laradumps-js 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +5 -2
- package/dist/laradumps.min.js +1 -1
- package/dist/src/LaraDumps.js +4 -1
- package/dist/src/LaraDumps.js.map +1 -1
- package/package.json +1 -1
- package/src/LaraDumps.ts +4 -1
- package/types.d.ts +1 -1
package/dist/index.js
CHANGED
@@ -1834,7 +1834,10 @@ var Screen_1 = __importDefault(__webpack_require__(/*! ./Screen */ "./src/Screen
|
|
1834
1834
|
var Table_1 = __importDefault(__webpack_require__(/*! ./Table */ "./src/Table.js"));
|
1835
1835
|
var TimeTrack_1 = __importDefault(__webpack_require__(/*! ./TimeTrack */ "./src/TimeTrack.js"));
|
1836
1836
|
var Validate_1 = __importDefault(__webpack_require__(/*! ./Validate */ "./src/Validate.js"));
|
1837
|
-
var
|
1837
|
+
var defaultHost = 'http://127.0.0.1:9191';
|
1838
|
+
var LaraDumps = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ instanceId: null, requestId: null, server: null, params: [], generateIds: function () {
|
1839
|
+
var _a, _b;
|
1840
|
+
this.server = "".concat((_b = (_a = globalThis.CONFIG_LARADUMPS) === null || _a === void 0 ? void 0 : _a.host) !== null && _b !== void 0 ? _b : defaultHost, "/api/dumps");
|
1838
1841
|
this.instanceId = this.makeUUID();
|
1839
1842
|
this.requestId = this.makeUUID();
|
1840
1843
|
return this;
|
@@ -7128,4 +7131,4 @@ module.exports = axios;
|
|
7128
7131
|
/******/
|
7129
7132
|
/******/ })()
|
7130
7133
|
;
|
7131
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFhOztBQUViLG1CQUFtQixtQkFBTyxDQUFDLDZEQUFlOztBQUUxQyxlQUFlLG1CQUFPLENBQUMsOENBQUk7O0FBRTNCOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FB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AoZyA9IDAsIG9wWzBdICYmIChfID0gMCkpLCBfKSB0cnkge1xuICAgICAgICAgICAgaWYgKGYgPSAxLCB5ICYmICh0ID0gb3BbMF0gJiAyID8geVtcInJldHVyblwiXSA6IG9wWzBdID8geVtcInRocm93XCJdIHx8ICgodCA9IHlbXCJyZXR1cm5cIl0pICYmIHQuY2FsbCh5KSwgMCkgOiB5Lm5leHQpICYmICEodCA9IHQuY2FsbCh5LCBvcFsxXSkpLmRvbmUpIHJldHVybiB0O1xuICAgICAgICAgICAgaWYgKHkgPSAwLCB0KSBvcCA9IFtvcFswXSAmIDIsIHQudmFsdWVdO1xuICAgICAgICAgICAgc3dpdGNoIChvcFswXSkge1xuICAgICAgICAgICAgICAgIGNhc2UgMDogY2FzZSAxOiB0ID0gb3A7IGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgNDogXy5sYWJlbCsrOyByZXR1cm4geyB2YWx1ZTogb3BbMV0sIGRvbmU6IGZhbHNlIH07XG4gICAgICAgICAgICAgICAgY2FzZSA1OiBfLmxhYmVsKys7IHkgPSBvcFsxXTsgb3AgPSBbMF07IGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIGNhc2UgNzogb3AgPSBfLm9wcy5wb3AoKTsgXy50cnlzLnBvcCgpOyBjb250aW51ZTtcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICBpZiAoISh0ID0gXy50cnlzLCB0ID0gdC5sZW5ndGggPiAwICYmIHRbdC5sZW5ndGggLSAxXSkgJiYgKG9wWzBdID09PSA2IHx8IG9wWzBdID09PSAyKSkgeyBfID0gMDsgY29udGludWU7IH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wWzBdID09PSAzICYmICghdCB8fCAob3BbMV0gPiB0WzBdICYmIG9wWzFdIDwgdFszXSkpKSB7IF8ubGFiZWwgPSBvcFsxXTsgYnJlYWs7IH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wWzBdID09PSA2ICYm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ICAgICAgICAgICA/IHBhcmFtc1swXVxuICAgICAgICAgICAgOiBwYXJhbXM7XG4gICAgICAgIHRoaXMucHJvbWlzZSA9IFByb21pc2UuYWxsKE9iamVjdC52YWx1ZXMoZGF0YSkubWFwKGZ1bmN0aW9uIChwYXJhbSwgaW5kZXgpIHtcbiAgICAgICAgICAgIHZhciBsYWJlbCA9IE9iamVjdC5rZXlzKGRhdGEpW2luZGV4XTtcbiAgICAgICAgICAgIG1hcmtzW2xhYmVsXSA9IHtcbiAgICAgICAgICAgICAgICBzdGFydF90aW1lOiBEYXRlLm5vdygpLFxuICAgICAgICAgICAgICAgIGVuZF90aW1lOiBudWxsLFxuICAgICAgICAgICAgICAgIHRvdGFsX3RpbWU6IG51bGxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24gKHJlc29sdmUpIHsgcmV0dXJuIF9fYXdhaXRlcihfdGhpcywgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gX19nZW5lcmF0b3IodGhpcywgZnVuY3Rpb24gKF9hKSB7XG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoX2EubGFiZWwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMDogcmV0dXJuIFs0IC8qeWllbGQqLywgcGFyYW0ocmVzb2x2ZSldO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9hLnNlbnQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIgLypyZXR1cm4qL107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pOyB9KS5maW5hbGx5KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBtYXJrc1tsYWJlbF0uZW5kX3RpbWUgPSBEYXRlLm5vdygpO1xuICAgICAgICAgICAgICAgIG1hcmtzW2xhYmVsXS50b3RhbF90aW1lID0gbWFya3NbbGFiZWxdLmVuZF90aW1lIC0gbWFya3NbbGFiZWxdLnN0YXJ0X3RpbWU7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSkpLnRoZW4oZnVuY3Rpb24gKCkgeyByZXR1cm4gbWFya3M7IH0pLmZpbmFsbHkoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgX3RoaXMuc2VuZE1hcmtzKG1hcmtzKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH0sXG4gICAgc2VuZE1hcmtzOiBmdW5jdGlvbiAobWFya3MpIHtcbiAgICAgICAgdmFyIGRhdGFNYXJrcyA9IHtcbiAgICAgICAgICAgIEZhc3Rlc3Q6IFtdXG4gICAgICAgIH07XG4gICAgICAgIE9iamVjdC52YWx1ZXMobWFya3MpLmZvckVhY2goZnVuY3Rpb24gKG1hcmssIGluZGV4KSB7XG4gICAgICAgICAgICB2YXIgX2E7XG4gICAgICAgICAgICB2YXIgbGFiZWwgPSBPYmplY3Qua2V5cyhtYXJrcylbaW5kZXhdO1xuICAgICAgICAgICAgaWYgKCFpc05hTihwYXJzZUludChsYWJlbCkpKSB7XG4gICAgICAgICAgICAgICAgbGFiZWwgPSBcIkNsb3N1cmUgXCIuY29uY2F0KGxhYmVsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICgoKF9hID0gZGF0YU1hcmtzLkZhc3Rlc3RbMV0pICE9PSBudWxsICYmIF9hICE9PSB2b2lkIDAgPyBfYSA6IG1hcmsuZW5kX3RpbWUgKyAxKSA+IG1hcmsuZW5kX3RpbWUpIHtcbiAgICAgICAgICAgICAgICBkYXRhTWFya3MuRmFzdGVzdCA9IFtcbiAgICAgICAgICAgICAgICAgICAgbGFiZWwsXG4gICAgICAgICAgICAgICAgICAgIG1hcmsuZW5kX3RpbWVcbiAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZGF0YU1hcmtzW2xhYmVsXSA9IFtcbiAgICAgICAgICAgICAgICBcIlN0YXJ0IHRpbWU6IFwiLmNvbmNhdChuZXcgRGF0ZShtYXJrLnN0YXJ0X3RpbWUpLnRvTG9jYWxlU3RyaW5nKCksIFwiXFxuICAgICAgICAgICAgICAgIEVuZCB0aW1lOiBcIikuY29uY2F0KG5ldyBEYXRlKG1hcmsuZW5kX3RpbWUpLnRvTG9jYWxlU3RyaW5nKCksIFwiXFxuICAgICAgICAgICAgICAgIFRvdGFsIHRpbWU6IFwiKS5jb25jYXQobWFyay50b3RhbF90aW1lLCBcIiBtc1wiKSxcbiAgICAgICAgICAgICAgICBtYXJrLmVuZF90aW1lXG4gICAgICAgICAgICBdO1xuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHRoaXMudGFibGVWMihkYXRhTWFya3MsIFwiQmVuY2htYXJrXCIpO1xuICAgIH1cbn07XG4vLyMgc291cmNlTWFwcGluZ1VSTD1CZW5jaG1hcmsuanMubWFwIiwiXCJ1c2Ugc3RyaWN0XCI7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHsgdmFsdWU6IHRydWUgfSk7XG5leHBvcnRzLmRlZmF1bHQgPSB7XG4gICAgY29sb3I6IGZ1bmN0aW9uIChjb2xvcikge1xuICAgICAgICByZXR1cm4gdGhpcy5zZW5kKFwiY29sb3JcIiwge1xuICAgICAgICAgICAgXCJjb2xvclwiOiB7XG4gICAgICAgICAgICAgICAgXCJjb2xvclwiOiBjb2xvclxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9LFxuICAgIGluZm86IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuYmx1ZSgpO1xuICAgIH0sXG4gICAgc3VjY2VzczogZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5ncmV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ICAgICAgICAgIGlmICghdGhpcy5pc1ZhbGlkSnNvbihqc29uKSkge1xuICAgICAgICAgICAgICAgIHRoaXMuZHVtcChqc29uKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuc2VuZEpzb24oanNvbik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICB0aGlzLmR1bXAodGhpcy5pbnNwZWN0KGpzb24pKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9XG4gICAgfSxcbiAgICBpbnNwZWN0OiBmdW5jdGlvbiAoanNvbikge1xuICAgICAgICByZXR1cm4gdGhpcy5jb252ZXJ0SlNPTlN0cmluZ1RvSlNPTigoMCwgdXRpbF8xLmluc3BlY3QpKGpzb24pKTtcbiAgICB9LFxuICAgIGNvbnZlcnRKU09OU3RyaW5nVG9KU09OOiBmdW5jdGlvbiAob2JqZWN0KSB7XG4gICAgICAgIHZhciBmb3JtYXR0ZWQgPSBvYmplY3RcbiAgICAgICAgICAgIC5yZXBsYWNlKC8oW3ssXVxccyopKFxcdyspXFxzKjovZywgJyQxXCIkMlwiOicpXG4gICAgICAgICAgICAucmVwbGFjZSgvOlxccyonKFteJ10qKScvZywgJzogXCIkMVwiJylcbiAgICAgICAgICAgIC5yZXBsYWNlKC91bmRlZmluZWQvZywgJ251bGwnKVxuICAgICAgICAgICAgLnJlcGxhY2UoL1xcW09iamVjdFxcXS9nLCAne30nKVxuICAgICAgICAgICAgLnJlcGxhY2UoLyhcXHJcXG58XFxufFxccikvZ20sIFwiXCIpO1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmV0dXJuIEpTT04ucGFyc2UoZm9ybWF0dGVkKTtcbiAgICAgICAgfVxuICAgICAgICBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICAgIHJldHVybiBvYmplY3Q7XG4gICAgICAgIH1cbiAgICB9LFxuICAgIGlzVmFsaWRKc29uOiBmdW5jdGlvbiAoanNvbikge1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgSlNPTi5wYXJzZShqc29uKTtcbiAgICAgICAgfVxuICAgICAgICBjYXRjaCAoZSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH0sXG4gICAgc2VuZEpzb246IGZ1bmN0aW9uIChqc29uKSB7XG4gICAgICAgIGpzb24gPSB0eXBlb2YgKGpzb24pICE9PSAnc3RyaW5nJ1xuICAgICAgICAgICAgPyBKU09OLnN0cmluZ2lmeShqc29uKVxuICAgICAgICAgICAgOiBqc29uO1xuICAgICAgICByZXR1cm4gdGhpcy5zZW5kKFwianNvblwiLCB7XG4gICAgICAgICAgICBcImpzb25cIjoge1xuICAgICAgICAgICAgICAgIFwic3RyaW5nXCI6IGpzb24sXG4gICAgICAgICAgICAgICAgXCJvcmlnaW5hbF9jb250ZW50XCI6IGpzb25cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfSxcbn07XG4vLyMgc291cmNlTWFwcGluZ1VSTD1Kc29uLmpzLm1hcCIsIlwidXNlIHN0cmljdFwiO1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFwiX19lc01vZHVsZVwiLCB7IHZhbHVlOiB0cnVlIH0pO1xuZXhwb3J0cy5kZWZhdWx0ID0ge1xuICAgIGxhYmVsOiBmdW5jdGlvbiAobGFiZWwpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuc2VuZChcImxhYmVsXCIsIHtcbiAgICAgICAgICAgIFwibGFiZWxcIjoge1xuICAgICAgICAgICAgICAgIFwibGFiZWxcIjogbGFiZWxcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfVxufTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPUxhYmVsLmpzLm1hcCIsIlwidXNlIHN0cmlj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aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuc2VuZChcImNsZWFyXCIsIHtcbiAgICAgICAgICAgIFwiY2xlYXJcIjoge31cbiAgICAgICAgfSk7XG4gICAgfSwgZGllOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcihcIkV4Y2VwdGlvbiB0byBzdG9wIHRoZSBleGVjdXRpb24hXCIpO1xuICAgIH0sIGxhYmVsOiBmdW5jdGlvbiAobGFiZWwpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuc2VuZChcImxhYmVsXCIsIHtcbiAgICAgICAgICAgIFwibGFiZWxcIjoge1xuICAgICAgICAgICAgICAgIGxhYmVsOiBsYWJlbFxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9LCBkdW1wOiBmdW5jdGlvbiAocGFyYW0pIHtcbiAgICAgICAgdmFyIHR5cGUgPSB0eXBlb2YgKHBhcmFtKTtcbiAgICAgICAgdmFyIGlzVmFsaWRKc29uID0gdHlwZSA9PT0gJ3N0cmluZycgJiYgdGhpcy5pc1ZhbGlkSnNvbihwYXJhbSk7XG4gICAgICAgIGlmICh0eXBlID09PSBcIm9iamVjdFwiIHx8IGlzVmFsaWRKc29uKSB7XG4gICAgICAgICAgICB0aGlzLmpzb24ocGFyYW0pO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnNlbmQoXCJkdW1wXCIsIHtcbiAgICAgICAgICAgIFwiZHVtcFwiOiB7XG4gICAgICAgICAgICAgICAgXCJkdW1wXCI6IHBhcmFtLFxuICAgICAgICAgICAgICAgIFwib3JpZ2luYWxfY29udGVudFwiOiBwYXJhbSxcbiAgICAgICAgICAgICAgICBcInZhcmlhYmxlX3R5cGVcIjogdHlwZSxcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfSwgc2VuZDogZnVuY3Rpb24gKHR5cGUsIGRhdGEpIHtcbiAgICAg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gIGxldCBkb25lO1xuICBsZXQgX29uRmluaXNoID0gKGUpID0+IHtcbiAgICBpZiAoIWRvbmUpIHtcbiAgICAgIGRvbmUgPSB0cnVlO1xuICAgICAgb25GaW5pc2ggJiYgb25GaW5pc2goZSk7XG4gICAgfVxuICB9O1xuXG4gIHJldHVybiBuZXcgUmVhZGFibGVTdHJlYW0oe1xuICAgIGFzeW5jIHB1bGwoY29udHJvbGxlcikge1xuICAgICAgdHJ5IHtcbiAgICAgICAgY29uc3Qge2RvbmUsIHZhbHVlfSA9IGF3YWl0IGl0ZXJhdG9yLm5leHQoKTtcblxuICAgICAgICBpZiAoZG9uZSkge1xuICAgICAgICAgX29uRmluaXNoKCk7XG4gICAgICAgICAgY29udHJvbGxlci5jbG9zZSgpO1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCBsZW4gPSB2YWx1ZS5ieXRlTGVuZ3RoO1xuICAgICAgICBpZiAob25Qcm9ncmVzcykge1xuICAgICAgICAgIGxldCBsb2FkZWRCeXRlcyA9IGJ5dGVzICs9IGxlbjtcbiAgICAgICAgICBvblByb2dyZXNzKGxvYWRlZEJ5dGVzKTtcbiAgICAgICAgfVxuICAgICAgICBjb250cm9sbGVyLmVucXVldWUobmV3IFVpbnQ4QXJyYXkodmFsdWUpKTtcbiAgICAgIH0gY2F0Y2ggKGVycikge1xuICAgICAgICBfb25GaW5pc2goZXJyKTtcbiAgICAgICAgdGhyb3cgZXJyO1xuICAgICAgfVxuICAgIH0sXG4gICAgY2FuY2VsKHJlYXNvbikge1xuICAgICAgX29uRmluaXNoKHJlYXNvbik7XG4gICAgICByZXR1cm4gaXRlcmF0b3IucmV0dXJuKCk7XG4gICAgfVxuICB9LCB7XG4gICAgaGlnaFdhdGVyTWFyazogMlxuICB9KVxufTtcblxuY29uc3QgaXNGZXRjaFN1cHBvcnRlZCA9IHR5cGVvZiBmZXRjaCA9PT0gJ2Z1bmN0aW9uJyAmJiB0eXBlb2YgUmV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HJpbmcoZXJyLnN0YWNrKS5lbmRzV2l0aChzdGFjay5yZXBsYWNlKC9eLitcXG4uK1xcbi8sICcnKSkpIHtcbiAgICAgICAgICAgIGVyci5zdGFjayArPSAnXFxuJyArIHN0YWNrO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgIC8vIGlnbm9yZSB0aGUgY2FzZSB3aGVyZSBcInN0YWNrXCIgaXMgYW4gdW4td3JpdGFibGUgcHJvcGVydHlcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICB0aHJvdyBlcnI7XG4gICAgfVxuICB9XG5cbiAgX3JlcXVlc3QoY29uZmlnT3JVcmwsIGNvbmZpZykge1xuICAgIC8qZXNsaW50IG5vLXBhcmFtLXJlYXNzaWduOjAqL1xuICAgIC8vIEFsbG93IGZvciBheGlvcygnZXhhbXBsZS91cmwnWywgY29uZmlnXSkgYSBsYSBmZXRjaCBBUElcbiAgICBpZiAodHlwZW9mIGNvbmZpZ09yVXJsID09PSAnc3RyaW5nJykge1xuICAgICAgY29uZmlnID0gY29uZmlnIHx8IHt9O1xuICAgICAgY29uZmlnLnVybCA9IGNvbmZpZ09yVXJsO1xuICAgIH0gZWxzZSB7XG4gICAgICBjb25maWcgPSBjb25maWdPclVybCB8fCB7fTtcbiAgICB9XG5cbiAgICBjb25maWcgPSBtZXJnZUNvbmZpZyh0aGlzLmRlZmF1bHRzLCBjb25maWcpO1xuXG4gICAgY29uc3Qge3RyYW5zaXRpb25hbCwgcGFyYW1zU2VyaWFsaXplciwgaGVhZGVyc30gPSBjb25maWc7XG5cbiAgICBpZiAodHJhbnNpdGlvbmFsICE9PSB1bmRlZmluZWQpIHtcbiAgICAgIHZhbGlkYXRvci5hc3NlcnRPcHRpb25zKHRyYW5zaXRpb25hbCwge1xuICAgICAgICBzaWxlbnRKU09OUGFyc2luZzogdmFsaWRhdG9ycy50cmFuc2l0aW9uYWwodmFsaWRhdG9ycy5ib29sZWFuKSxcbiAg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ArPSBhcnJbaV07XG4gICAgICAgIGlmIChpICsgMSA8IGFyci5sZW5ndGgpIHtcbiAgICAgICAgICAgIHN0ciArPSBqb2luZXI7XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIHN0cjtcbn07XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gYmluZCh0aGF0KSB7XG4gICAgdmFyIHRhcmdldCA9IHRoaXM7XG4gICAgaWYgKHR5cGVvZiB0YXJnZXQgIT09ICdmdW5jdGlvbicgfHwgdG9TdHIuYXBwbHkodGFyZ2V0KSAhPT0gZnVuY1R5cGUpIHtcbiAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcihFUlJPUl9NRVNTQUdFICsgdGFyZ2V0KTtcbiAgICB9XG4gICAgdmFyIGFyZ3MgPSBzbGljeShhcmd1bWVudHMsIDEpO1xuXG4gICAgdmFyIGJvdW5kO1xuICAgIHZhciBiaW5kZXIgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmICh0aGlzIGluc3RhbmNlb2YgYm91bmQpIHtcbiAgICAgICAgICAgIHZhciByZXN1bHQgPSB0YXJnZXQuYXBwbHkoXG4gICAgICAgICAgICAgICAgdGhpcyxcbiAgICAgICAgICAgICAgICBjb25jYXR0eShhcmdzLCBhcmd1bWVudHMpXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgaWYgKE9iamVjdChyZXN1bHQpID09PSByZXN1bHQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRhcmdldC5hcHBseShcbiAgICAgICAgICAgIHRoYXQsXG4gICAgICAgICAgICBjb25jYXR0eShhcmdzLCBhcmd1bWVudHMpXG4gICAgICAgICk7XG5cbiAgICB9O1xuXG4gICAgdmFyIGJvdW5kTGVuZ3RoID0gbWF4KDAsIHRhcmdldC5sZW5ndGgg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AgICAgICAgPyBwYXJhbXNbMF1cbiAgICAgICAgICAgIDogcGFyYW1zO1xuICAgICAgICB0aGlzLnByb21pc2UgPSBQcm9taXNlLmFsbChPYmplY3QudmFsdWVzKGRhdGEpLm1hcChmdW5jdGlvbiAocGFyYW0sIGluZGV4KSB7XG4gICAgICAgICAgICB2YXIgbGFiZWwgPSBPYmplY3Qua2V5cyhkYXRhKVtpbmRleF07XG4gICAgICAgICAgICBtYXJrc1tsYWJlbF0gPSB7XG4gICAgICAgICAgICAgICAgc3RhcnRfdGltZTogRGF0ZS5ub3coKSxcbiAgICAgICAgICAgICAgICBlbmRfdGltZTogbnVsbCxcbiAgICAgICAgICAgICAgICB0b3RhbF90aW1lOiBudWxsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKGZ1bmN0aW9uIChyZXNvbHZlKSB7IHJldHVybiBfX2F3YWl0ZXIoX3RoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIF9fZ2VuZXJhdG9yKHRoaXMsIGZ1bmN0aW9uIChfYSkge1xuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKF9hLmxhYmVsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDA6IHJldHVybiBbNCAvKnlpZWxkKi8sIHBhcmFtKHJlc29sdmUpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfYS5zZW50KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFsyIC8qcmV0dXJuKi9dO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTsgfSkuZmluYWxseShmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgbWFya3NbbGFiZWxdLmVuZF90aW1lID0gRGF0ZS5ub3coKTtcbiAgICAgICAgICAgICAgICBtYXJrc1tsYWJlbF0udG90YWxfdGltZSA9IG1hcmtzW2xhYmVsXS5lbmRfdGltZSAtIG1hcmtzW2xhYmVsXS5zdGFydF90aW1lO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pKS50aGVuKGZ1bmN0aW9uICgpIHsgcmV0dXJuIG1hcmtzOyB9KS5maW5hbGx5KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIF90aGlzLnNlbmRNYXJrcyhtYXJrcyk7XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9LFxuICAgIHNlbmRNYXJrczogZnVuY3Rpb24gKG1hcmtzKSB7XG4gICAgICAgIHZhciBkYXRhTWFya3MgPSB7XG4gICAgICAgICAgICBGYXN0ZXN0OiBbXVxuICAgICAgICB9O1xuICAgICAgICBPYmplY3QudmFsdWVzKG1hcmtzKS5mb3JFYWNoKGZ1bmN0aW9uIChtYXJrLCBpbmRleCkge1xuICAgICAgICAgICAgdmFyIF9hO1xuICAgICAgICAgICAgdmFyIGxhYmVsID0gT2JqZWN0LmtleXMobWFya3MpW2luZGV4XTtcbiAgICAgICAgICAgIGlmICghaXNOYU4ocGFyc2VJbnQobGFiZWwpKSkge1xuICAgICAgICAgICAgICAgIGxhYmVsID0gXCJDbG9zdXJlIFwiLmNvbmNhdChsYWJlbCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoKChfYSA9IGRhdGFNYXJrcy5GYXN0ZXN0WzFdKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBtYXJrLmVuZF90aW1lICsgMSkgPiBtYXJrLmVuZF90aW1lKSB7XG4gICAgICAgICAgICAgICAgZGF0YU1hcmtzLkZhc3Rlc3QgPSBbXG4gICAgICAgICAgICAgICAgICAgIGxhYmVsLFxuICAgICAgICAgICAgICAgICAgICBtYXJrLmVuZF90aW1lXG4gICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRhdGFNYXJrc1tsYWJlbF0gPSBbXG4gICAgICAgICAgICAgICAgXCJTdGFydCB0aW1lOiBcIi5jb25jYXQobmV3IERhdGUobWFyay5zdGFydF90aW1lKS50b0xvY2FsZVN0cmluZygpLCBcIlxcbiAgICAgICAgICAgICAgICBFbmQgdGltZTogXCIpLmNvbmNhdChuZXcgRGF0ZShtYXJrLmVuZF90aW1lKS50b0xvY2FsZVN0cmluZygpLCBcIlxcbiAgICAgICAgICAgICAgICBUb3RhbCB0aW1lOiBcIikuY29uY2F0KG1hcmsudG90YWxfdGltZSwgXCIgbXNcIiksXG4gICAgICAgICAgICAgICAgbWFyay5lbmRfdGltZVxuICAgICAgICAgICAgXTtcbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB0aGlzLnRhYmxlVjIoZGF0YU1hcmtzLCBcIkJlbmNobWFya1wiKTtcbiAgICB9XG59O1xuLy8jIHNvdXJjZU1hcHBpbmdVUkw9QmVuY2htYXJrLmpzLm1hcCIsIlwidXNlIHN0cmljdFwiO1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFwiX19lc01vZHVsZVwiLCB7IHZhbHVlOiB0cnVlIH0pO1xuZXhwb3J0cy5kZWZhdWx0ID0ge1xuICAgIGNvbG9yOiBmdW5jdGlvbiAoY29sb3IpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuc2VuZChcImNvbG9yXCIsIHtcbiAgICAgICAgICAgIFwiY29sb3JcIjoge1xuICAgICAgICAgICAgICAgIFwiY29sb3JcIjogY29sb3JcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfSxcbiAgICBpbmZvOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmJsdWUoKTtcbiAgICB9LFxuICAgIHN1Y2Nlc3M6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZ3JlZW4oKTtcbi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ICB9XG4gICAgICAgICAgICBpZiAoIXRoaXMuaXNWYWxpZEpzb24oanNvbikpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmR1bXAoanNvbik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLnNlbmRKc29uKGpzb24pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgdGhpcy5kdW1wKHRoaXMuaW5zcGVjdChqc29uKSk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfVxuICAgIH0sXG4gICAgaW5zcGVjdDogZnVuY3Rpb24gKGpzb24pIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuY29udmVydEpTT05TdHJpbmdUb0pTT04oKDAsIHV0aWxfMS5pbnNwZWN0KShqc29uKSk7XG4gICAgfSxcbiAgICBjb252ZXJ0SlNPTlN0cmluZ1RvSlNPTjogZnVuY3Rpb24gKG9iamVjdCkge1xuICAgICAgICB2YXIgZm9ybWF0dGVkID0gb2JqZWN0XG4gICAgICAgICAgICAucmVwbGFjZSgvKFt7LF1cXHMqKShcXHcrKVxccyo6L2csICckMVwiJDJcIjonKVxuICAgICAgICAgICAgLnJlcGxhY2UoLzpcXHMqJyhbXiddKiknL2csICc6IFwiJDFcIicpXG4gICAgICAgICAgICAucmVwbGFjZSgvdW5kZWZpbmVkL2csICdudWxsJylcbiAgICAgICAgICAgIC5yZXBsYWNlKC9cXFtPYmplY3RcXF0vZywgJ3t9JylcbiAgICAgICAgICAgIC5yZXBsYWNlKC8oXFxyXFxufFxcbnxcXHIpL2dtLCBcIlwiKTtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHJldHVybiBKU09OLnBhcnNlKGZvcm1hdHRlZCk7XG4gICAgICAgIH1cbiAgICAgICAgY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICByZXR1cm4gb2JqZWN0O1xuICAgICAgICB9XG4gICAgfSxcbiAgICBpc1ZhbGlkSnNvbjogZnVuY3Rpb24gKGpzb24pIHtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIEpTT04ucGFyc2UoanNvbik7XG4gICAgICAgIH1cbiAgICAgICAgY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9LFxuICAgIHNlbmRKc29uOiBmdW5jdGlvbiAoanNvbikge1xuICAgICAgICBqc29uID0gdHlwZW9mIChqc29uKSAhPT0gJ3N0cmluZydcbiAgICAgICAgICAgID8gSlNPTi5zdHJpbmdpZnkoanNvbilcbiAgICAgICAgICAgIDoganNvbjtcbiAgICAgICAgcmV0dXJuIHRoaXMuc2VuZChcImpzb25cIiwge1xuICAgICAgICAgICAgXCJqc29uXCI6IHtcbiAgICAgICAgICAgICAgICBcInN0cmluZ1wiOiBqc29uLFxuICAgICAgICAgICAgICAgIFwib3JpZ2luYWxfY29udGVudFwiOiBqc29uXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH0sXG59O1xuLy8jIHNvdXJjZU1hcHBpbmdVUkw9SnNvbi5qcy5tYXAiLCJcInVzZSBzdHJpY3RcIjtcbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBcIl9fZXNNb2R1bGVcIiwgeyB2YWx1ZTogdHJ1ZSB9KTtcbmV4cG9ydHMuZGVmYXVsdCA9IHtcbiAgICBsYWJlbDogZnVuY3Rpb24gKGxhYmVsKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnNlbmQoXCJsYWJlbFwiLCB7XG4gICAgICAgICAgICBcImxhYmVsXCI6IHtcbiAgICAgICAgICAgICAgICBcImxhYmVsXCI6IGxhYmVsXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cbn07XG4vLyMgc291cmNlTWFwcGluZ1VSTD1MYWJlbC5qcy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gICBcInJlYWxfcGF0aFwiOiAoX2IgPSB1cmwgPT09IG51bGwgfHwgdXJsID09PSB2b2lkIDAgPyB2b2lkIDAgOiB1cmwucGF0aG5hbWUpICE9PSBudWxsICYmIF9iICE9PSB2b2lkIDAgPyBfYiA6IFwidGVybWluYWxcIixcbiAgICAgICAgICAgICAgICBcImNsYXNzX25hbWVcIjogKF9jID0gdXJsID09PSBudWxsIHx8IHVybCA9PT0gdm9pZCAwID8gdm9pZCAwIDogdXJsLnBhdGhuYW1lLnNwbGl0KCcvJykucG9wKCkpICE9PSBudWxsICYmIF9jICE9PSB2b2lkIDAgPyBfYyA6IFwidGVybWluYWxcIixcbiAgICAgICAgICAgICAgICBcInByb2plY3RfcGF0aFwiOiAoX2QgPSB1cmwgPT09IG51bGwgfHwgdXJsID09PSB2b2lkIDAgPyB2b2lkIDAgOiB1cmwucGF0aG5hbWUuc3BsaXQoJy8nKS5zbGljZSgwLCAtMSkuam9pbignLycpKSAhPT0gbnVsbCAmJiBfZCAhPT0gdm9pZCAwID8gX2QgOiBcInRlcm1pbmFsXCIsXG4gICAgICAgICAgICB9LCBcInR5cGVcIjogdHlwZSB9LCBkYXRhKSkuY2F0Y2goZnVuY3Rpb24gKGVycm9yKSB7XG4gICAgICAgICAgICBjb25zb2xlLmVycm9yKFwiRXJyb3I6XCIsIGVycm9yKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH0sIGdldFN0YWNrVHJhY2U6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIF9hLCBfYjtcbiAgICAgICAgdmFyIHN0YWNrID0gbmV3IEVycm9yKCkuc3RhY2s7XG4gICAgICAgIHZhciB0cmFjayA9IHsgc3RhY2s6IHN0YWNrIH07XG4gICAgICAgIHZhciBzdGFja0xpbmVzID0gc3RhY2suc3BsaXQoXCJcXG5cIik7XG4gICAgICAgIHZhciBjYWxsZXJMaW5lID0gc3RhY2tMaW5lc1s0XTtcbiAgICAgICAgd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GRhdGEsIGxhYmVsKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnNlbmQoXCJ0YWJsZV92MlwiLCB7XG4gICAgICAgICAgICBcInRhYmxlX3YyXCI6IHtcbiAgICAgICAgICAgICAgICBsYWJlbDogbGFiZWwsXG4gICAgICAgICAgICAgICAgdmFsdWVzOiBkYXRhXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pLmxhYmVsKGxhYmVsKTtcbiAgICB9XG59O1xuLy8jIHNvdXJjZU1hcHBpbmdVUkw9VGFibGUuanMubWFwIiwiXCJ1c2Ugc3RyaWN0XCI7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHsgdmFsdWU6IHRydWUgfSk7XG5leHBvcnRzLmRlZmF1bHQgPSB7XG4gICAgdGltZTogZnVuY3Rpb24gKGxhYmVsKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnNlbmQoXCJ0aW1lX3RyYWNrXCIsIHtcbiAgICAgICAgICAgIFwidGltZV90cmFja1wiOiB7XG4gICAgICAgICAgICAgICAgdHJhY2tlcl9pZDogdGhpcy5tYWtlVVVJRCgpLFxuICAgICAgICAgICAgICAgIHRpbWU6IERhdGUubm93KCkgLyAxMDAwLFxuICAgICAgICAgICAgICAgIGxhYmVsOiBsYWJlbFxuICAgICAgICAgICAgfVxuICAgICAgICB9KS5sYWJlbChsYWJlbCk7XG4gICAgfSxcbiAgICBzdG9wVGltZTogZnVuY3Rpb24gKGxhYmVsKSB7XG4gICAgICAgIHZhciB0aW1lID0gRGF0ZS5ub3coKSAvIDEwMDA7XG4gICAgICAgIHJldHVybiB0aGlzLnNlbmQoXCJ0aW1lX3RyYWNrXCIsIHtcbiAgICAgICAgICAgIFwidGltZV90cmFja1wiOiB7XG4gICAgICAgICAgICAgICAgdGltZTogdGltZSxcbiAgICAgICAgICAgICAgICBsYWJlbDogbGFiZWwsXG4gICAgICAgICAgICAgICAgZW5kX3RpbWU6IHRpbWUs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7XG5cbiAgICAvLyBTZXQgdGhlIHJlcXVlc3QgdGltZW91dCBpbiBNU1xuICAgIHJlcXVlc3QudGltZW91dCA9IF9jb25maWcudGltZW91dDtcblxuICAgIGZ1bmN0aW9uIG9ubG9hZGVuZCgpIHtcbiAgICAgIGlmICghcmVxdWVzdCkge1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICAvLyBQcmVwYXJlIHRoZSByZXNwb25zZVxuICAgICAgY29uc3QgcmVzcG9uc2VIZWFkZXJzID0gQXhpb3NIZWFkZXJzJDEuZnJvbShcbiAgICAgICAgJ2dldEFsbFJlc3BvbnNlSGVhZGVycycgaW4gcmVxdWVzdCAmJiByZXF1ZXN0LmdldEFsbFJlc3BvbnNlSGVhZGVycygpXG4gICAgICApO1xuICAgICAgY29uc3QgcmVzcG9uc2VEYXRhID0gIXJlc3BvbnNlVHlwZSB8fCByZXNwb25zZVR5cGUgPT09ICd0ZXh0JyB8fCByZXNwb25zZVR5cGUgPT09ICdqc29uJyA/XG4gICAgICAgIHJlcXVlc3QucmVzcG9uc2VUZXh0IDogcmVxdWVzdC5yZXNwb25zZTtcbiAgICAgIGNvbnN0IHJlc3BvbnNlID0ge1xuICAgICAgICBkYXRhOiByZXNwb25zZURhdGEsXG4gICAgICAgIHN0YXR1czogcmVxdWVzdC5zdGF0dXMsXG4gICAgICAgIHN0YXR1c1RleHQ6IHJlcXVlc3Quc3RhdHVzVGV4dCxcbiAgICAgICAgaGVhZGVyczogcmVzcG9uc2VIZWFkZXJzLFxuICAgICAgICBjb25maWcsXG4gICAgICAgIHJlcXVlc3RcbiAgICAgIH07XG5cbiAgICAgIHNldHRsZShmdW5jdGlvbiBfcmVzb2x2ZSh2YWx1ZSkge1xuICAgICAgICByZXNvbHZlKHZhbHVlKTtcbiAgICAgICAgZG9uZSgpO1xuICAgICAgfSwgZnVuY3Rpb24gX3JlamVjdChlcnIpIHtcbiAgICAgICAgcmVqZWN0KGVycik7XG4gICAgICAgIGRvbmUoKT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