7731 lines
999 KiB
JavaScript
7731 lines
999 KiB
JavaScript
/*
|
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
if you want to view the source, please visit the github repository of this plugin
|
|
https://github.com/joethei/obsidian-plantuml
|
|
*/
|
|
|
|
var __create = Object.create;
|
|
var __defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __getProtoOf = Object.getPrototypeOf;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
var __commonJS = (cb, mod) => function __require() {
|
|
return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
};
|
|
var __export = (target, all) => {
|
|
__markAsModule(target);
|
|
for (var name in all)
|
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __reExport = (target, module2, desc) => {
|
|
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
for (let key of __getOwnPropNames(module2))
|
|
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
}
|
|
return target;
|
|
};
|
|
var __toModule = (module2) => {
|
|
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
};
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
// node_modules/plantuml-encoder/dist/plantuml-encoder.js
|
|
var require_plantuml_encoder = __commonJS({
|
|
"node_modules/plantuml-encoder/dist/plantuml-encoder.js"(exports, module2) {
|
|
(function(f) {
|
|
if (typeof exports === "object" && typeof module2 !== "undefined") {
|
|
module2.exports = f();
|
|
} else if (typeof define === "function" && define.amd) {
|
|
define([], f);
|
|
} else {
|
|
var g;
|
|
if (typeof window !== "undefined") {
|
|
g = window;
|
|
} else if (typeof global !== "undefined") {
|
|
g = global;
|
|
} else if (typeof self !== "undefined") {
|
|
g = self;
|
|
} else {
|
|
g = this;
|
|
}
|
|
g.plantumlEncoder = f();
|
|
}
|
|
})(function() {
|
|
var define2, module3, exports2;
|
|
return function() {
|
|
function r(e, n, t) {
|
|
function o(i2, f) {
|
|
if (!n[i2]) {
|
|
if (!e[i2]) {
|
|
var c = typeof require == "function" && require;
|
|
if (!f && c)
|
|
return c(i2, true);
|
|
if (u)
|
|
return u(i2, true);
|
|
var a = new Error("Cannot find module '" + i2 + "'");
|
|
throw a.code = "MODULE_NOT_FOUND", a;
|
|
}
|
|
var p = n[i2] = { exports: {} };
|
|
e[i2][0].call(p.exports, function(r2) {
|
|
var n2 = e[i2][1][r2];
|
|
return o(n2 || r2);
|
|
}, p, p.exports, r, e, n, t);
|
|
}
|
|
return n[i2].exports;
|
|
}
|
|
for (var u = typeof require == "function" && require, i = 0; i < t.length; i++)
|
|
o(t[i]);
|
|
return o;
|
|
}
|
|
return r;
|
|
}()({ 1: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
var pako = require2("pako/lib/deflate.js");
|
|
module4.exports = function(data) {
|
|
return pako.deflateRaw(data, { level: 9, to: "string" });
|
|
};
|
|
}, { "pako/lib/deflate.js": 4 }], 2: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
function encode6bit(b) {
|
|
if (b < 10) {
|
|
return String.fromCharCode(48 + b);
|
|
}
|
|
b -= 10;
|
|
if (b < 26) {
|
|
return String.fromCharCode(65 + b);
|
|
}
|
|
b -= 26;
|
|
if (b < 26) {
|
|
return String.fromCharCode(97 + b);
|
|
}
|
|
b -= 26;
|
|
if (b === 0) {
|
|
return "-";
|
|
}
|
|
if (b === 1) {
|
|
return "_";
|
|
}
|
|
return "?";
|
|
}
|
|
function append3bytes(b1, b2, b3) {
|
|
var c1 = b1 >> 2;
|
|
var c2 = (b1 & 3) << 4 | b2 >> 4;
|
|
var c3 = (b2 & 15) << 2 | b3 >> 6;
|
|
var c4 = b3 & 63;
|
|
var r = "";
|
|
r += encode6bit(c1 & 63);
|
|
r += encode6bit(c2 & 63);
|
|
r += encode6bit(c3 & 63);
|
|
r += encode6bit(c4 & 63);
|
|
return r;
|
|
}
|
|
module4.exports = function(data) {
|
|
var r = "";
|
|
for (var i = 0; i < data.length; i += 3) {
|
|
if (i + 2 === data.length) {
|
|
r += append3bytes(data.charCodeAt(i), data.charCodeAt(i + 1), 0);
|
|
} else if (i + 1 === data.length) {
|
|
r += append3bytes(data.charCodeAt(i), 0, 0);
|
|
} else {
|
|
r += append3bytes(data.charCodeAt(i), data.charCodeAt(i + 1), data.charCodeAt(i + 2));
|
|
}
|
|
}
|
|
return r;
|
|
};
|
|
}, {}], 3: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
var deflate = require2("./deflate");
|
|
var encode64 = require2("./encode64");
|
|
module4.exports.encode = function(puml) {
|
|
var deflated = deflate(puml);
|
|
return encode64(deflated);
|
|
};
|
|
}, { "./deflate": 1, "./encode64": 2 }], 4: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
var zlib_deflate = require2("./zlib/deflate");
|
|
var utils = require2("./utils/common");
|
|
var strings = require2("./utils/strings");
|
|
var msg = require2("./zlib/messages");
|
|
var ZStream = require2("./zlib/zstream");
|
|
var toString = Object.prototype.toString;
|
|
var Z_NO_FLUSH = 0;
|
|
var Z_FINISH = 4;
|
|
var Z_OK = 0;
|
|
var Z_STREAM_END = 1;
|
|
var Z_SYNC_FLUSH = 2;
|
|
var Z_DEFAULT_COMPRESSION = -1;
|
|
var Z_DEFAULT_STRATEGY = 0;
|
|
var Z_DEFLATED = 8;
|
|
function Deflate(options) {
|
|
if (!(this instanceof Deflate))
|
|
return new Deflate(options);
|
|
this.options = utils.assign({
|
|
level: Z_DEFAULT_COMPRESSION,
|
|
method: Z_DEFLATED,
|
|
chunkSize: 16384,
|
|
windowBits: 15,
|
|
memLevel: 8,
|
|
strategy: Z_DEFAULT_STRATEGY,
|
|
to: ""
|
|
}, options || {});
|
|
var opt = this.options;
|
|
if (opt.raw && opt.windowBits > 0) {
|
|
opt.windowBits = -opt.windowBits;
|
|
} else if (opt.gzip && opt.windowBits > 0 && opt.windowBits < 16) {
|
|
opt.windowBits += 16;
|
|
}
|
|
this.err = 0;
|
|
this.msg = "";
|
|
this.ended = false;
|
|
this.chunks = [];
|
|
this.strm = new ZStream();
|
|
this.strm.avail_out = 0;
|
|
var status = zlib_deflate.deflateInit2(this.strm, opt.level, opt.method, opt.windowBits, opt.memLevel, opt.strategy);
|
|
if (status !== Z_OK) {
|
|
throw new Error(msg[status]);
|
|
}
|
|
if (opt.header) {
|
|
zlib_deflate.deflateSetHeader(this.strm, opt.header);
|
|
}
|
|
if (opt.dictionary) {
|
|
var dict;
|
|
if (typeof opt.dictionary === "string") {
|
|
dict = strings.string2buf(opt.dictionary);
|
|
} else if (toString.call(opt.dictionary) === "[object ArrayBuffer]") {
|
|
dict = new Uint8Array(opt.dictionary);
|
|
} else {
|
|
dict = opt.dictionary;
|
|
}
|
|
status = zlib_deflate.deflateSetDictionary(this.strm, dict);
|
|
if (status !== Z_OK) {
|
|
throw new Error(msg[status]);
|
|
}
|
|
this._dict_set = true;
|
|
}
|
|
}
|
|
Deflate.prototype.push = function(data, mode) {
|
|
var strm = this.strm;
|
|
var chunkSize = this.options.chunkSize;
|
|
var status, _mode;
|
|
if (this.ended) {
|
|
return false;
|
|
}
|
|
_mode = mode === ~~mode ? mode : mode === true ? Z_FINISH : Z_NO_FLUSH;
|
|
if (typeof data === "string") {
|
|
strm.input = strings.string2buf(data);
|
|
} else if (toString.call(data) === "[object ArrayBuffer]") {
|
|
strm.input = new Uint8Array(data);
|
|
} else {
|
|
strm.input = data;
|
|
}
|
|
strm.next_in = 0;
|
|
strm.avail_in = strm.input.length;
|
|
do {
|
|
if (strm.avail_out === 0) {
|
|
strm.output = new utils.Buf8(chunkSize);
|
|
strm.next_out = 0;
|
|
strm.avail_out = chunkSize;
|
|
}
|
|
status = zlib_deflate.deflate(strm, _mode);
|
|
if (status !== Z_STREAM_END && status !== Z_OK) {
|
|
this.onEnd(status);
|
|
this.ended = true;
|
|
return false;
|
|
}
|
|
if (strm.avail_out === 0 || strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH)) {
|
|
if (this.options.to === "string") {
|
|
this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));
|
|
} else {
|
|
this.onData(utils.shrinkBuf(strm.output, strm.next_out));
|
|
}
|
|
}
|
|
} while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);
|
|
if (_mode === Z_FINISH) {
|
|
status = zlib_deflate.deflateEnd(this.strm);
|
|
this.onEnd(status);
|
|
this.ended = true;
|
|
return status === Z_OK;
|
|
}
|
|
if (_mode === Z_SYNC_FLUSH) {
|
|
this.onEnd(Z_OK);
|
|
strm.avail_out = 0;
|
|
return true;
|
|
}
|
|
return true;
|
|
};
|
|
Deflate.prototype.onData = function(chunk) {
|
|
this.chunks.push(chunk);
|
|
};
|
|
Deflate.prototype.onEnd = function(status) {
|
|
if (status === Z_OK) {
|
|
if (this.options.to === "string") {
|
|
this.result = this.chunks.join("");
|
|
} else {
|
|
this.result = utils.flattenChunks(this.chunks);
|
|
}
|
|
}
|
|
this.chunks = [];
|
|
this.err = status;
|
|
this.msg = this.strm.msg;
|
|
};
|
|
function deflate(input, options) {
|
|
var deflator = new Deflate(options);
|
|
deflator.push(input, true);
|
|
if (deflator.err) {
|
|
throw deflator.msg || msg[deflator.err];
|
|
}
|
|
return deflator.result;
|
|
}
|
|
function deflateRaw(input, options) {
|
|
options = options || {};
|
|
options.raw = true;
|
|
return deflate(input, options);
|
|
}
|
|
function gzip(input, options) {
|
|
options = options || {};
|
|
options.gzip = true;
|
|
return deflate(input, options);
|
|
}
|
|
exports3.Deflate = Deflate;
|
|
exports3.deflate = deflate;
|
|
exports3.deflateRaw = deflateRaw;
|
|
exports3.gzip = gzip;
|
|
}, { "./utils/common": 5, "./utils/strings": 6, "./zlib/deflate": 9, "./zlib/messages": 10, "./zlib/zstream": 12 }], 5: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
var TYPED_OK = typeof Uint8Array !== "undefined" && typeof Uint16Array !== "undefined" && typeof Int32Array !== "undefined";
|
|
function _has(obj, key) {
|
|
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
}
|
|
exports3.assign = function(obj) {
|
|
var sources = Array.prototype.slice.call(arguments, 1);
|
|
while (sources.length) {
|
|
var source = sources.shift();
|
|
if (!source) {
|
|
continue;
|
|
}
|
|
if (typeof source !== "object") {
|
|
throw new TypeError(source + "must be non-object");
|
|
}
|
|
for (var p in source) {
|
|
if (_has(source, p)) {
|
|
obj[p] = source[p];
|
|
}
|
|
}
|
|
}
|
|
return obj;
|
|
};
|
|
exports3.shrinkBuf = function(buf, size) {
|
|
if (buf.length === size) {
|
|
return buf;
|
|
}
|
|
if (buf.subarray) {
|
|
return buf.subarray(0, size);
|
|
}
|
|
buf.length = size;
|
|
return buf;
|
|
};
|
|
var fnTyped = {
|
|
arraySet: function(dest, src, src_offs, len, dest_offs) {
|
|
if (src.subarray && dest.subarray) {
|
|
dest.set(src.subarray(src_offs, src_offs + len), dest_offs);
|
|
return;
|
|
}
|
|
for (var i = 0; i < len; i++) {
|
|
dest[dest_offs + i] = src[src_offs + i];
|
|
}
|
|
},
|
|
flattenChunks: function(chunks) {
|
|
var i, l, len, pos, chunk, result;
|
|
len = 0;
|
|
for (i = 0, l = chunks.length; i < l; i++) {
|
|
len += chunks[i].length;
|
|
}
|
|
result = new Uint8Array(len);
|
|
pos = 0;
|
|
for (i = 0, l = chunks.length; i < l; i++) {
|
|
chunk = chunks[i];
|
|
result.set(chunk, pos);
|
|
pos += chunk.length;
|
|
}
|
|
return result;
|
|
}
|
|
};
|
|
var fnUntyped = {
|
|
arraySet: function(dest, src, src_offs, len, dest_offs) {
|
|
for (var i = 0; i < len; i++) {
|
|
dest[dest_offs + i] = src[src_offs + i];
|
|
}
|
|
},
|
|
flattenChunks: function(chunks) {
|
|
return [].concat.apply([], chunks);
|
|
}
|
|
};
|
|
exports3.setTyped = function(on) {
|
|
if (on) {
|
|
exports3.Buf8 = Uint8Array;
|
|
exports3.Buf16 = Uint16Array;
|
|
exports3.Buf32 = Int32Array;
|
|
exports3.assign(exports3, fnTyped);
|
|
} else {
|
|
exports3.Buf8 = Array;
|
|
exports3.Buf16 = Array;
|
|
exports3.Buf32 = Array;
|
|
exports3.assign(exports3, fnUntyped);
|
|
}
|
|
};
|
|
exports3.setTyped(TYPED_OK);
|
|
}, {}], 6: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
var utils = require2("./common");
|
|
var STR_APPLY_OK = true;
|
|
var STR_APPLY_UIA_OK = true;
|
|
try {
|
|
String.fromCharCode.apply(null, [0]);
|
|
} catch (__) {
|
|
STR_APPLY_OK = false;
|
|
}
|
|
try {
|
|
String.fromCharCode.apply(null, new Uint8Array(1));
|
|
} catch (__) {
|
|
STR_APPLY_UIA_OK = false;
|
|
}
|
|
var _utf8len = new utils.Buf8(256);
|
|
for (var q = 0; q < 256; q++) {
|
|
_utf8len[q] = q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1;
|
|
}
|
|
_utf8len[254] = _utf8len[254] = 1;
|
|
exports3.string2buf = function(str) {
|
|
var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;
|
|
for (m_pos = 0; m_pos < str_len; m_pos++) {
|
|
c = str.charCodeAt(m_pos);
|
|
if ((c & 64512) === 55296 && m_pos + 1 < str_len) {
|
|
c2 = str.charCodeAt(m_pos + 1);
|
|
if ((c2 & 64512) === 56320) {
|
|
c = 65536 + (c - 55296 << 10) + (c2 - 56320);
|
|
m_pos++;
|
|
}
|
|
}
|
|
buf_len += c < 128 ? 1 : c < 2048 ? 2 : c < 65536 ? 3 : 4;
|
|
}
|
|
buf = new utils.Buf8(buf_len);
|
|
for (i = 0, m_pos = 0; i < buf_len; m_pos++) {
|
|
c = str.charCodeAt(m_pos);
|
|
if ((c & 64512) === 55296 && m_pos + 1 < str_len) {
|
|
c2 = str.charCodeAt(m_pos + 1);
|
|
if ((c2 & 64512) === 56320) {
|
|
c = 65536 + (c - 55296 << 10) + (c2 - 56320);
|
|
m_pos++;
|
|
}
|
|
}
|
|
if (c < 128) {
|
|
buf[i++] = c;
|
|
} else if (c < 2048) {
|
|
buf[i++] = 192 | c >>> 6;
|
|
buf[i++] = 128 | c & 63;
|
|
} else if (c < 65536) {
|
|
buf[i++] = 224 | c >>> 12;
|
|
buf[i++] = 128 | c >>> 6 & 63;
|
|
buf[i++] = 128 | c & 63;
|
|
} else {
|
|
buf[i++] = 240 | c >>> 18;
|
|
buf[i++] = 128 | c >>> 12 & 63;
|
|
buf[i++] = 128 | c >>> 6 & 63;
|
|
buf[i++] = 128 | c & 63;
|
|
}
|
|
}
|
|
return buf;
|
|
};
|
|
function buf2binstring(buf, len) {
|
|
if (len < 65534) {
|
|
if (buf.subarray && STR_APPLY_UIA_OK || !buf.subarray && STR_APPLY_OK) {
|
|
return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));
|
|
}
|
|
}
|
|
var result = "";
|
|
for (var i = 0; i < len; i++) {
|
|
result += String.fromCharCode(buf[i]);
|
|
}
|
|
return result;
|
|
}
|
|
exports3.buf2binstring = function(buf) {
|
|
return buf2binstring(buf, buf.length);
|
|
};
|
|
exports3.binstring2buf = function(str) {
|
|
var buf = new utils.Buf8(str.length);
|
|
for (var i = 0, len = buf.length; i < len; i++) {
|
|
buf[i] = str.charCodeAt(i);
|
|
}
|
|
return buf;
|
|
};
|
|
exports3.buf2string = function(buf, max) {
|
|
var i, out, c, c_len;
|
|
var len = max || buf.length;
|
|
var utf16buf = new Array(len * 2);
|
|
for (out = 0, i = 0; i < len; ) {
|
|
c = buf[i++];
|
|
if (c < 128) {
|
|
utf16buf[out++] = c;
|
|
continue;
|
|
}
|
|
c_len = _utf8len[c];
|
|
if (c_len > 4) {
|
|
utf16buf[out++] = 65533;
|
|
i += c_len - 1;
|
|
continue;
|
|
}
|
|
c &= c_len === 2 ? 31 : c_len === 3 ? 15 : 7;
|
|
while (c_len > 1 && i < len) {
|
|
c = c << 6 | buf[i++] & 63;
|
|
c_len--;
|
|
}
|
|
if (c_len > 1) {
|
|
utf16buf[out++] = 65533;
|
|
continue;
|
|
}
|
|
if (c < 65536) {
|
|
utf16buf[out++] = c;
|
|
} else {
|
|
c -= 65536;
|
|
utf16buf[out++] = 55296 | c >> 10 & 1023;
|
|
utf16buf[out++] = 56320 | c & 1023;
|
|
}
|
|
}
|
|
return buf2binstring(utf16buf, out);
|
|
};
|
|
exports3.utf8border = function(buf, max) {
|
|
var pos;
|
|
max = max || buf.length;
|
|
if (max > buf.length) {
|
|
max = buf.length;
|
|
}
|
|
pos = max - 1;
|
|
while (pos >= 0 && (buf[pos] & 192) === 128) {
|
|
pos--;
|
|
}
|
|
if (pos < 0) {
|
|
return max;
|
|
}
|
|
if (pos === 0) {
|
|
return max;
|
|
}
|
|
return pos + _utf8len[buf[pos]] > max ? pos : max;
|
|
};
|
|
}, { "./common": 5 }], 7: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
function adler32(adler, buf, len, pos) {
|
|
var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0;
|
|
while (len !== 0) {
|
|
n = len > 2e3 ? 2e3 : len;
|
|
len -= n;
|
|
do {
|
|
s1 = s1 + buf[pos++] | 0;
|
|
s2 = s2 + s1 | 0;
|
|
} while (--n);
|
|
s1 %= 65521;
|
|
s2 %= 65521;
|
|
}
|
|
return s1 | s2 << 16 | 0;
|
|
}
|
|
module4.exports = adler32;
|
|
}, {}], 8: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
function makeTable() {
|
|
var c, table = [];
|
|
for (var n = 0; n < 256; n++) {
|
|
c = n;
|
|
for (var k = 0; k < 8; k++) {
|
|
c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
}
|
|
table[n] = c;
|
|
}
|
|
return table;
|
|
}
|
|
var crcTable = makeTable();
|
|
function crc32(crc, buf, len, pos) {
|
|
var t = crcTable, end = pos + len;
|
|
crc ^= -1;
|
|
for (var i = pos; i < end; i++) {
|
|
crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];
|
|
}
|
|
return crc ^ -1;
|
|
}
|
|
module4.exports = crc32;
|
|
}, {}], 9: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
var utils = require2("../utils/common");
|
|
var trees = require2("./trees");
|
|
var adler32 = require2("./adler32");
|
|
var crc32 = require2("./crc32");
|
|
var msg = require2("./messages");
|
|
var Z_NO_FLUSH = 0;
|
|
var Z_PARTIAL_FLUSH = 1;
|
|
var Z_FULL_FLUSH = 3;
|
|
var Z_FINISH = 4;
|
|
var Z_BLOCK = 5;
|
|
var Z_OK = 0;
|
|
var Z_STREAM_END = 1;
|
|
var Z_STREAM_ERROR = -2;
|
|
var Z_DATA_ERROR = -3;
|
|
var Z_BUF_ERROR = -5;
|
|
var Z_DEFAULT_COMPRESSION = -1;
|
|
var Z_FILTERED = 1;
|
|
var Z_HUFFMAN_ONLY = 2;
|
|
var Z_RLE = 3;
|
|
var Z_FIXED = 4;
|
|
var Z_DEFAULT_STRATEGY = 0;
|
|
var Z_UNKNOWN = 2;
|
|
var Z_DEFLATED = 8;
|
|
var MAX_MEM_LEVEL = 9;
|
|
var MAX_WBITS = 15;
|
|
var DEF_MEM_LEVEL = 8;
|
|
var LENGTH_CODES = 29;
|
|
var LITERALS = 256;
|
|
var L_CODES = LITERALS + 1 + LENGTH_CODES;
|
|
var D_CODES = 30;
|
|
var BL_CODES = 19;
|
|
var HEAP_SIZE = 2 * L_CODES + 1;
|
|
var MAX_BITS = 15;
|
|
var MIN_MATCH = 3;
|
|
var MAX_MATCH = 258;
|
|
var MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1;
|
|
var PRESET_DICT = 32;
|
|
var INIT_STATE = 42;
|
|
var EXTRA_STATE = 69;
|
|
var NAME_STATE = 73;
|
|
var COMMENT_STATE = 91;
|
|
var HCRC_STATE = 103;
|
|
var BUSY_STATE = 113;
|
|
var FINISH_STATE = 666;
|
|
var BS_NEED_MORE = 1;
|
|
var BS_BLOCK_DONE = 2;
|
|
var BS_FINISH_STARTED = 3;
|
|
var BS_FINISH_DONE = 4;
|
|
var OS_CODE = 3;
|
|
function err(strm, errorCode) {
|
|
strm.msg = msg[errorCode];
|
|
return errorCode;
|
|
}
|
|
function rank(f) {
|
|
return (f << 1) - (f > 4 ? 9 : 0);
|
|
}
|
|
function zero(buf) {
|
|
var len = buf.length;
|
|
while (--len >= 0) {
|
|
buf[len] = 0;
|
|
}
|
|
}
|
|
function flush_pending(strm) {
|
|
var s = strm.state;
|
|
var len = s.pending;
|
|
if (len > strm.avail_out) {
|
|
len = strm.avail_out;
|
|
}
|
|
if (len === 0) {
|
|
return;
|
|
}
|
|
utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);
|
|
strm.next_out += len;
|
|
s.pending_out += len;
|
|
strm.total_out += len;
|
|
strm.avail_out -= len;
|
|
s.pending -= len;
|
|
if (s.pending === 0) {
|
|
s.pending_out = 0;
|
|
}
|
|
}
|
|
function flush_block_only(s, last) {
|
|
trees._tr_flush_block(s, s.block_start >= 0 ? s.block_start : -1, s.strstart - s.block_start, last);
|
|
s.block_start = s.strstart;
|
|
flush_pending(s.strm);
|
|
}
|
|
function put_byte(s, b) {
|
|
s.pending_buf[s.pending++] = b;
|
|
}
|
|
function putShortMSB(s, b) {
|
|
s.pending_buf[s.pending++] = b >>> 8 & 255;
|
|
s.pending_buf[s.pending++] = b & 255;
|
|
}
|
|
function read_buf(strm, buf, start, size) {
|
|
var len = strm.avail_in;
|
|
if (len > size) {
|
|
len = size;
|
|
}
|
|
if (len === 0) {
|
|
return 0;
|
|
}
|
|
strm.avail_in -= len;
|
|
utils.arraySet(buf, strm.input, strm.next_in, len, start);
|
|
if (strm.state.wrap === 1) {
|
|
strm.adler = adler32(strm.adler, buf, len, start);
|
|
} else if (strm.state.wrap === 2) {
|
|
strm.adler = crc32(strm.adler, buf, len, start);
|
|
}
|
|
strm.next_in += len;
|
|
strm.total_in += len;
|
|
return len;
|
|
}
|
|
function longest_match(s, cur_match) {
|
|
var chain_length = s.max_chain_length;
|
|
var scan = s.strstart;
|
|
var match;
|
|
var len;
|
|
var best_len = s.prev_length;
|
|
var nice_match = s.nice_match;
|
|
var limit = s.strstart > s.w_size - MIN_LOOKAHEAD ? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0;
|
|
var _win = s.window;
|
|
var wmask = s.w_mask;
|
|
var prev = s.prev;
|
|
var strend = s.strstart + MAX_MATCH;
|
|
var scan_end1 = _win[scan + best_len - 1];
|
|
var scan_end = _win[scan + best_len];
|
|
if (s.prev_length >= s.good_match) {
|
|
chain_length >>= 2;
|
|
}
|
|
if (nice_match > s.lookahead) {
|
|
nice_match = s.lookahead;
|
|
}
|
|
do {
|
|
match = cur_match;
|
|
if (_win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1]) {
|
|
continue;
|
|
}
|
|
scan += 2;
|
|
match++;
|
|
do {
|
|
} while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend);
|
|
len = MAX_MATCH - (strend - scan);
|
|
scan = strend - MAX_MATCH;
|
|
if (len > best_len) {
|
|
s.match_start = cur_match;
|
|
best_len = len;
|
|
if (len >= nice_match) {
|
|
break;
|
|
}
|
|
scan_end1 = _win[scan + best_len - 1];
|
|
scan_end = _win[scan + best_len];
|
|
}
|
|
} while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);
|
|
if (best_len <= s.lookahead) {
|
|
return best_len;
|
|
}
|
|
return s.lookahead;
|
|
}
|
|
function fill_window(s) {
|
|
var _w_size = s.w_size;
|
|
var p, n, m, more, str;
|
|
do {
|
|
more = s.window_size - s.lookahead - s.strstart;
|
|
if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {
|
|
utils.arraySet(s.window, s.window, _w_size, _w_size, 0);
|
|
s.match_start -= _w_size;
|
|
s.strstart -= _w_size;
|
|
s.block_start -= _w_size;
|
|
n = s.hash_size;
|
|
p = n;
|
|
do {
|
|
m = s.head[--p];
|
|
s.head[p] = m >= _w_size ? m - _w_size : 0;
|
|
} while (--n);
|
|
n = _w_size;
|
|
p = n;
|
|
do {
|
|
m = s.prev[--p];
|
|
s.prev[p] = m >= _w_size ? m - _w_size : 0;
|
|
} while (--n);
|
|
more += _w_size;
|
|
}
|
|
if (s.strm.avail_in === 0) {
|
|
break;
|
|
}
|
|
n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
|
|
s.lookahead += n;
|
|
if (s.lookahead + s.insert >= MIN_MATCH) {
|
|
str = s.strstart - s.insert;
|
|
s.ins_h = s.window[str];
|
|
s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask;
|
|
while (s.insert) {
|
|
s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;
|
|
s.prev[str & s.w_mask] = s.head[s.ins_h];
|
|
s.head[s.ins_h] = str;
|
|
str++;
|
|
s.insert--;
|
|
if (s.lookahead + s.insert < MIN_MATCH) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
} while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);
|
|
}
|
|
function deflate_stored(s, flush) {
|
|
var max_block_size = 65535;
|
|
if (max_block_size > s.pending_buf_size - 5) {
|
|
max_block_size = s.pending_buf_size - 5;
|
|
}
|
|
for (; ; ) {
|
|
if (s.lookahead <= 1) {
|
|
fill_window(s);
|
|
if (s.lookahead === 0 && flush === Z_NO_FLUSH) {
|
|
return BS_NEED_MORE;
|
|
}
|
|
if (s.lookahead === 0) {
|
|
break;
|
|
}
|
|
}
|
|
s.strstart += s.lookahead;
|
|
s.lookahead = 0;
|
|
var max_start = s.block_start + max_block_size;
|
|
if (s.strstart === 0 || s.strstart >= max_start) {
|
|
s.lookahead = s.strstart - max_start;
|
|
s.strstart = max_start;
|
|
flush_block_only(s, false);
|
|
if (s.strm.avail_out === 0) {
|
|
return BS_NEED_MORE;
|
|
}
|
|
}
|
|
if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {
|
|
flush_block_only(s, false);
|
|
if (s.strm.avail_out === 0) {
|
|
return BS_NEED_MORE;
|
|
}
|
|
}
|
|
}
|
|
s.insert = 0;
|
|
if (flush === Z_FINISH) {
|
|
flush_block_only(s, true);
|
|
if (s.strm.avail_out === 0) {
|
|
return BS_FINISH_STARTED;
|
|
}
|
|
return BS_FINISH_DONE;
|
|
}
|
|
if (s.strstart > s.block_start) {
|
|
flush_block_only(s, false);
|
|
if (s.strm.avail_out === 0) {
|
|
return BS_NEED_MORE;
|
|
}
|
|
}
|
|
return BS_NEED_MORE;
|
|
}
|
|
function deflate_fast(s, flush) {
|
|
var hash_head;
|
|
var bflush;
|
|
for (; ; ) {
|
|
if (s.lookahead < MIN_LOOKAHEAD) {
|
|
fill_window(s);
|
|
if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
|
|
return BS_NEED_MORE;
|
|
}
|
|
if (s.lookahead === 0) {
|
|
break;
|
|
}
|
|
}
|
|
hash_head = 0;
|
|
if (s.lookahead >= MIN_MATCH) {
|
|
s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
|
|
hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
|
|
s.head[s.ins_h] = s.strstart;
|
|
}
|
|
if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {
|
|
s.match_length = longest_match(s, hash_head);
|
|
}
|
|
if (s.match_length >= MIN_MATCH) {
|
|
bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);
|
|
s.lookahead -= s.match_length;
|
|
if (s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) {
|
|
s.match_length--;
|
|
do {
|
|
s.strstart++;
|
|
s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
|
|
hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
|
|
s.head[s.ins_h] = s.strstart;
|
|
} while (--s.match_length !== 0);
|
|
s.strstart++;
|
|
} else {
|
|
s.strstart += s.match_length;
|
|
s.match_length = 0;
|
|
s.ins_h = s.window[s.strstart];
|
|
s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;
|
|
}
|
|
} else {
|
|
bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
|
|
s.lookahead--;
|
|
s.strstart++;
|
|
}
|
|
if (bflush) {
|
|
flush_block_only(s, false);
|
|
if (s.strm.avail_out === 0) {
|
|
return BS_NEED_MORE;
|
|
}
|
|
}
|
|
}
|
|
s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
|
|
if (flush === Z_FINISH) {
|
|
flush_block_only(s, true);
|
|
if (s.strm.avail_out === 0) {
|
|
return BS_FINISH_STARTED;
|
|
}
|
|
return BS_FINISH_DONE;
|
|
}
|
|
if (s.last_lit) {
|
|
flush_block_only(s, false);
|
|
if (s.strm.avail_out === 0) {
|
|
return BS_NEED_MORE;
|
|
}
|
|
}
|
|
return BS_BLOCK_DONE;
|
|
}
|
|
function deflate_slow(s, flush) {
|
|
var hash_head;
|
|
var bflush;
|
|
var max_insert;
|
|
for (; ; ) {
|
|
if (s.lookahead < MIN_LOOKAHEAD) {
|
|
fill_window(s);
|
|
if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
|
|
return BS_NEED_MORE;
|
|
}
|
|
if (s.lookahead === 0) {
|
|
break;
|
|
}
|
|
}
|
|
hash_head = 0;
|
|
if (s.lookahead >= MIN_MATCH) {
|
|
s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
|
|
hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
|
|
s.head[s.ins_h] = s.strstart;
|
|
}
|
|
s.prev_length = s.match_length;
|
|
s.prev_match = s.match_start;
|
|
s.match_length = MIN_MATCH - 1;
|
|
if (hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {
|
|
s.match_length = longest_match(s, hash_head);
|
|
if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096)) {
|
|
s.match_length = MIN_MATCH - 1;
|
|
}
|
|
}
|
|
if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {
|
|
max_insert = s.strstart + s.lookahead - MIN_MATCH;
|
|
bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);
|
|
s.lookahead -= s.prev_length - 1;
|
|
s.prev_length -= 2;
|
|
do {
|
|
if (++s.strstart <= max_insert) {
|
|
s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
|
|
hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
|
|
s.head[s.ins_h] = s.strstart;
|
|
}
|
|
} while (--s.prev_length !== 0);
|
|
s.match_available = 0;
|
|
s.match_length = MIN_MATCH - 1;
|
|
s.strstart++;
|
|
if (bflush) {
|
|
flush_block_only(s, false);
|
|
if (s.strm.avail_out === 0) {
|
|
return BS_NEED_MORE;
|
|
}
|
|
}
|
|
} else if (s.match_available) {
|
|
bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);
|
|
if (bflush) {
|
|
flush_block_only(s, false);
|
|
}
|
|
s.strstart++;
|
|
s.lookahead--;
|
|
if (s.strm.avail_out === 0) {
|
|
return BS_NEED_MORE;
|
|
}
|
|
} else {
|
|
s.match_available = 1;
|
|
s.strstart++;
|
|
s.lookahead--;
|
|
}
|
|
}
|
|
if (s.match_available) {
|
|
bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);
|
|
s.match_available = 0;
|
|
}
|
|
s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
|
|
if (flush === Z_FINISH) {
|
|
flush_block_only(s, true);
|
|
if (s.strm.avail_out === 0) {
|
|
return BS_FINISH_STARTED;
|
|
}
|
|
return BS_FINISH_DONE;
|
|
}
|
|
if (s.last_lit) {
|
|
flush_block_only(s, false);
|
|
if (s.strm.avail_out === 0) {
|
|
return BS_NEED_MORE;
|
|
}
|
|
}
|
|
return BS_BLOCK_DONE;
|
|
}
|
|
function deflate_rle(s, flush) {
|
|
var bflush;
|
|
var prev;
|
|
var scan, strend;
|
|
var _win = s.window;
|
|
for (; ; ) {
|
|
if (s.lookahead <= MAX_MATCH) {
|
|
fill_window(s);
|
|
if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {
|
|
return BS_NEED_MORE;
|
|
}
|
|
if (s.lookahead === 0) {
|
|
break;
|
|
}
|
|
}
|
|
s.match_length = 0;
|
|
if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
|
|
scan = s.strstart - 1;
|
|
prev = _win[scan];
|
|
if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
|
|
strend = s.strstart + MAX_MATCH;
|
|
do {
|
|
} while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);
|
|
s.match_length = MAX_MATCH - (strend - scan);
|
|
if (s.match_length > s.lookahead) {
|
|
s.match_length = s.lookahead;
|
|
}
|
|
}
|
|
}
|
|
if (s.match_length >= MIN_MATCH) {
|
|
bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);
|
|
s.lookahead -= s.match_length;
|
|
s.strstart += s.match_length;
|
|
s.match_length = 0;
|
|
} else {
|
|
bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
|
|
s.lookahead--;
|
|
s.strstart++;
|
|
}
|
|
if (bflush) {
|
|
flush_block_only(s, false);
|
|
if (s.strm.avail_out === 0) {
|
|
return BS_NEED_MORE;
|
|
}
|
|
}
|
|
}
|
|
s.insert = 0;
|
|
if (flush === Z_FINISH) {
|
|
flush_block_only(s, true);
|
|
if (s.strm.avail_out === 0) {
|
|
return BS_FINISH_STARTED;
|
|
}
|
|
return BS_FINISH_DONE;
|
|
}
|
|
if (s.last_lit) {
|
|
flush_block_only(s, false);
|
|
if (s.strm.avail_out === 0) {
|
|
return BS_NEED_MORE;
|
|
}
|
|
}
|
|
return BS_BLOCK_DONE;
|
|
}
|
|
function deflate_huff(s, flush) {
|
|
var bflush;
|
|
for (; ; ) {
|
|
if (s.lookahead === 0) {
|
|
fill_window(s);
|
|
if (s.lookahead === 0) {
|
|
if (flush === Z_NO_FLUSH) {
|
|
return BS_NEED_MORE;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
s.match_length = 0;
|
|
bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
|
|
s.lookahead--;
|
|
s.strstart++;
|
|
if (bflush) {
|
|
flush_block_only(s, false);
|
|
if (s.strm.avail_out === 0) {
|
|
return BS_NEED_MORE;
|
|
}
|
|
}
|
|
}
|
|
s.insert = 0;
|
|
if (flush === Z_FINISH) {
|
|
flush_block_only(s, true);
|
|
if (s.strm.avail_out === 0) {
|
|
return BS_FINISH_STARTED;
|
|
}
|
|
return BS_FINISH_DONE;
|
|
}
|
|
if (s.last_lit) {
|
|
flush_block_only(s, false);
|
|
if (s.strm.avail_out === 0) {
|
|
return BS_NEED_MORE;
|
|
}
|
|
}
|
|
return BS_BLOCK_DONE;
|
|
}
|
|
function Config(good_length, max_lazy, nice_length, max_chain, func) {
|
|
this.good_length = good_length;
|
|
this.max_lazy = max_lazy;
|
|
this.nice_length = nice_length;
|
|
this.max_chain = max_chain;
|
|
this.func = func;
|
|
}
|
|
var configuration_table;
|
|
configuration_table = [
|
|
new Config(0, 0, 0, 0, deflate_stored),
|
|
new Config(4, 4, 8, 4, deflate_fast),
|
|
new Config(4, 5, 16, 8, deflate_fast),
|
|
new Config(4, 6, 32, 32, deflate_fast),
|
|
new Config(4, 4, 16, 16, deflate_slow),
|
|
new Config(8, 16, 32, 32, deflate_slow),
|
|
new Config(8, 16, 128, 128, deflate_slow),
|
|
new Config(8, 32, 128, 256, deflate_slow),
|
|
new Config(32, 128, 258, 1024, deflate_slow),
|
|
new Config(32, 258, 258, 4096, deflate_slow)
|
|
];
|
|
function lm_init(s) {
|
|
s.window_size = 2 * s.w_size;
|
|
zero(s.head);
|
|
s.max_lazy_match = configuration_table[s.level].max_lazy;
|
|
s.good_match = configuration_table[s.level].good_length;
|
|
s.nice_match = configuration_table[s.level].nice_length;
|
|
s.max_chain_length = configuration_table[s.level].max_chain;
|
|
s.strstart = 0;
|
|
s.block_start = 0;
|
|
s.lookahead = 0;
|
|
s.insert = 0;
|
|
s.match_length = s.prev_length = MIN_MATCH - 1;
|
|
s.match_available = 0;
|
|
s.ins_h = 0;
|
|
}
|
|
function DeflateState() {
|
|
this.strm = null;
|
|
this.status = 0;
|
|
this.pending_buf = null;
|
|
this.pending_buf_size = 0;
|
|
this.pending_out = 0;
|
|
this.pending = 0;
|
|
this.wrap = 0;
|
|
this.gzhead = null;
|
|
this.gzindex = 0;
|
|
this.method = Z_DEFLATED;
|
|
this.last_flush = -1;
|
|
this.w_size = 0;
|
|
this.w_bits = 0;
|
|
this.w_mask = 0;
|
|
this.window = null;
|
|
this.window_size = 0;
|
|
this.prev = null;
|
|
this.head = null;
|
|
this.ins_h = 0;
|
|
this.hash_size = 0;
|
|
this.hash_bits = 0;
|
|
this.hash_mask = 0;
|
|
this.hash_shift = 0;
|
|
this.block_start = 0;
|
|
this.match_length = 0;
|
|
this.prev_match = 0;
|
|
this.match_available = 0;
|
|
this.strstart = 0;
|
|
this.match_start = 0;
|
|
this.lookahead = 0;
|
|
this.prev_length = 0;
|
|
this.max_chain_length = 0;
|
|
this.max_lazy_match = 0;
|
|
this.level = 0;
|
|
this.strategy = 0;
|
|
this.good_match = 0;
|
|
this.nice_match = 0;
|
|
this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);
|
|
this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);
|
|
this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);
|
|
zero(this.dyn_ltree);
|
|
zero(this.dyn_dtree);
|
|
zero(this.bl_tree);
|
|
this.l_desc = null;
|
|
this.d_desc = null;
|
|
this.bl_desc = null;
|
|
this.bl_count = new utils.Buf16(MAX_BITS + 1);
|
|
this.heap = new utils.Buf16(2 * L_CODES + 1);
|
|
zero(this.heap);
|
|
this.heap_len = 0;
|
|
this.heap_max = 0;
|
|
this.depth = new utils.Buf16(2 * L_CODES + 1);
|
|
zero(this.depth);
|
|
this.l_buf = 0;
|
|
this.lit_bufsize = 0;
|
|
this.last_lit = 0;
|
|
this.d_buf = 0;
|
|
this.opt_len = 0;
|
|
this.static_len = 0;
|
|
this.matches = 0;
|
|
this.insert = 0;
|
|
this.bi_buf = 0;
|
|
this.bi_valid = 0;
|
|
}
|
|
function deflateResetKeep(strm) {
|
|
var s;
|
|
if (!strm || !strm.state) {
|
|
return err(strm, Z_STREAM_ERROR);
|
|
}
|
|
strm.total_in = strm.total_out = 0;
|
|
strm.data_type = Z_UNKNOWN;
|
|
s = strm.state;
|
|
s.pending = 0;
|
|
s.pending_out = 0;
|
|
if (s.wrap < 0) {
|
|
s.wrap = -s.wrap;
|
|
}
|
|
s.status = s.wrap ? INIT_STATE : BUSY_STATE;
|
|
strm.adler = s.wrap === 2 ? 0 : 1;
|
|
s.last_flush = Z_NO_FLUSH;
|
|
trees._tr_init(s);
|
|
return Z_OK;
|
|
}
|
|
function deflateReset(strm) {
|
|
var ret = deflateResetKeep(strm);
|
|
if (ret === Z_OK) {
|
|
lm_init(strm.state);
|
|
}
|
|
return ret;
|
|
}
|
|
function deflateSetHeader(strm, head) {
|
|
if (!strm || !strm.state) {
|
|
return Z_STREAM_ERROR;
|
|
}
|
|
if (strm.state.wrap !== 2) {
|
|
return Z_STREAM_ERROR;
|
|
}
|
|
strm.state.gzhead = head;
|
|
return Z_OK;
|
|
}
|
|
function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
|
|
if (!strm) {
|
|
return Z_STREAM_ERROR;
|
|
}
|
|
var wrap = 1;
|
|
if (level === Z_DEFAULT_COMPRESSION) {
|
|
level = 6;
|
|
}
|
|
if (windowBits < 0) {
|
|
wrap = 0;
|
|
windowBits = -windowBits;
|
|
} else if (windowBits > 15) {
|
|
wrap = 2;
|
|
windowBits -= 16;
|
|
}
|
|
if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) {
|
|
return err(strm, Z_STREAM_ERROR);
|
|
}
|
|
if (windowBits === 8) {
|
|
windowBits = 9;
|
|
}
|
|
var s = new DeflateState();
|
|
strm.state = s;
|
|
s.strm = strm;
|
|
s.wrap = wrap;
|
|
s.gzhead = null;
|
|
s.w_bits = windowBits;
|
|
s.w_size = 1 << s.w_bits;
|
|
s.w_mask = s.w_size - 1;
|
|
s.hash_bits = memLevel + 7;
|
|
s.hash_size = 1 << s.hash_bits;
|
|
s.hash_mask = s.hash_size - 1;
|
|
s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);
|
|
s.window = new utils.Buf8(s.w_size * 2);
|
|
s.head = new utils.Buf16(s.hash_size);
|
|
s.prev = new utils.Buf16(s.w_size);
|
|
s.lit_bufsize = 1 << memLevel + 6;
|
|
s.pending_buf_size = s.lit_bufsize * 4;
|
|
s.pending_buf = new utils.Buf8(s.pending_buf_size);
|
|
s.d_buf = 1 * s.lit_bufsize;
|
|
s.l_buf = (1 + 2) * s.lit_bufsize;
|
|
s.level = level;
|
|
s.strategy = strategy;
|
|
s.method = method;
|
|
return deflateReset(strm);
|
|
}
|
|
function deflateInit(strm, level) {
|
|
return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
|
|
}
|
|
function deflate(strm, flush) {
|
|
var old_flush, s;
|
|
var beg, val;
|
|
if (!strm || !strm.state || flush > Z_BLOCK || flush < 0) {
|
|
return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
|
|
}
|
|
s = strm.state;
|
|
if (!strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH) {
|
|
return err(strm, strm.avail_out === 0 ? Z_BUF_ERROR : Z_STREAM_ERROR);
|
|
}
|
|
s.strm = strm;
|
|
old_flush = s.last_flush;
|
|
s.last_flush = flush;
|
|
if (s.status === INIT_STATE) {
|
|
if (s.wrap === 2) {
|
|
strm.adler = 0;
|
|
put_byte(s, 31);
|
|
put_byte(s, 139);
|
|
put_byte(s, 8);
|
|
if (!s.gzhead) {
|
|
put_byte(s, 0);
|
|
put_byte(s, 0);
|
|
put_byte(s, 0);
|
|
put_byte(s, 0);
|
|
put_byte(s, 0);
|
|
put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0);
|
|
put_byte(s, OS_CODE);
|
|
s.status = BUSY_STATE;
|
|
} else {
|
|
put_byte(s, (s.gzhead.text ? 1 : 0) + (s.gzhead.hcrc ? 2 : 0) + (!s.gzhead.extra ? 0 : 4) + (!s.gzhead.name ? 0 : 8) + (!s.gzhead.comment ? 0 : 16));
|
|
put_byte(s, s.gzhead.time & 255);
|
|
put_byte(s, s.gzhead.time >> 8 & 255);
|
|
put_byte(s, s.gzhead.time >> 16 & 255);
|
|
put_byte(s, s.gzhead.time >> 24 & 255);
|
|
put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0);
|
|
put_byte(s, s.gzhead.os & 255);
|
|
if (s.gzhead.extra && s.gzhead.extra.length) {
|
|
put_byte(s, s.gzhead.extra.length & 255);
|
|
put_byte(s, s.gzhead.extra.length >> 8 & 255);
|
|
}
|
|
if (s.gzhead.hcrc) {
|
|
strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);
|
|
}
|
|
s.gzindex = 0;
|
|
s.status = EXTRA_STATE;
|
|
}
|
|
} else {
|
|
var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8;
|
|
var level_flags = -1;
|
|
if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {
|
|
level_flags = 0;
|
|
} else if (s.level < 6) {
|
|
level_flags = 1;
|
|
} else if (s.level === 6) {
|
|
level_flags = 2;
|
|
} else {
|
|
level_flags = 3;
|
|
}
|
|
header |= level_flags << 6;
|
|
if (s.strstart !== 0) {
|
|
header |= PRESET_DICT;
|
|
}
|
|
header += 31 - header % 31;
|
|
s.status = BUSY_STATE;
|
|
putShortMSB(s, header);
|
|
if (s.strstart !== 0) {
|
|
putShortMSB(s, strm.adler >>> 16);
|
|
putShortMSB(s, strm.adler & 65535);
|
|
}
|
|
strm.adler = 1;
|
|
}
|
|
}
|
|
if (s.status === EXTRA_STATE) {
|
|
if (s.gzhead.extra) {
|
|
beg = s.pending;
|
|
while (s.gzindex < (s.gzhead.extra.length & 65535)) {
|
|
if (s.pending === s.pending_buf_size) {
|
|
if (s.gzhead.hcrc && s.pending > beg) {
|
|
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
}
|
|
flush_pending(strm);
|
|
beg = s.pending;
|
|
if (s.pending === s.pending_buf_size) {
|
|
break;
|
|
}
|
|
}
|
|
put_byte(s, s.gzhead.extra[s.gzindex] & 255);
|
|
s.gzindex++;
|
|
}
|
|
if (s.gzhead.hcrc && s.pending > beg) {
|
|
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
}
|
|
if (s.gzindex === s.gzhead.extra.length) {
|
|
s.gzindex = 0;
|
|
s.status = NAME_STATE;
|
|
}
|
|
} else {
|
|
s.status = NAME_STATE;
|
|
}
|
|
}
|
|
if (s.status === NAME_STATE) {
|
|
if (s.gzhead.name) {
|
|
beg = s.pending;
|
|
do {
|
|
if (s.pending === s.pending_buf_size) {
|
|
if (s.gzhead.hcrc && s.pending > beg) {
|
|
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
}
|
|
flush_pending(strm);
|
|
beg = s.pending;
|
|
if (s.pending === s.pending_buf_size) {
|
|
val = 1;
|
|
break;
|
|
}
|
|
}
|
|
if (s.gzindex < s.gzhead.name.length) {
|
|
val = s.gzhead.name.charCodeAt(s.gzindex++) & 255;
|
|
} else {
|
|
val = 0;
|
|
}
|
|
put_byte(s, val);
|
|
} while (val !== 0);
|
|
if (s.gzhead.hcrc && s.pending > beg) {
|
|
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
}
|
|
if (val === 0) {
|
|
s.gzindex = 0;
|
|
s.status = COMMENT_STATE;
|
|
}
|
|
} else {
|
|
s.status = COMMENT_STATE;
|
|
}
|
|
}
|
|
if (s.status === COMMENT_STATE) {
|
|
if (s.gzhead.comment) {
|
|
beg = s.pending;
|
|
do {
|
|
if (s.pending === s.pending_buf_size) {
|
|
if (s.gzhead.hcrc && s.pending > beg) {
|
|
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
}
|
|
flush_pending(strm);
|
|
beg = s.pending;
|
|
if (s.pending === s.pending_buf_size) {
|
|
val = 1;
|
|
break;
|
|
}
|
|
}
|
|
if (s.gzindex < s.gzhead.comment.length) {
|
|
val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255;
|
|
} else {
|
|
val = 0;
|
|
}
|
|
put_byte(s, val);
|
|
} while (val !== 0);
|
|
if (s.gzhead.hcrc && s.pending > beg) {
|
|
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
}
|
|
if (val === 0) {
|
|
s.status = HCRC_STATE;
|
|
}
|
|
} else {
|
|
s.status = HCRC_STATE;
|
|
}
|
|
}
|
|
if (s.status === HCRC_STATE) {
|
|
if (s.gzhead.hcrc) {
|
|
if (s.pending + 2 > s.pending_buf_size) {
|
|
flush_pending(strm);
|
|
}
|
|
if (s.pending + 2 <= s.pending_buf_size) {
|
|
put_byte(s, strm.adler & 255);
|
|
put_byte(s, strm.adler >> 8 & 255);
|
|
strm.adler = 0;
|
|
s.status = BUSY_STATE;
|
|
}
|
|
} else {
|
|
s.status = BUSY_STATE;
|
|
}
|
|
}
|
|
if (s.pending !== 0) {
|
|
flush_pending(strm);
|
|
if (strm.avail_out === 0) {
|
|
s.last_flush = -1;
|
|
return Z_OK;
|
|
}
|
|
} else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH) {
|
|
return err(strm, Z_BUF_ERROR);
|
|
}
|
|
if (s.status === FINISH_STATE && strm.avail_in !== 0) {
|
|
return err(strm, Z_BUF_ERROR);
|
|
}
|
|
if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) {
|
|
var bstate = s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush) : s.strategy === Z_RLE ? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush);
|
|
if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {
|
|
s.status = FINISH_STATE;
|
|
}
|
|
if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {
|
|
if (strm.avail_out === 0) {
|
|
s.last_flush = -1;
|
|
}
|
|
return Z_OK;
|
|
}
|
|
if (bstate === BS_BLOCK_DONE) {
|
|
if (flush === Z_PARTIAL_FLUSH) {
|
|
trees._tr_align(s);
|
|
} else if (flush !== Z_BLOCK) {
|
|
trees._tr_stored_block(s, 0, 0, false);
|
|
if (flush === Z_FULL_FLUSH) {
|
|
zero(s.head);
|
|
if (s.lookahead === 0) {
|
|
s.strstart = 0;
|
|
s.block_start = 0;
|
|
s.insert = 0;
|
|
}
|
|
}
|
|
}
|
|
flush_pending(strm);
|
|
if (strm.avail_out === 0) {
|
|
s.last_flush = -1;
|
|
return Z_OK;
|
|
}
|
|
}
|
|
}
|
|
if (flush !== Z_FINISH) {
|
|
return Z_OK;
|
|
}
|
|
if (s.wrap <= 0) {
|
|
return Z_STREAM_END;
|
|
}
|
|
if (s.wrap === 2) {
|
|
put_byte(s, strm.adler & 255);
|
|
put_byte(s, strm.adler >> 8 & 255);
|
|
put_byte(s, strm.adler >> 16 & 255);
|
|
put_byte(s, strm.adler >> 24 & 255);
|
|
put_byte(s, strm.total_in & 255);
|
|
put_byte(s, strm.total_in >> 8 & 255);
|
|
put_byte(s, strm.total_in >> 16 & 255);
|
|
put_byte(s, strm.total_in >> 24 & 255);
|
|
} else {
|
|
putShortMSB(s, strm.adler >>> 16);
|
|
putShortMSB(s, strm.adler & 65535);
|
|
}
|
|
flush_pending(strm);
|
|
if (s.wrap > 0) {
|
|
s.wrap = -s.wrap;
|
|
}
|
|
return s.pending !== 0 ? Z_OK : Z_STREAM_END;
|
|
}
|
|
function deflateEnd(strm) {
|
|
var status;
|
|
if (!strm || !strm.state) {
|
|
return Z_STREAM_ERROR;
|
|
}
|
|
status = strm.state.status;
|
|
if (status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE) {
|
|
return err(strm, Z_STREAM_ERROR);
|
|
}
|
|
strm.state = null;
|
|
return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;
|
|
}
|
|
function deflateSetDictionary(strm, dictionary) {
|
|
var dictLength = dictionary.length;
|
|
var s;
|
|
var str, n;
|
|
var wrap;
|
|
var avail;
|
|
var next;
|
|
var input;
|
|
var tmpDict;
|
|
if (!strm || !strm.state) {
|
|
return Z_STREAM_ERROR;
|
|
}
|
|
s = strm.state;
|
|
wrap = s.wrap;
|
|
if (wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead) {
|
|
return Z_STREAM_ERROR;
|
|
}
|
|
if (wrap === 1) {
|
|
strm.adler = adler32(strm.adler, dictionary, dictLength, 0);
|
|
}
|
|
s.wrap = 0;
|
|
if (dictLength >= s.w_size) {
|
|
if (wrap === 0) {
|
|
zero(s.head);
|
|
s.strstart = 0;
|
|
s.block_start = 0;
|
|
s.insert = 0;
|
|
}
|
|
tmpDict = new utils.Buf8(s.w_size);
|
|
utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);
|
|
dictionary = tmpDict;
|
|
dictLength = s.w_size;
|
|
}
|
|
avail = strm.avail_in;
|
|
next = strm.next_in;
|
|
input = strm.input;
|
|
strm.avail_in = dictLength;
|
|
strm.next_in = 0;
|
|
strm.input = dictionary;
|
|
fill_window(s);
|
|
while (s.lookahead >= MIN_MATCH) {
|
|
str = s.strstart;
|
|
n = s.lookahead - (MIN_MATCH - 1);
|
|
do {
|
|
s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;
|
|
s.prev[str & s.w_mask] = s.head[s.ins_h];
|
|
s.head[s.ins_h] = str;
|
|
str++;
|
|
} while (--n);
|
|
s.strstart = str;
|
|
s.lookahead = MIN_MATCH - 1;
|
|
fill_window(s);
|
|
}
|
|
s.strstart += s.lookahead;
|
|
s.block_start = s.strstart;
|
|
s.insert = s.lookahead;
|
|
s.lookahead = 0;
|
|
s.match_length = s.prev_length = MIN_MATCH - 1;
|
|
s.match_available = 0;
|
|
strm.next_in = next;
|
|
strm.input = input;
|
|
strm.avail_in = avail;
|
|
s.wrap = wrap;
|
|
return Z_OK;
|
|
}
|
|
exports3.deflateInit = deflateInit;
|
|
exports3.deflateInit2 = deflateInit2;
|
|
exports3.deflateReset = deflateReset;
|
|
exports3.deflateResetKeep = deflateResetKeep;
|
|
exports3.deflateSetHeader = deflateSetHeader;
|
|
exports3.deflate = deflate;
|
|
exports3.deflateEnd = deflateEnd;
|
|
exports3.deflateSetDictionary = deflateSetDictionary;
|
|
exports3.deflateInfo = "pako deflate (from Nodeca project)";
|
|
}, { "../utils/common": 5, "./adler32": 7, "./crc32": 8, "./messages": 10, "./trees": 11 }], 10: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
module4.exports = {
|
|
2: "need dictionary",
|
|
1: "stream end",
|
|
0: "",
|
|
"-1": "file error",
|
|
"-2": "stream error",
|
|
"-3": "data error",
|
|
"-4": "insufficient memory",
|
|
"-5": "buffer error",
|
|
"-6": "incompatible version"
|
|
};
|
|
}, {}], 11: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
var utils = require2("../utils/common");
|
|
var Z_FIXED = 4;
|
|
var Z_BINARY = 0;
|
|
var Z_TEXT = 1;
|
|
var Z_UNKNOWN = 2;
|
|
function zero(buf) {
|
|
var len = buf.length;
|
|
while (--len >= 0) {
|
|
buf[len] = 0;
|
|
}
|
|
}
|
|
var STORED_BLOCK = 0;
|
|
var STATIC_TREES = 1;
|
|
var DYN_TREES = 2;
|
|
var MIN_MATCH = 3;
|
|
var MAX_MATCH = 258;
|
|
var LENGTH_CODES = 29;
|
|
var LITERALS = 256;
|
|
var L_CODES = LITERALS + 1 + LENGTH_CODES;
|
|
var D_CODES = 30;
|
|
var BL_CODES = 19;
|
|
var HEAP_SIZE = 2 * L_CODES + 1;
|
|
var MAX_BITS = 15;
|
|
var Buf_size = 16;
|
|
var MAX_BL_BITS = 7;
|
|
var END_BLOCK = 256;
|
|
var REP_3_6 = 16;
|
|
var REPZ_3_10 = 17;
|
|
var REPZ_11_138 = 18;
|
|
var extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0];
|
|
var extra_dbits = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13];
|
|
var extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7];
|
|
var bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
|
|
var DIST_CODE_LEN = 512;
|
|
var static_ltree = new Array((L_CODES + 2) * 2);
|
|
zero(static_ltree);
|
|
var static_dtree = new Array(D_CODES * 2);
|
|
zero(static_dtree);
|
|
var _dist_code = new Array(DIST_CODE_LEN);
|
|
zero(_dist_code);
|
|
var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);
|
|
zero(_length_code);
|
|
var base_length = new Array(LENGTH_CODES);
|
|
zero(base_length);
|
|
var base_dist = new Array(D_CODES);
|
|
zero(base_dist);
|
|
function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {
|
|
this.static_tree = static_tree;
|
|
this.extra_bits = extra_bits;
|
|
this.extra_base = extra_base;
|
|
this.elems = elems;
|
|
this.max_length = max_length;
|
|
this.has_stree = static_tree && static_tree.length;
|
|
}
|
|
var static_l_desc;
|
|
var static_d_desc;
|
|
var static_bl_desc;
|
|
function TreeDesc(dyn_tree, stat_desc) {
|
|
this.dyn_tree = dyn_tree;
|
|
this.max_code = 0;
|
|
this.stat_desc = stat_desc;
|
|
}
|
|
function d_code(dist) {
|
|
return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
|
|
}
|
|
function put_short(s, w) {
|
|
s.pending_buf[s.pending++] = w & 255;
|
|
s.pending_buf[s.pending++] = w >>> 8 & 255;
|
|
}
|
|
function send_bits(s, value, length) {
|
|
if (s.bi_valid > Buf_size - length) {
|
|
s.bi_buf |= value << s.bi_valid & 65535;
|
|
put_short(s, s.bi_buf);
|
|
s.bi_buf = value >> Buf_size - s.bi_valid;
|
|
s.bi_valid += length - Buf_size;
|
|
} else {
|
|
s.bi_buf |= value << s.bi_valid & 65535;
|
|
s.bi_valid += length;
|
|
}
|
|
}
|
|
function send_code(s, c, tree) {
|
|
send_bits(s, tree[c * 2], tree[c * 2 + 1]);
|
|
}
|
|
function bi_reverse(code, len) {
|
|
var res = 0;
|
|
do {
|
|
res |= code & 1;
|
|
code >>>= 1;
|
|
res <<= 1;
|
|
} while (--len > 0);
|
|
return res >>> 1;
|
|
}
|
|
function bi_flush(s) {
|
|
if (s.bi_valid === 16) {
|
|
put_short(s, s.bi_buf);
|
|
s.bi_buf = 0;
|
|
s.bi_valid = 0;
|
|
} else if (s.bi_valid >= 8) {
|
|
s.pending_buf[s.pending++] = s.bi_buf & 255;
|
|
s.bi_buf >>= 8;
|
|
s.bi_valid -= 8;
|
|
}
|
|
}
|
|
function gen_bitlen(s, desc) {
|
|
var tree = desc.dyn_tree;
|
|
var max_code = desc.max_code;
|
|
var stree = desc.stat_desc.static_tree;
|
|
var has_stree = desc.stat_desc.has_stree;
|
|
var extra = desc.stat_desc.extra_bits;
|
|
var base = desc.stat_desc.extra_base;
|
|
var max_length = desc.stat_desc.max_length;
|
|
var h;
|
|
var n, m;
|
|
var bits;
|
|
var xbits;
|
|
var f;
|
|
var overflow = 0;
|
|
for (bits = 0; bits <= MAX_BITS; bits++) {
|
|
s.bl_count[bits] = 0;
|
|
}
|
|
tree[s.heap[s.heap_max] * 2 + 1] = 0;
|
|
for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {
|
|
n = s.heap[h];
|
|
bits = tree[tree[n * 2 + 1] * 2 + 1] + 1;
|
|
if (bits > max_length) {
|
|
bits = max_length;
|
|
overflow++;
|
|
}
|
|
tree[n * 2 + 1] = bits;
|
|
if (n > max_code) {
|
|
continue;
|
|
}
|
|
s.bl_count[bits]++;
|
|
xbits = 0;
|
|
if (n >= base) {
|
|
xbits = extra[n - base];
|
|
}
|
|
f = tree[n * 2];
|
|
s.opt_len += f * (bits + xbits);
|
|
if (has_stree) {
|
|
s.static_len += f * (stree[n * 2 + 1] + xbits);
|
|
}
|
|
}
|
|
if (overflow === 0) {
|
|
return;
|
|
}
|
|
do {
|
|
bits = max_length - 1;
|
|
while (s.bl_count[bits] === 0) {
|
|
bits--;
|
|
}
|
|
s.bl_count[bits]--;
|
|
s.bl_count[bits + 1] += 2;
|
|
s.bl_count[max_length]--;
|
|
overflow -= 2;
|
|
} while (overflow > 0);
|
|
for (bits = max_length; bits !== 0; bits--) {
|
|
n = s.bl_count[bits];
|
|
while (n !== 0) {
|
|
m = s.heap[--h];
|
|
if (m > max_code) {
|
|
continue;
|
|
}
|
|
if (tree[m * 2 + 1] !== bits) {
|
|
s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2];
|
|
tree[m * 2 + 1] = bits;
|
|
}
|
|
n--;
|
|
}
|
|
}
|
|
}
|
|
function gen_codes(tree, max_code, bl_count) {
|
|
var next_code = new Array(MAX_BITS + 1);
|
|
var code = 0;
|
|
var bits;
|
|
var n;
|
|
for (bits = 1; bits <= MAX_BITS; bits++) {
|
|
next_code[bits] = code = code + bl_count[bits - 1] << 1;
|
|
}
|
|
for (n = 0; n <= max_code; n++) {
|
|
var len = tree[n * 2 + 1];
|
|
if (len === 0) {
|
|
continue;
|
|
}
|
|
tree[n * 2] = bi_reverse(next_code[len]++, len);
|
|
}
|
|
}
|
|
function tr_static_init() {
|
|
var n;
|
|
var bits;
|
|
var length;
|
|
var code;
|
|
var dist;
|
|
var bl_count = new Array(MAX_BITS + 1);
|
|
length = 0;
|
|
for (code = 0; code < LENGTH_CODES - 1; code++) {
|
|
base_length[code] = length;
|
|
for (n = 0; n < 1 << extra_lbits[code]; n++) {
|
|
_length_code[length++] = code;
|
|
}
|
|
}
|
|
_length_code[length - 1] = code;
|
|
dist = 0;
|
|
for (code = 0; code < 16; code++) {
|
|
base_dist[code] = dist;
|
|
for (n = 0; n < 1 << extra_dbits[code]; n++) {
|
|
_dist_code[dist++] = code;
|
|
}
|
|
}
|
|
dist >>= 7;
|
|
for (; code < D_CODES; code++) {
|
|
base_dist[code] = dist << 7;
|
|
for (n = 0; n < 1 << extra_dbits[code] - 7; n++) {
|
|
_dist_code[256 + dist++] = code;
|
|
}
|
|
}
|
|
for (bits = 0; bits <= MAX_BITS; bits++) {
|
|
bl_count[bits] = 0;
|
|
}
|
|
n = 0;
|
|
while (n <= 143) {
|
|
static_ltree[n * 2 + 1] = 8;
|
|
n++;
|
|
bl_count[8]++;
|
|
}
|
|
while (n <= 255) {
|
|
static_ltree[n * 2 + 1] = 9;
|
|
n++;
|
|
bl_count[9]++;
|
|
}
|
|
while (n <= 279) {
|
|
static_ltree[n * 2 + 1] = 7;
|
|
n++;
|
|
bl_count[7]++;
|
|
}
|
|
while (n <= 287) {
|
|
static_ltree[n * 2 + 1] = 8;
|
|
n++;
|
|
bl_count[8]++;
|
|
}
|
|
gen_codes(static_ltree, L_CODES + 1, bl_count);
|
|
for (n = 0; n < D_CODES; n++) {
|
|
static_dtree[n * 2 + 1] = 5;
|
|
static_dtree[n * 2] = bi_reverse(n, 5);
|
|
}
|
|
static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);
|
|
static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);
|
|
static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);
|
|
}
|
|
function init_block(s) {
|
|
var n;
|
|
for (n = 0; n < L_CODES; n++) {
|
|
s.dyn_ltree[n * 2] = 0;
|
|
}
|
|
for (n = 0; n < D_CODES; n++) {
|
|
s.dyn_dtree[n * 2] = 0;
|
|
}
|
|
for (n = 0; n < BL_CODES; n++) {
|
|
s.bl_tree[n * 2] = 0;
|
|
}
|
|
s.dyn_ltree[END_BLOCK * 2] = 1;
|
|
s.opt_len = s.static_len = 0;
|
|
s.last_lit = s.matches = 0;
|
|
}
|
|
function bi_windup(s) {
|
|
if (s.bi_valid > 8) {
|
|
put_short(s, s.bi_buf);
|
|
} else if (s.bi_valid > 0) {
|
|
s.pending_buf[s.pending++] = s.bi_buf;
|
|
}
|
|
s.bi_buf = 0;
|
|
s.bi_valid = 0;
|
|
}
|
|
function copy_block(s, buf, len, header) {
|
|
bi_windup(s);
|
|
if (header) {
|
|
put_short(s, len);
|
|
put_short(s, ~len);
|
|
}
|
|
utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);
|
|
s.pending += len;
|
|
}
|
|
function smaller(tree, n, m, depth) {
|
|
var _n2 = n * 2;
|
|
var _m2 = m * 2;
|
|
return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m];
|
|
}
|
|
function pqdownheap(s, tree, k) {
|
|
var v = s.heap[k];
|
|
var j = k << 1;
|
|
while (j <= s.heap_len) {
|
|
if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {
|
|
j++;
|
|
}
|
|
if (smaller(tree, v, s.heap[j], s.depth)) {
|
|
break;
|
|
}
|
|
s.heap[k] = s.heap[j];
|
|
k = j;
|
|
j <<= 1;
|
|
}
|
|
s.heap[k] = v;
|
|
}
|
|
function compress_block(s, ltree, dtree) {
|
|
var dist;
|
|
var lc;
|
|
var lx = 0;
|
|
var code;
|
|
var extra;
|
|
if (s.last_lit !== 0) {
|
|
do {
|
|
dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1];
|
|
lc = s.pending_buf[s.l_buf + lx];
|
|
lx++;
|
|
if (dist === 0) {
|
|
send_code(s, lc, ltree);
|
|
} else {
|
|
code = _length_code[lc];
|
|
send_code(s, code + LITERALS + 1, ltree);
|
|
extra = extra_lbits[code];
|
|
if (extra !== 0) {
|
|
lc -= base_length[code];
|
|
send_bits(s, lc, extra);
|
|
}
|
|
dist--;
|
|
code = d_code(dist);
|
|
send_code(s, code, dtree);
|
|
extra = extra_dbits[code];
|
|
if (extra !== 0) {
|
|
dist -= base_dist[code];
|
|
send_bits(s, dist, extra);
|
|
}
|
|
}
|
|
} while (lx < s.last_lit);
|
|
}
|
|
send_code(s, END_BLOCK, ltree);
|
|
}
|
|
function build_tree(s, desc) {
|
|
var tree = desc.dyn_tree;
|
|
var stree = desc.stat_desc.static_tree;
|
|
var has_stree = desc.stat_desc.has_stree;
|
|
var elems = desc.stat_desc.elems;
|
|
var n, m;
|
|
var max_code = -1;
|
|
var node;
|
|
s.heap_len = 0;
|
|
s.heap_max = HEAP_SIZE;
|
|
for (n = 0; n < elems; n++) {
|
|
if (tree[n * 2] !== 0) {
|
|
s.heap[++s.heap_len] = max_code = n;
|
|
s.depth[n] = 0;
|
|
} else {
|
|
tree[n * 2 + 1] = 0;
|
|
}
|
|
}
|
|
while (s.heap_len < 2) {
|
|
node = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0;
|
|
tree[node * 2] = 1;
|
|
s.depth[node] = 0;
|
|
s.opt_len--;
|
|
if (has_stree) {
|
|
s.static_len -= stree[node * 2 + 1];
|
|
}
|
|
}
|
|
desc.max_code = max_code;
|
|
for (n = s.heap_len >> 1; n >= 1; n--) {
|
|
pqdownheap(s, tree, n);
|
|
}
|
|
node = elems;
|
|
do {
|
|
n = s.heap[1];
|
|
s.heap[1] = s.heap[s.heap_len--];
|
|
pqdownheap(s, tree, 1);
|
|
m = s.heap[1];
|
|
s.heap[--s.heap_max] = n;
|
|
s.heap[--s.heap_max] = m;
|
|
tree[node * 2] = tree[n * 2] + tree[m * 2];
|
|
s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
|
|
tree[n * 2 + 1] = tree[m * 2 + 1] = node;
|
|
s.heap[1] = node++;
|
|
pqdownheap(s, tree, 1);
|
|
} while (s.heap_len >= 2);
|
|
s.heap[--s.heap_max] = s.heap[1];
|
|
gen_bitlen(s, desc);
|
|
gen_codes(tree, max_code, s.bl_count);
|
|
}
|
|
function scan_tree(s, tree, max_code) {
|
|
var n;
|
|
var prevlen = -1;
|
|
var curlen;
|
|
var nextlen = tree[0 * 2 + 1];
|
|
var count = 0;
|
|
var max_count = 7;
|
|
var min_count = 4;
|
|
if (nextlen === 0) {
|
|
max_count = 138;
|
|
min_count = 3;
|
|
}
|
|
tree[(max_code + 1) * 2 + 1] = 65535;
|
|
for (n = 0; n <= max_code; n++) {
|
|
curlen = nextlen;
|
|
nextlen = tree[(n + 1) * 2 + 1];
|
|
if (++count < max_count && curlen === nextlen) {
|
|
continue;
|
|
} else if (count < min_count) {
|
|
s.bl_tree[curlen * 2] += count;
|
|
} else if (curlen !== 0) {
|
|
if (curlen !== prevlen) {
|
|
s.bl_tree[curlen * 2]++;
|
|
}
|
|
s.bl_tree[REP_3_6 * 2]++;
|
|
} else if (count <= 10) {
|
|
s.bl_tree[REPZ_3_10 * 2]++;
|
|
} else {
|
|
s.bl_tree[REPZ_11_138 * 2]++;
|
|
}
|
|
count = 0;
|
|
prevlen = curlen;
|
|
if (nextlen === 0) {
|
|
max_count = 138;
|
|
min_count = 3;
|
|
} else if (curlen === nextlen) {
|
|
max_count = 6;
|
|
min_count = 3;
|
|
} else {
|
|
max_count = 7;
|
|
min_count = 4;
|
|
}
|
|
}
|
|
}
|
|
function send_tree(s, tree, max_code) {
|
|
var n;
|
|
var prevlen = -1;
|
|
var curlen;
|
|
var nextlen = tree[0 * 2 + 1];
|
|
var count = 0;
|
|
var max_count = 7;
|
|
var min_count = 4;
|
|
if (nextlen === 0) {
|
|
max_count = 138;
|
|
min_count = 3;
|
|
}
|
|
for (n = 0; n <= max_code; n++) {
|
|
curlen = nextlen;
|
|
nextlen = tree[(n + 1) * 2 + 1];
|
|
if (++count < max_count && curlen === nextlen) {
|
|
continue;
|
|
} else if (count < min_count) {
|
|
do {
|
|
send_code(s, curlen, s.bl_tree);
|
|
} while (--count !== 0);
|
|
} else if (curlen !== 0) {
|
|
if (curlen !== prevlen) {
|
|
send_code(s, curlen, s.bl_tree);
|
|
count--;
|
|
}
|
|
send_code(s, REP_3_6, s.bl_tree);
|
|
send_bits(s, count - 3, 2);
|
|
} else if (count <= 10) {
|
|
send_code(s, REPZ_3_10, s.bl_tree);
|
|
send_bits(s, count - 3, 3);
|
|
} else {
|
|
send_code(s, REPZ_11_138, s.bl_tree);
|
|
send_bits(s, count - 11, 7);
|
|
}
|
|
count = 0;
|
|
prevlen = curlen;
|
|
if (nextlen === 0) {
|
|
max_count = 138;
|
|
min_count = 3;
|
|
} else if (curlen === nextlen) {
|
|
max_count = 6;
|
|
min_count = 3;
|
|
} else {
|
|
max_count = 7;
|
|
min_count = 4;
|
|
}
|
|
}
|
|
}
|
|
function build_bl_tree(s) {
|
|
var max_blindex;
|
|
scan_tree(s, s.dyn_ltree, s.l_desc.max_code);
|
|
scan_tree(s, s.dyn_dtree, s.d_desc.max_code);
|
|
build_tree(s, s.bl_desc);
|
|
for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {
|
|
if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0) {
|
|
break;
|
|
}
|
|
}
|
|
s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;
|
|
return max_blindex;
|
|
}
|
|
function send_all_trees(s, lcodes, dcodes, blcodes) {
|
|
var rank;
|
|
send_bits(s, lcodes - 257, 5);
|
|
send_bits(s, dcodes - 1, 5);
|
|
send_bits(s, blcodes - 4, 4);
|
|
for (rank = 0; rank < blcodes; rank++) {
|
|
send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3);
|
|
}
|
|
send_tree(s, s.dyn_ltree, lcodes - 1);
|
|
send_tree(s, s.dyn_dtree, dcodes - 1);
|
|
}
|
|
function detect_data_type(s) {
|
|
var black_mask = 4093624447;
|
|
var n;
|
|
for (n = 0; n <= 31; n++, black_mask >>>= 1) {
|
|
if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0) {
|
|
return Z_BINARY;
|
|
}
|
|
}
|
|
if (s.dyn_ltree[9 * 2] !== 0 || s.dyn_ltree[10 * 2] !== 0 || s.dyn_ltree[13 * 2] !== 0) {
|
|
return Z_TEXT;
|
|
}
|
|
for (n = 32; n < LITERALS; n++) {
|
|
if (s.dyn_ltree[n * 2] !== 0) {
|
|
return Z_TEXT;
|
|
}
|
|
}
|
|
return Z_BINARY;
|
|
}
|
|
var static_init_done = false;
|
|
function _tr_init(s) {
|
|
if (!static_init_done) {
|
|
tr_static_init();
|
|
static_init_done = true;
|
|
}
|
|
s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);
|
|
s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);
|
|
s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);
|
|
s.bi_buf = 0;
|
|
s.bi_valid = 0;
|
|
init_block(s);
|
|
}
|
|
function _tr_stored_block(s, buf, stored_len, last) {
|
|
send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3);
|
|
copy_block(s, buf, stored_len, true);
|
|
}
|
|
function _tr_align(s) {
|
|
send_bits(s, STATIC_TREES << 1, 3);
|
|
send_code(s, END_BLOCK, static_ltree);
|
|
bi_flush(s);
|
|
}
|
|
function _tr_flush_block(s, buf, stored_len, last) {
|
|
var opt_lenb, static_lenb;
|
|
var max_blindex = 0;
|
|
if (s.level > 0) {
|
|
if (s.strm.data_type === Z_UNKNOWN) {
|
|
s.strm.data_type = detect_data_type(s);
|
|
}
|
|
build_tree(s, s.l_desc);
|
|
build_tree(s, s.d_desc);
|
|
max_blindex = build_bl_tree(s);
|
|
opt_lenb = s.opt_len + 3 + 7 >>> 3;
|
|
static_lenb = s.static_len + 3 + 7 >>> 3;
|
|
if (static_lenb <= opt_lenb) {
|
|
opt_lenb = static_lenb;
|
|
}
|
|
} else {
|
|
opt_lenb = static_lenb = stored_len + 5;
|
|
}
|
|
if (stored_len + 4 <= opt_lenb && buf !== -1) {
|
|
_tr_stored_block(s, buf, stored_len, last);
|
|
} else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {
|
|
send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);
|
|
compress_block(s, static_ltree, static_dtree);
|
|
} else {
|
|
send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);
|
|
send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);
|
|
compress_block(s, s.dyn_ltree, s.dyn_dtree);
|
|
}
|
|
init_block(s);
|
|
if (last) {
|
|
bi_windup(s);
|
|
}
|
|
}
|
|
function _tr_tally(s, dist, lc) {
|
|
s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 255;
|
|
s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 255;
|
|
s.pending_buf[s.l_buf + s.last_lit] = lc & 255;
|
|
s.last_lit++;
|
|
if (dist === 0) {
|
|
s.dyn_ltree[lc * 2]++;
|
|
} else {
|
|
s.matches++;
|
|
dist--;
|
|
s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++;
|
|
s.dyn_dtree[d_code(dist) * 2]++;
|
|
}
|
|
return s.last_lit === s.lit_bufsize - 1;
|
|
}
|
|
exports3._tr_init = _tr_init;
|
|
exports3._tr_stored_block = _tr_stored_block;
|
|
exports3._tr_flush_block = _tr_flush_block;
|
|
exports3._tr_tally = _tr_tally;
|
|
exports3._tr_align = _tr_align;
|
|
}, { "../utils/common": 5 }], 12: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
function ZStream() {
|
|
this.input = null;
|
|
this.next_in = 0;
|
|
this.avail_in = 0;
|
|
this.total_in = 0;
|
|
this.output = null;
|
|
this.next_out = 0;
|
|
this.avail_out = 0;
|
|
this.total_out = 0;
|
|
this.msg = "";
|
|
this.state = null;
|
|
this.data_type = 2;
|
|
this.adler = 0;
|
|
}
|
|
module4.exports = ZStream;
|
|
}, {}] }, {}, [3])(3);
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/plantuml-encoder/dist/plantuml-decoder.js
|
|
var require_plantuml_decoder = __commonJS({
|
|
"node_modules/plantuml-encoder/dist/plantuml-decoder.js"(exports, module2) {
|
|
(function(f) {
|
|
if (typeof exports === "object" && typeof module2 !== "undefined") {
|
|
module2.exports = f();
|
|
} else if (typeof define === "function" && define.amd) {
|
|
define([], f);
|
|
} else {
|
|
var g;
|
|
if (typeof window !== "undefined") {
|
|
g = window;
|
|
} else if (typeof global !== "undefined") {
|
|
g = global;
|
|
} else if (typeof self !== "undefined") {
|
|
g = self;
|
|
} else {
|
|
g = this;
|
|
}
|
|
g.plantumlEncoder = f();
|
|
}
|
|
})(function() {
|
|
var define2, module3, exports2;
|
|
return function() {
|
|
function r(e, n, t) {
|
|
function o(i2, f) {
|
|
if (!n[i2]) {
|
|
if (!e[i2]) {
|
|
var c = typeof require == "function" && require;
|
|
if (!f && c)
|
|
return c(i2, true);
|
|
if (u)
|
|
return u(i2, true);
|
|
var a = new Error("Cannot find module '" + i2 + "'");
|
|
throw a.code = "MODULE_NOT_FOUND", a;
|
|
}
|
|
var p = n[i2] = { exports: {} };
|
|
e[i2][0].call(p.exports, function(r2) {
|
|
var n2 = e[i2][1][r2];
|
|
return o(n2 || r2);
|
|
}, p, p.exports, r, e, n, t);
|
|
}
|
|
return n[i2].exports;
|
|
}
|
|
for (var u = typeof require == "function" && require, i = 0; i < t.length; i++)
|
|
o(t[i]);
|
|
return o;
|
|
}
|
|
return r;
|
|
}()({ 1: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
var pako = require2("pako/lib/inflate.js");
|
|
module4.exports = function(data) {
|
|
return pako.inflateRaw(data, { to: "string" });
|
|
};
|
|
}, { "pako/lib/inflate.js": 4 }], 2: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
function decode6bit(cc) {
|
|
var c = cc.charCodeAt(0);
|
|
if (cc === "_")
|
|
return 63;
|
|
if (cc === "-")
|
|
return 62;
|
|
if (c >= 97)
|
|
return c - 61;
|
|
if (c >= 65)
|
|
return c - 55;
|
|
if (c >= 48)
|
|
return c - 48;
|
|
return "?";
|
|
}
|
|
function extract3bytes(data) {
|
|
var c1 = decode6bit(data[0]);
|
|
var c2 = decode6bit(data[1]);
|
|
var c3 = decode6bit(data[2]);
|
|
var c4 = decode6bit(data[3]);
|
|
var b1 = c1 << 2 | c2 >> 4 & 63;
|
|
var b2 = c2 << 4 & 240 | c3 >> 2 & 15;
|
|
var b3 = c3 << 6 & 192 | c4 & 63;
|
|
return [b1, b2, b3];
|
|
}
|
|
module4.exports = function(data) {
|
|
var r = "";
|
|
var i = 0;
|
|
for (i = 0; i < data.length; i += 4) {
|
|
var t = extract3bytes(data.substring(i, i + 4));
|
|
r = r + String.fromCharCode(t[0]);
|
|
r = r + String.fromCharCode(t[1]);
|
|
r = r + String.fromCharCode(t[2]);
|
|
}
|
|
return r;
|
|
};
|
|
}, {}], 3: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
var inflate = require2("./inflate");
|
|
var decode64 = require2("./decode64");
|
|
module4.exports.decode = function(encoded) {
|
|
var deflated = decode64(encoded);
|
|
return inflate(deflated);
|
|
};
|
|
}, { "./decode64": 2, "./inflate": 1 }], 4: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
var zlib_inflate = require2("./zlib/inflate");
|
|
var utils = require2("./utils/common");
|
|
var strings = require2("./utils/strings");
|
|
var c = require2("./zlib/constants");
|
|
var msg = require2("./zlib/messages");
|
|
var ZStream = require2("./zlib/zstream");
|
|
var GZheader = require2("./zlib/gzheader");
|
|
var toString = Object.prototype.toString;
|
|
function Inflate(options) {
|
|
if (!(this instanceof Inflate))
|
|
return new Inflate(options);
|
|
this.options = utils.assign({
|
|
chunkSize: 16384,
|
|
windowBits: 0,
|
|
to: ""
|
|
}, options || {});
|
|
var opt = this.options;
|
|
if (opt.raw && opt.windowBits >= 0 && opt.windowBits < 16) {
|
|
opt.windowBits = -opt.windowBits;
|
|
if (opt.windowBits === 0) {
|
|
opt.windowBits = -15;
|
|
}
|
|
}
|
|
if (opt.windowBits >= 0 && opt.windowBits < 16 && !(options && options.windowBits)) {
|
|
opt.windowBits += 32;
|
|
}
|
|
if (opt.windowBits > 15 && opt.windowBits < 48) {
|
|
if ((opt.windowBits & 15) === 0) {
|
|
opt.windowBits |= 15;
|
|
}
|
|
}
|
|
this.err = 0;
|
|
this.msg = "";
|
|
this.ended = false;
|
|
this.chunks = [];
|
|
this.strm = new ZStream();
|
|
this.strm.avail_out = 0;
|
|
var status = zlib_inflate.inflateInit2(this.strm, opt.windowBits);
|
|
if (status !== c.Z_OK) {
|
|
throw new Error(msg[status]);
|
|
}
|
|
this.header = new GZheader();
|
|
zlib_inflate.inflateGetHeader(this.strm, this.header);
|
|
if (opt.dictionary) {
|
|
if (typeof opt.dictionary === "string") {
|
|
opt.dictionary = strings.string2buf(opt.dictionary);
|
|
} else if (toString.call(opt.dictionary) === "[object ArrayBuffer]") {
|
|
opt.dictionary = new Uint8Array(opt.dictionary);
|
|
}
|
|
if (opt.raw) {
|
|
status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);
|
|
if (status !== c.Z_OK) {
|
|
throw new Error(msg[status]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Inflate.prototype.push = function(data, mode) {
|
|
var strm = this.strm;
|
|
var chunkSize = this.options.chunkSize;
|
|
var dictionary = this.options.dictionary;
|
|
var status, _mode;
|
|
var next_out_utf8, tail, utf8str;
|
|
var allowBufError = false;
|
|
if (this.ended) {
|
|
return false;
|
|
}
|
|
_mode = mode === ~~mode ? mode : mode === true ? c.Z_FINISH : c.Z_NO_FLUSH;
|
|
if (typeof data === "string") {
|
|
strm.input = strings.binstring2buf(data);
|
|
} else if (toString.call(data) === "[object ArrayBuffer]") {
|
|
strm.input = new Uint8Array(data);
|
|
} else {
|
|
strm.input = data;
|
|
}
|
|
strm.next_in = 0;
|
|
strm.avail_in = strm.input.length;
|
|
do {
|
|
if (strm.avail_out === 0) {
|
|
strm.output = new utils.Buf8(chunkSize);
|
|
strm.next_out = 0;
|
|
strm.avail_out = chunkSize;
|
|
}
|
|
status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH);
|
|
if (status === c.Z_NEED_DICT && dictionary) {
|
|
status = zlib_inflate.inflateSetDictionary(this.strm, dictionary);
|
|
}
|
|
if (status === c.Z_BUF_ERROR && allowBufError === true) {
|
|
status = c.Z_OK;
|
|
allowBufError = false;
|
|
}
|
|
if (status !== c.Z_STREAM_END && status !== c.Z_OK) {
|
|
this.onEnd(status);
|
|
this.ended = true;
|
|
return false;
|
|
}
|
|
if (strm.next_out) {
|
|
if (strm.avail_out === 0 || status === c.Z_STREAM_END || strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH)) {
|
|
if (this.options.to === "string") {
|
|
next_out_utf8 = strings.utf8border(strm.output, strm.next_out);
|
|
tail = strm.next_out - next_out_utf8;
|
|
utf8str = strings.buf2string(strm.output, next_out_utf8);
|
|
strm.next_out = tail;
|
|
strm.avail_out = chunkSize - tail;
|
|
if (tail) {
|
|
utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0);
|
|
}
|
|
this.onData(utf8str);
|
|
} else {
|
|
this.onData(utils.shrinkBuf(strm.output, strm.next_out));
|
|
}
|
|
}
|
|
}
|
|
if (strm.avail_in === 0 && strm.avail_out === 0) {
|
|
allowBufError = true;
|
|
}
|
|
} while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);
|
|
if (status === c.Z_STREAM_END) {
|
|
_mode = c.Z_FINISH;
|
|
}
|
|
if (_mode === c.Z_FINISH) {
|
|
status = zlib_inflate.inflateEnd(this.strm);
|
|
this.onEnd(status);
|
|
this.ended = true;
|
|
return status === c.Z_OK;
|
|
}
|
|
if (_mode === c.Z_SYNC_FLUSH) {
|
|
this.onEnd(c.Z_OK);
|
|
strm.avail_out = 0;
|
|
return true;
|
|
}
|
|
return true;
|
|
};
|
|
Inflate.prototype.onData = function(chunk) {
|
|
this.chunks.push(chunk);
|
|
};
|
|
Inflate.prototype.onEnd = function(status) {
|
|
if (status === c.Z_OK) {
|
|
if (this.options.to === "string") {
|
|
this.result = this.chunks.join("");
|
|
} else {
|
|
this.result = utils.flattenChunks(this.chunks);
|
|
}
|
|
}
|
|
this.chunks = [];
|
|
this.err = status;
|
|
this.msg = this.strm.msg;
|
|
};
|
|
function inflate(input, options) {
|
|
var inflator = new Inflate(options);
|
|
inflator.push(input, true);
|
|
if (inflator.err) {
|
|
throw inflator.msg || msg[inflator.err];
|
|
}
|
|
return inflator.result;
|
|
}
|
|
function inflateRaw(input, options) {
|
|
options = options || {};
|
|
options.raw = true;
|
|
return inflate(input, options);
|
|
}
|
|
exports3.Inflate = Inflate;
|
|
exports3.inflate = inflate;
|
|
exports3.inflateRaw = inflateRaw;
|
|
exports3.ungzip = inflate;
|
|
}, { "./utils/common": 5, "./utils/strings": 6, "./zlib/constants": 8, "./zlib/gzheader": 10, "./zlib/inflate": 12, "./zlib/messages": 14, "./zlib/zstream": 15 }], 5: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
var TYPED_OK = typeof Uint8Array !== "undefined" && typeof Uint16Array !== "undefined" && typeof Int32Array !== "undefined";
|
|
function _has(obj, key) {
|
|
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
}
|
|
exports3.assign = function(obj) {
|
|
var sources = Array.prototype.slice.call(arguments, 1);
|
|
while (sources.length) {
|
|
var source = sources.shift();
|
|
if (!source) {
|
|
continue;
|
|
}
|
|
if (typeof source !== "object") {
|
|
throw new TypeError(source + "must be non-object");
|
|
}
|
|
for (var p in source) {
|
|
if (_has(source, p)) {
|
|
obj[p] = source[p];
|
|
}
|
|
}
|
|
}
|
|
return obj;
|
|
};
|
|
exports3.shrinkBuf = function(buf, size) {
|
|
if (buf.length === size) {
|
|
return buf;
|
|
}
|
|
if (buf.subarray) {
|
|
return buf.subarray(0, size);
|
|
}
|
|
buf.length = size;
|
|
return buf;
|
|
};
|
|
var fnTyped = {
|
|
arraySet: function(dest, src, src_offs, len, dest_offs) {
|
|
if (src.subarray && dest.subarray) {
|
|
dest.set(src.subarray(src_offs, src_offs + len), dest_offs);
|
|
return;
|
|
}
|
|
for (var i = 0; i < len; i++) {
|
|
dest[dest_offs + i] = src[src_offs + i];
|
|
}
|
|
},
|
|
flattenChunks: function(chunks) {
|
|
var i, l, len, pos, chunk, result;
|
|
len = 0;
|
|
for (i = 0, l = chunks.length; i < l; i++) {
|
|
len += chunks[i].length;
|
|
}
|
|
result = new Uint8Array(len);
|
|
pos = 0;
|
|
for (i = 0, l = chunks.length; i < l; i++) {
|
|
chunk = chunks[i];
|
|
result.set(chunk, pos);
|
|
pos += chunk.length;
|
|
}
|
|
return result;
|
|
}
|
|
};
|
|
var fnUntyped = {
|
|
arraySet: function(dest, src, src_offs, len, dest_offs) {
|
|
for (var i = 0; i < len; i++) {
|
|
dest[dest_offs + i] = src[src_offs + i];
|
|
}
|
|
},
|
|
flattenChunks: function(chunks) {
|
|
return [].concat.apply([], chunks);
|
|
}
|
|
};
|
|
exports3.setTyped = function(on) {
|
|
if (on) {
|
|
exports3.Buf8 = Uint8Array;
|
|
exports3.Buf16 = Uint16Array;
|
|
exports3.Buf32 = Int32Array;
|
|
exports3.assign(exports3, fnTyped);
|
|
} else {
|
|
exports3.Buf8 = Array;
|
|
exports3.Buf16 = Array;
|
|
exports3.Buf32 = Array;
|
|
exports3.assign(exports3, fnUntyped);
|
|
}
|
|
};
|
|
exports3.setTyped(TYPED_OK);
|
|
}, {}], 6: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
var utils = require2("./common");
|
|
var STR_APPLY_OK = true;
|
|
var STR_APPLY_UIA_OK = true;
|
|
try {
|
|
String.fromCharCode.apply(null, [0]);
|
|
} catch (__) {
|
|
STR_APPLY_OK = false;
|
|
}
|
|
try {
|
|
String.fromCharCode.apply(null, new Uint8Array(1));
|
|
} catch (__) {
|
|
STR_APPLY_UIA_OK = false;
|
|
}
|
|
var _utf8len = new utils.Buf8(256);
|
|
for (var q = 0; q < 256; q++) {
|
|
_utf8len[q] = q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1;
|
|
}
|
|
_utf8len[254] = _utf8len[254] = 1;
|
|
exports3.string2buf = function(str) {
|
|
var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;
|
|
for (m_pos = 0; m_pos < str_len; m_pos++) {
|
|
c = str.charCodeAt(m_pos);
|
|
if ((c & 64512) === 55296 && m_pos + 1 < str_len) {
|
|
c2 = str.charCodeAt(m_pos + 1);
|
|
if ((c2 & 64512) === 56320) {
|
|
c = 65536 + (c - 55296 << 10) + (c2 - 56320);
|
|
m_pos++;
|
|
}
|
|
}
|
|
buf_len += c < 128 ? 1 : c < 2048 ? 2 : c < 65536 ? 3 : 4;
|
|
}
|
|
buf = new utils.Buf8(buf_len);
|
|
for (i = 0, m_pos = 0; i < buf_len; m_pos++) {
|
|
c = str.charCodeAt(m_pos);
|
|
if ((c & 64512) === 55296 && m_pos + 1 < str_len) {
|
|
c2 = str.charCodeAt(m_pos + 1);
|
|
if ((c2 & 64512) === 56320) {
|
|
c = 65536 + (c - 55296 << 10) + (c2 - 56320);
|
|
m_pos++;
|
|
}
|
|
}
|
|
if (c < 128) {
|
|
buf[i++] = c;
|
|
} else if (c < 2048) {
|
|
buf[i++] = 192 | c >>> 6;
|
|
buf[i++] = 128 | c & 63;
|
|
} else if (c < 65536) {
|
|
buf[i++] = 224 | c >>> 12;
|
|
buf[i++] = 128 | c >>> 6 & 63;
|
|
buf[i++] = 128 | c & 63;
|
|
} else {
|
|
buf[i++] = 240 | c >>> 18;
|
|
buf[i++] = 128 | c >>> 12 & 63;
|
|
buf[i++] = 128 | c >>> 6 & 63;
|
|
buf[i++] = 128 | c & 63;
|
|
}
|
|
}
|
|
return buf;
|
|
};
|
|
function buf2binstring(buf, len) {
|
|
if (len < 65534) {
|
|
if (buf.subarray && STR_APPLY_UIA_OK || !buf.subarray && STR_APPLY_OK) {
|
|
return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));
|
|
}
|
|
}
|
|
var result = "";
|
|
for (var i = 0; i < len; i++) {
|
|
result += String.fromCharCode(buf[i]);
|
|
}
|
|
return result;
|
|
}
|
|
exports3.buf2binstring = function(buf) {
|
|
return buf2binstring(buf, buf.length);
|
|
};
|
|
exports3.binstring2buf = function(str) {
|
|
var buf = new utils.Buf8(str.length);
|
|
for (var i = 0, len = buf.length; i < len; i++) {
|
|
buf[i] = str.charCodeAt(i);
|
|
}
|
|
return buf;
|
|
};
|
|
exports3.buf2string = function(buf, max) {
|
|
var i, out, c, c_len;
|
|
var len = max || buf.length;
|
|
var utf16buf = new Array(len * 2);
|
|
for (out = 0, i = 0; i < len; ) {
|
|
c = buf[i++];
|
|
if (c < 128) {
|
|
utf16buf[out++] = c;
|
|
continue;
|
|
}
|
|
c_len = _utf8len[c];
|
|
if (c_len > 4) {
|
|
utf16buf[out++] = 65533;
|
|
i += c_len - 1;
|
|
continue;
|
|
}
|
|
c &= c_len === 2 ? 31 : c_len === 3 ? 15 : 7;
|
|
while (c_len > 1 && i < len) {
|
|
c = c << 6 | buf[i++] & 63;
|
|
c_len--;
|
|
}
|
|
if (c_len > 1) {
|
|
utf16buf[out++] = 65533;
|
|
continue;
|
|
}
|
|
if (c < 65536) {
|
|
utf16buf[out++] = c;
|
|
} else {
|
|
c -= 65536;
|
|
utf16buf[out++] = 55296 | c >> 10 & 1023;
|
|
utf16buf[out++] = 56320 | c & 1023;
|
|
}
|
|
}
|
|
return buf2binstring(utf16buf, out);
|
|
};
|
|
exports3.utf8border = function(buf, max) {
|
|
var pos;
|
|
max = max || buf.length;
|
|
if (max > buf.length) {
|
|
max = buf.length;
|
|
}
|
|
pos = max - 1;
|
|
while (pos >= 0 && (buf[pos] & 192) === 128) {
|
|
pos--;
|
|
}
|
|
if (pos < 0) {
|
|
return max;
|
|
}
|
|
if (pos === 0) {
|
|
return max;
|
|
}
|
|
return pos + _utf8len[buf[pos]] > max ? pos : max;
|
|
};
|
|
}, { "./common": 5 }], 7: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
function adler32(adler, buf, len, pos) {
|
|
var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0;
|
|
while (len !== 0) {
|
|
n = len > 2e3 ? 2e3 : len;
|
|
len -= n;
|
|
do {
|
|
s1 = s1 + buf[pos++] | 0;
|
|
s2 = s2 + s1 | 0;
|
|
} while (--n);
|
|
s1 %= 65521;
|
|
s2 %= 65521;
|
|
}
|
|
return s1 | s2 << 16 | 0;
|
|
}
|
|
module4.exports = adler32;
|
|
}, {}], 8: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
module4.exports = {
|
|
Z_NO_FLUSH: 0,
|
|
Z_PARTIAL_FLUSH: 1,
|
|
Z_SYNC_FLUSH: 2,
|
|
Z_FULL_FLUSH: 3,
|
|
Z_FINISH: 4,
|
|
Z_BLOCK: 5,
|
|
Z_TREES: 6,
|
|
Z_OK: 0,
|
|
Z_STREAM_END: 1,
|
|
Z_NEED_DICT: 2,
|
|
Z_ERRNO: -1,
|
|
Z_STREAM_ERROR: -2,
|
|
Z_DATA_ERROR: -3,
|
|
Z_BUF_ERROR: -5,
|
|
Z_NO_COMPRESSION: 0,
|
|
Z_BEST_SPEED: 1,
|
|
Z_BEST_COMPRESSION: 9,
|
|
Z_DEFAULT_COMPRESSION: -1,
|
|
Z_FILTERED: 1,
|
|
Z_HUFFMAN_ONLY: 2,
|
|
Z_RLE: 3,
|
|
Z_FIXED: 4,
|
|
Z_DEFAULT_STRATEGY: 0,
|
|
Z_BINARY: 0,
|
|
Z_TEXT: 1,
|
|
Z_UNKNOWN: 2,
|
|
Z_DEFLATED: 8
|
|
};
|
|
}, {}], 9: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
function makeTable() {
|
|
var c, table = [];
|
|
for (var n = 0; n < 256; n++) {
|
|
c = n;
|
|
for (var k = 0; k < 8; k++) {
|
|
c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
}
|
|
table[n] = c;
|
|
}
|
|
return table;
|
|
}
|
|
var crcTable = makeTable();
|
|
function crc32(crc, buf, len, pos) {
|
|
var t = crcTable, end = pos + len;
|
|
crc ^= -1;
|
|
for (var i = pos; i < end; i++) {
|
|
crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];
|
|
}
|
|
return crc ^ -1;
|
|
}
|
|
module4.exports = crc32;
|
|
}, {}], 10: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
function GZheader() {
|
|
this.text = 0;
|
|
this.time = 0;
|
|
this.xflags = 0;
|
|
this.os = 0;
|
|
this.extra = null;
|
|
this.extra_len = 0;
|
|
this.name = "";
|
|
this.comment = "";
|
|
this.hcrc = 0;
|
|
this.done = false;
|
|
}
|
|
module4.exports = GZheader;
|
|
}, {}], 11: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
var BAD = 30;
|
|
var TYPE = 12;
|
|
module4.exports = function inflate_fast(strm, start) {
|
|
var state;
|
|
var _in;
|
|
var last;
|
|
var _out;
|
|
var beg;
|
|
var end;
|
|
var dmax;
|
|
var wsize;
|
|
var whave;
|
|
var wnext;
|
|
var s_window;
|
|
var hold;
|
|
var bits;
|
|
var lcode;
|
|
var dcode;
|
|
var lmask;
|
|
var dmask;
|
|
var here;
|
|
var op;
|
|
var len;
|
|
var dist;
|
|
var from;
|
|
var from_source;
|
|
var input, output;
|
|
state = strm.state;
|
|
_in = strm.next_in;
|
|
input = strm.input;
|
|
last = _in + (strm.avail_in - 5);
|
|
_out = strm.next_out;
|
|
output = strm.output;
|
|
beg = _out - (start - strm.avail_out);
|
|
end = _out + (strm.avail_out - 257);
|
|
dmax = state.dmax;
|
|
wsize = state.wsize;
|
|
whave = state.whave;
|
|
wnext = state.wnext;
|
|
s_window = state.window;
|
|
hold = state.hold;
|
|
bits = state.bits;
|
|
lcode = state.lencode;
|
|
dcode = state.distcode;
|
|
lmask = (1 << state.lenbits) - 1;
|
|
dmask = (1 << state.distbits) - 1;
|
|
top:
|
|
do {
|
|
if (bits < 15) {
|
|
hold += input[_in++] << bits;
|
|
bits += 8;
|
|
hold += input[_in++] << bits;
|
|
bits += 8;
|
|
}
|
|
here = lcode[hold & lmask];
|
|
dolen:
|
|
for (; ; ) {
|
|
op = here >>> 24;
|
|
hold >>>= op;
|
|
bits -= op;
|
|
op = here >>> 16 & 255;
|
|
if (op === 0) {
|
|
output[_out++] = here & 65535;
|
|
} else if (op & 16) {
|
|
len = here & 65535;
|
|
op &= 15;
|
|
if (op) {
|
|
if (bits < op) {
|
|
hold += input[_in++] << bits;
|
|
bits += 8;
|
|
}
|
|
len += hold & (1 << op) - 1;
|
|
hold >>>= op;
|
|
bits -= op;
|
|
}
|
|
if (bits < 15) {
|
|
hold += input[_in++] << bits;
|
|
bits += 8;
|
|
hold += input[_in++] << bits;
|
|
bits += 8;
|
|
}
|
|
here = dcode[hold & dmask];
|
|
dodist:
|
|
for (; ; ) {
|
|
op = here >>> 24;
|
|
hold >>>= op;
|
|
bits -= op;
|
|
op = here >>> 16 & 255;
|
|
if (op & 16) {
|
|
dist = here & 65535;
|
|
op &= 15;
|
|
if (bits < op) {
|
|
hold += input[_in++] << bits;
|
|
bits += 8;
|
|
if (bits < op) {
|
|
hold += input[_in++] << bits;
|
|
bits += 8;
|
|
}
|
|
}
|
|
dist += hold & (1 << op) - 1;
|
|
if (dist > dmax) {
|
|
strm.msg = "invalid distance too far back";
|
|
state.mode = BAD;
|
|
break top;
|
|
}
|
|
hold >>>= op;
|
|
bits -= op;
|
|
op = _out - beg;
|
|
if (dist > op) {
|
|
op = dist - op;
|
|
if (op > whave) {
|
|
if (state.sane) {
|
|
strm.msg = "invalid distance too far back";
|
|
state.mode = BAD;
|
|
break top;
|
|
}
|
|
}
|
|
from = 0;
|
|
from_source = s_window;
|
|
if (wnext === 0) {
|
|
from += wsize - op;
|
|
if (op < len) {
|
|
len -= op;
|
|
do {
|
|
output[_out++] = s_window[from++];
|
|
} while (--op);
|
|
from = _out - dist;
|
|
from_source = output;
|
|
}
|
|
} else if (wnext < op) {
|
|
from += wsize + wnext - op;
|
|
op -= wnext;
|
|
if (op < len) {
|
|
len -= op;
|
|
do {
|
|
output[_out++] = s_window[from++];
|
|
} while (--op);
|
|
from = 0;
|
|
if (wnext < len) {
|
|
op = wnext;
|
|
len -= op;
|
|
do {
|
|
output[_out++] = s_window[from++];
|
|
} while (--op);
|
|
from = _out - dist;
|
|
from_source = output;
|
|
}
|
|
}
|
|
} else {
|
|
from += wnext - op;
|
|
if (op < len) {
|
|
len -= op;
|
|
do {
|
|
output[_out++] = s_window[from++];
|
|
} while (--op);
|
|
from = _out - dist;
|
|
from_source = output;
|
|
}
|
|
}
|
|
while (len > 2) {
|
|
output[_out++] = from_source[from++];
|
|
output[_out++] = from_source[from++];
|
|
output[_out++] = from_source[from++];
|
|
len -= 3;
|
|
}
|
|
if (len) {
|
|
output[_out++] = from_source[from++];
|
|
if (len > 1) {
|
|
output[_out++] = from_source[from++];
|
|
}
|
|
}
|
|
} else {
|
|
from = _out - dist;
|
|
do {
|
|
output[_out++] = output[from++];
|
|
output[_out++] = output[from++];
|
|
output[_out++] = output[from++];
|
|
len -= 3;
|
|
} while (len > 2);
|
|
if (len) {
|
|
output[_out++] = output[from++];
|
|
if (len > 1) {
|
|
output[_out++] = output[from++];
|
|
}
|
|
}
|
|
}
|
|
} else if ((op & 64) === 0) {
|
|
here = dcode[(here & 65535) + (hold & (1 << op) - 1)];
|
|
continue dodist;
|
|
} else {
|
|
strm.msg = "invalid distance code";
|
|
state.mode = BAD;
|
|
break top;
|
|
}
|
|
break;
|
|
}
|
|
} else if ((op & 64) === 0) {
|
|
here = lcode[(here & 65535) + (hold & (1 << op) - 1)];
|
|
continue dolen;
|
|
} else if (op & 32) {
|
|
state.mode = TYPE;
|
|
break top;
|
|
} else {
|
|
strm.msg = "invalid literal/length code";
|
|
state.mode = BAD;
|
|
break top;
|
|
}
|
|
break;
|
|
}
|
|
} while (_in < last && _out < end);
|
|
len = bits >> 3;
|
|
_in -= len;
|
|
bits -= len << 3;
|
|
hold &= (1 << bits) - 1;
|
|
strm.next_in = _in;
|
|
strm.next_out = _out;
|
|
strm.avail_in = _in < last ? 5 + (last - _in) : 5 - (_in - last);
|
|
strm.avail_out = _out < end ? 257 + (end - _out) : 257 - (_out - end);
|
|
state.hold = hold;
|
|
state.bits = bits;
|
|
return;
|
|
};
|
|
}, {}], 12: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
var utils = require2("../utils/common");
|
|
var adler32 = require2("./adler32");
|
|
var crc32 = require2("./crc32");
|
|
var inflate_fast = require2("./inffast");
|
|
var inflate_table = require2("./inftrees");
|
|
var CODES = 0;
|
|
var LENS = 1;
|
|
var DISTS = 2;
|
|
var Z_FINISH = 4;
|
|
var Z_BLOCK = 5;
|
|
var Z_TREES = 6;
|
|
var Z_OK = 0;
|
|
var Z_STREAM_END = 1;
|
|
var Z_NEED_DICT = 2;
|
|
var Z_STREAM_ERROR = -2;
|
|
var Z_DATA_ERROR = -3;
|
|
var Z_MEM_ERROR = -4;
|
|
var Z_BUF_ERROR = -5;
|
|
var Z_DEFLATED = 8;
|
|
var HEAD = 1;
|
|
var FLAGS = 2;
|
|
var TIME = 3;
|
|
var OS = 4;
|
|
var EXLEN = 5;
|
|
var EXTRA = 6;
|
|
var NAME = 7;
|
|
var COMMENT = 8;
|
|
var HCRC = 9;
|
|
var DICTID = 10;
|
|
var DICT = 11;
|
|
var TYPE = 12;
|
|
var TYPEDO = 13;
|
|
var STORED = 14;
|
|
var COPY_ = 15;
|
|
var COPY = 16;
|
|
var TABLE = 17;
|
|
var LENLENS = 18;
|
|
var CODELENS = 19;
|
|
var LEN_ = 20;
|
|
var LEN = 21;
|
|
var LENEXT = 22;
|
|
var DIST = 23;
|
|
var DISTEXT = 24;
|
|
var MATCH = 25;
|
|
var LIT = 26;
|
|
var CHECK = 27;
|
|
var LENGTH = 28;
|
|
var DONE = 29;
|
|
var BAD = 30;
|
|
var MEM = 31;
|
|
var SYNC = 32;
|
|
var ENOUGH_LENS = 852;
|
|
var ENOUGH_DISTS = 592;
|
|
var MAX_WBITS = 15;
|
|
var DEF_WBITS = MAX_WBITS;
|
|
function zswap32(q) {
|
|
return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24);
|
|
}
|
|
function InflateState() {
|
|
this.mode = 0;
|
|
this.last = false;
|
|
this.wrap = 0;
|
|
this.havedict = false;
|
|
this.flags = 0;
|
|
this.dmax = 0;
|
|
this.check = 0;
|
|
this.total = 0;
|
|
this.head = null;
|
|
this.wbits = 0;
|
|
this.wsize = 0;
|
|
this.whave = 0;
|
|
this.wnext = 0;
|
|
this.window = null;
|
|
this.hold = 0;
|
|
this.bits = 0;
|
|
this.length = 0;
|
|
this.offset = 0;
|
|
this.extra = 0;
|
|
this.lencode = null;
|
|
this.distcode = null;
|
|
this.lenbits = 0;
|
|
this.distbits = 0;
|
|
this.ncode = 0;
|
|
this.nlen = 0;
|
|
this.ndist = 0;
|
|
this.have = 0;
|
|
this.next = null;
|
|
this.lens = new utils.Buf16(320);
|
|
this.work = new utils.Buf16(288);
|
|
this.lendyn = null;
|
|
this.distdyn = null;
|
|
this.sane = 0;
|
|
this.back = 0;
|
|
this.was = 0;
|
|
}
|
|
function inflateResetKeep(strm) {
|
|
var state;
|
|
if (!strm || !strm.state) {
|
|
return Z_STREAM_ERROR;
|
|
}
|
|
state = strm.state;
|
|
strm.total_in = strm.total_out = state.total = 0;
|
|
strm.msg = "";
|
|
if (state.wrap) {
|
|
strm.adler = state.wrap & 1;
|
|
}
|
|
state.mode = HEAD;
|
|
state.last = 0;
|
|
state.havedict = 0;
|
|
state.dmax = 32768;
|
|
state.head = null;
|
|
state.hold = 0;
|
|
state.bits = 0;
|
|
state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);
|
|
state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);
|
|
state.sane = 1;
|
|
state.back = -1;
|
|
return Z_OK;
|
|
}
|
|
function inflateReset(strm) {
|
|
var state;
|
|
if (!strm || !strm.state) {
|
|
return Z_STREAM_ERROR;
|
|
}
|
|
state = strm.state;
|
|
state.wsize = 0;
|
|
state.whave = 0;
|
|
state.wnext = 0;
|
|
return inflateResetKeep(strm);
|
|
}
|
|
function inflateReset2(strm, windowBits) {
|
|
var wrap;
|
|
var state;
|
|
if (!strm || !strm.state) {
|
|
return Z_STREAM_ERROR;
|
|
}
|
|
state = strm.state;
|
|
if (windowBits < 0) {
|
|
wrap = 0;
|
|
windowBits = -windowBits;
|
|
} else {
|
|
wrap = (windowBits >> 4) + 1;
|
|
if (windowBits < 48) {
|
|
windowBits &= 15;
|
|
}
|
|
}
|
|
if (windowBits && (windowBits < 8 || windowBits > 15)) {
|
|
return Z_STREAM_ERROR;
|
|
}
|
|
if (state.window !== null && state.wbits !== windowBits) {
|
|
state.window = null;
|
|
}
|
|
state.wrap = wrap;
|
|
state.wbits = windowBits;
|
|
return inflateReset(strm);
|
|
}
|
|
function inflateInit2(strm, windowBits) {
|
|
var ret;
|
|
var state;
|
|
if (!strm) {
|
|
return Z_STREAM_ERROR;
|
|
}
|
|
state = new InflateState();
|
|
strm.state = state;
|
|
state.window = null;
|
|
ret = inflateReset2(strm, windowBits);
|
|
if (ret !== Z_OK) {
|
|
strm.state = null;
|
|
}
|
|
return ret;
|
|
}
|
|
function inflateInit(strm) {
|
|
return inflateInit2(strm, DEF_WBITS);
|
|
}
|
|
var virgin = true;
|
|
var lenfix, distfix;
|
|
function fixedtables(state) {
|
|
if (virgin) {
|
|
var sym;
|
|
lenfix = new utils.Buf32(512);
|
|
distfix = new utils.Buf32(32);
|
|
sym = 0;
|
|
while (sym < 144) {
|
|
state.lens[sym++] = 8;
|
|
}
|
|
while (sym < 256) {
|
|
state.lens[sym++] = 9;
|
|
}
|
|
while (sym < 280) {
|
|
state.lens[sym++] = 7;
|
|
}
|
|
while (sym < 288) {
|
|
state.lens[sym++] = 8;
|
|
}
|
|
inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });
|
|
sym = 0;
|
|
while (sym < 32) {
|
|
state.lens[sym++] = 5;
|
|
}
|
|
inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });
|
|
virgin = false;
|
|
}
|
|
state.lencode = lenfix;
|
|
state.lenbits = 9;
|
|
state.distcode = distfix;
|
|
state.distbits = 5;
|
|
}
|
|
function updatewindow(strm, src, end, copy) {
|
|
var dist;
|
|
var state = strm.state;
|
|
if (state.window === null) {
|
|
state.wsize = 1 << state.wbits;
|
|
state.wnext = 0;
|
|
state.whave = 0;
|
|
state.window = new utils.Buf8(state.wsize);
|
|
}
|
|
if (copy >= state.wsize) {
|
|
utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);
|
|
state.wnext = 0;
|
|
state.whave = state.wsize;
|
|
} else {
|
|
dist = state.wsize - state.wnext;
|
|
if (dist > copy) {
|
|
dist = copy;
|
|
}
|
|
utils.arraySet(state.window, src, end - copy, dist, state.wnext);
|
|
copy -= dist;
|
|
if (copy) {
|
|
utils.arraySet(state.window, src, end - copy, copy, 0);
|
|
state.wnext = copy;
|
|
state.whave = state.wsize;
|
|
} else {
|
|
state.wnext += dist;
|
|
if (state.wnext === state.wsize) {
|
|
state.wnext = 0;
|
|
}
|
|
if (state.whave < state.wsize) {
|
|
state.whave += dist;
|
|
}
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
function inflate(strm, flush) {
|
|
var state;
|
|
var input, output;
|
|
var next;
|
|
var put;
|
|
var have, left;
|
|
var hold;
|
|
var bits;
|
|
var _in, _out;
|
|
var copy;
|
|
var from;
|
|
var from_source;
|
|
var here = 0;
|
|
var here_bits, here_op, here_val;
|
|
var last_bits, last_op, last_val;
|
|
var len;
|
|
var ret;
|
|
var hbuf = new utils.Buf8(4);
|
|
var opts;
|
|
var n;
|
|
var order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
|
|
if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0) {
|
|
return Z_STREAM_ERROR;
|
|
}
|
|
state = strm.state;
|
|
if (state.mode === TYPE) {
|
|
state.mode = TYPEDO;
|
|
}
|
|
put = strm.next_out;
|
|
output = strm.output;
|
|
left = strm.avail_out;
|
|
next = strm.next_in;
|
|
input = strm.input;
|
|
have = strm.avail_in;
|
|
hold = state.hold;
|
|
bits = state.bits;
|
|
_in = have;
|
|
_out = left;
|
|
ret = Z_OK;
|
|
inf_leave:
|
|
for (; ; ) {
|
|
switch (state.mode) {
|
|
case HEAD:
|
|
if (state.wrap === 0) {
|
|
state.mode = TYPEDO;
|
|
break;
|
|
}
|
|
while (bits < 16) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
if (state.wrap & 2 && hold === 35615) {
|
|
state.check = 0;
|
|
hbuf[0] = hold & 255;
|
|
hbuf[1] = hold >>> 8 & 255;
|
|
state.check = crc32(state.check, hbuf, 2, 0);
|
|
hold = 0;
|
|
bits = 0;
|
|
state.mode = FLAGS;
|
|
break;
|
|
}
|
|
state.flags = 0;
|
|
if (state.head) {
|
|
state.head.done = false;
|
|
}
|
|
if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) {
|
|
strm.msg = "incorrect header check";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
if ((hold & 15) !== Z_DEFLATED) {
|
|
strm.msg = "unknown compression method";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
hold >>>= 4;
|
|
bits -= 4;
|
|
len = (hold & 15) + 8;
|
|
if (state.wbits === 0) {
|
|
state.wbits = len;
|
|
} else if (len > state.wbits) {
|
|
strm.msg = "invalid window size";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
state.dmax = 1 << len;
|
|
strm.adler = state.check = 1;
|
|
state.mode = hold & 512 ? DICTID : TYPE;
|
|
hold = 0;
|
|
bits = 0;
|
|
break;
|
|
case FLAGS:
|
|
while (bits < 16) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
state.flags = hold;
|
|
if ((state.flags & 255) !== Z_DEFLATED) {
|
|
strm.msg = "unknown compression method";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
if (state.flags & 57344) {
|
|
strm.msg = "unknown header flags set";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
if (state.head) {
|
|
state.head.text = hold >> 8 & 1;
|
|
}
|
|
if (state.flags & 512) {
|
|
hbuf[0] = hold & 255;
|
|
hbuf[1] = hold >>> 8 & 255;
|
|
state.check = crc32(state.check, hbuf, 2, 0);
|
|
}
|
|
hold = 0;
|
|
bits = 0;
|
|
state.mode = TIME;
|
|
case TIME:
|
|
while (bits < 32) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
if (state.head) {
|
|
state.head.time = hold;
|
|
}
|
|
if (state.flags & 512) {
|
|
hbuf[0] = hold & 255;
|
|
hbuf[1] = hold >>> 8 & 255;
|
|
hbuf[2] = hold >>> 16 & 255;
|
|
hbuf[3] = hold >>> 24 & 255;
|
|
state.check = crc32(state.check, hbuf, 4, 0);
|
|
}
|
|
hold = 0;
|
|
bits = 0;
|
|
state.mode = OS;
|
|
case OS:
|
|
while (bits < 16) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
if (state.head) {
|
|
state.head.xflags = hold & 255;
|
|
state.head.os = hold >> 8;
|
|
}
|
|
if (state.flags & 512) {
|
|
hbuf[0] = hold & 255;
|
|
hbuf[1] = hold >>> 8 & 255;
|
|
state.check = crc32(state.check, hbuf, 2, 0);
|
|
}
|
|
hold = 0;
|
|
bits = 0;
|
|
state.mode = EXLEN;
|
|
case EXLEN:
|
|
if (state.flags & 1024) {
|
|
while (bits < 16) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
state.length = hold;
|
|
if (state.head) {
|
|
state.head.extra_len = hold;
|
|
}
|
|
if (state.flags & 512) {
|
|
hbuf[0] = hold & 255;
|
|
hbuf[1] = hold >>> 8 & 255;
|
|
state.check = crc32(state.check, hbuf, 2, 0);
|
|
}
|
|
hold = 0;
|
|
bits = 0;
|
|
} else if (state.head) {
|
|
state.head.extra = null;
|
|
}
|
|
state.mode = EXTRA;
|
|
case EXTRA:
|
|
if (state.flags & 1024) {
|
|
copy = state.length;
|
|
if (copy > have) {
|
|
copy = have;
|
|
}
|
|
if (copy) {
|
|
if (state.head) {
|
|
len = state.head.extra_len - state.length;
|
|
if (!state.head.extra) {
|
|
state.head.extra = new Array(state.head.extra_len);
|
|
}
|
|
utils.arraySet(state.head.extra, input, next, copy, len);
|
|
}
|
|
if (state.flags & 512) {
|
|
state.check = crc32(state.check, input, copy, next);
|
|
}
|
|
have -= copy;
|
|
next += copy;
|
|
state.length -= copy;
|
|
}
|
|
if (state.length) {
|
|
break inf_leave;
|
|
}
|
|
}
|
|
state.length = 0;
|
|
state.mode = NAME;
|
|
case NAME:
|
|
if (state.flags & 2048) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
copy = 0;
|
|
do {
|
|
len = input[next + copy++];
|
|
if (state.head && len && state.length < 65536) {
|
|
state.head.name += String.fromCharCode(len);
|
|
}
|
|
} while (len && copy < have);
|
|
if (state.flags & 512) {
|
|
state.check = crc32(state.check, input, copy, next);
|
|
}
|
|
have -= copy;
|
|
next += copy;
|
|
if (len) {
|
|
break inf_leave;
|
|
}
|
|
} else if (state.head) {
|
|
state.head.name = null;
|
|
}
|
|
state.length = 0;
|
|
state.mode = COMMENT;
|
|
case COMMENT:
|
|
if (state.flags & 4096) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
copy = 0;
|
|
do {
|
|
len = input[next + copy++];
|
|
if (state.head && len && state.length < 65536) {
|
|
state.head.comment += String.fromCharCode(len);
|
|
}
|
|
} while (len && copy < have);
|
|
if (state.flags & 512) {
|
|
state.check = crc32(state.check, input, copy, next);
|
|
}
|
|
have -= copy;
|
|
next += copy;
|
|
if (len) {
|
|
break inf_leave;
|
|
}
|
|
} else if (state.head) {
|
|
state.head.comment = null;
|
|
}
|
|
state.mode = HCRC;
|
|
case HCRC:
|
|
if (state.flags & 512) {
|
|
while (bits < 16) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
if (hold !== (state.check & 65535)) {
|
|
strm.msg = "header crc mismatch";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
hold = 0;
|
|
bits = 0;
|
|
}
|
|
if (state.head) {
|
|
state.head.hcrc = state.flags >> 9 & 1;
|
|
state.head.done = true;
|
|
}
|
|
strm.adler = state.check = 0;
|
|
state.mode = TYPE;
|
|
break;
|
|
case DICTID:
|
|
while (bits < 32) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
strm.adler = state.check = zswap32(hold);
|
|
hold = 0;
|
|
bits = 0;
|
|
state.mode = DICT;
|
|
case DICT:
|
|
if (state.havedict === 0) {
|
|
strm.next_out = put;
|
|
strm.avail_out = left;
|
|
strm.next_in = next;
|
|
strm.avail_in = have;
|
|
state.hold = hold;
|
|
state.bits = bits;
|
|
return Z_NEED_DICT;
|
|
}
|
|
strm.adler = state.check = 1;
|
|
state.mode = TYPE;
|
|
case TYPE:
|
|
if (flush === Z_BLOCK || flush === Z_TREES) {
|
|
break inf_leave;
|
|
}
|
|
case TYPEDO:
|
|
if (state.last) {
|
|
hold >>>= bits & 7;
|
|
bits -= bits & 7;
|
|
state.mode = CHECK;
|
|
break;
|
|
}
|
|
while (bits < 3) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
state.last = hold & 1;
|
|
hold >>>= 1;
|
|
bits -= 1;
|
|
switch (hold & 3) {
|
|
case 0:
|
|
state.mode = STORED;
|
|
break;
|
|
case 1:
|
|
fixedtables(state);
|
|
state.mode = LEN_;
|
|
if (flush === Z_TREES) {
|
|
hold >>>= 2;
|
|
bits -= 2;
|
|
break inf_leave;
|
|
}
|
|
break;
|
|
case 2:
|
|
state.mode = TABLE;
|
|
break;
|
|
case 3:
|
|
strm.msg = "invalid block type";
|
|
state.mode = BAD;
|
|
}
|
|
hold >>>= 2;
|
|
bits -= 2;
|
|
break;
|
|
case STORED:
|
|
hold >>>= bits & 7;
|
|
bits -= bits & 7;
|
|
while (bits < 32) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
if ((hold & 65535) !== (hold >>> 16 ^ 65535)) {
|
|
strm.msg = "invalid stored block lengths";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
state.length = hold & 65535;
|
|
hold = 0;
|
|
bits = 0;
|
|
state.mode = COPY_;
|
|
if (flush === Z_TREES) {
|
|
break inf_leave;
|
|
}
|
|
case COPY_:
|
|
state.mode = COPY;
|
|
case COPY:
|
|
copy = state.length;
|
|
if (copy) {
|
|
if (copy > have) {
|
|
copy = have;
|
|
}
|
|
if (copy > left) {
|
|
copy = left;
|
|
}
|
|
if (copy === 0) {
|
|
break inf_leave;
|
|
}
|
|
utils.arraySet(output, input, next, copy, put);
|
|
have -= copy;
|
|
next += copy;
|
|
left -= copy;
|
|
put += copy;
|
|
state.length -= copy;
|
|
break;
|
|
}
|
|
state.mode = TYPE;
|
|
break;
|
|
case TABLE:
|
|
while (bits < 14) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
state.nlen = (hold & 31) + 257;
|
|
hold >>>= 5;
|
|
bits -= 5;
|
|
state.ndist = (hold & 31) + 1;
|
|
hold >>>= 5;
|
|
bits -= 5;
|
|
state.ncode = (hold & 15) + 4;
|
|
hold >>>= 4;
|
|
bits -= 4;
|
|
if (state.nlen > 286 || state.ndist > 30) {
|
|
strm.msg = "too many length or distance symbols";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
state.have = 0;
|
|
state.mode = LENLENS;
|
|
case LENLENS:
|
|
while (state.have < state.ncode) {
|
|
while (bits < 3) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
state.lens[order[state.have++]] = hold & 7;
|
|
hold >>>= 3;
|
|
bits -= 3;
|
|
}
|
|
while (state.have < 19) {
|
|
state.lens[order[state.have++]] = 0;
|
|
}
|
|
state.lencode = state.lendyn;
|
|
state.lenbits = 7;
|
|
opts = { bits: state.lenbits };
|
|
ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
|
|
state.lenbits = opts.bits;
|
|
if (ret) {
|
|
strm.msg = "invalid code lengths set";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
state.have = 0;
|
|
state.mode = CODELENS;
|
|
case CODELENS:
|
|
while (state.have < state.nlen + state.ndist) {
|
|
for (; ; ) {
|
|
here = state.lencode[hold & (1 << state.lenbits) - 1];
|
|
here_bits = here >>> 24;
|
|
here_op = here >>> 16 & 255;
|
|
here_val = here & 65535;
|
|
if (here_bits <= bits) {
|
|
break;
|
|
}
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
if (here_val < 16) {
|
|
hold >>>= here_bits;
|
|
bits -= here_bits;
|
|
state.lens[state.have++] = here_val;
|
|
} else {
|
|
if (here_val === 16) {
|
|
n = here_bits + 2;
|
|
while (bits < n) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
hold >>>= here_bits;
|
|
bits -= here_bits;
|
|
if (state.have === 0) {
|
|
strm.msg = "invalid bit length repeat";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
len = state.lens[state.have - 1];
|
|
copy = 3 + (hold & 3);
|
|
hold >>>= 2;
|
|
bits -= 2;
|
|
} else if (here_val === 17) {
|
|
n = here_bits + 3;
|
|
while (bits < n) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
hold >>>= here_bits;
|
|
bits -= here_bits;
|
|
len = 0;
|
|
copy = 3 + (hold & 7);
|
|
hold >>>= 3;
|
|
bits -= 3;
|
|
} else {
|
|
n = here_bits + 7;
|
|
while (bits < n) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
hold >>>= here_bits;
|
|
bits -= here_bits;
|
|
len = 0;
|
|
copy = 11 + (hold & 127);
|
|
hold >>>= 7;
|
|
bits -= 7;
|
|
}
|
|
if (state.have + copy > state.nlen + state.ndist) {
|
|
strm.msg = "invalid bit length repeat";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
while (copy--) {
|
|
state.lens[state.have++] = len;
|
|
}
|
|
}
|
|
}
|
|
if (state.mode === BAD) {
|
|
break;
|
|
}
|
|
if (state.lens[256] === 0) {
|
|
strm.msg = "invalid code -- missing end-of-block";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
state.lenbits = 9;
|
|
opts = { bits: state.lenbits };
|
|
ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
|
|
state.lenbits = opts.bits;
|
|
if (ret) {
|
|
strm.msg = "invalid literal/lengths set";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
state.distbits = 6;
|
|
state.distcode = state.distdyn;
|
|
opts = { bits: state.distbits };
|
|
ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
|
|
state.distbits = opts.bits;
|
|
if (ret) {
|
|
strm.msg = "invalid distances set";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
state.mode = LEN_;
|
|
if (flush === Z_TREES) {
|
|
break inf_leave;
|
|
}
|
|
case LEN_:
|
|
state.mode = LEN;
|
|
case LEN:
|
|
if (have >= 6 && left >= 258) {
|
|
strm.next_out = put;
|
|
strm.avail_out = left;
|
|
strm.next_in = next;
|
|
strm.avail_in = have;
|
|
state.hold = hold;
|
|
state.bits = bits;
|
|
inflate_fast(strm, _out);
|
|
put = strm.next_out;
|
|
output = strm.output;
|
|
left = strm.avail_out;
|
|
next = strm.next_in;
|
|
input = strm.input;
|
|
have = strm.avail_in;
|
|
hold = state.hold;
|
|
bits = state.bits;
|
|
if (state.mode === TYPE) {
|
|
state.back = -1;
|
|
}
|
|
break;
|
|
}
|
|
state.back = 0;
|
|
for (; ; ) {
|
|
here = state.lencode[hold & (1 << state.lenbits) - 1];
|
|
here_bits = here >>> 24;
|
|
here_op = here >>> 16 & 255;
|
|
here_val = here & 65535;
|
|
if (here_bits <= bits) {
|
|
break;
|
|
}
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
if (here_op && (here_op & 240) === 0) {
|
|
last_bits = here_bits;
|
|
last_op = here_op;
|
|
last_val = here_val;
|
|
for (; ; ) {
|
|
here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)];
|
|
here_bits = here >>> 24;
|
|
here_op = here >>> 16 & 255;
|
|
here_val = here & 65535;
|
|
if (last_bits + here_bits <= bits) {
|
|
break;
|
|
}
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
hold >>>= last_bits;
|
|
bits -= last_bits;
|
|
state.back += last_bits;
|
|
}
|
|
hold >>>= here_bits;
|
|
bits -= here_bits;
|
|
state.back += here_bits;
|
|
state.length = here_val;
|
|
if (here_op === 0) {
|
|
state.mode = LIT;
|
|
break;
|
|
}
|
|
if (here_op & 32) {
|
|
state.back = -1;
|
|
state.mode = TYPE;
|
|
break;
|
|
}
|
|
if (here_op & 64) {
|
|
strm.msg = "invalid literal/length code";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
state.extra = here_op & 15;
|
|
state.mode = LENEXT;
|
|
case LENEXT:
|
|
if (state.extra) {
|
|
n = state.extra;
|
|
while (bits < n) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
state.length += hold & (1 << state.extra) - 1;
|
|
hold >>>= state.extra;
|
|
bits -= state.extra;
|
|
state.back += state.extra;
|
|
}
|
|
state.was = state.length;
|
|
state.mode = DIST;
|
|
case DIST:
|
|
for (; ; ) {
|
|
here = state.distcode[hold & (1 << state.distbits) - 1];
|
|
here_bits = here >>> 24;
|
|
here_op = here >>> 16 & 255;
|
|
here_val = here & 65535;
|
|
if (here_bits <= bits) {
|
|
break;
|
|
}
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
if ((here_op & 240) === 0) {
|
|
last_bits = here_bits;
|
|
last_op = here_op;
|
|
last_val = here_val;
|
|
for (; ; ) {
|
|
here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)];
|
|
here_bits = here >>> 24;
|
|
here_op = here >>> 16 & 255;
|
|
here_val = here & 65535;
|
|
if (last_bits + here_bits <= bits) {
|
|
break;
|
|
}
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
hold >>>= last_bits;
|
|
bits -= last_bits;
|
|
state.back += last_bits;
|
|
}
|
|
hold >>>= here_bits;
|
|
bits -= here_bits;
|
|
state.back += here_bits;
|
|
if (here_op & 64) {
|
|
strm.msg = "invalid distance code";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
state.offset = here_val;
|
|
state.extra = here_op & 15;
|
|
state.mode = DISTEXT;
|
|
case DISTEXT:
|
|
if (state.extra) {
|
|
n = state.extra;
|
|
while (bits < n) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
state.offset += hold & (1 << state.extra) - 1;
|
|
hold >>>= state.extra;
|
|
bits -= state.extra;
|
|
state.back += state.extra;
|
|
}
|
|
if (state.offset > state.dmax) {
|
|
strm.msg = "invalid distance too far back";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
state.mode = MATCH;
|
|
case MATCH:
|
|
if (left === 0) {
|
|
break inf_leave;
|
|
}
|
|
copy = _out - left;
|
|
if (state.offset > copy) {
|
|
copy = state.offset - copy;
|
|
if (copy > state.whave) {
|
|
if (state.sane) {
|
|
strm.msg = "invalid distance too far back";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
}
|
|
if (copy > state.wnext) {
|
|
copy -= state.wnext;
|
|
from = state.wsize - copy;
|
|
} else {
|
|
from = state.wnext - copy;
|
|
}
|
|
if (copy > state.length) {
|
|
copy = state.length;
|
|
}
|
|
from_source = state.window;
|
|
} else {
|
|
from_source = output;
|
|
from = put - state.offset;
|
|
copy = state.length;
|
|
}
|
|
if (copy > left) {
|
|
copy = left;
|
|
}
|
|
left -= copy;
|
|
state.length -= copy;
|
|
do {
|
|
output[put++] = from_source[from++];
|
|
} while (--copy);
|
|
if (state.length === 0) {
|
|
state.mode = LEN;
|
|
}
|
|
break;
|
|
case LIT:
|
|
if (left === 0) {
|
|
break inf_leave;
|
|
}
|
|
output[put++] = state.length;
|
|
left--;
|
|
state.mode = LEN;
|
|
break;
|
|
case CHECK:
|
|
if (state.wrap) {
|
|
while (bits < 32) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold |= input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
_out -= left;
|
|
strm.total_out += _out;
|
|
state.total += _out;
|
|
if (_out) {
|
|
strm.adler = state.check = state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out);
|
|
}
|
|
_out = left;
|
|
if ((state.flags ? hold : zswap32(hold)) !== state.check) {
|
|
strm.msg = "incorrect data check";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
hold = 0;
|
|
bits = 0;
|
|
}
|
|
state.mode = LENGTH;
|
|
case LENGTH:
|
|
if (state.wrap && state.flags) {
|
|
while (bits < 32) {
|
|
if (have === 0) {
|
|
break inf_leave;
|
|
}
|
|
have--;
|
|
hold += input[next++] << bits;
|
|
bits += 8;
|
|
}
|
|
if (hold !== (state.total & 4294967295)) {
|
|
strm.msg = "incorrect length check";
|
|
state.mode = BAD;
|
|
break;
|
|
}
|
|
hold = 0;
|
|
bits = 0;
|
|
}
|
|
state.mode = DONE;
|
|
case DONE:
|
|
ret = Z_STREAM_END;
|
|
break inf_leave;
|
|
case BAD:
|
|
ret = Z_DATA_ERROR;
|
|
break inf_leave;
|
|
case MEM:
|
|
return Z_MEM_ERROR;
|
|
case SYNC:
|
|
default:
|
|
return Z_STREAM_ERROR;
|
|
}
|
|
}
|
|
strm.next_out = put;
|
|
strm.avail_out = left;
|
|
strm.next_in = next;
|
|
strm.avail_in = have;
|
|
state.hold = hold;
|
|
state.bits = bits;
|
|
if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) {
|
|
if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
|
|
state.mode = MEM;
|
|
return Z_MEM_ERROR;
|
|
}
|
|
}
|
|
_in -= strm.avail_in;
|
|
_out -= strm.avail_out;
|
|
strm.total_in += _in;
|
|
strm.total_out += _out;
|
|
state.total += _out;
|
|
if (state.wrap && _out) {
|
|
strm.adler = state.check = state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out);
|
|
}
|
|
strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
|
|
if ((_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK) {
|
|
ret = Z_BUF_ERROR;
|
|
}
|
|
return ret;
|
|
}
|
|
function inflateEnd(strm) {
|
|
if (!strm || !strm.state) {
|
|
return Z_STREAM_ERROR;
|
|
}
|
|
var state = strm.state;
|
|
if (state.window) {
|
|
state.window = null;
|
|
}
|
|
strm.state = null;
|
|
return Z_OK;
|
|
}
|
|
function inflateGetHeader(strm, head) {
|
|
var state;
|
|
if (!strm || !strm.state) {
|
|
return Z_STREAM_ERROR;
|
|
}
|
|
state = strm.state;
|
|
if ((state.wrap & 2) === 0) {
|
|
return Z_STREAM_ERROR;
|
|
}
|
|
state.head = head;
|
|
head.done = false;
|
|
return Z_OK;
|
|
}
|
|
function inflateSetDictionary(strm, dictionary) {
|
|
var dictLength = dictionary.length;
|
|
var state;
|
|
var dictid;
|
|
var ret;
|
|
if (!strm || !strm.state) {
|
|
return Z_STREAM_ERROR;
|
|
}
|
|
state = strm.state;
|
|
if (state.wrap !== 0 && state.mode !== DICT) {
|
|
return Z_STREAM_ERROR;
|
|
}
|
|
if (state.mode === DICT) {
|
|
dictid = 1;
|
|
dictid = adler32(dictid, dictionary, dictLength, 0);
|
|
if (dictid !== state.check) {
|
|
return Z_DATA_ERROR;
|
|
}
|
|
}
|
|
ret = updatewindow(strm, dictionary, dictLength, dictLength);
|
|
if (ret) {
|
|
state.mode = MEM;
|
|
return Z_MEM_ERROR;
|
|
}
|
|
state.havedict = 1;
|
|
return Z_OK;
|
|
}
|
|
exports3.inflateReset = inflateReset;
|
|
exports3.inflateReset2 = inflateReset2;
|
|
exports3.inflateResetKeep = inflateResetKeep;
|
|
exports3.inflateInit = inflateInit;
|
|
exports3.inflateInit2 = inflateInit2;
|
|
exports3.inflate = inflate;
|
|
exports3.inflateEnd = inflateEnd;
|
|
exports3.inflateGetHeader = inflateGetHeader;
|
|
exports3.inflateSetDictionary = inflateSetDictionary;
|
|
exports3.inflateInfo = "pako inflate (from Nodeca project)";
|
|
}, { "../utils/common": 5, "./adler32": 7, "./crc32": 9, "./inffast": 11, "./inftrees": 13 }], 13: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
var utils = require2("../utils/common");
|
|
var MAXBITS = 15;
|
|
var ENOUGH_LENS = 852;
|
|
var ENOUGH_DISTS = 592;
|
|
var CODES = 0;
|
|
var LENS = 1;
|
|
var DISTS = 2;
|
|
var lbase = [
|
|
3,
|
|
4,
|
|
5,
|
|
6,
|
|
7,
|
|
8,
|
|
9,
|
|
10,
|
|
11,
|
|
13,
|
|
15,
|
|
17,
|
|
19,
|
|
23,
|
|
27,
|
|
31,
|
|
35,
|
|
43,
|
|
51,
|
|
59,
|
|
67,
|
|
83,
|
|
99,
|
|
115,
|
|
131,
|
|
163,
|
|
195,
|
|
227,
|
|
258,
|
|
0,
|
|
0
|
|
];
|
|
var lext = [
|
|
16,
|
|
16,
|
|
16,
|
|
16,
|
|
16,
|
|
16,
|
|
16,
|
|
16,
|
|
17,
|
|
17,
|
|
17,
|
|
17,
|
|
18,
|
|
18,
|
|
18,
|
|
18,
|
|
19,
|
|
19,
|
|
19,
|
|
19,
|
|
20,
|
|
20,
|
|
20,
|
|
20,
|
|
21,
|
|
21,
|
|
21,
|
|
21,
|
|
16,
|
|
72,
|
|
78
|
|
];
|
|
var dbase = [
|
|
1,
|
|
2,
|
|
3,
|
|
4,
|
|
5,
|
|
7,
|
|
9,
|
|
13,
|
|
17,
|
|
25,
|
|
33,
|
|
49,
|
|
65,
|
|
97,
|
|
129,
|
|
193,
|
|
257,
|
|
385,
|
|
513,
|
|
769,
|
|
1025,
|
|
1537,
|
|
2049,
|
|
3073,
|
|
4097,
|
|
6145,
|
|
8193,
|
|
12289,
|
|
16385,
|
|
24577,
|
|
0,
|
|
0
|
|
];
|
|
var dext = [
|
|
16,
|
|
16,
|
|
16,
|
|
16,
|
|
17,
|
|
17,
|
|
18,
|
|
18,
|
|
19,
|
|
19,
|
|
20,
|
|
20,
|
|
21,
|
|
21,
|
|
22,
|
|
22,
|
|
23,
|
|
23,
|
|
24,
|
|
24,
|
|
25,
|
|
25,
|
|
26,
|
|
26,
|
|
27,
|
|
27,
|
|
28,
|
|
28,
|
|
29,
|
|
29,
|
|
64,
|
|
64
|
|
];
|
|
module4.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {
|
|
var bits = opts.bits;
|
|
var len = 0;
|
|
var sym = 0;
|
|
var min = 0, max = 0;
|
|
var root = 0;
|
|
var curr = 0;
|
|
var drop = 0;
|
|
var left = 0;
|
|
var used = 0;
|
|
var huff = 0;
|
|
var incr;
|
|
var fill;
|
|
var low;
|
|
var mask;
|
|
var next;
|
|
var base = null;
|
|
var base_index = 0;
|
|
var end;
|
|
var count = new utils.Buf16(MAXBITS + 1);
|
|
var offs = new utils.Buf16(MAXBITS + 1);
|
|
var extra = null;
|
|
var extra_index = 0;
|
|
var here_bits, here_op, here_val;
|
|
for (len = 0; len <= MAXBITS; len++) {
|
|
count[len] = 0;
|
|
}
|
|
for (sym = 0; sym < codes; sym++) {
|
|
count[lens[lens_index + sym]]++;
|
|
}
|
|
root = bits;
|
|
for (max = MAXBITS; max >= 1; max--) {
|
|
if (count[max] !== 0) {
|
|
break;
|
|
}
|
|
}
|
|
if (root > max) {
|
|
root = max;
|
|
}
|
|
if (max === 0) {
|
|
table[table_index++] = 1 << 24 | 64 << 16 | 0;
|
|
table[table_index++] = 1 << 24 | 64 << 16 | 0;
|
|
opts.bits = 1;
|
|
return 0;
|
|
}
|
|
for (min = 1; min < max; min++) {
|
|
if (count[min] !== 0) {
|
|
break;
|
|
}
|
|
}
|
|
if (root < min) {
|
|
root = min;
|
|
}
|
|
left = 1;
|
|
for (len = 1; len <= MAXBITS; len++) {
|
|
left <<= 1;
|
|
left -= count[len];
|
|
if (left < 0) {
|
|
return -1;
|
|
}
|
|
}
|
|
if (left > 0 && (type === CODES || max !== 1)) {
|
|
return -1;
|
|
}
|
|
offs[1] = 0;
|
|
for (len = 1; len < MAXBITS; len++) {
|
|
offs[len + 1] = offs[len] + count[len];
|
|
}
|
|
for (sym = 0; sym < codes; sym++) {
|
|
if (lens[lens_index + sym] !== 0) {
|
|
work[offs[lens[lens_index + sym]]++] = sym;
|
|
}
|
|
}
|
|
if (type === CODES) {
|
|
base = extra = work;
|
|
end = 19;
|
|
} else if (type === LENS) {
|
|
base = lbase;
|
|
base_index -= 257;
|
|
extra = lext;
|
|
extra_index -= 257;
|
|
end = 256;
|
|
} else {
|
|
base = dbase;
|
|
extra = dext;
|
|
end = -1;
|
|
}
|
|
huff = 0;
|
|
sym = 0;
|
|
len = min;
|
|
next = table_index;
|
|
curr = root;
|
|
drop = 0;
|
|
low = -1;
|
|
used = 1 << root;
|
|
mask = used - 1;
|
|
if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) {
|
|
return 1;
|
|
}
|
|
for (; ; ) {
|
|
here_bits = len - drop;
|
|
if (work[sym] < end) {
|
|
here_op = 0;
|
|
here_val = work[sym];
|
|
} else if (work[sym] > end) {
|
|
here_op = extra[extra_index + work[sym]];
|
|
here_val = base[base_index + work[sym]];
|
|
} else {
|
|
here_op = 32 + 64;
|
|
here_val = 0;
|
|
}
|
|
incr = 1 << len - drop;
|
|
fill = 1 << curr;
|
|
min = fill;
|
|
do {
|
|
fill -= incr;
|
|
table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;
|
|
} while (fill !== 0);
|
|
incr = 1 << len - 1;
|
|
while (huff & incr) {
|
|
incr >>= 1;
|
|
}
|
|
if (incr !== 0) {
|
|
huff &= incr - 1;
|
|
huff += incr;
|
|
} else {
|
|
huff = 0;
|
|
}
|
|
sym++;
|
|
if (--count[len] === 0) {
|
|
if (len === max) {
|
|
break;
|
|
}
|
|
len = lens[lens_index + work[sym]];
|
|
}
|
|
if (len > root && (huff & mask) !== low) {
|
|
if (drop === 0) {
|
|
drop = root;
|
|
}
|
|
next += min;
|
|
curr = len - drop;
|
|
left = 1 << curr;
|
|
while (curr + drop < max) {
|
|
left -= count[curr + drop];
|
|
if (left <= 0) {
|
|
break;
|
|
}
|
|
curr++;
|
|
left <<= 1;
|
|
}
|
|
used += 1 << curr;
|
|
if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) {
|
|
return 1;
|
|
}
|
|
low = huff & mask;
|
|
table[low] = root << 24 | curr << 16 | next - table_index | 0;
|
|
}
|
|
}
|
|
if (huff !== 0) {
|
|
table[next + huff] = len - drop << 24 | 64 << 16 | 0;
|
|
}
|
|
opts.bits = root;
|
|
return 0;
|
|
};
|
|
}, { "../utils/common": 5 }], 14: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
module4.exports = {
|
|
2: "need dictionary",
|
|
1: "stream end",
|
|
0: "",
|
|
"-1": "file error",
|
|
"-2": "stream error",
|
|
"-3": "data error",
|
|
"-4": "insufficient memory",
|
|
"-5": "buffer error",
|
|
"-6": "incompatible version"
|
|
};
|
|
}, {}], 15: [function(require2, module4, exports3) {
|
|
"use strict";
|
|
function ZStream() {
|
|
this.input = null;
|
|
this.next_in = 0;
|
|
this.avail_in = 0;
|
|
this.total_in = 0;
|
|
this.output = null;
|
|
this.next_out = 0;
|
|
this.avail_out = 0;
|
|
this.total_out = 0;
|
|
this.msg = "";
|
|
this.state = null;
|
|
this.data_type = 2;
|
|
this.adler = 0;
|
|
}
|
|
module4.exports = ZStream;
|
|
}, {}] }, {}, [3])(3);
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/plantuml-encoder/browser-index.js
|
|
var require_browser_index = __commonJS({
|
|
"node_modules/plantuml-encoder/browser-index.js"(exports, module2) {
|
|
module2.exports = {
|
|
encode: require_plantuml_encoder().encode,
|
|
decode: require_plantuml_decoder().decode
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/localforage/dist/localforage.js
|
|
var require_localforage = __commonJS({
|
|
"node_modules/localforage/dist/localforage.js"(exports, module2) {
|
|
(function(f) {
|
|
if (typeof exports === "object" && typeof module2 !== "undefined") {
|
|
module2.exports = f();
|
|
} else if (typeof define === "function" && define.amd) {
|
|
define([], f);
|
|
} else {
|
|
var g;
|
|
if (typeof window !== "undefined") {
|
|
g = window;
|
|
} else if (typeof global !== "undefined") {
|
|
g = global;
|
|
} else if (typeof self !== "undefined") {
|
|
g = self;
|
|
} else {
|
|
g = this;
|
|
}
|
|
g.localforage = f();
|
|
}
|
|
})(function() {
|
|
var define2, module3, exports2;
|
|
return function e(t, n, r) {
|
|
function s(o2, u) {
|
|
if (!n[o2]) {
|
|
if (!t[o2]) {
|
|
var a = typeof require == "function" && require;
|
|
if (!u && a)
|
|
return a(o2, true);
|
|
if (i)
|
|
return i(o2, true);
|
|
var f = new Error("Cannot find module '" + o2 + "'");
|
|
throw f.code = "MODULE_NOT_FOUND", f;
|
|
}
|
|
var l = n[o2] = { exports: {} };
|
|
t[o2][0].call(l.exports, function(e2) {
|
|
var n2 = t[o2][1][e2];
|
|
return s(n2 ? n2 : e2);
|
|
}, l, l.exports, e, t, n, r);
|
|
}
|
|
return n[o2].exports;
|
|
}
|
|
var i = typeof require == "function" && require;
|
|
for (var o = 0; o < r.length; o++)
|
|
s(r[o]);
|
|
return s;
|
|
}({ 1: [function(_dereq_, module4, exports3) {
|
|
(function(global2) {
|
|
"use strict";
|
|
var Mutation = global2.MutationObserver || global2.WebKitMutationObserver;
|
|
var scheduleDrain;
|
|
{
|
|
if (Mutation) {
|
|
var called = 0;
|
|
var observer = new Mutation(nextTick);
|
|
var element = global2.document.createTextNode("");
|
|
observer.observe(element, {
|
|
characterData: true
|
|
});
|
|
scheduleDrain = function() {
|
|
element.data = called = ++called % 2;
|
|
};
|
|
} else if (!global2.setImmediate && typeof global2.MessageChannel !== "undefined") {
|
|
var channel = new global2.MessageChannel();
|
|
channel.port1.onmessage = nextTick;
|
|
scheduleDrain = function() {
|
|
channel.port2.postMessage(0);
|
|
};
|
|
} else if ("document" in global2 && "onreadystatechange" in global2.document.createElement("script")) {
|
|
scheduleDrain = function() {
|
|
var scriptEl = global2.document.createElement("script");
|
|
scriptEl.onreadystatechange = function() {
|
|
nextTick();
|
|
scriptEl.onreadystatechange = null;
|
|
scriptEl.parentNode.removeChild(scriptEl);
|
|
scriptEl = null;
|
|
};
|
|
global2.document.documentElement.appendChild(scriptEl);
|
|
};
|
|
} else {
|
|
scheduleDrain = function() {
|
|
setTimeout(nextTick, 0);
|
|
};
|
|
}
|
|
}
|
|
var draining;
|
|
var queue = [];
|
|
function nextTick() {
|
|
draining = true;
|
|
var i, oldQueue;
|
|
var len = queue.length;
|
|
while (len) {
|
|
oldQueue = queue;
|
|
queue = [];
|
|
i = -1;
|
|
while (++i < len) {
|
|
oldQueue[i]();
|
|
}
|
|
len = queue.length;
|
|
}
|
|
draining = false;
|
|
}
|
|
module4.exports = immediate;
|
|
function immediate(task) {
|
|
if (queue.push(task) === 1 && !draining) {
|
|
scheduleDrain();
|
|
}
|
|
}
|
|
}).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
|
|
}, {}], 2: [function(_dereq_, module4, exports3) {
|
|
"use strict";
|
|
var immediate = _dereq_(1);
|
|
function INTERNAL() {
|
|
}
|
|
var handlers = {};
|
|
var REJECTED = ["REJECTED"];
|
|
var FULFILLED = ["FULFILLED"];
|
|
var PENDING = ["PENDING"];
|
|
module4.exports = Promise2;
|
|
function Promise2(resolver) {
|
|
if (typeof resolver !== "function") {
|
|
throw new TypeError("resolver must be a function");
|
|
}
|
|
this.state = PENDING;
|
|
this.queue = [];
|
|
this.outcome = void 0;
|
|
if (resolver !== INTERNAL) {
|
|
safelyResolveThenable(this, resolver);
|
|
}
|
|
}
|
|
Promise2.prototype["catch"] = function(onRejected) {
|
|
return this.then(null, onRejected);
|
|
};
|
|
Promise2.prototype.then = function(onFulfilled, onRejected) {
|
|
if (typeof onFulfilled !== "function" && this.state === FULFILLED || typeof onRejected !== "function" && this.state === REJECTED) {
|
|
return this;
|
|
}
|
|
var promise = new this.constructor(INTERNAL);
|
|
if (this.state !== PENDING) {
|
|
var resolver = this.state === FULFILLED ? onFulfilled : onRejected;
|
|
unwrap(promise, resolver, this.outcome);
|
|
} else {
|
|
this.queue.push(new QueueItem(promise, onFulfilled, onRejected));
|
|
}
|
|
return promise;
|
|
};
|
|
function QueueItem(promise, onFulfilled, onRejected) {
|
|
this.promise = promise;
|
|
if (typeof onFulfilled === "function") {
|
|
this.onFulfilled = onFulfilled;
|
|
this.callFulfilled = this.otherCallFulfilled;
|
|
}
|
|
if (typeof onRejected === "function") {
|
|
this.onRejected = onRejected;
|
|
this.callRejected = this.otherCallRejected;
|
|
}
|
|
}
|
|
QueueItem.prototype.callFulfilled = function(value) {
|
|
handlers.resolve(this.promise, value);
|
|
};
|
|
QueueItem.prototype.otherCallFulfilled = function(value) {
|
|
unwrap(this.promise, this.onFulfilled, value);
|
|
};
|
|
QueueItem.prototype.callRejected = function(value) {
|
|
handlers.reject(this.promise, value);
|
|
};
|
|
QueueItem.prototype.otherCallRejected = function(value) {
|
|
unwrap(this.promise, this.onRejected, value);
|
|
};
|
|
function unwrap(promise, func, value) {
|
|
immediate(function() {
|
|
var returnValue;
|
|
try {
|
|
returnValue = func(value);
|
|
} catch (e) {
|
|
return handlers.reject(promise, e);
|
|
}
|
|
if (returnValue === promise) {
|
|
handlers.reject(promise, new TypeError("Cannot resolve promise with itself"));
|
|
} else {
|
|
handlers.resolve(promise, returnValue);
|
|
}
|
|
});
|
|
}
|
|
handlers.resolve = function(self2, value) {
|
|
var result = tryCatch(getThen, value);
|
|
if (result.status === "error") {
|
|
return handlers.reject(self2, result.value);
|
|
}
|
|
var thenable = result.value;
|
|
if (thenable) {
|
|
safelyResolveThenable(self2, thenable);
|
|
} else {
|
|
self2.state = FULFILLED;
|
|
self2.outcome = value;
|
|
var i = -1;
|
|
var len = self2.queue.length;
|
|
while (++i < len) {
|
|
self2.queue[i].callFulfilled(value);
|
|
}
|
|
}
|
|
return self2;
|
|
};
|
|
handlers.reject = function(self2, error) {
|
|
self2.state = REJECTED;
|
|
self2.outcome = error;
|
|
var i = -1;
|
|
var len = self2.queue.length;
|
|
while (++i < len) {
|
|
self2.queue[i].callRejected(error);
|
|
}
|
|
return self2;
|
|
};
|
|
function getThen(obj) {
|
|
var then = obj && obj.then;
|
|
if (obj && (typeof obj === "object" || typeof obj === "function") && typeof then === "function") {
|
|
return function appyThen() {
|
|
then.apply(obj, arguments);
|
|
};
|
|
}
|
|
}
|
|
function safelyResolveThenable(self2, thenable) {
|
|
var called = false;
|
|
function onError(value) {
|
|
if (called) {
|
|
return;
|
|
}
|
|
called = true;
|
|
handlers.reject(self2, value);
|
|
}
|
|
function onSuccess(value) {
|
|
if (called) {
|
|
return;
|
|
}
|
|
called = true;
|
|
handlers.resolve(self2, value);
|
|
}
|
|
function tryToUnwrap() {
|
|
thenable(onSuccess, onError);
|
|
}
|
|
var result = tryCatch(tryToUnwrap);
|
|
if (result.status === "error") {
|
|
onError(result.value);
|
|
}
|
|
}
|
|
function tryCatch(func, value) {
|
|
var out = {};
|
|
try {
|
|
out.value = func(value);
|
|
out.status = "success";
|
|
} catch (e) {
|
|
out.status = "error";
|
|
out.value = e;
|
|
}
|
|
return out;
|
|
}
|
|
Promise2.resolve = resolve;
|
|
function resolve(value) {
|
|
if (value instanceof this) {
|
|
return value;
|
|
}
|
|
return handlers.resolve(new this(INTERNAL), value);
|
|
}
|
|
Promise2.reject = reject;
|
|
function reject(reason) {
|
|
var promise = new this(INTERNAL);
|
|
return handlers.reject(promise, reason);
|
|
}
|
|
Promise2.all = all;
|
|
function all(iterable) {
|
|
var self2 = this;
|
|
if (Object.prototype.toString.call(iterable) !== "[object Array]") {
|
|
return this.reject(new TypeError("must be an array"));
|
|
}
|
|
var len = iterable.length;
|
|
var called = false;
|
|
if (!len) {
|
|
return this.resolve([]);
|
|
}
|
|
var values = new Array(len);
|
|
var resolved = 0;
|
|
var i = -1;
|
|
var promise = new this(INTERNAL);
|
|
while (++i < len) {
|
|
allResolver(iterable[i], i);
|
|
}
|
|
return promise;
|
|
function allResolver(value, i2) {
|
|
self2.resolve(value).then(resolveFromAll, function(error) {
|
|
if (!called) {
|
|
called = true;
|
|
handlers.reject(promise, error);
|
|
}
|
|
});
|
|
function resolveFromAll(outValue) {
|
|
values[i2] = outValue;
|
|
if (++resolved === len && !called) {
|
|
called = true;
|
|
handlers.resolve(promise, values);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Promise2.race = race;
|
|
function race(iterable) {
|
|
var self2 = this;
|
|
if (Object.prototype.toString.call(iterable) !== "[object Array]") {
|
|
return this.reject(new TypeError("must be an array"));
|
|
}
|
|
var len = iterable.length;
|
|
var called = false;
|
|
if (!len) {
|
|
return this.resolve([]);
|
|
}
|
|
var i = -1;
|
|
var promise = new this(INTERNAL);
|
|
while (++i < len) {
|
|
resolver(iterable[i]);
|
|
}
|
|
return promise;
|
|
function resolver(value) {
|
|
self2.resolve(value).then(function(response) {
|
|
if (!called) {
|
|
called = true;
|
|
handlers.resolve(promise, response);
|
|
}
|
|
}, function(error) {
|
|
if (!called) {
|
|
called = true;
|
|
handlers.reject(promise, error);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}, { "1": 1 }], 3: [function(_dereq_, module4, exports3) {
|
|
(function(global2) {
|
|
"use strict";
|
|
if (typeof global2.Promise !== "function") {
|
|
global2.Promise = _dereq_(2);
|
|
}
|
|
}).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
|
|
}, { "2": 2 }], 4: [function(_dereq_, module4, exports3) {
|
|
"use strict";
|
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
|
|
return typeof obj;
|
|
} : function(obj) {
|
|
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
};
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function getIDB() {
|
|
try {
|
|
if (typeof indexedDB !== "undefined") {
|
|
return indexedDB;
|
|
}
|
|
if (typeof webkitIndexedDB !== "undefined") {
|
|
return webkitIndexedDB;
|
|
}
|
|
if (typeof mozIndexedDB !== "undefined") {
|
|
return mozIndexedDB;
|
|
}
|
|
if (typeof OIndexedDB !== "undefined") {
|
|
return OIndexedDB;
|
|
}
|
|
if (typeof msIndexedDB !== "undefined") {
|
|
return msIndexedDB;
|
|
}
|
|
} catch (e) {
|
|
return;
|
|
}
|
|
}
|
|
var idb = getIDB();
|
|
function isIndexedDBValid() {
|
|
try {
|
|
if (!idb || !idb.open) {
|
|
return false;
|
|
}
|
|
var isSafari = typeof openDatabase !== "undefined" && /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && !/BlackBerry/.test(navigator.platform);
|
|
var hasFetch = typeof fetch === "function" && fetch.toString().indexOf("[native code") !== -1;
|
|
return (!isSafari || hasFetch) && typeof indexedDB !== "undefined" && typeof IDBKeyRange !== "undefined";
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function createBlob(parts, properties) {
|
|
parts = parts || [];
|
|
properties = properties || {};
|
|
try {
|
|
return new Blob(parts, properties);
|
|
} catch (e) {
|
|
if (e.name !== "TypeError") {
|
|
throw e;
|
|
}
|
|
var Builder = typeof BlobBuilder !== "undefined" ? BlobBuilder : typeof MSBlobBuilder !== "undefined" ? MSBlobBuilder : typeof MozBlobBuilder !== "undefined" ? MozBlobBuilder : WebKitBlobBuilder;
|
|
var builder = new Builder();
|
|
for (var i = 0; i < parts.length; i += 1) {
|
|
builder.append(parts[i]);
|
|
}
|
|
return builder.getBlob(properties.type);
|
|
}
|
|
}
|
|
if (typeof Promise === "undefined") {
|
|
_dereq_(3);
|
|
}
|
|
var Promise$1 = Promise;
|
|
function executeCallback(promise, callback) {
|
|
if (callback) {
|
|
promise.then(function(result) {
|
|
callback(null, result);
|
|
}, function(error) {
|
|
callback(error);
|
|
});
|
|
}
|
|
}
|
|
function executeTwoCallbacks(promise, callback, errorCallback) {
|
|
if (typeof callback === "function") {
|
|
promise.then(callback);
|
|
}
|
|
if (typeof errorCallback === "function") {
|
|
promise["catch"](errorCallback);
|
|
}
|
|
}
|
|
function normalizeKey(key2) {
|
|
if (typeof key2 !== "string") {
|
|
console.warn(key2 + " used as a key, but it is not a string.");
|
|
key2 = String(key2);
|
|
}
|
|
return key2;
|
|
}
|
|
function getCallback() {
|
|
if (arguments.length && typeof arguments[arguments.length - 1] === "function") {
|
|
return arguments[arguments.length - 1];
|
|
}
|
|
}
|
|
var DETECT_BLOB_SUPPORT_STORE = "local-forage-detect-blob-support";
|
|
var supportsBlobs = void 0;
|
|
var dbContexts = {};
|
|
var toString = Object.prototype.toString;
|
|
var READ_ONLY = "readonly";
|
|
var READ_WRITE = "readwrite";
|
|
function _binStringToArrayBuffer(bin) {
|
|
var length2 = bin.length;
|
|
var buf = new ArrayBuffer(length2);
|
|
var arr = new Uint8Array(buf);
|
|
for (var i = 0; i < length2; i++) {
|
|
arr[i] = bin.charCodeAt(i);
|
|
}
|
|
return buf;
|
|
}
|
|
function _checkBlobSupportWithoutCaching(idb2) {
|
|
return new Promise$1(function(resolve) {
|
|
var txn = idb2.transaction(DETECT_BLOB_SUPPORT_STORE, READ_WRITE);
|
|
var blob = createBlob([""]);
|
|
txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob, "key");
|
|
txn.onabort = function(e) {
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
resolve(false);
|
|
};
|
|
txn.oncomplete = function() {
|
|
var matchedChrome = navigator.userAgent.match(/Chrome\/(\d+)/);
|
|
var matchedEdge = navigator.userAgent.match(/Edge\//);
|
|
resolve(matchedEdge || !matchedChrome || parseInt(matchedChrome[1], 10) >= 43);
|
|
};
|
|
})["catch"](function() {
|
|
return false;
|
|
});
|
|
}
|
|
function _checkBlobSupport(idb2) {
|
|
if (typeof supportsBlobs === "boolean") {
|
|
return Promise$1.resolve(supportsBlobs);
|
|
}
|
|
return _checkBlobSupportWithoutCaching(idb2).then(function(value) {
|
|
supportsBlobs = value;
|
|
return supportsBlobs;
|
|
});
|
|
}
|
|
function _deferReadiness(dbInfo) {
|
|
var dbContext = dbContexts[dbInfo.name];
|
|
var deferredOperation = {};
|
|
deferredOperation.promise = new Promise$1(function(resolve, reject) {
|
|
deferredOperation.resolve = resolve;
|
|
deferredOperation.reject = reject;
|
|
});
|
|
dbContext.deferredOperations.push(deferredOperation);
|
|
if (!dbContext.dbReady) {
|
|
dbContext.dbReady = deferredOperation.promise;
|
|
} else {
|
|
dbContext.dbReady = dbContext.dbReady.then(function() {
|
|
return deferredOperation.promise;
|
|
});
|
|
}
|
|
}
|
|
function _advanceReadiness(dbInfo) {
|
|
var dbContext = dbContexts[dbInfo.name];
|
|
var deferredOperation = dbContext.deferredOperations.pop();
|
|
if (deferredOperation) {
|
|
deferredOperation.resolve();
|
|
return deferredOperation.promise;
|
|
}
|
|
}
|
|
function _rejectReadiness(dbInfo, err) {
|
|
var dbContext = dbContexts[dbInfo.name];
|
|
var deferredOperation = dbContext.deferredOperations.pop();
|
|
if (deferredOperation) {
|
|
deferredOperation.reject(err);
|
|
return deferredOperation.promise;
|
|
}
|
|
}
|
|
function _getConnection(dbInfo, upgradeNeeded) {
|
|
return new Promise$1(function(resolve, reject) {
|
|
dbContexts[dbInfo.name] = dbContexts[dbInfo.name] || createDbContext();
|
|
if (dbInfo.db) {
|
|
if (upgradeNeeded) {
|
|
_deferReadiness(dbInfo);
|
|
dbInfo.db.close();
|
|
} else {
|
|
return resolve(dbInfo.db);
|
|
}
|
|
}
|
|
var dbArgs = [dbInfo.name];
|
|
if (upgradeNeeded) {
|
|
dbArgs.push(dbInfo.version);
|
|
}
|
|
var openreq = idb.open.apply(idb, dbArgs);
|
|
if (upgradeNeeded) {
|
|
openreq.onupgradeneeded = function(e) {
|
|
var db = openreq.result;
|
|
try {
|
|
db.createObjectStore(dbInfo.storeName);
|
|
if (e.oldVersion <= 1) {
|
|
db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);
|
|
}
|
|
} catch (ex) {
|
|
if (ex.name === "ConstraintError") {
|
|
console.warn('The database "' + dbInfo.name + '" has been upgraded from version ' + e.oldVersion + " to version " + e.newVersion + ', but the storage "' + dbInfo.storeName + '" already exists.');
|
|
} else {
|
|
throw ex;
|
|
}
|
|
}
|
|
};
|
|
}
|
|
openreq.onerror = function(e) {
|
|
e.preventDefault();
|
|
reject(openreq.error);
|
|
};
|
|
openreq.onsuccess = function() {
|
|
var db = openreq.result;
|
|
db.onversionchange = function(e) {
|
|
e.target.close();
|
|
};
|
|
resolve(db);
|
|
_advanceReadiness(dbInfo);
|
|
};
|
|
});
|
|
}
|
|
function _getOriginalConnection(dbInfo) {
|
|
return _getConnection(dbInfo, false);
|
|
}
|
|
function _getUpgradedConnection(dbInfo) {
|
|
return _getConnection(dbInfo, true);
|
|
}
|
|
function _isUpgradeNeeded(dbInfo, defaultVersion) {
|
|
if (!dbInfo.db) {
|
|
return true;
|
|
}
|
|
var isNewStore = !dbInfo.db.objectStoreNames.contains(dbInfo.storeName);
|
|
var isDowngrade = dbInfo.version < dbInfo.db.version;
|
|
var isUpgrade = dbInfo.version > dbInfo.db.version;
|
|
if (isDowngrade) {
|
|
if (dbInfo.version !== defaultVersion) {
|
|
console.warn('The database "' + dbInfo.name + `" can't be downgraded from version ` + dbInfo.db.version + " to version " + dbInfo.version + ".");
|
|
}
|
|
dbInfo.version = dbInfo.db.version;
|
|
}
|
|
if (isUpgrade || isNewStore) {
|
|
if (isNewStore) {
|
|
var incVersion = dbInfo.db.version + 1;
|
|
if (incVersion > dbInfo.version) {
|
|
dbInfo.version = incVersion;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
function _encodeBlob(blob) {
|
|
return new Promise$1(function(resolve, reject) {
|
|
var reader = new FileReader();
|
|
reader.onerror = reject;
|
|
reader.onloadend = function(e) {
|
|
var base64 = btoa(e.target.result || "");
|
|
resolve({
|
|
__local_forage_encoded_blob: true,
|
|
data: base64,
|
|
type: blob.type
|
|
});
|
|
};
|
|
reader.readAsBinaryString(blob);
|
|
});
|
|
}
|
|
function _decodeBlob(encodedBlob) {
|
|
var arrayBuff = _binStringToArrayBuffer(atob(encodedBlob.data));
|
|
return createBlob([arrayBuff], { type: encodedBlob.type });
|
|
}
|
|
function _isEncodedBlob(value) {
|
|
return value && value.__local_forage_encoded_blob;
|
|
}
|
|
function _fullyReady(callback) {
|
|
var self2 = this;
|
|
var promise = self2._initReady().then(function() {
|
|
var dbContext = dbContexts[self2._dbInfo.name];
|
|
if (dbContext && dbContext.dbReady) {
|
|
return dbContext.dbReady;
|
|
}
|
|
});
|
|
executeTwoCallbacks(promise, callback, callback);
|
|
return promise;
|
|
}
|
|
function _tryReconnect(dbInfo) {
|
|
_deferReadiness(dbInfo);
|
|
var dbContext = dbContexts[dbInfo.name];
|
|
var forages = dbContext.forages;
|
|
for (var i = 0; i < forages.length; i++) {
|
|
var forage = forages[i];
|
|
if (forage._dbInfo.db) {
|
|
forage._dbInfo.db.close();
|
|
forage._dbInfo.db = null;
|
|
}
|
|
}
|
|
dbInfo.db = null;
|
|
return _getOriginalConnection(dbInfo).then(function(db) {
|
|
dbInfo.db = db;
|
|
if (_isUpgradeNeeded(dbInfo)) {
|
|
return _getUpgradedConnection(dbInfo);
|
|
}
|
|
return db;
|
|
}).then(function(db) {
|
|
dbInfo.db = dbContext.db = db;
|
|
for (var i2 = 0; i2 < forages.length; i2++) {
|
|
forages[i2]._dbInfo.db = db;
|
|
}
|
|
})["catch"](function(err) {
|
|
_rejectReadiness(dbInfo, err);
|
|
throw err;
|
|
});
|
|
}
|
|
function createTransaction(dbInfo, mode, callback, retries) {
|
|
if (retries === void 0) {
|
|
retries = 1;
|
|
}
|
|
try {
|
|
var tx = dbInfo.db.transaction(dbInfo.storeName, mode);
|
|
callback(null, tx);
|
|
} catch (err) {
|
|
if (retries > 0 && (!dbInfo.db || err.name === "InvalidStateError" || err.name === "NotFoundError")) {
|
|
return Promise$1.resolve().then(function() {
|
|
if (!dbInfo.db || err.name === "NotFoundError" && !dbInfo.db.objectStoreNames.contains(dbInfo.storeName) && dbInfo.version <= dbInfo.db.version) {
|
|
if (dbInfo.db) {
|
|
dbInfo.version = dbInfo.db.version + 1;
|
|
}
|
|
return _getUpgradedConnection(dbInfo);
|
|
}
|
|
}).then(function() {
|
|
return _tryReconnect(dbInfo).then(function() {
|
|
createTransaction(dbInfo, mode, callback, retries - 1);
|
|
});
|
|
})["catch"](callback);
|
|
}
|
|
callback(err);
|
|
}
|
|
}
|
|
function createDbContext() {
|
|
return {
|
|
forages: [],
|
|
db: null,
|
|
dbReady: null,
|
|
deferredOperations: []
|
|
};
|
|
}
|
|
function _initStorage(options) {
|
|
var self2 = this;
|
|
var dbInfo = {
|
|
db: null
|
|
};
|
|
if (options) {
|
|
for (var i in options) {
|
|
dbInfo[i] = options[i];
|
|
}
|
|
}
|
|
var dbContext = dbContexts[dbInfo.name];
|
|
if (!dbContext) {
|
|
dbContext = createDbContext();
|
|
dbContexts[dbInfo.name] = dbContext;
|
|
}
|
|
dbContext.forages.push(self2);
|
|
if (!self2._initReady) {
|
|
self2._initReady = self2.ready;
|
|
self2.ready = _fullyReady;
|
|
}
|
|
var initPromises = [];
|
|
function ignoreErrors() {
|
|
return Promise$1.resolve();
|
|
}
|
|
for (var j = 0; j < dbContext.forages.length; j++) {
|
|
var forage = dbContext.forages[j];
|
|
if (forage !== self2) {
|
|
initPromises.push(forage._initReady()["catch"](ignoreErrors));
|
|
}
|
|
}
|
|
var forages = dbContext.forages.slice(0);
|
|
return Promise$1.all(initPromises).then(function() {
|
|
dbInfo.db = dbContext.db;
|
|
return _getOriginalConnection(dbInfo);
|
|
}).then(function(db) {
|
|
dbInfo.db = db;
|
|
if (_isUpgradeNeeded(dbInfo, self2._defaultConfig.version)) {
|
|
return _getUpgradedConnection(dbInfo);
|
|
}
|
|
return db;
|
|
}).then(function(db) {
|
|
dbInfo.db = dbContext.db = db;
|
|
self2._dbInfo = dbInfo;
|
|
for (var k = 0; k < forages.length; k++) {
|
|
var forage2 = forages[k];
|
|
if (forage2 !== self2) {
|
|
forage2._dbInfo.db = dbInfo.db;
|
|
forage2._dbInfo.version = dbInfo.version;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
function getItem2(key2, callback) {
|
|
var self2 = this;
|
|
key2 = normalizeKey(key2);
|
|
var promise = new Promise$1(function(resolve, reject) {
|
|
self2.ready().then(function() {
|
|
createTransaction(self2._dbInfo, READ_ONLY, function(err, transaction) {
|
|
if (err) {
|
|
return reject(err);
|
|
}
|
|
try {
|
|
var store = transaction.objectStore(self2._dbInfo.storeName);
|
|
var req = store.get(key2);
|
|
req.onsuccess = function() {
|
|
var value = req.result;
|
|
if (value === void 0) {
|
|
value = null;
|
|
}
|
|
if (_isEncodedBlob(value)) {
|
|
value = _decodeBlob(value);
|
|
}
|
|
resolve(value);
|
|
};
|
|
req.onerror = function() {
|
|
reject(req.error);
|
|
};
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
});
|
|
})["catch"](reject);
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function iterate(iterator, callback) {
|
|
var self2 = this;
|
|
var promise = new Promise$1(function(resolve, reject) {
|
|
self2.ready().then(function() {
|
|
createTransaction(self2._dbInfo, READ_ONLY, function(err, transaction) {
|
|
if (err) {
|
|
return reject(err);
|
|
}
|
|
try {
|
|
var store = transaction.objectStore(self2._dbInfo.storeName);
|
|
var req = store.openCursor();
|
|
var iterationNumber = 1;
|
|
req.onsuccess = function() {
|
|
var cursor = req.result;
|
|
if (cursor) {
|
|
var value = cursor.value;
|
|
if (_isEncodedBlob(value)) {
|
|
value = _decodeBlob(value);
|
|
}
|
|
var result = iterator(value, cursor.key, iterationNumber++);
|
|
if (result !== void 0) {
|
|
resolve(result);
|
|
} else {
|
|
cursor["continue"]();
|
|
}
|
|
} else {
|
|
resolve();
|
|
}
|
|
};
|
|
req.onerror = function() {
|
|
reject(req.error);
|
|
};
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
});
|
|
})["catch"](reject);
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function setItem2(key2, value, callback) {
|
|
var self2 = this;
|
|
key2 = normalizeKey(key2);
|
|
var promise = new Promise$1(function(resolve, reject) {
|
|
var dbInfo;
|
|
self2.ready().then(function() {
|
|
dbInfo = self2._dbInfo;
|
|
if (toString.call(value) === "[object Blob]") {
|
|
return _checkBlobSupport(dbInfo.db).then(function(blobSupport) {
|
|
if (blobSupport) {
|
|
return value;
|
|
}
|
|
return _encodeBlob(value);
|
|
});
|
|
}
|
|
return value;
|
|
}).then(function(value2) {
|
|
createTransaction(self2._dbInfo, READ_WRITE, function(err, transaction) {
|
|
if (err) {
|
|
return reject(err);
|
|
}
|
|
try {
|
|
var store = transaction.objectStore(self2._dbInfo.storeName);
|
|
if (value2 === null) {
|
|
value2 = void 0;
|
|
}
|
|
var req = store.put(value2, key2);
|
|
transaction.oncomplete = function() {
|
|
if (value2 === void 0) {
|
|
value2 = null;
|
|
}
|
|
resolve(value2);
|
|
};
|
|
transaction.onabort = transaction.onerror = function() {
|
|
var err2 = req.error ? req.error : req.transaction.error;
|
|
reject(err2);
|
|
};
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
});
|
|
})["catch"](reject);
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function removeItem(key2, callback) {
|
|
var self2 = this;
|
|
key2 = normalizeKey(key2);
|
|
var promise = new Promise$1(function(resolve, reject) {
|
|
self2.ready().then(function() {
|
|
createTransaction(self2._dbInfo, READ_WRITE, function(err, transaction) {
|
|
if (err) {
|
|
return reject(err);
|
|
}
|
|
try {
|
|
var store = transaction.objectStore(self2._dbInfo.storeName);
|
|
var req = store["delete"](key2);
|
|
transaction.oncomplete = function() {
|
|
resolve();
|
|
};
|
|
transaction.onerror = function() {
|
|
reject(req.error);
|
|
};
|
|
transaction.onabort = function() {
|
|
var err2 = req.error ? req.error : req.transaction.error;
|
|
reject(err2);
|
|
};
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
});
|
|
})["catch"](reject);
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function clear(callback) {
|
|
var self2 = this;
|
|
var promise = new Promise$1(function(resolve, reject) {
|
|
self2.ready().then(function() {
|
|
createTransaction(self2._dbInfo, READ_WRITE, function(err, transaction) {
|
|
if (err) {
|
|
return reject(err);
|
|
}
|
|
try {
|
|
var store = transaction.objectStore(self2._dbInfo.storeName);
|
|
var req = store.clear();
|
|
transaction.oncomplete = function() {
|
|
resolve();
|
|
};
|
|
transaction.onabort = transaction.onerror = function() {
|
|
var err2 = req.error ? req.error : req.transaction.error;
|
|
reject(err2);
|
|
};
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
});
|
|
})["catch"](reject);
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function length(callback) {
|
|
var self2 = this;
|
|
var promise = new Promise$1(function(resolve, reject) {
|
|
self2.ready().then(function() {
|
|
createTransaction(self2._dbInfo, READ_ONLY, function(err, transaction) {
|
|
if (err) {
|
|
return reject(err);
|
|
}
|
|
try {
|
|
var store = transaction.objectStore(self2._dbInfo.storeName);
|
|
var req = store.count();
|
|
req.onsuccess = function() {
|
|
resolve(req.result);
|
|
};
|
|
req.onerror = function() {
|
|
reject(req.error);
|
|
};
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
});
|
|
})["catch"](reject);
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function key(n, callback) {
|
|
var self2 = this;
|
|
var promise = new Promise$1(function(resolve, reject) {
|
|
if (n < 0) {
|
|
resolve(null);
|
|
return;
|
|
}
|
|
self2.ready().then(function() {
|
|
createTransaction(self2._dbInfo, READ_ONLY, function(err, transaction) {
|
|
if (err) {
|
|
return reject(err);
|
|
}
|
|
try {
|
|
var store = transaction.objectStore(self2._dbInfo.storeName);
|
|
var advanced = false;
|
|
var req = store.openKeyCursor();
|
|
req.onsuccess = function() {
|
|
var cursor = req.result;
|
|
if (!cursor) {
|
|
resolve(null);
|
|
return;
|
|
}
|
|
if (n === 0) {
|
|
resolve(cursor.key);
|
|
} else {
|
|
if (!advanced) {
|
|
advanced = true;
|
|
cursor.advance(n);
|
|
} else {
|
|
resolve(cursor.key);
|
|
}
|
|
}
|
|
};
|
|
req.onerror = function() {
|
|
reject(req.error);
|
|
};
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
});
|
|
})["catch"](reject);
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function keys(callback) {
|
|
var self2 = this;
|
|
var promise = new Promise$1(function(resolve, reject) {
|
|
self2.ready().then(function() {
|
|
createTransaction(self2._dbInfo, READ_ONLY, function(err, transaction) {
|
|
if (err) {
|
|
return reject(err);
|
|
}
|
|
try {
|
|
var store = transaction.objectStore(self2._dbInfo.storeName);
|
|
var req = store.openKeyCursor();
|
|
var keys2 = [];
|
|
req.onsuccess = function() {
|
|
var cursor = req.result;
|
|
if (!cursor) {
|
|
resolve(keys2);
|
|
return;
|
|
}
|
|
keys2.push(cursor.key);
|
|
cursor["continue"]();
|
|
};
|
|
req.onerror = function() {
|
|
reject(req.error);
|
|
};
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
});
|
|
})["catch"](reject);
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function dropInstance(options, callback) {
|
|
callback = getCallback.apply(this, arguments);
|
|
var currentConfig = this.config();
|
|
options = typeof options !== "function" && options || {};
|
|
if (!options.name) {
|
|
options.name = options.name || currentConfig.name;
|
|
options.storeName = options.storeName || currentConfig.storeName;
|
|
}
|
|
var self2 = this;
|
|
var promise;
|
|
if (!options.name) {
|
|
promise = Promise$1.reject("Invalid arguments");
|
|
} else {
|
|
var isCurrentDb = options.name === currentConfig.name && self2._dbInfo.db;
|
|
var dbPromise = isCurrentDb ? Promise$1.resolve(self2._dbInfo.db) : _getOriginalConnection(options).then(function(db) {
|
|
var dbContext = dbContexts[options.name];
|
|
var forages = dbContext.forages;
|
|
dbContext.db = db;
|
|
for (var i = 0; i < forages.length; i++) {
|
|
forages[i]._dbInfo.db = db;
|
|
}
|
|
return db;
|
|
});
|
|
if (!options.storeName) {
|
|
promise = dbPromise.then(function(db) {
|
|
_deferReadiness(options);
|
|
var dbContext = dbContexts[options.name];
|
|
var forages = dbContext.forages;
|
|
db.close();
|
|
for (var i = 0; i < forages.length; i++) {
|
|
var forage = forages[i];
|
|
forage._dbInfo.db = null;
|
|
}
|
|
var dropDBPromise = new Promise$1(function(resolve, reject) {
|
|
var req = idb.deleteDatabase(options.name);
|
|
req.onerror = function() {
|
|
var db2 = req.result;
|
|
if (db2) {
|
|
db2.close();
|
|
}
|
|
reject(req.error);
|
|
};
|
|
req.onblocked = function() {
|
|
console.warn('dropInstance blocked for database "' + options.name + '" until all open connections are closed');
|
|
};
|
|
req.onsuccess = function() {
|
|
var db2 = req.result;
|
|
if (db2) {
|
|
db2.close();
|
|
}
|
|
resolve(db2);
|
|
};
|
|
});
|
|
return dropDBPromise.then(function(db2) {
|
|
dbContext.db = db2;
|
|
for (var i2 = 0; i2 < forages.length; i2++) {
|
|
var _forage = forages[i2];
|
|
_advanceReadiness(_forage._dbInfo);
|
|
}
|
|
})["catch"](function(err) {
|
|
(_rejectReadiness(options, err) || Promise$1.resolve())["catch"](function() {
|
|
});
|
|
throw err;
|
|
});
|
|
});
|
|
} else {
|
|
promise = dbPromise.then(function(db) {
|
|
if (!db.objectStoreNames.contains(options.storeName)) {
|
|
return;
|
|
}
|
|
var newVersion = db.version + 1;
|
|
_deferReadiness(options);
|
|
var dbContext = dbContexts[options.name];
|
|
var forages = dbContext.forages;
|
|
db.close();
|
|
for (var i = 0; i < forages.length; i++) {
|
|
var forage = forages[i];
|
|
forage._dbInfo.db = null;
|
|
forage._dbInfo.version = newVersion;
|
|
}
|
|
var dropObjectPromise = new Promise$1(function(resolve, reject) {
|
|
var req = idb.open(options.name, newVersion);
|
|
req.onerror = function(err) {
|
|
var db2 = req.result;
|
|
db2.close();
|
|
reject(err);
|
|
};
|
|
req.onupgradeneeded = function() {
|
|
var db2 = req.result;
|
|
db2.deleteObjectStore(options.storeName);
|
|
};
|
|
req.onsuccess = function() {
|
|
var db2 = req.result;
|
|
db2.close();
|
|
resolve(db2);
|
|
};
|
|
});
|
|
return dropObjectPromise.then(function(db2) {
|
|
dbContext.db = db2;
|
|
for (var j = 0; j < forages.length; j++) {
|
|
var _forage2 = forages[j];
|
|
_forage2._dbInfo.db = db2;
|
|
_advanceReadiness(_forage2._dbInfo);
|
|
}
|
|
})["catch"](function(err) {
|
|
(_rejectReadiness(options, err) || Promise$1.resolve())["catch"](function() {
|
|
});
|
|
throw err;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
var asyncStorage = {
|
|
_driver: "asyncStorage",
|
|
_initStorage,
|
|
_support: isIndexedDBValid(),
|
|
iterate,
|
|
getItem: getItem2,
|
|
setItem: setItem2,
|
|
removeItem,
|
|
clear,
|
|
length,
|
|
key,
|
|
keys,
|
|
dropInstance
|
|
};
|
|
function isWebSQLValid() {
|
|
return typeof openDatabase === "function";
|
|
}
|
|
var BASE_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
var BLOB_TYPE_PREFIX = "~~local_forage_type~";
|
|
var BLOB_TYPE_PREFIX_REGEX = /^~~local_forage_type~([^~]+)~/;
|
|
var SERIALIZED_MARKER = "__lfsc__:";
|
|
var SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER.length;
|
|
var TYPE_ARRAYBUFFER = "arbf";
|
|
var TYPE_BLOB = "blob";
|
|
var TYPE_INT8ARRAY = "si08";
|
|
var TYPE_UINT8ARRAY = "ui08";
|
|
var TYPE_UINT8CLAMPEDARRAY = "uic8";
|
|
var TYPE_INT16ARRAY = "si16";
|
|
var TYPE_INT32ARRAY = "si32";
|
|
var TYPE_UINT16ARRAY = "ur16";
|
|
var TYPE_UINT32ARRAY = "ui32";
|
|
var TYPE_FLOAT32ARRAY = "fl32";
|
|
var TYPE_FLOAT64ARRAY = "fl64";
|
|
var TYPE_SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER_LENGTH + TYPE_ARRAYBUFFER.length;
|
|
var toString$1 = Object.prototype.toString;
|
|
function stringToBuffer(serializedString) {
|
|
var bufferLength = serializedString.length * 0.75;
|
|
var len = serializedString.length;
|
|
var i;
|
|
var p = 0;
|
|
var encoded1, encoded2, encoded3, encoded4;
|
|
if (serializedString[serializedString.length - 1] === "=") {
|
|
bufferLength--;
|
|
if (serializedString[serializedString.length - 2] === "=") {
|
|
bufferLength--;
|
|
}
|
|
}
|
|
var buffer = new ArrayBuffer(bufferLength);
|
|
var bytes = new Uint8Array(buffer);
|
|
for (i = 0; i < len; i += 4) {
|
|
encoded1 = BASE_CHARS.indexOf(serializedString[i]);
|
|
encoded2 = BASE_CHARS.indexOf(serializedString[i + 1]);
|
|
encoded3 = BASE_CHARS.indexOf(serializedString[i + 2]);
|
|
encoded4 = BASE_CHARS.indexOf(serializedString[i + 3]);
|
|
bytes[p++] = encoded1 << 2 | encoded2 >> 4;
|
|
bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
|
|
bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
|
|
}
|
|
return buffer;
|
|
}
|
|
function bufferToString(buffer) {
|
|
var bytes = new Uint8Array(buffer);
|
|
var base64String = "";
|
|
var i;
|
|
for (i = 0; i < bytes.length; i += 3) {
|
|
base64String += BASE_CHARS[bytes[i] >> 2];
|
|
base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];
|
|
base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];
|
|
base64String += BASE_CHARS[bytes[i + 2] & 63];
|
|
}
|
|
if (bytes.length % 3 === 2) {
|
|
base64String = base64String.substring(0, base64String.length - 1) + "=";
|
|
} else if (bytes.length % 3 === 1) {
|
|
base64String = base64String.substring(0, base64String.length - 2) + "==";
|
|
}
|
|
return base64String;
|
|
}
|
|
function serialize(value, callback) {
|
|
var valueType = "";
|
|
if (value) {
|
|
valueType = toString$1.call(value);
|
|
}
|
|
if (value && (valueType === "[object ArrayBuffer]" || value.buffer && toString$1.call(value.buffer) === "[object ArrayBuffer]")) {
|
|
var buffer;
|
|
var marker = SERIALIZED_MARKER;
|
|
if (value instanceof ArrayBuffer) {
|
|
buffer = value;
|
|
marker += TYPE_ARRAYBUFFER;
|
|
} else {
|
|
buffer = value.buffer;
|
|
if (valueType === "[object Int8Array]") {
|
|
marker += TYPE_INT8ARRAY;
|
|
} else if (valueType === "[object Uint8Array]") {
|
|
marker += TYPE_UINT8ARRAY;
|
|
} else if (valueType === "[object Uint8ClampedArray]") {
|
|
marker += TYPE_UINT8CLAMPEDARRAY;
|
|
} else if (valueType === "[object Int16Array]") {
|
|
marker += TYPE_INT16ARRAY;
|
|
} else if (valueType === "[object Uint16Array]") {
|
|
marker += TYPE_UINT16ARRAY;
|
|
} else if (valueType === "[object Int32Array]") {
|
|
marker += TYPE_INT32ARRAY;
|
|
} else if (valueType === "[object Uint32Array]") {
|
|
marker += TYPE_UINT32ARRAY;
|
|
} else if (valueType === "[object Float32Array]") {
|
|
marker += TYPE_FLOAT32ARRAY;
|
|
} else if (valueType === "[object Float64Array]") {
|
|
marker += TYPE_FLOAT64ARRAY;
|
|
} else {
|
|
callback(new Error("Failed to get type for BinaryArray"));
|
|
}
|
|
}
|
|
callback(marker + bufferToString(buffer));
|
|
} else if (valueType === "[object Blob]") {
|
|
var fileReader = new FileReader();
|
|
fileReader.onload = function() {
|
|
var str = BLOB_TYPE_PREFIX + value.type + "~" + bufferToString(this.result);
|
|
callback(SERIALIZED_MARKER + TYPE_BLOB + str);
|
|
};
|
|
fileReader.readAsArrayBuffer(value);
|
|
} else {
|
|
try {
|
|
callback(JSON.stringify(value));
|
|
} catch (e) {
|
|
console.error("Couldn't convert value into a JSON string: ", value);
|
|
callback(null, e);
|
|
}
|
|
}
|
|
}
|
|
function deserialize(value) {
|
|
if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) {
|
|
return JSON.parse(value);
|
|
}
|
|
var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH);
|
|
var type = value.substring(SERIALIZED_MARKER_LENGTH, TYPE_SERIALIZED_MARKER_LENGTH);
|
|
var blobType;
|
|
if (type === TYPE_BLOB && BLOB_TYPE_PREFIX_REGEX.test(serializedString)) {
|
|
var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX);
|
|
blobType = matcher[1];
|
|
serializedString = serializedString.substring(matcher[0].length);
|
|
}
|
|
var buffer = stringToBuffer(serializedString);
|
|
switch (type) {
|
|
case TYPE_ARRAYBUFFER:
|
|
return buffer;
|
|
case TYPE_BLOB:
|
|
return createBlob([buffer], { type: blobType });
|
|
case TYPE_INT8ARRAY:
|
|
return new Int8Array(buffer);
|
|
case TYPE_UINT8ARRAY:
|
|
return new Uint8Array(buffer);
|
|
case TYPE_UINT8CLAMPEDARRAY:
|
|
return new Uint8ClampedArray(buffer);
|
|
case TYPE_INT16ARRAY:
|
|
return new Int16Array(buffer);
|
|
case TYPE_UINT16ARRAY:
|
|
return new Uint16Array(buffer);
|
|
case TYPE_INT32ARRAY:
|
|
return new Int32Array(buffer);
|
|
case TYPE_UINT32ARRAY:
|
|
return new Uint32Array(buffer);
|
|
case TYPE_FLOAT32ARRAY:
|
|
return new Float32Array(buffer);
|
|
case TYPE_FLOAT64ARRAY:
|
|
return new Float64Array(buffer);
|
|
default:
|
|
throw new Error("Unkown type: " + type);
|
|
}
|
|
}
|
|
var localforageSerializer = {
|
|
serialize,
|
|
deserialize,
|
|
stringToBuffer,
|
|
bufferToString
|
|
};
|
|
function createDbTable(t, dbInfo, callback, errorCallback) {
|
|
t.executeSql("CREATE TABLE IF NOT EXISTS " + dbInfo.storeName + " (id INTEGER PRIMARY KEY, key unique, value)", [], callback, errorCallback);
|
|
}
|
|
function _initStorage$1(options) {
|
|
var self2 = this;
|
|
var dbInfo = {
|
|
db: null
|
|
};
|
|
if (options) {
|
|
for (var i in options) {
|
|
dbInfo[i] = typeof options[i] !== "string" ? options[i].toString() : options[i];
|
|
}
|
|
}
|
|
var dbInfoPromise = new Promise$1(function(resolve, reject) {
|
|
try {
|
|
dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);
|
|
} catch (e) {
|
|
return reject(e);
|
|
}
|
|
dbInfo.db.transaction(function(t) {
|
|
createDbTable(t, dbInfo, function() {
|
|
self2._dbInfo = dbInfo;
|
|
resolve();
|
|
}, function(t2, error) {
|
|
reject(error);
|
|
});
|
|
}, reject);
|
|
});
|
|
dbInfo.serializer = localforageSerializer;
|
|
return dbInfoPromise;
|
|
}
|
|
function tryExecuteSql(t, dbInfo, sqlStatement, args, callback, errorCallback) {
|
|
t.executeSql(sqlStatement, args, callback, function(t2, error) {
|
|
if (error.code === error.SYNTAX_ERR) {
|
|
t2.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?", [dbInfo.storeName], function(t3, results) {
|
|
if (!results.rows.length) {
|
|
createDbTable(t3, dbInfo, function() {
|
|
t3.executeSql(sqlStatement, args, callback, errorCallback);
|
|
}, errorCallback);
|
|
} else {
|
|
errorCallback(t3, error);
|
|
}
|
|
}, errorCallback);
|
|
} else {
|
|
errorCallback(t2, error);
|
|
}
|
|
}, errorCallback);
|
|
}
|
|
function getItem$1(key2, callback) {
|
|
var self2 = this;
|
|
key2 = normalizeKey(key2);
|
|
var promise = new Promise$1(function(resolve, reject) {
|
|
self2.ready().then(function() {
|
|
var dbInfo = self2._dbInfo;
|
|
dbInfo.db.transaction(function(t) {
|
|
tryExecuteSql(t, dbInfo, "SELECT * FROM " + dbInfo.storeName + " WHERE key = ? LIMIT 1", [key2], function(t2, results) {
|
|
var result = results.rows.length ? results.rows.item(0).value : null;
|
|
if (result) {
|
|
result = dbInfo.serializer.deserialize(result);
|
|
}
|
|
resolve(result);
|
|
}, function(t2, error) {
|
|
reject(error);
|
|
});
|
|
});
|
|
})["catch"](reject);
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function iterate$1(iterator, callback) {
|
|
var self2 = this;
|
|
var promise = new Promise$1(function(resolve, reject) {
|
|
self2.ready().then(function() {
|
|
var dbInfo = self2._dbInfo;
|
|
dbInfo.db.transaction(function(t) {
|
|
tryExecuteSql(t, dbInfo, "SELECT * FROM " + dbInfo.storeName, [], function(t2, results) {
|
|
var rows = results.rows;
|
|
var length2 = rows.length;
|
|
for (var i = 0; i < length2; i++) {
|
|
var item = rows.item(i);
|
|
var result = item.value;
|
|
if (result) {
|
|
result = dbInfo.serializer.deserialize(result);
|
|
}
|
|
result = iterator(result, item.key, i + 1);
|
|
if (result !== void 0) {
|
|
resolve(result);
|
|
return;
|
|
}
|
|
}
|
|
resolve();
|
|
}, function(t2, error) {
|
|
reject(error);
|
|
});
|
|
});
|
|
})["catch"](reject);
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function _setItem(key2, value, callback, retriesLeft) {
|
|
var self2 = this;
|
|
key2 = normalizeKey(key2);
|
|
var promise = new Promise$1(function(resolve, reject) {
|
|
self2.ready().then(function() {
|
|
if (value === void 0) {
|
|
value = null;
|
|
}
|
|
var originalValue = value;
|
|
var dbInfo = self2._dbInfo;
|
|
dbInfo.serializer.serialize(value, function(value2, error) {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
dbInfo.db.transaction(function(t) {
|
|
tryExecuteSql(t, dbInfo, "INSERT OR REPLACE INTO " + dbInfo.storeName + " (key, value) VALUES (?, ?)", [key2, value2], function() {
|
|
resolve(originalValue);
|
|
}, function(t2, error2) {
|
|
reject(error2);
|
|
});
|
|
}, function(sqlError) {
|
|
if (sqlError.code === sqlError.QUOTA_ERR) {
|
|
if (retriesLeft > 0) {
|
|
resolve(_setItem.apply(self2, [key2, originalValue, callback, retriesLeft - 1]));
|
|
return;
|
|
}
|
|
reject(sqlError);
|
|
}
|
|
});
|
|
}
|
|
});
|
|
})["catch"](reject);
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function setItem$1(key2, value, callback) {
|
|
return _setItem.apply(this, [key2, value, callback, 1]);
|
|
}
|
|
function removeItem$1(key2, callback) {
|
|
var self2 = this;
|
|
key2 = normalizeKey(key2);
|
|
var promise = new Promise$1(function(resolve, reject) {
|
|
self2.ready().then(function() {
|
|
var dbInfo = self2._dbInfo;
|
|
dbInfo.db.transaction(function(t) {
|
|
tryExecuteSql(t, dbInfo, "DELETE FROM " + dbInfo.storeName + " WHERE key = ?", [key2], function() {
|
|
resolve();
|
|
}, function(t2, error) {
|
|
reject(error);
|
|
});
|
|
});
|
|
})["catch"](reject);
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function clear$1(callback) {
|
|
var self2 = this;
|
|
var promise = new Promise$1(function(resolve, reject) {
|
|
self2.ready().then(function() {
|
|
var dbInfo = self2._dbInfo;
|
|
dbInfo.db.transaction(function(t) {
|
|
tryExecuteSql(t, dbInfo, "DELETE FROM " + dbInfo.storeName, [], function() {
|
|
resolve();
|
|
}, function(t2, error) {
|
|
reject(error);
|
|
});
|
|
});
|
|
})["catch"](reject);
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function length$1(callback) {
|
|
var self2 = this;
|
|
var promise = new Promise$1(function(resolve, reject) {
|
|
self2.ready().then(function() {
|
|
var dbInfo = self2._dbInfo;
|
|
dbInfo.db.transaction(function(t) {
|
|
tryExecuteSql(t, dbInfo, "SELECT COUNT(key) as c FROM " + dbInfo.storeName, [], function(t2, results) {
|
|
var result = results.rows.item(0).c;
|
|
resolve(result);
|
|
}, function(t2, error) {
|
|
reject(error);
|
|
});
|
|
});
|
|
})["catch"](reject);
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function key$1(n, callback) {
|
|
var self2 = this;
|
|
var promise = new Promise$1(function(resolve, reject) {
|
|
self2.ready().then(function() {
|
|
var dbInfo = self2._dbInfo;
|
|
dbInfo.db.transaction(function(t) {
|
|
tryExecuteSql(t, dbInfo, "SELECT key FROM " + dbInfo.storeName + " WHERE id = ? LIMIT 1", [n + 1], function(t2, results) {
|
|
var result = results.rows.length ? results.rows.item(0).key : null;
|
|
resolve(result);
|
|
}, function(t2, error) {
|
|
reject(error);
|
|
});
|
|
});
|
|
})["catch"](reject);
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function keys$1(callback) {
|
|
var self2 = this;
|
|
var promise = new Promise$1(function(resolve, reject) {
|
|
self2.ready().then(function() {
|
|
var dbInfo = self2._dbInfo;
|
|
dbInfo.db.transaction(function(t) {
|
|
tryExecuteSql(t, dbInfo, "SELECT key FROM " + dbInfo.storeName, [], function(t2, results) {
|
|
var keys2 = [];
|
|
for (var i = 0; i < results.rows.length; i++) {
|
|
keys2.push(results.rows.item(i).key);
|
|
}
|
|
resolve(keys2);
|
|
}, function(t2, error) {
|
|
reject(error);
|
|
});
|
|
});
|
|
})["catch"](reject);
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function getAllStoreNames(db) {
|
|
return new Promise$1(function(resolve, reject) {
|
|
db.transaction(function(t) {
|
|
t.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'", [], function(t2, results) {
|
|
var storeNames = [];
|
|
for (var i = 0; i < results.rows.length; i++) {
|
|
storeNames.push(results.rows.item(i).name);
|
|
}
|
|
resolve({
|
|
db,
|
|
storeNames
|
|
});
|
|
}, function(t2, error) {
|
|
reject(error);
|
|
});
|
|
}, function(sqlError) {
|
|
reject(sqlError);
|
|
});
|
|
});
|
|
}
|
|
function dropInstance$1(options, callback) {
|
|
callback = getCallback.apply(this, arguments);
|
|
var currentConfig = this.config();
|
|
options = typeof options !== "function" && options || {};
|
|
if (!options.name) {
|
|
options.name = options.name || currentConfig.name;
|
|
options.storeName = options.storeName || currentConfig.storeName;
|
|
}
|
|
var self2 = this;
|
|
var promise;
|
|
if (!options.name) {
|
|
promise = Promise$1.reject("Invalid arguments");
|
|
} else {
|
|
promise = new Promise$1(function(resolve) {
|
|
var db;
|
|
if (options.name === currentConfig.name) {
|
|
db = self2._dbInfo.db;
|
|
} else {
|
|
db = openDatabase(options.name, "", "", 0);
|
|
}
|
|
if (!options.storeName) {
|
|
resolve(getAllStoreNames(db));
|
|
} else {
|
|
resolve({
|
|
db,
|
|
storeNames: [options.storeName]
|
|
});
|
|
}
|
|
}).then(function(operationInfo) {
|
|
return new Promise$1(function(resolve, reject) {
|
|
operationInfo.db.transaction(function(t) {
|
|
function dropTable(storeName) {
|
|
return new Promise$1(function(resolve2, reject2) {
|
|
t.executeSql("DROP TABLE IF EXISTS " + storeName, [], function() {
|
|
resolve2();
|
|
}, function(t2, error) {
|
|
reject2(error);
|
|
});
|
|
});
|
|
}
|
|
var operations = [];
|
|
for (var i = 0, len = operationInfo.storeNames.length; i < len; i++) {
|
|
operations.push(dropTable(operationInfo.storeNames[i]));
|
|
}
|
|
Promise$1.all(operations).then(function() {
|
|
resolve();
|
|
})["catch"](function(e) {
|
|
reject(e);
|
|
});
|
|
}, function(sqlError) {
|
|
reject(sqlError);
|
|
});
|
|
});
|
|
});
|
|
}
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
var webSQLStorage = {
|
|
_driver: "webSQLStorage",
|
|
_initStorage: _initStorage$1,
|
|
_support: isWebSQLValid(),
|
|
iterate: iterate$1,
|
|
getItem: getItem$1,
|
|
setItem: setItem$1,
|
|
removeItem: removeItem$1,
|
|
clear: clear$1,
|
|
length: length$1,
|
|
key: key$1,
|
|
keys: keys$1,
|
|
dropInstance: dropInstance$1
|
|
};
|
|
function isLocalStorageValid() {
|
|
try {
|
|
return typeof localStorage !== "undefined" && "setItem" in localStorage && !!localStorage.setItem;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getKeyPrefix(options, defaultConfig) {
|
|
var keyPrefix = options.name + "/";
|
|
if (options.storeName !== defaultConfig.storeName) {
|
|
keyPrefix += options.storeName + "/";
|
|
}
|
|
return keyPrefix;
|
|
}
|
|
function checkIfLocalStorageThrows() {
|
|
var localStorageTestKey = "_localforage_support_test";
|
|
try {
|
|
localStorage.setItem(localStorageTestKey, true);
|
|
localStorage.removeItem(localStorageTestKey);
|
|
return false;
|
|
} catch (e) {
|
|
return true;
|
|
}
|
|
}
|
|
function _isLocalStorageUsable() {
|
|
return !checkIfLocalStorageThrows() || localStorage.length > 0;
|
|
}
|
|
function _initStorage$2(options) {
|
|
var self2 = this;
|
|
var dbInfo = {};
|
|
if (options) {
|
|
for (var i in options) {
|
|
dbInfo[i] = options[i];
|
|
}
|
|
}
|
|
dbInfo.keyPrefix = _getKeyPrefix(options, self2._defaultConfig);
|
|
if (!_isLocalStorageUsable()) {
|
|
return Promise$1.reject();
|
|
}
|
|
self2._dbInfo = dbInfo;
|
|
dbInfo.serializer = localforageSerializer;
|
|
return Promise$1.resolve();
|
|
}
|
|
function clear$2(callback) {
|
|
var self2 = this;
|
|
var promise = self2.ready().then(function() {
|
|
var keyPrefix = self2._dbInfo.keyPrefix;
|
|
for (var i = localStorage.length - 1; i >= 0; i--) {
|
|
var key2 = localStorage.key(i);
|
|
if (key2.indexOf(keyPrefix) === 0) {
|
|
localStorage.removeItem(key2);
|
|
}
|
|
}
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function getItem$2(key2, callback) {
|
|
var self2 = this;
|
|
key2 = normalizeKey(key2);
|
|
var promise = self2.ready().then(function() {
|
|
var dbInfo = self2._dbInfo;
|
|
var result = localStorage.getItem(dbInfo.keyPrefix + key2);
|
|
if (result) {
|
|
result = dbInfo.serializer.deserialize(result);
|
|
}
|
|
return result;
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function iterate$2(iterator, callback) {
|
|
var self2 = this;
|
|
var promise = self2.ready().then(function() {
|
|
var dbInfo = self2._dbInfo;
|
|
var keyPrefix = dbInfo.keyPrefix;
|
|
var keyPrefixLength = keyPrefix.length;
|
|
var length2 = localStorage.length;
|
|
var iterationNumber = 1;
|
|
for (var i = 0; i < length2; i++) {
|
|
var key2 = localStorage.key(i);
|
|
if (key2.indexOf(keyPrefix) !== 0) {
|
|
continue;
|
|
}
|
|
var value = localStorage.getItem(key2);
|
|
if (value) {
|
|
value = dbInfo.serializer.deserialize(value);
|
|
}
|
|
value = iterator(value, key2.substring(keyPrefixLength), iterationNumber++);
|
|
if (value !== void 0) {
|
|
return value;
|
|
}
|
|
}
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function key$2(n, callback) {
|
|
var self2 = this;
|
|
var promise = self2.ready().then(function() {
|
|
var dbInfo = self2._dbInfo;
|
|
var result;
|
|
try {
|
|
result = localStorage.key(n);
|
|
} catch (error) {
|
|
result = null;
|
|
}
|
|
if (result) {
|
|
result = result.substring(dbInfo.keyPrefix.length);
|
|
}
|
|
return result;
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function keys$2(callback) {
|
|
var self2 = this;
|
|
var promise = self2.ready().then(function() {
|
|
var dbInfo = self2._dbInfo;
|
|
var length2 = localStorage.length;
|
|
var keys2 = [];
|
|
for (var i = 0; i < length2; i++) {
|
|
var itemKey = localStorage.key(i);
|
|
if (itemKey.indexOf(dbInfo.keyPrefix) === 0) {
|
|
keys2.push(itemKey.substring(dbInfo.keyPrefix.length));
|
|
}
|
|
}
|
|
return keys2;
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function length$2(callback) {
|
|
var self2 = this;
|
|
var promise = self2.keys().then(function(keys2) {
|
|
return keys2.length;
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function removeItem$2(key2, callback) {
|
|
var self2 = this;
|
|
key2 = normalizeKey(key2);
|
|
var promise = self2.ready().then(function() {
|
|
var dbInfo = self2._dbInfo;
|
|
localStorage.removeItem(dbInfo.keyPrefix + key2);
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function setItem$2(key2, value, callback) {
|
|
var self2 = this;
|
|
key2 = normalizeKey(key2);
|
|
var promise = self2.ready().then(function() {
|
|
if (value === void 0) {
|
|
value = null;
|
|
}
|
|
var originalValue = value;
|
|
return new Promise$1(function(resolve, reject) {
|
|
var dbInfo = self2._dbInfo;
|
|
dbInfo.serializer.serialize(value, function(value2, error) {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
try {
|
|
localStorage.setItem(dbInfo.keyPrefix + key2, value2);
|
|
resolve(originalValue);
|
|
} catch (e) {
|
|
if (e.name === "QuotaExceededError" || e.name === "NS_ERROR_DOM_QUOTA_REACHED") {
|
|
reject(e);
|
|
}
|
|
reject(e);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
function dropInstance$2(options, callback) {
|
|
callback = getCallback.apply(this, arguments);
|
|
options = typeof options !== "function" && options || {};
|
|
if (!options.name) {
|
|
var currentConfig = this.config();
|
|
options.name = options.name || currentConfig.name;
|
|
options.storeName = options.storeName || currentConfig.storeName;
|
|
}
|
|
var self2 = this;
|
|
var promise;
|
|
if (!options.name) {
|
|
promise = Promise$1.reject("Invalid arguments");
|
|
} else {
|
|
promise = new Promise$1(function(resolve) {
|
|
if (!options.storeName) {
|
|
resolve(options.name + "/");
|
|
} else {
|
|
resolve(_getKeyPrefix(options, self2._defaultConfig));
|
|
}
|
|
}).then(function(keyPrefix) {
|
|
for (var i = localStorage.length - 1; i >= 0; i--) {
|
|
var key2 = localStorage.key(i);
|
|
if (key2.indexOf(keyPrefix) === 0) {
|
|
localStorage.removeItem(key2);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
executeCallback(promise, callback);
|
|
return promise;
|
|
}
|
|
var localStorageWrapper = {
|
|
_driver: "localStorageWrapper",
|
|
_initStorage: _initStorage$2,
|
|
_support: isLocalStorageValid(),
|
|
iterate: iterate$2,
|
|
getItem: getItem$2,
|
|
setItem: setItem$2,
|
|
removeItem: removeItem$2,
|
|
clear: clear$2,
|
|
length: length$2,
|
|
key: key$2,
|
|
keys: keys$2,
|
|
dropInstance: dropInstance$2
|
|
};
|
|
var sameValue = function sameValue2(x, y) {
|
|
return x === y || typeof x === "number" && typeof y === "number" && isNaN(x) && isNaN(y);
|
|
};
|
|
var includes = function includes2(array, searchElement) {
|
|
var len = array.length;
|
|
var i = 0;
|
|
while (i < len) {
|
|
if (sameValue(array[i], searchElement)) {
|
|
return true;
|
|
}
|
|
i++;
|
|
}
|
|
return false;
|
|
};
|
|
var isArray = Array.isArray || function(arg) {
|
|
return Object.prototype.toString.call(arg) === "[object Array]";
|
|
};
|
|
var DefinedDrivers = {};
|
|
var DriverSupport = {};
|
|
var DefaultDrivers = {
|
|
INDEXEDDB: asyncStorage,
|
|
WEBSQL: webSQLStorage,
|
|
LOCALSTORAGE: localStorageWrapper
|
|
};
|
|
var DefaultDriverOrder = [DefaultDrivers.INDEXEDDB._driver, DefaultDrivers.WEBSQL._driver, DefaultDrivers.LOCALSTORAGE._driver];
|
|
var OptionalDriverMethods = ["dropInstance"];
|
|
var LibraryMethods = ["clear", "getItem", "iterate", "key", "keys", "length", "removeItem", "setItem"].concat(OptionalDriverMethods);
|
|
var DefaultConfig = {
|
|
description: "",
|
|
driver: DefaultDriverOrder.slice(),
|
|
name: "localforage",
|
|
size: 4980736,
|
|
storeName: "keyvaluepairs",
|
|
version: 1
|
|
};
|
|
function callWhenReady(localForageInstance, libraryMethod) {
|
|
localForageInstance[libraryMethod] = function() {
|
|
var _args = arguments;
|
|
return localForageInstance.ready().then(function() {
|
|
return localForageInstance[libraryMethod].apply(localForageInstance, _args);
|
|
});
|
|
};
|
|
}
|
|
function extend() {
|
|
for (var i = 1; i < arguments.length; i++) {
|
|
var arg = arguments[i];
|
|
if (arg) {
|
|
for (var _key in arg) {
|
|
if (arg.hasOwnProperty(_key)) {
|
|
if (isArray(arg[_key])) {
|
|
arguments[0][_key] = arg[_key].slice();
|
|
} else {
|
|
arguments[0][_key] = arg[_key];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return arguments[0];
|
|
}
|
|
var LocalForage = function() {
|
|
function LocalForage2(options) {
|
|
_classCallCheck(this, LocalForage2);
|
|
for (var driverTypeKey in DefaultDrivers) {
|
|
if (DefaultDrivers.hasOwnProperty(driverTypeKey)) {
|
|
var driver = DefaultDrivers[driverTypeKey];
|
|
var driverName = driver._driver;
|
|
this[driverTypeKey] = driverName;
|
|
if (!DefinedDrivers[driverName]) {
|
|
this.defineDriver(driver);
|
|
}
|
|
}
|
|
}
|
|
this._defaultConfig = extend({}, DefaultConfig);
|
|
this._config = extend({}, this._defaultConfig, options);
|
|
this._driverSet = null;
|
|
this._initDriver = null;
|
|
this._ready = false;
|
|
this._dbInfo = null;
|
|
this._wrapLibraryMethodsWithReady();
|
|
this.setDriver(this._config.driver)["catch"](function() {
|
|
});
|
|
}
|
|
LocalForage2.prototype.config = function config(options) {
|
|
if ((typeof options === "undefined" ? "undefined" : _typeof(options)) === "object") {
|
|
if (this._ready) {
|
|
return new Error("Can't call config() after localforage has been used.");
|
|
}
|
|
for (var i in options) {
|
|
if (i === "storeName") {
|
|
options[i] = options[i].replace(/\W/g, "_");
|
|
}
|
|
if (i === "version" && typeof options[i] !== "number") {
|
|
return new Error("Database version must be a number.");
|
|
}
|
|
this._config[i] = options[i];
|
|
}
|
|
if ("driver" in options && options.driver) {
|
|
return this.setDriver(this._config.driver);
|
|
}
|
|
return true;
|
|
} else if (typeof options === "string") {
|
|
return this._config[options];
|
|
} else {
|
|
return this._config;
|
|
}
|
|
};
|
|
LocalForage2.prototype.defineDriver = function defineDriver(driverObject, callback, errorCallback) {
|
|
var promise = new Promise$1(function(resolve, reject) {
|
|
try {
|
|
var driverName = driverObject._driver;
|
|
var complianceError = new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");
|
|
if (!driverObject._driver) {
|
|
reject(complianceError);
|
|
return;
|
|
}
|
|
var driverMethods = LibraryMethods.concat("_initStorage");
|
|
for (var i = 0, len = driverMethods.length; i < len; i++) {
|
|
var driverMethodName = driverMethods[i];
|
|
var isRequired = !includes(OptionalDriverMethods, driverMethodName);
|
|
if ((isRequired || driverObject[driverMethodName]) && typeof driverObject[driverMethodName] !== "function") {
|
|
reject(complianceError);
|
|
return;
|
|
}
|
|
}
|
|
var configureMissingMethods = function configureMissingMethods2() {
|
|
var methodNotImplementedFactory = function methodNotImplementedFactory2(methodName) {
|
|
return function() {
|
|
var error = new Error("Method " + methodName + " is not implemented by the current driver");
|
|
var promise2 = Promise$1.reject(error);
|
|
executeCallback(promise2, arguments[arguments.length - 1]);
|
|
return promise2;
|
|
};
|
|
};
|
|
for (var _i = 0, _len = OptionalDriverMethods.length; _i < _len; _i++) {
|
|
var optionalDriverMethod = OptionalDriverMethods[_i];
|
|
if (!driverObject[optionalDriverMethod]) {
|
|
driverObject[optionalDriverMethod] = methodNotImplementedFactory(optionalDriverMethod);
|
|
}
|
|
}
|
|
};
|
|
configureMissingMethods();
|
|
var setDriverSupport = function setDriverSupport2(support) {
|
|
if (DefinedDrivers[driverName]) {
|
|
console.info("Redefining LocalForage driver: " + driverName);
|
|
}
|
|
DefinedDrivers[driverName] = driverObject;
|
|
DriverSupport[driverName] = support;
|
|
resolve();
|
|
};
|
|
if ("_support" in driverObject) {
|
|
if (driverObject._support && typeof driverObject._support === "function") {
|
|
driverObject._support().then(setDriverSupport, reject);
|
|
} else {
|
|
setDriverSupport(!!driverObject._support);
|
|
}
|
|
} else {
|
|
setDriverSupport(true);
|
|
}
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
});
|
|
executeTwoCallbacks(promise, callback, errorCallback);
|
|
return promise;
|
|
};
|
|
LocalForage2.prototype.driver = function driver() {
|
|
return this._driver || null;
|
|
};
|
|
LocalForage2.prototype.getDriver = function getDriver(driverName, callback, errorCallback) {
|
|
var getDriverPromise = DefinedDrivers[driverName] ? Promise$1.resolve(DefinedDrivers[driverName]) : Promise$1.reject(new Error("Driver not found."));
|
|
executeTwoCallbacks(getDriverPromise, callback, errorCallback);
|
|
return getDriverPromise;
|
|
};
|
|
LocalForage2.prototype.getSerializer = function getSerializer(callback) {
|
|
var serializerPromise = Promise$1.resolve(localforageSerializer);
|
|
executeTwoCallbacks(serializerPromise, callback);
|
|
return serializerPromise;
|
|
};
|
|
LocalForage2.prototype.ready = function ready(callback) {
|
|
var self2 = this;
|
|
var promise = self2._driverSet.then(function() {
|
|
if (self2._ready === null) {
|
|
self2._ready = self2._initDriver();
|
|
}
|
|
return self2._ready;
|
|
});
|
|
executeTwoCallbacks(promise, callback, callback);
|
|
return promise;
|
|
};
|
|
LocalForage2.prototype.setDriver = function setDriver(drivers, callback, errorCallback) {
|
|
var self2 = this;
|
|
if (!isArray(drivers)) {
|
|
drivers = [drivers];
|
|
}
|
|
var supportedDrivers = this._getSupportedDrivers(drivers);
|
|
function setDriverToConfig() {
|
|
self2._config.driver = self2.driver();
|
|
}
|
|
function extendSelfWithDriver(driver) {
|
|
self2._extend(driver);
|
|
setDriverToConfig();
|
|
self2._ready = self2._initStorage(self2._config);
|
|
return self2._ready;
|
|
}
|
|
function initDriver(supportedDrivers2) {
|
|
return function() {
|
|
var currentDriverIndex = 0;
|
|
function driverPromiseLoop() {
|
|
while (currentDriverIndex < supportedDrivers2.length) {
|
|
var driverName = supportedDrivers2[currentDriverIndex];
|
|
currentDriverIndex++;
|
|
self2._dbInfo = null;
|
|
self2._ready = null;
|
|
return self2.getDriver(driverName).then(extendSelfWithDriver)["catch"](driverPromiseLoop);
|
|
}
|
|
setDriverToConfig();
|
|
var error = new Error("No available storage method found.");
|
|
self2._driverSet = Promise$1.reject(error);
|
|
return self2._driverSet;
|
|
}
|
|
return driverPromiseLoop();
|
|
};
|
|
}
|
|
var oldDriverSetDone = this._driverSet !== null ? this._driverSet["catch"](function() {
|
|
return Promise$1.resolve();
|
|
}) : Promise$1.resolve();
|
|
this._driverSet = oldDriverSetDone.then(function() {
|
|
var driverName = supportedDrivers[0];
|
|
self2._dbInfo = null;
|
|
self2._ready = null;
|
|
return self2.getDriver(driverName).then(function(driver) {
|
|
self2._driver = driver._driver;
|
|
setDriverToConfig();
|
|
self2._wrapLibraryMethodsWithReady();
|
|
self2._initDriver = initDriver(supportedDrivers);
|
|
});
|
|
})["catch"](function() {
|
|
setDriverToConfig();
|
|
var error = new Error("No available storage method found.");
|
|
self2._driverSet = Promise$1.reject(error);
|
|
return self2._driverSet;
|
|
});
|
|
executeTwoCallbacks(this._driverSet, callback, errorCallback);
|
|
return this._driverSet;
|
|
};
|
|
LocalForage2.prototype.supports = function supports(driverName) {
|
|
return !!DriverSupport[driverName];
|
|
};
|
|
LocalForage2.prototype._extend = function _extend(libraryMethodsAndProperties) {
|
|
extend(this, libraryMethodsAndProperties);
|
|
};
|
|
LocalForage2.prototype._getSupportedDrivers = function _getSupportedDrivers(drivers) {
|
|
var supportedDrivers = [];
|
|
for (var i = 0, len = drivers.length; i < len; i++) {
|
|
var driverName = drivers[i];
|
|
if (this.supports(driverName)) {
|
|
supportedDrivers.push(driverName);
|
|
}
|
|
}
|
|
return supportedDrivers;
|
|
};
|
|
LocalForage2.prototype._wrapLibraryMethodsWithReady = function _wrapLibraryMethodsWithReady() {
|
|
for (var i = 0, len = LibraryMethods.length; i < len; i++) {
|
|
callWhenReady(this, LibraryMethods[i]);
|
|
}
|
|
};
|
|
LocalForage2.prototype.createInstance = function createInstance(options) {
|
|
return new LocalForage2(options);
|
|
};
|
|
return LocalForage2;
|
|
}();
|
|
var localforage_js = new LocalForage();
|
|
module4.exports = localforage_js;
|
|
}, { "3": 3 }] }, {}, [4])(4);
|
|
});
|
|
}
|
|
});
|
|
|
|
// src/main.ts
|
|
__export(exports, {
|
|
default: () => PlantumlPlugin
|
|
});
|
|
var import_obsidian6 = __toModule(require("obsidian"));
|
|
|
|
// src/settings.ts
|
|
var import_obsidian = __toModule(require("obsidian"));
|
|
var DEFAULT_SETTINGS = {
|
|
server_url: "https://www.plantuml.com/plantuml",
|
|
header: "",
|
|
debounce: 3,
|
|
localJar: "",
|
|
javaPath: "java",
|
|
dotPath: "dot",
|
|
defaultProcessor: "png",
|
|
cache: 60,
|
|
exportPath: ""
|
|
};
|
|
var PlantUMLSettingsTab = class extends import_obsidian.PluginSettingTab {
|
|
constructor(plugin) {
|
|
super(plugin.app, plugin);
|
|
this.plugin = plugin;
|
|
}
|
|
display() {
|
|
const { containerEl } = this;
|
|
containerEl.empty();
|
|
new import_obsidian.Setting(containerEl).setName("Server URL").setDesc("PlantUML Server URL").addText((text) => text.setPlaceholder(DEFAULT_SETTINGS.server_url).setValue(this.plugin.settings.server_url).onChange((value) => __async(this, null, function* () {
|
|
this.plugin.settings.server_url = value;
|
|
yield this.plugin.saveSettings();
|
|
})));
|
|
if (import_obsidian.Platform.isDesktopApp) {
|
|
const jarDesc = new DocumentFragment();
|
|
jarDesc.createDiv().innerHTML = "Path to local JAR<br>Supports:<ul><li>Absolute path</li><li>Path relative to vault</li><li>Path relative to users home directory <code>~/</code></li></ul>";
|
|
new import_obsidian.Setting(containerEl).setName("Local JAR").setDesc(jarDesc).addText((text) => text.setPlaceholder(DEFAULT_SETTINGS.localJar).setValue(this.plugin.settings.localJar).onChange((value) => __async(this, null, function* () {
|
|
this.plugin.settings.localJar = value;
|
|
yield this.plugin.saveSettings();
|
|
})));
|
|
new import_obsidian.Setting(containerEl).setName("Java path").setDesc("Path to Java executable").addText((text) => text.setPlaceholder(DEFAULT_SETTINGS.javaPath).setValue(this.plugin.settings.javaPath).onChange((value) => __async(this, null, function* () {
|
|
this.plugin.settings.javaPath = value;
|
|
yield this.plugin.saveSettings();
|
|
})));
|
|
new import_obsidian.Setting(containerEl).setName("Dot path").setDesc("Path to dot executable").addText((text) => text.setPlaceholder(DEFAULT_SETTINGS.dotPath).setValue(this.plugin.settings.dotPath).onChange((value) => __async(this, null, function* () {
|
|
this.plugin.settings.dotPath = value;
|
|
yield this.plugin.saveSettings();
|
|
})));
|
|
new import_obsidian.Setting(containerEl).setName("Diagram export path").setDesc("Path where exported diagrams will be saved relative to the vault root. Leave blank to save along side the note.").addText((text) => text.setPlaceholder(DEFAULT_SETTINGS.exportPath).setValue(this.plugin.settings.exportPath).onChange((value) => __async(this, null, function* () {
|
|
this.plugin.settings.exportPath = value;
|
|
yield this.plugin.saveSettings();
|
|
})));
|
|
}
|
|
new import_obsidian.Setting(containerEl).setName("Default processor for includes").setDesc("Any .pu/.puml files linked will use this processor").addDropdown((dropdown) => {
|
|
dropdown.addOption("png", "PNG").addOption("svg", "SVG").setValue(this.plugin.settings.defaultProcessor).onChange((value) => __async(this, null, function* () {
|
|
this.plugin.settings.defaultProcessor = value;
|
|
yield this.plugin.saveSettings();
|
|
}));
|
|
});
|
|
new import_obsidian.Setting(containerEl).setName("Header").setDesc("Included at the head in every diagram. Useful for specifying a common theme (.puml file)").addTextArea((text) => {
|
|
text.setPlaceholder("!include https://raw.githubusercontent.com/....puml\n").setValue(this.plugin.settings.header).onChange((value) => __async(this, null, function* () {
|
|
this.plugin.settings.header = value;
|
|
yield this.plugin.saveSettings();
|
|
}));
|
|
text.inputEl.setAttr("rows", 4);
|
|
text.inputEl.addClass("puml-settings-area");
|
|
});
|
|
new import_obsidian.Setting(containerEl).setName("Cache").setDesc("in days. Only applicable when generating diagrams locally").addSlider((slider) => {
|
|
slider.setLimits(10, 360, 10).setValue(this.plugin.settings.cache).setDynamicTooltip().onChange((value) => __async(this, null, function* () {
|
|
this.plugin.settings.cache = value;
|
|
yield this.plugin.saveSettings();
|
|
}));
|
|
});
|
|
new import_obsidian.Setting(containerEl).setName("Debounce").setDesc("How often should the diagram refresh in seconds").addText((text) => text.setPlaceholder(String(DEFAULT_SETTINGS.debounce)).setValue(String(this.plugin.settings.debounce)).onChange((value) => __async(this, null, function* () {
|
|
if (!isNaN(Number(value)) || value === void 0) {
|
|
this.plugin.settings.debounce = Number(value || DEFAULT_SETTINGS.debounce);
|
|
yield this.plugin.saveSettings();
|
|
} else {
|
|
new import_obsidian.Notice("Please specify a valid number");
|
|
}
|
|
})));
|
|
}
|
|
};
|
|
|
|
// src/processors/localProcessors.ts
|
|
var plantuml = __toModule(require_browser_index());
|
|
|
|
// src/functions.ts
|
|
var Replacer = class {
|
|
constructor(plugin) {
|
|
this.plugin = plugin;
|
|
}
|
|
replaceNonBreakingSpaces(text) {
|
|
const lines = text.split(/\r?\n/);
|
|
const resultLines = [];
|
|
if (text.startsWith("@startmindmap")) {
|
|
for (const line of lines) {
|
|
resultLines.push(line.replace(/\s+/g, " "));
|
|
}
|
|
} else {
|
|
resultLines.push(...lines);
|
|
}
|
|
const result = resultLines.join("\r\n");
|
|
return result.replace(/ /gi, " ");
|
|
}
|
|
replaceLinks(text, path, filetype) {
|
|
return text.replace(/\[\[\[([\s\S]*?)\]\]\]/g, (_, args) => {
|
|
const split = args.split("|");
|
|
const file = this.plugin.app.metadataCache.getFirstLinkpathDest(split[0], path);
|
|
if (!file) {
|
|
return "File with name: " + split[0] + " not found";
|
|
}
|
|
let alias = file.basename;
|
|
if (filetype === "png") {
|
|
const url = this.plugin.app.getObsidianUrl(file);
|
|
if (split[1]) {
|
|
alias = split[1];
|
|
}
|
|
return "[[" + url + " " + alias + "]]";
|
|
}
|
|
return "[[" + file.basename + "]]";
|
|
});
|
|
}
|
|
getFullPath(path) {
|
|
if (path.length === 0) {
|
|
return this.plugin.app.vault.adapter.getFullPath("");
|
|
}
|
|
const file = this.plugin.app.vault.getAbstractFileByPath(path);
|
|
if (!file) {
|
|
return this.plugin.app.vault.adapter.getFullPath("");
|
|
}
|
|
const folder = this.plugin.app.vault.getDirectParent(file);
|
|
return this.plugin.app.vault.adapter.getFullPath(folder.path);
|
|
}
|
|
getPath(ctx) {
|
|
return this.getFullPath(ctx ? ctx.sourcePath : "");
|
|
}
|
|
};
|
|
function insertImageWithMap(el, image, map, encodedDiagram) {
|
|
el.empty();
|
|
const img = document.createElement("img");
|
|
if (image.startsWith("http")) {
|
|
img.src = image;
|
|
} else {
|
|
img.src = "data:image/png;base64," + image;
|
|
}
|
|
img.useMap = "#" + encodedDiagram;
|
|
if (map.contains("map")) {
|
|
el.innerHTML = map;
|
|
el.children[0].setAttr("name", encodedDiagram);
|
|
}
|
|
el.appendChild(img);
|
|
}
|
|
function insertAsciiImage(el, image) {
|
|
el.empty();
|
|
const pre = document.createElement("pre");
|
|
const code = document.createElement("code");
|
|
pre.appendChild(code);
|
|
code.setText(image);
|
|
el.appendChild(pre);
|
|
}
|
|
function insertSvgImage(el, image) {
|
|
el.empty();
|
|
const parser = new DOMParser();
|
|
const svg = parser.parseFromString(image, "image/svg+xml");
|
|
const links = svg.getElementsByTagName("a");
|
|
for (let i = 0; i < links.length; i++) {
|
|
const link = links[i];
|
|
link.addClass("internal-link");
|
|
}
|
|
el.insertAdjacentHTML("beforeend", svg.documentElement.outerHTML);
|
|
}
|
|
|
|
// src/const.ts
|
|
var LOGO_SVG = '<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" width="100" height="100" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><defs><linearGradient id="svgIDc" x1="-33.423" x2="-33.353" y1="-250.911" y2="-250.858" gradientTransform="matrix(37.134 26.001 13.575 -19.387 4673.473 -3982.019)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#767676"/><stop offset="1"/></linearGradient><linearGradient id="svgIDa" x1="-32.107" x2="-32.028" y1="-242.563" y2="-242.586" gradientTransform="matrix(81.081 56.774 17.306 -24.715 6804.021 -4149.644)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#0079b9"/><stop offset="1"/></linearGradient><linearGradient id="svgIDd" x1="-33.282" x2="-33.224" y1="-243.423" y2="-243.455" gradientTransform="matrix(60.003 42.015 34.184 -48.82 10343.005 -10469.084)" href="#svgIDa"/><linearGradient id="svgIDb" x1="12.356" x2="14.011" y1="26.268" y2="26.268" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#595959"/><stop offset=".087" stop-color="#6e6e6e"/><stop offset=".242" stop-color="#8c8c8c"/><stop offset=".405" stop-color="#a4a4a4"/><stop offset=".577" stop-color="#b5b5b5"/><stop offset=".765" stop-color="#bfbfbf"/><stop offset="1" stop-color="#c2c2c2"/></linearGradient><linearGradient id="svgIDe" x1="18.291" x2="19.946" y1="26.171" y2="26.171" href="#svgIDb"/><linearGradient id="svgIDf" x1="24.44" x2="26.096" y1="26.171" y2="26.171" href="#svgIDb"/></defs><path fill="#1c0a42" d="m20.305 17.872l6.855 4.546l-5.44 3.075l-6.859-4.494l5.444-3.127z"/><path d="m21.716 25.619l-.055-.036l-7.005-4.59l5.653-3.247l7.056 4.68Zm-6.65-4.613l6.658 4.362l5.231-2.957L20.3 18Z"/><path fill="url(#svgIDc)" d="m26.401 11.909l3.017 1.683l-2.348 1.496l-2.857-1.841l2.188-1.338z"/><path d="m27.069 15.215l-3.058-1.97l2.387-1.46l3.228 1.8Zm-2.654-1.966l2.655 1.711l2.138-1.36l-2.8-1.565Z"/><path fill="#ffbd3f" d="m14.498 17.807l6.856 4.547l-5.44 3.075l-6.859-4.494l5.443-3.128z"/><path d="m15.91 25.554l-.055-.036l-7.005-4.589l5.65-3.248l7.056 4.68Zm-6.65-4.613l6.658 4.359l5.231-2.957l-6.654-4.413Z"/><path fill="#a11f40" d="m7.99 17.966l6.964 4.4l-5.377 3.138l-7.359-4.655l5.772-2.883z"/><path d="M9.575 25.629L2 20.838l6-3l7.164 4.527ZM2.436 20.86l7.144 4.518l5.168-3.016l-6.764-4.273Z"/><path fill="url(#svgIDa)" d="m2.111 21.021l7.332 4.494v3.548l-7.332-4.731v-3.311z"/><path d="M9.55 29.26L2 24.391v-3.562l7.55 4.626Zm-7.332-4.986l7.118 4.592v-3.291l-7.118-4.362Z"/><path fill="url(#svgIDd)" d="m24.071 13.343l2.938 1.879v6.909l-2.938-1.884v-6.904z"/><path d="m27.063 22.229l-3.045-1.953v-7.031l3.045 1.947Zm-2.938-2.012l2.831 1.815v-6.781l-2.831-1.81Z"/><path fill="#fff" d="M27.149 22.526v-7.332l2.365-1.419v15.374H9.646v-3.548l5.44-3.075l.699 3.075h.011l5.676-3.075l.419 3.075h.054l5.204-3.075z"/><path d="M29.621 29.256H9.539v-3.718l5.62-3.177l.7 3.083l5.7-3.087l.422 3.1l5.061-2.991v-7.333l2.58-1.548Zm-19.868-.215h19.654V13.964l-2.151 1.29v7.332l-.053.031l-5.229 3.09H21.8l-.411-3.014l-5.564 3.014H15.7l-.686-3.018l-5.26 2.973Z"/><rect width="1.656" height="1.656" x="12.356" y="25.44" fill="url(#svgIDb)" rx=".215" ry=".215"/><path d="M13.8 27.2h-1.23a.322.322 0 0 1-.322-.322v-1.223a.322.322 0 0 1 .322-.322h1.23a.322.322 0 0 1 .322.322v1.226a.322.322 0 0 1-.322.319Zm-1.23-1.653a.108.108 0 0 0-.107.107v1.226a.108.108 0 0 0 .107.107h1.23a.108.108 0 0 0 .107-.107v-1.225a.108.108 0 0 0-.107-.107Z"/><rect width="1.656" height="1.656" x="18.291" y="25.343" fill="url(#svgIDe)" rx=".215" ry=".215"/><path d="M19.732 27.106h-1.227a.322.322 0 0 1-.322-.322v-1.226a.322.322 0 0 1 .322-.322h1.226a.322.322 0 0 1 .322.322v1.226a.322.322 0 0 1-.321.322Zm-1.226-1.656a.108.108 0 0 0-.107.107v1.226a.108.108 0 0 0 .107.107h1.226a.108.108 0 0 0 .107-.107v-1.225a.108.108 0 0 0-.107-.107Z"/><rect width="1.656" height="1.656" x="24.44" y="25.343" fill="url(#svgIDf)" rx=".215" ry=".215"/><path d="M25.881 27.106h-1.226a.322.322 0 0 1-.322-.322v-1.226a.322.322 0 0 1 .322-.322h1.226a.322.322 0 0 1 .322.322v1.226a.322.322 0 0 1-.322.322Zm-1.226-1.656a.108.108 0 0 0-.107.107v1.226a.108.108 0 0 0 .107.107h1.226a.108.108 0 0 0 .107-.107v-1.225a.108.108 0 0 0-.107-.107Z"/><path fill="#ea2d2e" d="M27.215 11.23c-.052.069-.417-.262-.653-.526a4.408 4.408 0 0 1-.516-.73A2.6 2.6 0 0 1 25.7 9.2a2.358 2.358 0 0 1-.052-.682a2.959 2.959 0 0 1 .129-.749a3.142 3.142 0 0 1 .787-1.207a15.532 15.532 0 0 0 1.283-1.4a3.062 3.062 0 0 0 .479-.927a3.979 3.979 0 0 0 .151-.855c.019-.364-.025-.593.023-.613s.215.274.287.564a3.167 3.167 0 0 1-.458 2.1a6.9 6.9 0 0 1-1.094 1.448a2.8 2.8 0 0 0-.849 1.234a2.466 2.466 0 0 0-.086.687a3.465 3.465 0 0 0 .476 1.542c.288.572.48.833.439.888Z"/><path d="M27.193 11.266c-.124 0-.492-.365-.651-.544a4.478 4.478 0 0 1-.52-.734a2.628 2.628 0 0 1-.346-.781a2.375 2.375 0 0 1-.053-.69a2.978 2.978 0 0 1 .13-.756a3.208 3.208 0 0 1 .793-1.216c.294-.331.5-.528.659-.686a4.393 4.393 0 0 0 .622-.711a3.052 3.052 0 0 0 .476-.919a3.951 3.951 0 0 0 .15-.849c.008-.159 0-.294 0-.393c0-.159-.006-.225.038-.243a.05.05 0 0 1 .043 0a1.226 1.226 0 0 1 .28.579a3.167 3.167 0 0 1-.46 2.121a6.928 6.928 0 0 1-1.1 1.453c-.055.06-.109.116-.162.171a2.3 2.3 0 0 0-.681 1.052a2.47 2.47 0 0 0-.082.673a3.458 3.458 0 0 0 .473 1.53c.114.231.215.415.289.549c.129.235.178.323.142.369a.051.051 0 0 1-.04.02ZM28.512 2.8a.863.863 0 0 0 0 .19c0 .1.007.236 0 .4a4.021 4.021 0 0 1-.152.861a3.106 3.106 0 0 1-.483.934a4.437 4.437 0 0 1-.629.719c-.162.158-.364.354-.657.683a3.168 3.168 0 0 0-.782 1.2a2.933 2.933 0 0 0-.128.743a2.325 2.325 0 0 0 .052.675a2.59 2.59 0 0 0 .341.767a4.422 4.422 0 0 0 .513.725a2.035 2.035 0 0 0 .611.526a1.183 1.183 0 0 0-.147-.31a12.935 12.935 0 0 1-.29-.551a3.5 3.5 0 0 1-.483-1.562a2.53 2.53 0 0 1 .084-.688a2.375 2.375 0 0 1 .694-1.075c.052-.055.106-.111.161-.171a6.879 6.879 0 0 0 1.09-1.442a3.119 3.119 0 0 0 .456-2.083a1.281 1.281 0 0 0-.251-.541Z"/><path fill="#ea2d2e" d="M29.972 6.087c-.019-.088-.432-.04-.766.073a2.6 2.6 0 0 0-1.059.722a2.8 2.8 0 0 0-.916 1.855a2.972 2.972 0 0 0 .258 1.06c.221.572.455.773.444 1.225c-.007.3-.114.484-.048.549s.314-.1.462-.313a1.8 1.8 0 0 0 .259-1.022c-.046-.815-.6-1.015-.608-1.8a1.858 1.858 0 0 1 .129-.676c.443-1.251 1.881-1.508 1.845-1.673Z"/><path d="M27.934 11.617a.094.094 0 0 1-.069-.026c-.046-.046-.03-.122-.005-.237a1.718 1.718 0 0 0 .045-.331a1.374 1.374 0 0 0-.214-.72a5 5 0 0 1-.228-.495a2.98 2.98 0 0 1-.259-1.07a2.81 2.81 0 0 1 .923-1.874a2.64 2.64 0 0 1 1.07-.729a1.482 1.482 0 0 1 .766-.1a.065.065 0 0 1 .037.046c.015.07-.092.121-.306.224a2.73 2.73 0 0 0-1.542 1.463a1.827 1.827 0 0 0-.127.667a1.645 1.645 0 0 0 .291.885a1.889 1.889 0 0 1 .317.914a1.814 1.814 0 0 1-.264 1.039a.809.809 0 0 1-.421.342Zm1.889-5.549a2.117 2.117 0 0 0-.608.117a2.588 2.588 0 0 0-1.048.715a2.764 2.764 0 0 0-.909 1.837a2.935 2.935 0 0 0 .256 1.05a4.955 4.955 0 0 0 .225.49a1.433 1.433 0 0 1 .22.745a1.765 1.765 0 0 1-.047.341c-.019.091-.035.163-.009.188a.046.046 0 0 0 .038.01a.769.769 0 0 0 .382-.32a1.793 1.793 0 0 0 .254-1.005a1.844 1.844 0 0 0-.31-.89a1.711 1.711 0 0 1-.3-.911a1.877 1.877 0 0 1 .13-.686a2.776 2.776 0 0 1 1.573-1.492c.126-.061.283-.136.277-.164l-.008-.007a.264.264 0 0 0-.116-.018Z"/></svg>';
|
|
var OutputType = /* @__PURE__ */ ((OutputType2) => {
|
|
OutputType2["PNG"] = "png";
|
|
OutputType2["SVG"] = "svg";
|
|
OutputType2["ASCII"] = "txt";
|
|
return OutputType2;
|
|
})(OutputType || {});
|
|
|
|
// src/processors/localProcessors.ts
|
|
var localforage = __toModule(require_localforage());
|
|
var LocalProcessors = class {
|
|
constructor(plugin) {
|
|
this.ascii = (source, el, ctx) => __async(this, null, function* () {
|
|
const encodedDiagram = plantuml.encode(source);
|
|
const item = yield localforage.getItem("ascii-" + encodedDiagram);
|
|
if (item) {
|
|
insertAsciiImage(el, item);
|
|
yield localforage.setItem("ts-" + encodedDiagram, Date.now());
|
|
return;
|
|
}
|
|
const image = yield this.generateLocalImage(source, OutputType.ASCII, this.plugin.replacer.getPath(ctx));
|
|
insertAsciiImage(el, image);
|
|
yield localforage.setItem("ascii-" + encodedDiagram, image);
|
|
yield localforage.setItem("ts-" + encodedDiagram, Date.now());
|
|
});
|
|
this.png = (source, el, ctx) => __async(this, null, function* () {
|
|
const encodedDiagram = plantuml.encode(source);
|
|
const item = yield localforage.getItem("png-" + encodedDiagram);
|
|
if (item) {
|
|
const map2 = yield localforage.getItem("map-" + encodedDiagram);
|
|
insertImageWithMap(el, item, map2, encodedDiagram);
|
|
yield localforage.setItem("ts-" + encodedDiagram, Date.now());
|
|
return;
|
|
}
|
|
const path = this.plugin.replacer.getPath(ctx);
|
|
const image = yield this.generateLocalImage(source, OutputType.PNG, path);
|
|
const map = yield this.generateLocalMap(source, path);
|
|
yield localforage.setItem("png-" + encodedDiagram, image);
|
|
yield localforage.setItem("map-" + encodedDiagram, map);
|
|
yield localforage.setItem("ts-" + encodedDiagram, Date.now());
|
|
insertImageWithMap(el, image, map, encodedDiagram);
|
|
});
|
|
this.svg = (source, el, ctx) => __async(this, null, function* () {
|
|
const encodedDiagram = plantuml.encode(source);
|
|
const item = yield localforage.getItem("svg-" + encodedDiagram);
|
|
if (item) {
|
|
insertSvgImage(el, item);
|
|
yield localforage.setItem("ts-" + encodedDiagram, Date.now());
|
|
return;
|
|
}
|
|
const image = yield this.generateLocalImage(source, OutputType.SVG, this.plugin.replacer.getPath(ctx));
|
|
yield localforage.setItem("svg-" + encodedDiagram, image);
|
|
yield localforage.setItem("ts-" + encodedDiagram, Date.now());
|
|
insertSvgImage(el, image);
|
|
});
|
|
this.plugin = plugin;
|
|
}
|
|
generateLocalMap(source, path) {
|
|
return __async(this, null, function* () {
|
|
const { exec } = require("child_process");
|
|
const args = this.resolveLocalJarCmd().concat(["-pipemap"]);
|
|
const child = exec(args.join(" "), { encoding: "binary", cwd: path });
|
|
let stdout = "";
|
|
if (child.stdout) {
|
|
child.stdout.on("data", (data) => {
|
|
stdout += data;
|
|
});
|
|
}
|
|
return new Promise((resolve, reject) => {
|
|
child.on("error", reject);
|
|
child.on("close", (code) => {
|
|
if (code === 0) {
|
|
resolve(stdout);
|
|
return;
|
|
} else if (code === 1) {
|
|
console.log(stdout);
|
|
reject(new Error(`an error occurred`));
|
|
} else {
|
|
reject(new Error(`child exited with code ${code}`));
|
|
}
|
|
});
|
|
child.stdin.write(source);
|
|
child.stdin.end();
|
|
});
|
|
});
|
|
}
|
|
generateLocalImage(source, type, path) {
|
|
return __async(this, null, function* () {
|
|
const { ChildProcess, exec } = require("child_process");
|
|
const args = this.resolveLocalJarCmd().concat(["-t" + type, "-pipe"]);
|
|
let child;
|
|
if (type === OutputType.PNG) {
|
|
child = exec(args.join(" "), { encoding: "binary", cwd: path });
|
|
} else {
|
|
child = exec(args.join(" "), { encoding: "utf-8", cwd: path });
|
|
}
|
|
let stdout;
|
|
let stderr;
|
|
if (child.stdout) {
|
|
child.stdout.on("data", (data) => {
|
|
if (stdout === void 0) {
|
|
stdout = data;
|
|
} else
|
|
stdout += data;
|
|
});
|
|
}
|
|
if (child.stderr) {
|
|
child.stderr.on("data", (data) => {
|
|
if (stderr === void 0) {
|
|
stderr = data;
|
|
} else
|
|
stderr += data;
|
|
});
|
|
}
|
|
return new Promise((resolve, reject) => {
|
|
child.on("error", reject);
|
|
child.on("close", (code) => {
|
|
if (stdout === void 0) {
|
|
return;
|
|
}
|
|
if (code === 0) {
|
|
if (type === OutputType.PNG) {
|
|
const buf = new Buffer(stdout, "binary");
|
|
resolve(buf.toString("base64"));
|
|
return;
|
|
}
|
|
resolve(stdout);
|
|
return;
|
|
} else if (code === 1) {
|
|
console.error(stdout);
|
|
reject(new Error(stderr));
|
|
} else {
|
|
if (type === OutputType.PNG) {
|
|
const buf = new Buffer(stdout, "binary");
|
|
resolve(buf.toString("base64"));
|
|
return;
|
|
}
|
|
resolve(stdout);
|
|
return;
|
|
}
|
|
});
|
|
child.stdin.write(source, "utf-8");
|
|
child.stdin.end();
|
|
});
|
|
});
|
|
}
|
|
resolveLocalJarCmd() {
|
|
const jarFromSettings = this.plugin.settings.localJar;
|
|
const { isAbsolute, resolve } = require("path");
|
|
const { userInfo } = require("os");
|
|
let jarFullPath;
|
|
const path = this.plugin.replacer.getFullPath("");
|
|
if (jarFromSettings[0] === "~") {
|
|
jarFullPath = userInfo().homedir + jarFromSettings.slice(1);
|
|
} else {
|
|
if (isAbsolute(jarFromSettings)) {
|
|
jarFullPath = jarFromSettings;
|
|
} else {
|
|
jarFullPath = resolve(path, jarFromSettings);
|
|
}
|
|
}
|
|
if (jarFullPath.length == 0) {
|
|
throw Error("Invalid local jar file");
|
|
}
|
|
if (jarFullPath.endsWith(".jar")) {
|
|
return [
|
|
this.plugin.settings.javaPath,
|
|
"-jar",
|
|
'"' + jarFullPath + '"',
|
|
"-Djava.awt.headless=true",
|
|
"-charset",
|
|
"utf-8",
|
|
"-graphvizdot",
|
|
'"' + this.plugin.settings.dotPath + '"'
|
|
];
|
|
}
|
|
return [
|
|
jarFullPath,
|
|
"-Djava.awt.headless=true",
|
|
"-charset",
|
|
"utf-8",
|
|
"-graphvizdot",
|
|
'"' + this.plugin.settings.dotPath + '"'
|
|
];
|
|
}
|
|
};
|
|
|
|
// src/processors/debouncedProcessors.ts
|
|
var import_obsidian2 = __toModule(require("obsidian"));
|
|
|
|
// node_modules/uuid/dist/esm-browser/rng.js
|
|
var getRandomValues;
|
|
var rnds8 = new Uint8Array(16);
|
|
function rng() {
|
|
if (!getRandomValues) {
|
|
getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== "undefined" && typeof msCrypto.getRandomValues === "function" && msCrypto.getRandomValues.bind(msCrypto);
|
|
if (!getRandomValues) {
|
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
}
|
|
}
|
|
return getRandomValues(rnds8);
|
|
}
|
|
|
|
// node_modules/uuid/dist/esm-browser/regex.js
|
|
var regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
|
|
// node_modules/uuid/dist/esm-browser/validate.js
|
|
function validate(uuid) {
|
|
return typeof uuid === "string" && regex_default.test(uuid);
|
|
}
|
|
var validate_default = validate;
|
|
|
|
// node_modules/uuid/dist/esm-browser/stringify.js
|
|
var byteToHex = [];
|
|
for (i = 0; i < 256; ++i) {
|
|
byteToHex.push((i + 256).toString(16).substr(1));
|
|
}
|
|
var i;
|
|
function stringify(arr) {
|
|
var offset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
if (!validate_default(uuid)) {
|
|
throw TypeError("Stringified UUID is invalid");
|
|
}
|
|
return uuid;
|
|
}
|
|
var stringify_default = stringify;
|
|
|
|
// node_modules/uuid/dist/esm-browser/v4.js
|
|
function v4(options, buf, offset) {
|
|
options = options || {};
|
|
var rnds = options.random || (options.rng || rng)();
|
|
rnds[6] = rnds[6] & 15 | 64;
|
|
rnds[8] = rnds[8] & 63 | 128;
|
|
if (buf) {
|
|
offset = offset || 0;
|
|
for (var i = 0; i < 16; ++i) {
|
|
buf[offset + i] = rnds[i];
|
|
}
|
|
return buf;
|
|
}
|
|
return stringify_default(rnds);
|
|
}
|
|
var v4_default = v4;
|
|
|
|
// src/processors/debouncedProcessors.ts
|
|
var DebouncedProcessors = class {
|
|
constructor(plugin) {
|
|
this.SECONDS_TO_MS_FACTOR = 1e3;
|
|
this.debounceMap = /* @__PURE__ */ new Map();
|
|
this.default = (source, el, ctx) => __async(this, null, function* () {
|
|
yield this.png(source, el, ctx);
|
|
});
|
|
this.png = (source, el, ctx) => __async(this, null, function* () {
|
|
yield this.processor(source, el, ctx, "png", this.plugin.getProcessor().png);
|
|
});
|
|
this.ascii = (source, el, ctx) => __async(this, null, function* () {
|
|
yield this.processor(source, el, ctx, "ascii", this.plugin.getProcessor().ascii);
|
|
});
|
|
this.svg = (source, el, ctx) => __async(this, null, function* () {
|
|
yield this.processor(source, el, ctx, "svg", this.plugin.getProcessor().svg);
|
|
});
|
|
this.processor = (source, el, ctx, filetype, processor) => __async(this, null, function* () {
|
|
const originalSource = source;
|
|
el.dataset.filetype = filetype;
|
|
el.createEl("h6", { text: "Generating PlantUML diagram", cls: "puml-loading" });
|
|
if (el.dataset.plantumlDebounce) {
|
|
const debounceId = el.dataset.plantumlDebounce;
|
|
if (this.debounceMap.has(debounceId)) {
|
|
this.debounceMap.get(debounceId)(source, el, ctx);
|
|
}
|
|
} else {
|
|
const func = (0, import_obsidian2.debounce)(processor, this.debounceTime, true);
|
|
const uuid = v4_default();
|
|
el.dataset.plantumlDebouce = uuid;
|
|
this.debounceMap.set(uuid, func);
|
|
source = this.plugin.replacer.replaceNonBreakingSpaces(source);
|
|
source = this.plugin.replacer.replaceLinks(source, this.plugin.replacer.getPath(ctx), filetype);
|
|
source = this.plugin.settings.header + "\r\n" + source;
|
|
yield processor(source, el, ctx);
|
|
el.addEventListener("contextmenu", (event) => {
|
|
const menu = new import_obsidian2.Menu().addItem((item) => {
|
|
item.setTitle("Copy diagram source").setIcon("clipboard-copy").onClick(() => __async(this, null, function* () {
|
|
yield navigator.clipboard.writeText(originalSource);
|
|
}));
|
|
}).addItem((item) => {
|
|
item.setTitle("Copy diagram").setIcon("image").onClick(() => __async(this, null, function* () {
|
|
console.log(el);
|
|
const img = el.querySelector("img");
|
|
if (img) {
|
|
this.renderToBlob(img, "An error occurred while copying image to clipboard", (blob) => __async(this, null, function* () {
|
|
yield navigator.clipboard.write([
|
|
new ClipboardItem({
|
|
"image/png": blob
|
|
})
|
|
]);
|
|
new import_obsidian2.Notice("Diagram copied to clipboard");
|
|
}));
|
|
}
|
|
const svg = el.querySelector("svg");
|
|
if (svg) {
|
|
yield navigator.clipboard.writeText(svg.outerHTML);
|
|
new import_obsidian2.Notice("Diagram copied to clipboard");
|
|
}
|
|
const code = el.querySelector("code");
|
|
if (code) {
|
|
yield navigator.clipboard.writeText(code.innerText);
|
|
new import_obsidian2.Notice("Diagram copied to clipboard");
|
|
}
|
|
}));
|
|
}).addItem((item) => {
|
|
item.setTitle("Export diagram").setIcon("image-file").onClick(() => __async(this, null, function* () {
|
|
const img = el.querySelector("img");
|
|
if (img) {
|
|
this.renderToBlob(img, "An error occurred while exporting the diagram", (blob) => __async(this, null, function* () {
|
|
const filename = yield this.getFilePath(source, ctx, "png");
|
|
const buffer = yield blob.arrayBuffer();
|
|
const file = this.getFile(filename);
|
|
if (file) {
|
|
yield this.plugin.app.vault.modifyBinary(file, buffer);
|
|
} else {
|
|
yield this.plugin.app.vault.createBinary(filename, buffer);
|
|
}
|
|
new import_obsidian2.Notice(`Diagram exported to '${filename}'`);
|
|
}));
|
|
}
|
|
const svg = el.querySelector("svg");
|
|
if (svg) {
|
|
yield this.saveTextFile(source, ctx, "svg", svg.outerHTML);
|
|
}
|
|
const code = el.querySelector("code");
|
|
if (code) {
|
|
yield this.saveTextFile(source, ctx, "txt", code.innerText);
|
|
}
|
|
}));
|
|
});
|
|
menu.showAtMouseEvent(event);
|
|
});
|
|
}
|
|
});
|
|
this.renderToBlob = (img, errorMessage, handleBlob) => {
|
|
const image = new Image();
|
|
image.crossOrigin = "anonymous";
|
|
image.src = img.src;
|
|
image.addEventListener("load", () => {
|
|
const canvas = document.createElement("canvas");
|
|
canvas.width = image.width;
|
|
canvas.height = image.height;
|
|
const ctx = canvas.getContext("2d");
|
|
ctx.fillStyle = "#fff";
|
|
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
ctx.drawImage(image, 0, 0);
|
|
try {
|
|
canvas.toBlob((blob) => __async(this, null, function* () {
|
|
try {
|
|
yield handleBlob(blob);
|
|
} catch (error) {
|
|
new import_obsidian2.Notice(errorMessage);
|
|
console.error(error);
|
|
}
|
|
}));
|
|
} catch (error) {
|
|
new import_obsidian2.Notice(errorMessage);
|
|
console.error(error);
|
|
}
|
|
});
|
|
};
|
|
this.getFilename = (source, ctx) => {
|
|
const startuml = source.match(/@startuml (.+)/i);
|
|
if ((startuml == null ? void 0 : startuml.length) >= 2) {
|
|
return `${startuml[1].trim()}`;
|
|
}
|
|
const now = new Date().toISOString().replace(/[:T]+/g, "-");
|
|
const filename = this.plugin.app.vault.getAbstractFileByPath(ctx.sourcePath).name;
|
|
return `${filename.substring(0, filename.lastIndexOf("."))}-${now.substring(0, now.lastIndexOf("."))}`;
|
|
};
|
|
this.getFolder = (ctx) => __async(this, null, function* () {
|
|
let exportPath = this.plugin.settings.exportPath;
|
|
if (!exportPath.startsWith("/")) {
|
|
const documentPath = this.plugin.app.vault.getAbstractFileByPath(ctx.sourcePath).parent;
|
|
exportPath = `${documentPath.path}/${exportPath}`;
|
|
}
|
|
const exists = yield this.plugin.app.vault.adapter.exists(exportPath);
|
|
if (!exists) {
|
|
this.plugin.app.vault.createFolder(exportPath);
|
|
}
|
|
return exportPath;
|
|
});
|
|
this.getFilePath = (source, ctx, type) => __async(this, null, function* () {
|
|
const filename = this.getFilename(source, ctx);
|
|
const path = yield this.getFolder(ctx);
|
|
return `${path}${filename}.${type}`;
|
|
});
|
|
this.getFile = (fileName) => {
|
|
let fName = fileName;
|
|
if (fName.startsWith("/")) {
|
|
fName = fName.substring(1);
|
|
}
|
|
const folderOrFile = this.plugin.app.vault.getAbstractFileByPath(fName);
|
|
if (folderOrFile instanceof import_obsidian2.TFile) {
|
|
return folderOrFile;
|
|
}
|
|
return void 0;
|
|
};
|
|
this.saveTextFile = (source, ctx, type, data) => __async(this, null, function* () {
|
|
try {
|
|
const filename = yield this.getFilePath(source, ctx, type);
|
|
const file = this.getFile(filename);
|
|
if (file) {
|
|
yield this.plugin.app.vault.modify(file, data);
|
|
} else {
|
|
yield this.plugin.app.vault.create(filename, data);
|
|
}
|
|
new import_obsidian2.Notice(`Diagram exported to '${filename}'`);
|
|
} catch (error) {
|
|
new import_obsidian2.Notice("An error occurred while while exporting the diagram");
|
|
console.error(error);
|
|
}
|
|
});
|
|
this.plugin = plugin;
|
|
const debounceTime = plugin.settings.debounce;
|
|
this.debounceTime = debounceTime * this.SECONDS_TO_MS_FACTOR;
|
|
}
|
|
};
|
|
|
|
// src/processors/serverProcessor.ts
|
|
var import_obsidian3 = __toModule(require("obsidian"));
|
|
var plantuml2 = __toModule(require_browser_index());
|
|
var ServerProcessor = class {
|
|
constructor(plugin) {
|
|
this.svg = (source, el, _) => __async(this, null, function* () {
|
|
let url = this.plugin.settings.server_url;
|
|
if (url.length == 0) {
|
|
url = DEFAULT_SETTINGS.server_url;
|
|
}
|
|
const imageUrlBase = url + "/svg/";
|
|
const encodedDiagram = plantuml2.encode(source);
|
|
(0, import_obsidian3.request)({ url: imageUrlBase + encodedDiagram, method: "GET" }).then((value) => {
|
|
insertSvgImage(el, value);
|
|
}).catch((error) => {
|
|
if (error)
|
|
console.error(error);
|
|
});
|
|
});
|
|
this.png = (source, el, _) => __async(this, null, function* () {
|
|
let url = this.plugin.settings.server_url;
|
|
if (url.length == 0) {
|
|
url = DEFAULT_SETTINGS.server_url;
|
|
}
|
|
const imageUrlBase = url + "/png/";
|
|
const encodedDiagram = plantuml2.encode(source);
|
|
const image = imageUrlBase + encodedDiagram;
|
|
const mapUrlBase = url + "/map/";
|
|
const map = yield (0, import_obsidian3.request)({ url: mapUrlBase + encodedDiagram, method: "GET" });
|
|
insertImageWithMap(el, image, map, encodedDiagram);
|
|
});
|
|
this.ascii = (source, el, _) => __async(this, null, function* () {
|
|
let url = this.plugin.settings.server_url;
|
|
if (url.length == 0) {
|
|
url = DEFAULT_SETTINGS.server_url;
|
|
}
|
|
const asciiUrlBase = url + "/txt/";
|
|
const encodedDiagram = plantuml2.encode(source);
|
|
const result = yield (0, import_obsidian3.request)({ url: asciiUrlBase + encodedDiagram });
|
|
if (result.startsWith("\uFFFDPNG")) {
|
|
const text = document.createElement("p");
|
|
text.style.color = "red";
|
|
text.innerText = "Your configured PlantUML Server does not support ASCII Art";
|
|
el.appendChild(text);
|
|
return;
|
|
}
|
|
insertAsciiImage(el, result);
|
|
});
|
|
this.plugin = plugin;
|
|
}
|
|
};
|
|
|
|
// src/PumlView.ts
|
|
var import_obsidian4 = __toModule(require("obsidian"));
|
|
var import_view = __toModule(require("@codemirror/view"));
|
|
var import_state = __toModule(require("@codemirror/state"));
|
|
var import_search = __toModule(require("@codemirror/search"));
|
|
var import_commands = __toModule(require("@codemirror/commands"));
|
|
var VIEW_TYPE = "plantuml";
|
|
var views = [];
|
|
var syncAnnotation = import_state.Annotation.define();
|
|
function syncDispatch(from) {
|
|
return (tr) => {
|
|
views[from].update([tr]);
|
|
if (tr.changes && tr.annotation && !tr.changes.empty && !tr.annotation(syncAnnotation)) {
|
|
for (let i = 0; i < views.length; i++) {
|
|
if (i !== from) {
|
|
views[i].dispatch({
|
|
changes: tr.changes,
|
|
annotations: syncAnnotation.of(true)
|
|
});
|
|
}
|
|
}
|
|
}
|
|
};
|
|
}
|
|
var PumlView = class extends import_obsidian4.TextFileView {
|
|
constructor(leaf, plugin) {
|
|
super(leaf);
|
|
this.dispatchId = -1;
|
|
this.extensions = [
|
|
(0, import_view.highlightActiveLine)(),
|
|
(0, import_view.highlightActiveLineGutter)(),
|
|
(0, import_search.highlightSelectionMatches)(),
|
|
(0, import_view.drawSelection)(),
|
|
import_view.keymap.of([...import_commands.defaultKeymap, import_commands.indentWithTab]),
|
|
(0, import_commands.history)(),
|
|
(0, import_search.search)(),
|
|
import_view.EditorView.updateListener.of((v) => __async(this, null, function* () {
|
|
if (v.docChanged) {
|
|
this.requestSave();
|
|
yield this.renderPreview();
|
|
}
|
|
}))
|
|
];
|
|
this.plugin = plugin;
|
|
this.debounced = (0, import_obsidian4.debounce)(this.plugin.getProcessor().png, this.plugin.settings.debounce * 1e3, true);
|
|
this.sourceEl = this.contentEl.createDiv({ cls: "plantuml-source-view", attr: { "style": "display: block" } });
|
|
this.previewEl = this.contentEl.createDiv({ cls: "plantuml-preview-view", attr: { "style": "display: none" } });
|
|
const vault = this.app.vault;
|
|
if (vault.getConfig("showLineNumber")) {
|
|
this.extensions.push((0, import_view.lineNumbers)());
|
|
}
|
|
if (vault.getConfig("lineWrap")) {
|
|
this.extensions.push(import_view.EditorView.lineWrapping);
|
|
}
|
|
this.editor = new import_view.EditorView({
|
|
state: import_state.EditorState.create({
|
|
extensions: this.extensions,
|
|
doc: this.data
|
|
}),
|
|
parent: this.sourceEl,
|
|
dispatch: syncDispatch(views.length)
|
|
});
|
|
this.dispatchId = views.push(this.editor) - 1;
|
|
}
|
|
getViewType() {
|
|
return VIEW_TYPE;
|
|
}
|
|
getState() {
|
|
return super.getState();
|
|
}
|
|
setState(state, result) {
|
|
if (state.mode === "preview") {
|
|
this.currentView = "preview";
|
|
(0, import_obsidian4.setIcon)(this.changeModeButton, "pencil");
|
|
this.changeModeButton.setAttribute("aria-label", "Edit (Ctrl+Click to edit in new pane)");
|
|
this.previewEl.style.setProperty("display", "block");
|
|
this.sourceEl.style.setProperty("display", "none");
|
|
this.renderPreview();
|
|
} else {
|
|
this.currentView = "source";
|
|
(0, import_obsidian4.setIcon)(this.changeModeButton, "lines-of-text");
|
|
this.changeModeButton.setAttribute("aria-label", "Preview (Ctrl+Click to open in new pane)");
|
|
this.previewEl.style.setProperty("display", "none");
|
|
this.sourceEl.style.setProperty("display", "block");
|
|
}
|
|
return super.setState(state, result);
|
|
}
|
|
onload() {
|
|
return __async(this, null, function* () {
|
|
this.changeModeButton = this.addAction("lines-of-text", "Preview (Ctrl+Click to open in new pane)", (evt) => this.switchMode(evt), 17);
|
|
const defaultViewMode = this.app.vault.getConfig("defaultViewMode");
|
|
this.currentView = defaultViewMode;
|
|
yield this.setState(__spreadProps(__spreadValues({}, this.getState()), { mode: defaultViewMode }), {});
|
|
});
|
|
}
|
|
onunload() {
|
|
views.remove(views[this.dispatchId]);
|
|
this.editor.destroy();
|
|
}
|
|
switchMode(arg) {
|
|
return __async(this, null, function* () {
|
|
let mode = arg;
|
|
if (!mode || mode instanceof MouseEvent)
|
|
mode = this.currentView === "source" ? "preview" : "source";
|
|
if (arg instanceof MouseEvent) {
|
|
if (import_obsidian4.Keymap.isModEvent(arg)) {
|
|
this.app.workspace.duplicateLeaf(this.leaf).then(() => __async(this, null, function* () {
|
|
var _a, _b;
|
|
const viewState = (_a = this.app.workspace.activeLeaf) == null ? void 0 : _a.getViewState();
|
|
if (viewState) {
|
|
viewState.state = __spreadProps(__spreadValues({}, viewState.state), { mode });
|
|
yield (_b = this.app.workspace.activeLeaf) == null ? void 0 : _b.setViewState(viewState);
|
|
}
|
|
}));
|
|
} else {
|
|
yield this.setState(__spreadProps(__spreadValues({}, this.getState()), { mode }), {});
|
|
}
|
|
}
|
|
});
|
|
}
|
|
getViewData() {
|
|
return this.editor.state.sliceDoc();
|
|
}
|
|
setViewData(data, clear) {
|
|
return __async(this, null, function* () {
|
|
this.data = data;
|
|
if (clear) {
|
|
this.editor.setState(import_state.EditorState.create({
|
|
doc: data,
|
|
extensions: this.extensions
|
|
}));
|
|
} else {
|
|
this.editor.dispatch({
|
|
changes: {
|
|
from: 0,
|
|
to: this.editor.state.doc.length,
|
|
insert: data
|
|
}
|
|
});
|
|
}
|
|
if (this.currentView === "preview")
|
|
this.renderPreview();
|
|
});
|
|
}
|
|
clear() {
|
|
this.previewEl.empty();
|
|
this.data = null;
|
|
}
|
|
getDisplayText() {
|
|
if (this.file)
|
|
return this.file.basename;
|
|
else
|
|
return "PlantUML (no file)";
|
|
}
|
|
canAcceptExtension(extension) {
|
|
return extension == "puml";
|
|
}
|
|
getIcon() {
|
|
return "document-plantuml";
|
|
}
|
|
renderPreview() {
|
|
return __async(this, null, function* () {
|
|
if (this.currentView !== "preview")
|
|
return;
|
|
this.previewEl.empty();
|
|
const loadingHeader = this.previewEl.createEl("h1", { text: "Loading" });
|
|
const previewDiv = this.previewEl.createDiv();
|
|
this.debounced(this.getViewData(), previewDiv, null);
|
|
loadingHeader.remove();
|
|
});
|
|
}
|
|
};
|
|
|
|
// src/main.ts
|
|
var import_localforage = __toModule(require_localforage());
|
|
|
|
// src/embed.ts
|
|
var import_obsidian5 = __toModule(require("obsidian"));
|
|
var PumlEmbed = class extends import_obsidian5.Component {
|
|
constructor(plugin, file, ctx) {
|
|
super();
|
|
this.plugin = plugin;
|
|
this.file = file;
|
|
this.ctx = ctx;
|
|
}
|
|
loadFile() {
|
|
return __async(this, null, function* () {
|
|
const data = yield this.plugin.app.vault.cachedRead(this.file);
|
|
yield this.plugin.getProcessor().png(data, this.ctx.containerEl, null);
|
|
});
|
|
}
|
|
};
|
|
|
|
// src/main.ts
|
|
var PlantumlPlugin = class extends import_obsidian6.Plugin {
|
|
constructor() {
|
|
super(...arguments);
|
|
this.hover = {
|
|
linkText: null,
|
|
sourcePath: null
|
|
};
|
|
}
|
|
getProcessor() {
|
|
if (import_obsidian6.Platform.isMobileApp) {
|
|
return this.serverProcessor;
|
|
}
|
|
if (this.settings.localJar.length > 0) {
|
|
return this.localProcessor;
|
|
}
|
|
return this.serverProcessor;
|
|
}
|
|
onload() {
|
|
return __async(this, null, function* () {
|
|
console.log("loading plugin plantuml");
|
|
yield this.loadSettings();
|
|
this.addSettingTab(new PlantUMLSettingsTab(this));
|
|
this.replacer = new Replacer(this);
|
|
this.serverProcessor = new ServerProcessor(this);
|
|
if (import_obsidian6.Platform.isDesktopApp) {
|
|
this.localProcessor = new LocalProcessors(this);
|
|
}
|
|
const processor = new DebouncedProcessors(this);
|
|
(0, import_obsidian6.addIcon)("document-" + VIEW_TYPE, LOGO_SVG);
|
|
this.registerView(VIEW_TYPE, (leaf) => {
|
|
return new PumlView(leaf, this);
|
|
});
|
|
this.registerExtensions(["puml", "pu"], VIEW_TYPE);
|
|
this.registerMarkdownCodeBlockProcessor("plantuml", processor.default);
|
|
this.registerMarkdownCodeBlockProcessor("plantuml-png", processor.png);
|
|
this.registerMarkdownCodeBlockProcessor("plantuml-ascii", processor.ascii);
|
|
this.registerMarkdownCodeBlockProcessor("plantuml-svg", processor.svg);
|
|
this.registerMarkdownCodeBlockProcessor("puml", processor.default);
|
|
this.registerMarkdownCodeBlockProcessor("puml-png", processor.png);
|
|
this.registerMarkdownCodeBlockProcessor("puml-svg", processor.svg);
|
|
this.registerMarkdownCodeBlockProcessor("puml-ascii", processor.ascii);
|
|
this.registerMarkdownCodeBlockProcessor("plantuml-map", processor.png);
|
|
this.app.embedRegistry.registerExtensions(["puml", "pu"], (ctx, file, subpath) => new PumlEmbed(this, file, ctx));
|
|
this.cleanupLocalStorage();
|
|
import_localforage.default.config({
|
|
name: "puml",
|
|
description: "PlantUML plugin"
|
|
});
|
|
yield this.cleanupCache();
|
|
this.observer = new MutationObserver((mutation) => __async(this, null, function* () {
|
|
if (mutation.length !== 1)
|
|
return;
|
|
if (mutation[0].addedNodes.length !== 1)
|
|
return;
|
|
if (this.hover.linkText === null)
|
|
return;
|
|
if (mutation[0].addedNodes[0].className !== "popover hover-popover file-embed is-loaded")
|
|
return;
|
|
const file = this.app.metadataCache.getFirstLinkpathDest(this.hover.linkText, this.hover.sourcePath);
|
|
if (!file)
|
|
return;
|
|
if (file.extension !== "puml" && file.extension !== "pu")
|
|
return;
|
|
const fileContent = yield this.app.vault.read(file);
|
|
const imgDiv = createDiv();
|
|
if (this.settings.defaultProcessor === "png") {
|
|
yield this.getProcessor().png(fileContent, imgDiv, null);
|
|
} else {
|
|
yield this.getProcessor().svg(fileContent, imgDiv, null);
|
|
}
|
|
const node = mutation[0].addedNodes[0];
|
|
node.empty();
|
|
const div = createDiv("", (element) => __async(this, null, function* () {
|
|
element.appendChild(imgDiv);
|
|
element.setAttribute("src", file.path);
|
|
element.onClickEvent((event) => {
|
|
event.stopImmediatePropagation();
|
|
const leaf = this.app.workspace.getLeaf(event.ctrlKey);
|
|
leaf.setViewState({
|
|
type: VIEW_TYPE,
|
|
state: { file: file.path }
|
|
});
|
|
});
|
|
}));
|
|
node.appendChild(div);
|
|
}));
|
|
this.registerEvent(this.app.workspace.on("hover-link", (event) => __async(this, null, function* () {
|
|
const linkText = event.linktext;
|
|
if (!linkText)
|
|
return;
|
|
const sourcePath = event.sourcePath;
|
|
if (!linkText.endsWith(".puml") && !linkText.endsWith(".pu")) {
|
|
return;
|
|
}
|
|
this.hover.linkText = linkText;
|
|
this.hover.sourcePath = sourcePath;
|
|
})));
|
|
this.observer.observe(document, { childList: true, subtree: true });
|
|
});
|
|
}
|
|
cleanupCache() {
|
|
return __async(this, null, function* () {
|
|
yield import_localforage.default.iterate((value, key) => {
|
|
if (key.startsWith("ts-")) {
|
|
const encoded = key.split("-")[1];
|
|
if (value < new Date().getTime() - this.settings.cache * 24 * 60 * 60 * 1e3) {
|
|
import_localforage.default.removeItem("png-" + encoded);
|
|
import_localforage.default.removeItem("svg-" + encoded);
|
|
import_localforage.default.removeItem("map-" + encoded);
|
|
import_localforage.default.removeItem("ascii-" + encoded);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
cleanupLocalStorage() {
|
|
for (const key of Object.keys(localStorage)) {
|
|
if (key.endsWith("-map") || key.endsWith("-png") || key.endsWith("-svg") || key.endsWith("ascii")) {
|
|
localStorage.removeItem(key);
|
|
}
|
|
}
|
|
}
|
|
onunload() {
|
|
return __async(this, null, function* () {
|
|
console.log("unloading plugin plantuml");
|
|
this.observer.disconnect();
|
|
this.app.embedRegistry.unregisterExtensions(["puml", "pu"]);
|
|
});
|
|
}
|
|
loadSettings() {
|
|
return __async(this, null, function* () {
|
|
this.settings = Object.assign({}, DEFAULT_SETTINGS, yield this.loadData());
|
|
});
|
|
}
|
|
saveSettings() {
|
|
return __async(this, null, function* () {
|
|
yield this.saveData(this.settings);
|
|
});
|
|
}
|
|
onExternalSettingsChange() {
|
|
return __async(this, null, function* () {
|
|
yield this.loadSettings();
|
|
});
|
|
}
|
|
};
|
|
/*!
|
|
localForage -- Offline Storage, Improved
|
|
Version 1.10.0
|
|
https://localforage.github.io/localForage
|
|
(c) 2013-2017 Mozilla, Apache License 2.0
|
|
*/
|
|
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsibm9kZV9tb2R1bGVzL3BsYW50dW1sLWVuY29kZXIvZGlzdC9wbGFudHVtbC1lbmNvZGVyL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0gcmVxdWlyZSgnLi9lbmNvZGU2NCcpXG5cbm1vZHVsZS5leHBvcnRzLmVuY29kZSA9IGZ1bmN0aW9uIChwdW1sKSB7XG4gIHZhciBkZWZsYXRlZCA9IGRlZmxhdGUocHVtbClcbiAgcmV0dXJuIGVuY29kZTY0KGRlZmxhdGVkKVxufVxuXG59LHtcIi4vZGVmbGF0ZVwiOjEsXCIuL2VuY29kZTY0XCI6Mn1dLDQ6W2Z1bmN0aW9uKHJlcXVpcmUsbW9kdWxlLGV4cG9ydHMpe1xuJ3VzZSBzdHJpY3QnO1xuXG5cbnZhciB6bGliX2RlZmxhdGUgPSByZXF1aXJlKCcuL3psaWIvZGVmbGF0ZScpO1xudmFyIHV0aWxzICAgICAgICA9IHJlcXVpcmUoJy4vdXRpbHMvY29tbW9uJyk7XG52YXIgc3RyaW5ncyAgICAgID0gcmVxdWlyZSgnLi91dGlscy9zdHJpbmdzJyk7XG52YXIgbXNnICAgICAgICAgID0gcmVxdWlyZSgnLi96bGliL21lc3NhZ2VzJyk7XG52YXIgWlN0cmVhbSAgICAgID0gcmVxdWlyZSgnLi96bGliL3pzdHJlYW0nKTtcblxudmFyIHRvU3RyaW5nID0gT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZztcblxuLyogUHVibGljIGNvbnN0YW50cyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cbnZhciBaX05PX0ZMVVNIICAgICAgPSAwO1xudmFyIFpfRklOSVNIICAgICAgICA9IDQ7XG5cbnZhciBaX09LICAgICAgICAgICAgPSAwO1xudmFyIFpfU1RSRUFNX0VORCAgICA9IDE7XG52YXIgWl9TWU5DX0ZMVVNIICAgID0gMjtcblxudmFyIFpfREVGQVVMVF9DT01QUkVTU0lPTiA9IC0xO1xuXG52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iAgICAgICAgcHV0X2J5dGUocywgT1NfQ09ERSk7XG4gICAgICAgIHMuc3RhdHVzID0gQlVTWV9TVEFURTtcbiAgICAgIH1cbiAgICAgIGVsc2Uge1xuICAgICAgICBwdXRfYnl0ZShzLCAocy5nemhlYWQudGV4dCA/IDEgOiAwKSArXG4gICAgICAgICAgICAgICAgICAgIChzLmd6aGVhZC5oY3JjID8gMiA6IDApICtcbiAgICAgICAgICAgICAgICAgICAgKCFzLmd6aGVhZC5leHRyYSA/IDAgOiA0KSArXG4gICAgICAgICAgICAgICAgICAgICghcy5nemhlYWQubmFtZSA/IDAgOiA4KSArXG4gICAgICAgICAgICAgICAgICAgICghcy5nemhlYWQuY29tbWVudCA/IDAgOiAxNilcbiAgICAgICAgKTtcbiAgICAgICAgcHV0X2J5dGUocywgcy5nemhlYWQudGltZSAmIDB4ZmYpO1xuICAgICAgICBwdXRfYnl0ZShzLCAocy5nemhlYWQudGltZSA+PiA4KSAmIDB4ZmYpO1xuICAgICAgICBwdXRfYnl0ZShzLCAocy5nemhlYWQudGltZSA+PiAxNikgJiAweGZmKTtcbiAgICAgICAgcHV0X2J5dGUocywgKHMuZ3poZWFkLnRpbWUgPj4gMjQpICYgMHhmZik7XG4gICAgICAgIHB1dF9ieXRlKHMsIHMubGV2ZWwgPT09IDkgPyAyIDpcbiAgICAgICAgICAgICAgICAgICAgKHMuc3RyYXRlZ3kgPj0gWl9IVUZGTUFOX09OTFkgfHwgcy5sZXZlbCA8IDIgP1xuICAgICAgICAgICAgICAgICAgICAgNCA6IDApKTtcbiAgICAgICAgcHV0X2J5dGUocywgcy5nemhlYWQub3MgJiAweGZmKTtcbiAgICAgICAgaWYgKHMuZ3poZWFkLmV4dHJhICYmIHMuZ3poZWFkLmV4dHJhLmxlbmd0aCkge1xuICAgICAgICAgIHB1dF9ieXRlKHMsIHMuZ3poZWFkLmV4dHJhLmxlbmd0aCAmIDB4ZmYpO1xuICAgICAgICAgIHB1dF9ieXRlKHMsIChzLmd6aG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ZhciBaX0FTQ0lJICAgICAgICAgICAgID0gMTsgLy8gPSBaX1RFWFRcbnZhciBaX1VOS05PV04gICAgICAgICAgICAgPSAyO1xuXG4vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbmZ1bmN0aW9uIHplcm8oYnVmKSB7IHZhciBsZW4gPSBidWYubGVuZ3RoOyB3aGlsZSAoLS1sZW4gPj0gMCkgeyBidWZbbGVuXSA9IDA7IH0gfVxuXG4vLyBGcm9tIHp1dGlsLmhcblxudmFyIFNUT1JFRF9CTE9DSyA9IDA7XG52YXIgU1RBVElDX1RSRUVTID0gMTtcbnZhciBEWU5fVFJFRVMgICAgPSAyO1xuLyogVGhlIHRocmVlIGtpbmRzIG9mIGJsb2NrIHR5cGUgKi9cblxudmFyIE1JTl9NQVRDSCAgICA9IDM7XG52YXIgTUFYX01BVENIICAgID0gMjU4O1xuLyogVGhlIG1pbmltdW0gYW5kIG1heGltdW0gbWF0Y2ggbGVuZ3RocyAqL1xuXG4vLyBGcm9tIGRlZmxhdGUuaFxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBJbnRlcm5hbCBjb21wcmVzc2lvbiBzdGF0ZS5cbiAqL1xuXG52YXIgTEVOR1RIX0NPREVTICA9IDI5O1xuLyogbnVtYmVyIG9mIGxlbmd0aCBjb2Rlcywgbm90IGNvdW50aW5nIHRoZSBzcGVjaWFsIEVORF9CTE9DSyBjb2RlICovXG5cbnZhciBMSVRFUkFMUyAgICAgID0gMjU2O1xuLyogbnVtYmVyIG9mIGxpdGVyYWwgYnl0ZXMgMC4uMjU1ICovXG5cbnZhciBMX0NPREVTICAgICAgID0gTElURVJBTFMgKyAxICsgTEVOR1RIX0NPREVTO1xuLyogbnVtYmVyIG9mIExpdGVyYWwgb3IgTGVuZ3RoIGNvZGVzLCBpbmNsdWRpbmcgdGhlIEVORF9CTE9DSyBjb2RlICovXG5cbnZhciBEX0NPREVTICAgICAgID0gMzA7XG4vKiBudW1iZXIgb2YgZGlzdGFuY2UgY29kZXMgKi9cblxudmFyIEJMX0NPREVTICAgICAgPSAxOTtcbi8qIG51bWJlciBvZiBjb2RlcyB1c2VkIHRvIHRyYW5zZmVyIHRoZSBiaXQgbGVuZ3RocyAqL1xuXG52YXIgSEVBUF9TSVpFICAgICA9IDIgKiBMX0NPREVTICsgMTtcbi8qIG1heGltdW0gaGVhcCBzaXplICovXG5cbnZhciBNQVhfQklUUyAgICAgID0gMTU7XG4vKiBBbGwgY29kZXMgbXVzdCBub3QgZXhjZWVkIE1BWF9CSVRTIGJpdHMgKi9cblxudmFyIEJ1Zl9zaXplICAgICAgPSAxNjtcbi8qIHNpemUgb2YgYml0IGJ1ZmZlciBpbiBiaV9idWYgKi9cblxuXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIENvbnN0YW50c1xuICovXG5cbnZhciBNQVhfQkxfQklUUyA9IDc7XG4vKiBCaXQgbGVuZ3RoIGNvZGVzIG11c3Qgbm90IGV4Y2VlZCBNQVhfQkxfQklUUyBiaXRzICovXG5cbnZhciBFTkRfQkxPQ0sgICA9IDI1Njtcbi8qIGVuZCBvZiBibG9jayBsaXRlcmFsIGNvZGUgKi9cblxudmFyIFJFUF8zXzYgICAgID0gMTY7XG4vKiByZXBlYXQgcHJldmlvdXMgYml0IGxlbmd0aCAzLTYgdGltZXMgKDIgYml0cyBvZiByZXBlYXQgY291bnQpICovXG5cbnZhciBSRVBaXzNfMTAgICA9IDE3O1xuLyogcmVwZWF0IGEgemVybyBsZW5ndGggMy0xMCB0aW1lcyAgKDMgYml0cyBvZiByZXBlYXQgY291bnQpICovXG5cbnZhciBSRVBaXzExXzEzOCA9IDE4O1xuLyogcmVwZW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ZSBjb25zaXN0ZW50LiBUaGUgbGFzdCBjb2RlXG4gICAqIG11c3QgYmUgYWxsIG9uZXMuXG4gICAqL1xuICAvL0Fzc2VydCAoY29kZSArIGJsX2NvdW50W01BWF9CSVRTXS0xID09ICgxPDxNQVhfQklUUyktMSxcbiAgLy8gICAgICAgIFwiaW5jb25zaXN0ZW50IGJpdCBjb3VudHNcIik7XG4gIC8vVHJhY2V2KChzdGRlcnIsXCJcXG5nZW5fY29kZXM6IG1heF9jb2RlICVkIFwiLCBtYXhfY29kZSkpO1xuXG4gIGZvciAobiA9IDA7ICBuIDw9IG1heF9jb2RlOyBuKyspIHtcbiAgICB2YXIgbGVuID0gdHJlZVtuICogMiArIDFdLyouTGVuKi87XG4gICAgaWYgKGxlbiA9PT0gMCkgeyBjb250aW51ZTsgfVxuICAgIC8qIE5vdyByZXZlcnNlIHRoZSBiaXRzICovXG4gICAgdHJlZVtuICogMl0vKi5Db2RlKi8gPSBiaV9yZXZlcnNlKG5leHRfY29kZVtsZW5dKyssIGxlbik7XG5cbiAgICAvL1RyYWNlY3YodHJlZSAhPSBzdGF0aWNfbHRyZWUsIChzdGRlcnIsXCJcXG5uICUzZCAlYyBsICUyZCBjICU0eCAoJXgpIFwiLFxuICAgIC8vICAgICBuLCAoaXNncmFwaChuKSA/IG4gOiAnICcpLCBsZW4sIHRyZWVbbl0uQ29kZSwgbmV4dF9jb2RlW2xlbl0tMSkpO1xuICB9XG59XG5cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBJbml0aWFsaXplIHRoZSB2YXJpb3VzICdjb25zdGFudCcgdGFibGVzLlxuICovXG5mdW5jdGlvbiB0cl9zdGF0aWNfaW5pdCgpIHtcbiAgdmFyIG47ICAgICAgICAvKiBpdGVyYXRlcyBvdmVyIHRyZWUgZWxlbWVudHMgKi9cbiAgdmFyIGJpdHM7ICAgICAvKiBiaXQgY291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B7XG4gICAgICBzLmJsX3RyZWVbUkVQWl8zXzEwICogMl0vKi5GcmVxKi8rKztcblxuICAgIH0gZWxzZSB7XG4gICAgICBzLmJsX3RyZWVbUkVQWl8xMV8xMzggKiAyXS8qLkZyZXEqLysrO1xuICAgIH1cblxuICAgIGNvdW50ID0gMDtcbiAgICBwcmV2bGVuID0gY3VybGVuO1xuXG4gICAgaWYgKG5leHRsZW4gPT09IDApIHtcbiAgICAgIG1heF9jb3VudCA9IDEzODtcbiAgICAgIG1pbl9jb3VudCA9IDM7XG5cbiAgICB9IGVsc2UgaWYgKGN1cmxlbiA9PT0gbmV4dGxlbikge1xuICAgICAgbWF4X2NvdW50ID0gNjtcbiAgICAgIG1pbl9jb3VudCA9IDM7XG5cbiAgICB9IGVsc2Uge1xuICAgICAgbWF4X2NvdW50ID0gNztcbiAgICAgIG1pbl9jb3VudCA9IDQ7XG4gICAgfVxuICB9XG59XG5cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBTZW5kIGEgbGl0ZXJhbCBvciBkaXN0YW5jZSB0cmVlIGluIGNvbXByZXNzZWQgZm9ybSwgdXNpbmcgdGhlIGNvZGVzIGluXG4gKiBibF90cmVlLlxuICovXG5mdW5jdGlvbiBzZW5kX3RyZWUocywgdHJlZSwgbWF4X2NvZGUpXG4vLyAgICBkZWZsYXRlX3N0YXRlICpzO1xuLy8gICAgY3RfZGF0YSAqdHJlZTsgLyogdGhlIHRyZWUgdG8gYmUgc2Nhbm5lZCAqL1xuLy8gICAgaW50IG1heF9jb2RlOyAgICAgICAvKiBhbmQgaXRzIGxhcmdlc3QgY29kZSBvZiBub24gemVybyBmcmVxdWVuY3kgKi9cbntcbiAgdmFyIG47ICAgICAgICAgICAgICAgICAgICAgLyogaXRlcmF0ZXMgb3ZlciBhbGwgdHJlZSBlbGVtZW50cyAqL1xuICB2YXIgcHJldmxlbiA9IC0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ICAgICAgc2VuZF9jb2RlKHMsIGN1cmxlbiwgcy5ibF90cmVlKTtcbiAgICAgICAgY291bnQtLTtcbiAgICAgIH1cbiAgICAgIC8vQXNzZXJ0KGNvdW50ID49IDMgJiYgY291bnQgPD0gNiwgXCIgM182P1wiKTtcbiAgICAgIHNlbmRfY29kZShzLCBSRVBfM182LCBzLmJsX3RyZWUpO1xuICAgICAgc2VuZF9iaXRzKHMsIGNvdW50IC0gMywgMik7XG5cbiAgICB9IGVsc2UgaWYgKGNvdW50IDw9IDEwKSB7XG4gICAgICBzZW5kX2NvZGUocywgUkVQWl8zXzEwLCBzLmJsX3RyZWUpO1xuICAgICAgc2VuZF9iaXRzKHMsIGNvdW50IC0gMywgMyk7XG5cbiAgICB9IGVsc2Uge1xuICAgICAgc2VuZF9jb2RlKHMsIFJFUFpfMTFfMTM4LCBzLmJsX3RyZWUpO1xuICAgICAgc2VuZF9iaXRzKHMsIGNvdW50IC0gMTEsIDcpO1xuICAgIH1cblxuICAgIGNvdW50ID0gMDtcbiAgICBwcmV2bGVuID0gY3VybGVuO1xuICAgIGlmIChuZXh0bGVuID09PSAwKSB7XG4gICAgICBtYXhfY291bnQgPSAxMzg7XG4gICAgICBtaW5fY291bnQgPSAzO1xuXG4gICAgfSBlbHNlIGlmIChjdXJsZW4gPT09IG5leHRsZW4pIHtcbiAgICAgIG1heF9jb3VudCA9IDY7XG4gICAgICBtaW5fY291bnQgPSAzO1xuXG4gICAgfSBlbHNlIHtcbiAgICAgIG1heF9jb3VudCA9IDc7XG4gICAgICBtaW5fY291bnQgPSA0O1xuICAgIH1cbiAgfVxufVxuXG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQ29uc3RydWN0IHRoZSBIdWZmbWFuIHRyZWUgZm9yIHRoZSBiaXQgbGVuZ3RocyBhbmQgcmV0dXJuIHRoZSBpbmRleCBpblxuICogYmxfb3JkZ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c3RhbmNlIGZyb20gemxpYiBoZWFkZXIgKi9cbi8vI2VuZGlmXG4gIHZhciB3c2l6ZTsgICAgICAgICAgICAgICAgICAvKiB3aW5kb3cgc2l6ZSBvciB6ZXJvIGlmIG5vdCB1c2luZyB3aW5kb3cgKi9cbiAgdmFyIHdoYXZlOyAgICAgICAgICAgICAgICAgIC8qIHZhbGlkIGJ5dGVzIGluIHRoZSB3aW5kb3cgKi9cbiAgdmFyIHduZXh0OyAgICAgICAgICAgICAgICAgIC8qIHdpbmRvdyB3cml0ZSBpbmRleCAqL1xuICAvLyBVc2UgYHNfd2luZG93YCBpbnN0ZWFkIGB3aW5kb3dgLCBhdm9pZCBjb25mbGljdCB3aXRoIGluc3RydW1lbnRhdGlvbiB0b29sc1xuICB2YXIgc193aW5kb3c7ICAgICAgICAgICAgICAgLyogYWxsb2NhdGVkIHNsaWRpbmcgd2luZG93LCBpZiB3c2l6ZSAhPSAwICovXG4gIHZhciBob2xkOyAgICAgICAgICAgICAgICAgICAvKiBsb2NhbCBzdHJtLmhvbGQgKi9cbiAgdmFyIGJpdHM7ICAgICAgICAgICAgICAgICAgIC8qIGxvY2FsIHN0cm0uYml0cyAqL1xuICB2YXIgbGNvZGU7ICAgICAgICAgICAgICAgICAgLyogbG9jYWwgc3RybS5sZW5jb2RlICovXG4gIHZhciBkY29kZTsgICAgICAgICAgICAgICAgICAvKiBsb2NhbCBzdHJtLmRpc3Rjb2RlICovXG4gIHZhciBsbWFzazsgICAgICAgICAgICAgICAgICAvKiBtYXNrIGZvciBmaXJzdCBsZXZlbCBvZiBsZW5ndGggY29kZXMgKi9cbiAgdmFyIGRtYXNrOyAgICAgICAgICAgICAgICAgIC8qIG1hc2sgZm9yIGZpcnN0IGxldmVsIG9mIGRpc3RhbmNlIGNvZGVzICovXG4gIHZhciBoZXJlOyAgICAgICAgICAgICAgICAgICAvKiByZXRyaWV2ZWQgdGFibGUgZW50cnkgKi9cbiAgdmFyIG9wOyAgICAgICAgICAgICAgICAg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AgbGl0ZXJhbCAnJWMnXFxuXCIgOlxuICAgICAgICAvLyAgICAgICAgXCJpbmZsYXRlOiAgICAgICAgIGxpdGVyYWwgMHglMDJ4XFxuXCIsIGhlcmUudmFsKSk7XG4gICAgICAgIG91dHB1dFtfb3V0KytdID0gaGVyZSAmIDB4ZmZmZi8qaGVyZS52YWwqLztcbiAgICAgIH1cbiAgICAgIGVsc2UgaWYgKG9wICYgMTYpIHsgICAgICAgICAgICAgICAgICAgICAvKiBsZW5ndGggYmFzZSAqL1xuICAgICAgICBsZW4gPSBoZXJlICYgMHhmZmZmLypoZXJlLnZhbCovO1xuICAgICAgICBvcCAmPSAxNTsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBudW1iZXIgb2YgZXh0cmEgYml0cyAqL1xuICAgICAgICBpZiAob3ApIHtcbiAgICAgICAgICBpZiAoYml0cyA8IG9wKSB7XG4gICAgICAgICAgICBob2xkICs9IGlucHV0W19pbisrXSA8PCBiaXRzO1xuICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgIH1cbiAgICAgICAgICBsZW4gKz0gaG9sZCAmICgoMSA8PCBvcCkgLSAxKTtcbiAgICAgICAgICBob2xkID4+Pj0gb3A7XG4gICAgICAgICAgYml0cyAtPSBvcDtcbiAgICAgICAgfVxuICAgICAgICAvL1RyYWNldnYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgICAgICAgIGxlbmd0aCAldVxcblwiLCBsZW4pKTtcbiAgICAgICAgaWYgKGJpdHMgPCAxNSkge1xuICAgICAgICAgIGhvbGQgKz0gaW5wdXRbX2luKytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgIGhvbGQgKz0gaW5wdXRbX2luKytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIGhlcmUgPSBkY29kZVtob2xkICYgZG1hc2tdO1xuXG4gICAgICAgIGRvZGlzdDpcbiAgICAgICAgZm9yICg7OykgeyAvLyBnb3RvIGVtdWxhdGlvblxuICAgICAgICAgIG9wID0gaGVyZSA+Pj4gMjQvKmhlcmUuYml0cyovO1xuICAgICAgICAgIGhvbGQgPj4+PSBvcDtcbiAgICAgICAgICBiaXRzIC09IG9wO1xuICAgICAgICAgIG9wID0gKGhlcmUgPj4+IDE2KSAmIDB4ZmYvKmhlcmUub3AqLztcblxuICAgICAgICAgIGlmIChvcCAmIDE2KSB7ICAgICAgICAgICAgICAgICAgICAgIC8qIGRpc3RhbmNlIGJhc2UgKi9cbiAgICAgICAgICAgIGRpc3QgPSBoZXJlICYgMHhmZmZmLypoZXJlLnZhbCovO1xuICAgICAgICAgICAgb3AgJj0gMTU7ICAgICAgICAgICAgICAgICAgICAgICAvKiBudW1iZXIgb2YgZXh0cmEgYml0cyAqL1xuICAgICAgICAgICAgaWYgKGJpdHMgPCBvcCkge1xuICAgICAgICAgICAgICBob2xkICs9IGlucHV0W19pbisrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICAgIGlmIChiaXRzIDwgb3ApIHtcbiAgICAgICAgICAgICAgICBob2xkICs9IGlucHV0W19pbisrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZGlzdCArPSBob2xkICYgKCgxIDw8IG9wKSAtIDEpO1xuLy8jaWZkZWYgSU5GTEFURV9TVFJJQ1RcbiAgICAgICAgICAgIGlmIChkaXN0ID4gZG1heCkge1xuICAgICAgICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGRpc3RhbmNlIHRvbyBmYXIgYmFjayc7XG4gICAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICAgIGJyZWFrIHRvcDtcbiAgICAgICAgICAgIH1cbi8vI2VuZGlmXG4gICAgICAgICAgICBob2xkID4+Pj0gb3A7XG4gICAgICAgICAgICBiaXRzIC09IG9wO1xuICAgICAgICAgICAgLy9UcmFjZXZ2KChzdGRlcnIsIFwiaW5mbGF0ZTogICAgICAgICBkaXN0YW5jZSAldVxcblwiLCBkaXN0KSk7XG4gICAgICAgICAgICBvcCA9IF9vdXQgLSBiZWc7ICAgICAgICAgICAgICAgIC8qIG1heCBkaXN0YW5jZSBpbiBvdXRwdXQgKi9cbiAgICAgICAgICAgIGlmIChkaXN0ID4gb3ApIHsgICAgICAgICAgICAgICAgLyogc2VlIGlmIGNvcHkgZnJvbSB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgb3AgPSBkaXN0IC0gb3A7ICAgICAgICAgICAgICAgLyogZGlzdGFuY2UgYmFjayBpbiB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgaWYgKG9wID4gd2hhdmUpIHtcbiAgICAgICAgICAgICAgICBpZiAoc3RhdGUuc2FuZSkge1xuICAgICAgICAgICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBkaXN0YW5jZSB0b28gZmFyIGJhY2snO1xuICAgICAgICAgICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICAgICAgICAgIGJyZWFrIHRvcDtcbiAgICAgICAgICAgICAgICB9XG5cbi8vICghKSBUaGlzIGJsb2NrIGlzIGRpc2FibGVkIGluIHpsaWIgZGVmYXVsdHMsXG4vLyBkb24ndCBlbmFibGUgaXQgZm9yIGJpbmFyeSBjb21wYXRpYmlsaXR5XG4vLyNpZmRlZiBJTkZMQVRFX0FMTE9XX0lOVkFMSURfRElTVEFOQ0VfVE9PRkFSX0FSUlJcbi8vICAgICAgICAgICAgICAgIGlmIChsZW4gPD0gb3AgLSB3aGF2ZSkge1xuLy8gICAgICAgICAgICAgICAgICBkbyB7XG4vLyAgICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSAwO1xuLy8gICAgICAgICAgICAgICAgICB9IHdoaWxlICgtLWxlbik7XG4vLyAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIHRvcDtcbi8vICAgICAgICAgICAgICAgIH1cbi8vICAgICAgICAgICAgICAgIGxlbiAtPSBvcCAtIHdoYXZlO1xuLy8gICAgICAgICAgICAgICAgZG8ge1xuLy8gICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IDA7XG4vLyAgICAgICAgICAgICAgICB9IHdoaWxlICgtLW9wID4gd2hhdmUpO1xuLy8gICAgICAgICAgICAgICAgaWYgKG9wID09PSAwKSB7XG4vLyAgICAgICAgICAgICAgICAgIGZyb20gPSBfb3V0IC0gZGlzdDtcbi8vICAgICAgICAgICAgICAgICAgZG8ge1xuLy8gICAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gb3V0cHV0W2Zyb20rK107XG4vLyAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tbGVuKTtcbi8vICAgICAgICAgICAgICAgICAgY29udGludWUgdG9wO1xuLy8gICAgICAgICAgICAgICAgfVxuLy8jZW5kaWZcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBmcm9tID0gMDsgLy8gd2luZG93IGluZGV4XG4gICAgICAgICAgICAgIGZyb21fc291cmNlID0gc193aW5kb3c7XG4gICAgICAgICAgICAgIGlmICh3bmV4dCA9PT0gMCkgeyAgICAgICAgICAgLyogdmVyeSBjb21tb24gY2FzZSAqL1xuICAgICAgICAgICAgICAgIGZyb20gKz0gd3NpemUgLSBvcDtcbiAgICAgICAgICAgICAgICBpZiAob3AgPCBsZW4pIHsgICAgICAgICAvKiBzb21lIGZyb20gd2luZG93ICovXG4gICAgICAgICAgICAgICAgICBsZW4gLT0gb3A7XG4gICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gc193aW5kb3dbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tb3ApO1xuICAgICAgICAgICAgICAgICAgZnJvbSA9IF9vdXQgLSBkaXN0OyAgLyogcmVzdCBmcm9tIG91dHB1dCAqL1xuICAgICAgICAgICAgICAgICAgZnJvbV9zb3VyY2UgPSBvdXRwdXQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGVsc2UgaWYgKHduZXh0IDwgb3ApIHsgICAgICAvKiB3cmFwIGFyb3VuZCB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgICBmcm9tICs9IHdzaXplICsgd25leHQgLSBvcDtcbiAgICAgICAgICAgICAgICBvcCAtPSB3bmV4dDtcbiAgICAgICAgICAgICAgICBpZiAob3AgPCBsZW4pIHsgICAgICAgICAvKiBzb21lIGZyb20gZW5kIG9mIHdpbmRvdyAqL1xuICAgICAgICAgICAgICAgICAgbGVuIC09IG9wO1xuICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IHNfd2luZG93W2Zyb20rK107XG4gICAgICAgICAgICAgICAgICB9IHdoaWxlICgtLW9wKTtcbiAgICAgICAgICAgICAgICAgIGZyb20gPSAwO1xuICAgICAgICAgICAgICAgICAgaWYgKHduZXh0IDwgbGVuKSB7ICAvKiBzb21lIGZyb20gc3RhcnQgb2Ygd2luZG93ICovXG4gICAgICAgICAgICAgICAgICAgIG9wID0gd25leHQ7XG4gICAgICAgICAgICAgICAgICAgIGxlbiAtPSBvcDtcbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gc193aW5kb3dbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1vcCk7XG4gICAgICAgICAgICAgICAgICAgIGZyb20gPSBfb3V0IC0gZGlzdDsgICAgICAvKiByZXN0IGZyb20gb3V0cHV0ICovXG4gICAgICAgICAgICAgICAgICAgIGZyb21fc291cmNlID0gb3V0cHV0O1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBlbHNlIHsgICAgICAgICAgICAgICAgICAgICAgLyogY29udGlndW91cyBpbiB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgICBmcm9tICs9IHduZXh0IC0gb3A7XG4gICAgICAgICAgICAgICAgaWYgKG9wIDwgbGVuKSB7ICAgICAgICAgLyogc29tZSBmcm9tIHdpbmRvdyAqL1xuICAgICAgICAgICAgICAgICAgbGVuIC09IG9wO1xuICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IHNfd2luZG93W2Zyb20rK107XG4gICAgICAgICAgICAgICAgICB9IHdoaWxlICgtLW9wKTtcbiAgICAgICAgICAgICAgICAgIGZyb20gPSBfb3V0IC0gZGlzdDsgIC8qIHJlc3QgZnJvbSBvdXRwdXQgKi9cbiAgICAgICAgICAgICAgICAgIGZyb21fc291cmNlID0gb3V0cHV0O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB3aGlsZSAobGVuID4gMikge1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gZnJvbV9zb3VyY2VbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IGZyb21fc291cmNlW2Zyb20rK107XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBmcm9tX3NvdXJjZVtmcm9tKytdO1xuICAgICAgICAgICAgICAgIGxlbiAtPSAzO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChsZW4pIHtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IGZyb21fc291cmNlW2Zyb20rK107XG4gICAgICAgICAgICAgICAgaWYgKGxlbiA+IDEpIHtcbiAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gZnJvbV9zb3VyY2VbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICBmcm9tID0gX291dCAtIGRpc3Q7ICAgICAgICAgIC8qIGNvcHkgZGlyZWN0IGZyb20gb3V0cHV0ICovXG4gICAgICAgICAgICAgIGRvIHsgICAgICAgICAgICAgICAgICAgICAgICAvKiBtaW5pbXVtIGxlbmd0aCBpcyB0aHJlZSAqL1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gb3V0cHV0W2Zyb20rK107XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBvdXRwdXRbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IG91dHB1dFtmcm9tKytdO1xuICAgICAgICAgICAgICAgIGxlbiAtPSAzO1xuICAgICAgICAgICAgICB9IHdoaWxlIChsZW4gPiAyKTtcbiAgICAgICAgICAgICAgaWYgKGxlbikge1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gb3V0cHV0W2Zyb20rK107XG4gICAgICAgICAgICAgICAgaWYgKGxlbiA+IDEpIHtcbiAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gb3V0cHV0W2Zyb20rK107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGVsc2UgaWYgKChvcCAmIDY0KSA9PT0gMCkgeyAgICAgICAgICAvKiAybmQgbGV2ZWwgZGlzdGFuY2UgY29kZSAqL1xuICAgICAgICAgICAgaGVyZSA9IGRjb2RlWyhoZXJlICYgMHhmZmZmKS8qaGVyZS52YWwqLyArIChob2xkICYgKCgxIDw8IG9wKSAtIDEpKV07XG4gICAgICAgICAgICBjb250aW51ZSBkb2Rpc3Q7XG4gICAgICAgICAgfVxuICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgc3RybS5tc2cgP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A9IC0zO1xudmFyIFpfTUVNX0VSUk9SICAgICA9IC00O1xudmFyIFpfQlVGX0VSUk9SICAgICA9IC01O1xuLy92YXIgWl9WRVJTSU9OX0VSUk9SID0gLTY7XG5cbi8qIFRoZSBkZWZsYXRlIGNvbXByZXNzaW9uIG1ldGhvZCAqL1xudmFyIFpfREVGTEFURUQgID0gODtcblxuXG4vKiBTVEFURVMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cblxuXG52YXIgICAgSEVBRCA9IDE7ICAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIG1hZ2ljIGhlYWRlciAqL1xudmFyICAgIEZMQUdTID0gMjsgICAgICAvKiBpOiB3YWl0aW5nIGZvciBtZXRob2QgYW5kIGZsYWdzIChnemlwKSAqL1xudmFyICAgIFRJTUUgPSAzOyAgICAgICAvKiBpOiB3YWl0aW5nIGZvciBtb2RpZmljYXRpb24gdGltZSAoZ3ppcCkgKi9cbnZhciAgICBPUyA9IDQ7ICAgICAgICAgLyogaTogd2FpdGluZyBmb3IgZXh0cmEgZmxhZ3MgYW5kIG9wZXJhdGluZyBzeXN0ZW0gKGd6aXApICovXG52YXIgICAgRVhMRU4gPSA1OyAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIGV4dHJhIGxlbmd0aCAoZ3ppcCkgKi9cbnZhciAgICBFWFRSQSA9IDY7ICAgICAgLyogaTogd2FpdGluZyBmb3IgZXh0cmEgYnl0ZXMgKGd6aXApICovXG52YXIgICAgTkFNRSA9IDc7ICAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIGVuZCBvZiBmaWxlIG5hbWUgKGd6aXApICovXG52YXIgICAgQ09NTUVOVCA9IDg7ICAgIC8qIGk6IHdhaXRpbmcgZm9yIGVuZCBvZ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Gxlbmd0aC9saXQgYW5kIGRpc3RhbmNlIGNvZGUgbGVuZ3RocyAqL1xudmFyICAgICAgICAgICAgTEVOXyA9IDIwOyAgICAgIC8qIGk6IHNhbWUgYXMgTEVOIGJlbG93LCBidXQgb25seSBmaXJzdCB0aW1lIGluICovXG52YXIgICAgICAgICAgICBMRU4gPSAyMTsgICAgICAgLyogaTogd2FpdGluZyBmb3IgbGVuZ3RoL2xpdC9lb2IgY29kZSAqL1xudmFyICAgICAgICAgICAgTEVORVhUID0gMjI7ICAgIC8qIGk6IHdhaXRpbmcgZm9yIGxlbmd0aCBleHRyYSBiaXRzICovXG52YXIgICAgICAgICAgICBESVNUID0gMjM7ICAgICAgLyogaTogd2FpdGluZyBmb3IgZGlzdGFuY2UgY29kZSAqL1xudmFyICAgICAgICAgICAgRElTVEVYVCA9IDI0OyAgIC8qIGk6IHdhaXRpbmcgZm9yIGRpc3RhbmNlIGV4dHJhIGJpdHMgKi9cbnZhciAgICAgICAgICAgIE1BVENIID0gMjU7ICAgICAvKiBvOiB3YWl0aW5nIGZvciBvdXRwdXQgc3BhY2UgdG8gY29weSBzdHJpbmcgKi9cbnZhciAgICAgICAgICAgIExJVCA9IDI2OyAgICAgICAvKiBvOiB3YWl0aW5nIGZvciBvdXRwdXQgc3BhY2UgdG8gd3JpdGUgbGl0ZXJhbCAqL1xudmFyICAgIENIRUNLID0gMjc7ICAgICAvKiBpOiB3YWl0aW5nIGZvciAzMi1iaXQgY2hlY2sgdmFsdWUgKi9cbnZhciAgICBMRU5HVEggPSAyODsgICAgLyogaTogd2FpdGluZyBmb3IgMzItYml0IGxlbmd0aCAoZ3ppcCkgKi9cbnZhciAgICBET05FID0gMjk7ICAgICAgLyogZmluaXNoZWQgY2hlY2ssIGRvbmUgLS0gcmVtYWluIGhlcmUgdW50aWwgcmVzZXQgKi9cbnZhciAgICBCQUQgPSAzMDsgICAgICAgLyogZ290IGEgZGF0YSBlcnJvciAtLSByZW1haW4gaGVyZSB1bnRpbCByZ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ICBjYXNlIEhFQUQ6XG4gICAgICAgIGlmIChzdGF0ZS53cmFwID09PSAwKSB7XG4gICAgICAgICAgc3RhdGUubW9kZSA9IFRZUEVETztcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICAvLz09PSBORUVEQklUUygxNik7XG4gICAgICAgIHdoaWxlIChiaXRzIDwgMTYpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgaWYgKChzdGF0ZS53cmFwICYgMikgJiYgaG9sZCA9PT0gMHg4YjFmKSB7ICAvKiBnemlwIGhlYWRlciAqL1xuICAgICAgICAgIHN0YXRlLmNoZWNrID0gMC8qY3JjMzIoMEwsIFpfTlVMTCwgMCkqLztcbiAgICAgICAgICAvLz09PSBDUkMyKHN0YXRlLmNoZWNrLCBob2xkKTtcbiAgICAgICAgICBoYnVmWzBdID0gaG9sZCAmIDB4ZmY7XG4gICAgICAgICAgaGJ1ZlsxXSA9IChob2xkID4+PiA4KSAmIDB4ZmY7XG4gICAgICAgICAgc3RhdGUuY2hlY2sgPSBjcmMzMihzdGF0ZS5jaGVjaywgaGJ1ZiwgMiwgMCk7XG4gICAgICAgICAgLy89PT0vL1xuXG4gICAgICAgICAgLy89PT0gSU5JVEJJVFMoKTtcbiAgICAgICAgICBob2xkID0gMDtcbiAgICAgICAgICBiaXRzID0gMDtcbiAgICAgICAgICAvLz09PS8vXG4gICAgICAgICAgc3RhdGUubW9kZSA9IEZMQUdTO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIHN0YXRlLmZsYWdzID0gMDsgICAgICAgICAgIC8qIGV4cGVjdCB6bGliIGhlYWRlciAqL1xuICAgICAgICBpZiAoc3RhdGUuaGVhZCkge1xuICAgICAgICAgIHN0YXRlLmhlYWQuZG9uZSA9IGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGlmICghKHN0YXRlLndyYXAgJiAxKSB8fCAgIC8qIGNoZWNrIGlmIHpsaWIgaGVhZGVyIGFsbG93ZWQgKi9cbiAgICAgICAgICAoKChob2xkICYgMHhmZikvKkJJVFMoOCkqLyA8PCA4KSArIChob2xkID4+IDgpKSAlIDMxKSB7XG4gICAgICAgICAgc3RybS5tc2cgPSAnaW5jb3JyZWN0IGhlYWRlciBjaGVjayc7XG4gICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBpZiAoKGhvbGQgJiAweDBmKS8qQklUUyg0KSovICE9PSBaX0RFRkxBVEVEKSB7XG4gICAgICAgICAgc3RybS5tc2cgPSAndW5rbm93biBjb21wcmVzc2lvbiBtZXRob2QnO1xuICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgLy8tLS0gRFJPUEJJVFMoNCkgLS0tLy9cbiAgICAgICAgaG9sZCA+Pj49IDQ7XG4gICAgICAgIGJpdHMgLT0gNDtcbiAgICAgICAgLy8tLS0vL1xuICAgICAgICBsZW4gPSAoaG9sZCAmIDB4MGYpLypCSVRTKDQpKi8gKyA4O1xuICAgICAgICBpZiAoc3RhdGUud2JpdHMgPT09IDApIHtcbiAgICAgICAgICBzdGF0ZS53Yml0cyA9IGxlbjtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChsZW4gPiBzdGF0ZS53Yml0cykge1xuICAgICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgd2luZG93IHNpemUnO1xuICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgc3RhdGUuZG1heCA9IDEgPDwgbGVuO1xuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgemxpYiBoZWFkZXIgb2tcXG5cIikpO1xuICAgICAgICBzdHJtLmFkbGVyID0gc3RhdGUuY2hlY2sgPSAxLyphZGxlcjMyKDBMLCBaX05VTEwsIDApKi87XG4gICAgICAgIHN0YXRlLm1vZGUgPSBob2xkICYgMHgyMDAgPyBESUNUSUQgOiBUWVBFO1xuICAgICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgICBob2xkID0gMDtcbiAgICAgICAgYml0cyA9IDA7XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIEZMQUdTOlxuICAgICAgICAvLz09PSBORUVEQklUUygxNik7ICovXG4gICAgICAgIHdoaWxlIChiaXRzIDwgMTYpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgc3RhdGUuZmxhZ3MgPSBob2xkO1xuICAgICAgICBpZiAoKHN0YXRlLmZsYWdzICYgMHhmZikgIT09IFpfREVGTEFURUQpIHtcbiAgICAgICAgICBzdHJtLm1zZyA9ICd1bmtub3duIGNvbXByZXNzaW9uIG1ldGhvZCc7XG4gICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBpZiAoc3RhdGUuZmxhZ3MgJiAweGUwMDApIHtcbiAgICAgICAgICBzdHJtLm1zZyA9ICd1bmtub3duIGhlYWRlciBmbGFncyBzZXQnO1xuICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHN0YXRlLmhlYWQpIHtcbiAgICAgICAgICBzdGF0ZS5oZWFkLnRleHQgPSAoKGhvbGQgPj4gOCkgJiAxKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoc3RhdGUuZmxhZ3MgJiAweDAyMDApIHtcbiAgICAgICAgICAvLz09PSBDUkMyKHN0YXRlLmNoZWNrLCBob2xkKTtcbiAgICAgICAgICBoYnVmWzBdID0gaG9sZCAmIDB4ZmY7XG4gICAgICAgICAgaGJ1ZlsxXSA9IChob2xkID4+PiA4KSAmIDB4ZmY7XG4gICAgICAgICAgc3RhdGUuY2hlY2sgPSBjcmMzMihzdGF0ZS5jaGVjaywgaGJ1ZiwgMiwgMCk7XG4gICAgICAgICAgLy89PT0vL1xuICAgICAgICB9XG4gICAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICAgIGhvbGQgPSAwO1xuICAgICAgICBiaXRzID0gMDtcbiAgICAgICAgLy89PT0vL1xuICAgICAgICBzdGF0ZS5tb2RlID0gVElNRTtcbiAgICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgICAgY2FzZSBUSU1FOlxuICAgICAgICAvLz09PSBORUVEQklUUygzMik7ICovXG4gICAgICAgIHdoaWxlIChiaXRzIDwgMzIpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgaWYgKHN0YXRlLmhlYWQpIHtcbiAgICAgICAgICBzdGF0ZS5oZWFkLnRpbWUgPSBob2xkO1xuICAgICAgICB9XG4gICAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MDIwMCkge1xuICAgICAgICAgIC8vPT09IENSQzQoc3RhdGUuY2hlY2ssIGhvbGQpXG4gICAgICAgICAgaGJ1ZlswXSA9IGhvbGQgJiAweGZmO1xuICAgICAgICAgIGhidWZbMV0gPSAoaG9sZCA+Pj4gOCkgJiAweGZmO1xuICAgICAgICAgIGhidWZbMl0gPSAoaG9sZCA+Pj4gMTYpICYgMHhmZjtcbiAgICAgICAgICBoYnVmWzNdID0gKGhvbGQgPj4+IDI0KSAmIDB4ZmY7XG4gICAgICAgICAgc3RhdGUuY2hlY2sgPSBjcmMzMihzdGF0ZS5jaGVjaywgaGJ1ZiwgNCwgMCk7XG4gICAgICAgICAgLy89PT1cbiAgICAgICAgfVxuICAgICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgICBob2xkID0gMDtcbiAgICAgICAgYml0cyA9IDA7XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgc3RhdGUubW9kZSA9IE9TO1xuICAgICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgICBjYXNlIE9TOlxuICAgICAgICAvLz09PSBORUVEQklUUygxNik7ICovXG4gICAgICAgIHdoaWxlIChiaXRzIDwgMTYpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgaWYgKHN0YXRlLmhlYWQpIHtcbiAgICAgICAgICBzdGF0ZS5oZWFkLnhmbGFncyA9IChob2xkICYgMHhmZik7XG4gICAgICAgICAgc3RhdGUuaGVhZC5vcyA9IChob2xkID4+IDgpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MDIwMCkge1xuICAgICAgICAgIC8vPT09IENSQzIoc3RhdGUuY2hlY2ssIGhvbGQpO1xuICAgICAgICAgIGhidWZbMF0gPSBob2xkICYgMHhmZjtcbiAgICAgICAgICBoYnVmWzFdID0gKGhvbGQgPj4+IDgpICYgMHhmZjtcbiAgICAgICAgICBzdGF0ZS5jaGVjayA9IGNyYzMyKHN0YXRlLmNoZWNrLCBoYnVmLCAyLCAwKTtcbiAgICAgICAgICAvLz09PS8vXG4gICAgICAgIH1cbiAgICAgICAgLy89PT0gSU5JVEJJVFMoKTtcbiAgICAgICAgaG9sZCA9IDA7XG4gICAgICAgIGJpdHMgPSAwO1xuICAgICAgICAvLz09PS8vXG4gICAgICAgIHN0YXRlLm1vZGUgPSBFWExFTjtcbiAgICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgICAgY2FzZSBFWExFTjpcbiAgICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwNDAwKSB7XG4gICAgICAgICAgLy89PT0gTkVFREJJVFMoMTYpOyAqL1xuICAgICAgICAgIHdoaWxlIChiaXRzIDwgMTYpIHtcbiAgICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgICAgaGF2ZS0tO1xuICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgfVxuICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICBzdGF0ZS5sZW5ndGggPSBob2xkO1xuICAgICAgICAgIGlmIChzdGF0ZS5oZWFkKSB7XG4gICAgICAgICAgICBzdGF0ZS5oZWFkLmV4dHJhX2xlbiA9IGhvbGQ7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MDIwMCkge1xuICAgICAgICAgICAgLy89PT0gQ1JDMihzdGF0ZS5jaGVjaywgaG9sZCk7XG4gICAgICAgICAgICBoYnVmWzBdID0gaG9sZCAmIDB4ZmY7XG4gICAgICAgICAgICBoYnVmWzFdID0gKGhvbGQgPj4+IDgpICYgMHhmZjtcbiAgICAgICAgICAgIHN0YXRlLmNoZWNrID0gY3JjMzIoc3RhdGUuY2hlY2ssIGhidWYsIDIsIDApO1xuICAgICAgICAgICAgLy89PT0vL1xuICAgICAgICAgIH1cbiAgICAgICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgICAgIGhvbGQgPSAwO1xuICAgICAgICAgIGJpdHMgPSAwO1xuICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChzdGF0ZS5oZWFkKSB7XG4gICAgICAgICAgc3RhdGUuaGVhZC5leHRyYSA9IG51bGwvKlpfTlVMTCovO1xuICAgICAgICB9XG4gICAgICAgIHN0YXRlLm1vZGUgPSBFWFRSQTtcbiAgICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgICAgY2FzZSBFWFRSQTpcbiAgICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwNDAwKSB7XG4gICAgICAgICAgY29weSA9IHN0YXRlLmxlbmd0aDtcbiAgICAgICAgICBpZiAoY29weSA+IGhhdmUpIHsgY29weSA9IGhhdmU7IH1cbiAgICAgICAgICBpZiAoY29weSkge1xuICAgICAgICAgICAgaWYgKHN0YXRlLmhlYWQpIHtcbiAgICAgICAgICAgICAgbGVuID0gc3RhdGUuaGVhZC5leHRyYV9sZW4gLSBzdGF0ZS5sZW5ndGg7XG4gICAgICAgICAgICAgIGlmICghc3RhdGUuaGVhZC5leHRyYSkge1xuICAgICAgICAgICAgICAgIC8vIFVzZSB1bnR5cGVkIGFycmF5IGZvciBtb3JlIGNvbnZlbmllbnQgcHJvY2Vzc2luZyBsYXRlclxuICAgICAgICAgICAgICAgIHN0YXRlLmhlYWQuZXh0cmEgPSBuZXcgQXJyYXkoc3RhdGUuaGVhZC5leHRyYV9sZW4pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHV0aWxzLmFycmF5U2V0KFxuICAgICAgICAgICAgICAgIHN0YXRlLmhlYWQuZXh0cmEsXG4gICAgICAgICAgICAgICAgaW5wdXQsXG4gICAgICAgICAgICAgICAgbmV4dCxcbiAgICAgICAgICAgICAgICAvLyBleHRyYSBmaWVsZCBpcyBsaW1pdGVkIHRvIDY1NTM2IGJ5dGVzXG4gICAgICAgICAgICAgICAgLy8gLSBubyBuZWVkIGZvciBhZGRpdGlvbmFsIHNpemUgY2hlY2tcbiAgICAgICAgICAgICAgICBjb3B5LFxuICAgICAgICAgICAgICAgIC8qbGVuICsgY29weSA+IHN0YXRlLmhlYWQuZXh0cmFfbWF4IC0gbGVuID8gc3RhdGUuaGVhZC5leHRyYV9tYXggOiBjb3B5LCovXG4gICAgICAgICAgICAgICAgbGVuXG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgIC8vem1lbWNweShzdGF0ZS5oZWFkLmV4dHJhICsgbGVuLCBuZXh0LFxuICAgICAgICAgICAgICAvLyAgICAgICAgbGVuICsgY29weSA+IHN0YXRlLmhlYWQuZXh0cmFfbWF4ID9cbiAgICAgICAgICAgICAgLy8gICAgICAgIHN0YXRlLmhlYWQuZXh0cmFfbWF4IC0gbGVuIDogY29weSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoc3RhdGUuZmxhZ3MgJiAweDAyMDApIHtcbiAgICAgICAgICAgICAgc3RhdGUuY2hlY2sgPSBjcmMzMihzdGF0ZS5jaGVjaywgaW5wdXQsIGNvcHksIG5leHQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaGF2ZSAtPSBjb3B5O1xuICAgICAgICAgICAgbmV4dCArPSBjb3B5O1xuICAgICAgICAgICAgc3RhdGUubGVuZ3RoIC09IGNvcHk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzdGF0ZS5sZW5ndGgpIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgIH1cbiAgICAgICAgc3RhdGUubGVuZ3RoID0gMDtcbiAgICAgICAgc3RhdGUubW9kZSA9IE5BTUU7XG4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ICAgICB9XG4gICAgICAgIHN0YXRlLmxlbmd0aCA9IDA7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBDT01NRU5UO1xuICAgICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgICBjYXNlIENPTU1FTlQ6XG4gICAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MTAwMCkge1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGNvcHkgPSAwO1xuICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgIGxlbiA9IGlucHV0W25leHQgKyBjb3B5KytdO1xuICAgICAgICAgICAgLyogdXNlIGNvbnN0YW50IGxpbWl0IGJlY2F1c2UgaW4ganMgd2Ugc2hvdWxkIG5vdCBwcmVhbGxvY2F0ZSBtZW1vcnkgKi9cbiAgICAgICAgICAgIGlmIChzdGF0ZS5oZWFkICYmIGxlbiAmJlxuICAgICAgICAgICAgICAgIChzdGF0ZS5sZW5ndGggPCA2NTUzNiAvKnN0YXRlLmhlYWQuY29tbV9tYXgqLykpIHtcbiAgICAgICAgICAgICAgc3RhdGUuaGVhZC5jb21tZW50ICs9IFN0cmluZy5mcm9tQ2hhckNvZGUobGVuKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IHdoaWxlIChsZW4gJiYgY29weSA8IGhhdmUpO1xuICAgICAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MDIwMCkge1xuICAgICAgICAgICAgc3RhdGUuY2hlY2sgPSBjcmMzMihzdGF0ZS5jaGVjaywgaW5wdXQsIGNvcHksIG5leHQpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBoYXZlIC09IGNvcHk7XG4gICAgICAgICAgbmV4dCArPSBjb3B5O1xuICAgICAgICAgIGlmIChsZW4pIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoc3RhdGUuaGVhZCkge1xuICAgICAgICAgIHN0YXRlLmhlYWQuY29tbWVudCA9IG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgc3RhdGUubW9kZSA9IEhDUkM7XG4gICAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICAgIGNhc2UgSENSQzpcbiAgICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwMjAwKSB7XG4gICAgICAgICAgLy89PT0gTkVFREJJVFMoMTYpOyAqL1xuICAgICAgICAgIHdoaWxlIChiaXRzIDwgMTYpIHtcbiAgICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgICAgaGF2ZS0tO1xuICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgfVxuICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICBpZiAoaG9sZCAhPT0gKHN0YXRlLmNoZWNrICYgMHhmZmZmKSkge1xuICAgICAgICAgICAgc3RybS5tc2cgPSAnaGVhZGVyIGNyYyBtaXNtYXRjaCc7XG4gICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICAgICAgaG9sZCA9IDA7XG4gICAgICAgICAgYml0cyA9IDA7XG4gICAgICAgICAgLy89PT0vL1xuICAgICAgICB9XG4gICAgICAgIGlmIChzdGF0ZS5oZWFkKSB7XG4gICAgICAgICAgc3RhdGUuaGVhZC5oY3JjID0gKChzdGF0ZS5mbGFncyA+PiA5KSAmIDEpO1xuICAgICAgICAgIHN0YXRlLmhlYWQuZG9uZSA9IHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgc3RybS5hZGxlciA9IHN0YXRlLmNoZWNrID0gMDtcbiAgICAgICAgc3RhdGUubW9kZSA9IFRZUEU7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSBESUNUSUQ6XG4gICAgICAgIC8vPT09IE5FRURCSVRTKDMyKTsgKi9cbiAgICAgICAgd2hpbGUgKGJpdHMgPCAzMikge1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgIH1cbiAgICAgICAgLy89PT0vL1xuICAgICAgICBzdHJtLmFkbGVyID0gc3RhdGUuY2hlY2sgPSB6c3dhcDMyKGhvbGQpO1xuICAgICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgICBob2xkID0gMDtcbiAgICAgICAgYml0cyA9IDA7XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgc3RhdGUubW9kZSA9IERJQ1Q7XG4gICAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICAgIGNhc2UgRElDVDpcbiAgICAgICAgaWYgKHN0YXRlLmhhdmVkaWN0ID09PSAwKSB7XG4gICAgICAgICAgLy8tLS0gUkVTVE9SRSgpIC0tLVxuICAgICAgICAgIHN0cm0ubmV4dF9vdXQgPSBwdXQ7XG4gICAgICAgICAgc3RybS5hdmFpbF9vdXQgPSBsZWZ0O1xuICAgICAgICAgIHN0cm0ubmV4dF9pbiA9IG5leHQ7XG4gICAgICAgICAgc3RybS5hdmFpbF9pbiA9IGhhdmU7XG4gICAgICAgICAgc3RhdGUuaG9sZCA9IGhvbGQ7XG4gICAgICAgICAgc3RhdGUuYml0cyA9IGJpdHM7XG4gICAgICAgICAgLy8tLS1cbiAgICAgICAgICByZXR1cm4gWl9ORUVEX0RJQ1Q7XG4gICAgICAgIH1cbiAgICAgICAgc3RybS5hZGxlciA9IHN0YXRlLmNoZWNrID0gMS8qYWRsZXIzMigwTCwgWl9OVUxMLCAwKSovO1xuICAgICAgICBzdGF0ZS5tb2RlID0gVFlQRTtcbiAgICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgICAgY2FzZSBUWVBFOlxuICAgICAgICBpZiAoZmx1c2ggPT09IFpfQkxPQ0sgfHwgZmx1c2ggPT09IFpfVFJFRVMpIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICAgIGNhc2UgVFlQRURPOlxuICAgICAgICBpZiAoc3RhdGUubGFzdCkge1xuICAgICAgICAgIC8vLS0tIEJZVEVCSVRTKCkgLS0tLy9cbiAgICAgICAgICBob2xkID4+Pj0gYml0cyAmIDc7XG4gICAgICAgICAgYml0cyAtPSBiaXRzICYgNztcbiAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgc3RhdGUubW9kZSA9IENIRUNLO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIC8vPT09IE5FRURCSVRTKDMpOyAqL1xuICAgICAgICB3aGlsZSAoYml0cyA8IDMpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgc3RhdGUubGFzdCA9IChob2xkICYgMHgwMSkvKkJJVFMoMSkqLztcbiAgICAgICAgLy8tLS0gRFJPUEJJVFMoMSkgLS0tLy9cbiAgICAgICAgaG9sZCA+Pj49IDE7XG4gICAgICAgIGJpdHMgLT0gMTtcbiAgICAgICAgLy8tLS0vL1xuXG4gICAgICAgIHN3aXRjaCAoKGhvbGQgJiAweDAzKS8qQklUUygyKSovKSB7XG4gICAgICAgICAgY2FzZSAwOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogc3RvcmVkIGJsb2NrICovXG4gICAgICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgICBzdG9yZWQgYmxvY2slc1xcblwiLFxuICAgICAgICAgICAgLy8gICAgICAgIHN0YXRlLmxhc3QgPyBcIiAobGFzdClcIiA6IFwiXCIpKTtcbiAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBTVE9SRUQ7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlIDE6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBmaXhlZCBibG9jayAqL1xuICAgICAgICAgICAgZml4ZWR0YWJsZXMoc3RhdGUpO1xuICAgICAgICAgICAgLy9UcmFjZXYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgICAgZml4ZWQgY29kZXMgYmxvY2slc1xcblwiLFxuICAgICAgICAgICAgLy8gICAgICAgIHN0YXRlLmxhc3QgPyBcIiAobGFzdClcIiA6IFwiXCIpKTtcbiAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBMRU5fOyAgICAgICAgICAgICAvKiBkZWNvZGUgY29kZXMgKi9cbiAgICAgICAgICAgIGlmIChmbHVzaCA9PT0gWl9UUkVFUykge1xuICAgICAgICAgICAgICAvLy0tLSBEUk9QQklUUygyKSAtLS0vL1xuICAgICAgICAgICAgICBob2xkID4+Pj0gMjtcbiAgICAgICAgICAgICAgYml0cyAtPSAyO1xuICAgICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgICAgIGJyZWFrIGluZl9sZWF2ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgMjogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGR5bmFtaWMgYmxvY2sgKi9cbiAgICAgICAgICAgIC8vVHJhY2V2KChzdGRlcnIsIFwiaW5mbGF0ZTogICAgIGR5bmFtaWMgY29kZXMgYmxvY2slc1xcblwiLFxuICAgICAgICAgICAgLy8gICAgICAgIHN0YXRlLmxhc3QgPyBcIiAobGFzdClcIiA6IFwiXCIpKTtcbiAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBUQUJMRTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgYmxvY2sgdHlwZSc7XG4gICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICB9XG4gICAgICAgIC8vLS0tIERST1BCSVRTKDIpIC0tLS8vXG4gICAgICAgIGhvbGQgPj4+PSAyO1xuICAgICAgICBiaXRzIC09IDI7XG4gICAgICAgIC8vLS0tLy9cbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIFNUT1JFRDpcbiAgICAgICAgLy8tLS0gQllURUJJVFMoKSAtLS0vLyAvKiBnbyB0byBieXRlIGJvdW5kYXJ5ICovXG4gICAgICAgIGhvbGQgPj4+PSBiaXRzICYgNztcbiAgICAgICAgYml0cyAtPSBiaXRzICYgNztcbiAgICAgICAgLy8tLS0vL1xuICAgICAgICAvLz09PSBORUVEQklUUygzMik7ICovXG4gICAgICAgIHdoaWxlIChiaXRzIDwgMzIpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgaWYgKChob2xkICYgMHhmZmZmKSAhPT0gKChob2xkID4+PiAxNikgXiAweGZmZmYpKSB7XG4gICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBzdG9yZWQgYmxvY2sgbGVuZ3Rocyc7XG4gICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBzdGF0ZS5sZW5ndGggPSBob2xkICYgMHhmZmZmO1xuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgICAgIHN0b3JlZCBsZW5ndGggJXVcXG5cIixcbiAgICAgICAgLy8gICAgICAgIHN0YXRlLmxlbmd0aCkpO1xuICAgICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgICBob2xkID0gMDtcbiAgICAgICAgYml0cyA9IDA7XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgc3RhdGUubW9kZSA9IENPUFlfO1xuICAgICAgICBpZiAoZmx1c2ggPT09IFpfVFJFRVMpIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICAgIGNhc2UgQ09QWV86XG4gICAgICAgIHN0YXRlLm1vZGUgPSBDT1BZO1xuICAgICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgICBjYXNlIENPUFk6XG4gICAgICAgIGNvcHkgPSBzdGF0ZS5sZW5ndGg7XG4gICAgICAgIGlmIChjb3B5KSB7XG4gICAgICAgICAgaWYgKGNvcHkgPiBoYXZlKSB7IGNvcHkgPSBoYXZlOyB9XG4gICAgICAgICAgaWYgKGNvcHkgPiBsZWZ0KSB7IGNvcHkgPSBsZWZ0OyB9XG4gICAgICAgICAgaWYgKGNvcHkgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgLy8tLS0gem1lbWNweShwdXQsIG5leHQsIGNvcHkpOyAtLS1cbiAgICAgICAgICB1dGlscy5hcnJheVNldChvdXRwdXQsIGlucHV0LCBuZXh0LCBjb3B5LCBwdXQpO1xuICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICBoYXZlIC09IGNvcHk7XG4gICAgICAgICAgbmV4dCArPSBjb3B5O1xuICAgICAgICAgIGxlZnQgLT0gY29weTtcbiAgICAgICAgICBwdXQgKz0gY29weTtcbiAgICAgICAgICBzdGF0ZS5sZW5ndGggLT0gY29weTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgICAgIHN0b3JlZCBlbmRcXG5cIikpO1xuICAgICAgICBzdGF0ZS5tb2RlID0gVFlQRTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIFRBQkxFOlxuICAgICAgICAvLz09PSBORUVEQklUUygxNCk7ICovXG4gICAgICAgIHdoaWxlIChiaXRzIDwgMTQpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgc3RhdGUubmxlbiA9IChob2xkICYgMHgxZikvKkJJVFMoNSkqLyArIDI1NztcbiAgICAgICAgLy8tLS0gRFJPUEJJVFMoNSkgLS0tLy9cbiAgICAgICAgaG9sZCA+Pj49IDU7XG4gICAgICAgIGJpdHMgLT0gNTtcbiAgICAgICAgLy8tLS0vL1xuICAgICAgICBzdGF0ZS5uZGlzdCA9IChob2xkICYgMHgxZikvKkJJVFMoNSkqLyArIDE7XG4gICAgICAgIC8vLS0tIERST1BCSVRTKDUpIC0tLS8vXG4gICAgICAgIGhvbGQgPj4+PSA1O1xuICAgICAgICBiaXRzIC09IDU7XG4gICAgICAgIC8vLS0tLy9cbiAgICAgICAgc3RhdGUubmNvZGUgPSAoaG9sZCAmIDB4MGYpLypCSVRTKDQpKi8gKyA0O1xuICAgICAgICAvLy0tLSBEUk9QQklUUyg0KSAtLS0vL1xuICAgICAgICBob2xkID4+Pj0gNDtcbiAgICAgICAgYml0cyAtPSA0O1xuICAgICAgICAvLy0tLS8vXG4vLyNpZm5kZWYgUEtaSVBfQlVHX1dPUktBUk9VTkRcbiAgICAgICAgaWYgKHN0YXRlLm5sZW4gPiAyODYgfHwgc3RhdGUubmRpc3QgPiAzMCkge1xuICAgICAgICAgIHN0cm0ubXNnID0gJ3RvbyBtYW55IGxlbmd0aCBvciBkaXN0YW5jZSBzeW1ib2xzJztcbiAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4vLyNlbmRpZlxuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgICAgIHRhYmxlIHNpemVzIG9rXFxuXCIpKTtcbiAgICAgICAgc3RhdGUuaGF2ZSA9IDA7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBMRU5MRU5TO1xuICAgICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgICBjYXNlIExFTkxFTlM6XG4gICAgICAgIHdoaWxlIChzdGF0ZS5oYXZlIDwgc3RhdGUubmNvZGUpIHtcbiAgICAgICAgICAvLz09PSBORUVEQklUUygzKTtcbiAgICAgICAgICB3aGlsZSAoYml0cyA8IDMpIHtcbiAgICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgICAgaGF2ZS0tO1xuICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgfVxuICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICBzdGF0ZS5sZW5zW29yZGVyW3N0YXRlLmhhdmUrK11dID0gKGhvbGQgJiAweDA3KTsvL0JJVFMoMyk7XG4gICAgICAgICAgLy8tLS0gRFJPUEJJVFMoMykgLS0tLy9cbiAgICAgICAgICBob2xkID4+Pj0gMztcbiAgICAgICAgICBiaXRzIC09IDM7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICB9XG4gICAgICAgIHdoaWxlIChzdGF0ZS5oYXZlIDwgMTkpIHtcbiAgICAgICAgIC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N0YXRlLm5sZW4gKyBzdGF0ZS5uZGlzdCkge1xuICAgICAgICAgIGZvciAoOzspIHtcbiAgICAgICAgICAgIGhlcmUgPSBzdGF0ZS5sZW5jb2RlW2hvbGQgJiAoKDEgPDwgc3RhdGUubGVuYml0cykgLSAxKV07LypCSVRTKHN0YXRlLmxlbmJpdHMpKi9cbiAgICAgICAgICAgIGhlcmVfYml0cyA9IGhlcmUgPj4+IDI0O1xuICAgICAgICAgICAgaGVyZV9vcCA9IChoZXJlID4+PiAxNikgJiAweGZmO1xuICAgICAgICAgICAgaGVyZV92YWwgPSBoZXJlICYgMHhmZmZmO1xuXG4gICAgICAgICAgICBpZiAoKGhlcmVfYml0cykgPD0gYml0cykgeyBicmVhazsgfVxuICAgICAgICAgICAgLy8tLS0gUFVMTEJZVEUoKSAtLS0vL1xuICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGhlcmVfdmFsIDwgMTYpIHtcbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIHN0YXRlLmxlbnNbc3RhdGUuaGF2ZSsrXSA9IGhlcmVfdmFsO1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGlmIChoZXJlX3ZhbCA9PT0gMTYpIHtcbiAgICAgICAgICAgICAgLy89PT0gTkVFREJJVFMoaGVyZS5iaXRzICsgMik7XG4gICAgICAgICAgICAgIG4gPSBoZXJlX2JpdHMgKyAyO1xuICAgICAgICAgICAgICB3aGlsZSAoYml0cyA8IG4pIHtcbiAgICAgICAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoaGVyZS5iaXRzKSAtLS0vL1xuICAgICAgICAgICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgICAgICBpZiAoc3RhdGUuaGF2ZSA9PT0gMCkge1xuICAgICAgICAgICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgYml0IGxlbmd0aCByZXBlYXQnO1xuICAgICAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgbGVuID0gc3RhdGUubGVuc1tzdGF0ZS5oYXZlIC0gMV07XG4gICAgICAgICAgICAgIGNvcHkgPSAzICsgKGhvbGQgJiAweDAzKTsvL0JJVFMoMik7XG4gICAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDIpIC0tLS8vXG4gICAgICAgICAgICAgIGhvbGQgPj4+PSAyO1xuICAgICAgICAgICAgICBiaXRzIC09IDI7XG4gICAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGhlcmVfdmFsID09PSAxNykge1xuICAgICAgICAgICAgICAvLz09PSBORUVEQklUUyhoZXJlLmJpdHMgKyAzKTtcbiAgICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDM7XG4gICAgICAgICAgICAgIHdoaWxlIChiaXRzIDwgbikge1xuICAgICAgICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgLy89PT0vL1xuICAgICAgICAgICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICAgIGJpdHMgLT0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgICAgIGxlbiA9IDA7XG4gICAgICAgICAgICAgIGNvcHkgPSAzICsgKGhvbGQgJiAweDA3KTsvL0JJVFMoMyk7XG4gICAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDMpIC0tLS8vXG4gICAgICAgICAgICAgIGhvbGQgPj4+PSAzO1xuICAgICAgICAgICAgICBiaXRzIC09IDM7XG4gICAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAvLz09PSBORUVEQklUUyhoZXJlLmJpdHMgKyA3KTtcbiAgICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDc7XG4gICAgICAgICAgICAgIHdoaWxlIChiaXRzIDwgbikge1xuICAgICAgICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgLy89PT0vL1xuICAgICAgICAgICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICAgIGJpdHMgLT0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgICAgIGxlbiA9IDA7XG4gICAgICAgICAgICAgIGNvcHkgPSAxMSArIChob2xkICYgMHg3Zik7Ly9CSVRTKDcpO1xuICAgICAgICAgICAgICAvLy0tLSBEUk9QQklUUyg3KSAtLS0vL1xuICAgICAgICAgICAgICBob2xkID4+Pj0gNztcbiAgICAgICAgICAgICAgYml0cyAtPSA3O1xuICAgICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoc3RhdGUuaGF2ZSArIGNvcHkgPiBzdGF0ZS5ubGVuICsgc3RhdGUubmRpc3QpIHtcbiAgICAgICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBiaXQgbGVuZ3RoIHJlcGVhdCc7XG4gICAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgd2hpbGUgKGNvcHktLSkge1xuICAgICAgICAgICAgICBzdGF0ZS5sZW5zW3N0YXRlLmhhdmUrK10gPSBsZW47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLyogaGFuZGxlIGVycm9yIGJyZWFrcyBpbiB3aGlsZSAqL1xuICAgICAgICBpZiAoc3RhdGUubW9kZSA9PT0gQkFEKSB7IGJyZWFrOyB9XG5cbiAgICAgICAgLyogY2hlY2sgZm9yIGVuZC1vZi1ibG9jayBjb2RlIChiZXR0ZXIgaGF2ZSB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IChmbHVzaCA9PT0gWl9UUkVFUykgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgICAgY2FzZSBMRU5fOlxuICAgICAgICBzdGF0ZS5tb2RlID0gTEVOO1xuICAgICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgICBjYXNlIExFTjpcbiAgICAgICAgaWYgKGhhdmUgPj0gNiAmJiBsZWZ0ID49IDI1OCkge1xuICAgICAgICAgIC8vLS0tIFJFU1RPUkUoKSAtLS1cbiAgICAgICAgICBzdHJtLm5leHRfb3V0ID0gcHV0O1xuICAgICAgICAgIHN0cm0uYXZhaWxfb3V0ID0gbGVmdDtcbiAgICAgICAgICBzdHJtLm5leHRfaW4gPSBuZXh0O1xuICAgICAgICAgIHN0cm0uYXZhaWxfaW4gPSBoYXZlO1xuICAgICAgICAgIHN0YXRlLmhvbGQgPSBob2xkO1xuICAgICAgICAgIHN0YXRlLmJpdHMgPSBiaXRzO1xuICAgICAgICAgIC8vLS0tXG4gICAgICAgICAgaW5mbGF0ZV9mYXN0KHN0cm0sIF9vdXQpO1xuICAgICAgICAgIC8vLS0tIExPQUQoKSAtLS1cbiAgICAgICAgICBwdXQgPSBzdHJtLm5leHRfb3V0O1xuICAgICAgICAgIG91dHB1dCA9IHN0cm0ub3V0cHV0O1xuICAgICAgICAgIGxlZnQgPSBzdHJtLmF2YWlsX291dDtcbiAgICAgICAgICBuZXh0ID0gc3RybS5uZXh0X2luO1xuICAgICAgICAgIGlucHV0ID0gc3RybS5pbnB1dDtcbiAgICAgICAgICBoYXZlID0gc3RybS5hdmFpbF9pbjtcbiAgICAgICAgICBob2xkID0gc3RhdGUuaG9sZDtcbiAgICAgICAgICBiaXRzID0gc3RhdGUuYml0cztcbiAgICAgICAgICAvLy0tLVxuXG4gICAgICAgICAgaWYgKHN0YXRlLm1vZGUgPT09IFRZUEUpIHtcbiAgICAgICAgICAgIHN0YXRlLmJhY2sgPSAtMTtcbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgc3RhdGUuYmFjayA9IDA7XG4gICAgICAgIGZvciAoOzspIHtcbiAgICAgICAgICBoZXJlID0gc3RhdGUubGVuY29kZVtob2xkICYgKCgxIDw8IHN0YXRlLmxlbmJpdHMpIC0gMSldOyAgLypCSVRTKHN0YXRlLmxlbmJpdHMpKi9cbiAgICAgICAgICBoZXJlX2JpdHMgPSBoZXJlID4+PiAyNDtcbiAgICAgICAgICBoZXJlX29wID0gKGhlcmUgPj4+IDE2KSAmIDB4ZmY7XG4gICAgICAgICAgaGVyZV92YWwgPSBoZXJlICYgMHhmZmZmO1xuXG4gICAgICAgICAgaWYgKGhlcmVfYml0cyA8PSBiaXRzKSB7IGJyZWFrOyB9XG4gICAgICAgICAgLy8tLS0gUFVMTEJZVEUoKSAtLS0vL1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICB9XG4gICAgICAgIGlmIChoZXJlX29wICYmIChoZXJlX29wICYgMHhmMCkgPT09IDApIHtcbiAgICAgICAgICBsYXN0X2JpdHMgPSBoZXJlX2JpdHM7XG4gICAgICAgICAgbGFzdF9vcCA9IGhlcmVfb3A7XG4gICAgICAgICAgbGFzdF92YWwgPSBoZXJlX3ZhbDtcbiAgICAgICAgICBmb3IgKDs7KSB7XG4gICAgICAgICAgICBoZXJlID0gc3RhdGUubGVuY29kZVtsYXN0X3ZhbCArXG4gICAgICAgICAgICAgICAgICAgICgoaG9sZCAmICgoMSA8PCAobGFzdF9iaXRzICsgbGFzdF9vcCkpIC0gMSkpLypCSVRTKGxhc3QuYml0cyArIGxhc3Qub3ApKi8gPj4gbGFzdF9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LnZhbCA8IDB4N2YgP1xuICAgICAgICAgIC8vICAgICAgICBcImluZmxhdGU6ICAgICAgICAgbGl0ZXJhbCAnJWMnXFxuXCIgOlxuICAgICAgICAgIC8vICAgICAgICBcImluZmxhdGU6ICAgICAgICAgbGl0ZXJhbCAweCUwMnhcXG5cIiwgaGVyZS52YWwpKTtcbiAgICAgICAgICBzdGF0ZS5tb2RlID0gTElUO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIGlmIChoZXJlX29wICYgMzIpIHtcbiAgICAgICAgICAvL1RyYWNldnYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgICAgICAgIGVuZCBvZiBibG9ja1xcblwiKSk7XG4gICAgICAgICAgc3RhdGUuYmFjayA9IC0xO1xuICAgICAgICAgIHN0YXRlLm1vZGUgPSBUWVBFO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIGlmIChoZXJlX29wICYgNjQpIHtcbiAgICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGxpdGVyYWwvbGVuZ3RoIGNvZGUnO1xuICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgc3RhdGUuZXh0cmEgPSBoZXJlX29wICYgMTU7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBMRU5FWFQ7XG4gICAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICAgIGNhc2UgTEVORVhUOlxuICAgICAgICBpZiAoc3RhdGUuZXh0cmEpIHtcbiAgICAgICAgICAvLz09PSBORUVEQklUUyhzdGF0ZS5leHRyYSk7XG4gICAgICAgICAgbiA9IHN0YXRlLmV4dHJhO1xuICAgICAgICAgIHdoaWxlIChiaXRzIDwgbikge1xuICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICB9XG4gICAgICAgICAgLy89PT0vL1xuICAgICAgICAgIHN0YXRlLmxlbmd0aCArPSBob2xkICYgKCgxIDw8IHN0YXRlLmV4dHJhKSAtIDEpLypCSVRTKHN0YXRlLmV4dHJhKSovO1xuICAgICAgICAgIC8vLS0tIERST1BCSVRTKHN0YXRlLmV4dHJhKSAtLS0vL1xuICAgICAgICAgIGhvbGQgPj4+PSBzdGF0ZS5leHRyYTtcbiAgICAgICAgICBiaXRzIC09IHN0YXRlLmV4dHJhO1xuICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICBzdGF0ZS5iYWNrICs9IHN0YXRlLmV4dHJhO1xuICAgICAgICB9XG4gICAgICAgIC8vVHJhY2V2digoc3RkZXJyLCBcImluZmxhdGU6ICAgICAgICAgbGVuZ3RoICV1XFxuXCIsIHN0YXRlLmxlbmd0aCkpO1xuICAgICAgICBzdGF0ZS53YXMgPSBzdGF0ZS5sZW5ndGg7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBESVNUO1xuICAgICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgICBjYXNlIERJU1Q6XG4gICAgICAgIGZvciAoOzspIHtcbiAgICAgICAgICBoZXJlID0gc3RhdGUuZGlzdGNvZGVbaG9sZCAmICgoMSA8PCBzdGF0ZS5kaXN0Yml0cykgLSAxKV07LypCSVRTKHN0YXRlLmRpc3RiaXRzKSovXG4gICAgICAgICAgaGVyZV9iaXRzID0gaGVyZSA+Pj4gMjQ7XG4gICAgICAgICAgaGVyZV9vcCA9IChoZXJlID4+PiAxNikgJiAweGZmO1xuICAgICAgICAgIGhlcmVfdmFsID0gaGVyZSAmIDB4ZmZmZjtcblxuICAgICAgICAgIGlmICgoaGVyZV9iaXRzKSA8PSBiaXRzKSB7IGJyZWFrOyB9XG4gICAgICAgICAgLy8tLS0gUFVMTEJZVEUoKSAtLS0vL1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICB9XG4gICAgICAgIGlmICgoaGVyZV9vcCAmIDB4ZjApID09PSAwKSB7XG4gICAgICAgICAgbGFzdF9iaXRzID0gaGVyZV9iaXRzO1xuICAgICAgICAgIGxhc3Rfb3AgPSBoZXJlX29wO1xuICAgICAgICAgIGxhc3RfdmFsID0gaGVyZV92YWw7XG4gICAgICAgICAgZm9yICg7Oykge1xuICAgICAgICAgICAgaGVyZSA9IHN0YXRlLmRpc3Rjb2RlW2xhc3RfdmFsICtcbiAgICAgICAgICAgICAgICAgICAgKChob2xkICYgKCgxIDw8IChsYXN0X2JpdHMgKyBsYXN0X29wKSkgLSAxKSkvKkJJVFMobGFzdC5iaXRzICsgbGFzdC5vcCkqLyA+PiBsYXN0X2JpdHMpXTtcbiAgICAgICAgICAgIGhlcmVfYml0cyA9IGhlcmUgPj4+IDI0O1xuICAgICAgICAgICAgaGVyZV9vcCA9IChoZXJlID4+PiAxNikgJiAweGZmO1xuICAgICAgICAgICAgaGVyZV92YWwgPSBoZXJlICYgMHhmZmZmO1xuXG4gICAgICAgICAgICBpZiAoKGxhc3RfYml0cyArIGhlcmVfYml0cykgPD0gYml0cykgeyBicmVhazsgfVxuICAgICAgICAgICAgLy8tLS0gUFVMTEJZVEUoKSAtLS0vL1xuICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgLy8tLS0gRFJPUEJJVFMobGFzdC5iaXRzKSAtLS0vL1xuICAgICAgICAgIGhvbGQgPj4+PSBsYXN0X2JpdHM7XG4gICAgICAgICAgYml0cyAtPSBsYXN0X2JpdHM7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIHN0YXRlLmJhY2sgKz0gbGFzdF9iaXRzO1xuICAgICAgICB9XG4gICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgaG9sZCA+Pj49IGhlcmVfYml0cztcbiAgICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAgIC8vLS0tLy9cbiAgICAgICAgc3RhdGUuYmFjayArPSBoZXJlX2JpdHM7XG4gICAgICAgIGlmIChoZXJlX29wICYgNjQpIHtcbiAgICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGRpc3RhbmNlIGNvZGUnO1xuICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgc3RhdGUub2Zmc2V0ID0gaGVyZV92YWw7XG4gICAgICAgIHN0YXRlLmV4dHJhID0gKGhlcmVfb3ApICYgMTU7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBESVNURVhUO1xuICAgICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgICBjYXNlIERJU1RFWFQ6XG4gICAgICAgIGlmIChzdGF0ZS5leHRyYSkge1xuICAgICAgICAgIC8vPT09IE5FRURCSVRTKHN0YXRlLmV4dHJhKTtcbiAgICAgICAgICBuID0gc3RhdGUuZXh0cmE7XG4gICAgICAgICAgd2hpbGUgKGJpdHMgPCBuKSB7XG4gICAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbm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weSA+IHN0YXRlLnduZXh0KSB7XG4gICAgICAgICAgICBjb3B5IC09IHN0YXRlLnduZXh0O1xuICAgICAgICAgICAgZnJvbSA9IHN0YXRlLndzaXplIC0gY29weTtcbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBmcm9tID0gc3RhdGUud25leHQgLSBjb3B5O1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoY29weSA+IHN0YXRlLmxlbmd0aCkgeyBjb3B5ID0gc3RhdGUubGVuZ3RoOyB9XG4gICAgICAgICAgZnJvbV9zb3VyY2UgPSBzdGF0ZS53aW5kb3c7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogY29weSBmcm9tIG91dHB1dCAqL1xuICAgICAgICAgIGZyb21fc291cmNlID0gb3V0cHV0O1xuICAgICAgICAgIGZyb20gPSBwdXQgLSBzdGF0ZS5vZmZzZXQ7XG4gICAgICAgICAgY29weSA9IHN0YXRlLmxlbmd0aDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoY29weSA+IGxlZnQpIHsgY29weSA9IGxlZnQ7IH1cbiAgICAgICAgbGVmdCAtPSBjb3B5O1xuICAgICAgICBzdGF0ZS5sZW5ndGggLT0gY29weTtcbiAgICAgICAgZG8ge1xuICAgICAgICAgIG91dHB1dFtwdXQrK10gPSBmcm9tX3NvdXJjZVtmcm9tKytdO1xuICAgICAgICB9IHdoaWxlICgtLWNvcHkpO1xuICAgICAgICBpZiAoc3RhdGUubGVuZ3RoID09PSAwKSB7IHN0YXRlLm1vZGUgPSBMRU47IH1cbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIExJVDpcbiAgICAgICAgaWYgKGxlZnQgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgIG91dHB1dFtwdXQrK10gPSBzdGF0ZS5sZW5ndGg7XG4gICAgICAgIGxlZnQtLTtcbiAgICAgICAgc3RhdGUubW9kZSA9IExFTjtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIENIRUNLOlxuICAgICAgICBpZiAoc3RhdGUud3JhcCkge1xuICAgICAgICAgIC8vPT09IE5FRURCSVRTKDMyKTtcbiAgICAgICAgICB3aGlsZSAoYml0cyA8IDMyKSB7XG4gICAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgIC8vIFVzZSAnfCcgaW5zdGVhZCBvZiAnKycgdG8gbWFrZSBzdXJlIHRoYXQgcmVzdWx0IGlzIHNpZ25lZFxuICAgICAgICAgICAgaG9sZCB8PSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgfVxuICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICBfb3V0IC09IGxlZnQ7XG4gICAgICAgICAgc3RybS50b3RhbF9vdXQgKz0gX291dDtcbiAgICAgICAgICBzdGF0ZS50b3RhbCArPSBfb3V0O1xuICAgICAgICAgIGlmIChfb3V0KSB7XG4gICAgICAgICAgICBzdHJtLmFkbGVyID0gc3RhdGUuY2hlY2sgPVxuICAgICAgICAgICAgICAgIC8qVVBEQVRFKHN0YXRlLmNoZWNrLCBwdXQgLSBfb3V0LCBfb3V0KTsqL1xuICAgICAgICAgICAgICAgIChzdGF0ZS5mbGFncyA/IGNyYzMyKHN0YXRlLmNoZWNrLCBvdXRwdXQsIF9vdXQsIHB1dCAtIF9vdXQpIDogYWRsZXIzMihzdGF0ZS5jaGVjaywgb3V0cHV0LCBfb3V0LCBwdXQgLSBfb3V0KSk7XG5cbiAgICAgICAgICB9XG4gICAgICAgICAgX291dCA9IGxlZnQ7XG4gICAgICAgICAgLy8gTkI6IGNyYzMyIHN0b3JlZCBhcyBzaWduZWQgMzItYml0IGludCwgenN3YXAzMiByZXR1cm5zIHNpZ25lZCB0b29cbiAgICAgICAgICBpZiAoKHN0YXRlLmZsYWdzID8gaG9sZCA6IHpzd2FwMzIoaG9sZCkpICE9PSBzdGF0ZS5jaGVjaykge1xuICAgICAgICAgICAgc3RybS5tc2cgPSAnaW5jb3JyZWN0IGRhdGEgY2hlY2snO1xuICAgICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgICAgIGhvbGQgPSAwO1xuICAgICAgICAgIGJpdHMgPSAwO1xuICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgY2hlY2sgbWF0Y2hlcyB0cmFpbGVyXFxuXCIpKTtcbiAgICAgICAgfVxuICAgICAgICBzdGF0ZS5tb2RlID0gTEVOR1RIO1xuICAgICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgICBjYXNlIExFTkdUSDpcbiAgICAgICAgaWYgKHN0YXRlLndyYXAgJiYgc3RhdGUuZmxhZ3MpIHtcbiAgICAgICAgICAvLz09PSBORUVEQklUUygzMik7XG4gICAgICAgICAgd2hpbGUgKGJpdHMgPCAzMikge1xuICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICB9XG4gICAgICAgICAgLy89PT0vL1xuICAgICAgICAgIGlmIChob2xkICE9PSAoc3RhdGUudG90YWwgJiAweGZmZmZmZmZmKSkge1xuICAgICAgICAgICAgc3RybS5tc2cgPSAnaW5jb3JyZWN0IGxlbmd0aCBjaGVjayc7XG4gICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgYnJlYWs7XG4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XG4gICAgICAgICAgICAgICAgX2RlZmVyUmVhZGluZXNzKGRiSW5mbyk7XG4gICAgICAgICAgICAgICAgZGJJbmZvLmRiLmNsb3NlKCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiByZXNvbHZlKGRiSW5mby5kYik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgZGJBcmdzID0gW2RiSW5mby5uYW1lXTtcblxuICAgICAgICBpZiAodXBncmFkZU5lZWRlZCkge1xuICAgICAgICAgICAgZGJBcmdzLnB1c2goZGJJbmZvLnZlcnNpb24pO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIG9wZW5yZXEgPSBpZGIub3Blbi5hcHBseShpZGIsIGRiQXJncyk7XG5cbiAgICAgICAgaWYgKHVwZ3JhZGVOZWVkZWQpIHtcbiAgICAgICAgICAgIG9wZW5yZXEub251cGdyYWRlbmVlZGVkID0gZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICB2YXIgZGIgPSBvcGVucmVxLnJlc3VsdDtcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBkYi5jcmVhdGVPYmplY3RTdG9yZShkYkluZm8uc3RvcmVOYW1lKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGUub2xkVmVyc2lvbiA8PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBBZGRlZCB3aGVuIHN1cHBvcnQgZm9yIGJsb2Igc2hpbXMgd2FzIGFkZGVkXG4gICAgICAgICAgICAgICAgICAgICAgICBkYi5jcmVhdGVPYmplY3RTdG9yZShERVRFQ1RfQkxPQl9TVVBQT1JUX1NUT1JFKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGV4KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChleC5uYW1lID09PSAnQ29uc3RyYWludEVycm9yJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS53YXJuKCdUaGUgZGF0YWJhc2UgXCInICsgZGJJbmZvLm5hbWUgKyAnXCInICsgJyBoYXMgYmVlbiB1cGdyYWRlZCBmcm9tIHZlcnNpb24gJyArIGUub2xkVmVyc2lvbiArICcgdG8gdmVyc2lvbiAnICsgZS5uZXdWZXJzaW9uICsgJywgYnV0IHRoZSBzdG9yYWdlIFwiJyArIGRiSW5mby5zdG9yZU5hbWUgKyAnXCIgYWxyZWFkeSBleGlzdHMuJyk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBleDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cblxuICAgICAgICBvcGVucmVxLm9uZXJyb3IgPSBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgcmVqZWN0KG9wZW5yZXEuZXJyb3IpO1xuICAgICAgICB9O1xuXG4gICAgICAgIG9wZW5yZXEub25zdWNjZXNzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIGRiID0gb3BlbnJlcS5yZXN1bHQ7XG4gICAgICAgICAgICBkYi5vbnZlcnNpb25jaGFuZ2UgPSBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgICAgIC8vIFRyaWdnZXJlZCB3aGVuIHRoZSBkYXRhYmFzZSBpcyBtb2RpZmllZCAoZS5nLiBhZGRpbmcgYW4gb2JqZWN0U3RvcmUpIG9yXG4gICAgICAgICAgICAgICAgLy8gZGVsZXRlZCAoZXZlbiB3aGVuIGluaXRpYXRlZCBieSBvdGhlciBzZXNzaW9ucyBpbiBkaWZmZXJlbnQgdGFicykuXG4gICAgICAgICAgICAgICAgLy8gQ2xvc2luZyB0aGUgY29ubmVjdGlvbiBoZXJlIHByZXZlbnRzIHRob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ybiBQcm9taXNlJDEucmVzb2x2ZSgpLnRoZW4oZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmICghZGJJbmZvLmRiIHx8IGVyci5uYW1lID09PSAnTm90Rm91bmRFcnJvcicgJiYgIWRiSW5mby5kYi5vYmplY3RTdG9yZU5hbWVzLmNvbnRhaW5zKGRiSW5mby5zdG9yZU5hbWUpICYmIGRiSW5mby52ZXJzaW9uIDw9IGRiSW5mby5kYi52ZXJzaW9uKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGluY3JlYXNlIHRoZSBkYiB2ZXJzaW9uLCB0byBjcmVhdGUgdGhlIG5ldyBPYmplY3RTdG9yZVxuICAgICAgICAgICAgICAgICAgICBpZiAoZGJJbmZvLmRiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkYkluZm8udmVyc2lvbiA9IGRiSW5mby5kYi52ZXJzaW9uICsgMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBSZW9wZW4gdGhlIGRhdGFiYXNlIGZvciB1cGdyYWRpbmcuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBfZ2V0VXBncmFkZWRDb25uZWN0aW9uKGRiSW5mbyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSkudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIF90cnlSZWNvbm5lY3QoZGJJbmZvKS50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgY3JlYXRlVHJhbnNhY3Rpb24oZGJJbmZvLCBtb2RlLCBjYWxsYmFjaywgcmV0cmllcyAtIDEpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSlbXCJjYXRjaFwiXShjYWxsYmFjayk7XG4gICAgICAgIH1cblxuICAgICAgICBjYWxsYmFjayhlcnIpO1xuICAgIH1cbn1cblxuZnVuY3Rpb24gY3JlYXRlRGJDb250Z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WN0KGVycik7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHN0b3JlID0gdHJhbnNhY3Rpb24ub2JqZWN0U3RvcmUoc2VsZi5fZGJJbmZvLnN0b3JlTmFtZSk7XG4gICAgICAgICAgICAgICAgICAgIHZhciByZXEgPSBzdG9yZS5nZXQoa2V5KTtcblxuICAgICAgICAgICAgICAgICAgICByZXEub25zdWNjZXNzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZhbHVlID0gcmVxLnJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF9pc0VuY29kZWRCbG9iKHZhbHVlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gX2RlY29kZUJsb2IodmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICAgICAgcmVxLm9uZXJyb3IgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZWplY3QocmVxLmVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdChlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSlbXCJjYXRjaFwiXShyZWplY3QpO1xuICAgIH0pO1xuXG4gICAgZXhlY3V0ZUNhbGxiYWNrKHByb21pc2UsIGNhbGxiYWNrKTtcbiAgICByZXR1cm4gcHJvbWlzZTtcbn1cblxuLy8gSXRlcmF0ZSBvdmVyIGFsbCBpdGVtcyBzdG9yZWQgaW4gZGF0YWJhc2UuXG5mdW5jdGlvbiBpdGVyYXRlKGl0ZXJhdG9yLCBjYWxsYmFjaykge1xuICAgIHZhciBzZWxmID0gdGhpcztcblxuICAgIHZhciBwcm9taXNlID0gbmV3IFByb21pc2UkMShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgIHNlbGYucmVhZHkoKS50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGNyZWF0ZVRyYW5zYWN0aW9uKHNlbGYuX2RiSW5mbywgUkVBRF9PTkxZLCBmdW5jdGlvbiAoZXJyLCB0cmFuc2FjdGlvbikge1xuICAgICAgICAgICAgICAgIGlmIChlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlamVjdChlcnIpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBzdG9yZSA9IHRyYW5zYWN0aW9uLm9iamVjdFN0b3JlKHNlbGYuX2RiSW5mby5zdG9yZU5hbWUpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgcmVxID0gc3RvcmUub3BlbkN1cnNvcigpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgaXRlcmF0aW9uTnVtYmVyID0gMTtcblxuICAgICAgICAgICAgICAgICAgICByZXEub25zdWNjZXNzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnNvciA9IHJlcS5yZXN1bHQ7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJzb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmFsdWUgPSBjdXJzb3IudmFsdWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF9pc0VuY29kZWRCbG9iKHZhbHVlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IF9kZWNvZGVCbG9iKHZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlc3VsdCA9IGl0ZXJhdG9yKHZhbHVlLCBjdXJzb3Iua2V5LCBpdGVyYXRpb25OdW1iZXIrKyk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3aGVuIHRoZSBpdGVyYXRvciBjYWxsYmFjayByZXR1cm5zIGFueVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIChub24tYHVuZGVmaW5lZGApIHZhbHVlLCB0aGVuIHdlIHN0b3BcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgaXRlcmF0aW9uIGltbWVkaWF0ZWx5XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCAhPT0gdm9pZCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUocmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JbXCJjb250aW51ZVwiXSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgICAgIHJlcS5vbmVycm9yID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KHJlcS5lcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pW1wiY2F0Y2hcIl0ocmVqZWN0KTtcbiAgICB9KTtcblxuICAgIGV4ZWN1dGVDYWxsYmFjayhwcm9taXNlLCBjYWxsYmFjayk7XG5cbiAgICByZXR1cm4gcHJvbWlzZTtcbn1cblxuZnVuY3Rpb24gc2V0SXRlbShrZXksIHZhbHVlLCBjYWxsYmFjaykge1xuICAgIHZhciBzZWxmID0gdGhpcztcblxuICAgIGtleSA9IG5vcm1hbGl6ZUtleShrZXkpO1xuXG4gICAgdmFyIHByb21pc2UgPSBuZXcgUHJvbWlzZSQxKGZ1bmN0aW9uIChyZXNvbHZlLCByZWplY3QpIHtcbiAgICAgICAgdmFyIGRiSW5mbztcbiAgICAgICAgc2VsZi5yZWFkeSgpLnRoZW4oZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgZGJJbmZvID0gc2VsZi5fZGJJbmZvO1xuICAgICAgICAgICAgaWYgKHRvU3RyaW5nLmNhbGwodmFsdWUpID09PSAnW29iamVjdCBCbG9iXScpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gX2NoZWNrQmxvYlN1cHBvcnQoZGJJbmZvLmRiKS50aGVuKGZ1bmN0aW9uIChibG9iU3VwcG9ydCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoYmxvYlN1cHBvcnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gX2VuY29kZUJsb2IodmFsdWUpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICB9KS50aGVuKGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgY3JlYXRlVHJhbnNhY3Rpb24oc2VsZi5fZGJJbmZvLCBSRUFEX1dSSVRFLCBmdW5jdGlvbiAoZXJyLCB0cmFuc2FjdGlvbikge1xuICAgICAgICAgICAgICAgIGlmIChlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlamVjdChlcnIpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBzdG9yZSA9IHRyYW5zYWN0aW9uLm9iamVjdFN0b3JlKHNlbGYuX2RiSW5mby5zdG9yZU5hbWUpO1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIFRoZSByZWFzb24gd2UgZG9uJ3QgX3NhdmVfIG51bGwgaXMgYmVjYXVzZSBJRSAxMCBkb2VzXG4gICAgICAgICAgICAgICAgICAgIC8vIG5vdCBzdXBwb3J0IHNhdmluZyB0aGUgYG51bGxgIHR5cGUgaW4gSW5kZXhlZERCLiBIb3dcbiAgICAgICAgICAgICAgICAgICAgLy8gaXJvbmljLCBnaXZlbiB0aGUgYnVnIGJlbG93IVxuICAgICAgICAgICAgICAgICAgICAvLyBTZWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9tb3ppbGxhL2xvY2FsRm9yYWdlL2lzc3Vlcy8xNjFcbiAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIHZhciByZXEgPSBzdG9yZS5wdXQodmFsdWUsIGtleSk7XG5cbiAgICAgICAgICAgICAgICAgICAgdHJhbnNhY3Rpb24ub25jb21wbGV0ZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIENhc3QgdG8gdW5kZWZpbmVkIHNvIHRoZSB2YWx1ZSBwYXNzZWQgdG9cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNhbGxiYWNrL3Byb21pc2UgaXMgdGhlIHNhbWUgYXMgd2hhdCBvbmUgd291bGQgZ2V0IG91dFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gb2YgYGdldEl0ZW0oKWAgbGF0ZXIuIFRoaXMgbGVhZHMgdG8gc29tZSB3ZWlyZG5lc3NcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIChzZXRJdGVtKCdmb28nLCB1bmRlZmluZWQpIHdpbGwgcmV0dXJuIGBudWxsYCksIGJ1dFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gaXQncyBub3QgbXkgZmF1bHQgbG9jYWxTdG9yYWdlIGlzIG91ciBiYXNlbGluZSBhbmQgdGhhdFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gaXQncyB3ZWlyZC5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgdHJhbnNhY3Rpb24ub25hYm9ydCA9IHRyYW5zYWN0aW9uLm9uZXJyb3IgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZXJyID0gcmVxLmVycm9yID8gcmVxLmVycm9yIDogcmVxLnRyYW5zYWN0aW9uLmVycm9yO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KGVycik7XG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICA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AgICAgLy8gdXNpbmcgYFsnZGVsZXRlJ10oKWAsIGJ1dCB3ZSBoYXZlIGEgYnVpbGQgc3RlcCB0aGF0XG4gICAgICAgICAgICAgICAgICAgIC8vIGZpeGVzIHRoaXMgZm9yIHVzIG5vdy5cbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlcSA9IHN0b3JlW1wiZGVsZXRlXCJdKGtleSk7XG4gICAgICAgICAgICAgICAgICAgIHRyYW5zYWN0aW9uLm9uY29tcGxldGUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKCk7XG4gICAgICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICAgICAgdHJhbnNhY3Rpb24ub25lcnJvciA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChyZXEuZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIFRoZSByZXF1ZXN0IHdpbGwgYmUgYWxzbyBiZSBhYm9ydGVkIGlmIHdlJ3ZlIGV4Y2VlZGVkIG91ciBzdG9yYWdlXG4gICAgICAgICAgICAgICAgICAgIC8vIHNwYWNlLlxuICAgICAgICAgICAgICAgICAgICB0cmFuc2FjdGlvbi5vbmFib3J0ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVyciA9IHJlcS5lcnJvciA/IHJlcS5lcnJvciA6IHJlcS50cmFuc2FjdGlvbi5lcnJvcjtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChlcnIpO1xuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVqZWN0KGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KVtcImNhdGNoXCJdKHJlamVjdCk7XG4gICAgfSk7XG5cbiAgICBleGVjdXRlQ2FsbGJhY2socHJvbWlzZSwgY2FsbGJhY2spO1xuICAgIHJldHVybiBwcm9taXNlO1xufVxuXG5mdW5jdGlvbiBjbGVhcihjYWxsYmFjaykge1xuICAgIHZhciBzZWxmID0gdGhpcztcblxuICAgIHZhciBwcm9taXNlID0gbmV3IFByb21pc2UkMShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgIHNlbGYucmVhZHkoKS50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGNyZWF0ZVRyYW5zYWN0aW9uKHNlbGYuX2RiSW5mbywgUkVBRF9XUklURSwgZnVuY3Rpb24gKGVyciwgdHJhbnNhY3Rpb24pIHtcbiAgICAgICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZWplY3QoZXJyKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgc3RvcmUgPSB0cmFuc2FjdGlvbi5vYmplY3RTdG9yZShzZWxmLl9kYkluZm8uc3RvcmVOYW1lKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlcSA9IHN0b3JlLmNsZWFyKCk7XG5cbiAgICAgICAgICAgICAgICAgICAgdHJhbnNhY3Rpb24ub25jb21wbGV0ZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgICAgICB0cmFuc2FjdGlvbi5vbmFib3J0ID0gdHJhbnNhY3Rpb24ub25lcnJvciA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlcnIgPSByZXEuZXJyb3IgPyByZXEuZXJyb3IgOiByZXEudHJhbnNhY3Rpb24uZXJyb3I7XG4gICAgICAgICAgICAgICAgICAgICAgICByZWplY3QoZXJyKTtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdChlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSlbXCJjYXRjaFwiXShyZWplY3QpO1xuICAgIH0pO1xuXG4gICAgZXhlY3V0ZUNhbGxiYWNrKHByb21pc2UsIGNhbGxiYWNrKTtcbiAgICByZXR1cm4gcHJvbWlzZTtcbn1cblxuZnVuY3Rpb24gbGVuZ3RoKGNhbGxiYWNrKSB7XG4gICAgdmFyIHNlbGYgPSB0aGlzO1xuXG4gICAgdmFyIHByb21pc2UgPSBuZXcgUHJvbWlzZSQxKGZ1bmN0aW9uIChyZXNvbHZlLCByZWplY3QpIHtcbiAgICAgICAgc2VsZi5yZWFkeSgpLnRoZW4oZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgY3JlYXRlVHJhbnNhY3Rpb24oc2VsZi5fZGJJbmZvLCBSRUFEX09OTFksIGZ1bmN0aW9uIChlcnIsIHRyYW5zYWN0aW9uKSB7XG4gICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0KGVycik7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHN0b3JlID0gdHJhbnNhY3Rpb24ub2JqZWN0U3RvcmUoc2VsZi5fZGJJbmZvLnN0b3JlTmFtZSk7XG4gICAgICAgICAgICAgICAgICAgIHZhciByZXEgPSBzdG9yZS5jb3VudCgpO1xuXG4gICAgICAgICAgICAgICAgICAgIHJlcS5vbnN1Y2Nlc3MgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHJlcS5yZXN1bHQpO1xuICAgICAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgICAgIHJlcS5vbmVycm9yID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KHJlcS5lcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pW1wiY2F0Y2hcIl0ocmVqZWN0KTtcbiAgICB9KTtcblxuICAgIGV4ZWN1dGVDYWxsYmFjayhwcm9taXNlLCBjYWxsYmFjayk7XG4gICAgcmV0dXJuIHByb21pc2U7XG59XG5cbmZ1bmN0aW9uIGtleShuLCBjYWxsYmFjaykge1xuICAgIHZhciBzZWxmID0gdGhpcztcblxuICAgIHZhciBwcm9taXNlID0gbmV3IFByb21pc2UkMShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgIGlmIChuIDwgMCkge1xuICAgICAgICAgICAgcmVzb2x2ZShudWxsKTtcblxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgc2VsZi5yZWFkeSgpLnRoZW4oZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgY3JlYXRlVHJhbnNhY3Rpb24oc2VsZi5fZGJJbmZvLCBSRUFEX09OTFksIGZ1bmN0aW9uIChlcnIsIHRyYW5zYWN0aW9uKSB7XG4gICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0KGVycik7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHN0b3JlID0gdHJhbnNhY3Rpb24ub2JqZWN0U3RvcmUoc2VsZi5fZGJJbmZvLnN0b3JlTmFtZSk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBhZHZhbmNlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB2YXIgcmVxID0gc3RvcmUub3BlbktleUN1cnNvcigpO1xuXG4gICAgICAgICAgICAgICAgICAgIHJlcS5vbnN1Y2Nlc3MgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgY3Vyc29yID0gcmVxLnJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY3Vyc29yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhpcyBtZWFucyB0aGVyZSB3ZXJlbid0IGVub3VnaCBrZXlzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShudWxsKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG4gPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBoYXZlIHRoZSBmaXJzdCBrZXksIHJldHVybiBpdCBpZiB0aGF0J3Mgd2hhdCB0aGV5XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2FudGVkLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoY3Vyc29yLmtleSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghYWR2YW5jZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gT3RoZXJ3aXNlLCBhc2sgdGhlIGN1cnNvciB0byBza2lwIGFoZWFkIG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVjb3Jkcy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWR2YW5jZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3IuYWR2YW5jZShuKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBXaGVuIHdlIGdldCBoZXJlLCB3ZSd2ZSBnb3QgdGhlIG50aCBrZXkuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoY3Vyc29yLmtleSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgICAgIHJlcS5vbmVycm9yID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KHJlcS5lcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pW1wiY2F0Y2hcIl0ocmVqZWN0KTtcbiAgICB9KTtcblxuICAgIGV4ZWN1dGVDYWxsYmFjayhwcm9taXNlLCBjYWxsYmFjayk7XG4gICAgcmV0dXJuIHByb21pc2U7XG59XG5cbmZ1bmN0aW9uIGtleXMoY2FsbGJhY2spIHtcbiAgICB2YXIgc2VsZiA9IHRoaXM7XG5cbiAgICB2YXIgcHJvbWlzZSA9IG5ldyBQcm9taXNlJDEoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgICBzZWxmLnJlYWR5KCkudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBjcmVhdGVUcmFuc2FjdGlvbihzZWxmLl9kYkluZm8sIFJFQURfT05MWSwgZnVuY3Rpb24gKGVyciwgdHJhbnNhY3Rpb24pIHtcbiAgICAgICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZWplY3QoZXJyKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgc3RvcmUgPSB0cmFuc2FjdGlvbi5vYmplY3RTdG9yZShzZWxmLl9kYkluZm8uc3RvcmVOYW1lKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlcSA9IHN0b3JlLm9wZW5LZXlDdXJzb3IoKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGtleXMgPSBbXTtcblxuICAgICAgICAgICAgICAgICAgICByZXEub25zdWNjZXNzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnNvciA9IHJlcS5yZXN1bHQ7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY3Vyc29yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShrZXlzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGtleXMucHVzaChjdXJzb3Iua2V5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcltcImNvbnRpbnVlXCJdKCk7XG4gICAgICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICAgICAgcmVxLm9uZXJyb3IgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZWplY3QocmVxLmVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdChlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSlbXCJjYXRjaFwiXShyZWplY3QpO1xuICAgIH0pO1xuXG4gICAgZXhlY3V0ZUNhbGxiYWNr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biAgICAgICAgICAgIHZhciBmb3JhZ2VzID0gZGJDb250ZXh0LmZvcmFnZXM7XG4gICAgICAgICAgICBkYkNvbnRleHQuZGIgPSBkYjtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZm9yYWdlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGZvcmFnZXNbaV0uX2RiSW5mby5kYiA9IGRiO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGRiO1xuICAgICAgICB9KTtcblxuICAgICAgICBpZiAoIW9wdGlvbnMuc3RvcmVOYW1lKSB7XG4gICAgICAgICAgICBwcm9taXNlID0gZGJQcm9taXNlLnRoZW4oZnVuY3Rpb24gKGRiKSB7XG4gICAgICAgICAgICAgICAgX2RlZmVyUmVhZGluZXNzKG9wdGlvbnMpO1xuXG4gICAgICAgICAgICAgICAgdmFyIGRiQ29udGV4dCA9IGRiQ29udGV4dHNbb3B0aW9ucy5uYW1lXTtcbiAgICAgICAgICAgICAgICB2YXIgZm9yYWdlcyA9IGRiQ29udGV4dC5mb3JhZ2VzO1xuXG4gICAgICAgICAgICAgICAgZGIuY2xvc2UoKTtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGZvcmFnZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZvcmFnZSA9IGZvcmFnZXNbaV07XG4gICAgICAgICAgICAgICAgICAgIGZvcmFnZS5fZGJJbmZvLmRiID0gbnVsbDtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB2YXIgZHJvcERCUHJvbWlzZSA9IG5ldyBQcm9taXNlJDEoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcmVxID0gaWRiLmRlbGV0ZURhdGFiYXNlKG9wdGlvbnMubmFtZSk7XG5cbiAgICAgICAgICAgICAgICAgICAgcmVxLm9uZXJyb3IgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGIgPSByZXEucmVzdWx0O1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGIuY2xvc2UoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChyZXEuZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgICAgIHJlcS5vbmJsb2NrZWQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBDbG9zaW5nIGFsbCBvcGVuIGNvbm5lY3Rpb25zIGluIG9udmVyc2lvbmNoYW5nZSBoYW5kbGVyIHNob3VsZCBwcmV2ZW50IHRoaXMgc2l0dWF0aW9uLCBidXQgaWZcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlIGRvIGdldCBoZXJlLCBpdCBqdXN0IG1lYW5zIHRoZSByZXF1ZXN0IHJlbWFpbnMgcGVuZGluZyAtIGV2ZW50dWFsbHkgaXQgd2lsbCBzdWNjZWVkIG9yIGVycm9yXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oJ2Ryb3BJbnN0YW5jZSBibG9ja2VkIGZvciBkYXRhYmFzZSBcIicgKyBvcHRpb25zLm5hbWUgKyAnXCIgdW50aWwgYWxsIG9wZW4gY29ubmVjdGlvbnMgYXJlIGNsb3NlZCcpO1xuICAgICAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgICAgIHJlcS5vbnN1Y2Nlc3MgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGIgPSByZXEucmVzdWx0O1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGIuY2xvc2UoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoZGIpO1xuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuIGRyb3BEQlByb21pc2UudGhlbihmdW5jdGlvbiAoZGIpIHtcbiAgICAgICAgICAgICAgICAgICAgZGJDb250ZXh0LmRiID0gZGI7XG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZm9yYWdlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIF9mb3JhZ2UgPSBmb3JhZ2VzW2ldO1xuICAgICAgICAgICAgICAgICAgICAgICAgX2FkdmFuY2VSZWFkaW5lc3MoX2ZvcmFnZS5fZGJJbmZvKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pW1wiY2F0Y2hcIl0oZnVuY3Rpb24gKGVycikge1xuICAgICAgICAgICAgICAgICAgICAoX3JlamVjdFJlYWRpbmVzcyhvcHRpb25zLCBlcnIpIHx8IFByb21pc2UkMS5yZXNvbHZlKCkpW1wiY2F0Y2hcIl0oZnVuY3Rpb24gKCkge30pO1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBlcnI7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHByb21pc2UgPSBkYlByb21pc2UudGhlbihmdW5jdGlvbiAoZGIpIHtcbiAgICAgICAgICAgICAgICBpZiAoIWRiLm9iamVjdFN0b3JlTmFtZXMuY29udGFpbnMob3B0aW9ucy5zdG9yZU5hbWUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB2YXIgbmV3VmVyc2lvbiA9IGRiLnZlcnNpb24gKyAxO1xuXG4gICAgICAgICAgICAgICAgX2RlZmVyUmVhZGluZXNzKG9wdGlvbnMpO1xuXG4gICAgICAgICAgICAgICAgdmFyIGRiQ29udGV4dCA9IGRiQ29udGV4dHNbb3B0aW9ucy5uYW1lXTtcbiAgICAgICAgICAgICAgICB2YXIgZm9yYWdlcyA9IGRiQ29udGV4dC5mb3JhZ2VzO1xuXG4gICAgICAgICAgICAgICAgZGIuY2xvc2UoKTtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGZvcmFnZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZvcmFnZSA9IGZvcmFnZXNbaV07XG4gICAgICAgICAgICAgICAgICAgIGZvcmFnZS5fZGJJbmZvLmRiID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgZm9yYWdlLl9kYkluZm8udmVyc2lvbiA9IG5ld1ZlcnNpb247XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdmFyIGRyb3BPYmplY3RQcm9taXNlID0gbmV3IFByb21pc2UkMShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciByZXEgPSBpZGIub3BlbihvcHRpb25zLm5hbWUsIG5ld1ZlcnNpb24pO1xuXG4gICAgICAgICAgICAgICAgICAgIHJlcS5vbmVycm9yID0gZnVuY3Rpb24gKGVycikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRiID0gcmVxLnJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRiLmNsb3NlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZWplY3QoZXJyKTtcbiAgICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgICAgICByZXEub251cGdyYWRlbmVlZGVkID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRiID0gcmVxLnJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRiLmRlbGV0ZU9iamVjdFN0b3JlKG9wdGlvbnMuc3RvcmVOYW1lKTtcbiAgICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgICAgICByZXEub25zdWNjZXNzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRiID0gcmVxLnJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRiLmNsb3NlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKGRiKTtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIHJldHVybiBkcm9wT2JqZWN0UHJvbWlzZS50aGVuKGZ1bmN0aW9uIChkYikge1xuICAgICAgICAgICAgICAgICAgICBkYkNvbnRleHQuZGIgPSBkYjtcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBmb3JhZ2VzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgX2ZvcmFnZTIgPSBmb3JhZ2VzW2pdO1xuICAgICAgICAgICAgICAgICAgICAgICAgX2ZvcmFnZTIuX2RiSW5mby5kYiA9IGRiO1xuICAgICAgICAgICAgICAgICAgICAgICAgX2FkdmFuY2VSZWFkaW5lc3MoX2ZvcmFnZTIuX2RiSW5mbyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KVtcImNhdGNoXCJdKGZ1bmN0aW9uIChlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgKF9yZWplY3RSZWFkaW5lc3Mob3B0aW9ucywgZXJyKSB8fCBQcm9taXNlJDEucmVzb2x2ZSgpKVtcImNhdGNoXCJdKGZ1bmN0aW9uICgpIHt9KTtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgZXJyO1xuICAgICAgICAgICAgICAgIH0pO1x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gICAgfSBlbHNlIGlmICh2YWx1ZVR5cGUgPT09ICdbb2JqZWN0IEludDE2QXJyYXldJykge1xuICAgICAgICAgICAgICAgIG1hcmtlciArPSBUWVBFX0lOVDE2QVJSQVk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHZhbHVlVHlwZSA9PT0gJ1tvYmplY3QgVWludDE2QXJyYXldJykge1xuICAgICAgICAgICAgICAgIG1hcmtlciArPSBUWVBFX1VJTlQxNkFSUkFZO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZVR5cGUgPT09ICdbb2JqZWN0IEludDMyQXJyYXldJykge1xuICAgICAgICAgICAgICAgIG1hcmtlciArPSBUWVBFX0lOVDMyQVJSQVk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHZhbHVlVHlwZSA9PT0gJ1tvYmplY3QgVWludDMyQXJyYXldJykge1xuICAgICAgICAgICAgICAgIG1hcmtlciArPSBUWVBFX1VJTlQzMkFSUkFZO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZVR5cGUgPT09ICdbb2JqZWN0IEZsb2F0MzJBcnJheV0nKSB7XG4gICAgICAgICAgICAgICAgbWFya2VyICs9IFRZUEVfRkxPQVQzMkFSUkFZO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZVR5cGUgPT09ICdbb2JqZWN0IEZsb2F0NjRBcnJheV0nKSB7XG4gICAgICAgICAgICAgICAgbWFya2VyICs9IFRZUEVfRkxPQVQ2NEFSUkFZO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjYWxsYmFjayhuZXcgRXJyb3IoJ0ZhaWxlZCB0byBnZXQgdHlwZSBmb3IgQmluYXJ5QXJyYXknKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBjYWxsYmFjayhtYXJrZXIgKyBidWZmZXJUb1N0cmluZyhidWZmZXIpKTtcbiAgICB9IGVsc2UgaWYgKHZhbHVlVHlwZSA9PT0g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w7XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gQ2hlY2sgdG8gc2VlIGlmIHRoaXMgaXMgc2VyaWFsaXplZCBjb250ZW50IHdlIG5lZWQgdG9cbiAgICAgICAgICAgICAgICAgICAgLy8gdW5wYWNrLlxuICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBkYkluZm8uc2VyaWFsaXplci5kZXNlcmlhbGl6ZShyZXN1bHQpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShyZXN1bHQpO1xuICAgICAgICAgICAgICAgIH0sIGZ1bmN0aW9uICh0LCBlcnJvcikge1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZXJyb3IpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pW1wiY2F0Y2hcIl0ocmVqZWN0KTtcbiAgICB9KTtcblxuICAgIGV4ZWN1dGVDYWxsYmFjayhwcm9taXNlLCBjYWxsYmFjayk7XG4gICAgcmV0dXJuIHByb21pc2U7XG59XG5cbmZ1bmN0aW9uIGl0ZXJhdGUkMShpdGVyYXRvciwgY2FsbGJhY2spIHtcbiAgICB2YXIgc2VsZiA9IHRoaXM7XG5cbiAgICB2YXIgcHJvbWlzZSA9IG5ldyBQcm9taXNlJDEoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgICBzZWxmLnJlYWR5KCkudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgZGJJbmZvID0gc2VsZi5fZGJJbmZvO1xuXG4gICAgICAgICAgICBkYkluZm8uZGIudHJhbnNhY3Rpb24oZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICB0cnlFeGVjdXRlU3FsKHQsIGRiSW5mbywgJ1NFTEVDVCAqIEZST00gJyArIGRiSW5mby5zdG9yZU5hbWUsIFtdLCBmdW5jdGlvbiAodCwgcmVzdWx0cykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcm93cyA9IHJlc3VsdHMucm93cztcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxlbmd0aCA9IHJvd3MubGVuZ3RoO1xuXG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpdGVtID0gcm93cy5pdGVtKGkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlc3VsdCA9IGl0ZW0udmFsdWU7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIENoZWNrIHRvIHNlZSBpZiB0aGlzIGlzIHNlcmlhbGl6ZWQgY29udGVudFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2UgbmVlZCB0byB1bnBhY2suXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gZGJJbmZvLnNlcmlhbGl6ZXIuZGVzZXJpYWxpemUocmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gaXRlcmF0b3IocmVzdWx0LCBpdGVtLmtleSwgaSArIDEpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB2b2lkKDApIHByZXZlbnRzIHByb2JsZW1zIHdpdGggcmVkZWZpbml0aW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBvZiBgdW5kZWZpbmVkYC5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQgIT09IHZvaWQgMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUocmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICByZXNvbHZlKCk7XG4gICAgICAgICAgICAgICAgfSwgZnVuY3Rpb24gKHQsIGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdChlcnJvcik7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSlbXCJjYXRjaFwiXShyZWplY3QpO1xuICAgIH0pO1xuXG4gICAgZXhlY3V0ZUNhbGxiYWNrKHByb21pc2UsIGNhbGxiYWNrKTtcbiAgICByZXR1cm4gcHJvbWlzZTtcbn1cblxuZnVuY3Rpb24gX3NldEl0ZW0oa2V5LCB2YWx1ZSwgY2FsbGJhY2ssIHJldHJpZXNMZWZ0KSB7XG4gICAgdmFyIHNlbGYgPSB0aGlzO1xuXG4gICAga2V5ID0gbm9ybWFsaXplS2V5KGtleSk7XG5cbiAgICB2YXIgcHJvbWlzZSA9IG5ldyBQcm9taXNlJDEoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgICBzZWxmLnJlYWR5KCkudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAvLyBUaGUgbG9jYWxTdG9yYWdlIEFQSSBkb2Vzbid0IHJldHVybiB1bmRlZmluZWQgdmFsdWVzIGluIGFuXG4gICAgICAgICAgICAvLyBcImV4cGVjdGVkXCIgd2F5LCBzbyB1bmRlZmluZWQgaXMgYWx3YXlzIGNhc3QgdG8gbnVsbCBpbiBhbGxcbiAgICAgICAgICAgIC8vIGRyaXZlcnMuIFNlZTogaHR0cHM6Ly9naXRodWIuY29tL21vemlsbGEvbG9jYWxGb3JhZ2UvcHVsbC80MlxuICAgICAgICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IG51bGw7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIFNhdmUgdGhlIG9yaWdpbmFsIHZhbHVlIHRvIHBhc3MgdG8gdGhlIGNhbGxiYWNrLlxuICAgICAgICAgICAgdmFyIG9yaWdpbmFsVmFsdWUgPSB2YWx1ZTtcblxuICAgICAgICAgICAgdmFyIGRiSW5mbyA9IHNlbGYuX2RiSW5mbztcbiAgICAgICAgICAgIGRiSW5mby5zZXJpYWxpemVyLnNlcmlhbGl6ZSh2YWx1ZSwgZnVuY3Rpb24gKHZhbHVlLCBlcnJvcikge1xuICAgICAgICAgICAgICAgIGlmIChlcnJvcikge1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZXJyb3IpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGRiSW5mby5kYi50cmFuc2FjdGlvbihmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5RXhlY3V0ZVNxbCh0LCBkYkluZm8sICdJTlNFUlQgT1IgUkVQTEFDRSBJTlRPICcgKyBkYkluZm8uc3RvcmVOYW1lICsgJyAnICsgJyhrZXksIHZhbHVlKSBWQUxVRVMgKD8sID8pJywgW2tleSwgdmFsdWVdLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShvcmlnaW5hbFZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGZ1bmN0aW9uICh0LCBlcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSwgZnVuY3Rpb24gKHNxbEVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGUgdHJhbnNhY3Rpb24gZmFpbGVkOyBjaGVja1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gdG8gc2VlIGlmIGl0J3MgYSBxdW90YSBlcnJvci5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzcWxFcnJvci5jb2RlID09PSBzcWxFcnJvci5RVU9UQV9FUlIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSByZWplY3QgdGhlIGNhbGxiYWNrIG91dHJpZ2h0IGZvciBub3csIGJ1dFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGl0J3Mgd29ydGggdHJ5aW5nIHRvIHJlLXJ1biB0aGUgdHJhbnNhY3Rpb24uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gRXZlbiBpZiB0aGUgdXNlciBhY2NlcHRzIHRoZSBwcm9tcHQgdG8gdXNlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbW9yZSBzdG9yYWdlIG9uIFNhZmFyaSwgdGhpcyBlcnJvciB3aWxsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYmUgY2FsbGVkLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVHJ5IHRvIHJlLXJ1biB0aGUgdHJhbnNhY3Rpb24uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJldHJpZXNMZWZ0ID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKF9zZXRJdGVtLmFwcGx5KHNlbGYsIFtrZXksIG9yaWdpbmFsVmFsdWUsIGNhbGxiYWNrLCByZXRyaWVzTGVmdCAtIDFdKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KHNxbEVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pW1wiY2F0Y2hcIl0ocmVqZWN0KTtcbi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oMCkua2V5IDogbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShyZXN1bHQpO1xuICAgICAgICAgICAgICAgIH0sIGZ1bmN0aW9uICh0LCBlcnJvcikge1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZXJyb3IpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pW1wiY2F0Y2hcIl0ocmVqZWN0KTtcbiAgICB9KTtcblxuICAgIGV4ZWN1dGVDYWxsYmFjayhwcm9taXNlLCBjYWxsYmFjayk7XG4gICAgcmV0dXJuIHByb21pc2U7XG59XG5cbmZ1bmN0aW9uIGtleXMkMShjYWxsYmFjaykge1xuICAgIHZhciBzZWxmID0gdGhpcztcblxuICAgIHZhciBwcm9taXNlID0gbmV3IFByb21pc2UkMShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgIHNlbGYucmVhZHkoKS50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBkYkluZm8gPSBzZWxmLl9kYkluZm87XG4gICAgICAgICAgICBkYkluZm8uZGIudHJhbnNhY3Rpb24oZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICB0cnlFeGVjdXRlU3FsKHQsIGRiSW5mbywgJ1NFTEVDVCBrZXkgRlJPTSAnICsgZGJJbmZvLnN0b3JlTmFtZSwgW10sIGZ1bmN0aW9uICh0LCByZXN1bHRzKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBrZXlzID0gW107XG5cbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCByZXN1bHRzLnJvd3MubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleXMucHVzaChyZXN1bHRzLnJvd3MuaXRlbShpKS5rZXkpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShrZXlzK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ICAgfVxuXG4gICAgICAgICAgICAgICAgcmVzb2x2ZSh7XG4gICAgICAgICAgICAgICAgICAgIGRiOiBkYixcbiAgICAgICAgICAgICAgICAgICAgc3RvcmVOYW1lczogc3RvcmVOYW1lc1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSwgZnVuY3Rpb24gKHQsIGVycm9yKSB7XG4gICAgICAgICAgICAgICAgcmVqZWN0KGVycm9yKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LCBmdW5jdGlvbiAoc3FsRXJyb3IpIHtcbiAgICAgICAgICAgIHJlamVjdChzcWxFcnJvcik7XG4gICAgICAgIH0pO1xuICAgIH0pO1xufVxuXG5mdW5jdGlvbiBkcm9wSW5zdGFuY2UkMShvcHRpb25zLCBjYWxsYmFjaykge1xuICAgIGNhbGxiYWNrID0gZ2V0Q2FsbGJhY2suYXBwbHkodGhpcywgYXJndW1lbnRzKTtcblxuICAgIHZhciBjdXJyZW50Q29uZmlnID0gdGhpcy5jb25maWcoKTtcbiAgICBvcHRpb25zID0gdHlwZW9mIG9wdGlvbnMgIT09ICdmdW5jdGlvbicgJiYgb3B0aW9ucyB8fCB7fTtcbiAgICBpZiAoIW9wdGlvbnMubmFtZSkge1xuICAgICAgICBvcHRpb25zLm5hbWUgPSBvcHRpb25zLm5hbWUgfHwgY3VycmVudENvbmZpZy5uYW1lO1xuICAgICAgICBvcHRpb25zLnN0b3JlTmFtZSA9IG9wdGlvbnMuc3RvcmVOYW1lIHx8IGN1cnJlbnRDb25maWcuc3RvcmVOYW1lO1xuICAgIH1cblxuICAgIHZhciBzZWxmID0gdGhpcztcbiAgICB2YXIgcHJvbWlzZTtcbiAgICBpZiAoIW9wdGlvbnMubmFtZSkge1xuICAgICAgICBwcm9taXNlID0gUHJvbWlzZSQxLnJlamVjdCgnSW52YWxpZCBhcmd1bWVudHMnKTtcbiAgICB9IGVsc2Uge1xuICAgICAgICBwcm9taXNlID0gbmV3IFByb21pc2UkMShmdW5jdGlvbiAocmVzb2x2ZSkge1xuICAgICAgICAgICAgdmFyIGRiO1xuICAgICAgICAgICAgaWYgKG9wdGlvbnMubmFtZSA9PT0gY3VycmVudENvbmZpZy5uYW1lKSB7XG4gICAgICAgICAgICAgICAgLy8gdXNlIHRoZSBkYiByZWZlcmVuY2Ugb2YgdGhlIGN1cnJlbnQgaW5zdGFuY2VcbiAgICAgICAgICAgICAgICBkYiA9IHNlbGYuX2RiSW5mby5kYjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZGIgPSBvcGVuRGF0YWJhc2Uob3B0aW9ucy5uYW1lLCAnJywgJycsIDApO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoIW9wdGlvbnMuc3RvcmVOYW1lKSB7XG4gICAgICAgICAgICAgICAgLy8gZHJvcCBhbGwgZGF0YWJhc2UgdGFibGVzXG4gICAgICAgICAgICAgICAgcmVzb2x2ZShnZXRBbGxTdG9yZU5hbWVzKGRiKSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJlc29sdmUoe1xuICAgICAgICAgICAgICAgICAgICBkYjogZGIsXG4gICAgICAgICAgICAgICAgICAgIHN0b3JlTmFtZXM6IFtvcHRpb25zLnN0b3JlTmFtZV1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSkudGhlbihmdW5jdGlvbiAob3BlcmF0aW9uSW5mbykge1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlJDEoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgICAgICAgICAgIG9wZXJhdGlvbkluZm8uZGIudHJhbnNhY3Rpb24oZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gZHJvcFRhYmxlKHN0b3JlTmFtZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlJDEoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQuZXhlY3V0ZVNxbCgnRFJPUCBUQUJMRSBJRiBFWElTVFMgJyArIHN0b3JlTmFtZSwgW10sIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGZ1bmN0aW9uICh0LCBlcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWplY3QoZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICB2YXIgb3BlcmF0aW9ucyA9IFtdO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMCwgbGVuID0gb3BlcmF0aW9uSW5mby5zdG9yZU5hbWVzLmxlbmd0aDsgaSA8IGxlbjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvcGVyYXRpb25zLnB1c2goZHJvcFRhYmxlKG9wZXJhdGlvbkluZm8uc3RvcmVOYW1lc1tpXSkpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgUHJvbWlzZSQxLmFsbChvcGVyYXRpb25zKS50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgfSlbXCJjYXRjaFwiXShmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KGUpO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9LCBmdW5jdGlvbiAoc3FsRXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVqZWN0KHN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hpcztcblxuICAgIGtleSA9IG5vcm1hbGl6ZUtleShrZXkpO1xuXG4gICAgdmFyIHByb21pc2UgPSBzZWxmLnJlYWR5KCkudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgIC8vIENvbnZlcnQgdW5kZWZpbmVkIHZhbHVlcyB0byBudWxsLlxuICAgICAgICAvLyBodHRwczovL2dpdGh1Yi5jb20vbW96aWxsYS9sb2NhbEZvcmFnZS9wdWxsLzQyXG4gICAgICAgIGlmICh2YWx1ZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICB2YWx1ZSA9IG51bGw7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBTYXZlIHRoZSBvcmlnaW5hbCB2YWx1ZSB0byBwYXNzIHRvIHRoZSBjYWxsYmFjay5cbiAgICAgICAgdmFyIG9yaWdpbmFsVmFsdWUgPSB2YWx1ZTtcblxuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UkMShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICB2YXIgZGJJbmZvID0gc2VsZi5fZGJJbmZvO1xuICAgICAgICAgICAgZGJJbmZvLnNlcmlhbGl6ZXIuc2VyaWFsaXplKHZhbHVlLCBmdW5jdGlvbiAodmFsdWUsIGVycm9yKSB7XG4gICAgICAgICAgICAgICAgaWYgKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdChlcnJvcik7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsU3RvcmFnZS5zZXRJdGVtKGRiSW5mby5rZXlQcmVmaXggKyBrZXksIHZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUob3JpZ2luYWxWYWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxvY2FsU3RvcmFnZSBjYXBhY2l0eSBleGNlZWRlZC5cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IE1ha2UgdGhpcyBhIHNwZWNpZmljIGVycm9yL2V2ZW50LlxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUubmFtZSA9PT0gJ1F1b3RhRXhjZWVkZWRFcnJvcicgfHwgZS5uYW1lID09PSAnTlNfRVJST1JfRE9NX1FVT1RBX1JFQUNIRUQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KGUpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgIH0pO1xuXG4gICAgZXhlY3V0ZUNhbGxiYWNrKHByb21pc2UsIGNhbGxiYWNrKTtcbiAgICByZXR1cm4gcHJvbWlzZTtcbn1cblxuZnVuY3Rpb24gZHJvcEluc3RhbmNlJDIob3B0aW9ucywgY2FsbGJhY2spIHtcbiAgICBjYWxsYmFjayA9IGdldENhbGxiYWNrLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG5cbiAgICBvcHRpb25zID0gdHlwZW9mIG9wdGlvbnMgIT09ICdmdW5jdGlvbicgJiYgb3B0aW9ucyB8fCB7fTtcbiAgICBpZiAoIW9wdGlvbnMubmFtZSkge1xuICAgICAgICB2YXIgY3VycmVudENvbmZpZyA9IHRoaXMuY29uZmlnKCk7XG4gICAgICAgIG9wdGlvbnMubmFtZSA9IG9wdGlvbnMubmFtZSB8fCBjdXJyZW50Q29uZmlnLm5hbWU7XG4gICAgICAgIG9wdGlvbnMuc3RvcmVOYW1lID0gb3B0aW9ucy5zdG9yZU5hbWUgfHwgY3VycmVudENvbmZpZy5zdG9yZU5hbWU7XG4gICAgfVxuXG4gICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgIHZhciBwcm9taXNlO1xuICAgIGlmICghb3B0aW9ucy5uYW1lKSB7XG4gICAgICAgIHByb21pc2UgPSBQcm9taXNlJDEucmVqZWN0KCdJbnZhbGlkIGFyZ3VtZW50cycpO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHByb21pc2UgPSBuZXcgUHJvbWlzZSQxKGZ1bmN0aW9uIChyZXNvbHZlKSB7XG4gICAgICAgICAgICBpZiAoIW9wdGlvbnMuc3RvcmVOYW1lKSB7XG4gICAgICAgICAgICAgICAgcmVzb2x2ZShvcHRpb25zLm5hbWUgKyAnLycpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXNvbHZlKF9nZXRLZXlQcmVmaXgob3B0aW9ucywgc2VsZi5fZGVmYXVsdENvbmZpZykpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KS50aGVuKGZ1bmN0aW9uIChrZXlQcmVmaXgpIHtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSBsb2NhbFN0b3JhZ2UubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHtcbiAgICAgICAgICAgICAgICB2YXIga2V5ID0gbG9jYWxTdG9yYWdlLmtleShpKTtcblxuICAgICAgICAgICAgICAgIGlmIChrZXkuaW5kZXhPZihrZXlQcmVmaXgpID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGxvY2FsU3RvcmFnZS5yZW1vdmVJdGVtKGtleSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBleGVjdXRlQ2FsbGJhY2socHJvbWlzZSwgY2FsbGJhY2spO1xuICAgIHJldHVybiBwcm9taXNlO1xufVxuXG52YXIgbG9jYWxTdG9yYWdlV3JhcHBlciA9IHtcbiAgICBfZHJpdmVyOiAnbG9jYWxTdG9yYWdlV3JhcHBlcicsXG4gICAgX2luaXRTdG9yYWdlOiBfaW5pdFN0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AgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGFyZ3VtZW50c1swXTtcbn1cblxudmFyIExvY2FsRm9yYWdlID0gZnVuY3Rpb24gKCkge1xuICAgIGZ1bmN0aW9uIExvY2FsRm9yYWdlKG9wdGlvbnMpIHtcbiAgICAgICAgX2NsYXNzQ2FsbENoZWNrKHRoaXMsIExvY2FsRm9yYWdlKTtcblxuICAgICAgICBmb3IgKHZhciBkcml2ZXJUeXBlS2V5IGluIERlZmF1bHREcml2ZXJzKSB7XG4gICAgICAgICAgICBpZiAoRGVmYXVsdERyaXZlcnMuaGFzT3duUHJvcGVydHkoZHJpdmVyVHlwZUtleSkpIHtcbiAgICAgICAgICAgICAgICB2YXIgZHJpdmVyID0gRGVmYXVsdERyaXZlcnNbZHJpdmVyVHlwZUtleV07XG4gICAgICAgICAgICAgICAgdmFyIGRyaXZlck5hbWUgPSBkcml2ZXIuX2RyaXZlcjtcbiAgICAgICAgICAgICAgICB0aGlzW2RyaXZlclR5cGVLZXldID0gZHJpdmVyTmFtZTtcblxuICAgICAgICAgICAgICAgIGlmICghRGVmaW5lZERyaXZlcnNbZHJpdmVyTmFtZV0pIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gd2UgZG9uJ3QgbmVlZCB0byB3YWl0IGZvciB0aGUgcHJvbWlzZSxcbiAgICAgICAgICAgICAgICAgICAgLy8gc2luY2UgdGhlIGRlZmF1bHQgZHJpdmVycyBjYW4gYmUgZGVmaW5lZFxuICAgICAgICAgICAgICAgICAgICAvLyBpbiBhIGJsb2NraW5nIG1hbm5lclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmRlZmluZURyaXZlcihkcml2ZXIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuX2RlZmF1bHRDb25maWcgPSBleHRlbmQoe30sI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aG9kTmFtZV0gIT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChjb21wbGlhbmNlRXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdmFyIGNvbmZpZ3VyZU1pc3NpbmdNZXRob2RzID0gZnVuY3Rpb24gY29uZmlndXJlTWlzc2luZ01ldGhvZHMoKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBtZXRob2ROb3RJbXBsZW1lbnRlZEZhY3RvcnkgPSBmdW5jdGlvbiBtZXRob2ROb3RJbXBsZW1lbnRlZEZhY3RvcnkobWV0aG9kTmFtZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZXJyb3IgPSBuZXcgRXJyb3IoJ01ldGhvZCAnICsgbWV0aG9kTmFtZSArICcgaXMgbm90IGltcGxlbWVudGVkIGJ5IHRoZSBjdXJyZW50IGRyaXZlcicpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwcm9taXNlID0gUHJvbWlzZSQxLnJlamVjdChlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXhlY3V0ZUNhbGxiYWNrKHByb21pc2UsIGFyZ3VtZW50c1thcmd1bWVudHMubGVuZ3RoIC0gMV0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwcm9taXNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBfaSA9IDAsIF9sZW4gPSBPcHRpb25hbERyaXZlck1ldGhvZHMubGVuZ3RoOyBfaSA8IF9sZW47IF9pKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvcHRpb25hbERyaXZlck1ldGhvZCA9IE9wdGlvbmFsRHJpdmVyTWV0aG9kc1tfaV07XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWRyaXZlck9iamVjdFtvcHRpb25hbERyaXZlck1ldGhvZF0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcml2ZXJPYmplY3Rbb3B0aW9uYWxEcml2ZXJNZXRob2RdID0gbWV0aG9kTm90SW1wbGVtZW50ZWRGYWN0b3J5KG9wdGlvbmFsRHJpdmVyTWV0aG9kKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICBjb25maWd1cmVNaXNzaW5nTWV0aG9kcygpO1xuXG4gICAgICAgICAgICAgICAgdmFyIHNldERyaXZlclN1cHBvcnQgPSBmdW5jdGlvbiBzZXREcml2ZXJTdXBwb3J0KHN1cHBvcnQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKERlZmluZWREcml2ZXJzW2RyaXZlck5hbWVdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmluZm8oJ1JlZGVmaW5pbmcgTG9jYWxGb3JhZ2UgZHJpdmVyOiAnICsgZHJpdmVyTmFtZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgRGVmaW5lZERyaXZlcnNbZHJpdmVyTmFtZV0gPSBkcml2ZXJPYmplY3Q7XG4gICAgICAgICAgICAgICAgICAgIERyaXZlclN1cHBvcnRbZHJpdmVyTmFtZV0gPSBzdXBwb3J0O1xuICAgICAgICAgICAgICAgICAgICAvLyBkb24ndCB1c2UgYSB0aGVuLCBzbyB0aGF0IHdlIGNhbiBkZWZpbmVcbiAgICAgICAgICAgICAgICAgICAgLy8gZHJpdmVycyB0aGF0IGhhdmUgc2ltcGxlIF9zdXBwb3J0IG1ldGhvZHNcbiAgICAgICAgICAgICAgICAgICAgLy8gaW4gYSBibG9ja2luZyBtYW5uZXJcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSgpO1xuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICBpZiAoJ19zdXBwb3J0JyBpbiBkcml2ZXJPYmplY3QpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGRyaXZlck9iamVjdC5fc3VwcG9ydCAmJiB0eXBlb2YgZHJpdmVyT2JqZWN0Ll9zdXBwb3J0ID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkcml2ZXJPYmplY3QuX3N1cHBvcnQoKS50aGVuKHNldERyaXZlclN1cHBvcnQsIHJlamVjdCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZXREcml2ZXJTdXBwb3J0KCEhZHJpdmVyT2JqZWN0Ll9zdXBwb3J0KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHNldERyaXZlclN1cHBvcnQodHJ1ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgIHJlamVjdChlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgZXhlY3V0ZVR3b0NhbGxiYWNrcyhwcm9taXNlLCBjYWxsYmFjaywgZXJyb3JDYWxsYmFjayk7XG4gICAgICAgIHJldHVybiBwcm9taXNlO1xuICAgIH07XG5cbiAgICBMb2NhbEZvcmFnZS5wcm90b3R5cGUuZHJpdmVyID0gZnVuY3Rpb24gZHJpdmVyKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5fZHJpdmVyIHx8IG51bGw7XG4gICAgfTtcblxuICAgIExvY2FsRm9yYWdlLnByb3RvdHlwZS5nZXREcml2ZXIgPSB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AgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiBzZWxmLl9yZWFkeTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgZXhlY3V0ZVR3b0NhbGxiYWNrcyhwcm9taXNlLCBjYWxsYmFjaywgY2FsbGJhY2spO1xuICAgICAgICByZXR1cm4gcHJvbWlzZTtcbiAgICB9O1xuXG4gICAgTG9jYWxGb3JhZ2UucHJvdG90eXBlLnNldERyaXZlciA9IGZ1bmN0aW9uIHNldERyaXZlcihkcml2ZXJzLCBjYWxsYmFjaywgZXJyb3JDYWxsYmFjaykge1xuICAgICAgICB2YXIgc2VsZiA9IHRoaXM7XG5cbiAgICAgICAgaWYgKCFpc0FycmF5KGRyaXZlcnMpKSB7XG4gICAgICAgICAgICBkcml2ZXJzID0gW2RyaXZlcnNdO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIHN1cHBvcnRlZERyaXZlcnMgPSB0aGlzLl9nZXRTdXBwb3J0ZWREcml2ZXJzKGRyaXZlcnMpO1xuXG4gICAgICAgIGZ1bmN0aW9uIHNldERyaXZlclRvQ29uZmlnKCkge1xuICAgICAgICAgICAgc2VsZi5fY29uZmlnLmRyaXZlciA9IHNlbGYuZHJpdmVyKCk7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBleHRlbmRTZWxmV2l0aERyaXZlcihkcml2ZXIpIHtcbiAgICAgICAgICAgIHNlbGYuX2V4dGVuZChkcml2ZXIpO1xuICAgICAgICAgICAgc2V0RHJpdmVyVG9Db25maWcoKTtcblxuICAgICAgICAgICAgc2VsZi5fcmVhZHkgPSBzZWxmLl9pbml0U3RvcmFnZShzZWxmLl9jb25maWcpO1xuICAgICAgICAgICAgcmV0dXJuIHNlbGYuX3JlYWR5O1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gaW5pdERyaXZlcihzdXBwb3J0ZWREcml2ZXJzKSB7XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciBjdXJyZW50RHJpdmVySW5kZXggPSAwO1xuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gZHJpdmVyUHJvbWlzZUxvb3AoKSB7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlIChjdXJyZW50RHJpdmVySW5kZXggPCBzdXBwb3J0ZWREcml2ZXJzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRyaXZlck5hbWUgPSBzdXBwb3J0ZWREcml2ZXJzW2N1cnJlbnREcml2ZXJJbmRleF07XG4gICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50RHJpdmVySW5kZXgrKztcblxuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5fZGJJbmZvID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX3JlYWR5ID0gbnVsbDtcblxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNlbGYuZ2V0RHJpdmVyKGRyaXZlck5hbWUpLnRoZW4oZXh0ZW5kU2VsZldpdGhEcml2ZXIpW1wiY2F0Y2hcIl0oZHJpdmVyUHJvbWlzZUxvb3ApO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgc2V0RHJpdmVyVG9Db25maWcoKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGVycm9yID0gbmV3IEVycm9yKCdObyBhdmFpbGFibGUgc3RvcmFnZSBtZXRob2QgZm91bmQuJyk7XG4gICAgICAgICAgICAgICAgICAgIHNlbGYuX2RyaXZlclNldCA9IFByb21pc2UkMS5yZWplY3QoZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2VsZi5fZHJpdmVyU2V0O1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHJldHVybiBkcml2ZXJQcm9taXNlTG9vcCgpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFRoZX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pb24oKTtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBsZWFmID0gdGhpcy5hcHAud29ya3NwYWNlLmdldExlYWYoZXZlbnQuY3RybEtleSk7XHJcbiAgICAgICAgICAgICAgICAgICAgbGVhZi5zZXRWaWV3U3RhdGUoe1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBWSUVXX1RZUEUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlOiB7ZmlsZTogZmlsZS5wYXRofVxyXG4gICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICB9KSk7XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICBub2RlLmFwcGVuZENoaWxkKGRpdik7XHJcblxyXG4gICAgICAgIH0pO1xyXG5cclxuICAgICAgICB0aGlzLnJlZ2lzdGVyRXZlbnQodGhpcy5hcHAud29ya3NwYWNlLm9uKFwiaG92ZXItbGlua1wiLCBhc3luYyAoZXZlbnQ6IGFueSkgPT4ge1xyXG4gICAgICAgICAgICBjb25zdCBsaW5rVGV4dDogc3RyaW5nID0gZXZlbnQubGlua3RleHQ7XHJcbiAgICAgICAgICAgIGlmICghbGlua1RleHQpIHJldHVybjtcclxuICAgICAgICAgICAgY29uc3Qgc291cmNlUGF0aDogc3RyaW5nID0gZXZlbnQuc291cmNlUGF0aDtcclxuXHJcbiAgICAgICAgICAgIGlmICghbGlua1RleHQuZW5kc1dpdGgoXCIucHVtbFwiKSAmJiAhbGlua1RleHQuZW5kc1dpdGgoXCIucHVcIikpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgdGhpcy5ob3Zlci5saW5rVGV4dCA9IGxpbmtUZXh0O1xyXG4gICAgICAgICAgICB0aGlzLmhvdmVyLnNvdXJjZVBhdGggPSBzb3VyY2VQYXRoO1xyXG4gICAgICAgIH0pKTtcclxuXHJcbiAgICAgICAgdGhpcy5vYnNlcn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AgICApO1xyXG5cclxuICAgICAgICBpZihQbGF0Zm9ybS5pc0Rlc2t0b3BBcHApIHtcclxuXHJcbiAgICAgICAgICAgIGNvbnN0IGphckRlc2MgPSBuZXcgRG9jdW1lbnRGcmFnbWVudCgpO1xyXG4gICAgICAgICAgICBqYXJEZXNjLmNyZWF0ZURpdigpLmlubmVySFRNTCA9IFwiUGF0aCB0byBsb2NhbCBKQVI8YnI+U3VwcG9ydHM6XCIgK1xyXG4gICAgICAgICAgICAgICAgXCI8dWw+XCIgK1xyXG4gICAgICAgICAgICAgICAgXCI8bGk+QWJzb2x1dGUgcGF0aDwvbGk+XCIgK1xyXG4gICAgICAgICAgICAgICAgXCI8bGk+UGF0aCByZWxhdGl2ZSB0byB2YXVsdDwvbGk+XCIgK1xyXG4gICAgICAgICAgICAgICAgXCI8bGk+UGF0aCByZWxhdGl2ZSB0byB1c2VycyBob21lIGRpcmVjdG9yeSA8Y29kZT5+LzwvY29kZT48L2xpPlwiICtcclxuICAgICAgICAgICAgICAgIFwiPC91bD5cIjtcclxuXHJcbiAgICAgICAgICAgIG5ldyBTZXR0aW5nKGNvbnRhaW5lckVsKVxyXG4gICAgICAgICAgICAgICAgLnNldE5hbWUoXCJMb2NhbCBKQVJcIilcclxuICAgICAgICAgICAgICAgIC5zZXREZXNjKGphckRlc2MpXHJcbiAgICAgICAgICAgICAgICAuYWRkVGV4dCh0ZXh0ID0+IHRleHQuc2V0UGxhY2Vob2xkZXIoREVGQVVMVF9TRVRUSU5HUy5sb2NhbEphcilcclxuICAgICAgICAgICAgICAgICAgICAuc2V0VmFsdWUodGhpcy5wbHVnaW4uc2V0dGluZ3MubG9jYWxKYXIpXHJcbiAgICAgICAgICAgICAgICAgICAgLm9uQ2hhbmdlKGFzeW5jICh2YWx1ZSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wbHVnaW4uc2V0dGluZ3MubG9jYWxKYXIgPSB2YWx1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMucGx1Z2luLnNhdmVTZXR0aW5ncygpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICAgICAgKTtcclxuXHJcbiAgICAgICAgICAgIG5ldyBTZXR0aW5nKGNvbnRhaW5lckVsKVxyXG4gICAgICAgICAgICAgICAgLnNldE5hbWUoXCJKYXZhIHBhdGhcIilcclxuICAgICAgICAgICAgICAgIC5zZXREZXNjKFwiUGF0aCB0byBKYXZhIGV4ZWN1dGFibGVcIilcclxuICAgICAgICAgICAgICAgIC5hZGRUZXh0KHRleHQgPT4gdGV4dC5zZXRQbGFjZWhvbGRlcihERUZBVUxUX1NFVFRJTkdTLmphdmFQYXRoKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zZXRWYWx1ZSh0aGlzLnBsdWdpbi5zZXR0aW5ncy5qYXZhUGF0aClcclxuICAgICAgICAgICAgICAgICAgICAub25DaGFuZ2UoYXN5bmMgKHZhbHVlKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBsdWdpbi5zZXR0aW5ncy5qYXZhUGF0aCA9IHZhbHVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5wbHVnaW4uc2F2ZVNldHRpbmdzKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICApXHJcbiAgICAgICAgICAgICAgICApO1xyXG5cclxuICAgICAgICAgICAgbmV3IFNldHRpbmcoY29udGFpbmVyRWwpXHJcbiAgICAgICAgICAgICAgICAuc2V0TmFtZShcIkRvdCBwYXRoXCIpXHJcbiAgICAgICAgICAgICAgICAuc2V0RGVzYyhcIlBhdGggdG8gZG90IGV4ZWN1dGFibGVcIilcclxuICAgICAgICAgICAgICAgIC5hZGRUZXh0KHRleHQgPT4gdGV4dC5zZXRQbGFjZWhvbGRlcihERUZBVUxUX1NFVFRJTkdTLmRvdFBhdGgpXHJcbiAgICAgICAgICAgICAgICAgICAgLnNldFZhbHVlKHRoaXMucGx1Z2luLnNldHRpbmdzLmRvdFBhdGgpXHJcbiAgICAgICAgICAgICAgICAgICAgLm9uQ2hhbmdlKGFzeW5jICh2YWx1ZSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wbHVnaW4uc2V0dGluZ3MuZG90UGF0aCA9IHZhbHVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5wbHVnaW4uc2F2ZVNldHRpbmdzKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICApXHJcbiAgICAgICAgICAgICAgICApO1xyXG5cclxuICAgICAgICAgICAgbmV3IFNldHRpbmcoY29udGFpbmVyRWwpXHJcbiAgICAgICAgICAgICAgICAuc2V0TmFtZShcIkRpYWdyYW0gZXhwb3J0IHBhdGhcIilcclxuICAgICAgICAgICAgICAgIC5zZXREZXNjKFwiUGF0aCB3aGVyZSBleHBvcnRlZCBkaWFncmFtcyB3aWxsIGJlIHNhdmVkIHJlbGF0aXZlIHRvIHRoZSB2YXVsdCByb290LiBMZWF2ZSBibGFuayB0byBzYXZlIGFsb25nIHNpZGUgdGhlIG5vdGUuXCIpXHJcbiAgICAgICAgICAgICAgICAuYWRkVGV4dCh0ZXh0ID0+IHRleHQuc2V0UGxhY2Vob2xkZXIoREVGQVVMVF9TRVRUSU5HUy5leHBvcnRQYXRoKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zZXRWYWx1ZSh0aGlzLnBsdWdpbi5zZXR0aW5ncy5leHBvcnRQYXRoKVxyXG4gICAgICAgICAgICAgICAgICAgIC5vbkNoYW5nZShhc3luYyAodmFsdWUpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGx1Z2luLnNldHRpbmdzLmV4cG9ydFBhdGggPSB2YWx1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMucGx1Z2luLnNhdmVTZXR0aW5ncygpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICAgICAgKTtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIG5ldyBTZXR0aW5nKGNvbnRhaW5lckVsKVxyXG4gICAgICAgICAgICAuc2V0TmFtZShcIkRlZmF1bHQgcHJvY2Vzc29yIGZvciBpbmNsdWRlc1wiKVxyXG4gICAgICAgICAgICAuc2V0RGVzYyhcIkFueSAucHUvLnB1bWwgZmlsZXMgbGlua2VkIHdpbGwgdXNlIHRoaXMgcHJvY2Vzc29yXCIpXHJcbiAgICAgICAgICAgIC5hZGREcm9wZG93bihkcm9wZG93biA9PiB7XHJcbiAgICAgICAgICAgICAgIGRyb3Bkb3duXHJcbiAgICAgICAgICAgICAgICAgICAuYWRkT3B0aW9uKFwicG5nXCIsIFwiUE5HXCIpXHJcbiAgICAgICAgICAgICAgICAgICAuYWRkT3B0aW9uKFwic3ZnXCIsIFwiU1ZHXCIpXHJcbiAgICAgICAgICAgICAgICAgICAuc2V0VmFsdWUodGhpcy5wbHVnaW4uc2V0dGluZ3MuZGVmYXVsdFByb2Nlc3NvcilcclxuICAgICAgICAgICAgICAgICAgIC5vbkNoYW5nZShhc3luYyh2YWx1ZSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgdGhpcy5wbHVnaW4uc2V0dGluZ3MuZGVmYXVsdFByb2Nlc3NvciA9IHZhbHVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5wbHVnaW4uc2F2ZVNldHRpbmdzKCk7XHJcbiAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgfSk7XHJcblxyXG4gICAgICAgIG5ldyBTZXR0aW5nKGNvbnRhaW5lckVsKS5zZXROYW1lKFwiSGVhZGVyXCIpXHJcbiAgICAgICAgICAgIC5zZXREZXNjKFwiSW5jbHVkZWQgYXQgdGhlIGhlYWQgaW4gZXZlcnkgZGlhZ3JhbS4gVXNlZnVsIGZvciBzcGVjaWZ5aW5nIGEgY29tbW9uIHRoZW1lICgucHVtbCBmaWxlKVwiKVxyXG4gICAgICAgICAgICAuYWRkVGV4dEFyZWEodGV4dCA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGV4dC5zZXRQbGFjZWhvbGRlcihcIiFpbmNsdWRlIGh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS8uLi4ucHVtbFxcblwiKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc2V0VmFsdWUodGhpcy5wbHVnaW4uc2V0dGluZ3MuaGVhZGVyKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAub25DaGFuZ2UoYXN5bmMgKHZhbHVlKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wbHVnaW4uc2V0dGluZ3MuaGVhZGVyID0gdmFsdWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5wbHVnaW4uc2F2ZVNldHRpbmdzKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIClcclxuICAgICAgICAgICAgICAgICAgICB0ZXh0LmlucHV0RWwuc2V0QXR0cihcInJvd3NcIiwgNCk7XHJcbiAgICAgICAgICAgICAgICAgICAgdGV4dC5pbnB1dEVsLmFkZENsYXNzKFwicHVtbC1zZXR0aW5ncy1hcmVhXCIpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICk7XHJcblxyXG4gICAgICAgIG5ldyBTZXR0aW5nKGNvbnRhaW5lckVsKVxyXG4gICAgICAgICAgICAuc2V0TmFtZSgnQ2FjaGUnKVxyXG4gICAgICAgICAgICAuc2V0RGVzYygnaW4gZGF5cy4gT25seSBhcHBsaWNhYmxlIHdoZW4gZ2VuZXJhdGluZyBkaWFncmFtcyBsb2NhbGx5JylcclxuICAgICAgICAgICAgLmFkZFNsaWRlcihzbGlkZXIgPT4ge1xyXG4gICAgICAgICAgICAgICAgc2xpZGVyXHJcbiAgICAgICAgICAgICAgICAgICAgLnNldExpbWl0cygxMCwgMzYwLCAxMClcclxuICAgICAgICAgICAgICAgICAgICAuc2V0VmFsdWUodGhpcy5wbHVnaW4uc2V0dGluZ3MuY2FjaGUpXHJcbiAgICAgICAgICAgICAgICAgICAgLnNldER5bmFtaWNUb29sdGlwKClcclxuICAgICAgICAgICAgICAgICAgICAub25DaGFuZ2UoYXN5bmMgdmFsdWUgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBsdWdpbi5zZXR0aW5ncy5jYWNoZSA9IHZhbHVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLnBsdWdpbi5zYXZlU2V0dGluZ3MoKTtcclxuICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgbmV3IFNldHRpbmcoY29udGFpbmVyRWwpXHJcbiAgICAgICAgICAgIC5zZXROYW1lKFwiRGVib3VuY2VcIilcclxuICAgICAgICAgICAgLnNldERlc2MoXCJIb3cgb2Z0ZW4gc2hvdWxkIHRoZSBkaWFncmFtIHJlZnJlc2ggaW4gc2Vjb25kc1wiKVxyXG4gICAgICAgICAgICAuYWRkVGV4dCh0ZXh0ID0+IHRleHQuc2V0UGxhY2Vob2xkZXIoU3RyaW5nKERFRkFVTFRfU0VUVElOR1MuZGVib3VuY2UpKVxyXG4gICAgICAgICAgICAgICAgLnNldFZhbHVlKFN0cmluZyh0aGlzLnBsdWdpbi5zZXR0aW5ncy5kZWJvdW5jZSkpXHJcbiAgICAgICAgICAgICAgICAub25DaGFuZ2UoYXN5bmMgKHZhbHVlKSA9P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HJcbiAgICAgICAgICAgIGNoaWxkLm9uKFwiZXJyb3JcIiwgcmVqZWN0KTtcclxuXHJcbiAgICAgICAgICAgIGNoaWxkLm9uKFwiY2xvc2VcIiwgKGNvZGU6IGFueSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgaWYgKGNvZGUgPT09IDApIHtcclxuICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHN0ZG91dCk7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjb2RlID09PSAxKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coc3Rkb3V0KTtcclxuICAgICAgICAgICAgICAgICAgICByZWplY3QobmV3IEVycm9yKGBhbiBlcnJvciBvY2N1cnJlZGApKTtcclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmVqZWN0KG5ldyBFcnJvcihgY2hpbGQgZXhpdGVkIHdpdGggY29kZSAke2NvZGV9YCkpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgICAgIGNoaWxkLnN0ZGluLndyaXRlKHNvdXJjZSk7XHJcbiAgICAgICAgICAgIGNoaWxkLnN0ZGluLmVuZCgpO1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG5cclxuICAgIGFzeW5jIGdlbmVyYXRlTG9jYWxJbWFnZShzb3VyY2U6IHN0cmluZywgdHlwZTogT3V0cHV0VHlwZSwgcGF0aDogc3RyaW5nKTogUHJvbWlzZTxzdHJpbmc+IHtcclxuICAgICAgICBjb25zdCB7Q2hpbGRQcm9jZXNzLCBleGVjfSA9IHJlcXVpcmUoJ2NoaWxkX3Byb2Nlc3MnKTtcclxuICAgICAgICBjb25zdCBhcmdzID0gdGhpcy5yZXNvbHZlTG9jYWxKYXJDbWQoKS5jb25jYXQoWyctdCcgKyB0eXBlLCAnLXBpcGUnXSk7XHJcblxyXG4gICAgICAgIGxldCBjaGlsZDogdHlwZW9mIENoaWxkUHJvY2VzcztcclxuICAgICAgICBpZiAodHlwZSA9PT0gT3V0cHV0VHlwZS5QTkcpIHtcclxuICAgICAgICAgICAgY2hpbGQgPSBleGVjKGFyZ3Muam9pbihcIiBcIiksIHtlbmNvZGluZzogJ2JpbmFyeScsIGN3ZDogcGF0aH0pO1xyXG4gICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgIGNoaWxkID0gZXhlYyhhcmdzLmpvaW4oXCIgXCIpLCB7ZW5jb2Rpbmc6ICd1dGYtOCcsIGN3ZDogcGF0aH0pO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgbGV0IHN0ZG91dDogYW55O1xyXG4gICAgICAgIGxldCBzdGRlcnI6IGFueTtcclxuXHJcbiAgICAgICAgaWYgKGNoaWxkLnN0ZG91dCkge1xyXG4gICAgICAgICAgICBjaGlsZC5zdGRvdXQub24oXCJkYXRhXCIsIChkYXRhOiBhbnkpID0+IHtcclxuICAgICAgICAgICAgICAgIGlmIChzdGRvdXQgPT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHN0ZG91dCA9IGRhdGE7XHJcbiAgICAgICAgICAgICAgICB9IGVsc2Ugc3Rkb3V0ICs9IGRhdGE7XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgaWYgKGNoaWxkLnN0ZGVycikge1xyXG4gICAgICAgICAgICBjaGlsZC5zdGRlcnIub24oJ2RhdGEnLCAoZGF0YTogYW55KSA9PiB7XHJcbiAgICAgICAgICAgICAgICBpZiAoc3RkZXJyID09PSB1bmRlZmluZWQpIHtcclxuICAgICAgICAgICAgICAgICAgICBzdGRlcnIgPSBkYXRhO1xyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHN0ZGVyciArPSBkYXRhO1xyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XHJcbiAgICAgICAgICAgIGNoaWxkLm9uKFwiZXJyb3JcIiwgcmVqZWN0KTtcclxuXHJcbiAgICAgICAgICAgIGNoaWxkLm9uKFwiY2xvc2VcIiwgKGNvZGU6IGFueSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgaWYoc3Rkb3V0ID09PSB1bmRlZmluZWQpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpZiAoY29kZSA9PT0gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBPdXRwdXRUeXBlLlBORykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBidWYgPSBuZXcgQnVmZmVyKHN0ZG91dCwgJ2JpbmFyeScpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKGJ1Zi50b1N0cmluZygnYmFzZTY0JykpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIHJlc29sdmUoc3Rkb3V0KTtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNvZGUgPT09IDEpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKHN0ZG91dCk7XHJcbiAgICAgICAgICAgICAgICAgICAgcmVqZWN0KG5ldyBFcnJvcihzdGRlcnIpKTtcclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGUgPT09IE91dHB1dFR5cGUuUE5HKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGJ1ZiA9IG5ldyBCdWZmZXIoc3Rkb3V0L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yRnJvbVNldHRpbmdzWzBdID09PSAnficpIHtcclxuICAgICAgICAgICAgLy8gQXMgYSB3b3JrYXJvdW5kLCBJJ20gbm90IHN1cmUgd2hhdCB3b3VsZCBpc0Fic29sdXRlKCkgcmV0dXJuIHdpdGggdW5peC1saWtlIHBhdGhcclxuICAgICAgICAgICAgamFyRnVsbFBhdGggPSB1c2VySW5mbygpLmhvbWVkaXIgKyBqYXJGcm9tU2V0dGluZ3Muc2xpY2UoMSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBpZiAoaXNBYnNvbHV0ZShqYXJGcm9tU2V0dGluZ3MpKSB7XHJcbiAgICAgICAgICAgICAgICBqYXJGdWxsUGF0aCA9IGphckZyb21TZXR0aW5ncztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIC8vIHRoZSBkZWZhdWx0IHNlYXJjaCBwYXRoIGlzIGN1cnJlbnQgdmF1bHRcclxuICAgICAgICAgICAgICAgIGphckZ1bGxQYXRoID0gcmVzb2x2ZShwYXRoLCBqYXJGcm9tU2V0dGluZ3MpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBpZiAoamFyRnVsbFBhdGgubGVuZ3RoID09IDApIHtcclxuICAgICAgICAgICAgdGhyb3cgRXJyb3IoJ0ludmFsaWQgbG9jYWwgamFyIGZpbGUnKTtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGlmKGphckZ1bGxQYXRoLmVuZHNXaXRoKCcuamFyJykpIHtcclxuICAgICAgICAgICAgcmV0dXJuIFtcclxuICAgICAgICAgICAgICAgIHRoaXMucGx1Z2luLnNldHRpbmdzLmphdmFQYXRoLCAnLWphcicsICdcIicgKyBqYXJGdWxsUGF0aCArICdcIicsICctRGphdmEuYXd0LmhlYWRsZXNzPXRydWUnLCAnLWNoYXJzZXQnLCAndXRmLTgnLCAnLWdyYXB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HRoaXMucGx1Z2luLmFwcC5tZXRhZGF0YUNhY2hlLmdldEZpcnN0TGlua3BhdGhEZXN0KHNwbGl0WzBdLCBwYXRoKTtcclxuICAgICAgICAgICAgaWYoIWZpbGUpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiBcIkZpbGUgd2l0aCBuYW1lOiBcIiArIHNwbGl0WzBdICsgXCIgbm90IGZvdW5kXCI7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgbGV0IGFsaWFzID0gZmlsZS5iYXNlbmFtZTtcclxuICAgICAgICAgICAgaWYoZmlsZXR5cGUgPT09IFwicG5nXCIpIHtcclxuICAgICAgICAgICAgICAgIC8vQHRzLWlnbm9yZVxyXG4gICAgICAgICAgICAgICAgY29uc3QgdXJsID0gdGhpcy5wbHVnaW4uYXBwLmdldE9ic2lkaWFuVXJsKGZpbGUpO1xyXG4gICAgICAgICAgICAgICAgaWYgKHNwbGl0WzFdKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgYWxpYXMgPSBzcGxpdFsxXTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHJldHVybiBcIltbXCIgKyB1cmwgKyBcIiBcIiArIGFsaWFzICsgXCJdXVwiO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHJldHVybiBcIltbXCIgKyBmaWxlLmJhc2VuYW1lICsgXCJdXVwiO1xyXG4gICAgICAgIH0pKTtcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIGdldCB0aGUgYWJzb2x1dGUgcGF0aCBvbiB0aGUgdXNlcnMgY29tcHV0ZXJcclxuICAgICAqIEBwYXJhbSBwYXRoIHZhdWx0IGxvY2FsIHBhdGhcclxuICAgICAqL1xyXG4gICAgcHVibGljIGdldEZ1bGxQYXRoKHBhdGg6IHN0cmluZykge1xyXG4gICAgICAgIGlmIChwYXRoLmxlbmd0aCA9PT0gMCkge1xyXG4gICAgICAgICAgICAvL0B0cy1pZ25vcmVc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0gPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpdGVtXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2V0VGl0bGUoJ0NvcHkgZGlhZ3JhbSBzb3VyY2UnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNldEljb24oJ2NsaXBib2FyZC1jb3B5JylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5vbkNsaWNrKGFzeW5jICgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBuYXZpZ2F0b3IuY2xpcGJvYXJkLndyaXRlVGV4dChvcmlnaW5hbFNvdXJjZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgLmFkZEl0ZW0oaXRlbSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRUaXRsZSgnQ29weSBkaWFncmFtJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRJY29uKCdpbWFnZScpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAub25DbGljayhhc3luYyAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coZWwpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGltZyA9IGVsLnF1ZXJ5U2VsZWN0b3IoJ2ltZycpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbWcpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5yZW5kZXJUb0Jsb2IoXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnQW4gZXJyb3Igb2NjdXJyZWQgd2hpbGUgY29weWluZyBpbWFnZSB0byBjbGlwYm9hcmQnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXN5bmMgKGJsb2IpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBuYXZpZ2F0b3IuY2xpcGJvYXJkLndyaXRlKFtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IENsaXBib2FyZEl0ZW0oe1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJpbWFnZS9wbmdcIjogYmxvYlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBOb3RpY2UoJ0RpYWdyYW0gY29waWVkIHRvIGNsaXBib2FyZCcpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzdmcgPSBlbC5xdWVyeVNlbGVjdG9yKCdzdmcnKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3ZnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IG5hdmlnYXRvci5jbGlwYm9hcmQud3JpdGVUZXh0KHN2Zy5vdXRlckhUTUwpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgTm90aWNlKCdEaWFncmFtIGNvcGllZCB0byBjbGlwYm9hcmQnKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY29kZSA9IGVsLnF1ZXJ5U2VsZWN0b3IoJ2NvZGUnKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29kZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBuYXZpZ2F0b3IuY2xpcGJvYXJkLndyaXRlVGV4dChjb2RlLmlubmVyVGV4dCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBOb3RpY2UoJ0RpYWdyYW0gY29waWVkIHRvIGNsaXBib2FyZCcpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgLmFkZEl0ZW0oaXRlbSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRUaXRsZSgnRXhwb3J0IGRpYWdyYW0nKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNldEljb24oJ2ltYWdlLWZpbGUnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLm9uQ2xpY2soYXN5bmMgKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGltZyA9IGVsLnF1ZXJ5U2VsZWN0b3IoJ2ltZycpO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW1nKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyVG9CbG9iKGltZywgJ0FuIGVycm9yIG9jY3VycmVkIHdoaWxlIGV4cG9ydGluZyB0aGUgZGlhZ3JhbScsIGFzeW5jIChibG9iKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBmaWxlbmFtZSA9IGF3YWl0IHRoaXMuZ2V0RmlsZVBhdGgoc291cmNlLCBjdHgsICdwbmcnKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGJ1ZmZlciA9IGF3YWl0IGJsb2IuYXJyYXlCdWZmZXIoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGZpbGUgPSB0aGlzLmdldEZpbGUoZmlsZW5hbWUpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLnBsdWdpbi5hcHAudmF1bHQubW9kaWZ5QmluYXJ5KGZpbGUsIGJ1ZmZlcik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMucGx1Z2luLmFwcC52YXVsdC5jcmVhdGVCaW5hcnkoZmlsZW5hbWUsIGJ1ZmZlcik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IE5vdGljZShgRGlhZ3JhbSBleHBvcnRlZCB0byAnJHtmaWxlbmFtZX0nYCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3ZnID0gZWwucXVlcnlTZWxlY3Rvcignc3ZnJyk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN2Zykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLnNhdmVUZXh0RmlsZShzb3VyY2UsIGN0eCwgJ3N2ZycsIHN2Zy5vdXRlckhUTUwpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY29kZSA9IGVsLnF1ZXJ5U2VsZWN0b3IoJ2NvZGUnKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29kZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLnNhdmVUZXh0RmlsZShzb3VyY2UsIGN0eCwgJ3R4dCcsIGNvZGUuaW5uZXJUZXh0KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgbWVudS5zaG93QXRNb3VzZUV2ZW50KGV2ZW50KTtcclxuICAgICAgICAgICAgfSlcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgcmVuZGVyVG9CbG9iID0gKGltZzogSFRNTEltYWdlRWxlbWVudCwgZXJyb3JNZXNzYWdlOiBzdHJpbmcsIGhhbmRsZUJsb2I6IChibG9iOiBCbG9iKSA9PiBQcm9taXNlPHZvaWQ+KSA9PiB7XHJcbiAgICAgICAgY29uc3QgaW1hZ2UgPSBuZXcgSW1hZ2UoKTtcclxuICAgICAgICBpbWFnZS5jcm9zc09yaWdpbiA9ICdhbm9ueW1vdXMnO1xyXG4gICAgICAgIGltYWdlLnNyYyA9IGltZy5zcmM7XHJcbiAgICAgICAgaW1hZ2UuYWRkRXZlbnRMaXN0ZW5lcignbG9hZCcsICgpID0+IHtcclxuICAgICAgICAgICAgY29uc3QgY2FudmFzID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnY2FudmFzJyk7XHJcbiAgICAgICAgICAgIGNhbnZhcy53aWR0aCA9IGltYWdlLndpZHRoO1xyXG4gICAgICAgICAgICBjYW52YXMuaGVpZ2h0ID0gaW1hZ2UuaGVpZ2h0O1xyXG4gICAgICAgICAgICBjb25zdCBjdHggPSBjYW52YXMuZ2V0Q29udGV4dCgnMmQnKTtcclxuICAgICAgICAgICAgY3R4LmZpbGxTdHlsZSA9ICcjZmZmJztcclxuICAgICAgICAgICAgY3R4LmZpbGxSZWN0KDAsIDAsIGNhbnZhcy53aWR0aCwgY2FudmFzLmhlaWdodCk7XHJcbiAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoaW1hZ2UsIDAsIDApO1xyXG4gICAgICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICAgICAgY2FudmFzLnRvQmxvYihhc3luYyAoYmxvYikgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IGhhbmRsZUJsb2IoYmxvYik7XHJcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3IE5vdGljZShlcnJvck1lc3NhZ2UpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKGVycm9yKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcclxuICAgICAgICAgICAgICAgIG5ldyBOb3RpY2UoZXJyb3JNZXNzYWdlKTtcclxuICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoZXJyb3IpO1xyXG4gICAgICAgICAgICB9XH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uY29uc3Qgc3luY0Fubm90YXRpb24gPSBBbm5vdGF0aW9uLmRlZmluZTxib29sZWFuPigpO1xyXG5cclxuZnVuY3Rpb24gc3luY0Rpc3BhdGNoKGZyb206IG51bWJlcikge1xyXG4gICAgcmV0dXJuICh0cjogVHJhbnNhY3Rpb24pID0+IHtcclxuICAgICAgICB2aWV3c1tmcm9tXS51cGRhdGUoW3RyXSk7XHJcbiAgICAgICAgaWYgKHRyLmNoYW5nZXMgJiYgdHIuYW5ub3RhdGlvbiAmJiAhdHIuY2hhbmdlcy5lbXB0eSAmJiAhdHIuYW5ub3RhdGlvbihzeW5jQW5ub3RhdGlvbikpIHtcclxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB2aWV3cy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgaWYoaSAhPT0gZnJvbSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHZpZXdzW2ldLmRpc3BhdGNoKHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2hhbmdlczogdHIuY2hhbmdlcyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgYW5ub3RhdGlvbnM6IHN5bmNBbm5vdGF0aW9uLm9mKHRydWUpXHJcbiAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICB9XHJcblxyXG4gICAgfVxyXG59XHJcblxyXG5leHBvcnQgY2xhc3MgUHVtbFZpZXcgZXh0ZW5kcyBUZXh0RmlsZVZpZXcge1xyXG4gICAgZWRpdG9yOiBFZGl0b3JWaWV3O1xyXG4gICAgcHJldmlld0VsOiBIVE1MRWxlbWVudDtcclxuICAgIHNvdXJjZUVsOiBIVE1MRWxlbWVudDtcclxuICAgIGNoYW5nZU1vZGVCdXR0b246IEhUTUxFbGVtZW50O1xyXG4gICAgY3VycmVudFZpZXc6ICdzb3VyY2UnIHwgJ3ByZXZpZXcnO1xyXG4gICAgcGx1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ICAgICAgICAgICAgICBleHRlbnNpb25zOiB0aGlzLmV4dGVuc2lvbnNcclxuICAgICAgICAgICAgIH0pKTtcclxuXHJcbiAgICAgICAgIH1lbHNlIHtcclxuICAgICAgICAgICAgIHRoaXMuZWRpdG9yLmRpc3BhdGNoKHtcclxuICAgICAgICAgICAgICAgICBjaGFuZ2VzOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgIGZyb206IDAsXHJcbiAgICAgICAgICAgICAgICAgICAgIHRvOiB0aGlzLmVkaXRvci5zdGF0ZS5kb2MubGVuZ3RoLFxyXG4gICAgICAgICAgICAgICAgICAgICBpbnNlcnQ6IGRhdGEsXHJcbiAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgfSlcclxuICAgICAgICAgfVxyXG4gICAgICAgIC8vIGlmIHdlJ3JlIGluIHByZXZpZXcgdmlldywgYWxzbyByZW5kZXIgdGhhdFxyXG4gICAgICAgIGlmICh0aGlzLmN1cnJlbnRWaWV3ID09PSAncHJldmlldycpIHRoaXMucmVuZGVyUHJldmlldygpO1xyXG4gICAgfVxyXG5cclxuICAgIC8vIGNsZWFyIHRoZSBlZGl0b3IsIGV0Y1xyXG4gICAgY2xlYXIoKSB7XHJcbiAgICAgICAgdGhpcy5wcmV2aWV3RWwuZW1wdHkoKTtcclxuICAgICAgICB0aGlzLmRhdGEgPSBudWxsO1xyXG4gICAgfVxyXG5cclxuICAgIGdldERpc3BsYXlUZXh0KCkge1xyXG4gICAgICAgIGlmICh0aGlzLmZpbGUpIHJldHVybiB0aGlzLmZpbGUuYmFzZW5hbWU7XHJcbiAgICAgICAgZWxzZSByZXR1cm4gXCJQbGFudFVNTCAobm8gZmlsZSlcIjtcclxuICAgIH1cclxuXHJcbiAgICBjYW5BY2NlcHRFeHRlbnNpb24oZXh0ZW5zaW9uOiBzdHJpbmcpIHtcclxuICAgICAgICByZXR1cm4gZXh0ZW5zaW9uID09ICdwdW1sJztcclxuICAgIH1cclxuXHJcbiAgICBnZXRJY29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