(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o> 6]; var primitive = (tag & 0x20) === 0; // Multi-octet tag - load if ((tag & 0x1f) === 0x1f) { var oct = tag; tag = 0; while ((oct & 0x80) === 0x80) { oct = buf.readUInt8(fail); if (buf.isError(oct)) return oct; tag <<= 7; tag |= oct & 0x7f; } } else { tag &= 0x1f; } var tagStr = der.tag[tag]; return { cls: cls, primitive: primitive, tag: tag, tagStr: tagStr }; } function derDecodeLen(buf, primitive, fail) { var len = buf.readUInt8(fail); if (buf.isError(len)) return len; // Indefinite form if (!primitive && len === 0x80) return null; // Definite form if ((len & 0x80) === 0) { // Short form return len; } // Long form var num = len & 0x7f; if (num >= 4) return buf.error('length octect is too long'); len = 0; for (var i = 0; i < num; i++) { len <<= 8; var j = buf.readUInt8(fail); if (buf.isError(j)) return j; len |= j; } return len; } },{"../../asn1":2,"inherits":95}],11:[function(require,module,exports){ var decoders = exports; decoders.der = require('./der'); decoders.pem = require('./pem'); },{"./der":10,"./pem":12}],12:[function(require,module,exports){ var inherits = require('inherits'); var Buffer = require('buffer').Buffer; var DERDecoder = require('./der'); function PEMDecoder(entity) { DERDecoder.call(this, entity); this.enc = 'pem'; }; inherits(PEMDecoder, DERDecoder); module.exports = PEMDecoder; PEMDecoder.prototype.decode = function decode(data, options) { var lines = data.toString().split(/[\r\n]+/g); var label = options.label.toUpperCase(); var re = /^-----(BEGIN|END) ([^-]+)-----$/; var start = -1; var end = -1; for (var i = 0; i < lines.length; i++) { var match = lines[i].match(re); if (match === null) continue; if (match[2] !== label) continue; if (start === -1) { if (match[1] !== 'BEGIN') break; start = i; } else { if (match[1] !== 'END') break; end = i; break; } } if (start === -1 || end === -1) throw new Error('PEM section not found for: ' + label); var base64 = lines.slice(start + 1, end).join(''); // Remove excessive symbols base64.replace(/[^a-z0-9\+\/=]+/gi, ''); var input = new Buffer(base64, 'base64'); return DERDecoder.prototype.decode.call(this, input, options); }; },{"./der":10,"buffer":47,"inherits":95}],13:[function(require,module,exports){ var inherits = require('inherits'); var Buffer = require('buffer').Buffer; var asn1 = require('../../asn1'); var base = asn1.base; // Import DER constants var der = asn1.constants.der; function DEREncoder(entity) { this.enc = 'der'; this.name = entity.name; this.entity = entity; // Construct base tree this.tree = new DERNode(); this.tree._init(entity.body); }; module.exports = DEREncoder; DEREncoder.prototype.encode = function encode(data, reporter) { return this.tree._encode(data, reporter).join(); }; // Tree methods function DERNode(parent) { base.Node.call(this, 'der', parent); } inherits(DERNode, base.Node); DERNode.prototype._encodeComposite = function encodeComposite(tag, primitive, cls, content) { var encodedTag = encodeTag(tag, primitive, cls, this.reporter); // Short form if (content.length < 0x80) { var header = new Buffer(2); header[0] = encodedTag; header[1] = content.length; return this._createEncoderBuffer([ header, content ]); } // Long form // Count octets required to store length var lenOctets = 1; for (var i = content.length; i >= 0x100; i >>= 8) lenOctets++; var header = new Buffer(1 + 1 + lenOctets); header[0] = encodedTag; header[1] = 0x80 | lenOctets; for (var i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8) header[i] = j & 0xff; return this._createEncoderBuffer([ header, content ]); }; DERNode.prototype._encodeStr = function encodeStr(str, tag) { if (tag === 'bitstr') { return this._createEncoderBuffer([ str.unused | 0, str.data ]); } else if (tag === 'bmpstr') { var buf = new Buffer(str.length * 2); for (var i = 0; i < str.length; i++) { buf.writeUInt16BE(str.charCodeAt(i), i * 2); } return this._createEncoderBuffer(buf); } else if (tag === 'numstr') { if (!this._isNumstr(str)) { return this.reporter.error('Encoding of string type: numstr supports ' + 'only digits and space'); } return this._createEncoderBuffer(str); } else if (tag === 'printstr') { if (!this._isPrintstr(str)) { return this.reporter.error('Encoding of string type: printstr supports ' + 'only latin upper and lower case letters, ' + 'digits, space, apostrophe, left and rigth ' + 'parenthesis, plus sign, comma, hyphen, ' + 'dot, slash, colon, equal sign, ' + 'question mark'); } return this._createEncoderBuffer(str); } else if (/str$/.test(tag)) { return this._createEncoderBuffer(str); } else { return this.reporter.error('Encoding of string type: ' + tag + ' unsupported'); } }; DERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) { if (typeof id === 'string') { if (!values) return this.reporter.error('string objid given, but no values map found'); if (!values.hasOwnProperty(id)) return this.reporter.error('objid not found in values map'); id = values[id].split(/[\s\.]+/g); for (var i = 0; i < id.length; i++) id[i] |= 0; } else if (Array.isArray(id)) { id = id.slice(); for (var i = 0; i < id.length; i++) id[i] |= 0; } if (!Array.isArray(id)) { return this.reporter.error('objid() should be either array or string, ' + 'got: ' + JSON.stringify(id)); } if (!relative) { if (id[1] >= 40) return this.reporter.error('Second objid identifier OOB'); id.splice(0, 2, id[0] * 40 + id[1]); } // Count number of octets var size = 0; for (var i = 0; i < id.length; i++) { var ident = id[i]; for (size++; ident >= 0x80; ident >>= 7) size++; } var objid = new Buffer(size); var offset = objid.length - 1; for (var i = id.length - 1; i >= 0; i--) { var ident = id[i]; objid[offset--] = ident & 0x7f; while ((ident >>= 7) > 0) objid[offset--] = 0x80 | (ident & 0x7f); } return this._createEncoderBuffer(objid); }; function two(num) { if (num < 10) return '0' + num; else return num; } DERNode.prototype._encodeTime = function encodeTime(time, tag) { var str; var date = new Date(time); if (tag === 'gentime') { str = [ two(date.getFullYear()), two(date.getUTCMonth() + 1), two(date.getUTCDate()), two(date.getUTCHours()), two(date.getUTCMinutes()), two(date.getUTCSeconds()), 'Z' ].join(''); } else if (tag === 'utctime') { str = [ two(date.getFullYear() % 100), two(date.getUTCMonth() + 1), two(date.getUTCDate()), two(date.getUTCHours()), two(date.getUTCMinutes()), two(date.getUTCSeconds()), 'Z' ].join(''); } else { this.reporter.error('Encoding ' + tag + ' time is not supported yet'); } return this._encodeStr(str, 'octstr'); }; DERNode.prototype._encodeNull = function encodeNull() { return this._createEncoderBuffer(''); }; DERNode.prototype._encodeInt = function encodeInt(num, values) { if (typeof num === 'string') { if (!values) return this.reporter.error('String int or enum given, but no values map'); if (!values.hasOwnProperty(num)) { return this.reporter.error('Values map doesn\'t contain: ' + JSON.stringify(num)); } num = values[num]; } // Bignum, assume big endian if (typeof num !== 'number' && !Buffer.isBuffer(num)) { var numArray = num.toArray(); if (!num.sign && numArray[0] & 0x80) { numArray.unshift(0); } num = new Buffer(numArray); } if (Buffer.isBuffer(num)) { var size = num.length; if (num.length === 0) size++; var out = new Buffer(size); num.copy(out); if (num.length === 0) out[0] = 0 return this._createEncoderBuffer(out); } if (num < 0x80) return this._createEncoderBuffer(num); if (num < 0x100) return this._createEncoderBuffer([0, num]); var size = 1; for (var i = num; i >= 0x100; i >>= 8) size++; var out = new Array(size); for (var i = out.length - 1; i >= 0; i--) { out[i] = num & 0xff; num >>= 8; } if(out[0] & 0x80) { out.unshift(0); } return this._createEncoderBuffer(new Buffer(out)); }; DERNode.prototype._encodeBool = function encodeBool(value) { return this._createEncoderBuffer(value ? 0xff : 0); }; DERNode.prototype._use = function use(entity, obj) { if (typeof entity === 'function') entity = entity(obj); return entity._getEncoder('der').tree; }; DERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) { var state = this._baseState; var i; if (state['default'] === null) return false; var data = dataBuffer.join(); if (state.defaultBuffer === undefined) state.defaultBuffer = this._encodeValue(state['default'], reporter, parent).join(); if (data.length !== state.defaultBuffer.length) return false; for (i=0; i < data.length; i++) if (data[i] !== state.defaultBuffer[i]) return false; return true; }; // Utility methods function encodeTag(tag, primitive, cls, reporter) { var res; if (tag === 'seqof') tag = 'seq'; else if (tag === 'setof') tag = 'set'; if (der.tagByName.hasOwnProperty(tag)) res = der.tagByName[tag]; else if (typeof tag === 'number' && (tag | 0) === tag) res = tag; else return reporter.error('Unknown tag: ' + tag); if (res >= 0x1f) return reporter.error('Multi-octet tag encoding unsupported'); if (!primitive) res |= 0x20; res |= (der.tagClassByName[cls || 'universal'] << 6); return res; } },{"../../asn1":2,"buffer":47,"inherits":95}],14:[function(require,module,exports){ var encoders = exports; encoders.der = require('./der'); encoders.pem = require('./pem'); },{"./der":13,"./pem":15}],15:[function(require,module,exports){ var inherits = require('inherits'); var DEREncoder = require('./der'); function PEMEncoder(entity) { DEREncoder.call(this, entity); this.enc = 'pem'; }; inherits(PEMEncoder, DEREncoder); module.exports = PEMEncoder; PEMEncoder.prototype.encode = function encode(data, options) { var buf = DEREncoder.prototype.encode.call(this, data); var p = buf.toString('base64'); var out = [ '-----BEGIN ' + options.label + '-----' ]; for (var i = 0; i < p.length; i += 64) out.push(p.slice(i, i + 64)); out.push('-----END ' + options.label + '-----'); return out.join('\n'); }; },{"./der":13,"inherits":95}],16:[function(require,module,exports){ // http://wiki.commonjs.org/wiki/Unit_Testing/1.0 // // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! // // Originally from narwhal.js (http://narwhaljs.org) // Copyright (c) 2009 Thomas Robinson <280north.com> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the 'Software'), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // when used in node, this will actually load the util module we depend on // versus loading the builtin util module as happens otherwise // this is a bug in node module loading as far as I am concerned var util = require('util/'); var pSlice = Array.prototype.slice; var hasOwn = Object.prototype.hasOwnProperty; // 1. The assert module provides functions that throw // AssertionError's when particular conditions are not met. The // assert module must conform to the following interface. var assert = module.exports = ok; // 2. The AssertionError is defined in assert. // new assert.AssertionError({ message: message, // actual: actual, // expected: expected }) assert.AssertionError = function AssertionError(options) { this.name = 'AssertionError'; this.actual = options.actual; this.expected = options.expected; this.operator = options.operator; if (options.message) { this.message = options.message; this.generatedMessage = false; } else { this.message = getMessage(this); this.generatedMessage = true; } var stackStartFunction = options.stackStartFunction || fail; if (Error.captureStackTrace) { Error.captureStackTrace(this, stackStartFunction); } else { // non v8 browsers so we can have a stacktrace var err = new Error(); if (err.stack) { var out = err.stack; // try to strip useless frames var fn_name = stackStartFunction.name; var idx = out.indexOf('\n' + fn_name); if (idx >= 0) { // once we have located the function frame // we need to strip out everything before it (and its line) var next_line = out.indexOf('\n', idx + 1); out = out.substring(next_line + 1); } this.stack = out; } } }; // assert.AssertionError instanceof Error util.inherits(assert.AssertionError, Error); function replacer(key, value) { if (util.isUndefined(value)) { return '' + value; } if (util.isNumber(value) && !isFinite(value)) { return value.toString(); } if (util.isFunction(value) || util.isRegExp(value)) { return value.toString(); } return value; } function truncate(s, n) { if (util.isString(s)) { return s.length < n ? s : s.slice(0, n); } else { return s; } } function getMessage(self) { return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' + self.operator + ' ' + truncate(JSON.stringify(self.expected, replacer), 128); } // At present only the three keys mentioned above are used and // understood by the spec. Implementations or sub modules can pass // other keys to the AssertionError's constructor - they will be // ignored. // 3. All of the following functions must throw an AssertionError // when a corresponding condition is not met, with a message that // may be undefined if not provided. All assertion methods provide // both the actual and expected values to the assertion error for // display purposes. function fail(actual, expected, message, operator, stackStartFunction) { throw new assert.AssertionError({ message: message, actual: actual, expected: expected, operator: operator, stackStartFunction: stackStartFunction }); } // EXTENSION! allows for well behaved errors defined elsewhere. assert.fail = fail; // 4. Pure assertion tests whether a value is truthy, as determined // by !!guard. // assert.ok(guard, message_opt); // This statement is equivalent to assert.equal(true, !!guard, // message_opt);. To test strictly for the value true, use // assert.strictEqual(true, guard, message_opt);. function ok(value, message) { if (!value) fail(value, true, message, '==', assert.ok); } assert.ok = ok; // 5. The equality assertion tests shallow, coercive equality with // ==. // assert.equal(actual, expected, message_opt); assert.equal = function equal(actual, expected, message) { if (actual != expected) fail(actual, expected, message, '==', assert.equal); }; // 6. The non-equality assertion tests for whether two objects are not equal // with != assert.notEqual(actual, expected, message_opt); assert.notEqual = function notEqual(actual, expected, message) { if (actual == expected) { fail(actual, expected, message, '!=', assert.notEqual); } }; // 7. The equivalence assertion tests a deep equality relation. // assert.deepEqual(actual, expected, message_opt); assert.deepEqual = function deepEqual(actual, expected, message) { if (!_deepEqual(actual, expected)) { fail(actual, expected, message, 'deepEqual', assert.deepEqual); } }; function _deepEqual(actual, expected) { // 7.1. All identical values are equivalent, as determined by ===. if (actual === expected) { return true; } else if (util.isBuffer(actual) && util.isBuffer(expected)) { if (actual.length != expected.length) return false; for (var i = 0; i < actual.length; i++) { if (actual[i] !== expected[i]) return false; } return true; // 7.2. If the expected value is a Date object, the actual value is // equivalent if it is also a Date object that refers to the same time. } else if (util.isDate(actual) && util.isDate(expected)) { return actual.getTime() === expected.getTime(); // 7.3 If the expected value is a RegExp object, the actual value is // equivalent if it is also a RegExp object with the same source and // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`). } else if (util.isRegExp(actual) && util.isRegExp(expected)) { return actual.source === expected.source && actual.global === expected.global && actual.multiline === expected.multiline && actual.lastIndex === expected.lastIndex && actual.ignoreCase === expected.ignoreCase; // 7.4. Other pairs that do not both pass typeof value == 'object', // equivalence is determined by ==. } else if (!util.isObject(actual) && !util.isObject(expected)) { return actual == expected; // 7.5 For all other Object pairs, including Array objects, equivalence is // determined by having the same number of owned properties (as verified // with Object.prototype.hasOwnProperty.call), the same set of keys // (although not necessarily the same order), equivalent values for every // corresponding key, and an identical 'prototype' property. Note: this // accounts for both named and indexed properties on Arrays. } else { return objEquiv(actual, expected); } } function isArguments(object) { return Object.prototype.toString.call(object) == '[object Arguments]'; } function objEquiv(a, b) { if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b)) return false; // an identical 'prototype' property. if (a.prototype !== b.prototype) return false; // if one is a primitive, the other must be same if (util.isPrimitive(a) || util.isPrimitive(b)) { return a === b; } var aIsArgs = isArguments(a), bIsArgs = isArguments(b); if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) return false; if (aIsArgs) { a = pSlice.call(a); b = pSlice.call(b); return _deepEqual(a, b); } var ka = objectKeys(a), kb = objectKeys(b), key, i; // having the same number of owned properties (keys incorporates // hasOwnProperty) if (ka.length != kb.length) return false; //the same set of keys (although not necessarily the same order), ka.sort(); kb.sort(); //~~~cheap key test for (i = ka.length - 1; i >= 0; i--) { if (ka[i] != kb[i]) return false; } //equivalent values for every corresponding key, and //~~~possibly expensive deep test for (i = ka.length - 1; i >= 0; i--) { key = ka[i]; if (!_deepEqual(a[key], b[key])) return false; } return true; } // 8. The non-equivalence assertion tests for any deep inequality. // assert.notDeepEqual(actual, expected, message_opt); assert.notDeepEqual = function notDeepEqual(actual, expected, message) { if (_deepEqual(actual, expected)) { fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); } }; // 9. The strict equality assertion tests strict equality, as determined by ===. // assert.strictEqual(actual, expected, message_opt); assert.strictEqual = function strictEqual(actual, expected, message) { if (actual !== expected) { fail(actual, expected, message, '===', assert.strictEqual); } }; // 10. The strict non-equality assertion tests for strict inequality, as // determined by !==. assert.notStrictEqual(actual, expected, message_opt); assert.notStrictEqual = function notStrictEqual(actual, expected, message) { if (actual === expected) { fail(actual, expected, message, '!==', assert.notStrictEqual); } }; function expectedException(actual, expected) { if (!actual || !expected) { return false; } if (Object.prototype.toString.call(expected) == '[object RegExp]') { return expected.test(actual); } else if (actual instanceof expected) { return true; } else if (expected.call({}, actual) === true) { return true; } return false; } function _throws(shouldThrow, block, expected, message) { var actual; if (util.isString(expected)) { message = expected; expected = null; } try { block(); } catch (e) { actual = e; } message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + (message ? ' ' + message : '.'); if (shouldThrow && !actual) { fail(actual, expected, 'Missing expected exception' + message); } if (!shouldThrow && expectedException(actual, expected)) { fail(actual, expected, 'Got unwanted exception' + message); } if ((shouldThrow && actual && expected && !expectedException(actual, expected)) || (!shouldThrow && actual)) { throw actual; } } // 11. Expected to throw an error: // assert.throws(block, Error_opt, message_opt); assert.throws = function(block, /*optional*/error, /*optional*/message) { _throws.apply(this, [true].concat(pSlice.call(arguments))); }; // EXTENSION! This is annoying to write outside this module. assert.doesNotThrow = function(block, /*optional*/message) { _throws.apply(this, [false].concat(pSlice.call(arguments))); }; assert.ifError = function(err) { if (err) {throw err;}}; var objectKeys = Object.keys || function (obj) { var keys = []; for (var key in obj) { if (hasOwn.call(obj, key)) keys.push(key); } return keys; }; },{"util/":150}],17:[function(require,module,exports){ 'use strict' exports.toByteArray = toByteArray exports.fromByteArray = fromByteArray var lookup = [] var revLookup = [] var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array function init () { var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' for (var i = 0, len = code.length; i < len; ++i) { lookup[i] = code[i] revLookup[code.charCodeAt(i)] = i } revLookup['-'.charCodeAt(0)] = 62 revLookup['_'.charCodeAt(0)] = 63 } init() function toByteArray (b64) { var i, j, l, tmp, placeHolders, arr var len = b64.length if (len % 4 > 0) { throw new Error('Invalid string. Length must be a multiple of 4') } // the number of equal signs (place holders) // if there are two placeholders, than the two characters before it // represent one byte // if there is only one, then the three characters before it represent 2 bytes // this is just a cheap hack to not do indexOf twice placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0 // base64 is 4/3 + up to two characters of the original data arr = new Arr(len * 3 / 4 - placeHolders) // if there are placeholders, only get up to the last complete 4 chars l = placeHolders > 0 ? len - 4 : len var L = 0 for (i = 0, j = 0; i < l; i += 4, j += 3) { tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)] arr[L++] = (tmp >> 16) & 0xFF arr[L++] = (tmp >> 8) & 0xFF arr[L++] = tmp & 0xFF } if (placeHolders === 2) { tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) arr[L++] = tmp & 0xFF } else if (placeHolders === 1) { tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) arr[L++] = (tmp >> 8) & 0xFF arr[L++] = tmp & 0xFF } return arr } function tripletToBase64 (num) { return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] } function encodeChunk (uint8, start, end) { var tmp var output = [] for (var i = start; i < end; i += 3) { tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) output.push(tripletToBase64(tmp)) } return output.join('') } function fromByteArray (uint8) { var tmp var len = uint8.length var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes var output = '' var parts = [] var maxChunkLength = 16383 // must be multiple of 3 // go through the array every three bytes, we'll deal with trailing stuff later for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) } // pad the end with zeros, but make sure to not forget the extra bytes if (extraBytes === 1) { tmp = uint8[len - 1] output += lookup[tmp >> 2] output += lookup[(tmp << 4) & 0x3F] output += '==' } else if (extraBytes === 2) { tmp = (uint8[len - 2] << 8) + (uint8[len - 1]) output += lookup[tmp >> 10] output += lookup[(tmp >> 4) & 0x3F] output += lookup[(tmp << 2) & 0x3F] output += '=' } parts.push(output) return parts.join('') } },{}],18:[function(require,module,exports){ (function (module, exports) { 'use strict'; // 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 { Buffer = require('buf' + 'fer').Buffer; } catch (e) { } BN.isBN = function isBN (num) { return num !== null && typeof num === 'object' && num.constructor.name === 'BN' && 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++; } if (base === 16) { this._parseHex(number, start); } else { this._parseBase(number, base, start); } if (number[0] === '-') { this.negative = 1; } this.strip(); if (endian !== 'le') return; 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 parseHex (str, start, end) { var r = 0; var len = Math.min(str.length, end); for (var i = start; i < len; i++) { var c = str.charCodeAt(i) - 48; r <<= 4; // 'a' - 'f' if (c >= 49 && c <= 54) { r |= c - 49 + 0xa; // 'A' - 'F' } else if (c >= 17 && c <= 22) { r |= c - 17 + 0xa; // '0' - '9' } else { r |= c & 0xf; } } return r; } BN.prototype._parseHex = function _parseHex (number, start) { // 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; } var j, w; // Scan 24-bit chunks and add them to the number var off = 0; for (i = number.length - 6, j = 0; i >= start; i -= 6) { w = parseHex(number, i, i + 6); this.words[j] |= (w << off) & 0x3ffffff; // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; off += 24; if (off >= 26) { off -= 26; j++; } } if (i + 6 !== start) { w = parseHex(number, start, i + 6); this.words[j] |= (w << off) & 0x3ffffff; this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; } 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); } } }; 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 += Math.imul(ah0, bl0); hi = Math.imul(ah0, bh0); var w0 = c + lo + ((mid & 0x1fff) << 13); c = hi + (mid >>> 13) + (w0 >>> 26); w0 &= 0x3ffffff; /* k = 1 */ lo = Math.imul(al1, bl0); mid = Math.imul(al1, bh0); mid += Math.imul(ah1, bl0); hi = Math.imul(ah1, bh0); lo += Math.imul(al0, bl1); mid += Math.imul(al0, bh1); mid += Math.imul(ah0, bl1); hi += Math.imul(ah0, bh1); var w1 = c + lo + ((mid & 0x1fff) << 13); c = hi + (mid >>> 13) + (w1 >>> 26); w1 &= 0x3ffffff; /* k = 2 */ lo = Math.imul(al2, bl0); mid = Math.imul(al2, bh0); mid += Math.imul(ah2, bl0); hi = Math.imul(ah2, bh0); lo += Math.imul(al1, bl1); mid += Math.imul(al1, bh1); mid += Math.imul(ah1, bl1); hi += Math.imul(ah1, bh1); lo += Math.imul(al0, bl2); mid += Math.imul(al0, bh2); mid += Math.imul(ah0, bl2); hi += Math.imul(ah0, bh2); var w2 = c + lo + ((mid & 0x1fff) << 13); c = hi + (mid >>> 13) + (w2 >>> 26); w2 &= 0x3ffffff; /* k = 3 */ lo = Math.imul(al3, bl0); mid = Math.imul(al3, bh0); mid += Math.imul(ah3, bl0); hi = Math.imul(ah3, bh0); lo += Math.imul(al2, bl1); mid += Math.imul(al2, bh1); mid += Math.imul(ah2, bl1); hi += Math.imul(ah2, bh1); lo += Math.imul(al1, bl2); mid += Math.imul(al1, bh2); mid += Math.imul(ah1, bl2); hi += Math.imul(ah1, bh2); lo += Math.imul(al0, bl3); mid += Math.imul(al0, bh3); mid += Math.imul(ah0, bl3); hi += Math.imul(ah0, bh3); var w3 = c + lo + ((mid & 0x1fff) << 13); c = hi + (mid >>> 13) + (w3 >>> 26); w3 &= 0x3ffffff; /* k = 4 */ lo = Math.imul(al4, bl0); mid = Math.imul(al4, bh0); mid += Math.imul(ah4, bl0); hi = Math.imul(ah4, bh0); lo += Math.imul(al3, bl1); mid += Math.imul(al3, bh1); mid += Math.imul(ah3, bl1); hi += Math.imul(ah3, bh1); lo += Math.imul(al2, bl2); mid += Math.imul(al2, bh2); mid += Math.imul(ah2, bl2); hi += Math.imul(ah2, bh2); lo += Math.imul(al1, bl3); mid += Math.imul(al1, bh3); mid += Math.imul(ah1, bl3); hi += Math.imul(ah1, bh3); lo += Math.imul(al0, bl4); mid += Math.imul(al0, bh4); mid += Math.imul(ah0, bl4); hi += Math.imul(ah0, bh4); var w4 = c + lo + ((mid & 0x1fff) << 13); c = hi + (mid >>> 13) + (w4 >>> 26); w4 &= 0x3ffffff; /* k = 5 */ lo = Math.imul(al5, bl0); mid = Math.imul(al5, bh0); mid += Math.imul(ah5, bl0); hi = Math.imul(ah5, bh0); lo += Math.imul(al4, bl1); mid += Math.imul(al4, bh1); mid += Math.imul(ah4, bl1); hi += Math.imul(ah4, bh1); lo += Math.imul(al3, bl2); mid += Math.imul(al3, bh2); mid += Math.imul(ah3, bl2); hi += Math.imul(ah3, bh2); lo += Math.imul(al2, bl3); mid += Math.imul(al2, bh3); mid += Math.imul(ah2, bl3); hi += Math.imul(ah2, bh3); lo += Math.imul(al1, bl4); mid += Math.imul(al1, bh4); mid += Math.imul(ah1, bl4); hi += Math.imul(ah1, bh4); lo += Math.imul(al0, bl5); mid += Math.imul(al0, bh5); mid += Math.imul(ah0, bl5); hi += Math.imul(ah0, bh5); var w5 = c + lo + ((mid & 0x1fff) << 13); c = hi + (mid >>> 13) + (w5 >>> 26); w5 &= 0x3ffffff; /* k = 6 */ lo = Math.imul(al6, bl0); mid = Math.imul(al6, bh0); mid += Math.imul(ah6, bl0); hi = Math.imul(ah6, bh0); lo += Math.imul(al5, bl1); mid += Math.imul(al5, bh1); mid += Math.imul(ah5, bl1); hi += Math.imul(ah5, bh1); lo += Math.imul(al4, bl2); mid += Math.imul(al4, bh2); mid += Math.imul(ah4, bl2); hi += Math.imul(ah4, bh2); lo += Math.imul(al3, bl3); mid += Math.imul(al3, bh3); mid += Math.imul(ah3, bl3); hi += Math.imul(ah3, bh3); lo += Math.imul(al2, bl4); mid += Math.imul(al2, bh4); mid += Math.imul(ah2, bl4); hi += Math.imul(ah2, bh4); lo += Math.imul(al1, bl5); mid += Math.imul(al1, bh5); mid += Math.imul(ah1, bl5); hi += Math.imul(ah1, bh5); lo += Math.imul(al0, bl6); mid += Math.imul(al0, bh6); mid += Math.imul(ah0, bl6); hi += Math.imul(ah0, bh6); var w6 = c + lo + ((mid & 0x1fff) << 13); c = hi + (mid >>> 13) + (w6 >>> 26); w6 &= 0x3ffffff; /* k = 7 */ lo = Math.imul(al7, bl0); mid = Math.imul(al7, bh0); mid += Math.imul(ah7, bl0); hi = Math.imul(ah7, bh0); lo += Math.imul(al6, bl1); mid += Math.imul(al6, bh1); mid += Math.imul(ah6, bl1); hi += Math.imul(ah6, bh1); lo += Math.imul(al5, bl2); mid += Math.imul(al5, bh2); mid += Math.imul(ah5, bl2); hi += Math.imul(ah5, bh2); lo += Math.imul(al4, bl3); mid += Math.imul(al4, bh3); mid += Math.imul(ah4, bl3); hi += Math.imul(ah4, bh3); lo += Math.imul(al3, bl4); mid += Math.imul(al3, bh4); mid += Math.imul(ah3, bl4); hi += Math.imul(ah3, bh4); lo += Math.imul(al2, bl5); mid += Math.imul(al2, bh5); mid += Math.imul(ah2, bl5); hi += Math.imul(ah2, bh5); lo += Math.imul(al1, bl6); mid += Math.imul(al1, bh6); mid += Math.imul(ah1, bl6); hi += Math.imul(ah1, bh6); lo += Math.imul(al0, bl7); mid += Math.imul(al0, bh7); mid += Math.imul(ah0, bl7); hi += Math.imul(ah0, bh7); var w7 = c + lo + ((mid & 0x1fff) << 13); c = hi + (mid >>> 13) + (w7 >>> 26); w7 &= 0x3ffffff; /* k = 8 */ lo = Math.imul(al8, bl0); mid = Math.imul(al8, bh0); mid += Math.imul(ah8, bl0); hi = Math.imul(ah8, bh0); lo += Math.imul(al7, bl1); mid += Math.imul(al7, bh1); mid += Math.imul(ah7, bl1); hi += Math.imul(ah7, bh1); lo += Math.imul(al6, bl2); mid += Math.imul(al6, bh2); mid += Math.imul(ah6, bl2); hi += Math.imul(ah6, bh2); lo += Math.imul(al5, bl3); mid += Math.imul(al5, bh3); mid += Math.imul(ah5, bl3); hi += Math.imul(ah5, bh3); lo += Math.imul(al4, bl4); mid += Math.imul(al4, bh4); mid += Math.imul(ah4, bl4); hi += Math.imul(ah4, bh4); lo += Math.imul(al3, bl5); mid += Math.imul(al3, bh5); mid += Math.imul(ah3, bl5); hi += Math.imul(ah3, bh5); lo += Math.imul(al2, bl6); mid += Math.imul(al2, bh6); mid += Math.imul(ah2, bl6); hi += Math.imul(ah2, bh6); lo += Math.imul(al1, bl7); mid += Math.imul(al1, bh7); mid += Math.imul(ah1, bl7); hi += Math.imul(ah1, bh7); lo += Math.imul(al0, bl8); mid += Math.imul(al0, bh8); mid += Math.imul(ah0, bl8); hi += Math.imul(ah0, bh8); var w8 = c + lo + ((mid & 0x1fff) << 13); c = hi + (mid >>> 13) + (w8 >>> 26); w8 &= 0x3ffffff; /* k = 9 */ lo = Math.imul(al9, bl0); mid = Math.imul(al9, bh0); mid += Math.imul(ah9, bl0); hi = Math.imul(ah9, bh0); lo += Math.imul(al8, bl1); mid += Math.imul(al8, bh1); mid += Math.imul(ah8, bl1); hi += Math.imul(ah8, bh1); lo += Math.imul(al7, bl2); mid += Math.imul(al7, bh2); mid += Math.imul(ah7, bl2); hi += Math.imul(ah7, bh2); lo += Math.imul(al6, bl3); mid += Math.imul(al6, bh3); mid += Math.imul(ah6, bl3); hi += Math.imul(ah6, bh3); lo += Math.imul(al5, bl4); mid += Math.imul(al5, bh4); mid += Math.imul(ah5, bl4); hi += Math.imul(ah5, bh4); lo += Math.imul(al4, bl5); mid += Math.imul(al4, bh5); mid += Math.imul(ah4, bl5); hi += Math.imul(ah4, bh5); lo += Math.imul(al3, bl6); mid += Math.imul(al3, bh6); mid += Math.imul(ah3, bl6); hi += Math.imul(ah3, bh6); lo += Math.imul(al2, bl7); mid += Math.imul(al2, bh7); mid += Math.imul(ah2, bl7); hi += Math.imul(ah2, bh7); lo += Math.imul(al1, bl8); mid += Math.imul(al1, bh8); mid += Math.imul(ah1, bl8); hi += Math.imul(ah1, bh8); lo += Math.imul(al0, bl9); mid += Math.imul(al0, bh9); mid += Math.imul(ah0, bl9); hi += Math.imul(ah0, bh9); var w9 = c + lo + ((mid & 0x1fff) << 13); c = hi + (mid >>> 13) + (w9 >>> 26); w9 &= 0x3ffffff; /* k = 10 */ lo = Math.imul(al9, bl1); mid = Math.imul(al9, bh1); mid += Math.imul(ah9, bl1); hi = Math.imul(ah9, bh1); lo += Math.imul(al8, bl2); mid += Math.imul(al8, bh2); mid += Math.imul(ah8, bl2); hi += Math.imul(ah8, bh2); lo += Math.imul(al7, bl3); mid += Math.imul(al7, bh3); mid += Math.imul(ah7, bl3); hi += Math.imul(ah7, bh3); lo += Math.imul(al6, bl4); mid += Math.imul(al6, bh4); mid += Math.imul(ah6, bl4); hi += Math.imul(ah6, bh4); lo += Math.imul(al5, bl5); mid += Math.imul(al5, bh5); mid += Math.imul(ah5, bl5); hi += Math.imul(ah5, bh5); lo += Math.imul(al4, bl6); mid += Math.imul(al4, bh6); mid += Math.imul(ah4, bl6); hi += Math.imul(ah4, bh6); lo += Math.imul(al3, bl7); mid += Math.imul(al3, bh7); mid += Math.imul(ah3, bl7); hi += Math.imul(ah3, bh7); lo += Math.imul(al2, bl8); mid += Math.imul(al2, bh8); mid += Math.imul(ah2, bl8); hi += Math.imul(ah2, bh8); lo += Math.imul(al1, bl9); mid += Math.imul(al1, bh9); mid += Math.imul(ah1, bl9); hi += Math.imul(ah1, bh9); var w10 = c + lo + ((mid & 0x1fff) << 13); c = hi + (mid >>> 13) + (w10 >>> 26); w10 &= 0x3ffffff; /* k = 11 */ lo = Math.imul(al9, bl2); mid = Math.imul(al9, bh2); mid += Math.imul(ah9, bl2); hi = Math.imul(ah9, bh2); lo += Math.imul(al8, bl3); mid += Math.imul(al8, bh3); mid += Math.imul(ah8, bl3); hi += Math.imul(ah8, bh3); lo += Math.imul(al7, bl4); mid += Math.imul(al7, bh4); mid += Math.imul(ah7, bl4); hi += Math.imul(ah7, bh4); lo += Math.imul(al6, bl5); mid += Math.imul(al6, bh5); mid += Math.imul(ah6, bl5); hi += Math.imul(ah6, bh5); lo += Math.imul(al5, bl6); mid += Math.imul(al5, bh6); mid += Math.imul(ah5, bl6); hi += Math.imul(ah5, bh6); lo += Math.imul(al4, bl7); mid += Math.imul(al4, bh7); mid += Math.imul(ah4, bl7); hi += Math.imul(ah4, bh7); lo += Math.imul(al3, bl8); mid += Math.imul(al3, bh8); mid += Math.imul(ah3, bl8); hi += Math.imul(ah3, bh8); lo += Math.imul(al2, bl9); mid += Math.imul(al2, bh9); mid += Math.imul(ah2, bl9); hi += Math.imul(ah2, bh9); var w11 = c + lo + ((mid & 0x1fff) << 13); c = hi + (mid >>> 13) + (w11 >>> 26); w11 &= 0x3ffffff; /* k = 12 */ lo = Math.imul(al9, bl3); mid = Math.imul(al9, bh3); mid += Math.imul(ah9, bl3); hi = Math.imul(ah9, bh3); lo += Math.imul(al8, bl4); mid += Math.imul(al8, bh4); mid += Math.imul(ah8, bl4); hi += Math.imul(ah8, bh4); lo += Math.imul(al7, bl5); mid += Math.imul(al7, bh5); mid += Math.imul(ah7, bl5); hi += Math.imul(ah7, bh5); lo += Math.imul(al6, bl6); mid += Math.imul(al6, bh6); mid += Math.imul(ah6, bl6); hi += Math.imul(ah6, bh6); lo += Math.imul(al5, bl7); mid += Math.imul(al5, bh7); mid += Math.imul(ah5, bl7); hi += Math.imul(ah5, bh7); lo += Math.imul(al4, bl8); mid += Math.imul(al4, bh8); mid += Math.imul(ah4, bl8); hi += Math.imul(ah4, bh8); lo += Math.imul(al3, bl9); mid += Math.imul(al3, bh9); mid += Math.imul(ah3, bl9); hi += Math.imul(ah3, bh9); var w12 = c + lo + ((mid & 0x1fff) << 13); c = hi + (mid >>> 13) + (w12 >>> 26); w12 &= 0x3ffffff; /* k = 13 */ lo = Math.imul(al9, bl4); mid = Math.imul(al9, bh4); mid += Math.imul(ah9, bl4); hi = Math.imul(ah9, bh4); lo += Math.imul(al8, bl5); mid += Math.imul(al8, bh5); mid += Math.imul(ah8, bl5); hi += Math.imul(ah8, bh5); lo += Math.imul(al7, bl6); mid += Math.imul(al7, bh6); mid += Math.imul(ah7, bl6); hi += Math.imul(ah7, bh6); lo += Math.imul(al6, bl7); mid += Math.imul(al6, bh7); mid += Math.imul(ah6, bl7); hi += Math.imul(ah6, bh7); lo += Math.imul(al5, bl8); mid += Math.imul(al5, bh8); mid += Math.imul(ah5, bl8); hi += Math.imul(ah5, bh8); lo += Math.imul(al4, bl9); mid += Math.imul(al4, bh9); mid += Math.imul(ah4, bl9); hi += Math.imul(ah4, bh9); var w13 = c + lo + ((mid & 0x1fff) << 13); c = hi + (mid >>> 13) + (w13 >>> 26); w13 &= 0x3ffffff; /* k = 14 */ lo = Math.imul(al9, bl5); mid = Math.imul(al9, bh5); mid += Math.imul(ah9, bl5); hi = Math.imul(ah9, bh5); lo += Math.imul(al8, bl6); mid += Math.imul(al8, bh6); mid += Math.imul(ah8, bl6); hi += Math.imul(ah8, bh6); lo += Math.imul(al7, bl7); mid += Math.imul(al7, bh7); mid += Math.imul(ah7, bl7); hi += Math.imul(ah7, bh7); lo += Math.imul(al6, bl8); mid += Math.imul(al6, bh8); mid += Math.imul(ah6, bl8); hi += Math.imul(ah6, bh8); lo += Math.imul(al5, bl9); mid += Math.imul(al5, bh9); mid += Math.imul(ah5, bl9); hi += Math.imul(ah5, bh9); var w14 = c + lo + ((mid & 0x1fff) << 13); c = hi + (mid >>> 13) + (w14 >>> 26); w14 &= 0x3ffffff; /* k = 15 */ lo = Math.imul(al9, bl6); mid = Math.imul(al9, bh6); mid += Math.imul(ah9, bl6); hi = Math.imul(ah9, bh6); lo += Math.imul(al8, bl7); mid += Math.imul(al8, bh7); mid += Math.imul(ah8, bl7); hi += Math.imul(ah8, bh7); lo += Math.imul(al7, bl8); mid += Math.imul(al7, bh8); mid += Math.imul(ah7, bl8); hi += Math.imul(ah7, bh8); lo += Math.imul(al6, bl9); mid += Math.imul(al6, bh9); mid += Math.imul(ah6, bl9); hi += Math.imul(ah6, bh9); var w15 = c + lo + ((mid & 0x1fff) << 13); c = hi + (mid >>> 13) + (w15 >>> 26); w15 &= 0x3ffffff; /* k = 16 */ lo = Math.imul(al9, bl7); mid = Math.imul(al9, bh7); mid += Math.imul(ah9, bl7); hi = Math.imul(ah9, bh7); lo += Math.imul(al8, bl8); mid += Math.imul(al8, bh8); mid += Math.imul(ah8, bl8); hi += Math.imul(ah8, bh8); lo += Math.imul(al7, bl9); mid += Math.imul(al7, bh9); mid += Math.imul(ah7, bl9); hi += Math.imul(ah7, bh9); var w16 = c + lo + ((mid & 0x1fff) << 13); c = hi + (mid >>> 13) + (w16 >>> 26); w16 &= 0x3ffffff; /* k = 17 */ lo = Math.imul(al9, bl8); mid = Math.imul(al9, bh8); mid += Math.imul(ah9, bl8); hi = Math.imul(ah9, bh8); lo += Math.imul(al8, bl9); mid += Math.imul(al8, bh9); mid += Math.imul(ah8, bl9); hi += Math.imul(ah8, bh9); var w17 = c + lo + ((mid & 0x1fff) << 13); c = hi + (mid >>> 13) + (w17 >>> 26); w17 &= 0x3ffffff; /* k = 18 */ lo = Math.imul(al9, bl9); mid = Math.imul(al9, bh9); mid += Math.imul(ah9, bl9); hi = Math.imul(ah9, bh9); var w18 = c + lo + ((mid & 0x1fff) << 13); c = hi + (mid >>> 13) + (w18 >>> 26); 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) { // No-op, we should not move anything at all } 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 (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 { 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); 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); }; })(typeof module === 'undefined' || module, this); },{}],19:[function(require,module,exports){ var r; module.exports = function rand(len) { if (!r) r = new Rand(null); return r.generate(len); }; function Rand(rand) { this.rand = rand; } module.exports.Rand = Rand; Rand.prototype.generate = function generate(len) { return this._rand(len); }; if (typeof window === 'object') { if (window.crypto && window.crypto.getRandomValues) { // Modern browsers Rand.prototype._rand = function _rand(n) { var arr = new Uint8Array(n); window.crypto.getRandomValues(arr); return arr; }; } else if (window.msCrypto && window.msCrypto.getRandomValues) { // IE Rand.prototype._rand = function _rand(n) { var arr = new Uint8Array(n); window.msCrypto.getRandomValues(arr); return arr; }; } else { // Old junk Rand.prototype._rand = function() { throw new Error('Not implemented yet'); }; } } else { // Node.js or Web worker try { var crypto = require('cry' + 'pto'); Rand.prototype._rand = function _rand(n) { return crypto.randomBytes(n); }; } catch (e) { // Emulate crypto API using randy Rand.prototype._rand = function _rand(n) { var res = new Uint8Array(n); for (var i = 0; i < res.length; i++) res[i] = this.rand.getByte(); return res; }; } } },{}],20:[function(require,module,exports){ arguments[4][1][0].apply(exports,arguments) },{"dup":1}],21:[function(require,module,exports){ (function (Buffer){ // based on the aes implimentation in triple sec // https://github.com/keybase/triplesec // which is in turn based on the one from crypto-js // https://code.google.com/p/crypto-js/ var uint_max = Math.pow(2, 32) function fixup_uint32 (x) { var ret, x_pos ret = x > uint_max || x < 0 ? (x_pos = Math.abs(x) % uint_max, x < 0 ? uint_max - x_pos : x_pos) : x return ret } function scrub_vec (v) { for (var i = 0; i < v.length; v++) { v[i] = 0 } return false } function Global () { this.SBOX = [] this.INV_SBOX = [] this.SUB_MIX = [[], [], [], []] this.INV_SUB_MIX = [[], [], [], []] this.init() this.RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36] } Global.prototype.init = function () { var d, i, sx, t, x, x2, x4, x8, xi, _i d = (function () { var _i, _results _results = [] for (i = _i = 0; _i < 256; i = ++_i) { if (i < 128) { _results.push(i << 1) } else { _results.push((i << 1) ^ 0x11b) } } return _results })() x = 0 xi = 0 for (i = _i = 0; _i < 256; i = ++_i) { sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4) sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63 this.SBOX[x] = sx this.INV_SBOX[sx] = x x2 = d[x] x4 = d[x2] x8 = d[x4] t = (d[sx] * 0x101) ^ (sx * 0x1010100) this.SUB_MIX[0][x] = (t << 24) | (t >>> 8) this.SUB_MIX[1][x] = (t << 16) | (t >>> 16) this.SUB_MIX[2][x] = (t << 8) | (t >>> 24) this.SUB_MIX[3][x] = t t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100) this.INV_SUB_MIX[0][sx] = (t << 24) | (t >>> 8) this.INV_SUB_MIX[1][sx] = (t << 16) | (t >>> 16) this.INV_SUB_MIX[2][sx] = (t << 8) | (t >>> 24) this.INV_SUB_MIX[3][sx] = t if (x === 0) { x = xi = 1 } else { x = x2 ^ d[d[d[x8 ^ x2]]] xi ^= d[d[xi]] } } return true } var G = new Global() AES.blockSize = 4 * 4 AES.prototype.blockSize = AES.blockSize AES.keySize = 256 / 8 AES.prototype.keySize = AES.keySize function bufferToArray (buf) { var len = buf.length / 4 var out = new Array(len) var i = -1 while (++i < len) { out[i] = buf.readUInt32BE(i * 4) } return out } function AES (key) { this._key = bufferToArray(key) this._doReset() } AES.prototype._doReset = function () { var invKsRow, keySize, keyWords, ksRow, ksRows, t keyWords = this._key keySize = keyWords.length this._nRounds = keySize + 6 ksRows = (this._nRounds + 1) * 4 this._keySchedule = [] for (ksRow = 0; ksRow < ksRows; ksRow++) { this._keySchedule[ksRow] = ksRow < keySize ? keyWords[ksRow] : (t = this._keySchedule[ksRow - 1], (ksRow % keySize) === 0 ? (t = (t << 8) | (t >>> 24), t = (G.SBOX[t >>> 24] << 24) | (G.SBOX[(t >>> 16) & 0xff] << 16) | (G.SBOX[(t >>> 8) & 0xff] << 8) | G.SBOX[t & 0xff], t ^= G.RCON[(ksRow / keySize) | 0] << 24) : keySize > 6 && ksRow % keySize === 4 ? t = (G.SBOX[t >>> 24] << 24) | (G.SBOX[(t >>> 16) & 0xff] << 16) | (G.SBOX[(t >>> 8) & 0xff] << 8) | G.SBOX[t & 0xff] : void 0, this._keySchedule[ksRow - keySize] ^ t) } this._invKeySchedule = [] for (invKsRow = 0; invKsRow < ksRows; invKsRow++) { ksRow = ksRows - invKsRow t = this._keySchedule[ksRow - (invKsRow % 4 ? 0 : 4)] this._invKeySchedule[invKsRow] = invKsRow < 4 || ksRow <= 4 ? t : G.INV_SUB_MIX[0][G.SBOX[t >>> 24]] ^ G.INV_SUB_MIX[1][G.SBOX[(t >>> 16) & 0xff]] ^ G.INV_SUB_MIX[2][G.SBOX[(t >>> 8) & 0xff]] ^ G.INV_SUB_MIX[3][G.SBOX[t & 0xff]] } return true } AES.prototype.encryptBlock = function (M) { M = bufferToArray(new Buffer(M)) var out = this._doCryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX) var buf = new Buffer(16) buf.writeUInt32BE(out[0], 0) buf.writeUInt32BE(out[1], 4) buf.writeUInt32BE(out[2], 8) buf.writeUInt32BE(out[3], 12) return buf } AES.prototype.decryptBlock = function (M) { M = bufferToArray(new Buffer(M)) var temp = [M[3], M[1]] M[1] = temp[0] M[3] = temp[1] var out = this._doCryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX) var buf = new Buffer(16) buf.writeUInt32BE(out[0], 0) buf.writeUInt32BE(out[3], 4) buf.writeUInt32BE(out[2], 8) buf.writeUInt32BE(out[1], 12) return buf } AES.prototype.scrub = function () { scrub_vec(this._keySchedule) scrub_vec(this._invKeySchedule) scrub_vec(this._key) } AES.prototype._doCryptBlock = function (M, keySchedule, SUB_MIX, SBOX) { var ksRow, s0, s1, s2, s3, t0, t1, t2, t3 s0 = M[0] ^ keySchedule[0] s1 = M[1] ^ keySchedule[1] s2 = M[2] ^ keySchedule[2] s3 = M[3] ^ keySchedule[3] ksRow = 4 for (var round = 1; round < this._nRounds; round++) { 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++] 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++] 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++] 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++] s0 = t0 s1 = t1 s2 = t2 s3 = t3 } t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++] t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++] t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++] t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++] return [ fixup_uint32(t0), fixup_uint32(t1), fixup_uint32(t2), fixup_uint32(t3) ] } exports.AES = AES }).call(this,require("buffer").Buffer) },{"buffer":47}],22:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') var inherits = require('inherits') var GHASH = require('./ghash') var xor = require('buffer-xor') inherits(StreamCipher, Transform) module.exports = StreamCipher function StreamCipher (mode, key, iv, decrypt) { if (!(this instanceof StreamCipher)) { return new StreamCipher(mode, key, iv) } Transform.call(this) this._finID = Buffer.concat([iv, new Buffer([0, 0, 0, 1])]) iv = Buffer.concat([iv, new Buffer([0, 0, 0, 2])]) this._cipher = new aes.AES(key) this._prev = new Buffer(iv.length) this._cache = new Buffer('') this._secCache = new Buffer('') this._decrypt = decrypt this._alen = 0 this._len = 0 iv.copy(this._prev) this._mode = mode var h = new Buffer(4) h.fill(0) this._ghash = new GHASH(this._cipher.encryptBlock(h)) this._authTag = null this._called = false } StreamCipher.prototype._update = function (chunk) { if (!this._called && this._alen) { var rump = 16 - (this._alen % 16) if (rump < 16) { rump = new Buffer(rump) rump.fill(0) this._ghash.update(rump) } } this._called = true var out = this._mode.encrypt(this, chunk) if (this._decrypt) { this._ghash.update(chunk) } else { this._ghash.update(out) } this._len += chunk.length return out } StreamCipher.prototype._final = function () { if (this._decrypt && !this._authTag) { throw new Error('Unsupported state or unable to authenticate data') } var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID)) if (this._decrypt) { if (xorTest(tag, this._authTag)) { throw new Error('Unsupported state or unable to authenticate data') } } else { this._authTag = tag } this._cipher.scrub() } StreamCipher.prototype.getAuthTag = function getAuthTag () { if (!this._decrypt && Buffer.isBuffer(this._authTag)) { return this._authTag } else { throw new Error('Attempting to get auth tag in unsupported state') } } StreamCipher.prototype.setAuthTag = function setAuthTag (tag) { if (this._decrypt) { this._authTag = tag } else { throw new Error('Attempting to set auth tag in unsupported state') } } StreamCipher.prototype.setAAD = function setAAD (buf) { if (!this._called) { this._ghash.update(buf) this._alen += buf.length } else { throw new Error('Attempting to set AAD in unsupported state') } } function xorTest (a, b) { var out = 0 if (a.length !== b.length) { out++ } var len = Math.min(a.length, b.length) var i = -1 while (++i < len) { out += (a[i] ^ b[i]) } return out } }).call(this,require("buffer").Buffer) },{"./aes":21,"./ghash":26,"buffer":47,"buffer-xor":46,"cipher-base":49,"inherits":95}],23:[function(require,module,exports){ var ciphers = require('./encrypter') exports.createCipher = exports.Cipher = ciphers.createCipher exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv var deciphers = require('./decrypter') exports.createDecipher = exports.Decipher = deciphers.createDecipher exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv var modes = require('./modes') function getCiphers () { return Object.keys(modes) } exports.listCiphers = exports.getCiphers = getCiphers },{"./decrypter":24,"./encrypter":25,"./modes":27}],24:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') var inherits = require('inherits') var modes = require('./modes') var StreamCipher = require('./streamCipher') var AuthCipher = require('./authCipher') var ebtk = require('evp_bytestokey') inherits(Decipher, Transform) function Decipher (mode, key, iv) { if (!(this instanceof Decipher)) { return new Decipher(mode, key, iv) } Transform.call(this) this._cache = new Splitter() this._last = void 0 this._cipher = new aes.AES(key) this._prev = new Buffer(iv.length) iv.copy(this._prev) this._mode = mode this._autopadding = true } Decipher.prototype._update = function (data) { this._cache.add(data) var chunk var thing var out = [] while ((chunk = this._cache.get(this._autopadding))) { thing = this._mode.decrypt(this, chunk) out.push(thing) } return Buffer.concat(out) } Decipher.prototype._final = function () { var chunk = this._cache.flush() if (this._autopadding) { return unpad(this._mode.decrypt(this, chunk)) } else if (chunk) { throw new Error('data not multiple of block length') } } Decipher.prototype.setAutoPadding = function (setTo) { this._autopadding = !!setTo return this } function Splitter () { if (!(this instanceof Splitter)) { return new Splitter() } this.cache = new Buffer('') } Splitter.prototype.add = function (data) { this.cache = Buffer.concat([this.cache, data]) } Splitter.prototype.get = function (autoPadding) { var out if (autoPadding) { if (this.cache.length > 16) { out = this.cache.slice(0, 16) this.cache = this.cache.slice(16) return out } } else { if (this.cache.length >= 16) { out = this.cache.slice(0, 16) this.cache = this.cache.slice(16) return out } } return null } Splitter.prototype.flush = function () { if (this.cache.length) { return this.cache } } function unpad (last) { var padded = last[15] var i = -1 while (++i < padded) { if (last[(i + (16 - padded))] !== padded) { throw new Error('unable to decrypt data') } } if (padded === 16) { return } return last.slice(0, 16 - padded) } var modelist = { ECB: require('./modes/ecb'), CBC: require('./modes/cbc'), CFB: require('./modes/cfb'), CFB8: require('./modes/cfb8'), CFB1: require('./modes/cfb1'), OFB: require('./modes/ofb'), CTR: require('./modes/ctr'), GCM: require('./modes/ctr') } function createDecipheriv (suite, password, iv) { var config = modes[suite.toLowerCase()] if (!config) { throw new TypeError('invalid suite type') } if (typeof iv === 'string') { iv = new Buffer(iv) } if (typeof password === 'string') { password = new Buffer(password) } if (password.length !== config.key / 8) { throw new TypeError('invalid key length ' + password.length) } if (iv.length !== config.iv) { throw new TypeError('invalid iv length ' + iv.length) } if (config.type === 'stream') { return new StreamCipher(modelist[config.mode], password, iv, true) } else if (config.type === 'auth') { return new AuthCipher(modelist[config.mode], password, iv, true) } return new Decipher(modelist[config.mode], password, iv) } function createDecipher (suite, password) { var config = modes[suite.toLowerCase()] if (!config) { throw new TypeError('invalid suite type') } var keys = ebtk(password, false, config.key, config.iv) return createDecipheriv(suite, keys.key, keys.iv) } exports.createDecipher = createDecipher exports.createDecipheriv = createDecipheriv }).call(this,require("buffer").Buffer) },{"./aes":21,"./authCipher":22,"./modes":27,"./modes/cbc":28,"./modes/cfb":29,"./modes/cfb1":30,"./modes/cfb8":31,"./modes/ctr":32,"./modes/ecb":33,"./modes/ofb":34,"./streamCipher":35,"buffer":47,"cipher-base":49,"evp_bytestokey":85,"inherits":95}],25:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') var inherits = require('inherits') var modes = require('./modes') var ebtk = require('evp_bytestokey') var StreamCipher = require('./streamCipher') var AuthCipher = require('./authCipher') inherits(Cipher, Transform) function Cipher (mode, key, iv) { if (!(this instanceof Cipher)) { return new Cipher(mode, key, iv) } Transform.call(this) this._cache = new Splitter() this._cipher = new aes.AES(key) this._prev = new Buffer(iv.length) iv.copy(this._prev) this._mode = mode this._autopadding = true } Cipher.prototype._update = function (data) { this._cache.add(data) var chunk var thing var out = [] while ((chunk = this._cache.get())) { thing = this._mode.encrypt(this, chunk) out.push(thing) } return Buffer.concat(out) } Cipher.prototype._final = function () { var chunk = this._cache.flush() if (this._autopadding) { chunk = this._mode.encrypt(this, chunk) this._cipher.scrub() return chunk } else if (chunk.toString('hex') !== '10101010101010101010101010101010') { this._cipher.scrub() throw new Error('data not multiple of block length') } } Cipher.prototype.setAutoPadding = function (setTo) { this._autopadding = !!setTo return this } function Splitter () { if (!(this instanceof Splitter)) { return new Splitter() } this.cache = new Buffer('') } Splitter.prototype.add = function (data) { this.cache = Buffer.concat([this.cache, data]) } Splitter.prototype.get = function () { if (this.cache.length > 15) { var out = this.cache.slice(0, 16) this.cache = this.cache.slice(16) return out } return null } Splitter.prototype.flush = function () { var len = 16 - this.cache.length var padBuff = new Buffer(len) var i = -1 while (++i < len) { padBuff.writeUInt8(len, i) } var out = Buffer.concat([this.cache, padBuff]) return out } var modelist = { ECB: require('./modes/ecb'), CBC: require('./modes/cbc'), CFB: require('./modes/cfb'), CFB8: require('./modes/cfb8'), CFB1: require('./modes/cfb1'), OFB: require('./modes/ofb'), CTR: require('./modes/ctr'), GCM: require('./modes/ctr') } function createCipheriv (suite, password, iv) { var config = modes[suite.toLowerCase()] if (!config) { throw new TypeError('invalid suite type') } if (typeof iv === 'string') { iv = new Buffer(iv) } if (typeof password === 'string') { password = new Buffer(password) } if (password.length !== config.key / 8) { throw new TypeError('invalid key length ' + password.length) } if (iv.length !== config.iv) { throw new TypeError('invalid iv length ' + iv.length) } if (config.type === 'stream') { return new StreamCipher(modelist[config.mode], password, iv) } else if (config.type === 'auth') { return new AuthCipher(modelist[config.mode], password, iv) } return new Cipher(modelist[config.mode], password, iv) } function createCipher (suite, password) { var config = modes[suite.toLowerCase()] if (!config) { throw new TypeError('invalid suite type') } var keys = ebtk(password, false, config.key, config.iv) return createCipheriv(suite, keys.key, keys.iv) } exports.createCipheriv = createCipheriv exports.createCipher = createCipher }).call(this,require("buffer").Buffer) },{"./aes":21,"./authCipher":22,"./modes":27,"./modes/cbc":28,"./modes/cfb":29,"./modes/cfb1":30,"./modes/cfb8":31,"./modes/ctr":32,"./modes/ecb":33,"./modes/ofb":34,"./streamCipher":35,"buffer":47,"cipher-base":49,"evp_bytestokey":85,"inherits":95}],26:[function(require,module,exports){ (function (Buffer){ var zeros = new Buffer(16) zeros.fill(0) module.exports = GHASH function GHASH (key) { this.h = key this.state = new Buffer(16) this.state.fill(0) this.cache = new Buffer('') } // from http://bitwiseshiftleft.github.io/sjcl/doc/symbols/src/core_gcm.js.html // by Juho Vähä-Herttua GHASH.prototype.ghash = function (block) { var i = -1 while (++i < block.length) { this.state[i] ^= block[i] } this._multiply() } GHASH.prototype._multiply = function () { var Vi = toArray(this.h) var Zi = [0, 0, 0, 0] var j, xi, lsb_Vi var i = -1 while (++i < 128) { xi = (this.state[~~(i / 8)] & (1 << (7 - i % 8))) !== 0 if (xi) { // Z_i+1 = Z_i ^ V_i Zi = xor(Zi, Vi) } // Store the value of LSB(V_i) lsb_Vi = (Vi[3] & 1) !== 0 // V_i+1 = V_i >> 1 for (j = 3; j > 0; j--) { Vi[j] = (Vi[j] >>> 1) | ((Vi[j - 1] & 1) << 31) } Vi[0] = Vi[0] >>> 1 // If LSB(V_i) is 1, V_i+1 = (V_i >> 1) ^ R if (lsb_Vi) { Vi[0] = Vi[0] ^ (0xe1 << 24) } } this.state = fromArray(Zi) } GHASH.prototype.update = function (buf) { this.cache = Buffer.concat([this.cache, buf]) var chunk while (this.cache.length >= 16) { chunk = this.cache.slice(0, 16) this.cache = this.cache.slice(16) this.ghash(chunk) } } GHASH.prototype.final = function (abl, bl) { if (this.cache.length) { this.ghash(Buffer.concat([this.cache, zeros], 16)) } this.ghash(fromArray([ 0, abl, 0, bl ])) return this.state } function toArray (buf) { return [ buf.readUInt32BE(0), buf.readUInt32BE(4), buf.readUInt32BE(8), buf.readUInt32BE(12) ] } function fromArray (out) { out = out.map(fixup_uint32) var buf = new Buffer(16) buf.writeUInt32BE(out[0], 0) buf.writeUInt32BE(out[1], 4) buf.writeUInt32BE(out[2], 8) buf.writeUInt32BE(out[3], 12) return buf } var uint_max = Math.pow(2, 32) function fixup_uint32 (x) { var ret, x_pos ret = x > uint_max || x < 0 ? (x_pos = Math.abs(x) % uint_max, x < 0 ? uint_max - x_pos : x_pos) : x return ret } function xor (a, b) { return [ a[0] ^ b[0], a[1] ^ b[1], a[2] ^ b[2], a[3] ^ b[3] ] } }).call(this,require("buffer").Buffer) },{"buffer":47}],27:[function(require,module,exports){ exports['aes-128-ecb'] = { cipher: 'AES', key: 128, iv: 0, mode: 'ECB', type: 'block' } exports['aes-192-ecb'] = { cipher: 'AES', key: 192, iv: 0, mode: 'ECB', type: 'block' } exports['aes-256-ecb'] = { cipher: 'AES', key: 256, iv: 0, mode: 'ECB', type: 'block' } exports['aes-128-cbc'] = { cipher: 'AES', key: 128, iv: 16, mode: 'CBC', type: 'block' } exports['aes-192-cbc'] = { cipher: 'AES', key: 192, iv: 16, mode: 'CBC', type: 'block' } exports['aes-256-cbc'] = { cipher: 'AES', key: 256, iv: 16, mode: 'CBC', type: 'block' } exports['aes128'] = exports['aes-128-cbc'] exports['aes192'] = exports['aes-192-cbc'] exports['aes256'] = exports['aes-256-cbc'] exports['aes-128-cfb'] = { cipher: 'AES', key: 128, iv: 16, mode: 'CFB', type: 'stream' } exports['aes-192-cfb'] = { cipher: 'AES', key: 192, iv: 16, mode: 'CFB', type: 'stream' } exports['aes-256-cfb'] = { cipher: 'AES', key: 256, iv: 16, mode: 'CFB', type: 'stream' } exports['aes-128-cfb8'] = { cipher: 'AES', key: 128, iv: 16, mode: 'CFB8', type: 'stream' } exports['aes-192-cfb8'] = { cipher: 'AES', key: 192, iv: 16, mode: 'CFB8', type: 'stream' } exports['aes-256-cfb8'] = { cipher: 'AES', key: 256, iv: 16, mode: 'CFB8', type: 'stream' } exports['aes-128-cfb1'] = { cipher: 'AES', key: 128, iv: 16, mode: 'CFB1', type: 'stream' } exports['aes-192-cfb1'] = { cipher: 'AES', key: 192, iv: 16, mode: 'CFB1', type: 'stream' } exports['aes-256-cfb1'] = { cipher: 'AES', key: 256, iv: 16, mode: 'CFB1', type: 'stream' } exports['aes-128-ofb'] = { cipher: 'AES', key: 128, iv: 16, mode: 'OFB', type: 'stream' } exports['aes-192-ofb'] = { cipher: 'AES', key: 192, iv: 16, mode: 'OFB', type: 'stream' } exports['aes-256-ofb'] = { cipher: 'AES', key: 256, iv: 16, mode: 'OFB', type: 'stream' } exports['aes-128-ctr'] = { cipher: 'AES', key: 128, iv: 16, mode: 'CTR', type: 'stream' } exports['aes-192-ctr'] = { cipher: 'AES', key: 192, iv: 16, mode: 'CTR', type: 'stream' } exports['aes-256-ctr'] = { cipher: 'AES', key: 256, iv: 16, mode: 'CTR', type: 'stream' } exports['aes-128-gcm'] = { cipher: 'AES', key: 128, iv: 12, mode: 'GCM', type: 'auth' } exports['aes-192-gcm'] = { cipher: 'AES', key: 192, iv: 12, mode: 'GCM', type: 'auth' } exports['aes-256-gcm'] = { cipher: 'AES', key: 256, iv: 12, mode: 'GCM', type: 'auth' } },{}],28:[function(require,module,exports){ var xor = require('buffer-xor') exports.encrypt = function (self, block) { var data = xor(block, self._prev) self._prev = self._cipher.encryptBlock(data) return self._prev } exports.decrypt = function (self, block) { var pad = self._prev self._prev = block var out = self._cipher.decryptBlock(block) return xor(out, pad) } },{"buffer-xor":46}],29:[function(require,module,exports){ (function (Buffer){ var xor = require('buffer-xor') exports.encrypt = function (self, data, decrypt) { var out = new Buffer('') var len while (data.length) { if (self._cache.length === 0) { self._cache = self._cipher.encryptBlock(self._prev) self._prev = new Buffer('') } if (self._cache.length <= data.length) { len = self._cache.length out = Buffer.concat([out, encryptStart(self, data.slice(0, len), decrypt)]) data = data.slice(len) } else { out = Buffer.concat([out, encryptStart(self, data, decrypt)]) break } } return out } function encryptStart (self, data, decrypt) { var len = data.length var out = xor(data, self._cache) self._cache = self._cache.slice(len) self._prev = Buffer.concat([self._prev, decrypt ? data : out]) return out } }).call(this,require("buffer").Buffer) },{"buffer":47,"buffer-xor":46}],30:[function(require,module,exports){ (function (Buffer){ function encryptByte (self, byteParam, decrypt) { var pad var i = -1 var len = 8 var out = 0 var bit, value while (++i < len) { pad = self._cipher.encryptBlock(self._prev) bit = (byteParam & (1 << (7 - i))) ? 0x80 : 0 value = pad[0] ^ bit out += ((value & 0x80) >> (i % 8)) self._prev = shiftIn(self._prev, decrypt ? bit : value) } return out } exports.encrypt = function (self, chunk, decrypt) { var len = chunk.length var out = new Buffer(len) var i = -1 while (++i < len) { out[i] = encryptByte(self, chunk[i], decrypt) } return out } function shiftIn (buffer, value) { var len = buffer.length var i = -1 var out = new Buffer(buffer.length) buffer = Buffer.concat([buffer, new Buffer([value])]) while (++i < len) { out[i] = buffer[i] << 1 | buffer[i + 1] >> (7) } return out } }).call(this,require("buffer").Buffer) },{"buffer":47}],31:[function(require,module,exports){ (function (Buffer){ function encryptByte (self, byteParam, decrypt) { var pad = self._cipher.encryptBlock(self._prev) var out = pad[0] ^ byteParam self._prev = Buffer.concat([self._prev.slice(1), new Buffer([decrypt ? byteParam : out])]) return out } exports.encrypt = function (self, chunk, decrypt) { var len = chunk.length var out = new Buffer(len) var i = -1 while (++i < len) { out[i] = encryptByte(self, chunk[i], decrypt) } return out } }).call(this,require("buffer").Buffer) },{"buffer":47}],32:[function(require,module,exports){ (function (Buffer){ var xor = require('buffer-xor') function incr32 (iv) { var len = iv.length var item while (len--) { item = iv.readUInt8(len) if (item === 255) { iv.writeUInt8(0, len) } else { item++ iv.writeUInt8(item, len) break } } } function getBlock (self) { var out = self._cipher.encryptBlock(self._prev) incr32(self._prev) return out } exports.encrypt = function (self, chunk) { while (self._cache.length < chunk.length) { self._cache = Buffer.concat([self._cache, getBlock(self)]) } var pad = self._cache.slice(0, chunk.length) self._cache = self._cache.slice(chunk.length) return xor(chunk, pad) } }).call(this,require("buffer").Buffer) },{"buffer":47,"buffer-xor":46}],33:[function(require,module,exports){ exports.encrypt = function (self, block) { return self._cipher.encryptBlock(block) } exports.decrypt = function (self, block) { return self._cipher.decryptBlock(block) } },{}],34:[function(require,module,exports){ (function (Buffer){ var xor = require('buffer-xor') function getBlock (self) { self._prev = self._cipher.encryptBlock(self._prev) return self._prev } exports.encrypt = function (self, chunk) { while (self._cache.length < chunk.length) { self._cache = Buffer.concat([self._cache, getBlock(self)]) } var pad = self._cache.slice(0, chunk.length) self._cache = self._cache.slice(chunk.length) return xor(chunk, pad) } }).call(this,require("buffer").Buffer) },{"buffer":47,"buffer-xor":46}],35:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') var inherits = require('inherits') inherits(StreamCipher, Transform) module.exports = StreamCipher function StreamCipher (mode, key, iv, decrypt) { if (!(this instanceof StreamCipher)) { return new StreamCipher(mode, key, iv) } Transform.call(this) this._cipher = new aes.AES(key) this._prev = new Buffer(iv.length) this._cache = new Buffer('') this._secCache = new Buffer('') this._decrypt = decrypt iv.copy(this._prev) this._mode = mode } StreamCipher.prototype._update = function (chunk) { return this._mode.encrypt(this, chunk, this._decrypt) } StreamCipher.prototype._final = function () { this._cipher.scrub() } }).call(this,require("buffer").Buffer) },{"./aes":21,"buffer":47,"cipher-base":49,"inherits":95}],36:[function(require,module,exports){ var ebtk = require('evp_bytestokey') var aes = require('browserify-aes/browser') var DES = require('browserify-des') var desModes = require('browserify-des/modes') var aesModes = require('browserify-aes/modes') function createCipher (suite, password) { var keyLen, ivLen suite = suite.toLowerCase() if (aesModes[suite]) { keyLen = aesModes[suite].key ivLen = aesModes[suite].iv } else if (desModes[suite]) { keyLen = desModes[suite].key * 8 ivLen = desModes[suite].iv } else { throw new TypeError('invalid suite type') } var keys = ebtk(password, false, keyLen, ivLen) return createCipheriv(suite, keys.key, keys.iv) } function createDecipher (suite, password) { var keyLen, ivLen suite = suite.toLowerCase() if (aesModes[suite]) { keyLen = aesModes[suite].key ivLen = aesModes[suite].iv } else if (desModes[suite]) { keyLen = desModes[suite].key * 8 ivLen = desModes[suite].iv } else { throw new TypeError('invalid suite type') } var keys = ebtk(password, false, keyLen, ivLen) return createDecipheriv(suite, keys.key, keys.iv) } function createCipheriv (suite, key, iv) { suite = suite.toLowerCase() if (aesModes[suite]) { return aes.createCipheriv(suite, key, iv) } else if (desModes[suite]) { return new DES({ key: key, iv: iv, mode: suite }) } else { throw new TypeError('invalid suite type') } } function createDecipheriv (suite, key, iv) { suite = suite.toLowerCase() if (aesModes[suite]) { return aes.createDecipheriv(suite, key, iv) } else if (desModes[suite]) { return new DES({ key: key, iv: iv, mode: suite, decrypt: true }) } else { throw new TypeError('invalid suite type') } } exports.createCipher = exports.Cipher = createCipher exports.createCipheriv = exports.Cipheriv = createCipheriv exports.createDecipher = exports.Decipher = createDecipher exports.createDecipheriv = exports.Decipheriv = createDecipheriv function getCiphers () { return Object.keys(desModes).concat(aes.getCiphers()) } exports.listCiphers = exports.getCiphers = getCiphers },{"browserify-aes/browser":23,"browserify-aes/modes":27,"browserify-des":37,"browserify-des/modes":38,"evp_bytestokey":85}],37:[function(require,module,exports){ (function (Buffer){ var CipherBase = require('cipher-base') var des = require('des.js') var inherits = require('inherits') var modes = { 'des-ede3-cbc': des.CBC.instantiate(des.EDE), 'des-ede3': des.EDE, 'des-ede-cbc': des.CBC.instantiate(des.EDE), 'des-ede': des.EDE, 'des-cbc': des.CBC.instantiate(des.DES), 'des-ecb': des.DES } modes.des = modes['des-cbc'] modes.des3 = modes['des-ede3-cbc'] module.exports = DES inherits(DES, CipherBase) function DES (opts) { CipherBase.call(this) var modeName = opts.mode.toLowerCase() var mode = modes[modeName] var type if (opts.decrypt) { type = 'decrypt' } else { type = 'encrypt' } var key = opts.key if (modeName === 'des-ede' || modeName === 'des-ede-cbc') { key = Buffer.concat([key, key.slice(0, 8)]) } var iv = opts.iv this._des = mode.create({ key: key, iv: iv, type: type }) } DES.prototype._update = function (data) { return new Buffer(this._des.update(data)) } DES.prototype._final = function () { return new Buffer(this._des.final()) } }).call(this,require("buffer").Buffer) },{"buffer":47,"cipher-base":49,"des.js":57,"inherits":95}],38:[function(require,module,exports){ exports['des-ecb'] = { key: 8, iv: 0 } exports['des-cbc'] = exports.des = { key: 8, iv: 8 } exports['des-ede3-cbc'] = exports.des3 = { key: 24, iv: 8 } exports['des-ede3'] = { key: 24, iv: 0 } exports['des-ede-cbc'] = { key: 16, iv: 8 } exports['des-ede'] = { key: 16, iv: 0 } },{}],39:[function(require,module,exports){ (function (Buffer){ var bn = require('bn.js'); var randomBytes = require('randombytes'); module.exports = crt; function blind(priv) { var r = getr(priv); var blinder = r.toRed(bn.mont(priv.modulus)) .redPow(new bn(priv.publicExponent)).fromRed(); return { blinder: blinder, unblinder:r.invm(priv.modulus) }; } function crt(msg, priv) { var blinds = blind(priv); var len = priv.modulus.byteLength(); var mod = bn.mont(priv.modulus); var blinded = new bn(msg).mul(blinds.blinder).umod(priv.modulus); var c1 = blinded.toRed(bn.mont(priv.prime1)); var c2 = blinded.toRed(bn.mont(priv.prime2)); var qinv = priv.coefficient; var p = priv.prime1; var q = priv.prime2; var m1 = c1.redPow(priv.exponent1); var m2 = c2.redPow(priv.exponent2); m1 = m1.fromRed(); m2 = m2.fromRed(); var h = m1.isub(m2).imul(qinv).umod(p); h.imul(q); m2.iadd(h); return new Buffer(m2.imul(blinds.unblinder).umod(priv.modulus).toArray(false, len)); } crt.getr = getr; function getr(priv) { var len = priv.modulus.byteLength(); var r = new bn(randomBytes(len)); while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2)) { r = new bn(randomBytes(len)); } return r; } }).call(this,require("buffer").Buffer) },{"bn.js":18,"buffer":47,"randombytes":119}],40:[function(require,module,exports){ (function (Buffer){ 'use strict' exports['RSA-SHA224'] = exports.sha224WithRSAEncryption = { sign: 'rsa', hash: 'sha224', id: new Buffer('302d300d06096086480165030402040500041c', 'hex') } exports['RSA-SHA256'] = exports.sha256WithRSAEncryption = { sign: 'rsa', hash: 'sha256', id: new Buffer('3031300d060960864801650304020105000420', 'hex') } exports['RSA-SHA384'] = exports.sha384WithRSAEncryption = { sign: 'rsa', hash: 'sha384', id: new Buffer('3041300d060960864801650304020205000430', 'hex') } exports['RSA-SHA512'] = exports.sha512WithRSAEncryption = { sign: 'rsa', hash: 'sha512', id: new Buffer('3051300d060960864801650304020305000440', 'hex') } exports['RSA-SHA1'] = { sign: 'rsa', hash: 'sha1', id: new Buffer('3021300906052b0e03021a05000414', 'hex') } exports['ecdsa-with-SHA1'] = { sign: 'ecdsa', hash: 'sha1', id: new Buffer('', 'hex') } exports.DSA = exports['DSA-SHA1'] = exports['DSA-SHA'] = { sign: 'dsa', hash: 'sha1', id: new Buffer('', 'hex') } exports['DSA-SHA224'] = exports['DSA-WITH-SHA224'] = { sign: 'dsa', hash: 'sha224', id: new Buffer('', 'hex') } exports['DSA-SHA256'] = exports['DSA-WITH-SHA256'] = { sign: 'dsa', hash: 'sha256', id: new Buffer('', 'hex') } exports['DSA-SHA384'] = exports['DSA-WITH-SHA384'] = { sign: 'dsa', hash: 'sha384', id: new Buffer('', 'hex') } exports['DSA-SHA512'] = exports['DSA-WITH-SHA512'] = { sign: 'dsa', hash: 'sha512', id: new Buffer('', 'hex') } exports['DSA-RIPEMD160'] = { sign: 'dsa', hash: 'rmd160', id: new Buffer('', 'hex') } exports['RSA-RIPEMD160'] = exports.ripemd160WithRSA = { sign: 'rsa', hash: 'rmd160', id: new Buffer('3021300906052b2403020105000414', 'hex') } exports['RSA-MD5'] = exports.md5WithRSAEncryption = { sign: 'rsa', hash: 'md5', id: new Buffer('3020300c06082a864886f70d020505000410', 'hex') } }).call(this,require("buffer").Buffer) },{"buffer":47}],41:[function(require,module,exports){ (function (Buffer){ var _algos = require('./algos') var createHash = require('create-hash') var inherits = require('inherits') var sign = require('./sign') var stream = require('stream') var verify = require('./verify') var algos = {} Object.keys(_algos).forEach(function (key) { algos[key] = algos[key.toLowerCase()] = _algos[key] }) function Sign (algorithm) { stream.Writable.call(this) var data = algos[algorithm] if (!data) { throw new Error('Unknown message digest') } this._hashType = data.hash this._hash = createHash(data.hash) this._tag = data.id this._signType = data.sign } inherits(Sign, stream.Writable) Sign.prototype._write = function _write (data, _, done) { this._hash.update(data) done() } Sign.prototype.update = function update (data, enc) { if (typeof data === 'string') { data = new Buffer(data, enc) } this._hash.update(data) return this } Sign.prototype.sign = function signMethod (key, enc) { this.end() var hash = this._hash.digest() var sig = sign(Buffer.concat([this._tag, hash]), key, this._hashType, this._signType) return enc ? sig.toString(enc) : sig } function Verify (algorithm) { stream.Writable.call(this) var data = algos[algorithm] if (!data) { throw new Error('Unknown message digest') } this._hash = createHash(data.hash) this._tag = data.id this._signType = data.sign } inherits(Verify, stream.Writable) Verify.prototype._write = function _write (data, _, done) { this._hash.update(data) done() } Verify.prototype.update = function update (data, enc) { if (typeof data === 'string') { data = new Buffer(data, enc) } this._hash.update(data) return this } Verify.prototype.verify = function verifyMethod (key, sig, enc) { if (typeof sig === 'string') { sig = new Buffer(sig, enc) } this.end() var hash = this._hash.digest() return verify(sig, Buffer.concat([this._tag, hash]), key, this._signType) } function createSign (algorithm) { return new Sign(algorithm) } function createVerify (algorithm) { return new Verify(algorithm) } module.exports = { Sign: createSign, Verify: createVerify, createSign: createSign, createVerify: createVerify } }).call(this,require("buffer").Buffer) },{"./algos":40,"./sign":43,"./verify":44,"buffer":47,"create-hash":52,"inherits":95,"stream":139}],42:[function(require,module,exports){ 'use strict' exports['1.3.132.0.10'] = 'secp256k1' exports['1.3.132.0.33'] = 'p224' exports['1.2.840.10045.3.1.1'] = 'p192' exports['1.2.840.10045.3.1.7'] = 'p256' exports['1.3.132.0.34'] = 'p384' exports['1.3.132.0.35'] = 'p521' },{}],43:[function(require,module,exports){ (function (Buffer){ // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js var createHmac = require('create-hmac') var crt = require('browserify-rsa') var curves = require('./curves') var elliptic = require('elliptic') var parseKeys = require('parse-asn1') var BN = require('bn.js') var EC = elliptic.ec function sign (hash, key, hashType, signType) { var priv = parseKeys(key) if (priv.curve) { if (signType !== 'ecdsa') throw new Error('wrong private key type') return ecSign(hash, priv) } else if (priv.type === 'dsa') { if (signType !== 'dsa') { throw new Error('wrong private key type') } return dsaSign(hash, priv, hashType) } else { if (signType !== 'rsa') throw new Error('wrong private key type') } var len = priv.modulus.byteLength() var pad = [ 0, 1 ] while (hash.length + pad.length + 1 < len) { pad.push(0xff) } pad.push(0x00) var i = -1 while (++i < hash.length) { pad.push(hash[i]) } var out = crt(pad, priv) return out } function ecSign (hash, priv) { var curveId = curves[priv.curve.join('.')] if (!curveId) throw new Error('unknown curve ' + priv.curve.join('.')) var curve = new EC(curveId) var key = curve.genKeyPair() key._importPrivate(priv.privateKey) var out = key.sign(hash) return new Buffer(out.toDER()) } function dsaSign (hash, priv, algo) { var x = priv.params.priv_key var p = priv.params.p var q = priv.params.q var g = priv.params.g var r = new BN(0) var k var H = bits2int(hash, q).mod(q) var s = false var kv = getKey(x, q, hash, algo) while (s === false) { k = makeKey(q, kv, algo) r = makeR(g, k, p, q) s = k.invm(q).imul(H.add(x.mul(r))).mod(q) if (!s.cmpn(0)) { s = false r = new BN(0) } } return toDER(r, s) } function toDER (r, s) { r = r.toArray() s = s.toArray() // Pad values if (r[0] & 0x80) { r = [ 0 ].concat(r) } // Pad values if (s[0] & 0x80) { s = [0].concat(s) } var total = r.length + s.length + 4 var res = [ 0x30, total, 0x02, r.length ] res = res.concat(r, [ 0x02, s.length ], s) return new Buffer(res) } function getKey (x, q, hash, algo) { x = new Buffer(x.toArray()) if (x.length < q.byteLength()) { var zeros = new Buffer(q.byteLength() - x.length) zeros.fill(0) x = Buffer.concat([zeros, x]) } var hlen = hash.length var hbits = bits2octets(hash, q) var v = new Buffer(hlen) v.fill(1) var k = new Buffer(hlen) k.fill(0) k = createHmac(algo, k) .update(v) .update(new Buffer([0])) .update(x) .update(hbits) .digest() v = createHmac(algo, k) .update(v) .digest() k = createHmac(algo, k) .update(v) .update(new Buffer([1])) .update(x) .update(hbits) .digest() v = createHmac(algo, k) .update(v) .digest() return { k: k, v: v } } function bits2int (obits, q) { var bits = new BN(obits) var shift = (obits.length << 3) - q.bitLength() if (shift > 0) { bits.ishrn(shift) } return bits } function bits2octets (bits, q) { bits = bits2int(bits, q) bits = bits.mod(q) var out = new Buffer(bits.toArray()) if (out.length < q.byteLength()) { var zeros = new Buffer(q.byteLength() - out.length) zeros.fill(0) out = Buffer.concat([zeros, out]) } return out } function makeKey (q, kv, algo) { var t, k do { t = new Buffer('') while (t.length * 8 < q.bitLength()) { kv.v = createHmac(algo, kv.k) .update(kv.v) .digest() t = Buffer.concat([t, kv.v]) } k = bits2int(t, q) kv.k = createHmac(algo, kv.k) .update(kv.v) .update(new Buffer([0])) .digest() kv.v = createHmac(algo, kv.k) .update(kv.v) .digest() } while (k.cmp(q) !== -1) return k } function makeR (g, k, p, q) { return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q) } module.exports = sign module.exports.getKey = getKey module.exports.makeKey = makeKey }).call(this,require("buffer").Buffer) },{"./curves":42,"bn.js":18,"browserify-rsa":39,"buffer":47,"create-hmac":55,"elliptic":67,"parse-asn1":104}],44:[function(require,module,exports){ (function (Buffer){ // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js var curves = require('./curves') var elliptic = require('elliptic') var parseKeys = require('parse-asn1') var BN = require('bn.js') var EC = elliptic.ec function verify (sig, hash, key, signType) { var pub = parseKeys(key) if (pub.type === 'ec') { if (signType !== 'ecdsa') { throw new Error('wrong public key type') } return ecVerify(sig, hash, pub) } else if (pub.type === 'dsa') { if (signType !== 'dsa') { throw new Error('wrong public key type') } return dsaVerify(sig, hash, pub) } else { if (signType !== 'rsa') { throw new Error('wrong public key type') } } var len = pub.modulus.byteLength() var pad = [ 1 ] var padNum = 0 while (hash.length + pad.length + 2 < len) { pad.push(0xff) padNum++ } pad.push(0x00) var i = -1 while (++i < hash.length) { pad.push(hash[i]) } pad = new Buffer(pad) var red = BN.mont(pub.modulus) sig = new BN(sig).toRed(red) sig = sig.redPow(new BN(pub.publicExponent)) sig = new Buffer(sig.fromRed().toArray()) var out = 0 if (padNum < 8) { out = 1 } len = Math.min(sig.length, pad.length) if (sig.length !== pad.length) { out = 1 } i = -1 while (++i < len) { out |= (sig[i] ^ pad[i]) } return out === 0 } function ecVerify (sig, hash, pub) { var curveId = curves[pub.data.algorithm.curve.join('.')] if (!curveId) throw new Error('unknown curve ' + pub.data.algorithm.curve.join('.')) var curve = new EC(curveId) var pubkey = pub.data.subjectPrivateKey.data return curve.verify(hash, sig, pubkey) } function dsaVerify (sig, hash, pub) { var p = pub.data.p var q = pub.data.q var g = pub.data.g var y = pub.data.pub_key var unpacked = parseKeys.signature.decode(sig, 'der') var s = unpacked.s var r = unpacked.r checkValue(s, q) checkValue(r, q) var montp = BN.mont(p) var w = s.invm(q) var v = g.toRed(montp) .redPow(new BN(hash).mul(w).mod(q)) .fromRed() .mul( y.toRed(montp) .redPow(r.mul(w).mod(q)) .fromRed() ).mod(p).mod(q) return !v.cmp(r) } function checkValue (b, q) { if (b.cmpn(0) <= 0) { throw new Error('invalid sig') } if (b.cmp(q) >= q) { throw new Error('invalid sig') } } module.exports = verify }).call(this,require("buffer").Buffer) },{"./curves":42,"bn.js":18,"buffer":47,"elliptic":67,"parse-asn1":104}],45:[function(require,module,exports){ (function (global){ 'use strict'; var buffer = require('buffer'); var Buffer = buffer.Buffer; var SlowBuffer = buffer.SlowBuffer; var MAX_LEN = buffer.kMaxLength || 2147483647; exports.alloc = function alloc(size, fill, encoding) { if (typeof Buffer.alloc === 'function') { return Buffer.alloc(size, fill, encoding); } if (typeof encoding === 'number') { throw new TypeError('encoding must not be number'); } if (typeof size !== 'number') { throw new TypeError('size must be a number'); } if (size > MAX_LEN) { throw new RangeError('size is too large'); } var enc = encoding; var _fill = fill; if (_fill === undefined) { enc = undefined; _fill = 0; } var buf = new Buffer(size); if (typeof _fill === 'string') { var fillBuf = new Buffer(_fill, enc); var flen = fillBuf.length; var i = -1; while (++i < size) { buf[i] = fillBuf[i % flen]; } } else { buf.fill(_fill); } return buf; } exports.allocUnsafe = function allocUnsafe(size) { if (typeof Buffer.allocUnsafe === 'function') { return Buffer.allocUnsafe(size); } if (typeof size !== 'number') { throw new TypeError('size must be a number'); } if (size > MAX_LEN) { throw new RangeError('size is too large'); } return new Buffer(size); } exports.from = function from(value, encodingOrOffset, length) { if (typeof Buffer.from === 'function' && (!global.Uint8Array || Uint8Array.from !== Buffer.from)) { return Buffer.from(value, encodingOrOffset, length); } if (typeof value === 'number') { throw new TypeError('"value" argument must not be a number'); } if (typeof value === 'string') { return new Buffer(value, encodingOrOffset); } if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { var offset = encodingOrOffset; if (arguments.length === 1) { return new Buffer(value); } if (typeof offset === 'undefined') { offset = 0; } var len = length; if (typeof len === 'undefined') { len = value.byteLength - offset; } if (offset >= value.byteLength) { throw new RangeError('\'offset\' is out of bounds'); } if (len > value.byteLength - offset) { throw new RangeError('\'length\' is out of bounds'); } return new Buffer(value.slice(offset, offset + len)); } if (Buffer.isBuffer(value)) { var out = new Buffer(value.length); value.copy(out, 0, 0, value.length); return out; } if (value) { if (Array.isArray(value) || (typeof ArrayBuffer !== 'undefined' && value.buffer instanceof ArrayBuffer) || 'length' in value) { return new Buffer(value); } if (value.type === 'Buffer' && Array.isArray(value.data)) { return new Buffer(value.data); } } throw new TypeError('First argument must be a string, Buffer, ' + 'ArrayBuffer, Array, or array-like object.'); } exports.allocUnsafeSlow = function allocUnsafeSlow(size) { if (typeof Buffer.allocUnsafeSlow === 'function') { return Buffer.allocUnsafeSlow(size); } if (typeof size !== 'number') { throw new TypeError('size must be a number'); } if (size >= MAX_LEN) { throw new RangeError('size is too large'); } return new SlowBuffer(size); } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"buffer":47}],46:[function(require,module,exports){ (function (Buffer){ module.exports = function xor (a, b) { var length = Math.min(a.length, b.length) var buffer = new Buffer(length) for (var i = 0; i < length; ++i) { buffer[i] = a[i] ^ b[i] } return buffer } }).call(this,require("buffer").Buffer) },{"buffer":47}],47:[function(require,module,exports){ (function (global){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ /* eslint-disable no-proto */ 'use strict' var base64 = require('base64-js') var ieee754 = require('ieee754') var isArray = require('isarray') exports.Buffer = Buffer exports.SlowBuffer = SlowBuffer exports.INSPECT_MAX_BYTES = 50 /** * If `Buffer.TYPED_ARRAY_SUPPORT`: * === true Use Uint8Array implementation (fastest) * === false Use Object implementation (most compatible, even IE6) * * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, * Opera 11.6+, iOS 4.2+. * * Due to various browser bugs, sometimes the Object implementation will be used even * when the browser supports typed arrays. * * Note: * * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. * * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. * * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of * incorrect length in some situations. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they * get the Object implementation, which is slower but behaves correctly. */ Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined ? global.TYPED_ARRAY_SUPPORT : typedArraySupport() /* * Export kMaxLength after typed array support is determined. */ exports.kMaxLength = kMaxLength() function typedArraySupport () { try { var arr = new Uint8Array(1) arr.foo = function () { return 42 } return arr.foo() === 42 && // typed array instances can be augmented typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` } catch (e) { return false } } function kMaxLength () { return Buffer.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff } function createBuffer (that, length) { if (kMaxLength() < length) { throw new RangeError('Invalid typed array length') } if (Buffer.TYPED_ARRAY_SUPPORT) { // Return an augmented `Uint8Array` instance, for best performance that = new Uint8Array(length) that.__proto__ = Buffer.prototype } else { // Fallback: Return an object instance of the Buffer class if (that === null) { that = new Buffer(length) } that.length = length } return that } /** * The Buffer constructor returns instances of `Uint8Array` that have their * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of * `Uint8Array`, so the returned instances will have all the node `Buffer` methods * and the `Uint8Array` methods. Square bracket notation works as expected -- it * returns a single octet. * * The `Uint8Array` prototype remains unmodified. */ function Buffer (arg, encodingOrOffset, length) { if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { return new Buffer(arg, encodingOrOffset, length) } // Common case. if (typeof arg === 'number') { if (typeof encodingOrOffset === 'string') { throw new Error( 'If encoding is specified then the first argument must be a string' ) } return allocUnsafe(this, arg) } return from(this, arg, encodingOrOffset, length) } Buffer.poolSize = 8192 // not used by this implementation // TODO: Legacy, not needed anymore. Remove in next major version. Buffer._augment = function (arr) { arr.__proto__ = Buffer.prototype return arr } function from (that, value, encodingOrOffset, length) { if (typeof value === 'number') { throw new TypeError('"value" argument must not be a number') } if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { return fromArrayBuffer(that, value, encodingOrOffset, length) } if (typeof value === 'string') { return fromString(that, value, encodingOrOffset) } return fromObject(that, value) } /** * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError * if value is a number. * Buffer.from(str[, encoding]) * Buffer.from(array) * Buffer.from(buffer) * Buffer.from(arrayBuffer[, byteOffset[, length]]) **/ Buffer.from = function (value, encodingOrOffset, length) { return from(null, value, encodingOrOffset, length) } if (Buffer.TYPED_ARRAY_SUPPORT) { Buffer.prototype.__proto__ = Uint8Array.prototype Buffer.__proto__ = Uint8Array if (typeof Symbol !== 'undefined' && Symbol.species && Buffer[Symbol.species] === Buffer) { // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 Object.defineProperty(Buffer, Symbol.species, { value: null, configurable: true }) } } function assertSize (size) { if (typeof size !== 'number') { throw new TypeError('"size" argument must be a number') } } function alloc (that, size, fill, encoding) { assertSize(size) if (size <= 0) { return createBuffer(that, size) } if (fill !== undefined) { // Only pay attention to encoding if it's a string. This // prevents accidentally sending in a number that would // be interpretted as a start offset. return typeof encoding === 'string' ? createBuffer(that, size).fill(fill, encoding) : createBuffer(that, size).fill(fill) } return createBuffer(that, size) } /** * Creates a new filled Buffer instance. * alloc(size[, fill[, encoding]]) **/ Buffer.alloc = function (size, fill, encoding) { return alloc(null, size, fill, encoding) } function allocUnsafe (that, size) { assertSize(size) that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) if (!Buffer.TYPED_ARRAY_SUPPORT) { for (var i = 0; i < size; i++) { that[i] = 0 } } return that } /** * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. * */ Buffer.allocUnsafe = function (size) { return allocUnsafe(null, size) } /** * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. */ Buffer.allocUnsafeSlow = function (size) { return allocUnsafe(null, size) } function fromString (that, string, encoding) { if (typeof encoding !== 'string' || encoding === '') { encoding = 'utf8' } if (!Buffer.isEncoding(encoding)) { throw new TypeError('"encoding" must be a valid string encoding') } var length = byteLength(string, encoding) | 0 that = createBuffer(that, length) that.write(string, encoding) return that } function fromArrayLike (that, array) { var length = checked(array.length) | 0 that = createBuffer(that, length) for (var i = 0; i < length; i += 1) { that[i] = array[i] & 255 } return that } function fromArrayBuffer (that, array, byteOffset, length) { array.byteLength // this throws if `array` is not a valid ArrayBuffer if (byteOffset < 0 || array.byteLength < byteOffset) { throw new RangeError('\'offset\' is out of bounds') } if (array.byteLength < byteOffset + (length || 0)) { throw new RangeError('\'length\' is out of bounds') } if (length === undefined) { array = new Uint8Array(array, byteOffset) } else { array = new Uint8Array(array, byteOffset, length) } if (Buffer.TYPED_ARRAY_SUPPORT) { // Return an augmented `Uint8Array` instance, for best performance that = array that.__proto__ = Buffer.prototype } else { // Fallback: Return an object instance of the Buffer class that = fromArrayLike(that, array) } return that } function fromObject (that, obj) { if (Buffer.isBuffer(obj)) { var len = checked(obj.length) | 0 that = createBuffer(that, len) if (that.length === 0) { return that } obj.copy(that, 0, 0, len) return that } if (obj) { if ((typeof ArrayBuffer !== 'undefined' && obj.buffer instanceof ArrayBuffer) || 'length' in obj) { if (typeof obj.length !== 'number' || isnan(obj.length)) { return createBuffer(that, 0) } return fromArrayLike(that, obj) } if (obj.type === 'Buffer' && isArray(obj.data)) { return fromArrayLike(that, obj.data) } } throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') } function checked (length) { // Note: cannot use `length < kMaxLength` here because that fails when // length is NaN (which is otherwise coerced to zero.) if (length >= kMaxLength()) { throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength().toString(16) + ' bytes') } return length | 0 } function SlowBuffer (length) { if (+length != length) { // eslint-disable-line eqeqeq length = 0 } return Buffer.alloc(+length) } Buffer.isBuffer = function isBuffer (b) { return !!(b != null && b._isBuffer) } Buffer.compare = function compare (a, b) { if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { throw new TypeError('Arguments must be Buffers') } if (a === b) return 0 var x = a.length var y = b.length for (var i = 0, len = Math.min(x, y); i < len; ++i) { if (a[i] !== b[i]) { x = a[i] y = b[i] break } } if (x < y) return -1 if (y < x) return 1 return 0 } Buffer.isEncoding = function isEncoding (encoding) { switch (String(encoding).toLowerCase()) { case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'raw': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return true default: return false } } Buffer.concat = function concat (list, length) { if (!isArray(list)) { throw new TypeError('"list" argument must be an Array of Buffers') } if (list.length === 0) { return Buffer.alloc(0) } var i if (length === undefined) { length = 0 for (i = 0; i < list.length; i++) { length += list[i].length } } var buffer = Buffer.allocUnsafe(length) var pos = 0 for (i = 0; i < list.length; i++) { var buf = list[i] if (!Buffer.isBuffer(buf)) { throw new TypeError('"list" argument must be an Array of Buffers') } buf.copy(buffer, pos) pos += buf.length } return buffer } function byteLength (string, encoding) { if (Buffer.isBuffer(string)) { return string.length } if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { return string.byteLength } if (typeof string !== 'string') { string = '' + string } var len = string.length if (len === 0) return 0 // Use a for loop to avoid recursion var loweredCase = false for (;;) { switch (encoding) { case 'ascii': case 'binary': // Deprecated case 'raw': case 'raws': return len case 'utf8': case 'utf-8': case undefined: return utf8ToBytes(string).length case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return len * 2 case 'hex': return len >>> 1 case 'base64': return base64ToBytes(string).length default: if (loweredCase) return utf8ToBytes(string).length // assume utf8 encoding = ('' + encoding).toLowerCase() loweredCase = true } } } Buffer.byteLength = byteLength function slowToString (encoding, start, end) { var loweredCase = false // No need to verify that "this.length <= MAX_UINT32" since it's a read-only // property of a typed array. // This behaves neither like String nor Uint8Array in that we set start/end // to their upper/lower bounds if the value passed is out of range. // undefined is handled specially as per ECMA-262 6th Edition, // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. if (start === undefined || start < 0) { start = 0 } // Return early if start > this.length. Done here to prevent potential uint32 // coercion fail below. if (start > this.length) { return '' } if (end === undefined || end > this.length) { end = this.length } if (end <= 0) { return '' } // Force coersion to uint32. This will also coerce falsey/NaN values to 0. end >>>= 0 start >>>= 0 if (end <= start) { return '' } if (!encoding) encoding = 'utf8' while (true) { switch (encoding) { case 'hex': return hexSlice(this, start, end) case 'utf8': case 'utf-8': return utf8Slice(this, start, end) case 'ascii': return asciiSlice(this, start, end) case 'binary': return binarySlice(this, start, end) case 'base64': return base64Slice(this, start, end) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return utf16leSlice(this, start, end) default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) encoding = (encoding + '').toLowerCase() loweredCase = true } } } // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect // Buffer instances. Buffer.prototype._isBuffer = true function swap (b, n, m) { var i = b[n] b[n] = b[m] b[m] = i } Buffer.prototype.swap16 = function swap16 () { var len = this.length if (len % 2 !== 0) { throw new RangeError('Buffer size must be a multiple of 16-bits') } for (var i = 0; i < len; i += 2) { swap(this, i, i + 1) } return this } Buffer.prototype.swap32 = function swap32 () { var len = this.length if (len % 4 !== 0) { throw new RangeError('Buffer size must be a multiple of 32-bits') } for (var i = 0; i < len; i += 4) { swap(this, i, i + 3) swap(this, i + 1, i + 2) } return this } Buffer.prototype.toString = function toString () { var length = this.length | 0 if (length === 0) return '' if (arguments.length === 0) return utf8Slice(this, 0, length) return slowToString.apply(this, arguments) } Buffer.prototype.equals = function equals (b) { if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') if (this === b) return true return Buffer.compare(this, b) === 0 } Buffer.prototype.inspect = function inspect () { var str = '' var max = exports.INSPECT_MAX_BYTES if (this.length > 0) { str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') if (this.length > max) str += ' ... ' } return '' } Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { if (!Buffer.isBuffer(target)) { throw new TypeError('Argument must be a Buffer') } if (start === undefined) { start = 0 } if (end === undefined) { end = target ? target.length : 0 } if (thisStart === undefined) { thisStart = 0 } if (thisEnd === undefined) { thisEnd = this.length } if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { throw new RangeError('out of range index') } if (thisStart >= thisEnd && start >= end) { return 0 } if (thisStart >= thisEnd) { return -1 } if (start >= end) { return 1 } start >>>= 0 end >>>= 0 thisStart >>>= 0 thisEnd >>>= 0 if (this === target) return 0 var x = thisEnd - thisStart var y = end - start var len = Math.min(x, y) var thisCopy = this.slice(thisStart, thisEnd) var targetCopy = target.slice(start, end) for (var i = 0; i < len; ++i) { if (thisCopy[i] !== targetCopy[i]) { x = thisCopy[i] y = targetCopy[i] break } } if (x < y) return -1 if (y < x) return 1 return 0 } function arrayIndexOf (arr, val, byteOffset, encoding) { var indexSize = 1 var arrLength = arr.length var valLength = val.length if (encoding !== undefined) { encoding = String(encoding).toLowerCase() if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { if (arr.length < 2 || val.length < 2) { return -1 } indexSize = 2 arrLength /= 2 valLength /= 2 byteOffset /= 2 } } function read (buf, i) { if (indexSize === 1) { return buf[i] } else { return buf.readUInt16BE(i * indexSize) } } var foundIndex = -1 for (var i = 0; byteOffset + i < arrLength; i++) { if (read(arr, byteOffset + i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { if (foundIndex === -1) foundIndex = i if (i - foundIndex + 1 === valLength) return (byteOffset + foundIndex) * indexSize } else { if (foundIndex !== -1) i -= i - foundIndex foundIndex = -1 } } return -1 } Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { if (typeof byteOffset === 'string') { encoding = byteOffset byteOffset = 0 } else if (byteOffset > 0x7fffffff) { byteOffset = 0x7fffffff } else if (byteOffset < -0x80000000) { byteOffset = -0x80000000 } byteOffset >>= 0 if (this.length === 0) return -1 if (byteOffset >= this.length) return -1 // Negative offsets start from the end of the buffer if (byteOffset < 0) byteOffset = Math.max(this.length + byteOffset, 0) if (typeof val === 'string') { val = Buffer.from(val, encoding) } if (Buffer.isBuffer(val)) { // special case: looking for empty string/buffer always fails if (val.length === 0) { return -1 } return arrayIndexOf(this, val, byteOffset, encoding) } if (typeof val === 'number') { if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') { return Uint8Array.prototype.indexOf.call(this, val, byteOffset) } return arrayIndexOf(this, [ val ], byteOffset, encoding) } throw new TypeError('val must be string, number or Buffer') } Buffer.prototype.includes = function includes (val, byteOffset, encoding) { return this.indexOf(val, byteOffset, encoding) !== -1 } function hexWrite (buf, string, offset, length) { offset = Number(offset) || 0 var remaining = buf.length - offset if (!length) { length = remaining } else { length = Number(length) if (length > remaining) { length = remaining } } // must be an even number of digits var strLen = string.length if (strLen % 2 !== 0) throw new Error('Invalid hex string') if (length > strLen / 2) { length = strLen / 2 } for (var i = 0; i < length; i++) { var parsed = parseInt(string.substr(i * 2, 2), 16) if (isNaN(parsed)) return i buf[offset + i] = parsed } return i } function utf8Write (buf, string, offset, length) { return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) } function asciiWrite (buf, string, offset, length) { return blitBuffer(asciiToBytes(string), buf, offset, length) } function binaryWrite (buf, string, offset, length) { return asciiWrite(buf, string, offset, length) } function base64Write (buf, string, offset, length) { return blitBuffer(base64ToBytes(string), buf, offset, length) } function ucs2Write (buf, string, offset, length) { return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) } Buffer.prototype.write = function write (string, offset, length, encoding) { // Buffer#write(string) if (offset === undefined) { encoding = 'utf8' length = this.length offset = 0 // Buffer#write(string, encoding) } else if (length === undefined && typeof offset === 'string') { encoding = offset length = this.length offset = 0 // Buffer#write(string, offset[, length][, encoding]) } else if (isFinite(offset)) { offset = offset | 0 if (isFinite(length)) { length = length | 0 if (encoding === undefined) encoding = 'utf8' } else { encoding = length length = undefined } // legacy write(string, encoding, offset, length) - remove in v0.13 } else { throw new Error( 'Buffer.write(string, encoding, offset[, length]) is no longer supported' ) } var remaining = this.length - offset if (length === undefined || length > remaining) length = remaining if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { throw new RangeError('Attempt to write outside buffer bounds') } if (!encoding) encoding = 'utf8' var loweredCase = false for (;;) { switch (encoding) { case 'hex': return hexWrite(this, string, offset, length) case 'utf8': case 'utf-8': return utf8Write(this, string, offset, length) case 'ascii': return asciiWrite(this, string, offset, length) case 'binary': return binaryWrite(this, string, offset, length) case 'base64': // Warning: maxLength not taken into account in base64Write return base64Write(this, string, offset, length) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return ucs2Write(this, string, offset, length) default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) encoding = ('' + encoding).toLowerCase() loweredCase = true } } } Buffer.prototype.toJSON = function toJSON () { return { type: 'Buffer', data: Array.prototype.slice.call(this._arr || this, 0) } } function base64Slice (buf, start, end) { if (start === 0 && end === buf.length) { return base64.fromByteArray(buf) } else { return base64.fromByteArray(buf.slice(start, end)) } } function utf8Slice (buf, start, end) { end = Math.min(buf.length, end) var res = [] var i = start while (i < end) { var firstByte = buf[i] var codePoint = null var bytesPerSequence = (firstByte > 0xEF) ? 4 : (firstByte > 0xDF) ? 3 : (firstByte > 0xBF) ? 2 : 1 if (i + bytesPerSequence <= end) { var secondByte, thirdByte, fourthByte, tempCodePoint switch (bytesPerSequence) { case 1: if (firstByte < 0x80) { codePoint = firstByte } break case 2: secondByte = buf[i + 1] if ((secondByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) if (tempCodePoint > 0x7F) { codePoint = tempCodePoint } } break case 3: secondByte = buf[i + 1] thirdByte = buf[i + 2] if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { codePoint = tempCodePoint } } break case 4: secondByte = buf[i + 1] thirdByte = buf[i + 2] fourthByte = buf[i + 3] if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { codePoint = tempCodePoint } } } } if (codePoint === null) { // we did not generate a valid codePoint so insert a // replacement char (U+FFFD) and advance only 1 byte codePoint = 0xFFFD bytesPerSequence = 1 } else if (codePoint > 0xFFFF) { // encode to utf16 (surrogate pair dance) codePoint -= 0x10000 res.push(codePoint >>> 10 & 0x3FF | 0xD800) codePoint = 0xDC00 | codePoint & 0x3FF } res.push(codePoint) i += bytesPerSequence } return decodeCodePointsArray(res) } // Based on http://stackoverflow.com/a/22747272/680742, the browser with // the lowest limit is Chrome, with 0x10000 args. // We go 1 magnitude less, for safety var MAX_ARGUMENTS_LENGTH = 0x1000 function decodeCodePointsArray (codePoints) { var len = codePoints.length if (len <= MAX_ARGUMENTS_LENGTH) { return String.fromCharCode.apply(String, codePoints) // avoid extra slice() } // Decode in chunks to avoid "call stack size exceeded". var res = '' var i = 0 while (i < len) { res += String.fromCharCode.apply( String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) ) } return res } function asciiSlice (buf, start, end) { var ret = '' end = Math.min(buf.length, end) for (var i = start; i < end; i++) { ret += String.fromCharCode(buf[i] & 0x7F) } return ret } function binarySlice (buf, start, end) { var ret = '' end = Math.min(buf.length, end) for (var i = start; i < end; i++) { ret += String.fromCharCode(buf[i]) } return ret } function hexSlice (buf, start, end) { var len = buf.length if (!start || start < 0) start = 0 if (!end || end < 0 || end > len) end = len var out = '' for (var i = start; i < end; i++) { out += toHex(buf[i]) } return out } function utf16leSlice (buf, start, end) { var bytes = buf.slice(start, end) var res = '' for (var i = 0; i < bytes.length; i += 2) { res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) } return res } Buffer.prototype.slice = function slice (start, end) { var len = this.length start = ~~start end = end === undefined ? len : ~~end if (start < 0) { start += len if (start < 0) start = 0 } else if (start > len) { start = len } if (end < 0) { end += len if (end < 0) end = 0 } else if (end > len) { end = len } if (end < start) end = start var newBuf if (Buffer.TYPED_ARRAY_SUPPORT) { newBuf = this.subarray(start, end) newBuf.__proto__ = Buffer.prototype } else { var sliceLen = end - start newBuf = new Buffer(sliceLen, undefined) for (var i = 0; i < sliceLen; i++) { newBuf[i] = this[i + start] } } return newBuf } /* * Need to make sure that buffer isn't trying to write out of bounds. */ function checkOffset (offset, ext, length) { if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') } Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) checkOffset(offset, byteLength, this.length) var val = this[offset] var mul = 1 var i = 0 while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul } return val } Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) { checkOffset(offset, byteLength, this.length) } var val = this[offset + --byteLength] var mul = 1 while (byteLength > 0 && (mul *= 0x100)) { val += this[offset + --byteLength] * mul } return val } Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { if (!noAssert) checkOffset(offset, 1, this.length) return this[offset] } Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) return this[offset] | (this[offset + 1] << 8) } Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) return (this[offset] << 8) | this[offset + 1] } Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return ((this[offset]) | (this[offset + 1] << 8) | (this[offset + 2] << 16)) + (this[offset + 3] * 0x1000000) } Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset] * 0x1000000) + ((this[offset + 1] << 16) | (this[offset + 2] << 8) | this[offset + 3]) } Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) checkOffset(offset, byteLength, this.length) var val = this[offset] var mul = 1 var i = 0 while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul } mul *= 0x80 if (val >= mul) val -= Math.pow(2, 8 * byteLength) return val } Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) checkOffset(offset, byteLength, this.length) var i = byteLength var mul = 1 var val = this[offset + --i] while (i > 0 && (mul *= 0x100)) { val += this[offset + --i] * mul } mul *= 0x80 if (val >= mul) val -= Math.pow(2, 8 * byteLength) return val } Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { if (!noAssert) checkOffset(offset, 1, this.length) if (!(this[offset] & 0x80)) return (this[offset]) return ((0xff - this[offset] + 1) * -1) } Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) var val = this[offset] | (this[offset + 1] << 8) return (val & 0x8000) ? val | 0xFFFF0000 : val } Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) var val = this[offset + 1] | (this[offset] << 8) return (val & 0x8000) ? val | 0xFFFF0000 : val } Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset]) | (this[offset + 1] << 8) | (this[offset + 2] << 16) | (this[offset + 3] << 24) } Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset] << 24) | (this[offset + 1] << 16) | (this[offset + 2] << 8) | (this[offset + 3]) } Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, true, 23, 4) } Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, false, 23, 4) } Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { if (!noAssert) checkOffset(offset, 8, this.length) return ieee754.read(this, offset, true, 52, 8) } Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { if (!noAssert) checkOffset(offset, 8, this.length) return ieee754.read(this, offset, false, 52, 8) } function checkInt (buf, value, offset, ext, max, min) { if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') if (offset + ext > buf.length) throw new RangeError('Index out of range') } Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { value = +value offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) { var maxBytes = Math.pow(2, 8 * byteLength) - 1 checkInt(this, value, offset, byteLength, maxBytes, 0) } var mul = 1 var i = 0 this[offset] = value & 0xFF while (++i < byteLength && (mul *= 0x100)) { this[offset + i] = (value / mul) & 0xFF } return offset + byteLength } Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { value = +value offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) { var maxBytes = Math.pow(2, 8 * byteLength) - 1 checkInt(this, value, offset, byteLength, maxBytes, 0) } var i = byteLength - 1 var mul = 1 this[offset + i] = value & 0xFF while (--i >= 0 && (mul *= 0x100)) { this[offset + i] = (value / mul) & 0xFF } return offset + byteLength } Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) this[offset] = (value & 0xff) return offset + 1 } function objectWriteUInt16 (buf, value, offset, littleEndian) { if (value < 0) value = 0xffff + value + 1 for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) { buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> (littleEndian ? i : 1 - i) * 8 } } Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) } else { objectWriteUInt16(this, value, offset, true) } return offset + 2 } Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 8) this[offset + 1] = (value & 0xff) } else { objectWriteUInt16(this, value, offset, false) } return offset + 2 } function objectWriteUInt32 (buf, value, offset, littleEndian) { if (value < 0) value = 0xffffffff + value + 1 for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) { buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff } } Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset + 3] = (value >>> 24) this[offset + 2] = (value >>> 16) this[offset + 1] = (value >>> 8) this[offset] = (value & 0xff) } else { objectWriteUInt32(this, value, offset, true) } return offset + 4 } Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 24) this[offset + 1] = (value >>> 16) this[offset + 2] = (value >>> 8) this[offset + 3] = (value & 0xff) } else { objectWriteUInt32(this, value, offset, false) } return offset + 4 } Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { value = +value offset = offset | 0 if (!noAssert) { var limit = Math.pow(2, 8 * byteLength - 1) checkInt(this, value, offset, byteLength, limit - 1, -limit) } var i = 0 var mul = 1 var sub = 0 this[offset] = value & 0xFF while (++i < byteLength && (mul *= 0x100)) { if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { sub = 1 } this[offset + i] = ((value / mul) >> 0) - sub & 0xFF } return offset + byteLength } Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { value = +value offset = offset | 0 if (!noAssert) { var limit = Math.pow(2, 8 * byteLength - 1) checkInt(this, value, offset, byteLength, limit - 1, -limit) } var i = byteLength - 1 var mul = 1 var sub = 0 this[offset + i] = value & 0xFF while (--i >= 0 && (mul *= 0x100)) { if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { sub = 1 } this[offset + i] = ((value / mul) >> 0) - sub & 0xFF } return offset + byteLength } Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) if (value < 0) value = 0xff + value + 1 this[offset] = (value & 0xff) return offset + 1 } Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) } else { objectWriteUInt16(this, value, offset, true) } return offset + 2 } Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 8) this[offset + 1] = (value & 0xff) } else { objectWriteUInt16(this, value, offset, false) } return offset + 2 } Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) this[offset + 2] = (value >>> 16) this[offset + 3] = (value >>> 24) } else { objectWriteUInt32(this, value, offset, true) } return offset + 4 } Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) if (value < 0) value = 0xffffffff + value + 1 if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 24) this[offset + 1] = (value >>> 16) this[offset + 2] = (value >>> 8) this[offset + 3] = (value & 0xff) } else { objectWriteUInt32(this, value, offset, false) } return offset + 4 } function checkIEEE754 (buf, value, offset, ext, max, min) { if (offset + ext > buf.length) throw new RangeError('Index out of range') if (offset < 0) throw new RangeError('Index out of range') } function writeFloat (buf, value, offset, littleEndian, noAssert) { if (!noAssert) { checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) } ieee754.write(buf, value, offset, littleEndian, 23, 4) return offset + 4 } Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { return writeFloat(this, value, offset, true, noAssert) } Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { return writeFloat(this, value, offset, false, noAssert) } function writeDouble (buf, value, offset, littleEndian, noAssert) { if (!noAssert) { checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) } ieee754.write(buf, value, offset, littleEndian, 52, 8) return offset + 8 } Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { return writeDouble(this, value, offset, true, noAssert) } Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { return writeDouble(this, value, offset, false, noAssert) } // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) Buffer.prototype.copy = function copy (target, targetStart, start, end) { if (!start) start = 0 if (!end && end !== 0) end = this.length if (targetStart >= target.length) targetStart = target.length if (!targetStart) targetStart = 0 if (end > 0 && end < start) end = start // Copy 0 bytes; we're done if (end === start) return 0 if (target.length === 0 || this.length === 0) return 0 // Fatal error conditions if (targetStart < 0) { throw new RangeError('targetStart out of bounds') } if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') if (end < 0) throw new RangeError('sourceEnd out of bounds') // Are we oob? if (end > this.length) end = this.length if (target.length - targetStart < end - start) { end = target.length - targetStart + start } var len = end - start var i if (this === target && start < targetStart && targetStart < end) { // descending copy from end for (i = len - 1; i >= 0; i--) { target[i + targetStart] = this[i + start] } } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { // ascending copy from start for (i = 0; i < len; i++) { target[i + targetStart] = this[i + start] } } else { Uint8Array.prototype.set.call( target, this.subarray(start, start + len), targetStart ) } return len } // Usage: // buffer.fill(number[, offset[, end]]) // buffer.fill(buffer[, offset[, end]]) // buffer.fill(string[, offset[, end]][, encoding]) Buffer.prototype.fill = function fill (val, start, end, encoding) { // Handle string cases: if (typeof val === 'string') { if (typeof start === 'string') { encoding = start start = 0 end = this.length } else if (typeof end === 'string') { encoding = end end = this.length } if (val.length === 1) { var code = val.charCodeAt(0) if (code < 256) { val = code } } if (encoding !== undefined && typeof encoding !== 'string') { throw new TypeError('encoding must be a string') } if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { throw new TypeError('Unknown encoding: ' + encoding) } } else if (typeof val === 'number') { val = val & 255 } // Invalid ranges are not set to a default, so can range check early. if (start < 0 || this.length < start || this.length < end) { throw new RangeError('Out of range index') } if (end <= start) { return this } start = start >>> 0 end = end === undefined ? this.length : end >>> 0 if (!val) val = 0 var i if (typeof val === 'number') { for (i = start; i < end; i++) { this[i] = val } } else { var bytes = Buffer.isBuffer(val) ? val : utf8ToBytes(new Buffer(val, encoding).toString()) var len = bytes.length for (i = 0; i < end - start; i++) { this[i + start] = bytes[i % len] } } return this } // HELPER FUNCTIONS // ================ var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g function base64clean (str) { // Node strips out invalid characters like \n and \t from the string, base64-js does not str = stringtrim(str).replace(INVALID_BASE64_RE, '') // Node converts strings with length < 2 to '' if (str.length < 2) return '' // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not while (str.length % 4 !== 0) { str = str + '=' } return str } function stringtrim (str) { if (str.trim) return str.trim() return str.replace(/^\s+|\s+$/g, '') } function toHex (n) { if (n < 16) return '0' + n.toString(16) return n.toString(16) } function utf8ToBytes (string, units) { units = units || Infinity var codePoint var length = string.length var leadSurrogate = null var bytes = [] for (var i = 0; i < length; i++) { codePoint = string.charCodeAt(i) // is surrogate component if (codePoint > 0xD7FF && codePoint < 0xE000) { // last char was a lead if (!leadSurrogate) { // no lead yet if (codePoint > 0xDBFF) { // unexpected trail if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) continue } else if (i + 1 === length) { // unpaired lead if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) continue } // valid lead leadSurrogate = codePoint continue } // 2 leads in a row if (codePoint < 0xDC00) { if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) leadSurrogate = codePoint continue } // valid surrogate pair codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 } else if (leadSurrogate) { // valid bmp char, but last char was a lead if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) } leadSurrogate = null // encode utf8 if (codePoint < 0x80) { if ((units -= 1) < 0) break bytes.push(codePoint) } else if (codePoint < 0x800) { if ((units -= 2) < 0) break bytes.push( codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80 ) } else if (codePoint < 0x10000) { if ((units -= 3) < 0) break bytes.push( codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80 ) } else if (codePoint < 0x110000) { if ((units -= 4) < 0) break bytes.push( codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80 ) } else { throw new Error('Invalid code point') } } return bytes } function asciiToBytes (str) { var byteArray = [] for (var i = 0; i < str.length; i++) { // Node's code seems to be doing this and not & 0x7F.. byteArray.push(str.charCodeAt(i) & 0xFF) } return byteArray } function utf16leToBytes (str, units) { var c, hi, lo var byteArray = [] for (var i = 0; i < str.length; i++) { if ((units -= 2) < 0) break c = str.charCodeAt(i) hi = c >> 8 lo = c % 256 byteArray.push(lo) byteArray.push(hi) } return byteArray } function base64ToBytes (str) { return base64.toByteArray(base64clean(str)) } function blitBuffer (src, dst, offset, length) { for (var i = 0; i < length; i++) { if ((i + offset >= dst.length) || (i >= src.length)) break dst[i + offset] = src[i] } return i } function isnan (val) { return val !== val // eslint-disable-line no-self-compare } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"base64-js":17,"ieee754":93,"isarray":97}],48:[function(require,module,exports){ module.exports = { "100": "Continue", "101": "Switching Protocols", "102": "Processing", "200": "OK", "201": "Created", "202": "Accepted", "203": "Non-Authoritative Information", "204": "No Content", "205": "Reset Content", "206": "Partial Content", "207": "Multi-Status", "208": "Already Reported", "226": "IM Used", "300": "Multiple Choices", "301": "Moved Permanently", "302": "Found", "303": "See Other", "304": "Not Modified", "305": "Use Proxy", "307": "Temporary Redirect", "308": "Permanent Redirect", "400": "Bad Request", "401": "Unauthorized", "402": "Payment Required", "403": "Forbidden", "404": "Not Found", "405": "Method Not Allowed", "406": "Not Acceptable", "407": "Proxy Authentication Required", "408": "Request Timeout", "409": "Conflict", "410": "Gone", "411": "Length Required", "412": "Precondition Failed", "413": "Payload Too Large", "414": "URI Too Long", "415": "Unsupported Media Type", "416": "Range Not Satisfiable", "417": "Expectation Failed", "418": "I'm a teapot", "421": "Misdirected Request", "422": "Unprocessable Entity", "423": "Locked", "424": "Failed Dependency", "425": "Unordered Collection", "426": "Upgrade Required", "428": "Precondition Required", "429": "Too Many Requests", "431": "Request Header Fields Too Large", "500": "Internal Server Error", "501": "Not Implemented", "502": "Bad Gateway", "503": "Service Unavailable", "504": "Gateway Timeout", "505": "HTTP Version Not Supported", "506": "Variant Also Negotiates", "507": "Insufficient Storage", "508": "Loop Detected", "509": "Bandwidth Limit Exceeded", "510": "Not Extended", "511": "Network Authentication Required" } },{}],49:[function(require,module,exports){ (function (Buffer){ var Transform = require('stream').Transform var inherits = require('inherits') var StringDecoder = require('string_decoder').StringDecoder module.exports = CipherBase inherits(CipherBase, Transform) function CipherBase (hashMode) { Transform.call(this) this.hashMode = typeof hashMode === 'string' if (this.hashMode) { this[hashMode] = this._finalOrDigest } else { this.final = this._finalOrDigest } this._decoder = null this._encoding = null } CipherBase.prototype.update = function (data, inputEnc, outputEnc) { if (typeof data === 'string') { data = new Buffer(data, inputEnc) } var outData = this._update(data) if (this.hashMode) { return this } if (outputEnc) { outData = this._toString(outData, outputEnc) } return outData } CipherBase.prototype.setAutoPadding = function () {} CipherBase.prototype.getAuthTag = function () { throw new Error('trying to get auth tag in unsupported state') } CipherBase.prototype.setAuthTag = function () { throw new Error('trying to set auth tag in unsupported state') } CipherBase.prototype.setAAD = function () { throw new Error('trying to set aad in unsupported state') } CipherBase.prototype._transform = function (data, _, next) { var err try { if (this.hashMode) { this._update(data) } else { this.push(this._update(data)) } } catch (e) { err = e } finally { next(err) } } CipherBase.prototype._flush = function (done) { var err try { this.push(this._final()) } catch (e) { err = e } finally { done(err) } } CipherBase.prototype._finalOrDigest = function (outputEnc) { var outData = this._final() || new Buffer('') if (outputEnc) { outData = this._toString(outData, outputEnc, true) } return outData } CipherBase.prototype._toString = function (value, enc, final) { if (!this._decoder) { this._decoder = new StringDecoder(enc) this._encoding = enc } if (this._encoding !== enc) { throw new Error('can\'t switch encodings') } var out = this._decoder.write(value) if (final) { out += this._decoder.end() } return out } }).call(this,require("buffer").Buffer) },{"buffer":47,"inherits":95,"stream":139,"string_decoder":144}],50:[function(require,module,exports){ (function (Buffer){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. function isArray(arg) { if (Array.isArray) { return Array.isArray(arg); } return objectToString(arg) === '[object Array]'; } exports.isArray = isArray; function isBoolean(arg) { return typeof arg === 'boolean'; } exports.isBoolean = isBoolean; function isNull(arg) { return arg === null; } exports.isNull = isNull; function isNullOrUndefined(arg) { return arg == null; } exports.isNullOrUndefined = isNullOrUndefined; function isNumber(arg) { return typeof arg === 'number'; } exports.isNumber = isNumber; function isString(arg) { return typeof arg === 'string'; } exports.isString = isString; function isSymbol(arg) { return typeof arg === 'symbol'; } exports.isSymbol = isSymbol; function isUndefined(arg) { return arg === void 0; } exports.isUndefined = isUndefined; function isRegExp(re) { return objectToString(re) === '[object RegExp]'; } exports.isRegExp = isRegExp; function isObject(arg) { return typeof arg === 'object' && arg !== null; } exports.isObject = isObject; function isDate(d) { return objectToString(d) === '[object Date]'; } exports.isDate = isDate; function isError(e) { return (objectToString(e) === '[object Error]' || e instanceof Error); } exports.isError = isError; function isFunction(arg) { return typeof arg === 'function'; } exports.isFunction = isFunction; function isPrimitive(arg) { return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || typeof arg === 'symbol' || // ES6 symbol typeof arg === 'undefined'; } exports.isPrimitive = isPrimitive; exports.isBuffer = Buffer.isBuffer; function objectToString(o) { return Object.prototype.toString.call(o); } }).call(this,{"isBuffer":require("../../is-buffer/index.js")}) },{"../../is-buffer/index.js":96}],51:[function(require,module,exports){ (function (Buffer){ var elliptic = require('elliptic'); var BN = require('bn.js'); module.exports = function createECDH(curve) { return new ECDH(curve); }; var aliases = { secp256k1: { name: 'secp256k1', byteLength: 32 }, secp224r1: { name: 'p224', byteLength: 28 }, prime256v1: { name: 'p256', byteLength: 32 }, prime192v1: { name: 'p192', byteLength: 24 }, ed25519: { name: 'ed25519', byteLength: 32 }, secp384r1: { name: 'p384', byteLength: 48 }, secp521r1: { name: 'p521', byteLength: 66 } }; aliases.p224 = aliases.secp224r1; aliases.p256 = aliases.secp256r1 = aliases.prime256v1; aliases.p192 = aliases.secp192r1 = aliases.prime192v1; aliases.p384 = aliases.secp384r1; aliases.p521 = aliases.secp521r1; function ECDH(curve) { this.curveType = aliases[curve]; if (!this.curveType ) { this.curveType = { name: curve }; } this.curve = new elliptic.ec(this.curveType.name); this.keys = void 0; } ECDH.prototype.generateKeys = function (enc, format) { this.keys = this.curve.genKeyPair(); return this.getPublicKey(enc, format); }; ECDH.prototype.computeSecret = function (other, inenc, enc) { inenc = inenc || 'utf8'; if (!Buffer.isBuffer(other)) { other = new Buffer(other, inenc); } var otherPub = this.curve.keyFromPublic(other).getPublic(); var out = otherPub.mul(this.keys.getPrivate()).getX(); return formatReturnValue(out, enc, this.curveType.byteLength); }; ECDH.prototype.getPublicKey = function (enc, format) { var key = this.keys.getPublic(format === 'compressed', true); if (format === 'hybrid') { if (key[key.length - 1] % 2) { key[0] = 7; } else { key [0] = 6; } } return formatReturnValue(key, enc); }; ECDH.prototype.getPrivateKey = function (enc) { return formatReturnValue(this.keys.getPrivate(), enc); }; ECDH.prototype.setPublicKey = function (pub, enc) { enc = enc || 'utf8'; if (!Buffer.isBuffer(pub)) { pub = new Buffer(pub, enc); } this.keys._importPublic(pub); return this; }; ECDH.prototype.setPrivateKey = function (priv, enc) { enc = enc || 'utf8'; if (!Buffer.isBuffer(priv)) { priv = new Buffer(priv, enc); } var _priv = new BN(priv); _priv = _priv.toString(16); this.keys._importPrivate(_priv); return this; }; function formatReturnValue(bn, enc, len) { if (!Array.isArray(bn)) { bn = bn.toArray(); } var buf = new Buffer(bn); if (len && buf.length < len) { var zeros = new Buffer(len - buf.length); zeros.fill(0); buf = Buffer.concat([zeros, buf]); } if (!enc) { return buf; } else { return buf.toString(enc); } } }).call(this,require("buffer").Buffer) },{"bn.js":18,"buffer":47,"elliptic":67}],52:[function(require,module,exports){ (function (Buffer){ 'use strict'; var inherits = require('inherits') var md5 = require('./md5') var rmd160 = require('ripemd160') var sha = require('sha.js') var Base = require('cipher-base') function HashNoConstructor(hash) { Base.call(this, 'digest') this._hash = hash this.buffers = [] } inherits(HashNoConstructor, Base) HashNoConstructor.prototype._update = function (data) { this.buffers.push(data) } HashNoConstructor.prototype._final = function () { var buf = Buffer.concat(this.buffers) var r = this._hash(buf) this.buffers = null return r } function Hash(hash) { Base.call(this, 'digest') this._hash = hash } inherits(Hash, Base) Hash.prototype._update = function (data) { this._hash.update(data) } Hash.prototype._final = function () { return this._hash.digest() } module.exports = function createHash (alg) { alg = alg.toLowerCase() if ('md5' === alg) return new HashNoConstructor(md5) if ('rmd160' === alg || 'ripemd160' === alg) return new HashNoConstructor(rmd160) return new Hash(sha(alg)) } }).call(this,require("buffer").Buffer) },{"./md5":54,"buffer":47,"cipher-base":49,"inherits":95,"ripemd160":130,"sha.js":132}],53:[function(require,module,exports){ (function (Buffer){ 'use strict'; var intSize = 4; var zeroBuffer = new Buffer(intSize); zeroBuffer.fill(0); var chrsz = 8; function toArray(buf, bigEndian) { if ((buf.length % intSize) !== 0) { var len = buf.length + (intSize - (buf.length % intSize)); buf = Buffer.concat([buf, zeroBuffer], len); } var arr = []; var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE; for (var i = 0; i < buf.length; i += intSize) { arr.push(fn.call(buf, i)); } return arr; } function toBuffer(arr, size, bigEndian) { var buf = new Buffer(size); var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE; for (var i = 0; i < arr.length; i++) { fn.call(buf, arr[i], i * 4, true); } return buf; } function hash(buf, fn, hashSize, bigEndian) { if (!Buffer.isBuffer(buf)) buf = new Buffer(buf); var arr = fn(toArray(buf, bigEndian), buf.length * chrsz); return toBuffer(arr, hashSize, bigEndian); } exports.hash = hash; }).call(this,require("buffer").Buffer) },{"buffer":47}],54:[function(require,module,exports){ 'use strict'; /* * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message * Digest Algorithm, as defined in RFC 1321. * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet * Distributed under the BSD License * See http://pajhome.org.uk/crypt/md5 for more info. */ var helpers = require('./helpers'); /* * Calculate the MD5 of an array of little-endian words, and a bit length */ function core_md5(x, len) { /* append padding */ x[len >> 5] |= 0x80 << ((len) % 32); x[(((len + 64) >>> 9) << 4) + 14] = len; var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; for(var i = 0; i < x.length; i += 16) { var olda = a; var oldb = b; var oldc = c; var oldd = d; a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936); d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586); c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819); b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330); a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897); d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426); c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341); b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983); a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416); d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417); c = md5_ff(c, d, a, b, x[i+10], 17, -42063); b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162); a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682); d = md5_ff(d, a, b, c, x[i+13], 12, -40341101); c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290); b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329); a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510); d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632); c = md5_gg(c, d, a, b, x[i+11], 14, 643717713); b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302); a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691); d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083); c = md5_gg(c, d, a, b, x[i+15], 14, -660478335); b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848); a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438); d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690); c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961); b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501); a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467); d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784); c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473); b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734); a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558); d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463); c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562); b = md5_hh(b, c, d, a, x[i+14], 23, -35309556); a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060); d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353); c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632); b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640); a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174); d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222); c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979); b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189); a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487); d = md5_hh(d, a, b, c, x[i+12], 11, -421815835); c = md5_hh(c, d, a, b, x[i+15], 16, 530742520); b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651); a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844); d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415); c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905); b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055); a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571); d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606); c = md5_ii(c, d, a, b, x[i+10], 15, -1051523); b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799); a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359); d = md5_ii(d, a, b, c, x[i+15], 10, -30611744); c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380); b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649); a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070); d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379); c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259); b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551); a = safe_add(a, olda); b = safe_add(b, oldb); c = safe_add(c, oldc); d = safe_add(d, oldd); } return Array(a, b, c, d); } /* * These functions implement the four basic operations the algorithm uses. */ function md5_cmn(q, a, b, x, s, t) { return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); } function md5_ff(a, b, c, d, x, s, t) { return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); } function md5_gg(a, b, c, d, x, s, t) { return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); } function md5_hh(a, b, c, d, x, s, t) { return md5_cmn(b ^ c ^ d, a, b, x, s, t); } function md5_ii(a, b, c, d, x, s, t) { return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); } /* * Add integers, wrapping at 2^32. This uses 16-bit operations internally * to work around bugs in some JS interpreters. */ function safe_add(x, y) { var lsw = (x & 0xFFFF) + (y & 0xFFFF); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xFFFF); } /* * Bitwise rotate a 32-bit number to the left. */ function bit_rol(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)); } module.exports = function md5(buf) { return helpers.hash(buf, core_md5, 16); }; },{"./helpers":53}],55:[function(require,module,exports){ (function (Buffer){ 'use strict'; var createHash = require('create-hash/browser'); var inherits = require('inherits') var Transform = require('stream').Transform var ZEROS = new Buffer(128) ZEROS.fill(0) function Hmac(alg, key) { Transform.call(this) alg = alg.toLowerCase() if (typeof key === 'string') { key = new Buffer(key) } var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64 this._alg = alg this._key = key if (key.length > blocksize) { key = createHash(alg).update(key).digest() } else if (key.length < blocksize) { key = Buffer.concat([key, ZEROS], blocksize) } var ipad = this._ipad = new Buffer(blocksize) var opad = this._opad = new Buffer(blocksize) for (var i = 0; i < blocksize; i++) { ipad[i] = key[i] ^ 0x36 opad[i] = key[i] ^ 0x5C } this._hash = createHash(alg).update(ipad) } inherits(Hmac, Transform) Hmac.prototype.update = function (data, enc) { this._hash.update(data, enc) return this } Hmac.prototype._transform = function (data, _, next) { this._hash.update(data) next() } Hmac.prototype._flush = function (next) { this.push(this.digest()) next() } Hmac.prototype.digest = function (enc) { var h = this._hash.digest() return createHash(this._alg).update(this._opad).update(h).digest(enc) } module.exports = function createHmac(alg, key) { return new Hmac(alg, key) } }).call(this,require("buffer").Buffer) },{"buffer":47,"create-hash/browser":52,"inherits":95,"stream":139}],56:[function(require,module,exports){ 'use strict' exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require('randombytes') exports.createHash = exports.Hash = require('create-hash') exports.createHmac = exports.Hmac = require('create-hmac') var hashes = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'].concat(Object.keys(require('browserify-sign/algos'))) exports.getHashes = function () { return hashes } var p = require('pbkdf2') exports.pbkdf2 = p.pbkdf2 exports.pbkdf2Sync = p.pbkdf2Sync var aes = require('browserify-cipher') ;[ 'Cipher', 'createCipher', 'Cipheriv', 'createCipheriv', 'Decipher', 'createDecipher', 'Decipheriv', 'createDecipheriv', 'getCiphers', 'listCiphers' ].forEach(function (key) { exports[key] = aes[key] }) var dh = require('diffie-hellman') ;[ 'DiffieHellmanGroup', 'createDiffieHellmanGroup', 'getDiffieHellman', 'createDiffieHellman', 'DiffieHellman' ].forEach(function (key) { exports[key] = dh[key] }) var sign = require('browserify-sign') ;[ 'createSign', 'Sign', 'createVerify', 'Verify' ].forEach(function (key) { exports[key] = sign[key] }) exports.createECDH = require('create-ecdh') var publicEncrypt = require('public-encrypt') ;[ 'publicEncrypt', 'privateEncrypt', 'publicDecrypt', 'privateDecrypt' ].forEach(function (key) { exports[key] = publicEncrypt[key] }) // the least I can do is make error messages for the rest of the node.js/crypto api. ;[ 'createCredentials' ].forEach(function (name) { exports[name] = function () { throw new Error([ 'sorry, ' + name + ' is not implemented yet', 'we accept pull requests', 'https://github.com/crypto-browserify/crypto-browserify' ].join('\n')) } }) },{"browserify-cipher":36,"browserify-sign":41,"browserify-sign/algos":40,"create-ecdh":51,"create-hash":52,"create-hmac":55,"diffie-hellman":63,"pbkdf2":106,"public-encrypt":109,"randombytes":119}],57:[function(require,module,exports){ 'use strict'; exports.utils = require('./des/utils'); exports.Cipher = require('./des/cipher'); exports.DES = require('./des/des'); exports.CBC = require('./des/cbc'); exports.EDE = require('./des/ede'); },{"./des/cbc":58,"./des/cipher":59,"./des/des":60,"./des/ede":61,"./des/utils":62}],58:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); var inherits = require('inherits'); var proto = {}; function CBCState(iv) { assert.equal(iv.length, 8, 'Invalid IV length'); this.iv = new Array(8); for (var i = 0; i < this.iv.length; i++) this.iv[i] = iv[i]; } function instantiate(Base) { function CBC(options) { Base.call(this, options); this._cbcInit(); } inherits(CBC, Base); var keys = Object.keys(proto); for (var i = 0; i < keys.length; i++) { var key = keys[i]; CBC.prototype[key] = proto[key]; } CBC.create = function create(options) { return new CBC(options); }; return CBC; } exports.instantiate = instantiate; proto._cbcInit = function _cbcInit() { var state = new CBCState(this.options.iv); this._cbcState = state; }; proto._update = function _update(inp, inOff, out, outOff) { var state = this._cbcState; var superProto = this.constructor.super_.prototype; var iv = state.iv; if (this.type === 'encrypt') { for (var i = 0; i < this.blockSize; i++) iv[i] ^= inp[inOff + i]; superProto._update.call(this, iv, 0, out, outOff); for (var i = 0; i < this.blockSize; i++) iv[i] = out[outOff + i]; } else { superProto._update.call(this, inp, inOff, out, outOff); for (var i = 0; i < this.blockSize; i++) out[outOff + i] ^= iv[i]; for (var i = 0; i < this.blockSize; i++) iv[i] = inp[inOff + i]; } }; },{"inherits":95,"minimalistic-assert":99}],59:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); function Cipher(options) { this.options = options; this.type = this.options.type; this.blockSize = 8; this._init(); this.buffer = new Array(this.blockSize); this.bufferOff = 0; } module.exports = Cipher; Cipher.prototype._init = function _init() { // Might be overrided }; Cipher.prototype.update = function update(data) { if (data.length === 0) return []; if (this.type === 'decrypt') return this._updateDecrypt(data); else return this._updateEncrypt(data); }; Cipher.prototype._buffer = function _buffer(data, off) { // Append data to buffer var min = Math.min(this.buffer.length - this.bufferOff, data.length - off); for (var i = 0; i < min; i++) this.buffer[this.bufferOff + i] = data[off + i]; this.bufferOff += min; // Shift next return min; }; Cipher.prototype._flushBuffer = function _flushBuffer(out, off) { this._update(this.buffer, 0, out, off); this.bufferOff = 0; return this.blockSize; }; Cipher.prototype._updateEncrypt = function _updateEncrypt(data) { var inputOff = 0; var outputOff = 0; var count = ((this.bufferOff + data.length) / this.blockSize) | 0; var out = new Array(count * this.blockSize); if (this.bufferOff !== 0) { inputOff += this._buffer(data, inputOff); if (this.bufferOff === this.buffer.length) outputOff += this._flushBuffer(out, outputOff); } // Write blocks var max = data.length - ((data.length - inputOff) % this.blockSize); for (; inputOff < max; inputOff += this.blockSize) { this._update(data, inputOff, out, outputOff); outputOff += this.blockSize; } // Queue rest for (; inputOff < data.length; inputOff++, this.bufferOff++) this.buffer[this.bufferOff] = data[inputOff]; return out; }; Cipher.prototype._updateDecrypt = function _updateDecrypt(data) { var inputOff = 0; var outputOff = 0; var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1; var out = new Array(count * this.blockSize); // TODO(indutny): optimize it, this is far from optimal for (; count > 0; count--) { inputOff += this._buffer(data, inputOff); outputOff += this._flushBuffer(out, outputOff); } // Buffer rest of the input inputOff += this._buffer(data, inputOff); return out; }; Cipher.prototype.final = function final(buffer) { var first; if (buffer) first = this.update(buffer); var last; if (this.type === 'encrypt') last = this._finalEncrypt(); else last = this._finalDecrypt(); if (first) return first.concat(last); else return last; }; Cipher.prototype._pad = function _pad(buffer, off) { if (off === 0) return false; while (off < buffer.length) buffer[off++] = 0; return true; }; Cipher.prototype._finalEncrypt = function _finalEncrypt() { if (!this._pad(this.buffer, this.bufferOff)) return []; var out = new Array(this.blockSize); this._update(this.buffer, 0, out, 0); return out; }; Cipher.prototype._unpad = function _unpad(buffer) { return buffer; }; Cipher.prototype._finalDecrypt = function _finalDecrypt() { assert.equal(this.bufferOff, this.blockSize, 'Not enough data to decrypt'); var out = new Array(this.blockSize); this._flushBuffer(out, 0); return this._unpad(out); }; },{"minimalistic-assert":99}],60:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); var inherits = require('inherits'); var des = require('../des'); var utils = des.utils; var Cipher = des.Cipher; function DESState() { this.tmp = new Array(2); this.keys = null; } function DES(options) { Cipher.call(this, options); var state = new DESState(); this._desState = state; this.deriveKeys(state, options.key); } inherits(DES, Cipher); module.exports = DES; DES.create = function create(options) { return new DES(options); }; var shiftTable = [ 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1 ]; DES.prototype.deriveKeys = function deriveKeys(state, key) { state.keys = new Array(16 * 2); assert.equal(key.length, this.blockSize, 'Invalid key length'); var kL = utils.readUInt32BE(key, 0); var kR = utils.readUInt32BE(key, 4); utils.pc1(kL, kR, state.tmp, 0); kL = state.tmp[0]; kR = state.tmp[1]; for (var i = 0; i < state.keys.length; i += 2) { var shift = shiftTable[i >>> 1]; kL = utils.r28shl(kL, shift); kR = utils.r28shl(kR, shift); utils.pc2(kL, kR, state.keys, i); } }; DES.prototype._update = function _update(inp, inOff, out, outOff) { var state = this._desState; var l = utils.readUInt32BE(inp, inOff); var r = utils.readUInt32BE(inp, inOff + 4); // Initial Permutation utils.ip(l, r, state.tmp, 0); l = state.tmp[0]; r = state.tmp[1]; if (this.type === 'encrypt') this._encrypt(state, l, r, state.tmp, 0); else this._decrypt(state, l, r, state.tmp, 0); l = state.tmp[0]; r = state.tmp[1]; utils.writeUInt32BE(out, l, outOff); utils.writeUInt32BE(out, r, outOff + 4); }; DES.prototype._pad = function _pad(buffer, off) { var value = buffer.length - off; for (var i = off; i < buffer.length; i++) buffer[i] = value; return true; }; DES.prototype._unpad = function _unpad(buffer) { var pad = buffer[buffer.length - 1]; for (var i = buffer.length - pad; i < buffer.length; i++) assert.equal(buffer[i], pad); return buffer.slice(0, buffer.length - pad); }; DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) { var l = lStart; var r = rStart; // Apply f() x16 times for (var i = 0; i < state.keys.length; i += 2) { var keyL = state.keys[i]; var keyR = state.keys[i + 1]; // f(r, k) utils.expand(r, state.tmp, 0); keyL ^= state.tmp[0]; keyR ^= state.tmp[1]; var s = utils.substitute(keyL, keyR); var f = utils.permute(s); var t = r; r = (l ^ f) >>> 0; l = t; } // Reverse Initial Permutation utils.rip(r, l, out, off); }; DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) { var l = rStart; var r = lStart; // Apply f() x16 times for (var i = state.keys.length - 2; i >= 0; i -= 2) { var keyL = state.keys[i]; var keyR = state.keys[i + 1]; // f(r, k) utils.expand(l, state.tmp, 0); keyL ^= state.tmp[0]; keyR ^= state.tmp[1]; var s = utils.substitute(keyL, keyR); var f = utils.permute(s); var t = l; l = (r ^ f) >>> 0; r = t; } // Reverse Initial Permutation utils.rip(l, r, out, off); }; },{"../des":57,"inherits":95,"minimalistic-assert":99}],61:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); var inherits = require('inherits'); var des = require('../des'); var Cipher = des.Cipher; var DES = des.DES; function EDEState(type, key) { assert.equal(key.length, 24, 'Invalid key length'); var k1 = key.slice(0, 8); var k2 = key.slice(8, 16); var k3 = key.slice(16, 24); if (type === 'encrypt') { this.ciphers = [ DES.create({ type: 'encrypt', key: k1 }), DES.create({ type: 'decrypt', key: k2 }), DES.create({ type: 'encrypt', key: k3 }) ]; } else { this.ciphers = [ DES.create({ type: 'decrypt', key: k3 }), DES.create({ type: 'encrypt', key: k2 }), DES.create({ type: 'decrypt', key: k1 }) ]; } } function EDE(options) { Cipher.call(this, options); var state = new EDEState(this.type, this.options.key); this._edeState = state; } inherits(EDE, Cipher); module.exports = EDE; EDE.create = function create(options) { return new EDE(options); }; EDE.prototype._update = function _update(inp, inOff, out, outOff) { var state = this._edeState; state.ciphers[0]._update(inp, inOff, out, outOff); state.ciphers[1]._update(out, outOff, out, outOff); state.ciphers[2]._update(out, outOff, out, outOff); }; EDE.prototype._pad = DES.prototype._pad; EDE.prototype._unpad = DES.prototype._unpad; },{"../des":57,"inherits":95,"minimalistic-assert":99}],62:[function(require,module,exports){ 'use strict'; exports.readUInt32BE = function readUInt32BE(bytes, off) { var res = (bytes[0 + off] << 24) | (bytes[1 + off] << 16) | (bytes[2 + off] << 8) | bytes[3 + off]; return res >>> 0; }; exports.writeUInt32BE = function writeUInt32BE(bytes, value, off) { bytes[0 + off] = value >>> 24; bytes[1 + off] = (value >>> 16) & 0xff; bytes[2 + off] = (value >>> 8) & 0xff; bytes[3 + off] = value & 0xff; }; exports.ip = function ip(inL, inR, out, off) { var outL = 0; var outR = 0; for (var i = 6; i >= 0; i -= 2) { for (var j = 0; j <= 24; j += 8) { outL <<= 1; outL |= (inR >>> (j + i)) & 1; } for (var j = 0; j <= 24; j += 8) { outL <<= 1; outL |= (inL >>> (j + i)) & 1; } } for (var i = 6; i >= 0; i -= 2) { for (var j = 1; j <= 25; j += 8) { outR <<= 1; outR |= (inR >>> (j + i)) & 1; } for (var j = 1; j <= 25; j += 8) { outR <<= 1; outR |= (inL >>> (j + i)) & 1; } } out[off + 0] = outL >>> 0; out[off + 1] = outR >>> 0; }; exports.rip = function rip(inL, inR, out, off) { var outL = 0; var outR = 0; for (var i = 0; i < 4; i++) { for (var j = 24; j >= 0; j -= 8) { outL <<= 1; outL |= (inR >>> (j + i)) & 1; outL <<= 1; outL |= (inL >>> (j + i)) & 1; } } for (var i = 4; i < 8; i++) { for (var j = 24; j >= 0; j -= 8) { outR <<= 1; outR |= (inR >>> (j + i)) & 1; outR <<= 1; outR |= (inL >>> (j + i)) & 1; } } out[off + 0] = outL >>> 0; out[off + 1] = outR >>> 0; }; exports.pc1 = function pc1(inL, inR, out, off) { var outL = 0; var outR = 0; // 7, 15, 23, 31, 39, 47, 55, 63 // 6, 14, 22, 30, 39, 47, 55, 63 // 5, 13, 21, 29, 39, 47, 55, 63 // 4, 12, 20, 28 for (var i = 7; i >= 5; i--) { for (var j = 0; j <= 24; j += 8) { outL <<= 1; outL |= (inR >> (j + i)) & 1; } for (var j = 0; j <= 24; j += 8) { outL <<= 1; outL |= (inL >> (j + i)) & 1; } } for (var j = 0; j <= 24; j += 8) { outL <<= 1; outL |= (inR >> (j + i)) & 1; } // 1, 9, 17, 25, 33, 41, 49, 57 // 2, 10, 18, 26, 34, 42, 50, 58 // 3, 11, 19, 27, 35, 43, 51, 59 // 36, 44, 52, 60 for (var i = 1; i <= 3; i++) { for (var j = 0; j <= 24; j += 8) { outR <<= 1; outR |= (inR >> (j + i)) & 1; } for (var j = 0; j <= 24; j += 8) { outR <<= 1; outR |= (inL >> (j + i)) & 1; } } for (var j = 0; j <= 24; j += 8) { outR <<= 1; outR |= (inL >> (j + i)) & 1; } out[off + 0] = outL >>> 0; out[off + 1] = outR >>> 0; }; exports.r28shl = function r28shl(num, shift) { return ((num << shift) & 0xfffffff) | (num >>> (28 - shift)); }; var pc2table = [ // inL => outL 14, 11, 17, 4, 27, 23, 25, 0, 13, 22, 7, 18, 5, 9, 16, 24, 2, 20, 12, 21, 1, 8, 15, 26, // inR => outR 15, 4, 25, 19, 9, 1, 26, 16, 5, 11, 23, 8, 12, 7, 17, 0, 22, 3, 10, 14, 6, 20, 27, 24 ]; exports.pc2 = function pc2(inL, inR, out, off) { var outL = 0; var outR = 0; var len = pc2table.length >>> 1; for (var i = 0; i < len; i++) { outL <<= 1; outL |= (inL >>> pc2table[i]) & 0x1; } for (var i = len; i < pc2table.length; i++) { outR <<= 1; outR |= (inR >>> pc2table[i]) & 0x1; } out[off + 0] = outL >>> 0; out[off + 1] = outR >>> 0; }; exports.expand = function expand(r, out, off) { var outL = 0; var outR = 0; outL = ((r & 1) << 5) | (r >>> 27); for (var i = 23; i >= 15; i -= 4) { outL <<= 6; outL |= (r >>> i) & 0x3f; } for (var i = 11; i >= 3; i -= 4) { outR |= (r >>> i) & 0x3f; outR <<= 6; } outR |= ((r & 0x1f) << 1) | (r >>> 31); out[off + 0] = outL >>> 0; out[off + 1] = outR >>> 0; }; var sTable = [ 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1, 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8, 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7, 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13, 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14, 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5, 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2, 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9, 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10, 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1, 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7, 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12, 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3, 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9, 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8, 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14, 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1, 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6, 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13, 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3, 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5, 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8, 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10, 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13, 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10, 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6, 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7, 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12, 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4, 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2, 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13, 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11 ]; exports.substitute = function substitute(inL, inR) { var out = 0; for (var i = 0; i < 4; i++) { var b = (inL >>> (18 - i * 6)) & 0x3f; var sb = sTable[i * 0x40 + b]; out <<= 4; out |= sb; } for (var i = 0; i < 4; i++) { var b = (inR >>> (18 - i * 6)) & 0x3f; var sb = sTable[4 * 0x40 + i * 0x40 + b]; out <<= 4; out |= sb; } return out >>> 0; }; var permuteTable = [ 16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22, 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7 ]; exports.permute = function permute(num) { var out = 0; for (var i = 0; i < permuteTable.length; i++) { out <<= 1; out |= (num >>> permuteTable[i]) & 0x1; } return out >>> 0; }; exports.padSplit = function padSplit(num, size, group) { var str = num.toString(2); while (str.length < size) str = '0' + str; var out = []; for (var i = 0; i < size; i += group) out.push(str.slice(i, i + group)); return out.join(' '); }; },{}],63:[function(require,module,exports){ (function (Buffer){ var generatePrime = require('./lib/generatePrime') var primes = require('./lib/primes.json') var DH = require('./lib/dh') function getDiffieHellman (mod) { var prime = new Buffer(primes[mod].prime, 'hex') var gen = new Buffer(primes[mod].gen, 'hex') return new DH(prime, gen) } var ENCODINGS = { 'binary': true, 'hex': true, 'base64': true } function createDiffieHellman (prime, enc, generator, genc) { if (Buffer.isBuffer(enc) || ENCODINGS[enc] === undefined) { return createDiffieHellman(prime, 'binary', enc, generator) } enc = enc || 'binary' genc = genc || 'binary' generator = generator || new Buffer([2]) if (!Buffer.isBuffer(generator)) { generator = new Buffer(generator, genc) } if (typeof prime === 'number') { return new DH(generatePrime(prime, generator), generator, true) } if (!Buffer.isBuffer(prime)) { prime = new Buffer(prime, enc) } return new DH(prime, generator, true) } exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman }).call(this,require("buffer").Buffer) },{"./lib/dh":64,"./lib/generatePrime":65,"./lib/primes.json":66,"buffer":47}],64:[function(require,module,exports){ (function (Buffer){ var BN = require('bn.js'); var MillerRabin = require('miller-rabin'); var millerRabin = new MillerRabin(); var TWENTYFOUR = new BN(24); var ELEVEN = new BN(11); var TEN = new BN(10); var THREE = new BN(3); var SEVEN = new BN(7); var primes = require('./generatePrime'); var randomBytes = require('randombytes'); module.exports = DH; function setPublicKey(pub, enc) { enc = enc || 'utf8'; if (!Buffer.isBuffer(pub)) { pub = new Buffer(pub, enc); } this._pub = new BN(pub); return this; } function setPrivateKey(priv, enc) { enc = enc || 'utf8'; if (!Buffer.isBuffer(priv)) { priv = new Buffer(priv, enc); } this._priv = new BN(priv); return this; } var primeCache = {}; function checkPrime(prime, generator) { var gen = generator.toString('hex'); var hex = [gen, prime.toString(16)].join('_'); if (hex in primeCache) { return primeCache[hex]; } var error = 0; if (prime.isEven() || !primes.simpleSieve || !primes.fermatTest(prime) || !millerRabin.test(prime)) { //not a prime so +1 error += 1; if (gen === '02' || gen === '05') { // we'd be able to check the generator // it would fail so +8 error += 8; } else { //we wouldn't be able to test the generator // so +4 error += 4; } primeCache[hex] = error; return error; } if (!millerRabin.test(prime.shrn(1))) { //not a safe prime error += 2; } var rem; switch (gen) { case '02': if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) { // unsuidable generator error += 8; } break; case '05': rem = prime.mod(TEN); if (rem.cmp(THREE) && rem.cmp(SEVEN)) { // prime mod 10 needs to equal 3 or 7 error += 8; } break; default: error += 4; } primeCache[hex] = error; return error; } function DH(prime, generator, malleable) { this.setGenerator(generator); this.__prime = new BN(prime); this._prime = BN.mont(this.__prime); this._primeLen = prime.length; this._pub = undefined; this._priv = undefined; this._primeCode = undefined; if (malleable) { this.setPublicKey = setPublicKey; this.setPrivateKey = setPrivateKey; } else { this._primeCode = 8; } } Object.defineProperty(DH.prototype, 'verifyError', { enumerable: true, get: function () { if (typeof this._primeCode !== 'number') { this._primeCode = checkPrime(this.__prime, this.__gen); } return this._primeCode; } }); DH.prototype.generateKeys = function () { if (!this._priv) { this._priv = new BN(randomBytes(this._primeLen)); } this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed(); return this.getPublicKey(); }; DH.prototype.computeSecret = function (other) { other = new BN(other); other = other.toRed(this._prime); var secret = other.redPow(this._priv).fromRed(); var out = new Buffer(secret.toArray()); var prime = this.getPrime(); if (out.length < prime.length) { var front = new Buffer(prime.length - out.length); front.fill(0); out = Buffer.concat([front, out]); } return out; }; DH.prototype.getPublicKey = function getPublicKey(enc) { return formatReturnValue(this._pub, enc); }; DH.prototype.getPrivateKey = function getPrivateKey(enc) { return formatReturnValue(this._priv, enc); }; DH.prototype.getPrime = function (enc) { return formatReturnValue(this.__prime, enc); }; DH.prototype.getGenerator = function (enc) { return formatReturnValue(this._gen, enc); }; DH.prototype.setGenerator = function (gen, enc) { enc = enc || 'utf8'; if (!Buffer.isBuffer(gen)) { gen = new Buffer(gen, enc); } this.__gen = gen; this._gen = new BN(gen); return this; }; function formatReturnValue(bn, enc) { var buf = new Buffer(bn.toArray()); if (!enc) { return buf; } else { return buf.toString(enc); } } }).call(this,require("buffer").Buffer) },{"./generatePrime":65,"bn.js":18,"buffer":47,"miller-rabin":98,"randombytes":119}],65:[function(require,module,exports){ var randomBytes = require('randombytes'); module.exports = findPrime; findPrime.simpleSieve = simpleSieve; findPrime.fermatTest = fermatTest; var BN = require('bn.js'); var TWENTYFOUR = new BN(24); var MillerRabin = require('miller-rabin'); var millerRabin = new MillerRabin(); var ONE = new BN(1); var TWO = new BN(2); var FIVE = new BN(5); var SIXTEEN = new BN(16); var EIGHT = new BN(8); var TEN = new BN(10); var THREE = new BN(3); var SEVEN = new BN(7); var ELEVEN = new BN(11); var FOUR = new BN(4); var TWELVE = new BN(12); var primes = null; function _getPrimes() { if (primes !== null) return primes; var limit = 0x100000; var res = []; res[0] = 2; for (var i = 1, k = 3; k < limit; k += 2) { var sqrt = Math.ceil(Math.sqrt(k)); for (var j = 0; j < i && res[j] <= sqrt; j++) if (k % res[j] === 0) break; if (i !== j && res[j] <= sqrt) continue; res[i++] = k; } primes = res; return res; } function simpleSieve(p) { var primes = _getPrimes(); for (var i = 0; i < primes.length; i++) if (p.modn(primes[i]) === 0) { if (p.cmpn(primes[i]) === 0) { return true; } else { return false; } } return true; } function fermatTest(p) { var red = BN.mont(p); return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0; } function findPrime(bits, gen) { if (bits < 16) { // this is what openssl does if (gen === 2 || gen === 5) { return new BN([0x8c, 0x7b]); } else { return new BN([0x8c, 0x27]); } } gen = new BN(gen); var num, n2; while (true) { num = new BN(randomBytes(Math.ceil(bits / 8))); while (num.bitLength() > bits) { num.ishrn(1); } if (num.isEven()) { num.iadd(ONE); } if (!num.testn(1)) { num.iadd(TWO); } if (!gen.cmp(TWO)) { while (num.mod(TWENTYFOUR).cmp(ELEVEN)) { num.iadd(FOUR); } } else if (!gen.cmp(FIVE)) { while (num.mod(TEN).cmp(THREE)) { num.iadd(FOUR); } } n2 = num.shrn(1); if (simpleSieve(n2) && simpleSieve(num) && fermatTest(n2) && fermatTest(num) && millerRabin.test(n2) && millerRabin.test(num)) { return num; } } } },{"bn.js":18,"miller-rabin":98,"randombytes":119}],66:[function(require,module,exports){ module.exports={ "modp1": { "gen": "02", "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff" }, "modp2": { "gen": "02", "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff" }, "modp5": { "gen": "02", "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff" }, "modp14": { "gen": "02", "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff" }, "modp15": { "gen": "02", "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff" }, "modp16": { "gen": "02", "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff" }, "modp17": { "gen": "02", "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff" }, "modp18": { "gen": "02", "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff" } } },{}],67:[function(require,module,exports){ 'use strict'; var elliptic = exports; elliptic.version = require('../package.json').version; elliptic.utils = require('./elliptic/utils'); elliptic.rand = require('brorand'); elliptic.hmacDRBG = require('./elliptic/hmac-drbg'); elliptic.curve = require('./elliptic/curve'); elliptic.curves = require('./elliptic/curves'); // Protocols elliptic.ec = require('./elliptic/ec'); elliptic.eddsa = require('./elliptic/eddsa'); },{"../package.json":83,"./elliptic/curve":70,"./elliptic/curves":73,"./elliptic/ec":74,"./elliptic/eddsa":77,"./elliptic/hmac-drbg":80,"./elliptic/utils":82,"brorand":19}],68:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); var elliptic = require('../../elliptic'); var utils = elliptic.utils; var getNAF = utils.getNAF; var getJSF = utils.getJSF; var assert = utils.assert; function BaseCurve(type, conf) { this.type = type; this.p = new BN(conf.p, 16); // Use Montgomery, when there is no fast reduction for the prime this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p); // Useful for many curves this.zero = new BN(0).toRed(this.red); this.one = new BN(1).toRed(this.red); this.two = new BN(2).toRed(this.red); // Curve configuration, optional this.n = conf.n && new BN(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); } module.exports = 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(p.precomputed); var doubles = p._getDoubles(); var naf = getNAF(k, 1); var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1); I /= 3; // Translate into more windowed form var repr = []; for (var j = 0; j < naf.length; j += doubles.step) { var nafW = 0; for (var k = j + doubles.step - 1; k >= j; k--) nafW = (nafW << 1) + naf[k]; 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 (var j = 0; j < repr.length; j++) { var 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(k, w); // 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 k = 0; i >= 0 && naf[i] === 0; i--) k++; if (i >= 0) k++; acc = acc.dblp(k); if (i < 0) break; var z = naf[i]; assert(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) { var wndWidth = this._wnafT1; var wnd = this._wnafT2; var naf = this._wnafT3; // Fill all arrays var max = 0; for (var i = 0; i < len; i++) { var p = points[i]; var nafPoints = p._getNAFPoints(defW); wndWidth[i] = nafPoints.wnd; wnd[i] = nafPoints.points; } // Comb small window NAFs for (var i = len - 1; i >= 1; i -= 2) { var a = i - 1; var b = i; if (wndWidth[a] !== 1 || wndWidth[b] !== 1) { naf[a] = getNAF(coeffs[a], wndWidth[a]); naf[b] = getNAF(coeffs[b], wndWidth[b]); 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(coeffs[a], coeffs[b]); max = Math.max(jsf[0].length, max); naf[a] = new Array(max); naf[b] = new Array(max); for (var 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 (var i = max; i >= 0; i--) { var k = 0; while (i >= 0) { var zero = true; for (var 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 (var j = 0; j < len; j++) { var z = tmp[j]; var p; 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 (var i = 0; i < len; i++) wnd[i] = null; 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.toArray(bytes, enc); var len = this.p.byteLength(); if (bytes[0] === 0x04 && bytes.length - 1 === 2 * len) { return this.point(bytes.slice(1, 1 + len), bytes.slice(1 + len, 1 + 2 * len)); } 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.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; }; },{"../../elliptic":67,"bn.js":18}],69:[function(require,module,exports){ 'use strict'; var curve = require('../curve'); var elliptic = require('../../elliptic'); var BN = require('bn.js'); var inherits = require('inherits'); var Base = curve.base; var assert = elliptic.utils.assert; function EdwardsCurve(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(conf.a, 16).umod(this.red.m); this.a = this.a.toRed(this.red); this.c = new BN(conf.c, 16).toRed(this.red); this.c2 = this.c.redSqr(); this.d = new BN(conf.d, 16).toRed(this.red); this.dd = this.d.redAdd(this.d); assert(!this.twisted || this.c.fromRed().cmpn(1) === 0); this.oneC = (conf.c | 0) === 1; } inherits(EdwardsCurve, Base); module.exports = EdwardsCurve; EdwardsCurve.prototype._mulA = function _mulA(num) { if (this.mOneA) return num.redNeg(); else return this.a.redMul(num); }; EdwardsCurve.prototype._mulC = function _mulC(num) { if (this.oneC) return num; else return this.c.redMul(num); }; // Just for compatibility with Short curve EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) { return this.point(x, y, z, t); }; EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) { x = new BN(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.prototype.pointFromY = function pointFromY(y, odd) { y = new BN(y, 16); if (!y.red) y = y.toRed(this.red); // x^2 = (y^2 - 1) / (d y^2 + 1) var y2 = y.redSqr(); var lhs = y2.redSub(this.one); var rhs = y2.redMul(this.d).redAdd(this.one); 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.isOdd() !== odd) x = x.redNeg(); return this.point(x, y); }; EdwardsCurve.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(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(x, 16); this.y = new BN(y, 16); this.z = z ? new BN(z, 16) : this.curve.one; this.t = t && new BN(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(Point, Base.BasePoint); EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) { return Point.fromJSON(this, obj); }; EdwardsCurve.prototype.point = function point(x, y, z, t) { return new Point(this, x, y, z, t); }; Point.fromJSON = function fromJSON(curve, obj) { return new Point(curve, obj[0], obj[1], obj[2]); }; Point.prototype.inspect = function inspect() { if (this.isInfinity()) return ''; return ''; }; Point.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; }; Point.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.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; if (this.curve.twisted) { // E = a * C var 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 var h = this.z.redSqr(); // J = F - 2 * H var 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 var e = c.redAdd(d); // H = (c * Z1)^2 var h = this.curve._mulC(this.c.redMul(this.z)).redSqr(); // J = E - 2 * H var 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.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.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.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.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.prototype.mul = function mul(k) { if (this._hasDoubles(k)) return this.curve._fixedNafMul(this, k); else return this.curve._wnafMul(this, k); }; Point.prototype.mulAdd = function mulAdd(k1, p, k2) { return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2); }; Point.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.prototype.neg = function neg() { return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg()); }; Point.prototype.getX = function getX() { this.normalize(); return this.x.fromRed(); }; Point.prototype.getY = function getY() { this.normalize(); return this.y.fromRed(); }; Point.prototype.eq = function eq(other) { return this === other || this.getX().cmp(other.getX()) === 0 && this.getY().cmp(other.getY()) === 0; }; // Compatibility with BaseCurve Point.prototype.toP = Point.prototype.normalize; Point.prototype.mixedAdd = Point.prototype.add; },{"../../elliptic":67,"../curve":70,"bn.js":18,"inherits":95}],70:[function(require,module,exports){ 'use strict'; var curve = exports; curve.base = require('./base'); curve.short = require('./short'); curve.mont = require('./mont'); curve.edwards = require('./edwards'); },{"./base":68,"./edwards":69,"./mont":71,"./short":72}],71:[function(require,module,exports){ 'use strict'; var curve = require('../curve'); var BN = require('bn.js'); var inherits = require('inherits'); var Base = curve.base; var elliptic = require('../../elliptic'); var utils = elliptic.utils; function MontCurve(conf) { Base.call(this, 'mont', conf); this.a = new BN(conf.a, 16).toRed(this.red); this.b = new BN(conf.b, 16).toRed(this.red); this.i4 = new BN(4).toRed(this.red).redInvm(); this.two = new BN(2).toRed(this.red); this.a24 = this.i4.redMul(this.a.redAdd(this.two)); } inherits(MontCurve, Base); module.exports = MontCurve; MontCurve.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(curve, x, z) { Base.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(x, 16); this.z = new BN(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(Point, Base.BasePoint); MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) { return this.point(utils.toArray(bytes, enc), 1); }; MontCurve.prototype.point = function point(x, z) { return new Point(this, x, z); }; MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) { return Point.fromJSON(this, obj); }; Point.prototype.precompute = function precompute() { // No-op }; Point.prototype._encode = function _encode() { return this.getX().toArray('be', this.curve.p.byteLength()); }; Point.fromJSON = function fromJSON(curve, obj) { return new Point(curve, obj[0], obj[1] || curve.one); }; Point.prototype.inspect = function inspect() { if (this.isInfinity()) return ''; return ''; }; Point.prototype.isInfinity = function isInfinity() { // XXX This code assumes that zero is always zero in red return this.z.cmpn(0) === 0; }; Point.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.prototype.add = function add() { throw new Error('Not supported on Montgomery curve'); }; Point.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.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.prototype.mulAdd = function mulAdd() { throw new Error('Not supported on Montgomery curve'); }; Point.prototype.eq = function eq(other) { return this.getX().cmp(other.getX()) === 0; }; Point.prototype.normalize = function normalize() { this.x = this.x.redMul(this.z.redInvm()); this.z = this.curve.one; return this; }; Point.prototype.getX = function getX() { // Normalize coordinates this.normalize(); return this.x.fromRed(); }; },{"../../elliptic":67,"../curve":70,"bn.js":18,"inherits":95}],72:[function(require,module,exports){ 'use strict'; var curve = require('../curve'); var elliptic = require('../../elliptic'); var BN = require('bn.js'); var inherits = require('inherits'); var Base = curve.base; var assert = elliptic.utils.assert; function ShortCurve(conf) { Base.call(this, 'short', conf); this.a = new BN(conf.a, 16).toRed(this.red); this.b = new BN(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(ShortCurve, Base); module.exports = ShortCurve; ShortCurve.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(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(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(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(vec.a, 16), b: new BN(vec.b, 16) }; }); } else { basis = this._getEndoBasis(lambda); } return { beta: beta, lambda: lambda, basis: basis }; }; ShortCurve.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.mont(num); var tinv = new BN(2).toRed(red).redInvm(); var ntinv = tinv.redNeg(); var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv); var l1 = ntinv.redAdd(s).fromRed(); var l2 = ntinv.redSub(s).fromRed(); return [ l1, l2 ]; }; ShortCurve.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(1); var y1 = new BN(0); var x2 = new BN(0); var y2 = new BN(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.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.prototype.pointFromX = function pointFromX(x, odd) { x = new BN(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.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.prototype._endoWnafMulAdd = function _endoWnafMulAdd(points, coeffs) { 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); // 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(curve, x, y, isRed) { Base.BasePoint.call(this, curve, 'affine'); if (x === null && y === null) { this.x = null; this.y = null; this.inf = true; } else { this.x = new BN(x, 16); this.y = new BN(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(Point, Base.BasePoint); ShortCurve.prototype.point = function point(x, y, isRed) { return new Point(this, x, y, isRed); }; ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) { return Point.fromJSON(this, obj, red); }; Point.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.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.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.prototype.inspect = function inspect() { if (this.isInfinity()) return ''; return ''; }; Point.prototype.isInfinity = function isInfinity() { return this.inf; }; Point.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.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.prototype.getX = function getX() { return this.x.fromRed(); }; Point.prototype.getY = function getY() { return this.y.fromRed(); }; Point.prototype.mul = function mul(k) { k = new BN(k, 16); 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.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.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.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.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(curve, x, y, z) { Base.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(0); } else { this.x = new BN(x, 16); this.y = new BN(y, 16); this.z = new BN(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(JPoint, Base.BasePoint); ShortCurve.prototype.jpoint = function jpoint(x, y, z) { return new JPoint(this, x, y, z); }; JPoint.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.prototype.neg = function neg() { return this.curve.jpoint(this.x, this.y.redNeg(), this.z); }; JPoint.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.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.prototype.dblp = function dblp(pow) { if (pow === 0) return this; if (this.isInfinity()) return this; if (!pow) return this.dbl(); if (this.curve.zeroA || this.curve.threeA) { var r = this; for (var 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 (var 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.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.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.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.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.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.prototype.mul = function mul(k, kbase) { k = new BN(k, kbase); return this.curve._wnafMul(this, k); }; JPoint.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.prototype.inspect = function inspect() { if (this.isInfinity()) return ''; return ''; }; JPoint.prototype.isInfinity = function isInfinity() { // XXX This code assumes that zero is always zero in red return this.z.cmpn(0) === 0; }; },{"../../elliptic":67,"../curve":70,"bn.js":18,"inherits":95}],73:[function(require,module,exports){ 'use strict'; var curves = exports; var hash = require('hash.js'); var elliptic = require('../elliptic'); var assert = elliptic.utils.assert; function PresetCurve(options) { if (options.type === 'short') this.curve = new elliptic.curve.short(options); else if (options.type === 'edwards') this.curve = new elliptic.curve.edwards(options); else this.curve = new elliptic.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: '0', 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 ] }); },{"../elliptic":67,"./precomputed/secp256k1":81,"hash.js":86}],74:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); var elliptic = require('../../elliptic'); var utils = elliptic.utils; var assert = utils.assert; var KeyPair = require('./key'); var Signature = require('./signature'); function EC(options) { if (!(this instanceof EC)) return new EC(options); // Shortcut `elliptic.ec(curve-name)` if (typeof options === 'string') { assert(elliptic.curves.hasOwnProperty(options), 'Unknown curve ' + options); options = elliptic.curves[options]; } // Shortcut for `elliptic.ec(elliptic.curves.curveName)` if (options instanceof elliptic.curves.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; } module.exports = EC; EC.prototype.keyPair = function keyPair(options) { return new KeyPair(this, options); }; EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) { return KeyPair.fromPrivate(this, priv, enc); }; EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) { return KeyPair.fromPublic(this, pub, enc); }; EC.prototype.genKeyPair = function genKeyPair(options) { if (!options) options = {}; // Instantiate Hmac_DRBG var drbg = new elliptic.hmacDRBG({ hash: this.hash, pers: options.pers, entropy: options.entropy || elliptic.rand(this.hash.hmacStrength), nonce: this.n.toArray() }); var bytes = this.n.byteLength(); var ns2 = this.n.sub(new BN(2)); do { var priv = new BN(drbg.generate(bytes)); if (priv.cmp(ns2) > 0) continue; priv.iaddn(1); return this.keyFromPrivate(priv); } while (true); }; EC.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.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(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 elliptic.hmacDRBG({ hash: this.hash, entropy: bkey, nonce: nonce, pers: options.pers, persEnc: options.persEnc }); // Number of bytes to generate var ns1 = this.n.sub(new BN(1)); for (var iter = 0; true; iter++) { var k = options.k ? options.k(iter) : new BN(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({ r: r, s: s, recoveryParam: recoveryParam }); } }; EC.prototype.verify = function verify(msg, signature, key, enc) { msg = this._truncateToN(new BN(msg, 16)); key = this.keyFromPublic(key, enc); signature = new Signature(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 = this.g.mulAdd(u1, key.getPublic(), u2); if (p.isInfinity()) return false; return p.getX().umod(this.n).cmp(r) === 0; }; EC.prototype.recoverPubKey = function(msg, signature, j, enc) { assert((3 & j) === j, 'The recovery param is more than two bits'); signature = new Signature(signature, enc); var n = this.n; var e = new BN(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 eNeg = n.sub(e); // 1.6.1 Compute Q = r^-1 (sR - eG) // Q = r^-1 (sR + -eG) var rInv = signature.r.invm(n); return this.g.mulAdd(eNeg, r, s).mul(rInv); }; EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) { signature = new Signature(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'); }; },{"../../elliptic":67,"./key":75,"./signature":76,"bn.js":18}],75:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); function KeyPair(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); } module.exports = KeyPair; KeyPair.fromPublic = function fromPublic(ec, pub, enc) { if (pub instanceof KeyPair) return pub; return new KeyPair(ec, { pub: pub, pubEnc: enc }); }; KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) { if (priv instanceof KeyPair) return priv; return new KeyPair(ec, { priv: priv, privEnc: enc }); }; KeyPair.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.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.prototype.getPrivate = function getPrivate(enc) { if (enc === 'hex') return this.priv.toString(16, 2); else return this.priv; }; KeyPair.prototype._importPrivate = function _importPrivate(key, enc) { this.priv = new BN(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.prototype._importPublic = function _importPublic(key, enc) { if (key.x || key.y) { this.pub = this.ec.curve.point(key.x, key.y); return; } this.pub = this.ec.curve.decodePoint(key, enc); }; // ECDH KeyPair.prototype.derive = function derive(pub) { return pub.mul(this.priv).getX(); }; // ECDSA KeyPair.prototype.sign = function sign(msg, enc, options) { return this.ec.sign(msg, this, enc, options); }; KeyPair.prototype.verify = function verify(msg, signature) { return this.ec.verify(msg, signature, this); }; KeyPair.prototype.inspect = function inspect() { return ''; }; },{"bn.js":18}],76:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); var elliptic = require('../../elliptic'); var utils = elliptic.utils; var assert = utils.assert; function Signature(options, enc) { if (options instanceof Signature) return options; if (this._importDER(options, enc)) return; assert(options.r && options.s, 'Signature without r or s'); this.r = new BN(options.r, 16); this.s = new BN(options.s, 16); if (options.recoveryParam === undefined) this.recoveryParam = null; else this.recoveryParam = options.recoveryParam; } module.exports = Signature; function Position() { this.place = 0; } function getLength(buf, p) { var initial = buf[p.place++]; if (!(initial & 0x80)) { return initial; } var octetLen = initial & 0xf; var val = 0; for (var i = 0, off = p.place; i < octetLen; i++, off++) { val <<= 8; val |= buf[off]; } 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.prototype._importDER = function _importDER(data, enc) { data = utils.toArray(data, enc); var p = new Position(); if (data[p.place++] !== 0x30) { return false; } var len = getLength(data, p); if ((len + p.place) !== data.length) { return false; } if (data[p.place++] !== 0x02) { return false; } var rlen = getLength(data, p); 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 (data.length !== slen + p.place) { return false; } var s = data.slice(p.place, slen + p.place); if (r[0] === 0 && (r[1] & 0x80)) { r = r.slice(1); } if (s[0] === 0 && (s[1] & 0x80)) { s = s.slice(1); } this.r = new BN(r); this.s = new BN(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.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.encode(res, enc); }; },{"../../elliptic":67,"bn.js":18}],77:[function(require,module,exports){ 'use strict'; var hash = require('hash.js'); var elliptic = require('../../elliptic'); var utils = elliptic.utils; var assert = utils.assert; var parseBytes = utils.parseBytes; var KeyPair = require('./key'); var Signature = require('./signature'); function EDDSA(curve) { assert(curve === 'ed25519', 'only tested with ed25519 so far'); if (!(this instanceof EDDSA)) return new EDDSA(curve); var curve = elliptic.curves[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.sha512; } module.exports = 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.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.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.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.intFromLE(bytes); }; EDDSA.prototype.isPoint = function isPoint(val) { return val instanceof this.pointClass; }; },{"../../elliptic":67,"./key":78,"./signature":79,"hash.js":86}],78:[function(require,module,exports){ 'use strict'; var elliptic = require('../../elliptic'); var utils = elliptic.utils; var assert = utils.assert; var parseBytes = utils.parseBytes; var cachedProperty = utils.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(eddsa, params) { this.eddsa = eddsa; this._secret = parseBytes(params.secret); if (eddsa.isPoint(params.pub)) this._pub = params.pub; else this._pubBytes = parseBytes(params.pub); } KeyPair.fromPublic = function fromPublic(eddsa, pub) { if (pub instanceof KeyPair) return pub; return new KeyPair(eddsa, { pub: pub }); }; KeyPair.fromSecret = function fromSecret(eddsa, secret) { if (secret instanceof KeyPair) return secret; return new KeyPair(eddsa, { secret: secret }); }; KeyPair.prototype.secret = function secret() { return this._secret; }; cachedProperty(KeyPair, 'pubBytes', function pubBytes() { return this.eddsa.encodePoint(this.pub()); }); cachedProperty(KeyPair, 'pub', function pub() { if (this._pubBytes) return this.eddsa.decodePoint(this._pubBytes); return this.eddsa.g.mul(this.priv()); }); cachedProperty(KeyPair, '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(KeyPair, 'priv', function priv() { return this.eddsa.decodeInt(this.privBytes()); }); cachedProperty(KeyPair, 'hash', function hash() { return this.eddsa.hash().update(this.secret()).digest(); }); cachedProperty(KeyPair, 'messagePrefix', function messagePrefix() { return this.hash().slice(this.eddsa.encodingLength); }); KeyPair.prototype.sign = function sign(message) { assert(this._secret, 'KeyPair can only verify'); return this.eddsa.sign(message, this); }; KeyPair.prototype.verify = function verify(message, sig) { return this.eddsa.verify(message, sig, this); }; KeyPair.prototype.getSecret = function getSecret(enc) { assert(this._secret, 'KeyPair is public only'); return utils.encode(this.secret(), enc); }; KeyPair.prototype.getPublic = function getPublic(enc) { return utils.encode(this.pubBytes(), enc); }; module.exports = KeyPair; },{"../../elliptic":67}],79:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); var elliptic = require('../../elliptic'); var utils = elliptic.utils; var assert = utils.assert; var cachedProperty = utils.cachedProperty; var parseBytes = utils.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(eddsa, sig) { this.eddsa = eddsa; if (typeof sig !== 'object') sig = parseBytes(sig); if (Array.isArray(sig)) { sig = { R: sig.slice(0, eddsa.encodingLength), S: sig.slice(eddsa.encodingLength) }; } assert(sig.R && sig.S, 'Signature without R or S'); if (eddsa.isPoint(sig.R)) this._R = sig.R; if (sig.S instanceof BN) 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, 'S', function S() { return this.eddsa.decodeInt(this.Sencoded()); }); cachedProperty(Signature, 'R', function R() { return this.eddsa.decodePoint(this.Rencoded()); }); cachedProperty(Signature, 'Rencoded', function Rencoded() { return this.eddsa.encodePoint(this.R()); }); cachedProperty(Signature, 'Sencoded', function Sencoded() { return this.eddsa.encodeInt(this.S()); }); Signature.prototype.toBytes = function toBytes() { return this.Rencoded().concat(this.Sencoded()); }; Signature.prototype.toHex = function toHex() { return utils.encode(this.toBytes(), 'hex').toUpperCase(); }; module.exports = Signature; },{"../../elliptic":67,"bn.js":18}],80:[function(require,module,exports){ 'use strict'; var hash = require('hash.js'); var elliptic = require('../elliptic'); var utils = elliptic.utils; var assert = utils.assert; function HmacDRBG(options) { if (!(this instanceof HmacDRBG)) return new HmacDRBG(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.toArray(options.entropy, options.entropyEnc); var nonce = utils.toArray(options.nonce, options.nonceEnc); var pers = utils.toArray(options.pers, options.persEnc); assert(entropy.length >= (this.minEntropy / 8), 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits'); this._init(entropy, nonce, pers); } module.exports = HmacDRBG; HmacDRBG.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.prototype._hmac = function hmac() { return new hash.hmac(this.hash, this.K); }; HmacDRBG.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.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) { // Optional entropy enc if (typeof entropyEnc !== 'string') { addEnc = add; add = entropyEnc; entropyEnc = null; } entropy = utils.toBuffer(entropy, entropyEnc); add = utils.toBuffer(add, addEnc); assert(entropy.length >= (this.minEntropy / 8), 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits'); this._update(entropy.concat(add || [])); this.reseed = 1; }; HmacDRBG.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.toArray(add, addEnc); 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.encode(res, enc); }; },{"../elliptic":67,"hash.js":86}],81:[function(require,module,exports){ module.exports = { doubles: { step: 4, points: [ [ 'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a', 'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821' ], [ '8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508', '11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf' ], [ '175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739', 'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695' ], [ '363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640', '4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9' ], [ '8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c', '4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36' ], [ '723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda', '96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f' ], [ 'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa', '5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999' ], [ '100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0', 'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09' ], [ 'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d', '9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d' ], [ 'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d', 'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088' ], [ 'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1', '9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d' ], [ '53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0', '5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8' ], [ '8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047', '10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a' ], [ '385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862', '283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453' ], [ '6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7', '7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160' ], [ '3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd', '56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0' ], [ '85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83', '7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6' ], [ '948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a', '53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589' ], [ '6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8', 'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17' ], [ 'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d', '4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda' ], [ 'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725', '7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd' ], [ '213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754', '4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2' ], [ '4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c', '17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6' ], [ 'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6', '6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f' ], [ '76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39', 'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01' ], [ 'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891', '893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3' ], [ 'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b', 'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f' ], [ 'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03', '2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7' ], [ 'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d', 'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78' ], [ 'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070', '7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1' ], [ '90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4', 'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150' ], [ '8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da', '662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82' ], [ 'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11', '1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc' ], [ '8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e', 'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b' ], [ 'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41', '2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51' ], [ 'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef', '67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45' ], [ 'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8', 'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120' ], [ '324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d', '648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84' ], [ '4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96', '35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d' ], [ '9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd', 'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d' ], [ '6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5', '9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8' ], [ 'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266', '40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8' ], [ '7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71', '34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac' ], [ '928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac', 'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f' ], [ '85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751', '1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962' ], [ 'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e', '493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907' ], [ '827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241', 'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec' ], [ 'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3', 'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d' ], [ 'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f', '4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414' ], [ '1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19', 'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd' ], [ '146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be', 'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0' ], [ 'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9', '6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811' ], [ 'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2', '8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1' ], [ 'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13', '7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c' ], [ '174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c', 'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73' ], [ '959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba', '2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd' ], [ 'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151', 'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405' ], [ '64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073', 'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589' ], [ '8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458', '38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e' ], [ '13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b', '69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27' ], [ 'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366', 'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1' ], [ '8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa', '40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482' ], [ '8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0', '620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945' ], [ 'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787', '7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573' ], [ 'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e', 'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82' ] ] }, naf: { wnd: 7, points: [ [ 'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9', '388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672' ], [ '2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4', 'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6' ], [ '5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc', '6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da' ], [ 'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe', 'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37' ], [ '774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb', 'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b' ], [ 'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8', 'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81' ], [ 'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e', '581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58' ], [ 'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34', '4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77' ], [ '2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c', '85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a' ], [ '352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5', '321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c' ], [ '2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f', '2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67' ], [ '9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714', '73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402' ], [ 'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729', 'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55' ], [ 'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db', '2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482' ], [ '6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4', 'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82' ], [ '1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5', 'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396' ], [ '605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479', '2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49' ], [ '62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d', '80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf' ], [ '80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f', '1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a' ], [ '7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb', 'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7' ], [ 'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9', 'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933' ], [ '49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963', '758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a' ], [ '77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74', '958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6' ], [ 'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530', 'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37' ], [ '463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b', '5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e' ], [ 'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247', 'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6' ], [ 'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1', 'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476' ], [ '2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120', '4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40' ], [ '7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435', '91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61' ], [ '754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18', '673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683' ], [ 'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8', '59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5' ], [ '186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb', '3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b' ], [ 'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f', '55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417' ], [ '5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143', 'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868' ], [ '290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba', 'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a' ], [ 'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45', 'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6' ], [ '766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a', '744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996' ], [ '59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e', 'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e' ], [ 'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8', 'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d' ], [ '7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c', '30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2' ], [ '948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519', 'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e' ], [ '7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab', '100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437' ], [ '3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca', 'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311' ], [ 'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf', '8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4' ], [ '1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610', '68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575' ], [ '733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4', 'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d' ], [ '15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c', 'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d' ], [ 'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940', 'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629' ], [ 'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980', 'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06' ], [ '311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3', '66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374' ], [ '34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf', '9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee' ], [ 'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63', '4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1' ], [ 'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448', 'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b' ], [ '32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf', '5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661' ], [ '7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5', '8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6' ], [ 'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6', '8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e' ], [ '16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5', '5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d' ], [ 'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99', 'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc' ], [ '78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51', 'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4' ], [ '494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5', '42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c' ], [ 'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5', '204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b' ], [ 'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997', '4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913' ], [ '841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881', '73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154' ], [ '5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5', '39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865' ], [ '36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66', 'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc' ], [ '336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726', 'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224' ], [ '8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede', '6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e' ], [ '1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94', '60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6' ], [ '85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31', '3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511' ], [ '29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51', 'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b' ], [ 'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252', 'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2' ], [ '4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5', 'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c' ], [ 'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b', '6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3' ], [ 'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4', '322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d' ], [ 'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f', '6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700' ], [ 'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889', '2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4' ], [ '591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246', 'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196' ], [ '11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984', '998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4' ], [ '3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a', 'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257' ], [ 'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030', 'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13' ], [ 'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197', '6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096' ], [ 'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593', 'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38' ], [ 'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef', '21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f' ], [ '347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38', '60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448' ], [ 'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a', '49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a' ], [ 'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111', '5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4' ], [ '4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502', '7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437' ], [ '3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea', 'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7' ], [ 'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26', '8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d' ], [ 'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986', '39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a' ], [ 'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e', '62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54' ], [ '48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4', '25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77' ], [ 'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda', 'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517' ], [ '6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859', 'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10' ], [ 'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f', 'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125' ], [ 'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c', '6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e' ], [ '13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942', 'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1' ], [ 'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a', '1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2' ], [ 'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80', '5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423' ], [ 'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d', '438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8' ], [ '8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1', 'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758' ], [ '52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63', 'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375' ], [ 'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352', '6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d' ], [ '7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193', 'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec' ], [ '5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00', '9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0' ], [ '32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58', 'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c' ], [ 'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7', 'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4' ], [ '8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8', 'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f' ], [ '4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e', '67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649' ], [ '3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d', 'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826' ], [ '674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b', '299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5' ], [ 'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f', 'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87' ], [ '30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6', '462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b' ], [ 'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297', '62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc' ], [ '93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a', '7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c' ], [ 'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c', 'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f' ], [ 'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52', '4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a' ], [ 'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb', 'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46' ], [ '463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065', 'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f' ], [ '7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917', '603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03' ], [ '74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9', 'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08' ], [ '30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3', '553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8' ], [ '9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57', '712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373' ], [ '176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66', 'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3' ], [ '75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8', '9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8' ], [ '809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721', '9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1' ], [ '1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180', '4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9' ] ] } }; },{}],82:[function(require,module,exports){ 'use strict'; var utils = exports; var BN = require('bn.js'); utils.assert = function assert(val, msg) { if (!val) throw new Error(msg || 'Assertion failed'); }; 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) { 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); } } else 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)); } 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; }; // Represent num in a w-NAF form function getNAF(num, w) { var naf = []; var ws = 1 << (w + 1); var k = num.clone(); while (k.cmpn(1) >= 0) { var z; if (k.isOdd()) { var mod = k.andln(ws - 1); if (mod > (ws >> 1) - 1) z = (ws >> 1) - mod; else z = mod; k.isubn(z); } else { z = 0; } naf.push(z); // Optimization, shift by word if possible var shift = (k.cmpn(0) !== 0 && k.andln(ws - 1) === 0) ? (w + 1) : 1; for (var i = 1; i < shift; i++) naf.push(0); k.iushrn(shift); } 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; 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 { var 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 { var 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; },{"bn.js":18}],83:[function(require,module,exports){ module.exports={ "_args": [ [ "elliptic@^6.0.0", "/home/dominic/.nvm/versions/node/v6.2.0/lib/node_modules/browserify/node_modules/browserify-sign" ] ], "_from": "elliptic@>=6.0.0 <7.0.0", "_id": "elliptic@6.2.7", "_inCache": true, "_installable": true, "_location": "/browserify/elliptic", "_nodeVersion": "6.0.0", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", "tmp": "tmp/elliptic-6.2.7.tgz_1464201793202_0.12479878286831081" }, "_npmUser": { "email": "fedor@indutny.com", "name": "indutny" }, "_npmVersion": "3.8.6", "_phantomChildren": {}, "_requested": { "name": "elliptic", "raw": "elliptic@^6.0.0", "rawSpec": "^6.0.0", "scope": null, "spec": ">=6.0.0 <7.0.0", "type": "range" }, "_requiredBy": [ "/browserify/browserify-sign", "/browserify/create-ecdh" ], "_resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.2.7.tgz", "_shasum": "dce82efbf176eefa7495d4be3e8b9f5b5694b295", "_shrinkwrap": null, "_spec": "elliptic@^6.0.0", "_where": "/home/dominic/.nvm/versions/node/v6.2.0/lib/node_modules/browserify/node_modules/browserify-sign", "author": { "email": "fedor@indutny.com", "name": "Fedor Indutny" }, "bugs": { "url": "https://github.com/indutny/elliptic/issues" }, "dependencies": { "bn.js": "^4.0.0", "brorand": "^1.0.1", "hash.js": "^1.0.0", "inherits": "^2.0.1" }, "description": "EC cryptography", "devDependencies": { "brfs": "^1.4.3", "coveralls": "^2.11.3", "grunt": "^0.4.5", "grunt-browserify": "^5.0.0", "grunt-contrib-connect": "^1.0.0", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-uglify": "^1.0.1", "grunt-mocha-istanbul": "^3.0.1", "grunt-saucelabs": "^8.6.2", "istanbul": "^0.4.2", "jscs": "^2.9.0", "jshint": "^2.6.0", "mocha": "^2.1.0" }, "directories": {}, "dist": { "shasum": "dce82efbf176eefa7495d4be3e8b9f5b5694b295", "tarball": "https://registry.npmjs.org/elliptic/-/elliptic-6.2.7.tgz" }, "files": [ "lib" ], "gitHead": "6a8ef1457bb8f45102d6678fc1095165f77d55d3", "homepage": "https://github.com/indutny/elliptic", "keywords": [ "EC", "Elliptic", "curve", "Cryptography" ], "license": "MIT", "main": "lib/elliptic.js", "maintainers": [ { "email": "fedor@indutny.com", "name": "indutny" } ], "name": "elliptic", "optionalDependencies": {}, "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git+ssh://git@github.com/indutny/elliptic.git" }, "scripts": { "jscs": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js", "jshint": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js", "lint": "npm run jscs && npm run jshint", "test": "npm run lint && npm run unit", "unit": "istanbul test _mocha --reporter=spec test/index.js", "version": "grunt dist && git add dist/" }, "version": "6.2.7" } },{}],84:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. function EventEmitter() { this._events = this._events || {}; this._maxListeners = this._maxListeners || undefined; } module.exports = EventEmitter; // Backwards-compat with node 0.10.x EventEmitter.EventEmitter = EventEmitter; EventEmitter.prototype._events = undefined; EventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are // added to it. This is a useful default which helps finding memory leaks. EventEmitter.defaultMaxListeners = 10; // Obviously not all Emitters should be limited to 10. This function allows // that to be increased. Set to zero for unlimited. EventEmitter.prototype.setMaxListeners = function(n) { if (!isNumber(n) || n < 0 || isNaN(n)) throw TypeError('n must be a positive number'); this._maxListeners = n; return this; }; EventEmitter.prototype.emit = function(type) { var er, handler, len, args, i, listeners; if (!this._events) this._events = {}; // If there is no 'error' event listener then throw. if (type === 'error') { if (!this._events.error || (isObject(this._events.error) && !this._events.error.length)) { er = arguments[1]; if (er instanceof Error) { throw er; // Unhandled 'error' event } throw TypeError('Uncaught, unspecified "error" event.'); } } handler = this._events[type]; if (isUndefined(handler)) return false; if (isFunction(handler)) { switch (arguments.length) { // fast cases case 1: handler.call(this); break; case 2: handler.call(this, arguments[1]); break; case 3: handler.call(this, arguments[1], arguments[2]); break; // slower default: args = Array.prototype.slice.call(arguments, 1); handler.apply(this, args); } } else if (isObject(handler)) { args = Array.prototype.slice.call(arguments, 1); listeners = handler.slice(); len = listeners.length; for (i = 0; i < len; i++) listeners[i].apply(this, args); } return true; }; EventEmitter.prototype.addListener = function(type, listener) { var m; if (!isFunction(listener)) throw TypeError('listener must be a function'); if (!this._events) this._events = {}; // To avoid recursion in the case that type === "newListener"! Before // adding it to the listeners, first emit "newListener". if (this._events.newListener) this.emit('newListener', type, isFunction(listener.listener) ? listener.listener : listener); if (!this._events[type]) // Optimize the case of one listener. Don't need the extra array object. this._events[type] = listener; else if (isObject(this._events[type])) // If we've already got an array, just append. this._events[type].push(listener); else // Adding the second element, need to change to array. this._events[type] = [this._events[type], listener]; // Check for listener leak if (isObject(this._events[type]) && !this._events[type].warned) { if (!isUndefined(this._maxListeners)) { m = this._maxListeners; } else { m = EventEmitter.defaultMaxListeners; } if (m && m > 0 && this._events[type].length > m) { this._events[type].warned = true; console.error('(node) warning: possible EventEmitter memory ' + 'leak detected. %d listeners added. ' + 'Use emitter.setMaxListeners() to increase limit.', this._events[type].length); if (typeof console.trace === 'function') { // not supported in IE 10 console.trace(); } } } return this; }; EventEmitter.prototype.on = EventEmitter.prototype.addListener; EventEmitter.prototype.once = function(type, listener) { if (!isFunction(listener)) throw TypeError('listener must be a function'); var fired = false; function g() { this.removeListener(type, g); if (!fired) { fired = true; listener.apply(this, arguments); } } g.listener = listener; this.on(type, g); return this; }; // emits a 'removeListener' event iff the listener was removed EventEmitter.prototype.removeListener = function(type, listener) { var list, position, length, i; if (!isFunction(listener)) throw TypeError('listener must be a function'); if (!this._events || !this._events[type]) return this; list = this._events[type]; length = list.length; position = -1; if (list === listener || (isFunction(list.listener) && list.listener === listener)) { delete this._events[type]; if (this._events.removeListener) this.emit('removeListener', type, listener); } else if (isObject(list)) { for (i = length; i-- > 0;) { if (list[i] === listener || (list[i].listener && list[i].listener === listener)) { position = i; break; } } if (position < 0) return this; if (list.length === 1) { list.length = 0; delete this._events[type]; } else { list.splice(position, 1); } if (this._events.removeListener) this.emit('removeListener', type, listener); } return this; }; EventEmitter.prototype.removeAllListeners = function(type) { var key, listeners; if (!this._events) return this; // not listening for removeListener, no need to emit if (!this._events.removeListener) { if (arguments.length === 0) this._events = {}; else if (this._events[type]) delete this._events[type]; return this; } // emit removeListener for all listeners on all events if (arguments.length === 0) { for (key in this._events) { if (key === 'removeListener') continue; this.removeAllListeners(key); } this.removeAllListeners('removeListener'); this._events = {}; return this; } listeners = this._events[type]; if (isFunction(listeners)) { this.removeListener(type, listeners); } else if (listeners) { // LIFO order while (listeners.length) this.removeListener(type, listeners[listeners.length - 1]); } delete this._events[type]; return this; }; EventEmitter.prototype.listeners = function(type) { var ret; if (!this._events || !this._events[type]) ret = []; else if (isFunction(this._events[type])) ret = [this._events[type]]; else ret = this._events[type].slice(); return ret; }; EventEmitter.prototype.listenerCount = function(type) { if (this._events) { var evlistener = this._events[type]; if (isFunction(evlistener)) return 1; else if (evlistener) return evlistener.length; } return 0; }; EventEmitter.listenerCount = function(emitter, type) { return emitter.listenerCount(type); }; function isFunction(arg) { return typeof arg === 'function'; } function isNumber(arg) { return typeof arg === 'number'; } function isObject(arg) { return typeof arg === 'object' && arg !== null; } function isUndefined(arg) { return arg === void 0; } },{}],85:[function(require,module,exports){ (function (Buffer){ var md5 = require('create-hash/md5') module.exports = EVP_BytesToKey function EVP_BytesToKey (password, salt, keyLen, ivLen) { if (!Buffer.isBuffer(password)) { password = new Buffer(password, 'binary') } if (salt && !Buffer.isBuffer(salt)) { salt = new Buffer(salt, 'binary') } keyLen = keyLen / 8 ivLen = ivLen || 0 var ki = 0 var ii = 0 var key = new Buffer(keyLen) var iv = new Buffer(ivLen) var addmd = 0 var md_buf var i var bufs = [] while (true) { if (addmd++ > 0) { bufs.push(md_buf) } bufs.push(password) if (salt) { bufs.push(salt) } md_buf = md5(Buffer.concat(bufs)) bufs = [] i = 0 if (keyLen > 0) { while (true) { if (keyLen === 0) { break } if (i === md_buf.length) { break } key[ki++] = md_buf[i] keyLen-- i++ } } if (ivLen > 0 && i !== md_buf.length) { while (true) { if (ivLen === 0) { break } if (i === md_buf.length) { break } iv[ii++] = md_buf[i] ivLen-- i++ } } if (keyLen === 0 && ivLen === 0) { break } } for (i = 0; i < md_buf.length; i++) { md_buf[i] = 0 } return { key: key, iv: iv } } }).call(this,require("buffer").Buffer) },{"buffer":47,"create-hash/md5":54}],86:[function(require,module,exports){ var hash = exports; hash.utils = require('./hash/utils'); hash.common = require('./hash/common'); hash.sha = require('./hash/sha'); hash.ripemd = require('./hash/ripemd'); hash.hmac = require('./hash/hmac'); // 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/common":87,"./hash/hmac":88,"./hash/ripemd":89,"./hash/sha":90,"./hash/utils":91}],87:[function(require,module,exports){ var hash = require('../hash'); var utils = hash.utils; var assert = utils.assert; function BlockHash() { 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; } exports.BlockHash = BlockHash; BlockHash.prototype.update = function update(msg, enc) { // Convert message to array, pad it, and join into 32bit blocks msg = utils.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.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.prototype.digest = function digest(enc) { this.update(this._pad()); assert(this.pending === null); return this._digest(enc); }; BlockHash.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 (var t = 8; t < this.padLength; t++) res[i++] = 0; } return res; }; },{"../hash":86}],88:[function(require,module,exports){ var hmac = exports; var hash = require('../hash'); var utils = hash.utils; var assert = utils.assert; 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.toArray(key, enc)); } module.exports = Hmac; Hmac.prototype._init = function init(key) { // Shorten key, if needed if (key.length > this.blockSize) key = new this.Hash().update(key).digest(); assert(key.length <= this.blockSize); // Add padding to key for (var i = key.length; i < this.blockSize; i++) key.push(0); for (var i = 0; i < key.length; i++) key[i] ^= 0x36; this.inner = new this.Hash().update(key); // 0x36 ^ 0x5c = 0x6a for (var 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); }; },{"../hash":86}],89:[function(require,module,exports){ var hash = require('../hash'); var utils = hash.utils; var rotl32 = utils.rotl32; var sum32 = utils.sum32; var sum32_3 = utils.sum32_3; var sum32_4 = utils.sum32_4; var BlockHash = hash.common.BlockHash; function RIPEMD160() { if (!(this instanceof RIPEMD160)) return new RIPEMD160(); BlockHash.call(this); this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ]; this.endian = 'little'; } utils.inherits(RIPEMD160, BlockHash); exports.ripemd160 = RIPEMD160; RIPEMD160.blockSize = 512; RIPEMD160.outSize = 160; RIPEMD160.hmacStrength = 192; RIPEMD160.padLength = 64; RIPEMD160.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( sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)), s[j]), E); A = E; E = D; D = rotl32(C, 10); C = B; B = T; T = sum32( rotl32( sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)), sh[j]), Eh); Ah = Eh; Eh = Dh; Dh = rotl32(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.prototype._digest = function digest(enc) { if (enc === 'hex') return utils.toHex32(this.h, 'little'); else return utils.split32(this.h, 'little'); }; function f(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(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(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 = [ 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 = [ 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 = [ 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 = [ 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 ]; },{"../hash":86}],90:[function(require,module,exports){ var hash = require('../hash'); var utils = hash.utils; var assert = utils.assert; var rotr32 = utils.rotr32; var rotl32 = utils.rotl32; var sum32 = utils.sum32; var sum32_4 = utils.sum32_4; var sum32_5 = utils.sum32_5; var rotr64_hi = utils.rotr64_hi; var rotr64_lo = utils.rotr64_lo; var shr64_hi = utils.shr64_hi; var shr64_lo = utils.shr64_lo; var sum64 = utils.sum64; var sum64_hi = utils.sum64_hi; var sum64_lo = utils.sum64_lo; var sum64_4_hi = utils.sum64_4_hi; var sum64_4_lo = utils.sum64_4_lo; var sum64_5_hi = utils.sum64_5_hi; var sum64_5_lo = utils.sum64_5_lo; var BlockHash = hash.common.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 ]; 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 ]; var sha1_K = [ 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xCA62C1D6 ]; function SHA256() { if (!(this instanceof SHA256)) return new SHA256(); BlockHash.call(this); this.h = [ 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 ]; this.k = sha256_K; this.W = new Array(64); } utils.inherits(SHA256, BlockHash); exports.sha256 = SHA256; SHA256.blockSize = 512; SHA256.outSize = 256; SHA256.hmacStrength = 192; SHA256.padLength = 64; SHA256.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(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(this.k.length === W.length); for (var i = 0; i < W.length; i++) { var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]); var T2 = sum32(s0_256(a), maj32(a, b, c)); h = g; g = f; f = e; e = sum32(d, T1); d = c; c = b; b = a; a = sum32(T1, T2); } this.h[0] = sum32(this.h[0], a); this.h[1] = sum32(this.h[1], b); this.h[2] = sum32(this.h[2], c); this.h[3] = sum32(this.h[3], d); this.h[4] = sum32(this.h[4], e); this.h[5] = sum32(this.h[5], f); this.h[6] = sum32(this.h[6], g); this.h[7] = sum32(this.h[7], h); }; SHA256.prototype._digest = function digest(enc) { if (enc === 'hex') return utils.toHex32(this.h, 'big'); else return utils.split32(this.h, 'big'); }; function SHA224() { if (!(this instanceof SHA224)) return new SHA224(); SHA256.call(this); this.h = [ 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ]; } utils.inherits(SHA224, SHA256); exports.sha224 = 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.toHex32(this.h.slice(0, 7), 'big'); else return utils.split32(this.h.slice(0, 7), 'big'); }; function SHA512() { if (!(this instanceof SHA512)) return new SHA512(); BlockHash.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.inherits(SHA512, BlockHash); exports.sha512 = SHA512; SHA512.blockSize = 1024; SHA512.outSize = 512; SHA512.hmacStrength = 192; SHA512.padLength = 128; SHA512.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(W[i - 4], W[i - 3]); // i - 2 var c0_lo = g1_512_lo(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(W[i - 30], W[i - 29]); // i - 15 var c2_lo = g0_512_lo(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(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo); W[i + 1] = sum64_4_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo); } }; SHA512.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(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(eh, el); var c1_lo = s1_512_lo(eh, el); var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl); var c2_lo = ch64_lo(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(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(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo); var c0_hi = s0_512_hi(ah, al); var c0_lo = s0_512_lo(ah, al); var c1_hi = maj64_hi(ah, al, bh, bl, ch, cl); var c1_lo = maj64_lo(ah, al, bh, bl, ch, cl); var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo); var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo); hh = gh; hl = gl; gh = fh; gl = fl; fh = eh; fl = el; eh = sum64_hi(dh, dl, T1_hi, T1_lo); el = sum64_lo(dl, dl, T1_hi, T1_lo); dh = ch; dl = cl; ch = bh; cl = bl; bh = ah; bl = al; ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo); al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo); } sum64(this.h, 0, ah, al); sum64(this.h, 2, bh, bl); sum64(this.h, 4, ch, cl); sum64(this.h, 6, dh, dl); sum64(this.h, 8, eh, el); sum64(this.h, 10, fh, fl); sum64(this.h, 12, gh, gl); sum64(this.h, 14, hh, hl); }; SHA512.prototype._digest = function digest(enc) { if (enc === 'hex') return utils.toHex32(this.h, 'big'); else return utils.split32(this.h, 'big'); }; function SHA384() { if (!(this instanceof SHA384)) return new SHA384(); SHA512.call(this); this.h = [ 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939, 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4 ]; } utils.inherits(SHA384, SHA512); exports.sha384 = SHA384; SHA384.blockSize = 1024; SHA384.outSize = 384; SHA384.hmacStrength = 192; SHA384.padLength = 128; SHA384.prototype._digest = function digest(enc) { if (enc === 'hex') return utils.toHex32(this.h.slice(0, 12), 'big'); else return utils.split32(this.h.slice(0, 12), 'big'); }; function SHA1() { if (!(this instanceof SHA1)) return new SHA1(); BlockHash.call(this); this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ]; this.W = new Array(80); } utils.inherits(SHA1, BlockHash); exports.sha1 = SHA1; SHA1.blockSize = 512; SHA1.outSize = 160; SHA1.hmacStrength = 80; SHA1.padLength = 64; SHA1.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(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 (var i = 0; i < W.length; i++) { var s = ~~(i / 20); var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]); e = d; d = c; c = rotl32(b, 30); b = a; a = t; } this.h[0] = sum32(this.h[0], a); this.h[1] = sum32(this.h[1], b); this.h[2] = sum32(this.h[2], c); this.h[3] = sum32(this.h[3], d); this.h[4] = sum32(this.h[4], e); }; SHA1.prototype._digest = function digest(enc) { if (enc === 'hex') return utils.toHex32(this.h, 'big'); else return utils.split32(this.h, 'big'); }; function ch32(x, y, z) { return (x & y) ^ ((~x) & z); } function maj32(x, y, z) { return (x & y) ^ (x & z) ^ (y & z); } function p32(x, y, z) { return x ^ y ^ z; } function s0_256(x) { return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22); } function s1_256(x) { return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25); } function g0_256(x) { return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3); } function g1_256(x) { return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10); } function ft_1(s, x, y, z) { if (s === 0) return ch32(x, y, z); if (s === 1 || s === 3) return p32(x, y, z); if (s === 2) return maj32(x, y, z); } function ch64_hi(xh, xl, yh, yl, zh, zl) { var r = (xh & yh) ^ ((~xh) & zh); if (r < 0) r += 0x100000000; return r; } function ch64_lo(xh, xl, yh, yl, zh, zl) { var r = (xl & yl) ^ ((~xl) & zl); if (r < 0) r += 0x100000000; return r; } function maj64_hi(xh, xl, yh, yl, zh, zl) { var r = (xh & yh) ^ (xh & zh) ^ (yh & zh); if (r < 0) r += 0x100000000; return r; } function maj64_lo(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(xh, xl) { var c0_hi = rotr64_hi(xh, xl, 28); var c1_hi = rotr64_hi(xl, xh, 2); // 34 var c2_hi = rotr64_hi(xl, xh, 7); // 39 var r = c0_hi ^ c1_hi ^ c2_hi; if (r < 0) r += 0x100000000; return r; } function s0_512_lo(xh, xl) { var c0_lo = rotr64_lo(xh, xl, 28); var c1_lo = rotr64_lo(xl, xh, 2); // 34 var c2_lo = rotr64_lo(xl, xh, 7); // 39 var r = c0_lo ^ c1_lo ^ c2_lo; if (r < 0) r += 0x100000000; return r; } function s1_512_hi(xh, xl) { var c0_hi = rotr64_hi(xh, xl, 14); var c1_hi = rotr64_hi(xh, xl, 18); var c2_hi = rotr64_hi(xl, xh, 9); // 41 var r = c0_hi ^ c1_hi ^ c2_hi; if (r < 0) r += 0x100000000; return r; } function s1_512_lo(xh, xl) { var c0_lo = rotr64_lo(xh, xl, 14); var c1_lo = rotr64_lo(xh, xl, 18); var c2_lo = rotr64_lo(xl, xh, 9); // 41 var r = c0_lo ^ c1_lo ^ c2_lo; if (r < 0) r += 0x100000000; return r; } function g0_512_hi(xh, xl) { var c0_hi = rotr64_hi(xh, xl, 1); var c1_hi = rotr64_hi(xh, xl, 8); var c2_hi = shr64_hi(xh, xl, 7); var r = c0_hi ^ c1_hi ^ c2_hi; if (r < 0) r += 0x100000000; return r; } function g0_512_lo(xh, xl) { var c0_lo = rotr64_lo(xh, xl, 1); var c1_lo = rotr64_lo(xh, xl, 8); var c2_lo = shr64_lo(xh, xl, 7); var r = c0_lo ^ c1_lo ^ c2_lo; if (r < 0) r += 0x100000000; return r; } function g1_512_hi(xh, xl) { var c0_hi = rotr64_hi(xh, xl, 19); var c1_hi = rotr64_hi(xl, xh, 29); // 61 var c2_hi = shr64_hi(xh, xl, 6); var r = c0_hi ^ c1_hi ^ c2_hi; if (r < 0) r += 0x100000000; return r; } function g1_512_lo(xh, xl) { var c0_lo = rotr64_lo(xh, xl, 19); var c1_lo = rotr64_lo(xl, xh, 29); // 61 var c2_lo = shr64_lo(xh, xl, 6); var r = c0_lo ^ c1_lo ^ c2_lo; if (r < 0) r += 0x100000000; return r; } },{"../hash":86}],91:[function(require,module,exports){ var utils = exports; var inherits = require('inherits'); function toArray(msg, enc) { if (Array.isArray(msg)) return msg.slice(); if (!msg) return []; var res = []; if (typeof msg === 'string') { if (!enc) { 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); } } else 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++) res[i] = msg[i] | 0; } return res; } utils.toArray = toArray; function toHex(msg) { var res = ''; for (var i = 0; i < msg.length; i++) res += zero2(msg[i].toString(16)); return res; } utils.toHex = toHex; function htonl(w) { var res = (w >>> 24) | ((w >>> 8) & 0xff00) | ((w << 8) & 0xff0000) | ((w & 0xff) << 24); return res >>> 0; } utils.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.toHex32 = toHex32; function zero2(word) { if (word.length === 1) return '0' + word; else return word; } utils.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.zero8 = zero8; function join32(msg, start, end, endian) { var len = end - start; assert(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.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.split32 = split32; function rotr32(w, b) { return (w >>> b) | (w << (32 - b)); } utils.rotr32 = rotr32; function rotl32(w, b) { return (w << b) | (w >>> (32 - b)); } utils.rotl32 = rotl32; function sum32(a, b) { return (a + b) >>> 0; } utils.sum32 = sum32; function sum32_3(a, b, c) { return (a + b + c) >>> 0; } utils.sum32_3 = sum32_3; function sum32_4(a, b, c, d) { return (a + b + c + d) >>> 0; } utils.sum32_4 = sum32_4; function sum32_5(a, b, c, d, e) { return (a + b + c + d + e) >>> 0; } utils.sum32_5 = sum32_5; function assert(cond, msg) { if (!cond) throw new Error(msg || 'Assertion failed'); } utils.assert = assert; utils.inherits = inherits; function sum64(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; } exports.sum64 = sum64; function sum64_hi(ah, al, bh, bl) { var lo = (al + bl) >>> 0; var hi = (lo < al ? 1 : 0) + ah + bh; return hi >>> 0; }; exports.sum64_hi = sum64_hi; function sum64_lo(ah, al, bh, bl) { var lo = al + bl; return lo >>> 0; }; exports.sum64_lo = sum64_lo; function sum64_4_hi(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; }; exports.sum64_4_hi = sum64_4_hi; function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) { var lo = al + bl + cl + dl; return lo >>> 0; }; exports.sum64_4_lo = sum64_4_lo; function sum64_5_hi(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; }; exports.sum64_5_hi = sum64_5_hi; function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { var lo = al + bl + cl + dl + el; return lo >>> 0; }; exports.sum64_5_lo = sum64_5_lo; function rotr64_hi(ah, al, num) { var r = (al << (32 - num)) | (ah >>> num); return r >>> 0; }; exports.rotr64_hi = rotr64_hi; function rotr64_lo(ah, al, num) { var r = (ah << (32 - num)) | (al >>> num); return r >>> 0; }; exports.rotr64_lo = rotr64_lo; function shr64_hi(ah, al, num) { return ah >>> num; }; exports.shr64_hi = shr64_hi; function shr64_lo(ah, al, num) { var r = (ah << (32 - num)) | (al >>> num); return r >>> 0; }; exports.shr64_lo = shr64_lo; },{"inherits":95}],92:[function(require,module,exports){ var http = require('http'); var https = module.exports; for (var key in http) { if (http.hasOwnProperty(key)) https[key] = http[key]; }; https.request = function (params, cb) { if (!params) params = {}; params.scheme = 'https'; params.protocol = 'https:'; return http.request.call(this, params, cb); } },{"http":140}],93:[function(require,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = nBytes * 8 - mLen - 1 var eMax = (1 << eLen) - 1 var eBias = eMax >> 1 var nBits = -7 var i = isLE ? (nBytes - 1) : 0 var d = isLE ? -1 : 1 var s = buffer[offset + i] i += d e = s & ((1 << (-nBits)) - 1) s >>= (-nBits) nBits += eLen for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} m = e & ((1 << (-nBits)) - 1) e >>= (-nBits) nBits += mLen for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} if (e === 0) { e = 1 - eBias } else if (e === eMax) { return m ? NaN : ((s ? -1 : 1) * Infinity) } else { m = m + Math.pow(2, mLen) e = e - eBias } return (s ? -1 : 1) * m * Math.pow(2, e - mLen) } exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { var e, m, c var eLen = nBytes * 8 - mLen - 1 var eMax = (1 << eLen) - 1 var eBias = eMax >> 1 var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) var i = isLE ? 0 : (nBytes - 1) var d = isLE ? 1 : -1 var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 value = Math.abs(value) if (isNaN(value) || value === Infinity) { m = isNaN(value) ? 1 : 0 e = eMax } else { e = Math.floor(Math.log(value) / Math.LN2) if (value * (c = Math.pow(2, -e)) < 1) { e-- c *= 2 } if (e + eBias >= 1) { value += rt / c } else { value += rt * Math.pow(2, 1 - eBias) } if (value * c >= 2) { e++ c /= 2 } if (e + eBias >= eMax) { m = 0 e = eMax } else if (e + eBias >= 1) { m = (value * c - 1) * Math.pow(2, mLen) e = e + eBias } else { m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) e = 0 } } for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} e = (e << mLen) | m eLen += mLen for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} buffer[offset + i - d] |= s * 128 } },{}],94:[function(require,module,exports){ var indexOf = [].indexOf; module.exports = function(arr, obj){ if (indexOf) return arr.indexOf(obj); for (var i = 0; i < arr.length; ++i) { if (arr[i] === obj) return i; } return -1; }; },{}],95:[function(require,module,exports){ if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, 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 module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor var TempCtor = function () {} TempCtor.prototype = superCtor.prototype ctor.prototype = new TempCtor() ctor.prototype.constructor = ctor } } },{}],96:[function(require,module,exports){ /** * Determine if an object is Buffer * * Author: Feross Aboukhadijeh * License: MIT * * `npm install is-buffer` */ module.exports = function (obj) { return !!(obj != null && (obj._isBuffer || // For Safari 5-7 (missing Object.prototype.constructor) (obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)) )) } },{}],97:[function(require,module,exports){ var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; },{}],98:[function(require,module,exports){ var bn = require('bn.js'); var brorand = require('brorand'); function MillerRabin(rand) { this.rand = rand || new brorand.Rand(); } module.exports = MillerRabin; MillerRabin.create = function create(rand) { return new MillerRabin(rand); }; MillerRabin.prototype._rand = function _rand(n) { var len = n.bitLength(); var buf = this.rand.generate(Math.ceil(len / 8)); // Set low bits buf[0] |= 3; // Mask high bits var mask = len & 0x7; if (mask !== 0) buf[buf.length - 1] >>= 7 - mask; return new bn(buf); } MillerRabin.prototype.test = function test(n, k, cb) { var len = n.bitLength(); var red = bn.mont(n); var rone = new bn(1).toRed(red); if (!k) k = Math.max(1, (len / 48) | 0); // Find d and s, (n - 1) = (2 ^ s) * d; var n1 = n.subn(1); var n2 = n1.subn(1); for (var s = 0; !n1.testn(s); s++) {} var d = n.shrn(s); var rn1 = n1.toRed(red); var prime = true; for (; k > 0; k--) { var a = this._rand(n2); if (cb) cb(a); var x = a.toRed(red).redPow(d); if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) continue; for (var i = 1; i < s; i++) { x = x.redSqr(); if (x.cmp(rone) === 0) return false; if (x.cmp(rn1) === 0) break; } if (i === s) return false; } return prime; }; MillerRabin.prototype.getDivisor = function getDivisor(n, k) { var len = n.bitLength(); var red = bn.mont(n); var rone = new bn(1).toRed(red); if (!k) k = Math.max(1, (len / 48) | 0); // Find d and s, (n - 1) = (2 ^ s) * d; var n1 = n.subn(1); var n2 = n1.subn(1); for (var s = 0; !n1.testn(s); s++) {} var d = n.shrn(s); var rn1 = n1.toRed(red); for (; k > 0; k--) { var a = this._rand(n2); var g = n.gcd(a); if (g.cmpn(1) !== 0) return g; var x = a.toRed(red).redPow(d); if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) continue; for (var i = 1; i < s; i++) { x = x.redSqr(); if (x.cmp(rone) === 0) return x.fromRed().subn(1).gcd(n); if (x.cmp(rn1) === 0) break; } if (i === s) { x = x.redSqr(); return x.fromRed().subn(1).gcd(n); } } return false; }; },{"bn.js":18,"brorand":19}],99:[function(require,module,exports){ module.exports = assert; function assert(val, msg) { if (!val) throw new Error(msg || 'Assertion failed'); } assert.equal = function assertEqual(l, r, msg) { if (l != r) throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r)); }; },{}],100:[function(require,module,exports){ exports.endianness = function () { return 'LE' }; exports.hostname = function () { if (typeof location !== 'undefined') { return location.hostname } else return ''; }; exports.loadavg = function () { return [] }; exports.uptime = function () { return 0 }; exports.freemem = function () { return Number.MAX_VALUE; }; exports.totalmem = function () { return Number.MAX_VALUE; }; exports.cpus = function () { return [] }; exports.type = function () { return 'Browser' }; exports.release = function () { if (typeof navigator !== 'undefined') { return navigator.appVersion; } return ''; }; exports.networkInterfaces = exports.getNetworkInterfaces = function () { return {} }; exports.arch = function () { return 'javascript' }; exports.platform = function () { return 'browser' }; exports.tmpdir = exports.tmpDir = function () { return '/tmp'; }; exports.EOL = '\n'; },{}],101:[function(require,module,exports){ module.exports={"2.16.840.1.101.3.4.1.1": "aes-128-ecb", "2.16.840.1.101.3.4.1.2": "aes-128-cbc", "2.16.840.1.101.3.4.1.3": "aes-128-ofb", "2.16.840.1.101.3.4.1.4": "aes-128-cfb", "2.16.840.1.101.3.4.1.21": "aes-192-ecb", "2.16.840.1.101.3.4.1.22": "aes-192-cbc", "2.16.840.1.101.3.4.1.23": "aes-192-ofb", "2.16.840.1.101.3.4.1.24": "aes-192-cfb", "2.16.840.1.101.3.4.1.41": "aes-256-ecb", "2.16.840.1.101.3.4.1.42": "aes-256-cbc", "2.16.840.1.101.3.4.1.43": "aes-256-ofb", "2.16.840.1.101.3.4.1.44": "aes-256-cfb" } },{}],102:[function(require,module,exports){ // from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js // Fedor, you are amazing. var asn1 = require('asn1.js') var RSAPrivateKey = asn1.define('RSAPrivateKey', function () { this.seq().obj( this.key('version').int(), this.key('modulus').int(), this.key('publicExponent').int(), this.key('privateExponent').int(), this.key('prime1').int(), this.key('prime2').int(), this.key('exponent1').int(), this.key('exponent2').int(), this.key('coefficient').int() ) }) exports.RSAPrivateKey = RSAPrivateKey var RSAPublicKey = asn1.define('RSAPublicKey', function () { this.seq().obj( this.key('modulus').int(), this.key('publicExponent').int() ) }) exports.RSAPublicKey = RSAPublicKey var PublicKey = asn1.define('SubjectPublicKeyInfo', function () { this.seq().obj( this.key('algorithm').use(AlgorithmIdentifier), this.key('subjectPublicKey').bitstr() ) }) exports.PublicKey = PublicKey var AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () { this.seq().obj( this.key('algorithm').objid(), this.key('none').null_().optional(), this.key('curve').objid().optional(), this.key('params').seq().obj( this.key('p').int(), this.key('q').int(), this.key('g').int() ).optional() ) }) var PrivateKeyInfo = asn1.define('PrivateKeyInfo', function () { this.seq().obj( this.key('version').int(), this.key('algorithm').use(AlgorithmIdentifier), this.key('subjectPrivateKey').octstr() ) }) exports.PrivateKey = PrivateKeyInfo var EncryptedPrivateKeyInfo = asn1.define('EncryptedPrivateKeyInfo', function () { this.seq().obj( this.key('algorithm').seq().obj( this.key('id').objid(), this.key('decrypt').seq().obj( this.key('kde').seq().obj( this.key('id').objid(), this.key('kdeparams').seq().obj( this.key('salt').octstr(), this.key('iters').int() ) ), this.key('cipher').seq().obj( this.key('algo').objid(), this.key('iv').octstr() ) ) ), this.key('subjectPrivateKey').octstr() ) }) exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo var DSAPrivateKey = asn1.define('DSAPrivateKey', function () { this.seq().obj( this.key('version').int(), this.key('p').int(), this.key('q').int(), this.key('g').int(), this.key('pub_key').int(), this.key('priv_key').int() ) }) exports.DSAPrivateKey = DSAPrivateKey exports.DSAparam = asn1.define('DSAparam', function () { this.int() }) var ECPrivateKey = asn1.define('ECPrivateKey', function () { this.seq().obj( this.key('version').int(), this.key('privateKey').octstr(), this.key('parameters').optional().explicit(0).use(ECParameters), this.key('publicKey').optional().explicit(1).bitstr() ) }) exports.ECPrivateKey = ECPrivateKey var ECParameters = asn1.define('ECParameters', function () { this.choice({ namedCurve: this.objid() }) }) exports.signature = asn1.define('signature', function () { this.seq().obj( this.key('r').int(), this.key('s').int() ) }) },{"asn1.js":2}],103:[function(require,module,exports){ (function (Buffer){ // adapted from https://github.com/apatil/pemstrip var findProc = /Proc-Type: 4,ENCRYPTED\r?\nDEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\r?\n\r?\n([0-9A-z\n\r\+\/\=]+)\r?\n/m var startRegex = /^-----BEGIN (.*) KEY-----\r?\n/m var fullRegex = /^-----BEGIN (.*) KEY-----\r?\n([0-9A-z\n\r\+\/\=]+)\r?\n-----END \1 KEY-----$/m var evp = require('evp_bytestokey') var ciphers = require('browserify-aes') module.exports = function (okey, password) { var key = okey.toString() var match = key.match(findProc) var decrypted if (!match) { var match2 = key.match(fullRegex) decrypted = new Buffer(match2[2].replace(/\r?\n/g, ''), 'base64') } else { var suite = 'aes' + match[1] var iv = new Buffer(match[2], 'hex') var cipherText = new Buffer(match[3].replace(/\r?\n/g, ''), 'base64') var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key var out = [] var cipher = ciphers.createDecipheriv(suite, cipherKey, iv) out.push(cipher.update(cipherText)) out.push(cipher.final()) decrypted = Buffer.concat(out) } var tag = key.match(startRegex)[1] + ' KEY' return { tag: tag, data: decrypted } } }).call(this,require("buffer").Buffer) },{"browserify-aes":23,"buffer":47,"evp_bytestokey":85}],104:[function(require,module,exports){ (function (Buffer){ var asn1 = require('./asn1') var aesid = require('./aesid.json') var fixProc = require('./fixProc') var ciphers = require('browserify-aes') var compat = require('pbkdf2') module.exports = parseKeys function parseKeys (buffer) { var password if (typeof buffer === 'object' && !Buffer.isBuffer(buffer)) { password = buffer.passphrase buffer = buffer.key } if (typeof buffer === 'string') { buffer = new Buffer(buffer) } var stripped = fixProc(buffer, password) var type = stripped.tag var data = stripped.data var subtype, ndata switch (type) { case 'PUBLIC KEY': ndata = asn1.PublicKey.decode(data, 'der') subtype = ndata.algorithm.algorithm.join('.') switch (subtype) { case '1.2.840.113549.1.1.1': return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der') case '1.2.840.10045.2.1': ndata.subjectPrivateKey = ndata.subjectPublicKey return { type: 'ec', data: ndata } case '1.2.840.10040.4.1': ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, 'der') return { type: 'dsa', data: ndata.algorithm.params } default: throw new Error('unknown key id ' + subtype) } throw new Error('unknown key type ' + type) case 'ENCRYPTED PRIVATE KEY': data = asn1.EncryptedPrivateKey.decode(data, 'der') data = decrypt(data, password) // falls through case 'PRIVATE KEY': ndata = asn1.PrivateKey.decode(data, 'der') subtype = ndata.algorithm.algorithm.join('.') switch (subtype) { case '1.2.840.113549.1.1.1': return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, 'der') case '1.2.840.10045.2.1': return { curve: ndata.algorithm.curve, privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, 'der').privateKey } case '1.2.840.10040.4.1': ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, 'der') return { type: 'dsa', params: ndata.algorithm.params } default: throw new Error('unknown key id ' + subtype) } throw new Error('unknown key type ' + type) case 'RSA PUBLIC KEY': return asn1.RSAPublicKey.decode(data, 'der') case 'RSA PRIVATE KEY': return asn1.RSAPrivateKey.decode(data, 'der') case 'DSA PRIVATE KEY': return { type: 'dsa', params: asn1.DSAPrivateKey.decode(data, 'der') } case 'EC PRIVATE KEY': data = asn1.ECPrivateKey.decode(data, 'der') return { curve: data.parameters.value, privateKey: data.privateKey } default: throw new Error('unknown key type ' + type) } } parseKeys.signature = asn1.signature function decrypt (data, password) { var salt = data.algorithm.decrypt.kde.kdeparams.salt var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10) var algo = aesid[data.algorithm.decrypt.cipher.algo.join('.')] var iv = data.algorithm.decrypt.cipher.iv var cipherText = data.subjectPrivateKey var keylen = parseInt(algo.split('-')[1], 10) / 8 var key = compat.pbkdf2Sync(password, salt, iters, keylen) var cipher = ciphers.createDecipheriv(algo, key, iv) var out = [] out.push(cipher.update(cipherText)) out.push(cipher.final()) return Buffer.concat(out) } }).call(this,require("buffer").Buffer) },{"./aesid.json":101,"./asn1":102,"./fixProc":103,"browserify-aes":23,"buffer":47,"pbkdf2":106}],105:[function(require,module,exports){ (function (process){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // resolves . and .. elements in a path array with directory names there // must be no slashes, empty elements, or device names (c:\) in the array // (so also no leading and trailing slashes - it does not distinguish // relative and absolute paths) function normalizeArray(parts, allowAboveRoot) { // if the path tries to go above the root, `up` ends up > 0 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 the path is allowed to go above the root, restore leading ..s if (allowAboveRoot) { for (; up--; up) { parts.unshift('..'); } } return parts; } // Split a filename into [root, dir, basename, ext], unix version // 'root' is just a slash, or nothing. var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; var splitPath = function(filename) { return splitPathRe.exec(filename).slice(1); }; // path.resolve([from ...], to) // posix version exports.resolve = function() { var resolvedPath = '', resolvedAbsolute = false; for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { var path = (i >= 0) ? arguments[i] : process.cwd(); // Skip empty and invalid entries if (typeof path !== 'string') { throw new TypeError('Arguments to path.resolve must be strings'); } else if (!path) { continue; } resolvedPath = path + '/' + resolvedPath; resolvedAbsolute = path.charAt(0) === '/'; } // At this point the path should be resolved to a full absolute path, but // handle relative paths to be safe (might happen when process.cwd() fails) // Normalize the path resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { return !!p; }), !resolvedAbsolute).join('/'); return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; }; // path.normalize(path) // posix version exports.normalize = function(path) { var isAbsolute = exports.isAbsolute(path), trailingSlash = substr(path, -1) === '/'; // Normalize the path path = normalizeArray(filter(path.split('/'), function(p) { return !!p; }), !isAbsolute).join('/'); if (!path && !isAbsolute) { path = '.'; } if (path && trailingSlash) { path += '/'; } return (isAbsolute ? '/' : '') + path; }; // posix version exports.isAbsolute = function(path) { return path.charAt(0) === '/'; }; // posix version exports.join = function() { var paths = Array.prototype.slice.call(arguments, 0); return exports.normalize(filter(paths, function(p, index) { if (typeof p !== 'string') { throw new TypeError('Arguments to path.join must be strings'); } return p; }).join('/')); }; // path.relative(from, to) // posix version exports.relative = function(from, to) { from = exports.resolve(from).substr(1); to = exports.resolve(to).substr(1); function trim(arr) { var start = 0; for (; start < arr.length; start++) { if (arr[start] !== '') break; } var end = arr.length - 1; for (; end >= 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; i < length; i++) { if (fromParts[i] !== toParts[i]) { samePartsLength = i; break; } } var outputParts = []; for (var i = samePartsLength; i < fromParts.length; i++) { outputParts.push('..'); } outputParts = outputParts.concat(toParts.slice(samePartsLength)); return outputParts.join('/'); }; exports.sep = '/'; exports.delimiter = ':'; exports.dirname = function(path) { var result = splitPath(path), root = result[0], dir = result[1]; if (!root && !dir) { // No dirname whatsoever return '.'; } if (dir) { // It has a dirname, strip trailing slash dir = dir.substr(0, dir.length - 1); } return root + dir; }; exports.basename = function(path, ext) { var f = splitPath(path)[2]; // TODO: make this comparison case-insensitive on windows? if (ext && f.substr(-1 * ext.length) === ext) { f = f.substr(0, f.length - ext.length); } return f; }; exports.extname = function(path) { return splitPath(path)[3]; }; function filter (xs, f) { if (xs.filter) return xs.filter(f); var res = []; for (var i = 0; i < xs.length; i++) { if (f(xs[i], i, xs)) res.push(xs[i]); } return res; } // String.prototype.substr - negative index don't work in IE8 var substr = 'ab'.substr(-1) === 'b' ? function (str, start, len) { return str.substr(start, len) } : function (str, start, len) { if (start < 0) start = str.length + start; return str.substr(start, len); } ; }).call(this,require('_process')) },{"_process":108}],106:[function(require,module,exports){ (function (Buffer){ var createHmac = require('create-hmac') var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs exports.pbkdf2 = pbkdf2 function pbkdf2 (password, salt, iterations, keylen, digest, callback) { if (typeof digest === 'function') { callback = digest digest = undefined } if (typeof callback !== 'function') { throw new Error('No callback provided to pbkdf2') } var result = pbkdf2Sync(password, salt, iterations, keylen, digest) setTimeout(function () { callback(undefined, result) }) } exports.pbkdf2Sync = pbkdf2Sync function pbkdf2Sync (password, salt, iterations, keylen, digest) { 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) { throw new TypeError('Bad key length') } digest = digest || 'sha1' if (!Buffer.isBuffer(password)) password = new Buffer(password, 'binary') if (!Buffer.isBuffer(salt)) salt = new Buffer(salt, 'binary') var hLen var l = 1 var DK = new Buffer(keylen) var block1 = new Buffer(salt.length + 4) salt.copy(block1, 0, 0, salt.length) var r var T for (var i = 1; i <= l; i++) { block1.writeUInt32BE(i, salt.length) var U = createHmac(digest, password).update(block1).digest() if (!hLen) { hLen = U.length T = new Buffer(hLen) l = Math.ceil(keylen / hLen) r = keylen - (l - 1) * hLen } U.copy(T, 0, 0, hLen) 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] } } var destPos = (i - 1) * hLen var len = (i === l ? r : hLen) T.copy(DK, destPos, 0, len) } return DK } }).call(this,require("buffer").Buffer) },{"buffer":47,"create-hmac":55}],107:[function(require,module,exports){ (function (process){ 'use strict'; if (!process.version || process.version.indexOf('v0.') === 0 || process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { module.exports = nextTick; } else { module.exports = process.nextTick; } function nextTick(fn, arg1, arg2, arg3) { if (typeof fn !== 'function') { throw new TypeError('"callback" argument must be a function'); } var len = arguments.length; var args, i; switch (len) { case 0: case 1: return process.nextTick(fn); case 2: return process.nextTick(function afterTickOne() { fn.call(null, arg1); }); case 3: return process.nextTick(function afterTickTwo() { fn.call(null, arg1, arg2); }); case 4: return process.nextTick(function afterTickThree() { fn.call(null, arg1, arg2, arg3); }); default: args = new Array(len - 1); i = 0; while (i < args.length) { args[i++] = arguments[i]; } return process.nextTick(function afterTick() { fn.apply(null, args); }); } } }).call(this,require('_process')) },{"_process":108}],108:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = setTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; clearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { setTimeout(drainQueue, 0); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function() { return 0; }; },{}],109:[function(require,module,exports){ exports.publicEncrypt = require('./publicEncrypt'); exports.privateDecrypt = require('./privateDecrypt'); exports.privateEncrypt = function privateEncrypt(key, buf) { return exports.publicEncrypt(key, buf, true); }; exports.publicDecrypt = function publicDecrypt(key, buf) { return exports.privateDecrypt(key, buf, true); }; },{"./privateDecrypt":111,"./publicEncrypt":112}],110:[function(require,module,exports){ (function (Buffer){ var createHash = require('create-hash'); module.exports = function (seed, len) { var t = new Buffer(''); var i = 0, c; while (t.length < len) { c = i2ops(i++); t = Buffer.concat([t, createHash('sha1').update(seed).update(c).digest()]); } return t.slice(0, len); }; function i2ops(c) { var out = new Buffer(4); out.writeUInt32BE(c,0); return out; } }).call(this,require("buffer").Buffer) },{"buffer":47,"create-hash":52}],111:[function(require,module,exports){ (function (Buffer){ var parseKeys = require('parse-asn1'); var mgf = require('./mgf'); var xor = require('./xor'); var bn = require('bn.js'); var crt = require('browserify-rsa'); var createHash = require('create-hash'); var withPublic = require('./withPublic'); module.exports = function privateDecrypt(private_key, enc, reverse) { var padding; if (private_key.padding) { padding = private_key.padding; } else if (reverse) { padding = 1; } else { padding = 4; } var key = parseKeys(private_key); var k = key.modulus.byteLength(); if (enc.length > k || new bn(enc).cmp(key.modulus) >= 0) { throw new Error('decryption error'); } var msg; if (reverse) { msg = withPublic(new bn(enc), key); } else { msg = crt(enc, key); } var zBuffer = new Buffer(k - msg.length); zBuffer.fill(0); msg = Buffer.concat([zBuffer, msg], k); if (padding === 4) { return oaep(key, msg); } else if (padding === 1) { return pkcs1(key, msg, reverse); } else if (padding === 3) { return msg; } else { throw new Error('unknown padding'); } }; function oaep(key, msg){ var n = key.modulus; var k = key.modulus.byteLength(); var mLen = msg.length; var iHash = createHash('sha1').update(new Buffer('')).digest(); var hLen = iHash.length; var hLen2 = 2 * hLen; if (msg[0] !== 0) { throw new Error('decryption error'); } var maskedSeed = msg.slice(1, hLen + 1); var maskedDb = msg.slice(hLen + 1); var seed = xor(maskedSeed, mgf(maskedDb, hLen)); var db = xor(maskedDb, mgf(seed, k - hLen - 1)); if (compare(iHash, db.slice(0, hLen))) { throw new Error('decryption error'); } var i = hLen; while (db[i] === 0) { i++; } if (db[i++] !== 1) { throw new Error('decryption error'); } return db.slice(i); } function pkcs1(key, msg, reverse){ var p1 = msg.slice(0, 2); var i = 2; var status = 0; while (msg[i++] !== 0) { if (i >= msg.length) { status++; break; } } var ps = msg.slice(2, i - 1); var p2 = msg.slice(i - 1, i); if ((p1.toString('hex') !== '0002' && !reverse) || (p1.toString('hex') !== '0001' && reverse)){ status++; } if (ps.length < 8) { status++; } if (status) { throw new Error('decryption error'); } return msg.slice(i); } function compare(a, b){ a = new Buffer(a); b = new Buffer(b); var dif = 0; var len = a.length; if (a.length !== b.length) { dif++; len = Math.min(a.length, b.length); } var i = -1; while (++i < len) { dif += (a[i] ^ b[i]); } return dif; } }).call(this,require("buffer").Buffer) },{"./mgf":110,"./withPublic":113,"./xor":114,"bn.js":18,"browserify-rsa":39,"buffer":47,"create-hash":52,"parse-asn1":104}],112:[function(require,module,exports){ (function (Buffer){ var parseKeys = require('parse-asn1'); var randomBytes = require('randombytes'); var createHash = require('create-hash'); var mgf = require('./mgf'); var xor = require('./xor'); var bn = require('bn.js'); var withPublic = require('./withPublic'); var crt = require('browserify-rsa'); var constants = { RSA_PKCS1_OAEP_PADDING: 4, RSA_PKCS1_PADDIN: 1, RSA_NO_PADDING: 3 }; module.exports = function publicEncrypt(public_key, msg, reverse) { var padding; if (public_key.padding) { padding = public_key.padding; } else if (reverse) { padding = 1; } else { padding = 4; } var key = parseKeys(public_key); var paddedMsg; if (padding === 4) { paddedMsg = oaep(key, msg); } else if (padding === 1) { paddedMsg = pkcs1(key, msg, reverse); } else if (padding === 3) { paddedMsg = new bn(msg); if (paddedMsg.cmp(key.modulus) >= 0) { throw new Error('data too long for modulus'); } } else { throw new Error('unknown padding'); } if (reverse) { return crt(paddedMsg, key); } else { return withPublic(paddedMsg, key); } }; function oaep(key, msg){ var k = key.modulus.byteLength(); var mLen = msg.length; var iHash = createHash('sha1').update(new Buffer('')).digest(); var hLen = iHash.length; var hLen2 = 2 * hLen; if (mLen > k - hLen2 - 2) { throw new Error('message too long'); } var ps = new Buffer(k - mLen - hLen2 - 2); ps.fill(0); var dblen = k - hLen - 1; var seed = randomBytes(hLen); var maskedDb = xor(Buffer.concat([iHash, ps, new Buffer([1]), msg], dblen), mgf(seed, dblen)); var maskedSeed = xor(seed, mgf(maskedDb, hLen)); return new bn(Buffer.concat([new Buffer([0]), maskedSeed, maskedDb], k)); } function pkcs1(key, msg, reverse){ var mLen = msg.length; var k = key.modulus.byteLength(); if (mLen > k - 11) { throw new Error('message too long'); } var ps; if (reverse) { ps = new Buffer(k - mLen - 3); ps.fill(0xff); } else { ps = nonZero(k - mLen - 3); } return new bn(Buffer.concat([new Buffer([0, reverse?1:2]), ps, new Buffer([0]), msg], k)); } function nonZero(len, crypto) { var out = new Buffer(len); var i = 0; var cache = randomBytes(len*2); var cur = 0; var num; while (i < len) { if (cur === cache.length) { cache = randomBytes(len*2); cur = 0; } num = cache[cur++]; if (num) { out[i++] = num; } } return out; } }).call(this,require("buffer").Buffer) },{"./mgf":110,"./withPublic":113,"./xor":114,"bn.js":18,"browserify-rsa":39,"buffer":47,"create-hash":52,"parse-asn1":104,"randombytes":119}],113:[function(require,module,exports){ (function (Buffer){ var bn = require('bn.js'); function withPublic(paddedMsg, key) { return new Buffer(paddedMsg .toRed(bn.mont(key.modulus)) .redPow(new bn(key.publicExponent)) .fromRed() .toArray()); } module.exports = withPublic; }).call(this,require("buffer").Buffer) },{"bn.js":18,"buffer":47}],114:[function(require,module,exports){ module.exports = function xor(a, b) { var len = a.length; var i = -1; while (++i < len) { a[i] ^= b[i]; } return a }; },{}],115:[function(require,module,exports){ (function (global){ /*! https://mths.be/punycode v1.4.1 by @mathias */ ;(function(root) { /** Detect free variables */ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; var freeModule = typeof module == 'object' && module && !module.nodeType && module; var freeGlobal = typeof global == 'object' && global; if ( freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal ) { root = freeGlobal; } /** * The `punycode` object. * @name punycode * @type Object */ var punycode, /** Highest positive signed 32-bit float value */ maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 /** Bootstring parameters */ base = 36, tMin = 1, tMax = 26, skew = 38, damp = 700, initialBias = 72, initialN = 128, // 0x80 delimiter = '-', // '\x2D' /** Regular expressions */ regexPunycode = /^xn--/, regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators /** Error messages */ errors = { 'overflow': 'Overflow: input needs wider integers to process', 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', 'invalid-input': 'Invalid input' }, /** Convenience shortcuts */ baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = String.fromCharCode, /** Temporary variable */ key; /*--------------------------------------------------------------------------*/ /** * A generic error utility function. * @private * @param {String} type The error type. * @returns {Error} Throws a `RangeError` with the applicable error message. */ function error(type) { throw new RangeError(errors[type]); } /** * A generic `Array#map` utility function. * @private * @param {Array} array The array to iterate over. * @param {Function} callback The function that gets called for every array * item. * @returns {Array} A new array of values returned by the callback function. */ function map(array, fn) { var length = array.length; var result = []; while (length--) { result[length] = fn(array[length]); } return result; } /** * A simple `Array#map`-like wrapper to work with domain name strings or email * addresses. * @private * @param {String} domain The domain name or email address. * @param {Function} callback The function that gets called for every * character. * @returns {Array} A new string of characters returned by the callback * function. */ function mapDomain(string, fn) { var parts = string.split('@'); var result = ''; if (parts.length > 1) { // In email addresses, only the domain name should be punycoded. Leave // the local part (i.e. everything up to `@`) intact. result = parts[0] + '@'; string = parts[1]; } // Avoid `split(regex)` for IE8 compatibility. See #17. string = string.replace(regexSeparators, '\x2E'); var labels = string.split('.'); var encoded = map(labels, fn).join('.'); return result + encoded; } /** * Creates an array containing the numeric code points of each Unicode * character in the string. While JavaScript uses UCS-2 internally, * this function will convert a pair of surrogate halves (each of which * UCS-2 exposes as separate characters) into a single code point, * matching UTF-16. * @see `punycode.ucs2.encode` * @see * @memberOf punycode.ucs2 * @name decode * @param {String} string The Unicode input string (UCS-2). * @returns {Array} The new array of code points. */ function ucs2decode(string) { var output = [], counter = 0, length = string.length, value, extra; while (counter < length) { value = string.charCodeAt(counter++); if (value >= 0xD800 && value <= 0xDBFF && counter < length) { // high surrogate, and there is a next character extra = string.charCodeAt(counter++); if ((extra & 0xFC00) == 0xDC00) { // low surrogate output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); } else { // unmatched surrogate; only append this code unit, in case the next // code unit is the high surrogate of a surrogate pair output.push(value); counter--; } } else { output.push(value); } } return output; } /** * Creates a string based on an array of numeric code points. * @see `punycode.ucs2.decode` * @memberOf punycode.ucs2 * @name encode * @param {Array} codePoints The array of numeric code points. * @returns {String} The new Unicode string (UCS-2). */ function ucs2encode(array) { return map(array, function(value) { var output = ''; if (value > 0xFFFF) { value -= 0x10000; output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); value = 0xDC00 | value & 0x3FF; } output += stringFromCharCode(value); return output; }).join(''); } /** * Converts a basic code point into a digit/integer. * @see `digitToBasic()` * @private * @param {Number} codePoint The basic numeric code point value. * @returns {Number} The numeric value of a basic code point (for use in * representing integers) in the range `0` to `base - 1`, or `base` if * the code point does not represent a value. */ function basicToDigit(codePoint) { if (codePoint - 48 < 10) { return codePoint - 22; } if (codePoint - 65 < 26) { return codePoint - 65; } if (codePoint - 97 < 26) { return codePoint - 97; } return base; } /** * Converts a digit/integer into a basic code point. * @see `basicToDigit()` * @private * @param {Number} digit The numeric value of a basic code point. * @returns {Number} The basic code point whose value (when used for * representing integers) is `digit`, which needs to be in the range * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is * used; else, the lowercase form is used. The behavior is undefined * if `flag` is non-zero and `digit` has no uppercase form. */ function digitToBasic(digit, flag) { // 0..25 map to ASCII a..z or A..Z // 26..35 map to ASCII 0..9 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); } /** * Bias adaptation function as per section 3.4 of RFC 3492. * https://tools.ietf.org/html/rfc3492#section-3.4 * @private */ function adapt(delta, numPoints, firstTime) { var k = 0; delta = firstTime ? floor(delta / damp) : delta >> 1; delta += floor(delta / numPoints); for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { delta = floor(delta / baseMinusTMin); } return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); } /** * Converts a Punycode string of ASCII-only symbols to a string of Unicode * symbols. * @memberOf punycode * @param {String} input The Punycode string of ASCII-only symbols. * @returns {String} The resulting string of Unicode symbols. */ function decode(input) { // Don't use UCS-2 var output = [], inputLength = input.length, out, i = 0, n = initialN, bias = initialBias, basic, j, index, oldi, w, k, digit, t, /** Cached calculation results */ baseMinusT; // Handle the basic code points: let `basic` be the number of input code // points before the last delimiter, or `0` if there is none, then copy // the first basic code points to the output. basic = input.lastIndexOf(delimiter); if (basic < 0) { basic = 0; } for (j = 0; j < basic; ++j) { // if it's not a basic code point if (input.charCodeAt(j) >= 0x80) { error('not-basic'); } output.push(input.charCodeAt(j)); } // Main decoding loop: start just after the last delimiter if any basic code // points were copied; start at the beginning otherwise. for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { // `index` is the index of the next character to be consumed. // Decode a generalized variable-length integer into `delta`, // which gets added to `i`. The overflow checking is easier // if we increase `i` as we go, then subtract off its starting // value at the end to obtain `delta`. for (oldi = i, w = 1, k = base; /* no condition */; k += base) { if (index >= inputLength) { error('invalid-input'); } digit = basicToDigit(input.charCodeAt(index++)); if (digit >= base || digit > floor((maxInt - i) / w)) { error('overflow'); } i += digit * w; t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); if (digit < t) { break; } baseMinusT = base - t; if (w > floor(maxInt / baseMinusT)) { error('overflow'); } w *= baseMinusT; } out = output.length + 1; bias = adapt(i - oldi, out, oldi == 0); // `i` was supposed to wrap around from `out` to `0`, // incrementing `n` each time, so we'll fix that now: if (floor(i / out) > maxInt - n) { error('overflow'); } n += floor(i / out); i %= out; // Insert `n` at position `i` of the output output.splice(i++, 0, n); } return ucs2encode(output); } /** * Converts a string of Unicode symbols (e.g. a domain name label) to a * Punycode string of ASCII-only symbols. * @memberOf punycode * @param {String} input The string of Unicode symbols. * @returns {String} The resulting Punycode string of ASCII-only symbols. */ function encode(input) { var n, delta, handledCPCount, basicLength, bias, j, m, q, k, t, currentValue, output = [], /** `inputLength` will hold the number of code points in `input`. */ inputLength, /** Cached calculation results */ handledCPCountPlusOne, baseMinusT, qMinusT; // Convert the input in UCS-2 to Unicode input = ucs2decode(input); // Cache the length inputLength = input.length; // Initialize the state n = initialN; delta = 0; bias = initialBias; // Handle the basic code points for (j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue < 0x80) { output.push(stringFromCharCode(currentValue)); } } handledCPCount = basicLength = output.length; // `handledCPCount` is the number of code points that have been handled; // `basicLength` is the number of basic code points. // Finish the basic string - if it is not empty - with a delimiter if (basicLength) { output.push(delimiter); } // Main encoding loop: while (handledCPCount < inputLength) { // All non-basic code points < n have been handled already. Find the next // larger one: for (m = maxInt, j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue >= n && currentValue < m) { m = currentValue; } } // Increase `delta` enough to advance the decoder's state to , // but guard against overflow handledCPCountPlusOne = handledCPCount + 1; if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { error('overflow'); } delta += (m - n) * handledCPCountPlusOne; n = m; for (j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue < n && ++delta > maxInt) { error('overflow'); } if (currentValue == n) { // Represent delta as a generalized variable-length integer for (q = delta, k = base; /* no condition */; k += base) { t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); if (q < t) { break; } qMinusT = q - t; baseMinusT = base - t; output.push( stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) ); q = floor(qMinusT / baseMinusT); } output.push(stringFromCharCode(digitToBasic(q, 0))); bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); delta = 0; ++handledCPCount; } } ++delta; ++n; } return output.join(''); } /** * Converts a Punycode string representing a domain name or an email address * to Unicode. Only the Punycoded parts of the input will be converted, i.e. * it doesn't matter if you call it on a string that has already been * converted to Unicode. * @memberOf punycode * @param {String} input The Punycoded domain name or email address to * convert to Unicode. * @returns {String} The Unicode representation of the given Punycode * string. */ function toUnicode(input) { return mapDomain(input, function(string) { return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; }); } /** * Converts a Unicode string representing a domain name or an email address to * Punycode. Only the non-ASCII parts of the domain name will be converted, * i.e. it doesn't matter if you call it with a domain that's already in * ASCII. * @memberOf punycode * @param {String} input The domain name or email address to convert, as a * Unicode string. * @returns {String} The Punycode representation of the given domain name or * email address. */ function toASCII(input) { return mapDomain(input, function(string) { return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; }); } /*--------------------------------------------------------------------------*/ /** Define the public API */ punycode = { /** * A string representing the current Punycode.js version number. * @memberOf punycode * @type String */ 'version': '1.4.1', /** * An object of methods to convert from JavaScript's internal character * representation (UCS-2) to Unicode code points, and back. * @see * @memberOf punycode * @type Object */ 'ucs2': { 'decode': ucs2decode, 'encode': ucs2encode }, 'decode': decode, 'encode': encode, 'toASCII': toASCII, 'toUnicode': toUnicode }; /** Expose `punycode` */ // Some AMD build optimizers, like r.js, check for specific condition patterns // like the following: if ( typeof define == 'function' && typeof define.amd == 'object' && define.amd ) { define('punycode', function() { return punycode; }); } else if (freeExports && freeModule) { if (module.exports == freeExports) { // in Node.js, io.js, or RingoJS v0.8.0+ freeModule.exports = punycode; } else { // in Narwhal or RingoJS v0.7.0- for (key in punycode) { punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); } } } else { // in Rhino or a web browser root.punycode = punycode; } }(this)); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],116:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; // If obj.hasOwnProperty has been overridden, then calling // obj.hasOwnProperty(prop) will break. // See: https://github.com/joyent/node/issues/1707 function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } module.exports = function(qs, sep, eq, options) { sep = sep || '&'; eq = eq || '='; var obj = {}; if (typeof qs !== 'string' || qs.length === 0) { return obj; } var regexp = /\+/g; qs = qs.split(sep); var maxKeys = 1000; if (options && typeof options.maxKeys === 'number') { maxKeys = options.maxKeys; } var len = qs.length; // maxKeys <= 0 means that we should not limit keys count if (maxKeys > 0 && len > maxKeys) { len = maxKeys; } for (var i = 0; i < len; ++i) { var x = qs[i].replace(regexp, '%20'), idx = x.indexOf(eq), kstr, vstr, k, v; if (idx >= 0) { kstr = x.substr(0, idx); vstr = x.substr(idx + 1); } else { kstr = x; vstr = ''; } k = decodeURIComponent(kstr); v = decodeURIComponent(vstr); if (!hasOwnProperty(obj, k)) { obj[k] = v; } else if (isArray(obj[k])) { obj[k].push(v); } else { obj[k] = [obj[k], v]; } } return obj; }; var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; },{}],117:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; var stringifyPrimitive = function(v) { switch (typeof v) { case 'string': return v; case 'boolean': return v ? 'true' : 'false'; case 'number': return isFinite(v) ? v : ''; default: return ''; } }; module.exports = function(obj, sep, eq, name) { sep = sep || '&'; eq = eq || '='; if (obj === null) { obj = undefined; } if (typeof obj === 'object') { return map(objectKeys(obj), function(k) { var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; if (isArray(obj[k])) { return map(obj[k], function(v) { return ks + encodeURIComponent(stringifyPrimitive(v)); }).join(sep); } else { return ks + encodeURIComponent(stringifyPrimitive(obj[k])); } }).join(sep); } if (!name) return ''; return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj)); }; var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; function map (xs, f) { if (xs.map) return xs.map(f); var res = []; for (var i = 0; i < xs.length; i++) { res.push(f(xs[i], i)); } return res; } var objectKeys = Object.keys || function (obj) { var res = []; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); } return res; }; },{}],118:[function(require,module,exports){ 'use strict'; exports.decode = exports.parse = require('./decode'); exports.encode = exports.stringify = require('./encode'); },{"./decode":116,"./encode":117}],119:[function(require,module,exports){ (function (process,global,Buffer){ 'use strict' function oldBrowser () { throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11') } var crypto = global.crypto || global.msCrypto if (crypto && crypto.getRandomValues) { module.exports = randomBytes } else { module.exports = oldBrowser } function randomBytes (size, cb) { // phantomjs needs to throw if (size > 65536) throw new Error('requested too many random bytes') // in case browserify isn't using the Uint8Array version var rawBytes = new global.Uint8Array(size) // This will not work in older browsers. // See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues if (size > 0) { // getRandomValues fails on IE if size == 0 crypto.getRandomValues(rawBytes) } // phantomjs doesn't like a buffer being passed here var bytes = new Buffer(rawBytes.buffer) if (typeof cb === 'function') { return process.nextTick(function () { cb(null, bytes) }) } return bytes } }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) },{"_process":108,"buffer":47}],120:[function(require,module,exports){ module.exports = require("./lib/_stream_duplex.js") },{"./lib/_stream_duplex.js":121}],121:[function(require,module,exports){ // a duplex stream is just a stream that is both readable and writable. // Since JS doesn't have multiple prototypal inheritance, this class // prototypally inherits from Readable, and then parasitically from // Writable. 'use strict'; /**/ var objectKeys = Object.keys || function (obj) { var keys = []; for (var key in obj) { keys.push(key); }return keys; }; /**/ module.exports = Duplex; /**/ var processNextTick = require('process-nextick-args'); /**/ /**/ var util = require('core-util-is'); util.inherits = require('inherits'); /**/ var Readable = require('./_stream_readable'); var Writable = require('./_stream_writable'); util.inherits(Duplex, Readable); var keys = objectKeys(Writable.prototype); for (var v = 0; v < keys.length; v++) { var method = keys[v]; if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; } function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); Readable.call(this, options); Writable.call(this, options); if (options && options.readable === false) this.readable = false; if (options && options.writable === false) this.writable = false; this.allowHalfOpen = true; if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; this.once('end', onend); } // the no-half-open enforcer function onend() { // if we allow half-open state, or if the writable side ended, // then we're ok. if (this.allowHalfOpen || this._writableState.ended) return; // no more data can be written. // But allow more writes to happen in this tick. processNextTick(onEndNT, this); } function onEndNT(self) { self.end(); } function forEach(xs, f) { for (var i = 0, l = xs.length; i < l; i++) { f(xs[i], i); } } },{"./_stream_readable":123,"./_stream_writable":125,"core-util-is":50,"inherits":95,"process-nextick-args":107}],122:[function(require,module,exports){ // a passthrough stream. // basically just the most minimal sort of Transform stream. // Every written chunk gets output as-is. 'use strict'; module.exports = PassThrough; var Transform = require('./_stream_transform'); /**/ var util = require('core-util-is'); util.inherits = require('inherits'); /**/ util.inherits(PassThrough, Transform); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); }; },{"./_stream_transform":124,"core-util-is":50,"inherits":95}],123:[function(require,module,exports){ (function (process){ 'use strict'; module.exports = Readable; /**/ var processNextTick = require('process-nextick-args'); /**/ /**/ var isArray = require('isarray'); /**/ Readable.ReadableState = ReadableState; /**/ var EE = require('events').EventEmitter; var EElistenerCount = function (emitter, type) { return emitter.listeners(type).length; }; /**/ /**/ var Stream; (function () { try { Stream = require('st' + 'ream'); } catch (_) {} finally { if (!Stream) Stream = require('events').EventEmitter; } })(); /**/ var Buffer = require('buffer').Buffer; /**/ var bufferShim = require('buffer-shims'); /**/ /**/ var util = require('core-util-is'); util.inherits = require('inherits'); /**/ /**/ var debugUtil = require('util'); var debug = void 0; if (debugUtil && debugUtil.debuglog) { debug = debugUtil.debuglog('stream'); } else { debug = function () {}; } /**/ var StringDecoder; util.inherits(Readable, Stream); var hasPrependListener = typeof EE.prototype.prependListener === 'function'; function prependListener(emitter, event, fn) { if (hasPrependListener) return emitter.prependListener(event, fn); // This is a brutally ugly hack to make sure that our error handler // is attached before any userland ones. NEVER DO THIS. This is here // only because this code needs to continue to work with older versions // of Node.js that do not include the prependListener() method. The goal // is to eventually remove this hack. if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; } var Duplex; function ReadableState(options, stream) { Duplex = Duplex || require('./_stream_duplex'); options = options || {}; // object stream flag. Used to make read(n) ignore n and to // make all the buffer merging and length checks go away this.objectMode = !!options.objectMode; if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer // Note: 0 is a valid value, means "don't call _read preemptively ever" var hwm = options.highWaterMark; var defaultHwm = this.objectMode ? 16 : 16 * 1024; this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; // cast to ints. this.highWaterMark = ~ ~this.highWaterMark; this.buffer = []; this.length = 0; this.pipes = null; this.pipesCount = 0; this.flowing = null; this.ended = false; this.endEmitted = false; this.reading = false; // a flag to be able to tell if the onwrite cb is called immediately, // or on a later tick. We set this to true at first, because any // actions that shouldn't happen until "later" should generally also // not happen before the first write call. this.sync = true; // whenever we return null, then we set a flag to say // that we're awaiting a 'readable' event emission. this.needReadable = false; this.emittedReadable = false; this.readableListening = false; this.resumeScheduled = false; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // when piping, we only care about 'readable' events that happen // after read()ing all the bytes and not getting any pushback. this.ranOut = false; // the number of writers that are awaiting a drain event in .pipe()s this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled this.readingMore = false; this.decoder = null; this.encoding = null; if (options.encoding) { if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } } var Duplex; function Readable(options) { Duplex = Duplex || require('./_stream_duplex'); if (!(this instanceof Readable)) return new Readable(options); this._readableState = new ReadableState(options, this); // legacy this.readable = true; if (options && typeof options.read === 'function') this._read = options.read; Stream.call(this); } // Manually shove something into the read() buffer. // This returns true if the highWaterMark has not been hit yet, // similar to how Writable.write() returns true if you should // write() some more. Readable.prototype.push = function (chunk, encoding) { var state = this._readableState; if (!state.objectMode && typeof chunk === 'string') { encoding = encoding || state.defaultEncoding; if (encoding !== state.encoding) { chunk = bufferShim.from(chunk, encoding); encoding = ''; } } return readableAddChunk(this, state, chunk, encoding, false); }; // Unshift should *always* be something directly out of read() Readable.prototype.unshift = function (chunk) { var state = this._readableState; return readableAddChunk(this, state, chunk, '', true); }; Readable.prototype.isPaused = function () { return this._readableState.flowing === false; }; function readableAddChunk(stream, state, chunk, encoding, addToFront) { var er = chunkInvalid(state, chunk); if (er) { stream.emit('error', er); } else if (chunk === null) { state.reading = false; onEofChunk(stream, state); } else if (state.objectMode || chunk && chunk.length > 0) { if (state.ended && !addToFront) { var e = new Error('stream.push() after EOF'); stream.emit('error', e); } else if (state.endEmitted && addToFront) { var _e = new Error('stream.unshift() after end event'); stream.emit('error', _e); } else { var skipAdd; if (state.decoder && !addToFront && !encoding) { chunk = state.decoder.write(chunk); skipAdd = !state.objectMode && chunk.length === 0; } if (!addToFront) state.reading = false; // Don't add to the buffer if we've decoded to an empty string chunk and // we're not in object mode if (!skipAdd) { // if we want the data now, just emit it. if (state.flowing && state.length === 0 && !state.sync) { stream.emit('data', chunk); stream.read(0); } else { // update the buffer info. state.length += state.objectMode ? 1 : chunk.length; if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); if (state.needReadable) emitReadable(stream); } } maybeReadMore(stream, state); } } else if (!addToFront) { state.reading = false; } return needMoreData(state); } // if it's past the high water mark, we can push in some more. // Also, if we have no data yet, we can stand some // more bytes. This is to work around cases where hwm=0, // such as the repl. Also, if the push() triggered a // readable event, and the user called read(largeNumber) such that // needReadable was set, then we ought to push more, so that another // 'readable' event will be triggered. function needMoreData(state) { return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); } // backwards compatibility. Readable.prototype.setEncoding = function (enc) { if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; this._readableState.decoder = new StringDecoder(enc); this._readableState.encoding = enc; return this; }; // Don't raise the hwm > 8MB var MAX_HWM = 0x800000; function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { n = MAX_HWM; } else { // Get the next highest power of 2 n--; n |= n >>> 1; n |= n >>> 2; n |= n >>> 4; n |= n >>> 8; n |= n >>> 16; n++; } return n; } function howMuchToRead(n, state) { if (state.length === 0 && state.ended) return 0; if (state.objectMode) return n === 0 ? 0 : 1; if (n === null || isNaN(n)) { // only flow one buffer at a time if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; } if (n <= 0) return 0; // If we're asking for more than the target buffer level, // then raise the water mark. Bump up to the next highest // power of 2, to prevent increasing it excessively in tiny // amounts. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); // don't have that much. return null, unless we've ended. if (n > state.length) { if (!state.ended) { state.needReadable = true; return 0; } else { return state.length; } } return n; } // you can override either this method, or the async _read(n) below. Readable.prototype.read = function (n) { debug('read', n); var state = this._readableState; var nOrig = n; if (typeof n !== 'number' || 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.length >= state.highWaterMark || state.ended)) { debug('read: emitReadable', state.length, state.ended); if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); return null; } 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); } 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 (doRead && !state.reading) n = howMuchToRead(nOrig, state); var ret; if (n > 0) ret = fromList(n, state);else ret = null; if (ret === null) { state.needReadable = true; n = 0; } state.length -= n; // If we have nothing in the buffer, then we want to know // as soon as we *do* get something into the buffer. if (state.length === 0 && !state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. if (nOrig !== n && state.ended && state.length === 0) endReadable(this); if (ret !== null) this.emit('data', ret); return ret; }; function chunkInvalid(state, chunk) { var er = null; if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { er = new TypeError('Invalid non-string/buffer chunk'); } return er; } function onEofChunk(stream, state) { if (state.ended) return; if (state.decoder) { var chunk = state.decoder.end(); if (chunk && chunk.length) { state.buffer.push(chunk); state.length += state.objectMode ? 1 : chunk.length; } } state.ended = true; // emit 'readable' now to make sure it gets picked up. 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; state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); } } function emitReadable_(stream) { debug('emit readable'); stream.emit('readable'); 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; processNextTick(maybeReadMore_, stream, state); } } function maybeReadMore_(stream, state) { var len = state.length; while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { debug('maybeReadMore read 0'); stream.read(0); if (len === state.length) // didn't get any data, stop spinning. break;else len = state.length; } state.readingMore = false; } // abstract method. to be overridden in specific implementation classes. // call cb(er, data) where data is <= n in length. // for virtual (non-string, non-buffer) streams, "length" is somewhat // arbitrary, and perhaps not very meaningful. Readable.prototype._read = function (n) { this.emit('error', new Error('not implemented')); }; Readable.prototype.pipe = function (dest, pipeOpts) { var src = this; var state = this._readableState; 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 : cleanup; if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); dest.on('unpipe', onunpipe); function onunpipe(readable) { debug('onunpipe'); if (readable === src) { 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', cleanup); 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); if (false === ret) { // If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. // => Check whether `dest` is still a piping destination. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { debug('false write response, pause', src._readableState.awaitDrain); src._readableState.awaitDrain++; } src.pause(); } } // if the dest has an error, then stop piping into it. // however, don't suppress the throwing behavior for this. function onerror(er) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); } // 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 () { 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.prototype.unpipe = function (dest) { var state = this._readableState; // if we're not piping anywhere, then do nothing. if (state.pipesCount === 0) return this; // just one destination. most common case. if (state.pipesCount === 1) { // passed in one, but it's not the right one. if (dest && dest !== state.pipes) return this; if (!dest) dest = state.pipes; // got a match. state.pipes = null; state.pipesCount = 0; state.flowing = false; if (dest) dest.emit('unpipe', this); return this; } // 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); }return this; } // try to find the right one. var i = indexOf(state.pipes, dest); if (i === -1) return this; state.pipes.splice(i, 1); state.pipesCount -= 1; if (state.pipesCount === 1) state.pipes = state.pipes[0]; dest.emit('unpipe', this); return this; }; // set up data events if they are asked for // Ensure readable listeners eventually get something Readable.prototype.on = function (ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); // If listening to data, and it has not explicitly been paused, // then call resume to start the flow of data on the next tick. if (ev === 'data' && false !== this._readableState.flowing) { this.resume(); } if (ev === 'readable' && !this._readableState.endEmitted) { var state = this._readableState; if (!state.readableListening) { state.readableListening = true; state.emittedReadable = false; state.needReadable = true; if (!state.reading) { processNextTick(nReadingNextTick, this); } else if (state.length) { emitReadable(this, state); } } } return res; }; Readable.prototype.addListener = Readable.prototype.on; function nReadingNextTick(self) { debug('readable nexttick read 0'); self.read(0); } // pause() and resume() are remnants of the legacy readable stream API // If the user uses them, then switch into old mode. Readable.prototype.resume = function () { var state = this._readableState; if (!state.flowing) { debug('resume'); state.flowing = true; resume(this, state); } return this; }; function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; processNextTick(resume_, stream, state); } } function resume_(stream, state) { if (!state.reading) { debug('resume read 0'); stream.read(0); } state.resumeScheduled = false; stream.emit('resume'); flow(stream); if (state.flowing && !state.reading) stream.read(0); } Readable.prototype.pause = function () { debug('call pause flowing=%j', this._readableState.flowing); if (false !== this._readableState.flowing) { debug('pause'); this._readableState.flowing = false; this.emit('pause'); } return this; }; function flow(stream) { var state = stream._readableState; debug('flow', state.flowing); if (state.flowing) { do { var chunk = stream.read(); } while (null !== chunk && state.flowing); } } // wrap an old-style stream as the async data source. // This is *not* part of the readable stream interface. // It is an ugly unfortunate mess of history. Readable.prototype.wrap = function (stream) { var state = this._readableState; var paused = false; var self = this; stream.on('end', function () { debug('wrapped end'); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) self.push(chunk); } self.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 = self.push(chunk); if (!ret) { paused = true; stream.pause(); } }); // proxy all the other methods. // important when wrapping filters and duplexes. for (var i in stream) { if (this[i] === undefined && typeof stream[i] === 'function') { this[i] = function (method) { return function () { return stream[method].apply(stream, arguments); }; }(i); } } // proxy certain important events. var events = ['error', 'close', 'destroy', 'pause', 'resume']; forEach(events, function (ev) { stream.on(ev, self.emit.bind(self, ev)); }); // when we try to consume some more bytes, simply unpause the // underlying stream. self._read = function (n) { debug('wrapped _read', n); if (paused) { paused = false; stream.resume(); } }; return self; }; // exposed for testing purposes only. Readable._fromList = fromList; // Pluck off n bytes from an array of buffers. // Length is the combined lengths of all the buffers in the list. function fromList(n, state) { var list = state.buffer; var length = state.length; var stringMode = !!state.decoder; var objectMode = !!state.objectMode; var ret; // nothing in the list, definitely empty. if (list.length === 0) return null; if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { // read it all, truncate the array. if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); list.length = 0; } else { // read just some of it. if (n < list[0].length) { // just take a part of the first list item. // slice is the same for buffers and strings. var buf = list[0]; ret = buf.slice(0, n); list[0] = buf.slice(n); } else if (n === list[0].length) { // first list is a perfect match ret = list.shift(); } else { // complex case. // we have enough to cover it, but it spans past the first buffer. if (stringMode) ret = '';else ret = bufferShim.allocUnsafe(n); var c = 0; for (var i = 0, l = list.length; i < l && c < n; i++) { var _buf = list[0]; var cpy = Math.min(n - c, _buf.length); if (stringMode) ret += _buf.slice(0, cpy);else _buf.copy(ret, c, 0, cpy); if (cpy < _buf.length) list[0] = _buf.slice(cpy);else list.shift(); c += cpy; } } } return ret; } function endReadable(stream) { var state = stream._readableState; // If we get here before consuming all the bytes, then that is a // bug in node. Should never happen. if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); if (!state.endEmitted) { state.ended = true; processNextTick(endReadableNT, state, stream); } } function endReadableNT(state, stream) { // Check that we didn't get one last unshift. if (!state.endEmitted && state.length === 0) { state.endEmitted = true; stream.readable = false; stream.emit('end'); } } function forEach(xs, f) { for (var i = 0, l = xs.length; i < l; i++) { f(xs[i], i); } } function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) return i; } return -1; } }).call(this,require('_process')) },{"./_stream_duplex":121,"_process":108,"buffer":47,"buffer-shims":45,"core-util-is":50,"events":84,"inherits":95,"isarray":97,"process-nextick-args":107,"string_decoder/":144,"util":20}],124:[function(require,module,exports){ // a transform stream is a readable/writable stream where you do // something with the data. Sometimes it's called a "filter", // but that's not a great name for it, since that implies a thing where // some bits pass through, and others are simply ignored. (That would // be a valid example of a transform, of course.) // // While the output is causally related to the input, it's not a // necessarily symmetric or synchronous transformation. For example, // a zlib stream might take multiple plain-text writes(), and then // emit a single compressed chunk some time in the future. // // Here's how this works: // // The Transform stream has all the aspects of the readable and writable // stream classes. When you write(chunk), that calls _write(chunk,cb) // internally, and returns false if there's a lot of pending writes // buffered up. When you call read(), that calls _read(n) until // there's enough pending readable data buffered up. // // In a transform stream, the written data is placed in a buffer. When // _read(n) is called, it transforms the queued up data, calling the // buffered _write cb's as it consumes chunks. If consuming a single // written chunk would result in multiple output chunks, then the first // outputted bit calls the readcb, and subsequent chunks just go into // the read buffer, and will cause it to emit 'readable' if necessary. // // This way, back-pressure is actually determined by the reading side, // since _read has to be called to start processing a new chunk. However, // a pathological inflate type of transform can cause excessive buffering // here. For example, imagine a stream where every byte of input is // interpreted as an integer from 0-255, and then results in that many // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in // 1kb of data being output. In this case, you could write a very small // amount of input, and end up with a very large amount of output. In // such a pathological inflating mechanism, there'd be no way to tell // the system to stop doing the transform. A single 4MB write could // cause the system to run out of memory. // // However, even in such a pathological case, only a single written chunk // would be consumed, and then the rest would wait (un-transformed) until // the results of the previous transformed chunk were consumed. 'use strict'; module.exports = Transform; var Duplex = require('./_stream_duplex'); /**/ var util = require('core-util-is'); util.inherits = require('inherits'); /**/ util.inherits(Transform, Duplex); function TransformState(stream) { this.afterTransform = function (er, data) { return afterTransform(stream, er, data); }; this.needTransform = false; this.transforming = false; this.writecb = null; this.writechunk = null; this.writeencoding = null; } function afterTransform(stream, er, data) { var ts = stream._transformState; ts.transforming = false; var cb = ts.writecb; if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); ts.writechunk = null; ts.writecb = null; if (data !== null && data !== undefined) stream.push(data); cb(er); var rs = stream._readableState; rs.reading = false; if (rs.needReadable || rs.length < rs.highWaterMark) { stream._read(rs.highWaterMark); } } function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options); this._transformState = new TransformState(this); // when the writable side finishes, then flush out anything remaining. var stream = this; // 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; } this.once('prefinish', function () { if (typeof this._flush === 'function') this._flush(function (er) { done(stream, er); });else done(stream); }); } Transform.prototype.push = function (chunk, encoding) { this._transformState.needTransform = false; return Duplex.prototype.push.call(this, chunk, encoding); }; // This is the part where you do stuff! // override this function in implementation classes. // 'chunk' is an input chunk. // // Call `push(newChunk)` to pass along transformed output // to the readable side. You may call 'push' zero or more times. // // Call `cb(err)` when you are done with this chunk. If you pass // an error, then that'll put the hurt on the whole operation. If you // never call cb(), then you'll never get another chunk. Transform.prototype._transform = function (chunk, encoding, cb) { throw new Error('Not implemented'); }; Transform.prototype._write = function (chunk, encoding, cb) { var ts = this._transformState; ts.writecb = cb; ts.writechunk = chunk; ts.writeencoding = encoding; if (!ts.transforming) { var rs = this._readableState; if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } }; // Doesn't matter what the args are here. // _transform does all the work. // That we got here means that the readable side wants more data. Transform.prototype._read = function (n) { var ts = this._transformState; if (ts.writechunk !== null && ts.writecb && !ts.transforming) { ts.transforming = true; this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { // mark that we need a transform, so that any data that comes in // will get processed, now that we've asked for it. ts.needTransform = true; } }; function done(stream, er) { if (er) return stream.emit('error', er); // if there's nothing in the write buffer, then that means // that nothing more will ever be provided var ws = stream._writableState; var ts = stream._transformState; if (ws.length) throw new Error('Calling transform done when ws.length != 0'); if (ts.transforming) throw new Error('Calling transform done when still transforming'); return stream.push(null); } },{"./_stream_duplex":121,"core-util-is":50,"inherits":95}],125:[function(require,module,exports){ (function (process){ // A bit simpler than readable streams. // Implement an async ._write(chunk, encoding, cb), and it'll handle all // the drain event emission and buffering. 'use strict'; module.exports = Writable; /**/ var processNextTick = require('process-nextick-args'); /**/ /**/ var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; /**/ Writable.WritableState = WritableState; /**/ var util = require('core-util-is'); util.inherits = require('inherits'); /**/ /**/ var internalUtil = { deprecate: require('util-deprecate') }; /**/ /**/ var Stream; (function () { try { Stream = require('st' + 'ream'); } catch (_) {} finally { if (!Stream) Stream = require('events').EventEmitter; } })(); /**/ var Buffer = require('buffer').Buffer; /**/ var bufferShim = require('buffer-shims'); /**/ util.inherits(Writable, Stream); function nop() {} function WriteReq(chunk, encoding, cb) { this.chunk = chunk; this.encoding = encoding; this.callback = cb; this.next = null; } var Duplex; function WritableState(options, stream) { Duplex = Duplex || require('./_stream_duplex'); options = options || {}; // object stream flag to indicate whether or not this stream // contains buffers or objects. this.objectMode = !!options.objectMode; if (stream instanceof Duplex) 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() var hwm = options.highWaterMark; var defaultHwm = this.objectMode ? 16 : 16 * 1024; this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; // cast to ints. this.highWaterMark = ~ ~this.highWaterMark; this.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; // 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; // 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 writableStateGetBuffer() { 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 () { return this.getBuffer(); }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') }); } catch (_) {} })(); var Duplex; function Writable(options) { Duplex = Duplex || require('./_stream_duplex'); // Writable ctor is applied to Duplexes, though they're not // instanceof Writable, they're instanceof Readable. if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); this._writableState = new WritableState(options, this); // legacy. this.writable = true; if (options) { if (typeof options.write === 'function') this._write = options.write; if (typeof options.writev === 'function') this._writev = options.writev; } Stream.call(this); } // Otherwise people can pipe Writable streams, which is just wrong. Writable.prototype.pipe = function () { this.emit('error', new Error('Cannot pipe, not readable')); }; function writeAfterEnd(stream, cb) { var er = new Error('write after end'); // TODO: defer error events consistently everywhere, not just the cb stream.emit('error', er); processNextTick(cb, er); } // If we get something that is not a buffer, string, null, or undefined, // and we're not in objectMode, then that's an error. // Otherwise stream chunks are all considered to be of length=1, and the // watermarks determine how many objects to keep in the buffer, rather than // how many bytes or characters. function validChunk(stream, state, chunk, cb) { var valid = true; var er = false; // Always throw error if a null is written // if we are not in object mode then throw // if it is not a buffer, string, or undefined. if (chunk === null) { er = new TypeError('May not write null values to stream'); } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { er = new TypeError('Invalid non-string/buffer chunk'); } if (er) { stream.emit('error', er); processNextTick(cb, er); valid = false; } return valid; } Writable.prototype.write = function (chunk, encoding, cb) { var state = this._writableState; var ret = false; if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; if (typeof cb !== 'function') cb = nop; if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { state.pendingcb++; ret = writeOrBuffer(this, state, chunk, encoding, cb); } return ret; }; Writable.prototype.cork = function () { var state = this._writableState; state.corked++; }; Writable.prototype.uncork = function () { var state = this._writableState; if (state.corked) { state.corked--; if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } }; Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { // node::ParseEncoding() requires lower case. if (typeof encoding === 'string') encoding = encoding.toLowerCase(); if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); this._writableState.defaultEncoding = encoding; return this; }; function decodeChunk(state, chunk, encoding) { if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { chunk = bufferShim.from(chunk, encoding); } return chunk; } // if we're already writing something, then just put this // in the queue, and wait our turn. Otherwise, call _write // If we return false, then we need a drain event, so set that flag. function writeOrBuffer(stream, state, chunk, encoding, cb) { chunk = decodeChunk(state, chunk, encoding); if (Buffer.isBuffer(chunk)) encoding = 'buffer'; 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 = new WriteReq(chunk, encoding, cb); if (last) { last.next = state.lastBufferedRequest; } else { state.bufferedRequest = state.lastBufferedRequest; } state.bufferedRequestCount += 1; } else { doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len; state.writecb = cb; state.writing = true; state.sync = true; if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); state.sync = false; } function onwriteError(stream, state, sync, er, cb) { --state.pendingcb; if (sync) processNextTick(cb, er);else cb(er); stream._writableState.errorEmitted = true; stream.emit('error', er); } 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; 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); if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { clearBuffer(stream, state); } if (sync) { /**/ asyncWrite(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; while (entry) { buffer[count] = entry; entry = entry.next; count += 1; } 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); } } 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; // 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.bufferedRequestCount = 0; state.bufferedRequest = entry; state.bufferProcessing = false; } Writable.prototype._write = function (chunk, encoding, cb) { cb(new Error('not implemented')); }; Writable.prototype._writev = null; Writable.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 && !state.finished) endWritable(this, state, cb); }; function needFinish(state) { return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } function prefinish(stream, state) { if (!state.prefinished) { state.prefinished = true; stream.emit('prefinish'); } } function finishMaybe(stream, state) { var need = needFinish(state); if (need) { if (state.pendingcb === 0) { prefinish(stream, state); state.finished = true; stream.emit('finish'); } else { prefinish(stream, state); } } return need; } function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); if (cb) { if (state.finished) processNextTick(cb);else stream.once('finish', cb); } state.ended = true; stream.writable = false; } // It seems a linked list but it is not // there will be only 2 of these for each stream function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function (err) { var entry = _this.entry; _this.entry = null; while (entry) { var cb = entry.callback; state.pendingcb--; cb(err); entry = entry.next; } if (state.corkedRequestsFree) { state.corkedRequestsFree.next = _this; } else { state.corkedRequestsFree = _this; } }; } }).call(this,require('_process')) },{"./_stream_duplex":121,"_process":108,"buffer":47,"buffer-shims":45,"core-util-is":50,"events":84,"inherits":95,"process-nextick-args":107,"util-deprecate":148}],126:[function(require,module,exports){ module.exports = require("./lib/_stream_passthrough.js") },{"./lib/_stream_passthrough.js":122}],127:[function(require,module,exports){ (function (process){ var Stream = (function (){ try { return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify } catch(_){} }()); exports = module.exports = require('./lib/_stream_readable.js'); exports.Stream = Stream || exports; exports.Readable = exports; exports.Writable = require('./lib/_stream_writable.js'); exports.Duplex = require('./lib/_stream_duplex.js'); exports.Transform = require('./lib/_stream_transform.js'); exports.PassThrough = require('./lib/_stream_passthrough.js'); if (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) { module.exports = Stream; } }).call(this,require('_process')) },{"./lib/_stream_duplex.js":121,"./lib/_stream_passthrough.js":122,"./lib/_stream_readable.js":123,"./lib/_stream_transform.js":124,"./lib/_stream_writable.js":125,"_process":108}],128:[function(require,module,exports){ module.exports = require("./lib/_stream_transform.js") },{"./lib/_stream_transform.js":124}],129:[function(require,module,exports){ module.exports = require("./lib/_stream_writable.js") },{"./lib/_stream_writable.js":125}],130:[function(require,module,exports){ (function (Buffer){ /* CryptoJS v3.1.2 code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ /** @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. */ // constants table var zl = [ 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 = [ 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 = [ 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 = [ 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 = [0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E] var hr = [0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000] function bytesToWords (bytes) { var words = [] for (var i = 0, b = 0; i < bytes.length; i++, b += 8) { words[b >>> 5] |= bytes[i] << (24 - b % 32) } return words } function wordsToBytes (words) { var bytes = [] for (var b = 0; b < words.length * 32; b += 8) { bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF) } return bytes } function processBlock (H, M, offset) { // swap endian for (var i = 0; i < 16; i++) { 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) ) } // 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 (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 } 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 << n) | (x >>> (32 - n)) } function ripemd160 (message) { var H = [0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0] if (typeof message === 'string') { message = new Buffer(message, 'utf8') } var m = bytesToWords(message) var nBitsLeft = message.length * 8 var nBitsTotal = message.length * 8 // Add padding m[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32) m[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) | (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00) ) for (var i = 0; i < m.length; i += 16) { processBlock(H, m, i) } // swap endian for (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) } var digestbytes = wordsToBytes(H) return new Buffer(digestbytes) } module.exports = ripemd160 }).call(this,require("buffer").Buffer) },{"buffer":47}],131:[function(require,module,exports){ (function (Buffer){ // prototype class for hash functions function Hash (blockSize, finalSize) { this._block = new Buffer(blockSize) this._finalSize = finalSize this._blockSize = blockSize this._len = 0 this._s = 0 } Hash.prototype.update = function (data, enc) { if (typeof data === 'string') { enc = enc || 'utf8' data = new Buffer(data, enc) } var l = this._len += data.length var s = this._s || 0 var f = 0 var buffer = this._block while (s < l) { var t = Math.min(data.length, f + this._blockSize - (s % this._blockSize)) var ch = (t - f) for (var i = 0; i < ch; i++) { buffer[(s % this._blockSize) + i] = data[i + f] } s += ch f += ch if ((s % this._blockSize) === 0) { this._update(buffer) } } this._s = s return this } Hash.prototype.digest = function (enc) { // Suppose the length of the message M, in bits, is l var l = this._len * 8 // Append the bit 1 to the end of the message this._block[this._len % this._blockSize] = 0x80 // and then k zero bits, where k is the smallest non-negative solution to the equation (l + 1 + k) === finalSize mod blockSize this._block.fill(0, this._len % this._blockSize + 1) if (l % (this._blockSize * 8) >= this._finalSize * 8) { this._update(this._block) this._block.fill(0) } // to this append the block which is equal to the number l written in binary // TODO: handle case where l is > Math.pow(2, 29) this._block.writeInt32BE(l, this._blockSize - 4) var hash = this._update(this._block) || this._hash() return enc ? hash.toString(enc) : hash } Hash.prototype._update = function () { throw new Error('_update must be implemented by subclass') } module.exports = Hash }).call(this,require("buffer").Buffer) },{"buffer":47}],132:[function(require,module,exports){ var exports = module.exports = function SHA (algorithm) { algorithm = algorithm.toLowerCase() var Algorithm = exports[algorithm] if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)') return new Algorithm() } exports.sha = require('./sha') exports.sha1 = require('./sha1') exports.sha224 = require('./sha224') exports.sha256 = require('./sha256') exports.sha384 = require('./sha384') exports.sha512 = require('./sha512') },{"./sha":133,"./sha1":134,"./sha224":135,"./sha256":136,"./sha384":137,"./sha512":138}],133:[function(require,module,exports){ (function (Buffer){ /* * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined * in FIPS PUB 180-1 * This source code is derived from sha1.js of the same repository. * The difference between SHA-0 and SHA-1 is just a bitwise rotate left * operation was added. */ var inherits = require('inherits') var Hash = require('./hash') var K = [ 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0 ] var W = new Array(80) function Sha () { this.init() this._w = W Hash.call(this, 64, 56) } inherits(Sha, Hash) Sha.prototype.init = function () { this._a = 0x67452301 this._b = 0xefcdab89 this._c = 0x98badcfe this._d = 0x10325476 this._e = 0xc3d2e1f0 return this } function rotl5 (num) { return (num << 5) | (num >>> 27) } function rotl30 (num) { return (num << 30) | (num >>> 2) } function ft (s, b, c, d) { if (s === 0) return (b & c) | ((~b) & d) if (s === 2) return (b & c) | (b & d) | (c & d) return b ^ c ^ d } Sha.prototype._update = function (M) { var W = this._w var a = this._a | 0 var b = this._b | 0 var c = this._c | 0 var d = this._d | 0 var e = this._e | 0 for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4) for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16] for (var j = 0; j < 80; ++j) { var s = ~~(j / 20) var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0 e = d d = c c = rotl30(b) b = a a = t } this._a = (a + this._a) | 0 this._b = (b + this._b) | 0 this._c = (c + this._c) | 0 this._d = (d + this._d) | 0 this._e = (e + this._e) | 0 } Sha.prototype._hash = function () { var H = new Buffer(20) H.writeInt32BE(this._a | 0, 0) H.writeInt32BE(this._b | 0, 4) H.writeInt32BE(this._c | 0, 8) H.writeInt32BE(this._d | 0, 12) H.writeInt32BE(this._e | 0, 16) return H } module.exports = Sha }).call(this,require("buffer").Buffer) },{"./hash":131,"buffer":47,"inherits":95}],134:[function(require,module,exports){ (function (Buffer){ /* * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined * in FIPS PUB 180-1 * Version 2.1a Copyright Paul Johnston 2000 - 2002. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet * Distributed under the BSD License * See http://pajhome.org.uk/crypt/md5 for details. */ var inherits = require('inherits') var Hash = require('./hash') var K = [ 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0 ] var W = new Array(80) function Sha1 () { this.init() this._w = W Hash.call(this, 64, 56) } inherits(Sha1, Hash) Sha1.prototype.init = function () { this._a = 0x67452301 this._b = 0xefcdab89 this._c = 0x98badcfe this._d = 0x10325476 this._e = 0xc3d2e1f0 return this } function rotl1 (num) { return (num << 1) | (num >>> 31) } function rotl5 (num) { return (num << 5) | (num >>> 27) } function rotl30 (num) { return (num << 30) | (num >>> 2) } function ft (s, b, c, d) { if (s === 0) return (b & c) | ((~b) & d) if (s === 2) return (b & c) | (b & d) | (c & d) return b ^ c ^ d } Sha1.prototype._update = function (M) { var W = this._w var a = this._a | 0 var b = this._b | 0 var c = this._c | 0 var d = this._d | 0 var e = this._e | 0 for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4) for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]) for (var j = 0; j < 80; ++j) { var s = ~~(j / 20) var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0 e = d d = c c = rotl30(b) b = a a = t } this._a = (a + this._a) | 0 this._b = (b + this._b) | 0 this._c = (c + this._c) | 0 this._d = (d + this._d) | 0 this._e = (e + this._e) | 0 } Sha1.prototype._hash = function () { var H = new Buffer(20) H.writeInt32BE(this._a | 0, 0) H.writeInt32BE(this._b | 0, 4) H.writeInt32BE(this._c | 0, 8) H.writeInt32BE(this._d | 0, 12) H.writeInt32BE(this._e | 0, 16) return H } module.exports = Sha1 }).call(this,require("buffer").Buffer) },{"./hash":131,"buffer":47,"inherits":95}],135:[function(require,module,exports){ (function (Buffer){ /** * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined * in FIPS 180-2 * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet * */ var inherits = require('inherits') var Sha256 = require('./sha256') var Hash = require('./hash') var W = new Array(64) function Sha224 () { this.init() this._w = W // new Array(64) Hash.call(this, 64, 56) } inherits(Sha224, Sha256) Sha224.prototype.init = function () { this._a = 0xc1059ed8 this._b = 0x367cd507 this._c = 0x3070dd17 this._d = 0xf70e5939 this._e = 0xffc00b31 this._f = 0x68581511 this._g = 0x64f98fa7 this._h = 0xbefa4fa4 return this } Sha224.prototype._hash = function () { var H = new Buffer(28) H.writeInt32BE(this._a, 0) H.writeInt32BE(this._b, 4) H.writeInt32BE(this._c, 8) H.writeInt32BE(this._d, 12) H.writeInt32BE(this._e, 16) H.writeInt32BE(this._f, 20) H.writeInt32BE(this._g, 24) return H } module.exports = Sha224 }).call(this,require("buffer").Buffer) },{"./hash":131,"./sha256":136,"buffer":47,"inherits":95}],136:[function(require,module,exports){ (function (Buffer){ /** * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined * in FIPS 180-2 * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet * */ var inherits = require('inherits') var Hash = require('./hash') var 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 ] var W = new Array(64) function Sha256 () { this.init() this._w = W // new Array(64) Hash.call(this, 64, 56) } inherits(Sha256, Hash) Sha256.prototype.init = function () { this._a = 0x6a09e667 this._b = 0xbb67ae85 this._c = 0x3c6ef372 this._d = 0xa54ff53a this._e = 0x510e527f this._f = 0x9b05688c this._g = 0x1f83d9ab this._h = 0x5be0cd19 return this } function ch (x, y, z) { return z ^ (x & (y ^ z)) } function maj (x, y, z) { return (x & y) | (z & (x | y)) } function sigma0 (x) { return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10) } function sigma1 (x) { return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7) } function gamma0 (x) { return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3) } function gamma1 (x) { return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10) } Sha256.prototype._update = function (M) { var W = this._w var a = this._a | 0 var b = this._b | 0 var c = this._c | 0 var d = this._d | 0 var e = this._e | 0 var f = this._f | 0 var g = this._g | 0 var h = this._h | 0 for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4) for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0 for (var j = 0; j < 64; ++j) { var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0 var T2 = (sigma0(a) + maj(a, b, c)) | 0 h = g g = f f = e e = (d + T1) | 0 d = c c = b b = a a = (T1 + T2) | 0 } this._a = (a + this._a) | 0 this._b = (b + this._b) | 0 this._c = (c + this._c) | 0 this._d = (d + this._d) | 0 this._e = (e + this._e) | 0 this._f = (f + this._f) | 0 this._g = (g + this._g) | 0 this._h = (h + this._h) | 0 } Sha256.prototype._hash = function () { var H = new Buffer(32) H.writeInt32BE(this._a, 0) H.writeInt32BE(this._b, 4) H.writeInt32BE(this._c, 8) H.writeInt32BE(this._d, 12) H.writeInt32BE(this._e, 16) H.writeInt32BE(this._f, 20) H.writeInt32BE(this._g, 24) H.writeInt32BE(this._h, 28) return H } module.exports = Sha256 }).call(this,require("buffer").Buffer) },{"./hash":131,"buffer":47,"inherits":95}],137:[function(require,module,exports){ (function (Buffer){ var inherits = require('inherits') var SHA512 = require('./sha512') var Hash = require('./hash') var W = new Array(160) function Sha384 () { this.init() this._w = W Hash.call(this, 128, 112) } inherits(Sha384, SHA512) Sha384.prototype.init = function () { this._ah = 0xcbbb9d5d this._bh = 0x629a292a this._ch = 0x9159015a this._dh = 0x152fecd8 this._eh = 0x67332667 this._fh = 0x8eb44a87 this._gh = 0xdb0c2e0d this._hh = 0x47b5481d this._al = 0xc1059ed8 this._bl = 0x367cd507 this._cl = 0x3070dd17 this._dl = 0xf70e5939 this._el = 0xffc00b31 this._fl = 0x68581511 this._gl = 0x64f98fa7 this._hl = 0xbefa4fa4 return this } Sha384.prototype._hash = function () { var H = new Buffer(48) function writeInt64BE (h, l, offset) { H.writeInt32BE(h, offset) H.writeInt32BE(l, offset + 4) } writeInt64BE(this._ah, this._al, 0) writeInt64BE(this._bh, this._bl, 8) writeInt64BE(this._ch, this._cl, 16) writeInt64BE(this._dh, this._dl, 24) writeInt64BE(this._eh, this._el, 32) writeInt64BE(this._fh, this._fl, 40) return H } module.exports = Sha384 }).call(this,require("buffer").Buffer) },{"./hash":131,"./sha512":138,"buffer":47,"inherits":95}],138:[function(require,module,exports){ (function (Buffer){ var inherits = require('inherits') var Hash = require('./hash') var 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 ] var W = new Array(160) function Sha512 () { this.init() this._w = W Hash.call(this, 128, 112) } inherits(Sha512, Hash) Sha512.prototype.init = function () { this._ah = 0x6a09e667 this._bh = 0xbb67ae85 this._ch = 0x3c6ef372 this._dh = 0xa54ff53a this._eh = 0x510e527f this._fh = 0x9b05688c this._gh = 0x1f83d9ab this._hh = 0x5be0cd19 this._al = 0xf3bcc908 this._bl = 0x84caa73b this._cl = 0xfe94f82b this._dl = 0x5f1d36f1 this._el = 0xade682d1 this._fl = 0x2b3e6c1f this._gl = 0xfb41bd6b this._hl = 0x137e2179 return this } function Ch (x, y, z) { return z ^ (x & (y ^ z)) } function maj (x, y, z) { return (x & y) | (z & (x | y)) } function sigma0 (x, xl) { return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25) } function sigma1 (x, xl) { return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23) } function Gamma0 (x, xl) { return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7) } function Gamma0l (x, xl) { return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25) } function Gamma1 (x, xl) { return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6) } function Gamma1l (x, xl) { return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26) } function getCarry (a, b) { return (a >>> 0) < (b >>> 0) ? 1 : 0 } Sha512.prototype._update = function (M) { var W = this._w var ah = this._ah | 0 var bh = this._bh | 0 var ch = this._ch | 0 var dh = this._dh | 0 var eh = this._eh | 0 var fh = this._fh | 0 var gh = this._gh | 0 var hh = this._hh | 0 var al = this._al | 0 var bl = this._bl | 0 var cl = this._cl | 0 var dl = this._dl | 0 var el = this._el | 0 var fl = this._fl | 0 var gl = this._gl | 0 var hl = this._hl | 0 for (var i = 0; i < 32; i += 2) { W[i] = M.readInt32BE(i * 4) W[i + 1] = M.readInt32BE(i * 4 + 4) } for (; i < 160; i += 2) { var xh = W[i - 15 * 2] var xl = W[i - 15 * 2 + 1] var gamma0 = Gamma0(xh, xl) var gamma0l = Gamma0l(xl, xh) xh = W[i - 2 * 2] xl = W[i - 2 * 2 + 1] var gamma1 = Gamma1(xh, xl) var gamma1l = Gamma1l(xl, xh) // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] var Wi7h = W[i - 7 * 2] var Wi7l = W[i - 7 * 2 + 1] var Wi16h = W[i - 16 * 2] var Wi16l = W[i - 16 * 2 + 1] var Wil = (gamma0l + Wi7l) | 0 var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0 Wil = (Wil + gamma1l) | 0 Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0 Wil = (Wil + Wi16l) | 0 Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0 W[i] = Wih W[i + 1] = Wil } for (var j = 0; j < 160; j += 2) { Wih = W[j] Wil = W[j + 1] var majh = maj(ah, bh, ch) var majl = maj(al, bl, cl) var sigma0h = sigma0(ah, al) var sigma0l = sigma0(al, ah) var sigma1h = sigma1(eh, el) var sigma1l = sigma1(el, eh) // t1 = h + sigma1 + ch + K[j] + W[j] var Kih = K[j] var Kil = K[j + 1] var chh = Ch(eh, fh, gh) var chl = Ch(el, fl, gl) var t1l = (hl + sigma1l) | 0 var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0 t1l = (t1l + chl) | 0 t1h = (t1h + chh + getCarry(t1l, chl)) | 0 t1l = (t1l + Kil) | 0 t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0 t1l = (t1l + Wil) | 0 t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0 // t2 = sigma0 + maj var t2l = (sigma0l + majl) | 0 var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0 hh = gh hl = gl gh = fh gl = fl fh = eh fl = el el = (dl + t1l) | 0 eh = (dh + t1h + getCarry(el, dl)) | 0 dh = ch dl = cl ch = bh cl = bl bh = ah bl = al al = (t1l + t2l) | 0 ah = (t1h + t2h + getCarry(al, t1l)) | 0 } this._al = (this._al + al) | 0 this._bl = (this._bl + bl) | 0 this._cl = (this._cl + cl) | 0 this._dl = (this._dl + dl) | 0 this._el = (this._el + el) | 0 this._fl = (this._fl + fl) | 0 this._gl = (this._gl + gl) | 0 this._hl = (this._hl + hl) | 0 this._ah = (this._ah + ah + getCarry(this._al, al)) | 0 this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0 this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0 this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0 this._eh = (this._eh + eh + getCarry(this._el, el)) | 0 this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0 this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0 this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0 } Sha512.prototype._hash = function () { var H = new Buffer(64) function writeInt64BE (h, l, offset) { H.writeInt32BE(h, offset) H.writeInt32BE(l, offset + 4) } writeInt64BE(this._ah, this._al, 0) writeInt64BE(this._bh, this._bl, 8) writeInt64BE(this._ch, this._cl, 16) writeInt64BE(this._dh, this._dl, 24) writeInt64BE(this._eh, this._el, 32) writeInt64BE(this._fh, this._fl, 40) writeInt64BE(this._gh, this._gl, 48) writeInt64BE(this._hh, this._hl, 56) return H } module.exports = Sha512 }).call(this,require("buffer").Buffer) },{"./hash":131,"buffer":47,"inherits":95}],139:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. module.exports = Stream; var EE = require('events').EventEmitter; var inherits = require('inherits'); inherits(Stream, EE); Stream.Readable = require('readable-stream/readable.js'); Stream.Writable = require('readable-stream/writable.js'); Stream.Duplex = require('readable-stream/duplex.js'); Stream.Transform = require('readable-stream/transform.js'); Stream.PassThrough = require('readable-stream/passthrough.js'); // Backwards-compat with node 0.4.x Stream.Stream = Stream; // old-style streams. Note that the pipe method (the only relevant // part of this class) is overridden in the Readable class. function Stream() { EE.call(this); } Stream.prototype.pipe = function(dest, options) { var source = this; function ondata(chunk) { if (dest.writable) { if (false === dest.write(chunk) && source.pause) { source.pause(); } } } source.on('data', ondata); function ondrain() { if (source.readable && source.resume) { source.resume(); } } dest.on('drain', ondrain); // If the 'end' option is not supplied, dest.end() will be called when // source gets the 'end' or 'close' events. Only dest.end() once. if (!dest._isStdio && (!options || options.end !== false)) { source.on('end', onend); source.on('close', onclose); } var didOnEnd = false; function onend() { if (didOnEnd) return; didOnEnd = true; dest.end(); } function onclose() { if (didOnEnd) return; didOnEnd = true; if (typeof dest.destroy === 'function') dest.destroy(); } // don't leave dangling pipes when there are errors. function onerror(er) { cleanup(); if (EE.listenerCount(this, 'error') === 0) { throw er; // Unhandled stream error in pipe. } } source.on('error', onerror); dest.on('error', onerror); // remove all the event listeners that were added. function cleanup() { source.removeListener('data', ondata); dest.removeListener('drain', ondrain); source.removeListener('end', onend); source.removeListener('close', onclose); source.removeListener('error', onerror); dest.removeListener('error', onerror); source.removeListener('end', cleanup); source.removeListener('close', cleanup); dest.removeListener('close', cleanup); } source.on('end', cleanup); source.on('close', cleanup); dest.on('close', cleanup); dest.emit('pipe', source); // Allow for unix-like usage: A.pipe(B).pipe(C) return dest; }; },{"events":84,"inherits":95,"readable-stream/duplex.js":120,"readable-stream/passthrough.js":126,"readable-stream/readable.js":127,"readable-stream/transform.js":128,"readable-stream/writable.js":129}],140:[function(require,module,exports){ (function (global){ var ClientRequest = require('./lib/request') var extend = require('xtend') var statusCodes = require('builtin-status-codes') var url = require('url') var http = exports http.request = function (opts, cb) { if (typeof opts === 'string') opts = url.parse(opts) else opts = extend(opts) // Normally, the page is loaded from http or https, so not specifying a protocol // will result in a (valid) protocol-relative url. However, this won't work if // the protocol is something else, like 'file:' var defaultProtocol = global.location.protocol.search(/^https?:$/) === -1 ? 'http:' : '' var protocol = opts.protocol || defaultProtocol var host = opts.hostname || opts.host var port = opts.port var path = opts.path || '/' // Necessary for IPv6 addresses if (host && host.indexOf(':') !== -1) host = '[' + host + ']' // This may be a relative url. The browser should always be able to interpret it correctly. opts.url = (host ? (protocol + '//' + host) : '') + (port ? ':' + port : '') + path opts.method = (opts.method || 'GET').toUpperCase() opts.headers = opts.headers || {} // Also valid opts.auth, opts.mode var req = new ClientRequest(opts) if (cb) req.on('response', cb) return req } http.get = function get (opts, cb) { var req = http.request(opts, cb) req.end() return req } http.Agent = function () {} http.Agent.defaultMaxSockets = 4 http.STATUS_CODES = statusCodes http.METHODS = [ 'CHECKOUT', 'CONNECT', 'COPY', 'DELETE', 'GET', 'HEAD', 'LOCK', 'M-SEARCH', 'MERGE', 'MKACTIVITY', 'MKCOL', 'MOVE', 'NOTIFY', 'OPTIONS', 'PATCH', 'POST', 'PROPFIND', 'PROPPATCH', 'PURGE', 'PUT', 'REPORT', 'SEARCH', 'SUBSCRIBE', 'TRACE', 'UNLOCK', 'UNSUBSCRIBE' ] }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./lib/request":142,"builtin-status-codes":48,"url":146,"xtend":152}],141:[function(require,module,exports){ (function (global){ exports.fetch = isFunction(global.fetch) && isFunction(global.ReadableByteStream) exports.blobConstructor = false try { new Blob([new ArrayBuffer(1)]) exports.blobConstructor = true } catch (e) {} var xhr = new global.XMLHttpRequest() // If location.host is empty, e.g. if this page/worker was loaded // from a Blob, then use example.com to avoid an error xhr.open('GET', global.location.host ? '/' : 'https://example.com') function checkTypeSupport (type) { try { xhr.responseType = type return xhr.responseType === type } catch (e) {} return false } // For some strange reason, Safari 7.0 reports typeof global.ArrayBuffer === 'object'. // Safari 7.1 appears to have fixed this bug. var haveArrayBuffer = typeof global.ArrayBuffer !== 'undefined' var haveSlice = haveArrayBuffer && isFunction(global.ArrayBuffer.prototype.slice) exports.arraybuffer = haveArrayBuffer && checkTypeSupport('arraybuffer') // These next two tests unavoidably show warnings in Chrome. Since fetch will always // be used if it's available, just return false for these to avoid the warnings. exports.msstream = !exports.fetch && haveSlice && checkTypeSupport('ms-stream') exports.mozchunkedarraybuffer = !exports.fetch && haveArrayBuffer && checkTypeSupport('moz-chunked-arraybuffer') exports.overrideMimeType = isFunction(xhr.overrideMimeType) exports.vbArray = isFunction(global.VBArray) function isFunction (value) { return typeof value === 'function' } xhr = null // Help gc }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],142:[function(require,module,exports){ (function (process,global,Buffer){ var capability = require('./capability') var inherits = require('inherits') var response = require('./response') var stream = require('readable-stream') var toArrayBuffer = require('to-arraybuffer') var IncomingMessage = response.IncomingMessage var rStates = response.readyStates function decideMode (preferBinary) { if (capability.fetch) { return 'fetch' } else if (capability.mozchunkedarraybuffer) { return 'moz-chunked-arraybuffer' } else if (capability.msstream) { return 'ms-stream' } else if (capability.arraybuffer && preferBinary) { return 'arraybuffer' } else if (capability.vbArray && preferBinary) { return 'text:vbarray' } else { return 'text' } } var ClientRequest = module.exports = function (opts) { var self = this stream.Writable.call(self) self._opts = opts self._body = [] self._headers = {} if (opts.auth) self.setHeader('Authorization', 'Basic ' + new Buffer(opts.auth).toString('base64')) Object.keys(opts.headers).forEach(function (name) { self.setHeader(name, opts.headers[name]) }) var preferBinary if (opts.mode === 'prefer-streaming') { // If streaming is a high priority but binary compatibility and // the accuracy of the 'content-type' header aren't preferBinary = false } else if (opts.mode === 'allow-wrong-content-type') { // If streaming is more important than preserving the 'content-type' header preferBinary = !capability.overrideMimeType } else if (!opts.mode || opts.mode === 'default' || opts.mode === 'prefer-fast') { // Use binary if text streaming may corrupt data or the content-type header, or for speed preferBinary = true } else { throw new Error('Invalid value for opts.mode') } self._mode = decideMode(preferBinary) self.on('finish', function () { self._onFinish() }) } inherits(ClientRequest, stream.Writable) ClientRequest.prototype.setHeader = function (name, value) { var self = this var lowerName = name.toLowerCase() // This check is not necessary, but it prevents warnings from browsers about setting unsafe // headers. To be honest I'm not entirely sure hiding these warnings is a good thing, but // http-browserify did it, so I will too. if (unsafeHeaders.indexOf(lowerName) !== -1) return self._headers[lowerName] = { name: name, value: value } } ClientRequest.prototype.getHeader = function (name) { var self = this return self._headers[name.toLowerCase()].value } ClientRequest.prototype.removeHeader = function (name) { var self = this delete self._headers[name.toLowerCase()] } ClientRequest.prototype._onFinish = function () { var self = this if (self._destroyed) return var opts = self._opts var headersObj = self._headers var body if (opts.method === 'POST' || opts.method === 'PUT' || opts.method === 'PATCH') { if (capability.blobConstructor) { body = new global.Blob(self._body.map(function (buffer) { return toArrayBuffer(buffer) }), { type: (headersObj['content-type'] || {}).value || '' }) } else { // get utf8 string body = Buffer.concat(self._body).toString() } } if (self._mode === 'fetch') { var headers = Object.keys(headersObj).map(function (name) { return [headersObj[name].name, headersObj[name].value] }) global.fetch(self._opts.url, { method: self._opts.method, headers: headers, body: body, mode: 'cors', credentials: opts.withCredentials ? 'include' : 'same-origin' }).then(function (response) { self._fetchResponse = response self._connect() }, function (reason) { self.emit('error', reason) }) } else { var xhr = self._xhr = new global.XMLHttpRequest() try { xhr.open(self._opts.method, self._opts.url, true) } catch (err) { process.nextTick(function () { self.emit('error', err) }) return } // Can't set responseType on really old browsers if ('responseType' in xhr) xhr.responseType = self._mode.split(':')[0] if ('withCredentials' in xhr) xhr.withCredentials = !!opts.withCredentials if (self._mode === 'text' && 'overrideMimeType' in xhr) xhr.overrideMimeType('text/plain; charset=x-user-defined') Object.keys(headersObj).forEach(function (name) { xhr.setRequestHeader(headersObj[name].name, headersObj[name].value) }) self._response = null xhr.onreadystatechange = function () { switch (xhr.readyState) { case rStates.LOADING: case rStates.DONE: self._onXHRProgress() break } } // Necessary for streaming in Firefox, since xhr.response is ONLY defined // in onprogress, not in onreadystatechange with xhr.readyState = 3 if (self._mode === 'moz-chunked-arraybuffer') { xhr.onprogress = function () { self._onXHRProgress() } } xhr.onerror = function () { if (self._destroyed) return self.emit('error', new Error('XHR error')) } try { xhr.send(body) } catch (err) { process.nextTick(function () { self.emit('error', err) }) return } } } /** * Checks if xhr.status is readable and non-zero, indicating no error. * Even though the spec says it should be available in readyState 3, * accessing it throws an exception in IE8 */ function statusValid (xhr) { try { var status = xhr.status return (status !== null && status !== 0) } catch (e) { return false } } ClientRequest.prototype._onXHRProgress = function () { var self = this if (!statusValid(self._xhr) || self._destroyed) return if (!self._response) self._connect() self._response._onXHRProgress() } ClientRequest.prototype._connect = function () { var self = this if (self._destroyed) return self._response = new IncomingMessage(self._xhr, self._fetchResponse, self._mode) self.emit('response', self._response) } ClientRequest.prototype._write = function (chunk, encoding, cb) { var self = this self._body.push(chunk) cb() } ClientRequest.prototype.abort = ClientRequest.prototype.destroy = function () { var self = this self._destroyed = true if (self._response) self._response._destroyed = true if (self._xhr) self._xhr.abort() // Currently, there isn't a way to truly abort a fetch. // If you like bikeshedding, see https://github.com/whatwg/fetch/issues/27 } ClientRequest.prototype.end = function (data, encoding, cb) { var self = this if (typeof data === 'function') { cb = data data = undefined } stream.Writable.prototype.end.call(self, data, encoding, cb) } ClientRequest.prototype.flushHeaders = function () {} ClientRequest.prototype.setTimeout = function () {} ClientRequest.prototype.setNoDelay = function () {} ClientRequest.prototype.setSocketKeepAlive = function () {} // Taken from http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader%28%29-method var unsafeHeaders = [ 'accept-charset', 'accept-encoding', 'access-control-request-headers', 'access-control-request-method', 'connection', 'content-length', 'cookie', 'cookie2', 'date', 'dnt', 'expect', 'host', 'keep-alive', 'origin', 'referer', 'te', 'trailer', 'transfer-encoding', 'upgrade', 'user-agent', 'via' ] }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) },{"./capability":141,"./response":143,"_process":108,"buffer":47,"inherits":95,"readable-stream":127,"to-arraybuffer":145}],143:[function(require,module,exports){ (function (process,global,Buffer){ var capability = require('./capability') var inherits = require('inherits') var stream = require('readable-stream') var rStates = exports.readyStates = { UNSENT: 0, OPENED: 1, HEADERS_RECEIVED: 2, LOADING: 3, DONE: 4 } var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode) { var self = this stream.Readable.call(self) self._mode = mode self.headers = {} self.rawHeaders = [] self.trailers = {} self.rawTrailers = [] // Fake the 'close' event, but only once 'end' fires self.on('end', function () { // The nextTick is necessary to prevent the 'request' module from causing an infinite loop process.nextTick(function () { self.emit('close') }) }) if (mode === 'fetch') { self._fetchResponse = response self.url = response.url self.statusCode = response.status self.statusMessage = response.statusText // backwards compatible version of for ( of ): // for (var ,_i,_it = [Symbol.iterator](); = (_i = _it.next()).value,!_i.done;) for (var header, _i, _it = response.headers[Symbol.iterator](); header = (_i = _it.next()).value, !_i.done;) { self.headers[header[0].toLowerCase()] = header[1] self.rawHeaders.push(header[0], header[1]) } // TODO: this doesn't respect backpressure. Once WritableStream is available, this can be fixed var reader = response.body.getReader() function read () { reader.read().then(function (result) { if (self._destroyed) return if (result.done) { self.push(null) return } self.push(new Buffer(result.value)) read() }) } read() } else { self._xhr = xhr self._pos = 0 self.url = xhr.responseURL self.statusCode = xhr.status self.statusMessage = xhr.statusText var headers = xhr.getAllResponseHeaders().split(/\r?\n/) headers.forEach(function (header) { var matches = header.match(/^([^:]+):\s*(.*)/) if (matches) { var key = matches[1].toLowerCase() if (key === 'set-cookie') { if (self.headers[key] === undefined) { self.headers[key] = [] } self.headers[key].push(matches[2]) } else if (self.headers[key] !== undefined) { self.headers[key] += ', ' + matches[2] } else { self.headers[key] = matches[2] } self.rawHeaders.push(matches[1], matches[2]) } }) self._charset = 'x-user-defined' if (!capability.overrideMimeType) { var mimeType = self.rawHeaders['mime-type'] if (mimeType) { var charsetMatch = mimeType.match(/;\s*charset=([^;])(;|$)/) if (charsetMatch) { self._charset = charsetMatch[1].toLowerCase() } } if (!self._charset) self._charset = 'utf-8' // best guess } } } inherits(IncomingMessage, stream.Readable) IncomingMessage.prototype._read = function () {} IncomingMessage.prototype._onXHRProgress = function () { var self = this var xhr = self._xhr var response = null switch (self._mode) { case 'text:vbarray': // For IE9 if (xhr.readyState !== rStates.DONE) break try { // This fails in IE8 response = new global.VBArray(xhr.responseBody).toArray() } catch (e) {} if (response !== null) { self.push(new Buffer(response)) break } // Falls through in IE8 case 'text': try { // This will fail when readyState = 3 in IE9. Switch mode and wait for readyState = 4 response = xhr.responseText } catch (e) { self._mode = 'text:vbarray' break } if (response.length > self._pos) { var newData = response.substr(self._pos) if (self._charset === 'x-user-defined') { var buffer = new Buffer(newData.length) for (var i = 0; i < newData.length; i++) buffer[i] = newData.charCodeAt(i) & 0xff self.push(buffer) } else { self.push(newData, self._charset) } self._pos = response.length } break case 'arraybuffer': if (xhr.readyState !== rStates.DONE) break response = xhr.response self.push(new Buffer(new Uint8Array(response))) break case 'moz-chunked-arraybuffer': // take whole response = xhr.response if (xhr.readyState !== rStates.LOADING || !response) break self.push(new Buffer(new Uint8Array(response))) break case 'ms-stream': response = xhr.response if (xhr.readyState !== rStates.LOADING) break var reader = new global.MSStreamReader() reader.onprogress = function () { if (reader.result.byteLength > self._pos) { self.push(new Buffer(new Uint8Array(reader.result.slice(self._pos)))) self._pos = reader.result.byteLength } } reader.onload = function () { self.push(null) } // reader.onerror = ??? // TODO: this reader.readAsArrayBuffer(response) break } // The ms-stream case handles end separately in reader.onload() if (self._xhr.readyState === rStates.DONE && self._mode !== 'ms-stream') { self.push(null) } } }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) },{"./capability":141,"_process":108,"buffer":47,"inherits":95,"readable-stream":127}],144:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var Buffer = require('buffer').Buffer; var isBufferEncoding = Buffer.isEncoding || function(encoding) { switch (encoding && encoding.toLowerCase()) { case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; default: return false; } } function assertEncoding(encoding) { if (encoding && !isBufferEncoding(encoding)) { throw new Error('Unknown encoding: ' + encoding); } } // StringDecoder provides an interface for efficiently splitting a series of // buffers into a series of JS strings without breaking apart multi-byte // characters. CESU-8 is handled as part of the UTF-8 encoding. // // @TODO Handling all encodings inside a single object makes it very difficult // to reason about this code, so it should be split up in the future. // @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code // points as used by CESU-8. var StringDecoder = exports.StringDecoder = function(encoding) { this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); assertEncoding(encoding); switch (this.encoding) { case 'utf8': // CESU-8 represents each of Surrogate Pair by 3-bytes this.surrogateSize = 3; break; case 'ucs2': case 'utf16le': // UTF-16 represents each of Surrogate Pair by 2-bytes this.surrogateSize = 2; this.detectIncompleteChar = utf16DetectIncompleteChar; break; case 'base64': // Base-64 stores 3 bytes in 4 chars, and pads the remainder. this.surrogateSize = 3; this.detectIncompleteChar = base64DetectIncompleteChar; break; default: this.write = passThroughWrite; return; } // Enough space to store all bytes of a single character. UTF-8 needs 4 // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). this.charBuffer = new Buffer(6); // Number of bytes received for the current incomplete multi-byte character. this.charReceived = 0; // Number of bytes expected for the current incomplete multi-byte character. this.charLength = 0; }; // write decodes the given buffer and returns it as JS string that is // guaranteed to not contain any partial multi-byte characters. Any partial // character found at the end of the buffer is buffered up, and will be // returned when calling write again with the remaining bytes. // // Note: Converting a Buffer containing an orphan surrogate to a String // currently works, but converting a String to a Buffer (via `new Buffer`, or // Buffer#write) will replace incomplete surrogates with the unicode // replacement character. See https://codereview.chromium.org/121173009/ . StringDecoder.prototype.write = function(buffer) { var charStr = ''; // if our last write ended with an incomplete multibyte character while (this.charLength) { // determine how many remaining bytes this buffer has to offer for this char var available = (buffer.length >= this.charLength - this.charReceived) ? this.charLength - this.charReceived : buffer.length; // add the new bytes to the char buffer buffer.copy(this.charBuffer, this.charReceived, 0, available); this.charReceived += available; if (this.charReceived < this.charLength) { // still not enough chars in this buffer? wait for more ... return ''; } // remove bytes belonging to the current character from the buffer buffer = buffer.slice(available, buffer.length); // get the character that was split charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character var charCode = charStr.charCodeAt(charStr.length - 1); if (charCode >= 0xD800 && charCode <= 0xDBFF) { this.charLength += this.surrogateSize; charStr = ''; continue; } this.charReceived = this.charLength = 0; // if there are no more bytes in this buffer, just emit our char if (buffer.length === 0) { return charStr; } break; } // determine and set charLength / charReceived this.detectIncompleteChar(buffer); var end = buffer.length; if (this.charLength) { // buffer the incomplete character bytes we got buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); end -= this.charReceived; } charStr += buffer.toString(this.encoding, 0, end); var end = charStr.length - 1; var charCode = charStr.charCodeAt(end); // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character if (charCode >= 0xD800 && charCode <= 0xDBFF) { var size = this.surrogateSize; this.charLength += size; this.charReceived += size; this.charBuffer.copy(this.charBuffer, size, 0, size); buffer.copy(this.charBuffer, 0, 0, size); return charStr.substring(0, end); } // or just emit the charStr return charStr; }; // detectIncompleteChar determines if there is an incomplete UTF-8 character at // the end of the given buffer. If so, it sets this.charLength to the byte // length that character, and sets this.charReceived to the number of bytes // that are available for this character. StringDecoder.prototype.detectIncompleteChar = function(buffer) { // determine how many bytes we have to check at the end of this buffer var i = (buffer.length >= 3) ? 3 : buffer.length; // Figure out if one of the last i bytes of our buffer announces an // incomplete char. for (; i > 0; i--) { var c = buffer[buffer.length - i]; // See http://en.wikipedia.org/wiki/UTF-8#Description // 110XXXXX if (i == 1 && c >> 5 == 0x06) { this.charLength = 2; break; } // 1110XXXX if (i <= 2 && c >> 4 == 0x0E) { this.charLength = 3; break; } // 11110XXX if (i <= 3 && c >> 3 == 0x1E) { this.charLength = 4; break; } } this.charReceived = i; }; StringDecoder.prototype.end = function(buffer) { var res = ''; if (buffer && buffer.length) res = this.write(buffer); if (this.charReceived) { var cr = this.charReceived; var buf = this.charBuffer; var enc = this.encoding; res += buf.slice(0, cr).toString(enc); } return res; }; function passThroughWrite(buffer) { return buffer.toString(this.encoding); } function utf16DetectIncompleteChar(buffer) { this.charReceived = buffer.length % 2; this.charLength = this.charReceived ? 2 : 0; } function base64DetectIncompleteChar(buffer) { this.charReceived = buffer.length % 3; this.charLength = this.charReceived ? 3 : 0; } },{"buffer":47}],145:[function(require,module,exports){ var Buffer = require('buffer').Buffer module.exports = function (buf) { // If the buffer is backed by a Uint8Array, a faster version will work if (buf instanceof Uint8Array) { // If the buffer isn't a subarray, return the underlying ArrayBuffer if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) { return buf.buffer } else if (typeof buf.buffer.slice === 'function') { // Otherwise we need to get a proper copy return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength) } } if (Buffer.isBuffer(buf)) { // This is the slow version that will work with any Buffer // implementation (even in old browsers) var arrayCopy = new Uint8Array(buf.length) var len = buf.length for (var i = 0; i < len; i++) { arrayCopy[i] = buf[i] } return arrayCopy.buffer } else { throw new Error('Argument must be a Buffer') } } },{"buffer":47}],146:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; var punycode = require('punycode'); var util = require('./util'); exports.parse = urlParse; exports.resolve = urlResolve; exports.resolveObject = urlResolveObject; exports.format = urlFormat; exports.Url = Url; function Url() { this.protocol = null; this.slashes = null; this.auth = null; this.host = null; this.port = null; this.hostname = null; this.hash = null; this.search = null; this.query = null; this.pathname = null; this.path = null; this.href = null; } // Reference: RFC 3986, RFC 1808, RFC 2396 // define these here so at least they only have to be // compiled once on the first module load. var protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, // Special case for a simple path URL simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, // RFC 2396: characters reserved for delimiting URLs. // We actually just auto-escape these. delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], // RFC 2396: characters not allowed for various reasons. unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), // Allowed by RFCs, but cause of XSS attacks. Always escape these. autoEscape = ['\''].concat(unwise), // Characters that are never ever allowed in a hostname. // Note that any invalid chars are also handled, but these // are the ones that are *expected* to be seen, so we fast-path // them. nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), hostEndingChars = ['/', '?', '#'], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, // protocols that can allow "unsafe" and "unwise" chars. unsafeProtocol = { 'javascript': true, 'javascript:': true }, // protocols that never have a hostname. hostlessProtocol = { 'javascript': true, 'javascript:': true }, // protocols that always contain a // bit. slashedProtocol = { 'http': true, 'https': true, 'ftp': true, 'gopher': true, 'file': true, 'http:': true, 'https:': true, 'ftp:': true, 'gopher:': true, 'file:': true }, querystring = require('querystring'); function urlParse(url, parseQueryString, slashesDenoteHost) { if (url && util.isObject(url) && url instanceof Url) return url; var u = new Url; u.parse(url, parseQueryString, slashesDenoteHost); return u; } Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { if (!util.isString(url)) { throw new TypeError("Parameter 'url' must be a string, not " + typeof url); } // Copy chrome, IE, opera backslash-handling behavior. // Back slashes before the query string get converted to forward slashes // See: https://code.google.com/p/chromium/issues/detail?id=25916 var queryIndex = url.indexOf('?'), splitter = (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', uSplit = url.split(splitter), slashRegex = /\\/g; uSplit[0] = uSplit[0].replace(slashRegex, '/'); url = uSplit.join(splitter); var rest = url; // trim before proceeding. // This is to support parse stuff like " http://foo.com \n" rest = rest.trim(); if (!slashesDenoteHost && url.split('#').length === 1) { // Try fast path regexp var simplePath = simplePathPattern.exec(rest); if (simplePath) { this.path = rest; this.href = rest; this.pathname = simplePath[1]; if (simplePath[2]) { this.search = simplePath[2]; if (parseQueryString) { this.query = querystring.parse(this.search.substr(1)); } else { this.query = this.search.substr(1); } } else if (parseQueryString) { this.search = ''; this.query = {}; } return this; } } var proto = protocolPattern.exec(rest); if (proto) { proto = proto[0]; var lowerProto = proto.toLowerCase(); this.protocol = lowerProto; rest = rest.substr(proto.length); } // figure out if it's got a host // user@server is *always* interpreted as a hostname, and url // resolution will treat //foo/bar as host=foo,path=bar because that's // how the browser resolves relative URLs. if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { var slashes = rest.substr(0, 2) === '//'; if (slashes && !(proto && hostlessProtocol[proto])) { rest = rest.substr(2); this.slashes = true; } } if (!hostlessProtocol[proto] && (slashes || (proto && !slashedProtocol[proto]))) { // there's a hostname. // the first instance of /, ?, ;, or # ends the host. // // If there is an @ in the hostname, then non-host chars *are* allowed // to the left of the last @ sign, unless some host-ending character // comes *before* the @-sign. // URLs are obnoxious. // // ex: // http://a@b@c/ => user:a@b host:c // http://a@b?@c => user:a host:c path:/?@c // v0.12 TODO(isaacs): This is not quite how Chrome does things. // Review our test case against browsers more comprehensively. // find the first instance of any hostEndingChars var hostEnd = -1; for (var i = 0; i < hostEndingChars.length; i++) { var hec = rest.indexOf(hostEndingChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; } // at this point, either we have an explicit point where the // auth portion cannot go past, or the last @ char is the decider. var auth, atSign; if (hostEnd === -1) { // atSign can be anywhere. atSign = rest.lastIndexOf('@'); } else { // atSign must be in auth portion. // http://a@b/c@d => host:b auth:a path:/c@d atSign = rest.lastIndexOf('@', hostEnd); } // Now we have a portion which is definitely the auth. // Pull that off. if (atSign !== -1) { auth = rest.slice(0, atSign); rest = rest.slice(atSign + 1); this.auth = decodeURIComponent(auth); } // the host is the remaining to the left of the first non-host char hostEnd = -1; for (var i = 0; i < nonHostChars.length; i++) { var hec = rest.indexOf(nonHostChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; } // if we still have not hit it, then the entire thing is a host. if (hostEnd === -1) hostEnd = rest.length; this.host = rest.slice(0, hostEnd); rest = rest.slice(hostEnd); // pull out port. this.parseHost(); // we've indicated that there is a hostname, // so even if it's empty, it has to be present. this.hostname = this.hostname || ''; // if hostname begins with [ and ends with ] // assume that it's an IPv6 address. var ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']'; // validate a little. if (!ipv6Hostname) { var hostparts = this.hostname.split(/\./); for (var i = 0, l = hostparts.length; i < l; i++) { var part = hostparts[i]; if (!part) continue; if (!part.match(hostnamePartPattern)) { var newpart = ''; for (var j = 0, k = part.length; j < k; j++) { if (part.charCodeAt(j) > 127) { // we replace non-ASCII char with a temporary placeholder // we need this to make sure size of hostname is not // broken by replacing non-ASCII by nothing newpart += 'x'; } else { newpart += part[j]; } } // we test again with ASCII char only if (!newpart.match(hostnamePartPattern)) { var validParts = hostparts.slice(0, i); var notHost = hostparts.slice(i + 1); var bit = part.match(hostnamePartStart); if (bit) { validParts.push(bit[1]); notHost.unshift(bit[2]); } if (notHost.length) { rest = '/' + notHost.join('.') + rest; } this.hostname = validParts.join('.'); break; } } } } if (this.hostname.length > hostnameMaxLen) { this.hostname = ''; } else { // hostnames are always lower case. this.hostname = this.hostname.toLowerCase(); } if (!ipv6Hostname) { // IDNA Support: Returns a punycoded representation of "domain". // It only converts parts of the domain name that // have non-ASCII characters, i.e. it doesn't matter if // you call it with a domain that already is ASCII-only. this.hostname = punycode.toASCII(this.hostname); } var p = this.port ? ':' + this.port : ''; var h = this.hostname || ''; this.host = h + p; this.href += this.host; // strip [ and ] from the hostname // the host field still retains them, though if (ipv6Hostname) { this.hostname = this.hostname.substr(1, this.hostname.length - 2); if (rest[0] !== '/') { rest = '/' + rest; } } } // now rest is set to the post-host stuff. // chop off any delim chars. if (!unsafeProtocol[lowerProto]) { // First, make 100% sure that any "autoEscape" chars get // escaped, even if encodeURIComponent doesn't think they // need to be. for (var i = 0, l = autoEscape.length; i < l; i++) { var ae = autoEscape[i]; if (rest.indexOf(ae) === -1) continue; var esc = encodeURIComponent(ae); if (esc === ae) { esc = escape(ae); } rest = rest.split(ae).join(esc); } } // chop off from the tail first. var hash = rest.indexOf('#'); if (hash !== -1) { // got a fragment string. this.hash = rest.substr(hash); rest = rest.slice(0, hash); } var qm = rest.indexOf('?'); if (qm !== -1) { this.search = rest.substr(qm); this.query = rest.substr(qm + 1); if (parseQueryString) { this.query = querystring.parse(this.query); } rest = rest.slice(0, qm); } else if (parseQueryString) { // no query string, but parseQueryString still requested this.search = ''; this.query = {}; } if (rest) this.pathname = rest; if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) { this.pathname = '/'; } //to support http.request if (this.pathname || this.search) { var p = this.pathname || ''; var s = this.search || ''; this.path = p + s; } // finally, reconstruct the href based on what has been validated. this.href = this.format(); return this; }; // format a parsed object into a url string function urlFormat(obj) { // ensure it's an object, and not a string url. // If it's an obj, this is a no-op. // this way, you can call url_format() on strings // to clean up potentially wonky urls. if (util.isString(obj)) obj = urlParse(obj); if (!(obj instanceof Url)) return Url.prototype.format.call(obj); return obj.format(); } Url.prototype.format = function() { var auth = this.auth || ''; if (auth) { auth = encodeURIComponent(auth); auth = auth.replace(/%3A/i, ':'); auth += '@'; } var protocol = this.protocol || '', pathname = this.pathname || '', hash = this.hash || '', host = false, query = ''; if (this.host) { host = auth + this.host; } else if (this.hostname) { host = auth + (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']'); if (this.port) { host += ':' + this.port; } } if (this.query && util.isObject(this.query) && Object.keys(this.query).length) { query = querystring.stringify(this.query); } var search = this.search || (query && ('?' + query)) || ''; if (protocol && protocol.substr(-1) !== ':') protocol += ':'; // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. // unless they had them to begin with. if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) { host = '//' + (host || ''); if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; } else if (!host) { host = ''; } if (hash && hash.charAt(0) !== '#') hash = '#' + hash; if (search && search.charAt(0) !== '?') search = '?' + search; pathname = pathname.replace(/[?#]/g, function(match) { return encodeURIComponent(match); }); search = search.replace('#', '%23'); return protocol + host + pathname + search + hash; }; function urlResolve(source, relative) { return urlParse(source, false, true).resolve(relative); } Url.prototype.resolve = function(relative) { return this.resolveObject(urlParse(relative, false, true)).format(); }; function urlResolveObject(source, relative) { if (!source) return relative; return urlParse(source, false, true).resolveObject(relative); } Url.prototype.resolveObject = function(relative) { if (util.isString(relative)) { var rel = new Url(); rel.parse(relative, false, true); relative = rel; } var result = new Url(); var tkeys = Object.keys(this); for (var tk = 0; tk < tkeys.length; tk++) { var tkey = tkeys[tk]; result[tkey] = this[tkey]; } // hash is always overridden, no matter what. // even href="" will remove it. result.hash = relative.hash; // if the relative url is empty, then there's nothing left to do here. if (relative.href === '') { result.href = result.format(); return result; } // hrefs like //foo/bar always cut to the protocol. if (relative.slashes && !relative.protocol) { // take everything except the protocol from relative var rkeys = Object.keys(relative); for (var rk = 0; rk < rkeys.length; rk++) { var rkey = rkeys[rk]; if (rkey !== 'protocol') result[rkey] = relative[rkey]; } //urlParse appends trailing / to urls like http://www.example.com if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) { result.path = result.pathname = '/'; } result.href = result.format(); return result; } if (relative.protocol && relative.protocol !== result.protocol) { // if it's a known url protocol, then changing // the protocol does weird things // first, if it's not file:, then we MUST have a host, // and if there was a path // to begin with, then we MUST have a path. // if it is file:, then the host is dropped, // because that's known to be hostless. // anything else is assumed to be absolute. if (!slashedProtocol[relative.protocol]) { var keys = Object.keys(relative); for (var v = 0; v < keys.length; v++) { var k = keys[v]; result[k] = relative[k]; } result.href = result.format(); return result; } result.protocol = relative.protocol; if (!relative.host && !hostlessProtocol[relative.protocol]) { var relPath = (relative.pathname || '').split('/'); while (relPath.length && !(relative.host = relPath.shift())); if (!relative.host) relative.host = ''; if (!relative.hostname) relative.hostname = ''; if (relPath[0] !== '') relPath.unshift(''); if (relPath.length < 2) relPath.unshift(''); result.pathname = relPath.join('/'); } else { result.pathname = relative.pathname; } result.search = relative.search; result.query = relative.query; result.host = relative.host || ''; result.auth = relative.auth; result.hostname = relative.hostname || relative.host; result.port = relative.port; // to support http.request if (result.pathname || result.search) { var p = result.pathname || ''; var s = result.search || ''; result.path = p + s; } result.slashes = result.slashes || relative.slashes; result.href = result.format(); return result; } var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), isRelAbs = ( relative.host || relative.pathname && relative.pathname.charAt(0) === '/' ), mustEndAbs = (isRelAbs || isSourceAbs || (result.host && relative.pathname)), removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split('/') || [], relPath = relative.pathname && relative.pathname.split('/') || [], psychotic = result.protocol && !slashedProtocol[result.protocol]; // if the url is a non-slashed url, then relative // links like ../.. should be able // to crawl up to the hostname, as well. This is strange. // result.protocol has already been set by now. // Later on, put the first path part into the host field. if (psychotic) { result.hostname = ''; result.port = null; if (result.host) { if (srcPath[0] === '') srcPath[0] = result.host; else srcPath.unshift(result.host); } result.host = ''; if (relative.protocol) { relative.hostname = null; relative.port = null; if (relative.host) { if (relPath[0] === '') relPath[0] = relative.host; else relPath.unshift(relative.host); } relative.host = null; } mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); } if (isRelAbs) { // it's absolute. result.host = (relative.host || relative.host === '') ? relative.host : result.host; result.hostname = (relative.hostname || relative.hostname === '') ? relative.hostname : result.hostname; result.search = relative.search; result.query = relative.query; srcPath = relPath; // fall through to the dot-handling below. } else if (relPath.length) { // it's relative // throw away the existing file, and take the new path instead. if (!srcPath) srcPath = []; srcPath.pop(); srcPath = srcPath.concat(relPath); result.search = relative.search; result.query = relative.query; } else if (!util.isNullOrUndefined(relative.search)) { // just pull out the search. // like href='?foo'. // Put this after the other two cases because it simplifies the booleans if (psychotic) { result.hostname = result.host = srcPath.shift(); //occationaly the auth can get stuck only in host //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; if (authInHost) { result.auth = authInHost.shift(); result.host = result.hostname = authInHost.shift(); } } result.search = relative.search; result.query = relative.query; //to support http.request if (!util.isNull(result.pathname) || !util.isNull(result.search)) { result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); } result.href = result.format(); return result; } if (!srcPath.length) { // no path at all. easy. // we've already handled the other stuff above. result.pathname = null; //to support http.request if (result.search) { result.path = '/' + result.search; } else { result.path = null; } result.href = result.format(); return result; } // if a url ENDs in . or .., then it must get a trailing slash. // however, if it ends in anything else non-slashy, // then it must NOT get a trailing slash. var last = srcPath.slice(-1)[0]; var hasTrailingSlash = ( (result.host || relative.host || srcPath.length > 1) && (last === '.' || last === '..') || last === ''); // strip single dots, resolve double dots to parent dir // if the path tries to go above the root, `up` ends up > 0 var up = 0; for (var i = srcPath.length; i >= 0; i--) { last = srcPath[i]; if (last === '.') { srcPath.splice(i, 1); } else if (last === '..') { srcPath.splice(i, 1); up++; } else if (up) { srcPath.splice(i, 1); up--; } } // if the path is allowed to go above the root, restore leading ..s if (!mustEndAbs && !removeAllDots) { for (; up--; up) { srcPath.unshift('..'); } } if (mustEndAbs && srcPath[0] !== '' && (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { srcPath.unshift(''); } if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { srcPath.push(''); } var isAbsolute = srcPath[0] === '' || (srcPath[0] && srcPath[0].charAt(0) === '/'); // put the host back if (psychotic) { result.hostname = result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : ''; //occationaly the auth can get stuck only in host //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; if (authInHost) { result.auth = authInHost.shift(); result.host = result.hostname = authInHost.shift(); } } mustEndAbs = mustEndAbs || (result.host && srcPath.length); if (mustEndAbs && !isAbsolute) { srcPath.unshift(''); } if (!srcPath.length) { result.pathname = null; result.path = null; } else { result.pathname = srcPath.join('/'); } //to support request.http if (!util.isNull(result.pathname) || !util.isNull(result.search)) { result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); } result.auth = relative.auth || result.auth; result.slashes = result.slashes || relative.slashes; result.href = result.format(); return result; }; Url.prototype.parseHost = function() { var host = this.host; var port = portPattern.exec(host); if (port) { port = port[0]; if (port !== ':') { this.port = port.substr(1); } host = host.substr(0, host.length - port.length); } if (host) this.hostname = host; }; },{"./util":147,"punycode":115,"querystring":118}],147:[function(require,module,exports){ 'use strict'; module.exports = { isString: function(arg) { return typeof(arg) === 'string'; }, isObject: function(arg) { return typeof(arg) === 'object' && arg !== null; }, isNull: function(arg) { return arg === null; }, isNullOrUndefined: function(arg) { return arg == null; } }; },{}],148:[function(require,module,exports){ (function (global){ /** * Module exports. */ module.exports = deprecate; /** * Mark that a method should not be used. * Returns a modified function which warns once by default. * * If `localStorage.noDeprecation = true` is set, then it is a no-op. * * If `localStorage.throwDeprecation = true` is set, then deprecated functions * will throw an Error when invoked. * * If `localStorage.traceDeprecation = true` is set, then deprecated functions * will invoke `console.trace()` instead of `console.error()`. * * @param {Function} fn - the function to deprecate * @param {String} msg - the string to print to the console when `fn` is invoked * @returns {Function} a new "deprecated" version of `fn` * @api public */ function deprecate (fn, msg) { if (config('noDeprecation')) { return fn; } var warned = false; function deprecated() { if (!warned) { if (config('throwDeprecation')) { throw new Error(msg); } else if (config('traceDeprecation')) { console.trace(msg); } else { console.warn(msg); } warned = true; } return fn.apply(this, arguments); } return deprecated; } /** * Checks `localStorage` for boolean values for the given `name`. * * @param {String} name * @returns {Boolean} * @api private */ function config (name) { // accessing global.localStorage can trigger a DOMException in sandboxed iframes try { if (!global.localStorage) return false; } catch (_) { return false; } var val = global.localStorage[name]; if (null == val) return false; return String(val).toLowerCase() === 'true'; } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],149:[function(require,module,exports){ module.exports = function isBuffer(arg) { return arg && typeof arg === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function'; } },{}],150:[function(require,module,exports){ (function (process,global){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var formatRegExp = /%[sdj%]/g; exports.format = function(f) { if (!isString(f)) { var objects = []; for (var i = 0; i < arguments.length; i++) { objects.push(inspect(arguments[i])); } return objects.join(' '); } var i = 1; var args = arguments; var len = args.length; var str = String(f).replace(formatRegExp, function(x) { if (x === '%%') return '%'; if (i >= len) return x; switch (x) { case '%s': return String(args[i++]); case '%d': return Number(args[i++]); case '%j': try { return JSON.stringify(args[i++]); } catch (_) { return '[Circular]'; } default: return x; } }); for (var x = args[i]; i < len; x = args[++i]) { if (isNull(x) || !isObject(x)) { str += ' ' + x; } else { str += ' ' + inspect(x); } } return str; }; // Mark that a method should not be used. // Returns a modified function which warns once by default. // If --no-deprecation is set, then it is a no-op. exports.deprecate = function(fn, msg) { // Allow for deprecating things in the process of starting up. if (isUndefined(global.process)) { return function() { return exports.deprecate(fn, msg).apply(this, arguments); }; } if (process.noDeprecation === true) { return fn; } var warned = false; function deprecated() { if (!warned) { if (process.throwDeprecation) { throw new Error(msg); } else if (process.traceDeprecation) { console.trace(msg); } else { console.error(msg); } warned = true; } return fn.apply(this, arguments); } return deprecated; }; var debugs = {}; var debugEnviron; exports.debuglog = function(set) { if (isUndefined(debugEnviron)) debugEnviron = process.env.NODE_DEBUG || ''; set = set.toUpperCase(); if (!debugs[set]) { if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { var pid = process.pid; debugs[set] = function() { var msg = exports.format.apply(exports, arguments); console.error('%s %d: %s', set, pid, msg); }; } else { debugs[set] = function() {}; } } return debugs[set]; }; /** * Echos the value of a value. Trys to print the value out * in the best way possible given the different types. * * @param {Object} obj The object to print out. * @param {Object} opts Optional options object that alters the output. */ /* legacy: obj, showHidden, depth, colors*/ function inspect(obj, opts) { // default options var ctx = { seen: [], stylize: stylizeNoColor }; // legacy... if (arguments.length >= 3) ctx.depth = arguments[2]; if (arguments.length >= 4) ctx.colors = arguments[3]; if (isBoolean(opts)) { // legacy... ctx.showHidden = opts; } else if (opts) { // got an "options" object exports._extend(ctx, opts); } // set default options if (isUndefined(ctx.showHidden)) ctx.showHidden = false; if (isUndefined(ctx.depth)) ctx.depth = 2; if (isUndefined(ctx.colors)) ctx.colors = false; if (isUndefined(ctx.customInspect)) ctx.customInspect = true; if (ctx.colors) ctx.stylize = stylizeWithColor; return formatValue(ctx, obj, ctx.depth); } exports.inspect = inspect; // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics inspect.colors = { 'bold' : [1, 22], 'italic' : [3, 23], 'underline' : [4, 24], 'inverse' : [7, 27], 'white' : [37, 39], 'grey' : [90, 39], 'black' : [30, 39], 'blue' : [34, 39], 'cyan' : [36, 39], 'green' : [32, 39], 'magenta' : [35, 39], 'red' : [31, 39], 'yellow' : [33, 39] }; // Don't use 'blue' not visible on cmd.exe inspect.styles = { 'special': 'cyan', 'number': 'yellow', 'boolean': 'yellow', 'undefined': 'grey', 'null': 'bold', 'string': 'green', 'date': 'magenta', // "name": intentionally not styling 'regexp': 'red' }; function stylizeWithColor(str, styleType) { var style = inspect.styles[styleType]; if (style) { return '\u001b[' + inspect.colors[style][0] + 'm' + str + '\u001b[' + inspect.colors[style][1] + 'm'; } else { return str; } } function stylizeNoColor(str, styleType) { return str; } function arrayToHash(array) { var hash = {}; array.forEach(function(val, idx) { hash[val] = true; }); return hash; } function formatValue(ctx, value, recurseTimes) { // Provide a hook for user-specified inspect functions. // Check that value is an object with an inspect function on it if (ctx.customInspect && value && isFunction(value.inspect) && // Filter out the util module, it's inspect function is special value.inspect !== exports.inspect && // Also filter out any prototype objects using the circular check. !(value.constructor && value.constructor.prototype === value)) { var ret = value.inspect(recurseTimes, ctx); if (!isString(ret)) { ret = formatValue(ctx, ret, recurseTimes); } return ret; } // Primitive types cannot have properties var primitive = formatPrimitive(ctx, value); if (primitive) { return primitive; } // Look up the keys of the object. var keys = Object.keys(value); var visibleKeys = arrayToHash(keys); if (ctx.showHidden) { keys = Object.getOwnPropertyNames(value); } // IE doesn't make error fields non-enumerable // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { return formatError(value); } // Some type of object without properties can be shortcutted. if (keys.length === 0) { if (isFunction(value)) { var name = value.name ? ': ' + value.name : ''; return ctx.stylize('[Function' + name + ']', 'special'); } if (isRegExp(value)) { return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); } if (isDate(value)) { return ctx.stylize(Date.prototype.toString.call(value), 'date'); } if (isError(value)) { return formatError(value); } } var base = '', array = false, braces = ['{', '}']; // Make Array say that they are Array if (isArray(value)) { array = true; braces = ['[', ']']; } // Make functions say that they are functions if (isFunction(value)) { var n = value.name ? ': ' + value.name : ''; base = ' [Function' + n + ']'; } // Make RegExps say that they are RegExps if (isRegExp(value)) { base = ' ' + RegExp.prototype.toString.call(value); } // Make dates with properties first say the date if (isDate(value)) { base = ' ' + Date.prototype.toUTCString.call(value); } // Make error with message first say the error if (isError(value)) { base = ' ' + formatError(value); } if (keys.length === 0 && (!array || value.length == 0)) { return braces[0] + base + braces[1]; } if (recurseTimes < 0) { if (isRegExp(value)) { return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); } else { return ctx.stylize('[Object]', 'special'); } } ctx.seen.push(value); var output; if (array) { output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); } else { output = keys.map(function(key) { return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); }); } ctx.seen.pop(); return reduceToSingleString(output, base, braces); } function formatPrimitive(ctx, value) { if (isUndefined(value)) return ctx.stylize('undefined', 'undefined'); if (isString(value)) { var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') .replace(/'/g, "\\'") .replace(/\\"/g, '"') + '\''; return ctx.stylize(simple, 'string'); } if (isNumber(value)) return ctx.stylize('' + value, 'number'); if (isBoolean(value)) return ctx.stylize('' + value, 'boolean'); // For some reason typeof null is "object", so special case here. if (isNull(value)) return ctx.stylize('null', 'null'); } function formatError(value) { return '[' + Error.prototype.toString.call(value) + ']'; } function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { var output = []; for (var i = 0, l = value.length; i < l; ++i) { if (hasOwnProperty(value, String(i))) { output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true)); } else { output.push(''); } } keys.forEach(function(key) { if (!key.match(/^\d+$/)) { output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true)); } }); return output; } function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { var name, str, desc; desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; if (desc.get) { if (desc.set) { str = ctx.stylize('[Getter/Setter]', 'special'); } else { str = ctx.stylize('[Getter]', 'special'); } } else { if (desc.set) { str = ctx.stylize('[Setter]', 'special'); } } if (!hasOwnProperty(visibleKeys, key)) { name = '[' + key + ']'; } if (!str) { if (ctx.seen.indexOf(desc.value) < 0) { if (isNull(recurseTimes)) { str = formatValue(ctx, desc.value, null); } else { str = formatValue(ctx, desc.value, recurseTimes - 1); } if (str.indexOf('\n') > -1) { if (array) { str = str.split('\n').map(function(line) { return ' ' + line; }).join('\n').substr(2); } else { str = '\n' + str.split('\n').map(function(line) { return ' ' + line; }).join('\n'); } } } else { str = ctx.stylize('[Circular]', 'special'); } } if (isUndefined(name)) { if (array && key.match(/^\d+$/)) { return str; } name = JSON.stringify('' + key); if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { name = name.substr(1, name.length - 2); name = ctx.stylize(name, 'name'); } else { name = name.replace(/'/g, "\\'") .replace(/\\"/g, '"') .replace(/(^"|"$)/g, "'"); name = ctx.stylize(name, 'string'); } } return name + ': ' + str; } function reduceToSingleString(output, base, braces) { var numLinesEst = 0; var length = output.reduce(function(prev, cur) { numLinesEst++; if (cur.indexOf('\n') >= 0) numLinesEst++; return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; }, 0); if (length > 60) { return braces[0] + (base === '' ? '' : base + '\n ') + ' ' + output.join(',\n ') + ' ' + braces[1]; } return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; } // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. function isArray(ar) { return Array.isArray(ar); } exports.isArray = isArray; function isBoolean(arg) { return typeof arg === 'boolean'; } exports.isBoolean = isBoolean; function isNull(arg) { return arg === null; } exports.isNull = isNull; function isNullOrUndefined(arg) { return arg == null; } exports.isNullOrUndefined = isNullOrUndefined; function isNumber(arg) { return typeof arg === 'number'; } exports.isNumber = isNumber; function isString(arg) { return typeof arg === 'string'; } exports.isString = isString; function isSymbol(arg) { return typeof arg === 'symbol'; } exports.isSymbol = isSymbol; function isUndefined(arg) { return arg === void 0; } exports.isUndefined = isUndefined; function isRegExp(re) { return isObject(re) && objectToString(re) === '[object RegExp]'; } exports.isRegExp = isRegExp; function isObject(arg) { return typeof arg === 'object' && arg !== null; } exports.isObject = isObject; function isDate(d) { return isObject(d) && objectToString(d) === '[object Date]'; } exports.isDate = isDate; function isError(e) { return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error); } exports.isError = isError; function isFunction(arg) { return typeof arg === 'function'; } exports.isFunction = isFunction; function isPrimitive(arg) { return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || typeof arg === 'symbol' || // ES6 symbol typeof arg === 'undefined'; } exports.isPrimitive = isPrimitive; exports.isBuffer = require('./support/isBuffer'); function objectToString(o) { return Object.prototype.toString.call(o); } function pad(n) { return n < 10 ? '0' + n.toString(10) : n.toString(10); } var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; // 26 Feb 16:19:34 function timestamp() { var d = new Date(); var time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(':'); return [d.getDate(), months[d.getMonth()], time].join(' '); } // log is just a thin wrapper to console.log that prepends a timestamp exports.log = function() { console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); }; /** * Inherit the prototype methods from one constructor into another. * * The Function.prototype.inherits from lang.js rewritten as a standalone * function (not on Function.prototype). NOTE: If this file is to be loaded * during bootstrapping this function needs to be rewritten using some native * functions as prototype setup using normal JavaScript does not work as * expected during bootstrapping (see mirror.js in r114903). * * @param {function} ctor Constructor function which needs to inherit the * prototype. * @param {function} superCtor Constructor function to inherit prototype from. */ exports.inherits = require('inherits'); exports._extend = function(origin, add) { // Don't do anything if add isn't an object if (!add || !isObject(add)) return origin; var keys = Object.keys(add); var i = keys.length; while (i--) { origin[keys[i]] = add[keys[i]]; } return origin; }; function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./support/isBuffer":149,"_process":108,"inherits":95}],151:[function(require,module,exports){ var indexOf = require('indexof'); var Object_keys = function (obj) { if (Object.keys) return Object.keys(obj) else { var res = []; for (var key in obj) res.push(key) return res; } }; var forEach = function (xs, fn) { if (xs.forEach) return xs.forEach(fn) else for (var i = 0; i < xs.length; i++) { fn(xs[i], i, xs); } }; var defineProp = (function() { try { Object.defineProperty({}, '_', {}); return function(obj, name, value) { Object.defineProperty(obj, name, { writable: true, enumerable: false, configurable: true, value: value }) }; } catch(e) { return function(obj, name, value) { obj[name] = value; }; } }()); var globals = ['Array', 'Boolean', 'Date', 'Error', 'EvalError', 'Function', 'Infinity', 'JSON', 'Math', 'NaN', 'Number', 'Object', 'RangeError', 'ReferenceError', 'RegExp', 'String', 'SyntaxError', 'TypeError', 'URIError', 'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', 'escape', 'eval', 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'undefined', 'unescape']; function Context() {} Context.prototype = {}; var Script = exports.Script = function NodeScript (code) { if (!(this instanceof Script)) return new Script(code); this.code = code; }; Script.prototype.runInContext = function (context) { if (!(context instanceof Context)) { throw new TypeError("needs a 'context' argument."); } var iframe = document.createElement('iframe'); if (!iframe.style) iframe.style = {}; iframe.style.display = 'none'; document.body.appendChild(iframe); var win = iframe.contentWindow; var wEval = win.eval, wExecScript = win.execScript; if (!wEval && wExecScript) { // win.eval() magically appears when this is called in IE: wExecScript.call(win, 'null'); wEval = win.eval; } forEach(Object_keys(context), function (key) { win[key] = context[key]; }); forEach(globals, function (key) { if (context[key]) { win[key] = context[key]; } }); var winKeys = Object_keys(win); var res = wEval.call(win, this.code); forEach(Object_keys(win), function (key) { // Avoid copying circular objects like `top` and `window` by only // updating existing context properties or new properties in the `win` // that was only introduced after the eval. if (key in context || indexOf(winKeys, key) === -1) { context[key] = win[key]; } }); forEach(globals, function (key) { if (!(key in context)) { defineProp(context, key, win[key]); } }); document.body.removeChild(iframe); return res; }; Script.prototype.runInThisContext = function () { return eval(this.code); // maybe... }; Script.prototype.runInNewContext = function (context) { var ctx = Script.createContext(context); var res = this.runInContext(ctx); forEach(Object_keys(ctx), function (key) { context[key] = ctx[key]; }); return res; }; forEach(Object_keys(Script.prototype), function (name) { exports[name] = Script[name] = function (code) { var s = Script(code); return s[name].apply(s, [].slice.call(arguments, 1)); }; }); exports.createScript = function (code) { return exports.Script(code); }; exports.createContext = Script.createContext = function (context) { var copy = new Context(); if(typeof context === 'object') { forEach(Object_keys(context), function (key) { copy[key] = context[key]; }); } return copy; }; },{"indexof":94}],152:[function(require,module,exports){ module.exports = extend var hasOwnProperty = Object.prototype.hasOwnProperty; function extend() { var target = {} for (var i = 0; i < arguments.length; i++) { var source = arguments[i] for (var key in source) { if (hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target } },{}],153:[function(require,module,exports){ var _require = require //fool browserify module.exports = _require('chloridedown/build/Release/sodium') },{}],154:[function(require,module,exports){ module.exports = require('sodium-browserify') },{"sodium-browserify":367}],155:[function(require,module,exports){ (function (process,Buffer){ if(process.env.CHLORIDE_JS) return module.exports = require('./browser') try { module.exports = require('./bindings') if(process.title == 'electro') { //workaround for electron@1 ??? //I don't understand. var verify = module.exports.crypto_sign_verify_detached module.exports.crypto_sign_verify_detached = function (sig, msg, pk) { //return verify(copy(sig), copy(msg), copy(pk)) return module.exports.crypto_sign_open(Buffer.concat([sig, msg]), pk) //console.log(sig, msg, pk) // return verify(new Buffer(sig), new Buffer(msg), new Buffer(pk)) } } } catch (err) { console.error('error loading sodium bindings:', err.message) console.error('falling back to javascript version.') module.exports = require('./browser') } }).call(this,require('_process'),require("buffer").Buffer) },{"./bindings":153,"./browser":154,"_process":108,"buffer":47}],156:[function(require,module,exports){ var URL = require('url') module.exports = function () { var remote = 'undefined' === typeof localStorage ? null //'ws://localhost:8989~shs:' + require('./keys') : localStorage.remote //TODO: use _several_ remotes, so if one goes down, // you can still communicate via another... // also, if a blob does not load, use another pub... //if we are the light client, get our blobs from the same domain. var blobsUrl if(remote) { var r = URL.parse(remote.split('~')[0]) //this will work for ws and wss. r.protocol = r.protocol.replace('ws', 'http') r.pathname = '/blobs/get' blobsUrl = URL.format(r) } else blobsUrl = 'http://localhost:8989/blobs/get' return { remote: remote, blobsUrl: blobsUrl } } },{"url":146}],157:[function(require,module,exports){ (function (process){ var h = require('hyperscript') var u = require('./util') var pull = require('pull-stream') var combine = require('depject') var path = require('path') var SbotApi = require('./sbot-api') var modules = require('./modules') var renderers = [] var app = [] //var App = require('./plugs').first(app) var u = require('./util') //modules.unshift(SbotApi()) //modules.unshift({app: app}) //var indexes = fs.readdirSync(path.join(__dirname, 'modules')) //var i = indexes.indexOf('index.js') //indexes.splice(i, 1) //var sv = [], screen_view = require('./plugs').first(sv) //modules['main.js' ] = { // screen_view: sv, // app: function () { // return h('div.row', // screen_view('/public'), // screen_view('/private') // ) // } //} modules['app.js'] = {app: []} modules['sbot-api.js'] = SbotApi() modules['tabs.js'] combine(modules) //, ['app', 'sbot'].concat(indexes) ) if(process.title === 'node') { console.log(require('depject/graph')(modules)) process.exit(0) } document.head.appendChild( h('style', "body {\n font-family: \"Source Sans Pro\", sans-serif;\n}\n\n.screen {\n position: absolute;\n top: 0px; bottom: 0px;\n left: 0px; right: 0px;\n overflow-y: hidden;\n}\n\n.column {\n display: flex;\n flex-direction: column;\n background: #f5f5f5;\n min-height: 0px;\n}\n\n.row {\n display: flex;\n flex-direction: row;\n}\n\n.stretch {\n flex-basis: 0;\n}\n\n.fixed {\n flex-grow: 1;\n flex-shrink: 1;\n}\n\n.scroll-y {\n overflow-y: auto;\n}\n\n.scroll-x {\n overflow-x: auto;\n}\n\n.button {\n border: 2px; margin: 3px;\n max-width: 50px;\n overflow-x: hidden;\n}\n\n\nimg {\n max-width: 100%;\n display: block;\n}\n\npre {\n max-width: 650px;\n white-space: pre-wrap;\n}\n\n/* scrolling feeds, threads */\n\n.scroller {\n width: 100%;\n}\n\n.scroller > * {\n margin-left: auto;\n margin-right: auto;\n}\n\n.scroller__wrapper {\n width: 100%;\n}\n\n@media (min-width: 600px) {\n .scroller__wrapper {\n width: 600px;\n }\n}\n\n\n/* --- hypertabs ------- */\n\n.hypertabs__tabs {\n overflow-y: hide;\n}\n\n.hypertabs > .row {\n flex-grow: 0; flex-shrink: 0;\n margin: 10px;\n}\n\n.hypertabs__tabs > * {\n max-width: 50px;\n overflow-x: hidden;\n margin-right: 5px;\n padding-top: 1px;\n}\n\n.hypertabs--selected {\n background: white;\n border: 1px solid #ccc;\n padding-top: 0;\n padding-left: 5px;\n padding-right: 5px;\n max-width: 200px;\n}\n\n/* message id */\n\ninput {\n margin-left: 3px;\n margin-right: 3px;\n border: 1px solid #eee;\n}\n\ntextarea {\n border: 1px solid #eee;\n}\n\n/* compose */\n\n.compose {\n width: 100%;\n}\n\n/* messages */\n\n.message {\n border: 1px solid #eee;\n padding: 5px;\n margin-top: .5em;\n background: white;\n display: block;\n flex-basis: 0;\n max-width: 100%;\n min-width: 300px;\n word-wrap:break-word; \n display:inline-block;\n}\n\n.message_meta input {\n border: none;\n font-size: .8em;\n color: #666;\n background: #ddd;\n}\n\n.message_meta {\n margin-left: auto;\n}\n.message_meta > * {\n margin-left: 5px;\n}\n.message_actions {\n float: right;\n}\n\n.dig {\n border-right: 2px solid #eee;\n padding-right: .6ex;\n margin-right: .1ex;\n}\n\n.message > .title > .avatar {\n margin-left: 0;\n}\n\n.message_content {\n margin-top: 5px;\n border-top: 1px solid #eee;\n padding-top: 3px;\n}\n\n/* -- suggest box */\n\n\n.suggest-box > * {\n background: #f5f5f5;\n border: 1px solid #ccc;\n margin: 3px;\n}\n\n.suggest-box {\n width: 200px;\n}\n\n.suggest-box ul {\n list-style-type: none;\n padding-left: -20px;\n}\n\n.suggest-box .selected {\n background: #ccc;\n}\n\n.suggest-box img {\n width: 40px;\n}\n.suggest-box,.selected img {\n width: 200px;\n}\n/* avatar */\n\n.avatar {\n display: flex;\n flex-direction: row;\n}\n.avatar img {\n width: 40px;\n height: 40px;\n margin-right: 3px;\n border: 1px solid #ccc;\n}\n\n.profile {\n background: #fff;\n border: 1px solid #eee;\n}\n\n.profile img {\n width: 150px;\n height: 150px;\n margin-right: 1em;\n margin-bottom: 1em;\n border: 1px solid #ccc;\n}\n\n/* lightbox - used in message-confirm */\n\n.lightbox {\n overflow: auto;\n background: #fff;\n width: 600px;\n border: 1px solid #eee;\n top: 2em;\n bottom: 2em;\n left: 2em;\n right: 2em;\n padding: 1em;\n}\n\n.message-confirm {\n background: #fff;\n} \n\n/* searchprompt */\n\n.searchprompt {\n width: 250px;\n margin-left: 10px;\n margin-bottom: 5px;\n}\n\na {\n color: #333;\n}\n\na:hover {\n color: #000;\n}\n\n/* TextNodeSearcher highlights */\n\nhighlight {\n background: yellow;\n}\n\n" )) console.log(modules['app.js']) document.body.appendChild(h('div.screen.column', modules['app.js'].app[0]())) }).call(this,require('_process')) },{"./modules":173,"./sbot-api":363,"./util":365,"_process":108,"depject":218,"depject/graph":217,"hyperscript":223,"path":105,"pull-stream":284}],158:[function(require,module,exports){ (function (process){ var config = require('ssb-config/inject')(process.env.ssb_appname) var ssbKeys = require('ssb-keys') var path = require('path') module.exports = ssbKeys.loadOrCreateSync(path.join(config.path, 'secret')) }).call(this,require('_process')) },{"_process":108,"path":105,"ssb-config/inject":333,"ssb-keys":337}],159:[function(require,module,exports){ module.exports = function (container) { var curMsgEl if (!container) return function() {} container.addEventListener('click', onActivateChild, false) container.addEventListener('focus', onActivateChild, true) function onActivateChild(ev) { for (var el = ev.target; el; el = el.parentNode) { if (el.parentNode == container) { curMsgEl = el return } } } function selectChild(el) { if (!el) return (el.scrollIntoViewIfNeeded || el.scrollIntoView).call(el) el.focus() curMsgEl = el } return function scroll(d) { selectChild(!curMsgEl ? container.firstChild : d > 0 ? curMsgEl.nextElementSibling || container.lastChild : d < 0 ? curMsgEl.previousElementSibling || container.firstChild : curMsgEl) } } },{}],160:[function(require,module,exports){ module.exports={ "auth": "async", "address": "sync", "manifest": "sync", "get": "async", "createFeedStream": "source", "createLogStream": "source", "messagesByType": "source", "createHistoryStream": "source", "createUserStream": "source", "links": "source", "relatedMessages": "async", "add": "async", "publish": "async", "getAddress": "sync", "getLatest": "async", "latest": "source", "latestSequence": "async", "whoami": "sync", "usage": "sync", "gossip": { "peers": "sync", "add": "sync", "ping": "duplex", "connect": "async", "changes": "source", "reconnect": "sync" }, "friends": { "all": "async", "hops": "async", "createFriendStream": "source", "get": "sync" }, "replicate": { "changes": "source" }, "invite": { "create": "async", "accept": "async", "use": "async" }, "block": { "isBlocked": "sync" }, "private": { "publish": "async", "unbox": "sync" }, "plugins": { "install": "source", "uninstall": "source", "enable": "async", "disable": "async" }, "notifier": {}, "patchwork": { "createEventStream": "source", "getIndexCounts": "async", "createInboxStream": "source", "createBookmarkStream": "source", "createMentionStream": "source", "createNoticeStream": "source", "createPrivatePostStream": "source", "createPublicPostStream": "source", "createChannelStream": "source", "createSearchStream": "source", "markRead": "async", "markUnread": "async", "markAllRead": "async", "toggleRead": "async", "isRead": "async", "bookmark": "async", "unbookmark": "async", "toggleBookmark": "async", "isBookmarked": "async", "getChannels": "async", "pinChannel": "async", "unpinChannel": "async", "toggleChannelPinned": "async", "watchChannel": "async", "unwatchChannel": "async", "toggleChannelWatched": "async", "addFileToBlobs": "async", "saveBlobToFile": "async", "useLookupCode": "source", "getMyProfile": "async", "getProfile": "async", "getAllProfiles": "async", "getNamesById": "async", "getIdsByName": "async", "getName": "async", "getActionItems": "async" }, "blobs": { "get": "source", "add": "sink", "ls": "source", "has": "async", "size": "async", "meta": "async", "want": "async", "push": "async", "changes": "source", "createWants": "source" }, "links2": { "read": "source", "dump": "source" }, "query": { "read": "source", "dump": "source" }, "ws": {} } },{}],161:[function(require,module,exports){ //this is just an UGLY HACK, because depject does not //support recursion... var sv = require('../plugs').first(exports.screen_view = []) exports._screen_view = function (value) { return sv(value) } },{"../plugs":362}],162:[function(require,module,exports){ var h = require('hyperscript') function idLink (id) { return h('a', {href:'#'+id}, id) } function asLink (ln) { return 'string' === typeof ln ? ln : ln.link } var blob_url = require('../plugs').first(exports.blob_url = []) exports.message_content = function (msg) { if(msg.value.content.type !== 'about') return if(!msg.value.content.image && !msg.value.content.name) return var about = msg.value.content var id = msg.value.content.about return h('p', about.about === msg.value.author ? h('span', 'self-identifies ') : h('span', 'identifies ', idLink(id)), ' as ', h('a', {href:"#"+about.about}, about.name || null, about.image ? h('img', {src: blob_url(about.image)}) : null ) ) } },{"../plugs":362,"hyperscript":223}],163:[function(require,module,exports){ var getAvatar = require('ssb-avatar') var h = require('hyperscript') var ref = require('ssb-ref') var plugs = require('../plugs') var sbot_links = plugs.first(exports.sbot_links = []) var blob_url = require('../plugs').first(exports.blob_url = []) var id = require('../keys').id var default_avatar = '&qjeAs8+uMXLlyovT4JnEpMwTNDx/QXHfOl2nv2u0VCM=.sha256' exports.avatar_image = function (author) { var img = h('img', {src: blob_url(default_avatar)}) getAvatar({links: sbot_links}, id, author, function (err, avatar) { if (err) return console.error(err) if(ref.isBlob(avatar.image)) img.src = blob_url(avatar.image) }) return img } },{"../keys":158,"../plugs":362,"hyperscript":223,"ssb-avatar":331,"ssb-ref":348}],164:[function(require,module,exports){ var h = require('hyperscript') var plugs = require('../plugs') var avatar_image = plugs.first(exports.avatar_image = []) var avatar_action = plugs.map(exports.avatar_action = []) exports.avatar_profile = function (id) { return h('div.row.profile', avatar_image(id), h('div.column', avatar_action(id)) ) } },{"../plugs":362,"hyperscript":223}],165:[function(require,module,exports){ var h = require('hyperscript') var u = require('../util') var plugs = require('../plugs') var avatar_name = plugs.first(exports.avatar_name = []) var avatar_image = plugs.first(exports.avatar_image = []) exports.avatar = function (author) { return h('a.avatar', {href:'#'+author}, avatar_image(author), avatar_name(author) ) } },{"../plugs":362,"../util":365,"hyperscript":223}],166:[function(require,module,exports){ var config = require('../config') exports.blob_url = function (link) { if('string' == typeof link.link) link = link.link return config().blobsUrl + '/'+link } },{"../config":156}],167:[function(require,module,exports){ var h = require('hyperscript') var u = require('../util') var pull = require('pull-stream') var Scroller = require('pull-scroll') var plugs = require('../plugs') var message_render = plugs.first(exports.message_render = []) var message_compose = plugs.first(exports.message_compose = []) var sbot_log = plugs.first(exports.sbot_log = []) var sbot_query = plugs.first(exports.sbot_query = []) exports.message_meta = function (msg) { var chan = msg.value.content.channel if (chan) return h('a', {href: '##'+chan}, '#'+chan) } exports.screen_view = function (path) { if(path[0] === '#') { var channel = path.substr(1) var content = h('div.column.scroller__content') var div = h('div.column.scroller', {style: {'overflow':'auto'}}, h('div.scroller__wrapper', message_compose({type: 'post', channel: channel}), content ) ) function matchesChannel(msg) { if (msg.sync) console.error('SYNC', msg) var c = msg && msg.value && msg.value.content return c && c.channel === channel } pull( sbot_log({old: false}), pull.filter(matchesChannel), Scroller(div, content, message_render, true, false) ) pull( sbot_query({reverse: true, query: [ {$filter: {value: {content: {channel: channel}}}} ]}), Scroller(div, content, message_render, false, false) ) return div } } },{"../plugs":362,"../util":365,"hyperscript":223,"pull-scroll":283,"pull-stream":284}],168:[function(require,module,exports){ var h = require('hyperscript') var u = require('../util') var suggest = require('suggest-box') var cont = require('cont') var mentions = require('ssb-mentions') var lightbox = require('hyperlightbox') var plugs = require('../plugs') //var suggest = plugs.map(exports.suggest = []) var publish = plugs.first(exports.sbot_publish = []) var message_content = plugs.first(exports.message_content = []) var message_confirm = plugs.first(exports.message_confirm = []) var file_input = plugs.first(exports.file_input = []) exports.suggest = [] function id (e) { return e } exports.message_compose = function (meta, prepublish, cb) { if('function' !== typeof prepublish) sbot = prepublish, prepublish = id var accessories meta = meta || {} if(!meta.type) throw new Error('message must have type') var ta = h('textarea') var blur ta.addEventListener('focus', function () { clearTimeout(blur) ta.style.height = '200px' accessories.style.display = 'block' }) ta.addEventListener('blur', function () { //don't shrink right away, so there is time //to click the publish button. clearTimeout(blur) blur = setTimeout(function () { if(ta.value) return ta.style.height = '50px' accessories.style.display = 'none' }, 200) }) ta.addEventListener('keydown', function (ev) { if(ev.keyCode === 13 && ev.ctrlKey) publish() }) var files = [] function publish() { var content try { content = JSON.parse(ta.value) } catch (err) { meta.text = ta.value meta.mentions = mentions(ta.value).concat(files) try { meta = prepublish(meta) } catch (err) { return alert(err.message) } return message_confirm(meta, done) } message_confirm(content, done) function done (err, msg) { if(err) return alert(err.stack) else ta.value = '' if (cb) cb(err, msg) } } var composer = h('div.compose', h('div.column', ta, accessories = h('div.row.compose__controls', //hidden until you focus the textarea {style: {display: 'none'}}, file_input(function (file) { files.push(file) var embed = file.type.indexOf('image/') === 0 ? '!' : '' ta.value += embed + '['+file.name+']('+file.link+')' console.log('added:', file) }), h('button', 'Publish', {onclick: publish})) ) ) suggest(ta, function (word, cb) { cont.para(exports.suggest.map(function (fn) { return function (cb) { fn(word, cb) } })) (function (err, results) { if(err) console.error(err) results = results.reduce(function (ary, item) { return ary.concat(item) }, []).sort(function (a, b) { return b.rank - a.rank }).filter(Boolean) cb(null, results) }) }, {}) return composer } },{"../plugs":362,"../util":365,"cont":197,"hyperlightbox":222,"hyperscript":223,"ssb-mentions":346,"suggest-box":356}],169:[function(require,module,exports){ var ref = require('ssb-ref') var keys = require('../keys') var ssbKeys = require('ssb-keys') function unbox_value(msg) { var plaintext = ssbKeys.unbox(msg.content, keys) if(!plaintext) return null return { previous: msg.previous, author: msg.author, sequence: msg.sequence, timestamp: msg.timestamp, hash: msg.hash, content: plaintext, private: true } } var sbot_publish = require('../plugs').first(exports.sbot_publish = []) exports.message_unbox = function (msg) { if(msg.value) { var value = unbox_value(msg.value) if(value) return { key: msg.key, value: value, timestamp: msg.timestamp } } else return unbox_value(msg) } exports.message_box = function (content) { return ssbKeys.box(content, content.recps.map(function (e) { return ref.isFeed(e) ? e : e.link })) } exports.publish = function (content, id) { if(content.recps) content = exports.message_box(content) sbot_publish(content, function (err, msg) { if(err) throw err console.log('PUBLISHED', msg) }) } },{"../keys":158,"../plugs":362,"ssb-keys":337,"ssb-ref":348}],170:[function(require,module,exports){ var ref = require('ssb-ref') var ui = require('../ui') var Scroller = require('pull-scroll') var h = require('hyperscript') var pull = require('pull-stream') var u = require('../util') var plugs = require('../plugs') var sbot_user_feed = plugs.first(exports.sbot_user_feed = []) var message_render = plugs.first(exports.message_render = []) var avatar_profile = plugs.first(exports.avatar_profile = []) exports.screen_view = function (id) { //TODO: header of user info, avatars, names, follows. if(ref.isFeed(id)) { var content = h('div.column.scroller__content') var div = h('div.column.scroller', {style: {'overflow':'auto'}}, h('div.scroller__wrapper', h('div', avatar_profile(id)), content ) ) pull( sbot_user_feed({id: id, old: false, live: true}), Scroller(div, content, message_render, true, false) ) //how to handle when have scrolled past the start??? pull( u.next(sbot_user_feed, { id: id, reverse: true, limit: 50, live: false }, ['value', 'sequence']), Scroller(div, content, message_render, false, false) ) return div } } },{"../plugs":362,"../ui":364,"../util":365,"hyperscript":223,"pull-scroll":283,"pull-stream":284,"ssb-ref":348}],171:[function(require,module,exports){ (function (Buffer){ var u = require('../util') var h = require('hyperscript') var pull = require('pull-stream') var mime = require('mime-types') var split = require('split-buffer') var plugs = require('../plugs') var add = plugs.first(exports.sbot_blobs_add = []) exports.file_input = function FileInput(onAdded) { return h('input', { type: 'file', onchange: function (ev) { var file = ev.target.files[0] var reader = new FileReader() reader.onload = function () { pull( pull.values(split(new Buffer(reader.result), 64*1024)), add(function (err, blob) { if(err) return console.error(err) onAdded({ link: blob, name: file.name, size: reader.result.length || reader.result.byteLength, type: mime.contentType(file.name) }) }) ) } reader.readAsArrayBuffer(file) } }) } }).call(this,require("buffer").Buffer) },{"../plugs":362,"../util":365,"buffer":47,"hyperscript":223,"mime-types":237,"pull-stream":284,"split-buffer":330}],172:[function(require,module,exports){ var h = require('hyperscript') var u = require('../util') var avatar = require('../plugs').first(exports.avatar = []) var pull = require('pull-stream') var plugs = require('../plugs') //render a message when someone follows someone, //so you see new users exports.message_content = function (msg) { if(msg.value.content.type == 'contact' && msg.value.content.contact) { return h('div.contact', 'follows', avatar(msg.value.content.contact) ) } } var sbot_links2 = plugs.first(exports.sbot_links2 = []) var message_confirm = plugs.first(exports.message_confirm = []) function follows (source, dest, cb) { pull( sbot_links2({query:[ {$filter: { source: source, dest: dest, rel: ['contact', {$gt: null}] }}, {$map: { timestamp: 'timestamp', follows: ["rel", 1] }} ]}), pull.collect(function (err, ary) { if(err) return cb(err) cb(null, ary.length ? ary.sort(function (a, b) { return a.timestamp - b.timestamp }).pop().follows : false ) }) ) } exports.avatar_action = function (id) { var follows_you, you_follow var self_id = require('../keys').id follows(self_id, id, function (err, f) { you_follow = f update() }) follows(id, self_id, function (err, f) { follows_you = f update() }) var state = h('label') var label = h('label') function update () { state.textContent = ( follows_you && you_follow ? 'friend' : follows_you ? 'follows you' : you_follow ? 'you follow' : '' ) label.textContent = you_follow ? 'unfollow' : 'follow' } return h('div', state, h('a', {href:'#', onclick: function () { message_confirm({ type: 'contact', contact: id, following: !you_follow }, function (err) { //TODO: update after following. }) }}, h('br'), label) ) } },{"../keys":158,"../plugs":362,"../util":365,"hyperscript":223,"pull-stream":284}],173:[function(require,module,exports){ module.exports = { "_screen_view.js": require('./_screen_view.js'), "about.js": require('./about.js'), "avatar-image.js": require('./avatar-image.js'), "avatar-profile.js": require('./avatar-profile.js'), "avatar.js": require('./avatar.js'), "blob-url.js": require('./blob-url.js'), "channel.js": require('./channel.js'), "compose.js": require('./compose.js'), "crypto.js": require('./crypto.js'), "feed.js": require('./feed.js'), "file-input.js": require('./file-input.js'), "follow.js": require('./follow.js'), "invite.js": require('./invite.js'), "like.js": require('./like.js'), "markdown.js": require('./markdown.js'), "message-confirm.js": require('./message-confirm.js'), "message-link.js": require('./message-link.js'), "message-name.js": require('./message-name.js'), "message.js": require('./message.js'), "names.js": require('./names.js'), "notifications.js": require('./notifications.js'), "post.js": require('./post.js'), "private.js": require('./private.js'), "public.js": require('./public.js'), "search-box.js": require('./search-box.js'), "search.js": require('./search.js'), "split.js": require('./split.js'), "suggest-mentions.js": require('./suggest-mentions.js'), "suggest.js": require('./suggest.js'), "tabs.js": require('./tabs.js'), "thread.js": require('./thread.js'), "timestamp.js": require('./timestamp.js') } },{"./_screen_view.js":161,"./about.js":162,"./avatar-image.js":163,"./avatar-profile.js":164,"./avatar.js":165,"./blob-url.js":166,"./channel.js":167,"./compose.js":168,"./crypto.js":169,"./feed.js":170,"./file-input.js":171,"./follow.js":172,"./invite.js":174,"./like.js":175,"./markdown.js":176,"./message-confirm.js":177,"./message-link.js":178,"./message-name.js":179,"./message.js":180,"./names.js":181,"./notifications.js":182,"./post.js":183,"./private.js":184,"./public.js":185,"./search-box.js":186,"./search.js":187,"./split.js":188,"./suggest-mentions.js":189,"./suggest.js":190,"./tabs.js":191,"./thread.js":192,"./timestamp.js":193}],174:[function(require,module,exports){ (function (process){ var ref = require('ssb-ref') var ssbClient = require('ssb-client') var id = require('../keys').id var h = require('hyperscript') var plugs = require('../plugs') var sbot_publish = plugs.first(exports.sbot_publish = []) exports.screen_view = function (invite) { //check that invite is // ws:...~shs:key:seed var parts = invite.split('~') .map(function (e) { return e.split(':') }) if(parts.length !== 2) return null if(!/^(net|wss?)$/.test(parts[0][0])) return null if(parts[1][0] !== 'shs') return null if(parts[1].length !== 3) return null //connect to server //request follow //post pub announce //post follow pub var progress = h('h1') var status = h('pre') var div = h('div', progress, status, h('a', 'accept', {href: '#', onclick: function (ev) { ev.preventDefault() ev.stopPropagation() attempt() return false }}) ) function attempt () { progress.textContent = '*' status.textContent = 'connecting...' console.log("CONNECT", invite) ssbClient(null, { remote: invite, manifest: { invite: {use: 'async'}, getAddress: 'async' } }, function (err, sbot) { console.log("ERR?", err, sbot) if(err) { progress.textContent = '*!' status.textContent = err.stack return } progress.textContent = '**' status.textContent = 'requesting follow...' + id sbot.invite.use({feed: id}, function (err, msg) { if(err) { progress.textContent = '**!' status.textContent = err.stack return } progress.textContent = '***' status.textContent = 'following...' //remove the seed from the shs address. //then it's correct address. //this should make the browser connect to this as remote. //we don't want to do this if when using this locally, though. if(process.title === 'browser') { var p2 = invite.split(':') p2.pop() localStorage.remote = p2.join(':') } sbot_publish({ type: 'contact', contact: sbot.id, following: true }, function (err) { if(err) { progress.textContent = '***!' status.textContent = err.stack return } progress.textContent = '****' status.textContent = 'READY!' }) }) }) } return div } }).call(this,require('_process')) },{"../keys":158,"../plugs":362,"_process":108,"hyperscript":223,"ssb-client":332,"ssb-ref":348}],175:[function(require,module,exports){ var h = require('hyperscript') var u = require('../util') var pull = require('pull-stream') var plugs = require('../plugs') var message_confirm = plugs.first(exports.message_confirm = []) var message_link = plugs.first(exports.message_link = []) var sbot_links = plugs.first(exports.sbot_links = []) exports.message_content = function (msg, sbot) { if(msg.value.content.type !== 'vote') return var link = msg.value.content.vote.link return h('div', msg.value.content.vote.value > 0 ? 'Dug' : 'Undug', ' ', message_link(link) ) } exports.message_meta = function (msg, sbot) { var digs = h('a') pull( sbot_links({dest: msg.key, rel: 'vote'}), pull.collect(function (err, votes) { if(votes.length === 1) digs.textContent = ' 1 Dig' if(votes.length > 1) digs.textContent = ' ' + votes.length + ' Digs' }) ) return digs } exports.message_action = function (msg, sbot) { if(msg.value.content.type !== 'vote') return h('a.dig', {href: '#', onclick: function () { var dig = { type: 'vote', vote: { link: msg.key, value: 1, expression: 'Dig' } } if(msg.value.content.recps) { dig.recps = msg.value.content.recps.map(function (e) { return e && typeof e !== 'string' ? e.link : e }) dig.private = true } //TODO: actually publish... message_confirm(dig) }}, 'Dig') } },{"../plugs":362,"../util":365,"hyperscript":223,"pull-stream":284}],176:[function(require,module,exports){ var markdown = require('ssb-markdown') var h = require('hyperscript') var ref = require('ssb-ref') // var blob_url = require('../plugs').first(exports.blob_url = []) exports.markdown = function (content) { if('string' === typeof content) content = {text: content} //handle patchwork style mentions. var mentions = {} if(Array.isArray(content.mentions)) content.mentions.forEach(function (link) { if(link.name) mentions["@"+link.name] = link.link }) var md = h('div.markdown') md.innerHTML = markdown.block(content.text, { toUrl: function (id) { if(ref.isBlob(id)) return blob_url(id) return '#'+(mentions[id]?mentions[id]:id) } }) return md } },{"../plugs":362,"hyperscript":223,"ssb-markdown":344,"ssb-ref":348}],177:[function(require,module,exports){ var lightbox = require('hyperlightbox') var h = require('hyperscript') var u = require('../util') //publish or add var plugs = require('../plugs') var publish = plugs.first(exports.sbot_publish = []) var message_content = plugs.first(exports.message_content = []) exports.message_confirm = function (content, cb) { cb = cb || function () {} var lb = lightbox() document.body.appendChild(lb) var okay = h('button', 'okay', {onclick: function () { publish(content); lb.remove(); cb(null, content) }}) var cancel = h('button', 'cancel', {onclick: function () { lb.remove() }}) okay.addEventListener('keydown', function (ev) { if(ev.keyCode === 27) cancel.click() //escape }) lb.show(h('div.column.message-confirm', message_content({key: "DRAFT", value: {content: content}}) || h('pre', JSON.stringify(content, null, 2)), h('div.row.message-confirm__controls', okay, cancel) )) okay.focus() } },{"../plugs":362,"../util":365,"hyperlightbox":222,"hyperscript":223}],178:[function(require,module,exports){ var h = require('hyperscript') var sbot_get = require('../plugs').first(exports.sbot_get = []) exports.message_link = function (id) { if('string' !== typeof id) throw new Error('link must be to message id') var link = h('a', {href: '#'+id}, id.substring(0, 10)+'...') sbot_get(id, function (err, value) { if(err) { if (err.name == 'NotFoundError') link.textContent += ' (missing)' else console.error(err) return } if(value.content.text) link.textContent = value.content.text.substring(0, 40)+'...' }) return link } },{"../plugs":362,"hyperscript":223}],179:[function(require,module,exports){ var sbot_get = require('../plugs').first(exports.sbot_get = []) exports.message_name = function (id) { sbot_get(id, function (err, value) { }) } },{"../plugs":362}],180:[function(require,module,exports){ var h = require('hyperscript') var u = require('../util') var pull = require('pull-stream') var plugs = require('../plugs') var message_content = plugs.first(exports.message_content = []) var avatar = plugs.first(exports.avatar = []) var message_meta = plugs.map(exports.message_meta = []) var message_action = plugs.map(exports.message_action = []) var message_link = plugs.first(exports.message_link = []) var sbot_links = plugs.first(exports.sbot_links = []) exports.message_render = function (msg, sbot) { var el = message_content(msg) if(!el) return var backlinks = h('div.backlinks') pull( sbot_links({dest: msg.key, rel: 'mentions', keys: true}), pull.collect(function (err, links) { if(links.length) backlinks.appendChild(h('label', 'backlinks:', h('div', links.map(function (link) { return message_link(link.key) })) )) }) ) var msg = h('div.message', h('div.title.row', h('div.avatar', avatar(msg.value.author)), h('div.message_meta.row', message_meta(msg)) ), h('div.message_content', el), h('div.message_actions.row', h('div.actions', message_action(msg), ' ', h('a', {href: '#' + msg.key}, 'Reply') ) ), backlinks, {onkeydown: function (ev) { //on enter, hit first meta. if(ev.keyCode == 13) { msg.querySelector('.enter').click() } }} ) // ); hyperscript does not seem to set attributes correctly. msg.setAttribute('tabindex', '0') return msg } },{"../plugs":362,"../util":365,"hyperscript":223,"pull-stream":284}],181:[function(require,module,exports){ var h = require('hyperscript') var pull = require('pull-stream') function all(stream, cb) { pull(stream, pull.collect(cb)) } var plugs = require('../plugs') var getAvatar = require('ssb-avatar') var sbot_links2 = plugs.first(exports.sbot_links2 = []) var sbot_links = plugs.first(exports.sbot_links = []) exports.avatar_name = function name (id) { var n = h('span', id.substring(0, 10)) //choose the most popular name for this person. //for anything like this you'll see I have used sbot.links2 //which is the ssb-links plugin. as you'll see the query interface //is pretty powerful! //TODO: "most popular" name is easily gameable. //must come up with something better than this. /* filter(rel: ['mentions', prefix('@')]) .reduce(name: rel[1], value: count()) */ var self_id = require('../keys').id all( sbot_links2({query: [ {$filter: {rel: ['mentions', {$prefix: '@'}], dest: id}}, {$reduce: { name: ['rel', 1], count: {$count: true} }} ]}), function (err, names) { if(err) console.error(err), names = [] //if they have not been mentioned, fallback //to patchwork style naming (i.e. self id) if(!names.length) return getAvatar({links: sbot_links}, self_id, id, function (err, avatar) { if (err) return console.error(err) n.textContent = (avatar.name[0] == '@' ? '' : '@') + avatar.name }) n.textContent = names.reduce(function (max, item) { return max.count > item.count || item.name == '@' ? max : item }, {name: id.substring(0, 10), count: 0}).name }) return n } },{"../keys":158,"../plugs":362,"hyperscript":223,"pull-stream":284,"ssb-avatar":331}],182:[function(require,module,exports){ var h = require('hyperscript') var u = require('../util') var pull = require('pull-stream') var Scroller = require('pull-scroll') var paramap = require('pull-paramap') var plugs = require('../plugs') var cont = require('cont') var message_render = plugs.first(exports.message_render = []) var sbot_log = plugs.first(exports.sbot_log = []) var sbot_get = plugs.first(exports.sbot_get = []) var sbot_user_feed = plugs.first(exports.sbot_user_feed = []) var message_unbox = plugs.first(exports.message_unbox = []) function unbox() { return pull( pull.map(function (msg) { return msg.value && 'string' === typeof msg.value.content ? message_unbox(msg) : msg }), pull.filter(Boolean) ) } function notifications(ourIds) { function linksToUs(link) { return link && link.link in ourIds } function isOurMsg(id, cb) { sbot_get(id, function (err, msg) { if (err && err.name == 'NotFoundError') cb(null, false) else if (err) cb(err) else cb(err, msg.author in ourIds) }) } return paramap(function (msg, cb) { var c = msg.value && msg.value.content if (!c || typeof c !== 'object') return cb() if (msg.value.author in ourIds) return cb() if (c.mentions && Array.isArray(c.mentions) && c.mentions.some(linksToUs)) return cb(null, msg) if (msg.private) return cb(null, msg) switch (c.type) { case 'post': if (c.branch || c.root) cont.para([].concat(c.branch, c.root).map(function (id) { return function (cb) { isOurMsg(id, cb) } })) (function (err, results) { if (err) cb(err) else if (results.some(Boolean)) cb(null, msg) else cb() }) else return cb() case 'contact': return cb(null, c.contact in ourIds ? msg : null) case 'vote': if (c.vote && c.vote.link) return isOurMsg(c.vote.link, function (err, isOurs) { cb(err, isOurs ? msg : null) }) else return cb() default: cb() } }, 4) } function getFirstMessage(feedId, cb) { sbot_user_feed({id: feedId, gte: 0, limit: 1})(null, cb) } exports.screen_view = function (path) { if(path === '/notifications') { var ids = {} var oldest var id = require('../keys').id ids[id] = true getFirstMessage(id, function (err, msg) { if (err) return console.error(err) if (!oldest || msg.value.timestamp < oldest) { oldest = msg.value.timestamp } }) var content = h('div.column.scroller__content') var div = h('div.column.scroller', {style: {'overflow':'auto'}}, h('div.scroller__wrapper', content ) ) pull( sbot_log({old: false}), unbox(), notifications(ids), pull.filter(), Scroller(div, content, message_render, true, false) ) pull( u.next(sbot_log, {reverse: true, limit: 100, live: false}), unbox(), notifications(ids), pull.filter(), pull.take(function (msg) { // abort stream after we pass the oldest messages of our feeds return !oldest || msg.value.timestamp > oldest }), Scroller(div, content, message_render, false, false) ) return div } } },{"../keys":158,"../plugs":362,"../util":365,"cont":197,"hyperscript":223,"pull-paramap":277,"pull-scroll":283,"pull-stream":284}],183:[function(require,module,exports){ var markdown = require('ssb-markdown') var h = require('hyperscript') var u = require('../util') var ref = require('ssb-ref') //render a message var plugs = require('../plugs') var message_link = plugs.first(exports.message_link = []) var markdown = plugs.first(exports.markdown = []) exports.message_content = function (data) { if(!data.value.content || !data.value.content.text) return var root = data.value.content.root var re = !root ? null : h('span', 're: ', message_link(root)) return h('div', re, markdown(data.value.content) ) } },{"../plugs":362,"../util":365,"hyperscript":223,"ssb-markdown":344,"ssb-ref":348}],184:[function(require,module,exports){ (function (process){ var h = require('hyperscript') var ui = require('../ui') var u = require('../util') var pull = require('pull-stream') var Scroller = require('pull-scroll') var ref = require('ssb-ref') var plugs = require('../plugs') var message_render = plugs.first(exports.message_render = []) var message_compose = plugs.first(exports.message_compose = []) var message_unbox = plugs.first(exports.message_unbox = []) var sbot_log = plugs.first(exports.sbot_log = []) function unbox () { return pull( pull.filter(function (msg) { return 'string' == typeof msg.value.content }), pull.map(function (msg) { return message_unbox(msg) }), pull.filter(Boolean) ) } exports.screen_view = function (path) { if(path === '/private') { if(process.title === 'browser') return h('div', h('h4', 'Private messages are not supported in the lite client.')) var id = require('../keys').id var compose = message_compose( {type: 'post', recps: [], private: true}, function (msg) { msg.recps = [id].concat(msg.mentions).filter(function (e) { return ref.isFeed('string' === typeof e ? e : e.link) }) if(!msg.recps.length) throw new Error('cannot make private message without recipients - just mention the user in an at reply in the message you send') return msg }) var content = h('div.column.scroller__content') var div = h('div.column.scroller', {style: {'overflow':'auto'}}, h('div.scroller__wrapper', compose, content) ) pull( sbot_log({old: false}), unbox(), Scroller(div, content, message_render, true, false) ) pull( u.next(sbot_log, {reverse: true, limit: 1000}), unbox(), Scroller(div, content, message_render, false, false, function (err) { if(err) throw err }) ) return div } } exports.message_meta = function (msg) { if(msg.value.private) return h('span', 'PRIVATE') } }).call(this,require('_process')) },{"../keys":158,"../plugs":362,"../ui":364,"../util":365,"_process":108,"hyperscript":223,"pull-scroll":283,"pull-stream":284,"ssb-ref":348}],185:[function(require,module,exports){ var h = require('hyperscript') var ui = require('../ui') var u = require('../util') var pull = require('pull-stream') var Scroller = require('pull-scroll') var plugs = require('../plugs') var message_render = plugs.first(exports.message_render = []) var message_compose = plugs.first(exports.message_compose = []) var sbot_log = plugs.first(exports.sbot_log = []) exports.screen_view = function (path, sbot) { if(path === '/public') { var content = h('div.column.scroller__content') var div = h('div.column.scroller', {style: {'overflow':'auto'}}, h('div.scroller__wrapper', message_compose({type: 'post'}), //header content ) ) pull( sbot_log({old: false}), Scroller(div, content, message_render, true, false) ) pull( u.next(sbot_log, {reverse: true, limit: 100, live: false}), Scroller(div, content, message_render, false, false) ) return div } } },{"../plugs":362,"../ui":364,"../util":365,"hyperscript":223,"pull-scroll":283,"pull-stream":284}],186:[function(require,module,exports){ var h = require('hyperscript') var suggest = require('suggest-box') var pull = require('pull-stream') var plugs = require('../plugs') var sbot_query = plugs.first(exports.sbot_query = []) var sbot_links2 = plugs.first(exports.sbot_links2 = []) exports.search_box = function (go) { var suggestBox var search = h('input.searchprompt', { type: 'search', onkeydown: function (ev) { switch (ev.keyCode) { case 13: // enter if (suggestBox && suggestBox.active) { suggestBox.complete() ev.stopPropagation() } if (go(search.value.trim(), !ev.ctrlKey)) search.blur() return case 27: // escape ev.preventDefault() search.blur() return } } }) search.activate = function (sigil, ev) { search.focus() ev.preventDefault() if (search.value[0] === sigil) { search.selectionStart = 1 search.selectionEnd = search.value.length } else { search.value = sigil } } var suggestions = {} // delay until the element has a parent setTimeout(function () { suggestBox = suggest(search, suggestions) }, 10) pull( sbot_query({query: [ {$filter: {value: {content: {channel: {$gt: ''}}}}}, {$reduce: { channel: ['value', 'content', 'channel'], posts: {$count: true} }} ]}), pull.collect(function (err, chans) { if (err) return console.error(err) suggestions['#'] = chans.map(function (chan) { var name = '#' + chan.channel return { title: name, value: name, subtitle: chan.posts } }) }) ) pull( sbot_links2({query: [ {$filter: { dest: {$prefix: '@'}, rel: ['mentions', {$gt: '@'}]} }, {$reduce: { id: 'dest', name: ['rel', 1], rank: {$count: true}} } ]}), pull.collect(function (err, links) { if (err) return console.error(err) suggestions['@'] = links.map(function (e) { return { title: e.name, value: e.id, subtitle: e.id + ' (' + e.rank + ')', rank: e.rank } }).sort(function (a, b) { return b.rank - a.rank }) }) ) return search } },{"../plugs":362,"hyperscript":223,"pull-stream":284,"suggest-box":356}],187:[function(require,module,exports){ var h = require('hyperscript') var u = require('../util') var pull = require('pull-stream') var Scroller = require('pull-scroll') var TextNodeSearcher = require('text-node-searcher') var plugs = require('../plugs') var message_render = plugs.first(exports.message_render = []) var sbot_log = plugs.first(exports.sbot_log = []) var whitespace = /\s+/ function andSearch(terms, inputs) { for(var i = 0; i < terms.length; i++) { var match = false for(var j = 0; j < inputs.length; j++) { if(terms[i].test(inputs[j])) match = true } //if a term was not matched by anything, filter this one if(!match) return false } return true } function searchFilter(terms) { return function (msg) { var c = msg && msg.value && msg.value.content return c && ( msg.key == terms[0] || andSearch(terms.map(function (term) { return new RegExp('\\b'+term+'\\b', 'i') }), [c.text, c.name, c.title]) ) } } function createOrRegExp(ary) { return new RegExp(ary.map(function (e) { return '\\b'+e+'\\b' }).join('|'), 'i') } function highlight(el, query) { var searcher = new TextNodeSearcher({container: el}) searcher.query = query searcher.highlight() return el } exports.screen_view = function (path) { if(path[0] === '?') { var query = path.substr(1).trim().split(whitespace) var _matches = searchFilter(query) var total = 0, matches = 0 var header = h('div.search_header', '') var content = h('div.column.scroller__content') var div = h('div.column.scroller', {style: {'overflow':'auto'}}, h('div.scroller__wrapper', header, content ) ) function matchesQuery (data) { total++ var m = _matches(data) if(m) matches++ header.textContent = 'searched:'+total+', found:'+matches return m } function renderMsg(msg) { var el = message_render(msg) highlight(el, createOrRegExp(query)) return el } pull( sbot_log({old: false}), pull.filter(matchesQuery), Scroller(div, content, renderMsg, true, false) ) pull( u.next(sbot_log, {reverse: true, limit: 500, live: false}), pull.filter(matchesQuery), Scroller(div, content, renderMsg, false, false) ) return div } } },{"../plugs":362,"../util":365,"hyperscript":223,"pull-scroll":283,"pull-stream":284,"text-node-searcher":358}],188:[function(require,module,exports){ var h = require('hyperscript') var screen_view = require('../plugs').first(exports._screen_view = []) exports.screen_view = function (path) { var m = /^split\s*\((.*)\)$/.exec(path) if(!m) return return h('div.row', m[1].split(',').map(function (e) { return screen_view(e.trim()) }).filter(Boolean) ) } },{"../plugs":362,"hyperscript":223}],189:[function(require,module,exports){ var pull = require('pull-stream') var cont = require('cont') function isImage (filename) { return /\.(gif|jpg|png|svg)$/i.test(filename) } var sbot_links2 = require('../plugs').first(exports.sbot_links2 = []) exports.suggest = cont.to(function (word, cb) { if(!/^[@%&!]/.test(word[0])) return cb() if(word.length < 2) return cb() var sigil = word[0] var embed = ((sigil === '!') ? '!' : '') if(embed) sigil = '&' if(word[0] !== '@') word = word.substring(1) pull( sbot_links2({query: [ {$filter: {rel: ['mentions', {$prefix: word}], dest: {$prefix: sigil}}}, {$reduce: {id: 'dest', name: ['rel', 1], rank: {$count: true}}} ]}), pull.collect(function (err, ary) { ary = ary .filter(function (e) { if(!embed) return true return isImage(e.name) }).sort(function (a, b) { return b.rank - a.rank }).map(function (e) { return { title: e.name + ': ' + e.id.substring(0,10)+' ('+e.rank+')', value: embed+'['+e.name+']('+e.id+')', rank: e.rank, image: isImage(e.name) ? 'http://localhost:7777/'+e.id : undefined } }) cb(null, ary) }) ) }) },{"../plugs":362,"cont":197,"pull-stream":284}],190:[function(require,module,exports){ },{}],191:[function(require,module,exports){ var Tabs = require('hypertabs') var h = require('hyperscript') var pull = require('pull-stream') var u = require('../util') var keyscroll = require('../keyscroll') var open = require('open-external') function ancestor (el) { if(!el) return if(el.tagName !== 'A') return ancestor(el.parentElement) return el } var plugs = require('../plugs') var screen_view = plugs.first(exports.screen_view = []) var search_box = plugs.first(exports.search_box = []) exports.message_render = [] exports.app = function () { var search var tabs = Tabs(function (name) { search.value = name sessionStorage.selectedTab = tabs.selected }) // tabs.classList.add('screen') search = search_box(function (path, change) { if(tabs.has(path)) { tabs.select(path) return true } var el = screen_view(path) if(el) { el.scroll = keyscroll(el.querySelector('.scroller__content')) tabs.add(path, el, change) localStorage.openTabs = JSON.stringify(tabs.tabs) return change } }) tabs.insertBefore(search, tabs.querySelector('.hypertabs__content')) var saved = [] try { saved = JSON.parse(localStorage.openTabs) } catch (_) { } if(!saved || saved.length < 3) saved = ['/public', '/private', '/notifications'] saved.forEach(function (path) { var el = screen_view(path) if (!el) return el.scroll = keyscroll(el.querySelector('.scroller__content')) if(el) tabs.add(path, el, false) }) tabs.select(sessionStorage.selectedTab || saved[0] || '/public') tabs.onclick = function (ev) { var link = ancestor(ev.target) if(!link) return var path = link.hash.substring(1) ev.preventDefault() ev.stopPropagation() //open external links. //this ought to be made into something more runcible if(open.isExternal(link.href)) return open(link.href) if(tabs.has(path)) return tabs.select(path) var el = screen_view(path) if(el) { el.scroll = keyscroll(el.querySelector('.scroller__content')) tabs.add(path, el, !ev.ctrlKey) localStorage.openTabs = JSON.stringify(tabs.tabs) } return false } window.addEventListener('keydown', function (ev) { if (ev.target.nodeName === 'INPUT' || ev.target.nodeName === 'TEXTAREA') return switch(ev.keyCode) { // scroll through tabs case 72: // h return tabs.selectRelative(-1) case 76: // l return tabs.selectRelative(1) // scroll through messages case 74: // j return tabs.selectedTab.scroll(1) case 75: // k return tabs.selectedTab.scroll(-1) // close a tab case 88: // x if (tabs.selected && tabs.selected[0] !== '/') { var sel = tabs.selected tabs.selectRelative(-1) tabs.remove(sel) localStorage.openTabs = JSON.stringify(tabs.tabs) } return // activate the search field case 191: // / search.activate('?', ev) return // navigate to a feed case 50: // 2 if (ev.shiftKey) search.activate('@', ev) return // navigate to a channel case 51: // 3 if (ev.shiftKey) search.activate('#', ev) return } }) // errors tab var errorsContent = h('div.column.scroller__content') var errors = h('div.column.scroller', {style: {'overflow':'auto'}}, h('div.scroller__wrapper', errorsContent ) ) window.addEventListener('error', function (ev) { var err = ev.error || ev if(!tabs.has('errors')) tabs.add('errors', errors, false) var el = h('div.message', h('strong', err.message), h('pre', err.stack)) if (errorsContent.firstChild) errorsContent.insertBefore(el, errorsContent.firstChild) else errorsContent.appendChild(el) }) return tabs } },{"../keyscroll":159,"../plugs":362,"../util":365,"hyperscript":223,"hypertabs":224,"open-external":257,"pull-stream":284}],192:[function(require,module,exports){ var ui = require('../ui') var pull = require('pull-stream') var Cat = require('pull-cat') var sort = require('ssb-sort') var ref = require('ssb-ref') var h = require('hyperscript') var u = require('../util') var Scroller = require('pull-scroll') function once (cont) { var ended = false return function (abort, cb) { if(abort) return cb(abort) else if (ended) return cb(ended) else cont(function (err, data) { if(err) return cb(ended = err) ended = true cb(null, data) }) } } var plugs = require('../plugs') var message_render = plugs.first(exports.message_render = []) var message_compose = plugs.first(exports.message_compose = []) var message_unbox = plugs.first(exports.message_unbox = []) var sbot_get = plugs.first(exports.sbot_get = []) var sbot_links = plugs.first(exports.sbot_links = []) function getThread (root, cb) { //in this case, it's inconvienent that panel only takes //a stream. maybe it would be better to accept an array? sbot_get(root, function (err, value) { var msg = {key: root, value: value} // if(value.content.root) return getThread(value.content.root, cb) pull( sbot_links({rel: 'root', dest: root, values: true, keys: true}), pull.collect(function (err, ary) { if(err) return cb(err) ary.unshift(msg) cb(null, ary) }) ) }) } exports.screen_view = function (id, sbot) { if(ref.isMsg(id)) { var meta = { type: 'post', root: id, branch: id //mutated when thread is loaded. } var content = h('div.column.scroller__content') var div = h('div.column.scroller', {style: {'overflow-y': 'auto'}}, h('div.scroller__wrapper', content, message_compose(meta) ) ) pull( sbot_links({ rel: 'root', dest: id, keys: true, old: false }), pull.drain(function (msg) { loadThread() //redraw thread }, function () {} ) ) function loadThread () { getThread(id, function (err, thread) { //would probably be better keep an id for each message element //(i.e. message key) and then update it if necessary. //also, it may have moved (say, if you received a missing message) content.innerHTML = '' //decrypt thread = thread.map(function (msg) { return 'string' === typeof msg.value.content ? message_unbox(msg) : msg }) if(err) return content.appendChild(h('pre', err.stack)) sort(thread).map(message_render).filter(Boolean).forEach(function (el) { content.appendChild(el) }) var branches = sort.heads(thread) meta.branch = branches.length > 1 ? branches : branches[0] meta.root = thread[0].value.content.root || thread[0].key meta.channel = thread[0].value.content.channel var recps = thread[0].value.content.recps if(recps && thread[0].value.private) meta.recps = recps }) } loadThread() return div } } },{"../plugs":362,"../ui":364,"../util":365,"hyperscript":223,"pull-cat":266,"pull-scroll":283,"pull-stream":284,"ssb-ref":348,"ssb-sort":349}],193:[function(require,module,exports){ var h = require('hyperscript') var moment = require('moment') function updateTimestampEl(el) { el.firstChild.nodeValue = el.timestamp.fromNow() return el } setInterval(function () { var els = [].slice.call(document.querySelectorAll('.timestamp')) els.forEach(updateTimestampEl) }, 60e3) exports.message_meta = function (msg) { var m = moment(msg.value.timestamp) return updateTimestampEl(h('a.enter.timestamp', { href: '#'+msg.key, timestamp: m, title: m.format('LLLL') }, '')) } },{"hyperscript":223,"moment":238}],194:[function(require,module,exports){ (function (Buffer){ var DuplexStream = require('readable-stream/duplex') , util = require('util') function BufferList (callback) { if (!(this instanceof BufferList)) return new BufferList(callback) this._bufs = [] this.length = 0 if (typeof callback == 'function') { this._callback = callback var piper = function piper (err) { if (this._callback) { this._callback(err) this._callback = null } }.bind(this) this.on('pipe', function onPipe (src) { src.on('error', piper) }) this.on('unpipe', function onUnpipe (src) { src.removeListener('error', piper) }) } else { this.append(callback) } DuplexStream.call(this) } util.inherits(BufferList, DuplexStream) BufferList.prototype._offset = function _offset (offset) { var tot = 0, i = 0, _t for (; i < this._bufs.length; i++) { _t = tot + this._bufs[i].length if (offset < _t) return [ i, offset - tot ] tot = _t } } BufferList.prototype.append = function append (buf) { var i = 0 , newBuf if (Array.isArray(buf)) { for (; i < buf.length; i++) this.append(buf[i]) } else if (buf instanceof BufferList) { // unwrap argument into individual BufferLists for (; i < buf._bufs.length; i++) this.append(buf._bufs[i]) } else if (buf != null) { // coerce number arguments to strings, since Buffer(number) does // uninitialized memory allocation if (typeof buf == 'number') buf = buf.toString() newBuf = Buffer.isBuffer(buf) ? buf : new Buffer(buf) this._bufs.push(newBuf) this.length += newBuf.length } return this } BufferList.prototype._write = function _write (buf, encoding, callback) { this.append(buf) if (typeof callback == 'function') callback() } BufferList.prototype._read = function _read (size) { if (!this.length) return this.push(null) size = Math.min(size, this.length) this.push(this.slice(0, size)) this.consume(size) } BufferList.prototype.end = function end (chunk) { DuplexStream.prototype.end.call(this, chunk) if (this._callback) { this._callback(null, this.slice()) this._callback = null } } BufferList.prototype.get = function get (index) { return this.slice(index, index + 1)[0] } BufferList.prototype.slice = function slice (start, end) { return this.copy(null, 0, start, end) } BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) { if (typeof srcStart != 'number' || srcStart < 0) srcStart = 0 if (typeof srcEnd != 'number' || srcEnd > this.length) srcEnd = this.length if (srcStart >= this.length) return dst || new Buffer(0) if (srcEnd <= 0) return dst || new Buffer(0) var copy = !!dst , off = this._offset(srcStart) , len = srcEnd - srcStart , bytes = len , bufoff = (copy && dstStart) || 0 , start = off[1] , l , i // copy/slice everything if (srcStart === 0 && srcEnd == this.length) { if (!copy) // slice, just return a full concat return Buffer.concat(this._bufs) // copy, need to copy individual buffers for (i = 0; i < this._bufs.length; i++) { this._bufs[i].copy(dst, bufoff) bufoff += this._bufs[i].length } return dst } // easy, cheap case where it's a subset of one of the buffers if (bytes <= this._bufs[off[0]].length - start) { return copy ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) : this._bufs[off[0]].slice(start, start + bytes) } if (!copy) // a slice, we need something to copy in to dst = new Buffer(len) for (i = off[0]; i < this._bufs.length; i++) { l = this._bufs[i].length - start if (bytes > l) { this._bufs[i].copy(dst, bufoff, start) } else { this._bufs[i].copy(dst, bufoff, start, start + bytes) break } bufoff += l bytes -= l if (start) start = 0 } return dst } BufferList.prototype.toString = function toString (encoding, start, end) { return this.slice(start, end).toString(encoding) } BufferList.prototype.consume = function consume (bytes) { while (this._bufs.length) { if (bytes >= this._bufs[0].length) { bytes -= this._bufs[0].length this.length -= this._bufs[0].length this._bufs.shift() } else { this._bufs[0] = this._bufs[0].slice(bytes) this.length -= bytes break } } return this } BufferList.prototype.duplicate = function duplicate () { var i = 0 , copy = new BufferList() for (; i < this._bufs.length; i++) copy.append(this._bufs[i]) return copy } BufferList.prototype.destroy = function destroy () { this._bufs.length = 0 this.length = 0 this.push(null) } ;(function () { var methods = { 'readDoubleBE' : 8 , 'readDoubleLE' : 8 , 'readFloatBE' : 4 , 'readFloatLE' : 4 , 'readInt32BE' : 4 , 'readInt32LE' : 4 , 'readUInt32BE' : 4 , 'readUInt32LE' : 4 , 'readInt16BE' : 2 , 'readInt16LE' : 2 , 'readUInt16BE' : 2 , 'readUInt16LE' : 2 , 'readInt8' : 1 , 'readUInt8' : 1 } for (var m in methods) { (function (m) { BufferList.prototype[m] = function (offset) { return this.slice(offset, offset + methods[m])[m](0) } }(m)) } }()) module.exports = BufferList }).call(this,require("buffer").Buffer) },{"buffer":47,"readable-stream/duplex":324,"util":150}],195:[function(require,module,exports){ /*! * Cross-Browser Split 1.1.1 * Copyright 2007-2012 Steven Levithan * Available under the MIT License * ECMAScript compliant, uniform cross-browser split method */ /** * Splits a string into an array of strings using a regex or string separator. Matches of the * separator are not included in the result array. However, if `separator` is a regex that contains * capturing groups, backreferences are spliced into the result each time `separator` is matched. * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably * cross-browser. * @param {String} str String to split. * @param {RegExp|String} separator Regex or string to use for separating the string. * @param {Number} [limit] Maximum number of items to include in the result array. * @returns {Array} Array of substrings. * @example * * // Basic use * split('a b c d', ' '); * // -> ['a', 'b', 'c', 'd'] * * // With limit * split('a b c d', ' ', 2); * // -> ['a', 'b'] * * // Backreferences in result array * split('..word1 word2..', /([a-z]+)(\d+)/i); * // -> ['..', 'word', '1', ' ', 'word', '2', '..'] */ module.exports = (function split(undef) { var nativeSplit = String.prototype.split, compliantExecNpcg = /()??/.exec("")[1] === undef, // NPCG: nonparticipating capturing group self; self = function(str, separator, limit) { // If `separator` is not a regex, use `nativeSplit` if (Object.prototype.toString.call(separator) !== "[object RegExp]") { return nativeSplit.call(str, separator, limit); } var output = [], flags = (separator.ignoreCase ? "i" : "") + (separator.multiline ? "m" : "") + (separator.extended ? "x" : "") + // Proposed for ES6 (separator.sticky ? "y" : ""), // Firefox 3+ lastLastIndex = 0, // Make `global` and avoid `lastIndex` issues by working with a copy separator = new RegExp(separator.source, flags + "g"), separator2, match, lastIndex, lastLength; str += ""; // Type-convert if (!compliantExecNpcg) { // Doesn't need flags gy, but they don't hurt separator2 = new RegExp("^" + separator.source + "$(?!\\s)", flags); } /* Values for `limit`, per the spec: * If undefined: 4294967295 // Math.pow(2, 32) - 1 * If 0, Infinity, or NaN: 0 * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296; * If negative number: 4294967296 - Math.floor(Math.abs(limit)) * If other: Type-convert, then use the above rules */ limit = limit === undef ? -1 >>> 0 : // Math.pow(2, 32) - 1 limit >>> 0; // ToUint32(limit) while (match = separator.exec(str)) { // `separator.lastIndex` is not reliable cross-browser lastIndex = match.index + match[0].length; if (lastIndex > lastLastIndex) { output.push(str.slice(lastLastIndex, match.index)); // Fix browsers whose `exec` methods don't consistently return `undefined` for // nonparticipating capturing groups if (!compliantExecNpcg && match.length > 1) { match[0].replace(separator2, function() { for (var i = 1; i < arguments.length - 2; i++) { if (arguments[i] === undef) { match[i] = undef; } } }); } if (match.length > 1 && match.index < str.length) { Array.prototype.push.apply(output, match.slice(1)); } lastLength = match[0].length; lastLastIndex = lastIndex; if (output.length >= limit) { break; } } if (separator.lastIndex === match.index) { separator.lastIndex++; // Avoid an infinite loop } } if (lastLastIndex === str.length) { if (lastLength || !separator.test("")) { output.push(""); } } else { output.push(str.slice(lastLastIndex)); } return output.length > limit ? output.slice(0, limit) : output; }; return self; })(); },{}],196:[function(require,module,exports){ // contains, add, remove, toggle var indexof = require('indexof') module.exports = ClassList function ClassList(elem) { var cl = elem.classList if (cl) { return cl } var classList = { add: add , remove: remove , contains: contains , toggle: toggle , toString: $toString , length: 0 , item: item } return classList function add(token) { var list = getTokens() if (indexof(list, token) > -1) { return } list.push(token) setTokens(list) } function remove(token) { var list = getTokens() , index = indexof(list, token) if (index === -1) { return } list.splice(index, 1) setTokens(list) } function contains(token) { return indexof(getTokens(), token) > -1 } function toggle(token) { if (contains(token)) { remove(token) return false } else { add(token) return true } } function $toString() { return elem.className } function item(index) { var tokens = getTokens() return tokens[index] || null } function getTokens() { var className = elem.className return filter(className.split(" "), isTruthy) } function setTokens(list) { var length = list.length elem.className = list.join(" ") classList.length = length for (var i = 0; i < list.length; i++) { classList[i] = list[i] } delete list[length] } } function filter (arr, fn) { var ret = [] for (var i = 0; i < arr.length; i++) { if (fn(arr[i])) ret.push(arr[i]) } return ret } function isTruthy(value) { return !!value } },{"indexof":226}],197:[function(require,module,exports){ var cont = require('continuable') exports = module.exports = function (fun) { return cont.to(fun) } for(var k in cont) exports[k] = cont[k] exports.para = require('continuable-para') exports.series = require('continuable-series') },{"continuable":208,"continuable-para":202,"continuable-series":203}],198:[function(require,module,exports){ var maybeCallback = require("continuable/maybe-callback") module.exports = maybeCallback(hash) // hash := (tasks:Object>) // => Continuable> function hash(tasks) { return function continuable(callback) { var keys = Object.keys(tasks) var count = 0 var result = {} if (keys.length === 0) { return callback(null, result) } keys.forEach(function (key) { tasks[key](function (err, value) { if (err && result) { result = null callback(err) } else if (!err && result) { result[key] = value if (++count === keys.length) { callback(null, result) } } }) }) } } },{"continuable/maybe-callback":199}],199:[function(require,module,exports){ var slice = Array.prototype.slice /* Given a function that takes n arguments and returns a continuable return a function that takes n arguments and maybe a n+1th argument which is a callback or takes n arguments and returns a continuable This basically means that you can do this: ```js var readFile = maybeCallback(function (uri) { return function (cb) { fs.readFile(uri, cb) } }) readFile("./foo")(cb) readFile("./foo", cb) ``` Be warned this breaks if the last argument is a function */ module.exports = maybeCallback // maybeCallback := (fn: (Any, ...) => Continuable) => // (Any, ..., Callback?) => Continuable function maybeCallback(fn) { return function maybeContinuable() { var args = slice.call(arguments) var callback = args[args.length - 1] if (typeof callback === "function") { args.pop() } var continuable = fn.apply(null, args) if (typeof callback === "function") { continuable(callback) } else { return continuable } } } },{}],200:[function(require,module,exports){ var maybeCallback = require("continuable/maybe-callback") module.exports = maybeCallback(list) // list := (tasks:Array>) // => Continuable> function list(tasks) { return function continuable(callback) { var result = [] var count = 0 if (tasks.length === 0) { return callback(null, result) } tasks.forEach(function invokeSource(source, index) { source(function continuation(err, value) { if (err && result) { result = null callback(err) } else if (!err && result) { result[index] = value if (++count === tasks.length) { callback(null, result) } } }) }) } } },{"continuable/maybe-callback":201}],201:[function(require,module,exports){ arguments[4][199][0].apply(exports,arguments) },{"dup":199}],202:[function(require,module,exports){ var list = require('continuable-list') var hash = require('continuable-hash') module.exports = function (obj, cb) { if(Array.isArray(obj)) return list(obj, cb) else if('object' === typeof obj) return hash(obj, cb) else return list([].slice.call(arguments)) } },{"continuable-hash":198,"continuable-list":200}],203:[function(require,module,exports){ module.exports = function series (continuables, callback) { if('function' === typeof continuables) return series([].slice.call(arguments)) if (callback) { next(callback) } else { return next } function next (callback) { continuables.shift() (function (err, value) { if (err || !continuables.length) return callback(err, value) next (callback) }) } } },{}],204:[function(require,module,exports){ // both := (Continuable) => Continuable<[Error, Any]> module.exports = both function both(source) { return function continuable(callback) { source(function (err, value) { callback(null, [err || null, value]) }) } } },{}],205:[function(require,module,exports){ module.exports = chain // chain := (Continuable, lambda:(A) => Continuable) => Continuable function chain(source, lambda) { return function continuable(callback) { source(function continuation(err, value) { if (err) { return callback(err) } lambda(value)(callback) }) } } },{}],206:[function(require,module,exports){ var of = require("./of") module.exports = either // either := (source: Continuable, // left: (Error, cb?: Callback) => Continuable, // right?: (A) => Continuable) // => Continuable function either(cont, left, right) { right = right || of return function continuable(callback) { cont(function (err, value) { if (!err) { return right(value)(callback) } // the left function takes either a callback or // it returns a continuable. Both are valid var cont = left(err, callback) if (cont) { cont(callback) } }) } } },{"./of":213}],207:[function(require,module,exports){ module.exports = error // error := (Error) => Continuable function error(err) { return function continuable(callback) { callback(err) } } },{}],208:[function(require,module,exports){ var maybeCallback = require("./maybe-callback.js") maybeCallback.both = require("./both.js") maybeCallback.chain = require("./chain.js") maybeCallback.either = require("./either.js") maybeCallback.error = require("./error.js") maybeCallback.join = require("./join.js") maybeCallback.mapAsync = require("./map-async.js") maybeCallback.map = require("./map.js") maybeCallback.of = require("./of.js") maybeCallback.to = require("./to.js") module.exports = maybeCallback },{"./both.js":204,"./chain.js":205,"./either.js":206,"./error.js":207,"./join.js":209,"./map-async.js":210,"./map.js":211,"./maybe-callback.js":212,"./of.js":213,"./to.js":214}],209:[function(require,module,exports){ module.exports = join // join := (Continuable>) => Continuable function join(source) { return function continuable(callback) { source(function continuation(err, next) { if (err) { return callback(err) } next(callback) }) } } },{}],210:[function(require,module,exports){ module.exports = mapAsync // mapAsync := (Continuable, lambda: (A, Callback)) => Continuable function mapAsync(source, lambda) { return function continuable(callback) { source(function continuation(err, value) { if (err) { return callback(err) } lambda(value, callback) }) } } },{}],211:[function(require,module,exports){ module.exports = map // map := (Continuable, (A) => B) => Continuable function map(source, lambda) { return function continuable(callback) { source(function continuation(err, value) { if (err) { return callback(err) } callback(null, lambda(value)) }) } } },{}],212:[function(require,module,exports){ arguments[4][199][0].apply(exports,arguments) },{"dup":199}],213:[function(require,module,exports){ module.exports = of // of := (Value) => Continuable function of(value) { return function continuable(callback) { callback(null, value) } } },{}],214:[function(require,module,exports){ var slice = Array.prototype.slice module.exports = to function to(asyncFn) { return function () { var args = slice.call(arguments) var callback = args[args.length - 1] var self = this if (typeof callback === "function") { return asyncFn.apply(this, args) } return function continuable(callback) { var _args = args.slice() _args.push(callback) return asyncFn.apply(self, _args) } } } },{}],215:[function(require,module,exports){ (function (Buffer){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. function isArray(arg) { if (Array.isArray) { return Array.isArray(arg); } return objectToString(arg) === '[object Array]'; } exports.isArray = isArray; function isBoolean(arg) { return typeof arg === 'boolean'; } exports.isBoolean = isBoolean; function isNull(arg) { return arg === null; } exports.isNull = isNull; function isNullOrUndefined(arg) { return arg == null; } exports.isNullOrUndefined = isNullOrUndefined; function isNumber(arg) { return typeof arg === 'number'; } exports.isNumber = isNumber; function isString(arg) { return typeof arg === 'string'; } exports.isString = isString; function isSymbol(arg) { return typeof arg === 'symbol'; } exports.isSymbol = isSymbol; function isUndefined(arg) { return arg === void 0; } exports.isUndefined = isUndefined; function isRegExp(re) { return objectToString(re) === '[object RegExp]'; } exports.isRegExp = isRegExp; function isObject(arg) { return typeof arg === 'object' && arg !== null; } exports.isObject = isObject; function isDate(d) { return objectToString(d) === '[object Date]'; } exports.isDate = isDate; function isError(e) { return (objectToString(e) === '[object Error]' || e instanceof Error); } exports.isError = isError; function isFunction(arg) { return typeof arg === 'function'; } exports.isFunction = isFunction; function isPrimitive(arg) { return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || typeof arg === 'symbol' || // ES6 symbol typeof arg === 'undefined'; } exports.isPrimitive = isPrimitive; exports.isBuffer = Buffer.isBuffer; function objectToString(o) { return Object.prototype.toString.call(o); } }).call(this,{"isBuffer":require("../../../../../.nvm/versions/node/v6.2.0/lib/node_modules/browserify/node_modules/is-buffer/index.js")}) },{"../../../../../.nvm/versions/node/v6.2.0/lib/node_modules/browserify/node_modules/is-buffer/index.js":96}],216:[function(require,module,exports){ (function (Buffer){ /*! * @description Recursive object extending * @author Viacheslav Lotsmanov * @license MIT * * The MIT License (MIT) * * Copyright (c) 2013-2015 Viacheslav Lotsmanov * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 'use strict'; function isSpecificValue(val) { return ( val instanceof Buffer || val instanceof Date || val instanceof RegExp ) ? true : false; } function cloneSpecificValue(val) { if (val instanceof Buffer) { var x = new Buffer(val.length); val.copy(x); return x; } else if (val instanceof Date) { return new Date(val.getTime()); } else if (val instanceof RegExp) { return new RegExp(val); } else { throw new Error('Unexpected situation'); } } /** * Recursive cloning array. */ function deepCloneArray(arr) { var clone = []; arr.forEach(function (item, index) { if (typeof item === 'object' && item !== null) { if (Array.isArray(item)) { clone[index] = deepCloneArray(item); } else if (isSpecificValue(item)) { clone[index] = cloneSpecificValue(item); } else { clone[index] = deepExtend({}, item); } } else { clone[index] = item; } }); return clone; } /** * Extening object that entered in first argument. * * Returns extended object or false if have no target object or incorrect type. * * If you wish to clone source object (without modify it), just use empty new * object as first argument, like this: * deepExtend({}, yourObj_1, [yourObj_N]); */ var deepExtend = module.exports = function (/*obj_1, [obj_2], [obj_N]*/) { if (arguments.length < 1 || typeof arguments[0] !== 'object') { return false; } if (arguments.length < 2) { return arguments[0]; } var target = arguments[0]; // convert arguments to array and cut off target object var args = Array.prototype.slice.call(arguments, 1); var val, src, clone; args.forEach(function (obj) { // skip argument if it is array or isn't object if (typeof obj !== 'object' || Array.isArray(obj)) { return; } Object.keys(obj).forEach(function (key) { src = target[key]; // source value val = obj[key]; // new value // recursion prevention if (val === target) { return; /** * if new value isn't object then just overwrite by new value * instead of extending. */ } else if (typeof val !== 'object' || val === null) { target[key] = val; return; // just clone arrays (and recursive clone objects inside) } else if (Array.isArray(val)) { target[key] = deepCloneArray(val); return; // custom cloning and overwrite for specific objects } else if (isSpecificValue(val)) { target[key] = cloneSpecificValue(val); return; // overwrite by new value if source isn't object or array } else if (typeof src !== 'object' || src === null || Array.isArray(src)) { target[key] = deepExtend({}, val); return; // source value and new value is objects both, extending... } else { target[key] = deepExtend(src, val); return; } }); }); return target; } }).call(this,require("buffer").Buffer) },{"buffer":47}],217:[function(require,module,exports){ function dot(s) { return s.replace('.js', '_JS').replace('-', '_') } function each(obj, iter) { for(var k in obj) iter(obj[k], k, obj) } function source (modules, fn) { for(var k in modules) for(var j in modules[k]) if(modules[k][j] === fn) return k } var exports = module.exports = function (modules, name) { return exports.toDot(exports.toGraph(modules), name) } exports.toGraph = function (modules) { var g = {} each(modules, function (e, name) { var o = {} for(var k in e) { if(Array.isArray(e[k])) { o[k] = e[k].map(function (v) { return source(modules, v) }) } } g[name] = o }) return g } exports.toDot = function (g, name) { var s = '' function log () { var args = [].slice.call(arguments) s += args.join(' ')+'\n' } log('digraph ' + (name || 'depject' ) + ' {') for(var k in g) log(' ', dot(k), '[label="'+k+'"]') log() for(var k in g) for(var j in g[k]) log(' ', dot(j), '[label="'+j+'", shape="box"]') log() var edges = {} function once (edge) { if(edges[edge]) return edges[edge] = true log(' ', edge) } for(var k in g) { for(var j in g[k]) { once(dot(k)+'->'+dot(j)) if(Array.isArray(g[k][j])) g[k][j].forEach(function (dest) { once(dot(j)+'->'+dot(dest)) }) else once(dot(j)+'->'+dot(g[k][j])) } } log('}') return s } },{}],218:[function(require,module,exports){ function copy(from, to) { (from || []).forEach(function (e) { to.forEach(function (to) { to.push(e) }) }) } function each(obj, iter) { for(var k in obj) iter(obj[k], k, obj) } function isFunction (f) { return 'function' === typeof f } var isArray = Array.isArray function isObject(o) { return o && 'object' === typeof o && !isArray(o) } function combine(args, names) { var modules = {} if(isArray(args) && isArray(names)) { args.forEach(function (v, i) { modules[names[i]] = args[i] }) } else if(isObject(args)) modules = args var plugs = {} var sockets = {} each(modules, function (mod) { for(var k in mod) { if(Array.isArray(mod[k])) (sockets[k] = sockets[k] || []).push(mod[k]) else if('function' == typeof mod[k]) (plugs[k] = plugs[k] || []).push(mod[k]) } }) for(var k in sockets) copy(plugs[k], sockets[k]) return {plugs: plugs, sockets: sockets} } module.exports = combine },{}],219:[function(require,module,exports){ // universal module definition: https://github.com/umdjs/umd/blob/master/returnExports.js#L41 (function (root, factory) { if (typeof exports === 'object') { // Node. Does not work with strict CommonJS, but // only CommonJS-like enviroments that support module.exports, // like Node. module.exports = factory(); } else if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(factory); } else { // Browser globals (root is window) root.emoji = factory(); } }(this, function () { return {"100":{"character":"💯","syllables":3,"types":["noun"]},"1234":{"character":"🔢","syllables":4,"types":[]},"+1":{"character":"👍","syllables":2,"types":["interjection"]},"-1":{"character":"👎","syllables":3,"types":[]},"8ball":{"character":"🎱","syllables":2,"types":[]},"a":{"character":"🅰","syllables":1,"types":["noun","idiom","indefinite-article","preposition","auxiliary-verb","abbreviation"]},"ab":{"character":"🆎","syllables":1,"types":["noun"]},"abc":{"character":"🔤","syllables":3,"types":[]},"abcd":{"character":"🔡","syllables":4,"types":[]},"accept":{"character":"🉑","syllables":2,"types":["verb-transitive","verb-intransitive"]},"aerial_tramway":{"character":"🚡","syllables":3,"types":[]},"airplane":{"character":"✈️","syllables":2,"types":["noun"]},"alarm_clock":{"character":"⏰","syllables":3,"types":[]},"alien":{"character":"👽","syllables":3,"types":["adjective","noun","verb-transitive"]},"ambulance":{"character":"🚑","syllables":3,"types":["noun"]},"anchor":{"character":"⚓️","syllables":2,"types":["noun","verb-transitive","verb-intransitive"]},"angel":{"character":"👼","syllables":2,"types":["noun"]},"anger":{"character":"💢","syllables":2,"types":["noun","verb-transitive","verb-intransitive"]},"angry":{"character":"😠","syllables":2,"types":["adjective"]},"anguished":{"character":"😟","syllables":2,"types":["adjective"]},"ant":{"character":"🐜","syllables":1,"types":["noun","idiom"]},"apple":{"character":"🍎","syllables":2,"types":["noun","idiom"]},"aquarius":{"character":"♒️","syllables":4,"types":[]},"aries":{"character":"♈️","syllables":2,"types":[]},"arrow_backward":{"character":"◀️","syllables":4,"types":[]},"arrow_double_down":{"character":"⏬","syllables":5,"types":[]},"arrow_double_up":{"character":"⏫","syllables":5,"types":[]},"arrow_down":{"character":"⬇️","syllables":3,"types":[]},"arrow_down_small":{"character":"🔽","syllables":4,"types":[]},"arrow_forward":{"character":"▶️","syllables":4,"types":[]},"arrow_heading_down":{"character":"⤵️","syllables":5,"types":[]},"arrow_heading_up":{"character":"⤴️","syllables":5,"types":[]},"arrow_left":{"character":"⬅️","syllables":3,"types":[]},"arrow_lower_left":{"character":"↙️","syllables":5,"types":[]},"arrow_lower_right":{"character":"↘️","syllables":5,"types":[]},"arrow_right":{"character":"➡️","syllables":3,"types":[]},"arrow_right_hook":{"character":"↪️","syllables":4,"types":[]},"arrow_up":{"character":"⬆️","syllables":3,"types":[]},"arrow_up_down":{"character":"↕️","syllables":4,"types":[]},"arrow_up_small":{"character":"🔼","syllables":4,"types":[]},"arrow_upper_left":{"character":"↖️","syllables":5,"types":[]},"arrow_upper_right":{"character":"↗️","syllables":5,"types":[]},"arrows_clockwise":{"character":"🔃","syllables":4,"types":[]},"arrows_counterclockwise":{"character":"🔄","syllables":6,"types":[]},"art":{"character":"🎨","syllables":1,"types":["noun","verb"]},"articulated_lorry":{"character":"🚛","syllables":7,"types":[]},"astonished":{"character":"😲","syllables":3,"types":["adjective","verb"]},"atm":{"character":"🏧","syllables":3,"types":["abbreviation"]},"b":{"character":"🅱","syllables":1,"types":["noun","abbreviation"]},"baby":{"character":"👶","syllables":2,"types":["noun","adjective","verb-transitive"]},"baby_bottle":{"character":"🍼","syllables":4,"types":[]},"baby_chick":{"character":"🐤","syllables":3,"types":[]},"baby_symbol":{"character":"🚼","syllables":4,"types":[]},"baggage_claim":{"character":"🛄","syllables":3,"types":[]},"balloon":{"character":"🎈","syllables":2,"types":["noun","verb-intransitive","verb-transitive","adjective"]},"ballot_box_with_check":{"character":"☑️","syllables":5,"types":[]},"bamboo":{"character":"🎍","syllables":2,"types":["noun"]},"banana":{"character":"🍌","syllables":3,"types":["noun"]},"bangbang":{"character":"‼️","syllables":2,"types":[]},"bank":{"character":"🏦","syllables":1,"types":["noun","verb-transitive","verb-intransitive","phrasal-verb"]},"bar_chart":{"character":"📊","syllables":2,"types":[]},"barber":{"character":"💈","syllables":2,"types":["noun","verb-transitive","verb-intransitive"]},"baseball":{"character":"⚾️","syllables":2,"types":["noun"]},"basketball":{"character":"🏀","syllables":3,"types":["noun"]},"bath":{"character":"🛀","syllables":1,"types":["noun"]},"bathtub":{"character":"🛁","syllables":2,"types":["noun"]},"battery":{"character":"🔋","syllables":3,"types":["noun"]},"bear":{"character":"🐻","syllables":1,"types":["verb-transitive","verb-intransitive","phrasal-verb","idiom","noun","adjective"]},"bee":{"character":"🐝","syllables":1,"types":["noun","idiom"]},"beer":{"character":"🍺","syllables":1,"types":["noun"]},"beers":{"character":"🍻","syllables":1,"types":["noun"]},"beetle":{"character":"🐞","syllables":2,"types":["noun","verb-intransitive","adjective"]},"beginner":{"character":"🔰","syllables":3,"types":["noun"]},"bell":{"character":"🔔","syllables":1,"types":["noun","verb-transitive","verb-intransitive","idiom"]},"bento":{"character":"🍱","syllables":2,"types":["noun"]},"bicyclist":{"character":"🚴","syllables":3,"types":["noun"]},"bike":{"character":"🚲","syllables":1,"types":["noun","verb-intransitive"]},"bikini":{"character":"👙","syllables":3,"types":["noun"]},"bird":{"character":"🐦","syllables":1,"types":["noun","verb-intransitive","idiom"]},"birthday":{"character":"🎂","syllables":2,"types":["noun"]},"black_circle":{"character":"⚫","syllables":3,"types":[]},"black_joker":{"character":"🃏","syllables":3,"types":[]},"black_nib":{"character":"✒️","syllables":2,"types":[]},"black_square":{"character":"⬛️","syllables":2,"types":[]},"black_square_button":{"character":"🔲","syllables":4,"types":[]},"blossom":{"character":"🌼","syllables":2,"types":["noun","verb-intransitive"]},"blowfish":{"character":"🐡","syllables":2,"types":["noun"]},"blue_book":{"character":"📘","syllables":2,"types":[]},"blue_car":{"character":"🚙","syllables":2,"types":[]},"blue_heart":{"character":"💙","syllables":2,"types":[]},"blush":{"character":"😊","syllables":1,"types":["verb-intransitive","noun"]},"boar":{"character":"🐗","syllables":1,"types":["noun"]},"boat":{"character":"⛵️","syllables":1,"types":["noun","verb-intransitive","verb-transitive","idiom"]},"bomb":{"character":"💣","syllables":1,"types":["noun","verb-transitive","verb-intransitive"]},"book":{"character":"📖","syllables":1,"types":["noun","verb-transitive","verb-intransitive","adjective","idiom"]},"bookmark":{"character":"🔖","syllables":2,"types":["noun"]},"bookmark_tabs":{"character":"📑","syllables":3,"types":[]},"books":{"character":"📚","syllables":1,"types":["noun","verb"]},"boom":{"character":"💥","syllables":1,"types":["verb-intransitive","verb-transitive","noun","idiom"]},"boot":{"character":"👢","syllables":1,"types":["noun","verb-transitive","verb-intransitive","idiom"]},"bouquet":{"character":"💐","syllables":2,"types":["noun"]},"bow":{"character":"🙇","syllables":1,"types":["noun","verb-intransitive","verb-transitive","phrasal-verb","idiom"]},"bowling":{"character":"🎳","syllables":2,"types":["noun"]},"boy":{"character":"👦","syllables":1,"types":["noun","interjection"]},"bread":{"character":"🍞","syllables":1,"types":["noun","verb-transitive"]},"bride_with_veil":{"character":"👰","syllables":3,"types":[]},"bridge_at_night":{"character":"🌉","syllables":3,"types":[]},"briefcase":{"character":"💼","syllables":2,"types":["noun"]},"broken_heart":{"character":"💔","syllables":3,"types":[]},"bug":{"character":"🐛","syllables":1,"types":["noun","verb-intransitive","verb-transitive","phrasal-verb","idiom"]},"bulb":{"character":"💡","syllables":1,"types":["noun"]},"bullettrain_front":{"character":"🚆","syllables":4,"types":[]},"bullettrain_side":{"character":"🚅","syllables":4,"types":[]},"bus":{"character":"🚌","syllables":1,"types":["noun","verb-transitive","verb-intransitive"]},"busstop":{"character":"🚏","syllables":2,"types":[]},"bust_in_silhouette":{"character":"👤","syllables":5,"types":[]},"busts_in_silhouette":{"character":"👥","syllables":5,"types":[]},"cactus":{"character":"🌵","syllables":2,"types":["noun"]},"cake":{"character":"🍰","syllables":1,"types":["noun","verb-transitive","verb-intransitive"]},"calendar":{"character":"📆","syllables":3,"types":["noun","verb-transitive"]},"calling":{"character":"📲","syllables":2,"types":["noun"]},"camel":{"character":"🐫","syllables":2,"types":["noun"]},"camera":{"character":"📷","syllables":3,"types":["noun","idiom"]},"cancer":{"character":"♋️","syllables":2,"types":["noun"]},"candy":{"character":"🍬","syllables":2,"types":["noun","verb-transitive","verb-intransitive"]},"capital_abcd":{"character":"🔠","syllables":7,"types":[]},"capricorn":{"character":"♑️","syllables":3,"types":[]},"car":{"character":"🚗","syllables":1,"types":["noun"]},"card_index":{"character":"📇","syllables":3,"types":[]},"carousel_horse":{"character":"🎠","syllables":4,"types":[]},"cat":{"character":"🐱","syllables":1,"types":["noun","verb-transitive","verb-intransitive","idiom"]},"cat2":{"character":"🐈","syllables":2,"types":[]},"cd":{"character":"💿","syllables":2,"types":["abbreviation"]},"chart":{"character":"💹","syllables":1,"types":["noun","verb-transitive","verb-intransitive"]},"chart_with_downwards_trend":{"character":"📉","syllables":5,"types":[]},"chart_with_upwards_trend":{"character":"📈","syllables":5,"types":[]},"checkered_flag":{"character":"🏁","syllables":3,"types":[]},"cherries":{"character":"🍒","syllables":2,"types":["noun"]},"cherry_blossom":{"character":"🌸","syllables":4,"types":[]},"chestnut":{"character":"🌰","syllables":2,"types":["noun","adjective"]},"chicken":{"character":"🐔","syllables":2,"types":["noun","adjective","verb-intransitive"]},"children_crossing":{"character":"🚸","syllables":4,"types":[]},"chocolate_bar":{"character":"🍫","syllables":3,"types":[]},"christmas_tree":{"character":"🎄","syllables":3,"types":[]},"church":{"character":"⛪️","syllables":1,"types":["noun","verb-transitive","adjective"]},"cinema":{"character":"🎦","syllables":3,"types":["noun"]},"circus_tent":{"character":"🎪","syllables":3,"types":[]},"city_sunrise":{"character":"🌇","syllables":4,"types":[]},"city_sunset":{"character":"🌆","syllables":4,"types":[]},"cl":{"character":"🆑","syllables":2,"types":["abbreviation"]},"clap":{"character":"👏","syllables":1,"types":["verb-intransitive","verb-transitive","noun"]},"clapper":{"character":"🎬","syllables":2,"types":["noun"]},"clipboard":{"character":"📋","syllables":2,"types":["noun"]},"clock1":{"character":"🕐","syllables":2,"types":[]},"clock10":{"character":"🕙","syllables":2,"types":[]},"clock1030":{"character":"🕥","syllables":4,"types":[]},"clock11":{"character":"🕚","syllables":4,"types":[]},"clock1130":{"character":"🕦","syllables":6,"types":[]},"clock12":{"character":"🕛","syllables":2,"types":[]},"clock1230":{"character":"🕧","syllables":4,"types":[]},"clock130":{"character":"🕜","syllables":4,"types":[]},"clock2":{"character":"🕑","syllables":2,"types":[]},"clock230":{"character":"🕝","syllables":4,"types":[]},"clock3":{"character":"🕒","syllables":2,"types":[]},"clock330":{"character":"🕞","syllables":4,"types":[]},"clock4":{"character":"🕓","syllables":2,"types":[]},"clock430":{"character":"🕟","syllables":4,"types":[]},"clock5":{"character":"🕔","syllables":2,"types":[]},"clock530":{"character":"🕠","syllables":4,"types":[]},"clock6":{"character":"🕕","syllables":2,"types":[]},"clock630":{"character":"🕡","syllables":4,"types":[]},"clock7":{"character":"🕖","syllables":3,"types":[]},"clock730":{"character":"🕢","syllables":5,"types":[]},"clock8":{"character":"🕗","syllables":2,"types":[]},"clock830":{"character":"🕣","syllables":4,"types":[]},"clock9":{"character":"🕘","syllables":2,"types":[]},"clock930":{"character":"🕤","syllables":4,"types":[]},"closed_book":{"character":"📕","syllables":2,"types":[]},"closed_lock_with_key":{"character":"🔐","syllables":4,"types":[]},"closed_umbrella":{"character":"🌂","syllables":4,"types":[]},"cloud":{"character":"☁️","syllables":1,"types":["noun","verb-transitive","verb-intransitive","idiom"]},"clubs":{"character":"♣️","syllables":1,"types":["verb","noun"]},"cn":{"character":"🇨🇳","syllables":2,"types":[]},"cocktail":{"character":"🍸","syllables":2,"types":["noun","adjective"]},"coffee":{"character":"☕️","syllables":2,"types":["noun"]},"cold_sweat":{"character":"😰","syllables":2,"types":[]},"collision":{"character":"💥","syllables":3,"types":["noun"]},"computer":{"character":"💻","syllables":3,"types":["noun"]},"confetti_ball":{"character":"🎊","syllables":4,"types":[]},"confounded":{"character":"😖","syllables":3,"types":["adjective"]},"confused":{"character":"😕","syllables":2,"types":["adjective"]},"congratulations":{"character":"㊗️","syllables":5,"types":["interjection","noun"]},"construction":{"character":"🚧","syllables":3,"types":["noun"]},"construction_worker":{"character":"👷","syllables":5,"types":[]},"convenience_store":{"character":"🏪","syllables":4,"types":[]},"cookie":{"character":"🍪","syllables":2,"types":["noun"]},"cool":{"character":"🆒","syllables":1,"types":["adjective","adverb","verb-transitive","verb-intransitive","noun","idiom"]},"cop":{"character":"👮","syllables":1,"types":["noun","verb-transitive","phrasal-verb","idiom"]},"copyright":{"character":"©","syllables":3,"types":["noun","adjective","verb-transitive"]},"corn":{"character":"🌽","syllables":1,"types":["noun","verb-transitive","verb-intransitive"]},"couple":{"character":"👫","syllables":2,"types":["noun","verb-transitive","verb-intransitive","adjective"]},"couple_with_heart":{"character":"💑","syllables":4,"types":[]},"couplekiss":{"character":"💏","syllables":3,"types":[]},"cow":{"character":"🐮","syllables":1,"types":["noun","idiom","verb-transitive"]},"cow2":{"character":"🐄","syllables":2,"types":[]},"credit_card":{"character":"💳","syllables":3,"types":[]},"crocodile":{"character":"🐊","syllables":3,"types":["noun"]},"crossed_flags":{"character":"🎌","syllables":2,"types":[]},"crown":{"character":"👑","syllables":1,"types":["noun","verb-transitive","verb-intransitive"]},"cry":{"character":"😢","syllables":1,"types":["verb-intransitive","verb-transitive","noun","phrasal-verb","idiom"]},"crying_cat_face":{"character":"😿","syllables":4,"types":[]},"crystal_ball":{"character":"🔮","syllables":3,"types":[]},"cupid":{"character":"💘","syllables":2,"types":["noun"]},"curly_loop":{"character":"➰","syllables":3,"types":[]},"currency_exchange":{"character":"💱","syllables":5,"types":[]},"curry":{"character":"🍛","syllables":2,"types":["verb-transitive","idiom","noun"]},"custard":{"character":"🍮","syllables":2,"types":["noun"]},"customs":{"character":"🛃","syllables":2,"types":["noun"]},"cyclone":{"character":"🌀","syllables":2,"types":["noun"]},"dancer":{"character":"💃","syllables":2,"types":["noun"]},"dancers":{"character":"👯","syllables":2,"types":["noun"]},"dango":{"character":"🍡","syllables":2,"types":[]},"dart":{"character":"🎯","syllables":1,"types":["noun","verb-intransitive","verb-transitive"]},"dash":{"character":"💨","syllables":1,"types":["verb-transitive","verb-intransitive","noun"]},"date":{"character":"📅","syllables":1,"types":["noun","verb-transitive","verb-intransitive","idiom"]},"de":{"character":"🇩🇪","syllables":1,"types":["noun","verb"]},"deciduous_tree":{"character":"🌳","syllables":5,"types":[]},"department_store":{"character":"🏬","syllables":4,"types":[]},"diamond_shape_with_a_dot_inside":{"character":"💠","syllables":8,"types":[]},"diamonds":{"character":"♦️","syllables":2,"types":["noun","verb"]},"disappointed":{"character":"😞","syllables":4,"types":["adjective"]},"disappointed_relieved":{"character":"😥","syllables":6,"types":[]},"dizzy":{"character":"💫","syllables":2,"types":["adjective","verb-transitive"]},"dizzy_face":{"character":"😵","syllables":3,"types":[]},"do_not_litter":{"character":"🚯","syllables":4,"types":[]},"dog":{"character":"🐶","syllables":1,"types":["noun","adverb","verb-transitive","idiom"]},"dog2":{"character":"🐕","syllables":2,"types":[]},"dollar":{"character":"💵","syllables":2,"types":["noun"]},"dolls":{"character":"🎎","syllables":1,"types":["noun"]},"dolphin":{"character":"🐬","syllables":2,"types":["noun"]},"donut":{"character":"🍩","syllables":2,"types":["noun"]},"door":{"character":"🚪","syllables":1,"types":["noun","verb-transitive","idiom"]},"doughnut":{"character":"🍩","syllables":2,"types":["noun"]},"dragon":{"character":"🐉","syllables":2,"types":["noun"]},"dragon_face":{"character":"🐲","syllables":3,"types":[]},"dress":{"character":"👗","syllables":1,"types":["verb-transitive","verb-intransitive","noun","adjective","phrasal-verb","idiom"]},"dromedary_camel":{"character":"🐪","syllables":6,"types":[]},"droplet":{"character":"💧","syllables":2,"types":["noun"]},"dvd":{"character":"📀","syllables":3,"types":[]},"e-mail":{"character":"📧","syllables":2,"types":["noun","verb-transitive"]},"ear":{"character":"👂","syllables":1,"types":["noun","idiom","verb-intransitive"]},"ear_of_rice":{"character":"🌾","syllables":3,"types":[]},"earth_africa":{"character":"🌍","syllables":4,"types":[]},"earth_americas":{"character":"🌎","syllables":5,"types":[]},"earth_asia":{"character":"🌏","syllables":3,"types":[]},"egg":{"character":"🍳","syllables":1,"types":["noun","verb-transitive","idiom"]},"eggplant":{"character":"🍆","syllables":2,"types":["noun"]},"eight":{"character":"8️⃣","syllables":1,"types":["noun"]},"eight_pointed_black_star":{"character":"✴️","syllables":5,"types":[]},"eight_spoked_asterisk":{"character":"✳️","syllables":4,"types":[]},"electric_plug":{"character":"🔌","syllables":4,"types":[]},"elephant":{"character":"🐘","syllables":3,"types":["noun"]},"email":{"character":"📩","syllables":2,"types":["noun","verb"]},"end":{"character":"🔚","syllables":1,"types":["noun","verb-transitive","verb-intransitive","idiom"]},"envelope":{"character":"✉️","syllables":3,"types":["noun","idiom"]},"es":{"character":"🇪🇸","syllables":1,"types":["noun"]},"euro":{"character":"💶","syllables":2,"types":["noun"]},"european_castle":{"character":"🏰","syllables":6,"types":[]},"european_post_office":{"character":"🏤","syllables":7,"types":[]},"evergreen_tree":{"character":"🌲","syllables":4,"types":[]},"exclamation":{"character":"❗️","syllables":4,"types":["noun"]},"expressionless":{"character":"😑","syllables":4,"types":["adjective"]},"eyeglasses":{"character":"👓","syllables":3,"types":["noun"]},"eyes":{"character":"👀","syllables":1,"types":["noun","verb"]},"facepunch":{"character":"👊","syllables":2,"types":[]},"factory":{"character":"🏭","syllables":3,"types":["noun"]},"fallen_leaf":{"character":"🍂","syllables":3,"types":[]},"family":{"character":"👪","syllables":3,"types":["noun","adjective"]},"fast_forward":{"character":"⏩","syllables":3,"types":[]},"fax":{"character":"📠","syllables":1,"types":["noun","verb-transitive"]},"fearful":{"character":"😨","syllables":2,"types":["adjective"]},"feet":{"character":"👣","syllables":1,"types":["noun"]},"ferris_wheel":{"character":"🎡","syllables":3,"types":[]},"file_folder":{"character":"📁","syllables":3,"types":[]},"fire":{"character":"🔥","syllables":2,"types":["noun","verb-transitive","verb-intransitive","phrasal-verb","idiom"]},"fire_engine":{"character":"🚒","syllables":4,"types":[]},"fireworks":{"character":"🎆","syllables":2,"types":["noun"]},"first_quarter_moon":{"character":"🌓","syllables":4,"types":[]},"first_quarter_moon_with_face":{"character":"🌛","syllables":6,"types":[]},"fish":{"character":"🐟","syllables":1,"types":["noun","verb-intransitive","verb-transitive","phrasal-verb","idiom"]},"fish_cake":{"character":"🍥","syllables":2,"types":[]},"fishing_pole_and_fish":{"character":"🎣","syllables":5,"types":[]},"fist":{"character":"✊","syllables":1,"types":["noun","verb-transitive"]},"five":{"character":"5️⃣","syllables":1,"types":["noun"]},"flags":{"character":"🎏","syllables":1,"types":["noun"]},"flashlight":{"character":"🔦","syllables":2,"types":["noun"]},"floppy_disk":{"character":"💾","syllables":3,"types":[]},"flower_playing_cards":{"character":"🎴","syllables":5,"types":[]},"flushed":{"character":"😳","syllables":1,"types":["adjective","verb"]},"foggy":{"character":"🌁","syllables":2,"types":["adjective"]},"football":{"character":"🏈","syllables":2,"types":["noun"]},"fork_and_knife":{"character":"🍴","syllables":3,"types":[]},"fountain":{"character":"⛲️","syllables":2,"types":["noun","verb-transitive"]},"four":{"character":"4️⃣","syllables":1,"types":["noun","idiom"]},"four_leaf_clover":{"character":"🍀","syllables":4,"types":[]},"fr":{"character":"🇫🇷","syllables":2,"types":[]},"free":{"character":"🆓","syllables":1,"types":["adjective","adverb","verb-transitive","idiom"]},"fried_shrimp":{"character":"🍤","syllables":2,"types":[]},"fries":{"character":"🍟","syllables":1,"types":["verb","noun"]},"frog":{"character":"🐸","syllables":1,"types":["noun"]},"frowning":{"character":"😦","syllables":2,"types":["verb"]},"fuelpump":{"character":"⛽️","syllables":2,"types":[]},"full_moon":{"character":"🌕","syllables":2,"types":[]},"full_moon_with_face":{"character":"🌝","syllables":4,"types":[]},"game_die":{"character":"🎲","syllables":2,"types":[]},"gb":{"character":"🇬🇧","syllables":2,"types":[]},"gem":{"character":"💎","syllables":1,"types":["noun","verb-transitive"]},"gemini":{"character":"♊️","syllables":3,"types":[]},"ghost":{"character":"👻","syllables":1,"types":["noun","verb-intransitive","verb-transitive"]},"gift":{"character":"🎁","syllables":1,"types":["noun","verb-transitive"]},"gift_heart":{"character":"💝","syllables":2,"types":[]},"girl":{"character":"👧","syllables":1,"types":["noun"]},"globe_with_meridians":{"character":"🌐","syllables":2,"types":[]},"goat":{"character":"🐐","syllables":1,"types":["noun"]},"golf":{"character":"⛳️","syllables":1,"types":["noun","verb-intransitive"]},"grapes":{"character":"🍇","syllables":1,"types":["noun"]},"green_apple":{"character":"🍏","syllables":3,"types":[]},"green_book":{"character":"📗","syllables":2,"types":[]},"green_heart":{"character":"💚","syllables":2,"types":[]},"grey_exclamation":{"character":"❕","syllables":5,"types":[]},"grey_question":{"character":"❔","syllables":3,"types":[]},"grimacing":{"character":"😬","syllables":3,"types":["verb"]},"grin":{"character":"😁","syllables":1,"types":["verb-intransitive","verb-transitive","noun"]},"grinning":{"character":"😀","syllables":2,"types":["verb"]},"guardsman":{"character":"💂","syllables":2,"types":["noun"]},"guitar":{"character":"🎸","syllables":2,"types":["noun"]},"gun":{"character":"🔫","syllables":1,"types":["noun","verb-transitive","verb-intransitive","phrasal-verb","idiom"]},"haircut":{"character":"💇","syllables":2,"types":["noun"]},"hamburger":{"character":"🍔","syllables":3,"types":["noun"]},"hammer":{"character":"🔨","syllables":2,"types":["noun","verb-transitive","verb-intransitive","idiom"]},"hamster":{"character":"🐹","syllables":2,"types":["noun"]},"hand":{"character":"✋","syllables":1,"types":["noun","verb-transitive","verb-intransitive","phrasal-verb","idiom"]},"handbag":{"character":"👜","syllables":2,"types":["noun"]},"hankey":{"character":"💩","syllables":2,"types":["noun"]},"hash":{"character":"#️⃣","syllables":1,"types":["noun","verb-transitive","idiom"]},"hatched_chick":{"character":"🐥","syllables":2,"types":[]},"hatching_chick":{"character":"🐣","syllables":3,"types":[]},"headphones":{"character":"🎧","syllables":2,"types":["noun"]},"hear_no_evil":{"character":"🙉","syllables":4,"types":[]},"heart":{"character":"❤️","syllables":1,"types":["noun","verb-transitive","idiom"]},"heart_decoration":{"character":"💟","syllables":5,"types":[]},"heart_eyes":{"character":"😍","syllables":2,"types":[]},"heart_eyes_cat":{"character":"😻","syllables":3,"types":[]},"heartbeat":{"character":"💓","syllables":2,"types":["noun"]},"heartpulse":{"character":"💗","syllables":2,"types":[]},"hearts":{"character":"♥️","syllables":1,"types":["noun","verb"]},"heavy_check_mark":{"character":"✔️","syllables":4,"types":[]},"heavy_division_sign":{"character":"➗","syllables":6,"types":[]},"heavy_dollar_sign":{"character":"💲","syllables":5,"types":[]},"heavy_exclamation_mark":{"character":"❗️","syllables":7,"types":[]},"heavy_minus_sign":{"character":"➖","syllables":5,"types":[]},"heavy_multiplication_x":{"character":"✖️","syllables":8,"types":[]},"heavy_plus_sign":{"character":"➕","syllables":4,"types":[]},"helicopter":{"character":"🚁","syllables":4,"types":["noun","verb-transitive"]},"herb":{"character":"🌿","syllables":1,"types":["noun"]},"hibiscus":{"character":"🌺","syllables":3,"types":["noun"]},"high_brightness":{"character":"🔆","syllables":3,"types":[]},"high_heel":{"character":"👠","syllables":2,"types":[]},"hocho":{"character":"🔪","syllables":2,"types":[]},"honey_pot":{"character":"🍯","syllables":3,"types":[]},"honeybee":{"character":"🐝","syllables":3,"types":["noun"]},"horse":{"character":"🐴","syllables":1,"types":["noun","verb-transitive","verb-intransitive","adjective","phrasal-verb","idiom"]},"horse_racing":{"character":"🏇","syllables":3,"types":[]},"hospital":{"character":"🏥","syllables":3,"types":["noun"]},"hotel":{"character":"🏨","syllables":2,"types":["noun"]},"hotsprings":{"character":"♨️","syllables":2,"types":[]},"hourglass":{"character":"⌛️","syllables":3,"types":["noun","adjective"]},"hourglass_flowing_sand":{"character":"⏳","syllables":6,"types":[]},"house":{"character":"🏠","syllables":1,"types":["noun","verb-transitive","verb-intransitive","idiom"]},"house_with_garden":{"character":"🏡","syllables":4,"types":[]},"hushed":{"character":"😧","syllables":1,"types":["adjective","verb"]},"ice_cream":{"character":"🍨","syllables":2,"types":[]},"icecream":{"character":"🍦","syllables":2,"types":["noun"]},"id":{"character":"🆔","syllables":1,"types":["noun"]},"ideograph_advantage":{"character":"🉐","syllables":3,"types":[]},"imp":{"character":"👿","syllables":1,"types":["noun","verb-transitive"]},"inbox_tray":{"character":"📥","syllables":1,"types":[]},"incoming_envelope":{"character":"📨","syllables":6,"types":[]},"information_desk_person":{"character":"💁","syllables":7,"types":[]},"information_source":{"character":"ℹ️","syllables":5,"types":[]},"innocent":{"character":"😇","syllables":3,"types":["adjective","noun"]},"interrobang":{"character":"⁉️","syllables":4,"types":["noun"]},"iphone":{"character":"📱","syllables":2,"types":[]},"it":{"character":"🇮🇹","syllables":1,"types":["pronoun","noun","idiom"]},"izakaya_lantern":{"character":"🏮","syllables":2,"types":[]},"jack_o_lantern":{"character":"🎃","syllables":4,"types":[]},"japan":{"character":"🗾","syllables":2,"types":["noun","verb-transitive"]},"japanese_castle":{"character":"🏯","syllables":5,"types":[]},"japanese_goblin":{"character":"👺","syllables":5,"types":[]},"japanese_ogre":{"character":"👹","syllables":5,"types":[]},"jeans":{"character":"👖","syllables":1,"types":["noun"]},"joy":{"character":"😂","syllables":1,"types":["noun","verb-intransitive","verb-transitive"]},"joy_cat":{"character":"😹","syllables":2,"types":[]},"jp":{"character":"🇯🇵","syllables":2,"types":["abbreviation"]},"key":{"character":"🔑","syllables":1,"types":["noun","adjective","verb-transitive","verb-intransitive","phrasal-verb","idiom"]},"keycap_ten":{"character":"🔟","syllables":1,"types":[]},"kimono":{"character":"👘","syllables":3,"types":["noun"]},"kiss":{"character":"💋","syllables":1,"types":["verb-transitive","verb-intransitive","noun","phrasal-verb","idiom"]},"kissing":{"character":"😗","syllables":2,"types":["verb","adjective"]},"kissing_cat":{"character":"😽","syllables":3,"types":[]},"kissing_closed_eyes":{"character":"😚","syllables":4,"types":[]},"kissing_face":{"character":"😚","syllables":3,"types":[]},"kissing_heart":{"character":"😘","syllables":3,"types":[]},"kissing_smiling_eyes":{"character":"😙","syllables":5,"types":[]},"koala":{"character":"🐨","syllables":3,"types":["noun"]},"koko":{"character":"🈁","syllables":2,"types":["noun"]},"kr":{"character":"🇰🇷","syllables":2,"types":[]},"large_blue_circle":{"character":"🔵","syllables":4,"types":[]},"large_blue_diamond":{"character":"🔷","syllables":4,"types":[]},"large_orange_diamond":{"character":"🔶","syllables":5,"types":[]},"last_quarter_moon":{"character":"🌗","syllables":4,"types":[]},"last_quarter_moon_with_face":{"character":"🌜","syllables":6,"types":[]},"laughing":{"character":"😆","syllables":2,"types":["noun","verb"]},"leaves":{"character":"🍃","syllables":1,"types":["noun"]},"ledger":{"character":"📒","syllables":2,"types":["noun"]},"left_luggage":{"character":"🛅","syllables":3,"types":[]},"left_right_arrow":{"character":"↔️","syllables":4,"types":[]},"leftwards_arrow_with_hook":{"character":"↩️","syllables":4,"types":[]},"lemon":{"character":"🍋","syllables":2,"types":["noun","adjective"]},"leo":{"character":"♌️","syllables":2,"types":[]},"leopard":{"character":"🐆","syllables":2,"types":["noun"]},"libra":{"character":"♎️","syllables":2,"types":["noun"]},"light_rail":{"character":"🚈","syllables":2,"types":[]},"link":{"character":"🔗","syllables":1,"types":["noun","verb-transitive","verb-intransitive"]},"lips":{"character":"👄","syllables":1,"types":["noun"]},"lipstick":{"character":"💄","syllables":2,"types":["noun"]},"lock":{"character":"🔒","syllables":1,"types":["noun","verb-transitive","verb-intransitive","phrasal-verb","idiom"]},"lock_with_ink_pen":{"character":"🔏","syllables":4,"types":[]},"lollipop":{"character":"🍭","syllables":3,"types":["noun"]},"loop":{"character":"➿","syllables":1,"types":["noun","verb-transitive","verb-intransitive","idiom"]},"loudspeaker":{"character":"📢","syllables":3,"types":["noun"]},"love_hotel":{"character":"🏩","syllables":3,"types":[]},"love_letter":{"character":"💌","syllables":3,"types":[]},"low_brightness":{"character":"🔅","syllables":3,"types":[]},"m":{"character":"ⓜ","syllables":1,"types":["noun","abbreviation"]},"mag":{"character":"🔍","syllables":1,"types":["noun"]},"mag_right":{"character":"🔎","syllables":2,"types":[]},"mahjong":{"character":"🀄️","syllables":2,"types":["noun"]},"mailbox":{"character":"📫","syllables":2,"types":["noun"]},"mailbox_closed":{"character":"📪","syllables":3,"types":[]},"mailbox_with_mail":{"character":"📬","syllables":4,"types":[]},"mailbox_with_no_mail":{"character":"📭","syllables":5,"types":[]},"man":{"character":"👨","syllables":1,"types":["noun","verb-transitive","interjection","idiom"]},"man_with_gua_pi_mao":{"character":"👲","syllables":4,"types":[]},"man_with_turban":{"character":"👳","syllables":4,"types":[]},"mans_shoe":{"character":"👞","syllables":2,"types":[]},"maple_leaf":{"character":"🍁","syllables":3,"types":[]},"mask":{"character":"😷","syllables":1,"types":["noun","verb-transitive","verb-intransitive"]},"massage":{"character":"💆","syllables":2,"types":["noun","verb-transitive"]},"meat_on_bone":{"character":"🍖","syllables":3,"types":[]},"mega":{"character":"📣","syllables":2,"types":["adjective"]},"melon":{"character":"🍈","syllables":2,"types":["noun"]},"memo":{"character":"📝","syllables":2,"types":["noun"]},"mens":{"character":"🚹","syllables":1,"types":[]},"metro":{"character":"🚇","syllables":2,"types":["noun","adjective"]},"microphone":{"character":"🎤","syllables":3,"types":["noun"]},"microscope":{"character":"🔬","syllables":3,"types":["noun"]},"milky_way":{"character":"🌌","syllables":3,"types":[]},"minibus":{"character":"🚐","syllables":3,"types":["noun"]},"minidisc":{"character":"💽","syllables":3,"types":["noun"]},"mobile_phone_off":{"character":"📴","syllables":4,"types":[]},"money_with_wings":{"character":"💸","syllables":4,"types":[]},"moneybag":{"character":"💰","syllables":3,"types":["noun"]},"monkey":{"character":"🐒","syllables":2,"types":["noun","verb-intransitive","verb-transitive"]},"monkey_face":{"character":"🐵","syllables":3,"types":[]},"monorail":{"character":"🚝","syllables":3,"types":["noun"]},"moon":{"character":"🌙","syllables":1,"types":["noun","verb-intransitive","verb-transitive"]},"mortar_board":{"character":"🎓","syllables":3,"types":[]},"mount_fuji":{"character":"🗻","syllables":3,"types":[]},"mountain_bicyclist":{"character":"🚵","syllables":5,"types":[]},"mountain_cableway":{"character":"🚠","syllables":2,"types":[]},"mountain_railway":{"character":"🚞","syllables":4,"types":[]},"mouse":{"character":"🐭","syllables":1,"types":["noun","verb-intransitive"]},"mouse2":{"character":"🐁","syllables":2,"types":[]},"movie_camera":{"character":"🎥","syllables":5,"types":[]},"moyai":{"character":"🗿","syllables":2,"types":[]},"muscle":{"character":"💪","syllables":2,"types":["noun","verb-intransitive","verb-transitive"]},"mushroom":{"character":"🍄","syllables":2,"types":["noun","verb-intransitive","adjective"]},"musical_keyboard":{"character":"🎹","syllables":5,"types":[]},"musical_note":{"character":"🎵","syllables":4,"types":[]},"musical_score":{"character":"🎼","syllables":4,"types":[]},"mute":{"character":"🔇","syllables":1,"types":["adjective","noun","verb-transitive"]},"nail_care":{"character":"💅","syllables":2,"types":[]},"name_badge":{"character":"📛","syllables":2,"types":[]},"necktie":{"character":"👔","syllables":2,"types":["noun"]},"negative_squared_cross_mark":{"character":"❎","syllables":6,"types":[]},"neutral_face":{"character":"😐","syllables":3,"types":[]},"new":{"character":"🆕","syllables":1,"types":["adjective","adverb"]},"new_moon":{"character":"🌑","syllables":2,"types":[]},"new_moon_with_face":{"character":"🌚","syllables":4,"types":[]},"newspaper":{"character":"📰","syllables":3,"types":["noun"]},"ng":{"character":"🆖","syllables":1,"types":["abbreviation"]},"nine":{"character":"9️⃣","syllables":1,"types":["noun","idiom"]},"no_bell":{"character":"🔕","syllables":2,"types":[]},"no_bicycles":{"character":"🚳","syllables":4,"types":[]},"no_entry":{"character":"⛔️","syllables":3,"types":[]},"no_entry_sign":{"character":"🚫","syllables":4,"types":[]},"no_good":{"character":"🙅","syllables":2,"types":[]},"no_mobile_phones":{"character":"📵","syllables":4,"types":[]},"no_mouth":{"character":"😶","syllables":2,"types":[]},"no_pedestrians":{"character":"🚷","syllables":5,"types":[]},"no_smoking":{"character":"🚭","syllables":3,"types":[]},"non-potable_water":{"character":"🚱","syllables":6,"types":[]},"nose":{"character":"👃","syllables":1,"types":["noun","verb-transitive","verb-intransitive","phrasal-verb","idiom"]},"notebook":{"character":"📓","syllables":2,"types":["noun"]},"notebook_with_decorative_cover":{"character":"📔","syllables":8,"types":[]},"notes":{"character":"🎶","syllables":1,"types":["noun"]},"nut_and_bolt":{"character":"🔩","syllables":3,"types":[]},"o":{"character":"⭕️","syllables":1,"types":["noun"]},"o2":{"character":"🅾","syllables":2,"types":[]},"ocean":{"character":"🌊","syllables":2,"types":["noun"]},"octopus":{"character":"🐙","syllables":3,"types":["noun"]},"oden":{"character":"🍢","syllables":2,"types":[]},"office":{"character":"🏢","syllables":2,"types":["noun"]},"ok":{"character":"🆗","syllables":2,"types":["adjective"]},"ok_hand":{"character":"👌","syllables":3,"types":[]},"ok_woman":{"character":"🙆","syllables":4,"types":[]},"older_man":{"character":"👴","syllables":3,"types":[]},"older_woman":{"character":"👵","syllables":4,"types":[]},"on":{"character":"🔛","syllables":1,"types":["preposition","adverb","adjective","idiom"]},"oncoming_automobile":{"character":"🚘","syllables":7,"types":[]},"oncoming_bus":{"character":"🚍","syllables":4,"types":[]},"oncoming_police_car":{"character":"🚔","syllables":6,"types":[]},"oncoming_taxi":{"character":"🚖","syllables":5,"types":[]},"one":{"character":"1️⃣","syllables":1,"types":["adjective","noun","pronoun","idiom"]},"open_file_folder":{"character":"📂","syllables":5,"types":[]},"open_hands":{"character":"👐","syllables":3,"types":[]},"open_mouth":{"character":"😮","syllables":3,"types":[]},"ophiuchus":{"character":"⛎","syllables":4,"types":[]},"orange_book":{"character":"📙","syllables":3,"types":[]},"outbox_tray":{"character":"📤","syllables":1,"types":[]},"ox":{"character":"🐂","syllables":1,"types":["noun"]},"page_facing_up":{"character":"📄","syllables":4,"types":[]},"page_with_curl":{"character":"📃","syllables":3,"types":[]},"pager":{"character":"📟","syllables":2,"types":["noun"]},"palm_tree":{"character":"🌴","syllables":2,"types":[]},"panda_face":{"character":"🐼","syllables":3,"types":[]},"paperclip":{"character":"📎","syllables":3,"types":["noun"]},"parking":{"character":"🅿️","syllables":2,"types":["noun"]},"part_alternation_mark":{"character":"〽️","syllables":6,"types":[]},"partly_sunny":{"character":"⛅️","syllables":4,"types":[]},"passport_control":{"character":"🛂","syllables":4,"types":[]},"paw_prints":{"character":"🐾","syllables":2,"types":[]},"peach":{"character":"🍑","syllables":1,"types":["noun","verb-intransitive","verb-transitive"]},"pear":{"character":"🍐","syllables":1,"types":["noun"]},"pencil":{"character":"📝","syllables":2,"types":["noun","verb-transitive","phrasal-verb"]},"pencil2":{"character":"✏️","syllables":3,"types":[]},"penguin":{"character":"🐧","syllables":2,"types":["noun"]},"pensive":{"character":"😔","syllables":2,"types":["adjective"]},"performing_arts":{"character":"🎭","syllables":4,"types":[]},"persevere":{"character":"😣","syllables":3,"types":["verb-intransitive"]},"person_frowning":{"character":"🙍","syllables":4,"types":[]},"person_with_blond_hair":{"character":"👱","syllables":5,"types":[]},"person_with_pouting_face":{"character":"🙎","syllables":6,"types":[]},"phone":{"character":"☎️","syllables":1,"types":["noun","verb-intransitive","verb-transitive"]},"pig":{"character":"🐷","syllables":1,"types":["noun","verb-intransitive","phrasal-verb","idiom"]},"pig2":{"character":"🐖","syllables":2,"types":[]},"pig_nose":{"character":"🐽","syllables":2,"types":[]},"pill":{"character":"💊","syllables":1,"types":["noun","verb-transitive","verb-intransitive"]},"pineapple":{"character":"🍍","syllables":3,"types":["noun"]},"pisces":{"character":"♓️","syllables":2,"types":[]},"pizza":{"character":"🍕","syllables":2,"types":["noun"]},"plus1":{"character":"👍","syllables":2,"types":[]},"point_down":{"character":"👇","syllables":2,"types":[]},"point_left":{"character":"👈","syllables":2,"types":[]},"point_right":{"character":"👉","syllables":2,"types":[]},"point_up":{"character":"☝️","syllables":2,"types":[]},"point_up_2":{"character":"👆","syllables":2,"types":[]},"police_car":{"character":"🚓","syllables":3,"types":[]},"poodle":{"character":"🐩","syllables":2,"types":["noun"]},"poop":{"character":"💩","syllables":1,"types":["noun","verb-transitive","phrasal-verb","verb-intransitive"]},"post_office":{"character":"🏣","syllables":3,"types":[]},"postal_horn":{"character":"📯","syllables":3,"types":[]},"postbox":{"character":"📮","syllables":2,"types":["noun"]},"potable_water":{"character":"🚰","syllables":5,"types":[]},"pouch":{"character":"👝","syllables":1,"types":["noun","verb-transitive","verb-intransitive"]},"poultry_leg":{"character":"🍗","syllables":3,"types":[]},"pound":{"character":"💷","syllables":1,"types":["noun","verb-transitive","verb-intransitive","idiom"]},"pouting_cat":{"character":"😾","syllables":3,"types":[]},"pray":{"character":"🙏","syllables":1,"types":["verb-intransitive","verb-transitive"]},"princess":{"character":"👸","syllables":2,"types":["noun","adjective"]},"punch":{"character":"👊","syllables":1,"types":["noun","verb-transitive","phrasal-verb","idiom"]},"purple_heart":{"character":"💜","syllables":3,"types":[]},"purse":{"character":"👛","syllables":1,"types":["noun","verb-transitive"]},"pushpin":{"character":"📌","syllables":2,"types":["noun"]},"put_litter_in_its_place":{"character":"🚮","syllables":6,"types":[]},"question":{"character":"❓","syllables":2,"types":["noun","verb-transitive","verb-intransitive","idiom"]},"rabbit":{"character":"🐰","syllables":2,"types":["noun","verb-intransitive"]},"rabbit2":{"character":"🐇","syllables":3,"types":[]},"racehorse":{"character":"🐎","syllables":2,"types":["noun"]},"radio":{"character":"📻","syllables":3,"types":["noun","verb-transitive","verb-intransitive"]},"radio_button":{"character":"🔘","syllables":5,"types":[]},"rage":{"character":"😡","syllables":1,"types":["noun","verb-intransitive"]},"railway_car":{"character":"🚋","syllables":3,"types":[]},"rainbow":{"character":"🌈","syllables":2,"types":["noun"]},"raised_hand":{"character":"✋","syllables":2,"types":[]},"raised_hands":{"character":"🙌","syllables":2,"types":[]},"raising_hand":{"character":"🙋","syllables":3,"types":[]},"ram":{"character":"🐏","syllables":1,"types":["noun","verb-transitive"]},"ramen":{"character":"🍜","syllables":2,"types":["noun"]},"rat":{"character":"🐀","syllables":1,"types":["noun","verb-intransitive","verb-transitive"]},"recycle":{"character":"♻️","syllables":3,"types":["verb-transitive"]},"red_car":{"character":"🚗","syllables":2,"types":[]},"red_circle":{"character":"🔴","syllables":3,"types":[]},"registered":{"character":"®","syllables":3,"types":["adjective"]},"relaxed":{"character":"☺️","syllables":2,"types":["adjective"]},"relieved":{"character":"😌","syllables":2,"types":["adjective","verb"]},"repeat":{"character":"🔁","syllables":2,"types":["verb-transitive","verb-intransitive","noun","adjective"]},"repeat_one":{"character":"🔂","syllables":3,"types":[]},"restroom":{"character":"🚻","syllables":2,"types":["noun"]},"revolving_hearts":{"character":"💞","syllables":4,"types":[]},"rewind":{"character":"⏪","syllables":2,"types":["verb-transitive","noun"]},"ribbon":{"character":"🎀","syllables":2,"types":["noun","verb-transitive"]},"rice":{"character":"🍚","syllables":1,"types":["noun","verb-transitive"]},"rice_ball":{"character":"🍙","syllables":2,"types":[]},"rice_cracker":{"character":"🍘","syllables":3,"types":[]},"rice_scene":{"character":"🎑","syllables":2,"types":[]},"ring":{"character":"💍","syllables":1,"types":["noun","verb-transitive","verb-intransitive","phrasal-verb","idiom"]},"rocket":{"character":"🚀","syllables":2,"types":["noun","verb-intransitive","verb-transitive"]},"roller_coaster":{"character":"🎢","syllables":4,"types":[]},"rooster":{"character":"🐓","syllables":2,"types":["noun"]},"rose":{"character":"🌹","syllables":1,"types":["noun","adjective","idiom","verb"]},"rotating_light":{"character":"🚨","syllables":4,"types":[]},"round_pushpin":{"character":"📍","syllables":3,"types":[]},"rowboat":{"character":"🚣","syllables":2,"types":["noun"]},"ru":{"character":"🇷🇺","syllables":1,"types":[]},"rugby_football":{"character":"🏉","syllables":4,"types":[]},"runner":{"character":"🏃","syllables":2,"types":["noun"]},"running":{"character":"🏃","syllables":2,"types":["noun","adjective","adverb","idiom"]},"running_shirt_with_sash":{"character":"🎽","syllables":5,"types":[]},"sa":{"character":"🈂","syllables":1,"types":[]},"sagittarius":{"character":"♐️","syllables":5,"types":[]},"sailboat":{"character":"⛵️","syllables":2,"types":["noun"]},"sake":{"character":"🍶","syllables":1,"types":["noun"]},"sandal":{"character":"👡","syllables":2,"types":["noun"]},"santa":{"character":"🎅","syllables":2,"types":[]},"satellite":{"character":"📡","syllables":3,"types":["noun"]},"satisfied":{"character":"😆","syllables":3,"types":["adjective"]},"saxophone":{"character":"🎷","syllables":3,"types":["noun"]},"school":{"character":"🏫","syllables":1,"types":["noun","verb-transitive","adjective","verb-intransitive"]},"school_satchel":{"character":"🎒","syllables":1,"types":[]},"scissors":{"character":"✂️","syllables":2,"types":["noun","verb"]},"scorpius":{"character":"♏️","syllables":3,"types":[]},"scream":{"character":"😱","syllables":1,"types":["verb-intransitive","verb-transitive","noun"]},"scream_cat":{"character":"🙀","syllables":2,"types":[]},"scroll":{"character":"📜","syllables":1,"types":["noun","verb-transitive","verb-intransitive"]},"seat":{"character":"💺","syllables":1,"types":["noun","verb-transitive","verb-intransitive","idiom"]},"secret":{"character":"㊙️","syllables":2,"types":["adjective","noun"]},"see_no_evil":{"character":"🙈","syllables":4,"types":[]},"seedling":{"character":"🌱","syllables":2,"types":["noun"]},"seven":{"character":"7️⃣","syllables":2,"types":["noun"]},"shaved_ice":{"character":"🍧","syllables":2,"types":[]},"sheep":{"character":"🐑","syllables":1,"types":["noun"]},"shell":{"character":"🐚","syllables":1,"types":["noun","verb-transitive","verb-intransitive","phrasal-verb"]},"ship":{"character":"🚢","syllables":1,"types":["noun","verb-transitive","verb-intransitive","phrasal-verb","idiom"]},"shirt":{"character":"👕","syllables":1,"types":["noun","idiom"]},"shit":{"character":"💩","syllables":1,"types":["verb-intransitive","verb-transitive","noun","interjection","phrasal-verb","idiom"]},"shoe":{"character":"👟","syllables":1,"types":["noun","verb-transitive","idiom"]},"shower":{"character":"🚿","syllables":2,"types":["noun","verb-transitive","verb-intransitive"]},"signal_strength":{"character":"📶","syllables":3,"types":[]},"six":{"character":"6️⃣","syllables":1,"types":["noun","idiom"]},"six_pointed_star":{"character":"🔯","syllables":4,"types":[]},"ski":{"character":"🎿","syllables":1,"types":["noun","verb-intransitive","verb-transitive"]},"skull":{"character":"💀","syllables":1,"types":["noun"]},"sleeping":{"character":"😴","syllables":2,"types":["verb","adjective","noun"]},"sleepy":{"character":"😪","syllables":2,"types":["adjective"]},"slot_machine":{"character":"🎰","syllables":3,"types":[]},"small_blue_diamond":{"character":"🔹","syllables":4,"types":[]},"small_orange_diamond":{"character":"🔸","syllables":5,"types":[]},"small_red_triangle":{"character":"🔺","syllables":5,"types":[]},"small_red_triangle_down":{"character":"🔻","syllables":6,"types":[]},"smile":{"character":"😄","syllables":1,"types":["noun","verb-intransitive","verb-transitive"]},"smile_cat":{"character":"😸","syllables":2,"types":[]},"smiley":{"character":"😃","syllables":2,"types":["noun","adjective"]},"smiley_cat":{"character":"😺","syllables":3,"types":[]},"smiling_imp":{"character":"😈","syllables":3,"types":[]},"smirk":{"character":"😏","syllables":1,"types":["verb-intransitive","noun"]},"smirk_cat":{"character":"😼","syllables":2,"types":[]},"smoking":{"character":"🚬","syllables":2,"types":["adjective"]},"snail":{"character":"🐌","syllables":1,"types":["noun"]},"snake":{"character":"🐍","syllables":1,"types":["noun","verb-transitive","verb-intransitive"]},"snowboarder":{"character":"🏂","syllables":3,"types":["noun"]},"snowflake":{"character":"❄️","syllables":2,"types":["noun"]},"snowman":{"character":"⛄️","syllables":2,"types":["noun"]},"sob":{"character":"😭","syllables":1,"types":["verb-intransitive","verb-transitive","noun"]},"soccer":{"character":"⚽️","syllables":2,"types":["noun"]},"soon":{"character":"🔜","syllables":1,"types":["adverb","idiom"]},"sos":{"character":"🆘","syllables":3,"types":[]},"sound":{"character":"🔉","syllables":1,"types":["noun","verb-intransitive","verb-transitive","phrasal-verb","adjective","adverb"]},"space_invader":{"character":"👾","syllables":4,"types":[]},"spades":{"character":"♠️","syllables":1,"types":["noun","verb"]},"spaghetti":{"character":"🍝","syllables":3,"types":["noun"]},"sparkler":{"character":"🎇","syllables":2,"types":["noun"]},"sparkles":{"character":"✨","syllables":2,"types":["noun","verb"]},"sparkling_heart":{"character":"💖","syllables":3,"types":[]},"speak_no_evil":{"character":"🙊","syllables":4,"types":[]},"speaker":{"character":"🔈","syllables":2,"types":["noun"]},"speech_balloon":{"character":"💬","syllables":3,"types":[]},"speedboat":{"character":"🚤","syllables":2,"types":["noun"]},"star":{"character":"⭐️","syllables":1,"types":["noun","adjective","verb-transitive","verb-intransitive","idiom"]},"star2":{"character":"🌟","syllables":2,"types":[]},"stars":{"character":"🌠","syllables":1,"types":["noun","verb"]},"station":{"character":"🚉","syllables":2,"types":["noun","verb-transitive"]},"statue_of_liberty":{"character":"🗽","syllables":6,"types":[]},"steam_locomotive":{"character":"🚂","syllables":5,"types":[]},"stew":{"character":"🍲","syllables":1,"types":["verb-transitive","verb-intransitive","noun"]},"straight_ruler":{"character":"📏","syllables":3,"types":[]},"strawberry":{"character":"🍓","syllables":3,"types":["noun","adjective"]},"stuck_out_tongue":{"character":"😛","syllables":3,"types":[]},"stuck_out_tongue_closed_eyes":{"character":"😝","syllables":5,"types":[]},"stuck_out_tongue_winking_eye":{"character":"😜","syllables":6,"types":[]},"sun_with_face":{"character":"🌞","syllables":3,"types":[]},"sunflower":{"character":"🌻","syllables":3,"types":["noun"]},"sunglasses":{"character":"😎","syllables":3,"types":["noun"]},"sunny":{"character":"☀️","syllables":2,"types":["adjective"]},"sunrise":{"character":"🌅","syllables":2,"types":["noun"]},"sunrise_over_mountains":{"character":"🌄","syllables":6,"types":[]},"surfer":{"character":"🏄","syllables":2,"types":["noun"]},"sushi":{"character":"🍣","syllables":2,"types":["noun"]},"suspension_railway":{"character":"🚟","syllables":5,"types":[]},"sweat":{"character":"😓","syllables":1,"types":["verb-intransitive","verb-transitive","noun","phrasal-verb","idiom"]},"sweat_drops":{"character":"💦","syllables":2,"types":[]},"sweat_smile":{"character":"😅","syllables":2,"types":[]},"sweet_potato":{"character":"🍠","syllables":4,"types":[]},"swimmer":{"character":"🏊","syllables":2,"types":["noun"]},"symbols":{"character":"🔣","syllables":2,"types":["noun"]},"syringe":{"character":"💉","syllables":2,"types":["noun"]},"tada":{"character":"🎉","syllables":2,"types":["interjection"]},"tanabata_tree":{"character":"🎋","syllables":5,"types":[]},"tangerine":{"character":"🍊","syllables":3,"types":["noun"]},"taurus":{"character":"♉️","syllables":2,"types":["noun"]},"taxi":{"character":"🚕","syllables":2,"types":["noun","verb-intransitive","verb-transitive"]},"tea":{"character":"🍵","syllables":1,"types":["noun"]},"telephone":{"character":"☎️","syllables":3,"types":["noun","verb-transitive","verb-intransitive"]},"telephone_receiver":{"character":"📞","syllables":6,"types":[]},"telescope":{"character":"🔭","syllables":3,"types":["noun","verb-transitive","verb-intransitive"]},"tennis":{"character":"🎾","syllables":2,"types":["noun"]},"tent":{"character":"⛺️","syllables":1,"types":["noun","verb-intransitive","verb-transitive"]},"thought_balloon":{"character":"💭","syllables":3,"types":[]},"three":{"character":"3️⃣","syllables":1,"types":["noun"]},"thumbsdown":{"character":"👎","syllables":2,"types":[]},"thumbsup":{"character":"👍","syllables":2,"types":[]},"ticket":{"character":"🎫","syllables":2,"types":["noun","verb-transitive"]},"tiger":{"character":"🐯","syllables":2,"types":["noun"]},"tiger2":{"character":"🐅","syllables":3,"types":[]},"tired_face":{"character":"😫","syllables":3,"types":[]},"tm":{"character":"™","syllables":2,"types":[]},"toilet":{"character":"🚽","syllables":2,"types":["noun"]},"tokyo_tower":{"character":"🗼","syllables":5,"types":[]},"tomato":{"character":"🍅","syllables":3,"types":["noun"]},"tongue":{"character":"👅","syllables":1,"types":["noun","verb-transitive","verb-intransitive","idiom"]},"top":{"character":"🔝","syllables":1,"types":["noun","adjective","verb-transitive","verb-intransitive","phrasal-verb","idiom"]},"tophat":{"character":"🎩","syllables":2,"types":["noun"]},"tractor":{"character":"🚜","syllables":2,"types":["noun"]},"traffic_light":{"character":"🚥","syllables":3,"types":[]},"train":{"character":"🚋","syllables":1,"types":["noun","verb-transitive","verb-intransitive"]},"train2":{"character":"🚆","syllables":2,"types":[]},"tram":{"character":"🚊","syllables":1,"types":["noun","verb-transitive"]},"triangular_flag_on_post":{"character":"🚩","syllables":7,"types":[]},"triangular_ruler":{"character":"📐","syllables":6,"types":[]},"trident":{"character":"🔱","syllables":2,"types":["noun","adjective"]},"triumph":{"character":"😤","syllables":2,"types":["verb-intransitive","noun"]},"trolleybus":{"character":"🚎","syllables":3,"types":["noun"]},"trophy":{"character":"🏆","syllables":2,"types":["noun"]},"tropical_drink":{"character":"🍹","syllables":4,"types":[]},"tropical_fish":{"character":"🐠","syllables":4,"types":[]},"truck":{"character":"🚚","syllables":1,"types":["noun","verb-transitive","verb-intransitive"]},"trumpet":{"character":"🎺","syllables":2,"types":["noun","verb-intransitive","verb-transitive"]},"tshirt":{"character":"👕","syllables":2,"types":[]},"tulip":{"character":"🌷","syllables":2,"types":["noun"]},"turtle":{"character":"🐢","syllables":2,"types":["noun","verb-intransitive"]},"tv":{"character":"📺","syllables":2,"types":["noun"]},"twisted_rightwards_arrows":{"character":"🔀","syllables":4,"types":[]},"two":{"character":"2️⃣","syllables":1,"types":["noun","idiom"]},"two_hearts":{"character":"💕","syllables":2,"types":[]},"two_men_holding_hands":{"character":"👬","syllables":5,"types":[]},"two_women_holding_hands":{"character":"👭","syllables":6,"types":[]},"u5272":{"character":"🈹","syllables":0,"types":[]},"u5408":{"character":"🈴","syllables":0,"types":[]},"u55b6":{"character":"🈺","syllables":0,"types":[]},"u6307":{"character":"🈯️","syllables":0,"types":[]},"u6708":{"character":"🈷","syllables":0,"types":[]},"u6709":{"character":"🈶","syllables":0,"types":[]},"u6e80":{"character":"🈵","syllables":0,"types":[]},"u7121":{"character":"🈚️","syllables":0,"types":[]},"u7533":{"character":"🈸","syllables":0,"types":[]},"u7981":{"character":"🈲","syllables":0,"types":[]},"u7a7a":{"character":"🈳","syllables":0,"types":[]},"uk":{"character":"🇬🇧","syllables":2,"types":[]},"umbrella":{"character":"☔️","syllables":3,"types":["noun"]},"unamused":{"character":"😒","syllables":3,"types":["adjective"]},"underage":{"character":"🔞","syllables":3,"types":["noun","adjective"]},"unlock":{"character":"🔓","syllables":2,"types":["verb-transitive","verb-intransitive"]},"up":{"character":"🆙","syllables":1,"types":["adverb","adjective","preposition","noun","verb-transitive","verb-intransitive","idiom"]},"us":{"character":"🇺🇸","syllables":1,"types":["pronoun"]},"v":{"character":"✌️","syllables":1,"types":["noun"]},"vertical_traffic_light":{"character":"🚦","syllables":6,"types":[]},"vhs":{"character":"📼","syllables":3,"types":[]},"vibration_mode":{"character":"📳","syllables":4,"types":[]},"video_camera":{"character":"📹","syllables":6,"types":[]},"video_game":{"character":"🎮","syllables":4,"types":[]},"violin":{"character":"🎻","syllables":3,"types":["noun"]},"virgo":{"character":"♍️","syllables":2,"types":[]},"volcano":{"character":"🌋","syllables":3,"types":["noun"]},"vs":{"character":"🆚","syllables":2,"types":["preposition"]},"walking":{"character":"🚶","syllables":2,"types":["adjective","noun"]},"waning_crescent_moon":{"character":"🌘","syllables":5,"types":[]},"waning_gibbous_moon":{"character":"🌖","syllables":5,"types":[]},"warning":{"character":"⚠️","syllables":2,"types":["noun","adjective"]},"watch":{"character":"⌚️","syllables":1,"types":["verb-intransitive","verb-transitive","noun","phrasal-verb","idiom"]},"water_buffalo":{"character":"🐃","syllables":5,"types":[]},"watermelon":{"character":"🍉","syllables":4,"types":["noun"]},"wave":{"character":"👋","syllables":1,"types":["verb-intransitive","verb-transitive","noun","phrasal-verb"]},"wavy_dash":{"character":"〰","syllables":3,"types":[]},"waxing_crescent_moon":{"character":"🌒","syllables":5,"types":[]},"waxing_gibbous_moon":{"character":"🌔","syllables":5,"types":[]},"wc":{"character":"🚾","syllables":2,"types":[]},"weary":{"character":"😩","syllables":2,"types":["adjective","verb-transitive"]},"wedding":{"character":"💒","syllables":2,"types":["noun"]},"whale":{"character":"🐳","syllables":1,"types":["noun","verb-intransitive","verb-transitive"]},"whale2":{"character":"🐋","syllables":2,"types":[]},"wheelchair":{"character":"♿️","syllables":2,"types":["noun"]},"white_check_mark":{"character":"✅","syllables":3,"types":[]},"white_circle":{"character":"⚪","syllables":3,"types":[]},"white_flower":{"character":"💮","syllables":3,"types":[]},"white_large_square":{"character":"◻️","syllables":3,"types":[]},"white_square_button":{"character":"🔳","syllables":4,"types":[]},"wind_chime":{"character":"🎐","syllables":2,"types":[]},"wine_glass":{"character":"🍷","syllables":2,"types":[]},"wink":{"character":"😉","syllables":1,"types":["verb-intransitive","verb-transitive","noun","phrasal-verb"]},"wolf":{"character":"🐺","syllables":1,"types":["noun","verb-transitive","idiom"]},"woman":{"character":"👩","syllables":2,"types":["noun","idiom"]},"womans_clothes":{"character":"👚","syllables":3,"types":[]},"womans_hat":{"character":"👒","syllables":3,"types":[]},"womens":{"character":"🚺","syllables":2,"types":[]},"worried":{"character":"😟","syllables":2,"types":["adjective","verb"]},"wrench":{"character":"🔧","syllables":1,"types":["noun","verb-transitive","verb-intransitive"]},"x":{"character":"❌","syllables":1,"types":["noun","verb-transitive",null]},"yellow_heart":{"character":"💛","syllables":3,"types":[]},"yen":{"character":"💴","syllables":1,"types":["noun","verb-intransitive"]},"yum":{"character":"😋","syllables":1,"types":["interjection"]},"zap":{"character":"⚡️","syllables":1,"types":["verb-transitive","verb-intransitive","noun","interjection"]},"zero":{"character":"0️⃣","syllables":2,"types":["noun","adjective","verb-transitive","phrasal-verb"]},"zzz":{"character":"💤","syllables":0,"types":["interjection","verb"]}}; })); },{}],220:[function(require,module,exports){ function getStack(err) { if(err.stack && err.name && err.message) return err.stack.substring(err.name.length + 3 + err.message.length) .split('\n') else if(err.stack) return err.stack.split('\n') } function removePrefix (a, b) { return a.filter(function (e) { return !~b.indexOf(e) }) } var explain = module.exports = function (err, message) { if(!(err.stack && err.name && err.message)) { console.error(new Error('stackless error')) return err } var _err = new Error(message) var stack = removePrefix(getStack(_err).slice(1), getStack(err)).join('\n') _err.stack = _err.name + ': ' + _err.message + '\n' + stack + '\n ' + err.stack return _err } },{}],221:[function(require,module,exports){ (function (Buffer){ 'use strict'; var zeroBuffer = new Buffer(128) zeroBuffer.fill(0) module.exports = Hmac function Hmac (createHash, blocksize, key) { if(!(this instanceof Hmac)) return new Hmac(createHash, blocksize, key) this._opad = opad this._createHash = createHash if(blocksize !== 128 && blocksize !== 64) throw new Error('blocksize must be either 64 for or 128 , but was:'+blocksize) key = this._key = !Buffer.isBuffer(key) ? new Buffer(key) : key if(key.length > blocksize) { key = this._createHash().update(key).digest() } else if(key.length < blocksize) { key = Buffer.concat([key, zeroBuffer], blocksize) } var ipad = this._ipad = new Buffer(blocksize) var opad = this._opad = new Buffer(blocksize) for(var i = 0; i < blocksize; i++) { ipad[i] = key[i] ^ 0x36 opad[i] = key[i] ^ 0x5C } this._hash = this._createHash().update(ipad) } Hmac.prototype.update = function (data, enc) { this._hash.update(data, enc) return this } Hmac.prototype.digest = function (enc) { var h = this._hash.digest() return this._createHash().update(this._opad).update(h).digest(enc) } }).call(this,require("buffer").Buffer) },{"buffer":47}],222:[function(require,module,exports){ var h = require('hyperscript') function width (el) { if(el === window) return window.innerWidth if(el === document) el = document.documentElement return el.getBoundingClientRect().width } function px(p) { return p+'px' } module.exports = function () { var content = h('div.lightbox__content') var lightbox = h('div.lightbox', {style: { position: 'fixed', top: px(0), bottom: px(0), left: px(0), right: px(0), display: 'none', // padding: px(10) }}, content) lightbox.close = function () { lightbox.style.display = 'none' lightbox.innerHTML = '' } lightbox.center = function () { lightbox.style.left = px((width(window) - width(lightbox)) / 2) } lightbox.show = function (el) { content.appendChild(el) lightbox.style.display = 'block' lightbox.center() } return lightbox } },{"hyperscript":223}],223:[function(require,module,exports){ var split = require('browser-split') var ClassList = require('class-list') require('html-element') function context () { var cleanupFuncs = [] function h() { var args = [].slice.call(arguments), e = null function item (l) { var r function parseClass (string) { // Our minimal parser doesn’t understand escaping CSS special // characters like `#`. Don’t use them. More reading: // https://mathiasbynens.be/notes/css-escapes . var m = split(string, /([\.#]?[^\s#.]+)/) if(/^\.|#/.test(m[1])) e = document.createElement('div') forEach(m, function (v) { var s = v.substring(1,v.length) if(!v) return if(!e) e = document.createElement(v) else if (v[0] === '.') ClassList(e).add(s) else if (v[0] === '#') e.setAttribute('id', s) }) } if(l == null) ; else if('string' === typeof l) { if(!e) parseClass(l) else e.appendChild(r = document.createTextNode(l)) } else if('number' === typeof l || 'boolean' === typeof l || l instanceof Date || l instanceof RegExp ) { e.appendChild(r = document.createTextNode(l.toString())) } //there might be a better way to handle this... else if (isArray(l)) forEach(l, item) else if(isNode(l)) e.appendChild(r = l) else if(l instanceof Text) e.appendChild(r = l) else if ('object' === typeof l) { for (var k in l) { if('function' === typeof l[k]) { if(/^on\w+/.test(k)) { (function (k, l) { // capture k, l in the closure if (e.addEventListener){ e.addEventListener(k.substring(2), l[k], false) cleanupFuncs.push(function(){ e.removeEventListener(k.substring(2), l[k], false) }) }else{ e.attachEvent(k, l[k]) cleanupFuncs.push(function(){ e.detachEvent(k, l[k]) }) } })(k, l) } else { // observable e[k] = l[k]() cleanupFuncs.push(l[k](function (v) { e[k] = v })) } } else if(k === 'style') { if('string' === typeof l[k]) { e.style.cssText = l[k] }else{ for (var s in l[k]) (function(s, v) { if('function' === typeof v) { // observable e.style.setProperty(s, v()) cleanupFuncs.push(v(function (val) { e.style.setProperty(s, val) })) } else e.style.setProperty(s, l[k][s]) })(s, l[k][s]) } } else if (k.substr(0, 5) === "data-") { e.setAttribute(k, l[k]) } else { e[k] = l[k] } } } else if ('function' === typeof l) { //assume it's an observable! var v = l() e.appendChild(r = isNode(v) ? v : document.createTextNode(v)) cleanupFuncs.push(l(function (v) { if(isNode(v) && r.parentElement) r.parentElement.replaceChild(v, r), r = v else r.textContent = v })) } return r } while(args.length) item(args.shift()) return e } h.cleanup = function () { for (var i = 0; i < cleanupFuncs.length; i++){ cleanupFuncs[i]() } cleanupFuncs.length = 0 } return h } var h = module.exports = context() h.context = context function isNode (el) { return el && el.nodeName && el.nodeType } function isText (el) { return el && el.nodeName === '#text' && el.nodeType == 3 } function forEach (arr, fn) { if (arr.forEach) return arr.forEach(fn) for (var i = 0; i < arr.length; i++) fn(arr[i], i) } function isArray (arr) { return Object.prototype.toString.call(arr) == '[object Array]' } },{"browser-split":195,"class-list":196,"html-element":20}],224:[function(require,module,exports){ var h = require('hyperscript') /* element classes are set with BEM convention. https://css-tricks.com/bem-101/ B = block. module name, on the top level of the component. E = element. a specific part of the component M = modifier. something that changes an element (or block) */ module.exports = function (onSelect) { var names = [] var tabs = h('div.row.hypertabs__tabs') var content = h('div.column.hypertabs__content') var d = h('div.hypertabs.column', tabs, content ) d.add = function (name, tab, change) { names.push(name) tabs.appendChild(h('div', h('a', name, {href: '#', onclick: function (ev) { ev.preventDefault() ev.stopPropagation() d.select(name) }}))) tab.style.display = 'none' content.appendChild(tab) if(change !== false) d.select(name) } d.has = function (name) { return !!~names.indexOf(name) } d.select = function (name) { d.selected = selected = name var i = names.indexOf(name) if(!~i) return console.log('unknown tab:'+name + ' expected:' + JSON.stringify(names) + i) ;[].forEach.call(tabs.children, function (el) { el.classList.remove('hypertabs--selected') }) tabs.children[i].classList.add('hypertabs--selected') ;[].forEach.call(content.children, function (tab) { tab.style.display = 'none' }) content.children[i].style.display = 'flex' d.selectedTab = content.children[i] onSelect && onSelect(name, i) } d.selectRelative = function (n) { d.select(names[(names.indexOf(selected) + n + names.length) % names.length]) } d.remove = function (name) { var i = names.indexOf(name) if(!~i) return names.splice(i, 1) tabs.removeChild(tabs.children[i]) content.removeChild(content.children[i]) if(selected === name) d.select(names[i] || names[0]) } d.tabs = names return d } },{"hyperscript":223}],225:[function(require,module,exports){ module.exports = function (buf) { var len = buf.length, i for(i = len - 1; buf[i] === 255; i--) buf[i] = 0 if(~i) buf[i] = buf[i] + 1 return buf } },{}],226:[function(require,module,exports){ arguments[4][94][0].apply(exports,arguments) },{"dup":94}],227:[function(require,module,exports){ arguments[4][95][0].apply(exports,arguments) },{"dup":95}],228:[function(require,module,exports){ 'use strict'; var v4 = '(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}'; var v6 = '(?:(?:[0-9a-fA-F:]){1,4}(?:(?::(?:[0-9a-fA-F]){1,4}|:)){2,7})+'; var ip = module.exports = function (opts) { opts = opts || {}; return opts.exact ? new RegExp('(?:^' + v4 + '$)|(?:^' + v6 + '$)') : new RegExp('(?:' + v4 + ')|(?:' + v6 + ')', 'g'); }; ip.v4 = function (opts) { opts = opts || {}; return opts.exact ? new RegExp('^' + v4 + '$') : new RegExp(v4, 'g'); }; ip.v6 = function (opts) { opts = opts || {}; return opts.exact ? new RegExp('^' + v6 + '$') : new RegExp(v6, 'g'); }; },{}],229:[function(require,module,exports){ var ip = exports, Buffer = require('buffer').Buffer, os = require('os'); ip.toBuffer = function toBuffer(ip, buff, offset) { offset = ~~offset; var result; if (/^(\d{1,3}\.){3,3}\d{1,3}$/.test(ip)) { result = buff || new Buffer(offset + 4); ip.split(/\./g).map(function(byte) { result[offset++] = parseInt(byte, 10) & 0xff; }); } else if (/^[a-f0-9:]+$/.test(ip)) { var s = ip.split(/::/g, 2), head = (s[0] || '').split(/:/g, 8), tail = (s[1] || '').split(/:/g, 8); if (tail.length === 0) { // xxxx:: while (head.length < 8) head.push('0000'); } else if (head.length === 0) { // ::xxxx while (tail.length < 8) tail.unshift('0000'); } else { // xxxx::xxxx while (head.length + tail.length < 8) head.push('0000'); } result = buff || new Buffer(offset + 16); head.concat(tail).map(function(word) { word = parseInt(word, 16); result[offset++] = (word >> 8) & 0xff; result[offset++] = word & 0xff; }); } else { throw Error('Invalid ip address: ' + ip); } return result; }; ip.toString = function toString(buff, offset, length) { offset = ~~offset; length = length || (buff.length - offset); var result = []; if (length === 4) { // IPv4 for (var i = 0; i < length; i++) { result.push(buff[offset + i]); } result = result.join('.'); } else if (length === 16) { // IPv6 for (var i = 0; i < length; i += 2) { result.push(buff.readUInt16BE(offset + i).toString(16)); } result = result.join(':'); result = result.replace(/(^|:)0(:0)*:0(:|$)/, '$1::$3'); result = result.replace(/:{3,4}/, '::'); } return result; }; ip.fromPrefixLen = function fromPrefixLen(prefixlen, family) { if (prefixlen > 32) { family = 'ipv6'; } else { family = _normalizeFamily(family); } var len = 4; if (family === 'ipv6') { len = 16; } var buff = new Buffer(len); for (var i = 0, n = buff.length; i < n; ++i) { var bits = 8; if (prefixlen < 8) { bits = prefixlen; } prefixlen -= bits; buff[i] = ~(0xff >> bits); } return ip.toString(buff); }; ip.mask = function mask(addr, mask) { addr = ip.toBuffer(addr); mask = ip.toBuffer(mask); var result = new Buffer(Math.max(addr.length, mask.length)); // Same protocol - do bitwise and if (addr.length === mask.length) { for (var i = 0; i < addr.length; i++) { result[i] = addr[i] & mask[i]; } } else if (mask.length === 4) { // IPv6 address and IPv4 mask // (Mask low bits) for (var i = 0; i < mask.length; i++) { result[i] = addr[addr.length - 4 + i] & mask[i]; } } else { // IPv6 mask and IPv4 addr for (var i = 0; i < result.length - 6; i++) { result[i] = 0; } // ::ffff:ipv4 result[10] = 0xff; result[11] = 0xff; for (var i = 0; i < addr.length; i++) { result[i + 12] = addr[i] & mask[i + 12]; } } return ip.toString(result); }; ip.cidr = function cidr(cidrString) { var cidrParts = cidrString.split('/'); if (cidrParts.length != 2) throw new Error('invalid CIDR subnet: ' + addr); var addr = cidrParts[0]; var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); return ip.mask(addr, mask); } ip.subnet = function subnet(addr, mask) { var networkAddress = ip.toLong(ip.mask(addr, mask)); // Calculate the mask's length. var maskBuffer = ip.toBuffer(mask); var maskLength = 0; for (var i = 0; i < maskBuffer.length; i++) { if (maskBuffer[i] == 0xff) { maskLength += 8; } else { var octet = maskBuffer[i] & 0xff; while (octet) { octet = (octet << 1) & 0xff; maskLength++; } } } var numberOfAddresses = Math.pow(2, 32 - maskLength); return { networkAddress: ip.fromLong(networkAddress), firstAddress: numberOfAddresses <= 2 ? ip.fromLong(networkAddress) : ip.fromLong(networkAddress + 1), lastAddress: numberOfAddresses <= 2 ? ip.fromLong(networkAddress + numberOfAddresses - 1) : ip.fromLong(networkAddress + numberOfAddresses - 2), broadcastAddress: ip.fromLong(networkAddress + numberOfAddresses - 1), subnetMask: mask, subnetMaskLength: maskLength, numHosts: numberOfAddresses <= 2 ? numberOfAddresses : numberOfAddresses - 2, length: numberOfAddresses }; } ip.cidrSubnet = function cidrSubnet(cidrString) { var cidrParts = cidrString.split('/'); if (cidrParts.length !== 2) throw new Error('invalid CIDR subnet: ' + addr); var addr = cidrParts[0]; var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); return ip.subnet(addr, mask); } ip.not = function not(addr) { var buff = ip.toBuffer(addr); for (var i = 0; i < buff.length; i++) { buff[i] = 0xff ^ buff[i]; } return ip.toString(buff); }; ip.or = function or(a, b) { a = ip.toBuffer(a); b = ip.toBuffer(b); // same protocol if (a.length == b.length) { for (var i = 0; i < a.length; ++i) { a[i] |= b[i]; } return ip.toString(a); // mixed protocols } else { var buff = a; var other = b; if (b.length > a.length) { buff = b; other = a; } var offset = buff.length - other.length; for (var i = offset; i < buff.length; ++i) { buff[i] |= other[i - offset]; } return ip.toString(buff); } }; ip.isEqual = function isEqual(a, b) { a = ip.toBuffer(a); b = ip.toBuffer(b); // Same protocol if (a.length === b.length) { for (var i = 0; i < a.length; i++) { if (a[i] !== b[i]) return false; } return true; } // Swap if (b.length === 4) { var t = b; b = a; a = t; } // a - IPv4, b - IPv6 for (var i = 0; i < 10; i++) { if (b[i] !== 0) return false; } var word = b.readUInt16BE(10); if (word !== 0 && word !== 0xffff) return false; for (var i = 0; i < 4; i++) { if (a[i] !== b[i + 12]) return false; } return true; }; ip.isPrivate = function isPrivate(addr) { return addr.match(/^10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/) != null || addr.match(/^192\.168\.([0-9]{1,3})\.([0-9]{1,3})/) != null || addr.match( /^172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})/) != null || addr.match(/^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/) != null || addr.match(/^169\.254\.([0-9]{1,3})\.([0-9]{1,3})/) != null || addr.match(/^fc00:/) != null || addr.match(/^fe80:/) != null || addr.match(/^::1$/) != null || addr.match(/^::$/) != null; }; ip.isPublic = function isPublic(addr) { return !ip.isPrivate(addr); } ip.isLoopback = function isLoopback(addr) { return /^127\.0\.0\.1$/.test(addr) || /^fe80::1$/.test(addr) || /^::1$/.test(addr) || /^::$/.test(addr); }; ip.loopback = function loopback(family) { // // Default to `ipv4` // family = _normalizeFamily(family); if (family !== 'ipv4' && family !== 'ipv6') { throw new Error('family must be ipv4 or ipv6'); } return family === 'ipv4' ? '127.0.0.1' : 'fe80::1'; }; // // ### function address (name, family) // #### @name {string|'public'|'private'} **Optional** Name or security // of the network interface. // #### @family {ipv4|ipv6} **Optional** IP family of the address (defaults // to ipv4). // // Returns the address for the network interface on the current system with // the specified `name`: // * String: First `family` address of the interface. // If not found see `undefined`. // * 'public': the first public ip address of family. // * 'private': the first private ip address of family. // * undefined: First address with `ipv4` or loopback addres `127.0.0.1`. // ip.address = function address(name, family) { var interfaces = os.networkInterfaces(), all; // // Default to `ipv4` // family = _normalizeFamily(family); // // If a specific network interface has been named, // return the address. // if (name && !~['public', 'private'].indexOf(name)) { return interfaces[name].filter(function (details) { details.family = details.family.toLowerCase(); return details.family === family; })[0].address; } var all = Object.keys(interfaces).map(function (nic) { // // Note: name will only be `public` or `private` // when this is called. // var addresses = interfaces[nic].filter(function (details) { details.family = details.family.toLowerCase(); if (details.family !== family || ip.isLoopback(details.address)) { return false; } else if (!name) { return true; } return name === 'public' ? !ip.isPrivate(details.address) : ip.isPrivate(details.address) }); return addresses.length ? addresses[0].address : undefined; }).filter(Boolean); return !all.length ? ip.loopback(family) : all[0]; }; ip.toLong = function toInt(ip){ var ipl=0; ip.split('.').forEach(function( octet ) { ipl<<=8; ipl+=parseInt(octet); }); return(ipl >>>0); }; ip.fromLong = function fromInt(ipl){ return ( (ipl>>>24) +'.' + (ipl>>16 & 255) +'.' + (ipl>>8 & 255) +'.' + (ipl & 255) ); }; function _normalizeFamily(family) { return family ? family.toLowerCase() : 'ipv4'; } },{"buffer":47,"os":100}],230:[function(require,module,exports){ (function(root) { function isValidDomain(v) { if (!v) return false; var re = /^(?!:\/\/)([a-zA-Z0-9-]+\.){0,5}[a-zA-Z0-9-][a-zA-Z0-9-]+\.[a-zA-Z]{2,64}?$/gi; return re.test(v); } if (typeof exports !== 'undefined') { if (typeof module !== 'undefined' && module.exports) { exports = module.exports = isValidDomain; } exports.isValidDomain = isValidDomain; } else if (typeof define === 'function' && define.amd) { define([], function() { return isValidDomain; }); } else { root.isValidDomain = isValidDomain; } })(this); },{}],231:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.isVisible = isVisible; exports.isVisibleAll = isVisibleAll; exports.isVisibleAny = isVisibleAny; var _iselement = require('iselement'); var _iselement2 = _interopRequireDefault(_iselement); var _styleProperties = require('style-properties'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // cross-browser way of getting element's style property function getStyle(element, property) { if (window.getComputedStyle) { return (0, _styleProperties.getStyleProperty)(element, property).original; } else if (element.currentStyle) { return element.currentStyle[property]; } return null; } function checkVisibility(element) { var is_displayed = getStyle(element, 'display') !== 'none'; var is_visible = getStyle(element, 'visibility') !== 'hidden'; return is_displayed && is_visible; } function isVisible(element) { // don't bother with non-element inputs if (!(0, _iselement2.default)(element)) { return false; } // This should prevent problems with ShadowDOMPolyfill. It returns different // object when asking directly via `document.body` (native element) and when // asking via `document.querySelector()` (wrapped element). This would result // in traversing too far in the `while` cycle below. var body_element = document.querySelector('body'); var html_element = document.querySelector('html'); // elements that are not inserted into the body are never visible if (!body_element || !body_element.contains(element)) { return false; } // test visibility recursively for element and all its parents, until BODY while (element && element !== body_element && element !== html_element) { if (!checkVisibility(element)) { return false; } element = element.parentNode; } return true; } function isVisibleAll(list) { for (var i = 0; i < list.length; i++) { if (!isVisible(list[i])) { return false; } } return true; } function isVisibleAny(list) { for (var i = 0; i < list.length; i++) { if (isVisible(list[i])) { return true; } } return false; } exports.default = isVisible; },{"iselement":233,"style-properties":353}],232:[function(require,module,exports){ arguments[4][97][0].apply(exports,arguments) },{"dup":97}],233:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; exports.default = function (obj) { return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && obj.nodeType === 1 && _typeof(obj.style) === 'object' && _typeof(obj.ownerDocument) === 'object'; }; },{}],234:[function(require,module,exports){ var looper = module.exports = function (fun) { (function next () { var loop = true, returned = false, sync = false do { sync = true; loop = false fun.call(this, function () { if(sync) loop = true else next() }) sync = false } while(loop) })() } },{}],235:[function(require,module,exports){ module.exports={ "application/1d-interleaved-parityfec": { "source": "iana" }, "application/3gpdash-qoe-report+xml": { "source": "iana" }, "application/3gpp-ims+xml": { "source": "iana" }, "application/a2l": { "source": "iana" }, "application/activemessage": { "source": "iana" }, "application/alto-costmap+json": { "source": "iana", "compressible": true }, "application/alto-costmapfilter+json": { "source": "iana", "compressible": true }, "application/alto-directory+json": { "source": "iana", "compressible": true }, "application/alto-endpointcost+json": { "source": "iana", "compressible": true }, "application/alto-endpointcostparams+json": { "source": "iana", "compressible": true }, "application/alto-endpointprop+json": { "source": "iana", "compressible": true }, "application/alto-endpointpropparams+json": { "source": "iana", "compressible": true }, "application/alto-error+json": { "source": "iana", "compressible": true }, "application/alto-networkmap+json": { "source": "iana", "compressible": true }, "application/alto-networkmapfilter+json": { "source": "iana", "compressible": true }, "application/aml": { "source": "iana" }, "application/andrew-inset": { "source": "iana", "extensions": ["ez"] }, "application/applefile": { "source": "iana" }, "application/applixware": { "source": "apache", "extensions": ["aw"] }, "application/atf": { "source": "iana" }, "application/atfx": { "source": "iana" }, "application/atom+xml": { "source": "iana", "compressible": true, "extensions": ["atom"] }, "application/atomcat+xml": { "source": "iana", "extensions": ["atomcat"] }, "application/atomdeleted+xml": { "source": "iana" }, "application/atomicmail": { "source": "iana" }, "application/atomsvc+xml": { "source": "iana", "extensions": ["atomsvc"] }, "application/atxml": { "source": "iana" }, "application/auth-policy+xml": { "source": "iana" }, "application/bacnet-xdd+zip": { "source": "iana" }, "application/batch-smtp": { "source": "iana" }, "application/bdoc": { "compressible": false, "extensions": ["bdoc"] }, "application/beep+xml": { "source": "iana" }, "application/calendar+json": { "source": "iana", "compressible": true }, "application/calendar+xml": { "source": "iana" }, "application/call-completion": { "source": "iana" }, "application/cals-1840": { "source": "iana" }, "application/cbor": { "source": "iana" }, "application/ccmp+xml": { "source": "iana" }, "application/ccxml+xml": { "source": "iana", "extensions": ["ccxml"] }, "application/cdfx+xml": { "source": "iana" }, "application/cdmi-capability": { "source": "iana", "extensions": ["cdmia"] }, "application/cdmi-container": { "source": "iana", "extensions": ["cdmic"] }, "application/cdmi-domain": { "source": "iana", "extensions": ["cdmid"] }, "application/cdmi-object": { "source": "iana", "extensions": ["cdmio"] }, "application/cdmi-queue": { "source": "iana", "extensions": ["cdmiq"] }, "application/cdni": { "source": "iana" }, "application/cea": { "source": "iana" }, "application/cea-2018+xml": { "source": "iana" }, "application/cellml+xml": { "source": "iana" }, "application/cfw": { "source": "iana" }, "application/cms": { "source": "iana" }, "application/cnrp+xml": { "source": "iana" }, "application/coap-group+json": { "source": "iana", "compressible": true }, "application/commonground": { "source": "iana" }, "application/conference-info+xml": { "source": "iana" }, "application/cpl+xml": { "source": "iana" }, "application/csrattrs": { "source": "iana" }, "application/csta+xml": { "source": "iana" }, "application/cstadata+xml": { "source": "iana" }, "application/csvm+json": { "source": "iana", "compressible": true }, "application/cu-seeme": { "source": "apache", "extensions": ["cu"] }, "application/cybercash": { "source": "iana" }, "application/dart": { "compressible": true }, "application/dash+xml": { "source": "iana", "extensions": ["mpd"] }, "application/dashdelta": { "source": "iana" }, "application/davmount+xml": { "source": "iana", "extensions": ["davmount"] }, "application/dca-rft": { "source": "iana" }, "application/dcd": { "source": "iana" }, "application/dec-dx": { "source": "iana" }, "application/dialog-info+xml": { "source": "iana" }, "application/dicom": { "source": "iana" }, "application/dii": { "source": "iana" }, "application/dit": { "source": "iana" }, "application/dns": { "source": "iana" }, "application/docbook+xml": { "source": "apache", "extensions": ["dbk"] }, "application/dskpp+xml": { "source": "iana" }, "application/dssc+der": { "source": "iana", "extensions": ["dssc"] }, "application/dssc+xml": { "source": "iana", "extensions": ["xdssc"] }, "application/dvcs": { "source": "iana" }, "application/ecmascript": { "source": "iana", "compressible": true, "extensions": ["ecma"] }, "application/edi-consent": { "source": "iana" }, "application/edi-x12": { "source": "iana", "compressible": false }, "application/edifact": { "source": "iana", "compressible": false }, "application/efi": { "source": "iana" }, "application/emergencycalldata.comment+xml": { "source": "iana" }, "application/emergencycalldata.deviceinfo+xml": { "source": "iana" }, "application/emergencycalldata.providerinfo+xml": { "source": "iana" }, "application/emergencycalldata.serviceinfo+xml": { "source": "iana" }, "application/emergencycalldata.subscriberinfo+xml": { "source": "iana" }, "application/emma+xml": { "source": "iana", "extensions": ["emma"] }, "application/emotionml+xml": { "source": "iana" }, "application/encaprtp": { "source": "iana" }, "application/epp+xml": { "source": "iana" }, "application/epub+zip": { "source": "iana", "extensions": ["epub"] }, "application/eshop": { "source": "iana" }, "application/exi": { "source": "iana", "extensions": ["exi"] }, "application/fastinfoset": { "source": "iana" }, "application/fastsoap": { "source": "iana" }, "application/fdt+xml": { "source": "iana" }, "application/fits": { "source": "iana" }, "application/font-sfnt": { "source": "iana" }, "application/font-tdpfr": { "source": "iana", "extensions": ["pfr"] }, "application/font-woff": { "source": "iana", "compressible": false, "extensions": ["woff"] }, "application/font-woff2": { "compressible": false, "extensions": ["woff2"] }, "application/framework-attributes+xml": { "source": "iana" }, "application/gml+xml": { "source": "apache", "extensions": ["gml"] }, "application/gpx+xml": { "source": "apache", "extensions": ["gpx"] }, "application/gxf": { "source": "apache", "extensions": ["gxf"] }, "application/gzip": { "source": "iana", "compressible": false }, "application/h224": { "source": "iana" }, "application/held+xml": { "source": "iana" }, "application/http": { "source": "iana" }, "application/hyperstudio": { "source": "iana", "extensions": ["stk"] }, "application/ibe-key-request+xml": { "source": "iana" }, "application/ibe-pkg-reply+xml": { "source": "iana" }, "application/ibe-pp-data": { "source": "iana" }, "application/iges": { "source": "iana" }, "application/im-iscomposing+xml": { "source": "iana" }, "application/index": { "source": "iana" }, "application/index.cmd": { "source": "iana" }, "application/index.obj": { "source": "iana" }, "application/index.response": { "source": "iana" }, "application/index.vnd": { "source": "iana" }, "application/inkml+xml": { "source": "iana", "extensions": ["ink","inkml"] }, "application/iotp": { "source": "iana" }, "application/ipfix": { "source": "iana", "extensions": ["ipfix"] }, "application/ipp": { "source": "iana" }, "application/isup": { "source": "iana" }, "application/its+xml": { "source": "iana" }, "application/java-archive": { "source": "apache", "compressible": false, "extensions": ["jar","war","ear"] }, "application/java-serialized-object": { "source": "apache", "compressible": false, "extensions": ["ser"] }, "application/java-vm": { "source": "apache", "compressible": false, "extensions": ["class"] }, "application/javascript": { "source": "iana", "charset": "UTF-8", "compressible": true, "extensions": ["js"] }, "application/jose": { "source": "iana" }, "application/jose+json": { "source": "iana", "compressible": true }, "application/jrd+json": { "source": "iana", "compressible": true }, "application/json": { "source": "iana", "charset": "UTF-8", "compressible": true, "extensions": ["json","map"] }, "application/json-patch+json": { "source": "iana", "compressible": true }, "application/json-seq": { "source": "iana" }, "application/json5": { "extensions": ["json5"] }, "application/jsonml+json": { "source": "apache", "compressible": true, "extensions": ["jsonml"] }, "application/jwk+json": { "source": "iana", "compressible": true }, "application/jwk-set+json": { "source": "iana", "compressible": true }, "application/jwt": { "source": "iana" }, "application/kpml-request+xml": { "source": "iana" }, "application/kpml-response+xml": { "source": "iana" }, "application/ld+json": { "source": "iana", "compressible": true, "extensions": ["jsonld"] }, "application/link-format": { "source": "iana" }, "application/load-control+xml": { "source": "iana" }, "application/lost+xml": { "source": "iana", "extensions": ["lostxml"] }, "application/lostsync+xml": { "source": "iana" }, "application/lxf": { "source": "iana" }, "application/mac-binhex40": { "source": "iana", "extensions": ["hqx"] }, "application/mac-compactpro": { "source": "apache", "extensions": ["cpt"] }, "application/macwriteii": { "source": "iana" }, "application/mads+xml": { "source": "iana", "extensions": ["mads"] }, "application/manifest+json": { "charset": "UTF-8", "compressible": true, "extensions": ["webmanifest"] }, "application/marc": { "source": "iana", "extensions": ["mrc"] }, "application/marcxml+xml": { "source": "iana", "extensions": ["mrcx"] }, "application/mathematica": { "source": "iana", "extensions": ["ma","nb","mb"] }, "application/mathml+xml": { "source": "iana", "extensions": ["mathml"] }, "application/mathml-content+xml": { "source": "iana" }, "application/mathml-presentation+xml": { "source": "iana" }, "application/mbms-associated-procedure-description+xml": { "source": "iana" }, "application/mbms-deregister+xml": { "source": "iana" }, "application/mbms-envelope+xml": { "source": "iana" }, "application/mbms-msk+xml": { "source": "iana" }, "application/mbms-msk-response+xml": { "source": "iana" }, "application/mbms-protection-description+xml": { "source": "iana" }, "application/mbms-reception-report+xml": { "source": "iana" }, "application/mbms-register+xml": { "source": "iana" }, "application/mbms-register-response+xml": { "source": "iana" }, "application/mbms-schedule+xml": { "source": "iana" }, "application/mbms-user-service-description+xml": { "source": "iana" }, "application/mbox": { "source": "iana", "extensions": ["mbox"] }, "application/media-policy-dataset+xml": { "source": "iana" }, "application/media_control+xml": { "source": "iana" }, "application/mediaservercontrol+xml": { "source": "iana", "extensions": ["mscml"] }, "application/merge-patch+json": { "source": "iana", "compressible": true }, "application/metalink+xml": { "source": "apache", "extensions": ["metalink"] }, "application/metalink4+xml": { "source": "iana", "extensions": ["meta4"] }, "application/mets+xml": { "source": "iana", "extensions": ["mets"] }, "application/mf4": { "source": "iana" }, "application/mikey": { "source": "iana" }, "application/mods+xml": { "source": "iana", "extensions": ["mods"] }, "application/moss-keys": { "source": "iana" }, "application/moss-signature": { "source": "iana" }, "application/mosskey-data": { "source": "iana" }, "application/mosskey-request": { "source": "iana" }, "application/mp21": { "source": "iana", "extensions": ["m21","mp21"] }, "application/mp4": { "source": "iana", "extensions": ["mp4s","m4p"] }, "application/mpeg4-generic": { "source": "iana" }, "application/mpeg4-iod": { "source": "iana" }, "application/mpeg4-iod-xmt": { "source": "iana" }, "application/mrb-consumer+xml": { "source": "iana" }, "application/mrb-publish+xml": { "source": "iana" }, "application/msc-ivr+xml": { "source": "iana" }, "application/msc-mixer+xml": { "source": "iana" }, "application/msword": { "source": "iana", "compressible": false, "extensions": ["doc","dot"] }, "application/mxf": { "source": "iana", "extensions": ["mxf"] }, "application/nasdata": { "source": "iana" }, "application/news-checkgroups": { "source": "iana" }, "application/news-groupinfo": { "source": "iana" }, "application/news-transmission": { "source": "iana" }, "application/nlsml+xml": { "source": "iana" }, "application/nss": { "source": "iana" }, "application/ocsp-request": { "source": "iana" }, "application/ocsp-response": { "source": "iana" }, "application/octet-stream": { "source": "iana", "compressible": false, "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"] }, "application/oda": { "source": "iana", "extensions": ["oda"] }, "application/odx": { "source": "iana" }, "application/oebps-package+xml": { "source": "iana", "extensions": ["opf"] }, "application/ogg": { "source": "iana", "compressible": false, "extensions": ["ogx"] }, "application/omdoc+xml": { "source": "apache", "extensions": ["omdoc"] }, "application/onenote": { "source": "apache", "extensions": ["onetoc","onetoc2","onetmp","onepkg"] }, "application/oxps": { "source": "iana", "extensions": ["oxps"] }, "application/p2p-overlay+xml": { "source": "iana" }, "application/parityfec": { "source": "iana" }, "application/patch-ops-error+xml": { "source": "iana", "extensions": ["xer"] }, "application/pdf": { "source": "iana", "compressible": false, "extensions": ["pdf"] }, "application/pdx": { "source": "iana" }, "application/pgp-encrypted": { "source": "iana", "compressible": false, "extensions": ["pgp"] }, "application/pgp-keys": { "source": "iana" }, "application/pgp-signature": { "source": "iana", "extensions": ["asc","sig"] }, "application/pics-rules": { "source": "apache", "extensions": ["prf"] }, "application/pidf+xml": { "source": "iana" }, "application/pidf-diff+xml": { "source": "iana" }, "application/pkcs10": { "source": "iana", "extensions": ["p10"] }, "application/pkcs12": { "source": "iana" }, "application/pkcs7-mime": { "source": "iana", "extensions": ["p7m","p7c"] }, "application/pkcs7-signature": { "source": "iana", "extensions": ["p7s"] }, "application/pkcs8": { "source": "iana", "extensions": ["p8"] }, "application/pkix-attr-cert": { "source": "iana", "extensions": ["ac"] }, "application/pkix-cert": { "source": "iana", "extensions": ["cer"] }, "application/pkix-crl": { "source": "iana", "extensions": ["crl"] }, "application/pkix-pkipath": { "source": "iana", "extensions": ["pkipath"] }, "application/pkixcmp": { "source": "iana", "extensions": ["pki"] }, "application/pls+xml": { "source": "iana", "extensions": ["pls"] }, "application/poc-settings+xml": { "source": "iana" }, "application/postscript": { "source": "iana", "compressible": true, "extensions": ["ai","eps","ps"] }, "application/ppsp-tracker+json": { "source": "iana", "compressible": true }, "application/problem+json": { "source": "iana", "compressible": true }, "application/problem+xml": { "source": "iana" }, "application/provenance+xml": { "source": "iana" }, "application/prs.alvestrand.titrax-sheet": { "source": "iana" }, "application/prs.cww": { "source": "iana", "extensions": ["cww"] }, "application/prs.hpub+zip": { "source": "iana" }, "application/prs.nprend": { "source": "iana" }, "application/prs.plucker": { "source": "iana" }, "application/prs.rdf-xml-crypt": { "source": "iana" }, "application/prs.xsf+xml": { "source": "iana" }, "application/pskc+xml": { "source": "iana", "extensions": ["pskcxml"] }, "application/qsig": { "source": "iana" }, "application/raptorfec": { "source": "iana" }, "application/rdap+json": { "source": "iana", "compressible": true }, "application/rdf+xml": { "source": "iana", "compressible": true, "extensions": ["rdf"] }, "application/reginfo+xml": { "source": "iana", "extensions": ["rif"] }, "application/relax-ng-compact-syntax": { "source": "iana", "extensions": ["rnc"] }, "application/remote-printing": { "source": "iana" }, "application/reputon+json": { "source": "iana", "compressible": true }, "application/resource-lists+xml": { "source": "iana", "extensions": ["rl"] }, "application/resource-lists-diff+xml": { "source": "iana", "extensions": ["rld"] }, "application/rfc+xml": { "source": "iana" }, "application/riscos": { "source": "iana" }, "application/rlmi+xml": { "source": "iana" }, "application/rls-services+xml": { "source": "iana", "extensions": ["rs"] }, "application/rpki-ghostbusters": { "source": "iana", "extensions": ["gbr"] }, "application/rpki-manifest": { "source": "iana", "extensions": ["mft"] }, "application/rpki-roa": { "source": "iana", "extensions": ["roa"] }, "application/rpki-updown": { "source": "iana" }, "application/rsd+xml": { "source": "apache", "extensions": ["rsd"] }, "application/rss+xml": { "source": "apache", "compressible": true, "extensions": ["rss"] }, "application/rtf": { "source": "iana", "compressible": true, "extensions": ["rtf"] }, "application/rtploopback": { "source": "iana" }, "application/rtx": { "source": "iana" }, "application/samlassertion+xml": { "source": "iana" }, "application/samlmetadata+xml": { "source": "iana" }, "application/sbml+xml": { "source": "iana", "extensions": ["sbml"] }, "application/scaip+xml": { "source": "iana" }, "application/scim+json": { "source": "iana", "compressible": true }, "application/scvp-cv-request": { "source": "iana", "extensions": ["scq"] }, "application/scvp-cv-response": { "source": "iana", "extensions": ["scs"] }, "application/scvp-vp-request": { "source": "iana", "extensions": ["spq"] }, "application/scvp-vp-response": { "source": "iana", "extensions": ["spp"] }, "application/sdp": { "source": "iana", "extensions": ["sdp"] }, "application/sep+xml": { "source": "iana" }, "application/sep-exi": { "source": "iana" }, "application/session-info": { "source": "iana" }, "application/set-payment": { "source": "iana" }, "application/set-payment-initiation": { "source": "iana", "extensions": ["setpay"] }, "application/set-registration": { "source": "iana" }, "application/set-registration-initiation": { "source": "iana", "extensions": ["setreg"] }, "application/sgml": { "source": "iana" }, "application/sgml-open-catalog": { "source": "iana" }, "application/shf+xml": { "source": "iana", "extensions": ["shf"] }, "application/sieve": { "source": "iana" }, "application/simple-filter+xml": { "source": "iana" }, "application/simple-message-summary": { "source": "iana" }, "application/simplesymbolcontainer": { "source": "iana" }, "application/slate": { "source": "iana" }, "application/smil": { "source": "iana" }, "application/smil+xml": { "source": "iana", "extensions": ["smi","smil"] }, "application/smpte336m": { "source": "iana" }, "application/soap+fastinfoset": { "source": "iana" }, "application/soap+xml": { "source": "iana", "compressible": true }, "application/sparql-query": { "source": "iana", "extensions": ["rq"] }, "application/sparql-results+xml": { "source": "iana", "extensions": ["srx"] }, "application/spirits-event+xml": { "source": "iana" }, "application/sql": { "source": "iana" }, "application/srgs": { "source": "iana", "extensions": ["gram"] }, "application/srgs+xml": { "source": "iana", "extensions": ["grxml"] }, "application/sru+xml": { "source": "iana", "extensions": ["sru"] }, "application/ssdl+xml": { "source": "apache", "extensions": ["ssdl"] }, "application/ssml+xml": { "source": "iana", "extensions": ["ssml"] }, "application/tamp-apex-update": { "source": "iana" }, "application/tamp-apex-update-confirm": { "source": "iana" }, "application/tamp-community-update": { "source": "iana" }, "application/tamp-community-update-confirm": { "source": "iana" }, "application/tamp-error": { "source": "iana" }, "application/tamp-sequence-adjust": { "source": "iana" }, "application/tamp-sequence-adjust-confirm": { "source": "iana" }, "application/tamp-status-query": { "source": "iana" }, "application/tamp-status-response": { "source": "iana" }, "application/tamp-update": { "source": "iana" }, "application/tamp-update-confirm": { "source": "iana" }, "application/tar": { "compressible": true }, "application/tei+xml": { "source": "iana", "extensions": ["tei","teicorpus"] }, "application/thraud+xml": { "source": "iana", "extensions": ["tfi"] }, "application/timestamp-query": { "source": "iana" }, "application/timestamp-reply": { "source": "iana" }, "application/timestamped-data": { "source": "iana", "extensions": ["tsd"] }, "application/ttml+xml": { "source": "iana" }, "application/tve-trigger": { "source": "iana" }, "application/ulpfec": { "source": "iana" }, "application/urc-grpsheet+xml": { "source": "iana" }, "application/urc-ressheet+xml": { "source": "iana" }, "application/urc-targetdesc+xml": { "source": "iana" }, "application/urc-uisocketdesc+xml": { "source": "iana" }, "application/vcard+json": { "source": "iana", "compressible": true }, "application/vcard+xml": { "source": "iana" }, "application/vemmi": { "source": "iana" }, "application/vividence.scriptfile": { "source": "apache" }, "application/vnd.3gpp-prose+xml": { "source": "iana" }, "application/vnd.3gpp-prose-pc3ch+xml": { "source": "iana" }, "application/vnd.3gpp.access-transfer-events+xml": { "source": "iana" }, "application/vnd.3gpp.bsf+xml": { "source": "iana" }, "application/vnd.3gpp.mid-call+xml": { "source": "iana" }, "application/vnd.3gpp.pic-bw-large": { "source": "iana", "extensions": ["plb"] }, "application/vnd.3gpp.pic-bw-small": { "source": "iana", "extensions": ["psb"] }, "application/vnd.3gpp.pic-bw-var": { "source": "iana", "extensions": ["pvb"] }, "application/vnd.3gpp.sms": { "source": "iana" }, "application/vnd.3gpp.sms+xml": { "source": "iana" }, "application/vnd.3gpp.srvcc-ext+xml": { "source": "iana" }, "application/vnd.3gpp.srvcc-info+xml": { "source": "iana" }, "application/vnd.3gpp.state-and-event-info+xml": { "source": "iana" }, "application/vnd.3gpp.ussd+xml": { "source": "iana" }, "application/vnd.3gpp2.bcmcsinfo+xml": { "source": "iana" }, "application/vnd.3gpp2.sms": { "source": "iana" }, "application/vnd.3gpp2.tcap": { "source": "iana", "extensions": ["tcap"] }, "application/vnd.3lightssoftware.imagescal": { "source": "iana" }, "application/vnd.3m.post-it-notes": { "source": "iana", "extensions": ["pwn"] }, "application/vnd.accpac.simply.aso": { "source": "iana", "extensions": ["aso"] }, "application/vnd.accpac.simply.imp": { "source": "iana", "extensions": ["imp"] }, "application/vnd.acucobol": { "source": "iana", "extensions": ["acu"] }, "application/vnd.acucorp": { "source": "iana", "extensions": ["atc","acutc"] }, "application/vnd.adobe.air-application-installer-package+zip": { "source": "apache", "extensions": ["air"] }, "application/vnd.adobe.flash.movie": { "source": "iana" }, "application/vnd.adobe.formscentral.fcdt": { "source": "iana", "extensions": ["fcdt"] }, "application/vnd.adobe.fxp": { "source": "iana", "extensions": ["fxp","fxpl"] }, "application/vnd.adobe.partial-upload": { "source": "iana" }, "application/vnd.adobe.xdp+xml": { "source": "iana", "extensions": ["xdp"] }, "application/vnd.adobe.xfdf": { "source": "iana", "extensions": ["xfdf"] }, "application/vnd.aether.imp": { "source": "iana" }, "application/vnd.ah-barcode": { "source": "iana" }, "application/vnd.ahead.space": { "source": "iana", "extensions": ["ahead"] }, "application/vnd.airzip.filesecure.azf": { "source": "iana", "extensions": ["azf"] }, "application/vnd.airzip.filesecure.azs": { "source": "iana", "extensions": ["azs"] }, "application/vnd.amazon.ebook": { "source": "apache", "extensions": ["azw"] }, "application/vnd.americandynamics.acc": { "source": "iana", "extensions": ["acc"] }, "application/vnd.amiga.ami": { "source": "iana", "extensions": ["ami"] }, "application/vnd.amundsen.maze+xml": { "source": "iana" }, "application/vnd.android.package-archive": { "source": "apache", "compressible": false, "extensions": ["apk"] }, "application/vnd.anki": { "source": "iana" }, "application/vnd.anser-web-certificate-issue-initiation": { "source": "iana", "extensions": ["cii"] }, "application/vnd.anser-web-funds-transfer-initiation": { "source": "apache", "extensions": ["fti"] }, "application/vnd.antix.game-component": { "source": "iana", "extensions": ["atx"] }, "application/vnd.apache.thrift.binary": { "source": "iana" }, "application/vnd.apache.thrift.compact": { "source": "iana" }, "application/vnd.apache.thrift.json": { "source": "iana" }, "application/vnd.api+json": { "source": "iana", "compressible": true }, "application/vnd.apple.installer+xml": { "source": "iana", "extensions": ["mpkg"] }, "application/vnd.apple.mpegurl": { "source": "iana", "extensions": ["m3u8"] }, "application/vnd.apple.pkpass": { "compressible": false, "extensions": ["pkpass"] }, "application/vnd.arastra.swi": { "source": "iana" }, "application/vnd.aristanetworks.swi": { "source": "iana", "extensions": ["swi"] }, "application/vnd.artsquare": { "source": "iana" }, "application/vnd.astraea-software.iota": { "source": "iana", "extensions": ["iota"] }, "application/vnd.audiograph": { "source": "iana", "extensions": ["aep"] }, "application/vnd.autopackage": { "source": "iana" }, "application/vnd.avistar+xml": { "source": "iana" }, "application/vnd.balsamiq.bmml+xml": { "source": "iana" }, "application/vnd.balsamiq.bmpr": { "source": "iana" }, "application/vnd.bekitzur-stech+json": { "source": "iana", "compressible": true }, "application/vnd.biopax.rdf+xml": { "source": "iana" }, "application/vnd.blueice.multipass": { "source": "iana", "extensions": ["mpm"] }, "application/vnd.bluetooth.ep.oob": { "source": "iana" }, "application/vnd.bluetooth.le.oob": { "source": "iana" }, "application/vnd.bmi": { "source": "iana", "extensions": ["bmi"] }, "application/vnd.businessobjects": { "source": "iana", "extensions": ["rep"] }, "application/vnd.cab-jscript": { "source": "iana" }, "application/vnd.canon-cpdl": { "source": "iana" }, "application/vnd.canon-lips": { "source": "iana" }, "application/vnd.cendio.thinlinc.clientconf": { "source": "iana" }, "application/vnd.century-systems.tcp_stream": { "source": "iana" }, "application/vnd.chemdraw+xml": { "source": "iana", "extensions": ["cdxml"] }, "application/vnd.chipnuts.karaoke-mmd": { "source": "iana", "extensions": ["mmd"] }, "application/vnd.cinderella": { "source": "iana", "extensions": ["cdy"] }, "application/vnd.cirpack.isdn-ext": { "source": "iana" }, "application/vnd.citationstyles.style+xml": { "source": "iana" }, "application/vnd.claymore": { "source": "iana", "extensions": ["cla"] }, "application/vnd.cloanto.rp9": { "source": "iana", "extensions": ["rp9"] }, "application/vnd.clonk.c4group": { "source": "iana", "extensions": ["c4g","c4d","c4f","c4p","c4u"] }, "application/vnd.cluetrust.cartomobile-config": { "source": "iana", "extensions": ["c11amc"] }, "application/vnd.cluetrust.cartomobile-config-pkg": { "source": "iana", "extensions": ["c11amz"] }, "application/vnd.coffeescript": { "source": "iana" }, "application/vnd.collection+json": { "source": "iana", "compressible": true }, "application/vnd.collection.doc+json": { "source": "iana", "compressible": true }, "application/vnd.collection.next+json": { "source": "iana", "compressible": true }, "application/vnd.commerce-battelle": { "source": "iana" }, "application/vnd.commonspace": { "source": "iana", "extensions": ["csp"] }, "application/vnd.contact.cmsg": { "source": "iana", "extensions": ["cdbcmsg"] }, "application/vnd.coreos.ignition+json": { "source": "iana", "compressible": true }, "application/vnd.cosmocaller": { "source": "iana", "extensions": ["cmc"] }, "application/vnd.crick.clicker": { "source": "iana", "extensions": ["clkx"] }, "application/vnd.crick.clicker.keyboard": { "source": "iana", "extensions": ["clkk"] }, "application/vnd.crick.clicker.palette": { "source": "iana", "extensions": ["clkp"] }, "application/vnd.crick.clicker.template": { "source": "iana", "extensions": ["clkt"] }, "application/vnd.crick.clicker.wordbank": { "source": "iana", "extensions": ["clkw"] }, "application/vnd.criticaltools.wbs+xml": { "source": "iana", "extensions": ["wbs"] }, "application/vnd.ctc-posml": { "source": "iana", "extensions": ["pml"] }, "application/vnd.ctct.ws+xml": { "source": "iana" }, "application/vnd.cups-pdf": { "source": "iana" }, "application/vnd.cups-postscript": { "source": "iana" }, "application/vnd.cups-ppd": { "source": "iana", "extensions": ["ppd"] }, "application/vnd.cups-raster": { "source": "iana" }, "application/vnd.cups-raw": { "source": "iana" }, "application/vnd.curl": { "source": "iana" }, "application/vnd.curl.car": { "source": "apache", "extensions": ["car"] }, "application/vnd.curl.pcurl": { "source": "apache", "extensions": ["pcurl"] }, "application/vnd.cyan.dean.root+xml": { "source": "iana" }, "application/vnd.cybank": { "source": "iana" }, "application/vnd.dart": { "source": "iana", "compressible": true, "extensions": ["dart"] }, "application/vnd.data-vision.rdz": { "source": "iana", "extensions": ["rdz"] }, "application/vnd.debian.binary-package": { "source": "iana" }, "application/vnd.dece.data": { "source": "iana", "extensions": ["uvf","uvvf","uvd","uvvd"] }, "application/vnd.dece.ttml+xml": { "source": "iana", "extensions": ["uvt","uvvt"] }, "application/vnd.dece.unspecified": { "source": "iana", "extensions": ["uvx","uvvx"] }, "application/vnd.dece.zip": { "source": "iana", "extensions": ["uvz","uvvz"] }, "application/vnd.denovo.fcselayout-link": { "source": "iana", "extensions": ["fe_launch"] }, "application/vnd.desmume-movie": { "source": "iana" }, "application/vnd.desmume.movie": { "source": "apache" }, "application/vnd.dir-bi.plate-dl-nosuffix": { "source": "iana" }, "application/vnd.dm.delegation+xml": { "source": "iana" }, "application/vnd.dna": { "source": "iana", "extensions": ["dna"] }, "application/vnd.document+json": { "source": "iana", "compressible": true }, "application/vnd.dolby.mlp": { "source": "apache", "extensions": ["mlp"] }, "application/vnd.dolby.mobile.1": { "source": "iana" }, "application/vnd.dolby.mobile.2": { "source": "iana" }, "application/vnd.doremir.scorecloud-binary-document": { "source": "iana" }, "application/vnd.dpgraph": { "source": "iana", "extensions": ["dpg"] }, "application/vnd.dreamfactory": { "source": "iana", "extensions": ["dfac"] }, "application/vnd.drive+json": { "source": "iana", "compressible": true }, "application/vnd.ds-keypoint": { "source": "apache", "extensions": ["kpxx"] }, "application/vnd.dtg.local": { "source": "iana" }, "application/vnd.dtg.local.flash": { "source": "iana" }, "application/vnd.dtg.local.html": { "source": "iana" }, "application/vnd.dvb.ait": { "source": "iana", "extensions": ["ait"] }, "application/vnd.dvb.dvbj": { "source": "iana" }, "application/vnd.dvb.esgcontainer": { "source": "iana" }, "application/vnd.dvb.ipdcdftnotifaccess": { "source": "iana" }, "application/vnd.dvb.ipdcesgaccess": { "source": "iana" }, "application/vnd.dvb.ipdcesgaccess2": { "source": "iana" }, "application/vnd.dvb.ipdcesgpdd": { "source": "iana" }, "application/vnd.dvb.ipdcroaming": { "source": "iana" }, "application/vnd.dvb.iptv.alfec-base": { "source": "iana" }, "application/vnd.dvb.iptv.alfec-enhancement": { "source": "iana" }, "application/vnd.dvb.notif-aggregate-root+xml": { "source": "iana" }, "application/vnd.dvb.notif-container+xml": { "source": "iana" }, "application/vnd.dvb.notif-generic+xml": { "source": "iana" }, "application/vnd.dvb.notif-ia-msglist+xml": { "source": "iana" }, "application/vnd.dvb.notif-ia-registration-request+xml": { "source": "iana" }, "application/vnd.dvb.notif-ia-registration-response+xml": { "source": "iana" }, "application/vnd.dvb.notif-init+xml": { "source": "iana" }, "application/vnd.dvb.pfr": { "source": "iana" }, "application/vnd.dvb.service": { "source": "iana", "extensions": ["svc"] }, "application/vnd.dxr": { "source": "iana" }, "application/vnd.dynageo": { "source": "iana", "extensions": ["geo"] }, "application/vnd.dzr": { "source": "iana" }, "application/vnd.easykaraoke.cdgdownload": { "source": "iana" }, "application/vnd.ecdis-update": { "source": "iana" }, "application/vnd.ecowin.chart": { "source": "iana", "extensions": ["mag"] }, "application/vnd.ecowin.filerequest": { "source": "iana" }, "application/vnd.ecowin.fileupdate": { "source": "iana" }, "application/vnd.ecowin.series": { "source": "iana" }, "application/vnd.ecowin.seriesrequest": { "source": "iana" }, "application/vnd.ecowin.seriesupdate": { "source": "iana" }, "application/vnd.emclient.accessrequest+xml": { "source": "iana" }, "application/vnd.enliven": { "source": "iana", "extensions": ["nml"] }, "application/vnd.enphase.envoy": { "source": "iana" }, "application/vnd.eprints.data+xml": { "source": "iana" }, "application/vnd.epson.esf": { "source": "iana", "extensions": ["esf"] }, "application/vnd.epson.msf": { "source": "iana", "extensions": ["msf"] }, "application/vnd.epson.quickanime": { "source": "iana", "extensions": ["qam"] }, "application/vnd.epson.salt": { "source": "iana", "extensions": ["slt"] }, "application/vnd.epson.ssf": { "source": "iana", "extensions": ["ssf"] }, "application/vnd.ericsson.quickcall": { "source": "iana" }, "application/vnd.eszigno3+xml": { "source": "iana", "extensions": ["es3","et3"] }, "application/vnd.etsi.aoc+xml": { "source": "iana" }, "application/vnd.etsi.asic-e+zip": { "source": "iana" }, "application/vnd.etsi.asic-s+zip": { "source": "iana" }, "application/vnd.etsi.cug+xml": { "source": "iana" }, "application/vnd.etsi.iptvcommand+xml": { "source": "iana" }, "application/vnd.etsi.iptvdiscovery+xml": { "source": "iana" }, "application/vnd.etsi.iptvprofile+xml": { "source": "iana" }, "application/vnd.etsi.iptvsad-bc+xml": { "source": "iana" }, "application/vnd.etsi.iptvsad-cod+xml": { "source": "iana" }, "application/vnd.etsi.iptvsad-npvr+xml": { "source": "iana" }, "application/vnd.etsi.iptvservice+xml": { "source": "iana" }, "application/vnd.etsi.iptvsync+xml": { "source": "iana" }, "application/vnd.etsi.iptvueprofile+xml": { "source": "iana" }, "application/vnd.etsi.mcid+xml": { "source": "iana" }, "application/vnd.etsi.mheg5": { "source": "iana" }, "application/vnd.etsi.overload-control-policy-dataset+xml": { "source": "iana" }, "application/vnd.etsi.pstn+xml": { "source": "iana" }, "application/vnd.etsi.sci+xml": { "source": "iana" }, "application/vnd.etsi.simservs+xml": { "source": "iana" }, "application/vnd.etsi.timestamp-token": { "source": "iana" }, "application/vnd.etsi.tsl+xml": { "source": "iana" }, "application/vnd.etsi.tsl.der": { "source": "iana" }, "application/vnd.eudora.data": { "source": "iana" }, "application/vnd.ezpix-album": { "source": "iana", "extensions": ["ez2"] }, "application/vnd.ezpix-package": { "source": "iana", "extensions": ["ez3"] }, "application/vnd.f-secure.mobile": { "source": "iana" }, "application/vnd.fastcopy-disk-image": { "source": "iana" }, "application/vnd.fdf": { "source": "iana", "extensions": ["fdf"] }, "application/vnd.fdsn.mseed": { "source": "iana", "extensions": ["mseed"] }, "application/vnd.fdsn.seed": { "source": "iana", "extensions": ["seed","dataless"] }, "application/vnd.ffsns": { "source": "iana" }, "application/vnd.filmit.zfc": { "source": "iana" }, "application/vnd.fints": { "source": "iana" }, "application/vnd.firemonkeys.cloudcell": { "source": "iana" }, "application/vnd.flographit": { "source": "iana", "extensions": ["gph"] }, "application/vnd.fluxtime.clip": { "source": "iana", "extensions": ["ftc"] }, "application/vnd.font-fontforge-sfd": { "source": "iana" }, "application/vnd.framemaker": { "source": "iana", "extensions": ["fm","frame","maker","book"] }, "application/vnd.frogans.fnc": { "source": "iana", "extensions": ["fnc"] }, "application/vnd.frogans.ltf": { "source": "iana", "extensions": ["ltf"] }, "application/vnd.fsc.weblaunch": { "source": "iana", "extensions": ["fsc"] }, "application/vnd.fujitsu.oasys": { "source": "iana", "extensions": ["oas"] }, "application/vnd.fujitsu.oasys2": { "source": "iana", "extensions": ["oa2"] }, "application/vnd.fujitsu.oasys3": { "source": "iana", "extensions": ["oa3"] }, "application/vnd.fujitsu.oasysgp": { "source": "iana", "extensions": ["fg5"] }, "application/vnd.fujitsu.oasysprs": { "source": "iana", "extensions": ["bh2"] }, "application/vnd.fujixerox.art-ex": { "source": "iana" }, "application/vnd.fujixerox.art4": { "source": "iana" }, "application/vnd.fujixerox.ddd": { "source": "iana", "extensions": ["ddd"] }, "application/vnd.fujixerox.docuworks": { "source": "iana", "extensions": ["xdw"] }, "application/vnd.fujixerox.docuworks.binder": { "source": "iana", "extensions": ["xbd"] }, "application/vnd.fujixerox.docuworks.container": { "source": "iana" }, "application/vnd.fujixerox.hbpl": { "source": "iana" }, "application/vnd.fut-misnet": { "source": "iana" }, "application/vnd.fuzzysheet": { "source": "iana", "extensions": ["fzs"] }, "application/vnd.genomatix.tuxedo": { "source": "iana", "extensions": ["txd"] }, "application/vnd.geo+json": { "source": "iana", "compressible": true }, "application/vnd.geocube+xml": { "source": "iana" }, "application/vnd.geogebra.file": { "source": "iana", "extensions": ["ggb"] }, "application/vnd.geogebra.tool": { "source": "iana", "extensions": ["ggt"] }, "application/vnd.geometry-explorer": { "source": "iana", "extensions": ["gex","gre"] }, "application/vnd.geonext": { "source": "iana", "extensions": ["gxt"] }, "application/vnd.geoplan": { "source": "iana", "extensions": ["g2w"] }, "application/vnd.geospace": { "source": "iana", "extensions": ["g3w"] }, "application/vnd.gerber": { "source": "iana" }, "application/vnd.globalplatform.card-content-mgt": { "source": "iana" }, "application/vnd.globalplatform.card-content-mgt-response": { "source": "iana" }, "application/vnd.gmx": { "source": "iana", "extensions": ["gmx"] }, "application/vnd.google-apps.document": { "compressible": false, "extensions": ["gdoc"] }, "application/vnd.google-apps.presentation": { "compressible": false, "extensions": ["gslides"] }, "application/vnd.google-apps.spreadsheet": { "compressible": false, "extensions": ["gsheet"] }, "application/vnd.google-earth.kml+xml": { "source": "iana", "compressible": true, "extensions": ["kml"] }, "application/vnd.google-earth.kmz": { "source": "iana", "compressible": false, "extensions": ["kmz"] }, "application/vnd.gov.sk.e-form+xml": { "source": "iana" }, "application/vnd.gov.sk.e-form+zip": { "source": "iana" }, "application/vnd.gov.sk.xmldatacontainer+xml": { "source": "iana" }, "application/vnd.grafeq": { "source": "iana", "extensions": ["gqf","gqs"] }, "application/vnd.gridmp": { "source": "iana" }, "application/vnd.groove-account": { "source": "iana", "extensions": ["gac"] }, "application/vnd.groove-help": { "source": "iana", "extensions": ["ghf"] }, "application/vnd.groove-identity-message": { "source": "iana", "extensions": ["gim"] }, "application/vnd.groove-injector": { "source": "iana", "extensions": ["grv"] }, "application/vnd.groove-tool-message": { "source": "iana", "extensions": ["gtm"] }, "application/vnd.groove-tool-template": { "source": "iana", "extensions": ["tpl"] }, "application/vnd.groove-vcard": { "source": "iana", "extensions": ["vcg"] }, "application/vnd.hal+json": { "source": "iana", "compressible": true }, "application/vnd.hal+xml": { "source": "iana", "extensions": ["hal"] }, "application/vnd.handheld-entertainment+xml": { "source": "iana", "extensions": ["zmm"] }, "application/vnd.hbci": { "source": "iana", "extensions": ["hbci"] }, "application/vnd.hcl-bireports": { "source": "iana" }, "application/vnd.hdt": { "source": "iana" }, "application/vnd.heroku+json": { "source": "iana", "compressible": true }, "application/vnd.hhe.lesson-player": { "source": "iana", "extensions": ["les"] }, "application/vnd.hp-hpgl": { "source": "iana", "extensions": ["hpgl"] }, "application/vnd.hp-hpid": { "source": "iana", "extensions": ["hpid"] }, "application/vnd.hp-hps": { "source": "iana", "extensions": ["hps"] }, "application/vnd.hp-jlyt": { "source": "iana", "extensions": ["jlt"] }, "application/vnd.hp-pcl": { "source": "iana", "extensions": ["pcl"] }, "application/vnd.hp-pclxl": { "source": "iana", "extensions": ["pclxl"] }, "application/vnd.httphone": { "source": "iana" }, "application/vnd.hydrostatix.sof-data": { "source": "iana", "extensions": ["sfd-hdstx"] }, "application/vnd.hyperdrive+json": { "source": "iana", "compressible": true }, "application/vnd.hzn-3d-crossword": { "source": "iana" }, "application/vnd.ibm.afplinedata": { "source": "iana" }, "application/vnd.ibm.electronic-media": { "source": "iana" }, "application/vnd.ibm.minipay": { "source": "iana", "extensions": ["mpy"] }, "application/vnd.ibm.modcap": { "source": "iana", "extensions": ["afp","listafp","list3820"] }, "application/vnd.ibm.rights-management": { "source": "iana", "extensions": ["irm"] }, "application/vnd.ibm.secure-container": { "source": "iana", "extensions": ["sc"] }, "application/vnd.iccprofile": { "source": "iana", "extensions": ["icc","icm"] }, "application/vnd.ieee.1905": { "source": "iana" }, "application/vnd.igloader": { "source": "iana", "extensions": ["igl"] }, "application/vnd.immervision-ivp": { "source": "iana", "extensions": ["ivp"] }, "application/vnd.immervision-ivu": { "source": "iana", "extensions": ["ivu"] }, "application/vnd.ims.imsccv1p1": { "source": "iana" }, "application/vnd.ims.imsccv1p2": { "source": "iana" }, "application/vnd.ims.imsccv1p3": { "source": "iana" }, "application/vnd.ims.lis.v2.result+json": { "source": "iana", "compressible": true }, "application/vnd.ims.lti.v2.toolconsumerprofile+json": { "source": "iana", "compressible": true }, "application/vnd.ims.lti.v2.toolproxy+json": { "source": "iana", "compressible": true }, "application/vnd.ims.lti.v2.toolproxy.id+json": { "source": "iana", "compressible": true }, "application/vnd.ims.lti.v2.toolsettings+json": { "source": "iana", "compressible": true }, "application/vnd.ims.lti.v2.toolsettings.simple+json": { "source": "iana", "compressible": true }, "application/vnd.informedcontrol.rms+xml": { "source": "iana" }, "application/vnd.informix-visionary": { "source": "iana" }, "application/vnd.infotech.project": { "source": "iana" }, "application/vnd.infotech.project+xml": { "source": "iana" }, "application/vnd.innopath.wamp.notification": { "source": "iana" }, "application/vnd.insors.igm": { "source": "iana", "extensions": ["igm"] }, "application/vnd.intercon.formnet": { "source": "iana", "extensions": ["xpw","xpx"] }, "application/vnd.intergeo": { "source": "iana", "extensions": ["i2g"] }, "application/vnd.intertrust.digibox": { "source": "iana" }, "application/vnd.intertrust.nncp": { "source": "iana" }, "application/vnd.intu.qbo": { "source": "iana", "extensions": ["qbo"] }, "application/vnd.intu.qfx": { "source": "iana", "extensions": ["qfx"] }, "application/vnd.iptc.g2.catalogitem+xml": { "source": "iana" }, "application/vnd.iptc.g2.conceptitem+xml": { "source": "iana" }, "application/vnd.iptc.g2.knowledgeitem+xml": { "source": "iana" }, "application/vnd.iptc.g2.newsitem+xml": { "source": "iana" }, "application/vnd.iptc.g2.newsmessage+xml": { "source": "iana" }, "application/vnd.iptc.g2.packageitem+xml": { "source": "iana" }, "application/vnd.iptc.g2.planningitem+xml": { "source": "iana" }, "application/vnd.ipunplugged.rcprofile": { "source": "iana", "extensions": ["rcprofile"] }, "application/vnd.irepository.package+xml": { "source": "iana", "extensions": ["irp"] }, "application/vnd.is-xpr": { "source": "iana", "extensions": ["xpr"] }, "application/vnd.isac.fcs": { "source": "iana", "extensions": ["fcs"] }, "application/vnd.jam": { "source": "iana", "extensions": ["jam"] }, "application/vnd.japannet-directory-service": { "source": "iana" }, "application/vnd.japannet-jpnstore-wakeup": { "source": "iana" }, "application/vnd.japannet-payment-wakeup": { "source": "iana" }, "application/vnd.japannet-registration": { "source": "iana" }, "application/vnd.japannet-registration-wakeup": { "source": "iana" }, "application/vnd.japannet-setstore-wakeup": { "source": "iana" }, "application/vnd.japannet-verification": { "source": "iana" }, "application/vnd.japannet-verification-wakeup": { "source": "iana" }, "application/vnd.jcp.javame.midlet-rms": { "source": "iana", "extensions": ["rms"] }, "application/vnd.jisp": { "source": "iana", "extensions": ["jisp"] }, "application/vnd.joost.joda-archive": { "source": "iana", "extensions": ["joda"] }, "application/vnd.jsk.isdn-ngn": { "source": "iana" }, "application/vnd.kahootz": { "source": "iana", "extensions": ["ktz","ktr"] }, "application/vnd.kde.karbon": { "source": "iana", "extensions": ["karbon"] }, "application/vnd.kde.kchart": { "source": "iana", "extensions": ["chrt"] }, "application/vnd.kde.kformula": { "source": "iana", "extensions": ["kfo"] }, "application/vnd.kde.kivio": { "source": "iana", "extensions": ["flw"] }, "application/vnd.kde.kontour": { "source": "iana", "extensions": ["kon"] }, "application/vnd.kde.kpresenter": { "source": "iana", "extensions": ["kpr","kpt"] }, "application/vnd.kde.kspread": { "source": "iana", "extensions": ["ksp"] }, "application/vnd.kde.kword": { "source": "iana", "extensions": ["kwd","kwt"] }, "application/vnd.kenameaapp": { "source": "iana", "extensions": ["htke"] }, "application/vnd.kidspiration": { "source": "iana", "extensions": ["kia"] }, "application/vnd.kinar": { "source": "iana", "extensions": ["kne","knp"] }, "application/vnd.koan": { "source": "iana", "extensions": ["skp","skd","skt","skm"] }, "application/vnd.kodak-descriptor": { "source": "iana", "extensions": ["sse"] }, "application/vnd.las.las+xml": { "source": "iana", "extensions": ["lasxml"] }, "application/vnd.liberty-request+xml": { "source": "iana" }, "application/vnd.llamagraphics.life-balance.desktop": { "source": "iana", "extensions": ["lbd"] }, "application/vnd.llamagraphics.life-balance.exchange+xml": { "source": "iana", "extensions": ["lbe"] }, "application/vnd.lotus-1-2-3": { "source": "iana", "extensions": ["123"] }, "application/vnd.lotus-approach": { "source": "iana", "extensions": ["apr"] }, "application/vnd.lotus-freelance": { "source": "iana", "extensions": ["pre"] }, "application/vnd.lotus-notes": { "source": "iana", "extensions": ["nsf"] }, "application/vnd.lotus-organizer": { "source": "iana", "extensions": ["org"] }, "application/vnd.lotus-screencam": { "source": "iana", "extensions": ["scm"] }, "application/vnd.lotus-wordpro": { "source": "iana", "extensions": ["lwp"] }, "application/vnd.macports.portpkg": { "source": "iana", "extensions": ["portpkg"] }, "application/vnd.mapbox-vector-tile": { "source": "iana" }, "application/vnd.marlin.drm.actiontoken+xml": { "source": "iana" }, "application/vnd.marlin.drm.conftoken+xml": { "source": "iana" }, "application/vnd.marlin.drm.license+xml": { "source": "iana" }, "application/vnd.marlin.drm.mdcf": { "source": "iana" }, "application/vnd.mason+json": { "source": "iana", "compressible": true }, "application/vnd.maxmind.maxmind-db": { "source": "iana" }, "application/vnd.mcd": { "source": "iana", "extensions": ["mcd"] }, "application/vnd.medcalcdata": { "source": "iana", "extensions": ["mc1"] }, "application/vnd.mediastation.cdkey": { "source": "iana", "extensions": ["cdkey"] }, "application/vnd.meridian-slingshot": { "source": "iana" }, "application/vnd.mfer": { "source": "iana", "extensions": ["mwf"] }, "application/vnd.mfmp": { "source": "iana", "extensions": ["mfm"] }, "application/vnd.micro+json": { "source": "iana", "compressible": true }, "application/vnd.micrografx.flo": { "source": "iana", "extensions": ["flo"] }, "application/vnd.micrografx.igx": { "source": "iana", "extensions": ["igx"] }, "application/vnd.microsoft.portable-executable": { "source": "iana" }, "application/vnd.miele+json": { "source": "iana", "compressible": true }, "application/vnd.mif": { "source": "iana", "extensions": ["mif"] }, "application/vnd.minisoft-hp3000-save": { "source": "iana" }, "application/vnd.mitsubishi.misty-guard.trustweb": { "source": "iana" }, "application/vnd.mobius.daf": { "source": "iana", "extensions": ["daf"] }, "application/vnd.mobius.dis": { "source": "iana", "extensions": ["dis"] }, "application/vnd.mobius.mbk": { "source": "iana", "extensions": ["mbk"] }, "application/vnd.mobius.mqy": { "source": "iana", "extensions": ["mqy"] }, "application/vnd.mobius.msl": { "source": "iana", "extensions": ["msl"] }, "application/vnd.mobius.plc": { "source": "iana", "extensions": ["plc"] }, "application/vnd.mobius.txf": { "source": "iana", "extensions": ["txf"] }, "application/vnd.mophun.application": { "source": "iana", "extensions": ["mpn"] }, "application/vnd.mophun.certificate": { "source": "iana", "extensions": ["mpc"] }, "application/vnd.motorola.flexsuite": { "source": "iana" }, "application/vnd.motorola.flexsuite.adsi": { "source": "iana" }, "application/vnd.motorola.flexsuite.fis": { "source": "iana" }, "application/vnd.motorola.flexsuite.gotap": { "source": "iana" }, "application/vnd.motorola.flexsuite.kmr": { "source": "iana" }, "application/vnd.motorola.flexsuite.ttc": { "source": "iana" }, "application/vnd.motorola.flexsuite.wem": { "source": "iana" }, "application/vnd.motorola.iprm": { "source": "iana" }, "application/vnd.mozilla.xul+xml": { "source": "iana", "compressible": true, "extensions": ["xul"] }, "application/vnd.ms-3mfdocument": { "source": "iana" }, "application/vnd.ms-artgalry": { "source": "iana", "extensions": ["cil"] }, "application/vnd.ms-asf": { "source": "iana" }, "application/vnd.ms-cab-compressed": { "source": "iana", "extensions": ["cab"] }, "application/vnd.ms-color.iccprofile": { "source": "apache" }, "application/vnd.ms-excel": { "source": "iana", "compressible": false, "extensions": ["xls","xlm","xla","xlc","xlt","xlw"] }, "application/vnd.ms-excel.addin.macroenabled.12": { "source": "iana", "extensions": ["xlam"] }, "application/vnd.ms-excel.sheet.binary.macroenabled.12": { "source": "iana", "extensions": ["xlsb"] }, "application/vnd.ms-excel.sheet.macroenabled.12": { "source": "iana", "extensions": ["xlsm"] }, "application/vnd.ms-excel.template.macroenabled.12": { "source": "iana", "extensions": ["xltm"] }, "application/vnd.ms-fontobject": { "source": "iana", "compressible": true, "extensions": ["eot"] }, "application/vnd.ms-htmlhelp": { "source": "iana", "extensions": ["chm"] }, "application/vnd.ms-ims": { "source": "iana", "extensions": ["ims"] }, "application/vnd.ms-lrm": { "source": "iana", "extensions": ["lrm"] }, "application/vnd.ms-office.activex+xml": { "source": "iana" }, "application/vnd.ms-officetheme": { "source": "iana", "extensions": ["thmx"] }, "application/vnd.ms-opentype": { "source": "apache", "compressible": true }, "application/vnd.ms-package.obfuscated-opentype": { "source": "apache" }, "application/vnd.ms-pki.seccat": { "source": "apache", "extensions": ["cat"] }, "application/vnd.ms-pki.stl": { "source": "apache", "extensions": ["stl"] }, "application/vnd.ms-playready.initiator+xml": { "source": "iana" }, "application/vnd.ms-powerpoint": { "source": "iana", "compressible": false, "extensions": ["ppt","pps","pot"] }, "application/vnd.ms-powerpoint.addin.macroenabled.12": { "source": "iana", "extensions": ["ppam"] }, "application/vnd.ms-powerpoint.presentation.macroenabled.12": { "source": "iana", "extensions": ["pptm"] }, "application/vnd.ms-powerpoint.slide.macroenabled.12": { "source": "iana", "extensions": ["sldm"] }, "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { "source": "iana", "extensions": ["ppsm"] }, "application/vnd.ms-powerpoint.template.macroenabled.12": { "source": "iana", "extensions": ["potm"] }, "application/vnd.ms-printdevicecapabilities+xml": { "source": "iana" }, "application/vnd.ms-printing.printticket+xml": { "source": "apache" }, "application/vnd.ms-printschematicket+xml": { "source": "iana" }, "application/vnd.ms-project": { "source": "iana", "extensions": ["mpp","mpt"] }, "application/vnd.ms-tnef": { "source": "iana" }, "application/vnd.ms-windows.devicepairing": { "source": "iana" }, "application/vnd.ms-windows.nwprinting.oob": { "source": "iana" }, "application/vnd.ms-windows.printerpairing": { "source": "iana" }, "application/vnd.ms-windows.wsd.oob": { "source": "iana" }, "application/vnd.ms-wmdrm.lic-chlg-req": { "source": "iana" }, "application/vnd.ms-wmdrm.lic-resp": { "source": "iana" }, "application/vnd.ms-wmdrm.meter-chlg-req": { "source": "iana" }, "application/vnd.ms-wmdrm.meter-resp": { "source": "iana" }, "application/vnd.ms-word.document.macroenabled.12": { "source": "iana", "extensions": ["docm"] }, "application/vnd.ms-word.template.macroenabled.12": { "source": "iana", "extensions": ["dotm"] }, "application/vnd.ms-works": { "source": "iana", "extensions": ["wps","wks","wcm","wdb"] }, "application/vnd.ms-wpl": { "source": "iana", "extensions": ["wpl"] }, "application/vnd.ms-xpsdocument": { "source": "iana", "compressible": false, "extensions": ["xps"] }, "application/vnd.msa-disk-image": { "source": "iana" }, "application/vnd.mseq": { "source": "iana", "extensions": ["mseq"] }, "application/vnd.msign": { "source": "iana" }, "application/vnd.multiad.creator": { "source": "iana" }, "application/vnd.multiad.creator.cif": { "source": "iana" }, "application/vnd.music-niff": { "source": "iana" }, "application/vnd.musician": { "source": "iana", "extensions": ["mus"] }, "application/vnd.muvee.style": { "source": "iana", "extensions": ["msty"] }, "application/vnd.mynfc": { "source": "iana", "extensions": ["taglet"] }, "application/vnd.ncd.control": { "source": "iana" }, "application/vnd.ncd.reference": { "source": "iana" }, "application/vnd.nervana": { "source": "iana" }, "application/vnd.netfpx": { "source": "iana" }, "application/vnd.neurolanguage.nlu": { "source": "iana", "extensions": ["nlu"] }, "application/vnd.nintendo.nitro.rom": { "source": "iana" }, "application/vnd.nintendo.snes.rom": { "source": "iana" }, "application/vnd.nitf": { "source": "iana", "extensions": ["ntf","nitf"] }, "application/vnd.noblenet-directory": { "source": "iana", "extensions": ["nnd"] }, "application/vnd.noblenet-sealer": { "source": "iana", "extensions": ["nns"] }, "application/vnd.noblenet-web": { "source": "iana", "extensions": ["nnw"] }, "application/vnd.nokia.catalogs": { "source": "iana" }, "application/vnd.nokia.conml+wbxml": { "source": "iana" }, "application/vnd.nokia.conml+xml": { "source": "iana" }, "application/vnd.nokia.iptv.config+xml": { "source": "iana" }, "application/vnd.nokia.isds-radio-presets": { "source": "iana" }, "application/vnd.nokia.landmark+wbxml": { "source": "iana" }, "application/vnd.nokia.landmark+xml": { "source": "iana" }, "application/vnd.nokia.landmarkcollection+xml": { "source": "iana" }, "application/vnd.nokia.n-gage.ac+xml": { "source": "iana" }, "application/vnd.nokia.n-gage.data": { "source": "iana", "extensions": ["ngdat"] }, "application/vnd.nokia.n-gage.symbian.install": { "source": "iana", "extensions": ["n-gage"] }, "application/vnd.nokia.ncd": { "source": "iana" }, "application/vnd.nokia.pcd+wbxml": { "source": "iana" }, "application/vnd.nokia.pcd+xml": { "source": "iana" }, "application/vnd.nokia.radio-preset": { "source": "iana", "extensions": ["rpst"] }, "application/vnd.nokia.radio-presets": { "source": "iana", "extensions": ["rpss"] }, "application/vnd.novadigm.edm": { "source": "iana", "extensions": ["edm"] }, "application/vnd.novadigm.edx": { "source": "iana", "extensions": ["edx"] }, "application/vnd.novadigm.ext": { "source": "iana", "extensions": ["ext"] }, "application/vnd.ntt-local.content-share": { "source": "iana" }, "application/vnd.ntt-local.file-transfer": { "source": "iana" }, "application/vnd.ntt-local.ogw_remote-access": { "source": "iana" }, "application/vnd.ntt-local.sip-ta_remote": { "source": "iana" }, "application/vnd.ntt-local.sip-ta_tcp_stream": { "source": "iana" }, "application/vnd.oasis.opendocument.chart": { "source": "iana", "extensions": ["odc"] }, "application/vnd.oasis.opendocument.chart-template": { "source": "iana", "extensions": ["otc"] }, "application/vnd.oasis.opendocument.database": { "source": "iana", "extensions": ["odb"] }, "application/vnd.oasis.opendocument.formula": { "source": "iana", "extensions": ["odf"] }, "application/vnd.oasis.opendocument.formula-template": { "source": "iana", "extensions": ["odft"] }, "application/vnd.oasis.opendocument.graphics": { "source": "iana", "compressible": false, "extensions": ["odg"] }, "application/vnd.oasis.opendocument.graphics-template": { "source": "iana", "extensions": ["otg"] }, "application/vnd.oasis.opendocument.image": { "source": "iana", "extensions": ["odi"] }, "application/vnd.oasis.opendocument.image-template": { "source": "iana", "extensions": ["oti"] }, "application/vnd.oasis.opendocument.presentation": { "source": "iana", "compressible": false, "extensions": ["odp"] }, "application/vnd.oasis.opendocument.presentation-template": { "source": "iana", "extensions": ["otp"] }, "application/vnd.oasis.opendocument.spreadsheet": { "source": "iana", "compressible": false, "extensions": ["ods"] }, "application/vnd.oasis.opendocument.spreadsheet-template": { "source": "iana", "extensions": ["ots"] }, "application/vnd.oasis.opendocument.text": { "source": "iana", "compressible": false, "extensions": ["odt"] }, "application/vnd.oasis.opendocument.text-master": { "source": "iana", "extensions": ["odm"] }, "application/vnd.oasis.opendocument.text-template": { "source": "iana", "extensions": ["ott"] }, "application/vnd.oasis.opendocument.text-web": { "source": "iana", "extensions": ["oth"] }, "application/vnd.obn": { "source": "iana" }, "application/vnd.oftn.l10n+json": { "source": "iana", "compressible": true }, "application/vnd.oipf.contentaccessdownload+xml": { "source": "iana" }, "application/vnd.oipf.contentaccessstreaming+xml": { "source": "iana" }, "application/vnd.oipf.cspg-hexbinary": { "source": "iana" }, "application/vnd.oipf.dae.svg+xml": { "source": "iana" }, "application/vnd.oipf.dae.xhtml+xml": { "source": "iana" }, "application/vnd.oipf.mippvcontrolmessage+xml": { "source": "iana" }, "application/vnd.oipf.pae.gem": { "source": "iana" }, "application/vnd.oipf.spdiscovery+xml": { "source": "iana" }, "application/vnd.oipf.spdlist+xml": { "source": "iana" }, "application/vnd.oipf.ueprofile+xml": { "source": "iana" }, "application/vnd.oipf.userprofile+xml": { "source": "iana" }, "application/vnd.olpc-sugar": { "source": "iana", "extensions": ["xo"] }, "application/vnd.oma-scws-config": { "source": "iana" }, "application/vnd.oma-scws-http-request": { "source": "iana" }, "application/vnd.oma-scws-http-response": { "source": "iana" }, "application/vnd.oma.bcast.associated-procedure-parameter+xml": { "source": "iana" }, "application/vnd.oma.bcast.drm-trigger+xml": { "source": "iana" }, "application/vnd.oma.bcast.imd+xml": { "source": "iana" }, "application/vnd.oma.bcast.ltkm": { "source": "iana" }, "application/vnd.oma.bcast.notification+xml": { "source": "iana" }, "application/vnd.oma.bcast.provisioningtrigger": { "source": "iana" }, "application/vnd.oma.bcast.sgboot": { "source": "iana" }, "application/vnd.oma.bcast.sgdd+xml": { "source": "iana" }, "application/vnd.oma.bcast.sgdu": { "source": "iana" }, "application/vnd.oma.bcast.simple-symbol-container": { "source": "iana" }, "application/vnd.oma.bcast.smartcard-trigger+xml": { "source": "iana" }, "application/vnd.oma.bcast.sprov+xml": { "source": "iana" }, "application/vnd.oma.bcast.stkm": { "source": "iana" }, "application/vnd.oma.cab-address-book+xml": { "source": "iana" }, "application/vnd.oma.cab-feature-handler+xml": { "source": "iana" }, "application/vnd.oma.cab-pcc+xml": { "source": "iana" }, "application/vnd.oma.cab-subs-invite+xml": { "source": "iana" }, "application/vnd.oma.cab-user-prefs+xml": { "source": "iana" }, "application/vnd.oma.dcd": { "source": "iana" }, "application/vnd.oma.dcdc": { "source": "iana" }, "application/vnd.oma.dd2+xml": { "source": "iana", "extensions": ["dd2"] }, "application/vnd.oma.drm.risd+xml": { "source": "iana" }, "application/vnd.oma.group-usage-list+xml": { "source": "iana" }, "application/vnd.oma.pal+xml": { "source": "iana" }, "application/vnd.oma.poc.detailed-progress-report+xml": { "source": "iana" }, "application/vnd.oma.poc.final-report+xml": { "source": "iana" }, "application/vnd.oma.poc.groups+xml": { "source": "iana" }, "application/vnd.oma.poc.invocation-descriptor+xml": { "source": "iana" }, "application/vnd.oma.poc.optimized-progress-report+xml": { "source": "iana" }, "application/vnd.oma.push": { "source": "iana" }, "application/vnd.oma.scidm.messages+xml": { "source": "iana" }, "application/vnd.oma.xcap-directory+xml": { "source": "iana" }, "application/vnd.omads-email+xml": { "source": "iana" }, "application/vnd.omads-file+xml": { "source": "iana" }, "application/vnd.omads-folder+xml": { "source": "iana" }, "application/vnd.omaloc-supl-init": { "source": "iana" }, "application/vnd.onepager": { "source": "iana" }, "application/vnd.openblox.game+xml": { "source": "iana" }, "application/vnd.openblox.game-binary": { "source": "iana" }, "application/vnd.openeye.oeb": { "source": "iana" }, "application/vnd.openofficeorg.extension": { "source": "apache", "extensions": ["oxt"] }, "application/vnd.openxmlformats-officedocument.custom-properties+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.drawing+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.extended-properties+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.presentationml-template": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.presentation": { "source": "iana", "compressible": false, "extensions": ["pptx"] }, "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.slide": { "source": "iana", "extensions": ["sldx"] }, "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { "source": "iana", "extensions": ["ppsx"] }, "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.template": { "source": "apache", "extensions": ["potx"] }, "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml-template": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { "source": "iana", "compressible": false, "extensions": ["xlsx"] }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { "source": "apache", "extensions": ["xltx"] }, "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.theme+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.themeoverride+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.vmldrawing": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml-template": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { "source": "iana", "compressible": false, "extensions": ["docx"] }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { "source": "apache", "extensions": ["dotx"] }, "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { "source": "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { "source": "iana" }, "application/vnd.openxmlformats-package.core-properties+xml": { "source": "iana" }, "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { "source": "iana" }, "application/vnd.openxmlformats-package.relationships+xml": { "source": "iana" }, "application/vnd.oracle.resource+json": { "source": "iana", "compressible": true }, "application/vnd.orange.indata": { "source": "iana" }, "application/vnd.osa.netdeploy": { "source": "iana" }, "application/vnd.osgeo.mapguide.package": { "source": "iana", "extensions": ["mgp"] }, "application/vnd.osgi.bundle": { "source": "iana" }, "application/vnd.osgi.dp": { "source": "iana", "extensions": ["dp"] }, "application/vnd.osgi.subsystem": { "source": "iana", "extensions": ["esa"] }, "application/vnd.otps.ct-kip+xml": { "source": "iana" }, "application/vnd.oxli.countgraph": { "source": "iana" }, "application/vnd.pagerduty+json": { "source": "iana", "compressible": true }, "application/vnd.palm": { "source": "iana", "extensions": ["pdb","pqa","oprc"] }, "application/vnd.panoply": { "source": "iana" }, "application/vnd.paos+xml": { "source": "iana" }, "application/vnd.paos.xml": { "source": "apache" }, "application/vnd.pawaafile": { "source": "iana", "extensions": ["paw"] }, "application/vnd.pcos": { "source": "iana" }, "application/vnd.pg.format": { "source": "iana", "extensions": ["str"] }, "application/vnd.pg.osasli": { "source": "iana", "extensions": ["ei6"] }, "application/vnd.piaccess.application-licence": { "source": "iana" }, "application/vnd.picsel": { "source": "iana", "extensions": ["efif"] }, "application/vnd.pmi.widget": { "source": "iana", "extensions": ["wg"] }, "application/vnd.poc.group-advertisement+xml": { "source": "iana" }, "application/vnd.pocketlearn": { "source": "iana", "extensions": ["plf"] }, "application/vnd.powerbuilder6": { "source": "iana", "extensions": ["pbd"] }, "application/vnd.powerbuilder6-s": { "source": "iana" }, "application/vnd.powerbuilder7": { "source": "iana" }, "application/vnd.powerbuilder7-s": { "source": "iana" }, "application/vnd.powerbuilder75": { "source": "iana" }, "application/vnd.powerbuilder75-s": { "source": "iana" }, "application/vnd.preminet": { "source": "iana" }, "application/vnd.previewsystems.box": { "source": "iana", "extensions": ["box"] }, "application/vnd.proteus.magazine": { "source": "iana", "extensions": ["mgz"] }, "application/vnd.publishare-delta-tree": { "source": "iana", "extensions": ["qps"] }, "application/vnd.pvi.ptid1": { "source": "iana", "extensions": ["ptid"] }, "application/vnd.pwg-multiplexed": { "source": "iana" }, "application/vnd.pwg-xhtml-print+xml": { "source": "iana" }, "application/vnd.qualcomm.brew-app-res": { "source": "iana" }, "application/vnd.quark.quarkxpress": { "source": "iana", "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"] }, "application/vnd.quobject-quoxdocument": { "source": "iana" }, "application/vnd.radisys.moml+xml": { "source": "iana" }, "application/vnd.radisys.msml+xml": { "source": "iana" }, "application/vnd.radisys.msml-audit+xml": { "source": "iana" }, "application/vnd.radisys.msml-audit-conf+xml": { "source": "iana" }, "application/vnd.radisys.msml-audit-conn+xml": { "source": "iana" }, "application/vnd.radisys.msml-audit-dialog+xml": { "source": "iana" }, "application/vnd.radisys.msml-audit-stream+xml": { "source": "iana" }, "application/vnd.radisys.msml-conf+xml": { "source": "iana" }, "application/vnd.radisys.msml-dialog+xml": { "source": "iana" }, "application/vnd.radisys.msml-dialog-base+xml": { "source": "iana" }, "application/vnd.radisys.msml-dialog-fax-detect+xml": { "source": "iana" }, "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { "source": "iana" }, "application/vnd.radisys.msml-dialog-group+xml": { "source": "iana" }, "application/vnd.radisys.msml-dialog-speech+xml": { "source": "iana" }, "application/vnd.radisys.msml-dialog-transform+xml": { "source": "iana" }, "application/vnd.rainstor.data": { "source": "iana" }, "application/vnd.rapid": { "source": "iana" }, "application/vnd.realvnc.bed": { "source": "iana", "extensions": ["bed"] }, "application/vnd.recordare.musicxml": { "source": "iana", "extensions": ["mxl"] }, "application/vnd.recordare.musicxml+xml": { "source": "iana", "extensions": ["musicxml"] }, "application/vnd.renlearn.rlprint": { "source": "iana" }, "application/vnd.rig.cryptonote": { "source": "iana", "extensions": ["cryptonote"] }, "application/vnd.rim.cod": { "source": "apache", "extensions": ["cod"] }, "application/vnd.rn-realmedia": { "source": "apache", "extensions": ["rm"] }, "application/vnd.rn-realmedia-vbr": { "source": "apache", "extensions": ["rmvb"] }, "application/vnd.route66.link66+xml": { "source": "iana", "extensions": ["link66"] }, "application/vnd.rs-274x": { "source": "iana" }, "application/vnd.ruckus.download": { "source": "iana" }, "application/vnd.s3sms": { "source": "iana" }, "application/vnd.sailingtracker.track": { "source": "iana", "extensions": ["st"] }, "application/vnd.sbm.cid": { "source": "iana" }, "application/vnd.sbm.mid2": { "source": "iana" }, "application/vnd.scribus": { "source": "iana" }, "application/vnd.sealed.3df": { "source": "iana" }, "application/vnd.sealed.csf": { "source": "iana" }, "application/vnd.sealed.doc": { "source": "iana" }, "application/vnd.sealed.eml": { "source": "iana" }, "application/vnd.sealed.mht": { "source": "iana" }, "application/vnd.sealed.net": { "source": "iana" }, "application/vnd.sealed.ppt": { "source": "iana" }, "application/vnd.sealed.tiff": { "source": "iana" }, "application/vnd.sealed.xls": { "source": "iana" }, "application/vnd.sealedmedia.softseal.html": { "source": "iana" }, "application/vnd.sealedmedia.softseal.pdf": { "source": "iana" }, "application/vnd.seemail": { "source": "iana", "extensions": ["see"] }, "application/vnd.sema": { "source": "iana", "extensions": ["sema"] }, "application/vnd.semd": { "source": "iana", "extensions": ["semd"] }, "application/vnd.semf": { "source": "iana", "extensions": ["semf"] }, "application/vnd.shana.informed.formdata": { "source": "iana", "extensions": ["ifm"] }, "application/vnd.shana.informed.formtemplate": { "source": "iana", "extensions": ["itp"] }, "application/vnd.shana.informed.interchange": { "source": "iana", "extensions": ["iif"] }, "application/vnd.shana.informed.package": { "source": "iana", "extensions": ["ipk"] }, "application/vnd.simtech-mindmapper": { "source": "iana", "extensions": ["twd","twds"] }, "application/vnd.siren+json": { "source": "iana", "compressible": true }, "application/vnd.smaf": { "source": "iana", "extensions": ["mmf"] }, "application/vnd.smart.notebook": { "source": "iana" }, "application/vnd.smart.teacher": { "source": "iana", "extensions": ["teacher"] }, "application/vnd.software602.filler.form+xml": { "source": "iana" }, "application/vnd.software602.filler.form-xml-zip": { "source": "iana" }, "application/vnd.solent.sdkm+xml": { "source": "iana", "extensions": ["sdkm","sdkd"] }, "application/vnd.spotfire.dxp": { "source": "iana", "extensions": ["dxp"] }, "application/vnd.spotfire.sfs": { "source": "iana", "extensions": ["sfs"] }, "application/vnd.sss-cod": { "source": "iana" }, "application/vnd.sss-dtf": { "source": "iana" }, "application/vnd.sss-ntf": { "source": "iana" }, "application/vnd.stardivision.calc": { "source": "apache", "extensions": ["sdc"] }, "application/vnd.stardivision.draw": { "source": "apache", "extensions": ["sda"] }, "application/vnd.stardivision.impress": { "source": "apache", "extensions": ["sdd"] }, "application/vnd.stardivision.math": { "source": "apache", "extensions": ["smf"] }, "application/vnd.stardivision.writer": { "source": "apache", "extensions": ["sdw","vor"] }, "application/vnd.stardivision.writer-global": { "source": "apache", "extensions": ["sgl"] }, "application/vnd.stepmania.package": { "source": "iana", "extensions": ["smzip"] }, "application/vnd.stepmania.stepchart": { "source": "iana", "extensions": ["sm"] }, "application/vnd.street-stream": { "source": "iana" }, "application/vnd.sun.wadl+xml": { "source": "iana" }, "application/vnd.sun.xml.calc": { "source": "apache", "extensions": ["sxc"] }, "application/vnd.sun.xml.calc.template": { "source": "apache", "extensions": ["stc"] }, "application/vnd.sun.xml.draw": { "source": "apache", "extensions": ["sxd"] }, "application/vnd.sun.xml.draw.template": { "source": "apache", "extensions": ["std"] }, "application/vnd.sun.xml.impress": { "source": "apache", "extensions": ["sxi"] }, "application/vnd.sun.xml.impress.template": { "source": "apache", "extensions": ["sti"] }, "application/vnd.sun.xml.math": { "source": "apache", "extensions": ["sxm"] }, "application/vnd.sun.xml.writer": { "source": "apache", "extensions": ["sxw"] }, "application/vnd.sun.xml.writer.global": { "source": "apache", "extensions": ["sxg"] }, "application/vnd.sun.xml.writer.template": { "source": "apache", "extensions": ["stw"] }, "application/vnd.sus-calendar": { "source": "iana", "extensions": ["sus","susp"] }, "application/vnd.svd": { "source": "iana", "extensions": ["svd"] }, "application/vnd.swiftview-ics": { "source": "iana" }, "application/vnd.symbian.install": { "source": "apache", "extensions": ["sis","sisx"] }, "application/vnd.syncml+xml": { "source": "iana", "extensions": ["xsm"] }, "application/vnd.syncml.dm+wbxml": { "source": "iana", "extensions": ["bdm"] }, "application/vnd.syncml.dm+xml": { "source": "iana", "extensions": ["xdm"] }, "application/vnd.syncml.dm.notification": { "source": "iana" }, "application/vnd.syncml.dmddf+wbxml": { "source": "iana" }, "application/vnd.syncml.dmddf+xml": { "source": "iana" }, "application/vnd.syncml.dmtnds+wbxml": { "source": "iana" }, "application/vnd.syncml.dmtnds+xml": { "source": "iana" }, "application/vnd.syncml.ds.notification": { "source": "iana" }, "application/vnd.tao.intent-module-archive": { "source": "iana", "extensions": ["tao"] }, "application/vnd.tcpdump.pcap": { "source": "iana", "extensions": ["pcap","cap","dmp"] }, "application/vnd.tmd.mediaflex.api+xml": { "source": "iana" }, "application/vnd.tml": { "source": "iana" }, "application/vnd.tmobile-livetv": { "source": "iana", "extensions": ["tmo"] }, "application/vnd.trid.tpt": { "source": "iana", "extensions": ["tpt"] }, "application/vnd.triscape.mxs": { "source": "iana", "extensions": ["mxs"] }, "application/vnd.trueapp": { "source": "iana", "extensions": ["tra"] }, "application/vnd.truedoc": { "source": "iana" }, "application/vnd.ubisoft.webplayer": { "source": "iana" }, "application/vnd.ufdl": { "source": "iana", "extensions": ["ufd","ufdl"] }, "application/vnd.uiq.theme": { "source": "iana", "extensions": ["utz"] }, "application/vnd.umajin": { "source": "iana", "extensions": ["umj"] }, "application/vnd.unity": { "source": "iana", "extensions": ["unityweb"] }, "application/vnd.uoml+xml": { "source": "iana", "extensions": ["uoml"] }, "application/vnd.uplanet.alert": { "source": "iana" }, "application/vnd.uplanet.alert-wbxml": { "source": "iana" }, "application/vnd.uplanet.bearer-choice": { "source": "iana" }, "application/vnd.uplanet.bearer-choice-wbxml": { "source": "iana" }, "application/vnd.uplanet.cacheop": { "source": "iana" }, "application/vnd.uplanet.cacheop-wbxml": { "source": "iana" }, "application/vnd.uplanet.channel": { "source": "iana" }, "application/vnd.uplanet.channel-wbxml": { "source": "iana" }, "application/vnd.uplanet.list": { "source": "iana" }, "application/vnd.uplanet.list-wbxml": { "source": "iana" }, "application/vnd.uplanet.listcmd": { "source": "iana" }, "application/vnd.uplanet.listcmd-wbxml": { "source": "iana" }, "application/vnd.uplanet.signal": { "source": "iana" }, "application/vnd.uri-map": { "source": "iana" }, "application/vnd.valve.source.material": { "source": "iana" }, "application/vnd.vcx": { "source": "iana", "extensions": ["vcx"] }, "application/vnd.vd-study": { "source": "iana" }, "application/vnd.vectorworks": { "source": "iana" }, "application/vnd.vel+json": { "source": "iana", "compressible": true }, "application/vnd.verimatrix.vcas": { "source": "iana" }, "application/vnd.vidsoft.vidconference": { "source": "iana" }, "application/vnd.visio": { "source": "iana", "extensions": ["vsd","vst","vss","vsw"] }, "application/vnd.visionary": { "source": "iana", "extensions": ["vis"] }, "application/vnd.vividence.scriptfile": { "source": "iana" }, "application/vnd.vsf": { "source": "iana", "extensions": ["vsf"] }, "application/vnd.wap.sic": { "source": "iana" }, "application/vnd.wap.slc": { "source": "iana" }, "application/vnd.wap.wbxml": { "source": "iana", "extensions": ["wbxml"] }, "application/vnd.wap.wmlc": { "source": "iana", "extensions": ["wmlc"] }, "application/vnd.wap.wmlscriptc": { "source": "iana", "extensions": ["wmlsc"] }, "application/vnd.webturbo": { "source": "iana", "extensions": ["wtb"] }, "application/vnd.wfa.p2p": { "source": "iana" }, "application/vnd.wfa.wsc": { "source": "iana" }, "application/vnd.windows.devicepairing": { "source": "iana" }, "application/vnd.wmc": { "source": "iana" }, "application/vnd.wmf.bootstrap": { "source": "iana" }, "application/vnd.wolfram.mathematica": { "source": "iana" }, "application/vnd.wolfram.mathematica.package": { "source": "iana" }, "application/vnd.wolfram.player": { "source": "iana", "extensions": ["nbp"] }, "application/vnd.wordperfect": { "source": "iana", "extensions": ["wpd"] }, "application/vnd.wqd": { "source": "iana", "extensions": ["wqd"] }, "application/vnd.wrq-hp3000-labelled": { "source": "iana" }, "application/vnd.wt.stf": { "source": "iana", "extensions": ["stf"] }, "application/vnd.wv.csp+wbxml": { "source": "iana" }, "application/vnd.wv.csp+xml": { "source": "iana" }, "application/vnd.wv.ssp+xml": { "source": "iana" }, "application/vnd.xacml+json": { "source": "iana", "compressible": true }, "application/vnd.xara": { "source": "iana", "extensions": ["xar"] }, "application/vnd.xfdl": { "source": "iana", "extensions": ["xfdl"] }, "application/vnd.xfdl.webform": { "source": "iana" }, "application/vnd.xmi+xml": { "source": "iana" }, "application/vnd.xmpie.cpkg": { "source": "iana" }, "application/vnd.xmpie.dpkg": { "source": "iana" }, "application/vnd.xmpie.plan": { "source": "iana" }, "application/vnd.xmpie.ppkg": { "source": "iana" }, "application/vnd.xmpie.xlim": { "source": "iana" }, "application/vnd.yamaha.hv-dic": { "source": "iana", "extensions": ["hvd"] }, "application/vnd.yamaha.hv-script": { "source": "iana", "extensions": ["hvs"] }, "application/vnd.yamaha.hv-voice": { "source": "iana", "extensions": ["hvp"] }, "application/vnd.yamaha.openscoreformat": { "source": "iana", "extensions": ["osf"] }, "application/vnd.yamaha.openscoreformat.osfpvg+xml": { "source": "iana", "extensions": ["osfpvg"] }, "application/vnd.yamaha.remote-setup": { "source": "iana" }, "application/vnd.yamaha.smaf-audio": { "source": "iana", "extensions": ["saf"] }, "application/vnd.yamaha.smaf-phrase": { "source": "iana", "extensions": ["spf"] }, "application/vnd.yamaha.through-ngn": { "source": "iana" }, "application/vnd.yamaha.tunnel-udpencap": { "source": "iana" }, "application/vnd.yaoweme": { "source": "iana" }, "application/vnd.yellowriver-custom-menu": { "source": "iana", "extensions": ["cmp"] }, "application/vnd.zul": { "source": "iana", "extensions": ["zir","zirz"] }, "application/vnd.zzazz.deck+xml": { "source": "iana", "extensions": ["zaz"] }, "application/voicexml+xml": { "source": "iana", "extensions": ["vxml"] }, "application/vq-rtcpxr": { "source": "iana" }, "application/watcherinfo+xml": { "source": "iana" }, "application/whoispp-query": { "source": "iana" }, "application/whoispp-response": { "source": "iana" }, "application/widget": { "source": "iana", "extensions": ["wgt"] }, "application/winhlp": { "source": "apache", "extensions": ["hlp"] }, "application/wita": { "source": "iana" }, "application/wordperfect5.1": { "source": "iana" }, "application/wsdl+xml": { "source": "iana", "extensions": ["wsdl"] }, "application/wspolicy+xml": { "source": "iana", "extensions": ["wspolicy"] }, "application/x-7z-compressed": { "source": "apache", "compressible": false, "extensions": ["7z"] }, "application/x-abiword": { "source": "apache", "extensions": ["abw"] }, "application/x-ace-compressed": { "source": "apache", "extensions": ["ace"] }, "application/x-amf": { "source": "apache" }, "application/x-apple-diskimage": { "source": "apache", "extensions": ["dmg"] }, "application/x-authorware-bin": { "source": "apache", "extensions": ["aab","x32","u32","vox"] }, "application/x-authorware-map": { "source": "apache", "extensions": ["aam"] }, "application/x-authorware-seg": { "source": "apache", "extensions": ["aas"] }, "application/x-bcpio": { "source": "apache", "extensions": ["bcpio"] }, "application/x-bdoc": { "compressible": false, "extensions": ["bdoc"] }, "application/x-bittorrent": { "source": "apache", "extensions": ["torrent"] }, "application/x-blorb": { "source": "apache", "extensions": ["blb","blorb"] }, "application/x-bzip": { "source": "apache", "compressible": false, "extensions": ["bz"] }, "application/x-bzip2": { "source": "apache", "compressible": false, "extensions": ["bz2","boz"] }, "application/x-cbr": { "source": "apache", "extensions": ["cbr","cba","cbt","cbz","cb7"] }, "application/x-cdlink": { "source": "apache", "extensions": ["vcd"] }, "application/x-cfs-compressed": { "source": "apache", "extensions": ["cfs"] }, "application/x-chat": { "source": "apache", "extensions": ["chat"] }, "application/x-chess-pgn": { "source": "apache", "extensions": ["pgn"] }, "application/x-chrome-extension": { "extensions": ["crx"] }, "application/x-cocoa": { "source": "nginx", "extensions": ["cco"] }, "application/x-compress": { "source": "apache" }, "application/x-conference": { "source": "apache", "extensions": ["nsc"] }, "application/x-cpio": { "source": "apache", "extensions": ["cpio"] }, "application/x-csh": { "source": "apache", "extensions": ["csh"] }, "application/x-deb": { "compressible": false }, "application/x-debian-package": { "source": "apache", "extensions": ["deb","udeb"] }, "application/x-dgc-compressed": { "source": "apache", "extensions": ["dgc"] }, "application/x-director": { "source": "apache", "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"] }, "application/x-doom": { "source": "apache", "extensions": ["wad"] }, "application/x-dtbncx+xml": { "source": "apache", "extensions": ["ncx"] }, "application/x-dtbook+xml": { "source": "apache", "extensions": ["dtb"] }, "application/x-dtbresource+xml": { "source": "apache", "extensions": ["res"] }, "application/x-dvi": { "source": "apache", "compressible": false, "extensions": ["dvi"] }, "application/x-envoy": { "source": "apache", "extensions": ["evy"] }, "application/x-eva": { "source": "apache", "extensions": ["eva"] }, "application/x-font-bdf": { "source": "apache", "extensions": ["bdf"] }, "application/x-font-dos": { "source": "apache" }, "application/x-font-framemaker": { "source": "apache" }, "application/x-font-ghostscript": { "source": "apache", "extensions": ["gsf"] }, "application/x-font-libgrx": { "source": "apache" }, "application/x-font-linux-psf": { "source": "apache", "extensions": ["psf"] }, "application/x-font-otf": { "source": "apache", "compressible": true, "extensions": ["otf"] }, "application/x-font-pcf": { "source": "apache", "extensions": ["pcf"] }, "application/x-font-snf": { "source": "apache", "extensions": ["snf"] }, "application/x-font-speedo": { "source": "apache" }, "application/x-font-sunos-news": { "source": "apache" }, "application/x-font-ttf": { "source": "apache", "compressible": true, "extensions": ["ttf","ttc"] }, "application/x-font-type1": { "source": "apache", "extensions": ["pfa","pfb","pfm","afm"] }, "application/x-font-vfont": { "source": "apache" }, "application/x-freearc": { "source": "apache", "extensions": ["arc"] }, "application/x-futuresplash": { "source": "apache", "extensions": ["spl"] }, "application/x-gca-compressed": { "source": "apache", "extensions": ["gca"] }, "application/x-glulx": { "source": "apache", "extensions": ["ulx"] }, "application/x-gnumeric": { "source": "apache", "extensions": ["gnumeric"] }, "application/x-gramps-xml": { "source": "apache", "extensions": ["gramps"] }, "application/x-gtar": { "source": "apache", "extensions": ["gtar"] }, "application/x-gzip": { "source": "apache" }, "application/x-hdf": { "source": "apache", "extensions": ["hdf"] }, "application/x-httpd-php": { "compressible": true, "extensions": ["php"] }, "application/x-install-instructions": { "source": "apache", "extensions": ["install"] }, "application/x-iso9660-image": { "source": "apache", "extensions": ["iso"] }, "application/x-java-archive-diff": { "source": "nginx", "extensions": ["jardiff"] }, "application/x-java-jnlp-file": { "source": "apache", "compressible": false, "extensions": ["jnlp"] }, "application/x-javascript": { "compressible": true }, "application/x-latex": { "source": "apache", "compressible": false, "extensions": ["latex"] }, "application/x-lua-bytecode": { "extensions": ["luac"] }, "application/x-lzh-compressed": { "source": "apache", "extensions": ["lzh","lha"] }, "application/x-makeself": { "source": "nginx", "extensions": ["run"] }, "application/x-mie": { "source": "apache", "extensions": ["mie"] }, "application/x-mobipocket-ebook": { "source": "apache", "extensions": ["prc","mobi"] }, "application/x-mpegurl": { "compressible": false }, "application/x-ms-application": { "source": "apache", "extensions": ["application"] }, "application/x-ms-shortcut": { "source": "apache", "extensions": ["lnk"] }, "application/x-ms-wmd": { "source": "apache", "extensions": ["wmd"] }, "application/x-ms-wmz": { "source": "apache", "extensions": ["wmz"] }, "application/x-ms-xbap": { "source": "apache", "extensions": ["xbap"] }, "application/x-msaccess": { "source": "apache", "extensions": ["mdb"] }, "application/x-msbinder": { "source": "apache", "extensions": ["obd"] }, "application/x-mscardfile": { "source": "apache", "extensions": ["crd"] }, "application/x-msclip": { "source": "apache", "extensions": ["clp"] }, "application/x-msdos-program": { "extensions": ["exe"] }, "application/x-msdownload": { "source": "apache", "extensions": ["exe","dll","com","bat","msi"] }, "application/x-msmediaview": { "source": "apache", "extensions": ["mvb","m13","m14"] }, "application/x-msmetafile": { "source": "apache", "extensions": ["wmf","wmz","emf","emz"] }, "application/x-msmoney": { "source": "apache", "extensions": ["mny"] }, "application/x-mspublisher": { "source": "apache", "extensions": ["pub"] }, "application/x-msschedule": { "source": "apache", "extensions": ["scd"] }, "application/x-msterminal": { "source": "apache", "extensions": ["trm"] }, "application/x-mswrite": { "source": "apache", "extensions": ["wri"] }, "application/x-netcdf": { "source": "apache", "extensions": ["nc","cdf"] }, "application/x-ns-proxy-autoconfig": { "compressible": true, "extensions": ["pac"] }, "application/x-nzb": { "source": "apache", "extensions": ["nzb"] }, "application/x-perl": { "source": "nginx", "extensions": ["pl","pm"] }, "application/x-pilot": { "source": "nginx", "extensions": ["prc","pdb"] }, "application/x-pkcs12": { "source": "apache", "compressible": false, "extensions": ["p12","pfx"] }, "application/x-pkcs7-certificates": { "source": "apache", "extensions": ["p7b","spc"] }, "application/x-pkcs7-certreqresp": { "source": "apache", "extensions": ["p7r"] }, "application/x-rar-compressed": { "source": "apache", "compressible": false, "extensions": ["rar"] }, "application/x-redhat-package-manager": { "source": "nginx", "extensions": ["rpm"] }, "application/x-research-info-systems": { "source": "apache", "extensions": ["ris"] }, "application/x-sea": { "source": "nginx", "extensions": ["sea"] }, "application/x-sh": { "source": "apache", "compressible": true, "extensions": ["sh"] }, "application/x-shar": { "source": "apache", "extensions": ["shar"] }, "application/x-shockwave-flash": { "source": "apache", "compressible": false, "extensions": ["swf"] }, "application/x-silverlight-app": { "source": "apache", "extensions": ["xap"] }, "application/x-sql": { "source": "apache", "extensions": ["sql"] }, "application/x-stuffit": { "source": "apache", "compressible": false, "extensions": ["sit"] }, "application/x-stuffitx": { "source": "apache", "extensions": ["sitx"] }, "application/x-subrip": { "source": "apache", "extensions": ["srt"] }, "application/x-sv4cpio": { "source": "apache", "extensions": ["sv4cpio"] }, "application/x-sv4crc": { "source": "apache", "extensions": ["sv4crc"] }, "application/x-t3vm-image": { "source": "apache", "extensions": ["t3"] }, "application/x-tads": { "source": "apache", "extensions": ["gam"] }, "application/x-tar": { "source": "apache", "compressible": true, "extensions": ["tar"] }, "application/x-tcl": { "source": "apache", "extensions": ["tcl","tk"] }, "application/x-tex": { "source": "apache", "extensions": ["tex"] }, "application/x-tex-tfm": { "source": "apache", "extensions": ["tfm"] }, "application/x-texinfo": { "source": "apache", "extensions": ["texinfo","texi"] }, "application/x-tgif": { "source": "apache", "extensions": ["obj"] }, "application/x-ustar": { "source": "apache", "extensions": ["ustar"] }, "application/x-wais-source": { "source": "apache", "extensions": ["src"] }, "application/x-web-app-manifest+json": { "compressible": true, "extensions": ["webapp"] }, "application/x-www-form-urlencoded": { "source": "iana", "compressible": true }, "application/x-x509-ca-cert": { "source": "apache", "extensions": ["der","crt","pem"] }, "application/x-xfig": { "source": "apache", "extensions": ["fig"] }, "application/x-xliff+xml": { "source": "apache", "extensions": ["xlf"] }, "application/x-xpinstall": { "source": "apache", "compressible": false, "extensions": ["xpi"] }, "application/x-xz": { "source": "apache", "extensions": ["xz"] }, "application/x-zmachine": { "source": "apache", "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"] }, "application/x400-bp": { "source": "iana" }, "application/xacml+xml": { "source": "iana" }, "application/xaml+xml": { "source": "apache", "extensions": ["xaml"] }, "application/xcap-att+xml": { "source": "iana" }, "application/xcap-caps+xml": { "source": "iana" }, "application/xcap-diff+xml": { "source": "iana", "extensions": ["xdf"] }, "application/xcap-el+xml": { "source": "iana" }, "application/xcap-error+xml": { "source": "iana" }, "application/xcap-ns+xml": { "source": "iana" }, "application/xcon-conference-info+xml": { "source": "iana" }, "application/xcon-conference-info-diff+xml": { "source": "iana" }, "application/xenc+xml": { "source": "iana", "extensions": ["xenc"] }, "application/xhtml+xml": { "source": "iana", "compressible": true, "extensions": ["xhtml","xht"] }, "application/xhtml-voice+xml": { "source": "apache" }, "application/xml": { "source": "iana", "compressible": true, "extensions": ["xml","xsl","xsd","rng"] }, "application/xml-dtd": { "source": "iana", "compressible": true, "extensions": ["dtd"] }, "application/xml-external-parsed-entity": { "source": "iana" }, "application/xml-patch+xml": { "source": "iana" }, "application/xmpp+xml": { "source": "iana" }, "application/xop+xml": { "source": "iana", "compressible": true, "extensions": ["xop"] }, "application/xproc+xml": { "source": "apache", "extensions": ["xpl"] }, "application/xslt+xml": { "source": "iana", "extensions": ["xslt"] }, "application/xspf+xml": { "source": "apache", "extensions": ["xspf"] }, "application/xv+xml": { "source": "iana", "extensions": ["mxml","xhvml","xvml","xvm"] }, "application/yang": { "source": "iana", "extensions": ["yang"] }, "application/yin+xml": { "source": "iana", "extensions": ["yin"] }, "application/zip": { "source": "iana", "compressible": false, "extensions": ["zip"] }, "application/zlib": { "source": "iana" }, "audio/1d-interleaved-parityfec": { "source": "iana" }, "audio/32kadpcm": { "source": "iana" }, "audio/3gpp": { "source": "iana", "compressible": false, "extensions": ["3gpp"] }, "audio/3gpp2": { "source": "iana" }, "audio/ac3": { "source": "iana" }, "audio/adpcm": { "source": "apache", "extensions": ["adp"] }, "audio/amr": { "source": "iana" }, "audio/amr-wb": { "source": "iana" }, "audio/amr-wb+": { "source": "iana" }, "audio/aptx": { "source": "iana" }, "audio/asc": { "source": "iana" }, "audio/atrac-advanced-lossless": { "source": "iana" }, "audio/atrac-x": { "source": "iana" }, "audio/atrac3": { "source": "iana" }, "audio/basic": { "source": "iana", "compressible": false, "extensions": ["au","snd"] }, "audio/bv16": { "source": "iana" }, "audio/bv32": { "source": "iana" }, "audio/clearmode": { "source": "iana" }, "audio/cn": { "source": "iana" }, "audio/dat12": { "source": "iana" }, "audio/dls": { "source": "iana" }, "audio/dsr-es201108": { "source": "iana" }, "audio/dsr-es202050": { "source": "iana" }, "audio/dsr-es202211": { "source": "iana" }, "audio/dsr-es202212": { "source": "iana" }, "audio/dv": { "source": "iana" }, "audio/dvi4": { "source": "iana" }, "audio/eac3": { "source": "iana" }, "audio/encaprtp": { "source": "iana" }, "audio/evrc": { "source": "iana" }, "audio/evrc-qcp": { "source": "iana" }, "audio/evrc0": { "source": "iana" }, "audio/evrc1": { "source": "iana" }, "audio/evrcb": { "source": "iana" }, "audio/evrcb0": { "source": "iana" }, "audio/evrcb1": { "source": "iana" }, "audio/evrcnw": { "source": "iana" }, "audio/evrcnw0": { "source": "iana" }, "audio/evrcnw1": { "source": "iana" }, "audio/evrcwb": { "source": "iana" }, "audio/evrcwb0": { "source": "iana" }, "audio/evrcwb1": { "source": "iana" }, "audio/evs": { "source": "iana" }, "audio/fwdred": { "source": "iana" }, "audio/g711-0": { "source": "iana" }, "audio/g719": { "source": "iana" }, "audio/g722": { "source": "iana" }, "audio/g7221": { "source": "iana" }, "audio/g723": { "source": "iana" }, "audio/g726-16": { "source": "iana" }, "audio/g726-24": { "source": "iana" }, "audio/g726-32": { "source": "iana" }, "audio/g726-40": { "source": "iana" }, "audio/g728": { "source": "iana" }, "audio/g729": { "source": "iana" }, "audio/g7291": { "source": "iana" }, "audio/g729d": { "source": "iana" }, "audio/g729e": { "source": "iana" }, "audio/gsm": { "source": "iana" }, "audio/gsm-efr": { "source": "iana" }, "audio/gsm-hr-08": { "source": "iana" }, "audio/ilbc": { "source": "iana" }, "audio/ip-mr_v2.5": { "source": "iana" }, "audio/isac": { "source": "apache" }, "audio/l16": { "source": "iana" }, "audio/l20": { "source": "iana" }, "audio/l24": { "source": "iana", "compressible": false }, "audio/l8": { "source": "iana" }, "audio/lpc": { "source": "iana" }, "audio/midi": { "source": "apache", "extensions": ["mid","midi","kar","rmi"] }, "audio/mobile-xmf": { "source": "iana" }, "audio/mp4": { "source": "iana", "compressible": false, "extensions": ["m4a","mp4a"] }, "audio/mp4a-latm": { "source": "iana" }, "audio/mpa": { "source": "iana" }, "audio/mpa-robust": { "source": "iana" }, "audio/mpeg": { "source": "iana", "compressible": false, "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"] }, "audio/mpeg4-generic": { "source": "iana" }, "audio/musepack": { "source": "apache" }, "audio/ogg": { "source": "iana", "compressible": false, "extensions": ["oga","ogg","spx"] }, "audio/opus": { "source": "iana" }, "audio/parityfec": { "source": "iana" }, "audio/pcma": { "source": "iana" }, "audio/pcma-wb": { "source": "iana" }, "audio/pcmu": { "source": "iana" }, "audio/pcmu-wb": { "source": "iana" }, "audio/prs.sid": { "source": "iana" }, "audio/qcelp": { "source": "iana" }, "audio/raptorfec": { "source": "iana" }, "audio/red": { "source": "iana" }, "audio/rtp-enc-aescm128": { "source": "iana" }, "audio/rtp-midi": { "source": "iana" }, "audio/rtploopback": { "source": "iana" }, "audio/rtx": { "source": "iana" }, "audio/s3m": { "source": "apache", "extensions": ["s3m"] }, "audio/silk": { "source": "apache", "extensions": ["sil"] }, "audio/smv": { "source": "iana" }, "audio/smv-qcp": { "source": "iana" }, "audio/smv0": { "source": "iana" }, "audio/sp-midi": { "source": "iana" }, "audio/speex": { "source": "iana" }, "audio/t140c": { "source": "iana" }, "audio/t38": { "source": "iana" }, "audio/telephone-event": { "source": "iana" }, "audio/tone": { "source": "iana" }, "audio/uemclip": { "source": "iana" }, "audio/ulpfec": { "source": "iana" }, "audio/vdvi": { "source": "iana" }, "audio/vmr-wb": { "source": "iana" }, "audio/vnd.3gpp.iufp": { "source": "iana" }, "audio/vnd.4sb": { "source": "iana" }, "audio/vnd.audiokoz": { "source": "iana" }, "audio/vnd.celp": { "source": "iana" }, "audio/vnd.cisco.nse": { "source": "iana" }, "audio/vnd.cmles.radio-events": { "source": "iana" }, "audio/vnd.cns.anp1": { "source": "iana" }, "audio/vnd.cns.inf1": { "source": "iana" }, "audio/vnd.dece.audio": { "source": "iana", "extensions": ["uva","uvva"] }, "audio/vnd.digital-winds": { "source": "iana", "extensions": ["eol"] }, "audio/vnd.dlna.adts": { "source": "iana" }, "audio/vnd.dolby.heaac.1": { "source": "iana" }, "audio/vnd.dolby.heaac.2": { "source": "iana" }, "audio/vnd.dolby.mlp": { "source": "iana" }, "audio/vnd.dolby.mps": { "source": "iana" }, "audio/vnd.dolby.pl2": { "source": "iana" }, "audio/vnd.dolby.pl2x": { "source": "iana" }, "audio/vnd.dolby.pl2z": { "source": "iana" }, "audio/vnd.dolby.pulse.1": { "source": "iana" }, "audio/vnd.dra": { "source": "iana", "extensions": ["dra"] }, "audio/vnd.dts": { "source": "iana", "extensions": ["dts"] }, "audio/vnd.dts.hd": { "source": "iana", "extensions": ["dtshd"] }, "audio/vnd.dvb.file": { "source": "iana" }, "audio/vnd.everad.plj": { "source": "iana" }, "audio/vnd.hns.audio": { "source": "iana" }, "audio/vnd.lucent.voice": { "source": "iana", "extensions": ["lvp"] }, "audio/vnd.ms-playready.media.pya": { "source": "iana", "extensions": ["pya"] }, "audio/vnd.nokia.mobile-xmf": { "source": "iana" }, "audio/vnd.nortel.vbk": { "source": "iana" }, "audio/vnd.nuera.ecelp4800": { "source": "iana", "extensions": ["ecelp4800"] }, "audio/vnd.nuera.ecelp7470": { "source": "iana", "extensions": ["ecelp7470"] }, "audio/vnd.nuera.ecelp9600": { "source": "iana", "extensions": ["ecelp9600"] }, "audio/vnd.octel.sbc": { "source": "iana" }, "audio/vnd.qcelp": { "source": "iana" }, "audio/vnd.rhetorex.32kadpcm": { "source": "iana" }, "audio/vnd.rip": { "source": "iana", "extensions": ["rip"] }, "audio/vnd.rn-realaudio": { "compressible": false }, "audio/vnd.sealedmedia.softseal.mpeg": { "source": "iana" }, "audio/vnd.vmx.cvsd": { "source": "iana" }, "audio/vnd.wave": { "compressible": false }, "audio/vorbis": { "source": "iana", "compressible": false }, "audio/vorbis-config": { "source": "iana" }, "audio/wav": { "compressible": false, "extensions": ["wav"] }, "audio/wave": { "compressible": false, "extensions": ["wav"] }, "audio/webm": { "source": "apache", "compressible": false, "extensions": ["weba"] }, "audio/x-aac": { "source": "apache", "compressible": false, "extensions": ["aac"] }, "audio/x-aiff": { "source": "apache", "extensions": ["aif","aiff","aifc"] }, "audio/x-caf": { "source": "apache", "compressible": false, "extensions": ["caf"] }, "audio/x-flac": { "source": "apache", "extensions": ["flac"] }, "audio/x-m4a": { "source": "nginx", "extensions": ["m4a"] }, "audio/x-matroska": { "source": "apache", "extensions": ["mka"] }, "audio/x-mpegurl": { "source": "apache", "extensions": ["m3u"] }, "audio/x-ms-wax": { "source": "apache", "extensions": ["wax"] }, "audio/x-ms-wma": { "source": "apache", "extensions": ["wma"] }, "audio/x-pn-realaudio": { "source": "apache", "extensions": ["ram","ra"] }, "audio/x-pn-realaudio-plugin": { "source": "apache", "extensions": ["rmp"] }, "audio/x-realaudio": { "source": "nginx", "extensions": ["ra"] }, "audio/x-tta": { "source": "apache" }, "audio/x-wav": { "source": "apache", "extensions": ["wav"] }, "audio/xm": { "source": "apache", "extensions": ["xm"] }, "chemical/x-cdx": { "source": "apache", "extensions": ["cdx"] }, "chemical/x-cif": { "source": "apache", "extensions": ["cif"] }, "chemical/x-cmdf": { "source": "apache", "extensions": ["cmdf"] }, "chemical/x-cml": { "source": "apache", "extensions": ["cml"] }, "chemical/x-csml": { "source": "apache", "extensions": ["csml"] }, "chemical/x-pdb": { "source": "apache" }, "chemical/x-xyz": { "source": "apache", "extensions": ["xyz"] }, "font/opentype": { "compressible": true, "extensions": ["otf"] }, "image/bmp": { "source": "apache", "compressible": true, "extensions": ["bmp"] }, "image/cgm": { "source": "iana", "extensions": ["cgm"] }, "image/fits": { "source": "iana" }, "image/g3fax": { "source": "iana", "extensions": ["g3"] }, "image/gif": { "source": "iana", "compressible": false, "extensions": ["gif"] }, "image/ief": { "source": "iana", "extensions": ["ief"] }, "image/jp2": { "source": "iana" }, "image/jpeg": { "source": "iana", "compressible": false, "extensions": ["jpeg","jpg","jpe"] }, "image/jpm": { "source": "iana" }, "image/jpx": { "source": "iana" }, "image/ktx": { "source": "iana", "extensions": ["ktx"] }, "image/naplps": { "source": "iana" }, "image/pjpeg": { "compressible": false }, "image/png": { "source": "iana", "compressible": false, "extensions": ["png"] }, "image/prs.btif": { "source": "iana", "extensions": ["btif"] }, "image/prs.pti": { "source": "iana" }, "image/pwg-raster": { "source": "iana" }, "image/sgi": { "source": "apache", "extensions": ["sgi"] }, "image/svg+xml": { "source": "iana", "compressible": true, "extensions": ["svg","svgz"] }, "image/t38": { "source": "iana" }, "image/tiff": { "source": "iana", "compressible": false, "extensions": ["tiff","tif"] }, "image/tiff-fx": { "source": "iana" }, "image/vnd.adobe.photoshop": { "source": "iana", "compressible": true, "extensions": ["psd"] }, "image/vnd.airzip.accelerator.azv": { "source": "iana" }, "image/vnd.cns.inf2": { "source": "iana" }, "image/vnd.dece.graphic": { "source": "iana", "extensions": ["uvi","uvvi","uvg","uvvg"] }, "image/vnd.djvu": { "source": "iana", "extensions": ["djvu","djv"] }, "image/vnd.dvb.subtitle": { "source": "iana", "extensions": ["sub"] }, "image/vnd.dwg": { "source": "iana", "extensions": ["dwg"] }, "image/vnd.dxf": { "source": "iana", "extensions": ["dxf"] }, "image/vnd.fastbidsheet": { "source": "iana", "extensions": ["fbs"] }, "image/vnd.fpx": { "source": "iana", "extensions": ["fpx"] }, "image/vnd.fst": { "source": "iana", "extensions": ["fst"] }, "image/vnd.fujixerox.edmics-mmr": { "source": "iana", "extensions": ["mmr"] }, "image/vnd.fujixerox.edmics-rlc": { "source": "iana", "extensions": ["rlc"] }, "image/vnd.globalgraphics.pgb": { "source": "iana" }, "image/vnd.microsoft.icon": { "source": "iana" }, "image/vnd.mix": { "source": "iana" }, "image/vnd.mozilla.apng": { "source": "iana" }, "image/vnd.ms-modi": { "source": "iana", "extensions": ["mdi"] }, "image/vnd.ms-photo": { "source": "apache", "extensions": ["wdp"] }, "image/vnd.net-fpx": { "source": "iana", "extensions": ["npx"] }, "image/vnd.radiance": { "source": "iana" }, "image/vnd.sealed.png": { "source": "iana" }, "image/vnd.sealedmedia.softseal.gif": { "source": "iana" }, "image/vnd.sealedmedia.softseal.jpg": { "source": "iana" }, "image/vnd.svf": { "source": "iana" }, "image/vnd.tencent.tap": { "source": "iana" }, "image/vnd.valve.source.texture": { "source": "iana" }, "image/vnd.wap.wbmp": { "source": "iana", "extensions": ["wbmp"] }, "image/vnd.xiff": { "source": "iana", "extensions": ["xif"] }, "image/vnd.zbrush.pcx": { "source": "iana" }, "image/webp": { "source": "apache", "extensions": ["webp"] }, "image/x-3ds": { "source": "apache", "extensions": ["3ds"] }, "image/x-cmu-raster": { "source": "apache", "extensions": ["ras"] }, "image/x-cmx": { "source": "apache", "extensions": ["cmx"] }, "image/x-freehand": { "source": "apache", "extensions": ["fh","fhc","fh4","fh5","fh7"] }, "image/x-icon": { "source": "apache", "compressible": true, "extensions": ["ico"] }, "image/x-jng": { "source": "nginx", "extensions": ["jng"] }, "image/x-mrsid-image": { "source": "apache", "extensions": ["sid"] }, "image/x-ms-bmp": { "source": "nginx", "compressible": true, "extensions": ["bmp"] }, "image/x-pcx": { "source": "apache", "extensions": ["pcx"] }, "image/x-pict": { "source": "apache", "extensions": ["pic","pct"] }, "image/x-portable-anymap": { "source": "apache", "extensions": ["pnm"] }, "image/x-portable-bitmap": { "source": "apache", "extensions": ["pbm"] }, "image/x-portable-graymap": { "source": "apache", "extensions": ["pgm"] }, "image/x-portable-pixmap": { "source": "apache", "extensions": ["ppm"] }, "image/x-rgb": { "source": "apache", "extensions": ["rgb"] }, "image/x-tga": { "source": "apache", "extensions": ["tga"] }, "image/x-xbitmap": { "source": "apache", "extensions": ["xbm"] }, "image/x-xcf": { "compressible": false }, "image/x-xpixmap": { "source": "apache", "extensions": ["xpm"] }, "image/x-xwindowdump": { "source": "apache", "extensions": ["xwd"] }, "message/cpim": { "source": "iana" }, "message/delivery-status": { "source": "iana" }, "message/disposition-notification": { "source": "iana" }, "message/external-body": { "source": "iana" }, "message/feedback-report": { "source": "iana" }, "message/global": { "source": "iana" }, "message/global-delivery-status": { "source": "iana" }, "message/global-disposition-notification": { "source": "iana" }, "message/global-headers": { "source": "iana" }, "message/http": { "source": "iana", "compressible": false }, "message/imdn+xml": { "source": "iana", "compressible": true }, "message/news": { "source": "iana" }, "message/partial": { "source": "iana", "compressible": false }, "message/rfc822": { "source": "iana", "compressible": true, "extensions": ["eml","mime"] }, "message/s-http": { "source": "iana" }, "message/sip": { "source": "iana" }, "message/sipfrag": { "source": "iana" }, "message/tracking-status": { "source": "iana" }, "message/vnd.si.simp": { "source": "iana" }, "message/vnd.wfa.wsc": { "source": "iana" }, "model/iges": { "source": "iana", "compressible": false, "extensions": ["igs","iges"] }, "model/mesh": { "source": "iana", "compressible": false, "extensions": ["msh","mesh","silo"] }, "model/vnd.collada+xml": { "source": "iana", "extensions": ["dae"] }, "model/vnd.dwf": { "source": "iana", "extensions": ["dwf"] }, "model/vnd.flatland.3dml": { "source": "iana" }, "model/vnd.gdl": { "source": "iana", "extensions": ["gdl"] }, "model/vnd.gs-gdl": { "source": "apache" }, "model/vnd.gs.gdl": { "source": "iana" }, "model/vnd.gtw": { "source": "iana", "extensions": ["gtw"] }, "model/vnd.moml+xml": { "source": "iana" }, "model/vnd.mts": { "source": "iana", "extensions": ["mts"] }, "model/vnd.opengex": { "source": "iana" }, "model/vnd.parasolid.transmit.binary": { "source": "iana" }, "model/vnd.parasolid.transmit.text": { "source": "iana" }, "model/vnd.rosette.annotated-data-model": { "source": "iana" }, "model/vnd.valve.source.compiled-map": { "source": "iana" }, "model/vnd.vtu": { "source": "iana", "extensions": ["vtu"] }, "model/vrml": { "source": "iana", "compressible": false, "extensions": ["wrl","vrml"] }, "model/x3d+binary": { "source": "apache", "compressible": false, "extensions": ["x3db","x3dbz"] }, "model/x3d+fastinfoset": { "source": "iana" }, "model/x3d+vrml": { "source": "apache", "compressible": false, "extensions": ["x3dv","x3dvz"] }, "model/x3d+xml": { "source": "iana", "compressible": true, "extensions": ["x3d","x3dz"] }, "model/x3d-vrml": { "source": "iana" }, "multipart/alternative": { "source": "iana", "compressible": false }, "multipart/appledouble": { "source": "iana" }, "multipart/byteranges": { "source": "iana" }, "multipart/digest": { "source": "iana" }, "multipart/encrypted": { "source": "iana", "compressible": false }, "multipart/form-data": { "source": "iana", "compressible": false }, "multipart/header-set": { "source": "iana" }, "multipart/mixed": { "source": "iana", "compressible": false }, "multipart/parallel": { "source": "iana" }, "multipart/related": { "source": "iana", "compressible": false }, "multipart/report": { "source": "iana" }, "multipart/signed": { "source": "iana", "compressible": false }, "multipart/voice-message": { "source": "iana" }, "multipart/x-mixed-replace": { "source": "iana" }, "text/1d-interleaved-parityfec": { "source": "iana" }, "text/cache-manifest": { "source": "iana", "compressible": true, "extensions": ["appcache","manifest"] }, "text/calendar": { "source": "iana", "extensions": ["ics","ifb"] }, "text/calender": { "compressible": true }, "text/cmd": { "compressible": true }, "text/coffeescript": { "extensions": ["coffee","litcoffee"] }, "text/css": { "source": "iana", "compressible": true, "extensions": ["css"] }, "text/csv": { "source": "iana", "compressible": true, "extensions": ["csv"] }, "text/csv-schema": { "source": "iana" }, "text/directory": { "source": "iana" }, "text/dns": { "source": "iana" }, "text/ecmascript": { "source": "iana" }, "text/encaprtp": { "source": "iana" }, "text/enriched": { "source": "iana" }, "text/fwdred": { "source": "iana" }, "text/grammar-ref-list": { "source": "iana" }, "text/hjson": { "extensions": ["hjson"] }, "text/html": { "source": "iana", "compressible": true, "extensions": ["html","htm","shtml"] }, "text/jade": { "extensions": ["jade"] }, "text/javascript": { "source": "iana", "compressible": true }, "text/jcr-cnd": { "source": "iana" }, "text/jsx": { "compressible": true, "extensions": ["jsx"] }, "text/less": { "extensions": ["less"] }, "text/markdown": { "source": "iana" }, "text/mathml": { "source": "nginx", "extensions": ["mml"] }, "text/mizar": { "source": "iana" }, "text/n3": { "source": "iana", "compressible": true, "extensions": ["n3"] }, "text/parameters": { "source": "iana" }, "text/parityfec": { "source": "iana" }, "text/plain": { "source": "iana", "compressible": true, "extensions": ["txt","text","conf","def","list","log","in","ini"] }, "text/provenance-notation": { "source": "iana" }, "text/prs.fallenstein.rst": { "source": "iana" }, "text/prs.lines.tag": { "source": "iana", "extensions": ["dsc"] }, "text/prs.prop.logic": { "source": "iana" }, "text/raptorfec": { "source": "iana" }, "text/red": { "source": "iana" }, "text/rfc822-headers": { "source": "iana" }, "text/richtext": { "source": "iana", "compressible": true, "extensions": ["rtx"] }, "text/rtf": { "source": "iana", "compressible": true, "extensions": ["rtf"] }, "text/rtp-enc-aescm128": { "source": "iana" }, "text/rtploopback": { "source": "iana" }, "text/rtx": { "source": "iana" }, "text/sgml": { "source": "iana", "extensions": ["sgml","sgm"] }, "text/slim": { "extensions": ["slim","slm"] }, "text/stylus": { "extensions": ["stylus","styl"] }, "text/t140": { "source": "iana" }, "text/tab-separated-values": { "source": "iana", "compressible": true, "extensions": ["tsv"] }, "text/troff": { "source": "iana", "extensions": ["t","tr","roff","man","me","ms"] }, "text/turtle": { "source": "iana", "extensions": ["ttl"] }, "text/ulpfec": { "source": "iana" }, "text/uri-list": { "source": "iana", "compressible": true, "extensions": ["uri","uris","urls"] }, "text/vcard": { "source": "iana", "compressible": true, "extensions": ["vcard"] }, "text/vnd.a": { "source": "iana" }, "text/vnd.abc": { "source": "iana" }, "text/vnd.curl": { "source": "iana", "extensions": ["curl"] }, "text/vnd.curl.dcurl": { "source": "apache", "extensions": ["dcurl"] }, "text/vnd.curl.mcurl": { "source": "apache", "extensions": ["mcurl"] }, "text/vnd.curl.scurl": { "source": "apache", "extensions": ["scurl"] }, "text/vnd.debian.copyright": { "source": "iana" }, "text/vnd.dmclientscript": { "source": "iana" }, "text/vnd.dvb.subtitle": { "source": "iana", "extensions": ["sub"] }, "text/vnd.esmertec.theme-descriptor": { "source": "iana" }, "text/vnd.fly": { "source": "iana", "extensions": ["fly"] }, "text/vnd.fmi.flexstor": { "source": "iana", "extensions": ["flx"] }, "text/vnd.graphviz": { "source": "iana", "extensions": ["gv"] }, "text/vnd.in3d.3dml": { "source": "iana", "extensions": ["3dml"] }, "text/vnd.in3d.spot": { "source": "iana", "extensions": ["spot"] }, "text/vnd.iptc.newsml": { "source": "iana" }, "text/vnd.iptc.nitf": { "source": "iana" }, "text/vnd.latex-z": { "source": "iana" }, "text/vnd.motorola.reflex": { "source": "iana" }, "text/vnd.ms-mediapackage": { "source": "iana" }, "text/vnd.net2phone.commcenter.command": { "source": "iana" }, "text/vnd.radisys.msml-basic-layout": { "source": "iana" }, "text/vnd.si.uricatalogue": { "source": "iana" }, "text/vnd.sun.j2me.app-descriptor": { "source": "iana", "extensions": ["jad"] }, "text/vnd.trolltech.linguist": { "source": "iana" }, "text/vnd.wap.si": { "source": "iana" }, "text/vnd.wap.sl": { "source": "iana" }, "text/vnd.wap.wml": { "source": "iana", "extensions": ["wml"] }, "text/vnd.wap.wmlscript": { "source": "iana", "extensions": ["wmls"] }, "text/vtt": { "charset": "UTF-8", "compressible": true, "extensions": ["vtt"] }, "text/x-asm": { "source": "apache", "extensions": ["s","asm"] }, "text/x-c": { "source": "apache", "extensions": ["c","cc","cxx","cpp","h","hh","dic"] }, "text/x-component": { "source": "nginx", "extensions": ["htc"] }, "text/x-fortran": { "source": "apache", "extensions": ["f","for","f77","f90"] }, "text/x-gwt-rpc": { "compressible": true }, "text/x-handlebars-template": { "extensions": ["hbs"] }, "text/x-java-source": { "source": "apache", "extensions": ["java"] }, "text/x-jquery-tmpl": { "compressible": true }, "text/x-lua": { "extensions": ["lua"] }, "text/x-markdown": { "compressible": true, "extensions": ["markdown","md","mkd"] }, "text/x-nfo": { "source": "apache", "extensions": ["nfo"] }, "text/x-opml": { "source": "apache", "extensions": ["opml"] }, "text/x-pascal": { "source": "apache", "extensions": ["p","pas"] }, "text/x-processing": { "compressible": true, "extensions": ["pde"] }, "text/x-sass": { "extensions": ["sass"] }, "text/x-scss": { "extensions": ["scss"] }, "text/x-setext": { "source": "apache", "extensions": ["etx"] }, "text/x-sfv": { "source": "apache", "extensions": ["sfv"] }, "text/x-suse-ymp": { "compressible": true, "extensions": ["ymp"] }, "text/x-uuencode": { "source": "apache", "extensions": ["uu"] }, "text/x-vcalendar": { "source": "apache", "extensions": ["vcs"] }, "text/x-vcard": { "source": "apache", "extensions": ["vcf"] }, "text/xml": { "source": "iana", "compressible": true, "extensions": ["xml"] }, "text/xml-external-parsed-entity": { "source": "iana" }, "text/yaml": { "extensions": ["yaml","yml"] }, "video/1d-interleaved-parityfec": { "source": "apache" }, "video/3gpp": { "source": "apache", "extensions": ["3gp","3gpp"] }, "video/3gpp-tt": { "source": "apache" }, "video/3gpp2": { "source": "apache", "extensions": ["3g2"] }, "video/bmpeg": { "source": "apache" }, "video/bt656": { "source": "apache" }, "video/celb": { "source": "apache" }, "video/dv": { "source": "apache" }, "video/encaprtp": { "source": "apache" }, "video/h261": { "source": "apache", "extensions": ["h261"] }, "video/h263": { "source": "apache", "extensions": ["h263"] }, "video/h263-1998": { "source": "apache" }, "video/h263-2000": { "source": "apache" }, "video/h264": { "source": "apache", "extensions": ["h264"] }, "video/h264-rcdo": { "source": "apache" }, "video/h264-svc": { "source": "apache" }, "video/h265": { "source": "apache" }, "video/iso.segment": { "source": "apache" }, "video/jpeg": { "source": "apache", "extensions": ["jpgv"] }, "video/jpeg2000": { "source": "apache" }, "video/jpm": { "source": "apache", "extensions": ["jpm","jpgm"] }, "video/mj2": { "source": "apache", "extensions": ["mj2","mjp2"] }, "video/mp1s": { "source": "apache" }, "video/mp2p": { "source": "apache" }, "video/mp2t": { "source": "apache", "extensions": ["ts"] }, "video/mp4": { "source": "apache", "compressible": false, "extensions": ["mp4","mp4v","mpg4"] }, "video/mp4v-es": { "source": "apache" }, "video/mpeg": { "source": "apache", "compressible": false, "extensions": ["mpeg","mpg","mpe","m1v","m2v"] }, "video/mpeg4-generic": { "source": "apache" }, "video/mpv": { "source": "apache" }, "video/nv": { "source": "apache" }, "video/ogg": { "source": "apache", "compressible": false, "extensions": ["ogv"] }, "video/parityfec": { "source": "apache" }, "video/pointer": { "source": "apache" }, "video/quicktime": { "source": "apache", "compressible": false, "extensions": ["qt","mov"] }, "video/raptorfec": { "source": "apache" }, "video/raw": { "source": "apache" }, "video/rtp-enc-aescm128": { "source": "apache" }, "video/rtploopback": { "source": "apache" }, "video/rtx": { "source": "apache" }, "video/smpte292m": { "source": "apache" }, "video/ulpfec": { "source": "apache" }, "video/vc1": { "source": "apache" }, "video/vnd.cctv": { "source": "apache" }, "video/vnd.dece.hd": { "source": "apache", "extensions": ["uvh","uvvh"] }, "video/vnd.dece.mobile": { "source": "apache", "extensions": ["uvm","uvvm"] }, "video/vnd.dece.mp4": { "source": "apache" }, "video/vnd.dece.pd": { "source": "apache", "extensions": ["uvp","uvvp"] }, "video/vnd.dece.sd": { "source": "apache", "extensions": ["uvs","uvvs"] }, "video/vnd.dece.video": { "source": "apache", "extensions": ["uvv","uvvv"] }, "video/vnd.directv.mpeg": { "source": "apache" }, "video/vnd.directv.mpeg-tts": { "source": "apache" }, "video/vnd.dlna.mpeg-tts": { "source": "apache" }, "video/vnd.dvb.file": { "source": "apache", "extensions": ["dvb"] }, "video/vnd.fvt": { "source": "apache", "extensions": ["fvt"] }, "video/vnd.hns.video": { "source": "apache" }, "video/vnd.iptvforum.1dparityfec-1010": { "source": "apache" }, "video/vnd.iptvforum.1dparityfec-2005": { "source": "apache" }, "video/vnd.iptvforum.2dparityfec-1010": { "source": "apache" }, "video/vnd.iptvforum.2dparityfec-2005": { "source": "apache" }, "video/vnd.iptvforum.ttsavc": { "source": "apache" }, "video/vnd.iptvforum.ttsmpeg2": { "source": "apache" }, "video/vnd.motorola.video": { "source": "apache" }, "video/vnd.motorola.videop": { "source": "apache" }, "video/vnd.mpegurl": { "source": "apache", "extensions": ["mxu","m4u"] }, "video/vnd.ms-playready.media.pyv": { "source": "apache", "extensions": ["pyv"] }, "video/vnd.nokia.interleaved-multimedia": { "source": "apache" }, "video/vnd.nokia.videovoip": { "source": "apache" }, "video/vnd.objectvideo": { "source": "apache" }, "video/vnd.radgamettools.bink": { "source": "apache" }, "video/vnd.radgamettools.smacker": { "source": "apache" }, "video/vnd.sealed.mpeg1": { "source": "apache" }, "video/vnd.sealed.mpeg4": { "source": "apache" }, "video/vnd.sealed.swf": { "source": "apache" }, "video/vnd.sealedmedia.softseal.mov": { "source": "apache" }, "video/vnd.uvvu.mp4": { "source": "apache", "extensions": ["uvu","uvvu"] }, "video/vnd.vivo": { "source": "apache", "extensions": ["viv"] }, "video/vp8": { "source": "apache" }, "video/webm": { "source": "apache", "compressible": false, "extensions": ["webm"] }, "video/x-f4v": { "source": "apache", "extensions": ["f4v"] }, "video/x-fli": { "source": "apache", "extensions": ["fli"] }, "video/x-flv": { "source": "apache", "compressible": false, "extensions": ["flv"] }, "video/x-m4v": { "source": "apache", "extensions": ["m4v"] }, "video/x-matroska": { "source": "apache", "compressible": false, "extensions": ["mkv","mk3d","mks"] }, "video/x-mng": { "source": "apache", "extensions": ["mng"] }, "video/x-ms-asf": { "source": "apache", "extensions": ["asf","asx"] }, "video/x-ms-vob": { "source": "apache", "extensions": ["vob"] }, "video/x-ms-wm": { "source": "apache", "extensions": ["wm"] }, "video/x-ms-wmv": { "source": "apache", "compressible": false, "extensions": ["wmv"] }, "video/x-ms-wmx": { "source": "apache", "extensions": ["wmx"] }, "video/x-ms-wvx": { "source": "apache", "extensions": ["wvx"] }, "video/x-msvideo": { "source": "apache", "extensions": ["avi"] }, "video/x-sgi-movie": { "source": "apache", "extensions": ["movie"] }, "video/x-smv": { "source": "apache", "extensions": ["smv"] }, "x-conference/x-cooltalk": { "source": "apache", "extensions": ["ice"] }, "x-shader/x-fragment": { "compressible": true }, "x-shader/x-vertex": { "compressible": true } } },{}],236:[function(require,module,exports){ /*! * mime-db * Copyright(c) 2014 Jonathan Ong * MIT Licensed */ /** * Module exports. */ module.exports = require('./db.json') },{"./db.json":235}],237:[function(require,module,exports){ /*! * mime-types * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict' /** * Module dependencies. * @private */ var db = require('mime-db') var extname = require('path').extname /** * Module variables. * @private */ var extractTypeRegExp = /^\s*([^;\s]*)(?:;|\s|$)/ var textTypeRegExp = /^text\//i /** * Module exports. * @public */ exports.charset = charset exports.charsets = { lookup: charset } exports.contentType = contentType exports.extension = extension exports.extensions = Object.create(null) exports.lookup = lookup exports.types = Object.create(null) // Populate the extensions/types maps populateMaps(exports.extensions, exports.types) /** * Get the default charset for a MIME type. * * @param {string} type * @return {boolean|string} */ function charset(type) { if (!type || typeof type !== 'string') { return false } // TODO: use media-typer var match = extractTypeRegExp.exec(type) var mime = match && db[match[1].toLowerCase()] if (mime && mime.charset) { return mime.charset } // default text/* to utf-8 if (match && textTypeRegExp.test(match[1])) { return 'UTF-8' } return false } /** * Create a full Content-Type header given a MIME type or extension. * * @param {string} str * @return {boolean|string} */ function contentType(str) { // TODO: should this even be in this module? if (!str || typeof str !== 'string') { return false } var mime = str.indexOf('/') === -1 ? exports.lookup(str) : str if (!mime) { return false } // TODO: use content-type or other module if (mime.indexOf('charset') === -1) { var charset = exports.charset(mime) if (charset) mime += '; charset=' + charset.toLowerCase() } return mime } /** * Get the default extension for a MIME type. * * @param {string} type * @return {boolean|string} */ function extension(type) { if (!type || typeof type !== 'string') { return false } // TODO: use media-typer var match = extractTypeRegExp.exec(type) // get extensions var exts = match && exports.extensions[match[1].toLowerCase()] if (!exts || !exts.length) { return false } return exts[0] } /** * Lookup the MIME type for a file path/extension. * * @param {string} path * @return {boolean|string} */ function lookup(path) { if (!path || typeof path !== 'string') { return false } // get the extension ("ext" or ".ext" or full path) var extension = extname('x.' + path) .toLowerCase() .substr(1) if (!extension) { return false } return exports.types[extension] || false } /** * Populate the extensions and types maps. * @private */ function populateMaps(extensions, types) { // source preference (least -> most) var preference = ['nginx', 'apache', undefined, 'iana'] Object.keys(db).forEach(function forEachMimeType(type) { var mime = db[type] var exts = mime.extensions if (!exts || !exts.length) { return } // mime -> extensions extensions[type] = exts // extension -> mime for (var i = 0; i < exts.length; i++) { var extension = exts[i] if (types[extension]) { var from = preference.indexOf(db[types[extension]].source) var to = preference.indexOf(mime.source) if (types[extension] !== 'application/octet-stream' && from > to || (from === to && types[extension].substr(0, 12) === 'application/')) { // skip the remapping continue } } // set the extension -> mime types[extension] = type } }) } },{"mime-db":236,"path":105}],238:[function(require,module,exports){ //! moment.js //! version : 2.13.0 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com ;(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.moment = factory() }(this, function () { 'use strict'; var hookCallback; function utils_hooks__hooks () { return hookCallback.apply(null, arguments); } // This is done to register the method called with moment() // without creating circular dependencies. function setHookCallback (callback) { hookCallback = callback; } function isArray(input) { return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]'; } function isDate(input) { return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]'; } function map(arr, fn) { var res = [], i; for (i = 0; i < arr.length; ++i) { res.push(fn(arr[i], i)); } return res; } function hasOwnProp(a, b) { return Object.prototype.hasOwnProperty.call(a, b); } function extend(a, b) { for (var i in b) { if (hasOwnProp(b, i)) { a[i] = b[i]; } } if (hasOwnProp(b, 'toString')) { a.toString = b.toString; } if (hasOwnProp(b, 'valueOf')) { a.valueOf = b.valueOf; } return a; } function create_utc__createUTC (input, format, locale, strict) { return createLocalOrUTC(input, format, locale, strict, true).utc(); } function defaultParsingFlags() { // We need to deep clone this object. return { empty : false, unusedTokens : [], unusedInput : [], overflow : -2, charsLeftOver : 0, nullInput : false, invalidMonth : null, invalidFormat : false, userInvalidated : false, iso : false, parsedDateParts : [], meridiem : null }; } function getParsingFlags(m) { if (m._pf == null) { m._pf = defaultParsingFlags(); } return m._pf; } var some; if (Array.prototype.some) { some = Array.prototype.some; } else { some = function (fun) { var t = Object(this); var len = t.length >>> 0; for (var i = 0; i < len; i++) { if (i in t && fun.call(this, t[i], i, t)) { return true; } } return false; }; } function valid__isValid(m) { if (m._isValid == null) { var flags = getParsingFlags(m); var parsedParts = some.call(flags.parsedDateParts, function (i) { return i != null; }); m._isValid = !isNaN(m._d.getTime()) && flags.overflow < 0 && !flags.empty && !flags.invalidMonth && !flags.invalidWeekday && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || (flags.meridiem && parsedParts)); if (m._strict) { m._isValid = m._isValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined; } } return m._isValid; } function valid__createInvalid (flags) { var m = create_utc__createUTC(NaN); if (flags != null) { extend(getParsingFlags(m), flags); } else { getParsingFlags(m).userInvalidated = true; } return m; } function isUndefined(input) { return input === void 0; } // Plugins that add properties should also add the key here (null value), // so we can properly clone ourselves. var momentProperties = utils_hooks__hooks.momentProperties = []; function copyConfig(to, from) { var i, prop, val; if (!isUndefined(from._isAMomentObject)) { to._isAMomentObject = from._isAMomentObject; } if (!isUndefined(from._i)) { to._i = from._i; } if (!isUndefined(from._f)) { to._f = from._f; } if (!isUndefined(from._l)) { to._l = from._l; } if (!isUndefined(from._strict)) { to._strict = from._strict; } if (!isUndefined(from._tzm)) { to._tzm = from._tzm; } if (!isUndefined(from._isUTC)) { to._isUTC = from._isUTC; } if (!isUndefined(from._offset)) { to._offset = from._offset; } if (!isUndefined(from._pf)) { to._pf = getParsingFlags(from); } if (!isUndefined(from._locale)) { to._locale = from._locale; } if (momentProperties.length > 0) { for (i in momentProperties) { prop = momentProperties[i]; val = from[prop]; if (!isUndefined(val)) { to[prop] = val; } } } return to; } var updateInProgress = false; // Moment prototype object function Moment(config) { copyConfig(this, config); this._d = new Date(config._d != null ? config._d.getTime() : NaN); // Prevent infinite loop in case updateOffset creates new moment // objects. if (updateInProgress === false) { updateInProgress = true; utils_hooks__hooks.updateOffset(this); updateInProgress = false; } } function isMoment (obj) { return obj instanceof Moment || (obj != null && obj._isAMomentObject != null); } function absFloor (number) { if (number < 0) { return Math.ceil(number); } else { return Math.floor(number); } } function toInt(argumentForCoercion) { var coercedNumber = +argumentForCoercion, value = 0; if (coercedNumber !== 0 && isFinite(coercedNumber)) { value = absFloor(coercedNumber); } return value; } // compare two arrays, return the number of differences function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i; for (i = 0; i < len; i++) { if ((dontConvert && array1[i] !== array2[i]) || (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { diffs++; } } return diffs + lengthDiff; } function warn(msg) { if (utils_hooks__hooks.suppressDeprecationWarnings === false && (typeof console !== 'undefined') && console.warn) { console.warn('Deprecation warning: ' + msg); } } function deprecate(msg, fn) { var firstTime = true; return extend(function () { if (utils_hooks__hooks.deprecationHandler != null) { utils_hooks__hooks.deprecationHandler(null, msg); } if (firstTime) { warn(msg + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\n' + (new Error()).stack); firstTime = false; } return fn.apply(this, arguments); }, fn); } var deprecations = {}; function deprecateSimple(name, msg) { if (utils_hooks__hooks.deprecationHandler != null) { utils_hooks__hooks.deprecationHandler(name, msg); } if (!deprecations[name]) { warn(msg); deprecations[name] = true; } } utils_hooks__hooks.suppressDeprecationWarnings = false; utils_hooks__hooks.deprecationHandler = null; function isFunction(input) { return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; } function isObject(input) { return Object.prototype.toString.call(input) === '[object Object]'; } function locale_set__set (config) { var prop, i; for (i in config) { prop = config[i]; if (isFunction(prop)) { this[i] = prop; } else { this['_' + i] = prop; } } this._config = config; // Lenient ordinal parsing accepts just a number in addition to // number + (possibly) stuff coming from _ordinalParseLenient. this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source); } function mergeConfigs(parentConfig, childConfig) { var res = extend({}, parentConfig), prop; for (prop in childConfig) { if (hasOwnProp(childConfig, prop)) { if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { res[prop] = {}; extend(res[prop], parentConfig[prop]); extend(res[prop], childConfig[prop]); } else if (childConfig[prop] != null) { res[prop] = childConfig[prop]; } else { delete res[prop]; } } } return res; } function Locale(config) { if (config != null) { this.set(config); } } var keys; if (Object.keys) { keys = Object.keys; } else { keys = function (obj) { var i, res = []; for (i in obj) { if (hasOwnProp(obj, i)) { res.push(i); } } return res; }; } // internal storage for locale config files var locales = {}; var globalLocale; function normalizeLocale(key) { return key ? key.toLowerCase().replace('_', '-') : key; } // pick the locale from the array // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root function chooseLocale(names) { var i = 0, j, next, locale, split; while (i < names.length) { split = normalizeLocale(names[i]).split('-'); j = split.length; next = normalizeLocale(names[i + 1]); next = next ? next.split('-') : null; while (j > 0) { locale = loadLocale(split.slice(0, j).join('-')); if (locale) { return locale; } if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { //the next array item is better than a shallower substring of this one break; } j--; } i++; } return null; } function loadLocale(name) { var oldLocale = null; // TODO: Find a better way to register and load all the locales in Node if (!locales[name] && (typeof module !== 'undefined') && module && module.exports) { try { oldLocale = globalLocale._abbr; require('./locale/' + name); // because defineLocale currently also sets the global locale, we // want to undo that for lazy loaded locales locale_locales__getSetGlobalLocale(oldLocale); } catch (e) { } } return locales[name]; } // This function will load locale and then set the global locale. If // no arguments are passed in, it will simply return the current global // locale key. function locale_locales__getSetGlobalLocale (key, values) { var data; if (key) { if (isUndefined(values)) { data = locale_locales__getLocale(key); } else { data = defineLocale(key, values); } if (data) { // moment.duration._locale = moment._locale = data; globalLocale = data; } } return globalLocale._abbr; } function defineLocale (name, config) { if (config !== null) { config.abbr = name; if (locales[name] != null) { deprecateSimple('defineLocaleOverride', 'use moment.updateLocale(localeName, config) to change ' + 'an existing locale. moment.defineLocale(localeName, ' + 'config) should only be used for creating a new locale'); config = mergeConfigs(locales[name]._config, config); } else if (config.parentLocale != null) { if (locales[config.parentLocale] != null) { config = mergeConfigs(locales[config.parentLocale]._config, config); } else { // treat as if there is no base config deprecateSimple('parentLocaleUndefined', 'specified parentLocale is not defined yet'); } } locales[name] = new Locale(config); // backwards compat for now: also set the locale locale_locales__getSetGlobalLocale(name); return locales[name]; } else { // useful for testing delete locales[name]; return null; } } function updateLocale(name, config) { if (config != null) { var locale; if (locales[name] != null) { config = mergeConfigs(locales[name]._config, config); } locale = new Locale(config); locale.parentLocale = locales[name]; locales[name] = locale; // backwards compat for now: also set the locale locale_locales__getSetGlobalLocale(name); } else { // pass null for config to unupdate, useful for tests if (locales[name] != null) { if (locales[name].parentLocale != null) { locales[name] = locales[name].parentLocale; } else if (locales[name] != null) { delete locales[name]; } } } return locales[name]; } // returns locale data function locale_locales__getLocale (key) { var locale; if (key && key._locale && key._locale._abbr) { key = key._locale._abbr; } if (!key) { return globalLocale; } if (!isArray(key)) { //short-circuit everything else locale = loadLocale(key); if (locale) { return locale; } key = [key]; } return chooseLocale(key); } function locale_locales__listLocales() { return keys(locales); } var aliases = {}; function addUnitAlias (unit, shorthand) { var lowerCase = unit.toLowerCase(); aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit; } function normalizeUnits(units) { return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; } function normalizeObjectUnits(inputObject) { var normalizedInput = {}, normalizedProp, prop; for (prop in inputObject) { if (hasOwnProp(inputObject, prop)) { normalizedProp = normalizeUnits(prop); if (normalizedProp) { normalizedInput[normalizedProp] = inputObject[prop]; } } } return normalizedInput; } function makeGetSet (unit, keepTime) { return function (value) { if (value != null) { get_set__set(this, unit, value); utils_hooks__hooks.updateOffset(this, keepTime); return this; } else { return get_set__get(this, unit); } }; } function get_set__get (mom, unit) { return mom.isValid() ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; } function get_set__set (mom, unit, value) { if (mom.isValid()) { mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); } } // MOMENTS function getSet (units, value) { var unit; if (typeof units === 'object') { for (unit in units) { this.set(unit, units[unit]); } } else { units = normalizeUnits(units); if (isFunction(this[units])) { return this[units](value); } } return this; } function zeroFill(number, targetLength, forceSign) { var absNumber = '' + Math.abs(number), zerosToFill = targetLength - absNumber.length, sign = number >= 0; return (sign ? (forceSign ? '+' : '') : '-') + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; } var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; var formatFunctions = {}; var formatTokenFunctions = {}; // token: 'M' // padded: ['MM', 2] // ordinal: 'Mo' // callback: function () { this.month() + 1 } function addFormatToken (token, padded, ordinal, callback) { var func = callback; if (typeof callback === 'string') { func = function () { return this[callback](); }; } if (token) { formatTokenFunctions[token] = func; } if (padded) { formatTokenFunctions[padded[0]] = function () { return zeroFill(func.apply(this, arguments), padded[1], padded[2]); }; } if (ordinal) { formatTokenFunctions[ordinal] = function () { return this.localeData().ordinal(func.apply(this, arguments), token); }; } } function removeFormattingTokens(input) { if (input.match(/\[[\s\S]/)) { return input.replace(/^\[|\]$/g, ''); } return input.replace(/\\/g, ''); } function makeFormatFunction(format) { var array = format.match(formattingTokens), i, length; for (i = 0, length = array.length; i < length; i++) { if (formatTokenFunctions[array[i]]) { array[i] = formatTokenFunctions[array[i]]; } else { array[i] = removeFormattingTokens(array[i]); } } return function (mom) { var output = '', i; for (i = 0; i < length; i++) { output += array[i] instanceof Function ? array[i].call(mom, format) : array[i]; } return output; }; } // format date using native date object function formatMoment(m, format) { if (!m.isValid()) { return m.localeData().invalidDate(); } format = expandFormat(format, m.localeData()); formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); return formatFunctions[format](m); } function expandFormat(format, locale) { var i = 5; function replaceLongDateFormatTokens(input) { return locale.longDateFormat(input) || input; } localFormattingTokens.lastIndex = 0; while (i >= 0 && localFormattingTokens.test(format)) { format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); localFormattingTokens.lastIndex = 0; i -= 1; } return format; } var match1 = /\d/; // 0 - 9 var match2 = /\d\d/; // 00 - 99 var match3 = /\d{3}/; // 000 - 999 var match4 = /\d{4}/; // 0000 - 9999 var match6 = /[+-]?\d{6}/; // -999999 - 999999 var match1to2 = /\d\d?/; // 0 - 99 var match3to4 = /\d\d\d\d?/; // 999 - 9999 var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999 var match1to3 = /\d{1,3}/; // 0 - 999 var match1to4 = /\d{1,4}/; // 0 - 9999 var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 var matchUnsigned = /\d+/; // 0 - inf var matchSigned = /[+-]?\d+/; // -inf - inf var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 // any word (or two) characters or numbers including two/three word month in arabic. // includes scottish gaelic two word and hyphenated months var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i; var regexes = {}; function addRegexToken (token, regex, strictRegex) { regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { return (isStrict && strictRegex) ? strictRegex : regex; }; } function getParseRegexForToken (token, config) { if (!hasOwnProp(regexes, token)) { return new RegExp(unescapeFormat(token)); } return regexes[token](config._strict, config._locale); } // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript function unescapeFormat(s) { return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { return p1 || p2 || p3 || p4; })); } function regexEscape(s) { return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } var tokens = {}; function addParseToken (token, callback) { var i, func = callback; if (typeof token === 'string') { token = [token]; } if (typeof callback === 'number') { func = function (input, array) { array[callback] = toInt(input); }; } for (i = 0; i < token.length; i++) { tokens[token[i]] = func; } } function addWeekParseToken (token, callback) { addParseToken(token, function (input, array, config, token) { config._w = config._w || {}; callback(input, config._w, config, token); }); } function addTimeToArrayFromToken(token, input, config) { if (input != null && hasOwnProp(tokens, token)) { tokens[token](input, config._a, config, token); } } var YEAR = 0; var MONTH = 1; var DATE = 2; var HOUR = 3; var MINUTE = 4; var SECOND = 5; var MILLISECOND = 6; var WEEK = 7; var WEEKDAY = 8; var indexOf; if (Array.prototype.indexOf) { indexOf = Array.prototype.indexOf; } else { indexOf = function (o) { // I know var i; for (i = 0; i < this.length; ++i) { if (this[i] === o) { return i; } } return -1; }; } function daysInMonth(year, month) { return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); } // FORMATTING addFormatToken('M', ['MM', 2], 'Mo', function () { return this.month() + 1; }); addFormatToken('MMM', 0, 0, function (format) { return this.localeData().monthsShort(this, format); }); addFormatToken('MMMM', 0, 0, function (format) { return this.localeData().months(this, format); }); // ALIASES addUnitAlias('month', 'M'); // PARSING addRegexToken('M', match1to2); addRegexToken('MM', match1to2, match2); addRegexToken('MMM', function (isStrict, locale) { return locale.monthsShortRegex(isStrict); }); addRegexToken('MMMM', function (isStrict, locale) { return locale.monthsRegex(isStrict); }); addParseToken(['M', 'MM'], function (input, array) { array[MONTH] = toInt(input) - 1; }); addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { var month = config._locale.monthsParse(input, token, config._strict); // if we didn't find a month name, mark the date as invalid. if (month != null) { array[MONTH] = month; } else { getParsingFlags(config).invalidMonth = input; } }); // LOCALES var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/; var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); function localeMonths (m, format) { return isArray(this._months) ? this._months[m.month()] : this._months[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; } var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); function localeMonthsShort (m, format) { return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; } function units_month__handleStrictParse(monthName, format, strict) { var i, ii, mom, llc = monthName.toLocaleLowerCase(); if (!this._monthsParse) { // this is not used this._monthsParse = []; this._longMonthsParse = []; this._shortMonthsParse = []; for (i = 0; i < 12; ++i) { mom = create_utc__createUTC([2000, i]); this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase(); this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); } } if (strict) { if (format === 'MMM') { ii = indexOf.call(this._shortMonthsParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._longMonthsParse, llc); return ii !== -1 ? ii : null; } } else { if (format === 'MMM') { ii = indexOf.call(this._shortMonthsParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._longMonthsParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._longMonthsParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortMonthsParse, llc); return ii !== -1 ? ii : null; } } } function localeMonthsParse (monthName, format, strict) { var i, mom, regex; if (this._monthsParseExact) { return units_month__handleStrictParse.call(this, monthName, format, strict); } if (!this._monthsParse) { this._monthsParse = []; this._longMonthsParse = []; this._shortMonthsParse = []; } // TODO: add sorting // Sorting makes sure if one month (or abbr) is a prefix of another // see sorting in computeMonthsParse for (i = 0; i < 12; i++) { // make the regex if we don't have it already mom = create_utc__createUTC([2000, i]); if (strict && !this._longMonthsParse[i]) { this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i'); this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i'); } if (!strict && !this._monthsParse[i]) { regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) { return i; } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) { return i; } else if (!strict && this._monthsParse[i].test(monthName)) { return i; } } } // MOMENTS function setMonth (mom, value) { var dayOfMonth; if (!mom.isValid()) { // No op return mom; } if (typeof value === 'string') { if (/^\d+$/.test(value)) { value = toInt(value); } else { value = mom.localeData().monthsParse(value); // TODO: Another silent failure? if (typeof value !== 'number') { return mom; } } } dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); return mom; } function getSetMonth (value) { if (value != null) { setMonth(this, value); utils_hooks__hooks.updateOffset(this, true); return this; } else { return get_set__get(this, 'Month'); } } function getDaysInMonth () { return daysInMonth(this.year(), this.month()); } var defaultMonthsShortRegex = matchWord; function monthsShortRegex (isStrict) { if (this._monthsParseExact) { if (!hasOwnProp(this, '_monthsRegex')) { computeMonthsParse.call(this); } if (isStrict) { return this._monthsShortStrictRegex; } else { return this._monthsShortRegex; } } else { return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex; } } var defaultMonthsRegex = matchWord; function monthsRegex (isStrict) { if (this._monthsParseExact) { if (!hasOwnProp(this, '_monthsRegex')) { computeMonthsParse.call(this); } if (isStrict) { return this._monthsStrictRegex; } else { return this._monthsRegex; } } else { return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex; } } function computeMonthsParse () { function cmpLenRev(a, b) { return b.length - a.length; } var shortPieces = [], longPieces = [], mixedPieces = [], i, mom; for (i = 0; i < 12; i++) { // make the regex if we don't have it already mom = create_utc__createUTC([2000, i]); shortPieces.push(this.monthsShort(mom, '')); longPieces.push(this.months(mom, '')); mixedPieces.push(this.months(mom, '')); mixedPieces.push(this.monthsShort(mom, '')); } // Sorting makes sure if one month (or abbr) is a prefix of another it // will match the longer piece. shortPieces.sort(cmpLenRev); longPieces.sort(cmpLenRev); mixedPieces.sort(cmpLenRev); for (i = 0; i < 12; i++) { shortPieces[i] = regexEscape(shortPieces[i]); longPieces[i] = regexEscape(longPieces[i]); mixedPieces[i] = regexEscape(mixedPieces[i]); } this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); this._monthsShortRegex = this._monthsRegex; this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); } function checkOverflow (m) { var overflow; var a = m._a; if (a && getParsingFlags(m).overflow === -2) { overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1; if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { overflow = DATE; } if (getParsingFlags(m)._overflowWeeks && overflow === -1) { overflow = WEEK; } if (getParsingFlags(m)._overflowWeekday && overflow === -1) { overflow = WEEKDAY; } getParsingFlags(m).overflow = overflow; } return m; } // iso 8601 regex // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/; var isoDates = [ ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], ['GGGG-[W]WW', /\d{4}-W\d\d/, false], ['YYYY-DDD', /\d{4}-\d{3}/], ['YYYY-MM', /\d{4}-\d\d/, false], ['YYYYYYMMDD', /[+-]\d{10}/], ['YYYYMMDD', /\d{8}/], // YYYYMM is NOT allowed by the standard ['GGGG[W]WWE', /\d{4}W\d{3}/], ['GGGG[W]WW', /\d{4}W\d{2}/, false], ['YYYYDDD', /\d{7}/] ]; // iso time formats and regexes var isoTimes = [ ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], ['HH:mm:ss', /\d\d:\d\d:\d\d/], ['HH:mm', /\d\d:\d\d/], ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], ['HHmmss', /\d\d\d\d\d\d/], ['HHmm', /\d\d\d\d/], ['HH', /\d\d/] ]; var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; // date from iso format function configFromISO(config) { var i, l, string = config._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat; if (match) { getParsingFlags(config).iso = true; for (i = 0, l = isoDates.length; i < l; i++) { if (isoDates[i][1].exec(match[1])) { dateFormat = isoDates[i][0]; allowTime = isoDates[i][2] !== false; break; } } if (dateFormat == null) { config._isValid = false; return; } if (match[3]) { for (i = 0, l = isoTimes.length; i < l; i++) { if (isoTimes[i][1].exec(match[3])) { // match[2] should be 'T' or space timeFormat = (match[2] || ' ') + isoTimes[i][0]; break; } } if (timeFormat == null) { config._isValid = false; return; } } if (!allowTime && timeFormat != null) { config._isValid = false; return; } if (match[4]) { if (tzRegex.exec(match[4])) { tzFormat = 'Z'; } else { config._isValid = false; return; } } config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); configFromStringAndFormat(config); } else { config._isValid = false; } } // date from iso format or fallback function configFromString(config) { var matched = aspNetJsonRegex.exec(config._i); if (matched !== null) { config._d = new Date(+matched[1]); return; } configFromISO(config); if (config._isValid === false) { delete config._isValid; utils_hooks__hooks.createFromInputFallback(config); } } utils_hooks__hooks.createFromInputFallback = deprecate( 'moment construction falls back to js Date. This is ' + 'discouraged and will be removed in upcoming major ' + 'release. Please refer to ' + 'https://github.com/moment/moment/issues/1407 for more info.', function (config) { config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); } ); function createDate (y, m, d, h, M, s, ms) { //can't just apply() to create a date: //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply var date = new Date(y, m, d, h, M, s, ms); //the date constructor remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0 && isFinite(date.getFullYear())) { date.setFullYear(y); } return date; } function createUTCDate (y) { var date = new Date(Date.UTC.apply(null, arguments)); //the Date.UTC function remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) { date.setUTCFullYear(y); } return date; } // FORMATTING addFormatToken('Y', 0, 0, function () { var y = this.year(); return y <= 9999 ? '' + y : '+' + y; }); addFormatToken(0, ['YY', 2], 0, function () { return this.year() % 100; }); addFormatToken(0, ['YYYY', 4], 0, 'year'); addFormatToken(0, ['YYYYY', 5], 0, 'year'); addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); // ALIASES addUnitAlias('year', 'y'); // PARSING addRegexToken('Y', matchSigned); addRegexToken('YY', match1to2, match2); addRegexToken('YYYY', match1to4, match4); addRegexToken('YYYYY', match1to6, match6); addRegexToken('YYYYYY', match1to6, match6); addParseToken(['YYYYY', 'YYYYYY'], YEAR); addParseToken('YYYY', function (input, array) { array[YEAR] = input.length === 2 ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input); }); addParseToken('YY', function (input, array) { array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input); }); addParseToken('Y', function (input, array) { array[YEAR] = parseInt(input, 10); }); // HELPERS function daysInYear(year) { return isLeapYear(year) ? 366 : 365; } function isLeapYear(year) { return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; } // HOOKS utils_hooks__hooks.parseTwoDigitYear = function (input) { return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); }; // MOMENTS var getSetYear = makeGetSet('FullYear', true); function getIsLeapYear () { return isLeapYear(this.year()); } // start-of-first-week - start-of-year function firstWeekOffset(year, dow, doy) { var // first-week day -- which january is always in the first week (4 for iso, 1 for other) fwd = 7 + dow - doy, // first-week day local weekday -- which local weekday is fwd fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; return -fwdlw + fwd - 1; } //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday function dayOfYearFromWeeks(year, week, weekday, dow, doy) { var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear; if (dayOfYear <= 0) { resYear = year - 1; resDayOfYear = daysInYear(resYear) + dayOfYear; } else if (dayOfYear > daysInYear(year)) { resYear = year + 1; resDayOfYear = dayOfYear - daysInYear(year); } else { resYear = year; resDayOfYear = dayOfYear; } return { year: resYear, dayOfYear: resDayOfYear }; } function weekOfYear(mom, dow, doy) { var weekOffset = firstWeekOffset(mom.year(), dow, doy), week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, resWeek, resYear; if (week < 1) { resYear = mom.year() - 1; resWeek = week + weeksInYear(resYear, dow, doy); } else if (week > weeksInYear(mom.year(), dow, doy)) { resWeek = week - weeksInYear(mom.year(), dow, doy); resYear = mom.year() + 1; } else { resYear = mom.year(); resWeek = week; } return { week: resWeek, year: resYear }; } function weeksInYear(year, dow, doy) { var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy); return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; } // Pick the first defined of two or three arguments. function defaults(a, b, c) { if (a != null) { return a; } if (b != null) { return b; } return c; } function currentDateArray(config) { // hooks is actually the exported moment object var nowValue = new Date(utils_hooks__hooks.now()); if (config._useUTC) { return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()]; } return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; } // convert an array to a date. // the array should mirror the parameters below // note: all values past the year are optional and will default to the lowest possible value. // [year, month, day , hour, minute, second, millisecond] function configFromArray (config) { var i, date, input = [], currentDate, yearToUse; if (config._d) { return; } currentDate = currentDateArray(config); //compute day of the year from weeks and weekdays if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { dayOfYearFromWeekInfo(config); } //if the day of the year is set, figure out what it is if (config._dayOfYear) { yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); if (config._dayOfYear > daysInYear(yearToUse)) { getParsingFlags(config)._overflowDayOfYear = true; } date = createUTCDate(yearToUse, 0, config._dayOfYear); config._a[MONTH] = date.getUTCMonth(); config._a[DATE] = date.getUTCDate(); } // Default to current date. // * if no year, month, day of month are given, default to today // * if day of month is given, default month and year // * if month is given, default only year // * if year is given, don't default anything for (i = 0; i < 3 && config._a[i] == null; ++i) { config._a[i] = input[i] = currentDate[i]; } // Zero out whatever was not defaulted, including time for (; i < 7; i++) { config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; } // Check for 24:00:00.000 if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) { config._nextDay = true; config._a[HOUR] = 0; } config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input); // Apply timezone offset from input. The actual utcOffset can be changed // with parseZone. if (config._tzm != null) { config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); } if (config._nextDay) { config._a[HOUR] = 24; } } function dayOfYearFromWeekInfo(config) { var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow; w = config._w; if (w.GG != null || w.W != null || w.E != null) { dow = 1; doy = 4; // TODO: We need to take the current isoWeekYear, but that depends on // how we interpret now (local, utc, fixed offset). So create // a now version of current config (take local/utc/offset flags, and // create now). weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year); week = defaults(w.W, 1); weekday = defaults(w.E, 1); if (weekday < 1 || weekday > 7) { weekdayOverflow = true; } } else { dow = config._locale._week.dow; doy = config._locale._week.doy; weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year); week = defaults(w.w, 1); if (w.d != null) { // weekday -- low day numbers are considered next week weekday = w.d; if (weekday < 0 || weekday > 6) { weekdayOverflow = true; } } else if (w.e != null) { // local weekday -- counting starts from begining of week weekday = w.e + dow; if (w.e < 0 || w.e > 6) { weekdayOverflow = true; } } else { // default to begining of week weekday = dow; } } if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { getParsingFlags(config)._overflowWeeks = true; } else if (weekdayOverflow != null) { getParsingFlags(config)._overflowWeekday = true; } else { temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); config._a[YEAR] = temp.year; config._dayOfYear = temp.dayOfYear; } } // constant that refers to the ISO standard utils_hooks__hooks.ISO_8601 = function () {}; // date from string and format string function configFromStringAndFormat(config) { // TODO: Move this to another part of the creation flow to prevent circular deps if (config._f === utils_hooks__hooks.ISO_8601) { configFromISO(config); return; } config._a = []; getParsingFlags(config).empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC` var string = '' + config._i, i, parsedInput, tokens, token, skipped, stringLength = string.length, totalParsedInputLength = 0; tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; for (i = 0; i < tokens.length; i++) { token = tokens[i]; parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; // console.log('token', token, 'parsedInput', parsedInput, // 'regex', getParseRegexForToken(token, config)); if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { getParsingFlags(config).unusedInput.push(skipped); } string = string.slice(string.indexOf(parsedInput) + parsedInput.length); totalParsedInputLength += parsedInput.length; } // don't parse if it's not a known token if (formatTokenFunctions[token]) { if (parsedInput) { getParsingFlags(config).empty = false; } else { getParsingFlags(config).unusedTokens.push(token); } addTimeToArrayFromToken(token, parsedInput, config); } else if (config._strict && !parsedInput) { getParsingFlags(config).unusedTokens.push(token); } } // add remaining unparsed input length to the string getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; if (string.length > 0) { getParsingFlags(config).unusedInput.push(string); } // clear _12h flag if hour is <= 12 if (getParsingFlags(config).bigHour === true && config._a[HOUR] <= 12 && config._a[HOUR] > 0) { getParsingFlags(config).bigHour = undefined; } getParsingFlags(config).parsedDateParts = config._a.slice(0); getParsingFlags(config).meridiem = config._meridiem; // handle meridiem config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem); configFromArray(config); checkOverflow(config); } function meridiemFixWrap (locale, hour, meridiem) { var isPm; if (meridiem == null) { // nothing to do return hour; } if (locale.meridiemHour != null) { return locale.meridiemHour(hour, meridiem); } else if (locale.isPM != null) { // Fallback isPm = locale.isPM(meridiem); if (isPm && hour < 12) { hour += 12; } if (!isPm && hour === 12) { hour = 0; } return hour; } else { // this is not supposed to happen return hour; } } // date from string and array of format strings function configFromStringAndArray(config) { var tempConfig, bestMoment, scoreToBeat, i, currentScore; if (config._f.length === 0) { getParsingFlags(config).invalidFormat = true; config._d = new Date(NaN); return; } for (i = 0; i < config._f.length; i++) { currentScore = 0; tempConfig = copyConfig({}, config); if (config._useUTC != null) { tempConfig._useUTC = config._useUTC; } tempConfig._f = config._f[i]; configFromStringAndFormat(tempConfig); if (!valid__isValid(tempConfig)) { continue; } // if there is any input that was not parsed add a penalty for that format currentScore += getParsingFlags(tempConfig).charsLeftOver; //or tokens currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; getParsingFlags(tempConfig).score = currentScore; if (scoreToBeat == null || currentScore < scoreToBeat) { scoreToBeat = currentScore; bestMoment = tempConfig; } } extend(config, bestMoment || tempConfig); } function configFromObject(config) { if (config._d) { return; } var i = normalizeObjectUnits(config._i); config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) { return obj && parseInt(obj, 10); }); configFromArray(config); } function createFromConfig (config) { var res = new Moment(checkOverflow(prepareConfig(config))); if (res._nextDay) { // Adding is smart enough around DST res.add(1, 'd'); res._nextDay = undefined; } return res; } function prepareConfig (config) { var input = config._i, format = config._f; config._locale = config._locale || locale_locales__getLocale(config._l); if (input === null || (format === undefined && input === '')) { return valid__createInvalid({nullInput: true}); } if (typeof input === 'string') { config._i = input = config._locale.preparse(input); } if (isMoment(input)) { return new Moment(checkOverflow(input)); } else if (isArray(format)) { configFromStringAndArray(config); } else if (format) { configFromStringAndFormat(config); } else if (isDate(input)) { config._d = input; } else { configFromInput(config); } if (!valid__isValid(config)) { config._d = null; } return config; } function configFromInput(config) { var input = config._i; if (input === undefined) { config._d = new Date(utils_hooks__hooks.now()); } else if (isDate(input)) { config._d = new Date(input.valueOf()); } else if (typeof input === 'string') { configFromString(config); } else if (isArray(input)) { config._a = map(input.slice(0), function (obj) { return parseInt(obj, 10); }); configFromArray(config); } else if (typeof(input) === 'object') { configFromObject(config); } else if (typeof(input) === 'number') { // from milliseconds config._d = new Date(input); } else { utils_hooks__hooks.createFromInputFallback(config); } } function createLocalOrUTC (input, format, locale, strict, isUTC) { var c = {}; if (typeof(locale) === 'boolean') { strict = locale; locale = undefined; } // object construction must be done this way. // https://github.com/moment/moment/issues/1423 c._isAMomentObject = true; c._useUTC = c._isUTC = isUTC; c._l = locale; c._i = input; c._f = format; c._strict = strict; return createFromConfig(c); } function local__createLocal (input, format, locale, strict) { return createLocalOrUTC(input, format, locale, strict, false); } var prototypeMin = deprecate( 'moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { return other < this ? this : other; } else { return valid__createInvalid(); } } ); var prototypeMax = deprecate( 'moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { return other > this ? this : other; } else { return valid__createInvalid(); } } ); // Pick a moment m from moments so that m[fn](other) is true for all // other. This relies on the function fn to be transitive. // // moments should either be an array of moment objects or an array, whose // first element is an array of moment objects. function pickBy(fn, moments) { var res, i; if (moments.length === 1 && isArray(moments[0])) { moments = moments[0]; } if (!moments.length) { return local__createLocal(); } res = moments[0]; for (i = 1; i < moments.length; ++i) { if (!moments[i].isValid() || moments[i][fn](res)) { res = moments[i]; } } return res; } // TODO: Use [].sort instead? function min () { var args = [].slice.call(arguments, 0); return pickBy('isBefore', args); } function max () { var args = [].slice.call(arguments, 0); return pickBy('isAfter', args); } var now = function () { return Date.now ? Date.now() : +(new Date()); }; function Duration (duration) { var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months = normalizedInput.month || 0, weeks = normalizedInput.week || 0, days = normalizedInput.day || 0, hours = normalizedInput.hour || 0, minutes = normalizedInput.minute || 0, seconds = normalizedInput.second || 0, milliseconds = normalizedInput.millisecond || 0; // representation for dateAddRemove this._milliseconds = +milliseconds + seconds * 1e3 + // 1000 minutes * 6e4 + // 1000 * 60 hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 // Because of dateAddRemove treats 24 hours as different from a // day when working around DST, we need to store them separately this._days = +days + weeks * 7; // It is impossible translate months into days without knowing // which months you are are talking about, so we have to store // it separately. this._months = +months + quarters * 3 + years * 12; this._data = {}; this._locale = locale_locales__getLocale(); this._bubble(); } function isDuration (obj) { return obj instanceof Duration; } // FORMATTING function offset (token, separator) { addFormatToken(token, 0, 0, function () { var offset = this.utcOffset(); var sign = '+'; if (offset < 0) { offset = -offset; sign = '-'; } return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2); }); } offset('Z', ':'); offset('ZZ', ''); // PARSING addRegexToken('Z', matchShortOffset); addRegexToken('ZZ', matchShortOffset); addParseToken(['Z', 'ZZ'], function (input, array, config) { config._useUTC = true; config._tzm = offsetFromString(matchShortOffset, input); }); // HELPERS // timezone chunker // '+10:00' > ['10', '00'] // '-1530' > ['-15', '30'] var chunkOffset = /([\+\-]|\d\d)/gi; function offsetFromString(matcher, string) { var matches = ((string || '').match(matcher) || []); var chunk = matches[matches.length - 1] || []; var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; var minutes = +(parts[1] * 60) + toInt(parts[2]); return parts[0] === '+' ? minutes : -minutes; } // Return a moment from input, that is local/utc/zone equivalent to model. function cloneWithOffset(input, model) { var res, diff; if (model._isUTC) { res = model.clone(); diff = (isMoment(input) || isDate(input) ? input.valueOf() : local__createLocal(input).valueOf()) - res.valueOf(); // Use low-level api, because this fn is low-level api. res._d.setTime(res._d.valueOf() + diff); utils_hooks__hooks.updateOffset(res, false); return res; } else { return local__createLocal(input).local(); } } function getDateOffset (m) { // On Firefox.24 Date#getTimezoneOffset returns a floating point. // https://github.com/moment/moment/pull/1871 return -Math.round(m._d.getTimezoneOffset() / 15) * 15; } // HOOKS // This function will be called whenever a moment is mutated. // It is intended to keep the offset in sync with the timezone. utils_hooks__hooks.updateOffset = function () {}; // MOMENTS // keepLocalTime = true means only change the timezone, without // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset // +0200, so we adjust the time as needed, to be valid. // // Keeping the time actually adds/subtracts (one hour) // from the actual represented time. That is why we call updateOffset // a second time. In case it wants us to change the offset again // _changeInProgress == true case, then we have to adjust, because // there is no such time in the given timezone. function getSetOffset (input, keepLocalTime) { var offset = this._offset || 0, localAdjust; if (!this.isValid()) { return input != null ? this : NaN; } if (input != null) { if (typeof input === 'string') { input = offsetFromString(matchShortOffset, input); } else if (Math.abs(input) < 16) { input = input * 60; } if (!this._isUTC && keepLocalTime) { localAdjust = getDateOffset(this); } this._offset = input; this._isUTC = true; if (localAdjust != null) { this.add(localAdjust, 'm'); } if (offset !== input) { if (!keepLocalTime || this._changeInProgress) { add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false); } else if (!this._changeInProgress) { this._changeInProgress = true; utils_hooks__hooks.updateOffset(this, true); this._changeInProgress = null; } } return this; } else { return this._isUTC ? offset : getDateOffset(this); } } function getSetZone (input, keepLocalTime) { if (input != null) { if (typeof input !== 'string') { input = -input; } this.utcOffset(input, keepLocalTime); return this; } else { return -this.utcOffset(); } } function setOffsetToUTC (keepLocalTime) { return this.utcOffset(0, keepLocalTime); } function setOffsetToLocal (keepLocalTime) { if (this._isUTC) { this.utcOffset(0, keepLocalTime); this._isUTC = false; if (keepLocalTime) { this.subtract(getDateOffset(this), 'm'); } } return this; } function setOffsetToParsedOffset () { if (this._tzm) { this.utcOffset(this._tzm); } else if (typeof this._i === 'string') { this.utcOffset(offsetFromString(matchOffset, this._i)); } return this; } function hasAlignedHourOffset (input) { if (!this.isValid()) { return false; } input = input ? local__createLocal(input).utcOffset() : 0; return (this.utcOffset() - input) % 60 === 0; } function isDaylightSavingTime () { return ( this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset() ); } function isDaylightSavingTimeShifted () { if (!isUndefined(this._isDSTShifted)) { return this._isDSTShifted; } var c = {}; copyConfig(c, this); c = prepareConfig(c); if (c._a) { var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a); this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0; } else { this._isDSTShifted = false; } return this._isDSTShifted; } function isLocal () { return this.isValid() ? !this._isUTC : false; } function isUtcOffset () { return this.isValid() ? this._isUTC : false; } function isUtc () { return this.isValid() ? this._isUTC && this._offset === 0 : false; } // ASP.NET json date format regex var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/; // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere // and further modified to allow for strings containing both week and day var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/; function create__createDuration (input, key) { var duration = input, // matching against regexp is expensive, do it on demand match = null, sign, ret, diffRes; if (isDuration(input)) { duration = { ms : input._milliseconds, d : input._days, M : input._months }; } else if (typeof input === 'number') { duration = {}; if (key) { duration[key] = input; } else { duration.milliseconds = input; } } else if (!!(match = aspNetRegex.exec(input))) { sign = (match[1] === '-') ? -1 : 1; duration = { y : 0, d : toInt(match[DATE]) * sign, h : toInt(match[HOUR]) * sign, m : toInt(match[MINUTE]) * sign, s : toInt(match[SECOND]) * sign, ms : toInt(match[MILLISECOND]) * sign }; } else if (!!(match = isoRegex.exec(input))) { sign = (match[1] === '-') ? -1 : 1; duration = { y : parseIso(match[2], sign), M : parseIso(match[3], sign), w : parseIso(match[4], sign), d : parseIso(match[5], sign), h : parseIso(match[6], sign), m : parseIso(match[7], sign), s : parseIso(match[8], sign) }; } else if (duration == null) {// checks for null or undefined duration = {}; } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) { diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to)); duration = {}; duration.ms = diffRes.milliseconds; duration.M = diffRes.months; } ret = new Duration(duration); if (isDuration(input) && hasOwnProp(input, '_locale')) { ret._locale = input._locale; } return ret; } create__createDuration.fn = Duration.prototype; function parseIso (inp, sign) { // We'd normally use ~~inp for this, but unfortunately it also // converts floats to ints. // inp may be undefined, so careful calling replace on it. var res = inp && parseFloat(inp.replace(',', '.')); // apply sign while we're at it return (isNaN(res) ? 0 : res) * sign; } function positiveMomentsDifference(base, other) { var res = {milliseconds: 0, months: 0}; res.months = other.month() - base.month() + (other.year() - base.year()) * 12; if (base.clone().add(res.months, 'M').isAfter(other)) { --res.months; } res.milliseconds = +other - +(base.clone().add(res.months, 'M')); return res; } function momentsDifference(base, other) { var res; if (!(base.isValid() && other.isValid())) { return {milliseconds: 0, months: 0}; } other = cloneWithOffset(other, base); if (base.isBefore(other)) { res = positiveMomentsDifference(base, other); } else { res = positiveMomentsDifference(other, base); res.milliseconds = -res.milliseconds; res.months = -res.months; } return res; } function absRound (number) { if (number < 0) { return Math.round(-1 * number) * -1; } else { return Math.round(number); } } // TODO: remove 'name' arg after deprecation is removed function createAdder(direction, name) { return function (val, period) { var dur, tmp; //invert the arguments, but complain about it if (period !== null && !isNaN(+period)) { deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period).'); tmp = val; val = period; period = tmp; } val = typeof val === 'string' ? +val : val; dur = create__createDuration(val, period); add_subtract__addSubtract(this, dur, direction); return this; }; } function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) { var milliseconds = duration._milliseconds, days = absRound(duration._days), months = absRound(duration._months); if (!mom.isValid()) { // No op return; } updateOffset = updateOffset == null ? true : updateOffset; if (milliseconds) { mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); } if (days) { get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding); } if (months) { setMonth(mom, get_set__get(mom, 'Month') + months * isAdding); } if (updateOffset) { utils_hooks__hooks.updateOffset(mom, days || months); } } var add_subtract__add = createAdder(1, 'add'); var add_subtract__subtract = createAdder(-1, 'subtract'); function moment_calendar__calendar (time, formats) { // We want to compare the start of today, vs this. // Getting start-of-today depends on whether we're local/utc/offset or not. var now = time || local__createLocal(), sod = cloneWithOffset(now, this).startOf('day'), diff = this.diff(sod, 'days', true), format = diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; var output = formats && (isFunction(formats[format]) ? formats[format]() : formats[format]); return this.format(output || this.localeData().calendar(format, this, local__createLocal(now))); } function clone () { return new Moment(this); } function isAfter (input, units) { var localInput = isMoment(input) ? input : local__createLocal(input); if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { return this.valueOf() > localInput.valueOf(); } else { return localInput.valueOf() < this.clone().startOf(units).valueOf(); } } function isBefore (input, units) { var localInput = isMoment(input) ? input : local__createLocal(input); if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { return this.valueOf() < localInput.valueOf(); } else { return this.clone().endOf(units).valueOf() < localInput.valueOf(); } } function isBetween (from, to, units, inclusivity) { inclusivity = inclusivity || '()'; return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) && (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units)); } function isSame (input, units) { var localInput = isMoment(input) ? input : local__createLocal(input), inputMs; if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(units || 'millisecond'); if (units === 'millisecond') { return this.valueOf() === localInput.valueOf(); } else { inputMs = localInput.valueOf(); return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf(); } } function isSameOrAfter (input, units) { return this.isSame(input, units) || this.isAfter(input,units); } function isSameOrBefore (input, units) { return this.isSame(input, units) || this.isBefore(input,units); } function diff (input, units, asFloat) { var that, zoneDelta, delta, output; if (!this.isValid()) { return NaN; } that = cloneWithOffset(input, this); if (!that.isValid()) { return NaN; } zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; units = normalizeUnits(units); if (units === 'year' || units === 'month' || units === 'quarter') { output = monthDiff(this, that); if (units === 'quarter') { output = output / 3; } else if (units === 'year') { output = output / 12; } } else { delta = this - that; output = units === 'second' ? delta / 1e3 : // 1000 units === 'minute' ? delta / 6e4 : // 1000 * 60 units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60 units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst delta; } return asFloat ? output : absFloor(output); } function monthDiff (a, b) { // difference in months var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()), // b is in (anchor - 1 month, anchor + 1 month) anchor = a.clone().add(wholeMonthDiff, 'months'), anchor2, adjust; if (b - anchor < 0) { anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); // linear across the month adjust = (b - anchor) / (anchor - anchor2); } else { anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); // linear across the month adjust = (b - anchor) / (anchor2 - anchor); } //check for negative zero, return zero if negative zero return -(wholeMonthDiff + adjust) || 0; } utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; utils_hooks__hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; function toString () { return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); } function moment_format__toISOString () { var m = this.clone().utc(); if (0 < m.year() && m.year() <= 9999) { if (isFunction(Date.prototype.toISOString)) { // native implementation is ~50x faster, use it when we can return this.toDate().toISOString(); } else { return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); } } else { return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); } } function format (inputString) { if (!inputString) { inputString = this.isUtc() ? utils_hooks__hooks.defaultFormatUtc : utils_hooks__hooks.defaultFormat; } var output = formatMoment(this, inputString); return this.localeData().postformat(output); } function from (time, withoutSuffix) { if (this.isValid() && ((isMoment(time) && time.isValid()) || local__createLocal(time).isValid())) { return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); } else { return this.localeData().invalidDate(); } } function fromNow (withoutSuffix) { return this.from(local__createLocal(), withoutSuffix); } function to (time, withoutSuffix) { if (this.isValid() && ((isMoment(time) && time.isValid()) || local__createLocal(time).isValid())) { return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); } else { return this.localeData().invalidDate(); } } function toNow (withoutSuffix) { return this.to(local__createLocal(), withoutSuffix); } // If passed a locale key, it will set the locale for this // instance. Otherwise, it will return the locale configuration // variables for this instance. function locale (key) { var newLocaleData; if (key === undefined) { return this._locale._abbr; } else { newLocaleData = locale_locales__getLocale(key); if (newLocaleData != null) { this._locale = newLocaleData; } return this; } } var lang = deprecate( 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', function (key) { if (key === undefined) { return this.localeData(); } else { return this.locale(key); } } ); function localeData () { return this._locale; } function startOf (units) { units = normalizeUnits(units); // the following switch intentionally omits break keywords // to utilize falling through the cases. switch (units) { case 'year': this.month(0); /* falls through */ case 'quarter': case 'month': this.date(1); /* falls through */ case 'week': case 'isoWeek': case 'day': case 'date': this.hours(0); /* falls through */ case 'hour': this.minutes(0); /* falls through */ case 'minute': this.seconds(0); /* falls through */ case 'second': this.milliseconds(0); } // weeks are a special case if (units === 'week') { this.weekday(0); } if (units === 'isoWeek') { this.isoWeekday(1); } // quarters are also special if (units === 'quarter') { this.month(Math.floor(this.month() / 3) * 3); } return this; } function endOf (units) { units = normalizeUnits(units); if (units === undefined || units === 'millisecond') { return this; } // 'date' is an alias for 'day', so it should be considered as such. if (units === 'date') { units = 'day'; } return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms'); } function to_type__valueOf () { return this._d.valueOf() - ((this._offset || 0) * 60000); } function unix () { return Math.floor(this.valueOf() / 1000); } function toDate () { return this._offset ? new Date(this.valueOf()) : this._d; } function toArray () { var m = this; return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()]; } function toObject () { var m = this; return { years: m.year(), months: m.month(), date: m.date(), hours: m.hours(), minutes: m.minutes(), seconds: m.seconds(), milliseconds: m.milliseconds() }; } function toJSON () { // new Date(NaN).toJSON() === null return this.isValid() ? this.toISOString() : null; } function moment_valid__isValid () { return valid__isValid(this); } function parsingFlags () { return extend({}, getParsingFlags(this)); } function invalidAt () { return getParsingFlags(this).overflow; } function creationData() { return { input: this._i, format: this._f, locale: this._locale, isUTC: this._isUTC, strict: this._strict }; } // FORMATTING addFormatToken(0, ['gg', 2], 0, function () { return this.weekYear() % 100; }); addFormatToken(0, ['GG', 2], 0, function () { return this.isoWeekYear() % 100; }); function addWeekYearFormatToken (token, getter) { addFormatToken(0, [token, token.length], 0, getter); } addWeekYearFormatToken('gggg', 'weekYear'); addWeekYearFormatToken('ggggg', 'weekYear'); addWeekYearFormatToken('GGGG', 'isoWeekYear'); addWeekYearFormatToken('GGGGG', 'isoWeekYear'); // ALIASES addUnitAlias('weekYear', 'gg'); addUnitAlias('isoWeekYear', 'GG'); // PARSING addRegexToken('G', matchSigned); addRegexToken('g', matchSigned); addRegexToken('GG', match1to2, match2); addRegexToken('gg', match1to2, match2); addRegexToken('GGGG', match1to4, match4); addRegexToken('gggg', match1to4, match4); addRegexToken('GGGGG', match1to6, match6); addRegexToken('ggggg', match1to6, match6); addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) { week[token.substr(0, 2)] = toInt(input); }); addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { week[token] = utils_hooks__hooks.parseTwoDigitYear(input); }); // MOMENTS function getSetWeekYear (input) { return getSetWeekYearHelper.call(this, input, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy); } function getSetISOWeekYear (input) { return getSetWeekYearHelper.call(this, input, this.isoWeek(), this.isoWeekday(), 1, 4); } function getISOWeeksInYear () { return weeksInYear(this.year(), 1, 4); } function getWeeksInYear () { var weekInfo = this.localeData()._week; return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); } function getSetWeekYearHelper(input, week, weekday, dow, doy) { var weeksTarget; if (input == null) { return weekOfYear(this, dow, doy).year; } else { weeksTarget = weeksInYear(input, dow, doy); if (week > weeksTarget) { week = weeksTarget; } return setWeekAll.call(this, input, week, weekday, dow, doy); } } function setWeekAll(weekYear, week, weekday, dow, doy) { var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); this.year(date.getUTCFullYear()); this.month(date.getUTCMonth()); this.date(date.getUTCDate()); return this; } // FORMATTING addFormatToken('Q', 0, 'Qo', 'quarter'); // ALIASES addUnitAlias('quarter', 'Q'); // PARSING addRegexToken('Q', match1); addParseToken('Q', function (input, array) { array[MONTH] = (toInt(input) - 1) * 3; }); // MOMENTS function getSetQuarter (input) { return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); } // FORMATTING addFormatToken('w', ['ww', 2], 'wo', 'week'); addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); // ALIASES addUnitAlias('week', 'w'); addUnitAlias('isoWeek', 'W'); // PARSING addRegexToken('w', match1to2); addRegexToken('ww', match1to2, match2); addRegexToken('W', match1to2); addRegexToken('WW', match1to2, match2); addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { week[token.substr(0, 1)] = toInt(input); }); // HELPERS // LOCALES function localeWeek (mom) { return weekOfYear(mom, this._week.dow, this._week.doy).week; } var defaultLocaleWeek = { dow : 0, // Sunday is the first day of the week. doy : 6 // The week that contains Jan 1st is the first week of the year. }; function localeFirstDayOfWeek () { return this._week.dow; } function localeFirstDayOfYear () { return this._week.doy; } // MOMENTS function getSetWeek (input) { var week = this.localeData().week(this); return input == null ? week : this.add((input - week) * 7, 'd'); } function getSetISOWeek (input) { var week = weekOfYear(this, 1, 4).week; return input == null ? week : this.add((input - week) * 7, 'd'); } // FORMATTING addFormatToken('D', ['DD', 2], 'Do', 'date'); // ALIASES addUnitAlias('date', 'D'); // PARSING addRegexToken('D', match1to2); addRegexToken('DD', match1to2, match2); addRegexToken('Do', function (isStrict, locale) { return isStrict ? locale._ordinalParse : locale._ordinalParseLenient; }); addParseToken(['D', 'DD'], DATE); addParseToken('Do', function (input, array) { array[DATE] = toInt(input.match(match1to2)[0], 10); }); // MOMENTS var getSetDayOfMonth = makeGetSet('Date', true); // FORMATTING addFormatToken('d', 0, 'do', 'day'); addFormatToken('dd', 0, 0, function (format) { return this.localeData().weekdaysMin(this, format); }); addFormatToken('ddd', 0, 0, function (format) { return this.localeData().weekdaysShort(this, format); }); addFormatToken('dddd', 0, 0, function (format) { return this.localeData().weekdays(this, format); }); addFormatToken('e', 0, 0, 'weekday'); addFormatToken('E', 0, 0, 'isoWeekday'); // ALIASES addUnitAlias('day', 'd'); addUnitAlias('weekday', 'e'); addUnitAlias('isoWeekday', 'E'); // PARSING addRegexToken('d', match1to2); addRegexToken('e', match1to2); addRegexToken('E', match1to2); addRegexToken('dd', function (isStrict, locale) { return locale.weekdaysMinRegex(isStrict); }); addRegexToken('ddd', function (isStrict, locale) { return locale.weekdaysShortRegex(isStrict); }); addRegexToken('dddd', function (isStrict, locale) { return locale.weekdaysRegex(isStrict); }); addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { var weekday = config._locale.weekdaysParse(input, token, config._strict); // if we didn't get a weekday name, mark the date as invalid if (weekday != null) { week.d = weekday; } else { getParsingFlags(config).invalidWeekday = input; } }); addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { week[token] = toInt(input); }); // HELPERS function parseWeekday(input, locale) { if (typeof input !== 'string') { return input; } if (!isNaN(input)) { return parseInt(input, 10); } input = locale.weekdaysParse(input); if (typeof input === 'number') { return input; } return null; } // LOCALES var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); function localeWeekdays (m, format) { return isArray(this._weekdays) ? this._weekdays[m.day()] : this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()]; } var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); function localeWeekdaysShort (m) { return this._weekdaysShort[m.day()]; } var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'); function localeWeekdaysMin (m) { return this._weekdaysMin[m.day()]; } function day_of_week__handleStrictParse(weekdayName, format, strict) { var i, ii, mom, llc = weekdayName.toLocaleLowerCase(); if (!this._weekdaysParse) { this._weekdaysParse = []; this._shortWeekdaysParse = []; this._minWeekdaysParse = []; for (i = 0; i < 7; ++i) { mom = create_utc__createUTC([2000, 1]).day(i); this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase(); this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase(); this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); } } if (strict) { if (format === 'dddd') { ii = indexOf.call(this._weekdaysParse, llc); return ii !== -1 ? ii : null; } else if (format === 'ddd') { ii = indexOf.call(this._shortWeekdaysParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } } else { if (format === 'dddd') { ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } else if (format === 'ddd') { ii = indexOf.call(this._shortWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._minWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortWeekdaysParse, llc); return ii !== -1 ? ii : null; } } } function localeWeekdaysParse (weekdayName, format, strict) { var i, mom, regex; if (this._weekdaysParseExact) { return day_of_week__handleStrictParse.call(this, weekdayName, format, strict); } if (!this._weekdaysParse) { this._weekdaysParse = []; this._minWeekdaysParse = []; this._shortWeekdaysParse = []; this._fullWeekdaysParse = []; } for (i = 0; i < 7; i++) { // make the regex if we don't have it already mom = create_utc__createUTC([2000, 1]).day(i); if (strict && !this._fullWeekdaysParse[i]) { this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i'); this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i'); this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i'); } if (!this._weekdaysParse[i]) { regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) { return i; } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) { return i; } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) { return i; } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { return i; } } } // MOMENTS function getSetDayOfWeek (input) { if (!this.isValid()) { return input != null ? this : NaN; } var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); if (input != null) { input = parseWeekday(input, this.localeData()); return this.add(input - day, 'd'); } else { return day; } } function getSetLocaleDayOfWeek (input) { if (!this.isValid()) { return input != null ? this : NaN; } var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return input == null ? weekday : this.add(input - weekday, 'd'); } function getSetISODayOfWeek (input) { if (!this.isValid()) { return input != null ? this : NaN; } // behaves the same as moment#day except // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) // as a setter, sunday should belong to the previous week. return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); } var defaultWeekdaysRegex = matchWord; function weekdaysRegex (isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, '_weekdaysRegex')) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysStrictRegex; } else { return this._weekdaysRegex; } } else { return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex; } } var defaultWeekdaysShortRegex = matchWord; function weekdaysShortRegex (isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, '_weekdaysRegex')) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysShortStrictRegex; } else { return this._weekdaysShortRegex; } } else { return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex; } } var defaultWeekdaysMinRegex = matchWord; function weekdaysMinRegex (isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, '_weekdaysRegex')) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysMinStrictRegex; } else { return this._weekdaysMinRegex; } } else { return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex; } } function computeWeekdaysParse () { function cmpLenRev(a, b) { return b.length - a.length; } var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], i, mom, minp, shortp, longp; for (i = 0; i < 7; i++) { // make the regex if we don't have it already mom = create_utc__createUTC([2000, 1]).day(i); minp = this.weekdaysMin(mom, ''); shortp = this.weekdaysShort(mom, ''); longp = this.weekdays(mom, ''); minPieces.push(minp); shortPieces.push(shortp); longPieces.push(longp); mixedPieces.push(minp); mixedPieces.push(shortp); mixedPieces.push(longp); } // Sorting makes sure if one weekday (or abbr) is a prefix of another it // will match the longer piece. minPieces.sort(cmpLenRev); shortPieces.sort(cmpLenRev); longPieces.sort(cmpLenRev); mixedPieces.sort(cmpLenRev); for (i = 0; i < 7; i++) { shortPieces[i] = regexEscape(shortPieces[i]); longPieces[i] = regexEscape(longPieces[i]); mixedPieces[i] = regexEscape(mixedPieces[i]); } this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); this._weekdaysShortRegex = this._weekdaysRegex; this._weekdaysMinRegex = this._weekdaysRegex; this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i'); } // FORMATTING addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); // ALIASES addUnitAlias('dayOfYear', 'DDD'); // PARSING addRegexToken('DDD', match1to3); addRegexToken('DDDD', match3); addParseToken(['DDD', 'DDDD'], function (input, array, config) { config._dayOfYear = toInt(input); }); // HELPERS // MOMENTS function getSetDayOfYear (input) { var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); } // FORMATTING function hFormat() { return this.hours() % 12 || 12; } function kFormat() { return this.hours() || 24; } addFormatToken('H', ['HH', 2], 0, 'hour'); addFormatToken('h', ['hh', 2], 0, hFormat); addFormatToken('k', ['kk', 2], 0, kFormat); addFormatToken('hmm', 0, 0, function () { return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); }); addFormatToken('hmmss', 0, 0, function () { return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2); }); addFormatToken('Hmm', 0, 0, function () { return '' + this.hours() + zeroFill(this.minutes(), 2); }); addFormatToken('Hmmss', 0, 0, function () { return '' + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2); }); function meridiem (token, lowercase) { addFormatToken(token, 0, 0, function () { return this.localeData().meridiem(this.hours(), this.minutes(), lowercase); }); } meridiem('a', true); meridiem('A', false); // ALIASES addUnitAlias('hour', 'h'); // PARSING function matchMeridiem (isStrict, locale) { return locale._meridiemParse; } addRegexToken('a', matchMeridiem); addRegexToken('A', matchMeridiem); addRegexToken('H', match1to2); addRegexToken('h', match1to2); addRegexToken('HH', match1to2, match2); addRegexToken('hh', match1to2, match2); addRegexToken('hmm', match3to4); addRegexToken('hmmss', match5to6); addRegexToken('Hmm', match3to4); addRegexToken('Hmmss', match5to6); addParseToken(['H', 'HH'], HOUR); addParseToken(['a', 'A'], function (input, array, config) { config._isPm = config._locale.isPM(input); config._meridiem = input; }); addParseToken(['h', 'hh'], function (input, array, config) { array[HOUR] = toInt(input); getParsingFlags(config).bigHour = true; }); addParseToken('hmm', function (input, array, config) { var pos = input.length - 2; array[HOUR] = toInt(input.substr(0, pos)); array[MINUTE] = toInt(input.substr(pos)); getParsingFlags(config).bigHour = true; }); addParseToken('hmmss', function (input, array, config) { var pos1 = input.length - 4; var pos2 = input.length - 2; array[HOUR] = toInt(input.substr(0, pos1)); array[MINUTE] = toInt(input.substr(pos1, 2)); array[SECOND] = toInt(input.substr(pos2)); getParsingFlags(config).bigHour = true; }); addParseToken('Hmm', function (input, array, config) { var pos = input.length - 2; array[HOUR] = toInt(input.substr(0, pos)); array[MINUTE] = toInt(input.substr(pos)); }); addParseToken('Hmmss', function (input, array, config) { var pos1 = input.length - 4; var pos2 = input.length - 2; array[HOUR] = toInt(input.substr(0, pos1)); array[MINUTE] = toInt(input.substr(pos1, 2)); array[SECOND] = toInt(input.substr(pos2)); }); // LOCALES function localeIsPM (input) { // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays // Using charAt should be more compatible. return ((input + '').toLowerCase().charAt(0) === 'p'); } var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i; function localeMeridiem (hours, minutes, isLower) { if (hours > 11) { return isLower ? 'pm' : 'PM'; } else { return isLower ? 'am' : 'AM'; } } // MOMENTS // Setting the hour should keep the time, because the user explicitly // specified which hour he wants. So trying to maintain the same hour (in // a new timezone) makes sense. Adding/subtracting hours does not follow // this rule. var getSetHour = makeGetSet('Hours', true); // FORMATTING addFormatToken('m', ['mm', 2], 0, 'minute'); // ALIASES addUnitAlias('minute', 'm'); // PARSING addRegexToken('m', match1to2); addRegexToken('mm', match1to2, match2); addParseToken(['m', 'mm'], MINUTE); // MOMENTS var getSetMinute = makeGetSet('Minutes', false); // FORMATTING addFormatToken('s', ['ss', 2], 0, 'second'); // ALIASES addUnitAlias('second', 's'); // PARSING addRegexToken('s', match1to2); addRegexToken('ss', match1to2, match2); addParseToken(['s', 'ss'], SECOND); // MOMENTS var getSetSecond = makeGetSet('Seconds', false); // FORMATTING addFormatToken('S', 0, 0, function () { return ~~(this.millisecond() / 100); }); addFormatToken(0, ['SS', 2], 0, function () { return ~~(this.millisecond() / 10); }); addFormatToken(0, ['SSS', 3], 0, 'millisecond'); addFormatToken(0, ['SSSS', 4], 0, function () { return this.millisecond() * 10; }); addFormatToken(0, ['SSSSS', 5], 0, function () { return this.millisecond() * 100; }); addFormatToken(0, ['SSSSSS', 6], 0, function () { return this.millisecond() * 1000; }); addFormatToken(0, ['SSSSSSS', 7], 0, function () { return this.millisecond() * 10000; }); addFormatToken(0, ['SSSSSSSS', 8], 0, function () { return this.millisecond() * 100000; }); addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { return this.millisecond() * 1000000; }); // ALIASES addUnitAlias('millisecond', 'ms'); // PARSING addRegexToken('S', match1to3, match1); addRegexToken('SS', match1to3, match2); addRegexToken('SSS', match1to3, match3); var token; for (token = 'SSSS'; token.length <= 9; token += 'S') { addRegexToken(token, matchUnsigned); } function parseMs(input, array) { array[MILLISECOND] = toInt(('0.' + input) * 1000); } for (token = 'S'; token.length <= 9; token += 'S') { addParseToken(token, parseMs); } // MOMENTS var getSetMillisecond = makeGetSet('Milliseconds', false); // FORMATTING addFormatToken('z', 0, 0, 'zoneAbbr'); addFormatToken('zz', 0, 0, 'zoneName'); // MOMENTS function getZoneAbbr () { return this._isUTC ? 'UTC' : ''; } function getZoneName () { return this._isUTC ? 'Coordinated Universal Time' : ''; } var momentPrototype__proto = Moment.prototype; momentPrototype__proto.add = add_subtract__add; momentPrototype__proto.calendar = moment_calendar__calendar; momentPrototype__proto.clone = clone; momentPrototype__proto.diff = diff; momentPrototype__proto.endOf = endOf; momentPrototype__proto.format = format; momentPrototype__proto.from = from; momentPrototype__proto.fromNow = fromNow; momentPrototype__proto.to = to; momentPrototype__proto.toNow = toNow; momentPrototype__proto.get = getSet; momentPrototype__proto.invalidAt = invalidAt; momentPrototype__proto.isAfter = isAfter; momentPrototype__proto.isBefore = isBefore; momentPrototype__proto.isBetween = isBetween; momentPrototype__proto.isSame = isSame; momentPrototype__proto.isSameOrAfter = isSameOrAfter; momentPrototype__proto.isSameOrBefore = isSameOrBefore; momentPrototype__proto.isValid = moment_valid__isValid; momentPrototype__proto.lang = lang; momentPrototype__proto.locale = locale; momentPrototype__proto.localeData = localeData; momentPrototype__proto.max = prototypeMax; momentPrototype__proto.min = prototypeMin; momentPrototype__proto.parsingFlags = parsingFlags; momentPrototype__proto.set = getSet; momentPrototype__proto.startOf = startOf; momentPrototype__proto.subtract = add_subtract__subtract; momentPrototype__proto.toArray = toArray; momentPrototype__proto.toObject = toObject; momentPrototype__proto.toDate = toDate; momentPrototype__proto.toISOString = moment_format__toISOString; momentPrototype__proto.toJSON = toJSON; momentPrototype__proto.toString = toString; momentPrototype__proto.unix = unix; momentPrototype__proto.valueOf = to_type__valueOf; momentPrototype__proto.creationData = creationData; // Year momentPrototype__proto.year = getSetYear; momentPrototype__proto.isLeapYear = getIsLeapYear; // Week Year momentPrototype__proto.weekYear = getSetWeekYear; momentPrototype__proto.isoWeekYear = getSetISOWeekYear; // Quarter momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter; // Month momentPrototype__proto.month = getSetMonth; momentPrototype__proto.daysInMonth = getDaysInMonth; // Week momentPrototype__proto.week = momentPrototype__proto.weeks = getSetWeek; momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = getSetISOWeek; momentPrototype__proto.weeksInYear = getWeeksInYear; momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear; // Day momentPrototype__proto.date = getSetDayOfMonth; momentPrototype__proto.day = momentPrototype__proto.days = getSetDayOfWeek; momentPrototype__proto.weekday = getSetLocaleDayOfWeek; momentPrototype__proto.isoWeekday = getSetISODayOfWeek; momentPrototype__proto.dayOfYear = getSetDayOfYear; // Hour momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour; // Minute momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute; // Second momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond; // Millisecond momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond; // Offset momentPrototype__proto.utcOffset = getSetOffset; momentPrototype__proto.utc = setOffsetToUTC; momentPrototype__proto.local = setOffsetToLocal; momentPrototype__proto.parseZone = setOffsetToParsedOffset; momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset; momentPrototype__proto.isDST = isDaylightSavingTime; momentPrototype__proto.isDSTShifted = isDaylightSavingTimeShifted; momentPrototype__proto.isLocal = isLocal; momentPrototype__proto.isUtcOffset = isUtcOffset; momentPrototype__proto.isUtc = isUtc; momentPrototype__proto.isUTC = isUtc; // Timezone momentPrototype__proto.zoneAbbr = getZoneAbbr; momentPrototype__proto.zoneName = getZoneName; // Deprecations momentPrototype__proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth); momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth); momentPrototype__proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear); momentPrototype__proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779', getSetZone); var momentPrototype = momentPrototype__proto; function moment__createUnix (input) { return local__createLocal(input * 1000); } function moment__createInZone () { return local__createLocal.apply(null, arguments).parseZone(); } var defaultCalendar = { sameDay : '[Today at] LT', nextDay : '[Tomorrow at] LT', nextWeek : 'dddd [at] LT', lastDay : '[Yesterday at] LT', lastWeek : '[Last] dddd [at] LT', sameElse : 'L' }; function locale_calendar__calendar (key, mom, now) { var output = this._calendar[key]; return isFunction(output) ? output.call(mom, now) : output; } var defaultLongDateFormat = { LTS : 'h:mm:ss A', LT : 'h:mm A', L : 'MM/DD/YYYY', LL : 'MMMM D, YYYY', LLL : 'MMMM D, YYYY h:mm A', LLLL : 'dddd, MMMM D, YYYY h:mm A' }; function longDateFormat (key) { var format = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()]; if (format || !formatUpper) { return format; } this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) { return val.slice(1); }); return this._longDateFormat[key]; } var defaultInvalidDate = 'Invalid date'; function invalidDate () { return this._invalidDate; } var defaultOrdinal = '%d'; var defaultOrdinalParse = /\d{1,2}/; function ordinal (number) { return this._ordinal.replace('%d', number); } function preParsePostFormat (string) { return string; } var defaultRelativeTime = { future : 'in %s', past : '%s ago', s : 'a few seconds', m : 'a minute', mm : '%d minutes', h : 'an hour', hh : '%d hours', d : 'a day', dd : '%d days', M : 'a month', MM : '%d months', y : 'a year', yy : '%d years' }; function relative__relativeTime (number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; return (isFunction(output)) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); } function pastFuture (diff, output) { var format = this._relativeTime[diff > 0 ? 'future' : 'past']; return isFunction(format) ? format(output) : format.replace(/%s/i, output); } var prototype__proto = Locale.prototype; prototype__proto._calendar = defaultCalendar; prototype__proto.calendar = locale_calendar__calendar; prototype__proto._longDateFormat = defaultLongDateFormat; prototype__proto.longDateFormat = longDateFormat; prototype__proto._invalidDate = defaultInvalidDate; prototype__proto.invalidDate = invalidDate; prototype__proto._ordinal = defaultOrdinal; prototype__proto.ordinal = ordinal; prototype__proto._ordinalParse = defaultOrdinalParse; prototype__proto.preparse = preParsePostFormat; prototype__proto.postformat = preParsePostFormat; prototype__proto._relativeTime = defaultRelativeTime; prototype__proto.relativeTime = relative__relativeTime; prototype__proto.pastFuture = pastFuture; prototype__proto.set = locale_set__set; // Month prototype__proto.months = localeMonths; prototype__proto._months = defaultLocaleMonths; prototype__proto.monthsShort = localeMonthsShort; prototype__proto._monthsShort = defaultLocaleMonthsShort; prototype__proto.monthsParse = localeMonthsParse; prototype__proto._monthsRegex = defaultMonthsRegex; prototype__proto.monthsRegex = monthsRegex; prototype__proto._monthsShortRegex = defaultMonthsShortRegex; prototype__proto.monthsShortRegex = monthsShortRegex; // Week prototype__proto.week = localeWeek; prototype__proto._week = defaultLocaleWeek; prototype__proto.firstDayOfYear = localeFirstDayOfYear; prototype__proto.firstDayOfWeek = localeFirstDayOfWeek; // Day of Week prototype__proto.weekdays = localeWeekdays; prototype__proto._weekdays = defaultLocaleWeekdays; prototype__proto.weekdaysMin = localeWeekdaysMin; prototype__proto._weekdaysMin = defaultLocaleWeekdaysMin; prototype__proto.weekdaysShort = localeWeekdaysShort; prototype__proto._weekdaysShort = defaultLocaleWeekdaysShort; prototype__proto.weekdaysParse = localeWeekdaysParse; prototype__proto._weekdaysRegex = defaultWeekdaysRegex; prototype__proto.weekdaysRegex = weekdaysRegex; prototype__proto._weekdaysShortRegex = defaultWeekdaysShortRegex; prototype__proto.weekdaysShortRegex = weekdaysShortRegex; prototype__proto._weekdaysMinRegex = defaultWeekdaysMinRegex; prototype__proto.weekdaysMinRegex = weekdaysMinRegex; // Hours prototype__proto.isPM = localeIsPM; prototype__proto._meridiemParse = defaultLocaleMeridiemParse; prototype__proto.meridiem = localeMeridiem; function lists__get (format, index, field, setter) { var locale = locale_locales__getLocale(); var utc = create_utc__createUTC().set(setter, index); return locale[field](utc, format); } function listMonthsImpl (format, index, field) { if (typeof format === 'number') { index = format; format = undefined; } format = format || ''; if (index != null) { return lists__get(format, index, field, 'month'); } var i; var out = []; for (i = 0; i < 12; i++) { out[i] = lists__get(format, i, field, 'month'); } return out; } // () // (5) // (fmt, 5) // (fmt) // (true) // (true, 5) // (true, fmt, 5) // (true, fmt) function listWeekdaysImpl (localeSorted, format, index, field) { if (typeof localeSorted === 'boolean') { if (typeof format === 'number') { index = format; format = undefined; } format = format || ''; } else { format = localeSorted; index = format; localeSorted = false; if (typeof format === 'number') { index = format; format = undefined; } format = format || ''; } var locale = locale_locales__getLocale(), shift = localeSorted ? locale._week.dow : 0; if (index != null) { return lists__get(format, (index + shift) % 7, field, 'day'); } var i; var out = []; for (i = 0; i < 7; i++) { out[i] = lists__get(format, (i + shift) % 7, field, 'day'); } return out; } function lists__listMonths (format, index) { return listMonthsImpl(format, index, 'months'); } function lists__listMonthsShort (format, index) { return listMonthsImpl(format, index, 'monthsShort'); } function lists__listWeekdays (localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); } function lists__listWeekdaysShort (localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); } function lists__listWeekdaysMin (localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); } locale_locales__getSetGlobalLocale('en', { ordinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal : function (number) { var b = number % 10, output = (toInt(number % 100 / 10) === 1) ? 'th' : (b === 1) ? 'st' : (b === 2) ? 'nd' : (b === 3) ? 'rd' : 'th'; return number + output; } }); // Side effect imports utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale); utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale); var mathAbs = Math.abs; function duration_abs__abs () { var data = this._data; this._milliseconds = mathAbs(this._milliseconds); this._days = mathAbs(this._days); this._months = mathAbs(this._months); data.milliseconds = mathAbs(data.milliseconds); data.seconds = mathAbs(data.seconds); data.minutes = mathAbs(data.minutes); data.hours = mathAbs(data.hours); data.months = mathAbs(data.months); data.years = mathAbs(data.years); return this; } function duration_add_subtract__addSubtract (duration, input, value, direction) { var other = create__createDuration(input, value); duration._milliseconds += direction * other._milliseconds; duration._days += direction * other._days; duration._months += direction * other._months; return duration._bubble(); } // supports only 2.0-style add(1, 's') or add(duration) function duration_add_subtract__add (input, value) { return duration_add_subtract__addSubtract(this, input, value, 1); } // supports only 2.0-style subtract(1, 's') or subtract(duration) function duration_add_subtract__subtract (input, value) { return duration_add_subtract__addSubtract(this, input, value, -1); } function absCeil (number) { if (number < 0) { return Math.floor(number); } else { return Math.ceil(number); } } function bubble () { var milliseconds = this._milliseconds; var days = this._days; var months = this._months; var data = this._data; var seconds, minutes, hours, years, monthsFromDays; // if we have a mix of positive and negative values, bubble down first // check: https://github.com/moment/moment/issues/2166 if (!((milliseconds >= 0 && days >= 0 && months >= 0) || (milliseconds <= 0 && days <= 0 && months <= 0))) { milliseconds += absCeil(monthsToDays(months) + days) * 864e5; days = 0; months = 0; } // The following code bubbles up values, see the tests for // examples of what that means. data.milliseconds = milliseconds % 1000; seconds = absFloor(milliseconds / 1000); data.seconds = seconds % 60; minutes = absFloor(seconds / 60); data.minutes = minutes % 60; hours = absFloor(minutes / 60); data.hours = hours % 24; days += absFloor(hours / 24); // convert days to months monthsFromDays = absFloor(daysToMonths(days)); months += monthsFromDays; days -= absCeil(monthsToDays(monthsFromDays)); // 12 months -> 1 year years = absFloor(months / 12); months %= 12; data.days = days; data.months = months; data.years = years; return this; } function daysToMonths (days) { // 400 years have 146097 days (taking into account leap year rules) // 400 years have 12 months === 4800 return days * 4800 / 146097; } function monthsToDays (months) { // the reverse of daysToMonths return months * 146097 / 4800; } function as (units) { var days; var months; var milliseconds = this._milliseconds; units = normalizeUnits(units); if (units === 'month' || units === 'year') { days = this._days + milliseconds / 864e5; months = this._months + daysToMonths(days); return units === 'month' ? months : months / 12; } else { // handle milliseconds separately because of floating point math errors (issue #1867) days = this._days + Math.round(monthsToDays(this._months)); switch (units) { case 'week' : return days / 7 + milliseconds / 6048e5; case 'day' : return days + milliseconds / 864e5; case 'hour' : return days * 24 + milliseconds / 36e5; case 'minute' : return days * 1440 + milliseconds / 6e4; case 'second' : return days * 86400 + milliseconds / 1000; // Math.floor prevents floating point math errors here case 'millisecond': return Math.floor(days * 864e5) + milliseconds; default: throw new Error('Unknown unit ' + units); } } } // TODO: Use this.as('ms')? function duration_as__valueOf () { return ( this._milliseconds + this._days * 864e5 + (this._months % 12) * 2592e6 + toInt(this._months / 12) * 31536e6 ); } function makeAs (alias) { return function () { return this.as(alias); }; } var asMilliseconds = makeAs('ms'); var asSeconds = makeAs('s'); var asMinutes = makeAs('m'); var asHours = makeAs('h'); var asDays = makeAs('d'); var asWeeks = makeAs('w'); var asMonths = makeAs('M'); var asYears = makeAs('y'); function duration_get__get (units) { units = normalizeUnits(units); return this[units + 's'](); } function makeGetter(name) { return function () { return this._data[name]; }; } var milliseconds = makeGetter('milliseconds'); var seconds = makeGetter('seconds'); var minutes = makeGetter('minutes'); var hours = makeGetter('hours'); var days = makeGetter('days'); var months = makeGetter('months'); var years = makeGetter('years'); function weeks () { return absFloor(this.days() / 7); } var round = Math.round; var thresholds = { s: 45, // seconds to minute m: 45, // minutes to hour h: 22, // hours to day d: 26, // days to month M: 11 // months to year }; // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); } function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) { var duration = create__createDuration(posNegDuration).abs(); var seconds = round(duration.as('s')); var minutes = round(duration.as('m')); var hours = round(duration.as('h')); var days = round(duration.as('d')); var months = round(duration.as('M')); var years = round(duration.as('y')); var a = seconds < thresholds.s && ['s', seconds] || minutes <= 1 && ['m'] || minutes < thresholds.m && ['mm', minutes] || hours <= 1 && ['h'] || hours < thresholds.h && ['hh', hours] || days <= 1 && ['d'] || days < thresholds.d && ['dd', days] || months <= 1 && ['M'] || months < thresholds.M && ['MM', months] || years <= 1 && ['y'] || ['yy', years]; a[2] = withoutSuffix; a[3] = +posNegDuration > 0; a[4] = locale; return substituteTimeAgo.apply(null, a); } // This function allows you to set a threshold for relative time strings function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) { if (thresholds[threshold] === undefined) { return false; } if (limit === undefined) { return thresholds[threshold]; } thresholds[threshold] = limit; return true; } function humanize (withSuffix) { var locale = this.localeData(); var output = duration_humanize__relativeTime(this, !withSuffix, locale); if (withSuffix) { output = locale.pastFuture(+this, output); } return locale.postformat(output); } var iso_string__abs = Math.abs; function iso_string__toISOString() { // for ISO strings we do not use the normal bubbling rules: // * milliseconds bubble up until they become hours // * days do not bubble at all // * months bubble up until they become years // This is because there is no context-free conversion between hours and days // (think of clock changes) // and also not between days and months (28-31 days per month) var seconds = iso_string__abs(this._milliseconds) / 1000; var days = iso_string__abs(this._days); var months = iso_string__abs(this._months); var minutes, hours, years; // 3600 seconds -> 60 minutes -> 1 hour minutes = absFloor(seconds / 60); hours = absFloor(minutes / 60); seconds %= 60; minutes %= 60; // 12 months -> 1 year years = absFloor(months / 12); months %= 12; // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js var Y = years; var M = months; var D = days; var h = hours; var m = minutes; var s = seconds; var total = this.asSeconds(); if (!total) { // this is the same as C#'s (Noda) and python (isodate)... // but not other JS (goog.date) return 'P0D'; } return (total < 0 ? '-' : '') + 'P' + (Y ? Y + 'Y' : '') + (M ? M + 'M' : '') + (D ? D + 'D' : '') + ((h || m || s) ? 'T' : '') + (h ? h + 'H' : '') + (m ? m + 'M' : '') + (s ? s + 'S' : ''); } var duration_prototype__proto = Duration.prototype; duration_prototype__proto.abs = duration_abs__abs; duration_prototype__proto.add = duration_add_subtract__add; duration_prototype__proto.subtract = duration_add_subtract__subtract; duration_prototype__proto.as = as; duration_prototype__proto.asMilliseconds = asMilliseconds; duration_prototype__proto.asSeconds = asSeconds; duration_prototype__proto.asMinutes = asMinutes; duration_prototype__proto.asHours = asHours; duration_prototype__proto.asDays = asDays; duration_prototype__proto.asWeeks = asWeeks; duration_prototype__proto.asMonths = asMonths; duration_prototype__proto.asYears = asYears; duration_prototype__proto.valueOf = duration_as__valueOf; duration_prototype__proto._bubble = bubble; duration_prototype__proto.get = duration_get__get; duration_prototype__proto.milliseconds = milliseconds; duration_prototype__proto.seconds = seconds; duration_prototype__proto.minutes = minutes; duration_prototype__proto.hours = hours; duration_prototype__proto.days = days; duration_prototype__proto.weeks = weeks; duration_prototype__proto.months = months; duration_prototype__proto.years = years; duration_prototype__proto.humanize = humanize; duration_prototype__proto.toISOString = iso_string__toISOString; duration_prototype__proto.toString = iso_string__toISOString; duration_prototype__proto.toJSON = iso_string__toISOString; duration_prototype__proto.locale = locale; duration_prototype__proto.localeData = localeData; // Deprecations duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString); duration_prototype__proto.lang = lang; // Side effect imports // FORMATTING addFormatToken('X', 0, 0, 'unix'); addFormatToken('x', 0, 0, 'valueOf'); // PARSING addRegexToken('x', matchSigned); addRegexToken('X', matchTimestamp); addParseToken('X', function (input, array, config) { config._d = new Date(parseFloat(input, 10) * 1000); }); addParseToken('x', function (input, array, config) { config._d = new Date(toInt(input)); }); // Side effect imports utils_hooks__hooks.version = '2.13.0'; setHookCallback(local__createLocal); utils_hooks__hooks.fn = momentPrototype; utils_hooks__hooks.min = min; utils_hooks__hooks.max = max; utils_hooks__hooks.now = now; utils_hooks__hooks.utc = create_utc__createUTC; utils_hooks__hooks.unix = moment__createUnix; utils_hooks__hooks.months = lists__listMonths; utils_hooks__hooks.isDate = isDate; utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale; utils_hooks__hooks.invalid = valid__createInvalid; utils_hooks__hooks.duration = create__createDuration; utils_hooks__hooks.isMoment = isMoment; utils_hooks__hooks.weekdays = lists__listWeekdays; utils_hooks__hooks.parseZone = moment__createInZone; utils_hooks__hooks.localeData = locale_locales__getLocale; utils_hooks__hooks.isDuration = isDuration; utils_hooks__hooks.monthsShort = lists__listMonthsShort; utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin; utils_hooks__hooks.defineLocale = defineLocale; utils_hooks__hooks.updateLocale = updateLocale; utils_hooks__hooks.locales = locale_locales__listLocales; utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort; utils_hooks__hooks.normalizeUnits = normalizeUnits; utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold; utils_hooks__hooks.prototype = momentPrototype; var _moment = utils_hooks__hooks; return _moment; })); },{}],239:[function(require,module,exports){ // If `Date.now()` is invoked twice quickly, it's possible to get two // identical time stamps. To avoid generation duplications, subsequent // calls are manually ordered to force uniqueness. var _last = 0 var _count = 1 var adjusted = 0 var _adjusted = 0 module.exports = function timestamp() { /** Returns NOT an accurate representation of the current time. Since js only measures time as ms, if you call `Date.now()` twice quickly, it's possible to get two identical time stamps. This function guarantees unique but maybe inaccurate results on each call. **/ //uncomment this wen var time = Date.now() //time = ~~ (time / 1000) //^^^uncomment when testing... /** If time returned is same as in last call, adjust it by adding a number based on the counter. Counter is incremented so that next call get's adjusted properly. Because floats have restricted precision, may need to step past some values... **/ if (_last === time) { do { adjusted = time + ((_count++) / (_count + 999)) } while (adjusted === _adjusted) _adjusted = adjusted } // If last time was different reset timer back to `1`. else { _count = 1 adjusted = time } _adjusted = adjusted _last = time return adjusted } },{}],240:[function(require,module,exports){ var assert = require('assert') var separator = '~', escape = '!' var SE = require('separator-escape')(separator, escape) var isArray = Array.isArray function isFunction (f) { return 'function' === typeof f } function isString (s) { return 'string' === typeof s } function head (opts) { return isArray(opts) ? opts[0] : opts } function tail (opts) { return isArray(opts) ? opts.slice(1) : [] } function compose (stream, transforms, cb) { ;(function next (err, stream, i) { if(err) return cb(err) else if(i >= transforms.length) return cb(null, stream) else transforms[i](stream, function (err, stream) { next(err, stream, i+1) }) })(null, stream, 0) } module.exports = function (ary) { var proto = head(ary) var trans = tail(ary) function parse (str) { var parts = SE.parse(str) var out = [] for(var i = 0; i < parts.length; i++) { var v = ary[i].parse(parts[i]) if(!v) return null out[i] = v } return out } function parseMaybe (str) { return isString(str) ? parse(str) : str } return { name: ary.map(function (e) { return e.name }).join(separator), client: function (_opts, cb) { var opts = parseMaybe(_opts) if(!opts) return cb(new Error('could not parse address:'+_opts)) proto.client(head(opts), function (err, stream) { if(err) return cb(err) compose( stream, trans.map(function (tr, i) { return tr.create(opts[i+1]) }), cb ) }) }, server: function (onConnection, onError) { onError = onError || function (err) { console.error('server error', err.stack) } return proto.server(function (stream) { compose( stream, trans.map(function (tr) { return tr.create() }), function (err, stream) { if(err) onError(err) else onConnection(stream) } ) }) }, parse: parse, stringify: function () { return SE.stringify(ary.map(function (e) { return e.stringify() })) } } } },{"assert":16,"separator-escape":329}],241:[function(require,module,exports){ var compose = require('./compose') var isArray = Array.isArray function split(str) { return isArray(str) ? str : str.split(';') } module.exports = function (plugs) { plugs = plugs.map(function (e) { return isArray(e) ? compose(e) : e }) return { name: plugs.map(function (e) { return e.name }).join(';'), client: function (addr, cb) { var plug split(addr).find(function (addr) { //connect with the first plug that understands this string. plug = plugs.find(function (plug) { return plug.parse(addr) }) }) if(plug) plug.client(addr, cb) else cb(new Error('could not connect to one of:'+addr)) }, server: function (onConnect, onError) { //start all servers var closes = plugs.map(function (plug) { return plug.server(onConnect, onError) }) return function () { closes.forEach(function (close) { close() }) } }, stringify: function () { return plugs.map(function (plug) { return plug.stringify() }).join(';') }, //parse doesn't really make sense here... //like, what if you only have a partial match? //maybe just parse the ones you understand? parse: function (str) { return str.split(';').map(function (e, i) { return plugs[i].parse(e) }) } } } },{"./compose":240}],242:[function(require,module,exports){ var pull = require('pull-stream') var Handshake = require('pull-handshake') var State = require('./state') var challenge_length = 64 var client_auth_length = 16+32+64 var server_auth_length = 16+64 var mac_length = 16 //client is Alice //create the client stream with the public key you expect to connect to. exports.client = exports.createClientStream = function (alice, app_key, timeout) { return function (bob_pub, seed, cb) { if('function' == typeof seed) cb = seed, seed = null //alice may be null. var state = new State(app_key, alice, bob_pub, seed) var stream = Handshake({timeout: timeout}, cb) var shake = stream.handshake delete stream.handshake function abort(err, reason) { if(err && err !== true) shake.abort(err, cb) else shake.abort(new Error(reason), cb) } shake.write(state.createChallenge()) shake.read(challenge_length, function (err, msg) { if(err) return abort(err, 'challenge not accepted') //create the challenge first, because we need to generate a local key if(!state.verifyChallenge(msg)) return abort(null, 'wrong protocol (version?)') shake.write(state.createClientAuth()) shake.read(server_auth_length, function (err, boxed_sig) { if(err) return abort(err, 'hello not accepted') if(!state.verifyServerAccept(boxed_sig)) return abort(null, 'server not authenticated') cb(null, shake.rest(), state.cleanSecrets()) }) }) return stream } } //server is Bob. exports.server = exports.createServerStream = function (bob, authorize, app_key, timeout) { return function (cb) { var state = new State(app_key, bob) var stream = Handshake({timeout: timeout}, cb) var shake = stream.handshake delete stream.handshake function abort (err, reason) { if(err && err !== true) shake.abort(err, cb) else shake.abort(new Error(reason), cb) } shake.read(challenge_length, function (err, challenge) { if(err) return abort(err, 'expected challenge') if(!state.verifyChallenge(challenge)) return shake.abort(new Error('wrong protocol/version')) shake.write(state.createChallenge()) shake.read(client_auth_length, function (err, hello) { if(err) return abort(err, 'expected hello') if(!state.verifyClientAuth(hello)) { //we know who the client was, but chose not to answer: if(state.remote.public) return abort(null, 'unauthenticated client:' + state.remote.public.toString('hex'), cb) //client dialed wrong number... (we don't know who they where) else return abort(null, 'wrong number') } //check if the user wants to speak to alice. authorize(state.remote.public, function (err, auth) { if(auth == null && !err) err = new Error('client unauthorized') if(!auth) return abort(err, 'client authentication rejected') state.auth = auth shake.write(state.createServerAccept()) cb(null, shake.rest(), state.cleanSecrets()) }) }) }) return stream } } },{"./state":245,"pull-handshake":274,"pull-stream":284}],243:[function(require,module,exports){ (function (Buffer){ var handshake = require('./handshake') var secure = require('./secure') var cl = require('chloride') function isBuffer(buf, len) { return Buffer.isBuffer(buf) && buf.length === len } exports.client = exports.createClient = function (alice, app_key, timeout) { var create = handshake.client(alice, app_key, timeout) return function (bob, seed, cb) { if(!isBuffer(bob, 32)) throw new Error('createClient *must* be passed a public key') if('function' === typeof seed) return create(bob, secure(seed)) else return create(bob, seed, secure(cb)) } } exports.server = exports.createServer = function (bob, authorize, app_key, timeout) { var create = handshake.server(bob, authorize, app_key, timeout) return function (cb) { return create(secure(cb)) } } }).call(this,{"isBuffer":require("../../../../../../.nvm/versions/node/v6.2.0/lib/node_modules/browserify/node_modules/is-buffer/index.js")}) },{"../../../../../../.nvm/versions/node/v6.2.0/lib/node_modules/browserify/node_modules/is-buffer/index.js":96,"./handshake":242,"./secure":244,"chloride":155}],244:[function(require,module,exports){ (function (Buffer){ var sodium = require('chloride') var hash = sodium.crypto_hash_sha256 var pull = require('pull-stream') var boxes = require('pull-box-stream') var concat = Buffer.concat module.exports = function (cb) { return function (err, stream, state) { if(err) return cb(err) var en_key = hash(concat([state.secret, state.remote.public])) var de_key = hash(concat([state.secret, state.local.public])) var en_nonce = state.remote.app_mac.slice(0, 24) var de_nonce = state.local.app_mac.slice(0, 24) cb(null, { remote: state.remote.public, //on the server, attach any metadata gathered //during `authorize` call auth: state.auth, source: pull( stream.source, boxes.createUnboxStream(de_key, de_nonce) ), sink: pull( boxes.createBoxStream(en_key, en_nonce), stream.sink ) }) } } }).call(this,require("buffer").Buffer) },{"buffer":47,"chloride":155,"pull-box-stream":265,"pull-stream":284}],245:[function(require,module,exports){ (function (Buffer){ var sodium = require('chloride') var keypair = sodium.crypto_box_keypair var from_seed = sodium.crypto_sign_seed_keypair var shared = sodium.crypto_scalarmult var hash = sodium.crypto_hash_sha256 var sign = sodium.crypto_sign_detached var verify = sodium.crypto_sign_verify_detached var auth = sodium.crypto_auth var verify_auth = sodium.crypto_auth_verify var curvify_pk = sodium.crypto_sign_ed25519_pk_to_curve25519 var curvify_sk = sodium.crypto_sign_ed25519_sk_to_curve25519 var box = sodium.crypto_secretbox_easy var unbox = sodium.crypto_secretbox_open_easy var concat = Buffer.concat var nonce = new Buffer(24); nonce.fill(0) var challenge_length = 64 var client_auth_length = 16+32+64 var server_auth_length = 16+64 var mac_length = 16 //this is a simple secure handshake, //the client public key is passed in plain text, module.exports = State function State (app_key, local, remote, seed) { if(!(this instanceof State)) return new State(app_key, local, remote, seed) if(seed) local = from_seed(seed) this.app_key = app_key var kx = keypair() this.local = { kx_pk: kx.publicKey, kx_sk: kx.secretKey, public: local.publicKey, secret: local.secretKey } this.remote = { public: remote || null } } var proto = State.prototype proto.createChallenge = function createChallenge () { var state = this state.local.app_mac = auth(state.local.kx_pk, state.app_key) return concat([state.local.app_mac, state.local.kx_pk]) } proto.verifyChallenge = function verifyChallenge (challenge) { var state = this var mac = challenge.slice(0, 32) var remote_pk = challenge.slice(32, challenge.length) if(0 !== verify_auth(mac, remote_pk, state.app_key)) return null state.remote.kx_pk = remote_pk state.remote.app_mac = mac state.secret = shared(state.local.kx_sk, state.remote.kx_pk) state.shash = hash(state.secret) return true } proto.createClientAuth = function createClientAuth () { var state = this //now we have agreed on the secret. //this can be an encryption secret, //or a hmac secret. // shared(local.kx, remote.public) var a_bob = shared(state.local.kx_sk, curvify_pk(state.remote.public)) state.a_bob = a_bob state.secret2 = hash(concat([state.app_key, state.secret, a_bob])) var signed = concat([state.app_key, state.remote.public, state.shash]) var sig = sign(signed, state.local.secret) state.local.hello = Buffer.concat([sig, state.local.public]) return box(state.local.hello, nonce, state.secret2) } proto.verifyClientAuth = function verifyClientAuth (data) { var state = this var a_bob = shared(curvify_sk(state.local.secret), state.remote.kx_pk) state.a_bob = a_bob state.secret2 = hash(concat([state.app_key, state.secret, a_bob])) state.remote.hello = unbox(data, nonce, state.secret2) if(!state.remote.hello) return null var sig = state.remote.hello.slice(0, 64) var public = state.remote.hello.slice(64, client_auth_length) var signed = concat([state.app_key, state.local.public, state.shash]) if(!verify(sig, signed, public)) return null state.remote.public = public return true } proto.createServerAccept = function createServerAccept () { var state = this //shared key between my local ephemeral key + remote public var b_alice = shared(state.local.kx_sk, curvify_pk(state.remote.public)) state.b_alice = b_alice state.secret3 = hash(concat([state.app_key, state.secret, state.a_bob, state.b_alice])) var signed = concat([state.app_key, state.remote.hello, state.shash]) var okay = sign(signed, state.local.secret) return box(okay, nonce, state.secret3) } proto.verifyServerAccept = function verifyServerAccept (boxed_okay) { var state = this var b_alice = shared(curvify_sk(state.local.secret), state.remote.kx_pk) state.b_alice = b_alice // state.secret3 = hash(concat([state.secret2, b_alice])) state.secret3 = hash(concat([state.app_key, state.secret, state.a_bob, state.b_alice])) var sig = unbox(boxed_okay, nonce, state.secret3) if(!sig) return null var signed = concat([state.app_key, state.local.hello, state.shash]) if(!verify(sig, signed, state.remote.public)) return null return true } proto.cleanSecrets = function cleanSecrets () { var state = this // clean away all the secrets for forward security. // use a different secret hash(secret3) in the rest of the session, // and so that a sloppy application cannot compromise the handshake. delete state.local.secret state.shash.fill(0) state.secret.fill(0) state.a_bob.fill(0) state.b_alice.fill(0) state.secret = hash(state.secret3) state.secret2.fill(0) state.secret3.fill(0) state.local.kx_sk.fill(0) delete state.shash delete state.secret2 delete state.secret3 delete state.a_bob delete state.b_alice delete state.local.kx_sk return state } }).call(this,require("buffer").Buffer) },{"buffer":47,"chloride":155}],246:[function(require,module,exports){ var net = require('net') var toPull = require('stream-to-pull-stream') module.exports = function (opts) { opts.allowHalfOpen = opts.allowHalfOpen !== false return { name: 'net', server: function (onConnection) { var server = net.createServer(opts, function (stream) { onConnection(stream = toPull.duplex(stream)) }).listen(opts) return function () { server.close() } }, client: function (opts, cb) { var started = false var stream = net.connect(opts) .on('connect', function () { if(started) return started = true cb(null, toPull.duplex(stream)) }) .on('error', function (err) { if(started) return started = true cb(err) }) }, //MUST be net:: parse: function (s) { var ary = s.split(':') if(ary.length !== 3) return null if('net' !== ary.shift()) return null var port = +ary.pop() if(isNaN(port)) return null return { name: 'net', host: ary.shift() || 'localhost', port: port } }, stringify: function () { return ['net', opts.host || 'localhost', opts.port].join(':') } } } },{"net":1,"stream-to-pull-stream":350}],247:[function(require,module,exports){ (function (Buffer){ var SHS = require('secret-handshake') var pull = require('pull-stream') module.exports = function (opts) { var server = SHS.createServer( opts.keys, opts.auth, opts.appKey, opts.timeout ) var client = SHS.createClient( opts.keys, opts.appKey, opts.timeout ) return { name: 'shs', create: function (_opts) { return function (stream, cb) { pull( stream.source, _opts && _opts.key ? client(_opts.key, _opts.seed, cb) : server(cb), stream.sink ) } }, parse: function (str) { var ary = str.split(':') if(ary[0] !== 'shs') return null var seed = undefined //seed of private key to connect with, optional. if(ary.length > 2) { seed = new Buffer(ary[2], 'base64') if(seed.length !== 32) return null } var key = new Buffer(ary[1], 'base64') if(key.length !== 32) return null return {key: key, seed: seed} }, stringify: function () { return 'shs:'+opts.keys.publicKey.toString('base64') } } } }).call(this,require("buffer").Buffer) },{"buffer":47,"pull-stream":284,"secret-handshake":243}],248:[function(require,module,exports){ var WS = require('pull-ws') var URL = require('url') module.exports = function (opts) { opts = opts || {} opts.binaryType = (opts.binaryType || 'arraybuffer') return { name: 'ws', server: function (onConnect) { var server = WS.createServer(opts, function (stream) { onConnect(stream) }) if(!opts.server) server.listen(opts.port) return server.close.bind(server) }, client: function (addr, cb) { if(!addr.host) { addr.hostname = addr.hostname || opts.host || 'localhost' addr.slashes = true addr = URL.format(addr) } var stream = WS.connect(addr, { binaryType: opts.binaryType, onConnect: function (err) { cb(err, stream) } }) }, stringify: function () { return URL.format({ protocol: 'ws', slashes: true, hostname: opts.host || 'localhost', //detect ip address port: opts.port }) }, parse: function (str) { var addr = URL.parse(str) if(!/^wss?\:$/.test(addr.protocol)) return null return addr } } } },{"pull-ws":317,"url":146}],249:[function(require,module,exports){ 'use strict'; var EventEmitter = require('events').EventEmitter var u = require('./util') var explain = require('explain-error') function isFunction (f) { return 'function' === typeof f } function isObject (o) { return o && 'object' === typeof o } function noop (err) { if (err) throw explain(err, 'callback not provided') } module.exports = function (path, remoteApi, _remoteCall) { var emitter = new EventEmitter() function remoteCall(type, name, args) { var cb = isFunction (args[args.length - 1]) ? args.pop() : noop var value try { value = _remoteCall(type, name, args, cb) } catch(err) { return u.errorAsStreamOrCb(type, err, cb)} return value } //add all the api methods to emitter recursively ;(function recurse (obj, api, path) { for(var name in api) (function (name, type) { var _path = path ? path.concat(name) : [name] obj[name] = isObject(type) ? recurse({}, type, _path) : function () { return remoteCall(type, _path, [].slice.call(arguments)) } })(name, api[name]) return obj })(emitter, remoteApi, path) //legacy local emit, from when remote emit was supported. emitter._emit = emitter.emit return emitter } },{"./util":255,"events":84,"explain-error":220}],250:[function(require,module,exports){ 'use strict' var PSC = require('packet-stream-codec') var u = require('./util') var initStream = require('./stream') var createApi = require('./api') var createLocalCall = require('./local-api') function createMuxrpc (remoteApi, localApi, local, id, perms, codec, legacy) { localApi = localApi || {} remoteApi = remoteApi || {} var emitter if(!codec) codec = PSC //pass the manifest to the permissions so that it can know //what something should be. var _cb, ws var context = { _emit: function (event, value) { emitter && emitter._emit(event, value) return context }, id: id } var ws = initStream( createLocalCall(local, localApi, perms).bind(context), codec, function (err) { if(emitter.closed) return emitter.closed = true emitter.emit('closed') if(_cb) { var cb = _cb; _cb = null; cb(err) } } ) emitter = createApi([], remoteApi, function (type, name, args, cb) { if(ws.closed) throw new Error('stream is closed') return ws.remoteCall(type, name, args, cb) }) if(legacy) { Object.__defineGetter__.call(emitter, 'id', function () { return context.id }) Object.__defineSetter__.call(emitter, 'id', function (value) { context.id = value }) var first = true emitter.createStream = function (cb) { _cb = cb if(first) { first = false; return ws } else throw new Error('one stream per rpc') } } else emitter.stream = ws emitter.closed = false emitter.close = function (err, cb) { ws.close(err, cb) return this } return emitter } module.exports = function (remoteApi, localApi, codec) { if(arguments.length > 3) return createMuxrpc.apply(this, arguments) return function (local, perms, id) { return createMuxrpc(remoteApi, localApi, local, id, perms, codec, true) } } },{"./api":249,"./local-api":251,"./stream":254,"./util":255,"packet-stream-codec":261}],251:[function(require,module,exports){ var Permissions = require('./permissions') var u = require('./util') module.exports = function createLocalCall(local, localApi, perms) { perms = Permissions(perms) function has(type, name) { return type === u.get(localApi, name) } function localCall(type, name, args) { if(name === 'emit') throw new Error('emit has been removed') //is there a way to know whether it's sync or async? if(type === 'async') if(has('sync', name)) { var cb = args.pop(), value try { value = u.get(local, name).apply(this, args) } catch (err) { return cb(err) } return cb(null, value) } if (!has(type, name)) throw new Error('no '+type+':'+name) return u.get(local, name).apply(this, args) } return function (type, name, args) { var err = perms.pre(name, args) if(err) throw err return localCall.call(this, type, name, args) } } },{"./permissions":252,"./util":255}],252:[function(require,module,exports){ 'use strict'; var u = require('./util') var isArray = Array.isArray function isFunction (f) { return 'function' === typeof f } function join (str) { return Array.isArray(str) ? str.join('.') : str } function toArray(str) { return isArray(str) ? str : str.split('.') } function isPerms (p) { return ( p && isFunction(p.pre) && isFunction(p.test) && isFunction(p.post) ) } /* perms: a given capability may be permitted to call a particular api. but only if a perms function returns true for the arguments it passes. suppose, an app may be given access, but may only create functions with it's own properties. create perms: { allow: ['add', 'query'], deny: [...], rules: { add: { call: function (value) { return (value.type === 'task' || value.type === '_task') }, query: { call: function (value) { safe.contains(value, {path: ['content', 'type'], eq: 'task'}) || safe.contains(value, {path: ['content', 'type'], eq: '_task'}) }, filter: function (value) { return (value.type === 'task' || value.type === '_task') } } } } */ module.exports = function (opts) { if(isPerms(opts)) return opts if(isFunction(opts)) return {pre: opts} var allow = null var deny = {} function perms (opts) { if(opts.allow) { allow = {} opts.allow.forEach(function (path) { u.set(allow, toArray(path), true) }) } else allow = null if(opts.deny) opts.deny.forEach(function (path) { u.set(deny, toArray(path), true) }) else deny = {} return this } if(opts) perms(opts) perms.pre = function (name, args) { name = isArray(name) ? name : [name] if(allow && !u.prefix(allow, name)) return new Error('method:'+name + ' is not on whitelist') if(deny && u.prefix(deny, name)) return new Error('method:'+name + ' is on blacklist') } perms.post = function (err, value) { //TODO } //alias for pre, used in tests. perms.test = function (name, args) { return perms.pre(name, args) } perms.get = function () { return {allow: allow, deny: deny} } return perms } },{"./util":255}],253:[function(require,module,exports){ 'use strict' var pull = require('pull-stream') // wrap pull streams around packet-stream's weird streams. function once (fn) { var done = false return function (err, val) { if(done) return done = true fn(err, val) } } module.exports = function (weird, _done) { var buffer = [], ended = false, waiting, abort var done = once(function (err, v) { _done && _done(err, v) // deallocate weird = null _done = null waiting = null if(abort) abort(err || true, function () {}) }) weird.read = function (data, end) { ended = ended || end if(waiting) { var cb = waiting waiting = null cb(ended, data) } else if(!ended) buffer.push(data) if(ended) done(ended !== true ? ended : null) } return { source: function (abort, cb) { if(abort) { weird && weird.write(null, abort) cb(abort); done(abort !== true ? abort : null) } else if(buffer.length) cb(null, buffer.shift()) else if(ended) cb(ended) else waiting = cb }, sink : function (read) { if(ended) return read(ended, function () {}), abort = null abort = read pull.drain(function (data) { //TODO: make this should only happen on a UNIPLEX stream. if(ended) return false weird.write(data) }, function (err) { if(weird && !weird.writeEnd) weird.write(null, err || true) done && done(err) }) (read) } } } function uniplex (s, done) { return module.exports(s, function (err) { if(!s.writeEnd) s.write(null, err || true) if(done) done(err) }) } module.exports.source = function (s) { return uniplex(s).source } module.exports.sink = function (s, done) { return uniplex(s, done).sink } module.exports.duplex = module.exports },{"pull-stream":284}],254:[function(require,module,exports){ 'use strict'; var PacketStream = require('packet-stream') var pull = require('pull-stream') var pullWeird = require('./pull-weird') var goodbye = require('pull-goodbye') var u = require('./util') var explain = require('explain-error') function isFunction (f) { return 'function' === typeof f } function isString (s) { return 'string' === typeof s } function isObject (o) { return o && 'object' === typeof o } function isSource (t) { return 'source' === t } function isSink (t) { return 'sink' === t } function isDuplex (t) { return 'duplex' === t } function isSync (t) { return 'sync' === t } function isAsync (t) { return 'async' === t } function isRequest (t) { return isSync(t) || isAsync(t) } function isStream (t) { return isSource(t) || isSink(t) || isDuplex(t) } module.exports = function initStream (localCall, codec, onClose) { var ps = PacketStream({ message: function (msg) { // if(isString(msg)) return // if(msg.length > 0 && isString(msg[0])) // localCall('msg', 'emit', msg) }, request: function (opts, cb) { var name = opts.name, args = opts.args var inCB = false, called = false, async = false, value args.push(function (err, value) { called = true inCB = true; cb(err, value) }) try { value = localCall('async', name, args) } catch (err) { if(inCB || called) throw explain(err, 'no callback provided to muxrpc async funtion') return cb(err) } }, stream: function (stream) { stream.read = function (data, end) { var name = data.name var type = data.type var err, value stream.read = null if(!isStream(type)) return stream.write(null, new Error('unsupported stream type:'+type)) //how would this actually happen? if(end) return stream.write(null, end) try { value = localCall(type, name, data.args) } catch (_err) { err = _err } var _stream = pullWeird[ {source: 'sink', sink: 'source'}[type] || 'duplex' ](stream) return u.pipeToStream( type, _stream, err ? u.errorAsStream(type, err) : value ) // if(isSource(type)) // _stream(err ? pull.error(err) : value) // else if (isSink(type)) // (err ? abortSink(err) : value)(_stream) // else if (isDuplex(type)) // pull(_stream, err ? abortDuplex(err) : value, _stream) } }, close: function (err) { ps = null // deallocate ws.ended = true if(ws.closed) return ws.closed = true if(onClose) { var close = onClose; onClose = null; close(err) } } }) var ws = goodbye(pullWeird(ps, function (_) { //this error will be handled in PacketStream.close })) ws = codec ? codec(ws) : ws ws.remoteCall = function (type, name, args, cb) { if(name === 'emit') return ps.message(args) if(!(isRequest(type) || isStream(type))) throw new Error('unsupported type:' + JSON.stringify(type)) if(isRequest(type)) return ps.request({name: name, args: args}, cb) var ws = ps.stream(), s = pullWeird[type](ws, cb) ws.write({name: name, args: args, type: type}) return s } //hack to work around ordering in setting ps.ended. //Question: if an object has subobjects, which //all have close events, should the subobjects fire close //before the parent? or should parents close after? //should there be a preclose event on the parent //that fires when it's about to close all the children? ws.isOpen = function () { return !ps.ended } ws.close = function (err, cb) { if(isFunction(err)) cb = err, err = false if(!ps) return (cb && cb()) if(err) return ps.destroy(err), (cb && cb()) ps.close(function (err) { if(cb) cb(err) else if(err) throw explain(err, 'no callback provided for muxrpc close') }) return this } ws.closed = false return ws } },{"./pull-weird":253,"./util":255,"explain-error":220,"packet-stream":262,"pull-goodbye":273,"pull-stream":284}],255:[function(require,module,exports){ 'use strict'; var pull = require('pull-stream') function isString (s) { return 'string' === typeof s } var isArray = Array.isArray function isObject (o) { return o && 'object' === typeof o && !isArray(o) } function isEmpty (obj) { for(var k in obj) return false; return true } //I wrote set as part of permissions.js //and then later mount, they do nearly the same thing //but not quite. this should be refactored sometime. //what differs is that set updates the last key in the path //to the new value, but mount merges the last value //which makes sense if it's an object, and set makes sense if it's //a string/number/boolean. exports.set = function (obj, path, value) { var _obj, _k for(var i = 0; i < path.length; i++) { var k = path[i] obj[k] = obj[k] || {} _obj = obj; _k = k obj = obj[k] } _obj[_k] = value } exports.get = function (obj, path) { if(isString(path)) return obj[path] var value for(var i = 0; i < path.length; i++) { var k = path[i] value = obj = obj[k] if(null == obj) return obj } return value } exports.prefix = function (obj, path) { var value, parent = obj for(var i = 0; i < path.length; i++) { var k = path[i] value = obj = obj[k] if('object' !== typeof obj) { return obj } parent = obj } return 'object' !== typeof value ? !!value : false } function mkPath(obj, path) { for(var i in path) { var key = path[i] if(!obj[key]) obj[key]={} obj = obj[key] } return obj } function rmPath (obj, path) { (function r (obj, i) { var key = path[i] if(!obj) return else if(path.length - 1 === i) delete obj[key] else if(i < path.length) r(obj[key], i+1) if(isEmpty(obj[key])) delete obj[key] })(obj, 0) } function merge (obj, _obj) { for(var k in _obj) obj[k] = _obj[k] return obj } var mount = exports.mount = function (obj, path, _obj) { if(!Array.isArray(path)) throw new Error('path must be array of strings') return merge(mkPath(obj, path), _obj) } var unmount = exports.unmount = function (obj, path) { return rmPath(obj, path) } function isSource (t) { return 'source' === t } function isSink (t) { return 'sink' === t } function isDuplex (t) { return 'duplex' === t } function isSync (t) { return 'sync' === t } function isAsync (t) { return 'async' === t } function isRequest (t) { return isSync(t) || isAsync(t) } function isStream (t) { return isSource(t) || isSink(t) || isDuplex(t) } function abortSink (err) { return function (read) { read(err || true, function () {}) } } function abortDuplex (err) { return {source: pull.error(err), sink: abortSink(err)} } exports.errorAsStream = function (type, err) { return ( isSource(type) ? pull.error(err) : isSink(type) ? abortSink(err) : abortDuplex(err) ) } exports.errorAsStreamOrCb = function (type, err, cb) { return ( isRequest(type) ? cb(err) : isSource(type) ? pull.error(err) : isSink(type) ? abortSink(err) : cb(err), abortDuplex(err) ) } exports.pipeToStream = function (type, _stream, stream) { if(isSource(type)) _stream(stream) else if (isSink(type)) stream(_stream) else if (isDuplex(type)) pull(_stream, stream, _stream) } },{"pull-stream":284}],256:[function(require,module,exports){ var os = require('os') var ip = require('ip') //pick the first reasonable looking host. //this should *just work* when running on a vps. var isPrivate = ip.isPrivate function isNonPrivate (e) { return !isPrivate(e) } var address = module.exports = function (inter, filter) { inter = inter || os.networkInterfaces() filter = filter || isNonPrivate for(var k in inter) { for(var i in inter[k]) { var e = inter[k][i] // find a reasonable looking address if(!e.internal && filter(e.address, e)) return e.address } } } function isV4 (e) { return e.family === 'IPv4' } function isV6 (e) { return e.family === 'IPv6' } var private = module.exports.private = function (inter) { return address(inter, isPrivate) } module.exports.v4 = address(null, function (addr, e) { return isV4(e) && isNonPrivate(addr) }) module.exports.v6 = address(null, function (addr, e) { return isV6(e) && isNonPrivate(addr) }) private.v4 = address(null, function (addr, e) { return isV4(e) && isPrivate(addr) }) private.v6 = address(null, function (addr, e) { return isV6(e) && isPrivate(addr) }) module.exports.all = { public: { v4: module.exports.v4, v6: module.exports.v6 }, private: { v4: private.v4, v6: private.v6 } } if(!module.parent) { console.log(module.exports.all) } },{"ip":229,"os":100}],257:[function(require,module,exports){ module.exports = function openExternal (url) { var _r = require //fool browserify //electron@1 try {return _r('electron').shell.openExternal(url) } catch (err) { } //electron@0 try { return _r('shell').openExternal(url) } catch (err) { } //browser window.open(url, '_blank') } module.exports.isExternal = function isExternal (url, location) { //if it starts with a relative link, or the same domain, then it is not external. var origin = (location || window.location).origin //firefox has origin "null" not file... if(origin === 'null' && (location || window.location).protocol == 'file:') origin = 'file://' return !/[#./]/.test(url[0]) && url.indexOf(origin) !== 0 } },{}],258:[function(require,module,exports){ (function (process){ 'use strict'; var os = require('os'); function homedir() { var env = process.env; var home = env.HOME; var user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME; if (process.platform === 'win32') { return env.USERPROFILE || env.HOMEDRIVE + env.HOMEPATH || home || null; } if (process.platform === 'darwin') { return home || (user ? '/Users/' + user : null); } if (process.platform === 'linux') { return home || (process.getuid() === 0 ? '/root' : (user ? '/home/' + user : null)); } return home || null; } module.exports = typeof os.homedir === 'function' ? os.homedir : homedir; }).call(this,require('_process')) },{"_process":108,"os":100}],259:[function(require,module,exports){ (function (process){ 'use strict'; var isWindows = process.platform === 'win32'; var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/; // https://github.com/nodejs/io.js/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43 module.exports = function () { var path; if (isWindows) { path = process.env.TEMP || process.env.TMP || (process.env.SystemRoot || process.env.windir) + '\\temp'; } else { path = process.env.TMPDIR || process.env.TMP || process.env.TEMP || '/tmp'; } if (trailingSlashRe.test(path)) { path = path.slice(0, -1); } return path; }; }).call(this,require('_process')) },{"_process":108}],260:[function(require,module,exports){ (function (process){ var isWindows = process.platform === 'win32' var path = require('path') var exec = require('child_process').exec var osTmpdir = require('os-tmpdir') var osHomedir = require('os-homedir') // looking up envs is a bit costly. // Also, sometimes we want to have a fallback // Pass in a callback to wait for the fallback on failures // After the first lookup, always returns the same thing. function memo (key, lookup, fallback) { var fell = false var falling = false exports[key] = function (cb) { var val = lookup() if (!val && !fell && !falling && fallback) { fell = true falling = true exec(fallback, function (er, output, stderr) { falling = false if (er) return // oh well, we tried val = output.trim() }) } exports[key] = function (cb) { if (cb) process.nextTick(cb.bind(null, null, val)) return val } if (cb && !falling) process.nextTick(cb.bind(null, null, val)) return val } } memo('user', function () { return ( isWindows ? process.env.USERDOMAIN + '\\' + process.env.USERNAME : process.env.USER ) }, 'whoami') memo('prompt', function () { return isWindows ? process.env.PROMPT : process.env.PS1 }) memo('hostname', function () { return isWindows ? process.env.COMPUTERNAME : process.env.HOSTNAME }, 'hostname') memo('tmpdir', function () { return osTmpdir() }) memo('home', function () { return osHomedir() }) memo('path', function () { return (process.env.PATH || process.env.Path || process.env.path).split(isWindows ? ';' : ':') }) memo('editor', function () { return process.env.EDITOR || process.env.VISUAL || (isWindows ? 'notepad.exe' : 'vi') }) memo('shell', function () { return isWindows ? process.env.ComSpec || 'cmd' : process.env.SHELL || 'bash' }) }).call(this,require('_process')) },{"_process":108,"child_process":1,"os-homedir":258,"os-tmpdir":259,"path":105}],261:[function(require,module,exports){ (function (Buffer){ var Through = require('pull-through') var Reader = require('pull-reader') var BUFFER = 0, STRING = 1, OBJECT = 2 var GOODBYE = 'GOODBYE' var isBuffer = Buffer.isBuffer function isString (s) { return 'string' === typeof s } function encodePair (msg) { var head = new Buffer(9) var flags = 0 var value = msg.value !== undefined ? msg.value : msg.end //final packet if(isString(msg) && msg === GOODBYE) { head.fill(0) return [head, null] } if(isString(value)) { flags = STRING value = new Buffer(value) } else if(isBuffer(value)) { flags = BUFFER } else { flags = OBJECT value = new Buffer(JSON.stringify(value)) } // does this frame represent a msg, a req, or a stream? //end, stream flags = msg.stream << 3 | msg.end << 2 | flags head[0] = flags head.writeUInt32BE(value.length, 1) head.writeInt32BE(msg.req || 0, 5) return [head, value] } function decodeHead (bytes) { if(bytes.length != 9) throw new Error('expected header to be 9 bytes long') var flags = bytes[0] var length = bytes.readUInt32BE(1) var req = bytes.readInt32BE(5) return { req : req, stream : !!(flags & 8), end : !!(flags & 4), value : null, length : length, type : flags & 3 } } function decodeBody (bytes, msg) { if(bytes.length !== msg.length) throw new Error('incorrect length, expected:'+msg.length+' found:'+bytes.length) if(BUFFER === msg.type) msg.value = bytes else if(STRING === msg.type) msg.value = bytes.toString() else if(OBJECT === msg.type) msg.value = JSON.parse(bytes.toString()) else throw new Error('unknown message type') return msg } function encode () { return Through(function (d) { var c = encodePair(d) this.queue(c[0]) if(c[1] !== null) this.queue(c[1]) }) } function decode () { var reader = Reader(), ended = false return function (read) { reader(read) return function (abort, cb) { if(ended) return cb(true) if(abort) return reader.abort(abort, cb) reader.read(9, function (err, head) { if(err) return cb(err) var msg = decodeHead(head) if(msg.length === 0) { //final packet ended = true return cb(null, GOODBYE) } reader.read(msg.length, function (err, body) { if(err) return cb(err) decodeBody(body, msg) cb(null, msg) }) }) } } } exports = module.exports = function (stream) { return { source: encode()(stream.source), sink: function (read) { return stream.sink(decode()(read)) } } } exports.encodePair = encodePair exports.decodeHead = decodeHead exports.decodeBody = decodeBody exports.encode = encode exports.decode = decode }).call(this,require("buffer").Buffer) },{"buffer":47,"pull-reader":281,"pull-through":315}],262:[function(require,module,exports){ function flat(err) { if(!err) return err if(err === true) return true return {message: err.message, name: err.name, stack: err.stack} } module.exports = function (opts) { return new PacketStream(opts) } function PacketStream (opts) { this.ended = false this.opts = opts // must release, may capture `this` this._req_counter = 1 this._requests = {} // must release, may capture `this` this._instreams = {} // must release, may capture `this` this._outstreams = {} // must release, may capture `this` this._closecbs = [] // must release, may capture `this` this._closing = false this._closed = false if (opts.close) this._closecbs.push(opts.close) } // Sends a single message to the other end PacketStream.prototype.message = function (obj) { this.read({req: 0, stream: false, end: false, value: obj}) } // Sends a message to the other end, expects an (err, obj) response PacketStream.prototype.request = function (obj, cb) { var rid = this._req_counter++ var self = this this._requests[rid] = function (err, value) { delete self._requests[rid] cb(err, value) self._maybedone() } this.read({ req:rid, stream: false, end: false, value: obj }) } // Sends a request to the other end for a stream PacketStream.prototype.stream = function () { var rid = this._req_counter++ var self = this this._outstreams[rid] = new PacketStreamSubstream(rid, this, function() { delete self._outstreams[rid] }) return this._outstreams[rid] } // Marks the packetstream to close when all current IO is finished PacketStream.prototype.close = function (cb) { if(!cb) throw new Error('packet-stream.close *must* have callback') if (this._closed) return cb() this._closecbs.push(cb) this._closing = true this._maybedone() } // Forces immediate close of the PacketStream // - usually triggered by an `end` packet from the other end PacketStream.prototype.destroy = function (end) { end = end || flat(end) this.ended = end var err = (end === true) ? new Error('unexpected end of parent stream') : end // force-close all requests and substreams var numended = 0 for (var k in this._requests) { numended++; this._requests[k](err) } for (var k in this._instreams) { numended++; this._instreams[k].destroy(err) } for (var k in this._outstreams) { numended++; this._outstreams[k].destroy(err) } //from the perspective of the outside stream it's not an error //if the stream was in a state that where end was okay. (no open requests/streams) if (numended === 0 && end === true) err = null this._closing = true this._maybedone(err) } PacketStream.prototype._maybedone = function (err) { if (this._closed || !this._closing) return // check if all requests and streams finished if (Object.keys(this._requests).length !== 0 || Object.keys(this._instreams).length !== 0 || Object.keys(this._outstreams).length !== 0) return // not yet // close this._closed = true this._closecbs.forEach(function (cb) { cb(err) }) this.read(null, err || true) // deallocate this.opts = null this._closecbs.length = 0 this.read = closedread } function closedread (msg) { console.error('packet-stream asked to read after closed', msg) } // Sends data out to the other end // - to be overridden by the PacketStream consumer PacketStream.prototype.read = function (msg) { console.error('please overwrite read method to do IO', msg) } // Accepts data from the other end PacketStream.prototype.write = function (msg, end) { if (this.ended) return if (end) this.destroy(end) else if (msg.req && !msg.stream) this._onrequest(msg) else if (msg.req && msg.stream) this._onstream(msg) else this._onmessage(msg) } // Internal handler of incoming message msgs PacketStream.prototype._onmessage = function (msg) { if (this.opts && 'function' === typeof this.opts.message) this.opts.message(msg.value) } // Internal handler of incoming request msgs PacketStream.prototype._onrequest = function (msg) { var rid = msg.req*-1 if(msg.req < 0) { // A incoming response if (typeof this._requests[rid] == 'function') this._requests[rid]( msg.end ? msg.value: null, msg.end ? null : msg.value ) } else { // An incoming request if (this.opts && typeof this.opts.request == 'function') { var once = false var self = this this.opts.request(msg.value, function (err, value) { if(once) throw new Error('cb called twice from local api') once = true if(err) self.read({ value: flat(err), end: true, req: rid }) else self.read({ value: value, end: false, req: rid }) self._maybedone() }) } else { if (this.ended) { var err = (this.ended === true) ? new Error('unexpected end of parent stream') : this.ended this.read({ value: flat(err), end: true, stream: false, req: rid }) } else this.read({ value: { message: 'Unable to handle requests', name: 'NO_REQUEST_HANDLER', stack: null }, end: true, stream: false, req: rid }) this._maybedone() } } } // Internal handler of incoming stream msgs PacketStream.prototype._onstream = function (msg) { if(msg.req < 0) { // Incoming stream data var rid = msg.req*-1 var outs = this._outstreams[rid] if (!outs) return console.error('no stream for incoming msg', msg) if (msg.end) { if (outs.writeEnd) delete this._outstreams[rid] outs.readEnd = true outs.read(null, msg.value) this._maybedone() } else outs.read(msg.value) } else { // Incoming stream request var rid = msg.req var ins = this._instreams[rid] if (!ins) { // New stream var self = this ins = this._instreams[rid] = new PacketStreamSubstream(rid*-1, this, function() { delete self._instreams[rid] }) if (this.opts && typeof this.opts.stream == 'function') this.opts.stream(ins) } if (!ins.read) return console.error('no .read for stream:', ins.id, 'dropped:', msg) if (msg.end) { if (ins.writeEnd) delete this._instreams[rid] ins.readEnd = true ins.read(null, msg.value) this._maybedone() } else ins.read(msg.value) } } function PacketStreamSubstream (id, ps, remove) { this.id = id this.read = null // must release, may capture `this` this.writeEnd = null this.readEnd = null this._ps = ps // must release, may capture `this` this._remove = remove // must release, may capture `this` this._seq_counter = 1 } PacketStreamSubstream.prototype.write = function (data, err) { if (err) { this.writeEnd = err var ps = this._ps if (ps) { ps.read({ req: this.id, stream: true, end: true, value: flat(err) }) if (this.readEnd) this.destroy() ps._maybedone() } } else { if (this._ps) this._ps.read({ req: this.id, stream: true, end: false, value: data }) } } // Send the `end` message for the substream PacketStreamSubstream.prototype.end = function (err) { this.write(null, flat(err || true)) } PacketStreamSubstream.prototype.destroy = function (err) { if (!this.writeEnd) { this.writeEnd = true if (!this.readEnd) { this.readEnd = true try { // catch errors to ensure cleanup this.read(null, err) } catch (e) { console.error('Exception thrown by PacketStream substream end handler', e) console.error(e.stack) } } this.write(null, err) } else if (!this.readEnd) { this.readEnd = true try { // catch errors to ensure cleanup this.read(null, err) } catch (e) { console.error('Exception thrown by PacketStream substream end handler', e) console.error(e.stack) } } // deallocate if (this._ps) { this._remove() this._remove = null this.read = closedread this._ps = null } } },{}],263:[function(require,module,exports){ (function (Buffer){ var sodium = require('chloride') var crypto = require('crypto') var scalarmult = sodium.crypto_scalarmult var box = sodium.crypto_box_easy var secretbox = sodium.crypto_secretbox_easy var secretbox_open = sodium.crypto_secretbox_open_easy var keypair = sodium.crypto_box_keypair var concat = Buffer.concat function randombytes(n) { return crypto.randomBytes(n) } const MAX = 7 exports.multibox = function (msg, recipients) { if(recipients.length > MAX) throw new Error('max recipients is:'+MAX+' found:'+recipients.length) var nonce = randombytes(24) var key = randombytes(32) var onetime = keypair() var _key = concat([new Buffer([recipients.length & MAX]), key]) return concat([ nonce, onetime.publicKey, concat(recipients.map(function (r_pk, i) { return secretbox(_key, nonce, scalarmult(onetime.secretKey, r_pk)) })), secretbox(msg, nonce, key) ]) } function get_key(ctxt, my_key) { } exports.multibox_open = function (ctxt, sk) { //, groups... var nonce = ctxt.slice(0, 24) var onetime_pk = ctxt.slice(24, 24+32) var my_key = scalarmult(sk, onetime_pk) var _key, key, length, start = 24+32, size = 32+1+16 for(var i = 0; i <= MAX; i++) { var s = start+size*i if(s + size > (ctxt.length - 16)) continue _key = secretbox_open(ctxt.slice(s, s + size), nonce, my_key) if(_key) { length = _key[0] key = _key.slice(1) continue } } if(!key) return return secretbox_open(ctxt.slice(start+length*size), nonce, key) } }).call(this,require("buffer").Buffer) },{"buffer":47,"chloride":155,"crypto":56}],264:[function(require,module,exports){ arguments[4][107][0].apply(exports,arguments) },{"_process":108,"dup":107}],265:[function(require,module,exports){ (function (Buffer){ 'use strict' var sodium = require('chloride') var Reader = require('pull-reader') var increment = require('increment-buffer') var through = require('pull-through') var split = require('split-buffer') var isBuffer = Buffer.isBuffer var concat = Buffer.concat var box = sodium.crypto_secretbox_easy var unbox = sodium.crypto_secretbox_open_easy function unbox_detached (mac, boxed, nonce, key) { return sodium.crypto_secretbox_open_easy(concat([mac, boxed]), nonce, key) } var max = 1024*4 var NONCE_LEN = 24 var HEADER_LEN = 2+16+16 function isZeros(b) { for(var i = 0; i < b.length; i++) if(b[i] !== 0) return false return true } function randomSecret(n) { var rand = new Buffer(n) sodium.randombytes(rand) return rand } function copy (a) { var b = new Buffer(a.length) a.copy(b, 0, 0, a.length) return b } exports.createBoxStream = exports.createEncryptStream = function (key, init_nonce) { if(key.length === 56) { init_nonce = key.slice(32, 56) key = key.slice(0, 32) } else if(!(key.length === 32 && init_nonce.length === 24)) throw new Error('nonce must be 24 bytes') // we need two nonces because increment mutates, // and we need the next for the header, // and the next next nonce for the packet var nonce1 = copy(init_nonce), nonce2 = copy(init_nonce) var head = new Buffer(18) return through(function (data) { if('string' === typeof data) data = new Buffer(data, 'utf8') else if(!isBuffer(data)) return this.emit('error', new Error('must be buffer')) if(data.length === 0) return var input = split(data, max) for(var i = 0; i < input.length; i++) { head.writeUInt16BE(input[i].length, 0) var boxed = box(input[i], increment(nonce2), key) //write the mac into the header. boxed.copy(head, 2, 0, 16) this.queue(box(head, nonce1, key)) this.queue(boxed.slice(16, 16 + input[i].length)) increment(increment(nonce1)); increment(nonce2) } }, function (err) { if(err) return this.queue(null) //handle special-case of empty session //final header is same length as header except all zeros (inside box) var final = new Buffer(2+16); final.fill(0) this.queue(box(final, nonce1, key)) this.queue(null) }) } exports.createUnboxStream = exports.createDecryptStream = function (key, nonce) { if(key.length == 56) { nonce = key.slice(32, 56) key = key.slice(0, 32) } else if(!(key.length === 32 && nonce.length === 24)) throw new Error('nonce must be 24 bytes') var reader = Reader(), first = true, ended var first = true return function (read) { reader(read) return function (end, cb) { if(end) return reader.abort(end, cb) //use abort when the input was invalid, //but the source hasn't actually ended yet. function abort(err) { reader.abort(ended = err || true, cb) } if(ended) return cb(ended) reader.read(HEADER_LEN, function (err, cipherheader) { if(err === true) return cb(ended = new Error('unexpected hangup')) if(err) return cb(ended = err) var header = unbox(cipherheader, nonce, key) if(!header) return abort(new Error('invalid header')) //valid end of stream if(isZeros(header)) return cb(ended = true) var length = header.readUInt16BE(0) var mac = header.slice(2, 34) reader.read(length, function (err, cipherpacket) { if(err) return cb(ended = err) //recreate a valid packet //TODO: PR to sodium bindings for detached box/open var plainpacket = unbox_detached(mac, cipherpacket, increment(nonce), key) if(!plainpacket) return abort(new Error('invalid packet')) increment(nonce) cb(null, plainpacket) }) }) } } } }).call(this,require("buffer").Buffer) },{"buffer":47,"chloride":155,"increment-buffer":225,"pull-reader":281,"pull-through":315,"split-buffer":330}],266:[function(require,module,exports){ var noop = function () {} function abortAll(ary, abort, cb) { var n = ary.length if(!n) return cb(abort) ary.forEach(function (f) { if(f) f(abort, next) else next() }) function next() { if(--n) return cb(abort) } if(!n) next() } module.exports = function (streams) { return function (abort, cb) { ;(function next () { if(abort) abortAll(streams, abort, cb) else if(!streams.length) cb(true) else if(!streams[0]) streams.shift(), next() else streams[0](null, function (err, data) { if(err) { streams.shift() //drop the first, has already ended. if(err === true) next() else abortAll(streams, err, cb) } else cb(null, data) }) })() } } },{}],267:[function(require,module,exports){ var Source = require('./source') var Sink = require('./sink') module.exports = function () { var source = Source() var sink = Sink() return { source: source, sink: sink, resolve: function (duplex) { source.resolve(duplex.source) sink.resolve(duplex.sink) } } } },{"./sink":269,"./source":270}],268:[function(require,module,exports){ exports.source = require('./source') exports.through = require('./through') exports.sink = require('./sink') exports.duplex = require('./duplex') },{"./duplex":267,"./sink":269,"./source":270,"./through":271}],269:[function(require,module,exports){ module.exports = function (stream) { var read, started = false, id = Math.random() function consume (_read) { if(!_read) throw new Error('must be passed a readable') read = _read if(started) stream(read) } consume.resolve = consume.ready = consume.start = function (_stream) { started = true; stream = _stream || stream if(read) stream(read) return consume } return consume } },{}],270:[function(require,module,exports){ module.exports = function () { var _read, _cb, abortCb, _end var read = function (end, cb) { if(!_read) { if(end) { _end = end abortCb = cb } else _cb = cb } else _read(end, cb) } read.resolve = function (read) { if(_read) throw new Error('already resolved') _read = read if(!_read) throw new Error('no read cannot resolve!' + _read) if(_cb) read(null, _cb) if(abortCb) read(_end, abortCb) } read.abort = function(err) { read.resolve(function (_, cb) { cb(err || true) }) } return read } },{}],271:[function(require,module,exports){ module.exports = function () { var read, reader, cb, abort, stream function delayed (_read) { //if we already have the stream, go! if(stream) return stream(_read) read = _read return function (_abort, _cb) { if(reader) reader(_abort, _cb) else abort = _abort, cb = _cb } } delayed.resolve = function (_stream) { if(stream) throw new Error('already resolved') stream = _stream if(!stream) throw new Error('resolve *must* be passed a transform stream') if(read) { reader = stream(read) if(cb) reader(abort, cb) } } return delayed } },{}],272:[function(require,module,exports){ module.exports = function endable (goodbye) { var ended, waiting, sentEnd function h (read) { return function (abort, cb) { read(abort, function (end, data) { if(end && !sentEnd) { sentEnd = true return cb(null, goodbye) } //send end message... if(end && ended) cb(end) else if(end) waiting = cb else cb(null, data) }) } } h.end = function () { ended = true if(waiting) waiting(ended) return h } return h } },{}],273:[function(require,module,exports){ var endable = require('./endable') var pull = require('pull-stream') module.exports = function (stream, goodbye) { goodbye = goodbye || 'GOODBYE' var e = endable(goodbye) return { // when the source ends, // send the goodbye and then wait to recieve // the other goodbye. source: pull(stream.source, e), sink: pull( //when the goodbye is received, allow the source to end. pull.filter(function (data) { if(data !== goodbye) return true e.end() }), stream.sink ) } } },{"./endable":272,"pull-stream":284}],274:[function(require,module,exports){ var Reader = require('pull-reader') var pull = require('pull-stream') var deferred = require('pull-defer') var Writer = require('pull-pushable') var cat = require('pull-cat') var pair = require('pull-pair') function once (cb) { var called = 0 return function (a, b, c) { if(called++) return cb(a, b, c) } } function isFunction (f) { return 'function' === typeof f } module.exports = function (opts, _cb) { if(isFunction(opts)) _cb = opts, opts = {} _cb = once(_cb) var reader = Reader(opts && opts.timeout || 5e3) var writer = Writer(function (err) { if(err) _cb(err) }) var source = deferred.source() var p = pair() return { handshake: { read: reader.read, abort: function (err) { writer.end(err) reader.abort(err, function (err) { }) _cb(err) }, write: writer.push, rest: function () { writer.end() return { source: reader.read(), sink: p.sink } } }, sink: reader, source: cat([writer, p.source]) } } },{"pull-cat":266,"pull-defer":268,"pull-pair":275,"pull-pushable":279,"pull-reader":281,"pull-stream":284}],275:[function(require,module,exports){ //a pair of pull streams where one drains from the other module.exports = function () { var _read, waiting function sink (read) { if('function' !== typeof read) throw new Error('read must be function') _read = read if(waiting) { var _waiting = waiting waiting = null _read.apply(null, _waiting) } } function source (abort, cb) { if(_read) _read(abort, cb) else waiting = [abort, cb] } return { source: source, sink: sink } } },{}],276:[function(require,module,exports){ var noop = function () {} module.exports = function (next) { var stream return function (abort, cb) { if(abort) { if(stream) stream(abort, cb) else cb(abort) } else more() function more () { if(!stream) { try { stream = next() } catch(err) { return cb(err) } if(!stream) return cb(true) } stream(null, function (err, data) { if(err) { console.log('end', err, data) stream = null if(err === true) setTimeout(more, 100) else cb(err) } else cb(null, data) }) } } } },{}],277:[function(require,module,exports){ module.exports = function (map, width) { var reading = false, abort return function (read) { var i = 0, j = 0, last = 0 var seen = [], started = false, ended = false, _cb, error function drain () { if(_cb) { var cb = _cb if(error) { _cb = null return cb(error) } if(Object.hasOwnProperty.call(seen, j)) { _cb = null var data = seen[j]; delete seen[j]; j++ cb(null, data) if(width) start() } else if(j >= last && ended) { _cb = null cb(true) } } } function start () { started = true if(ended) return drain() if(reading || width && (i - width >= j)) return reading = true read(abort, function (end, data) { reading = false if(end) { last = i; ended = end drain() } else { var k = i++ map(data, function (err, data) { seen[k] = data if(err) error = err drain() }) if(!ended) start() } }) } return function (_abort, cb) { if(_abort) read(ended = abort = _abort, function (err) { if(cb) return cb(err) }) else { _cb = cb if(!started) start() drain() } } } } },{}],278:[function(require,module,exports){ module.exports = function (onPause) { var wait, read, paused function reader (_read) { read = _read return function (abort, cb) { if(!paused) read(abort, cb) else wait = [abort, cb] } } reader.pause = function () { if(paused) return onPause(paused = true) } reader.resume = function () { if(!paused) return paused = false onPause(paused) if(wait) { var _wait = wait wait = null read(_wait[0], _wait[1]) } } return reader } },{}],279:[function(require,module,exports){ module.exports = pullPushable function pullPushable (onClose) { // create a buffer for data // that have been pushed // but not yet pulled. var buffer = [] // a pushable is a source stream // (abort, cb) => cb(end, data) // // when pushable is pulled, // keep references to abort and cb // so we can call back after // .end(end) or .push(data) var abort, cb function read (_abort, _cb) { if (_abort) { abort = _abort // if there is already a cb waiting, abort it. if (cb) callback(abort) } cb = _cb drain() } var ended read.end = function (end) { ended = ended || end || true // attempt to drain drain() } read.push = function (data) { if (ended) return // if sink already waiting, // we can call back directly. if (cb) { callback(abort, data) return } // otherwise push data and // attempt to drain buffer.push(data) drain() } return read // `drain` calls back to (if any) waiting // sink with abort, end, or next data. function drain () { if (!cb) return if (abort) callback(abort) else if (!buffer.length && ended) callback(ended) else if (buffer.length) callback(null, buffer.shift()) } // `callback` calls back to waiting sink, // and removes references to sink cb. function callback (err, val) { var _cb = cb // if error and pushable passed onClose, call it // the first time this stream ends or errors. if (err && onClose) { var c = onClose onClose = null c(err === true ? null : err) } cb = null _cb(err, val) } } },{}],280:[function(require,module,exports){ (function (Buffer){ var BufferList = require('bl') module.exports = function () { var bl = new BufferList() function get (n) { var len = n == null ? bl.length : n var data = bl.slice(0, len) bl.consume(n) return data } return { data: bl, add: function (data) { bl.append(data) return this }, has: function (n) { if(n == null) return bl.length > 0 return bl.length >= n }, get: function (n) { if(n == null) return get() if(!this.has(n)) throw new Error( 'current length is:'+bl.length + ', could not get:'+n + ' bytes' ) return get(n) } } var soFar = new Buffer(0) return { data: soFar, add: function (data) { if(!Buffer.isBuffer(data)) throw new Error('data must be a buffer, was: ' + JSON.stringify(data)) this.data = soFar = Buffer.concat([soFar, data]) return this }, has: function (n) { if(null == n) return soFar.length > 0 return soFar.length - (n || 0) >= 0 }, get: function (n) { var next if(null == n) { next = soFar soFar = new Buffer(0) return next } next = soFar.slice(0, n) if(soFar.length < n) throw new Error('current length is:'+soFar.length + ', could not get:'+n + ' bytes') soFar = soFar.slice(n, soFar.length) return next } } } }).call(this,require("buffer").Buffer) },{"bl":194,"buffer":47}],281:[function(require,module,exports){ 'use strict' var State = require('./bl-state') function isInteger (i) { return Number.isFinite(i) } function isFunction (f) { return 'function' === typeof f } function maxDelay(fn, delay) { if(!delay) return fn return function (a, cb) { var timer = setTimeout(function () { fn(new Error('pull-reader: read exceeded timeout'), cb) }, delay) fn(a, function (err, value) { clearTimeout(timer) cb(err, value) }) } } module.exports = function (timeout) { var queue = [], read, readTimed, reading = false var state = State(), ended, streaming, abort function drain () { while (queue.length) { if(null == queue[0].length && state.has(1)) { queue.shift().cb(null, state.get()) } else if(state.has(queue[0].length)) { var next = queue.shift() next.cb(null, state.get(next.length)) } else if(ended) queue.shift().cb(ended) else return !!queue.length } //always read a little data return queue.length || !state.has(1) || abort } function more () { var d = drain() if(d && !reading) if(read && !reading && !streaming) { reading = true readTimed (null, function (err, data) { reading = false if(err) { ended = err return drain() } state.add(data) more() }) } } function reader (_read) { if(abort) { while(queue.length) queue.shift().cb(abort) return cb && cb(abort) } readTimed = maxDelay(_read, timeout) read = _read more() } reader.abort = function (err, cb) { abort = err || true if(read) { reading = true read(abort, function () { while(queue.length) queue.shift().cb(abort) cb && cb(abort) }) } else cb() } reader.read = function (len, timeout, cb) { if(isFunction(timeout)) cb = timeout, timeout = 0 if(isFunction(cb)) { queue.push({length: isInteger(len) ? len : null, cb: cb}) more() } else { //switch into streaming mode for the rest of the stream. streaming = true //wait for the current read to complete return function (abort, cb) { //if there is anything still in the queue, if(reading || state.has(1)) { if(abort) return read(abort, cb) queue.push({length: null, cb: cb}) more() } else maxDelay(read, timeout)(abort, function (err, data) { cb(err, data) }) } } } return reader } },{"./bl-state":280}],282:[function(require,module,exports){ var defer = require('pull-defer') module.exports = function (connect, factor, max) { factor = factor || 100 max = max || 10e3 var errors = 0, waiting = [] var state, attempt = Date.now() //first attempt started below. function tryConnect () { try { connect(isConnected) } catch (err) { console.log(err); isConnected(err) } } function isConnected (err) { //if the connection errored if(err && err !== true) { _state = false errors ++ setTimeout(tryConnect, Math.min(Math.pow(2, errors)*factor, max)) } else { _state = true errors = 0 } if(state === _state) return state = _state if(state) while(waiting.length && state) waiting.shift()() //we don't handle any notifications for loosing connectivity. } isConnected.async = function async(fn) { return function () { var args = [].slice.call(arguments) if(state) fn.apply(null, args) else waiting.push(function () { fn.apply(null, args) }) } } isConnected.source = function (fn) { return function () { var args = [].slice.call(arguments) if(state) return fn.apply(null, args) var source = defer.source() waiting.push(function () { source.resolve(fn.apply(null, args)) }) return source } } isConnected.sink = function (fn) { return function () { var args = [].slice.call(arguments) if(state) return fn.apply(null, args) var sink = defer.sink() waiting.push(function () { sink.resolve(fn.apply(null, args)) }) return sink } } tryConnect() return isConnected } },{"pull-defer":268}],283:[function(require,module,exports){ var pull = require('pull-stream') var Pause = require('pull-pause') var isVisible = require('is-visible').isVisible function isBottom (scroller, buffer) { var rect = scroller.getBoundingClientRect() var topmax = scroller.scrollTopMax || (scroller.scrollHeight - rect.height) return scroller.scrollTop >= + ((topmax) - (buffer || 0)) } function isTop (scroller, buffer) { return scroller.scrollTop <= (buffer || 0) } function isFilled(content) { return ( !isVisible(content) //check if the scroller is not visible. // && content.getBoundingClientRect().height == 0 //and has children. if there are no children, //it might be size zero because it hasn't started yet. // && && content.children.length > 10 //&& !isVisible(scroller) ) } function isEnd(scroller, buffer, top) { //if the element is display none, don't read anything into it. return (top ? isTop : isBottom)(scroller, buffer) } function append(list, el, top, sticky) { if(!el) return var s = list.scrollHeight if(top && list.firstChild) list.insertBefore(el, list.firstChild) else list.appendChild(el) //scroll down by the height of the thing added. //if it added to the top (in non-sticky mode) //or added it to the bottom (in sticky mode) if(top !== sticky) { var st = list.scrollTop, d = (list.scrollHeight - s) + 1 list.scrollTop = list.scrollTop + d // list.scrollTo( // list.scrollLeft, // list.scrollTop + d // ) } } function overflow (el) { return el.style.overflowY || el.style.overflow || (function () { var style = getComputedStyle(el) return style.overflowY || el.style.overflow })() } var buffer = 100 module.exports = function Scroller(scroller, content, render, top, sticky, cb) { //if second argument is a function, //it means the scroller and content elements are the same. if('function' === typeof content) { cb = sticky top = render render = content content = scroller } var f = overflow(scroller) if(!/auto|scroll/.test(f)) throw new Error('scroller.style.overflowY must be scroll or auto, was:' + f + '!') scroller.addEventListener('scroll', scroll) var pause = Pause(function () {}), queue = [] //apply some changes to the dom, but ensure that //`element` is at the same place on screen afterwards. function add () { if(queue.length) append(content, render(queue.shift()), top, sticky) } function scroll (ev) { if (isEnd(scroller, buffer, top) || isFilled(content)) { pause.resume() add() } } return pull( pause, pull.drain(function (e) { queue.push(e) if(!isVisible(content)) { if(content.children.length < 10) add() } else if(isEnd(scroller, buffer, top)) add() if(queue.length > 5) pause.pause() }, function (err) { if(err) console.error(err) cb ? cb(err) : console.error(err) }) ) } },{"is-visible":231,"pull-pause":278,"pull-stream":284}],284:[function(require,module,exports){ 'use strict' var sources = require('./sources') var sinks = require('./sinks') var throughs = require('./throughs') exports = module.exports = require('./pull') for(var k in sources) exports[k] = sources[k] for(var k in throughs) exports[k] = throughs[k] for(var k in sinks) exports[k] = sinks[k] },{"./pull":285,"./sinks":290,"./sources":297,"./throughs":306}],285:[function(require,module,exports){ 'use strict' module.exports = function pull (a) { var length = arguments.length if (typeof a === 'function' && a.length === 1) { var args = new Array(length) for(var i = 0; i < length; i++) args[i] = arguments[i] return function (read) { args.unshift(read) return pull.apply(null, args) } } var read = a if (read && typeof read.source === 'function') { read = read.source } for (var i = 1; i < length; i++) { var s = arguments[i] if (typeof s === 'function') { read = s(read) } else if (s && typeof s === 'object') { s.sink(read) read = s.source } } return read } },{}],286:[function(require,module,exports){ 'use strict' var reduce = require('./reduce') module.exports = function collect (cb) { return reduce(function (arr, item) { arr.push(item) return arr }, [], cb) } },{"./reduce":293}],287:[function(require,module,exports){ 'use strict' var reduce = require('./reduce') module.exports = function concat (cb) { return reduce(function (a, b) { return a + b }, '', cb) } },{"./reduce":293}],288:[function(require,module,exports){ 'use strict' module.exports = function drain (op, done) { var read, abort function sink (_read) { read = _read if(abort) return sink.abort() //this function is much simpler to write if you //just use recursion, but by using a while loop //we do not blow the stack if the stream happens to be sync. ;(function next() { var loop = true, cbed = false while(loop) { cbed = false read(null, function (end, data) { cbed = true if(end = end || abort) { loop = false if(done) done(end === true ? null : end) else if(end && end !== true) throw end } else if(op && false === op(data) || abort) { loop = false read(abort || true, done || function () {}) } else if(!loop){ next() } }) if(!cbed) { loop = false return } } })() } sink.abort = function (err, cb) { if('function' == typeof err) cb = err, err = true abort = err || true if(read) return read(abort, cb || function () {}) } return sink } },{}],289:[function(require,module,exports){ 'use strict' function id (e) { return e } var prop = require('../util/prop') var drain = require('./drain') module.exports = function find (test, cb) { var ended = false if(!cb) cb = test, test = id else test = prop(test) || id return drain(function (data) { if(test(data)) { ended = true cb(null, data) return false } }, function (err) { if(ended) return //already called back cb(err === true ? null : err, null) }) } },{"../util/prop":313,"./drain":288}],290:[function(require,module,exports){ 'use strict' module.exports = { drain: require('./drain'), onEnd: require('./on-end'), log: require('./log'), find: require('./find'), reduce: require('./reduce'), collect: require('./collect'), concat: require('./concat') } },{"./collect":286,"./concat":287,"./drain":288,"./find":289,"./log":291,"./on-end":292,"./reduce":293}],291:[function(require,module,exports){ 'use strict' var drain = require('./drain') module.exports = function log (done) { return drain(function (data) { console.log(data) }, done) } },{"./drain":288}],292:[function(require,module,exports){ 'use strict' var drain = require('./drain') module.exports = function onEnd (done) { return drain(null, done) } },{"./drain":288}],293:[function(require,module,exports){ 'use strict' var drain = require('./drain') module.exports = function reduce (reducer, acc, cb) { return drain(function (data) { acc = reducer(acc, data) }, function (err) { cb(err, acc) }) } },{"./drain":288}],294:[function(require,module,exports){ 'use strict' module.exports = function count (max) { var i = 0; max = max || Infinity return function (end, cb) { if(end) return cb && cb(end) if(i > max) return cb(true) cb(null, i++) } } },{}],295:[function(require,module,exports){ 'use strict' //a stream that ends immediately. module.exports = function empty () { return function (abort, cb) { cb(true) } } },{}],296:[function(require,module,exports){ 'use strict' //a stream that errors immediately. module.exports = function error (err) { return function (abort, cb) { cb(err) } } },{}],297:[function(require,module,exports){ 'use strict' module.exports = { keys: require('./keys'), once: require('./once'), values: require('./values'), count: require('./count'), infinite: require('./infinite'), empty: require('./empty'), error: require('./error') } },{"./count":294,"./empty":295,"./error":296,"./infinite":298,"./keys":299,"./once":300,"./values":301}],298:[function(require,module,exports){ 'use strict' module.exports = function infinite (generate) { generate = generate || Math.random return function (end, cb) { if(end) return cb && cb(end) return cb(null, generate()) } } },{}],299:[function(require,module,exports){ 'use strict' var values = require('./values') module.exports = function (object) { return values(Object.keys(object)) } },{"./values":301}],300:[function(require,module,exports){ 'use strict' var abortCb = require('../util/abort-cb') module.exports = function once (value, onAbort) { return function (abort, cb) { if(abort) return abortCb(cb, abort, onAbort) if(value != null) { var _value = value; value = null cb(null, _value) } else cb(true) } } },{"../util/abort-cb":312}],301:[function(require,module,exports){ 'use strict' var abortCb = require('../util/abort-cb') module.exports = function values (array, onAbort) { if(!array) return function (abort, cb) { if(abort) return abortCb(cb, abort, onAbort) return cb(true) } if(!Array.isArray(array)) array = Object.keys(array).map(function (k) { return array[k] }) var i = 0 return function (abort, cb) { if(abort) return abortCb(cb, abort, onAbort) cb(i >= array.length || null, array[i++]) } } },{"../util/abort-cb":312}],302:[function(require,module,exports){ 'use strict' function id (e) { return e } var prop = require('../util/prop') module.exports = function asyncMap (map) { if(!map) return id map = prop(map) var busy = false, abortCb, aborted return function (read) { return function next (abort, cb) { if(aborted) return cb(aborted) if(abort) { aborted = abort if(!busy) read(abort, cb) else read(abort, function () { //if we are still busy, wait for the mapper to complete. if(busy) abortCb = cb else cb(abort) }) } else read(null, function (end, data) { if(end) cb(end) else if(aborted) cb(aborted) else { busy = true map(data, function (err, data) { busy = false if(aborted) { cb(aborted) abortCb(aborted) } else if(err) next (err, cb) else cb(null, data) }) } }) } } } },{"../util/prop":313}],303:[function(require,module,exports){ 'use strict' var tester = require('../util/tester') var filter = require('./filter') module.exports = function filterNot (test) { test = tester(test) return filter(function (data) { return !test(data) }) } },{"../util/tester":314,"./filter":304}],304:[function(require,module,exports){ 'use strict' var tester = require('../util/tester') module.exports = function filter (test) { //regexp test = tester(test) return function (read) { return function next (end, cb) { var sync, loop = true while(loop) { loop = false sync = true read(end, function (end, data) { if(!end && !test(data)) return sync ? loop = true : next(end, cb) cb(end, data) }) sync = false } } } } },{"../util/tester":314}],305:[function(require,module,exports){ 'use strict' var values = require('../sources/values') var once = require('../sources/once') //convert a stream of arrays or streams into just a stream. module.exports = function flatten () { return function (read) { var _read return function (abort, cb) { if (abort) { //abort the current stream, and then stream of streams. _read ? _read(abort, function(err) { read(err || abort, cb) }) : read(abort, cb) } else if(_read) nextChunk() else nextStream() function nextChunk () { _read(null, function (err, data) { if (err === true) nextStream() else if (err) { read(true, function(abortErr) { // TODO: what do we do with the abortErr? cb(err) }) } else cb(null, data) }) } function nextStream () { _read = null read(null, function (end, stream) { if(end) return cb(end) if(Array.isArray(stream) || stream && 'object' === typeof stream) stream = values(stream) else if('function' != typeof stream) stream = once(stream) _read = stream nextChunk() }) } } } } },{"../sources/once":300,"../sources/values":301}],306:[function(require,module,exports){ 'use strict' module.exports = { map: require('./map'), asyncMap: require('./async-map'), filter: require('./filter'), filterNot: require('./filter-not'), through: require('./through'), take: require('./take'), unique: require('./unique'), nonUnique: require('./non-unique'), flatten: require('./flatten') } },{"./async-map":302,"./filter":304,"./filter-not":303,"./flatten":305,"./map":307,"./non-unique":308,"./take":309,"./through":310,"./unique":311}],307:[function(require,module,exports){ 'use strict' function id (e) { return e } var prop = require('../util/prop') module.exports = function map (mapper) { if(!mapper) return id mapper = prop(mapper) return function (read) { return function (abort, cb) { read(abort, function (end, data) { try { data = !end ? mapper(data) : null } catch (err) { return read(err, function () { return cb(err) }) } cb(end, data) }) } } } },{"../util/prop":313}],308:[function(require,module,exports){ 'use strict' var unique = require('./unique') //passes an item through when you see it for the second time. module.exports = function nonUnique (field) { return unique(field, true) } },{"./unique":311}],309:[function(require,module,exports){ 'use strict' //read a number of items and then stop. module.exports = function take (test, opts) { opts = opts || {} var last = opts.last || false // whether the first item for which !test(item) should still pass var ended = false if('number' === typeof test) { last = true var n = test; test = function () { return --n } } return function (read) { function terminate (cb) { read(true, function (err) { last = false; cb(err || true) }) } return function (end, cb) { if(ended) last ? terminate(cb) : cb(ended) else if(ended = end) read(ended, cb) else read(null, function (end, data) { if(ended = ended || end) { //last ? terminate(cb) : cb(ended) } else if(!test(data)) { ended = true last ? cb(null, data) : terminate(cb) } else cb(null, data) }) } } } },{}],310:[function(require,module,exports){ 'use strict' //a pass through stream that doesn't change the value. module.exports = function through (op, onEnd) { var a = false function once (abort) { if(a || !onEnd) return a = true onEnd(abort === true ? null : abort) } return function (read) { return function (end, cb) { if(end) once(end) return read(end, function (end, data) { if(!end) op && op(data) else once(end) cb(end, data) }) } } } },{}],311:[function(require,module,exports){ 'use strict' function id (e) { return e } var prop = require('../util/prop') var filter = require('./filter') //drop items you have already seen. module.exports = function unique (field, invert) { field = prop(field) || id var seen = {} return filter(function (data) { var key = field(data) if(seen[key]) return !!invert //false, by default else seen[key] = true return !invert //true by default }) } },{"../util/prop":313,"./filter":304}],312:[function(require,module,exports){ module.exports = function abortCb(cb, abort, onAbort) { cb(abort) onAbort && onAbort(abort === true ? null: abort) return } },{}],313:[function(require,module,exports){ module.exports = function prop (key) { return key && ( 'string' == typeof key ? function (data) { return data[key] } : 'object' === typeof key && 'function' === typeof key.exec //regexp ? function (data) { var v = key.exec(data); return v && v[0] } : key ) } },{}],314:[function(require,module,exports){ var prop = require('./prop') function id (e) { return e } module.exports = function tester (test) { return ( 'object' === typeof test && 'function' === typeof test.test //regexp ? function (data) { return test.test(data) } : prop (test) || id ) } },{"./prop":313}],315:[function(require,module,exports){ var looper = require('looper') module.exports = function (writer, ender) { return function (read) { var queue = [], ended, error function enqueue (data) { queue.push(data) } writer = writer || function (data) { this.queue(data) } ender = ender || function () { this.queue(null) } var emitter = { emit: function (event, data) { if(event == 'data') enqueue(data) if(event == 'end') ended = true, enqueue(null) if(event == 'error') error = data }, queue: enqueue } var _cb return function (end, cb) { ended = ended || end if(end) return read(end, function () { if(_cb) { var t = _cb; _cb = null; t(end) } cb(end) }) _cb = cb looper(function pull (next) { //if it's an error if(!_cb) return cb = _cb if(error) _cb = null, cb(error) else if(queue.length) { var data = queue.shift() _cb = null,cb(data === null, data) } else { read(ended, function (end, data) { //null has no special meaning for pull-stream if(end && end !== true) { error = end; return next() } if(ended = ended || end) ender.call(emitter) else if(data !== null) { writer.call(emitter, data) if(error || ended) return read(error || ended, function () { _cb = null; cb(error || ended) }) } next(pull) }) } }) } } } },{"looper":234}],316:[function(require,module,exports){ 'use strict'; var ws = require('./') var WebSocket = require('ws') var wsurl = require('./ws-url') function isFunction (f) { return 'function' === typeof f } exports.connect = function (addr, opts) { var stream if(isFunction(opts)) opts = {onConnect: opts} var location = typeof window === 'undefined' ? {} : window.location var url = wsurl(addr, location) var socket = new WebSocket(url) stream = ws(socket, opts) stream.remoteAddress = url stream.close = function (cb) { if (cb && typeof cb == 'function') socket.addEventListener('close', cb) socket.close() } return stream } },{"./":317,"./ws-url":322,"ws":361}],317:[function(require,module,exports){ exports = module.exports = duplex; exports.source = require('./source'); exports.sink = require('./sink'); exports.createServer = require('./server').createServer exports.connect = require('./client').connect function duplex (ws, opts) { var req = ws.upgradeReq || {} if(opts && opts.binaryType) ws.binaryType = opts.binaryType else if(opts && opts.binary) ws.binaryType = 'arraybuffer' return { source: exports.source(ws, opts && opts.onConnect), sink: exports.sink(ws, opts), //http properties - useful for routing or auth. headers: req.headers, url: req.url, upgrade: req.upgrade, method: req.method }; }; },{"./client":316,"./server":319,"./sink":320,"./source":321}],318:[function(require,module,exports){ module.exports = function(socket, callback) { var remove = socket && (socket.removeEventListener || socket.removeListener); function cleanup () { if (typeof remove == 'function') { remove.call(socket, 'open', handleOpen); remove.call(socket, 'error', handleErr); } } function handleOpen(evt) { cleanup(); callback(); } function handleErr (evt) { cleanup(); callback(evt); } // if the socket is closing or closed, return end if (socket.readyState >= 2) { return callback(true); } // if open, trigger the callback if (socket.readyState === 1) { return callback(); } socket.addEventListener('open', handleOpen); socket.addEventListener('error', handleErr); }; },{}],319:[function(require,module,exports){ var ws = require('./') var WebSocket = require('ws') var url = require('url') var http = require('http') var https = require('https') exports.connect = require('./client').connect var EventEmitter = require('events').EventEmitter exports.createServer = function (opts, onConnection) { var emitter = new EventEmitter() var server if (typeof opts === 'function'){ onConnection = opts opts = null } opts = opts || {} if(onConnection) emitter.on('connection', onConnection) function proxy (server, event) { return server.on(event, function () { var args = [].slice.call(arguments) args.unshift(event) emitter.emit.apply(emitter, args) }) } var server = opts.server || (opts.key && opts.cert ? https.createServer(opts) : http.createServer()) var wsServer = new WebSocket.Server({ server: server, verifyClient: opts.verifyClient }) proxy(server, 'listening') proxy(server, 'request') proxy(server, 'close') wsServer.on('connection', function (socket) { var stream = ws(socket) stream.remoteAddress = socket.upgradeReq.socket.remoteAddress emitter.emit('connection', stream) }) emitter.listen = function (addr, onListening) { if(onListening) emitter.once('listening', onListening) server.listen(addr.port || addr) return emitter } emitter.close = function (onClose) { server.close(onClose) wsServer.close() return emitter } return emitter } },{"./":317,"./client":316,"events":84,"http":140,"https":92,"url":146,"ws":361}],320:[function(require,module,exports){ (function (process){ var ready = require('./ready'); /** ### `sink(socket, opts?)` Create a pull-stream `Sink` that will write data to the `socket`. <<< examples/write.js **/ module.exports = function(socket, opts) { return function (read) { opts = opts || {} var closeOnEnd = opts.closeOnEnd !== false; var onClose = 'function' === typeof opts ? opts : opts.onClose; function next(end, data) { // if the stream has ended, simply return if (end) { if (closeOnEnd && socket.readyState <= 1) { if(onClose) socket.addEventListener('close', function (ev) { if(ev.wasClean) onClose() else { var err = new Error('ws error') err.event = ev onClose(err) } }); socket.close(); } return; } // socket ready? ready(socket, function(end) { if (end) { return read(end, function () {}); } socket.send(data); process.nextTick(function() { read(null, next); }); }); } read(null, next); } } }).call(this,require('_process')) },{"./ready":318,"_process":108}],321:[function(require,module,exports){ /** ### `source(socket)` Create a pull-stream `Source` that will read data from the `socket`. <<< examples/read.js **/ module.exports = function(socket, cb) { var buffer = []; var receiver; var ended; var started = false; socket.addEventListener('message', function(evt) { if (receiver) { return receiver(null, evt.data); } buffer.push(evt.data); }); socket.addEventListener('close', function(evt) { if (ended) return if (receiver) { receiver(ended = true) } }); socket.addEventListener('error', function (evt) { if (ended) return; ended = evt; if(!started) { started = true cb && cb(evt) } if (receiver) { receiver(ended) } }); socket.addEventListener('open', function (evt) { if(started || ended) return started = true cb && cb() }) function read(abort, cb) { receiver = null; //if stream has already ended. if (ended) return cb(ended); // if ended, abort else if (abort) { //this will callback when socket closes receiver = cb socket.close() } // return data, if any else if(buffer.length > 0) cb(null, buffer.shift()); // wait for more data (or end) else receiver = cb; }; return read; }; },{}],322:[function(require,module,exports){ var rurl = require('relative-url') var map = {http:'ws', https:'wss'} var def = 'ws' module.exports = function (url, location) { return rurl(url, location, map, def) } },{"relative-url":328}],323:[function(require,module,exports){ // when this is loaded into the browser, // just use the defaults... module.exports = function (name, defaults) { return defaults } },{}],324:[function(require,module,exports){ arguments[4][120][0].apply(exports,arguments) },{"./lib/_stream_duplex.js":325,"dup":120}],325:[function(require,module,exports){ arguments[4][121][0].apply(exports,arguments) },{"./_stream_readable":326,"./_stream_writable":327,"core-util-is":215,"dup":121,"inherits":227,"process-nextick-args":264}],326:[function(require,module,exports){ (function (process){ 'use strict'; module.exports = Readable; /**/ var processNextTick = require('process-nextick-args'); /**/ /**/ var isArray = require('isarray'); /**/ /**/ var Buffer = require('buffer').Buffer; /**/ Readable.ReadableState = ReadableState; var EE = require('events'); /**/ var EElistenerCount = function (emitter, type) { return emitter.listeners(type).length; }; /**/ /**/ var Stream; (function () { try { Stream = require('st' + 'ream'); } catch (_) {} finally { if (!Stream) Stream = require('events').EventEmitter; } })(); /**/ var Buffer = require('buffer').Buffer; /**/ var util = require('core-util-is'); util.inherits = require('inherits'); /**/ /**/ var debugUtil = require('util'); var debug = undefined; if (debugUtil && debugUtil.debuglog) { debug = debugUtil.debuglog('stream'); } else { debug = function () {}; } /**/ var StringDecoder; util.inherits(Readable, Stream); var Duplex; function ReadableState(options, stream) { Duplex = Duplex || require('./_stream_duplex'); options = options || {}; // object stream flag. Used to make read(n) ignore n and to // make all the buffer merging and length checks go away this.objectMode = !!options.objectMode; if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer // Note: 0 is a valid value, means "don't call _read preemptively ever" var hwm = options.highWaterMark; var defaultHwm = this.objectMode ? 16 : 16 * 1024; this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; // cast to ints. this.highWaterMark = ~ ~this.highWaterMark; this.buffer = []; this.length = 0; this.pipes = null; this.pipesCount = 0; this.flowing = null; this.ended = false; this.endEmitted = false; this.reading = false; // a flag to be able to tell if the onwrite cb is called immediately, // or on a later tick. We set this to true at first, because any // actions that shouldn't happen until "later" should generally also // not happen before the first write call. this.sync = true; // whenever we return null, then we set a flag to say // that we're awaiting a 'readable' event emission. this.needReadable = false; this.emittedReadable = false; this.readableListening = false; this.resumeScheduled = false; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // when piping, we only care about 'readable' events that happen // after read()ing all the bytes and not getting any pushback. this.ranOut = false; // the number of writers that are awaiting a drain event in .pipe()s this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled this.readingMore = false; this.decoder = null; this.encoding = null; if (options.encoding) { if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } } var Duplex; function Readable(options) { Duplex = Duplex || require('./_stream_duplex'); if (!(this instanceof Readable)) return new Readable(options); this._readableState = new ReadableState(options, this); // legacy this.readable = true; if (options && typeof options.read === 'function') this._read = options.read; Stream.call(this); } // Manually shove something into the read() buffer. // This returns true if the highWaterMark has not been hit yet, // similar to how Writable.write() returns true if you should // write() some more. Readable.prototype.push = function (chunk, encoding) { var state = this._readableState; if (!state.objectMode && typeof chunk === 'string') { encoding = encoding || state.defaultEncoding; if (encoding !== state.encoding) { chunk = new Buffer(chunk, encoding); encoding = ''; } } return readableAddChunk(this, state, chunk, encoding, false); }; // Unshift should *always* be something directly out of read() Readable.prototype.unshift = function (chunk) { var state = this._readableState; return readableAddChunk(this, state, chunk, '', true); }; Readable.prototype.isPaused = function () { return this._readableState.flowing === false; }; function readableAddChunk(stream, state, chunk, encoding, addToFront) { var er = chunkInvalid(state, chunk); if (er) { stream.emit('error', er); } else if (chunk === null) { state.reading = false; onEofChunk(stream, state); } else if (state.objectMode || chunk && chunk.length > 0) { if (state.ended && !addToFront) { var e = new Error('stream.push() after EOF'); stream.emit('error', e); } else if (state.endEmitted && addToFront) { var e = new Error('stream.unshift() after end event'); stream.emit('error', e); } else { var skipAdd; if (state.decoder && !addToFront && !encoding) { chunk = state.decoder.write(chunk); skipAdd = !state.objectMode && chunk.length === 0; } if (!addToFront) state.reading = false; // Don't add to the buffer if we've decoded to an empty string chunk and // we're not in object mode if (!skipAdd) { // if we want the data now, just emit it. if (state.flowing && state.length === 0 && !state.sync) { stream.emit('data', chunk); stream.read(0); } else { // update the buffer info. state.length += state.objectMode ? 1 : chunk.length; if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); if (state.needReadable) emitReadable(stream); } } maybeReadMore(stream, state); } } else if (!addToFront) { state.reading = false; } return needMoreData(state); } // if it's past the high water mark, we can push in some more. // Also, if we have no data yet, we can stand some // more bytes. This is to work around cases where hwm=0, // such as the repl. Also, if the push() triggered a // readable event, and the user called read(largeNumber) such that // needReadable was set, then we ought to push more, so that another // 'readable' event will be triggered. function needMoreData(state) { return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); } // backwards compatibility. Readable.prototype.setEncoding = function (enc) { if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; this._readableState.decoder = new StringDecoder(enc); this._readableState.encoding = enc; return this; }; // Don't raise the hwm > 8MB var MAX_HWM = 0x800000; function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { n = MAX_HWM; } else { // Get the next highest power of 2 n--; n |= n >>> 1; n |= n >>> 2; n |= n >>> 4; n |= n >>> 8; n |= n >>> 16; n++; } return n; } function howMuchToRead(n, state) { if (state.length === 0 && state.ended) return 0; if (state.objectMode) return n === 0 ? 0 : 1; if (n === null || isNaN(n)) { // only flow one buffer at a time if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; } if (n <= 0) return 0; // If we're asking for more than the target buffer level, // then raise the water mark. Bump up to the next highest // power of 2, to prevent increasing it excessively in tiny // amounts. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); // don't have that much. return null, unless we've ended. if (n > state.length) { if (!state.ended) { state.needReadable = true; return 0; } else { return state.length; } } return n; } // you can override either this method, or the async _read(n) below. Readable.prototype.read = function (n) { debug('read', n); var state = this._readableState; var nOrig = n; if (typeof n !== 'number' || 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.length >= state.highWaterMark || state.ended)) { debug('read: emitReadable', state.length, state.ended); if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); return null; } 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); } 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 (doRead && !state.reading) n = howMuchToRead(nOrig, state); var ret; if (n > 0) ret = fromList(n, state);else ret = null; if (ret === null) { state.needReadable = true; n = 0; } state.length -= n; // If we have nothing in the buffer, then we want to know // as soon as we *do* get something into the buffer. if (state.length === 0 && !state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. if (nOrig !== n && state.ended && state.length === 0) endReadable(this); if (ret !== null) this.emit('data', ret); return ret; }; function chunkInvalid(state, chunk) { var er = null; if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { er = new TypeError('Invalid non-string/buffer chunk'); } return er; } function onEofChunk(stream, state) { if (state.ended) return; if (state.decoder) { var chunk = state.decoder.end(); if (chunk && chunk.length) { state.buffer.push(chunk); state.length += state.objectMode ? 1 : chunk.length; } } state.ended = true; // emit 'readable' now to make sure it gets picked up. 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; state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); } } function emitReadable_(stream) { debug('emit readable'); stream.emit('readable'); 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; processNextTick(maybeReadMore_, stream, state); } } function maybeReadMore_(stream, state) { var len = state.length; while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { debug('maybeReadMore read 0'); stream.read(0); if (len === state.length) // didn't get any data, stop spinning. break;else len = state.length; } state.readingMore = false; } // abstract method. to be overridden in specific implementation classes. // call cb(er, data) where data is <= n in length. // for virtual (non-string, non-buffer) streams, "length" is somewhat // arbitrary, and perhaps not very meaningful. Readable.prototype._read = function (n) { this.emit('error', new Error('not implemented')); }; Readable.prototype.pipe = function (dest, pipeOpts) { var src = this; var state = this._readableState; 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 : cleanup; if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); dest.on('unpipe', onunpipe); function onunpipe(readable) { debug('onunpipe'); if (readable === src) { 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', cleanup); 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); if (false === ret) { // If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. if (state.pipesCount === 1 && state.pipes[0] === dest && src.listenerCount('data') === 1 && !cleanedUp) { debug('false write response, pause', src._readableState.awaitDrain); src._readableState.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) dest.emit('error', er); } // This is a brutally ugly hack to make sure that our error handler // is attached before any userland ones. NEVER DO THIS. if (!dest._events || !dest._events.error) dest.on('error', onerror);else if (isArray(dest._events.error)) dest._events.error.unshift(onerror);else dest._events.error = [onerror, dest._events.error]; // 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 () { 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.prototype.unpipe = function (dest) { var state = this._readableState; // if we're not piping anywhere, then do nothing. if (state.pipesCount === 0) return this; // just one destination. most common case. if (state.pipesCount === 1) { // passed in one, but it's not the right one. if (dest && dest !== state.pipes) return this; if (!dest) dest = state.pipes; // got a match. state.pipes = null; state.pipesCount = 0; state.flowing = false; if (dest) dest.emit('unpipe', this); return this; } // 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); }return this; } // try to find the right one. var i = indexOf(state.pipes, dest); if (i === -1) return this; state.pipes.splice(i, 1); state.pipesCount -= 1; if (state.pipesCount === 1) state.pipes = state.pipes[0]; dest.emit('unpipe', this); return this; }; // set up data events if they are asked for // Ensure readable listeners eventually get something Readable.prototype.on = function (ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); // If listening to data, and it has not explicitly been paused, // then call resume to start the flow of data on the next tick. if (ev === 'data' && false !== this._readableState.flowing) { this.resume(); } if (ev === 'readable' && !this._readableState.endEmitted) { var state = this._readableState; if (!state.readableListening) { state.readableListening = true; state.emittedReadable = false; state.needReadable = true; if (!state.reading) { processNextTick(nReadingNextTick, this); } else if (state.length) { emitReadable(this, state); } } } return res; }; Readable.prototype.addListener = Readable.prototype.on; function nReadingNextTick(self) { debug('readable nexttick read 0'); self.read(0); } // pause() and resume() are remnants of the legacy readable stream API // If the user uses them, then switch into old mode. Readable.prototype.resume = function () { var state = this._readableState; if (!state.flowing) { debug('resume'); state.flowing = true; resume(this, state); } return this; }; function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; processNextTick(resume_, stream, state); } } function resume_(stream, state) { if (!state.reading) { debug('resume read 0'); stream.read(0); } state.resumeScheduled = false; stream.emit('resume'); flow(stream); if (state.flowing && !state.reading) stream.read(0); } Readable.prototype.pause = function () { debug('call pause flowing=%j', this._readableState.flowing); if (false !== this._readableState.flowing) { debug('pause'); this._readableState.flowing = false; this.emit('pause'); } return this; }; function flow(stream) { var state = stream._readableState; debug('flow', state.flowing); if (state.flowing) { do { var chunk = stream.read(); } while (null !== chunk && state.flowing); } } // wrap an old-style stream as the async data source. // This is *not* part of the readable stream interface. // It is an ugly unfortunate mess of history. Readable.prototype.wrap = function (stream) { var state = this._readableState; var paused = false; var self = this; stream.on('end', function () { debug('wrapped end'); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) self.push(chunk); } self.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 = self.push(chunk); if (!ret) { paused = true; stream.pause(); } }); // proxy all the other methods. // important when wrapping filters and duplexes. for (var i in stream) { if (this[i] === undefined && typeof stream[i] === 'function') { this[i] = function (method) { return function () { return stream[method].apply(stream, arguments); }; }(i); } } // proxy certain important events. var events = ['error', 'close', 'destroy', 'pause', 'resume']; forEach(events, function (ev) { stream.on(ev, self.emit.bind(self, ev)); }); // when we try to consume some more bytes, simply unpause the // underlying stream. self._read = function (n) { debug('wrapped _read', n); if (paused) { paused = false; stream.resume(); } }; return self; }; // exposed for testing purposes only. Readable._fromList = fromList; // Pluck off n bytes from an array of buffers. // Length is the combined lengths of all the buffers in the list. function fromList(n, state) { var list = state.buffer; var length = state.length; var stringMode = !!state.decoder; var objectMode = !!state.objectMode; var ret; // nothing in the list, definitely empty. if (list.length === 0) return null; if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { // read it all, truncate the array. if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); list.length = 0; } else { // read just some of it. if (n < list[0].length) { // just take a part of the first list item. // slice is the same for buffers and strings. var buf = list[0]; ret = buf.slice(0, n); list[0] = buf.slice(n); } else if (n === list[0].length) { // first list is a perfect match ret = list.shift(); } else { // complex case. // we have enough to cover it, but it spans past the first buffer. if (stringMode) ret = '';else ret = new Buffer(n); var c = 0; for (var i = 0, l = list.length; i < l && c < n; i++) { var buf = list[0]; var cpy = Math.min(n - c, buf.length); if (stringMode) ret += buf.slice(0, cpy);else buf.copy(ret, c, 0, cpy); if (cpy < buf.length) list[0] = buf.slice(cpy);else list.shift(); c += cpy; } } } return ret; } function endReadable(stream) { var state = stream._readableState; // If we get here before consuming all the bytes, then that is a // bug in node. Should never happen. if (state.length > 0) throw new Error('endReadable called on non-empty stream'); if (!state.endEmitted) { state.ended = true; processNextTick(endReadableNT, state, stream); } } function endReadableNT(state, stream) { // Check that we didn't get one last unshift. if (!state.endEmitted && state.length === 0) { state.endEmitted = true; stream.readable = false; stream.emit('end'); } } function forEach(xs, f) { for (var i = 0, l = xs.length; i < l; i++) { f(xs[i], i); } } function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) return i; } return -1; } }).call(this,require('_process')) },{"./_stream_duplex":325,"_process":108,"buffer":47,"core-util-is":215,"events":84,"inherits":227,"isarray":232,"process-nextick-args":264,"string_decoder/":351,"util":20}],327:[function(require,module,exports){ (function (process){ // A bit simpler than readable streams. // Implement an async ._write(chunk, encoding, cb), and it'll handle all // the drain event emission and buffering. 'use strict'; module.exports = Writable; /**/ var processNextTick = require('process-nextick-args'); /**/ /**/ var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; /**/ /**/ var Buffer = require('buffer').Buffer; /**/ Writable.WritableState = WritableState; /**/ var util = require('core-util-is'); util.inherits = require('inherits'); /**/ /**/ var internalUtil = { deprecate: require('util-deprecate') }; /**/ /**/ var Stream; (function () { try { Stream = require('st' + 'ream'); } catch (_) {} finally { if (!Stream) Stream = require('events').EventEmitter; } })(); /**/ var Buffer = require('buffer').Buffer; util.inherits(Writable, Stream); function nop() {} function WriteReq(chunk, encoding, cb) { this.chunk = chunk; this.encoding = encoding; this.callback = cb; this.next = null; } var Duplex; function WritableState(options, stream) { Duplex = Duplex || require('./_stream_duplex'); options = options || {}; // object stream flag to indicate whether or not this stream // contains buffers or objects. this.objectMode = !!options.objectMode; if (stream instanceof Duplex) 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() var hwm = options.highWaterMark; var defaultHwm = this.objectMode ? 16 : 16 * 1024; this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; // cast to ints. this.highWaterMark = ~ ~this.highWaterMark; this.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; // 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; // count buffered requests this.bufferedRequestCount = 0; // create the two objects needed to store the corked requests // they are not a linked list, as no new elements are inserted in there this.corkedRequestsFree = new CorkedRequest(this); this.corkedRequestsFree.next = new CorkedRequest(this); } WritableState.prototype.getBuffer = function writableStateGetBuffer() { 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 () { return this.getBuffer(); }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') }); } catch (_) {} })(); var Duplex; function Writable(options) { Duplex = Duplex || require('./_stream_duplex'); // Writable ctor is applied to Duplexes, though they're not // instanceof Writable, they're instanceof Readable. if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); this._writableState = new WritableState(options, this); // legacy. this.writable = true; if (options) { if (typeof options.write === 'function') this._write = options.write; if (typeof options.writev === 'function') this._writev = options.writev; } Stream.call(this); } // Otherwise people can pipe Writable streams, which is just wrong. Writable.prototype.pipe = function () { this.emit('error', new Error('Cannot pipe. Not readable.')); }; function writeAfterEnd(stream, cb) { var er = new Error('write after end'); // TODO: defer error events consistently everywhere, not just the cb stream.emit('error', er); processNextTick(cb, er); } // If we get something that is not a buffer, string, null, or undefined, // and we're not in objectMode, then that's an error. // Otherwise stream chunks are all considered to be of length=1, and the // watermarks determine how many objects to keep in the buffer, rather than // how many bytes or characters. function validChunk(stream, state, chunk, cb) { var valid = true; if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { var er = new TypeError('Invalid non-string/buffer chunk'); stream.emit('error', er); processNextTick(cb, er); valid = false; } return valid; } Writable.prototype.write = function (chunk, encoding, cb) { var state = this._writableState; var ret = false; if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; if (typeof cb !== 'function') cb = nop; if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { state.pendingcb++; ret = writeOrBuffer(this, state, chunk, encoding, cb); } return ret; }; Writable.prototype.cork = function () { var state = this._writableState; state.corked++; }; Writable.prototype.uncork = function () { var state = this._writableState; if (state.corked) { state.corked--; if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } }; Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { // node::ParseEncoding() requires lower case. if (typeof encoding === 'string') encoding = encoding.toLowerCase(); if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); this._writableState.defaultEncoding = encoding; }; function decodeChunk(state, chunk, encoding) { if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { chunk = new Buffer(chunk, encoding); } return chunk; } // if we're already writing something, then just put this // in the queue, and wait our turn. Otherwise, call _write // If we return false, then we need a drain event, so set that flag. function writeOrBuffer(stream, state, chunk, encoding, cb) { chunk = decodeChunk(state, chunk, encoding); if (Buffer.isBuffer(chunk)) encoding = 'buffer'; 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 = new WriteReq(chunk, encoding, cb); if (last) { last.next = state.lastBufferedRequest; } else { state.bufferedRequest = state.lastBufferedRequest; } state.bufferedRequestCount += 1; } else { doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len; state.writecb = cb; state.writing = true; state.sync = true; if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); state.sync = false; } function onwriteError(stream, state, sync, er, cb) { --state.pendingcb; if (sync) processNextTick(cb, er);else cb(er); stream._writableState.errorEmitted = true; stream.emit('error', er); } 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; 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); if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { clearBuffer(stream, state); } if (sync) { /**/ asyncWrite(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; while (entry) { buffer[count] = entry; entry = entry.next; count += 1; } doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is always async, defer these to save a bit of time // as the hot path ends with doWrite state.pendingcb++; state.lastBufferedRequest = null; state.corkedRequestsFree = holder.next; holder.next = null; } 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; // 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.bufferedRequestCount = 0; state.bufferedRequest = entry; state.bufferProcessing = false; } Writable.prototype._write = function (chunk, encoding, cb) { cb(new Error('not implemented')); }; Writable.prototype._writev = null; Writable.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 && !state.finished) endWritable(this, state, cb); }; function needFinish(state) { return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } function prefinish(stream, state) { if (!state.prefinished) { state.prefinished = true; stream.emit('prefinish'); } } function finishMaybe(stream, state) { var need = needFinish(state); if (need) { if (state.pendingcb === 0) { prefinish(stream, state); state.finished = true; stream.emit('finish'); } else { prefinish(stream, state); } } return need; } function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); if (cb) { if (state.finished) processNextTick(cb);else stream.once('finish', cb); } state.ended = true; stream.writable = false; } // It seems a linked list but it is not // there will be only 2 of these for each stream function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function (err) { var entry = _this.entry; _this.entry = null; while (entry) { var cb = entry.callback; state.pendingcb--; cb(err); entry = entry.next; } if (state.corkedRequestsFree) { state.corkedRequestsFree.next = _this; } else { state.corkedRequestsFree = _this; } }; } }).call(this,require('_process')) },{"./_stream_duplex":325,"_process":108,"buffer":47,"core-util-is":215,"events":84,"inherits":227,"process-nextick-args":264,"util-deprecate":360}],328:[function(require,module,exports){ //normalize a ws url. var URL = require('url') module.exports = function (url, location, protocolMap, defaultProtocol) { protocolMap = protocolMap ||{} /* https://nodejs.org/dist/latest-v6.x/docs/api/url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost I didn't know this, but url.parse takes a 3rd argument which interprets "//foo.com" as the hostname, but without the protocol. by default, // is interpreted as the path. that lets us do what the wsurl module does. https://www.npmjs.com/package/wsurl but most of the time, I want to write js that will work on localhost, and will work on a server... so I want to just do createWebSocket('/') and get "ws://mydomain.com/" */ var url = URL.parse(url, false, true) var proto if(url.protocol) proto = url.protocol else { proto = location.protocol ? location.protocol.replace(/:$/,'') : 'http' proto = ((protocolMap)[proto] || defaultProtocol || proto) + ':' } //handle quirk in url package if(url.host && url.host[0] === ':') url.host = null //useful for websockets if(url.hostname) { return URL.format({ protocol: proto, slashes: true, hostname: url.hostname, port: url.port, pathname: url.pathname, search: url.search }) } else url.host = location.host //included for completeness. would you want to do this? if(url.port) { return URL.format({ protocol: proto, slashes: true, host: location.hostname + ':' + url.port, port: url.port, pathname: url.pathname, search: url.search }) } //definately useful for websockets if(url.pathname) { return URL.format({ protocol: proto, slashes: true, host: url.host, pathname: url.pathname, search: url.search }) } else url.pathname = location.pathname //included for completeness. would you want to do this? if(url.search) { return URL.format({ protocol: proto, slashes: true, host: url.host, pathname: url.pathname, search: url.search }) } else url.search = location.search return url.format(url) } },{"url":146}],329:[function(require,module,exports){ //module.exports = function (sep, esc) { // sep = sep || ',' // esc = esc || '\\' // // new RegExp('([^'+sep+']|'+esc+sep+') //} module.exports = function (sep, esc) { if(sep.length != 1) throw new Error('separator must be a single char') if(esc.length != 1) throw new Error('escape must be a single char') return { parse: function (str) { var ary = [] var cur = '' for(var i = 0; i < str.length; i++) { if(str[i] == esc && i+1 < str.length) { console.log(str[i], str[i+1], str, i) cur += str[++i] } else if(str[i] === sep) { ary.push(cur) cur = '' } else cur += str[i] } ary.push(cur) return ary }, stringify: function (ary) { //for each item in the array. return ary.map(function (str) { var s = '' for(var i = 0; i < str.length; i++) { if(str[i] === esc || str[i] === sep) s += esc + str[i] else s += str[i] } return s }).join(sep) } } } },{}],330:[function(require,module,exports){ module.exports = function split (data, max) { if(max <= 0) throw new Error('cannot split into zero (or smaller) length buffers') if(data.length <= max) return [data] var out = [], len = 0 while(len < data.length) { out.push(data.slice(len, Math.min(len + max, data.length))) len += max } return out } },{}],331:[function(require,module,exports){ 'use strict' var pull = require('pull-stream') var cat = require('pull-cat') var mlib = require('ssb-msgs') function truncate(str, len) { str = String(str) return str.length < len ? str : str.substr(0, len-1) + '…' } module.exports = function getAvatar(sbot, source, dest, cb) { var name, image pull( cat([ // First get About info that we gave them. sbot.links({ source: source, dest: dest, rel: 'about', values: true, reverse: true }), // If that isn't enough, then get About info that they gave themselves. sbot.links({ source: dest, dest: dest, rel: 'about', values: true, reverse: true }), // Finally, get About info from other feeds. sbot.links({ dest: dest, rel: 'about', values: true, reverse: true }), ]), pull.filter(function (msg) { return msg && msg.value.content }), pull.drain(function (msg) { if (name && image) return false // end the streams early var c = msg.value.content if (!name) { name = c.name } if (!image) { var imgLink = mlib.link(c.image, 'blob') image = imgLink && imgLink.link } }, function (err) { if (err && err !== true) return cb (err) if (!name) name = truncate(dest, 8) cb(null, {id: dest, name: name, image: image, from: source}) }) ) } },{"pull-cat":266,"pull-stream":284,"ssb-msgs":347}],332:[function(require,module,exports){ (function (Buffer){ 'use strict' var path = require('path') var ssbKeys = require('ssb-keys') var explain = require('explain-error') var path = require('path') var fs = require('fs') var MultiServer = require('multiserver') var WS = require('multiserver/plugins/ws') var Net = require('multiserver/plugins/net') var Shs = require('multiserver/plugins/shs') var muxrpc = require('muxrpc') var pull = require('pull-stream') function toSodiumKeys(keys) { if(!keys || !keys.public) return null return { publicKey: new Buffer(keys.public.replace('.ed25519',''), 'base64'), secretKey: new Buffer(keys.private.replace('.ed25519',''), 'base64'), } } var cap = new Buffer('1KHLiKZvAvjbY1ziZEHMXawbCEIM6qwjCDm3VYRan/s=', 'base64') var createConfig = require('ssb-config/inject') module.exports = function (keys, opts, cb) { var config if (typeof keys == 'function') { cb = keys keys = null opts = null } else if (typeof opts == 'function') { cb = opts opts = keys keys = null } if(typeof opts === 'string' || opts == null || !keys) config = createConfig(typeof opts === 'string' ? opts : null) else config = {} keys = keys || ssbKeys.loadOrCreateSync(path.join(config.path, 'secret')) opts = opts || {} var remote if(opts.remote) remote = opts.remote else { var host = opts.host || 'localhost' var port = opts.port || config.port || 8008 var key = opts.key || keys.id remote = 'net:'+host+':'+port+'~shs:'+key.substring(1).replace('.ed25519', '') } var manifest = opts.manifest || (function () { try { return JSON.parse(fs.readFileSync( path.join(config.path, 'manifest.json') )) } catch (err) { throw explain(err, 'could not load manifest file') } })() var shs = Shs({ keys: toSodiumKeys(keys), appKey: opts.appKey || cap, //no client auth. we can't receive connections anyway. auth: function (cb) { cb(null, false) }, timeout: 1000 }) var ms = MultiServer([ [Net({}), shs], [WS({}), shs] ]) ms.client(remote, function (err, stream) { if(err) return cb(explain(err, 'could not connect to sbot')) var sbot = muxrpc(manifest, false)() pull(stream, sbot.createStream(), stream) cb(null, sbot) }) } }).call(this,require("buffer").Buffer) },{"buffer":47,"explain-error":220,"fs":1,"multiserver":241,"multiserver/plugins/net":246,"multiserver/plugins/shs":247,"multiserver/plugins/ws":248,"muxrpc":250,"path":105,"pull-stream":284,"ssb-config/inject":333,"ssb-keys":337}],333:[function(require,module,exports){ var path = require('path') var home = require('osenv').home var nonPrivate = require('non-private-ip') var merge = require('deep-extend') var RC = require('rc') var SEC = 1e3 var MIN = 60*SEC module.exports = function (name, override) { name = name || 'ssb' var HOME = home() || 'browser' //most probably browser return RC(name || 'ssb', merge({ //just use an ipv4 address by default. //there have been some reports of seemingly non-private //ipv6 addresses being returned and not working. //https://github.com/ssbc/scuttlebot/pull/102 party: true, host: nonPrivate.v4 || '', port: 8008, timeout: 0, pub: true, local: true, friends: { dunbar: 150, hops: 3 }, gossip: { connections: 3 }, path: path.join(HOME, '.' + name), timers: { connection: 0, reconnect: 5*SEC, ping: 5*MIN, handshake: 5*SEC }, master: [], logging: { level: 'notice' }, party: true //disable quotas }, override || {})) } },{"deep-extend":216,"non-private-ip":256,"osenv":260,"path":105,"rc":323}],334:[function(require,module,exports){ (function (Buffer){ var cont = require('cont') var util = require('./util') var Queue = require('./queue') var ssbKeys = require('ssb-keys') function isFunction (f) { return 'function' === typeof f } function isObject (o) { return ( o && 'object' === typeof o && !Buffer.isBuffer(o) && !Array.isArray(o) ) } module.exports = function (ssb, keys) { if(!ssb.add) throw new Error('*must* install feeds on this ssb instance') var queue = Queue(function (msg, prev, cb) { if(prev) next(prev) else ssb.getLatest(keys.id, function (_, prev) { next(prev) }) function next (prev) { ssb.add( util.create( keys, null, msg, prev && prev.value, prev && prev.key ), cb ) } }) var publish = cont(function (type, message, cb) { // argument variations if (isFunction(message)) { cb = message; message = type } // add(msgObj, cbFn) else if (isObject(message)) { message.type = type } // add(typeStr, mgObj, cbFn) else { message = { type: type, value: message } } // add(typeStr, msgStr, cbFn) var err = util.isInvalidContent(message) if(err) return cb(err) queue(message, cb) return this }) return { id: keys.id, keys: keys, add: publish, publish: publish } } }).call(this,{"isBuffer":require("../../../../.nvm/versions/node/v6.2.0/lib/node_modules/browserify/node_modules/is-buffer/index.js")}) },{"../../../../.nvm/versions/node/v6.2.0/lib/node_modules/browserify/node_modules/is-buffer/index.js":96,"./queue":335,"./util":336,"cont":197,"ssb-keys":337}],335:[function(require,module,exports){ module.exports = function (async) { var queue = [], working = false, prev = null function start () { if(working) return working = true ;(function next (item) { async(item.value, prev, function (err, result) { prev = result if(item.cb) item.cb(err, result) if(queue.length) next(queue.shift(), result) else working = false }) })(queue.shift()) } return function (value, cb) { queue.push({value: value, cb: cb}) start() } } },{}],336:[function(require,module,exports){ (function (Buffer){ var ssbKeys = require('ssb-keys') var timestamp = require('monotonic-timestamp') var isRef = require('ssb-ref') var isHash = isRef.isHash var isFeedId = isRef.isFeedId var encode = exports.encode = function (obj) { return JSON.stringify(obj, null, 2) } function isString (s) { return 'string' === typeof s } function isInteger (n) { return ~~n === n } function isObject (o) { return o && 'object' === typeof o } function clone (obj) { var o = {} for(var k in obj) o[k] = obj[k]; return o } function isEncrypted (str) { return isString(str) && /^[0-9A-Za-z\/+]+={0,2}\.box/.test(str) } exports.BatchQueue = function BatchQueue (db) { var batch = [], writing = false function drain () { writing = true var _batch = batch batch = [] db.batch(_batch, function () { writing = false write.size = batch.length if(batch.length) drain() _batch.forEach(function (op) { op.cb(null, {key:op.key, value: op.value}) }) }) } function write (op) { batch.push(op) write.size = batch.length if(!writing) drain() } write.size = 0 return write } exports.create = function (keys, type, content, prev, prev_key) { //this noise is to handle things calling this with legacy api. if(isString(type) && (Buffer.isBuffer(content) || isString(content))) content = {type: type, value: content} if(isObject(content)) content.type = content.type || type //noise end prev_key = !prev_key && prev ? ('%'+ssbKeys.hash(encode(prev))) : prev_key || null return ssbKeys.signObj(keys, { previous: prev_key, author: keys.id, sequence: prev ? prev.sequence + 1 : 1, timestamp: timestamp(), hash: 'sha256', content: content, }) } var isInvalidContent = exports.isInvalidContent = function (content) { if(!isEncrypted(content)) { type = content.type if (!(isString(type) && type.length <= 52 && type.length >= 3)) { return new Error('type must be a string' + '3 <= type.length < 52, was:' + type ) } } return false } exports.isInvalidShape = function (msg) { if( !isObject(msg) || !isInteger(msg.sequence) || !isFeedId(msg.author) || !(isObject(msg.content) || isEncrypted(msg.content)) ) return new Error('message has invalid properties') //allow encrypted messages, where content is a base64 string. var asJson = encode(msg) if (asJson.length > 8192) // 8kb return new Error( 'encoded message must not be larger than 8192 bytes') return isInvalidContent(msg.content) } exports.isInvalid = function validateSync (pub, msg, previous) { // :TODO: is there a faster way to measure the size of this message? var key = previous.key var prev = previous.value if(prev) { if(msg.previous !== key) return new Error( 'expected previous: ' + key + 'but found:' + msg.previous ) if(msg.sequence !== prev.sequence + 1 || msg.timestamp <= prev.timestamp) return new Error('out of order') } else { if(!(msg.previous == null && msg.sequence === 1 && msg.timestamp > 0)) return new Error('expected initial message') } if(msg.author !== pub) { return new Error( 'expected different author:' + hash(pub.public || pub).toString('base64') + 'but found:' + msg.author.toString('base64') ) } if(!ssbKeys.verifyObj(pub, msg)) return new Error('signature was invalid') return false } }).call(this,{"isBuffer":require("../../../../.nvm/versions/node/v6.2.0/lib/node_modules/browserify/node_modules/is-buffer/index.js")}) },{"../../../../.nvm/versions/node/v6.2.0/lib/node_modules/browserify/node_modules/is-buffer/index.js":96,"monotonic-timestamp":239,"ssb-keys":337,"ssb-ref":348}],337:[function(require,module,exports){ (function (Buffer){ var deepEqual = require('deep-equal') var createHmac = require('hmac') var sodium = require('chloride') var ssbref = require('ssb-ref') var pb = require('private-box') var u = require('./util') var isBuffer = Buffer.isBuffer function isString (s) { return 'string' === typeof s } //UTILS function clone (obj) { var _obj = {} for(var k in obj) { if(Object.hasOwnProperty.call(obj, k)) _obj[k] = obj[k] } return _obj } var isLink = ssbref.isLink var isFeedId = ssbref.isFeedId exports.hash = u.hash exports.getTag = u.getTag function isObject (o) { return 'object' === typeof o } function isFunction (f) { return 'function' === typeof f } function isString(s) { return 'string' === typeof s } var curves = {} curves.ed25519 = require('./sodium') try { curves.k256 = require('./eccjs') } catch (_) {} function getCurve(keys) { var curve = keys.curve if(!keys.curve && isString(keys.public)) keys = keys.public if(!curve && isString(keys)) curve = u.getTag(keys) if(!curves[curve]) { throw new Error( 'unkown curve:' + curve + ' expected: '+Object.keys(curves) ) } return curve } //this should return a key pair: // {curve: curve, public: Buffer, private: Buffer} exports.generate = function (curve, seed) { curve = curve || 'ed25519' if(!curves[curve]) throw new Error('unknown curve:'+curve) return u.keysToJSON(curves[curve].generate(seed), curve) } //import functions for loading/saving keys from storage var storage = require('./storage')(exports.generate) for(var key in storage) exports[key] = storage[key] exports.loadOrCreate = function (filename, cb) { exports.load(filename, function (err, keys) { if(!err) return cb(null, keys) exports.create(filename, cb) }) } exports.loadOrCreateSync = function (filename) { try { return exports.loadSync(filename) } catch (err) { return exports.createSync(filename) } } //takes a public key and a hash and returns a signature. //(a signature must be a node buffer) exports.sign = function (keys, msg) { if(isString(msg)) msg = new Buffer(msg) if(!isBuffer(msg)) throw new Error('msg should be buffer') var curve = getCurve(keys) return curves[curve] .sign(u.toBuffer(keys.private || keys), msg) .toString('base64')+'.sig.'+curve } //takes a public key, signature, and a hash //and returns true if the signature was valid. exports.verify = function (keys, sig, msg) { if(isObject(sig)) throw new Error('signature should be base64 string, did you mean verifyObj(public, signed_obj)') return curves[getCurve(keys)].verify( u.toBuffer(keys.public || keys), u.toBuffer(sig), isBuffer(msg) ? msg : new Buffer(msg) ) } // OTHER CRYTPO FUNCTIONS exports.hmac = function (data, key) { //no longer used, pretty sure. return createHmac(createHash, 64, key) .update(data).digest('base64')+'.sha256.hmac' } exports.signObj = function (keys, obj) { var _obj = clone(obj) var b = new Buffer(JSON.stringify(_obj, null, 2)) _obj.signature = exports.sign(keys, b) return _obj } exports.verifyObj = function (keys, obj) { obj = clone(obj) var sig = obj.signature delete obj.signature var b = new Buffer(JSON.stringify(obj, null, 2)) return exports.verify(keys, sig, b) } exports.box = function (msg, recipients) { msg = new Buffer(JSON.stringify(msg)) recipients = recipients.map(function (keys) { var public = keys.public || keys return sodium.crypto_sign_ed25519_pk_to_curve25519(u.toBuffer(public)) }) //it's since the nonce is 24 bytes (a multiple of 3) //it's possible to concatenate the base64 strings //and still have a valid base64 string. return pb.multibox(msg, recipients).toString('base64')+'.box' } exports.unbox = function (boxed, keys) { boxed = u.toBuffer(boxed) var sk = sodium.crypto_sign_ed25519_sk_to_curve25519(u.toBuffer(keys.private || keys)) var msg = pb.multibox_open(boxed, sk) if(msg) return JSON.parse(''+msg) } }).call(this,require("buffer").Buffer) },{"./eccjs":20,"./sodium":342,"./storage":338,"./util":343,"buffer":47,"chloride":155,"deep-equal":339,"hmac":221,"private-box":263,"ssb-ref":348}],338:[function(require,module,exports){ var u = require('./util') function isFunction (f) { return 'function' == typeof f } module.exports = function (generate) { function create (filename, curve, legacy) { var keys = generate(curve, legacy) localStorage[filename] = JSON.stringify(keys) return keys } function load (filename) { return JSON.parse(localStorage[filename]) } return { createSync: create, create: function(filename, curve, legacy, cb) { if(isFunction(legacy)) cb = legacy, legacy = null if(isFunction(curve)) cb = curve, curve = null cb(null, create(filename, curve, legacy)) }, loadSync: load, load: function (filename, cb) { cb(null, load(filename)) } } } },{"./util":343}],339:[function(require,module,exports){ var pSlice = Array.prototype.slice; var objectKeys = require('./lib/keys.js'); var isArguments = require('./lib/is_arguments.js'); var deepEqual = module.exports = function (actual, expected, opts) { if (!opts) opts = {}; // 7.1. All identical values are equivalent, as determined by ===. if (actual === expected) { return true; } else if (actual instanceof Date && expected instanceof Date) { return actual.getTime() === expected.getTime(); // 7.3. Other pairs that do not both pass typeof value == 'object', // equivalence is determined by ==. } else if (typeof actual != 'object' && typeof expected != 'object') { return opts.strict ? actual === expected : actual == expected; // 7.4. For all other Object pairs, including Array objects, equivalence is // determined by having the same number of owned properties (as verified // with Object.prototype.hasOwnProperty.call), the same set of keys // (although not necessarily the same order), equivalent values for every // corresponding key, and an identical 'prototype' property. Note: this // accounts for both named and indexed properties on Arrays. } else { return objEquiv(actual, expected, opts); } } function isUndefinedOrNull(value) { return value === null || value === undefined; } function isBuffer (x) { if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { return false; } if (x.length > 0 && typeof x[0] !== 'number') return false; return true; } function objEquiv(a, b, opts) { var i, key; if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) return false; // an identical 'prototype' property. if (a.prototype !== b.prototype) return false; //~~~I've managed to break Object.keys through screwy arguments passing. // Converting to array solves the problem. if (isArguments(a)) { if (!isArguments(b)) { return false; } a = pSlice.call(a); b = pSlice.call(b); return deepEqual(a, b, opts); } if (isBuffer(a)) { if (!isBuffer(b)) { return false; } if (a.length !== b.length) return false; for (i = 0; i < a.length; i++) { if (a[i] !== b[i]) return false; } return true; } try { var ka = objectKeys(a), kb = objectKeys(b); } catch (e) {//happens when one is a string literal and the other isn't return false; } // having the same number of owned properties (keys incorporates // hasOwnProperty) if (ka.length != kb.length) return false; //the same set of keys (although not necessarily the same order), ka.sort(); kb.sort(); //~~~cheap key test for (i = ka.length - 1; i >= 0; i--) { if (ka[i] != kb[i]) return false; } //equivalent values for every corresponding key, and //~~~possibly expensive deep test for (i = ka.length - 1; i >= 0; i--) { key = ka[i]; if (!deepEqual(a[key], b[key], opts)) return false; } return typeof a === typeof b; } },{"./lib/is_arguments.js":340,"./lib/keys.js":341}],340:[function(require,module,exports){ var supportsArgumentsClass = (function(){ return Object.prototype.toString.call(arguments) })() == '[object Arguments]'; exports = module.exports = supportsArgumentsClass ? supported : unsupported; exports.supported = supported; function supported(object) { return Object.prototype.toString.call(object) == '[object Arguments]'; }; exports.unsupported = unsupported; function unsupported(object){ return object && typeof object == 'object' && typeof object.length == 'number' && Object.prototype.hasOwnProperty.call(object, 'callee') && !Object.prototype.propertyIsEnumerable.call(object, 'callee') || false; }; },{}],341:[function(require,module,exports){ exports = module.exports = typeof Object.keys === 'function' ? Object.keys : shim; exports.shim = shim; function shim (obj) { var keys = []; for (var key in obj) keys.push(key); return keys; } },{}],342:[function(require,module,exports){ var sodium = require('chloride') var crypto = require('crypto') module.exports = { curves: ['ed25519'], generate: function (seed) { var keys = sodium.crypto_sign_seed_keypair(seed || crypto.randomBytes(32)) return { curve: 'ed25519', public: keys.publicKey, //so that this works with either sodium //or libsodium-wrappers (in browser) private: keys.privateKey || keys.secretKey } }, sign: function (private, message) { return sodium.crypto_sign_detached(message, private) }, verify: function (public, sig, message) { return sodium.crypto_sign_verify_detached(sig, message, public) } } },{"chloride":155,"crypto":56}],343:[function(require,module,exports){ (function (Buffer){ var crypto = require('crypto') exports.hash = function (data, enc) { data = ( 'string' === typeof data && enc == null ? new Buffer(data, 'binary') : new Buffer(data, enc) ) return crypto.createHash('sha256').update(data).digest('base64')+'.sha256' } exports.hasSigil = function hasSigil (s) { return /^(@|%|&)/.test(s) } function tag (key, tag) { if(!tag) throw new Error('no tag for:' + key.toString('base64')) return key.toString('base64')+'.' + tag.replace(/^\./, '') } exports.keysToJSON = function keysToJSON(keys, curve) { curve = (keys.curve || curve) var pub = tag(keys.public.toString('base64'), curve) return { curve: curve, public: pub, private: keys.private ? tag(keys.private.toString('base64'), curve) : undefined, id: '@'+(curve === 'ed25519' ? pub : exports.hash(pub)) } } exports.getTag = function getTag (string) { var i = string.indexOf('.') return string.substring(i+1) } //crazy hack to make electron not crash function base64ToBuffer(s) { var l = s.length * 6 / 8 if(s[s.length - 2] == '=') l = l - 2 else if(s[s.length - 1] == '=') l = l - 1 var b = new Buffer(l) b.write(s, 'base64') return b } exports.toBuffer = function (buf) { if(buf == null) return buf if(Buffer.isBuffer(buf)) throw new Error('already a buffer') var i = buf.indexOf('.') var start = (exports.hasSigil(buf)) ? 1 : 0 return new Buffer(buf.substring(start, ~i ? i : buf.length), 'base64') // return base64ToBuffer() } //function toUint8(buf) { // return new Uint8Array(toBuffer(buf)) //} }).call(this,require("buffer").Buffer) },{"buffer":47,"crypto":56}],344:[function(require,module,exports){ 'use strict' var emojiNamedCharacters = require('emoji-named-characters') var marked = require('ssb-marked') var ssbref = require('ssb-ref') var mlib = require('ssb-msgs') var blockRenderer = new marked.Renderer() var inlineRenderer = new marked.Renderer() // override to only allow external links or hashes, and correctly link to ssb objects blockRenderer.urltransform = function (url) { var c = url.charAt(0) var hasSigil = (c == '@' || c == '&' || c == '%') if (this.options.sanitize && !hasSigil) { // sanitize - only allow ssb refs or http/s links try { var prot = decodeURIComponent(unescape(url.replace(/[^\w:]/g, ''))).toLowerCase(); } catch (e) { return false; } if (prot.indexOf('http:') !== 0 && prot.indexOf('https:') !== 0 && prot.indexOf('data:') !== 0) { return false; } } // use our own link if this is an ssb ref var isSsbRef = ssbref.isLink(url) if ((hasSigil || isSsbRef) && this.options.toUrl) { return this.options.toUrl(url) } return url } // override to make http/s links external blockRenderer.link = function(href, title, text) { href = this.urltransform(href) var out if (href !== false) { if ((href.indexOf('/%26') === 0 || href.indexOf('/&') === 0) && (title || text)) // add ?name param if this is a link to a blob href += '?name='+encodeURIComponent(title || text) out = ''; return out; }; blockRenderer.image = function (href, title, text) { href = href.replace(/^&/, '&') if (ssbref.isLink(href) && this.options.toUrl) { var url = this.options.toUrl(href) var out = '' + text + '/g, '>') .replace(/"/g, '"') .replace(/\n+/g, ' ') } function shortenIfLink (text) { return (ssbref.isLink(text.trim())) ? text.slice(0, 8) : text } marked.setOptions({ gfm: true, mentions: true, tables: true, breaks: true, pedantic: false, sanitize: true, smartLists: true, smartypants: false, emoji: renderEmoji(16), renderer: blockRenderer }) exports.block = function(text, opts) { return marked(''+(text||''), opts) } exports.inline = function(text) { return marked(''+(text||''), { renderer: inlineRenderer, emoji: renderEmoji(12) }) } var emojiRegex = /(\s|>|^)?:([A-z0-9_]+):(\s|<|$)/g; exports.emojis = function (str) { return str.replace(emojiRegex, function(full, $1, $2, $3) { return ($1||'') + renderEmoji(16)($2) + ($3||'') }) } function renderEmoji (size) { size = size||20 return function (emoji) { return emoji in emojiNamedCharacters ? ':' + escape(emoji) + ':' : ':' + emoji + ':' } } },{"emoji-named-characters":219,"ssb-marked":345,"ssb-msgs":347,"ssb-ref":348}],345:[function(require,module,exports){ (function (global){ /** * marked - a markdown parser * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/chjj/marked */ ;(function() { /** * Block-Level Grammar */ var block = { newline: /^\n+/, code: /^( {4}[^\n]+\n*)+/, fences: noop, hr: /^( *[-*_]){3,} *(?:\n+|$)/, heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, nptable: noop, lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/, list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/, def: /^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, table: noop, paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/, text: /^[^\n]+/ }; block.bullet = /(?:[*+-]|\d+\.)/; block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; block.item = replace(block.item, 'gm') (/bull/g, block.bullet) (); block.list = replace(block.list) (/bull/g, block.bullet) ('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))') ('def', '\\n+(?=' + block.def.source + ')') (); block.blockquote = replace(block.blockquote) ('def', block.def) (); block._tag = '(?!(?:' + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b'; block.html = replace(block.html) ('comment', //) ('closed', /<(tag)[\s\S]+?<\/\1>/) ('closing', /])*?>/) (/tag/g, block._tag) (); block.paragraph = replace(block.paragraph) ('hr', block.hr) ('heading', block.heading) ('lheading', block.lheading) ('blockquote', block.blockquote) ('tag', '<' + block._tag) ('def', block.def) (); /** * Normal Block Grammar */ block.normal = merge({}, block); /** * GFM Block Grammar */ block.gfm = merge({}, block.normal, { fences: /^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/, paragraph: /^/ }); block.gfm.paragraph = replace(block.paragraph) ('(?!', '(?!' + block.gfm.fences.source.replace('\\1', '\\2') + '|' + block.list.source.replace('\\1', '\\3') + '|') (); /** * GFM + Tables Block Grammar */ block.tables = merge({}, block.gfm, { nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/, table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/ }); /** * Block Lexer */ function Lexer(options) { this.tokens = []; this.tokens.links = {}; this.options = options || marked.defaults; this.rules = block.normal; if (this.options.gfm) { if (this.options.tables) { this.rules = block.tables; } else { this.rules = block.gfm; } } } /** * Expose Block Rules */ Lexer.rules = block; /** * Static Lex Method */ Lexer.lex = function(src, options) { var lexer = new Lexer(options); return lexer.lex(src); }; /** * Preprocessing */ Lexer.prototype.lex = function(src) { src = src .replace(/\r\n|\r/g, '\n') .replace(/\t/g, ' ') .replace(/\u00a0/g, ' ') .replace(/\u2424/g, '\n'); return this.token(src, true); }; /** * Lexing */ Lexer.prototype.token = function(src, top, bq) { var src = src.replace(/^ +$/gm, '') , next , loose , cap , bull , b , item , space , i , l; while (src) { // newline if (cap = this.rules.newline.exec(src)) { src = src.substring(cap[0].length); if (cap[0].length > 1) { this.tokens.push({ type: 'space' }); } } // code if (cap = this.rules.code.exec(src)) { src = src.substring(cap[0].length); cap = cap[0].replace(/^ {4}/gm, ''); this.tokens.push({ type: 'code', text: !this.options.pedantic ? cap.replace(/\n+$/, '') : cap }); continue; } // fences (gfm) if (cap = this.rules.fences.exec(src)) { src = src.substring(cap[0].length); this.tokens.push({ type: 'code', lang: cap[2], text: cap[3] }); continue; } // heading if (cap = this.rules.heading.exec(src)) { src = src.substring(cap[0].length); this.tokens.push({ type: 'heading', depth: cap[1].length, text: cap[2] }); continue; } // table no leading pipe (gfm) if (top && (cap = this.rules.nptable.exec(src))) { src = src.substring(cap[0].length); item = { type: 'table', header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), cells: cap[3].replace(/\n$/, '').split('\n') }; for (i = 0; i < item.align.length; i++) { if (/^ *-+: *$/.test(item.align[i])) { item.align[i] = 'right'; } else if (/^ *:-+: *$/.test(item.align[i])) { item.align[i] = 'center'; } else if (/^ *:-+ *$/.test(item.align[i])) { item.align[i] = 'left'; } else { item.align[i] = null; } } for (i = 0; i < item.cells.length; i++) { item.cells[i] = item.cells[i].split(/ *\| */); } this.tokens.push(item); continue; } // lheading if (cap = this.rules.lheading.exec(src)) { src = src.substring(cap[0].length); this.tokens.push({ type: 'heading', depth: cap[2] === '=' ? 1 : 2, text: cap[1] }); continue; } // hr if (cap = this.rules.hr.exec(src)) { src = src.substring(cap[0].length); this.tokens.push({ type: 'hr' }); continue; } // blockquote if (cap = this.rules.blockquote.exec(src)) { src = src.substring(cap[0].length); this.tokens.push({ type: 'blockquote_start' }); cap = cap[0].replace(/^ *> ?/gm, ''); // Pass `top` to keep the current // "toplevel" state. This is exactly // how markdown.pl works. this.token(cap, top, true); this.tokens.push({ type: 'blockquote_end' }); continue; } // list if (cap = this.rules.list.exec(src)) { src = src.substring(cap[0].length); bull = cap[2]; this.tokens.push({ type: 'list_start', ordered: bull.length > 1 }); // Get each top-level item. cap = cap[0].match(this.rules.item); next = false; l = cap.length; i = 0; for (; i < l; i++) { item = cap[i]; // Remove the list item's bullet // so it is seen as the next token. space = item.length; item = item.replace(/^ *([*+-]|\d+\.) +/, ''); // Outdent whatever the // list item contains. Hacky. if (~item.indexOf('\n ')) { space -= item.length; item = !this.options.pedantic ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') : item.replace(/^ {1,4}/gm, ''); } // Determine whether the next list item belongs here. // Backpedal if it does not belong in this list. if (this.options.smartLists && i !== l - 1) { b = block.bullet.exec(cap[i + 1])[0]; if (bull !== b && !(bull.length > 1 && b.length > 1)) { src = cap.slice(i + 1).join('\n') + src; i = l - 1; } } // Determine whether item is loose or not. // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ // for discount behavior. loose = next || /\n\n(?!\s*$)/.test(item); if (i !== l - 1) { next = item.charAt(item.length - 1) === '\n'; if (!loose) loose = next; } this.tokens.push({ type: loose ? 'loose_item_start' : 'list_item_start' }); // Recurse. this.token(item, false, bq); this.tokens.push({ type: 'list_item_end' }); } this.tokens.push({ type: 'list_end' }); continue; } // html if (cap = this.rules.html.exec(src)) { src = src.substring(cap[0].length); this.tokens.push({ type: this.options.sanitize ? 'paragraph' : 'html', pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style', text: cap[0] }); continue; } // def if ((!bq && top) && (cap = this.rules.def.exec(src))) { src = src.substring(cap[0].length); this.tokens.links[cap[1].toLowerCase()] = { href: cap[2], title: cap[3] }; continue; } // table (gfm) if (top && (cap = this.rules.table.exec(src))) { src = src.substring(cap[0].length); item = { type: 'table', header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') }; for (i = 0; i < item.align.length; i++) { if (/^ *-+: *$/.test(item.align[i])) { item.align[i] = 'right'; } else if (/^ *:-+: *$/.test(item.align[i])) { item.align[i] = 'center'; } else if (/^ *:-+ *$/.test(item.align[i])) { item.align[i] = 'left'; } else { item.align[i] = null; } } for (i = 0; i < item.cells.length; i++) { item.cells[i] = item.cells[i] .replace(/^ *\| *| *\| *$/g, '') .split(/ *\| */); } this.tokens.push(item); continue; } // top-level paragraph if (top && (cap = this.rules.paragraph.exec(src))) { src = src.substring(cap[0].length); this.tokens.push({ type: 'paragraph', text: cap[1].charAt(cap[1].length - 1) === '\n' ? cap[1].slice(0, -1) : cap[1] }); continue; } // text if (cap = this.rules.text.exec(src)) { // Top-level should never reach here. src = src.substring(cap[0].length); this.tokens.push({ type: 'text', text: cap[0] }); continue; } if (src) { throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); } } return this.tokens; }; /** * Inline-Level Grammar */ var inline = { escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, autolink: /^<([^ >]+(@|:\/)[^ >]+)>/, url: noop, tag: /^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/, link: /^!?\[(inside)\]\(href\)/, reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, br: /^ {2,}\n(?!\s*$)/, del: noop, emoji: noop, mention: /^(\s)?([@%&][A-Za-z0-9\._\-+=\/]*[A-Za-z0-9_\-+=\/])/, text: /^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/; inline.link = replace(inline.link) ('inside', inline._inside) ('href', inline._href) (); inline.reflink = replace(inline.reflink) ('inside', inline._inside) (); /** * Normal Inline Grammar */ inline.normal = merge({}, inline); /** * Pedantic Inline Grammar */ inline.pedantic = merge({}, inline.normal, { strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/ }); /** * GFM Inline Grammar */ inline.gfm = merge({}, inline.normal, { escape: replace(inline.escape)('])', '~|])')(), url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/, del: /^~~(?=\S)([\s\S]*?\S)~~/, emoji: /^:([A-Za-z0-9_\-\+]+?):/, text: replace(inline.text) (']|', ':~]|') ('|', '|https?://|') () }); /** * GFM + Line Breaks Inline Grammar */ inline.breaks = merge({}, inline.gfm, { br: replace(inline.br)('{2,}', '*')(), text: replace(inline.gfm.text)('{2,}', '*')() }); /** * Inline Lexer & Compiler */ function InlineLexer(links, options) { this.options = options || marked.defaults; this.links = links; this.rules = inline.normal; this.renderer = this.options.renderer || new Renderer; this.renderer.options = this.options; if (!this.links) { throw new Error('Tokens array requires a `links` property.'); } if (this.options.gfm) { if (this.options.breaks) { this.rules = inline.breaks; } else { this.rules = inline.gfm; } } else if (this.options.pedantic) { this.rules = inline.pedantic; } this.emojiTemplate = getEmojiTemplate(options); } /** * Expose Inline Rules */ InlineLexer.rules = inline; /** * Static Lexing/Compiling Method */ InlineLexer.output = function(src, links, options) { var inline = new InlineLexer(links, options); return inline.output(src); }; /** * Lexing/Compiling */ InlineLexer.prototype.output = function(src) { var out = '' , link , text , href , cap; while (src) { // escape if (cap = this.rules.escape.exec(src)) { src = src.substring(cap[0].length); out += cap[1]; continue; } // mention if (!this.inLink && this.options.mentions && (cap = this.rules.mention.exec(src))) { src = src.substring(cap[0].length); out += this.renderer.mention(cap[1], cap[2]) continue; } // autolink if (cap = this.rules.autolink.exec(src)) { src = src.substring(cap[0].length); if (cap[2] === '@') { text = cap[1].charAt(6) === ':' ? this.mangle(cap[1].substring(7)) : this.mangle(cap[1]); href = this.mangle('mailto:') + text; } else { text = escape(cap[1]); href = text; } out += this.renderer.link(href, null, text); continue; } // url (gfm) if (!this.inLink && (cap = this.rules.url.exec(src))) { src = src.substring(cap[0].length); text = escape(cap[1]); href = text; out += this.renderer.link(href, null, text); continue; } // tag if (cap = this.rules.tag.exec(src)) { if (!this.inLink && /^/i.test(cap[0])) { this.inLink = false; } src = src.substring(cap[0].length); out += this.options.sanitize ? escape(cap[0]) : cap[0]; continue; } // link if (cap = this.rules.link.exec(src)) { src = src.substring(cap[0].length); this.inLink = true; out += this.outputLink(cap, { href: cap[2], title: cap[3] }); this.inLink = false; continue; } // reflink, nolink if ((cap = this.rules.reflink.exec(src)) || (cap = this.rules.nolink.exec(src))) { src = src.substring(cap[0].length); link = (cap[2] || cap[1]).replace(/\s+/g, ' '); link = this.links[link.toLowerCase()]; if (!link || !link.href) { out += cap[0].charAt(0); src = cap[0].substring(1) + src; continue; } this.inLink = true; out += this.outputLink(cap, link); this.inLink = false; continue; } // strong if (cap = this.rules.strong.exec(src)) { src = src.substring(cap[0].length); out += this.renderer.strong(this.output(cap[2] || cap[1])); continue; } // em if (cap = this.rules.em.exec(src)) { src = src.substring(cap[0].length); out += this.renderer.em(this.output(cap[2] || cap[1])); continue; } // code if (cap = this.rules.code.exec(src)) { src = src.substring(cap[0].length); out += this.renderer.codespan(escape(cap[2], true)); continue; } // br if (cap = this.rules.br.exec(src)) { src = src.substring(cap[0].length); out += this.renderer.br(); continue; } // del (gfm) if (cap = this.rules.del.exec(src)) { src = src.substring(cap[0].length); out += this.renderer.del(this.output(cap[1])); continue; } // emoji (gfm) if (cap = this.rules.emoji.exec(src)) { src = src.substring(cap[0].length); out += this.emoji(cap[1]); continue; } // text if (cap = this.rules.text.exec(src)) { src = src.substring(cap[0].length); out += escape(this.smartypants(cap[0])); continue; } if (src) { throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); } } return out; }; /** * Compile Link */ InlineLexer.prototype.outputLink = function(cap, link) { var href = simpleEscape(link.href) , title = link.title ? escape(link.title) : null; return cap[0].charAt(0) !== '!' ? this.renderer.link(href, title, this.output(cap[1])) : this.renderer.image(href, title, escape(cap[1])); }; /** * Emoji Transformations */ function emojiDefaultTemplate(emoji) { return ':'
    + escape(emoji)
    + ':'; } function getEmojiTemplate(options) { if (options.emoji) { if (typeof options.emoji === 'function') { return options.emoji; } if (typeof options.emoji === 'string') { var emojiSplit = options.emoji.split(/\{emoji\}/g); return function(emoji) { return emojiSplit.join(emoji); } } } return emojiDefaultTemplate; } InlineLexer.prototype.emojiTemplate = emojiDefaultTemplate; InlineLexer.prototype.emoji = function (name) { if (!this.options.emoji) return ':' + name + ':'; return this.emojiTemplate(name); }; /** * Smartypants Transformations */ InlineLexer.prototype.smartypants = function(text) { if (!this.options.smartypants) return text; return text // em-dashes .replace(/--/g, '\u2014') // opening singles .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') // closing singles & apostrophes .replace(/'/g, '\u2019') // opening doubles .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') // closing doubles .replace(/"/g, '\u201d') // ellipses .replace(/\.{3}/g, '\u2026'); }; /** * Mangle Links */ InlineLexer.prototype.mangle = function(text) { var out = '' , l = text.length , i = 0 , ch; for (; i < l; i++) { ch = text.charCodeAt(i); if (Math.random() > 0.5) { ch = 'x' + ch.toString(16); } out += '&#' + ch + ';'; } return out; }; /** * Renderer */ function Renderer(options) { this.options = options || {}; } Renderer.prototype.urltransform = function (url) { if (this.options.sanitize) { try { var prot = decodeURIComponent(unescape(url)) .replace(/[^\w:]/g, '') .toLowerCase(); } catch (e) { return false; } if (prot.indexOf('javascript:') === 0) { return false; } } return url } Renderer.prototype.code = function(code, lang, escaped) { if (this.options.highlight) { var out = this.options.highlight(code, lang); if (out != null && out !== code) { escaped = true; code = out; } } if (!lang) { return '
'
      + (escaped ? code : escape(code, true))
      + '\n
'; } return '
'
    + (escaped ? code : escape(code, true))
    + '\n
\n'; }; Renderer.prototype.blockquote = function(quote) { return '
\n' + quote + '
\n'; }; Renderer.prototype.html = function(html) { return html; }; Renderer.prototype.heading = function(text, level, raw) { return '' + text + '\n'; }; Renderer.prototype.hr = function() { return this.options.xhtml ? '
\n' : '
\n'; }; Renderer.prototype.list = function(body, ordered) { var type = ordered ? 'ol' : 'ul'; return '<' + type + '>\n' + body + '\n'; }; Renderer.prototype.listitem = function(text) { return '
  • ' + text + '
  • \n'; }; Renderer.prototype.paragraph = function(text) { return '

    ' + text + '

    \n'; }; Renderer.prototype.table = function(header, body) { return '\n' + '\n' + header + '\n' + '\n' + body + '\n' + '
    \n'; }; Renderer.prototype.tablerow = function(content) { return '\n' + content + '\n'; }; Renderer.prototype.tablecell = function(content, flags) { var type = flags.header ? 'th' : 'td'; var tag = flags.align ? '<' + type + ' style="text-align:' + flags.align + '">' : '<' + type + '>'; return tag + content + '\n'; }; // span level renderer Renderer.prototype.strong = function(text) { return '' + text + ''; }; Renderer.prototype.em = function(text) { return '' + text + ''; }; Renderer.prototype.codespan = function(text) { return '' + text + ''; }; Renderer.prototype.br = function() { return this.options.xhtml ? '
    ' : '
    '; }; Renderer.prototype.del = function(text) { return '' + text + ''; }; Renderer.prototype.link = function(href, title, text) { href = this.urltransform(href) var out if (href !== false) out = '
    '; return out; }; Renderer.prototype.image = function(href, title, text) { var out = '' + text + '' : '>'; return out; }; Renderer.prototype.mention = function(preceding, id) { var href = this.urltransform(id) // shorten the id if it appears to be the full length if ((id.charAt(0) == '&' || id.charAt(0) == '@' || id.charAt(0) == '%') && id.length > 50) id = id.slice(0, 8) + '...' if (href === false) return (preceding||'')+''+escape(id)+'' return (preceding||'')+''+escape(id)+'' } /** * Parsing & Compiling */ function Parser(options) { this.tokens = []; this.token = null; this.options = options || marked.defaults; this.options.renderer = this.options.renderer || new Renderer; this.renderer = this.options.renderer; this.renderer.options = this.options; } /** * Static Parse Method */ Parser.parse = function(src, options, renderer) { var parser = new Parser(options, renderer); return parser.parse(src); }; /** * Parse Loop */ Parser.prototype.parse = function(src) { this.inline = new InlineLexer(src.links, this.options, this.renderer); this.tokens = src.reverse(); var out = ''; while (this.next()) { out += this.tok(); } return out; }; /** * Next Token */ Parser.prototype.next = function() { return this.token = this.tokens.pop(); }; /** * Preview Next Token */ Parser.prototype.peek = function() { return this.tokens[this.tokens.length - 1] || 0; }; /** * Parse Text Tokens */ Parser.prototype.parseText = function() { var body = this.token.text; while (this.peek().type === 'text') { body += '\n' + this.next().text; } return this.inline.output(body); }; /** * Parse Current Token */ Parser.prototype.tok = function() { switch (this.token.type) { case 'space': { return ''; } case 'hr': { return this.renderer.hr(); } case 'heading': { return this.renderer.heading( this.inline.output(this.token.text), this.token.depth, this.token.text); } case 'code': { return this.renderer.code(this.token.text, this.token.lang, this.token.escaped); } case 'table': { var header = '' , body = '' , i , row , cell , flags , j; // header cell = ''; for (i = 0; i < this.token.header.length; i++) { flags = { header: true, align: this.token.align[i] }; cell += this.renderer.tablecell( this.inline.output(this.token.header[i]), { header: true, align: this.token.align[i] } ); } header += this.renderer.tablerow(cell); for (i = 0; i < this.token.cells.length; i++) { row = this.token.cells[i]; cell = ''; for (j = 0; j < row.length; j++) { cell += this.renderer.tablecell( this.inline.output(row[j]), { header: false, align: this.token.align[j] } ); } body += this.renderer.tablerow(cell); } return this.renderer.table(header, body); } case 'blockquote_start': { var body = ''; while (this.next().type !== 'blockquote_end') { body += this.tok(); } return this.renderer.blockquote(body); } case 'list_start': { var body = '' , ordered = this.token.ordered; while (this.next().type !== 'list_end') { body += this.tok(); } return this.renderer.list(body, ordered); } case 'list_item_start': { var body = ''; while (this.next().type !== 'list_item_end') { body += this.token.type === 'text' ? this.parseText() : this.tok(); } return this.renderer.listitem(body); } case 'loose_item_start': { var body = ''; while (this.next().type !== 'list_item_end') { body += this.tok(); } return this.renderer.listitem(body); } case 'html': { var html = !this.token.pre && !this.options.pedantic ? this.inline.output(this.token.text) : this.token.text; return this.renderer.html(html); } case 'paragraph': { return this.renderer.paragraph(this.inline.output(this.token.text)); } case 'text': { return this.renderer.paragraph(this.parseText()); } } }; /** * Helpers */ function escape(html, encode) { return html .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/'/g, '''); } function simpleEscape(html) { return html .replace(//g, '>'); } function unescape(html) { return html.replace(/&([#\w]+);/g, function(_, n) { n = n.toLowerCase(); if (n === 'colon') return ':'; if (n.charAt(0) === '#') { return n.charAt(1) === 'x' ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1)); } return ''; }); } function replace(regex, opt) { regex = regex.source; opt = opt || ''; return function self(name, val) { if (!name) return new RegExp(regex, opt); val = val.source || val; val = val.replace(/(^|[^\[])\^/g, '$1'); regex = regex.replace(name, val); return self; }; } function noop() {} noop.exec = noop; function merge(obj) { var i = 1 , target , key; for (; i < arguments.length; i++) { target = arguments[i]; for (key in target) { if (Object.prototype.hasOwnProperty.call(target, key)) { obj[key] = target[key]; } } } return obj; } /** * Marked */ function marked(src, opt, callback) { if (callback || typeof opt === 'function') { if (!callback) { callback = opt; opt = null; } opt = merge({}, marked.defaults, opt || {}); var highlight = opt.highlight , tokens , pending , i = 0; try { tokens = Lexer.lex(src, opt) } catch (e) { return callback(e); } pending = tokens.length; var done = function(err) { if (err) { opt.highlight = highlight; return callback(err); } var out; try { out = Parser.parse(tokens, opt); } catch (e) { err = e; } opt.highlight = highlight; return err ? callback(err) : callback(null, out); }; if (!highlight || highlight.length < 3) { return done(); } delete opt.highlight; if (!pending) return done(); for (; i < tokens.length; i++) { (function(token) { if (token.type !== 'code') { return --pending || done(); } return highlight(token.text, token.lang, function(err, code) { if (err) return done(err); if (code == null || code === token.text) { return --pending || done(); } token.text = code; token.escaped = true; --pending || done(); }); })(tokens[i]); } return; } try { if (opt) opt = merge({}, marked.defaults, opt); return Parser.parse(Lexer.lex(src, opt), opt); } catch (e) { e.message += '\nPlease report this to https://github.com/chjj/marked.'; if ((opt || marked.defaults).silent) { return '

    An error occured:

    '
            + escape(e.message + '', true)
            + '
    '; } throw e; } } /** * Options */ marked.options = marked.setOptions = function(opt) { merge(marked.defaults, opt); return marked; }; marked.defaults = { gfm: true, emoji: false, mentions: true, tables: true, breaks: false, pedantic: false, sanitize: false, smartLists: false, silent: false, highlight: null, langPrefix: 'lang-', smartypants: false, headerPrefix: '', renderer: new Renderer, xhtml: false, mentionNames: null }; /** * Expose */ marked.Parser = Parser; marked.parser = Parser.parse; marked.Renderer = Renderer; marked.Lexer = Lexer; marked.lexer = Lexer.lex; marked.InlineLexer = InlineLexer; marked.inlineLexer = InlineLexer.output; marked.parse = marked; if (typeof module !== 'undefined' && typeof exports === 'object') { module.exports = marked; } else if (typeof define === 'function' && define.amd) { define(function() { return marked; }); } else { this.marked = marked; } }).call(function() { return this || (typeof window !== 'undefined' ? window : global); }()); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],346:[function(require,module,exports){ var ref = require('ssb-ref') var marked = require('ssb-marked') function noop(){} var onLink = noop var extractor = new marked.Renderer() extractor.mention = function (_, id) { onLink({target: id}) } extractor.link = function (href, _, text) { onLink({label: text, target: href, embed: false}) } extractor.image = function (href, _, text) { onLink({label: text, target: href, embed: true}) } function links (s, _onLink) { if('string' !== typeof s) return onLink = _onLink try { marked(s, {renderer: extractor}) } catch(err) { console.log(JSON.stringify(s)) throw err } onLink = noop } module.exports = function (text) { var a = [] links(text, function (link) { if(ref.isFeed(link.target)) a.push({link: link.target, rel: 'mentions', name: link.label && link.label.replace(/^@/, '')}) else if(ref.isBlob(link.target)) a.push({link: link.target, rel: 'mentions', name: link.label}) else if(ref.isMsg(link.target)) a.push({link: link.target, rel: 'mentions', name: link.label}) }) return a } },{"ssb-marked":345,"ssb-ref":348}],347:[function(require,module,exports){ var ref = require('ssb-ref') function isObject (o) { return o && 'object' === typeof o } function isBool (o) { return 'boolean' === typeof o } function isString (s) { return 'string' === typeof s } function toArray (v, force) { if (Array.isArray(v)) return v // maybe it's an array-like object? (object with ordered numeric keys) var i=0, arr=[] if (isObject(v)) { while (v[i]) { arr[i] = v[i] i++ } if (Object.keys(arr).length > 0) return arr // it was! } // it wasnt... if (force) { // ...just put v in the arr arr.push(v) return arr } return v } // given any part of the message-obj hierarchy, pull out the content-object // - uses ducktyping to find the content function toMsgContent (obj) { if (!obj) return null if (obj.value && obj.value.content && obj.value.content.type) return obj.value.content if (obj.content && obj.content.type) return obj.content return obj } function traverse (obj, each) { for (var k in obj) { if (!obj[k]) continue var arr = toArray(obj[k], false) if (Array.isArray(arr)) { arr.forEach(function (v) { each(v, k) }) } else each(obj[k], k) } } // iterate links in the message exports.indexLinks = function (message, opts, each) { if (typeof opts == 'function') { each = opts opts = null } if (typeof opts == 'string') opts = { rel: opts } if (!opts) opts = {} var msg = opts.msg var feed = opts.feed var blob = opts.blob var any = !(msg || feed || blob) traverse(toMsgContent(message), function (obj, rel) { if (opts.rel && rel !== opts.rel) return var r = (typeof obj == 'string') ? obj : obj.link if (any) { if (!ref.isLink(r)) return } else { if (msg) { if (isBool(msg) && ref.type(r) != 'msg') return if (!isBool(msg) && r != msg) return } if (feed) { if (isBool(feed) && ref.type(r) != 'feed') return if (!isBool(feed) && r != feed) return } if (blob) { if (isBool(blob) && ref.type(r) != 'blob') return if (!isBool(blob) && r != blob) return } } each((typeof obj == 'string') ? { link: obj } : obj, rel) }) } // coerce to link object, optionally of a given type // null if coersion fails exports.link = exports.asLink = function (obj, type) { if (!obj) return null if (isString(obj)) obj = { link: obj } return isLink(obj, type) ? obj : null } // coerce to links array, optionally of a given type // filters out failed coersions exports.links = exports.asLinks = function (obj, type) { if (!obj) return [] var arr = toArray(obj, true) return arr .filter(function (l) { return isLink(l, type) }) .map(function (o) { return (typeof o == 'string') ? { link: o } : o }) } // detects whether the given string/object is a link // - `type` optional var isLink = exports.isLink = function (obj, type) { if (!obj) return false var r = (isString(obj)) ? obj : obj.link return (type) ? (ref.type(r) == type) : ref.isLink(r) } function indexLinksTo (msgA, msgB, each) { if (!msgA || !msgB || !msgB.key) return exports.indexLinks(msgA, function (l, rel) { if (l.link === msgB.key) each(l, rel) }) } // iterate `msgA` and find all links to `msgB`, returning an array of the link objects exports.linksTo = function (msgA, msgB) { var links = [] indexLinksTo(msgA, msgB, function (link, rel) { links.push(link) }) return links } // iterate `msgA` and find all links to `msgB`, returning an array of the link rels exports.relationsTo = function (msgA, msgB) { var rels = [] indexLinksTo(msgA, msgB, function (link, rel) { rels.push(rel) }) return rels } },{"ssb-ref":348}],348:[function(require,module,exports){ var isDomain = require('is-valid-domain') var rx = require('ip-regex')({exact: true}) var isIP = rx.test.bind(rx) var isInteger = Number.isInteger function isString(s) { return 'string' === typeof s } var isLink = exports.isLink = function (data) { return isString(data) && /^(@|%|&)[A-Za-z0-9\/+]{43}=\.[\w\d]+$/.test(data) } var isFeedId = exports.isFeed = exports.isFeedId = function (data) { return isString(data) && /^@[A-Za-z0-9\/+]{43}=\.(?:sha256|ed25519)$/.test(data) } var isMsgId = exports.isMsg = exports.isMsgId = function (data) { return isString(data) && /^%[A-Za-z0-9\/+]{43}=\.sha256$/.test(data) } var isBlobId = exports.isBlob = exports.isBlobId = function (data) { return isString(data) && /^&[A-Za-z0-9\/+]{43}=\.sha256$/.test(data) } var isAddress = exports.isAddress = function (data) { if(!isString(data)) return false var parts = data.split(':') var id = parts.pop(), port = parts.pop(), addr = parts.join(':') return ( isFeedId(id) && isInteger(+port) && (isIP(addr) || isDomain(addr) || addr === 'localhost') ) } var isInvite = exports.isInvite = function (data) { if(!isString(data)) return false var parts = data.split('~') //console.log(parts, isAddress(parts[0]), /^[A-Za-z0-9\/+]{43}=$/.test(parts[1])) return parts.length == 2 && isAddress(parts[0]) && /^[A-Za-z0-9\/+]{43}=$/.test(parts[1]) } exports.type = function (id) { if(!isString(id)) return false var c = id.charAt(0) if (c == '@' && isFeedId(id)) return 'feed' else if (c == '%' && isMsgId(id)) return 'msg' else if (c == '&' && isBlobId(id)) return 'blob' else if(isAddress(id)) return 'address' else if(isInvite(id)) return 'invite' else return false } exports.extract = function (data) { if (!isString(data)) return false var _data = data try { _data = decodeURIComponent(data) } catch (e) {} // this may fail if it's not encoded, so don't worry if it does _data = _data.replace(/&/g, '&') var res = /([@%&][A-Za-z0-9\/+]{43}=\.[\w\d]+)/.exec(_data) return res && res[0] } },{"ip-regex":228,"is-valid-domain":230}],349:[function(require,module,exports){ var isMsg = require('ssb-ref').isMsg function links (obj, each) { if(isMsg(obj)) return each(obj) if(!obj || 'object' !== typeof obj) return for(var k in obj) links(obj[k], each) } function firstKey (obj) { for(var k in obj) return k } //used to initialize sort function messages (thread) { var counts = {} for(var i = 0; i < thread.length; i++) { var key = thread[i].key if(counts[key]) throw new Error('thread has duplicate message:'+key) counts[key] = 1 } return counts } function heads (thread) { var counts = messages(thread) thread.forEach(function (msg) { if(counts[msg.key] == 0) return links(msg.value, function (link) { change = true counts[link] = 0 }) }) var ary = [] for(var k in counts) if(counts[k] !== 0) ary.push(k) return ary } function roots (thread) { var counts = messages(thread) thread.forEach(function (msg) { links(msg.value, function (link) { if(counts[link]) counts[msg.key] = 2 }) }) var ary = [] for(var k in counts) if(counts[k] === 1) ary.push(k) return ary } function order (thread) { var counts = messages(thread) //until(function () { var ordered = true while(ordered) { ordered = false thread.forEach(function (msg) { var max = counts[msg.key] links(msg.value, function (e) { if(counts[e] && counts[e] + 1 > max) max = counts[e] + 1 }) if(max > counts[msg.key]) { ordered = true counts[msg.key] = max } }) } return counts } function sort (thread) { var counts = order(thread) return thread.sort(function (a, b) { return ( counts[a.key] - counts[b.key] //received timestamp, may not be present || a.timestamp - b.timestamp //declared timestamp, may by incorrect or a lie || a.value.timestamp - b.value.timestamp //finially, sort hashes lexiegraphically. || (a.key > b.key ? -1 : a.key < b.key ? 1 : 0) ) }) } exports = module.exports = sort exports.heads = heads exports.order = order exports.roots = roots },{"ssb-ref":348}],350:[function(require,module,exports){ (function (process){ var pull = require('pull-stream/pull') var looper = require('looper') function destroy(stream, cb) { function onClose () { cleanup(); cb() } function onError (err) { cleanup(); cb(err) } function cleanup() { stream.removeListener('close', onClose) stream.removeListener('error', onError) } stream.on('close', onClose) stream.on('error', onError) } function destroy (stream) { if(!stream.destroy) console.error( 'warning, stream-to-pull-stream: \n' + 'the wrapped node-stream does not implement `destroy`, \n' + 'this may cause resource leaks.' ) else stream.destroy() } function write(read, stream, cb) { var ended, closed = false, did function done () { if(did) return did = true cb && cb(ended === true ? null : ended) } function onClose () { if(closed) return closed = true cleanup() if(!ended) read(ended = true, done) else done() } function onError (err) { cleanup() if(!ended) read(ended = err, done) } function cleanup() { stream.on('finish', onClose) stream.removeListener('close', onClose) stream.removeListener('error', onError) } stream.on('close', onClose) stream.on('finish', onClose) stream.on('error', onError) process.nextTick(function () { looper(function (next) { read(null, function (end, data) { ended = ended || end //you can't "end" a stdout stream, so this needs to be handled specially. if(end === true) return stream._isStdio ? done() : stream.end() if(ended = ended || end) { destroy(stream) return done(ended) } //I noticed a problem streaming to the terminal: //sometimes the end got cut off, creating invalid output. //it seems that stdout always emits "drain" when it ends. //so this seems to work, but i have been unable to reproduce this test //automatically, so you need to run ./test/stdout.js a few times and the end is valid json. if(stream._isStdio) stream.write(data, function () { next() }) else { var pause = stream.write(data) if(pause === false) stream.once('drain', next) else next() } }) }) }) } function first (emitter, events, handler) { function listener (val) { events.forEach(function (e) { emitter.removeListener(e, listener) }) handler(val) } events.forEach(function (e) { emitter.on(e, listener) }) return emitter } function read2(stream) { var ended = false, waiting = false var _cb function read () { var data = stream.read() if(data !== null && _cb) { var cb = _cb; _cb = null cb(null, data) } } stream.on('readable', function () { waiting = true _cb && read() }) .on('end', function () { ended = true _cb && _cb(ended) }) .on('error', function (err) { ended = err _cb && _cb(ended) }) return function (end, cb) { _cb = cb if(ended) cb(ended) else if(waiting) read() } } function read1(stream) { var buffer = [], cbs = [], ended, paused = false var draining function drain() { while((buffer.length || ended) && cbs.length) cbs.shift()(buffer.length ? null : ended, buffer.shift()) if(!buffer.length && (paused)) { paused = false stream.resume() } } stream.on('data', function (data) { buffer.push(data) drain() if(buffer.length && stream.pause) { paused = true stream.pause() } }) stream.on('end', function () { ended = true drain() }) stream.on('error', function (err) { ended = err drain() }) return function (abort, cb) { if(!cb) throw new Error('*must* provide cb') if(abort) { stream.once('close', function () { cb(abort) }) destroy(stream) } cbs.push(cb) drain() } } var read = read1 var sink = function (stream, cb) { return function (read) { return write(read, stream, cb) } } var source = function (stream) { return read1(stream) } exports = module.exports = function (stream, cb) { return ( (stream.writable && stream.write) ? stream.readable ? function(_read) { write(_read, stream, cb); return read1(stream) } : sink(stream, cb) : source(stream) ) } exports.sink = sink exports.source = source exports.read = read exports.read1 = read1 exports.read2 = read2 exports.duplex = function (stream, cb) { return { source: source(stream), sink: sink(stream, cb) } } exports.transform = function (stream) { return function (read) { var _source = source(stream) sink(stream)(read); return _source } } }).call(this,require('_process')) },{"_process":108,"looper":234,"pull-stream/pull":285}],351:[function(require,module,exports){ arguments[4][144][0].apply(exports,arguments) },{"buffer":47,"dup":144}],352:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.toCamelCase = toCamelCase; exports.toKebabCase = toKebabCase; var delimiters = [' ', '-', '_']; function toCamelCase() { var input = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0]; var characters = input.split(''); var result = []; var character = void 0; while (character = characters.shift()) { if (delimiters.indexOf(character) !== -1) { if (character = characters.shift()) { character = character.toUpperCase(); } } result.push(character); } return result.join(''); } function toKebabCase() { var input = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0]; var characters = input.split(''); var result = []; characters.forEach(function (character) { var lowercase_character = character.toLowerCase(); if (character !== lowercase_character) { result.push('-', lowercase_character); } else if (delimiters.indexOf(character) !== -1) { result.push('-'); } else { result.push(character); } }); return result.join(''); } },{}],353:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.getStyleProperty = getStyleProperty; exports.getStyleProperties = getStyleProperties; var _changeCase = require('./change-case'); var _parsePropertyValue = require('./parse-property-value'); var _parsePropertyValue2 = _interopRequireDefault(_parsePropertyValue); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * @typedef {Object} StyleProperty * @property {string} unit - unit of the property, e.g. px, rgb * @property {string|number} value - value of the property * @property {string} output - valid string representation of value and unit * * @example Simple property. * { * unit: 'px', * value: 100, * output: '100px' * } * * @example Color property. * { * unit: 'rgb', * value: [255, 255, 255], * output: '#ffffff' * } */ /** * Attempts to fix the element when using Webcomponents with ShadowDOMPolyfill. It returns either original element or wrapped element, depending on whether the polyfill replaced the original `getComputedStyle` method or not. * This is madness and no sane person should ever do hacks like this. ShadowDOMPolyfill sucks donkey balls! * @param {Object|HTMLElement} element * @returns {Object|HTMLElement} */ function fixWebcomponentsElement(element) { if (typeof window.ShadowDOMPolyfill !== 'undefined') { var is_native = document.defaultView.getComputedStyle.toString().indexOf('[native code]') !== -1; // Can't check if element is instance of HTMLElement, because the polyfill // hijacks this. Only reliable way of checking if it is wrapped I found // is using this ugly ass property. var is_wrapped = typeof element.__impl4cf1e782hg__ !== 'undefined'; if (is_native && is_wrapped) { element = window.ShadowDOMPolyfill.unwrap(element); } if (!is_native && !is_wrapped) { element = window.ShadowDOMPolyfill.wrap(element); } } return element; } /** * Returns information about unit and value of given property for given element. * @param {HTMLElement} element * @param {string} property - Name of the property. You can use either camelCase (e.g. zIndex) or kebab-case (e.g. z-index). * @returns {StyleProperty} * * @example * var element_width = getStyleProperty(my_element, 'width'); * // returns {unit: 'px', value: 100, output: '100px'} */ function getStyleProperty(element, property) { property = (0, _changeCase.toKebabCase)(property); element = fixWebcomponentsElement(element); var value = document.defaultView.getComputedStyle(element, null).getPropertyValue(property); return (0, _parsePropertyValue2.default)(value); } /** * Returns information about multiple properties of given element. * @param {HTMLElement} element * @param {Array|string} properties - List of properties. Single property (string) will be converted to an array. * @returns {Object} - Keys of the returned objects are property names, values are objects containing information about given property. * * @example * var element_size = getStyleProperties(my_element, ['width', 'height']); * // returns * // { * // width: {unit: 'px', value: 100, output: '100px'}, * // height: {unit: 'px', value: 100, output: '100px'} * // } */ function getStyleProperties(element) { var properties = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1]; if (typeof properties === 'string') { properties = [properties]; } var result = {}; properties.forEach(function (property) { result[property] = getStyleProperty(element, property); }); return result; } },{"./change-case":352,"./parse-property-value":354}],354:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = function (value) { var result = re_color.test(value) ? parseColorProperty(value) : parseRegularProperty(value); result.original = value; return result; }; var re_color = /^rgb\((\d+),\s?(\d+),\s?(\d+)\)$/; var re_prop = /^(-?\d*\.?\d*)(.*)$/; // converts number in base 10 to base 16, adds padding zero if needed function convertColorComponent(input) { var result = input.toString(16); if (result.length < 2) { result = '0' + result; } return result; } function parseColorProperty(value) { var matches = value.match(re_color); var result = {}; result.unit = 'rgb'; result.value = [parseInt(matches[1], 10), parseInt(matches[2], 10), parseInt(matches[3], 10)]; result.output = '#' + convertColorComponent(result.value[0]) + convertColorComponent(result.value[1]) + convertColorComponent(result.value[2]); return result; } function parseRegularProperty(value) { var result = { unit: '', value: null, output: 'auto' }; if (value !== 'auto') { var matches = value.match(re_prop); result.value = parseFloat(matches[1]); result.unit = matches[2]; result.output = result.value + result.unit; } return result; } },{}],355:[function(require,module,exports){ function whitespace (s) { return /\S/.test(s) } exports.START = exports.END = -1 var start = exports.start = function (text, i, bound) { var s = i, S = -1 while(s >= 0 && bound(text[s])) S = s-- return exports.START = S } var end = exports.end = function (text, i, bound) { var s = i, S = -1 while(s < text.length && bound(text[s])) S = ++s return exports.END = S } var word = exports.word = function (text, i, bound) { bound = bound || whitespace return text.substring(start(text, i, bound), end(text, i, bound)) } exports.replace = function replace (value, text, i, bound) { bound = bound || whitespace var w = word(text, i, bound) if(!w) return text return ( text.substring(0, exports.START) + value + text.substring(exports.END) ) } },{}],356:[function(require,module,exports){ 'use strict' var h = require('hyperscript') var wordBoundary = /\s/ var bounds = require('./bounds') var TextareaCaretPosition = require('textarea-caret-position') var Suggester = require('./suggester') module.exports = function(el, choices, options) { var tcp = new TextareaCaretPosition(el) var suggest = Suggester(choices) var box = { input: el, choices: choices, options: options || {}, active: false, activate: activate, deactivate: deactivate, selection: 0, filtered: [], //get the current word get: function (i) { i = Number.isInteger(i) ? i : el.selectionStart - 1 return bounds.word(el.value, i) }, //replace the current word set: function (w, i) { i = Number.isInteger(i) ? i : el.selectionStart - 1 el.value = bounds.replace(w, el.value + ' ', i) el.selectionStart = el.selectionEnd = bounds.START + w.length + 1 }, select: function (n) { this.selection = Math.max(0, Math.min(this.filtered.length, n)) this.update() }, next: function () { this.select(this.selection + 1) }, prev: function () { this.select(this.selection - 1) }, suggest: function (cb) { var choices, self = this // extract current word var word = this.get() if(!word) return this.deactivate(), cb() // filter and order the list by the current word this.selection = 0 var r = this.request = (this.request || 0) + 1 suggest(word, function (err, choices) { if(err) return console.error(err) if(r !== self.request) return cb() if(choices) cb(null, self.filtered = choices) }) }, reposition: function () { self = this if (self.filtered.length == 0) return self.deactivate() // create / update the element if (self.active) { self.update() } else { // calculate position var pos = tcp.get(el.selectionStart, el.selectionEnd) var bounds = el.getBoundingClientRect() // setup self.x = pos.left + bounds.left - el.scrollLeft self.y = pos.top + bounds.top - el.scrollTop + 20 self.activate() } }, update: update, complete: function (n) { if(!isNaN(n)) this.select(n) if (this.filtered.length) { var choice = this.filtered[this.selection] if (choice && choice.value) { // update the text under the cursor to have the current selection's value var v = el.value this.set(choice.value) // fire the suggestselect event el.dispatchEvent(new CustomEvent('suggestselect', { detail: choice })) } } this.deactivate() }, } el.addEventListener('input', oninput.bind(box)) el.addEventListener('keydown', onkeydown.bind(box)) el.addEventListener('blur', onblur.bind(box)) return box } function getItemIndex(e) { for (var el = e.target; el && el != this; el = el.parentNode) if (el._i != null) return el._i } function onListMouseMove(e) { this.isMouseActive = true } function onListMouseOver(e) { // ignore mouseover triggered by list redrawn under the cursor if (!this.isMouseActive) return var i = getItemIndex(e) if (i != null && i != this.selection) this.select(i) } function onListMouseDown(e) { var i = getItemIndex(e) if (i != null) { this.select(i) this.complete() // prevent blur e.preventDefault() } } function render(box) { var cls = (box.options.cls) ? ('.'+box.options.cls) : '' return h('.suggest-box'+cls, { style: { left: (box.x+'px'), top: (box.y+'px'), position: 'fixed' } }, [ h('ul', { onmousemove: onListMouseMove.bind(box), onmouseover: onListMouseOver.bind(box), onmousedown: onListMouseDown.bind(box) }, renderOpts(box)) ]) } function renderOpts(box) { var fragment = document.createDocumentFragment() for (var i=0; i < box.filtered.length; i++) { var opt = box.filtered[i] var tag = 'li' if (i === box.selection) tag += '.selected' if (opt.cls) tag += '.' + opt.cls var title = opt.image ? h('img', { src: opt.image }) : h('strong', opt.title) fragment.appendChild(h(tag, {_i: i}, [title, ' ', opt.subtitle && h('small', opt.subtitle)])) } return fragment } function activate() { if (this.active) return this.active = true this.el = render(this) document.body.appendChild(this.el) } function update() { if (!this.active) return var ul = this.el.querySelector('ul') ul.innerHTML = '' ul.appendChild(renderOpts(this)) } function deactivate() { if (!this.active) return this.el.parentNode.removeChild(this.el) this.el = null this.active = false } function oninput(e) { var self = this var word = this.suggest(function (_, suggestions) { if(suggestions) self.reposition() }) } function onkeydown(e) { if (this.active) { // up if (e.keyCode == 38) this.prev() // down else if (e.keyCode == 40) this.next() // escape else if (e.keyCode == 27) this.deactivate() // enter or tab else if (e.keyCode == 13 || e.keyCode == 9) this.complete() else return //ordinary key, fall back. e.preventDefault() //movement key, as above. this.isMouseActive = false } } function onblur(e) { this.deactivate() } },{"./bounds":355,"./suggester":357,"hyperscript":223,"textarea-caret-position":359}],357:[function(require,module,exports){ function isObject (o) { return o && 'object' === typeof o } var isArray = Array.isArray function isFunction (f) { return 'function' === typeof f } function compare(a, b) { return compareval(a.rank, b.rank) || compareval(a.title, b.title) } function compareval(a, b) { return a === b ? 0 : a < b ? -1 : 1 } function suggestWord (word, choices, cb) { if(isArray(choices)) { //remove any non word characters and make case insensitive. var wordRe = new RegExp(word.replace(/\W/g, ''), 'i') cb(null, choices.map(function (opt, i) { var title = wordRe.exec(opt.title) var subtitle = opt.subtitle ? wordRe.exec(opt.subtitle) : null var rank = (title === null ? (subtitle&&subtitle.index) : (subtitle === null ? (title&&title.index) : Math.min(title.index, subtitle.index))) if (rank !== null) { opt.rank = rank return opt } }).filter(Boolean).sort(compare).slice(0, 20)) } else if(isFunction(choices)) choices(word, cb) } module.exports = function (choices) { if(isFunction(choices)) return choices else if(isObject(choices) && (choices.any || isArray(choices))) return function (word, cb) { suggestWord(word, choices.any || choices, cb) } else if(isObject(choices)) { var _choices = choices //legacy return function (word, cb) { if(!choices[word[0]]) return cb() suggestWord(word.substring(1), choices[word[0]], cb) } } } },{}],358:[function(require,module,exports){ /* * TextNodeSeacher * Copyright (c) 2015 Charles Lehner * * Usage of the works is permitted provided that this instrument is * retained with the works, so that any entity that uses the works is * notified of this instrument. * * DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY. */ (function (global) { function addAccents(str) { // http://www.the-art-of-web.com/javascript/search-highlight/ return str // .replace(/([ao])e/ig, "$1") .replace(/e/ig, "[eèéêë]") .replace(/a/ig, "([aàâä]|ae)") .replace(/i/ig, "[iîï]") .replace(/o/ig, "([oôö]|oe)") .replace(/u/ig, "[uùûü]") .replace(/y/ig, "[yÿ]"); } function quoteRegex(str) { return str.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); } function setSelection(startNode, startOffset, endNode, endOffset) { var range = document.createRange(); range.setStart(startNode, startOffset); range.setEnd(endNode, endOffset); var sel = window.getSelection(); sel.removeAllRanges(); sel.addRange(range); } function selectText(node, offset, len, align) { // Put the text into its own element so we can scroll it into view var parent = node.parentNode; var el = document.createElement("span"); var middle = offset > 0 ? node.splitText(offset) : node; var end = middle.splitText(len); el.appendChild(middle); parent.insertBefore(el, end); el.scrollIntoView(align); // Restore the text and set the selection parent.removeChild(el); parent.insertBefore(middle, end); parent.normalize(); setSelection(node, offset, node, offset + len); } function TextNodeSearcher(opt) { if (!opt) opt = {}; else if (opt instanceof window.Element) opt = {container: opt}; this.container = opt.container || document.body; this.highlightTagName = opt.highlightTagName || this.highlightTagName; } TextNodeSearcher.prototype.highlightTagName = "highlight"; TextNodeSearcher.prototype.setQuery = function (str) { if (str == this.queryStr) return; this.queryStr = str; this.query = new RegExp(addAccents(quoteRegex(str)), "ig"); }; function shouldDescendInto(node) { return node.nodeName != "SCRIPT" && node.nodeName != "STYLE"; } function getNextTextNode(node, container) { do { if (shouldDescendInto(node) && node.firstChild) { node = node.firstChild; } else { while (!node.nextSibling) { node = node.parentNode; if (node == container || !node) return null; } node = node.nextSibling; } } while (node.nodeType != node.TEXT_NODE); return node; } function getPreviousTextNode(node, container) { if (node == container) { while (node.lastChild && shouldDescendInto(node)) node = node.lastChild; if (node.nodeType == node.TEXT_NODE) return node; } do { if (!node || node == container) { return null; } else if (node.previousSibling) { node = node.previousSibling; while (shouldDescendInto(node) && node.lastChild) node = node.lastChild; } else { node = node.parentNode; } } while (node.nodeType != node.TEXT_NODE); return node; } function matchLast(re, str) { var last; re.lastIndex = 0; for (var m = re.exec(str); m; m = re.exec(str)) last = m; return last; } TextNodeSearcher.prototype.highlight = function () { if (this.highlightedQuery == this.query) return; else if (this.highlightedQuery) this.unhighlight(); var query = this.highlightedQuery = this.query; query.lastIndex = 0; for (var node = getNextTextNode(this.container, this.container); node; node = getNextTextNode(node, this.container)) { var m = query.exec(node.data); if (m) { var offset = m.index; var len = m[0].length; if (len === 0) return; var hl = document.createElement(this.highlightTagName); var middle = offset > 0 ? node.splitText(offset) : node; var next; if (middle.data.length > len) { next = middle.splitText(len); } else { next = middle.nextSibling; } var parent = node.parentNode; hl.appendChild(middle); if (next) parent.insertBefore(hl, next); else parent.appendChild(hl); node = middle; query.lastIndex = len; } } }; TextNodeSearcher.prototype.unhighlight = function () { this.highlightedQuery = null; var els = this.container.getElementsByTagName(this.highlightTagName); els = [].slice.call(els); for (var i = 0; i < els.length; i++) { var el = els[i]; var parent = el.parentNode; var text = el.firstChild; parent.insertBefore(text, el); parent.removeChild(el); parent.normalize(); } }; TextNodeSearcher.prototype.selectNext = function () { if (!this.queryStr || !this.container) return; var sel = window.getSelection(); var startNode = sel.focusNode; var startOffset = 0; if (!startNode || !this.container.contains(startNode)) startNode = getNextTextNode(this.container, this.container); else if (startNode.nodeType != startNode.TEXT_NODE) startNode = getNextTextNode(startNode, this.container); else startOffset = sel.focusOffset; var wrapped = false; for (var node = startNode; node;) { var str = node.data; this.query.lastIndex = startOffset; if (startOffset) startOffset = 0; var m = this.query.exec(str); if (m) { selectText(node, m.index, m[0].length, false); return; } node = getNextTextNode(node, this.container); if (!node) { if (wrapped) return; wrapped = true; node = getNextTextNode(this.container, this.container); } } }; TextNodeSearcher.prototype.selectPrevious = function () { if (!this.queryStr || !this.container) return; var sel = window.getSelection(); var endNode = sel.anchorNode; var endOffset = 0; if (!endNode || !this.container.contains(endNode)) endNode = getPreviousTextNode(this.container, this.container); else if (endNode.nodeType != endNode.TEXT_NODE) endNode = getPreviousTextNode(endNode, this.container); else endOffset = sel.anchorOffset; var wrapped = false; for (var node = endNode; node;) { var str = node.data; if (endOffset < Infinity) { str = node.data.substr(0, endOffset); endOffset = Infinity; } var m = matchLast(this.query, str); if (m) { selectText(node, m.index, m[0].length, false); return; } node = getPreviousTextNode(node, this.container); if (!node) { if (wrapped) return; wrapped = true; node = getPreviousTextNode(this.container, this.container); } } }; if (typeof module != "undefined") module.exports = TextNodeSearcher; else if (global) global.TextNodeSearcher = TextNodeSearcher; }(this)); },{}],359:[function(require,module,exports){ /* jshint browser: true */ // The properties that we copy into a mirrored div. // Note that some browsers, such as Firefox, // do not concatenate properties, i.e. padding-top, bottom etc. -> padding, // so we have to do every single property specifically. var properties = [ 'direction', // RTL support 'boxSizing', 'width', // on Chrome and IE, exclude the scrollbar, so the mirror div wraps exactly as the textarea does 'height', 'overflowX', 'overflowY', // copy the scrollbar for IE 'borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', // https://developer.mozilla.org/en-US/docs/Web/CSS/font 'fontStyle', 'fontVariant', 'fontWeight', 'fontStretch', 'fontSize', 'fontSizeAdjust', 'lineHeight', 'fontFamily', 'textAlign', 'textTransform', 'textIndent', 'textDecoration', // might not make a difference, but better be safe 'letterSpacing', 'wordSpacing' ]; function CaretCoordinates(element) { var self = this; this.element = element; // mirrored div this.div = document.createElement('div'); // this.div.id = 'input-textarea-caret-position-mirror-div'; element.parentNode.insertBefore(this.div, element); var style = this.div.style; this.computed = window.getComputedStyle? getComputedStyle(element) : element.currentStyle; // currentStyle for IE < 9 // default textarea styles style.whiteSpace = 'pre-wrap'; if (element.nodeName !== 'INPUT') style.wordWrap = 'break-word'; // only for textarea-s // position off-screen style.position = 'absolute'; // required to return coordinates properly style.visibility = 'hidden'; // not 'display: none' because we want rendering // transfer the element's properties to the div properties.forEach(function (prop) { style[prop] = self.computed[prop]; }); style.overflow = 'hidden'; // for Chrome to not render a scrollbar; IE keeps overflowY = 'scroll' this.divText = document.createTextNode(''); this.div.appendChild(this.divText); this.span = document.createElement('span'); this.spanText = document.createTextNode(''); this.span.appendChild(this.spanText); this.div.appendChild(this.span); function resize() { style.width = self.computed.width; } window.addEventListener('resize', resize); } CaretCoordinates.prototype.get = function(positionLeft, positionRight) { // calculate left offset this.divText.nodeValue = this.element.value.substring(0, positionLeft); // the second special handling for input type="text" vs textarea: spaces need to be replaced with non-breaking spaces - http://stackoverflow.com/a/13402035/1269037 if (this.element.nodeName === 'INPUT') this.divText.nodeValue = this.divText.nodeValue.replace(/\s/g, "\u00a0"); // Wrapping must be replicated *exactly*, including when a long word gets // onto the next line, with whitespace at the end of the line before (#7). // The *only* reliable way to do that is to copy the *entire* rest of the // textarea's content into the created at the caret position. // for inputs, just '.' would be enough, but why bother? this.spanText.nodeValue = this.element.value.substring(positionLeft) || '.'; // || because a completely empty faux span doesn't render at all var left = this.span.offsetLeft + parseInt(this.computed['borderLeftWidth'], 10); // calculate right offset this.divText.nodeValue = this.element.value.substring(0, positionRight); // the second special handling for input type="text" vs textarea: spaces need to be replaced with non-breaking spaces - http://stackoverflow.com/a/13402035/1269037 if (this.element.nodeName === 'INPUT') this.divText.nodeValue = this.divText.nodeValue.replace(/\s/g, "\u00a0"); this.spanText.nodeValue = this.element.value.substring(positionRight) || '.'; // || because a completely empty faux span doesn't render at all var right = this.span.offsetLeft + parseInt(this.computed['borderLeftWidth'], 10); // special case where right position is not be calculated correctly (full line selected) if (right <= left) { right = this.div.offsetWidth + parseInt(this.computed['borderLeftWidth'], 10); } var coordinates = { top: this.span.offsetTop + parseInt(this.computed['borderTopWidth'], 10), left: left, right: right }; return coordinates; }; module.exports = CaretCoordinates; },{}],360:[function(require,module,exports){ arguments[4][148][0].apply(exports,arguments) },{"dup":148}],361:[function(require,module,exports){ /** * Module dependencies. */ var global = (function() { return this; })(); /** * WebSocket constructor. */ var WebSocket = global.WebSocket || global.MozWebSocket; /** * Module exports. */ module.exports = WebSocket ? ws : null; /** * WebSocket constructor. * * The third `opts` options object gets ignored in web browsers, since it's * non-standard, and throws a TypeError if passed to the constructor. * See: https://github.com/einaros/ws/issues/227 * * @param {String} uri * @param {Array} protocols (optional) * @param {Object) opts (optional) * @api public */ function ws(uri, protocols, opts) { var instance; if (protocols) { instance = new WebSocket(uri, protocols); } else { instance = new WebSocket(uri); } return instance; } if (WebSocket) ws.prototype = WebSocket.prototype; },{}],362:[function(require,module,exports){ var u = require('./util') exports.first = function first(plug) { return function () { var args = [].slice.call(arguments) args.unshift(plug) return u.firstPlug.apply(null, args) } } exports.map = function (plug) { return function () { var args = [].slice.call(arguments) return plug.map(function (fn) { if(fn) return fn.apply(null, args) }).filter(Boolean) } } },{"./util":365}],363:[function(require,module,exports){ (function (Buffer){ var pull = require('pull-stream') var crypto = require('crypto') var ref = require('ssb-ref') var Reconnect = require('pull-reconnect') function Hash (onHash) { var hash = crypto.createHash('sha256') return pull.through(function (data) { hash.update( 'string' === typeof data ? new Buffer(data, 'utf8') : data ) }, function (err) { if(err && !onHash) throw err onHash && onHash(err, '&'+hash.digest('base64')+'.sha256') }) } //uncomment this to use from browser... //also depends on having ssb-ws installed. //var createClient = require('ssb-lite') var createClient = require('ssb-client') var createConfig = require('ssb-config/inject') var createFeed = require('ssb-feed') var keys = require('./keys') var ssbKeys = require('ssb-keys') module.exports = function () { var opts = createConfig() var sbot = null var rec = Reconnect(function (isConn) { // var remote // if('undefined' !== typeof localStorage) // remote = localStorage.remote createClient(keys, { manifest: require('./manifest.json'), remote: require('./config')().remote }, function (err, _sbot) { if(err) { console.error(err.stack) isConn(err) return } sbot = _sbot sbot.on('closed', function () { sbot = null isConn(new Error('closed')) }) isConn() }) }) var internal = { getLatest: rec.async(function (id, cb) { sbot.getLatest(id, cb) }), add: rec.async(function (msg, cb) { sbot.add(msg, cb) }) } var feed = createFeed(internal, keys) return { sbot_blobs_add: rec.sink(function (cb) { return pull( Hash(cb), sbot.blobs.add() ) }), sbot_links: rec.source(function (query) { return sbot.links(query) }), sbot_links2: rec.source(function (query) { return sbot.links2.read(query) }), sbot_query: rec.source(function (query) { return sbot.query.read(query) }), sbot_log: rec.source(function (opts) { return sbot.createLogStream(opts) }), sbot_user_feed: rec.source(function (opts) { return sbot.createUserStream(opts) }), sbot_get: rec.async(function (key, cb) { sbot.get(key, cb) }), sbot_publish: rec.async(function (content, cb) { if(content.recps) content = ssbKeys.box(content, content.recps.map(function (e) { return ref.isFeed(e) ? e : e.link })) feed.add(content, function (err, msg) { if(err) console.error(err) else if(!cb) console.log(msg) cb && cb(err, msg) }) }), sbot_whoami: rec.async(function (cb) { sbot.whoami(cb) }) } } }).call(this,require("buffer").Buffer) },{"./config":156,"./keys":158,"./manifest.json":160,"buffer":47,"crypto":56,"pull-reconnect":282,"pull-stream":284,"ssb-client":332,"ssb-config/inject":333,"ssb-feed":334,"ssb-keys":337,"ssb-ref":348}],364:[function(require,module,exports){ var h = require('hyperscript') var pull = require('pull-stream') var u = require('./util') var Scroller = require('pull-scroll') exports.createStream = function createStream (stream, render) { var div = h('div.column', {style: {'overflow-y': 'auto'}}) pull( stream, Scroller(div, div, render, false, false) ) return div } exports.createRenderers = function (renderers, sbot) { return function (data) { return u.first(renderers, function (fn) { return fn(data, sbot) }) } } },{"./util":365,"hyperscript":223,"pull-scroll":283,"pull-stream":284}],365:[function(require,module,exports){ var pull = require('pull-stream') var Next = require('pull-next') function first (list, test) { for(var i in list) { var value = test(list[i], i, list) if(value) return value } } function decorate (list, value, caller) { caller = caller || function (d,e,v) { return d(e, v) } return list.reduce(function (element, decorator) { return caller(decorator, element, value) || element }, null) } function get(obj, path) { if(obj == null) return obj if('string' === typeof path) return obj[path] for(var i = 0; i < path.length; i++) { obj = obj[path[i]] if(obj == null) return } return obj } exports.first = first exports.decorate = decorate exports.next = function (createStream, opts, property, range) { range = range || opts.reverse ? 'lt' : 'gt' property = property || 'timestamp' var last = null, count = -1 return Next(function () { if(last) { if(count === 0) return var value = opts[range] = get(last, property) if(value == null) return last = null } return pull( createStream(opts), pull.through(function (msg) { count ++ if(!msg.sync) last = msg }, function (err) { //retry on errors... if(err) return count = -1 //end stream if there were no results if(last == null) last = {} }) ) }) } exports.firstPlug = function (plugs) { if(!Array.isArray(plugs)) throw new Error('plugs must be an array') var args = [].slice.call(arguments) var plugs = args.shift() return exports.first(plugs, function (fn) { return fn.apply(null, args) }) } },{"pull-next":276,"pull-stream":284}],366:[function(require,module,exports){ (function (Buffer){ var sodium = require('libsodium-wrappers') function I(b) { return Buffer.isBuffer(b) ? new Uint8Array(b) : b } function B(b) { return (b instanceof Uint8Array) ? new Buffer(b) : b } function bufferize(fn) { if('function' !== typeof fn) throw new Error('not a function') return function () { var args = [].map.call(arguments, I) var r = B(fn.apply(this, args)) return r } } function keys (k) { return { publicKey: B(k.publicKey), secretKey: B(k.secretKey || k.privateKey) } } exports.crypto_sign_seed_keypair = function (seed) { return keys(sodium.crypto_sign_seed_keypair(I(seed))) } exports.crypto_sign_keypair = function () { return keys(sodium.crypto_sign_keypair()) } exports.crypto_box_keypair = function () { return keys(sodium.crypto_box_keypair()) } ;[ 'sign_verify_detached', 'sign_detached', 'sign', 'sign_open', 'sign_ed25519_pk_to_curve25519', 'sign_ed25519_sk_to_curve25519', 'scalarmult', 'secretbox_easy', 'secretbox_open_easy', 'box_easy', 'box_open_easy', 'auth', 'auth_verify', 'hash' ].forEach(function (name) { if(name === 'auth_verify') { //this is inconsistent with sign_verify!! var fn = bufferize(sodium.crypto_auth_verify) exports['crypto_'+name] = function (msg, tok, key) { return fn(msg, tok, key) ? 0 : 1 } } else exports['crypto_'+name] = bufferize(sodium['crypto_'+name]) }) var Sha256 = require('sha.js/sha256') exports.crypto_hash_sha256 = function (msg) { return new Sha256().update(msg).digest() } function nullIfThrew (fn) { return function () { try { return fn.apply(this, [].slice.call(arguments)) } catch (err) { return null } } } exports.crypto_secretbox_open_easy = nullIfThrew(exports.crypto_secretbox_open_easy) exports.crypto_box_open_easy = nullIfThrew(exports.crypto_box_open_easy) }).call(this,require("buffer").Buffer) },{"buffer":47,"libsodium-wrappers":369,"sha.js/sha256":372}],367:[function(require,module,exports){ //only exports browser api. use chloride module //to get automatic fallbacks! module.exports = require('./browser') },{"./browser":366}],368:[function(require,module,exports){ arguments[4][95][0].apply(exports,arguments) },{"dup":95}],369:[function(require,module,exports){ (function (process){ (function (root, factory) { if (typeof process === "object" && typeof process.stdout === "undefined") { process.stderr = process.stdout = { write: function() { } }; } if (typeof define === "function" && define.amd) { define(["exports", "libsodium"], factory); } else if (typeof exports !== "undefined") { factory(exports, require("libsodium")); } else { var cb = root.sodium && root.sodium.onload; factory((root.sodium = {}), root.libsodium); if (typeof cb === "function") { cb(root.sodium); } } }(this, function (exports, libsodium) { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); var output_format = "uint8array"; libsodium._sodium_init(); // List of functions and constants defined in the wrapped libsodium function symbols() { return Object.keys(exports).sort(); } function increment(bytes) { if (! bytes instanceof Uint8Array) { throw new TypeError("Only Uint8Array instances can be incremented"); } var c = 1 << 8; for (var i = 0 | 0, j = bytes.length; i < j; i++) { c >>= 8; c += bytes[i]; bytes[i] = c & 0xff; } } function memzero(bytes) { if (! bytes instanceof Uint8Array) { throw new TypeError("Only Uint8Array instances can be wiped"); } for (var i = 0 | 0, j = bytes.length; i < j; i++) { bytes[i] = 0; } } function memcmp(b1, b2) { if (!(b1 instanceof Uint8Array && b2 instanceof Uint8Array)) { throw new TypeError("Only Uint8Array instances can be compared"); } if (b1.length !== b2.length) { throw new TypeError("Only instances of identical length can be compared"); } for (var d = 0 | 0, i = 0 | 0, j = b1.length; i < j; i++) { d |= b1[i] ^ b2[i]; } return d === 0; } function compare(b1, b2) { if (!(b1 instanceof Uint8Array && b2 instanceof Uint8Array)) { throw new TypeError("Only Uint8Array instances can be compared"); } if (b1.length !== b2.length) { throw new TypeError("Only instances of identical length can be compared"); } for (var gt = 0 | 0, eq = 1 | 1, i = b1.length; i-- > 0;) { gt |= ((b2[i] - b1[i]) >> 8) & eq; eq &= ((b2[i] ^ b1[i]) - 1) >> 8; } return (gt + gt + eq) - 1; } //--------------------------------------------------------------------------- // Codecs function from_string(str) { if (typeof TextEncoder === "function") { return new TextEncoder("utf-8").encode(str); } str = unescape(encodeURIComponent(str)); var bytes = new Uint8Array(str.length); for (var i = 0; i < str.length; i++) { bytes[i] = str.charCodeAt(i); } return bytes; } function to_string(bytes) { if (typeof TextDecoder === "function") { return new TextDecoder("utf-8", {fatal: true}).decode(bytes); } try { return decodeURIComponent(escape(String.fromCharCode.apply(null, bytes))); } catch (_) { throw new TypeError("The encoded data was not valid."); } } function from_hex(str) { if (!is_hex(str)) throw new TypeError("The provided string doesn't look like hex data"); var result = new Uint8Array(str.length / 2); for (var i = 0; i < str.length; i += 2) { result[i >>> 1] = parseInt(str.substr(i, 2), 16); } return result; } function to_hex(bytes) { var str = "", b, c, x; for (var i = 0; i < bytes.length; i++) { c = bytes[i] & 0xf; b = bytes[i] >>> 4; x = (87 + c + (((c - 10) >> 8) & ~38)) << 8 | (87 + b + (((b - 10) >> 8) & ~38)); str += String.fromCharCode(x & 0xff) + String.fromCharCode(x >>> 8); } return str; } function is_hex(str) { return (typeof str === "string" && /^[0-9a-f]+$/i.test(str) && str.length % 2 === 0); } function from_base64(sBase64, nBlocksSize) { function _b64ToUint6(nChr) { return nChr > 64 && nChr < 91 ? nChr - 65 : nChr > 96 && nChr < 123 ? nChr - 71 : nChr > 47 && nChr < 58 ? nChr + 4 : nChr === 43 ? 62 : nChr === 47 ? 63 : 0; } var sB64Enc = sBase64.replace(/[^A-Za-z0-9\+\/]/g, ""), nInLen = sB64Enc.length, nOutLen = nBlocksSize ? Math.ceil((nInLen * 3 + 1 >> 2) / nBlocksSize) * nBlocksSize : nInLen * 3 + 1 >> 2, taBytes = new Uint8Array(nOutLen); for (var nMod3, nMod4, nUint24 = 0, nOutIdx = 0, nInIdx = 0; nInIdx < nInLen; nInIdx++) { nMod4 = nInIdx & 3; nUint24 |= _b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << 18 - 6 * nMod4; if (nMod4 === 3 || nInLen - nInIdx === 1) { for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) { taBytes[nOutIdx] = nUint24 >>> (16 >>> nMod3 & 24) & 255; } nUint24 = 0; } } return taBytes; } function to_base64(aBytes, noNewLine) { function _uint6ToB64(nUint6) { return nUint6 < 26 ? nUint6 + 65 : nUint6 < 52 ? nUint6 + 71 : nUint6 < 62 ? nUint6 - 4 : nUint6 === 62 ? 43 : nUint6 === 63 ? 47 : 65; } if (typeof aBytes === "string") { throw new Exception("input has to be an array"); } var nMod3 = 2, sB64Enc = ""; for (var nLen = aBytes.length, nUint24 = 0, nIdx = 0; nIdx < nLen; nIdx++) { nMod3 = nIdx % 3; if (nIdx > 0 && (nIdx * 4 / 3) % 76 === 0 && !noNewLine) { sB64Enc += "\r\n"; } nUint24 |= aBytes[nIdx] << (16 >>> nMod3 & 24); if (nMod3 === 2 || aBytes.length - nIdx === 1) { sB64Enc += String.fromCharCode(_uint6ToB64(nUint24 >>> 18 & 63), _uint6ToB64(nUint24 >>> 12 & 63), _uint6ToB64(nUint24 >>> 6 & 63), _uint6ToB64(nUint24 & 63)); nUint24 = 0; } } return sB64Enc.substr(0, sB64Enc.length - 2 + nMod3) + (nMod3 === 2 ? "" : nMod3 === 1 ? "=" : "=="); } function output_formats() { return ["uint8array", "text", "hex", "base64"]; } function _format_output(output, optionalOutputFormat) { var selectedOutputFormat = optionalOutputFormat || output_format; if (!_is_output_format(selectedOutputFormat)) throw new Error(selectedOutputFormat + " output format is not available"); if (output instanceof AllocatedBuf) { if (selectedOutputFormat === "uint8array") return output.to_Uint8Array(); else if (selectedOutputFormat === "text") return libsodium.Pointer_stringify(output.address, output.length); else if (selectedOutputFormat === "hex") return to_hex(output.to_Uint8Array()); else if (selectedOutputFormat === "base64") return to_base64(output.to_Uint8Array()); else throw new Error("What is output format \"" + selectedOutputFormat + "\"?"); } else if (typeof output === "object") { //Composed output. Example : key pairs var props = Object.keys(output); var formattedOutput = {}; for (var i = 0; i < props.length; i++) { formattedOutput[props[i]] = _format_output(output[props[i]], selectedOutputFormat); } return formattedOutput; } else if (typeof output === "string") { return output; } else { throw new TypeError("Cannot format output"); } } function _is_output_format(format) { var formats = output_formats(); for (var i = 0; i < formats.length; i++) { if (formats[i] === format) return true; } return false; } function _check_output_format(format) { if (!format) { return; } else if (typeof format !== "string") { throw new TypeError("When defined, the output format must be a string"); } else if (!_is_output_format(format)) { throw new Error(format + " is not a supported output format"); } } //--------------------------------------------------------------------------- // Memory management // AllocatedBuf: address allocated using _malloc() + length function AllocatedBuf(length) { this.length = length; this.address = _malloc(length); } // Copy the content of a AllocatedBuf (_malloc()'d memory) into a Uint8Array AllocatedBuf.prototype.to_Uint8Array = function () { var result = new Uint8Array(this.length); result.set(libsodium.HEAPU8.subarray(this.address, this.address + this.length)); return result; }; // _malloc() a region and initialize it with the content of a Uint8Array function _to_allocated_buf_address(bytes) { var address = _malloc(bytes.length); libsodium.HEAPU8.set(bytes, address); return address; } function _malloc(length) { var result = libsodium._malloc(length); if (result === 0) { throw { message: "_malloc() failed", length: length }; } return result; } function _free(address) { libsodium._free(address); } function _free_all(addresses) { for (var i = 0; i < addresses.length; i++) { _free(addresses[i]); } } function _free_and_throw_error(address_pool, err) { _free_all(address_pool); throw new Error(err); } function _free_and_throw_type_error(address_pool, err) { _free_all(address_pool); throw new TypeError(err); } function _require_defined(address_pool, varValue, varName) { if (varValue == undefined) { _free_and_throw_type_error(address_pool, varName + " cannot be null or undefined"); } } function _any_to_Uint8Array(address_pool, varValue, varName) { _require_defined(address_pool, varValue, varName); if (varValue instanceof Uint8Array) { return varValue; } else if (typeof varValue === "string") { return from_string(varValue); } _free_and_throw_type_error(address_pool, "unsupported input type for " + varName); } function crypto_aead_chacha20poly1305_decrypt(secret_nonce, ciphertext, additional_data, public_nonce, key, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: secret_nonce (unsized_buf_optional) var secret_nonce_address = null, secret_nonce_length = 0; if (secret_nonce != undefined) { secret_nonce = _any_to_Uint8Array(address_pool, secret_nonce, "secret_nonce"); secret_nonce_address = _to_allocated_buf_address(secret_nonce); secret_nonce_length = secret_nonce.length; address_pool.push(secret_nonce_address); } // ---------- input: ciphertext (unsized_buf) ciphertext = _any_to_Uint8Array(address_pool, ciphertext, "ciphertext"); var ciphertext_address = _to_allocated_buf_address(ciphertext), ciphertext_length = ciphertext.length; address_pool.push(ciphertext_address); // ---------- input: additional_data (unsized_buf_optional) var additional_data_address = null, additional_data_length = 0; if (additional_data != undefined) { additional_data = _any_to_Uint8Array(address_pool, additional_data, "additional_data"); additional_data_address = _to_allocated_buf_address(additional_data); additional_data_length = additional_data.length; address_pool.push(additional_data_address); } // ---------- input: public_nonce (buf) public_nonce = _any_to_Uint8Array(address_pool, public_nonce, "public_nonce"); var public_nonce_address, public_nonce_length = (libsodium._crypto_aead_chacha20poly1305_npubbytes()) | 0; if (public_nonce.length !== public_nonce_length) { _free_and_throw_type_error(address_pool, "invalid public_nonce length"); } public_nonce_address = _to_allocated_buf_address(public_nonce); address_pool.push(public_nonce_address); // ---------- input: key (buf) key = _any_to_Uint8Array(address_pool, key, "key"); var key_address, key_length = (libsodium._crypto_aead_chacha20poly1305_keybytes()) | 0; if (key.length !== key_length) { _free_and_throw_type_error(address_pool, "invalid key length"); } key_address = _to_allocated_buf_address(key); address_pool.push(key_address); // ---------- output message (buf) var message_length = (ciphertext_length - libsodium._crypto_aead_chacha20poly1305_abytes()) | 0, message = new AllocatedBuf(message_length), message_address = message.address; address_pool.push(message_address); if ((libsodium._crypto_aead_chacha20poly1305_decrypt(message_address, null, secret_nonce_address, ciphertext_address, ciphertext_length, 0, additional_data_address, additional_data_length, 0, public_nonce_address, key_address)) === 0) { var ret = _format_output(message, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_aead_chacha20poly1305_encrypt(message, additional_data, secret_nonce, public_nonce, key, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: additional_data (unsized_buf_optional) var additional_data_address = null, additional_data_length = 0; if (additional_data != undefined) { additional_data = _any_to_Uint8Array(address_pool, additional_data, "additional_data"); additional_data_address = _to_allocated_buf_address(additional_data); additional_data_length = additional_data.length; address_pool.push(additional_data_address); } // ---------- input: secret_nonce (unsized_buf_optional) var secret_nonce_address = null, secret_nonce_length = 0; if (secret_nonce != undefined) { secret_nonce = _any_to_Uint8Array(address_pool, secret_nonce, "secret_nonce"); secret_nonce_address = _to_allocated_buf_address(secret_nonce); secret_nonce_length = secret_nonce.length; address_pool.push(secret_nonce_address); } // ---------- input: public_nonce (buf) public_nonce = _any_to_Uint8Array(address_pool, public_nonce, "public_nonce"); var public_nonce_address, public_nonce_length = (libsodium._crypto_aead_chacha20poly1305_npubbytes()) | 0; if (public_nonce.length !== public_nonce_length) { _free_and_throw_type_error(address_pool, "invalid public_nonce length"); } public_nonce_address = _to_allocated_buf_address(public_nonce); address_pool.push(public_nonce_address); // ---------- input: key (buf) key = _any_to_Uint8Array(address_pool, key, "key"); var key_address, key_length = (libsodium._crypto_aead_chacha20poly1305_keybytes()) | 0; if (key.length !== key_length) { _free_and_throw_type_error(address_pool, "invalid key length"); } key_address = _to_allocated_buf_address(key); address_pool.push(key_address); // ---------- output ciphertext (buf) var ciphertext_length = (message_length + libsodium._crypto_aead_chacha20poly1305_abytes()) | 0, ciphertext = new AllocatedBuf(ciphertext_length), ciphertext_address = ciphertext.address; address_pool.push(ciphertext_address); if ((libsodium._crypto_aead_chacha20poly1305_encrypt(ciphertext_address, null, message_address, message_length, 0, additional_data_address, additional_data_length, 0, secret_nonce_address, public_nonce_address, key_address)) === 0) { var ret = _format_output(ciphertext, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_aead_chacha20poly1305_ietf_decrypt(secret_nonce, ciphertext, additional_data, public_nonce, key, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: secret_nonce (unsized_buf_optional) var secret_nonce_address = null, secret_nonce_length = 0; if (secret_nonce != undefined) { secret_nonce = _any_to_Uint8Array(address_pool, secret_nonce, "secret_nonce"); secret_nonce_address = _to_allocated_buf_address(secret_nonce); secret_nonce_length = secret_nonce.length; address_pool.push(secret_nonce_address); } // ---------- input: ciphertext (unsized_buf) ciphertext = _any_to_Uint8Array(address_pool, ciphertext, "ciphertext"); var ciphertext_address = _to_allocated_buf_address(ciphertext), ciphertext_length = ciphertext.length; address_pool.push(ciphertext_address); // ---------- input: additional_data (unsized_buf_optional) var additional_data_address = null, additional_data_length = 0; if (additional_data != undefined) { additional_data = _any_to_Uint8Array(address_pool, additional_data, "additional_data"); additional_data_address = _to_allocated_buf_address(additional_data); additional_data_length = additional_data.length; address_pool.push(additional_data_address); } // ---------- input: public_nonce (buf) public_nonce = _any_to_Uint8Array(address_pool, public_nonce, "public_nonce"); var public_nonce_address, public_nonce_length = (libsodium._crypto_aead_chacha20poly1305_ietf_npubbytes()) | 0; if (public_nonce.length !== public_nonce_length) { _free_and_throw_type_error(address_pool, "invalid public_nonce length"); } public_nonce_address = _to_allocated_buf_address(public_nonce); address_pool.push(public_nonce_address); // ---------- input: key (buf) key = _any_to_Uint8Array(address_pool, key, "key"); var key_address, key_length = (libsodium._crypto_aead_chacha20poly1305_keybytes()) | 0; if (key.length !== key_length) { _free_and_throw_type_error(address_pool, "invalid key length"); } key_address = _to_allocated_buf_address(key); address_pool.push(key_address); // ---------- output message (buf) var message_length = (ciphertext_length - libsodium._crypto_aead_chacha20poly1305_abytes()) | 0, message = new AllocatedBuf(message_length), message_address = message.address; address_pool.push(message_address); if ((libsodium._crypto_aead_chacha20poly1305_ietf_decrypt(message_address, null, secret_nonce_address, ciphertext_address, ciphertext_length, 0, additional_data_address, additional_data_length, 0, public_nonce_address, key_address)) === 0) { var ret = _format_output(message, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_aead_chacha20poly1305_ietf_encrypt(message, additional_data, secret_nonce, public_nonce, key, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: additional_data (unsized_buf_optional) var additional_data_address = null, additional_data_length = 0; if (additional_data != undefined) { additional_data = _any_to_Uint8Array(address_pool, additional_data, "additional_data"); additional_data_address = _to_allocated_buf_address(additional_data); additional_data_length = additional_data.length; address_pool.push(additional_data_address); } // ---------- input: secret_nonce (unsized_buf_optional) var secret_nonce_address = null, secret_nonce_length = 0; if (secret_nonce != undefined) { secret_nonce = _any_to_Uint8Array(address_pool, secret_nonce, "secret_nonce"); secret_nonce_address = _to_allocated_buf_address(secret_nonce); secret_nonce_length = secret_nonce.length; address_pool.push(secret_nonce_address); } // ---------- input: public_nonce (buf) public_nonce = _any_to_Uint8Array(address_pool, public_nonce, "public_nonce"); var public_nonce_address, public_nonce_length = (libsodium._crypto_aead_chacha20poly1305_ietf_npubbytes()) | 0; if (public_nonce.length !== public_nonce_length) { _free_and_throw_type_error(address_pool, "invalid public_nonce length"); } public_nonce_address = _to_allocated_buf_address(public_nonce); address_pool.push(public_nonce_address); // ---------- input: key (buf) key = _any_to_Uint8Array(address_pool, key, "key"); var key_address, key_length = (libsodium._crypto_aead_chacha20poly1305_keybytes()) | 0; if (key.length !== key_length) { _free_and_throw_type_error(address_pool, "invalid key length"); } key_address = _to_allocated_buf_address(key); address_pool.push(key_address); // ---------- output ciphertext (buf) var ciphertext_length = (message_length + libsodium._crypto_aead_chacha20poly1305_abytes()) | 0, ciphertext = new AllocatedBuf(ciphertext_length), ciphertext_address = ciphertext.address; address_pool.push(ciphertext_address); if ((libsodium._crypto_aead_chacha20poly1305_ietf_encrypt(ciphertext_address, null, message_address, message_length, 0, additional_data_address, additional_data_length, 0, secret_nonce_address, public_nonce_address, key_address)) === 0) { var ret = _format_output(ciphertext, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_auth(message, key, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: key (buf) key = _any_to_Uint8Array(address_pool, key, "key"); var key_address, key_length = (libsodium._crypto_auth_keybytes()) | 0; if (key.length !== key_length) { _free_and_throw_type_error(address_pool, "invalid key length"); } key_address = _to_allocated_buf_address(key); address_pool.push(key_address); // ---------- output tag (buf) var tag_length = (libsodium._crypto_auth_bytes()) | 0, tag = new AllocatedBuf(tag_length), tag_address = tag.address; address_pool.push(tag_address); if ((libsodium._crypto_auth(tag_address, message_address, message_length, 0, key_address) | 0) === 0) { var ret = _format_output(tag, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_auth_hmacsha256(message, key, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: key (buf) key = _any_to_Uint8Array(address_pool, key, "key"); var key_address, key_length = (libsodium._crypto_auth_hmacsha256_keybytes()) | 0; if (key.length !== key_length) { _free_and_throw_type_error(address_pool, "invalid key length"); } key_address = _to_allocated_buf_address(key); address_pool.push(key_address); // ---------- output hash (buf) var hash_length = (libsodium._crypto_auth_hmacsha256_bytes()) | 0, hash = new AllocatedBuf(hash_length), hash_address = hash.address; address_pool.push(hash_address); if ((libsodium._crypto_auth_hmacsha256(hash_address, message_address, message_length, 0, key_address) | 0) === 0) { var ret = _format_output(hash, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_auth_hmacsha256_verify(tag, message, key) { var address_pool = []; // ---------- input: tag (buf) tag = _any_to_Uint8Array(address_pool, tag, "tag"); var tag_address, tag_length = (libsodium._crypto_auth_hmacsha256_bytes()) | 0; if (tag.length !== tag_length) { _free_and_throw_type_error(address_pool, "invalid tag length"); } tag_address = _to_allocated_buf_address(tag); address_pool.push(tag_address); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: key (buf) key = _any_to_Uint8Array(address_pool, key, "key"); var key_address, key_length = (libsodium._crypto_auth_hmacsha256_keybytes()) | 0; if (key.length !== key_length) { _free_and_throw_type_error(address_pool, "invalid key length"); } key_address = _to_allocated_buf_address(key); address_pool.push(key_address); var result = libsodium._crypto_auth_hmacsha256_verify(tag_address, message_address, message_length, 0, key_address) | 0; var ret = (result === 0); _free_all(address_pool); return ret; } function crypto_auth_hmacsha512(message, key, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: key (buf) key = _any_to_Uint8Array(address_pool, key, "key"); var key_address, key_length = (libsodium._crypto_auth_hmacsha512_keybytes()) | 0; if (key.length !== key_length) { _free_and_throw_type_error(address_pool, "invalid key length"); } key_address = _to_allocated_buf_address(key); address_pool.push(key_address); // ---------- output hash (buf) var hash_length = (libsodium._crypto_auth_hmacsha512_bytes()) | 0, hash = new AllocatedBuf(hash_length), hash_address = hash.address; address_pool.push(hash_address); if ((libsodium._crypto_auth_hmacsha512(hash_address, message_address, message_length, 0, key_address) | 0) === 0) { var ret = _format_output(hash, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_auth_hmacsha512_verify(tag, message, key) { var address_pool = []; // ---------- input: tag (buf) tag = _any_to_Uint8Array(address_pool, tag, "tag"); var tag_address, tag_length = (libsodium._crypto_auth_hmacsha512_bytes()) | 0; if (tag.length !== tag_length) { _free_and_throw_type_error(address_pool, "invalid tag length"); } tag_address = _to_allocated_buf_address(tag); address_pool.push(tag_address); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: key (buf) key = _any_to_Uint8Array(address_pool, key, "key"); var key_address, key_length = (libsodium._crypto_auth_hmacsha512_keybytes()) | 0; if (key.length !== key_length) { _free_and_throw_type_error(address_pool, "invalid key length"); } key_address = _to_allocated_buf_address(key); address_pool.push(key_address); var result = libsodium._crypto_auth_hmacsha512_verify(tag_address, message_address, message_length, 0, key_address) | 0; var ret = (result === 0); _free_all(address_pool); return ret; } function crypto_auth_verify(tag, message, key) { var address_pool = []; // ---------- input: tag (buf) tag = _any_to_Uint8Array(address_pool, tag, "tag"); var tag_address, tag_length = (libsodium._crypto_auth_bytes()) | 0; if (tag.length !== tag_length) { _free_and_throw_type_error(address_pool, "invalid tag length"); } tag_address = _to_allocated_buf_address(tag); address_pool.push(tag_address); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: key (buf) key = _any_to_Uint8Array(address_pool, key, "key"); var key_address, key_length = (libsodium._crypto_auth_keybytes()) | 0; if (key.length !== key_length) { _free_and_throw_type_error(address_pool, "invalid key length"); } key_address = _to_allocated_buf_address(key); address_pool.push(key_address); var result = libsodium._crypto_auth_verify(tag_address, message_address, message_length, 0, key_address) | 0; var ret = (result === 0); _free_all(address_pool); return ret; } function crypto_box_beforenm(publicKey, secretKey, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: publicKey (buf) publicKey = _any_to_Uint8Array(address_pool, publicKey, "publicKey"); var publicKey_address, publicKey_length = (libsodium._crypto_box_publickeybytes()) | 0; if (publicKey.length !== publicKey_length) { _free_and_throw_type_error(address_pool, "invalid publicKey length"); } publicKey_address = _to_allocated_buf_address(publicKey); address_pool.push(publicKey_address); // ---------- input: secretKey (buf) secretKey = _any_to_Uint8Array(address_pool, secretKey, "secretKey"); var secretKey_address, secretKey_length = (libsodium._crypto_box_secretkeybytes()) | 0; if (secretKey.length !== secretKey_length) { _free_and_throw_type_error(address_pool, "invalid secretKey length"); } secretKey_address = _to_allocated_buf_address(secretKey); address_pool.push(secretKey_address); // ---------- output sharedKey (buf) var sharedKey_length = (libsodium._crypto_box_beforenmbytes()) | 0, sharedKey = new AllocatedBuf(sharedKey_length), sharedKey_address = sharedKey.address; address_pool.push(sharedKey_address); if ((libsodium._crypto_box_beforenm(sharedKey_address, publicKey_address, secretKey_address) | 0) === 0) { var ret = _format_output(sharedKey, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_box_detached(message, nonce, publicKey, secretKey, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: nonce (buf) nonce = _any_to_Uint8Array(address_pool, nonce, "nonce"); var nonce_address, nonce_length = (libsodium._crypto_box_noncebytes()) | 0; if (nonce.length !== nonce_length) { _free_and_throw_type_error(address_pool, "invalid nonce length"); } nonce_address = _to_allocated_buf_address(nonce); address_pool.push(nonce_address); // ---------- input: publicKey (buf) publicKey = _any_to_Uint8Array(address_pool, publicKey, "publicKey"); var publicKey_address, publicKey_length = (libsodium._crypto_box_publickeybytes()) | 0; if (publicKey.length !== publicKey_length) { _free_and_throw_type_error(address_pool, "invalid publicKey length"); } publicKey_address = _to_allocated_buf_address(publicKey); address_pool.push(publicKey_address); // ---------- input: secretKey (buf) secretKey = _any_to_Uint8Array(address_pool, secretKey, "secretKey"); var secretKey_address, secretKey_length = (libsodium._crypto_box_secretkeybytes()) | 0; if (secretKey.length !== secretKey_length) { _free_and_throw_type_error(address_pool, "invalid secretKey length"); } secretKey_address = _to_allocated_buf_address(secretKey); address_pool.push(secretKey_address); // ---------- output ciphertext (buf) var ciphertext_length = (message_length) | 0, ciphertext = new AllocatedBuf(ciphertext_length), ciphertext_address = ciphertext.address; address_pool.push(ciphertext_address); // ---------- output mac (buf) var mac_length = (libsodium._crypto_box_macbytes()) | 0, mac = new AllocatedBuf(mac_length), mac_address = mac.address; address_pool.push(mac_address); if ((libsodium._crypto_box_detached(ciphertext_address, mac_address, message_address, message_length, 0, nonce_address, publicKey_address, secretKey_address) | 0) === 0) { var ret = _format_output({ciphertext: ciphertext, mac: mac}, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_box_easy(message, nonce, publicKey, secretKey, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: nonce (buf) nonce = _any_to_Uint8Array(address_pool, nonce, "nonce"); var nonce_address, nonce_length = (libsodium._crypto_box_noncebytes()) | 0; if (nonce.length !== nonce_length) { _free_and_throw_type_error(address_pool, "invalid nonce length"); } nonce_address = _to_allocated_buf_address(nonce); address_pool.push(nonce_address); // ---------- input: publicKey (buf) publicKey = _any_to_Uint8Array(address_pool, publicKey, "publicKey"); var publicKey_address, publicKey_length = (libsodium._crypto_box_publickeybytes()) | 0; if (publicKey.length !== publicKey_length) { _free_and_throw_type_error(address_pool, "invalid publicKey length"); } publicKey_address = _to_allocated_buf_address(publicKey); address_pool.push(publicKey_address); // ---------- input: secretKey (buf) secretKey = _any_to_Uint8Array(address_pool, secretKey, "secretKey"); var secretKey_address, secretKey_length = (libsodium._crypto_box_secretkeybytes()) | 0; if (secretKey.length !== secretKey_length) { _free_and_throw_type_error(address_pool, "invalid secretKey length"); } secretKey_address = _to_allocated_buf_address(secretKey); address_pool.push(secretKey_address); // ---------- output ciphertext (buf) var ciphertext_length = (message_length + libsodium._crypto_box_macbytes()) | 0, ciphertext = new AllocatedBuf(ciphertext_length), ciphertext_address = ciphertext.address; address_pool.push(ciphertext_address); if ((libsodium._crypto_box_easy(ciphertext_address, message_address, message_length, 0, nonce_address, publicKey_address, secretKey_address) | 0) === 0) { var ret = _format_output(ciphertext, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_box_easy_afternm(message, nonce, sharedKey, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: nonce (buf) nonce = _any_to_Uint8Array(address_pool, nonce, "nonce"); var nonce_address, nonce_length = (libsodium._crypto_box_noncebytes()) | 0; if (nonce.length !== nonce_length) { _free_and_throw_type_error(address_pool, "invalid nonce length"); } nonce_address = _to_allocated_buf_address(nonce); address_pool.push(nonce_address); // ---------- input: sharedKey (buf) sharedKey = _any_to_Uint8Array(address_pool, sharedKey, "sharedKey"); var sharedKey_address, sharedKey_length = (libsodium._crypto_box_beforenmbytes()) | 0; if (sharedKey.length !== sharedKey_length) { _free_and_throw_type_error(address_pool, "invalid sharedKey length"); } sharedKey_address = _to_allocated_buf_address(sharedKey); address_pool.push(sharedKey_address); // ---------- output ciphertext (buf) var ciphertext_length = (message_length + libsodium._crypto_box_macbytes()) | 0, ciphertext = new AllocatedBuf(ciphertext_length), ciphertext_address = ciphertext.address; address_pool.push(ciphertext_address); if ((libsodium._crypto_box_easy_afternm(ciphertext_address, message_address, message_length, 0, nonce_address, sharedKey_address) | 0) === 0) { var ret = _format_output(ciphertext, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_box_keypair(outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- output publicKey (buf) var publicKey_length = (libsodium._crypto_box_publickeybytes()) | 0, publicKey = new AllocatedBuf(publicKey_length), publicKey_address = publicKey.address; address_pool.push(publicKey_address); // ---------- output secretKey (buf) var secretKey_length = (libsodium._crypto_box_secretkeybytes()) | 0, secretKey = new AllocatedBuf(secretKey_length), secretKey_address = secretKey.address; address_pool.push(secretKey_address); if ((libsodium._crypto_box_keypair(publicKey_address, secretKey_address) | 0) === 0) { var ret = _format_output({publicKey: publicKey, privateKey: secretKey, keyType: "curve25519"}, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_box_open_detached(ciphertext, mac, nonce, publicKey, secretKey, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: ciphertext (unsized_buf) ciphertext = _any_to_Uint8Array(address_pool, ciphertext, "ciphertext"); var ciphertext_address = _to_allocated_buf_address(ciphertext), ciphertext_length = ciphertext.length; address_pool.push(ciphertext_address); // ---------- input: mac (buf) mac = _any_to_Uint8Array(address_pool, mac, "mac"); var mac_address, mac_length = (libsodium._crypto_box_macbytes()) | 0; if (mac.length !== mac_length) { _free_and_throw_type_error(address_pool, "invalid mac length"); } mac_address = _to_allocated_buf_address(mac); address_pool.push(mac_address); // ---------- input: nonce (buf) nonce = _any_to_Uint8Array(address_pool, nonce, "nonce"); var nonce_address, nonce_length = (libsodium._crypto_box_noncebytes()) | 0; if (nonce.length !== nonce_length) { _free_and_throw_type_error(address_pool, "invalid nonce length"); } nonce_address = _to_allocated_buf_address(nonce); address_pool.push(nonce_address); // ---------- input: publicKey (buf) publicKey = _any_to_Uint8Array(address_pool, publicKey, "publicKey"); var publicKey_address, publicKey_length = (libsodium._crypto_box_publickeybytes()) | 0; if (publicKey.length !== publicKey_length) { _free_and_throw_type_error(address_pool, "invalid publicKey length"); } publicKey_address = _to_allocated_buf_address(publicKey); address_pool.push(publicKey_address); // ---------- input: secretKey (buf) secretKey = _any_to_Uint8Array(address_pool, secretKey, "secretKey"); var secretKey_address, secretKey_length = (libsodium._crypto_box_secretkeybytes()) | 0; if (secretKey.length !== secretKey_length) { _free_and_throw_type_error(address_pool, "invalid secretKey length"); } secretKey_address = _to_allocated_buf_address(secretKey); address_pool.push(secretKey_address); // ---------- output plaintext (buf) var plaintext_length = (ciphertext_length) | 0, plaintext = new AllocatedBuf(plaintext_length), plaintext_address = plaintext.address; address_pool.push(plaintext_address); if ((libsodium._crypto_box_open_detached(plaintext_address, ciphertext_address, mac_address, ciphertext_length, 0, nonce_address, publicKey_address, secretKey_address) | 0) === 0) { var ret = _format_output(plaintext, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_box_open_easy(ciphertext, nonce, publicKey, secretKey, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: ciphertext (unsized_buf) ciphertext = _any_to_Uint8Array(address_pool, ciphertext, "ciphertext"); var ciphertext_address = _to_allocated_buf_address(ciphertext), ciphertext_length = ciphertext.length; address_pool.push(ciphertext_address); // ---------- input: nonce (buf) nonce = _any_to_Uint8Array(address_pool, nonce, "nonce"); var nonce_address, nonce_length = (libsodium._crypto_box_noncebytes()) | 0; if (nonce.length !== nonce_length) { _free_and_throw_type_error(address_pool, "invalid nonce length"); } nonce_address = _to_allocated_buf_address(nonce); address_pool.push(nonce_address); // ---------- input: publicKey (buf) publicKey = _any_to_Uint8Array(address_pool, publicKey, "publicKey"); var publicKey_address, publicKey_length = (libsodium._crypto_box_publickeybytes()) | 0; if (publicKey.length !== publicKey_length) { _free_and_throw_type_error(address_pool, "invalid publicKey length"); } publicKey_address = _to_allocated_buf_address(publicKey); address_pool.push(publicKey_address); // ---------- input: secretKey (buf) secretKey = _any_to_Uint8Array(address_pool, secretKey, "secretKey"); var secretKey_address, secretKey_length = (libsodium._crypto_box_secretkeybytes()) | 0; if (secretKey.length !== secretKey_length) { _free_and_throw_type_error(address_pool, "invalid secretKey length"); } secretKey_address = _to_allocated_buf_address(secretKey); address_pool.push(secretKey_address); // ---------- output plaintext (buf) var plaintext_length = (ciphertext_length - libsodium._crypto_box_macbytes()) | 0, plaintext = new AllocatedBuf(plaintext_length), plaintext_address = plaintext.address; address_pool.push(plaintext_address); if ((libsodium._crypto_box_open_easy(plaintext_address, ciphertext_address, ciphertext_length, 0, nonce_address, publicKey_address, secretKey_address) | 0) === 0) { var ret = _format_output(plaintext, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_box_open_easy_afternm(ciphertext, nonce, sharedKey, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: ciphertext (unsized_buf) ciphertext = _any_to_Uint8Array(address_pool, ciphertext, "ciphertext"); var ciphertext_address = _to_allocated_buf_address(ciphertext), ciphertext_length = ciphertext.length; address_pool.push(ciphertext_address); // ---------- input: nonce (buf) nonce = _any_to_Uint8Array(address_pool, nonce, "nonce"); var nonce_address, nonce_length = (libsodium._crypto_box_noncebytes()) | 0; if (nonce.length !== nonce_length) { _free_and_throw_type_error(address_pool, "invalid nonce length"); } nonce_address = _to_allocated_buf_address(nonce); address_pool.push(nonce_address); // ---------- input: sharedKey (buf) sharedKey = _any_to_Uint8Array(address_pool, sharedKey, "sharedKey"); var sharedKey_address, sharedKey_length = (libsodium._crypto_box_beforenmbytes()) | 0; if (sharedKey.length !== sharedKey_length) { _free_and_throw_type_error(address_pool, "invalid sharedKey length"); } sharedKey_address = _to_allocated_buf_address(sharedKey); address_pool.push(sharedKey_address); // ---------- output plaintext (buf) var plaintext_length = (ciphertext_length - libsodium._crypto_box_macbytes()) | 0, plaintext = new AllocatedBuf(plaintext_length), plaintext_address = plaintext.address; address_pool.push(plaintext_address); if ((libsodium._crypto_box_open_easy_afternm(plaintext_address, ciphertext_address, ciphertext_length, 0, nonce_address, sharedKey_address) | 0) === 0) { var ret = _format_output(plaintext, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_box_seal(message, publicKey, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: publicKey (buf) publicKey = _any_to_Uint8Array(address_pool, publicKey, "publicKey"); var publicKey_address, publicKey_length = (libsodium._crypto_box_publickeybytes()) | 0; if (publicKey.length !== publicKey_length) { _free_and_throw_type_error(address_pool, "invalid publicKey length"); } publicKey_address = _to_allocated_buf_address(publicKey); address_pool.push(publicKey_address); // ---------- output ciphertext (buf) var ciphertext_length = (message_length + libsodium._crypto_box_sealbytes()) | 0, ciphertext = new AllocatedBuf(ciphertext_length), ciphertext_address = ciphertext.address; address_pool.push(ciphertext_address); if ((libsodium._crypto_box_seal(ciphertext_address, message_address, message_length, 0, publicKey_address) | 0) === 0) { var ret = _format_output(ciphertext, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_box_seal_open(ciphertext, publicKey, secretKey, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: ciphertext (unsized_buf) ciphertext = _any_to_Uint8Array(address_pool, ciphertext, "ciphertext"); var ciphertext_address = _to_allocated_buf_address(ciphertext), ciphertext_length = ciphertext.length; address_pool.push(ciphertext_address); // ---------- input: publicKey (buf) publicKey = _any_to_Uint8Array(address_pool, publicKey, "publicKey"); var publicKey_address, publicKey_length = (libsodium._crypto_box_publickeybytes()) | 0; if (publicKey.length !== publicKey_length) { _free_and_throw_type_error(address_pool, "invalid publicKey length"); } publicKey_address = _to_allocated_buf_address(publicKey); address_pool.push(publicKey_address); // ---------- input: secretKey (buf) secretKey = _any_to_Uint8Array(address_pool, secretKey, "secretKey"); var secretKey_address, secretKey_length = (libsodium._crypto_box_secretkeybytes()) | 0; if (secretKey.length !== secretKey_length) { _free_and_throw_type_error(address_pool, "invalid secretKey length"); } secretKey_address = _to_allocated_buf_address(secretKey); address_pool.push(secretKey_address); // ---------- output plaintext (buf) var plaintext_length = (ciphertext_length - libsodium._crypto_box_sealbytes()) | 0, plaintext = new AllocatedBuf(plaintext_length), plaintext_address = plaintext.address; address_pool.push(plaintext_address); if ((libsodium._crypto_box_seal_open(plaintext_address, ciphertext_address, ciphertext_length, 0, publicKey_address, secretKey_address) | 0) === 0) { var ret = _format_output(plaintext, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_box_seed_keypair(seed, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: seed (buf) seed = _any_to_Uint8Array(address_pool, seed, "seed"); var seed_address, seed_length = (libsodium._crypto_box_seedbytes()) | 0; if (seed.length !== seed_length) { _free_and_throw_type_error(address_pool, "invalid seed length"); } seed_address = _to_allocated_buf_address(seed); address_pool.push(seed_address); // ---------- output publicKey (buf) var publicKey_length = (libsodium._crypto_box_publickeybytes()) | 0, publicKey = new AllocatedBuf(publicKey_length), publicKey_address = publicKey.address; address_pool.push(publicKey_address); // ---------- output privateKey (buf) var privateKey_length = (libsodium._crypto_box_secretkeybytes()) | 0, privateKey = new AllocatedBuf(privateKey_length), privateKey_address = privateKey.address; address_pool.push(privateKey_address); if ((libsodium._crypto_box_seed_keypair(publicKey_address, privateKey_address, seed_address) | 0) === 0) { var ret = _format_output({publicKey: publicKey, privateKey: privateKey}, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_generichash(hash_length, message, key, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: hash_length (uint) _require_defined(address_pool, hash_length, "hash_length"); if (!(typeof hash_length === "number" && (hash_length | 0) === hash_length) && (hash_length | 0) > 0) { _free_and_throw_type_error(address_pool, "hash_length must be an unsigned integer"); } // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: key (unsized_buf_optional) var key_address = null, key_length = 0; if (key != undefined) { key = _any_to_Uint8Array(address_pool, key, "key"); key_address = _to_allocated_buf_address(key); key_length = key.length; address_pool.push(key_address); } // ---------- output hash (buf) var hash_length = (hash_length) | 0, hash = new AllocatedBuf(hash_length), hash_address = hash.address; address_pool.push(hash_address); if ((libsodium._crypto_generichash(hash_address, hash_length, message_address, message_length, 0, key_address, key_length) | 0) === 0) { var ret = _format_output(hash, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_generichash_final(state_address, hash_length, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: state_address (generichash_state_address) _require_defined(address_pool, state_address, "state_address"); // ---------- input: hash_length (uint) _require_defined(address_pool, hash_length, "hash_length"); if (!(typeof hash_length === "number" && (hash_length | 0) === hash_length) && (hash_length | 0) > 0) { _free_and_throw_type_error(address_pool, "hash_length must be an unsigned integer"); } // ---------- output hash (buf) var hash_length = (hash_length) | 0, hash = new AllocatedBuf(hash_length), hash_address = hash.address; address_pool.push(hash_address); if ((libsodium._crypto_generichash_final(state_address, hash_address, hash_length) | 0) === 0) { var ret = (libsodium._free(state_address), _format_output(hash, outputFormat)); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_generichash_init(key, hash_length, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: key (unsized_buf_optional) var key_address = null, key_length = 0; if (key != undefined) { key = _any_to_Uint8Array(address_pool, key, "key"); key_address = _to_allocated_buf_address(key); key_length = key.length; address_pool.push(key_address); } // ---------- input: hash_length (uint) _require_defined(address_pool, hash_length, "hash_length"); if (!(typeof hash_length === "number" && (hash_length | 0) === hash_length) && (hash_length | 0) > 0) { _free_and_throw_type_error(address_pool, "hash_length must be an unsigned integer"); } // ---------- output state (generichash_state) var state_address = new AllocatedBuf(357).address; if ((libsodium._crypto_generichash_init(state_address, key_address, key_length, hash_length) | 0) === 0) { var ret = state_address; _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_generichash_update(state_address, message_chunk, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: state_address (generichash_state_address) _require_defined(address_pool, state_address, "state_address"); // ---------- input: message_chunk (unsized_buf) message_chunk = _any_to_Uint8Array(address_pool, message_chunk, "message_chunk"); var message_chunk_address = _to_allocated_buf_address(message_chunk), message_chunk_length = message_chunk.length; address_pool.push(message_chunk_address); if ((libsodium._crypto_generichash_update(state_address, message_chunk_address, message_chunk_length) | 0) === 0) { _free_all(address_pool); return; } _free_and_throw_error(address_pool); } function crypto_hash(message, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- output hash (buf) var hash_length = (libsodium._crypto_hash_bytes()) | 0, hash = new AllocatedBuf(hash_length), hash_address = hash.address; address_pool.push(hash_address); if ((libsodium._crypto_hash(hash_address, message_address, message_length, 0) | 0) === 0) { var ret = _format_output(hash, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_hash_sha256(message, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- output hash (buf) var hash_length = (libsodium._crypto_hash_sha256_bytes()) | 0, hash = new AllocatedBuf(hash_length), hash_address = hash.address; address_pool.push(hash_address); if ((libsodium._crypto_hash_sha256(hash_address, message_address, message_length, 0) | 0) === 0) { var ret = _format_output(hash, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_hash_sha512(message, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- output hash (buf) var hash_length = (libsodium._crypto_hash_sha512_bytes()) | 0, hash = new AllocatedBuf(hash_length), hash_address = hash.address; address_pool.push(hash_address); if ((libsodium._crypto_hash_sha512(hash_address, message_address, message_length, 0) | 0) === 0) { var ret = _format_output(hash, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_onetimeauth(message, key, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: key (buf) key = _any_to_Uint8Array(address_pool, key, "key"); var key_address, key_length = (libsodium._crypto_onetimeauth_keybytes()) | 0; if (key.length !== key_length) { _free_and_throw_type_error(address_pool, "invalid key length"); } key_address = _to_allocated_buf_address(key); address_pool.push(key_address); // ---------- output hash (buf) var hash_length = (libsodium._crypto_onetimeauth_bytes()) | 0, hash = new AllocatedBuf(hash_length), hash_address = hash.address; address_pool.push(hash_address); if ((libsodium._crypto_onetimeauth(hash_address, message_address, message_length, 0, key_address) | 0) === 0) { var ret = _format_output(hash, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_onetimeauth_final(state_address, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: state_address (onetimeauth_state_address) _require_defined(address_pool, state_address, "state_address"); // ---------- output hash (buf) var hash_length = (libsodium._crypto_onetimeauth_bytes()) | 0, hash = new AllocatedBuf(hash_length), hash_address = hash.address; address_pool.push(hash_address); if ((libsodium._crypto_onetimeauth_final(state_address, hash_address) | 0) === 0) { var ret = (libsodium._free(state_address), _format_output(hash, outputFormat)); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_onetimeauth_init(key, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: key (unsized_buf_optional) var key_address = null, key_length = 0; if (key != undefined) { key = _any_to_Uint8Array(address_pool, key, "key"); key_address = _to_allocated_buf_address(key); key_length = key.length; address_pool.push(key_address); } // ---------- output state (onetimeauth_state) var state_address = new AllocatedBuf(144).address; if ((libsodium._crypto_onetimeauth_init(state_address, key_address) | 0) === 0) { var ret = state_address; _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_onetimeauth_update(state_address, message_chunk, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: state_address (onetimeauth_state_address) _require_defined(address_pool, state_address, "state_address"); // ---------- input: message_chunk (unsized_buf) message_chunk = _any_to_Uint8Array(address_pool, message_chunk, "message_chunk"); var message_chunk_address = _to_allocated_buf_address(message_chunk), message_chunk_length = message_chunk.length; address_pool.push(message_chunk_address); if ((libsodium._crypto_onetimeauth_update(state_address, message_chunk_address, message_chunk_length) | 0) === 0) { _free_all(address_pool); return; } _free_and_throw_error(address_pool); } function crypto_onetimeauth_verify(hash, message, key) { var address_pool = []; // ---------- input: hash (buf) hash = _any_to_Uint8Array(address_pool, hash, "hash"); var hash_address, hash_length = (libsodium._crypto_onetimeauth_bytes()) | 0; if (hash.length !== hash_length) { _free_and_throw_type_error(address_pool, "invalid hash length"); } hash_address = _to_allocated_buf_address(hash); address_pool.push(hash_address); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: key (buf) key = _any_to_Uint8Array(address_pool, key, "key"); var key_address, key_length = (libsodium._crypto_onetimeauth_keybytes()) | 0; if (key.length !== key_length) { _free_and_throw_type_error(address_pool, "invalid key length"); } key_address = _to_allocated_buf_address(key); address_pool.push(key_address); var result = libsodium._crypto_onetimeauth_verify(hash_address, message_address, message_length, 0, key_address) | 0; var ret = (result === 0); _free_all(address_pool); return ret; } function crypto_pwhash_scryptsalsa208sha256(password, salt, opsLimit, memLimit, keyLength, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: password (unsized_buf) password = _any_to_Uint8Array(address_pool, password, "password"); var password_address = _to_allocated_buf_address(password), password_length = password.length; address_pool.push(password_address); // ---------- input: salt (buf) salt = _any_to_Uint8Array(address_pool, salt, "salt"); var salt_address, salt_length = (libsodium._crypto_pwhash_scryptsalsa208sha256_saltbytes()) | 0; if (salt.length !== salt_length) { _free_and_throw_type_error(address_pool, "invalid salt length"); } salt_address = _to_allocated_buf_address(salt); address_pool.push(salt_address); // ---------- input: opsLimit (uint) _require_defined(address_pool, opsLimit, "opsLimit"); if (!(typeof opsLimit === "number" && (opsLimit | 0) === opsLimit) && (opsLimit | 0) > 0) { _free_and_throw_type_error(address_pool, "opsLimit must be an unsigned integer"); } // ---------- input: memLimit (uint) _require_defined(address_pool, memLimit, "memLimit"); if (!(typeof memLimit === "number" && (memLimit | 0) === memLimit) && (memLimit | 0) > 0) { _free_and_throw_type_error(address_pool, "memLimit must be an unsigned integer"); } // ---------- input: keyLength (uint) _require_defined(address_pool, keyLength, "keyLength"); if (!(typeof keyLength === "number" && (keyLength | 0) === keyLength) && (keyLength | 0) > 0) { _free_and_throw_type_error(address_pool, "keyLength must be an unsigned integer"); } // ---------- output derivedKey (buf) var derivedKey_length = (keyLength) | 0, derivedKey = new AllocatedBuf(derivedKey_length), derivedKey_address = derivedKey.address; address_pool.push(derivedKey_address); if ((libsodium._crypto_pwhash_scryptsalsa208sha256(derivedKey_address, keyLength, 0, password_address, password_length, 0, salt_address, opsLimit, 0, memLimit) | 0) === 0) { var ret = _format_output(derivedKey, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_pwhash_scryptsalsa208sha256_ll(password, salt, opsLimit, r, p, keyLength, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: password (unsized_buf) password = _any_to_Uint8Array(address_pool, password, "password"); var password_address = _to_allocated_buf_address(password), password_length = password.length; address_pool.push(password_address); // ---------- input: salt (unsized_buf) salt = _any_to_Uint8Array(address_pool, salt, "salt"); var salt_address = _to_allocated_buf_address(salt), salt_length = salt.length; address_pool.push(salt_address); // ---------- input: opsLimit (uint) _require_defined(address_pool, opsLimit, "opsLimit"); if (!(typeof opsLimit === "number" && (opsLimit | 0) === opsLimit) && (opsLimit | 0) > 0) { _free_and_throw_type_error(address_pool, "opsLimit must be an unsigned integer"); } // ---------- input: r (uint) _require_defined(address_pool, r, "r"); if (!(typeof r === "number" && (r | 0) === r) && (r | 0) > 0) { _free_and_throw_type_error(address_pool, "r must be an unsigned integer"); } // ---------- input: p (uint) _require_defined(address_pool, p, "p"); if (!(typeof p === "number" && (p | 0) === p) && (p | 0) > 0) { _free_and_throw_type_error(address_pool, "p must be an unsigned integer"); } // ---------- input: keyLength (uint) _require_defined(address_pool, keyLength, "keyLength"); if (!(typeof keyLength === "number" && (keyLength | 0) === keyLength) && (keyLength | 0) > 0) { _free_and_throw_type_error(address_pool, "keyLength must be an unsigned integer"); } // ---------- output derivedKey (buf) var derivedKey_length = (keyLength) | 0, derivedKey = new AllocatedBuf(derivedKey_length), derivedKey_address = derivedKey.address; address_pool.push(derivedKey_address); if ((libsodium._crypto_pwhash_scryptsalsa208sha256_ll(password_address, password_length, salt_address, salt_length, opsLimit, 0, r, p, derivedKey_address, keyLength) | 0) === 0) { var ret = _format_output(derivedKey, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_pwhash_scryptsalsa208sha256_str(password, opsLimit, memLimit, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: password (unsized_buf) password = _any_to_Uint8Array(address_pool, password, "password"); var password_address = _to_allocated_buf_address(password), password_length = password.length; address_pool.push(password_address); // ---------- input: opsLimit (uint) _require_defined(address_pool, opsLimit, "opsLimit"); if (!(typeof opsLimit === "number" && (opsLimit | 0) === opsLimit) && (opsLimit | 0) > 0) { _free_and_throw_type_error(address_pool, "opsLimit must be an unsigned integer"); } // ---------- input: memLimit (uint) _require_defined(address_pool, memLimit, "memLimit"); if (!(typeof memLimit === "number" && (memLimit | 0) === memLimit) && (memLimit | 0) > 0) { _free_and_throw_type_error(address_pool, "memLimit must be an unsigned integer"); } // ---------- output hashed_password (buf) var hashed_password_length = (libsodium._crypto_pwhash_scryptsalsa208sha256_strbytes()) | 0, hashed_password = new AllocatedBuf(hashed_password_length), hashed_password_address = hashed_password.address; address_pool.push(hashed_password_address); if ((libsodium._crypto_pwhash_scryptsalsa208sha256_str(hashed_password_address, password_address, password_length, 0, opsLimit, 0, memLimit) | 0) === 0) { var ret = libsodium.Pointer_stringify(hashed_password_address); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_pwhash_scryptsalsa208sha256_str_verify(hashed_password, password, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: hashed_password (string) hashed_password = from_string(hashed_password + "\0"); var hashed_password_address = _to_allocated_buf_address(hashed_password), hashed_password_length = hashed_password.length - 1; address_pool.push(hashed_password_address); // ---------- input: password (unsized_buf) password = _any_to_Uint8Array(address_pool, password, "password"); var password_address = _to_allocated_buf_address(password), password_length = password.length; address_pool.push(password_address); var result = libsodium._crypto_pwhash_scryptsalsa208sha256_str_verify(hashed_password_address, password_address, password_length, 0) | 0; var ret = (result === 0); _free_all(address_pool); return ret; } function crypto_scalarmult(privateKey, publicKey, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: privateKey (buf) privateKey = _any_to_Uint8Array(address_pool, privateKey, "privateKey"); var privateKey_address, privateKey_length = (libsodium._crypto_scalarmult_scalarbytes()) | 0; if (privateKey.length !== privateKey_length) { _free_and_throw_type_error(address_pool, "invalid privateKey length"); } privateKey_address = _to_allocated_buf_address(privateKey); address_pool.push(privateKey_address); // ---------- input: publicKey (buf) publicKey = _any_to_Uint8Array(address_pool, publicKey, "publicKey"); var publicKey_address, publicKey_length = (libsodium._crypto_scalarmult_scalarbytes()) | 0; if (publicKey.length !== publicKey_length) { _free_and_throw_type_error(address_pool, "invalid publicKey length"); } publicKey_address = _to_allocated_buf_address(publicKey); address_pool.push(publicKey_address); // ---------- output sharedSecret (buf) var sharedSecret_length = (libsodium._crypto_scalarmult_bytes()) | 0, sharedSecret = new AllocatedBuf(sharedSecret_length), sharedSecret_address = sharedSecret.address; address_pool.push(sharedSecret_address); if ((libsodium._crypto_scalarmult(sharedSecret_address, privateKey_address, publicKey_address) | 0) === 0) { var ret = _format_output(sharedSecret, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_scalarmult_base(privateKey, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: privateKey (buf) privateKey = _any_to_Uint8Array(address_pool, privateKey, "privateKey"); var privateKey_address, privateKey_length = (libsodium._crypto_scalarmult_scalarbytes()) | 0; if (privateKey.length !== privateKey_length) { _free_and_throw_type_error(address_pool, "invalid privateKey length"); } privateKey_address = _to_allocated_buf_address(privateKey); address_pool.push(privateKey_address); // ---------- output publicKey (buf) var publicKey_length = (libsodium._crypto_scalarmult_scalarbytes()) | 0, publicKey = new AllocatedBuf(publicKey_length), publicKey_address = publicKey.address; address_pool.push(publicKey_address); if ((libsodium._crypto_scalarmult_base(publicKey_address, privateKey_address) | 0) === 0) { var ret = _format_output(publicKey, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_secretbox_detached(message, nonce, key, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: nonce (buf) nonce = _any_to_Uint8Array(address_pool, nonce, "nonce"); var nonce_address, nonce_length = (libsodium._crypto_secretbox_noncebytes()) | 0; if (nonce.length !== nonce_length) { _free_and_throw_type_error(address_pool, "invalid nonce length"); } nonce_address = _to_allocated_buf_address(nonce); address_pool.push(nonce_address); // ---------- input: key (buf) key = _any_to_Uint8Array(address_pool, key, "key"); var key_address, key_length = (libsodium._crypto_secretbox_keybytes()) | 0; if (key.length !== key_length) { _free_and_throw_type_error(address_pool, "invalid key length"); } key_address = _to_allocated_buf_address(key); address_pool.push(key_address); // ---------- output cipher (buf) var cipher_length = (message_length) | 0, cipher = new AllocatedBuf(cipher_length), cipher_address = cipher.address; address_pool.push(cipher_address); // ---------- output mac (buf) var mac_length = (libsodium._crypto_secretbox_macbytes()) | 0, mac = new AllocatedBuf(mac_length), mac_address = mac.address; address_pool.push(mac_address); if ((libsodium._crypto_secretbox_detached(cipher_address, mac_address, message_address, message_length, 0, nonce_address, key_address) | 0) === 0) { var ret = _format_output({mac: mac, cipher: cipher}, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_secretbox_easy(message, nonce, key, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: nonce (buf) nonce = _any_to_Uint8Array(address_pool, nonce, "nonce"); var nonce_address, nonce_length = (libsodium._crypto_secretbox_noncebytes()) | 0; if (nonce.length !== nonce_length) { _free_and_throw_type_error(address_pool, "invalid nonce length"); } nonce_address = _to_allocated_buf_address(nonce); address_pool.push(nonce_address); // ---------- input: key (buf) key = _any_to_Uint8Array(address_pool, key, "key"); var key_address, key_length = (libsodium._crypto_secretbox_keybytes()) | 0; if (key.length !== key_length) { _free_and_throw_type_error(address_pool, "invalid key length"); } key_address = _to_allocated_buf_address(key); address_pool.push(key_address); // ---------- output cipher (buf) var cipher_length = (message_length + libsodium._crypto_secretbox_macbytes()) | 0, cipher = new AllocatedBuf(cipher_length), cipher_address = cipher.address; address_pool.push(cipher_address); if ((libsodium._crypto_secretbox_easy(cipher_address, message_address, message_length, 0, nonce_address, key_address) | 0) === 0) { var ret = _format_output(cipher, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_secretbox_open_detached(ciphertext, mac, nonce, key, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: ciphertext (unsized_buf) ciphertext = _any_to_Uint8Array(address_pool, ciphertext, "ciphertext"); var ciphertext_address = _to_allocated_buf_address(ciphertext), ciphertext_length = ciphertext.length; address_pool.push(ciphertext_address); // ---------- input: mac (buf) mac = _any_to_Uint8Array(address_pool, mac, "mac"); var mac_address, mac_length = (libsodium._crypto_secretbox_macbytes()) | 0; if (mac.length !== mac_length) { _free_and_throw_type_error(address_pool, "invalid mac length"); } mac_address = _to_allocated_buf_address(mac); address_pool.push(mac_address); // ---------- input: nonce (buf) nonce = _any_to_Uint8Array(address_pool, nonce, "nonce"); var nonce_address, nonce_length = (libsodium._crypto_secretbox_noncebytes()) | 0; if (nonce.length !== nonce_length) { _free_and_throw_type_error(address_pool, "invalid nonce length"); } nonce_address = _to_allocated_buf_address(nonce); address_pool.push(nonce_address); // ---------- input: key (buf) key = _any_to_Uint8Array(address_pool, key, "key"); var key_address, key_length = (libsodium._crypto_secretbox_keybytes()) | 0; if (key.length !== key_length) { _free_and_throw_type_error(address_pool, "invalid key length"); } key_address = _to_allocated_buf_address(key); address_pool.push(key_address); // ---------- output message (buf) var message_length = (ciphertext_length) | 0, message = new AllocatedBuf(message_length), message_address = message.address; address_pool.push(message_address); if ((libsodium._crypto_secretbox_open_detached(message_address, ciphertext_address, mac_address, ciphertext_length, 0, nonce_address, key_address) | 0) === 0) { var ret = _format_output(message, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_secretbox_open_easy(ciphertext, nonce, key, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: ciphertext (unsized_buf) ciphertext = _any_to_Uint8Array(address_pool, ciphertext, "ciphertext"); var ciphertext_address = _to_allocated_buf_address(ciphertext), ciphertext_length = ciphertext.length; address_pool.push(ciphertext_address); // ---------- input: nonce (buf) nonce = _any_to_Uint8Array(address_pool, nonce, "nonce"); var nonce_address, nonce_length = (libsodium._crypto_secretbox_noncebytes()) | 0; if (nonce.length !== nonce_length) { _free_and_throw_type_error(address_pool, "invalid nonce length"); } nonce_address = _to_allocated_buf_address(nonce); address_pool.push(nonce_address); // ---------- input: key (buf) key = _any_to_Uint8Array(address_pool, key, "key"); var key_address, key_length = (libsodium._crypto_secretbox_keybytes()) | 0; if (key.length !== key_length) { _free_and_throw_type_error(address_pool, "invalid key length"); } key_address = _to_allocated_buf_address(key); address_pool.push(key_address); // ---------- output message (buf) var message_length = (ciphertext_length - libsodium._crypto_secretbox_macbytes()) | 0, message = new AllocatedBuf(message_length), message_address = message.address; address_pool.push(message_address); if ((libsodium._crypto_secretbox_open_easy(message_address, ciphertext_address, ciphertext_length, 0, nonce_address, key_address) | 0) === 0) { var ret = _format_output(message, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_shorthash(message, key, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: key (buf) key = _any_to_Uint8Array(address_pool, key, "key"); var key_address, key_length = (libsodium._crypto_shorthash_keybytes()) | 0; if (key.length !== key_length) { _free_and_throw_type_error(address_pool, "invalid key length"); } key_address = _to_allocated_buf_address(key); address_pool.push(key_address); // ---------- output hash (buf) var hash_length = (libsodium._crypto_shorthash_bytes()) | 0, hash = new AllocatedBuf(hash_length), hash_address = hash.address; address_pool.push(hash_address); if ((libsodium._crypto_shorthash(hash_address, message_address, message_length, 0, key_address) | 0) === 0) { var ret = _format_output(hash, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_sign(message, privateKey, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: privateKey (buf) privateKey = _any_to_Uint8Array(address_pool, privateKey, "privateKey"); var privateKey_address, privateKey_length = (libsodium._crypto_sign_secretkeybytes()) | 0; if (privateKey.length !== privateKey_length) { _free_and_throw_type_error(address_pool, "invalid privateKey length"); } privateKey_address = _to_allocated_buf_address(privateKey); address_pool.push(privateKey_address); // ---------- output signature (buf) var signature_length = (message.length + libsodium._crypto_sign_bytes()) | 0, signature = new AllocatedBuf(signature_length), signature_address = signature.address; address_pool.push(signature_address); if ((libsodium._crypto_sign(signature_address, null, message_address, message_length, 0, privateKey_address) | 0) === 0) { var ret = _format_output(signature, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_sign_detached(message, privateKey, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: privateKey (buf) privateKey = _any_to_Uint8Array(address_pool, privateKey, "privateKey"); var privateKey_address, privateKey_length = (libsodium._crypto_sign_secretkeybytes()) | 0; if (privateKey.length !== privateKey_length) { _free_and_throw_type_error(address_pool, "invalid privateKey length"); } privateKey_address = _to_allocated_buf_address(privateKey); address_pool.push(privateKey_address); // ---------- output signature (buf) var signature_length = (libsodium._crypto_sign_bytes()) | 0, signature = new AllocatedBuf(signature_length), signature_address = signature.address; address_pool.push(signature_address); if ((libsodium._crypto_sign_detached(signature_address, null, message_address, message_length, 0, privateKey_address) | 0) === 0) { var ret = _format_output(signature, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_sign_ed25519_pk_to_curve25519(edPk, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: edPk (buf) edPk = _any_to_Uint8Array(address_pool, edPk, "edPk"); var edPk_address, edPk_length = (libsodium._crypto_sign_publickeybytes()) | 0; if (edPk.length !== edPk_length) { _free_and_throw_type_error(address_pool, "invalid edPk length"); } edPk_address = _to_allocated_buf_address(edPk); address_pool.push(edPk_address); // ---------- output cPk (buf) var cPk_length = (libsodium._crypto_scalarmult_scalarbytes()) | 0, cPk = new AllocatedBuf(cPk_length), cPk_address = cPk.address; address_pool.push(cPk_address); if ((libsodium._crypto_sign_ed25519_pk_to_curve25519(cPk_address, edPk_address) | 0) === 0) { var ret = _format_output(cPk, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_sign_ed25519_sk_to_curve25519(edSk, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: edSk (buf) edSk = _any_to_Uint8Array(address_pool, edSk, "edSk"); var edSk_address, edSk_length = (libsodium._crypto_sign_secretkeybytes()) | 0; if (edSk.length !== edSk_length) { _free_and_throw_type_error(address_pool, "invalid edSk length"); } edSk_address = _to_allocated_buf_address(edSk); address_pool.push(edSk_address); // ---------- output cSk (buf) var cSk_length = (libsodium._crypto_scalarmult_scalarbytes()) | 0, cSk = new AllocatedBuf(cSk_length), cSk_address = cSk.address; address_pool.push(cSk_address); if ((libsodium._crypto_sign_ed25519_sk_to_curve25519(cSk_address, edSk_address) | 0) === 0) { var ret = _format_output(cSk, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_sign_ed25519_sk_to_pk(privateKey, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: privateKey (buf) privateKey = _any_to_Uint8Array(address_pool, privateKey, "privateKey"); var privateKey_address, privateKey_length = (libsodium._crypto_sign_secretkeybytes()) | 0; if (privateKey.length !== privateKey_length) { _free_and_throw_type_error(address_pool, "invalid privateKey length"); } privateKey_address = _to_allocated_buf_address(privateKey); address_pool.push(privateKey_address); // ---------- output publicKey (buf) var publicKey_length = (libsodium._crypto_sign_publickeybytes()) | 0, publicKey = new AllocatedBuf(publicKey_length), publicKey_address = publicKey.address; address_pool.push(publicKey_address); if ((libsodium._crypto_sign_ed25519_sk_to_pk(publicKey_address, privateKey_address) | 0) === 0) { var ret = _format_output(publicKey, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_sign_ed25519_sk_to_seed(privateKey, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: privateKey (buf) privateKey = _any_to_Uint8Array(address_pool, privateKey, "privateKey"); var privateKey_address, privateKey_length = (libsodium._crypto_sign_secretkeybytes()) | 0; if (privateKey.length !== privateKey_length) { _free_and_throw_type_error(address_pool, "invalid privateKey length"); } privateKey_address = _to_allocated_buf_address(privateKey); address_pool.push(privateKey_address); // ---------- output seed (buf) var seed_length = (libsodium._crypto_sign_seedbytes()) | 0, seed = new AllocatedBuf(seed_length), seed_address = seed.address; address_pool.push(seed_address); if ((libsodium._crypto_sign_ed25519_sk_to_seed(seed_address, privateKey_address) | 0) === 0) { var ret = _format_output(seed, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_sign_keypair(outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- output publicKey (buf) var publicKey_length = (libsodium._crypto_sign_publickeybytes()) | 0, publicKey = new AllocatedBuf(publicKey_length), publicKey_address = publicKey.address; address_pool.push(publicKey_address); // ---------- output privateKey (buf) var privateKey_length = (libsodium._crypto_sign_secretkeybytes()) | 0, privateKey = new AllocatedBuf(privateKey_length), privateKey_address = privateKey.address; address_pool.push(privateKey_address); if ((libsodium._crypto_sign_keypair(publicKey_address, privateKey_address) | 0) === 0) { var ret = _format_output({publicKey: publicKey, privateKey: privateKey, keyType: 'ed25519'}, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_sign_open(signedMessage, publicKey, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: signedMessage (unsized_buf) signedMessage = _any_to_Uint8Array(address_pool, signedMessage, "signedMessage"); var signedMessage_address = _to_allocated_buf_address(signedMessage), signedMessage_length = signedMessage.length; address_pool.push(signedMessage_address); // ---------- input: publicKey (buf) publicKey = _any_to_Uint8Array(address_pool, publicKey, "publicKey"); var publicKey_address, publicKey_length = (libsodium._crypto_sign_publickeybytes()) | 0; if (publicKey.length !== publicKey_length) { _free_and_throw_type_error(address_pool, "invalid publicKey length"); } publicKey_address = _to_allocated_buf_address(publicKey); address_pool.push(publicKey_address); // ---------- output message (buf) var message_length = (signedMessage_length - libsodium._crypto_sign_bytes()) | 0, message = new AllocatedBuf(message_length), message_address = message.address; address_pool.push(message_address); if ((libsodium._crypto_sign_open(message_address, null, signedMessage_address, signedMessage_length, 0, publicKey_address) | 0) === 0) { var ret = _format_output(message, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_sign_seed_keypair(seed, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: seed (buf) seed = _any_to_Uint8Array(address_pool, seed, "seed"); var seed_address, seed_length = (libsodium._crypto_sign_seedbytes()) | 0; if (seed.length !== seed_length) { _free_and_throw_type_error(address_pool, "invalid seed length"); } seed_address = _to_allocated_buf_address(seed); address_pool.push(seed_address); // ---------- output publicKey (buf) var publicKey_length = (libsodium._crypto_sign_publickeybytes()) | 0, publicKey = new AllocatedBuf(publicKey_length), publicKey_address = publicKey.address; address_pool.push(publicKey_address); // ---------- output privateKey (buf) var privateKey_length = (libsodium._crypto_sign_secretkeybytes()) | 0, privateKey = new AllocatedBuf(privateKey_length), privateKey_address = privateKey.address; address_pool.push(privateKey_address); if ((libsodium._crypto_sign_seed_keypair(publicKey_address, privateKey_address, seed_address) | 0) === 0) { var ret = _format_output({publicKey: publicKey, privateKey: privateKey, keyType: "ed25519"}, outputFormat); _free_all(address_pool); return ret; } _free_and_throw_error(address_pool); } function crypto_sign_verify_detached(signature, message, publicKey) { var address_pool = []; // ---------- input: signature (buf) signature = _any_to_Uint8Array(address_pool, signature, "signature"); var signature_address, signature_length = (libsodium._crypto_sign_bytes()) | 0; if (signature.length !== signature_length) { _free_and_throw_type_error(address_pool, "invalid signature length"); } signature_address = _to_allocated_buf_address(signature); address_pool.push(signature_address); // ---------- input: message (unsized_buf) message = _any_to_Uint8Array(address_pool, message, "message"); var message_address = _to_allocated_buf_address(message), message_length = message.length; address_pool.push(message_address); // ---------- input: publicKey (buf) publicKey = _any_to_Uint8Array(address_pool, publicKey, "publicKey"); var publicKey_address, publicKey_length = (libsodium._crypto_sign_publickeybytes()) | 0; if (publicKey.length !== publicKey_length) { _free_and_throw_type_error(address_pool, "invalid publicKey length"); } publicKey_address = _to_allocated_buf_address(publicKey); address_pool.push(publicKey_address); var verificationResult = libsodium._crypto_sign_verify_detached(signature_address, message_address, message_length, 0, publicKey_address) | 0; var ret = (verificationResult === 0); _free_all(address_pool); return ret; } function randombytes_buf(length, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: length (uint) _require_defined(address_pool, length, "length"); if (!(typeof length === "number" && (length | 0) === length) && (length | 0) > 0) { _free_and_throw_type_error(address_pool, "length must be an unsigned integer"); } // ---------- output output (buf) var output_length = (length) | 0, output = new AllocatedBuf(output_length), output_address = output.address; address_pool.push(output_address); libsodium._randombytes_buf(output_address, length); var ret = (_format_output(output, outputFormat)); _free_all(address_pool); return ret; } function randombytes_close(outputFormat) { var address_pool = []; _check_output_format(outputFormat); libsodium._randombytes_close(); } function randombytes_random(outputFormat) { var address_pool = []; _check_output_format(outputFormat); var random_value = libsodium._randombytes_random() >>> 0; var ret = (random_value); _free_all(address_pool); return ret; } function randombytes_set_implementation(implementation, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: implementation (randombytes_implementation) var implementation_address = libsodium._malloc(6 * 4); for (var i = 0; i < 6; i++) { libsodium.setValue(implementation_address + i * 4, libsodium.Runtime.addFunction(implementation [["implementation_name", "random", "stir", "uniform", "buf", "close"][i]]), "i32"); } if ((libsodium._randombytes_set_implementation(implementation_address) | 0) === 0) { _free_all(address_pool); return; } _free_and_throw_error(address_pool); } function randombytes_stir(outputFormat) { var address_pool = []; _check_output_format(outputFormat); libsodium._randombytes_stir(); } function randombytes_uniform(upper_bound, outputFormat) { var address_pool = []; _check_output_format(outputFormat); // ---------- input: upper_bound (uint) _require_defined(address_pool, upper_bound, "upper_bound"); if (!(typeof upper_bound === "number" && (upper_bound | 0) === upper_bound) && (upper_bound | 0) > 0) { _free_and_throw_type_error(address_pool, "upper_bound must be an unsigned integer"); } var random_value = libsodium._randombytes_uniform(upper_bound) >>> 0; var ret = (random_value); _free_all(address_pool); return ret; } function sodium_version_string() { var address_pool = []; var version = libsodium._sodium_version_string(); var ret = (libsodium.Pointer_stringify(version)); _free_all(address_pool); return ret; } exports.compare = compare; exports.from_base64 = from_base64; exports.from_hex = from_hex; exports.from_string = from_string; exports.increment = increment; exports.libsodium = libsodium; exports.memcmp = memcmp; exports.memzero = memzero; exports.output_formats = output_formats; exports.symbols = symbols; exports.to_base64 = to_base64; exports.to_hex = to_hex; exports.to_string = to_string; var exported_functions = ["crypto_aead_chacha20poly1305_decrypt", "crypto_aead_chacha20poly1305_encrypt", "crypto_aead_chacha20poly1305_ietf_decrypt", "crypto_aead_chacha20poly1305_ietf_encrypt", "crypto_auth", "crypto_auth_hmacsha256", "crypto_auth_hmacsha256_verify", "crypto_auth_hmacsha512", "crypto_auth_hmacsha512_verify", "crypto_auth_verify", "crypto_box_beforenm", "crypto_box_detached", "crypto_box_easy", "crypto_box_easy_afternm", "crypto_box_keypair", "crypto_box_open_detached", "crypto_box_open_easy", "crypto_box_open_easy_afternm", "crypto_box_seal", "crypto_box_seal_open", "crypto_box_seed_keypair", "crypto_generichash", "crypto_generichash_final", "crypto_generichash_init", "crypto_generichash_update", "crypto_hash", "crypto_hash_sha256", "crypto_hash_sha512", "crypto_onetimeauth", "crypto_onetimeauth_final", "crypto_onetimeauth_init", "crypto_onetimeauth_update", "crypto_onetimeauth_verify", "crypto_pwhash_scryptsalsa208sha256", "crypto_pwhash_scryptsalsa208sha256_ll", "crypto_pwhash_scryptsalsa208sha256_str", "crypto_pwhash_scryptsalsa208sha256_str_verify", "crypto_scalarmult", "crypto_scalarmult_base", "crypto_secretbox_detached", "crypto_secretbox_easy", "crypto_secretbox_open_detached", "crypto_secretbox_open_easy", "crypto_shorthash", "crypto_sign", "crypto_sign_detached", "crypto_sign_ed25519_pk_to_curve25519", "crypto_sign_ed25519_sk_to_curve25519", "crypto_sign_ed25519_sk_to_pk", "crypto_sign_ed25519_sk_to_seed", "crypto_sign_keypair", "crypto_sign_open", "crypto_sign_seed_keypair", "crypto_sign_verify_detached", "randombytes_buf", "randombytes_close", "randombytes_random", "randombytes_set_implementation", "randombytes_stir", "randombytes_uniform", "sodium_version_string"], functions = [crypto_aead_chacha20poly1305_decrypt, crypto_aead_chacha20poly1305_encrypt, crypto_aead_chacha20poly1305_ietf_decrypt, crypto_aead_chacha20poly1305_ietf_encrypt, crypto_auth, crypto_auth_hmacsha256, crypto_auth_hmacsha256_verify, crypto_auth_hmacsha512, crypto_auth_hmacsha512_verify, crypto_auth_verify, crypto_box_beforenm, crypto_box_detached, crypto_box_easy, crypto_box_easy_afternm, crypto_box_keypair, crypto_box_open_detached, crypto_box_open_easy, crypto_box_open_easy_afternm, crypto_box_seal, crypto_box_seal_open, crypto_box_seed_keypair, crypto_generichash, crypto_generichash_final, crypto_generichash_init, crypto_generichash_update, crypto_hash, crypto_hash_sha256, crypto_hash_sha512, crypto_onetimeauth, crypto_onetimeauth_final, crypto_onetimeauth_init, crypto_onetimeauth_update, crypto_onetimeauth_verify, crypto_pwhash_scryptsalsa208sha256, crypto_pwhash_scryptsalsa208sha256_ll, crypto_pwhash_scryptsalsa208sha256_str, crypto_pwhash_scryptsalsa208sha256_str_verify, crypto_scalarmult, crypto_scalarmult_base, crypto_secretbox_detached, crypto_secretbox_easy, crypto_secretbox_open_detached, crypto_secretbox_open_easy, crypto_shorthash, crypto_sign, crypto_sign_detached, crypto_sign_ed25519_pk_to_curve25519, crypto_sign_ed25519_sk_to_curve25519, crypto_sign_ed25519_sk_to_pk, crypto_sign_ed25519_sk_to_seed, crypto_sign_keypair, crypto_sign_open, crypto_sign_seed_keypair, crypto_sign_verify_detached, randombytes_buf, randombytes_close, randombytes_random, randombytes_set_implementation, randombytes_stir, randombytes_uniform, sodium_version_string]; for (var i = 0; i < functions.length; i++) { if (typeof libsodium["_" + exported_functions[i]] === "function") { exports[exported_functions[i]] = functions[i]; } } var constants = ["SODIUM_LIBRARY_VERSION_MAJOR", "SODIUM_LIBRARY_VERSION_MINOR", "crypto_aead_chacha20poly1305_ABYTES", "crypto_aead_chacha20poly1305_KEYBYTES", "crypto_aead_chacha20poly1305_NPUBBYTES", "crypto_aead_chacha20poly1305_NSECBYTES", "crypto_aead_chacha20poly1305_ietf_NPUBBYTES", "crypto_auth_BYTES", "crypto_auth_KEYBYTES", "crypto_auth_hmacsha256_BYTES", "crypto_auth_hmacsha256_KEYBYTES", "crypto_auth_hmacsha512_BYTES", "crypto_auth_hmacsha512_KEYBYTES", "crypto_box_BEFORENMBYTES", "crypto_box_MACBYTES", "crypto_box_NONCEBYTES", "crypto_box_PUBLICKEYBYTES", "crypto_box_SEALBYTES", "crypto_box_SECRETKEYBYTES", "crypto_box_SEEDBYTES", "crypto_generichash_BYTES", "crypto_generichash_BYTES_MAX", "crypto_generichash_BYTES_MIN", "crypto_generichash_KEYBYTES", "crypto_generichash_KEYBYTES_MAX", "crypto_generichash_KEYBYTES_MIN", "crypto_hash_BYTES", "crypto_onetimeauth_BYTES", "crypto_onetimeauth_KEYBYTES", "crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE", "crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE", "crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE", "crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE", "crypto_pwhash_scryptsalsa208sha256_SALTBYTES", "crypto_pwhash_scryptsalsa208sha256_STRBYTES", "crypto_pwhash_scryptsalsa208sha256_STR_VERIFY", "crypto_scalarmult_BYTES", "crypto_scalarmult_SCALARBYTES", "crypto_secretbox_KEYBYTES", "crypto_secretbox_MACBYTES", "crypto_secretbox_NONCEBYTES", "crypto_shorthash_BYTES", "crypto_shorthash_KEYBYTES", "crypto_sign_BYTES", "crypto_sign_PUBLICKEYBYTES", "crypto_sign_SECRETKEYBYTES", "crypto_sign_SEEDBYTES"]; for (var i = 0; i < constants.length; i++) { var raw = libsodium["_" + constants[i].toLowerCase()]; if (typeof raw === "function") exports[constants[i]] = raw()|0; } var constants_str = ["SODIUM_VERSION_STRING", "crypto_pwhash_scryptsalsa208sha256_STRPREFIX"]; for (var i = 0; i < constants_str.length; i++) { var raw = libsodium["_" + constants_str[i].toLowerCase()]; if (typeof raw === "function") exports[constants_str[i]] = libsodium.Pointer_stringify(raw()); } return exports; })); }).call(this,require('_process')) },{"_process":108,"libsodium":370}],370:[function(require,module,exports){ (function (process,Buffer,__dirname){ (function (root, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') { factory(exports); } else { factory(root.libsodium = {}); } })(this, function (exports) { "use strict"; var Module = exports; Object.defineProperty(exports, '__esModule', { value: true }); var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](filename);if(!ret&&filename!=nodePath["resolve"](filename)){filename=path.join(__dirname,"..","src",filename);ret=nodeFS["readFileSync"](filename)}if(ret&&!binary)ret=ret.toString();return ret};Module["readBinary"]=function readBinary(filename){var ret=Module["read"](filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};Module["load"]=function load(f){globalEval(read(f))};if(!Module["thisProgram"]){if(process["argv"].length>1){Module["thisProgram"]=process["argv"][1].replace(/\\/g,"/")}else{Module["thisProgram"]="unknown-program"}}Module["arguments"]=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",(function(ex){if(!(ex instanceof ExitStatus)){throw ex}}));Module["inspect"]=(function(){return"[Emscripten Module object]"})}else if(ENVIRONMENT_IS_SHELL){if(!Module["print"])Module["print"]=print;if(typeof printErr!="undefined")Module["printErr"]=printErr;if(typeof read!="undefined"){Module["read"]=read}else{Module["read"]=function read(){throw"no read() available (jsc?)"}}Module["readBinary"]=function readBinary(f){if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}var 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}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){Module["read"]=function read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(typeof arguments!="undefined"){Module["arguments"]=arguments}if(typeof console!=="undefined"){if(!Module["print"])Module["print"]=function print(x){console.log(x)};if(!Module["printErr"])Module["printErr"]=function printErr(x){console.log(x)}}else{var TRY_USE_DUMP=false;if(!Module["print"])Module["print"]=TRY_USE_DUMP&&typeof dump!=="undefined"?(function(x){dump(x)}):(function(x){})}if(ENVIRONMENT_IS_WORKER){Module["load"]=importScripts}if(typeof Module["setWindowTitle"]==="undefined"){Module["setWindowTitle"]=(function(title){document.title=title})}}else{throw"Unknown runtime environment. Where are we?"}function globalEval(x){throw"NO_DYNAMIC_EXECUTION was set, cannot eval"}if(!Module["load"]&&Module["read"]){Module["load"]=function load(f){globalEval(Module["read"](f))}}if(!Module["print"]){Module["print"]=(function(){})}if(!Module["printErr"]){Module["printErr"]=Module["print"]}if(!Module["arguments"]){Module["arguments"]=[]}if(!Module["thisProgram"]){Module["thisProgram"]="./this.program"}Module.print=Module["print"];Module.printErr=Module["printErr"];Module["preRun"]=[];Module["postRun"]=[];for(var key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}var Runtime={setTempRet0:(function(value){tempRet0=value}),getTempRet0:(function(){return tempRet0}),stackSave:(function(){return STACKTOP}),stackRestore:(function(stackTop){STACKTOP=stackTop}),getNativeTypeSize:(function(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 Runtime.QUANTUM_SIZE}else if(type[0]==="i"){var bits=parseInt(type.substr(1));assert(bits%8===0);return bits/8}else{return 0}}}}),getNativeFieldSize:(function(type){return Math.max(Runtime.getNativeTypeSize(type),Runtime.QUANTUM_SIZE)}),STACK_ALIGN:16,prepVararg:(function(ptr,type){if(type==="double"||type==="i64"){if(ptr&7){assert((ptr&7)===4);ptr+=4}}else{assert((ptr&3)===0)}return ptr}),getAlignSize:(function(type,size,vararg){if(!vararg&&(type=="i64"||type=="double"))return 8;if(!type)return Math.min(size,8);return Math.min(size||(type?Runtime.getNativeFieldSize(type):0),Runtime.QUANTUM_SIZE)}),dynCall:(function(sig,ptr,args){if(args&&args.length){if(!args.splice)args=Array.prototype.slice.call(args);args.splice(0,0,ptr);return Module["dynCall_"+sig].apply(null,args)}else{return Module["dynCall_"+sig].call(null,ptr)}}),functionPointers:[null,null,null,null,null,null,null,null],addFunction:(function(func){for(var i=0;i=TOTAL_MEMORY){var success=enlargeMemory();if(!success){DYNAMICTOP=ret;return 0}}return ret}),alignMemory:(function(size,quantum){var ret=size=Math.ceil(size/(quantum?quantum:16))*(quantum?quantum:16);return ret}),makeBigInt:(function(low,high,unsigned){var ret=unsigned?+(low>>>0)+ +(high>>>0)*+4294967296:+(low>>>0)+ +(high|0)*+4294967296;return ret}),GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module["Runtime"]=Runtime;var __THREW__=0;var ABORT=false;var EXITSTATUS=0;var undef=0;var tempValue,tempInt,tempBigInt,tempInt2,tempBigInt2,tempPair,tempBigIntI,tempBigIntR,tempBigIntS,tempBigIntP,tempBigIntD,tempDouble,tempFloat;var tempI64,tempI64b;var tempRet0,tempRet1,tempRet2,tempRet3,tempRet4,tempRet5,tempRet6,tempRet7,tempRet8,tempRet9;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}var globalScope=this;function getCFunc(ident){var func=Module["_"+ident];if(!func){abort("NO_DYNAMIC_EXECUTION was set, cannot eval - ccall/cwrap are not functional")}assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)");return func}var cwrap,ccall;((function(){var JSfuncs={"stackSave":(function(){Runtime.stackSave()}),"stackRestore":(function(){Runtime.stackRestore()}),"arrayToC":(function(arr){var ret=Runtime.stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}),"stringToC":(function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){ret=Runtime.stackAlloc((str.length<<2)+1);writeStringToMemory(str,ret)}return ret})};var toC={"string":JSfuncs["stringToC"],"array":JSfuncs["arrayToC"]};ccall=function ccallFunc(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)}}Module["setValue"]=setValue;function getValue(ptr,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":return HEAP8[ptr>>0];case"i8":return HEAP8[ptr>>0];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":return HEAP32[ptr>>2];case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];default:abort("invalid type for setValue: "+type)}return null}Module["getValue"]=getValue;var ALLOC_NORMAL=0;var ALLOC_STACK=1;var ALLOC_STATIC=2;var ALLOC_DYNAMIC=3;var ALLOC_NONE=4;Module["ALLOC_NORMAL"]=ALLOC_NORMAL;Module["ALLOC_STACK"]=ALLOC_STACK;Module["ALLOC_STATIC"]=ALLOC_STATIC;Module["ALLOC_DYNAMIC"]=ALLOC_DYNAMIC;Module["ALLOC_NONE"]=ALLOC_NONE;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=[_malloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][allocator===undefined?ALLOC_STATIC:allocator](Math.max(size,singleType?1:types.length))}if(zeroinit){var ptr=ret,stop;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 Module["UTF8ToString"](ptr)}Module["Pointer_stringify"]=Pointer_stringify;function AsciiToString(ptr){var str="";while(1){var ch=HEAP8[ptr++>>0];if(!ch)return str;str+=String.fromCharCode(ch)}}Module["AsciiToString"]=AsciiToString;function stringToAscii(str,outPtr){return writeAsciiToMemory(str,outPtr,false)}Module["stringToAscii"]=stringToAscii;function UTF8ArrayToString(u8Array,idx){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)}}}Module["UTF8ArrayToString"]=UTF8ArrayToString;function UTF8ToString(ptr){return UTF8ArrayToString(HEAPU8,ptr)}Module["UTF8ToString"]=UTF8ToString;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}Module["stringToUTF8Array"]=stringToUTF8Array;function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}Module["stringToUTF8"]=stringToUTF8;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}Module["lengthBytesUTF8"]=lengthBytesUTF8;function UTF16ToString(ptr){var i=0;var str="";while(1){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)return str;++i;str+=String.fromCharCode(codeUnit)}}Module["UTF16ToString"]=UTF16ToString;function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}Module["stringToUTF16"]=stringToUTF16;function lengthBytesUTF16(str){return str.length*2}Module["lengthBytesUTF16"]=lengthBytesUTF16;function UTF32ToString(ptr){var i=0;var str="";while(1){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)return str;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}}Module["UTF32ToString"]=UTF32ToString;function stringToUTF32(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}Module["stringToUTF32"]=stringToUTF32;function lengthBytesUTF32(str){var len=0;for(var i=0;i=55296&&codeUnit<=57343)++i;len+=4}return len}Module["lengthBytesUTF32"]=lengthBytesUTF32;function demangle(func){var hasLibcxxabi=!!Module["___cxa_demangle"];if(hasLibcxxabi){try{var buf=_malloc(func.length);writeStringToMemory(func.substr(1),buf);var status=_malloc(4);var ret=Module["___cxa_demangle"](buf,0,0,status);if(getValue(status,"i32")===0&&ret){return Pointer_stringify(ret)}}catch(e){}finally{if(buf)_free(buf);if(status)_free(status);if(ret)_free(ret)}}var i=3;var basicTypes={"v":"void","b":"bool","c":"char","s":"short","i":"int","l":"long","f":"float","d":"double","w":"wchar_t","a":"signed char","h":"unsigned char","t":"unsigned short","j":"unsigned int","m":"unsigned long","x":"long long","y":"unsigned long long","z":"..."};var subs=[];var first=true;function dump(x){if(x)Module.print(x);Module.print(func);var pre="";for(var a=0;a"}else{ret=name}paramLoop:while(i0){var c=func[i++];if(c in basicTypes){list.push(basicTypes[c])}else{switch(c){case"P":list.push(parse(true,1,true)[0]+"*");break;case"R":list.push(parse(true,1,true)[0]+"&");break;case"L":{i++;var end=func.indexOf("E",i);var size=end-i;list.push(func.substr(i,size));i+=size+2;break};case"A":{var size=parseInt(func.substr(i));i+=size.toString().length;if(func[i]!=="_")throw"?";i++;list.push(parse(true,1,true)[0]+" ["+size+"]");break};case"E":break paramLoop;default:ret+="?"+c;break paramLoop}}}if(!allowVoid&&list.length===1&&list[0]==="void")list=[];if(rawList){if(ret){list.push(ret+"?")}return list}else{return ret+flushList()}}var parsed=func;try{if(func=="Object._main"||func=="_main"){return"main()"}if(typeof func==="number")func=Pointer_stringify(func);if(func[0]!=="_")return func;if(func[1]!=="_")return func;if(func[2]!=="Z")return func;switch(func[3]){case"n":return"operator new()";case"d":return"operator delete()"}parsed=parse()}catch(e){parsed+="?"}if(parsed.indexOf("?")>=0&&!hasLibcxxabi){Runtime.warnOnce("warning: a problem occurred in builtin C++ name demangling; build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling")}return parsed}function demangleAll(text){return text.replace(/__Z[\w\d_]+/g,(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(){return demangleAll(jsStackTrace())}Module["stackTrace"]=stackTrace;var PAGE_SIZE=4096;function alignMemoryPage(x){if(x%4096>0){x+=4096-x%4096}return x}var HEAP;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;var STATIC_BASE=0,STATICTOP=0,staticSealed=false;var STACK_BASE=0,STACKTOP=0,STACK_MAX=0;var DYNAMIC_BASE=0,DYNAMICTOP=0;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 adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or 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"]||33554432;var totalMemory=64*1024;while(totalMemory0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Runtime.dynCall("v",func)}else{Runtime.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;var runtimeExited=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__);runtimeExited=true}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)}Module["addOnPreRun"]=addOnPreRun;function addOnInit(cb){__ATINIT__.unshift(cb)}Module["addOnInit"]=addOnInit;function addOnPreMain(cb){__ATMAIN__.unshift(cb)}Module["addOnPreMain"]=addOnPreMain;function addOnExit(cb){__ATEXIT__.unshift(cb)}Module["addOnExit"]=addOnExit;function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}Module["addOnPostRun"]=addOnPostRun;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}Module["intArrayFromString"]=intArrayFromString;function intArrayToString(array){var ret=[];for(var i=0;i255){chr&=255}ret.push(String.fromCharCode(chr))}return ret.join("")}Module["intArrayToString"]=intArrayToString;function writeStringToMemory(string,buffer,dontAddNull){var array=intArrayFromString(string,dontAddNull);var i=0;while(i>0]=chr;i=i+1}}Module["writeStringToMemory"]=writeStringToMemory;function writeArrayToMemory(array,buffer){for(var i=0;i>0]=array[i]}}Module["writeArrayToMemory"]=writeArrayToMemory;function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}Module["writeAsciiToMemory"]=writeAsciiToMemory;function unSign(value,bits,ignore){if(value>=0){return value}return bits<=32?2*Math.abs(1<=half&&(bits<=32||value>half)){value=-2*half+value}return value}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"];var Math_abs=Math.abs;var Math_cos=Math.cos;var Math_sin=Math.sin;var Math_tan=Math.tan;var Math_acos=Math.acos;var Math_asin=Math.asin;var Math_atan=Math.atan;var Math_atan2=Math.atan2;var Math_exp=Math.exp;var Math_log=Math.log;var Math_sqrt=Math.sqrt;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_pow=Math.pow;var Math_imul=Math.imul;var Math_fround=Math.fround;var Math_min=Math.min;var Math_clz32=Math.clz32;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}Module["addRunDependency"]=addRunDependency;function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["removeRunDependency"]=removeRunDependency;Module["preloadedImages"]={};Module["preloadedAudios"]={};var memoryInitializer=null;var ASM_CONSTS=[(function(){{return Module.getRandomValue()}}),(function(){{if(Module.getRandomValue===undefined){try{var window_="object"===typeof window?window:self,crypto_=typeof window_.crypto!=="undefined"?window_.crypto:window_.msCrypto,randomValuesStandard=(function(){var buf=new Uint32Array(1);crypto_.getRandomValues(buf);return buf[0]>>>0});randomValuesStandard();Module.getRandomValue=randomValuesStandard}catch(e){try{var crypto=require("crypto"),randomValueNodeJS=(function(){var buf=crypto.randomBytes(4);return(buf[0]<<24|buf[1]<<16|buf[2]<<8|buf[3])>>>0});randomValueNodeJS();Module.getRandomValue=randomValueNodeJS}catch(e){throw"No secure random number generator found"}}}}})];function _emscripten_asm_const_0(code){return ASM_CONSTS[code]()}STATIC_BASE=8;STATICTOP=STATIC_BASE+34944;__ATINIT__.push();allocate([8,201,188,243,103,230,9,106,59,167,202,132,133,174,103,187,43,248,148,254,114,243,110,60,241,54,29,95,58,245,79,165,209,130,230,173,127,82,14,81,31,108,62,43,140,104,5,155,107,189,65,251,171,217,131,31,121,33,126,19,25,205,224,91,103,230,9,106,133,174,103,187,114,243,110,60,58,245,79,165,127,82,14,81,140,104,5,155,171,217,131,31,25,205,224,91,133,59,140,1,189,241,36,255,248,37,195,1,96,220,55,0,183,76,62,255,195,66,61,0,50,76,164,1,225,164,76,255,76,61,163,255,117,62,31,0,81,145,64,255,118,65,14,0,162,115,214,255,6,138,46,0,124,230,244,255,10,138,143,0,52,26,194,0,184,244,76,0,129,143,41,1,190,244,19,255,123,170,122,255,98,129,68,0,121,213,147,0,86,101,30,255,161,103,155,0,140,89,67,255,239,229,190,1,67,11,181,0,198,240,137,254,238,69,188,255,67,151,238,0,19,42,108,255,229,85,113,1,50,68,135,255,17,106,9,0,50,103,1,255,80,1,168,1,35,152,30,255,16,168,185,1,56,89,232,255,101,210,252,0,41,250,71,0,204,170,79,255,14,46,239,255,80,77,239,0,189,214,75,255,17,141,249,0,38,80,76,255,190,85,117,0,86,228,170,0,156,216,208,1,195,207,164,255,150,66,76,255,175,225,16,255,141,80,98,1,76,219,242,0,198,162,114,0,46,218,152,0,155,43,241,254,155,160,104,255,51,187,165,0,2,17,175,0,66,84,160,1,247,58,30,0,35,65,53,254,69,236,191,0,45,134,245,1,163,123,221,0,32,110,20,255,52,23,165,0,186,214,71,0,233,176,96,0,242,239,54,1,57,89,138,0,83,0,84,255,136,160,100,0,92,142,120,254,104,124,190,0,181,177,62,255,250,41,85,0,152,130,42,1,96,252,246,0,151,151,63,254,239,133,62,0,32,56,156,0,45,167,189,255,142,133,179,1,131,86,211,0,187,179,150,254,250,170,14,255,210,163,78,0,37,52,151,0,99,77,26,0,238,156,213,255,213,192,209,1,73,46,84,0,20,65,41,1,54,206,79,0,201,131,146,254,170,111,24,255,177,33,50,254,171,38,203,255,78,247,116,0,209,221,153,0,133,128,178,1,58,44,25,0,201,39,59,1,189,19,252,0,49,229,210,1,117,187,117,0,181,179,184,1,0,114,219,0,48,94,147,0,245,41,56,0,125,13,204,254,244,173,119,0,44,221,32,254,84,234,20,0,249,160,198,1,236,126,234,255,47,99,168,254,170,226,153,255,102,179,216,0,226,141,122,255,122,66,153,254,182,245,134,0,227,228,25,1,214,57,235,255,216,173,56,255,181,231,210,0,119,128,157,255,129,95,136,255,110,126,51,0,2,169,183,255,7,130,98,254,69,176,94,255,116,4,227,1,217,242,145,255,202,173,31,1,105,1,39,255,46,175,69,0,228,47,58,255,215,224,69,254,207,56,69,255,16,254,139,255,23,207,212,255,202,20,126,255,95,213,96,255,9,176,33,0,200,5,207,255,241,42,128,254,35,33,192,255,248,229,196,1,129,17,120,0,251,103,151,255,7,52,112,255,140,56,66,255,40,226,245,255,217,70,37,254,172,214,9,255,72,67,134,1,146,192,214,255,44,38,112,0,68,184,75,255,206,90,251,0,149,235,141,0,181,170,58,0,116,244,239,0,92,157,2,0,102,173,98,0,233,137,96,1,127,49,203,0,5,155,148,0,23,148,9,255,211,122,12,0,34,134,26,255,219,204,136,0,134,8,41,255,224,83,43,254,85,25,247,0,109,127,0,254,169,136,48,0,238,119,219,255,231,173,213,0,206,18,254,254,8,186,7,255,126,9,7,1,111,42,72,0,111,52,236,254,96,63,141,0,147,191,127,254,205,78,192,255,14,106,237,1,187,219,76,0,175,243,187,254,105,89,173,0,85,25,89,1,162,243,148,0,2,118,209,254,33,158,9,0,139,163,46,255,93,70,40,0,108,42,142,254,111,252,142,255,155,223,144,0,51,229,167,255,73,252,155,255,94,116,12,255,152,160,218,255,156,238,37,255,179,234,207,255,197,0,179,255,154,164,141,0,225,196,104,0,10,35,25,254,209,212,242,255,97,253,222,254,184,101,229,0,222,18,127,1,164,136,135,255,30,207,140,254,146,97,243,0,129,192,26,254,201,84,33,255,111,10,78,255,147,81,178,255,4,4,24,0,161,238,215,255,6,141,33,0,53,215,14,255,41,181,208,255,231,139,157,0,179,203,221,255,255,185,113,0,189,226,172,255,113,66,214,255,202,62,45,255,102,64,8,255,78,174,16,254,133,117,68,255,182,120,89,255,133,114,211,0,189,110,21,255,15,10,106,0,41,192,1,0,152,232,121,255,188,60,160,255,153,113,206,255,0,183,226,254,180,13,72,255,176,160,14,254,211,201,134,255,158,24,143,0,127,105,53,0,96,12,189,0,167,215,251,255,159,76,128,254,106,101,225,255,30,252,4,0,146,12,174,0,89,241,178,254,10,229,166,255,123,221,42,254,30,20,212,0,82,128,3,0,48,209,243,0,119,121,64,255,50,227,156,255,0,110,197,1,103,27,144,0,133,59,140,1,189,241,36,255,248,37,195,1,96,220,55,0,183,76,62,255,195,66,61,0,50,76,164,1,225,164,76,255,76,61,163,255,117,62,31,0,81,145,64,255,118,65,14,0,162,115,214,255,6,138,46,0,124,230,244,255,10,138,143,0,52,26,194,0,184,244,76,0,129,143,41,1,190,244,19,255,123,170,122,255,98,129,68,0,121,213,147,0,86,101,30,255,161,103,155,0,140,89,67,255,239,229,190,1,67,11,181,0,198,240,137,254,238,69,188,255,234,113,60,255,37,255,57,255,69,178,182,254,128,208,179,0,118,26,125,254,3,7,214,255,241,50,77,255,85,203,197,255,211,135,250,255,25,48,100,255,187,213,180,254,17,88,105,0,83,209,158,1,5,115,98,0,4,174,60,254,171,55,110,255,217,181,17,255,20,188,170,0,146,156,102,254,87,214,174,255,114,122,155,1,233,44,170,0,127,8,239,1,214,236,234,0,175,5,219,0,49,106,61,255,6,66,208,255,2,106,110,255,81,234,19,255,215,107,192,255,67,151,238,0,19,42,108,255,229,85,113,1,50,68,135,255,17,106,9,0,50,103,1,255,80,1,168,1,35,152,30,255,16,168,185,1,56,89,232,255,101,210,252,0,41,250,71,0,204,170,79,255,14,46,239,255,80,77,239,0,189,214,75,255,17,141,249,0,38,80,76,255,190,85,117,0,86,228,170,0,156,216,208,1,195,207,164,255,150,66,76,255,175,225,16,255,141,80,98,1,76,219,242,0,198,162,114,0,46,218,152,0,155,43,241,254,155,160,104,255,178,9,252,254,100,110,212,0,14,5,167,0,233,239,163,255,28,151,157,1,101,146,10,255,254,158,70,254,71,249,228,0,88,30,50,0,68,58,160,255,191,24,104,1,129,66,129,255,192,50,85,255,8,179,138,255,38,250,201,0,115,80,160,0,131,230,113,0,125,88,147,0,90,68,199,0,253,76,158,0,28,255,118,0,113,250,254,0,66,75,46,0,230,218,43,0,229,120,186,1,148,68,43,0,136,124,238,1,187,107,197,255,84,53,246,255,51,116,254,255,51,187,165,0,2,17,175,0,66,84,160,1,247,58,30,0,35,65,53,254,69,236,191,0,45,134,245,1,163,123,221,0,32,110,20,255,52,23,165,0,186,214,71,0,233,176,96,0,242,239,54,1,57,89,138,0,83,0,84,255,136,160,100,0,92,142,120,254,104,124,190,0,181,177,62,255,250,41,85,0,152,130,42,1,96,252,246,0,151,151,63,254,239,133,62,0,32,56,156,0,45,167,189,255,142,133,179,1,131,86,211,0,187,179,150,254,250,170,14,255,68,113,21,255,222,186,59,255,66,7,241,1,69,6,72,0,86,156,108,254,55,167,89,0,109,52,219,254,13,176,23,255,196,44,106,255,239,149,71,255,164,140,125,255,159,173,1,0,51,41,231,0,145,62,33,0,138,111,93,1,185,83,69,0,144,115,46,0,97,151,16,255,24,228,26,0,49,217,226,0,113,75,234,254,193,153,12,255,182,48,96,255,14,13,26,0,128,195,249,254,69,193,59,0,132,37,81,254,125,106,60,0,214,240,169,1,164,227,66,0,210,163,78,0,37,52,151,0,99,77,26,0,238,156,213,255,213,192,209,1,73,46,84,0,20,65,41,1,54,206,79,0,201,131,146,254,170,111,24,255,177,33,50,254,171,38,203,255,78,247,116,0,209,221,153,0,133,128,178,1,58,44,25,0,201,39,59,1,189,19,252,0,49,229,210,1,117,187,117,0,181,179,184,1,0,114,219,0,48,94,147,0,245,41,56,0,125,13,204,254,244,173,119,0,44,221,32,254,84,234,20,0,249,160,198,1,236,126,234,255,143,62,221,0,129,89,214,255,55,139,5,254,68,20,191,255,14,204,178,1,35,195,217,0,47,51,206,1,38,246,165,0,206,27,6,254,158,87,36,0,217,52,146,255,125,123,215,255,85,60,31,255,171,13,7,0,218,245,88,254,252,35,60,0,55,214,160,255,133,101,56,0,224,32,19,254,147,64,234,0,26,145,162,1,114,118,125,0,248,252,250,0,101,94,196,255,198,141,226,254,51,42,182,0,135,12,9,254,109,172,210,255,197,236,194,1,241,65,154,0,48,156,47,255,153,67,55,255,218,165,34,254,74,180,179,0,218,66,71,1,88,122,99,0,212,181,219,255,92,42,231,255,239,0,154,0,245,77,183,255,94,81,170,1,18,213,216,0,171,93,71,0,52,94,248,0,18,151,161,254,197,209,66,255,174,244,15,254,162,48,183,0,49,61,240,254,182,93,195,0,199,228,6,1,200,5,17,255,137,45,237,255,108,148,4,0,90,79,237,255,39,63,77,255,53,82,207,1,142,22,118,255,101,232,18,1,92,26,67,0,5,200,88,255,33,168,138,255,149,225,72,0,2,209,27,255,44,245,168,1,220,237,17,255,30,211,105,254,141,238,221,0,128,80,245,254,111,254,14,0,222,95,190,1,223,9,241,0,146,76,212,255,108,205,104,255,63,117,153,0,144,69,48,0,35,228,111,0,192,33,193,255,112,214,190,254,115,152,151,0,23,102,88,0,51,74,248,0,226,199,143,254,204,162,101,255,208,97,189,1,245,104,18,0,230,246,30,255,23,148,69,0,110,88,52,254,226,181,89,255,208,47,90,254,114,161,80,255,33,116,248,0,179,152,87,255,69,144,177,1,88,238,26,255,58,32,113,1,1,77,69,0,59,121,52,255,152,238,83,0,52,8,193,0,231,39,233,255,199,34,138,0,222,68,173,0,91,57,242,254,220,210,127,255,192,7,246,254,151,35,187,0,195,236,165,0,111,93,206,0,212,247,133,1,154,133,209,255,155,231,10,0,64,78,38,0,122,249,100,1,30,19,97,255,62,91,249,1,248,133,77,0,197,63,168,254,116,10,82,0,184,236,113,254,212,203,194,255,61,100,252,254,36,5,202,255,119,91,153,255,129,79,29,0,103,103,171,254,237,215,111,255,216,53,69,0,239,240,23,0,194,149,221,255,38,225,222,0,232,255,180,254,118,82,133,255,57,209,177,1,139,232,133,0,158,176,46,254,194,115,46,0,88,247,229,1,28,103,191,0,221,222,175,254,149,235,44,0,151,228,25,254,218,105,103,0,142,85,210,0,149,129,190,255,213,65,94,254,117,134,224,255,82,198,117,0,157,221,220,0,163,101,36,0,197,114,37,0,104,172,166,254,11,182,0,0,81,72,188,255,97,188,16,255,69,6,10,0,199,147,145,255,8,9,115,1,65,214,175,255,217,173,209,0,80,127,166,0,247,229,4,254,167,183,124,255,90,28,204,254,175,59,240,255,11,41,248,1,108,40,51,255,144,177,195,254,150,250,126,0,138,91,65,1,120,60,222,255,245,193,239,0,29,214,189,255,128,2,25,0,80,154,162,0,77,220,107,1,234,205,74,255,54,166,103,255,116,72,9,0,228,94,47,255,30,200,25,255,35,214,89,255,61,176,140,255,83,226,163,255,75,130,172,0,128,38,17,0,95,137,152,255,215,124,159,1,79,93,0,0,148,82,157,254,195,130,251,255,40,202,76,255,251,126,224,0,157,99,62,254,207,7,225,255,96,68,195,0,140,186,157,255,131,19,231,255,42,128,254,0,52,219,61,254,102,203,72,0,141,7,11,255,186,164,213,0,31,122,119,0,133,242,145,0,208,252,232,255,91,213,182,255,143,4,250,254,249,215,74,0,165,30,111,1,171,9,223,0,229,123,34,1,92,130,26,255,77,155,45,1,195,139,28,255,59,224,78,0,136,17,247,0,108,121,32,0,79,250,189,255,96,227,252,254,38,241,62,0,62,174,125,255,155,111,93,255,10,230,206,1,97,197,40,255,0,49,57,254,65,250,13,0,18,251,150,255,220,109,210,255,5,174,166,254,44,129,189,0,235,35,147,255,37,247,141,255,72,141,4,255,103,107,255,0,247,90,4,0,53,44,42,0,2,30,240,0,4,59,63,0,88,78,36,0,113,167,180,0,190,71,193,255,199,158,164,255,58,8,172,0,77,33,12,0,65,63,3,0,153,77,33,255,172,254,102,1,228,221,4,255,87,30,254,1,146,41,86,255,138,204,239,254,108,141,17,255,187,242,135,0,210,208,127,0,68,45,14,254,73,96,62,0,81,60,24,255,170,6,36,255,3,249,26,0,35,213,109,0,22,129,54,255,21,35,225,255,234,61,56,255,58,217,6,0,143,124,88,0,236,126,66,0,209,38,183,255,34,238,6,255,174,145,102,0,95,22,211,0,196,15,153,254,46,84,232,255,117,34,146,1,231,250,74,255,27,134,100,1,92,187,195,255,170,198,112,0,120,28,42,0,209,70,67,0,29,81,31,0,29,168,100,1,169,173,160,0,107,35,117,0,62,96,59,255,81,12,69,1,135,239,190,255,220,252,18,0,163,220,58,255,137,137,188,255,83,102,109,0,96,6,76,0,234,222,210,255,185,174,205,1,60,158,213,255,13,241,214,0,172,129,140,0,93,104,242,0,192,156,251,0,43,117,30,0,225,81,158,0,127,232,218,0,226,28,203,0,233,27,151,255,117,43,5,255,242,14,47,255,33,20,6,0,137,251,44,254,27,31,245,255,183,214,125,254,40,121,149,0,186,158,213,255,89,8,227,0,69,88,0,254,203,135,225,0,201,174,203,0,147,71,184,0,18,121,41,254,94,5,78,0,224,214,240,254,36,5,180,0,251,135,231,1,163,138,212,0,210,249,116,254,88,129,187,0,19,8,49,254,62,14,144,255,159,76,211,0,214,51,82,0,109,117,228,254,103,223,203,255,75,252,15,1,154,71,220,255,23,13,91,1,141,168,96,255,181,182,133,0,250,51,55,0,234,234,212,254,175,63,158,0,39,240,52,1,158,189,36,255,213,40,85,1,32,180,247,255,19,102,26,1,84,24,97,255,69,21,222,0,148,139,122,255,220,213,235,1,232,203,255,0,121,57,147,0,227,7,154,0,53,22,147,1,72,1,225,0,82,134,48,254,83,60,157,255,145,72,169,0,34,103,239,0,198,233,47,0,116,19,4,255,184,106,9,255,183,129,83,0,36,176,230,1,34,103,72,0,219,162,134,0,245,42,158,0,32,149,96,254,165,44,144,0,202,239,72,254,215,150,5,0,42,66,36,1,132,215,175,0,86,174,86,255,26,197,156,255,49,232,135,254,103,182,82,0,253,128,176,1,153,178,122,0,245,250,10,0,236,24,178,0,137,106,132,0,40,29,41,0,50,30,152,255,124,105,38,0,230,191,75,0,143,43,170,0,44,131,20,255,44,13,23,255,237,255,155,1,159,109,100,255,112,181,24,255,104,220,108,0,55,211,131,0,99,12,213,255,152,151,145,255,238,5,159,0,97,155,8,0,33,108,81,0,1,3,103,0,62,109,34,255,250,155,180,0,32,71,195,255,38,70,145,1,159,95,245,0,69,229,101,1,136,28,240,0,79,224,25,0,78,110,121,255,248,168,124,0,187,128,247,0,2,147,235,254,79,11,132,0,70,58,12,1,181,8,163,255,79,137,133,255,37,170,11,255,141,243,85,255,176,231,215,255,204,150,164,255,239,215,39,255,46,87,156,254,8,163,88,255,172,34,232,0,66,44,102,255,27,54,41,254,236,99,87,255,41,123,169,1,52,114,43,0,117,134,40,0,155,134,26,0,231,207,91,254,35,132,38,255,19,102,125,254,36,227,133,255,118,3,113,255,29,13,124,0,152,96,74,1,88,146,206,255,167,191,220,254,162,18,88,255,182,100,23,0,31,117,52,0,81,46,106,1,12,2,7,0,69,80,201,1,209,246,172,0,12,48,141,1,224,211,88,0,116,226,159,0,122,98,130,0,65,236,234,1,225,226,9,255,207,226,123,1,89,214,59,0,112,135,88,1,90,244,203,255,49,11,38,1,129,108,186,0,89,112,15,1,101,46,204,255,127,204,45,254,79,255,221,255,51,73,18,255,127,42,101,255,241,21,202,0,160,227,7,0,105,50,236,0,79,52,197,255,104,202,208,1,180,15,16,0,101,197,78,255,98,77,203,0,41,185,241,1,35,193,124,0,35,155,23,255,207,53,192,0,11,125,163,1,249,158,185,255,4,131,48,0,21,93,111,255,61,121,231,1,69,200,36,255,185,48,185,255,111,238,21,255,39,50,25,255,99,215,163,255,87,212,30,255,164,147,5,255,128,6,35,1,108,223,110,255,194,76,178,0,74,101,180,0,243,47,48,0,174,25,43,255,82,173,253,1,54,114,192,255,40,55,91,0,215,108,176,255,11,56,7,0,224,233,76,0,209,98,202,254,242,25,125,0,44,193,93,254,203,8,177,0,135,176,19,0,112,71,213,255,206,59,176,1,4,67,26,0,14,143,213,254,42,55,208,255,60,67,120,0,193,21,163,0,99,164,115,0,10,20,118,0,156,212,222,254,160,7,217,255,114,245,76,1,117,59,123,0,176,194,86,254,213,15,176,0,78,206,207,254,213,129,59,0,233,251,22,1,96,55,152,255,236,255,15,255,197,89,84,255,93,149,133,0,174,160,113,0,234,99,169,255,152,116,88,0,144,164,83,255,95,29,198,255,34,47,15,255,99,120,134,255,5,236,193,0,249,247,126,255,147,187,30,0,50,230,117,255,108,217,219,255,163,81,166,255,72,25,169,254,155,121,79,255,28,155,89,254,7,126,17,0,147,65,33,1,47,234,253,0,26,51,18,0,105,83,199,255,163,196,230,0,113,248,164,0,226,254,218,0,189,209,203,255,164,247,222,254,255,35,165,0,4,188,243,1,127,179,71,0,37,237,254,255,100,186,240,0,5,57,71,254,103,72,73,255,244,18,81,254,229,210,132,255,238,6,180,255,11,229,174,255,227,221,192,1,17,49,28,0,163,215,196,254,9,118,4,255,51,240,71,0,113,129,109,255,76,240,231,0,188,177,127,0,125,71,44,1,26,175,243,0,94,169,25,254,27,230,29,0,15,139,119,1,168,170,186,255,172,197,76,255,252,75,188,0,137,124,196,0,72,22,96,255,45,151,249,1,220,145,100,0,64,192,159,255,120,239,226,0,129,178,146,0,0,192,125,0,235,138,234,0,183,157,146,0,83,199,192,255,184,172,72,255,73,225,128,0,77,6,250,255,186,65,67,0,104,246,207,0,188,32,138,255,218,24,242,0,67,138,81,254,237,129,121,255,20,207,150,1,41,199,16,255,6,20,128,0,159,118,5,0,181,16,143,255,220,38,15,0,23,64,147,254,73,26,13,0,87,228,57,1,204,124,128,0,43,24,223,0,219,99,199,0,22,75,20,255,19,27,126,0,157,62,215,0,110,29,230,0,179,167,255,1,54,252,190,0,221,204,182,254,179,158,65,255,81,157,3,0,194,218,159,0,170,223,0,0,224,11,32,255,38,197,98,0,168,164,37,0,23,88,7,1,164,186,110,0,96,36,134,0,234,242,229,0,250,121,19,0,242,254,112,255,3,47,94,1,9,239,6,255,81,134,153,254,214,253,168,255,67,124,224,0,245,95,74,0,28,30,44,254,1,109,220,255,178,89,89,0,252,36,76,0,24,198,46,255,76,77,111,0,134,234,136,255,39,94,29,0,185,72,234,255,70,68,135,255,231,102,7,254,77,231,140,0,167,47,58,1,148,97,118,255,16,27,225,1,166,206,143,255,110,178,214,255,180,131,162,0,143,141,225,1,13,218,78,255,114,153,33,1,98,104,204,0,175,114,117,1,167,206,75,0,202,196,83,1,58,64,67,0,138,47,111,1,196,247,128,255,137,224,224,254,158,112,207,0,154,100,255,1,134,37,107,0,198,128,79,255,127,209,155,255,163,254,185,254,60,14,243,0,31,219,112,254,29,217,65,0,200,13,116,254,123,60,196,255,224,59,184,254,242,89,196,0,123,16,75,254,149,16,206,0,69,254,48,1,231,116,223,255,209,160,65,1,200,80,98,0,37,194,184,254,148,63,34,0,139,240,65,255,217,144,132,255,56,38,45,254,199,120,210,0,108,177,166,255,160,222,4,0,220,126,119,254,165,107,160,255,82,220,248,1,241,175,136,0,144,141,23,255,169,138,84,0,160,137,78,255,226,118,80,255,52,27,132,255,63,96,139,255,152,250,39,0,188,155,15,0,232,51,150,254,40,15,232,255,240,229,9,255,137,175,27,255,75,73,97,1,218,212,11,0,135,5,162,1,107,185,213,0,2,249,107,255,40,242,70,0,219,200,25,0,25,157,13,0,67,82,80,255,196,249,23,255,145,20,149,0,50,72,146,0,94,76,148,1,24,251,65,0,31,192,23,0,184,212,201,255,123,233,162,1,247,173,72,0,162,87,219,254,126,134,89,0,159,11,12,254,166,105,29,0,73,27,228,1,113,120,183,255,66,163,109,1,212,143,11,255,159,231,168,1,255,128,90,0,57,14,58,254,89,52,10,255,253,8,163,1,0,145,210,255,10,129,85,1,46,181,27,0,103,136,160,254,126,188,209,255,34,35,111,0,215,219,24,255,212,11,214,254,101,5,118,0,232,197,133,255,223,167,109,255,237,80,86,255,70,139,94,0,158,193,191,1,155,15,51,255,15,190,115,0,78,135,207,255,249,10,27,1,181,125,233,0,95,172,13,254,170,213,161,255,39,236,138,255,95,93,87,255,190,128,95,0,125,15,206,0,166,150,159,0,227,15,158,255,206,158,120,255,42,141,128,0,101,178,120,1,156,109,131,0,218,14,44,254,247,168,206,255,212,112,28,0,112,17,228,255,90,16,37,1,197,222,108,0,254,207,83,255,9,90,243,255,243,244,172,0,26,88,115,255,205,116,122,0,191,230,193,0,180,100,11,1,217,37,96,255,154,78,156,0,235,234,31,255,206,178,178,255,149,192,251,0,182,250,135,0,246,22,105,0,124,193,109,255,2,210,149,255,169,17,170,0,0,96,110,255,117,9,8,1,50,123,40,255,193,189,99,0,34,227,160,0,48,80,70,254,211,51,236,0,45,122,245,254,44,174,8,0,173,37,233,255,158,65,171,0,122,69,215,255,90,80,2,255,131,106,96,254,227,114,135,0,205,49,119,254,176,62,64,255,82,51,17,255,241,20,243,255,130,13,8,254,128,217,243,255,162,27,1,254,90,118,241,0,246,198,246,255,55,16,118,255,200,159,157,0,163,17,1,0,140,107,121,0,85,161,118,255,38,0,149,0,156,47,238,0,9,166,166,1,75,98,181,255,50,74,25,0,66,15,47,0,139,225,159,0,76,3,142,255,14,238,184,0,11,207,53,255,183,192,186,1,171,32,174,255,191,76,221,1,247,170,219,0,25,172,50,254,217,9,233,0,203,126,68,255,183,92,48,0,127,167,183,1,65,49,254,0,16,63,127,1,254,21,170,255,59,224,127,254,22,48,63,255,27,78,130,254,40,195,29,0,250,132,112,254,35,203,144,0,104,169,168,0,207,253,30,255,104,40,38,254,94,228,88,0,206,16,128,255,212,55,122,255,223,22,234,0,223,197,127,0,253,181,181,1,145,102,118,0,236,153,36,255,212,217,72,255,20,38,24,254,138,62,62,0,152,140,4,0,230,220,99,255,1,21,212,255,148,201,231,0,244,123,9,254,0,171,210,0,51,58,37,255,1,255,14,255,244,183,145,254,0,242,166,0,22,74,132,0,121,216,41,0,95,195,114,254,133,24,151,255,156,226,231,255,247,5,77,255,246,148,115,254,225,92,81,255,222,80,246,254,170,123,89,255,74,199,141,0,29,20,8,255,138,136,70,255,93,75,92,0,221,147,49,254,52,126,226,0,229,124,23,0,46,9,181,0,205,64,52,1,131,254,28,0,151,158,212,0,131,64,78,0,206,25,171,0,0,230,139,0,191,253,110,254,103,247,167,0,64,40,40,1,42,165,241,255,59,75,228,254,124,243,189,255,196,92,178,255,130,140,86,255,141,89,56,1,147,198,5,255,203,248,158,254,144,162,141,0,11,172,226,0,130,42,21,255,1,167,143,255,144,36,36,255,48,88,164,254,168,170,220,0,98,71,214,0,91,208,79,0,159,76,201,1,166,42,214,255,69,255,0,255,6,128,125,255,190,1,140,0,146,83,218,255,215,238,72,1,122,127,53,0,189,116,165,255,84,8,66,255,214,3,208,255,213,110,133,0,195,168,44,1,158,231,69,0,162,64,200,254,91,58,104,0,182,58,187,254,249,228,136,0,203,134,76,254,99,221,233,0,75,254,214,254,80,69,154,0,64,152,248,254,236,136,202,255,157,105,153,254,149,175,20,0,22,35,19,255,124,121,233,0,186,250,198,254,132,229,139,0,137,80,174,255,165,125,68,0,144,202,148,254,235,239,248,0,135,184,118,0,101,94,17,255,122,72,70,254,69,130,146,0,127,222,248,1,69,127,118,255,30,82,215,254,188,74,19,255,229,167,194,254,117,25,66,255,65,234,56,254,213,22,156,0,151,59,93,254,45,28,27,255,186,126,164,255,32,6,239,0,127,114,99,1,219,52,2,255,99,96,166,254,62,190,126,255,108,222,168,1,75,226,174,0,230,226,199,0,60,117,218,255,252,248,20,1,214,188,204,0,31,194,134,254,123,69,192,255,169,173,36,254,55,98,91,0,223,42,102,254,137,1,102,0,157,90,25,0,239,122,64,255,252,6,233,0,7,54,20,255,82,116,174,0,135,37,54,255,15,186,125,0,227,112,175,255,100,180,225,255,42,237,244,255,244,173,226,254,248,18,33,0,171,99,150,255,74,235,50,255,117,82,32,254,106,168,237,0,207,109,208,1,228,9,186,0,135,60,169,254,179,92,143,0,244,170,104,255,235,45,124,255,70,99,186,0,117,137,183,0,224,31,215,0,40,9,100,0,26,16,95,1,68,217,87,0,8,151,20,255,26,100,58,255,176,165,203,1,52,118,70,0,7,32,254,254,244,254,245,255,167,144,194,255,125,113,23,255,176,121,181,0,136,84,209,0,138,6,30,255,89,48,28,0,33,155,14,255,25,240,154,0,141,205,109,1,70,115,62,255,20,40,107,254,138,154,199,255,94,223,226,255,157,171,38,0,163,177,25,254,45,118,3,255,14,222,23,1,209,190,81,255,118,123,232,1,13,213,101,255,123,55,123,254,27,246,165,0,50,99,76,255,140,214,32,255,97,65,67,255,24,12,28,0,174,86,78,1,64,247,96,0,160,135,67,0,66,55,243,255,147,204,96,255,26,6,33,255,98,51,83,1,153,213,208,255,2,184,54,255,25,218,11,0,49,67,246,254,18,149,72,255,13,25,72,0,42,79,214,0,42,4,38,1,27,139,144,255,149,187,23,0,18,164,132,0,245,84,184,254,120,198,104,255,126,218,96,0,56,117,234,255,13,29,214,254,68,47,10,255,167,154,132,254,152,38,198,0,66,178,89,255,200,46,171,255,13,99,83,255,210,187,253,255,170,45,42,1,138,209,124,0,214,162,141,0,12,230,156,0,102,36,112,254,3,147,67,0,52,215,123,255,233,171,54,255,98,137,62,0,247,218,39,255,231,218,236,0,247,191,127,0,195,146,84,0,165,176,92,255,19,212,94,255,17,74,227,0,88,40,153,1,198,147,1,255,206,67,245,254,240,3,218,255,61,141,213,255,97,183,106,0,195,232,235,254,95,86,154,0,209,48,205,254,118,209,241,255,240,120,223,1,213,29,159,0,163,127,147,255,13,218,93,0,85,24,68,254,70,20,80,255,189,5,140,1,82,97,254,255,99,99,191,255,132,84,133,255,107,218,116,255,112,122,46,0,105,17,32,0,194,160,63,255,68,222,39,1,216,253,92,0,177,105,205,255,149,201,195,0,42,225,11,255,40,162,115,0,9,7,81,0,165,218,219,0,180,22,0,254,29,146,252,255,146,207,225,1,180,135,96,0,31,163,112,0,177,11,219,255,133,12,193,254,43,78,50,0,65,113,121,1,59,217,6,255,110,94,24,1,112,172,111,0,7,15,96,0,36,85,123,0,71,150,21,255,208,73,188,0,192,11,167,1,213,245,34,0,9,230,92,0,162,142,39,255,215,90,27,0,98,97,89,0,94,79,211,0,90,157,240,0,95,220,126,1,102,176,226,0,36,30,224,254,35,31,127,0,231,232,115,1,85,83,130,0,210,73,245,255,47,143,114,255,68,65,197,0,59,72,62,255,183,133,173,254,93,121,118,255,59,177,81,255,234,69,173,255,205,128,177,0,220,244,51,0,26,244,209,1,73,222,77,255,163,8,96,254,150,149,211,0,158,254,203,1,54,127,139,0,161,224,59,0,4,109,22,255,222,42,45,255,208,146,102,255,236,142,187,0,50,205,245,255,10,74,89,254,48,79,142,0,222,76,130,255,30,166,63,0,236,12,13,255,49,184,244,0,187,113,102,0,218,101,253,0,153,57,182,254,32,150,42,0,25,198,146,1,237,241,56,0,140,68,5,0,91,164,172,255,78,145,186,254,67,52,205,0,219,207,129,1,109,115,17,0,54,143,58,1,21,248,120,255,179,255,30,0,193,236,66,255,1,255,7,255,253,192,48,255,19,69,217,1,3,214,0,255,64,101,146,1,223,125,35,255,235,73,179,255,249,167,226,0,225,175,10,1,97,162,58,0,106,112,171,1,84,172,5,255,133,140,178,255,134,245,142,0,97,90,125,255,186,203,185,255,223,77,23,255,192,92,106,0,15,198,115,255,217,152,248,0,171,178,120,255,228,134,53,0,176,54,193,1,250,251,53,0,213,10,100,1,34,199,106,0,151,31,244,254,172,224,87,255,14,237,23,255,253,85,26,255,127,39,116,255,172,104,100,0,251,14,70,255,212,208,138,255,253,211,250,0,176,49,165,0,15,76,123,255,37,218,160,255,92,135,16,1,10,126,114,255,70,5,224,255,247,249,141,0,68,20,60,1,241,210,189,255,195,217,187,1,151,3,113,0,151,92,174,0,231,62,178,255,219,183,225,0,23,23,33,255,205,181,80,0,57,184,248,255,67,180,1,255,90,123,93,255,39,0,162,255,96,248,52,255,84,66,140,0,34,127,228,255,194,138,7,1,166,110,188,0,21,17,155,1,154,190,198,255,214,80,59,255,18,7,143,0,72,29,226,1,199,217,249,0,232,161,71,1,149,190,201,0,217,175,95,254,113,147,67,255,138,143,199,255,127,204,1,0,29,182,83,1,206,230,155,255,186,204,60,0,10,125,85,255,232,96,25,255,255,89,247,255,213,254,175,1,232,193,81,0,28,43,156,254,12,69,8,0,147,24,248,0,18,198,49,0,134,60,35,0,118,246,18,255,49,88,254,254,228,21,186,255,182,65,112,1,219,22,1,255,22,126,52,255,189,53,49,255,112,25,143,0,38,127,55,255,226,101,163,254,208,133,61,255,137,69,174,1,190,118,145,255,60,98,219,255,217,13,245,255,250,136,10,0,84,254,226,0,201,31,125,1,240,51,251,255,31,131,130,255,2,138,50,255,215,215,177,1,223,12,238,255,252,149,56,255,124,91,68,255,72,126,170,254,119,255,100,0,130,135,232,255,14,79,178,0,250,131,197,0,138,198,208,0,121,216,139,254,119,18,36,255,29,193,122,0,16,42,45,255,213,240,235,1,230,190,169,255,198,35,228,254,110,173,72,0,214,221,241,255,56,148,135,0,192,117,78,254,141,93,207,255,143,65,149,0,21,18,98,255,95,44,244,1,106,191,77,0,254,85,8,254,214,110,176,255,73,173,19,254,160,196,199,255,237,90,144,0,193,172,113,255,200,155,136,254,228,90,221,0,137,49,74,1,164,221,215,255,209,189,5,255,105,236,55,255,42,31,129,1,193,255,236,0,46,217,60,0,138,88,187,255,226,82,236,255,81,69,151,255,142,190,16,1,13,134,8,0,127,122,48,255,81,64,156,0,171,243,139,0,237,35,246,0,122,143,193,254,212,122,146,0,95,41,255,1,87,132,77,0,4,212,31,0,17,31,78,0,39,45,173,254,24,142,217,255,95,9,6,255,227,83,6,0,98,59,130,254,62,30,33,0,8,115,211,1,162,97,128,255,7,184,23,254,116,28,168,255,248,138,151,255,98,244,240,0,186,118,130,0,114,248,235,255,105,173,200,1,160,124,71,255,94,36,164,1,175,65,146,255,238,241,170,254,202,198,197,0,228,71,138,254,45,246,109,255,194,52,158,0,133,187,176,0,83,252,154,254,89,189,221,255,170,73,252,0,148,58,125,0,36,68,51,254,42,69,177,255,168,76,86,255,38,100,204,255,38,53,35,0,175,19,97,0,225,238,253,255,81,81,135,0,210,27,255,254,235,73,107,0,8,207,115,0,82,127,136,0,84,99,21,254,207,19,136,0,100,164,101,0,80,208,77,255,132,207,237,255,15,3,15,255,33,166,110,0,156,95,85,255,37,185,111,1,150,106,35,255,166,151,76,0,114,87,135,255,159,194,64,0,12,122,31,255,232,7,101,254,173,119,98,0,154,71,220,254,191,57,53,255,168,232,160,255,224,32,99,255,218,156,165,0,151,153,163,0,217,13,148,1,197,113,89,0,149,28,161,254,207,23,30,0,105,132,227,255,54,230,94,255,133,173,204,255,92,183,157,255,88,144,252,254,102,33,90,0,159,97,3,0,181,218,155,255,240,114,119,0,106,214,53,255,165,190,115,1,152,91,225,255,88,106,44,255,208,61,113,0,151,52,124,0,191,27,156,255,110,54,236,1,14,30,166,255,39,127,207,1,229,199,28,0,188,228,188,254,100,157,235,0,246,218,183,1,107,22,193,255,206,160,95,0,76,239,147,0,207,161,117,0,51,166,2,255,52,117,10,254,73,56,227,255,152,193,225,0,132,94,136,255,101,191,209,0,32,107,229,255,198,43,180,1,100,210,118,0,114,67,153,255,23,88,26,255,89,154,92,1,220,120,140,255,144,114,207,255,252,115,250,255,34,206,72,0,138,133,127,255,8,178,124,1,87,75,97,0,15,229,92,254,240,67,131,255,118,123,227,254,146,120,104,255,145,213,255,1,129,187,70,255,219,119,54,0,1,19,173,0,45,150,148,1,248,83,72,0,203,233,169,1,142,107,56,0,247,249,38,1,45,242,80,255,30,233,103,0,96,82,70,0,23,201,111,0,81,39,30,255,161,183,78,255,194,234,33,255,68,227,140,254,216,206,116,0,70,27,235,255,104,144,79,0,164,230,93,254,214,135,156,0,154,187,242,254,188,20,131,255,36,109,174,0,159,112,241,0,5,110,149,1,36,165,218,0,166,29,19,1,178,46,73,0,93,43,32,254,248,189,237,0,102,155,141,0,201,93,195,255,241,139,253,255,15,111,98,255,108,65,163,254,155,79,190,255,73,174,193,254,246,40,48,255,107,88,11,254,202,97,85,255,253,204,18,255,113,242,66,0,110,160,194,254,208,18,186,0,81,21,60,0,188,104,167,255,124,166,97,254,210,133,142,0,56,242,137,254,41,111,130,0,111,151,58,1,111,213,141,255,183,172,241,255,38,6,196,255,185,7,123,255,46,11,246,0,245,105,119,1,15,2,161,255,8,206,45,255,18,202,74,255,83,124,115,1,212,141,157,0,83,8,209,254,139,15,232,255,172,54,173,254,50,247,132,0,214,189,213,0,144,184,105,0,223,254,248,0,255,147,240,255,23,188,72,0,7,51,54,0,188,25,180,254,220,180,0,255,83,160,20,0,163,189,243,255,58,209,194,255,87,73,60,0,106,24,49,0,245,249,220,0,22,173,167,0,118,11,195,255,19,126,237,0,110,159,37,255,59,82,47,0,180,187,86,0,188,148,208,1,100,37,133,255,7,112,193,0,129,188,156,255,84,106,129,255,133,225,202,0,14,236,111,255,40,20,101,0,172,172,49,254,51,54,74,255,251,185,184,255,93,155,224,255,180,249,224,1,230,178,146,0,72,57,54,254,178,62,184,0,119,205,72,0,185,239,253,255,61,15,218,0,196,67,56,255,234,32,171,1,46,219,228,0,208,108,234,255,20,63,232,255,165,53,199,1,133,228,5,255,52,205,107,0,74,238,140,255,150,156,219,254,239,172,178,255,251,189,223,254,32,142,211,255,218,15,138,1,241,196,80,0,28,36,98,254,22,234,199,0,61,237,220,255,246,57,37,0,142,17,142,255,157,62,26,0,43,238,95,254,3,217,6,255,213,25,240,1,39,220,174,255,154,205,48,254,19,13,192,255,244,34,54,254,140,16,155,0,240,181,5,254,155,193,60,0,166,128,4,255,36,145,56,255,150,240,219,0,120,51,145,0,82,153,42,1,140,236,146,0,107,92,248,1,189,10,3,0,63,136,242,0,211,39,24,0,19,202,161,1,173,27,186,255,210,204,239,254,41,209,162,255,182,254,159,255,172,116,52,0,195,103,222,254,205,69,59,0,53,22,41,1,218,48,194,0,80,210,242,0,210,188,207,0,187,161,161,254,216,17,1,0,136,225,113,0,250,184,63,0,223,30,98,254,77,168,162,0,59,53,175,0,19,201,10,255,139,224,194,0,147,193,154,255,212,189,12,254,1,200,174,255,50,133,113,1,94,179,90,0,173,182,135,0,94,177,113,0,43,89,215,255,136,252,106,255,123,134,83,254,5,245,66,255,82,49,39,1,220,2,224,0,97,129,177,0,77,59,89,0,61,29,155,1,203,171,220,255,92,78,139,0,145,33,181,255,169,24,141,1,55,150,179,0,139,60,80,255,218,39,97,0,2,147,107,255,60,248,72,0,173,230,47,1,6,83,182,255,16,105,162,254,137,212,81,255,180,184,134,1,39,222,164,255,221,105,251,1,239,112,125,0,63,7,97,0,63,104,227,255,148,58,12,0,90,60,224,255,84,212,252,0,79,215,168,0,248,221,199,1,115,121,1,0,36,172,120,0,32,162,187,255,57,107,49,255,147,42,21,0,106,198,43,1,57,74,87,0,126,203,81,255,129,135,195,0,140,31,177,0,221,139,194,0,3,222,215,0,131,68,231,0,177,86,178,254,124,151,180,0,184,124,38,1,70,163,17,0,249,251,181,1,42,55,227,0,226,161,44,0,23,236,110,0,51,149,142,1,93,5,236,0,218,183,106,254,67,24,77,0,40,245,209,255,222,121,153,0,165,57,30,0,83,125,60,0,70,38,82,1,229,6,188,0,109,222,157,255,55,118,63,255,205,151,186,0,227,33,149,255,254,176,246,1,227,177,227,0,34,106,163,254,176,43,79,0,106,95,78,1,185,241,122,255,185,14,61,0,36,1,202,0,13,178,162,255,247,11,132,0,161,230,92,1,65,1,185,255,212,50,165,1,141,146,64,255,158,242,218,0,21,164,125,0,213,139,122,1,67,71,87,0,203,158,178,1,151,92,43,0,152,111,5,255,39,3,239,255,217,255,250,255,176,63,71,255,74,245,77,1,250,174,18,255,34,49,227,255,246,46,251,255,154,35,48,1,125,157,61,255,106,36,78,255,97,236,153,0,136,187,120,255,113,134,171,255,19,213,217,254,216,94,209,255,252,5,61,0,94,3,202,0,3,26,183,255,64,191,43,255,30,23,21,0,129,141,77,255,102,120,7,1,194,76,140,0,188,175,52,255,17,81,148,0,232,86,55,1,225,48,172,0,134,42,42,255,238,50,47,0,169,18,254,0,20,147,87,255,14,195,239,255,69,247,23,0,238,229,128,255,177,49,112,0,168,98,251,255,121,71,248,0,243,8,145,254,246,227,153,255,219,169,177,254,251,139,165,255,12,163,185,255,164,40,171,255,153,159,27,254,243,109,91,255,222,24,112,1,18,214,231,0,107,157,181,254,195,147,0,255,194,99,104,255,89,140,190,255,177,66,126,254,106,185,66,0,49,218,31,0,252,174,158,0,188,79,230,1,238,41,224,0,212,234,8,1,136,11,181,0,166,117,83,255,68,195,94,0,46,132,201,0,240,152,88,0,164,57,69,254,160,224,42,255,59,215,67,255,119,195,141,255,36,180,121,254,207,47,8,255,174,210,223,0,101,197,68,255,255,82,141,1,250,137,233,0,97,86,133,1,16,80,69,0,132,131,159,0,116,93,100,0,45,141,139,0,152,172,157,255,90,43,91,0,71,153,46,0,39,16,112,255,217,136,97,255,220,198,25,254,177,53,49,0,222,88,134,255,128,15,60,0,207,192,169,255,192,116,209,255,106,78,211,1,200,213,183,255,7,12,122,254,222,203,60,255,33,110,199,254,251,106,117,0,228,225,4,1,120,58,7,255,221,193,84,254,112,133,27,0,189,200,201,255,139,135,150,0,234,55,176,255,61,50,65,0,152,108,169,255,220,85,1,255,112,135,227,0,162,26,186,0,207,96,185,254,244,136,107,0,93,153,50,1,198,97,151,0,110,11,86,255,143,117,174,255,115,212,200,0,5,202,183,0,237,164,10,254,185,239,62,0,236,120,18,254,98,123,99,255,168,201,194,254,46,234,214,0,191,133,49,255,99,169,119,0,190,187,35,1,115,21,45,255,249,131,72,0,112,6,123,255,214,49,181,254,166,233,34,0,92,197,102,254,253,228,205,255,3,59,201,1,42,98,46,0,219,37,35,255,169,195,38,0,94,124,193,1,156,43,223,0,95,72,133,254,120,206,191,0,122,197,239,255,177,187,79,255,254,46,2,1,250,167,190,0,84,129,19,0,203,113,166,255,249,31,189,254,72,157,202,255,208,71,73,255,207,24,72,0,10,16,18,1,210,81,76,255,88,208,192,255,126,243,107,255,238,141,120,255,199,121,234,255,137,12,59,255,36,220,123,255,148,179,60,254,240,12,29,0,66,0,97,1,36,30,38,255,115,1,93,255,96,103,231,255,197,158,59,1,192,164,240,0,202,202,57,255,24,174,48,0,89,77,155,1,42,76,215,0,244,151,233,0,23,48,81,0,239,127,52,254,227,130,37,255,248,116,93,1,124,132,118,0,173,254,192,1,6,235,83,255,110,175,231,1,251,28,182,0,129,249,93,254,84,184,128,0,76,181,62,0,175,128,186,0,100,53,136,254,109,29,226,0,221,233,58,1,20,99,74,0,0,22,160,0,134,13,21,0,9,52,55,255,17,89,140,0,175,34,59,0,84,165,119,255,224,226,234,255,7,72,166,255,123,115,255,1,18,214,246,0,250,7,71,1,217,220,185,0,212,35,76,255,38,125,175,0,189,97,210,0,114,238,44,255,41,188,169,254,45,186,154,0,81,92,22,0,132,160,193,0,121,208,98,255,13,81,44,255,203,156,82,0,71,58,21,255,208,114,191,254,50,38,147,0,154,216,195,0,101,25,18,0,60,250,215,255,233,132,235,255,103,175,142,1,16,14,92,0,141,31,110,254,238,241,45,255,153,217,239,1,97,168,47,255,249,85,16,1,28,175,62,255,57,254,54,0,222,231,126,0,166,45,117,254,18,189,96,255,228,76,50,0,200,244,94,0,198,152,120,1,68,34,69,255,12,65,160,254,101,19,90,0,167,197,120,255,68,54,185,255,41,218,188,0,113,168,48,0,88,105,189,1,26,82,32,255,185,93,164,1,228,240,237,255,66,182,53,0,171,197,92,255,107,9,233,1,199,120,144,255,78,49,10,255,109,170,105,255,90,4,31,255,28,244,113,255,74,58,11,0,62,220,246,255,121,154,200,254,144,210,178,255,126,57,129,1,43,250,14,255,101,111,28,1,47,86,241,255,61,70,150,255,53,73,5,255,30,26,158,0,209,26,86,0,138,237,74,0,164,95,188,0,142,60,29,254,162,116,248,255,187,175,160,0,151,18,16,0,209,111,65,254,203,134,39,255,88,108,49,255,131,26,71,255,221,27,215,254,104,105,93,255,31,236,31,254,135,0,211,255,143,127,110,1,212,73,229,0,233,67,167,254,195,1,208,255,132,17,221,255,51,217,90,0,67,235,50,255,223,210,143,0,179,53,130,1,233,106,198,0,217,173,220,255,112,229,24,255,175,154,93,254,71,203,246,255,48,66,133,255,3,136,230,255,23,221,113,254,235,111,213,0,170,120,95,254,251,221,2,0,45,130,158,254,105,94,217,255,242,52,180,254,213,68,45,255,104,38,28,0,244,158,76,0,161,200,96,255,207,53,13,255,187,67,148,0,170,54,248,0,119,162,178,255,83,20,11,0,42,42,192,1,146,159,163,255,183,232,111,0,77,229,21,255,71,53,143,0,27,76,34],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);allocate([246,136,47,255,219,39,182,255,92,224,201,1,19,142,14,255,69,182,241,255,163,118,245,0,9,109,106,1,170,181,247,255,78,47,238,255,84,210,176,255,213,107,139,0,39,38,11,0,72,21,150,0,72,130,69,0,205,77,155,254,142,133,21,0,71,111,172,254,226,42,59,255,179,0,215,1,33,128,241,0,234,252,13,1,184,79,8,0,110,30,73,255,246,141,189,0,170,207,218,1,74,154,69,255,138,246,49,255,155,32,100,0,125,74,105,255,90,85,61,255,35,229,177,255,62,125,193,255,153,86,188,1,73,120,212,0,209,123,246,254,135,209,38,255,151,58,44,1,92,69,214,255,14,12,88,255,252,153,166,255,253,207,112,255,60,78,83,255,227,124,110,0,180,96,252,255,53,117,33,254,164,220,82,255,41,1,27,255,38,164,166,255,164,99,169,254,61,144,70,255,192,166,18,0,107,250,66,0,197,65,50,0,1,179,18,255,255,104,1,255,43,153,35,255,80,111,168,0,110,175,168,0,41,105,45,255,219,14,205,255,164,233,140,254,43,1,118,0,233,67,195,0,178,82,159,255,138,87,122,255,212,238,90,255,144,35,124,254,25,140,164,0,251,215,44,254,133,70,107,255,101,227,80,254,92,169,55,0,215,42,49,0,114,180,85,255,33,232,27,1,172,213,25,0,62,176,123,254,32,133,24,255,225,191,62,0,93,70,153,0,181,42,104,1,22,191,224,255,200,200,140,255,249,234,37,0,149,57,141,0,195,56,208,255,254,130,70,255,32,173,240,255,29,220,199,0,110,100,115,255,132,229,249,0,228,233,223,255,37,216,209,254,178,177,209,255,183,45,165,254,224,97,114,0,137,97,168,255,225,222,172,0,165,13,49,1,210,235,204,255,252,4,28,254,70,160,151,0,232,190,52,254,83,248,93,255,62,215,77,1,175,175,179,255,160,50,66,0,121,48,208,0,63,169,209,255,0,210,200,0,224,187,44,1,73,162,82,0,9,176,143,255,19,76,193,255,29,59,167,1,24,43,154,0,28,190,190,0,141,188,129,0,232,235,203,255,234,0,109,255,54,65,159,0,60,88,232,255,121,253,150,254,252,233,131,255,198,110,41,1,83,77,71,255,200,22,59,254,106,253,242,255,21,12,207,255,237,66,189,0,90,198,202,1,225,172,127,0,53,22,202,0,56,230,132,0,1,86,183,0,109,190,42,0,243,68,174,1,109,228,154,0,200,177,122,1,35,160,183,255,177,48,85,255,90,218,169,255,248,152,78,0,202,254,110,0,6,52,43,0,142,98,65,255,63,145,22,0,70,106,93,0,232,138,107,1,110,179,61,255,211,129,218,1,242,209,92,0,35,90,217,1,182,143,106,255,116,101,217,255,114,250,221,255,173,204,6,0,60,150,163,0,73,172,44,255,239,110,80,255,237,76,153,254,161,140,249,0,149,232,229,0,133,31,40,255,174,164,119,0,113,51,214,0,129,228,2,254,64,34,243,0,107,227,244,255,174,106,200,255,84,153,70,1,50,35,16,0,250,74,216,254,236,189,66,255,153,249,13,0,230,178,4,255,221,41,238,0,118,227,121,255,94,87,140,254,254,119,92,0,73,239,246,254,117,87,128,0,19,211,145,255,177,46,252,0,229,91,246,1,69,128,247,255,202,77,54,1,8,11,9,255,153,96,166,0,217,214,173,255,134,192,2,1,0,207,0,0,189,174,107,1,140,134,100,0,158,193,243,1,182,102,171,0,235,154,51,0,142,5,123,255,60,168,89,1,217,14,92,255,19,214,5,1,211,167,254,0,44,6,202,254,120,18,236,255,15,113,184,255,184,223,139,0,40,177,119,254,182,123,90,255,176,165,176,0,247,77,194,0,27,234,120,0,231,0,214,255,59,39,30,0,125,99,145,255,150,68,68,1,141,222,248,0,153,123,210,255,110,127,152,255,229,33,214,1,135,221,197,0,137,97,2,0,12,143,204,255,81,41,188,0,115,79,130,255,94,3,132,0,152,175,187,255,124,141,10,255,126,192,179,255,11,103,198,0,149,6,45,0,219,85,187,1,230,18,178,255,72,182,152,0,3,198,184,255,128,112,224,1,97,161,230,0,254,99,38,255,58,159,197,0,151,66,219,0,59,69,143,255,185,112,249,0,119,136,47,255,123,130,132,0,168,71,95,255,113,176,40,1,232,185,173,0,207,93,117,1,68,157,108,255,102,5,147,254,49,97,33,0,89,65,111,254,247,30,163,255,124,217,221,1,102,250,216,0,198,174,75,254,57,55,18,0,227,5,236,1,229,213,173,0,201,109,218,1,49,233,239,0,30,55,158,1,25,178,106,0,155,111,188,1,94,126,140,0,215,31,238,1,77,240,16,0,213,242,25,1,38,71,168,0,205,186,93,254,49,211,140,255,219,0,180,255,134,118,165,0,160,147,134,255,110,186,35,255,198,243,42,0,243,146,119,0,134,235,163,1,4,241,135,255,193,46,193,254,103,180,79,255,225,4,184,254,242,118,130,0,146,135,176,1,234,111,30,0,69,66,213,254,41,96,123,0,121,94,42,255,178,191,195,255,46,130,42,0,117,84,8,255,233,49,214,254,238,122,109,0,6,71,89,1,236,211,123,0,244,13,48,254,119,148,14,0,114,28,86,255,75,237,25,255,145,229,16,254,129,100,53,255,134,150,120,254,168,157,50,0,23,72,104,255,224,49,14,0,255,123,22,255,151,185,151,255,170,80,184,1,134,182,20,0,41,100,101,1,153,33,16,0,76,154,111,1,86,206,234,255,192,160,164,254,165,123,93,255,1,216,164,254,67,17,175,255,169,11,59,255,158,41,61,255,73,188,14,255,195,6,137,255,22,147,29,255,20,103,3,255,246,130,227,255,122,40,128,0,226,47,24,254,35,36,32,0,152,186,183,255,69,202,20,0,195,133,195,0,222,51,247,0,169,171,94,1,183,0,160,255,64,205,18,1,156,83,15,255,197,58,249,254,251,89,110,255,50,10,88,254,51,43,216,0,98,242,198,1,245,151,113,0,171,236,194,1,197,31,199,255,229,81,38,1,41,59,20,0,253,104,230,0,152,93,14,255,246,242,146,254,214,169,240,255,240,102,108,254,160,167,236,0,154,218,188,0,150,233,202,255,27,19,250,1,2,71,133,255,175,12,63,1,145,183,198,0,104,120,115,255,130,251,247,0,17,212,167,255,62,123,132,255,247,100,189,0,155,223,152,0,143,197,33,0,155,59,44,255,150,93,240,1,127,3,87,255,95,71,207,1,167,85,1,255,188,152,116,255,10,23,23,0,137,195,93,1,54,98,97,0,240,0,168,255,148,188,127,0,134,107,151,0,76,253,171,0,90,132,192,0,146,22,54,0,224,66,54,254,230,186,229,255,39,182,196,0,148,251,130,255,65,131,108,254,128,1,160,0,169,49,167,254,199,254,148,255,251,6,131,0,187,254,129,255,85,82,62,0,178,23,58,255,254,132,5,0,164,213,39,0,134,252,146,254,37,53,81,255,155,134,82,0,205,167,238,255,94,45,180,255,132,40,161,0,254,111,112,1,54,75,217,0,179,230,221,1,235,94,191,255,23,243,48,1,202,145,203,255,39,118,42,255,117,141,253,0,254,0,222,0,43,251,50,0,54,169,234,1,80,68,208,0,148,203,243,254,145,7,135,0,6,254,0,0,252,185,127,0,98,8,129,255,38,35,72,255,211,36,220,1,40,26,89,0,168,64,197,254,3,222,239,255,2,83,215,254,180,159,105,0,58,115,194,0,186,116,106,255,229,247,219,255,129,118,193,0,202,174,183,1,166,161,72,0,201,107,147,254,237,136,74,0,233,230,106,1,105,111,168,0,64,224,30,1,1,229,3,0,102,151,175,255,194,238,228,255,254,250,212,0,187,237,121,0,67,251,96,1,197,30,11,0,183,95,204,0,205,89,138,0,64,221,37,1,255,223,30,255,178,48,211,255,241,200,90,255,167,209,96,255,57,130,221,0,46,114,200,255,61,184,66,0,55,182,24,254,110,182,33,0,171,190,232,255,114,94,31,0,18,221,8,0,47,231,254,0,255,112,83,0,118,15,215,255,173,25,40,254,192,193,31,255,238,21,146,255,171,193,118,255,101,234,53,254,131,212,112,0,89,192,107,1,8,208,27,0,181,217,15,255,231,149,232,0,140,236,126,0,144,9,199,255,12,79,181,254,147,182,202,255,19,109,182,255,49,212,225,0,74,163,203,0,175,233,148,0,26,112,51,0,193,193,9,255,15,135,249,0,150,227,130,0,204,0,219,1,24,242,205,0,238,208,117,255,22,244,112,0,26,229,34,0,37,80,188,255,38,45,206,254,240,90,225,255,29,3,47,255,42,224,76,0,186,243,167,0,32,132,15,255,5,51,125,0,139,135,24,0,6,241,219,0,172,229,133,255,246,214,50,0,231,11,207,255,191,126,83,1,180,163,170,255,245,56,24,1,178,164,211,255,3,16,202,1,98,57,118,255,141,131,89,254,33,51,24,0,243,149,91,255,253,52,14,0,35,169,67,254,49,30,88,255,179,27,36,255,165,140,183,0,58,189,151,0,88,31,0,0,75,169,66,0,66,101,199,255,24,216,199,1,121,196,26,255,14,79,203,254,240,226,81,255,94,28,10,255,83,193,240,255,204,193,131,255,94,15,86,0,218,40,157,0,51,193,209,0,0,242,177,0,102,185,247,0,158,109,116,0,38,135,91,0,223,175,149,0,220,66,1,255,86,60,232,0,25,96,37,255,225,122,162,1,215,187,168,255,158,157,46,0,56,171,162,0,232,240,101,1,122,22,9,0,51,9,21,255,53,25,238,255,217,30,232,254,125,169,148,0,13,232,102,0,148,9,37,0,165,97,141,1,228,131,41,0,222,15,243,255,254,18,17,0,6,60,237,1,106,3,113,0,59,132,189,0,92,112,30,0,105,208,213,0,48,84,179,255,187,121,231,254,27,216,109,255,162,221,107,254,73,239,195,255,250,31,57,255,149,135,89,255,185,23,115,1,3,163,157,255,18,112,250,0,25,57,187,255,161,96,164,0,47,16,243,0,12,141,251,254,67,234,184,255,41,18,161,0,175,6,96,255,160,172,52,254,24,176,183,255,198,193,85,1,124,121,137,255,151,50,114,255,220,203,60,255,207,239,5,1,0,38,107,255,55,238,94,254,70,152,94,0,213,220,77,1,120,17,69,255,85,164,190,255,203,234,81,0,38,49,37,254,61,144,124,0,137,78,49,254,168,247,48,0,95,164,252,0,105,169,135,0,253,228,134,0,64,166,75,0,81,73,20,255,207,210,10,0,234,106,150,255,94,34,90,255,254,159,57,254,220,133,99,0,139,147,180,254,24,23,185,0,41,57,30,255,189,97,76,0,65,187,223,255,224,172,37,255,34,62,95,1,231,144,240,0,77,106,126,254,64,152,91,0,29,98,155,0,226,251,53,255,234,211,5,255,144,203,222,255,164,176,221,254,5,231,24,0,179,122,205,0,36,1,134,255,125,70,151,254,97,228,252,0,172,129,23,254,48,90,209,255,150,224,82,1,84,134,30,0,241,196,46,0,103,113,234,255,46,101,121,254,40,124,250,255,135,45,242,254,9,249,168,255,140,108,131,255,143,163,171,0,50,173,199,255,88,222,142,255,200,95,158,0,142,192,163,255,7,117,135,0,111,124,22,0,236,12,65,254,68,38,65,255,227,174,254,0,244,245,38,0,240,50,208,255,161,63,250,0,60,209,239,0,122,35,19,0,14,33,230,254,2,159,113,0,106,20,127,255,228,205,96,0,137,210,174,254,180,212,144,255,89,98,154,1,34,88,139,0,167,162,112,1,65,110,197,0,241,37,169,0,66,56,131,255,10,201,83,254,133,253,187,255,177,112,45,254,196,251,0,0,196,250,151,255,238,232,214,255,150,209,205,0,28,240,118,0,71,76,83,1,236,99,91,0,42,250,131,1,96,18,64,255,118,222,35,0,113,214,203,255,122,119,184,255,66,19,36,0,204,64,249,0,146,89,139,0,134,62,135,1,104,233,101,0,188,84,26,0,49,249,129,0,208,214,75,255,207,130,77,255,115,175,235,0,171,2,137,255,175,145,186,1,55,245,135,255,154,86,181,1,100,58,246,255,109,199,60,255,82,204,134,255,215,49,230,1,140,229,192,255,222,193,251,255,81,136,15,255,179,149,162,255,23,39,29,255,7,95,75,254,191,81,222,0,241,81,90,255,107,49,201,255,244,211,157,0,222,140,149,255,65,219,56,254,189,246,90,255,178,59,157,1,48,219,52,0,98,34,215,0,28,17,187,255,175,169,24,0,92,79,161,255,236,200,194,1,147,143,234,0,229,225,7,1,197,168,14,0,235,51,53,1,253,120,174,0,197,6,168,255,202,117,171,0,163,21,206,0,114,85,90,255,15,41,10,255,194,19,99,0,65,55,216,254,162,146,116,0,50,206,212,255,64,146,29,255,158,158,131,1,100,165,130,255,172,23,129,255,125,53,9,255,15,193,18,1,26,49,11,255,181,174,201,1,135,201,14,255,100,19,149,0,219,98,79,0,42,99,143,254,96,0,48,255,197,249,83,254,104,149,79,255,235,110,136,254,82,128,44,255,65,41,36,254,88,211,10,0,187,121,187,0,98,134,199,0,171,188,179,254,210,11,238,255,66,123,130,254,52,234,61,0,48,113,23,254,6,86,120,255,119,178,245,0,87,129,201,0,242,141,209,0,202,114,85,0,148,22,161,0,103,195,48,0,25,49,171,255,138,67,130,0,182,73,122,254,148,24,130,0,211,229,154,0,32,155,158,0,84,105,61,0,177,194,9,255,166,89,86,1,54,83,187,0,249,40,117,255,109,3,215,255,53,146,44,1,63,47,179,0,194,216,3,254,14,84,136,0,136,177,13,255,72,243,186,255,117,17,125,255,211,58,211,255,93,79,223,0,90,88,245,255,139,209,111,255,70,222,47,0,10,246,79,255,198,217,178,0,227,225,11,1,78,126,179,255,62,43,126,0,103,148,35,0,129,8,165,254,245,240,148,0,61,51,142,0,81,208,134,0,15,137,115,255,211,119,236,255,159,245,248,255,2,134,136,255,230,139,58,1,160,164,254,0,114,85,141,255,49,166,182,255,144,70,84,1,85,182,7,0,46,53,93,0,9,166,161,255,55,162,178,255,45,184,188,0,146,28,44,254,169,90,49,0,120,178,241,1,14,123,127,255,7,241,199,1,189,66,50,255,198,143,101,254,189,243,135,255,141,24,24,254,75,97,87,0,118,251,154,1,237,54,156,0,171,146,207,255,131,196,246,255,136,64,113,1,151,232,57,0,240,218,115,0,49,61,27,255,64,129,73,1,252,169,27,255,40,132,10,1,90,201,193,255,252,121,240,1,186,206,41,0,43,198,97,0,145,100,183,0,204,216,80,254,172,150,65,0,249,229,196,254,104,123,73,255,77,104,96,254,130,180,8,0,104,123,57,0,220,202,229,255,102,249,211,0,86,14,232,255,182,78,209,0,239,225,164,0,106,13,32,255,120,73,17,255,134,67,233,0,83,254,181,0,183,236,112,1,48,64,131,255,241,216,243,255,65,193,226,0,206,241,100,254,100,134,166,255,237,202,197,0,55,13,81,0,32,124,102,255,40,228,177,0,118,181,31,1,231,160,134,255,119,187,202,0,0,142,60,255,128,38,189,255,166,201,150,0,207,120,26,1,54,184,172,0,12,242,204,254,133,66,230,0,34,38,31,1,184,112,80,0,32,51,165,254,191,243,55,0,58,73,146,254,155,167,205,255,100,104,152,255,197,254,207,255,173,19,247,0,238,10,202,0,239,151,242,0,94,59,39,255,240,29,102,255,10,92,154,255,229,84,219,255,161,129,80,0,208,90,204,1,240,219,174,255,158,102,145,1,53,178,76,255,52,108,168,1,83,222,107,0,211,36,109,0,118,58,56,0,8,29,22,0,237,160,199,0,170,209,157,0,137,71,47,0,143,86,32,0,198,242,2,0,212,48,136,1,92,172,186,0,230,151,105,1,96,191,229,0,138,80,191,254,240,216,130,255,98,43,6,254,168,196,49,0,253,18,91,1,144,73,121,0,61,146,39,1,63,104,24,255,184,165,112,254,126,235,98,0,80,213,98,255,123,60,87,255,82,140,245,1,223,120,173,255,15,198,134,1,206,60,239,0,231,234,92,255,33,238,19,255,165,113,142,1,176,119,38,0,160,43,166,254,239,91,105,0,107,61,194,1,25,4,68,0,15,139,51,0,164,132,106,255,34,116,46,254,168,95,197,0,137,212,23,0,72,156,58,0,137,112,69,254,150,105,154,255,236,201,157,0,23,212,154,255,136,82,227,254,226,59,221,255,95,149,192,0,81,118,52,255,33,43,215,1,14,147,75,255,89,156,121,254,14,18,79,0,147,208,139,1,151,218,62,255,156,88,8,1,210,184,98,255,20,175,123,255,102,83,229,0,220,65,116,1,150,250,4,255,92,142,220,255,34,247,66,255,204,225,179,254,151,81,151,0,71,40,236,255,138,63,62,0,6,79,240,255,183,185,181,0,118,50,27,0,63,227,192,0,123,99,58,1,50,224,155,255,17,225,223,254,220,224,77,255,14,44,123,1,141,128,175,0,248,212,200,0,150,59,183,255,147,97,29,0,150,204,181,0,253,37,71,0,145,85,119,0,154,200,186,0,2,128,249,255,83,24,124,0,14,87,143,0,168,51,245,1,124,151,231,255,208,240,197,1,124,190,185,0,48,58,246,0,20,233,232,0,125,18,98,255,13,254,31,255,245,177,130,255,108,142,35,0,171,125,242,254,140,12,34,255,165,161,162,0,206,205,101,0,247,25,34,1,100,145,57,0,39,70,57,0,118,204,203,255,242,0,162,0,165,244,30,0,198,116,226,0,128,111,153,255,140,54,182,1,60,122,15,255,155,58,57,1,54,50,198,0,171,211,29,255,107,138,167,255,173,107,199,255,109,161,193,0,89,72,242,255,206,115,89,255,250,254,142,254,177,202,94,255,81,89,50,0,7,105,66,255,25,254,255,254,203,64,23,255,79,222,108,255,39,249,75,0,241,124,50,0,239,152,133,0,221,241,105,0,147,151,98,0,213,161,121,254,242,49,137,0,233,37,249,254,42,183,27,0,184,119,230,255,217,32,163,255,208,251,228,1,137,62,131,255,79,64,9,254,94,48,113,0,17,138,50,254,193,255,22,0,247,18,197,1,67,55,104,0,16,205,95,255,48,37,66,0,55,156,63,1,64,82,74,255,200,53,71,254,239,67,125,0,26,224,222,0,223,137,93,255,30,224,202,255,9,220,132,0,198,38,235,1,102,141,86,0,60,43,81,1,136,28,26,0,233,36,8,254,207,242,148,0,164,162,63,0,51,46,224,255,114,48,79,255,9,175,226,0,222,3,193,255,47,160,232,255,255,93,105,254,14,42,230,0,26,138,82,1,208,43,244,0,27,39,38,255,98,208,127,255,64,149,182,255,5,250,209,0,187,60,28,254,49,25,218,255,169,116,205,255,119,18,120,0,156,116,147,255,132,53,109,255,13,10,202,0,110,83,167,0,157,219,137,255,6,3,130,255,50,167,30,255,60,159,47,255,129,128,157,254,94,3,189,0,3,166,68,0,83,223,215,0,150,90,194,1,15,168,65,0,227,83,51,255,205,171,66,255,54,187,60,1,152,102,45,255,119,154,225,0,240,247,136,0,100,197,178,255,139,71,223,255,204,82,16,1,41,206,42,255,156,192,221,255,216,123,244,255,218,218,185,255,187,186,239,255,252,172,160,255,195,52,22,0,144,174,181,254,187,100,115,255,211,78,176,255,27,7,193,0,147,213,104,255,90,201,10,255,80,123,66,1,22,33,186,0,1,7,99,254,30,206,10,0,229,234,5,0,53,30,210,0,138,8,220,254,71,55,167,0,72,225,86,1,118,190,188,0,254,193,101,1,171,249,172,255,94,158,183,254,93,2,108,255,176,93,76,255,73,99,79,255,74,64,129,254,246,46,65,0,99,241,127,254,246,151,102,255,44,53,208,254,59,102,234,0,154,175,164,255,88,242,32,0,111,38,1,0,255,182,190,255,115,176,15,254,169,60,129,0,122,237,241,0,90,76,63,0,62,74,120,255,122,195,110,0,119,4,178,0,222,242,210,0,130,33,46,254,156,40,41,0,167,146,112,1,49,163,111,255,121,176,235,0,76,207,14,255,3,25,198,1,41,235,213,0,85,36,214,1,49,92,109,255,200,24,30,254,168,236,195,0,145,39,124,1,236,195,149,0,90,36,184,255,67,85,170,255,38,35,26,254,131,124,68,255,239,155,35,255,54,201,164,0,196,22,117,255,49,15,205,0,24,224,29,1,126,113,144,0,117,21,182,0,203,159,141,0,223,135,77,0,176,230,176,255,190,229,215,255,99,37,181,255,51,21,138,255,25,189,89,255,49,48,165,254,152,45,247,0,170,108,222,0,80,202,5,0,27,69,103,254,204,22,129,255,180,252,62,254,210,1,91,255,146,110,254,255,219,162,28,0,223,252,213,1,59,8,33,0,206,16,244,0,129,211,48,0,107,160,208,0,112,59,209,0,109,77,216,254,34,21,185,255,246,99,56,255,179,139,19,255,185,29,50,255,84,89,19,0,74,250,98,255,225,42,200,255,192,217,205,255,210,16,167,0,99,132,95,1,43,230,57,0,254,11,203,255,99,188,63,255,119,193,251,254,80,105,54,0,232,181,189,1,183,69,112,255,208,171,165,255,47,109,180,255,123,83,165,0,146,162,52,255,154,11,4,255,151,227,90,255,146,137,97,254,61,233,41,255,94,42,55,255,108,164,236,0,152,68,254,0,10,140,131,255,10,106,79,254,243,158,137,0,67,178,66,254,177,123,198,255,15,62,34,0,197,88,42,255,149,95,177,255,152,0,198,255,149,254,113,255,225,90,163,255,125,217,247,0,18,17,224,0,128,66,120,254,192,25,9,255,50,221,205,0,49,212,70,0,233,255,164,0,2,209,9,0,221,52,219,254,172,224,244,255,94,56,206,1,242,179,2,255,31,91,164,1,230,46,138,255,189,230,220,0,57,47,61,255,111,11,157,0,177,91,152,0,28,230,98,0,97,87,126,0,198,89,145,255,167,79,107,0,249,77,160,1,29,233,230,255,150,21,86,254,60,11,193,0,151,37,36,254,185,150,243,255,228,212,83,1,172,151,180,0,201,169,155,0,244,60,234,0,142,235,4,1,67,218,60,0,192,113,75,1,116,243,207,255,65,172,155,0,81,30,156,255,80,72,33,254,18,231,109,255,142,107,21,254,125,26,132,255,176,16,59,255,150,201,58,0,206,169,201,0,208,121,226,0,40,172,14,255,150,61,94,255,56,57,156,255,141,60,145,255,45,108,149,255,238,145,155,255,209,85,31,254,192,12,210,0,99,98,93,254,152,16,151,0,225,185,220,0,141,235,44,255,160,172,21,254,71,26,31,255,13,64,93,254,28,56,198,0,177,62,248,1,182,8,241,0,166,101,148,255,78,81,133,255,129,222,215,1,188,169,129,255,232,7,97,0,49,112,60,255,217,229,251,0,119,108,138,0,39,19,123,254,131,49,235,0,132,84,145,0,130,230,148,255,25,74,187,0,5,245,54,255,185,219,241,1,18,194,228,255,241,202,102,0,105,113,202,0,155,235,79,0,21,9,178,255,156,1,239,0,200,148,61,0,115,247,210,255,49,221,135,0,58,189,8,1,35,46,9,0,81,65,5,255,52,158,185,255,125,116,46,255,74,140,13,255,210,92,172,254,147,23,71,0,217,224,253,254,115,108,180,255,145,58,48,254,219,177,24,255,156,255,60,1,154,147,242,0,253,134,87,0,53,75,229,0,48,195,222,255,31,175,50,255,156,210,120,255,208,35,222,255,18,248,179,1,2,10,101,255,157,194,248,255,158,204,101,255,104,254,197,255,79,62,4,0,178,172,101,1,96,146,251,255,65,10,156,0,2,137,165,255,116,4,231,0,242,215,1,0,19,35,29,255,43,161,79,0,59,149,246,1,251,66,176,0,200,33,3,255,80,110,142,255,195,161,17,1,228,56,66,255,123,47,145,254,132,4,164,0,67,174,172,0,25,253,114,0,87,97,87,1,250,220,84,0,96,91,200,255,37,125,59,0,19,65,118,0,161,52,241,255,237,172,6,255,176,191,255,255,1,65,130,254,223,190,230,0,101,253,231,255,146,35,109,0,250,29,77,1,49,0,19,0,123,90,155,1,22,86,32,255,218,213,65,0,111,93,127,0,60,93,169,255,8,127,182,0,17,186,14,254,253,137,246,255,213,25,48,254,76,238,0,255,248,92,70,255,99,224,139,0,184,9,255,1,7,164,208,0,205,131,198,1,87,214,199,0,130,214,95,0,221,149,222,0,23,38,171,254,197,110,213,0,43,115,140,254,215,177,118,0,96,52,66,1,117,158,237,0,14,64,182,255,46,63,174,255,158,95,190,255,225,205,177,255,43,5,142,255,172,99,212,255,244,187,147,0,29,51,153,255,228,116,24,254,30,101,207,0,19,246,150,255,134,231,5,0,125,134,226,1,77,65,98,0,236,130,33,255,5,110,62,0,69,108,127,255,7,113,22,0,145,20,83,254,194,161,231,255,131,181,60,0,217,209,177,255,229,148,212,254,3,131,184,0,117,177,187,1,28,14,31,255,176,102,80,0,50,84,151,255,125,31,54,255,21,157,133,255,19,179,139,1,224,232,26,0,34,117,170,255,167,252,171,255,73,141,206,254,129,250,35,0,72,79,236,1,220,229,20,255,41,202,173,255,99,76,238,255,198,22,224,255,108,198,195,255,36,141,96,1,236,158,59,255,106,100,87,0,110,226,2,0,227,234,222,0,154,93,119,255,74,112,164,255,67,91,2,255,21,145,33,255,102,214,137,255,175,230,103,254,163,246,166,0,93,247,116,254,167,224,28,255,220,2,57,1,171,206,84,0,123,228,17,255,27,120,119,0,119,11,147,1,180,47,225,255,104,200,185,254,165,2,114,0,77,78,212,0,45,154,177,255,24,196,121,254,82,157,182,0,90,16,190,1,12,147,197,0,95,239,152,255,11,235,71,0,86,146,119,255,172,134,214,0,60,131,196,0,161,225,129,0,31,130,120,254,95,200,51,0,105,231,210,255,58,9,148,255,43,168,221,255,124,237,142,0,198,211,50,254,46,245,103,0,164,248,84,0,152,70,208,255,180,117,177,0,70,79,185,0,243,74,32,0,149,156,207,0,197,196,161,1,245,53,239,0,15,93,246,254,139,240,49,255,196,88,36,255,162,38,123,0,128,200,157,1,174,76,103,255,173,169,34,254,216,1,171,255,114,51,17,0,136,228,194,0,110,150,56,254,106,246,159,0,19,184,79,255,150,77,240,255,155,80,162,0,0,53,169,255,29,151,86,0,68,94,16,0,92,7,110,254,98,117,149,255,249,77,230,255,253,10,140,0,214,124,92,254,35,118,235,0,89,48,57,1,22,53,166,0,184,144,61,255,179,255,194,0,214,248,61,254,59,110,246,0,121,21,81,254,166,3,228,0,106,64,26,255,69,232,134,255,242,220,53,254,46,220,85,0,113,149,247,255,97,179,103,255,190,127,11,0,135,209,182,0,95,52,129,1,170,144,206,255,122,200,204,255,168,100,146,0,60,144,149,254,70,60,40,0,122,52,177,255,246,211,101,255,174,237,8,0,7,51,120,0,19,31,173,0,126,239,156,255,143,189,203,0,196,128,88,255,233,133,226,255,30,125,173,255,201,108,50,0,123,100,59,255,254,163,3,1,221,148,181,255,214,136,57,254,222,180,137,255,207,88,54,255,28,33,251,255,67,214,52,1,210,208,100,0,81,170,94,0,145,40,53,0,224,111,231,254,35,28,244,255,226,199,195,254,238,17,230,0,217,217,164,254,169,157,221,0,218,46,162,1,199,207,163,255,108,115,162,1,14,96,187,255,118,60,76,0,184,159,152,0,209,231,71,254,42,164,186,255,186,153,51,254,221,171,182,255,162,142,173,0,235,47,193,0,7,139,16,1,95,164,64,255,16,221,166,0,219,197,16,0,132,29,44,255,100,69,117,255,60,235,88,254,40,81,173,0,71,190,61,255,187,88,157,0,231,11,23,0,237,117,164,0,225,168,223,255,154,114,116,255,163,152,242,1,24,32,170,0,125,98,113,254,168,19,76,0,17,157,220,254,155,52,5,0,19,111,161,255,71,90,252,255,173,110,240,0,10,198,121,255,253,255,240,255,66,123,210,0,221,194,215,254,121,163,17,255,225,7,99,0,190,49,182,0,115,9,133,1,232,26,138,255,213,68,132,0,44,119,122,255,179,98,51,0,149,90,106,0,71,50,230,255,10,153,118,255,177,70,25,0,165,87,205,0,55,138,234,0,238,30,97,0,113,155,207,0,98,153,127,0,34,107,219,254,117,114,172,255,76,180,255,254,242,57,179,255,221,34,172,254,56,162,49,255,83,3,255,255,113,221,189,255,188,25,228,254,16,88,89,255,71,28,198,254,22,17,149,255,243,121,254,255,107,202,99,255,9,206,14,1,220,47,153,0,107,137,39,1,97,49,194,255,149,51,197,254,186,58,11,255,107,43,232,1,200,6,14,255,181,133,65,254,221,228,171,255,123,62,231,1,227,234,179,255,34,189,212,254,244,187,249,0,190,13,80,1,130,89,1,0,223,133,173,0,9,222,198,255,66,127,74,0,167,216,93,255,155,168,198,1,66,145,0,0,68,102,46,1,172,90,154,0,216,128,75,255,160,40,51,0,158,17,27,1,124,240,49,0,236,202,176,255,151,124,192,255,38,193,190,0,95,182,61,0,163,147,124,255,255,165,51,255,28,40,17,254,215,96,78,0,86,145,218,254,31,36,202,255,86,9,5,0,111,41,200,255,237,108,97,0,57,62,44,0,117,184,15,1,45,241,116,0,152,1,220,255,157,165,188,0,250,15,131,1,60,44,125,255,65,220,251,255,75,50,184,0,53,90,128,255,231,80,194,255,136,129,127,1,21,18,187,255,45,58,161,255,71,147,34,0,174,249,11,254,35,141,29,0,239,68,177,255,115,110,58,0,238,190,177,1,87,245,166,255,190,49,247,255,146,83,184,255,173,14,39,255,146,215,104,0,142,223,120,0,149,200,155,255,212,207,145,1,16,181,217,0,173,32,87,255,255,35,181,0,119,223,161,1,200,223,94,255,70,6,186,255,192,67,85,255,50,169,152,0,144,26,123,255,56,243,179,254,20,68,136,0,39,140,188,254,253,208,5,255,200,115,135,1,43,172,229,255,156,104,187,0,151,251,167,0,52,135,23,0,151,153,72,0,147,197,107,254,148,158,5,255,238,143,206,0,126,153,137,255,88,152,197,254,7,68,167,0,252,159,165,255,239,78,54,255,24,63,55,255,38,222,94,0,237,183,12,255,206,204,210,0,19,39,246,254,30,74,231,0,135,108,29,1,179,115,0,0,117,118,116,1,132,6,252,255,145,129,161,1,105,67,141,0,82,37,226,255,238,226,228,255,204,214,129,254,162,123,100,255,185,121,234,0,45,108,231,0,66,8,56,255,132,136,128,0,172,224,66,254,175,157,188,0,230,223,226,254,242,219,69,0,184,14,119,1,82,162,56,0,114,123,20,0,162,103,85,255,49,239,99,254,156,135,215,0,111,255,167,254,39,196,214,0,144,38,79,1,249,168,125,0,155,97,156,255,23,52,219,255,150,22,144,0,44,149,165,255,40,127,183,0,196,77,233,255,118,129,210,255,170,135,230,255,214,119,198,0,233,240,35,0,253,52,7,255,117,102,48,255,21,204,154,255,179,136,177,255,23,2,3,1,149,130,89,255,252,17,159,1,70,60,26,0,144,107,17,0,180,190,60,255,56,182,59,255,110,71,54,255,198,18,129,255,149,224,87,255,223,21,152,255,138,22,182,255,250,156,205,0,236,45,208,255,79,148,242,1,101,70,209,0,103,78,174,0,101,144,172,255,152,136,237,1,191,194,136,0,113,80,125,1,152,4,141,0,155,150,53,255,196,116,245,0,239,114,73,254,19,82,17,255,124,125,234,255,40,52,191,0,42,210,158,255,155,132,165,0,178,5,42,1,64,92,40,255,36,85,77,255,178,228,118,0,137,66,96,254,115,226,66,0,110,240,69,254,151,111,80,0,167,174,236,255,227,108,107,255,188,242,65,255,183,81,255,0,57,206,181,255,47,34,181,255,213,240,158,1,71,75,95,0,156,40,24,255,102,210,81,0,171,199,228,255,154,34,41,0,227,175,75,0,21,239,195,0,138,229,95,1,76,192,49,0,117,123,87,1,227,225,130,0,125,62,63,255,2,198,171,0,254,36,13,254,145,186,206,0,148,255,244,255,35,0,166,0,30,150,219,1,92,228,212,0,92,198,60,254,62,133,200,255,201,41,59,0,125,238,109,255,180,163,238,1,140,122,82,0,9,22,88,255,197,157,47,255,153,94,57,0,88,30,182,0,84,161,85,0,178,146,124,0,166,166,7,255,21,208,223,0,156,182,242,0,155,121,185,0,83,156,174,254,154,16,118,255,186,83,232,1,223,58,121,255,29,23,88,0,35,125,127,255,170,5,149,254,164,12,130,255,155,196,29,0,161,96,136,0,7,35,29,1,162,37,251,0,3,46,242,255,0,217,188,0,57,174,226,1,206,233,2,0,57,187,136,254,123,189,9,255,201,117,127,255,186,36,204,0,231,25,216,0,80,78,105,0,19,134,129,255,148,203,68,0,141,81,125,254,248,165,200,255,214,144,135,0,151,55,166,255,38,235,91,0,21,46,154,0,223,254,150,255,35,153,180,255,125,176,29,1,43,98,30,255,216,122,230,255,233,160,12,0,57,185,12,254,240,113,7,255,5,9,16,254,26,91,108,0,109,198,203,0,8,147,40,0,129,134,228,255,124,186,40,255,114,98,132,254,166,132,23,0,99,69,44,0,9,242,238,255,184,53,59,0,132,129,102,255,52,32,243,254,147,223,200,255,123,83,179,254,135,144,201,255,141,37,56,1,151,60,227,255,90,73,156,1,203,172,187,0,80,151,47,255,94,137,231,255,36,191,59,255,225,209,181,255,74,215,213,254,6,118,179,255,153,54,193,1,50,0,231,0,104,157,72,1,140,227,154,255,182,226,16,254,96,225,92,255,115,20,170,254,6,250,78,0,248,75,173,255,53,89,6,255,0,180,118,0,72,173,1,0,64,8,206,1,174,133,223,0,185,62,133,255,214,11,98,0,197,31,208,0,171,167,244,255,22,231,181,1,150,218,185,0,247,169,97,1,165,139,247,255,47,120,149,1,103,248,51,0,60,69,28,254,25,179,196,0,124,7,218,254,58,107,81,0,184,233,156,255,252,74,36,0,118,188,67,0,141,95,53,255,222,94,165,254,46,61,53,0,206,59,115,255,47,236,250,255,74,5,32,1,129,154,238,255,106,32,226,0,121,187,61,255,3,166,241,254,67,170,172,255,29,216,178,255,23,201,252,0,253,110,243,0,200,125,57,0,109,192,96,255,52,115,238,0,38,121,243,255,201,56,33,0,194,118,130,0,75,96,25,255,170,30,230,254,39,63,253,0,36,45,250,255,251,1,239,0,160,212,92,1,45,209,237,0,243,33,87,254,237,84,201,255,212,18,157,254,212,99,127,255,217,98,16,254,139,172,239,0,168,201,130,255,143,193,169,255,238,151,193,1,215,104,41,0,239,61,165,254,2,3,242,0,22,203,177,254,177,204,22,0,149,129,213,254,31,11,41,255,0,159,121,254,160,25,114,255,162,80,200,0,157,151,11,0,154,134,78,1,216,54,252,0,48,103,133,0,105,220,197,0,253,168,77,254,53,179,23,0,24,121,240,1,255,46,96,255,107,60,135,254,98,205,249,255,63,249,119,255,120,59,211,255,114,180,55,254,91,85,237,0,149,212,77,1,56,73,49,0,86,198,150,0,93,209,160,0,69,205,182,255,244,90,43,0,20,36,176,0,122,116,221,0,51,167,39,1,231,1,63,255,13,197,134,0,3,209,34,255,135,59,202,0,167,100,78,0,47,223,76,0,185,60,62,0,178,166,123,1,132,12,161,255,61,174,43,0,195,69,144,0,127,47,191,1,34,44,78,0,57,234,52,1,255,22,40,255,246,94,146,0,83,228,128,0,60,78,224,255,0,96,210,255,153,175,236,0,159,21,73,0,180,115,196,254,131,225,106,0,255,167,134,0,159,8,112,255,120,68,194,255,176,196,198,255,118,48,168,255,93,169,1,0,112,200,102,1,74,24,254,0,19,141,4,254,142,62,63,0,131,179,187,255,77,156,155,255,119,86,164,0,170,208,146,255,208,133,154,255,148,155,58,255,162,120,232,254,252,213,155,0,241,13,42,0,94,50,131,0,179,170,112,0,140,83,151,255,55,119,84,1,140,35,239,255,153,45,67,1,236,175,39,0,54,151,103,255,158,42,65,255,196,239,135,254,86,53,203,0,149,97,47,254,216,35,17,255,70,3,70,1,103,36,90,255,40,26,173,0,184,48,13,0,163,219,217,255,81,6,1,255,221,170,108,254,233,208,93,0,100,201,249,254,86,36,35,255,209,154,30,1,227,201,251,255,2,189,167,254,100,57,3,0,13,128,41,0,197,100,75,0,150,204,235,255,145,174,59,0,120,248,149,255,85,55,225,0,114,210,53,254,199,204,119,0,14,247,74,1,63,251,129,0,67,104,151,1,135,130,80,0,79,89,55,255,117,230,157,255,25,96,143,0,213,145,5,0,69,241,120,1,149,243,95,255,114,42,20,0,131,72,2,0,154,53,20,255,73,62,109,0,196,102,152,0,41,12,204,255,122,38,11,1,250,10,145,0,207,125,148,0,246,244,222,255,41,32,85,1,112,213,126,0,162,249,86,1,71,198,127,255,81,9,21,1,98,39,4,255,204,71,45,1,75,111,137,0,234,59,231,0,32,48,95,255,204,31,114,1,29,196,181,255,51,241,167,254,93,109,142,0,104,144,45,0,235,12,181,255,52,112,164,0,76,254,202,255,174,14,162,0,61,235,147,255,43,64,185,254,233,125,217,0,243,88,167,254,74,49,8,0,156,204,66,0,124,214,123,0,38,221,118,1,146,112,236,0,114,98,177,0,151,89,199,0,87,197,112,0,185,149,161,0,44,96,165,0,248,179,20,255,188,219,216,254,40,62,13,0,243,142,141,0,229,227,206,255,172,202,35,255,117,176,225,255,82,110,38,1,42,245,14,255,20,83,97,0,49,171,10,0,242,119,120,0,25,232,61,0,212,240,147,255,4,115,56,255,145,17,239,254,202,17,251,255,249,18,245,255,99,117,239,0,184,4,179,255,246,237,51,255,37,239,137,255,166,112,166,255,81,188,33,255,185,250,142,255,54,187,173,0,208,112,201,0,246,43,228,1,104,184,88,255,212,52,196,255,51,117,108,255,254,117,155,0,46,91,15,255,87,14,144,255,87,227,204,0,83,26,83,1,159,76,227,0,159,27,213,1,24,151,108,0,117,144,179,254,137,209,82,0,38,159,10,0,115,133,201,0,223,182,156,1,110,196,93,255,57,60,233,0,5,167,105,255,154,197,164,0,96,34,186,255,147,133,37,1,220,99,190,0,1,167,84,255,20,145,171,0,194,197,251,254,95,78,133,255,252,248,243,255,225,93,131,255,187,134,196,255,216,153,170,0,20,118,158,254,140,1,118,0,86,158,15,1,45,211,41,255,147,1,100,254,113,116,76,255,211,127,108,1,103,15,48,0,193,16,102,1,69,51,95,255,107,128,157,0,137,171,233,0,90,124,144,1,106,161,182,0,175,76,236,1,200,141,172,255,163,58,104,0,233,180,52,255,240,253,14,255,162,113,254,255,38,239,138,254,52,46,166,0,241,101,33,254,131,186,156,0,111,208,62,255,124,94,160,255,31,172,254,0,112,174,56,255,188,99,27,255,67,138,251,0,125,58,128,1,156,152,174,255,178,12,247,255,252,84,158,0,82,197,14,254,172,200,83,255,37,39,46,1,106,207,167,0,24,189,34,0,131,178,144,0,206,213,4,0,161,226,210,0,72,51,105,255,97,45,187,255,78,184,223,255,176,29,251,0,79,160,86,255,116,37,178,0,82,77,213,1,82,84,141,255,226,101,212,1,175,88,199,255,245,94,247,1,172,118,109,255,166,185,190,0,131,181,120,0,87,254,93,255,134,240,73,255,32,245,143,255,139,162,103,255,179,98,18,254,217,204,112,0,147,223,120,255,53,10,243,0,166,140,150,0,125,80,200,255,14,109,219,255,91,218,1,255,252,252,47,254,109,156,116,255,115,49,127,1,204,87,211,255,148,202,217,255,26,85,249,255,14,245,134,1,76,89,169,255,242,45,230,0,59,98,172,255,114,73,132,254,78,155,49,255,158,126,84,0,49,175,43,255,16,182,84,255,157,103,35,0,104,193,109,255,67,221,154,0,201,172,1,254,8,162,88,0,165,1,29,255,125,155,229,255,30,154,220,1,103,239,92,0,220,1,109,255,202,198,1,0,94,2,142,1,36,54,44,0,235,226,158,255,170,251,214,255,185,77,9,0,97,74,242,0,219,163,149,255,240,35,118,255,223,114,88,254,192,199,3,0,106,37,24,255,201,161,118,255,97,89,99,1,224,58,103,255,101,199,147,254,222,60,99,0,234,25,59,1,52,135,27,0,102,3,91,254,168,216,235,0,229,232,136,0,104,60,129,0,46,168,238,0,39,191,67,0,75,163,47,0,143,97,98,255,56,216,168,1,168,233,252,255,35,111,22,255,92,84,43,0,26,200,87,1,91,253,152,0,202,56,70,0,142,8,77,0,80,10,175,1,252,199,76,0,22,110,82,255,129,1,194,0,11,128,61,1,87,14,145,255,253,222,190,1,15,72,174,0,85,163,86,254,58,99,44,255,45,24,188,254,26,205,15,0,19,229,210,254,248,67,195,0,99,71,184,0,154,199,37,255,151,243,121,255,38,51,75,255,201,85,130,254,44,65,250,0,57,147,243,254,146,43,59,255,89,28,53,0,33,84,24,255,179,51,18,254,189,70,83,0,11,156,179,1,98,134,119,0,158,111,111,0,119,154,73,255,200,63,140,254,45,13,13,255,154,192,2,254,81,72,42,0,46,160,185,254,44,112,6,0,146,215,149,1,26,176,104,0,68,28,87,1,236,50,153,255,179,128,250,254,206,193,191,255,166,92,137,254,53,40,239,0,210,1,204,254,168,173,35,0,141,243,45,1,36,50,109,255,15,242,194,255,227,159,122,255,176,175,202,254,70,57,72,0,40,223,56,0,208,162,58,255,183,98,93,0,15,111,12,0,30,8,76,255,132,127,246,255,45,242,103,0,69,181,15,255,10,209,30,0,3,179,121,0,241,232,218,1,123,199,88,255,2,210,202,1,188,130,81,255,94,101,208,1,103,36,45,0,76,193,24,1,95,26,241,255,165,162,187,0,36,114,140,0,202,66,5,255,37,56,147,0,152,11,243,1,127,85,232,255,250,135,212,1,185,177,113,0,90,220,75,255,69,248,146,0,50,111,50,0,92,22,80,0,244,36,115,254,163,100,82,255,25,193,6,1,127,61,36,0,253,67,30,254,65,236,170,255,161,17,215,254,63,175,140,0,55,127,4,0,79,112,233,0,109,160,40,0,143,83,7,255,65,26,238,255,217,169,140,255,78,94,189,255,0,147,190,255,147,71,186,254,106,77,127,255,233,157,233,1,135,87,237,255,208,13,236,1,155,109,36,255,180,100,218,0,180,163,18,0,190,110,9,1,17,63,123,255,179,136,180,255,165,123,123,255,144,188,81,254,71,240,108,255,25,112,11,255,227,218,51,255,167,50,234,255,114,79,108,255,31,19,115,255,183,240,99,0,227,87,143,255,72,217,248,255,102,169,95,1,129,149,149,0,238,133,12,1,227,204,35,0,208,115,26,1,102,8,234,0,112,88,143,1,144,249,14,0,240,158,172,254,100,112,119,0,194,141,153,254,40,56,83,255,121,176,46,0,42,53,76,255,158,191,154,0,91,209,92,0,173,13,16,1,5,72,226,255,204,254,149,0,80,184,207,0,100,9,122,254,118,101,171,255,252,203,0,254,160,207,54,0,56,72,249,1,56,140,13,255,10,64,107,254,91,101,52,255,225,181,248,1,139,255,132,0,230,145,17,0,233,56,23,0,119,1,241,255,213,169,151,255,99,99,9,254,185,15,191,255,173,103,109,1,174,13,251,255,178,88,7,254,27,59,68,255,10,33,2,255,248,97,59,0,26,30,146,1,176,147,10,0,95,121,207,1,188,88,24,0,185,94,254,254,115,55,201,0,24,50,70,0,120,53,6,0,142,66,146,0,228,226,249,255,104,192,222,1,173,68,219,0,162,184,36,255,143,102,137,255,157,11,23,0,125,45,98,0,235,93,225,254,56,112,160,255,70,116,243,1,153,249,55,255,129,39,17,1,241,80,244,0,87,69,21,1,94,228,73,255,78,66,65,255,194,227,231,0,61,146,87,255,173,155,23,255,112,116,219,254,216,38,11,255,131,186,133,0,94,212,187,0,100,47,91,0,204,254,175,255,222,18,215,254,173,68,108,255,227,228,79,255,38,221,213,0,163,227,150,254,31,190,18,0,160,179,11,1,10,90,94,255,220,174,88,0,163,211,229,255,199,136,52,0,130,95,221,255,140,188,231,254,139,113,128,255,117,171,236,254,49,220,20,255,59,20,171,255,228,109,188,0,20,225,32,254,195,16,174,0,227,254,136,1,135,39,105,0,150,77,206,255,210,238,226],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+10240);allocate([55,212,132,254,239,57,124,0,170,194,93,255,249,16,247,255,24,151,62,255,10,151,10,0,79,139,178,255,120,242,202,0,26,219,213,0,62,125,35,255,144,2,108,255,230,33,83,255,81,45,216,1,224,62,17,0,214,217,125,0,98,153,153,255,179,176,106,254,131,93,138,255,109,62,36,255,178,121,32,255,120,252,70,0,220,248,37,0,204,88,103,1,128,220,251,255,236,227,7,1,106,49,198,255,60,56,107,0,99,114,238,0,220,204,94,1,73,187,1,0,89,154,34,0,78,217,165,255,14,195,249,255,9,230,253,255,205,135,245,0,26,252,7,255,84,205,27,1,134,2,112,0,37,158,32,0,231,91,237,255,191,170,204,255,152,7,222,0,109,192,49,0,193,166,146,255,232,19,181,255,105,142,52,255,103,16,27,1,253,200,165,0,195,217,4,255,52,189,144,255,123,155,160,254,87,130,54,255,78,120,61,255,14,56,41,0,25,41,125,255,87,168,245,0,214,165,70,0,212,169,6,255,219,211,194,254,72,93,164,255,197,33,103,255,43,142,141,0,131,225,172,0,244,105,28,0,68,68,225,0,136,84,13,255,130,57,40,254,139,77,56,0,84,150,53,0,54,95,157,0,144,13,177,254,95,115,186,0,117,23,118,255,244,166,241,255,11,186,135,0,178,106,203,255,97,218,93,0,43,253,45,0,164,152,4,0,139,118,239,0,96,1,24,254,235,153,211,255,168,110,20,255,50,239,176,0,114,41,232,0,193,250,53,0,254,160,111,254,136,122,41,255,97,108,67,0,215,152,23,255,140,209,212,0,42,189,163,0,202,42,50,255,106,106,189,255,190,68,217,255,233,58,117,0,229,220,243,1,197,3,4,0,37,120,54,254,4,156,134,255,36,61,171,254,165,136,100,255,212,232,14,0,90,174,10,0,216,198,65,255,12,3,64,0,116,113,115,255,248,103,8,0,231,125,18,255,160,28,197,0,30,184,35,1,223,73,249,255,123,20,46,254,135,56,37,255,173,13,229,1,119,161,34,255,245,61,73,0,205,125,112,0,137,104,134,0,217,246,30,255,237,142,143,0,65,159,102,255,108,164,190,0,219,117,173,255,34,37,120,254,200,69,80,0,31,124,218,254,74,27,160,255,186,154,199,255,71,199,252,0,104,81,159,1,17,200,39,0,211,61,192,1,26,238,91,0,148,217,12,0,59,91,213,255,11,81,183,255,129,230,122,255,114,203,145,1,119,180,66,255,72,138,180,0,224,149,106,0,119,82,104,255,208,140,43,0,98,9,182,255,205,101,134,255,18,101,38,0,95,197,166,255,203,241,147,0,62,208,145,255,133,246,251,0,2,169,14,0,13,247,184,0,142,7,254,0,36,200,23,255,88,205,223,0,91,129,52,255,21,186,30,0,143,228,210,1,247,234,248,255,230,69,31,254,176,186,135,255,238,205,52,1,139,79,43,0,17,176,217,254,32,243,67,0,242,111,233,0,44,35,9,255,227,114,81,1,4,71,12,255,38,105,191,0,7,117,50,255,81,79,16,0,63,68,65,255,157,36,110,255,77,241,3,255,226,45,251,1,142,25,206,0,120,123,209,1,28,254,238,255,5,128,126,255,91,222,215,255,162,15,191,0,86,240,73,0,135,185,81,254,44,241,163,0,212,219,210,255,112,162,155,0,207,101,118,0,168,72,56,255,196,5,52,0,72,172,242,255,126,22,157,255,146,96,59,255,162,121,152,254,140,16,95,0,195,254,200,254,82,150,162,0,119,43,145,254,204,172,78,255,166,224,159,0,104,19,237,255,245,126,208,255,226,59,213,0,117,217,197,0,152,72,237,0,220,31,23,254,14,90,231,255,188,212,64,1,60,101,246,255,85,24,86,0,1,177,109,0,146,83,32,1,75,182,192,0,119,241,224,0,185,237,27,255,184,101,82,1,235,37,77,255,253,134,19,0,232,246,122,0,60,106,179,0,195,11,12,0,109,66,235,1,125,113,59,0,61,40,164,0,175,104,240,0,2,47,187,255,50,12,141,0,194,139,181,255,135,250,104,0,97,92,222,255,217,149,201,255,203,241,118,255,79,151,67,0,122,142,218,255,149,245,239,0,138,42,200,254,80,37,97,255,124,112,167,255,36,138,87,255,130,29,147,255,241,87,78,255,204,97,19,1,177,209,22,255,247,227,127,254,99,119,83,255,212,25,198,1,16,179,179,0,145,77,172,254,89,153,14,255,218,189,167,0,107,233,59,255,35,33,243,254,44,112,112,255,161,127,79,1,204,175,10,0,40,21,138,254,104,116,228,0,199,95,137,255,133,190,168,255,146,165,234,1,183,99,39,0,183,220,54,254,255,222,133,0,162,219,121,254,63,239,6,0,225,102,54,255,251,18,246,0,4,34,129,1,135,36,131,0,206,50,59,1,15,97,183,0,171,216,135,255,101,152,43,255,150,251,91,0,38,145,95,0,34,204,38,254,178,140,83,255,25,129,243,255,76,144,37,0,106,36,26,254,118,144,172,255,68,186,229,255,107,161,213,255,46,163,68,255,149,170,253,0,187,17,15,0,218,160,165,255,171,35,246,1,96,13,19,0,165,203,117,0,214,107,192,255,244,123,177,1,100,3,104,0,178,242,97,255,251,76,130,255,211,77,42,1,250,79,70,255,63,244,80,1,105,101,246,0,61,136,58,1,238,91,213,0,14,59,98,255,167,84,77,0,17,132,46,254,57,175,197,255,185,62,184,0,76,64,207,0,172,175,208,254,175,74,37,0,138,27,211,254,148,125,194,0,10,89,81,0,168,203,101,255,43,213,209,1,235,245,54,0,30,35,226,255,9,126,70,0,226,125,94,254,156,117,20,255,57,248,112,1,230,48,64,255,164,92,166,1,224,214,230,255,36,120,143,0,55,8,43,255,251,1,245,1,106,98,165,0,74,107,106,254,53,4,54,255,90,178,150,1,3,120,123,255,244,5,89,1,114,250,61,255,254,153,82,1,77,15,17,0,57,238,90,1,95,223,230,0,236,52,47,254,103,148,164,255,121,207,36,1,18,16,185,255,75,20,74,0,187,11,101,0,46,48,129,255,22,239,210,255,77,236,129,255,111,77,204,255,61,72,97,255,199,217,251,255,42,215,204,0,133,145,201,255,57,230,146,1,235,100,198,0,146,73,35,254,108,198,20,255,182,79,210,255,82,103,136,0,246,108,176,0,34,17,60,255,19,74,114,254,168,170,78,255,157,239,20,255,149,41,168,0,58,121,28,0,79,179,134,255,231,121,135,255,174,209,98,255,243,122,190,0,171,166,205,0,212,116,48,0,29,108,66,255,162,222,182,1,14,119,21,0,213,39,249,255,254,223,228,255,183,165,198,0,133,190,48,0,124,208,109,255,119,175,85,255,9,209,121,1,48,171,189,255,195,71,134,1,136,219,51,255,182,91,141,254,49,159,72,0,35,118,245,255,112,186,227,255,59,137,31,0,137,44,163,0,114,103,60,254,8,213,150,0,162,10,113,255,194,104,72,0,220,131,116,255,178,79,92,0,203,250,213,254,93,193,189,255,130,255,34,254,212,188,151,0,136,17,20,255,20,101,83,255,212,206,166,0,229,238,73,255,151,74,3,255,168,87,215,0,155,188,133,255,166,129,73,0,240,79,133,255,178,211,81,255,203,72,163,254,193,168,165,0,14,164,199,254,30,255,204,0,65,72,91,1,166,74,102,255,200,42,0,255,194,113,227,255,66,23,208,0,229,216,100,255,24,239,26,0,10,233,62,255,123,10,178,1,26,36,174,255,119,219,199,1,45,163,190,0,16,168,42,0,166,57,198,255,28,26,26,0,126,165,231,0,251,108,100,255,61,229,121,255,58,118,138,0,76,207,17,0,13,34,112,254,89,16,168,0,37,208,105,255,35,201,215,255,40,106,101,254,6,239,114,0,40,103,226,254,246,127,110,255,63,167,58,0,132,240,142,0,5,158,88,255,129,73,158,255,94,89,146,0,230,54,146,0,8,45,173,0,79,169,1,0,115,186,247,0,84,64,131,0,67,224,253,255,207,189,64,0,154,28,81,1,45,184,54,255,87,212,224,255,0,96,73,255,129,33,235,1,52,66,80,255,251,174,155,255,4,179,37,0,234,164,93,254,93,175,253,0,198,69,87,255,224,106,46,0,99,29,210,0,62,188,114,255,44,234,8,0,169,175,247,255,23,109,137,255,229,182,39,0,192,165,94,254,245,101,217,0,191,88,96,0,196,94,99,255,106,238,11,254,53,126,243,0,94,1,101,255,46,147,2,0,201,124,124,255,141,12,218,0,13,166,157,1,48,251,237,255,155,250,124,255,106,148,146,255,182,13,202,0,28,61,167,0,217,152,8,254,220,130,45,255,200,230,255,1,55,65,87,255,93,191,97,254,114,251,14,0,32,105,92,1,26,207,141,0,24,207,13,254,21,50,48,255,186,148,116,255,211,43,225,0,37,34,162,254,164,210,42,255,68,23,96,255,182,214,8,255,245,117,137,255,66,195,50,0,75,12,83,254,80,140,164,0,9,165,36,1,228,110,227,0,241,17,90,1,25,52,212,0,6,223,12,255,139,243,57,0,12,113,75,1,246,183,191,255,213,191,69,255,230,15,142,0,1,195,196,255,138,171,47,255,64,63,106,1,16,169,214,255,207,174,56,1,88,73,133,255,182,133,140,0,177,14,25,255,147,184,53,255,10,227,161,255,120,216,244,255,73,77,233,0,157,238,139,1,59,65,233,0,70,251,216,1,41,184,153,255,32,203,112,0,146,147,253,0,87,101,109,1,44,82,133,255,244,150,53,255,94,152,232,255,59,93,39,255,88,147,220,255,78,81,13,1,32,47,252,255,160,19,114,255,93,107,39,255,118,16,211,1,185,119,209,255,227,219,127,254,88,105,236,255,162,110,23,255,36,166,110,255,91,236,221,255,66,234,116,0,111,19,244,254,10,233,26,0,32,183,6,254,2,191,242,0,218,156,53,254,41,60,70,255,168,236,111,0,121,185,126,255,238,142,207,255,55,126,52,0,220,129,208,254,80,204,164,255,67,23,144,254,218,40,108,255,127,202,164,0,203,33,3,255,2,158,0,0,37,96,188,255,192,49,74,0,109,4,0,0,111,167,10,254,91,218,135,255,203,66,173,255,150,194,226,0,201,253,6,255,174,102,121,0,205,191,110,0,53,194,4,0,81,40,45,254,35,102,143,255,12,108,198,255,16,27,232,255,252,71,186,1,176,110,114,0,142,3,117,1,113,77,142,0,19,156,197,1,92,47,252,0,53,232,22,1,54,18,235,0,46,35,189,255,236,212,129,0,2,96,208,254,200,238,199,255,59,175,164,255,146,43,231,0,194,217,52,255,3,223,12,0,138,54,178,254,85,235,207,0,232,207,34,0,49,52,50,255,166,113,89,255,10,45,216,255,62,173,28,0,111,165,246,0,118,115,91,255,128,84,60,0,167,144,203,0,87,13,243,0,22,30,228,1,177,113,146,255,129,170,230,254,252,153,129,255,145,225,43,0,70,231,5,255,122,105,126,254,86,246,148,255,110,37,154,254,209,3,91,0,68,145,62,0,228,16,165,255,55,221,249,254,178,210,91,0,83,146,226,254,69,146,186,0,93,210,104,254,16,25,173,0,231,186,38,0,189,122,140,255,251,13,112,255,105,110,93,0,251,72,170,0,192,23,223,255,24,3,202,1,225,93,228,0,153,147,199,254,109,170,22,0,248,101,246,255,178,124,12,255,178,254,102,254,55,4,65,0,125,214,180,0,183,96,147,0,45,117,23,254,132,191,249,0,143,176,203,254,136,183,54,255,146,234,177,0,146,101,86,255,44,123,143,1,33,209,152,0,192,90,41,254,83,15,125,255,213,172,82,0,215,169,144,0,16,13,34,0,32,209,100,255,84,18,249,1,197,17,236,255,217,186,230,0,49,160,176,255,111,118,97,255,237,104,235,0,79,59,92,254,69,249,11,255,35,172,74,1,19,118,68,0,222,124,165,255,180,66,35,255,86,174,246,0,43,74,111,255,126,144,86,255,228,234,91,0,242,213,24,254,69,44,235,255,220,180,35,0,8,248,7,255,102,47,92,255,240,205,102,255,113,230,171,1,31,185,201,255,194,246,70,255,122,17,187,0,134,70,199,255,149,3,150,255,117,63,103,0,65,104,123,255,212,54,19,1,6,141,88,0,83,134,243,255,136,53,103,0,169,27,180,0,177,49,24,0,111,54,167,0,195,61,215,255,31,1,108,1,60,42,70,0,185,3,162,255,194,149,40,255,246,127,38,254,190,119,38,255,61,119,8,1,96,161,219,255,42,203,221,1,177,242,164,255,245,159,10,0,116,196,0,0,5,93,205,254,128,127,179,0,125,237,246,255,149,162,217,255,87,37,20,254,140,238,192,0,9,9,193,0,97,1,226,0,29,38,10,0,0,136,63,255,229,72,210,254,38,134,92,255,78,218,208,1,104,36,84,255,12,5,193,255,242,175,61,255,191,169,46,1,179,147,147,255,113,190,139,254,125,172,31,0,3,75,252,254,215,36,15,0,193,27,24,1,255,69,149,255,110,129,118,0,203,93,249,0,138,137,64,254,38,70,6,0,153,116,222,0,161,74,123,0,193,99,79,255,118,59,94,255,61,12,43,1,146,177,157,0,46,147,191,0,16,255,38,0,11,51,31,1,60,58,98,255,111,194,77,1,154,91,244,0,140,40,144,1,173,10,251,0,203,209,50,254,108,130,78,0,228,180,90,0,174,7,250,0,31,174,60,0,41,171,30,0,116,99,82,255,118,193,139,255,187,173,198,254,218,111,56,0,185,123,216,0,249,158,52,0,52,180,93,255,201,9,91,255,56,45,166,254,132,155,203,255,58,232,110,0,52,211,89,255,253,0,162,1,9,87,183,0,145,136,44,1,94,122,245,0,85,188,171,1,147,92,198,0,0,8,104,0,30,95,174,0,221,230,52,1,247,247,235,255,137,174,53,255,35,21,204,255,71,227,214,1,232,82,194,0,11,48,227,255,170,73,184,255,198,251,252,254,44,112,34,0,131,101,131,255,72,168,187,0,132,135,125,255,138,104,97,255,238,184,168,255,243,104,84,255,135,216,226,255,139,144,237,0,188,137,150,1,80,56,140,255,86,169,167,255,194,78,25,255,220,17,180,255,17,13,193,0,117,137,212,255,141,224,151,0,49,244,175,0,193,99,175,255,19,99,154,1,255,65,62,255,156,210,55,255,242,244,3,255,250,14,149,0,158,88,217,255,157,207,134,254,251,232,28,0,46,156,251,255,171,56,184,255,239,51,234,0,142,138,131,255,25,254,243,1,10,201,194,0,63,97,75,0,210,239,162,0,192,200,31,1,117,214,243,0,24,71,222,254,54,40,232,255,76,183,111,254,144,14,87,255,214,79,136,255,216,196,212,0,132,27,140,254,131,5,253,0,124,108,19,255,28,215,75,0,76,222,55,254,233,182,63,0,68,171,191,254,52,111,222,255,10,105,77,255,80,170,235,0,143,24,88,255,45,231,121,0,148,129,224,1,61,246,84,0,253,46,219,255,239,76,33,0,49,148,18,254,230,37,69,0,67,134,22,254,142,155,94,0,31,157,211,254,213,42,30,255,4,228,247,254,252,176,13,255,39,0,31,254,241,244,255,255,170,45,10,254,253,222,249,0,222,114,132,0,255,47,6,255,180,163,179,1,84,94,151,255,89,209,82,254,229,52,169,255,213,236,0,1,214,56,228,255,135,119,151,255,112,201,193,0,83,160,53,254,6,151,66,0,18,162,17,0,233,97,91,0,131,5,78,1,181,120,53,255,117,95,63,255,237,117,185,0,191,126,136,255,144,119,233,0,183,57,97,1,47,201,187,255,167,165,119,1,45,100,126,0,21,98,6,254,145,150,95,255,120,54,152,0,209,98,104,0,143,111,30,254,184,148,249,0,235,216,46,0,248,202,148,255,57,95,22,0,242,225,163,0,233,247,232,255,71,171,19,255,103,244,49,255,84,103,93,255,68,121,244,1,82,224,13,0,41,79,43,255,249,206,167,255,215,52,21,254,192,32,22,255,247,111,60,0,101,74,38,255,22,91,84,254,29,28,13,255,198,231,215,254,244,154,200,0,223,137,237,0,211,132,14,0,95,64,206,255,17,62,247,255,233,131,121,1,93,23,77,0,205,204,52,254,81,189,136,0,180,219,138,1,143,18,94,0,204,43,140,254,188,175,219,0,111,98,143,255,151,63,162,255,211,50,71,254,19,146,53,0,146,45,83,254,178,82,238,255,16,133,84,255,226,198,93,255,201,97,20,255,120,118,35,255,114,50,231,255,162,229,156,255,211,26,12,0,114,39,115,255,206,212,134,0,197,217,160,255,116,129,94,254,199,215,219,255,75,223,249,1,253,116,181,255,232,215,104,255,228,130,246,255,185,117,86,0,14,5,8,0,239,29,61,1,237,87,133,255,125,146,137,254,204,168,223,0,46,168,245,0,154,105,22,0,220,212,161,255,107,69,24,255,137,218,181,255,241,84,198,255,130,122,211,255,141,8,153,255,190,177,118,0,96,89,178,0,255,16,48,254,122,96,105,255,117,54,232,255,34,126,105,255,204,67,166,0,232,52,138,255,211,147,12,0,25,54,7,0,44,15,215,254,51,236,45,0,190,68,129,1,106,147,225,0,28,93,45,254,236,141,15,255,17,61,161,0,220,115,192,0,236,145,24,254,111,168,169,0,224,58,63,255,127,164,188,0,82,234,75,1,224,158,134,0,209,68,110,1,217,166,217,0,70,225,166,1,187,193,143,255,16,7,88,255,10,205,140,0,117,192,156,1,17,56,38,0,27,124,108,1,171,215,55,255,95,253,212,0,155,135,168,255,246,178,153,254,154,68,74,0,232,61,96,254,105,132,59,0,33,76,199,1,189,176,130,255,9,104,25,254,75,198,102,255,233,1,112,0,108,220,20,255,114,230,70,0,140,194,133,255,57,158,164,254,146,6,80,255,169,196,97,1,85,183,130,0,70,158,222,1,59,237,234,255,96,25,26,255,232,175,97,255,11,121,248,254,88,35,194,0,219,180,252,254,74,8,227,0,195,227,73,1,184,110,161,255,49,233,164,1,128,53,47,0,82,14,121,255,193,190,58,0,48,174,117,255,132,23,32,0,40,10,134,1,22,51,25,255,240,11,176,255,110,57,146,0,117,143,239,1,157,101,118,255,54,84,76,0,205,184,18,255,47,4,72,255,78,112,85,255,193,50,66,1,93,16,52,255,8,105,134,0,12,109,72,255,58,156,251,0,144,35,204,0,44,160,117,254,50,107,194,0,1,68,165,255,111,110,162,0,158,83,40,254,76,214,234,0,58,216,205,255,171,96,147,255,40,227,114,1,176,227,241,0,70,249,183,1,136,84,139,255,60,122,247,254,143,9,117,255,177,174,137,254,73,247,143,0,236,185,126,255,62,25,247,255,45,64,56,255,161,244,6,0,34,57,56,1,105,202,83,0,128,147,208,0,6,103,10,255,74,138,65,255,97,80,100,255,214,174,33,255,50,134,74,255,110,151,130,254,111,84,172,0,84,199,75,254,248,59,112,255,8,216,178,1,9,183,95,0,238,27,8,254,170,205,220,0,195,229,135,0,98,76,237,255,226,91,26,1,82,219,39,255,225,190,199,1,217,200,121,255,81,179,8,255,140,65,206,0,178,207,87,254,250,252,46,255,104,89,110,1,253,189,158,255,144,214,158,255,160,245,54,255,53,183,92,1,21,200,194,255,146,33,113,1,209,1,255,0,235,106,43,255,167,52,232,0,157,229,221,0,51,30,25,0,250,221,27,1,65,147,87,255,79,123,196,0,65,196,223,255,76,44,17,1,85,241,68,0,202,183,249,255,65,212,212,255,9,33,154,1,71,59,80,0,175,194,59,255,141,72,9,0,100,160,244,0,230,208,56,0,59,25,75,254,80,194,194,0,18,3,200,254,160,159,115,0,132,143,247,1,111,93,57,255,58,237,11,1,134,222,135,255,122,163,108,1,123,43,190,255,251,189,206,254,80,182,72,255,208,246,224,1,17,60,9,0,161,207,38,0,141,109,91,0,216,15,211,255,136,78,110,0,98,163,104,255,21,80,121,255,173,178,183,1,127,143,4,0,104,60,82,254,214,16,13,255,96,238,33,1,158,148,230,255,127,129,62,255,51,255,210,255,62,141,236,254,157,55,224,255,114,39,244,0,192,188,250,255,228,76,53,0,98,84,81,255,173,203,61,254,147,50,55,255,204,235,191,0,52,197,244,0,88,43,211,254,27,191,119,0,188,231,154,0,66,81,161,0,92,193,160,1,250,227,120,0,123,55,226,0,184,17,72,0,133,168,10,254,22,135,156,255,41,25,103,255,48,202,58,0,186,149,81,255,188,134,239,0,235,181,189,254,217,139,188,255,74,48,82,0,46,218,229,0,189,253,251,0,50,229,12,255,211,141,191,1,128,244,25,255,169,231,122,254,86,47,189,255,132,183,23,255,37,178,150,255,51,137,253,0,200,78,31,0,22,105,50,0,130,60,0,0,132,163,91,254,23,231,187,0,192,79,239,0,157,102,164,255,192,82,20,1,24,181,103,255,240,9,234,0,1,123,164,255,133,233,0,255,202,242,242,0,60,186,245,0,241,16,199,255,224,116,158,254,191,125,91,255,224,86,207,0,121,37,231,255,227,9,198,255,15,153,239,255,121,232,217,254,75,112,82,0,95,12,57,254,51,214,105,255,148,220,97,1,199,98,36,0,156,209,12,254,10,212,52,0,217,180,55,254,212,170,232,255,216,20,84,255,157,250,135,0,157,99,127,254,1,206,41,0,149,36,70,1,54,196,201,255,87,116,0,254,235,171,150,0,27,163,234,0,202,135,180,0,208,95,0,254,123,156,93,0,183,62,75,0,137,235,182,0,204,225,255,255,214,139,210,255,2,115,8,255,29,12,111,0,52,156,1,0,253,21,251,255,37,165,31,254,12,130,211,0,106,18,53,254,42,99,154,0,14,217,61,254,216,11,92,255,200,197,112,254,147,38,199,0,36,252,120,254,107,169,77,0,1,123,159,255,207,75,102,0,163,175,196,0,44,1,240,0,120,186,176,254,13,98,76,255,237,124,241,255,232,146,188,255,200,96,224,0,204,31,41,0,208,200,13,0,21,225,96,255,175,156,196,0,247,208,126,0,62,184,244,254,2,171,81,0,85,115,158,0,54,64,45,255,19,138,114,0,135,71,205,0,227,47,147,1,218,231,66,0,253,209,28,0,244,15,173,255,6,15,118,254,16,150,208,255,185,22,50,255,86,112,207,255,75,113,215,1,63,146,43,255,4,225,19,254,227,23,62,255,14,255,214,254,45,8,205,255,87,197,151,254,210,82,215,255,245,248,247,255,128,248,70,0,225,247,87,0,90,120,70,0,213,245,92,0,13,133,226,0,47,181,5,1,92,163,105,255,6,30,133,254,232,178,61,255,230,149,24,255,18,49,158,0,228,100,61,254,116,243,251,255,77,75,92,1,81,219,147,255,76,163,254,254,141,213,246,0,232,37,152,254,97,44,100,0,201,37,50,1,212,244,57,0,174,171,183,255,249,74,112,0,166,156,30,0,222,221,97,255,243,93,73,254,251,101,100,255,216,217,93,255,254,138,187,255,142,190,52,255,59,203,177,255,200,94,52,0,115,114,158,255,165,152,104,1,126,99,226,255,118,157,244,1,107,200,16,0,193,90,229,0,121,6,88,0,156,32,93,254,125,241,211,255,14,237,157,255,165,154,21,255,184,224,22,255,250,24,152,255,113,77,31,0,247,171,23,255,237,177,204,255,52,137,145,255,194,182,114,0,224,234,149,0,10,111,103,1,201,129,4,0,238,142,78,0,52,6,40,255,110,213,165,254,60,207,253,0,62,215,69,0,96,97,0,255,49,45,202,0,120,121,22,255,235,139,48,1,198,45,34,255,182,50,27,1,131,210,91,255,46,54,128,0,175,123,105,255,198,141,78,254,67,244,239,255,245,54,103,254,78,38,242,255,2,92,249,254,251,174,87,255,139,63,144,0,24,108,27,255,34,102,18,1,34,22,152,0,66,229,118,254,50,143,99,0,144,169,149,1,118,30,152,0,178,8,121,1,8,159,18,0,90,101,230,255,129,29,119,0,68,36,11,1,232,183,55,0,23,255,96,255,161,41,193,255,63,139,222,0,15,179,243,0,255,100,15,255,82,53,135,0,137,57,149,1,99,240,170,255,22,230,228,254,49,180,82,255,61,82,43,0,110,245,217,0,199,125,61,0,46,253,52,0,141,197,219,0,211,159,193,0,55,121,105,254,183,20,129,0,169,119,170,255,203,178,139,255,135,40,182,255,172,13,202,255,65,178,148,0,8,207,43,0,122,53,127,1,74,161,48,0,227,214,128,254,86,11,243,255,100,86,7,1,245,68,134,255,61,43,21,1,152,84,94,255,190,60,250,254,239,118,232,255,214,136,37,1,113,76,107,255,93,104,100,1,144,206,23,255,110,150,154,1,228,103,185,0,218,49,50,254,135,77,139,255,185,1,78,0,0,161,148,255,97,29,233,255,207,148,149,255,160,168,0,0,91,128,171,255,6,28,19,254,11,111,247,0,39,187,150,255,138,232,149,0,117,62,68,255,63,216,188,255,235,234,32,254,29,57,160,255,25,12,241,1,169,60,191,0,32,131,141,255,237,159,123,255,94,197,94,254,116,254,3,255,92,179,97,254,121,97,92,255,170,112,14,0,21,149,248,0,248,227,3,0,80,96,109,0,75,192,74,1,12,90,226,255,161,106,68,1,208,114,127,255,114,42,255,254,74,26,74,255,247,179,150,254,121,140,60,0,147,70,200,255,214,40,161,255,161,188,201,255,141,65,135,255,242,115,252,0,62,47,202,0,180,149,255,254,130,55,237,0,165,17,186,255,10,169,194,0,156,109,218,255,112,140,123,255,104,128,223,254,177,142,108,255,121,37,219,255,128,77,18,255,111,108,23,1,91,192,75,0,174,245,22,255,4,236,62,255,43,64,153,1,227,173,254,0,237,122,132,1,127,89,186,255,142,82,128,254,252,84,174,0,90,179,177,1,243,214,87,255,103,60,162,255,208,130,14,255,11,130,139,0,206,129,219,255,94,217,157,255,239,230,230,255,116,115,159,254,164,107,95,0,51,218,2,1,216,125,198,255,140,202,128,254,11,95,68,255,55,9,93,254,174,153,6,255,204,172,96,0,69,160,110,0,213,38,49,254,27,80,213,0,118,125,114,0,70,70,67,255,15,142,73,255,131,122,185,255,243,20,50,254,130,237,40,0,210,159,140,1,197,151,65,255,84,153,66,0,195,126,90,0,16,238,236,1,118,187,102,255,3,24,133,255,187,69,230,0,56,197,92,1,213,69,94,255,80,138,229,1,206,7,230,0,222,111,230,1,91,233,119,255,9,89,7,1,2,98,1,0,148,74,133,255,51,246,180,255,228,177,112,1,58,189,108,255,194,203,237,254,21,209,195,0,147,10,35,1,86,157,226,0,31,163,139,254,56,7,75,255,62,90,116,0,181,60,169,0,138,162,212,254,81,167,31,0,205,90,112,255,33,112,227,0,83,151,117,1,177,224,73,255,174,144,217,255,230,204,79,255,22,77,232,255,114,78,234,0,224,57,126,254,9,49,141,0,242,147,165,1,104,182,140,255,167,132,12,1,123,68,127,0,225,87,39,1,251,108,8,0,198,193,143,1,121,135,207,255,172,22,70,0,50,68,116,255,101,175,40,255,248,105,233,0,166,203,7,0,110,197,218,0,215,254,26,254,168,226,253,0,31,143,96,0,11,103,41,0,183,129,203,254,100,247,74,255,213,126,132,0,210,147,44,0,199,234,27,1,148,47,181,0,155,91,158,1,54,105,175,255,2,78,145,254,102,154,95,0,128,207,127,254,52,124,236,255,130,84,71,0,221,243,211,0,152,170,207,0,222,106,199,0,183,84,94,254,92,200,56,255,138,182,115,1,142,96,146,0,133,136,228,0,97,18,150,0,55,251,66,0,140,102,4,0,202,103,151,0,30,19,248,255,51,184,207,0,202,198,89,0,55,197,225,254,169,95,249,255,66,65,68,255,188,234,126,0,166,223,100,1,112,239,244,0,144,23,194,0,58,39,182,0,244,44,24,254,175,68,179,255,152,118,154,1,176,162,130,0,217,114,204,254,173,126,78,255,33,222,30,255,36,2,91,255,2,143,243,0,9,235,215,0,3,171,151,1,24,215,245,255,168,47,164,254,241,146,207,0,69,129,180,0,68,243,113,0,144,53,72,254,251,45,14,0,23,110,168,0,68,68,79,255,110,70,95,254,174,91,144,255,33,206,95,255,137,41,7,255,19,187,153,254,35,255,112,255,9,145,185,254,50,157,37,0,11,112,49,1,102,8,190,255,234,243,169,1,60,85,23,0,74,39,189,0,116,49,239,0,173,213,210,0,46,161,108,255,159,150,37,0,196,120,185,255,34,98,6,255,153,195,62,255,97,230,71,255,102,61,76,0,26,212,236,255,164,97,16,0,198,59,146,0,163,23,196,0,56,24,61,0,181,98,193,0,251,147,229,255,98,189,24,255,46,54,206,255,234,82,246,0,183,103,38,1,109,62,204,0,10,240,224,0,146,22,117,255,142,154,120,0,69,212,35,0,208,99,118,1,121,255,3,255,72,6,194,0,117,17,197,255,125,15,23,0,154,79,153,0,214,94,197,255,185,55,147,255,62,254,78,254,127,82,153,0,110,102,63,255,108,82,161,255,105,187,212,1,80,138,39,0,60,255,93,255,72,12,186,0,210,251,31,1,190,167,144,255,228,44,19,254,128,67,232,0,214,249,107,254,136,145,86,255,132,46,176,0,189,187,227,255,208,22,140,0,217,211,116,0,50,81,186,254,139,250,31,0,30,64,198,1,135,155,100,0,160,206,23,254,187,162,211,255,16,188,63,0,254,208,49,0,85,84,191,0,241,192,242,255,153,126,145,1,234,162,162,255,230,97,216,1,64,135,126,0,190,148,223,1,52,0,43,255,28,39,189,1,64,136,238,0,175,196,185,0,98,226,213,255,127,159,244,1,226,175,60,0,160,233,142,1,180,243,207,255,69,152,89,1,31,101,21,0,144,25,164,254,139,191,209,0,91,25,121,0,32,147,5,0,39,186,123,255,63,115,230,255,93,167,198,255,143,213,220,255,179,156,19,255,25,66,122,0,214,160,217,255,2,45,62,255,106,79,146,254,51,137,99,255,87,100,231,255,175,145,232,255,101,184,1,255,174,9,125,0,82,37,161,1,36,114,141,255,48,222,142,255,245,186,154,0,5,174,221,254,63,114,155,255,135,55,160,1,80,31,135,0,126,250,179,1,236,218,45,0,20,28,145,1,16,147,73,0,249,189,132,1,17,189,192,255,223,142,198,255,72,20,15,255,250,53,237,254,15,11,18,0,27,211,113,254,213,107,56,255,174,147,146,255,96,126,48,0,23,193,109,1,37,162,94,0,199,157,249,254,24,128,187,255,205,49,178,254,93,164,42,255,43,119,235,1,88,183,237,255,218,210,1,255,107,254,42,0,230,10,99,255,162,0,226,0,219,237,91,0,129,178,203,0,208,50,95,254,206,208,95,255,247,191,89,254,110,234,79,255,165,61,243,0,20,122,112,255,246,246,185,254,103,4,123,0,233,99,230,1,219,91,252,255,199,222,22,255,179,245,233,255,211,241,234,0,111,250,192,255,85,84,136,0,101,58,50,255,131,173,156,254,119,45,51,255,118,233,16,254,242,90,214,0,94,159,219,1,3,3,234,255,98,76,92,254,80,54,230,0,5,228,231,254,53,24,223,255,113,56,118,1,20,132,1,255,171,210,236,0,56,241,158,255,186,115,19,255,8,229,174,0,48,44,0,1,114,114,166,255,6,73,226,255,205,89,244,0,137,227,75,1,248,173,56,0,74,120,246,254,119,3,11,255,81,120,198,255,136,122,98,255,146,241,221,1,109,194,78,255,223,241,70,1,214,200,169,255,97,190,47,255,47,103,174,255,99,92,72,254,118,233,180,255,193,35,233,254,26,229,32,255,222,252,198,0,204,43,71,255,199,84,172,0,134,102,190,0,111,238,97,254,230,40,230,0,227,205,64,254,200,12,225,0,166,25,222,0,113,69,51,255,143,159,24,0,167,184,74,0,29,224,116,254,158,208,233,0,193,116,126,255,212,11,133,255,22,58,140,1,204,36,51,255,232,30,43,0,235,70,181,255,64,56,146,254,169,18,84,255,226,1,13,255,200,50,176,255,52,213,245,254,168,209,97,0,191,71,55,0,34,78,156,0,232,144,58,1,185,74,189,0,186,142,149,254,64,69,127,255,161,203,147,255,176,151,191,0,136,231,203,254,163,182,137,0,161,126,251,254,233,32,66,0,68,207,66,0,30,28,37,0,93,114,96,1,254,92,247,255,44,171,69,0,202,119,11,255,188,118,50,1,255,83,136,255,71,82,26,0,70,227,2,0,32,235,121,1,181,41,154,0,71,134,229,254,202,255,36,0,41,152,5,0,154,63,73,255,34,182,124,0,121,221,150,255,26,204,213,1,41,172,87,0,90,157,146,255,109,130,20,0,71,107,200,255,243,102,189,0,1,195,145,254,46,88,117,0,8,206,227,0,191,110,253,255,109,128,20,254,134,85,51,255,137,177,112,1,216,34,22,255,131,16,208,255,121,149,170,0,114,19,23,1,166,80,31,255,113,240,122,0,232,179,250,0,68,110,180,254,210,170,119,0,223,108,164,255,207,79,233,255,27,229,226,254,209,98,81,255,79,68,7,0,131,185,100,0,170,29,162,255,17,162,107,255,57,21,11,1,100,200,181,255,127,65,166,1,165,134,204,0,104,167,168,0,1,164,79,0,146,135,59,1,70,50,128,255,102,119,13,254,227,6,135,0,162,142,179,255,160,100,222,0,27,224,219,1,158,93,195,255,234,141,137,0,16,24,125,255,238,206,47,255,97,17,98,255,116,110,12,255,96,115,77,0,91,227,232,255,248,254,79,255,92,229,6,254,88,198,139,0,206,75,129,0,250,77,206,255,141,244,123,1,138,69,220,0,32,151,6,1,131,167,22,255,237,68,167,254,199,189,150,0,163,171,138,255,51,188,6,255,95,29,137,254,148,226,179,0,181,107,208,255,134,31,82,255,151,101,45,255,129,202,225,0,224,72,147,0,48,138,151,255,195,64,206,254,237,218,158,0,106,29,137,254,253,189,233,255,103,15,17,255,194,97,255,0,178,45,169,254,198,225,155,0,39,48,117,255,135,106,115,0,97,38,181,0,150,47,65,255,83,130,229,254,246,38,129,0,92,239,154,254,91,99,127,0,161,111,33,255,238,217,242,255,131,185,195,255,213,191,158,255,41,150,218,0,132,169,131,0,89,84,252,1,171,70,128,255,163,248,203,254,1,50,180,255,124,76,85,1,251,111,80,0,99,66,239,255,154,237,182,255,221,126,133,254,74,204,99,255,65,147,119,255,99,56,167,255,79,248,149,255,116,155,228,255,237,43,14,254,69,137,11,255,22,250,241,1,91,122,143,255,205,249,243,0,212,26,60,255,48,182,176,1,48,23,191,255,203,121,152,254,45,74,213,255,62,90,18,254,245,163,230,255,185,106,116,255,83,35,159,0,12,33,2,255,80,34,62,0,16,87,174,255,173,101,85,0,202,36,81,254,160,69,204,255,64,225,187,0,58,206,94,0,86,144,47,0,229,86,245,0,63,145,190,1,37,5,39,0,109,251,26,0,137,147,234,0,162,121,145,255,144,116,206,255,197,232,185,255,183,190,140,255,73,12,254,255,139,20,242,255,170,90,239,255,97,66,187,255,245,181,135,254,222,136,52,0,245,5,51,254,203,47,78,0,152,101,216,0,73,23,125,0,254,96,33,1,235,210,73,255,43,209,88,1,7,129,109,0,122,104,228,254,170,242,203,0,242,204,135,255,202,28,233,255,65,6,127,0,159,144,71,0,100,140,95,0,78,150,13,0,251,107,118,1,182,58,125,255,1,38,108,255,141,189,209,255,8,155,125,1,113,163,91,255,121,79,190,255,134,239,108,255,76,47,248,0,163,228,239,0,17,111,10,0,88,149,75,255,215,235,239,0,167,159,24,255,47,151,108,255,107,209,188,0,233,231,99,254,28,202,148,255,174,35,138,255,110,24,68,255,2,69,181,0,107,102,82,0,102,237,7,0,92,36,237,255,221,162,83,1,55,202,6,255,135,234,135,255,24,250,222,0,65,94,168,254,245,248,210,255,167,108,201,254,255,161,111,0,205,8,254,0,136,13,116,0,100,176,132,255,43,215,126,255,177,133,130,255,158,79,148,0,67,224,37,1,12,206,21,255,62,34,110,1,237,104,175,255,80,132,111,255,142,174,72,0,84,229,180,254,105,179,140,0,64,248,15,255,233,138,16,0,245,67,123,254,218,121,212,255,63,95,218,1,213,133,137,255,143,182,82,255,48,28,11,0,244,114,141,1,209,175,76,255,157,181,150,255,186,229,3,255,164,157,111,1,231,189,139,0,119,202,190,255,218,106,64,255,68,235,63,254,96,26,172,255,187,47,11,1,215,18,251,255,81,84,89,0,68,58,128,0,94,113,5,1,92,129,208,255,97,15,83,254,9,28,188,0,239,9,164,0,60,205,152,0,192,163,98,255,184,18,60,0,217,182,139,0,109,59,120,255,4,192,251,0,169,210,240,255,37,172,92,254,148,211,245,255,179,65,52,0,253,13,115,0,185,174,206,1,114,188,149,255,237,90,173,0,43,199,192,255,88,108,113,0,52,35,76,0,66,25,148,255,221,4,7,255,151,241,114,255,190,209,232,0,98,50,199,0,151,150,213,255,18,74,36,1,53,40,7,0,19,135,65,255,26,172,69,0,174,237,85,0,99,95,41,0,3,56,16,0,39,160,177,255,200,106,218,254,185,68,84,255,91,186,61,254,67,143,141,255,13,244,166,255,99,114,198,0,199,110,163,255,193,18,186,0,124,239,246,1,110,68,22,0,2,235,46,1,212,60,107,0,105,42,105,1,14,230,152,0,7,5,131,0,141,104,154,255,213,3,6,0,131,228,162,255,179,100,28,1,231,123,85,255,206,14,223,1,253,96,230,0,38,152,149,1,98,137,122,0,214,205,3,255,226,152,179,255,6,133,137,0,158,69,140,255,113,162,154,255,180,243,172,255,27,189,115,255,143,46,220,255,213,134,225,255,126,29,69,0,188,43,137,1,242,70,9,0,90,204,255,255,231,170,147,0,23,56,19,254,56,125,157,255,48,179,218,255,79,182,253,255,38,212,191,1,41,235,124,0,96,151,28,0,135,148,190,0,205,249,39,254,52,96,136,255,212,44,136,255,67,209,131,255,252,130,23,255,219,128,20,255,198,129,118,0,108,101,11,0,178,5,146,1,62,7,100,255,181,236,94,254,28,26,164,0,76,22,112,255,120,102,79,0,202,192,229,1,200,176,215,0,41,64,244,255,206,184,78,0,167,45,63,1,160,35,0,255,59,12,142,255,204,9,144,255,219,94,229,1,122,27,112,0,189,105,109,255,64,208,74,255,251,127,55,1,2,226,198,0,44,76,209,0,151,152,77,255,210,23,46,1,201,171,69,255,44,211,231,0,190,37,224,255,245,196,62,255,169,181,222,255,34,211,17,0,119,241,197,255,229,35,152,1,21,69,40,255,178,226,161,0,148,179,193,0,219,194,254,1,40,206,51,255,231,92,250,1,67,153,170,0,21,148,241,0,170,69,82,255,121,18,231,255,92,114,3,0,184,62,230,0,225,201,87,255,146,96,162,255,181,242,220,0,173,187,221,1,226,62,170,255,56,126,217,1,117,13,227,255,179,44,239,0,157,141,155,255,144,221,83,0,235,209,208,0,42,17,165,1,251,81,133,0,124,245,201,254,97,211,24,255,83,214,166,0,154,36,9,255,248,47,127,0,90,219,140,255,161,217,38,254,212,147,63,255,66,84,148,1,207,3,1,0,230,134,89,1,127,78,122,255,224,155,1,255,82,136,74,0,178,156,208,255,186,25,49,255,222,3,210,1,229,150,190,255,85,162,52,255,41,84,141,255,73,123,84,254,93,17,150,0,119,19,28,1,32,22,215,255,28,23,204,255,142,241,52,255,228,52,125,0,29,76,207,0,215,167,250,254,175,164,230,0,55,207,105,1,109,187,245,255,161,44,220,1,41,101,128,255,167,16,94,0,93,214,107,255,118,72,0,254,80,61,234,255,121,175,125,0,139,169,251,0,97,39,147,254,250,196,49,255,165,179,110,254,223,70,187,255,22,142,125,1,154,179,138,255,118,176,42,1,10,174,153,0,156,92,102,0,168,13,161,255,143,16,32,0,250,197,180,255,203,163,44,1,87,32,36,0,161,153,20,255,123,252,15,0,25,227,80,0,60,88,142,0,17,22,201,1,154,205,77,255,39,63,47,0,8,122,141,0,128,23,182,254,204,39,19,255,4,112,29,255,23,36,140,255,210,234,116,254,53,50,63,255,121,171,104,255,160,219,94,0,87,82,14,254,231,42,5,0,165,139,127,254,86,78,38,0,130,60,66,254,203,30,45,255,46,196,122,1,249,53,162,255,136,143,103,254,215,210,114,0,231,7,160,254,169,152,42,255,111,45,246,0,142,131,135,255,131,71,204,255,36,226,11,0,0,28,242,255,225,138,213,255,247,46,216,254,245,3,183,0,108,252,74,1,206,26,48,255,205,54,246,255,211,198,36,255,121,35,50,0,52,216,202,255,38,139,129,254,242,73,148,0,67,231,141,255,42,47,204,0,78,116,25,1,4,225,191,255,6,147,228,0,58,88,177,0,122,165,229,255,252,83,201,255,224,167,96,1,177,184,158,255,242,105,179,1,248,198,240,0,133,66,203,1,254,36,47,0,45,24,115,255,119,62,254,0,196,225,186,254,123,141,172,0,26,85,41,255,226,111,183,0,213,231,151,0,4,59,7,255,238,138,148,0,66,147,33,255,31,246,141,255,209,141,116,255,104,112,31,0,88,161,172,0,83,215,230,254,47,111,151,0,45,38,52,1,132,45,204,0,138,128,109,254,233,117,134,255,243,190,173,254,241,236,240,0,82,127,236,254,40,223,161,255,110,182,225,255,123,174,239,0,135,242,145,1,51,209,154,0,150,3,115,254,217,164,252,255,55,156,69,1,84,94,255,255,232,73,45,1,20,19,212,255,96,197,59,254,96,251,33,0,38,199,73,1,64,172,247,255,117,116,56,255,228,17,18,0,62,138,103,1,246,229,164,255,244,118,201,254,86,32,159,255,109,34,137,1,85,211,186,0,10,193,193,254,122,194,177,0,122,238,102,255,162,218,171,0,108,217,161,1,158,170,34,0,176,47,155,1,181,228,11,255,8,156,0,0,16,75,93,0,206,98,255,1,58,154,35,0,12,243,184,254,67,117,66,255,230,229,123,0,201,42,110,0,134,228,178,254,186,108,118,255,58,19,154,255,82,169,62,255,114,143,115,1,239,196,50,255,173,48,193,255,147,2,84,255,150,134,147,254,95,232,73,0,109,227,52,254,191,137,10,0,40,204,30,254,76,52,97,255,164,235,126,0,254,124,188,0,74,182,21,1,121,29,35,255,241,30,7,254,85,218,214,255,7,84,150,254,81,27,117,255,160,159,152,254,66,24,221,255,227,10,60,1,141,135,102,0,208,189,150,1,117,179,92,0,132,22,136,255,120,199,28,0,21,129,79,254,182,9,65,0,218,163,169,0,246,147,198,255,107,38,144,1,78,175,205,255,214,5,250,254,47,88,29,255,164,47,204,255,43,55,6,255,131,134,207,254,116,100,214,0,96,140,75,1,106,220,144,0,195,32,28,1,172,81,5,255,199,179,52,255,37,84,203,0,170,112,174,0,11,4,91,0,69,244,27,1,117,131,92,0,33,152,175,255,140,153,107,255,251,135,43,254,87,138,4,255,198,234,147,254,121,152,84,255,205,101,155,1,157,9,25,0,72,106,17,254,108,153,0,255,189,229,186,0,193,8,176,255,174,149,209,0,238,130,29,0,233,214,126,1,61,226,102,0,57,163,4,1,198,111,51,255,45,79,78,1,115,210,10,255,218,9,25,255,158,139,198,255,211,82,187,254,80,133,83,0,157,129,230,1,243,133,134,255,40,136,16,0,77,107,79,255,183,85,92,1,177,204,202,0,163,71,147,255,152,69,190,0,172,51,188,1,250,210,172,255,211,242,113,1,89,89,26,255,64,66,111,254,116,152,42,0,161,39,27,255,54,80,254,0,106,209,115,1,103,124,97,0,221,230,98,255,31,231,6,0,178,192,120,254,15,217,203,255,124,158,79,0,112,145,247,0,92,250,48,1,163,181,193,255,37,47,142,254,144,189,165,255,46,146,240,0,6,75,128,0,41,157,200,254,87,121,213,0,1,113,236,0,5,45,250,0,144,12,82,0,31,108,231,0,225,239,119,255,167,7,189,255,187,228,132,255,110,189,34,0,94,44,204,1,162,52,197,0,78,188,241,254,57,20,141,0,244,146,47,1,206,100,51,0,125,107,148,254,27,195,77,0,152,253,90,1,7,143,144,255,51,37,31,0,34,119,38,255,7,197,118,0,153,188,211,0,151,20,116,254,245,65,52,255,180,253,110,1,47,177,209,0,161,99,17,255,118,222,202,0,125,179,252,1,123,54,126,255,145,57,191,0,55,186,121,0,10,243,138,0,205,211,229,255,125,156,241,254,148,156,185,255,227,19,188,255,124,41,32,255,31,34,206,254,17,57,83,0,204,22,37,255,42,96,98,0,119,102,184,1,3,190,28],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+20480);allocate([110,82,218,255,200,204,192,255,201,145,118,0,117,204,146,0,132,32,98,1,192,194,121,0,106,161,248,1,237,88,124,0,23,212,26,0,205,171,90,255,248,48,216,1,141,37,230,255,124,203,0,254,158,168,30,255,214,248,21,0,112,187,7,255,75,133,239,255,74,227,243,255,250,147,70,0,214,120,162,0,167,9,179,255,22,158,18,0,218,77,209,1,97,109,81,255,244,33,179,255,57,52,57,255,65,172,210,255,249,71,209,255,142,169,238,0,158,189,153,255,174,254,103,254,98,33,14,0,141,76,230,255,113,139,52,255,15,58,212,0,168,215,201,255,248,204,215,1,223,68,160,255,57,154,183,254,47,231,121,0,106,166,137,0,81,136,138,0,165,43,51,0,231,139,61,0,57,95,59,254,118,98,25,255,151,63,236,1,94,190,250,255,169,185,114,1,5,250,58,255,75,105,97,1,215,223,134,0,113,99,163,1,128,62,112,0,99,106,147,0,163,195,10,0,33,205,182,0,214,14,174,255,129,38,231,255,53,182,223,0,98,42,159,255,247,13,40,0,188,210,177,1,6,21,0,255,255,61,148,254,137,45,129,255,89,26,116,254,126,38,114,0,251,50,242,254,121,134,128,255,204,249,167,254,165,235,215,0,202,177,243,0,133,141,62,0,240,130,190,1,110,175,255,0,0,20,146,1,37,210,121,255,7,39,130,0,142,250,84,255,141,200,207,0,9,95,104,255,11,244,174,0,134,232,126,0,167,1,123,254,16,193,149,255,232,233,239,1,213,70,112,255,252,116,160,254,242,222,220,255,205,85,227,0,7,185,58,0,118,247,63,1,116,77,177,255,62,245,200,254,63,18,37,255,107,53,232,254,50,221,211,0,162,219,7,254,2,94,43,0,182,62,182,254,160,78,200,255,135,140,170,0,235,184,228,0,175,53,138,254,80,58,77,255,152,201,2,1,63,196,34,0,5,30,184,0,171,176,154,0,121,59,206,0,38,99,39,0,172,80,77,254,0,134,151,0,186,33,241,254,94,253,223,255,44,114,252,0,108,126,57,255,201,40,13,255,39,229,27,255,39,239,23,1,151,121,51,255,153,150,248,0,10,234,174,255,118,246,4,254,200,245,38,0,69,161,242,1,16,178,150,0,113,56,130,0,171,31,105,0,26,88,108,255,49,42,106,0,251,169,66,0,69,93,149,0,20,57,254,0,164,25,111,0,90,188,90,255,204,4,197,0,40,213,50,1,212,96,132,255,88,138,180,254,228,146,124,255,184,246,247,0,65,117,86,255,253,102,210,254,254,121,36,0,137,115,3,255,60,24,216,0,134,18,29,0,59,226,97,0,176,142,71,0,7,209,161,0,189,84,51,254,155,250,72,0,213,84,235,255,45,222,224,0,238,148,143,255,170,42,53,255,78,167,117,0,186,0,40,255,125,177,103,255,69,225,66,0,227,7,88,1,75,172,6,0,169,45,227,1,16,36,70,255,50,2,9,255,139,193,22,0,143,183,231,254,218,69,50,0,236,56,161,1,213,131,42,0,138,145,44,254,136,229,40,255,49,63,35,255,61,145,245,255,101,192,2,254,232,167,113,0,152,104,38,1,121,185,218,0,121,139,211,254,119,240,35,0,65,189,217,254,187,179,162,255,160,187,230,0,62,248,14,255,60,78,97,0,255,247,163,255,225,59,91,255,107,71,58,255,241,47,33,1,50,117,236,0,219,177,63,254,244,90,179,0,35,194,215,255,189,67,50,255,23,135,129,0,104,189,37,255,185,57,194,0,35,62,231,255,220,248,108,0,12,231,178,0,143,80,91,1,131,93,101,255,144,39,2,1,255,250,178,0,5,17,236,254,139,32,46,0,204,188,38,254,245,115,52,255,191,113,73,254,191,108,69,255,22,69,245,1,23,203,178,0,170,99,170,0,65,248,111,0,37,108,153,255,64,37,69,0,0,88,62,254,89,148,144,255,191,68,224,1,241,39,53,0,41,203,237,255,145,126,194,255,221,42,253,255,25,99,151,0,97,253,223,1,74,115,49,255,6,175,72,255,59,176,203,0,124,183,249,1,228,228,99,0,129,12,207,254,168,192,195,255,204,176,16,254,152,234,171,0,77,37,85,255,33,120,135,255,142,194,227,1,31,214,58,0,213,187,125,255,232,46,60,255,190,116,42,254,151,178,19,255,51,62,237,254,204,236,193,0,194,232,60,0,172,34,157,255,189,16,184,254,103,3,95,255,141,233,36,254,41,25,11,255,21,195,166,0,118,245,45,0,67,213,149,255,159,12,18,255,187,164,227,1,160,25,5,0,12,78,195,1,43,197,225,0,48,142,41,254,196,155,60,255,223,199,18,1,145,136,156,0,252,117,169,254,145,226,238,0,239,23,107,0,109,181,188,255,230,112,49,254,73,170,237,255,231,183,227,255,80,220,20,0,194,107,127,1,127,205,101,0,46,52,197,1,210,171,36,255,88,3,90,255,56,151,141,0,96,187,255,255,42,78,200,0,254,70,70,1,244,125,168,0,204,68,138,1,124,215,70,0,102,66,200,254,17,52,228,0,117,220,143,254,203,248,123,0,56,18,174,255,186,151,164,255,51,232,208,1,160,228,43,255,249,29,25,1,68,190,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,124,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,19,0,0,0,65,132,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,47,98,108,97,107,101,50,47,114,101,102,47,103,101,110,101,114,105,99,104,97,115,104,95,98,108,97,107,101,50,98,46,99,0,99,114,121,112,116,111,95,103,101,110,101,114,105,99,104,97,115,104,95,98,108,97,107,101,50,98,0,107,101,121,108,101,110,32,60,61,32,85,73,78,84,56,95,77,65,88,0,99,114,121,112,116,111,95,103,101,110,101,114,105,99,104,97,115,104,95,98,108,97,107,101,50,98,95,105,110,105,116,0,99,114,121,112,116,111,95,103,101,110,101,114,105,99,104,97,115,104,95,98,108,97,107,101,50,98,95,102,105,110,97,108,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,55,36,0,101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,123,32,114,101,116,117,114,110,32,77,111,100,117,108,101,46,103,101,116,82,97,110,100,111,109,86,97,108,117,101,40,41,59,32,125,0,123,32,105,102,32,40,77,111,100,117,108,101,46,103,101,116,82,97,110,100,111,109,86,97,108,117,101,32,61,61,61,32,117,110,100,101,102,105,110,101,100,41,32,123,32,116,114,121,32,123,32,118,97,114,32,119,105,110,100,111,119,95,32,61,32,34,111,98,106,101,99,116,34,32,61,61,61,32,116,121,112,101,111,102,32,119,105,110,100,111,119,32,63,32,119,105,110,100,111,119,32,58,32,115,101,108,102,44,32,99,114,121,112,116,111,95,32,61,32,116,121,112,101,111,102,32,119,105,110,100,111,119,95,46,99,114,121,112,116,111,32,33,61,61,32,34,117,110,100,101,102,105,110,101,100,34,32,63,32,119,105,110,100,111,119,95,46,99,114,121,112,116,111,32,58,32,119,105,110,100,111,119,95,46,109,115,67,114,121,112,116,111,44,32,114,97,110,100,111,109,86,97,108,117,101,115,83,116,97,110,100,97,114,100,32,61,32,102,117,110,99,116,105,111,110,40,41,32,123,32,118,97,114,32,98,117,102,32,61,32,110,101,119,32,85,105,110,116,51,50,65,114,114,97,121,40,49,41,59,32,99,114,121,112,116,111,95,46,103,101,116,82,97,110,100,111,109,86,97,108,117,101,115,40,98,117,102,41,59,32,114,101,116,117,114,110,32,98,117,102,91,48,93,32,62,62,62,32,48,59,32,125,59,32,114,97,110,100,111,109,86,97,108,117,101,115,83,116,97,110,100,97,114,100,40,41,59,32,77,111,100,117,108,101,46,103,101,116,82,97,110,100,111,109,86,97,108,117,101,32,61,32,114,97,110,100,111,109,86,97,108,117,101,115,83,116,97,110,100,97,114,100,59,32,125,32,99,97,116,99,104,32,40,101,41,32,123,32,116,114,121,32,123,32,118,97,114,32,99,114,121,112,116,111,32,61,32,114,101,113,117,105,114,101,40,39,99,114,121,112,116,111,39,41,44,32,114,97,110,100,111,109,86,97,108,117,101,78,111,100,101,74,83,32,61,32,102,117,110,99,116,105,111,110,40,41,32,123,32,118,97,114,32,98,117,102,32,61,32,99,114,121,112,116,111,46,114,97,110,100,111,109,66,121,116,101,115,40,52,41,59,32,114,101,116,117,114,110,32,40,98,117,102,91,48,93,32,60,60,32,50,52,32,124,32,98,117,102,91,49,93,32,60,60,32,49,54,32,124,32,98,117,102,91,50,93,32,60,60,32,56,32,124,32,98,117,102,91,51,93,41,32,62,62,62,32,48,59,32,125,59,32,114,97,110,100,111,109,86,97,108,117,101,78,111,100,101,74,83,40,41,59,32,77,111,100,117,108,101,46,103,101,116,82,97,110,100,111,109,86,97,108,117,101,32,61,32,114,97,110,100,111,109,86,97,108,117,101,78,111,100,101,74,83,59,32,125,32,99,97,116,99,104,32,40,101,41,32,123,32,116,104,114,111,119,32,39,78,111,32,115,101,99,117,114,101,32,114,97,110,100,111,109,32,110,117,109,98,101,114,32,103,101,110,101,114,97,116,111,114,32,102,111,117,110,100,39,59,32,125,32,125,32,125,32,125,0,49,46,48,46,54,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107,101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+30720);allocate([46,47,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+34873);var tempDoublePtr=Runtime.alignMemory(allocate(12,"i8",ALLOC_STATIC),8);assert(tempDoublePtr%8==0);function copyTempFloat(ptr){HEAP8[tempDoublePtr]=HEAP8[ptr];HEAP8[tempDoublePtr+1]=HEAP8[ptr+1];HEAP8[tempDoublePtr+2]=HEAP8[ptr+2];HEAP8[tempDoublePtr+3]=HEAP8[ptr+3]}function copyTempDouble(ptr){HEAP8[tempDoublePtr]=HEAP8[ptr];HEAP8[tempDoublePtr+1]=HEAP8[ptr+1];HEAP8[tempDoublePtr+2]=HEAP8[ptr+2];HEAP8[tempDoublePtr+3]=HEAP8[ptr+3];HEAP8[tempDoublePtr+4]=HEAP8[ptr+4];HEAP8[tempDoublePtr+5]=HEAP8[ptr+5];HEAP8[tempDoublePtr+6]=HEAP8[ptr+6];HEAP8[tempDoublePtr+7]=HEAP8[ptr+7]}function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;return value}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 _sysconf(name){switch(name){case 30:return PAGE_SIZE;case 85:return totalMemory/PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}___setErrNo(ERRNO_CODES.EINVAL);return-1}Module["_i64Subtract"]=_i64Subtract;Module["_i64Add"]=_i64Add;Module["_bitshift64Ashr"]=_bitshift64Ashr;Module["_memset"]=_memset;function _pthread_cleanup_push(routine,arg){__ATEXIT__.push((function(){Runtime.dynCall("vi",routine,[arg])}));_pthread_cleanup_push.level=__ATEXIT__.length}Module["_bitshift64Lshr"]=_bitshift64Lshr;Module["_bitshift64Shl"]=_bitshift64Shl;function _pthread_cleanup_pop(){assert(_pthread_cleanup_push.level==__ATEXIT__.length,"cannot pop if something else added meanwhile!");__ATEXIT__.pop();_pthread_cleanup_push.level=__ATEXIT__.length}function _abort(){Module["abort"]()}function ___lock(){}function ___unlock(){}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.buffer.byteLength: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){var e=dst.entries[key];var e2=src.entries[key];if(!e2){remove.push(key);total++}}));if(!total){return callback(null)}var errored=false;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/)}),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&146)>>1}}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)}),flagsToPermissionStringMap:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},flagsToPermissionString:(function(flags){flags&=~32768;if(flags in NODEFS.flagsToPermissionStringMap){return NODEFS.flagsToPermissionStringMap[flags]}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.flagsToPermissionString(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;var nbuffer=new Buffer(length);var res;try{res=fs.readSync(stream.nfd,nbuffer,0,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(res>0){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})}};var _stdin=allocate(1,"i32*",ALLOC_STATIC);var _stdout=allocate(1,"i32*",ALLOC_STATIC);var _stderr=allocate(1,"i32*",ALLOC_STATIC);var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,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((flags&2097155)!==0||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}var mounts=FS.getMounts(FS.root.mount);var completed=0;function done(err){if(err){if(!done.errored){done.errored=true;return callback(err)}return}if(++completed>=mounts.length){callback(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)}),mkdev:(function(path,mode,dev){if(typeof dev==="undefined"){dev=mode;mode=438}mode|=8192;return FS.mknod(path,mode,dev)}),symlink:(function(oldpath,newpath){if(!PATH.resolve(oldpath)){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}var lookup=FS.lookupPath(newpath,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}var newname=PATH.basename(newpath);var err=FS.mayCreate(parent,newname);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.symlink){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return parent.node_ops.symlink(parent,newname,oldpath)}),rename:(function(old_path,new_path){var old_dirname=PATH.dirname(old_path);var new_dirname=PATH.dirname(new_path);var old_name=PATH.basename(old_path);var new_name=PATH.basename(new_path);var lookup,old_dir,new_dir;try{lookup=FS.lookupPath(old_path,{parent:true});old_dir=lookup.node;lookup=FS.lookupPath(new_path,{parent:true});new_dir=lookup.node}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(!old_dir||!new_dir)throw new FS.ErrnoError(ERRNO_CODES.ENOENT);if(old_dir.mount!==new_dir.mount){throw new FS.ErrnoError(ERRNO_CODES.EXDEV)}var old_node=FS.lookupNode(old_dir,old_name);var relative=PATH.relative(old_path,new_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}relative=PATH.relative(new_path,old_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY)}var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(old_node===new_node){return}var isdir=FS.isDir(old_node.mode);var err=FS.mayDelete(old_dir,old_name,isdir);if(err){throw new FS.ErrnoError(err)}err=new_node?FS.mayDelete(new_dir,new_name,isdir):FS.mayCreate(new_dir,new_name);if(err){throw new FS.ErrnoError(err)}if(!old_dir.node_ops.rename){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isMountpoint(old_node)||new_node&&FS.isMountpoint(new_node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(new_dir!==old_dir){err=FS.nodePermissions(old_dir,"w");if(err){throw new FS.ErrnoError(err)}}try{if(FS.trackingDelegate["willMovePath"]){FS.trackingDelegate["willMovePath"](old_path,new_path)}}catch(e){console.log("FS.trackingDelegate['willMovePath']('"+old_path+"', '"+new_path+"') threw an exception: "+e.message)}FS.hashRemoveNode(old_node);try{old_dir.node_ops.rename(old_node,new_dir,new_name)}catch(e){throw e}finally{FS.hashAddNode(old_node)}try{if(FS.trackingDelegate["onMovePath"])FS.trackingDelegate["onMovePath"](old_path,new_path)}catch(e){console.log("FS.trackingDelegate['onMovePath']('"+old_path+"', '"+new_path+"') threw an exception: "+e.message)}}),rmdir:(function(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var err=FS.mayDelete(parent,name,true);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.rmdir){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}try{if(FS.trackingDelegate["willDeletePath"]){FS.trackingDelegate["willDeletePath"](path)}}catch(e){console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: "+e.message)}parent.node_ops.rmdir(parent,name);FS.destroyNode(node);try{if(FS.trackingDelegate["onDeletePath"])FS.trackingDelegate["onDeletePath"](path)}catch(e){console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: "+e.message)}}),readdir:(function(path){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node.node_ops.readdir){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}return node.node_ops.readdir(node)}),unlink:(function(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var err=FS.mayDelete(parent,name,false);if(err){if(err===ERRNO_CODES.EISDIR)err=ERRNO_CODES.EPERM;throw new FS.ErrnoError(err)}if(!parent.node_ops.unlink){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}try{if(FS.trackingDelegate["willDeletePath"]){FS.trackingDelegate["willDeletePath"](path)}}catch(e){console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: "+e.message)}parent.node_ops.unlink(parent,name);FS.destroyNode(node);try{if(FS.trackingDelegate["onDeletePath"])FS.trackingDelegate["onDeletePath"](path)}catch(e){console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: "+e.message)}}),readlink:(function(path){var lookup=FS.lookupPath(path);var link=lookup.node;if(!link){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}if(!link.node_ops.readlink){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return PATH.resolve(FS.getPath(link.parent),link.node_ops.readlink(link))}),stat:(function(path,dontFollow){var lookup=FS.lookupPath(path,{follow:!dontFollow});var node=lookup.node;if(!node){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}if(!node.node_ops.getattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return node.node_ops.getattr(node)}),lstat:(function(path){return FS.stat(path,true)}),chmod:(function(path,mode,dontFollow){var node;if(typeof path==="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}node.node_ops.setattr(node,{mode:mode&4095|node.mode&~4095,timestamp:Date.now()})}),lchmod:(function(path,mode){FS.chmod(path,mode,true)}),fchmod:(function(fd,mode){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}FS.chmod(stream.node,mode)}),chown:(function(path,uid,gid,dontFollow){var node;if(typeof path==="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}node.node_ops.setattr(node,{timestamp:Date.now()})}),lchown:(function(path,uid,gid){FS.chown(path,uid,gid,true)}),fchown:(function(fd,uid,gid){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}FS.chown(stream.node,uid,gid)}),truncate:(function(path,len){if(len<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node;if(typeof path==="string"){var lookup=FS.lookupPath(path,{follow:true});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EISDIR)}if(!FS.isFile(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var err=FS.nodePermissions(node,"w");if(err){throw new FS.ErrnoError(err)}node.node_ops.setattr(node,{size:len,timestamp:Date.now()})}),ftruncate:(function(fd,len){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}FS.truncate(stream.node,len)}),utime:(function(path,atime,mtime){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;node.node_ops.setattr(node,{timestamp:Math.max(atime,mtime)})}),open:(function(path,flags,mode,fd_start,fd_end){if(path===""){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}flags=typeof flags==="string"?FS.modeStringToFlags(flags):flags;mode=typeof mode==="undefined"?438:mode;if(flags&64){mode=mode&4095|32768}else{mode=0}var node;if(typeof path==="object"){node=path}else{path=PATH.normalize(path);try{var lookup=FS.lookupPath(path,{follow:!(flags&131072)});node=lookup.node}catch(e){}}var created=false;if(flags&64){if(node){if(flags&128){throw new FS.ErrnoError(ERRNO_CODES.EEXIST)}}else{node=FS.mknod(path,mode,0);created=true}}if(!node){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}if(FS.isChrdev(node.mode)){flags&=~512}if(flags&65536&&!FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}if(!created){var err=FS.mayOpen(node,flags);if(err){throw new FS.ErrnoError(err)}}if(flags&512){FS.truncate(node,0)}flags&=~(128|512);var stream=FS.createStream({node:node,path:FS.getPath(node),flags:flags,seekable:true,position:0,stream_ops:node.stream_ops,ungotten:[],error:false},fd_start,fd_end);if(stream.stream_ops.open){stream.stream_ops.open(stream)}if(Module["logReadFiles"]&&!(flags&1)){if(!FS.readFiles)FS.readFiles={};if(!(path in FS.readFiles)){FS.readFiles[path]=1;Module["printErr"]("read file: "+path)}}try{if(FS.trackingDelegate["onOpenFile"]){var trackingFlags=0;if((flags&2097155)!==1){trackingFlags|=FS.tracking.openFlags.READ}if((flags&2097155)!==0){trackingFlags|=FS.tracking.openFlags.WRITE}FS.trackingDelegate["onOpenFile"](path,trackingFlags)}}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+path+"', flags) threw an exception: "+e.message)}return stream}),close:(function(stream){if(stream.getdents)stream.getdents=null;try{if(stream.stream_ops.close){stream.stream_ops.close(stream)}}catch(e){throw e}finally{FS.closeStream(stream.fd)}}),llseek:(function(stream,offset,whence){if(!stream.seekable||!stream.stream_ops.llseek){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)}stream.position=stream.stream_ops.llseek(stream,offset,whence);stream.ungotten=[];return stream.position}),read:(function(stream,buffer,offset,length,position){if(length<0||position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if((stream.flags&2097155)===1){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EISDIR)}if(!stream.stream_ops.read){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var seeking=true;if(typeof position==="undefined"){position=stream.position;seeking=false}else if(!stream.seekable){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)}var bytesRead=stream.stream_ops.read(stream,buffer,offset,length,position);if(!seeking)stream.position+=bytesRead;return bytesRead}),write:(function(stream,buffer,offset,length,position,canOwn){if(length<0||position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EISDIR)}if(!stream.stream_ops.write){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if(stream.flags&1024){FS.llseek(stream,0,2)}var seeking=true;if(typeof position==="undefined"){position=stream.position;seeking=false}else if(!stream.seekable){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)}var bytesWritten=stream.stream_ops.write(stream,buffer,offset,length,position,canOwn);if(!seeking)stream.position+=bytesWritten;try{if(stream.path&&FS.trackingDelegate["onWriteToFile"])FS.trackingDelegate["onWriteToFile"](stream.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return bytesWritten}),allocate:(function(stream,offset,length){if(offset<0||length<=0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if(!FS.isFile(stream.node.mode)&&!FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}if(!stream.stream_ops.allocate){throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP)}stream.stream_ops.allocate(stream,offset,length)}),mmap:(function(stream,buffer,offset,length,position,prot,flags){if((stream.flags&2097155)===1){throw new FS.ErrnoError(ERRNO_CODES.EACCES)}if(!stream.stream_ops.mmap){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}return stream.stream_ops.mmap(stream,buffer,offset,length,position,prot,flags)}),msync:(function(stream,buffer,offset,length,mmapFlags){if(!stream||!stream.stream_ops.msync){return 0}return stream.stream_ops.msync(stream,buffer,offset,length,mmapFlags)}),munmap:(function(stream){return 0}),ioctl:(function(stream,cmd,arg){if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(ERRNO_CODES.ENOTTY)}return stream.stream_ops.ioctl(stream,cmd,arg)}),readFile:(function(path,opts){opts=opts||{};opts.flags=opts.flags||"r";opts.encoding=opts.encoding||"binary";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error('Invalid encoding type "'+opts.encoding+'"')}var ret;var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==="utf8"){ret=UTF8ArrayToString(buf,0)}else if(opts.encoding==="binary"){ret=buf}FS.close(stream);return ret}),writeFile:(function(path,data,opts){opts=opts||{};opts.flags=opts.flags||"w";opts.encoding=opts.encoding||"utf8";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error('Invalid encoding type "'+opts.encoding+'"')}var stream=FS.open(path,opts.flags,opts.mode);if(opts.encoding==="utf8"){var buf=new Uint8Array(lengthBytesUTF8(data)+1);var actualNumBytes=stringToUTF8Array(data,buf,0,buf.length);FS.write(stream,buf,0,actualNumBytes,0,opts.canOwn)}else if(opts.encoding==="binary"){FS.write(stream,data,0,data.length,0,opts.canOwn)}FS.close(stream)}),cwd:(function(){return FS.currentPath}),chdir:(function(path){var lookup=FS.lookupPath(path,{follow:true});if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}var err=FS.nodePermissions(lookup.node,"x");if(err){throw new FS.ErrnoError(err)}FS.currentPath=lookup.path}),createDefaultDirectories:(function(){FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user")}),createDefaultDevices:(function(){FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:(function(){return 0}),write:(function(stream,buffer,offset,length,pos){return length})});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var random_device;if(typeof crypto!=="undefined"){var randomBuffer=new Uint8Array(1);random_device=(function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]})}else if(ENVIRONMENT_IS_NODE){random_device=(function(){return require("crypto").randomBytes(1)[0]})}else{random_device=(function(){return Math.random()*256|0})}FS.createDevice("/dev","random",random_device);FS.createDevice("/dev","urandom",random_device);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp")}),createSpecialDirectories:(function(){FS.mkdir("/proc");FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount:(function(){var node=FS.createNode("/proc/self","fd",16384|511,73);node.node_ops={lookup:(function(parent,name){var fd=+name;var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:(function(){return stream.path})}};ret.parent=ret;return ret})};return node})},{},"/proc/self/fd")}),createStandardStreams:(function(){if(Module["stdin"]){FS.createDevice("/dev","stdin",Module["stdin"])}else{FS.symlink("/dev/tty","/dev/stdin")}if(Module["stdout"]){FS.createDevice("/dev","stdout",null,Module["stdout"])}else{FS.symlink("/dev/tty","/dev/stdout")}if(Module["stderr"]){FS.createDevice("/dev","stderr",null,Module["stderr"])}else{FS.symlink("/dev/tty1","/dev/stderr")}var stdin=FS.open("/dev/stdin","r");assert(stdin.fd===0,"invalid handle for stdin ("+stdin.fd+")");var stdout=FS.open("/dev/stdout","w");assert(stdout.fd===1,"invalid handle for stdout ("+stdout.fd+")");var stderr=FS.open("/dev/stderr","w");assert(stderr.fd===2,"invalid handle for stderr ("+stderr.fd+")")}),ensureErrnoError:(function(){if(FS.ErrnoError)return;FS.ErrnoError=function ErrnoError(errno,node){this.node=node;this.setErrno=(function(errno){this.errno=errno;for(var key in ERRNO_CODES){if(ERRNO_CODES[key]===errno){this.code=key;break}}});this.setErrno(errno);this.message=ERRNO_MESSAGES[errno]};FS.ErrnoError.prototype=new Error;FS.ErrnoError.prototype.constructor=FS.ErrnoError;[ERRNO_CODES.ENOENT].forEach((function(code){FS.genericErrors[code]=new FS.ErrnoError(code);FS.genericErrors[code].stack=""}))}),staticInit:(function(){FS.ensureErrnoError();FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={"MEMFS":MEMFS,"IDBFS":IDBFS,"NODEFS":NODEFS,"WORKERFS":WORKERFS}}),init:(function(input,output,error){assert(!FS.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");FS.init.initialized=true;FS.ensureErrnoError();Module["stdin"]=input||Module["stdin"];Module["stdout"]=output||Module["stdout"];Module["stderr"]=error||Module["stderr"];FS.createStandardStreams()}),quit:(function(){FS.init.initialized=false;var fflush=Module["_fflush"];if(fflush)fflush(0);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 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]}));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.defineProperty(lazyArray,"length",{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._length})});Object.defineProperty(lazyArray,"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.defineProperty(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);ret=ret.slice(0,Math.max(0,bufsize));writeStringToMemory(ret,buf,true);return ret.length}),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 ___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}}var _emscripten_asm_const=true;function ___assert_fail(condition,filename,line,func){ABORT=true;throw"Assertion failed: "+Pointer_stringify(condition)+", at: "+[filename?Pointer_stringify(filename):"unknown filename",line,func?Pointer_stringify(func):"unknown function"]+" at "+stackTrace()}function _sbrk(bytes){var self=_sbrk;if(!self.called){DYNAMICTOP=alignMemoryPage(DYNAMICTOP);self.called=true;assert(Runtime.dynamicAlloc);self.alloc=Runtime.dynamicAlloc;Runtime.dynamicAlloc=(function(){abort("cannot dynamically allocate, sbrk now has control")})}var ret=DYNAMICTOP;if(bytes!=0){var success=self.alloc(bytes);if(!success)return-1>>>0}return ret}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest);return dest}Module["_memcpy"]=_memcpy;Module["_memmove"]=_memmove;var _emscripten_asm_const_int=true;function _time(ptr){var ret=Date.now()/1e3|0;if(ptr){HEAP32[ptr>>2]=ret}return ret}function _pthread_self(){return 0}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;assert(offset_high===0);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 ___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 ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),op=SYSCALLS.get();switch(op){case 21505:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21506:{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)};default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}FS.staticInit();__ATINIT__.unshift((function(){if(!Module["noFSInit"]&&!FS.init.initialized)FS.init()}));__ATMAIN__.push((function(){FS.ignorePermissions=false}));__ATEXIT__.push((function(){FS.quit()}));Module["FS_createFolder"]=FS.createFolder;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createLink"]=FS.createLink;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;__ATINIT__.unshift((function(){TTY.init()}));__ATEXIT__.push((function(){TTY.shutdown()}));if(ENVIRONMENT_IS_NODE){var fs=require("fs");var NODEJS_PATH=require("path");NODEFS.staticInit()}STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP);staticSealed=true;STACK_MAX=STACK_BASE+TOTAL_STACK;DYNAMIC_BASE=DYNAMICTOP=Runtime.alignMemory(STACK_MAX);assert(DYNAMIC_BASE>0]|0;M=Hd(d[e+1>>0]|0|0,0,8)|0;J=C;r=Hd(d[e+2>>0]|0|0,0,16)|0;J=J|C;s=Hd(d[e+3>>0]|0|0,0,24)|0;J=J|C;I=a[e+6>>0]|0;L=d[e+4>>0]|0;p=Hd(d[e+5>>0]|0|0,0,8)|0;K=C;I=Hd(I&255|0,0,16)|0;K=Hd(p|L|I|0,K|C|0,6)|0;I=C;L=a[e+9>>0]|0;p=d[e+7>>0]|0;f=Hd(d[e+8>>0]|0|0,0,8)|0;w=C;L=Hd(L&255|0,0,16)|0;w=Hd(f|p|L|0,w|C|0,5)|0;L=C;p=a[e+12>>0]|0;f=d[e+10>>0]|0;y=Hd(d[e+11>>0]|0|0,0,8)|0;n=C;p=Hd(p&255|0,0,16)|0;n=Hd(y|f|p|0,n|C|0,3)|0;p=C;f=a[e+15>>0]|0;y=d[e+13>>0]|0;F=Hd(d[e+14>>0]|0|0,0,8)|0;A=C;f=Hd(f&255|0,0,16)|0;A=Hd(F|y|f|0,A|C|0,2)|0;f=C;y=d[e+16>>0]|0;F=Hd(d[e+17>>0]|0|0,0,8)|0;u=C;h=Hd(d[e+18>>0]|0|0,0,16)|0;u=u|C;t=Hd(d[e+19>>0]|0|0,0,24)|0;t=F|y|h|t;u=u|C;h=a[e+22>>0]|0;y=d[e+20>>0]|0;F=Hd(d[e+21>>0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>>2]|0;h=c[b+100>>2]|0;g=c[b+104>>2]|0;f=c[b+108>>2]|0;e=c[b+112>>2]|0;d=c[b+116>>2]|0;c[a+80>>2]=c[b+80>>2];c[a+84>>2]=l;c[a+88>>2]=k;c[a+92>>2]=j;c[a+96>>2]=i;c[a+100>>2]=h;c[a+104>>2]=g;c[a+108>>2]=f;c[a+112>>2]=e;c[a+116>>2]=d;Jc(a+120|0,b+120|0,1144);return}function Rc(b,e){b=b|0;e=e|0;var f=0,g=0,h=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;u=i;t=i=i+63&-64;i=i+592|0;p=t+400|0;r=t+520|0;s=t+240|0;q=t+120|0;f=0;do{n=a[e+f>>0]|0;o=f<<1;a[r+o>>0]=n&15;a[r+(o|1)>>0]=(n&255)>>>4;f=f+1|0}while((f|0)!=32);e=0;f=0;do{o=r+f|0;n=(d[o>>0]|0)+e|0;e=(n<<24)+134217728>>28;a[o>>0]=n-(e<<4);f=f+1|0}while((f|0)!=63);f=r+63|0;a[f>>0]=(d[f>>0]|0)+e;e=b;f=e+40|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(f|0));j=b+40|0;c[j>>2]=1;g=b+44|0;e=g;f=e+36|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(f|0));k=b+80|0;c[k>>2]=1;h=b+84|0;l=b+120|0;m=s+120|0;n=s+40|0;o=s+80|0;e=h;f=e+76|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(f|0));e=1;do{Sc(t,(e|0)/2|0,a[r+e>>0]|0);Oc(s,b,t);Jc(b,s,m);Jc(j,n,o);Jc(k,o,m);Jc(l,s,n);e=e+2|0}while((e|0)<64);B=c[b+4>>2]|0;z=c[b+8>>2]|0;y=c[b+12>>2]|0;x=c[b+16>>2]|0;w=c[b+20>>2]|0;v=c[b+24>>2]|0;f=c[b+28>>2]|0;e=c[b+32>>2]|0;A=c[b+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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;s=d<<24>>24;s=Gd(s|0,((s|0)<0)<<31>>31|0,63)|0;h=d<<24>>24;s=0-s|0;d=a+4|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;e=a+40|0;c[e>>2]=1;f=a+44|0;g=a+80|0;h=h-((h&s)<<1)&255;i=(h^1)+-1|0;j=1184+(b*960|0)|0;k=a+8|0;l=a+12|0;m=a+16|0;n=a+20|0;o=a+24|0;p=a+28|0;q=a+32|0;r=a+36|0;t=f;u=t+76|0;do{c[t>>2]=0;t=t+4|0}while((t|0)<(u|0));H=i>>31;A=c[1184+(b*960|0)+4>>2]&H;I=c[1184+(b*960|0)+8>>2]&H;K=c[1184+(b*960|0)+12>>2]&H;M=c[1184+(b*960|0)+16>>2]&H;O=c[1184+(b*960|0)+20>>2]&H;Q=c[1184+(b*960|0)+24>>2]&H;S=c[1184+(b*960|0)+28>>2]&H;U=c[1184+(b*960|0)+32>>2]&H;W=c[1184+(b*960|0)+36>>2]&H;c[a>>2]=(c[j>>2]^1)&H^1;c[d>>2]=A;c[k>>2]=I;c[l>>2]=K;c[m>>2]=M;c[n>>2]=O;c[o>>2]=Q;c[p>>2]=S;c[q>>2]=U;c[r>>2]=W;W=a+48|0;U=a+52|0;S=a+56|0;Q=a+60|0;O=a+64|0;M=a+68|0;K=a+72|0;I=a+76|0;A=c[1184+(b*960|0)+44>>2]&H;z=c[1184+(b*960|0)+48>>2]&H;w=c[1184+(b*960|0)+52>>2]&H;B=c[1184+(b*960|0)+56>>2]&H;ia=c[1184+(b*960|0)+60>>2]&H;D=c[1184+(b*960|0)+64>>2]&H;ea=c[1184+(b*960|0)+68>>2]&H;F=c[1184+(b*960|0)+72>>2]&H;ga=c[1184+(b*960|0)+76>>2]&H;c[e>>2]=(c[1184+(b*960|0)+40>>2]^1)&H^1;c[f>>2]=A;c[W>>2]=z;c[U>>2]=w;c[S>>2]=B;c[Q>>2]=ia;c[O>>2]=D;c[M>>2]=ea;c[K>>2]=F;c[I>>2]=ga;ga=c[g>>2]|0;F=a+84|0;ea=c[F>>2]|0;D=a+88|0;ia=c[D>>2]|0;B=a+92|0;w=c[B>>2]|0;z=a+96|0;A=c[z>>2]|0;x=a+100|0;fa=c[x>>2]|0;v=a+104|0;ba=c[v>>2]|0;i=a+108|0;G=c[i>>2]|0;t=a+112|0;_=c[t>>2]|0;u=a+116|0;da=c[u>>2]|0;$=(c[1184+(b*960|0)+84>>2]^ea)&H;aa=(c[1184+(b*960|0)+88>>2]^ia)&H;y=(c[1184+(b*960|0)+92>>2]^w)&H;j=(c[1184+(b*960|0)+96>>2]^A)&H;ha=(c[1184+(b*960|0)+100>>2]^fa)&H;Z=(c[1184+(b*960|0)+104>>2]^ba)&H;ca=(c[1184+(b*960|0)+108>>2]^G)&H;C=(c[1184+(b*960|0)+112>>2]^_)&H;E=(c[1184+(b*960|0)+116>>2]^da)&H;c[g>>2]=(c[1184+(b*960|0)+80>>2]^ga)&H^ga;c[F>>2]=$^ea;c[D>>2]=aa^ia;c[B>>2]=y^w;c[z>>2]=j^A;c[x>>2]=ha^fa;c[v>>2]=Z^ba;c[i>>2]=ca^G;c[t>>2]=C^_;c[u>>2]=E^da;da=c[a>>2]|0;E=c[d>>2]|0;_=c[k>>2]|0;C=c[l>>2]|0;G=c[m>>2]|0;ca=c[n>>2]|0;ba=c[o>>2]|0;Z=c[p>>2]|0;fa=c[q>>2]|0;ha=c[r>>2]|0;A=(h^2)+-1>>31;j=(c[1184+(b*960|0)+124>>2]^E)&A;w=(c[1184+(b*960|0)+128>>2]^_)&A;y=(c[1184+(b*960|0)+132>>2]^C)&A;ia=(c[1184+(b*960|0)+136>>2]^G)&A;aa=(c[1184+(b*960|0)+140>>2]^ca)&A;ea=(c[1184+(b*960|0)+144>>2]^ba)&A;$=(c[1184+(b*960|0)+148>>2]^Z)&A;ga=(c[1184+(b*960|0)+152>>2]^fa)&A;H=(c[1184+(b*960|0)+156>>2]^ha)&A;c[a>>2]=(c[1184+(b*960|0)+120>>2]^da)&A^da;c[d>>2]=j^E;c[k>>2]=w^_;c[l>>2]=y^C;c[m>>2]=ia^G;c[n>>2]=aa^ca;c[o>>2]=ea^ba;c[p>>2]=$^Z;c[q>>2]=ga^fa;c[r>>2]=H^ha;ha=c[e>>2]|0;H=c[f>>2]|0;fa=c[W>>2]|0;ga=c[U>>2]|0;Z=c[S>>2]|0;$=c[Q>>2]|0;ba=c[O>>2]|0;ea=c[M>>2]|0;ca=c[K>>2]|0;aa=c[I>>2]|0;G=(c[1184+(b*960|0)+164>>2]^H)&A;ia=(c[1184+(b*960|0)+168>>2]^fa)&A;C=(c[1184+(b*960|0)+172>>2]^ga)&A;y=(c[1184+(b*960|0)+176>>2]^Z)&A;_=(c[1184+(b*960|0)+180>>2]^$)&A;w=(c[1184+(b*960|0)+184>>2]^ba)&A;E=(c[1184+(b*960|0)+188>>2]^ea)&A;j=(c[1184+(b*960|0)+192>>2]^ca)&A;da=(c[1184+(b*960|0)+196>>2]^aa)&A;c[e>>2]=(c[1184+(b*960|0)+160>>2]^ha)&A^ha;c[f>>2]=G^H;c[W>>2]=ia^fa;c[U>>2]=C^ga;c[S>>2]=y^Z;c[Q>>2]=_^$;c[O>>2]=w^ba;c[M>>2]=E^ea;c[K>>2]=j^ca;c[I>>2]=da^aa;aa=c[g>>2]|0;da=c[F>>2]|0;ca=c[D>>2]|0;j=c[B>>2]|0;ea=c[z>>2]|0;E=c[x>>2]|0;ba=c[v>>2]|0;w=c[i>>2]|0;$=c[t>>2]|0;_=c[u>>2]|0;Z=(c[1184+(b*960|0)+204>>2]^da)&A;y=(c[1184+(b*960|0)+208>>2]^ca)&A;ga=(c[1184+(b*960|0)+212>>2]^j)&A;C=(c[1184+(b*960|0)+216>>2]^ea)&A;fa=(c[1184+(b*960|0)+220>>2]^E)&A;ia=(c[1184+(b*960|0)+224>>2]^ba)&A;H=(c[1184+(b*960|0)+228>>2]^w)&A;G=(c[1184+(b*960|0)+232>>2]^$)&A;ha=(c[1184+(b*960|0)+236>>2]^_)&A;c[g>>2]=(c[1184+(b*960|0)+200>>2]^aa)&A^aa;c[F>>2]=Z^da;c[D>>2]=y^ca;c[B>>2]=ga^j;c[z>>2]=C^ea;c[x>>2]=fa^E;c[v>>2]=ia^ba;c[i>>2]=H^w;c[t>>2]=G^$;c[u>>2]=ha^_;_=c[a>>2]|0;ha=c[d>>2]|0;$=c[k>>2]|0;G=c[l>>2]|0;w=c[m>>2]|0;H=c[n>>2]|0;ba=c[o>>2]|0;ia=c[p>>2]|0;E=c[q>>2]|0;fa=c[r>>2]|0;ea=(h^3)+-1>>31;C=(c[1184+(b*960|0)+244>>2]^ha)&ea;j=(c[1184+(b*960|0)+248>>2]^$)&ea;ga=(c[1184+(b*960|0)+252>>2]^G)&ea;ca=(c[1184+(b*960|0)+256>>2]^w)&ea;y=(c[1184+(b*960|0)+260>>2]^H)&ea;da=(c[1184+(b*960|0)+264>>2]^ba)&ea;Z=(c[1184+(b*960|0)+268>>2]^ia)&ea;aa=(c[1184+(b*960|0)+272>>2]^E)&ea;A=(c[1184+(b*960|0)+276>>2]^fa)&ea;c[a>>2]=(c[1184+(b*960|0)+240>>2]^_)&ea^_;c[d>>2]=C^ha;c[k>>2]=j^$;c[l>>2]=ga^G;c[m>>2]=ca^w;c[n>>2]=y^H;c[o>>2]=da^ba;c[p>>2]=Z^ia;c[q>>2]=aa^E;c[r>>2]=A^fa;fa=c[e>>2]|0;A=c[f>>2]|0;E=c[W>>2]|0;aa=c[U>>2]|0;ia=c[S>>2]|0;Z=c[Q>>2]|0;ba=c[O>>2]|0;da=c[M>>2]|0;H=c[K>>2]|0;y=c[I>>2]|0;w=(c[1184+(b*960|0)+284>>2]^A)&ea;ca=(c[1184+(b*960|0)+288>>2]^E)&ea;G=(c[1184+(b*960|0)+292>>2]^aa)&ea;ga=(c[1184+(b*960|0)+296>>2]^ia)&ea;$=(c[1184+(b*960|0)+300>>2]^Z)&ea;j=(c[1184+(b*960|0)+304>>2]^ba)&ea;ha=(c[1184+(b*960|0)+308>>2]^da)&ea;C=(c[1184+(b*960|0)+312>>2]^H)&ea;_=(c[1184+(b*960|0)+316>>2]^y)&ea;c[e>>2]=(c[1184+(b*960|0)+280>>2]^fa)&ea^fa;c[f>>2]=w^A;c[W>>2]=ca^E;c[U>>2]=G^aa;c[S>>2]=ga^ia;c[Q>>2]=$^Z;c[O>>2]=j^ba;c[M>>2]=ha^da;c[K>>2]=C^H;c[I>>2]=_^y;y=c[g>>2]|0;_=c[F>>2]|0;H=c[D>>2]|0;C=c[B>>2]|0;da=c[z>>2]|0;ha=c[x>>2]|0;ba=c[v>>2]|0;j=c[i>>2]|0;Z=c[t>>2]|0;$=c[u>>2]|0;ia=(c[1184+(b*960|0)+324>>2]^_)&ea;ga=(c[1184+(b*960|0)+328>>2]^H)&ea;aa=(c[1184+(b*960|0)+332>>2]^C)&ea;G=(c[1184+(b*960|0)+336>>2]^da)&ea;E=(c[1184+(b*960|0)+340>>2]^ha)&ea;ca=(c[1184+(b*960|0)+344>>2]^ba)&ea;A=(c[1184+(b*960|0)+348>>2]^j)&ea;w=(c[1184+(b*960|0)+352>>2]^Z)&ea;fa=(c[1184+(b*960|0)+356>>2]^$)&ea;c[g>>2]=(c[1184+(b*960|0)+320>>2]^y)&ea^y;c[F>>2]=ia^_;c[D>>2]=ga^H;c[B>>2]=aa^C;c[z>>2]=G^da;c[x>>2]=E^ha;c[v>>2]=ca^ba;c[i>>2]=A^j;c[t>>2]=w^Z;c[u>>2]=fa^$;$=c[a>>2]|0;fa=c[d>>2]|0;Z=c[k>>2]|0;w=c[l>>2]|0;j=c[m>>2]|0;A=c[n>>2]|0;ba=c[o>>2]|0;ca=c[p>>2]|0;ha=c[q>>2]|0;E=c[r>>2]|0;da=(h^4)+-1>>31;G=(c[1184+(b*960|0)+364>>2]^fa)&da;C=(c[1184+(b*960|0)+368>>2]^Z)&da;aa=(c[1184+(b*960|0)+372>>2]^w)&da;H=(c[1184+(b*960|0)+376>>2]^j)&da;ga=(c[1184+(b*960|0)+380>>2]^A)&da;_=(c[1184+(b*960|0)+384>>2]^ba)&da;ia=(c[1184+(b*960|0)+388>>2]^ca)&da;y=(c[1184+(b*960|0)+392>>2]^ha)&da;ea=(c[1184+(b*960|0)+396>>2]^E)&da;c[a>>2]=(c[1184+(b*960|0)+360>>2]^$)&da^$;c[d>>2]=G^fa;c[k>>2]=C^Z;c[l>>2]=aa^w;c[m>>2]=H^j;c[n>>2]=ga^A;c[o>>2]=_^ba;c[p>>2]=ia^ca;c[q>>2]=y^ha;c[r>>2]=ea^E;E=c[e>>2]|0;ea=c[f>>2]|0;ha=c[W>>2]|0;y=c[U>>2]|0;ca=c[S>>2]|0;ia=c[Q>>2]|0;ba=c[O>>2]|0;_=c[M>>2]|0;A=c[K>>2]|0;ga=c[I>>2]|0;j=(c[1184+(b*960|0)+404>>2]^ea)&da;H=(c[1184+(b*960|0)+408>>2]^ha)&da;w=(c[1184+(b*960|0)+412>>2]^y)&da;aa=(c[1184+(b*960|0)+416>>2]^ca)&da;Z=(c[1184+(b*960|0)+420>>2]^ia)&da;C=(c[1184+(b*960|0)+424>>2]^ba)&da;fa=(c[1184+(b*960|0)+428>>2]^_)&da;G=(c[1184+(b*960|0)+432>>2]^A)&da;$=(c[1184+(b*960|0)+436>>2]^ga)&da;c[e>>2]=(c[1184+(b*960|0)+400>>2]^E)&da^E;c[f>>2]=j^ea;c[W>>2]=H^ha;c[U>>2]=w^y;c[S>>2]=aa^ca;c[Q>>2]=Z^ia;c[O>>2]=C^ba;c[M>>2]=fa^_;c[K>>2]=G^A;c[I>>2]=$^ga;ga=c[g>>2]|0;$=c[F>>2]|0;A=c[D>>2]|0;G=c[B>>2]|0;_=c[z>>2]|0;fa=c[x>>2]|0;ba=c[v>>2]|0;C=c[i>>2]|0;ia=c[t>>2]|0;Z=c[u>>2]|0;ca=(c[1184+(b*960|0)+444>>2]^$)&da;aa=(c[1184+(b*960|0)+448>>2]^A)&da;y=(c[1184+(b*960|0)+452>>2]^G)&da;w=(c[1184+(b*960|0)+456>>2]^_)&da;ha=(c[1184+(b*960|0)+460>>2]^fa)&da;H=(c[1184+(b*960|0)+464>>2]^ba)&da;ea=(c[1184+(b*960|0)+468>>2]^C)&da;j=(c[1184+(b*960|0)+472>>2]^ia)&da;E=(c[1184+(b*960|0)+476>>2]^Z)&da;c[g>>2]=(c[1184+(b*960|0)+440>>2]^ga)&da^ga;c[F>>2]=ca^$;c[D>>2]=aa^A;c[B>>2]=y^G;c[z>>2]=w^_;c[x>>2]=ha^fa;c[v>>2]=H^ba;c[i>>2]=ea^C;c[t>>2]=j^ia;c[u>>2]=E^Z;Z=c[a>>2]|0;E=c[d>>2]|0;ia=c[k>>2]|0;j=c[l>>2]|0;C=c[m>>2]|0;ea=c[n>>2]|0;ba=c[o>>2]|0;H=c[p>>2]|0;fa=c[q>>2]|0;ha=c[r>>2]|0;_=(h^5)+-1>>31;w=(c[1184+(b*960|0)+484>>2]^E)&_;G=(c[1184+(b*960|0)+488>>2]^ia)&_;y=(c[1184+(b*960|0)+492>>2]^j)&_;A=(c[1184+(b*960|0)+496>>2]^C)&_;aa=(c[1184+(b*960|0)+500>>2]^ea)&_;$=(c[1184+(b*960|0)+504>>2]^ba)&_;ca=(c[1184+(b*960|0)+508>>2]^H)&_;ga=(c[1184+(b*960|0)+512>>2]^fa)&_;da=(c[1184+(b*960|0)+516>>2]^ha)&_;c[a>>2]=(c[1184+(b*960|0)+480>>2]^Z)&_^Z;c[d>>2]=w^E;c[k>>2]=G^ia;c[l>>2]=y^j;c[m>>2]=A^C;c[n>>2]=aa^ea;c[o>>2]=$^ba;c[p>>2]=ca^H;c[q>>2]=ga^fa;c[r>>2]=da^ha;ha=c[e>>2]|0;da=c[f>>2]|0;fa=c[W>>2]|0;ga=c[U>>2]|0;H=c[S>>2]|0;ca=c[Q>>2]|0;ba=c[O>>2]|0;$=c[M>>2]|0;ea=c[K>>2]|0;aa=c[I>>2]|0;C=(c[1184+(b*960|0)+524>>2]^da)&_;A=(c[1184+(b*960|0)+528>>2]^fa)&_;j=(c[1184+(b*960|0)+532>>2]^ga)&_;y=(c[1184+(b*960|0)+536>>2]^H)&_;ia=(c[1184+(b*960|0)+540>>2]^ca)&_;G=(c[1184+(b*960|0)+544>>2]^ba)&_;E=(c[1184+(b*960|0)+548>>2]^$)&_;w=(c[1184+(b*960|0)+552>>2]^ea)&_;Z=(c[1184+(b*960|0)+556>>2]^aa)&_;c[e>>2]=(c[1184+(b*960|0)+520>>2]^ha)&_^ha;c[f>>2]=C^da;c[W>>2]=A^fa;c[U>>2]=j^ga;c[S>>2]=y^H;c[Q>>2]=ia^ca;c[O>>2]=G^ba;c[M>>2]=E^$;c[K>>2]=w^ea;c[I>>2]=Z^aa;aa=c[g>>2]|0;Z=c[F>>2]|0;ea=c[D>>2]|0;w=c[B>>2]|0;$=c[z>>2]|0;E=c[x>>2]|0;ba=c[v>>2]|0;G=c[i>>2]|0;ca=c[t>>2]|0;ia=c[u>>2]|0;H=(c[1184+(b*960|0)+564>>2]^Z)&_;y=(c[1184+(b*960|0)+568>>2]^ea)&_;ga=(c[1184+(b*960|0)+572>>2]^w)&_;j=(c[1184+(b*960|0)+576>>2]^$)&_;fa=(c[1184+(b*960|0)+580>>2]^E)&_;A=(c[1184+(b*960|0)+584>>2]^ba)&_;da=(c[1184+(b*960|0)+588>>2]^G)&_;C=(c[1184+(b*960|0)+592>>2]^ca)&_;ha=(c[1184+(b*960|0)+596>>2]^ia)&_;c[g>>2]=(c[1184+(b*960|0)+560>>2]^aa)&_^aa;c[F>>2]=H^Z;c[D>>2]=y^ea;c[B>>2]=ga^w;c[z>>2]=j^$;c[x>>2]=fa^E;c[v>>2]=A^ba;c[i>>2]=da^G;c[t>>2]=C^ca;c[u>>2]=ha^ia;ia=c[a>>2]|0;ha=c[d>>2]|0;ca=c[k>>2]|0;C=c[l>>2]|0;G=c[m>>2]|0;da=c[n>>2]|0;ba=c[o>>2]|0;A=c[p>>2]|0;E=c[q>>2]|0;fa=c[r>>2]|0;$=(h^6)+-1>>31;j=(c[1184+(b*960|0)+604>>2]^ha)&$;w=(c[1184+(b*960|0)+608>>2]^ca)&$;ga=(c[1184+(b*960|0)+612>>2]^C)&$;ea=(c[1184+(b*960|0)+616>>2]^G)&$;y=(c[1184+(b*960|0)+620>>2]^da)&$;Z=(c[1184+(b*960|0)+624>>2]^ba)&$;H=(c[1184+(b*960|0)+628>>2]^A)&$;aa=(c[1184+(b*960|0)+632>>2]^E)&$;_=(c[1184+(b*960|0)+636>>2]^fa)&$;c[a>>2]=(c[1184+(b*960|0)+600>>2]^ia)&$^ia;c[d>>2]=j^ha;c[k>>2]=w^ca;c[l>>2]=ga^C;c[m>>2]=ea^G;c[n>>2]=y^da;c[o>>2]=Z^ba;c[p>>2]=H^A;c[q>>2]=aa^E;c[r>>2]=_^fa;fa=c[e>>2]|0;_=c[f>>2]|0;E=c[W>>2]|0;aa=c[U>>2]|0;A=c[S>>2]|0;H=c[Q>>2]|0;ba=c[O>>2]|0;Z=c[M>>2]|0;da=c[K>>2]|0;y=c[I>>2]|0;G=(c[1184+(b*960|0)+644>>2]^_)&$;ea=(c[1184+(b*960|0)+648>>2]^E)&$;C=(c[1184+(b*960|0)+652>>2]^aa)&$;ga=(c[1184+(b*960|0)+656>>2]^A)&$;ca=(c[1184+(b*960|0)+660>>2]^H)&$;w=(c[1184+(b*960|0)+664>>2]^ba)&$;ha=(c[1184+(b*960|0)+668>>2]^Z)&$;j=(c[1184+(b*960|0)+672>>2]^da)&$;ia=(c[1184+(b*960|0)+676>>2]^y)&$;c[e>>2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b*960|0)+824>>2]^ba)&Z;$=(c[1184+(b*960|0)+828>>2]^j)&Z;w=(c[1184+(b*960|0)+832>>2]^A)&Z;E=(c[1184+(b*960|0)+836>>2]^H)&Z;c[g>>2]=(c[1184+(b*960|0)+800>>2]^ga)&Z^ga;c[F>>2]=ea^ca;c[D>>2]=aa^_;c[B>>2]=y^C;c[z>>2]=G^ia;c[x>>2]=ha^fa;c[v>>2]=da^ba;c[i>>2]=$^j;c[t>>2]=w^A;c[u>>2]=E^H;H=c[a>>2]|0;E=c[d>>2]|0;A=c[k>>2]|0;w=c[l>>2]|0;j=c[m>>2]|0;$=c[n>>2]|0;ba=c[o>>2]|0;da=c[p>>2]|0;fa=c[q>>2]|0;ha=c[r>>2]|0;ia=(h^8)+-1>>31;G=(c[1184+(b*960|0)+844>>2]^E)&ia;C=(c[1184+(b*960|0)+848>>2]^A)&ia;y=(c[1184+(b*960|0)+852>>2]^w)&ia;h=(c[1184+(b*960|0)+856>>2]^j)&ia;_=(c[1184+(b*960|0)+860>>2]^$)&ia;aa=(c[1184+(b*960|0)+864>>2]^ba)&ia;ca=(c[1184+(b*960|0)+868>>2]^da)&ia;ea=(c[1184+(b*960|0)+872>>2]^fa)&ia;ga=(c[1184+(b*960|0)+876>>2]^ha)&ia;c[a>>2]=(c[1184+(b*960|0)+840>>2]^H)&ia^H;c[d>>2]=G^E;c[k>>2]=C^A;c[l>>2]=y^w;c[m>>2]=h^j;c[n>>2]=_^$;c[o>>2]=aa^ba;c[p>>2]=ca^da;c[q>>2]=ea^fa;c[r>>2]=ga^ha;ha=c[e>>2]|0;ga=c[f>>2]|0;fa=c[W>>2]|0;ea=c[U>>2]|0;da=c[S>>2]|0;ca=c[Q>>2]|0;ba=c[O>>2]|0;aa=c[M>>2]|0;$=c[K>>2]|0;_=c[I>>2]|0;j=(c[1184+(b*960|0)+884>>2]^ga)&ia;h=(c[1184+(b*960|0)+888>>2]^fa)&ia;w=(c[1184+(b*960|0)+892>>2]^ea)&ia;y=(c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h)|0){b=-1;i=Qa;return b|0}if(!((a[h+31>>0]|(a[h+30>>0]|(a[h+29>>0]|(a[h+28>>0]|(a[h+27>>0]|(a[h+26>>0]|(a[h+25>>0]|(a[h+24>>0]|(a[h+23>>0]|(a[h+22>>0]|(a[h+21>>0]|(a[h+20>>0]|(a[h+19>>0]|(a[h+18>>0]|(a[h+17>>0]|(a[h+16>>0]|(a[h+15>>0]|(a[h+14>>0]|(a[h+13>>0]|(a[h+12>>0]|(a[h+11>>0]|(a[h+10>>0]|(a[h+9>>0]|(a[h+8>>0]|(a[h+7>>0]|(a[h+6>>0]|(a[h+5>>0]|(a[h+4>>0]|(a[h+3>>0]|(a[h+2>>0]|(a[h+1>>0]|a[h>>0])))))))))))))))))))))))))))))))<<24>>24)){b=-1;i=Qa;return b|0}l=n+64|0;q=l;c[q>>2]=0;c[q+4>>2]=0;q=n;o=8;r=q+64|0;do{c[q>>2]=c[o>>2];q=q+4|0;o=o+4|0}while((q|0)<(r|0));m=n+72|0;q=m;c[q>>2]=256;c[q+4>>2]=0;q=l;c[q>>2]=0;c[q+4>>2]=0;q=n+80|0;o=b;r=q+32|0;do{a[q>>0]=a[o>>0]|0;q=q+1|0;o=o+1|0}while((q|0)<(r|0));q=m;c[q>>2]=512;c[q+4>>2]=0;q=l;c[q>>2]=0;c[q+4>>2]=0;q=n+112|0;o=h;r=q+32|0;do{a[q>>0]=a[o>>0]|0;q=q+1|0;o=o+1|0}while((q|0)<(r|0));Fb(n,e,f,g);Gb(n,p);Wc(p);f=0;do{a[Na+f>>0]=(d[p+(f>>3)>>0]|0)>>>(f&7)&1;f=f+1|0}while((f|0)!=256);p=b+32|0;o=0;while(1){e=Na+o|0;a:do if(a[e>>0]|0){h=1;do{g=h+o|0;if((g|0)>=256)break a;m=Na+g|0;f=a[m>>0]|0;b:do if(f<<24>>24){n=a[e>>0]|0;f=f<<24>>24<>0]=l;a[m>>0]=0;break}f=n-f|0;if((f|0)<=-16)break a;a[e>>0]=f;while(1){f=Na+g|0;if(!(a[f>>0]|0))break;a[f>>0]=0;g=g+1|0;if((g|0)>=256)break b}a[f>>0]=1}while(0);h=h+1|0}while((h|0)<7)}while(0);o=o+1|0;if((o|0)==256){f=0;break}}do{a[Oa+f>>0]=(d[p+(f>>3)>>0]|0)>>>(f&7)&1;f=f+1|0}while((f|0)!=256);o=0;do{e=Oa+o|0;c:do if(a[e>>0]|0){h=1;do{g=h+o|0;if((g|0)>=256)break c;m=Oa+g|0;f=a[m>>0]|0;d:do if(f<<24>>24){n=a[e>>0]|0;f=f<<24>>24<>0]=l;a[m>>0]=0;break}f=n-f|0;if((f|0)<=-16)break c;a[e>>0]=f;while(1){f=Oa+g|0;if(!(a[f>>0]|0))break;a[f>>0]=0;g=g+1|0;if((g|0)>=256)break d}a[f>>0]=1}while(0);h=h+1|0}while((h|0)<7)}while(0);o=o+1|0}while((o|0)!=256);Qc(Ja,s);Ia=c[s+4>>2]|0;r=c[s+8>>2]|0;q=c[s+12>>2]|0;Ga=c[s+16>>2]|0;Fa=c[s+20>>2]|0;Ea=c[s+24>>2]|0;Da=c[s+28>>2]|0;Ca=c[s+32>>2]|0;Ba=c[s+36>>2]|0;c[Ma>>2]=c[s>>2];c[Ma+4>>2]=Ia;c[Ma+8>>2]=r;c[Ma+12>>2]=q;c[Ma+16>>2]=Ga;c[Ma+20>>2]=Fa;c[Ma+24>>2]=Ea;c[Ma+28>>2]=Da;c[Ma+32>>2]=Ca;c[Ma+36>>2]=Ba;Ba=c[s+44>>2]|0;Ca=c[s+48>>2]|0;Da=c[s+52>>2]|0;Ea=c[s+56>>2]|0;Fa=c[s+60>>2]|0;Ga=c[s+64>>2]|0;q=c[s+68>>2]|0;r=c[s+72>>2]|0;Ia=c[s+76>>2]|0;c[Ma+40>>2]=c[s+40>>2];c[Ma+44>>2]=Ba;c[Ma+48>>2]=Ca;c[Ma+52>>2]=Da;c[Ma+56>>2]=Ea;c[Ma+60>>2]=Fa;c[Ma+64>>2]=Ga;c[Ma+68>>2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ka,t,q);Jc(La,Ka,Ba);Jc(Ea,Ca,Da);Jc(Fa,Da,Ba);Jc(Ga,Ka,Ca);Qc(Ja+1120|0,La);q=j;r=q+40|0;do{c[q>>2]=0;q=q+4|0}while((q|0)<(r|0));Ha=j+40|0;c[Ha>>2]=1;q=j+44|0;r=q+36|0;do{c[q>>2]=0;q=q+4|0}while((q|0)<(r|0));Ia=j+80|0;c[Ia>>2]=1;q=j+84|0;r=q+36|0;do{c[q>>2]=0;q=q+4|0}while((q|0)<(r|0));g=255;while(1){if(a[Na+g>>0]|0){f=g;break}if(a[Oa+g>>0]|0){f=g;break}f=g+-1|0;if((g|0)>0)g=f;else break}if((f|0)>-1){l=La+44|0;m=La+48|0;n=La+52|0;e=La+56|0;h=La+60|0;o=La+64|0;p=La+68|0;q=La+72|0;r=La+76|0;s=La+4|0;t=La+8|0;u=La+12|0;v=La+16|0;w=La+20|0;x=La+24|0;y=La+28|0;z=La+32|0;A=La+36|0;B=Ka+4|0;C=Ka+8|0;D=Ka+12|0;E=Ka+16|0;F=Ka+20|0;G=Ka+24|0;H=Ka+28|0;I=Ka+32|0;J=Ka+36|0;K=Ka+44|0;L=Ka+48|0;M=Ka+52|0;N=Ka+56|0;O=Ka+60|0;P=Ka+64|0;Q=Ka+68|0;R=Ka+72|0;S=Ka+76|0;T=La+84|0;U=La+88|0;V=La+92|0;W=La+96|0;X=La+100|0;Y=La+104|0;Z=La+108|0;_=La+112|0;$=La+116|0;aa=k+4|0;ba=k+8|0;ca=k+12|0;da=k+16|0;ea=k+20|0;fa=k+24|0;ga=k+28|0;ha=k+32|0;ia=k+36|0;ja=Ka+84|0;ka=Ka+88|0;la=Ka+92|0;ma=Ka+96|0;na=Ka+100|0;oa=Ka+104|0;pa=Ka+108|0;qa=Ka+112|0;ra=Ka+116|0;sa=Ka+124|0;ta=Ka+128|0;ua=Ka+132|0;va=Ka+136|0;wa=Ka+140|0;xa=Ka+144|0;ya=Ka+148|0;za=Ka+152|0;Aa=Ka+156|0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[c+22>>0]^a[b+22>>0]|a[c+23>>0]^a[b+23>>0]|a[c+24>>0]^a[b+24>>0]|a[c+25>>0]^a[b+25>>0]|a[c+26>>0]^a[b+26>>0]|a[c+27>>0]^a[b+27>>0]|a[c+28>>0]^a[b+28>>0]|a[c+29>>0]^a[b+29>>0]|a[c+30>>0]^a[b+30>>0]|a[c+31>>0]^a[b+31>>0])&255)+511|0)>>>8&1)+-1|0}function Zc(a){a=a|0;c[7976]=a;return 0}function _c(){return Ba(0)|0}function $c(){Ba(1);return}function ad(a){a=a|0;var b=0,d=0;b=c[7976]|0;if((b|0)!=0?(d=c[b+12>>2]|0,(d|0)!=0):0){a=Ea[d&31](a)|0;return a|0}if(a>>>0<2){a=0;return a|0}b=((0-a|0)>>>0)%(a>>>0)|0;do d=Ba(0)|0;while(d>>>0>>0);a=(d>>>0)%(a>>>0)|0;return a|0}function bd(b,c){b=b|0;c=c|0;var d=0;if(!c)return;else d=0;do{a[b+d>>0]=Ba(0)|0;d=d+1|0}while((d|0)!=(c|0));return}function cd(){var a=0;a=c[7976]|0;if(!a){a=0;return a|0}a=c[a+20>>2]|0;if(!a){a=0;return a|0}a=Da[a&31]()|0;return a|0}function dd(){var a=0,b=0;if(c[7977]|0){b=1;return b|0}Ba(1);a=na(30)|0;if((a|0)>0)c[7978]=a;else a=c[7978]|0;if(a>>>0<16)ra();else b=0;do{Ba(0)|0;b=b+1|0}while((b|0)!=16);c[7977]=1;b=0;return b|0}function ed(a,b){a=a|0;b=b|0;Fd(a|0,0,b|0)|0;return}function fd(b,c,e,f){b=b|0;c=c|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;g=f<<1;if(!(f>>>0<2147483647&g>>>0>>0))ra();if(!f){f=0;f=b+f|0;a[f>>0]=0;return b|0}else c=0;do{j=d[e+c>>0]|0;i=j&15;j=j>>>4;h=c<<1;a[b+h>>0]=j+87+((j+65526|0)>>>8&217);a[b+(h|1)>>0]=((i<<8)+22272+(i+65526&55552)|0)>>>8;c=c+1|0}while((c|0)!=(f|0));j=b+g|0;a[j>>0]=0;return b|0}function gd(b,e,f,g,h,i,j){b=b|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,s=0,t=0,u=0;a:do if(!g){n=0;l=0;o=0;k=0}else{b:do if(!h){n=0;r=0;l=0;k=0;while(1){p=d[f+l>>0]|0;m=p^48;o=(m+65526|0)>>>8;p=(p&223)+201|0;q=p&255;q=(q+65526^q+65520)>>>8;if(!((q|o)&255)){o=0;break a}m=q&p|o&m;if(n>>>0>=e>>>0){m=k;break b}if(!(k<<24>>24))m=m<<4&255;else{a[b+n>>0]=m|r&255;n=n+1|0;m=r}k=(k&255^255)&255;l=l+1|0;if(l>>>0>>0)r=m;else{o=0;break a}}}else{n=0;u=0;l=0;k=0;while(1){t=k<<24>>24==0;c:do if(!t){q=d[f+l>>0]|0;m=q^48;o=(m+65526|0)>>>8;q=(q&223)+201|0;p=q&255;p=(p+65526^p+65520)>>>8;if(!((p|o)&255)){o=0;break a}}else while(1){q=a[f+l>>0]|0;r=q&255;m=r^48;o=(m+65526|0)>>>8;s=(r&223)+201|0;p=s&255;p=(p+65526^p+65520)>>>8;if((p|o)&255){q=s;break c}s=ud(h,r)|0;if((s|0)==0?1:(a[s>>0]|0)!=q<<24>>24){o=0;k=0;break a}l=l+1|0;if(l>>>0>=g>>>0){o=0;k=0;break a}}while(0);m=p&q|o&m;if(n>>>0>=e>>>0){m=k;break b}if(t)m=m<<4&255;else{a[b+n>>0]=m|u&255;n=n+1|0;m=u}k=(k&255^255)&255;l=l+1|0;if(l>>>0>>0)u=m;else{o=0;break a}}}while(0);if(!(c[7979]|0))k=31964;else k=c[(oa()|0)+60>>2]|0;c[k>>2]=34;o=-1;k=m}while(0);if(j)c[j>>2]=f+(((k<<24>>24!=0)<<31>>31)+l);if(!i)return o|0;c[i>>2]=n;return o|0}function hd(){return 33779}function id(){return 8}function jd(){return 0}function kd(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}if((w|0)==8?(ob(A,v,B,33833),(y|0)!=0):0){l=0;do{a[x+l>>0]=a[A+l>>0]^a[z+l>>0];l=l+1|0}while((l|0)!=(y|0))}n=A;m=n+64|0;do{a[n>>0]=0;n=n+1|0}while((n|0)<(m|0));n=B;m=n+32|0;do{a[n>>0]=0;n=n+1|0}while((n|0)<(m|0));i=D;return}function od(){var a=0;if(!(c[7979]|0))a=31964;else a=c[(oa()|0)+60>>2]|0;return a|0}function pd(a){a=a|0;var b=0,d=0;d=i;b=i=i+63&-64;i=i+16|0;c[b>>2]=c[a+60>>2];a=pa(6,b|0)|0;if(a>>>0>4294963200){if(!(c[7979]|0))b=31964;else b=c[(oa()|0)+60>>2]|0;c[b>>2]=0-a;a=-1}i=d;return a|0}function qd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=i;e=i=i+63&-64;i=i+32|0;h=e;e=e+20|0;c[h>>2]=c[a+60>>2];c[h+4>>2]=0;c[h+8>>2]=b;c[h+12>>2]=e;c[h+16>>2]=d;b=ya(140,h|0)|0;if(b>>>0<=4294963200)if((b|0)<0)f=7;else a=c[e>>2]|0;else{if(!(c[7979]|0))a=31964;else a=c[(oa()|0)+60>>2]|0;c[a>>2]=0-b;f=7}if((f|0)==7){c[e>>2]=-1;a=-1}i=g;return a|0}function rd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;q=i;k=i=i+63&-64;i=i+48|0;n=k+16|0;m=k;k=k+32|0;o=a+28|0;g=c[o>>2]|0;c[k>>2]=g;p=a+20|0;g=(c[p>>2]|0)-g|0;c[k+4>>2]=g;c[k+8>>2]=b;c[k+12>>2]=d;j=a+60|0;l=a+44|0;f=2;g=g+d|0;while(1){if(!(c[7979]|0)){c[n>>2]=c[j>>2];c[n+4>>2]=k;c[n+8>>2]=f;b=Aa(146,n|0)|0;if(b>>>0>4294963200){if(!(c[7979]|0))e=31964;else e=c[(oa()|0)+60>>2]|0;c[e>>2]=0-b;b=-1}}else{ua(18,a|0);c[m>>2]=c[j>>2];c[m+4>>2]=k;c[m+8>>2]=f;b=Aa(146,m|0)|0;if(b>>>0>4294963200){if(!(c[7979]|0))e=31964;else e=c[(oa()|0)+60>>2]|0;c[e>>2]=0-b;b=-1}la(0)}if((g|0)==(b|0)){b=13;break}if((b|0)<0){b=15;break}g=g-b|0;e=c[k+4>>2]|0;if(b>>>0<=e>>>0)if((f|0)==2){c[o>>2]=(c[o>>2]|0)+b;h=e;e=k;f=2}else{h=e;e=k}else{h=c[l>>2]|0;c[o>>2]=h;c[p>>2]=h;h=c[k+12>>2]|0;b=b-e|0;e=k+8|0;f=f+-1|0}c[e>>2]=(c[e>>2]|0)+b;c[e+4>>2]=h-b;k=e}if((b|0)==13){n=c[l>>2]|0;c[a+16>>2]=n+(c[a+48>>2]|0);a=n;c[o>>2]=a;c[p>>2]=a}else if((b|0)==15){c[a+16>>2]=0;c[o>>2]=0;c[p>>2]=0;c[a>>2]=c[a>>2]|32;if((f|0)==2)d=0;else d=d-(c[k+4>>2]|0)|0}i=q;return d|0}function sd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=i;h=i=i+63&-64;i=i+80|0;f=h;c[b+36>>2]=20;if((c[b>>2]&64|0)==0?(c[f>>2]=c[b+60>>2],c[f+4>>2]=21505,c[f+8>>2]=h+12,(wa(54,f|0)|0)!=0):0)a[b+75>>0]=-1;h=rd(b,d,e)|0;i=g;return h|0}function td(a){a=a|0;var b=0;if(!a){if(!(c[7990]|0))a=0;else a=td(c[7990]|0)|0;ma(31944);b=c[7985]|0;if(b)do{if((c[b+20>>2]|0)>>>0>(c[b+28>>2]|0)>>>0)a=xd(b)|0|a;b=c[b+56>>2]|0}while((b|0)!=0);xa(31944)}else a=xd(a)|0;return a|0}function ud(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;f=d&255;a:do if(!f)b=b+(vd(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=_(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)break b;b=b+4|0;e=c[b>>2]|0}while(((e&-2139062144^-2139062144)&e+-16843009|0)==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 vd(b){b=b|0;var d=0,e=0,f=0;f=b;a:do if(!(f&3))e=4;else{d=b;b=f;while(1){if(!(a[d>>0]|0))break a;d=d+1|0;b=d;if(!(b&3)){b=d;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 wd(a){a=a|0;return}function xd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=a+20|0;g=a+28|0;if((c[b>>2]|0)>>>0>(c[g>>2]|0)>>>0?(Fa[c[a+36>>2]&31](a,0,0)|0,(c[b>>2]|0)==0):0)b=-1;else{h=a+4|0;d=c[h>>2]|0;e=a+8|0;f=c[e>>2]|0;if(d>>>0>>0)Fa[c[a+40>>2]&31](a,d-f|0,1)|0;c[a+16>>2]=0;c[g>>2]=0;c[b>>2]=0;c[e>>2]=0;c[h>>2]=0;b=0}return b|0} function Hb(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=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,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0;h=i;g=i=i+63&-64;i=i+640|0;e=0;do{j=b+(e<<3)|0;o=d[j+7>>0]|0;p=Hd(d[j+6>>0]|0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;return Qb(a,b,c,d,e)|0}function Nb(a,b){a=a|0;b=b|0;Ub(a,b);return 0}function Ob(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;Tb(a,b,c,d);return 0}function Pb(a,b){a=a|0;b=b|0;Rb(a,b);return 0}function Qb(b,c,d,e,f){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0;h=i;g=i=i+63&-64;i=i+160|0;j=g;g=g+144|0;Ub(j,f);Tb(j,c,d,e);Rb(j,g);i=h;return ((((a[g+1>>0]^a[b+1>>0]|a[g>>0]^a[b>>0]|a[g+2>>0]^a[b+2>>0]|a[g+3>>0]^a[b+3>>0]|a[g+4>>0]^a[b+4>>0]|a[g+5>>0]^a[b+5>>0]|a[g+6>>0]^a[b+6>>0]|a[g+7>>0]^a[b+7>>0]|a[g+8>>0]^a[b+8>>0]|a[g+9>>0]^a[b+9>>0]|a[g+10>>0]^a[b+10>>0]|a[g+11>>0]^a[b+11>>0]|a[g+12>>0]^a[b+12>>0]|a[g+13>>0]^a[b+13>>0]|a[g+14>>0]^a[b+14>>0]|a[g+15>>0]^a[b+15>>0])&255)+511|0)>>>8&1)+-1|0}function Rb(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;h=b+56|0;g=c[h>>2]|0;h=c[h+4>>2]|0;if(!((g|0)==0&(h|0)==0)){e=b+64|0;a[e+g>>0]=1;f=Dd(g|0,h|0,1,0)|0;i=C;if(i>>>0<0|(i|0)==0&f>>>0<16){i=Cd(14,0,g|0,h|0)|0;Fd(b+(f+64)|0,0,i+1|0)|0}a[b+80>>0]=1;Sb(b,e,16,0)}i=c[b+24>>2]|0;p=(c[b+28>>2]|0)+(i>>>26)|0;e=p&67108863;n=(p>>>26)+(c[b+32>>2]|0)|0;m=n&67108863;f=(n>>>26)+(c[b+36>>2]|0)|0;h=((f>>>26)*5|0)+(c[b+20>>2]|0)|0;g=h&67108863;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>4&67092735;c[b+12>>2]=((d[e+10>>0]|0)<<8|(d[f>>0]|0)|(d[e+11>>0]|0)<<16|(d[e+12>>0]|0)<<24)>>>6&66076671;c[b+16>>2]=(d[e+14>>0]|0)<<8|(d[e+13>>0]|0)|(d[e+15>>0]|0)<<16&983040;f=b+20|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[b+40>>2]=(d[e+17>>0]|0)<<8|(d[e+16>>0]|0)|(d[e+18>>0]|0)<<16|(d[e+19>>0]|0)<<24;c[b+44>>2]=(d[e+21>>0]|0)<<8|(d[e+20>>0]|0)|(d[e+22>>0]|0)<<16|(d[e+23>>0]|0)<<24;c[b+48>>2]=(d[e+25>>0]|0)<<8|(d[e+24>>0]|0)|(d[e+26>>0]|0)<<16|(d[e+27>>0]|0)<<24;c[b+52>>2]=(d[e+29>>0]|0)<<8|(d[e+28>>0]|0)|(d[e+30>>0]|0)<<16|(d[e+31>>0]|0)<<24;e=b+56|0;c[e>>2]=0;c[e+4>>2]=0;a[b+80>>0]=0;return}function Vb(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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=i;t=i=i+63&-64;i=i+48|0;j=t+8|0;u=t+4|0;if((a[g>>0]|0)!=36){h=0;i=w;return h|0}if((a[g+1>>0]|0)!=55){h=0;i=w;return h|0}if((a[g+2>>0]|0)!=36){h=0;i=w;return h|0}o=a[g+3>>0]|0;n=o&255;a:do if(1){l=65;k=34881;do{if((a[k>>0]|0)==o<<24>>24)break a;k=k+1|0;l=l+-1|0;m=(l|0)!=0}while(m&(k&3|0)!=0);if(!m){h=0;i=w;return h|0}}else{l=65;k=34881}while(0);b:do if((a[k>>0]|0)!=o<<24>>24){m=_(n,16843009)|0;c:do if(l>>>0>3)while(1){s=c[k>>2]^m;if((s&-2139062144^-2139062144)&s+-16843009)break c;k=k+4|0;l=l+-4|0;if(l>>>0<=3){v=12;break}}else v=12;while(0);if((v|0)==12)if(!l){h=0;i=w;return h|0}while(1){if((a[k>>0]|0)==o<<24>>24)break b;l=l+-1|0;if(!l){j=0;break}else k=k+1|0}i=w;return j|0}while(0);if((k|0)==0|(l|0)==0){h=0;i=w;return h|0}r=Hd(1,0,k-34881|0)|0;s=C;k=Xb(u,g+4|0)|0;if(!k){h=0;i=w;return h|0}q=Xb(t,k)|0;if(!q){h=0;i=w;return h|0}o=q;p=o-g|0;n=(o&3|0)==0;d:do if(n){k=q;v=22}else{l=q;k=o;while(1){if(!(a[l>>0]|0))break d;l=l+1|0;k=l;if(!(k&3)){k=l;v=22;break}}}while(0);if((v|0)==22){while(1){l=c[k>>2]|0;if(!((l&-2139062144^-2139062144)&l+-16843009))k=k+4|0;else break}if((l&255)<<24>>24)do k=k+1|0;while((a[k>>0]|0)!=0)}l=k-o+1|0;while(1){k=l+-1|0;if(!l){v=32;break}m=q+k|0;if((a[m>>0]|0)==36){v=30;break}else l=k}if((v|0)==30)if(!m)v=32;else l=l+-1|0;if((v|0)==32){e:do if(n){k=q;v=35}else{k=q;l=o;while(1){if(!(a[k>>0]|0)){k=l;break e}k=k+1|0;l=k;if(!(l&3)){v=35;break}}}while(0);if((v|0)==35){while(1){l=c[k>>2]|0;if(!((l&-2139062144^-2139062144)&l+-16843009))k=k+4|0;else break}if((l&255)<<24>>24)do k=k+1|0;while((a[k>>0]|0)!=0)}l=k-o|0}k=l+p|0;p=k+45|0;if(p>>>0>102|p>>>0>>0){h=0;i=w;return h|0}if(hc(b,e,f,q,l,r,s,c[u>>2]|0,c[t>>2]|0,j,32)|0){h=0;i=w;return h|0}Id(h|0,g|0,k|0)|0;s=h+k|0;r=s+1|0;a[s>>0]=36;s=r;r=h+102-r|0;k=0;f:while(1){if(k>>>0<32){p=0;q=k;k=0}else break;do{g=q;q=q+1|0;k=d[j+g>>0]<>>0<32&p>>>0<24);if(!p)k=s;else{l=k;m=r;n=s;o=0;while(1){if(!m){v=50;break f}k=n+1|0;a[n>>0]=a[34881+(l&63)>>0]|0;o=o+6|0;if(o>>>0>=p>>>0)break;else{l=l>>>6;m=m+-1|0;n=k}}}g=(k|0)==0;r=(g?0:s-k|0)+r|0;if(g){v=50;break}else{s=k;k=q}}if((v|0)==50){k=j+32|0;do{a[j>>0]=0;j=j+1|0}while((j|0)<(k|0));h=0;i=w;return h|0}k=j+32|0;do{a[j>>0]=0;j=j+1|0}while((j|0)<(k|0));if(!((s|0)!=0&s>>>0<(h+102|0)>>>0)){h=0;i=w;return h|0}a[s>>0]=0;i=w;return h|0}function Wb(a,b,d,e,f,g,h,j,k,l){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0;m=i;n=i=i+63&-64;i=i+16|0;c[n+4>>2]=0;c[n>>2]=0;c[n+8>>2]=0;f=hc(n,a,b,d,e,f,g,h,j,k,l)|0;g=c[n>>2]|0;if(!g){i=m;return f|0}zd(g);i=m;return f|0}function Xb(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;i=a[d>>0]|0;h=i&255;a:do if(1){e=65;f=34881;do{if((a[f>>0]|0)==i<<24>>24)break a;f=f+1|0;e=e+-1|0;g=(e|0)!=0}while(g&(f&3|0)!=0);if(!g){d=0;n=0;c[b>>2]=n;return d|0}}else{e=65;f=34881}while(0);b:do if((a[f>>0]|0)!=i<<24>>24){g=_(h,16843009)|0;c:do if(e>>>0>3)while(1){m=c[f>>2]^g;if((m&-2139062144^-2139062144)&m+-16843009)break c;f=f+4|0;e=e+-4|0;if(e>>>0<=3){n=9;break}}else n=9;while(0);if((n|0)==9)if(!e){d=0;n=0;c[b>>2]=n;return d|0}while(1){if((a[f>>0]|0)==i<<24>>24)break b;e=e+-1|0;if(!e){e=0;f=0;break}else f=f+1|0}c[b>>2]=f;return e|0}while(0);if((f|0)==0|(e|0)==0){d=0;n=0;c[b>>2]=n;return d|0}j=a[d+1>>0]|0;i=j&255;d:do if(1){e=65;g=34881;do{if((a[g>>0]|0)==j<<24>>24)break d;g=g+1|0;e=e+-1|0;h=(e|0)!=0}while(h&(g&3|0)!=0);if(!h){d=0;n=0;c[b>>2]=n;return d|0}}else{e=65;g=34881}while(0);e:do if((a[g>>0]|0)!=j<<24>>24){h=_(i,16843009)|0;f:do if(e>>>0>3)while(1){m=c[g>>2]^h;if((m&-2139062144^-2139062144)&m+-16843009)break f;g=g+4|0;e=e+-4|0;if(e>>>0<=3){n=22;break}}else n=22;while(0);if((n|0)==22)if(!e){d=0;n=0;c[b>>2]=n;return d|0}while(1){if((a[g>>0]|0)==j<<24>>24)break e;e=e+-1|0;if(!e){e=0;f=0;break}else g=g+1|0}c[b>>2]=f;return e|0}while(0);if((g|0)==0|(e|0)==0){d=0;n=0;c[b>>2]=n;return d|0}k=a[d+2>>0]|0;j=k&255;g:do if(1){e=65;h=34881;do{if((a[h>>0]|0)==k<<24>>24)break g;h=h+1|0;e=e+-1|0;i=(e|0)!=0}while(i&(h&3|0)!=0);if(!i){d=0;n=0;c[b>>2]=n;return d|0}}else{e=65;h=34881}while(0);h:do if((a[h>>0]|0)!=k<<24>>24){i=_(j,16843009)|0;i:do if(e>>>0>3)while(1){m=c[h>>2]^i;if((m&-2139062144^-2139062144)&m+-16843009)break i;h=h+4|0;e=e+-4|0;if(e>>>0<=3){n=36;break}}else n=36;while(0);if((n|0)==36)if(!e){d=0;n=0;c[b>>2]=n;return d|0}while(1){if((a[h>>0]|0)==k<<24>>24)break h;e=e+-1|0;if(!e){e=0;f=0;break}else h=h+1|0}c[b>>2]=f;return e|0}while(0);if((h|0)==0|(e|0)==0){d=0;n=0;c[b>>2]=n;return d|0}l=a[d+3>>0]|0;k=l&255;j:do if(1){e=65;i=34881;do{if((a[i>>0]|0)==l<<24>>24)break j;i=i+1|0;e=e+-1|0;j=(e|0)!=0}while(j&(i&3|0)!=0);if(!j){d=0;n=0;c[b>>2]=n;return d|0}}else{e=65;i=34881}while(0);k:do if((a[i>>0]|0)==l<<24>>24)m=i;else{j=_(k,16843009)|0;l:do if(e>>>0>3)while(1){m=c[i>>2]^j;if((m&-2139062144^-2139062144)&m+-16843009)break l;i=i+4|0;e=e+-4|0;if(e>>>0<=3){n=49;break}}else n=49;while(0);if((n|0)==49)if(!e){d=0;n=0;c[b>>2]=n;return d|0}while(1){if((a[i>>0]|0)==l<<24>>24){m=i;break k}e=e+-1|0;if(!e){e=0;f=0;break}else i=i+1|0}c[b>>2]=f;return e|0}while(0);if((m|0)==0|(e|0)==0){d=0;n=0;c[b>>2]=n;return d|0}l=a[d+4>>0]|0;k=l&255;m:do if(1){i=65;e=34881;do{if((a[e>>0]|0)==l<<24>>24)break m;e=e+1|0;i=i+-1|0;j=(i|0)!=0}while(j&(e&3|0)!=0);if(!j){d=0;n=0;c[b>>2]=n;return d|0}}else{i=65;e=34881}while(0);n:do if((a[e>>0]|0)!=l<<24>>24){j=_(k,16843009)|0;o:do if(i>>>0>3)while(1){k=c[e>>2]^j;if((k&-2139062144^-2139062144)&k+-16843009)break o;e=e+4|0;i=i+-4|0;if(i>>>0<=3){n=62;break}}else n=62;while(0);if((n|0)==62)if(!i){d=0;n=0;c[b>>2]=n;return d|0}while(1){if((a[e>>0]|0)==l<<24>>24)break n;i=i+-1|0;if(!i){e=0;f=0;break}else e=e+1|0}c[b>>2]=f;return e|0}while(0);if((e|0)==0|(i|0)==0){d=0;n=0;c[b>>2]=n;return d|0}d=d+5|0;n=e-34881<<24|(m-34881<<18|(h-34881<<12|(g-34881<<6|f-34881)));c[b>>2]=n;return d|0}function Yb(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 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;A=i;w=i=i+63&-64;i=i+560|0;r=w+488|0;z=w+456|0;v=w+208|0;x=w;y=w+416|0;w=w+424|0;n=v+32|0;if(d>>>0<=64){p=n;c[p>>2]=0;c[p+4>>2]=0;c[v>>2]=c[18];c[v+4>>2]=c[19];c[v+8>>2]=c[20];c[v+12>>2]=c[21];c[v+16>>2]=c[22];c[v+20>>2]=c[23];c[v+24>>2]=c[24];c[v+28>>2]=c[25];p=r;q=p+64|0;do{a[p>>0]=54;p=p+1|0}while((p|0)<(q|0));l=(d|0)==0;if(!l){j=d;k=n;a[r>>0]=a[b>>0]^54;if((j|0)==1)d=j;else{d=j;m=8}}else k=n}else{c[v>>2]=c[18];c[v+4>>2]=c[19];c[v+8>>2]=c[20];c[v+12>>2]=c[21];c[v+16>>2]=c[22];c[v+20>>2]=c[23];c[v+24>>2]=c[24];c[v+28>>2]=c[25];p=Hd(d|0,0,3)|0;l=n;c[l>>2]=p;c[l+4>>2]=C;l=v+40|0;p=l;m=b;q=p+64|0;do{a[p>>0]=a[m>>0]|0;p=p+1|0;m=m+1|0}while((p|0)<(q|0));Eb(v,l);j=b+64|0;k=Dd(d|0,0,-64,-1)|0;b=C;if(b>>>0>0|(b|0)==0&k>>>0>63){do{Eb(v,j);j=j+64|0;k=Dd(k|0,b|0,-64,-1)|0;b=C}while(b>>>0>0|(b|0)==0&k>>>0>63);b=k}else b=k;Id(l|0,j|0,b|0)|0;Db(v,z);p=n;c[p>>2]=0;c[p+4>>2]=0;c[v>>2]=c[18];c[v+4>>2]=c[19];c[v+8>>2]=c[20];c[v+12>>2]=c[21];c[v+16>>2]=c[22];c[v+20>>2]=c[23];c[v+24>>2]=c[24];c[v+28>>2]=c[25];p=r;q=p+64|0;do{a[p>>0]=54;p=p+1|0}while((p|0)<(q|0));a[r>>0]=a[z>>0]^54;d=32;b=z;k=n;l=0;m=8}if((m|0)==8){j=1;do{u=r+j|0;a[u>>0]=a[u>>0]^a[b+j>>0];j=j+1|0}while((j|0)!=(d|0))}o=k;c[o>>2]=512;c[o+4>>2]=0;o=v+40|0;p=o;m=r;q=p+64|0;do{a[p>>0]=a[m>>0]|0;p=p+1|0;m=m+1|0}while((p|0)<(q|0));Eb(v,o);n=v+104|0;m=v+136|0;p=m;c[p>>2]=0;c[p+4>>2]=0;c[n>>2]=c[18];c[n+4>>2]=c[19];c[n+8>>2]=c[20];c[n+12>>2]=c[21];c[n+16>>2]=c[22];c[n+20>>2]=c[23];c[n+24>>2]=c[24];c[n+28>>2]=c[25];p=r;q=p+64|0;do{a[p>>0]=92;p=p+1|0}while((p|0)<(q|0));if(!l?(a[r>>0]=a[b>>0]^92,(d|0)!=1):0){j=1;do{u=r+j|0;a[u>>0]=a[u>>0]^a[b+j>>0];j=j+1|0}while((j|0)!=(d|0))}j=m;c[j>>2]=512;c[j+4>>2]=0;j=v+144|0;p=j;m=r;q=p+64|0;do{a[p>>0]=a[m>>0]|0;p=p+1|0;m=m+1|0}while((p|0)<(q|0));Eb(n,j);do if(f){b=k;t=c[b>>2]|0;b=c[b+4>>2]|0;j=Gd(t|0,b|0,3)|0;j=j&63;u=Hd(f|0,0,3)|0;u=Dd(t|0,b|0,u|0,C|0)|0;b=k;c[b>>2]=u;c[b+4>>2]=C;b=64-j|0;j=v+40+j|0;if(b>>>0>f>>>0){Id(j|0,e|0,f|0)|0;break}Id(j|0,e|0,b|0)|0;Eb(v,o);j=e+b|0;k=Cd(f|0,0,b|0,0)|0;b=C;if(b>>>0>0|(b|0)==0&k>>>0>63){do{Eb(v,j);j=j+64|0;k=Dd(k|0,b|0,-64,-1)|0;b=C}while(b>>>0>0|(b|0)==0&k>>>0>63);b=k}else b=k;Id(o|0,j|0,b|0)|0}while(0);if(!h){i=A;return}l=y+3|0;d=y+2|0;n=y+1|0;o=x+32|0;r=x+104|0;e=x+136|0;f=x+144|0;s=x+40|0;t=0;u=0;do{u=u+1|0;a[l>>0]=u;a[d>>0]=u>>>8;a[n>>0]=u>>>16;a[y>>0]=u>>>24;Id(x|0,v|0,208)|0;q=o;b=c[q>>2]|0;q=c[q+4>>2]|0;j=Gd(b|0,q|0,3)|0;j=j&63;q=Dd(b|0,q|0,32,0)|0;b=o;c[b>>2]=q;c[b+4>>2]=C;b=64-j|0;j=x+40+j|0;if(b>>>0>4){q=c[y>>2]|0;a[j>>0]=q;a[j+1>>0]=q>>8;a[j+2>>0]=q>>16;a[j+3>>0]=q>>24}else{Id(j|0,y|0,b|0)|0;Eb(x,s);j=y+b|0;k=Cd(4,0,b|0,0)|0;b=C;if(b>>>0>0|(b|0)==0&k>>>0>63){do{Eb(x,j);j=j+64|0;k=Dd(k|0,b|0,-64,-1)|0;b=C}while(b>>>0>0|(b|0)==0&k>>>0>63);b=k}else b=k;Id(s|0,j|0,b|0)|0}Db(x,z);q=e;b=c[q>>2]|0;q=c[q+4>>2]|0;j=Gd(b|0,q|0,3)|0;j=j&63;q=Dd(b|0,q|0,256,0)|0;b=e;c[b>>2]=q;c[b+4>>2]=C;b=64-j|0;j=x+144+j|0;if(b>>>0>32){p=j;m=z;q=p+32|0;do{a[p>>0]=a[m>>0]|0;p=p+1|0;m=m+1|0}while((p|0)<(q|0))}else{Id(j|0,z|0,b|0)|0;Eb(r,f);j=z+b|0;k=Cd(32,0,b|0,0)|0;b=C;if(b>>>0>0|(b|0)==0&k>>>0>63){do{Eb(r,j);j=j+64|0;k=Dd(k|0,b|0,-64,-1)|0;b=C}while(b>>>0>0|(b|0)==0&k>>>0>63);b=k}else b=k;Id(f|0,j|0,b|0)|0}Db(r,w);q=h-t|0;Id(g+t|0,w|0,(q>>>0>32?32:q)|0)|0;t=u<<5}while(t>>>0>>0);i=A;return}function Zb(){return 32}function _b(){return 102}function $b(){return 32984}function ac(){return 524288}function bc(){return 16777216}function cc(){return 33554432}function dc(){return 1073741824}function ec(a,b,d,e,f,g,h,j,k,l){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0;o=i;n=i=i+63&-64;i=i+16|0;Fd(a|0,0,b|0)|0;m=g|d;if(m>>>0>0|(m|0)==0&(f|b)>>>0>4294967295){if(!(c[7979]|0))d=31964;else d=c[(oa()|0)+60>>2]|0;c[d>>2]=27;n=-1;i=o;return n|0}g=k>>>0<0|(k|0)==0&j>>>0<32768;m=g?32768:j;k=g?0:k;a:do if(k>>>0<0|(k|0)==0&m>>>0>>5>>>0){g=Gd(m|0,k|0,6)|0;j=C;k=1;while(1){m=Hd(1,0,k|0)|0;l=C;d=k+1|0;if(l>>>0>j>>>0|(l|0)==(j|0)&m>>>0>g>>>0){d=k;g=1;break a}if(d>>>0<63)k=d;else{g=1;break}}}else{g=l>>>11;j=1;while(1){l=Hd(1,0,j|0)|0;p=C;d=j+1|0;if(p>>>0>0|(p|0)==0&l>>>0>g>>>0){d=j;break}if(d>>>0<63)j=d;else break}g=Gd(m|0,k|0,2)|0;g=Gd(g|0,C|0,d|0)|0;p=C;m=p>>>0>0|(p|0)==0&g>>>0>1073741823;g=m?1073741823:g;g=g>>>3}while(0);d=Hd(1,0,d|0)|0;c[n+4>>2]=0;c[n>>2]=0;c[n+8>>2]=0;g=hc(n,e,f,h,32,d,C,8,g,a,b)|0;d=c[n>>2]|0;if(d)zd(d);p=g;i=o;return p|0}function fc(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|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,v=0,w=0;w=i;v=i=i+63&-64;i=i+112|0;t=v+72|0;u=v+12|0;l=b;m=l+102|0;do{a[l>>0]=0;l=l+1|0}while((l|0)<(m|0));if(g>>>0>0|(g|0)==0&f>>>0>4294967295){if(!(c[7979]|0))g=31964;else g=c[(oa()|0)+60>>2]|0;c[g>>2]=27;v=-1;i=w;return v|0}m=j>>>0<0|(j|0)==0&h>>>0<32768;n=m?32768:h;m=m?0:j;a:do if(m>>>0<0|(m|0)==0&n>>>0>>5>>>0){h=Gd(n|0,m|0,6)|0;l=C;m=1;while(1){k=Hd(1,0,m|0)|0;n=C;g=m+1|0;if(n>>>0>l>>>0|(n|0)==(l|0)&k>>>0>h>>>0){g=m;h=1;break a}if(g>>>0<63)m=g;else{h=1;break}}}else{h=k>>>11;l=1;while(1){k=Hd(1,0,l|0)|0;j=C;g=l+1|0;if(j>>>0>0|(j|0)==0&k>>>0>h>>>0){g=l;break}if(g>>>0<63)l=g;else break}h=Gd(n|0,m|0,2)|0;h=Gd(h|0,C|0,g|0)|0;k=C;n=k>>>0>0|(k|0)==0&h>>>0>1073741823;h=n?1073741823:h;h=h>>>3}while(0);l=0;do{a[t+l>>0]=Ba(0)|0;l=l+1|0}while((l|0)!=32);b:do if((((((((g>>>0<=63?(k=Hd(h|0,0,3)|0,n=C,!(n>>>0>0|(n|0)==0&k>>>0>1073741823)):0)?(a[u>>0]=36,a[u+1>>0]=55,a[u+2>>0]=36,a[u+3>>0]=a[34881+g>>0]|0,a[u+4>>0]=54,k=u+5|0,o=u+9|0,a[k>>0]=46,a[k+1>>0]=46,a[k+2>>0]=46,a[k+3>>0]=46,(o|0)!=0):0)?(p=o,r=u+58|0,(r|0)!=(p|0)):0)?(q=r-p|0,a[o>>0]=a[34881+(h&63)>>0]|0,(q|0)!=1):0)?(a[u+10>>0]=a[34881+(h>>>6&63)>>0]|0,(q|0)!=2):0)?(a[u+11>>0]=a[34881+(h>>>12&63)>>0]|0,(q|0)!=3):0)?(a[u+12>>0]=a[34881+(h>>>18&63)>>0]|0,(q|0)!=4):0)?(s=u+14|0,a[u+13>>0]=a[34881+(h>>>24)>>0]|0,(s|0)!=0):0){p=s;o=r-s|0;g=0;while(1){if(g>>>0<32){n=0;k=g;g=0}else break;do{s=k;k=k+1|0;g=(d[t+s>>0]|0)<>>0<32&n>>>0<24);if(!n)g=p;else{h=g;l=o;m=p;j=0;while(1){if(!l)break b;g=m+1|0;a[m>>0]=a[34881+(h&63)>>0]|0;j=j+6|0;if(j>>>0>=n>>>0)break;else{h=h>>>6;l=l+-1|0;m=g}}}s=(g|0)==0;o=(s?0:p-g|0)+o|0;if(s)break b;else{p=g;g=k}}if(p>>>0<(u+58|0)>>>0){a[p>>0]=0;l=v+4|0;c[l>>2]=0;c[v>>2]=0;m=v+8|0;c[m>>2]=0;g=(Vb(v,e,f,u,b)|0)==0;h=c[v>>2]|0;if(h)zd(h);c[l>>2]=0;c[v>>2]=0;c[m>>2]=0;if(!g){v=0;i=w;return v|0}if(!(c[7979]|0))g=31964;else g=c[(oa()|0)+60>>2]|0;c[g>>2]=22;v=-1;i=w;return v|0}}while(0);if(!(c[7979]|0))g=31964;else g=c[(oa()|0)+60>>2]|0;c[g>>2]=22;v=-1;i=w;return v|0}function gc(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;m=i;l=i=i+63&-64;i=i+128|0;f=l+12|0;a:do if(b&3){g=102;h=b;do{if(!(a[h>>0]|0)){k=5;break a}h=h+1|0;g=g+-1|0;j=(g|0)!=0}while(j&(h&3|0)!=0);if(j)k=5;else g=0}else{g=102;h=b;k=5}while(0);b:do if((k|0)==5)if(a[h>>0]|0){c:do if(g>>>0>3)while(1){j=c[h>>2]|0;if((j&-2139062144^-2139062144)&j+-16843009)break;h=h+4|0;g=g+-4|0;if(g>>>0<=3){k=10;break c}}else k=10;while(0);if((k|0)==10)if(!g){g=0;break}while(1){if(!(a[h>>0]|0))break b;h=h+1|0;g=g+-1|0;if(!g){g=0;break}}}while(0);if((((g|0)!=0?h:0)|0)!=(b+101|0)){b=-1;i=m;return b|0}j=l+4|0;c[j>>2]=0;c[l>>2]=0;k=l+8|0;c[k>>2]=0;g=(Vb(l,d,e,b,f)|0)==0;h=c[l>>2]|0;if(h)zd(h);c[j>>2]=0;c[l>>2]=0;c[k>>2]=0;if(g){b=-1;i=m;return b|0}else{g=0;h=0}do{g=a[b+h>>0]^a[f+h>>0]|g;h=h+1|0}while((h|0)!=102);h=(((g&255)+511|0)>>>8&1)+-1|0;g=f+102|0;do{a[f>>0]=0;f=f+1|0}while((f|0)<(g|0));b=h;i=m;return b|0}function hc(b,e,f,g,h,i,j,k,l,m,n){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;var 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,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0;J=Od(l|0,0,k|0,0)|0;I=C;if(I>>>0>0|(I|0)==0&J>>>0>1073741823){if(!(c[7979]|0))o=31964;else o=c[(oa()|0)+60>>2]|0;c[o>>2]=27;f=-1;return f|0}if(j>>>0>0|(j|0)==0&i>>>0>4294967295){if(!(c[7979]|0))o=31964;else o=c[(oa()|0)+60>>2]|0;c[o>>2]=27;f=-1;return f|0}G=Dd(i|0,j|0,-1,-1)|0;H=C;if(j>>>0<0|(j|0)==0&i>>>0<2|((G&i|0)!=0|(H&j|0)!=0)){if(!(c[7979]|0))o=31964;else o=c[(oa()|0)+60>>2]|0;c[o>>2]=22;f=-1;return f|0}if((k|0)==0|(l|0)==0){if(!(c[7979]|0))o=31964;else o=c[(oa()|0)+60>>2]|0;c[o>>2]=22;f=-1;return f|0}if(!(k>>>0>16777215?1:(33554431/(l>>>0)|0)>>>0>>0)?!(0>>0|(0==(j|0)?(33554431/(k>>>0)|0)>>>0>>0:0)):0){I=k<<7;J=_(I,l)|0;y=Od(I|0,0,i|0,j|0)|0;o=y+J|0;if(o>>>0>>0){if(!(c[7979]|0))o=31964;else o=c[(oa()|0)+60>>2]|0;c[o>>2]=12;f=-1;return f|0}F=k<<8|64;w=o+F|0;if(w>>>0>>0){if(!(c[7979]|0))o=31964;else o=c[(oa()|0)+60>>2]|0;c[o>>2]=12;f=-1;return f|0}x=b+8|0;do if((c[x>>2]|0)>>>0>>0){o=c[b>>2]|0;if(o)zd(o);v=b+4|0;c[v>>2]=0;c[b>>2]=0;c[x>>2]=0;do if(w>>>0<=4294967168){if(w>>>0>=4294967168){if(!(c[7979]|0))o=31964;else o=c[(oa()|0)+60>>2]|0;c[o>>2]=12;q=12;o=0;break}t=w|8;o=yd(t+76|0)|0;if(o){s=o+-8|0;do if(o&63){r=o+63&-64;F=r+-8|0;q=s;r=(F-q|0)>>>0>15?F:r+56|0;q=r-q|0;o=o+-4|0;F=c[o>>2]|0;p=(F&-8)-q|0;if(!(F&3)){c[r>>2]=(c[s>>2]|0)+q;c[r+4>>2]=p;break}else{F=r+4|0;c[F>>2]=p|c[F>>2]&1|2;E=r+p+4|0;c[E>>2]=c[E>>2]|1;c[o>>2]=q|c[o>>2]&1|2;c[F>>2]=c[F>>2]|1;Ad(s,q);break}}else r=s;while(0);o=r+4|0;p=c[o>>2]|0;if((p&3|0)!=0?(u=p&-8,u>>>0>(t+16|0)>>>0):0){F=u-t|0;E=r+t|0;c[o>>2]=t|p&1|2;c[E+4>>2]=F|3;D=E+F+4|0;c[D>>2]=c[D>>2]|1;Ad(E,F)}q=0;o=r+8|0}else{q=12;o=0}}else{q=12;o=0}while(0);if(!(c[7979]|0))p=31964;else p=c[(oa()|0)+60>>2]|0;c[p>>2]=q;if(!q){c[b>>2]=o;c[v>>2]=o;c[x>>2]=(o|0)!=0?w:0;if(!o)o=-1;else break;return o|0}else{c[b>>2]=0;c[v>>2]=0;c[x>>2]=0;f=-1;return f|0}}else o=c[b+4>>2]|0;while(0);F=o+J|0;E=F+y|0;Yb(e,f,g,h,o,J);t=k<<5;u=E+(t<<2)|0;v=E+(k<<6<<2)|0;w=(t|0)==0;x=(i|0)==0&(j|0)==0;b=t&1073741792;y=(b|0)==0;h=I+-64|0;g=E+h|0;h=u+h|0;z=h+4|0;A=g+4|0;D=0;do{B=o+(_(I,D)|0)|0;if(!w){p=0;do{s=B+(p<<2)|0;c[E+(p<<2)>>2]=(d[s+1>>0]|0)<<8|(d[s>>0]|0)|(d[s+2>>0]|0)<<16|(d[s+3>>0]|0)<<24;p=p+1|0}while((p|0)!=(t|0))}a:do if(!x){if(y){p=0;q=0;do{ic(E,u,v,k);ic(u,E,v,k);p=Dd(p|0,q|0,2,0)|0;q=C}while(q>>>0>>0|(q|0)==(j|0)&p>>>0>>0)}else{r=0;s=0;do{p=Od(r|0,s|0,t|0,0)|0;p=F+(p<<2)|0;q=0;do{c[p+(q<<2)>>2]=c[E+(q<<2)>>2];q=q+1|0}while((q|0)!=(b|0));ic(E,u,v,k);p=Od(r|1|0,s|0,t|0,0)|0;p=F+(p<<2)|0;q=0;do{c[p+(q<<2)>>2]=c[u+(q<<2)>>2];q=q+1|0}while((q|0)!=(b|0));ic(u,E,v,k);r=Dd(r|0,s|0,2,0)|0;s=C}while(s>>>0>>0|(s|0)==(j|0)&r>>>0>>0)}if(y){p=0;q=0;while(1){ic(E,u,v,k);ic(u,E,v,k);p=Dd(p|0,q|0,2,0)|0;q=C;if(!(q>>>0>>0|(q|0)==(j|0)&p>>>0>>0))break a}}else{r=0;s=0}do{p=Od(c[g>>2]&G|0,c[A>>2]&H|0,t|0,0)|0;p=F+(p<<2)|0;q=0;do{K=E+(q<<2)|0;c[K>>2]=c[K>>2]^c[p+(q<<2)>>2];q=q+1|0}while((q|0)!=(b|0));ic(E,u,v,k);p=Od(c[h>>2]&G|0,c[z>>2]&H|0,t|0,0)|0;p=F+(p<<2)|0;q=0;do{K=u+(q<<2)|0;c[K>>2]=c[K>>2]^c[p+(q<<2)>>2];q=q+1|0}while((q|0)!=(b|0));ic(u,E,v,k);r=Dd(r|0,s|0,2,0)|0;s=C}while(s>>>0>>0|(s|0)==(j|0)&r>>>0>>0)}while(0);if(!w){p=0;do{K=B+(p<<2)|0;s=c[E+(p<<2)>>2]|0;a[K>>0]=s;a[K+1>>0]=s>>>8;a[K+2>>0]=s>>>16;a[K+3>>0]=s>>>24;p=p+1|0}while((p|0)!=(t|0))}D=D+1|0}while((D|0)!=(l|0));Yb(e,f,o,J,m,n);K=0;return K|0}if(!(c[7979]|0))o=31964;else o=c[(oa()|0)+60>>2]|0;c[o>>2]=12;K=-1;return K|0}function ic(a,b,d,e){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M=(M<<18|M>>>14)^j;V=o+p|0;V=(V<<7|V>>>25)^q;S=V+p|0;S=(S<<9|S>>>23)^r;P=S+V|0;P=(P<<13|P>>>19)^o;I=P+S|0;I=(I<<18|I>>>14)^p;Y=V+U|0;d=(Y<<7|Y>>>25)^X;X=d+U|0;m=(X<<9|X>>>23)^W;W=m+d|0;q=(W<<13|W>>>19)^V;V=q+m|0;D=(V<<18|V>>>14)^U;U=R+Q|0;i=(U<<7|U>>>25)^T;T=i+Q|0;r=(T<<9|T>>>23)^S;S=r+i|0;E=(S<<13|S>>>19)^R;R=E+r|0;e=(R<<18|R>>>14)^Q;Q=N+M|0;o=(Q<<7|Q>>>25)^P;P=o+M|0;G=(P<<9|P>>>23)^O;O=G+o|0;g=(O<<13|O>>>19)^N;N=g+G|0;j=(N<<18|N>>>14)^M;M=J+I|0;C=(M<<7|M>>>25)^L;L=C+I|0;h=(L<<9|L>>>23)^K;K=h+C|0;l=(K<<13|K>>>19)^J;J=l+h|0;p=(J<<18|J>>>14)^I;H=H+2|0}while(H>>>0<8);c[a>>2]=(c[a>>2]|0)+D;c[b>>2]=(c[b>>2]|0)+d;c[z>>2]=(c[z>>2]|0)+m;c[A>>2]=(c[A>>2]|0)+q;c[B>>2]=(c[B>>2]|0)+E;c[F>>2]=(c[F>>2]|0)+e;c[f>>2]=(c[f>>2]|0)+i;c[k>>2]=(c[k>>2]|0)+r;c[n>>2]=(c[n>>2]|0)+G;c[s>>2]=(c[s>>2]|0)+g;c[t>>2]=(c[t>>2]|0)+j;c[u>>2]=(c[u>>2]|0)+o;c[v>>2]=(c[v>>2]|0)+C;c[w>>2]=(c[w>>2]|0)+h;c[x>>2]=(c[x>>2]|0)+l;c[y>>2]=(c[y>>2]|0)+p;return}function kc(){return 32}function lc(){return 32}function mc(a,b){a=a|0;b=b|0;md(a,b,33785);return 0}function nc(a,b,c){a=a|0;b=b|0;c=c|0;md(a,b,c);return 0}function oc(){return 32}function pc(){return 24}function qc(){return 16}function rc(b,c,d,e,f,g,h){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;r=i;q=i=i+63&-64;i=i+240|0;p=q;o=q+176|0;q=q+144|0;nb(q,g,h,32988);h=b;j=d;if(b>>>0>=d>>>0?0>>0|0==(f|0)&(h-j|0)>>>0>>0:0)k=5;else if(d>>>0>=b>>>0?0>>0|0==(f|0)&(j-h|0)>>>0>>0:0)k=5;if((k|0)==5){Jd(b|0,d|0,e|0)|0;d=b}h=o;k=h+32|0;do{a[h>>0]=0;h=h+1|0}while((h|0)<(k|0));l=f>>>0>0|(f|0)==0&e>>>0>32;m=l?32:e;n=l?0:f;h=(m|0)==0&(n|0)==0;if(!h){k=f>>>0<0|(f|0)==0&e>>>0<32;k=Dd((k?e:32)|0,(k?f:0)|0,-1,0)|0;Id(o+32|0,d|0,k+1|0)|0}k=Dd(m|0,n|0,32,0)|0;j=g+16|0;nd(o,o,k,C,j,0,0,q);Ub(p,o);if(!h){g=f>>>0<0|(f|0)==0&e>>>0<32;g=Dd((g?e:32)|0,(g?f:0)|0,-1,0)|0;Id(b|0,o+32|0,g+1|0)|0}h=o;k=h+64|0;do{a[h>>0]=0;h=h+1|0}while((h|0)<(k|0));if(!l){Tb(p,b,e,f);Rb(p,c);i=r;return 0}o=Cd(e|0,f|0,m|0,n|0)|0;nd(b+m|0,d+m|0,o,C,j,1,0,q);Tb(p,b,e,f);Rb(p,c);i=r;return 0}function sc(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;if(d>>>0>0|(d|0)==0&c>>>0>4294967279){e=-1;return e|0}rc(a+16|0,a,b,c,d,e,f)|0;e=0;return e|0}function tc(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|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;t=i;s=i=i+63&-64;i=i+208|0;m=s;o=s+144|0;n=s+112|0;r=s+48|0;s=s+16|0;nb(s,j,k,32988);q=j+16|0;k=n;j=s;l=k+32|0;do{a[k>>0]=a[j>>0]|0;k=k+1|0;j=j+1|0}while((k|0)<(l|0));l=q;j=l;l=l+4|0;l=d[l>>0]|d[l+1>>0]<<8|d[l+2>>0]<<16|d[l+3>>0]<<24;k=m;c[k>>2]=d[j>>0]|d[j+1>>0]<<8|d[j+2>>0]<<16|d[j+3>>0]<<24;c[k+4>>2]=l;k=m+8|0;c[k>>2]=0;c[k+4>>2]=0;ob(o,m,n,33817);k=0;do{a[r+k>>0]=a[o+k>>0]|0;k=k+1|0}while((k|0)!=32);if(Qb(f,e,g,h,r)|0){k=s;l=k+32|0;do{a[k>>0]=0;k=k+1|0}while((k|0)<(l|0));s=-1;i=t;return s|0}k=e;j=b;if(e>>>0>=b>>>0?0>>0|0==(h|0)&(k-j|0)>>>0>>0:0)p=9;else if(b>>>0>=e>>>0?0>>0|0==(h|0)&(j-k|0)>>>0>>0:0)p=9;if((p|0)==9){Jd(b|0,e|0,g|0)|0;e=b}k=h>>>0>0|(h|0)==0&g>>>0>32;j=k?32:g;l=k?0:h;if((j|0)==0&(l|0)==0)nd(r,r,32,0,q,0,0,s);else{f=r+32|0;p=h>>>0<0|(h|0)==0&g>>>0<32;p=Dd((p?g:32)|0,(p?h:0)|0,-1,0)|0;p=p+1|0;Id(f|0,e|0,p|0)|0;o=Dd(j|0,l|0,32,0)|0;nd(r,r,o,C,q,0,0,s);Id(b|0,f|0,p|0)|0}if(k){r=Cd(g|0,h|0,j|0,l|0)|0;nd(b+j|0,e+j|0,r,C,q,1,0,s)}k=s;l=k+32|0;do{a[k>>0]=0;k=k+1|0}while((k|0)<(l|0));s=0;i=t;return s|0}function uc(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;if(d>>>0<0|(d|0)==0&c>>>0<16){e=-1;return e|0}d=Dd(c|0,d|0,-16,-1)|0;e=tc(a,b+16|0,b,d,C,e,f)|0;return e|0}function vc(){return 8}function wc(){return 16}function xc(b,c,e,f,g){b=b|0;c=c|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,y=0;h=d[g>>0]|0;o=Hd(d[g+1>>0]|0|0,0,8)|0;n=C;j=Hd(d[g+2>>0]|0|0,0,16)|0;n=n|C;k=Hd(d[g+3>>0]|0|0,0,24)|0;n=n|C|(d[g+4>>0]|0);r=Hd(d[g+5>>0]|0|0,0,40)|0;n=n|C;i=Hd(d[g+6>>0]|0|0,0,48)|0;n=n|C;l=Hd(d[g+7>>0]|0|0,0,56)|0;l=o|h|j|k|r|i|l;n=n|C;i=d[g+8>>0]|0;r=Hd(d[g+9>>0]|0|0,0,8)|0;k=C;j=Hd(d[g+10>>0]|0|0,0,16)|0;k=k|C;h=Hd(d[g+11>>0]|0|0,0,24)|0;k=k|C|(d[g+12>>0]|0);o=Hd(d[g+13>>0]|0|0,0,40)|0;k=k|C;p=Hd(d[g+14>>0]|0|0,0,48)|0;k=k|C;m=Hd(d[g+15>>0]|0|0,0,56)|0;m=r|i|j|h|o|p|m;k=k|C;p=e&7;o=c+e+(0-p)|0;e=Hd(e|0,f|0,56)|0;g=C;h=m^2037671283;j=k^1952801890;i=l^1852142177;f=n^1819895653;m=m^1852075885;k=k^1685025377;l=l^1886610805;n=n^1936682341;if((o|0)!=(c|0)){do{x=d[c>>0]|0;y=Hd(d[c+1>>0]|0|0,0,8)|0;r=C;w=Hd(d[c+2>>0]|0|0,0,16)|0;r=r|C;t=Hd(d[c+3>>0]|0|0,0,24)|0;r=r|C|(d[c+4>>0]|0);u=Hd(d[c+5>>0]|0|0,0,40)|0;r=r|C;v=Hd(d[c+6>>0]|0|0,0,48)|0;r=r|C;s=Hd(d[c+7>>0]|0|0,0,56)|0;s=y|x|w|t|u|v|s;r=r|C;v=s^h;u=r^j;n=Dd(l|0,n|0,m|0,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v|0)|0;w=C;t=Hd(y|0,r|0,16)|0;x=C;r=Gd(y|0,r|0,48)|0;r=(t|r)^v;x=(x|C)^w;t=Hd(r|0,x|0,21)|0;y=C;x=Gd(r|0,x|0,43)|0;y=y|C;w=Dd(v|0,w|0,q|0,s|0)|0;v=C;r=Hd(q|0,s|0,17)|0;u=C;s=Gd(q|0,s|0,47)|0;x=(r|s)^w^v^(t|x);y=(u|C)^v^w^y;a[b>>0]=x;a[b+1>>0]=x>>>8;a[b+2>>0]=x>>>16;a[b+3>>0]=x>>>24;a[b+4>>0]=y;w=Gd(x|0,y|0,40)|0;a[b+5>>0]=w;w=Gd(x|0,y|0,48)|0;a[b+6>>0]=w;y=Gd(x|0,y|0,56)|0;a[b+7>>0]=y;return 0}function yc(){return 64}function zc(){return 32}function Ac(){return 32}function Bc(){return 64}function Cc(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;o=i;h=i=i+63&-64;i=i+496|0;k=h;j=h+448|0;l=h+408|0;m=h+368|0;h=h+208|0;g=k+64|0;n=k;p=8;q=n+64|0;do{c[n>>2]=c[p>>2];n=n+4|0;p=p+4|0}while((n|0)<(q|0));n=k+72|0;c[n>>2]=256;c[n+4>>2]=0;n=g;c[n>>2]=0;c[n+4>>2]=0;n=k+80|0;p=f;q=n+32|0;do{a[n>>0]=a[p>>0]|0;n=n+1|0;p=p+1|0}while((n|0)<(q|0));Gb(k,e);a[e>>0]=(d[e>>0]|0)&248;q=e+31|0;a[q>>0]=(d[q>>0]|0)&63|64;Rc(h,e);Ic(j,h+80|0);Jc(l,h,j);Jc(m,h+40|0,j);Lc(b,m);Lc(k,l);q=b+31|0;a[q>>0]=(d[q>>0]|0)^(d[k>>0]|0)<<7;Jd(e|0,f|0,32)|0;Jd(e+32|0,b|0,32)|0;i=o;return 0}function Dc(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;q=i;n=i=i+63&-64;i=i+528|0;m=n;l=n+448|0;o=n+408|0;p=n+368|0;k=n+208|0;n=n+488|0;f=0;do{a[n+f>>0]=Ba(0)|0;f=f+1|0}while((f|0)!=32);f=m+64|0;g=m;h=8;j=g+64|0;do{c[g>>2]=c[h>>2];g=g+4|0;h=h+4|0}while((g|0)<(j|0));g=m+72|0;c[g>>2]=256;c[g+4>>2]=0;g=f;c[g>>2]=0;c[g+4>>2]=0;g=m+80|0;h=n;j=g+32|0;do{a[g>>0]=a[h>>0]|0;g=g+1|0;h=h+1|0}while((g|0)<(j|0));Gb(m,e);a[e>>0]=(d[e>>0]|0)&248;g=e+31|0;a[g>>0]=(d[g>>0]|0)&63|64;Rc(k,e);Ic(l,k+80|0);Jc(o,k,l);Jc(p,k+40|0,l);Lc(b,p);Lc(m,o);g=b+31|0;a[g>>0]=(d[g>>0]|0)^(d[m>>0]|0)<<7;g=e;h=n;j=g+32|0;do{a[g>>0]=a[h>>0]|0;g=g+1|0;h=h+1|0}while((g|0)<(j|0));Jd(e+32|0,b|0,32)|0;i=q;return 0}function Ec(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,j=0,k=0;h=i;j=i=i+63&-64;i=i+16|0;k=a+64|0;Jd(k|0,d|0,e|0)|0;Xc(a,j,k,e,f,g);g=j;d=(b|0)!=0;if((c[g>>2]|0)==64&(c[g+4>>2]|0)==0){if(!d){k=0;i=h;return k|0}j=Dd(e|0,f|0,64,0)|0;k=b;c[k>>2]=j;c[k+4>>2]=C;k=0;i=h;return k|0}else{if(d){k=b;c[k>>2]=0;c[k+4>>2]=0}k=Dd(e|0,f|0,64,0)|0;Fd(a|0,0,k|0)|0;k=-1;i=h;return k|0}return 0}function Fc(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;e=Dd(e|0,f|0,-64,-1)|0;f=C;do if(!(f>>>0>0|(f|0)==0&e>>>0>4294967231)){h=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t;c[$>>2]=z-A;c[Y>>2]=_+Z;c[V>>2]=X+W;c[S>>2]=U+T;c[P>>2]=R+Q;c[e>>2]=d+f;c[l>>2]=i+h;c[n>>2]=k+o;c[u>>2]=r+q;c[w>>2]=t+x;c[D>>2]=A+z;D=c[C>>2]|0;z=a+124|0;A=c[z>>2]|0;w=a+128|0;x=c[w>>2]|0;t=a+132|0;u=c[t>>2]|0;q=a+136|0;r=c[q>>2]|0;n=a+140|0;o=c[n>>2]|0;k=a+144|0;l=c[k>>2]|0;h=a+148|0;i=c[h>>2]|0;e=a+152|0;f=c[e>>2]|0;a=a+156|0;d=c[a>>2]|0;c[O>>2]=D+E;c[N>>2]=A+B;c[M>>2]=x+y;c[L>>2]=u+v;c[K>>2]=r+s;c[J>>2]=o+p;c[I>>2]=l+m;c[H>>2]=i+j;c[G>>2]=f+g;c[F>>2]=d+b;c[C>>2]=E-D;c[z>>2]=B-A;c[w>>2]=y-x;c[t>>2]=v-u;c[q>>2]=s-r;c[n>>2]=p-o;c[k>>2]=m-l;c[h>>2]=j-i;c[e>>2]=g-f;c[a>>2]=b-d;return} function Ha(a){a=a|0;var b=0;b=i;i=i+a|0;i=i+15&-16;return b|0}function Ia(){return i|0}function Ja(a){a=a|0;i=a}function Ka(a,b){a=a|0;b=b|0;i=a;j=b}function La(a,b){a=a|0;b=b|0;if(!n){n=a;o=b}}function Ma(b){b=b|0;a[k>>0]=a[b>>0];a[k+1>>0]=a[b+1>>0];a[k+2>>0]=a[b+2>>0];a[k+3>>0]=a[b+3>>0]}function Na(b){b=b|0;a[k>>0]=a[b>>0];a[k+1>>0]=a[b+1>>0];a[k+2>>0]=a[b+2>>0];a[k+3>>0]=a[b+3>>0];a[k+4>>0]=a[b+4>>0];a[k+5>>0]=a[b+5>>0];a[k+6>>0]=a[b+6>>0];a[k+7>>0]=a[b+7>>0]}function Oa(a){a=a|0;C=a}function Pa(){return C|0}function Qa(){return 32}function Ra(){return 32}function Sa(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;Ua(a,b,c,d,e);return 0}function Ta(b,c,d,e,f){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;h=i;i=i+32|0;g=h;Ua(g,c,d,e,f);d=Yc(b,g)|0;e=(g|0)==(b|0);c=0;f=0;do{c=a[b+f>>0]^a[g+f>>0]|c;f=f+1|0}while((f|0)!=32);i=h;return (e?-1:d)|(((c&255)+511|0)>>>8&1)+-1|0}function Ua(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=i;i=i+608|0;r=s+480|0;o=s+416|0;n=s;j=n+64|0;c[j>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;c[j+12>>2]=0;h=n;k=8;l=h+64|0;do{c[h>>2]=c[k>>2];h=h+4|0;k=k+4|0}while((h|0)<(l|0));h=r;l=h+128|0;do{a[h>>0]=54;h=h+1|0}while((h|0)<(l|0));a[r>>0]=a[g>>0]^54;h=1;do{q=r+h|0;a[q>>0]=a[q>>0]^a[g+h>>0];h=h+1|0}while((h|0)!=32);h=n+72|0;c[h>>2]=1024;c[h+4>>2]=0;c[j>>2]=0;c[j+4>>2]=0;j=n+80|0;h=j;k=r;l=h+128|0;do{a[h>>0]=a[k>>0]|0;h=h+1|0;k=k+1|0}while((h|0)<(l|0));Hb(n,j);j=a[g>>0]|0;q=n+208|0;m=n+272|0;c[m>>2]=0;c[m+4>>2]=0;c[m+8>>2]=0;c[m+12>>2]=0;h=q;k=8;l=h+64|0;do{c[h>>2]=c[k>>2];h=h+4|0;k=k+4|0}while((h|0)<(l|0));h=r;l=h+128|0;do{a[h>>0]=92;h=h+1|0}while((h|0)<(l|0));a[r>>0]=j^92;h=1;do{p=r+h|0;a[p>>0]=a[p>>0]^a[g+h>>0];h=h+1|0}while((h|0)!=32);j=n+280|0;p=j;c[p>>2]=1024;c[p+4>>2]=0;p=m;c[p>>2]=0;c[p+4>>2]=0;p=n+288|0;h=p;k=r;l=h+128|0;do{a[h>>0]=a[k>>0]|0;h=h+1|0;k=k+1|0}while((h|0)<(l|0));Hb(q,p);Fb(n,d,e,f);Gb(n,o);f=j;d=c[f>>2]|0;f=c[f+4>>2]|0;k=Gd(d|0,f|0,3)|0;k=k&127;h=Dd(d|0,f|0,512,0)|0;c[j>>2]=h;c[j+4>>2]=C;j=m;h=c[j>>2]|0;j=c[j+4>>2]|0;if(f>>>0>4294967295|(f|0)==-1&d>>>0>4294966783){h=Dd(h|0,j|0,1,0)|0;j=C;d=m;c[d>>2]=h;c[d+4>>2]=j}g=m;c[g>>2]=h;c[g+4>>2]=j;j=Cd(128,0,k|0,0)|0;g=C;h=n+288+k|0;if(g>>>0>0|(g|0)==0&j>>>0>64){k=o;l=h+64|0;do{a[h>>0]=a[k>>0]|0;h=h+1|0;k=k+1|0}while((h|0)<(l|0));Gb(q,r);h=b;k=r;l=h+32|0;do{a[h>>0]=a[k>>0]|0;h=h+1|0;k=k+1|0}while((h|0)<(l|0));i=s;return}Id(h|0,o|0,j|0)|0;Hb(q,p);h=o+j|0;j=Cd(64,0,j|0,g|0)|0;g=C;if(g>>>0>0|(g|0)==0&j>>>0>127)do{Hb(q,h);h=h+128|0;j=Dd(j|0,g|0,-128,-1)|0;g=C}while(g>>>0>0|(g|0)==0&j>>>0>127);Id(p|0,h|0,j|0)|0;Gb(q,r);h=b;k=r;l=h+32|0;do{a[h>>0]=a[k>>0]|0;h=h+1|0;k=k+1|0}while((h|0)<(l|0));i=s;return}function Va(){return 32}function Wa(){return 32}function Xa(){return 32}function Ya(){return 32}function Za(){return 24}function _a(){return 16}function $a(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;k=i;i=i+272|0;h=k;g=k+208|0;f=h+64|0;j=h;l=8;m=j+64|0;do{c[j>>2]=c[l>>2];j=j+4|0;l=l+4|0}while((j|0)<(m|0));j=h+72|0;c[j>>2]=256;c[j+4>>2]=0;j=f;c[j>>2]=0;c[j+4>>2]=0;j=h+80|0;l=e;m=j+32|0;do{a[j>>0]=a[l>>0]|0;j=j+1|0;l=l+1|0}while((j|0)<(m|0));Gb(h,g);j=d;l=g;m=j+32|0;do{a[j>>0]=a[l>>0]|0;j=j+1|0;l=l+1|0}while((j|0)<(m|0));md(b,d,33785);i=k;return 0}function ab(b,c){b=b|0;c=c|0;var d=0;d=0;do{a[c+d>>0]=Ba(0)|0;d=d+1|0}while((d|0)!=32);md(b,c,33785);return 0}function bb(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=i;i=i+32|0;e=d;md(e,c,b);nb(a,32576,e,32592);i=d;return 0}function cb(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;rc(a,b,c,d,e,f,g)|0;return 0}function db(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;var j=0,k=0,l=0;j=i;i=i+64|0;l=j+32|0;k=j;md(l,h,g);nb(k,32576,l,32592);rc(a,b,c,d,e,f,k)|0;i=j;return 0}function eb(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;if(d>>>0>0|(d|0)==0&c>>>0>4294967279){e=-1;return e|0}rc(a+16|0,a,b,c,d,e,f)|0;e=0;return e|0}function fb(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;var h=0,j=0,k=0;k=i;i=i+64|0;j=k+32|0;h=k;if(d>>>0>0|(d|0)==0&c>>>0>4294967279){g=-1;i=k;return g|0}md(j,g,f);nb(h,32576,j,32592);rc(a+16|0,a,b,c,d,e,h)|0;g=0;i=k;return g|0}function gb(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 tc(a,b,c,d,e,f,g)|0}function hb(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;var j=0,k=0,l=0;j=i;i=i+64|0;l=j+32|0;k=j;md(l,h,g);nb(k,32576,l,32592);h=tc(a,b,c,d,e,f,k)|0;i=j;return h|0}function ib(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;if(d>>>0<0|(d|0)==0&c>>>0<16){e=-1;return e|0}d=Dd(c|0,d|0,-16,-1)|0;e=tc(a,b+16|0,b,d,C,e,f)|0;return e|0}function jb(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;var h=0,j=0,k=0;k=i;i=i+64|0;j=k+32|0;h=k;if(d>>>0<0|(d|0)==0&c>>>0<16){g=-1;i=k;return g|0}c=Dd(c|0,d|0,-16,-1)|0;d=C;md(j,g,f);nb(h,32576,j,32592);g=tc(a,b+16|0,b,c,d,e,h)|0;i=k;return g|0}function kb(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=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;A=i;v=i=i+63&-64;i=i+480|0;y=v;w=v+448|0;x=v+424|0;j=v+392|0;v=v+360|0;h=0;do{a[v+h>>0]=Ba(0)|0;h=h+1|0}while((h|0)!=32);md(j,v,33785);h=b;o=j;p=h+32|0;do{a[h>>0]=a[o>>0]|0;h=h+1|0;o=o+1|0}while((h|0)<(p|0));Fd(y|0,0,357)|0;q=y;c[q>>2]=-222443248;c[q+4>>2]=1779033703;q=y+8|0;c[q>>2]=-2067093701;c[q+4>>2]=-1150833019;q=y+16|0;c[q>>2]=-23791573;c[q+4>>2]=1013904242;q=y+24|0;c[q>>2]=1595750129;c[q+4>>2]=-1521486534;q=y+32|0;c[q>>2]=-1377402159;c[q+4>>2]=1359893119;q=y+40|0;c[q>>2]=725511199;c[q+4>>2]=-1694144372;q=y+48|0;c[q>>2]=-79577749;c[q+4>>2]=528734635;q=y+56|0;c[q>>2]=327033209;c[q+4>>2]=1541459225;q=y+352|0;r=y+96|0;s=y+64|0;t=y+72|0;u=y+224|0;h=0;m=0;n=32;while(1){l=256-h|0;h=y+96+h|0;if(!(m>>>0>0|(m|0)==0&n>>>0>l>>>0)){z=5;break}Id(h|0,j|0,l|0)|0;c[q>>2]=(c[q>>2]|0)+l;p=s;h=c[p>>2]|0;p=c[p+4>>2]|0;k=Dd(h|0,p|0,128,0)|0;o=s;c[o>>2]=k;c[o+4>>2]=C;o=t;o=Dd((p>>>0>4294967295|(p|0)==-1&h>>>0>4294967167)&1|0,0,c[o>>2]|0,c[o+4>>2]|0)|0;h=t;c[h>>2]=o;c[h+4>>2]=C;Ab(y,r);h=r;o=u;p=h+128|0;do{c[h>>2]=c[o>>2];h=h+4|0;o=o+4|0}while((h|0)<(p|0));h=(c[q>>2]|0)+-128|0;c[q>>2]=h;k=Cd(n|0,m|0,l|0,0)|0;if((n|0)==(l|0)&(m|0)==0){n=g;l=0;m=32;break}else{j=j+l|0;m=C;n=k}}if((z|0)==5){Id(h|0,j|0,n|0)|0;h=Dd(c[q>>2]|0,0,n|0,m|0)|0;c[q>>2]=h;n=g;l=0;m=32}while(1){k=256-h|0;h=y+96+h|0;if(!(l>>>0>0|(l|0)==0&m>>>0>k>>>0)){z=8;break}Id(h|0,n|0,k|0)|0;c[q>>2]=(c[q>>2]|0)+k;p=s;h=c[p>>2]|0;p=c[p+4>>2]|0;j=Dd(h|0,p|0,128,0)|0;o=s;c[o>>2]=j;c[o+4>>2]=C;o=t;o=Dd((p>>>0>4294967295|(p|0)==-1&h>>>0>4294967167)&1|0,0,c[o>>2]|0,c[o+4>>2]|0)|0;h=t;c[h>>2]=o;c[h+4>>2]=C;Ab(y,r);h=r;o=u;p=h+128|0;do{c[h>>2]=c[o>>2];h=h+4|0;o=o+4|0}while((h|0)<(p|0));h=(c[q>>2]|0)+-128|0;c[q>>2]=h;j=Cd(m|0,l|0,k|0,0)|0;if((m|0)==(k|0)&(l|0)==0)break;else{n=n+k|0;l=C;m=j}}if((z|0)==8){Id(h|0,n|0,m|0)|0;z=Dd(c[q>>2]|0,0,m|0,l|0)|0;c[q>>2]=z}zb(y,x,24)|0;if(f>>>0>0|(f|0)==0&e>>>0>4294967279){z=-1;i=A;return z|0}md(y,v,g);nb(w,32576,y,32592);rc(b+48|0,b+32|0,d,e,f,x,w)|0;z=0;i=A;return z|0}function lb(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,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;y=i;v=i=i+63&-64;i=i+416|0;w=v;u=v+384|0;v=v+360|0;if(e>>>0<0|(e|0)==0&d>>>0<48){x=-1;i=y;return x|0}Fd(w|0,0,357)|0;p=w;c[p>>2]=-222443248;c[p+4>>2]=1779033703;p=w+8|0;c[p>>2]=-2067093701;c[p+4>>2]=-1150833019;p=w+16|0;c[p>>2]=-23791573;c[p+4>>2]=1013904242;p=w+24|0;c[p>>2]=1595750129;c[p+4>>2]=-1521486534;p=w+32|0;c[p>>2]=-1377402159;c[p+4>>2]=1359893119;p=w+40|0;c[p>>2]=725511199;c[p+4>>2]=-1694144372;p=w+48|0;c[p>>2]=-79577749;c[p+4>>2]=528734635;p=w+56|0;c[p>>2]=327033209;c[p+4>>2]=1541459225;p=w+352|0;q=w+96|0;r=w+64|0;s=w+72|0;t=w+224|0;k=b;h=0;m=0;n=32;while(1){l=256-h|0;h=w+96+h|0;if(!(m>>>0>0|(m|0)==0&n>>>0>l>>>0)){x=4;break}Id(h|0,k|0,l|0)|0;c[p>>2]=(c[p>>2]|0)+l;o=r;h=c[o>>2]|0;o=c[o+4>>2]|0;z=Dd(h|0,o|0,128,0)|0;j=r;c[j>>2]=z;c[j+4>>2]=C;j=s;j=Dd((o>>>0>4294967295|(o|0)==-1&h>>>0>4294967167)&1|0,0,c[j>>2]|0,c[j+4>>2]|0)|0;h=s;c[h>>2]=j;c[h+4>>2]=C;Ab(w,q);h=q;j=t;o=h+128|0;do{c[h>>2]=c[j>>2];h=h+4|0;j=j+4|0}while((h|0)<(o|0));h=(c[p>>2]|0)+-128|0;c[p>>2]=h;j=Cd(n|0,m|0,l|0,0)|0;if((n|0)==(l|0)&(m|0)==0){l=0;m=32;break}else{k=k+l|0;m=C;n=j}}if((x|0)==4){Id(h|0,k|0,n|0)|0;h=Dd(c[p>>2]|0,0,n|0,m|0)|0;c[p>>2]=h;l=0;m=32}while(1){k=256-h|0;h=w+96+h|0;if(!(l>>>0>0|(l|0)==0&m>>>0>k>>>0)){x=7;break}Id(h|0,f|0,k|0)|0;c[p>>2]=(c[p>>2]|0)+k;o=r;h=c[o>>2]|0;o=c[o+4>>2]|0;z=Dd(h|0,o|0,128,0)|0;j=r;c[j>>2]=z;c[j+4>>2]=C;j=s;j=Dd((o>>>0>4294967295|(o|0)==-1&h>>>0>4294967167)&1|0,0,c[j>>2]|0,c[j+4>>2]|0)|0;h=s;c[h>>2]=j;c[h+4>>2]=C;Ab(w,q);h=q;j=t;o=h+128|0;do{c[h>>2]=c[j>>2];h=h+4|0;j=j+4|0}while((h|0)<(o|0));h=(c[p>>2]|0)+-128|0;c[p>>2]=h;j=Cd(m|0,l|0,k|0,0)|0;if((m|0)==(k|0)&(l|0)==0)break;else{f=f+k|0;l=C;m=j}}if((x|0)==7){Id(h|0,f|0,m|0)|0;z=Dd(c[p>>2]|0,0,m|0,l|0)|0;c[p>>2]=z}zb(w,v,24)|0;if((d&-16|0)==32&(e|0)==0){z=-1;i=y;return z|0}x=Dd(d|0,e|0,-48,-1)|0;z=C;md(w,g,b);nb(u,32576,w,32592);z=tc(a,b+48|0,b+32|0,x,z,v,u)|0;i=y;return z|0}function mb(){return 48}function nb(b,c,e,f){b=b|0;c=c|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,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>0]=Q;a[b+21>>0]=Q>>>8;a[b+22>>0]=Q>>>16;a[b+23>>0]=Q>>>24;a[b+24>>0]=R;a[b+25>>0]=R>>>8;a[b+26>>0]=R>>>16;a[b+27>>0]=R>>>24;a[b+28>>0]=S;a[b+29>>0]=S>>>8;a[b+30>>0]=S>>>16;a[b+31>>0]=S>>>24;a[b+32>>0]=T;a[b+33>>0]=T>>>8;a[b+34>>0]=T>>>16;a[b+35>>0]=T>>>24;a[b+36>>0]=U;a[b+37>>0]=U>>>8;a[b+38>>0]=U>>>16;a[b+39>>0]=U>>>24;a[b+40>>0]=V;a[b+41>>0]=V>>>8;a[b+42>>0]=V>>>16;a[b+43>>0]=V>>>24;a[b+44>>0]=W;a[b+45>>0]=W>>>8;a[b+46>>0]=W>>>16;a[b+47>>0]=W>>>24;a[b+48>>0]=X;a[b+49>>0]=X>>>8;a[b+50>>0]=X>>>16;a[b+51>>0]=X>>>24;a[b+52>>0]=Y;a[b+53>>0]=Y>>>8;a[b+54>>0]=Y>>>16;a[b+55>>0]=Y>>>24;a[b+56>>0]=Z;a[b+57>>0]=Z>>>8;a[b+58>>0]=Z>>>16;a[b+59>>0]=Z>>>24;a[b+60>>0]=_;a[b+61>>0]=_>>>8;a[b+62>>0]=_>>>16;a[b+63>>0]=_>>>24;return}function pb(){return 16}function qb(){return 64}function rb(){return 32}function sb(){return 16}function tb(){return 64}function ub(){return 32}function vb(){return 384}function wb(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|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,v=0;v=i;t=i=i+63&-64;i=i+496|0;n=t+360|0;if((e+-1|0)>>>0>63|k>>>0>64){u=-1;i=v;return u|0}if(e>>>0>=256)za(32608,32628,18,32680);if(k>>>0>=256)za(32707,32628,19,32680);m=k&255;do if(!((b|0)==0|(f|0)==0&((g|0)!=0|(h|0)!=0)|((e&255)+-1&255)>63)?(l=m<<24>>24==0,!((m&255)>64|((j|0)!=0|l)^1)):0){if(l){Fd(t|0,0,357)|0;m=t;c[m>>2]=e&255^-222443256;c[m+4>>2]=1779033703;m=t+8|0;c[m>>2]=-2067093701;c[m+4>>2]=-1150833019;m=t+16|0;c[m>>2]=-23791573;c[m+4>>2]=1013904242;m=t+24|0;c[m>>2]=1595750129;c[m+4>>2]=-1521486534;m=t+32|0;c[m>>2]=-1377402159;c[m+4>>2]=1359893119;m=t+40|0;c[m>>2]=725511199;c[m+4>>2]=-1694144372;m=t+48|0;c[m>>2]=-79577749;c[m+4>>2]=528734635;m=t+56|0;c[m>>2]=327033209;c[m+4>>2]=1541459225;m=0}else{if((j|0)==0|(m+-1&255)>63){l=-1;break}l=k&255;Fd(t|0,0,357)|0;s=Hd(l|0,0,8)|0;o=t;c[o>>2]=(s|e&255)^-222443256;c[o+4>>2]=C^1779033703;o=t+8|0;c[o>>2]=-2067093701;c[o+4>>2]=-1150833019;o=t+16|0;c[o>>2]=-23791573;c[o+4>>2]=1013904242;o=t+24|0;c[o>>2]=1595750129;c[o+4>>2]=-1521486534;o=t+32|0;c[o>>2]=-1377402159;c[o+4>>2]=1359893119;o=t+40|0;c[o>>2]=725511199;c[o+4>>2]=-1694144372;o=t+48|0;c[o>>2]=-79577749;c[o+4>>2]=528734635;o=t+56|0;c[o>>2]=327033209;c[o+4>>2]=1541459225;Fd(n+l|0,0,(m<<24>>24<0?0:128-l|0)|0)|0;Id(n|0,j|0,l|0)|0;l=t+352|0;o=t+96|0;m=o+128|0;do{a[o>>0]=a[n>>0]|0;o=o+1|0;n=n+1|0}while((o|0)<(m|0));c[l>>2]=128;m=128}k=t+352|0;if(!((g|0)==0&(h|0)==0)){q=t+96|0;j=t+64|0;r=t+72|0;s=t+224|0;p=f;while(1){f=256-m|0;l=t+96+m|0;if(!(h>>>0>0|(h|0)==0&g>>>0>f>>>0)){u=16;break}Id(l|0,p|0,f|0)|0;c[k>>2]=(c[k>>2]|0)+f;m=j;o=c[m>>2]|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u+1>>0]=e>>8;a[u+2>>0]=e>>16;a[u+3>>0]=e>>24;if(a[t+356>>0]|0){u=t+88|0;c[u>>2]=-1;c[u+4>>2]=-1}u=t+80|0;c[u>>2]=-1;c[u+4>>2]=-1;Fd(t+96+m|0,0,256-m|0)|0;Ab(t,t+96|0);Id(b|0,t|0,l|0)|0;l=0}else l=-1;while(0);u=l;i=v;return u|0}function xb(b,c,d,e){b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;j=i;f=i=i+63&-64;i=i+128|0;if(d>>>0>64|(e+-1|0)>>>0>63){b=-1;i=j;return b|0}if(e>>>0>=256)za(32608,32628,53,32727);if(d>>>0>=256)za(32707,32628,54,32727);h=e&255;if((c|0)==0|(d|0)==0){if((h+-1&255)>63){b=-1;i=j;return b|0}Fd(b|0,0,357)|0;c=e&255^-222443256;e=b;d=e;a[d>>0]=c;a[d+1>>0]=c>>8;a[d+2>>0]=c>>16;a[d+3>>0]=c>>24;e=e+4|0;a[e>>0]=103;a[e+1>>0]=230;a[e+2>>0]=9;a[e+3>>0]=106;e=b+8|0;d=e;a[d>>0]=-2067093701;a[d+1>>0]=-2067093701>>8;a[d+2>>0]=-2067093701>>16;a[d+3>>0]=-2067093701>>24;e=e+4|0;a[e>>0]=-1150833019;a[e+1>>0]=-1150833019>>8;a[e+2>>0]=-1150833019>>16;a[e+3>>0]=-1150833019>>24;e=b+16|0;d=e;a[d>>0]=-23791573;a[d+1>>0]=-23791573>>8;a[d+2>>0]=-23791573>>16;a[d+3>>0]=-23791573>>24;e=e+4|0;a[e>>0]=114;a[e+1>>0]=243;a[e+2>>0]=110;a[e+3>>0]=60;e=b+24|0;d=e;a[d>>0]=241;a[d+1>>0]=54;a[d+2>>0]=29;a[d+3>>0]=95;e=e+4|0;a[e>>0]=-1521486534;a[e+1>>0]=-1521486534>>8;a[e+2>>0]=-1521486534>>16;a[e+3>>0]=-1521486534>>24;e=b+32|0;d=e;a[d>>0]=-1377402159;a[d+1>>0]=-1377402159>>8;a[d+2>>0]=-1377402159>>16;a[d+3>>0]=-1377402159>>24;e=e+4|0;a[e>>0]=127;a[e+1>>0]=82;a[e+2>>0]=14;a[e+3>>0]=81;e=b+40|0;d=e;a[d>>0]=31;a[d+1>>0]=108;a[d+2>>0]=62;a[d+3>>0]=43;e=e+4|0;a[e>>0]=-1694144372;a[e+1>>0]=-1694144372>>8;a[e+2>>0]=-1694144372>>16;a[e+3>>0]=-1694144372>>24;e=b+48|0;d=e;a[d>>0]=-79577749;a[d+1>>0]=-79577749>>8;a[d+2>>0]=-79577749>>16;a[d+3>>0]=-79577749>>24;e=e+4|0;a[e>>0]=171;a[e+1>>0]=217;a[e+2>>0]=131;a[e+3>>0]=31;b=b+56|0;e=b;a[e>>0]=121;a[e+1>>0]=33;a[e+2>>0]=126;a[e+3>>0]=19;b=b+4|0;a[b>>0]=25;a[b+1>>0]=205;a[b+2>>0]=224;a[b+3>>0]=91;b=0;i=j;return b|0}else{g=d&255;if((h+-1&255)>63|(g+-1&255)>63){b=-1;i=j;return b|0}h=d&255;Fd(b|0,0,357)|0;l=Hd(h|0,0,8)|0;l=(l|e&255)^-222443256;d=C^1779033703;e=b;k=e;a[k>>0]=l;a[k+1>>0]=l>>8;a[k+2>>0]=l>>16;a[k+3>>0]=l>>24;e=e+4|0;a[e>>0]=d;a[e+1>>0]=d>>8;a[e+2>>0]=d>>16;a[e+3>>0]=d>>24;e=b+8|0;d=e;a[d>>0]=-2067093701;a[d+1>>0]=-2067093701>>8;a[d+2>>0]=-2067093701>>16;a[d+3>>0]=-2067093701>>24;e=e+4|0;a[e>>0]=-1150833019;a[e+1>>0]=-1150833019>>8;a[e+2>>0]=-1150833019>>16;a[e+3>>0]=-1150833019>>24;e=b+16|0;d=e;a[d>>0]=-23791573;a[d+1>>0]=-23791573>>8;a[d+2>>0]=-23791573>>16;a[d+3>>0]=-23791573>>24;e=e+4|0;a[e>>0]=114;a[e+1>>0]=243;a[e+2>>0]=110;a[e+3>>0]=60;e=b+24|0;d=e;a[d>>0]=241;a[d+1>>0]=54;a[d+2>>0]=29;a[d+3>>0]=95;e=e+4|0;a[e>>0]=-1521486534;a[e+1>>0]=-1521486534>>8;a[e+2>>0]=-1521486534>>16;a[e+3>>0]=-1521486534>>24;e=b+32|0;d=e;a[d>>0]=-1377402159;a[d+1>>0]=-1377402159>>8;a[d+2>>0]=-1377402159>>16;a[d+3>>0]=-1377402159>>24;e=e+4|0;a[e>>0]=127;a[e+1>>0]=82;a[e+2>>0]=14;a[e+3>>0]=81;e=b+40|0;d=e;a[d>>0]=31;a[d+1>>0]=108;a[d+2>>0]=62;a[d+3>>0]=43;e=e+4|0;a[e>>0]=-1694144372;a[e+1>>0]=-1694144372>>8;a[e+2>>0]=-1694144372>>16;a[e+3>>0]=-1694144372>>24;e=b+48|0;d=e;a[d>>0]=-79577749;a[d+1>>0]=-79577749>>8;a[d+2>>0]=-79577749>>16;a[d+3>>0]=-79577749>>24;e=e+4|0;a[e>>0]=171;a[e+1>>0]=217;a[e+2>>0]=131;a[e+3>>0]=31;e=b+56|0;d=e;a[d>>0]=121;a[d+1>>0]=33;a[d+2>>0]=126;a[d+3>>0]=19;e=e+4|0;a[e>>0]=25;a[e+1>>0]=205;a[e+2>>0]=224;a[e+3>>0]=91;Fd(f+h|0,0,(g<<24>>24<0?0:128-h|0)|0)|0;Id(f|0,c|0,h|0)|0;c=b+352|0;h=b+96|0;g=h+128|0;do{a[h>>0]=a[f>>0]|0;h=h+1|0;f=f+1|0}while((h|0)<(g|0));a[c>>0]=128;a[c+1>>0]=0;a[c+2>>0]=0;a[c+3>>0]=0;l=0;i=j;return l|0}return 0}function yb(b,c,e,f){b=b|0;c=c|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;if((e|0)==0&(f|0)==0)return 0;k=b+352|0;l=b+96|0;m=b+64|0;n=b+72|0;o=b+224|0;g=d[k>>0]|d[k+1>>0]<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}if((p|0)==6)return 0;Id(e|0,c|0,j|0)|0;s=Dd(d[k>>0]|d[k+1>>0]<<8|d[k+2>>0]<<16|d[k+3>>0]<<24|0,0,j|0,f|0)|0;a[k>>0]=s;a[k+1>>0]=s>>8;a[k+2>>0]=s>>16;a[k+3>>0]=s>>24;return 0}function zb(b,c,e){b=b|0;c=c|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;if(e>>>0>=256)za(32608,32628,106,32759);f=e&255;if(!(f<<24>>24)){b=-1;return b|0}if((f&255)>64){b=-1;return b|0}g=b+352|0;f=d[g>>0]|d[g+1>>0]<<8|d[g+2>>0]<<16|d[g+3>>0]<<24;i=b+64|0;if(f>>>0>128){k=i;j=k;j=d[j>>0]|d[j+1>>0]<<8|d[j+2>>0]<<16|d[j+3>>0]<<24;k=k+4|0;k=d[k>>0]|d[k+1>>0]<<8|d[k+2>>0]<<16|d[k+3>>0]<<24;m=Dd(j|0,k|0,128,0)|0;l=C;h=i;f=h;a[f>>0]=m;a[f+1>>0]=m>>8;a[f+2>>0]=m>>16;a[f+3>>0]=m>>24;h=h+4|0;a[h>>0]=l;a[h+1>>0]=l>>8;a[h+2>>0]=l>>16;a[h+3>>0]=l>>24;h=b+72|0;l=h;f=l;l=l+4|0;l=Dd((k>>>0>4294967295|(k|0)==-1&j>>>0>4294967167)&1|0,0,d[f>>0]|d[f+1>>0]<<8|d[f+2>>0]<<16|d[f+3>>0]<<24|0,d[l>>0]|d[l+1>>0]<<8|d[l+2>>0]<<16|d[l+3>>0]<<24|0)|0;f=C;j=h;k=j;a[k>>0]=l;a[k+1>>0]=l>>8;a[k+2>>0]=l>>16;a[k+3>>0]=l>>24;j=j+4|0;a[j>>0]=f;a[j+1>>0]=f>>8;a[j+2>>0]=f>>16;a[j+3>>0]=f>>24;j=b+96|0;Ab(b,j);f=(d[g>>0]|d[g+1>>0]<<8|d[g+2>>0]<<16|d[g+3>>0]<<24)+-128|0;a[g>>0]=f;a[g+1>>0]=f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0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;g=i;f=i=i+63&-64;i=i+256|0;e=0;do{h=b+(e<<2)|0;c[f+(e<<2)>>2]=(d[h+2>>0]|0)<<8|(d[h+3>>0]|0)|(d[h+1>>0]|0)<<16|(d[h>>0]|0)<<24;e=e+1|0}while((e|0)!=16);b=c[f>>2]|0;e=16;do{h=c[f+(e+-2<<2)>>2]|0;j=b;b=c[f+(e+-15<<2)>>2]|0;c[f+(e<<2)>>2]=j+(c[f+(e+-7<<2)>>2]|0)+((h>>>19|h<<13)^h>>>10^(h>>>17|h<<15))+((b>>>18|b<<14)^b>>>3^(b>>>7|b<<25));e=e+1|0}while((e|0)!=64);u=c[a>>2]|0;s=a+4|0;t=c[s>>2]|0;q=a+8|0;r=c[q>>2]|0;o=a+12|0;m=a+16|0;n=c[m>>2]|0;k=a+20|0;l=c[k>>2]|0;e=a+24|0;b=c[e>>2]|0;j=a+28|0;h=(c[j>>2]|0)+1116352408+(c[f>>2]|0)+((n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7))+((b^l)&n^b)|0;p=(c[o>>2]|0)+h|0;h=((r|t)&u|r&t)+((u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10))+h|0;b=b+1899447441+(c[f+4>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((l^n)&p^l)|0;r=r+b|0;b=((t|u)&h|t&u)+((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+b|0;l=l+-1245643825+(c[f+8>>2]|0)+((r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7))+((n^p)&r^n)|0;t=t+l|0;l=((u|h)&b|u&h)+((b>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10))+l|0;n=n+-373957723+(c[f+12>>2]|0)+((t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7))+((p^r)&t^p)|0;u=u+n|0;n=((h|b)&l|h&b)+((l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10))+n|0;p=p+961987163+(c[f+16>>2]|0)+((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+((r^t)&u^r)|0;h=h+p|0;p=((b|l)&n|b&l)+((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+p|0;r=r+1508970993+(c[f+20>>2]|0)+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+((t^u)&h^t)|0;b=b+r|0;r=((l|n)&p|l&n)+((p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10))+r|0;t=t+-1841331548+(c[f+24>>2]|0)+((b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+((u^h)&b^u)|0;l=l+t|0;t=((n|p)&r|n&p)+((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+t|0;u=u+-1424204075+(c[f+28>>2]|0)+((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+((h^b)&l^h)|0;n=n+u|0;u=((p|r)&t|p&r)+((t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10))+u|0;h=h+-670586216+(c[f+32>>2]|0)+((n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7))+((b^l)&n^b)|0;p=p+h|0;h=((r|t)&u|r&t)+((u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10))+h|0;b=b+310598401+(c[f+36>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((l^n)&p^l)|0;r=r+b|0;b=((t|u)&h|t&u)+((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+b|0;l=l+607225278+(c[f+40>>2]|0)+((r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7))+((n^p)&r^n)|0;t=t+l|0;l=((u|h)&b|u&h)+((b>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10))+l|0;n=n+1426881987+(c[f+44>>2]|0)+((t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7))+((p^r)&t^p)|0;u=u+n|0;n=((h|b)&l|h&b)+((l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10))+n|0;p=p+1925078388+(c[f+48>>2]|0)+((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+((r^t)&u^r)|0;h=h+p|0;p=((b|l)&n|b&l)+((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+p|0;r=r+-2132889090+(c[f+52>>2]|0)+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+((t^u)&h^t)|0;b=b+r|0;r=((l|n)&p|l&n)+((p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10))+r|0;t=t+-1680079193+(c[f+56>>2]|0)+((b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+((u^h)&b^u)|0;l=l+t|0;t=((n|p)&r|n&p)+((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+t|0;u=u+-1046744716+(c[f+60>>2]|0)+((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+((h^b)&l^h)|0;n=n+u|0;u=((p|r)&t|p&r)+((t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10))+u|0;h=h+-459576895+(c[f+64>>2]|0)+((n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7))+((b^l)&n^b)|0;p=p+h|0;h=((r|t)&u|r&t)+((u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10))+h|0;b=b+-272742522+(c[f+68>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((l^n)&p^l)|0;r=r+b|0;b=((t|u)&h|t&u)+((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+b|0;l=l+264347078+(c[f+72>>2]|0)+((r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7))+((n^p)&r^n)|0;t=t+l|0;l=((u|h)&b|u&h)+((b>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10))+l|0;n=n+604807628+(c[f+76>>2]|0)+((t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7))+((p^r)&t^p)|0;u=u+n|0;n=((h|b)&l|h&b)+((l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10))+n|0;p=p+770255983+(c[f+80>>2]|0)+((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+((r^t)&u^r)|0;h=h+p|0;p=((b|l)&n|b&l)+((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+p|0;r=r+1249150122+(c[f+84>>2]|0)+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+((t^u)&h^t)|0;b=b+r|0;r=((l|n)&p|l&n)+((p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10))+r|0;t=t+1555081692+(c[f+88>>2]|0)+((b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+((u^h)&b^u)|0;l=l+t|0;t=((n|p)&r|n&p)+((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+t|0;u=u+1996064986+(c[f+92>>2]|0)+((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+((h^b)&l^h)|0;n=n+u|0;u=((p|r)&t|p&r)+((t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10))+u|0;h=h+-1740746414+(c[f+96>>2]|0)+((n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7))+((b^l)&n^b)|0;p=p+h|0;h=((r|t)&u|r&t)+((u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10))+h|0;b=b+-1473132947+(c[f+100>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((l^n)&p^l)|0;r=r+b|0;b=((t|u)&h|t&u)+((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+b|0;l=l+-1341970488+(c[f+104>>2]|0)+((r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7))+((n^p)&r^n)|0;t=t+l|0;l=((u|h)&b|u&h)+((b>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10))+l|0;n=n+-1084653625+(c[f+108>>2]|0)+((t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7))+((p^r)&t^p)|0;u=u+n|0;n=((h|b)&l|h&b)+((l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10))+n|0;p=p+-958395405+(c[f+112>>2]|0)+((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+((r^t)&u^r)|0;h=h+p|0;p=((b|l)&n|b&l)+((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+p|0;r=r+-710438585+(c[f+116>>2]|0)+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+((t^u)&h^t)|0;b=b+r|0;r=((l|n)&p|l&n)+((p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10))+r|0;t=t+113926993+(c[f+120>>2]|0)+((b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+((u^h)&b^u)|0;l=l+t|0;t=((n|p)&r|n&p)+((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+t|0;u=u+338241895+(c[f+124>>2]|0)+((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+((h^b)&l^h)|0;n=n+u|0;u=((p|r)&t|p&r)+((t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10))+u|0;h=h+666307205+(c[f+128>>2]|0)+((n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7))+((b^l)&n^b)|0;p=p+h|0;h=((r|t)&u|r&t)+((u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10))+h|0;b=b+773529912+(c[f+132>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((l^n)&p^l)|0;r=r+b|0;b=((t|u)&h|t&u)+((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+b|0;l=l+1294757372+(c[f+136>>2]|0)+((r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7))+((n^p)&r^n)|0;t=t+l|0;l=((u|h)&b|u&h)+((b>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10))+l|0;n=n+1396182291+(c[f+140>>2]|0)+((t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7))+((p^r)&t^p)|0;u=u+n|0;n=((h|b)&l|h&b)+((l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10))+n|0;p=p+1695183700+(c[f+144>>2]|0)+((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+((r^t)&u^r)|0;h=h+p|0;p=((b|l)&n|b&l)+((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+p|0;r=r+1986661051+(c[f+148>>2]|0)+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+((t^u)&h^t)|0;b=b+r|0;r=((l|n)&p|l&n)+((p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10))+r|0;t=t+-2117940946+(c[f+152>>2]|0)+((b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+((u^h)&b^u)|0;l=l+t|0;t=((n|p)&r|n&p)+((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+t|0;u=u+-1838011259+(c[f+156>>2]|0)+((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+((h^b)&l^h)|0;n=n+u|0;u=((p|r)&t|p&r)+((t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10))+u|0;h=h+-1564481375+(c[f+160>>2]|0)+((n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7))+((b^l)&n^b)|0;p=p+h|0;h=((r|t)&u|r&t)+((u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10))+h|0;b=b+-1474664885+(c[f+164>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((l^n)&p^l)|0;r=r+b|0;b=((t|u)&h|t&u)+((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+b|0;l=l+-1035236496+(c[f+168>>2]|0)+((r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7))+((n^p)&r^n)|0;t=t+l|0;l=((u|h)&b|u&h)+((b>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10))+l|0;n=n+-949202525+(c[f+172>>2]|0)+((t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7))+((p^r)&t^p)|0;u=u+n|0;n=((h|b)&l|h&b)+((l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10))+n|0;p=p+-778901479+(c[f+176>>2]|0)+((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+((r^t)&u^r)|0;h=h+p|0;p=((b|l)&n|b&l)+((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+p|0;r=r+-694614492+(c[f+180>>2]|0)+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+((t^u)&h^t)|0;b=b+r|0;r=((l|n)&p|l&n)+((p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10))+r|0;t=t+-200395387+(c[f+184>>2]|0)+((b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+((u^h)&b^u)|0;l=l+t|0;t=((n|p)&r|n&p)+((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+t|0;u=u+275423344+(c[f+188>>2]|0)+((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+((h^b)&l^h)|0;n=n+u|0;u=((p|r)&t|p&r)+((t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10))+u|0;h=h+430227734+(c[f+192>>2]|0)+((n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7))+((b^l)&n^b)|0;p=p+h|0;h=((r|t)&u|r&t)+((u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10))+h|0;b=b+506948616+(c[f+196>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((l^n)&p^l)|0;r=r+b|0;b=((t|u)&h|t&u)+((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+b|0;l=l+659060556+(c[f+200>>2]|0)+((r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7))+((n^p)&r^n)|0;t=t+l|0;l=((u|h)&b|u&h)+((b>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10))+l|0;n=n+883997877+(c[f+204>>2]|0)+((t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7))+((p^r)&t^p)|0;u=u+n|0;n=((h|b)&l|h&b)+((l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10))+n|0;p=p+958139571+(c[f+208>>2]|0)+((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+((r^t)&u^r)|0;h=h+p|0;p=((b|l)&n|b&l)+((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+p|0;r=r+1322822218+(c[f+212>>2]|0)+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+((t^u)&h^t)|0;b=b+r|0;r=((l|n)&p|l&n)+((p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10))+r|0;t=t+1537002063+(c[f+216>>2]|0)+((b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+((u^h)&b^u)|0;l=l+t|0;t=((n|p)&r|n&p)+((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+t|0;u=u+1747873779+(c[f+220>>2]|0)+((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+((h^b)&l^h)|0;n=n+u|0;u=((p|r)&t|p&r)+((t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10))+u|0;h=h+1955562222+(c[f+224>>2]|0)+((n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7))+((b^l)&n^b)|0;p=p+h|0;h=((r|t)&u|r&t)+((u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10))+h|0;b=b+2024104815+(c[f+228>>2]|0)+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+((l^n)&p^l)|0;r=r+b|0;b=((t|u)&h|t&u)+((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+b|0;l=l+-2067236844+(c[f+232>>2]|0)+((r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7))+((n^p)&r^n)|0;t=t+l|0;l=((u|h)&b|u&h)+((b>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10))+l|0;n=n+-1933114872+(c[f+236>>2]|0)+((t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7))+((p^r)&t^p)|0;u=u+n|0;n=((h|b)&l|h&b)+((l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10))+n|0;p=p+-1866530822+(c[f+240>>2]|0)+((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+((r^t)&u^r)|0;h=h+p|0;p=((b|l)&n|b&l)+((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+p|0;r=r+-1538233109+(c[f+244>>2]|0)+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+((t^u)&h^t)|0;b=b+r|0;r=((l|n)&p|l&n)+((p>>>2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[u+4>>0]=q;a[u+3>>0]=t;q=Gd(r|0,t|0,40)|0;a[u+2>>0]=q;q=Gd(r|0,t|0,48)|0;a[u+1>>0]=q;t=Gd(r|0,t|0,56)|0;a[u>>0]=t;e=e+1|0}while((e|0)!=8);Fd(b|0,0,208)|0;i=s;return} function yd(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,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;do if(a>>>0<245){o=a>>>0<11?16:a+11&-8;a=o>>>3;j=c[8020]|0;b=j>>>a;if(b&3){b=(b&1^1)+a|0;d=32120+(b<<1<<2)|0;e=d+8|0;f=c[e>>2]|0;g=f+8|0;h=c[g>>2]|0;do if((d|0)!=(h|0)){if(h>>>0<(c[8024]|0)>>>0)ra();a=h+12|0;if((c[a>>2]|0)==(f|0)){c[a>>2]=d;c[e>>2]=h;break}else ra()}else c[8020]=j&~(1<>2]=G|3;G=f+G+4|0;c[G>>2]=c[G>>2]|1;G=g;return G|0}h=c[8022]|0;if(o>>>0>h>>>0){if(b){d=2<>>12&16;d=d>>>i;f=d>>>5&8;d=d>>>f;g=d>>>2&4;d=d>>>g;e=d>>>1&2;d=d>>>e;b=d>>>1&1;b=(f|i|g|e|b)+(d>>>b)|0;d=32120+(b<<1<<2)|0;e=d+8|0;g=c[e>>2]|0;i=g+8|0;f=c[i>>2]|0;do if((d|0)!=(f|0)){if(f>>>0<(c[8024]|0)>>>0)ra();a=f+12|0;if((c[a>>2]|0)==(g|0)){c[a>>2]=d;c[e>>2]=f;k=c[8022]|0;break}else ra()}else{c[8020]=j&~(1<>2]=o|3;e=g+o|0;c[e+4>>2]=h|1;c[e+h>>2]=h;if(k){f=c[8025]|0;b=k>>>3;d=32120+(b<<1<<2)|0;a=c[8020]|0;b=1<>2]|0;if(b>>>0<(c[8024]|0)>>>0)ra();else{l=a;m=b}}else{c[8020]=a|b;l=d+8|0;m=d}c[l>>2]=f;c[m+12>>2]=f;c[f+8>>2]=m;c[f+12>>2]=d}c[8022]=h;c[8025]=e;G=i;return G|0}a=c[8021]|0;if(a){i=(a&0-a)+-1|0;F=i>>>12&16;i=i>>>F;E=i>>>5&8;i=i>>>E;G=i>>>2&4;i=i>>>G;b=i>>>1&2;i=i>>>b;j=i>>>1&1;j=c[32384+((E|F|G|b|j)+(i>>>j)<<2)>>2]|0;i=(c[j+4>>2]&-8)-o|0;b=j;while(1){a=c[b+16>>2]|0;if(!a){a=c[b+20>>2]|0;if(!a)break}b=(c[a+4>>2]&-8)-o|0;G=b>>>0>>0;i=G?b:i;b=a;j=G?a:j}f=c[8024]|0;if(j>>>0>>0)ra();h=j+o|0;if(j>>>0>=h>>>0)ra();g=c[j+24>>2]|0;d=c[j+12>>2]|0;do if((d|0)==(j|0)){b=j+20|0;a=c[b>>2]|0;if(!a){b=j+16|0;a=c[b>>2]|0;if(!a){n=0;break}}while(1){d=a+20|0;e=c[d>>2]|0;if(e){a=e;b=d;continue}d=a+16|0;e=c[d>>2]|0;if(!e)break;else{a=e;b=d}}if(b>>>0>>0)ra();else{c[b>>2]=0;n=a;break}}else{e=c[j+8>>2]|0;if(e>>>0>>0)ra();a=e+12|0;if((c[a>>2]|0)!=(j|0))ra();b=d+8|0;if((c[b>>2]|0)==(j|0)){c[a>>2]=d;c[b>>2]=e;n=d;break}else ra()}while(0);do if(g){a=c[j+28>>2]|0;b=32384+(a<<2)|0;if((j|0)==(c[b>>2]|0)){c[b>>2]=n;if(!n){c[8021]=c[8021]&~(1<>>0<(c[8024]|0)>>>0)ra();a=g+16|0;if((c[a>>2]|0)==(j|0))c[a>>2]=n;else c[g+20>>2]=n;if(!n)break}b=c[8024]|0;if(n>>>0>>0)ra();c[n+24>>2]=g;a=c[j+16>>2]|0;do if(a)if(a>>>0>>0)ra();else{c[n+16>>2]=a;c[a+24>>2]=n;break}while(0);a=c[j+20>>2]|0;if(a)if(a>>>0<(c[8024]|0)>>>0)ra();else{c[n+20>>2]=a;c[a+24>>2]=n;break}}while(0);if(i>>>0<16){G=i+o|0;c[j+4>>2]=G|3;G=j+G+4|0;c[G>>2]=c[G>>2]|1}else{c[j+4>>2]=o|3;c[h+4>>2]=i|1;c[h+i>>2]=i;a=c[8022]|0;if(a){e=c[8025]|0;b=a>>>3;d=32120+(b<<1<<2)|0;a=c[8020]|0;b=1<>2]|0;if(b>>>0<(c[8024]|0)>>>0)ra();else{p=a;q=b}}else{c[8020]=a|b;p=d+8|0;q=d}c[p>>2]=e;c[q+12>>2]=e;c[e+8>>2]=q;c[e+12>>2]=d}c[8022]=i;c[8025]=h}G=j+8|0;return G|0}}}else if(a>>>0<=4294967231){a=a+11|0;o=a&-8;k=c[8021]|0;if(k){d=0-o|0;a=a>>>8;if(a)if(o>>>0>16777215)j=31;else{q=(a+1048320|0)>>>16&8;z=a<>>16&4;z=z<>>16&2;j=14-(p|q|j)+(z<>>15)|0;j=o>>>(j+7|0)&1|j<<1}else j=0;b=c[32384+(j<<2)>>2]|0;a:do if(!b){a=0;b=0;z=86}else{f=d;a=0;h=o<<((j|0)==31?0:25-(j>>>1)|0);i=b;b=0;while(1){e=c[i+4>>2]&-8;d=e-o|0;if(d>>>0>>0)if((e|0)==(o|0)){a=i;b=i;z=90;break a}else b=i;else d=f;e=c[i+20>>2]|0;i=c[i+16+(h>>>31<<2)>>2]|0;a=(e|0)==0|(e|0)==(i|0)?a:e;e=(i|0)==0;if(e){z=86;break}else{f=d;h=h<<(e&1^1)}}}while(0);if((z|0)==86){if((a|0)==0&(b|0)==0){a=2<>>12&16;q=q>>>m;l=q>>>5&8;q=q>>>l;n=q>>>2&4;q=q>>>n;p=q>>>1&2;q=q>>>p;a=q>>>1&1;a=c[32384+((l|m|n|p|a)+(q>>>a)<<2)>>2]|0}if(!a){i=d;j=b}else z=90}if((z|0)==90)while(1){z=0;q=(c[a+4>>2]&-8)-o|0;e=q>>>0>>0;d=e?q:d;b=e?a:b;e=c[a+16>>2]|0;if(e){a=e;z=90;continue}a=c[a+20>>2]|0;if(!a){i=d;j=b;break}else z=90}if((j|0)!=0?i>>>0<((c[8022]|0)-o|0)>>>0:0){f=c[8024]|0;if(j>>>0>>0)ra();h=j+o|0;if(j>>>0>=h>>>0)ra();g=c[j+24>>2]|0;d=c[j+12>>2]|0;do if((d|0)==(j|0)){b=j+20|0;a=c[b>>2]|0;if(!a){b=j+16|0;a=c[b>>2]|0;if(!a){s=0;break}}while(1){d=a+20|0;e=c[d>>2]|0;if(e){a=e;b=d;continue}d=a+16|0;e=c[d>>2]|0;if(!e)break;else{a=e;b=d}}if(b>>>0>>0)ra();else{c[b>>2]=0;s=a;break}}else{e=c[j+8>>2]|0;if(e>>>0>>0)ra();a=e+12|0;if((c[a>>2]|0)!=(j|0))ra();b=d+8|0;if((c[b>>2]|0)==(j|0)){c[a>>2]=d;c[b>>2]=e;s=d;break}else ra()}while(0);do if(g){a=c[j+28>>2]|0;b=32384+(a<<2)|0;if((j|0)==(c[b>>2]|0)){c[b>>2]=s;if(!s){c[8021]=c[8021]&~(1<>>0<(c[8024]|0)>>>0)ra();a=g+16|0;if((c[a>>2]|0)==(j|0))c[a>>2]=s;else c[g+20>>2]=s;if(!s)break}b=c[8024]|0;if(s>>>0>>0)ra();c[s+24>>2]=g;a=c[j+16>>2]|0;do if(a)if(a>>>0>>0)ra();else{c[s+16>>2]=a;c[a+24>>2]=s;break}while(0);a=c[j+20>>2]|0;if(a)if(a>>>0<(c[8024]|0)>>>0)ra();else{c[s+20>>2]=a;c[a+24>>2]=s;break}}while(0);do if(i>>>0>=16){c[j+4>>2]=o|3;c[h+4>>2]=i|1;c[h+i>>2]=i;a=i>>>3;if(i>>>0<256){d=32120+(a<<1<<2)|0;b=c[8020]|0;a=1<>2]|0;if(b>>>0<(c[8024]|0)>>>0)ra();else{t=a;v=b}}else{c[8020]=b|a;t=d+8|0;v=d}c[t>>2]=h;c[v+12>>2]=h;c[h+8>>2]=v;c[h+12>>2]=d;break}a=i>>>8;if(a)if(i>>>0>16777215)d=31;else{F=(a+1048320|0)>>>16&8;G=a<>>16&4;G=G<>>16&2;d=14-(E|F|d)+(G<>>15)|0;d=i>>>(d+7|0)&1|d<<1}else d=0;e=32384+(d<<2)|0;c[h+28>>2]=d;a=h+16|0;c[a+4>>2]=0;c[a>>2]=0;a=c[8021]|0;b=1<>2]=h;c[h+24>>2]=e;c[h+12>>2]=h;c[h+8>>2]=h;break}d=i<<((d|0)==31?0:25-(d>>>1)|0);e=c[e>>2]|0;while(1){if((c[e+4>>2]&-8|0)==(i|0)){z=148;break}b=e+16+(d>>>31<<2)|0;a=c[b>>2]|0;if(!a){z=145;break}else{d=d<<1;e=a}}if((z|0)==145)if(b>>>0<(c[8024]|0)>>>0)ra();else{c[b>>2]=h;c[h+24>>2]=e;c[h+12>>2]=h;c[h+8>>2]=h;break}else if((z|0)==148){a=e+8|0;b=c[a>>2]|0;G=c[8024]|0;if(b>>>0>=G>>>0&e>>>0>=G>>>0){c[b+12>>2]=h;c[a>>2]=h;c[h+8>>2]=b;c[h+12>>2]=e;c[h+24>>2]=0;break}else ra()}}else{G=i+o|0;c[j+4>>2]=G|3;G=j+G+4|0;c[G>>2]=c[G>>2]|1}while(0);G=j+8|0;return G|0}}}else o=-1;while(0);d=c[8022]|0;if(d>>>0>=o>>>0){a=d-o|0;b=c[8025]|0;if(a>>>0>15){G=b+o|0;c[8025]=G;c[8022]=a;c[G+4>>2]=a|1;c[G+a>>2]=a;c[b+4>>2]=o|3}else{c[8022]=0;c[8025]=0;c[b+4>>2]=d|3;G=b+d+4|0;c[G>>2]=c[G>>2]|1}G=b+8|0;return G|0}a=c[8023]|0;if(a>>>0>o>>>0){E=a-o|0;c[8023]=E;G=c[8026]|0;F=G+o|0;c[8026]=F;c[F+4>>2]=E|1;c[G+4>>2]=o|3;G=G+8|0;return G|0}do if(!(c[8138]|0)){a=na(30)|0;if(!(a+-1&a)){c[8140]=a;c[8139]=a;c[8141]=-1;c[8142]=-1;c[8143]=0;c[8131]=0;c[8138]=(ta(0)|0)&-16^1431655768;break}else ra()}while(0);h=o+48|0;e=c[8140]|0;i=o+47|0;d=e+i|0;e=0-e|0;j=d&e;if(j>>>0<=o>>>0){G=0;return G|0}a=c[8130]|0;if((a|0)!=0?(t=c[8128]|0,v=t+j|0,v>>>0<=t>>>0|v>>>0>a>>>0):0){G=0;return G|0}b:do if(!(c[8131]&4)){b=c[8026]|0;c:do if(b){f=32528;while(1){a=c[f>>2]|0;if(a>>>0<=b>>>0?(r=f+4|0,(a+(c[r>>2]|0)|0)>>>0>b>>>0):0)break;a=c[f+8>>2]|0;if(!a){z=173;break c}else f=a}a=d-(c[8023]|0)&e;if(a>>>0<2147483647){b=sa(a|0)|0;if((b|0)==((c[f>>2]|0)+(c[r>>2]|0)|0)){if((b|0)!=(-1|0)){h=b;g=a;z=193;break b}}else z=183}}else z=173;while(0);do if((z|0)==173?(u=sa(0)|0,(u|0)!=(-1|0)):0){a=u;b=c[8139]|0;d=b+-1|0;if(!(d&a))a=j;else a=j-a+(d+a&0-b)|0;b=c[8128]|0;d=b+a|0;if(a>>>0>o>>>0&a>>>0<2147483647){v=c[8130]|0;if((v|0)!=0?d>>>0<=b>>>0|d>>>0>v>>>0:0)break;b=sa(a|0)|0;if((b|0)==(u|0)){h=u;g=a;z=193;break b}else z=183}}while(0);d:do if((z|0)==183){d=0-a|0;do if(h>>>0>a>>>0&(a>>>0<2147483647&(b|0)!=(-1|0))?(w=c[8140]|0,w=i-a+w&0-w,w>>>0<2147483647):0)if((sa(w|0)|0)==(-1|0)){sa(d|0)|0;break d}else{a=w+a|0;break}while(0);if((b|0)!=(-1|0)){h=b;g=a;z=193;break b}}while(0);c[8131]=c[8131]|4;z=190}else z=190;while(0);if((((z|0)==190?j>>>0<2147483647:0)?(x=sa(j|0)|0,y=sa(0)|0,x>>>0>>0&((x|0)!=(-1|0)&(y|0)!=(-1|0))):0)?(g=y-x|0,g>>>0>(o+40|0)>>>0):0){h=x;z=193}if((z|0)==193){a=(c[8128]|0)+g|0;c[8128]=a;if(a>>>0>(c[8129]|0)>>>0)c[8129]=a;k=c[8026]|0;do if(k){f=32528;while(1){a=c[f>>2]|0;b=f+4|0;d=c[b>>2]|0;if((h|0)==(a+d|0)){z=203;break}e=c[f+8>>2]|0;if(!e)break;else f=e}if(((z|0)==203?(c[f+12>>2]&8|0)==0:0)?k>>>0>>0&k>>>0>=a>>>0:0){c[b>>2]=d+g;G=k+8|0;G=(G&7|0)==0?0:0-G&7;F=k+G|0;G=g-G+(c[8023]|0)|0;c[8026]=F;c[8023]=G;c[F+4>>2]=G|1;c[F+G+4>>2]=40;c[8027]=c[8142];break}a=c[8024]|0;if(h>>>0>>0){c[8024]=h;i=h}else i=a;b=h+g|0;a=32528;while(1){if((c[a>>2]|0)==(b|0)){z=211;break}a=c[a+8>>2]|0;if(!a){b=32528;break}}if((z|0)==211)if(!(c[a+12>>2]&8)){c[a>>2]=h;m=a+4|0;c[m>>2]=(c[m>>2]|0)+g;m=h+8|0;m=h+((m&7|0)==0?0:0-m&7)|0;a=b+8|0;a=b+((a&7|0)==0?0:0-a&7)|0;l=m+o|0;j=a-m-o|0;c[m+4>>2]=o|3;do if((a|0)!=(k|0)){if((a|0)==(c[8025]|0)){G=(c[8022]|0)+j|0;c[8022]=G;c[8025]=l;c[l+4>>2]=G|1;c[l+G>>2]=G;break}b=c[a+4>>2]|0;if((b&3|0)==1){h=b&-8;f=b>>>3;e:do if(b>>>0>=256){g=c[a+24>>2]|0;e=c[a+12>>2]|0;do if((e|0)==(a|0)){e=a+16|0;d=e+4|0;b=c[d>>2]|0;if(!b){b=c[e>>2]|0;if(!b){E=0;break}else d=e}while(1){e=b+20|0;f=c[e>>2]|0;if(f){b=f;d=e;continue}e=b+16|0;f=c[e>>2]|0;if(!f)break;else{b=f;d=e}}if(d>>>0>>0)ra();else{c[d>>2]=0;E=b;break}}else{f=c[a+8>>2]|0;if(f>>>0>>0)ra();b=f+12|0;if((c[b>>2]|0)!=(a|0))ra();d=e+8|0;if((c[d>>2]|0)==(a|0)){c[b>>2]=e;c[d>>2]=f;E=e;break}else ra()}while(0);if(!g)break;b=c[a+28>>2]|0;d=32384+(b<<2)|0;do if((a|0)!=(c[d>>2]|0)){if(g>>>0<(c[8024]|0)>>>0)ra();b=g+16|0;if((c[b>>2]|0)==(a|0))c[b>>2]=E;else c[g+20>>2]=E;if(!E)break e}else{c[d>>2]=E;if(E)break;c[8021]=c[8021]&~(1<>>0>>0)ra();c[E+24>>2]=g;b=a+16|0;d=c[b>>2]|0;do if(d)if(d>>>0>>0)ra();else{c[E+16>>2]=d;c[d+24>>2]=E;break}while(0);b=c[b+4>>2]|0;if(!b)break;if(b>>>0<(c[8024]|0)>>>0)ra();else{c[E+20>>2]=b;c[b+24>>2]=E;break}}else{d=c[a+8>>2]|0;e=c[a+12>>2]|0;b=32120+(f<<1<<2)|0;do if((d|0)!=(b|0)){if(d>>>0>>0)ra();if((c[d+12>>2]|0)==(a|0))break;ra()}while(0);if((e|0)==(d|0)){c[8020]=c[8020]&~(1<>>0>>0)ra();b=e+8|0;if((c[b>>2]|0)==(a|0)){B=b;break}ra()}while(0);c[d+12>>2]=e;c[B>>2]=d}while(0);a=a+h|0;f=h+j|0}else f=j;a=a+4|0;c[a>>2]=c[a>>2]&-2;c[l+4>>2]=f|1;c[l+f>>2]=f;a=f>>>3;if(f>>>0<256){d=32120+(a<<1<<2)|0;b=c[8020]|0;a=1<>2]|0;if(b>>>0>=(c[8024]|0)>>>0){F=a;G=b;break}ra()}while(0);c[F>>2]=l;c[G+12>>2]=l;c[l+8>>2]=G;c[l+12>>2]=d;break}a=f>>>8;do if(!a)d=0;else{if(f>>>0>16777215){d=31;break}F=(a+1048320|0)>>>16&8;G=a<>>16&4;G=G<>>16&2;d=14-(E|F|d)+(G<>>15)|0;d=f>>>(d+7|0)&1|d<<1}while(0);e=32384+(d<<2)|0;c[l+28>>2]=d;a=l+16|0;c[a+4>>2]=0;c[a>>2]=0;a=c[8021]|0;b=1<>2]=l;c[l+24>>2]=e;c[l+12>>2]=l;c[l+8>>2]=l;break}d=f<<((d|0)==31?0:25-(d>>>1)|0);e=c[e>>2]|0;while(1){if((c[e+4>>2]&-8|0)==(f|0)){z=281;break}b=e+16+(d>>>31<<2)|0;a=c[b>>2]|0;if(!a){z=278;break}else{d=d<<1;e=a}}if((z|0)==278)if(b>>>0<(c[8024]|0)>>>0)ra();else{c[b>>2]=l;c[l+24>>2]=e;c[l+12>>2]=l;c[l+8>>2]=l;break}else if((z|0)==281){a=e+8|0;b=c[a>>2]|0;G=c[8024]|0;if(b>>>0>=G>>>0&e>>>0>=G>>>0){c[b+12>>2]=l;c[a>>2]=l;c[l+8>>2]=b;c[l+12>>2]=e;c[l+24>>2]=0;break}else ra()}}else{G=(c[8023]|0)+j|0;c[8023]=G;c[8026]=l;c[l+4>>2]=G|1}while(0);G=m+8|0;return G|0}else b=32528;while(1){a=c[b>>2]|0;if(a>>>0<=k>>>0?(A=a+(c[b+4>>2]|0)|0,A>>>0>k>>>0):0)break;b=c[b+8>>2]|0}f=A+-47|0;b=f+8|0;b=f+((b&7|0)==0?0:0-b&7)|0;f=k+16|0;b=b>>>0>>0?k:b;a=b+8|0;d=h+8|0;d=(d&7|0)==0?0:0-d&7;G=h+d|0;d=g+-40-d|0;c[8026]=G;c[8023]=d;c[G+4>>2]=d|1;c[G+d+4>>2]=40;c[8027]=c[8142];d=b+4|0;c[d>>2]=27;c[a>>2]=c[8132];c[a+4>>2]=c[8133];c[a+8>>2]=c[8134];c[a+12>>2]=c[8135];c[8132]=h;c[8133]=g;c[8135]=0;c[8134]=a;a=b+24|0;do{a=a+4|0;c[a>>2]=7}while((a+4|0)>>>0>>0);if((b|0)!=(k|0)){g=b-k|0;c[d>>2]=c[d>>2]&-2;c[k+4>>2]=g|1;c[b>>2]=g;a=g>>>3;if(g>>>0<256){d=32120+(a<<1<<2)|0;b=c[8020]|0;a=1<>2]|0;if(b>>>0<(c[8024]|0)>>>0)ra();else{C=a;D=b}}else{c[8020]=b|a;C=d+8|0;D=d}c[C>>2]=k;c[D+12>>2]=k;c[k+8>>2]=D;c[k+12>>2]=d;break}a=g>>>8;if(a)if(g>>>0>16777215)d=31;else{F=(a+1048320|0)>>>16&8;G=a<>>16&4;G=G<>>16&2;d=14-(E|F|d)+(G<>>15)|0;d=g>>>(d+7|0)&1|d<<1}else d=0;e=32384+(d<<2)|0;c[k+28>>2]=d;c[k+20>>2]=0;c[f>>2]=0;a=c[8021]|0;b=1<>2]=k;c[k+24>>2]=e;c[k+12>>2]=k;c[k+8>>2]=k;break}d=g<<((d|0)==31?0:25-(d>>>1)|0);e=c[e>>2]|0;while(1){if((c[e+4>>2]&-8|0)==(g|0)){z=307;break}b=e+16+(d>>>31<<2)|0;a=c[b>>2]|0;if(!a){z=304;break}else{d=d<<1;e=a}}if((z|0)==304)if(b>>>0<(c[8024]|0)>>>0)ra();else{c[b>>2]=k;c[k+24>>2]=e;c[k+12>>2]=k;c[k+8>>2]=k;break}else if((z|0)==307){a=e+8|0;b=c[a>>2]|0;G=c[8024]|0;if(b>>>0>=G>>>0&e>>>0>=G>>>0){c[b+12>>2]=k;c[a>>2]=k;c[k+8>>2]=b;c[k+12>>2]=e;c[k+24>>2]=0;break}else ra()}}}else{G=c[8024]|0;if((G|0)==0|h>>>0>>0)c[8024]=h;c[8132]=h;c[8133]=g;c[8135]=0;c[8029]=c[8138];c[8028]=-1;a=0;do{G=32120+(a<<1<<2)|0;c[G+12>>2]=G;c[G+8>>2]=G;a=a+1|0}while((a|0)!=32);G=h+8|0;G=(G&7|0)==0?0:0-G&7;F=h+G|0;G=g+-40-G|0;c[8026]=F;c[8023]=G;c[F+4>>2]=G|1;c[F+G+4>>2]=40;c[8027]=c[8142]}while(0);a=c[8023]|0;if(a>>>0>o>>>0){E=a-o|0;c[8023]=E;G=c[8026]|0;F=G+o|0;c[8026]=F;c[F+4>>2]=E|1;c[G+4>>2]=o|3;G=G+8|0;return G|0}}if(!(c[7979]|0))a=31964;else a=c[(oa()|0)+60>>2]|0;c[a>>2]=12;G=0;return G|0}function zd(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,n=0,o=0,p=0,q=0;if(!a)return;d=a+-8|0;h=c[8024]|0;if(d>>>0>>0)ra();a=c[a+-4>>2]|0;b=a&3;if((b|0)==1)ra();e=a&-8;m=d+e|0;do if(!(a&1)){a=c[d>>2]|0;if(!b)return;k=d+(0-a)|0;j=a+e|0;if(k>>>0>>0)ra();if((k|0)==(c[8025]|0)){a=m+4|0;b=c[a>>2]|0;if((b&3|0)!=3){q=k;f=j;break}c[8022]=j;c[a>>2]=b&-2;c[k+4>>2]=j|1;c[k+j>>2]=j;return}e=a>>>3;if(a>>>0<256){b=c[k+8>>2]|0;d=c[k+12>>2]|0;a=32120+(e<<1<<2)|0;if((b|0)!=(a|0)){if(b>>>0>>0)ra();if((c[b+12>>2]|0)!=(k|0))ra()}if((d|0)==(b|0)){c[8020]=c[8020]&~(1<>>0>>0)ra();a=d+8|0;if((c[a>>2]|0)==(k|0))g=a;else ra()}else g=d+8|0;c[b+12>>2]=d;c[g>>2]=b;q=k;f=j;break}g=c[k+24>>2]|0;d=c[k+12>>2]|0;do if((d|0)==(k|0)){d=k+16|0;b=d+4|0;a=c[b>>2]|0;if(!a){a=c[d>>2]|0;if(!a){i=0;break}else b=d}while(1){d=a+20|0;e=c[d>>2]|0;if(e){a=e;b=d;continue}d=a+16|0;e=c[d>>2]|0;if(!e)break;else{a=e;b=d}}if(b>>>0>>0)ra();else{c[b>>2]=0;i=a;break}}else{e=c[k+8>>2]|0;if(e>>>0>>0)ra();a=e+12|0;if((c[a>>2]|0)!=(k|0))ra();b=d+8|0;if((c[b>>2]|0)==(k|0)){c[a>>2]=d;c[b>>2]=e;i=d;break}else ra()}while(0);if(g){a=c[k+28>>2]|0;b=32384+(a<<2)|0;if((k|0)==(c[b>>2]|0)){c[b>>2]=i;if(!i){c[8021]=c[8021]&~(1<>>0<(c[8024]|0)>>>0)ra();a=g+16|0;if((c[a>>2]|0)==(k|0))c[a>>2]=i;else c[g+20>>2]=i;if(!i){q=k;f=j;break}}d=c[8024]|0;if(i>>>0>>0)ra();c[i+24>>2]=g;a=k+16|0;b=c[a>>2]|0;do if(b)if(b>>>0>>0)ra();else{c[i+16>>2]=b;c[b+24>>2]=i;break}while(0);a=c[a+4>>2]|0;if(a)if(a>>>0<(c[8024]|0)>>>0)ra();else{c[i+20>>2]=a;c[a+24>>2]=i;q=k;f=j;break}else{q=k;f=j}}else{q=k;f=j}}else{q=d;f=e}while(0);if(q>>>0>=m>>>0)ra();a=m+4|0;b=c[a>>2]|0;if(!(b&1))ra();if(!(b&2)){if((m|0)==(c[8026]|0)){p=(c[8023]|0)+f|0;c[8023]=p;c[8026]=q;c[q+4>>2]=p|1;if((q|0)!=(c[8025]|0))return;c[8025]=0;c[8022]=0;return}if((m|0)==(c[8025]|0)){p=(c[8022]|0)+f|0;c[8022]=p;c[8025]=q;c[q+4>>2]=p|1;c[q+p>>2]=p;return}f=(b&-8)+f|0;e=b>>>3;do if(b>>>0>=256){g=c[m+24>>2]|0;a=c[m+12>>2]|0;do if((a|0)==(m|0)){d=m+16|0;b=d+4|0;a=c[b>>2]|0;if(!a){a=c[d>>2]|0;if(!a){n=0;break}else b=d}while(1){d=a+20|0;e=c[d>>2]|0;if(e){a=e;b=d;continue}d=a+16|0;e=c[d>>2]|0;if(!e)break;else{a=e;b=d}}if(b>>>0<(c[8024]|0)>>>0)ra();else{c[b>>2]=0;n=a;break}}else{b=c[m+8>>2]|0;if(b>>>0<(c[8024]|0)>>>0)ra();d=b+12|0;if((c[d>>2]|0)!=(m|0))ra();e=a+8|0;if((c[e>>2]|0)==(m|0)){c[d>>2]=a;c[e>>2]=b;n=a;break}else ra()}while(0);if(g){a=c[m+28>>2]|0;b=32384+(a<<2)|0;if((m|0)==(c[b>>2]|0)){c[b>>2]=n;if(!n){c[8021]=c[8021]&~(1<>>0<(c[8024]|0)>>>0)ra();a=g+16|0;if((c[a>>2]|0)==(m|0))c[a>>2]=n;else c[g+20>>2]=n;if(!n)break}d=c[8024]|0;if(n>>>0>>0)ra();c[n+24>>2]=g;a=m+16|0;b=c[a>>2]|0;do if(b)if(b>>>0>>0)ra();else{c[n+16>>2]=b;c[b+24>>2]=n;break}while(0);a=c[a+4>>2]|0;if(a)if(a>>>0<(c[8024]|0)>>>0)ra();else{c[n+20>>2]=a;c[a+24>>2]=n;break}}}else{b=c[m+8>>2]|0;d=c[m+12>>2]|0;a=32120+(e<<1<<2)|0;if((b|0)!=(a|0)){if(b>>>0<(c[8024]|0)>>>0)ra();if((c[b+12>>2]|0)!=(m|0))ra()}if((d|0)==(b|0)){c[8020]=c[8020]&~(1<>>0<(c[8024]|0)>>>0)ra();a=d+8|0;if((c[a>>2]|0)==(m|0))l=a;else ra()}else l=d+8|0;c[b+12>>2]=d;c[l>>2]=b}while(0);c[q+4>>2]=f|1;c[q+f>>2]=f;if((q|0)==(c[8025]|0)){c[8022]=f;return}}else{c[a>>2]=b&-2;c[q+4>>2]=f|1;c[q+f>>2]=f}a=f>>>3;if(f>>>0<256){d=32120+(a<<1<<2)|0;b=c[8020]|0;a=1<>2]|0;if(b>>>0<(c[8024]|0)>>>0)ra();else{o=a;p=b}}else{c[8020]=b|a;o=d+8|0;p=d}c[o>>2]=q;c[p+12>>2]=q;c[q+8>>2]=p;c[q+12>>2]=d;return}a=f>>>8;if(a)if(f>>>0>16777215)d=31;else{o=(a+1048320|0)>>>16&8;p=a<>>16&4;p=p<>>16&2;d=14-(n|o|d)+(p<>>15)|0;d=f>>>(d+7|0)&1|d<<1}else d=0;e=32384+(d<<2)|0;c[q+28>>2]=d;c[q+20>>2]=0;c[q+16>>2]=0;a=c[8021]|0;b=1<>>1)|0);e=c[e>>2]|0;while(1){if((c[e+4>>2]&-8|0)==(f|0)){a=130;break}b=e+16+(d>>>31<<2)|0;a=c[b>>2]|0;if(!a){a=127;break}else{d=d<<1;e=a}}if((a|0)==127)if(b>>>0<(c[8024]|0)>>>0)ra();else{c[b>>2]=q;c[q+24>>2]=e;c[q+12>>2]=q;c[q+8>>2]=q;break}else if((a|0)==130){a=e+8|0;b=c[a>>2]|0;p=c[8024]|0;if(b>>>0>=p>>>0&e>>>0>=p>>>0){c[b+12>>2]=q;c[a>>2]=q;c[q+8>>2]=b;c[q+12>>2]=e;c[q+24>>2]=0;break}else ra()}}else{c[8021]=a|b;c[e>>2]=q;c[q+24>>2]=e;c[q+12>>2]=q;c[q+8>>2]=q}while(0);q=(c[8028]|0)+-1|0;c[8028]=q;if(!q)a=32536;else return;while(1){a=c[a>>2]|0;if(!a)break;else a=a+8|0}c[8028]=-1;return}function Ad(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;o=a+b|0;d=c[a+4>>2]|0;do if(!(d&1)){g=c[a>>2]|0;if(!(d&3))return;l=a+(0-g)|0;k=g+b|0;i=c[8024]|0;if(l>>>0>>0)ra();if((l|0)==(c[8025]|0)){a=o+4|0;d=c[a>>2]|0;if((d&3|0)!=3){r=l;f=k;break}c[8022]=k;c[a>>2]=d&-2;c[l+4>>2]=k|1;c[l+k>>2]=k;return}e=g>>>3;if(g>>>0<256){a=c[l+8>>2]|0;b=c[l+12>>2]|0;d=32120+(e<<1<<2)|0;if((a|0)!=(d|0)){if(a>>>0>>0)ra();if((c[a+12>>2]|0)!=(l|0))ra()}if((b|0)==(a|0)){c[8020]=c[8020]&~(1<>>0>>0)ra();d=b+8|0;if((c[d>>2]|0)==(l|0))h=d;else ra()}else h=b+8|0;c[a+12>>2]=b;c[h>>2]=a;r=l;f=k;break}g=c[l+24>>2]|0;b=c[l+12>>2]|0;do if((b|0)==(l|0)){b=l+16|0;a=b+4|0;d=c[a>>2]|0;if(!d){d=c[b>>2]|0;if(!d){j=0;break}else a=b}while(1){b=d+20|0;e=c[b>>2]|0;if(e){d=e;a=b;continue}b=d+16|0;e=c[b>>2]|0;if(!e)break;else{d=e;a=b}}if(a>>>0>>0)ra();else{c[a>>2]=0;j=d;break}}else{e=c[l+8>>2]|0;if(e>>>0>>0)ra();d=e+12|0;if((c[d>>2]|0)!=(l|0))ra();a=b+8|0;if((c[a>>2]|0)==(l|0)){c[d>>2]=b;c[a>>2]=e;j=b;break}else ra()}while(0);if(g){d=c[l+28>>2]|0;a=32384+(d<<2)|0;if((l|0)==(c[a>>2]|0)){c[a>>2]=j;if(!j){c[8021]=c[8021]&~(1<>>0<(c[8024]|0)>>>0)ra();d=g+16|0;if((c[d>>2]|0)==(l|0))c[d>>2]=j;else c[g+20>>2]=j;if(!j){r=l;f=k;break}}b=c[8024]|0;if(j>>>0>>0)ra();c[j+24>>2]=g;d=l+16|0;a=c[d>>2]|0;do if(a)if(a>>>0>>0)ra();else{c[j+16>>2]=a;c[a+24>>2]=j;break}while(0);d=c[d+4>>2]|0;if(d)if(d>>>0<(c[8024]|0)>>>0)ra();else{c[j+20>>2]=d;c[d+24>>2]=j;r=l;f=k;break}else{r=l;f=k}}else{r=l;f=k}}else{r=a;f=b}while(0);h=c[8024]|0;if(o>>>0>>0)ra();d=o+4|0;a=c[d>>2]|0;if(!(a&2)){if((o|0)==(c[8026]|0)){q=(c[8023]|0)+f|0;c[8023]=q;c[8026]=r;c[r+4>>2]=q|1;if((r|0)!=(c[8025]|0))return;c[8025]=0;c[8022]=0;return}if((o|0)==(c[8025]|0)){q=(c[8022]|0)+f|0;c[8022]=q;c[8025]=r;c[r+4>>2]=q|1;c[r+q>>2]=q;return}f=(a&-8)+f|0;e=a>>>3;do if(a>>>0>=256){g=c[o+24>>2]|0;b=c[o+12>>2]|0;do if((b|0)==(o|0)){b=o+16|0;a=b+4|0;d=c[a>>2]|0;if(!d){d=c[b>>2]|0;if(!d){n=0;break}else a=b}while(1){b=d+20|0;e=c[b>>2]|0;if(e){d=e;a=b;continue}b=d+16|0;e=c[b>>2]|0;if(!e)break;else{d=e;a=b}}if(a>>>0>>0)ra();else{c[a>>2]=0;n=d;break}}else{e=c[o+8>>2]|0;if(e>>>0>>0)ra();d=e+12|0;if((c[d>>2]|0)!=(o|0))ra();a=b+8|0;if((c[a>>2]|0)==(o|0)){c[d>>2]=b;c[a>>2]=e;n=b;break}else ra()}while(0);if(g){d=c[o+28>>2]|0;a=32384+(d<<2)|0;if((o|0)==(c[a>>2]|0)){c[a>>2]=n;if(!n){c[8021]=c[8021]&~(1<>>0<(c[8024]|0)>>>0)ra();d=g+16|0;if((c[d>>2]|0)==(o|0))c[d>>2]=n;else c[g+20>>2]=n;if(!n)break}b=c[8024]|0;if(n>>>0>>0)ra();c[n+24>>2]=g;d=o+16|0;a=c[d>>2]|0;do if(a)if(a>>>0>>0)ra();else{c[n+16>>2]=a;c[a+24>>2]=n;break}while(0);d=c[d+4>>2]|0;if(d)if(d>>>0<(c[8024]|0)>>>0)ra();else{c[n+20>>2]=d;c[d+24>>2]=n;break}}}else{a=c[o+8>>2]|0;b=c[o+12>>2]|0;d=32120+(e<<1<<2)|0;if((a|0)!=(d|0)){if(a>>>0>>0)ra();if((c[a+12>>2]|0)!=(o|0))ra()}if((b|0)==(a|0)){c[8020]=c[8020]&~(1<>>0>>0)ra();d=b+8|0;if((c[d>>2]|0)==(o|0))m=d;else ra()}else m=b+8|0;c[a+12>>2]=b;c[m>>2]=a}while(0);c[r+4>>2]=f|1;c[r+f>>2]=f;if((r|0)==(c[8025]|0)){c[8022]=f;return}}else{c[d>>2]=a&-2;c[r+4>>2]=f|1;c[r+f>>2]=f}d=f>>>3;if(f>>>0<256){b=32120+(d<<1<<2)|0;a=c[8020]|0;d=1<>2]|0;if(a>>>0<(c[8024]|0)>>>0)ra();else{p=d;q=a}}else{c[8020]=a|d;p=b+8|0;q=b}c[p>>2]=r;c[q+12>>2]=r;c[r+8>>2]=q;c[r+12>>2]=b;return}d=f>>>8;if(d)if(f>>>0>16777215)b=31;else{p=(d+1048320|0)>>>16&8;q=d<>>16&4;q=q<>>16&2;b=14-(o|p|b)+(q<>>15)|0;b=f>>>(b+7|0)&1|b<<1}else b=0;e=32384+(b<<2)|0;c[r+28>>2]=b;c[r+20>>2]=0;c[r+16>>2]=0;d=c[8021]|0;a=1<>2]=r;c[r+24>>2]=e;c[r+12>>2]=r;c[r+8>>2]=r;return}b=f<<((b|0)==31?0:25-(b>>>1)|0);e=c[e>>2]|0;while(1){if((c[e+4>>2]&-8|0)==(f|0)){d=127;break}a=e+16+(b>>>31<<2)|0;d=c[a>>2]|0;if(!d){d=124;break}else{b=b<<1;e=d}}if((d|0)==124){if(a>>>0<(c[8024]|0)>>>0)ra();c[a>>2]=r;c[r+24>>2]=e;c[r+12>>2]=r;c[r+8>>2]=r;return}else if((d|0)==127){d=e+8|0;a=c[d>>2]|0;q=c[8024]|0;if(!(a>>>0>=q>>>0&e>>>0>=q>>>0))ra();c[a+12>>2]=r;c[d>>2]=r;c[r+8>>2]=a;c[r+12>>2]=e;c[r+24>>2]=0;return}}function Bd(){}function Cd(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 (C=d,a-c>>>0|0)|0}function Dd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;c=a+c>>>0;return (C=b+d+(c>>>0>>0|0)>>>0,c|0)|0}function Ed(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){C=b>>c;return a>>>c|(b&(1<>c-32|0}function Fd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=b+e|0;if((e|0)>=20){d=d&255;h=b&3;i=d|d<<8|d<<16|d<<24;g=f&~3;if(h){h=b+4-h|0;while((b|0)<(h|0)){a[b>>0]=d;b=b+1|0}}while((b|0)<(g|0)){c[b>>2]=i;b=b+4|0}}while((b|0)<(f|0)){a[b>>0]=d;b=b+1|0}return b-e|0}function Gd(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){C=b>>>c;return a>>>c|(b&(1<>>c-32|0}function Hd(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){C=b<>>32-c;return a<=4096)return va(b|0,d|0,e|0)|0;f=b|0;if((b&3)==(d&3)){while(b&3){if(!e)return f|0;a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0;e=e-1|0}while((e|0)>=4){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;e=e-4|0}}while((e|0)>0){a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0;e=e-1|0}return f|0}function Jd(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 Id(b,c,d)|0;return b|0}function Kd(b){b=b|0;var c=0;c=a[m+(b&255)>>0]|0;if((c|0)<8)return c|0;c=a[m+(b>>8&255)>>0]|0;if((c|0)<8)return c+8|0;c=a[m+(b>>16&255)>>0]|0;if((c|0)<8)return c+16|0;return (a[m+(b>>>24)>>0]|0)+24|0}function Ld(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;f=a&65535;e=b&65535;c=_(e,f)|0;d=a>>>16;a=(c>>>16)+(_(e,d)|0)|0;e=b>>>16;b=_(e,f)|0;return (C=(a>>>16)+(_(e,d)|0)+(((a&65535)+b|0)>>>16)|0,a+b<<16|c&65535|0)|0}function Md(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,i=0,j=0;j=b>>31|((b|0)<0?-1:0)<<1;i=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;f=d>>31|((d|0)<0?-1:0)<<1;e=((d|0)<0?-1:0)>>31|((d|0)<0?-1:0)<<1;h=Cd(j^a,i^b,j,i)|0;g=C;a=f^j;b=e^i;return Cd((Rd(h,g,Cd(f^c,e^d,f,e)|0,C,0)|0)^a,C^b,a,b)|0}function Nd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+16|0;j=f|0;h=b>>31|((b|0)<0?-1:0)<<1;g=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;l=e>>31|((e|0)<0?-1:0)<<1;k=((e|0)<0?-1:0)>>31|((e|0)<0?-1:0)<<1;a=Cd(h^a,g^b,h,g)|0;b=C;Rd(a,b,Cd(l^d,k^e,l,k)|0,C,j)|0;e=Cd(c[j>>2]^h,c[j+4>>2]^g,h,g)|0;d=C;i=f;return (C=d,e)|0}function Od(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=Ld(e,f)|0;a=C;return (C=(_(b,f)|0)+(_(d,e)|0)+a|a&0,c|0|0)|0}function Pd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Rd(a,b,c,d,0)|0}function Qd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;g=i;i=i+16|0;f=g|0;Rd(a,b,d,e,f)|0;i=g;return (C=c[f+4>>2]|0,c[f>>2]|0)|0}function Rd(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 (C=n,f)|0}else{if(!g){n=0;f=0;return (C=n,f)|0}c[f>>2]=a|0;c[f+4>>2]=b&0;n=0;f=0;return (C=n,f)|0}}g=(i|0)==0;do if(h){if(!g){g=(aa(i|0)|0)-(aa(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 (C=n,f)|0}g=h-1|0;if(g&h){i=(aa(h|0)|0)+33-(aa(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){c[f>>2]=g&l;c[f+4>>2]=0}if((h|0)==1){o=j|b&0;p=a|0|0;return (C=o,p)|0}else{p=Kd(h|0)|0;o=k>>>(p>>>0)|0;p=k<<32-p|l>>>(p>>>0)|0;return (C=o,p)|0}}else{if(g){if(f){c[f>>2]=(k>>>0)%(h>>>0);c[f+4>>2]=0}o=0;p=(k>>>0)/(h>>>0)>>>0;return (C=o,p)|0}if(!l){if(f){c[f>>2]=0;c[f+4>>2]=(k>>>0)%(i>>>0)}o=0;p=(k>>>0)/(i>>>0)>>>0;return (C=o,p)|0}g=i-1|0;if(!(g&i)){if(f){c[f>>2]=a|0;c[f+4>>2]=g&k|b&0}o=0;p=k>>>((Kd(i|0)|0)>>>0);return (C=o,p)|0}g=(aa(i|0)|0)-(aa(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 (C=o,p)|0}while(0);if(!h){k=i;j=0;i=0}else{m=d|0|0;l=n|e&0;k=Dd(m|0,l|0,-1,-1)|0;d=C;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;Cd(k,d,e,n)|0;p=C;o=p>>31|((p|0)<0?-1:0)<<1;i=o&1;a=Cd(e,n,o&m,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&l)|0;b=C;h=h-1|0}while((h|0)!=0);k=j;j=0}h=0;if(f){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 (C=o,p)|0}function Sd(a){a=a|0;return Da[a&31]()|0}function Td(){return ea(0)|0}function Ud(){return ea(1)|0}function Vd(){return ea(2)|0}function Wd(){return ea(3)|0}function Xd(){return ea(4)|0}function Yd(){return ea(5)|0}function Zd(){return ea(6)|0}function _d(){return ea(7)|0}function $d(a,b){a=a|0;b=b|0;return Ea[a&31](b|0)|0}function ae(a){a=a|0;return ga(0,a|0)|0}function be(a){a=a|0;return ga(1,a|0)|0}function ce(a){a=a|0;return ga(2,a|0)|0}function de(a){a=a|0;return ga(3,a|0)|0}function ee(a){a=a|0;return ga(4,a|0)|0}function fe(a){a=a|0;return ga(5,a|0)|0}function ge(a){a=a|0;return ga(6,a|0)|0}function he(a){a=a|0;return ga(7,a|0)|0}function ie(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Fa[a&31](b|0,c|0,d|0)|0}function je(a,b,c){a=a|0;b=b|0;c=c|0;return ia(0,a|0,b|0,c|0)|0}function ke(a,b,c){a=a|0;b=b|0;c=c|0;return ia(1,a|0,b|0,c|0)|0}function le(a,b,c){a=a|0;b=b|0;c=c|0;return ia(2,a|0,b|0,c|0)|0}function me(a,b,c){a=a|0;b=b|0;c=c|0;return ia(3,a|0,b|0,c|0)|0}function ne(a,b,c){a=a|0;b=b|0;c=c|0;return ia(4,a|0,b|0,c|0)|0}function oe(a,b,c){a=a|0;b=b|0;c=c|0;return ia(5,a|0,b|0,c|0)|0}function pe(a,b,c){a=a|0;b=b|0;c=c|0;return ia(6,a|0,b|0,c|0)|0}function qe(a,b,c){a=a|0;b=b|0;c=c|0;return ia(7,a|0,b|0,c|0)|0}function re(a,b){a=a|0;b=b|0;Ga[a&31](b|0)}function se(a){a=a|0;ka(0,a|0)}function te(a){a=a|0;ka(1,a|0)}function ue(a){a=a|0;ka(2,a|0)}function ve(a){a=a|0;ka(3,a|0)}function we(a){a=a|0;ka(4,a|0)}function xe(a){a=a|0;ka(5,a|0)}function ye(a){a=a|0;ka(6,a|0)}function ze(a){a=a|0;ka(7,a|0)}function Ae(){ba(0);return 0}function Be(a){a=a|0;ba(1);return 0}function Ce(a,b,c){a=a|0;b=b|0;c=c|0;ba(2);return 0}function De(a){a=a|0;ba(3)} // EMSCRIPTEN_END_FUNCS var Da=[Ae,Ae,Td,Ae,Ud,Ae,Vd,Ae,Wd,Ae,Xd,Ae,Yd,Ae,Zd,Ae,_d,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae];var Ea=[Be,Be,ae,Be,be,Be,ce,Be,de,Be,ee,Be,fe,Be,ge,Be,he,Be,pd,Be,Be,Be,Be,Be,Be,Be,Be,Be,Be,Be,Be,Be];var Fa=[Ce,Ce,je,Ce,ke,Ce,le,Ce,me,Ce,ne,Ce,oe,Ce,pe,Ce,qe,Ce,sd,qd,rd,Ce,Ce,Ce,Ce,Ce,Ce,Ce,Ce,Ce,Ce,Ce];var Ga=[De,De,se,De,te,De,ue,De,ve,De,we,De,xe,De,ye,De,ze,De,wd,De,De,De,De,De,De,De,De,De,De,De,De,De];return{_sodium_library_version_minor:jd,_crypto_onetimeauth_bytes:Jb,_sodium_version_string:hd,_sodium_hex2bin:gd,_crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive:dc,_bitshift64Lshr:Gd,_crypto_pwhash_scryptsalsa208sha256:ec,_crypto_box_noncebytes:Za,_crypto_box_beforenm:bb,_crypto_scalarmult_base:mc,_crypto_auth_bytes:Qa,_crypto_sign_open:Fc,_memcpy:Id,_crypto_box_seed_keypair:$a,_crypto_pwhash_scryptsalsa208sha256_memlimit_interactive:bc,_crypto_box_open_easy_afternm:ib,_crypto_sign_ed25519_sk_to_curve25519:Uc,_sodium_memzero:ed,_crypto_box_seal:kb,_free:zd,_crypto_shorthash:xc,_crypto_auth_keybytes:Ra,_crypto_pwhash_scryptsalsa208sha256_saltbytes:Zb,_crypto_sign_seedbytes:zc,_crypto_box_detached_afternm:cb,_crypto_auth:Sa,_randombytes_random:_c,_crypto_sign_keypair:Dc,_crypto_shorthash_keybytes:wc,_crypto_generichash_statebytes:vb,_crypto_pwhash_scryptsalsa208sha256_str_verify:gc,_crypto_generichash_init:xb,_crypto_generichash_keybytes_max:tb,_crypto_sign_ed25519_pk_to_curve25519:Tc,_crypto_box_beforenmbytes:Ya,_crypto_generichash:wb,_sodium_library_version_major:id,_randombytes_stir:$c,_randombytes_close:cd,_crypto_onetimeauth_keybytes:Kb,_crypto_onetimeauth:Lb,_crypto_shorthash_bytes:vc,_crypto_box_secretkeybytes:Xa,_crypto_onetimeauth_update:Ob,_crypto_pwhash_scryptsalsa208sha256_ll:Wb,_crypto_box_detached:db,_randombytes_buf:bd,_crypto_pwhash_scryptsalsa208sha256_str:fc,_bitshift64Ashr:Ed,_crypto_box_open_detached:hb,_crypto_scalarmult_bytes:kc,_crypto_auth_verify:Ta,_crypto_box_seal_open:lb,_crypto_secretbox_detached:rc,_crypto_secretbox_easy:sc,_crypto_pwhash_scryptsalsa208sha256_strbytes:_b,_memset:Fd,_crypto_box_open_detached_afternm:gb,_crypto_box_sealbytes:mb,_i64Subtract:Cd,_crypto_pwhash_scryptsalsa208sha256_strprefix:$b,_crypto_box_seedbytes:Va,_crypto_hash:Cb,_crypto_box_easy_afternm:eb,_crypto_box_macbytes:_a,_crypto_box_publickeybytes:Wa,_sodium_bin2hex:fd,_crypto_sign_secretkeybytes:Bc,_crypto_scalarmult_scalarbytes:lc,_crypto_onetimeauth_statebytes:Ib,_crypto_generichash_keybytes_min:sb,_malloc:yd,_memmove:Jd,_crypto_sign:Ec,_crypto_secretbox_noncebytes:pc,_randombytes_set_implementation:Zc,_crypto_box_keypair:ab,_crypto_generichash_keybytes:ub,_crypto_generichash_bytes_min:pb,_sodium_init:dd,_crypto_secretbox_macbytes:qc,_crypto_secretbox_keybytes:oc,_bitshift64Shl:Hd,_crypto_hash_bytes:Bb,_fflush:td,_crypto_generichash_bytes:rb,_crypto_generichash_bytes_max:qb,_crypto_secretbox_open_detached:tc,_crypto_sign_verify_detached:Hc,_crypto_onetimeauth_verify:Mb,_crypto_box_open_easy:jb,_crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive:cc,_crypto_sign_publickeybytes:Ac,_i64Add:Dd,_crypto_sign_bytes:yc,_crypto_generichash_update:yb,_crypto_scalarmult:nc,_crypto_sign_detached:Gc,_crypto_box_easy:fb,___errno_location:od,_crypto_onetimeauth_final:Pb,_crypto_secretbox_open_easy:uc,_crypto_generichash_final:zb,_randombytes_uniform:ad,_crypto_sign_seed_keypair:Cc,_crypto_pwhash_scryptsalsa208sha256_opslimit_interactive:ac,_crypto_onetimeauth_init:Nb,runPostSets:Bd,stackAlloc:Ha,stackSave:Ia,stackRestore:Ja,establishStackSpace:Ka,setThrew:La,setTempRet0:Oa,getTempRet0:Pa,dynCall_i:Sd,dynCall_ii:$d,dynCall_iiii:ie,dynCall_vi:re}}) // EMSCRIPTEN_END_ASM (Module.asmGlobalArg,Module.asmLibraryArg,buffer);var _sodium_library_version_minor=Module["_sodium_library_version_minor"]=asm["_sodium_library_version_minor"];var _crypto_onetimeauth_bytes=Module["_crypto_onetimeauth_bytes"]=asm["_crypto_onetimeauth_bytes"];var _crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive=Module["_crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive"]=asm["_crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive"];var _bitshift64Lshr=Module["_bitshift64Lshr"]=asm["_bitshift64Lshr"];var _crypto_pwhash_scryptsalsa208sha256=Module["_crypto_pwhash_scryptsalsa208sha256"]=asm["_crypto_pwhash_scryptsalsa208sha256"];var _crypto_box_noncebytes=Module["_crypto_box_noncebytes"]=asm["_crypto_box_noncebytes"];var _crypto_box_beforenm=Module["_crypto_box_beforenm"]=asm["_crypto_box_beforenm"];var _crypto_scalarmult_base=Module["_crypto_scalarmult_base"]=asm["_crypto_scalarmult_base"];var _crypto_auth_bytes=Module["_crypto_auth_bytes"]=asm["_crypto_auth_bytes"];var _crypto_sign_open=Module["_crypto_sign_open"]=asm["_crypto_sign_open"];var _memcpy=Module["_memcpy"]=asm["_memcpy"];var _crypto_box_seed_keypair=Module["_crypto_box_seed_keypair"]=asm["_crypto_box_seed_keypair"];var _crypto_pwhash_scryptsalsa208sha256_memlimit_interactive=Module["_crypto_pwhash_scryptsalsa208sha256_memlimit_interactive"]=asm["_crypto_pwhash_scryptsalsa208sha256_memlimit_interactive"];var _crypto_box_open_easy_afternm=Module["_crypto_box_open_easy_afternm"]=asm["_crypto_box_open_easy_afternm"];var _crypto_sign_ed25519_sk_to_curve25519=Module["_crypto_sign_ed25519_sk_to_curve25519"]=asm["_crypto_sign_ed25519_sk_to_curve25519"];var _sodium_memzero=Module["_sodium_memzero"]=asm["_sodium_memzero"];var _crypto_box_seal=Module["_crypto_box_seal"]=asm["_crypto_box_seal"];var _free=Module["_free"]=asm["_free"];var runPostSets=Module["runPostSets"]=asm["runPostSets"];var _crypto_shorthash=Module["_crypto_shorthash"]=asm["_crypto_shorthash"];var _crypto_auth_keybytes=Module["_crypto_auth_keybytes"]=asm["_crypto_auth_keybytes"];var _crypto_pwhash_scryptsalsa208sha256_saltbytes=Module["_crypto_pwhash_scryptsalsa208sha256_saltbytes"]=asm["_crypto_pwhash_scryptsalsa208sha256_saltbytes"];var _crypto_sign_seedbytes=Module["_crypto_sign_seedbytes"]=asm["_crypto_sign_seedbytes"];var _crypto_box_detached_afternm=Module["_crypto_box_detached_afternm"]=asm["_crypto_box_detached_afternm"];var _crypto_auth=Module["_crypto_auth"]=asm["_crypto_auth"];var _randombytes_random=Module["_randombytes_random"]=asm["_randombytes_random"];var _crypto_sign_keypair=Module["_crypto_sign_keypair"]=asm["_crypto_sign_keypair"];var _crypto_generichash_keybytes_min=Module["_crypto_generichash_keybytes_min"]=asm["_crypto_generichash_keybytes_min"];var _crypto_generichash_statebytes=Module["_crypto_generichash_statebytes"]=asm["_crypto_generichash_statebytes"];var _crypto_pwhash_scryptsalsa208sha256_str_verify=Module["_crypto_pwhash_scryptsalsa208sha256_str_verify"]=asm["_crypto_pwhash_scryptsalsa208sha256_str_verify"];var _sodium_version_string=Module["_sodium_version_string"]=asm["_sodium_version_string"];var _crypto_generichash_keybytes_max=Module["_crypto_generichash_keybytes_max"]=asm["_crypto_generichash_keybytes_max"];var _crypto_sign_ed25519_pk_to_curve25519=Module["_crypto_sign_ed25519_pk_to_curve25519"]=asm["_crypto_sign_ed25519_pk_to_curve25519"];var _crypto_sign_publickeybytes=Module["_crypto_sign_publickeybytes"]=asm["_crypto_sign_publickeybytes"];var _crypto_box_beforenmbytes=Module["_crypto_box_beforenmbytes"]=asm["_crypto_box_beforenmbytes"];var _crypto_generichash=Module["_crypto_generichash"]=asm["_crypto_generichash"];var _sodium_library_version_major=Module["_sodium_library_version_major"]=asm["_sodium_library_version_major"];var _randombytes_stir=Module["_randombytes_stir"]=asm["_randombytes_stir"];var _crypto_shorthash_keybytes=Module["_crypto_shorthash_keybytes"]=asm["_crypto_shorthash_keybytes"];var _randombytes_close=Module["_randombytes_close"]=asm["_randombytes_close"];var _crypto_onetimeauth_keybytes=Module["_crypto_onetimeauth_keybytes"]=asm["_crypto_onetimeauth_keybytes"];var _crypto_onetimeauth=Module["_crypto_onetimeauth"]=asm["_crypto_onetimeauth"];var _crypto_shorthash_bytes=Module["_crypto_shorthash_bytes"]=asm["_crypto_shorthash_bytes"];var _crypto_box_secretkeybytes=Module["_crypto_box_secretkeybytes"]=asm["_crypto_box_secretkeybytes"];var _crypto_onetimeauth_update=Module["_crypto_onetimeauth_update"]=asm["_crypto_onetimeauth_update"];var _crypto_pwhash_scryptsalsa208sha256_ll=Module["_crypto_pwhash_scryptsalsa208sha256_ll"]=asm["_crypto_pwhash_scryptsalsa208sha256_ll"];var _crypto_box_detached=Module["_crypto_box_detached"]=asm["_crypto_box_detached"];var _randombytes_buf=Module["_randombytes_buf"]=asm["_randombytes_buf"];var _crypto_pwhash_scryptsalsa208sha256_strbytes=Module["_crypto_pwhash_scryptsalsa208sha256_strbytes"]=asm["_crypto_pwhash_scryptsalsa208sha256_strbytes"];var _bitshift64Ashr=Module["_bitshift64Ashr"]=asm["_bitshift64Ashr"];var _crypto_box_open_detached=Module["_crypto_box_open_detached"]=asm["_crypto_box_open_detached"];var _crypto_scalarmult_bytes=Module["_crypto_scalarmult_bytes"]=asm["_crypto_scalarmult_bytes"];var _crypto_auth_verify=Module["_crypto_auth_verify"]=asm["_crypto_auth_verify"];var _crypto_sign_detached=Module["_crypto_sign_detached"]=asm["_crypto_sign_detached"];var _crypto_secretbox_detached=Module["_crypto_secretbox_detached"]=asm["_crypto_secretbox_detached"];var _crypto_secretbox_easy=Module["_crypto_secretbox_easy"]=asm["_crypto_secretbox_easy"];var _crypto_pwhash_scryptsalsa208sha256_str=Module["_crypto_pwhash_scryptsalsa208sha256_str"]=asm["_crypto_pwhash_scryptsalsa208sha256_str"];var _memset=Module["_memset"]=asm["_memset"];var _crypto_box_open_detached_afternm=Module["_crypto_box_open_detached_afternm"]=asm["_crypto_box_open_detached_afternm"];var _crypto_box_sealbytes=Module["_crypto_box_sealbytes"]=asm["_crypto_box_sealbytes"];var _i64Subtract=Module["_i64Subtract"]=asm["_i64Subtract"];var _crypto_pwhash_scryptsalsa208sha256_strprefix=Module["_crypto_pwhash_scryptsalsa208sha256_strprefix"]=asm["_crypto_pwhash_scryptsalsa208sha256_strprefix"];var _crypto_box_seedbytes=Module["_crypto_box_seedbytes"]=asm["_crypto_box_seedbytes"];var _crypto_hash=Module["_crypto_hash"]=asm["_crypto_hash"];var _crypto_box_easy_afternm=Module["_crypto_box_easy_afternm"]=asm["_crypto_box_easy_afternm"];var _crypto_box_macbytes=Module["_crypto_box_macbytes"]=asm["_crypto_box_macbytes"];var _crypto_box_publickeybytes=Module["_crypto_box_publickeybytes"]=asm["_crypto_box_publickeybytes"];var _sodium_bin2hex=Module["_sodium_bin2hex"]=asm["_sodium_bin2hex"];var _crypto_sign_secretkeybytes=Module["_crypto_sign_secretkeybytes"]=asm["_crypto_sign_secretkeybytes"];var _crypto_scalarmult_scalarbytes=Module["_crypto_scalarmult_scalarbytes"]=asm["_crypto_scalarmult_scalarbytes"];var _crypto_onetimeauth_statebytes=Module["_crypto_onetimeauth_statebytes"]=asm["_crypto_onetimeauth_statebytes"];var _crypto_generichash_bytes_min=Module["_crypto_generichash_bytes_min"]=asm["_crypto_generichash_bytes_min"];var _malloc=Module["_malloc"]=asm["_malloc"];var _crypto_secretbox_open_easy=Module["_crypto_secretbox_open_easy"]=asm["_crypto_secretbox_open_easy"];var _crypto_sign=Module["_crypto_sign"]=asm["_crypto_sign"];var _crypto_secretbox_noncebytes=Module["_crypto_secretbox_noncebytes"]=asm["_crypto_secretbox_noncebytes"];var _randombytes_set_implementation=Module["_randombytes_set_implementation"]=asm["_randombytes_set_implementation"];var _crypto_box_keypair=Module["_crypto_box_keypair"]=asm["_crypto_box_keypair"];var _crypto_generichash_keybytes=Module["_crypto_generichash_keybytes"]=asm["_crypto_generichash_keybytes"];var _sodium_hex2bin=Module["_sodium_hex2bin"]=asm["_sodium_hex2bin"];var _sodium_init=Module["_sodium_init"]=asm["_sodium_init"];var _crypto_secretbox_macbytes=Module["_crypto_secretbox_macbytes"]=asm["_crypto_secretbox_macbytes"];var _crypto_secretbox_keybytes=Module["_crypto_secretbox_keybytes"]=asm["_crypto_secretbox_keybytes"];var _bitshift64Shl=Module["_bitshift64Shl"]=asm["_bitshift64Shl"];var _crypto_hash_bytes=Module["_crypto_hash_bytes"]=asm["_crypto_hash_bytes"];var _fflush=Module["_fflush"]=asm["_fflush"];var _crypto_generichash_bytes=Module["_crypto_generichash_bytes"]=asm["_crypto_generichash_bytes"];var _crypto_generichash_bytes_max=Module["_crypto_generichash_bytes_max"]=asm["_crypto_generichash_bytes_max"];var _crypto_secretbox_open_detached=Module["_crypto_secretbox_open_detached"]=asm["_crypto_secretbox_open_detached"];var _crypto_sign_verify_detached=Module["_crypto_sign_verify_detached"]=asm["_crypto_sign_verify_detached"];var _crypto_onetimeauth_verify=Module["_crypto_onetimeauth_verify"]=asm["_crypto_onetimeauth_verify"];var _crypto_box_open_easy=Module["_crypto_box_open_easy"]=asm["_crypto_box_open_easy"];var _crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive=Module["_crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive"]=asm["_crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive"];var _crypto_generichash_init=Module["_crypto_generichash_init"]=asm["_crypto_generichash_init"];var _i64Add=Module["_i64Add"]=asm["_i64Add"];var _crypto_sign_bytes=Module["_crypto_sign_bytes"]=asm["_crypto_sign_bytes"];var _crypto_generichash_update=Module["_crypto_generichash_update"]=asm["_crypto_generichash_update"];var _crypto_scalarmult=Module["_crypto_scalarmult"]=asm["_crypto_scalarmult"];var _crypto_box_seal_open=Module["_crypto_box_seal_open"]=asm["_crypto_box_seal_open"];var _crypto_box_easy=Module["_crypto_box_easy"]=asm["_crypto_box_easy"];var ___errno_location=Module["___errno_location"]=asm["___errno_location"];var _crypto_onetimeauth_final=Module["_crypto_onetimeauth_final"]=asm["_crypto_onetimeauth_final"];var _memmove=Module["_memmove"]=asm["_memmove"];var _crypto_generichash_final=Module["_crypto_generichash_final"]=asm["_crypto_generichash_final"];var _randombytes_uniform=Module["_randombytes_uniform"]=asm["_randombytes_uniform"];var _crypto_sign_seed_keypair=Module["_crypto_sign_seed_keypair"]=asm["_crypto_sign_seed_keypair"];var _crypto_pwhash_scryptsalsa208sha256_opslimit_interactive=Module["_crypto_pwhash_scryptsalsa208sha256_opslimit_interactive"]=asm["_crypto_pwhash_scryptsalsa208sha256_opslimit_interactive"];var _crypto_onetimeauth_init=Module["_crypto_onetimeauth_init"]=asm["_crypto_onetimeauth_init"];var dynCall_i=Module["dynCall_i"]=asm["dynCall_i"];var dynCall_ii=Module["dynCall_ii"]=asm["dynCall_ii"];var dynCall_iiii=Module["dynCall_iiii"]=asm["dynCall_iiii"];var dynCall_vi=Module["dynCall_vi"]=asm["dynCall_vi"];Runtime.stackAlloc=asm["stackAlloc"];Runtime.stackSave=asm["stackSave"];Runtime.stackRestore=asm["stackRestore"];Runtime.establishStackSpace=asm["establishStackSpace"];Runtime.setTempRet0=asm["setTempRet0"];Runtime.getTempRet0=asm["getTempRet0"];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;var preloadStartTime=null;var calledMain=false;dependenciesFulfilled=function runCaller(){if(!Module["calledRun"])run();if(!Module["calledRun"])dependenciesFulfilled=runCaller};Module["callMain"]=Module.callMain=function callMain(args){assert(runDependencies==0,"cannot call main when async dependencies remain! (listen on __ATMAIN__)");assert(__ATPRERUN__.length==0,"cannot call main when preRun functions remain to be called");args=args||[];ensureInitRuntime();var argc=args.length+1;function pad(){for(var i=0;i<4-1;i++){argv.push(0)}}var argv=[allocate(intArrayFromString(Module["thisProgram"]),"i8",ALLOC_NORMAL)];pad();for(var i=0;i0){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"]();if(Module["_main"]&&shouldRunNow)Module["callMain"](args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout((function(){setTimeout((function(){Module["setStatus"]("")}),1);doRun()}),1)}else{doRun()}}Module["run"]=Module.run=run;function exit(status,implicit){if(implicit&&Module["noExitRuntime"]){return}if(Module["noExitRuntime"]){}else{ABORT=true;EXITSTATUS=status;STACKTOP=initialStackTop;exitRuntime();if(Module["onExit"])Module["onExit"](status)}if(ENVIRONMENT_IS_NODE){process["stdout"]["once"]("drain",(function(){process["exit"](status)}));console.log(" ");setTimeout((function(){process["exit"](status)}),500)}else if(ENVIRONMENT_IS_SHELL&&typeof quit==="function"){quit(status)}throw new ExitStatus(status)}Module["exit"]=Module.exit=exit;var abortDecorators=[];function abort(what){if(what!==undefined){Module.print(what);Module.printErr(what);what=JSON.stringify(what)}else{what=""}ABORT=true;EXITSTATUS=1;var extra="\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";var output="abort("+what+") at "+stackTrace()+extra;if(abortDecorators){abortDecorators.forEach((function(decorator){output=decorator(output,what)}))}throw output}Module["abort"]=Module.abort=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"]){shouldRunNow=false}run() return Module; }); }).call(this,require('_process'),require("buffer").Buffer,"/../sodium-browserify/node_modules/libsodium/dist/modules") },{"_process":108,"buffer":47,"crypto":56,"fs":1,"path":105}],371:[function(require,module,exports){ arguments[4][131][0].apply(exports,arguments) },{"buffer":47,"dup":131}],372:[function(require,module,exports){ arguments[4][136][0].apply(exports,arguments) },{"./hash":371,"buffer":47,"dup":136,"inherits":368}]},{},[157]);