diff --git a/dist/app.js b/dist/app.js index 23b311c..546b135 100644 --- a/dist/app.js +++ b/dist/app.js @@ -12339,96 +12339,10 @@ class Camera { } // this.ui.components.tileSelectionIndicator.handleClick(x, y); const tilePos = this.screenToTilePos(x, y); - this.selectTileAt(tilePos.x, tilePos.y); + if (tilePos) { + this.selectTileAt(tilePos.x, tilePos.y); + } }; - // public screenToTilePos(x: number, y: number): Point { - // // offset from center of viewport/container - // const scale = this.ui.gameDisplay.stage.scale.x; - // const pivot = this.ui.gameDisplay.stage.pivot; - // const viewport = this.getViewportInTiles(false); - // // calculate initial pivot based on map size and tile size - // const initialPivotX = (this.game.gameSize.width * Tile.size) / 2; - // const initialPivotY = (this.game.gameSize.height * Tile.size) / 2; - // const screenCenterX = this.ui.gameCanvasContainer.clientWidth / 2; - // const screenCenterY = this.ui.gameCanvasContainer.clientHeight / 2; - // const pivotX = pivot.x; - // const pivotY = pivot.y; - // const centerTileX = viewport.center.x; - // const centerTileY = viewport.center.y; - // const centerScreenX = centerTileX * Tile.size; - // const centerScreenY = centerTileY * Tile.size; - // console.log("centerScreenX", centerScreenX); - // const pivotDiffX = pivotX - centerScreenX; - // const pivotDiffY = pivotY - centerScreenY; - // console.log("pivotDiffX", pivotDiffX); - // // const pixelOffsetFromTileCenter = pivot.x % Tile.size; - // // console.log("pixel offset from tile center", pixelOffsetFromTileCenter); - // // take into account how offset the stage is from the center of the tile - // console.log( - // "calculate offset, pivot, tile size, scale", - // pivot.x, - // Tile.size, - // scale - // ); - // const screenCenterXScaled = (screenCenterX - pivotDiffX) / scale; - // const screenCenterYScaled = (screenCenterY - pivotDiffY) / scale; - // const scaledClickOffsetX = x / scale - screenCenterXScaled; - // const scaledClickOffsetY = y / scale - screenCenterYScaled; - // const tileOffsetX = Math.round(scaledClickOffsetX / Tile.size); - // const tileOffsetY = Math.round(scaledClickOffsetY / Tile.size); - // const tileX = viewport.center.x + tileOffsetX; - // const tileY = viewport.center.y + tileOffsetY; - // return new Point(tileX, tileY); - // } - // public screenToTilePos(x: number, y: number): Point { - // // offset from center of viewport/container - // const scale = this.ui.gameDisplay.stage.scale.x; - // const pivot = this.ui.gameDisplay.stage.pivot; - // const viewport = this.getViewportInTiles(false); - // let centerX = this.ui.gameCanvasContainer.clientWidth / 2; - // const centerY = this.ui.gameCanvasContainer.clientHeight / 2; - // // take into account how offset the stage is from the center of the tile - // const pixelOffsetFromTileCenter = pivot.x % Tile.size; - // console.log("pixel offset from tile center", pixelOffsetFromTileCenter); - // // const scaledTileSizeX = Tile.size / scale; - // // const centerTileOffsetX = - // // ((pivot.x * 100000) % Math.round(Tile.size * 100000)) / 100000; - // const centerTileOffsetY = pivot.y % (Tile.size / scale); - // const centerTileOffsetX = pixelOffsetFromTileCenter; - // console.log("centerTileOffsetX", centerTileOffsetX); - // console.log("pivotX, scaledtilesize, ", pivot.x, Tile.size / scale); - // centerX -= centerTileOffsetX; - // const centerXScaled = centerX / scale; - // const centerYScaled = centerY / scale; - // const scaledClickOffsetX = (x + centerTileOffsetX) / scale - centerXScaled; - // const scaledClickOffsetY = (y - centerTileOffsetY) / scale - centerYScaled; - // // console.log("scaledClickOffsetX", scaledClickOffsetX); - // const tileOffsetX = Math.round(scaledClickOffsetX / Tile.size); - // const tileOffsetY = Math.round(scaledClickOffsetY / Tile.size); - // const tileX = viewport.center.x + tileOffsetX; - // const tileY = viewport.center.y + tileOffsetY; - // return new Point(tileX, tileY); - // } - // public screenToTilePos(x: number, y: number): Point { - // // offset from center of viewport/container - // const scale = this.ui.gameDisplay.stage.scale.x; - // const pivot = this.ui.gameDisplay.stage.pivot; - // const viewport = this.getViewportInTiles(false); - // const centerX = this.ui.gameCanvasContainer.clientWidth / 2; - // const centerY = this.ui.gameCanvasContainer.clientHeight / 2; - // // take into account how offset the stage is from the center of the tile - // const centerTileOffsetX = pivot.x % Tile.size; - // const centerTileOffsetY = pivot.y % Tile.size; - // const centerXScaled = centerX / scale; - // const centerYScaled = centerY / scale; - // const scaledClickOffsetX = (x - centerTileOffsetX) / scale - centerXScaled; - // const scaledClickOffsetY = (y - centerTileOffsetY) / scale - centerYScaled; - // const tileOffsetX = Math.round(scaledClickOffsetX / Tile.size); - // const tileOffsetY = Math.round(scaledClickOffsetY / Tile.size); - // const tileX = viewport.center.x + tileOffsetX; - // const tileY = viewport.center.y + tileOffsetY; - // return new Point(tileX, tileY); - // } this.handlePanStart = (g) => { // console.log("pan start", g.velocityX, g.velocityY); // console.log( @@ -12796,36 +12710,16 @@ class Camera { this.momentum.y = 0; } screenToTilePos(x, y) { - // offset from center of viewport/container - const scale = this.ui.gameDisplay.stage.scale.x; - const pivot = this.ui.gameDisplay.stage.pivot; - const viewport = this.viewportUnpadded; - // calculate initial pivot based on map size and tile size - const screenCenterX = this.ui.gameCanvasContainer.clientWidth / 2; - const screenCenterY = this.ui.gameCanvasContainer.clientHeight / 2; - const pivotX = pivot.x; - const pivotY = pivot.y; - const centerTileX = viewport.center.x; - const centerTileY = viewport.center.y; - const centerTileScreenX = centerTileX * _tile__WEBPACK_IMPORTED_MODULE_1__.Tile.size; - const centerTileScreenY = centerTileY * _tile__WEBPACK_IMPORTED_MODULE_1__.Tile.size; - console.log("centerScreenX", centerTileScreenX); - const pivotDiffX = pivotX - centerTileScreenX; - const pivotDiffY = pivotY - centerTileScreenY; - console.log("pivotDiffX", pivotDiffX); - // const pixelOffsetFromTileCenter = pivot.x % Tile.size; - // console.log("pixel offset from tile center", pixelOffsetFromTileCenter); - // take into account how offset the stage is from the center of the tile - console.log("calculate offset, pivot, tile size, scale", pivot.x, _tile__WEBPACK_IMPORTED_MODULE_1__.Tile.size, scale); - const screenCenterXScaled = (screenCenterX - pivotDiffX) / scale; - const screenCenterYScaled = (screenCenterY - pivotDiffY) / scale; - const scaledClickOffsetX = x / scale - screenCenterXScaled; - const scaledClickOffsetY = y / scale - screenCenterYScaled; - const tileOffsetX = Math.round(scaledClickOffsetX / _tile__WEBPACK_IMPORTED_MODULE_1__.Tile.size); - const tileOffsetY = Math.round(scaledClickOffsetY / _tile__WEBPACK_IMPORTED_MODULE_1__.Tile.size); - const tileX = viewport.center.x + tileOffsetX; - const tileY = viewport.center.y + tileOffsetY; - return new _point__WEBPACK_IMPORTED_MODULE_0__.Point(tileX, tileY); + for (const key of this.viewportTilesUnpadded) { + const point = _map_world__WEBPACK_IMPORTED_MODULE_8__.MapWorld.keyToPoint(key); + const sprite = this.game.renderer.getFromCache(point, _renderer__WEBPACK_IMPORTED_MODULE_6__.Layer.TERRAIN); + if (sprite) { + const bounds = sprite.getBounds(); + if (bounds.contains(x, y)) { + return point; + } + } + } } setSideMenuVisible(visible) { // only hide/show if not collapsed @@ -19719,10 +19613,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _shoelace_style_shoelace_dist_components_button_button_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @shoelace-style/shoelace/dist/components/button/button.js */ "./node_modules/@shoelace-style/shoelace/dist/components/button/button.js"); /* harmony import */ var _shoelace_style_shoelace_dist_components_icon_button_icon_button_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @shoelace-style/shoelace/dist/components/icon-button/icon-button.js */ "./node_modules/@shoelace-style/shoelace/dist/components/icon-button/icon-button.js"); /* harmony import */ var _shoelace_style_shoelace_dist_components_range_range_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @shoelace-style/shoelace/dist/components/range/range.js */ "./node_modules/@shoelace-style/shoelace/dist/components/range/range.js"); -/* harmony import */ var _point__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../point */ "./src/point.ts"); -/* harmony import */ var _tile__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../tile */ "./src/tile.ts"); -/* harmony import */ var _shoelace_assets_icons_x_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../shoelace/assets/icons/x.svg */ "./src/shoelace/assets/icons/x.svg"); - +/* harmony import */ var _tile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../tile */ "./src/tile.ts"); +/* harmony import */ var _shoelace_assets_icons_x_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../shoelace/assets/icons/x.svg */ "./src/shoelace/assets/icons/x.svg"); @@ -19748,7 +19640,7 @@ class IndicatorTileSelection extends HTMLElement { this.container.style.pointerEvents = "none"; this.closeBtn = document.createElement("sl-icon-button"); this.closeBtn.setAttribute("size", "large"); - this.closeBtn.setAttribute("src", _shoelace_assets_icons_x_svg__WEBPACK_IMPORTED_MODULE_6__); + this.closeBtn.setAttribute("src", _shoelace_assets_icons_x_svg__WEBPACK_IMPORTED_MODULE_5__); this.closeBtn.style.position = "absolute"; this.closeBtn.style.top = "15px"; this.closeBtn.style.right = "15px"; @@ -19782,7 +19674,7 @@ class IndicatorTileSelection extends HTMLElement { // fill the grid with 16x16 tiles with a 1px border const borderSize = 1; const scale = this.game.userInterface.gameDisplay.stage.scale.x; - const tileSize = _tile__WEBPACK_IMPORTED_MODULE_5__.Tile.size * scale; + const tileSize = _tile__WEBPACK_IMPORTED_MODULE_4__.Tile.size * scale; const innerTileSize = tileSize - borderSize * 2; // Subtract border on both sides const width = this.canvas.width; const height = this.canvas.height; @@ -19791,8 +19683,8 @@ class IndicatorTileSelection extends HTMLElement { const xOffset = (width % tileSize) / 2; const yOffset = (height % tileSize) / 2; const pivot = this.game.userInterface.gameDisplay.stage.pivot; - const pivotOffsetX = (pivot.x % _tile__WEBPACK_IMPORTED_MODULE_5__.Tile.size) * scale; - const pivotOffsetY = (pivot.y % _tile__WEBPACK_IMPORTED_MODULE_5__.Tile.size) * scale; + const pivotOffsetX = (pivot.x % _tile__WEBPACK_IMPORTED_MODULE_4__.Tile.size) * scale; + const pivotOffsetY = (pivot.y % _tile__WEBPACK_IMPORTED_MODULE_4__.Tile.size) * scale; ctx.clearRect(0, 0, width, height); // Clear the canvas ctx.fillStyle = "rgba(255, 16, 240, 1)"; // Set the color to hot pink for (let i = 0; i < rows; i++) { @@ -19826,46 +19718,6 @@ class IndicatorTileSelection extends HTMLElement { this.isVisible = visible; this.style.display = visible ? "block" : "none"; } - handleClick(x, y) { - console.log("handle click", x, y); - const clickedPos = this.screenToTilePos(x, y); - console.log("clicked pos", clickedPos); - const clickedTile = this.game.map.getTile(clickedPos.x, clickedPos.y); - console.log("clicked tile", clickedTile); - this.game.map.setTile(clickedPos.x, clickedPos.y, _tile__WEBPACK_IMPORTED_MODULE_5__.Tile.shrub); - } - screenToTilePos(x, y) { - // offset from center of viewport/container - const scale = this.game.userInterface.gameDisplay.stage.scale.x; - const pivot = this.game.userInterface.gameDisplay.stage.pivot; - const viewport = this.game.userInterface.camera.getViewport().padded; - // calculate initial pivot based on map size and tile size - const screenCenterX = this.game.userInterface.gameCanvasContainer.clientWidth / 2; - const screenCenterY = this.game.userInterface.gameCanvasContainer.clientHeight / 2; - const pivotX = pivot.x; - const pivotY = pivot.y; - const centerTileX = viewport.center.x; - const centerTileY = viewport.center.y; - const centerTileScreenX = centerTileX * _tile__WEBPACK_IMPORTED_MODULE_5__.Tile.size; - const centerTileScreenY = centerTileY * _tile__WEBPACK_IMPORTED_MODULE_5__.Tile.size; - console.log("--- centerScreenX", centerTileScreenX); - const pivotDiffX = pivotX - centerTileScreenX; - const pivotDiffY = pivotY - centerTileScreenY; - console.log("--- pivotDiffX", pivotDiffX); - // const pixelOffsetFromTileCenter = pivot.x % Tile.size; - // console.log("pixel offset from tile center", pixelOffsetFromTileCenter); - // take into account how offset the stage is from the center of the tile - console.log("--- calculate offset, pivot, tile size, scale", pivot.x, _tile__WEBPACK_IMPORTED_MODULE_5__.Tile.size, scale); - const screenCenterXScaled = (screenCenterX - pivotDiffX) / scale; - const screenCenterYScaled = (screenCenterY - pivotDiffY) / scale; - const scaledClickOffsetX = x / scale - screenCenterXScaled; - const scaledClickOffsetY = y / scale - screenCenterYScaled; - const tileOffsetX = Math.round(scaledClickOffsetX / _tile__WEBPACK_IMPORTED_MODULE_5__.Tile.size); - const tileOffsetY = Math.round(scaledClickOffsetY / _tile__WEBPACK_IMPORTED_MODULE_5__.Tile.size); - const tileX = viewport.center.x + tileOffsetX; - const tileY = viewport.center.y + tileOffsetY; - return new _point__WEBPACK_IMPORTED_MODULE_4__.Point(tileX, tileY); - } } @@ -82817,4 +82669,4 @@ document.body.onload = () => __awaiter(void 0, void 0, void 0, function* () { /******/ })() ; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwLmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBYTs7QUFFYixtQkFBbUIsbUJBQU8sQ0FBQyw0REFBZTs7QUFFMUMsZUFBZSxtQkFBTyxDQUFDLDZDQUFJOztBQUUzQjs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7Ozs7O0FDZGE7O0FBRWIsV0FBVyxtQkFBTyxDQUFDLDREQUFlO0FBQ2xDLG1CQUFtQixtQkFBTyxDQUFDLDREQUFlO0FBQzFDLHdCQUF3QixtQkFBTyxDQUFDLHdFQUFxQjs7QUFFckQ7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0Esb0JBQW9CLFNBQVMsVUFBVTtBQUN2QyxHQUFHO0FBQ0g7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQSw0Q0FBNEMsa0JBQWtCO0FBQzlELEVBQUU7QUFDRixDQUFDLG9CQUFvQjtBQUNyQjs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUMzQ0E7QUFDZ0g7QUFDakI7QUFDL0YsOEJBQThCLG1GQUEyQixDQUFDLDRGQUFxQztBQUMvRjtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNB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AgICBpZiAoIW91dGVyTm9kZSB8fCBvdXRlck5vZGUubmV4dCA9PT0gb3V0ZXJOb2RlLnByZXYpIHJldHVybiB0cmlhbmdsZXM7XG5cbiAgICB2YXIgbWluWCwgbWluWSwgbWF4WCwgbWF4WSwgeCwgeSwgaW52U2l6ZTtcblxuICAgIGlmIChoYXNIb2xlcykgb3V0ZXJOb2RlID0gZWxpbWluYXRlSG9sZXMoZGF0YSwgaG9sZUluZGljZXMsIG91dGVyTm9kZSwgZGltKTtcblxuICAgIC8vIGlmIHRoZSBzaGFwZSBpcyBub3QgdG9vIHNpbXBsZSwgd2UnbGwgdXNlIHotb3JkZXIgY3VydmUgaGFzaCBsYXRlcjsgY2FsY3VsYXRlIHBvbHlnb24gYmJveFxuICAgIGlmIChkYXRhLmxlbmd0aCA+IDgwICogZGltKSB7XG4gICAgICAgIG1pblggPSBtYXhYID0gZGF0YVswXTtcbiAgICAgICAgbWluWSA9IG1heFkgPSBkYXRhWzFdO1xuXG4gICAgICAgIGZvciAodmFyIGkgPSBkaW07IGkgPCBvdXRlckxlbjsgaSArPSBkaW0pIHtcbiAgICAgICAgICAgIHggPSBkYXRhW2ldO1xuICAgICAgICAgICAgeSA9IGRhdGFbaSArIDFdO1xuICAgICAgICAgICAgaWYgKHggPCBtaW5YKSBtaW5YID0geDtcbiAgICAgICAgICAgIGlmICh5IDwgbWluWSkgbWluWSA9IHk7XG4gICAgICAgICAgICBpZiAoeCA+IG1heFgpIG1heFggPSB4O1xuICAgICAgICAgICAgaWYgKHkgPiBtYXhZKSBtYXhZID0geTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIG1pblgsIG1pblkgYW5kIGludlNpemUgYXJlIGxhdGVyIHVzZWQgdG8gdHJhbnNmb3JtIGNvb3JkcyBpbnRvIGludGVnZXJzIGZvciB6LW9yZGVyIGNhbGN1bGF0aW9uXG4gICAgICAgIGludlNpemUgPSBNYXRoLm1heChtYXhYIC0gbWluWCwgbWF4WSAtIG1pblkpO1xuIC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vbm5lY3Rpb247XG4gICAgLy8gb3RoZXJ3aXNlIGNob29zZSB0aGUgcG9pbnQgb2YgdGhlIG1pbmltdW0gYW5nbGUgd2l0aCB0aGUgcmF5IGFzIGNvbm5lY3Rpb24gcG9pbnRcblxuICAgIHZhciBzdG9wID0gbSxcbiAgICAgICAgbXggPSBtLngsXG4gICAgICAgIG15ID0gbS55LFxuICAgICAgICB0YW5NaW4gPSBJbmZpbml0eSxcbiAgICAgICAgdGFuO1xuXG4gICAgcCA9IG07XG5cbiAgICBkbyB7XG4gICAgICAgIGlmIChoeCA+PSBwLnggJiYgcC54ID49IG14ICYmIGh4ICE9PSBwLnggJiZcbiAgICAgICAgICAgICAgICBwb2ludEluVHJpYW5nbGUoaHkgPCBteSA/IGh4IDogcXgsIGh5LCBteCwgbXksIGh5IDwgbXkgPyBxeCA6IGh4LCBoeSwgcC54LCBwLnkpKSB7XG5cbiAgICAgICAgICAgIHRhbiA9IE1hdGguYWJzKGh5IC0gcC55KSAvIChoeCAtIHAueCk7IC8vIHRhbmdlbnRpYWxcblxuICAgICAgICAgICAgaWYgKGxvY2FsbHlJbnNpZGUocCwgaG9sZSkgJiZcbiAgICAgICAgICAgICAgICAodGFuIDwgdGFuTWluIHx8ICh0YW4gPT09IHRhbk1pbiAmJiAocC54ID4gbS54IHx8IChwLnggPT09IG0ueCAmJiBzZWN0b3JDb250YWluc1NlY3RvcihtLCBwKSkpKSkpIHtcbiAgICAgICAgICAgICAgICBtID0gcDtcbiAgICAgICAgICAgICAgICB0YW5NaW4gPSB0YW47XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBwID0gcC5uZXh0O1xuICAgIH0gd2hpbGUgKHAgIT09IHN0b3ApO1xuXG4gICAgcmV0dXJuIG07XG59XG5cbi8vIHdoZXRoZXIgc2VjdG9yIGluIHZlcnRleCBtIGNvbnRhaW5zIHNlY3RvciBpbiB2ZXJ0ZXggcCBpbiB0aGUgc2FtZSBjb29yZGluYXRlc1xuZn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sZSAocCkge1xuICAgICAgICAgICAgbnVtTWVyZ2VzKys7XG4gICAgICAgICAgICBxID0gcDtcbiAgICAgICAgICAgIHBTaXplID0gMDtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBpblNpemU7IGkrKykge1xuICAgICAgICAgICAgICAgIHBTaXplKys7XG4gICAgICAgICAgICAgICAgcSA9IHEubmV4dFo7XG4gICAgICAgICAgICAgICAgaWYgKCFxKSBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHFTaXplID0gaW5TaXplO1xuXG4gICAgICAgICAgICB3aGlsZSAocFNpemUgPiAwIHx8IChxU2l6ZSA+IDAgJiYgcSkpIHtcblxuICAgICAgICAgICAgICAgIGlmIChwU2l6ZSAhPT0gMCAmJiAocVNpemUgPT09IDAgfHwgIXEgfHwgcC56IDw9IHEueikpIHtcbiAgICAgICAgICAgICAgICAgICAgZSA9IHA7XG4gICAgICAgICAgICAgICAgICAgIHAgPSBwLm5leHRaO1xuICAgICAgICAgICAgICAgICAgICBwU2l6ZS0tO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGUgPSBxO1xuICAgICAgICAgICAgICAgICAgICBxID0gcS5uZXh0WjtcbiAgICAgICAgICAgICAgICAgICAgcVNpemUtLTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAodGFpbCkgdGFpbC5uZXh0WiA9IGU7XG4gICAgICAgICAgICAgICAgZWxzZSBsaXN0ID0gZTtcblxuICAgICAgICAgICAgICAgIGUucHJldlogPSB0YWlsO1xuICAgICAgICAgICAgICAgIHRhaWwgPSBlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBwID0gcTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRhaWwubmV4dFogPSBudWxsO1xuICAgICAgICBpblNpemUgKj0gMjtcblxuICAgIH0gd2hpbGUgKG51bU1lcmdlcyA+IDEpO1xuXG4gICAgcmV0dX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yxcbiAgICAgICAgICAgICAgICBjb25jYXR0eShhcmdzLCBhcmd1bWVudHMpXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgaWYgKE9iamVjdChyZXN1bHQpID09PSByZXN1bHQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRhcmdldC5hcHBseShcbiAgICAgICAgICAgIHRoYXQsXG4gICAgICAgICAgICBjb25jYXR0eShhcmdzLCBhcmd1bWVudHMpXG4gICAgICAgICk7XG5cbiAgICB9O1xuXG4gICAgdmFyIGJvdW5kTGVuZ3RoID0gbWF4KDAsIHRhcmdldC5sZW5ndGggLSBhcmdzLmxlbmd0aCk7XG4gICAgdmFyIGJvdW5kQXJncyA9IFtdO1xuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYm91bmRMZW5ndGg7IGkrKykge1xuICAgICAgICBib3VuZEFyZ3NbaV0gPSAnJCcgKyBpO1xuICAgIH1cblxuICAgIGJvdW5kID0gRnVuY3Rpb24oJ2JpbmRlcicsICdyZXR1cm4gZnVuY3Rpb24gKCcgKyBqb2lueShib3VuZEFyZ3MsICcsJykgKyAnKXsgcmV0dXJuIGJpbmRlci5hcHBseSh0aGlzLGFyZ3VtZW50cyk7IH0nKShiaW5kZXIpO1xuXG4gICAgaWYgKHRhcmdldC5wcm90b3R5cGUpIHtcbiAgICAgICAgdmFyIEVtcHR5ID0gZnVuY3Rpb24gRW1wdHkoKSB7fTtcbiAgICAgICAgRW1wdHkucHJvdG90eXBlID0gdGFyZ2V0LnByb3RvdHlwZTtcbiAgICAgICAgYm91bmQucHJvdG90eXBlID0gbmV3IEVtcHR5KCk7XG4gICAgICAgIEVtcHR5LnByb3RvdHlwZSA9IG51bGw7XG4gICAgfVxuXG4gICAgcmV0dXJuIGJvdW5kO1xufTtcbiIsIid1c2Ugc3RyaWN0Jztc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ZXJBZ2VudC5zcGxpdCgnVHdpdHRlcicpO1xuICAgIGlmICh0eXBlb2YgdG1wWzFdICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICB1c2VyQWdlbnQgPSB0bXBbMF07XG4gICAgfVxuICAgIHZhciBtYXRjaCA9IGNyZWF0ZU1hdGNoKHVzZXJBZ2VudCk7XG4gICAgdmFyIHJlc3VsdCA9IHtcbiAgICAgICAgYXBwbGU6IHtcbiAgICAgICAgICAgIHBob25lOiBtYXRjaChhcHBsZUlwaG9uZSkgJiYgIW1hdGNoKHdpbmRvd3NQaG9uZSksXG4gICAgICAgICAgICBpcG9kOiBtYXRjaChhcHBsZUlwb2QpLFxuICAgICAgICAgICAgdGFibGV0OiAhbWF0Y2goYXBwbGVJcGhvbmUpICYmXG4gICAgICAgICAgICAgICAgKG1hdGNoKGFwcGxlVGFibGV0KSB8fCBpc0FwcGxlVGFibGV0T25Jb3MxMyhuYXYpKSAmJlxuICAgICAgICAgICAgICAgICFtYXRjaCh3aW5kb3dzUGhvbmUpLFxuICAgICAgICAgICAgdW5pdmVyc2FsOiBtYXRjaChhcHBsZVVuaXZlcnNhbCksXG4gICAgICAgICAgICBkZXZpY2U6IChtYXRjaChhcHBsZUlwaG9uZSkgfHxcbiAgICAgICAgICAgICAgICBtYXRjaChhcHBsZUlwb2QpIHx8XG4gICAgICAgICAgICAgICAgbWF0Y2goYXBwbGVUYWJsZXQpIHx8XG4gICAgICAgICAgICAgICAgbWF0Y2goYXBwbGVVbml2ZXJzYWwpIHx8XG4gICAgICAgICAgICAgICAgaXNBcHBsZVRhYmxldE9uSW9zMTMobmF2KSkgJiZcbiAgICAgICAgICAgICAgICAhbWF0Y2god2luZG93c1Bob25lKVxuICAgICAgICB9LFxuICAgICAgICBhbWF6b246IHtcbiAgICAgICAgICAgIHBob25lOiBtYXRjaChhbWF6b25QaG9uZSksXG4gICAgICAgICAgICB0YWJsZXQ6ICFtYXRjaChhbWF6b25QaG9uZSkgJiYgbWF0Y2goYW1hem9uVGFibGV0KSxcbiAgICAgICAgICAgIGRldmljZTogbWF0Y2goYW1hem9uUGhvbmUpIHx8IG1hdGNoKGFtYXpvblRhYmxldClcbiAgICAgICAgfSxcbiAgICAgICAgYW5kcm9pZDoge1xuICAgICAgICAgICAgcGhvbmU6ICghbWF0Y2god2luZG93c1Bob25lKSAmJiBtYXRjaChhbWF6b25QaG9uZSkpIHx8XG4gICAgICAgICAgICAgICAgKCFtYXRjaCh3aW5kb3dzUGhvbmUpICYmIG1hdGNoKGFuZHJvaWRQaG9uZSkpLFxuICAgICAgICAgICAgdGFibGV0OiAhbWF0Y2god2luZG93c1Bob25lKSAmJlxuICAgICAgICAgICAgICAgICFtYXRjaChhbWF6b25QaG9uZSkgJiZcbiAgICAgICAgICAgICAgICAhbWF0Y2goYW5kcm9pZFBob25lKSAmJlxuICAgICAgICAgICAgICAgIChtYXRjaChhbWF6b25UYWJsZXQpIHx8IG1hdGNoKGFuZHJvaWRUYWJsZXQpKSxcbiAgICAgICAgICAgIGRldmljZTogKCFtYXRjaCh3aW5kb3dzUGhvbmUpICYmXG4gICAgICAgICAgICAgICAgKG1hdGNoKGFtYXpvblBob25lKSB8fFxuICAgICAgICAgICAgICAgICAgICBtYXRjaChhbWF6b25UYWJsZXQpIHx8XG4gICAgICAgICAgICAgICAgICAgIG1hdGNoKGFuZHJvaWRQaG9uZSkgfHxcbiAgICAgICAgICAgICAgICAgICAgbWF0Y2goYW5kcm9pZFRhYmxldCkpKSB8fFxuICAgICAgICAgICAgICAgIG1hdGNoKC9cXGJva2h0dHBcXGIvaSlcbiAgICAgICAgfSxcbiAgICAgICAgd2luZG93czoge1xuICAgICAgICAgICAgcGhvbmU6IG1hdGNoKHdpbmRvd3NQaG9uZSksXG4gICAgICAgICAgICB0YWJsZXQ6IG1hdGNoKHdpbmRvd3NUYWJsZXQpLFxuICAgICAgICAgICAgZGV2aWNlOiBtYXRjaCh3aW5kb3dzUGhvbmUpIHx8IG1hdGNoKHdpbmRvd3NUYWJsZXQpXG4gICAgICAgIH0sXG4gICAgICAgIG90aGVyOiB7XG4gICAgICAgICAgICBibGFja2JlcnJ5OiBtYXRjaChvdGhlckJsYWNrQmVycnkpLFxuICAgICAgICAgICAgYmxhY2tiZXJyeTEwOiBtYXRjaChvdGhlckJsYWNrQmVycnkxMCksXG4gICAgICAgICAgICBvcGVyYTogbWF0Y2gob3RoZXJPcGVyYSksXG4gICAgICAgICAgICBmaXJlZm94OiBtYXRjaChvdGhlckZpcmVmb3gpLFxuICAgICAgICAgICAgY2hyb21lOiBtYXRjaChvdGhlckNocm9tZSksXG4gICAgICAgICAgICBkZXZpY2U6IG1hdGNoKG90aGVyQmxhY2tCZXJyeSkgfHxcbiAgICAgICAgICAgICAgICBtYXRjaChvdGhlckJsYWNrQmVycnkxMCkgfHxcbiAgICAgICAgICAgICAgICBtYXRjaChvdGhlck9wZXJhKSB8fFxuICAgICAgICAgICAgICAgIG1hdGNoKG90aGVyRmlyZWZveCkgfHxcbiAgICAgICAgICAgICAgICBtYXRjaChvdGhlckNocm9tZSlcbiAgICAgICAgfSxcbiAgICAgICAgYW55OiBmYWxzZSxcbiAgICAgICAgcGhvbmU6IGZhbHNlLFxuICAgICAgICB0YWJsZXQ6IGZhbHNlXG4gICAgfTtcbiAgICByZXN1bHQuYW55ID1cbiAgICAgICAgcmVzdWx0LmFwcGxlLmRldmljZSB8fFxuICAgICAgICAgICAgcmVzdWx0LmFuZHJvaWQuZGV2aWNlIHx8XG4gICAgICAgICAgICByZXN1bHQud2luZG93cy5kZXZpY2UgfHxcbiAgICAgICAgICAgIHJlc3VsdC5vdGhlci5kZXZpY2U7XG4gICAgcmVzdWx0LnBob25lID1cbiAgICAgICAgcmVzdWx0LmFwcGxlLnBob25lIHx8IHJlc3VsdC5hbmRyb2lkLnBob25lIHx8IHJlc3VsdC53aW5kb3dzLnBob25lO1xuICAgIHJlc3VsdC50YWJsZXQgPVxuICAgICAgICByZXN1bHQuYXBwbGUudGFibGV0IHx8I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2FibGUtbGluZSBuby1wcm90b1xuICAgICAgICA/IGZ1bmN0aW9uIChPKSB7XG4gICAgICAgICAgICByZXR1cm4gTy5fX3Byb3RvX187IC8vIGVzbGludC1kaXNhYmxlLWxpbmUgbm8tcHJvdG9cbiAgICAgICAgfVxuICAgICAgICA6IG51bGxcbik7XG5cbmZ1bmN0aW9uIGFkZE51bWVyaWNTZXBhcmF0b3IobnVtLCBzdHIpIHtcbiAgICBpZiAoXG4gICAgICAgIG51bSA9PT0gSW5maW5pdHlcbiAgICAgICAgfHwgbnVtID09PSAtSW5maW5pdHlcbiAgICAgICAgfHwgbnVtICE9PSBudW1cbiAgICAgICAgfHwgKG51bSAmJiBudW0gPiAtMTAwMCAmJiBudW0gPCAxMDAwKVxuICAgICAgICB8fCAkdGVzdC5jYWxsKC9lLywgc3RyKVxuICAgICkge1xuICAgICAgICByZXR1cm4gc3RyO1xuICAgIH1cbiAgICB2YXIgc2VwUmVnZXggPSAvWzAtOV0oPz0oPzpbMC05XXszfSkrKD8hWzAtOV0pKS9nO1xuICAgIGlmICh0eXBlb2YgbnVtID09PSAnbnVtYmVyJykge1xuICAgICAgICB2YXIgaW50ID0gbnVtIDwgMCA/IC0kZmxvb3IoLW51bSkgOiAkZmxvb3IobnVtKTsgLy8gdHJ1bmMobnVtKVxuICAgICAgICBpZiAoaW50ICE9PSBudW0pIHtcbiAgICAgICAgICAgIHZhciBpbnRTdHIgPSBTdHJpbmcoaW50KTtcbiAgICAgICAgICAgIHZhciBkZWMgPSAkc2xpY2UuY2FsbChzdHIsIGludFN0ci5sZW5ndGggKyAxKTtcbiAgICAgICAgICAgIHJldHVybiAkcmVwbGFjZS5jYWxsKGludFN0ciwgc2VwUmVnZXgsICckJl8nKSArICcuJyArICRyZXBsYWNlLmNhbGwoJHJlcGxhY2UuY2FsbChkZWMsIC8oWzAtOV17M30pL2csICckJl8nKSwgL18kLywgJycpO1xuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiAkcmVwbGFjZS5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5lZCcpIHsgZGVwdGggPSAwOyB9XG4gICAgaWYgKGRlcHRoID49IG1heERlcHRoICYmIG1heERlcHRoID4gMCAmJiB0eXBlb2Ygb2JqID09PSAnb2JqZWN0Jykge1xuICAgICAgICByZXR1cm4gaXNBcnJheShvYmopID8gJ1tBcnJheV0nIDogJ1tPYmplY3RdJztcbiAgICB9XG5cbiAgICB2YXIgaW5kZW50ID0gZ2V0SW5kZW50KG9wdHMsIGRlcHRoKTtcblxuICAgIGlmICh0eXBlb2Ygc2VlbiA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgc2VlbiA9IFtdO1xuICAgIH0gZWxzZSBpZiAoaW5kZXhPZihzZWVuLCBvYmopID49IDApIHtcbiAgICAgICAgcmV0dXJuICdbQ2lyY3VsYXJdJztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBpbnNwZWN0KHZhbHVlLCBmcm9tLCBub0luZGVudCkge1xuICAgICAgICBpZiAoZnJvbSkge1xuICAgICAgICAgICAgc2VlbiA9ICRhcnJTbGljZS5jYWxsKHNlZW4pO1xuICAgICAgICAgICAgc2Vlbi5wdXNoKGZyb20pO1xuICAgICAgICB9XG4gICAgICAgIGlmIChub0luZGVudCkge1xuICAgICAgICAgICAgdmFyIG5ld09wdHMgPSB7XG4gICAgICAgICAgICAgICAgZGVwdGg6IG9wdHMuZGVwdGhcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoaGFzKG9wdHMsICdxdW90ZVN0eWxlJykpIHtcbiAgICAgICAgICAgICAgICBuZXdPcHRzLnF1b3RlU3R5bGUgPSBvcHRzLnF1b3RlU3R5bGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gaW5zcGVjdF8odmFsdWUsIG5ld09wdHMsIGRlcHRoICsgMSwgc2Vlbik7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGluc3BlY3RfKHZhbHVlLCBvcHRzLCBkZXB0aCArIDEsIHNlZW4pO1xuICAgIH1c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dGlvbnMucGFyYW1ldGVyTGltaXQ7XG4gICAgdmFyIHBhcnRzID0gY2xlYW5TdHIuc3BsaXQob3B0aW9ucy5kZWxpbWl0ZXIsIGxpbWl0KTtcbiAgICB2YXIgc2tpcEluZGV4ID0gLTE7IC8vIEtlZXAgdHJhY2sgb2Ygd2hlcmUgdGhlIHV0Zjggc2VudGluZWwgd2FzIGZvdW5kXG4gICAgdmFyIGk7XG5cbiAgICB2YXIgY2hhcnNldCA9IG9wdGlvbnMuY2hhcnNldDtcbiAgICBpZiAob3B0aW9ucy5jaGFyc2V0U2VudGluZWwpIHtcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IHBhcnRzLmxlbmd0aDsgKytpKSB7XG4gICAgICAgICAgICBpZiAocGFydHNbaV0uaW5kZXhPZigndXRmOD0nKSA9PT0gMCkge1xuICAgICAgICAgICAgICAgIGlmIChwYXJ0c1tpXSA9PT0gY2hhcnNldFNlbnRpbmVsKSB7XG4gICAgICAgICAgICAgICAgICAgIGNoYXJzZXQgPSAndXRmLTgnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocGFydHNbaV0gPT09IGlzb1NlbnRpbmVsKSB7XG4gICAgICAgICAgICAgICAgICAgIGNoYXJzZXQgPSAnaXNvLTg4NTktMSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHNraXBJbmRleCA9IGk7XG4gICAgICAgICAgICAgICAgaSA9IHBhcnRzLmxlbmd0aDsgLy8gVGhlIGVzbGludCBzZXR0aW5ncyBkbyBub3QgYWxsb3cgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmb3IgKGkgPSAwOyBpIDwgcGFydHMubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgaWYgKGkgPT09IHNraXBJbmRleCkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIHBhcnQgPSBwYXJ0c1tpXTtcblxuICAgICAgICB2YXIgYnJhY2tldEVxdWFsc1BvcyA9IHBhcnQuaW5kZXhPZignXT0nKTtcbiAgICAgICAgdmFyIHBvcyA9IGJyYWNrZXRFcXVhbHNQb3MgPT09IC0xID8gcGFydC5pbmRleE9mKCc9JykgOiBicmFja2V0RXF1YWxzUG9zICsgMTtcblxuICAgICAgICB2YXIga2V5LCB2YWw7XG4gICAgICAgIGlmIChwb3MgPT09IC0xKSB7XG4gICAgICAgICAgICBrZXkgPSBvcHRpb25zLmRlY29kZXIocGFydCwgZGVmYXVsdHMuZGVjb2RlciwgY2hhcnNldCwgJ2tleScpO1xuICAgICAgICAgICAgdmFsID0gb3B0aW9ucy5zdHJpY3ROdWxsSGFuZGxpbmcgPyBudWxsIDogJyc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBrZXkgPSBvcHRpb25zLmRlY29kZXIocGFydC5zbGljZSgwLCBwb3MpLCBkZWZhdWx0cy5kZWNvZGVyLCBjaGFyc2V0LCAna2V5Jyk7XG4gICAgICAgICAgICB2YWwgPSB1dGlscy5tYXliZU1hcChcbiAgICAgICAgICAgICAgICBwYXJzZUFycmF5VmFsdWUocGFydC5zbGljZShwb3MgKyAxKSwgb3B0aW9ucyksXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gKGVuY29kZWRWYWwpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wdGlvbnMuZGVjb2RlcihlbmNvZGVkVmFsLCBkZWZhdWx0cy5kZWNvZGVyLCBjaGFyc2V0LCAndmFsdWUnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICApO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHZhbCAmJiBvcHRpb25zLmludGVycHJldE51bWVyaWNFbnRpdGllcyAmJiBjaGFyc2V0ID09PSAnaXNvLTg4NTktMScpIHtcbiAgICAgICAgICAgIHZhbCA9IGludGVycHJldE51bWVyaWNFbnRpdGllcyh2YWwpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHBhcnQuaW5kZXhPZignW109JykgPiAtMSkge1xuICAgICAgICAgICAgdmFsID0gaXNBcnJheSh2YWwpID8gW3ZhbF0gOiB2YWw7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoaGFzLmNhbGwob2JqLCBrZXkpKSB7XG4gICAgICAgICAgICBvYmpba2V5XSA9IHV0aWxzLmNvbWJpbmUob2JqW2tleV0sIHZhbCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvYmpba2V5XSA9IHZhbDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBvYmo7XG59O1xuXG52YXIgcGFyc2VPYmplY3QgPSBmdW5jdGlvbiAoY2hhaW4sIHZhbCwgb3B0aW9ucywgdmFsdWVzUGFyc2VkKSB7XG4gICAgdmFyIGxlYWYgPSB2YWx1ZXNQYXJzZWQgPyB2YWwgOiBwYXJzZUFycmF5VmFsdWUodmFsLCBvcHRpb25zKTtcblxuICAgIGZvciAodmFyIGkgPSBjaGFpbi5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICB2YXIgb2JqO1xuICAgICAgICB2YXIgcm9vdCA9IGNoYWluW2ldO1xuXG4gICAgICAgIGlmIChyb290ID09PSAnW10nICYmIG9wdGlvbnMucGFyc2VBcnJheXMpIHtcbiAgICAgICAgICAgIG9iaiA9IFtdLmNvbmNhdChsZWFmKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9iaiA9IG9wdGlvbnMucGxhaW5PYmplY3RzID8gT2JqZWN0LmNyZWF0ZShudWxsKSA6IHt9O1xuICAgICAgICAgICAgdmFyIGNsZWFuUm9vdCA9IHJvb3QuY2hhckF0KDApID09PSAnWycgJiYgcm9vdC5jaGFyQXQocm9vdC5sZW5ndGggLSAxKSA9PT0gJ10nID8gcm9vdC5zbGljZSgxLCAtMSkgOiByb290O1xuICAgICAgICAgICAgdmFyIGluZGV4ID0gcGFyc2VJbnQoY2xlYW5Sb290LCAxMCk7XG4gICAgICAgICAgICBpZiAoIW9wdGlvbnMucGFyc2VBcnJheXMgJiYgY2xlYW5Sb290ID09PSAnJykge1xuICAgICAgICAgICAgICAgIG9iaiA9IHsgMDogbGVhZiB9O1xuICAgICAgICAgICAgfSBlbHNlIGlmIChcbiAgICAgICAgICAgICAgICAhaXNOYU4oaW5kZXgpXG4gICAgICAgICAgICAgICAgJiYgcm9vdCAhPT0gY2xlYW5Sb290XG4gICAgICAgICAgICAgICAgJiYgU3RyaW5nKGluZGV4KSA9PT0gY2xlYW5Sb290XG4gICAgICAgICAgICAgICAgJiYgaW5kZXggPj0gMFxuICAgICAgICAgICAgICAgICYmIChvcHRpb25zLnBhcnNlQXJyYXlzICYmIGluZGV4IDw9IG9wdGlvbnMuYXJyYXlMaW1pdClcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIG9iaiA9IFtdO1xuICAgICAgICAgICAgICAgIG9ialtpbmRleF0gPSBsZWFmO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChjbGVhblJvb3QgIT09ICdfX3Byb3RvX18nKSB7XG4gICAgICAgICAgICAgICAgb2JqW2NsZWFuUm9vdF0gPSBsZWFmO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgbGVhZiA9IG9iajtcbiAgICB9XG5cbiAgICByZXR1cm4gbGVhZjtcbn07XG5cbnZhciBwYXJzZUtleXMgPSBmdW5jdGlvbiBwYXJzZVF1ZXJ5U3RyaW5nS2V5cyhnaXZlbktleSwgdmFsLCBvcHRpb25zLCB2YWx1ZXNQYXJzZWQpIHtcbiAgICBpZiAoIWdpdmVuS2V5KSB7XG4gICAgICAgIHJldHVybjtcbiAgICB9XG5cbiAgICAvLyBUcmFuc2Zvcm0gZG90IG5vdGF0aW9uIHRvIGJyYWNrZXQgbm90YXRpb25cbiAgICB2YXIga2V5ID0gb3B0aW9ucy5hbGxvd0RvdHMgPyBnaXZlbktleS5yZXBsYWNlKC9cXC4oW14uW10rKS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ByZWZpeCArIChhbGxvd0RvdHMgPyAnLicgKyBrZXkgOiAnWycgKyBrZXkgKyAnXScpO1xuXG4gICAgICAgIHNpZGVDaGFubmVsLnNldChvYmplY3QsIHN0ZXApO1xuICAgICAgICB2YXIgdmFsdWVTaWRlQ2hhbm5lbCA9IGdldFNpZGVDaGFubmVsKCk7XG4gICAgICAgIHZhbHVlU2lkZUNoYW5uZWwuc2V0KHNlbnRpbmVsLCBzaWRlQ2hhbm5lbCk7XG4gICAgICAgIHB1c2hUb0FycmF5KHZhbHVlcywgc3RyaW5naWZ5KFxuICAgICAgICAgICAgdmFsdWUsXG4gICAgICAgICAgICBrZXlQcmVmaXgsXG4gICAgICAgICAgICBnZW5lcmF0ZUFycmF5UHJlZml4LFxuICAgICAgICAgICAgY29tbWFSb3VuZFRyaXAsXG4gICAgICAgICAgICBzdHJpY3ROdWxsSGFuZGxpbmcsXG4gICAgICAgICAgICBza2lwTnVsbHMsXG4gICAgICAgICAgICBnZW5lcmF0ZUFycmF5UHJlZml4ID09PSAnY29tbWEnICYmIGVuY29kZVZhbHVlc09ubHkgJiYgaXNBcnJheShvYmopID8gbnVsbCA6IGVuY29kZXIsXG4gICAgICAgICAgICBmaWx0ZXIsXG4gICAgICAgICAgICBzb3J0LFxuICAgICAgICAgICAgYWxsb3dEb3RzLFxuICAgICAgICAgICAgc2VyaWFsaXplRGF0ZSxcbiAgICAgICAgICAgIGZvcm1hdCxcbiAgICAgICAgICAgIGZvcm1hdHRlcixcbiAgICAgICAgICAgIGVuY29kZVZhbHVlc09ubHksXG4gICAgICAgICAgICBjaGFyc2V0LFxuICAgICAgICAgICAgdmFsdWVTaWRlQ2hhbm5lbFxuICAgICAgICApKTtcbiAgICB9XG5cbiAgICByZXR1cm4gdmFsdWVzO1xufTtcblxudmFyIG5vcm1hbGl6ZVN0cmluZ2lmeU9wdGlvbnMgPSBmdW5jdGlvbiBub3JtYWxpemVTdHJpbmdpZnlPcHRpb25zKG9wdHMpIHtcbiAgICBpZ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b3VuZFRyaXAgPSBnZW5lcmF0ZUFycmF5UHJlZml4ID09PSAnY29tbWEnICYmIG9wdHMgJiYgb3B0cy5jb21tYVJvdW5kVHJpcDtcblxuICAgIGlmICghb2JqS2V5cykge1xuICAgICAgICBvYmpLZXlzID0gT2JqZWN0LmtleXMob2JqKTtcbiAgICB9XG5cbiAgICBpZiAob3B0aW9ucy5zb3J0KSB7XG4gICAgICAgIG9iaktleXMuc29ydChvcHRpb25zLnNvcnQpO1xuICAgIH1cblxuICAgIHZhciBzaWRlQ2hhbm5lbCA9IGdldFNpZGVDaGFubmVsKCk7XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBvYmpLZXlzLmxlbmd0aDsgKytpKSB7XG4gICAgICAgIHZhciBrZXkgPSBvYmpLZXlzW2ldO1xuXG4gICAgICAgIGlmIChvcHRpb25zLnNraXBOdWxscyAmJiBvYmpba2V5XSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cbiAgICAgICAgcHVzaFRvQXJyYXkoa2V5cywgc3RyaW5naWZ5KFxuICAgICAgICAgICAgb2JqW2tleV0sXG4gICAgICAgICAgICBrZXksXG4gICAgICAgICAgICBnZW5lcmF0ZUFycmF5UHJlZml4LFxuICAgICAgICAgICAgY29tbWFSb3VuZFRyaXAsXG4gICAgICAgICAgICBvcHRpb25zLnN0cmljdE51bGxIYW5kbGluZyxcbiAgICAgICAgICAgIG9wdGlvbnMuc2tpcE51bGxzLFxuICAgICAgICAgICAgb3B0aW9ucy5lbmNvZGUgPyBvcHRpb25zLmVuY29kZXIgOiBudWxsLFxuICAgICAgICAgICAgb3B0aW9ucy5maWx0ZXIsXG4gICAgICAgICAgICBvcHRpb25zLnNvcnQsXG4gICAgICAgICAgICBvcHRpb25zLmFsbG93RG90cyxcbiAgICAgICAgICAgIG9wdGlvbnMuc2VyaWFsaXplRGF0ZSxcbiAgICAgICAgICAgIG9wdGlvbnMuZm9ybWF0LFxuICAgICAgICAgICAg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mF5ID0gW107XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCAyNTY7ICsraSkge1xuICAgICAgICBhcnJheS5wdXNoKCclJyArICgoaSA8IDE2ID8gJzAnIDogJycpICsgaS50b1N0cmluZygxNikpLnRvVXBwZXJDYXNlKCkpO1xuICAgIH1cblxuICAgIHJldHVybiBhcnJheTtcbn0oKSk7XG5cbnZhciBjb21wYWN0UXVldWUgPSBmdW5jdGlvbiBjb21wYWN0UXVldWUocXVldWUpIHtcbiAgICB3aGlsZSAocXVldWUubGVuZ3RoID4gMSkge1xuICAgICAgICB2YXIgaXRlbSA9IHF1ZXVlLnBvcCgpO1xuICAgICAgICB2YXIgb2JqID0gaXRlbS5vYmpbaXRlbS5wcm9wXTtcblxuICAgICAgICBpZiAoaXNBcnJheShvYmopKSB7XG4gICAgICAgICAgICB2YXIgY29tcGFjdGVkID0gW107XG5cbiAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgb2JqLmxlbmd0aDsgKytqKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBvYmpbal0gIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbXBhY3RlZC5wdXNoKG9ialtqXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpdGVtLm9ialtpdGVtLnByb3BdID0gY29tcGFjdGVkO1xuICAgICAgICB9XG4gICAgfVxufTtcblxudmFyIGFycmF5VG9PYmplY3QgPSBmdW5jdGlvbiBhcnJheVRvT2JqZWN0KHNvdXJjZSwgb3B0aW9ucykge1xuICAgIHZhciBvYmogPSBvcHRpb25zICYmIG9wdGlvbnMucGxhaW5PYmplY3RzID8gT2JqZWN0LmNyZWF0ZShudWxsKSA6IHt9O1xuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc291cmNlLmxlbmd0aDsgKytpKSB7XG4gICAgICAgIGlmICh0eXBlb2Ygc291cmNlW2ldICE9PSAndW5k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oYyA+PSAweDMwICYmIGMgPD0gMHgzOSkgLy8gMC05XG4gICAgICAgICAgICB8fCAoYyA+PSAweDQxICYmIGMgPD0gMHg1QSkgLy8gYS16XG4gICAgICAgICAgICB8fCAoYyA+PSAweDYxICYmIGMgPD0gMHg3QSkgLy8gQS1aXG4gICAgICAgICAgICB8fCAoZm9ybWF0ID09PSBmb3JtYXRzLlJGQzE3MzggJiYgKGMgPT09IDB4MjggfHwgYyA9PT0gMHgyOSkpIC8vICggKVxuICAgICAgICApIHtcbiAgICAgICAgICAgIG91dCArPSBzdHJpbmcuY2hhckF0KGkpO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4ODApIHtcbiAgICAgICAgICAgIG91dCA9IG91dCArIGhleFRhYmxlW2NdO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4ODAwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyAoaGV4VGFibGVbMHhDMCB8IChjID4+IDYpXSArIGhleFRhYmxlWzB4ODAgfCAoYyAmIDB4M0YpXSk7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjIDwgMHhEODAwIHx8IGMgPj0gMHhFMDAwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyAoaGV4VGFibGVbMHhFMCB8IChjID4+IDEyKV0gKyBoZXhUYWJsZVsweDgwIHwgKChjID4+IDYpICYgMHgzRildICsgaGV4VGFibGVbMHg4MCB8IChjICYgMHgzRildKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaSArPSAxO1xuICAgICAgICBjID0gMHgxMDAwMCArICgoKGMgJiAweDNGRikgPDwgMTApIHwgKHN0cmluZy5jaGFyQ29kZUF0KGkpICYgMHgzRkYpKTtcbiAgICAgICAgLyogZXNsaW50IG9wZXJhdG9yLWxpbmVicmVhazogWzIsIFwiYmVmb3JlXCJdICovXG4gICAgICAgIG91dCArPSBoZXhUYWJsZVsweEYwIHwgKGMgPj4gMTgpXVxuICAgICAgICAgICAgKyBoZXhUYWJsZVsweDgwIHwgKChjID4+IDEyKSAmIDB4M0YpXVxuICAgICAgICAgICAgKyBoZXhUYWJsZVsweDgwIHwgKChjID4+IDYpICYgMHgzRildXG4gICAgICAgICAgICArIGhleFRhYmxlWzB4ODAgfCAoYyAmIDB4M0YpXTtcbiAgICB9XG5cbiAgICByZXR1cm4gb3V0O1xufTtcblxudmFyIGNvbXBhY3QgPSBmdW5jdGlvbiBjb21wYWN0KHZhbHVlKSB7XG4gICAgdmFyIHF1ZXVlID0gW3sgb2JqOiB7IG86IHZhbHVlIH0sIHByb3A6ICdvJyB9XTtcbiAgICB2YXIgcmVmcyA9IFtdO1xuXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBxdWV1ZS5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIgaXRlbSA9IHF1ZXVlW2ldO1xuICAgICAgICB2YXIgb2JqID0gaXRlbS5vYmpbaXRlbS5wcm9wXTtcblxuICAgICAgICB2YXIga2V5cyA9IE9iamVjdC5rZXlzKG9iaik7XG4gICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwga2V5cy5sZW5ndGg7ICsraikge1xuICAgICAgICAgICAgdmFyIGtleSA9IGtleXNbal07XG4gICAgICAgICAgICB2YXIgdmFsID0gb2JqW2tleV07XG4gICAgICAgICAgICBpZiAodHlwZW9mIHZhbCA9PT0gJ29iamVjdCcgJiYgdmFsICE9PSBudWxsICYmIHJlZnMuaW5kZXhPZih2YWwpID09PSAtMSkge1xuICAgICAgICAgICAgICAgIHF1ZXVlLnB1c2goeyBvYmo6IG9iaiwgcHJvcDoga2V5IH0pO1xuICAgICAgICAgICAgICAgIHJlZnMucHVzaCh2YWwpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgY29tcGFjdFF1Z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AgICB9XG4gICAgICAgIGNvbnN0IHRvcCA9IHRoaXMuaGVhcFswXTtcbiAgICAgICAgaWYgKHRoaXMubGVuKCkgPiAxKSB7XG4gICAgICAgICAgICB0aGlzLmhlYXBbMF0gPSB0aGlzLmhlYXAucG9wKCk7XG4gICAgICAgICAgICB0aGlzLnVwZGF0ZURvd24oMCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmhlYXAucG9wKCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRvcDtcbiAgICB9XG4gICAgZmluZCh2KSB7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy5sZW4oKTsgaSsrKSB7XG4gICAgICAgICAgICBpZiAodiA9PSB0aGlzLmhlYXBbaV0udmFsdWUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5oZWFwW2ldO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgIH1cbiAgICByZW1vdmUodikge1xuICAgICAgICBsZXQgaW5kZXggPSBudWxsO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRoaXMubGVuKCk7IGkrKykge1xuICAgICAgICAgICAgaWYgKHYgPT0gdGhpcy5oZWFwW2ldLnZhbHVlKSB7XG4gICAgICAgICAgICAgICAgaW5kZXggPSBpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChpbmRleCA9PT0gbnVsbCkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLmxlbigpID4gMSkge1xuICAgICAgICAgICAgbGV0IGxhc3QgPSB0aGlzLmhlYXAucG9wKCk7XG4gICAgICAgICAgICBpZiAobGFzdC52YWx1ZSAhPSB2KSB7IC8vIGlmIHRoZSBsYXN0IG9uZSBpcyBiZWluZyByZW1vdmVkLCBkbyBub3RoaW5nXG4gICAgICAgICAgICAgICAgdGhpcy5oZWFwW2luZGV4XSA9IGxhc3Q7XG4gICAgICAgICAgICAgICAgdGhpcy51cGRhdGVEb3duKGluZGV4KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5oZWFwLnBvcCgpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cbiAgICBwYXJlbnROb2RlKHgpIHtcbiAgICAgICAgcmV0dXJuIE1hdGguZmxvb3IoKHggLSAxKSAvIDIpO1xuICAgIH1cbiAgICBsZWZ0Q2hpbGROb2RlKHgpIHtcbiAgICAgICAgcmV0dXJuIDIgKiB4ICsgMTtcbiAgICB9XG4gICAgcmlnaHRDaGlsZE5vZGUoeCkge1xuICAgICAgICByZXR1cm4gMiAqIHggKyAyO1xuICAgIH1cbiAgICBleGlzdE5vZGUoeCkge1xuICAgICAgICByZXR1cm4geCA+PSAwICYmIHggPCB0aGlzLmhlYXAubGVuZ3RoO1xuICAgIH1cbiAgICBzd2FwKHgsIHkpIHtcbiAgICAgICAgY29uc3QgdCA9IHRoaXMuaGVhcFt4XTtcbiAgICAgICAgdGhpcy5oZWFwW3hdID0gdGhpcy5oZWFwW3ldO1xuICAgICAgICB0aGlzLmhlYXBbeV0gPSB0O1xuICAgIH1cbiAgICBtaW5Ob2RlKG51bWJlcnMpIHtcbiAgICAgICAgY29uc3QgdmFsaWRudW1iZXJzID0gbnVtYmVycy5maWx0ZXIodGhpcy5leGlzdE5vZGUuYmluZCh0aGlzKSk7XG4gICAgICAgIGxldCBtaW5pbWFsID0gdmFsaWRudW1iZXJzWzBdO1xuICAgICAgICBmb3IgKGNvbnN0IGkgb2YgdmFsaWRudW1iZXJzKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5sZXNzVGhhbih0aGlzLmhlYXBbaV0sIHRoaXMuaGVhcFttaW5pbWFsXSkpIHtcbiAgICAgICAgICAgICAgICBtaW5pbWFsID0gaTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbWluaW1hbDtcbiAgICB9XG4gICAgdXBkYXRlVXAoeCkge1xuICAgICAgICBpZiAoeCA9PSAwKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgY29uc3QgcGFyZW50ID0gdGhpcy5wYXJlbnROb2RlKHgpO1xuICAgICAgICBpZiAodGhpcy5leGlzdE5vZGUocGFyZW50KSAmJiB0aGlzLmxlc3NUaGFuKHRoaXMuaGVhcFt4XSwgdGhpcy5oZWFwW3BhcmVudF0pKSB7XG4gICAgICAgICAgICB0aGlzLnN3YXAoeCwgcGFyZW50KTtcbiAgICAgICAgICAgIHRoaXMudXBkYXRlVXAocGFyZW50KTtcbiAgICAgICAgfVxuICAgIH1cbiAgICB1cGRhdGVEb3duKHgpIHtcbiAgICAgICAgY29uc3QgbGVmdENoaWxkID0gdGhpcy5sZWZ0Q2hpbGROb2RlKHgpO1xuICAgICAgICBjb25zdCByaWdodENoaWxkID0gdGhpcy5yaWdodENoaWxkTm9kZSh4KTtcbiAgICAgICAgaWYgKCF0aGlzLmV4aXN0Tm9kZShsZWZ0Q2hpbGQpKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgY29uc3QgbSA9IHRoaXMubWluTm9kZShbeCwgbGVmdENoaWxkLCByaWdodENoaWxkXSk7XG4gICAgICAgIGlmIChtICE9IHgpIHtcbiAgICAgICAgICAgIHRoaXMuc3dhcCh4LCBtKTtcbiAgICAgICAgICAgIHRoaXMudXBkYXRlRG93bihtKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBkZWJ1Z1ByaW50KCkge1xuICAgICAgICBjb25zb2xlLmxvZyh0aGlzLmhlYXApO1xuICAgIH1cbn1cbiIsImltcG9ydCB7IGNsYW1wIH0gZnJvbSBcIi4vdXRpbC5qc1wiO1xuaW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KiogU2hpZnQga2V5LiAqL1xuICAgIFZLX1NISUZUOiAxNixcbiAgICAvKiogQ29udHJvbCBrZXkuICovXG4gICAgVktfQ09OVFJPTDogMTcsXG4gICAgLyoqIEFsdCAoT3B0aW9uIG9uIE1hYykga2V5LiAqL1xuICAgIFZLX0FMVDogMTgsXG4gICAgLyoqIFBhdXNlIGtleS4gKi9cbiAgICBWS19QQVVTRTogMTksXG4gICAgLyoqIENhcHMgbG9jay4gKi9cbiAgICBWS19DQVBTX0xPQ0s6IDIwLFxuICAgIC8qKiBFc2NhcGUga2V5LiAqL1xuICAgIFZLX0VTQ0FQRTogMjcsXG4gICAgLyoqIFNwYWNlIGJhci4gKi9cbiAgICBWS19TUEFDRTogMzIsXG4gICAgLyoqIFBhZ2UgVXAga2V5LiAqL1xuICAgIFZLX1BBR0VfVVA6IDMzLFxuICAgIC8qKiBQYWdlIERvd24ga2V5LiAqL1xuICAgIFZLX1BBR0VfRE9XTjogMzQsXG4gICAgLyoqIEVuZCBrZXkuICovXG4gICAgVktfRU5EOiAzNSxcbiAgICAvKiogSG9tZSBrZXkuICovXG4gICAgVktfSE9NRTogMzYsXG4gICAgLyoqIExlZnQgYXJyb3cuICovXG4gICAgVktfTEVGVDogMzcsXG4gICAgLyoqIFVwIGFycm93LiAqL1xuICAgIFZLX1VQOiAzOCxcbiAgICAvKiogUmlnaHQgYXJyb3cuICovXG4gICAgVktfUklHSFQ6IDM5LFxuICAgIC8qKiBEb3duIGFycm93LiAqL1xuICAgIFZLX0RPV046IDQwLFxuICAgIC8qKiBQcmludCBTY3JlZW4ga2V5LiAqL1xuICAgIFZLX1BSSU5UU0NSRUVOOiA0NCxcbiAgICAvKiogSW5zKGVydCkga2V5LiAqL1xuICAgIFZLX0lOU0VSVDogNDUsXG4gICAgLyoqIERlbChldGUpIGtleS4gKi9cbiAgICBWS19ERUxFVEU6IDQ2LFxuICAgIC8qKiovXG4gICAgVktfMDogNDgsXG4gICAgLyoqKi9cbiAgICBWS18xOiA0OSxcbiAgICAvKioqL1xuICAgIFZLXzI6IDUwLFxuICAgIC8qKiovXG4gICAgVktfMzogNTEsXG4gICAgLyoqKi9cbiAgICBWS180OiA1MixcbiAgICAvKioqL1xuICAgIFZLXzU6IDUzLFxuICAgIC8qKiovXG4gICAgVktfNjogNTQsXG4gICAgLyoqKi9cbiAgICBWS183OiA1NSxcbiAgICAvKioqL1xuICAgIFZLXzg6IDU2LFxuICAgIC8qKiovXG4gICAgVktfOTogNTcsXG4gICAgLyoqIENvbG9uICg6KSBrZXkuIFJlcXVpcmVzIEdlY2tvIDE1LjAgKi9cbiAgICBWS19DT0xPTjogNTgsXG4gICAgLyoqIFNlbWljb2xvbiAoOykga2V5LiAqL1xuICAgIFZLX1NFTUlDT0xPTjogNTksXG4gICAgLyoqIExlc3MtdGhhbiAoPCkga2V5LiBSZXF1aXJlcyBHZWNrbyAxNS4wICovXG4gICAgVktfTEVTU19USEFOOiA2MCxcbiAgICAvKiogRXF1YWxzICg9KSBrZXkuICovXG4gICAgVktfRVFVQUxTOiA2MSxcbiAgICAvKiogR3JlYXRlci10aGFuICg+KSBrZXkuIFJlcXVpcmVzIEdlY2tvIDE1LjAgKi9cbiAgICBWS19HUkVBVEVSX1RIQU46IDYyLFxuICAgIC8qKiBRdWVzdGlvbiBtYXJrICg/KSBrZXkuIFJlcXVpcmVzIEdlY2tvIDE1LjAgKi9cbiAgICBWS19RVUVTVElPTl9NQVJLOiA2MyxcbiAgICAvKiogQXRtYXJrIChAKSBrZXkuIFJlcXVpcmVzIEdlY2tvIDE1LjAgKi9cbiAgICBWS19BVDogNjQsXG4gICAgLyoqKi9cbiAgICBWS19BOiA2NSxcbiAgICAvKioqL1xuICAgIFZLX0I6IDY2LFxuICAgIC8qKiovXG4gICAgVktfQzogNjcsXG4gICAgLyoqKi9cbiAgICBWS19EOiA2OCxcbiAgICAvKioqL1xuICAgIFZLX0U6IDY5LFxuICAgIC8qKiovXG4gICAgVktfRjogNzAsXG4gICAgLyoqKi9cbiAgICBWS19HOiA3MSxcbiAgICAvKioqL1xuICAgIFZLX0g6IDcyLFxuICAgIC8qKiovXG4gICAgVktfSTogNzMsXG4gICAgLyoqKi9cbiAgICBWS19KOiA3NCxcbiAgICAvKioqL1xuICAgIFZLX0s6IDc1LFxuICAgIC8qKiovXG4gICAgVktfTDogNzYsXG4gICAgLyoqKi9cbiAgICBWS19NOiA3NyxcbiAgICAvKioqL1xuICAgIFZLX046IDc4LFxuICAgIC8qKiovXG4gICAgVktfTzogNzksXG4gICAgLyoqKi9cbiAgICBWS19QOiA4MCxcbiAgICAvKioqL1xuICAgIFZLX1E6IDgxLFxuICAgIC8qKiovXG4gICAgVktfUjogODIsXG4gICAgLyoqKi9cbiAgICBWS19TOiA4MyxcbiAgICAvKioqL1xuICAgIFZLX1Q6IDg0LFxuICAgIC8qKiovXG4gICAgVktfVTogODUsXG4gICAgLyoqKi9cbiAgICBWS19WOiA4NixcbiAgICAvKioqL1xuICAgIFZLX1c6IDg3LFxuICAgIC8qKiovXG4gICAgVktfWDogODgsXG4gICAgLyoqKi9cbiAgICBWS19ZOiA4OSxcbiAgICAvKioqL1xuICAgIFZLX1o6IDkwLFxuICAgIC8qKiovXG4gICAgVktfQ09OVEVYVF9NRU5VOiA5MyxcbiAgICAvKiogMCBvbiB0aGUgbnVtZXJpYyBrZXlwYWQuICovXG4gICAgVktfTlVNUEFEMDogOTYsXG4gICAgLyoqIDEgb24gdGhlIG51bWVyaWMga2V5cGFkLiAqL1xuICAgIFZLX05VTVBBRDE6IDk3LFxuICAgIC8qKiAyIG9uIHRoZSBudW1lcmljIGtleXBhZC4gKi9cbiAgICBWS19OVU1QQUQyOiA5OCxcbiAgICAvKiogMyBvbiB0aGUgbnVtZXJpYyBrZXlwYWQuICovXG4gICAgVktfTlVNUEFEMzogOTksXG4gICAgLyoqIDQgb24gdGhlIG51bWVyaWMga2V5cGFkLiAqL1xuICAgIFZLX05VTVBBRDQ6IDEwMCxcbiAgICAvKiogNSBvbiB0a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gLyoqIEY3IGtleS4gKi9cbiAgICBWS19GNzogMTE4LFxuICAgIC8qKiBGOCBrZXkuICovXG4gICAgVktfRjg6IDExOSxcbiAgICAvKiogRjkga2V5LiAqL1xuICAgIFZLX0Y5OiAxMjAsXG4gICAgLyoqIEYxMCBrZXkuICovXG4gICAgVktfRjEwOiAxMjEsXG4gICAgLyoqIEYxMSBrZXkuICovXG4gICAgVktfRjExOiAxMjIsXG4gICAgLyoqIEYxMiBrZXkuICovXG4gICAgVktfRjEyOiAxMjMsXG4gICAgLyoqIEYxMyBrZXkuICovXG4gICAgVktfRjEzOiAxMjQsXG4gICAgLyoqIEYxNCBrZXkuICovXG4gICAgVktfRjE0OiAxMjUsXG4gICAgLyoqIEYxNSBrZXkuICovXG4gICAgVktfRjE1OiAxMjYsXG4gICAgLyoqIEYxNiBrZXkuICovXG4gICAgVktfRjE2OiAxMjcsXG4gICAgLyoqIEYxNyBrZXkuICovXG4gICAgVktfRjE3OiAxMjgsXG4gICAgLyoqIEYxOCBrZXkuICovXG4gICAgVktfRjE4OiAxMjksXG4gICAgLyoqIEYxOSBrZXkuICovXG4gICAgVktfRjE5OiAxMzAsXG4gICAgLyoqIEYyMCBrZXkuICovXG4gICAgVktfRjIwOiAxMzEsXG4gICAgLyoqIEYyMSBrZXkuICovXG4gICAgVktfRjIxOiAxMzIsXG4gICAgLyoqIEYyMiBrZXkuICovXG4gICAgVktfRjIyOiAxMzMsXG4gICAgLyoqIEYyMyBrZXkuICovXG4gICAgVktfRjIzOiAxMzQsXG4gICAgLyoqIEYyNCBrZXkuICovXG4gICAgVktfRjI0OiAxMzUsXG4gICAgLyoqIE51bSBMb2NrIGtleS4gKi9cbiAgICBWS19OVU1fTE9DSzogMTQ0LFxuICAgIC8qKiBTY3JvbGwgTG9jayBrZXkuICovXG4gICAgVktfU0NST0xMX0xPQ0s6IDE0NSxcbiAgICAvKiogQ2lyY3VtZmxleCAoXikga2V5LiBSZXF1aXJlcyBHZWNrbyAxNS4wICovXG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PSBub3RoaW5nLCB0cnVlID0gYWxsLCBvYmplY3QgPSBkaXJ0eSBjZWxsc1xuICAgICAgICAgICAgdGhpcy5fb3B0aW9ucyA9IHt9O1xuICAgICAgICAgICAgb3B0aW9ucyA9IE9iamVjdC5hc3NpZ24oe30sIERFRkFVTFRfT1BUSU9OUywgb3B0aW9ucyk7XG4gICAgICAgICAgICB0aGlzLnNldE9wdGlvbnMob3B0aW9ucyk7XG4gICAgICAgICAgICB0aGlzLkRFQlVHID0gdGhpcy5ERUJVRy5iaW5kKHRoaXMpO1xuICAgICAgICAgICAgdGhpcy5fdGljayA9IHRoaXMuX3RpY2suYmluZCh0aGlzKTtcbiAgICAgICAgICAgIHRoaXMuX2JhY2tlbmQuc2NoZWR1bGUodGhpcy5fdGljayk7XG4gICAgICAgIH1cbiAgICAgICAgLyoqXG4gICAgICAgICAqIERlYnVnIGhlbHBlciwgaWRlYWwgYXMgYSBtYXAgZ2VuZXJhdG9yIGNhbGxiYWNrLiBBbHdheXMgYm91bmQgdG8gdGhpcy5cbiAgICAgICAgICogQHBhcmFtIHtpbnR9IHhcbiAgICAgICAgICogQHBhcmFtIHtpbnR9IHlcbiAgICAgICAgICogQHBhcmFtIHtpbnR9IHdoYXRcbiAgICAgICAgICovXG4gICAgICAgIERFQlVHKHgsIHksIHdoYXQpIHtcbiAgICAgICAgICAgIGxldCBjb2xvcnMgPSBbdGhpcy5fb3B0aW9ucy5iZywgdGhpcy5fb3B0aW9ucy5mZ107XG4gICAgICAgICAgICB0aGlzLmRyYXcoeCwgeSwgbnVsbCwgbnVsbCwgY29sb3JzW3doYXQgJSBjb2xvcnMubGVuZ3RoXSk7XG4gICAgICAgIH1cbiAgICAgICAgLyoqXG4gICAgICAgICAqIENsZWFyIHRoZSB3aG9sZSBkaXNwbGF5IChjb3ZlciBpdCB3aXRoIGJhY2tncm91bmQgY29sb3IpXG4gICAgICAgICAqL1xuICAgICAgICBjbGVhcigpIHtcbiAgICAgICAgICAgIHRoaXMuX2RhdGEgPSB7fTtcbiAgICAgICAgICAgIHRoaXMuX2RpcnR5ID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICAvKipcbiAgICAgICAgICogQHNlZSBST1QuRGlzcGxheVxuICAgICAgICAgKi9cbiAgICAgICAgc2V0T3B0aW9ucyhvcHRpb25zKSB7XG4gICAgICAgICAgICBPYmplY3QuYXNzaWduKHRoaXMuX29wdGlvbnMsIG9wdGlvbnMpO1xuICAgICAgICAgICAgaWYgKG9wdGlvbnMud2lkdGggfHwgb3B0aW9ucy5oZWlnaHQgfHwgb3B0aW9ucy5mb250U2l6ZSB8fCBvcHRpb25zLmZvbnRGYW1pbHkgfHwgb3B0aW9ucy5zcGFjaW5nIHx8IG9wdGlvbnMubGF5b3V0KSB7XG4gICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMubGF5b3V0KSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBjdG9yID0gQkFDS0VORFNbb3B0aW9ucy5sYXlvdXRdO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9iYWNrZW5kID0gbmV3IGN0b3IoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5fYmFja2VuZC5zZXRPcHRpb25zKHRoaXMuX29wdGlvbnMpO1xuICAgICAgICAgICAgICAgIHRoaXMuX2RpcnR5ID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBSZXR1cm5zIGN1cnJlbnRseSBzZXQgb3B0aW9uc1xuICAgICAgICAgKi9cbiAgICAgICAgZ2V0T3B0aW9ucygpIHsgcmV0dXJuIHRoaXMuX29wdGlvbnM7IH1cbiAgICAgICAgLyoqXG4gICAgICAgICAqIFJldHVybnMgdGhlIERPTSBub2RlIG9mIHRoaXMgZGlzcGxheVxuICAgICAgICAgKi9cbiAgICAgICAgZ2V0Q29udGFpbmVyKCkgeyBy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F2YWlsV2lkdGgsIGF2YWlsSGVpZ2h0KTtcbiAgICAgICAgfVxuICAgICAgICBjb21wdXRlVGlsZVNpemUoYXZhaWxXaWR0aCwgYXZhaWxIZWlnaHQpIHtcbiAgICAgICAgICAgIGxldCB3aWR0aCA9IE1hdGguZmxvb3IoYXZhaWxXaWR0aCAvIHRoaXMuX29wdGlvbnMud2lkdGgpO1xuICAgICAgICAgICAgbGV0IGhlaWdodCA9IE1hdGguZmxvb3IoYXZhaWxIZWlnaHQgLyB0aGlzLl9vcHRpb25zLmhlaWdodCk7XG4gICAgICAgICAgICByZXR1cm4gW3dpZHRoLCBoZWlnaHRdO1xuICAgICAgICB9XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBDb252ZXJ0IGEgRE9NIGV2ZW50IChtb3VzZSBvciB0b3VjaCkgdG8gbWFwIGNvb3JkaW5hdGVzLiBVc2VzIGZpcnN0IHRvdWNoIGZvciBtdWx0aS10b3VjaC5cbiAgICAgICAgICogQHBhcmFtIHtFdmVudH0gZSBldmVudFxuICAgICAgICAgKiBAcmV0dXJucyB7aW50WzJdfSAtMSBmb3IgdmFsdWVzIG91dHNpZGUgb2YgdGhlIGNhbnZhc1xuICAgICAgICAgKi9cbiAgICAgICAgZXZlbnRUb1Bvc2l0aW9uKGUpIHtcbiAgICAgICAgICAgIGxldCB4LCB5O1xuICAgICAgICAgICAgaWYgKFwidG91Y2hlc1wiIGluIGUpIHtcbiAgICAgICAgICAgICAgICB4ID0gZS50b3VjaGVzWzBdLmNsaWVudFg7XG4gICAgICAgICAgICAgICAgeSA9IGUudG91Y2hlc1swXS5jbGllbnRZO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgeCA9IGUuY2xpZW50WDtcbiAgICAgICAgICAgICAgICB5ID0gZS5jbGllbnRZO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2JhY2tlbmQuZXZlbnRUb1Bvc2l0aW9uKHgsIHkpO1xuICAgICAgICB9XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAcGFyYW0ge2ludH0geFxuICAgICAgICAgKiBAcGFyYW0ge2ludH0geVxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZyB8fCBzdHJpbmdbXX0gY2ggT25lIG9yIG1vcmUgY2hhcnMgKHdpbGwgYmUgb3ZlcmxhcHBpbmcgdGhlbXNlbHZlcylcbiAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IFtmZ10gZm9yZWdyb3VuZCBjb2xvclxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gW2JnXSBiYWNrZ3JvdW5kIGNvbG9yXG4gICAgICAgICAqL1xuICAgICAgICBkcmF3KHgsIHksIGNoLCBmZywgYmcpIHtcbiAgICAgICAgICAgIGlmICghZmcpIHtcbiAgICAgICAgICAgICAgICBmZyA9IHRoaXMuX29wdGlvbnMuZmc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIWJnKSB7XG4gICAgICAgICAgICAgICAgYmcgPSB0aGlzLl9vcHRpb25zLmJnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IGtleSA9IGAke3h9LCR7eX1gO1xuICAgICAgICAgICAgdGhpcy5fZGF0YVtrZXldID0gW3gsIHksIGNoLCBmZywgYmddO1xuICAgICAgICAgICAgaWYgKHRoaXMuX2RpcnR5ID09PSB0cnVlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfSAvLyB3aWxsIGFscmVhZHkgcmVkcmF3IGV2ZXJ5dGhpbmcgXG4gICAgICAgICAgICBpZiAoIXRoaXMuX2RpcnR5KSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fZGlydHkgPSB7fTtcbiAgICAgICAgICAgIH0gLy8gZmlyc3QhXG4gICAgICAgICAgICB0aGlzLl9kaXJ0eVtrZXldID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICAvKipcbiAgICAgICAgICogQHBhcmFtIHtpbnR9IHhcbiAgICAgICAgICogQHBhcmFtIHtpbnR9IHlcbiAgICAgICAgICogQHBhcmFtIHtzdHJpbmcgfHwgc3RyaW5nW119IGNoIE9uZSBvciBtb3JlIGNoYXJzICh3aWxsIGJlIG92ZXJsYXBwaW5nIHRoZW1zZWx2ZXMpXG4gICAgICAgICAqIEBwYXJhbSB7c3RyaW5nIHx8IG51bGx9IFtmZ10gZm9yZWdyb3VuZCBjb2xvclxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZyB8fCBudWxsfSBbYmddIGJhY2tncm91bmQgY29sb3JcbiAgICAgICAgICovXG4gICAgICAgIGRyYXdPdmVyKHgsIHksIGNoLCBmZywgYmcpIHtcbiAgICAgICAgICAgIGNvbnN0IGtleSA9IGAke3h9LCR7eX1gO1xuICAgICAgICAgICAgY29uc3QgZXhpc3RpbmcgPSB0aGlzLl9kYXRhW2tleV07XG4gICAgICAgICAgICBpZiAoZXhpc3RpbmcpIHtcbiAgICAgICAgICAgICAgICBleGlzdGluZ1syXSA9IGNoIHx8IGV4aXN0aW5nWzJdO1xuICAgICAgICAgICAgICAgIGV4aXN0aW5nWzNdID0gZmcgfHwgZXhpc3RpbmdbM107XG4gICAgICAgICAgICAgICAgZXhpc3RpbmdbNF0gPSBiZyB8fCBleGlzdGluZ1s0XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuZHJhdyh4LCB5LCBjaCwgZmcsIGJnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvKipcbiAgICAgICAgICogRHJhd3MgYSB0ZXh0IGF0IGdpdmVuIHBvc2l0aW9uLiBPcHRpb25hbGx5IHdyYXBzIGF0IGEgbWF4aW11bSBsZW5ndGguIEN1cnJlbnRseSBkb2VzIG5vdCB3b3JrIHdpdGggaGV4IGxheW91dC5cbiAgICAgICAgICogQHBhcmFtIHtpbnR9IHhcbiAgICAgICAgICogQHBhcmFtIHtpbnR9IHlcbiAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IHRleHQgTWF5IGNvbnRhaW4gY29sb3IvYmFja2dyb3VuZCBmb3JtYXQgc3BlY2lmaWVycywgJWN7bmFtZX0vJWJ7bmFtZX0sIGJvdGggb3B0aW9uYWwuICVje30vJWJ7fSByZXNldHMgdG8gZGVmYXVsdC5cbiAgICAgICAgICogQHBhcmFtIHtpbnR9IFttYXhXaWR0aF0gd3JhcCBhdCB3aGF0IHdpZHRoP1xuICAgICAgICAgKiBAcmV0dXJucyB7aW50fSBsaW5lcyBkcmF3blxuICAgICAgICAgKi9cbiAgICAgICAgZHJhd1RleHQoeCwgeSwgdGV4dCwgbWF4V2lkdGgpIHtcbiAgICAgICAgICAgIGxldCBmZyA9IG51bGw7XG4gICAgICAgICAgICBsZXQgYmcgPSBudWxsO1xuICAgICAgICAgICAgbGV0IGN4ID0geDtcbiAgICAgICAgICAgIGxldCBjeSA9IHk7XG4gICAgICAgICAgICBsZXQgbGluZXMgPSAxO1xuICAgICAgICAgICAgaWYgKCFtYXhXaWR0aCkge1xuICAgICAgICAgICAgICAgIG1heFdpZHRoID0gdGhpcy5fb3B0aW9ucy53aWR0aCAtIHg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdG9rZW5zID0gVGV4dC50b2tlbml6ZSh0ZXh0LCBtYXhXaWR0aCk7XG4gICAgICAgICAgICB3aGlsZSAodG9rZW5zLmxlbmd0aCkgeyAvLyBpbnRlcnByZXQgdG9rZW5pemVkIG9wY29kZSBzdHJlYW1cbiAgICAgICAgICAgICAgICBsZXQgdG9rZW4gPSB0b2tlbnMuc2hpZnQoKTtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRva2VuLnR5cGUpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSBUZXh0LlRZUEVfVEVYVDpcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpc1NwYWNlID0gZmFsc2UsIGlzUHJldlNwYWNlID0gZmFsc2UsIGlzRnVsbFdpZHRoID0gZmFsc2UsIGlzUHJldkZ1bGxXaWR0aCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0b2tlbi52YWx1ZS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjYyA9IHRva2VuLnZhbHVlLmNoYXJDb2RlQXQoaSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGMgPSB0b2tlbi52YWx1ZS5jaGFyQXQoaSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX29wdGlvbnMubGF5b3V0ID09PSBcInRlcm1cIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgY2NoID0gY2MgPj4gODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGlzQ0pLID0gY2NoID09PSAweDExIHx8IChjY2ggPj0gMHgyZSAmJiBjY2ggPD0gMHg5ZikgfHwgKGNjaCA+PSAweGFjICYmIGNjaCA8PSAweGQ3KSB8fCAoY2MgPj0gMHhBOTYwICYmIGNjIDw9IDB4QTk3Rik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0NKSykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kcmF3KGN4ICsgMCwgY3ksIGMsIGZnLCBiZyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRyYXcoY3ggKyAxLCBjeSwgXCJcXHRcIiwgZmcsIGJnKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN4ICs9IDI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBc3NpZ24gdG8gYHRydWVgIHdoZW4gdGhlIGN1cnJlbnQgY2hhciBpcyBmdWxsLXdpZHRoLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzRnVsbFdpZHRoID0gKGNjID4gMHhmZjAwICYmIGNjIDwgMHhmZjYxKSB8fCAoY2MgPiAweGZmZGMgJiYgY2MgPCAweGZmZTgpIHx8IGNjID4gMHhmZmVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEN1cnJlbnQgY2hhciBpcyBzcGFjZSwgd2hhdGV2ZXIgZnVsbC13aWR0aCBvciBoYWxmLXdpZHRoIGJvdGggYXJlIE9LLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzU3BhY2UgPSAoYy5jaGFyQ29kZUF0KDApID09IDB4MjAgfHwgYy5jaGFyQ29kZUF0KDApID09IDB4MzAwMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhlIHByZXZpb3VzIGNoYXIgaXMgZnVsbC13aWR0aCBhbmRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBjdXJyZW50IGNoYXIgaXMgbmV0aGVyIGhhbGYtd2lkdGggbm9yIGEgc3BhY2UuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzUHJldkZ1bGxXaWR0aCAmJiAhaXNGdWxsV2lkdGggJiYgIWlzU3BhY2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3grKztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IC8vIGFkZCBhbiBleHRyYSBwb3NpdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoZSBjdXJyZW50IGNoYXIgaXMgZnVsbC13aWR0aCBhbmRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgcHJldmlvdXMgY2hhciBpcyBub3QgYSBzcGFjZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNGdWxsV2lkdGggJiYgIWlzUHJldlNwYWNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN4Kys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSAvLyBhZGQgYW4gZXh0cmEgcG9zaXRpb25cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRyYXcoY3grKywgY3ksIGMsIGZnLCBiZyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNQcmV2U3BhY2UgPSBpc1NwYWNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzUHJldkZ1bGxXaWR0aCA9IGlzRnVsbFdpZHRoO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgVGV4dC5UWVBFX0ZHOlxuICAgICAgICAgICAgICAgICAgICAgICAgZmcgPSB0b2tlbi52YWx1ZSB8fCBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgVGV4dC5UWVBFX0JHOlxuICAgICAgICAgICAgICAgICAgICAgICAgYmcgPSB0b2tlbi52YWx1ZSB8fCBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgVGV4dC5UWVBFX05FV0xJTkU6XG4gICAgICAgICAgICAgICAgICAgICAgICBjeCA9IHg7XG4gICAgICAgICAgICAgICAgICAgICAgICBjeSsrO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZXMrKztcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBsaW5lcztcbiAgICAgICAgfVxuICAgICAgICAvKipcbiAgICAgICAgICogVGltZXIgdGljazogdXBkYXRlIGRpcnR5IHBhcnRzXG4gICAgICAgICAqL1xuICAgICAgICBfdGljaygpIHtcbiAgICAgICAgICAgIHRoaXMuX2JhY2tlbmQuc2NoZWR1bGUodGhpcy5fdGljayk7XG4gICAgICAgICAgICBpZiAoIXRoaXMuX2RpcnR5KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRoaXMuX2RpcnR5ID09PSB0cnVlKSB7IC8vIGRyYXcgYWxsXG4gICAgICAgICAgICAgICAgdGhpcy5fYmFja2VuZC5jbGVhcigpO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGlkIGluIHRoaXMuX2RhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fZHJhdyhpZCwgZmFsc2UpO1xuICAgICAgICAgICAgICAgIH0gLy8gcmVkcmF3IGNhY2hlZCBkYXRhIFxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7IC8vIGRyYXcgb25seSBkaXJ0eSBcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBrZXkgaW4gdGhpcy5fZGlydHkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fZHJhdyhrZXksIHRydWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuX2RpcnR5ID0gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBrZXkgV2hhdCB0byBkcmF3XG4gICAgICAgICAqIEBwYXJhbSB7Ym9vbH0gY2xlYXJCZWZvcmUgSXMgaXQgbmVjZXNzYXJ5IHRvIGNsZWFuIGJlZm9yZT9cbiAgICAgICAgICovXG4gICAgICAgIF9kcmF3KGtleSwgY2xlYXJCZWZvcmUpIHtcbiAgICAgICAgICAgIGxldCBkYXRhID0gdGhpcy5fZGF0YVtrZXldO1xuICAgICAgICAg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ICAgICAgICAgaWYgKFJlY3QuY2FjaGUpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9kcmF3V2l0aENhY2hlKGRhdGEpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fZHJhd05vQ2FjaGUoZGF0YSwgY2xlYXJCZWZvcmUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIF9kcmF3V2l0aENhY2hlKGRhdGEpIHtcbiAgICAgICAgICAgIGxldCBbeCwgeSwgY2gsIGZnLCBiZ10gPSBkYXRhO1xuICAgICAgICAgICAgbGV0IGhhc2ggPSBcIlwiICsgY2ggKyBmZyArIGJnO1xuICAgICAgICAgICAgbGV0IGNhbnZhcztcbiAgICAgICAgICAgIGlmIChoYXNoIGluIHRoaXMuX2NhbnZhc0NhY2hlKSB7XG4gICAgICAgICAgICAgICAgY2FudmFzID0gdGhpcy5fY2FudmFzQ2FjaGVbaGFzaF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgYiA9IHRoaXMuX29wdGlvbnMuYm9yZGVyO1xuICAgICAgICAgICAgICAgIGNhbnZhcyA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoXCJjYW52YXNcIik7XG4gICAgICAgICAgICAgICAgbGV0IGN0eCA9IGNhbnZhcy5nZXRDb250ZXh0KFwiMmRcIik7XG4gICAgICAgICAgICAgICAgY2FudmFzLndpZHRoID0gdGhpcy5fc3BhY2luZ1g7XG4gICAgICAgICAgICAgICAgY2FudmFzLmhlaWdodCA9IHRoaXMuX3NwYWNpbmdZO1xuICAgICAgICAgICAgICAgIGN0eC5maWxsU3R5bGUgPSBiZztcbiAgICAgICAgICAgICAgICBjdHguZmlsbFJlY3QoYiwgYiwgY2FudmFzLndpZHRoIC0gYiwgY2FudmFzLmhlaWdodCAtIGIpO1xuICAgICAgICAgICAgICAgIGlmIChjaCkge1xuICAgICAgICAgICAgICAgICAgICBjdHguZmlsbFN0eWxlID0gZmc7XG4gICAgICAgICAgICAgICAgICAgIGN0eC5mb250ID0gdGhpcy5fY3R4LmZvbnQ7XG4gICAgICAgICAgICAgICAgICAgIGN0eC50ZXh0QWxpZ24gPSBcImNlbnRlclwiO1xuICAgICAgICAgICAgICAgICAgICBjdHgudGV4dEJhc2VsaW5lID0gXCJtaWRkbGVcIjtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNoYXJzID0gW10uY29uY2F0KGNoKTtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgY3R4LmZpbGxUZXh0KGNoYXJzW2ldLCB0aGlzLl9zcGFjaW5nWCAvIDIsIE1hdGguY2VpbCh0aGlzLl9zcGFjaW5nWSAvIDIpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLl9jYW52YXNDYWNoZVtoYXNoXSA9IGNhbnZhcztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuX2N0eC5kcmF3SW1hZ2UoY2FudmFzLCB4ICogdGhpcy5fc3BhY2luZ1gsIHkgKiB0aGlzLl9zcGFjaW5nWSk7XG4gICAgICAgIH1cbiAgICAgICAgX2RyYXdOb0NhY2hlKGRhdGEsIGNsZWFyQmVmb3JlKSB7XG4gICAgICAgICAgICBsZXQgW3gsIHksIGNoLCBmZywgYmddID0gZGF0YTtcbiAgICAgICAgICAgIGlmIChjbGVhckJlZm9yZSkge1xuICAgICAgICAgICAgICAgIGxldCBiID0gdGhpcy5fb3B0aW9ucy5ib3JkZXI7XG4gICAgICAgICAgICAgICAgdGhpcy5fY3R4LmZpbGxTdHlsZSA9IGJnO1xuICAgICAgICAgICAgICAgIHRoaXMuX2N0eC5maWxsUmVjdCh4ICogdGhpcy5fc3BhY2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mhlaWdodCAtICh5ICsgMSkgKiBvcHRzLnRpbGVIZWlnaHQ7XG4gICAgICAgIGdsLnNjaXNzb3IoeCAqIG9wdHMudGlsZVdpZHRoLCBzY2lzc29yWSwgb3B0cy50aWxlV2lkdGgsIG9wdHMudGlsZUhlaWdodCk7XG4gICAgICAgIGlmIChjbGVhckJlZm9yZSkge1xuICAgICAgICAgICAgaWYgKG9wdHMudGlsZUNvbG9yaXplKSB7XG4gICAgICAgICAgICAgICAgZ2wuY2xlYXJDb2xvcigwLCAwLCAwLCAwKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGdsLmNsZWFyQ29sb3IoLi4ucGFyc2VDb2xvcihiZykpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZ2wuY2xlYXIoZ2wuQ09MT1JfQlVGRkVSX0JJVCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFjaCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGxldCBjaGFycyA9IFtdLmNvbmNhdChjaCk7XG4gICAgICAgIGxldCBiZ3MgPSBbXS5jb25jYXQoYmcpO1xuICAgICAgICBsZXQgZmdzID0gW10uY29uY2F0KGZnKTtcbiAgICAgICAgZ2wudW5pZm9ybTJmdih0aGlzLl91bmlmb3Jtc1tcInRhcmdldFBvc1JlbFwiXSwgW3gsIHldKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IHRpbGUgPSB0aGlzLl9vcHRpb25zLnRpbGVNYXBbY2hhcnNbaV1dO1xuICAgICAgICAgICAgaWYgKCF0aWxlKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBDaGFyIFwiJHtjaGFyc1tpXX1cIiBub3QgZm91bmQgaW4gdGlsZU1hcGApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZ2wudW5pZm9ybTFmKHRoaXMuX3VuaWZvcm1zW1wiY29sb3JpemVcIl0sIG9wdHMudGlsZUNvbG9yaXplID8gMSA6IDApO1xuICAgICAgICAgICAgZ2wudW5pZm9ybTJmdih0aGlzLl91bmlmb3Jtc1tcInRpbGVzZXRQb3NBYnNcIl0sIHRpbGUpO1xuICAgICAgICAgICAgaWYgKG9wdHMudGlsZUNvbG9yaXplKSB7XG4gICAgICAgICAgICAgICAgZ2wudW5pZm9ybTRmdih0aGlzLl91bmlmb3Jtc1tcInRpbnRcIl0sIHBhcnNlQ29sb3IoZmdzW2ldKSk7XG4gICAgICAgICAgICAgICAgZ2wudW5pZm9ybTRmdih0aGlzLl91bmlmb3Jtc1tcImJnXCJdLCBwYXJzZUNvbG9yKGJnc1tpXSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZ2wuZHJhd0FycmF5cyhnbC5UUklBTkdMRV9TVFJJUCwgMCwgNCk7XG4gICAgICAgIH1cbiAgICAgICAgLypcbiAgICAgICAgXG4gICAgICAgIFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGk9MDtpPGNoYXJzLmxlbmd0aDtpKyspIHtcbiAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9vcHRpb25zLnRpbGVDb2xvcml6ZSkgeyAvLyBhcHBseSBjb2xvcml6YXRpb25cbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjYW52YXMgPSB0aGlzLl9jb2xvckNhbnZhcztcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb250ZXh0ID0gY2FudmFzLmdldENvbnRleHQoXCIyZFwiKSBhcyBDYW52YXNSZW5kZXJpbmdDb250ZXh0MkQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0Lmdsb2JhbENvbXBvc2l0ZU9wZXJhdGlvbiA9IFwic291cmNlLW92ZXJcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHQuY2xlYXJSZWN0KDAsIDAsIHRpbGVXaWR0aCwgdGlsZUhlaWdodCk7XG4gICAgICAgIFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGZnID0gZmdzW2ldO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGJnID0gYmdzW2ldO1xuICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHQuZHJhd0ltYWdlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX29wdGlvbnMudGlsZVNldCEsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGlsZVswXSwgdGlsZVsxXSwgdGlsZVdpZHRoLCB0aWxlSGVpZ2h0LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIDAsIHRpbGVXaWR0aCwgdGlsZUhlaWdodFxuICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmcgIT0gXCJ0cmFuc3BhcmVudFwiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dC5maWxsU3R5bGUgPSBmZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0Lmdsb2JhbENvbXBvc2l0ZU9wZXJhdGlvbiA9IFwic291cmNlLWF0b3BcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmZpbGxSZWN0KDAsIDAsIHRpbGVXaWR0aCwgdGlsZUhlaWdodCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgIFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGJnICE9IFwidHJhbnNwYXJlbnRcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHQuZmlsbFN0eWxlID0gYmc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dC5nbG9iYWxDb21wb3NpdGVPcGVyYXRpb24gPSBcImRlc3RpbmF0aW9uLW92ZXJcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmZpbGxSZWN0KDAsIDAsIHRpbGVXaWR0aCwgdGlsZUhlaWdodCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgIFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3R4LmRyYXdJbWFnZShjYW52YXMsIHgqdGlsZVdpZHRoLCB5KnRpbGVIZWlnaHQsIHRpbGVXaWR0aCwgdGlsZUhlaWdodCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7IC8vIG5vIGNvbG9yaXppbmcsIGVhc3lcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N0eC5kcmF3SW1hZ2UoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fb3B0aW9ucy50aWxlU2V0ISxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aWxlWzBdLCB0aWxlWzFdLCB0aWxlV2lkdGgsIHRpbGVIZWlnaHQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeCp0aWxlV2lkdGgsIHkqdGlsZUhlaWdodCwgdGlsZVdpZHRoLCB0aWxlSGVpZ2h0XG4gICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgKi9cbiAgICB9XG4gICAgY2xlYXIoKSB7XG4gICAgICAgIGNvbnN0IGdsID0gdGhpcy5fZ2w7XG4gICAgICAgIGdsLmNsZWFyQ29sb3IoLi4ucGFyc2VDb2xvcih0aGlzLl9vcHRpb25zLmJnKSk7XG4gICAgICAgIGdsLnNjaXNzb3IoMCwgMCwgZ2wuY2FudmFzLndpZHRoLCBnbC5jYW52YXMuaGVpZ2h0KTtcbiAgICAgICAgZ2wuY2xlYXIoZ2wuQ09MT1JfQlVGRkVSX0JJVCk7XG4gICAgfVxuICAgIGNvbXB1dGVTaXplKGF2YWlsV2lkdGgs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ICAgICAgdGhyb3cgbmV3IEVycm9yKGBDaGFyIFwiJHtjaGFyc1tpXX1cIiBub3QgZm91bmQgaW4gdGlsZU1hcGApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRoaXMuX29wdGlvbnMudGlsZUNvbG9yaXplKSB7IC8vIGFwcGx5IGNvbG9yaXphdGlvblxuICAgICAgICAgICAgICAgIGxldCBjYW52YXMgPSB0aGlzLl9jb2xvckNhbnZhcztcbiAgICAgICAgICAgICAgICBsZXQgY29udGV4dCA9IGNhbnZhcy5nZXRDb250ZXh0KFwiMmRcIik7XG4gICAgICAgICAgICAgICAgY29udGV4dC5nbG9iYWxDb21wb3NpdGVPcGVyYXRpb24gPSBcInNvdXJjZS1vdmVyXCI7XG4gICAgICAgICAgICAgICAgY29udGV4dC5jbGVhclJlY3QoMCwgMCwgdGlsZVdpZHRoLCB0aWxlSGVpZ2h0KTtcbiAgICAgICAgICAgICAgICBsZXQgZmcgPSBmZ3NbaV07XG4gICAgICAgICAgICAgICAgbGV0IGJnID0gYmdzW2ldO1xuICAgICAgICAgICAgICAgIGNvbnRleHQuZHJhd0ltYWdlKHRoaXMuX29wdGlvbnMudGlsZVNldCwgdGlsZVswXSwgdGlsZVsxXSwgdGlsZVdpZHRoLCB0aWxlSGVpZ2h0LCAwLCAwLCB0aWxlV2lkdGgsIHRpbGVIZWlnaHQpO1xuICAgICAgICAgICAgICAgIGlmIChmZyAhPSBcInRyYW5zcGFyZW50XCIpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5maWxsU3R5bGUgPSBmZztcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5nbG9iYWxDb21wb3NpdGVPcGVyYXRpb24gPSBcInNvdXJjZS1hdG9wXCI7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQuZmlsbFJlY3QoMCwgMCwgdGlsZVdpZHRoLCB0aWxlSGVpZ2h0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICA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3AgaXMgbG9ja2VkLlxuICAgICAqL1xuICAgIHN0YXJ0KCkgeyByZXR1cm4gdGhpcy51bmxvY2soKTsgfVxuICAgIC8qKlxuICAgICAqIEludGVycnVwdCB0aGUgZW5naW5lIGJ5IGFuIGFzeW5jaHJvbm91cyBhY3Rpb25cbiAgICAgKi9cbiAgICBsb2NrKCkge1xuICAgICAgICB0aGlzLl9sb2NrKys7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBSZXN1bWUgZXhlY3V0aW9uIChwYXVzZWQgYnkgYSBwcmV2aW91cyBsb2NrKVxuICAgICAqL1xuICAgIHVubG9jaygpIHtcbiAgICAgICAgaWYgKCF0aGlzLl9sb2NrKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJDYW5ub3QgdW5sb2NrIHVubG9ja2VkIGVuZ2luZVwiKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLl9sb2NrLS07XG4gICAgICAgIHdoaWxlICghdGhpcy5fbG9jaykge1xuICAgICAgICAgICAgbGV0IGFjdG9yID0gdGhpcy5fc2NoZWR1bGVyLm5leHQoKTtcbiAgICAgICAgICAgIGlmICghYWN0b3IpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5sb2NrKCk7XG4gICAgICAgICAgICB9IC8qIG5vIGFjdG9ycyAqL1xuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IGFjdG9yLmFjdCgpO1xuICAgICAgICAgICAgaWYgKHJlc3VsdCAmJiByZXN1bHQudGhlbikgeyAvKiBhY3RvciByZXR1cm5lZCBhIFwidGhlbmFibGVcIiwgbG9va3MgbGlrZSBhIFByb21pc2UgKi9cbiAgICAgICAgICAgICAgICB0aGlzLmxvY2soKTtcbiAgICAgICAgICAgICAgICByZXN1bHQudGhlbih0aGlzLnVubG9jay5iaW5kKHRoaXMpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdG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oO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBuZWlnaGJvcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBjeCA9IG5laWdoYm9yc1tpXVswXTtcbiAgICAgICAgICAgICAgICBjeSA9IG5laWdoYm9yc1tpXVsxXTtcbiAgICAgICAgICAgICAgICBBID0gYW5nbGUgKiAoaSAtIDAuNSk7XG4gICAgICAgICAgICAgICAgQiA9IEEgKyBhbmdsZTtcbiAgICAgICAgICAgICAgICBibG9ja3MgPSAhdGhpcy5fbGlnaHRQYXNzZXMoY3gsIGN5KTtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5fdmlzaWJsZUNvb3JkcyhNYXRoLmZsb29yKEEpLCBNYXRoLmNlaWwoQiksIGJsb2NrcywgREFUQSkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2soY3gsIGN5LCByLCAxKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKERBVEEubGVuZ3RoID09IDIgJiYgREFUQVswXSA9PSAwICYmIERBVEFbMV0gPT0gMzYwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9IC8qIGN1dG9mZj8gKi9cbiAgICAgICAgICAgIH0gLyogZm9yIGFsbCBjZWxscyBpbiB0aGlzIHJpbmcgKi9cbiAgICAgICAgfSAvKiBmb3IgYWxsIHJpbmdzICovXG4gICAgfVxuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7aW50fSBBIHN0YXJ0IGFuZ2xlXG4gICAgICogQHBhcmFtIHtpbnR9IEIgZW5kIGFuZ2xlXG4gICAgICogQHBhcmFtIHtib29sfSBibG9ja3MgRG9lcyBjdXJyZW50IGNlbGwgYmxvY2sgdmlzaWJpbGl0eT9cbiAgICAgKiBAcGFyYW0ge2ludFtdW119IERBVEEgc2hhZG93ZWQgYW5nbGUgcGFpcnNcbiAgICAgKi9cbiAgICBfdmlzaWJsZUNvb3JkcyhBLCBCLCBibG9ja3MsIERBVEEpIHtcbiAgICAgICAgaWYgKEEgPCAwKSB7XG4gICAgICAgICAgICBsZXQgdjEgPSB0aGlzLl92aXNpYmxlQ29vcmRzKDAsIEIsIGJsb2NrcywgREFUQSk7XG4gICAgICAgICAgICBsZXQgdjIgPSB0aGlzLl92aXNpYmxlQ29vcmRzKDM2MCArIEEsIDM2MCwgYmxvY2tzLCBEQVRBKTtcbiAgICAgICAgICAgIHJldHVybiB2MSB8fCB2MjtcbiAgICAgICAgfVxuICAgICAgICBsZXQgaW5kZXggPSAwO1xuICAgICAgICB3aGlsZSAoaW5kZXggPCBEQVRBLmxlbmd0aCAmJiBEQVRBW2luZGV4XSA8IEEpIHtcbiAgICAgICAgICAgIGluZGV4Kys7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGluZGV4ID09IERBVEEubGVuZ3RoKSB7IC8qIGNvbXBsZXRlbHkgbmV3IHNoYWRvdyAqL1xuICAgICAgICAgICAgaWYgKGJsb2Nrcykge1xuICAgICAgICAgICAgICAgIERBVEEucHVzaChBLCBCKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIGxldCBjb3VudCA9IDA7XG4gICAgICAgIGlmIChpbmRleCAlIDIpIHsgLyogdGhpcyBzaGFkb3cgc3RhcnRzIGluIGFuIGV4aXN0aW5nIHNoYWRvdywgb3Igd2l0aGluIGl0cyBlbmRpbmcgYm91bmRhcnkgKi9cbiAgICAgICAgICAgIHdoaWxlIChpbmRleCA8IERBVEEubGVuZ3RoICYmIERBVEFbaW5kZXhdIDwgQikge1xuICAgICAgICAgICAgICAgIGluZGV4Kys7XG4gICAgICAgICAgICAgICAgY291bnQrKztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjb3VudCA9PSAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGJsb2Nrcykge1xuICAgICAgICAgICAgICAgIGlmIChjb3VudCAlIDIpIHtcbiAgICAgICAgICAgICAgICAgICAgREFUQS5zcGxpY2UoaW5kZXggLSBjb3VudCwgY291bnQsIEIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgREFUQS5zcGxpY2UoaW5kZXggLSBjb3VudCwgY291bnQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgeyAvKiB0aGlzIHNoYWRvdyBzdGFydHMgb3V0c2lkZSBhbiBleGlzdGluZyBzaGFkb3csIG9yIHdpdGhpbiBhIHN0YXJ0aW5nIGJvdW5kYXJ5ICovXG4gICAgICAgICAgICB3aGlsZSAoaW5kZXggPCBEQVRBLmxlbmd0aCAmJiBEQVRBW2luZGV4XSA8IEIpIHtcbiAgICAgICAgICAgICAgICBpbmRleCsrO1xuICAgICAgICAgICAgICAgIGNvdW50Kys7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvKiB2aXNpYmxlIHdoZW4gb3V0c2lkZSBhbiBleGlzdGluZyBzaGFkb3csIG9yIHdoZW4gb3ZlcmxhcHBpbmcgKi9cbiAgICAgICAgICAgIGlmIChBID09IERBVEFbaW5kZXggLSBjb3VudF0gJiYgY291bnQgPT0gMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChibG9ja3MpIHtcbiAgICAgICAgICAgICAgICBpZiAoY291bnQgJSAyKSB7XG4gICAgICAgICAgICAgICAgICAgIERBVEEuc3BsaWNlKGluZGV4IC0gY291bnQsIGNvdW50LCBBKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIERB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bnRGYWN0b3IsIHN0YXJ0T2Zmc2V0O1xuICAgICAgICBzd2l0Y2ggKHRoaXMuX29wdGlvbnMudG9wb2xvZ3kpIHtcbiAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICBjb3VudEZhY3RvciA9IDE7XG4gICAgICAgICAgICAgICAgc3RhcnRPZmZzZXQgPSBbMCwgMV07XG4gICAgICAgICAgICAgICAgZGlycyA9IFtcbiAgICAgICAgICAgICAgICAgICAgRElSU1s4XVs3XSxcbiAgICAgICAgICAgICAgICAgICAgRElSU1s4XVsxXSxcbiAgICAgICAgICAgICAgICAgICAgRElSU1s4XVszXSxcbiAgICAgICAgICAgICAgICAgICAgRElSU1s4XVs1XVxuICAgICAgICAgICAgICAgIF07XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgZGlycyA9IERJUlNbNl07XG4gICAgICAgICAgICAgICAgY291bnRGYWN0b3IgPSAxO1xuICAgICAgICAgICAgICAgIHN0YXJ0T2Zmc2V0ID0gWy0xLCAxXTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgODpcbiAgICAgICAgICAgICAgICBkaXJzID0gRElSU1s0XTtcbiAgICAgICAgICAgICAgICBjb3VudEZhY3RvciA9IDI7XG4gICAgICAgICAgICAgICAgc3RhcnRPZmZzZXQgPSBbLTEsIDFdO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJJbmNvcnJlY3QgdG9wb2xvZ3kgZm9yIEZPViBjb21wdXRhdGlvblwiKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICAvKiBzdGFydGluZyBuZWlnaGJvciAqL1xuICAgICAgICBsZXQgeCA9IGN4ICsgc3RhcnRPZmZzZXRbMF0gKiByO1xuICAgICAg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bmVpZ2hib3JDb3VudCAtIDEsIDIgKiBuZWlnaGJvckNvdW50XTtcbiAgICAgICAgICAgICAgICBBMiA9IFsyICogaSArIDEsIDIgKiBuZWlnaGJvckNvdW50XTtcbiAgICAgICAgICAgICAgICBibG9ja3MgPSAhdGhpcy5fbGlnaHRQYXNzZXMoY3gsIGN5KTtcbiAgICAgICAgICAgICAgICB2aXNpYmlsaXR5ID0gdGhpcy5fY2hlY2tWaXNpYmlsaXR5KEExLCBBMiwgYmxvY2tzLCBTSEFET1dTKTtcbiAgICAgICAgICAgICAgICBpZiAodmlzaWJpbGl0eSkge1xuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayhjeCwgY3ksIHIsIHZpc2liaWxpdHkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoU0hBRE9XUy5sZW5ndGggPT0gMiAmJiBTSEFET1dTWzBdWzBdID09IDAgJiYgU0hBRE9XU1sxXVswXSA9PSBTSEFET1dTWzFdWzFdKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9IC8qIGN1dG9mZj8gKi9cbiAgICAgICAgICAgIH0gLyogZm9yIGFsbCBjZWxscyBpbiB0aGlzIHJpbmcgKi9cbiAgICAgICAgfSAvKiBmb3IgYWxsIHJpbmdzICovXG4gICAgfVxuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7aW50WzJdfSBBMSBhcmMgc3RhcnRcbiAgICAgKiBAcGFyYW0ge2ludFsyXX0gQTIgYXJjIGVuZFxuICAgICAqIEBwYXJhbSB7Ym9vbH0gYmxvY2tzIERvZXMgY3VycmVudCBhcmMgYmxvY2sgdmlzaWJpbGl0eT9cbiAgICAgKiBAcGFyYW0ge2ludFtdW119IFNIQURPV1MgbGlzdCBvZiBhY3RpdmUgc2hhZG93c1xuICAgICAqL1xuICAgIF9jaGVja1Zpc2liaWxpdHkoQTEsIEEyLCBibG9ja3MsIFNIQURPV1MpIHtcbiAgICAgICAgaWYgKEExWzBdID4gQTJbMF0pIHsgLyogc3BsaXQgaW50byB0d28gc3ViLWFyY3MgKi9cbiAgICAgICAgICAgIGxldCB2MSA9IHRoaXMuX2NoZWNrVmlzaWJpbGl0eShBMSwgW0ExWzFdLCBBMVsxXV0sIGJsb2NrcywgU0hBRE9XUyk7XG4gICAgICAgICAgICBsZXQgdjIgPSB0aGlzLl9jaGVja1Zpc2liaWxpdHkoWzAsIDFdLCBBMiwgYmxvY2tzLCBTSEFET1dTKTtcbiAgICAgICAgICAgIHJldHVybiAodjEgKyB2MikgLyAyO1xuICAgICAgICB9XG4gICAgICAgIC8qIGluZGV4MTogZmlyc3Qgc2hhZG93ID49IEExICovXG4gICAgICAgIGxldCBpbmRleDEgPSAwLCBlZGdlMSA9IGZhbHNlO1xuICAgICAgICB3aGlsZSAoaW5kZXgxIDwgU0hBRE9XUy5sZW5ndGgpIHtcbiAgICAgICAgICAgIGxldCBvbGQgPSBTSEFET1dTW2luZGV4MV07XG4gICAgICAgICAgICBsZXQgZGlmZiA9IG9sZFswXSAqIEExWzFdIC0gQTFbMF0gKiBvbGRbMV07XG4gICAgICAgICAgICBpZiAoZGlmZiA+PSAwKSB7IC8qIG9sZCA+PSBBMSAqL1xuICAgICAgICAgICAgICAgIGlmIChkaWZmID09IDAgJiYgIShpbmRleDEgJSAyKSkge1xuICAgICAgICAgICAgICAgICAgICBlZGdlMSA9IHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaW5kZXgxKys7XG4gICAgICAgIH1cbiAgICAgICAgLyogaW5kZXgyOiBsYXN0IHNoYWRvdyA8PSBBMiAqL1xuICAgICAgICBsZXQgaW5kZXgyID0gU0hBRE9XUy5sZW5ndGgsIGVkZ2UyID0gZmFsc2U7XG4gICAgICAgIHdoaWxlIChpbmRleDItLSkge1xuICAgICAgICAgICAgbGV0IG9sZCA9IFNIQURPV1NbaW5kZXgyXTtcbiAgICAgICAgICAgIGxldCBkaWZmID0gQTJbMF0gKiBvbGRbMV0gLSBvbGRbMF0gKiBBMlsxXTtcbiAgICAgICAgICAgIGlmIChkaWZmID49IDApIHsgLyogb2xkIDw9IEEyICovXG4gICAgICAgICAgICAgICAgaWYgKGRpZmYgPT0gMCAmJiAoaW5kZXgyICUgMikpIHtcbiAgICAgICAgICAgICAgICAgICAgZWRnZTIgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgdmlzaWJsZSA9IHRydWU7XG4gICAgICAgIGlmIChpbmRleDEgPT0gaW5kZXgyICYmIChlZGdlMSB8fCBlZGdlMikpIHsgLyogc3Vic2V0IG9mIGV4aXN0aW5nIHNoYWRvdywgb25lIG9mIHRoZSBlZGdlcyBtYXRjaCAqL1xuICAgICAgICAgICAgdmlzaWJsZSA9IGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGVkZ2UxICYmIGVkZ2UyICYmIGluZGV4MSArIDEgPT0gaW5kZXgyICYmIChpbmRleDIgJSAyKSkgeyAvKiBjb21wbGV0ZWx5IGVxdWl2YWxlbnQgd2l0aCBleGlzdGluZyBzaGFkb3cgKi9cbiAgICAgICAgICAgIHZpc2libGUgPSBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChpbmRleDEgPiBpbmRleDIgJiYgKGluZGV4MSAlIDIpKSB7IC8qIHN1YnNldCBvZiBleGlzdGluZyBzaGFkb3csIG5vdCB0b3VjaGluZyAqL1xuICAgICAgICAgICAgdmlzaWJsZSA9IGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGlmICghdmlzaWJsZSkge1xuICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgIH0gLyogZmFzdCBjYXNlOiBub3QgdmlzaWJsZSAqL1xuICAgICAgICBsZXQgdmlzaWJsZUxlbmd0aDtcbiAgICAgICAgLyogY29tcHV0ZSB0aGUgbGVuZ3RoIG9mIHZpc2libGUgYXJjLCBhZGp1c3QgbGlzdCBvZiBzaGFkb3dzIChpZiBibG9ja2luZykgKi9cbiAgICAgICAgbGV0IHJlbW92ZSA9IGluZGV4MiAtIGluZGV4MSArIDE7XG4gICAgICAgIGlmIChyZW1vdmUgJSAyKSB7XG4gICAgICAgICAgICBpZiAoaW5kZXgxICUgMikgeyAvKiBmaXJzdCBlZGdlIHdpdGhpbiBleGlzdGluZyBzaGFkb3csIHNlY29uZCBvdXRzaWRlICovXG4gICAgICAgICAgICAgICAgbGV0IFAgPSBTSEFET1dTW2luZGV4MV07XG4gICAgICAgICAgICAgICAgdmlzaWJsZUxlbmd0aCA9IChBMlswXSAqIFBbMV0gLSBQWzBdICogQTJbMV0pIC8gKFBbMV0gKiBBMlsxXSk7XG4gICAgICAgICAgICAgICAgaWYgKGJsb2Nrcykge1xuICAgICAgICAgICAgICAgICAgICBTSEFET1dTLnNwbGljZShpbmRleDEsIHJlbW92ZSwgQTIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgeyAvKiBzZWNvbmQgZWRnZSB3aXRoaW4gZXhpc3Rpbmcgc2hhZG93LCBmaXJzdCBvdXRzaWRlICovXG4gICAgICAgICAgICAgICAgbGV0IFAgPSBTSEFET1dTW2luZGV4Ml07XG4gICAgICAgICAgICAgICAgdmlzaWJsZUxlbmd0aCA9IChQWzBdICogQTFbMV0gLSBBMVswXSAqIFBbMV0pIC8gKEExWzFdICogUFsxXSk7XG4gICAgICAgICAgICAgICAgaWYgKGJsb2Nrcykge1xuICAgICAgICAgICAgICAgICAgICBTSEFET1dTLnNwbGljZShpbmRleDEsIHJlbW92ZSwgQTEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGlmIChpbmRleDEgJSAyKSB7IC8qIGJvdGggZWRnZXMgd2l0aGluIGV4aXN0aW5nIHNoYWRvd3MgKi9cbiAgICAgICAgICAgICAgICBsZXQgUDEgPSBTSEFET1dTW2luZGV4MV07XG4gICAgICAgICAgICAgICAgbGV0IFAyID0gU0hBRE9XU1tpbmRleDJdO1xuICAgICAgICAgICAgICAgIHZpc2libGVMZW5ndGggPSAoUDJbMF0gKiBQMVsxXSAtIFAxWzBdICogUDJbMV0pIC8gKFAxWzFdICogUDJbMV0pO1xuICAgICAgICAgICAgICAgIGlmIChibG9ja3MpIHtcbiAgICAgICAgICAgICAgICAgICAgU0hBRE9XUy5zcGxpY2UoaW5kZXgxLCByZW1vdmUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgeyAvKiBib3RoIGVkZ2VzIG91dHNpZGUgZXhpc3Rpbmcgc2hhZG93cyAqL1xuICAgICAgICAgICAgICAgIGlmIChibG9ja3MpIHtcbiAgICAgICAgICAgICAgICAgICAgU0hBRE9XUy5zcGxpY2UoaW5kZXgxLCByZW1vdmUsIEExLCBBMik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiAxOyAvKiB3aG9sZSBhcmMgdmlzaWJsZSEgKi9cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgYXJjTGVuZ3RoID0gKEEyWzBdICogQTFbMV0gLSBBMVswXSAqIEEyWzFdKSAvIChBMVsxXSAqIEEyWzFdKTtcbiAgICAgICAgcmV0dXJuIHZpc2libGVMZW5ndGggLyBhcmNMZW5ndGg7XG4gICAgfVxufVxuIiwiaW1wb3J0IEZPViBmcm9tIFwiLi9mb3YuanNcIjtcbi8qKiBPY3RhbnRzIHVzZWQgZm9yIHRyYW5zbGF0aW5nIHJlY3Vyc2l2ZSBzaGFkb3djYXN0aW5nIG9mZnNldHMgKi9cbmNvbnN0IE9DVEFOVFMgPSBbXG4gICA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ICAgLy8nUm93JyBjb3VsZCBiZSBjb2x1bW4sIG5hbWVzIGhlcmUgYXNzdW1lIG9jdGFudCAwIGFuZCB3b3VsZCBiZSBmbGlwcGVkIGZvciBoYWxmIHRoZSBvY3RhbnRzXG4gICAgICAgICAgICB3aGlsZSAoZHggPD0gMCkge1xuICAgICAgICAgICAgICAgIGR4ICs9IDE7XG4gICAgICAgICAgICAgICAgLy9UcmFuc2xhdGUgZnJvbSByZWxhdGl2ZSBjb29yZGluYXRlcyB0byBtYXAgY29vcmRpbmF0ZXNcbiAgICAgICAgICAgICAgICBsZXQgbWFwWCA9IHN0YXJ0WCArIGR4ICogeHggKyBkeSAqIHh5O1xuICAgICAgICAgICAgICAgIGxldCBtYXBZID0gc3RhcnRZICsgZHggKiB5eCArIGR5ICogeXk7XG4gICAgICAgICAgICAgICAgLy9SYW5nZSBvZiB0aGUgcm93XG4gICAgICAgICAgICAgICAgbGV0IHNsb3BlU3RhcnQgPSAoZHggLSAwLjUpIC8gKGR5ICsgMC41KTtcbiAgICAgICAgICAgICAgICBsZXQgc2xvcGVFbmQgPSAoZHggKyAwLjUpIC8gKGR5IC0gMC41KTtcbiAgICAgICAgICAgICAgICAvL0lnbm9yZSBpZiBub3QgeWV0IGF0IGxlZnQgZWRnZSBvZiBPY3RhbnRcbiAgICAgICAgICAgICAgICBpZiAoc2xvcGVFbmQgPiB2aXNTbG9wZVN0YXJ0KSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvL0RvbmUgaWYgcGFzdCByaWdodCBlZGdlXG4gICAgICAgICAgICAgICAgaWYgKHNsb3BlU3RhcnQgPCB2aXNTbG9wZUVuZCkge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy9JZiBpdCdzIGluIHJhbmdlLCBpdCdzIHZpc2libGVcbiAgICAgICAgICAgICAgICBpZiAoKGR4ICogZHggKyBkeSAqIGR5KSA8IChyYWRpdXMgKiByYWRpdXMpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKG1hcFgsIG1hcFksIGksIDEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIWJsb2NrZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgLy9JZiB0aWxlIGlzIGEgYmxvY2tpbmcgdGlsZSwgY2FzdCBhcm91bmQgaXRcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLl9saWdodFBhc3NlcyhtYXBYLCBtYXBZKSAmJiBpIDwgcmFkaXVzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBibG9ja2VkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2Nhc3RWaXNpYmlsaXR5KHN0YXJ0WCwgc3RhcnRZLCBpICsgMSwgdmlzU2xvcGVTdGFydCwgc2xvcGVTdGFydCwgcmFkaXVzLCB4eCwgeHksIHl4LCB5eSwgY2FsbGJhY2spO1xuICAgICAgICAgICAgICAgICAgICAgICAgbmV3U3RhcnQgPSBzbG9wZUVuZDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgLy9LZWVwIG5hcnJvd2luZyBpZiBzY2FubmluZyBhY3Jvc3MgYSBibG9ja1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXRoaXMuX2xpZ2h0UGFzc2VzKG1hcFgsIG1hcFkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXdTdGFydCA9IHNsb3BlRW5kO1xuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgLy9CbG9jayBoYXMgZW5kZWRcbiAgICAgICAgICAgICAgICAgICAgYmxvY2tlZCA9IGZh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UNhY2hlID0ge307XG4gICAgICAgIHRoaXMuX2ZvdkNhY2hlID0ge307XG4gICAgICAgIHRoaXMuc2V0T3B0aW9ucyhvcHRpb25zKTtcbiAgICB9XG4gICAgLyoqXG4gICAgICogQWRqdXN0IG9wdGlvbnMgYXQgcnVudGltZVxuICAgICAqL1xuICAgIHNldE9wdGlvbnMob3B0aW9ucykge1xuICAgICAgICBPYmplY3QuYXNzaWduKHRoaXMuX29wdGlvbnMsIG9wdGlvbnMpO1xuICAgICAgICBpZiAob3B0aW9ucyAmJiBvcHRpb25zLnJhbmdlKSB7XG4gICAgICAgICAgICB0aGlzLnJlc2V0KCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIFNldCB0aGUgdXNlZCBGaWVsZC1PZi1WaWV3IGFsZ29cbiAgICAgKi9cbiAgICBzZXRGT1YoZm92KSB7XG4gICAgICAgIHRoaXMuX2ZvdiA9IGZvdjtcbiAgICAgICAgdGhpcy5fZm92Q2FjaGUgPSB7fTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIFNldCAob3IgcmVtb3ZlKSBhIGxpZ2h0IHNvdXJjZVxuICAgICAqL1xuICAgIHNldExpZ2h0KHgsIHksIGNvbG9yKSB7XG4gICAgICAgIGxldCBrZXkgPSB4ICsgXCIsXCIgKyB5O1xuICAgICAgICBpZiAoY29sb3IpIHtcbiAgICAgICAgICAgIHRoaXMuX2xpZ2h0c1trZXldID0gKHR5cGVvZiAoY29sb3IpID09IFwic3RyaW5nXCIgPyBDb2xvci5mcm9tU3RyaW5nKGNvbG9yKSA6IGNvbG9yKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGRlbGV0ZSB0aGlzLl9saWdodHNba2V5XTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG4gICAgLyoqXG4gICAgICogU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ywgbGl0Q2VsbHMsIGRvbmVDZWxscykge1xuICAgICAgICBmb3IgKGxldCBrZXkgaW4gZW1pdHRpbmdDZWxscykge1xuICAgICAgICAgICAgbGV0IHBhcnRzID0ga2V5LnNwbGl0KFwiLFwiKTtcbiAgICAgICAgICAgIGxldCB4ID0gcGFyc2VJbnQocGFydHNbMF0pO1xuICAgICAgICAgICAgbGV0IHkgPSBwYXJzZUludChwYXJ0c1sxXSk7XG4gICAgICAgICAgICB0aGlzLl9lbWl0TGlnaHRGcm9tQ2VsbCh4LCB5LCBlbWl0dGluZ0NlbGxzW2tleV0sIGxpdENlbGxzKTtcbiAgICAgICAgICAgIGRvbmVDZWxsc1trZXldID0gMTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG4gICAgLyoqXG4gICAgICogUHJlcGFyZSBhIGxpc3Qgb2YgZW1pdHRlcnMgZm9yIG5leHQgcGFzc1xuICAgICAqL1xuICAgIF9jb21wdXRlRW1pdHRlcnMobGl0Q2VsbHMsIGRvbmVDZWxscykge1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGtleSBpbiBsaXRDZWxscykge1xuICAgICAgICAgICAgaWYgKGtleSBpbiBkb25lQ2VsbHMpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH0gLyogYWxyZWFkeSBlbWl0dGVkICovXG4gICAgICAgICAgICBsZXQgY29sb3IgPSBsaXRDZWxsc1trZXldO1xuICAgICAgICAgICAgbGV0IHJlZmxlY3Rpdml0eTtcbiAgICAgICAgICAgIGlmIChrZXkgaW4gdGhpcy5fcmVmbGVjdGl2aXR5Q2FjaGUpIHtcbiAgICAgICAgICAgICAgICByZWZsZWN0aXZpdHkgPSB0aGlzLl9yZWZsZWN0aXZpdHlDYWNoZVtrZXldO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IHBhcnRzID0ga2V5LnNwbGl0KFwiLFwiKTtcbiAgICAgICAgICAgICAgICBsZXQgeCA9IHBhcnNlSW50KHBhcnRzWzBdKTtcbiAgICAgICAgICAgICAgICBsZXQgeSA9IHBhcnNlSW50KHBhcnRzWzFdKTtcbiAgICAgICAgICAgICAgICByZWZsZWN0aXZpdHkgPSB0aGlzLl9yZWZsZWN0aXZpdHlDYWxsYmFjayh4LCB5KTtcbiAgICAgICAgICAgICAgICB0aGlzLl9yZWZsZWN0aXZpdHlDYWNoZVtrZXldID0gcmVmbGVjdGl2aXR5O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHJlZmxlY3Rpdml0eSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9IC8qIHdpbGwgbm90IHJlZmxlY3QgYXQgYWxsICovXG4gICAgICAgICAgICAvKiBjb21wdXRlIGVtaXNzaW9uIGNvbG9yICovXG4gICAgICAgICAgICBsZXQgZW1pc3Npb24gPSBbMCwgMCwgMF07XG4gICAgICAgICAgICBsZXQgaW50ZW5zaXR5ID0gMDtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMzsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IHBhcnQgPSBNYXRoLnJvdW5kKGNvbG9yW2ldICogcmVmbGVjdGl2aXR5KTtcbiAgICAgICAgICAgICAgICBlbWlzc2lvbltpXSA9IHBhcnQ7XG4gICAgICAgICAgICAgICAgaW50ZW5zaXR5ICs9IHBhcnQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaW50ZW5zaXR5ID4gdGhpcy5fb3B0aW9ucy5lbWlzc2lvblRocmVzaG9sZCkge1xuICAgICAgICAgICAgICAgIHJlc3VsdFtrZXldID0gZW1pc3Npb247XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG4gICAgLyoqXG4gICAgICogQ29tcHV0ZSBvbmUgaXRlcmF0aW9uIGZyb20gb25lIGNlbGxcbiAgICAgKi9cbiAgICBfZW1pdExpZ2h0RnJvbUNlbGwoeCwgeSwgY29sb3IsIGxpdENlbGxzKSB7XG4gICAgICAgIGxldCBrZXkgPSB4ICsgXCIsXCIgKyB5O1xuICAgICAgICBsZXQgZm92O1xuICAgICAgICBpZiAoa2V5IGluIHRoaXMuX2ZvdkNhY2hlKSB7XG4gICAgICAgICAgICBmb3YgPSB0aGlzLl9mb3ZDYWNoZVtrZXldO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgZm92ID0gdGhpcy5fdXBkYXRlRk9WKHgsIHkpO1xuICAgICAgICB9XG4gICAgICAgIGZvciAobGV0IGZvdktleSBpbiBmb3YpIHtcbiAgICAgICAgICAgIGxldCBmb3JtRmFjdG9yID0gZm92W2ZvdktleV07XG4gICAgICAgICAgICBsZXQgcmVzdWx0O1xuICAgICAgICAgICAgaWYgKGZvdktleSBpbiBsaXRDZWxscykgeyAvKiBhbHJlYWR5IGxpdCAqL1xuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGxpdENlbGxzW2ZvdktleV07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHsgLyogbmV3bHkgbGl0ICovXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gWzAsIDAsIDBdO1xuICAgICAgICAgICAgICAgIGxpdENlbGxzW2ZvdktleV0gPSByZXN1bHQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDM7IGkrKykge1xuICAgICAgICAgICAgICAgIHJlc3VsdFtpXSArPSBNYXRoLnJvdW5kKGNvbG9yW2ldICogZm9ybUZhY3Rvcik7XG4gICAgICAgICAgICB9IC8qIGFkZCBsaWdodCBjb2xvciAqL1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBDb21wdXRlIEZPViAo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XSA9IDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKCFjdXIgJiYgYm9ybi5pbmRleE9mKG5jb3VudCkgIT0gLTEpIHsgLyogYm9ybiAqL1xuICAgICAgICAgICAgICAgICAgICBuZXdNYXBbaV1bal0gPSAxO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aGlzLl9tYXAgPSBuZXdNYXA7XG4gICAgICAgIGNhbGxiYWNrICYmIHRoaXMuX3NlcnZpY2VDYWxsYmFjayhjYWxsYmFjayk7XG4gICAgfVxuICAgIF9zZXJ2aWNlQ2FsbGJhY2soY2FsbGJhY2spIHtcbiAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCB0aGlzLl9oZWlnaHQ7IGorKykge1xuICAgICAgICAgICAgbGV0IHdpZHRoU3RlcCA9IDE7XG4gICAgICAgICAgICBsZXQgd2lkdGhTdGFydCA9IDA7XG4gICAgICAgICAgICBpZiAodGhpcy5fb3B0aW9ucy50b3BvbG9neSA9PSA2KSB7XG4gICAgICAgICAgICAgICAgd2lkdGhTdGVwID0gMjtcbiAgICAgICAgICAgICAgICB3aWR0aFN0YXJ0ID0gaiAlIDI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gd2lkdGhTdGFydDsgaSA8IHRoaXMuX3dpZHRoOyBpICs9IHdpZHRoU3RlcCkge1xuICAgICAgICAgICAgICAgIGNhbGxiYWNrKGksIGosIHRoaXMuX21hcFtpXVtqXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgLyoqXG4gICAgICogR2V0IG5laWdoYm9yIGNvdW50IGF0IFtpLGpdIGluIHRoaXMuX21hcFxuICAgICAqL1xuICAgIF9nZXROZWlnaGJvcnMoY3gsIGN5KSB7XG4gICAgICAgIGxldCByZXN1bHQgPSAwO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaS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gbGV0IHdpZHRoU3RlcCA9IDE7XG4gICAgICAgIGxldCB3aWR0aFN0YXJ0cyA9IFswLCAwXTtcbiAgICAgICAgaWYgKHRoaXMuX29wdGlvbnMudG9wb2xvZ3kgPT0gNikge1xuICAgICAgICAgICAgd2lkdGhTdGVwID0gMjtcbiAgICAgICAgICAgIHdpZHRoU3RhcnRzID0gWzAsIDFdO1xuICAgICAgICB9XG4gICAgICAgIGZvciAobGV0IHkgPSAwOyB5IDwgdGhpcy5faGVpZ2h0OyB5KyspIHtcbiAgICAgICAgICAgIGZvciAobGV0IHggPSB3aWR0aFN0YXJ0c1t5ICUgMl07IHggPCB0aGlzLl93aWR0aDsgeCArPSB3aWR0aFN0ZXApIHtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5fZnJlZVNwYWNlKHgsIHksIHZhbHVlKSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgcCA9IFt4LCB5XTtcbiAgICAgICAgICAgICAgICAgICAgbm90Q29ubmVjdGVkW3RoaXMuX3BvaW50S2V5KHApXSA9IHA7XG4gICAgICAgICAgICAgICAgICAgIGFsbEZyZWVTcGFjZS5wdXNoKFt4LCB5XSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBzdGFydCA9IGFsbEZyZWVTcGFjZVtSTkcuZ2V0VW5pZm9ybUludCgwLCBhbGxGcmVlU3BhY2UubGVuZ3RoIC0gMSldO1xuICAgICAgICBsZXQga2V5ID0gdGhpcy5fcG9pbnRLZXkoc3RhcnQpO1xuICAgICAgICBsZXQgY29ubmVjdGVkID0ge307XG4gICAgICAgIGNvbm5lY3RlZFtrZXldID0gc3RhcnQ7XG4gICAgICAgIGRlbGV0ZSBub3RDb25uZWN0ZWRba2V5XTtcbiAgICAgICAgLy8gZmluZCB3aGF0J3MgY29ubmVjdGVkIHRvIHRoZSBzdGFydGluZyBwb2ludFxuICAgICAgICB0aGlzLl9maW5kQ29ubmVjdGVkK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dGVkXG4gICAgICAgICAgICBmb3IgKGxldCBrIGluIGxvY2FsKSB7XG4gICAgICAgICAgICAgICAgbGV0IHBwID0gbG9jYWxba107XG4gICAgICAgICAgICAgICAgdGhpcy5fbWFwW3BwWzBdXVtwcFsxXV0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICBjb25uZWN0ZWRba10gPSBwcDtcbiAgICAgICAgICAgICAgICBkZWxldGUgbm90Q29ubmVjdGVkW2tdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGNhbGxiYWNrICYmIHRoaXMuX3NlcnZpY2VDYWxsYmFjayhjYWxsYmFjayk7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIEZpbmQgcmFuZG9tIHBvaW50cyB0byBjb25uZWN0LiBTZWFyY2ggZm9yIHRoZSBjbG9zZXN0IHBvaW50IGluIHRoZSBsYXJnZXIgc3BhY2UuXG4gICAgICogVGhpcyBpcyB0byBtaW5pbWl6ZSB0aGUgbGVuZ3RoIG9mIHRoZSBwYXNzYWdlIHdoaWxlIG1haW50YWluaW5nIGdvb2QgcGVyZm9ybWFuY2UuXG4gICAgICovXG4gICAgX2dldEZyb21Ubyhjb25uZWN0ZWQsIG5vdENvbm5lY3RlZCkge1xuICAgICAgICBsZXQgZnJvbSA9IFswLCAwXSwgdG8gPSBbMCwgMF0sIGQ7XG4gICAgICAgIGxldCBjb25uZWN0ZWRLZXlzID0gT2JqZWN0LmtleXMoY29ubmVjdGVkKTtcbiAgICAgICAgbGV0IG5vdENvbm5lY3RlZEtleXMgPSBPYmplY3Qua2V5cyhub3RDb25uZWN0ZWQpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDU7IGkrKykge1xuICAgICAgICAgICAgaWYgKGNvbm5lY3RlZEtleXMubGVuZ3RoIDwgbm90Q29ubmVjdGVkS2V5cy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBsZXQga2V5cyA9IGNvbm5lY3RlZEtleXM7XG4gICAgICAgICAgICAgICAgdG8gPSBjb25uZWN0ZWRba2V5c1tSTkcuZ2V0VW5pZm9ybUludCgwLCBrZXlzLmxlbmd0aCAtIDEpXV07XG4gICAgICAgICAgICAgICAgZnJvbSA9IHRoaXMuX2dldENsb3Nlc3QodG8sIG5vdENvbm5lY3RlZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQga2V5cyA9IG5vdENvbm5lY3RlZEtleXM7XG4gICAgICAgICAgICAgICAgZnJvbSA9IG5vdENvbm5lY3RlZFtrZXlzW1JORy5nZXRVbmlmb3JtSW50KDAsIGtleXMubGVuZ3RoIC0gMSldXTtcbiAgICAgICAgICAgICAgICB0byA9IHRoaXMuX2dldENsb3Nlc3QoZnJvbSwgY29ubmVjdGVkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGQgPSAoZnJvbVswXSAtIHRvWzBdKSAqIChmcm9tWzBdIC0gdG9bMF0pICsgKGZyb21bMV0gLSB0b1sxXSkgKiAoZnJvbVsxXSAtIHRvWzFdKTtcbiAgICAgICAgICAgIGlmIChkIDwgNjQpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvLyBjb25zb2xlLmxvZyhcIj4+PiBjb25uZWN0ZWQ9XCIgKyB0byArIFwiIG5vdENvbm5lY3RlZD1cIiArIGZyb20gKyBcIiBkaXN0PVwiICsgZCk7XG4gICAgICAgIHJldHVybiBbZnJvbSwgdG9dO1xuICAgIH1cbiAgICBfZ2V0Q2xvc2VzdChwb2ludCwgc3BhY2UpIHtcbiAgICAgICAgbGV0IG1pblBvaW50ID0gbnVsbDtcbiAgICAgICAgbGV0IG1pbkRpc3QgPSBudWxsO1xuICAgICAgICBmb3IgKGxldCBrIGluIHNwYWNlKSB7XG4gICAgICAgICAgICBsZXQgcCA9IHNwYWNlW2tdO1xuICAgICAgICAgICAgbGV0IGQgPSAocFswXSAtIHBvaW50WzBdKSAqIChwWzBdIC0gcG9pbnRbMF0pICsgKHBbMV0gLSBwb2ludFsxXSkgKiAocFsxXSAtIHBvaW50WzFdKTtcbiAgICAgICAgICAgIGlmIChtaW5EaXN0ID09IG51bGwgfHwgZCA8IG1pbkRpc3QpIHtcbiAgICAgICAgICAgICAgICBtaW5EaXN0ID0gZDtcbiAgICAgICAgICAgICAgICBtaW5Qb2ludCA9IHA7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG1pblBvaW50O1xuICAgIH1cbiAgICBfZmluZENvbm5lY3RlZChjb25uZWN0ZWQsIG5vdENvbm5lY3RlZCwgc3RhY2ssIGtlZXBOb3RDb25uZWN0ZWQsIHZhbHVlKSB7XG4gICAgICAgIHdoaWxlIChzdGFjay5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBsZXQgcCA9IHN0YWNrLnNwbGljZSgwLCAxKVswXTtcbiAgICAgICAgICAgIGxldCB0ZXN0cztcbiAgICAgICAgICAgIGlmICh0aGlzLl9vcHRpb25zLnRvcG9sb2d5ID09IDYpIHtcbiAgICAgICAgICAgICAgICB0ZXN0cyA9IFtcbiAgICAgICAgICAgICAgICAgICAgW3BbMF0gKyAyLCBwWzFdXSxcbiAgICAgICAgICAgICAgICAgICAgW3BbMF0gKyAxLCBwWzFdIC0gMV0sXG4gICAgICAgICAgICAgICAgICAgIFtwWzBdIC0gMSwgcFsxXSAtIDFdLFxuICAgICAgICAgICAgICAgICAgICBbcFswXSAtIDIsIHBbMV1dLFxuICAgICAgICAgICAgICAgICAgICBbcFswXSAtIDEsIHBbMV0gKyAxXSxcbiAgICAgICAgICAgICAgICAgICAgW3BbMF0gKyAxLCBwWzFdICsgMV0sXG4gICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHRlc3RzID0gW1xuICAgICAgICAgICAgICAgICAgICBbcFswXSArIDEsIHBbMV1dLFxuICAgICAgICAgICAgICAgICAgICBbcFswXSAtIDEsIHBbMV1dLFxuICAgICAgICAgICAgICAgICAgICBbcFswXSwgcFsxXSArIDFdLFxuICAgICAgICAgICAgICAgICAgICBbcFswXSwgcFsxXSAtIDFdXG4gICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGVzdHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQga2V5ID0gdGhpcy5fcG9pbnRLZXkodGVzdHNbaV0pO1xuICAgICAgICAgICAgICAgIGlmIChjb25uZWN0ZWRba2V5XSA9PSBudWxsICYmIHRoaXMuX2ZyZWVTcGFjZSh0ZXN0c1tpXVswXSwgdGVzdHNbaV1bMV0sIHZhbHVlKSkge1xuICAgICAgICAgICAgICAgICAgICBjb25uZWN0ZWRba2V5XSA9IHRlc3RzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWtlZXBOb3RDb25uZWN0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBub3RDb25uZWN0ZWRba2V5XTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBzdGFjay5wdXNoKHRlc3RzW2ldKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgX3R1bm5lbFRvQ29ubmVjdGVkKHRvLCBmcm9tLCBjb25uZWN0ZWQsIG5vdENvbm5lY3RlZCwgdmFsdWUsIGNvbm5lY3Rpb25DYWxsYmFjaykge1xuICAgICAgICBsZXQgYSwgYjtcbiAgICAgICAgaWYgKGZyb21bMF0gPCB0b1swXSkge1xuICAgICAgICAgICAgYSA9IGZyb207XG4gICAgICAgICAgICBiID0gdG87XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBhID0gdG87XG4gICAgICAgICAgICBiID0gZnJvbTtcbiAgICAgICAgfVxuICAgICAgICBmb3IgKGxldCB4eCA9IGFbMF07IHh4IDw9IGJbMF07IHh4KyspIHtcbiAgICAgICAgICAgIHRoaXMuX21hcFt4eF1bYVsxXV0gPSB2YWx1ZTtcbiAgICAgICAgICAgIGxldCBwID0gW3h4LCBhWzFdXTtcbiAgICAgICAgICAgIGxldCBwa2V5ID0gdGhpcy5fcG9pbnRLZXkocCk7XG4gICAgICAgICAgICBjb25uZWN0ZWRbcGtleV0gPSBwO1xuICAgICAgICAgICAgZGVsZXRlIG5vdENvbm5lY3RlZFtwa2V5XTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoY29ubmVjdGlvbkNhbGxiYWNrICYmIGFbMF0gPCBiWzBdKSB7XG4gICAgICAgICAgICBjb25uZWN0aW9uQ2FsbGJhY2soYSwgW2JbMF0sIGFbMV1dKTtcbiAgICAgICAgfVxuICAgICAgICAvLyB4IGlzIG5vdyBmaXhlZFxuICAgICAgICBsZXQgeCA9IGJbMF07XG4gICAgICAgIGlmIChmcm9tWzFdIDwgdG9bMV0pIHtcbiAgICAgICAgICAgIGEgPSBmcm9tO1xuICAgICAgICAgICAgYiA9IHRvO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgYSA9IHRvO1xuICAgICAgICAgICAgYiA9IGZyb207XG4gICAgICAgIH1cbiAgICAgICAgZm9yIChsZXQgeXkgPSBhWzFdOyB5eSA8IGJbMV07IHl5KyspIHtcbiAgICAgICAgICAgIHRoaXMuX21hcFt4XVt5eV0gPSB2YWx1ZTtcbiAgICAgICAgICAgIGxldCBwID0gW3gsIHl5XTtcbiAgICAgICAgICAgIGxldCBwa2V5ID0gdGhpcy5fcG9pbnRLZXkocCk7XG4gICAgICAgICAgICBjb25uZWN0ZWRbcGtleV0gPSBwO1xuICAgICAgICAgICAgZGVsZXRlIG5vdENvbm5lY3RlZFtwa2V5XTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoY29ubmVjdGlvbkNhbGxiYWNrICYmIGFbMV0gPCBiWzFdKSB7XG4gICAgICAgICAgICBjb25uZWN0aW9uQ2FsbGJhY2soW2JbMF0sIGFbMV1dLCBbYlswXSwgYlsxXV0pO1xuICAgICAgICB9XG4gICAgfVxuICAgIF90dW5uZWxUb0Nvbm5lY3RlZDYodG8sIGZyb20sIGNvbm5lY3RlZCwgbm90Q29ubmVjdGVkLCB2YWx1ZSwgY29ubmVjdGlvbkNhbGxiYWNrKSB7XG4gICAgICAgIGxldCBhLCBiO1xuICAgICAgICBpZiAoZnJvbVswXSA8IHRvWzBdKSB7XG4gICAgICAgICAgICBhID0gZnJvbTtcbiAgICAgICAgICAgIGIgPSB0bztcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGEgPSB0bztcbiAgICAgICAgICAgIGIgPSBmcm9tO1xuICAgICAgICB9XG4gICAgICAgIC8vIHR1bm5lbCBkaWFnb25hbGx5IHVudGlsIGhvcml6b250YWxseSBsZXZlbFxuICAgICAgICBsZXQgeHggPSBhWzBdO1xuICAgICAgICBsZXQgeXkgPSBhWzFdO1xuICAgICAgICB3aGlsZSAoISh4eCA9PSBiWzBdICYmIHl5ID09IGJbMV0pKSB7XG4gICAgICAgICAgICBsZXQgc3RlcFdpZHRoID0gMjtcbiAgICAgICAgICAgIGlmICh5eSA8IGJbMV0pIHtcbiAgICAgICAgICAgICAgICB5eSsrO1xuICAgICAgICAgICAgICAgIHN0ZXBXaWR0aCA9IDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICh5eSA+IGJbMV0pIHtcbiAgICAgICAgICAgICAgICB5eS0tO1xuICAgICAgICAgICAgICAgIHN0ZXBXaWR0aCA9IDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoeHggPCBiWzBdKSB7XG4gICAgICAgICAgICAgICAgeHggKz0gc3RlcFdpZHRoO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoeHggPiBiWzBdKSB7XG4gICAgICAgICAgICAgICAgeHggLT0gc3RlcFdpZHRoO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoYlsxXSAlIDIpIHtcbiAgICAgICAgICAgICAgICAvLyBXb24ndCBzdGVwIG91dHNpZGUgbWFwIGlmIGRlc3RpbmF0aW9uIG9uIGlzIG1hcCdzIHJpZ2h0IGVkZ2VcbiAgICAgICAgICAgICAgICB4eCAtPSBzdGVwV2lkdGg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBkaXR0byBmb3IgbGVmdCBlZGdlXG4gICAgICAgICAgICAgICAgeHggKz0gc3RlcFdpZHRoO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy5fbWFwW3h4XVt5eV0gPSB2YWx1ZTtcbiAgICAgICAgICAgIGxldCBwID0gW3h4LCB5eV07XG4gICAgICAgICAgICBsZXQgcGtleSA9IHRoaXMuX3BvaW50S2V5KHApO1xuICAgICAgICAgICAgY29ubmVjdGVkW3BrZXldID0gcDtcbiAgICAgICAgICAgIGRlbGV0ZSBub3RDb25uZWN0ZWRbcGtleV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvbm5lY3Rpb25DYWxsYmFjaykge1xuICAgICAgICAgICAgY29ubmVjdGlvbkNhbGxiYWNrKGZyb20sIHRvKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBfZnJlZVNwYWNlKHgsIHksIHZhbHVlKSB7XG4gICAgICAgIHJldHVybiB4ID49IDAgJiYgeCA8IHRoaXMuX3dpZHRoICYmIHkgPj0gMCAmJiB5IDwgdGhpcy5faGVpZ2h0ICYmIHRoaXMuX21hcFt4XVt5XSA9PSB2YWx1ZTtcbiAgICB9XG4gICAgX3BvaW50S2V5KHApIHsgcmV0dXJuIHBbMF0gKyBcIi5cIiArIHBbMV07IH1cbn1cbiIsImltcG9ydCBEdW5nZW9uIGZyb20gXCIuL2R1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sZXQgYXJlYSA9ICh0aGlzLl93aWR0aCAtIDIpICogKHRoaXMuX2hlaWdodCAtIDIpO1xuICAgICAgICB0aGlzLl9maXJzdFJvb20oKTtcbiAgICAgICAgbGV0IHQxID0gRGF0ZS5ub3coKTtcbiAgICAgICAgbGV0IHByaW9yaXR5V2FsbHM7XG4gICAgICAgIGRvIHtcbiAgICAgICAgICAgIHByaW9yaXR5V2FsbHMgPSAwO1xuICAgICAgICAgICAgbGV0IHQyID0gRGF0ZS5ub3coKTtcbiAgICAgICAgICAgIGlmICh0MiAtIHQxID4gdGhpcy5fb3B0aW9ucy50aW1lTGltaXQpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8qIGZpbmQgYSBnb29kIHdhbGwgKi9cbiAgICAgICAgICAgIGxldCB3YWxsID0gdGhpcy5fZmluZFdhbGwoKTtcbiAgICAgICAgICAgIGlmICghd2FsbCkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfSAvKiBubyBtb3JlIHdhbGxzICovXG4gICAgICAgICAgICBsZXQgcGFydHMgPSB3YWxsLnNwbGl0KFwiLFwiKTtcbiAgICAgICAgICAgIGxldCB4ID0gcGFyc2VJbnQocGFydHNbMF0pO1xuICAgICAgICAgICAgbGV0IHkgPSBwYXJzZUludChwYXJ0c1sxXSk7XG4gICAgICAgICAgICBsZXQgZGlyID0gdGhpcy5fZ2V0RGlnZ2luZ0RpcmVjdGlvbih4LCB5KTtcbiAgICAgICAgICAgIGlmICghZGlyKSB7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9IC8qIHRoaXMgd2FsbCBpcyBub3Qgc3VpdGFibGUgKi9cbiAgICAgICAgICAgIC8vXHRcdGNvbnNvbGUubG9nKFwid2FsbFwiLCB4LCB5KTtcbiAgICAgICAgICAgIC8qIHRyeSBhZGRpbmcgYSBmZWF0dXJlICovXG4gICAgICAgICAgICBsZXQgZmVhdHVyZUF0dGVtcHRzID0gMDtcbiAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICBmZWF0dXJlQXR0ZW1wdHMrKztcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5fdHJ5RmVhdHVyZSh4LCB5LCBkaXJbMF0sIGRpclsxXSkpIHsgLyogZmVhdHVyZSBhZGRlZCAqL1xuICAgICAgICAgICAgICAgICAgICAvL2lmICh0aGlzLl9yb29tcy5sZW5ndGggKyB0aGlzLl9jb3JyaWRvcnMubGVuZ3RoID09IDIpIHsgdGhpcy5fcm9vbXNbMF0uYWRkRG9vcih4LCB5KTsgfSAvKiBmaXJzdCByb29tIG9maWNpYWxseSBoYXMgZG9vcnMgKi9cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fcmVtb3ZlU3Vycm91bmRpbmdXYWxscyh4LCB5KTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fcmVtb3ZlU3Vycm91bmRpbmdXYWxscyh4IC0gZGlyWzBdLCB5IC0gZGlyWzFdKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSB3aGlsZSAoZmVhdHVyZUF0dGVtcHRzIDwgdGhpcy5fZmVhdHVyZUF0dGVtcHRzKTtcbiAgICAgICAgICAgIGZvciAobGV0IGlkIGluIHRoaXMuX3dhbGxzKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuX3dhbGxzW2lkXSA+IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgcHJpb3JpdHlXYWxscysrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSB3aGlsZSAodGhpcy5fZHVnIC8gYXJlYSA8IHRoaXMuX29wdGlvbnMuZHVnUGVyY2VudGFnZSB8fCBwcmlvcml0eVdhbGxzKTsgLyogZml4bWUgbnVtYmVyIG9mIHByaW9yaXR5IHdhbGxzICovXG4gICAgICAgIHRoaXMuX2FkZERvb3JzKCk7XG4gICAgICAgIGlmIChjYWxsYmFjaykge1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aGlzLl93aWR0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCB0aGlzLl9oZWlnaHQ7IGorKykge1xuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayhpLCBqLCB0aGlzLl9tYXBbaV1bal0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aGlzLl93YWxscyA9IHt9O1xuICAgICAgICB0aGlzLl9tYXAgPSBbXTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuICAgIF9kaWdDYWxsYmFjayh4LCB5LCB2YWx1ZSkge1xuICAgICAgICBpZiAodmFsdWUgPT0gMCB8fCB2YWx1ZSA9PSAyKSB7IC8qIGVtcHR5ICovXG4gICAgICAgICAgICB0aGlzLl9tYXBbeF1beV0gPSAwO1xuICAgICAgICAgICAgdGhpcy5fZHVnKys7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7IC8qIHdhbGwgKi9cbiAgICAgICAgICAgIHRoaXMuX3dhbGxzW3ggKyBcIixcIiArIHldID0gMTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBfaXNXYWxsQ2FsbGJhY2soeCwgeSkge1xuICAgICAgICBpZiAoeCA8IDAgfHwgeSA8IDAgfHwgeCA+PSB0aGlzLl93aWR0aCB8fCB5ID49IHRoaXMuX2hlaWdodCkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiAodGhpcy5fbWFwW3hdW3ldID09IDEpO1xuICAgIH1cbiAgICBfY2FuQmVEdWdDYWxsYmFjayh4LCB5KSB7XG4gICAgICAgIGlmICh4IDwgMSB8fCB5IDwgMSB8fCB4ICsgMSA+PSB0aGlzLl93aWR0aCB8fCB5ICsgMSA+PSB0aGlzLl9oZWlnaHQpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gKHRoaXMuX21hcFt4XVt5XSA9PSAxKTtcbiAgICB9XG4gICAgX3ByaW9yaXR5V2FsbENhbGxiYWNrKHgsIHkpIHsgdGhpcy5fd2FsbHNbeCArIFwiLFwiICsgeV0gPSAyOyB9XG4gICAgO1xuICAgIF9maXJzdFJvb20oKSB7XG4gICAgICAgIGxldCBjeCA9IE1hdGguZmxvb3IodGhpcy5fd2lkdGggLyAyKTtcbiAgICAgICAgbGV0IGN5ID0gTWF0aC5mbG9vcih0aGlzLl9oZWlnaHQgLyAyKTtcbiAgICAgICAgbGV0IHJvb20gPSBSb29tLmNyZWF0ZVJhbmRvbUNlbnRlcihjeCwgY3ksIHRoaXMuX29wdGlvbnMpO1xuICAgICAgICB0aGlzLl9yb29tcy5wdXNoKHJvb20pO1xuICAgICAgICByb29tLmNyZWF0ZSh0aGlzLl9kaWdDYWxsYmFjayk7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIEdldCBhIHN1aXRhYmxlIHdhbGxcbiAgICAgKi9cbiAgICBfZmluZFdhbGwoKSB7XG4gICAgICAgIGxldCBwcmlvMSA9IFtdO1xuICAgICAgICBsZXQgcHJpbzIgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaWQgaW4gdGhpcy5fd2FsbHMpIHtcbiAgICAgICAgICAgIGxldCBwcmlvID0gdGhpcy5fd2FsbHNbaWRdO1xuICAgICAgICAgICAgaWYgKHByaW8gPT0gMikge1xuICAgICAgICAgICAgICAgIHByaW8yLnB1c2goaWQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgcHJpbzEucHVzaChpZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGFyciA9IChwcmlvMi5sZW5ndGggPyBwcmlvMiA6IHByaW8xKTtcbiAgIC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W9uKGN4LCBjeSkge1xuICAgICAgICBpZiAoY3ggPD0gMCB8fCBjeSA8PSAwIHx8IGN4ID49IHRoaXMuX3dpZHRoIC0gMSB8fCBjeSA+PSB0aGlzLl9oZWlnaHQgLSAxKSB7XG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzdWx0ID0gbnVsbDtcbiAgICAgICAgbGV0IGRlbHRhcyA9IERJUlNbNF07XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZGVsdGFzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgZGVsdGEgPSBkZWx0YXNbaV07XG4gICAgICAgICAgICBsZXQgeCA9IGN4ICsgZGVsdGFbMF07XG4gICAgICAgICAgICBsZXQgeSA9IGN5ICsgZGVsdGFbMV07XG4gICAgICAgICAgICBpZiAoIXRoaXMuX21hcFt4XVt5XSkgeyAvKiB0aGVyZSBhbHJlYWR5IGlzIGFub3RoZXIgZW1wdHkgbmVpZ2hib3IhICovXG4gICAgICAgICAgICAgICAgaWYgKHJlc3VsdCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gZGVsdGE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLyogbm8gZW1wdHkgbmVpZ2hib3IgKi9cbiAgICAgICAgaWYgKCFyZXN1bHQpIHtcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBbLXJlc3VsdFswXSwgLXJlc3VsdFsxXV07XG4gICAgfVxuICAgIC8qKlxuICAgICAqIEZpbmQgZW1wdHkgc3BhY2VzIHN1cnJvdW5kaW5nIHJvb21zLCBhbmQgYXBwbHkgZG9vcnMuXG4gICAgICovXG4gICAgX2FkZERvb3JzKCkge1xuICAgICAgICBsZXQgZGF0YSA9IHRoaXMuX21h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pcy5fbWFwLnB1c2goW10pO1xuICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBoOyBqKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgYm9yZGVyID0gKGkgPT0gMCB8fCBqID09IDAgfHwgaSArIDEgPT0gdyB8fCBqICsgMSA9PSBoKTtcbiAgICAgICAgICAgICAgICB0aGlzLl9tYXBbaV0ucHVzaChib3JkZXIgPyAxIDogMCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5fc3RhY2sgPSBbXG4gICAgICAgICAgICBbMSwgMSwgdyAtIDIsIGggLSAyXVxuICAgICAgICBdO1xuICAgICAgICB0aGlzLl9wcm9jZXNzKCk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdzsgaSsrKSB7XG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGg7IGorKykge1xuICAgICAgICAgICAgICAgIGNhbGxiYWNrKGksIGosIHRoaXMuX21hcFtpXVtqXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5fbWFwID0gW107XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cbiAgICBfcHJvY2VzcygpIHtcbiAgICAgICAgd2hpbGUgKHRoaXMuX3N0YWNrLmxlbmd0aCkge1xuICAgICAgICAgICAgbGV0IHJvb20gPSB0aGlzLl9zdGFjay5zaGlmdCgpOyAvKiBbbGVmdCwgdG9wLCByaWdodCwgYm90dG9tXSAqL1xuICAgICAgICAgICAgdGhpcy5fcGFydGl0aW9uUm9vbShyb29tKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBfcGFydGl0aW9uUm9vbShyb29tKSB7XG4gICAgICAgIGxldCBhdmFpbFggPSBbXTtcbiAgICAgICAgbGV0IGF2YWlsWSA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gcm9vbVswXSArIDE7IGkgPCByb29tWzJdOyBpKyspIHtcbiAgICAgICAgICAgIGxldCB0b3AgPSB0aGlzLl9tYXBbaV1bcm9vbVsxXSAtIDFdO1xuICAgICAgICAgICAgbGV0IGJvdHRvbSA9IHRoaXMuX21hcFtpXVtyb29tWzNdICsgMV07XG4gICAgICAgICAgICBpZiAodG9wICYmIGJvdHRvbSAmJiAhKGkgJSAyKSkge1xuICAgICAgICAgICAgICAgIGF2YWlsWC5wdXNoKGkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZvciAobGV0IGogPSByb29tWzFdICsgMTsgaiA8IHJvb21bM107IGorKykge1xuICAgICAgICAgICAgbGV0IGxlZnQgPSB0aGlzLl9tYXBbcm9vbVswXSAtIDFdW2pdO1xuICAgICAgICAgICAgbGV0IHJpZ2h0ID0gdGhpcy5fbWFwW3Jvb21bMl0gKyAxXVtqXTtcbiAgICAgICAgICAgIGlmIChsZWZ0ICYmIHJpZ2h0ICYmICEoaiAlIDIpKSB7XG4gICAgICAgICAgICAgICAgYXZhaWxZLnB1c2goaik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFhdmFpbFgubGVuZ3RoIHx8ICFhdmFpbFkubGVuZ3RoKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHggPSBSTkcuZ2V0SXRlbShhdmFpbFgpO1xuICAgICAgICBsZXQgeSA9IFJORy5nZXRJdGVtKGF2YWlsWSk7XG4gICAgICAgIHRoaXMuX21hcFt4XVt5XSA9IDE7XG4gICAgICAgIGxldCB3YWxscyA9IFtdO1xuICAgICAgICBsZXQgdyA9IFtdO1xuICAgICAgICB3YWxscy5wdXNoKHcpOyAvKiBsZWZ0IHBhcnQgKi9cbiAgICAgICAgZm9yIChsZXQgaSA9IHJvb21bMF07IGkgPCB4OyBpKyspIHtcbiAgICAgICAgICAgIHRoaXMuX21hcFtpXVt5XSA9IDE7XG4gICAgICAgICAgICBpZiAoaSAlIDIpXG4gICAgICAgICAgICAgICAgdy5wdXNoKFtpLCB5XSk7XG4gICAgICAgIH1cbiAgICAgICAgdyA9IFtdO1xuICAgICAgICB3YWxscy5wdXNoKHcpOyAvKiByaWdodCBwYXJ0ICovXG4gICAgICAgIGZvciAobGV0IGkgPSB4ICsgMTsgaSA8PSByb29tWzJdOyBpKyspIHtcbiAgICAgICAgICAgIHRoaXMuX21hcFtpXVt5XSA9IDE7XG4gICAgICAgICAgICBpZiAoaSAlIDIpXG4gICAgICAgICAgICAgICAgdy5wdXNoKFtpLCB5XSk7XG4gICAgICAgIH1cbiAgICAgICAgdyA9IFtdO1xuICAgICAgICB3YWxscy5wdXNoKHcpOyAvKiB0b3AgcGFydCAqL1xuICAgICAgICBmb3IgKGxldCBqID0gcm9vbVsxXTsgaiA8IHk7IGorKykge1xuICAgICAgICAgICAgdGhpcy5fbWFwW3hdW2pdID0gMTtcbiAgICAgICAgICAgIGlmIChqICUgMilcbiAgICAgICAgICAgICAgICB3LnB1c2goW3gsIGpdKTtcbiAgICAgICAgfVxuICAgICAgICB3ID0gW107XG4gICAgICAgIHdhbGxzLnB1c2godyk7IC8qIGJvdHRvbSBwYXJ0ICovXG4gICAgICAgIGZvciAobGV0IGogPSB5ICsgMTsgaiA8PSByb29tWzNdOyBqKyspIHtcbiAgICAgICAgICAgIHRoaXMuX21hcFt4XVtqXSA9IDE7XG4gICAgICAgICAgICBpZiAoaiAlIDIpXG4gICAgICAgICAgICAgICAgdy5wdXNoKFt4LCBqXSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHNvbGlkID0gUk5HLmdldEl0ZW0od2FsbHMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHdhbGxzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgdyA9IHdhbGxzW2ldO1xuICAgICAgICAgICAgaWYgKHcgPT0gc29saWQpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBob2xlID0gU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IC8gMjQ7XG4gICAgICAgIGxldCBMID0gW107XG4gICAgICAgIGxldCBSID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdzsgaSsrKSB7XG4gICAgICAgICAgICBMLnB1c2goaSk7XG4gICAgICAgICAgICBSLnB1c2goaSk7XG4gICAgICAgIH1cbiAgICAgICAgTC5wdXNoKHcgLSAxKTsgLyogZmFrZSBzdG9wLWJsb2NrIGF0IHRoZSByaWdodCBzaWRlICovXG4gICAgICAgIGxldCBqO1xuICAgICAgICBmb3IgKGogPSAxOyBqICsgMyA8IHRoaXMuX2hlaWdodDsgaiArPSAyKSB7XG4gICAgICAgICAgICAvKiBvbmUgcm93ICovXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHc7IGkrKykge1xuICAgICAgICAgICAgICAgIC8qIGNlbGwgY29vcmRzICh3aWxsIGJlIGFsd2F5cyBlbXB0eSkgKi9cbiAgICAgICAgICAgICAgICBsZXQgeCA9IDIgKiBpICsgMTtcbiAgICAgICAgICAgICAgICBsZXQgeSA9IGo7XG4gICAgICAgICAgICAgICAgbWFwW3hdW3ldID0gMDtcbiAgICAgICAgICAgICAgICAvKiByaWdodCBjb25uZWN0aW9uICovXG4gICAgICAgICAgICAgICAgaWYgKGkgIT0gTFtpICsgMV0gJiYgUk5HLmdldFVuaWZvcm0oKSA+IHJhbmQpIHtcbiAgICAgICAgICAgICAgICAgICAgYWRkVG9MaXN0KGksIEwsIFIpO1xuICAgICAgICAgICAgICAgICAgICBtYXBbeCArIDFdW3ldID0gMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLyogYm90dG9tIGNvbm5lY3Rpb24gKi9cbiAgICAgICAgICAgICAgICBpZiAoaSAhPSBMW2ldICYmIFJORy5nZXRVbmlmb3JtKCkgPiByYW5kKSB7XG4gICAgICAgICAgICAgICAgICAgIC8qIHJlbW92ZSBjb25uZWN0aW9uICovXG4gICAgICAgICAgICAgICAgICAgIHJlbW92ZUZyb21MaXN0KGksIEwsIFIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgLyogY3JlYXRlIGNvbm5lY3Rpb24gKi9cbiAgICAgICAgICAgICAgICAgICAgbWFwW3hdW3kgKyAxXSA9IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8qIGxhc3Qgcm93ICovXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdzsgaSsrKSB7XG4gICAgICAgICAgICAvKiBjZWxsIGNvb3JkcyAod2lsbCBiZSBhbHdheXMgZW1wdHkpICovXG4gICAgICAgICAgICBsZXQgeCA9IDIgKiBpICsgMTtcbiAgICAgICAgICAgIGxldCB5ID0gajtcbiAgICAgICAgICAgIG1hcFt4XVt5XSA9IDA7XG4gICAgICAgICAgICAvKiByaWdodCBjb25uZWN0aW9uICovXG4gICAgICAgICAgICBpZiAoaSAhPSBMW2kgKyAxXSAmJiAoaSA9PSBMW2ldIHx8IFJORy5nZXRVbmlmb3JtKCkgPiByYW5kKSkge1xuICAgICAgICAgICAgICAgIC8qIGRpZyByaWdodCBhbHNvIGlmIHRoZSBjZWxsIGlzIHNlcGFyYXRlZCwgc28gaXQgZ2V0cyBjb25uZWN0ZWQgdG8gdGhlIHJlc3Qgb2YgbWF6ZSAqL1xuICAgICAgICAgICAgICAgIGFkZFRvTGlzdChpLCBMLCBSKTtcbiAgICAgICAgICAgICAgICBtYXBbeCArIDFdW3ldID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlbW92ZUZyb21MaXN0KGksIEwsIFIpO1xuICAgICAgICB9XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy5fd2lkdGg7IGkrKykge1xuICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCB0aGlzLl9oZWlnaHQ7IGorKykge1xuICAgICAgICAgIC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kpIHtcbiAgICAgICAgdGhpcy5fZG9vcnNbeCArIFwiLFwiICsgeV0gPSAxO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHtmdW5jdGlvbn1cbiAgICAgKi9cbiAgICBnZXREb29ycyhjYikge1xuICAgICAgICBmb3IgKGxldCBrZXkgaW4gdGhpcy5fZG9vcnMpIHtcbiAgICAgICAgICAgIGxldCBwYXJ0cyA9IGtleS5zcGxpdChcIixcIik7XG4gICAgICAgICAgICBjYihwYXJzZUludChwYXJ0c1swXSksIHBhcnNlSW50KHBhcnRzWzFdKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuICAgIGNsZWFyRG9vcnMoKSB7XG4gICAgICAgIHRoaXMuX2Rvb3JzID0ge307XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cbiAgICBhZGREb29ycyhpc1dhbGxDYWxsYmFjaykge1xuICAgICAgICBsZXQgbGVmdCA9IHRoaXMuX3gxIC0gMTtcbiAgICAgICAgbGV0IHJpZ2h0ID0gdGhpcy5feDIgKyAxO1xuICAgICAgICBsZXQgdG9wID0gdGhpcy5feTEgLSAxO1xuICAgICAgICBsZXQgYm90dG9tID0gdGhpcy5feTIgKyAxO1xuICAgICAgICBmb3IgKGxldCB4ID0gbGVmdDsgeCA8PSByaWdodDsgeCsrKSB7XG4gICAgICAgICAgICBmb3IgKGxldCB5ID0gdG9wOyB5IDw9IGJvdHRvbTsgeSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKHggIT0gbGVmdCAmJiB4ICE9IHJpZ2h0ICYmIHkgIT0gdG9wICYmIHkgIT0gYm90dG9tKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaXNXYWxsQ2FsbGJhY2soeCwgeSkpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMuYWRkRG9vcih4LCB5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG4gICAgZGVidWcoKSB7XG4gICAgICAgIGNvbnNvbGUubG9nKFwicm9vbVwiLCB0aGlzLl94MSwgdGhpcy5feTEsIHRoaXMuX3gyLCB0aGlzLl95Mik7XG4gICAgfVxuICAgIGlzVmFsaWQoaXNXYWxsQ2FsbGJhY2ssIGNhbkJlRHVnQ2FsbGJhY2spIHtcbiAgICAgICAgbGV0IGxlZnQgPSB0aGlzLl94MSAtIDE7XG4gICAgICAgIGxldCByaWdodCA9IHRoaXMuX3gyICsgMTtcbiAgICAgICAgbGV0IHRvcCA9IHRoaXMuX3kxIC0gMTtcbiAgICAgICAgbGV0IGJvdHRvbSA9IHRoaXMuX3kyICsgMTtcbiAgICAgICAgZm9yIChsZXQgeCA9IGxlZnQ7IHggPD0gcmlnaHQ7IHgrKykge1xuICAgICAgICAgICAgZm9yIChsZXQgeSA9IHRvcDsgeSA8PSBib3R0b207IHkrKykge1xuICAgICAgICAgICAgICAgIGlmICh4ID09IGxlZnQgfHwgeCA9PSByaWdodCB8fCB5ID09IHRvcCB8fCB5ID09IGJvdHRvbSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWlzV2FsbENhbGxiYWNrKHgsIHkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghY2FuQmVEdWdDYWxsYmFjayh4LCB5KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfV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SAqIGR5O1xuICAgICAgICAgICAgaWYgKCFjYW5CZUR1Z0NhbGxiYWNrKHgsIHkpKSB7XG4gICAgICAgICAgICAgICAgb2sgPSBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghaXNXYWxsQ2FsbGJhY2soeCArIG54LCB5ICsgbnkpKSB7XG4gICAgICAgICAgICAgICAgb2sgPSBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghaXNXYWxsQ2FsbGJhY2soeCAtIG54LCB5IC0gbnkpKSB7XG4gICAgICAgICAgICAgICAgb2sgPSBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghb2spIHtcbiAgICAgICAgICAgICAgICBsZW5ndGggPSBpO1xuICAgICAgICAgICAgICAgIHRoaXMuX2VuZFggPSB4IC0gZHg7XG4gICAgICAgICAgICAgICAgdGhpcy5fZW5kWSA9IHkgLSBkeTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvKipcbiAgICAgICAgICogSWYgdGhlIGxlbmd0aCBkZWdlbmVyYXRlZCwgdGhpcyBjb3JyaWRvciBtaWdodCBiZSBpbnZhbGlkXG4gICAgICAgICAqL1xuICAgICAgICAvKiBub3Qgc3VwcG9ydGVkICovXG4gICAgICAgIGlmIChsZW5ndGggPT0gMCkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIC8qIGxlbmd0aCAxIGFsbG93ZWQgb25seSBpZiB0aGUgbmV4dCBzcGFjZSBpcyBlbXB0eSAqL1xuICAgICAgICBpZiAobGVuZ3RoID09IDEgJiYgaXNXYWxsQ2FsbGJhY2sodGhpcy5fZW5kWCArIGR4LCB0aGlzLl9lbmRZICsgZHkpKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgLyoqXG4gICAgICAgICAqI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AgICAgICAgdGhpcy5fbWFwID0gW107XG4gICAgfVxuICAgIGNyZWF0ZShjYWxsYmFjaykge1xuICAgICAgICBsZXQgd2lkdGggPSB0aGlzLl93aWR0aDtcbiAgICAgICAgbGV0IGhlaWdodCA9IHRoaXMuX2hlaWdodDtcbiAgICAgICAgbGV0IG1hcCA9IHRoaXMuX2ZpbGxNYXAoMSk7XG4gICAgICAgIHdpZHRoIC09ICh3aWR0aCAlIDIgPyAxIDogMik7XG4gICAgICAgIGhlaWdodCAtPSAoaGVpZ2h0ICUgMiA/IDEgOiAyKTtcbiAgICAgICAgbGV0IGN4ID0gMDtcbiAgICAgICAgbGV0IGN5ID0gMDtcbiAgICAgICAgbGV0IG54ID0gMDtcbiAgICAgICAgbGV0IG55ID0gMDtcbiAgICAgICAgbGV0IGRvbmUgPSAwO1xuICAgICAgICBsZXQgYmxvY2tlZCA9IGZhbHNlO1xuICAgICAgICBsZXQgZGlycyA9IFtcbiAgICAgICAgICAgIFswLCAwXSxcbiAgICAgICAgICAgIFswLCAwXSxcbiAgICAgICAgICAgIFswLCAwXSxcbiAgICAgICAgICAgIFswLCAwXVxuICAgICAgICBdO1xuICAgICAgICBkbyB7XG4gICAgICAgICAgICBjeCA9IDEgKyAyICogTWF0aC5mbG9vcihSTkcuZ2V0VW5pZm9ybSgpICogKHdpZHRoIC0gMSkgLyAyKTtcbiAgICAgICAgICAgIGN5ID0gMSArIDIgKiBNYXRoLmZsb29yKFJORy5nZXRVbmlmb3JtKCkgKiAoaGVpZ2h0IC0gMSkgLyAyKTtcbiAgICAgICAgICAgIGlmICghZG9uZSkge1xuICAgICAgICAgICAgICAgIG1hcFtjeF1bY3ldID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghbWFwW2N4XVtjeV0pIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9yYW5kb21pemUoZGlycyk7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoTWF0aC5mbG9vcihSTkcuZ2V0VW5pZm9ybSgpICogKHRoaXMuX3JlZ3VsYXJpdHkgKyAxKSkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fcmFuZG9taXplKGRpcnMpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGJsb2NrZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDQ7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgbnggPSBjeCArIGRpcnNbaV1bMF0gKiAyO1xuICAgICAgICAgICAgICAgICAgICAgICAgbnkgPSBjeSArIGRpcnNbaV1bMV0gKiAyO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2lzRnJlZShtYXAsIG54LCBueSwgd2lkdGgsIGhlaWdodCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXBbbnhdW255XSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFwW2N4ICsgZGlyc1tpXVswXV1bY3kgKyBkaXJzW2ldWzFdXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY3ggPSBueDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjeSA9IG55O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsb2NrZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb25lKys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IHdoaWxlICghYmxvY2tlZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gd2hpbGUgKGRvbmUgKyAxIDwgd2lkdGggKiBoZWlnaHQgLyA0KTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aGlzLl93aWR0aDsgaSsrKSB7XG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IHRoaXMuX2hlaWdodDsgaisrKSB7XG4gICAgICAgICAgICAgICAgY2FsbGJhY2soaSwgaiwgbWFwW2ldW2pdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aGlzLl9tYXAgPSBbXTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuICAgIF9yYW5kb21pemUoZGlycykge1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDQ7IGkrKykge1xuICAgICAgICAgICAgZGlyc1tpXVswXSA9IDA7XG4gICAgICAgICAgICBkaXJzW2ldWzFdID0gMDtcbiAgICAgICAgfVxuICAgICAgICBzd2l0Y2ggKE1hdGguZmxvb3IoUk5HLmdldFVuaWZvcm0oKSAqIDQpKSB7XG4gICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgZGlyc1swXVswXSA9IC0xO1xuICAgICAgICAgICAgICAgIGRpcnNbMV1bMF0gPSAxO1xuICAgICAgICAgICAgICAgIGRpcnNbMl1bMV0gPSAtMTtcbiAgICAgICAgICAgICAgICBkaXJzWzNdWzFdID0gMTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICBkaXJzWzNdWzBdID0gLTE7XG4gICAgICAgICAgICAgICAgZGlyc1syXVswXSA9IDE7XG4gICAgICAgICAgICAgICAgZGlyc1sxXVsxXSA9IC0xO1xuICAgICAgICAgICAgICAgIGRpcnNbMF1bMV0gPSAxO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgIGRpcnNbMl1bMF0gPSAtMTtcbiAgICAgICAgICAgICAgICBkaXJzWzNdWzBdID0gMTtcbiAgICAgICAgICAgICAgICBkaXJzWzBdWzFdID0gLTE7XG4gICAgICAgICAgICAgICAgZGlyc1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hhc093blByb3BlcnR5KFwicm9vbUhlaWdodFwiKSkge1xuICAgICAgICAgICAgb3B0aW9uc1tcInJvb21IZWlnaHRcIl0gPSB0aGlzLl9jYWxjdWxhdGVSb29tU2l6ZSh0aGlzLl9oZWlnaHQsIG9wdGlvbnNbXCJjZWxsSGVpZ2h0XCJdKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLl9vcHRpb25zID0gb3B0aW9ucztcbiAgICB9XG4gICAgY3JlYXRlKGNhbGxiYWNrKSB7XG4gICAgICAgIHRoaXMubWFwID0gdGhpcy5fZmlsbE1hcCgxKTtcbiAgICAgICAgdGhpcy5yb29tcyA9IFtdO1xuICAgICAgICB0aGlzLmNvbm5lY3RlZENlbGxzID0gW107XG4gICAgICAgIHRoaXMuX2luaXRSb29tcygpO1xuICAgICAgICB0aGlzLl9jb25uZWN0Um9vbXMoKTtcbiAgICAgICAgdGhpcy5fY29ubmVjdFVuY29ubmVjdGVkUm9vbXMoKTtcbiAgICAgICAgdGhpcy5fY3JlYXRlUmFuZG9tUm9vbUNvbm5lY3Rpb25zKCk7XG4gICAgICAgIHRoaXMuX2NyZWF0ZVJvb21zKCk7XG4gICAgICAgIHRoaXMuX2NyZWF0ZUNvcnJpZG9ycygpO1xuICAgICAgICBpZiAoY2FsbGJhY2spIHtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy5fd2lkdGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgdGhpcy5faGVpZ2h0OyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2soaSwgaiwgdGhpcy5tYXBbaV1bal0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG4gICAgX2NhbGN1bGF0ZVJvb21TaXplKHNpemUsIGNlbGwpIHtcbiAgICAgICAgbGV0IG1heCA9IE1hdGgu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uY2VsbEhlaWdodCAtIDEpO1xuICAgICAgICBsZXQgaWR4O1xuICAgICAgICBsZXQgbmNneDtcbiAgICAgICAgbGV0IG5jZ3k7XG4gICAgICAgIGxldCBmb3VuZCA9IGZhbHNlO1xuICAgICAgICBsZXQgcm9vbTtcbiAgICAgICAgbGV0IG90aGVyUm9vbTtcbiAgICAgICAgbGV0IGRpclRvQ2hlY2s7XG4gICAgICAgIC8vIGZpbmQgIHVuY29ubmVjdGVkIG5laWdoYm91ciBjZWxsc1xuICAgICAgICBkbyB7XG4gICAgICAgICAgICAvL2RpclRvQ2hlY2sgPSBbMCwgMSwgMiwgMywgNCwgNSwgNiwgN107XG4gICAgICAgICAgICBkaXJUb0NoZWNrID0gWzAsIDIsIDQsIDZdO1xuICAgICAgICAgICAgZGlyVG9DaGVjayA9IFJORy5zaHVmZmxlKGRpclRvQ2hlY2spO1xuICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgIGZvdW5kID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgaWR4ID0gZGlyVG9DaGVjay5wb3AoKTtcbiAgICAgICAgICAgICAgICBuY2d4ID0gY2d4ICsgRElSU1s4XVtpZHhdWzBdO1xuICAgICAgICAgICAgICAgIG5jZ3kgPSBjZ3kgKyBESVJTWzhdW2lkeF1bMV07XG4gICAgICAgICAgICAgICAgaWYgKG5jZ3ggPCAwIHx8IG5jZ3ggPj0gdGhpcy5fb3B0aW9ucy5jZWxsV2lkdGgpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChuY2d5IDwgMCB8fCBuY2d5ID49IHRoaXMuX29wdGlvbnMuY2VsbEhlaWdodCkge1xuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcm9vbSA9IHRoaXMucm9vbXNbY2d4XVtjZ3ldO1xuICAgICAgICAgICAgICAgIGlmIChyb29tW1wiY29ubmVjdGlvbnNcIl0ubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAvLyBhcyBsb25nIGFzIHRoaXMgcm9vbSBkb2Vzbid0IGFscmVhZHkgY29vbmVjdCB0byBtZSwgd2UgYXJlIG9rIHdpdGggaXQuXG4gICAgICAgICAgICAgICAgICAgIGlmIChyb29tW1wiY29ubmVjdGlvbnNcIl1bMF1bMF0gPT0gbmNneCAmJiByb29tW1wiY29ubmVjdGlvbnNcIl1bMF1bMV0gPT0gbmNneSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgb3RoZXJSb29tID0gdGhpcy5yb29tc1tuY2d4XVtuY2d5XTtcbiAgICAgICAgICAgICAgICBpZiAob3RoZXJSb29tW1wiY29ubmVjdGlvbnNcIl0ubGVuZ3RoID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgb3RoZXJSb29tW1wiY29ubmVjdGlvbnNcIl0ucHVzaChbY2d4LCBjZ3ldKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jb25uZWN0ZWRDZWxscy5wdXNoKFtuY2d4LCBuY2d5XSk7XG4gICAgICAgICAgICAgICAgICAgIGNneCA9IG5jZ3g7XG4gICAgICAgICAgICAgICAgICAgIGNneSA9IG5jZ3k7XG4gICAgICAgICAgICAgICAgICAgIGZvdW5kID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IHdoaWxlIChkaXJUb0NoZWNrLmxlbmd0aCA+IDAgJiYgZm91bmQgPT0gZmFsc2UpO1xuICAgICAgICB9IHdoaWxlIChkaXJUb0NoZWNrLmxlbmd0aCA+IDApO1xuICAgIH1cbiAgICBfY29ubmVjdFVuY29ubmVjdGVkUm9vbXMoKSB7XG4gICAgICAgIC8vV2hpbGUgdGhlcmUgYXJlIHVuY29ubmVjdGVkIHJvb21zLCB0cnkgdG8gY29ubmVjdCB0aGVtIHRvIGEgcmFuZG9tIGNvbm5lY3RlZCBuZWlnaGJvclxuICAgICAgICAvLyhpZiBhIHJvb20gaGFzIG5vIGNvbm5lY3RlZCBuZWlnaGJvcnMgeWV0LCBqdXN0IGtlZXAgY3ljbGluZywgeW91J2xsIGZpbGwgb3V0IHRvIGl0IGV2ZW50dWFsbHkpLlxuICAgICAgICBsZXQgY3cgPSB0aGlzLl9vcHRpb25zLmNlbGxXaWR0aDtcbiAgICAgICAgbGV0IGNoID0gdGhpcy5fb3B0aW9ucy5jZWxsSGVpZ2h0O1xuICAgICAgICB0aGlzLmNvbm5lY3RlZENlbGxzID0gUk5HLnNodWZmbGUodGhpcy5jb25uZWN0ZWRDZWxscyk7XG4gICAgICAgIGxldCByb29tO1xuICAgICAgICBsZXQgb3RoZXJSb29tO1xuICAgICAgICBsZXQgdmFsaWRSb29tO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRoaXMuX29wdGlvbnMuY2VsbFdpZHRoOyBpKyspIHtcbiAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgdGhpcy5fb3B0aW9ucy5jZWxsSGVpZ2h0OyBqKyspIHtcbiAgICAgICAgICAgICAgICByb29tID0gdGhpcy5yb29tc1tpXVtqXTtcbiAgICAgICAgICAgICAgICBpZiAocm9vbVtcImNvbm5lY3Rpb25zXCJdLmxlbmd0aCA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBkaXJlY3Rpb25zID0gWzAsIDIsIDQsIDZdO1xuICAgICAgICAgICAgICAgICAgICBkaXJlY3Rpb25zID0gUk5HLnNodWZmbGUoZGlyZWN0aW9ucyk7XG4gICAgICAgICAgICAgICAgICAgIHZhbGlkUm9vbSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGlySWR4ID0gZGlyZWN0aW9ucy5wb3AoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdJID0gaSArIERJUlNbOF1bZGlySWR4XVswXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdKID0gaiArIERJUlNbOF1bZGlySWR4XVsxXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXdJIDwgMCB8fCBuZXdJID49IGN3IHx8IG5ld0ogPCAwIHx8IG5ld0ogPj0gY2gpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIG90aGVyUm9vbSA9IHRoaXMucm9vbXNbbmV3SV1bbmV3Sl07XG4gICAgICAgICAgICAgICAgICAgICAgICB2YWxpZFJvb20gPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG90aGVyUm9vbVtcImNvbm5lY3Rpb25zXCJdLmxlbmd0aCA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBrID0gMDsgayA8IG90aGVyUm9vbVtcImNvbm5lY3Rpb25zXCJdLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG90aGVyUm9vbVtcImNvbm5lY3Rpb25zXCJdW2tdWzBdID09IGkgJiYgb3RoZXJSb29tW1wiY29ubmVjdGlvbnNcIl1ba11bMV0gPT0gaikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWxpZFJvb20gPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZhbGlkUm9vbSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IHdoaWxlIChkaXJlY3Rpb25zLmxlbmd0aCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh2YWxpZFJvb20pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJvb21bXCJjb25uZWN0aW9uc1wiXS5wdXNoKFtvdGhlclJvb21bXCJjZWxseFwiXSwgb3RoZXJSb29tW1wiY2VsbHlcIl1dKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKFwiLS0gVW5hYmxlIHRvIGNvbm5lY3Qgcm9vbS5cIik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgX2NyZWF0ZVJhbmRvbVJvb21Db25uZWN0aW9ucygpIHtcbiAgICAgICAgLy8gRW1wdHkgZm9yIG5vdy5cbiAgICB9XG4gICAgX2NyZWF0ZVJvb21zKCkge1xuICAgICAgICBsZXQgdyA9IHRoaXMuX3dpZHRoO1xuICAgICAgICBsZXQgaCA9IHRoaXMuX2hlaWdodDtcbiAgICAgICAgbGV0IGN3ID0gdGhpcy5fb3B0aW9ucy5jZWxsV2lkdGg7XG4gICAgICAgIGxldCBjaCA9IHRoaXMuX29wdGlvbnMuY2VsbEhlaWdodDtcbiAgICAgICAgbGV0IGN3cCA9IE1hdGguZmxvb3IodGhpcy5fd2lkdGggLyBjdyk7XG4gICAgICAgIGxldCBjaHAgPSBNYXRoLmZsb29yKHRoaXMuX2hlaWdodCAvIGNoKTtcbiAgICAgICAgbGV0IHJvb213O1xuICAgICAgICBsZXQgcm9vbWg7XG4gICAgICAgIGxldCByb29tV2lkdGggPSB0aGlzLl9vcHRpb25zW1wicm9vbVdpZHRoXCJdO1xuICAgICAgICBsZXQgcm9vbUhlaWdodCA9IHRoaXMuX29wdGlvbnNbXCJyb29tSGVpZ2h0XCJdO1xuICAgICAgICBsZXQgc3g7XG4gICAgICAgIGxldCBzeTtcbiAgICAgICAgbGV0IG90aGVyUm9vbTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdzsgaSsrKSB7XG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGNoOyBqKyspIHtcbiAgICAgICAgICAgICAgICBzeCA9IGN3cCAqIGk7XG4gICAgICAgICAgICAgICAgc3kgPSBjaHAgKiBqO1xuICAgICAgICAgICAgICAgIGlmIChzeCA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHN4ID0gMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHN5ID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgc3kgPSAxO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByb29tdyA9IFJORy5nZXRVbmlmb3JtSW50KHJvb21XaWR0aFswXSwgcm9vbVdpZHRoWzFdKTtcbiAgICAgICAgICAgICAgICByb29taCA9IFJORy5nZXRVbmlmb3JtSW50KHJvb21IZWlnaHRbMF0sIHJvb21IZWlnaHRbMV0pO1xuICAgICAgICAgICAgICAgIGlmIChqID4gMCkge1xuICAgICAgICAgICAgICAgICAgICBvdGhlclJvb20gPSB0aGlzLnJvb21zW2ldW2ogLSAxXTtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKHN5IC0gKG90aGVyUm9vbVtcInlcIl0gKyBvdGhlclJvb21bXCJoZWlnaHRcIl0pIDwgMykge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3krKztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaSA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgb3RoZXJSb29tID0gdGhpcy5yb29tc1tpIC0gMV1bal07XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlIChzeCAtIChvdGhlclJvb21bXCJ4XCJdICsgb3RoZXJSb29tW1wid2lkdGhcIl0pIDwgMykge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3grKztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBsZXQgc3hPZmZzZXQgPSBNYXRoLnJvdW5kKFJORy5nZXRVbmlmb3JtSW50KDAsIGN3cCAtIHJvb213KSAvIDIpO1xuICAgICAgICAgICAgICAgIGxldCBzeU9mZnNldCA9IE1hdGgucm91bmQoUk5HLmdldFVuaWZvcm1JbnQoMCwgY2hwIC0gcm9vbWgpIC8gMik7XG4gICAgICAgICAgICAgICAgd2hpbGUgKHN4ICsgc3hPZmZzZXQgKyByb29tdyA+PSB3KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzeE9mZnNldCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3hPZmZzZXQtLTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJvb213LS07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgd2hpbGUgKHN5ICsgc3lPZmZzZXQgKyByb29taCA+PSBoKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzeU9mZnNldCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3lPZmZzZXQtLTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJvb21oLS07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc3ggPSBzeCArIHN4T2Zmc2V0O1xuICAgICAgICAgICAgICAgIHN5ID0gc3kgKyBzeU9mZnNldDtcbiAgICAgICAgICAgICAgICB0aGlzLnJvb21zW2ldW2pdW1wieFwiXSA9IHN4O1xuICAgICAgICAgICAgICAgIHRoaXMucm9vbXNbaV1bal1bXCJ5XCJdID0gc3k7XG4gICAgICAgICAgICAgICAgdGhpcy5yb29tc1tpXVtqXVtcIndpZHRoXCJdID0gcm9vbXc7XG4gICAgICAgICAgICAgICAgdGhpcy5yb29tc1tpXVtqXVtcImhlaWdodFwiXSA9IHJvb21oO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGlpID0gc3g7IGlpIDwgc3ggKyByb29tdzsgaWkrKykge1xuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBqaiA9IHN5OyBqaiA8IHN5ICsgcm9vbWg7IGpqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMubWFwW2lpXVtqal0gPSAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIF9nZXRXYWxsUG9zaXRpb24oYVJvb20sIGFEaXJlY3Rpb24pIHtcbiAgICAgICAgbGV0IHJ4O1xuICAgICAgICBsZXQgcnk7XG4gICAgICAgIGxldCBkb29yO1xuICAgICAgICBpZiAoYURpcmVjdGlvbiA9PSAxIHx8IGFEaXJlY3Rpb24gPT0gMykge1xuICAgICAgICAgICAgcnggPSBSTkcuZ2V0VW5pZm9ybUludChhUm9vbVtcInhcIl0gKyAxLCBhUm9vbVtcInhcIl0gKyBhUm9vbVtcIndpZHRoXCJdIC0gMik7XG4gICAgICAgICAgICBpZiAoYURpcmVjdGlvbiA9PSAxKSB7XG4gICAgICAgICAgICAgICAgcnkgPSBhUm9vbVtcInlcIl0gLSAyO1xuICAgICAgICAgICAgICAgIGRvb3IgPSByeSArIDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICByeSA9IGFSb29tW1w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pciwgdGVtcERpc3RdKTtcbiAgICAgICAgICAgIC8vIG1vdmUgYWxsIHRoZSB4IG9mZnNldFxuICAgICAgICAgICAgbW92ZXMucHVzaChbeERpciwgeEFic10pO1xuICAgICAgICAgICAgLy8gbW92ZSBzZW5kSGFsZiBvZiB0aGUgIHkgb2Zmc2V0XG4gICAgICAgICAgICB0ZW1wRGlzdCA9IE1hdGguZmxvb3IoeUFicyAqIHNlY29uZEhhbGYpO1xuICAgICAgICAgICAgbW92ZXMucHVzaChbeURpciwgdGVtcERpc3RdKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIC8vICBtb3ZlIGZpcnN0SGFsZiBvZiB0aGUgeCBvZmZzZXRcbiAgICAgICAgICAgIHRlbXBEaXN0ID0gTWF0aC5jZWlsKHhBYnMgKiBmaXJzdEhhbGYpO1xuICAgICAgICAgICAgbW92ZXMucHVzaChbeERpciwgdGVtcERpc3RdKTtcbiAgICAgICAgICAgIC8vIG1vdmUgYWxsIHRoZSB5IG9mZnNldFxuICAgICAgICAgICAgbW92ZXMucHVzaChbeURpciwgeUFic10pO1xuICAgICAgICAgICAgLy8gbW92ZSBzZWNvbmRIYWxmIG9mIHRoZSB4IG9mZnNldC5cbiAgICAgICAgICAgIHRlbXBEaXN0ID0gTWF0aC5mbG9vcih4QWJzICogc2Vjb25kSGFsZik7XG4gICAgICAgICAgICBtb3Zlcy5wdXNoKFt4RGlyLCB0ZW1wRGlzdF0pO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMubWFwW3hwb3NdW3lwb3NdID0gMDtcbiAgICAgICAgd2hpbGUgKG1vdmVzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgIG1vdmUgPSBtb3Zlcy5wb3AoKTtcbiAgICAgICAgICAgIHdoaWxlIChtb3ZlWzFdID4gMCkge1xuICAgICAgICAgICAgICAgIHhwb3MgKz0gRElSU1s4XVttb3ZlWzBdXVswXTtcbiAgICAgICAgICAgICAgICB5cG9zICs9IERJUlNbOF1bbW92ZVswXV1bMV07XG4gICAgICAgICAgICAgICAgdGhpcy5tYXBbeHBvc11beXBvc10gPSAwO1xuICAgICAgICAgICAgICAgIG1vdmVbMV0gPSBtb3ZlWzFdIC0gMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICBfY3JlYXRlQ29ycmlkb3JzKCkge1xuICAgICAgICAvLyBEcmF3IENvcnJpZG9ycyBiZXR3ZWVuIGNvbm5lY3RlZCByb29tc1xuICAgICAgICBsZXQgY3cgPSB0aGlzLl9vcHRpb25zLmNlbGxXaWR0aDtcbiAgICAgICAgbGV0IGNoID0gdGhpcy5fb3B0aW9ucy5jZWxsSGVpZ2h0O1xuICAgICAgICBsZXQgcm9vbTtcbiAgICAgICAgbGV0IGNvbm5lY3Rpb247XG4gICAgICAgIGxldCBvdGhlclJvb207XG4gICAgICAgIGxldCB3YWxsO1xuICAgICAgICBsZXQgb3RoZXJXYWxsO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN3OyBpKyspIHtcbiAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgY2g7IGorKykge1xuICAgICAgICAgICAgICAgIHJvb20gPSB0aGlzLnJvb21zW2ldW2pdO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDwgcm9vbVtcImNvbm5lY3Rpb25zXCJdLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24gPSByb29tW1wiY29ubmVjdGlvbnNcIl1ba107XG4gICAgICAgICAgICAgICAgICAgIG90aGVyUm9vbSA9IHRoaXMucm9vbXNbY29ubmVjdGlvblswXV1bY29ubmVjdGlvblsxXV07XG4gICAgICAgICAgICAgICAgICAgIC8vIGZpZ3VyZSBvdXQgd2hhdCB3YWxsIG91ciBjb3JyaWRvciB3aWxsIHN0YXJ0IG9uZS5cbiAgICAgICAgICAgICAgICAgICAgLy8gZmlndXJlIG91dCB3aGF0IHdhbGwgb3VyIGNvcnJpZG9yIHdpbGwgZW5kIG9uLlxuICAgICAgICAgICAgICAgICAgICBpZiAob3RoZXJSb29tW1wiY2VsbHhcIl0gPiByb29tW1wiY2VsbHhcIl0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdhbGwgPSAyO1xuICAgICAgICAgICAgICAgICAgICAgICAgb3RoZXJXYWxsID0gNDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChvdGhlclJvb21bXCJjZWxseFwiXSA8IHJvb21bXCJjZWxseFwiXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgd2FsbCA9IDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBvdGhlcldhbGwgPSAyO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKG90aGVyUm9vbVtcImNlbGx5XCJdID4gcm9vbVtcImNlbGx5XCJdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3YWxsID0gMztcbiAgICAgICAgICAgICAgICAgICAgICAgIG90aGVyV2FsbCA9IDE7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3YWxsID0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG90aGVyV2FsbCA9IDM7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fZHJhd0NvcnJpZG9yKHRoaXMuX2dldFdhbGxQb3NpdGlvbihyb29tLCB3YWxsKSwgdGhpcy5fZ2V0V2FsbFBvc2l0aW9uKG90aGVyUm9vbSwgb3RoZXJXYWxsKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufVxuIiwiaW1wb3J0IER1bmdlb24gZnJvbSBcIi4vZHVuZ2Vvbi5qc1wiO1xua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ZpbGxNYXAoMSk7XG4gICAgICAgICAgICB0aGlzLl9kdWcgPSAwO1xuICAgICAgICAgICAgdGhpcy5fcm9vbXMgPSBbXTtcbiAgICAgICAgICAgIHRoaXMuX3VuY29ubmVjdGVkID0gW107XG4gICAgICAgICAgICB0aGlzLl9nZW5lcmF0ZVJvb21zKCk7XG4gICAgICAgICAgICBpZiAodGhpcy5fcm9vbXMubGVuZ3RoIDwgMikge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRoaXMuX2dlbmVyYXRlQ29ycmlkb3JzKCkpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoY2FsbGJhY2spIHtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy5fd2lkdGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgdGhpcy5faGVpZ2h0OyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2soaSwgaiwgdGhpcy5fbWFwW2ldW2pdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIEdlbmVyYXRlcyBhIHN1aXRhYmxlIGFtb3VudCBvZiByb29tc1xuICAgICAqL1xuICAgIF9nZW5lcmF0ZVJvb21zKCkge1xuICAgICAgICBsZXQgdyA9IHRoaXMuX3dpZHRoIC0gMjtcbiAgICAgICAgbGV0IGggPSB0aGlzLl9oZWlnaHQgLSAyO1xuICAgICAgICBsZXQgcm9vbTtcbiAgICAgICAgZG8ge1xuICAgICAgICAgICAgcm9vbSA9IHRoaXMuX2dlbmVyYXRlUm9vbSgpO1xuICAgICAgICAgICAgaWYgKHRoaXMuX2R1ZyAvICh3ICogaCkgPiB0aGlzLl9vcHRpb25zLnJvb21EdWdQZXJjZW50YWdlKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9IC8qIGFjaGlldmVkIHJlcXVlc3RlZCBhbW91bnQgb2YgZnJlZSBzcGFjZSAqL1xuICAgICAgICB9IHdoaWxlIChyb29tKTtcbiAgICAgICAgLyogZWl0aGVyIGVub3VnaCByb29tcywgb3Igbm90IGFibGUgdG8gZ2VuZXJhdGUgbW9yZSBvZiB0aGVtIDopICovXG4gICAgfVxuICAgIC8qKlxuICAgICAqIFRyeSB0byBnZW5lcmF0ZSBvbmUgcm9vbVxuICAgICAqL1xuICAgIF9nZW5lcmF0ZVJvb20oKSB7XG4gICAgICAgIGxldCBjb3VudCA9IDA7XG4gICAgICAgIHdoaWxlIChjb3VudCA8IHRoaXMuX3Jvb21BdHRlbXB0cykge1xuICAgICAgICAgICAgY291bnQrKztcbiAgICAgICAgICAgIGxldCByb29tID0gUm9vbS5jcmVhdGVSYW5kb20odGhpcy5fd2lkdGgsIHRoaXMuX2hlaWdodCwgdGhpcy5fb3B0aW9ucyk7XG4gICAgICAgICAgICBpZiAoIXJvb20uaXNWYWxpZCh0aGlzLl9pc1dhbGxDYWxsYmFjaywgdGhpcy5fY2FuQmVEdWdDYWxsYmFjaykpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJvb20uY3JlYXRlKHRoaXMuX2RpZ0NhbGxiYWNrKTtcbiAgICAgICAgICAgIHRoaXMuX3Jvb21zLnB1c2gocm9vbSk7XG4gICAgICAgICAgICByZXR1cm4gcm9vbTtcbiAgICAgICAgfVxuICAgICAgICAvKiBubyByb29tIHdhcyBnZW5lcmF0ZWQgaW4gYSBnaXZlbiBudW1iZXIgb2YgYXR0ZW1wdHMgKi9cbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIEdlbmVyYXRlcyBjb25uZWN0b3JzIGJld2VlbiByb29tc1xuICAgICAqIEByZXR1cm5zIHtib29sfSBzdWNjZXNzIFdhcyB0aGlzIGF0dGVtcHQgc3VjY2Vzc2Z1bGw/XG4gICAgICovXG4gICAgX2dlbmVyYXRlQ29ycmlkb3JzKCkge1xuICAgICAgICBsZXQgY250ID0gMDtcbiAgICAgICAgd2hpbGUgKGNudCA8IHRoaXMuX2NvcnJpZG9yQXR0ZW1wdHMpIHtcbiAgICAgICAgICAgIGNudCsrO1xuICAgICAgICAgICAgdGhpcy5fY29ycmlkb3JzID0gW107XG4gICAgICAgICAgICAvKiBkaWcgcm9vbXMgaW50byBhIGNsZWFyIG1hcCAqL1xuICAgICAgICAgICAgdGhpcy5fbWFwID0gdGhpcy5fZmlsbE1hcCgxKTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy5fcm9vbXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgcm9vbSA9IHRoaXMuX3Jvb21zW2ldO1xuICAgICAgICAgICAgICAgIHJvb20uY2xlYXJEb29ycygpO1xuICAgICAgICAgICAgICAgIHJvb20uY3JlYXRlKHRoaXMuX2RpZ0NhbGxiYWNrKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuX3VuY29ubmVjdGVkID0gUk5HLnNodWZmbGUodGhpcy5fcm9vbXMuc2xpY2UoKSk7XG4gICAgICAgICAgICB0aGlzLl9jb25uZWN0ZWQgPSBbXTtcbiAgICAgICAgICAgIGlmICh0aGlzLl91bmNvbm5lY3RlZC5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9jb25uZWN0ZWQucHVzaCh0aGlzLl91bmNvbm5lY3RlZC5wb3AoKSk7XG4gICAgICAgICAgICB9IC8qIGZpcnN0IG9uZSBpcyBhbHdheXMgY29ubmVjdGVkICovXG4gICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgIC8qIDEuIHBpY2sgcmFuZG9tIGNvbm5lY3RlZCByb29tICovXG4gICAgICAgICAgICAgICAgbGV0IGNvbm5lY3RlZCA9IFJORy5nZXRJdGVtKHRoaXMuX2Nvbm5lY3RlZCk7XG4gICAgICAgICAgICAgICAgaWYgKCFjb25uZWN0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8qIDIuIGZpbmQgY2xvc2VzdCB1bmNvbm5lY3RlZCAqL1xuICAgICAgICAgICAgICAgIGxldCByb29tMSA9IHRoaXMuX2Nsb3Nlc3RSb29tKHRoaXMuX3VuY29ubmVjdGVkLCBjb25uZWN0ZWQpO1xuICAgICAgICAgICAgICAgIGlmICghcm9vbTEpIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8qIDMuIGNvbm5lY3QgaXQgdG8gY2xvc2VzdCBjb25uZWN0ZWQgKi9cbiAgICAgICAgICAgICAgICBsZXQgcm9vbTIgPSB0aGlzLl9jbG9zZXN0Um9vbSh0aGlzLl9jb25uZWN0ZWQsIHJvb20xKTtcbiAgICAgICAgICAgICAgICBpZiAoIXJvb20yKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBsZXQgb2sgPSB0aGlzLl9jb25uZWN0Um9vbXMocm9vbTEsIHJvb20yKTtcbiAgICAgICAgICAgICAgICBpZiAoIW9rKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH0gLyogc3RvcCBjb25uZWN0aW5nLCByZS1zaHVmZmxlICovXG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLl91bmNvbm5lY3RlZC5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgfSAvKiBkb25lOyBubyByb29tcyByZW1haW4gKi9cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICAgIDtcbiAgICAvKipcbiAgICAgKiBGb3IgYSBnaXZlbiByb29tLCBmaW5kIHRoZSBjbG9zZXN0IG9uZSBmcm9tIHRoZSBsaXN0XG4gICAgICovXG4gICAgX2Nsb3Nlc3RSb29tKHJvb21zLCByb29tKSB7XG4gICAgICAgIGxldCBkaXN0ID0gSW5maW5pdHk7XG4gICAgICAgIGxldCBjZW50ZXIgPSByb29tLmdldENlbnRlcigpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gbnVsbDtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCByb29tcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IHIgPSByb29tc1tpXTtcbiAgICAgICAgICAgIGxldCBjID0gci5nZXRDZW50ZXIoKTtcbiAgICAgICAgICAgIGxldCBkeCA9IGNbMF0gLSBjZW50ZXJbMF07XG4gICAgICAgICAgICBsZXQgZHkgPSBjWzFdIC0gY2VudGVyWzFdO1xuICAgICAgICAgICAgbGV0IGQgPSBkeCAqIGR4ICsgZHkgKiBkeTtcbiAgICAgICAgICAgIGlmIChkIDwgZGlzdCkge1xuICAgICAgICAgICAgICAgIGRpc3QgPSBkO1xuICAgICAgICAgICAgICAgIHJlc3VsdCA9IHI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG4gICAgX2Nvbm5lY3RSb29tcyhyb29tMSwgcm9vbTIpIHtcbiAgICAgICAgLypcbiAgICAgICAgICAgIHJvb20xLmRlYnVnKCk7XG4gICAgICAgICAgICByb29tMi5kZWJ1ZygpO1xuICAgICAgICAqL1xuICAgICAgICBsZXQgY2VudGVyMSA9IHJvb20xLmdldENlbnRlcigpO1xuICAgICAgICBsZXQgY2VudGVyMiA9IHJvb20yLmdldENlbnRlcigpO1xuICAgICAgICBsZXQgZGlmZlggPSBjZW50ZXIyWzBdIC0gY2VudGVyMVswXTtcbiAgICAgICAgbGV0IGRpZmZZID0gY2VudGVyMlsxXSAtIGNlbnRlcjFbMV07XG4gICAgICAgIGxldCBzdGFydDtcbiAgICAgICAgbGV0IGVuZDtcbiAgICAgICAgbGV0IGRpckluZGV4MSwgZGlySW5kZXgyLCBtaW4sIG1heCwgaW5kZXg7XG4gICAgICAgIGlmIChNYXRoLmFicyhkaWZmWCkgPCBNYXRoLmFicyhkaWZmWSkpIHsgLyogZmlyc3QgdHJ5IGNvbm5lY3Rpbmcgbm9ydGgtc291dGggd2FsbHMgKi9cbiAgICAgICAgICAgIGRpckluZGV4MSA9IChkaWZmWSA+IDAgPyAyIDogMCk7XG4gICAgICAgICAgICBkaXJJbmRleDIgPSAoZGlySW5kZXgxICsgMikgJSA0O1xuICAgICAgICAgICAgbWluID0gcm9vbTIuZ2V0TGVmdCgpO1xuICAgICAgICAgICAgbWF4ID0gcm9vbTIuZ2V0UmlnaHQoKTtcbiAgICAgICAgICAgIGluZGV4ID0gMDtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHsgLyogZmlyc3QgdHJ5IGNvbm5lY3RpbmcgZWFzdC13ZXN0IHdhbGxzICovXG4gICAgICAgICAgICBkaXJJbmRleDEgPSAoZGlmZlggPiAwID8gMSA6IDMpO1xuICAgICAgICAgICAgZGlySW5kZXgyID0gKGRpckluZGV4MSArIDIpICUgNDtcbiAgICAgICAgICAgIG1pbiA9IHJvb20yLmdldFRvcCgpO1xuICAgICAgICAgICAgbWF4ID0gcm9vbTIuZ2V0Qm90dG9tKCk7XG4gICAgICAgICAgICBpbmRleCA9IDE7XG4gICAgICAgIH1cbiAgICAgICAgc3RhcnQgPSB0aGlzLl9wbGFjZUluV2FsbChyb29tMSwgZGlySW5kZXgxKTsgLyogY29ycmlkb3Igd2lsbCBzdGFydCBoZXJlICovXG4gICAgICAgIGlmICghc3RhcnQpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoc3RhcnRbaW5kZXhdID49IG1pbiAmJiBzdGFydFtpbmRleF0gPD0gbWF4KSB7IC8qIHBvc3NpYmxlIHRvIGNvbm5lY3Qgd2l0aCBzdHJhaWdodCBsaW5lIChJLWxpa2UpICovXG4gICAgICAgICAgICBlbmQgPSBzdGFydC5zbGljZSgpO1xuICAgICAgICAgICAgbGV0IHZhbHVlID0gMDtcbiAgICAgICAgICAgIHN3aXRjaCAoZGlySW5kZXgyKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHJvb20yLmdldFRvcCgpIC0gMTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHJvb20yLmdldFJpZ2h0KCkgKyAxO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gcm9vbTIuZ2V0Qm90dG9tKCkgKyAxO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gcm9vbTIuZ2V0TGVmdCgpIC0gMTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbmRbKGluZGV4ICsgMSkgJSAyXSA9IHZhbHVlO1xuICAgICAgICAgICAgdGhpcy5fZGlnTGluZShbc3RhcnQsIGVuZF0pO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHN0YXJ0W2luZGV4XSA8IG1pbiAtIDEgfHwgc3RhcnRbaW5kZXhdID4gbWF4ICsgMSkgeyAvKiBuZWVkIHRvIHN3aXRjaCB0YXJnZXQgd2FsbCAoTC1saWtlKSAqL1xuICAgICAgICAgICAgbGV0IGRpZmYgPSBzdGFydFtpbmRleF0gLSBjZW50ZXIyW2luZGV4XTtcbiAgICAgICAgICAgIGxldCByb3RhdGlvbiA9IDA7XG4gICAgICAgICAgICBzd2l0Y2ggKGRpckluZGV4Mikge1xuICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgIHJvdGF0aW9uID0gKGRpZmYgPCAwID8gMyA6IDEpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgICAgICByb3RhdGlvbiA9IChkaWZmIDwgMCA/IDEgOiAzKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkaXJJbmRleDIgPSAoZGlySW5kZXgyICsgcm90YXRpb24pICUgNDtcbiAgICAgICAgICAgIGVuZCA9IHRoaXMuX3BsYWNlSW5XYWxsKHJvb20yLCBkaXJJbmRleDIpO1xuICAgICAgICAgICAgaWYgKCFlbmQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgbWlkID0gWzAsIDBdO1xuICAgICAgICAgICAgbWlkW2luZGV4XSA9IHN0YXJ0W2luZGV4XTtcbiAgICAgICAgICAgIGxldCBpbmRleDIgPSAoaW5kZXggKyAxKSAlIDI7XG4gICAgICAgICAgICBtaWRbaW5kZXgyXSA9IGVuZFtpbmRleDJdO1xuICAgICAgICAgICAgdGhpcy5fZGlnTGluZShbc3RhcnQsIG1pZCwgZW5kXSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7IC8qIHVzZSBjdXJyZW50IHdhbGwgcGFpciwgYnV0IGFkanVzdCB0aGUgbGluZSBpbiB0aGUgbWlkZGxlIChTLWxpa2UpICovXG4gICAgICAgICAgICBsZXQgaW5kZXgyID0gKGluZGV4ICsgMSkgJSAyO1xuICAgICAgICAgICAgZW5kID0gdGhpcy5fcGxhY2VJbldhbGwocm9vbTIsIGRpckluZGV4Mik7XG4gICAgICAgICAgICBpZiAoIWVuZCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBtaWQgPSBNYXRoLnJvdW5kKChlbmRbaW5kZXgyXSArIHN0YXJ0W2luZGV4Ml0pIC8gMik7XG4gICAgICAgICAgICBsZXQgbWlkMSA9IFswLCAwXTtcbiAgICAgICAgICAgIGxldCBtaWQyID0gWzAsIDBdO1xuICAgICAgICAgICAgbWlkMVtpbmRleF0gPSBzdGFydFtpbmRleF07XG4gICAgICAgICAgICBtaWQxW2luZGV4Ml0gPSBtaWQ7XG4gICAgICAgICAgICBtaWQyW2luZGV4XSA9IGVuZFtpbmRleF07XG4gICAgICAgICAgICBtaWQyW2luZGV4Ml0gPSBtaWQ7XG4gICAgICAgICAgICB0aGlzLl9kaWdMaW5lKFtzdGFydCwgbWlkMSwgbWlkMiwgZW5kXSk7XG4gICAgICAgIH1cbiAgICAgICAgcm9vbTEuYWRkRG9vcihzdGFydFswXSwgc3RhcnRbMV0pO1xuICAgICAgICByb29tMi5hZGREb29yKGVuZFswXSwgZW5kWzFdKTtcbiAgICAgICAgaW5kZXggPSB0aGlzLl91bmNvbm5lY3RlZC5pbmRleE9mKHJvb20xKTtcbiAgICAgICAgaWYgKGluZGV4ICE9IC0xKSB7XG4gICAgICAgICAgICB0aGlzLl91bmNvbm5lY3RlZC5zcGxpY2UoaW5kZXgsIDEpO1xuICAgICAgICAgICAgdGhpcy5fY29ubmVjdGVkLnB1c2gocm9vbTEpO1xuICAgICAgICB9XG4gICAgICAgIGluZGV4ID0gdGhpcy5fdW5jb25uZWN0ZWQuaW5kZXhPZihyb29tMik7XG4gICAgICAgIGlmIChpbmRleCAhPSAtMSkge1xuICAgICAgICAgICAgdGhpcy5fdW5jb25uZWN0ZWQuc3BsaWNlKGluZGV4LCAxKTtcbiAgICAgICAgICAgIHRoaXMuX2Nvbm5lY3RlZC5wdXNoKHJvb20yKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9XG4gICAgX3BsYWNlSW5XYWxsKHJvb20sIGRpckluZGV4KSB7XG4gICAgICAgIGxldCBzdGFydCA9IFswLCAwXTtcbiAgICAgICAgbGV0IGRpciA9IFswLCAwXTtcbiAgICAgICAgbGV0IGxlbmd0aCA9IDA7XG4gICAgICAgIHN3aXRjaCAoZGlySW5kZXgpIHtcbiAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICBkaXIgPSBbMSwgMF07XG4gICAgICAgICAgICAgICAgc3RhcnQgPSBbcm9vbS5nZXRMZWZ0KCksIHJvb20uZ2V0VG9wKCkgLSAxXTtcbiAgICAgICAgICAgICAgICBsZW5ndGggPSByb29tLmdldFJpZ2h0KCkgLSByb29tLmdldExlZnQoKSArIDE7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgZGlyID0gWzAsIDFdO1xuICAgICAgICAgICAgICAgIHN0YXJ0ID0gW3Jvb20uZ2V0UmlnaHQoKSArIDEsIHJvb20uZ2V0VG9wKCldO1xuICAgICAgICAgICAgICAgIGxlbmd0aCA9IHJvb20uZ2V0Qm90dG9tKCkgLSByb29tLmdldFRvcCgpICsgMTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICBkaXIgPSBbMSwgMF07XG4gICAgICAgICAgICAgICAgc3RhcnQgPSBbcm9vbS5nZXRMZWZ0KCksIHJvb20uZ2V0Qm90dG9tKCkgKyAxXTtcbiAgICAgICAgICAgICAgICBsZW5ndGggPSByb29tLmdldFJpZ2h0KCkgLSByb29tLmdldExlZnQoKSArIDE7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgZGlyID0gWzAsIDFdO1xuICAgICAgICAgICAgICAgIHN0YXJ0ID0gW3Jvb20uZ2V0TGVmdCgpIC0gMSwgcm9vbS5nZXRUb3AoKV07XG4gICAgICAgICAgICAgICAgbGVuZ3RoID0gcm9vbS5nZXRCb3R0b20oKSAtIHJvb20uZ2V0VG9wKCkgKyAxO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIGxldCBhdmFpbCA9IFtdO1xuICAgICAgICBsZXQgbGFzdEJhZEluZGV4ID0gLTI7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCB4ID0gc3RhcnRbMF0gKyBpICogZGlyWzBdO1xuICAgICAgICAgICAgbGV0IHkgPSBzdGFydFsxXSArIGkgKiBkaXJbMV07XG4gICAgICAgICAgICBhdmFpbC5wdXNoKG51bGwpO1xuICAgICAgICAgICAgbGV0IGlzV2FsbCA9ICh0aGlzLl9tYXBbeF1beV0gPT0gMSk7XG4gICAgICAgICAgICBpZiAoaXNXYWxsKSB7XG4gICAgICAgICAgICAgICAgaWYgKGxhc3RCYWRJbmRleCAhPSBpIC0gMSkge1xuICAgICAgICAgICAgICAgICAgICBhdmFpbFtpXSA9IFt4LCB5XTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBsYXN0QmFkSW5kZXggPSBpO1xuICAgICAgICAgICAgICAgIGlmIChpKSB7XG4gICAgICAgICAgICAgICAgICAgIGF2YWlsW2kgLSAxXSA9IG51bGw7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZvciAobGV0IGkgPSBhdmFpbC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aW9ucyBieSBQZXRlciBFYXN0bWFuIChwZWFzdG1hbkBkcml6emxlLnN0YW5mb3JkLmVkdSkuXG4gKiBCZXR0ZXIgcmFuayBvcmRlcmluZyBtZXRob2QgYnkgU3RlZmFuIEd1c3RhdnNvbiBpbiAyMDEyLlxuICovXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBTaW1wbGV4IGV4dGVuZHMgTm9pc2Uge1xuICAgIC8qKlxuICAgICAqIEBwYXJhbSBncmFkaWVudHMgUmFuZG9tIGdyYWRpZW50c1xuICAgICAqL1xuICAgIGNvbnN0cnVjdG9yKGdyYWRpZW50cyA9IDI1Nikge1xuICAgICAgICBzdXBlcigpO1xuICAgICAgICB0aGlzLl9ncmFkaWVudHMgPSBbXG4gICAgICAgICAgICBbMCwgLTFdLFxuICAgICAgICAgICAgWzEsIC0xXSxcbiAgICAgICAgICAgIFsxLCAwXSxcbiAgICAgICAgICAgIFsxLCAxXSxcbiAgICAgICAgICAgIFswLCAxXSxcbiAgICAgICAgICAgIFstMSwgMV0sXG4gICAgICAgICAgICBbLTEsIDBdLFxuICAgICAgICAgICAgWy0xLCAtMV1cbiAgICAgICAgXTtcbiAgICAgICAgbGV0IHBlcm11dGF0aW9ucyA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGdyYWRpZW50czsgaSsrKSB7XG4gICAgICAgICAgICBwZXJtdXRhdGlvbnMucHVzaChpKTtcbiAgICAgICAgfVxuICAgICAgICBwZXJtdXRhdGlvbnMgPSBSTkcuc2h1ZmZsZShwZXJtdXRhdGlvbnMpO1xuICAgICAgICB0aGlzLl9wZXJtcyA9IFtdO1xuICAgICAgICB0aGlzLl9pbmRleGVzID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMiAqIGdyYWRpZW50czsgaSsrKSB7XG4gICAgICAgICAgICB0aGlzLl9wZXJtcy5wdXNoKHBlcm11dGF0aW9uc1tpICUgZ3JhZGllbnRzXSk7XG4gICAgICAgICA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yBvZiB0aGUgdGhyZWUgc2ltcGxleCBjb3JuZXJzXG4gICAgICAgIGxldCBpaSA9IG1vZChpLCBjb3VudCk7XG4gICAgICAgIGxldCBqaiA9IG1vZChqLCBjb3VudCk7XG4gICAgICAgIC8vIENhbGN1bGF0ZSB0aGUgY29udHJpYnV0aW9uIGZyb20gdGhlIHRocmVlIGNvcm5lcnNcbiAgICAgICAgbGV0IHQwID0gMC41IC0geDAgKiB4MCAtIHkwICogeTA7XG4gICAgICAgIGlmICh0MCA+PSAwKSB7XG4gICAgICAgICAgICB0MCAqPSB0MDtcbiAgICAgICAgICAgIGdpID0gaW5kZXhlc1tpaSArIHBlcm1zW2pqXV07XG4gICAgICAgICAgICBsZXQgZ3JhZCA9IHRoaXMuX2dyYWRpZW50c1tnaV07XG4gICAgICAgICAgICBuMCA9IHQwICogdDAgKiAoZ3JhZFswXSAqIHgwICsgZ3JhZFsxXSAqIHkwKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgdDEgPSAwLjUgLSB4MSAqIHgxIC0geTEgKiB5MTtcbiAgICAgICAgaWYgKHQxID49IDApIHtcbiAgICAgICAgICAgIHQxICo9IHQxO1xuICAgICAgICAgICAgZ2kgPSBpbmRleGVzW2lpICsgaTEgKyBwZXJtc1tqaiArIGoxXV07XG4gICAgICAgICAgICBsZXQgZ3JhZCA9IHRoaXMuX2dyYWRpZW50c1tnaV07XG4gICAgICAgICAgICBuMSA9IHQxICogdDEgKiAoZ3JhZFswXSAqIHgxICsgZ3JhZFsxXSAqIHkxKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgdDIgPSAwLjUgLSB4MiAqIHgyIC0geTIgKiB5MjtcbiAgICAgICAgaWYgKHQyID49IDApIHtcbiAgICAgICAgICAgIHQyICo9IHQyO1xuICAgICAgICAgICAgZ2kgPSBpbmRleGVzW2lpICsgMSArIHBlcm1zW2pqICsgMV1dO1xuICAgICAgICAgICAgbGV0IGdyYWQgPSB0aGlzLl9ncmFkaWVudHNbZ2ld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lzLl9mcm9tWCA9IGZyb21YO1xuICAgICAgICB0aGlzLl9mcm9tWSA9IGZyb21ZO1xuICAgICAgICB0aGlzLl9hZGQodGhpcy5fdG9YLCB0aGlzLl90b1ksIG51bGwpO1xuICAgICAgICB3aGlsZSAodGhpcy5fdG9kby5sZW5ndGgpIHtcbiAgICAgICAgICAgIGxldCBpdGVtID0gdGhpcy5fdG9kby5zaGlmdCgpO1xuICAgICAgICAgICAgbGV0IGlkID0gaXRlbS54ICsgXCIsXCIgKyBpdGVtLnk7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5fZG9uZSkge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy5fZG9uZVtpZF0gPSBpdGVtO1xuICAgICAgICAgICAgaWYgKGl0ZW0ueCA9PSBmcm9tWCAmJiBpdGVtLnkgPT0gZnJvbVkpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBuZWlnaGJvcnMgPSB0aGlzLl9nZXROZWlnaGJvcnMoaXRlbS54LCBpdGVtLnkpO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBuZWlnaGJvcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgbmVpZ2hib3IgPSBuZWlnaGJvcnNbaV07XG4gICAgICAgICAgICAgICAgbGV0IHggPSBuZWlnaGJvclswXTtcbiAgICAgICAgICAgICAgICBsZXQgeSA9IG5laWdoYm9yWzFdO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IHggKyBcIixcIiArIHk7XG4gICAgICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMuX2RvbmUpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMuX2FkZCh4LCB5LCBpdGVtKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgaXRlbSA9IHRoaXMuX2RvbmVbZnJvbVggKyBcIixcIiArIGZyb21ZXTtcbiAgICAgICAgaWYgKCFpdGVtKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgd2hpbGUgKGl0ZW0pIHtcbiAgICAgICAgICAgIGNhbGxiYWNrKGl0ZW0ueCwgaXRlbS55KTtcbiAgICAgICAgICAgIGl0ZW0gPSBpdGVtLnByZXY7XG4gICAgICAgIH1cbiAgICB9XG4gICAgX2FkZCh4LCB5LCBwcmV2KSB7XG4gICAgICAgIGxldCBoID0gdGhpcy5fZGlzdGFuY2UoeCwgeSk7XG4gICAgICAgIGxldCBvYmogPSB7XG4gICAgICAgICAgICB4OiB4LFxuICAgICAgICAgICAgeTogeSxcbiAgICAgICAgICAgIHByZXY6IHByZXYsXG4gICAgICAgICAgICBnOiAocHJldiA/IHByZXYuZyArIDEgOiAwKSxcbiAgICAgICAgICAgIGg6IGhcbiAgICAgICAgfTtcbiAgICAgICAgLyogaW5zZXJ0IGludG8gcHJpb3JpdHkgcXVldWUgKi9cbiAgICAgICAgbGV0IGYgPSBvYmouZyArIG9iai5oO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRoaXMuX3RvZG8ubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpdGVtID0gdGhpcy5fdG9kb1tpXTtcbiAgICAgICAgICAgIGxldCBpdGVtRiA9IGl0ZW0uZyArIGl0ZW0uaDtcbiAgICAgICAgICAgIGlmIChmIDwgaXRlbUYgfHwgKGYgPT0gaXRlbUYgJiYgaCA8IGl0ZW0uaCkpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl90b2RvLnNwbGljZShpLCAwLCBvYmopO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aGlzLl90b2RvLnB1c2gob2JqKTtcbiAgICB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ZKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG5laWdoYm9ycyA9IHRoaXMuX2dldE5laWdoYm9ycyhpdGVtLngsIGl0ZW0ueSk7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG5laWdoYm9ycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBuZWlnaGJvciA9IG5laWdoYm9yc1tpXTtcbiAgICAgICAgICAgICAgICBsZXQgeCA9IG5laWdoYm9yWzBdO1xuICAgICAgICAgICAgICAgIGxldCB5ID0gbmVpZ2hib3JbMV07XG4gICAgICAgICAgICAgICAgbGV0IGlkID0geCArIFwiLFwiICsgeTtcbiAgICAgICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5fY29tcHV0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfSAvKiBhbHJlYWR5IGRvbmUgKi9cbiAgICAgICAgICAgICAgICB0aGlzLl9hZGQoeCwgeSwgaXRlbSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgX2FkZCh4LCB5LCBwcmV2KSB7XG4gICAgICAgIGxldCBvYmogPSB7XG4gICAgICAgICAgICB4OiB4LFxuICAgICAgICAgICAgeTogeSxcbiAgICAgICAgICAgIHByZXY6IHByZXZcbiAgICAgICAgfTtcbiAgICAgICAgdGhpcy5fY29tcHV0ZWRbeCArIFwiLFwiICsgeV0gPSBvYmo7XG4gICAgICAgIHRoaXMuX3RvZG8ucHVzaChvYmopO1xuICAgIH1cbn1cbiIsImltcG9ydCBEaWprc3RyYSBmcm9tIFwiLi9kaWprc3RyYS5qc1wiO1xuaW1wb3J0IEFTdGFyIGZyb20gXCIuL2FzdGFyLmpzXCI7XG5leHBvcnQgZGVmYXVsdCB7IERpamtzdHJhLCBBU3RhciB9O1xuIiwiaW1wb3J0IHsgRElSUyB9IGZyb20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AgICAgICAgICAgICB0aGlzLl9kaXJzWzRdLFxuICAgICAgICAgICAgICAgIHRoaXMuX2RpcnNbNl0sXG4gICAgICAgICAgICAgICAgdGhpcy5fZGlyc1sxXSxcbiAgICAgICAgICAgICAgICB0aGlzLl9kaXJzWzNdLFxuICAgICAgICAgICAgICAgIHRoaXMuX2RpcnNbNV0sXG4gICAgICAgICAgICAgICAgdGhpcy5fZGlyc1s3XVxuICAgICAgICAgICAgXTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBfZ2V0TmVpZ2hib3JzKGN4LCBjeSkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy5fZGlycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGRpciA9IHRoaXMuX2RpcnNbaV07XG4gICAgICAgICAgICBsZXQgeCA9IGN4ICsgZGlyWzBdO1xuICAgICAgICAgICAgbGV0IHkgPSBjeSArIGRpclsxXTtcbiAgICAgICAgICAgIGlmICghdGhpcy5fcGFzc2FibGVDYWxsYmFjayh4LCB5KSkge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0LnB1c2goW3gsIHldKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cbn1cbiIsIi8qKlxuICogVGhpcyBjb2RlIGlzIGFuIGltcGxlbWVudGF0aW9uIG9mIEFsZWEgYWxnb3JpdGhtOyAoQykgMjAxMCBKb2hhbm5lcyBCYWFnw7hlLlxuICogQWxlYSBpcyBsaWNlbnNlZCBhY2NvcmRpbmcgdG8gdGhlIGh0dHA6Ly9lbi53aWtpcGVkaWEub3JnL3dpa2kvTUlUX0xpY2Vuc2UuXG4gKi9cbmNvbnN0IEZSQUMgPSAyLjMyODMwNjQzNjUzODY5NjNlLTEwOyAvKiAyXi0zMiAqL1xuY2xhc3MgUk5HIHtcbi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BsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBjbG9uZSA9IGFycmF5LnNsaWNlKCk7XG4gICAgICAgIHdoaWxlIChjbG9uZS5sZW5ndGgpIHtcbiAgICAgICAgICAgIGxldCBpbmRleCA9IGNsb25lLmluZGV4T2YodGhpcy5nZXRJdGVtKGNsb25lKSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaChjbG9uZS5zcGxpY2UoaW5kZXgsIDEpWzBdKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBAcGFyYW0gZGF0YSBrZXk9d2hhdGV2ZXIsIHZhbHVlPXdlaWdodCAocmVsYXRpdmUgcHJvYmFiaWxpdHkpXG4gICAgICogQHJldHVybnMgd2hhdGV2ZXJcbiAgICAgKi9cbiAgICBnZXRXZWlnaHRlZFZhbHVlKGRhdGEpIHtcbiAgICAgICAgbGV0IHRvdGFsID0gMDtcbiAgICAgICAgZm9yIChsZXQgaWQgaW4gZGF0YSkge1xuICAgICAgICAgICAgdG90YWwgKz0gZGF0YVtpZF07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJhbmRvbSA9IHRoaXMuZ2V0VW5pZm9ybSgpICogdG90YWw7XG4gICAgICAgIGxldCBpZCwgcGFydCA9IDA7XG4gICAgICAgIGZvciAoaWQgaW4gZGF0YSkge1xuICAgICAgICAgICAgcGFydCArPSBkYXRhW2lkXTtcbiAgICAgICAgICAgIGlmIChyYW5kb20gPCBwYXJ0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIElmIGJ5IHNvbWUgZmxvYXRpbmctcG9pbnQgYW5ub3lhbmNlIHdlIGhhdmVcbiAgICAgICAgLy8gcmFuZG9tID49IHRvdGFsLCBqdXN0IHJldHVybiB0aGUgbGFzdCBpZC5cbiAgICAgICAgcmV0dXJuIGlkO1xuICAgIH1cb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xuICAgICAgICB9XG4gICAgICAgIHBhcnRzLnB1c2goXCJkaWN0aW9uYXJ5IHNpemUgKGNvbnRleHRzKTogXCIgKyBkYXRhQ291bnQpO1xuICAgICAgICBwYXJ0cy5wdXNoKFwiZGljdGlvbmFyeSBzaXplIChldmVudHMpOiBcIiArIGV2ZW50Q291bnQpO1xuICAgICAgICByZXR1cm4gcGFydHMuam9pbihcIiwgXCIpO1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBAcGFyYW0ge3N0cmluZ31cbiAgICAgKiBAcmV0dXJucyB7c3RyaW5nW119XG4gICAgICovXG4gICAgX3NwbGl0KHN0cikge1xuICAgICAgICByZXR1cm4gc3RyLnNwbGl0KHRoaXMuX29wdGlvbnMud29yZHMgPyAvXFxzKy8gOiBcIlwiKTtcbiAgICB9XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHtzdHJpbmdbXX1cbiAgICAgKiBAcmV0dXJucyB7c3RyaW5nfVxuICAgICAqL1xuICAgIF9qb2luKGFycikge1xuICAgICAgICByZXR1cm4gYXJyLmpvaW4odGhpcy5fb3B0aW9ucy53b3JkcyA/IFwiIFwiIDogXCJcIik7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7c3RyaW5nW119IGNvbnRleHRcbiAgICAgKiBAcGFyYW0ge3N0cmluZ30gZXZlbnRcbiAgICAgKi9cbiAgICBfb2JzZXJ2ZUV2ZW50KGNvbnRleHQsIGV2ZW50KSB7XG4gICAgICAgIGxldCBrZXkgPSB0aGlzLl9qb2luKGNvbnRleHQpO1xuICAgICAgICBpZiAoIShrZXkgaW4gdGhpcy5fZGF0YSkpIHtcbiAgICAgICAgICAgIHRoaXMuX2RhdGFba2V5XSA9IHt9O1xuICAgICAgICB9XG4gICAgICAgIGxldCBkYXRhID0gdGhpcy5fZGF0YVtrZXldO1xuICAgICAgICBpZiAoIShldmVudCBpbiBkYXRhKSkge1xuICAgICAgICAgICAgZGF0YVtldmVudF0gPSAwO1xuICAgICAgICB9XG4gICAgICAgIGRhdGFbZXZlbnRdKys7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7c3RyaW5nW119XG4gICAgICogQHJldHVybnMge3N0cmluZ31cbiAgICAgKi9cbiAgICBfc2FtcGxlKGNvbnRleHQpIHtcbiAgICAgICAgY29udGV4dCA9IHRoaXMuX2JhY2tvZmYoY29udGV4dCk7XG4gICAgICAgIGxldCBrZXkgPSB0aGlzLl9qb2luKGNvbnRleHQpO1xuICAgICAgICBsZXQgZGF0YSA9IHRoaXMuX2RhdGFba2V5XTtcbiAgICAgICAgbGV0IGF2YWlsYWJsZSA9IHt9O1xuICAgICAgICBpZiAodGhpcy5fb3B0aW9ucy5wcmlvcikge1xuICAgICAgICAgICAgZm9yIChsZXQgZXZlbnQgaW4gdGhpcy5fcHJpb3JWYWx1ZXMpIHtcbiAgICAgICAgICAgICAgICBhdmFpbGFibGVbZXZlbnRdID0gdGhpcy5fcHJpb3JWYWx1ZXNbZXZlbnRdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZm9yIChsZXQgZXZlbnQgaW4gZGF0YSkge1xuICAgICAgICAgICAgICAgIGF2YWlsYWJsZVtldmVudF0gKz0gZGF0YVtldmVudF07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBhdmFpbGFibGUgPSBkYXRhO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBSTkcuZ2V0V2VpZ2h0ZWRWYWx1ZShhdmFpbGFibGUpO1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBAcGFyYW0ge3N0cmluZ1tdfVxuICAgICAqIEByZXR1cm5zIHtzdHJpbmdbXX1cbiAgICAgKi9cbiAgICBfYmFja29mZihjb250ZXh0KSB7XG4gICAgICAgIGlmIChjb250ZXh0Lmxlbmd0aCA+IHRoaXMuX29wdGlvbnMub3JkZXIpIHtcbiAgICAgICAgICAgIGNvbnRleHQgPSBjb250ZXh0LnN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W5lTGVuZ3RoID0gMDtcbiAgICBsZXQgbGFzdFRva2VuV2l0aFNwYWNlID0gLTE7XG4gICAgd2hpbGUgKGkgPCB0b2tlbnMubGVuZ3RoKSB7IC8qIHRha2UgYWxsIHRleHQgdG9rZW5zLCByZW1vdmUgc3BhY2UsIGFwcGx5IGxpbmVicmVha3MgKi9cbiAgICAgICAgbGV0IHRva2VuID0gdG9rZW5zW2ldO1xuICAgICAgICBpZiAodG9rZW4udHlwZSA9PSBUWVBFX05FV0xJTkUpIHsgLyogcmVzZXQgKi9cbiAgICAgICAgICAgIGxpbmVMZW5ndGggPSAwO1xuICAgICAgICAgICAgbGFzdFRva2VuV2l0aFNwYWNlID0gLTE7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRva2VuLnR5cGUgIT0gVFlQRV9URVhUKSB7IC8qIHNraXAgbm9uLXRleHQgdG9rZW5zICovXG4gICAgICAgICAgICBpKys7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuICAgICAgICAvKiByZW1vdmUgc3BhY2VzIGF0IHRoZSBiZWdpbm5pbmcgb2YgbGluZSAqL1xuICAgICAgICB3aGlsZSAobGluZUxlbmd0aCA9PSAwICYmIHRva2VuLnZhbHVlLmNoYXJBdCgwKSA9PSBcIiBcIikge1xuICAgICAgICAgICAgdG9rZW4udmFsdWUgPSB0b2tlbi52YWx1ZS5zdWJzdHJpbmcoMSk7XG4gICAgICAgIH1cbiAgICAgICAgLyogZm9yY2VkIG5ld2xpbmU/IGluc2VydCB0d28gbmV3IHRva2VucyBhZnRlciB0aGlzIG9uZSAqL1xuICAgICAgICBsZXQgaW5kZXggPSB0b2tlbi52YWx1ZS5pbmRleE9mKFwiXFxuXCIpO1xuICAgICAgICBpZiAoaW5kZXggIT0gLTEpIHtcbiAgICAgICAgICAgIHRva2VuLnZhbHVlID0gYnJlYWtJbnNpZGVUb2tlbih0b2tlbnMsIGksIGluZGV4LCB0cnVlKTtcbiAgICAgICAgICAgIC8qIGlmIHRoZXJlIGFyZSBzcGFjZXMgYXQgdGhlIGVuZCwgd2UgbXVzdCByZW1vdmUgdGhlbSAod2UgZG8gbm90IHdhbnQgdGhlIGxpbmUgdG9vIGxvbmcpICovXG4gICAgICAgICAgICBsZXQgYXJyID0gdG9rZW4udmFsdWUuc3BsaXQoXCJcIik7XG4gICAgICAgICAgICB3aGlsZSAoYXJyLmxlbmd0aCAmJiBhcnJbYXJyLmxlbmd0aCAtIDFdID09IFwiIFwiKSB7XG4gICAgICAgICAgICAgICAgYXJyLnBvcCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdG9rZW4udmFsdWUgPSBhcnIuam9pbihcIlwiKTtcbiAgICAgICAgfVxuICAgICAgICAvKiB0b2tlbiBkZWdlbmVyYXRlZD8gKi9cbiAgICAgICAgaWYgKCF0b2tlbi52YWx1ZS5sZW5ndGgpIHtcbiAgICAgICAgICAgIHRva2Vucy5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobGluZUxlbmd0aCArIHRva2VuLnZhbHVlLmxlbmd0aCA+IG1heFdpZHRoKSB7IC8qIGxpbmUgdG9vIGxvbmcsIGZpbmQgYSBzdWl0YWJsZSBicmVha2luZyBzcG90ICovXG4gICAgICAgICAgICAvKiBpcyBpdCBwb3NzaWJsZSB0byBicmVhayB3aXRoaW4gdGhpcyB0b2tlbj8gKi9cbiAgICAgICAgICAgIGxldCBpbmRleCA9IC0xO1xuICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICBsZXQgbmV4dEluZGV4ID0gdG9rZW4udmFsdWUuaW5kZXhPZihcIiBcIiwgaW5kZXggKyAxKTtcbiAgICAgICAgICAgICAgICBpZiAobmV4dEluZGV4ID09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAobGluZUxlbmd0aCArIG5leHRJbmRleCA+IG1heFdpZHRoKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpbmRleCA9IG5leHRJbmRleDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpbmRleCAhPSAtMSkgeyAvKiBicmVhayBhdCBzcGFjZSB3aXRoaW4gdGhpcyBvbmUgKi9cbiAgICAgICAgICAgICAgICB0b2tlbi52YWx1ZSA9IGJyZWFrSW5zaWRlVG9rZW4odG9rZW5zLCBpLCBpbmRleCwgdHJ1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChsYXN0VG9rZW5XaXRoU3BhY2UgIT0gLTEpIHsgLyogaXMgdGhlcmUgYSBwcmV2aW91cyB0b2tlbiB3aGVyZSBhIGJyZWFrIGNhbiBvY2N1cj8gKi9cbiAgICAgICAgICAgICAgICBsZXQgdG9rZW4gPSB0b2tlbnNbbGFzdFRva2VuV2l0aFNwYWNlXTtcbiAgICAgICAgICAgICAgICBsZXQgYnJlYWtJbmRleCA9IHRva2VuLnZhbHVlLmxhc3RJbmRleE9mKFwiIFwiKTtcbiAgICAgICAgICAgICAgICB0b2tlbi52YWx1ZSA9IGJyZWFrSW5zaWRlVG9rZW4odG9rZW5zLCBsYXN0VG9rZW5XaXRoU3BhY2UsIGJyZWFrSW5kZXgsIHRydWUpO1xuICAgICAgICAgICAgICAgIGkgPSBsYXN0VG9rZW5XaXRoU3BhY2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHsgLyogZm9yY2UgYnJlYWsgaW4gdGhpcyB0b2tlbiAqL1xuICAgICAgICAgICAgICAgIHRva2VuLnZhbHVlID0gYnJlYWtJbnNpZGVUb2tlbih0b2tlbnMsIGksIG1heFdpZHRoIC0gbGluZUxlbmd0aCwgZmFsc2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2UgeyAvK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VGlsZS5UaWxlc2V0c1t0aWxlc2V0TWV0YS5pZF1bc2Vhc29uXVtcImJhc2VcIl0gPSB0aWxlO1xyXG4vLyAgIH1cclxuLy8gfVxyXG4iLCJpbXBvcnQgeyBCYXNlVGlsZUtleSB9IGZyb20gXCIuL3RpbGVcIjtcclxuZXhwb3J0IGNsYXNzIEF1dG90aWxlIHtcclxuICAgIHN0YXRpYyBpc0F1dG9UaWxlQm9yZGVyKHgsIHksIG1hcE9iamVjdCkge1xyXG4gICAgICAgIGNvbnN0IGtleSA9IGAke3h9LCR7eX1gO1xyXG4gICAgICAgIGNvbnN0IHRpbGVJbmRleCA9IG1hcE9iamVjdFtrZXldO1xyXG4gICAgICAgIGlmICh0aWxlSW5kZXggPT0gQmFzZVRpbGVLZXkpIHtcclxuICAgICAgICAgICAgY29uc29sZS5sb2coYHRpbGVJbmRleCBmb3IgJHtrZXl9IGlzICR7dGlsZUluZGV4fWApO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodGlsZUluZGV4ID09PSA0Nykge1xyXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgfVxyXG4gICAgc3RhdGljIGlzVGlsZUluZGV4QXV0b1RpbGVCb3JkZXIodGlsZUluZGV4KSB7XHJcbiAgICAgICAgaWYgKHRpbGVJbmRleCA9PT0gNDcpIHtcclxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgIH1cclxuICAgIHN0YXRpYyBzaG91bGRBdXRvVGlsZShtYXBPYmplY3QsIHgsIHksIHRpbGVCaW9tZSkge1xyXG4gICAgICAgIGNvbnN0IG5laWdoYm9yUG9zaXRpb25zID0gW1xyXG4gICAgICAgICAgICBbeCwgeSAtIDFdLFxyXG4gICAgICAgICAgICBbeCAtIDEsIHldLFxyXG4gICAgICAgICAgICBbeCArIDEsIHldLFxyXG4gICAgICAgICAgICBbeCwgeSArIDFdLFxyXG4gICAgICAgICAgICBbeCAtIDEsIHkgLSAxXSxcclxuICAgICAgICAgICAgW3ggKyAxLCB5IC0gMV0sXHJcbiAgICAgICAgICAgIFt4IC0gMSwgeSArIDFdLFxyXG4gICAgICAgICAgICBbeCArIDEsIHkgKyAxXSwgLy8gc291dGhlYXN0XHJcbiAgICAgICAgXTtcclxuICAgICAgICAvLyBsZXQgaXNNb2lzdERpcnQ7XHJcbiAgICAgICAgaWYgKHRpbGVCaW9tZSA9PSBudWxsKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgLy8gaWYgKHRpbGVCaW9tZS5pZCA9PT0gXCJtb2lzdGRpcnRcIikge1xyXG4gICAgICAgIC8vICAgaXNNb2lzdERpcnQgPSB0cnVlO1xyXG4gICAgICAgIC8vIH1cclxuICAgICAgICBmb3IgKGNvbnN0IFtueCwgbnldIG9mIG5laWdoYm9yUG9zaXRpb25zKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IG5laWdoYm9yQmlvbWUgPSBtYXBPYmplY3RbYCR7bnh9LCR7bnl9YF07XHJcbiAgICAgICAgICAgIGlmIChuZWlnaGJvckJpb21lID09IG51bGwpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvLyBpZiAoaXNNb2lzdERpcnQpIHtcclxuICAgICAgICAgICAgLy8gICBpZiAoXHJcbiAgICAgICAgICAgIC8vICAgICBuZWlnaGJvckJpb21lLmlkID09PSBcInNub3dtb2lzdGRpcnRcIiB8fFxyXG4gICAgICAgICAgICAvLyAgICAgbmVpZ2hib3JCaW9tZS5pZCA9PT0gXCJtb2lzdGRpcnRcIlxyXG4gICAgICAgICAgICAvLyAgICkge1xyXG4gICAgICAgICAgICAvLyAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgICAgIC8vICAgfVxyXG4gICAgICAgICAgICAvLyAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICAgICAgLy8gfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgIH1cclxuICAgIHN0YXRpYyBhdXRvdGlsZUxvb2t1cChtYXBPYmplY3QsIHhfYm91bmRhcnksIHlfYm91bmRhcnksIHgsIHksIHRpbGVCaW9tZSkge1xyXG4gICAgICAgIGxldCBzdW0gPSAwO1xyXG4gICAgICAgIGxldCBuID0gZmFsc2U7XHJcbiAgICAgICAgbGV0IGUgPSBmYWxzZTtcclxuICAgICAgICBsZXQgcyA9IGZhbHNlO1xyXG4gICAgICAgIGxldCB3ID0gZmFsc2U7XHJcbiAgICAgICAgbGV0IHNraXBCaW9tZXM7XHJcbiAgICAgICAgbGV0IG9ubHlCaW9tZXM7XHJcbiAgICAgICAgaWYgKHRpbGVCaW9tZS5za2lwQXV0b1RpbGVUeXBlcykge1xyXG4gICAgICAgICAgICBza2lwQmlvbWVzID0gW3RpbGVCaW9tZS5pZCwgLi4udGlsZUJpb21lLnNraXBBdXRvVGlsZVR5cGVzXTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIHNraXBCaW9tZXMgPSBbdGlsZUJpb21lLmlkXTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHRpbGVCaW9tZS5vbmx5QXV0b1RpbGVUeXBlcykge1xyXG4gICAgICAgICAgICBvbmx5QmlvbWVzID0gdGlsZUJpb21lLm9ubHlBdXRvVGlsZVR5cGVzO1xyXG4gICAgICAgICAgICBza2lwQmlvbWVzID0gdW5kZWZpbmVkOyAvLyBpZiBvbmx5QmlvbWVzIGlzIHNldCwgc2tpcEJpb21lcyBpcyBpZ25vcmVkXHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh5ID4gMCAmJlxyXG4gICAgICAgICAgICB0aGlzLmJldHRlclNob3VsZEF1dG90aWxlKG1hcE9iamVjdFtgJHt4fSwke3kgLSAxfWBdLmlkLCBvbmx5QmlvbWVzLCBza2lwQmlvbWVzKSkge1xyXG4gICAgICAgICAgICBuID0gdHJ1ZTtcclxuICAgICAgICAgICAgc3VtICs9IEF1dG90aWxlLk47XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh4ID4gMCAmJlxyXG4gICAgICAgICAgICB0aGlzLmJldHRlclNob3VsZEF1dG90aWxlKG1hcE9iamVjdFtgJHt4IC0gMX0sJHt5fWBdLmlkLCBvbmx5QmlvbWVzLCBza2lwQmlvbWVzKSkge1xyXG4gICAgICAgICAgICB3ID0gdHJ1ZTtcclxuICAgICAgICAgICAgc3VtICs9IEF1dG90aWxlLlc7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh4IDwgeF9ib3VuZGFyeSAmJlxyXG4gICAgICAgICAgICB0aGlzLmJldHRlclNob3VsZEF1dG90aWxlKG1hcE9iamVjdFtgJHt4ICsgMX0sJHt5fWBdLmlkLCBvbmx5QmlvbWVzLCBza2lwQmlvbWVzKSkge1xyXG4gICAgICAgICAgICBlID0gdHJ1ZTtcclxuICAgICAgICAgICAgc3VtICs9IEF1dG90aWxlLkU7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh5IDwgeV9ib3VuZGFyeSAmJlxyXG4gICAgICAgICAgICB0aGlzLmJldHRlclNob3VsZEF1dG90aWxlKG1hcE9iamVjdFtgJHt4fSwke3kgKyAxfWBdLmlkLCBvbmx5QmlvbWVzLCBza2lwQmlvbWVzKSkge1xyXG4gICAgICAgICAgICBzID0gdHJ1ZTtcclxuICAgICAgICAgICAgc3VtICs9IEF1dG90aWxlLlM7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChuICYmXHJcbiAgICAgICAgICAgIHcgJiZcclxuICAgICAgICAgICAgeSA+IDAgJiZcclxuICAgICAgICAgICAgeCA+IDAgJiZcclxuICAgICAgICAgICAgdGhpcy5iZXR0ZXJTaG91bGRBdXRvdGlsZShtYXBPYmplY3RbYCR7eCAtIDF9LCR7eSAtIDF9YF0uaWQsIG9ubHlCaW9tZXMsIHNraXBCaW9tZXMpKVxyXG4gICAgICAgICAgICBzdW0gKz0gQXV0b3RpbGUuTlc7XHJcbiAgICAgICAgaWYgKG4gJiZcclxuICAgICAgICAgICAgZSAmJlxyXG4gICAgICAgICAgICB5ID4gMCAmJlxyXG4gICAgICAgICAgICB4IDwgeF9ib3VuZGFyeSAmJlxyXG4gICAgICAgICAgICB0aGlzLmJldHRlclNob3VsZEF1dG90aWxlKG1hcE9iamVjdFtgJHt4ICsgMX0sJHt5IC0gMX1gXS5pZCwgb25seUJpb21lcywgc2tpcEJpb21lcykpXHJcbiAgICAgICAgICAgIHN1bSArPSBBdXRvdGlsZS5ORTtcclxuICAgICAgICBpZiAocyAmJlxyXG4gICAgICAgICAgICB3ICYmXHJcbiAgICAgICAgICAgIHkgPCB5X2JvdW5kYXJ5ICYmXHJcbiAgICAgICAgICAgIHggPiAwICYmXHJcbiAgICAgICAgICAgIHRoaXMuYmV0dGVyU2hvdWxkQXV0b3RpbGUobWFwT2JqZWN0W2Ake3ggLSAxfSwke3kgKyAxfWBdLmlkLCBvbmx5QmlvbWVzLCBza2lwQmlvbWVzKSlcclxuICAgICAgICAgICAgc3VtICs9IEF1dG90aWxlLlNXO1xyXG4gICAgICAgIGlmIChzICYmXHJcbiAgICAgICAgICAgIGUgJiZcclxuICAgICAgICAgICAgeCA8IHhfYm91bmRhcnkgJiZcclxuICAgICAgICAgICAgeSA8IHlfYm91bmRhcnkgJiZcclxuICAgICAgICAgICAgdGhpcy5iZXR0ZXJTaG91bGRBdXRvdGlsZShtYXBPYmplY3RbYCR7eCArIDF9LCR7eSArIDF9YF0uaWQsIG9ubHlCaW9tZXMsIHNraXBCaW9tZXMpKVxyXG4gICAgICAgICAgICBzdW0gKz0gQXV0b3RpbGUuU0U7XHJcbiAgICAgICAgcmV0dXJuIEF1dG90aWxlLkJJVE1BU0tbc3VtX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eyB9XHJcbiAgICBzdGF0aWMgaW5SYW5nZU9mKHZhbHVlLCByYW5nZSkge1xyXG4gICAgICAgIGlmICghcmFuZ2UpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICghdmFsdWUpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChyYW5nZS5taW4gJiYgdmFsdWUgPCByYW5nZS5taW4pIHtcclxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAocmFuZ2UubWF4ICYmIHZhbHVlID4gcmFuZ2UubWF4KSB7XHJcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICB9XHJcbiAgICBzdGF0aWMgaW5SYW5nZU9mQWxsKHgsIHksIG1hcHMsIGdlbmVyYXRpb25PcHRpb25zKSB7XHJcbiAgICAgICAgY29uc3QgcG9zID0gTWFwV29ybGQuY29vcmRzVG9LZXkoeCwgeSk7XHJcbiAgICAgICAgLy8gbG9vcCB0aHJvdWdoIHZhbHVlcyBpbiBHZW5lcmF0aW9uT3B0aW9uc1xyXG4gICAgICAgIGlmIChnZW5lcmF0aW9uT3B0aW9ucy5oZWlnaHQpIHtcclxuICAgICAgICAgICAgaWYgKCFCaW9tZXMuaW5SYW5nZU9mKG1hcHMuaGVpZ2h0W3Bvc10sIGdlbmVyYXRpb25PcHRpb25zLmhlaWdodCkpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoZ2VuZXJhdGlvbk9wdGlvbnMubW9pc3R1cmUpIHtcclxuICAgICAgICAgICAgaWYgKCFCaW9tZXMuaW5SYW5nZU9mKG1hcHMubW9pc3R1cmVbcG9zXSwgZ2VuZXJhdGlvbk9wdGlvbnMubW9pc3R1cmUpKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKGdlbmVyYXRpb25PcHRpb25zLnRlbXBlcmF0dXJlKSB7XHJcbiAgICAgICAgICAgIGlmICghQmlvbWVzLmluUmFuZ2VPZihtYXBzLnRlbXBlcmF0dXJlW3Bvc10sIGdlbmVyYXRpb25PcHRpb25zLnRlbXBlcmF0dXJlKSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgfVxyXG4gICAgc3RhdGljIHNoaWZ0VG9CaW9tZSh2YWx1ZSwgb3B0aW9uKSB7XHJcbiAgICAgICAgY29uc3QgdGhyZXNob2xkID0gMC4wMTtcclxuICAgICAgICAvLyBpZiBiZWxvdyB0aGUgbWluLCBzaGlmdCB0byB0aGUgbWluXHJcbiAgICAgICAgLy8gaWYgYWJvdmUgdGhlIG1heCwgc2hpZnQgdG8gdGhlIG1heFxyXG4gICAgICAgIGlmICgob3B0aW9uID09PSBudWxsIHx8IG9wdGlvbiA9PT0gdm9pZCAwID8gdm9pZCAwIDogb3B0aW9uLm1pbikgJiYgdmFsdWUgPCBvcHRpb24ubWluKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBvcHRpb24ubWluICsgdGhyZXNob2xkO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoKG9wdGlvbiA9PT0gbnVsbCB8fCBvcHRpb24gPT09IHZvaWQgMCA/IHZvaWQgMCA6IG9wdGlvbi5tYXgpICYmIHZhbHVlID4gb3B0aW9uLm1heCkge1xyXG4gICAgICAgICAgICByZXR1cm4gb3B0aW9uLm1heCAtIHRocmVzaG9sZDtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0d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AgICAgIGdlbmVyYXRpb25PcHRpb25zOiB7XHJcbiAgICAgICAgICAgIGhlaWdodDoge1xyXG4gICAgICAgICAgICAgICAgbWF4OiAwLjI1LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgIH0sXHJcbiAgICB9LFxyXG4gICAgYmVhY2g6IHtcclxuICAgICAgICBpZDogXCJiZWFjaFwiLFxyXG4gICAgICAgIG5hbWU6IFwiQmVhY2hcIixcclxuICAgICAgICBkZXNjcmlwdGlvbjogXCJXaGVyZSB0aGUgb2NlYW4gbWVldHMgdGhlIGxhbmQuXCIsXHJcbiAgICAgICAgYmFzZVRpbGU6IFwiYmlvbWVzL2JlYWNoL2JlYWNoX3NwcmluZ19zYW5keWRpcnRfNDdcIixcclxuICAgICAgICBhdXRvdGlsZVByZWZpeDogXCJiaW9tZXMvYmVhY2gvYmVhY2hfc3ByaW5nX3NhbmR5ZGlydF9cIixcclxuICAgICAgICBjb2xvcjogXCIjZThkMzZhXCIsXHJcbiAgICAgICAgZ2VuZXJhdGlvbk9wdGlvbnM6IHtcclxuICAgICAgICAgICAgaGVpZ2h0OiB7XHJcbiAgICAgICAgICAgICAgICBtaW46IDAuNSxcclxuICAgICAgICAgICAgICAgIG1heDogMC41MixcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICB9LFxyXG4gICAgfSxcclxuICAgIG1vaXN0ZGlydDoge1xyXG4gICAgICAgIC8vIGtleSB3aWxsIG1hdGNoIEJpb21lVHlwZVxyXG4gICAgICAgIGlkOiBcIm1vaXN0ZGlydFwiLFxyXG4gICAgICAgIG5hbWU6IFwiRGlydFwiLFxyXG4gICAgICAgIGRlc2NyaXB0aW9uOiBcIlRoaWNrIHNvaWwuXCIsXHJcbiAgICAgICAgYmFzZVRpbGU6IFwiYmlvbWVzL21vaXN0ZGlydC9tb2lzdGRpcnRfYmFzZVwiLFxyXG4gICAgICAgIGF1dG90aWxlUHJlZml4OiBcImJpb21lcy9zbm93L3Nub3dfc3ByaW5nX21vaXN0ZGlydF9cIixcclxuICAgICAgICBvbmx5QXV0b1RpbGVUeXBlczogW1wic25vd21vaXN0ZGlydFwiXSxcclxuICAgICAgICBjb2xvcjogXCIjNjY1YjQ3XCIsXHJcbiAgICAgICAgZ2VuZXJhdGlvbk9wdGlvbnM6IHtcclxuICAgICAgICAgICAgaGVpZ2h0OiB7XHJcbiAgICAgICAgICAgICAgICBtaW46IDAuNTIsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIG1vaXN0dXJlOiB7XHJcbiAgICAgICAgICAgICAgICBtaW46IDAuMzUsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgfSxcclxuICAgIH0sXHJcbiAgICBzYW5keWRpcnQ6IHtcclxuICAgICAgICBpZDogXCJzYW5keWRpcnRcIixcclxuICAgICAgICBuYW1lOiBcIlNhbmR5IERpcnRcIixcclxuICAgICAgICBkZXNjcmlwdGlvbjogXCJUaGUga2luZCB3aXRoIGxpdHRsZSByb2NrcyBhbmQgc2hhcnAgYml0cy5cIixcclxuICAgICAgICBiYXNlVGlsZTogXCJiaW9tZXMvc2FuZHlkaXJ0L3NhbmR5ZGlydF9zcHJpbmdfbW9pc3RkaXJ0XzAwXCIsXHJcbiAgICAgICAgYXV0b3RpbGVQcmVmaXg6IFwiYmlvbWVzL3NhbmR5ZGlydC9zYW5keWRpcnRfc3ByaW5nX21vaXN0ZGlydF9cIixcclxuICAgICAgICBza2lwQXV0b1RpbGVUeXBlczogW1wiYmVhY2hcIiwgXCJvY2VhblwiXSxcclxuICAgICAgICBjb2xvcjogXCIjZGRkMjliXCIsXHJcbiAgICAgICAgZ2VuZXJhdGlvbk9wdGlvbnM6IHtcclxuICAgICAgICAgICAgaGVpZ2h0OiB7XHJcbiAgICAgICAgICAgICAgICBtaW46IDAuNSxcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgbW9pc3R1cmU6IHtcclxuICAgICAgICAgICAgICAgIG1pbjogMCxcclxuICAgICAgICAgICAgICAgIG1heDogMSxcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICB9LFxyXG4gICAgfSxcclxuICAgIGhpbGxzbG93OiB7XHJcbiAgICAgICAgaWQ6IFwiaGlsbHNsb3dcIixcclxuICAgICAgICBuYW1lOiBcIkxvdyBIaWxsc1wiLFxyXG4gICAgICAgIGRlc2NyaXB0aW9uOiBcImxvdyBoaWxscy5cIixcclxuICAgICAgICBjb2xvcjogXCIjNmU2ODY0XCIsXHJcbiAgICAgICAgYmFzZVRpbGU6IFwiYmlvbWVzL2hpbGxzbG93L2hpbGxzbG93X3NwcmluZ19tb2lzdGRpcnRfNDdcIixcclxuICAgICAgICBhdXRvdGlsZVByZWZpeDogXCJiaW9tZXMvaGlsbHNsb3cvaGlsbHNsb3dfc3ByaW5nX21vaXN0ZGlydF9cIixcclxuICAgICAgICBza2lwQXV0b1RpbGVUeXBlczogW1wiaGlsbHNtaWRcIiwgXCJoaWxsc2hpZ2hcIl0sXHJcbiAgICAgICAgZ2VuZXJhdGlvbk9wdGlvbnM6IHtcclxuICAgICAgICAgICAgaGVpZ2h0OiB7XHJcbiAgICAgICAgICAgICAgICBtaW46IDAuNjQsXHJcbiAgICAgICAgICAgICAgICBtYXg6IDAuNyxcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICB9LFxyXG4gICAgfSxcclxuICAgIGhpbGxzbWlkOiB7XHJcbiAgICAgICAgaWQ6IFwiaGlsbHNtaWRcIixcclxuICAgICAgICBuYW1lOiBcIk1pZCBIaWxsc1wiLFxyXG4gICAgICAgIGRlc2NyaXB0aW9uOiBcIk1pZCBoaWxscy5cIixcclxuICAgICAgICBjb2xvcjogXCIjOTE4Mzc5XCIsXHJcbiAgICAgICAgYmFzZVRpbGU6IFwiYmlvbWVzL2hpbGxzbWlkL2hpbGxzbWlkX3NwcmluZ19tb2lzdGRpcnRfNDdcIixcclxuICAgICAgICBhdXRvdGlsZVByZWZpeDogXCJiaW9tZXMvaGlsbHNtaWQvaGlsbHNtaWRfc3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pc3RkaXJ0X1wiLFxyXG4gICAgICAgIGdlbmVyYXRpb25PcHRpb25zOiB7XHJcbiAgICAgICAgICAgIG1vaXN0dXJlOiB7XHJcbiAgICAgICAgICAgICAgICBtaW46IDAuNixcclxuICAgICAgICAgICAgICAgIG1heDogMC44LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB0ZW1wZXJhdHVyZToge1xyXG4gICAgICAgICAgICAgICAgbWluOiAwLjI4LFxyXG4gICAgICAgICAgICAgICAgbWF4OiAwLjYsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgfSxcclxuICAgIH0sXHJcbiAgICBoaWxsZ3Jhc3M6IHtcclxuICAgICAgICBpZDogXCJoaWxsZ3Jhc3NcIixcclxuICAgICAgICBuYW1lOiBcIlBhbGUgR3Jhc3NcIixcclxuICAgICAgICBkZXNjcmlwdGlvbjogXCJQcmlja2x5IGFuZCBwYWxlLCB0aGlzIGdyYXNzIHRocml2ZXMgYXQgaGlnaGVyIGVsZXZhdGlvbnMuXCIsXHJcbiAgICAgICAgY29sb3I6IFwiIzM5ODM1MFwiLFxyXG4gICAgICAgIGJhc2VUaWxlOiBcImJpb21lcy9mb3Jlc3RncmFzcy9mb3Jlc3RncmFzc19zcHJpbmdfbW9pc3RkaXJ0XzQ3XCIsXHJcbiAgICAgICAgYXV0b3RpbGVQcmVmaXg6IFwiYmlvbWVzL2ZvcmVzdGdyYXNzL2ZvcmVzdGdyYXNzX3NwcmluZ19tb2lzdGRpcnRfXCIsXHJcbiAgICAgICAgZ2VuZXJhdGlvbk9wdGlvbnM6IHtcclxuICAgICAgICAgICAgaGVpZ2h0OiB7XHJcbiAgICAgICAgICAgICAgICBtaW46IDAuNzUsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIG1vaXN0dXJlOiB7XHJcbiAgICAgICAgICAgICAgICBtaW46IDAuNjUsXHJcbiAgICAgICAgICAgICAgICBtYXg6IDAuOCxcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICB9LFxyXG4gICAgfSxcclxuICAgIHN3YW1wOiB7XHJcbiAgICAgICAgaWQ6IFwic3dhbXBcIixcclxuICAgICAgICBuYW1lOiBcIlN3YW1wXCIsXHJcbiAgICAgICAgZGVzY3JpcHRpb246IFwiVGhlIG11cmt5IHdhdGVyIGNvdWxkIGJlIGhpZGluZyBhbnl0aGluZy4uLlwiLFxyXG4gICAgICAgIGJhc2VUaWxlOiBcImJpb21lcy9zd2FtcC9zd2FtcF9zcHJpbmdfbW9pc3RkaXJ0XzQ3XCIsXHJcbiAgICAgICAgYXV0b3RpbGVQcmVmaXg6IFwiYmlvbWVzL3N3YW1wL3N3YW1wX3NwcmluZ19tb2lzdGRpcnRfXCIsXHJcbiAgICAgICAgY29sb3I6IFwiIzYwNmQ0Y1wiLFxyXG4gICAgICAgIGdlbmVyYXRpb25PcHRpb25zOiB7XHJcbiAgICAgICAgICAgIGhlaWdodDoge1xyXG4gICAgICAgICAgICAgICAgbWluOiAwLjUsXHJcbiAgICAgICAgICAgICAgICBtYXg6IDAuNixcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgbW9pc3R1cmU6IHtcclxuICAgICAgICAgICAgICAgIG1pbjogMC44LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB0ZW1wZXJhdHVyZToge1xyXG4gICAgICAgICAgICAgICAgbWluOiAwLjUsXHJcbiAgICAgICAgICAgICAgICBtYXg6IDAuOCxcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICB9LFxyXG4gICAgfSxcclxuICAgIHZhbGxleToge1xyXG4gICAgICAgIGlkOiBcInZhbGxleVwiLFxyXG4gICAgICAgIG5hbWU6IFwiVmFsbGV5XCIsXHJcbiAgICAgICAgZGVzY3JpcHRpb246IFwiQSBsb3ctbHlpbmcgYXJlYSBwcm90ZWN0ZWQgYnkgaGlsbHMuXCIsXHJcbiAgICAgICAgYmFzZVRpbGU6IFwiYmlvbWVzL3ZhbGxleS92YWxsZXlfc3ByaW5nX21vaXN0ZGlydF80N1wiLFxyXG4gICAgICAgIGF1dG90aWxlUHJlZml4OiBcImJpb21lcy92YWxsZXkvdmFsbGV5X3NwcmluZ19tb2lzdGRpcnRfXCIsXHJcbiAgICAgICAgY29sb3I6IFwiIzhkZjQ4ZFwiLFxyXG4gICAgICAgIGdlbmVyYXRpb25PcHRpb25zOiB7XHJcbiAgICAgICAgICAgIGhlaWdodDoge1xyXG4gICAgICAgICAgICAgICAgbWluOiAwLjUsXHJcbiAgICAgICAgICAgICAgICBtYXg6IDAuNixcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgbW9pc3R1cmU6IHtcclxuICAgICAgICAgICAgICAgIG1pbjogMC41LFxyXG4gICAgICAgICAgICAgICAgbWF4OiAwLjgsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIHRlbXBlcmF0dXJlOiB7XHJcbiAgICAgICAgICAgICAgICBtaW46IDAuNCxcclxuICAgICAgICAgICAgICAgIG1heDogMC44LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgIH0sXHJcbiAgICB9LFxyXG4gICAgLy8gc25vd3NhbmR5ZGlydDoge1xyXG4gICAgLy8gICBpZDogXCJzbm93c2FuZHlkaXJ0XCIsXHJcbiAgICAvLyAgIG5hbWU6IFwiU25vd1wiLFxyXG4gICAgLy8gICBkZXNjcmlwdGlvbjogXCJBIGJsYW5rZXQgb2Ygc25vdyBjb3ZlcnMgdGhlIGdyb3VuZC5cIixcclxuICAgIC8vICAgYmFzZVRpbGU6IFwiYmlvbWVzL3Nub3cvc25vd19iYXNlXCIsXHJcbiAgICAvLyAgIC8vIGF1dG90aWxlUHJlZml4OiBcImJpb21lcy9zYW5keWRpcnQvc2FuZHlkaXJ0X3NwcmluZ19zbm93X1wiLFxyXG4gICAgLy8gICBjb2xvcjogXCIjZmVmZWZlXCIsXHJcbiAgICAvLyAgIGdlbmVyYXRpb25PcHRpb25zOiB7XHJcbiAgICAvLyAgICAgaGVpZ2h0OiB7XHJcbiAgICAvLyAgICAgICBtaW46IDAuNixcclxuICAgIC8vICAgICB9LFxyXG4gICAgLy8gICAgIHRlbXBlcmF0dXJlOiB7XHJcbiAgICAvLyAgICAgICBtYXg6IDAuMyxcclxuICAgIC8vICAgICB9LFxyXG4gICAgLy8gICB9LFxyXG4gICAgLy8gfSxcclxuICAgIHNub3dtb2lzdGRpcnQ6IHtcclxuICAgICAgICBpZDogXCJzbm93bW9pc3RkaXJ0XCIsXHJcbiAgICAgICAgbmFtZTogXCJTbm93XCIsXHJcbiAgICAgICAgZGVzY3JpcHRpb246IFwiQSBibGFua2V0IG9mIHNub3cgY292ZXJzIHRoZSBncm91bmQuXCIsXHJcbiAgICAgICAgYmFzZVRpbGU6IFwiYmlvbWVzL3Nub3cvc25vd19iYXNlXCIsXHJcbiAgICAgICAgLy8gYXV0b3RpbGVQcmVmaXg6IFwiYmlvbWVzL3Nub3cvc25vd19zcHJpbmdfbW9pc3RkaXJ0X1wiLFxyXG4gICAgICAgIGNvbG9yOiBcIiNmZWZlZmVcIixcclxuICAgICAgICBnZW5lcmF0aW9uT3B0aW9uczoge1xyXG4gICAgICAgICAgICBoZWlnaHQ6IHtcclxuICAgICAgICAgICAgICAgIG1pbjogMC42LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAvLyBtb2lzdHVyZToge1xyXG4gICAgICAgICAgICAvLyAgIG1pbjogMC4zLFxyXG4gICAgICAgICAgICAvLyB9LFxyXG4gICAgICAgICAgICB0ZW1wZXJhdHVyZToge1xyXG4gICAgICAgICAgICAgICAgbWF4OiAwLjMsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgfSxcclxuICAgIH0sXHJcbiAgICBzbm93aGlsbHNoaWxsc21pZDoge1xyXG4gICAgICAgIGlkOiBcInNub3doaWxsc2hpbGxzbWlkXCIsXHJcbiAgICAgICAgbmFtZTogXCJTbm93XCIsXHJcbiAgICAgICAgZGVzY3JpcHRpb246IFwiQS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VNpemUud2lkdGggKiBUaWxlLnNpemUpIC8gMjtcclxuICAgICAgICAvLyAgIGNvbnN0IGluaXRpYWxQaXZvdFkgPSAodGhpcy5nYW1lLmdhbWVTaXplLmhlaWdodCAqIFRpbGUuc2l6ZSkgLyAyO1xyXG4gICAgICAgIC8vICAgY29uc3Qgc2NyZWVuQ2VudGVyWCA9IHRoaXMudWkuZ2FtZUNhbnZhc0NvbnRhaW5lci5jbGllbnRXaWR0aCAvIDI7XHJcbiAgICAgICAgLy8gICBjb25zdCBzY3JlZW5DZW50ZXJZID0gdGhpcy51aS5nYW1lQ2FudmFzQ29udGFpbmVyLmNsaWVudEhlaWdodCAvIDI7XHJcbiAgICAgICAgLy8gICBjb25zdCBwaXZvdFggPSBwaXZvdC54O1xyXG4gICAgICAgIC8vICAgY29uc3QgcGl2b3RZID0gcGl2b3QueTtcclxuICAgICAgICAvLyAgIGNvbnN0IGNlbnRlclRpbGVYID0gdmlld3BvcnQuY2VudGVyLng7XHJcbiAgICAgICAgLy8gICBjb25zdCBjZW50ZXJUaWxlWSA9IHZpZXdwb3J0LmNlbnRlci55O1xyXG4gICAgICAgIC8vICAgY29uc3QgY2VudGVyU2NyZWVuWCA9IGNlbnRlclRpbGVYICogVGlsZS5zaXplO1xyXG4gICAgICAgIC8vICAgY29uc3QgY2VudGVyU2NyZWVuWSA9IGNlbnRlclRpbGVZICogVGlsZS5zaXplO1xyXG4gICAgICAgIC8vICAgY29uc29sZS5sb2coXCJjZW50ZXJTY3JlZW5YXCIsIGNlbnRlclNjcmVlblgpO1xyXG4gICAgICAgIC8vICAgY29uc3QgcGl2b3REaWZmWCA9IHBpdm90WCAtIGNlbnRlclNjcmVlblg7XHJcbiAgICAgICAgLy8gICBjb25zdCBwaXZvdERpZmZZID0gcGl2b3RZIC0gY2VudGVyU2NyZWVuWTtcclxuICAgICAgICAvLyAgIGNvbnNvbGUubG9nKFwicGl2b3REaWZmWFwiLCBwaXZvdERpZmZYKTtcclxuICAgICAgICAvLy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mQoc2NhbGVkQ2xpY2tPZmZzZXRYIC8gVGlsZS5zaXplKTtcclxuICAgICAgICAvLyAgIGNvbnN0IHRpbGVPZmZzZXRZID0gTWF0aC5yb3VuZChzY2FsZWRDbGlja09mZnNldFkgLyBUaWxlLnNpemUpO1xyXG4gICAgICAgIC8vICAgY29uc3QgdGlsZVggPSB2aWV3cG9ydC5jZW50ZXIueCArIHRpbGVPZmZzZXRYO1xyXG4gICAgICAgIC8vICAgY29uc3QgdGlsZVkgPSB2aWV3cG9ydC5jZW50ZXIueSArIHRpbGVPZmZzZXRZO1xyXG4gICAgICAgIC8vICAgcmV0dXJuIG5ldyBQb2ludCh0aWxlWCwgdGlsZVkpO1xyXG4gICAgICAgIC8vIH1cclxuICAgICAgICB0aGlzLmhhbmRsZVBhblN0YXJ0ID0gKGcpID0+IHtcclxuICAgICAgICAgICAgLy8gY29uc29sZS5sb2coXCJwYW4gc3RhcnRcIiwgZy52ZWxvY2l0eVgsIGcudmVsb2NpdHlZKTtcclxuICAgICAgICAgICAgLy8gY29uc29sZS5sb2coXHJcbiAgICAgICAgICAgIC8vICAgXCJwYW4gaW5mb1wiLFxyXG4gICAgICAgICAgICAvLyAgIGcudG91Y2hNb3ZlWCxcclxuICAgICAgICAgICAgLy8gICBnLnRvdWNoTW92ZVksXHJcbiAgICAgICAgICAgIC8vICAgZy50b3VjaFN0YXJ0WCxcclxuICAgICAgICAgICAgLy8gICBnLnRvdWNoU3RhcnRZLFxyXG4gICAgICAgICAgICAvLyAgIGcudG91Y2hFbmRYLFxyXG4gICAgICAgICAgICAvLyAgIGcudG91Y2hFbmRZXHJcbiAgICAgICAgICAgIC8vICk7XHJcbiAgICAgICAgICAgIHRoaXMudmlld3BvcnRUYXJnZXQgPSBudWxsO1xyXG4gICAgICAgICAgICB0aGlzLnNob3dTaWRlYmFyVGltZXIgPSB0aGlzLnNob3dTaWRlYmFyRGVsYXlNcztcclxuICAgICAgICAgICAgdGhpcy5zZXRTaWRlTWVudVZpc2lib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FsZSxcclxuICAgICAgICAgICAgLy8gICBudWxsLCAvLyByb3RhdGlvblxyXG4gICAgICAgICAgICAvLyAgIG51bGwsIC8vIHNrZXdcclxuICAgICAgICAgICAgLy8gICBudWxsLFxyXG4gICAgICAgICAgICAvLyAgIHBpdm90WCxcclxuICAgICAgICAgICAgLy8gICBwaXZvdFlcclxuICAgICAgICAgICAgLy8gKTtcclxuICAgICAgICAgICAgdGhpcy51aS5nYW1lRGlzcGxheS5zdGFnZS5zZXRUcmFuc2Zvcm0odGhpcy5nYW1lLnVzZXJJbnRlcmZhY2UuZ2FtZURpc3BsYXkuc3RhZ2UucG9zaXRpb24ueCwgdGhpcy5nYW1lLnVzZXJJbnRlcmZhY2UuZ2FtZURpc3BsYXkuc3RhZ2UucG9zaXRpb24ueSwgc2NhbGUsIC8vIHNjYWxlXHJcbiAgICAgICAgICAgIHNjYWxlLCBudWxsLCAvLyByb3RhdGlvblxyXG4gICAgICAgICAgICBudWxsLCAvLyBza2V3XHJcbiAgICAgICAgICAgIG51bGwsIHBpdm90WCwgcGl2b3RZKTtcclxuICAgICAgICAgICAgaWYgKHRoaXMuZ2FtZS5vcHRpb25zLnNob3dDbG91ZHMpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMudWkuY29tcG9uZW50cy5za3lNYXNrLnNldFNreU1hc2tWaXNpYmlsaXR5KHRoaXMuZ2V0Tm9ybWFsaXplZFpvb20oKSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9O1xyXG4gICAgICAgIHRoaXMuaGFuZGxlRG91YmxlVGFwID0gKGcpID0+IHtcclxuICAgICAgICAgICAgY29uc3Qgem9vbUluQW1vdW50ID0gMS43NTtcclxuICAgICAgICAgICAgbGV0IHNjYWxlID0gdGhpcy51aS5nYW1lRGlzcGxheS5zdGFnZS5zY2FsZS54ICogem9vbUluQW1vdW50O1xyXG4gICAgICAgICAgICBzY2FsZSA9IE1hdGgubWF4KHRoaXMubWluWm9vbSwgTWF0aC5taW4odGhpcy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W50ZXJmYWNlLmdhbWVEaXNwbGF5LnN0YWdlLnBvc2l0aW9uLngsXHJcbiAgICAgICAgICAgIC8vICAgdGhpcy5nYW1lLnVzZXJJbnRlcmZhY2UuZ2FtZURpc3BsYXkuc3RhZ2UucG9zaXRpb24ueSxcclxuICAgICAgICAgICAgLy8gICBzY2FsZSwgLy8gc2NhbGVcclxuICAgICAgICAgICAgLy8gICBzY2FsZSxcclxuICAgICAgICAgICAgLy8gICBudWxsLCAvLyByb3RhdGlvblxyXG4gICAgICAgICAgICAvLyAgIG51bGwsIC8vIHNrZXdcclxuICAgICAgICAgICAgLy8gICBudWxsLFxyXG4gICAgICAgICAgICAvLyAgIHBpdm90WCxcclxuICAgICAgICAgICAgLy8gICBwaXZvdFlcclxuICAgICAgICAgICAgLy8gKTtcclxuICAgICAgICAgICAgaWYgKHRoaXMuZ2FtZS5vcHRpb25zLnNob3dDbG91ZHMpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMudWkuY29tcG9uZW50cy5za3lNYXNrLnNldFNreU1hc2tWaXNpYmlsaXR5KHRoaXMuZ2V0Tm9ybWFsaXplZFpvb20oKSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9O1xyXG4gICAgICAgIHRoaXMuZGVmYXVsdFpvb20gPSAxLjQ7XHJcbiAgICAgICAgdGhpcy5jdXJyZW50Wm9vbSA9IHRoaXMuZGVmYXVsdFpvb207XHJcbiAgICAgICAgdGhpcy5taW5ab29tID0gMC41O1xyXG4gICAgICAgIHRoaXMubWF4Wm9vbSA9IDc7XHJcbiAgICAgICAgdGhpcy5tb3ZlU3BlZWQgPSAwLjM7XHJcbiAgICAgICAgdGhpcy5zaG93U2lkZWJhckRlbGF5TXMgPSA1MDA7XHJcbiAgICAgICAgdGhpcy5tYXhNb21lbnR1bVRpbWVNcyA9IDEwMDA7XHJcbiAgICAgICAgdGhpcy5tb21lbnR1bVRpbWVyID0gMDtcclxuICAgICAgICB0aGlzLnNob3dTaWRlYmFyVGltZ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vcnQuaGVpZ2h0IC8gMiAmJlxyXG4gICAgICAgICAgICB5IDwgdGhpcy52aWV3cG9ydC5jZW50ZXIueSArIHRoaXMudmlld3BvcnQuaGVpZ2h0IC8gMik7XHJcbiAgICB9XHJcbiAgICBjZW50ZXJPbih4LCB5KSB7XHJcbiAgICAgICAgdGhpcy52aWV3cG9ydFRhcmdldCA9IHRoaXMuVGlsZVRvU2NyZWVuQ29vcmRzKHgsIHkpO1xyXG4gICAgfVxyXG4gICAgZm9sbG93QWN0b3IoYWN0b3IpIHtcclxuICAgICAgICB0aGlzLnZpZXdwb3J0VGFyZ2V0ID0gYWN0b3I7XHJcbiAgICB9XHJcbiAgICByZWZyZXNoUG9pbnRlclRhcmdldEluZm8oKSB7XHJcbiAgICAgICAgaWYgKHRoaXMucG9pbnRlclRhcmdldCkge1xyXG4gICAgICAgICAgICBpZiAoIWlzQWN0b3IodGhpcy5wb2ludGVyVGFyZ2V0LnRhcmdldCkpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMucG9pbnRlclRhcmdldC5pbmZvID0gdGhpcy5nYW1lLmdldFRpbGVJbmZvQXQodGhpcy5wb2ludGVyVGFyZ2V0LnBvc2l0aW9uLngsIHRoaXMucG9pbnRlclRhcmdldC5wb3NpdGlvbi55KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIHNldFBvaW50ZXJUYXJnZXQocG9zLCB0YXJnZXQsIHZpZXdwb3J0VGFyZ2V0ID0gZmFsc2UpIHtcclxuICAgICAgICBpZiAoaXNBY3Rvcih0YXJnZXQpKSB7XHJcbiAgICAgICAgICAgIHRoaXMucG9pbnRlclRhcmdldCA9IHtcclxuICAgICAgICAgICAgICAgIHBvc2l0aW9uOiB0YXJnZXQucG9zaXRpb24sXHJcbiAgICAgICAgICAgICAgICB0YXJnZXQ6IHRhcmdldCxcclxuICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgdGhpcy51aS5jb21wb25lbnRzLnNpZGVNZW51LnNldEVudGl0eVRhcmdldCh0YXJnZXQpO1xyXG4gICAgICAgICAgICBpZiAodmlld3BvcnRUYXJnZXQpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMudmlld3BvcnRUYXJnZXQgPSB0YXJnZXQ7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIHRoaXMucG9pbnRlclRhcmdldCA9IHtcclxuICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBwb3MsXHJcbiAgICAgICAgICAgICAgICB0YXJnZXQ6IHRhcmdldCxcclxuICAgICAgICAgICAgICAgIGluZm86IHRoaXMuZ2FtZS5nZXRUaWxlSW5mb0F0KHBvcy54LCBwb3MueSksXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHRoaXMudWkuY29tcG9uZW50cy5zaWRlTWVudS5zZXRFbnRpdHlUYXJnZXQobnVsbCk7XHJcbiAgICAgICAgICAgIGlmICh2aWV3cG9ydFRhcmdldCkge1xyXG4gICAgICAgICAgICAgICAgdGhpcy52aWV3cG9ydFRhcmdldCA9IHBvcztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLnVpLmNvbXBvbmVudHMudGlsZUluZm8uc2V0Q29udGVudCh0aGlzLnBvaW50ZXJUYXJnZXQpO1xyXG4gICAgfVxyXG4gICAgY2xlYXJQb2ludGVyVGFyZ2V0KCkge1xyXG4gICAgICAgIHRoaXMucG9pbnRlclRhcmdldCA9IG51bGw7XHJcbiAgICAgICAgdGhpcy51aS5jb21wb25lbnRzLnNpZGVNZW51LnNldEVudGl0eVRhcmdldChudWxsKTtcclxuICAgIH1cclxuICAgIHNlbGVjdFRpbGVBdCh4LCB5LCB2aWV3cG9ydFRhcmdldCA9IGZhbHNlKSB7XHJcbiAgICAgICAgLy8gY2hlY2sgaWYgZW50aXR5IGF0IHRpbGUgcG9zaXRpb25cclxuICAgICAgICAvLyB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AgICAgICBnZXN0dXJlLm9uKFwicGFubW92ZVwiLCAoZXZlbnQpID0+IHtcclxuICAgICAgICAgICAgdGhpcy5oYW5kbGVQb2ludGVyRHJhZyhnZXN0dXJlKTtcclxuICAgICAgICB9KTtcclxuICAgICAgICBnZXN0dXJlLm9uKFwicGFuZW5kXCIsIChldmVudCkgPT4ge1xyXG4gICAgICAgICAgICB0aGlzLmhhbmRsZVBhbkVuZChnZXN0dXJlKTtcclxuICAgICAgICB9KTtcclxuICAgICAgICBnZXN0dXJlLm9uKFwidGFwXCIsIChldmVudCkgPT4ge1xyXG4gICAgICAgICAgICB0aGlzLmhhbmRsZUNsaWNrKGdlc3R1cmUsIGV2ZW50KTtcclxuICAgICAgICB9KTtcclxuICAgICAgICBnZXN0dXJlLm9uKFwiZG91YmxldGFwXCIsIChldmVudCkgPT4ge1xyXG4gICAgICAgICAgICAvLyBUaGUgZ2VzdHVyZSB3YXMgYSBkb3VibGUgdGFwLiBUaGUgJ3RhcCcgZXZlbnQgd2lsbCBhbHNvIGhhdmUgYmVlbiBmaXJlZCBvblxyXG4gICAgICAgICAgICAvLyB0aGUgZmlyc3QgdGFwLlxyXG4gICAgICAgICAgICB0aGlzLmhhbmRsZURvdWJsZVRhcChnZXN0dXJlKTtcclxuICAgICAgICB9KTtcclxuICAgICAgICB0aGlzLnVpLmdhbWVDYW52YXNDb250YWluZXIuYWRkRXZlbnRMaXN0ZW5lcihcIndoZWVsXCIsIHRoaXMuaGFuZGxlTW91c2Vab29tLCB7XHJcbiAgICAgICAgICAgIHBhc3NpdmU6IGZhbHNlLFxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKFwia2V5ZG93blwiLCB0aGlzLmhhbmRsZUlucHV0LmJpbmQodGhpcyksIHtcclxuICAgICAgICAgICAgcGFzc2l2ZTogZmFsc2UsXHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbiAgICBBY3QoKSB7XHJcbiAgICAg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uVGlsZUVudGVyVmlld3BvcnQoZW50ZXJlZFRpbGVzKTtcclxuICAgIH1cclxuICAgIHVwZGF0ZShkZWx0YVRpbWUpIHtcclxuICAgICAgICBpZiAodGhpcy5zaG93U2lkZWJhclRpbWVyID4gMCkge1xyXG4gICAgICAgICAgICB0aGlzLnNob3dTaWRlYmFyVGltZXIgLT0gZGVsdGFUaW1lICogMTAwMDtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSBpZiAodGhpcy5zaG93U2lkZWJhclRpbWVyIDwgMCkge1xyXG4gICAgICAgICAgICB0aGlzLnNob3dTaWRlYmFyVGltZXIgPSAwO1xyXG4gICAgICAgICAgICB0aGlzLnNldFNpZGVNZW51VmlzaWJsZSh0cnVlKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICByZW5kZXJVcGRhdGUoaW50ZXJwUGVyY2VudCkge1xyXG4gICAgICAgIC8vIG9ubHkgdXBkYXRlIHZpZXdwb3J0IGlmOlxyXG4gICAgICAgIC8vIHpvb20vc2NhbGUgY2hhbmdlXHJcbiAgICAgICAgLy8gcGl2b3QgY2hhbmdlXHJcbiAgICAgICAgaWYgKCF0aGlzLnZpZXdwb3J0KSB7XHJcbiAgICAgICAgICAgIHRoaXMudXBkYXRlVmlld3BvcnQoKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHRoaXMubGFzdFpvb20gIT09IHRoaXMuY3VycmVudFpvb20gfHxcclxuICAgICAgICAgICAgdGhpcy5sYXN0UGl2b3QueCAhPT0gdGhpcy51aS5nYW1lRGlzcGxheS5zdGFnZS5waXZvdC54IHx8XHJcbiAgICAgICAgICAgIHRoaXMubGFzdFBpdm90LnkgIT09IHRoaXMudWkuZ2FtZURpc3BsYXkuc3RhZ2UucGl2b3QueSkge1xyXG4gICAgICAgICAgICB0aGlzLmxhc3Rab29tID0gdGhpcy5jdXJyZW50Wm9vbTtcclxuICAgICAgICAgICAgdGhpcy5sYXN0UGl2b3QueCA9IHRoaXMudWk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0YWdldmFsdWUobmV3UGl2b3RZKTtcclxuICAgICAgICAgICAgICAgIHRoaXMudWkuZ2FtZURpc3BsYXkuc3RhZ2UucGl2b3Quc2V0KG5ld1Bpdm90WCwgbmV3UGl2b3RZKTtcclxuICAgICAgICAgICAgICAgIC8vIG5ld1Bpdm90WCA9XHJcbiAgICAgICAgICAgICAgICAvLyAgIE1hdGguY2VpbCh0aGlzLnVpLmdhbWVEaXNwbGF5LnN0YWdlLnBpdm90LnggLyBUaWxlLnNpemUpICogVGlsZS5zaXplO1xyXG4gICAgICAgICAgICAgICAgLy8gdGhpcy51aS5nYW1lRGlzcGxheS5zdGFnZS5waXZvdC54ID0gdGhpcy5sZXJwKFxyXG4gICAgICAgICAgICAgICAgLy8gICB0aGlzLnVpLmdhbWVEaXNwbGF5LnN0YWdlLnBpdm90LngsXHJcbiAgICAgICAgICAgICAgICAvLyAgIHRhcmdldFBvcy54LFxyXG4gICAgICAgICAgICAgICAgLy8gICBkZWx0YVRpbWVcclxuICAgICAgICAgICAgICAgIC8vICk7XHJcbiAgICAgICAgICAgICAgICAvLyB0aGlzLnVpLmdhbWVEaXNwbGF5LnN0YWdlLnBpdm90LnkgPSB0aGlzLmxlcnAoXHJcbiAgICAgICAgICAgICAgICAvLyAgIHRoaXMudWkuZ2FtZURpc3BsYXkuc3RhZ2UucGl2b3QueSxcclxuICAgICAgICAgICAgICAgIC8vICAgdGFyZ2V0UG9zLnksXHJcbiAgICAgICAgICAgICAgICAvLyAgIGRlbHRhVGltZVxyXG4gICAgICAgICAgICAgICAgLy8gKTtcclxuICAgICAgICAgICAgICAgIC8vIHRoaXMudWkuZ2FtZURpc3BsYXkuc3RhZ2UucGl2b3QueCA9XHJcbiAgICAgICAgICAgICAgICAvLyAgIE1hdGguY2VpbCh0aGlzLnVpLmdhbWVEaXNwbGF5LnN0YWdlLnBpdm90LnggLyBUaWxlLnNpemUpICogVGlsZS5zaXplO1xyXG4gICAgICAgICAgICAgICAgLy8gdGhpcy51aS5n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uYWN0b3IudGlsZS5zcHJpdGVQYXRoKS5kYXRhLmZyYW1lcztcclxuICAgICAgICAgICAgdGhpcy5hbmltYXRpb25GcmFtZXMgPSB7fTtcclxuICAgICAgICAgICAgZm9yIChsZXQgYW5pbWF0aW9uS2V5IG9mIHRoaXMuYWN0b3IudGlsZS5hbmltYXRpb25LZXlzKSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmFuaW1hdGlvbkZyYW1lc1thbmltYXRpb25LZXldID0gW107XHJcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBrZXkgaW4gZnJhbWVzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGtleS5pbmNsdWRlcyhhbmltYXRpb25LZXkpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuYW5pbWF0aW9uRnJhbWVzW2FuaW1hdGlvbktleV0ucHVzaChrZXkpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHRoaXMuYW5pbWF0aW9uRnJhbWVzW2FuaW1hdGlvbktleV0uc29ydCgpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHRoaXMuc2V0QW5pbWF0aW9uKHRoaXMuYWN0b3IudGlsZS5hbmltYXRpb25LZXlzWzBdKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBzZXRBbmltYXRpb24oYW5pbWF0aW9uKSB7XHJcbiAgICAgICAgaWYgKHRoaXMuY3VycmVudEFuaW1hdGlvbiA9PT0gYW5pbWF0aW9uKVxyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgdGhpcy5jdXJyZW50QW5pbWF0aW9uID0gYW5pbWF0aW9uO1xyXG4gICAgICAgIGlmICh0aGlzLmFjdG9yLnNwcml0ZSkge1xyXG4gICAgICAgICAgICBjb25zdCBhbmltYXRlZFNwcml0ZSA9IHRoaXMuYWN0b3Iuc3ByaXRlO1xyXG4gICAgIC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vbikge1xyXG4gICAgICAgICAgICAgICAgLy8gISEhISEgTVVTVCBjaGVjayBpZiB0YXJnZXQgaXMgcmVhY2hhYmxlIGJlZm9yZSB0aGlzIHBvaW50XHJcbiAgICAgICAgICAgICAgICBpZiAoaGFzR29hbCAmJiAhaGFzUGF0aCkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGNhbGN1bGF0ZSBuZXcgcGF0aCBpZiBubyBwYXRoIGV4aXN0c1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucGF0aFRvKHRoaXMuZ29hbC50YXJnZXRQb3MpO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnBhdGgubGVuZ3RoID09PSAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vIHBhdGggZm91bmRcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5nb2FsID0gdGhpcy5wbGFuV2FuZGVyR29hbCgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBoYXNHb2FsID0gdGhpcy5nb2FsICE9IG51bGw7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGF0aFRvKChfZCA9IHRoaXMuZ29hbCkgPT09IG51bGwgfHwgX2QgPT09IHZvaWQgMCA/IHZvaWQgMCA6IF9kLnRhcmdldFBvcyk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGhhc1BhdGggPSAoKF9lID0gdGhpcy5wYXRoKSA9PT0gbnVsbCB8fCBfZSA9PT0gdm9pZCAwID8gdm9pZCAwIDogX2UubGVuZ3RoKSA+IDA7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpZiAoaGFzR29hbCAmJiBoYXNQYXRoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gY29uc29sZS5sb2coXCJoYXMgZ29hbCwgaGFzIHBhdGgsIHNldCBhY3Rpb24gbW92ZUFjdGlvblwiKTtcclxuICAg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hpcy5wYXRoQ2FsbGJhY2suYmluZCh0aGlzKSk7XHJcbiAgICAgICAgdGhpcy5wYXRoLnNoaWZ0KCk7IC8vIHJlbW92ZSBhY3RvcidzIHBvc2l0aW9uXHJcbiAgICB9XHJcbiAgICBhY3QoKSB7XHJcbiAgICAgICAgcmV0dXJuIHRoaXMuYWN0aW9uXHJcbiAgICAgICAgICAgIC5ydW4oKVxyXG4gICAgICAgICAgICAudGhlbigocmVzKSA9PiB7XHJcbiAgICAgICAgICAgIC8vIGZhY2UgdGhlIHNwcml0ZS9hbmltIHRvIHRoZSBkaXJlY3Rpb24gb2YgbW92ZW1lbnRcclxuICAgICAgICAgICAgdGhpcy51cGRhdGVGYWNpbmcocmVzID09PSBudWxsIHx8IHJlcyA9PT0gdm9pZCAwID8gdm9pZCAwIDogcmVzLm1vdmVtZW50VmVjdG9yKTtcclxuICAgICAgICAgICAgaWYgKHRoaXMuZ29hbCA9PT0gdGhpcy5hY3Rpb24pIHtcclxuICAgICAgICAgICAgICAgIC8vIGdvYWwgY29tcGxldGVkLCBwaWNrIGEgbmV3IG9uZSBuZXh0IHR1cm5cclxuICAgICAgICAgICAgICAgIHRoaXMuZ29hbCA9IG51bGw7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy8gYWN0aW9uIGNvbXBsZXRlZCwgcGljayBhIG5ldyBvbmUgbmV4dCB0dXJuXHJcbiAgICAgICAgICAgIHRoaXMuYWN0aW9uID0gbnVsbDtcclxuICAgICAgICAgICAgcmV0dXJuIHJlcztcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIGdldERlc2NyaXB0aW9uKCkge1xyXG4gICAgICAgIGNvbnN0IGRlc2NyaXB0aW9uQmxvY2tzID0gW107XHJcbiAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgIGljb246IFBpbkljb24sXHJcbiAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAocG9pbnRlclRhcmdldCkg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KSB7XHJcbiAgICAgICAgICAgICAgICBjYXNlIDE6XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hbmltYXRvci5zZXRBbmltYXRpb24oXCJ3YWxrX3JpZ2h0XCIpO1xyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgY2FzZSAtMTpcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmFuaW1hdG9yLnNldEFuaW1hdGlvbihcIndhbGtfbGVmdFwiKTtcclxuICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgIGNhc2UgMDpcclxuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKG1vdmVWZWN0b3JbMV0pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5hbmltYXRvci5zZXRBbmltYXRpb24oXCJ3YWxrX2Rvd25cIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAtMTpcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuYW5pbWF0b3Iuc2V0QW5pbWF0aW9uKFwid2Fsa191cFwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIHBhdGhDYWxsYmFjayh4LCB5KSB7XHJcbiAgICAgICAgdGhpcy5wYXRoLnB1c2gobmV3IFBvaW50KHgsIHkpKTtcclxuICAgIH1cclxufVxyXG4iLCJpbXBvcnQgeyBQYXRoLCBSTkcgfSBmcm9tIFwicm90LWpzXCI7XHJcbmltcG9ydCB7IFBvaW50IH0gZnJvbSBcIi4uL3BvaW50XCI7XHJcbmltcG9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HNlO1xyXG4gICAgICAgIGxldCBoYXNQYXRoID0gKChfYyA9IHRoaXMucGF0aCkgPT09IG51bGwgfHwgX2MgPT09IHZvaWQgMCA/IHZvaWQgMCA6IF9jLmxlbmd0aCkgPiAwO1xyXG4gICAgICAgIGNvbnN0IGlzT2NjdXBpZWQgPSBoYXNQYXRoXHJcbiAgICAgICAgICAgID8gdGhpcy5nYW1lLmlzT2NjdXBpZWRCeUVudGl0eSh0aGlzLnBhdGhbMF0ueCwgdGhpcy5wYXRoWzBdLnkpXHJcbiAgICAgICAgICAgIDogZmFsc2U7XHJcbiAgICAgICAgaWYgKCFoYXNHb2FsKSB7XHJcbiAgICAgICAgICAgIC8vIGZpbmQgbmV3IGdvYWxcclxuICAgICAgICAgICAgdGhpcy5nb2FsID0gdGhpcy5wbGFuR29hbCgpO1xyXG4gICAgICAgICAgICBoYXNHb2FsID0gdGhpcy5nb2FsICE9IG51bGw7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChoYXNHb2FsKSB7XHJcbiAgICAgICAgICAgIGlmIChhdEdvYWxQb3NpdGlvbikge1xyXG4gICAgICAgICAgICAgICAgLy8gcnVuIHRoZSBhY3Rpb24gaWYgYXQgdGhlIGdvYWwgcG9zaXRpb25cclxuICAgICAgICAgICAgICAgIHRoaXMuYWN0aW9uID0gdGhpcy5nb2FsO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmICghdGhpcy5hY3Rpb24pIHtcclxuICAgICAgICAgICAgICAgIC8vICEhISEhIE1VU1QgY2hlY2sgaWYgdGFyZ2V0IGlzIHJlYWNoYWJsZSBiZWZvcmUgdGhpcyBwb2ludFxyXG4gICAgICAgICAgICAgICAgaWYgKGhhc0dvYWwgJiYgIWhhc1BhdGgpIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBjYWxjdWxhdGUgbmV3IHBhdGggaWYgbm8gcGF0aCBleGlzdHNcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnBhdGhUbyh0aGlzLmdvYWwudGFyZ2V0UG9zKTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5wYXRoLmxlbmd0aCA9PT0gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBubyBwYXRoIGZvdW5kXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZ29hbCA9IHRoaXMucGxhbldhbmRlckdvYWwoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaGFzR29hbCA9IHRoaXMuZ29hbCAhPSBudWxsO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBhdGhUbygoX2QgPSB0aGlzLmdvYWwpID09PSBudWxsIHx8IF9kID09PSB2b2lkIDAgPyB2b2lkIDAgOiBfZC50YXJnZXRQb3MpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBoYXNQYXRoID0gKChfZSA9IHRoaXMucGF0aCkgPT09IG51bGwgfHwgX2UgPT09IHZvaWQgMCA/IHZvaWQgMCA6IF9lLmxlbmd0aCkgPiAwO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKGhhc0dvYWwgJiYgaGFzUGF0aCkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKFwiaGFzIGdvYWwsIGhhcyBwYXRoLCBzZXQgYWN0aW9uIG1vdmVBY3Rpb25cIik7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hY3Rpb24gPSBuZXcgTW92ZUFjdGlvbih0aGlzLmdhbWUsIHRoaXMsIHRoaXMucGF0aC5zaGlmdCgpIC8vIG1ha2Ugc3VyZSB0byByZW1vdmUgdGhlIHBvaW50XHJcbiAgICAgICAgICAgICAgICAgICAgKTtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1ccl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ICAgICAgICAgICAgICAgIHRoaXMuZ29hbCA9IG51bGw7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgdGhpcy5hY3Rpb24gPSBudWxsO1xyXG4gICAgICAgICAgICByZXR1cm4gcmVzO1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgZ2V0RGVzY3JpcHRpb24oKSB7XHJcbiAgICAgICAgY29uc3QgZGVzY3JpcHRpb25CbG9ja3MgPSBbXTtcclxuICAgICAgICBkZXNjcmlwdGlvbkJsb2Nrcy5wdXNoKHtcclxuICAgICAgICAgICAgaWNvbjogUGluSWNvbixcclxuICAgICAgICAgICAgZ2V0RGVzY3JpcHRpb246IChwb2ludGVyVGFyZ2V0KSA9PiBgJHt0aGlzLnBvc2l0aW9uLnh9LCAke3RoaXMucG9zaXRpb24ueX1gLFxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGRlc2NyaXB0aW9uQmxvY2tzLnB1c2goe1xyXG4gICAgICAgICAgICBpY29uOiBUeXBlSWNvbixcclxuICAgICAgICAgICAgZ2V0RGVzY3JpcHRpb246ICgpID0+IHRoaXMuc3ViVHlwZSxcclxuICAgICAgICB9KTtcclxuICAgICAgICBkZXNjcmlwdGlvbkJsb2Nrcy5wdXNoKHtcclxuICAgICAgICAgICAgaWNvbjogR29hbEljb24sXHJcbiAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAoKSA9PiB7IHZhciBfYTsgcmV0dXJuICgoX2EgPSB0aGlzLmdvYWwpID09PSBudWxsIHx8IF9hID09PSB2b2lkIDAgPyB2b2lkIDAgOiBfYS5uYW1lKSB8fCBcIi1cIjsgfSxcclxuICAgICAgICB9KTtcclxuICAgICAgICBkZXNjcmlwdGlvbkJsb2Nrcy5wdXNoKHtcclxuICAgICAgICAgICAgaWNvbjogQWN0aW9uSWNvbixcclxuICAgICAgICAgICAgZ2V0RGVzY3JpcHRpb246ICgpID0+IHsgdmFyIF9hOyByZXR1cm4gKChfYSA9IHRoaX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XHJcbiAgICAgICAgICAgIHRoaXMucG9zaXRpb24gPSBuZXdQb2ludDtcclxuICAgICAgICAgICAgdmFsaWRJbnB1dCA9IHRydWU7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKGNvZGUgPT09IEtFWVMuVktfUkVUVVJOIHx8IGNvZGUgPT09IEtFWVMuVktfU1BBQ0UpIHtcclxuICAgICAgICAgICAgLy8gdGhpcy5nYW1lLmNoZWNrQm94KHRoaXMucG9zaXRpb24ueCwgdGhpcy5wb3NpdGlvbi55KTtcclxuICAgICAgICAgICAgdmFsaWRJbnB1dCA9IHRydWU7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICB2YWxpZElucHV0ID0gY29kZSA9PT0gS0VZUy5WS19OVU1QQUQ1OyAvLyBXYWl0IGEgdHVyblxyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLmdhbWUudXNlckludGVyZmFjZS5jYW1lcmEuY2VudGVyT24odGhpcy5wb3NpdGlvbi54LCB0aGlzLnBvc2l0aW9uLnkpO1xyXG4gICAgICAgIHJldHVybiB2YWxpZElucHV0O1xyXG4gICAgfVxyXG4gICAgZ2V0RGVzY3JpcHRpb24oKSB7XHJcbiAgICAgICAgY29uc3QgZGVzY3JpcHRpb25CbG9ja3MgPSBbXTtcclxuICAgICAgICBkZXNjcmlwdGlvbkJsb2Nrcy5wdXNoKHtcclxuICAgICAgICAgICAgaWNvbjogVHlwZUljb24sXHJcbiAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAoKSA9PiBcIlBsYXllclwiLFxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGlmICh0aGlzLmdvYWwpIHtcclxuICAgICAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgICAgICBpY29uOiBHb2FsSWNvbixcclxuICAgICAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAoKSA9PiB0aGlzLmdvY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vc2l0aW9uKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBydW4gdGhlIGFjdGlvbiBpZiBhdCB0aGUgZ29hbCBwb3NpdGlvblxyXG4gICAgICAgICAgICAgICAgdGhpcy5hY3Rpb24gPSB0aGlzLmdvYWw7XHJcbiAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKCF0aGlzLmFjdGlvbikge1xyXG4gICAgICAgICAgICAgICAgLy8gISEhISEgTVVTVCBjaGVjayBpZiB0YXJnZXQgaXMgcmVhY2hhYmxlIGJlZm9yZSB0aGlzIHBvaW50XHJcbiAgICAgICAgICAgICAgICBpZiAoaGFzR29hbCAmJiAhaGFzUGF0aCkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGNhbGN1bGF0ZSBuZXcgcGF0aCBpZiBubyBwYXRoIGV4aXN0c1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucGF0aFRvKHRoaXMuZ29hbC50YXJnZXRQb3MpO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnBhdGgubGVuZ3RoID09PSAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vIHBhdGggZm91bmRcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5nb2FsID0gdGhpcy5wbGFuV2FuZGVyR29hbCgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBoYXNHb2FsID0gdGhpcy5nb2FsICE9IG51bGw7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGF0aFRvKChfZCA9IHRoaXMuZ29hbCkgPT09IG51bGwgfHwgX2QgPT09IHZvaWQgMCA/IHZvaWQgMCA6IF9kLnRhcmdldFBvcyk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGhhc1BhdGggPSAoKF9lID0gdGhpcy5wYXRoKSA9PT0gbnVsbCB8fCBfZSA9PT0gdm9pZ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9KTtcclxuICAgIH1cclxuICAgIGdldERlc2NyaXB0aW9uKCkge1xyXG4gICAgICAgIGNvbnN0IGRlc2NyaXB0aW9uQmxvY2tzID0gW107XHJcbiAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgIGljb246IFBpbkljb24sXHJcbiAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAocG9pbnRlclRhcmdldCkgPT4gYCR7dGhpcy5wb3NpdGlvbi54fSwgJHt0aGlzLnBvc2l0aW9uLnl9YCxcclxuICAgICAgICB9KTtcclxuICAgICAgICBkZXNjcmlwdGlvbkJsb2Nrcy5wdXNoKHtcclxuICAgICAgICAgICAgaWNvbjogVHlwZUljb24sXHJcbiAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAoKSA9PiB0aGlzLnN1YlR5cGUsXHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgIGljb246IEdvYWxJY29uLFxyXG4gICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKCkgPT4geyB2YXIgX2E7IHJldHVybiAoKF9hID0gdGhpcy5nb2FsKSA9PT0gbnVsbCB8fCBfYSA9PT0gdm9pZCAwID8gdm9pZCAwIDogX2EubmFtZSkgfHwgXCItXCI7IH0sXHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgIGljb246IEFjdGlvbkljb24sXHJcbiAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAoKSA9PiB7IHZhciBfYTsgcmV0dXJuICgoX2EgPSB0aGlzLmFjdGlvbikgPT09IG51bGwgfHwgX2EgPT09IHZvaWQgMCA/IHZvaWQgMCA6IF9hLm5hbWUpIHx8IFwiLVwiOyB9LFxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIHJldHVybiBkZXNjcmlwdGlvbkJsb2NrcztcclxuICAgIH1cclxuICAgIHVwZGF0ZUZhY2luZyhtb3ZlVmVjdG9yKSB7XHJcbiAgICAgICAgaWYgKG1vdmVWZWN0b3IpIHtcclxuICAgICAgICAgICAgLy8gdGhlIGFjdGlvbiBpbnZvbHZlcyBtb3ZlbWVudCwgc28gdXBkYXRlIHNwcml0ZSBmYWNpbmdcclxuICAgICAgICAgICAgc3dpdGNoIChtb3ZlVmVjdG9yWzBdKSB7XHJcbiAgICAgICAgICAgICAgICBjYXNlIDE6XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hbmltYXRvci5zZXRBbmltYXRpb24oXCJyaWdodFwiKTtcclxuICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgIGNhc2UgLTE6XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hbmltYXRvci5zZXRBbmltYXRpb24oXCJsZWZ0XCIpO1xyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgY2FzZSAwOlxyXG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAobW92ZVZlY3RvclsxXSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmFuaW1hdG9yLnNldEFuaW1hdGlvbihcImRvd25cIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAtMTpcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuYW5pbWF0b3Iuc2V0QW5pbWF0aW9uKFwidXBcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBwYXRoQ2FsbG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gICAgICB9XHJcbiAgICAgICAgICAgIGlmICghdGhpcy5hY3Rpb24pIHtcclxuICAgICAgICAgICAgICAgIC8vICEhISEhIE1VU1QgY2hlY2sgaWYgdGFyZ2V0IGlzIHJlYWNoYWJsZSBiZWZvcmUgdGhpcyBwb2ludFxyXG4gICAgICAgICAgICAgICAgaWYgKGhhc0dvYWwgJiYgIWhhc1BhdGgpIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBjYWxjdWxhdGUgbmV3IHBhdGggaWYgbm8gcGF0aCBleGlzdHNcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnBhdGhUbyh0aGlzLmdvYWwudGFyZ2V0UG9zKTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5wYXRoLmxlbmd0aCA9PT0gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBubyBwYXRoIGZvdW5kXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZ29hbCA9IHRoaXMucGxhbldhbmRlckdvYWwoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaGFzR29hbCA9IHRoaXMuZ29hbCAhPSBudWxsO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBhdGhUbygoX2QgPSB0aGlzLmdvYWwpID09PSBudWxsIHx8IF9kID09PSB2b2lkIDAgPyB2b2lkIDAgOiBfZC50YXJnZXRQb3MpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBoYXNQYXRoID0gKChfZSA9IHRoaXMucGF0aCkgPT09IG51bGwgfHwgX2UgPT09IHZvaWQgMCA/IHZvaWQgMCA6IF9lLmxlbmd0aCkgPiAwO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKGhhc0dvYWwgJiYgaGFzUGF0aCkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKFwiaGFzIGdvYWwsIGhhcyBwYXRoLC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gICAgICAgICAgICB0aGlzLmdvYWwgPSBudWxsO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHRoaXMuYWN0aW9uID0gbnVsbDtcclxuICAgICAgICAgICAgcmV0dXJuIHJlcztcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIGdldERlc2NyaXB0aW9uKCkge1xyXG4gICAgICAgIGNvbnN0IGRlc2NyaXB0aW9uQmxvY2tzID0gW107XHJcbiAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgIGljb246IFBpbkljb24sXHJcbiAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAocG9pbnRlclRhcmdldCkgPT4gYCR7dGhpcy5wb3NpdGlvbi54fSwgJHt0aGlzLnBvc2l0aW9uLnl9YCxcclxuICAgICAgICB9KTtcclxuICAgICAgICBkZXNjcmlwdGlvbkJsb2Nrcy5wdXNoKHtcclxuICAgICAgICAgICAgaWNvbjogVHlwZUljb24sXHJcbiAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAoKSA9PiB0aGlzLnN1YlR5cGUsXHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgIGljb246IEdvYWxJY29uLFxyXG4gICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKCkgPT4geyB2YXIgX2E7IHJldHVybiAoKF9hID0gdGhpcy5nb2FsKSA9PT0gbnVsbCB8fCBfYSA9PT0gdm9pZCAwID8gdm9pZCAwIDogX2EubmFtZSkgfHwgXCItXCI7IH0sXHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgIGljb246IEFjdGlvbkljb24sXHJcbiAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAoKSA9PiB7IHZhciBfYTsgcmV0dXJuICgoX2EgPSB0aGlzLmFjdGlvbikgPT09IG51bGwgfHwgX2EgPT09IHZvaWQgMCA/IHZvaWQgMCA6IF9hLm5hbWUpIHx8IFwiLVwiOyB9LFxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIHJldHVybiBkZXNjcmlwdGlvbkJsb2NrcztcclxuICAgIH1cclxuICAgIHVwZGF0ZUZhY2luZyhtb3ZlVmVjdG9yKSB7XHJcbiAgICAgICAgaWYgKG1vdmVWZWN0b3IpIHtcclxuICAgICAgICAgICAgLy8gdGhlIGFjdGlvbiBpbnZvbHZlcyBtb3ZlbWVudCwgc28gdXBkYXRlIHNwcml0ZSBmYWNpbmdcclxuICAgICAgICAgICAgc3dpdGNoIChtb3ZlVmVjdG9yWzBdKSB7XHJcbiAgICAgICAgICAgICAgICBjYXNlIDE6XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hbmltYXRvci5zZXRBbmltYXRpb24oXCJyaWdodFwiKTtcclxuICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgIGNhc2UgLTE6XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hbmltYXRvci5zZXRBbmltYXRpb24oXCJsZWZ0XCIpO1xyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgY2FzZSAwOlxyXG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAobW92ZVZlY3RvclsxXSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmFuaW1hdG9yLnNldEFuaW1hdGlvbihcImRvd25cIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAtMTpcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuYW5pbWF0b3Iuc2V0QW5pbWF0aW9uKFwidXBcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICA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1xyXG4gICAgICAgIHRoaXMuZ2FtZS5yZW5kZXJlci5hZGRUb1NjZW5lKHRoaXMucG9zaXRpb24sIExheWVyLlBMQU5ULCB0aGlzLnNwcml0ZSk7XHJcbiAgICB9XHJcbiAgICBwbGFuKCkge1xyXG4gICAgICAgIHRoaXMuYWN0aW9uID0gbmV3IFdhaXRBY3Rpb24odGhpcy5nYW1lLCB0aGlzLCB0aGlzLnBvc2l0aW9uKTtcclxuICAgIH1cclxuICAgIGFjdCgpIHtcclxuICAgICAgICBjb25zb2xlLmxvZyhcIkFDVCAtIHNocnViIC0gVE9ET1wiKTtcclxuICAgICAgICAvLyB0aGlzLmFjdGlvbi5ydW4oKTtcclxuICAgICAgICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKCk7XHJcbiAgICB9XHJcbiAgICBnZXREZXNjcmlwdGlvbigpIHtcclxuICAgICAgICBjb25zdCBkZXNjcmlwdGlvbkJsb2NrcyA9IFtdO1xyXG4gICAgICAgIGRlc2NyaXB0aW9uQmxvY2tzLnB1c2goe1xyXG4gICAgICAgICAgICBpY29uOiBQaW5JY29uLFxyXG4gICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKCkgPT4gYCR7dGhpcy5wb3NpdGlvbi54fSwgJHt0aGlzLnBvc2l0aW9uLnl9YCxcclxuICAgICAgICB9KTtcclxuICAgICAgICBkZXNjcmlwdGlvbkJsb2Nrcy5wdXNoKHtcclxuICAgICAgICAgICAgaWNvbjogVHlwZUljb24sXHJcbiAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAoKSA9PiB0aGlzLnN1YlR5cGUsXHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgaWYgKHRoaXMuZ29hbCkge1xyXG4gICAgICAgICAgICBkZXNjcmlwdGlvbkJsb2Nrcy5wdXNoKHtcclxuICAgICAgICAgICAgICAgIGljb246IEdvYWxJY29uLFxyXG4gICAgICAgICAgICAgICAgZ2V0RGVzY3JpcHRpb246ICgpID0+IHRoaXMuZ29h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aCksXHJcbiAgICAgICAgICAgIHRydW5rQmFzZTogVHJlZVNwZWNpZXMuZ2VuZXJhdGVTcGVjaWVzVGV4dHVyZXMob3B0aW9ucy50ZXh0dXJlU2V0LnRydW5rQmFzZSksXHJcbiAgICAgICAgICAgIGxlYWY6IFRyZWVTcGVjaWVzLmdlbmVyYXRlU3BlY2llc1RleHR1cmVzKG9wdGlvbnMudGV4dHVyZVNldC5sZWFmKSxcclxuICAgICAgICB9O1xyXG4gICAgICAgIGNvbnNvbGUubG9nKFwibmV3IHRyZWUgc3BlY2llc1wiLCB0aGlzKTtcclxuICAgIH1cclxuICAgIHN0YXRpYyBnZW5lcmF0ZVNwZWNpZXNUZXh0dXJlcyhwYXRocykge1xyXG4gICAgICAgIHJldHVybiBwYXRocy5tYXAoKHBhdGgpID0+IHtcclxuICAgICAgICAgICAgY29uc3Qgc3ByaXRlID0gU3ByaXRlLmZyb20ocGF0aCk7XHJcbiAgICAgICAgICAgIGNvbnN0IHRleHR1cmUgPSBzcHJpdGUgPT09IG51bGwgfHwgc3ByaXRlID09PSB2b2lkIDAgPyB2b2lkIDAgOiBzcHJpdGUudGV4dHVyZTtcclxuICAgICAgICAgICAgaWYgKHNwcml0ZSkge1xyXG4gICAgICAgICAgICAgICAgc3ByaXRlLmRlc3Ryb3koKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICByZXR1cm4gdGV4dHVyZTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIHN0YXRpYyBwcm9jZXNzVHJlZVNwZWNpZXMoKSB7XHJcbiAgICAgICAgaWYgKFRyZWVTcGVjaWVzLnRyZWVTcGVjaWVzLmxlbmd0aClcclxuICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIGNvbnN0IHNwZWNpZXNEZWZzID0gW1xyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBpZDogXCJwaW5lXCIsXHJcbiAgICAgICAgICAgICAgICBuYW1lOiBcIlBpbmVcIixcclxuICAgICAgICAgICAgICAgIGljb25QYXRoOiBcInRyZWVfMDBcIixcclxuICAgICAgICAgICAgICAgIHRleHR1cmVTZXQ6IHtcclxuICAgICAgICAgICAgICAgICAgICB0cnVuazogW1widHJ1bmtfMDBcIiwgXCJ0cnVua18wMVwiLCBcInRydW5rXzAyXCJdLFxyXG4gICAgICAgICAgICAgICAgICAgIGJyYW5jaDogW1widHJ1bmtfMDBcIiwgXCJ0cnVua18wMVwiLCBcInRydW5rXzAyXCJdLFxyXG4gICAgICAgICAgICAgICAgICAgIHRydW5rQmFzZTogW1widHJ1bmtfYmFzZV9waW5lXCJdLFxyXG4gICAgICAgICAgICAgICAgICAgIGxlYWY6IFtcclxuICAgICAgICAgICAgICAgICAgICAgICAgXCJsZWFmX3BpbmVfMDBcIixcclxuICAgICAgICAgICAgICAgICAgICAgICAgXCJsZWFmX3BpbmVfMDFcIixcclxuICAgICAgICAgICAgICAgICAgICAgICAgXCJsZWFmX3BpbmVfMDJcIixcclxuICAgICAgICAgICAgICAgICAgICAgICAgXCJsZWFmX3BpbmVfMDNcIixcclxuICAgICAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIGdyb3d0aE9wdGlvbnM6IHtcclxuICAgICAgICAgICAgICAgICAgICB0ZW1wZXJhdHVyZToge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBtaW46IDAsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1heDogMTAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgICAgbW9pc3R1cmU6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWluOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXg6IDEwMCxcclxuICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgIGhlaWdodDoge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBtaW46IDAsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1heDogMTAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgICAgbGlnaHQ6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWluOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXg6IDEwMCxcclxuICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIGJyYW5jaFNlZ21lbnRXaWR0aERlZ3JhZGU6IDAuOTYsXHJcbiAgICAgICAgICAgICAgICBicmFuY2hTZWdtZW50V2lkdGhNaW46IDEuMixcclxuICAgICAgICAgICAgICAgIGJyYW5jaFNlZ21lbnRXaWR0aFJhbmdlOiAzLjUsXHJcbiAgICAgICAgICAgICAgICAvLyBtaW5UcnVua0Jhc2VTaXplOiAzLFxyXG4gICAgICAgICAgICAgICAgLy8gYnJhbmNoU2VnbWVudEhlaWdodE1pbjogNCxcclxuICAgICAgICAgICAgICAgIC8vIGJyYW5jaFNlZ21lbnRIZWlnaHRSYW5nZTogOCxcclxuICAgICAgICAgICAgICAgIC8vIGJyYW5jaFNlZ21lbnRIZWlnaHREZWdyYWRlOiAwLjk1LFxyXG4gICAgICAgICAgICAgICAgYnJhbmNoQ2hhbmNlOiAxLFxyXG4gICAgICAgICAgICAgICAgYnJhbmNoQ2hhbmNlR3JvdzogLTAuNixcclxuICAgICAgICAgICAgICAgIG1heEJyYW5jaGVzUGVyU2VnbWVudDogMixcclxuICAgICAgICAgICAgICAgIG1heEJyYW5jaGVzUGVyU2VnbWVudFJhbmdlOiAxLFxyXG4gICAgICAgICAgICAgICAgYnJhbmNoQ3VydmVBbmdsZTogMyxcclxuICAgICAgICAgICAgICAgIGJyYW5jaEZvcmtNaW46IDIzLFxyXG4gICAgICAgICAgICAgICAgYnJhbmNoRm9ya1JhbmdlOiAyMCxcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgaWQ6IFwiYmlyY2hcIixcclxuICAgICAgICAgICAgICAgIG5hbWU6IFwiQmlyY2hcIixcclxuICAgICAgICAgICAgICAgIGljb25QYXRoOiBcInRyZWVfMDFcIixcclxuICAgICAgICAgICAgICAgIHRleHR1cmVTZXQ6IHtcclxuICAgICAgICAgICAgICAgICAgICB0cnVuazogW1widHJ1bmtfMDNcIl0sXHJcbiAgICAgICAgICAgICAgICAgICAgYnJhbmNoOiBbXCJ0cnVua18wM1wiXSxcclxuICAgICAgICAgICAgICAgICAgICB0cnVua0Jhc2U6IFtcInRydW5rX2Jhc2VfYmlyY2hcIl0sXHJcbiAgICAgICAgICAgICAgICAgICAgbGVhZjogW1wibGVhZl9iaXJjaF8wMFwiLCBcImxlYWZfYmlyY2hfMDFcIiwgXCJsZWFmX2JpcmNoXzAyXCJdLFxyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIGdyb3d0aE9wdGlvbnM6IHtcclxuICAgICAgICAgICAgICAgICAgICB0ZW1wZXJhdHVyZToge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBtaW46IDAsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1heDogMTAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgICAgbW9pc3R1cmU6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWluOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXg6IDEwMCxcclxuICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgIGhlaWdodDoge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBtaW46IDAsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1heDogMTAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgICAgbGlnaHQ6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWluOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXg6IDEwMCxcclxuICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIHRydW5rU2VnbWVudENvdW50OiA1LFxyXG4gICAgICAgICAgICAgICAgdHJ1bmtTZWdtZW50SGVpZ2h0TWluOiA1LFxyXG4gICAgICAgICAgICAgICAgdHJ1bmtTZWdtZW50SGVpZ2h0UmFuZ2U6IDMsXHJcbiAgICAgICAgICAgICAgICB0cnVua1NlZ21lbnRXaWR0aE1pbjogNCxcclxuICAgICAgICAgICAgICAgIHRydW5rU2VnbWVudFdpZHRoUmFuZ2U6IDMsXHJcbiAgICAgICAgICAgICAgICB0cnVua1NlZ21lbnRXaWR0aERlZ3JhZGU6IDAuOTgsXHJcbiAgICAgICAgICAgICAgICBtaW5UcnVua0Jhc2VTaXplOiAzLFxyXG4gICAgICAgICAgICAgICAgYnJhbmNoU2VnbWVudEhlaWdodE1pbjogNCxcclxuICAgICAgICAgICAgICAgIGJyYW5jaFNlZ21lbnRIZWlnaHRSYW5nZTogOCxcclxuICAgICAgICAgICAgICAgIGJyYW5jaFNlZ21lbnRIZWlnaHREZWdyYWRlOiAwLjk1LFxyXG4gICAgICAgICAgICAgICAgYnJhbmNoU2VnbWVudFdpZHRoRGVncmFkZTogMC45LFxyXG4gICAgICAgICAgICAgICAgYnJhbmNoU2VnbWVudFdpZHRoTWluOiAwLjgxLFxyXG4gICAgICAgICAgICAgICAgYnJhbmNoU2VnbWVudFdpZHRoUmFuZ2U6IDAsXHJcbiAgICAgICAgICAgICAgICBicmFuY2hDaGFuY2U6IDAuOCxcclxuICAgICAgICAgICAgICAgIGJyYW5jaENoYW5jZUdyb3c6IC0wLjMzLFxyXG4gICAgICAgICAgICAgICAgbWF4QnJhbmNoZXNQZXJTZWdtZW50OiAyLFxyXG4gICAgICAgICAgICAgICAgbWF4QnJhbmNoZXNQZXJTZWdtZW50UmFuZ2U6IDEsXHJcbiAgICAgICAgICAgICAgICBicmFuY2hDdXJ2ZUFuZ2xlOiA1LFxyXG4gICAgICAgICAgICAgICAgYnJhbmNoRm9ya01pbjogMTAsXHJcbiAgICAgICAgICAgICAgICBicmFuY2hGb3JrUmFuZ2U6IDcsXHJcbiAgICAgICAgICAgICAgICBsZWFmRGlzdGFuY2U6IDEuOCxcclxuICAgICAgICAgICAgICAgIGxlYXZlc1BlckJyYW5jaE1pbjogMjUsXHJcbiAgICAgICAgICAgICAgICBsZWF2ZXNQZXJCcmFuY2hSYW5nZTogMTAsXHJcbiAgICAgICAgICAgICAgICBsZWF2ZXNQZXJCcmFuY2hEZW5zaXR5OiAxLjMsXHJcbiAgICAgICAgICAgICAgICBsZWFmU2l6ZVJhbmdlOiA2LFxyXG4gICAgICAgICAgICAgICAgbGVhZk1pblNpemU6IDgsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIGlkOiBcIm1hcGxlXCIsXHJcbiAgICAgICAgICAgICAgICBuYW1lOiBcIk1hcGxlXCIsXHJcbiAgICAgICAgICAgICAgICBpY29uUGF0aDogXCJ0cmVlXzAxXCIsXHJcbiAgICAgICAgICAgICAgICB0ZXh0dXJlU2V0OiB7XHJcbiAgICAgICAgICAgICAgICAgICAgdHJ1bms6IFtcInRydW5rXzAzXCJdLFxyXG4gICAgICAgICAgICAgICAgICAgIGJyYW5jaDogW1widHJ1bmtfMDNcIl0sXHJcbiAgICAgICAgICAgICAgICAgICAgdHJ1bmtCYXNlOiBbXCJ0cnVua19iYXNlX2JpcmNoXCJdLFxyXG4gICAgICAgICAgICAgICAgICAgIGxlYWY6IFtcImxlYWZfbWFwbGVfMDBcIiwgXCJsZWFmX21hcGxlXzAxXCIsIFwibGVhZl9tYXBsZV8wMlwiXSxcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBncm93dGhPcHRpb25zOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGVtcGVyYXR1cmU6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWluOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXg6IDEwMCxcclxuICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgIG1vaXN0dXJlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1pbjogMCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWF4OiAxMDAsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWluOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXg6IDEwMCxcclxuICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgIGxpZ2h0OiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1pbjogMCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWF4OiAxMDAsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIGlkOiBcImNvdHRvbmNhbmR5XCIsXHJcbiAgICAgICAgICAgICAgICBuYW1lOiBcIkNvdHRvbiBDYW5keVwiLFxyXG4gICAgICAgICAgICAgICAgaWNvblBhdGg6IFwidHJlZV8wMVwiLFxyXG4gICAgICAgICAgICAgICAgdGV4dHVyZVNldDoge1xyXG4gICAgICAgICAgICAgICAgICAgIHRydW5rOiBbXCJ0cnVua18wM1wiXSxcclxuICAgICAgICAgICAgICAgICAgICBicmFuY2g6IFtcInRydW5rXzAzXCJdLFxyXG4gICAgICAgICAgICAgICAgICAgIHRydW5rQmFzZTogW1widHJ1bmtfYmFzZV9iaXJjaFwiXSxcclxuICAgICAgICAgICAgICAgICAgICBsZWFmOiBbXCJsZWFmX3BpbmtfMDBcIiwgXCJsZWFmX3BpbmtfMDFcIiwgXCJsZWFmX3BpbmtfMDJcIl0sXHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgZ3Jvd3RoT3B0aW9uczoge1xyXG4gICAgICAgICAgICAgICAgICAgIHRlbXBlcmF0dXJlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1pbjogMCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWF4OiAxMDAsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgICAgICBtb2lzdHVyZToge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBtaW46IDAsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1heDogMTAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1pbjogMCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWF4OiAxMDAsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgICAgICBsaWdodDoge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBtaW46IDAsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1heDogMTAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgbWluTGVhZkFscGhhOiAwLjEsXHJcbiAgICAgICAgICAgICAgICBtYXhMZWFmQWxwaGE6IDAuNzUsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgXTtcclxuICAgICAgICBzcGVjaWVzRGVmcy5mb3JFYWNoKChzcGVjaWVzRGVmKSA9PiB7XHJcbiAgICAgICAgICAgIFRyZWVTcGVjaWVzLnRyZWVTcGVjaWVzW3NwZWNpZXNEZWYuaWRdID0gbmV3IFRyZWVTcGVjaWVzKHNwZ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lzLmJyYW5jaE9yZGVyLFxyXG4gICAgICAgICAgICBncm93TGVhdmVzOiBmYWxzZSxcclxuICAgICAgICAgICAgZG9uZUV4dGVuZGluZzogZmFsc2UsXHJcbiAgICAgICAgICAgIGRvbmVCcmFuY2hpbmc6IGZhbHNlLFxyXG4gICAgICAgICAgICBicmFuY2hDb3VudDogMCxcclxuICAgICAgICB9O1xyXG4gICAgICAgIHRoaXMuYnJhbmNoT3JkZXIgPSAwO1xyXG4gICAgICAgIC8vIGdlbmVyYXRlIGZpcnN0IHRydW5rIHNlZ21lbnRcclxuICAgICAgICAvLyBsZXQgd2lkdGggPSB0aGlzLnRydW5rU2VnbWVudFdpZHRoO1xyXG4gICAgICAgIGxldCBsZW5ndGggPSB0aGlzLmdldFJhbmRGcm9tKHRoaXMuc3BlY2llcy50cnVua1NlZ21lbnRIZWlnaHRNaW4sIHRoaXMuc3BlY2llcy50cnVua1NlZ21lbnRIZWlnaHRSYW5nZSk7XHJcbiAgICAgICAgbGV0IHgxID0geDtcclxuICAgICAgICBsZXQgeTEgPSB5O1xyXG4gICAgICAgIGxldCB4MiA9IHgxICsgdGhpcy5sZW5ndGhkaXJfeChsZW5ndGgsIHRoaXMuY3VydmUpO1xyXG4gICAgICAgIGxldCB5MiA9IHkxIC0gdGhpcy5sZW5ndGhkaXJfeShsZW5ndGgsIHRoaXMuY3VydmUpO1xyXG4gICAgICAgIGxldCBmaXJzdFRydW5rU2VnbWVudCA9IHtcclxuICAgICAgICAgICAgcG9zaXRpb246IG5ldyBQb2ludCh4MSwgeTEpLFxyXG4gICAgICAgICAgICB4MTogeDEsXHJcbiAgICAgICAgICAgIHkxOiB5MSxcclxuICAgICAgICAgICAgeDI6IHgyLFxyXG4gICAgICAgICAgICB5MjogeTIsXHJcbiAgICAgICAgICAgIGN1cnZlOiB0aGlzLmN1cnZlLFxyXG4gICAgICAgICAgICBsZW5ndGg6IGxlbmd0aCxcclxuICAgICAgICAgICAgd2lkdGg6IHRoaXMudHJ1bm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ICAgbGVuZ3RoID0gdGhpcy5zcGVjaWVzLmJyYW5jaFNlZ21lbnRIZWlnaHRNaW47XHJcbiAgICAgICAgICAgIGxldCB4MSA9IGxhc3RTZWdtZW50LngyO1xyXG4gICAgICAgICAgICBsZXQgeTEgPSBsYXN0U2VnbWVudC55MjtcclxuICAgICAgICAgICAgbGV0IHgyID0geDEgKyB0aGlzLmxlbmd0aGRpcl94KGxlbmd0aCwgdGhpcy5jdXJ2ZSk7XHJcbiAgICAgICAgICAgIGxldCB5MiA9IHkxIC0gdGhpcy5sZW5ndGhkaXJfeShsZW5ndGgsIHRoaXMuY3VydmUpO1xyXG4gICAgICAgICAgICBsZXQgbmV3U2VnbWVudCA9IHtcclxuICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBuZXcgUG9pbnQoeDEsIHkxKSxcclxuICAgICAgICAgICAgICAgIHgxOiB4MSxcclxuICAgICAgICAgICAgICAgIHkxOiB5MSxcclxuICAgICAgICAgICAgICAgIHgyOiB4MixcclxuICAgICAgICAgICAgICAgIHkyOiB5MixcclxuICAgICAgICAgICAgICAgIGN1cnZlOiB0aGlzLmN1cnZlLFxyXG4gICAgICAgICAgICAgICAgbGVuZ3RoOiBsZW5ndGgsXHJcbiAgICAgICAgICAgICAgICB3aWR0aDogd2lkdGgsXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHRoaXMudHJlZVRydW5rLnNlZ21lbnRzLnB1c2gobmV3U2VnbWVudCk7XHJcbiAgICAgICAgICAgIGlmICh0aGlzLnRyZWVUcnVuay5zZWdtZW50cy5sZW5ndGggPT09IHRydW5rU2VnbWVudHMpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMudHJlZVRydW5rLmRvbmVFeHRlbmRpbmcgPSB0cnVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICB9XHJcbiAgICBncm93VHJlZUJyYW5jaGVzKCkge1xyXG4gICAgICAgIC8vIGFkZCBicmFuY2hlcyB0byB0cnVua1xyXG4gICAgICAgIC8vIG9yIGFkZCBicmFuY2hlcyB0byBleGlzdGluZyBicmFuY2hlc1xyXG4gICAgICAgIGxldCBncm93U3VjY2VzcyA9IGZhbHNlO1xyXG4gICAgICAgIC8vIGFkZCBmaXJzdCBicmFuY2ggdG8gdHJ1bmtcclxuICAgICAgICBpZiAodGhpcy50cmVlQnJhbmNoZXMubGVuZ3RoID09PSAwKSB7XHJcbiAgICAgICAgICAgIGxldCBsYXN0U2VnbWVudCA9IHRoaXMudHJlZVRydW5rLnNlZ21lbnRzW3RoaXMudHJlZVRydW5rLnNlZ21lbnRzLmxlbmd0aCAtIDFdO1xyXG4gICAgICAgICAgICB0aGlzLmN1cnZlID1cclxuICAgICAgICAgICAgICAgIGxhc3RTZWdtZW50LmN1cnZlICtcclxuICAgICAgICAgICAgICAgICAgICAodGhpcy5zcGVjaWVzLmJyYW5jaEZvcmtNaW4gK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBSTkcuZ2V0VW5pZm9ybSgpICogdGhpcy5zcGVjaWVzLmJyYW5jaEZvcmtSYW5nZSkgKlxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmN1cnZlRGlyO1xyXG4gICAgICAgICAgICBsZXQgd2lkdGggPSBsYXN0U2VnbWVudC53aWR0aDtcclxuICAgICAgICAgICAgbGV0IGxlbmd0aCA9IGxhc3RTZWdtZW50Lmxlbmd0aDtcclxuICAgICAgICAgICAgd2lkdGggKj0gdGhpcy5zcGVjaWVzLmJyYW5jaFNlZ21lbnRXaWR0aERlZ3JhZGU7XHJcbiAgICAgICAgICAgIGlmICh3aWR0aCA8IHRoaXMuc3BlY2llcy5icmFuY2hTZWdtZW50V2lkdGhNaW4pIHtcclxuICAgICAgICAgICAgICAgIHdpZHRoID0gdGhpcy5zcGVjaWVzLmJyYW5jaFNlZ21lbnRXaWR0aE1pbjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBsZW5ndGggKj0gdGhpcy5zcGVjaWVzLmJyYW5jaFNlZ21lbnRIZWlnaHREZWdyYWRlO1xyXG4gICAgICAgICAgICBpZiAobGVuZ3RoIDwgdGhpcy5zcGVjaWVzLmJyYW5jaFNlZ21lbnRIZWlnaHRNaW4pIHtcclxuICAgICAgICAgICAgICAgIGxlbmd0aCA9IHRoaXMuc3BlY2llcy5icmFuY2hTZWdtZW50SGVpZ2h0TWluO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGxldCB4MSA9IGxhc3RTZWdtZW50LngyICsgdGhpcy5sZW5ndGhkaXJfeChsZW5ndGgsIHRoaXMuY3VydmUpIC8gMjtcclxuICAgICAgICAgICAgbGV0IHkxID0gbGFzdFNlZ21lbnQueTIgKyB0aGlzLmxlbmd0aGRpcl95KGxlbmd0aCwgdGhpcy5jdXJ2ZSkgLyAzO1xyXG4gICAgICAgICAgICBsZXQgeDIgPSB4MSArIHRoaXMubGVuZ3RoZGlyX3gobGVuZ3RoLCB0aGlzLmN1cnZlKTtcclxuICAgICAgICAgICAgbGV0IHkyID0geTEgLSB0aGlzLmxlbmd0aGRpcl95KGxlbmd0aCwgdGhpcy5jdXJ2ZSk7XHJcbiAgICAgICAgICAgIGxldCBuZXdCcmFuY2ggPSB7XHJcbiAgICAgICAgICAgICAgICBzZWdtZW50czogW1xyXG4gICAgICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IG5ldyBQb2ludCh4MSwgeTEpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB4MTogeDEsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHkxOiB5MSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgeDI6IHgyLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB5MjogeTIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN1cnZlOiB0aGlzLmN1cnZlLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBsZW5ndGg6IGxlbmd0aCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IHdpZHRoLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICAgICAgZ3Jvd0xlYXZlczogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICBkb25lRXh0ZW5kaW5nOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgIGRvbmVCcmFuY2hpbmc6IGZhbHNlLFxyXG4gICAgICAgICAgICAgICAgb3JkZXI6IHRoaXMuYnJhbmNoT3JkZXIsXHJcbiAgICAgICAgICAgICAgICBicmFuY2hDb3VudDogMCxcclxuICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgdGhpcy50cmVlQnJhbmNoZXMucHVzaChuZXdCcmFuY2gpO1xyXG4gICAgICAgICAgICB0aGlzLmJyYW5jaE9yZGVyKys7XHJcbiAgICAgICAgICAgIHRoaXMuY3VydmVEaXIgPSBSTkcuZ2V0VW5pZm9ybSgpID4gMC41ID8gMSA6IC0xOyAvLyByZXNldCBjdXJ2ZSBkaXJcclxuICAgICAgICAgICAgdGhpcy5jdXJ2ZSArPVxyXG4gICAgICAgICAgICAgICAgUk5HLmdldFVuaWZvcm0oKSAqIHRoaXMuc3BlY2llcy5icmFuY2hDdXJ2ZUFuZ2xlICogdGhpcy5jdXJ2ZURpcjsgLy8gc2V0IG5ldyBjdXJ2ZSBkaXJcclxuICAgICAgICAgICAgZ3Jvd1N1Y2Nlc3MgPSB0cnVlO1xyXG4gICAgICAgIH1cclxuICAgICAgICAvLyBleHRlbmQgZXhpc3RpbmcgYnJhbmNoZXNcclxuICAgICAgICBpZiAoIWdyb3dTdWNjZXNzKSB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IHRyZWVCcmFuY2ggb2YgdGhpcy50cmVlQnJhbmNoZXMpIHtcclxuICAgICAgICAgICAgICAgIGlmICghdHJlZUJyYW5jaC5kb25lRXh0ZW5kaW5nKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxhc3RTZWdtZW50ID0gdHJlZUJyYW5jaC5zZWdtZW50c1t0cmVlQnJhbmNoLnNlZ21lbnRzLmxlbmd0aCAtIDFdO1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCB3aWR0aCA9IGxhc3RTZWdtZW50LndpZHRoO1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBsZW5ndGggPSBsYXN0U2VnbWVudC5sZW5ndGg7XHJcbiAgICAgICAgICAgICAgICAgICAgd2lkdGggKj0gdGhpcy5zcGVjaWVzLmJyYW5jaFNlZ21lbnRXaWR0aERlZ3JhZGU7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHdpZHRoIDwgdGhpcy5zcGVjaWVzLmJyYW5jaFNlZ21lbnRXaWR0aE1pbilcclxuICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGggPSB0aGlzLnNwZWNpZXMuYnJhbmNoU2VnbWVudFdpZHRoTWluO1xyXG4gICAgICAgICAgICAgICAgICAgIGxlbmd0aCAqPSB0aGlzLnNwZWNpZXMuYnJhbmNoU2VnbWVudEhlaWdodERlZ3JhZGU7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxlbmd0aCA8IHRoaXMuc3BlY2llcy5icmFuY2hTZWdtZW50SGVpZ2h0TWluKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSB0aGlzLnNwZWNpZXMuYnJhbmNoU2VnbWVudEhlaWdodE1pbjtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgeDEgPSBsYXN0U2VnbWVudC54MjtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgeTEgPSBsYXN0U2VnbWVudC55MjtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgeDIgPSB4MSArIHRoaXMubGVuZ3RoZGlyX3gobGVuZ3RoLCB0aGlzLmN1cnZlKTtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgeTIgPSB5MSAtIHRoaXMubGVuZ3RoZGlyX3kobGVuZ3RoLCB0aGlzLmN1cnZlKTtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgbmV3U2VnbWVudCA9IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IG5ldyBQb2ludCh4MSwgeTEpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB4MTogeDEsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHkxOiB5MSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgeDI6IHgyLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB5MjogeTIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN1cnZlOiB0aGlzLmN1cnZlLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBsZW5ndGg6IGxlbmd0aCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IHdpZHRoLFxyXG4gICAgICAgICAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgICAgICAgICAgdHJlZUJyYW5jaC5zZWdtZW50cy5wdXNoKG5ld1NlZ21lbnQpO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0cmVlQnJhbmNoLnNlZ21lbnRzLmxlbmd0aCA+PSB0aGlzLnNwZWNpZXMuYnJhbmNoU2VnbWVudENvdW50KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyZWVCcmFuY2guZG9uZUV4dGVuZGluZyA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYnJhbmNoT3JkZXIrKztcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmN1cnZlRGlyID0gUk5HLmdldFVuaWZvcm0oKSA+IDAuNSA/IDEgOiAtMTsgLy8gcmVzZXQgY3VydmUgZGlyXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jdXJ2ZSArPVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBSTkcuZ2V0VW5pZm9ybSgpICogdGhpcy5zcGVjaWVzLmJyYW5jaEN1cnZlQW5nbGUgKiB0aGlzLmN1cnZlRGlyOyAvLyBzZXQgbmV3IGN1cnZlIGRpclxyXG4gICAgICAgICAgICAgICAgICAgIGdyb3dTdWNjZXNzID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICAvLyBhZGQgYSBuZXcgYnJhbmNoIHRvIGFuIGV4aXN0aW5nIHNlZ21lbnQvYnJhbmNoXHJcbiAgICAgICAgLy8gc3RhcnRpbmcgZnJvbSB0b3Agb2YgdHJlZVxyXG4gICAgICAgIGlmICghZ3Jvd1N1Y2Nlc3MpIHtcclxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aGlzLnRyZWVCcmFuY2hlcy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgLy8gc3RhcnQgYXQgdGhlIGJvdHRvbSBvZiB0aGUgdHJlZSBmb3IgYmV0dGVyIGxvb2tpbmcgYnJhbmNoaW5nXHJcbiAgICAgICAgICAgICAgICAvLyBsZXQgdHJlZUJyYW5jaCA9IHRoaXMudHJlZUJyYW5jaGVzW2ldO1xyXG4gICAgICAgICAgICAgICAgbGV0IHRyZWVCcmFuY2ggPSBSTkcuZ2V0SXRlbSh0aGlzLnRyZWVCcmFuY2hlcyk7XHJcbiAgICAgICAgICAgICAgICBpZiAoIXRyZWVCcmFuY2gpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICh0cmVlQnJhbmNoLmJyYW5jaENvdW50IDwgdGhpcy5icmFuY2hlc1BlclNlZ21lbnQgJiZcclxuICAgICAgICAgICAgICAgICAgICAhdHJlZUJyYW5jaC5kb25lQnJhbmNoaW5nKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gY29uc3QgcmFuZFNlZ21lbnQgPSBSTkcuZ2V0SXRlbSh0cmVlQnJhbmNoLnNlZ21lbnRzKTtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCByYW5kU2VnbWVudCA9IGdldEl0ZW1Gcm9tUmFuZ2UodHJlZUJyYW5jaC5zZWdtZW50cywgMiwgdHJlZUJyYW5jaC5zZWdtZW50cy5sZW5ndGggLSAxKTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIXJhbmRTZWdtZW50IHx8XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIChyYW5kU2VnbWVudCA9PT0gbnVsbCB8fCByYW5kU2VnbWVudCA9PT0gdm9pZCAwID8gdm9pZCAwIDogcmFuZFNlZ21lbnQud2lkdGgpIDw9IHRoaXMuc3BlY2llcy5icmFuY2hTZWdtZW50V2lkdGhNaW4pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3VydmUgPVxyXG4gICAgICAgICAgICAgICAgICAgICAgICByYW5kU2VnbWVudC5jdXJ2ZSArXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAodGhpcy5zcGVjaWVzLmJyYW5jaEZvcmtNaW4gK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJORy5nZXRVbmlmb3JtKCkgKiB0aGlzLnNwZWNpZXMuYnJhbmNoRm9ya1JhbmdlKSAqXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFJORy5nZXRVbmlmb3JtKCkgPiAwLjUgPyAxIDogLTEpO1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCB3aWR0aCA9IHJhbmRTZWdtZW50LndpZHRoO1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBsZW5ndGggPSByYW5kU2VnbWVudC5sZW5ndGg7XHJcbiAgICAgICAgICAgICAgICAgICAgd2lkdGggKj0gdGhpcy5zcGVjaWVzLmJyYW5jaFNlZ21lbnRXaWR0aERlZ3JhZGU7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHdpZHRoIDwgdGhpcy5zcGVjaWVzLmJyYW5jaFNlZ21lbnRXaWR0aE1pbilcclxuICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGggPSB0aGlzLnNwZWNpZXMuYnJhbmNoU2VnbWVudFdpZHRoTWluO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChsZW5ndGggPCB0aGlzLnNwZWNpZXMuYnJhbmNoU2VnbWVudEhlaWdodE1pbilcclxuICAgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gdGhpcy5zcGVjaWVzLmJyYW5jaFNlZ21lbnRIZWlnaHRNaW47XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IHgxID0gcmFuZFNlZ21lbnQueDI7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IHkxID0gcmFuZFNlZ21lbnQueTI7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IHgyID0geDEgKyB0aGlzLmxlbmd0aGRpcl94KGxlbmd0aCwgdGhpcy5jdXJ2ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IHkyID0geTEgLSB0aGlzLmxlbmd0aGRpcl95KGxlbmd0aCwgdGhpcy5jdXJ2ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcmFuZCA9IFJORy5nZXRVbmlmb3JtKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IGRvbmVCcmFuY2hpbmcgPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgICAgICBkb25lQnJhbmNoaW5nID0gcmFuZCA+IHRoaXMuYnJhbmNoQ2hhbmNlO1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGlmIChpc1RyZWVUcnVuayh0cmVlQnJhbmNoKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vICAgZG9uZUJyYW5jaGluZyA9IGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gICBkb25lQnJhbmNoaW5nID0gcmFuZCA+IHRoaXMuYnJhbmNoQ2hhbmNlO1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIH1cclxuICAgICAgICAgICAgICAgICAgICAvLyBpZiAoaXNUcmVlVHJ1bmsodHJlZUJyYW5jaCkpIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyAgIC8vIHRyZWUgdHJ1bmsgaXMgbGVzcyBsaWtlbHkgdG8gZmluaXNoIGJyYW5jaGluZ1xyXG4gICAgICAgICAgICAgICAgICAgIC8vICAgaWYgKFJORy5nZXRVbmlmb3JtKCkgPiAwLjYpIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyAgICAgZG9uZUJyYW5jaGluZyA9IHJhbmQgPiB0aGlzLmJyYW5jaENoYW5jZTtcclxuICAgICAgICAgICAgICAgICAgICAvLyAgIH1cclxuICAgICAgICAgICAgICAgICAgICAvLyB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vICAgZG9uZUJyYW5jaGluZyA9IHJhbmQgPiB0aGlzLmJyYW5jaENoYW5jZTtcclxuICAgICAgICAgICAgICAgICAgICAvLyB9XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IG5ld0JyYW5jaCA9IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgc2VnbWVudHM6IFtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogbmV3IFBvaW50KHgxLCB5MSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeDE6IHgxLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHkxOiB5MSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4MjogeDIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeTI6IHkyLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnZlOiB0aGlzLmN1cnZlLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aDogbGVuZ3RoLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiB3aWR0aCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGdyb3dMZWF2ZXM6IHRydWUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvbmVFeHRlbmRpbmc6IGZhbHNlLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzdG9wIHNvbWUgYnJhbmNoZXMgZnJvbSBicmFuY2hpbmcgdG8ga2VlcCB0cmVlIGZyb20gZ2V0dGluZyB0b28gZGVuc2VcclxuICAgICAgICAgICAgICAgICAgICAgICAgZG9uZUJyYW5jaGluZyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgb3JkZXI6IHRoaXMuYnJhbmNoT3JkZXIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyYW5jaENvdW50OiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy50cmVlQnJhbmNoZXMucHVzaChuZXdCcmFuY2gpO1xyXG4gICAgICAgICAgICAgICAgICAgIHRyZWVCcmFuY2guYnJhbmNoQ291bnQrKztcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmJyYW5jaE9yZGVyKys7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5icmFuY2hDaGFuY2UgKz0gdGhpcy5zcGVjaWVzLmJyYW5jaENoYW5jZUdyb3c7IC8vIGdyb3cgYnJhbmNoIGNoYW5jZSBldmVyeSB0aW1lIHRyZWUgZ3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AgICAgICAgICAgICAgc2NhbGU6IHRydWUsXHJcbiAgICAgICAgICAgICAgICB0aW50OiB0cnVlLFxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBncm93dGhTdGVwczsgaSsrKSB7XHJcbiAgICAgICAgICAgIGlmICh0aGlzLnRyZWVCcmFuY2hlcy5sZW5ndGggPiAxKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBvbmx5IHN0YXJ0IGdyb3dpbmcgbGVhdmVzIG9uY2UgdGhlcmUgYXJlIGJyYW5jaGVzXHJcbiAgICAgICAgICAgICAgICB0aGlzLnJlbmRlckxlYXZlcyh0aW50KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAodGhpcy5mdWxseUdyb3duKSB7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvLyBhZGQgdHJ1bmtcclxuICAgICAgICAgICAgZ3Jvd1N1Y2Nlc3MgPSB0aGlzLnJlbmRlckJyYW5jaCh0aGlzLnRyZWVUcnVuaywgdGludCk7XHJcbiAgICAgICAgICAgIGlmICghZ3Jvd1N1Y2Nlc3MpIHtcclxuICAgICAgICAgICAgICAgIC8vIGFkZCBicmFuY2hlcyB0byB0cnVua1xyXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgdHJlZUJyYW5jaCBvZiB0aGlzLnRyZWVCcmFuY2hlcykge1xyXG4gICAgICAgICAgICAgICAgICAgIGdyb3dTdWNjZXNzID0gdGhpcy5yZW5kZXJCcmFuY2godHJlZUJyYW5jaCwgdGludCk7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGdyb3dTdWNjZXNzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAg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hbmNoIC8gNDtcclxuICAgICAgICBjb25zdCBtYXhMZWF2ZXMgPSB0aGlzLmxlYXZlc1BlckJyYW5jaCAqXHJcbiAgICAgICAgICAgIHRoaXMudHJlZUJyYW5jaGVzLmxlbmd0aCAqXHJcbiAgICAgICAgICAgIHRoaXMuc3BlY2llcy5sZWF2ZXNQZXJCcmFuY2hEZW5zaXR5O1xyXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbGVhZnNQZXJHcm93dGg7IGkrKykge1xyXG4gICAgICAgICAgICBpZiAodGhpcy5sZWFmU3ByaXRlcy5sZW5ndGggPj0gbWF4TGVhdmVzKSB7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjb25zdCBsZWFmUm90ID0gUk5HLmdldFVuaWZvcm0oKSAqIDM2MDtcclxuICAgICAgICAgICAgLy8gZ2V0IG5ld2VyIGJyYW5jaGVzIGZpcnN0XHJcbiAgICAgICAgICAgIGxldCByYW5kb21WYWx1ZSA9IE1hdGgucG93KFJORy5nZXRVbmlmb3JtKCksIDIpO1xyXG4gICAgICAgICAgICBsZXQgYnJhbmNoSW5kZXggPSBNYXRoLmZsb29yKCgxIC0gcmFuZG9tVmFsdWUpICogdGhpcy50cmVlQnJhbmNoZXMubGVuZ3RoKTtcclxuICAgICAgICAgICAgbGV0IGJyYW5jaCA9IHRoaXMudHJlZUJyYW5jaGVzW2JyYW5jaEluZGV4XTtcclxuICAgICAgICAgICAgaWYgKCFicmFuY2guZ3Jvd0xlYXZlcykge1xyXG4gICAgICAgICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgbGV0IHNlZ21lbnQgPSBSTkcuZ2V0SXRlbSgoYnJhbmNoID09PSBudWxsIHx8IGJyYW5jaCA9PT0gdm9pZCAwID8gdm9pZCAwIDogYnJhbmNoLnNlZ21lbnRzKSB8fCBbXSk7XHJcbiAgICAgICAgICAgIGlmICghY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QnJhbmNoICpcclxuICAgICAgICAgICAgdGhpcy5zcGVjaWVzLmxlYXZlc1BlckJyYW5jaERlbnNpdHk7XHJcbiAgICAgICAgY29uc3QgdGltZVNjYWxlID0gdGhpcy5nYW1lLnRpbWVNYW5hZ2VyLnRpbWVTY2FsZTtcclxuICAgICAgICAvLyBmdWRnZWQgbmV4dExlYWZDb3VudCBjYWxjLCBidXQgZG9lc24ndCByZWFsbHkgbWF0dGVyXHJcbiAgICAgICAgY29uc3QgbmV4dExlYWZDb3VudCA9IHRoaXMubGVhZlNwcml0ZXMubGVuZ3RoICtcclxuICAgICAgICAgICAgdGhpcy5sZWF2ZXNQZXJCcmFuY2ggKiB0aGlzLnNwZWNpZXMubGVhdmVzUGVyQnJhbmNoRGVuc2l0eTtcclxuICAgICAgICBjb25zdCBkZWFkTGVhZkNvdW50ID0gMztcclxuICAgICAgICBsZXQgbmV3QWxwaGEgPSAxO1xyXG4gICAgICAgIGxldCBuZXdTY2FsZSA9IDE7XHJcbiAgICAgICAgbGV0IGxlYWZJbmRleCA9IDA7XHJcbiAgICAgICAgbGV0IGxlYWY7XHJcbiAgICAgICAgaWYgKG5leHRMZWFmQ291bnQgPj0gbWF4TGVhdmVzKSB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZGVhZExlYWZDb3VudDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICBsZWFmID0gdGhpcy5sZWFmU3ByaXRlc1tpXTtcclxuICAgICAgICAgICAgICAgIGlmICghbGVhZilcclxuICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgIGxlYWZJbmRleCA9IHRoaXMubGVhZlNwcml0ZXMuaW5kZXhPZihsZWFmKTtcclxuICAgICAgICAgICAgICAgIGxlYWYueSArPSBSTkcuZ2V0VW5pZm9ybSgpICogOCAqIHRpbWVTY2FsZTtcclxuICAgICAgICAgICAgICAgIC8vIGdlbnRsZSBzd2F5XHJcbiAgICAgICAgICAgICAgICBsZWFmLnggKz0gKFJORy5nZXRVbmlmb3JtKCkgKiAyIC0gMSkgKiB0aW1lU2NhbGU7XHJcbiAgICAgICAgICAgICAgICBsZWFmLnJvdGF0aW9uICs9IChSTkcuZ2V0VW5pZm9ybSgpICogMiAtIDEpICogdGltZVNjYWxlO1xyXG4gICAgICAgICAgICAgICAgaWYgKGxlYWYueSA+PSAtMjApIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBmYWRlIHRoZSBsZWFmIG91dCBhcyBpdCByZWFjaGVzIHRoZSBncm91bmRcclxuICAgICAgICAgICAgICAgICAgICBuZXdBbHBoYSA9IGxlYWYuYWxwaGEgLSAwLjEyICogdGltZVNjYWxlO1xyXG4gICAgICAgICAgICAgICAgICAgIG5ld0FscGhhID0gbmV3QWxwaGEgPCAwID8gMCA6IG5ld0FscGhhO1xyXG4gICAgICAgICAgICAgICAgICAgIGxlYWYuYWxwaGEgPSBuZXdBbHBoYTtcclxuICAgICAgICAgICAgICAgICAgICBuZXdTY2FsZSA9IGxlYWYuc2NhbGUueCAtIDAuMDMgKiB0aW1lU2NhbGU7XHJcbiAgICAgICAgICAgICAgICAgICAgbmV3U2NhbGUgPSBuZXdTY2FsZSA8IDAuNCA/IDAuNCA6IG5ld1NjYWxlO1xyXG4gICAgICAgICAgICAgICAgICAgIGxlYWYuc2NhbGUuc2V0KG5ld1NjYWxlKTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAobGVhZi55ID49IDApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbGVhZi5kZXN0cm95KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMubGVhZlNwcml0ZXMuc3BsaWNlKGxlYWZJbmRleCwgMSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgZ2V0RGVzY3JpcHRpb24oKSB7XHJcbiAgICAgICAgY29uc3QgZGVzY3JpcHRpb25CbG9ja3MgPSBbXTtcclxuICAgICAgICBkZXNjcmlwdGlvbkJsb2Nrcy5wdXNoKHtcclxuICAgICAgICAgICAgaWNvbjogUGluSWNvbixcclxuICAgICAgICAgICAgZ2V0RGVzY3JpcHRpb246IChwb2ludGVyVGFyZ2V0KSA9PiBgJHtwb2ludGVyVGFyZ2V0ID09PSBudWxsIHx8IHBvaW50ZXJUYXJnZXQgPT09IHZvaWQgMCA/IHZvaWQgMCA6IHBvaW50ZXJUYXJnZXQucG9zaXRpb24ueH0sICR7cG9pbnRlclRhcmdldCA9PT0gbnVsbCB8fCBwb2ludGVyVGFyZ2V0ID09PSB2b2lkIDAgPyB2b2lkIDAgOiBwb2ludGVyVGFyZ2V0LnBvc2l0aW9uLnl9YCxcclxuICAgICAgICB9KTtcclxuICAgICAgICBkZXNjcmlwdGlvbkJsb2Nrcy5wdXNoKHtcclxuICAgICAgICAgICAgaWNvbjogVHlwZUljb24sXHJcbiAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAoKSA9PiB0aGlzLnN1YlR5cGUsXHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgaWYgKHRoaXMuZ29hbCkge1xyXG4gICAgICAgICAgICBkZXNjcmlwdGlvbkJsb2Nrcy5wdXNoKHtcclxuICAgICAgICAgICAgICAgIGljb246IEdvYWxJY29uLFxyXG4gICAgICAgICAgICAgICAgZ2V0RGVzY3JpcHRpb246ICgpID0+IHRoaXMuZ29hbC5uYW1lLFxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHRoaXMuYWN0aW9uKSB7XHJcbiAgICAgICAgICAgIGRlc2NyaXB0aW9uQmxvY2tzLnB1c2goe1xyXG4gICAgICAgICAgICAgICAgaWNvbjogQWN0aW9uSWNvbixcclxuICAgICAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAoKSA9PiB0aGlzLmFjdGlvbi5uYW1lLFxyXG4gICAgICAgICA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xhc3MgR2FtZSB7XHJcbiAgICBjb25zdHJ1Y3RvcigpIHtcclxuICAgICAgICAvLyBzdGFydGluZyBvcHRpb25zXHJcbiAgICAgICAgdGhpcy5vcHRpb25zID0ge1xyXG4gICAgICAgICAgICBzaG91bGRBdXRvdGlsZTogdHJ1ZSxcclxuICAgICAgICAgICAgc2hvdWxkUmVuZGVyOiB0cnVlLFxyXG4gICAgICAgICAgICBzaG93Q2xvdWRzOiB0cnVlLFxyXG4gICAgICAgICAgICBhbmltYXRlU2hhZG93czogdHJ1ZSxcclxuICAgICAgICAgICAgZW50aXR5Q291bnQ6IDQ1LFxyXG4gICAgICAgICAgICB0cmVlQ291bnQ6IDEwMCxcclxuICAgICAgICAgICAgc2hydWJDb3VudDogMTAsXHJcbiAgICAgICAgICAgIGdhbWVTaXplOiB7XHJcbiAgICAgICAgICAgICAgICB3aWR0aDogMjAwLFxyXG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAyMDAsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIGRheVN0YXJ0OiB0cnVlLFxyXG4gICAgICAgICAgICAvLyBnYW1lU2VlZDogMTIzNCxcclxuICAgICAgICAgICAgLy8gZ2FtZVNlZWQ6IDYxMDIzOSxcclxuICAgICAgICAgICAgZ2FtZVNlZWQ6IDU5NDYyOCxcclxuICAgICAgICAgICAgLy8gZ2FtZVNlZWQ6IG51bGwsXHJcbiAgICAgICAgICAgIHR1cm5BbmltRGVsYXk6IDUwMCxcclxuICAgICAgICAgICAgbWFpbkxvb3BSYXRlOiAxMDAwIC8gNjAsXHJcbiAgICAgICAgICAgIHJlZnJlc2hSYXRlOiAxMDAwIC8gNjAsXHJcbiAgICAgICAgICAgIGdhbWVMb29wUmF0ZTogMTAwMCAvIDEwLFxyXG4gICAgICAgICAgICB1aUxvb3BSYXRlOiAxMDAwIC8gMTAsXHJcbiAgICAgICAgICAgIG1heFRpY2tSYXRlOiAxMDAwIC8gNjAsXHJcbiAgICAgICAgICAg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hpcy5tYXAuYmlvbWVNYXBbTWFwV29ybGQuY29vcmRzVG9LZXkoeCwgeSldLFxyXG4gICAgICAgIH07XHJcbiAgICB9XHJcbiAgICBnZXRFbnRpdHlBdCh4LCB5KSB7XHJcbiAgICAgICAgZm9yIChsZXQgZW50aXR5IG9mIHRoaXMuZW50aXRpZXMpIHtcclxuICAgICAgICAgICAgaWYgKGVudGl0eS5wb3NpdGlvbi54ID09PSB4ICYmIGVudGl0eS5wb3NpdGlvbi55ID09PSB5KSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gZW50aXR5O1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBudWxsO1xyXG4gICAgfVxyXG4gICAgZ2V0UGxhbnRBdCh4LCB5KSB7XHJcbiAgICAgICAgZm9yIChsZXQgcGxhbnQgb2YgdGhpcy5wbGFudHMpIHtcclxuICAgICAgICAgICAgaWYgKHBsYW50LnBvc2l0aW9uLnggPT09IHggJiYgcGxhbnQucG9zaXRpb24ueSA9PT0geSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHBsYW50O1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBudWxsO1xyXG4gICAgfVxyXG4gICAgZ2V0UmFuZG9tVGlsZVBvc2l0aW9ucyh0eXBlLCBxdWFudGl0eSA9IDEpIHtcclxuICAgICAgICByZXR1cm4gdGhpcy5tYXAuZ2V0UmFuZG9tVGlsZVBvc2l0aW9ucyh0eXBlLCBxdWFudGl0eSk7XHJcbiAgICB9XHJcbiAgICBnZXRSYW5kb21QbGFudFBvc2l0aW9ucyh0eXBlLCBxdWFudGl0eSA9IDEpIHtcclxuICAgICAgICBsZXQgYnVmZmVyID0gW107XHJcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xyXG4gICAgICAgIGZvciAobGV0IGtleSBpbiB0aGlzLnBsYW50cykge1xyXG4gICAgICAgICAgICBpZiAodGhpcy5wbGFudHNba2V5XS50eXBlID09PSB0eXBlKSB7XHJcbiAgICAgICAgICAgICAgICBidWZmZXIucHVzaCh0aGlzLnBsYW50c1trZXldLnBvc2l0aW9uKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBsZXQgaW5kZXg7XHJcbiAgICAgICAgd2hpbGUgKGJ1ZmZlci5sZW5ndGggPiAwICYmIHJlc3VsdC5sZW5ndGggPCBxdWFudGl0eSkge1xyXG4gICAgICAgICAgICBpbmRleCA9IE1hdGguZmxvb3IoUk5HLmdldFVuaWZvcm0oKSAqIGJ1ZmZlci5sZW5ndGgpO1xyXG4gICAgICAgICAgICByZXN1bHQucHVzaChidWZmZXIuc3BsaWNlKGluZGV4LCAxKVswXSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiByZXN1bHQ7XHJcbiAgICB9XHJcbiAgICBnZXRSYW5kb21FbnRpdHlQb3NpdGlvbnModHlwZSwgcXVhbnRpdHkgPSAxKSB7XHJcbiAgICAgICAgbGV0IGJ1ZmZlciA9IFtdO1xyXG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcclxuICAgICAgICBmb3IgKGxldCBrZXkgaW4gdGhpcy5lbnRpdGllcykge1xyXG4gICAgICAgICAgICBpZiAodGhpcy5lbnRpdGllc1trZXldLnR5cGUgPT09IHR5cGUpIHtcclxuICAgICAgICAgICAgICAgIGJ1ZmZlci5wdXNoKHRoaXMuZW50aXRpZXNba2V5XS5wb3NpdGlvbik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgbGV0IGluZGV4O1xyXG4gICAgICAgIHdoaWxlIChidWZmZXIubGVuZ3RoID4gMCAmJiByZXN1bHQubGVuZ3RoIDwgcXVhbnRpdHkpIHtcclxuICAgICAgICAgICAgaW5kZXggPSBNYXRoLmZsb29yKFJORy5nZXRVbmlmb3JtKCkgKiBidWZmZXIubGVuZ3RoKTtcclxuICAgICAgICAgICAgcmVz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KSB7XHJcbiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHtcclxuICAgICAgICAgICAgLy8gY29uc29sZS5sb2coXCJzdGFydCBsb29wXCIpO1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgZW5kTG9vcCgpIHtcclxuICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkge1xyXG4gICAgICAgICAgICAvLyBjb25zb2xlLmxvZyhcImVuZCBsb29wXCIpO1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgLy8gcHJpdmF0ZSBhc3luYyBkcmF3TG9vcCgpIHtcclxuICAgIC8vICAgY29uc29sZS5sb2coXCJkcmF3IGxvb3BcIik7XHJcbiAgICAvLyB9XHJcbiAgICBtYWluTG9vcChkZWx0YVRpbWUpIHtcclxuICAgICAgICAvLyBpZiAoIXRoaXMudGltZU1hbmFnZXIuaXNQYXVzZWQpIHtcclxuICAgICAgICB0aGlzLnRpY2tlci51cGRhdGUocGVyZm9ybWFuY2Uubm93KCkpO1xyXG4gICAgICAgIC8vIH1cclxuICAgICAgICAvLyBoYW5kbGUgY291bnRpbmcgZG93biB3YWl0IHRpbWUgYWZ0ZXIgYSB0dXJuIChsaWtlIGZvciBhbmltYXRpb24pXHJcbiAgICAgICAgaWYgKHRoaXMucG9zdFR1cm5XYWl0VGltZSA+IDAgJiYgIXRoaXMudGltZU1hbmFnZXIuaXNQYXVzZWQpIHtcclxuICAgICAgICAgICAgdGhpcy5wb3N0VHVybldhaXRUaW1lIC09IGRlbHRhVGltZSAqIHRoaXMudGltZU1hbmFnZXIudGltZVNjYWxlO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodGhpcy5wb3N0VHVybldhaXRUaW1lIDwgMCkge1xyXG4gICAgICAgICAgICB0aGlzLnBvc3RUdXJuV2FpdFR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b3IgPT09IHZvaWQgMCA/IHZvaWQgMCA6IGFjdG9yLnBsYW4pKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gYWN0b3IgPT09IG51bGwgfHwgYWN0b3IgPT09IHZvaWQgMCA/IHZvaWQgMCA6IGFjdG9yLnBsYW4oKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pKS50aGVuKCgpID0+IF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHtcclxuICAgICAgICAgICAgYWN0b3JzLmZvckVhY2goKGFjdG9yKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBpZiAoYWN0b3IgPT09IG51bGwgfHwgYWN0b3IgPT09IHZvaWQgMCA/IHZvaWQgMCA6IGFjdG9yLmFjdGlvbikge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMudGltZU1hbmFnZXIuc2V0RHVyYXRpb24oYWN0b3IuYWN0aW9uLmR1cmF0aW9uSW5UdXJucyk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB5aWVsZCBQcm9taXNlLmFsbChhY3RvcnMubWFwKChhY3RvcikgPT4ge1xyXG4gICAgICAgICAgICAgICAgaWYgKGFjdG9yID09PSBudWxsIHx8IGFjdG9yID09PSB2b2lkIDAgPyB2b2lkIDAgOiBhY3Rvci5hY3Rpb24pIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYWN0b3IgPT09IG51bGwgfHwgYWN0b3IgPT09IHZvaWQgMCA/IHZvaWQgMCA6IGFjdG9yLmFjdCgpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KSk7XHJcbiAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKFwicHJvbWlzZXMgZG9uZVwiKTtcclxuICAgICAgICAgICAgdGhpcy51c2VySW50ZXJmYWNlLmRyYXdFbnRpdGllcygpO1xyXG4gICAgICAgICAgIC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iAgICAgICAgLy8gICAgICAgICB0aGlzLnRpbWVNYW5hZ2VyLmN1cnJlbnRUdXJuXHJcbiAgICAgICAgLy8gICAgICAgKTtcclxuICAgICAgICAvLyAgICAgfVxyXG4gICAgICAgIC8vICAgICAvLyBjaGVjayBpZiBkdW1teSBhY3RvclxyXG4gICAgICAgIC8vICAgICBhY3Rvci5wbGFuKCk7XHJcbiAgICAgICAgLy8gICAgIGlmIChhY3Rvci5hY3Rpb24pIHtcclxuICAgICAgICAvLyAgICAgICBpZiAoYWN0b3IudHlwZSA9PT0gVGlsZVR5cGUuRW50aXR5KSB7XHJcbiAgICAgICAgLy8gICAgICAgICBjb25zb2xlLmxvZyhcInNldCBkdXJhdGlvbiBcIiArIGFjdG9yLmFjdGlvbi5kdXJhdGlvbkluVHVybnMpO1xyXG4gICAgICAgIC8vICAgICAgIH1cclxuICAgICAgICAvLyAgICAgICB0aGlzLnRpbWVNYW5hZ2VyLnNldER1cmF0aW9uKGFjdG9yLmFjdGlvbi5kdXJhdGlvbkluVHVybnMpO1xyXG4gICAgICAgIC8vICAgICAgIGFjdG9yLmFjdCgpO1xyXG4gICAgICAgIC8vICAgICB9XHJcbiAgICAgICAgLy8gICB9IGVsc2Uge1xyXG4gICAgICAgIC8vICAgICAvLyBpZiBkdW1teSBhY3RvciwganVzdCBmb3JjZSBuZXh0IHR1cm5cclxuICAgICAgICAvLyAgICAgdGhpcy50aW1lTWFuYWdlci5zZXREdXJhdGlvbigxKTtcclxuICAgICAgICAvLyAgIH1cclxuICAgICAgICAvLyB9KTtcclxuICAgICAgICAvLyAvLyBjb25zb2xlLmxvZyhcIi0tLS0tIGRyYXcgZW50aXRpZXMgLS0tLS0tLSBcIik7XHJcbiAgICAgICAgLy8gdGhpcy51c2VySW50ZXJmYWNlLmRyYXdFbnRpdGllcygpO1xyXG4gICAgICAgIC8vIHRoaXMubWFwLmxpZ2h0TWFuYWdlci5jbGVhckxpZ2h0TWFwKCk7XHJcbiAgICAgICAgLy8gdGh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AvLyAgICAgYWN0b3IgPSB0aGlzLnRpbWVNYW5hZ2VyLm5leHRPblNjaGVkdWxlKCk7XHJcbiAgICAvLyAgICAgaWYgKGFjdG9yLnR5cGUgPT09IFRpbGVUeXBlLkVudGl0eSkge1xyXG4gICAgLy8gICAgICAgY29uc29sZS5sb2coXCJhYm91dCB0byBhY3Qgb24gXCIgKyBhY3Rvci5uYW1lKTtcclxuICAgIC8vICAgICAgIGNvbnNvbGUubG9nKFwidHVybiB2cyBjdXJyZW50IHR1cm5cIiwgdHVybiwgdGhpcy50aW1lTWFuYWdlci5jdXJyZW50VHVybik7XHJcbiAgICAvLyAgICAgfVxyXG4gICAgLy8gICAgIGlmIChhY3Rvcj8ucGxhbikge1xyXG4gICAgLy8gICAgICAgLy8gY2hlY2sgaWYgZHVtbXkgYWN0b3JcclxuICAgIC8vICAgICAgIGFjdG9yLnBsYW4oKTtcclxuICAgIC8vICAgICAgIGlmIChhY3Rvci5hY3Rpb24pIHtcclxuICAgIC8vICAgICAgICAgaWYgKGFjdG9yLnR5cGUgPT09IFRpbGVUeXBlLkVudGl0eSkge1xyXG4gICAgLy8gICAgICAgICAgIGNvbnNvbGUubG9nKFwic2V0IGR1cmF0aW9uIFwiICsgYWN0b3IuYWN0aW9uLmR1cmF0aW9uSW5UdXJucyk7XHJcbiAgICAvLyAgICAgICAgIH1cclxuICAgIC8vICAgICAgICAgdGhpcy50aW1lTWFuYWdlci5zZXREdXJhdGlvbihhY3Rvci5hY3Rpb24uZHVyYXRpb25JblR1cm5zKTtcclxuICAgIC8vICAgICAgICAgYWN0b3IuYWN0KCk7XHJcbiAgICAvLyAgICAgICB9XHJcbiAgICAvLyAgICAgfSBlbHNlIHtcclxuICAgIC8vICAgICAgIC8vIGlmIGR1bW15IGFjdG9yLCBqdXN0IGZvcmNlIG5leHQgdHVyblxyXG4gICAgLy8gICAgICAgdGhpcy50aW1lTWFuYWdlci5zZXREdXJhdGlvbigxKTtcclxuICAgIC8vICAgICB9XHJcbiA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dldEJpb21lKHdvcmxkUG9pbnQueCwgd29ybGRQb2ludC55KTtcclxuICAgICAgICAgICAgdGhpcy5zcGF3blBsYW50SW5CaW9tZShwb3NpdGlvbiwgYmlvbWUuaWQpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIHNwYXduUGxhbnRJbkJpb21lKHBvcywgYmlvbWUpIHtcclxuICAgICAgICBsZXQgdHJlZTtcclxuICAgICAgICBzd2l0Y2ggKGJpb21lKSB7XHJcbiAgICAgICAgICAgIGNhc2UgQmlvbWVzLkJpb21lcy5tb2lzdGRpcnQuaWQ6XHJcbiAgICAgICAgICAgICAgICB0cmVlID0gbmV3IFRyZWUodGhpcywgcG9zLCBUcmVlU3BlY2llcy50cmVlU3BlY2llc1tcInBpbmVcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgQmlvbWVzLkJpb21lcy5oaWxsc21pZC5pZDpcclxuICAgICAgICAgICAgY2FzZSBCaW9tZXMuQmlvbWVzLmhpbGxzaGlnaC5pZDpcclxuICAgICAgICAgICAgICAgIHRyZWUgPSBuZXcgVHJlZSh0aGlzLCBwb3MsIFRyZWVTcGVjaWVzLnRyZWVTcGVjaWVzW1wiYmlyY2hcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgQmlvbWVzLkJpb21lcy52YWxsZXkuaWQ6XHJcbiAgICAgICAgICAgICAgICB0cmVlID0gbmV3IFRyZWUodGhpcywgcG9zLCBUcmVlU3BlY2llcy50cmVlU3BlY2llc1tcImNvdHRvbmNhbmR5XCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIEJpb21lcy5CaW9tZXMuc25vd2hpbGxzaGlsbHNtaWQuaWQ6XHJcbiAgICAgICAgICAgICAgICB0cmVlID0gbmV3IFRyZWUodGhpcywgcG9zLCBUcmVlU3BlY2llcy50cmVlU3BlY2llc1tcIm1hcGxlXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBkZWZhdWx0OlxyXG4gICAgICAgICAgICAgICAgLy8gY29uc3QgcmFuZCA9IFJORy5nZXRVbmlmb3JtKCk7XHJcbiAgICAgICAgICAgICAgICAvLyB0cmVlID1cclxuICAgICAgICAgICAgICAgIC8vICAgcmFuZCA8IDAuMzNcclxuICAgICAgICAgICAgICAgIC8vICAgICA/IG5ldyBUcmVlKHRoaXMsIHBvcywgVHJlZVNwZWNpZXMudHJlZVNwZWNpZXNbXCJwaW5lXCJdKVxyXG4gICAgICAgICAgICAgICAgLy8gICAgIDogcmFuZCA8IDAuNjZcclxuICAgICAgICAgICAgICAgIC8vICAgICA/IG5ldyBUcmVlKHRoaXMsIHBvcywgVHJlZVNwZWNpZXMudHJlZVNwZWNpZXNbXCJiaXJjaFwiXSlcclxuICAgICAgICAgICAgICAgIC8vICAgICA6IG5ldyBUcmVlKHRoaXMsIHBvcywgVHJlZVNwZWNpZXMudHJlZVNwZWNpZXNbXCJtYXBsZVwiXSk7XHJcbiAgICAgICAgICAgICAgICB0cmVlID0gbmV3IFRyZWUodGhpcywgcG9zLCBUcmVlU3BlY2llcy50cmVlU3BlY2llc1tcIm1hcGxlXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLnBsYW50cy5wdXNoKHRyZWUpO1xyXG4gICAgICAgIHRoaXMudGltZU1hbmFnZXIuYWRkVG9TY2hlZHVsZSh0cmVlLCB0cnVlKTtcclxuICAgICAgICByZXR1cm4gdHJlZTtcclxuICAgIH1cclxuICAgIGdlbmVyYXRlUGxheWVyKCkge1xyXG4gICAgICAgIGNvbnN0IHBvcyA9IHRoaXMubWFwLmdldFJhbmRvbVRpbGVQb3NpdGlvbnMoQmlvbWVzLkJpb21lcy5tb2lzdGRpcnQuaWQsIDEpWzBdO1xyXG4gICAgICAgIHRoaXMucG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JcbiAgICAgICAgICAgIGNhc2UgQmlvbWVzLkJpb21lcy5oaWxsc2xvdy5pZDpcclxuICAgICAgICAgICAgICAgIGVudGl0eSA9IG5ldyBNdXNocm9vbSh0aGlzLCBwb3MpO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICBlbnRpdHkgPSBuZXcgTXVzaHJvb20odGhpcywgcG9zKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLmVudGl0aWVzLnB1c2goZW50aXR5KTtcclxuICAgICAgICB0aGlzLnRpbWVNYW5hZ2VyLmFkZFRvU2NoZWR1bGUoZW50aXR5LCB0cnVlKTtcclxuICAgICAgICBlbnRpdHkuZHJhdygpO1xyXG4gICAgICAgIHJldHVybiBlbnRpdHk7XHJcbiAgICB9XHJcbiAgICBzcGF3blJhbmRvbUVudGl0eShwb3MpIHtcclxuICAgICAgICBsZXQgZW50aXR5O1xyXG4gICAgICAgIGNvbnN0IHJhbmQgPSBSTkcuZ2V0VW5pZm9ybSgpO1xyXG4gICAgICAgIGlmIChyYW5kIDwgMC4yNSkge1xyXG4gICAgICAgICAgICAvLyBlbnRpdHkgPSBuZXcgUGVyc29uKHRoaXMsIHBvcyk7XHJcbiAgICAgICAgICAgIGVudGl0eSA9IG5ldyBDb3codGhpcywgcG9zKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSBpZiAocmFuZCA8IDAuNSkge1xyXG4gICAgICAgICAgICBlbnRpdHkgPSBuZXcgU2hhcmtCbHVlKHRoaXMsIHBvcyk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBlbnRpdHkgPSBuZXcgTXVzaHJvb20odGhpcywgcG9zKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy5lbnRpdGllcy5wdXNoKGVudGl0eSk7XHJcbiA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xuICAgIC8vIH1cclxuICAgIC8vIGRlc3Ryb3lCb3goYWN0b3I6IEFjdG9yLCB4OiBudW1iZXIsIHk6IG51bWJlcik6IHZvaWQge1xyXG4gICAgLy8gICBzd2l0Y2ggKHRoaXMubWFwLmdldFRpbGVUeXBlKHgsIHkpKSB7XHJcbiAgICAvLyAgICAgY2FzZSBUaWxlVHlwZS5QbGFudDpcclxuICAgIC8vICAgICBjYXNlIFRpbGVUeXBlLkN1dFRyZWU6XHJcbiAgICAvLyAgICAgICB0aGlzLm1hcC5zZXRUaWxlKHgsIHksIFRpbGUudHJlZVN0dW1wKTtcclxuICAgIC8vICAgICAgIGlmICh0aGlzLnRyZWVQb2ludC54ID09IHggJiYgdGhpcy50cmVlUG9pbnQueSA9PSB5KSB7XHJcbiAgICAvLyAgICAgICAgIHRoaXMudXNlckludGVyZmFjZS5tZXNzYWdlTG9nLmFwcGVuZFRleHQoXHJcbiAgICAvLyAgICAgICAgICAgXCJDb250aW51ZSB3aXRoICdzcGFjZWJhcicgb3IgJ3JldHVybicuXCJcclxuICAgIC8vICAgICAgICAgKTtcclxuICAgIC8vICAgICAgICAgdGhpcy51c2VySW50ZXJmYWNlLm1lc3NhZ2VMb2cuYXBwZW5kVGV4dChcclxuICAgIC8vICAgICAgICAgICBgR2FtZSBvdmVyIC0gJHt0aGlzLmdldEFjdG9yTmFtZShcclxuICAgIC8vICAgICAgICAgICAgIGFjdG9yXHJcbiAgICAvLyAgICAgICAgICAgKX0gZGV0cm95ZWQgdGhlIGJveCB3aXRoIHRoZSBwaW5lYXBwbGUuYFxyXG4gICAgLy8gICAgICAgICApO1xyXG4gICAgLy8gICAgICAgICB0aGlzLmdhbWVTdGF0ZS5waW5lYXBwbGVXYXNEZXN0cm95ZWQgPSB0cnVlO1xyXG4gICAgLy8gICAgICAgfSBlbHNlIHtcclxuICAgIC8vICAgICAgICAgdGhpcy51c2VySW50ZXJmYWNlLm1lc3NhZ2VMb2cuYXBwZW5kVGV4dChcclxuICAgI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AgXCJMdWlnaVwiLFxyXG4gICAgICAgICAgICBcIkplblwiLFxyXG4gICAgICAgICAgICBcIkNhc3NpZVwiLFxyXG4gICAgICAgICAgICBcIlR5bGVyXCIsXHJcbiAgICAgICAgICAgIFwiRGF2ZVwiLFxyXG4gICAgICAgICAgICBcIkp1ZHlcIixcclxuICAgICAgICAgICAgXCJKdWRlXCIsXHJcbiAgICAgICAgICAgIFwiSnVhblwiLFxyXG4gICAgICAgICAgICBcIkplcm1haW5lXCIsXHJcbiAgICAgICAgICAgIFwiS3lsaWVcIixcclxuICAgICAgICAgICAgXCJBZGFtXCIsXHJcbiAgICAgICAgICAgIFwiUGF0cmlja1wiLFxyXG4gICAgICAgICAgICBcIk1hdHRcIixcclxuICAgICAgICAgICAgXCJDZWxlc3RlXCIsXHJcbiAgICAgICAgICAgIFwiQXJ0aHVyXCIsXHJcbiAgICAgICAgICAgIFwiSmltbXlcIixcclxuICAgICAgICAgICAgXCJKaWxsXCIsXHJcbiAgICAgICAgICAgIFwiSmFpbmllXCIsXHJcbiAgICAgICAgICAgIFwiQnJvZGllXCIsXHJcbiAgICAgICAgICAgIFwiR3VhZGFsb3VwZVwiLFxyXG4gICAgICAgICAgICBcIkphc21pbmVcIixcclxuICAgICAgICAgICAgXCJKYXNwZXJcIixcclxuICAgICAgICAgICAgXCJKYXJlZFwiLFxyXG4gICAgICAgICAgICBcIkplc3NlXCIsXHJcbiAgICAgICAgICAgIFwiSmVubnlcIixcclxuICAgICAgICAgICAgXCJKaWxsXCIsXHJcbiAgICAgICAgICAgIFwiSmlsbGlhblwiLFxyXG4gICAgICAgICAgICBcIkFteVwiLFxyXG4gICAgICAgICAgICBcIkJpbGxcIixcclxuICAgICAgICAgICAgXCJaYW5lXCIsXHJcbiAgICAgICAgICAgIFwiWmFja1wiLFxyXG4gICAgICAgICAgICBcIlphY2hcIixcclxuICAgICAgICAgICAgXCJaYWNoYXJ5XCIsXHJcbiAgICAgICAgICAgIFwiWmFyYVwiLFxyXG4gICAgICAgICAgICBcIlplbGRhXCIsXHJcbiAgICAgICAgICAgIFwiWm9lXCIsXHJcbiAgICAgICAgICAgIFwiSG9tZXJcIixcclxuICAgICAgICBdO1xyXG4gICAgICAgIGNvbnN0IGV4YW1wbGVBbmltYWxOYW1lcyA9IFtcclxuICAgICAgICAgICAgXCJTcG90XCIsXHJcbiAgICAgICAgICAgIFwiUm92ZXJcIixcclxuICAgICAgICAgICAgXCJGaWRvXCIsXHJcbiAgICAgICAgICAgIFwiUmV4XCIsXHJcbiAgICAgICAgICAgIFwiUmV4eVwiLFxyXG4gICAgICAgICAgICBcIlJleGllXCIsXHJcbiAgICAgICAgICAgIFwiQmltYm9cIixcclxuICAgICAgICAgICAgXCJGaXJvbGFpc1wiLFxyXG4gICAgICAgICAgICBcIk1hbmNoYVwiLFxyXG4gICAgICAgICAgICBcIkdhdGl0b1wiLFxyXG4gICAgICAgICAgICBcIkZpZG9cIixcclxuICAgICAgICAgICAgXCJSb2Njb1wiLFxyXG4gICAgICAgICAgICBcIkRvbmFcIixcclxuICAgICAgICAgICAgXCJEb25hdGVsbG9cIixcclxuICAgICAgICAgICAgXCJNdXN0YWNoZVwiLFxyXG4gICAgICAgICAgICBcIkZ1enp5XCIsXHJcbiAgICAgICAgICAgIFwiQmlnb3RlXCIsXHJcbiAgICAgICAgICAgIFwiRmx1ZmZ5XCIsXHJcbiAgICAgICAgICAgIFwiTGFudWRvXCIsXHJcbiAgICAgICAgICAgIFwiUGF3c1wiLFxyXG4gICAgICAgICAgICBcIlBhdGFzXCIsXHJcbiAgICAgICAgICAgIFwiUGF3c3lcIixcclxuICAgICAgICAgICAgXCJQYXdzaWVcIixcclxuICAgICAgICAgICAgXCJQYXBwYXNcIixcclxuICAgICAgICAgICAgXCJQYXBwaWVcIixcclxuICAgICAgICAgICAgXCJaaXBweVwiLFxyXG4gICAgICAgICAgICBcIlNraXBweVwiLFxyXG4gICAgICAgICAgICBcIlNraXBwZXJcIixcclxuICAgICAgICAgICAgXCJ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lnaHQsIHRoaXMubGlnaHREZWZhdWx0cy5zdW5saWdodCwgdGhpcy5nYW1lLnRpbWVNYW5hZ2VyLnJlbWFpbmluZ1BoYXNlUGVyY2VudCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAocGhhc2UgPT09IExpZ2h0UGhhc2UucGVhaykge1xyXG4gICAgICAgICAgICAgICAgYW1iaWVudExpZ2h0VG9VcGRhdGUgPSB0aGlzLmxpZ2h0RGVmYXVsdHMuc3VubGlnaHQ7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBhbWJpZW50TGlnaHRUb1VwZGF0ZSA9IG11bHRpQ29sb3JMZXJwKFtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmxpZ2h0RGVmYXVsdHMuYW1iaWVudERheWxpZ2h0LFxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMubGlnaHREZWZhdWx0cy5hbWJpZW50U3Vuc2V0LFxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMubGlnaHREZWZhdWx0cy5zdW5saWdodCxcclxuICAgICAgICAgICAgICAgIF0sIHRoaXMuZ2FtZS50aW1lTWFuYWdlci5yZW1haW5pbmdQaGFzZVBlcmNlbnQpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBpZiAocGhhc2UgPT09IExpZ2h0UGhhc2UucmlzaW5nKSB7XHJcbiAgICAgICAgICAgICAgICBhbWJpZW50TGlnaHRUb1VwZGF0ZSA9IG11bHRpQ29sb3JMZXJwKFtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmxpZ2h0RGVmYXVsdHMuYW1iaWVudERheWxpZ2h0LFxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMubGlnaHREZWZhdWx0cy5hbWJpZW50TmlnaHRMaWdodCxcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmxpZ2h0RGVmYXVsdHMubW9vbmxpZ2h0LFxyXG4gICAgICAgICAgICAgICAgXSwgdGhpcy5nYW1lLnRpbWVNYW5hZ2VyLnJlbWFpbmluZ1BoYXNlUGVyY2VudCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAocGhhc2UgPT09IExpZ2h0UGhhc2UucGVhaykge1xyXG4gICAgICAgICAgICAgICAgYW1iaWVudExpZ2h0VG9VcGRhdGUgPSB0aGlzLmxpZ2h0RGVmYXVsdHMubW9vbmxpZ2h0O1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgYW1iaWVudExpZ2h0VG9VcGRhdGUgPSBtdWx0aUNvbG9yTGVycChbXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5saWdodERlZmF1bHRzLmFtYmllbnREYXlsaWdodCxcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmxpZ2h0RGVmYXVsdHMuYW1iaWVudE5pZ2h0TGlnaHQsXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5saWdodERlZmF1bHRzLm1vb25saWdodCxcclxuICAgICAgICAgICAgICAgIF0sIHRoaXMuZ2FtZS50aW1lTWFuYWdlci5yZW1haW5pbmdQaGFzZVBlcmNlbnQpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICghY2FsY3VsYXRlVGFyZ2V0KSB7XHJcbiAgICAgICAgICAgIHRoaXMuYW1iaWVudExpZ2h0ID0gYW1iaWVudExpZ2h0VG9VcGRhdGU7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICB0aGlzLnRhcmdldEFtYmllbnRMaWdodCA9IGFtYmllbnRMaWdodFRvVXBkYXRlO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGxpZ2h0UGFzc2VzKHgsIHkpIHtcclxuICAgICAg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WRbZW50aXR5LmlkXSA9IG51bGw7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBjbGVhckNoYW5nZWREeW5hbWljTGlnaHRzKCkge1xyXG4gICAgICAgIGZvciAobGV0IGVudGl0eSBvZiB0aGlzLmdhbWUuZW50aXRpZXMpIHtcclxuICAgICAgICAgICAgaWYgKHRoaXMubGlnaHRFbWl0dGVyQnlJZFtlbnRpdHkuaWRdKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBbeCwgeV0gPSB0aGlzLmxpZ2h0RW1pdHRlckJ5SWRbZW50aXR5LmlkXTtcclxuICAgICAgICAgICAgICAgIGlmIChlbnRpdHkucG9zaXRpb24ueCAhPSB4IHx8IGVudGl0eS5wb3NpdGlvbi55ICE9IHkpIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmxpZ2h0RW1pdHRlcnMuc2V0TGlnaHQoeCwgeSwgbnVsbCk7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5saWdodEVtaXR0ZXJCeUlkW2VudGl0eS5pZF0gPSBudWxsO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgdXBkYXRlRHluYW1pY0xpZ2h0aW5nKCkge1xyXG4gICAgICAgIGlmICh0aGlzLmdhbWUudGltZU1hbmFnZXIuaXNOaWdodHRpbWUpIHtcclxuICAgICAgICAgICAgZm9yIChsZXQgZW50aXR5IG9mIHRoaXMuZ2FtZS5lbnRpdGllcykge1xyXG4gICAgICAgICAgICAgICAgbGV0IHVwZGF0ZUxpZ2h0ID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMubGlnaHRFbWl0dGVyQnlJZFtlbnRpdHkuaWRdKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlTGlnaHQgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMubGlnaHRFbWl0dGVyQnlJZFtlbnRpdHkuaWRdKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgW3gsIHldID0gdGhpcy5saWdodEVtaXR0ZXJCeUlkW2VudGl0eS5pZF07XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVudGl0eS5wb3NpdGlvbi54ICE9IHggfHwgZW50aXR5LnBvc2l0aW9uLnkgIT0geSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVMaWdodCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKHVwZGF0ZUxpZ2h0KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5saWdodEVtaXR0ZXJCeUlkW2VudGl0eS5pZF0gPSBbXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGVudGl0eS5wb3NpdGlvbi54LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBlbnRpdHkucG9zaXRpb24ueSxcclxuICAgICAgICAgICAgICAgICAgICBdO1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMubGlnaHRFbWl0dGVycy5zZXRMaWdodChlbnRpdHkucG9zaXRpb24ueCwgZW50aXR5LnBvc2l0aW9uLnksIHRoaXMubGlnaHREZWZhdWx0cy50b3JjaEJyaWdodCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBnZXRMaWdodENvbG9yRm9yKHgsIHksIGxpZ2h0TWFwID0gbnVsbCwgLy8geCx5IC0+IGNvbG9yIGJhc2VkIG9uIGxpZ2h0IHNvdXJjZXNcclxuICAgIHNoYWRvd01hcCA9IG51bGwsIC8vIHgseSAtPiBudW1iZXIgYmFzZWQgb24gc3VuIHBvc2l0aW9uXHJcbiAgICBvY2NsdXNpb25NYXAgPSB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bXTtcclxuICAgICAgICB0aGlzLmJvdW5kUnVuQW5pbWF0aW9uID0gdGhpcy5ydW5BbmltYXRpb24uYmluZCh0aGlzKTtcclxuICAgIH1cclxuICAgIHN0YXJ0KCkgeyB9XHJcbiAgICBhbmltVXBkYXRlKCkge1xyXG4gICAgICAgIGZvciAobGV0IGkgPSB0aGlzLmFuaW1hdGlvbnMubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHtcclxuICAgICAgICAgICAgY29uc3QgYW5pbSA9IHRoaXMuYW5pbWF0aW9uc1tpXTtcclxuICAgICAgICAgICAgaWYgKGFuaW0uZW5kVHVybiA8PSB0aGlzLmdhbWUudGltZU1hbmFnZXIuY3VycmVudFR1cm4pIHtcclxuICAgICAgICAgICAgICAgIGlmIChhbmltLmNhbGxiYWNrKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgYW5pbS5jYWxsYmFjaygpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgLy8gU3dhcCB0aGUgZWxlbWVudCB0byByZW1vdmUgd2l0aCB0aGUgbGFzdCBlbGVtZW50IGFuZCBwb3AgaXQgZnJvbSB0aGUgYXJyYXlcclxuICAgICAgICAgICAgICAgIGlmIChpICE9PSB0aGlzLmFuaW1hdGlvbnMubGVuZ3RoIC0gMSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYW5pbWF0aW9uc1tpXSA9IHRoaXMuYW5pbWF0aW9uc1t0aGlzLmFuaW1hdGlvbnMubGVuZ3RoIC0gMV07XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB0aGlzLmFuaW1hdGlvbnMucG9wKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBydW5BbmltYXRpb25XaXRoQXJncyA9ICgpID0+IHRoaXMuYm91bmRSdW5BbmltYXRpb24oYW5pbSk7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmdhbWUuc2NoZWR1bGVyLnBvc3RUYXNrKHJ1bkFuaW1hdGlvbldpdGhBcmdzLCB7XHJcbiAgICAgICAgICAgICAgICAgICAgcHJpb3JpdHk6IFwidXNlci12aXNpYmxlXCIsXHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIHJ1bkFuaW1hdGlvbihhbmltYXRpb24pIHtcclxuICAgICAgICBpZiAoYW5pbWF0aW9uLmFjdGlvbiA9PT0gXCJtb3ZlXCIpIHtcclxuICAgICAgICAgICAgdGhpcy5hbmltYXRlTW92ZShhbmltYXRpb24pO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGFkZE1vdmVBbmltYXRpb24odGlsZUtleSwgLy8gdGhlIHRpbGUgcG9zaXRpb24gaW4gdGhlIHJlbmRlcmVyJ3MgY2FjaGVcclxuICAgIG9sZFBvcywgbmV3UG9zLCBjYWxsYmFjaywgYWN0b3IpIHtcclxuICAgICAgICBjb25zdCBhbmltYXRpb24gPSB7XHJcbiAgICAgICAgICAgIGlkOiBnZW5lcmF0ZUlkKCksXHJcbiAgICAgICAgICAgIHRpbGVLZXk6IHRpbGVLZXksXHJcbiAgICAgICAgICAgIG9sZFBvczogb2xkUG9zLFxyXG4gICAgICAgICAgICBuZXdQb3M6IG5ld1BvcyxcclxuICAgICAgICAgICAgYWN0aW9uOiBcIm1vdmVcIixcclxuICAgICAgICAgICAgdHVybkR1cmF0aW9uOiAxLFxyXG4gICAgICAgICAgICBlbmRUdXJuOiB0aGlzLmdhbWUudGltZU1hbmFnZXIuY3VycmVudFR1cm4gKyAxLFxyXG4gICAgICAgICAgICBjYWxsYmFjazogY2FsbGJhY2ssXHJcbiAgICAgICAgfTtcclxuICAgICAgICBpZiAoYWN0b3IpIHtcclxuICAgICAgICAgICAgYW5pbWF0aW9uLmFjdG9yID0gYWN0b3I7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRoaXMuYW5pbWF0aW9ucy5wdXNoKGFuaW1hdGlvbik7XHJcbiAgICB9XHJcbiAgICBhbmltYXRlTW92ZShhbmltYXRpb24pIHtcclxuICAgICAgICBjb25zdCBuZXdQb3MgPSBhbmltYXRpb24ubmV3UG9zO1xyXG4gICAgICAgIGNvbnN0IG9sZFBvcyA9IGFuaW1hdGlvbi5vbGRQb3M7XHJcbiAgICAgICAgaWYgKG9sZFBvcyAmJiBuZXdQb3MpIHtcclxuICAgICAgICAgICAgbGV0IHBlcmNlbnQgPSB0aGlzLmdhbWUudGltZU1hbmFnZXIudHVybkFuaW1UaW1lUGVyY2VudDtcclxuICAgICAgICAgICAgbGV0IGFuaW1Eb25lID0gcGVyY2VudCA+PSAwLjk5OyAvLyByZWR1Y2UgZm9yIHNuYXBwaWVyIGZlZWxcclxuICAgICAgICAgICAgaWYgKGFuaW1Eb25lKVxyXG4gICAgICAgICAgICAgICAgcGVyY2VudCA9IDE7XHJcbiAgICAgICAgICAgIGxldCB4LCB5O1xyXG4gICAgICAgICAgICBpZiAodGhpcy5vcHRpb25zLmxlcnBTdHlsZSA9PT0gXCJsaW5lYXJcIikge1xyXG4gICAgICAgICAgICAgICAgeCA9IGxlcnAocGVyY2VudCwgb2xkUG9zWzBdLCBuZXdQb3NbMF0pO1xyXG4gICAgICAgICAgICAgICAgeSA9IGxlcnAocGVyY2VudCwgb2xkUG9zWzFdLCBuZXdQb3NbMV0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2UgaWYgKHRoaXMub3B0aW9ucy5sZXJwU3R5bGUgPT09IFwiZWFzZUluXCIpIHtcclxuICAgICAgICAgICAgICAgIHggPSBsZXJwRWFzZUluKHBlcmNlbnQsIG9sZFBvc1swXSwgbmV3UG9zWzBdKTtcclxuICAgICAgICAgICAgICAgIHkgPSBsZXJwRWFzZUluKHBlcmNlbnQsIG9sZFBvc1sxXSwgbmV3UG9zWzFdKTtcclxuICAgICAgICAgICAgfVxyX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lbi1vdmVybGF5XCIsIE92ZXJsYXkpO1xyXG4gICAgICAgIGN1c3RvbUVsZW1lbnRzLmRlZmluZShcInV0aWxpdHktYWN0aW9uc1wiLCBVdGlsaXR5QWN0aW9ucyk7XHJcbiAgICAgICAgY3VzdG9tRWxlbWVudHMuZGVmaW5lKFwiaW5kaWNhdG9yLXN1blwiLCBJbmRpY2F0b3JTdW4pO1xyXG4gICAgICAgIGN1c3RvbUVsZW1lbnRzLmRlZmluZShcImluZGljYXRvci10aWxlLXNlbGVjdGlvblwiLCBJbmRpY2F0b3JUaWxlU2VsZWN0aW9uKTtcclxuICAgIH1cclxuICAgIGluaXRDb250cm9scygpIHtcclxuICAgICAgICB0aGlzLnRpbWVDb250cm9sID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcInRpbWUtY29udHJvbFwiKTtcclxuICAgICAgICBpZiAodGhpcy50aW1lQ29udHJvbCkge1xyXG4gICAgICAgICAgICAvLyB0aGlzLnRpbWVDb250cm9sLnRvZ2dsZVRvb2x0aXAoKTtcclxuICAgICAgICAgICAgdGhpcy50aW1lQ29udHJvbC51cGRhdGVUaW1lKHRoaXMuZ2FtZS50aW1lTWFuYWdlci5nZXRDdXJyZW50VGltZUZvckRpc3BsYXkoKSk7XHJcbiAgICAgICAgICAgIHRoaXMudGltZUNvbnRyb2wucGF1c2VCdG4uYWRkRXZlbnRMaXN0ZW5lcihcImNsaWNrXCIsICgpID0+IHtcclxuICAgICAgICAgICAgICAgIHRoaXMuZ2FtZS50aW1lTWFuYWdlci50b2dnbGVQYXVzZSgpO1xyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgdGhpcy50aW1lQ29udHJvbC50aW1lU2xpZGVyLmFkZEV2ZW50TGlzdGVuZXIoXCJzbC1pbnB1dFwiLCAoZSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5nYW1lLnRpbWVNYW5hZ2VyLnNldFRpbWVzY2FsZShlLnRhcmdldC52YWx1ZSk7XHJcbi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l0ZW0oZW50aXR5KSB7XHJcbiAgICAgICAgY29uc3QgaXNBbmltYXRlZCA9IGVudGl0eS50aWxlLmFuaW1hdGlvbktleXMgIT0gbnVsbDtcclxuICAgICAgICAvLyB1c2UgcmVnZXggdG8gc2VsZWN0IFwibXVzaHJvb21fMDBfd2Fsa18xNHgxOFwiLFxyXG4gICAgICAgIC8vIG91dCBvZiBcInNwcml0ZXMvbXVzaHJvb21fMDBfd2Fsa18xNHgxOC9tdXNocm9vbV8wMF93YWxrXzE0eDE4Lmpzb25cIixcclxuICAgICAgICBsZXQgc3ByaXRlUGF0aDtcclxuICAgICAgICBpZiAoaXNBbmltYXRlZCkge1xyXG4gICAgICAgICAgICAvLyBzcHJpdGVQYXRoID0gYW5pbWF0ZWRUaWxlUGF0aFRvU3RhdGljKGVudGl0eS50aWxlLnNwcml0ZVBhdGgpO1xyXG4gICAgICAgICAgICBzcHJpdGVQYXRoID0gZW50aXR5LnRpbGUuaWNvblBhdGg7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBzcHJpdGVQYXRoID0gZW50aXR5LnRpbGUuc3ByaXRlUGF0aDtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgaWQ6IGAke2VudGl0eS5pZH1gLFxyXG4gICAgICAgICAgICBpY29uOiBnZXRDYWNoZWRUaWxlVGV4dHVyZShzcHJpdGVQYXRoKSxcclxuICAgICAgICAgICAgY2xpY2tIYW5kbGVyOiAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhgY2xpY2tlZCBvbiAke2VudGl0eS5pZH1gKTtcclxuICAgICAgICAgICAgICAgIHRoaXMudWkuY2FtZXJhLnNldFBvaW50ZXJUYXJnZXQoZW50aXR5LnBvc2l0aW9uLCBlbnRpdHksIHRydWUpO1xyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBsYWJlbDogZW50aXR5Lm5hbWUsXHJcbiAgICAgICAgICAgIHRvb2x0aXA6IGBFbnRpdHk6ICR7ZW50aXR5LmlkfWAsXHJcbiAgICAgICAgfTtcclxuICAgIH1cclxuICAgIHNldFV0aWxpdHlBY3Rpb25zT3B0aW9ucygpIHtcclxuICAgICAgICB0aGlzLnV0aWxpdHlBY3Rpb25zLnNldE9wdGlvbnMoW1xyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbDogXCJPdmVybGF5c1wiLFxyXG4gICAgICAgICAgICAgICAgaWNvbjogT3ZlcmxheUljb24sXHJcbiAgICAgICAgICAgICAgICBoYW5kbGVyOiAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coXCJvdmVybGF5cyBzZWxlY3RlZFwiKTtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFVJVmlzaWJsZShmYWxzZSwgdHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gdGhpcy5nYW1lLnRpbWVNYW5hZ2VyLnNldElzUGF1c2VkKHRydWUpO1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3ZlcmxheS5zZXRWaXNpYmxlKHRydWUpO1xyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgbGFiZWw6IFwiR3JpZCBJbmRpY2F0b3JcIixcclxuICAgICAgICAgICAgICAgIGljb246IE92ZXJsYXlJY29uLFxyXG4gICAgICAgICAgICAgICAgaGFuZGxlcjogKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKFwiR3JpZCBJbmRpY2F0b3Igc2VsZWN0ZWRcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRVSVZpc2libGUoZmFsc2UsIHRydWUpO1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMudGlsZVNlbGVjdGlvbkluZGljYXRvci5zZXRW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cbiAgICAgICAgY2xvdWRMZXZlbCArPSBjbG91ZExldmVsTm9pc2U7XHJcbiAgICAgICAgLy8gbWVkaXVtIGNsb3VkcyB3aGVyZSB0aGVyZSBhcmUgbm8gc3VuYmVhbXNcclxuICAgICAgICBjbG91ZExldmVsTm9pc2UgPVxyXG4gICAgICAgICAgICAoY2xvdWRJbnRlbnNpdHkgKyAwLjEyKSAqXHJcbiAgICAgICAgICAgICAgICBnZXRTY2FsZWROb2lzZShub2lzZSwgY2xvdWRTaXplICsgMTAgKiAobm9pc2VYICsgb2Zmc2V0KSwgY2xvdWRTaXplICsgMTAgKiAobm9pc2VZICsgb2Zmc2V0KSk7XHJcbiAgICAgICAgaWYgKGNsb3VkTGV2ZWwgPiB0aGlzLnN1bmJlYW1NYXhMZXZlbCkge1xyXG4gICAgICAgICAgICBjbG91ZExldmVsICs9IGNsb3VkTGV2ZWxOb2lzZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2xvdWRMZXZlbE5vaXNlID1cclxuICAgICAgICAgICAgKGNsb3VkSW50ZW5zaXR5IC0gMC4wOCkgKlxyXG4gICAgICAgICAgICAgICAgZ2V0U2NhbGVkTm9pc2Uobm9pc2UsIGNsb3VkU2l6ZSArIDE1ICogKG5vaXNlWCArIG9mZnNldCksIGNsb3VkU2l6ZSArIDE1ICogKG5vaXNlWSArIG9mZnNldCkpO1xyXG4gICAgICAgIGlmIChjbG91ZExldmVsID4gdGhpcy5zdW5iZWFtTWF4TGV2ZWwpIHtcclxuICAgICAgICAgICAgY2xvdWRMZXZlbCArPSBjbG91ZExldmVsTm9pc2U7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChjbG91ZExldmVsID4gMSkge1xyXG4gICAgICAgICAgICBjbG91ZExldmVsID0gMTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSBpZiAoY2xvdWRMZXZlbCA8IDApIHtcclxuICAgICAgICAgICAgY2xvdWRMZXZlbCA9IDA7XHJcbiAgICAgICAgfVxy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kU3BlZWRDaGFuZ2VBbW91bnQ7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChSTkcuZ2V0VW5pZm9ybSgpIDwgd2luZFNwZWVkQ2hhbmdlQ2hhbmNlKSB7XHJcbiAgICAgICAgICAgIHdpbmRTcGVlZC55ICs9XHJcbiAgICAgICAgICAgICAgICBSTkcuZ2V0VW5pZm9ybSgpIDwgMC41ID8gd2luZFNwZWVkQ2hhbmdlQW1vdW50IDogLXdpbmRTcGVlZENoYW5nZUFtb3VudDtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKFJORy5nZXRVbmlmb3JtKCkgPCB3aW5kU3BlZWRDaGFuZ2VEaXJlY3Rpb25DaGFuY2UpIHtcclxuICAgICAgICAgICAgd2luZFNwZWVkLnggKz1cclxuICAgICAgICAgICAgICAgIFJORy5nZXRVbmlmb3JtKCkgPCAwLjVcclxuICAgICAgICAgICAgICAgICAgICA/IHdpbmRTcGVlZENoYW5nZURpcmVjdGlvblxyXG4gICAgICAgICAgICAgICAgICAgIDogLXdpbmRTcGVlZENoYW5nZURpcmVjdGlvbjtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKFJORy5nZXRVbmlmb3JtKCkgPCB3aW5kU3BlZWRDaGFuZ2VEaXJlY3Rpb25DaGFuY2UpIHtcclxuICAgICAgICAgICAgd2luZFNwZWVkLnkgKz1cclxuICAgICAgICAgICAgICAgIFJORy5nZXRVbmlmb3JtKCkgPCAwLjVcclxuICAgICAgICAgICAgICAgICAgICA/IHdpbmRTcGVlZENoYW5nZURpcmVjdGlvblxyXG4gICAgICAgICAgICAgICAgICAgIDogLXdpbmRTcGVlZENoYW5nZURpcmVjdGlvbjtcclxuICAgICAgICB9XHJcbiAgICAgICAgd2luZFNwZWVkLnggPSBNYXRoLm1pbih3aW5kU3BlZWRNYXgsIE1hdGgubWF4KHdpbmRTcGVlZE1pbiwgd2luZFNwZWVkLngpKTtcclxuICAgICAgICB3aW5kU3BlZWQueSA9IE1hdG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gICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aGlzLmdhbWUub3B0aW9ucy5nYW1lU2l6ZS53aWR0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgdGhpcy5nYW1lLm9wdGlvbnMuZ2FtZVNpemUuaGVpZ2h0OyBqKyspIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGtleSA9IE1hcFdvcmxkLmNvb3Jkc1RvS2V5KGksIGopO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgYWRqYWNlbnQgPSB0aGlzLm1hcC5nZXRBZGphY2VudChpLCBqLCBoZWlnaHRMYXllckFkamFjZW5jeU1hcCk7XHJcbiAgICAgICAgICAgICAgICBpZiAoYWRqYWNlbnQpIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNhbGNUb3BEb3duRHJvcG9mZihpLCBqLCBhZGphY2VudCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICB1cGRhdGVPY2NsdXNpb25TaGFkb3dNYXAoY2FsY3VsYXRlVGFyZ2V0ID0gdHJ1ZSkge1xyXG4gICAgICAgIGxldCBtYXBUb1VwZGF0ZSA9IHt9O1xyXG4gICAgICAgIGlmIChjYWxjdWxhdGVUYXJnZXQpIHtcclxuICAgICAgICAgICAgZm9yIChsZXQga2V5IGluIHRoaXMudGFyZ2V0T2NjbHVzaW9uTWFwKSB7XHJcbiAgICAgICAgICAgICAgICBtYXBUb1VwZGF0ZVtrZXldID0gdGhpcy50YXJnZXRPY2NsdXNpb25NYXBba2V5XTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgZm9yIChsZXQga2V5IGluIHRoaXMub2NjbHVzaW9uTWFwKSB7XHJcbiAgICAgICAgICAgICAgICBtYXBUb1VwZGF0ZVtrZXldID0gdGhpcy5vY2NsdXNpb25NYXBba2V5XTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBmb3IgKGxldCB4ID0gMDsgeCA8IHRoaXMuZ2FtZS5vcHRpb25zLmdhbWVTaXplLndpZHRoOyB4KyspIHtcclxuICAgICAgICAgICAgZm9yIChsZXQgeSA9IDA7IHkgPCB0aGlzLmdhbWUub3B0aW9ucy5nYW1lU2l6ZS5oZWlnaHQ7IHkrKykge1xyXG4gICAgICAgICAgICAgICAgY29uc3Qga2V5ID0gTWFwV29ybGQuY29vcmRzVG9LZXkoeCwgeSk7XHJcbiAgICAgICAgICAgICAgICBtYXBUb1VwZGF0ZVtrZXldID0gdGhpcy5nZXRTaGFkb3dGb3IoeCwgeSwgXCJ0b3Bkb3duXCIpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICghY2FsY3VsYXRlVGFyZ2V0KSB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IGtleSBpbiB0aGlzLm9jY2x1c2lvbk1hcCkge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5vY2NsdXNpb25NYXBba2V5XSA9IG1hcFRvVXBkYXRlW2tleV07XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IGtleSBpbiB0aGlzLnRhcmdldE9jY2x1c2lvbk1hcCkge1xyXG4gICAgICAgICAgICAgICAgdGhpcy50YXJnZXRPY2NsdXNpb25NYXBba2V5XSA9IG1hcFRvVXBkYXRlW2tleV07XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICB1cGRhdGVTaGFkb3dNYXAoY2FsY3VsYXRlVGFyZ2V0ID0gdHJ1ZSwgZGlyKSB7XHJcbiAgICAgICAgbGV0IG1hcFRvVXBkYXRlID0ge307XHJcbiAgICAgICAgaWYgKGNhbGN1bGF0ZVRhcmdldCkge1xyXG4gIC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B9KTtcclxuICAgIC8vICAgcmV0dXJuIHNvcnRlZDtcclxuICAgIC8vIH1cclxuICAgIGNhbGNTdW5kb3duTWFwKCkge1xyXG4gICAgICAgIGNvbnN0IHJvd3MgPSB0aGlzLmdhbWUub3B0aW9ucy5nYW1lU2l6ZS5oZWlnaHQ7XHJcbiAgICAgICAgY29uc3QgY29sdW1ucyA9IHRoaXMuZ2FtZS5vcHRpb25zLmdhbWVTaXplLndpZHRoO1xyXG4gICAgICAgIGNvbnN0IHRvdGFsID0gY29sdW1ucyArIHJvd3MgLSAxO1xyXG4gICAgICAgIGNvbnN0IHJlc3VsdCA9IFtdO1xyXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcm93czsgaSsrKSB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgY29sdW1uczsgaisrKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBrZXkgPSBNYXBXb3JsZC5jb29yZHNUb0tleShqLCBpKTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGVsID0gW2osIGldO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgcG9zID0gaiArIHJvd3MgLSBpIC0gMTtcclxuICAgICAgICAgICAgICAgIGlmICghcmVzdWx0W3Bvc10pIHtcclxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbcG9zXSA9IFtdO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgcmVzdWx0W3Bvc10udW5zaGlmdChlbCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcclxuICAgIH1cclxuICAgIGNhbGNTdW51cE1hcCgpIHtcclxuICAgICAgICBjb25zdCByb3dzID0gdGhpcy5nYW1lLm9wdGlvbnMuZ2FtZVNpemUuaGVpZ2h0O1xyXG4gICAgICAgIGNvbnN0IGNvbHVtbnMgPSB0aGlzLmdhbWUub3B0aW9ucy5nYW1lU2l6ZS53aWR0aDtcclxuICAgICAgICBjb25zdCB0b3RhbCA9IGNvbHVtbnMgKyByb3dzIC0gMTtcclxuICAgICAgICBjb25zdCByZXN1bHQgPSBbXTtcclxuICAgICAgICBmb3IgKGxldCBpID0gcm93czsgaSA+PSAwOyBpLS0pIHtcclxuICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBjb2x1bW5zOyBqKyspIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGtleSA9IE1hcFdvcmxkLmNvb3Jkc1RvS2V5KGksIGopO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZWwgPSBbaSwgal07XHJcbiAgICAgICAgICAgICAgICBjb25zdCBwb3MgPSBpICsgajtcclxuICAgICAgICAgICAgICAgIGlmICghcmVzdWx0W3Bvc10pIHtcclxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbcG9zXSA9IFtdO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgcmVzdWx0W3Bvc10udW5zaGlmdChlbCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcclxuICAgIH1cclxuICAgIGdldEhlaWdodERyb3BvZmYoY3VycmVudEhlaWdodCwgcHJldmlvdXNIZWlnaHQpIHtcclxuICAgICAgICBsZXQgZHJvcG9mZiA9IEhlaWdodERyb3BvZmZbcHJldmlvdXNIZWlnaHRdIC0gSGVpZ2h0RHJvcG9mZltjdXJyZW50SGVpZ2h0XTtcclxuICAgICAgICBpZiAoZHJvcG9mZiA+IDApIHtcclxuICAgICAgICAgICAgZHJvcG9mZiA9IDEgLSBkcm9wb2ZmO1xyXG4gICAgICAgICAgICAvLyBzaW5jZSB0aGlzIGlzIHVzZWQgdG8gcmVwcmVzZW50IGxpZ2h0IGxhdGVyLCB3ZSB3YW50IHRvIG1lYXN1cmUgdGhlIGRyb3AgYmV0d2VlbiBhbWJpZW50IGxpZ2h0IGFuZCAwIGxpZ2h0XH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2V5XTtcclxuICAgICAgICBsZXQgZHJvcG9mZiA9IDA7XHJcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhZGphY2VudC5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICBjb25zdCBhZGphY2VudEhlaWdodExheWVyID0gYWRqYWNlbnRbaV07XHJcbiAgICAgICAgICAgIGNvbnN0IGN1cnJlbnREcm9wb2ZmID0gdGhpcy5nZXRPY2NsdXNpb25IZWlnaHREcm9wb2ZmKGhlaWdodExldmVsLCBhZGphY2VudEhlaWdodExheWVyKTtcclxuICAgICAgICAgICAgaWYgKGN1cnJlbnREcm9wb2ZmID4gMCkge1xyXG4gICAgICAgICAgICAgICAgaWYgKGRyb3BvZmYgPT09IDApIHtcclxuICAgICAgICAgICAgICAgICAgICBkcm9wb2ZmID0gY3VycmVudERyb3BvZmY7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBkcm9wb2ZmICo9IGN1cnJlbnREcm9wb2ZmO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGRyb3BvZmYgPSBNYXRoLnJvdW5kKGRyb3BvZmYgKiAxMDAwKSAvIDEwMDA7XHJcbiAgICAgICAgdGhpcy5kcm9wb2ZmTWFwc1tcInRvcGRvd25cIl1bMV1ba2V5XSA9IGRyb3BvZmY7XHJcbiAgICAgICAgcmV0dXJuIGRyb3BvZmY7XHJcbiAgICB9XHJcbiAgICBnZXRTaGFkb3dGb3IoeCwgeSwgZGlyKSB7XHJcbiAgICAgICAgY29uc3Qga2V5ID0gTWFwV29ybGQuY29vcmRzVG9LZXkoeCwgeSk7XHJcbiAgICAgICAgLy8gdG9wZG93biBoYXMgb25seSAxIHNoYWRvd0xlbmd0aFxyXG4gICAgICAgIGNvbnN0IG1hcCA9IHRoaXMuZHJvcG9mZk1hcHNbZGlyX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6IHRydWUsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIGxhYmVsOiBcInVuZGVyMTVcIixcclxuICAgICAgICAgICAgICAgIHRocmVzaG9sZDogMC4xNSxcclxuICAgICAgICAgICAgICAgIGlzTmVnYXRpdmU6IHRydWUsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIGxhYmVsOiBcInVuZGVyMFwiLFxyXG4gICAgICAgICAgICAgICAgdGhyZXNob2xkOiAwLFxyXG4gICAgICAgICAgICAgICAgaXNOZWdhdGl2ZTogdHJ1ZSxcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICBdKTtcclxuICAgICAgICBjb25zb2xlLmxvZyhcInRlbXAgbWFwXCIsIHN0YXRzLCB0aGlzLnRlbXBNYXAudGVtcE1hcCk7XHJcbiAgICAgICAgLy8gYXNzaWduIGJpb21lIG1hcCB1c2luZyBjbGltYXRlIG1hcHNcclxuICAgICAgICBmb3IgKGxldCB4ID0gMDsgeCA8IHdpZHRoOyB4KyspIHtcclxuICAgICAgICAgICAgZm9yIChsZXQgeSA9IDA7IHkgPCBoZWlnaHQ7IHkrKykge1xyXG4gICAgICAgICAgICAgICAgY29uc3Qga2V5ID0gTWFwV29ybGQuY29vcmRzVG9LZXkoeCwgeSk7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmJpb21lTWFwW2tleV0gPSB0aGlzLmFzc2lnbkJpb21lKHgsIHkpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIC8vIHVwZGF0ZSBhZGphY2VuY3kgbWFwcyBhZ2FpblxyXG4gICAgICAgIHRoaXMucmVnZW5lcmF0ZUFkamFjZW5jeU1hcChcImJpb21lXCIpO1xyXG4gICAgICAgIC8vIGFzc2lnbiBiaW9tZSBtYXAgdXNpbmcgY2xpbWF0ZSBtYXBzXHJcbiAgICAgICAgZm9yIChsZXQg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cbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKGlzTG93ZXJIZWlnaHQpIHtcclxuICAgICAgICAgICAgdGhpcy5zaGlmdEhlaWdodCh4LCB5LCBiaW9tZSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBiaW9tZTtcclxuICAgIH1cclxuICAgIC8vIHByaXZhdGUgcmVnZW5lcmF0ZUFkamFjZW5jeU1hcChtYXA6IFwidGVycmFpblwiIHwgXCJiaW9tZVwiKSB7XHJcbiAgICAvLyAgIGZvciAobGV0IHggPSAwOyB4IDwgdGhpcy5nYW1lLm9wdGlvbnMuZ2FtZVNpemUud2lkdGg7IHgrKykge1xyXG4gICAgLy8gICAgIGZvciAobGV0IHkgPSAwOyB5IDwgdGhpcy5nYW1lLm9wdGlvbnMuZ2FtZVNpemUuaGVpZ2h0OyB5KyspIHtcclxuICAgIC8vICAgICAgIGNvbnN0IGtleSA9IE1hcFdvcmxkLmNvb3Jkc1RvS2V5KHgsIHkpO1xyXG4gICAgLy8gICAgICAgaWYgKG1hcCA9PT0gXCJ0ZXJyYWluXCIpIHtcclxuICAgIC8vICAgICAgICAgdGhpcy50ZXJyYWluQWRqYWNlbmN5RDFNYXBba2V5XSA9IHRoaXMuYXNzaWduQWRqYWNlbnRCaW9tZXMoXHJcbiAgICAvLyAgICAgICAgICAgeCxcclxuICAgIC8vICAgICAgICAgICB5LFxyXG4gICAgLy8gICAgICAgICAgIHRoaXMudGVycmFpbk1hcCxcclxuICAgIC8vICAgICAgICAgICAxXHJcbiAgICAvLyAgICAgICAgICk7XHJcbiAgICAvLyAgICAgICAgIHRoaXMudGVycmFpbkFkamFjZW5jeUQyTWFwW2tleV0gPSB0aGlzLmFzc2lnbkFkamFjZW50QmlvbWVzKFxyXG4gICAgLy8gICAgICAgICAgIHgsXHJcbiAgICAvLyAgICAgICAgICAgeSxcclxuICAgIC8vICAgICAgICAgICB0aGlzLnRlcnJhaW5NYXAsXHJcbiAgICAvLyAgICAgICAgICAgMlxyXG4gICAgLy8gICAgICAgICApO1xyXG4gICAgLy8gICAgICAgfSBlbHNlIGlmIChtYXAgPT09IFwiYmlvbWVcIikge1xyXG4gICAgLy8gICAgICAgICB0aGlzLmJpb21lQWRqYWNlbmN5RDFNYXBba2V5XSA9IHRoaXMuYXNzaWduQWRqYWNlbnRCaW9tZXMoXHJcbiAgICAvLyAgICAgICAgICAgeCxcclxuICAgIC8vICAgICAgICAgICB5LFxyXG4gICAgLy8gICAgICAgICAgIHRoaXMuYmlvbWVNYXAsXHJcbiAgICAvLyAgICAgICAgICAgMVxyXG4gICAgLy8gICAgICAgICApO1xyXG4gICAgLy8gICAgICAgICB0aGlzLmJpb21lQWRqYWNlbmN5RDJNYXBba2V5XSA9IHRoaXMuYXNzaWduQWRqYWNlbnRCaW9tZXMoXHJcbiAgICAvLyAgICAgICAgICAgeCxcclxuICAgIC8vICAgICAgICAgICB5LFxyXG4gICAgLy8gICAgICAgICAgIHRoaXMuYmlvbWVNYXAsXHJcbiAgICAvLyAgICAgICAgICAgMlxyXG4gICAgLy8gICAgICAgICApO1xyXG4gICAgLy8gICAgICAgfVxyXG4gICAgLy8gICAgIH1cclxuICAgIC8vICAgfVxyXG4gICAgLy8gfVxyXG4gICAgcmVnZW5lcmF0ZUFkamFjZW5jeU1hcChtYXApIHtcclxuICAgICAgICBmb3IgKGxldCB4ID0gMDsgeCA8IHRoaXMuZ2FtZS5vcHRpb25zLmdhbWVTaXplLndpZHRoOyB4KyspIHtcclxuICAgICAgICAgICAgZm9yIChsZXQgeSA9IDA7IHkgPCB0aGlzLmdhbWUub3B0aW9ucy5nYW1lU2l6ZS5oZWlnaHQ7IHkrKykge1xyXG4gICAgICAgICAgICAgICAgY29uc3Qga2V5ID0gTWFwV29ybGQuY29vcmRzVG9LZXkoeCwgeSk7XHJcbiAgICAgICAgICAgICAgICBpZiAobWFwID09PSBcInRlcnJhaW5cIikge1xyXG4gICAgICAgICAgICAgICAgICAgIHR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G4gICAgICAgICAgICAgICAgICAgIHRoaXMuaGVpZ2h0TGF5ZXJBZGphY2VuY3lEMU1hcFtrZXldID0gdGhpcy5hc3NpZ25BZGphY2VudEhlaWdodExheWVycyh4LCB5LCB0aGlzLmhlaWdodExheWVyTWFwLCAxKTtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmhlaWdodExheWVyQWRqYWNlbmN5RDJNYXBba2V5XSA9IHRoaXMuYXNzaWduQWRqYWNlbnRIZWlnaHRMYXllcnMoeCwgeSwgdGhpcy5oZWlnaHRMYXllck1hcCwgMik7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBhc3NpZ25BZGphY2VudEJpb21lcyh4LCB5LCBtYXAsIGRpc3RhbmNlID0gMSkge1xyXG4gICAgICAgIGNvbnN0IGtleSA9IE1hcFdvcmxkLmNvb3Jkc1RvS2V5KHgsIHkpO1xyXG4gICAgICAgIGNvbnN0IGhlaWdodFZhbCA9IHRoaXMuaGVpZ2h0TWFwW2tleV07XHJcbiAgICAgICAgY29uc3QgdGVycmFpbiA9IHRoaXMudGVycmFpbk1hcFtrZXldO1xyXG4gICAgICAgIGNvbnN0IGFkamFjZW50QmlvbWVzID0gW107XHJcbiAgICAgICAgbGV0IHBvcztcclxuICAgICAgICBsZXQgYmlvbWU7XHJcbiAgICAgICAgZm9yIChsZXQgeE9mZnNldCA9IC1kaXN0YW5jZTsgeE9mZnNldCA8PSBkaXN0YW5jZTsgeE9mZnNldCsrKSB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IHlPZmZzZXQgPSAtZGlzdGFuY2U7IHlPZmZzZXQgPD0gZGlzdGFuY2U7IHlPZmZzZXQrKykge1xyXG4gICAgICAgICAgICAgICAgaWYgKHhPZmZzZXQgPT09IDAgJiYgeU9mZnNldCA9PT0gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgcG9zID0gbmV3IFBvaW50KHggKyB4T2Zmc2V0LCB5ICsgeU9mZnNldCk7XHJcbiAgICAgICAgICAgICAgICBiaW9tZSA9IG1hcFtNYXBXb3JsZC5jb29yZHNUb0tleShwb3MueCwgcG9zLnkpXTtcclxuICAgICAgICAgICAgICAgIGFkamFjZW50QmlvbWVzLnB1c2goYmlvbWUpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBhZGphY2VudEJpb21lcztcclxuICAgIH1cclxuICAgIGFzc2lnbkFkamFjZW50SGVpZ2h0cyh4LCB5LCBtYXAsIGRpc3RhbmNlID0gMSkge1xyXG4gICAgICAgIGNvbnN0IGtleSA9IE1hcFdvcmxkLmNvb3Jkc1RvS2V5KHgsIHkpO1xyXG4gICAgICAgIGNvbnN0IGFkamFjZW50SGVpZ2h0cyA9IFtdO1xyXG4gICAgICAgIGxldCBwb3M7XHJcbiAgICAgICAgbGV0IGhlaWdodDtcclxuICAgICAgICBmb3IgKGxldCB4T2Zmc2V0ID0gLWRpc3RhbmNlOyB4T2Zmc2V0IDw9IGRpc3RhbmNlOyB4T2Zmc2V0KyspIHtcclxuICAgICAgICAgICAgZm9yIChsZXQgeU9mZnNldCA9IC1kaXN0YW5jZTsgeU9mZnNldCA8PSBkaXN0YW5jZTsgeU9mZnNldCsrKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoeE9mZnNldCA9PT0gMCAmJiB5T2Zmc2V0ID09PSAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBwb3MgPSBuZXcgUG9pbnQoeCArIHhPZmZzZXQsIHkgKyB5T2Zmc2V0KTtcclxuICAgICAgICAgICAgICAgIGhlaWdodCA9IG1hcFtNYXBXb3JsZC5jb29yZHNUb0tleShwb3MueCwgcG9zLnkpXTtcclxuICAgICAgICAgICAgICAgIGFkamFjZW50SGVpZ2h0cy5wdXNoKGhlaWdodCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIGFkamFjZW50SGVpZ2h0cztcclxuICAgIH1cclxuICAgIGFzc2lnbkFkamFjZW50SGVpZ2h0TGF5ZXJzKHgsIHksIG1hcCwgZGlzdGFuY2UgPSAxKSB7XHJcbiAgICAgICAgY29uc3Qga2V5ID0gTWFwV29ybGQuY29vcmRzVG9LZXkoeCwgeSk7XHJcbiAgICAgICAgY29uc3QgYWRqYWNlbnRIZWlnaHRMYXllcnMgPSBbXTtcclxuICAgICAgICBsZXQgcG9zO1xyXG4gICAgICAgIGxldCBoZWlnaHRMYXllcjtcclxuICAgICAgICBmb3IgKGxldCB4T2Zmc2V0ID0gLWRpc3RhbmNlOyB4T2Zmc2V0IDw9IGRpc3RhbmNlOyB4T2Zmc2V0KyspIHtcclxuICAgICAgICAgICAgZm9yIChsZXQgeU9mZnNldCA9IC1kaXN0YW5jZTsgeU9mZnNldCA8PSBkaXN0YW5jZTsgeU9mZnNldCsrKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoeE9mZnNldCA9PT0gMCAmJiB5T2Zmc2V0ID09PSAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBwb3MgPSBuZXcgUG9pbnQoeCArIHhPZmZzZXQsIHkgKyB5T2Zmc2V0KTtcclxuICAgICAgICAgICAgICAgIGhlaWdodExheWVyID0gbWFwW01hcFdvcmxkLmNvb3Jkc1RvS2V5KHBvcy54LCBwb3MueSldO1xyXG4gICAgICAgICAgICAgICAgYWRqYWNlbnRIZWlnaHRMYXllcnMucHVzaChoZWlnaHRMYXllcik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIGFkamFjZW50SGVpZ2h0TGF5ZXJzO1xyXG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ImFkamFjZW50VGVycmFpbiBmb3IgXCIgKyB4ICsgXCIsIFwiICsgeSwgYWRqYWNlbnRUZXJyYWluKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhZGphY2VudFRlcnJhaW4ubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgaWYgKCF0ZXJyYWluLmluY2x1ZGVzKGFkamFjZW50VGVycmFpbltpXSkpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgIH1cclxuICAgIGFzc2lnbkJpb21lKHgsIHkpIHtcclxuICAgICAgICBjb25zdCBrZXkgPSBNYXBXb3JsZC5jb29yZHNUb0tleSh4LCB5KTtcclxuICAgICAgICBjb25zdCBoZWlnaHRWYWwgPSB0aGlzLmhlaWdodE1hcFtrZXldO1xyXG4gICAgICAgIGNvbnN0IG1vaXN0dXJlVmFsID0gdGhpcy5tb2lzdHVyZU1hcC5nZXRNb2lzdHVyZUJ5S2V5KGtleSk7XHJcbiAgICAgICAgY29uc3QgdGVycmFpbiA9IHRoaXMudGVycmFpbk1hcFtrZXldO1xyXG4gICAgICAgIGNvbnN0IG1hcHMgPSB7XHJcbiAgICAgICAgICAgIGhlaWdodDogdGhpcy5oZWlnaHRNYXAsXHJcbiAgICAgICAgICAgIHRlbXBlcmF0dXJlOiB0aGlzLnRlbXBNYXAudGVtcE1hcCxcclxuICAgICAgICAgICAgbW9pc3R1cmU6IHRoaXMubW9pc3R1cmVNYXAubW9pc3R1cmVNYXAsXHJcbiAgICAgICAgfTtcclxuICAgICAgICBpZiAodGVycmFpbiA9PT0gQmlvbWVzLkJpb21lcy5vY2Vhbikge1xyXG4gICAgICAgICAgICBpZiAoQmlvbWVzLmluUmFuZ2VPZkFsbCh4LCB5LCBtYXBzLCBCaW9tZXMuQmlvbWVzLm9jZWFuZGV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yXG4gICAgICAgICAgICByZXR1cm4gQmlvbWVzLkJpb21lcy5tb2lzdGRpcnQ7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgZ2VuZXJhdGVBdXRvdGlsZU1hcChyYXdNYXApIHtcclxuICAgICAgICAvLyBjb25zb2xlLmxvZyhcInJhd01hcCB0byBzdGFydCB3aXRoOiBcIiwgcmF3TWFwKTtcclxuICAgICAgICB0aGlzLmF1dG90aWxlTWFwID0gQXV0b3RpbGUuYXV0b3RpbGUocmF3TWFwKTtcclxuICAgICAgICBsZXQgdGlsZUluZGV4O1xyXG4gICAgICAgIGxldCBiaW9tZTtcclxuICAgICAgICBsZXQgYmlvbWVJZDtcclxuICAgICAgICBsZXQgc2Vhc29uO1xyXG4gICAgICAgIGxldCB0aWxlO1xyXG4gICAgICAgIHNlYXNvbiA9IHRoaXMuZ2FtZS50aW1lTWFuYWdlci5zZWFzb247XHJcbiAgICAgICAgT2JqZWN0LmtleXModGhpcy5hdXRvdGlsZU1hcCkuZm9yRWFjaCgocG9zKSA9PiB7XHJcbiAgICAgICAgICAgIHRpbGVJbmRleCA9IHRoaXMuYXV0b3RpbGVNYXBbcG9zXTtcclxuICAgICAgICAgICAgYmlvbWUgPSByYXdNYXBbcG9zXTtcclxuICAgICAgICAgICAgYmlvbWVJZCA9IGJpb21lLmlkO1xyXG4gICAgICAgICAgICBpZiAoIShiaW9tZSA9PT0gbnVsbCB8fCBiaW9tZSA9PT0gdm9pZCAwID8gdm9pZCAwIDogYmlvbWUuYXV0b3RpbGVQcmVmaXgpKSB7XHJcbiAgICAgICAgICAgICAgICAvLyB1c2UgdGhlIGJhc2UgdGlsZSByYXRoZXIgdGhhbiBhdXRvdGlsaW5nXHJcbiAgICAgICAgICAgICAgICB0aWxlID0gVGlsZS5UaWxlc2V0c1tiaW9tZUlkXVtzZWFzb25dW0Jhc2VUaWxlS2V5XTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgIC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GxldCBrZXkgaW4gdGhpcy50aWxlTWFwKSB7XHJcbiAgICAgICAgICAgIC8vIHRoaXMgZ29lcyB0aHJvdWdoIGV2ZXJ5IHNpbmdsZSB0aWxlXHJcbiAgICAgICAgICAgIC8vIERPTlQgQUREIFVOTkVDRVNTQVJZIENPREUgVE8gVEhFIE9VVEVSIExPT1BcclxuICAgICAgICAgICAgaWYgKHRoaXMudGlsZU1hcFtrZXldLmJpb21lSWQgPT09IGJpb21lVHlwZSkge1xyXG4gICAgICAgICAgICAgICAgbGV0IHBvcyA9IE1hcFdvcmxkLmtleVRvUG9pbnQoa2V5KTtcclxuICAgICAgICAgICAgICAgIGlmICghb25seVBhc3NhYmxlIHx8IChvbmx5UGFzc2FibGUgJiYgdGhpcy5pc1Bhc3NhYmxlKHBvcy54LCBwb3MueSkpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzUGxhbnQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcG9zID0gVGlsZS50cmFuc2xhdGVQb2ludChwb3MsIExheWVyLlRFUlJBSU4sIExheWVyLlBMQU5UKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLnB1c2gocG9zLCBuZXcgUG9pbnQocG9zLnggKyAxLCBwb3MueSksIG5ldyBQb2ludChwb3MueCwgcG9zLnkgKyAxKSwgbmV3IFBvaW50KHBvcy54ICsgMSwgcG9zLnkgKyAxKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBidWZmZXIucHVzaChwb3MpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBsZXQgaW5kZXg7XHJcbiAgICAgICAgd2hpbGUgKGJ1ZmZlci5sZW5ndGggPiAwICYmIHJlc3VsdC5sZW5ndGggPCBxdW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nVzZXJJbnRlcmZhY2UgPSB1c2VySW50ZXJmYWNlO1xyXG4gICAgICAgIHRoaXMucG9zaXRpb24gPSBwb3NpdGlvbjtcclxuICAgICAgICB0aGlzLm1heFdpZHRoID0gbWF4V2lkdGg7XHJcbiAgICAgICAgdGhpcy5tYXhMaW5lcyA9IG1heExpbmVzO1xyXG4gICAgICAgIHRoaXMubGluZXMgPSBbXTtcclxuICAgIH1cclxuICAgIGNsZWFyKCkge1xyXG4gICAgICAgIHRoaXMubGluZXMgPSBbXTtcclxuICAgIH1cclxuICAgIGFwcGVuZFRleHQodGV4dCkge1xyXG4gICAgICAgIHRoaXMubGluZXMuc3BsaWNlKDAsIDAsIHRleHQpO1xyXG4gICAgICAgIGlmICh0aGlzLmxpbmVzLmxlbmd0aCA+IHRoaXMubWF4TGluZXMpIHtcclxuICAgICAgICAgICAgdGhpcy5saW5lcy5zcGxpY2UodGhpcy5tYXhMaW5lcywgdGhpcy5saW5lcy5sZW5ndGggLSB0aGlzLm1heExpbmVzKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBkcmF3KCkge1xyXG4gICAgICAgIGxldCBsaW5lUG9zaXRpb24gPSBuZXcgUG9pbnQodGhpcy5wb3NpdGlvbi54LCB0aGlzLnBvc2l0aW9uLnkpO1xyXG4gICAgICAgIGZvciAobGV0IGluZGV4ID0gMDsgaW5kZXggPCB0aGlzLm1heExpbmVzICYmIGluZGV4IDwgdGhpcy5saW5lcy5sZW5ndGg7ICsraW5kZXgpIHtcclxuICAgICAgICAgICAgdGhpcy51c2VySW50ZXJmYWNlLmRyYXdUZXh0KGxpbmVQb3NpdGlvbiwgdGhpcy5saW5lc1tpbmRleF0sIHRoaXMubWF4V2lkdGgpO1xyXG4gICAgICAgICAgICArK2xpbmVQb3NpdGlvbi55O1xyXG4gICAgICAgIH1cclxuICAgIH1cclxufVxyXG4iLCJpbXBvcnQgeyBDb2xvciwgUk5HIH0gZnJvbSBcInJvdC1qc1wiO1xyXG5leHBv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yLCBncmV5LCBhbW91bnQpO1xyXG4vLyB9XHJcbmV4cG9ydCBmdW5jdGlvbiBnZXRNYXBTdGF0cyh2YWx1ZXMsIHN0YXRpc3RpY3MpIHtcclxuICAgIGNvbnN0IGNvdW50ID0gdmFsdWVzLmxlbmd0aDtcclxuICAgIGxldCBzdGF0cyA9IHN0YXRpc3RpY3MubWFwKChzdGF0KSA9PiB7XHJcbiAgICAgICAgcmV0dXJuIE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSwgc3RhdCksIHsgYnVja2V0OiBbXSwgdmFsdWU6IG51bGwgfSk7XHJcbiAgICB9KTtcclxuICAgIGZvciAoY29uc3QgdmFsIG9mIHZhbHVlcykge1xyXG4gICAgICAgIGZvciAoY29uc3Qgc3RhdCBvZiBzdGF0cykge1xyXG4gICAgICAgICAgICBpZiAoc3RhdC5pc05lZ2F0aXZlKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAodmFsIDw9IHN0YXQudGhyZXNob2xkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc3RhdC5idWNrZXQucHVzaCh2YWwpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgaWYgKHZhbCA+PSBzdGF0LnRocmVzaG9sZCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHN0YXQuYnVja2V0LnB1c2godmFsKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGZvciAoY29uc3Qgc3RhdCBvZiBzdGF0cykge1xyXG4gICAgICAgIHN0YXQudmFsdWUgPSBNYXRoLnJvdW5kKChzdGF0LmJ1Y2tldC5sZW5ndGggLyBjb3VudCkgKiAxMDApIC8gMTAwO1xyXG4gICAgICAgIGRlbGV0ZSBzdGF0LmJ1Y2tldDtcclxuICAgIH1cclxuICAgIHJldHVybiBzdGF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ICAgICAgIHJldHVybiB0aGlzLnggPT0gcG9pbnQueCAmJiB0aGlzLnkgPT0gcG9pbnQueTtcclxuICAgIH1cclxuICAgIHRvS2V5KCkge1xyXG4gICAgICAgIHJldHVybiBgJHt0aGlzLnh9LCR7dGhpcy55fWA7XHJcbiAgICB9XHJcbiAgICBtYW5oYXR0YW5EaXN0YW5jZShwb2ludCkge1xyXG4gICAgICAgIHJldHVybiBNYXRoLmFicyh0aGlzLnggLSBwb2ludC54KSArIE1hdGguYWJzKHRoaXMueSAtIHBvaW50LnkpO1xyXG4gICAgfVxyXG4gICAgZGlzdGFuY2UocG9pbnQpIHtcclxuICAgICAgICByZXR1cm4gTWF0aC5zcXJ0KE1hdGgucG93KHRoaXMueCAtIHBvaW50LngsIDIpICsgTWF0aC5wb3codGhpcy55IC0gcG9pbnQueSwgMikpO1xyXG4gICAgfVxyXG4gICAgLy8gcmV0dXJuIHZhbHVlIGlzIGEgdHVwbGUgb2YgW2R4LCBkeV1cclxuICAgIC8vIGkuZS4gWzEsIDBdIGZvciByaWdodFxyXG4gICAgbW92ZW1lbnRWZWN0b3IocG9pbnQpIHtcclxuICAgICAgICAvLyByZXR1cm4gRElSU1s0XVsyXSBmb3IgZG93blxyXG4gICAgICAgIC8vIHJldHVybiBESVJTWzRdWzNdIGZvciByaWdodFxyXG4gICAgICAgIC8vIHJldHVybiBESVJTWzRdWzBdIGZvciB1cFxyXG4gICAgICAgIC8vIHJldHVybiBESVJTWzRdWzFdIGZvciBsZWZ0XHJcbiAgICAgICAgbGV0IGR4ID0gcG9pbnQueCAtIHRoaXMueDtcclxuICAgICAgICBsZXQgZHkgPSBwb2ludC55IC0gdGhpcy55O1xyXG4gICAgICAgIGlmIChkeCA9PSAwICYmIGR5ID09IDApIHtcclxuICAgICAgICAgICAgcmV0dXJuIFswLCAwXTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKGR4ID09IDApIHtcclxuICAgICAgICAgICAgcmV0dXJuIChkeSA+IDAgPyBESV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IHtcclxuICAgICAgICB0aGlzLmdhbWUgPSBnYW1lO1xyXG4gICAgICAgIHRoaXMudGVycmFpbkxheWVyID0gbmV3IFBJWEkuQ29udGFpbmVyKCk7XHJcbiAgICAgICAgdGhpcy5ncm91bmRGWExheWVyID0gbmV3IFBJWEkuQ29udGFpbmVyKCk7XHJcbiAgICAgICAgdGhpcy5wbGFudExheWVyID0gbmV3IFBJWEkuQ29udGFpbmVyKCk7XHJcbiAgICAgICAgdGhpcy5lbnRpdHlMYXllciA9IG5ldyBQSVhJLkNvbnRhaW5lcigpO1xyXG4gICAgICAgIHRoaXMudWlMYXllciA9IG5ldyBQSVhJLkNvbnRhaW5lcigpO1xyXG4gICAgICAgIFBJWEkuc2V0dGluZ3MuUk9VTkRfUElYRUxTID0gdHJ1ZTtcclxuICAgICAgICBQSVhJLnNldHRpbmdzLlJFTkRFUl9PUFRJT05TLmFudGlhbGlhcyA9IGZhbHNlO1xyXG4gICAgICAgIHRoaXMudGVycmFpbkxheWVyLnpJbmRleCA9IDU7XHJcbiAgICAgICAgdGhpcy5ncm91bmRGWExheWVyLnpJbmRleCA9IDEwO1xyXG4gICAgICAgIHRoaXMucGxhbnRMYXllci56SW5kZXggPSAyNTtcclxuICAgICAgICB0aGlzLnBsYW50TGF5ZXIuc29ydGFibGVDaGlsZHJlbiA9IHRydWU7XHJcbiAgICAgICAgdGhpcy5lbnRpdHlMYXllci56SW5kZXggPSAxNTtcclxuICAgICAgICB0aGlzLnVpTGF5ZXIuekluZGV4ID0gMTAwO1xyXG4gICAgICAgIHRoaXMuZGlzcGxheU9iakNhY2hlID0ge1xyXG4gICAgICAgICAgICBbTGF5ZXIuVEVSUkFJTl06IHt9LFxyXG4gICAgICAgICAgICBbTGF5ZXIuR1JPVU5ERlhdOiB7fSxcclxuICAgICAgICAgICAgW0xheWVyLlBMQU5UXToge30sXHJcbiAgICAgICAgICAgIFtMYXllci5FTlRJVFldOiB7fSxcclxuICAgICAgICAgICAgW0xheWVyLlVJXToge30sXHJcbiAgICAgICAgfTtcclxuICAgIH1cclxuICAgIGFkZExheWVyc1RvU3RhZ2Uoc3RhZ2UpIHtcclxuICAgICAgICBzdGFnZS5hZGRDaGlsZCh0aGlzLnRlcnJhaW5MYXllcik7XHJcbiAgICAgICAgc3RhZ2UuYWRkQ2hpbGQodGhpcy5ncm91bmRGWExheWVyKTtcclxuICAgICAgICBzdGFnZS5hZGRDaGlsZCh0aGlzLnBsYW50TGF5ZXIpO1xyXG4gICAgICAgIHN0YWdlLmFkZENoaWxkKHRoaXMuZW50aXR5TGF5ZXIpO1xyXG4gICAgICAgIHN0YWdlLmFkZENoaWxkKHRoaXMudWlMYXllcik7XHJcbiAgICB9XHJcbiAgICByZW5kZXJMYXllcnMobGF5ZXJzLCB3aWR0aCwgaGVpZ2h0LCB2aWV3cG9ydENlbnRlclRpbGUpIHtcclxuICAgICAgICBsZXQgY2VudGVyVmlld3BvcnQ7XHJcbiAgICAgICAgbGV0IHJpZ2h0O1xyXG4gICAgICAgIGxldCBib3R0b207XHJcbiAgICAgICAgbGV0IGxlZnQ7XHJcbiAgICAgICAgbGV0IHRvcDtcclxuICAgICAgICBmb3IgKGxldCBsYXllciBvZiBsYXllcnMpIHtcclxuICAgICAgICAgICAgaWYgKGxheWVyID09PSBMYXllci5QTEFOVCB8fCBsYXllciA9PT0gTGF5ZXIuR1JPVU5ERlgpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHJhdGlvID0gVGlsZS5zaXplIC8gVGlsZS5wbGFudFNpemU7XHJcbiAgICAgICAgICAgICAgICBjZW50ZXJWaWV3cG9ydCA9IFRpbGUudHJhbnNsYXRlUG9pbnQodmlld3BvcnRDZW50ZXJUaWxlLCBMYXllci5URVJSQUlOLCBMYXllci5QTEFOVCk7XHJcbiAgICAgICAgICAgICAgICByaWdodCA9IGNlbnRlclZpZXdwb3J0LnggKyBNYXRoLmNlaWwoKHdpZHRoIC8gMikgKiByYXRpbyk7XHJcbiAgICAgICAgICAgICAgICBib3R0b20gPSBjZW50ZXJWaWV3cG9ydC55ICsgTWF0aC5jZWlsKChoZWlnaHQgLyAyKSAqIHJhdGlvKTtcclxuICAgICAgICAgICAgICAgIGxlZnQgPSBjZW50ZXJWaWV3cG9ydC54IC0gTWF0aC5mbG9vcigod2lkdGggLyAyKSAqIHJhdGlvKTtcclxuICAgICAgICAgICAgICAgIHRvcCA9IGNlbnRlclZpZXdwb3J0LnkgLSBNYXRoLmZsb29yKChoZWlnaHQgLyAyKSAqIHJhdGlvKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIGNlbnRlclZpZXdwb3J0ID0gdmlld3BvcnRDZW50ZXJUaWxlO1xyXG4gICAgICAgICAgICAgICAgcmlnaHQgPSBjZW50ZXJWaWV3cG9ydC54ICsgTWF0aC5jZWlsKHdpZHRoIC8gMik7XHJcbiAgICAgICAgICAgICAgICBib3R0b20gPSBjZW50ZXJWaWV3cG9ydC55ICsgTWF0aC5jZWlsKGhlaWdodCAvIDIpO1xyXG4gICAgICAgICAgICAgICAgbGVmdCA9IGNlbnRlclZpZXdwb3J0LnggLSBNYXRoLmZsb29yKHdpZHRoIC8gMik7XHJcbiAgICAgICAgICAgICAgICB0b3AgPSBjZW50ZXJWaWV3cG9ydC55IC0gTWF0aC5mbG9vcihoZWlnaHQgLyAyKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAobGF5ZXIgIT09IExheWVyLkVOVElUWSkge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5jbGVhckxheWVyKGxheWVyKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBmb3IgKGxldCB4ID0gbGVmdDsgeCA8IHJpZ2h0OyB4KyspIHtcclxuICAgICAgICAgICAgICAgIGZvciAobGV0IHkgPSB0b3A7IHkgPCBib3R0b207IHkrKykge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGtleSA9IE1hcFdvcmxkLmNvb3Jkc1RvS2V5KHgsIHkpO1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBkaXNwbGF5T2JqID0gdGhpcy5kaXNwbGF5T2JqQ2FjaGVbbGF5ZXJdW2tleV07XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlzU3ByaXRlID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFkaXNwbGF5T2JqKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBpc1Nwcml0ZSA9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXlPYmogaW5zdGFuY2VvZiBQSVhJLlNwcml0ZSB8fFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheU9iaiBpbnN0YW5jZW9mIFBJWEkuQW5pbWF0ZWRTcHJpdGU7XHJcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChsYXllcikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIExheWVyLlRFUlJBSU46IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMudGludE9iamVjdFdpdGhDaGlsZHJlbihkaXNwbGF5T2JqLCBuZXcgUG9pbnQoeCwgeSkpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy50ZXJyYWluTGF5ZXIuYWRkQ2hpbGQoZGlzcGxheU9iaik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIExheWVyLkdST1VOREZYOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzLnRpbnRPYmplY3RXaXRoQ2hpbGRyZW4oZGlzcGxheU9iaiwgbmV3IFBvaW50KHgsIHkpKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZ3JvdW5kRlhMYXllci5hZGRDaGlsZChkaXNwbGF5T2JqKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgTGF5ZXIuUExBTlQ6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRlcnJhaW5Qb2ludCA9IFRpbGUudHJhbnNsYXRlUG9pbnQobmV3IFBvaW50KHgsIHkpLCBMYXllci5QTEFOVCwgTGF5ZXIuVEVSUkFJTik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnRpbnRPYmplY3RXaXRoQ2hpbGRyZW4oZGlzcGxheU9iaiwgdGVycmFpblBvaW50KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRpc3BsYXlPYmouekluZGV4ID0gdGhpcy5nYW1lLm9wdGlvbnMuZ2FtZVNpemUuaGVpZ2h0ICogcmF0aW8gLSB5O1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wbGFudExheWVyLmFkZENoaWxkKGRpc3BsYXlPYmopO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBMYXllci5FTlRJVFk6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMudGludE9iamVjdFdpdGhDaGlsZHJlbihkaXNwbGF5T2JqLCBuZXcgUG9pbnQoeCwgeSksIHRydWUpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5lbnRpdHlMYXllci5hZGRDaGlsZChkaXNwbGF5T2JqKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgTGF5ZXIuVUk6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMudWlMYXllci5hZGRDaGlsZChkaXNwbGF5T2JqKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgLy8gYWRkIHRoZSBzcHJpdGUgdG8gdGhlIGNhY2hlLCB0byBiZSByZW5kZXJlZCBvbiB0aGUgbmV4dCByZW5kZXIgcGFzc1xyXG4gICAgLy8gVE9ETzogZG9uJ3QgY3JlYXRlIHRoZSBzcHJpdGUgaGVyZSwganVzdCB0YWtlIGEgc3ByaXRlIG9yIGFuaW1hdGVkIHNwcml0ZSBhbmQgYWRkIGl0IHRvIHRoZSBjYWNoZVxyXG4gICAgYWRkVG9TY2VuZShwb3NpdGlvbiwgbGF5ZXIsIGRpc3BsYXlPYmosIGluaXRpYWxUaW50KSB7XHJcbiAgICAgICAgbGV0IGlzU3ByaXRlID0gZmFsc2U7XHJcbiAgICAgICAgaWYgKCFkaXNwbGF5T2JqKSB7XHJcbiAgICAgICAgICAgIC8vIHRocm93IChuZXcgRXJyb3IoXCJObyBzcHJpdGUgcHJvdmlkZWRcIiksIHBvc2l0aW9uLCBsYXllciwgc3ByaXRlLCB0aW50KTtcclxuICAgICAgICAgICAgY29uc29sZVxyXG4gICAgICAgICAgICAgICAgLnRocm90dGxlKDI1MClcclxuICAgICAgICAgICAgICAgIC5sb2coXCJFcnJvcjogYWRkVG9TY2VuZTogbm8gZGlzcGxheU9iaiBwcm92aWRlZFwiLCBwb3NpdGlvbiwgbGF5ZXIsIGRpc3BsYXlPYmosIGluaXRpYWxUaW50KTtcclxuICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpc1Nwcml0ZSA9XHJcbiAgICAgICAgICAgIGRpc3BsYXlPYmogaW5zdGFuY2VvZiBQSVhJLlNwcml0ZSB8fFxyXG4gICAgICAgICAgICAgICAgZGlzcGxheU9iaiBpbnN0YW5jZW9mIFBJWEkuQW5pbWF0ZWRTcHJpdGU7XHJcbiAgICAgICAgc3dpdGNoIChsYXllcikge1xyXG4gICAgICAgICAgICBjYXNlIExheWVyLlBMQU5UOiB7XHJcbiAgICAgICAgICAgICAgICBpZiAoaXNTcHJpdGUpIHtcclxuICAgICAgICAgICAgICAgICAgICBkaXNwbGF5T2JqLmFuY2hvci5zZXQoMC41KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIC8vIGNvbnN0IHJhdGlvID0gVGlsZS5zaXplIC8gVGlsZS5wbGFudFNpemU7XHJcbiAgICAgICAgICAgICAgICAvLyBjb25zdCB0ZXJyYWluUG9pbnQgPSBuZXcgUG9pbnQoXHJcbiAgICAgICAgICAgICAgICAvLyAgIE1hdGguZmxvb3IocG9zaXRpb24ueCAvIHJhdGlvKSxcclxuICAgICAgICAgICAgICAgIC8vICAgTWF0aC5mbG9vcihwb3NpdGlvbi55IC8gcmF0aW8pXHJcbiAgICAgICAgICAgICAgICAvLyApO1xyXG4gICAgICAgICAgICAgICAgLy8gZGlzcGxheU9iai56SW5kZXggPVxyXG4gICAgICAgICAgICAgICAgLy8gICB0aGlzLmdhbWUub3B0aW9ucy5nYW1lU2l6ZS5oZWlnaHQgKiByYXRpbyAtIHRlcnJhaW5Qb2ludC55O1xyXG4gICAgICAgICAgICAgICAgZGlzcGxheU9iai5wb3NpdGlvbi54ID0gcG9zaXRpb24ueCAqIFRpbGUucGxhbnRTaXplO1xyXG4gICAgICAgICAgICAgICAgZGlzcGxheU9iai5wb3NpdGlvbi55ID0gcG9zaXRpb24ueSAqIFRpbGUucGxhbnRTaXplO1xyXG4gICAgICAgICAgICAgICAgLy8gZGlzcGxheU9iai5zY2FsZS5zZXQoMSk7XHJcbiAgICAgICAgICAgICAgICAvLyBjb25zb2xlLmxvZyhcImFkZCBzcHJpdGUgdG8gcGxhbnRcIiwgc3ByaXRlLCBwb3NpdGlvbi54LCBwb3NpdGlvbi55KTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNhc2UgTGF5ZXIuVEVSUkFJTjoge1xyXG4gICAgICAgICAgICAgICAgaWYgKGlzU3ByaXRlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZGlzcGxheU9iai5hbmNob3Iuc2V0KDAuNSk7XHJcbiAgICAgICAgICAgICAgICAgICAgZGlzcGxheU9iai5zY2FsZS5zZXQoMik7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBkaXNwbGF5T2JqLnBvc2l0aW9uLnggPSBwb3NpdGlvbi54ICogVGlsZS5zaXplO1xyXG4gICAgICAgICAgICAgICAgZGlzcGxheU9iai5wb3NpdGlvbi55ID0gcG9zaXRpb24ueSAqIFRpbGUuc2l6ZTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNhc2UgTGF5ZXIuR1JPVU5ERlg6IHtcclxuICAgICAgICAgICAgICAgIGlmIChpc1Nwcml0ZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGRpc3BsYXlPYmouYW5jaG9yLnNldCgwLjUpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZGlzcGxheU9iai5wb3NpdGlvbi54ID0gcG9zaXRpb24ueCAqIFRpbGUucGxhbnRTaXplO1xyXG4gICAgICAgICAgICAgICAgZGlzcGxheU9iai5wb3NpdGlvbi55ID0gcG9zaXRpb24ueSAqIFRpbGUucGxhbnRTaXplO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY2FzZSBMYXllci5VSToge1xyXG4gICAgICAgICAgICAgICAgaWYgKGlzU3ByaXRlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZGlzcGxheU9iai5hbmNob3Iuc2V0KDAuNSk7XHJcbiAgICAgICAgICAgICAgICAgICAgZGlzcGxheU9iai5zY2FsZS5zZXQoMik7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBkaXNwbGF5T2JqLnBvc2l0aW9uLnggPSBwb3NpdGlvbi54ICogVGlsZS5zaXplO1xyXG4gICAgICAgICAgICAgICAgZGlzcGxheU9iai5wb3NpdGlvbi55ID0gcG9zaXRpb24ueSAqIFRpbGUuc2l6ZTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNhc2UgTGF5ZXIuRU5USVRZOiB7XHJcbiAgICAgICAgICAgICAgICBpZiAoaXNTcHJpdGUpIHtcclxuICAgICAgICAgICAgICAgICAgICBkaXNwbGF5T2JqLmFuY2hvci5zZXQoMC41KTtcclxuICAgICAgICAgICAgICAgICAgICAvLyBkaXNwbGF5T2JqLnNjYWxlLnNldCgxKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGRpc3BsYXlPYmoucG9zaXRpb24ueCA9IHBvc2l0aW9uLnggKiBUaWxlLnNpemU7XHJcbiAgICAgICAgICAgICAgICBkaXNwbGF5T2JqLnBvc2l0aW9uLnkgPSBwb3NpdGlvbi55ICogVGlsZS5zaXplO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKGluaXRpYWxUaW50ICYmIGlzU3ByaXRlKSB7XHJcbiAgICAgICAgICAgIGRpc3BsYXlPYmoudGludCA9IGluaXRpYWxUaW50IHx8IFwiMHhGRkZGRkZcIjtcclxuICAgICAgICB9XHJcb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cml0ZUJ5UG9zXHJcbiAgICAgICAgdGhpcy5kaXNwbGF5T2JqQ2FjaGVbbGF5ZXJdW2Ake3Bvc2l0aW9uLnh9LCR7cG9zaXRpb24ueX1gXSA9IHVuZGVmaW5lZDtcclxuICAgICAgICBzd2l0Y2ggKGxheWVyKSB7XHJcbiAgICAgICAgICAgIGNhc2UgTGF5ZXIuVEVSUkFJTjoge1xyXG4gICAgICAgICAgICAgICAgdGhpcy50ZXJyYWluTGF5ZXIucmVtb3ZlQ2hpbGQoY2FjaGVkT2JqKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNhc2UgTGF5ZXIuR1JPVU5ERlg6IHtcclxuICAgICAgICAgICAgICAgIHRoaXMuZ3JvdW5kRlhMYXllci5yZW1vdmVDaGlsZChjYWNoZWRPYmopO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY2FzZSBMYXllci5QTEFOVDoge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5wbGFudExheWVyLnJlbW92ZUNoaWxkKGNhY2hlZE9iaik7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjYXNlIExheWVyLkVOVElUWToge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5lbnRpdHlMYXllci5yZW1vdmVDaGlsZChjYWNoZWRPYmopO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNhc2UgTGF5ZXIuVUk6IHtcclxuICAgICAgICAgICAgICAgIHRoaXMudWlMYXllci5yZW1vdmVDaGlsZChjYWNoZWRPYmopO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgY2xlYXJDYWNoZShsYXllcikge1xyXG4gICAgICAgIGlmIChsYXllcikge1xyXG4gICAgICAgICAgICB0aGlzLmRpc3BsYXlPYmpDYWNoZVtsYXllcl0gPSB7fTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIHRoaXMuZGlzcGxheU9iakNhY2hlID0ge1xyXG4gICAgICAgICAgICAgICAgW0xheWVyLlRFUlJBSU5dOiB7fSxcclxuICAgICAgICAgICAgICAgIFtMYXllci5HUk9VTkRGWF06IHt9LFxyXG4gICAgICAgICAgICAgICAgW0xheWVyLlBMQU5UXToge30sXHJcbiAgICAgICAgICAgICAgICBbTGF5ZXIuRU5USVRZXToge30sXHJcbiAgICAgICAgICAgICAgICBbTGF5ZXIuVUldOiB7fSxcclxuICAgICAgICAgICAgfTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBjbGVhclNjZW5lKGNsZWFyQ2FjaGUgPSBmYWxzZSkge1xyXG4gICAgICAgIHRoaXMuY2xlYXJMYXllcihMYXllci5URVJSQUlOLCBjbGVhckNhY2hlKTtcclxuICAgICAgICB0aGlzLmNsZWFyTGF5ZXIoTGF5ZXIuR1JPVU5ERlgsIGNsZWFyQ2FjaGUpO1xyXG4gICAgICAgIHRoaXMuY2xlYXJMYXllcihMYXllci5QTEFOVCwgY2xlYXJDYWNoZSk7XHJcbiAgICAgICAgdGhpcy5jbGVhckxheWVyKExheWVyLkVOVElUWSwgY2xlYXJDYWNoZSk7XHJcbiAgICAgICAgdGhpcy5jbGVhckxheWVyKExheWVyLlVJLCBjbGVhckNhY2hlKTtcclxuICAgIH1cclxuICAgIGNsZWFyTGF5ZXJzKGxheWVycywgY2xlYXJDYWNoZSA9IGZhbHNlKSB7XHJcbiAgICAgICAgZm9yIChsZXQgbGF5ZXIgb2YgbGF5ZXJzKSB7XHJcbiAgICAgICAgICAgIHRoaXMuY2xlYXJMYXllcihsYXllciwgY2xlYXJDYWNoZSk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgY2xlYXJMYXllcihsYXllciwgY2xlYXJDYWNoZSA9IGZhbHNlKSB7XHJcbiAgICAgICAgaWYgKGNsZWFyQ2FjaGUpIHtcclxuICAgICAgICAgICAgdGhpcy5kaXNwbGF5T2JqQ2FjaGVbbGF5ZXJdID0ge307XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHN3aXRjaCAobGF5ZXIpIHtcclxuICAgICAgICAgICAgY2FzZSBMYXllci5URVJSQUlOOiB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLnRlcnJhaW5MYXllci5yZW1vdmVDaGlsZHJlbigpO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY2FzZSBMYXllci5HUk9VTkRGWDoge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5ncm91bmRGWExheWVyLnJlbW92ZUNoaWxkcmVuKCk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjYXNlIExheWVyLlBMQU5UOiB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLnBsYW50TGF5ZXIucmVtb3ZlQ2hpbGRyZW4oKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNhc2UgTGF5ZXIuRU5USVRZOiB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmVudGl0eUxheWVyLnJlbW92ZUNoaWxkcmVuKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY2FzZSBMYXllci5VSToge1xyXG4gICAgICAgICAgICAgICAgdGhpcy51aUxheWVyLnJlbW92ZUNoaWxkcmVuKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICAvLyBtb3ZlIGEgc3ByaXRlcyBwb3NpdGlvbiBvbiB0aGUgc2NyZWVuLCBidXQgbGVhdmUgaXRzIHRpbGUgcG9zaXRpb24gdW5jaGFuZ2VkXHJcbiAgICBtb3ZlQ2FjaGVkU3ByaXRlVH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JJbnRlcmZhY2U7XHJcbiAgICAgICAgdGhpcy5wb3NpdGlvbiA9IHBvc2l0aW9uO1xyXG4gICAgICAgIHRoaXMubWF4V2lkdGggPSBtYXhXaWR0aDtcclxuICAgICAgICBpZiAoIXBhcmFtcykge1xyXG4gICAgICAgICAgICBwYXJhbXMgPSB7fTtcclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy50dXJucyA9IHBhcmFtcy50dXJucyB8fCAwO1xyXG4gICAgICAgIHRoaXMucGluZWFwcGxlcyA9IHBhcmFtcy5hbmFuYXMgfHwgMDtcclxuICAgICAgICB0aGlzLmJveGVzID0gcGFyYW1zLmJveGVzIHx8IDA7XHJcbiAgICAgICAgdGhpcy5tYXhCb3hlcyA9IHBhcmFtcy5tYXhCb3hlcyB8fCAwO1xyXG4gICAgfVxyXG4gICAgcmVzZXQoKSB7XHJcbiAgICAgICAgdGhpcy50dXJucyA9IDA7XHJcbiAgICAgICAgdGhpcy5waW5lYXBwbGVzID0gMDtcclxuICAgICAgICB0aGlzLmJveGVzID0gMDtcclxuICAgICAgICB0aGlzLm1heEJveGVzID0gMDtcclxuICAgIH1cclxuICAgIGRyYXcoKSB7XHJcbiAgICAgICAgbGV0IHRleHQgPSBgdHVybnM6ICR7cGFkUmlnaHQodGhpcy50dXJucy50b1N0cmluZygpLCA2KX0gcGluZWFwcGxlczogJHtwYWRSaWdodCh0aGlzLnBpbmVhcHBsZXMudG9TdHJpbmcoKSwgNil9IGJveGVzOiAke3BhZExlZnQodGhpcy5ib3hlcy50b1N0cmluZygpLCAyKX0gLyAke3BhZExlZnQodGhpcy5tYXhCb3hlcy50b1N0cmluZygpLCAyKX1gO1xyXG4gICAgICAgIHRoaXMudXNlckludGVyZmFjZS5kcmF3VGV4dCh0aGlzLnBvc2l0aW9uLCB0ZXh0LCB0aGlzLm1heFdpZHRoKTtcclxuICAgIH1cclxufVxyXG4iLCJleHBvcnQgZnVuY3Rpb24gcGFkTGVmdCh0ZXh0LCBsZW5ndGg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R1cm4gcG9zaXRpb247XHJcbiAgICAgICAgY29uc3QgcmF0aW8gPSBUaWxlLnNpemUgLyBUaWxlLnBsYW50U2l6ZTtcclxuICAgICAgICBpZiAoZnJvbSA9PT0gTGF5ZXIuUExBTlQpIHtcclxuICAgICAgICAgICAgcmV0dXJuIG5ldyBQb2ludChNYXRoLmZsb29yKHBvc2l0aW9uLnggLyByYXRpbyksIE1hdGguZmxvb3IocG9zaXRpb24ueSAvIHJhdGlvKSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKHRvID09PSBMYXllci5QTEFOVCkge1xyXG4gICAgICAgICAgICByZXR1cm4gbmV3IFBvaW50KHBvc2l0aW9uLnggKiByYXRpbywgcG9zaXRpb24ueSAqIHJhdGlvKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBzdGF0aWMgZ2V0RGVzY3JpcHRpb24odGFyZ2V0KSB7XHJcbiAgICAgICAgY29uc3QgZGVzY3JpcHRpb25CbG9ja3MgPSBbXTtcclxuICAgICAgICBpZiAoIXRhcmdldClcclxuICAgICAgICAgICAgcmV0dXJuIGRlc2NyaXB0aW9uQmxvY2tzO1xyXG4gICAgICAgIGRlc2NyaXB0aW9uQmxvY2tzLnB1c2goe1xyXG4gICAgICAgICAgICBpY29uOiBQaW5JY29uLFxyXG4gICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKHBvaW50ZXJUYXJnZXQpID0+IGAke3BvaW50ZXJUYXJnZXQucG9zaXRpb24ueH0sICR7dGFyZ2V0LnBvc2l0aW9uLnl9YCxcclxuICAgICAgICB9KTtcclxuICAgICAgICBpZiAodGFyZ2V0LmluZm8pIHtcclxuICAgICAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgICAgICBpY29uOiBUZXh0SWNvbixcclxuICAgICAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAocG9pbnRlclRhcmdldCkgPT4geyB2YXIgX2E7IHJldHVybi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2h0KSAqIDEwMCl9IGhlaWdodGA7IH0sXHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICBkZXNjcmlwdGlvbkJsb2Nrcy5wdXNoKHtcclxuICAgICAgICAgICAgICAgIGljb246IE1vaXN0dXJlSWNvbixcclxuICAgICAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAocG9pbnRlclRhcmdldCkgPT4geyB2YXIgX2E7IHJldHVybiBgJHtNYXRoLnJvdW5kKCgoX2EgPSBwb2ludGVyVGFyZ2V0ID09PSBudWxsIHx8IHBvaW50ZXJUYXJnZXQgPT09IHZvaWQgMCA/IHZvaWQgMCA6IHBvaW50ZXJUYXJnZXQuaW5mbykgPT09IG51bGwgfHwgX2EgPT09IHZvaWQgMCA/IHZvaWQgMCA6IF9hLm1vaXN0dXJlKSAqIDEwMCl9JSBtb2lzdHVyZWA7IH0sXHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICBkZXNjcmlwdGlvbkJsb2Nrcy5wdXNoKHtcclxuICAgICAgICAgICAgICAgIGljb246IE1hZ25ldEljb24sXHJcbiAgICAgICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKHBvaW50ZXJUYXJnZXQpID0+IHsgdmFyIF9hOyByZXR1cm4gYCR7TWF0aC5yb3VuZCgoKF9hID0gcG9pbnRlclRhcmdldCA9PT0gbnVsbCB8fCBwb2ludGVyVGFyZ2V0ID09PSB2b2lkIDAgPyB2b2lkIDAgOiBwb2ludGVyVGFyZ2V0LmluZm8pID09PSBudWxsIHx8IF9hID09PSB2b2lkIDAgPyB2b2lkIDAgOiBfYS5tYWduZXRpc20pICogMTAwKX0gbWFnbmV0aXNtYDsgfSxcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIGRlc2NyaXB0aW9uQmxvY2tzLnB1c2goe1xyXG4gICAgICAgICAgICAgICAgaWNvbjogU3VuSWNvbixcclxuICAgICAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAocG9p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zZSA9IExpZ2h0UGhhc2Uuc2V0dGluZztcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIHRoaXMubGlnaHRQaGFzZSA9IExpZ2h0UGhhc2UucGVhaztcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHRoaXMubGlnaHRQaGFzZSA9PT0gTGlnaHRQaGFzZS5yaXNpbmcpIHtcclxuICAgICAgICAgICAgdGhpcy5yZW1haW5pbmdQaGFzZVBlcmNlbnQgPVxyXG4gICAgICAgICAgICAgICAgKDEgLSB0aGlzLnJlbWFpbmluZ0N5Y2xlUGVyY2VudCkgLyB0aGlzLmxpZ2h0VHJhbnNpdGlvblBlcmNlbnQ7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKHRoaXMubGlnaHRQaGFzZSA9PT0gTGlnaHRQaGFzZS5zZXR0aW5nKSB7XHJcbiAgICAgICAgICAgIHRoaXMucmVtYWluaW5nUGhhc2VQZXJjZW50ID1cclxuICAgICAgICAgICAgICAgIHRoaXMucmVtYWluaW5nQ3ljbGVQZXJjZW50IC8gdGhpcy5saWdodFRyYW5zaXRpb25QZXJjZW50O1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgdGhpcy5yZW1haW5pbmdQaGFzZVBlcmNlbnQgPSAxO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGdldEN1cnJlbnRUaW1lRm9yRGlzcGxheSgpIHtcclxuICAgICAgICByZXR1cm4gYFllYXI6ICR7dGhpcy5jdXJyZW50WWVhcn0gIC0gICR7dGhpcy5pc0RheVRpbWUgPyBcIkRheVwiIDogXCJOaWdodFwifTogJHt0aGlzLmN1cnJlbnREYXl9ICAtICBIb3VyOiAke3RoaXMuY3VycmVudFRpbWV9YDtcclxuICAgIH1cclxuICAgIHNldER1cmF0aW9uKHRpbWUpIHtcclxuICAgICAgICByZXR1cm4gdGhpcy5zY2hlZHVsZXIuc2V0RHVyYXRpb24odGltZSk7XHJcbiAgICB9XHJcbiAgICB0b2dnbGVQYXVzZSgpIHtcclxuICAgICAgICB0aGlzLnNldElzUGF1c2VkKCF0aGlzLmlzUGF1c2VkKTtcclxuICAgIH1cclxuICAgIHNldElzUGF1c2VkKGlzUGF1c2VkKSB7XHJcbiAgICAgICAgdGhpcy5pc1BhdXNlZCA9IGlzUGF1c2VkO1xyXG4gICAgICAgIGNvbnNvbGUubG9nKFwiaXNQYXVzZWQ6IFwiLCB0aGlzLmlzUGF1c2VkKTtcclxuICAgIH1cclxuICAgIHNldFRpbWVzY2FsZShzY2FsZSkge1xyXG4gICAgICAgIHRoaXMudGltZVNjYWxlID0gc2NhbGU7XHJcbiAgICAgICAgaWYgKHRoaXMudGltZVNjYWxlID4gdGhpcy5tYXhUaW1lU2NhbGUpIHtcclxuICAgICAgICAgICAgdGhpcy50aW1lU2NhbGUgPSB0aGlzLm1heFRpbWVTY2FsZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHRoaXMudGltZVNjYWxlIDw9IDApIHtcclxuICAgICAgICAgICAgdGhpcy50aW1lU2NhbGUgPSAwO1xyXG4gICAgICAgICAgICB0aGlzLmlzUGF1c2VkID0gdHJ1ZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIHRoaXMuaXNQYXVzZWQgPSBmYWxzZTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICByZXNldFR1cm5BbmltVGltZSgpIHtcclxuICAgICAgICAvLyByZXNldCB0dXJuIHRpbWVcclxuICAgICAgICB0aGlzLnR1cm5BbmltVGltZVBlcmNlbnQgPSAwO1xyXG4gICAgfVxyXG4gICAgZm9yY2VOZXh0VHVybigpIHtcclxuICAgICAgICBjb25zdCB0ZW1wID0gdGhpcy5zY2hlZHVsZXIuYWRkKG51bGwsIGZhbHNlLCAxKTtcclxuICAgICAgICB0aGlzLnNjaGVkdWxlci5uZXh0KCk7XHJcbiA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5nYW1lLnVzZXJJbnRlcmZhY2UuZ2FtZURpc3BsYXkuc3RhZ2UucGl2b3Q7XHJcbiAgICAgICAgICAgIGNvbnN0IHBpdm90T2Zmc2V0WCA9IChwaXZvdC54ICUgVGlsZS5zaXplKSAqIHNjYWxlO1xyXG4gICAgICAgICAgICBjb25zdCBwaXZvdE9mZnNldFkgPSAocGl2b3QueSAlIFRpbGUuc2l6ZSkgKiBzY2FsZTtcclxuICAgICAgICAgICAgY3R4LmNsZWFyUmVjdCgwLCAwLCB3aWR0aCwgaGVpZ2h0KTsgLy8gQ2xlYXIgdGhlIGNhbnZhc1xyXG4gICAgICAgICAgICBjdHguZmlsbFN0eWxlID0gXCJyZ2JhKDI1NSwgMTYsIDI0MCwgMSlcIjsgLy8gU2V0IHRoZSBjb2xvciB0byBob3QgcGlua1xyXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHJvd3M7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBjb2xzOyBqKyspIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PT0gNDcgJiYgaiA9PT0gMjYpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29uc29sZS5sb2coYGRyYXcgdGlsZSBhdCAke2l9LCAke2p9LCAke3RpbGVTaXplfWApO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjdHguZmlsbFN0eWxlID0gXCJyZ2JhKDMwLCAyMDAsIDI0MCwgMSlcIjsgLy8gU2V0IHRoZSBjb2xvciB0byBzb21ldGhpbmcgZWxzZVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY3R4LmZpbGxTdHlsZSA9IFwicmdiYSgyNTUsIDE2LCAyNDAsIDEpXCI7IC8vIFNldCB0aGUgY29sb3IgdG8gaG90IHBpbmtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmZpbGxSZWN0KGkgKiB0aWxlU2l6ZSArIHhPZmZzZXQgLSBwaXZvdE9mZnNldFgsIGogKiB0aWxlU2l6ZSArIHlPZmZzZXQgLSBwaXZvdE9mZnNldFksIHRpbGVTaXplLCB0aWxlU2l6ZSk7IC8vIERyYXcgdGhlIG91dGVyIHRpbGUgKGJvcmRlcilcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHJvd3M7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBjb2xzOyBqKyspIHtcclxuICAgICAgICAgICAgICAgICAgICBjdHguY2xlYXJSZWN0KGkgKiB0aWxlU2l6ZSArIHhPZmZzZXQgLSBwaXZvdE9mZnNldFggKyBib3JkZXJTaXplLCBqICogdGlsZVNpemUgKyB5T2Zmc2V0IC0gcGl2b3RPZmZzZXRZICsgYm9yZGVyU2l6ZSwgaW5uZXJUaWxlU2l6ZSwgaW5uZXJUaWxlU2l6ZSk7IC8vIENsZWFyIHRoZSBpbm5lciB0aWxlXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICByZW5kZXJVcGRhdGUoKSB7XHJcbiAgICAgICAgaWYgKCF0aGlzLmNhbnZhcykge1xyXG4gICAgICAgICAgICB0aGlzLmNyZWF0ZUNhbnZhcygpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodGhpcy5jYW52YXMgJiYgdGhpcy5pc1Zpc2libGUpIHtcclxuICAgICAgICAgICAgdGhpcy5kcmF3R3JpZCgpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIHNldFZpc2libGUodmlzaWJsZSkge1xyXG4gICAgICAgIHRoaXMuaXNWaXNpYmxlID0gdmlzaWJsZTtcclxuICAgICAgICB0aGlz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lbCA9IFwiR3JleXNjYWxlIE92ZXJsYXlcIiwgZ2V0RGF0YSkge1xyXG4gICAgICAgIGNvbnN0IG92ZXJsYXkgPSB0aGlzLmdlbmVyYXRlT3ZlcmxheUNvbnRhaW5lcihsYWJlbCwgd2lkdGgsIGhlaWdodCk7XHJcbiAgICAgICAgY29uc3Qgb3ZlcmxheVdpdGhSZWZyZXNoID0gT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LCBvdmVybGF5KSwgeyByZWZyZXNoRGF0YTogKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgY2FudmFzID0gb3ZlcmxheS5jYW52YXM7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBncmV5c2NhbGVNYXAgPSBnZXREYXRhKCk7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBjdHggPSBjYW52YXMuZ2V0Q29udGV4dChcIjJkXCIpO1xyXG4gICAgICAgICAgICAgICAgaWYgKGN0eCA9PT0gbnVsbCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGNvbnN0IGltYWdlRGF0YSA9IGN0eC5jcmVhdGVJbWFnZURhdGEoY2FudmFzLndpZHRoLCBjYW52YXMuaGVpZ2h0KTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGRhdGEgPSBpbWFnZURhdGEuZGF0YTtcclxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZGF0YS5sZW5ndGg7IGkgKz0gNCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHggPSAoaSAvIDQpICUgY2FudmFzLndpZHRoO1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHkgPSBNYXRoLmZsb29yKGkgLyA0IC8gY2FudmFzLndpZHRoKTtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBrZXkgPSBgJHt4fSwke3l9YDtcclxuICAgICAgICAgICAgICAg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NhbnZhcy5nZXRDb250ZXh0KFwiMmRcIik7XHJcbiAgICAgICAgICAgICAgICBpZiAoY3R4ID09PSBudWxsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgY29uc3QgaW1hZ2VEYXRhID0gY3R4LmNyZWF0ZUltYWdlRGF0YShjYW52YXMud2lkdGgsIGNhbnZhcy5oZWlnaHQpO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZGF0YSA9IGltYWdlRGF0YS5kYXRhO1xyXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBkYXRhLmxlbmd0aDsgaSArPSA0KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgeCA9IChpIC8gNCkgJSBjYW52YXMud2lkdGg7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgeSA9IE1hdGguZmxvb3IoaSAvIDQgLyBjYW52YXMud2lkdGgpO1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGtleSA9IGAke3h9LCR7eX1gO1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHZhbHVlID0gZ3JleXNjYWxlTWFwW2tleV07XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlZCA9IDA7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IGdyZWVuID0gMDtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgYmx1ZSA9IDA7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGdyYWRpZW50Lm1pbiA9PT0gXCJyZWRcIikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZWQgPSAoMSAtIHZhbHVlKSAqIDI1NTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGdyYWRpZW50Lm1pbiA9PT0gXCJncmVlblwiKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuID0gKDEgLSB2YWx1ZSkgKiAyNTU7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChncmFkaWVudC5taW4gPT09IFwiYmx1ZVwiKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJsdWUgPSAoMSAtIHZhbHVlKSAqIDI1NTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGdyYWRpZW50Lm1heCA9PT0gXCJyZWRcIikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZWQgPSB2YWx1ZSAqIDI1NTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGdyYWRpZW50Lm1heCA9PT0gXCJncmVlblwiKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuID0gdmFsdWUgKiAyNTU7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChncmFkaWVudC5tYXggPT09IFwiYmx1ZVwiKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJsdWUgPSB2YWx1ZSAqIDI1NTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgZGF0YVtpXSA9IHJlZDsgLy8gUmVkXHJcbiAgICAgICAgICAgICAgICAgICAgZGF0YVtpICsgMV0gPSBncmVlbjsgLy8gR3JlZW5cclxuICAgICAgICAgICAgICAgICAgICBkYXRhW2kgKyAyXSA9IGJsdWU7IC8vIEJsdWVcclxuICAgICAgICAgICAgICAgICAgICBkYXRhW2kgKyAzXSA9IDI1NTsgLy8gQWxwaGFcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGN0eC5wdXRJbWFnZURhdGEoaW1hZ2VEYXRhLCAwLCAwKTtcclxuICAgICAgICAgICAgfSB9KTtcclxuICAgICAgICB0aGlzLm92ZXJs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XMuZ2V0Q29udGV4dChcIjJkXCIpO1xyXG4gICAgICAgICAgICAgICAgaWYgKGN0eCA9PT0gbnVsbCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGNvbnN0IGltYWdlRGF0YSA9IGN0eC5jcmVhdGVJbWFnZURhdGEoY2FudmFzLndpZHRoLCBjYW52YXMuaGVpZ2h0KTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGRhdGEgPSBpbWFnZURhdGEuZGF0YTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGJpb21lTWFwID0gZ2V0RGF0YSgpO1xyXG4gICAgICAgICAgICAgICAgLy8gc2V0IHRoZSBjb2xvciBvZiBlYWNoIHBpeGVsIHRvIGJpb21lLmNvbG9yXHJcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGRhdGEubGVuZ3RoOyBpICs9IDQpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCB4ID0gKGkgLyA0KSAlIGNhbnZhcy53aWR0aDtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCB5ID0gTWF0aC5mbG9vcihpIC8gNCAvIGNhbnZhcy53aWR0aCk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qga2V5ID0gYCR7eH0sJHt5fWA7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgYmlvbWUgPSBiaW9tZU1hcFtrZXldO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChiaW9tZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjb2xvciA9IGJpb21lLmNvbG9yO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhW2ldID0gcGFyc2VJbnQoY29sb3Iuc3Vic3RyKDEsIDIpLCAxNik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbaSArIDFdID0gcGFyc2VJbnQoY29sb3Iuc3Vic3RyKDMsIDIpLCAxNik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbaSArIDJdID0gcGFyc2VJbnQoY29sb3Iuc3Vic3RyKDUsIDIpLCAxNik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbaSArIDNdID0gMjU1O1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGN0eC5wdXRJbWFnZURhdGEoaW1hZ2VEYXRhLCAwLCAwKTtcclxuICAgICAgICAgICAgfSB9KTtcclxuICAgICAgICB0aGlzLm92ZXJsYXlzLnB1c2gob3ZlcmxheVdpdGhSZWZyZXNoKTtcclxuICAgICAgICB0aGlzLmRpc3BsYXlPdmVybGF5cy5wdXNoKG92ZXJsYXlXaXRoUmVmcmVzaCk7XHJcbiAgICAgICAgLy8gb3ZlcmxheVdpdGhSZWZyZXNoLnJlZnJlc2goKTtcclxuICAgIH1cclxuICAgIGdlbmVyYXRlT3ZlcmxheUNvbnRhaW5lcihsYWJlbCwgd2lkdGgsIGhlaWdodCkge1xyXG4gICAgICAgIGNvbnN0IG92ZXJsYXlDb250YWluZXIgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KFwiZGl2XCIpO1xyXG4gICAgICAgIG92ZXJsYXlDb250YWluZXIuc3R5bGUucG9zaXRpb24gPSBcImFic29sdXRlXCI7XHJcbiAgICAgICAgb3ZlcmxheUNvbnRhaW5lci5zdHlsZS50b3AgPSBcIjBcIjtcclxuICAgICAgICBvdmVybGF5Q29udGFpbmVyLnN0eWxlLmJvdHRvbSA9IFwiMFwiO1xyXG4gICAgICAgIG92ZXJsYXlDb250YWluZXIuc3R5bGUubGVmdCA9IFwiMFwiO1xyXG4gICAgICAgIG92ZXJsYXlDb250YWluZXIuc3R5bGUucmlnaHQgPSBcIjBcIjtcclxuICAgICAgICBvdmVybGF5Q29udGFpbmVyLnN0eWxlLnBvaW50ZXJFdmVudHMgPSBcIm5v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Y2FudmFzLnN0eWxlLmRpc3BsYXkgPSBcImJsb2NrXCI7XHJcbiAgICB9XHJcbiAgICBzZXRWaXNpYmxlKHZpc2libGUpIHtcclxuICAgICAgICBpZiAodmlzaWJsZSkge1xyXG4gICAgICAgICAgICB0aGlzLm92ZXJsYXlzWzBdLmNhbnZhcy5zdHlsZS5kaXNwbGF5ID0gXCJibG9ja1wiO1xyXG4gICAgICAgICAgICB0aGlzLmxhYmVsLnN0eWxlLmRpc3BsYXkgPSBcImJsb2NrXCI7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICB0aGlzLm92ZXJsYXlzLmZvckVhY2goKG92ZXJsYXkpID0+IHtcclxuICAgICAgICAgICAgICAgIG92ZXJsYXkuY2FudmFzLnN0eWxlLmRpc3BsYXkgPSBcIm5vbmVcIjtcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIHRoaXMubGFiZWwuc3R5bGUuZGlzcGxheSA9IFwibm9uZVwiO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLmlzVmlzaWJsZSA9IHZpc2libGU7XHJcbiAgICAgICAgdGhpcy5jb250YWluZXIuc3R5bGUuZGlzcGxheSA9IHZpc2libGUgPyBcImZsZXhcIiA6IFwibm9uZVwiO1xyXG4gICAgfVxyXG4gICAgdG9nZ2xlVmlzaWJsZSgpIHtcclxuICAgICAgICB0aGlzLnNldFZpc2libGUoIXRoaXMuaXNWaXNpYmxlKTtcclxuICAgIH1cclxuICAgIHJlZnJlc2gobWFwKSB7XHJcbiAgICAgICAgY29uc3QgY3VycmVudE92ZXJsYXkgPSB0aGlzLm92ZXJsYXlzWzBdO1xyXG4gICAgICAgIGlmICh0aGlzLmlzVmlzaWJsZSAmJiBjdXJyZW50T3ZlcmxheSkge1xyXG4gICAgICAgICAgICBjdXJyZW50T3ZlcmxheS5yZWZyZXNoRGF0YShtYXApO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxufVxyXG4iL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29udGVudDogW10gfSxcclxuICAgICAgICAgICAgeyBuYW1lOiBcIlJlc291cmNlc1wiLCBpY29uOiBCYWNrcGFja0ljb24sIGNvbnRlbnQ6IFtdIH0sXHJcbiAgICAgICAgICAgIHsgbmFtZTogXCJCdWlsZFwiLCBpY29uOiBXcmVuY2hJY29uLCBjb250ZW50OiBbXSB9LFxyXG4gICAgICAgIF07XHJcbiAgICAgICAgdGhpcy5pc1Zpc2libGUgPSB0cnVlO1xyXG4gICAgICAgIHRoaXMuY29udGFpbmVyID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcImRpdlwiKTtcclxuICAgICAgICB0aGlzLmNvbnRhaW5lci5zdHlsZS5wb2ludGVyRXZlbnRzID0gXCJhdXRvXCI7XHJcbiAgICAgICAgdGhpcy5jb250YWluZXIuc3R5bGUucG9zaXRpb24gPSBcImFic29sdXRlXCI7XHJcbiAgICAgICAgdGhpcy5jb250YWluZXIuc3R5bGUudG9wID0gXCIxMjBweFwiO1xyXG4gICAgICAgIHRoaXMuY29udGFpbmVyLnN0eWxlLmxlZnQgPSBcIjBcIjtcclxuICAgICAgICB0aGlzLmNvbnRhaW5lci5zdHlsZS5ib3R0b20gPSBcIjIwcHhcIjtcclxuICAgICAgICB0aGlzLmNvbnRhaW5lci5zdHlsZS53aWR0aCA9IFwiMTIwcHhcIjtcclxuICAgICAgICB0aGlzLmNvbnRhaW5lci5zdHlsZS5wYWRkaW5nID0gXCIxMHB4XCI7XHJcbiAgICAgICAgdGhpcy5jb250YWluZXIuc3R5bGUucGFkZGluZ1JpZ2h0ID0gXCIwcHhcIjtcclxuICAgICAgICB0aGlzLmNvbnRhaW5lci5zdHlsZS5wYWRkaW5nTGVmdCA9IFwiMHB4XCI7XHJcbiAgICAgICAgdGhpcy5jb250YWluZXIuc3R5bGUuYmFja2dyb3VuZENvbG9yID0gXCJyZ2JhKDAsIDAsIDAsIC44KVwiO1xyXG4gICAgICAgIHRoaXMuY29udGFpbmVyLnN0eWxlLmJveFN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QnRuLmFwcGVuZENoaWxkKGRyb3Bkb3duSWNvbik7XHJcbiAgICAgICAgdGhpcy5kcm9wZG93bi5hcHBlbmRDaGlsZCh0aGlzLmRyb3Bkb3duQnRuKTtcclxuICAgICAgICBpZiAodGhpcy5kcm9wZG93bk1lbnVPcHRpb25zKSB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IG9wdGlvbiBvZiB0aGlzLmRyb3Bkb3duTWVudU9wdGlvbnMpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMuZHJvcGRvd25NZW51LnJlbW92ZUNoaWxkKG9wdGlvbik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy5kcm9wZG93bk1lbnVPcHRpb25zID0gW107XHJcbiAgICAgICAgZm9yIChsZXQgdGFiIG9mIHRoaXMudGFicykge1xyXG4gICAgICAgICAgICBpZiAodGFiID09PSB0aGlzLnNlbGVjdGVkVGFiKSB7XHJcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjb25zdCBkcm9wZG93bkl0ZW0gPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KFwic2wtbWVudS1pdGVtXCIpO1xyXG4gICAgICAgICAgICBjb25zdCBkcm9wZG93bkljb24gPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KFwic2wtaWNvblwiKTtcclxuICAgICAgICAgICAgZHJvcGRvd25JY29uLnN0eWxlLm1hcmdpblJpZ2h0ID0gXCIxNXB4XCI7XHJcbiAgICAgICAgICAgIGRyb3Bkb3duSXRlbS50ZXh0Q29udGVudCA9IHRhYi5uYW1lO1xyXG4gICAgICAgICAgICBkcm9wZG93bkl0ZW0uaWQgPSB0YWIubmFtZTtcclxuICAgICAgICAgICAgZHJvcGRvd25JdGVtLnN0eWxlLnBhZGRpbmdUb3AgPSBcIjE1cHhcIjtcclxuICAgICAgICAgICAgZHJvcGRvd25JdGVtLnN0eWxlLnBhZGRpbmdCb3R0b20gPSBcIjE1cHhcIjtcclxuICAgICAgICAgICAgZHJvcGRvd25JY29uLnNldEF0dHJpYnV0ZShcInNsb3RcIiwgXCJwcmVmaXhcIik7XHJcbiAgICAgICAgICAgIGRyb3Bkb3duSWNvbi5zZXRBdHRyaWJ1dGUoXCJzcmNcIiwgdGFiLmljb24pO1xyXG4gICAgICAgICAgICBkcm9wZG93bkl0ZW0uYXBwZW5kQ2hpbGQoZHJvcGRvd25JY29uKTtcclxuICAgICAgICAgICAgdGhpcy5kcm9wZG93bk1lbnUuYXBwZW5kQ2hpbGQoZHJvcGRvd25JdGVtKTtcclxuICAgICAgICAgICAgdGhpcy5kcm9wZG93bk1lbnVPcHRpb25zLnB1c2goZHJvcGRvd25JdGVtKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBidWlsZFRhYkNvbnRlbnQoKSB7XHJcbiAgICAgICAgLy8gc3dpdGNoICh0aGlzLnNlbGVjdGVkVGFiLm5hbWUpIHtcclxuICAgICAgICAvLyAgIGNhc2UgXCJFbnRpdGllc1wiOlxyXG4gICAgICAgIC8vICAgICBicmVhaztcclxuICAgICAgICAvLyAgIGNhc2UgXCJDaXRpZXNcIjpcclxuICAgICAgICAvLyAgICAgcGxhY2Vob2xkZXJSZXNvdXJjZXMgPSBbXHJcbiAgICAgICAgLy8gICAgICAgeyBuYW1lOiBcIkJvb20gVG93blwiLCBpY29uOiBIb3VzZVdpdGhHZWFySWNvbiB9LFxyXG4gICAgICAgIC8vICAgICAgIHsgbmFtZTogXCJEZWNsaW5pbmcgQ2l0eVwiLCBpY29uOiBIb3VzZURvd25JY29uIH0sXHJcbiAgICAgICAgLy8gICAgICAgeyBuYW1lOiBcIlBvdGVudGlhbCBTaXRlXCIsIGljb246IEdlb0ljb24gfSxcclxuICAgICAgICAvLyAgICAgICB7IG5hbWU6IFwiQ29tbWVyY2lhbCBEaXN0cmljdFwiLCBpY29uOiBTaG9wV2luZG93SWNvbiB9LFxyXG4gICAgICAgIC8vICAgICBdO1xyXG4gICAgICAgIC8vICAgICBicmVhaztcclxuICAgICAgICAvLyAgIGNhc2UgXCJSZXNvdXJjZXNcIjpcclxuICAgICAgICAvLyAgICAgcGxhY2Vob2xkZXJSZXNvdXJjZXMgPSBbXHJcbiAgICAgICAgLy8gICAgICAgeyBuYW1lOiBcIkN1cnJlbmN5XCIsIGljb246IEN1cnJlbmN5SWNvbiB9LFxyXG4gICAgICAgIC8vICAgICAgIHsgbmFtZTogXCJBbmltYWxzXCIsIGljb246IFBpZ2d5QmFua0ljb24gfSxcclxuICAgICAgICAvLyAgICAgICB7IG5hbWU6IFwiTWVkaWNpbmVcIiwgaWNvbjogQ2Fwc3VsZUljb24gfSxcclxuICAgICAgICAvLyAgICAgICB7IG5hbWU6IFwiUGxhbnQgTWF0ZXJpYWxcIiwgaWNvbjogRmxvd2VySWNvbiB9LFxyXG4gICAgICAgIC8vICAgICBdO1xyXG4gICAgICAgIC8vICAgICBicmVhaztcclxuICAgICAgICAvLyAgIGNhc2UgXCJCdWlsZFwiOlxyXG4gICAgICAgIC8vICAgICBwbGFjZWhvbGRlclJlc291cmNlcyA9IFtcclxuICAgICAgICAvLyAgICAgICB7IG5hbWU6IFwiUGxhbm5pbmdcIiwgaWNvbjogUGVuY2lsSWNvbiB9LFxyXG4gICAgICAgIC8vICAgICAgIHsgbmFtZTogXCJIb3VzaW5nXCIsIGljb246IEhvdXNlSWNvbiB9LFxyXG4gICAgICAgIC8vICAgICBdO1xyXG4gICAgICAgIC8vICAgICBicmVhaztcclxuICAgICAgICAvLyB9XHJcbiAgICAgICAgaWYgKHRoaXMubWVudUNvbnRlbnQpIHtcclxuICAgICAgICAgICAgdGhpcy5taWRDb250cm9scy5yZW1vdmVDaGlsZCh0aGlzLm1lbnVDb250ZW50KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy5tZW51Q29udGVudCA9IG5ldyBTaWRlTWVudUNvbnRlbnQodGhpcy5zZWxlY3RlZFRhYiwgdGhpcy5zZWxlY3RlZFRhYi5jb250ZW50KTtcclxuICAgICAgICB0aGlzLm1pZENvbnRyb2xzLmFwcGVuZENoaWxkKHRoaXMubWVudUNvbnRlbnQpO1xyXG4gICAgfVxyXG4gICAgc2V0VmlzaWJsZSh2aXNpYmxlLCBpbmNsdWRlVG9nZ2xlID0gZmFsc2UpIHtcclxuICAgICAgICBpZiAoaW5jbHVkZVRvZ2dsZSkge1xyXG4gICAgICAgICAgICB0aGlzLmhhbmRsZS5zdHlsZS5kaXNwbGF5ID0gdmlzaWJsZSA/IFwiYmxvY2tcIiA6IFwibm9uZVwiO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodGhpcy5pc0NvbGxhcHNlZCkge1xyXG4gICAgICAgICAgICBpZiAoIXZpc2libGUpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMuY29udGFpbmVyLnN0eWxlLnRyYW5zZm9ybSA9IFwidHJhbnNsYXRlWCgtMTAwJSlcIjtcclxuICAgICAgICAgICAgICAgIHRoaXMuaXNWaXNpYmxlID0gZmFsc2U7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLmlzVmlzaWJsZSA9IHZpc2libGU7XHJcbiAgICAgICAgdGhpcy5jb250YWluZXIuc3R5bGUudHJhbnNmb3JtID0gdGhpcy5pc1Zpc2libGVcclxuICAgICAgICAgICAgPyBcInRyYW5zbGF0ZVgoMClcIlxyXG4gICAgICAgICAgICA6IFwidHJhbnNsYXRlWCgtMTAwJSlcIjtcclxuICAgIH1cclxuICAgIHNldENvbGxhcHNlZChjb2xsYXBzZWQpIHtcclxuICAgICAgICB0aGlzLmlzQ29sbGFwc2VkID0gY29sbGFwc2VkO1xyXG4gICAgICAgIHRoaXMuc2V0VmlzaWJsZSghdGhpcy5pc0NvbGxhcHNlZCk7XHJcbiAgICB9XHJcbiAgICBzZXRUYWJDb250ZW50KHRhYk5hbWUsIGNvbnRlbn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0ID09IG51bGwpIHtcclxuICAgICAgICAgICAgLy8gaGlkZSB0aGUgdGlsZSBpbmZvIGFzIGEgc2ltcGxpc3RpYyB3YXkgdG8gY2xlYXIgaXRcclxuICAgICAgICAgICAgLy8gaXQgZ2V0cyB1bmhpZGRlbiB3aGVuIHRoZSB0YXJnZXQgY2hhbmdlc1xyXG4gICAgICAgICAgICB0aGlzLnNldFZpc2libGUoZmFsc2UpO1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRoaXMuY29udGFpbmVyLnN0eWxlLmRpc3BsYXkgPSBcImZsZXhcIjtcclxuICAgICAgICBsZXQgY2FjaGVkU3ByaXRlO1xyXG4gICAgICAgIGlmIChpc0FjdG9yKHRhcmdldC50YXJnZXQpKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGlzQW5pbWF0ZWQgPSB0YXJnZXQudGFyZ2V0LnRpbGUuYW5pbWF0aW9uS2V5cyAhPSBudWxsO1xyXG4gICAgICAgICAgICBsZXQgc3ByaXRlUGF0aDtcclxuICAgICAgICAgICAgdGhpcy5sYWJlbC50ZXh0Q29udGVudCA9IGAke3RhcmdldC50YXJnZXQubmFtZX1gO1xyXG4gICAgICAgICAgICBpZiAoaXNBbmltYXRlZCkge1xyXG4gICAgICAgICAgICAgICAgc3ByaXRlUGF0aCA9IHRhcmdldC50YXJnZXQudGlsZS5pY29uUGF0aDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHNwcml0ZVBhdGggPSB0YXJnZXQudGFyZ2V0LnRpbGUuc3ByaXRlUGF0aDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjYWNoZWRTcHJpdGUgPSBnZXRDYWNoZWRUaWxlVGV4dHVyZShzcHJpdGVQYXRoKTtcclxuICAgICAgICAgICAgdGhpcy5hdmF0YXIuc3R5bGUudHJhbnNmb3JtID1cclxuICAgICAgICAgICAgICAgIFw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fXB4YDtcclxuICAgICAgICAgICAgdGhpcy5hdmF0YXIuc3R5bGUuYmFja2dyb3VuZFBvc2l0aW9uWSA9IGAtJHtjYWNoZWRTcHJpdGUueU9mZnNldH1weGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRoaXMuc2V0Qm9keUNvbnRlbnQodGFyZ2V0KTtcclxuICAgICAgICB0aGlzLnNldFZpc2libGUodHJ1ZSk7XHJcbiAgICB9XHJcbiAgICAvLyBvbmx5IGNhbGxlZCB3aGVuIGNoYW5naW5nIHRhcmdldHNcclxuICAgIHNldEJvZHlDb250ZW50KHRhcmdldCkge1xyXG4gICAgICAgIHRoaXMuYm9keS5yZW1vdmVDaGlsZCh0aGlzLmJvZHkuZmlyc3RDaGlsZCk7XHJcbiAgICAgICAgdGhpcy5ib2R5LnRleHRDb250ZW50ID0gXCJcIjtcclxuICAgICAgICBjb25zdCBib2R5Q29udGFpbmVyID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcImRpdlwiKTtcclxuICAgICAgICBib2R5Q29udGFpbmVyLnN0eWxlLmRpc3BsYXkgPSBcImZsZXhcIjtcclxuICAgICAgICBib2R5Q29udGFpbmVyLnN0eWxlLmZsZXhEaXJlY3Rpb24gPSBcImNvbHVtblwiO1xyXG4gICAgICAgIGJvZHlDb250YWluZXIuc3R5bGUuYWxpZ25JdGVtcyA9IFwic3RhcnRcIjtcclxuICAgICAgICBib2R5Q29udGFpbmVyLnN0eWxlLmp1c3RpZnlDb250ZW50ID0gXCJzdGFydFwiO1xyXG4gICAgICAgIGJvZHlDb250YWluZXIuc3R5bGUucGFkZGluZyA9IFwiMCAwIDAgMFwiO1xyXG4gICAgICAgIGJvZHlDb250YWluZXIuc3R5bGUubWFyZ2luID0gXCIwIDAgMCAwXCI7XHJcbiAgICAgICAgYm9keUNvbnRhaW5lci5zdHlsZS53aWR0aCA9IFwiMTAwJVwiO1xyXG4gICAgICAgIGxldCBkQmxvY2tzID0gW107XHJcbiAgICAgICAgaW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gICovXG4gICAgdmFyIGlwdjZIb3N0bmFtZSA9IHRoaXMuaG9zdG5hbWVbMF0gPT09ICdbJyAmJiB0aGlzLmhvc3RuYW1lW3RoaXMuaG9zdG5hbWUubGVuZ3RoIC0gMV0gPT09ICddJztcblxuICAgIC8vIHZhbGlkYXRlIGEgbGl0dGxlLlxuICAgIGlmICghaXB2Nkhvc3RuYW1lKSB7XG4gICAgICB2YXIgaG9zdHBhcnRzID0gdGhpcy5ob3N0bmFtZS5zcGxpdCgvXFwuLyk7XG4gICAgICBmb3IgKHZhciBpID0gMCwgbCA9IGhvc3RwYXJ0cy5sZW5ndGg7IGkgPCBsOyBpKyspIHtcbiAgICAgICAgdmFyIHBhcnQgPSBob3N0cGFydHNbaV07XG4gICAgICAgIGlmICghcGFydCkgeyBjb250aW51ZTsgfVxuICAgICAgICBpZiAoIXBhcnQubWF0Y2goaG9zdG5hbWVQYXJ0UGF0dGVybikpIHtcbiAgICAgICAgICB2YXIgbmV3cGFydCA9ICcnO1xuICAgICAgICAgIGZvciAodmFyIGogPSAwLCBrID0gcGFydC5sZW5ndGg7IGogPCBrOyBqKyspIHtcbiAgICAgICAgICAgIGlmIChwYXJ0LmNoYXJDb2RlQXQoaikgPiAxMjcpIHtcbiAgICAgICAgICAgICAgLypcbiAgICAgICAgICAgICAgICogd2UgcmVwbGFjZSBub24tQVNDSUkgY2hhciB3aXRoIGEgdGVtcG9yYXJ5IHBsYWNlaG9sZGVyXG4gICAgICAgICAgICAgICAqIHdlIG5lZWQgdGhpcyB0byBtYWtlIHN1cmUgc2l6ZSBvZiBob3N0bmFtZSBpcyBub3RcbiAgICAgICAgICAgICAgICogYnJva2VuIGJ5IHJlcGxhY2luZyBub24tQVNDSUkgYnkgbm90aGluZ1xuICAgICAgICAgICAgICAgKi9cbiAgICAgICAgICAgICAgbmV3cGFydCArPSAneCc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBuZXdwYXJ0ICs9IHBhcnRbal07XG4g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ICAgc3RyYXRlZ3ksXG4gICAgICBtaWRkbGV3YXJlRGF0YSxcbiAgICAgIHJlY3RzLFxuICAgICAgcGxhdGZvcm0sXG4gICAgICBlbGVtZW50czoge1xuICAgICAgICByZWZlcmVuY2UsXG4gICAgICAgIGZsb2F0aW5nXG4gICAgICB9XG4gICAgfSk7XG4gICAgeCA9IG5leHRYICE9IG51bGwgPyBuZXh0WCA6IHg7XG4gICAgeSA9IG5leHRZICE9IG51bGwgPyBuZXh0WSA6IHk7XG4gICAgbWlkZGxld2FyZURhdGEgPSB7XG4gICAgICAuLi5taWRkbGV3YXJlRGF0YSxcbiAgICAgIFtuYW1lXToge1xuICAgICAgICAuLi5taWRkbGV3YXJlRGF0YVtuYW1lXSxcbiAgICAgICAgLi4uZGF0YVxuICAgICAgfVxuICAgIH07XG4gICAgaWYgKHJlc2V0ICYmIHJlc2V0Q291bnQgPD0gNTApIHtcbiAgICAgIHJlc2V0Q291bnQrKztcbiAgICAgIGlmICh0eXBlb2YgcmVzZXQgPT09ICdvYmplY3QnKSB7XG4gICAgICAgIGlmIChyZXNldC5wbGFjZW1lbnQpIHtcbiAgICAgICAgICBzdGF0ZWZ1bFBsYWNlbWVudCA9IHJlc2V0LnBsYWNlbWVudDtcbiAgICAgICAgfVxuICAgICAgICBpZiAocmVzZXQucmVjdHMpIHtcbiAgICAgICAgICByZWN0cyA9IHJlc2V0LnJlY3RzID09PSB0cnVlID8gYXdhaXQgcGxhdGZvcm0uZ2V0RWxlbWVudFJlY3RzKHtcbiAgICAgICAgICAgIHJlZmVyZW5jZSxcbiAgICAgICAgICAgIGZsb2F0aW5nLFxuICAgICAgICAgICAgc3RyYXRlZ3lcbiAgICAgICAgICB9KSA6IHJlc2V0LnJlY3RzO1xuICAgICAgICB9XG4gICAgICAgICh7XG4gICAgICAgICAgeCxcbiAgICAgICAgICB5XG4gICAgICAgIH0gPSBjb21wdXRlQ29vcmRzRnJvbVBsYWNlbWVudChyZWN0cywgc3RhdGVmdWxQbGF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gICAgICAgIH07XG4gICAgICAgICAgfVxuICAgICAgICBjYXNlICdlc2NhcGVkJzpcbiAgICAgICAgICB7XG4gICAgICAgICAgICBjb25zdCBvdmVyZmxvdyA9IGF3YWl0IGRldGVjdE92ZXJmbG93KHN0YXRlLCB7XG4gICAgICAgICAgICAgIC4uLmRldGVjdE92ZXJmbG93T3B0aW9ucyxcbiAgICAgICAgICAgICAgYWx0Qm91bmRhcnk6IHRydWVcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgY29uc3Qgb2Zmc2V0cyA9IGdldFNpZGVPZmZzZXRzKG92ZXJmbG93LCByZWN0cy5mbG9hdGluZyk7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICBkYXRhOiB7XG4gICAgICAgICAgICAgICAgZXNjYXBlZE9mZnNldHM6IG9mZnNldHMsXG4gICAgICAgICAgICAgICAgZXNjYXBlZDogaXNBbnlTaWRlRnVsbHlDbGlwcGVkKG9mZnNldHMpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfVxuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgIHtcbiAgICAgICAgICAgIHJldHVybiB7fTtcbiAgICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9O1xufTtcblxuZnVuY3Rpb24gZ2V0Qm91bmRpbmdSZWN0KHJlY3RzKSB7XG4gIGNvbnN0IG1pblggPSBtaW4oLi4ucmVjdHMubWFwKHJlY3QgPT4gcmVjdC5sZWZ0KSk7XG4gIGNvbnN0IG1pblkgPSBtaW4oLi4ucmVjdHMubWFwKHJlY3QgPT4gcmVjdC50b3ApKTtcbiAgY29uc3QgbWF4WCA9IG1heCguLi5yZWN0cy5tYXAocmVjdCA9PiByZWN0LnJpZ2h0KSk7XG4gIGNvbnN0IG1heFkgPSBtYXgoLi4ucmVjdHMubWFwKHJlY3QgPT4gcmVjdC5ib3R0b20pKTtcbiAgcmV0dXJuIHtcbiAgICB4OiBtaW5YLFx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CBpc1RvcCA9IGdldFNpZGUocGxhY2VtZW50KSA9PT0gJ3RvcCc7XG4gICAgICAgICAgICBjb25zdCB0b3AgPSBmaXJzdFJlY3QudG9wO1xuICAgICAgICAgICAgY29uc3QgYm90dG9tID0gbGFzdFJlY3QuYm90dG9tO1xuICAgICAgICAgICAgY29uc3QgbGVmdCA9IGlzVG9wID8gZmlyc3RSZWN0LmxlZnQgOiBsYXN0UmVjdC5sZWZ0O1xuICAgICAgICAgICAgY29uc3QgcmlnaHQgPSBpc1RvcCA/IGZpcnN0UmVjdC5yaWdodCA6IGxhc3RSZWN0LnJpZ2h0O1xuICAgICAgICAgICAgY29uc3Qgd2lkdGggPSByaWdodCAtIGxlZnQ7XG4gICAgICAgICAgICBjb25zdCBoZWlnaHQgPSBib3R0b20gLSB0b3A7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICB0b3AsXG4gICAgICAgICAgICAgIGJvdHRvbSxcbiAgICAgICAgICAgICAgbGVmdCxcbiAgICAgICAgICAgICAgcmlnaHQsXG4gICAgICAgICAgICAgIHdpZHRoLFxuICAgICAgICAgICAgICBoZWlnaHQsXG4gICAgICAgICAgICAgIHg6IGxlZnQsXG4gICAgICAgICAgICAgIHk6IHRvcFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9XG4gICAgICAgICAgY29uc3QgaXNMZWZ0U2lkZSA9IGdldFNpZGUocGxhY2VtZW50KSA9PT0gJ2xlZnQnO1xuICAgICAgICAgIGNvbnN0IG1heFJpZ2h0ID0gbWF4KC4uLmNsaWVudFJlY3RzLm1hcChyZWN0ID0+IHJlY3QucmlnaHQpKTtcbiAgICAgICAgICBjb25zdCBtaW5MZWZ0ID0gbWluKC4uLmNsaWVudFJlY3RzLm1hcChyZWN0ID0+IHJlY3QubGVmdCkpO1xuICAgICAgICAgIGNvbnN0IG1lYXN1cmVSZWN0cyA9IGNsaWVudFJlY3RzLmZpbHRlcihyZWN0ID0+IGlzTGVmdFNpZGUgPyByZWN0LmxlZnQgPT09IG1pbkxlZnQgOiByZWN0LnJpZ2h0ID09PSBtYXhSaWdodCk7XG4gICAgICAgICAgY29uc3QgdG9wID0gbWVhc3VyZVJlY3RzWzBdLnRvcDtcbiAgICAgICAgICBjb25zdCBib3R0b20gPSBtZWFzdXJlUmVjdHNbbWVhc3VyZVJlY3RzLmxlbmd0aCAtIDFdLmJvdHRvbTtcbiAgICAgICAgICBjb25zdCBsZWZ0ID0gbWluTGVmdDtcbiAgICAgICAgICBjb25zdCByaWdodCA9IG1heFJpZ2h0O1xuICAgICAgICAgIGNvbnN0IHdpZHRoID0gcmlnaHQgLSBsZWZ0O1xuICAgICAgICAgIGNvbnN0IGhlaWdodCA9IGJvdHRvbSAtIHRvcDtcbiAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdG9wLFxuICAgICAgICAgICAgYm90dG9tLFxuICAgICAgICAgICAgbGVmdCxcbiAgICAgICAgICAgIHJpZ2h0LFxuICAgICAgICAgICAgd2lkdGgsXG4gICAgICAgICAgICBoZWlnaHQsXG4gICAgICAgICAgICB4OiBsZWZ0LFxuICAgICAgICAgICAgeTogdG9wXG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsbGJhY2s7XG4gICAgICB9XG4gICAgICBjb25zdCByZXNldFJlY3RzID0gYXdhaXQgcGxhdGZvcm0uZ2V0RWxlbWVudFJlY3RzKHtcbiAgICAgICAgcmVmZXJlbmNlOiB7XG4gICAgICAgICAgZ2V0Qm91bmRpbmdDbGllbnRSZWN0XG4gICAgICAgIH0sXG4gICAgICAgIGZsb2F0aW5nOiBlbGVtZW50cy5mbG9hdGluZyxcbiAgICAgICAgc3RyYXRlZ3lcbiAgICAgIH0pO1xuICAgICAgaWYgKHJlY3RzLnJlZmVyZW5jZS54ICE9PSByZXNldFJlY3RzLnJlZmVyZW5jZS54IHx8IHJlY3RzLnJlZmVyZW5jZS55ICE9PSByZXNldFJlY3RzLnJlZmVyZW5jZS55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xcbiAgICAgICAgICAgICAgeVxuICAgICAgICAgICAgfSA9IF9yZWY7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICB4LFxuICAgICAgICAgICAgICB5XG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgLi4uZGV0ZWN0T3ZlcmZsb3dPcHRpb25zXG4gICAgICB9ID0gZXZhbHVhdGUob3B0aW9ucywgc3RhdGUpO1xuICAgICAgY29uc3QgY29vcmRzID0ge1xuICAgICAgICB4LFxuICAgICAgICB5XG4gICAgICB9O1xuICAgICAgY29uc3Qgb3ZlcmZsb3cgPSBhd2FpdCBkZXRlY3RPdmVyZmxvdyhzdGF0ZSwgZGV0ZWN0T3ZlcmZsb3dPcHRpb25zKTtcbiAgICAgIGNvbnN0IGNyb3NzQXhpcyA9IGdldFNpZGVBeGlzKGdldFNpZGUocGxhY2VtZW50KSk7XG4gICAgICBjb25zdCBtYWluQXhpcyA9IGdldE9wcG9zaXRlQXhpcyhjcm9zc0F4aXMpO1xuICAgICAgbGV0IG1haW5BeGlzQ29vcmQgPSBjb29yZHNbbWFpbkF4aXNdO1xuICAgICAgbGV0IGNyb3NzQXhpc0Nvb3JkID0gY29vcmRzW2Nyb3NzQXhpc107XG4gICAgICBpZiAoY2hlY2tNYWluQXhpcykge1xuICAgICAgICBjb25zdCBtaW5TaWRlID0gbWFpbkF4aXMgPT09ICd5JyA/ICd0b3AnIDogJ2xlZnQnO1xuICAgICAgICBjb25zdCBtYXhTaWRlID0gbWFpbkF4aXMgPT09ICd5JyA/ICdib3R0b20nIDogJ3JpZ2h0JztcbiAgICAgICAgY29uc3QgbWluID0gbWFpbkF4aXNDb29yZCArIG92ZXJmbG93W21pblNpZGVdO1xuICAgICAgICBjb25zdCBtYXggPSBtYWluQXhpc0Nvb3JkIC0gb3ZlcmZsb3dbbWF4U2lkZV07XG4gICAgICAgIG1haW5BeGlzQ29vcmQgPSBjbGFtcChtaW4sIG1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uICAgIGlmICghd2lkdGggfHwgIWhlaWdodCkge1xuICAgICAgcmV0dXJuO1xuICAgIH1cbiAgICBjb25zdCBpbnNldFRvcCA9IGZsb29yKHRvcCk7XG4gICAgY29uc3QgaW5zZXRSaWdodCA9IGZsb29yKHJvb3QuY2xpZW50V2lkdGggLSAobGVmdCArIHdpZHRoKSk7XG4gICAgY29uc3QgaW5zZXRCb3R0b20gPSBmbG9vcihyb290LmNsaWVudEhlaWdodCAtICh0b3AgKyBoZWlnaHQpKTtcbiAgICBjb25zdCBpbnNldExlZnQgPSBmbG9vcihsZWZ0KTtcbiAgICBjb25zdCByb290TWFyZ2luID0gLWluc2V0VG9wICsgXCJweCBcIiArIC1pbnNldFJpZ2h0ICsgXCJweCBcIiArIC1pbnNldEJvdHRvbSArIFwicHggXCIgKyAtaW5zZXRMZWZ0ICsgXCJweFwiO1xuICAgIGNvbnN0IG9wdGlvbnMgPSB7XG4gICAgICByb290TWFyZ2luLFxuICAgICAgdGhyZXNob2xkOiBtYXgoMCwgbWluKDEsIHRocmVzaG9sZCkpIHx8IDFcbiAgICB9O1xuICAgIGxldCBpc0ZpcnN0VXBkYXRlID0gdHJ1ZTtcbiAgICBmdW5jdGlvbiBoYW5kbGVPYnNlcnZlKGVudHJpZXMpIHtcbiAgICAgIGNvbnN0IHJhdGlvID0gZW50cmllc1swXS5pbnRlcnNlY3Rpb25SYXRpbztcbiAgICAgIGlmIChyYXRpbyAhPT0gdGhyZXNob2xkKSB7XG4gICAgICAgIGlmICghaXNGaXJzdFVwZGF0ZSkge1xuICAgICAgICAgIHJldHVybiByZWZyZXNoKCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFyYXRpbykge1xuICAgICAgICAgIHRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4ge1xuICAgICAgICAgICAgcmVmcmVzaChmYWxzZSwgMWUtNyk7XG4gICAgICAgICAgfSwgMTAwKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICByZW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bWUgfSA9IGNvbnRleHQ7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBzZXQodikge1xuICAgICAgICAgICAgICAgIGNvbnN0IG9sZFZhbHVlID0gdGFyZ2V0LmdldC5jYWxsKHRoaXMpO1xuICAgICAgICAgICAgICAgIHRhcmdldC5zZXQuY2FsbCh0aGlzLCB2KTtcbiAgICAgICAgICAgICAgICB0aGlzLnJlcXVlc3RVcGRhdGUobmFtZSwgb2xkVmFsdWUsIG9wdGlvbnMpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGluaXQodikge1xuICAgICAgICAgICAgICAgIGlmICh2ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fJGNoYW5nZVByb3BlcnR5KG5hbWUsIHVuZGVmaW5lZCwgb3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiB2O1xuICAgICAgICAgICAgfSxcbiAgICAgICAgfTtcbiAgICB9XG4gICAgZWxzZSBpZiAoa2luZCA9PT0gJ3NldHRlcicpIHtcbiAgICAgICAgY29uc3QgeyBuYW1lIH0gPSBjb250ZXh0O1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICBjb25zdCBvbGRWYWx1ZSA9IHRoaXNbbmFtZV07XG4gICAgICAgICAgICB0YXJnZXQuY2FsbCh0aGlzLCB2YWx1ZSk7XG4gICAgICAgICAgICB0aGlzLnJlcXVlc3RVcGRhdGUobmFtZSwgb2xkVmFsdWUsIG9wdGlvbnMpO1xuICAgICAgICB9O1xuICAgIH1cbiAgICB0aHJvdyBuZXcgRXJyb3IoYFVuc3VwcG9ydGVkIGRlY29yYXRvciBsb2NhdGlvbjogJHtraW5kfWApO1xufTtcbi8qKlxuICogQSBjbGFzcyBmaWVsZCBvciBhY2Nlc3NvciBkZWNvcmF0b3Igd2hpY2ggY3JlYXRlcyBhIHJlYWN0aXZlIHBy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yaW1lbnRhbCBkZWNvcmF0b3JzXG4gICAgICAgICAgICAvLyAgICAgIG9uIGF1dG8tYWNjZXNzb3JzLlxuICAgICAgICAgICAgLy8gICAzLiBGdW5jdGlvbnMgdGhhdCBhY2Nlc3Mgb3VyIG93biBjYWNoZS1rZXkgcHJvcGVydHkgb24gdGhlIGluc3RhbmNlLFxuICAgICAgICAgICAgLy8gICAgICBpbiB0aGUgY2FzZSBvZiBleHBlcmltZW50YWwgZGVjb3JhdG9ycyBvbiBmaWVsZHMuXG4gICAgICAgICAgICBjb25zdCB7IGdldCwgc2V0IH0gPSB0eXBlb2YgbmFtZU9yQ29udGV4dCA9PT0gJ29iamVjdCdcbiAgICAgICAgICAgICAgICA/IHByb3RvT3JUYXJnZXRcbiAgICAgICAgICAgICAgICA6IGRlc2NyaXB0b3IgPz9cbiAgICAgICAgICAgICAgICAgICAgKCgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGtleSA9IERFVl9NT0RFXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBTeW1ib2woYCR7U3RyaW5nKG5hbWVPckNvbnRleHQpfSAoQHF1ZXJ5KCkgY2FjaGUpYClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFN5bWJvbCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXQoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzW2tleV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXQodikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzW2tleV0gPSB2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9KSgpO1xuICAgICAgICAgICAgcmV0dXJuIGRlc2MocHJvdG9PclRhcmdldCwgbmFtZU9yQ29udGV4dCwge1xuICAgICAgICAgICAgICAgIGdldCgpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3VsdCA9IGdldC5jYWxsKHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0ID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IGRvUXVlcnkodGhpcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0ICE9PSBudWxsIHx8IHRoaXMuaGFzVXBkYXRlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldC5jYWxsKHRoaXMsIHJlc3VsdCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAvLyBUaGlzIG9iamVjdCB3b3JrcyBhcyB0aGUgcmV0dXJuIHR5cGUgZm9yIGJvdGggc3RhbmRhcmQgYW5kXG4gICAgICAgICAgICAvLyBleHBlcmltZW50YWwgZGVjb3JhdG9ycy5cbiAgICAgICAgICAgIHJldHVybiBkZXNjKHByb3RvT3JUYXJnZXQsIG5hbWVPckNvbnRleHQsIHtcbiAgICAgICAgICAgICAgICBnZXQoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBkb1F1ZXJ5KHRoaXMpO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH0pO1xufVxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9cXVlcnkuanMubWFwIiwiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IDIwMTcgR29vZ2xlIExMQ1xuICogU1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UgPSB2YWx1ZTtcbiAgICAgICAgc3dpdGNoICh0eXBlKSB7XG4gICAgICAgICAgICBjYXNlIEJvb2xlYW46XG4gICAgICAgICAgICAgICAgZnJvbVZhbHVlID0gdmFsdWUgIT09IG51bGw7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIE51bWJlcjpcbiAgICAgICAgICAgICAgICBmcm9tVmFsdWUgPSB2YWx1ZSA9PT0gbnVsbCA/IG51bGwgOiBOdW1iZXIodmFsdWUpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSBPYmplY3Q6XG4gICAgICAgICAgICBjYXNlIEFycmF5OlxuICAgICAgICAgICAgICAgIC8vIERvICpub3QqIGdlbmVyYXRlIGV4Y2VwdGlvbiB3aGVuIGludmFsaWQgSlNPTiBpcyBzZXQgYXMgZWxlbWVudHNcbiAgICAgICAgICAgICAgICAvLyBkb24ndCBub3JtYWxseSBjb21wbGFpbiBvbiBiZWluZyBtaXMtY29uZmlndXJlZC5cbiAgICAgICAgICAgICAgICAvLyBUT0RPKHNvcnZlbGwpOiBEbyBnZW5lcmF0ZSBleGNlcHRpb24gaW4gKmRldiBtb2RlKi5cbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAvLyBBc3NlcnQgdG8gYWRoZXJlIHRvIEJhemVsJ3MgXCJtdXN0IHR5cGUgYXNzZXJ0IEpTT04gcGFyc2VcIiBydWxlLlxuICAgICAgICAgICAgICAgICAgICBmcm9tVmFsdWUgPSBKU09OLnBhcnNlKHZhbHVlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgZnJvbVZhbHVlID0gbnVsbDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZyb21WYWx1ZTtcbiAg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gYW4gYWNjZXNzb3IuXG4gICAgICogRm9yIGV4YW1wbGUsXG4gICAgICpcbiAgICAgKiBgYGB0c1xuICAgICAqIGNsYXNzIE15RWxlbWVudCBleHRlbmRzIExpdEVsZW1lbnQge1xuICAgICAqICAgc3RhdGljIGdldFByb3BlcnR5RGVzY3JpcHRvcihuYW1lLCBrZXksIG9wdGlvbnMpIHtcbiAgICAgKiAgICAgY29uc3QgZGVmYXVsdERlc2NyaXB0b3IgPVxuICAgICAqICAgICAgICAgc3VwZXIuZ2V0UHJvcGVydHlEZXNjcmlwdG9yKG5hbWUsIGtleSwgb3B0aW9ucyk7XG4gICAgICogICAgIGNvbnN0IHNldHRlciA9IGRlZmF1bHREZXNjcmlwdG9yLnNldDtcbiAgICAgKiAgICAgcmV0dXJuIHtcbiAgICAgKiAgICAgICBnZXQ6IGRlZmF1bHREZXNjcmlwdG9yLmdldCxcbiAgICAgKiAgICAgICBzZXQodmFsdWUpIHtcbiAgICAgKiAgICAgICAgIHNldHRlci5jYWxsKHRoaXMsIHZhbHVlKTtcbiAgICAgKiAgICAgICAgIC8vIGN1c3RvbSBhY3Rpb24uXG4gICAgICogICAgICAgfSxcbiAgICAgKiAgICAgICBjb25maWd1cmFibGU6IHRydWUsXG4gICAgICogICAgICAgZW51bWVyYWJsZTogdHJ1ZVxuICAgICAqICAgICB9XG4gICAgICogICB9XG4gICAgICogfVxuICAgICAqIGBgYFxuICAgICAqXG4gICAgICogQG5vY29sbGFwc2VcbiAgICAgKiBAY2F0ZWdvcnkgcHJvcGVydGllc1xuICAgICAqL1xuICAgIHN0YXRpYyBnZXRQcm9wZXJ0eURlc2NyaXB0b3IobmFtZSwga2V5LCBvcHRpb25zKSB7XG4gICAgICAgIGNvbnN0IHsgZ2V0LCBzZXQgfSA9IGdldE93blByb3BlcnR5RGVzY3JpcHRvcih0aGlzLnByb3RvdHlwZSwgbmFtZSkgPz8ge1xuICAgICAgICAgICAgZ2V0KCkge1xuICAgICAgICAgICAgICAgIHJld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ICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIENyZWF0ZSBwcm9wZXJ0aWVzIGZyb20gc3RhbmRhcmQgZGVjb3JhdG9yIG1ldGFkYXRhOlxuICAgICAgICBjb25zdCBtZXRhZGF0YSA9IHRoaXNbU3ltYm9sLm1ldGFkYXRhXTtcbiAgICAgICAgaWYgKG1ldGFkYXRhICE9PSBudWxsKSB7XG4gICAgICAgICAgICBjb25zdCBwcm9wZXJ0aWVzID0gbGl0UHJvcGVydHlNZXRhZGF0YS5nZXQobWV0YWRhdGEpO1xuICAgICAgICAgICAgaWYgKHByb3BlcnRpZXMgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIGZvciAoY29uc3QgW3AsIG9wdGlvbnNdIG9mIHByb3BlcnRpZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5lbGVtZW50UHJvcGVydGllcy5zZXQocCwgb3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIENyZWF0ZSB0aGUgYXR0cmlidXRlLXRvLXByb3BlcnR5IG1hcFxuICAgICAgICB0aGlzLl9fYXR0cmlidXRlVG9Qcm9wZXJ0eU1hcCA9IG5ldyBNYXAoKTtcbiAgICAgICAgZm9yIChjb25zdCBbcCwgb3B0aW9uc10gb2YgdGhpcy5lbGVtZW50UHJvcGVydGllcykge1xuICAgICAgICAgICAgY29uc3QgYXR0ciA9IHRoaXMuX19hdHRyaWJ1dGVOYW1lRm9yUHJvcGVydHkocCwgb3B0aW9ucyk7XG4gICAgICAgICAgICBpZiAoYXR0ciAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fX2F0dHJpYnV0ZVRvUHJvcGVydHlNYXAuc2V0KGF0dHIsIHApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHRoaXMuZWxlbWVudFN0eWxlcyA9IHRoaXMuZmluY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B0aGUgY29uc3RydWN0b3IuXG4gICAgICAgICAgICAgICAgY29uc3QgY3RvciA9IHRoaXMuY29uc3RydWN0b3I7XG4gICAgICAgICAgICAgICAgY29uc3Qgc2hhZG93ZWRQcm9wZXJ0aWVzID0gWy4uLmN0b3IuZWxlbWVudFByb3BlcnRpZXMua2V5cygpXS5maWx0ZXIoKHApID0+IHRoaXMuaGFzT3duUHJvcGVydHkocCkgJiYgcCBpbiBnZXRQcm90b3R5cGVPZih0aGlzKSk7XG4gICAgICAgICAgICAgICAgaWYgKHNoYWRvd2VkUHJvcGVydGllcy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBUaGUgZm9sbG93aW5nIHByb3BlcnRpZXMgb24gZWxlbWVudCAke3RoaXMubG9jYWxOYW1lfSB3aWxsIG5vdCBgICtcbiAgICAgICAgICAgICAgICAgICAgICAgIGB0cmlnZ2VyIHVwZGF0ZXMgYXMgZXhwZWN0ZWQgYmVjYXVzZSB0aGV5IGFyZSBzZXQgdXNpbmcgY2xhc3MgYCArXG4gICAgICAgICAgICAgICAgICAgICAgICBgZmllbGRzOiAke3NoYWRvd2VkUHJvcGVydGllcy5qb2luKCcsICcpfS4gYCArXG4gICAgICAgICAgICAgICAgICAgICAgICBgTmF0aXZlIGNsYXNzIGZpZWxkcyBhbmQgc29tZSBjb21waWxlZCBvdXRwdXQgd2lsbCBvdmVyd3JpdGUgYCArXG4gICAgICAgICAgICAgICAgICAgICAgICBgYWNjZXNzb3JzIHVzZWQgZm9yIGRldGVjdGluZyBjaGFuZ2VzLiBTZWUgYCArXG4gICAgICAgICAgICAgICAgICAgICAgICBgaHR0cHM6Ly9saXQuZGV2L21zZy9jbGFzcy1maWVsZC1zaGFkb3dpbmcgYCArXG4gICAgICAgICAgICAgICAgICAgICAgICBgZm9yIG1vcmUgaW5mb3JtYXRpb24uYCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAg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RpZmZlcmVuY2UgZnJvbVxuICAgICAgICAgICAgLy8gZXhwZXJpbWVudGFsIGRlY29yYXRvcnMgb24gZmllbGRzIGFuZCBzdGFuZGFyZCBkZWNvcmF0b3JzIG9uXG4gICAgICAgICAgICAvLyBhdXRvLWFjY2Vzc29ycy5cbiAgICAgICAgICAgIC8vIEZvciBjb250ZXh0IHdoeSBleHBlcmltZW50YWxEZWNvcmF0b3JzIHdpdGggYXV0byBhY2Nlc3NvcnMgYXJlIGhhbmRsZWRcbiAgICAgICAgICAgIC8vIHNwZWNpZmljYWxseSBhbHNvIHNlZTpcbiAgICAgICAgICAgIC8vIGh0dHBzOi8vZ2l0aHViLmNvbS9saXQvbGl0L3B1bGwvNDE4MyNpc3N1ZWNvbW1lbnQtMTcxMTk1OTYzNVxuICAgICAgICAgICAgY29uc3QgZWxlbWVudFByb3BlcnRpZXMgPSB0aGlzLmNvbnN0cnVjdG9yXG4gICAgICAgICAgICAgICAgLmVsZW1lbnRQcm9wZXJ0aWVzO1xuICAgICAgICAgICAgaWYgKGVsZW1lbnRQcm9wZXJ0aWVzLnNpemUgPiAwKSB7XG4gICAgICAgICAgICAgICAgZm9yIChjb25zdCBbcCwgb3B0aW9uc10gb2YgZWxlbWVudFByb3BlcnRpZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMud3JhcHBlZCA9PT0gdHJ1ZSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgIXRoaXMuXyRjaGFuZ2VkUHJvcGVydGllcy5oYXMocCkgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNbcF0gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fJGNoYW5nZVByb3BlcnR5KHAsIHRoaXNbcF0sIG9wdGlvbnMpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBzaG91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GlvbkNoYW5nZVwiLFxuICAgICAgICBcInJlc2V0XCIsXG4gICAgICAgIFwidXBkYXRlXCIsXG4gICAgICAgIFwicG9zdHJlbmRlclwiLFxuICAgICAgICBcInByZXJlbmRlclwiLFxuICAgICAgICBcInJlc2l6ZVwiXG4gICAgICBdLFxuICAgICAgc3lzdGVtczogX1JlbmRlcmVyMi5fX3N5c3RlbXMsXG4gICAgICBwcmlvcml0eTogW1xuICAgICAgICBcIl92aWV3XCIsXG4gICAgICAgIFwidGV4dHVyZUdlbmVyYXRvclwiLFxuICAgICAgICBcImJhY2tncm91bmRcIixcbiAgICAgICAgXCJfcGx1Z2luXCIsXG4gICAgICAgIFwic3RhcnR1cFwiLFxuICAgICAgICAvLyBsb3cgbGV2ZWwgV2ViR0wgc3lzdGVtc1xuICAgICAgICBcImNvbnRleHRcIixcbiAgICAgICAgXCJzdGF0ZVwiLFxuICAgICAgICBcInRleHR1cmVcIixcbiAgICAgICAgXCJidWZmZXJcIixcbiAgICAgICAgXCJnZW9tZXRyeVwiLFxuICAgICAgICBcImZyYW1lYnVmZmVyXCIsXG4gICAgICAgIFwidHJhbnNmb3JtRmVlZGJhY2tcIixcbiAgICAgICAgLy8gaGlnaCBsZXZlbCBwaXhpIHNwZWNpZmljIHJlbmRlcmluZ1xuICAgICAgICBcIm1hc2tcIixcbiAgICAgICAgXCJzY2lzc29yXCIsXG4gICAgICAgIFwic3RlbmNpbFwiLFxuICAgICAgICBcInByb2plY3Rpb25cIixcbiAgICAgICAgXCJ0ZXh0dXJlR0NcIixcbiAgICAgICAgXCJmaWx0ZXJcIixcbiAgICAgICAgXCJyZW5kZXJUZXh0dXJlXCIsXG4gICAgICAgIFwiYmF0Y2hcIixcbiAgICAgICAgXCJvYmplY3RSZW5kZXJlclwiLFxuICAgICAgICBcIl9tdWx0aXNhbXBsZVwiXG4gICAgICBdXG4gICAgfTtcbiAgICB0aGlzLnNldHVwKHN5c3RlbUNvbmZpZyksIFwidXNlQ29udGV4dEFscGh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kZXIgPSAoNCAtIGVsZW1lbnRTaXplICUgNCkgJSA0O1xuICAgICAgICBmdW5jRnJhZ21lbnRzLnB1c2goYFxuICAgICAgICAgICAgICAgIGN2ID0gdWQuJHtuYW1lfS52YWx1ZTtcbiAgICAgICAgICAgICAgICB2ID0gdXYuJHtuYW1lfTtcbiAgICAgICAgICAgICAgICBvZmZzZXQgPSAke3Vib0VsZW1lbnQub2Zmc2V0IC8gNH07XG5cbiAgICAgICAgICAgICAgICB0ID0gMDtcblxuICAgICAgICAgICAgICAgIGZvcih2YXIgaT0wOyBpIDwgJHt1Ym9FbGVtZW50LmRhdGEuc2l6ZSAqIHJvd1NpemV9OyBpKyspXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBmb3IodmFyIGogPSAwOyBqIDwgJHtlbGVtZW50U2l6ZX07IGorKylcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQrK10gPSB2W3QrK107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ICs9ICR7cmVtYWluZGVyfTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBgKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGNvbnN0IHRlbXBsYXRlID0gVUJPX1RPX1NJTkdMRV9TRVRURVJTW3Vib0VsZW1lbnQuZGF0YS50eXBlXTtcbiAgICAgICAgZnVuY0ZyYWdtZW50cy5wdXNoKGBcbiAgICAgICAgICAgICAgICBjdiA9IHVkLiR7bmFtZX0udmFsdWU7XG4gICAgICAgICAgICAgICAgdiA9IHV2LiR7bmFtZX07XG4gICAgICAgICAgICAgICAgb2Zmc2V0ID0gJHt1Ym9FbGVtZW50Lm9mZnNldCAvIDR9O1xuICAgICAgICAgICAgICAgICR7dGVtcGxhdGV9O1xuICAgICAgICAgICAgICAgIGApO1xuICAgICAgfVxuICB9XG4gIHJldHVybi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R7bmFtZX1cIl0ubG9jYXRpb24sIGZhbHNlLCB1dltcIiR7bmFtZX1cIl0udG9BcnJheSh0cnVlKSk7XG4gICAgICAgICAgICBgXG4gICAgKSxcbiAgICBjb2RlVWJvOiAobmFtZSkgPT4gYFxuICAgICAgICAgICAgICAgIHZhciAke25hbWV9X21hdHJpeCA9IHV2LiR7bmFtZX0udG9BcnJheSh0cnVlKTtcblxuICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0XSA9ICR7bmFtZX1fbWF0cml4WzBdO1xuICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KzFdID0gJHtuYW1lfV9tYXRyaXhbMV07XG4gICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQrMl0gPSAke25hbWV9X21hdHJpeFsyXTtcbiAgICAgICAgXG4gICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQgKyA0XSA9ICR7bmFtZX1fbWF0cml4WzNdO1xuICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0ICsgNV0gPSAke25hbWV9X21hdHJpeFs0XTtcbiAgICAgICAgICAgICAgICBkYXRhW29mZnNldCArIDZdID0gJHtuYW1lfV9tYXRyaXhbNV07XG4gICAgICAgIFxuICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0ICsgOF0gPSAke25hbWV9X21hdHJpeFs2XTtcbiAgICAgICAgICAgICAgICBkYXRhW29mZnNldCArIDldID0gJHtuYW1lfV9tYXRyaXhbN107XG4gICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQgKyAxMF0gPSAke25hbWV9X21hdHJpeFs4XTtcbiAgICAgICAgICAgIGBcbiAgfSxcbiAgLy8gdXBsb2FkaW5nIGEgcGl4aSBwb2ludCBhcyBhIHZlYzIgd2l0aCBjYWNoaW5nIGxheWVyXG4gIHtcbiAgICB0ZXN0OiAoZGF0YSwgdW5pZm9ybSkgPT4gZGF0YS50eXBlID09PSBcInZlYzJcIiAmJiBkYXRhLnNpemUgPT09IDEgJiYgIWRhdGEuaXNBcnJheSAmJiB1bmlmb3JtLnggIT09IHZvaWQgMCxcbiAgICBjb2RlOiAobmFtZSkgPT4gYFxuICAgICAgICAgICAgICAgIGN2ID0gdWRbXCIke25hbWV9XCJdLnZhbHVlO1xuICAgICAgICAgICAgICAgIHYgPSB1dltcIiR7bmFtZX1cIl07XG5cbiAgICAgICAgICAgICAgICBpZihjdlswXSAhPT0gdi54IHx8IGN2WzFdICE9PSB2LnkpXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBjdlswXSA9IHYueDtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMV0gPSB2Lnk7XG4gICAgICAgICAgICAgICAgICAgIGdsLnVuaWZvcm0yZih1ZFtcIiR7bmFtZX1cIl0ubG9jYXRpb24sIHYueCwgdi55KTtcbiAgICAgICAgICAgICAgICB9YCxcbiAgICBjb2RlVWJvOiAobmFtZSkgPT4gYFxuICAgICAgICAgICAgICAgIHYgPSB1di4ke25hbWV9O1xuXG4gICAgICAgICAgICAgICAgZGF0YVtvZmZzZXRdID0gdi54O1xuICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KzFdID0gdi55O1xuICAgICAgICAgICAgYFxuICB9LFxuICAvLyBjYWNoaW5nIGxheWVyIGZvciBhIHZlYzJcbiAge1xuICAgIHRlc3Q6IChkYXRhKSA9PiBkYXRhLnR5cGUgPT09IFwidmVjMlwiICYmIGRhdGEuc2l6ZSA9PT0gMSAmJiAhZGF0YS5pc0FycmF5LFxuICAgIGNvZGU6IChuYW1lKSA9PiBgXG4gICAgICAgICAgICAgICAgY3YgPSB1ZFtcIiR7bmFtZX1cIl0udmFsdWU7XG4gICAgICAgICAgICAgICAgdiA9IHV2W1wiJHtuYW1lfVwiXTtcblxuICAgICAgICAgICAgICAgIGlmKGN2WzBdICE9PSB2WzBdIHx8IGN2WzFdICE9PSB2WzFdKVxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMF0gPSB2WzBdO1xuICAgICAgICAgICAgICAgICAgICBjdlsxXSA9IHZbMV07XG4gICAgICAgICAgICAgICAgICAgIGdsLnVuaWZvcm0yZih1ZFtcIiR7bmFtZX1cIl0ubG9jYXRpb24sIHZbMF0sIHZbMV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGBcbiAgfSxcbiAgLy8gdXBsb2FkIGEgcGl4aSByZWN0YW5nbGUgYXMgYSB2ZWM0IHdpdGggY2FjaGluZyBsYXllclxuICB7XG4gICAgdGVzdDogKGRhdGEsIHVuaWZvcm0pID0+IGRhdGEudHlwZSA9PT0gXCJ2ZWM0XCIgJiYgZGF0YS5zaXplID09PSAxICYmICFkYXRhLmlzQXJyYXkgJiYgdW5pZm9ybS53aWR0aCAhPT0gdm9pZCAwLFxuICAgIGNvZGU6IChuYW1lKSA9PiBgXG4gICAgICAgICAgICAgICAgY3YgPSB1ZFtcIiR7bmFtZX1cIl0udmFsdWU7XG4gICAgICAgICAgICAgICAgdiA9IHV2W1wiJHtuYW1lfVwiXTtcblxuICAgICAgICAgICAgICAgIGlmKGN2WzBdICE9PSB2LnggfHwgY3ZbMV0gIT09IHYueSB8fCBjdlsyXSAhPT0gdi53aWR0aCB8fCBjdlszXSAhPT0gdi5oZWlnaHQpXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBjdlswXSA9IHYueDtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMV0gPSB2Lnk7XG4gICAgICAgICAgICAgICAgICAgIGN2WzJdID0gdi53aWR0aDtcbiAgICAgICAgICAgICAgICAgICAgY3ZbM10gPSB2LmhlaWdodDtcbiAgICAgICAgICAgICAgICAgICAgZ2wudW5pZm9ybTRmKHVkW1wiJHtuYW1lfVwiXS5sb2NhdGlvbiwgdi54LCB2LnksIHYud2lkdGgsIHYuaGVpZ2h0KVxuICAgICAgICAgICAgICAgIH1gLFxuICAgIGNvZGVVYm86IChuYW1lKSA9PiBgXG4gICAgICAgICAgICAgICAgICAgIHYgPSB1di4ke25hbWV9O1xuXG4gICAgICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0XSA9IHYueDtcbiAgICAgICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQrMV0gPSB2Lnk7XG4gICAgICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KzJdID0gdi53aWR0aDtcbiAgICAgICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQrM10gPSB2LmhlaWdodDtcbiAgICAgICAgICAgICAgICBgXG4gIH0sXG4gIC8vIHVwbG9hZCBhIHBpeGkgY29sb3IgYXMgdmVjNCB3aXRoIGNhY2hpbmcgbGF5ZXJcbiAge1xuICAgIHRlc3Q6IChkYXRhLCB1bmlmb3JtKSA9PiBkYXRhLnR5cGUgPT09IFwidmVjNFwiICYmIGRhdGEuc2l6ZSA9PT0gMSAmJiAhZGF0YS5pc0FycmF5ICYmIHVuaWZvcm0ucmVkICE9PSB2b2lkIDAsXG4gICAgY29kZTogKG5hbWUpID0+IGBcbiAgICAgICAgICAgICAgICBjdiA9IHVkW1wiJHtuYW1lfVwiXS52YWx1ZTtcbiAgICAgICAgICAgICAgICB2ID0gdXZbXCIke25hbWV9XCJdO1xuXG4gICAgICAgICAgICAgICAgaWYoY3ZbMF0gIT09IHYucmVkIHx8IGN2WzFdICE9PSB2LmdyZWVuIHx8IGN2WzJdICE9PSB2LmJsdWUgfHwgY3ZbM10gIT09IHYuYWxwaGEpXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBjdlswXSA9IHYucmVkO1xuICAgICAgICAgICAgICAgICAgICBjdlsxXSA9IHYuZ3JlZW47XG4gICAgICAgICAgICAgICAgICAgIGN2WzJdID0gdi5ibHVlO1xuICAgICAgICAgICAgICAgICAgICBjdlszXSA9IHYuYWxwaGE7XG4gICAgICAgICAgICAgICAgICAgIGdsLnVuaWZvcm00Zih1ZFtcIiR7bmFtZX1cIl0ubG9jYXRpb24sIHYucmVkLCB2LmdyZWVuLCB2LmJsdWUsIHYuYWxwaGEpXG4gICAgICAgICAgICAgICAgfWAsXG4gICAgY29kZVVibzogKG5hbWUpID0+IGBcbiAgICAgICAgICAgICAgICAgICAgdiA9IHV2LiR7bmFtZX07XG5cbiAgICAgICAgICAgICAgICAgICAgZGF0YVtvZmZzZXRdID0gdi5yZWQ7XG4gICAgICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KzFdID0gdi5ncmVlbjtcbiAgICAgICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQrMl0gPSB2LmJsdWU7XG4gICAgICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KzNdID0gdi5hbHBoYTtcbiAgICAgICAgICAgICAgICBgXG4gIH0sXG4gIC8vIHVwbG9hZCBhIHBpeGkgY29sb3IgYXMgYSB2ZWMzIHdpdGggY2FjaGluZyBsYXllclxuICB7XG4gICAgdGVzdDogKGRhdGEsIHVuaWZvcm0pID0+IGRhdGEudHlwZSA9PT0gXCJ2ZWMzXCIgJiYgZGF0YS5zaXplID09PSAxICYmICFkYXRhLmlzQXJyYXkgJiYgdW5pZm9ybS5yZWQgIT09IHZvaWQgMCxcbiAgICBjb2RlOiAobmFtZSkgPT4gYFxuICAgICAgICAgICAgICAgIGN2ID0gdWRbXCIke25hbWV9XCJdLnZhbHVlO1xuICAgICAgICAgICAgICAgIHYgPSB1dltcIiR7bmFtZX1cIl07XG5cbiAgICAgICAgICAgICAgICBpZihjdlswXSAhPT0gdi5yZWQgfHwgY3ZbMV0gIT09IHYuZ3JlZW4gfHwgY3ZbMl0gIT09IHYuYmx1ZSB8fCBjdlszXSAhPT0gdi5hKVxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMF0gPSB2LnJlZDtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMV0gPSB2LmdyZWVuO1xuICAgICAgICAgICAgICAgICAgICBjdlsyXSA9IHYuYmx1ZTtcbiAgICBcbiAgICAgICAgICAgICAgICAgICAgZ2wudW5pZm9ybTNmKHVkW1wiJHtuYW1lfVwiXS5sb2NhdGlvbiwgdi5yZWQsIHYuZ3JlZW4sIHYuYmx1ZSlcbiAgICAgICAgICAgICAgICB9YCxcbiAgICBjb2RlVWJvOiAobmFtZSkgPT4gYFxuICAgICAgICAgICAgICAgICAgICB2ID0gdXYuJHtuYW1lfTtcblxuICAgICAgICAgICAgICAgICAgICBkYXRhW29mZnNldF0gPSB2LnJlZDtcbiAgICAgICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQrMV0gPSB2LmdyZWVuO1xuICAgICAgICAgICAgICAgICAgICBkYXRhW29mZnNldCsyXSA9IHYuYmx1ZTtcbiAgICAgICAgICAgICAgICBgXG4gIH0sXG4gIC8vIGEgY2FjaGluZyBsYXllciBmb3IgdmVjNCB1cGxvYWRpbmdcbiAge1xuICAgIHRlc3Q6IChkYXRhKSA9PiBkYXRhLnR5cGUgPT09IFwidmVjNFwiICYmIGRhdGEuc2l6ZSA9PT0gMSAmJiAhZGF0YS5pc0FycmF5LFxuICAgIGNvZGU6IChuYW1lKSA9PiBgXG4gICAgICAgICAgICAgICAgY3YgPSB1ZFtcIiR7bmFtZX1cIl0udmFsdWU7XG4gICAgICAgICAgICAgICAgdiA9IHV2W1wiJHtuYW1lfVwiXTtcblxuICAgICAgICAgICAgICAgIGlmKGN2WzBdICE9PSB2WzBdIHx8IGN2WzFdICE9PSB2WzFdIHx8IGN2WzJdICE9PSB2WzJdIHx8IGN2WzNdICE9PSB2WzNdKVxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMF0gPSB2WzBdO1xuICAgICAgICAgICAgICAgICAgICBjdlsxXSA9IHZbMV07XG4gICAgICAgICAgICAgICAgICAgIGN2WzJdID0gdlsyXTtcbiAgICAgICAgICAgICAgICAgICAgY3ZbM10gPSB2WzNdO1xuXG4gICAgICAgICAgICAgICAgICAgIGdsLnVuaWZvcm00Zih1ZFtcIiR7bmFtZX1cIl0ubG9jYXRpb24sI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ICAgaWYgKHJ0LnggPD0gbHQueCB8fCBsYi55IDw9IGx0LnkpXG4gICAgICByZXR1cm4gITE7XG4gICAgY29uc3QgcyA9IE1hdGguc2lnbih0cmFuc2Zvcm0uYSAqIHRyYW5zZm9ybS5kIC0gdHJhbnNmb3JtLmIgKiB0cmFuc2Zvcm0uYyk7XG4gICAgaWYgKHMgPT09IDAgfHwgKHRyYW5zZm9ybS5hcHBseShsdCwgbHQpLCB0cmFuc2Zvcm0uYXBwbHkobGIsIGxiKSwgdHJhbnNmb3JtLmFwcGx5KHJ0LCBydCksIHRyYW5zZm9ybS5hcHBseShyYiwgcmIpLCBNYXRoLm1heChsdC54LCBsYi54LCBydC54LCByYi54KSA8PSB4MCB8fCBNYXRoLm1pbihsdC54LCBsYi54LCBydC54LCByYi54KSA+PSB4MSB8fCBNYXRoLm1heChsdC55LCBsYi55LCBydC55LCByYi55KSA8PSB5MCB8fCBNYXRoLm1pbihsdC55LCBsYi55LCBydC55LCByYi55KSA+PSB5MSkpXG4gICAgICByZXR1cm4gITE7XG4gICAgY29uc3QgbnggPSBzICogKGxiLnkgLSBsdC55KSwgbnkgPSBzICogKGx0LnggLSBsYi54KSwgbjAwID0gbnggKiB4MCArIG55ICogeTAsIG4xMCA9IG54ICogeDEgKyBueSAqIHkwLCBuMDEgPSBueCAqIHgwICsgbnkgKiB5MSwgbjExID0gbnggKiB4MSArIG55ICogeTE7XG4gICAgaWYgKE1hdGgubWF4KG4wMCwgbjEwLCBuMDEsIG4xMSkgPD0gbnggKiBsdC54ICsgbnkgKiBsdC55IHx8IE1hdGgubWluKG4wMCwgbjEwLCBuMDEsIG4xMSkgPj0gbnggKiByYi54ICsgbnkgKiByYi55KVxuICAgICAgcmV0dXJuICExO1xuICAgIGNvbnN0IG14ID0gcyAqIChsdC55IC0gcnQueSksIG15ID0gcyAqIChydC54IC0gbHQueCksIG0wMCA9IG14ICogeDAgKyBteSAqIHkwLCBtMTAgPSBteCAqIHgxICsgbXkgKiB5MCwgb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ID0gcGF0aDIuY2hhckNvZGVBdChpKTtcbiAgICBlbHNlIHtcbiAgICAgIGlmIChjb2RlID09PSA0NylcbiAgICAgICAgYnJlYWs7XG4gICAgICBjb2RlID0gNDc7XG4gICAgfVxuICAgIGlmIChjb2RlID09PSA0Nykge1xuICAgICAgaWYgKCEobGFzdFNsYXNoID09PSBpIC0gMSB8fCBkb3RzID09PSAxKSlcbiAgICAgICAgaWYgKGxhc3RTbGFzaCAhPT0gaSAtIDEgJiYgZG90cyA9PT0gMikge1xuICAgICAgICAgIGlmIChyZXMubGVuZ3RoIDwgMiB8fCBsYXN0U2VnbWVudExlbmd0aCAhPT0gMiB8fCByZXMuY2hhckNvZGVBdChyZXMubGVuZ3RoIC0gMSkgIT09IDQ2IHx8IHJlcy5jaGFyQ29kZUF0KHJlcy5sZW5ndGggLSAyKSAhPT0gNDYpIHtcbiAgICAgICAgICAgIGlmIChyZXMubGVuZ3RoID4gMikge1xuICAgICAgICAgICAgICBjb25zdCBsYXN0U2xhc2hJbmRleCA9IHJlcy5sYXN0SW5kZXhPZihcIi9cIik7XG4gICAgICAgICAgICAgIGlmIChsYXN0U2xhc2hJbmRleCAhPT0gcmVzLmxlbmd0aCAtIDEpIHtcbiAgICAgICAgICAgICAgICBsYXN0U2xhc2hJbmRleCA9PT0gLTEgPyAocmVzID0gXCJcIiwgbGFzdFNlZ21lbnRMZW5ndGggPSAwKSA6IChyZXMgPSByZXMuc2xpY2UoMCwgbGFzdFNsYXNoSW5kZXgpLCBsYXN0U2VnbWVudExlbmd0aCA9IHJlcy5sZW5ndGggLSAxIC0gcmVzLmxhc3RJbmRleE9mKFwiL1wiKSksIGxhc3RTbGFzaCA9IGksIGRvdHMgPSAwO1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHJlcy5sZW5ndGggPT09IDIgfHwgcmVzLmxlbmd0aCA9PT0gMSkge1xuICAgICAgICAgICAgICBy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A6IDA7XG4gICAgICBpZiAoaXRlbXMubGVuZ3RoID4gMCkge1xuICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICBldmVudC5zdG9wUHJvcGFnYXRpb24oKTtcbiAgICAgICAgaWYgKGV2ZW50LmtleSA9PT0gXCJBcnJvd0Rvd25cIikge1xuICAgICAgICAgIGluZGV4Kys7XG4gICAgICAgIH0gZWxzZSBpZiAoZXZlbnQua2V5ID09PSBcIkFycm93VXBcIikge1xuICAgICAgICAgIGluZGV4LS07XG4gICAgICAgIH0gZWxzZSBpZiAoZXZlbnQua2V5ID09PSBcIkhvbWVcIikge1xuICAgICAgICAgIGluZGV4ID0gMDtcbiAgICAgICAgfSBlbHNlIGlmIChldmVudC5rZXkgPT09IFwiRW5kXCIpIHtcbiAgICAgICAgICBpbmRleCA9IGl0ZW1zLmxlbmd0aCAtIDE7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGluZGV4IDwgMCkge1xuICAgICAgICAgIGluZGV4ID0gaXRlbXMubGVuZ3RoIC0gMTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoaW5kZXggPiBpdGVtcy5sZW5ndGggLSAxKSB7XG4gICAgICAgICAgaW5kZXggPSAwO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuc2V0Q3VycmVudEl0ZW0oaXRlbXNbaW5kZXhdKTtcbiAgICAgICAgaXRlbXNbaW5kZXhdLmZvY3VzKCk7XG4gICAgICB9XG4gICAgfVxuICB9XG4gIGhhbmRsZU1vdXNlRG93bihldmVudCkge1xuICAgIGNvbnN0IHRhcmdldCA9IGV2ZW50LnRhcmdldDtcbiAgICBpZiAodGhpcy5pc01lbnVJdGVtKHRhcmdldCkpIHtcbiAgICAgIHRoaXMuc2V0Q3VycmVudEl0ZW0odGFyZ2V0KTtcbiAgICB9XG4gIH1cbiAgaGFuZGxlU2xvdENoYW5nZSgpIHtcbiAgICBjb25zdCBpdGVtcyA9IHRoaXMuZ2V0QWxsSXRlbX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gICBhcmlhLWRlc2NyaWJlZGJ5PVwiaGVscC10ZXh0XCJcbiAgICAgICAgICAgICAgQGNoYW5nZT0ke3RoaXMuaGFuZGxlQ2hhbmdlfVxuICAgICAgICAgICAgICBAZm9jdXM9JHt0aGlzLmhhbmRsZUZvY3VzfVxuICAgICAgICAgICAgICBAaW5wdXQ9JHt0aGlzLmhhbmRsZUlucHV0fVxuICAgICAgICAgICAgICBAaW52YWxpZD0ke3RoaXMuaGFuZGxlSW52YWxpZH1cbiAgICAgICAgICAgICAgQGJsdXI9JHt0aGlzLmhhbmRsZUJsdXJ9XG4gICAgICAgICAgICAvPlxuICAgICAgICAgICAgJHt0aGlzLnRvb2x0aXAgIT09IFwibm9uZVwiICYmICF0aGlzLmRpc2FibGVkID8gaHRtbGBcbiAgICAgICAgICAgICAgICAgIDxvdXRwdXQgcGFydD1cInRvb2x0aXBcIiBjbGFzcz1cInJhbmdlX190b29sdGlwXCI+XG4gICAgICAgICAgICAgICAgICAgICR7dHlwZW9mIHRoaXMudG9vbHRpcEZvcm1hdHRlciA9PT0gXCJmdW5jdGlvblwiID8gdGhpcy50b29sdGlwRm9ybWF0dGVyKHRoaXMudmFsdWUpIDogdGhpcy52YWx1ZX1cbiAgICAgICAgICAgICAgICAgIDwvb3V0cHV0PlxuICAgICAgICAgICAgICAgIGAgOiBcIlwifVxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICA8L2Rpdj5cblxuICAgICAgICA8ZGl2XG4gICAgICAgICAgcGFydD1cImZvcm0tY29udHJvbC1oZWxwLXRleHRcIlxuICAgICAgICAgIGlkPVwiaGVscC10ZXh0XCJcbiAgICAgICAgICBjbGFzcz1cImZvcm0tY29udHJvbF9faGVscC10ZXh0XCJcbiAgICAgICAgICBhcmlhLWhpZGRlbj0ke2hhc0hlbHBUZXh0ID8gXCJmYWxzZVwiIDogXCJ0cnVlXCJ9XG4gICAgICAgID5cbiAgICAgICAgICA8c2xvdCBuYW1lPVwiaGVscC10ZXh0XCI+JHt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O1xuICAgICAgICAgICAgYm90dG9tUmlnaHRYID0gYW5jaG9yUmVjdC5yaWdodDtcbiAgICAgICAgICAgIGJvdHRvbVJpZ2h0WSA9IGFuY2hvclJlY3QudG9wO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoYW5jaG9yUmVjdC5sZWZ0IDwgcG9wdXBSZWN0LmxlZnQpIHtcbiAgICAgICAgICAgIHRvcExlZnRYID0gYW5jaG9yUmVjdC5yaWdodDtcbiAgICAgICAgICAgIHRvcExlZnRZID0gYW5jaG9yUmVjdC50b3A7XG4gICAgICAgICAgICB0b3BSaWdodFggPSBwb3B1cFJlY3QubGVmdDtcbiAgICAgICAgICAgIHRvcFJpZ2h0WSA9IHBvcHVwUmVjdC50b3A7XG4gICAgICAgICAgICBib3R0b21MZWZ0WCA9IGFuY2hvclJlY3QucmlnaHQ7XG4gICAgICAgICAgICBib3R0b21MZWZ0WSA9IGFuY2hvclJlY3QuYm90dG9tO1xuICAgICAgICAgICAgYm90dG9tUmlnaHRYID0gcG9wdXBSZWN0LmxlZnQ7XG4gICAgICAgICAgICBib3R0b21SaWdodFkgPSBwb3B1cFJlY3QuYm90dG9tO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0b3BMZWZ0WCA9IHBvcHVwUmVjdC5yaWdodDtcbiAgICAgICAgICAgIHRvcExlZnRZID0gcG9wdXBSZWN0LnRvcDtcbiAgICAgICAgICAgIHRvcFJpZ2h0WCA9IGFuY2hvclJlY3QubGVmdDtcbiAgICAgICAgICAgIHRvcFJpZ2h0WSA9IGFuY2hvclJlY3QudG9wO1xuICAgICAgICAgICAgYm90dG9tTGVmdFggPSBwb3B1cFJlY3QucmlnaHQ7XG4gICAgICAgICAgICBib3R0b21MZWZ0WSA9IHBvcHVwUmVjdC5ib3R0b207XG4gICAgICAgICAgICBib3R0b21SaWdodFggPSBhbmNob3JSZWN0LmxlZnQ7XG4gICAgICAgICAgICBib3R0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cbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignYGNsYXNzTWFwKClgIGNhbiBvbmx5IGJlIHVzZWQgaW4gdGhlIGBjbGFzc2AgYXR0cmlidXRlICcgK1xuICAgICAgICAgICAgICAgICdhbmQgbXVzdCBiZSB0aGUgb25seSBwYXJ0IGluIHRoZSBhdHRyaWJ1dGUuJyk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmVuZGVyKGNsYXNzSW5mbykge1xuICAgICAgICAvLyBBZGQgc3BhY2VzIHRvIGVuc3VyZSBzZXBhcmF0aW9uIGZyb20gc3RhdGljIGNsYXNzZXNcbiAgICAgICAgcmV0dXJuICgnICcgK1xuICAgICAgICAgICAgT2JqZWN0LmtleXMoY2xhc3NJbmZvKVxuICAgICAgICAgICAgICAgIC5maWx0ZXIoKGtleSkgPT4gY2xhc3NJbmZvW2tleV0pXG4gICAgICAgICAgICAgICAgLmpvaW4oJyAnKSArXG4gICAgICAgICAgICAnICcpO1xuICAgIH1cbiAgICB1cGRhdGUocGFydCwgW2NsYXNzSW5mb10pIHtcbiAgICAgICAgLy8gUmVtZW1iZXIgZHluYW1pYyBjbGFzc2VzIG9uIHRoZSBmaXJzdCByZW5kZXJcbiAgICAgICAgaWYgKHRoaXMuX3ByZXZpb3VzQ2xhc3NlcyA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICB0aGlzLl9wcmV2aW91c0NsYXNzZXMgPSBuZXcgU2V0KCk7XG4gICAgICAgICAgICBpZiAocGFydC5zdHJpbmdzICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9zdGF0aWNDbGFzc2VzID0gbmV3IFNldChwYXJ0LnN0cmluZ3NcbiAgICAgICAgICAgICAgICAgICAgLmpvaW4oJyAnKVxuICAgICAgICAgICAgICAgICAgICAuc3BsaXQoL1xccy8pXG4gICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoKHMpID0+IHMgIT09ICcnKSk7XG4gICAgICAgICAgIC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sdWVdKSB7XG4gICAgICAgIGlmICh2YWx1ZSA9PT0gbm9DaGFuZ2UgfHwgdmFsdWUgPT09IG5vdGhpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBlbGVtZW50ID0gcGFydC5lbGVtZW50O1xuICAgICAgICBjb25zdCBuYW1lID0gcGFydC5uYW1lO1xuICAgICAgICBpZiAocGFydC50eXBlID09PSBQYXJ0VHlwZS5QUk9QRVJUWSkge1xuICAgICAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnlcbiAgICAgICAgICAgIGlmICh2YWx1ZSA9PT0gZWxlbWVudFtuYW1lXSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBub0NoYW5nZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChwYXJ0LnR5cGUgPT09IFBhcnRUeXBlLkJPT0xFQU5fQVRUUklCVVRFKSB7XG4gICAgICAgICAgICBpZiAoISF2YWx1ZSA9PT0gZWxlbWVudC5oYXNBdHRyaWJ1dGUobmFtZSkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm9DaGFuZ2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAocGFydC50eXBlID09PSBQYXJ0VHlwZS5BVFRSSUJVVEUpIHtcbiAgICAgICAgICAgIGlmIChlbGVtZW50LmdldEF0dHJpYnV0ZShuYW1lKSA9PT0gU3RyaW5nKHZhbHVlKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBub0NoYW5nZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvLyBSZXNldHMgdGhlIHBhcnQncyB2YWx1ZSwgY2F1c2luZyBpdHMgZGlydHktY2hlY2sgdG8gZmFpbCBzbyB0aGF0IGl0XG4gICAgICAgIC8vI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2suc2V0KGNvbnRleHQsIGxhc3RFbGVtZW50Rm9yQ2FsbGJhY2spO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGxhc3RFbGVtZW50Rm9yQ2FsbGJhY2suZ2V0KHRoaXMuX3JlZikgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIHRoaXMuX3JlZi5jYWxsKHRoaXMuX2NvbnRleHQsIHVuZGVmaW5lZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsYXN0RWxlbWVudEZvckNhbGxiYWNrLnNldCh0aGlzLl9yZWYsIGVsZW1lbnQpO1xuICAgICAgICAgICAgLy8gQ2FsbCB0aGUgcmVmIHdpdGggdGhlIG5ldyBlbGVtZW50IHZhbHVlXG4gICAgICAgICAgICBpZiAoZWxlbWVudCAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fcmVmLmNhbGwodGhpcy5fY29udGV4dCwgZWxlbWVudCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB0aGlzLl9yZWYudmFsdWUgPSBlbGVtZW50O1xuICAgICAgICB9XG4gICAgfVxuICAgIGdldCBfbGFzdEVsZW1lbnRGb3JSZWYoKSB7XG4gICAgICAgIHJldHVybiB0eXBlb2YgdGhpcy5fcmVmID09PSAnZnVuY3Rpb24nXG4gICAgICAgICAgICA/IGxhc3RFbGVtZW50Rm9yQ29udGV4dEFuZENhbGxiYWNrXG4gICAgICAgICAgICAgICAgLmdldCh0aGlzLl9jb250ZXh0ID8/IGdsb2JhbFRoaXMpXG4gICAgICAgICAgICAgICAgPy5nZXQodGhpcy5fcmVmKVxuICAgICAgICAgICAgOiB0aGlzLl9yZWY/LnZhbHVlO1xuICAgIH1cbiAgICBkaXNjb25uZWN0ZWQoKSB7XG4gICAgICAgIC8vIE9ubHkgY2xlYXIgdGhlIGJveCBpZiBvdXIgZWxlbWVudCBpcyBzdGls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WFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGFzdEluZGV4ID0gcmVnZXgubGFzdEluZGV4O1xuICAgICAgICAgICAgaWYgKHJlZ2V4ID09PSB0ZXh0RW5kUmVnZXgpIHtcbiAgICAgICAgICAgICAgICBpZiAobWF0Y2hbQ09NTUVOVF9TVEFSVF0gPT09ICchLS0nKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlZ2V4ID0gY29tbWVudEVuZFJlZ2V4O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChtYXRjaFtDT01NRU5UX1NUQVJUXSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIFdlIHN0YXJ0ZWQgYSB3ZWlyZCBjb21tZW50LCBsaWtlIDwve1xuICAgICAgICAgICAgICAgICAgICByZWdleCA9IGNvbW1lbnQyRW5kUmVnZXg7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKG1hdGNoW1RBR19OQU1FXSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChyYXdUZXh0RWxlbWVudC50ZXN0KG1hdGNoW1RBR19OQU1FXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJlY29yZCBpZiB3ZSBlbmNvdW50ZXIgYSByYXctdGV4dCBlbGVtZW50LiBXZSdsbCBzd2l0Y2ggdG9cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoaXMgcmVnZXggYXQgdGhlIGVuZCBvZiB0aGUgdGFnLlxuICAgICAgICAgICAgICAgICAgICAgICAgcmF3VGV4dEVuZFJlZ2V4ID0gbmV3IFJlZ0V4cChgPC8ke21hdGNoW1RBR19OQU1FXX1gLCAnZycpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJlZ2V4ID0gdGFnRW5kUmVnZXg7XG4gICAgICAgICAgICAgICAgfVx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ZGV4XG4gICAgICAgICAgICAgICAgICAgIGF0dHJOYW1lRW5kSW5kZXggPSAtMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAobWF0Y2hbQVRUUklCVVRFX05BTUVdID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gQXR0cmlidXRlIG5hbWUgcG9zaXRpb25cbiAgICAgICAgICAgICAgICAgICAgYXR0ck5hbWVFbmRJbmRleCA9IC0yO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYXR0ck5hbWVFbmRJbmRleCA9IHJlZ2V4Lmxhc3RJbmRleCAtIG1hdGNoW1NQQUNFU19BTkRfRVFVQUxTXS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgIGF0dHJOYW1lID0gbWF0Y2hbQVRUUklCVVRFX05BTUVdO1xuICAgICAgICAgICAgICAgICAgICByZWdleCA9XG4gICAgICAgICAgICAgICAgICAgICAgICBtYXRjaFtRVU9URV9DSEFSXSA9PT0gdW5kZWZpbmVkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0YWdFbmRSZWdleFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbWF0Y2hbUVVPVEVfQ0hBUl0gPT09ICdcIidcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBkb3VibGVRdW90ZUF0dHJFbmRSZWdleFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHNpbmdsZVF1b3RlQXR0ckVuZFJlZ2V4O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHJlZ2V4ID09PSBkb3VibGVRdW90ZUF0dHJFbmRSZWdleCB8fFxuICAgICAgICAgICAgICAgIHJlZ2V4ID09PSBzaW5nbGVRdW90ZUF0dHJFbmRSZWdleCkge1xuICAgICAgICAgIC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GJpbmRpbmcgbmV4dCB0byBzZWxmLWNsb3NpbmcgdGFnIGVuZCBhbmQgaW5zZXJ0IGEgc3BhY2UgdG9cbiAgICAgICAgLy8gc2VwYXJhdGUgdGhlIG1hcmtlciBmcm9tIHRoZSB0YWcgZW5kOlxuICAgICAgICBjb25zdCBlbmQgPSByZWdleCA9PT0gdGFnRW5kUmVnZXggJiYgc3RyaW5nc1tpICsgMV0uc3RhcnRzV2l0aCgnLz4nKSA/ICcgJyA6ICcnO1xuICAgICAgICBodG1sICs9XG4gICAgICAgICAgICByZWdleCA9PT0gdGV4dEVuZFJlZ2V4XG4gICAgICAgICAgICAgICAgPyBzICsgbm9kZU1hcmtlclxuICAgICAgICAgICAgICAgIDogYXR0ck5hbWVFbmRJbmRleCA+PSAwXG4gICAgICAgICAgICAgICAgICAgID8gKGF0dHJOYW1lcy5wdXNoKGF0dHJOYW1lKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHMuc2xpY2UoMCwgYXR0ck5hbWVFbmRJbmRleCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvdW5kQXR0cmlidXRlU3VmZml4ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLnNsaWNlKGF0dHJOYW1lRW5kSW5kZXgpKSArXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXJrZXIgK1xuICAgICAgICAgICAgICAgICAgICAgICAgZW5kXG4gICAgICAgICAgICAgICAgICAgIDogcyArIG1hcmtlciArIChhdHRyTmFtZUVuZEluZGV4ID09PSAtMiA/IGkgOiBlbmQpO1xuICAgIH1cbiAgICBjb25zdCBodG1sUmVzdWx0ID0gaHRtbCArIChzdHJpbmdzW2xdIHx8ICc8Pz4nKSArICh0eXBlID09PSBTVkdfUkVTVUxUID8gJzwvc3ZnPicgOiAnJyk7XG4gICAgLy8gUmV0dXJuZWQgYXMgYW4gYXJyYXkgZm9yIHRlcnNlbmVzc1xuICAgIHJldHVybiBbdHJ1c3RGcm9tVGVtcGxhdG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gICAgICAgICAgICAgICBgZWxlbWVudHMuIFNlZSBodHRwczovL2xpdC5kZXYvbXNnL2V4cHJlc3Npb24taW4tJHt0YWd9IGZvciBtb3JlIGAgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGBpbmZvcm1hdGlvbi5gO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRhZyA9PT0gJ3RlbXBsYXRlJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihtKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc3N1ZVdhcm5pbmcoJycsIG0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIFRPRE8gKGp1c3RpbmZhZ25hbmkpOiBmb3IgYXR0ZW1wdGVkIGR5bmFtaWMgdGFnIG5hbWVzLCB3ZSBkb24ndFxuICAgICAgICAgICAgICAgIC8vIGluY3JlbWVudCB0aGUgYmluZGluZ0luZGV4LCBhbmQgaXQnbGwgYmUgb2ZmIGJ5IDEgaW4gdGhlIGVsZW1lbnRcbiAgICAgICAgICAgICAgICAvLyBhbmQgb2ZmIGJ5IHR3byBhZnRlciBpdC5cbiAgICAgICAgICAgICAgICBpZiAobm9kZS5oYXNBdHRyaWJ1dGVzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChjb25zdCBuYW1lIG9mIG5vZGUuZ2V0QXR0cmlidXRlTmFtZXMoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5hbWUuZW5kc1dpdGgoYm91bmRBdHRyaWJ1dGVTdWZmaXgpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVhbE5hbWUgPSBhdHRyTmFtZXNbYXR0ck5hbWVJbmRleCsrXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2YWx1ZSA9IG5vZGUuZ2V0QXR0cmlidXRlKG5hbWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHN0YXRpY3MgPSB2YWx1ZS5zcGxpdChtYXJrZXIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IG0gPSAvKFsuP0BdKT8oLiopLy5leGVjKHJlYWxOYW1lKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogQVRUUklCVVRFX1BBUlQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBub2RlSW5kZXgsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IG1bMl0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZ3M6IHN0YXRpY3MsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN0b3I6IG1bMV0gPT09ICcuJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBQcm9wZXJ0eVBhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJz8nXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBCb29sZWFuQXR0cmlidXRlUGFydFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJ0AnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gRXZlbnRQYXJ0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogQXR0cmlidXRlUGFydCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKG5hbWUuc3RhcnRzV2l0aChtYXJrZXIpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IEVMRU1FTlRfUEFSVCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBUT0RPIChqdXN0aW5mYWduYW5pKTogYmVuY2htYXJrIHRoZSByZWdleCBhZ2FpbnN0IHRlc3RpbmcgZm9yIGVhY2hcbiAgICAgICAgICAgICAgICAvLyBvZiB0aGUgMyByYXcgdGV4dCBlbGVtZW50IG5hbWVzLlxuICAgICAgICAgICAgICAgIGlmIChyYXdUZXh0RWxlbWVudC50ZXN0KG5vZGUudGFnTmFtZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gRm9yIHJhdyB0ZXh0IGVsZW1lbnRzIHdlIG5lZWQgdG8gc3BsaXQgdGhlIHRleHQgY29udGVudCBvblxuICAgICAgICAgICAgICAgICAgICAvLyBtYXJrZXJzLCBjcmVhdGUgYSBUZXh0IG5vZGUgZm9yIGVhY2ggc2VnbWVudCwgYW5kIGNyZWF0ZVxuICAgICAgICAgICAgICAgICAgICAvLyBhIFRlbXBsYXRlUGFydCBmb3IgZWFjaCBtYXJrZXIuXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHN0cmluZ3MgPSBub2RlLnRleHRDb250ZW50LnNwbGl0KG1hcmtlcik7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGxhc3RJbmRleCA9IHN0cmluZ3MubGVuZ3RoIC0gMTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxhc3RJbmRleCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUudGV4dENvbnRlbnQgPSB0cnVzdGVkVHlwZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRydXN0ZWRUeXBlcy5lbXB0eVNjcmlwdFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogJyc7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBHZW5lcmF0ZSBhIG5ldyB0ZXh0IG5vZGUgZm9yIGVhY2ggbGl0ZXJhbCBzZWN0aW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGVzZSBub2RlcyBhcmUgYWxzbyB1c2VkIGFzIHRoZSBtYXJrZXJzIGZvciBub2RlIHBhcnRzXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBjYW4ndCB1c2UgZW1wdHkgdGV4dCBub2RlcyBhcyBtYXJrZXJzIGJlY2F1c2UgdGhleSdyZVxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm9ybWFsaXplZCB3aGVuIGNsb25pbmcgaW4gSUUgKGNvdWxkIHNpbXBsaWZ5IHdoZW5cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIElFIGlzIG5vIGxvbmdlciBzdXBwb3J0ZWQpXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGxhc3RJbmRleDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5hcHBlbmQoc3RyaW5nc1tpXSwgY3JlYXRlTWFya2VyKCkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdhbGsgcGFzdCB0aGUgbWFya2VyIG5vZGUgd2UganVzdCBhZGRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdhbGtlci5uZXh0Tm9kZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnRzLnB1c2goeyB0eXBlOiBDSElMRF9QQVJULCBpbmRleDogKytub2RlSW5kZXggfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBOb3RlIGJlY2F1c2UgdGhpcyBtYXJrZXIgaXMgYWRkZWQgYWZ0ZXIgdGhlIHdhbGtlcidzIGN1cnJlbnRcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vZGUsIGl0IHdpbGwgYmUgd2Fsa2VkIHRvIGluIHRoZSBvdXRlciBsb29wIChhbmQgaWdub3JlZCksIHNvXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB3ZSBkb24ndCBuZWVkIHRvIGFkanVzdCBub2RlSW5kZXggaGVyZVxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5hcHBlbmQoc3RyaW5nc1tsYXN0SW5kZXhdLCBjcmVhdGVNYXJrZXIoKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChub2RlLm5vZGVUeXBlID09PSA4KSB7XG4gICAgICAgICAgICAgICAgY29uc3QgZGF0YSA9IG5vZGUuZGF0YTtcbiAgICAgICAgICAgICAgICBpZiAoZGF0YSA9PT0gbWFya2VyTWF0Y2gpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFydHMucHVzaCh7IHR5cGU6IENISUxEX1BBUlQsIGluZGV4OiBub2RlSW5kZXggfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBsZXQgaSA9IC0xO1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoKGkgPSBub2RlLmRhdGEuaW5kZXhPZihtYXJrZXIsIGkgKyAxKSkgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBDb21tZW50IG5vZGUgaGFzIGEgYmluZGluZyBtYXJrZXIgaW5zaWRlLCBtYWtlIGFuIGluYWN0aXZlIHBhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoZSBiaW5kaW5nIHdvbid0IHdvcmssIGJ1dCBzdWJzZXF1ZW50IGJpbmRpbmdzIHdpbGxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnRzLnB1c2goeyB0eXBlOiBDT01NRU5UX1BBUlQsIGluZGV4OiBub2RlSW5kZXggfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBNb3ZlIHRvIHRoZSBlbmQgb2YgdGhlIG1hdGNoXG4gICAgICAgICAgICAgICAgICAgICAgICBpICs9IG1hcmtlci5sZW5ndGggLSAxO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbm9kZUluZGV4Kys7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKERFVl9NT0RFKSB7XG4gICAgICAgICAgICAvLyBJZiB0aGVyZSB3YXMgYSBkdXBsaWNhdGUgYXR0cmlidXRlIG9uIGEgdGFnLCB0aGVuIHdoZW4gdGhlIHRhZyBpc1xuICAgICAgICAgICAgLy8gcGFyc2VkIGludG8gYW4gZWxlbWVudCB0aGUgYXR0cmlidXRlIGdldHMgZGUtZHVwbGljYXRlZC4gV2UgY2FuIGRldGVjdFxuICAgICAgICAgICAgLy8gdGhpcyBtaXNtYXRjaCBpZiB3ZSBoYXZlbid0IHByZWNpc2VseSBjb25zdW1lZCBldmVyeSBhdHRyaWJ1dGUgbmFtZVxuICAgICAgICAgICAgLy8gd2hlbiBwcmVwYXJpbmcgdGhlIHRlbXBsYXRlLiBUaGlzIHdvcmtzIGJlY2F1c2UgYGF0dHJOYW1lc2AgaXMgYnVpbHRcbiAgICAgICAgICAgIC8vIGZyb20gdGhlIHRlbXBsYXRl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1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIGlmIChub2RlSW5kZXggPT09IHRlbXBsYXRlUGFydC5pbmRleCkge1xuICAgICAgICAgICAgICAgIGxldCBwYXJ0O1xuICAgICAgICAgICAgICAgIGlmICh0ZW1wbGF0ZVBhcnQudHlwZSA9PT0gQ0hJTERfUEFSVCkge1xuICAgICAgICAgICAgICAgICAgICBwYXJ0ID0gbmV3IENoaWxkUGFydChub2RlLCBub2RlLm5leHRTaWJsaW5nLCB0aGlzLCBvcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAodGVtcGxhdGVQYXJ0LnR5cGUgPT09IEFUVFJJQlVURV9QQVJUKSB7XG4gICAgICAgICAgICAgICAgICAgIHBhcnQgPSBuZXcgdGVtcGxhdGVQYXJ0LmN0b3Iobm9kZSwgdGVtcGxhdGVQYXJ0Lm5hbWUsIHRlbXBsYXRlUGFydC5zdHJpbmdzLCB0aGlzLCBvcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAodGVtcGxhdGVQYXJ0LnR5cGUgPT09IEVMRU1FTlRfUEFSVCkge1xuICAgICAgICAgICAgICAgICAgICBwYXJ0ID0gbmV3IEVsZW1lbnRQYXJ0KG5vZGUsIHRoaXMsIG9wdGlvbnMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLl8kcGFydHMucHVzaChwYXJ0KTtcbiAgICAgICAgICAgICAgICB0ZW1wbGF0ZVBhcnQgPSBwYXJ0c1srK3BhcnRJbmRleF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobm9kZUluZGV4ICE9PSB0ZW1wbGF0ZVBhcnQ/LmluZGV4KSB7XG4gICAgICAgICAgICAgICAgbm9kZSA9IHdhbGtlci5uZXh0Tm9kZSgpO1xuICAgICAgICAgICAgICAgIG5vZGVJbmRleCsrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIFdlIG5lZWQgdG8gc2V0IHRoZSBjdXJyZW50Tm9kZSBhd2F5IGZyb20gdGhlIGNsb25lZCB0cmVlIHNvIHRoYXQgd2VcbiAgICAgICAgLy8gZG9uJ3QgaG9sZCBvbnRvIHRoZSB0cmVlIGV2ZW4gaWYgdGhlIHRyZWUgaXMgZGV0YWNoZWQgYW5kIHNob3VsZCBiZVxuICAgICAgICAvLyBmcmVlZC5cbiAgICAgICAgd2Fsa2VyLmN1cnJlbnROb2RlID0gZDtcbiAgICAgICAgcmV0dXJuIGZyYWdtZW50O1xuICAgIH1cbiAgICBfdXBkYXRlKHZhbHVlcykge1xuICAgICAgICBsZXQgaSA9IDA7XG4gICAgICAgIGZvciAoY29uc3QgcGFydCBvZiB0aGlzLl8kcGFydHMpIHtcbiAgICAgICAgICAgIGlmIChwYXJ0ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICBkZWJ1Z0xvZ0V2ZW50ICYmXG4gICAgICAgICAgICAgICAgICAgIGRlYnVnTG9nRXZlbnQoe1xuICAgICAgICAgICAgICAgICAgICAgICAga2luZDogJ3NldCBwYXJ0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnQsXG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdmFsdWVzW2ldLFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVJbmRleDogaSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlcyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlSW5zdGFuY2U6IHRoaXMsXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIGlmIChwYXJ0LnN0cmluZ3MgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICBwYXJ0Ll8kc2V0VmFsdWUodmFsdWVzLCBwYXJ0LCBpKTtcbiAgICAgICAgICAgICAgICAgICAgLy8gVGhlIG51bWJl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h2YWx1ZSkpIHtcbiAgICAgICAgICAgIC8vIE5vbi1yZW5kZXJpbmcgY2hpbGQgdmFsdWVzLiBJdCdzIGltcG9ydGFudCB0aGF0IHRoZXNlIGRvIG5vdCByZW5kZXJcbiAgICAgICAgICAgIC8vIGVtcHR5IHRleHQgbm9kZXMgdG8gYXZvaWQgaXNzdWVzIHdpdGggcHJldmVudGluZyBkZWZhdWx0IDxzbG90PlxuICAgICAgICAgICAgLy8gZmFsbGJhY2sgY29udGVudC5cbiAgICAgICAgICAgIGlmICh2YWx1ZSA9PT0gbm90aGluZyB8fCB2YWx1ZSA9PSBudWxsIHx8IHZhbHVlID09PSAnJykge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLl8kY29tbWl0dGVkVmFsdWUgIT09IG5vdGhpbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVidWdMb2dFdmVudCAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgZGVidWdMb2dFdmVudCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAga2luZDogJ2NvbW1pdCBub3RoaW5nIHRvIGNoaWxkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydDogdGhpcy5fJHN0YXJ0Tm9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmQ6IHRoaXMuXyRlbmROb2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudDogdGhpcy5fJHBhcmVudCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zOiB0aGlzLm9wdGlvbnMsXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fJGNsZWFyKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMuXyRjb21taXR0ZWRWYWx1ZSA9IG5vdGhpbmc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICh2YWx1ZSAhPT0gdGhpcy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wgcGFyZW50Tm9kZU5hbWUgPT09ICdTQ1JJUFQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gJ0ZvcmJpZGRlbic7XG4gICAgICAgICAgICAgICAgICAgIGlmIChERVZfTU9ERSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmVudE5vZGVOYW1lID09PSAnU1RZTEUnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGBMaXQgZG9lcyBub3Qgc3VwcG9ydCBiaW5kaW5nIGluc2lkZSBzdHlsZSBub2Rlcy4gYCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgVGhpcyBpcyBhIHNlY3VyaXR5IHJpc2ssIGFzIHN0eWxlIGluamVjdGlvbiBhdHRhY2tzIGNhbiBgICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGBleGZpbHRyYXRlIGRhdGEgYW5kIHNwb29mIFVJcy4gYCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgQ29uc2lkZXIgaW5zdGVhZCB1c2luZyBjc3NcXGAuLi5cXGAgbGl0ZXJhbHMgYCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgdG8gY29tcG9zZSBzdHlsZXMsIGFuZCBtYWtlIGRvIGR5bmFtaWMgc3R5bGluZyB3aXRoIGAgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYGNzcyBjdXN0b20gcHJvcGVydGllcywgOjpwYXJ0cywgPHNsb3Q+cywgYCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgYW5kIGJ5IG11dGF0aW5nIHRoZSBET00gcmF0aGVyIHRoYW4gc3R5bGVzaGVldHMuYDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgTGl0IGRvZXMgbm90IHN1cHBvcnQgYmluZGluZyBpbnNpZGUgc2NyaXB0IG5vZGVzLiBgICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGBUaGlzIGlzIGEgc2VjdXJpdHkgcmlzaywgYXMgaXQgY291bGQgYWxsb3cgYXJiaXRyYXJ5IGAgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYGNvZGUgZXhlY3V0aW9uLmA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRlYnVnTG9nRXZlbnQgJiZcbiAgICAgICAgICAgICAgICBkZWJ1Z0xvZ0V2ZW50KHtcbiAgICAgICAgICAgICAgICAgICAga2luZDogJ2NvbW1pdCBub2RlJyxcbiAgICAgICAgICAgICAgICAgICAgc3RhcnQ6IHRoaXMuXyRzdGFydE5vZGUsXG4gICAgICAgICAgICAgICAgICAgIHBhcmVudDogdGhpcy5fJHBhcmVudCxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHZhbHVlLFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zOiB0aGlzLm9wdGlvbnMsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB0aGlzLl8kY29tbWl0dGVkVmFsdWUgPSB0aGlzLl9pbnNlcnQodmFsdWUpO1xuICAgICAgICB9XG4gICAgfVxuICAgIF9jb21taXRUZXh0KHZhbHVlKSB7XG4gICAgICAgIC8vIElmIHRoZSBjb21taXR0ZWQgdmFsdWUgaXMgYSBwcmltaXRpdmUgaXQgbWVhbnMgd2UgY2FsbGVkIF9jb21taXRUZXh0IG9uXG4gICAgICAgIC8vIHRoZSBwcmV2aW91cyByZW5kZXIsIGFuZCB3ZSBrbm93IHRoYXQgdGhpcy5fJHN0YXJ0Tm9kZS5uZXh0U2libGluZyBpcyBhXG4gICAgICAgIC8vIFRleHQgbm9kZS4gV2UgY2FuIG5vdyBqdXN0IHJlcGxhY2UgdGhlIHRleHQgY29udGVudCAoLmRhdGEpIG9mIHRoZSBub2RlLlxuICAgICAgICBpZiAodGhpcy5fJGNvbW1pdHRlZFZhbHVlICE9PSBub3RoaW5nICYmXG4gICAgICAgICAgICBpc1ByaW1pdGl2ZSh0aGlzLl8kY29tbWl0dGVkVmFsdWUpKSB7XG4gICAgICAgICAgICBjb25zdCBub2RlID0gd3JhcCh0aGlzLl8kc3RhcnROb2RlKS5uZXh0U2libGluZztcbiAgICAgICAgICAgIGlmIChFTkFCTEVfRVhUUkFfU0VDVVJJVFlfSE9PS1MpIHtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5fdGV4dFNhbml0aXplciA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3RleHRTYW5pdGl6ZXIgPSBjcmVhdGVTYW5pdGl6ZXIobm9kZSwgJ2RhdGEnLCAncHJvcGVydHknKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFsdWUgPSB0aGlzLl90ZXh0U2FuaXRpemVyKHZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRlYnVnTG9nRXZlbnQgJiZcbiAgICAgICAgICAgICAgICBkZWJ1Z0xvZ0V2ZW50KHtcbiAgICAgICAgICAgICAgICAgICAga2luZDogJ2NvbW1pdCB0ZXh0JyxcbiAgICAgICAgICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUsXG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnM6IHRoaXMub3B0aW9ucyxcbiAgICAgICAgICAgIC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mVudCh7XG4gICAgICAgICAgICAgICAgICAgICAgICBraW5kOiAnY29tbWl0IHRleHQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZTogdGV4dE5vZGUsXG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnM6IHRoaXMub3B0aW9ucyxcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgdGV4dE5vZGUuZGF0YSA9IHZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fY29tbWl0Tm9kZShkLmNyZWF0ZVRleHROb2RlKHZhbHVlKSk7XG4gICAgICAgICAgICAgICAgZGVidWdMb2dFdmVudCAmJlxuICAgICAgICAgICAgICAgICAgICBkZWJ1Z0xvZ0V2ZW50KHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGtpbmQ6ICdjb21taXQgdGV4dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlOiB3cmFwKHRoaXMuXyRzdGFydE5vZGUpLm5leHRTaWJsaW5nLFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zOiB0aGlzLm9wdGlvbnMsXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHRoaXMuXyRjb21taXR0ZWRWYWx1ZSA9IHZhbHVlO1xuICAgIH1cbiAgICBfY29tbWl0VGVtcGxhdGVSZXN1bHQocmVzdWx0KSB7XG4gICAgICAgIC8vIFRoaXMgcHJvcGVydHkgbmVlZHMgdG8gcmVtYWluIHVubWluaWZpZWQuXG4gICAgICAgIGNvbnN0IHsgdmFsdWVzLCBbJ18kbGl0VHlwZSQnXTogdHlwZSB9ID0gcmVzdWx0O1xuICAgICAgICAvLyBJZiAkbGl0VHlwZSQgaXMgY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HRoaXMuXyRjb21taXR0ZWRWYWx1ZS5fJHBhcnRzLFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zOiB0aGlzLm9wdGlvbnMsXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlcyxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHRoaXMuXyRjb21taXR0ZWRWYWx1ZS5fdXBkYXRlKHZhbHVlcyk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBjb25zdCBpbnN0YW5jZSA9IG5ldyBUZW1wbGF0ZUluc3RhbmNlKHRlbXBsYXRlLCB0aGlzKTtcbiAgICAgICAgICAgIGNvbnN0IGZyYWdtZW50ID0gaW5zdGFuY2UuX2Nsb25lKHRoaXMub3B0aW9ucyk7XG4gICAgICAgICAgICBkZWJ1Z0xvZ0V2ZW50ICYmXG4gICAgICAgICAgICAgICAgZGVidWdMb2dFdmVudCh7XG4gICAgICAgICAgICAgICAgICAgIGtpbmQ6ICd0ZW1wbGF0ZSBpbnN0YW50aWF0ZWQnLFxuICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZSxcbiAgICAgICAgICAgICAgICAgICAgaW5zdGFuY2UsXG4gICAgICAgICAgICAgICAgICAgIHBhcnRzOiBpbnN0YW5jZS5fJHBhcnRzLFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zOiB0aGlzLm9wdGlvbnMsXG4gICAgICAgICAgICAgICAgICAgIGZyYWdtZW50LFxuICAgICAgICAgICAgICAgICAgICB2YWx1ZXMsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBpbnN0YW5jZS5fdXBkYXRlKHZhbHVlcyk7XG4gICAgICAgICAgICBkZWJ1Z0xvZ0V2ZW50ICYmXG4gICAgICAgICAgICAgICAgZGVidWdMb2dFdmVudCh7XG4gICAgICAgICAgICAgICAgICAgIGtpbmQ6ICd0ZW1wbGF0ZSBpbnN0YW50aWF0ZWQgYW5kIHVwZGF0ZWQnL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ZpZGVkIHZhbHVlIGlzIGBub0NoYW5nZWAsIHVzZSB0aGUgcHJldmlvdXMgdmFsdWVcbiAgICAgICAgICAgICAgICAgICAgdiA9IHRoaXMuXyRjb21taXR0ZWRWYWx1ZVtpXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY2hhbmdlIHx8PVxuICAgICAgICAgICAgICAgICAgICAhaXNQcmltaXRpdmUodikgfHwgdiAhPT0gdGhpcy5fJGNvbW1pdHRlZFZhbHVlW2ldO1xuICAgICAgICAgICAgICAgIGlmICh2ID09PSBub3RoaW5nKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gbm90aGluZztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAodmFsdWUgIT09IG5vdGhpbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUgKz0gKHYgPz8gJycpICsgc3RyaW5nc1tpICsgMV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIFdlIGFsd2F5cyByZWNvcmQgZWFjaCB2YWx1ZSwgZXZlbiBpZiBvbmUgaXMgYG5vdGhpbmdgLCBmb3IgZnV0dXJlXG4gICAgICAgICAgICAgICAgLy8gY2hhbmdlIGRldGVjdGlvbi5cbiAgICAgICAgICAgICAgICB0aGlzLl8kY29tbWl0dGVkVmFsdWVbaV0gPSB2O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChjaGFuZ2UgJiYgIW5vQ29tbWl0KSB7XG4gICAgICAgICAgICB0aGlzLl9jb21taXRWYWx1ZSh2YWx1ZSk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgLyoqIEBpbnRlcm5hbCAqL1xuICAgIF9jb21taXRWYWx1ZSh2YWx1ZSkge1xuICAgICAgICBpZiAodmFsdWUgPT09IG5vdGhpbmcpIHtcbiAgICAgICAgICAgIHdyYXAodGhpcy5lbGVtZW50KS5yZW1vdmVBdHRyaWJ1dGUodGhpcy5uYW1lKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGlmIChFTkFCTEVfRVhUUkFfU0VDVVJJVFlfSE9PS1MpIHtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5fc2FuaXRpemVyID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fc2FuaXRpemVyID0gc2FuaXRpemVyRmFjdG9yeUludGVybmFsKHRoaXMuZWxlbWVudCwgdGhpcy5uYW1lLCAnYXR0cmlidXRlJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhbHVlID0gdGhpcy5fc2FuaXRpemVyKHZhbHVlID8/ICcnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRlYnVnTG9nRXZlbnQgJiZcbiAgICAgICAgICAgICAgICBkZWJ1Z0xvZ0V2ZW50KHtcbiAgICAgICAgICAgICAgICAgICAga2luZDogJ2NvbW1pdCBhdHRyaWJ1dGUnLFxuICAgICAgICAgICAgICAgICAgICBlbGVtZW50OiB0aGlzLmVsZW1lbnQsXG4gICAgICAgICAgICAgICAgICAgIG5hbWU6IHRoaXMubmFtZSxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUsXG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnM6IHRoaXMub3B0aW9ucyxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHdyYXAodGhpcy5lbGVtZW50KS5zZXRBdHRyaWJ1dGUodGhpcy5uYW1lLCAodmFsdWUgPz8gJycpKTtcbiAgICAgICAgfVxuICAgIH1cbn1cbmNsYXNzIFByb3BlcnR5UGFydCBleHRlbmRzIEF0dHJpYnV0ZVBhcnQge1xuICAgIGNvbnN0cnVjdG9yKCkge1xuICAgICAgICBzdXBlciguLi5hcmd1bWVudHMpO1xuICAgICAgICB0aGlzLnR5cGUgPSBQUk9QRVJUWV9QQVJUO1xuICAgIH1cbiAgICAv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xuICAgICAgICAgICAgICAgIG9sZExpc3RlbmVyLmNhcHR1cmUgfHxcbiAgICAgICAgICAgIG5ld0xpc3RlbmVyLm9uY2UgIT09XG4gICAgICAgICAgICAgICAgb2xkTGlzdGVuZXIub25jZSB8fFxuICAgICAgICAgICAgbmV3TGlzdGVuZXIucGFzc2l2ZSAhPT1cbiAgICAgICAgICAgICAgICBvbGRMaXN0ZW5lci5wYXNzaXZlO1xuICAgICAgICAvLyBJZiB0aGUgbmV3IHZhbHVlIGlzIG5vdCBub3RoaW5nIGFuZCB3ZSByZW1vdmVkIHRoZSBsaXN0ZW5lciwgd2UgaGF2ZVxuICAgICAgICAvLyB0byBhZGQgdGhlIHBhcnQgYXMgYSBsaXN0ZW5lci5cbiAgICAgICAgY29uc3Qgc2hvdWxkQWRkTGlzdGVuZXIgPSBuZXdMaXN0ZW5lciAhPT0gbm90aGluZyAmJlxuICAgICAgICAgICAgKG9sZExpc3RlbmVyID09PSBub3RoaW5nIHx8IHNob3VsZFJlbW92ZUxpc3RlbmVyKTtcbiAgICAgICAgZGVidWdMb2dFdmVudCAmJlxuICAgICAgICAgICAgZGVidWdMb2dFdmVudCh7XG4gICAgICAgICAgICAgICAga2luZDogJ2NvbW1pdCBldmVudCBsaXN0ZW5lcicsXG4gICAgICAgICAgICAgICAgZWxlbWVudDogdGhpcy5lbGVtZW50LFxuICAgICAgICAgICAgICAgIG5hbWU6IHRoaXMubmFtZSxcbiAgICAgICAgICAgICAgICB2YWx1ZTogbmV3TGlzdGVuZXIsXG4gICAgICAgICAgICAgICAgb3B0aW9uczogdGhpcy5vcHRpb25zLFxuICAgICAgICAgICAgICAgIHJlbW92ZUxpc3RlbmVyOiBzaG91bGRSZW1vdmVMaXN0ZW5lcixcbiAgICAgICAgICAgICAgICBhZGRMaXN0ZW5lcjogc2hvdWxkQWRkTGlzdGVuZXIsXG4gICAgICAgICAgICAgICAgb2xkTGlzdGVuZXIsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgaWYg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3aWxsIGJlIGNob3NlbiBmcm9tIHdoZW4gbG9hZGluZyB2aWEgdGhlIHNwZWNpZmllZCBrZXlcbiAgICovXG4gIGFkZEJ1bmRsZShidW5kbGVJZCwgYXNzZXRzKSB7XG4gICAgdGhpcy5yZXNvbHZlci5hZGRCdW5kbGUoYnVuZGxlSWQsIGFzc2V0cyk7XG4gIH1cbiAgLyoqXG4gICAqIEJ1bmRsZXMgYXJlIGEgd2F5IHRvIGxvYWQgbXVsdGlwbGUgYXNzZXRzIGF0IG9uY2UuXG4gICAqIElmIGEgbWFuaWZlc3QgaGFzIGJlZW4gcHJvdmlkZWQgdG8gdGhlIGluaXQgZnVuY3Rpb24gdGhlbiB5b3UgY2FuIGxvYWQgYSBidW5kbGUsIG9yIGJ1bmRsZXMuXG4gICAqIHlvdSBjYW4gYWxzbyBhZGQgYnVuZGxlcyB2aWEgYGFkZEJ1bmRsZWBcbiAgICogQGV4YW1wbGVcbiAgICogaW1wb3J0IHsgQXNzZXRzIH0gZnJvbSAncGl4aS5qcyc7XG4gICAqXG4gICAqIC8vIE1hbmlmZXN0IEV4YW1wbGVcbiAgICogY29uc3QgbWFuaWZlc3QgPSB7XG4gICAqICAgICBidW5kbGVzOiBbXG4gICAqICAgICAgICAge1xuICAgKiAgICAgICAgICAgICBuYW1lOiAnbG9hZC1zY3JlZW4nLFxuICAgKiAgICAgICAgICAgICBhc3NldHM6IFtcbiAgICogICAgICAgICAgICAgICAgIHtcbiAgICogICAgICAgICAgICAgICAgICAgICBhbGlhczogJ2JhY2tncm91bmQnLFxuICAgKiAgICAgICAgICAgICAgICAgICAgIHNyYzogJ3N1bnNldC5wbmcnLFxuICAgKiAgICAgICAgICAgICAgICAgfSxcbiAgICogICAgICAgICAgICAgICAgIHtcbiAgICogICAgICAgICAgICAgICAgICAgICBhbGlhczogJ2JhcicsXG4gICAqICAgICAgICAgICAgICAgICAgICAgc3JjOiAnbG9hZC1iYXIue3BuZyx3ZWJwfScsXG4gICAqICAgICAgICAgICAgICAgICB9LFxuICAgKiAgICAgICAgICAgICBdLFxuICAgKiAgICAgICAgIH0sXG4gICAqICAgICAgICAge1xuICAgKiAgICAgICAgICAgICBuYW1lOiAnZ2FtZS1zY3JlZW4nLFxuICAgKiAgICAgICAgICAgICBhc3NldHM6IFtcbiAgICogICAgICAgICAgICAgICAgIHtcbiAgICogICAgICAgICAgICAgICAgICAgICBhbGlhczogJ2NoYXJhY3RlcicsXG4gICAqICAgICAgICAgICAgICAgICAgICAgc3JjOiAncm9ib3QucG5nJyxcbiAgICogICAgICAgICAgICAgICAgIH0sXG4gICAqICAgICAgICAgICAgICAgICB7XG4gICAqICAgICAgICAgICAgICAgICAgICAgYWxpYXM6ICdlbmVteScsXG4gICAqICAgICAgICAgICAgICAgICAgICAgc3JjOiAnYmFkLWd1eS5wbmcnLFxuICAgKiAgICAgICAgICAgICAgICAgfSxcbiAgICogICAgICAgICAgICAgXSxcbiAgICogICAgICAgICB9LFxuICAgKiAgICAgXVxuICAgKiB9O1xuICAgKlxuICAgKiBhd2FpdCBBc3NldHMuaW5pdCh7IG1hbmlmZXN0IH0pO1xuICAgKlxuICAgKiAvLyBMb2FkIGEgYnVuZGxlLi4uXG4gICAqIGxvYWRTY3JlZW5Bc3NldHMgPSBhd2FpdCBBc3NldHMubG9hZEJ1bmRsZSgnbG9hZC1zY3JlZW4nKTtcbiAgICogLy8gTG9hZCBhbm90aGVyIGJ1bmRsZS4uLlxuICAgKiBnYW1lU2NyZWVuQXNzZXRzID0gYXdhaXQgQXNzZXRzLmxvYWRCdW5kbGUoJ2dhbWUtc2NyZWVuJyk7XG4gICAqIEBwYXJhbSBidW5kbGVJZHMgLSB0aGUgYnVuZGxlIGlkIG9yIGlkcyB0byBsb2FkXG4gICAqIEBwYXJhbSBvblByb2dyZXNzIC0gT3B0aW9uYWwgZnVuY3Rpb24gdGhhdCBpcyBjYWxsZWQgd2hlbiBwcm9ncmVzcyBvbiBhc3NldCBsb2FkaW5nIGlzIG1hZGUuXG4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NYW5pZmVzdCwgdGhpcyB3aWxsIHJldHVybiB0aGUgYXNzZXRzIHVybHMgZm9yXG4gICAqIGEgZ2l2ZW4gYnVuZGxlSWQgb3IgYnVuZGxlSWRzLlxuICAgKiBAZXhhbXBsZVxuICAgKiAvLyBNYW5pZmVzdCBFeGFtcGxlXG4gICAqIGNvbnN0IG1hbmlmZXN0ID0ge1xuICAgKiAgICAgYnVuZGxlczogW1xuICAgKiAgICAgICAgIHtcbiAgICogICAgICAgICAgICAgbmFtZTogJ2xvYWQtc2NyZWVuJyxcbiAgICogICAgICAgICAgICAgYXNzZXRzOiBbXG4gICAqICAgICAgICAgICAgICAgICB7XG4gICAqICAgICAgICAgICAgICAgICAgICAgYWxpYXM6ICdiYWNrZ3JvdW5kJyxcbiAgICogICAgICAgICAgICAgICAgICAgICBzcmM6ICdzdW5zZXQucG5nJyxcbiAgICogICAgICAgICAgICAgICAgIH0sXG4gICAqICAgICAgICAgICAgICAgICB7XG4gICAqICAgICAgICAgICAgICAgICAgICAgYWxpYXM6ICdiYXInLFxuICAgKiAgICAgICAgICAgICAgICAgICAgIHNyYzogJ2xvYWQtYmFyLntwbmcsd2VicH0nLFxuICAgKiAgICAgICAgICAgICAgICAgfSxcbiAgICogICAgICAgICAgICAgXSxcbiAgICogICAgICAgICB9LFxuICAgKiAgICAgICAgIHtcbiAgICogICAgICAgICAgICAgbmFtZTogJ2dhbWUtc2NyZWVuJyxcbiAgICogICAgICAgICAgICAgYXNzZXRzOiBbXG4gICAqICAgICAgICAgICAgICAgICB7XG4gICAqICAgICAgICAgICAgICAgICAgICAgYWxpYXM6ICdjaGFyYWN0ZXInLFxuICAgKiAgICAgICAgICAgICAgICAgICAgIHNyYzogJ3JvYm90LnBuZycsXG4gICAqICAgICAgICAgICAgICAgICB9LFxuICAgKiAgICAgICAgICAgICAgICAge1xuICAgKiAgICAgICAgICAgICAgICAgICAgIGFsaWFzOiAnZW5lbXknLFxuICAgKiAgICAgICAgICAgICAgICAgICAgIHNy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pdFwiLFxuICAgICAgICBcImRlc3Ryb3lcIixcbiAgICAgICAgXCJjb250ZXh0Q2hhbmdlXCIsXG4gICAgICAgIFwicmVzb2x1dGlvbkNoYW5nZVwiLFxuICAgICAgICBcInJlc2V0XCIsXG4gICAgICAgIFwidXBkYXRlXCIsXG4gICAgICAgIFwicG9zdHJlbmRlclwiLFxuICAgICAgICBcInByZXJlbmRlclwiLFxuICAgICAgICBcInJlc2l6ZVwiXG4gICAgICBdLFxuICAgICAgc3lzdGVtczogX1JlbmRlcmVyMi5fX3N5c3RlbXMsXG4gICAgICBwcmlvcml0eTogW1xuICAgICAgICBcIl92aWV3XCIsXG4gICAgICAgIFwidGV4dHVyZUdlbmVyYXRvclwiLFxuICAgICAgICBcImJhY2tncm91bmRcIixcbiAgICAgICAgXCJfcGx1Z2luXCIsXG4gICAgICAgIFwic3RhcnR1cFwiLFxuICAgICAgICAvLyBsb3cgbGV2ZWwgV2ViR0wgc3lzdGVtc1xuICAgICAgICBcImNvbnRleHRcIixcbiAgICAgICAgXCJzdGF0ZVwiLFxuICAgICAgICBcInRleHR1cmVcIixcbiAgICAgICAgXCJidWZmZXJcIixcbiAgICAgICAgXCJnZW9tZXRyeVwiLFxuICAgICAgICBcImZyYW1lYnVmZmVyXCIsXG4gICAgICAgIFwidHJhbnNmb3JtRmVlZGJhY2tcIixcbiAgICAgICAgLy8gaGlnaCBsZXZlbCBwaXhpIHNwZWNpZmljIHJlbmRlcmluZ1xuICAgICAgICBcIm1hc2tcIixcbiAgICAgICAgXCJzY2lzc29yXCIsXG4gICAgICAgIFwic3RlbmNpbFwiLFxuICAgICAgICBcInByb2plY3Rpb25cIixcbiAgICAgICAgXCJ0ZXh0dXJlR0NcIixcbiAgICAgICAgXCJmaWx0ZXJcIixcbiAgICAgICAgXCJyZW5kZXJUZXh0dXJlXCIsXG4gICAgICAgIFwiYmF0Y2hcIixcbiAgICAgICAgXCJvYmplY3RSZW5kZXJlclwiLFxuICAgICAgICBcIl9tdWx0a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laRVt1Ym9FbGVtZW50LmRhdGEudHlwZV0gLyAxNiwgMSksIGVsZW1lbnRTaXplID0gc2l6ZTIgLyByb3dTaXplLCByZW1haW5kZXIgPSAoNCAtIGVsZW1lbnRTaXplICUgNCkgJSA0O1xuICAgICAgICBmdW5jRnJhZ21lbnRzLnB1c2goYFxuICAgICAgICAgICAgICAgIGN2ID0gdWQuJHtuYW1lfS52YWx1ZTtcbiAgICAgICAgICAgICAgICB2ID0gdXYuJHtuYW1lfTtcbiAgICAgICAgICAgICAgICBvZmZzZXQgPSAke3Vib0VsZW1lbnQub2Zmc2V0IC8gNH07XG5cbiAgICAgICAgICAgICAgICB0ID0gMDtcblxuICAgICAgICAgICAgICAgIGZvcih2YXIgaT0wOyBpIDwgJHt1Ym9FbGVtZW50LmRhdGEuc2l6ZSAqIHJvd1NpemV9OyBpKyspXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBmb3IodmFyIGogPSAwOyBqIDwgJHtlbGVtZW50U2l6ZX07IGorKylcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQrK10gPSB2W3QrK107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ICs9ICR7cmVtYWluZGVyfTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBgKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGNvbnN0IHRlbXBsYXRlID0gVUJPX1RPX1NJTkdMRV9TRVRURVJTW3Vib0VsZW1lbnQuZGF0YS50eXBlXTtcbiAgICAgICAgZnVuY0ZyYWdtZW50cy5wdXNoKGBcbiAgICAgICAgICAgICAgICBjdiA9IHVkLiR7bmFtZX0udmFsdWU7XG4gICAgICAgICAgICAgICAgdiA9IHV2LiR7bmFtZX07XG4gICAgICAgICAgICAgICAgb2Zmc2V0ID0gJHt1Ym9FbGVtZW50Lm9mZnNldCAv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jYWNoaW5nIGRpcnR5IGlkcyBoZXJlIVxuICAgICAgYFxuICAgICAgICAgICAgZ2wudW5pZm9ybU1hdHJpeDNmdih1ZFtcIiR7bmFtZX1cIl0ubG9jYXRpb24sIGZhbHNlLCB1dltcIiR7bmFtZX1cIl0udG9BcnJheSh0cnVlKSk7XG4gICAgICAgICAgICBgXG4gICAgKSxcbiAgICBjb2RlVWJvOiAobmFtZSkgPT4gYFxuICAgICAgICAgICAgICAgIHZhciAke25hbWV9X21hdHJpeCA9IHV2LiR7bmFtZX0udG9BcnJheSh0cnVlKTtcblxuICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0XSA9ICR7bmFtZX1fbWF0cml4WzBdO1xuICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KzFdID0gJHtuYW1lfV9tYXRyaXhbMV07XG4gICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQrMl0gPSAke25hbWV9X21hdHJpeFsyXTtcbiAgICAgICAgXG4gICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQgKyA0XSA9ICR7bmFtZX1fbWF0cml4WzNdO1xuICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0ICsgNV0gPSAke25hbWV9X21hdHJpeFs0XTtcbiAgICAgICAgICAgICAgICBkYXRhW29mZnNldCArIDZdID0gJHtuYW1lfV9tYXRyaXhbNV07XG4gICAgICAgIFxuICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0ICsgOF0gPSAke25hbWV9X21hdHJpeFs2XTtcbiAgICAgICAgICAgICAgICBkYXRhW29mZnNldCArIDldID0gJHtuYW1lfV9tYXRyaXhbN107XG4gICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQgKyAxMF0gPSAke25hbWV9X21hdHJpeFs4XTtcbiAgICAgICAgICAgIGBcbiAgfSxcbiAgLy8gdXBsb2FkaW5nIGEgcGl4aSBwb2ludCBhcyBhIHZlYzIgd2l0aCBjYWNoaW5nIGxheWVyXG4gIHtcbiAgICB0ZXN0OiAoZGF0YSwgdW5pZm9ybSkgPT4gZGF0YS50eXBlID09PSBcInZlYzJcIiAmJiBkYXRhLnNpemUgPT09IDEgJiYgIWRhdGEuaXNBcnJheSAmJiB1bmlmb3JtLnggIT09IHZvaWQgMCxcbiAgICBjb2RlOiAobmFtZSkgPT4gYFxuICAgICAgICAgICAgICAgIGN2ID0gdWRbXCIke25hbWV9XCJdLnZhbHVlO1xuICAgICAgICAgICAgICAgIHYgPSB1dltcIiR7bmFtZX1cIl07XG5cbiAgICAgICAgICAgICAgICBpZihjdlswXSAhPT0gdi54IHx8IGN2WzFdICE9PSB2LnkpXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBjdlswXSA9IHYueDtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMV0gPSB2Lnk7XG4gICAgICAgICAgICAgICAgICAgIGdsLnVuaWZvcm0yZih1ZFtcIiR7bmFtZX1cIl0ubG9jYXRpb24sIHYueCwgdi55KTtcbiAgICAgICAgICAgICAgICB9YCxcbiAgICBjb2RlVWJvOiAobmFtZSkgPT4gYFxuICAgICAgICAgICAgICAgIHYgPSB1di4ke25hbWV9O1xuXG4gICAgICAgICAgICAgICAgZGF0YVtvZmZzZXRdID0gdi54O1xuICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KzFdID0gdi55O1xuICAgICAgICAgICAgYFxuICB9LFxuICAvLyBjYWNoaW5nIGxheWVyIGZvciBhIHZlYzJcbiAge1xuICAgIHRlc3Q6IChkYXRhKSA9PiBkYXRhLnR5cGUgPT09IFwidmVjMlwiICYmIGRhdGEuc2l6ZSA9PT0gMSAmJiAhZGF0YS5pc0FycmF5LFxuICAgIGNvZGU6IChuYW1lKSA9PiBgXG4gICAgICAgICAgICAgICAgY3YgPSB1ZFtcIiR7bmFtZX1cIl0udmFsdWU7XG4gICAgICAgICAgICAgICAgdiA9IHV2W1wiJHtuYW1lfVwiXTtcblxuICAgICAgICAgICAgICAgIGlmKGN2WzBdICE9PSB2WzBdIHx8IGN2WzFdICE9PSB2WzFdKVxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMF0gPSB2WzBdO1xuICAgICAgICAgICAgICAgICAgICBjdlsxXSA9IHZbMV07XG4gICAgICAgICAgICAgICAgICAgIGdsLnVuaWZvcm0yZih1ZFtcIiR7bmFtZX1cIl0ubG9jYXRpb24sIHZbMF0sIHZbMV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGBcbiAgfSxcbiAgLy8gdXBsb2FkIGEgcGl4aSByZWN0YW5nbGUgYXMgYSB2ZWM0IHdpdGggY2FjaGluZyBsYXllclxuICB7XG4gICAgdGVzdDogKGRhdGEsIHVuaWZvcm0pID0+IGRhdGEudHlwZSA9PT0gXCJ2ZWM0XCIgJiYgZGF0YS5zaXplID09PSAxICYmICFkYXRhLmlzQXJyYXkgJiYgdW5pZm9ybS53aWR0aCAhPT0gdm9pZCAwLFxuICAgIGNvZGU6IChuYW1lKSA9PiBgXG4gICAgICAgICAgICAgICAgY3YgPSB1ZFtcIiR7bmFtZX1cIl0udmFsdWU7XG4gICAgICAgICAgICAgICAgdiA9IHV2W1wiJHtuYW1lfVwiXTtcblxuICAgICAgICAgICAgICAgIGlmKGN2WzBdICE9PSB2LnggfHwgY3ZbMV0gIT09IHYueSB8fCBjdlsyXSAhPT0gdi53aWR0aCB8fCBjdlszXSAhPT0gdi5oZWlnaHQpXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBjdlswXSA9IHYueDtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMV0gPSB2Lnk7XG4gICAgICAgICAgICAgICAgICAgIGN2WzJdID0gdi53aWR0aDtcbiAgICAgICAgICAgICAgICAgICAgY3ZbM10gPSB2LmhlaWdodDtcbiAgICAgICAgICAgICAgICAgICAgZ2wudW5pZm9ybTRmKHVkW1wiJHtuYW1lfVwiXS5sb2NhdGlvbiwgdi54LCB2LnksIHYud2lkdGgsIHYuaGVpZ2h0KVxuICAgICAgICAgICAgICAgIH1gLFxuICAgIGNvZGVVYm86IChuYW1lKSA9PiBgXG4gICAgICAgICAgICAgICAgICAgIHYgPSB1di4ke25hbWV9O1xuXG4gICAgICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0XSA9IHYueDtcbiAgICAgICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQrMV0gPSB2Lnk7XG4gICAgICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KzJdID0gdi53aWR0aDtcbiAgICAgICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQrM10gPSB2LmhlaWdodDtcbiAgICAgICAgICAgICAgICBgXG4gIH0sXG4gIC8vIHVwbG9hZCBhIHBpeGkgY29sb3IgYXMgdmVjNCB3aXRoIGNhY2hpbmcgbGF5ZXJcbiAge1xuICAgIHRlc3Q6IChkYXRhLCB1bmlmb3JtKSA9PiBkYXRhLnR5cGUgPT09IFwidmVjNFwiICYmIGRhdGEuc2l6ZSA9PT0gMSAmJiAhZGF0YS5pc0FycmF5ICYmIHVuaWZvcm0ucmVkICE9PSB2b2lkIDAsXG4gICAgY29kZTogKG5hbWUpID0+IGBcbiAgICAgICAgICAgICAgICBjdiA9IHVkW1wiJHtuYW1lfVwiXS52YWx1ZTtcbiAgICAgICAgICAgICAgICB2ID0gdXZbXCIke25hbWV9XCJdO1xuXG4gICAgICAgICAgICAgICAgaWYoY3ZbMF0gIT09IHYucmVkIHx8IGN2WzFdICE9PSB2LmdyZWVuIHx8IGN2WzJdICE9PSB2LmJsdWUgfHwgY3ZbM10gIT09IHYuYWxwaGEpXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBjdlswXSA9IHYucmVkO1xuICAgICAgICAgICAgICAgICAgICBjdlsxXSA9IHYuZ3JlZW47XG4gICAgICAgICAgICAgICAgICAgIGN2WzJdID0gdi5ibHVlO1xuICAgICAgICAgICAgICAgICAgICBjdlszXSA9IHYuYWxwaGE7XG4gICAgICAg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dyZWVuO1xuICAgICAgICAgICAgICAgICAgICBjdlsyXSA9IHYuYmx1ZTtcbiAgICBcbiAgICAgICAgICAgICAgICAgICAgZ2wudW5pZm9ybTNmKHVkW1wiJHtuYW1lfVwiXS5sb2NhdGlvbiwgdi5yZWQsIHYuZ3JlZW4sIHYuYmx1ZSlcbiAgICAgICAgICAgICAgICB9YCxcbiAgICBjb2RlVWJvOiAobmFtZSkgPT4gYFxuICAgICAgICAgICAgICAgICAgICB2ID0gdXYuJHtuYW1lfTtcblxuICAgICAgICAgICAgICAgICAgICBkYXRhW29mZnNldF0gPSB2LnJlZDtcbiAgICAgICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQrMV0gPSB2LmdyZWVuO1xuICAgICAgICAgICAgICAgICAgICBkYXRhW29mZnNldCsyXSA9IHYuYmx1ZTtcbiAgICAgICAgICAgICAgICBgXG4gIH0sXG4gIC8vIGEgY2FjaGluZyBsYXllciBmb3IgdmVjNCB1cGxvYWRpbmdcbiAge1xuICAgIHRlc3Q6IChkYXRhKSA9PiBkYXRhLnR5cGUgPT09IFwidmVjNFwiICYmIGRhdGEuc2l6ZSA9PT0gMSAmJiAhZGF0YS5pc0FycmF5LFxuICAgIGNvZGU6IChuYW1lKSA9PiBgXG4gICAgICAgICAgICAgICAgY3YgPSB1ZFtcIiR7bmFtZX1cIl0udmFsdWU7XG4gICAgICAgICAgICAgICAgdiA9IHV2W1wiJHtuYW1lfVwiXTtcblxuICAgICAgICAgICAgICAgIGlmKGN2WzBdICE9PSB2WzBdIHx8IGN2WzFdICE9PSB2WzFdIHx8IGN2WzJdICE9PSB2WzJdIHx8IGN2WzNdICE9PSB2WzNdKVxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMF0gPSB2WzBdO1xuICAgICAgICAgICAgICAgICAgICBjdlsxXSA9IHZbMV07XG4gICAgICAgICAgICAgICAgICAgIGN2WzJdID0gdlsyXTtcbiAgICAgICAgICAgICAgICAgICAgY3Zb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taW5ZIDogbWluWSwgdGhpcy5tYXhYID0gYm91bmRzLm1heFggPiBtYXhYID8gYm91bmRzLm1heFggOiBtYXhYLCB0aGlzLm1heFkgPSBib3VuZHMubWF4WSA+IG1heFkgPyBib3VuZHMubWF4WSA6IG1heFk7XG4gIH1cbiAgLyoqXG4gICAqIEFkZHMgb3RoZXIgQm91bmRzLCBtYXNrZWQgd2l0aCBCb3VuZHMuXG4gICAqIEBwYXJhbSBib3VuZHMgLSBUaGUgQm91bmRzIHRvIGJlIGFkZGVkLlxuICAgKiBAcGFyYW0gbWFzayAtIFRPRE9cbiAgICovXG4gIGFkZEJvdW5kc01hc2soYm91bmRzLCBtYXNrKSB7XG4gICAgY29uc3QgX21pblggPSBib3VuZHMubWluWCA+IG1hc2subWluWCA/IGJvdW5kcy5taW5YIDogbWFzay5taW5YLCBfbWluWSA9IGJvdW5kcy5taW5ZID4gbWFzay5taW5ZID8gYm91bmRzLm1pblkgOiBtYXNrLm1pblksIF9tYXhYID0gYm91bmRzLm1heFggPCBtYXNrLm1heFggPyBib3VuZHMubWF4WCA6IG1hc2subWF4WCwgX21heFkgPSBib3VuZHMubWF4WSA8IG1hc2subWF4WSA/IGJvdW5kcy5tYXhZIDogbWFzay5tYXhZO1xuICAgIGlmIChfbWluWCA8PSBfbWF4WCAmJiBfbWluWSA8PSBfbWF4WSkge1xuICAgICAgY29uc3QgbWluWCA9IHRoaXMubWluWCwgbWluWSA9IHRoaXMubWluWSwgbWF4WCA9IHRoaXMubWF4WCwgbWF4WSA9IHRoaXMubWF4WTtcbiAgICAgIHRoaXMubWluWCA9IF9taW5YIDwgbWluWCA/IF9taW5YIDogbWluWCwgdGhpcy5taW5ZID0gX21pblkgPCBtaW5ZID8gX21pblkgOiBtaW5ZLCB0aGlzLm1heFggPSBfbWF4WCA+IG1heFggPyBfbWF4WCA6IG1heFgsIHRoaXMubWF4WSA9IF9tYXhZID4gbWF4WSA/IF9tYXhZIDogbWF4WTtcbiAgICB9XG4gIH1cbi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1bWFOVyArIGx1bWFTVykgLSAobHVtYU5FICsgbHVtYVNFKSk7XG5cbiAgICBmbG9hdCBkaXJSZWR1Y2UgPSBtYXgoKGx1bWFOVyArIGx1bWFORSArIGx1bWFTVyArIGx1bWFTRSkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAoMC4yNSAqIEZYQUFfUkVEVUNFX01VTCksIEZYQUFfUkVEVUNFX01JTik7XG5cbiAgICBmbG9hdCByY3BEaXJNaW4gPSAxLjAgLyAobWluKGFicyhkaXIueCksIGFicyhkaXIueSkpICsgZGlyUmVkdWNlKTtcbiAgICBkaXIgPSBtaW4odmVjMihGWEFBX1NQQU5fTUFYLCBGWEFBX1NQQU5fTUFYKSxcbiAgICAgICAgICAgICAgbWF4KHZlYzIoLUZYQUFfU1BBTl9NQVgsIC1GWEFBX1NQQU5fTUFYKSxcbiAgICAgICAgICAgICAgICAgIGRpciAqIHJjcERpck1pbikpICogaW52ZXJzZVZQO1xuXG4gICAgdmVjMyByZ2JBID0gMC41ICogKFxuICAgICAgICAgICAgICAgICAgICAgICB0ZXh0dXJlMkQodGV4LCBmcmFnQ29vcmQgKiBpbnZlcnNlVlAgKyBkaXIgKiAoMS4wIC8gMy4wIC0gMC41KSkueHl6ICtcbiAgICAgICAgICAgICAgICAgICAgICAgdGV4dHVyZTJEKHRleCwgZnJhZ0Nvb3JkICogaW52ZXJzZVZQICsgZGlyICogKDIuMCAvIDMuMCAtIDAuNSkpLnh5eik7XG4gICAgdmVjMyByZ2JCID0gcmdiQSAqIDAuNSArIDAuMjUgKiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dHVyZTJEKHRleCwgZnJhZ0Nvb3JkICogaW52ZXJzZVZQICsgZGlyICogLTAuNSkueHl6ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0dXJlMkQodGV4LCBmcmFnQ29vcmQgKiBpbnZlcnNlVlAgKyBkaXIgKiAwLjUpLnh5eik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pIDogdG1wUG9pbnQuY29weUZyb20ocG9pbnQpLCBkYXRhLnNoYXBlLmNvbnRhaW5zKHRtcFBvaW50LngsIHRtcFBvaW50LnkpKSkge1xuICAgICAgICBsZXQgaGl0SG9sZSA9ICExO1xuICAgICAgICBpZiAoZGF0YS5ob2xlcykge1xuICAgICAgICAgIGZvciAobGV0IGkyID0gMDsgaTIgPCBkYXRhLmhvbGVzLmxlbmd0aDsgaTIrKylcbiAgICAgICAgICAgIGlmIChkYXRhLmhvbGVzW2kyXS5zaGFwZS5jb250YWlucyh0bXBQb2ludC54LCB0bXBQb2ludC55KSkge1xuICAgICAgICAgICAgICBoaXRIb2xlID0gITA7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICghaGl0SG9sZSlcbiAgICAgICAgICByZXR1cm4gITA7XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiAhMTtcbiAgfVxuICAvKipcbiAgICogR2VuZXJhdGVzIGludGVybWVkaWF0ZSBiYXRjaCBkYXRhLiBFaXRoZXIgZ2V0cyBjb252ZXJ0ZWQgdG8gZHJhd0NhbGxzXG4gICAqIG9yIHVzZWQgdG8gY29udmVydCB0byBiYXRjaCBvYmplY3RzIGRpcmVjdGx5IGJ5IHRoZSBHcmFwaGljcyBvYmplY3QuXG4gICAqL1xuICB1cGRhdGVCYXRjaGVzKCkge1xuICAgIGlmICghdGhpcy5ncmFwaGljc0RhdGEubGVuZ3RoKSB7XG4gICAgICB0aGlzLmJhdGNoYWJsZSA9ICEwO1xuICAgICAgcmV0dXJuO1xuICAgIH1cbiAgICBpZiAoIXRoaXMudmFsaWRhdGVCYXRjaGluZygpKVxuICAgICAgcmV0dXJuO1xuICAgIHRoaXMuY2FjaGVEaXJ0eSA9IHRoaXMuZGlydHk7XG4gICAgY29uc3QgdXZzID0gdGhpcy51dnMsIGdyYXBoaWNzRGF0YSA9IHRoaXMuZ3JhcGhpY3NEYXRhO1xuIC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gKiBNYXRoLnNxcnQocnggKyByeSkpLCBtID0gbiAqIDggKyAoZHggPyA0IDogMCkgKyAoZHkgPyA0IDogMCk7XG4gICAgaWYgKHBvaW50cy5sZW5ndGggPSBtLCBtID09PSAwKVxuICAgICAgcmV0dXJuO1xuICAgIGlmIChuID09PSAwKSB7XG4gICAgICBwb2ludHMubGVuZ3RoID0gOCwgcG9pbnRzWzBdID0gcG9pbnRzWzZdID0geCArIGR4LCBwb2ludHNbMV0gPSBwb2ludHNbM10gPSB5ICsgZHksIHBvaW50c1syXSA9IHBvaW50c1s0XSA9IHggLSBkeCwgcG9pbnRzWzVdID0gcG9pbnRzWzddID0geSAtIGR5O1xuICAgICAgcmV0dXJuO1xuICAgIH1cbiAgICBsZXQgajEgPSAwLCBqMiA9IG4gKiA0ICsgKGR4ID8gMiA6IDApICsgMiwgajMgPSBqMiwgajQgPSBtO1xuICAgIHtcbiAgICAgIGNvbnN0IHgwID0gZHggKyByeCwgeTAgPSBkeSwgeDEgPSB4ICsgeDAsIHgyID0geCAtIHgwLCB5MSA9IHkgKyB5MDtcbiAgICAgIGlmIChwb2ludHNbajErK10gPSB4MSwgcG9pbnRzW2oxKytdID0geTEsIHBvaW50c1stLWoyXSA9IHkxLCBwb2ludHNbLS1qMl0gPSB4MiwgZHkpIHtcbiAgICAgICAgY29uc3QgeTIgPSB5IC0geTA7XG4gICAgICAgIHBvaW50c1tqMysrXSA9IHgyLCBwb2ludHNbajMrK10gPSB5MiwgcG9pbnRzWy0tajRdID0geTIsIHBvaW50c1stLWo0XSA9IHgxO1xuICAgICAgfVxuICAgIH1cbiAgICBmb3IgKGxldCBpID0gMTsgaSA8IG47IGkrKykge1xuICAgICAgY29uc3QgYSA9IE1hdGguUEkgLyAyICogKGkgLyBuKSwgeDAgPSBkeCArIE1hdGguY29zKGEpICogcngsIHkwID0gZHkgKyBNYXRoLnNpbihhKSAqIHJ5LCB4MSA9IHggKyB4MCwgeDIgPSB4IC0geDAsIHkxID0geSArIHkwL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ydGV4XG4gICAgICAgICAgICBpbXgsXG4gICAgICAgICAgICBpbXksXG4gICAgICAgICAgICAvLyBpbm5lciBtaXRlciBwb2ludFxuICAgICAgICAgICAgeDEgKyBwZXJwMXggKiBvdXRlcldlaWdodCxcbiAgICAgICAgICAgIHkxICsgcGVycDF5ICogb3V0ZXJXZWlnaHRcbiAgICAgICAgICApIDogdmVydHMucHVzaChcbiAgICAgICAgICAgIHgxIC0gcGVycHggKiBpbm5lcldlaWdodCxcbiAgICAgICAgICAgIHkxIC0gcGVycHkgKiBpbm5lcldlaWdodCxcbiAgICAgICAgICAgIC8vIGZpcnN0IHNlZ21lbnQncyBpbm5lciB2ZXJ0ZXhcbiAgICAgICAgICAgIG9teCxcbiAgICAgICAgICAgIG9teSxcbiAgICAgICAgICAgIC8vIG91dGVyIG1pdGVyIHBvaW50XG4gICAgICAgICAgICB4MSAtIHBlcnAxeCAqIGlubmVyV2VpZ2h0LFxuICAgICAgICAgICAgeTEgLSBwZXJwMXkgKiBpbm5lcldlaWdodCxcbiAgICAgICAgICAgIC8vIHNlY29uZCBzZWdtZW50J3Mgb3V0ZXIgdmVydGV4XG4gICAgICAgICAgICBvbXgsXG4gICAgICAgICAgICBvbXlcbiAgICAgICAgICApLCBpbmRleENvdW50ICs9IDI7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgY2FzZSBMSU5FX0pPSU4uUk9VTkQ6IHtcbiAgICAgICAgICBjbG9ja3dpc2UgPyAodmVydHMucHVzaChcbiAgICAgICAgICAgIGlteCxcbiAgICAgICAgICAgIGlteSxcbiAgICAgICAgICAgIHgxICsgcGVycHggKiBvdXRlcldlaWdodCxcbiAgICAgICAgICAgIHkxICsgcGVycHkgKiBvdXRlcldlaWdodFxuICAgICAgICAgICksIGluZGV4Q291bnQgKz0gcm91bmQoXG4gICAgICAgICAgICB4MSxcbiAgICAgICAgICAgIHkxLFxuICAgICAgICAgICAgeDEgKyBwZXJweCAqIG91dGVyV2VpZ2h0LFxuICAgICAgICAgICAgeTEgKyBwZXJweSAqIG91dGVyV2VpZ2h0LFxuICAgICAgICAgICAgeDEgKyBwZXJwMXggKiBvdXRlcldlaWdodCxcbiAgICAgICAgICAgIHkxICsgcGVycDF5ICogb3V0ZXJXZWlnaHQsXG4gICAgICAgICAgICB2ZXJ0cyxcbiAgICAgICAgICAgICEwXG4gICAgICAgICAgKSArIDQsIHZlcnRzLnB1c2goXG4gICAgICAgICAgICBpbXgsXG4gICAgICAgICAgICBpbXksXG4gICAgICAgICAgICB4MSArIHBlcnAxeCAqIG91dGVyV2VpZ2h0LFxuICAgICAgICAgICAgeTEgKyBwZXJwMXkgKiBvdXRlcldlaWdodFxuICAgICAgICAgICkpIDogKHZlcnRzLnB1c2goXG4gICAgICAgICAgICB4MSAtIHBlcnB4ICogaW5uZXJXZWlnaHQsXG4gICAgICAgICAgICB5MSAtIHBlcnB5ICogaW5uZXJXZWlnaHQsXG4gICAgICAgICAgICBvbXgsXG4gICAgICAgICAgICBvbXlcbiAgICAgICAgICApLCBpbmRleENvdW50ICs9IHJvdW5kKFxuICAgICAgICAgICAgeDEsXG4gICAgICAgICAgICB5MSxcbiAgICAgICAgICAgIHgxIC0gcGVycHggKiBpbm5lcldlaWdodCxcbiAgICAgICAgICAgIHkxIC0gcGVycHkgKiBpbm5lcldlaWdodCxcbiAgICAgICAgICAgIHgxIC0gcGVycDF4ICogaW5uZXJXZWlnaHQsXG4gICAgICAgICAgICB5MSAtIHBlcnAxeSAqIGlubmVyV2VpZ2h0LFxuICAgICAgICAgICAgdmVydHMsXG4gICAgICAgICAgICAhMVxuICAgICAgICAgICkgKyA0LCB2ZXJ0cy5wdXNoKFxuICAgICAgICAgICAgeDEgLSBwZXJwMXggKiBpbm5lcldlaWdodCxcbiAgICAgICAgICAgIHkxIC0gcGVycDF5ICogaW5uZXJXZWlnaHQsXG4gICAgICAgICAgICBvbXgsXG4gICAgICAgICAgICBvbXlcbiAgICAgICAgICApKTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgfVxuICAgIGVsc2Uge1xuICAgICAgc3dpdGNoICh2ZXJ0cy5wdXNoKFxuICAgICAgICB4MSAtIHBlcnB4ICogaW5uZXJXZWlnaHQsXG4gICAgICAgIHkxIC0gcGVycHkgKiBpbm5lcldlaWdodCxcbiAgICAgICAgLy8gZmlyc3Qgc2VnbWVudCdzIGlubmVyIHZlcnRleFxuICAgICAgICB4MSArIHBlcnB4ICogb3V0ZXJXZWlnaHQsXG4gICAgICAgIHkxICsgcGVycHkgKiBvdXRlcldlaWdodFxuICAgICAgKSwgam9pbikge1xuICAgICAgICBjYXNlIExJTkVfSk9JTi5NSVRFUjoge1xuICAgICAgICAgIGNsb2Nrd2lzZSA/IHZlcnRzLnB1c2goXG4gICAgICAgICAgICBvbXgsXG4gICAgICAgICAgICBvbXksXG4gICAgICAgICAgICAvLyBpbm5lciBtaXRlciBwb2ludFxuICAgICAgICAgICAgb214LFxuICAgICAgICAgICAgb215XG4gICAgICAgICAgKSA6IHZlcnRzLnB1c2goXG4gICAgICAgICAgICBpbXgsXG4gICAgICAgICAgICBpbXksXG4gICAgICAgICAgICAvLyBvdXRlciBtaXRlciBwb2ludFxuICAgICAgICAgICAgaW14LFxuICAgICAgICAgICAgaW15XG4gICAgICAgICAgKSwgaW5kZXhDb3VudCArPSAyO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIGNhc2UgTElORV9KT0lOLlJPVU5EOiB7XG4gICAgICAgICAgY2xvY2t3aXNlID8gaW5kZXhDb3VudCArPSByb3VuZChcbiAgICAgICAgICAgIHgxLFxuICAgICAgICAgICAgeTEsXG4gICAgICAgICAgICB4MSArIHBlcnB4ICogb3V0ZXJXZWlnaHQsXG4gICAgICAgICAgICB5MSArIHBlcnB5ICogb3V0ZXJXZWlnaHQsXG4gICAgICAgICAgICB4MSArIHBlcnAxeCAqIG91dGVyV2VpZ2h0LFxuICAgICAgICAgICAgeTEgKyBwZXJwMXkgKiBvdXRlcldlaWdodCxcbiAgICAgICAgICAgIHZlcnRzLFxuICAgICAgICAgICAgITBcbiAgICAgICAgICApICsgMiA6IGluZGV4Q291bnQgKz0gcm91bmQoXG4gICAgICAgICAgICB4MSxcbiAgICAgICAgICAgIHkxLFxuICAgICAgICAgICAgeDEgLSBwZXJweCAqIGlubmVyV2VpZ2h0LFxuICAgICAgICAgICAgeTEgLSBwZXJweSAqIGlubmVyV2VpZ2h0LFxuICAgICAgICAgICAgeDEgLSBwZXJwMXggKiBpbm5lcldlaWdodCxcbiAgICAgICAgICAgIHkxIC0gcGVycDF5ICogaW5uZXJXZWlnaHQsXG4gICAgICAgICAgICB2ZXJ0cyxcbiAgICAgICAgICAgICExXG4gICAgICAgICAgKSArIDI7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHZlcnRzLnB1c2goXG4gICAgICAgIHgxIC0gcGVycDF4ICogaW5uZXJXZWlnaHQsXG4gICAgICAgIHkxIC0gcGVycDF5ICogaW5uZXJXZWlnaHQsXG4gICAgICAgIC8vIHNlY29uZCBzZWdtZW50J3MgaW5uZXIgdmVydGV4XG4gICAgICAgIHgxICsgcGVycDF4ICogb3V0ZXJXZWlnaHQsXG4gICAgICAgIHkxICsgcGVycDF5ICogb3V0ZXJXZWlnaHRcbiAgICAgICksIGluZGV4Q291bnQgKz0gMjtcbiAgICB9XG4gIH1cbiAgeDAgPSBwb2ludHNbKGxlbmd0aCAtIDIpICogMl0sIHkwID0gcG9pbnRzWyhsZW5ndGggLSAyKSAqIDIgKyAxXSwgeDEgPSBwb2ludHNbKGxlbmd0aCAtIDEpICogMl0sIHkxID0gcG9pbnRzWyhsZW5ndGggLSAxKSAqIDIgKyAxXSwgcGVycHggPSAtKHkwIC0geTEpLCBwZXJweSA9IHgwIC0geDEsIGRpc3QgPSBNYXRoLnNxcnQocGVycHggKiBwZXJweCArIHBlcnB5ICogcGVycHkpLCBwZXJweCAvPSBkaXN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cbiAgICAgICAgYXR0cmlidXRlTmFtZTogXCJhVmVydGV4UG9zaXRpb25cIixcbiAgICAgICAgc2l6ZTogMixcbiAgICAgICAgdXBsb2FkRnVuY3Rpb246IHRoaXMudXBsb2FkVmVydGljZXMsXG4gICAgICAgIG9mZnNldDogMFxuICAgICAgfSxcbiAgICAgIC8vIHBvc2l0aW9uRGF0YVxuICAgICAge1xuICAgICAgICBhdHRyaWJ1dGVOYW1lOiBcImFQb3NpdGlvbkNvb3JkXCIsXG4gICAgICAgIHNpemU6IDIsXG4gICAgICAgIHVwbG9hZEZ1bmN0aW9uOiB0aGlzLnVwbG9hZFBvc2l0aW9uLFxuICAgICAgICBvZmZzZXQ6IDBcbiAgICAgIH0sXG4gICAgICAvLyByb3RhdGlvbkRhdGFcbiAgICAgIHtcbiAgICAgICAgYXR0cmlidXRlTmFtZTogXCJhUm90YXRpb25cIixcbiAgICAgICAgc2l6ZTogMSxcbiAgICAgICAgdXBsb2FkRnVuY3Rpb246IHRoaXMudXBsb2FkUm90YXRpb24sXG4gICAgICAgIG9mZnNldDogMFxuICAgICAgfSxcbiAgICAgIC8vIHV2c0RhdGFcbiAgICAgIHtcbiAgICAgICAgYXR0cmlidXRlTmFtZTogXCJhVGV4dHVyZUNvb3JkXCIsXG4gICAgICAgIHNpemU6IDIsXG4gICAgICAgIHVwbG9hZEZ1bmN0aW9uOiB0aGlzLnVwbG9hZFV2cyxcbiAgICAgICAgb2Zmc2V0OiAwXG4gICAgICB9LFxuICAgICAgLy8gdGludERhdGFcbiAgICAgIHtcbiAgICAgICAgYXR0cmlidXRlTmFtZTogXCJhQ29sb3JcIixcbiAgICAgICAgc2l6ZTogMSxcbiAgICAgICAgdHlwZTogVFlQRVMuVU5TSUdORURfQllURSxcbiAgICAgICAgdXBsb2FkRnVuY3Rpb246IHRoaXMudXBsb2FkVGludCxcbiAgICAgICAgb2Zmc2V0OiAwXG4gICAgICB9XG4gICAgXSwgdGhpcy5zaGFkZXIgPSBTaGFkZXI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mxvb3IocmVjdC54KSAvIHRoaXMucmVzb2x1dGlvbixcbiAgICAgICAgICBNYXRoLmZsb29yKHJlY3QueSkgLyB0aGlzLnJlc29sdXRpb24sXG4gICAgICAgICAgTWF0aC5mbG9vcihyZWN0LmgpIC8gdGhpcy5yZXNvbHV0aW9uLFxuICAgICAgICAgIE1hdGguZmxvb3IocmVjdC53KSAvIHRoaXMucmVzb2x1dGlvblxuICAgICAgICApIDogZnJhbWUgPSBuZXcgUmVjdGFuZ2xlKFxuICAgICAgICAgIE1hdGguZmxvb3IocmVjdC54KSAvIHRoaXMucmVzb2x1dGlvbixcbiAgICAgICAgICBNYXRoLmZsb29yKHJlY3QueSkgLyB0aGlzLnJlc29sdXRpb24sXG4gICAgICAgICAgTWF0aC5mbG9vcihyZWN0LncpIC8gdGhpcy5yZXNvbHV0aW9uLFxuICAgICAgICAgIE1hdGguZmxvb3IocmVjdC5oKSAvIHRoaXMucmVzb2x1dGlvblxuICAgICAgICApLCBkYXRhLnRyaW1tZWQgIT09ICExICYmIGRhdGEuc3ByaXRlU291cmNlU2l6ZSAmJiAodHJpbSA9IG5ldyBSZWN0YW5nbGUoXG4gICAgICAgICAgTWF0aC5mbG9vcihkYXRhLnNwcml0ZVNvdXJjZVNpemUueCkgLyB0aGlzLnJlc29sdXRpb24sXG4gICAgICAgICAgTWF0aC5mbG9vcihkYXRhLnNwcml0ZVNvdXJjZVNpemUueSkgLyB0aGlzLnJlc29sdXRpb24sXG4gICAgICAgICAgTWF0aC5mbG9vcihyZWN0LncpIC8gdGhpcy5yZXNvbHV0aW9uLFxuICAgICAgICAgIE1hdGguZmxvb3IocmVjdC5oKSAvIHRoaXMucmVzb2x1dGlvblxuICAgICAgICApKSwgdGhpcy50ZXh0dXJlc1tpXSA9IG5ldyBUZXh0dXJlKFxuICAgICAgICAgIHRoaXMuYmFzZVRleHR1cmUsXG4gICAgICAgICAgZnJhbWUsXG4gICAgICAgICAgb3JpZyxcbiAgICAgICAgICB0cmltLFxuICA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FibGVGb250c1t1cmxdO1xuICAgICAgcmV0dXJuIHRoaXMuX2ZvbnRzLnB1c2goZm9udCksIGZvbnQucmVmcysrLCB0aGlzLnN0eWxlSUQrKywgdGhpcy5mb250c0RpcnR5ID0gITAsIFByb21pc2UucmVzb2x2ZSgpO1xuICAgIH1cbiAgICByZXR1cm4gc2V0dGluZ3MuQURBUFRFUi5mZXRjaCh1cmwpLnRoZW4oKHJlc3BvbnNlKSA9PiByZXNwb25zZS5ibG9iKCkpLnRoZW4oYXN5bmMgKGJsb2IpID0+IG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgIGNvbnN0IHNyYyA9IFVSTC5jcmVhdGVPYmplY3RVUkwoYmxvYiksIHJlYWRlciA9IG5ldyBGaWxlUmVhZGVyKCk7XG4gICAgICByZWFkZXIub25sb2FkID0gKCkgPT4gcmVzb2x2ZShbc3JjLCByZWFkZXIucmVzdWx0XSksIHJlYWRlci5vbmVycm9yID0gcmVqZWN0LCByZWFkZXIucmVhZEFzRGF0YVVSTChibG9iKTtcbiAgICB9KSkudGhlbihhc3luYyAoW3NyYywgZGF0YVNyY10pID0+IHtcbiAgICAgIGNvbnN0IGZvbnQgPSBPYmplY3QuYXNzaWduKHtcbiAgICAgICAgZmFtaWx5OiB1dGlscy5wYXRoLmJhc2VuYW1lKHVybCwgdXRpbHMucGF0aC5leHRuYW1lKHVybCkpLFxuICAgICAgICB3ZWlnaHQ6IFwibm9ybWFsXCIsXG4gICAgICAgIHN0eWxlOiBcIm5vcm1hbFwiLFxuICAgICAgICBkaXNwbGF5OiBcImF1dG9cIixcbiAgICAgICAgc3JjLFxuICAgICAgICBkYXRhU3JjLFxuICAgICAgICByZWZzOiAxLFxuICAgICAgICBvcmlnaW5hbFVybDogdXJsLFxuICAgICAgICBmb250RmFjZTogbnVsbFxuICAgICAgfSwgb3B0aW9ucyk7XG4gICAgICBhdmFpbGFibGVGb250c1t1cmxdID0gZm9udCwgdGhpcy5fZm9ud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AgICAgIGNvbnRpbnVlO1xuICAgICAgfVxuICAgICAgY29uc3QgdG9rZW5XaWR0aCA9IF9UZXh0TWV0cmljczIuZ2V0RnJvbUNhY2hlKHRva2VuLCBsZXR0ZXJTcGFjaW5nLCBjYWNoZSwgY29udGV4dCk7XG4gICAgICBpZiAodG9rZW5XaWR0aCA+IHdvcmRXcmFwV2lkdGgpXG4gICAgICAgIGlmIChsaW5lICE9PSBcIlwiICYmIChsaW5lcyArPSBfVGV4dE1ldHJpY3MyLmFkZExpbmUobGluZSksIGxpbmUgPSBcIlwiLCB3aWR0aCA9IDApLCBfVGV4dE1ldHJpY3MyLmNhbkJyZWFrV29yZHModG9rZW4sIHN0eWxlLmJyZWFrV29yZHMpKSB7XG4gICAgICAgICAgY29uc3QgY2hhcmFjdGVycyA9IF9UZXh0TWV0cmljczIud29yZFdyYXBTcGxpdCh0b2tlbik7XG4gICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBjaGFyYWN0ZXJzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICBsZXQgY2hhciA9IGNoYXJhY3RlcnNbal0sIGxhc3RDaGFyID0gY2hhciwgayA9IDE7XG4gICAgICAgICAgICBmb3IgKDsgY2hhcmFjdGVyc1tqICsga107ICkge1xuICAgICAgICAgICAgICBjb25zdCBuZXh0Q2hhciA9IGNoYXJhY3RlcnNbaiArIGtdO1xuICAgICAgICAgICAgICBpZiAoIV9UZXh0TWV0cmljczIuY2FuQnJlYWtDaGFycyhsYXN0Q2hhciwgbmV4dENoYXIsIHRva2VuLCBqLCBzdHlsZS5icmVha1dvcmRzKSlcbiAgICAgICAgICAgICAgICBjaGFyICs9IG5leHRDaGFyO1xuICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIGxhc3RDaGFyID0gbmV4dENoYXIsIGsrKztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGogKz0gayAtIDE7XG4gICAgICAgICAgIC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2U7XG4gICAgICAgIHRoaXMuc3dpcGluZ0RpcmVjdGlvbiA9IG51bGw7XG4gICAgICAgIHRoaXMuc3dpcGVkSG9yaXpvbnRhbCA9IGZhbHNlO1xuICAgICAgICB0aGlzLnN3aXBlZFZlcnRpY2FsID0gZmFsc2U7XG4gICAgICAgIHRoaXMub3JpZ2luYWxEaXN0YW5jZSA9IG51bGw7XG4gICAgICAgIHRoaXMubmV3RGlzdGFuY2UgPSBudWxsO1xuICAgICAgICB0aGlzLnNjYWxlID0gbnVsbDtcbiAgICAgICAgdGhpcy5vcmlnaW5hbEFuZ2xlID0gbnVsbDtcbiAgICAgICAgdGhpcy5uZXdBbmdsZSA9IG51bGw7XG4gICAgICAgIHRoaXMucm90YXRpb24gPSBudWxsO1xuICAgICAgICB0aGlzLmhhbmRsZXJzID0ge1xuICAgICAgICAgICAgcGFuc3RhcnQ6IFtdLFxuICAgICAgICAgICAgcGFubW92ZTogW10sXG4gICAgICAgICAgICBwYW5lbmQ6IFtdLFxuICAgICAgICAgICAgc3dpcGVsZWZ0OiBbXSxcbiAgICAgICAgICAgIHN3aXBlcmlnaHQ6IFtdLFxuICAgICAgICAgICAgc3dpcGV1cDogW10sXG4gICAgICAgICAgICBzd2lwZWRvd246IFtdLFxuICAgICAgICAgICAgdGFwOiBbXSxcbiAgICAgICAgICAgIGRvdWJsZXRhcDogW10sXG4gICAgICAgICAgICBsb25ncHJlc3M6IFtdLFxuICAgICAgICAgICAgcGluY2g6IFtdLFxuICAgICAgICAgICAgcGluY2hlbmQ6IFtdLFxuICAgICAgICAgICAgcm90YXRlOiBbXSxcbiAgICAgICAgICAgIHJvdGF0ZWVuZDogW10sXG4gICAgICAgIH07XG4gICAgICAgIHRoaXMuX29uVG91Y2hTdGFydCA9IHRoaXMub25Ub3VjaFN0YXJ0LmJpbmQodGhpcyk7XG4gICAgICAgIHRoaXMuX29uVG91Y2hNb3ZlID0gdGhpcy5vblRvdWNoTW92ZS5iaW5kKHRoaXMpO1xuICAg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zLm9mZih0eXBlLCBmbiksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgfVxuICAgIG9mZih0eXBlLCBmbikge1xuICAgICAgICBpZiAodGhpcy5oYW5kbGVyc1t0eXBlXSkge1xuICAgICAgICAgICAgY29uc3QgaWR4ID0gdGhpcy5oYW5kbGVyc1t0eXBlXS5pbmRleE9mKGZuKTtcbiAgICAgICAgICAgIGlmIChpZHggIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5oYW5kbGVyc1t0eXBlXS5zcGxpY2UoaWR4LCAxKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICBmaXJlKHR5cGUsIGV2ZW50KSB7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy5oYW5kbGVyc1t0eXBlXS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdGhpcy5oYW5kbGVyc1t0eXBlXVtpXShldmVudCk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgb25Ub3VjaFN0YXJ0KGV2ZW50KSB7XG4gICAgICAgIHZhciBfYSwgX2IsIF9jLCBfZCwgX2UsIF9mLCBfZywgX2gsIF9qLCBfaywgX2wsIF9tLCBfbywgX3AsIF9xLCBfciwgX3MsIF90LCBfdSwgX3YsIF93LCBfeCwgX3ksIF96LCBfMCwgXzE7XG4gICAgICAgIGxldCBkaWRUb3VjaDEgPSBmYWxzZTtcbiAgICAgICAgbGV0IGRpZFRvdWNoMiA9IGZhbHNlO1xuICAgICAgICBpZiAoZXZlbnQudHlwZSAhPT0gJ21vdXNlZG93bicpIHtcbiAgICAgICAgICAgIGlmICghdGhpcy50b3VjaDEpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnRvdWNoMSA9IGV2ZW50LmNoYW5nZWRUb3VjaGVzWzBdO1xuICAgICAgICAgICAgICAgIGRpZFRvdWNoMSA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoKChkaWRUb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NhbCA9IGFic1RvdWNoTW92ZVkgPiB0aGlzLnRocmVzaG9sZFk7XG4gICAgICAgICAgICB0aGlzLnN3aXBpbmdEaXJlY3Rpb24gPVxuICAgICAgICAgICAgICAgIGFic1RvdWNoTW92ZVggPiBhYnNUb3VjaE1vdmVZXG4gICAgICAgICAgICAgICAgICAgID8gdGhpcy5zd2lwaW5nSG9yaXpvbnRhbFxuICAgICAgICAgICAgICAgICAgICAgICAgPyAnaG9yaXpvbnRhbCdcbiAgICAgICAgICAgICAgICAgICAgICAgIDogJ3ByZS1ob3Jpem9udGFsJ1xuICAgICAgICAgICAgICAgICAgICA6IHRoaXMuc3dpcGluZ1ZlcnRpY2FsXG4gICAgICAgICAgICAgICAgICAgICAgICA/ICd2ZXJ0aWNhbCdcbiAgICAgICAgICAgICAgICAgICAgICAgIDogJ3ByZS12ZXJ0aWNhbCc7XG4gICAgICAgICAgICBpZiAoTWF0aC5tYXgoYWJzVG91Y2hNb3ZlWCwgYWJzVG91Y2hNb3ZlWSkgPiB0aGlzLm9wdHMucHJlc3NUaHJlc2hvbGQpIHtcbiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQoKF9nID0gdGhpcy5sb25nUHJlc3NUaW1lcikgIT09IG51bGwgJiYgX2cgIT09IHZvaWQgMCA/IF9nIDogdW5kZWZpbmVkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuZmlyZSgncGFubW92ZScsIGV2ZW50KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZXZlbnQudHlwZSAhPT0gJ21vdXNlbW92ZScgJiYgdGhpcy50b3VjaE1vdmUxICE9IG51bGwgJiYgdGhpcy50b3VjaE1vdmUyICE9IG51bGwpIHtcbiAgICAgICAgICAgIHRoaXMubmV3RGlzdGFuY2UgPSBNYXRoLnNxcnQoTWF0aC5wb3codGhpcy50b3VjaE1vdmUyLnNjcmVlblggLSB0aGlzLnRvdWNoTW92ZTEuc2NyZWVuWCwgMikgK1xuICAgICAgIC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BNYXRoLlBJKSAvIDE4MCkgfHxcbiAgICAgICAgICAgICAgICAgICAgZGlhZ29uYWwgPiBNYXRoLnRhbigoKDQ1ICsgdGhpcy5vcHRzLmRpYWdvbmFsTGltaXQpICogTWF0aC5QSSkgLyAxODApKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhYnNYID49IGFic1kpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc3dpcGVkVmVydGljYWwgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoYWJzWSA+IGFic1gpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc3dpcGVkSG9yaXpvbnRhbCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICh0aGlzLnN3aXBlZEhvcml6b250YWwpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHggPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChfZiA9IHRoaXMudmVsb2NpdHlYKSAhPT0gbnVsbCAmJiBfZiAhPT0gdm9pZCAwID8gX2YgOiAwKSA8IC10aGlzLm9wdHMudmVsb2NpdHlUaHJlc2hvbGQgfHwgZGlzdGFuY2UgPCAtdGhpcy5kaXNyZWdhcmRWZWxvY2l0eVRocmVzaG9sZFgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmZpcmUoJ3N3aXBlbGVmdCcsIGV2ZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKF9nID0gdGhpcy52ZWxvY2l0eVgpICE9PSBudWxsICYmIF9nICE9PSB2b2lkIDAgPyBfZyA6IDApID4gdGhpcy5vcHRzLnZlbG9jaXR5VGhyZXNob2xkIHx8IGRpc3RhbmNlID4gdGhpcy5kaXNyZWdhcmRWZWxvY2l0eVRocmVzaG9sZFgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmZpcmUoJ3N3aXBlcmlnaHQnLCBldmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuc3dpcGVkVmVydGljYWwpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHkgPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChfaCA9IHRoaXMudmVsb2NpdHlZKSAhPT0gbnVsbCAmJiBfaCAhPT0gdm9pZCAwID8gX2ggOiAwKSA8IC10aGlzLm9wdHMudmVsb2NpdHlUaHJlc2hvbGQgfHwgZGlzdGFuY2UgPCAtdGhpcy5kaXNyZWdhcmRWZWxvY2l0eVRocmVzaG9sZFkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmZpcmUoJ3N3aXBldXAnLCBldmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChfaiA9IHRoaXMudmVsb2NpdHlZKSAhPT0gbnVsbCAmJiBfaiAhPT0gdm9pZCAwID8gX2ogOiAwKSA+IHRoaXMub3B0cy52ZWxvY2l0eVRocmVzaG9sZCB8fCBkaXN0YW5jZSA+IHRoaXMuZGlzcmVnYXJkVmVsb2NpdHlUaHJlc2hvbGRZKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5maXJlKCdzd2lwZWRvd24nLCBldmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChhYnNYIDwgdGhpcy5vcHRzLnByZXNzVGhyZXNob2xkICYmIGFic1kgPCB0aGlzLm9wdHMucHJlc3NUaHJlc2hvbGQpIHtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5kb3VibGVUYXBXYWl0aW5nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZG91YmxlVGFwV2FpdGluZyA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQoKF9rID0gdGhpcy5kb3VibGVUYXBUaW1lcikgIT09IG51bGwgJiYgX2sgIT09IHZvaWQgMCA/IF9rIDogdW5kZWZpbmVkKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5maXJlKCdkb3VibGV0YXAnLCBldmVudCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmRvdWJsZVRhcFdhaXRpbmcgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmRvdWJsZVRhcFRpbWVyID0gc2V0VGltZW91dCgoKSA9PiAodGhpcy5kb3VibGVUYXBXYWl0aW5nID0gZmFsc2UpLCB0aGlzLm9wdHMuZG91YmxlVGFwVGltZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZmlyZSgndGFwJywgZXZlbnQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoIXRoaXMudG91Y2gxICYmICF0aGlzLnRvdWNoMikge1xuICAgICAgICAgICAgdGhpcy5maXJlKCdwaW5jaGVuZCcsIGV2ZW50KTtcbiAgICAgICAgICAgIHRoaXMuZmlyZSgncm90YXRlZW5kJywgZXZlbnQpO1xuICAgICAgICAgICAgdGhpcy5vcmlnaW5hbERpc3RhbmNlID0gbnVsbDtcbiAgICAgICAgICAgIHRoaXMubmV3RGlzdGFuY2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HdvIGJ5IHRoZSBkaWFnb25hbFxuICAgICAgICAgICAgICAgIHZhciBjID0gc3BsaXRQb2x5Z29uKGEsIGIpO1xuXG4gICAgICAgICAgICAgICAgLy8gZmlsdGVyIGNvbGluZWFyIHBvaW50cyBhcm91bmQgdGhlIGN1dHNcbiAgICAgICAgICAgICAgICBhID0gZmlsdGVyUG9pbnRzKGEsIGEubmV4dCk7XG4gICAgICAgICAgICAgICAgYyA9IGZpbHRlclBvaW50cyhjLCBjLm5leHQpO1xuXG4gICAgICAgICAgICAgICAgLy8gcnVuIGVhcmN1dCBvbiBlYWNoIGhhbGZcbiAgICAgICAgICAgICAgICBlYXJjdXRMaW5rZWQoYSwgdHJpYW5nbGVzLCBkaW0sIG1pblgsIG1pblksIGludlNpemUsIDApO1xuICAgICAgICAgICAgICAgIGVhcmN1dExpbmtlZChjLCB0cmlhbmdsZXMsIGRpbSwgbWluWCwgbWluWSwgaW52U2l6ZSwgMCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYiA9IGIubmV4dDtcbiAgICAgICAgfVxuICAgICAgICBhID0gYS5uZXh0O1xuICAgIH0gd2hpbGUgKGEgIT09IHN0YXJ0KTtcbn1cblxuLy8gbGluayBldmVyeSBob2xlIGludG8gdGhlIG91dGVyIGxvb3AsIHByb2R1Y2luZyBhIHNpbmdsZS1yaW5nIHBvbHlnb24gd2l0aG91dCBob2xlc1xuZnVuY3Rpb24gZWxpbWluYXRlSG9sZXMoZGF0YSwgaG9sZUluZGljZXMsIG91dGVyTm9kZSwgZGltKSB7XG4gICAgdmFyIHF1ZXVlID0gW10sXG4gICAgICAgIGksIGxlbiwgc3RhcnQsIGVuZCwgbGlzdDtcblxuICAgIGZvciAoaSA9IDAsIGxlbiA9IGhvbGVJbmRpY2VzLmxlbmd0aDsgaSA8IGxlbjsgaSsrKSB7XG4gICAgICAgIHN0YXJ0ID0gaG9sZUluZGljZXNbaV0gKiBkaW07XG4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0YW5NaW4gJiYgKHAueCA+IG0ueCB8fCAocC54ID09PSBtLnggJiYgc2VjdG9yQ29udGFpbnNTZWN0b3IobSwgcCkpKSkpKSB7XG4gICAgICAgICAgICAgICAgbSA9IHA7XG4gICAgICAgICAgICAgICAgdGFuTWluID0gdGFuO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcCA9IHAubmV4dDtcbiAgICB9IHdoaWxlIChwICE9PSBzdG9wKTtcblxuICAgIHJldHVybiBtO1xufVxuXG4vLyB3aGV0aGVyIHNlY3RvciBpbiB2ZXJ0ZXggbSBjb250YWlucyBzZWN0b3IgaW4gdmVydGV4IHAgaW4gdGhlIHNhbWUgY29vcmRpbmF0ZXNcbmZ1bmN0aW9uIHNlY3RvckNvbnRhaW5zU2VjdG9yKG0sIHApIHtcbiAgICByZXR1cm4gYXJlYShtLnByZXYsIG0sIHAucHJldikgPCAwICYmIGFyZWEocC5uZXh0LCBtLCBtLm5leHQpIDwgMDtcbn1cblxuLy8gaW50ZXJsaW5rIHBvbHlnb24gbm9kZXMgaW4gei1vcmRlclxuZnVuY3Rpb24gaW5kZXhDdXJ2ZShzdGFydCwgbWluWCwgbWluWSwgaW52U2l6ZSkge1xuICAgIHZhciBwID0gc3RhcnQ7XG4gICAgZG8ge1xuICAgICAgICBpZiAocC56ID09PSAwKSBwLnogPSB6T3JkZXIocC54LCBwLnksIG1pblgsIG1pblksIGludlNpemUpO1xuICAgICAgICBwLnByZXZaID0gcC5wcmV2O1xuICAgICAgICBwLm5leHRaID0gcC5uZXh0O1xuICAgICAgICBwID0gcC5uZXh0O1xuICAgIH0gd2hpbGUgKHAgIT09IHN0YXJ0KTtcblxuICAgIHAucHJldloubmV4dFogPSBudWxsO1xuICAgIHAucHJldlogPSBudWxsO1xuXG4gICAgc29ydExpbmtlZChwKTtcbn1cblxuLy8gU2ltb24gVGF0aGFtJ3MgbGlua2VkIGxpc3QgbWVyZ2Ugc29ydCBhbGdvcml0aG1cbi8vIGh0dHA6Ly93d3cuY2hpYXJrLmdyZWVuZW5kLm9yZy51ay9+c2d0YXRoYW0vYWxnb3JpdGhtcy9saXN0c29ydC5odG1sXG5mdW5jdGlvbiBzb3J0TGlua2VkKGxpc3QpIHtcbiAgICB2YXIgaSwgcCwgcSwgZSwgdGFpbCwgbnVtTWVyZ2VzLCBwU2l6ZSwgcVNpemUsXG4gICAgICAgIGluU2l6ZSA9IDE7XG5cbiAgICBkbyB7XG4gICAgICAgIHAgPSBsaXN0O1xuICAgICAgICBsaXN0ID0gbnVsbDtcbiAgICAgICAgdGFpbCA9IG51bGw7XG4gICAgICAgIG51bU1lcmdlcyA9IDA7XG5cbiAgICAgICAgd2hpbGUgKHApIHtcbiAgICAgICAgICAgIG51bU1lcmdlcysrO1xuICAgICAgICAgICAgcSA9IHA7XG4gICAgICAgICAgICBwU2l6ZSA9IDA7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgaW5TaXplOyBpKyspIHtcbiAgICAgICAgICAgICAgICBwU2l6ZSsrO1xuICAgICAgICAgICAgICAgIHEgPSBxLm5leHRaO1xuICAgICAgICAgICAgICAgIGlmICghcSkgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBxU2l6ZSA9IGluU2l6ZTtcblxuICAgICAgICAgICAgd2hpbGUgKHBTaXplID4gMCB8fCAocVNpemUgPiAwICYmIHEpKSB7XG5cbiAgICAgICAgICAgICAgICBpZiAocFNpemUgIT09IDAgJiYgKHFTaXplID09PSAwIHx8ICFxIHx8IHAueiA8PSBxLnopKSB7XG4gICAgICAgICAgICAgICAgICAgIGUgPSBwO1xuICAgICAgICAgICAgICAgICAgICBwID0gcC5uZXh0WjtcbiAgICAgICAgICAgICAgICAgICAgcFNpemUtLTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBlID0gcTtcbiAgICAgICAgICAgICAgICAgICAgcSA9IHEubmV4dFo7XG4gICAgICAgICAgICAgICAgICAg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mICh0eXBlb2YgdGFyZ2V0ICE9PSAnZnVuY3Rpb24nIHx8IHRvU3RyLmFwcGx5KHRhcmdldCkgIT09IGZ1bmNUeXBlKSB7XG4gICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoRVJST1JfTUVTU0FHRSArIHRhcmdldCk7XG4gICAgfVxuICAgIHZhciBhcmdzID0gc2xpY3koYXJndW1lbnRzLCAxKTtcblxuICAgIHZhciBib3VuZDtcbiAgICB2YXIgYmluZGVyID0gZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAodGhpcyBpbnN0YW5jZW9mIGJvdW5kKSB7XG4gICAgICAgICAgICB2YXIgcmVzdWx0ID0gdGFyZ2V0LmFwcGx5KFxuICAgICAgICAgICAgICAgIHRoaXMsXG4gICAgICAgICAgICAgICAgY29uY2F0dHkoYXJncywgYXJndW1lbnRzKVxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIGlmIChPYmplY3QocmVzdWx0KSA9PT0gcmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0YXJnZXQuYXBwbHkoXG4gICAgICAgICAgICB0aGF0LFxuICAgICAgICAgICAgY29uY2F0dHkoYXJncywgYXJndW1lbnRzKVxuICAgICAgICApO1xuXG4gICAgfTtcblxuICAgIHZhciBib3VuZExlbmd0aCA9IG1heCgwLCB0YXJnZXQubGVuZ3RoIC0gYXJncy5sZW5ndGgpO1xuICAgIHZhciBib3VuZEFyZ3MgPSBbXTtcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IGJvdW5kTGVuZ3RoOyBpKyspIHtcbiAgICAgICAgYm91bmRBcmdzW2ldID0gJyQnICsgaTtcbiAgICB9XG5cbiAgICBib3VuZCA9IEZ1bmN0aW9uKCdiaW5kZXInLCAncmV0dXJuIGZ1bmN0aW9uICgnICsgam9pbnko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NoKGFwcGxlVGFibGV0KSB8fFxuICAgICAgICAgICAgICAgIG1hdGNoKGFwcGxlVW5pdmVyc2FsKSB8fFxuICAgICAgICAgICAgICAgIGlzQXBwbGVUYWJsZXRPbklvczEzKG5hdikpICYmXG4gICAgICAgICAgICAgICAgIW1hdGNoKHdpbmRvd3NQaG9uZSlcbiAgICAgICAgfSxcbiAgICAgICAgYW1hem9uOiB7XG4gICAgICAgICAgICBwaG9uZTogbWF0Y2goYW1hem9uUGhvbmUpLFxuICAgICAgICAgICAgdGFibGV0OiAhbWF0Y2goYW1hem9uUGhvbmUpICYmIG1hdGNoKGFtYXpvblRhYmxldCksXG4gICAgICAgICAgICBkZXZpY2U6IG1hdGNoKGFtYXpvblBob25lKSB8fCBtYXRjaChhbWF6b25UYWJsZXQpXG4gICAgICAgIH0sXG4gICAgICAgIGFuZHJvaWQ6IHtcbiAgICAgICAgICAgIHBob25lOiAoIW1hdGNoKHdpbmRvd3NQaG9uZSkgJiYgbWF0Y2goYW1hem9uUGhvbmUpKSB8fFxuICAgICAgICAgICAgICAgICghbWF0Y2god2luZG93c1Bob25lKSAmJiBtYXRjaChhbmRyb2lkUGhvbmUpKSxcbiAgICAgICAgICAgIHRhYmxldDogIW1hdGNoKHdpbmRvd3NQaG9uZSkgJiZcbiAgICAgICAgICAgICAgICAhbWF0Y2goYW1hem9uUGhvbmUpICYmXG4gICAgICAgICAgICAgICAgIW1hdGNoKGFuZHJvaWRQaG9uZSkgJiZcbiAgICAgICAgICAgICAgICAobWF0Y2goYW1hem9uVGFibGV0KSB8fCBtYXRjaChhbmRyb2lkVGFibGV0KSksXG4gICAgICAgICAgICBkZXZpY2U6ICghbWF0Y2god2luZG93c1Bob25lKSAmJlxuICAgICAgICAgICAgICAgIChtYXRjaChhbWF6b25QaG9uZSkgfHxcbiAgICAgICAgICAgICAgICAgICAgbWF0Y2goYW1hem9uVGFibGV0KSB8fFxuICAgICAgICAgICAgICAgICAgICBtYXRjaChhbmRyb2lkUGhvbmUpIHx8XG4gICAgICAgICAgICAgICAgICAgIG1hdGNoKGFuZHJvaWRUYWJsZXQpKSkgfHxcbiAgICAgICAgICAgICAgICBtYXRjaCgvXFxib2todHRwXFxiL2kpXG4gICAgICAgIH0sXG4gICAgICAgIHdpbmRvd3M6IHtcbiAgICAgICAgICAgIHBob25lOiBtYXRjaCh3aW5kb3dzUGhvbmUpLFxuICAgICAgICAgICAgdGFibGV0OiBtYXRjaCh3aW5kb3dzVGFibGV0KSxcbiAgICAgICAgICAgIGRldmljZTogbWF0Y2god2luZG93c1Bob25lKSB8fCBtYXRjaCh3aW5kb3dzVGFibGV0KVxuICAgICAgICB9LFxuICAgICAgICBvdGhlcjoge1xuICAgICAgICAgICAgYmxhY2tiZXJyeTogbWF0Y2gob3RoZXJCbGFja0JlcnJ5KSxcbiAgICAgICAgICAgIGJsYWNrYmVycnkxMDogbWF0Y2gob3RoZXJCbGFja0JlcnJ5MTApLFxuICAgICAgICAgICAgb3BlcmE6IG1hdGNoKG90aGVyT3BlcmEpLFxuICAgICAgICAgICAgZmlyZWZveDogbWF0Y2gob3RoZXJGaXJlZm94KSxcbiAgICAgICAgICAgIGNocm9tZTogbWF0Y2gob3RoZXJDaHJvbWUpLFxuICAgICAgICAgICAgZGV2aWNlOiBtYXRjaChvdGhlckJsYWNrQmVycnkpIHx8XG4gICAgICAgICAgICAgICAgbWF0Y2gob3RoZXJCbGFja0JlcnJ5MTApIHx8XG4gICAgICAgICAgICAgICAgbWF0Y2gob3RoZXJPcGVyYSkgfHxcbiAgICAgICAgICAgICAgICBtYXRjaChvdGhlckZpcmVmb3gpIHx8XG4gICAgICAgICAgICAgICAgbWF0Y2gob3RoZXJDaHJvbWUpXG4gICAgICAgIH0sXG4gICAgICAgIGFueTogZmFsc2UsXG4gICAgICAgIHBob25lOiBmYWxzZSxcbiAgICAgICAgdGFibGV0OiBmYWxzZVxuICAgIH07XG4gICAgcmVzdWx0LmFueSA9XG4gICAgICAgIHJlc3VsdC5hcHBsZS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JylcbiAgICA/IFN5bWJvbC50b1N0cmluZ1RhZ1xuICAgIDogbnVsbDtcbnZhciBpc0VudW1lcmFibGUgPSBPYmplY3QucHJvdG90eXBlLnByb3BlcnR5SXNFbnVtZXJhYmxlO1xuXG52YXIgZ1BPID0gKHR5cGVvZiBSZWZsZWN0ID09PSAnZnVuY3Rpb24nID8gUmVmbGVjdC5nZXRQcm90b3R5cGVPZiA6IE9iamVjdC5nZXRQcm90b3R5cGVPZikgfHwgKFxuICAgIFtdLl9fcHJvdG9fXyA9PT0gQXJyYXkucHJvdG90eXBlIC8vIGVzbGludC1kaXNhYmxlLWxpbmUgbm8tcHJvdG9cbiAgICAgICAgPyBmdW5jdGlvbiAoTykge1xuICAgICAgICAgICAgcmV0dXJuIE8uX19wcm90b19fOyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIG5vLXByb3RvXG4gICAgICAgIH1cbiAgICAgICAgOiBudWxsXG4pO1xuXG5mdW5jdGlvbiBhZGROdW1lcmljU2VwYXJhdG9yKG51bSwgc3RyKSB7XG4gICAgaWYgKFxuICAgICAgICBudW0gPT09IEluZmluaXR5XG4gICAgICAgIHx8IG51bSA9PT0gLUluZmluaXR5XG4gICAgICAgIHx8IG51bSAhPT0gbnVtXG4gICAgICAgIHx8IChudW0gJiYgbnVtID4gLTEwMDAgJiYgbnVtIDwgMTAwMClcbiAgICAgICAgfHwgJHRlc3QuY2FsbCgvZS8sIHN0cilcbiAgICApIHtcbiAgICAgICAgcmV0dXJuIHN0cjtcbiAgICB9XG4gICAgdmFyIHNlcFJlZ2V4ID0gL1swLTldKD89KD86WzAtOV17M30pKyg/IVswLTldKSkvZztcbiAgICBpZiAodHlwZW9mIG51bSA9PT0gJ251bWJlcicpIHtcbiAgICAgICAgdmFyIGludCA9IG51bSA8IDAgPyAtJGZsb29yKC1udW0pIDogJGZsb29yKG51bSk7IC8vIHRydW5jKG51bSlcbiAgICAgICAgaWYgKGludCAhPT0gbnVtKSB7XG4gICAgICAgICAgICB2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RyaW5nKSA6IHN5bVN0cmluZztcbiAgICB9XG4gICAgaWYgKGlzRWxlbWVudChvYmopKSB7XG4gICAgICAgIHZhciBzID0gJzwnICsgJHRvTG93ZXJDYXNlLmNhbGwoU3RyaW5nKG9iai5ub2RlTmFtZSkpO1xuICAgICAgICB2YXIgYXR0cnMgPSBvYmouYXR0cmlidXRlcyB8fCBbXTtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhdHRycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgcyArPSAnICcgKyBhdHRyc1tpXS5uYW1lICsgJz0nICsgd3JhcFF1b3RlcyhxdW90ZShhdHRyc1tpXS52YWx1ZSksICdkb3VibGUnLCBvcHRzKTtcbiAgICAgICAgfVxuICAgICAgICBzICs9ICc+JztcbiAgICAgICAgaWYgKG9iai5jaGlsZE5vZGVzICYmIG9iai5jaGlsZE5vZGVzLmxlbmd0aCkgeyBzICs9ICcuLi4nOyB9XG4gICAgICAgIHMgKz0gJzwvJyArICR0b0xvd2VyQ2FzZS5jYWxsKFN0cmluZyhvYmoubm9kZU5hbWUpKSArICc+JztcbiAgICAgICAgcmV0dXJuIHM7XG4gICAgfVxuICAgIGlmIChpc0FycmF5KG9iaikpIHtcbiAgICAgICAgaWYgKG9iai5sZW5ndGggPT09IDApIHsgcmV0dXJuICdbXSc7IH1cbiAgICAgICAgdmFyIHhzID0gYXJyT2JqS2V5cyhvYmosIGluc3BlY3QpO1xuICAgICAgICBpZiAoaW5kZW50ICYmICFzaW5nbGVMaW5lVmFsdWVzKHhzKSkge1xuICAgICAgICAgICAgcmV0dXJuICdbJyArIGluZGVudGVkSm9pbih4cywgaW5kZW50KSArICddJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gJ1sgJyArICRqb2luLmNhbGwoeHMsICcsICcpICsgJyBdJztcbiAgICB9XG4gICAgaWYgKGlzRXJyb3Iob2JqKSkge1xuICAgICAgICB2YXIgcGFydHMgPSBhcnJPYmpLZXlzKG9iai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SBwYXJ0cy5sZW5ndGg7IC8vIFRoZSBlc2xpbnQgc2V0dGluZ3MgZG8gbm90IGFsbG93IGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZm9yIChpID0gMDsgaSA8IHBhcnRzLmxlbmd0aDsgKytpKSB7XG4gICAgICAgIGlmIChpID09PSBza2lwSW5kZXgpIHtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG4gICAgICAgIHZhciBwYXJ0ID0gcGFydHNbaV07XG5cbiAgICAgICAgdmFyIGJyYWNrZXRFcXVhbHNQb3MgPSBwYXJ0LmluZGV4T2YoJ109Jyk7XG4gICAgICAgIHZhciBwb3MgPSBicmFja2V0RXF1YWxzUG9zID09PSAtMSA/IHBhcnQuaW5kZXhPZignPScpIDogYnJhY2tldEVxdWFsc1BvcyArIDE7XG5cbiAgICAgICAgdmFyIGtleSwgdmFsO1xuICAgICAgICBpZiAocG9zID09PSAtMSkge1xuICAgICAgICAgICAga2V5ID0gb3B0aW9ucy5kZWNvZGVyKHBhcnQsIGRlZmF1bHRzLmRlY29kZXIsIGNoYXJzZXQsICdrZXknKTtcbiAgICAgICAgICAgIHZhbCA9IG9wdGlvbnMuc3RyaWN0TnVsbEhhbmRsaW5nID8gbnVsbCA6ICcnO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAga2V5ID0gb3B0aW9ucy5kZWNvZGVyKHBhcnQuc2xpY2UoMCwgcG9zKSwgZGVmYXVsdHMuZGVjb2RlciwgY2hhcnNldCwgJ2tleScpO1xuICAgICAgICAgICAgdmFsID0gdXRpbHMubWF5YmVNYXAoXG4gICAgICAgICAgICAgICAgcGFyc2VBcnJheVZhbHVlKHBhcnQuc2xpY2UocG9zICsgMSksIG9wdGlvbnMpLFxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIChlbmNvZGVkVmFsKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBvcHRpb25zLmRlY29k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YXQobGVhZik7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvYmogPSBvcHRpb25zLnBsYWluT2JqZWN0cyA/IE9iamVjdC5jcmVhdGUobnVsbCkgOiB7fTtcbiAgICAgICAgICAgIHZhciBjbGVhblJvb3QgPSByb290LmNoYXJBdCgwKSA9PT0gJ1snICYmIHJvb3QuY2hhckF0KHJvb3QubGVuZ3RoIC0gMSkgPT09ICddJyA/IHJvb3Quc2xpY2UoMSwgLTEpIDogcm9vdDtcbiAgICAgICAgICAgIHZhciBpbmRleCA9IHBhcnNlSW50KGNsZWFuUm9vdCwgMTApO1xuICAgICAgICAgICAgaWYgKCFvcHRpb25zLnBhcnNlQXJyYXlzICYmIGNsZWFuUm9vdCA9PT0gJycpIHtcbiAgICAgICAgICAgICAgICBvYmogPSB7IDA6IGxlYWYgfTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoXG4gICAgICAgICAgICAgICAgIWlzTmFOKGluZGV4KVxuICAgICAgICAgICAgICAgICYmIHJvb3QgIT09IGNsZWFuUm9vdFxuICAgICAgICAgICAgICAgICYmIFN0cmluZyhpbmRleCkgPT09IGNsZWFuUm9vdFxuICAgICAgICAgICAgICAgICYmIGluZGV4ID49IDBcbiAgICAgICAgICAgICAgICAmJiAob3B0aW9ucy5wYXJzZUFycmF5cyAmJiBpbmRleCA8PSBvcHRpb25zLmFycmF5TGltaXQpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBvYmogPSBbXTtcbiAgICAgICAgICAgICAgICBvYmpbaW5kZXhdID0gbGVhZjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY2xlYW5Sb290ICE9PSAnX19wcm90b19fJykge1xuICAgICAgICAgICAgICAgIG9ialtjbGVhblJvb3RdID0gbGVhZjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGxlYWYgPSBvYmo7XG4gICAgfVxuXG4gICAgcmV0dXJuIGxlYWY7XG59O1xuXG52YXI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zLmFsbG93UHJvdG90eXBlcykge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGtleXMucHVzaChwYXJlbnQpO1xuICAgIH1cblxuICAgIC8vIExvb3AgdGhyb3VnaCBjaGlsZHJlbiBhcHBlbmRpbmcgdG8gdGhlIGFycmF5IHVudGlsIHdlIGhpdCBkZXB0aFxuXG4gICAgdmFyIGkgPSAwO1xuICAgIHdoaWxlIChvcHRpb25zLmRlcHRoID4gMCAmJiAoc2VnbWVudCA9IGNoaWxkLmV4ZWMoa2V5KSkgIT09IG51bGwgJiYgaSA8IG9wdGlvbnMuZGVwdGgpIHtcbiAgICAgICAgaSArPSAxO1xuICAgICAgICBpZiAoIW9wdGlvbnMucGxhaW5PYmplY3RzICYmIGhhcy5jYWxsKE9iamVjdC5wcm90b3R5cGUsIHNlZ21lbnRbMV0uc2xpY2UoMSwgLTEpKSkge1xuICAgICAgICAgICAgaWYgKCFvcHRpb25zLmFsbG93UHJvdG90eXBlcykge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBrZXlzLnB1c2goc2VnbWVudFsxXSk7XG4gICAgfVxuXG4gICAgLy8gSWYgdGhlcmUncyBhIHJlbWFpbmRlciwganVzdCBhZGQgd2hhdGV2ZXIgaXMgbGVmdFxuXG4gICAgaWYgKHNlZ21lbnQpIHtcbiAgICAgICAga2V5cy5wdXNoKCdbJyArIGtleS5zbGljZShzZWdtZW50LmluZGV4KSArICddJyk7XG4gICAgfVxuXG4gICAgcmV0dXJuIHBhcnNlT2JqZWN0KGtleXMsIHZhbCwgb3B0aW9ucywgdmFsdWVzUGFyc2VkKTtcbn07XG5cbnZhciBub3JtYWxpemVQYXJzZU9wdGlvbnMgPSBmdW5jdGlvbiBub3JtYWxpemVQYXJzZU9wdGlvbnMob3B0cykge1xuICAgIGlmICghb3B0cykge1xuICAgICAgICByZXR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sZSAoKHRtcFNjID0gdG1wU2MuZ2V0KHNlbnRpbmVsKSkgIT09IHZvaWQgdW5kZWZpbmVkICYmICFmaW5kRmxhZykge1xuICAgICAgICAvLyBXaGVyZSBvYmplY3QgbGFzdCBhcHBlYXJlZCBpbiB0aGUgcmVmIHRyZWVcbiAgICAgICAgdmFyIHBvcyA9IHRtcFNjLmdldChvYmplY3QpO1xuICAgICAgICBzdGVwICs9IDE7XG4gICAgICAgIGlmICh0eXBlb2YgcG9zICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKHBvcyA9PT0gc3RlcCkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBSYW5nZUVycm9yKCdDeWNsaWMgb2JqZWN0IHZhbHVlJyk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGZpbmRGbGFnID0gdHJ1ZTsgLy8gQnJlYWsgd2hpbGVcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIHRtcFNjLmdldChzZW50aW5lbCkgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBzdGVwID0gMDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlmICh0eXBlb2YgZmlsdGVyID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgIG9iaiA9IGZpbHRlcihwcmVmaXgsIG9iaik7XG4gICAgfSBlbHNlIGlmIChvYmogaW5zdGFuY2VvZiBEYXRlKSB7XG4gICAgICAgIG9iaiA9IHNlcmlhbGl6ZURhdGUob2JqKTtcbiAgICB9IGVsc2UgaWYgKGdlbmVyYXRlQXJyYXlQcmVmaXggPT09ICdjb21tYScgJiYgaXNBcnJheShvYmopKSB7XG4gICAgICAgIG9iaiA9IHV0aWxzLm1heWJlTWFwKG9iaiwgZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICBpZiAodmFsdWUgaW5zdGFuY2VvZiBEYXRlKSB7XG4gICAgICAgICAgIC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leXM7XG4gICAgaWYgKGdlbmVyYXRlQXJyYXlQcmVmaXggPT09ICdjb21tYScgJiYgaXNBcnJheShvYmopKSB7XG4gICAgICAgIC8vIHdlIG5lZWQgdG8gam9pbiBlbGVtZW50cyBpblxuICAgICAgICBpZiAoZW5jb2RlVmFsdWVzT25seSAmJiBlbmNvZGVyKSB7XG4gICAgICAgICAgICBvYmogPSB1dGlscy5tYXliZU1hcChvYmosIGVuY29kZXIpO1xuICAgICAgICB9XG4gICAgICAgIG9iaktleXMgPSBbeyB2YWx1ZTogb2JqLmxlbmd0aCA+IDAgPyBvYmouam9pbignLCcpIHx8IG51bGwgOiB2b2lkIHVuZGVmaW5lZCB9XTtcbiAgICB9IGVsc2UgaWYgKGlzQXJyYXkoZmlsdGVyKSkge1xuICAgICAgICBvYmpLZXlzID0gZmlsdGVyO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHZhciBrZXlzID0gT2JqZWN0LmtleXMob2JqKTtcbiAgICAgICAgb2JqS2V5cyA9IHNvcnQgPyBrZXlzLnNvcnQoc29ydCkgOiBrZXlzO1xuICAgIH1cblxuICAgIHZhciBhZGp1c3RlZFByZWZpeCA9IGNvbW1hUm91bmRUcmlwICYmIGlzQXJyYXkob2JqKSAmJiBvYmoubGVuZ3RoID09PSAxID8gcHJlZml4ICsgJ1tdJyA6IHByZWZpeDtcblxuICAgIGZvciAodmFyIGogPSAwOyBqIDwgb2JqS2V5cy5sZW5ndGg7ICsraikge1xuICAgICAgICB2YXIga2V5ID0gb2JqS2V5c1tqXTtcbiAgICAgICAgdmFyIHZhbHVlID0gdHlwZW9mIGtleSA9PT0gJ29iamVjdCcgJiYgdHlwZW9mIGtleS52YWx1ZSAhPT0gJ3VuZGVmaW5lZCcgPyBrZXkudmFsdWUgOiBvYmpba2V5XTtcblxuICAgICAgICBpZiAoc2tpcE51bGxzICYmIHZhbHVlID09PSBudWxsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgIC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ucy5lbmNvZGVyIDogbnVsbCxcbiAgICAgICAgICAgIG9wdGlvbnMuZmlsdGVyLFxuICAgICAgICAgICAgb3B0aW9ucy5zb3J0LFxuICAgICAgICAgICAgb3B0aW9ucy5hbGxvd0RvdHMsXG4gICAgICAgICAgICBvcHRpb25zLnNlcmlhbGl6ZURhdGUsXG4gICAgICAgICAgICBvcHRpb25zLmZvcm1hdCxcbiAgICAgICAgICAgIG9wdGlvbnMuZm9ybWF0dGVyLFxuICAgICAgICAgICAgb3B0aW9ucy5lbmNvZGVWYWx1ZXNPbmx5LFxuICAgICAgICAgICAgb3B0aW9ucy5jaGFyc2V0LFxuICAgICAgICAgICAgc2lkZUNoYW5uZWxcbiAgICAgICAgKSk7XG4gICAgfVxuXG4gICAgdmFyIGpvaW5lZCA9IGtleXMuam9pbihvcHRpb25zLmRlbGltaXRlcik7XG4gICAgdmFyIHByZWZpeCA9IG9wdGlvbnMuYWRkUXVlcnlQcmVmaXggPT09IHRydWUgPyAnPycgOiAnJztcblxuICAgIGlmIChvcHRpb25zLmNoYXJzZXRTZW50aW5lbCkge1xuICAgICAgICBpZiAob3B0aW9ucy5jaGFyc2V0ID09PSAnaXNvLTg4NTktMScpIHtcbiAgICAgICAgICAgIC8vIGVuY29kZVVSSUNvbXBvbmVudCgnJiMxMDAwMzsnKSwgdGhlIFwibnVtZXJpYyBlbnRpdHlcIiByZXByZXNlbnRhdGlvbiBvZiBhIGNoZWNrbWFya1xuICAgICAgICAgICAgcHJlZml4ICs9ICd1dGY4PSUyNiUyMzEwMDAzJTNCJic7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBlbmNvZGVVUklDb21wb25lbnQoJ+KckycpXG4gICAgICAgICAgICBwcmVmaXggKz0gJ3V0Zjg9JUUyJTlDJTkzJic7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gam9pbmVkLmxlbmd0aCA+IDAgPyBwcmVmaXggKyBqb2luZWQgOiAnJztcbn07XG4i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DsgaSA8IHN0cmluZy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIgYyA9IHN0cmluZy5jaGFyQ29kZUF0KGkpO1xuXG4gICAgICAgIGlmIChcbiAgICAgICAgICAgIGMgPT09IDB4MkQgLy8gLVxuICAgICAgICAgICAgfHwgYyA9PT0gMHgyRSAvLyAuXG4gICAgICAgICAgICB8fCBjID09PSAweDVGIC8vIF9cbiAgICAgICAgICAgIHx8IGMgPT09IDB4N0UgLy8gflxuICAgICAgICAgICAgfHwgKGMgPj0gMHgzMCAmJiBjIDw9IDB4MzkpIC8vIDAtOVxuICAgICAgICAgICAgfHwgKGMgPj0gMHg0MSAmJiBjIDw9IDB4NUEpIC8vIGEtelxuICAgICAgICAgICAgfHwgKGMgPj0gMHg2MSAmJiBjIDw9IDB4N0EpIC8vIEEtWlxuICAgICAgICAgICAgfHwgKGZvcm1hdCA9PT0gZm9ybWF0cy5SRkMxNzM4ICYmIChjID09PSAweDI4IHx8IGMgPT09IDB4MjkpKSAvLyAoIClcbiAgICAgICAgKSB7XG4gICAgICAgICAgICBvdXQgKz0gc3RyaW5nLmNoYXJBdChpKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGMgPCAweDgwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyBoZXhUYWJsZVtjXTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGMgPCAweDgwMCkge1xuICAgICAgICAgICAgb3V0ID0gb3V0ICsgKGhleFRhYmxlWzB4QzAgfCAoYyA+PiA2KV0gKyBoZXhUYWJsZVsweDgwIHwgKGMgJiAweDNGKV0pO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4RDgwMCB8fCBjID49IDB4RTAwMCkge1xuICAgICAgICAgICAgb3V0ID0gb3V0ICsgKGhleFRhYmxlWzB4RTAgfCAoY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dGFtcCArPSAxO1xuICAgICAgICBjb25zdCBsb2MgPSB0aGlzLmxlbigpO1xuICAgICAgICB0aGlzLmhlYXAucHVzaCh7IHZhbHVlLCB0aW1lc3RhbXA6IHRoaXMudGltZXN0YW1wLCBrZXkgfSk7XG4gICAgICAgIHRoaXMudXBkYXRlVXAobG9jKTtcbiAgICB9XG4gICAgcG9wKCkge1xuICAgICAgICBpZiAodGhpcy5sZW4oKSA9PSAwKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJubyBlbGVtZW50IHRvIHBvcFwiKTtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCB0b3AgPSB0aGlzLmhlYXBbMF07XG4gICAgICAgIGlmICh0aGlzLmxlbigpID4gMSkge1xuICAgICAgICAgICAgdGhpcy5oZWFwWzBdID0gdGhpcy5oZWFwLnBvcCgpO1xuICAgICAgICAgICAgdGhpcy51cGRhdGVEb3duKDApO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5oZWFwLnBvcCgpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0b3A7XG4gICAgfVxuICAgIGZpbmQodikge1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRoaXMubGVuKCk7IGkrKykge1xuICAgICAgICAgICAgaWYgKHYgPT0gdGhpcy5oZWFwW2ldLnZhbHVlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuaGVhcFtpXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG4gICAgcmVtb3ZlKHYpIHtcbiAgICAgICAgbGV0IGluZGV4ID0gbnVsbDtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aGlzLmxlbigpOyBpKyspIHtcbiAgICAgICAgICAgIGlmICh2ID09IHRoaXMuaGVhcFtpXS52YWx1ZSkge1xuICAgICAgICAgICAgICAgIGluZGV4ID0gaT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ldID0gdDtcbiAgICB9XG4gICAgbWluTm9kZShudW1iZXJzKSB7XG4gICAgICAgIGNvbnN0IHZhbGlkbnVtYmVycyA9IG51bWJlcnMuZmlsdGVyKHRoaXMuZXhpc3ROb2RlLmJpbmQodGhpcykpO1xuICAgICAgICBsZXQgbWluaW1hbCA9IHZhbGlkbnVtYmVyc1swXTtcbiAgICAgICAgZm9yIChjb25zdCBpIG9mIHZhbGlkbnVtYmVycykge1xuICAgICAgICAgICAgaWYgKHRoaXMubGVzc1RoYW4odGhpcy5oZWFwW2ldLCB0aGlzLmhlYXBbbWluaW1hbF0pKSB7XG4gICAgICAgICAgICAgICAgbWluaW1hbCA9IGk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG1pbmltYWw7XG4gICAgfVxuICAgIHVwZGF0ZVVwKHgpIHtcbiAgICAgICAgaWYgKHggPT0gMCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGNvbnN0IHBhcmVudCA9IHRoaXMucGFyZW50Tm9kZSh4KTtcbiAgICAgICAgaWYgKHRoaXMuZXhpc3ROb2RlKHBhcmVudCkgJiYgdGhpcy5sZXNzVGhhbih0aGlzLmhlYXBbeF0sIHRoaXMuaGVhcFtwYXJlbnRdKSkge1xuICAgICAgICAgICAgdGhpcy5zd2FwKHgsIHBhcmVudCk7XG4gICAgICAgICAgICB0aGlzLnVwZGF0ZVVwKHBhcmVudCk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgdXBkYXRlRG93bih4KSB7XG4gICAgICAgIGNvbnN0IGxlZnRDaGlsZCA9IHRoaXMubGVmdENoaWxkTm9kZSh4KTtcbiAgICAgICAgY29uc3QgcmlnaHRDaGlsZCA9IHRoaXMucmlnaHRDaGlsZE5vZGUoeCk7XG4gICAgICAgIGlmICghdGhpcy5leGlzdE5vZGUobGVmdENoaWxkKSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGNvbnN0IG0gPSB0aGlzLm1pbk5vZGUoW3gsIGxlZnRDaGlsZCwgcmlnaHRDaGlsZF0pO1xuICAgICAgICBpZiAobSAhPSB4KSB7XG4gICAgICAgICAgICB0aGlzLnN3YXAoeCwgbSk7XG4gICAgICAgICAgICB0aGlzLnVwZGF0ZURvd24obSk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgZGVidWdQcmludCgpIHtcbiAgICAgICAgY29uc29sZS5sb2codGhpcy5oZWFwKTtcbiAgICB9XG59XG4iLCJpbXBvcnQgeyBjbGFtcCB9IGZyb20gXCIuL3V0aWwuanNcIjtcbmltcG9ydCBSTkcgZnJvbSBcIi4vcm5nLmpzXCI7XG5leHBvcnQgZnVuY3Rpb24gZnJvbVN0cmluZyhzdHIpIHtcbiAgICBsZXQgY2FjaGVkLCByO1xuICAgIGlmIChzdHIgaW4gQ0FDSEUpIHtcbiAgICAgICAgY2FjaGVkID0gQ0FDSEVbc3RyXTtcbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICAgIGlmIChzdHIuY2hhckF0KDApID09IFwiI1wiKSB7IC8vIGhleCByZ2JcbiAgICAgICAgICAgIGxldCBtYXRjaGVkID0gc3RyLm1hdGNoKC9bMC05YS1mXS9naSkgfHwgW107XG4gICAgICAgICAgICBsZXQgdmFsdWVzID0gbWF0Y2hlZC5tYXAoKHgpID0+IHBhcnNlSW50KHgsIDE2KSk7XG4gICAgICAgICAgICBpZiAodmFsdWVzLmxlbmd0aCA9PSAzKSB7XG4gICAgICAgICAgICAgICAgY2FjaGVkID0gdmFsdWVzLm1hcCgoeCkgPT4geCAqIDE3KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMzsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlc1tpICsgMV0gKz0gMTYgKiB2YWx1ZXNbaV07XG4gICAgICAgICAgICAgICAgICAgIHZ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AgICAgICAgaCA9IChnIC0gYikgLyBkICsgKGcgPCBiID8gNiA6IDApO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSBnOlxuICAgICAgICAgICAgICAgIGggPSAoYiAtIHIpIC8gZCArIDI7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIGI6XG4gICAgICAgICAgICAgICAgaCA9IChyIC0gZykgLyBkICsgNDtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBoIC89IDY7XG4gICAgfVxuICAgIHJldHVybiBbaCwgcywgbF07XG59XG5mdW5jdGlvbiBodWUycmdiKHAsIHEsIHQpIHtcbiAgICBpZiAodCA8IDApXG4gICAgICAgIHQgKz0gMTtcbiAgICBpZiAodCA+IDEpXG4gICAgICAgIHQgLT0gMTtcbiAgICBpZiAodCA8IDEgLyA2KVxuICAgICAgICByZXR1cm4gcCArIChxIC0gcCkgKiA2ICogdDtcbiAgICBpZiAodCA8IDEgLyAyKVxuICAgICAgICByZXR1cm4gcTtcbiAgICBpZiAodCA8IDIgLyAzKVxuICAgICAgICByZXR1cm4gcCArIChxIC0gcCkgKiAoMiAvIDMgLSB0KSAqIDY7XG4gICAgcmV0dXJuIHA7XG59XG4vKipcbiAqIENvbnZlcnRzIGFuIEhTTCBjb2xvciB2YWx1ZSB0byBSR0IuIEV4cGVjdHMgMC4uMSBpbnB1dHMsIHByb2R1Y2VzIDAuLjI1NSBvdXRwdXRzLlxuICovXG5leHBvcnQgZnVuY3Rpb24gaHNsMnJnYihjb2xvcikge1xuICAgIGxldCBsID0gY29sb3JbMl07XG4gICAgaWYgKGNvbG9yWzFdID09IDApIHtcbiAgICAgICAgbCA9IE1hdGgucm91bmQobCAqIDI1NSk7XG4gICAgICAgIHJldHVybiBbbCwgbCwgbF07XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgICBsZXQgcyA9IGNvbG9yWzFdO1xuICAgICAgICBsZX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93biBhcnJvdy4gKi9cbiAgICBWS19ET1dOOiA0MCxcbiAgICAvKiogUHJpbnQgU2NyZWVuIGtleS4gKi9cbiAgICBWS19QUklOVFNDUkVFTjogNDQsXG4gICAgLyoqIElucyhlcnQpIGtleS4gKi9cbiAgICBWS19JTlNFUlQ6IDQ1LFxuICAgIC8qKiBEZWwoZXRlKSBrZXkuICovXG4gICAgVktfREVMRVRFOiA0NixcbiAgICAvKioqL1xuICAgIFZLXzA6IDQ4LFxuICAgIC8qKiovXG4gICAgVktfMTogNDksXG4gICAgLyoqKi9cbiAgICBWS18yOiA1MCxcbiAgICAvKioqL1xuICAgIFZLXzM6IDUxLFxuICAgIC8qKiovXG4gICAgVktfNDogNTIsXG4gICAgLyoqKi9cbiAgICBWS181OiA1MyxcbiAgICAvKioqL1xuICAgIFZLXzY6IDU0LFxuICAgIC8qKiovXG4gICAgVktfNzogNTUsXG4gICAgLyoqKi9cbiAgICBWS184OiA1NixcbiAgICAvKioqL1xuICAgIFZLXzk6IDU3LFxuICAgIC8qKiBDb2xvbiAoOikga2V5LiBSZXF1aXJlcyBHZWNrbyAxNS4wICovXG4gICAgVktfQ09MT046IDU4LFxuICAgIC8qKiBTZW1pY29sb24gKDspIGtleS4gKi9cbiAgICBWS19TRU1JQ09MT046IDU5LFxuICAgIC8qKiBMZXNzLXRoYW4gKDwpIGtleS4gUmVxdWlyZXMgR2Vja28gMTUuMCAqL1xuICAgIFZLX0xFU1NfVEhBTjogNjAsXG4gICAgLyoqIEVxdWFscyAoPSkga2V5LiAqL1xuICAgIFZLX0VRVUFMUzogNjEsXG4gICAgLyoqIEdyZWF0ZXItdGhhbiAoPikga2V5LiBSZXF1aXJlcyBHZWNrbyAxNS4wICovXG4gICAgVktfR1JFQVRFUl9USEFOOiA2MixcbiAgICAvKiogUXVlc3Rpb24gbWFyayAoPykga2V5LiBSZXF1aXJlcyBHZWNrbyAxNS4wICovXG4gICAgVktfUVVFU1RJT05fTUFSSzogNjMsXG4gICAgLyoqIEF0bWFyayAoQCkga2V5LiBSZXF1aXJlcyBHZWNrbyAxNS4wICovXG4gICAgVktfQVQ6IDY0LFxuICAgIC8qKiovXG4gICAgVktfQTogNjUsXG4gICAgLyoqKi9cbiAgICBWS19COiA2NixcbiAgICAvKioqL1xuICAgIFZLX0M6IDY3LFxuICAgIC8qKiovXG4gICAgVktfRDogNjgsXG4gICAgLyoqKi9cbiAgICBWS19FOiA2OSxcbiAgICAvKioqL1xuICAgIFZLX0Y6IDcwLFxuICAgIC8qKiovXG4gICAgVktfRzogNzEsXG4gICAgLyoqKi9cbiAgICBWS19IOiA3MixcbiAgICAvKioqL1xuICAgIFZLX0k6IDczLFxuICAgIC8qKiovXG4gICAgVktfSjogNzQsXG4gICAgLyoqKi9cbiAgICBWS19LOiA3NSxcbiAgICAvKioqL1xuICAgIFZLX0w6IDc2LFxuICAgIC8qKiovXG4gICAgVktfTTogNzcsXG4gICAgLyoqKi9cbiAgICBWS19OOiA3OCxcbiAgICAvKioqL1xuICAgIFZLX086IDc5LFxuICAgIC8qKiovXG4gICAgVktfUDogODAsXG4gICAgLyoqKi9cbiAgICBWS19ROiA4MSxcbiAgICAvKioqL1xuICAgIFZLX1I6IDgyLFxuICAgIC8qKiovXG4gICAgVktfUzogODMsXG4gICAgLyoqKi9cbiAgICBWS19UOiA4NCxcbiAgICAvKioqL1xuICAgIFZLX1U6IDg1LFxuICAgIC8qKiovXG4gICAgVktfVjogODYsXG4gICAgLyoqKi9cbiAgICBWS19XOiA4NyxcbiAgICAvKioqL1xuICAgIFZLX1g6IDg4LFxuICAgIC8qKiovXG4gICAgVktfWTogODksXG4gICAgLyoqKi9cbiAgICBWS19aOiA5MCxcbiAgICAvKioqL1xuICAgIFZLX0NPTlRFWFRfTUVOVTogOTMsXG4gICAgLyoqIDAgb24gdGhlIG51bWVyaWMga2V5cGFkLiAqL1xuICAgIFZLX05VTVBBRDA6IDk2LFxuICAgIC8qKiAxIG9uIHRoZSBudW1lcmljIGtleXBhZC4gK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0gW3RoaXMuX29wdGlvbnMuYmcsIHRoaXMuX29wdGlvbnMuZmddO1xuICAgICAgICAgICAgdGhpcy5kcmF3KHgsIHksIG51bGwsIG51bGwsIGNvbG9yc1t3aGF0ICUgY29sb3JzLmxlbmd0aF0pO1xuICAgICAgICB9XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBDbGVhciB0aGUgd2hvbGUgZGlzcGxheSAoY292ZXIgaXQgd2l0aCBiYWNrZ3JvdW5kIGNvbG9yKVxuICAgICAgICAgKi9cbiAgICAgICAgY2xlYXIoKSB7XG4gICAgICAgICAgICB0aGlzLl9kYXRhID0ge307XG4gICAgICAgICAgICB0aGlzLl9kaXJ0eSA9IHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBzZWUgUk9ULkRpc3BsYXlcbiAgICAgICAgICovXG4gICAgICAgIHNldE9wdGlvbnMob3B0aW9ucykge1xuICAgICAgICAgICAgT2JqZWN0LmFzc2lnbih0aGlzLl9vcHRpb25zLCBvcHRpb25zKTtcbiAgICAgICAgICAgIGlmIChvcHRpb25zLndpZHRoIHx8IG9wdGlvbnMuaGVpZ2h0IHx8IG9wdGlvbnMuZm9udFNpemUgfHwgb3B0aW9ucy5mb250RmFtaWx5IHx8IG9wdGlvbnMuc3BhY2luZyB8fCBvcHRpb25zLmxheW91dCkge1xuICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLmxheW91dCkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgY3RvciA9IEJBQ0tFTkRTW29wdGlvbnMubGF5b3V0XTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fYmFja2VuZCA9IG5ldyBjdG9yKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMuX2JhY2tlbmQuc2V0T3B0aW9ucyh0aGlzLl9vcHRpb25zKTtcbiAgICAgICAgICAgICAgICB0aGlzLl9kaXJ0eSA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAg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BlKSB7XG4gICAgICAgICAgICAgICAgeCA9IGUudG91Y2hlc1swXS5jbGllbnRYO1xuICAgICAgICAgICAgICAgIHkgPSBlLnRvdWNoZXNbMF0uY2xpZW50WTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHggPSBlLmNsaWVudFg7XG4gICAgICAgICAgICAgICAgeSA9IGUuY2xpZW50WTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9iYWNrZW5kLmV2ZW50VG9Qb3NpdGlvbih4LCB5KTtcbiAgICAgICAgfVxuICAgICAgICAvKipcbiAgICAgICAgICogQHBhcmFtIHtpbnR9IHhcbiAgICAgICAgICogQHBhcmFtIHtpbnR9IHlcbiAgICAgICAgICogQHBhcmFtIHtzdHJpbmcgfHwgc3RyaW5nW119IGNoIE9uZSBvciBtb3JlIGNoYXJzICh3aWxsIGJlIG92ZXJsYXBwaW5nIHRoZW1zZWx2ZXMpXG4gICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBbZmddIGZvcmVncm91bmQgY29sb3JcbiAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IFtiZ10gYmFja2dyb3VuZCBjb2xvclxuICAgICAgICAgKi9cbiAgICAgICAgZHJhdyh4LCB5LCBjaCwgZmcsIGJnKSB7XG4gICAgICAgICAgICBpZiAoIWZnKSB7XG4gICAgICAgICAgICAgICAgZmcgPSB0aGlzLl9vcHRpb25zLmZnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFiZykge1xuICAgICAgICAgICAgICAgIGJnID0gdGhpcy5fb3B0aW9ucy5iZztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBrZXkgPSBgJHt4fSwke3l9YDtcbiAgICAgICAgICAgIHRoaXMuX2RhdGFba2V5XSA9IFt4LCB5LCBjaCwgZmcsIGJnXTtcbiAgICAgICAgICAgIGlmICh0aGlzLl9kaXJ0eSA9PT0gdHJ1ZSkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH0gLy8gd2lsbCBhbHJlYWR5IHJlZHJhdyBldmVyeXRoaW5nIFxuICAgICAgICAgICAgaWYgKCF0aGlzLl9kaXJ0eSkge1xuICAgICAgICAgICAgICAgIHRoaXMuX2RpcnR5ID0ge307XG4gICAgICAgICAgICB9IC8vIGZpcnN0IVxuICAgICAgICAgICAgdGhpcy5fZGlydHlba2V5XSA9IHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBwYXJhbSB7aW50fSB4XG4gICAgICAgICAqIEBwYXJhbSB7aW50fSB5XG4gICAgICAgICAqIEBwYXJhbSB7c3RyaW5nIHx8IHN0cmluZ1tdfSBjaCBPbmUgb3IgbW9yZSBjaGFycyAod2lsbCBiZSBvdmVybGFwcGluZyB0aGVtc2VsdmVzKVxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZyB8fCBudWxsfSBbZmddIGZvcmVncm91bmQgY29sb3JcbiAgICAgICAgICogQHBhcmFtIHtzdHJpbmcgfHwgbnVsbH0gW2JnXSBiYWNrZ3JvdW5kIGNvbG9yXG4gICAgICAgICAqL1xuICAgICAgICBkcmF3T3Zlcih4LCB5LCBjaCwgZmcsIGJnKSB7XG4gICAgICAgICAgICBjb25zdCBrZXkgPSBgJHt4fSwke3l9YDtcbiAgICAgICAgICAgIGNvbnN0IGV4aXN0aW5nID0gdGhpcy5fZGF0YVtrZXldO1xuICAgICAgICAgICAgaWYgKGV4aXN0aW5nKSB7XG4gICAgICAgICAgICAgICAgZXhpc3RpbmdbMl0gPSBjaCB8fCBleGlzdGluZ1syXTtcbiAgICAgICAgICAgICAgICBleGlzdGluZ1szXSA9IGZnIHx8IGV4aXN0aW5nWzNdO1xuICAgICAgICAgICAgICAgIGV4aXN0aW5nWzRdID0gYmcgfHwgZXhpc3RpbmdbNF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLmRyYXcoeCwgeSwgY2gsIGZnLCBiZyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLyoqXG4gICAgICAgICAqIERyYXdzIGEgdGV4dCBhdCBnaXZlbiBwb3NpdGlvbi4gT3B0aW9uYWxseSB3cmFwcyBhdCBhIG1heGltdW0gbGVuZ3RoLiBDdXJyZW50bHkgZG9lcyBub3Qgd29yayB3aXRoIGhleCBsYXlvdXQuXG4gICAgICAgICAqIEBwYXJhbSB7aW50fSB4XG4gICAgICAgICAqIEBwYXJhbSB7aW50fSB5XG4gICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSB0ZXh0IE1heSBjb250YWluIGNvbG9yL2JhY2tncm91bmQgZm9ybWF0IHNwZWNpZmllcnMsICVje25hbWV9LyVie25hbWV9LCBib3RoIG9wdGlvbmFsLiAlY3t9LyVie30gcmVzZXRzIHRvIGRlZmF1bHQuXG4gICAgICAgICAqIEBwYXJhbSB7aW50fSBbbWF4V2lkdGhdIHdyYXAgYXQgd2hhdCB3aWR0aD9cbiAgICAgICAgICogQHJldHVybnMge2ludH0gbGluZXMgZHJhd25cbiAgICAgICAgICovXG4gICAgICAgIGRyYXdUZXh0KHgsIHksIHRleHQsIG1heFdpZHRoKSB7XG4gICAgICAgICAgICBsZXQgZmcgPSBudWxsO1xuICAgICAgICAgICAgbGV0IGJnID0gbnVsbDtcbiAgICAgICAgICAgIGxldCBjeCA9IHg7XG4gICAgICAgICAgICBsZXQgY3kgPSB5O1xuICAgICAgICAgICAgbGV0IGxpbmVzID0gMTtcbiAgICAgICAgICAgIGlmICghbWF4V2lkdGgpIHtcbiAgICAgICAgICAgICAgICBtYXhXaWR0aCA9IHRoaXMuX29wdGlvbnMud2lkdGggLSB4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHRva2VucyA9IFRleHQudG9rZW5pemUodGV4dCwgbWF4V2lkdGgpO1xuICAgICAgICAgICAgd2hpbGUgKHRva2Vucy5sZW5ndGgpIHsgLy8gaW50ZXJwcmV0IHRva2VuaXplZCBvcGNvZGUgc3RyZWFtXG4gICAgICAgICAgICAgICAgbGV0IHRva2VuID0gdG9rZW5zLnNoaWZ0KCk7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh0b2tlbi50eXBlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgVGV4dC5UWVBFX1RFWFQ6XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaXNTcGFjZSA9IGZhbHNlLCBpc1ByZXZTcGFjZSA9IGZhbHNlLCBpc0Z1bGxXaWR0aCA9IGZhbHNlLCBpc1ByZXZGdWxsV2lkdGggPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdG9rZW4udmFsdWUubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgY2MgPSB0b2tlbi52YWx1ZS5jaGFyQ29kZUF0KGkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjID0gdG9rZW4udmFsdWUuY2hhckF0KGkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9vcHRpb25zLmxheW91dCA9PT0gXCJ0ZXJtXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNjaCA9IGNjID4+IDg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpc0NKSyA9IGNjaCA9PT0gMHgxMSB8fCAoY2NoID49IDB4MmUgJiYgY2NoIDw9IDB4OWYpIHx8IChjY2ggPj0gMHhhYyAmJiBjY2ggPD0gMHhkNykgfHwgKGNjID49IDB4QTk2MCAmJiBjYyA8PSAweEE5N0YpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNDSkspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZHJhdyhjeCArIDAsIGN5LCBjLCBmZywgYmcpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kcmF3KGN4ICsgMSwgY3ksIFwiXFx0XCIsIGZnLCBiZyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjeCArPSAyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQXNzaWduIHRvIGB0cnVlYCB3aGVuIHRoZSBjdXJyZW50IGNoYXIgaXMgZnVsbC13aWR0aC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc0Z1bGxXaWR0aCA9IChjYyA+IDB4ZmYwMCAmJiBjYyA8IDB4ZmY2MSkgfHwgKGNjID4gMHhmZmRjICYmIGNjIDwgMHhmZmU4KSB8fCBjYyA+IDB4ZmZlZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBDdXJyZW50IGNoYXIgaXMgc3BhY2UsIHdoYXRldmVyIGZ1bGwtd2lkdGggb3IgaGFsZi13aWR0aCBib3RoIGFyZSBPSy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1NwYWNlID0gKGMuY2hhckNvZGVBdCgwKSA9PSAweDIwIHx8IGMuY2hhckNvZGVBdCgwKSA9PSAweDMwMDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoZSBwcmV2aW91cyBjaGFyIGlzIGZ1bGwtd2lkdGggYW5kXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY3VycmVudCBjaGFyIGlzIG5ldGhlciBoYWxmLXdpZHRoIG5vciBhIHNwYWNlLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc1ByZXZGdWxsV2lkdGggJiYgIWlzRnVsbFdpZHRoICYmICFpc1NwYWNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN4Kys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSAvLyBhZGQgYW4gZXh0cmEgcG9zaXRpb25cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGUgY3VycmVudCBjaGFyIGlzIGZ1bGwtd2lkdGggYW5kXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhlIHByZXZpb3VzIGNoYXIgaXMgbm90IGEgc3BhY2UuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzRnVsbFdpZHRoICYmICFpc1ByZXZTcGFjZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjeCsrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gLy8gYWRkIGFuIGV4dHJhIHBvc2l0aW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kcmF3KGN4KyssIGN5LCBjLCBmZywgYmcpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzUHJldlNwYWNlID0gaXNTcGFjZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1ByZXZGdWxsV2lkdGggPSBpc0Z1bGxXaWR0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIFRleHQuVFlQRV9GRzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGZnID0gdG9rZW4udmFsdWUgfHwgbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIFRleHQuVFlQRV9CRzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGJnID0gdG9rZW4udmFsdWUgfHwgbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIFRleHQuVFlQRV9ORVdMSU5FOlxuICAgICAgICAgICAgICAgICAgICAgICAgY3ggPSB4O1xuICAgICAgICAgICAgICAgICAgICAgICAgY3krKztcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVzKys7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gbGluZXM7XG4gICAgICAgIH1cbiAgICAgICAgLyoqXG4gICAgICAgICAqIFRpbWVyIHRpY2s6IHVwZGF0ZSBkaXJ0eSBwYXJ0c1xuICAgICAgICAgKi9cbiAgICAgICAgX3RpY2soKSB7XG4gICAgICAgICAgICB0aGlzLl9iYWNrZW5kLnNjaGVkdWxlKHRoaXMuX3RpY2spO1xuICAgICAgICAgICAgaWYgKCF0aGlzLl9kaXJ0eSkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0aGlzLl9kaXJ0eSA9PT0gdHJ1ZSkgeyAvLyBkcmF3IGFsbFxuICAgICAgICAgICAgICAgIHRoaXMuX2JhY2tlbmQuY2xlYXIoKTtcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpZCBpbiB0aGlzLl9kYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2RyYXcoaWQsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICB9IC8vIHJlZHJhdyBjYWNoZWQgZGF0YSBcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgeyAvLyBkcmF3IG9ubHkgZGlydHkgXG4gICAgICAgICAgICAgICAgZm9yIChsZXQga2V5IGluIHRoaXMuX2RpcnR5KSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2RyYXcoa2V5LCB0cnVlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLl9kaXJ0eSA9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wO1xuICAgICAgICAgICAgdGhpcy5fc3BhY2luZ1kgPSAwO1xuICAgICAgICAgICAgdGhpcy5fY2FudmFzQ2FjaGUgPSB7fTtcbiAgICAgICAgfVxuICAgICAgICBzZXRPcHRpb25zKG9wdGlvbnMpIHtcbiAgICAgICAgICAgIHN1cGVyLnNldE9wdGlvbnMob3B0aW9ucyk7XG4gICAgICAgICAgICB0aGlzLl9jYW52YXNDYWNoZSA9IHt9O1xuICAgICAgICB9XG4gICAgICAgIGRyYXcoZGF0YSwgY2xlYXJCZWZvcmUpIHtcbiAgICAgICAgICAgIGlmIChSZWN0LmNhY2hlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fZHJhd1dpdGhDYWNoZShkYXRhKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuX2RyYXdOb0NhY2hlKGRhdGEsIGNsZWFyQmVmb3JlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBfZHJhd1dpdGhDYWNoZShkYXRhKSB7XG4gICAgICAgICAgICBsZXQgW3gsIHksIGNoLCBmZywgYmddID0gZGF0YTtcbiAgICAgICAgICAgIGxldCBoYXNoID0gXCJcIiArIGNoICsgZmcgKyBiZztcbiAgICAgICAgICAgIGxldCBjYW52YXM7XG4gICAgICAgICAgICBpZiAoaGFzaCBpbiB0aGlzLl9jYW52YXNDYWNoZSkge1xuICAgICAgICAgICAgICAgIGNhbnZhcyA9IHRoaXMuX2NhbnZhc0NhY2hlW2hhc2hdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IGIgPSB0aGlzLl9vcHRpb25zLmJvcmRlcjtcbiAgICAgICAgICAgICAgICBjYW52YXMgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KFwiY2FudmFzXCIpO1xuICAgICAgICAgICAgICAgIGxldCBjdHggPSBjYW52YXMuZ2V0Q29udGV4dChcIjJkXCIpO1xuICAgICAgICAgICAgICAgIGNhbnZhcy53aWR0aCA9IHRoaXMuX3NwYWNpbmdYO1xuICAgICAgICAgICAgICAgIGNhbnZhcy5oZWlnaHQgPSB0aGlzLl9zcGFjaW5nWTtcbiAgICAgICAgICAgICAgICBjdHguZmlsbFN0eWxlID0gYmc7XG4gICAgICAgICAgICAgICAgY3R4LmZpbGxSZWN0KGIsIGIsIGNhbnZhcy53aWR0aCAtIGIsIGNhbnZhcy5oZWlnaHQgLSBiKTtcbiAgICAgICAgICAgICAgICBpZiAoY2gpIHtcbiAgICAgICAgICAgICAgICAgICAgY3R4LmZpbGxTdHlsZSA9IGZnO1xuICAgICAgICAgICAgICAgICAgICBjdHguZm9udCA9IHRoaXMuX2N0eC5mb250O1xuICAgICAgICAgICAgICAgICAgICBjdHgudGV4dEFsaWduID0gXCJjZW50ZXJcIjtcbiAgICAgICAgICAgICAgICAgICAgY3R4LnRleHRCYXNlbGluZSA9IFwibWlkZGxlXCI7XG4gICAgICAgICAgICAgICAgICAgIGxldCBjaGFycyA9IFtdLmNvbmNhdChjaCk7XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY2hhcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5maWxsVGV4dChjaGFyc1tpXSwgdGhpcy5fc3BhY2luZ1ggLyAyLCBNYXRoLmNlaWwodGhpcy5fc3BhY2luZ1kgLyAyKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5fY2FudmFzQ2FjaGVbaGFzaF0gPSBjYW52YXM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLl9jdHguZHJhd0ltYWdlKGNhbnZhcywgeCAqIHRoaXMuX3NwYWNpbmdYLCB5ICogdGhpcy5fc3BhY2luZ1kpO1xuICAgICAgICB9XG4gICAgICAgIF9kcmF3Tm9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biAgICAgICAgfVxuICAgICAgICBpZiAoZHkgPCAwIHx8IGR5ID49IHNpemVbMV0pIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZHggIT09IHRoaXMuX2N1cnNvclswXSB8fCBkeSAhPT0gdGhpcy5fY3Vyc29yWzFdKSB7XG4gICAgICAgICAgICBwcm9jZXNzLnN0ZG91dC53cml0ZShwb3NpdGlvblRvQW5zaShkeCwgZHkpKTtcbiAgICAgICAgICAgIHRoaXMuX2N1cnNvclswXSA9IGR4O1xuICAgICAgICAgICAgdGhpcy5fY3Vyc29yWzFdID0gZHk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gdGVybWluYWxzIGF1dG9tYXRpY2FsbHkgY2xlYXIsIGJ1dCBpZiB3ZSdyZSBjbGVhcmluZyB3aGVuIHdlJ3JlXG4gICAgICAgIC8vIG5vdCBvdGhlcndpc2UgcHJvdmlkZWQgd2l0aCBhIGNoYXJhY3RlciwganVzdCB1c2UgYSBzcGFjZSBpbnN0ZWFkXG4gICAgICAgIGlmIChjbGVhckJlZm9yZSkge1xuICAgICAgICAgICAgaWYgKCFjaCkge1xuICAgICAgICAgICAgICAgIGNoID0gXCIgXCI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy8gaWYgd2UncmUgbm90IGNsZWFyaW5nIGFuZCBub3QgcHJvdmlkZWQgd2l0aCBhIGNoYXJhY3RlciwgZG8gbm90aGluZ1xuICAgICAgICBpZiAoIWNoKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgLy8gZGV0ZXJtaW5lIGlmIHdlIG5lZWQgdG8gY2hhbmdlIGNvbG9yc1xuICAgICAgICBsZXQgbmV3Q29sb3IgPSBjb2xvclRvQW5zaShmZywgYmcpO1xuICAgICAgICBpZiAobmV3Q29sb3IgIT09IHRoaXMuX2xhc3RDb2xvcikge1xuICAgICAgICAgICAgcHJvY2Vzcy5zdGRvd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fY29sb3JDYW52YXM7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29udGV4dCA9IGNhbnZhcy5nZXRDb250ZXh0KFwiMmRcIikgYXMgQ2FudmFzUmVuZGVyaW5nQ29udGV4dDJEO1xuICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dC5nbG9iYWxDb21wb3NpdGVPcGVyYXRpb24gPSBcInNvdXJjZS1vdmVyXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmNsZWFyUmVjdCgwLCAwLCB0aWxlV2lkdGgsIHRpbGVIZWlnaHQpO1xuICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBmZyA9IGZnc1tpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBiZyA9IGJnc1tpXTtcbiAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmRyYXdJbWFnZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9vcHRpb25zLnRpbGVTZXQhLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbGVbMF0sIHRpbGVbMV0sIHRpbGVXaWR0aCwgdGlsZUhlaWdodCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCAwLCB0aWxlV2lkdGgsIHRpbGVIZWlnaHRcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgIFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZnICE9IFwidHJhbnNwYXJlbnRcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHQuZmlsbFN0eWxlID0gZmc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dC5nbG9iYWxDb21wb3NpdGVPcGVyYXRpb24gPSBcInNvdXJjZS1hdG9wXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dC5maWxsUmVjdCgwLCAwLCB0aWxlV2lkdGgsIHRpbGVIZWlnaHQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChiZyAhPSBcInRyYW5zcGFyZW50XCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmZpbGxTdHlsZSA9IGJnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHQuZ2xvYmFsQ29tcG9zaXRlT3BlcmF0aW9uID0gXCJkZXN0aW5hdGlvbi1vdmVyXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dC5maWxsUmVjdCgwLCAwLCB0aWxlV2lkdGgsIHRpbGVIZWlnaHQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N0eC5kcmF3SW1hZ2UoY2FudmFzLCB4KnRpbGVXaWR0aCwgeSp0aWxlSGVpZ2h0LCB0aWxlV2lkdGgsIHRpbGVIZWlnaHQpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeyAvLyBubyBjb2xvcml6aW5nLCBlYXN5XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdHguZHJhd0ltYWdlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX29wdGlvbnMudGlsZVNldCEsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGlsZVswXSwgdGlsZVsxXSwgdGlsZVdpZHRoLCB0aWxlSGVpZ2h0LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHgqdGlsZVdpZHRoLCB5KnRpbGVIZWlnaHQsIHRpbGVXaWR0aCwgdGlsZUhlaWdodFxuICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgXG4gICAgICAgICovXG4gICAgfVxuICAgIGNsZWFyKCkge1xuICAgICAgICBjb25zdCBnbC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AgICAgICAgICAgICAgIGNvbnRleHQuZmlsbFN0eWxlID0gZmc7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQuZ2xvYmFsQ29tcG9zaXRlT3BlcmF0aW9uID0gXCJzb3VyY2UtYXRvcFwiO1xuICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmZpbGxSZWN0KDAsIDAsIHRpbGVXaWR0aCwgdGlsZUhlaWdodCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChiZyAhPSBcInRyYW5zcGFyZW50XCIpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5maWxsU3R5bGUgPSBiZztcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5nbG9iYWxDb21wb3NpdGVPcGVyYXRpb24gPSBcImRlc3RpbmF0aW9uLW92ZXJcIjtcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5maWxsUmVjdCgwLCAwLCB0aWxlV2lkdGgsIHRpbGVIZWlnaHQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLl9jdHguZHJhd0ltYWdlKGNhbnZhcywgeCAqIHRpbGVXaWR0aCwgeSAqIHRpbGVIZWlnaHQsIHRpbGVXaWR0aCwgdGlsZUhlaWdodCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHsgLy8gbm8gY29sb3JpemluZywgZWFzeVxuICAgICAgICAgICAgICAgIHRoaXMuX2N0eC5kcmF3SW1hZ2UodGhpcy5fb3B0aW9ucy50aWxlU2V0LCB0aWxlWzBdLCB0aWxlWzFdLCB0aWxlV2lkdGgsIHRpbGVIZWlnaHQsIHggKiB0aWxlV2lkdGgsIHkgKiB0aWxlSGVpZ2h0LCB0aWxlV2lkdGgsIHRpbGVIZWlnaHQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIGNvbXB1dGVTaXplKGF2YWlsV2lkdGgsIGF2YWlsSGVpZ2h0KSB7XG4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cbiAgICAgICAgdGhpcy5fZXZlbnRzLnB1c2goZXZlbnQsIHRpbWUpO1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBMb2NhdGVzIHRoZSBuZWFyZXN0IGV2ZW50LCBhZHZhbmNlcyB0aW1lIGlmIG5lY2Vzc2FyeS4gUmV0dXJucyB0aGF0IGV2ZW50IGFuZCByZW1vdmVzIGl0IGZyb20gdGhlIHF1ZXVlLlxuICAgICAqIEByZXR1cm5zIHs/IHx8IG51bGx9IFRoZSBldmVudCBwcmV2aW91c2x5IGFkZGVkIGJ5IGFkZEV2ZW50LCBudWxsIGlmIG5vIGV2ZW50IGF2YWlsYWJsZVxuICAgICAqL1xuICAgIGdldCgpIHtcbiAgICAgICAgaWYgKCF0aGlzLl9ldmVudHMubGVuKCkpIHtcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgICAgIGxldCB7IGtleTogdGltZSwgdmFsdWU6IGV2ZW50IH0gPSB0aGlzLl9ldmVudHMucG9wKCk7XG4gICAgICAgIGlmICh0aW1lID4gMCkgeyAvKiBhZHZhbmNlICovXG4gICAgICAgICAgICB0aGlzLl90aW1lICs9IHRpbWU7XG4gICAgICAgICAgICB0aGlzLl9ldmVudHMuc2hpZnQoLXRpbWUpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBldmVudDtcbiAgICB9XG4gICAgLyoqXG4gICAgICogR2V0IHRoZSB0aW1lIGFzc29jaWF0ZWQgd2l0aCB0aGUgZ2l2ZW4gZXZlbnRcbiAgICAgKiBAcGFyYW0gez99IGV2ZW50XG4gICAgICogQHJldHVybnMge251bWJlcn0gdGltZVxuICAgICAqL1xuICAgIGdldEV2ZW50VGltZShldmVudCkge1xuICAgICAgICBjb25zdCByID0gdGhpcy5fZXZlbnRzLmZpbmQoZXZlbnQpO1xuICAgICAgICBpZiAocikge1xuICAgICAgICAgICAgY29uc3QgeyBrZXkgfSA9IHI7XG4gICAgICAgICAgICByZXR1cm4ga2V5O1x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VuZGluZyBjZWxscyBpbiBjb25jZW50cmljIHJpbmdzLCBzdGFydGluZyBmcm9tIHRoZSBjZW50ZXIgKi9cbiAgICAgICAgZm9yIChsZXQgciA9IDE7IHIgPD0gUjsgcisrKSB7XG4gICAgICAgICAgICBsZXQgbmVpZ2hib3JzID0gdGhpcy5fZ2V0Q2lyY2xlKHgsIHksIHIpO1xuICAgICAgICAgICAgbGV0IGFuZ2xlID0gMzYwIC8gbmVpZ2hib3JzLmxlbmd0aDtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbmVpZ2hib3JzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgY3ggPSBuZWlnaGJvcnNbaV1bMF07XG4gICAgICAgICAgICAgICAgY3kgPSBuZWlnaGJvcnNbaV1bMV07XG4gICAgICAgICAgICAgICAgQSA9IGFuZ2xlICogKGkgLSAwLjUpO1xuICAgICAgICAgICAgICAgIEIgPSBBICsgYW5nbGU7XG4gICAgICAgICAgICAgICAgYmxvY2tzID0gIXRoaXMuX2xpZ2h0UGFzc2VzKGN4LCBjeSk7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuX3Zpc2libGVDb29yZHMoTWF0aC5mbG9vcihBKSwgTWF0aC5jZWlsKEIpLCBibG9ja3MsIERBVEEpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKGN4LCBjeSwgciwgMSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChEQVRBLmxlbmd0aCA9PSAyICYmIERBVEFbMF0gPT0gMCAmJiBEQVRBWzFdID09IDM2MCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfSAvKiBjdXRvZmY/ICovXG4gICAgICAgICAgICB9IC8qIGZvciBhbGwgY2VsbHMgaW4gdGhpcyByaW5nICovXG4gICAgICAgIH0gLyogZm9yIGFsbCByaW5ncyAqL1xuICAgIH1cbiAgICAvKipcbiAgICAg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5ICovXG4gICAgICAgICAgICB3aGlsZSAoaW5kZXggPCBEQVRBLmxlbmd0aCAmJiBEQVRBW2luZGV4XSA8IEIpIHtcbiAgICAgICAgICAgICAgICBpbmRleCsrO1xuICAgICAgICAgICAgICAgIGNvdW50Kys7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoY291bnQgPT0gMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChibG9ja3MpIHtcbiAgICAgICAgICAgICAgICBpZiAoY291bnQgJSAyKSB7XG4gICAgICAgICAgICAgICAgICAgIERBVEEuc3BsaWNlKGluZGV4IC0gY291bnQsIGNvdW50LCBCKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIERBVEEuc3BsaWNlKGluZGV4IC0gY291bnQsIGNvdW50KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHsgLyogdGhpcyBzaGFkb3cgc3RhcnRzIG91dHNpZGUgYW4gZXhpc3Rpbmcgc2hhZG93LCBvciB3aXRoaW4gYSBzdGFydGluZyBib3VuZGFyeSAqL1xuICAgICAgICAgICAgd2hpbGUgKGluZGV4IDwgREFUQS5sZW5ndGggJiYgREFUQVtpbmRleF0gPCBCKSB7XG4gICAgICAgICAgICAgICAgaW5kZXgrKztcbiAgICAgICAgICAgICAgICBjb3VudCsrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLyogdmlzaWJsZSB3aGVuIG91dHNpZGUgYW4gZXhpc3Rpbmcgc2hhZG93LCBvciB3aGVuIG92ZXJsYXBwaW5nICovXG4gICAgICAgICAgICBpZiAoQSA9PSBEQVRBW2luZGV4IC0gY291bnRdICYmIGNvdW50ID09IDEpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoYmxvY2tzKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNvdW50ICUgMikge1xuICAgICAgICAgICAgICAgICAgICBEQVRBLnNwbGljZShpbmRleCAtIGNvdW50LCBjb3VudCwgQSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBEQVRBLnNwbGljZShpbmRleCAtIGNvdW50LCBjb3VudCwgQSwgQik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICB9XG59XG4iLCJpbXBvcnQgeyBESVJTIH0gZnJvbSBcIi4uL2NvbnN0YW50cy5qc1wiO1xuO1xuO1xuZXhwb3J0IGRlZmF1bHQgY2xhc3MgRk9WIHtcbiAgICAvKipcbiAgICAgKiBAY2xhc3MgQWJzdHJhY3QgRk9WIGFsZ29yaXRobVxuICAgICAqIEBwYXJhbSB7ZnVuY3Rpb259IGxpZ2h0UGFzc2VzQ2FsbGJhY2sgRG9lcyB0aGUgbGlnaHQgcGFzcyB0aHJvdWdoIHgseT9cbiAgICAgKiBAcGFyYW0ge29iamVjdH0gW29wdGlvbnNdXG4gICAgICogQHBhcmFtIHtpbnR9IFtvcHRpb25zLnRvcG9sb2d5PThdIDQvNi84XG4gICAgICovXG4gICAgY29uc3RydWN0b3IobGlnaHRQYXNzZXNDYWxsYmFjaywgb3B0aW9ucyA9IHt9KSB7XG4gICAgICAgIHRoaXMuX2xpZ2h0UGFzc2VzID0gbGlnaHRQYXNzZXNDYWxsYmFjaztcbiAgICAgICAgdGhpcy5fb3B0aW9ucyA9IE9iamVjdC5hc3NpZ24oeyB0b3BvbG9neTogOCB9LCBvcHRpb25zKTtcbiAgICB9XG4gICAgLyoqXG4gICAgICogUmV0dXJuIGFsbCBuZWlnaGJvcnMgaW4gYSBjb25jZW50cmljIHJpbmdcbiAgICAgKiBAcGFyYW0ge2ludH0gY3ggY2VudGVyLXhcbiAgICAgKiBAcGFyYW0ge2ludH0gY3kgY2VudGVyLXlcbiAgICAgKiBAcGFyYW0ge2ludH0gciByYW5nZVxuICAgICAqL1xuICAgIF9nZXRDaXJjbGUoY3gsIGN5LCByKSB7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgbGV0IGRpcnMsIGNvdW50RmFjdG9yLCBzdGFydE9mZnNldDtcbiAgICAgICAgc3dpdGNoICh0aGlzLl9vcHRpb25zLnRvcG9sb2d5KSB7XG4gICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgY291bnRGYWN0b3IgPSAxO1xuICAgICAgICAgICAgICAgIHN0YXJ0T2Zmc2V0ID0gWzAsIDFdO1xuICAgICAgICAgICAgICAgIGRpcnMgPSBbXG4gICAgICAgICAgICAgICAgICAgIERJUlNbOF1bN10sXG4gICAgICAgICAgICAgICAgICAgIERJUlNbOF1bMV0sXG4gICAgICAgICAgICAgICAgICAgIERJUlNbOF1bM10sXG4gICAgICAgICAgICAgICAgICAgIERJUlNbOF1bNV1cbiAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICAgIGRpcnMgPSBESVJTWzZdO1xuICAgICAgICAgICAgICAgIGNvdW50RmFjdG9yID0gMTtcbiAgICAgICAgICAgICAgICBzdGFydE9mZnNldCA9IFstMSwgMV07XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDg6XG4gICAgICAgICAgICAgICAgZGlycyA9IERJUlNbNF07XG4gICAgICAgICAgICAgICAgY291bnRGYWN0b3IgPSAyO1xuICAgICAgICAgICAgICAgIHN0YXJ0T2Zmc2V0ID0gWy0xLCAxXTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGRlZmF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W2ldWzBdO1xuICAgICAgICAgICAgICAgIGN5ID0gbmVpZ2hib3JzW2ldWzFdO1xuICAgICAgICAgICAgICAgIC8qIHNoaWZ0IGhhbGYtYW4tYW5nbGUgYmFja3dhcmRzIHRvIG1haW50YWluIGNvbnNpc3RlbmN5IG9mIDAtdGggY2VsbHMgKi9cbiAgICAgICAgICAgICAgICBBMSA9IFtpID8gMiAqIGkgLSAxIDogMiAqIG5laWdoYm9yQ291bnQgLSAxLCAyICogbmVpZ2hib3JDb3VudF07XG4gICAgICAgICAgICAgICAgQTIgPSBbMiAqIGkgKyAxLCAyICogbmVpZ2hib3JDb3VudF07XG4gICAgICAgICAgICAgICAgYmxvY2tzID0gIXRoaXMuX2xpZ2h0UGFzc2VzKGN4LCBjeSk7XG4gICAgICAgICAgICAgICAgdmlzaWJpbGl0eSA9IHRoaXMuX2NoZWNrVmlzaWJpbGl0eShBMSwgQTIsIGJsb2NrcywgU0hBRE9XUyk7XG4gICAgICAgICAgICAgICAgaWYgKHZpc2liaWxpdHkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2soY3gsIGN5LCByLCB2aXNpYmlsaXR5KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKFNIQURPV1MubGVuZ3RoID09IDIgJiYgU0hBRE9XU1swXVswXSA9PSAwICYmIFNIQURPV1NbMV1bMF0gPT0gU0hBRE9XU1sxXVsxXSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfSAvKiBjdXRvZmY/ICovXG4gICAgICAgICAgICB9IC8qIGZvciBhbGwgY2VsbHMgaW4gdGhpcyByaW5nICovXG4gICAgICAgIH0gLyogZm9yIGFsbCByaW5ncyAqL1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBAcGFyYW0ge2ludFsyXX0gQTEgYXJjIHN0YXJ0XG4gICAgICogQHBhcmFtIHtpbnRbMl19IEEyIGFyYyBlbmRcbiAgICAgKiBAcGFy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cbiAgICAgICAgICAgIGluZGV4MSsrO1xuICAgICAgICB9XG4gICAgICAgIC8qIGluZGV4MjogbGFzdCBzaGFkb3cgPD0gQTIgKi9cbiAgICAgICAgbGV0IGluZGV4MiA9IFNIQURPV1MubGVuZ3RoLCBlZGdlMiA9IGZhbHNlO1xuICAgICAgICB3aGlsZSAoaW5kZXgyLS0pIHtcbiAgICAgICAgICAgIGxldCBvbGQgPSBTSEFET1dTW2luZGV4Ml07XG4gICAgICAgICAgICBsZXQgZGlmZiA9IEEyWzBdICogb2xkWzFdIC0gb2xkWzBdICogQTJbMV07XG4gICAgICAgICAgICBpZiAoZGlmZiA+PSAwKSB7IC8qIG9sZCA8PSBBMiAqL1xuICAgICAgICAgICAgICAgIGlmIChkaWZmID09IDAgJiYgKGluZGV4MiAlIDIpKSB7XG4gICAgICAgICAgICAgICAgICAgIGVkZ2UyID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHZpc2libGUgPSB0cnVlO1xuICAgICAgICBpZiAoaW5kZXgxID09IGluZGV4MiAmJiAoZWRnZTEgfHwgZWRnZTIpKSB7IC8qIHN1YnNldCBvZiBleGlzdGluZyBzaGFkb3csIG9uZSBvZiB0aGUgZWRnZXMgbWF0Y2ggKi9cbiAgICAgICAgICAgIHZpc2libGUgPSBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChlZGdlMSAmJiBlZGdlMiAmJiBpbmRleDEgKyAxID09IGluZGV4MiAmJiAoaW5kZXgyICUgMikpIHsgLyogY29tcGxldGVseSBlcXVpdmFsZW50IHdpdGggZXhpc3Rpbmcgc2hhZG93ICovXG4gICAgICAgICAgICB2aXNpYmxlID0gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoaW5kZXgxID4gaW5kZXgyICYmIChpbmRleDEgJSAyKSkgeyAvKiBzdWJzZXQgb2YgZXhpc3Rpbmcgc2hhZG93LCBub3QgdG91Y2hpbmcgKi9cbiAgICAgICAgICAgIHZpc2libGUgPSBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIXZpc2libGUpIHtcbiAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICB9IC8qIGZhc3QgY2FzZTogbm90IHZpc2libGUgKi9cbiAgICAgICAgbGV0IHZpc2libGVMZW5ndGg7XG4gICAgICAgIC8qIGNvbXB1dGUgdGhlIGxlbmd0aCBvZiB2aXNpYmxlIGFyYywgYWRqdXN0IGxpc3Qgb2Ygc2hhZG93cyAoaWYgYmxvY2tpbmcpICovXG4gICAgICAgIGxldCByZW1vdmUgPSBpbmRleDIgLSBpbmRleDEgKyAxO1xuICAgICAgICBpZiAocmVtb3ZlICUgMikge1xuICAgICAgICAgICAgaWYgKGluZGV4MSAlIDIpIHsgLyogZmlyc3QgZWRnZSB3aXRoaW4gZXhpc3Rpbmcgc2hhZG93LCBzZWNvbmQgb3V0c2lkZSAqL1xuICAgICAgICAgICAgICAgIGxldCBQID0gU0hBRE9XU1tpbmRleDFdO1xuICAgICAgICAgICAgICAgIHZpc2libGVMZW5ndGggPSAoQTJbMF0gKiBQWzFdIC0gUFswXSAqIEEyWzFdKSAvIChQWzFdICogQTJbMV0pO1xuICAgICAgICAgICAgICAgIGlmIChibG9ja3MpIHtcbiAgICAgICAgICAgICAgICAgICAgU0hBRE9XUy5zcGxpY2UoaW5kZXgxLCByZW1vdmUsIEEyKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHsgLyogc2Vjb25kIGVkZ2Ugd2l0aGluIGV4aXN0aW5nIHNoYWRvdywgZmlyc3Qgb3V0c2lkZSAqL1xuICAgICAgICAgICAgICAgIGxldCBQID0gU0hBRE9XU1tpbmRleDJdO1xuICAgICAgICAgICAgICAgIHZpc2libGVMZW5ndGggPSAoUFswXSAqIEExWzFdIC0gQTFbMF0gKiBQWzFdKSAvIChBMVsxXSAqIFBbMV0pO1xuICAgICAgICAgICAgICAgIGlmIChibG9ja3MpIHtcbiAgICAgICAgICAgICAgICAgICAgU0hBRE9XUy5zcGxpY2UoaW5kZXgxLCByZW1vdmUsIEExKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBpZiAoaW5kZXgxICUgMikgeyAvKiBib3RoIGVkZ2VzIHdpdGhpbiBleGlzdGluZyBzaGFkb3dzICovXG4gICAgICAgICAgICAgICAgbGV0IFAxID0gU0hBRE9XU1tpbmRleDFdO1xuICAgICAgICAgICAgICAgIGxldCBQMiA9IFNIQURPV1NbaW5kZXgyXTtcbiAgICAgICAgICAgICAgICB2aXNpYmxlTGVuZ3RoID0gKFAyWzBdICogUDFbMV0gLSBQMVswXSAqIFAyWzFdKSAvIChQMVsxXSAqIFAyWzFdKTtcbiAgICAgICAgICAgICAgICBpZiAoYmxvY2tzKSB7XG4gICAgICAgICAgICAgICAgICAgIFNIQURPV1Muc3BsaWNlKGluZGV4MSwgcmVtb3ZlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHsgLyogYm90aCBlZGdlcyBvdXRzaWRlIGV4aXN0aW5nIHNoYWRvd3MgKi9cbiAgICAgICAgICAgICAgICBpZiAoYmxvY2tzKSB7XG4gICAgICAgICAgICAgICAgICAgIFNIQURPV1Muc3BsaWNlKGluZGV4MSwgcmVtb3ZlLCBBMSwgQTIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gMTsgLyogd2hvbGUgYXJjIHZpc2libGUhICovXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGFyY0xlbmd0aCA9IChBMlswXSAqIEExWzFdIC0gQTFbMF0gKiBBMlsxXSkgLyAoQTFbMV0gKiBBMls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gICAgICAgIH1cbiAgICAgICAgZm9yIChsZXQgaSA9IHJvdzsgaSA8PSByYWRpdXM7IGkrKykge1xuICAgICAgICAgICAgbGV0IGR4ID0gLWkgLSAxO1xuICAgICAgICAgICAgbGV0IGR5ID0gLWk7XG4gICAgICAgICAgICBsZXQgYmxvY2tlZCA9IGZhbHNlO1xuICAgICAgICAgICAgbGV0IG5ld1N0YXJ0ID0gMDtcbiAgICAgICAgICAgIC8vJ1JvdycgY291bGQgYmUgY29sdW1uLCBuYW1lcyBoZXJlIGFzc3VtZSBvY3RhbnQgMCBhbmQgd291bGQgYmUgZmxpcHBlZCBmb3IgaGFsZiB0aGUgb2N0YW50c1xuICAgICAgICAgICAgd2hpbGUgKGR4IDw9IDApIHtcbiAgICAgICAgICAgICAgICBkeCArPSAxO1xuICAgICAgICAgICAgICAgIC8vVHJhbnNsYXRlIGZyb20gcmVsYXRpdmUgY29vcmRpbmF0ZXMgdG8gbWFwIGNvb3JkaW5hdGVzXG4gICAgICAgICAgICAgICAgbGV0IG1hcFggPSBzdGFydFggKyBkeCAqIHh4ICsgZHkgKiB4eTtcbiAgICAgICAgICAgICAgICBsZXQgbWFwWSA9IHN0YXJ0WSArIGR4ICogeXggKyBkeSAqIHl5O1xuICAgICAgICAgICAgICAgIC8vUmFuZ2Ugb2YgdGhlIHJvd1xuICAgICAgICAgICAgICAgIGxldCBzbG9wZVN0YXJ0ID0gKGR4IC0gMC41KSAvIChkeSArIDAuNSk7XG4gICAgICAgICAgICAgICAgbGV0IHNsb3BlRW5kID0gKGR4ICsgMC41KSAvIChkeSAtIDAuNSk7XG4gICAgICAgICAgICAgICAgLy9JZ25vcmUgaWYgbm90IHlldCBhdCBsZWZ0IGVkZ2Ugb2YgT2N0YW50XG4gICAgICAgICAgICAgICAgaWYgKHNsb3BlRW5kID4gdmlzU2xvcGVTdGFydCkge1xuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy9Eb25lIGlmIHBhc3QgcmlnaHQgZWRnZVxuICAgICAgICAgICAgICAgIGlmIChzbG9wZVN0YXJ0IDwgdmlzU2xvcGVFbmQpIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vSWYgaXQncyBpbiByYW5nZSwgaXQncyB2aXNpYmxlXG4gICAgICAgICAgICAgICAgaWYgKChkeCAqIGR4ICsgZHkgKiBkeSkgPCAocmFkaXVzICogcmFkaXVzKSkge1xuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayhtYXBYLCBtYXBZLCBpLCAxKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFibG9ja2VkKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vSWYgdGlsZSBpcyBhIGJsb2NraW5nIHRpbGUsIGNhc3QgYXJvdW5kIGl0XG4gICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5fbGlnaHRQYXNzZXMobWFwWCwgbWFwWSkgJiYgaSA8IHJhZGl1cykge1xuICAgICAgICAgICAgICAgICAgICAgICAgYmxvY2tlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9jYXN0VmlzaWJpbGl0eShzdGFydFgsIHN0YXJ0WSwgaSArIDEsIHZpc1Nsb3BlU3RhcnQsIHNsb3BlU3RhcnQsIHJhZGl1cywgeHgsIHh5LCB5eCwgeXksIGNhbGxiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld1N0YXJ0ID0gc2xvcGVFbmQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vS2VlcCBuYXJyb3dpbmcgaWYgc2Nhbm5pbmcgYWNyb3NzIGEgYmxvY2tcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLl9saW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QuYXNzaWduKHtcbiAgICAgICAgICAgIHBhc3NlczogMSxcbiAgICAgICAgICAgIGVtaXNzaW9uVGhyZXNob2xkOiAxMDAsXG4gICAgICAgICAgICByYW5nZTogMTBcbiAgICAgICAgfSwgb3B0aW9ucyk7XG4gICAgICAgIHRoaXMuX2xpZ2h0cyA9IHt9O1xuICAgICAgICB0aGlzLl9yZWZsZWN0aXZpdHlDYWNoZSA9IHt9O1xuICAgICAgICB0aGlzLl9mb3ZDYWNoZSA9IHt9O1xuICAgICAgICB0aGlzLnNldE9wdGlvbnMob3B0aW9ucyk7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIEFkanVzdCBvcHRpb25zIGF0IHJ1bnRpbWVcbiAgICAgKi9cbiAgICBzZXRPcHRpb25zKG9wdGlvbnMpIHtcbiAgICAgICAgT2JqZWN0LmFzc2lnbih0aGlzLl9vcHRpb25zLCBvcHRpb25zKTtcbiAgICAgICAgaWYgKG9wdGlvbnMgJiYgb3B0aW9ucy5yYW5nZSkge1xuICAgICAgICAgICAgdGhpcy5yZXNldCgpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBTZXQgdGhlIHVzZWQgRmllbGQtT2YtVmlldyBhbGdvXG4gICAgICovXG4gICAgc2V0Rk9WKGZvdikge1xuICAgICAgICB0aGlzLl9mb3YgPSBmb3Y7XG4gICAgICAgIHRoaXMuX2ZvdkNhY2hlID0ge307XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBTZXQgKG9yIHJlbW92ZSkgYSBsaWdodCBzb3VyY2VcbiAgICAgKi9cbiAgICBzZXRMaWdodCh4LCB5LCBjb2xvcikge1xuICAgICAgICBsZXQga2V5ID0geCArIFwiLFwiICsgeTtcbiAgICAgICAgaWYgKGNvbG9yKSB7XG4gICAgICAgICAgICB0aGlzLl9saWdodHNba2V5XSA9ICh0eXBlb2YgKGNvbG9yKSA9PS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ZWZsZWN0aXZpdHk7XG4gICAgICAgICAgICBpZiAoa2V5IGluIHRoaXMuX3JlZmxlY3Rpdml0eUNhY2hlKSB7XG4gICAgICAgICAgICAgICAgcmVmbGVjdGl2aXR5ID0gdGhpcy5fcmVmbGVjdGl2aXR5Q2FjaGVba2V5XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBwYXJ0cyA9IGtleS5zcGxpdChcIixcIik7XG4gICAgICAgICAgICAgICAgbGV0IHggPSBwYXJzZUludChwYXJ0c1swXSk7XG4gICAgICAgICAgICAgICAgbGV0IHkgPSBwYXJzZUludChwYXJ0c1sxXSk7XG4gICAgICAgICAgICAgICAgcmVmbGVjdGl2aXR5ID0gdGhpcy5fcmVmbGVjdGl2aXR5Q2FsbGJhY2soeCwgeSk7XG4gICAgICAgICAgICAgICAgdGhpcy5fcmVmbGVjdGl2aXR5Q2FjaGVba2V5XSA9IHJlZmxlY3Rpdml0eTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChyZWZsZWN0aXZpdHkgPT0gMCkge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfSAvKiB3aWxsIG5vdCByZWZsZWN0IGF0IGFsbCAqL1xuICAgICAgICAgICAgLyogY29tcHV0ZSBlbWlzc2lvbiBjb2xvciAqL1xuICAgICAgICAgICAgbGV0IGVtaXNzaW9uID0gWzAsIDAsIDBdO1xuICAgICAgICAgICAgbGV0IGludGVuc2l0eSA9IDA7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDM7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBwYXJ0ID0gTWF0aC5yb3VuZChjb2xvcltpXSAqIHJlZmxlY3Rpdml0eSk7XG4gICAgICAgICAgICAgICAgZW1pc3Npb25baV0gPSBwYXJ0O1xuICAgICAgICAgICAgICAgIGludGVuc2l0eSArPSBwYXJ0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGludGVuc2l0eSA+IHRoaXMuX29wdGlvbnMuZW1pc3Npb25UaHJlc2hvbGQpIHtcbiAgICAgICAgICAgICAgICByZXN1bHRba2V5XSA9IGVtaXNzaW9uO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIENvbXB1dGUgb25lIGl0ZXJhdGlvbiBmcm9tIG9uZSBjZWxsXG4gICAgICovXG4gICAgX2VtaXRMaWdodEZyb21DZWxsKHgsIHksIGNvbG9yLCBsaXRDZWxscykge1xuICAgICAgICBsZXQga2V5ID0geCArIFwiLFwiICsgeTtcbiAgICAgICAgbGV0IGZvdjtcbiAgICAgICAgaWYgKGtleSBpbiB0aGlzLl9mb3ZDYWNoZSkge1xuICAgICAgICAgICAgZm92ID0gdGhpcy5fZm92Q2FjaGVba2V5XTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGZvdiA9IHRoaXMuX3VwZGF0ZUZPVih4LCB5KTtcbiAgICAgICAgfVxuICAgICAgICBmb3IgKGxldCBmb3ZLZXkgaW4gZm92KSB7XG4gICAgICAgICAgICBsZXQgZm9ybUZhY3RvciA9IGZvdltmb3ZLZXldO1xuICAgICAgICAgICAgbGV0IHJlc3VsdDtcbiAgICAgICAgICAgIGlmIChmb3ZLZXkgaW4gbGl0Q2VsbHMpIHsgLyogYWxyZWFkeSBsaXQgKi9cbiAgICAgICAgICAgICAgICByZXN1bHQgPSBsaXRDZWxsc1tmb3ZLZXldO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7IC8qIG5ld2x5IGxpdCAqL1xuICAgICAgICAgICAgICAgIHJlc3VsdCA9IFswLCAwLCAwXTtcbiAgICAgICAgICAgICAgICBsaXRDZWxsc1tmb3ZLZXldID0gcmVzdWx0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZm9yIChsZXQ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GN1ciA9IHRoaXMuX21hcFtpXVtqXTtcbiAgICAgICAgICAgICAgICBsZXQgbmNvdW50ID0gdGhpcy5fZ2V0TmVpZ2hib3JzKGksIGopO1xuICAgICAgICAgICAgICAgIGlmIChjdXIgJiYgc3Vydml2ZS5pbmRleE9mKG5jb3VudCkgIT0gLTEpIHsgLyogc3Vydml2ZSAqL1xuICAgICAgICAgICAgICAgICAgICBuZXdNYXBbaV1bal0gPSAxO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmICghY3VyICYmIGJvcm4uaW5kZXhPZihuY291bnQpICE9IC0xKSB7IC8qIGJvcm4gKi9cbiAgICAgICAgICAgICAgICAgICAgbmV3TWFwW2ldW2pdID0gMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5fbWFwID0gbmV3TWFwO1xuICAgICAgICBjYWxsYmFjayAmJiB0aGlzLl9zZXJ2aWNlQ2FsbGJhY2soY2FsbGJhY2spO1xuICAgIH1cbiAgICBfc2VydmljZUNhbGxiYWNrKGNhbGxiYWNrKSB7XG4gICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgdGhpcy5faGVpZ2h0OyBqKyspIHtcbiAgICAgICAgICAgIGxldCB3aWR0aFN0ZXAgPSAxO1xuICAgICAgICAgICAgbGV0IHdpZHRoU3RhcnQgPSAwO1xuICAgICAgICAgICAgaWYgKHRoaXMuX29wdGlvbnMudG9wb2xvZ3kgPT0gNikge1xuICAgICAgICAgICAgICAgIHdpZHRoU3RlcCA9IDI7XG4gICAgICAgICAgICAgICAgd2lkdGhTdGFydCA9IGogJSAyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IHdpZHRoU3RhcnQ7IGkgPCB0aGlzLl93aWR0aDsgaSArPSB3aWR0aFN0ZXApIHtcbiAgICAgICAgICAgICAgICBjYWxsYmFjayhpLCBqLCB0aGlzLl9tYXBb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IGxldCBub3RDb25uZWN0ZWRLZXlzID0gT2JqZWN0LmtleXMobm90Q29ubmVjdGVkKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCA1OyBpKyspIHtcbiAgICAgICAgICAgIGlmIChjb25uZWN0ZWRLZXlzLmxlbmd0aCA8IG5vdENvbm5lY3RlZEtleXMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgbGV0IGtleXMgPSBjb25uZWN0ZWRLZXlzO1xuICAgICAgICAgICAgICAgIHRvID0gY29ubmVjdGVkW2tleXNbUk5HLmdldFVuaWZvcm1JbnQoMCwga2V5cy5sZW5ndGggLSAxKV1dO1xuICAgICAgICAgICAgICAgIGZyb20gPSB0aGlzLl9nZXRDbG9zZXN0KHRvLCBub3RDb25uZWN0ZWQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IGtleXMgPSBub3RDb25uZWN0ZWRLZXlzO1xuICAgICAgICAgICAgICAgIGZyb20gPSBub3RDb25uZWN0ZWRba2V5c1tSTkcuZ2V0VW5pZm9ybUludCgwLCBrZXlzLmxlbmd0aCAtIDEpXV07XG4gICAgICAgICAgICAgICAgdG8gPSB0aGlzLl9nZXRDbG9zZXN0KGZyb20sIGNvbm5lY3RlZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkID0gKGZyb21bMF0gLSB0b1swXSkgKiAoZnJvbVswXSAtIHRvWzBdKSArIChmcm9tWzFdIC0gdG9bMV0pICogKGZyb21bMV0gLSB0b1sxXSk7XG4gICAgICAgICAgICBpZiAoZCA8IDY0KSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy8gY29uc29sZS5sb2coXCI+Pj4gY29ubmVjdGVkPVwiICsgdG8gKyBcIiBub3RDb25uZWN0ZWQ9XCIgKyBmcm9tICsgXCIgZGlzdD1cIiArIGQpO1xuICAgICAgICByZXR1cm4gW2Zyb20sIHRvXTtcbiAgICB9XG4gICAgX2dldENsb3Nlc3QocG9pbnQsIHNwYWNlKSB7XG4gICAgICAgIGxldCBtaW5Qb2ludCA9IG51bGw7XG4gICAgICAgIGxldCBtaW5EaXN0ID0gbnVsbDtcbiAgICAgICAgZm9yIChsZXQgayBpbiBzcGFjZSkge1xuICAgICAgICAgICAgbGV0IHAgPSBzcGFjZVtrXTtcbiAgICAgICAgICAgIGxldCBkID0gKHBbMF0gLSBwb2ludFswXSkgKiAocFswXSAtIHBvaW50WzBdKSArIChwWzFdIC0gcG9pbnRbMV0pICogKHBbMV0gLSBwb2ludFsxXSk7XG4gICAgICAgICAgICBpZiAobWluRGlzdCA9PSBudWxsIHx8IGQgPCBtaW5EaXN0KSB7XG4gICAgICAgICAgICAgICAgbWluRGlzdCA9IGQ7XG4gICAgICAgICAgICAgICAgbWluUG9pbnQgPSBwO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBtaW5Qb2ludDtcbiAgICB9XG4gICAgX2ZpbmRDb25uZWN0ZWQoY29ubmVjdGVkLCBub3RDb25uZWN0ZWQsIHN0YWNrLCBrZWVwTm90Q29ubmVjdGVkLCB2YWx1ZSkge1xuICAgICAgICB3aGlsZSAoc3RhY2subGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgbGV0IHAgPSBzdGFjay5zcGxpY2UoMCwgMSlbMF07XG4gICAgICAgICAgICBsZXQgdGVzdHM7XG4gICAgICAgICAgICBpZiAodGhpcy5fb3B0aW9ucy50b3BvbG9neSA9PSA2KSB7XG4gICAgICAgICAgICAgICAgdGVzdHMgPSBbXG4gICAgICAgICAgICAgICAgICAgIFtwWzBdICsgMiwgcFsxXV0sXG4gICAgICAgICAgICAgICAgICAgIFtwWzBdICsgMSwgcFsxXSAtIDFdLFxuICAgICAgICAgICAgICAgICAgICBbcFswXSAtIDEsIHBbMV0gLSAxXSxcbiAgICAgICAgICAgICAgICAgICAgW3BbMF0gLSAyLCBwWzFdXSxcbiAgICAgICAgICAgICAgICAgICAgW3BbMF0gLSAxLCBwWzFdICsgMV0sXG4gICAgICAgICAgICAgICAgICAgIFtwWzBdICsgMSwgcFsxXSArIDFdLFxuICAgICAgICAgICAgICAgIF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB0ZXN0cyA9IFtcbiAgICAgICAgICAgICAgICAgICAgW3BbMF0gKyAxLCBwWzFdXSxcbiAgICAgICAgICAgICAgICAgICAgW3BbMF0gLSAxLCBwWzFdXSxcbiAgICAgICAgICAgICAgICAgICAgW3BbMF0sIHBbMV0gKyAxXSxcbiAgICAgICAgICAgICAgICAgICAgW3BbMF0sIHBbMV0gLSAxXVxuICAgICAgICAgICAgICAgIF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRlc3RzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGtleSA9IHRoaXMuX3BvaW50S2V5KHRlc3RzW2ldKTtcbiAgICAgICAgICAgICAgICBpZiAoY29ubmVjdGVkW2tleV0gPT0gbnVsbCAmJiB0aGlzLl9mcmVlU3BhY2UodGVzdHNbaV1bMF0sIHRlc3RzW2ldWzFdLCB2YWx1ZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgY29ubmVjdGVkW2tleV0gPSB0ZXN0c1tpXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFrZWVwTm90Q29ubmVjdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgbm90Q29ubmVjdGVkW2tleV07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgc3RhY2sucHVzaCh0ZXN0c1tpXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIF90dW5uZWxUb0Nvbm5lY3RlZCh0bywgZnJvbSwgY29ubmVjdGVkLCBub3RDb25uZWN0ZWQsIHZhbHVlLCBjb25uZWN0aW9uQ2FsbGJhY2spIHtcbiAgICAgICAgbGV0IGEsIGI7XG4gICAgICAgIGlmIChmcm9tWzBdIDwgdG9bMF0pIHtcbiAgICAgICAgICAgIGEgPSBmcm9tO1xuICAgICAgICAgICAgYiA9IHRvO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgYSA9IHRvO1xuICAgICAgICAgICAgYiA9IGZyb207XG4gICAgICAgIH1cbiAgICAgICAgZm9yIChsZXQgeHggPSBhWzBdOyB4eCA8PSBiWzBdOyB4eCsrKSB7XG4gICAgICAgICAgICB0aGlzLl9tYXBbeHhdW2FbMV1dID0gdmFsdWU7XG4gICAgICAgICAgICBsZXQgcCA9IFt4eCwgYVsxXV07XG4gICAgICAgICAgICBsZXQgcGtleSA9IHRoaXMuX3BvaW50S2V5KHApO1xuICAgICAgICAgICAgY29ubmVjdGVkW3BrZXldID0gcDtcbiAgICAgICAgICAgIGRlbGV0ZSBub3RDb25uZWN0ZWRbcGtleV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvbm5lY3Rpb25DYWxsYmFjayAmJiBhWzBdIDwgYlswXSkge1xuICAgICAgICAgICAgY29ubmVjdGlvbkNhbGxiYWNrKGEsIFtiWzBdLCBhWzFdXSk7XG4gICAgICAgIH1cbiAgICAgICAgLy8geCBpcyBub3cgZml4ZWRcbiAgICAgICAgbGV0IHggPSBiWzBdO1xuICAgICAgICBpZiAoZnJvbVsxXSA8IHRvWzFdKSB7XG4gICAgICAgICAgICBhID0gZnJvbTtcbiAgICAgICAgICAgIGIgPSB0bztcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGEgPSB0bztcbiAgICAgICAgICAgIGIgPSBmcm9tO1xuICAgICAgICB9XG4gICAgICAgIGZvciAobGV0IHl5ID0gYVsxXTsgeXkgPCBiWzFdOyB5eSsrKSB7XG4gICAgICAgICAgICB0aGlzLl9tYXBbeF1beXldID0gdmFsdWU7XG4gICAgICAgICAgICBsZXQgcCA9IFt4LCB5eV07XG4gICAgICAgICAgICBsZXQgcGtleSA9IHRoaXMuX3BvaW50S2V5KHApO1xuICAgICAgICAgICAgY29ubmVjdGVkW3BrZXldID0gcDtcbiAgICAgICAgICAgIGRlbGV0ZSBub3RDb25uZWN0ZWRbcGtleV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvbm5lY3Rpb25DYWxsYmFjayAmJiBhWzFdIDwgYlsxXSkge1xuICAgICAgICAgICAgY29ubmVjdGlvbkNhbGxiYWNrKFtiWzBdLCBhWzFdXSwgW2JbMF0sIGJbMV1dKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBfdHVubmVsVG9Db25uZWN0ZWQ2KHRvLCBmcm9tLCBjb25uZWN0ZWQsIG5vdENvbm5lY3RlZCwgdmFsdWUsIGNvbm5lY3Rpb25DYWxsYmFjaykge1xuICAgICAgICBsZXQgYSwgYjtcbiAgICAgICAgaWYgKGZyb21bMF0gPCB0b1swXSkge1xuICAgICAgICAgICAgYSA9IGZyb207XG4gICAgICAgICAgICBiID0gdG87XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBhID0gdG87XG4gICAgICAgICAgICBiID0gZnJvbTtcbiAgICAgICAgfVxuICAgICAgICAvLyB0dW5uZWwgZGlhZ29uYWxseSB1bnRpbCBob3Jpem9udGFsbHkgbGV2ZWxcbiAgICAgICAgbGV0IHh4ID0gYVswXTtcbiAgICAgICAgbGV0IHl5ID0gYVsxXTtcbiAgICAgICAgd2hpbGUgKCEoeHggPT0gYlswXSAmJiB5eSA9PSBiWzFdKSkge1xuICAgICAgICAgICAgbGV0IHN0ZXBXaWR0aCA9IDI7XG4gICAgICAgICAgICBpZiAoeXkgPCBiWzFdKSB7XG4gICAgICAgICAgICAgICAgeXkrKztcbiAgICAgICAgICAgICAgICBzdGVwV2lkdGggPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoeXkgPiBiWzFdKSB7XG4gICAgICAgICAgICAgICAgeXktLTtcbiAgICAgICAgICAgICAgICBzdGVwV2lkdGggPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHh4IDwgYlswXSkge1xuICAgICAgICAgICAgICAgIHh4ICs9IHN0ZXBXaWR0aDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHh4ID4gYlswXSkge1xuICAgICAgICAgICAgICAgIHh4IC09IHN0ZXBXaWR0aDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGJbMV0gJSAyKSB7XG4gICAgICAgICAgICAgICAgLy8gV29uJ3Qgc3RlcCBvdXRzaWRlIG1hcCBpZiBkZXN0aW5hdGlvbiBvbiBpcyBtYXAncyByaWdodCBlZGdlXG4gICAgICAgICAgICAgICAgeHggLT0gc3RlcFdpZHRoO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gZGl0dG8gZm9yIGxlZnQgZWRnZVxuICAgICAgICAgICAgICAgIHh4ICs9IHN0ZXBXaWR0aDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuX21hcFt4eF1beXldID0gdmFsdWU7XG4gICAgICAgICAgICBsZXQgcCA9IFt4eCwgeXldO1xuICAgICAgICAgICAgbGV0IHBrZXkgPSB0aGlzLl9wb2ludEtleShwKTtcbiAgICAgICAgICAgIGNvbm5lY3RlZFtwa2V5XSA9IHA7XG4gICAgICAgICAgICBkZWxldGUgbm90Q29ubmVjdGVkW3BrZXldO1xuICAgICAgICB9XG4gICAgICAgIGlmIChjb25uZWN0aW9uQ2FsbGJhY2spIHtcbiAgICAgICAgICAgIGNvbm5lY3Rpb25DYWxsYmFjayhmcm9tLCB0byk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgX2ZyZWVTcGFjZSh4LCB5LC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rLmJpbmQodGhpcyk7XG4gICAgfVxuICAgIGNyZWF0ZShjYWxsYmFjaykge1xuICAgICAgICB0aGlzLl9yb29tcyA9IFtdO1xuICAgICAgICB0aGlzLl9jb3JyaWRvcnMgPSBbXTtcbiAgICAgICAgdGhpcy5fbWFwID0gdGhpcy5fZmlsbE1hcCgxKTtcbiAgICAgICAgdGhpcy5fd2FsbHMgPSB7fTtcbiAgICAgICAgdGhpcy5fZHVnID0gMDtcbiAgICAgICAgbGV0IGFyZWEgPSAodGhpcy5fd2lkdGggLSAyKSAqICh0aGlzLl9oZWlnaHQgLSAyKTtcbiAgICAgICAgdGhpcy5fZmlyc3RSb29tKCk7XG4gICAgICAgIGxldCB0MSA9IERhdGUubm93KCk7XG4gICAgICAgIGxldCBwcmlvcml0eVdhbGxzO1xuICAgICAgICBkbyB7XG4gICAgICAgICAgICBwcmlvcml0eVdhbGxzID0gMDtcbiAgICAgICAgICAgIGxldCB0MiA9IERhdGUubm93KCk7XG4gICAgICAgICAgICBpZiAodDIgLSB0MSA+IHRoaXMuX29wdGlvbnMudGltZUxpbWl0KSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvKiBmaW5kIGEgZ29vZCB3YWxsICovXG4gICAgICAgICAgICBsZXQgd2FsbCA9IHRoaXMuX2ZpbmRXYWxsKCk7XG4gICAgICAgICAgICBpZiAoIXdhbGwpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH0gLyogbm8gbW9yZSB3YWxscyAqL1xuICAgICAgICAgICAgbGV0IHBhcnRzID0gd2FsbC5zcGxpdChcIixcIik7XG4gICAgICAgICAgICBsZXQgeCA9IHBhcnNlSW50KHBhcnRzWzBdKTtcbiAgICAgICAgICAgIGxldCB5ID0gcGFyc2VJbnQocGFydHNbMV0pO1xuICAgICAgICAgICAgbGV0IGRpciA9IHRoaXMuX2dldERpZ2dpbmdEaXJlY3Rpb24oeCwgeSk7XG4gICAgICAgICAgICBpZiAoIWRpcikge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfSAvKiB0aGlzIHdhbGwgaXMgbm90IHN1aXRhYmxlICovXG4gICAgICAgICAgICAvL1x0XHRjb25zb2xlLmxvZyhcIndhbGxcIiwgeCwgeSk7XG4gICAgICAgICAgICAvKiB0cnkgYWRkaW5nIGEgZmVhdHVyZSAqL1xuICAgICAgICAgICAgbGV0IGZlYXR1cmVBdHRlbXB0cyA9IDA7XG4gICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgZmVhdHVyZUF0dGVtcHRzKys7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuX3RyeUZlYXR1cmUoeCwgeSwgZGlyWzBdLCBkaXJbMV0pKSB7IC8qIGZlYXR1cmUgYWRkZWQgKi9cbiAgICAgICAgICAgICAgICAgICAgLy9pZiAodGhpcy5fcm9vbXMubGVuZ3RoICsgdGhpcy5fY29ycmlkb3JzLmxlbmd0aCA9PSAyKSB7IHRoaXMuX3Jvb21zWzBdLmFkZERvb3IoeCwgeSk7IH0gLyogZmlyc3Qgcm9vbSBvZmljaWFsbHkgaGFzIGRvb3JzICovXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3JlbW92ZVN1cnJvdW5kaW5nV2FsbHMoeCwgeSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3JlbW92ZVN1cnJvdW5kaW5nV2FsbHMoeCAtIGRpclswXSwgeSAtIGRpclsxXSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gd2hpbGUgKGZlYXR1cmVBdHRlbXB0cyA8IHRoaXMuX2ZlYXR1cmVBdHRlbXB0cyk7XG4gICAgICAgICAgICBmb3IgKGxldCBpZCBpbiB0aGlzLl93YWxscykge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLl93YWxsc1tpZF0gPiAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHByaW9yaXR5V2FsbHMrKztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gd2hpbGUgKHRoaXMuX2R1ZyAvIGFyZWEgPCB0aGlzLl9vcHRpb25zLmR1Z1BlcmNlbnRhZ2UgfHwgcHJpb3JpdHlXYWxscyk7IC8qIGZpeG1lIG51bWJlciBvZiBwcmlvcml0eSB3YWxscyAqL1xuICAgICAgICB0aGlzLl9hZGREb29ycygpO1xuICAgICAgICBpZiAoY2FsbGJhY2spIHtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy5fd2lkdGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgdGhpcy5faGVpZ2h0OyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2soaSwgaiwgdGhpcy5fbWFwW2ldW2pdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5fd2FsbHMgPSB7fTtcbiAgICAgICAgdGhpcy5fbWFwID0gW107XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cbiAgICBfZGlnQ2FsbGJhY2soeCwgeSwgdmFsdWUpIHtcbiAgICAgICAgaWYgKHZhbHVlID09IDAgfHwgdmFsdWUgPT0gMikgeyAvKiBlbXB0eSAqL1xuICAgICAgICAgICAgdGhpcy5fbWFwW3hdW3ldID0gMDtcbiAgICAgICAgICAgIHRoaXMuX2R1ZysrO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgeyAvKiB3YWxsICovXG4gICAgICAgICAgICB0aGlzLl93YWxsc1t4ICsgXCIsXCIgKyB5XSA9IDE7XG4gICAgICAgIH1cbiAgICB9XG4gICAgX2lzV2FsbENhbGxiYWNrKHgsIHkpIHtcbiAgICAgICAgaWYgKHggPCAwIHx8IHkgPCAwIHx8IHggPj0gdGhpcy5fd2lkdGggfH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ICAgICAgICAgLy9cdFx0Y29uc29sZS5sb2coXCJub3QgdmFsaWRcIik7XG4gICAgICAgICAgICAvL1x0XHRmZWF0dXJlLmRlYnVnKCk7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgZmVhdHVyZS5jcmVhdGUodGhpcy5fZGlnQ2FsbGJhY2spO1xuICAgICAgICAvL1x0ZmVhdHVyZS5kZWJ1ZygpO1xuICAgICAgICBpZiAoZmVhdHVyZSBpbnN0YW5jZW9mIFJvb20pIHtcbiAgICAgICAgICAgIHRoaXMuX3Jvb21zLnB1c2goZmVhdHVyZSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGZlYXR1cmUgaW5zdGFuY2VvZiBDb3JyaWRvcikge1xuICAgICAgICAgICAgZmVhdHVyZS5jcmVhdGVQcmlvcml0eVdhbGxzKHRoaXMuX3ByaW9yaXR5V2FsbENhbGxiYWNrKTtcbiAgICAgICAgICAgIHRoaXMuX2NvcnJpZG9ycy5wdXNoKGZlYXR1cmUpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cbiAgICBfcmVtb3ZlU3Vycm91bmRpbmdXYWxscyhjeCwgY3kpIHtcbiAgICAgICAgbGV0IGRlbHRhcyA9IERJUlNbNF07XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZGVsdGFzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgZGVsdGEgPSBkZWx0YXNbaV07XG4gICAgICAgICAgICBsZXQgeCA9IGN4ICsgZGVsdGFbMF07XG4gICAgICAgICAgICBsZXQgeSA9IGN5ICsgZGVsdGFbMV07XG4gICAgICAgICAgICBkZWxldGUgdGhpcy5fd2FsbHNbeCArIFwiLFwiICsgeV07XG4gICAgICAgICAgICB4ID0gY3ggKyAyICogZGVsdGFbMF07XG4gICAgICAgICAgICB5ID0gY3kgKyAyICogZGVsdGFbMV07XG4gICAgICAgICAgICBkZWxldGUgdGhpcy5fd2FsbHNbeCArIFwiLFwiICsgeV07XG4gICAgICAgIH1cbiAgICB9XG4gICAgLyoqXG4gICAgICogUmV0dXJucyB2ZWN0b3IgaW4gXCJkaWdnaW5nXCIgZGlyZWN0aW9uLCBvciBmYWxzZSwgaWYgdGhpcyBkb2VzIG5vdCBleGlzdCAob3IgaXMgbm90IHVuaXF1ZSlcbiAgICAgKi9cbiAgICBfZ2V0RGlnZ2luZ0RpcmVjdGlvbihjeCwgY3kpIHtcbiAgICAgICAgaWYgKGN4IDw9IDAgfHwgY3kgPD0gMCB8fCBjeCA+PSB0aGlzLl93aWR0aCAtIDEgfHwgY3kgPj0gdGhpcy5faGVpZ2h0IC0gMSkge1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3VsdCA9IG51bGw7XG4gICAgICAgIGxldCBkZWx0YXMgPSBESVJTWzRdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGRlbHRhcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGRlbHRhID0gZGVsdGFzW2ldO1xuICAgICAgICAgICAgbGV0IHggPSBjeCArIGRlbHRhWzBdO1xuICAgICAgICAgICAgbGV0IHkgPSBjeSArIGRlbHRhWzFdO1xuICAgICAgICAgICAgaWYgKCF0aGlzLl9tYXBbeF1beV0pIHsgLyogdGhlcmUgYWxyZWFkeSBpcyBhbm90aGVyIGVtcHR5IG5laWdoYm9yISAqL1xuICAgICAgICAgICAgICAgIGlmIChyZXN1bHQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGRlbHRhO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8qIG5vIGVtcHR5IG5laWdoYm9yICovXG4gICAgICAgIGlmICghcmVzdWx0KSB7XG4gICAgICAgICAgICByZXR1cm4gb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uICAgICAgICB0aGlzLl9tYXAgPSBbXTtcbiAgICB9XG4gICAgY3JlYXRlKGNhbGxiYWNrKSB7XG4gICAgICAgIGxldCB3ID0gdGhpcy5fd2lkdGg7XG4gICAgICAgIGxldCBoID0gdGhpcy5faGVpZ2h0O1xuICAgICAgICB0aGlzLl9tYXAgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB3OyBpKyspIHtcbiAgICAgICAgICAgIHRoaXMuX21hcC5wdXNoKFtdKTtcbiAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgaDsgaisrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGJvcmRlciA9IChpID09IDAgfHwgaiA9PSAwIHx8IGkgKyAxID09IHcgfHwgaiArIDEgPT0gaCk7XG4gICAgICAgICAgICAgICAgdGhpcy5fbWFwW2ldLnB1c2goYm9yZGVyID8gMSA6IDApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHRoaXMuX3N0YWNrID0gW1xuICAgICAgICAgICAgWzEsIDEsIHcgLSAyLCBoIC0gMl1cbiAgICAgICAgXTtcbiAgICAgICAgdGhpcy5fcHJvY2VzcygpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHc7IGkrKykge1xuICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBoOyBqKyspIHtcbiAgICAgICAgICAgICAgICBjYWxsYmFjayhpLCBqLCB0aGlzLl9tYXBbaV1bal0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHRoaXMuX21hcCA9IFtdO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG4gICAgX3Byb2Nlc3MoKSB7XG4gICAgICAgIHdoaWxlICh0aGlzLl9zdGFjay5sZW5ndGgpIHtcbiAgICAgICAgICAgIGxldCByb29tID0gdGhpcy5fc3RhY2suc2hpZnQoKTsgLyogW2xlZnQsIHRvcCwgcmlnaHQsIGJvdHRvbV0gKi9cbiAgICAgICAgICAgIHRoaXMuX3BhcnRpdGlvblJvb20ocm9vbSk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgX3BhcnRpdGlvblJvb20ocm9vbSkge1xuICAgICAgICBsZXQgYXZhaWxYID0gW107XG4gICAgICAgIGxldCBhdmFpbFkgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IHJvb21bMF0gKyAxOyBpIDwgcm9vbVsyXTsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgdG9wID0gdGhpcy5fbWFwW2ldW3Jvb21bMV0gLSAxXTtcbiAgICAgICAgICAgIGxldCBib3R0b20gPSB0aGlzLl9tYXBbaV1bcm9vbVszXSArIDFdO1xuICAgICAgICAgICAgaWYgKHRvcCAmJiBib3R0b20gJiYgIShpICUgMikpIHtcbiAgICAgICAgICAgICAgICBhdmFpbFgucHVzaChpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBmb3IgKGxldCBqID0gcm9vbVsxXSArIDE7IGogPCByb29tWzNdOyBqKyspIHtcbiAgICAgICAgICAgIGxldCBsZWZ0ID0gdGhpcy5fbWFwW3Jvb21bMF0gLSAxXVtqXTtcbiAgICAgICAgICAgIGxldCByaWdodCA9IHRoaXMuX21hcFtyb29tWzJdICsgMV1bal07XG4gICAgICAgICAgICBpZiAobGVmdCAmJiByaWdodCAmJiAhKGogJSAyKSkge1xuICAgICAgICAgICAgICAgIGF2YWlsWS5wdXNoKGopO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICghYXZhaWxYLmxlbmd0aCB8fCAhYXZhaWxZLmxlbmd0aCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGxldCB4ID0gUk5HLmdldEl0ZW0oYXZhaWxYKTtcbiAgICAgICAgbGV0IHkgPSBSTkcuZ2V0SXRlbShhdmFpbFkpO1xuICAgICAgICB0aGlzLl9tYXBbeF1beV0gPSAxO1xuICAgICAgICBsZXQgd2FsbHMgPSBbXTtcbiAgICAgICAgbGV0IHcgPSBbXTtcbiAgICAgICAgd2FsbHMucHVzaCh3KTsgLyogbGVmdCBwYXJ0ICovXG4gICAgICAgIGZvciAobGV0IGkgPSByb29tWzBdOyBpIDwgeDsgaSsrKSB7XG4gICAgICAgICAgICB0aGlzLl9tYXBbaV1beV0gPSAxO1xuICAgICAgICAgICAgaWYgKGkgJSAyKVxuICAgICAgICAgICAgICAgIHcucHVzaChbaSwgeV0pO1xuICAgICAgICB9XG4gICAgICAgIHcgPSBbXTtcbiAgICAgICAgd2FsbHMucHVzaCh3KTsgLyogcmlnaHQgcGFydCAqL1xuICAgICAgICBmb3IgKGxldCBpID0geCArIDE7IGkgPD0gcm9vbVsyXTsgaSsrKSB7XG4gICAgICAgICAgICB0aGlzLl9tYXBbaV1beV0gPSAxO1xuICAgICAgICAgICAgaWYgKGkgJSAyKVxuICAgICAgICAgICAgICAgIHcucHVzaChbaSwgeV0pO1xuICAgICAgICB9XG4gICAgICAgIHcgPSBbXTtcbiAgICAgICAgd2FsbHMucHVzaCh3KTsgLyogdG9wIHBhcnQgKi9cbiAgICAgICAgZm9yIChsZXQgaiA9IHJvb21bMV07IGogPCB5OyBqKyspIHtcbiAgICAgICAgICAgIHRoaXMuX21hcFt4XVtqXSA9IDE7XG4gICAgICAgICAgICBpZiAoaiAlIDIpXG4gICAgICAgICAgICAgICAgdy5wdXNoKFt4LCBqXSk7XG4gICAgICAgIH1cbiAgICAgICAgdyA9IFtdO1xuICAgICAgICB3YWxscy5wdXNoKHcpOyAvKiBib3R0b20gcGFydCAqL1xuICAgICAgICBmb3IgKGxldCBqID0geSArIDE7IGogPD0gcm9vbVszXTsgaisrKSB7XG4gICAgICAgICAgICB0aGlzLl9tYXBbeF1bal0gPSAxO1xuICAgICAgICAgICAgaWYgKGogJSAyKVxuICAgICAgICAgICAgICAgIHcucHVzaChbeCwgal0pO1xuICAgICAgICB9XG4gICAgICAgIGxldCBzb2xpZCA9IFJORy5nZXR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xuZXhwb3J0IGRlZmF1bHQgY2xhc3MgRWxsZXJNYXplIGV4dGVuZHMgTWFwIHtcbiAgICBjcmVhdGUoY2FsbGJhY2spIHtcbiAgICAgICAgbGV0IG1hcCA9IHRoaXMuX2ZpbGxNYXAoMSk7XG4gICAgICAgIGxldCB3ID0gTWF0aC5jZWlsKCh0aGlzLl93aWR0aCAtIDIpIC8gMik7XG4gICAgICAgIGxldCByYW5kID0gOSAvIDI0O1xuICAgICAgICBsZXQgTCA9IFtdO1xuICAgICAgICBsZXQgUiA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHc7IGkrKykge1xuICAgICAgICAgICAgTC5wdXNoKGkpO1xuICAgICAgICAgICAgUi5wdXNoKGkpO1xuICAgICAgICB9XG4gICAgICAgIEwucHVzaCh3IC0gMSk7IC8qIGZha2Ugc3RvcC1ibG9jayBhdCB0aGUgcmlnaHQgc2lkZSAqL1xuICAgICAgICBsZXQgajtcbiAgICAgICAgZm9yIChqID0gMTsgaiArIDMgPCB0aGlzLl9oZWlnaHQ7IGogKz0gMikge1xuICAgICAgICAgICAgLyogb25lIHJvdyAqL1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB3OyBpKyspIHtcbiAgICAgICAgICAgICAgICAvKiBjZWxsIGNvb3JkcyAod2lsbCBiZSBhbHdheXMgZW1wdHkpICovXG4gICAgICAgICAgICAgICAgbGV0IHggPSAyICogaSArIDE7XG4gICAgICAgICAgICAgICAgbGV0IHkgPSBqO1xuICAgICAgICAgICAgICAgIG1hcFt4XVt5XSA9IDA7XG4gICAgICAgICAgICAgICAgLyogcmlnaHQgY29ubmVjdGlvbiAqL1xuICAgICAgICAgICAgICAgIGlmIChpICE9IExbaSArIDFdICYmIFJORy5nZXRVbmlmb3JtKCkgPiByYW5kKSB7XG4gICAgICAgICAgICAgICAgICAgIGFkZFRvTGlzdChpLCBMLCBSKTtcbiAgICAgICAgICAgICAgICAgICAgbWFwW3ggKyAxXVt5XSA9IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8qIGJvdHRvbSBjb25uZWN0aW9uICovXG4gICAgICAgICAgICAgICAgaWYgKGkgIT0gTFtpXSAmJiBSTkcuZ2V0VW5pZm9ybSgpID4gcmFuZCkge1xuICAgICAgICAgICAgICAgICAgICAvKiByZW1vdmUgY29ubmVjdGlvbiAqL1xuICAgICAgICAgICAgICAgICAgICByZW1vdmVGcm9tTGlzdChpLCBMLCBSKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8qIGNyZWF0ZSBjb25uZWN0aW9uICovXG4gICAgICAgICAgICAgICAgICAgIG1hcFt4XVt5ICsgMV0gPSAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvKiBsYXN0IHJvdyAqL1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHc7IGkrKykge1xuICAgICAgICAgICAgLyogY2VsbCBjb29yZHMgKHdpbGwgYmUgYWx3YXlzIGVtcHR5KSAqL1xuICAgICAgICAgICAgbGV0IHggPSAyICogaSArIDE7XG4gICAgICAgICAgICBsZXQgeSA9IGo7XG4gICAgICAgICAgICBtYXBbeF1beV0gPSAwO1xuICAgICAgICAgICAgLyogcmlnaHQgY29ubmVjdGlvbiAqL1xuICAgICAgICAgICAgaWYgKGkgIT0gTFtpICsgMV0gJiYgKGkgPT0gTFtpXSB8fCBSTkcuZ2V0VW5pZm9ybSgpID4gcmFuZCkpIHtcbiAgICAgICAgICAgICAgICAvKiBkaWcgcmlnaHQgYWxzbyBpZiB0aGUgY2VsbCBpcyBzZXBhcmF0ZWQsIHNvIGl0IGdldHMgY29ubmVjdGVkIHRvIHRoZSByZXN0IG9mIG1hemUgKi9cbiAgICAgICAgICAgICAgICBhZGRUb0xpc3QoaSwgTCwgUik7XG4gICAgICAgICAgICAgICAgbWFwW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sgeSA8PSBib3R0b207IHkrKykge1xuICAgICAgICAgICAgICAgIGlmICh4ICE9IGxlZnQgJiYgeCAhPSByaWdodCAmJiB5ICE9IHRvcCAmJiB5ICE9IGJvdHRvbSkge1xuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzV2FsbENhbGxiYWNrKHgsIHkpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLmFkZERvb3IoeCwgeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuICAgIGRlYnVnKCkge1xuICAgICAgICBjb25zb2xlLmxvZyhcInJvb21cIiwgdGhpcy5feDEsIHRoaXMuX3kxLCB0aGlzLl94MiwgdGhpcy5feTIpO1xuICAgIH1cbiAgICBpc1ZhbGlkKGlzV2FsbENhbGxiYWNrLCBjYW5CZUR1Z0NhbGxiYWNrKSB7XG4gICAgICAgIGxldCBsZWZ0ID0gdGhpcy5feDEgLSAxO1xuICAgICAgICBsZXQgcmlnaHQgPSB0aGlzLl94MiArIDE7XG4gICAgICAgIGxldCB0b3AgPSB0aGlzLl95MSAtIDE7XG4gICAgICAgIGxldCBib3R0b20gPSB0aGlzLl95MiArIDE7XG4gICAgICAgIGZvciAobGV0IHggPSBsZWZ0OyB4IDw9IHJpZ2h0OyB4KyspIHtcbiAgICAgICAgICAgIGZvciAobGV0IHkgPSB0b3A7IHkgPD0gYm90dG9tOyB5KyspIHtcbiAgICAgICAgICAgICAgICBpZiAoeCA9PSBsZWZ0IHx8IHggPT0gcmlnaHQgfHwgeSA9PSB0b3AgfHwgeSA9PSBib3R0b20pIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFpc1dhbGxDYWxsYmFjayh4LCB5KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWNhbkJlRHVnQ2FsbGJhY2soeCwgeSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHtmdW5jdGlvbn0gZGlnQ2FsbGJhY2sgRGlnIGNhbGxiYWNrIHdpdGggYSBzaWduYXR1cmUgKHgsIHksIHZhbHVlKS4gVmFsdWVzOiAwID0gZW1wdHksIDEgPSB3YWxsLCAyID0gZG9vci4gTXVsdGlwbGUgZG9vcnMgYXJlIGFsbG93ZWQuXG4gICAgICovXG4gICAgY3JlYXRlKGRpZ0NhbGxiYWNrKSB7XG4gICAgICAgIGxldCBsZWZ0ID0gdGhpcy5feDEgLSAxO1xuICAgICAgICBsZXQgcmlnaHQgPSB0aGlzLl94MiArIDE7XG4gICAgICAgIGxldCB0b3AgPSB0aGlzLl95MSAtIDE7XG4gICAgICAgIGxldCBib3R0b20gPSB0aGlzLl95MiArIDE7XG4gICAgICAgIGxldCB2YWx1ZSA9IDA7XG4gICAgICAgIGZvciAobGV0IHggPSBsZWZ0OyB4IDw9IHJpZ2h0OyB4KyspIHtcbiAgICAgICAgICAgIGZvciAobGV0IHkgPSB0b3A7IHkgPD0gYm90dG9tOyB5KyspIHtcbiAgICAgICAgICAgICAgICBpZiAoeCArIFwiLFwiICsgeSBpbiB0aGlzLl9kb29ycykge1xuICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IDI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHggPT0gbGV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ICAgICAgICAgICAgZHkgPSBkeSAvIE1hdGguYWJzKGR5KTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgbnggPSBkeTtcbiAgICAgICAgbGV0IG55ID0gLWR4O1xuICAgICAgICBsZXQgb2sgPSB0cnVlO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgeCA9IHN4ICsgaSAqIGR4O1xuICAgICAgICAgICAgbGV0IHkgPSBzeSArIGkgKiBkeTtcbiAgICAgICAgICAgIGlmICghY2FuQmVEdWdDYWxsYmFjayh4LCB5KSkge1xuICAgICAgICAgICAgICAgIG9rID0gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIWlzV2FsbENhbGxiYWNrKHggKyBueCwgeSArIG55KSkge1xuICAgICAgICAgICAgICAgIG9rID0gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIWlzV2FsbENhbGxiYWNrKHggLSBueCwgeSAtIG55KSkge1xuICAgICAgICAgICAgICAgIG9rID0gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIW9rKSB7XG4gICAgICAgICAgICAgICAgbGVuZ3RoID0gaTtcbiAgICAgICAgICAgICAgICB0aGlzLl9lbmRYID0geCAtIGR4O1xuICAgICAgICAgICAgICAgIHRoaXMuX2VuZFkgPSB5IC0gZHk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLyoqXG4gICAgICAgICAqIElmIHRoZSBsZW5ndGggZGVnZW5lcmF0ZWQsIHRoaXMgY29ycmlkb3IgbWlnaHQgYmUgaW52YWxpZFxuICAgICAgICAgKi9cbiAgICAgICAgLyogbm90IHN1cHBvcnRlZCAqL1xuICAgICAgICBpZiAobGVuZ3RoID09IDApIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVx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gMik7XG4gICAgICAgICAgICBpZiAoIWRvbmUpIHtcbiAgICAgICAgICAgICAgICBtYXBbY3hdW2N5XSA9IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIW1hcFtjeF1bY3ldKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fcmFuZG9taXplKGRpcnMpO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKE1hdGguZmxvb3IoUk5HLmdldFVuaWZvcm0oKSAqICh0aGlzLl9yZWd1bGFyaXR5ICsgMSkpID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX3JhbmRvbWl6ZShkaXJzKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBibG9ja2VkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCA0OyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG54ID0gY3ggKyBkaXJzW2ldWzBdICogMjtcbiAgICAgICAgICAgICAgICAgICAgICAgIG55ID0gY3kgKyBkaXJzW2ldWzFdICogMjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9pc0ZyZWUobWFwLCBueCwgbnksIHdpZHRoLCBoZWlnaHQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFwW254XVtueV0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcFtjeCArIGRpcnNbaV1bMF1dW2N5ICsgZGlyc1tpXVsxXV0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN4ID0gbng7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY3kgPSBueTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBibG9ja2VkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9uZSsrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoIWJsb2NrZWQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IHdoaWxlIChkb25lICsgMSA8IHdpZHRoICogaGVpZ2h0IC8gNCk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy5fd2lkdGg7IGkrKykge1xuICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCB0aGlzLl9oZWlnaHQ7IGorKykge1xuICAgICAgICAgICAgICAgIGNhbGxiYWNrKGksIGosIG1hcFtpXVtqXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5fbWFwID0gW107XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cbiAgICBfcmFuZG9taXplKGRpcnMpIHtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCA0OyBpKyspIHtcbiAgICAgICAgICAgIGRpcnNbaV1bMF0gPSAwO1xuICAgICAgICAgICAgZGlyc1tpXVsxXSA9IDA7XG4gICAgICAgIH1cbiAgICAgICAgc3dpdGNoIChNYXRoLmZsb29yKFJORy5nZXRVbmlmb3JtKCkgKiA0KSkge1xuICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgIGRpcnNbMF1bMF0gPSAtMTtcbiAgICAgICAgICAgICAgICBkaXJzWzFdWzBdID0gMTtcbiAgICAgICAgICAgICAgICBkaXJzWzJdWzFdID0gLTE7XG4gICAgICAgICAgICAgICAgZGlyc1szXVsxXSA9IDE7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgZGlyc1szXVswXSA9IC0xO1xuICAgICAgICAgICAgICAgIGRpcnNbMl1bMF0gPSAxO1xuICAgICAgICAgICAgICAgIGRpcnNbMV1bMV0gPSAtMTtcbiAgICAgICAgICAgICAgICBkaXJzWzBdWzFdID0gMTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICBkaXJzWzJdWzBdID0gLTE7XG4gICAgICAgICAgICAgICAgZGlyc1szXVswXSA9IDE7XG4gICAgICAgICAgICAgICAgZGlyc1swXVsxXSA9IC0xO1xuICAgICAgICAgICAgICAgIGRpcnNbMV1bMV0gPSAxO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgIGRpcnNbMV1bMF0gPSAtMTtcbiAgICAgICAgICAgICAgICBkaXJzWzBdWzBdID0gMTtcbiAgICAgICAgICAgICAgICBkaXJzWzNdWzFdID0gLTE7XG4gICAgICAgICAgICAgICAgZGlyc1syXVsxXSA9IDE7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICB9XG4gICAgX2lzRnJlZShtYXAsIHgsIHksIHdpZHRoLCBoZWlnaHQpIHtcbiAgICAgICAgaWYgKHggPCAxIHx8IHkgPCAxIHx8IHggPj0gd2lkdGggfHwgeSA+PSBoZWlnaHQpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbWFwW3hdW3ldO1xuICAgIH1cbn1cbiIsImltcG9ydCBBcmVuYSBmcm9tIFwiLi9hcmVuYS5qc1wiO1xuaW1wb3J0IFVuaWZvcm0gZnJvbSBcIi4vdW5pZm9ybS5qc1wiO1xuaW1wb3J0IENlbGx1bGFyIGZyb20gXCIuL2NlbGx1bGFyLmpzXCI7XG5pbXBvcnQgRGlnZ2VyIGZyb20gXCIuL2RpZ2dlci5qc1wiO1xuaW1wb3J0IEVsbGVyTWF6ZSBmcm9tIFwiLi9lbGxlcm1hemUuanNcIjtcbmltcG9ydCBEaXZpZGVkTWF6ZSBmcm9tIFwiLi9kaXZpZGVkbW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SB7XG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKGksIGosIHRoaXMubWFwW2ldW2pdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuICAgIF9jYWxjdWxhdGVSb29tU2l6ZShzaXplLCBjZWxsKSB7XG4gICAgICAgIGxldCBtYXggPSBNYXRoLmZsb29yKChzaXplIC8gY2VsbCkgKiAwLjgpO1xuICAgICAgICBsZXQgbWluID0gTWF0aC5mbG9vcigoc2l6ZSAvIGNlbGwpICogMC4yNSk7XG4gICAgICAgIGlmIChtaW4gPCAyKSB7XG4gICAgICAgICAgICBtaW4gPSAyO1xuICAgICAgICB9XG4gICAgICAgIGlmIChtYXggPCAyKSB7XG4gICAgICAgICAgICBtYXggPSAyO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBbbWluLCBtYXhdO1xuICAgIH1cbiAgICBfaW5pdFJvb21zKCkge1xuICAgICAgICAvLyBjcmVhdGUgcm9vbXMgYXJyYXkuIFRoaXMgaXMgdGhlIFwiZ3JpZFwiIGxpc3QgZnJvbSB0aGUgYWxnby5cbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aGlzLl9vcHRpb25zLmNlbGxXaWR0aDsgaSsrKSB7XG4gICAgICAgICAgICB0aGlzLnJvb21zLnB1c2goW10pO1xuICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCB0aGlzLl9vcHRpb25zLmNlbGxIZWlnaHQ7IGorKykge1xuICAgICAgICAgICAgICAgIHRoaXMucm9vbXNbaV0ucHVzaCh7IFwieFwiOiAwLCBcInlcIjogMCwgXCJ3aWR0aFwiOiAwLCBcImhlaWdodFwiOiAwLCBcImNvbm5lY3Rpb25zXCI6IFtdLCBcImNlbGx4XCI6IGksIFwiY2VsbHlcIjogaiB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICBfY29ubmVjdFJvb21zKCkge1xuICAgICAgICAvL3BpY2sgcmFuZG9tIHN0YXJ0aW5nIGdyaWRcbiAgICAgICAgbGV0IGNneCA9IFJORy5nZXRVbmlmb3JtSW50KDAsIHRoaXMuX29wdGlvbnMuY2VsbFdpZHRoIC0gMSk7XG4gICAgICAgIGxldCBjZ3kgPSBSTkcuZ2V0VW5pZm9ybUludCgwLCB0aGlzLl9vcHRpb25zLmNlbGxIZWlnaHQgLSAxKTtcbiAgICAgICAgbGV0IGlkeDtcbiAgICAgICAgbGV0IG5jZ3g7XG4gICAgICAgIGxldCBuY2d5O1xuICAgICAgICBsZXQgZm91bmQgPSBmYWxzZTtcbiAgICAgICAgbGV0IHJvb207XG4gICAgICAgIGxldCBvdGhlclJvb207XG4gICAgICAgIGxldCBkaXJUb0NoZWNrO1xuICAgICAgICAvLyBmaW5kICB1bmNvbm5lY3RlZCBuZWlnaGJvdXIgY2VsbHNcbiAgICAgICAgZG8ge1xuICAgICAgICAgICAgLy9kaXJUb0NoZWNrID0gWzAsIDEsIDIsIDMsIDQsIDUsIDYsIDddO1xuICAgICAgICAgICAgZGlyVG9DaGVjayA9IFswLCAyLCA0LCA2XTtcbiAgICAgICAgICAgIGRpclRvQ2hlY2sgPSBSTkcuc2h1ZmZsZShkaXJUb0NoZWNrKTtcbiAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICBmb3VuZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGlkeCA9IGRpclRvQ2hlY2sucG9wKCk7XG4gICAgICAgICAgICAgICAgbmNneCA9IGNneCArIERJUlNbOF1baWR4XVswXTtcbiAgICAgICAgICAgICAgICBuY2d5ID0gY2d5ICsgRElSU1s4XVtpZHhdWzFdO1xuICAgICAgICAgICAgICAgIGlmIChuY2d4IDwgMCB8fCBuY2d4ID49IHRoaXMuX29wdGlvbnMuY2VsbFdpZHRoKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAobmNneSA8IDAgfHwgbmNneSA+PSB0aGlzLl9vcHRpb25zLmNlbGxIZWlnaHQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJvb20gPSB0aGlzLnJvb21zW2NneF1bY2d5XTtcbiAgICAgICAgICAgICAgICBpZiAocm9vbVtcImNvbm5lY3Rpb25zXCJdLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gYXMgbG9uZyBhcyB0aGlzIHJvb20gZG9lc24ndCBhbHJlYWR5IGNvb25lY3QgdG8gbWUsIHdlIGFyZSBvayB3aXRoIGl0LlxuICAgICAgICAgICAgICAgICAgICBpZiAocm9vbVtcImNvbm5lY3Rpb25zXCJdWzBdWzBdID09IG5jZ3ggJiYgcm9vbVtcImNvbm5lY3Rpb25zXCJdWzBdWzFdID09IG5jZ3kpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG90aGVyUm9vbSA9IHRoaXMucm9vbXNbbmNneF1bbmNneV07XG4gICAgICAgICAgICAgICAgaWYgKG90aGVyUm9vbVtcImNvbm5lY3Rpb25zXCJdLmxlbmd0aCA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIG90aGVyUm9vbVtcImNvbm5lY3Rpb25zXCJdLnB1c2goW2NneCwgY2d5XSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY29ubmVjdGVkQ2VsbHMucHVzaChbbmNneCwgbmNneV0pO1xuICAgICAgICAgICAgICAgICAgICBjZ3ggPSBuY2d4O1xuICAgICAgICAgICAgICAgICAgICBjZ3kgPSBuY2d5O1xuICAgICAgICAgICAgICAgICAgICBmb3VuZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSB3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cbiAgICAgICAgICAgICAgICAgICAgZGlyZWN0aW9ucyA9IFJORy5zaHVmZmxlKGRpcmVjdGlvbnMpO1xuICAgICAgICAgICAgICAgICAgICB2YWxpZFJvb20gPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRpcklkeCA9IGRpcmVjdGlvbnMucG9wKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV3SSA9IGkgKyBESVJTWzhdW2RpcklkeF1bMF07XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV3SiA9IGogKyBESVJTWzhdW2RpcklkeF1bMV07XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV3SSA8IDAgfHwgbmV3SSA+PSBjdyB8fCBuZXdKIDwgMCB8fCBuZXdKID49IGNoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBvdGhlclJvb20gPSB0aGlzLnJvb21zW25ld0ldW25ld0pdO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWRSb29tID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvdGhlclJvb21bXCJjb25uZWN0aW9uc1wiXS5sZW5ndGggPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgayA9IDA7IGsgPCBvdGhlclJvb21bXCJjb25uZWN0aW9uc1wiXS5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvdGhlclJvb21bXCJjb25uZWN0aW9uc1wiXVtrXVswXSA9PSBpICYmIG90aGVyUm9vbVtcImNvbm5lY3Rpb25zXCJdW2tdWzFdID09IGopIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWRSb29tID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWxpZFJvb20pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoZGlyZWN0aW9ucy5sZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICBpZiAodmFsaWRSb29tKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByb29tW1wiY29ubmVjdGlvbnNcIl0ucHVzaChbb3RoZXJSb29tW1wiY2VsbHhcIl0sIG90aGVyUm9vbVtcImNlbGx5XCJdXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhcIi0tIFVuYWJsZSB0byBjb25uZWN0IHJvb20uXCIpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIF9jcmVhdGVSYW5kb21Sb29tQ29ubmVjdGlvbnMoKSB7XG4gICAgICAgIC8vIEVtcHR5IGZvciBub3cuXG4gICAgfVxuICAgIF9jcmVhdGVSb29tcygpIHtcbiAgICAgICAgbGV0IHcgPSB0aGlzLl93aWR0aDtcbiAgICAgICAgbGV0IGggPSB0aGlzLl9oZWlnaHQ7XG4gICAgICAgIGxldCBjdyA9IHRoaXMuX29wdGlvbnMuY2VsbFdpZHRoO1xuICAgICAgICBsZXQgY2ggPSB0aGlzLl9vcHRpb25zLmNlbGxIZWlnaHQ7XG4gICAgICAgIGxldCBjd3AgPSBNYXRoLmZsb29yKHRoaXMuX3dpZHRoIC8gY3cpO1xuICAgICAgICBsZXQgY2hwID0gTWF0aC5mbG9vcih0aGlzLl9oZWlnaHQgLyBjaCk7XG4gICAgICAgIGxldCByb29tdztcbiAgICAgICAgbGV0IHJvb21oO1xuICAgICAgICBsZXQgcm9vbVdpZHRoID0gdGhpcy5fb3B0aW9uc1tcInJvb21XaWR0aFwiXTtcbiAgICAgICAgbGV0IHJvb21IZWlnaHQgPSB0aGlzLl9vcHRpb25zW1wicm9vbUhlaWdodFwiXTtcbiAgICAgICAgbGV0IHN4O1xuICAgICAgICBsZXQgc3k7XG4gICAgICAgIGxldCBvdGhlclJvb207XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3c7IGkrKykge1xuICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBjaDsgaisrKSB7XG4gICAgICAgICAgICAgICAgc3ggPSBjd3AgKiBpO1xuICAgICAgICAgICAgICAgIHN5ID0gY2hwICogajtcbiAgICAgICAgICAgICAgICBpZiAoc3ggPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBzeCA9IDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChzeSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHN5ID0gMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcm9vbXcgPSBSTkcuZ2V0VW5pZm9ybUludChyb29tV2lkdGhbMF0sIHJvb21XaWR0aFsxXSk7XG4gICAgICAgICAgICAgICAgcm9vbWggPSBSTkcuZ2V0VW5pZm9ybUludChyb29tSGVpZ2h0WzBdLCByb29tSGVpZ2h0WzFdKTtcbiAgICAgICAgICAgICAgICBpZiAoaiA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgb3RoZXJSb29tID0gdGhpcy5yb29tc1tpXVtqIC0gMV07XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlIChzeSAtIChvdGhlclJvb21bXCJ5XCJdICsgb3RoZXJSb29tW1wiaGVpZ2h0XCJdKSA8IDMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN5Kys7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGkgPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIG90aGVyUm9vbSA9IHRoaXMucm9vbXNbaSAtIDFdW2pdO1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoc3ggLSAob3RoZXJSb29tW1wieFwiXSArIG90aGVyUm9vbVtcIndpZHRoXCJdKSA8IDMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN4Kys7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbGV0IHN4T2Zmc2V0ID0gTWF0aC5yb3VuZChSTkcuZ2V0VW5pZm9ybUludCgwLCBjd3AgLSByb29tdykgLyAyKTtcbiAgICAgICAgICAgICAgICBsZXQgc3lPZmZzZXQgPSBNYXRoLnJvdW5kKFJORy5nZXRVbmlmb3JtSW50KDAsIGNocCAtIHJvb21oKSAvIDIpO1xuICAgICAgICAgICAgICAgIHdoaWxlIChzeCArIHN4T2Zmc2V0ICsgcm9vbXcgPj0gdykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoc3hPZmZzZXQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN4T2Zmc2V0LS07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByb29tdy0tO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHdoaWxlIChzeSArIHN5T2Zmc2V0ICsgcm9vbWggPj0gaCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoc3lPZmZzZXQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN5T2Zmc2V0LS07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByb29taC0tO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHN4ID0gc3ggKyBzeE9mZnNldDtcbiAgICAgICAgICAgICAgICBzeSA9IHN5ICsgc3lPZmZzZXQ7XG4gICAgICAgICAgICAgICAgdGhpcy5yb29tc1tpXVtqXVtcInhcIl0gPSBzeDtcbiAgICAgICAgICAgICAgICB0aGlzLnJvb21zW2ldW2pdW1wieVwiXSA9IHN5O1xuICAgICAgICAgICAgICAgIHRoaXMucm9vbXNbaV1bal1bXCJ3aWR0aFwiXSA9IHJvb213O1xuICAgICAgICAgICAgICAgIHRoaXMucm9vbXNbaV1bal1bXCJoZWlnaHRcIl0gPSByb29taDtcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpaSA9IHN4OyBpaSA8IHN4ICsgcm9vbXc7IGlpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgamogPSBzeTsgamogPCBzeSArIHJvb21oOyBqaisrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm1hcFtpaV1bampdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICBfZ2V0V2FsbFBvc2l0aW9uKGFSb29tLCBhRGlyZWN0aW9uKSB7XG4gICAgICAgIGxldCByeDtcbiAgICAgICAgbGV0IHJ5O1xuICAgICAgICBsZXQgZG9vcjtcbiAgICAgICAgaWYgKGFEaXJlY3Rpb24gPT0gMSB8fCBhRGlyZWN0aW9uID09IDMpIHtcbiAgICAgICAgICAgIHJ4ID0gUk5HLmdldFVuaWZvcm1JbnQoYVJvb21bXCJ4XCJdICsgMSwgYVJvb21bXCJ4XCJdICsgYVJvb21bXCJ3aWR0aFwiXSAtIDIpO1xuICAgICAgICAgICAgaWYgKGFEaXJlY3Rpb24gPT0gMSkge1xuICAgICAgICAgICAgICAgIHJ5ID0gYVJvb21bXCJ5XCJdIC0gMjtcbiAgICAgICAgICAgICAgICBkb29yID0gcnkgKyAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgcnkgPSBhUm9vbVtcInlcIl0gKyBhUm9vbVtcImhlaWdodFwiXSArIDE7XG4gICAgICAgICAgICAgICAgZG9vciA9IHJ5IC0gMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMubWFwW3J4XVtkb29yXSA9IDA7IC8vIGknbSBub3Qgc2V0dGluZyBhIHNwZWNpZmljICdkb29yJyB0aWxlIHZhbHVlIHJpZ2h0IG5vdywganVzdCBlbXB0eSBzcGFjZS5cbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJ5ID0gUk5HLmdldFVuaWZvcm1JbnQoYVJvb21bXCJ5XCJdICsgMSwgYVJvb21bXCJ5XCJdICsgYVJvb21bXCJoZWlnaHRcIl0gLSAyKTtcbiAgICAgICAgICAgIGlmIChhRGlyZWN0aW9uID09IDIpIHtcbiAgICAgICAgICAgICAgICByeCA9IGFSb29tW1wieFwiXSArIGFSb29tW1wid2lkdGhcIl0gKyAxO1xuICAgICAgICAgICAgICAgIGRvb3IgPSByeCAtIDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICByeCA9IGFSb29tW1wieFwiXSAtIDI7XG4gICAgICAgICAgICAgICAgZG9vciA9IHJ4ICsgMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMubWFwW2Rvb3JdW3J5XSA9IDA7IC8vIGknbSBub3Qgc2V0dGluZyBhIHNwZWNpZmljICdkb29yJyB0aWxlIHZhbHVlIHJpZ2h0IG5vdywganVzdCBlb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1hcFt4cG9zXVt5cG9zXSA9IDA7XG4gICAgICAgIHdoaWxlIChtb3Zlcy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBtb3ZlID0gbW92ZXMucG9wKCk7XG4gICAgICAgICAgICB3aGlsZSAobW92ZVsxXSA+IDApIHtcbiAgICAgICAgICAgICAgICB4cG9zICs9IERJUlNbOF1bbW92ZVswXV1bMF07XG4gICAgICAgICAgICAgICAgeXBvcyArPSBESVJTWzhdW21vdmVbMF1dWzFdO1xuICAgICAgICAgICAgICAgIHRoaXMubWFwW3hwb3NdW3lwb3NdID0gMDtcbiAgICAgICAgICAgICAgICBtb3ZlWzFdID0gbW92ZVsxXSAtIDE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgX2NyZWF0ZUNvcnJpZG9ycygpIHtcbiAgICAgICAgLy8gRHJhdyBDb3JyaWRvcnMgYmV0d2VlbiBjb25uZWN0ZWQgcm9vbXNcbiAgICAgICAgbGV0IGN3ID0gdGhpcy5fb3B0aW9ucy5jZWxsV2lkdGg7XG4gICAgICAgIGxldCBjaCA9IHRoaXMuX29wdGlvbnMuY2VsbEhlaWdodDtcbiAgICAgICAgbGV0IHJvb207XG4gICAgICAgIGxldCBjb25uZWN0aW9uO1xuICAgICAgICBsZXQgb3RoZXJSb29tO1xuICAgICAgICBsZXQgd2FsbDtcbiAgICAgICAgbGV0IG90aGVyV2FsbDtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdzsgaSsrKSB7XG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGNoOyBqKyspIHtcbiAgICAgICAgICAgICAgICByb29tID0gdGhpcy5yb29tc1tpXVtqXTtcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBrID0gMDsgayA8IHJvb21bXCJjb25uZWN0aW9uc1wiXS5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uID0gcm9vbVtcImNvbm5lY3Rpb25zXCJdW2tdO1xuICAgICAgICAgICAgICAgICAgICBvdGhlclJvb20gPSB0aGlzLnJvb21zW2Nvbm5lY3Rpb25bMF1dW2Nvbm5lY3Rpb25bMV1dO1xuICAgICAgICAgICAgICAgICAgICAvLyBmaWd1cmUgb3V0IHdoYXQgd2FsbCBvdXIgY29ycmlkb3Igd2lsbCBzdGFydCBvbmUuXG4gICAgICAgICAgICAgICAgICAgIC8vIGZpZ3VyZSBvdXQgd2hhdCB3YWxsIG91ciBjb3JyaWRvciB3aWxsIGVuZCBvbi5cbiAgICAgICAgICAgICAgICAgICAgaWYgKG90aGVyUm9vbVtcImNlbGx4XCJdID4gcm9vbVtcImNlbGx4XCJdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3YWxsID0gMjtcbiAgICAgICAgICAgICAgICAgICAgICAgIG90aGVyV2FsbCA9IDQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAob3RoZXJSb29tW1wiY2VsbHhcIl0gPCByb29tW1wiY2VsbHhcIl0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdhbGwgPSA0O1xuICAgICAgICAgICAgICAgICAgICAgICAgb3RoZXJXYWxsID0gMjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChvdGhlclJvb21bXCJjZWxseVwiXSA+IHJvb21bXCJjZWxseVwiXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgd2FsbCA9IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICBvdGhlcldhbGwgPSAxO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgd2FsbCA9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICBvdGhlcldhbGwgPSAzO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2R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Agd2hpbGUgKDEpIHtcbiAgICAgICAgICAgIGxldCB0MiA9IERhdGUubm93KCk7XG4gICAgICAgICAgICBpZiAodDIgLSB0MSA+IHRoaXMuX29wdGlvbnMudGltZUxpbWl0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9IC8qIHRpbWUgbGltaXQhICovXG4gICAgICAgICAgICB0aGlzLl9tYXAgPSB0aGlzLl9maWxsTWFwKDEpO1xuICAgICAgICAgICAgdGhpcy5fZHVnID0gMDtcbiAgICAgICAgICAgIHRoaXMuX3Jvb21zID0gW107XG4gICAgICAgICAgICB0aGlzLl91bmNvbm5lY3RlZCA9IFtdO1xuICAgICAgICAgICAgdGhpcy5fZ2VuZXJhdGVSb29tcygpO1xuICAgICAgICAgICAgaWYgKHRoaXMuX3Jvb21zLmxlbmd0aCA8IDIpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0aGlzLl9nZW5lcmF0ZUNvcnJpZG9ycygpKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNhbGxiYWNrKSB7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRoaXMuX3dpZHRoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IHRoaXMuX2hlaWdodDsgaisrKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKGksIGosIHRoaXMuX21hcFtpXVtqXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBHZW5lcmF0ZXMgYSBzdWl0YWJsZSBhbW91bnQgb2Ygcm9vbXNcbiAgICAgKi9cbiAgICBfZ2VuZXJhdGVSb29tc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gICBpZiAodGhpcy5fdW5jb25uZWN0ZWQubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fY29ubmVjdGVkLnB1c2godGhpcy5fdW5jb25uZWN0ZWQucG9wKCkpO1xuICAgICAgICAgICAgfSAvKiBmaXJzdCBvbmUgaXMgYWx3YXlzIGNvbm5lY3RlZCAqL1xuICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAvKiAxLiBwaWNrIHJhbmRvbSBjb25uZWN0ZWQgcm9vbSAqL1xuICAgICAgICAgICAgICAgIGxldCBjb25uZWN0ZWQgPSBSTkcuZ2V0SXRlbSh0aGlzLl9jb25uZWN0ZWQpO1xuICAgICAgICAgICAgICAgIGlmICghY29ubmVjdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvKiAyLiBmaW5kIGNsb3Nlc3QgdW5jb25uZWN0ZWQgKi9cbiAgICAgICAgICAgICAgICBsZXQgcm9vbTEgPSB0aGlzLl9jbG9zZXN0Um9vbSh0aGlzLl91bmNvbm5lY3RlZCwgY29ubmVjdGVkKTtcbiAgICAgICAgICAgICAgICBpZiAoIXJvb20xKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvKiAzLiBjb25uZWN0IGl0IHRvIGNsb3Nlc3QgY29ubmVjdGVkICovXG4gICAgICAgICAgICAgICAgbGV0IHJvb20yID0gdGhpcy5fY2xvc2VzdFJvb20odGhpcy5fY29ubmVjdGVkLCByb29tMSk7XG4gICAgICAgICAgICAgICAgaWYgKCFyb29tMikge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbGV0IG9rID0gdGhpcy5fY29ubmVjdFJvb21zKHJvb20xLCByb29tMik7XG4gICAgICAgICAgICAgICAgaWYgKCFvaykge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9IC8qIHN0b3AgY29ubmVjdGluZywgcmUtc2h1ZmZsZSAqL1xuICAgICAgICAgICAgICAgIGlmICghdGhpcy5fdW5jb25uZWN0ZWQubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgIH0gLyogZG9uZTsgbm8gcm9vbXMgcmVtYWluICovXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgICA7XG4gICAgLyoqXG4gICAgICogRm9yIGEgZ2l2ZW4gcm9vbSwgZmluZCB0aGUgY2xvc2VzdCBvbmUgZnJvbSB0aGUgbGlzdFxuICAgICAqL1xuICAgIF9jbG9zZXN0Um9vbShyb29tcywgcm9vbSkge1xuICAgICAgICBsZXQgZGlzdCA9IEluZmluaXR5O1xuICAgICAgICBsZXQgY2VudGVyID0gcm9vbS5nZXRDZW50ZXIoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IG51bGw7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcm9vbXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCByID0gcm9vbXNbaV07XG4gICAgICAgICAgICBsZXQgYyA9IHIuZ2V0Q2VudGVyKCk7XG4gICAgICAgICAgICBsZXQgZHggPSBjWzBdIC0gY2VudGVyWzBdO1xuICAgICAgICAgICAgbGV0IGR5ID0gY1sxXSAtIGNlbnRlclsxXTtcbiAgICAgICAgICAgIGxldCBkID0gZHggKiBkeCArIGR5ICogZHk7XG4gICAgICAgICAgICBpZiAoZCA8IGRpc3QpIHtcbiAgICAgICAgICAgICAgICBkaXN0ID0gZDtcbiAgICAgICAgICAgICAgICByZXN1bHQgPSByO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuICAgIF9jb25uZWN0Um9vbXMocm9vbTEsIHJvb20yKSB7XG4gICAgICAgIC8qXG4gICAgICAgICAgICByb29tMS5kZWJ1ZygpO1xuICAgICAgICAgICAgcm9vbTIuZGVidWcoKTtcbiAgICAgICAgKi9cbiAgICAgICAgbGV0IGNlbnRlcjEgPSByb29tMS5nZXRDZW50ZXIoKTtcbiAgICAgICAgbGV0IGNlbnRlcjIgPSByb29tMi5nZXRDZW50ZXIoKTtcbiAgICAgICAgbGV0IGRpZmZYID0gY2VudGVyMlswXSAtIGNlbnRlcjFbMF07XG4gICAgICAgIGxldCBkaWZmWSA9IGNlbnRlcjJbMV0gLSBjZW50ZXIxWzFdO1xuICAgICAgICBsZXQgc3RhcnQ7XG4gICAgICAgIGxldCBlbmQ7XG4gICAgICAgIGxldCBkaXJJbmRleDEsIGRpckluZGV4MiwgbWluLCBtYXgsIGluZGV4O1xuICAgICAgICBpZiAoTWF0aC5hYnMoZGlmZlgpIDwgTWF0aC5hYnMoZGlmZlkpKSB7IC8qIGZpcnN0IHRyeSBjb25uZWN0aW5nIG5vcnRoLXNvdXRoIHdhbGxzICovXG4gICAgICAgICAgICBkaXJJbmRleDEgPSAoZGlmZlkgPiAwID8gMiA6IDApO1xuICAgICAgICAgICAgZGlySW5kZXgyID0gKGRpckluZGV4MSArIDIpICUgNDtcbiAgICAgICAgICAgIG1pbiA9IHJvb20yLmdldExlZnQoKTtcbiAgICAgICAgICAgIG1heCA9IHJvb20yLmdldFJpZ2h0KCk7XG4gICAgICAgICAgICBpbmRleCA9IDA7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7IC8qIGZpcnN0IHRyeSBjb25uZWN0aW5nIGVhc3Qtd2VzdCB3YWxscyAqL1xuICAgICAgICAgICAgZGlySW5kZXgxID0gKGRpZmZYID4gMCA/IDEgOiAzKTtcbiAgICAgICAgICAgIGRpckluZGV4MiA9IChkaXJJbmRleDEgKyAyKSAlIDQ7XG4gICAgICAgICAgICBtaW4gPSByb29tMi5nZXRUb3AoKTtcbiAgICAgICAgICAgIG1heCA9IHJvb20yLmdldEJvdHRvbSgpO1xuICAgICAgICAgICAgaW5kZXggPSAxO1xuICAgICAgICB9XG4gICAgICAgIHN0YXJ0ID0gdGhpcy5fcGxhY2VJbldhbGwocm9vbTEsIGRpckluZGV4MSk7IC8qIGNvcnJpZG9yIHdpbGwgc3RhcnQgaGVyZSAqL1xuICAgICAgICBpZiAoIXN0YXJ0KSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHN0YXJ0W2luZGV4XSA+PSBtaW4gJiYgc3RhcnRbaW5kZXhdIDw9IG1heCkgeyAvKiBwb3NzaWJsZSB0byBjb25uZWN0IHdpdGggc3RyYWlnaHQgbGluZSAoSS1saWtlKSAqL1xuICAgICAgICAgICAgZW5kID0gc3RhcnQuc2xpY2UoKTtcbiAgICAgICAgICAgIGxldCB2YWx1ZSA9IDA7XG4gICAgICAgICAgICBzd2l0Y2ggKGRpckluZGV4Mikge1xuICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSByb29tMi5nZXRUb3AoKSAtIDE7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSByb29tMi5nZXRSaWdodCgpICsgMTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHJvb20yLmdldEJvdHRvbSgpICsgMTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHJvb20yLmdldExlZnQoKSAtIDE7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZW5kWyhpbmRleCArIDEpICUgMl0gPSB2YWx1ZTtcbiAgICAgICAgICAgIHRoaXMuX2RpZ0xpbmUoW3N0YXJ0LCBlbmRdKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChzdGFydFtpbmRleF0gPCBtaW4gLSAxIHx8IHN0YXJ0W2luZGV4XSA+IG1heCArIDEpIHsgLyogbmVlZCB0byBzd2l0Y2ggdGFyZ2V0IHdhbGwgKEwtbGlrZSkgKi9cbiAgICAgICAgICAgIGxldCBkaWZmID0gc3RhcnRbaW5kZXhdIC0gY2VudGVyMltpbmRleF07XG4gICAgICAgICAgICBsZXQgcm90YXRpb24gPSAwO1xuICAgICAgICAgICAgc3dpdGNoIChkaXJJbmRleDIpIHtcbiAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgICByb3RhdGlvbiA9IChkaWZmIDwgMCA/IDMgOiAxKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgcm90YXRpb24gPSAoZGlmZiA8IDAgPyAxIDogMyk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZGlySW5kZXgyID0gKGRpckluZGV4MiArIHJvdGF0aW9uKSAlIDQ7XG4gICAgICAgICAgICBlbmQgPSB0aGlzLl9wbGFjZUluV2FsbChyb29tMiwgZGlySW5kZXgyKTtcbiAgICAgICAgICAgIGlmICghZW5kKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG1pZCA9IFswLCAwXTtcbiAgICAgICAgICAgIG1pZFtpbmRleF0gPSBzdGFydFtpbmRleF07XG4gICAgICAgICAgICBsZXQga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ZWQuaW5kZXhPZihyb29tMSk7XG4gICAgICAgIGlmIChpbmRleCAhPSAtMSkge1xuICAgICAgICAgICAgdGhpcy5fdW5jb25uZWN0ZWQuc3BsaWNlKGluZGV4LCAxKTtcbiAgICAgICAgICAgIHRoaXMuX2Nvbm5lY3RlZC5wdXNoKHJvb20xKTtcbiAgICAgICAgfVxuICAgICAgICBpbmRleCA9IHRoaXMuX3VuY29ubmVjdGVkLmluZGV4T2Yocm9vbTIpO1xuICAgICAgICBpZiAoaW5kZXggIT0gLTEpIHtcbiAgICAgICAgICAgIHRoaXMuX3VuY29ubmVjdGVkLnNwbGljZShpbmRleCwgMSk7XG4gICAgICAgICAgICB0aGlzLl9jb25uZWN0ZWQucHVzaChyb29tMik7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuICAgIF9wbGFjZUluV2FsbChyb29tLCBkaXJJbmRleCkge1xuICAgICAgICBsZXQgc3RhcnQgPSBbMCwgMF07XG4gICAgICAgIGxldCBkaXIgPSBbMCwgMF07XG4gICAgICAgIGxldCBsZW5ndGggPSAwO1xuICAgICAgICBzd2l0Y2ggKGRpckluZGV4KSB7XG4gICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgZGlyID0gWzEsIDBdO1xuICAgICAgICAgICAgICAgIHN0YXJ0ID0gW3Jvb20uZ2V0TGVmdCgpLCByb29tLmdldFRvcCgpIC0gMV07XG4gICAgICAgICAgICAgICAgbGVuZ3RoID0gcm9vbS5nZXRSaWdodCgpIC0gcm9vbS5nZXRMZWZ0KCkgKyAxO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgIGRpciA9IFswLCAxXTtcbiAgICAgICAgICAgICAgICBzdGFydCA9IFtyb29tLmdldFJpZ2h0KCkgKyAxLCByb29tLmdldFRvcCgpXTtcbiAgICAgICAgICAgICAgICBsZW5ndGggPSByb29tLmdldEJvdHRvbSgpIC0gcm9vbS5nZXRUb3AoKSArIDE7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgZGlyID0gWzEsIDBdO1xuICAgICAgICAgICAgICAgIHN0YXJ0ID0gW3Jvb20uZ2V0TGVmdCgpLCByb29tLmdldEJvdHRvbSgpICsgMV07XG4gICAgICAgICAgICAgICAgbGVuZ3RoID0gcm9vbS5nZXRSaWdodCgpIC0gcm9vbS5nZXRMZWZ0KCkgKyAxO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgIGRpciA9IFswLCAxXTtcbiAgICAgICAgICAgICAgICBzdGFydCA9IFtyb29tLmdldExlZnQoKSAtIDEsIHJvb20uZ2V0VG9wKCldO1xuICAgICAgICAgICAgICAgIGxlbmd0aCA9IHJvb20uZ2V0Qm90dG9tKCkgLSByb29tLmdldFRvcCgpICsgMTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBsZXQgYXZhaWwgPSBbXTtcbiAgICAgICAgbGV0IGxhc3RCYWRJbmRleCA9IC0yO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgeCA9IHN0YXJ0WzBdICsgaSAqIGRpclswXTtcbiAgICAgICAgICAgIGxldCB5ID0gc3RhcnRbMV0gKyBpICogZGlyWzFdO1xuICAgICAgICAgICAgYXZhaWwucHVzaChudWxsKTtcbiAgICAgICAgICAgIGxldCBpc1dhbGwgPSAodGhpcy5fbWFwW3hdW3ldID09IDEpO1xuICAgICAgICAgICAgaWYgKGlzV2FsbCkge1xuICAgICAgICAgICAgICAgIGlmIChsYXN0QmFkSW5kZXggIT0gaSAtIDEpIHtcbiAgICAgICAgICAgICAgICAgICAgYXZhaWxbaV0gPSBbeCwgeV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgbGFzdEJhZEluZGV4ID0gaTtcbiAgICAgICAgICAgICAgICBpZiAoaSkge1xuICAgICAgICAgICAgICAgICAgICBhdmFpbFtpIC0gMV0gPSBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBmb3IgKGxldCBpID0gYXZhaWwubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHtcbiAgICAgICAgICAgIGlmICghYXZhaWxbaV0pIHtcbiAgICAgICAgICAgICAgICBhdmFpbC5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIChhdmFpbC5sZW5ndGggPyBSTkcuZ2V0SXRlbShhdmFpbCkgOiBudWxsKTtcbiAgICB9XG4gICAgLyoqXG4gICAgICogRGlnIGEgcG9seWxpbmUuXG4gICAgICovXG4gICAgX2RpZ0xpbmUocG9pbnRzKSB7XG4gICAgICAgIGZvciAobGV0IGkgPSAxOyBpIDwgcG9pbnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgc3RhcnQgPSBwb2ludHNbaSAtIDFdO1xuICAgICAgICAgICAgbGV0IGVuZCA9IHBvaW50c1tpXTtcbiAgICAgICAgICAgIGxldCBjb3JyaWRvciA9IG5ldyBDb3JyaWRvcihzdGFydFswXSwgc3RhcnRbMV0sIGVuZFswXSwgZW5kWzFdKTtcbiAgICAgICAgICAgIGNvcnJpZG9yLmNyZWF0ZSh0aGlzLl9kaWdDYWxsYmFjayk7XG4gICAgICAgICAgICB0aGlzLl9jb3JyaWRvcnMucHVzaChjb3JyaWRvcik7XG4gICAgICAgIH1cbiAgICB9XG4gICAgX2RpZ0NhbGxiYWNrKHgsIHksIHZhbHVlKSB7XG4gICAgICAgIHRoaXMuX21hcFt4XVt5XSA9IHZhbHVlO1xuICAgICAgICBpZi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QgY29vcmRzXG4gICAgICAgIGxldCB5MSA9IHkwIC0gajEgKyBHMjtcbiAgICAgICAgbGV0IHgyID0geDAgLSAxICsgMiAqIEcyOyAvLyBPZmZzZXRzIGZvciBsYXN0IGNvcm5lciBpbiAoeCx5KSB1bnNrZXdlZCBjb29yZHNcbiAgICAgICAgbGV0IHkyID0geTAgLSAxICsgMiAqIEcyO1xuICAgICAgICAvLyBXb3JrIG91dCB0aGUgaGFzaGVkIGdyYWRpZW50IGluZGljZXMgb2YgdGhlIHRocmVlIHNpbXBsZXggY29ybmVyc1xuICAgICAgICBsZXQgaWkgPSBtb2QoaSwgY291bnQpO1xuICAgICAgICBsZXQgamogPSBtb2QoaiwgY291bnQpO1xuICAgICAgICAvLyBDYWxjdWxhdGUgdGhlIGNvbnRyaWJ1dGlvbiBmcm9tIHRoZSB0aHJlZSBjb3JuZXJzXG4gICAgICAgIGxldCB0MCA9IDAuNSAtIHgwICogeDAgLSB5MCAqIHkwO1xuICAgICAgICBpZiAodDAgPj0gMCkge1xuICAgICAgICAgICAgdDAgKj0gdDA7XG4gICAgICAgICAgICBnaSA9IGluZGV4ZXNbaWkgKyBwZXJtc1tqal1dO1xuICAgICAgICAgICAgbGV0IGdyYWQgPSB0aGlzLl9ncmFkaWVudHNbZ2ldO1xuICAgICAgICAgICAgbjAgPSB0MCAqIHQwICogKGdyYWRbMF0gKiB4MCArIGdyYWRbMV0gKiB5MCk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHQxID0gMC41IC0geDEgKiB4MSAtIHkxICogeTE7XG4gICAgICAgIGlmICh0MSA+PSAwKSB7XG4gICAgICAgICAgICB0MSAqPSB0MTtcbiAgICAgICAgICAgIGdpID0gaW5kZXhlc1tpaSArIGkxICsgcGVybXNbamogKyBqMV1dO1xuICAgICAgICAgICAgbGV0IGdyYWQgPSB0aGlzLl9ncmFkaWVudHNbZ2ldO1xuICAgICAgICAgICAgbjEgPSB0MSAqIHQxICogKGdyYWRbMF0gKiB4MSArIG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gICAgICB0aGlzLl9kb25lID0ge307XG4gICAgfVxuICAgIC8qKlxuICAgICAqIENvbXB1dGUgYSBwYXRoIGZyb20gYSBnaXZlbiBwb2ludFxuICAgICAqIEBzZWUgUk9ULlBhdGgjY29tcHV0ZVxuICAgICAqL1xuICAgIGNvbXB1dGUoZnJvbVgsIGZyb21ZLCBjYWxsYmFjaykge1xuICAgICAgICB0aGlzLl90b2RvID0gW107XG4gICAgICAgIHRoaXMuX2RvbmUgPSB7fTtcbiAgICAgICAgdGhpcy5fZnJvbVggPSBmcm9tWDtcbiAgICAgICAgdGhpcy5fZnJvbVkgPSBmcm9tWTtcbiAgICAgICAgdGhpcy5fYWRkKHRoaXMuX3RvWCwgdGhpcy5fdG9ZLCBudWxsKTtcbiAgICAgICAgd2hpbGUgKHRoaXMuX3RvZG8ubGVuZ3RoKSB7XG4gICAgICAgICAgICBsZXQgaXRlbSA9IHRoaXMuX3RvZG8uc2hpZnQoKTtcbiAgICAgICAgICAgIGxldCBpZCA9IGl0ZW0ueCArIFwiLFwiICsgaXRlbS55O1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMuX2RvbmUpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuX2RvbmVbaWRdID0gaXRlbTtcbiAgICAgICAgICAgIGlmIChpdGVtLnggPT0gZnJvbVggJiYgaXRlbS55ID09IGZyb21ZKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgbmVpZ2hib3JzID0gdGhpcy5fZ2V0TmVpZ2hib3JzKGl0ZW0ueCwgaXRlbS55KTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbmVpZ2hib3JzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IG5laWdoYm9yID0gbmVpZ2hib3JzW2ldO1xuICAgICAgICAgICAgICAgIGxldCB4ID0gbmVpZ2hib3JbMF07XG4gICAgICAgICAgICAgICAgbGV0IHkgPSBuZWlnaGJvclsxXTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSB4ICsgXCIsXCIgKyB5O1xuICAgICAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLl9kb25lKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLl9hZGQoeCwgeSwgaXRlbSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGl0ZW0gPSB0aGlzLl9kb25lW2Zyb21YICsgXCIsXCIgKyBmcm9tWV07XG4gICAgICAgIGlmICghaXRlbSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIHdoaWxlIChpdGVtKSB7XG4gICAgICAgICAgICBjYWxsYmFjayhpdGVtLngsIGl0ZW0ueSk7XG4gICAgICAgICAgICBpdGVtID0gaXRlbS5wcmV2O1xuICAgICAgICB9XG4gICAgfVxuICAgIF9hZGQoeCwgeSwgcHJldikge1xuICAgICAgICBsZXQgaCA9IHRoaXMuX2Rpc3RhbmNlKHgsIHkpO1xuICAgICAgICBsZXQgb2JqID0ge1xuICAgICAgICAgICAgeDogeCxcbiAgICAgICAgICAgIHk6IHksXG4gICAgICAgICAgICBwcmV2OiBwcmV2LFxuICAgICAgICAgICAgZzogKHByZXYgPyBwcmV2LmcgKyAxIDogMCksXG4gICAgICAgICAgICBoOiBoXG4gICAgICAgIH07XG4gICAgICAgIC8qIGluc2VydCBpbnRvIHByaW9yaXR5IHF1ZXVlICovXG4gICAgICAgIGxldCBmID0gb2JqLmcgKyBvYmouaDtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aGlzLl90b2RvLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaXRlbSA9IHRoaXMuX3RvZG9baV07XG4gICAgICAgICAgICBsZXQgaXRlbUYgPSBpdGVtLmcgKyBpdGVtLmg7XG4gICAgICAgICAgICBpZiAoZiA8IGl0ZW1GIHx8IChmID09IGl0ZW1GICYmIGggPCBpdGVtLmgpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fdG9kby5zcGxpY2UoaSwgMCwgb2JqKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5fdG9kby5wdXNoKG9iaik7XG4gICAgfVxuICAgIF9kaXN0YW5jZSh4LCB5KSB7XG4gICAgICAgIHN3aXRjaCAodGhpcy5fb3B0aW9ucy50b3BvbG9neSkge1xuICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICAgIHJldHVybiAoTWF0aC5hYnMoeCAtIHRoaXMuX2Zyb21YKSArIE1hdGguYWJzKHkgLSB0aGlzLl9mcm9tWSkpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICAgIGxldCBkeCA9IE1hdGguYWJzKHggLSB0aGlzLl9mcm9tWCk7XG4gICAgICAgICAgICAgICAgbGV0IGR5ID0gTWF0aC5hYnMoeSAtIHRoaXMuX2Zyb21ZKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZHkgKyBNYXRoLm1heCgwLCAoZHggLSBkeSkgLyAyKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgODpcbiAgICAgICAgICAgICAgICByZXR1cm4gTWF0aC5tYXgoTWF0aC5hYnMoeCAtIHRoaXMuX2Zyb21YKSwgTWF0aC5hYnMoeSAtIHRoaXMuX2Zyb21ZKSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICB9XG59XG4iLCJpbXBvcnQgUGF0aCBmcm9tIFwiLi9wYXRoLmpzXCI7XG4vKipcbiAqIEBjbGFzcyBTaW1wbGlmaWVkIERpamtzd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4gICAgfVxuICAgIC8qKlxuICAgICAqIENvbXB1dGUgYSBub24tY2FjaGVkIHZhbHVlXG4gICAgICovXG4gICAgX2NvbXB1dGUoZnJvbVgsIGZyb21ZKSB7XG4gICAgICAgIHdoaWxlICh0aGlzLl90b2RvLmxlbmd0aCkge1xuICAgICAgICAgICAgbGV0IGl0ZW0gPSB0aGlzLl90b2RvLnNoaWZ0KCk7XG4gICAgICAgICAgICBpZiAoaXRlbS54ID09IGZyb21YICYmIGl0ZW0ueSA9PSBmcm9tWSkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBuZWlnaGJvcnMgPSB0aGlzLl9nZXROZWlnaGJvcnMoaXRlbS54LCBpdGVtLnkpO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBuZWlnaGJvcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgbmVpZ2hib3IgPSBuZWlnaGJvcnNbaV07XG4gICAgICAgICAgICAgICAgbGV0IHggPSBuZWlnaGJvclswXTtcbiAgICAgICAgICAgICAgICBsZXQgeSA9IG5laWdoYm9yWzFdO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IHggKyBcIixcIiArIHk7XG4gICAgICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMuX2NvbXB1dGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIH0gLyogYWxyZWFkeSBkb25lICovXG4gICAgICAgICAgICAgICAgdGhpcy5fYWRkKHgsIHksIGl0ZW0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIF9hZGQoeCwgeSwgcHJldikge1xuICAgICAgICBsZXQgb2JqID0ge1xuICAgICAgICAgICAgeDogeCxcbiAgICAgICAgICAgIHk6IHksXG4gICAgICAgICAgICBwcmV2OiBwcmV2XG4gICAgICAgIH07XG4gICAgICAgIHRoaXMu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lvbnMudG9wb2xvZ3ldO1xuICAgICAgICBpZiAodGhpcy5fb3B0aW9ucy50b3BvbG9neSA9PSA4KSB7IC8qIHJlb3JkZXIgZGlycyBmb3IgbW9yZSBhZXN0aGV0aWMgcmVzdWx0ICh2ZXJ0aWNhbC9ob3Jpem9udGFsIGZpcnN0KSAqL1xuICAgICAgICAgICAgdGhpcy5fZGlycyA9IFtcbiAgICAgICAgICAgICAgICB0aGlzLl9kaXJzWzBdLFxuICAgICAgICAgICAgICAgIHRoaXMuX2RpcnNbMl0sXG4gICAgICAgICAgICAgICAgdGhpcy5fZGlyc1s0XSxcbiAgICAgICAgICAgICAgICB0aGlzLl9kaXJzWzZdLFxuICAgICAgICAgICAgICAgIHRoaXMuX2RpcnNbMV0sXG4gICAgICAgICAgICAgICAgdGhpcy5fZGlyc1szXSxcbiAgICAgICAgICAgICAgICB0aGlzLl9kaXJzWzVdLFxuICAgICAgICAgICAgICAgIHRoaXMuX2RpcnNbN11cbiAgICAgICAgICAgIF07XG4gICAgICAgIH1cbiAgICB9XG4gICAgX2dldE5laWdoYm9ycyhjeCwgY3kpIHtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRoaXMuX2RpcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBkaXIgPSB0aGlzLl9kaXJzW2ldO1xuICAgICAgICAgICAgbGV0IHggPSBjeCArIGRpclswXTtcbiAgICAgICAgICAgIGxldCB5ID0gY3kgKyBkaXJbMV07XG4gICAgICAgICAgICBpZiAoIXRoaXMuX3Bhc3NhYmxlQ2FsbGJhY2soeCwgeSkpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdC5wdXNoKFt4LCB5XSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG59XG4iLCIvKipcbiAqIFRoa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sZXM6IFwiICsgcHJpb3JDb3VudCk7XG4gICAgICAgIGxldCBkYXRhQ291bnQgPSBPYmplY3Qua2V5cyh0aGlzLl9kYXRhKS5sZW5ndGg7XG4gICAgICAgIGxldCBldmVudENvdW50ID0gMDtcbiAgICAgICAgZm9yIChsZXQgcCBpbiB0aGlzLl9kYXRhKSB7XG4gICAgICAgICAgICBldmVudENvdW50ICs9IE9iamVjdC5rZXlzKHRoaXMuX2RhdGFbcF0pLmxlbmd0aDtcbiAgICAgICAgfVxuICAgICAgICBwYXJ0cy5wdXNoKFwiZGljdGlvbmFyeSBzaXplIChjb250ZXh0cyk6IFwiICsgZGF0YUNvdW50KTtcbiAgICAgICAgcGFydHMucHVzaChcImRpY3Rpb25hcnkgc2l6ZSAoZXZlbnRzKTogXCIgKyBldmVudENvdW50KTtcbiAgICAgICAgcmV0dXJuIHBhcnRzLmpvaW4oXCIsIFwiKTtcbiAgICB9XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHtzdHJpbmd9XG4gICAgICogQHJldHVybnMge3N0cmluZ1tdfVxuICAgICAqL1xuICAgIF9zcGxpdChzdHIpIHtcbiAgICAgICAgcmV0dXJuIHN0ci5zcGxpdCh0aGlzLl9vcHRpb25zLndvcmRzID8gL1xccysvIDogXCJcIik7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7c3RyaW5nW119XG4gICAgICogQHJldHVybnMge3N0cmluZ31cbiAgICAgKi9cbiAgICBfam9pbihhcnIpIHtcbiAgICAgICAgcmV0dXJuIGFyci5qb2luKHRoaXMuX29wdGlvbnMud29yZHMgPyBcIiBcIiA6IFwiXCIpO1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBAcGFyYW0ge3N0cmluZ1tdfSBjb250ZXh0XG4gICAgICogQHBhcmFtIHtzdHJpbmd9IGV2ZW50XG4gICAgICovXG4gICAgX29ic2VydmVFdmVudChjb250ZXh0LCBldmVudCkge1xuICAgICAgICBsZXQga2V5ID0gdGhpcy5fam9pbihjb250ZXh0KTtcbiAgICAgICAgaWYgKCEoa2V5IGluIHRoaXMuX2RhdGEpKSB7XG4gICAgICAgICAgICB0aGlzLl9kYXRhW2tleV0gPSB7fTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgZGF0YSA9IHRoaXMuX2RhdGFba2V5XTtcbiAgICAgICAgaWYgKCEoZXZlbnQgaW4gZGF0YSkpIHtcbiAgICAgICAgICAgIGRhdGFbZXZlbnRdID0gMDtcbiAgICAgICAgfVxuICAgICAgICBkYXRhW2V2ZW50XSsrO1xuICAgIH1cbiAgICAvKipcbiAgICAgKiBAcGFyYW0ge3N0cmluZ1tdfVxuICAgICAqIEByZXR1cm5zIHtzdHJpbmd9XG4gICAgICovXG4gICAgX3NhbXBsZShjb250ZXh0KSB7XG4gICAgICAgIGNvbnRleHQgPSB0aGlzLl9iYWNrb2ZmKGNvbnRleHQpO1xuICAgICAgICBsZXQga2V5ID0gdGhpcy5fam9pbihjb250ZXh0KTtcbiAgICAgICAgbGV0IGRhdGEgPSB0aGlzLl9kYXRhW2tleV07XG4gICAgICAgIGxldCBhdmFpbGFibGUgPSB7fTtcbiAgICAgICAgaWYgKHRoaXMuX29wdGlvbnMucHJpb3IpIHtcbiAgICAgICAgICAgIGZvciAobGV0IGV2ZW50IGluIHRoaXMuX3ByaW9yVmFsdWVzKSB7XG4gICAgICAgICAgICAgICAgYXZhaWxhYmxlW2V2ZW50XSA9IHRoaXMuX3ByaW9yVmFsdWVzW2V2ZW50XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZvciAobGV0IGV2ZW50IGluIGRhdGEpIHtcbiAgICAgICAgICAgICAgICBhdmFpbGFibGVbZXZlbnRdICs9IGRhdGFbZXZlbnRdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgYXZhaWxhYmxlID0gZGF0YTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gUk5HLmdldFdlaWdodGVkVmFsdWUoYXZhaWxhYmxlKTtcbiAgICB9XG4gICAgLyoqXG4gICAgICogQHBhcmFtIHtzdHJpbmdbXX1cbiAgICAgKiBAcmV0dXJucyB7c3RyaW5nW119XG4gICAgICovXG4gICAgX2JhY2tvZmYoY29udGV4dCkge1xuICAgICAgICBpZiAoY29udGV4dC5sZW5ndGggPiB0aGlzLl9vcHRpb25zLm9yZGVyKSB7XG4gICAgICAgICAgICBjb250ZXh0ID0gY29udGV4dC5zbGljZSgtdGhpcy5fb3B0aW9ucy5vcmRlcik7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoY29udGV4dC5sZW5ndGggPCB0aGlzLl9vcHRpb25zLm9yZGVyKSB7XG4gICAgICAgICAgICBjb250ZXh0ID0gdGhpcy5fcHJlZml4LnNsaWNlKDAsIHRoaXMuX29wdGlvbnMub3JkZXIgLSBjb250ZXh0Lmxlbmd0aCkuY29uY2F0KGNvbnRleHQpO1xuICAgICAgICB9XG4gICAgICAgIHdoaWxlICghKHRoaXMuX2pvaW4oY29udGV4dCkgaW4gdGhpcy5fZGF0YSkgJiYgY29udGV4dC5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBjb250ZXh0ID0gY29udGV4dC5zbGljZSgxKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gY29udGV4dDtcbiAgICB9XG59XG4iLCIvKipcbiAqIEBuYW1lc3BhY2VcbiAqIENvbnRhaW5zIHRleHQgdG9rZW5pemF0aW9uIGFuZCBicmVha2luZyByb3V0aW5lc1xuICovXG5jb25zdCBSRV9DT0xPUlMgPSAvJShbYmNdKXsoW159XSopfS9nO1xuLy8gdG9rZW4gdHlwZXNcbmV4cG9ydCBjb25zdCBUWVBFX1RFWFQgPSAwO1xuZXhwb3J0IGNvbnN0IFRZUEVfTkVXTElORSA9IDE7XG5leHBvcnQgY29uc3QgVFlQRV9GRyA9IDI7XG5leHBvcnQgY29uc3QgVFlQRV9CRyA9IDM7XG4vKipcbiAqIE1lYXN1cm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rZW5pemF0aW9uIHBhc3MgLSBzcGxpdCB0ZXh0cyBhbmQgY29sb3IgZm9ybWF0dGluZyBjb21tYW5kcyAqL1xuICAgIGxldCBvZmZzZXQgPSAwO1xuICAgIHN0ci5yZXBsYWNlKFJFX0NPTE9SUywgZnVuY3Rpb24gKG1hdGNoLCB0eXBlLCBuYW1lLCBpbmRleCkge1xuICAgICAgICAvKiBzdHJpbmcgYmVmb3JlICovXG4gICAgICAgIGxldCBwYXJ0ID0gc3RyLnN1YnN0cmluZyhvZmZzZXQsIGluZGV4KTtcbiAgICAgICAgaWYgKHBhcnQubGVuZ3RoKSB7XG4gICAgICAgICAgICByZXN1bHQucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogVFlQRV9URVhULFxuICAgICAgICAgICAgICAgIHZhbHVlOiBwYXJ0XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICAvKiBjb2xvciBjb21tYW5kICovXG4gICAgICAgIHJlc3VsdC5wdXNoKHtcbiAgICAgICAgICAgIHR5cGU6ICh0eXBlID09IFwiY1wiID8gVFlQRV9GRyA6IFRZUEVfQkcpLFxuICAgICAgICAgICAgdmFsdWU6IG5hbWUudHJpbSgpXG4gICAgICAgIH0pO1xuICAgICAgICBvZmZzZXQgPSBpbmRleCArIG1hdGNoLmxlbmd0aDtcbiAgICAgICAgcmV0dXJuIFwiXCI7XG4gICAgfSk7XG4gICAgLyogbGFzdCByZW1haW5pbmcgcGFydCAqL1xuICAgIGxldCBwYXJ0ID0gc3RyLnN1YnN0cmluZyhvZmZzZXQpO1xuICAgIGlmIChwYXJ0Lmxlbmd0aCkge1xuICAgICAgICByZXN1bHQucHVzaCh7XG4gICAgICAgICAgICB0eXBlOiBUWVBFX1RFWFQsXG4gICAgICAgICAgICB2YWx1ZTogcGFydFxuICAgICAgICB9KTtcbiAgICB9XG4gICAgcmV0dXJuIGJyZWFrTGluZXMocmVzdWx0LCBtYXhXaWR0aCk7XG59XG4vKiBpbnNlcnQ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ICgxKSB7XG4gICAgICAgICAgICAgICAgbGV0IG5leHRJbmRleCA9IHRva2VuLnZhbHVlLmluZGV4T2YoXCIgXCIsIGluZGV4ICsgMSk7XG4gICAgICAgICAgICAgICAgaWYgKG5leHRJbmRleCA9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGxpbmVMZW5ndGggKyBuZXh0SW5kZXggPiBtYXhXaWR0aCkge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaW5kZXggPSBuZXh0SW5kZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaW5kZXggIT0gLTEpIHsgLyogYnJlYWsgYXQgc3BhY2Ugd2l0aGluIHRoaXMgb25lICovXG4gICAgICAgICAgICAgICAgdG9rZW4udmFsdWUgPSBicmVha0luc2lkZVRva2VuKHRva2VucywgaSwgaW5kZXgsIHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAobGFzdFRva2VuV2l0aFNwYWNlICE9IC0xKSB7IC8qIGlzIHRoZXJlIGEgcHJldmlvdXMgdG9rZW4gd2hlcmUgYSBicmVhayBjYW4gb2NjdXI/ICovXG4gICAgICAgICAgICAgICAgbGV0IHRva2VuID0gdG9rZW5zW2xhc3RUb2tlbldpdGhTcGFjZV07XG4gICAgICAgICAgICAgICAgbGV0IGJyZWFrSW5kZXggPSB0b2tlbi52YWx1ZS5sYXN0SW5kZXhPZihcIiBcIik7XG4gICAgICAgICAgICAgICAgdG9rZW4udmFsdWUgPSBicmVha0luc2lkZVRva2VuKHRva2VucywgbGFzdFRva2VuV2l0aFNwYWNlLCBicmVha0luZGV4LCB0cnVlKTtcbiAgICAgICAgICAgICAgICBpID0gbGFzdFRva2VuV2l0aFNwYWNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7IC8qIGZvcmNlIGJyZWFrIGluIHRoaXMgdG9rZW4gKi9cbiAgICAgICAgICAgICAgICB0b2tlbi52YWx1ZSA9IGJyZWFrSW5zaWRlVG9rZW4odG9rZW5zLCBpLCBtYXhXaWR0aCAtIGxpbmVMZW5ndGgsIGZhbHNlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIHsgLyogbGluZSBub3QgbG9uZywgY29udGludWUgKi9cbiAgICAgICAgICAgIGxpbmVMZW5ndGggKz0gdG9rZW4udmFsdWUubGVuZ3RoO1xuICAgICAgICAgICAgaWYgKHRva2VuLnZhbHVlLmluZGV4T2YoXCIgXCIpICE9IC0xKSB7XG4gICAgICAgICAgICAgICAgbGFzdFRva2VuV2l0aFNwYWNlID0gaTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpKys7IC8qIGFkdmFuY2UgdG8gbmV4dCB0b2tlbiAqL1xuICAgIH1cbiAgICB0b2tlbnMucHVzaCh7IHR5cGU6IFRZUEVfTkVXTElORSB9KTsgLyogaW5zZXJ0IGZha2UgbmV3bGluZSB0byBmaXggdGhlIGxhc3QgdGV4dCBsaW5lICovXG4gICAgLyogcmVtb3ZlIHRyYWlsaW5nIHNwYWNlIGZyb20gdGV4dCB0b2tlbnMgYmVmb3JlIG5ld2xpbmVzICovXG4gICAgbGV0IGxhc3RUZXh0VG9rZW4gPSBudWxsO1xuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdG9rZW5zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgIGxldCB0b2tlbiA9IHRva2Vuc1tpXTtcbiAgICAgICAgc3dpdGNoICh0b2tlbi50eXBlKSB7XG4gICAgICAgICAgICBjYXNlIFRZUEVfVEVYVDpcbiAgICAgICAgICAgICAgICBsYXN0VGV4dFRva2VuID0gdG9rZW47XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIFRZUEVfTkVXTElORTpcbiAgICAgICAgICAgICAgICBpZiAobGFzdFRleHRUb2tlbikgeyAvKiByZW1vdmUgdHJhaWxpbmcgc3BhY2UgKi9cbiAgICAgICAgICAgICAgICAgICAgbGV0IGFyciA9IGxhc3RUZXh0VG9rZW4udmFsdWUuc3BsaXQoXCJcIik7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlIChhcnIubGVuZ3RoICYmIGFyclthcnIubGVuZ3RoIC0gMV0gPT0gXCIgXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wb3AoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBsYXN0VGV4dFRva2VuLnZhbHVlID0gYXJyLmpvaW4oXCJcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGxhc3RUZXh0VG9rZW4gPSBudWxsO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgfVxuICAgIHRva2Vucy5wb3AoKTsgLyogcmVtb3ZlIGZha2UgdG9rZW4gKi9cbiAgICByZXR1cm4gdG9rZW5zO1xufVxuLyoqXG4gKiBDcmVhdGUgbmV3IHRva2VucyBhbmQgaW5zZXJ0IHRoZW0gaW50byB0aGUgc3RyZWFtXG4gKiBAcGFyYW0ge29iamVjdFtdfSB0b2tlbnNcbiAqIEBwYXJhbSB7aW50fSB0b2tlbkluZGV4IFRva2VuIGJlaW5nIHByb2Nlc3NlZFxuICogQHBhcmFtIHtpbnR9IGJyZWFrSW5kZXggSW5kZXggd2l0aGluIGN1cnJlbnQgdG9rZW4ncyB2YWx1ZVxuICogQHBhcmFtIHtib29sfSByZW1vdmVCcmVha0NoYXIgRG8gd2Ugd2FudCB0byByZW1vdmUgdGhlIGJyZWFraW5nIGNoYXJhY3Rlcj9cbiAqIEByZXR1cm5zIHtzdHJpbmd9IHJlbWFpbmluZyB1bmJyb2tlbiB0b2tlbiB2YWx1ZVxuICovXG5mdW5jdGlvbiBicmVha0luc2lkZVRva2VuKHRva2V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wT2JqZWN0LCB4LCB5LCB0aWxlQmlvbWUpIHtcclxuICAgICAgICBjb25zdCBuZWlnaGJvclBvc2l0aW9ucyA9IFtcclxuICAgICAgICAgICAgW3gsIHkgLSAxXSxcclxuICAgICAgICAgICAgW3ggLSAxLCB5XSxcclxuICAgICAgICAgICAgW3ggKyAxLCB5XSxcclxuICAgICAgICAgICAgW3gsIHkgKyAxXSxcclxuICAgICAgICAgICAgW3ggLSAxLCB5IC0gMV0sXHJcbiAgICAgICAgICAgIFt4ICsgMSwgeSAtIDFdLFxyXG4gICAgICAgICAgICBbeCAtIDEsIHkgKyAxXSxcclxuICAgICAgICAgICAgW3ggKyAxLCB5ICsgMV0sIC8vIHNvdXRoZWFzdFxyXG4gICAgICAgIF07XHJcbiAgICAgICAgLy8gbGV0IGlzTW9pc3REaXJ0O1xyXG4gICAgICAgIGlmICh0aWxlQmlvbWUgPT0gbnVsbCkge1xyXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIC8vIGlmICh0aWxlQmlvbWUuaWQgPT09IFwibW9pc3RkaXJ0XCIpIHtcclxuICAgICAgICAvLyAgIGlzTW9pc3REaXJ0ID0gdHJ1ZTtcclxuICAgICAgICAvLyB9XHJcbiAgICAgICAgZm9yIChjb25zdCBbbngsIG55XSBvZiBuZWlnaGJvclBvc2l0aW9ucykge1xyXG4gICAgICAgICAgICBjb25zdCBuZWlnaGJvckJpb21lID0gbWFwT2JqZWN0W2Ake254fSwke255fWBdO1xyXG4gICAgICAgICAgICBpZiAobmVpZ2hib3JCaW9tZSA9PSBudWxsKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy8gaWYgKGlzTW9pc3REaXJ0KSB7XHJcbiAgICAgICAgICAgIC8vICAgaWYgKFxyXG4gICAgICAgICAgICAvLyAgICAgbmVpZ2hib3JCaW9tZS5pZCA9PT0gXCJzbm93bW9pc3RkaXJ0XCIgfHxcclxuICAgICAgICAgICAgLy8gICAgIG5laWdoYm9yQmlvbWUuaWQgPT09IFwibW9pc3RkaXJ0XCJcclxuICAgICAgICAgICAgLy8gICApIHtcclxuICAgICAgICAgICAgLy8gICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgICAgICAvLyAgIH1cclxuICAgICAgICAgICAgLy8gICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgICAgIC8vIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICB9XHJcbiAgICBzdGF0aWMgYXV0b3RpbGVMb29rdXAobWFwT2JqZWN0LCB4X2JvdW5kYXJ5LCB5X2JvdW5kYXJ5LCB4LCB5LCB0aWxlQmlvbWUpIHtcclxuICAgICAgICBsZXQgc3VtID0gMDtcclxuICAgICAgICBsZXQgbiA9IGZhbHNlO1xyXG4gICAgICAgIGxldCBlID0gZmFsc2U7XHJcbiAgICAgICAgbGV0IHMgPSBmYWxzZTtcclxuICAgICAgICBsZXQgdyA9IGZhbHNlO1xyXG4gICAgICAgIGxldCBza2lwQmlvbWVzO1xyXG4gICAgICAgIGxldCBvbmx5QmlvbWVzO1xyXG4gICAgICAgIGlmICh0aWxlQmlvbWUuc2tpcEF1dG9UaWxlVHlwZXMpIHtcclxuICAgICAgICAgICAgc2tpcEJpb21lcyA9IFt0aWxlQmlvbWUuaWQsIC4uLnRpbGVCaW9tZS5za2lwQXV0b1RpbGVUeXBlc107XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBza2lwQmlvbWVzID0gW3RpbGVCaW9tZS5pZF07XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh0aWxlQmlvbWUub25seUF1dG9UaWxlVHlwZXMpIHtcclxuICAgICAgICAgICAgb25seUJpb21lcyA9IHRpbGVCaW9tZS5vbmx5QXV0b1RpbGVUeXBlcztcclxuICAgICAgICAgICAgc2tpcEJpb21lcyA9IHVuZGVmaW5lZDsgLy8gaWYgb25seUJpb21lcyBpcyBzZXQsIHNraXBCaW9tZXMgaXMgaWdub3JlZFxyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoeSA+IDAgJiZcclxuICAgICAgICAgICAgdGhpcy5iZXR0ZXJTaG91bGRBdXRvdGlsZShtYXBPYmplY3RbYCR7eH0sJHt5IC0gMX1gXS5pZCwgb25seUJpb21lcywgc2tpcEJpb21lcykpIHtcclxuICAgICAgICAgICAgbiA9IHRydWU7XHJcbiAgICAgICAgICAgIHN1bSArPSBBdXRvdGlsZS5OO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoeCA+IDAgJiZcclxuICAgICAgICAgICAgdGhpcy5iZXR0ZXJTaG91bGRBdXRvdGlsZShtYXBPYmplY3RbYCR7eCAtIDF9LCR7eX1gXS5pZCwgb25seUJpb21lcywgc2tpcEJpb21lcykpIHtcclxuICAgICAgICAgICAgdyA9IHRydWU7XHJcbiAgICAgICAgICAgIHN1bSArPSBBdXRvdGlsZS5XO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoeCA8IHhfYm91bmRhcnkgJiZcclxuICAgICAgICAgICAgdGhpcy5iZXR0ZXJTaG91bGRBdXRvdGlsZShtYXBPYmplY3RbYCR7eCArIDF9LCR7eX1gXS5pZCwgb25seUJpb21lcywgc2tpcEJpb21lcykpIHtcclxuICAgICAgICAgICAgZSA9IHRydWU7XHJcbiAgICAgICAgICAgIHN1bSArPSBBdXRvdGlsZS5FO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoeSA8IHlfYm91bmRhcnkgJiZcclxuICAgICAgICAgICAgdGhpcy5iZXR0ZXJTaG91bGRBdXRvdGlsZShtYXBPYmplY3RbYCR7eH0sJHt5ICsgMX1gXS5pZCwgb25seUJpb21lcywgc2tpcEJpb21lcykpIHtcclxuICAgICAgICAgICAgcyA9IHRydWU7XHJcbiAgICAgICAgICAgIHN1bSArPSBBdXRvdGlsZS5TO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAobiAmJlxyXG4gICAgICAgICAgICB3ICYmXHJcbiAgICAgICAgICAgIHkgPiAwICYmXHJcbiAgICAgICAgICAgIHggPiAwICYmXHJcbiAgICAgICAgICAgIHRoaXMuYmV0dGVyU2hvdWxkQXV0b3RpbGUobWFwT2JqZWN0W2Ake3ggLSAxfSwke3kgLSAxfWBdLmlkLCBvbmx5QmlvbWVzLCBza2lwQmlvbWVzKSlcclxuICAgICAgICAgICAgc3VtICs9IEF1dG90aWxlLk5XO1xyXG4gICAgICAgIGlmIChuICYmXHJcbiAgICAgICAgICAgIGUgJiZcclxuICAgICAgICAgICAgeSA+IDAgJiZcclxuICAgICAgICAgICAgeCA8IHhfYm91bmRhcnkgJiZcclxuICAgICAgICAgICAgdGhpcy5iZXR0ZXJTaG91bGRBdXRvdGlsZShtYXBPYmplY3RbYCR7eCArIDF9LCR7eSAtIDF9YF0uaWQsIG9ubHlCaW9tZXMsIHNraXBCaW9tZXMpKVxyXG4gICAgICAgICAgICBzdW0gKz0gQXV0b3RpbGUuTkU7XHJcbiAgICAgICAgaWYgKHMgJiZcclxuICAgICAgICAgICAgdyAmJlxyXG4gICAgICAgICAgICB5IDwgeV9ib3VuZGFyeSAmJlxyXG4gICAgICAgICAgICB4ID4gMCAmJlxyXG4gICAgICAgICAgICB0aGlzLmJldHRlclNob3VsZEF1dG90aWxlKG1hcE9iamVjdFtgJHt4IC0gMX0sJHt5ICsgMX1gXS5pZCwgb25seUJpb21lcywgc2tpcEJpb21lcykpXHJcbiAgICAgICAgICAgIHN1bSArPSBBdXRvdGlsZS5TVztcclxuICAgICAgICBpZiAocyAmJlxyXG4gICAgICAgICAgICBlICYmXHJcbiAgICAgICAgICAgIHggPCB4X2JvdW5kYXJ5ICYmXHJcbiAgICAgICAgICAgIHkgPCB5X2JvdW5kYXJ5ICYmXHJcbiAgICAgICAgICAgIHRoaXMuYmV0dGVyU2hvdWxkQXV0b3RpbGUobWFwT2J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obGV0IHggPSAwOyB4IDw9IG1heFg7IHgrKykge1xyXG4gICAgICAgICAgICAgICAgY29uc3Qga2V5ID0gYCR7eH0sJHt5fWA7XHJcbiAgICAgICAgICAgICAgICBjb25zdCB0aWxlVmFsdWUgPSBtYXBPYmplY3Rba2V5XTtcclxuICAgICAgICAgICAgICAgIGlmICghdGhpcy5zaG91bGRBdXRvVGlsZShtYXBPYmplY3QsIHgsIHksIHRpbGVWYWx1ZSkpIHtcclxuICAgICAgICAgICAgICAgICAgICB0aWxlc1trZXldID0gNDc7XHJcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB0aWxlc1trZXldID0gQXV0b3RpbGUuYXV0b3RpbGVMb29rdXAobWFwT2JqZWN0LCBtYXhYLCBtYXhZLCB4LCB5LCB0aWxlVmFsdWUpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNvbnNvbGUubG9nKFwiYXV0b3RpbGVkIG1hcDogXCIsIHRpbGVzKTtcclxuICAgICAgICByZXR1cm4gdGlsZXM7XHJcbiAgICB9XHJcbn1cclxuQXV0b3RpbGUuTlcgPSBNYXRoLnBvdygyLCAwKTtcclxuQXV0b3RpbGUuTiA9IE1hdGgucG93KDIsIDEpO1xyXG5BdXRvdGlsZS5ORSA9IE1hdGgucG93KDIsIDIpO1xyXG5BdXRvdGlsZS5XID0gTWF0aC5wb3coMiwgMyk7XHJcbkF1dG90aWxlLkUgPSBNYXRoLnBvdygyLCA0KTtcclxuQXV0b3RpbGUuU1cgPSBNYXRoLnBvdygyLCA1KTtcclxuQXV0b3RpbGUuUyA9IE1hdGgucG93KDIsIDYpO1xyXG5BdXRvdGlsZS5TRSA9IE1hdGgucG93KDIsIDcpO1xyXG5BdXRvdGlsZS5CSVRNQVNLID0ge1xyXG4gICAgMjogNDQsXHJcbiAgICA4OiA0NSxcclxuICAgIDEwOiAzOSxcclxuICAgID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OiB7XHJcbiAgICAgICAgICAgIGhlaWdodDoge1xyXG4gICAgICAgICAgICAgICAgbWluOiAwLjUsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIG1vaXN0dXJlOiB7XHJcbiAgICAgICAgICAgICAgICBtaW46IDAsXHJcbiAgICAgICAgICAgICAgICBtYXg6IDEsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgfSxcclxuICAgIH0sXHJcbiAgICBoaWxsc2xvdzoge1xyXG4gICAgICAgIGlkOiBcImhpbGxzbG93XCIsXHJcbiAgICAgICAgbmFtZTogXCJMb3cgSGlsbHNcIixcclxuICAgICAgICBkZXNjcmlwdGlvbjogXCJsb3cgaGlsbHMuXCIsXHJcbiAgICAgICAgY29sb3I6IFwiIzZlNjg2NFwiLFxyXG4gICAgICAgIGJhc2VUaWxlOiBcImJpb21lcy9oaWxsc2xvdy9oaWxsc2xvd19zcHJpbmdfbW9pc3RkaXJ0XzQ3XCIsXHJcbiAgICAgICAgYXV0b3RpbGVQcmVmaXg6IFwiYmlvbWVzL2hpbGxzbG93L2hpbGxzbG93X3NwcmluZ19tb2lzdGRpcnRfXCIsXHJcbiAgICAgICAgc2tpcEF1dG9UaWxlVHlwZXM6IFtcImhpbGxzbWlkXCIsIFwiaGlsbHNoaWdoXCJdLFxyXG4gICAgICAgIGdlbmVyYXRpb25PcHRpb25zOiB7XHJcbiAgICAgICAgICAgIGhlaWdodDoge1xyXG4gICAgICAgICAgICAgICAgbWluOiAwLjY0LFxyXG4gICAgICAgICAgICAgICAgbWF4OiAwLjcsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgfSxcclxuICAgIH0sXHJcbiAgICBoaWxsc21pZDoge1xyXG4gICAgICAgIGlkOiBcImhpbGxzbWlkXCIsXHJcbiAgICAgICAgbmFtZTogXCJNaWQgSGlsbHNcIixcclxuICAgICAgICBkZXNjcmlwdGlvbjogXCJNaWQgaGlsbHMuXCIsXHJcbiAgICAgICAgY29sb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IG1pbjogMC43OCxcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICB9LFxyXG4gICAgfSxcclxuICAgIGdyYXNzOiB7XHJcbiAgICAgICAgaWQ6IFwiZ3Jhc3NcIixcclxuICAgICAgICBuYW1lOiBcIldpbGQgR3Jhc3NcIixcclxuICAgICAgICBkZXNjcmlwdGlvbjogXCJUYWxsIGdyYXNzIHBlcmZlY3QgZm9yIHNtYWxsIGFuaW1hbHMgdG8gaGlkZSBpbi5cIixcclxuICAgICAgICBjb2xvcjogXCIjNzRjODU3XCIsXHJcbiAgICAgICAgYmFzZVRpbGU6IFwiYmlvbWVzL2dyYXNzL2dyYXNzX3NwcmluZ19tb2lzdGRpcnRfNDdcIixcclxuICAgICAgICBhdXRvdGlsZVByZWZpeDogXCJiaW9tZXMvZ3Jhc3MvZ3Jhc3Nfc3ByaW5nX21vaXN0ZGlydF9cIixcclxuICAgICAgICBnZW5lcmF0aW9uT3B0aW9uczoge1xyXG4gICAgICAgICAgICBtb2lzdHVyZToge1xyXG4gICAgICAgICAgICAgICAgbWluOiAwLjUsXHJcbiAgICAgICAgICAgICAgICBtYXg6IDAuNyxcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgdGVtcGVyYXR1cmU6IHtcclxuICAgICAgICAgICAgICAgIG1pbjogMC40LFxyXG4gICAgICAgICAgICAgICAgbWF4OiAwLjcsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgfSxcclxuICAgIH0sXHJcbiAgICBzaG9ydGdyYXNzOiB7XHJcbiAgICAgICAgaWQ6IFwic2hvcnRncmFzc1wiLFxyXG4gICAgICAgIG5hbWU6IFwiU2hvcnQgR3Jhc3NcIixcclxuICAgICAgICBkZXNjcmlwdGlvbjogXCJQbGVhc2FudGx5IHNob3J0IGdyYXNzLCBmb3VuZCBjb21tb25seSBtb3N0IGV2ZXJ5d2hlcmUuXCIsXHJcbiAgICAgICAgY29sb3I6IFwiIzc0Yzg1N1wiLFxyXG4gICAgICAgI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gICAgbWluOiAwLjc1LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBtb2lzdHVyZToge1xyXG4gICAgICAgICAgICAgICAgbWluOiAwLjY1LFxyXG4gICAgICAgICAgICAgICAgbWF4OiAwLjgsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgfSxcclxuICAgIH0sXHJcbiAgICBzd2FtcDoge1xyXG4gICAgICAgIGlkOiBcInN3YW1wXCIsXHJcbiAgICAgICAgbmFtZTogXCJTd2FtcFwiLFxyXG4gICAgICAgIGRlc2NyaXB0aW9uOiBcIlRoZSBtdXJreSB3YXRlciBjb3VsZCBiZSBoaWRpbmcgYW55dGhpbmcuLi5cIixcclxuICAgICAgICBiYXNlVGlsZTogXCJiaW9tZXMvc3dhbXAvc3dhbXBfc3ByaW5nX21vaXN0ZGlydF80N1wiLFxyXG4gICAgICAgIGF1dG90aWxlUHJlZml4OiBcImJpb21lcy9zd2FtcC9zd2FtcF9zcHJpbmdfbW9pc3RkaXJ0X1wiLFxyXG4gICAgICAgIGNvbG9yOiBcIiM2MDZkNGNcIixcclxuICAgICAgICBnZW5lcmF0aW9uT3B0aW9uczoge1xyXG4gICAgICAgICAgICBoZWlnaHQ6IHtcclxuICAgICAgICAgICAgICAgIG1pbjogMC41LFxyXG4gICAgICAgICAgICAgICAgbWF4OiAwLjYsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIG1vaXN0dXJlOiB7XHJcbiAgICAgICAgICAgICAgICBtaW46IDAuOCxcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgdGVtcGVyYXR1cmU6IHtcclxuICAgICAgICAgICAgICAgIG1pbjogMC41LFxyXG4gICAgICAgICAgICAgICAgbWF4OiAwLjgsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgfSxcclxuICAgIH0sXHJcbiAgICB2YWxsZXk6IHtcclxuICAgICAgICBpZDogXCJ2YWxsZXlcIixcclxuICAgICAgICBuYW1lOiBcIlZhbGxleVwiLFxyXG4gICAgICAgIGRlc2NyaXB0aW9uOiBcIkEgbG93LWx5aW5nIGFyZWEgcHJvdGVjdGVkIGJ5IGhpbGxzLlwiLFxyXG4gICAgICAgIGJhc2VUaWxlOiBcImJpb21lcy92YWxsZXkvdmFsbGV5X3NwcmluZ19tb2lzdGRpcnRfNDdcIixcclxuICAgICAgICBhdXRvdGlsZVByZWZpeDogXCJiaW9tZXMvdmFsbGV5L3ZhbGxleV9zcHJpbmdfbW9pc3RkaXJ0X1wiLFxyXG4gICAgICAgIGNvbG9yOiBcIiM4ZGY0OGRcIixcclxuICAgICAgICBnZW5lcmF0aW9uT3B0aW9uczoge1xyXG4gICAgICAgICAgICBoZWlnaHQ6IHtcclxuICAgICAgICAgICAgICAgIG1pbjogMC41LFxyXG4gICAgICAgICAgICAgICAgbWF4OiAwLjYsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIG1vaXN0dXJlOiB7XHJcbiAgICAgICAgICAgICAgICBtaW46IDAuNSxcclxuICAgICAgICAgICAgICAgIG1heDogMC44LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB0ZW1wZXJhdHVyZToge1xyXG4gICAgICAgICAgICAgICAgbWluOiAwLjQsXHJcbiAgICAgICAgICAgICAgICBtYXg6IDAuOCxcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICB9LFxyXG4gICAgfSxcclxuICAgIC8vIHNub3dzYW5keWRpcnQ6IHtcclxuICAgIC8vICAgaWQ6IFwic25vd3NhbmR5ZGlydFwiLFxyXG4gICAgLy8gICBuYW1lOiBcIlNub3dcIixcclxuICAgIC8vICAgZGVzY3JpcHRpb246IFwiQSBibGFua2V0IG9mIHNub3cgY292ZXJzIHRoZSBncm91bmQuXCIsXHJcbiAgICAvLyAgIGJhc2VUaWxlOiBcImJpb21lcy9zbm93L3Nub3dfYmFzZVwiLFxyXG4gICAgLy8gICAvLyBhdXRvdGlsZVByZWZpeDogXCJiaW9tZXMvc2FuZHlkaXJ0L3NhbmR5ZGlydF9zcHJpbmdfc25vd19cIixcclxuICAgIC8vICAgY29sb3I6IFwiI2ZlZmVmZVwiLFxyXG4gICAgLy8gICBnZW5lcmF0aW9uT3B0aW9uczoge1xyXG4gICAgLy8gICAgIGhlaWdodDoge1xyXG4gICAgLy8gICAgICAgbWluOiAwLjYsXHJcbiAgICAvLyAgICAgfSxcclxuICAgIC8vICAgICB0ZW1wZXJhdHVyZToge1xyXG4gICAgLy8gICAgICAgbWF4OiAwLjMsXHJcbiAgICAvLyAgICAgfSxcclxuICAgIC8vICAgfSxcclxuICAgIC8vIH0sXHJcbiAgICBzbm93bW9pc3RkaXJ0OiB7XHJcbiAgICAgICAgaWQ6IFwic25vd21vaXN0ZGlydFwiLFxyXG4gICAgICAgIG5hbWU6IFwiU25vd1wiLFxyXG4gICAgICAgIGRlc2NyaXB0aW9uOiBcIkEgYmxhbmtldCBvZiBzbm93IGNvdmVycyB0aGUgZ3JvdW5kLlwiLFxyXG4gICAgICAgIGJhc2VUaWxlOiBcImJpb21lcy9zbm93L3Nub3dfYmFzZVwiLFxyXG4gICAgICAgIC8vIGF1dG90aWxlUHJlZml4OiBcImJpb21lcy9zbm93L3Nub3dfc3ByaW5nX21vaXN0ZGlydF9cIixcclxuICAgICAgICBjb2xvcjogXCIjZmVmZWZlXCIsXHJcbiAgICAgICAgZ2VuZXJhdGlvbk9wdGlvbnM6IHtcclxuICAgICAgICAgICAgaGVpZ2h0OiB7XHJcbiAgICAgICAgICAgICAgICBtaW46IDAuNixcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgLy8gbW9pc3R1cmU6IHtcclxuICAgICAgICAgICAgLy8gICBtaW46IDAuMyxcclxuICAgICAgICAgICAgLy8gfSxcclxuICAgICAgICAgICAgdGVtcGVyYXR1cmU6IHtcclxuICAgICAgICAgICAgICAgIG1heDogMC4zLFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgIH0sXHJcbiAgICB9LFxyXG4gICAgc25vd2hpbGxzaGlsbHNtaWQ6IHtcclxuICAgICAgICBpZDogXCJzbm93aGlsbHNoaWxsc21pZFwiLFxyXG4gICAgICAgIG5hbWU6IFwiU25vd1wiLFxyXG4gICAgICAgIGRlc2NyaXB0aW9uOiBcIkEgYmxhbmtldCBvZiBzbm93IGNvdmVycyB0aGUgZ3JvdW5kLlwiLFxyXG4gICAgICAgIGJhc2VUaWxlOiBcImJpb21lcy9zbm93aGlsbHMvc25vd2hpbGxzX3NwcmluZ19oaWxsc21pZF80N1wiLFxyXG4gICAgICAgIGF1dG90aWxlUHJlZml4OiBcImJpb21lcy9zbm93aGlsbHMvc25vd2hpbGxzX3NwcmluZ19oaWxsc21pZF9cIixcclxuICAgICAgICBjb2xvcjogXCIjYzJlYWYwXCIsXHJcbiAgICAgICAgZ2VuZXJhdGlvbk9wdGlvbnM6IHtcclxuICAgICAgICAgICAgaGVpZ2h0OiB7XHJcbiAgICAgICAgICAgICAgICBtaW46IDAuNixcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgLy8gbW9pc3R1cmU6IHtcclxuICAgICAgICAgICAgLy8gICBtaW46IDAuMyxcclxuICAgICAgICAgICAgLy8gfSxcclxuICAgICAgICAgICAgdGVtcGVyYXR1cmU6IHtcclxuICAgICAgICAgICAgICAgIG1heDogMC4zLFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgIH0sXHJcbiAgICB9LFxyXG59O1xyXG4iLCJpbXBvcnQgeyBQb2ludCB9IGZyb20gXCIuL3BvaW50XCI7XHJcbmltcG9ydCB7IFRpbGUgfSBmcm9tIFwiLi90aWxlXCI7XHJcbmltcG9ydCB7IEtFWVMsIERJUlMgfSBmcm9tIFwicm90LWpzXCI7XHJcbmltcG9ydCB7IElucHV0VXRpbGl0eSB9IGZyb20gXCIuL2lucHV0LXV0aWxpdHlcIjtcclxuaW1wb3J0IFRpbnlHZXN0dXJlIGZyb20gXCJ0aW55Z2VzdHVyZVwiO1xyXG5pbXBvc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VudCkge1xyXG4gICAgICAgICAgICAgICAgLy8gdGhpcyBpcyBtb3JlIGFjY3VyYXRlIHRoYW4gZy50b3VjaFN0YXJ0WCBmb3Igc29tZSByZWFzb25cclxuICAgICAgICAgICAgICAgIHggPSBlLmNsaWVudFg7XHJcbiAgICAgICAgICAgICAgICB5ID0gZS5jbGllbnRZO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgeCA9IGcudG91Y2hTdGFydFg7XHJcbiAgICAgICAgICAgICAgICB5ID0gZy50b3VjaFN0YXJ0WTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvLyB0aGlzLnVpLmNvbXBvbmVudHMudGlsZVNlbGVjdGlvbkluZGljYXRvci5oYW5kbGVDbGljayh4LCB5KTtcclxuICAgICAgICAgICAgY29uc3QgdGlsZVBvcyA9IHRoaXMuc2NyZWVuVG9UaWxlUG9zKHgsIHkpO1xyXG4gICAgICAgICAgICBpZiAodGlsZVBvcykge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3RUaWxlQXQodGlsZVBvcy54LCB0aWxlUG9zLnkpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfTtcclxuICAgICAgICB0aGlzLmhhbmRsZVBhblN0YXJ0ID0gKGcpID0+IHtcclxuICAgICAgICAgICAgLy8gY29uc29sZS5sb2coXCJwYW4gc3RhcnRcIiwgZy52ZWxvY2l0eVgsIGcudmVsb2NpdHlZKTtcclxuICAgICAgICAgICAgLy8gY29uc29sZS5sb2coXHJcbiAgICAgICAgICAgIC8vICAgXCJwYW4gaW5mb1wiLFxyXG4gICAgICAgICAgICAvLyAgIGcudG91Y2hNb3ZlWCxcclxuICAgICAgICAgICAgLy8gICBnLnRvdWNoTW92ZVksXHJcbiAgICAgICAgICAgIC8vICAgZy50b3VjaFN0YXJ0WCxcclxuICAgICAgICAgICAgLy8gICBnLnRvdWNoU3RhcnRZLFxyXG4gICAgICAgICAgICAvLyAgIGcudG91Y2hFbmRYLFxyXG4gICAgICAgICAgICAvLyAgIGcudG91Y2hFbmRZXHJcbiAgICAgICAgICAgIC8vICk7XHJcbiAgICAgICAgICAgIHRoaXMudmlld3BvcnRUYXJnZXQgPSBudWxsO1xyXG4gICAgICAgICAgICB0aGlzLnNob3dTaWRlYmFyVGltZXIgPSB0aGlzLnNob3dTaWRlYmFyRGVsYXlNcztcclxuICAgICAgICAgICAgdGhpcy5zZXRTaWRlTWVudVZpc2libGUoZmFsc2UpO1xyXG4gICAgICAgIH07XHJcbiAgICAgICAgdGhpcy5oYW5kbGVQYW5FbmQgPSAoZykgPT4ge1xyXG4gICAgICAgICAgICAvLyBjaGVjayBpZiB1c2VyIGFjdHVhbGx5IHBhbm5lZC9tb3ZlZCB0aGUgcG9pbnRlclxyXG4gICAgICAgICAgICBpZiAoZy50b3VjaE1vdmVYIHx8IGcudG91Y2hNb3ZlWSkge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5tb21lbnR1bS54ID0gZy52ZWxvY2l0eVg7XHJcbiAgICAgICAgICAgICAgICB0aGlzLm1vbWVudHVtLnkgPSBnLnZlbG9jaXR5WTtcclxuICAgICAgICAgICAgICAgIHRoaXMubW9tZW50dW1UaW1lciA9IHRoaXMubWF4TW9tZW50dW1UaW1lTXM7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9O1xyXG4gICAgICAgIHRoaXMuaGFuZGxlUGluY2hab29tID0gKGcpID0+IHtcclxuICAgICAgICAgICAgY29uc3QgbWF4U2NhbGVTcGVlZCA9IDAuMjsgLy8gPCAxIHRvIHRha2UgZWZmZWN0XHJcbiAgICAgICAgICAgIGNvbnN0IHNjYWxlU3BlZWQgPSAwLjI7XHJcbiAgICAgICAgICAgIGxldCBwaXZvdFggPSB0aGlzLnVpLmdhbWVEaXNwbGF5LnN0YWdlLnBpdm90Lng7XHJcbiAgICAgICAgICAgIGxldCBwaXZvdFkgPSB0aGlzLnVpLmdhbWVEa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bnNmb3JtKFxyXG4gICAgICAgICAgICAvLyAgIHRoaXMuZ2FtZS51c2VySW50ZXJmYWNlLmdhbWVEaXNwbGF5LnN0YWdlLnBvc2l0aW9uLngsXHJcbiAgICAgICAgICAgIC8vICAgdGhpcy5nYW1lLnVzZXJJbnRlcmZhY2UuZ2FtZURpc3BsYXkuc3RhZ2UucG9zaXRpb24ueSxcclxuICAgICAgICAgICAgLy8gICBzY2FsZSwgLy8gc2NhbGVcclxuICAgICAgICAgICAgLy8gICBzY2FsZSxcclxuICAgICAgICAgICAgLy8gICBudWxsLCAvLyByb3RhdGlvblxyXG4gICAgICAgICAgICAvLyAgIG51bGwsIC8vIHNrZXdcclxuICAgICAgICAgICAgLy8gICBudWxsLFxyXG4gICAgICAgICAgICAvLyAgIHBpdm90WCxcclxuICAgICAgICAgICAgLy8gICBwaXZvdFlcclxuICAgICAgICAgICAgLy8gKTtcclxuICAgICAgICAgICAgdGhpcy51aS5nYW1lRGlzcGxheS5zdGFnZS5zZXRUcmFuc2Zvcm0odGhpcy5nYW1lLnVzZXJJbnRlcmZhY2UuZ2FtZURpc3BsYXkuc3RhZ2UucG9zaXRpb24ueCwgdGhpcy5nYW1lLnVzZXJJbnRlcmZhY2UuZ2FtZURpc3BsYXkuc3RhZ2UucG9zaXRpb24ueSwgc2NhbGUsIC8vIHNjYWxlXHJcbiAgICAgICAgICAgIHNjYWxlLCBudWxsLCAvLyByb3RhdGlvblxyXG4gICAgICAgICAgICBudWxsLCAvLyBza2V3XHJcbiAgICAgICAgICAgIG51bGwsIHBpdm90WCwgcGl2b3RZKTtcclxuICAgICAgICAgICAgaWYgKHRoaXMuZ2FtZS5vcHRpb25zLnNob3dDbG91ZHMpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMudWkuY29tcG9uZW50cy5za3lNYXNrLnNldFNreU1hc2tWaXNpYmlsaXR5KHRoaXMuZ2V0Tm9ybWFsaXplZFpvb20oKSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9O1xyXG4gICAgICAgIHRoaXMuaGFuZGxlRG91YmxlVGFwID0gKGcpID0+IHtcclxuICAgICAgICAgICAgY29uc3Qgem9vbUluQW1vdW50ID0gMS43NTtcclxuICAgICAgICAgICAgbGV0IHNjYWxlID0gdGhpcy51aS5nYW1lRGlzcGxheS5zdGFnZS5zY2FsZS54ICogem9vbUluQW1vdW50O1xyXG4gICAgICAgICAgICBzY2FsZSA9IE1hdGgubWF4KHRoaXMubWluWm9vbSwgTWF0aC5taW4odGhpcy5tYXhab29tLCBzY2FsZSkpO1xyXG4gICAgICAgICAgICB0aGlzLnVpLmdhbWVEaXNwbGF5LnN0YWdlLnNjYWxlLnNldChzY2FsZSk7XHJcbiAgICAgICAgICAgIGlmICh0aGlzLmdhbWUub3B0aW9ucy5zaG93Q2xvdWRzKSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLnVpLmNvbXBvbmVudHMuc2t5TWFzay5zZXRTa3lNYXNrVmlzaWJpbGl0eSh0aGlzLmdldE5vcm1hbGl6ZWRab29tKCkpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfTtcclxuICAgICAgICB0aGlzLmhhbmRsZU1vdXNlWm9vbSA9IChlKSA9PiB7XHJcbiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcclxuICAgICAgICAgICAgY29uc3Qgc2NhbGVTcGVlZCA9IDAuMTtcclxuICAgICAgICAgICAgY29uc3QgbWF4U2NhbGVTcGVlZCA9IDAuMzU7XHJcbiAgICAgICAgICAgIGxldCBwaXZvdFggPSB0aGlzLnVpLmdhbWVEaXNwbGF5LnN0YWdlLnBpdm90Lng7XHJcbiAgICAgICAgICAgIGxldCBwaXZvdFkgPSB0aGlzLnVpLmdhbWVEaXNwbGF5LnN0YWdlLnBpdm90Lnk7XHJcbiAgICAgICAgICAgIGxldCBzY2FsZSA9IHRoaXMudWkuZ2FtZURpc3BsYXkuc3RhZ2Uuc2NhbGUueDtcclxuICAgICAgICAgICAgbGV0IHNjc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gICAgICAgICAgIC8vIHVwZGF0ZSB0aGUgc2NhbGUgYW5kIHBvc2l0aW9uIG9mIHRoZSBzdGFnZVxyXG4gICAgICAgICAgICB0aGlzLnVpLmdhbWVEaXNwbGF5LnN0YWdlLnNjYWxlLnNldChzY2FsZSk7XHJcbiAgICAgICAgICAgIC8vIHRoaXMudWkuZ2FtZURpc3BsYXkuc3RhZ2Uuc2V0VHJhbnNmb3JtKFxyXG4gICAgICAgICAgICAvLyAgIHRoaXMuZ2FtZS51c2VySW50ZXJmYWNlLmdhbWVEaXNwbGF5LnN0YWdlLnBvc2l0aW9uLngsXHJcbiAgICAgICAgICAgIC8vICAgdGhpcy5nYW1lLnVzZXJJbnRlcmZhY2UuZ2FtZURpc3BsYXkuc3RhZ2UucG9zaXRpb24ueSxcclxuICAgICAgICAgICAgLy8gICBzY2FsZSwgLy8gc2NhbGVcclxuICAgICAgICAgICAgLy8gICBzY2FsZSxcclxuICAgICAgICAgICAgLy8gICBudWxsLCAvLyByb3RhdGlvblxyXG4gICAgICAgICAgICAvLyAgIG51bGwsIC8vIHNrZXdcclxuICAgICAgICAgICAgLy8gICBudWxsLFxyXG4gICAgICAgICAgICAvLyAgIHBpdm90WCxcclxuICAgICAgICAgICAgLy8gICBwaXZvdFlcclxuICAgICAgICAgICAgLy8gKTtcclxuICAgICAgICAgICAgaWYgKHRoaXMuZ2FtZS5vcHRpb25zLnNob3dDbG91ZHMpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMudWkuY29tcG9uZW50cy5za3lNYXNrLnNldFNreU1hc2tWaXNpYmlsaXR5KHRoaXMuZ2V0Tm9ybWFsaXplZFpvb20oKSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9O1xyXG4gICAgICAgIHRoaXMuZGVmYXVsdFpvb20gPSAxLjQ7XHJcbiAgICAgICAgdGhpcy5jdXJyZW50Wm9vbSA9IHRoaXMuZGVmYXVsdFpvb207XHJcbiAgICAgICAgdGhpcy5taW5ab29tID0gMC41O1xyXG4gICAgICAgIHRoaXMubWF4Wm9vbSA9IDc7XHJcbiAgICAgICAgdGhpcy5tb3ZlU3BlZWQgPSAwLjM7XHJcbiAgICAgICAgdGhpcy5zaG93U2lkZWJhckRlbGF5TXMgPSA1MDA7XHJcbiAgICAgICAgdGhpcy5tYXhNb21lbnR1bVRpbWVNcyA9IDEwMDA7XHJcbiAgICAgICAgdGhpcy5tb21lbnR1bVRpbWVyID0gMDtcclxuICAgICAgICB0aGlzLnNob3dTaWRlYmFyVGltZXIgPSAwO1xyXG4gICAgICAgIHRoaXMua2V5TWFwID0ge307XHJcbiAgICAgICAgdGhpcy5rZXlNYXBbS0VZUy5WS19XXSA9IDA7IC8vIHVwXHJcbiAgICAgICAgdGhpcy5rZXlNYXBbS0VZUy5WS19EXSA9IDI7IC8vIHJpZ2h0XHJcbiAgICAgICAgdGhpcy5rZXlNYXBbS0VZUy5WS19TXSA9IDQ7IC8vIGRvd25cclxuICAgICAgICB0aGlzLmtleU1hcFtLRVlTLlZLX0FdID0gNjsgLy8gbGVmdFxyXG4gICAgICAgIHRoaXMubGFzdFBpdm90ID0gbmV3IFBvaW50KDAsIDApO1xyXG4gICAgICAgIHRoaXMubGFzdFpvb20gPSB0aGlzLmN1cnJlbnRab29tO1xyXG4gICAgICAgIHRoaXMudmlld3BvcnRUaWxlcyA9IFtdO1xyXG4gICAgICAgIHRoaXMudmlld3BvcnRUaWxlc1VucGFkZGVkID0gW107XHJcbiAgICAgICAgdGhpcy5tb21lbnR1bSA9IHtcclxuICAgICAgICAgICAgeDogMCxcclxuICAgICAgICAgICAgeTogMCxcclxuICAgICAgICAgICAgaGFuZGxlclJlZjogbnVsbCxcclxuICAgICAgICAgICAgZGVjYXk6IDAuOCxcclxuICAgICAgICAgICAgZHVyYXRpb25NczogNzUwLFxyXG4gICAgICAgIH07XHJcbiAgICAgICAgdGhpcy5jZW50ZXJWaWV3cG9ydCh0aGlzLnVpLmdhbWVEaXNwbGF5LnN0YWdlLCB0aGlzLn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2V0ID0gZmFsc2UpIHtcclxuICAgICAgICBpZiAoaXNBY3Rvcih0YXJnZXQpKSB7XHJcbiAgICAgICAgICAgIHRoaXMucG9pbnRlclRhcmdldCA9IHtcclxuICAgICAgICAgICAgICAgIHBvc2l0aW9uOiB0YXJnZXQucG9zaXRpb24sXHJcbiAgICAgICAgICAgICAgICB0YXJnZXQ6IHRhcmdldCxcclxuICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgdGhpcy51aS5jb21wb25lbnRzLnNpZGVNZW51LnNldEVudGl0eVRhcmdldCh0YXJnZXQpO1xyXG4gICAgICAgICAgICBpZiAodmlld3BvcnRUYXJnZXQpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMudmlld3BvcnRUYXJnZXQgPSB0YXJnZXQ7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIHRoaXMucG9pbnRlclRhcmdldCA9IHtcclxuICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBwb3MsXHJcbiAgICAgICAgICAgICAgICB0YXJnZXQ6IHRhcmdldCxcclxuICAgICAgICAgICAgICAgIGluZm86IHRoaXMuZ2FtZS5nZXRUaWxlSW5mb0F0KHBvcy54LCBwb3MueSksXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHRoaXMudWkuY29tcG9uZW50cy5zaWRlTWVudS5zZXRFbnRpdHlUYXJnZXQobnVsbCk7XHJcbiAgICAgICAgICAgIGlmICh2aWV3cG9ydFRhcmdldCkge1xyXG4gICAgICAgICAgICAgICAgdGhpcy52aWV3cG9ydFRhcmdldCA9IHBvcztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLnVpLmNvbXBvbmVudHMudGlsZUluZm8uc2V0Q29udGVudCh0aGlzLnBvaW50ZXJUYXJnZXQpO1xyXG4gICAgfVxyXG4gICAgY2xlYXJQb2ludGVyVGFyZ2V0KCkge1xyXG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50KSA9PiB7XHJcbiAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XHJcbiAgICAgICAgICAgIHRoaXMuaGFuZGxlUGluY2hab29tKGdlc3R1cmUpO1xyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGdlc3R1cmUub24oXCJwYW5zdGFydFwiLCAoZXZlbnQpID0+IHtcclxuICAgICAgICAgICAgdGhpcy5oYW5kbGVQYW5TdGFydChnZXN0dXJlKTtcclxuICAgICAgICB9KTtcclxuICAgICAgICBnZXN0dXJlLm9uKFwicGFubW92ZVwiLCAoZXZlbnQpID0+IHtcclxuICAgICAgICAgICAgdGhpcy5oYW5kbGVQb2ludGVyRHJhZyhnZXN0dXJlKTtcclxuICAgICAgICB9KTtcclxuICAgICAgICBnZXN0dXJlLm9uKFwicGFuZW5kXCIsIChldmVudCkgPT4ge1xyXG4gICAgICAgICAgICB0aGlzLmhhbmRsZVBhbkVuZChnZXN0dXJlKTtcclxuICAgICAgICB9KTtcclxuICAgICAgICBnZXN0dXJlLm9uKFwidGFwXCIsIChldmVudCkgPT4ge1xyXG4gICAgICAgICAgICB0aGlzLmhhbmRsZUNsaWNrKGdlc3R1cmUsIGV2ZW50KTtcclxuICAgICAgICB9KTtcclxuICAgICAgICBnZXN0dXJlLm9uKFwiZG91YmxldGFwXCIsIChldmVudCkgPT4ge1xyXG4gICAgICAgICAgICAvLyBUaGUgZ2VzdHVyZSB3YXMgYSBkb3VibGUgdGFwLiBUaGUgJ3RhcCcgZXZlbnQgd2lsbCBhbHNvIGhhdmUgYmVlbiBmaXJlZCBvblxyXG4gICAgICAgICAgICAvLyB0aGUgZmlyc3QgdGFwLlxyXG4gICAgICAgICAgICB0aGlzLmhhbmRsZURvdWJsZVRhcChnZXN0dXJlKTtcclxuICAgICAgICB9KTtcclxuICAgICAgICB0aGlzLnVpLmdhbWVDYW52YXNDb250YWluZXIuYWRkRXZlbnRMaXN0ZW5lcihcIndoZWVsXCIsIHRoaXMuaGFuZGx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aWR0aCwgdGhpcy51aS5nYW1lQ2FudmFzQ29udGFpbmVyLmNsaWVudEhlaWdodCk7XHJcbiAgICAgICAgICAgIHZhbGlkSW5wdXQgPSB0cnVlO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdmFsaWRJbnB1dDtcclxuICAgIH1cclxuICAgIHJlc2V0TW9tZW50dW0oKSB7XHJcbiAgICAgICAgdGhpcy5tb21lbnR1bVRpbWVyID0gMDtcclxuICAgICAgICB0aGlzLm1vbWVudHVtLnggPSAwO1xyXG4gICAgICAgIHRoaXMubW9tZW50dW0ueSA9IDA7XHJcbiAgICB9XHJcbiAgICBzY3JlZW5Ub1RpbGVQb3MoeCwgeSkge1xyXG4gICAgICAgIGZvciAoY29uc3Qga2V5IG9mIHRoaXMudmlld3BvcnRUaWxlc1VucGFkZGVkKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IHBvaW50ID0gTWFwV29ybGQua2V5VG9Qb2ludChrZXkpO1xyXG4gICAgICAgICAgICBjb25zdCBzcHJpdGUgPSB0aGlzLmdhbWUucmVuZGVyZXIuZ2V0RnJvbUNhY2hlKHBvaW50LCBMYXllci5URVJSQUlOKTtcclxuICAgICAgICAgICAgaWYgKHNwcml0ZSkge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgYm91bmRzID0gc3ByaXRlLmdldEJvdW5kcygpO1xyXG4gICAgICAgICAgICAgICAgaWYgKGJvdW5kcy5jb250YWlucyh4LCB5KSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwb2ludDtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIHNldFNpZGVNZW51VmlzaWJsZSh2aXNpYmxlKSB7XHJcbiAgICAgICAgLy8gb25seSBoaWRlL3Nob3cgaWYgbm90IGNvbGxhcHNlZFxyXG4gICAgICAgIGlmICghdGhpcy51aS5jb21wb25lbnRzLnNpZGVNZW51LmlzQ29sbGFwc2VkKSB7XHJcbiAgICAgICAgICAgIHRoaXMudWkuY29tcG9uZW50cy5zaWRlTWVudS5zZXRWaXNpYmxlKHZpc2libGUpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGhhbmRsZU1vbWVudHVtKCkge1xyXG4gICAgICAgIGNvbnN0IHBlcmNlbnQgPSB0aGlzLm1vbWVudHVtVGltZXIgLyB0aGlzLm1heE1vbWVudHVtVGltZU1zO1xyXG4gICAgICAgIHRoaXMubW9tZW50dW0ueCA9IGxlcnAodGhpcy5tb21lbnR1bS54LCAwLCBwZXJjZW50KTtcclxuICAgICAgICB0aGlzLm1vbWVudHVtLnkgPSBsZXJwKHRoaXMubW9tZW50dW0ueSwgMCwgcGVyY2VudCk7XHJcbiAgICAgICAgdGhpcy51aS5nYW1lRGlzcGxheS5zdGFnZS5waXZvdC54IC09IHRoaXMubW9tZW50dW0ueDtcclxuICAgICAgICB0aGlzLnVpLmdhbWVEaXNwbGF5LnN0YWdlLnBpdm90LnkgLT0gdGhpcy5tb21lbnR1bS55O1xyXG4gICAgICAgIGlmICh0aGlzLm1vbWVudHVtVGltZXIgPD0gMCkge1xyXG4gICAgICAgICAgICAvLyBzdG9wIG1vbWVudHVtXHJcbiAgICAgICAgICAgIHRoaXMucmVzZXRNb21lbnR1bSgpO1xyXG4gICAgICAgICAgICAvLyBzdGFydCB0aW1lIGZvciBzaG93aW5nIHNpZGViYXIgYWdhaW5cclxuICAgICAgICAgICAgdGhpcy5zaG93U2lkZWJhclRpbWVyID0gdGhpcy5zaG93U2lkZWJhckRlbGF5TXM7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgc25hcENhbWVyYVRvVGlsZSgpIHtcclxuICAgICAgICB0aGlzLnVpLmdhbWVEaXNwbGF5LnN0YWdlLnBpdm90LnggPVxyXG4gICAgICAgICAgICBNYXRoLmNlaWwodGhpcy51aS5nYW1lRGlzcGxheS5zdGFnZS5waXZvdC54IC8gVGlsZS5zaXplKSAqIFRp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G4gICAgICAgIGZvciAoY29uc3QgdGlsZUtleSBvZiB0aGlzLnZpZXdwb3J0VGlsZXMpIHtcclxuICAgICAgICAgICAgaWYgKCFvbGRUaWxlcy5oYXModGlsZUtleSkpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHBvaW50ID0gTWFwV29ybGQua2V5VG9Qb2ludCh0aWxlS2V5KTtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLmdhbWUubWFwLmlzUG9pbnRJbk1hcChwb2ludCkpIHtcclxuICAgICAgICAgICAgICAgICAgICBlbnRlcmVkVGlsZXMucHVzaChwb2ludCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy5nYW1lLm1hcC5vblRpbGVFbnRlclZpZXdwb3J0KGVudGVyZWRUaWxlcyk7XHJcbiAgICB9XHJcbiAgICB1cGRhdGUoZGVsdGFUaW1lKSB7XHJcbiAgICAgICAgaWYgKHRoaXMuc2hvd1NpZGViYXJUaW1lciA+IDApIHtcclxuICAgICAgICAgICAgdGhpcy5zaG93U2lkZWJhclRpbWVyIC09IGRlbHRhVGltZSAqIDEwMDA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKHRoaXMuc2hvd1NpZGViYXJUaW1lciA8IDApIHtcclxuICAgICAgICAgICAgdGhpcy5zaG93U2lkZWJhclRpbWVyID0gMDtcclxuICAgICAgICAgICAgdGhpcy5zZXRTaWRlTWVudVZpc2libGUodHJ1ZSk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgcmVuZGVyVXBkYXRlKGludGVycFBlcmNlbnQpIHtcclxuICAgICAgICAvLyBvbmx5IHVwZGF0ZSB2aWV3cG9ydCBpZjpcclxuICAgICAgICAvLyB6b29tL3NjYWxlIGNoYW5nZVxyXG4gICAgICAgIC8vIHBpdm90IGNoYW5nZVxyXG4gICAgICAgIGlmICghdGhpcy52aWV3cG9ydCkge1x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Xkuc3RhZ2UucGl2b3QueSAtIHRhcmdldFBvcy55KSA+IDAuMSkge1xyXG4gICAgICAgICAgICAgICAgbmV3UGl2b3RYID0gbGVycChkZWx0YVRpbWUsIHRoaXMudWkuZ2FtZURpc3BsYXkuc3RhZ2UucGl2b3QueCwgdGFyZ2V0UG9zLngpO1xyXG4gICAgICAgICAgICAgICAgbmV3UGl2b3RZID0gbGVycChkZWx0YVRpbWUsIHRoaXMudWkuZ2FtZURpc3BsYXkuc3RhZ2UucGl2b3QueSwgdGFyZ2V0UG9zLnkpO1xyXG4gICAgICAgICAgICAgICAgbmV3UGl2b3RYID0gdGhpcy5yb3VuZFN0YWdldmFsdWUobmV3UGl2b3RYKTtcclxuICAgICAgICAgICAgICAgIG5ld1Bpdm90WSA9IHRoaXMucm91bmRTdGFnZXZhbHVlKG5ld1Bpdm90WSk7XHJcbiAgICAgICAgICAgICAgICB0aGlzLnVpLmdhbWVEaXNwbGF5LnN0YWdlLnBpdm90LnNldChuZXdQaXZvdFgsIG5ld1Bpdm90WSk7XHJcbiAgICAgICAgICAgICAgICAvLyBuZXdQaXZvdFggPVxyXG4gICAgICAgICAgICAgICAgLy8gICBNYXRoLmNlaWwodGhpcy51aS5nYW1lRGlzcGxheS5zdGFnZS5waXZvdC54IC8gVGlsZS5zaXplKSAqIFRpbGUuc2l6ZTtcclxuICAgICAgICAgICAgICAgIC8vIHRoaXMudWkuZ2FtZURpc3BsYXkuc3RhZ2UucGl2b3QueCA9IHRoaXMubGVycChcclxuICAgICAgICAgICAgICAgIC8vICAgdGhpcy51aS5nYW1lRGlzcGxheS5zdGFnZS5waXZvdC54LFxyXG4gICAgICAgICAgICAgICAgLy8gICB0YXJnZXRQb3MueCxcclxuICAgICAgICAgICAgICAgIC8vICAgZGVsdGFUaW1lXHJcbiAgICAgICAgICAgICAgICAvLyApO1xyXG4gICAgICAgICAgICAgICAgLy8gdGhpcy51aS5nYW1lRGlzcGxheS5zdGFnZS5waXZvdC55ID0gdGhpcy5sZXJwKFxyXG4gICAgICAgICAgICAgICAgLy8gICB0aGlzLnVpLmdhbWVEaXNwbGF5LnN0YWdlLnBpdm90LnksXHJcbiAgICAgICAgICAgICAgICAvLyAgIHRhcmdldFBvcy55LFxyXG4gICAgICAgICAgICAgICAgLy8gICBkZWx0YVRpbWVcclxuICAgICAgICAgICAgICAgIC8vICk7XHJcbiAgICAgICAgICAgICAgICAvLyB0aGlzLnVpLmdhbWVEaXNwbGF5LnN0YWdlLnBpdm90LnggPVxyXG4gICAgICAgICAgICAgICAgLy8gICBNYXRoLmNlaWwodGhpcy51aS5nYW1lRGlzcGxheS5zdGFnZS5waXZvdC54IC8gVGlsZS5zaXplKSAqIFRpbGUuc2l6ZTtcclxuICAgICAgICAgICAgICAgIC8vIHRoaXMudWkuZ2FtZURpc3BsYXkuc3RhZ2UucGl2b3QueSA9XHJcbiAgICAgICAgICAgICAgICAvLyAgIE1hdGguY2VpbCh0aGlzLnVpLmdhbWVEaXNwbGF5LnN0YWdlLnBpdm90LnkgLyBUaWxlLnNpemUpICogVGlsZS5zaXplO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgdGhpcy51aS5nYW1lRGlzcGxheS5zdGFnZS5waXZvdC5zZXQodGFyZ2V0UG9zLngsIHRhcmdldFBvcy55KTtcclxuICAgICAgICAgICAgICAgIHRoaXMudmlld3BvcnRUYXJnZXQgPSBudWxsO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgZ2V0Tm9ybWFsaXplZFpvb20oKSB7XHJcbiAgICAgICAgcmV0dXJuIHRoaXMudWkuZ2FtZURpc3BsYXkuc3RhZ2Uuc2NhbGUueCAvICh0aGlzLm1heFpvb20gLSB0aGlzLm1pblpvb20pO1xyXG4gICAgfVxyXG59XHJcbiIsImltcG9ydCB7IEFuaW1hdGVkU3ByaXRlLCBBc3NldHMsIFRleHR1cmUgfSBmcm9tIFwicGl4aS5qc1wiO1xyXG5leHBvcnQgY2xhc3MgQW5pbWF0b3Ige1xyXG4gICAgY29uc3RydWN0b3IoZ2FtZSwgYWN0b3IpIHtcclxuICAgICAgICB0aGlzLmdhbWUgPSBnYW1lO1xyXG4gICAgICAgIHRoaXMuYWN0b3IgPSBhY3RvcjtcclxuICAgICAgICB0aGlzLmFuaW1TcGVlZCA9IDE7XHJcbiAgICAgICAgY29uc29sZS5sb2coYEFuaW1hdG9yIGZvciAke3RoaXMuYWN0b3IubmFtZX1gKTtcclxuICAgICAgICBpZiAodGhpcy5hY3Rvci50aWxlLmFuaW1hdGlvbktleXMpIHtcclxuICAgICAgICAgICAgY29uc3QgZnJhbWVzID0gQXNzZXRzLmNhY2hlLmdldCh0aGlzLmFjdG9yLnRpbGUuc3ByaXRlUGF0aCkuZGF0YS5mcmFtZXM7XHJcbiAgICAgICAgICAgIHRoaXMuYW5pbWF0aW9uRnJhbWVzID0ge307XHJcbiAgICAgICAgICAgIGZvciAobGV0IGFuaW1hdGlvbktleSBvZiB0aGlzLmFjdG9yLnRpbGUuYW5pbWF0aW9uS2V5cykge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5hbmltYXRpb25GcmFtZXNbYW5pbWF0aW9uS2V5XSA9IFtdO1xyXG4gICAgICAgICAgICAgICAgZm9yIChsZXQga2V5IGluIGZyYW1lcykge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChrZXkuaW5jbHVkZXMoYW5pbWF0aW9uS2V5KSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmFuaW1hdGlvbkZyYW1lc1thbmltYXRpb25LZXldLnB1c2goa2V5KTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB0aGlzLmFuaW1hdGlvbkZyYW1lc1thbmltYXRpb25LZXldLnNvcnQoKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB0aGlzLnNldEFu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ZpbmQgbmV3IGdvYWxcclxuICAgICAgICAgICAgdGhpcy5nb2FsID0gdGhpcy5wbGFuR29hbCgpO1xyXG4gICAgICAgICAgICBoYXNHb2FsID0gdGhpcy5nb2FsICE9IG51bGw7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChoYXNHb2FsKSB7XHJcbiAgICAgICAgICAgIGlmIChhdEdvYWxQb3NpdGlvbikge1xyXG4gICAgICAgICAgICAgICAgLy8gcnVuIHRoZSBhY3Rpb24gaWYgYXQgdGhlIGdvYWwgcG9zaXRpb25cclxuICAgICAgICAgICAgICAgIHRoaXMuYWN0aW9uID0gdGhpcy5nb2FsO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmICghdGhpcy5hY3Rpb24pIHtcclxuICAgICAgICAgICAgICAgIC8vICEhISEhIE1VU1QgY2hlY2sgaWYgdGFyZ2V0IGlzIHJlYWNoYWJsZSBiZWZvcmUgdGhpcyBwb2ludFxyXG4gICAgICAgICAgICAgICAgaWYgKGhhc0dvYWwgJiYgIWhhc1BhdGgpIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBjYWxjdWxhdGUgbmV3IHBhdGggaWYgbm8gcGF0aCBleGlzdHNcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnBhdGhUbyh0aGlzLmdvYWwudGFyZ2V0UG9zKTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5wYXRoLmxlbmd0aCA9PT0gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBubyBwYXRoIGZvdW5kXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZ29hbCA9IHRoaXMucGxhbldhbmRlckdvYWwoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaGFzR29hbCA9IHRoaXMuZ29hbCAhPSBudWxsO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBhdGhUbygoX2QgPSB0aGlzLmdvYWwpID09PSBudWxsIHx8IF9kID09PSB2b2lkIDAgPyB2b2lkIDAgOiBfZC50YXJnZXRQb3MpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBoYXNQYXRoID0gKChfZSA9IHRoaXMucGF0aCkgPT09IG51bGwgfHwgX2UgPT09IHZvaWQgMCA/IHZvaWQgMCA6IF9lLmxlbmd0aCkgPiAwO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKGhhc0dvYWwgJiYgaGFzUGF0aCkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKFwiaGFzIGdvYWwsIGhhcyBwYXRoLCBzZXQgYWN0aW9uIG1vdmVBY3Rpb25cIik7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hY3Rpb24gPSBuZXcgTW92ZUFjdGlvbih0aGlzLmdhbWUsIHRoaXMsIHRoaXMucGF0aC5zaGlmdCgpIC8vIG1ha2Ugc3VyZSB0byByZW1vdmUgdGhlIHBvaW50XHJcbiAgICAgICAgICAgICAgICAgICAgKTtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBjYW5QYXRoVG8oeCwgeSkge1xyXG4gICAgICAgIGNvbnN0IGRpc3RhbmNlRnJvbVRhcmdldCA9IHRoaXMucG9zaXRpb24ubWFuaGF0dGFuRGlzdGFuY2UobmV3IFBvaW50KHgsIHkpKTtcclxuICAgICAgICBjb25zdCBpblJhbmdlID0gZGlzdGFuY2VGcm9tVGFyZ2V0IDw9IHRoaXMucmFuZ2U7XHJcbiAgICAgICAgcmV0dXJuIChpblJhbmdlICYmXHJcbiAgICAgICAgICAgICghdGhpcy5nYW1lLmlzQmxvY2tlZCh4LCB5KSB8fCB0aGlzLmdhbWUuaXNPY2N1cGll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xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIC8vIGFjdGlvbiBjb21wbGV0ZWQsIHBpY2sgYSBuZXcgb25lIG5leHQgdHVyblxyXG4gICAgICAgICAgICB0aGlzLmFjdGlvbiA9IG51bGw7XHJcbiAgICAgICAgICAgIHJldHVybiByZXM7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbiAgICBnZXREZXNjcmlwdGlvbigpIHtcclxuICAgICAgICBjb25zdCBkZXNjcmlwdGlvbkJsb2NrcyA9IFtdO1xyXG4gICAgICAgIGRlc2NyaXB0aW9uQmxvY2tzLnB1c2goe1xyXG4gICAgICAgICAgICBpY29uOiBQaW5JY29uLFxyXG4gICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKHBvaW50ZXJUYXJnZXQpID0+IGAke3RoaXMucG9zaXRpb24ueH0sICR7dGhpcy5wb3NpdGlvbi55fWAsXHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgIGljb246IFR5cGVJY29uLFxyXG4gICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKCkgPT4gdGhpcy5zdWJUeXBlLFxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGRlc2NyaXB0aW9uQmxvY2tzLnB1c2goe1xyXG4gICAgICAgICAgICBpY29uOiBHb2FsSWNvbixcclxuICAgICAgICAgICAgZ2V0RGVzY3JpcHRpb246ICgpID0+IHsgdmFyIF9hOyByZXR1cm4gKChfYSA9IHRoaXMuZ29hbCkgPT09IG51bGwgfHwgX2EgPT09IHZvaWQgMCA/IHZvaWQgMCA6IF9hLm5hbWUpIHx8IFwiLVwiOyB9LFxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGRlc2NyaXB0aW9uQmxvY2tzLnB1c2goe1xyXG4gICAgICAgICAgICBpY29uOiBBY3Rpb25JY29uLFxyXG4gICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKCkgPT4geyB2YXIgX2E7IHJldHVybiAoKF9hID0gdGhpcy5hY3Rpb24pID09PSBudWxsIHx8IF9hID09PSB2b2lkIDAgPyB2b2lkIDAgOiBfYS5uYW1lKSB8fCBcIi1cIjsgfSxcclxuICAgICAgICB9KTtcclxuICAgICAgICByZXR1cm4gZGVzY3JpcHRpb25CbG9ja3M7XHJcbiAgICB9XHJcbiAgICB1cGRhdGVGYWNpbmcobW92ZVZlY3Rvcikge1xyXG4gICAgICAgIGlmIChtb3ZlVmVjdG9yKSB7XHJcbiAgICAgICAgICAgIC8vIHRoZSBhY3Rpb24gaW52b2x2ZXMgbW92ZW1lbnQsIHNvIHVwZGF0ZSBzcHJpdGUgZmFjaW5nXHJcbiAgICAgICAgICAgIHN3aXRjaCAobW92ZVZlY3RvclswXSkge1xyXG4gICAgICAgICAgICAgICAgY2FzZSAxOlxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYW5pbWF0b3Iuc2V0QW5pbWF0aW9uKFwid2Fsa19yaWdodFwiKTtcclxuICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgIGNhc2UgLTE6XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hbmltYXRvci5zZXRBbmltYXRpb24oXCJ3YWxrX2xlZnRcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICBjYXNlIDA6XHJcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChtb3ZlVmVjdG9yWzFdKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuYW5pbWF0b3Iuc2V0QW5pbWF0aW9uKFwid2Fsa19kb3duXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgLTE6XHJcbiAgICAgICAgICAgICAgICAgICA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nZXRQb3MueCwgZ29hbC50YXJnZXRQb3MueSkpO1xyXG4gICAgfVxyXG4gICAgcGxhbigpIHtcclxuICAgICAgICB2YXIgX2EsIF9iLCBfYywgX2QsIF9lO1xyXG4gICAgICAgIGxldCBoYXNHb2FsID0gdGhpcy5nb2FsICE9IG51bGw7XHJcbiAgICAgICAgY29uc3QgYXRHb2FsUG9zaXRpb24gPSB0aGlzLmdvYWxcclxuICAgICAgICAgICAgPyAoX2EgPSB0aGlzLnBvc2l0aW9uKSA9PT0gbnVsbCB8fCBfYSA9PT0gdm9pZCAwID8gdm9pZCAwIDogX2EuZXF1YWxzKChfYiA9IHRoaXMuZ29hbCkgPT09IG51bGwgfHwgX2IgPT09IHZvaWQgMCA/IHZvaWQgMCA6IF9iLnRhcmdldFBvcylcclxuICAgICAgICAgICAgOiBmYWxzZTtcclxuICAgICAgICBsZXQgaGFzUGF0aCA9ICgoX2MgPSB0aGlzLnBhdGgpID09PSBudWxsIHx8IF9jID09PSB2b2lkIDAgPyB2b2lkIDAgOiBfYy5sZW5ndGgpID4gMDtcclxuICAgICAgICBjb25zdCBpc09jY3VwaWVkID0gaGFzUGF0aFxyXG4gICAgICAgICAgICA/IHRoaXMuZ2FtZS5pc09jY3VwaWVkQnlFbnRpdHkodGhpcy5wYXRoWzBdLngsIHRoaXMucGF0aFswXS55KVxyXG4gICAgICAgICAgICA6IGZhbHNlO1xyXG4gICAgICAgIGlmICghaGFzR29hbCkge1xyXG4gICAgICAgICAgICAvLyBmaW5kIG5ldyBnb2FsXHJcbiAgICAgICAgICAgIHRoaXMuZ29hbCA9IHRoaXMucGxhbkdvYWwoKTtcclxuICAgICAgICAgICAgaGFzR29hbCA9IHRoaXMuZ29hbCAhPSBudWxsO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoaGFzR29hbCkge1xyXG4gICAgICAgICAgICBpZiAoYXRHb2FsUG9zaXRpb24pIHtcclxuICAgICAgICAgICAgICAgIC8vIHJ1biB0aGUgYWN0aW9uIGlmIGF0IHRoZSBnb2FsIHBvc2l0aW9uXHJcbiAgICAgICAgICAgICAgICB0aGlzLmFjdGlvbiA9IHRoaXMuZ29hbDtcclxuICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAoIXRoaXMuYWN0aW9uKSB7XHJcbiAgICAgICAgICAgICAgICAvLyAhISEhISBNVVNUIGNoZWNrIGlmIHRhcmdldCBpcyByZWFjaGFibGUgYmVmb3JlIHRoaXMgcG9pbnRcclxuICAgICAgICAgICAgICAgIGlmIChoYXNHb2FsICYmICFoYXNQYXRoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gY2FsY3VsYXRlIG5ldyBwYXRoIGlmIG5vIHBhdGggZXhpc3RzXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXRoVG8odGhpcy5nb2FsLnRhcmdldFBvcyk7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMucGF0aC5sZW5ndGggPT09IDApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm8gcGF0aCBmb3VuZFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmdvYWwgPSB0aGlzLnBsYW5XYW5kZXJHb2FsKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGhhc0dvYWwgPSB0aGlzLmdvYWwgIT0gbnVsbDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXRoVG8oKF9kID0gdGhpcy5nb2FsKSA9PT0gbnVsbCB8fCBfZCA9PT0gdm9pZCAwID8gdm9pZCAwIDogX2QudGFyZ2V0UG9zKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgaGFzUGF0aCA9ICgoX2UgPSB0aGlzLnBhdGgpID09PSBudWxsIHx8IF9lID09PSB2b2lkIDAgPyB2b2lkIDAgOiBfZS5sZW5ndGgpID4gMDtcclxuICAgICAgICAgICAgICAg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KSwge1xyXG4gICAgICAgICAgICB0b3BvbG9neTogNCxcclxuICAgICAgICB9KTtcclxuICAgICAgICB0aGlzLnBhdGggPSBbXTtcclxuICAgICAgICBhc3Rhci5jb21wdXRlKHRoaXMucG9zaXRpb24ueCwgdGhpcy5wb3NpdGlvbi55LCB0aGlzLnBhdGhDYWxsYmFjay5iaW5kKHRoaXMpKTtcclxuICAgICAgICB0aGlzLnBhdGguc2hpZnQoKTsgLy8gcmVtb3ZlIGFjdG9yJ3MgcG9zaXRpb25cclxuICAgIH1cclxuICAgIGFjdCgpIHtcclxuICAgICAgICByZXR1cm4gdGhpcy5hY3Rpb24ucnVuKCkudGhlbigocmVzKSA9PiB7XHJcbiAgICAgICAgICAgIGlmICh0aGlzLmdvYWwgPT09IHRoaXMuYWN0aW9uKSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmdvYWwgPSBudWxsO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHRoaXMuYWN0aW9uID0gbnVsbDtcclxuICAgICAgICAgICAgcmV0dXJuIHJlcztcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIGdldERlc2NyaXB0aW9uKCkge1xyXG4gICAgICAgIGNvbnN0IGRlc2NyaXB0aW9uQmxvY2tzID0gW107XHJcbiAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgIGljb246IFBpbkljb24sXHJcbiAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAocG9pbnRlclRhcmdldCkgPT4gYCR7dGhpcy5wb3NpdGlvbi54fSwgJHt0aGlzLnBvc2l0aW9uLnl9YCxcclxuICAgICAgICB9KTtcclxuICAgICAgICBkZXNjcmlwdGlvbkJsb2Nrcy5wdXNoKHtcclxuICAgICAgICAgICAgaWNvbjogVHlwZUljb24sXHJcbiAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAoKSA9PiB0aGlzLnN1YlR5cGUsXHJcbiAgICAgICAgfSk7XHJcb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5wdXQgPSBmYWxzZTtcclxuICAgICAgICBsZXQgY29kZSA9IGV2ZW50LmtleUNvZGU7XHJcbiAgICAgICAgaWYgKGNvZGUgaW4gdGhpcy5rZXlNYXApIHtcclxuICAgICAgICAgICAgbGV0IGRpZmYgPSBESVJTWzhdW3RoaXMua2V5TWFwW2NvZGVdXTtcclxuICAgICAgICAgICAgbGV0IG5ld1BvaW50ID0gbmV3IFBvaW50KHRoaXMucG9zaXRpb24ueCArIGRpZmZbMF0sIHRoaXMucG9zaXRpb24ueSArIGRpZmZbMV0pO1xyXG4gICAgICAgICAgICBpZiAoIXRoaXMuZ2FtZS5pc01hcEJsb2NrZWQobmV3UG9pbnQueCwgbmV3UG9pbnQueSkpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB0aGlzLnBvc2l0aW9uID0gbmV3UG9pbnQ7XHJcbiAgICAgICAgICAgIHZhbGlkSW5wdXQgPSB0cnVlO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIGlmIChjb2RlID09PSBLRVlTLlZLX1JFVFVSTiB8fCBjb2RlID09PSBLRVlTLlZLX1NQQUNFKSB7XHJcbiAgICAgICAgICAgIC8vIHRoaXMuZ2FtZS5jaGVja0JveCh0aGlzLnBvc2l0aW9uLngsIHRoaXMucG9zaXRpb24ueSk7XHJcbiAgICAgICAgICAgIHZhbGlkSW5wdXQgPSB0cnVlO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgdmFsaWRJbnB1dCA9IGNvZGUgPT09IEtFWVMuVktfTlVNUEFENTsgLy8gV2FpdCBhIHR1cm5cclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy5nYW1lLnVzZXJJbnRlcmZhY2UuY2FtZXJhLmNlbnRlck9uKHRoaXMucG9zaXRpb24ueCwgdGhpcy5wb3NpdGlvbi55KTtcclxuICAgICAgICByZXR1cm4gdmFsaWRJbnB1dDtcclxuICAgIH1cclxuICAgIGdldERlc2NyaXB0aW9uKCkge1xyXG4gICAgICAgIGNvbnN0IGRlc2NyaXB0aW9uQmxvY2tzID0gW107XHJcbiAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgIGljb246IFR5cGVJY29uLFxyXG4gICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKCkgPT4gXCJQbGF5ZXJcIixcclxuICAgICAgICB9KTtcclxuICAgICAgICBpZiAodGhpcy5nb2FsKSB7XHJcbiAgICAgICAgICAgIGRlc2NyaXB0aW9uQmxvY2tzLnB1c2goe1xyXG4gICAgICAgICAgICAgICAgaWNvbjogR29hbEljb24sXHJcbiAgICAgICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKCkgPT4gdGhpcy5nb2FsLm5hbWUsXHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodGhpcy5hY3Rpb24pIHtcclxuICAgICAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgICAgICBpY29uOiBBY3Rpb25JY29uLFxyXG4gICAgICAgICAgICAgICAgZ2V0RGVzY3JpcHRpb246ICgpID0+IHRoaXMuYWN0aW9uLm5hbWUsXHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gZGVzY3JpcHRpb25CbG9ja3M7XHJcbiAgICB9XHJcbn1cclxuIiwiaW1wb3J0IHsgUGF0aCwgUk5HIH0gZnJvbSBcInJvdC1qc1wiO1xyXG5pbXBvcnQgeyBQb2ludCB9IGZyb20gXCIuLi9wb2ludFwiO1xyXG5pbXBvcnQgeyBUaWxlLCBUaWxlU3ViVHlwZSB9IGZyb20gXCIuLi90aWxlXCI7XHJcbmltcG9ydCB7IE1vdmVBY3Rpb24gfSBmcm9tIFwiLi4vYWN0aW9ucy9tb3ZlQWN0aW9uXCI7XHJcbmltcG9ydCB7I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G4gICAgICAgIGNvbnN0IGlzT2NjdXBpZWQgPSBoYXNQYXRoXHJcbiAgICAgICAgICAgID8gdGhpcy5nYW1lLmlzT2NjdXBpZWRCeUVudGl0eSh0aGlzLnBhdGhbMF0ueCwgdGhpcy5wYXRoWzBdLnkpXHJcbiAgICAgICAgICAgIDogZmFsc2U7XHJcbiAgICAgICAgaWYgKCFoYXNHb2FsKSB7XHJcbiAgICAgICAgICAgIC8vIGZpbmQgbmV3IGdvYWxcclxuICAgICAgICAgICAgdGhpcy5nb2FsID0gdGhpcy5wbGFuR29hbCgpO1xyXG4gICAgICAgICAgICBoYXNHb2FsID0gdGhpcy5nb2FsICE9IG51bGw7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChoYXNHb2FsKSB7XHJcbiAgICAgICAgICAgIGlmIChhdEdvYWxQb3NpdGlvbikge1xyXG4gICAgICAgICAgICAgICAgLy8gcnVuIHRoZSBhY3Rpb24gaWYgYXQgdGhlIGdvYWwgcG9zaXRpb25cclxuICAgICAgICAgICAgICAgIHRoaXMuYWN0aW9uID0gdGhpcy5nb2FsO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmICghdGhpcy5hY3Rpb24pIHtcclxuICAgICAgICAgICAgICAgIC8vICEhISEhIE1VU1QgY2hlY2sgaWYgdGFyZ2V0IGlzIHJlYWNoYWJsZSBiZWZvcmUgdGhpcyBwb2ludFxyXG4gICAgICAgICAgICAgICAgaWYgKGhhc0dvYWwgJiYgIWhhc1BhdGgpIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBjYWxjdWxhdGUgbmV3IHBhdGggaWYgbm8gcGF0aCBleGlzdHNcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnBhdGhUbyh0aGlzLmdvYWwudGFyZ2V0UG9zKTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5wYXRoLmxlbmd0aCA9PT0gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBubyBwYXRoIGZvdW5kXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZ29hbCA9IHRoaXMucGxhbldhbmRlckdvYWwoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaGFzR29hbCA9IHRoaXMuZ29hbCAhPSBudWxsO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBhdGhUbygoX2QgPSB0aGlzLmdvYWwpID09PSBudWxsIHx8IF9kID09PSB2b2lkIDAgPyB2b2lkIDAgOiBfZC50YXJnZXRQb3MpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBoYXNQYXRoID0gKChfZSA9IHRoaXMucGF0aCkgPT09IG51bGwgfHwgX2UgPT09IHZvaWQgMCA/IHZvaWQgMCA6IF9lLmxlbmd0aCkgPiAwO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKGhhc0dvYWwgJiYgaGFzUGF0aCkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKFwiaGFzIGdvYWwsIGhhcyBwYXRoLCBzZXQgYWN0aW9uIG1vdmVBY3Rpb25cIik7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hY3Rpb24gPSBuZXcgTW92ZUFjdGlvbih0aGlzLmdhbWUsIHRoaXMsIHRoaXMucGF0aC5zaGlmdCgpIC8vIG1ha2Ugc3VyZSB0byByZW1vdmUgdGhlIHBvaW50XHJcbiAgICAgICAgICAgICAgICAgICAgKTtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBjYW5QYXRoVG8oeCwgeSkge1xyXG4gICAgICAgIGNvbnN0IGRpc3RhbmNlRnJvbVRhcmdldCA9IHRoaXMucG9zaXRpb24ubWFuaGF0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vaWQgMCA/IHZvaWQgMCA6IHJlcy5tb3ZlbWVudFZlY3Rvcik7XHJcbiAgICAgICAgICAgIGlmICh0aGlzLmdvYWwgPT09IHRoaXMuYWN0aW9uKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBnb2FsIGNvbXBsZXRlZCwgcGljayBhIG5ldyBvbmUgbmV4dCB0dXJuXHJcbiAgICAgICAgICAgICAgICB0aGlzLmdvYWwgPSBudWxsO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIC8vIGFjdGlvbiBjb21wbGV0ZWQsIHBpY2sgYSBuZXcgb25lIG5leHQgdHVyblxyXG4gICAgICAgICAgICB0aGlzLmFjdGlvbiA9IG51bGw7XHJcbiAgICAgICAgICAgIHJldHVybiByZXM7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbiAgICBnZXREZXNjcmlwdGlvbigpIHtcclxuICAgICAgICBjb25zdCBkZXNjcmlwdGlvbkJsb2NrcyA9IFtdO1xyXG4gICAgICAgIGRlc2NyaXB0aW9uQmxvY2tzLnB1c2goe1xyXG4gICAgICAgICAgICBpY29uOiBQaW5JY29uLFxyXG4gICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKHBvaW50ZXJUYXJnZXQpID0+IGAke3RoaXMucG9zaXRpb24ueH0sICR7dGhpcy5wb3NpdGlvbi55fWAsXHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgIGljb246IFR5cGVJY29uLFxyXG4gICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKCkgPT4gdGhpcy5zdWJUeXBlLFxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGRlc2NyaXB0aW9uQmxvY2tzLnB1c2goe1xyXG4gICAgICAgICAgICBpY29uOiBHb2FsSWNvbixcclxuICAgICAgICAgICAgZ2V0RGVzY3JpcHRpb246ICgpID0+IHsgdmFyIF9hOyByZXR1cm4gKChfYSA9IHRoaXMuZ29hbCkgPT09IG51bGwgfHwgX2EgPT09IHZvaWQgMCA/IHZvaWQgMCA6IF9hLm5hbWUpIHx8IFwiLVwiOyB9LFxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGRlc2NyaXB0aW9uQmxvY2tzLnB1c2goe1xyXG4gICAgICAgICAgICBpY29uOiBBY3Rpb25JY29uLFxyXG4gICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKCkgPT4geyB2YXIgX2E7IHJldHVybiAoKF9hID0gdGhpcy5hY3Rpb24pID09PSBudWxsIHx8IF9hID09PSB2b2lkIDAgPyB2b2lkIDAgOiBfYS5uYW1lKSB8fCBcIi1cIjsgfSxcclxuICAgICAgICB9KTtcclxuICAgICAgICByZXR1cm4gZGVzY3JpcHRpb25CbG9ja3M7XHJcbiAgICB9XHJcbiAgICB1cGRhdGVGYWNpbmcobW92ZVZlY3Rvcikge1xyXG4gICAgICAgIGlmIChtb3ZlVmVjdG9yKSB7XHJcbiAgICAgICAgICAgIC8vIHRoZSBhY3Rpb24gaW52b2x2ZXMgbW92ZW1lbnQsIHNvIHVwZGF0ZSBzcHJpdGUgZmFjaW5nXHJcbiAgICAgICAgICAgIHN3aXRjaCAobW92ZVZlY3RvclswXSkge1xyXG4gICAgICAgICAgICAgICAgY2FzZSAxOlxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYW5pbWF0b3Iuc2V0QW5pbWF0aW9uKFwicmlnaHRcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICBjYXNlIC0xOlxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYW5pbWF0b3Iuc2V0QW5pbWF0aW9uKFwibGVmdFwiKTtcclxuICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgIGNhc2UgMDpcclxuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKG1vdmVWZWN0b3JbMV0pIHtcclxuICAgICAgICAgICAg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IGlmICghaGFzR29hbCkge1xyXG4gICAgICAgICAgICAvLyBmaW5kIG5ldyBnb2FsXHJcbiAgICAgICAgICAgIHRoaXMuZ29hbCA9IHRoaXMucGxhbkdvYWwoKTtcclxuICAgICAgICAgICAgaGFzR29hbCA9IHRoaXMuZ29hbCAhPSBudWxsO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoaGFzR29hbCkge1xyXG4gICAgICAgICAgICBpZiAoYXRHb2FsUG9zaXRpb24pIHtcclxuICAgICAgICAgICAgICAgIC8vIHJ1biB0aGUgYWN0aW9uIGlmIGF0IHRoZSBnb2FsIHBvc2l0aW9uXHJcbiAgICAgICAgICAgICAgICB0aGlzLmFjdGlvbiA9IHRoaXMuZ29hbDtcclxuICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAoIXRoaXMuYWN0aW9uKSB7XHJcbiAgICAgICAgICAgICAgICAvLyAhISEhISBNVVNUIGNoZWNrIGlmIHRhcmdldCBpcyByZWFjaGFibGUgYmVmb3JlIHRoaXMgcG9pbnRcclxuICAgICAgICAgICAgICAgIGlmIChoYXNHb2FsICYmICFoYXNQYXRoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gY2FsY3VsYXRlIG5ldyBwYXRoIGlmIG5vIHBhdGggZXhpc3RzXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXRoVG8odGhpcy5nb2FsLnRhcmdldFBvcyk7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMucGF0aC5sZW5ndGggPT09IDApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm8gcGF0aCBmb3VuZFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmdvYWwgPSB0aGlzLnBsYW5XYW5kZXJHb2FsKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGhhc0dvYWwgPSB0aGlzLmdvYWwgIT0gbnVsbDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXRoVG8oKF9kID0gdGhpcy5nb2FsKSA9PT0gbnVsbCB8fCBfZCA9PT0gdm9pZCAwID8gdm9pZCAwIDogX2QudGFyZ2V0UG9zKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgaGFzUGF0aCA9ICgoX2UgPSB0aGlzLnBhdGgpID09PSBudWxsIHx8IF9lID09PSB2b2lkIDAgPyB2b2lkIDAgOiBfZS5sZW5ndGgpID4gMDtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmIChoYXNHb2FsICYmIGhhc1BhdGgpIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBjb25zb2xlLmxvZyhcImhhcyBnb2FsLCBoYXMgcGF0aCwgc2V0IGFjdGlvbiBtb3ZlQWN0aW9uXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYWN0aW9uID0gbmV3IE1vdmVBY3Rpb24odGhpcy5nYW1lLCB0aGlzLCB0aGlzLnBhdGguc2hpZnQoKSAvLyBtYWtlIHN1cmUgdG8gcmVtb3ZlIHRoZSBwb2ludFxyXG4gICAgICAgICAgICAgICAgICAgICk7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgY2FuUGF0aFRvKHgsIHkpIHtcclxuICAgICAgICBjb25zdCBkaXN0YW5jZUZyb21UYXJnZXQgPSB0aGlzLnBvc2l0aW9uLm1hbmhhdHRhbkRpc3RhbmNlKG5ldyBQb2ludCh4LCB5KSk7XHJcbiAgICAgICAgY29uc3QgaW5SYW5nZSA9IGRpc3RhbmNlRnJvbVRhcmdldCA8PSB0aGlzLnJhbmdlO1xyXG4gICAgICAgIC8vIGNoZWNrIGlmIHdhdGVyIHRpbGVcclxuICAgICAgICBjb25zdCBiaW9t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hbGxiYWNrLmJpbmQodGhpcykpO1xyXG4gICAgICAgIHRoaXMucGF0aC5zaGlmdCgpOyAvLyByZW1vdmUgYWN0b3IncyBwb3NpdGlvblxyXG4gICAgfVxyXG4gICAgYWN0KCkge1xyXG4gICAgICAgIHJldHVybiB0aGlzLmFjdGlvblxyXG4gICAgICAgICAgICAucnVuKClcclxuICAgICAgICAgICAgLnRoZW4oKHJlcykgPT4ge1xyXG4gICAgICAgICAgICB0aGlzLnVwZGF0ZUZhY2luZyhyZXMgPT09IG51bGwgfHwgcmVzID09PSB2b2lkIDAgPyB2b2lkIDAgOiByZXMubW92ZW1lbnRWZWN0b3IpO1xyXG4gICAgICAgICAgICBpZiAodGhpcy5nb2FsID09PSB0aGlzLmFjdGlvbikge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5nb2FsID0gbnVsbDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB0aGlzLmFjdGlvbiA9IG51bGw7XHJcbiAgICAgICAgICAgIHJldHVybiByZXM7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbiAgICBnZXREZXNjcmlwdGlvbigpIHtcclxuICAgICAgICBjb25zdCBkZXNjcmlwdGlvbkJsb2NrcyA9IFtdO1xyXG4gICAgICAgIGRlc2NyaXB0aW9uQmxvY2tzLnB1c2goe1xyXG4gICAgICAgICAgICBpY29uOiBQaW5JY29uLFxyXG4gICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKHBvaW50ZXJUYXJnZXQpID0+IGAke3RoaXMucG9zaXRpb24ueH0sICR7dGhpcy5wb3NpdGlvbi55fWAsXHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgIGljb246IFR5cGVJY29uLFxyXG4gICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKCkgPT4gdGhpcy5zdWJUeXBlLFxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGRlc2NyaXB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uICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgIGNhc2UgMDpcclxuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKG1vdmVWZWN0b3JbMV0pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5hbmltYXRvci5zZXRBbmltYXRpb24oXCJkb3duXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgLTE6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmFuaW1hdG9yLnNldEFuaW1hdGlvbihcInVwXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgcGF0aENhbGxiYWNrKHgsIHkpIHtcclxuICAgICAgICB0aGlzLnBhdGgucHVzaChuZXcgUG9pbnQoeCwgeSkpO1xyXG4gICAgfVxyXG59XHJcbiIsImltcG9ydCB7IFRpbGUsIFRpbGVTdWJUeXBlIH0gZnJvbSBcIi4uL3RpbGVcIjtcclxuaW1wb3J0IHsgV2FpdEFjdGlvbiB9IGZyb20gXCIuLi9hY3Rpb25zL3dhaXRBY3Rpb25cIjtcclxuaW1wb3J0IFR5cGVJY29uIGZyb20gXCIuLi9zaG9lbGFjZS9hc3NldHMvaWNvbnMvcGVyc29uLXZjYXJkLnN2Z1wiO1xyXG5pbXBvcnQgR29hbEljb24gZnJvbSBcIi4uL3Nob2VsYWNlL2Fzc2V0cy9pY29ucy9nZW8tYWx0LnN2Z1wiO1xyXG5pbXBvcnQgQWN0aW9uSWNvbiBmcm9tIFwiLi4vc2hvZWxhY2UvYXNzZXRz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JpcHRpb246ICgpID0+IGAke3RoaXMucG9zaXRpb24ueH0sICR7dGhpcy5wb3NpdGlvbi55fWAsXHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgIGljb246IFR5cGVJY29uLFxyXG4gICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKCkgPT4gdGhpcy5zdWJUeXBlLFxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGlmICh0aGlzLmdvYWwpIHtcclxuICAgICAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgICAgICBpY29uOiBHb2FsSWNvbixcclxuICAgICAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAoKSA9PiB0aGlzLmdvYWwubmFtZSxcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh0aGlzLmFjdGlvbikge1xyXG4gICAgICAgICAgICBkZXNjcmlwdGlvbkJsb2Nrcy5wdXNoKHtcclxuICAgICAgICAgICAgICAgIGljb246IEFjdGlvbkljb24sXHJcbiAgICAgICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKCkgPT4gdGhpcy5hY3Rpb24ubmFtZSxcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBkZXNjcmlwdGlvbkJsb2NrcztcclxuICAgIH1cclxufVxyXG4iLCJpbXBvcnQgeyBTcHJpdGUgfSBmcm9tIFwicGl4aS5qc1wiO1xyXG5leHBvcnQgY2xhc3MgVHJlZVNwZWNpZXMge1xyXG4gICAgY29uc3RydWN0b3Iob3B0aW9ucykge1xyXG4gICAgICAgIHRoaXMuaWQgPSBvcHRpb25zLmlkOyAvLyBpZCBvZiB0aGUgdHJlZSBzcGVjaWVzXHJcbiAgICAgICAgdGhpcy5uYW1lID0gb3B0aW9ucy5uYW1lOyAvLyBuYW1lIG9mIHRo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bmtTZWdtZW50SGVpZ2h0UmFuZ2UgIT09IHVuZGVmaW5lZFxyXG4gICAgICAgICAgICAgICAgPyBvcHRpb25zLnRydW5rU2VnbWVudEhlaWdodFJhbmdlXHJcbiAgICAgICAgICAgICAgICA6IDM7IC8vIHJhbmRvbSByYW5nZSBhZGRlZCB0byB0cnVuayBzZWdtZW50IGhlaWdodFxyXG4gICAgICAgIHRoaXMudHJ1bmtTZWdtZW50V2lkdGhNaW4gPVxyXG4gICAgICAgICAgICBvcHRpb25zLnRydW5rU2VnbWVudFdpZHRoTWluICE9PSB1bmRlZmluZWRcclxuICAgICAgICAgICAgICAgID8gb3B0aW9ucy50cnVua1NlZ21lbnRXaWR0aE1pblxyXG4gICAgICAgICAgICAgICAgOiA2OyAvLyB3aWR0aCBvZiBlYWNoIHRydW5rIHNlZ21lbnRcclxuICAgICAgICB0aGlzLnRydW5rU2VnbWVudFdpZHRoUmFuZ2UgPVxyXG4gICAgICAgICAgICBvcHRpb25zLnRydW5rU2VnbWVudFdpZHRoUmFuZ2UgIT09IHVuZGVmaW5lZFxyXG4gICAgICAgICAgICAgICAgPyBvcHRpb25zLnRydW5rU2VnbWVudFdpZHRoUmFuZ2VcclxuICAgICAgICAgICAgICAgIDogMzsgLy8gcmFuZG9tIHJhbmdlIGFkZGVkIHRvIHRydW5rIHNlZ21lbnQgd2lkdGhcclxuICAgICAgICB0aGlzLnRydW5rV2lkdGhEZWdyYWRlID1cclxuICAgICAgICAgICAgb3B0aW9ucy50cnVua1NlZ21lbnRXaWR0aERlZ3JhZGUgIT09IHVuZGVmaW5lZFxyXG4gICAgICAgICAgICAgICAgPyBvcHRpb25zLnRydW5rU2VnbWVudFdpZHRoRGVncmFkZVxyXG4gICAgICAgICAgICAgICAgOiAwLjkzOyAvLyBkZWdyYWRhdGlvbiBmYWN0b3IgZm9yIHRydW5rIHdpZHRoXHJcbiAgICAgICAgdGhpcy5tYXhCcmFuY2hlc1BlclNlZ21lbnQgPVxyXG4gICAgICAgIC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dGUpIHtcclxuICAgICAgICAgICAgICAgIHNwcml0ZS5kZXN0cm95KCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIHRleHR1cmU7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbiAgICBzdGF0aWMgcHJvY2Vzc1RyZWVTcGVjaWVzKCkge1xyXG4gICAgICAgIGlmIChUcmVlU3BlY2llcy50cmVlU3BlY2llcy5sZW5ndGgpXHJcbiAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICBjb25zdCBzcGVjaWVzRGVmcyA9IFtcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgaWQ6IFwicGluZVwiLFxyXG4gICAgICAgICAgICAgICAgbmFtZTogXCJQaW5lXCIsXHJcbiAgICAgICAgICAgICAgICBpY29uUGF0aDogXCJ0cmVlXzAwXCIsXHJcbiAgICAgICAgICAgICAgICB0ZXh0dXJlU2V0OiB7XHJcbiAgICAgICAgICAgICAgICAgICAgdHJ1bms6IFtcInRydW5rXzAwXCIsIFwidHJ1bmtfMDFcIiwgXCJ0cnVua18wMlwiXSxcclxuICAgICAgICAgICAgICAgICAgICBicmFuY2g6IFtcInRydW5rXzAwXCIsIFwidHJ1bmtfMDFcIiwgXCJ0cnVua18wMlwiXSxcclxuICAgICAgICAgICAgICAgICAgICB0cnVua0Jhc2U6IFtcInRydW5rX2Jhc2VfcGluZVwiXSxcclxuICAgICAgICAgICAgICAgICAgICBsZWFmOiBbXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIFwibGVhZl9waW5lXzAwXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIFwibGVhZl9waW5lXzAxXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIFwibGVhZl9waW5lXzAyXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIFwibGVhZl9waW5lXzAzXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgXSxcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBncm93dGhPcHRpb25zOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGVtcGVyYXR1cmU6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWluOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXg6IDEwMCxcclxuICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgIG1vaXN0dXJlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1pbjogMCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWF4OiAxMDAsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWluOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXg6IDEwMCxcclxuICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgIGxpZ2h0OiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1pbjogMCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWF4OiAxMDAsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBicmFuY2hTZWdtZW50V2lkdGhEZWdyYWRlOiAwLjk2LFxyXG4gICAgICAgICAgICAgICAgYnJhbmNoU2VnbWVudFdpZHRoTWluOiAxLjIsXHJcbiAgICAgICAgICAgICAgICBicmFuY2hTZWdtZW50V2lkdGhSYW5nZTogMy41LFxyXG4gICAgICAgICAgICAgICAgLy8gbWluVHJ1bmtCYXNlU2l6ZTogMyxcclxuICAgICAgICAgICAgICAgIC8vIGJyYW5jaFNlZ21lbnRIZWlnaHRNaW46IDQsXHJcbiAgICAgICAgICAgICAgICAvLyBicmFuY2hTZWdtZW50SGVpZ2h0UmFuZ2U6IDgsXHJcbiAgICAgICAgICAgICAgICAvLyBicmFuY2hTZWdtZW50SGVpZ2h0RGVncmFkZTogMC45NSxcclxuICAgICAgICAgICAgICAgIGJyYW5jaENoYW5jZTogMSxcclxuICAgICAgICAgICAgICAgIGJyYW5jaENoYW5jZUdyb3c6IC0wLjYsXHJcbiAgICAgICAgICAgICAgICBtYXhCcmFuY2hlc1BlclNlZ21lbnQ6IDIsXHJcbiAgICAgICAgICAgICAgICBtYXhCcmFuY2hlc1BlclNlZ21lbnRSYW5nZTogMSxcclxuICAgICAgICAgICAgICAgIGJyYW5jaEN1cnZlQW5nbGU6IDMsXHJcbiAgICAgICAgICAgICAgICBicmFuY2hGb3JrTWluOiAyMyxcclxuICAgICAgICAgICAgICAgIGJyYW5jaEZvcmtSYW5nZTogMjAsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIGlkOiBcImJpcmNoXCIsXHJcbiAgICAgICAgICAgICAgICBuYW1lOiBcIkJpcmNoXCIsXHJcbiAgICAgICAgICAgICAgICBpY29uUGF0aDogXCJ0cmVlXzAxXCIsXHJcbiAgICAgICAgICAgICAgICB0ZXh0dXJlU2V0OiB7XHJcbiAgICAgICAgICAgICAgICAgICAgdHJ1bms6IFtcInRydW5rXzAzXCJdLFxyXG4gICAgICAgICAgICAgICAgICAgIGJyYW5jaDogW1widHJ1bmtfMDNcIl0sXHJcbiAgICAgICAgICAgICAgICAgICAgdHJ1bmtCYXNlOiBbXCJ0cnVua19iYXNlX2JpcmNoXCJdLFxyXG4gICAgICAgICAgICAgICAgICAgIGxlYWY6IFtcImxlYWZfYmlyY2hfMDBcIiwgXCJsZWFmX2JpcmNoXzAxXCIsIFwibGVhZl9iaXJjaF8wMlwiXSxcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBncm93dGhPcHRpb25zOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGVtcGVyYXR1cmU6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWluOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXg6IDEwMCxcclxuICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgIG1vaXN0dXJlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1pbjogMCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWF4OiAxMDAsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWluOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXg6IDEwMCxcclxuICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgIGxpZ2h0OiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1pbjogMCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWF4OiAxMDAsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICB0cnVua1NlZ21lbnRDb3VudDogNSxcclxuICAgICAgICAgICAgICAgIHRydW5rU2VnbWVudEhlaWdodE1pbjogNSxcclxuICAgICAgICAgICAgICAgIHRydW5rU2VnbWVudEhlaWdodFJhbmdlOiAzLFxyXG4gICAgICAgICAgICAgICAgdHJ1bmtTZWdtZW50V2lkdGhNaW46IDQsXHJcbiAgICAgICAgICAgICAgICB0cnVua1NlZ21lbnRXaWR0aFJhbmdlOiAzLFxyXG4gICAgICAgICAgICAgICAgdHJ1bmtTZWdtZW50V2lkdGhEZWdyYWRlOiAwLjk4LFxyXG4gICAgICAgICAgICAgICAgbWluVHJ1bmtCYXNlU2l6ZTogMyxcclxuICAgICAgICAgICAgICAgIGJyYW5jaFNlZ21lbnRIZWlnaHRNaW46IDQsXHJcbiAgICAgICAgICAgICAgICBicmFuY2hTZWdtZW50SGVpZ2h0UmFuZ2U6IDgsXHJcbiAgICAgICAgICAgICAgICBicmFuY2hTZWdtZW50SGVpZ2h0RGVncmFkZTogMC45NSxcclxuICAgICAgICAgICAgICAgIGJyYW5jaFNlZ21lbnRXaWR0aERlZ3JhZGU6IDAuOSxcclxuICAgICAgICAgICAgICAgIGJyYW5jaFNlZ21lbnRXaWR0aE1pbjogMC44MSxcclxuICAgICAgICAgICAgICAgIGJyYW5jaFNlZ21lbnRXaWR0aFJhbmdlOiAwLFxyXG4gICAgICAgICAgICAgICAgYnJhbmNoQ2hhbmNlOiAwLjgsXHJcbiAgICAgICAgICAgICAgICBicmFuY2hDaGFuY2VHcm93OiAtMC4zMyxcclxuICAgICAgICAgICAgICAgIG1heEJyYW5jaGVzUGVyU2VnbWVudDogMixcclxuICAgICAgICAgICAgICAgIG1heEJyYW5jaGVzUGVyU2VnbWVudFJhbmdlOiAxLFxyXG4gICAgICAgICAgICAgICAgYnJhbmNoQ3VydmVBbmdsZTogNSxcclxuICAgICAgICAgICAgICAgIGJyYW5jaEZvcmtNaW46IDEwLFxyXG4gICAgICAgICAgICAgICAgYnJhbmNoRm9ya1JhbmdlOiA3LFxyXG4gICAgICAgICAgICAgICAgbGVhZkRpc3RhbmNlOiAxLjgsXHJcbiAgICAgICAgICAgICAgICBsZWF2ZXNQZXJCcmFuY2hNaW46IDI1LFxyXG4gICAgICAgICAgICAgICAgbGVhdmVzUGVyQnJhbmNoUmFuZ2U6IDEwLFxyXG4gICAgICAgICAgICAgICAgbGVhdmVzUGVyQnJhbmNoRGVuc2l0eTogMS4zLFxyXG4gICAgICAgICAgICAgICAgbGVhZlNpemVSYW5nZTogNixcclxuICAgICAgICAgICAgICAgIGxlYWZNaW5TaXplOiA4LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBpZDogXCJtYXBsZVwiLFxyXG4gICAgICAgICAgICAgICAgbmFtZTogXCJNYXBsZVwiLFxyXG4gICAgICAgICAgICAgICAgaWNvblBhdGg6IFwidHJlZV8wMVwiLFxyXG4gICAgICAgICAgICAgICAgdGV4dHVyZVNldDoge1xyXG4gICAgICAgICAgICAgICAgICAgIHRydW5rOiBbXCJ0cnVua18wM1wiXSxcclxuICAgICAgICAgICAgICAgICAgICBicmFuY2g6IFtcInRydW5rXzAzXCJdLFxyXG4gICAgICAgICAgICAgICAgICAgIHRydW5rQmFzZTogW1widHJ1bmtfYmFzZV9iaXJjaFwiXSxcclxuICAgICAgICAgICAgICAgICAgICBsZWFmOiBbXCJsZWFmX21hcGxlXzAwXCIsIFwibGVhZl9tYXBsZV8wMVwiLCBcImxlYWZfbWFwbGVfMDJcIl0sXHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgZ3Jvd3RoT3B0aW9uczoge1xyXG4gICAgICAgICAgICAgICAgICAgIHRlbXBlcmF0dXJlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1pbjogMCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWF4OiAxMDAsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgICAgICBtb2lzdHVyZToge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBtaW46IDAsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1heDogMTAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1pbjogMCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWF4OiAxMDAsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgICAgICBsaWdodDoge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBtaW46IDAsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1heDogMTAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBpZDogXCJjb3R0b25jYW5keVwiLFxyXG4gICAgICAgICAgICAgICAgbmFtZTogXCJDb3R0b24gQ2FuZHlcIixcclxuICAgICAgICAgICAgICAgIGljb25QYXRoOiBcInRyZWVfMDFcIixcclxuICAgICAgICAgICAgICAgIHRleHR1cmVTZXQ6IHtcclxuICAgICAgICAgICAgICAgICAgICB0cnVuazogW1widHJ1bmtfMDNcIl0sXHJcbiAgICAgICAgICAgICAgICAgICAgYnJhbmNoOiBbXCJ0cnVua18wM1wiXSxcclxuICAgICAgICAgICAgICAgICAgICB0cnVua0Jhc2U6IFtcInRydW5rX2Jhc2VfYmlyY2hcIl0sXHJcbiAgICAgICAgICAgICAgICAgICAgbGVhZjogW1wibGVhZl9waW5rXzAwXCIsIFwibGVhZl9waW5rXzAxXCIsIFwibGVhZl9waW5rXzAyXCJdLFxyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIGdyb3d0aE9wdGlvbnM6IHtcclxuICAgICAgICAgICAgICAgICAgICB0ZW1wZXJhdHVyZToge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBtaW46IDAsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1heDogMTAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgICAgbW9pc3R1cmU6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWluOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXg6IDEwMCxcclxuICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgIGhlaWdodDoge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBtaW46IDAsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1heDogMTAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgICAgbGlnaHQ6IHtcclxuICAgICAgICAgICAgICAgICA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cbiAgICAgICAgICAgIGxldCB3aWR0aCA9IGxhc3RTZWdtZW50LndpZHRoO1xyXG4gICAgICAgICAgICBsZXQgbGVuZ3RoID0gbGFzdFNlZ21lbnQubGVuZ3RoO1xyXG4gICAgICAgICAgICB3aWR0aCAqPSB0aGlzLnNwZWNpZXMudHJ1bmtXaWR0aERlZ3JhZGU7XHJcbiAgICAgICAgICAgIGlmICh3aWR0aCA8IHRoaXMuc3BlY2llcy5icmFuY2hTZWdtZW50V2lkdGhNaW4pXHJcbiAgICAgICAgICAgICAgICB3aWR0aCA9IHRoaXMuc3BlY2llcy5icmFuY2hTZWdtZW50V2lkdGhNaW47XHJcbiAgICAgICAgICAgIGlmIChsZW5ndGggPCB0aGlzLnNwZWNpZXMuYnJhbmNoU2VnbWVudEhlaWdodE1pbilcclxuICAgICAgICAgICAgICAgIGxlbmd0aCA9IHRoaXMuc3BlY2llcy5icmFuY2hTZWdtZW50SGVpZ2h0TWluO1xyXG4gICAgICAgICAgICBsZXQgeDEgPSBsYXN0U2VnbWVudC54MjtcclxuICAgICAgICAgICAgbGV0IHkxID0gbGFzdFNlZ21lbnQueTI7XHJcbiAgICAgICAgICAgIGxldCB4MiA9IHgxICsgdGhpcy5sZW5ndGhkaXJfeChsZW5ndGgsIHRoaXMuY3VydmUpO1xyXG4gICAgICAgICAgICBsZXQgeTIgPSB5MSAtIHRoaXMubGVuZ3RoZGlyX3kobGVuZ3RoLCB0aGlzLmN1cnZlKTtcclxuICAgICAgICAgICAgbGV0IG5ld1NlZ21lbnQgPSB7XHJcbiAgICAgICAgICAgICAgICBwb3NpdGlvbjogbmV3IFBvaW50KHgxLCB5MSksXHJcbiAgICAgICAgICAgICAgICB4MTogeDEsXHJcbiAgICAgICAgICAgICAgICB5MTogeTEsXHJcbiAgICAgICAgICAgICAgICB4MjogeDIsXHJcbiAgICAgICAgICAgICAgICB5MjogeTIsXHJcbiAgICAgICAgICAgICAgICBjdXJ2ZTogdGhpcy5jdXJ2ZSxcclxuICA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gICAgICAgIGxldCB5MiA9IHkxIC0gdGhpcy5sZW5ndGhkaXJfeShsZW5ndGgsIHRoaXMuY3VydmUpO1xyXG4gICAgICAgICAgICBsZXQgbmV3QnJhbmNoID0ge1xyXG4gICAgICAgICAgICAgICAgc2VnbWVudHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBuZXcgUG9pbnQoeDEsIHkxKSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgeDE6IHgxLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB5MTogeTEsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHgyOiB4MixcclxuICAgICAgICAgICAgICAgICAgICAgICAgeTI6IHkyLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjdXJ2ZTogdGhpcy5jdXJ2ZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoOiBsZW5ndGgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiB3aWR0aCxcclxuICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgXSxcclxuICAgICAgICAgICAgICAgIGdyb3dMZWF2ZXM6IGZhbHNlLFxyXG4gICAgICAgICAgICAgICAgZG9uZUV4dGVuZGluZzogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICBkb25lQnJhbmNoaW5nOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgIG9yZGVyOiB0aGlzLmJyYW5jaE9yZGVyLFxyXG4gICAgICAgICAgICAgICAgYnJhbmNoQ291bnQ6IDAsXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHRoaXMudHJlZUJyYW5jaGVzLnB1c2gobmV3QnJhbmNoKTtcclxuICAgICAgICAgICAgdGhpcy5icmFuY2hPcmRlcisrO1xyXG4gICAgICAgICAgICB0aGlzLmN1cnZlRGlyID0gUk5HLmdldFVuaWZvcm0oKSA+IDAuNSA/IDEgOiAtMTsgLy8gcmVzZXQgY3VydmUgZGlyXHJcbiAgICAgICAgICAgIHRoaXMuY3VydmUgKz1cclxuICAgICAgICAgICAgICAgIFJORy5nZXRVbmlmb3JtKCkgKiB0aGlzLnNwZWNpZXMuYnJhbmNoQ3VydmVBbmdsZSAqIHRoaXMuY3VydmVEaXI7IC8vIHNldCBuZXcgY3VydmUgZGlyXHJcbiAgICAgICAgICAgIGdyb3dTdWNjZXNzID0gdHJ1ZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgLy8gZXh0ZW5kIGV4aXN0aW5nIGJyYW5jaGVzXHJcbiAgICAgICAgaWYgKCFncm93U3VjY2Vzcykge1xyXG4gICAgICAgICAgICBmb3IgKGxldCB0cmVlQnJhbmNoIG9mIHRoaXMudHJlZUJyYW5jaGVzKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoIXRyZWVCcmFuY2guZG9uZUV4dGVuZGluZykge1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBsYXN0U2VnbWVudCA9IHRyZWVCcmFuY2guc2VnbWVudHNbdHJlZUJyYW5jaC5zZWdtZW50cy5sZW5ndGggLSAxXTtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgd2lkdGggPSBsYXN0U2VnbWVudC53aWR0aDtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgbGVuZ3RoID0gbGFzdFNlZ21lbnQubGVuZ3RoO1xyXG4gICAgICAgICAgICAgICAgICAgIHdpZHRoICo9IHRoaXMuc3BlY2llcy5icmFuY2hTZWdtZW50V2lkdGhEZWdyYWRlO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICh3aWR0aCA8IHRoaXMuc3BlY2llcy5icmFuY2hTZWdtZW50V2lkdGhNaW4pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoID0gdGhpcy5zcGVjaWVzLmJyYW5jaFNlZ21lbnRXaWR0aE1pbjtcclxuICAgICAgICAgICAgICAgICAgICBsZW5ndGggKj0gdGhpcy5zcGVjaWVzLmJyYW5jaFNlZ21lbnRIZWlnaHREZWdyYWRlO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChsZW5ndGggPCB0aGlzLnNwZWNpZXMuYnJhbmNoU2VnbWVudEhlaWdodE1pbilcclxuICAgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gdGhpcy5zcGVjaWVzLmJyYW5jaFNlZ21lbnRIZWlnaHRNaW47XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IHgxID0gbGFzdFNlZ21lbnQueDI7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IHkxID0gbGFzdFNlZ21lbnQueTI7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IHgyID0geDEgKyB0aGlzLmxlbmd0aGRpcl94KGxlbmd0aCwgdGhpcy5jdXJ2ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IHkyID0geTEgLSB0aGlzLmxlbmd0aGRpcl95KGxlbmd0aCwgdGhpcy5jdXJ2ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IG5ld1NlZ21lbnQgPSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBuZXcgUG9pbnQoeDEsIHkxKSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgeDE6IHgxLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB5MTogeTEsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHgyOiB4MixcclxuICAgICAgICAgICAgICAgICAgICAgICAgeTI6IHkyLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjdXJ2ZTogdGhpcy5jdXJ2ZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoOiBsZW5ndGgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiB3aWR0aCxcclxuICAgICAgICAgICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICAgICAgICAgIHRyZWVCcmFuY2guc2VnbWVudHMucHVzaChuZXdTZWdtZW50KTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAodHJlZUJyYW5jaC5zZWdtZW50cy5sZW5ndGggPj0gdGhpcy5zcGVjaWVzLmJyYW5jaFNlZ21lbnRDb3VudCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0cmVlQnJhbmNoLmRvbmVFeHRlbmRpbmcgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmJyYW5jaE9yZGVyKys7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jdXJ2ZURpciA9IFJORy5nZXRVbmlmb3JtKCkgPiAwLjUgPyAxIDogLTE7IC8vIHJlc2V0IGN1cnZlIGRpclxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3VydmUgKz1cclxuICAgICAgICAgICAgICAgICAgICAgICAgUk5HLmdldFVuaWZvcm0oKSAqIHRoaXMuc3BlY2llcy5icmFuY2hDdXJ2ZUFuZ2xlICogdGhpcy5jdXJ2ZURpcjsgLy8gc2V0IG5ldyBjdXJ2ZSBkaXJcclxuICAgICAgICAgICAgICAgICAgICBncm93U3VjY2VzcyA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgLy8gYWRkIGEgbmV3IGJyYW5jaCB0byBhbiBleGlzdGluZyBzZWdtZW50L2JyYW5jaFxyXG4gICAgICAgIC8vIHN0YXJ0aW5nIGZyb20gdG9wIG9mIHRyZWVcclxuICAgICAgICBpZiAoIWdyb3dTdWNjZXNzKSB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy50cmVlQnJhbmNoZXMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgIC8vIHN0YXJ0IGF0IHRoZSBib3R0b20gb2YgdGhlIHRyZWUgZm9yIGJldHRlciBsb29raW5nIGJyYW5jaGluZ1xyXG4gICAgICAgICAgICAgICAgLy8gbGV0IHRyZWVCcmFuY2ggPSB0aGlzLnRyZWVCcmFuY2hlc1tpXTtcclxuICAgICAgICAgICAgICAgIGxldCB0cmVlQnJhbmNoID0gUk5HLmdldEl0ZW0odGhpcy50cmVlQnJhbmNoZXMpO1xyXG4gICAgICAgICAgICAgICAgaWYgKCF0cmVlQnJhbmNoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpZiAodHJlZUJyYW5jaC5icmFuY2hDb3VudCA8IHRoaXMuYnJhbmNoZXNQZXJTZWdtZW50ICYmXHJcbiAgICAgICAgICAgICAgICAgICAgIXRyZWVCcmFuY2guZG9uZUJyYW5jaGluZykge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbnN0IHJhbmRTZWdtZW50ID0gUk5HLmdldEl0ZW0odHJlZUJyYW5jaC5zZWdtZW50cyk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcmFuZFNlZ21lbnQgPSBnZXRJdGVtRnJvbVJhbmdlKHRyZWVCcmFuY2guc2VnbWVudHMsIDIsIHRyZWVCcmFuY2guc2VnbWVudHMubGVuZ3RoIC0gMSk7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFyYW5kU2VnbWVudCB8fFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAocmFuZFNlZ21lbnQgPT09IG51bGwgfHwgcmFuZFNlZ21lbnQgPT09IHZvaWQgMCA/IHZvaWQgMCA6IHJhbmRTZWdtZW50LndpZHRoKSA8PSB0aGlzLnNwZWNpZXMuYnJhbmNoU2VnbWVudFdpZHRoTWluKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmN1cnZlID1cclxuICAgICAgICAgICAgICAgICAgICAgICAgcmFuZFNlZ21lbnQuY3VydmUgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRoaXMuc3BlY2llcy5icmFuY2hGb3JrTWluICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSTkcuZ2V0VW5pZm9ybSgpICogdGhpcy5zcGVjaWVzLmJyYW5jaEZvcmtSYW5nZSkgKlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChSTkcuZ2V0VW5pZm9ybSgpID4gMC41ID8gMSA6IC0xKTtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgd2lkdGggPSByYW5kU2VnbWVudC53aWR0aDtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgbGVuZ3RoID0gcmFuZFNlZ21lbnQubGVuZ3RoO1xyXG4gICAgICAgICAgICAgICAgICAgIHdpZHRoICo9IHRoaXMuc3BlY2llcy5icmFuY2hTZWdtZW50V2lkdGhEZWdyYWRlO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICh3aWR0aCA8IHRoaXMuc3BlY2llcy5icmFuY2hTZWdtZW50V2lkdGhNaW4pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoID0gdGhpcy5zcGVjaWVzLmJyYW5jaFNlZ21lbnRXaWR0aE1pbjtcclxuICAgICAgICAgICAgICAgICAgICBpZiAobGVuZ3RoIDwgdGhpcy5zcGVjaWVzLmJyYW5jaFNlZ21lbnRIZWlnaHRNaW4pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IHRoaXMuc3BlY2llcy5icmFuY2hTZWdtZW50SGVpZ2h0TWluO1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCB4MSA9IHJhbmRTZWdtZW50LngyO1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCB5MSA9IHJhbmRTZWdtZW50LnkyO1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCB4MiA9IHgxICsgdGhpcy5sZW5ndGhkaXJfeChsZW5ndGgsIHRoaXMuY3VydmUpO1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCB5MiA9IHkxIC0gdGhpcy5sZW5ndGhkaXJfeShsZW5ndGgsIHRoaXMuY3VydmUpO1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHJhbmQgPSBSTkcuZ2V0VW5pZm9ybSgpO1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBkb25lQnJhbmNoaW5nID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICAgICAgZG9uZUJyYW5jaGluZyA9IHJhbmQgPiB0aGlzLmJyYW5jaENoYW5jZTtcclxuICAgICAgICAgICAgICAgICAgICAvLyBpZiAoaXNUcmVlVHJ1bmsodHJlZUJyYW5jaCkpIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyAgIGRvbmVCcmFuY2hpbmcgPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgICAgICAvLyB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vICAgZG9uZUJyYW5jaGluZyA9IHJhbmQgPiB0aGlzLmJyYW5jaENoYW5jZTtcclxuICAgICAgICAgICAgICAgICAgICAvLyB9XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gaWYgKGlzVHJlZVRydW5rKHRyZWVCcmFuY2gpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gICAvLyB0cmVlIHRydW5rIGlzIGxlc3MgbGlrZWx5IHRvIGZpbmlzaCBicmFuY2hpbmdcclxuICAgICAgICAgICAgICAgICAgICAvLyAgIGlmIChSTkcuZ2V0VW5pZm9ybSgpID4gMC42KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gICAgIGRvbmVCcmFuY2hpbmcgPSByYW5kID4gdGhpcy5icmFuY2hDaGFuY2U7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gICB9XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyAgIGRvbmVCcmFuY2hpbmcgPSByYW5kID4gdGhpcy5icmFuY2hDaGFuY2U7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gfVxyXG4gICAgICAgICAgICAgICAgICAgIGxldCBuZXdCcmFuY2ggPSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlZ21lbnRzOiBbXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IG5ldyBQb2ludCh4MSwgeTEpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHgxOiB4MSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5MTogeTEsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeDI6IHgyLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHkyOiB5MixcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJ2ZTogdGhpcy5jdXJ2ZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZW5ndGg6IGxlbmd0aCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogd2lkdGgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBncm93TGVhdmVzOiB0cnVlLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBkb25lRXh0ZW5kaW5nOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3RvcCBzb21lIGJyYW5jaGVzIGZyb20gYnJhbmNoaW5nIHRvIGtlZXAgdHJlZSBmcm9tIGdldHRpbmcgdG9vIGRlbnNlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvbmVCcmFuY2hpbmcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG9yZGVyOiB0aGlzLmJyYW5jaE9yZGVyLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBicmFuY2hDb3VudDogMCxcclxuICAgICAgICAgICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMudHJlZUJyYW5jaGVzLnB1c2gobmV3QnJhbmNoKTtcclxuICAgICAgICAgICAgICAgICAgICB0cmVlQnJhbmNoLmJyYW5jaENvdW50Kys7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5icmFuY2hPcmRlcisrO1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYnJhbmNoQ2hhbmNlICs9IHRoaXMuc3BlY2llcy5icmFuY2hDaGFuY2VHcm93OyAvLyBncm93IGJyYW5jaCBjaGFuY2UgZXZlcnkgdGltZSB0cmVlIGdyb3dzXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jdXJ2ZURpciA9IFJORy5nZXRVbmlmb3JtKCkgPiAwLjUgPyAxIDogLTE7IC8vIHJlc2V0IGN1cnZlIGRpclxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3VydmUgKz1cclxuICAgICAgICAgICAgICAgICAgICAgICAgUk5HLmdldFVuaWZvcm0oKSAqIHRoaXMuc3BlY2llcy5icmFuY2hDdXJ2ZUFuZ2xlICogdGhpcy5jdXJ2ZURpcjsgLy8gc2V0IG5ldyBjdXJ2ZSBkaXJcclxuICAgICAgICAgICAgICAgICAgICBncm93U3VjY2VzcyA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIGdyb3dTdWNjZXNzO1xyXG4gICAgfVxyXG4gICAgcmVuZGVyVHJ1bmtCYXNlKGF0dGFjaFNlZ21lbnQsIGF0dGFjaFNwcml0ZSkge1xyXG4gICAgICAgIC8vIGFkZCBhIHNwcml0ZSBmb3Igd2hlcm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5ZXIuUExBTlQsIExheWVyLlRFUlJBSU4pO1xyXG4gICAgICAgIGNvbnN0IHRpbnQgPSB0aGlzLmdhbWUucmVuZGVyZXIuZ2V0VGludEZvclBvc2l0aW9uKHRlcnJhaW5Qb2ludCk7XHJcbiAgICAgICAgbGV0IGdyb3dTdWNjZXNzID0gZmFsc2U7XHJcbiAgICAgICAgaWYgKGZpcnN0R3Jvd3RoKSB7XHJcbiAgICAgICAgICAgIHRoaXMuc3ByaXRlID0gbmV3IFBhcnRpY2xlQ29udGFpbmVyKDEwMDAsIHtcclxuICAgICAgICAgICAgICAgIHZlcnRpY2VzOiB0cnVlLFxyXG4gICAgICAgICAgICAgICAgcG9zaXRpb246IHRydWUsXHJcbiAgICAgICAgICAgICAgICByb3RhdGlvbjogdHJ1ZSxcclxuICAgICAgICAgICAgICAgIHNjYWxlOiB0cnVlLFxyXG4gICAgICAgICAgICAgICAgdGludDogdHJ1ZSxcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZ3Jvd3RoU3RlcHM7IGkrKykge1xyXG4gICAgICAgICAgICBpZiAodGhpcy50cmVlQnJhbmNoZXMubGVuZ3RoID4gMSkge1xyXG4gICAgICAgICAgICAgICAgLy8gb25seSBzdGFydCBncm93aW5nIGxlYXZlcyBvbmNlIHRoZXJlIGFyZSBicmFuY2hlc1xyXG4gICAgICAgICAgICAgICAgdGhpcy5yZW5kZXJMZWF2ZXModGludCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKHRoaXMuZnVsbHlHcm93bikge1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy8gYWRkIHRydW5rXHJcbiAgICAgICAgICAgIGdyb3dTdWNjZXNzID0gdGhpcy5yZW5kZXJCcmFuY2godGhpcy50cmVlVHJ1bmssIHRpbnQpO1xyXG4gICAgICAgICAgICBpZiAoIWdyb3dTdWNjZXNzKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBhZGQgYnJhbmNoZXMgdG8gdHJ1bmtcclxuICAgICAgICAgICAgICAgIGZvciAobGV0IHRyZWVCcmFuY2ggb2YgdGhpcy50cmVlQnJhbmNoZXMpIHtcclxuICAgICAgICAgICAgICAgICAgICBncm93U3VjY2VzcyA9IHRoaXMucmVuZGVyQnJhbmNoKHRyZWVCcmFuY2gsIHRpbnQpO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChncm93U3VjY2Vzcykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKCFncm93U3VjY2Vzcykge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5mdWxseUdyb3duID0gdHJ1ZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gZ3Jvd1N1Y2Nlc3M7XHJcbiAgICB9XHJcbiAgICByYW5kb21pemVMZWFmU2l6ZSgpIHtcclxuICAgICAgICB0aGlzLmxlYWZTaXplID1cclxuICAgICAgICAgICAgdGhpcy5zcGVjaWVzLmxlYWZNaW5TaXplICsgUk5HLmdldFVuaWZvcm0oKSAqIHRoaXMuc3BlY2llcy5sZWFmU2l6ZVJhbmdlO1xyXG4gICAgfVxyXG4gICAgbGVuZ3RoZGlyX3gobGVuZ3RoLCBkaXJlY3Rpb24pIHtcclxuICAgICAgICByZXR1cm4gbGVuZ3RoICogTWF0aC5jb3MoKGRpcmVjdGlvbiAqIE1hdGguUEkpIC8gMTgwKTtcclxuICAgIH1cclxuICAgIGxlbmd0aGRpcl95KGxlbmd0aCwgZGlyZWN0aW9uKSB7XHJcbiAgICAgICAgcmV0dXJuIGxlbmd0aCAqIE1hdGguc2luKChkaXJlY3Rpb24gKiBNYXRoLlBJKSAvID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JcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLmdyb3d0aFN0ZXAgKz0gMTsgLy8gaW5jcmVtZW50IGdyb3d0aCBzdGVwXHJcbiAgICAgICAgdGhpcy5yZW5kZXJUcmVlKGdyb3dTdGVwcyk7XHJcbiAgICB9XHJcbiAgICByZW5kZXJMZWF2ZXModGludCkge1xyXG4gICAgICAgIGlmICh0aGlzLmdyb3dMZWF2ZXMgPT09IGZhbHNlKSB7XHJcbiAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcbiAgICAgICAgY29uc3QgbGVhZnNQZXJHcm93dGggPSB0aGlzLmxlYXZlc1BlckJyYW5jaCAvIDQ7XHJcbiAgICAgICAgY29uc3QgbWF4TGVhdmVzID0gdGhpcy5sZWF2ZXNQZXJCcmFuY2ggKlxyXG4gICAgICAgICAgICB0aGlzLnRyZWVCcmFuY2hlcy5sZW5ndGggKlxyXG4gICAgICAgICAgICB0aGlzLnNwZWNpZXMubGVhdmVzUGVyQnJhbmNoRGVuc2l0eTtcclxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGxlYWZzUGVyR3Jvd3RoOyBpKyspIHtcclxuICAgICAgICAgICAgaWYgKHRoaXMubGVhZlNwcml0ZXMubGVuZ3RoID49IG1heExlYXZlcykge1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY29uc3QgbGVhZlJvdCA9IFJORy5nZXRVbmlmb3JtKCkgKiAzNjA7XHJcbiAgICAgICAgICAgIC8vIGdldCBuZXdlciBicmFuY2hlcyBmaXJzdFxyXG4gICAgICAgICAgICBsZXQgcmFuZG9tVmFsdWUgPSBNYXRoLnBvdyhSTkcuZ2V0VW5pZm9ybSgpLCAyKTtcclxuICAgICAgICAgICAgbGV0IGJyYW5jaEluZGV4ID0gTWF0aC5mbG9vcigoMSAtIHJhbmRvbVZhbHVlKSAqIHRoaXMudHJlZUJyYW5jaGVzLmxlbmd0aCk7XHJcbiAgICAgICAgICAgIGxldCBicmFuY2ggPSB0aGlzLnRyZWVCcmFuY2hlc1ticmFuY2hJbmRleF07XHJcbiAgICAgICAgICAgIGlmICghYnJhbmNoLmdyb3dMZWF2ZXMpIHtcclxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGxldCBzZWdtZW50ID0gUk5HLmdldEl0ZW0oKGJyYW5jaCA9PT0gbnVsbCB8fCBicmFuY2ggPT09IHZvaWQgMCA/IHZvaWQgMCA6IGJyYW5jaC5zZWdtZW50cykgfHwgW10pO1xyXG4gICAgICAgICAgICBpZiAoIWJyYW5jaCB8fCAhc2VnbWVudCkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHRoaXMubGVhZkFscGhhIC09IDAuMDI7XHJcbiAgICAgICAgICAgIHRoaXMubGVhZlNpemUgLT0gMC4xO1xyXG4gICAgICAgICAgICBpZiAodGhpcy5sZWFmQWxwaGEgPCB0aGlzLnNwZWNpZXMubWluTGVhZkFscGhhKSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmxlYWZBbHBoYSA9IHRoaXMuc3BlY2llcy5tYXhMZWFmQWxwaGE7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKHRoaXMubGVhZlNpemUgPCB0aGlzLnNwZWNpZXMubGVhZk1pblNpemUpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMucmFuZG9taXplTGVhZlNpemUoKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBsZXQgYW5nbGUgPSBSTkcuZ2V0VW5pZm9ybSgpICogdGhpcy5zcGVjaWVzLmxlYWZDb3ZlcmFnZUFuZ2xlO1xyXG4gICAgICAgICAgICBsZXQgZGlzdGFuY2UgPSBSTkcuZ2V0VW5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gICBmb3IgKGxldCBpID0gMDsgaSA8IGRlYWRMZWFmQ291bnQ7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgbGVhZiA9IHRoaXMubGVhZlNwcml0ZXNbaV07XHJcbiAgICAgICAgICAgICAgICBpZiAoIWxlYWYpXHJcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICBsZWFmSW5kZXggPSB0aGlzLmxlYWZTcHJpdGVzLmluZGV4T2YobGVhZik7XHJcbiAgICAgICAgICAgICAgICBsZWFmLnkgKz0gUk5HLmdldFVuaWZvcm0oKSAqIDggKiB0aW1lU2NhbGU7XHJcbiAgICAgICAgICAgICAgICAvLyBnZW50bGUgc3dheVxyXG4gICAgICAgICAgICAgICAgbGVhZi54ICs9IChSTkcuZ2V0VW5pZm9ybSgpICogMiAtIDEpICogdGltZVNjYWxlO1xyXG4gICAgICAgICAgICAgICAgbGVhZi5yb3RhdGlvbiArPSAoUk5HLmdldFVuaWZvcm0oKSAqIDIgLSAxKSAqIHRpbWVTY2FsZTtcclxuICAgICAgICAgICAgICAgIGlmIChsZWFmLnkgPj0gLTIwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gZmFkZSB0aGUgbGVhZiBvdXQgYXMgaXQgcmVhY2hlcyB0aGUgZ3JvdW5kXHJcbiAgICAgICAgICAgICAgICAgICAgbmV3QWxwaGEgPSBsZWFmLmFscGhhIC0gMC4xMiAqIHRpbWVTY2FsZTtcclxuICAgICAgICAgICAgICAgICAgICBuZXdBbHBoYSA9IG5ld0FscGhhIDwgMCA/IDAgOiBuZXdBbHBoYTtcclxuICAgICAgICAgICAgICAgICAgICBsZWFmLmFscGhhID0gbmV3QWxwaGE7XHJcbiAgICAgICAgICAgICAgICAgICAgbmV3U2NhbGUgPSBsZWFmLnNjYWxlLnggLSAwLjAzICogdGltZVNjYWxlO1xyXG4gICAgICAgICAgICAgICAgICAgIG5ld1NjYWxlID0gbmV3U2NhbGUgPCAwLjQgPyAwLjQgOiBuZXdTY2FsZTtcclxuICAgICAgICAgICAgICAgICAgICBsZWFmLnNjYWxlLnNldChuZXdTY2FsZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxlYWYueSA+PSAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxlYWYuZGVzdHJveSgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmxlYWZTcHJpdGVzLnNwbGljZShsZWFmSW5kZXgsIDEpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGdldERlc2NyaXB0aW9uKCkge1xyXG4gICAgICAgIGNvbnN0IGRlc2NyaXB0aW9uQmxvY2tzID0gW107XHJcbiAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgIGljb246IFBpbkljb24sXHJcbiAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAocG9pbnRlclRhcmdldCkgPT4gYCR7cG9pbnRlclRhcmdldCA9PT0gbnVsbCB8fCBwb2ludGVyVGFyZ2V0ID09PSB2b2lkIDAgPyB2b2lkIDAgOiBwb2ludGVyVGFyZ2V0LnBvc2l0aW9uLnh9LCAke3BvaW50ZXJUYXJnZXQgPT09IG51bGwgfHwgcG9pbnRlclRhcmdldCA9PT0gdm9pZCAwID8gdm9pZCAwIDogcG9pbnRlclRhcmdldC5wb3NpdGlvbi55fWAsXHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgIGljb246IFR5cGVJY29uLFxyXG4gICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKCkgPT4gdGhpcy5zdWJUeXBlLFxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGlmICh0aGlzLmdvYWwpIHtcclxuICAgICAgICAgICAgZGVzY3JpcHRpb25CbG9ja3MucHVzaCh7XHJcbiAgICAgICAgICAgICAgICBpY29uOiBHb2FsSWNvbixcclxuICAgICAgICAgICAgICAgIGdldERlc2NyaXB0aW9uOiAoKSA9PiB0aGlzLmdvYWwubmFtZSxcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh0aGlzLmFjdGlvbikge1xyXG4gICAgICAgICAgICBkZXNjcmlwdGlvbkJsb2Nrcy5wdXNoKHtcclxuICAgICAgICAgICAgICAgIGljb246IEFjdGlvbkljb24sXHJcbiAgICAgICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKCkgPT4gdGhpcy5hY3Rpb24ubmFtZSxcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBkZXNjcmlwdGlvbkJsb2NrcztcclxuICAgIH1cclxufVxyXG4iLCJleHBvcnQgY2xhc3MgR2FtZVN0YXRlIHtcclxuICAgIGNvbnN0cnVjdG9yKCkge1xyXG4gICAgICAgIHRoaXMucmVzZXQoKTtcclxuICAgIH1cclxuICAgIHJlc2V0KCkge1xyXG4gICAgICAgIHRoaXMuZm91bmRQaW5lYXBwbGUgPSBmYWxzZTtcclxuICAgICAgICB0aGlzLnBpbmVhcHBsZVdhc0Rlc3Ryb3llZCA9IGZhbHNlO1xyXG4gICAgICAgIHRoaXMucGxheWVyV2FzQ2F1Z2h0ID0gZmFsc2U7XHJcbiAgICB9XHJcbiAgICBkb1N0YXJ0TmV4dFJvdW5kKCkge1xyXG4gICAgICAgIHJldHVybiB0aGlzLmZvdW5kUGluZWFwcGxlO1xyXG4gICAgfVxyXG4gICAgZG9SZXN0YXJ0R2FtZSgpIHtcclxuICAgICAgICByZXR1cm4gdGhpcy5waW5lYXBwbGVXYXNEZXN0cm95ZWQgfHwgdGhpcy5wbGF5ZXJXYXNDYXVnaHQ7XHJcbiAgICB9XHJcbiAgICBpc0dhbWVPdmVyKCkge1xyXG4gICAgIC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udXNlckludGVyZmFjZS5pbml0KCk7XHJcbiAgICAgICAgICAgIHlpZWxkIHRoaXMuaW5pdGlhbGl6ZVBsYW50cygpO1xyXG4gICAgICAgICAgICB5aWVsZCB0aGlzLmluaXRpYWxpemVHYW1lKCk7XHJcbiAgICAgICAgICAgIHlpZWxkIHRoaXMuYWRkQWN0b3JzKCk7XHJcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgc3RhcnQoKSB7XHJcbiAgICAgICAgLy8gdGhpcy5tYWluTG9vcChwZXJmb3JtYW5jZS5ub3coKSk7XHJcbiAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoXCJibHVyXCIsICgpID0+IHtcclxuICAgICAgICAgICAgLy8gTWFpbkxvb3Auc3RvcCgpO1xyXG4gICAgICAgICAgICB0aGlzLnRpbWVNYW5hZ2VyLnNldElzUGF1c2VkKHRydWUpO1xyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIE1haW5Mb29wLnNldEJlZ2luKHRoaXMuc3RhcnRMb29wKVxyXG4gICAgICAgICAgICAuc2V0VXBkYXRlKHRoaXMubWFpbkxvb3AuYmluZCh0aGlzKSlcclxuICAgICAgICAgICAgLnNldERyYXcodGhpcy5yZW5kZXJMb29wLmJpbmQodGhpcykpXHJcbiAgICAgICAgICAgIC5zZXRFbmQodGhpcy5lbmRMb29wLmJpbmQodGhpcykpXHJcbiAgICAgICAgICAgIC5zdGFydCgpO1xyXG4gICAgfVxyXG4gICAgaXNNYXBCbG9ja2VkKHgsIHkpIHtcclxuICAgICAgICByZXR1cm4gIXRoaXMubWFwLmlzUGFzc2FibGUoeCwgeSk7XHJcbiAgICB9XHJcbiAgICBpc09jY3VwaWVkQnlFbnRpdHkoeCwgeSkge1xyXG4gICAgICAgIHJldHVybiB0aGlzLmVudGl0aWVzLnNvbWUoKGVudGl0eSkgPT4gZW50aXR5LnBvc2l0aW9uLnggPT09IHggJiYgZW50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zbTogdGhpcy5tYXAucG9sZXNNYXAubWFnbmV0aXNtTWFwW01hcFdvcmxkLmNvb3Jkc1RvS2V5KHgsIHkpXSxcclxuICAgICAgICAgICAgdGVtcGVyYXR1cmVQZXJjZW50OiB0aGlzLm1hcC50ZW1wTWFwLnRlbXBNYXBbTWFwV29ybGQuY29vcmRzVG9LZXkoeCwgeSldLFxyXG4gICAgICAgICAgICBtb2lzdHVyZTogdGhpcy5tYXAubW9pc3R1cmVNYXAubW9pc3R1cmVNYXBbTWFwV29ybGQuY29vcmRzVG9LZXkoeCwgeSldLFxyXG4gICAgICAgICAgICBzdW5saWdodDogdGhpcy5tYXAuZ2V0VG90YWxMaWdodCh4LCB5KSxcclxuICAgICAgICAgICAgYmlvbWU6IHRoaXMubWFwLmJpb21lTWFwW01hcFdvcmxkLmNvb3Jkc1RvS2V5KHgsIHkpXSxcclxuICAgICAgICB9O1xyXG4gICAgfVxyXG4gICAgZ2V0RW50aXR5QXQoeCwgeSkge1xyXG4gICAgICAgIGZvciAobGV0IGVudGl0eSBvZiB0aGlzLmVudGl0aWVzKSB7XHJcbiAgICAgICAgICAgIGlmIChlbnRpdHkucG9zaXRpb24ueCA9PT0geCAmJiBlbnRpdHkucG9zaXRpb24ueSA9PT0geSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGVudGl0eTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gbnVsbDtcclxuICAgIH1cclxuICAgIGdldFBsYW50QXQoeCwgeSkge1xyXG4gICAgICAgIGZvciAobGV0IHBsYW50IG9mIHRoaXMucGxhbnRzKSB7XHJcbiAgICAgICAgICAgIGlmIChwbGFudC5wb3NpdGlvbi54ID09PSB4ICYmIHBsYW50LnBvc2l0aW9uLnkgPT09IHkpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiBwbGFudDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gbnVsbDtcclxuICAgIH1cclxuICAgIGdldFJhbmRvbVRpbGVQb3NpdGlvbnModHlwZSwgcXVhbnRpdHkgPSAxKSB7XHJcbiAgICAgICAgcmV0dXJuIHRoaXMubWFwLmdldFJhbmRvbVRpbGVQb3NpdGlvbnModHlwZSwgcXVhbnRpdHkpO1xyXG4gICAgfVxyXG4gICAgZ2V0UmFuZG9tUGxhbnRQb3NpdGlvbnModHlwZSwgcXVhbnRpdHkgPSAxKSB7XHJcbiAgICAgICAgbGV0IGJ1ZmZlciA9IFtdO1xyXG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcclxuICAgICAgICBmb3IgKGxldCBrZXkgaW4gdGhpcy5wbGFudHMpIHtcclxuICAgICAgICAgICAgaWYgKHRoaXMucGxhbnRzW2tleV0udHlwZSA9PT0gdHlwZSkge1xyXG4gICAgICAgICAgICAgICAgYnVmZmVyLnB1c2godGhpcy5wbGFudHNba2V5XS5wb3NpdGlvbik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgbGV0IGluZGV4O1xyXG4gICAgICAgIHdoaWxlIChidWZmZXIubGVuZ3RoID4gMCAmJiByZXN1bHQubGVuZ3RoIDwgcXVhbnRpdHkpIHtcclxuICAgICAgICAgICAgaW5kZXggPSBNYXRoLmZsb29yKFJORy5nZXRVbmlmb3JtKCkgKiBidWZmZXIubGVuZ3RoKTtcclxuICAgICAgICAgICAgcmVzdWx0LnB1c2goYnVmZmVyLnNwbGljZShpbmRleCwgMSlbMF0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gcmVzdWx0O1xyXG4gICAgfVxyXG4gICAgZ2V0UmFuZG9tRW50aXR5UG9zaXRpb25zKHR5cGUsIHF1YW50aXR5ID0gMSkge1xyXG4gICAgICAgIGxldCBidWZmZXIgPSBbXTtcclxuICAgICAgICBsZXQgcmVzdWx0ID0gW107XHJcbiAgICAgICAgZm9yIChsZXQga2V5IGluIHRoaXMuZW50aXRpZXMpIHtcclxuICA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xhcHNlZCA+IHRoaXMub3B0aW9ucy5tYWluTG9vcFJhdGUpIHtcclxuICAgIC8vICAgICBpZiAodGhpcy5vcHRpb25zLnNob3VsZFJlbmRlcikge1xyXG4gICAgLy8gICAgICAgZWxhcHNlZCA9IG5vdyAtIHRoaXMubGFzdFJlbmRlclRpbWU7XHJcbiAgICAvLyAgICAgICBpZiAoZWxhcHNlZCA+IHRoaXMub3B0aW9ucy5yZWZyZXNoUmF0ZSkge1xyXG4gICAgLy8gICAgICAgICBpZiAodGhpcy5nYW1lTG9vcERlbGF5ID4gMCAmJiAhdGhpcy50aW1lTWFuYWdlci5pc1BhdXNlZCkge1xyXG4gICAgLy8gICAgICAgICAgIHRoaXMuZ2FtZUxvb3BEZWxheSAtPSBlbGFwc2VkICogdGhpcy50aW1lTWFuYWdlci50aW1lU2NhbGU7XHJcbiAgICAvLyAgICAgICAgIH1cclxuICAgIC8vICAgICAgICAgaWYgKHRoaXMuZ2FtZUxvb3BEZWxheSA8IDApIHtcclxuICAgIC8vICAgICAgICAgICB0aGlzLmdhbWVMb29wRGVsYXkgPSAwO1xyXG4gICAgLy8gICAgICAgICB9XHJcbiAgICAvLyAgICAgICAgIGF3YWl0IHRoaXMucmVuZGVyTG9vcChub3cpO1xyXG4gICAgLy8gICAgICAgICB0aGlzLmxhc3RSZW5kZXJUaW1lID0gbm93O1xyXG4gICAgLy8gICAgICAgfVxyXG4gICAgLy8gICAgIH1cclxuICAgIC8vICAgICBlbGFwc2VkID0gbm93IC0gdGhpcy5sYXN0dWlSZWZyZXNoVGltZTtcclxuICAgIC8vICAgICBpZiAoZWxhcHNlZCA+IHRoaXMub3B0aW9ucy51aUxvb3BSYXRlKSB7XHJcbiAgICAvLyAgICAgICBhd2FpdCB0aGlzLnVpTG9vcChub3cpO1xyXG4gICAgLy8gICAgICAgdGhpcy5sYXN0dWlSZWZyZXNoVGltZSA9IG5vdztcclxuICAgIC8vICAgICB9XHJcbiAgICAvLyAgICAgaWYgKCF0aGlzLn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3JzLnB1c2godGhpcy50aW1lTWFuYWdlci5uZXh0T25TY2hlZHVsZSgpKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgLy8gbGV0IGFjdGlvbnMgPSBhY3RvcnMubWFwKChhY3RvcikgPT4ge1xyXG4gICAgICAgIC8vICAgaWYgKGFjdG9yKSB7XHJcbiAgICAgICAgLy8gICAgIHJldHVybiBhY3Rvcj8ucGxhbigpO1xyXG4gICAgICAgIC8vICAgfVxyXG4gICAgICAgIC8vIH0pO1xyXG4gICAgICAgIHJldHVybiBQcm9taXNlLmFsbChhY3RvcnMubWFwKChhY3RvcikgPT4ge1xyXG4gICAgICAgICAgICBpZiAoYWN0b3IgJiYgKGFjdG9yID09PSBudWxsIHx8IGFjdG9yID09PSB2b2lkIDAgPyB2b2lkIDAgOiBhY3Rvci5wbGFuKSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGFjdG9yID09PSBudWxsIHx8IGFjdG9yID09PSB2b2lkIDAgPyB2b2lkIDAgOiBhY3Rvci5wbGFuKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KSkudGhlbigoKSA9PiBfX2F3YWl0ZXIodGhpcywgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uKiAoKSB7XHJcbiAgICAgICAgICAgIGFjdG9ycy5mb3JFYWNoKChhY3RvcikgPT4ge1xyXG4gICAgICAgICAgICAgICAgaWYgKGFjdG9yID09PSBudWxsIHx8IGFjdG9yID09PSB2b2lkIDAgPyB2b2lkIDAgOiBhY3Rvci5hY3Rpb24pIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnRpbWVNYW5hZ2VyLnNldER1cmF0aW9uKGFjdG9yLmFjdGlvbi5kdXJhdGlvbkluVHVybnMpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgeWllbGQgUHJvbWlzZS5hbGwoYWN0b3JzLm1hcCgoYWN0b3IpID0+IHtcclxuICAgICAgICAgICAgICAgIGlmIChhY3RvciA9PT0gbnVsbCB8fCBhY3RvciA9PT0gdm9pZCAwID8gdm9pZCAwIDogYWN0b3IuYWN0aW9uKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFjdG9yID09PSBudWxsIHx8IGFjdG9yID09PSB2b2lkIDAgPyB2b2lkIDAgOiBhY3Rvci5hY3QoKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSkpO1xyXG4gICAgICAgICAgICAvLyBjb25zb2xlLmxvZyhcInByb21pc2VzIGRvbmVcIik7XHJcbiAgICAgICAgICAgIHRoaXMudXNlckludGVyZmFjZS5kcmF3RW50aXRpZXMoKTtcclxuICAgICAgICAgICAgdGhpcy5tYXAubGlnaHRNYW5hZ2VyLmNsZWFyTGlnaHRNYXAoKTtcclxuICAgICAgICAgICAgdGhpcy5tYXAubGlnaHRNYW5hZ2VyLmludGVycG9sYXRlQW1iaWVudExpZ2h0KCk7XHJcbiAgICAgICAgICAgIHRoaXMubWFwLnNoYWRvd01hcC50dXJuVXBkYXRlKCk7XHJcbiAgICAgICAgICAgIHRoaXMubWFwLmNsb3VkTWFwLnR1cm5VcGRhdGUoKTtcclxuICAgICAgICAgICAgLy8gdXBkYXRlIGR5bmFtaWMgbGlnaHRzIGFmdGVyIGFsbCBhY3RvcnMgaGF2ZSBtb3ZlZFxyXG4gICAgICAgICAgICAvLyB3aWxsIGdldCBwaWNrZWQgdXAgaW4gbmV4dCByZW5kZXJcclxuICAgICAgICAgICAgdGhpcy5tYXAubGlnaHRNYW5hZ2VyLmNsZWFyQ2hhbmdlZER5bmFtaWNMaWdodHMoKTtcclxuICAgICAgICAgICAgdGhpcy5tYXAubGlnaHRNYW5hZ2VyLnVwZGF0ZUR5bmFtaWNMaWdodGluZygpO1xyXG4gICAgICAgICAgICB0aGlzLm1hcC5saWdodE1hbmFnZXIucmVjYWxjdWxhdGVEeW5hbWljTGlnaHRpbmcoKTtcclxuICAgICAgICB9KSk7XHJcbiAgICAgICAgLy8gYWN0b3JzLmZvckVhY2goKGFjdG9yKSA9PiB7XHJcbiAgICAgICAgLy8gICBpZiAoYWN0b3I/LnBsYW4pIHtcclxuICAgICAgICAvLyAgICAgaWYgKGFjdG9yLnR5cGUgPT09IFRpbGVUeXBlLkVudGl0eSkge1xyXG4gICAgICAgIC8vICAgICAgIGNvbnNvbGUubG9nKFwiYWJvdXQgdG8gYWN0IG9uIFwiICsgYWN0b3IubmFtZSk7XHJcbiAgICAgICAgLy8gICAgICAgY29uc29sZS5sb2coXHJcbiAgICAgICAgLy8gICAgICAgICBcInR1cm4gdnMgY3VycmVudCB0dXJuXCIsXHJcbiAgICAgICAgLy8gICAgICAgICB0dXJuLFxyXG4gICAgICAgIC8vICAgICAgICAgdGhpcy50aW1lTWFuYWdlci5jdXJyZW50VHVyblxyXG4gICAgICAgIC8vICAgICAgICk7XHJcbiAgICAgICAgLy8gICAgIH1cclxuICAgICAgICAvLyAgICAgLy8gY2hlY2sgaWYgZHVtbXkgYWN0b3JcclxuICAgICAgICAvLyAgICAgYWN0b3IucGxhbigpO1xyXG4gICAgICAgIC8vICAgICBpZiAoYWN0b3IuYWN0aW9uKSB7XHJcbiAgICAgICAgLy8gICAgICAgaWYgKGFjdG9yLnR5cGUgPT09IFRpbGVUeXBlLkVudGl0eSkge1xyXG4gICAgICAgIC8vICAgICAgICAgY29uc29sZS5sb2coXCJzZXQgZHVyYXRpb24gXCIgKyBhY3Rvci5hY3Rpb24uZHVyYXRpb25JblR1cm5zKTtcclxuICAgICAgICAvLyAgICAgICB9XHJcbiAgICAgICAgLy8gICAgICAgdGhpcy50aW1lTWFuYWdlci5zZXREdXJhdGlvbihhY3Rvci5hY3Rpb24uZHVyYXRpb25JblR1cm5zKTtcclxuICAgICAgICAvLyAgICAgICBhY3Rvci5hY3QoKTtcclxuICAgICAgICAvLyAgICAgfVxyXG4gICAgICAgIC8vICAgfSBlbHNlIHtcclxuICAgICAgICAvLyAgICAgLy8g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1hbmFnZXIudXBkYXRlRHluYW1pY0xpZ2h0aW5nKCk7XHJcbiAgICAvLyAgIHRoaXMubWFwLmxpZ2h0TWFuYWdlci5yZWNhbGN1bGF0ZUR5bmFtaWNMaWdodGluZygpO1xyXG4gICAgLy8gfVxyXG4gICAgcmVuZGVyTG9vcChpbnRlcnBQZXJjZW50KSB7XHJcbiAgICAgICAgLy8gY29uc29sZS5sb2coXCJub3dcIiwgbm93KTtcclxuICAgICAgICAvLyB0aGlzLnNjaGVkdWxlci5wb3N0VGFzayhcclxuICAgICAgICAvLyAgICgpID0+IHRoaXMudGltZU1hbmFnZXIucmVuZGVyVXBkYXRlKGRlbHRhVGltZSwgdGhpcy5nYW1lTG9vcERlbGF5KSxcclxuICAgICAgICAvLyAgIHtcclxuICAgICAgICAvLyAgICAgcHJpb3JpdHk6IFwidXNlci1ibG9ja2luZ1wiLFxyXG4gICAgICAgIC8vICAgfVxyXG4gICAgICAgIC8vICk7XHJcbiAgICAgICAgdGhpcy50aW1lTWFuYWdlci5yZW5kZXJVcGRhdGUodGhpcy5wb3N0VHVybldhaXRUaW1lKTtcclxuICAgICAgICAvLyBjb25zb2xlLmxvZyhcInJlbmRlcmluZ1wiKTtcclxuICAgICAgICAvLyB0aGlzLnNjaGVkdWxlci5wb3N0VGFzayhcclxuICAgICAgICAvLyAgICgpID0+IHRoaXMudXNlckludGVyZmFjZS5jYW1lcmEucmVuZGVyVXBkYXRlKGRlbHRhVGltZSksXHJcbiAgICAgICAgLy8gICB7XHJcbiAgICAgICAgLy8gICAgIHByaW9yaXR5OiBcInVzZXItYmxvY2tpbmdcIixcclxuICAgICAgICAvLyAgIH1cclxuICAgICAgICAvLyApO1xyXG4gICAgICAgIHRoaXMudXNlckludGVyZmFjZS5jYW1lcmEucmVuZGVyVXBkYXRlKGludGVycFBlcmNlbnQpO1xyXG4gICAgICAgIHRoaXMuc2NoZWR1bGVyLnBvc3RUYXNrKCgpID0+IHRoaXMubWFwLnNoYWRvd01hcC5yZW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rO1xyXG4gICAgICAgICAgICBjYXNlIEJpb21lcy5CaW9tZXMubW9pc3RkaXJ0LmlkOlxyXG4gICAgICAgICAgICAgICAgZW50aXR5ID0gbmV3IENvdyh0aGlzLCBwb3MpO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgQmlvbWVzLkJpb21lcy5vY2Vhbi5pZDpcclxuICAgICAgICAgICAgY2FzZSBCaW9tZXMuQmlvbWVzLm9jZWFuZGVlcC5pZDpcclxuICAgICAgICAgICAgICAgIGVudGl0eSA9IG5ldyBTaGFya0JsdWUodGhpcywgcG9zKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIEJpb21lcy5CaW9tZXMuaGlsbHNsb3cuaWQ6XHJcbiAgICAgICAgICAgICAgICBlbnRpdHkgPSBuZXcgTXVzaHJvb20odGhpcywgcG9zKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBkZWZhdWx0OlxyXG4gICAgICAgICAgICAgICAgZW50aXR5ID0gbmV3IE11c2hyb29tKHRoaXMsIHBvcyk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy5lbnRpdGllcy5wdXNoKGVudGl0eSk7XHJcbiAgICAgICAgdGhpcy50aW1lTWFuYWdlci5hZGRUb1NjaGVkdWxlKGVudGl0eSwgdHJ1ZSk7XHJcbiAgICAgICAgZW50aXR5LmRyYXcoKTtcclxuICAgICAgICByZXR1cm4gZW50aXR5O1xyXG4gICAgfVxyXG4gICAgc3Bhd25SYW5kb21FbnRpdHkocG9zKSB7XHJcbiAgICAgICAgbGV0IGVudGl0eTtcclxuICAgICAgICBjb25zdCByYW5kID0gUk5HLmdldFVuaWZvcm0oKTtcclxuICAgICAgICBpZiAocmFuZCA8IDAuMjUpIHtcclxuICAgICAgICAgICAgLy8gZW50aXR5ID0gbmV3IFBlcnNvbih0aGlzLCBwb3MpO1xyXG4gICAgICAgICAgICBlbnRpdHkgPSBuZXcgQ293KHRoaXMsIHBvcyk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKHJhbmQgPCAwLjUpIHtcclxuICAgICAgICAgICAgZW50aXR5ID0gbmV3IFNoYXJrQmx1ZSh0aGlzLCBwb3MpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgZW50aXR5ID0gbmV3IE11c2hyb29tKHRoaXMsIHBvcyk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRoaXMuZW50aXRpZXMucHVzaChlbnRpdHkpO1xyXG4gICAgICAgIHRoaXMudGltZU1hbmFnZXIuYWRkVG9TY2hlZHVsZShlbnRpdHksIHRydWUpO1xyXG4gICAgICAgIGVudGl0eS5kcmF3KCk7XHJcbiAgICAgICAgLy8gdGhpcy5yZW5kZXJlci5hZGRUb1NjZW5lKFxyXG4gICAgICAgIC8vICAgZW50aXR5LnBvc2l0aW9uLFxyXG4gICAgICAgIC8vICAgTGF5ZXIuRU5USVRZLFxyXG4gICAgICAgIC8vICAgZW50aXR5LnRpbGUuc3ByaXRlUGF0aCxcclxuICAgICAgICAvLyAgIG51bGwsXHJcbiAgICAgICAgLy8gICBlbnRpdHkudGlsZS5hbmltYXRlZFxyXG4gICAgICAgIC8vICk7XHJcbiAgICAgICAgcmV0dXJuIGVudGl0eTtcclxuICAgIH1cclxuICAgIC8vIGNoZWNrQm94KHg6IG51bWJlciwgeTogbnVtYmVyKTogdm9pZCB7XHJcbiAgICAvLyAgIHN3aXRjaCAodGhpcy5tYXAuZ2V0VGlsZVR5cGUoeCwgeSkpIHtcclxuICAgIC8vICAgICBjYXNlIFRpbGUuc2hydWIudHlwZTpcclxuICAgIC8vICAgICAgIHRoaXMubWFwLnNldFRpbGUoeCwgeSwgVGlsZS5jdXRUcmVlKTtcclxuICAgIC8vICAgICAgIHRoaXMudXNlckludGVyZmFjZS5zd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dGhpcy5nZXRBY3Rvck5hbWUoXHJcbiAgICAvLyAgICAgICAgICAgICBhY3RvclxyXG4gICAgLy8gICAgICAgICAgICl9IGRldHJveWVkIHRoZSBib3ggd2l0aCB0aGUgcGluZWFwcGxlLmBcclxuICAgIC8vICAgICAgICAgKTtcclxuICAgIC8vICAgICAgICAgdGhpcy5nYW1lU3RhdGUucGluZWFwcGxlV2FzRGVzdHJveWVkID0gdHJ1ZTtcclxuICAgIC8vICAgICAgIH0gZWxzZSB7XHJcbiAgICAvLyAgICAgICAgIHRoaXMudXNlckludGVyZmFjZS5tZXNzYWdlTG9nLmFwcGVuZFRleHQoXHJcbiAgICAvLyAgICAgICAgICAgYCR7dGhpcy5nZXRBY3Rvck5hbWUoYWN0b3IpfSBkZXRyb3llZCBhIGJveC5gXHJcbiAgICAvLyAgICAgICAgICk7XHJcbiAgICAvLyAgICAgICB9XHJcbiAgICAvLyAgICAgICBicmVhaztcclxuICAgIC8vICAgICBjYXNlIFRpbGVUeXBlLlRyZWVTdHVtcDpcclxuICAgIC8vICAgICAgIHRoaXMudXNlckludGVyZmFjZS5tZXNzYWdlTG9nLmFwcGVuZFRleHQoXHJcbiAgICAvLyAgICAgICAgIFwiVGhpcyBib3ggaXMgYWxyZWFkeSBkZXN0cm95ZWQuXCJcclxuICAgIC8vICAgICAgICk7XHJcbiAgICAvLyAgICAgICBicmVhaztcclxuICAgIC8vICAgICBkZWZhdWx0OlxyXG4gICAgLy8gICAgICAgdGhpcy51c2VySW50ZXJmYWNlLm1lc3NhZ2VMb2cuYXBwZW5kVGV4dChcIlRoZXJlIGlzIG5vIGJveCBoZXJlIVwiKTtcclxuICAgIC8vICAgICAgIGJyZWFrO1xyXG4gICAgLy8gICB9XHJcbiAgICAvLyB9XHJcbiAgICAvLyBjYXRjaFBsYXllcihhY3RvcjogQWN0b3IpOiB2b2lkIHtcclxuICAgIC8vICAgdGhpcy51c2VySW50ZXJmYWNlLm1lc3NhZ2VMb2cuYXBwZW5kVGV4d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3Ioe1xyXG4gICAgICAgICAgICB3b3JkczogdHJ1ZSxcclxuICAgICAgICB9KTtcclxuICAgICAgICB0aGlzLm5hbWVHZW5lcmF0b3JzW1RpbGVTdWJUeXBlLkh1bWFuXSA9IG5ldyBTdHJpbmdHZW5lcmF0b3Ioe1xyXG4gICAgICAgICAgICB3b3JkczogdHJ1ZSxcclxuICAgICAgICB9KTtcclxuICAgICAgICBjb25zdCBleGFtcGxlSHVtYW5OYW1lcyA9IFtcclxuICAgICAgICAgICAgXCJCcmFkeVwiLFxyXG4gICAgICAgICAgICBcIk1hcmlvXCIsXHJcbiAgICAgICAgICAgIFwiTHVpZ2lcIixcclxuICAgICAgICAgICAgXCJKZW5cIixcclxuICAgICAgICAgICAgXCJDYXNzaWVcIixcclxuICAgICAgICAgICAgXCJUeWxlclwiLFxyXG4gICAgICAgICAgICBcIkRhdmVcIixcclxuICAgICAgICAgICAgXCJKdWR5XCIsXHJcbiAgICAgICAgICAgIFwiSnVkZVwiLFxyXG4gICAgICAgICAgICBcIkp1YW5cIixcclxuICAgICAgICAgICAgXCJKZXJtYWluZVwiLFxyXG4gICAgICAgICAgICBcIkt5bGllXCIsXHJcbiAgICAgICAgICAgIFwiQWRhbVwiLFxyXG4gICAgICAgICAgICBcIlBhdHJpY2tcIixcclxuICAgICAgICAgICAgXCJNYXR0XCIsXHJcbiAgICAgICAgICAgIFwiQ2VsZXN0ZVwiLFxyXG4gICAgICAgICAgICBcIkFydGh1clwiLFxyXG4gICAgICAgICAgICBcIkppbW15XCIsXHJcbiAgICAgICAgICAgIFwiSmlsbFwiLFxyXG4gICAgICAgICAgICBcIkphaW5pZVwiLFxyXG4gICAgICAgICAgICBcIkJyb2RpZVwiLFxyXG4gICAgICAgICAgICBcIkd1YWRhbG91cGVcIixcclxuICAgICAgICAgICAgXCJKYXNtaW5lXCIsXHJcbiAgICAgICAgICAgIFwiSmFzcGVyXCIsXHJcbiAgICAgICAgICAgIFwiSmFyZWRcIixcclxuICAgICAgICAgICAgXCJKZXNzZVwiLFxyXG4gICAgICAgICAgICBcIkplbm55XCIsXHJcbiAgICAgICAgICAgIFwiSmlsbFwiLFxyXG4gICAgICAgICAgICBcIkppbGxpYW5cIixcclxuICAgICAgICAgICAgXCJBbXlcIixcclxuICAgICAgICAgICAgXCJCaWxsXCIsXHJcbiAgICAgICAgICAgIFwiWmFuZVwiLFxyXG4gICAgICAgICAgICBcIlphY2tcIixcclxuICAgICAgICAgICAgXCJaYWNoXCIsXHJcbiAgICAgICAgICAgIFwiWmFjaGFyeVwiLFxyXG4gICAgICAgICAgICBcIlphcmFcIixcclxuICAgICAgICAgICAgXCJaZWxkYVwiLFxyXG4gICAgICAgICAgICBcIlpvZVwiLFxyXG4gICAgICAgICAgICBcIkhvbWVyXCIsXHJcbiAgICAgICAgXTtcclxuICAgICAgICBjb25zdCBleGFtcGxlQW5pbWFsTmFtZXMgPSBbXHJcbiAgICAgICAgICAgIFwiU3BvdFwiLFxyXG4gICAgICAgICAgICBcIlJvdmVyXCIsXHJcbiAgICAgICAgICAgIFwiRmlkb1wiLFxyXG4gICAgICAgICAgICBcIlJleFwiLFxyXG4gICAgICAgICAgICBcIlJleHlcIixcclxuICAgICAgICAgICAgXCJSZXhpZVwiLFxyXG4gICAgICAgICAgICBcIkJpbWJvXCIsXHJcbiAgICAgICAgICAgIFwiRmlyb2xhaXNcIixcclxuICAgICAgICAgICAgXCJNYW5jaGFcIixcclxuICAgICAgICAgICAgXCJHYXRpdG9cIixcclxuICAgICAgICAgICAgXCJGaWRvXCIsXHJcbiAgICAgICAgICAgIFwiUm9jY29cIixcclxuICAgICAgICAgICAgXCJEb25hXCIsXHJcbiAgICAgICAgICAgIFwiRG9uYXRlbGxvXCIsXHJcbiAgICAgICAgICAgIFwiTXVzdGFjaGVcIixcclxuICAgICAgICAgICAgXCJGdXp6eVwiLFxyXG4gICAgICAgICAgICBcIkJpZ290ZVwiLFxyXG4gICAgICAgICAgICBcIkZsdWZmeVwiLFxyXG4gICAgICAgICAgICBcIkxhbnVkb1wiLFxyXG4gICAgICAgICAgICBcIlBhd3NcIixcclxuICAgICAgICAgICAgXCJQYXRhc1wiLFxyXG4gICAgICAgICAgICBcIlBhd3N5XCIsXHJcbiAgICAgICAgICAgIFwiUGF3c2llXCIsXHJcbiAgICAgICAgICAgIFwiUGFwcGFzXCIsXHJcbiAgICAgICAgICAgIFwiUGFwcGllXCIsXHJcbiAgICAgICAgICAgIFwiWmlwcHlcIixcclxuICAgICAgICAgICAgXCJTa2lwcHlcIixcclxuICAgICAgICAgICAgXCJTa2lwcGVyXCIsXHJcbiAgICAgICAgICAgIFwiU2tpcFwiLFxyXG4gICAgICAgICAgICBcIlNrdW5rXCIsXHJcbiAgICAgICAgICAgIFwiQm9vdHNcIixcclxuICAgICAgICAgICAgXCJCb290c3lcIixcclxuICAgICAgICAgICAgXCJCb290c2llXCIsXHJcbiAgICAgICAgICAgIFwiQmFubmFuYVwiLFxyXG4gICAgICAgIF07XHJcbiAgICAgICAgZXhhbXBsZUh1bWFuTmFtZXMuZm9yRWFjaCgobmFtZSkgPT4gdGhpcy5uYW1lR2VuZXJhdG9yc1tUaWxlU3ViVHlwZS5IdW1hbl0ub2JzZXJ2ZShuYW1lKSk7XHJcbiAgICAgICAgZXhhbXBsZUFuaW1hbE5hbWVzLmZvckVhY2goKG5hbWUpID0+IHRoaXMubmFtZUdlbmVyYXRvcnNbVGlsZVN1YlR5cGUuQW5pbWFsXS5vYnNlcnZlKG5hbWUpKTtcclxuICAgIH1cclxuICAgIGdlbmVyYXRlKHN1YlR5cGUpIHtcclxuICAgICAgICByZXR1cm4gdGhpcy5uYW1lR2VuZXJhdG9yc1tzdWJUeXBlXS5nZW5lcmF0ZSgpO1xyXG4gICAgfVxyXG59XHJcbiIsImV4cG9ydCBjbGFzcyBJbnB1dFV0aWxpdHkge1xyXG4gICAgc3RhdGljIHdhaXRGb3JJbnB1dChoYW5kbGVJbnB1dCkge1xyXG4gICAgICAgIHJldHVybiBuZXcgUHJ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zZTtcclxuICAgICAgICBpZiAoIWNhbGN1bGF0ZVRhcmdldCkge1xyXG4gICAgICAgICAgICBhbWJpZW50TGlnaHRUb1VwZGF0ZSA9IHRoaXMuYW1iaWVudExpZ2h0O1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoaXNEYXl0aW1lKSB7XHJcbiAgICAgICAgICAgIGlmIChwaGFzZSA9PT0gTGlnaHRQaGFzZS5yaXNpbmcpIHtcclxuICAgICAgICAgICAgICAgIGFtYmllbnRMaWdodFRvVXBkYXRlID0gQ29sb3IubGVycCh0aGlzLmxpZ2h0RGVmYXVsdHMuYW1iaWVudERheWxpZ2h0LCB0aGlzLmxpZ2h0RGVmYXVsdHMuc3VubGlnaHQsIHRoaXMuZ2FtZS50aW1lTWFuYWdlci5yZW1haW5pbmdQaGFzZVBlcmNlbnQpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2UgaWYgKHBoYXNlID09PSBMaWdodFBoYXNlLnBlYWspIHtcclxuICAgICAgICAgICAgICAgIGFtYmllbnRMaWdodFRvVXBkYXRlID0gdGhpcy5saWdodERlZmF1bHRzLnN1bmxpZ2h0O1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgYW1iaWVudExpZ2h0VG9VcGRhdGUgPSBtdWx0aUNvbG9yTGVycChbXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5saWdodERlZmF1bHRzLmFtYmllbnREYXlsaWdodCxcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmxpZ2h0RGVmYXVsdHMuYW1iaWVudFN1bnNldCxcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmxpZ2h0RGVmYXVsdHMuc3VubGlnaHQsXHJcbiAgICAgICAgICAgICAgICBdLCB0aGlzLmdhbWUudGltZU1hbmFnZXIucmVtYWluaW5nUGhhc2VQZXJjZW50KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgaWYgKHBoYXNlID09PSBMaWdodFBoYXNlLnJpc2luZykge1xyXG4gICAgICAgICAgICAgICAgYW1iaWVudExpZ2h0VG9VcGRhdGUgPSBtdWx0aUNvbG9yTGVycChbXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5saWdodERlZmF1bHRzLmFtYmllbnREYXlsaWdodCxcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmxpZ2h0RGVmYXVsdHMuYW1iaWVudE5pZ2h0TGlnaHQsXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5saWdodERlZmF1bHRzLm1vb25saWdodCxcclxuICAgICAgICAgICAgICAgIF0sIHRoaXMuZ2FtZS50aW1lTWFuYWdlci5yZW1haW5pbmdQaGFzZVBlcmNlbnQpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2UgaWYgKHBoYXNlID09PSBMaWdodFBoYXNlLnBlYWspIHtcclxuICAgICAgICAgICAgICAgIGFtYmllbnRMaWdodFRvVXBkYXRlID0gdGhpcy5saWdodERlZmF1bHRzLm1vb25saWdodDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIGFtYmllbnRMaWdodFRvVXBkYXRlID0gbXVsdGlDb2xvckxlcnAoW1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMubGlnaHREZWZhdWx0cy5hbWJpZW50RGF5bGlnaHQsXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5saWdodERlZmF1bHRzLmFtYmllbnROaWdodExpZ2h0LFxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMubGlnaHREZWZhdWx0cy5tb29ubGlnaHQsXHJcbiAgICAgICAgICAgICAgICBdLCB0aGlzLmdhbWUudGltZU1hbmFnZXIucmVtYWluaW5nUGhhc2VQZXJjZW50KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoIWNhbGN1bGF0ZVRhcmdldCkge1xyXG4gICAgICAgICAgICB0aGlzLmFtYmllbnRMaWdodCA9IGFtYmllbnRMaWdodFRvVXBkYXRlO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgdGhpcy50YXJnZXRBbWJpZW50TGlnaHQgPSBhbWJpZW50TGlnaHRUb1VwZGF0ZTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBsaWdodFBhc3Nlcyh4LCB5KSB7XHJcbiAgICAgICAgY29uc3QgdGlsZSA9IHRoaXMubWFwLmdldFRpbGUoeCwgeSk7XHJcbiAgICAgICAgaWYgKCF0aWxlKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKCF0aGlzLm1hcC5pc1Bhc3NhYmxlKHgsIHkpKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHRoaXMuZ2FtZS5pc09jY3VwaWVkQnlQbGFudCh4LCB5KSkge1xyXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgfVxyXG4gICAgY2xlYXJMaWdodE1hcCgpIHtcclxuICAgICAgICB0aGlzLmxpZ2h0TWFwID0ge307XHJcbiAgICB9XHJcbiAgICByZWZsZWN0aXZpdHkoeCwgeSkge1xyXG4gICAgICAgIGNvbnN0IGtleSA9IE1hcFdvcmxkLmNvb3Jkc1RvS2V5KHgsIHkpO1xyXG4gICAgICAgIGNvbnN0IGJpb21lID0gdGhpcy5tYXAuYmlvbWVNYXBba2V5XTtcclxuICAgICAgICBpZiAoIWJpb21lKSB7XHJcbiAgICAgICAgICAgIHJldHVybiAwO1xyXG4gICAgICAgIH1cclxuICAgICAgICBjb25zdCBpc0Jsb2NraW5nID0gYmlvbWUuaWQgPT0gXCJoaWxsc21pZFwiIHx8XHJcbiAgICAgICAgICAgIGJpb21lLmlkID09IFwiaGlsbHNsb3dcIiB8fFxyXG4gICAgICAgICAgICBiaW9tZS5pZCA9PSBcImhpbGxzaGlnaFwiIHx8XHJcbiAgICAgICAgICAgIGJpb21lLmlkID09IFwiZ3Jhc3NcIjtcclxuICAgICAgICBjb25zdCBpc1dhdGVyID0gYmlvbWUuaWQgPT0gXCJvY2VhblwiIHx8IGJpb21lLmlkID09IFwib2NlYW5kZWVwXCIgfHwgYmlvbWUuaWQgPT0gXCJzd2FtcFwiO1xyXG4gICAgICAgIGNvbnN0IGlzUmVmbGVjdGl2ZURpcnQgPSBiaW9tZS5pZCA9PSBcInNhbmR5ZGlydFwiIHx8IGJpb21lLmlkID09IFwiYmVhY2hcIjtcclxuICAgICAgICBjb25zdCBpc1NoYWRvd2VkID0gYmlvbWUuaWQgPT0gXCJncmFzc1wiIHx8IGJpb21lLmlkID09IFwidmFsbGV5XCI7XHJcbiAgICAgICAgaWYgKGlzQmxvY2tpbmcpIHtcclxuICAgICAgICAgICAgcmV0dXJuIDA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChpc1NoYWRvd2VkKSB7XHJcbiAgICAgICAgICAgIHJldHVybiAwLjEzO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoaXNSZWZsZWN0aXZlRGlydCkge1xyXG4gICAgICAgICAgICByZXR1cm4gMC4yODtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKGlzV2F0ZXIpIHtcclxuICAgICAgICAgICAgcmV0dXJuIDAuMzc7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiAwLjIyO1xyXG4gICAgfVxyXG4gICAgbGlnaHRpbmdDYWxsYmFjayh4LCB5LCBjb2xvcikge1xyXG4gICAgICAgIGlmICh0aGlzLmdhbWUudXNlckludGVyZmFjZS5jYW1lcmEuaW5WaWV3cG9ydCh4LCB5KSkge1xyXG4gICAgICAgICAg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AgICAgICBpZiAodGhpcy5saWdodEVtaXR0ZXJCeUlkW2VudGl0eS5pZF0pIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IFt4LCB5XSA9IHRoaXMubGlnaHRFbWl0dGVyQnlJZFtlbnRpdHkuaWRdO1xyXG4gICAgICAgICAgICAgICAgdGhpcy5saWdodEVtaXR0ZXJzLnNldExpZ2h0KHgsIHksIG51bGwpO1xyXG4gICAgICAgICAgICAgICAgdGhpcy5saWdodEVtaXR0ZXJCeUlkW2VudGl0eS5pZF0gPSBudWxsO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgY2xlYXJDaGFuZ2VkRHluYW1pY0xpZ2h0cygpIHtcclxuICAgICAgICBmb3IgKGxldCBlbnRpdHkgb2YgdGhpcy5nYW1lLmVudGl0aWVzKSB7XHJcbiAgICAgICAgICAgIGlmICh0aGlzLmxpZ2h0RW1pdHRlckJ5SWRbZW50aXR5LmlkXSkge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgW3gsIHldID0gdGhpcy5saWdodEVtaXR0ZXJCeUlkW2VudGl0eS5pZF07XHJcbiAgICAgICAgICAgICAgICBpZiAoZW50aXR5LnBvc2l0aW9uLnggIT0geCB8fCBlbnRpdHkucG9zaXRpb24ueSAhPSB5KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5saWdodEVtaXR0ZXJzLnNldExpZ2h0KHgsIHksIG51bGwpO1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMubGlnaHRFbWl0dGVyQnlJZFtlbnRpdHkuaWRdID0gbnVsbDtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIHVwZGF0ZUR5bmFtaWNMaWdodGluZygpIHtcclxuICAgICAgICBpZiAodGhpcy5nYW1lLnRpbWVNYW5hZ2VyLmlzTmlnaHR0aW1lKSB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IGVudGl0eSBvZiB0aGlzLmdhbWUuZW50aXRpZXMpIHtcclxuICAgICAgICAgICAgICAgIGxldCB1cGRhdGVMaWdodCA9IGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLmxpZ2h0RW1pdHRlckJ5SWRbZW50aXR5LmlkXSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUxpZ2h0ID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLmxpZ2h0RW1pdHRlckJ5SWRbZW50aXR5LmlkXSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IFt4LCB5XSA9IHRoaXMubGlnaHRFbWl0dGVyQnlJZFtlbnRpdHkuaWRdO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChlbnRpdHkucG9zaXRpb24ueCAhPSB4IHx8IGVudGl0eS5wb3NpdGlvbi55ICE9IHkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlTGlnaHQgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICh1cGRhdGVMaWdodCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMubGlnaHRFbWl0dGVyQnlJZFtlbnRpdHkuaWRdID0gW1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBlbnRpdHkucG9zaXRpb24ueCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZW50aXR5LnBvc2l0aW9uLnksXHJcbiAgICAgICAgICAgICAgICAgICAgXTtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmxpZ2h0RW1pdHRlcnMuc2V0TGlnaHQoZW50aXR5LnBvc2l0aW9uLngsIGVudGl0eS5wb3NpdGlvbi55LCB0aGlzLmxpZ2h0RGVmYXVsdHMudG9yY2hCcmlnaHQpO1xyXG4gICAgICAgICAgICAgICAgfVxy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XG4gICAgICAgICAgICAgICAgdGhpcy5hbmltYXRpb25zLnBvcCgpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgcnVuQW5pbWF0aW9uV2l0aEFyZ3MgPSAoKSA9PiB0aGlzLmJvdW5kUnVuQW5pbWF0aW9uKGFuaW0pO1xyXG4gICAgICAgICAgICAgICAgdGhpcy5nYW1lLnNjaGVkdWxlci5wb3N0VGFzayhydW5BbmltYXRpb25XaXRoQXJncywge1xyXG4gICAgICAgICAgICAgICAgICAgIHByaW9yaXR5OiBcInVzZXItdmlzaWJsZVwiLFxyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBydW5BbmltYXRpb24oYW5pbWF0aW9uKSB7XHJcbiAgICAgICAgaWYgKGFuaW1hdGlvbi5hY3Rpb24gPT09IFwibW92ZVwiKSB7XHJcbiAgICAgICAgICAgIHRoaXMuYW5pbWF0ZU1vdmUoYW5pbWF0aW9uKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBhZGRNb3ZlQW5pbWF0aW9uKHRpbGVLZXksIC8vIHRoZSB0aWxlIHBvc2l0aW9uIGluIHRoZSByZW5kZXJlcidzIGNhY2hlXHJcbiAgICBvbGRQb3MsIG5ld1BvcywgY2FsbGJhY2ssIGFjdG9yKSB7XHJcbiAgICAgICAgY29uc3QgYW5pbWF0aW9uID0ge1xyXG4gICAgICAgICAgICBpZDogZ2VuZXJhdGVJZCgpLFxyXG4gICAgICAgICAgICB0aWxlS2V5OiB0aWxlS2V5LFxyXG4gICAgICAgICAgICBvbGRQb3M6IG9sZFBvcyxcclxuICAgICAgICAgICAgbmV3UG9zOiBuZXdQb3MsXHJcbiAgICAgICAgICAgIGFjdGlvbjogXCJtb3ZlXCIsXHJcbiAgICAgICAgICAgIHR1cm5EdXJhdGlvbjogMSxcclxuICAgICAgICAgICAgZW5kVHVybjogdGhpcy5nYW1lLnRpbWVNYW5hZ2VyLmN1cnJlbnRUdXJuICsgMSxcclxuICAgICAgICAgICAgY2FsbGJhY2s6IGNhbGxiYWNrLFxyXG4gICAgICAgIH07XHJcbiAgICAgICAgaWYgKGFjdG9yKSB7XHJcbiAgICAgICAgICAgIGFuaW1hdGlvbi5hY3RvciA9IGFjdG9yO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLmFuaW1hdGlvbnMucHVzaChhbmltYXRpb24pO1xyXG4gICAgfVxyXG4gICAgYW5pbWF0ZU1vdmUoYW5pbWF0aW9uKSB7XHJcbiAgICAgICAgY29uc3QgbmV3UG9zID0gYW5pbWF0aW9uLm5ld1BvcztcclxuICAgICAgICBjb25zdCBvbGRQb3MgPSBhbmltYXRpb24ub2xkUG9zO1xyXG4gICAgICAgIGlmIChvbGRQb3MgJiYgbmV3UG9zKSB7XHJcbiAgICAgICAgICAgIGxldCBwZXJjZW50ID0gdGhpcy5nYW1lLnRpbWVNYW5hZ2VyLnR1cm5BbmltVGltZVBlcmNlbnQ7XHJcbiAgICAgICAgICAgIGxldCBhbmltRG9uZSA9IHBlcmNlbnQgPj0gMC45OTsgLy8gcmVkdWNlIGZvciBzbmFwcGllciBmZWVsXHJcbiAgICAgICAgICAgIGlmIChhbmltRG9uZSlcclxuICAgICAgICAgICAgICAgIHBlcmNlbnQgPSAxO1xyXG4gICAgICAgICAgICBsZXQgeCwgeTtcclxuICAgICAgICAgICAgaWYgKHRoaXMub3B0aW9ucy5sZXJwU3R5bGUgPT09IFwibGluZWFyXCIpIHtcclxuICAgICAgICAgICAgICAgIHggPSBsZXJwKHBlcmNlbnQsIG9sZFBvc1swXSwgbmV3UG9zWzBdKTtcclxuICAgICAgICAgICAgICAgIHkgPSBsZXJwKHBlcmNlbnQsIG9sZFBvc1sxXSwgbmV3UG9zWzFdKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmICh0aGlzLm9wdGlvbnMubGVycFN0eWxlID09PSBcImVhc2VJblwiKSB7XHJcbiAgICAgICAgICAgICAgICB4ID0gbGVycEVhc2VJbihwZXJjZW50LCBvbGRQb3NbMF0sIG5ld1Bvc1swXSk7XHJcbiAgICAgICAgICAgICAgICB5ID0gbGVycEVhc2VJbihwZXJjZW50LCBvbGRQb3NbMV0sIG5ld1Bvc1sxXSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAodGhpcy5vcHRpb25zLmxlcnBTdHlsZSA9PT0gXCJlYXNlT3V0XCIpIHtcclxuICAgICAgICAgICAgICAgIHggPSBsZXJwRWFzZU91dChwZXJjZW50LCBvbGRQb3NbMF0sIG5ld1Bvc1swXSk7XHJcbiAgICAgICAgICAgICAgICB5ID0gbGVycEVhc2VPdXQocGVyY2VudCwgb2xkUG9zWzFdLCBuZXdQb3NbMV0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2UgaWYgKHRoaXMub3B0aW9ucy5sZXJwU3R5bGUgPT09IFwiZWFzZUluT3V0XCIpIHtcclxuICAgICAgICAgICAgICAgIHggPSBsZXJwRWFzZUluT3V0KHBlcmNlbnQsIG9sZFBvc1swXSwgbmV3UG9zWzBdKTtcclxuICAgICAgICAgICAgICAgIHkgPSBsZXJwRWFzZUluT3V0KHBlcmNlbnQsIG9sZFBvc1sxXSwgbmV3UG9zWzFdKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB0aGlzLmdhbWUucmVuZGVyZXIubW92ZUNhY2hlZFNwcml0ZVRyYW5zZm9ybShhbmltYXRpb24udGlsZUtleSwgTGF5ZXIuRU5USVRZLCB4LCB5KTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuIiwiaW1wb3J0IHsgVGltZUNvbnRyb2wgfSBmcm9tIFwiLi93ZWItY29tcG9uZW50cy90aW1lLWNvbnRyb2xcIjtcclxuaW1wb3J0IHsgU2lkZU1lbnUgfSB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fSk7XHJcbiAgICAgICAgICAgIHRoaXMudGltZUNvbnRyb2wudGltZVNsaWRlci5hZGRFdmVudExpc3RlbmVyKFwic2wtaW5wdXRcIiwgKGUpID0+IHtcclxuICAgICAgICAgICAgICAgIHRoaXMuZ2FtZS50aW1lTWFuYWdlci5zZXRUaW1lc2NhbGUoZS50YXJnZXQudmFsdWUpO1xyXG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2coXCJ0aW1lIHNjYWxlOiBcIiwgdGhpcy5nYW1lLnRpbWVNYW5hZ2VyLnRpbWVTY2FsZSk7XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLnNpZGVNZW51ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcInNpZGUtbWVudVwiKTtcclxuICAgICAgICBpZiAodGhpcy5zaWRlTWVudSkge1xyXG4gICAgICAgICAgICB0aGlzLnNpZGVNZW51LmRyb3Bkb3duTWVudS5hZGRFdmVudExpc3RlbmVyKFwic2wtc2VsZWN0XCIsIChlKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhlLmRldGFpbCk7XHJcbiAgICAgICAgICAgICAgICB0aGlzLnNpZGVNZW51LnNldFNlbGVjdGVkVGFiKHRoaXMuc2lkZU1lbnUuZ2V0VGFiKGUuZGV0YWlsLml0ZW0uaWQpKTtcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIHRoaXMuc2lkZU1lbnUuaGFuZGxlLmFkZEV2ZW50TGlzdGVuZXIoXCJjbGlja1wiLCAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLnNpZGVNZW51LnNldENvbGxhcHNlZCghdGhpcy5zaWRlTWVudS5pc0NvbGxhcHNlZCk7XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLnRpbGVJbmZvID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcInRpbGUtaW5mb1w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RVSVZpc2libGUodHJ1ZSwgdHJ1ZSk7XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodGhpcy50aW1lQ29udHJvbCkge1xyXG4gICAgICAgICAgICB0aGlzLnV0aWxpdHlBY3Rpb25zID0gdGhpcy50aW1lQ29udHJvbC51dGlsaXR5QWN0aW9ucztcclxuICAgICAgICAgICAgdGhpcy5zZXRVdGlsaXR5QWN0aW9uc09wdGlvbnMoKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICB1cGRhdGVUaW1lQ29udHJvbCgpIHtcclxuICAgICAgICBpZiAodGhpcy50aW1lQ29udHJvbCkge1xyXG4gICAgICAgICAgICB0aGlzLnRpbWVDb250cm9sLnVwZGF0ZVRpbWUodGhpcy5nYW1lLnRpbWVNYW5hZ2VyLmdldEN1cnJlbnRUaW1lRm9yRGlzcGxheSgpKTtcclxuICAgICAgICAgICAgdGhpcy50aW1lQ29udHJvbC51cGRhdGVQYXVzZUJ0bih0aGlzLmdhbWUudGltZU1hbmFnZXIuaXNQYXVzZWQpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIHJlbmRlclVwZGF0ZSgpIHtcclxuICAgICAgICBpZiAodGhpcy50aWxlU2VsZWN0aW9uSW5kaWNhdG9yKSB7XHJcbiAgICAgICAgICAgIHRoaXMudGlsZVNlbGVjdGlvbkluZGljYXRvci5yZW5kZXJVcGRhdGUoKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICB1cGRhdGVTaWRlQmFyQ29udGVudCh0YWJOYW1lLCBjb250ZW50KSB7XHJcbiAgICAgICAgaWYgKHRhYk5hbWUgPT09IFwiRW50aXRpZXNcIikge1xyXG4gICAgICAgICAgICBjb25zdCBlbnRpdHlNZW51SXRlbXMgPSBjb250ZW50Lm1hcCgoZW50aXR5KSA9PiB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5tYXBFbnRpdHlUb01lbnVJdGVtKGV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lbnRpdHkuaWR9YCk7XHJcbiAgICAgICAgICAgICAgICB0aGlzLnVpLmNhbWVyYS5zZXRQb2ludGVyVGFyZ2V0KGVudGl0eS5wb3NpdGlvbiwgZW50aXR5LCB0cnVlKTtcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgbGFiZWw6IGVudGl0eS5uYW1lLFxyXG4gICAgICAgICAgICB0b29sdGlwOiBgRW50aXR5OiAke2VudGl0eS5pZH1gLFxyXG4gICAgICAgIH07XHJcbiAgICB9XHJcbiAgICBzZXRVdGlsaXR5QWN0aW9uc09wdGlvbnMoKSB7XHJcbiAgICAgICAgdGhpcy51dGlsaXR5QWN0aW9ucy5zZXRPcHRpb25zKFtcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgbGFiZWw6IFwiT3ZlcmxheXNcIixcclxuICAgICAgICAgICAgICAgIGljb246IE92ZXJsYXlJY29uLFxyXG4gICAgICAgICAgICAgICAgaGFuZGxlcjogKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKFwib3ZlcmxheXMgc2VsZWN0ZWRcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRVSVZpc2libGUoZmFsc2UsIHRydWUpO1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIHRoaXMuZ2FtZS50aW1lTWFuYWdlci5zZXRJc1BhdXNlZCh0cnVlKTtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLm92ZXJsYXkuc2V0VmlzaWJsZSh0cnVlKTtcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIGxhYmVsOiBcIkdyaWQgSW5kaWNhdG9yXCIsXHJcbiAgICAgICAgICAgICAgICBpY29uOiBPdmVybGF5SWNvbixcclxuICAgICAgICAgICAgICAgIGhhbmRsZXI6ICgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zb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AgIGNhc2UgQmlvbWVzLkJpb21lcy5vY2VhbmRlZXAuaWQ6XHJcbiAgICAgICAgICAgICAgICBjbG91ZFNpemUgPSAyO1xyXG4gICAgICAgICAgICAgICAgY2xvdWRJbnRlbnNpdHkgPSAwLjQ0O1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgQmlvbWVzLkJpb21lcy5vY2Vhbi5pZDpcclxuICAgICAgICAgICAgICAgIGNsb3VkU2l6ZSA9IDQuNTtcclxuICAgICAgICAgICAgICAgIGNsb3VkSW50ZW5zaXR5ID0gMC40MjtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIEJpb21lcy5CaW9tZXMuaGlsbHNoaWdoLmlkOlxyXG4gICAgICAgICAgICBjYXNlIEJpb21lcy5CaW9tZXMuaGlsbHNtaWQuaWQ6XHJcbiAgICAgICAgICAgICAgICBjbG91ZFNpemUgPSAxOTtcclxuICAgICAgICAgICAgICAgIGNsb3VkSW50ZW5zaXR5ID0gMC4zNztcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIEJpb21lcy5CaW9tZXMuaGlsbHNsb3cuaWQ6XHJcbiAgICAgICAgICAgICAgICBjbG91ZFNpemUgPSAxNTtcclxuICAgICAgICAgICAgICAgIGNsb3VkSW50ZW5zaXR5ID0gMC4zMztcclxuICAgICAgICAgICAgY2FzZSBCaW9tZXMuQmlvbWVzLnN3YW1wLmlkOlxyXG4gICAgICAgICAgICAgICAgY2xvdWRJbnRlbnNpdHkgPSAwLjM0O1xyXG4gICAgICAgICAgICBkZWZhdWx0OlxyXG4gICAgICAgICAgICAgICAgY2xvdWRTaXplID0gMTI7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICB9XHJcbiAgICAgICAgLy8gYmFzaWMgYmlnIHNtb290aCBzb2Z0IGNsb3VkcyBhbmQgc3VuYmVhbXNcclxuICAgICAgIC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HRoaXMudGFyZ2V0T2NjbHVzaW9uTWFwW2tleV07XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IGtleSBpbiB0aGlzLm9jY2x1c2lvbk1hcCkge1xyXG4gICAgICAgICAgICAgICAgbWFwVG9VcGRhdGVba2V5XSA9IHRoaXMub2NjbHVzaW9uTWFwW2tleV07XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZm9yIChsZXQgeCA9IDA7IHggPCB0aGlzLmdhbWUub3B0aW9ucy5nYW1lU2l6ZS53aWR0aDsgeCsrKSB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IHkgPSAwOyB5IDwgdGhpcy5nYW1lLm9wdGlvbnMuZ2FtZVNpemUuaGVpZ2h0OyB5KyspIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGtleSA9IE1hcFdvcmxkLmNvb3Jkc1RvS2V5KHgsIHkpO1xyXG4gICAgICAgICAgICAgICAgbWFwVG9VcGRhdGVba2V5XSA9IHRoaXMuZ2V0U2hhZG93Rm9yKHgsIHksIFwidG9wZG93blwiKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoIWNhbGN1bGF0ZVRhcmdldCkge1xyXG4gICAgICAgICAgICBmb3IgKGxldCBrZXkgaW4gdGhpcy5vY2NsdXNpb25NYXApIHtcclxuICAgICAgICAgICAgICAgIHRoaXMub2NjbHVzaW9uTWFwW2tleV0gPSBtYXBUb1VwZGF0ZVtrZXldO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBmb3IgKGxldCBrZXkgaW4gdGhpcy50YXJnZXRPY2NsdXNpb25NYXApIHtcclxuICAgICAgICAgICAgICAgIHRoaXMudGFyZ2V0T2NjbHVzaW9uTWFwW2tleV0gPSBtYXBUb1VwZGF0ZVtrZXldO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgdXBkYXRlU2hhZG93TWFwKGNhbGN1bGF0ZVRhcmdldCA9IHRydWUsIGRpcikge1xyXG4gICAgICAgIGxldCBtYXBUb1VwZGF0ZSA9IHt9O1xyXG4gICAgICAgIGlmIChjYWxjdWxhdGVUYXJnZXQpIHtcclxuICAgICAgICAgICAgbWFwVG9VcGRhdGUgPSB0aGlzLnRhcmdldFNoYWRvd01hcDtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIG1hcFRvVXBkYXRlID0gdGhpcy5zaGFkb3dNYXA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNvbnN0IG9mZnNldE1hcCA9IGRpciA9PT0gXCJzdW51cFwiID8gdGhpcy5zdW51cE9mZnNldE1hcCA6IHRoaXMuc3VuZG93bk9mZnNldE1hcDtcclxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG9mZnNldE1hcC5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IG9mZnNldE1hcFtpXS5sZW5ndGg7IGorKykge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgY29vcmRzID0gb2Zmc2V0TWFwW2ldW2pdO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgeCA9IGNvb3Jkc1swXTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHkgPSBjb29yZHNbMV07XHJcbiAgICAgICAgICAgICAgICBtYXBUb1VwZGF0ZVtNYXBXb3JsZC5jb29yZHNUb0tleSh4LCB5KV0gPSB0aGlzLmdldFNoYWRvd0Zvcih4LCB5LCBkaXIpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgdHVyblVwZGF0ZSgpIHtcclxuICAgICAgICAvLyBzaGFkb3cgc3RyZW5ndGggb25seSBjaGFuZ2VzI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ggKiB2ZWN0b3IueCArIHBvaW50QS55ICogdmVjdG9yLnk7XHJcbiAgICAvLyAgICAgY29uc3Qgc2NhbGFyQiA9IHBvaW50Qi54ICogdmVjdG9yLnggKyBwb2ludEIueSAqIHZlY3Rvci55O1xyXG4gICAgLy8gICAgIHJldHVybiBzY2FsYXJBIC0gc2NhbGFyQjtcclxuICAgIC8vICAgfSk7XHJcbiAgICAvLyAgIHJldHVybiBzb3J0ZWQ7XHJcbiAgICAvLyB9XHJcbiAgICBjYWxjU3VuZG93bk1hcCgpIHtcclxuICAgICAgICBjb25zdCByb3dzID0gdGhpcy5nYW1lLm9wdGlvbnMuZ2FtZVNpemUuaGVpZ2h0O1xyXG4gICAgICAgIGNvbnN0IGNvbHVtbnMgPSB0aGlzLmdhbWUub3B0aW9ucy5nYW1lU2l6ZS53aWR0aDtcclxuICAgICAgICBjb25zdCB0b3RhbCA9IGNvbHVtbnMgKyByb3dzIC0gMTtcclxuICAgICAgICBjb25zdCByZXN1bHQgPSBbXTtcclxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHJvd3M7IGkrKykge1xyXG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGNvbHVtbnM7IGorKykge1xyXG4gICAgICAgICAgICAgICAgY29uc3Qga2V5ID0gTWFwV29ybGQuY29vcmRzVG9LZXkoaiwgaSk7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBlbCA9IFtqLCBpXTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHBvcyA9IGogKyByb3dzIC0gaSAtIDE7XHJcbiAgICAgICAgICAgICAgICBpZiAoIXJlc3VsdFtwb3NdKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0W3Bvc10gPSBbXTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHJlc3VsdFtwb3NdLnVuc2hpZnQoZWwpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiByZXN1bHQ7XHJcbiAgICB9XHJcbiAgICBjYWxjU3VudXBNYXAoKSB7XHJcbiAgICAgICAgY29uc3Qgcm93cyA9IHRoaXMuZ2FtZS5vcHRpb25zLmdhbWVTaXplLmhlaWdodDtcclxuICAgICAgICBjb25zdCBjb2x1bW5zID0gdGhpcy5nYW1lLm9wdGlvbnMuZ2FtZVNpemUud2lkdGg7XHJcbiAgICAgICAgY29uc3QgdG90YWwgPSBjb2x1bW5zICsgcm93cyAtIDE7XHJcbiAgICAgICAgY29uc3QgcmVzdWx0ID0gW107XHJcbiAgICAgICAgZm9yIChsZXQgaSA9IHJvd3M7IGkgPj0gMDsgaS0tKSB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgY29sdW1uczsgaisrKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBrZXkgPSBNYXBXb3JsZC5jb29yZHNUb0tleShpLCBqKTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGVsID0gW2ksIGpdO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgcG9zID0gaSArIGo7XHJcbiAgICAgICAgICAgICAgICBpZiAoIXJlc3VsdFtwb3NdKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0W3Bvc10gPSBbXTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHJlc3VsdFtwb3NdLnVuc2hpZnQoZWwpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiByZXN1bHQ7XHJcbiAgICB9XHJcbiAgICBnZXRIZWlnaHREcm9wb2ZmKGN1cnJlbnRIZWlnaHQsIHByZXZpb3VzSGVpZ2h0KSB7XHJcbiAgICAgICAgbGV0IGRyb3BvZmYgPSBIZWlnaHREcm9wb2ZmW3ByZXZpb3VzSGVpZ2h0XSAtIEhlaWdodERyb3BvZmZbY3VycmVudEhlaWdodF07XHJcbiAgICAgICAgaWYgKGRyb3BvZmYgP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mYoeCwgeSwgcm93LCBpbmRleCwgY29vcmRNYXAsIG1hcEtleSkge1xyXG4gICAgICAgIGNvbnN0IGtleSA9IE1hcFdvcmxkLmNvb3Jkc1RvS2V5KHgsIHkpO1xyXG4gICAgICAgIGNvbnN0IGhlaWdodExldmVsID0gdGhpcy5tYXAuaGVpZ2h0TGF5ZXJNYXBba2V5XTtcclxuICAgICAgICBsZXQgbGFzdFJvdztcclxuICAgICAgICBsZXQgbGFzdEhlaWdodExldmVsO1xyXG4gICAgICAgIGxldCBkcm9wb2ZmID0gMDtcclxuICAgICAgICBmb3IgKGxldCBpID0gdGhpcy5taW5TaGFkb3dMZW5ndGg7IGkgPCB0aGlzLm1heFNoYWRvd0xlbmd0aCArIDE7IGkrKykge1xyXG4gICAgICAgICAgICBsYXN0Um93ID0gY29vcmRNYXBbcm93IC0gaV07XHJcbiAgICAgICAgICAgIGNvbnN0IGxhc3RJbmRleCA9IGluZGV4IC0gaTtcclxuICAgICAgICAgICAgbGFzdEhlaWdodExldmVsID0gbGFzdFJvd1xyXG4gICAgICAgICAgICAgICAgPyB0aGlzLm1hcC5oZWlnaHRMYXllck1hcFtsYXN0Um93W2xhc3RJbmRleF1dXHJcbiAgICAgICAgICAgICAgICA6IGhlaWdodExldmVsO1xyXG4gICAgICAgICAgICBkcm9wb2ZmID0gdGhpcy5nZXRIZWlnaHREcm9wb2ZmKGhlaWdodExldmVsLCBsYXN0SGVpZ2h0TGV2ZWwpO1xyXG4gICAgICAgICAgICBpZiAodGhpcy5kcm9wb2ZmTWFwc1ttYXBLZXldW2ldID09PSB1bmRlZmluZWQpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMuZHJvcG9mZk1hcHNbbWFwS2V5XVtpXSA9IHt9O1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHRoaXMuZHJvcG9mZk1hcHNbbWFwS2V5XVtpXVtrZXldID0gZHJvcG9mZjtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIGRyb3BvZmY7XHJcbiAgICB9XHJcbiAgICBjYWxjVG9wRG93bkRyb3BvZmYoeCwgeSwgYWRqYWNlbnQpIHtcclxuICAgICAgICBjb25zdCBrZXkgPSBNYXBXb3JsZC5jb29yZHNUb0tleSh4LCB5KTtcclxuICAgICAgICBjb25zdCBoZWlnaHRMZXZlbCA9IHRoaXMubWFwLmhlaWdodExheWVyTWFwW2tleV07XHJcbiAgICAgICAgbGV0IGRyb3BvZmYgPSAwO1xyXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYWRqYWNlbnQubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgY29uc3QgYWRqYWNlbnRIZWlnaHRMYXllciA9IGFkamFjZW50W2ldO1xyXG4gICAgICAgICAgICBjb25zdCBjdXJyZW50RHJvcG9mZiA9IHRoaXMuZ2V0T2NjbHVzaW9uSGVpZ2h0RHJvcG9mZihoZWlnaHRMZXZlbCwgYWRqYWNlbnRIZWlnaHRMYXllcik7XHJcbiAgICAgICAgICAgIGlmIChjdXJyZW50RHJvcG9mZiA+IDApIHtcclxuICAgICAgICAgICAgICAgIGlmIChkcm9wb2ZmID09PSAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZHJvcG9mZiA9IGN1cnJlbnREcm9wb2ZmO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZHJvcG9mZiAqPSBjdXJyZW50RHJvcG9mZjtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBkcm9wb2ZmID0gTWF0aC5yb3VuZChkcm9wb2ZmICogMTAwMCkgLyAxMDAwO1xyXG4gICAgICAgIHRoaXMuZHJvcG9mZk1hcHNbXCJ0b3Bkb3duXCJdWzFdW2tleV0gPSBkcm9wb2ZmO1xyXG4gICAgICAgIHJldHVybiBkcm9wb2ZmO1xyXG4gICAgfVxyXG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XJhdGVBZGphY2VuY3lNYXAoXCJoZWlnaHRcIik7XHJcbiAgICAgICAgdGhpcy5yZWdlbmVyYXRlQWRqYWNlbmN5TWFwKFwiaGVpZ2h0TGF5ZXJcIik7XHJcbiAgICAgICAgdGhpcy5yZWdlbmVyYXRlQWRqYWNlbmN5TWFwKFwidGVycmFpblwiKTtcclxuICAgICAgICAvLyBzZWNvbmQgcGFzcywgcHJvY2VzcyB0ZXJyYWluIGZyb20gZmlyc3QgcGFzcyB0byBzbW9vdGggb3V0IGlzc3Vlc1xyXG4gICAgICAgIGZvciAobGV0IHggPSAwOyB4IDwgd2lkdGg7IHgrKykge1xyXG4gICAgICAgICAgICBmb3IgKGxldCB5ID0gMDsgeSA8IGhlaWdodDsgeSsrKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBrZXkgPSBNYXBXb3JsZC5jb29yZHNUb0tleSh4LCB5KTtcclxuICAgICAgICAgICAgICAgIHRoaXMudGVycmFpbk1hcFtrZXldID0gdGhpcy5wcm9jZXNzVGVycmFpbih4LCB5KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBmb3IgKGxldCB4ID0gMDsgeCA8IHdpZHRoOyB4KyspIHtcclxuICAgICAgICAgICAgZm9yIChsZXQgeSA9IDA7IHkgPCBoZWlnaHQ7IHkrKykge1xyXG4gICAgICAgICAgICAgICAgY29uc3Qga2V5ID0gTWFwV29ybGQuY29vcmRzVG9LZXkoeCwgeSk7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmhlaWdodExheWVyTWFwW2tleV0gPSB0aGlzLmdldEhlaWdodExheWVyKHgsIHkpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIC8vIHVwZGF0ZSBhZGphY2VuY3kgbWFwcyBhZ2FpblxyXG4gICAgICAgIHRoaXMucmVnZW5lcmF0ZUFkamFjZW5jeU1hcChcInRlcnJhaW5cIik7XHJcbiAgICAgICAgLy8gdGhpcmQgcG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6IDAuNTUsXHJcbiAgICAgICAgICAgICAgICBpc05lZ2F0aXZlOiB0cnVlLFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbDogXCJ1bmRlcjMyXCIsXHJcbiAgICAgICAgICAgICAgICB0aHJlc2hvbGQ6IDAuMzIsXHJcbiAgICAgICAgICAgICAgICBpc05lZ2F0aXZlOiB0cnVlLFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbDogXCJ1bmRlcjE1XCIsXHJcbiAgICAgICAgICAgICAgICB0aHJlc2hvbGQ6IDAuMTUsXHJcbiAgICAgICAgICAgICAgICBpc05lZ2F0aXZlOiB0cnVlLFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbDogXCJ1bmRlcjBcIixcclxuICAgICAgICAgICAgICAgIHRocmVzaG9sZDogMCxcclxuICAgICAgICAgICAgICAgIGlzTmVnYXRpdmU6IHRydWUsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgXSk7XHJcbiAgICAgICAgY29uc29sZS5sb2coXCJ0ZW1wIG1hcFwiLCBzdGF0cywgdGhpcy50ZW1wTWFwLnRlbXBNYXApO1xyXG4gICAgICAgIC8vIGFzc2lnbiBiaW9tZSBtYXAgdXNpbmcgY2xpbWF0ZSBtYXBzXHJcbiAgICAgICAgZm9yIChsZXQgeCA9IDA7IHggPCB3aWR0aDsgeCsrKSB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IHkgPSAwOyB5IDwgaGVpZ2h0OyB5KyspIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGtleSA9IE1hcFdvcmxkLmNvb3Jkc1RvS2V5KHgsIHkpO1xyXG4gICAgICAgICAgICAgICAgdGhpcy5iaW9tZU1hcFtrZXldID0gdGhpcy5hc3NpZ25CaW9tZSh4LCB5KTtcclx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tZUFkamFjZW5jeUQxTWFwLCBbXHJcbiAgICAgICAgICAgICAgICBCaW9tZXMuQmlvbWVzLm1vaXN0ZGlydCxcclxuICAgICAgICAgICAgICAgIEJpb21lcy5CaW9tZXMudmFsbGV5LFxyXG4gICAgICAgICAgICBdKSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIEJpb21lcy5CaW9tZXMudmFsbGV5O1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChpc0xvd2VySGVpZ2h0KSB7XHJcbiAgICAgICAgICAgIHRoaXMuc2hpZnRIZWlnaHQoeCwgeSwgYmlvbWUpO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gYmlvbWU7XHJcbiAgICB9XHJcbiAgICAvLyBwcml2YXRlIHJlZ2VuZXJhdGVBZGphY2VuY3lNYXAobWFwOiBcInRlcnJhaW5cIiB8IFwiYmlvbWVcIikge1xyXG4gICAgLy8gICBmb3IgKGxldCB4ID0gMDsgeCA8IHRoaXMuZ2FtZS5vcHRpb25zLmdhbWVTaXplLndpZHRoOyB4KyspIHtcclxuICAgIC8vICAgICBmb3IgKGxldCB5ID0gMDsgeSA8IHRoaXMuZ2FtZS5vcHRpb25zLmdhbWVTaXplLmhlaWdodDsgeSsrKSB7XHJcbiAgICAvLyAgICAgICBjb25zdCBrZXkgPSBNYXBXb3JsZC5jb29yZHNUb0tleSh4LCB5KTtcclxuICAgIC8vICAgICAgIGlmIChtYXAgPT09IFwidGVycmFpblwiKSB7XHJcbiAgICAvLyAgICAgICAgIHRoaXMudGVycmFpbkFkamFjZW5jeUQxTWFwW2tleV0gPSB0aGlzLmFzc2lnbkFkamFjZW50QmlvbWVzKFxyXG4gICAgLy8gICAgICAgICAgIHgsXHJcbiAgICAvLyAgICAgICAgICAgeSxcclxuICAgIC8vICAgICAgICAgICB0aGlzLnRlcnJhaW5NYXAsXHJcbiAgICAvLyAgICAgICAgICAgMVxyXG4gICAgLy8gICAgICAgICApO1xyXG4gICAgLy8gICAgICAgICB0aGlzLnRlcnJhaW5BZGphY2VuY3lEMk1hcFtrZXldID0gdGhpcy5hc3NpZ25BZGphY2VudEJpb21lcyhcclxuICAgIC8vICAgICAgICAgICB4LFxyXG4gICAgLy8gICAgICAgICAgIHksXHJcbiAgICAvLyAgICAgICAgICAgdGhpcy50ZXJyYWluTWFwLFxyXG4gICAgLy8gICAgICAgICAgIDJcclxuICAgIC8vICAgICAgICAgKTtcclxuICAgIC8vICAgICAgIH0gZWxzZSBpZiAobWFwID09PSBcImJpb21lXCIpIHtcclxuICAgIC8vICAgICAgICAgdGhpcy5iaW9tZUFkamFjZW5jeUQxTWFwW2tleV0gPSB0aGlzLmFzc2lnbkFkamFjZW50QmlvbWVzKFxyXG4gICAgLy8gICAgICAgICAgIHgsXHJcbiAgICAvLyAgICAgICAgICAgeSxcclxuICAgIC8vICAgICAgICAgICB0aGlzLmJpb21lTWFwLFxyXG4gICAgLy8gICAgICAgICAgIDFcclxuICAgIC8vICAgICAgICAgKTtcclxuICAgIC8vICAgICAgICAgdGhpcy5iaW9tZUFkamFjZW5jeUQyTWFwW2tleV0gPSB0aGlzLmFzc2lnbkFkamFjZW50QmlvbWVzKFxyXG4gICAgLy8gICAgICAgICAgIHgsXHJcbiAgICAvLyAgICAgICAgICAgeSxcclxuICAgIC8vICAgICAgICAgICB0aGlzLmJpb21lTWFwLFxyXG4gICAgLy8gICAgICAgICAgIDJcclxuICAgIC8vICAgICAgICAgKTtcclxuICAgIC8vICAgICAgIH1cclxuICAgIC8vICAgICB9XHJcbiAgICAvLyAgIH1cclxuICAgIC8vIH1cclxuICAgIHJlZ2VuZXJhdGVBZGphY2VuY3lNYXAobWFwKSB7XHJcbiAgICAgICAgZm9yIChsZXQgeCA9IDA7IHggPCB0aGlzLmdhbWUub3B0aW9ucy5nYW1lU2l6ZS53aWR0aDsgeCsrKSB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IHkgPSAwOyB5IDwgdGhpcy5nYW1lLm9wdGlvbnMuZ2FtZVNpemUuaGVpZ2h0OyB5KyspIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGtleSA9IE1hcFdvcmxkLmNvb3Jkc1RvS2V5KHgsIHkpO1xyXG4gICAgICAgICAgICAgICAgaWYgKG1hcCA9PT0gXCJ0ZXJyYWluXCIpIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnRlcnJhaW5BZGphY2VuY3lEMU1hcFtrZXldID0gdGhpcy5hc3NpZ25BZGphY2VudEJpb21lcyh4LCB5LCB0aGlzLnRlcnJhaW5NYXAsIDEpO1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMudGVycmFpbkFkamFjZW5jeUQyTWFwW2tleV0gPSB0aGlzLmFzc2lnbkFkamFjZW50QmlvbWVzKHgsIHksIHRoaXMudGVycmFpbk1hcCwgMik7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChtYXAgPT09IFwiYmlvbWVcIikge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYmlvbWVBZGphY2VuY3lEMU1hcFtrZXldID0gdGhpcy5hc3NpZ25BZGphY2VudEJpb21lcyh4LCB5LCB0aGlzLmJpb21lTWFwLCAyKTtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmJpb21lQWRqYWNlbmN5RDJNYXBba2V5XSA9IHRoaXMuYXNzaWduQWRqYWNlbnRCaW9tZXMoeCwgeSwgdGhpcy5iaW9tZU1hcCwgMik7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChtYXAgPT09IFwiaGVpZ2h0XCIpIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmhlaWdodEFkamFjZW5jeUQxTWFwW2tleV0gPSB0aGlzLmFzc2lnbkFkamFjZW50SGVpZ2h0cyh4LCB5LCB0aGlzLmhlaWdodE1hcCwgMSk7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5oZWlnaHRBZGphY2VuY3lEMk1hcFtrZXldID0gdGhpcy5hc3NpZ25BZGphY2VudEhlaWdodHMoeCwgeSwgdGhpcy5oZWlnaHRNYXAsIDIpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAobWFwID09PSBcImhlaWdodExheWVyXCIpIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmhlaWdodExheWVyQWRqYWNlbmN5RDFNYXBba2V5XSA9IHRoaXMuYXNzaWduQWRqYWNlbnRIZWlnaHRMYXllcnMoeCwgeSwgdGhpcy5oZWlnaHRMYXllck1hcCwgMSk7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5oZWlnaHRMYXllckFkamFjZW5jeUQyTWFwW2tleV0gPSB0aGlzLmFzc2lnbkFkamFjZW50SGVpZ2h0TGF5ZXJzKHgsIHksIHRoaXMuaGVpZ2h0TGF5ZXJNYXAsIDIpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgYXNzaWduQWRqYWNlbnRCaW9tZXMoeCwgeSwgbWFwLCBkaXN0YW5jZSA9IDEpIHtcclxuICAgICAgICBjb25zdCBrZXkgPSBNYXBXb3JsZC5jb29yZHNUb0tleSh4LCB5KTtcclxuICAgICAgICBjb25zdCBoZWlnaHRWYWwgPSB0aGlzLmhlaWdodE1hcFtrZXldO1xyXG4gICAgICAgIGNvbnN0IHRlcnJhaW4gPSB0aGlzLnRlcnJhaW5NYXBba2V5XTtcclxuICAgICAgICBjb25zdCBhZGphY2VudEJpb21lcyA9IFtdO1xyXG4gICAgICAgIGxldCBwb3M7XHJcbiAgICAgICAgbGV0IGJpb21lO1xyXG4gICAgICAgIGZvciAobGV0IHhPZmZzZXQgPSAtZGlzdGFuY2U7IHhPZmZzZXQgPD0gZGlzdGFuY2U7IHhPZmZzZXQrKykge1xyXG4gICAgICAgICAgICBmb3IgKGxldCB5T2Zmc2V0ID0gLWRpc3RhbmNlOyB5T2Zmc2V0IDw9IGRpc3RhbmNlOyB5T2Zmc2V0KyspIHtcclxuICAgICAgICAgICAgICAgIGlmICh4T2Zmc2V0ID09PSAwICYmIHlPZmZzZXQgPT09IDApIHtcclxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHBvcyA9IG5ldyBQb2ludCh4ICsgeE9mZnNldCwgeSArIHlPZmZzZXQpO1xyXG4gICAgICAgICAgICAgICAgYmlvbWUgPSBtYXBbTWFwV29ybGQuY29vcmRzVG9LZXkocG9zLngsIHBvcy55KV07XHJcbiAgICAgICAgICAgICAgICBhZGphY2VudEJpb21lcy5wdXNoKGJpb21lKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gYWRqYWNlbnRCaW9tZXM7XHJcbiAgICB9XHJcbiAgICBhc3NpZ25BZGphY2VudEhlaWdodHMoeCwgeSwgbWFwLCBkaXN0YW5jZSA9IDEpIHtcclxuICAgICAgICBjb25zdCBrZXkgPSBNYXBXb3JsZC5jb29yZHNUb0tleSh4LCB5KTtcclxuICAgICAgICBjb25zdCBhZGphY2VudEhlaWdodHMgPSBbXTtcclxuICAgICAgICBsZXQgcG9zO1xyXG4gICAgICAgIGxldCBoZWlnaHQ7XHJcbiAgICAgICAgZm9yIChsZXQgeE9mZnNldCA9IC1kaXN0YW5jZTsgeE9mZnNldCA8PSBkaXN0YW5jZTsgeE9mZnNldCsrKSB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IHlPZmZzZXQgPSAtZGlzdGFuY2U7IHlPZmZzZXQgPD0gZGlzdGFuY2U7IHlPZmZzZXQrKykge1xyXG4gICAgICAgICAgICAgICAgaWYgKHhPZmZzZXQgPT09IDAgJiYgeU9mZnNldCA9PT0gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgcG9zID0gbmV3IFBvaW50KHggKyB4T2Zmc2V0LCB5ICsgeU9mZnNldCk7XHJcbiAgICAgICAgICAgICAgICBoZWlnaHQgPSBtYXBbTWFwV29ybGQuY29vcmRzVG9LZXkocG9zLngsIHBvcy55KV07XHJcbiAgICAgICAgICAgICAgICBhZGphY2VudEhlaWdodHMucHVzaChoZWlnaHQpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBhZGphY2VudEhlaWdodHM7XHJcbiAgICB9XHJcbiAgICBhc3NpZ25BZGphY2VudEhlaWdodExheWVycyh4LCB5LCBtYXAsIGRpc3RhbmNlID0gMSkge1xyXG4gICAgICAgIGNvbnN0IGtleSA9IE1hcFdvcmxkLmNvb3Jkc1RvS2V5KHgsIHkpO1xyXG4gICAgICAgIGNvbnN0IGFkamFjZW50SGVpZ2h0TGF5ZXJzID0gW107XHJcbiAgICAgICAgbGV0IHBvcztcclxuICAgICAgICBsZXQgaGVpZ2h0TGF5ZXI7XHJcbiAgICAgICAgZm9yIChsZXQgeE9mZnNldCA9IC1kaXN0YW5jZTsgeE9mZnNldCA8PSBkaXN0YW5jZTsgeE9mZnNldCsrKSB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IHlPZmZzZXQgPSAtZGlzdGFuY2U7IHlPZmZzZXQgPD0gZGlzdGFuY2U7IHlPZmZzZXQrKykge1xyXG4gICAgICAgICAgICAgICAgaWYgKHhPZmZzZXQgPT09IDAgJiYgeU9mZnNldCA9PT0gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgcG9zID0gbmV3IFBvaW50KHggKyB4T2Zmc2V0LCB5ICsgeU9mZnNldCk7XHJcbiAgICAgICAgICAgICAgICBoZWlnaHRMYXllciA9IG1hcFtNYXBXb3JsZC5jb29yZHNUb0tleShwb3MueCwgcG9zLnkpXTtcclxuICAgICAgICAgICAgICAgIGFkamFjZW50SGVpZ2h0TGF5ZXJzLnB1c2goaGVpZ2h0TGF5ZXIpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBhZGphY2VudEhlaWdodExheWVycztcclxuICAgIH1cclxuICAgIGlzQWRqYWNlbnRUb0Jpb21lKHgsIHksIGFkamFjZW5jeU1hcCwgdGVycmFpbikge1xyXG4gICAgICAgIGNvbnN0IGtleSA9IE1hcFdvcmxkLmNvb3Jkc1RvS2V5KHgsIHkpO1xyXG4gICAgICAgIGNvbnN0IGFkamFjZW50VGVycmFpbiA9IGFkamFjZW5jeU1hcFtrZXldO1xyXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYWRqYWNlbnRUZXJyYWluLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIGlmICh0ZXJyYWluLmluY2x1ZGVzKGFkamFjZW50VGVycmFpbltpXSkpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgIH1cclxuICAgIGdldEFkamFjZW50QmlvbWVzKHgsIHksIGFkamFjZW5jeU1hcCkge1xyXG4gICAgICAgIHJldHVybiBhZGphY2VuY3lNYXBbTWFwV29ybGQuY29vcmRzVG9LZXkoeCwgeSldO1xyXG4gICAgfVxyXG4gICAgZ2V0QWRqYWNlbnQoeCwgeSwgYWRqYWNlbmN5TWFwKSB7XHJcbiAgICAgICAgcmV0dXJuIGFkamFjZW5jeU1hcFtNYXBXb3JsZC5jb29yZHNUb0tleSh4LCB5KV07XHJcbiAgICB9XHJcbiAgICBpc1N1cnJvdW5kZWRCeSh4LCB5LCBhZGphY2VuY3lNYXAsIHRlcnJhaW4pIHtcclxuICAgICAgICBjb25zdCBrZXkgPSBNYXBXb3JsZC5j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tdO1xyXG4gICAgICAgIC8vIGdvIHRocm91Z2ggZXZlcnkgdGlsZSBpbiBtYXBcclxuICAgICAgICAvLyBpZiBpc1BsYW50LSBhZGQgdGhhdCB0aWxlICogcmF0aW8gb2YgdGlsZSBzaXplIGRpZmYgdG8gYnVmZmVyXHJcbiAgICAgICAgZm9yIChsZXQga2V5IGluIHRoaXMudGlsZU1hcCkge1xyXG4gICAgICAgICAgICAvLyB0aGlzIGdvZXMgdGhyb3VnaCBldmVyeSBzaW5nbGUgdGlsZVxyXG4gICAgICAgICAgICAvLyBET05UIEFERCBVTk5FQ0VTU0FSWSBDT0RFIFRPIFRIRSBPVVRFUiBMT09QXHJcbiAgICAgICAgICAgIGlmICh0aGlzLnRpbGVNYXBba2V5XS5iaW9tZUlkID09PSBiaW9tZVR5cGUpIHtcclxuICAgICAgICAgICAgICAgIGxldCBwb3MgPSBNYXBXb3JsZC5rZXlUb1BvaW50KGtleSk7XHJcbiAgICAgICAgICAgICAgICBpZiAoIW9ubHlQYXNzYWJsZSB8fCAob25seVBhc3NhYmxlICYmIHRoaXMuaXNQYXNzYWJsZShwb3MueCwgcG9zLnkpKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChpc1BsYW50KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvcyA9IFRpbGUudHJhbnNsYXRlUG9pbnQocG9zLCBMYXllci5URVJSQUlOLCBMYXllci5QTEFOVCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlci5wdXNoKHBvcywgbmV3IFBvaW50KHBvcy54ICsgMSwgcG9zLnkpLCBuZXcgUG9pbnQocG9zLngsIHBvcy55ICsgMSksIG5ldyBQb2ludChwb3MueCArIDEsIHBvcy55ICsgMSkpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLnB1c2gocG9zKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgbGV0IGluZGV4O1xyXG4gICAgICAgIHdoaWxlIChidWZmZXIubGVuZ3RoID4gMCAmJiByZXN1bHQubGVuZ3RoIDwgcXVhbnRpdHkpIHtcclxuICAgICAgICAgICAgaW5kZXggPSBNYXRoLmZsb29yKFJORy5nZXRVbmlmb3JtKCkgKiBidWZmZXIubGVuZ3RoKTtcclxuICAgICAgICAgICAgY29uc3QgcG9zID0gYnVmZmVyW2luZGV4XTtcclxuICAgICAgICAgICAgcmVzdWx0LnB1c2gobmV3IFBvaW50KHBvcy54LCBwb3MueSkpO1xyXG4gICAgICAgICAgICAvLyByZXN1bHQucHVzaChidWZmZXIuc3BsaWNlKGluZGV4LCAxKVswXSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiByZXN1bHQ7XHJcbiAgICB9XHJcbiAgICBnZXRUaWxlKHgsIHkpIHtcclxuICAgICAgICByZXR1cm4gdGhpcy50aWxlTWFwW01hcFdvcmxkLmNvb3Jkc1RvS2V5KHgsIHkpXTtcclxuICAgIH1cclxuICAgIGdldEJpb21lKHgsIHkpIHtcclxuICAgICAgICByZXR1cm4gdGhpcy5iaW9tZU1hcFtNYXBXb3JsZC5jb29yZHNUb0tleSh4LCB5KV07XHJcbiAgICB9XHJcbiAgICBpc1Bhc3NhYmxlKHgsIHkpIHtcclxuICAgICAgICBjb25zdCBrZXkgPSBNYXBXb3JsZC5jb29yZHNUb0tleSh4LCB5KTtcclxuICAgICAgICBjb25zdCBiaW9tZSA9IHRoaXMuYmlvbWVNYXBba2V5XTtcclxuICAgICAgICBjb25zdCBhdXRvdGlsZSA9IHRoaXMuYXV0b3RpbGVNYXBba2V5XTtcclxuICAgICAgICBjb25zdCBpc0JvcmRlclRpbGUgPSBBdXRvdGlsZS5pc1RpbGVJbmRleEF1dG9UaWxlQm9yZGVyKGF1dG90a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gfSBmcm9tIFwiLi9wb2ludFwiO1xyXG5leHBvcnQgY2xhc3MgTWVzc2FnZUxvZyB7XHJcbiAgICBjb25zdHJ1Y3Rvcih1c2VySW50ZXJmYWNlLCBwb3NpdGlvbiwgbWF4V2lkdGgsIG1heExpbmVzKSB7XHJcbiAgICAgICAgdGhpcy51c2VySW50ZXJmYWNlID0gdXNlckludGVyZmFjZTtcclxuICAgICAgICB0aGlzLnBvc2l0aW9uID0gcG9zaXRpb247XHJcbiAgICAgICAgdGhpcy5tYXhXaWR0aCA9IG1heFdpZHRoO1xyXG4gICAgICAgIHRoaXMubWF4TGluZXMgPSBtYXhMaW5lcztcclxuICAgICAgICB0aGlzLmxpbmVzID0gW107XHJcbiAgICB9XHJcbiAgICBjbGVhcigpIHtcclxuICAgICAgICB0aGlzLmxpbmVzID0gW107XHJcbiAgICB9XHJcbiAgICBhcHBlbmRUZXh0KHRleHQpIHtcclxuICAgICAgICB0aGlzLmxpbmVzLnNwbGljZSgwLCAwLCB0ZXh0KTtcclxuICAgICAgICBpZiAodGhpcy5saW5lcy5sZW5ndGggPiB0aGlzLm1heExpbmVzKSB7XHJcbiAgICAgICAgICAgIHRoaXMubGluZXMuc3BsaWNlKHRoaXMubWF4TGluZXMsIHRoaXMubGluZXMubGVuZ3RoIC0gdGhpcy5tYXhMaW5lcyk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgZHJhdygpIHtcclxuICAgICAgICBsZXQgbGluZVBvc2l0aW9uID0gbmV3IFBvaW50KHRoaXMucG9zaXRpb24ueCwgdGhpcy5wb3NpdGlvbi55KTtcclxuICAgICAgICBmb3IgKGxldCBpbmRleCA9IDA7IGluZGV4IDwgdGhpcy5tYXhMaW5lcyAmJiBpbmRleCA8IHRoaXMubGluZXMubGVuZ3RoOyArK2luZGV4KSB7XHJcbiAgICAgICAgICAgIHRoaXMudXNlckludGVyZmFjZS5kcmF3VGV4dChsaW5lUG9zaXRpb24sIHRoaXMubGluZXNbaW5kZXh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aW1wb3J0IHsgRElSUyB9IGZyb20gXCJyb3QtanNcIjtcclxuZXhwb3J0IGNsYXNzIFBvaW50IHtcclxuICAgIGNvbnN0cnVjdG9yKHgsIHkpIHtcclxuICAgICAgICB0aGlzLnggPSB4O1xyXG4gICAgICAgIHRoaXMueSA9IHk7XHJcbiAgICB9XHJcbiAgICBlcXVhbHMocG9pbnQpIHtcclxuICAgICAgICByZXR1cm4gdGhpcy54ID09IHBvaW50LnggJiYgdGhpcy55ID09IHBvaW50Lnk7XHJcbiAgICB9XHJcbiAgICB0b0tleSgpIHtcclxuICAgICAgICByZXR1cm4gYCR7dGhpcy54fSwke3RoaXMueX1gO1xyXG4gICAgfVxyXG4gICAgbWFuaGF0dGFuRGlzdGFuY2UocG9pbnQpIHtcclxuICAgICAgICByZXR1cm4gTWF0aC5hYnModGhpcy54IC0gcG9pbnQueCkgKyBNYXRoLmFicyh0aGlzLnkgLSBwb2ludC55KTtcclxuICAgIH1cclxuICAgIGRpc3RhbmNlKHBvaW50KSB7XHJcbiAgICAgICAgcmV0dXJuIE1hdGguc3FydChNYXRoLnBvdyh0aGlzLnggLSBwb2ludC54LCAyKSArIE1hdGgucG93KHRoaXMueSAtIHBvaW50LnksIDIpKTtcclxuICAgIH1cclxuICAgIC8vIHJldHVybiB2YWx1ZSBpcyBhIHR1cGxlIG9mIFtkeCwgZHldXHJcbiAgICAvLyBpLmUuIFsxLCAwXSBmb3IgcmlnaHRcclxuICAgIG1vdmVtZW50VmVjdG9yKHBvaW50KSB7XHJcbiAgICAgICAgLy8gcmV0dXJuIERJUlNbNF1bMl0gZm9yIGRvd25cclxuICAgICAgICAvLyByZXR1cm4gRElSU1s0XVszXSBmb3IgcmlnaHRcclxuICAgICAgICAvLyByZXR1cm4gRElSU1s0XVswXSBmb3IgdXBcclxuICAgICAgICAvLyByZXR1cm4gRElSU1s0XVsxXSBmb3IgbGVmdFxyXG4gICAgICAgIGxldCBkeCA9IHBvaW50LnggLSB0aGlzLng7XHJcbiA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lzLmRpc3BsYXlPYmpDYWNoZSA9IHtcclxuICAgICAgICAgICAgW0xheWVyLlRFUlJBSU5dOiB7fSxcclxuICAgICAgICAgICAgW0xheWVyLkdST1VOREZYXToge30sXHJcbiAgICAgICAgICAgIFtMYXllci5QTEFOVF06IHt9LFxyXG4gICAgICAgICAgICBbTGF5ZXIuRU5USVRZXToge30sXHJcbiAgICAgICAgICAgIFtMYXllci5VSV06IHt9LFxyXG4gICAgICAgIH07XHJcbiAgICB9XHJcbiAgICBhZGRMYXllcnNUb1N0YWdlKHN0YWdlKSB7XHJcbiAgICAgICAgc3RhZ2UuYWRkQ2hpbGQodGhpcy50ZXJyYWluTGF5ZXIpO1xyXG4gICAgICAgIHN0YWdlLmFkZENoaWxkKHRoaXMuZ3JvdW5kRlhMYXllcik7XHJcbiAgICAgICAgc3RhZ2UuYWRkQ2hpbGQodGhpcy5wbGFudExheWVyKTtcclxuICAgICAgICBzdGFnZS5hZGRDaGlsZCh0aGlzLmVudGl0eUxheWVyKTtcclxuICAgICAgICBzdGFnZS5hZGRDaGlsZCh0aGlzLnVpTGF5ZXIpO1xyXG4gICAgfVxyXG4gICAgcmVuZGVyTGF5ZXJzKGxheWVycywgd2lkdGgsIGhlaWdodCwgdmlld3BvcnRDZW50ZXJUaWxlKSB7XHJcbiAgICAgICAgbGV0IGNlbnRlclZpZXdwb3J0O1xyXG4gICAgICAgIGxldCByaWdodDtcclxuICAgICAgICBsZXQgYm90dG9tO1xyXG4gICAgICAgIGxldCBsZWZ0O1xyXG4gICAgICAgIGxldCB0b3A7XHJcbiAgICAgICAgZm9yIChsZXQgbGF5ZXIgb2YgbGF5ZXJzKSB7XHJcbiAgICAgICAgICAgIGlmIChsYXllciA9PT0gTGF5ZXIuUExBTlQgfHwgbGF5ZXIgPT09IExheWVyLkdST1VOREZYKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCByYXRpbyA9IFRpbGUuc2l6ZSAvIFRpbGUucGxhbnRTaXplO1xyXG4gICAgICAgICAgICAgICAgY2VudGVyVmlld3BvcnQgPSBUaWxlLnRyYW5zbGF0ZVBvaW50KHZpZXdwb3J0Q2VudGVyVGlsZSwgTGF5ZXIuVEVSUkFJTiwgTGF5ZXIuUExBTlQpO1xyXG4gICAgICAgICAgICAgICAgcmlnaHQgPSBjZW50ZXJWaWV3cG9ydC54ICsgTWF0aC5jZWlsKCh3aWR0aCAvIDIpICogcmF0aW8pO1xyXG4gICAgICAgICAgICAgICAgYm90dG9tID0gY2VudGVyVmlld3BvcnQueSArIE1hdGguY2VpbCgoaGVpZ2h0IC8gMikgKiByYXRpbyk7XHJcbiAgICAgICAgICAgICAgICBsZWZ0ID0gY2VudGVyVmlld3BvcnQueCAtIE1hdGguZmxvb3IoKHdpZHRoIC8gMikgKiByYXRpbyk7XHJcbiAgICAgICAgICAgICAgICB0b3AgPSBjZW50ZXJWaWV3cG9ydC55IC0gTWF0aC5mbG9vcigoaGVpZ2h0IC8gMikgKiByYXRpbyk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBjZW50ZXJWaWV3cG9ydCA9IHZpZXdwb3J0Q2VudGVyVGlsZTtcclxuICAgICAgICAgICAgICAgIHJpZ2h0ID0gY2VudGVyVmlld3BvcnQueCArIE1hdGguY2VpbCh3aWR0aCAvIDIpO1xyXG4gICAgICAgICAgICAgICAgYm90dG9tID0gY2VudGVyVmlld3BvcnQueSArIE1hdGguY2VpbChoZWlnaHQgLyAyKTtcclxuICAgICAgICAgICAgICAgIGxlZnQgPSBjZW50ZXJWaWV3cG9ydC54IC0gTWF0aC5mbG9vcih3aWR0aCAvIDIpO1xyXG4gICAgICAgICAgICAgICAgdG9wID0gY2VudGVyVmlld3BvcnQueSAtIE1hdGguZmxvb3IoaGVpZ2h0IC8gMik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKGxheWVyICE9PSBMYXllci5FTlRJVFkpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMuY2xlYXJMYXllcihsYXllcik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZm9yIChsZXQgeCA9IGxlZnQ7IHggPCByaWdodDsgeCsrKSB7XHJcbiAgICAgICAgICAgICAgICBmb3IgKGxldCB5ID0gdG9wOyB5IDwgYm90dG9tOyB5KyspIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBrZXkgPSBNYXBXb3JsZC5jb29yZHNUb0tleSh4LCB5KTtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgZGlzcGxheU9iaiA9IHRoaXMuZGlzcGxheU9iakNhY2hlW2xheWVyXVtrZXldO1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBpc1Nwcml0ZSA9IGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICghZGlzcGxheU9iaikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgaXNTcHJpdGUgPVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5T2JqIGluc3RhbmNlb2YgUElYSS5TcHJpdGUgfHxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXlPYmogaW5zdGFuY2VvZiBQSVhJLkFuaW1hdGVkU3ByaXRlO1xyXG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAobGF5ZXIpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBMYXllci5URVJSQUlOOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnRpbnRPYmplY3RXaXRoQ2hpbGRyZW4oZGlzcGxheU9iaiwgbmV3IFBvaW50KHgsIHkpKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMudGVycmFpbkxheWVyLmFkZENoaWxkKGRpc3BsYXlPYmopO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBMYXllci5HUk9VTkRGWDoge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhpcy50aW50T2JqZWN0V2l0aENoaWxkcmVuKGRpc3BsYXlPYmosIG5ldyBQb2ludCh4LCB5KSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmdyb3VuZEZYTGF5ZXIuYWRkQ2hpbGQoZGlzcGxheU9iaik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIExheWVyLlBMQU5UOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0ZXJyYWluUG9pbnQgPSBUaWxlLnRyYW5zbGF0ZVBvaW50KG5ldyBQb2ludCh4LCB5KSwgTGF5ZXIuUExBTlQsIExheWVyLlRFUlJBSU4pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy50aW50T2JqZWN0V2l0aENoaWxkcmVuKGRpc3BsYXlPYmosIHRlcnJhaW5Qb2ludCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBkaXNwbGF5T2JqLnpJbmRleCA9IHRoaXMuZ2FtZS5vcHRpb25zLmdhbWVTaXplLmhlaWdodCAqIHJhdGlvIC0geTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGxhbnRMYXllci5hZGRDaGlsZChkaXNwbGF5T2JqKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgTGF5ZXIuRU5USVRZOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnRpbnRPYmplY3RXaXRoQ2hpbGRyZW4oZGlzcGxheU9iaiwgbmV3IFBvaW50KHgsIHkpLCB0cnVlKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZW50aXR5TGF5ZXIuYWRkQ2hpbGQoZGlzcGxheU9iaik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIExheWVyLlVJOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnVpTGF5ZXIuYWRkQ2hpbGQoZGlzcGxheU9iaik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIC8vIGFkZCB0aGUgc3ByaXRlIHRvIHRoZSBjYWNoZSwgdG8gYmUgcmVuZGVyZWQgb24gdGhlIG5leHQgcmVuZGVyIHBhc3NcclxuICAgIC8vIFRPRE86IGRvbid0IGNyZWF0ZSB0aGUgc3ByaXRlIGhlcmUsIGp1c3QgdGFrZSBhIHNwcml0ZSBvciBhbmltYXRlZCBzcHJpdGUgYW5kIGFkZCBpdCB0byB0aGUgY2FjaGVcclxuICAgIGFkZFRvU2NlbmUocG9zaXRpb24sIGxheWVyLCBkaXNwbGF5T2JqLCBpbml0aWFsVGludCkge1xyXG4gICAgICAgIGxldCBpc1Nwcml0ZSA9IGZhbHNlO1xyXG4gICAgICAgIGlmICghZGlzcGxheU9iaikge1xyXG4gICAgICAgICAgICAvLyB0aHJvdyAobmV3IEVycm9yKFwiTm8gc3ByaXRlIHByb3ZpZGVkXCIpLCBwb3NpdGlvbiwgbGF5ZXIsIHNwcml0ZSwgdGludCk7XHJcbiAgICAgICAgICAgIGNvbnNvbGVcclxuICAgICAgICAgICAgICAgIC50aHJvdHRsZSgyNTApXHJcbiAgICAgICAgICAgICAgICAubG9nKFwiRXJyb3I6IGFkZFRvU2NlbmU6IG5vIGRpc3BsYXlPYmogcHJvdmlkZWRcIiwgcG9zaXRpb24sIGxheWVyLCBkaXNwbGF5T2JqLCBpbml0aWFsVGludCk7XHJcbiAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcbiAgICAgICAgaXNTcHJpdGUgPVxyXG4gICAgICAgICAgICBkaXNwbGF5T2JqIGluc3RhbmNlb2YgUElYSS5TcHJpdGUgfHxcclxuICAgICAgICAgICAgICAgIGRpc3BsYXlPYmogaW5zdGFuY2VvZiBQSVhJLkFuaW1hdGVkU3ByaXRlO1xyXG4gICAgICAgIHN3aXRjaCAobGF5ZXIpIHtcclxuICAgICAgICAgICAgY2FzZSBMYXllci5QTEFOVDoge1xyXG4gICAgICAgICAgICAgICAgaWYgKGlzU3ByaXRlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZGlzcGxheU9iai5hbmNob3Iuc2V0KDAuNSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvLyBjb25zdCByYXRpbyA9IFRpbGUuc2l6ZSAvIFRpbGUucGxhbnRTaXplO1xyXG4gICAgICAgICAgICAgICAgLy8gY29uc3QgdGVycmFpblBvaW50ID0gbmV3IFBvaW50KFxyXG4gICAgICAgICAgICAgICAgLy8gICBNYXRoLmZsb29yKHBvc2l0aW9uLnggLyByYXRpbyksXHJcbiAgICAgICAgICAgICAgICAvLyAgIE1hdGguZmxvb3IocG9zaXRpb24ueSAvIHJhdGlvKVxyXG4gICAgICAgICAgICAgICAgLy8gKTtcclxuICAgICAgICAgICAgICAgIC8vIGRpc3BsYXlPYmouekluZGV4ID1cclxuICAgICAgICAgICAgICAgIC8vICAgdGhpcy5nYW1lLm9wdGlvbnMuZ2FtZVNpemUuaGVpZ2h0ICogcmF0aW8gLSB0ZXJyYWluUG9pbnQueTtcclxuICAgICAgICAgICAgICAgIGRpc3BsYXlPYmoucG9zaXRpb24ueCA9IHBvc2l0aW9uLnggKiBUaWxlLnBsYW50U2l6ZTtcclxuICAgICAgICAgICAgICAgIGRpc3BsYXlPYmoucG9zaXRpb24ueSA9IHBvc2l0aW9uLnkgKiBUaWxlLnBsYW50U2l6ZTtcclxuICAgICAgICAgICAgICAgIC8vIGRpc3BsYXlPYmouc2NhbGUuc2V0KDEpO1xyXG4gICAgICAgICAgICAgICAgLy8gY29uc29sZS5sb2coXCJhZGQgc3ByaXRlIHRvIHBsYW50XCIsIHNwcml0ZSwgcG9zaXRpb24ueCwgcG9zaXRpb24ueSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjYXNlIExheWVyLlRFUlJBSU46IHtcclxuICAgICAgICAgICAgICAgIGlmIChpc1Nwcml0ZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGRpc3BsYXlPYmouYW5jaG9yLnNldCgwLjUpO1xyXG4gICAgICAgICAgICAgICAgICAgIGRpc3BsYXlPYmouc2NhbGUuc2V0KDIpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZGlzcGxheU9iai5wb3NpdGlvbi54ID0gcG9zaXRpb24ueCAqIFRpbGUuc2l6ZTtcclxuICAgICAgICAgICAgICAgIGRpc3BsYXlPYmoucG9zaXRpb24ueSA9IHBvc2l0aW9uLnkgKiBUaWxlLnNpemU7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjYXNlIExheWVyLkdST1VOREZYOiB7XHJcbiAgICAgICAgICAgICAgICBpZiAoaXNTcHJpdGUpIHtcclxuICAgICAgICAgICAgICAgICAgICBkaXNwbGF5T2JqLmFuY2hvci5zZXQoMC41KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGRpc3BsYXlPYmoucG9zaXRpb24ueCA9IHBvc2l0aW9uLnggKiBUaWxlLnBsYW50U2l6ZTtcclxuICAgICAgICAgICAgICAgIGRpc3BsYXlPYmoucG9zaXRpb24ueSA9IHBvc2l0aW9uLnkgKiBUaWxlLnBsYW50U2l6ZTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNhc2UgTGF5ZXIuVUk6IHtcclxuICAgICAgICAgICAgICAgIGlmIChpc1Nwcml0ZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGRpc3BsYXlPYmouYW5jaG9yLnNldCgwLjUpO1xyXG4gICAgICAgICAgICAgICAgICAgIGRpc3BsYXlPYmouc2NhbGUuc2V0KDIpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZGlzcGxheU9iai5wb3NpdGlvbi54ID0gcG9zaXRpb24ueCAqIFRpbGUuc2l6ZTtcclxuICAgICAgICAgICAgICAgIGRpc3BsYXlPYmoucG9zaXRpb24ueSA9IHBvc2l0aW9uLnkgKiBUaWxlLnNpemU7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjYXNlIExheWVyLkVOVElUWToge1xyXG4gICAgICAgICAgICAgICAgaWYgKGlzU3ByaXRlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZGlzcGxheU9iai5hbmNob3Iuc2V0KDAuNSk7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gZGlzcGxheU9iai5zY2FsZS5zZXQoMSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBkaXNwbGF5T2JqLnBvc2l0aW9uLnggPSBwb3NpdGlvbi54ICogVGlsZS5zaXplO1xyXG4gICAgICAgICAgICAgICAgZGlzcGxheU9iai5wb3NpdGlvbi55ID0gcG9zaXRpb24ueSAqIFRpbGUuc2l6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AgICBjYWNoZWRPYmogPSB0aGlzLmRpc3BsYXlPYmpDYWNoZVtsYXllcl1bZGlzcGxheU9ial07XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBjYWNoZWRPYmogPSBkaXNwbGF5T2JqO1xyXG4gICAgICAgIH1cclxuICAgICAgICAvLyByZW1vdmUgZnJvbSBzcHJpdGVCeVBvc1xyXG4gICAgICAgIHRoaXMuZGlzcGxheU9iakNhY2hlW2xheWVyXVtgJHtwb3NpdGlvbi54fSwke3Bvc2l0aW9uLnl9YF0gPSB1bmRlZmluZWQ7XHJcbiAgICAgICAgc3dpdGNoIChsYXllcikge1xyXG4gICAgICAgICAgICBjYXNlIExheWVyLlRFUlJBSU46IHtcclxuICAgICAgICAgICAgICAgIHRoaXMudGVycmFpbkxheWVyLnJlbW92ZUNoaWxkKGNhY2hlZE9iaik7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjYXNlIExheWVyLkdST1VOREZYOiB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmdyb3VuZEZYTGF5ZXIucmVtb3ZlQ2hpbGQoY2FjaGVkT2JqKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNhc2UgTGF5ZXIuUExBTlQ6IHtcclxuICAgICAgICAgICAgICAgIHRoaXMucGxhbnRMYXllci5yZW1vdmVDaGlsZChjYWNoZWRPYmopO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY2FzZSBMYXllci5FTlRJVFk6IHtcclxuICAgICAgICAgICAgICAgIHRoaXMuZW50aXR5TGF5ZXIucmVtb3ZlQ2hpbGQoY2FjaGVkT2JqKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjYXNlIExheWVyLlVJOiB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLnVpTGF5ZXIucmVtb3ZlQ2hpbGQoY2FjaGVkT2JqKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGNsZWFyQ2FjaGUobGF5ZXIpIHtcclxuICAgICAgICBpZiAobGF5ZXIpIHtcclxuICAgICAgICAgICAgdGhpcy5kaXNwbGF5T2JqQ2FjaGVbbGF5ZXJdID0ge307XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICB0aGlzLmRpc3BsYXlPYmpDYWNoZSA9IHtcclxuICAgICAgICAgICAgICAgIFtMYXllci5URVJSQUlOXToge30sXHJcbiAgICAgICAgICAgICAgICBbTGF5ZXIuR1JPVU5ERlhdOiB7fSxcclxuICAgICAgICAgICAgICAgIFtMYXllci5QTEFOVF06IHt9LFxyXG4gICAgICAgICAgICAgICAgW0xheWVyLkVOVElUWV06IHt9LFxyXG4gICAgICAgICAgICAgICAgW0xheWVyLlVJXToge30sXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgY2xlYXJTY2VuZShjbGVhckNhY2hlID0gZmFsc2UpIHtcclxuICAgICAgICB0aGlzLmNsZWFyTGF5ZXIoTGF5ZXIuVEVSUkFJTiwgY2xlYXJDYWNoZSk7XHJcbiAgICAgICAgdGhpcy5jbGVhckxheWVyKExheWVyLkdST1VOREZYLCBjbGVhckNhY2hlKTtcclxuICAgICAgICB0aGlzLmNsZWFyTGF5ZXIoTGF5ZXIuUExBTlQsIGNsZWFyQ2FjaGUpO1xyXG4gICAgICAgIHRoaXMuY2xlYXJMYXllcihMYXllci5FTlRJVFksIGNsZWFyQ2FjaGUpO1xyXG4gICAgICAgIHRoaXMuY2xlYXJMYXllcihMYXllci5VSSwgY2xlYXJDYWNoZSk7XHJcbiAgICB9XHJcbiAgICBjbGVhckxheWVycyhsYXllcnMsIGNsZWFyQ2FjaGUgPSBmYWxzZSkge1xyXG4gICAgICAgIGZvciAobGV0IGxheWVyIG9mIGxheWVycykge1xyXG4gICAgICAgICAgICB0aGlzLmNsZWFyTGF5ZXIobGF5ZXIsIGNsZWFyQ2FjaGUpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGNsZWFyTGF5ZXIobGF5ZXIsIGNsZWFyQ2FjaGUgPSBmYWxzZSkge1xyXG4gICAgICAgIGlmIChjbGVhckNhY2hlKSB7XHJcbiAgICAgICAgICAgIHRoaXMuZGlzcGxheU9iakNhY2hlW2xheWVyXSA9IHt9O1xyXG4gICAgICAgIH1cclxuICAgICAgICBzd2l0Y2ggKGxheWVyKSB7XHJcbiAgICAgICAgICAgIGNhc2UgTGF5ZXIuVEVSUkFJTjoge1xyXG4gICAgICAgICAgICAgICAgdGhpcy50ZXJyYWluTGF5ZXIucmVtb3ZlQ2hpbGRyZW4oKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNhc2UgTGF5ZXIuR1JPVU5ERlg6IHtcclxuICAgICAgICAgICAgICAgIHRoaXMuZ3JvdW5kRlhMYXllci5yZW1vdmVDaGlsZHJlbigpO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY2FzZSBMYXllci5QTEFOVDoge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5wbGFudExheWVyLnJlbW92ZUNoaWxkcmVuKCk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjYXNlIExheWVyLkVOVElUWToge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5lbnRpdHlMYXllci5yZW1vdmVDaGlsZHJlbigpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNhc2UgTGF5ZXIuVUk6IHtcclxuICAgICAgICAgICAgICAgIHRoaXMudWlMYXllci5yZW1vdmVDaGls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O1xyXG4gICAgICAgIC8vIH0gZWxzZSB7XHJcbiAgICAgICAgLy8gICB0aGlzLnNwcml0ZSA9IFNwcml0ZS5mcm9tKHRoaXMuc3ByaXRlUGF0aCk7XHJcbiAgICAgICAgLy8gfVxyXG4gICAgfVxyXG4gICAgc3RhdGljIHRyYW5zbGF0ZVBvaW50KHBvc2l0aW9uLCBmcm9tLCB0bykge1xyXG4gICAgICAgIGlmIChmcm9tID09PSB0bylcclxuICAgICAgICAgICAgcmV0dXJuIHBvc2l0aW9uO1xyXG4gICAgICAgIGNvbnN0IHJhdGlvID0gVGlsZS5zaXplIC8gVGlsZS5wbGFudFNpemU7XHJcbiAgICAgICAgaWYgKGZyb20gPT09IExheWVyLlBMQU5UKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBuZXcgUG9pbnQoTWF0aC5mbG9vcihwb3NpdGlvbi54IC8gcmF0aW8pLCBNYXRoLmZsb29yKHBvc2l0aW9uLnkgLyByYXRpbykpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIGlmICh0byA9PT0gTGF5ZXIuUExBTlQpIHtcclxuICAgICAgICAgICAgcmV0dXJuIG5ldyBQb2ludChwb3NpdGlvbi54ICogcmF0aW8sIHBvc2l0aW9uLnkgKiByYXRpbyk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgc3RhdGljIGdldERlc2NyaXB0aW9uKHRhcmdldCkge1xyXG4gICAgICAgIGNvbnN0IGRlc2NyaXB0aW9uQmxvY2tzID0gW107XHJcbiAgICAgICAgaWYgKCF0YXJnZXQpXHJcbiAgICAgICAgICAgIHJldHVybiBkZXNjcmlwdGlvbkJsb2NrcztcclxuICAgICAgICBkZXNjcmlwdGlvbkJsb2Nrcy5wdXNoKHtcclxuICAgICAgICAgICAgaWNvbjogUGluSWNvbixcclxuICAgICAgICAgICAgZ2V0RGVzY3JpcHRpb246IChwb2ludGVyVGFyZ2V0KSA9PiBgJHtwb2ludGVyVGFyZ2V0LnBvc2l0aW9uLnh9LCAke3RhcmdldC5wb3NpdGlvbi55fWAsXHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgaWYgKHRhcmdldC5pbmZvKSB7XHJcbiAgICAgICAgICAgIGRlc2NyaXB0aW9uQmxvY2tzLnB1c2goe1xyXG4gICAgICAgICAgICAgICAgaWNvbjogVGV4dEljb24sXHJcbiAgICAgICAgICAgICAgICBnZXREZXNjcmlwdGlvbjogKHBvaW50ZXJUYXJnZXQpID0+IHsgdmFyIF9hOyByZXR1cm4gYCR7KChfYSA9IHBvaW50ZXJUYXJnZXQgPT09IG51bGwgfHwgcG9pbnRlclRhcmdldCA9PT0gdm9pZCAwID8gdm9pZCAwIDogcG9pbnRlclRhcmdldC5pbmZvKSA9PT0gbnVsbCB8fCBfYSA9PT0gdm9pZCAwID8gdm9pZCAwIDogX2EuYmlvbWUuZGVzY3JpcHRpb24pIHx8IFwiVW5rbm93biBCaW9tZVwifWA7IH0sXHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICBkZXNjcmlwdGlvbkJsb2Nrcy5wdXNoKHtcclxuICAgICAgICAgICAgICAgIGljb246IFRlbXBJY29uLFxyXG4gICAgICAgICAgICAgICAgZ2V0RGVzY3JpcHRpb246IChwb2ludGVyVGFyZ2V0KSA9PiB7IHZhciBfYTsgcmV0dXJuIGAke01hdGgucm91bmQoKChfYSA9IHBvaW50ZXJUYXJnZXQgPT09IG51bGwgfHwgcG9pbnRlclRhcmdldCA9PT0gdm9pZCAwID8gdm9pZCAwIDogcG9pbnRlclRhcmdldC5pbmZvKSA9PT0gbnVsbCB8fCBfYSA9PT0gdm9pZCAwID8gdm9pZCAwIDogX2EudGVtcGVyYXR1cmVQZXJjZW50KSAqIDEwMCl9wrBGYDsgfSxcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIGRlc2NyaXB0aW9uQmxvY2tzLnB1c2goe1xyXG4gICAgICAgICAgICAgICAgaWNvbjogSGVpZ2h0SWNvbixcclxuICAgIC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aGVpZ2h0LFxyXG4gICAgICAgIC8vICAgdmlld3BvcnRJblRpbGVzLmNlbnRlclxyXG4gICAgICAgIC8vICk7XHJcbiAgICAgICAgdGhpcy5nYW1lLnJlbmRlcmVyLnJlbmRlckxheWVycyhbTGF5ZXIuVEVSUkFJTiwgTGF5ZXIuR1JPVU5ERlgsIExheWVyLkVOVElUWSwgTGF5ZXIuUExBTlQsIExheWVyLlVJXSwgdmlld3BvcnRJblRpbGVzLndpZHRoLCB2aWV3cG9ydEluVGlsZXMuaGVpZ2h0LCB2aWV3cG9ydEluVGlsZXMuY2VudGVyKTtcclxuICAgICAgICAvLyB0aGlzLmdhbWUucmVuZGVyZXIucmVuZGVyTGF5ZXJzKFxyXG4gICAgICAgIC8vICAgW0xheWVyLlRFUlJBSU4sIExheWVyLkVOVElUWSwgTGF5ZXIuVUldLFxyXG4gICAgICAgIC8vICAgdmlld3BvcnRJblRpbGVzLndpZHRoLFxyXG4gICAgICAgIC8vICAgdmlld3BvcnRJblRpbGVzLmhlaWdodCxcclxuICAgICAgICAvLyAgIHZpZXdwb3J0SW5UaWxlcy5jZW50ZXJcclxuICAgICAgICAvLyApO1xyXG4gICAgfVxyXG4gICAgZHJhd1BsYW50cygpIHtcclxuICAgICAgICB0aGlzLmdhbWUucmVuZGVyZXIuY2xlYXJMYXllcihMYXllci5QTEFOVCwgdHJ1ZSk7XHJcbiAgICAgICAgZm9yIChsZXQgcGxhbnQgb2YgdGhpcy5nYW1lLnBsYW50cykge1xyXG4gICAgICAgICAgICAvLyB0aGlzLmdhbWUucmVuZGVyZXIuYWRkVG9TY2VuZShcclxuICAgICAgICAgICAgLy8gICBwbGFudC5wb3NpdGlvbixcclxuICAgICAgICAgICAgLy8gICBMYXllci5QTEFOVCxcclxuICAgICAgICAgICAgLy8gICBwbGFudC50aWxlLnNwcml0ZVBhdGgsXHJcbiAgICAgICAgICAgIC8vICAgbnVsbCxcclxuICAgICAgICAgICAgLy8gICBwbGFudC50aWxlLmFuaW1hd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eWxlLnRvcCA9IFwiMFwiO1xyXG4gICAgICAgICAgICB0aGlzLmNhbnZhcy5zdHlsZS5sZWZ0ID0gXCIwXCI7XHJcbiAgICAgICAgICAgIHRoaXMuY2FudmFzLnN0eWxlLnBvaW50ZXJFdmVudHMgPSBcIm5vbmVcIjtcclxuICAgICAgICAgICAgdGhpcy5jYW52YXMuc3R5bGUuekluZGV4ID0gXCIxMDBcIjtcclxuICAgICAgICAgICAgdGhpcy5jb250YWluZXIuYXBwZW5kQ2hpbGQodGhpcy5jYW52YXMpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGRyYXdHcmlkKCkge1xyXG4gICAgICAgIGlmICh0aGlzLmNhbnZhcykge1xyXG4gICAgICAgICAgICBjb25zdCBjdHggPSB0aGlzLmNhbnZhcy5nZXRDb250ZXh0KFwiMmRcIik7XHJcbiAgICAgICAgICAgIC8vIGZpbGwgdGhlIGdyaWQgd2l0aCAxNngxNiB0aWxlcyB3aXRoIGEgMXB4IGJvcmRlclxyXG4gICAgICAgICAgICBjb25zdCBib3JkZXJTaXplID0gMTtcclxuICAgICAgICAgICAgY29uc3Qgc2NhbGUgPSB0aGlzLmdhbWUudXNlckludGVyZmFjZS5nYW1lRGlzcGxheS5zdGFnZS5zY2FsZS54O1xyXG4gICAgICAgICAgICBjb25zdCB0aWxlU2l6ZSA9IFRpbGUuc2l6ZSAqIHNjYWxlO1xyXG4gICAgICAgICAgICBjb25zdCBpbm5lclRpbGVTaXplID0gdGlsZVNpemUgLSBib3JkZXJTaXplICogMjsgLy8gU3VidHJhY3QgYm9yZGVyIG9uIGJvdGggc2lkZXNcclxuICAgICAgICAgICAgY29uc3Qgd2lkdGggPSB0aGlzLmNhbnZhcy53aWR0aDtcclxuICAgICAgICAgICAgY29uc3QgaGVpZ2h0ID0gdGhpcy5jYW52YXMuaGVpZ2h0O1xyXG4gICAgICAgICAgICBjb25zdCByb3dzID0gTWF0aC5mbG9vcih3aWR0aCAvIHRpbGVTaXplKTtcclxuICAgICAgICAgICAgY29uc3QgY29scyA9IE1hdGguZmxvb3IoaGVpZ2h0IC8gdGlsZVNpemUpO1xyXG4gICAgICAgICAgICBjb25zdCB4T2Zmc2V0ID0gKHdpZHRoICUgdGlsZVNpemUpIC8gMjtcclxuICAgICAgICAgICAgY29uc3QgeU9mZnNldCA9IChoZWlnaHQgJSB0aWxlU2l6ZSkgLyAyO1xyXG4gICAgICAgICAgICBjb25zdCBwaXZvdCA9IHRoaXMuZ2FtZS51c2VySW50ZXJmYWNlLmdhbWVEaXNwbGF5LnN0YWdlLnBpdm90O1xyXG4gICAgICAgICAgICBjb25zdCBwaXZvdE9mZnNldFggPSAocGl2b3QueCAlIFRpbGUuc2l6ZSkgKiBzY2FsZTtcclxuICAgICAgICAgICAgY29uc3QgcGl2b3RPZmZzZXRZID0gKHBpdm90LnkgJSBUaWxlLnNpemUpICogc2NhbGU7XHJcbiAgICAgICAgICAgIGN0eC5jbGVhclJlY3QoMCwgMCwgd2lkdGgsIGhlaWdodCk7IC8vIENsZWFyIHRoZSBjYW52YXNcclxuICAgICAgICAgICAgY3R4LmZpbGxTdHlsZSA9IFwicmdiYSgyNTUsIDE2LCAyNDAsIDEpXCI7IC8vIFNldCB0aGUgY29sb3IgdG8gaG90IHBpbmtcclxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCByb3dzOyBpKyspIHtcclxuICAgICAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgY29sczsgaisrKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT09IDQ3ICYmIGogPT09IDI2KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKGBkcmF3IHRpbGUgYXQgJHtpfSwgJHtqfSwgJHt0aWxlU2l6ZX1gKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY3R4LmZpbGxTdHlsZSA9IFwicmdiYSgzMCwgMjAwLCAyNDAsIDEpXCI7IC8vIFNldCB0aGUgY29sb3IgdG8gc29tZXRoaW5nIGVsc2VcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5maWxsU3R5bGUgPSBcInJnYmEoMjU1LCAxNiwgMjQwLCAxKVwiOyAvLyBTZXQgdGhlIGNvbG9yIHRvIGhvdCBwaW5rXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5maWxsUmVjdChpICogdGlsZVNpemUgKyB4T2Zmc2V0IC0gcGl2b3RPZmZzZXRYLCBqICogdGlsZVNpemUgKyB5T2Zmc2V0IC0gcGl2b3RPZmZzZXRZLCB0aWxlU2l6ZSwgdGlsZVNpemUpOyAvLyBEcmF3IHRoZSBvdXRlciB0aWxlIChib3JkZXIpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCByb3dzOyBpKyspIHtcclxuICAgICAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgY29sczsgaisrKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmNsZWFyUmVjdChpICogdGlsZVNpemUgKyB4T2Zmc2V0IC0gcGl2b3RPZmZzZXRYICsgYm9yZGVyU2l6ZSwgaiAqIHRpbGVTaXplICsgeU9mZnNldCAtIHBpdm90T2Zmc2V0WSArIGJvcmRlclNpemUsIGlubmVyVGlsZVNpemUsIGlubmVyVGlsZVNpemUpOyAvLyBDbGVhciB0aGUgaW5uZXIgdGlsZVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgcmVuZGVyVXBkYXRlKCkge1xyXG4gICAgICAgIGlmICghdGhpcy5jYW52YXMpIHtcclxuICAgICAgICAgICAgdGhpcy5jcmVhdGVDYW52YXMoK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iAgICB9XHJcbiAgICBnZXQgaXNWaXNpYmxlKCkge1xyXG4gICAgICAgIHJldHVybiB0aGlzLl9pc1Zpc2libGU7XHJcbiAgICB9XHJcbiAgICBzZXQgaXNWaXNpYmxlKHZhbHVlKSB7XHJcbiAgICAgICAgdGhpcy5faXNWaXNpYmxlID0gdmFsdWU7XHJcbiAgICB9XHJcbiAgICBnZW5lcmF0ZU92ZXJsYXkod2lkdGgsIGhlaWdodCwgbGFiZWwgPSBcIkdyZXlzY2FsZSBPdmVybGF5XCIsIGdldERhdGEpIHtcclxuICAgICAgICBjb25zdCBvdmVybGF5ID0gdGhpcy5nZW5lcmF0ZU92ZXJsYXlDb250YWluZXIobGFiZWwsIHdpZHRoLCBoZWlnaHQpO1xyXG4gICAgICAgIGNvbnN0IG92ZXJsYXlXaXRoUmVmcmVzaCA9IE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSwgb3ZlcmxheSksIHsgcmVmcmVzaERhdGE6ICgpID0+IHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGNhbnZhcyA9IG92ZXJsYXkuY2FudmFzO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZ3JleXNjYWxlTWFwID0gZ2V0RGF0YSgpO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgY3R4ID0gY2FudmFzLmdldENvbnRleHQoXCIyZFwiKTtcclxuICAgICAgICAgICAgICAgIGlmIChjdHggPT09IG51bGwpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBjb25zdCBpbWFnZURhdGEgPSBjdHguY3JlYXRlSW1hZ2VEYXRhKGNhbnZhcy53aWR0aCwgY2FudmFzLmhlaWdodCk7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBkYXRhID0gaW1hZ2VEYXRhLmRhdGE7XHJcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGRhdGEubGVuZ3RoOyBpICs9IDQpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCB4ID0gKGkgLyA0KSAlIGNhbnZhcy53aWR0aDtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCB5ID0gTWF0aC5mbG9vcihpIC8gNCAvIGNhbnZhcy53aWR0aCk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qga2V5ID0gYCR7eH0sJHt5fWA7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSBncmV5c2NhbGVNYXBba2V5XSAqIDI1NTtcclxuICAgICAgICAgICAgICAgICAgICBkYXRhW2ldID0gdmFsdWU7XHJcbiAgICAgICAgICAgICAgICAgICAgZGF0YVtpICsgMV0gPSB2YWx1ZTtcclxuICAgICAgICAgICAgICAgICAgICBkYXRhW2kgKyAyXSA9IHZhbHVlO1xyXG4gICAgICAgICAgICAgICAgICAgIGRhdGFbaSArIDNdID0gMjU1O1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgY3R4LnB1dEltYWdlRGF0YShpbWFnZURhdGEsIDAsIDApO1xyXG4gICAgICAgICAgICB9IH0pO1xyXG4gICAgICAgIHRoaXMub3ZlcmxheXMucHVzaChvdmVybGF5V2l0aFJlZnJlc2gpO1xyXG4gICAgICAgIHRoaXMuZGlzcGxheU92ZXJsYXlzLnB1c2gob3ZlcmxheVdpdGhSZWZyZXNoKTtcclxuICAgIH1cclxuICAgIGdlbmVyYXRlR3JhZGllbnRPdmVybGF5KHdpZHRoLCBoZWlnaHQsIGxhYmVsID0gXCJHcmV5c2NhbGUgT3ZlcmxheVwiLCBncmFkaWVudCwgZ2V0RGF0YSkge1xyXG4gICAgICAgIGNvbnN0IG92ZXJsYXkgPSB0aGlzLmdlbmVyYXRlT3ZlcmxheUNvbnRhaW5lcihsYWJlbCwgd2lkdGgsIGhlaWdodCk7XHJcbiAgICAgICAgY29uc3Qgb3ZlcmxheVdpdGhSZWZyZXNoID0gT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LCBvdmVybGF5KSwgeyByZWZyZXNoRGF0YTogKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgY2FudmFzID0gb3ZlcmxheS5jYW52YXM7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBncmV5c2NhbGVNYXAgPSBnZXREYXRhKCk7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBjdHggPSBjYW52YXMuZ2V0Q29udGV4dChcIjJkXCIpO1xyXG4gICAgICAgICAgICAgICAgaWYgKGN0eCA9PT0gbnVsbCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGNvbnN0IGltYWdlRGF0YSA9IGN0eC5jcmVhdGVJbWFnZURhdGEoY2FudmFzLndpZHRoLCBjYW52YXMuaGVpZ2h0KTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGRhdGEgPSBpbWFnZURhdGEuZGF0YTtcclxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZGF0YS5sZW5ndGg7IGkgKz0gNCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHggPSAoaSAvIDQpICUgY2FudmFzLndpZHRoO1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHkgPSBNYXRoLmZsb29yKGkgLyA0IC8gY2FudmFzLndpZHRoKTtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBrZXkgPSBgJHt4fSwke3l9YDtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCB2YWx1ZSA9IGdyZXlzY2FsZU1hcFtrZXldO1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCByZWQgPSAwO1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBncmVlbiA9IDA7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IGJsdWUgPSAwO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChncmFkaWVudC5taW4gPT09IFwicmVkXCIpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmVkID0gKDEgLSB2YWx1ZSkgKiAyNTU7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChncmFkaWVudC5taW4gPT09IFwiZ3JlZW5cIikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBncmVlbiA9ICgxIC0gdmFsdWUpICogMjU1O1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAoZ3JhZGllbnQubWluID09PSBcImJsdWVcIikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBibHVlID0gKDEgLSB2YWx1ZSkgKiAyNTU7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChncmFkaWVudC5tYXggPT09IFwicmVkXCIpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmVkID0gdmFsdWUgKiAyNTU7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChncmFkaWVudC5tYXggPT09IFwiZ3JlZW5cIikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBncmVlbiA9IHZhbHVlICogMjU1O1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAoZ3JhZGllbnQubWF4ID09PSBcImJsdWVcIikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBibHVlID0gdmFsdWUgKiAyNTU7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGRhdGFbaV0gPSByZWQ7IC8vIFJlZFxyXG4gICAgICAgICAgICAgICAgICAgIGRhdGFbaSArIDFdID0gZ3JlZW47IC8vIEdyZWVuXHJcbiAgICAgICAgICAgICAgICAgICAgZGF0YVtpICsgMl0gPSBibHVlOyAvLyBCbHVlXHJcbiAgIC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aXRoUmVmcmVzaCA9IE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSwgb3ZlcmxheSksIHsgcmVmcmVzaERhdGE6ICgpID0+IHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGNhbnZhcyA9IG92ZXJsYXkuY2FudmFzO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgY3R4ID0gY2FudmFzLmdldENvbnRleHQoXCIyZFwiKTtcclxuICAgICAgICAgICAgICAgIGlmIChjdHggPT09IG51bGwpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBjb25zdCBpbWFnZURhdGEgPSBjdHguY3JlYXRlSW1hZ2VEYXRhKGNhbnZhcy53aWR0aCwgY2FudmFzLmhlaWdodCk7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBkYXRhID0gaW1hZ2VEYXRhLmRhdGE7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBiaW9tZU1hcCA9IGdldERhdGEoKTtcclxuICAgICAgICAgICAgICAgIC8vIHNldCB0aGUgY29sb3Igb2YgZWFjaCBwaXhlbCB0byBiaW9tZS5jb2xvclxyXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBkYXRhLmxlbmd0aDsgaSArPSA0KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgeCA9IChpIC8gNCkgJSBjYW52YXMud2lkdGg7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgeSA9IE1hdGguZmxvb3IoaSAvIDQgLyBjYW52YXMud2lkdGgpO1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGtleSA9IGAke3h9LCR7eX1gO1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGJpb21lID0gYmlvbWVNYXBba2V5XTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoYmlvbWUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY29sb3IgPSBiaW9tZS5jb2xvcjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVtpXSA9IHBhcnNlSW50KGNvbG9yLnN1YnN0cigxLCAyKSwgMTYpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhW2kgKyAxXSA9IHBhcnNlSW50KGNvbG9yLnN1YnN0cigzLCAyKSwgMTYpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhW2kgKyAyXSA9IHBhcnNlSW50KGNvbG9yLnN1YnN0cig1LCAyKSwgMTYpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhW2kgKyAzXSA9IDI1NTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBjdHgucHV0SW1hZ2VEYXRhKGltYWdlRGF0YSwgMCwgMCk7XHJcbiAgICAgICAgICAgIH0gfSk7XHJcbiAgICAgICAgdGhpcy5vdmVybGF5cy5wdXNoKG92ZXJsYXlXaXRoUmVmcmVzaCk7XHJcbiAgICAgICAgdGhpcy5kaXNwbGF5T3ZlcmxheXMucHVzaChvdmVybGF5V2l0aFJlZnJlc2gpO1xyXG4gICAgICAgIC8vIG92ZXJsYXlXaXRoUmVmcmVzaC5yZWZyZXNoKCk7XHJcbiAgICB9XHJcbiAgICBnZW5lcmF0ZU92ZXJsYXlDb250YWluZXIobGFiZWwsIHdpZHRoLCBoZWlnaHQpIHtcclxuICAgICAgICBjb25zdCBvdmVybGF5Q29udGFpbmVyID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcImRpdlwiKTtcclxuICAgICAgICBvdmVybGF5Q29udGFpbmVyLnN0eWxlLnBvc2l0aW9uID0gXCJhYnNvbHV0ZVwiO1xyXG4gICAgICAgIG92ZXJsYXlDb250YWluZXIuc3R5bGUudG9wID0gXCIwXCI7XHJcbiAgICAgICAgb3ZlcmxheUNvbnRhaW5lci5zdHlsZS5ib3R0b20g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5lci5hcHBlbmRDaGlsZChjYW52YXMpO1xyXG4gICAgICAgIHRoaXMuY29udGFpbmVyLmFwcGVuZENoaWxkKG92ZXJsYXlDb250YWluZXIpO1xyXG4gICAgICAgIHJldHVybiBvdmVybGF5O1xyXG4gICAgfVxyXG4gICAgaGFuZGxlQ2xpY2soZSkge1xyXG4gICAgICAgIGlmICh0aGlzLmlzVmlzaWJsZSkge1xyXG4gICAgICAgICAgICBjb25zdCBmb3J3YXJkID0gZS5jbGllbnRYID4gd2luZG93LmlubmVyV2lkdGggLyAyO1xyXG4gICAgICAgICAgICB0aGlzLm5leHRPdmVybGF5KGZvcndhcmQpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIG5leHRPdmVybGF5KGZvcndhcmQgPSB0cnVlKSB7XHJcbiAgICAgICAgbGV0IGN1cnJlbnRPdmVybGF5O1xyXG4gICAgICAgIGxldCBuZXh0T3ZlcmxheTtcclxuICAgICAgICBpZiAoZm9yd2FyZCkge1xyXG4gICAgICAgICAgICBjdXJyZW50T3ZlcmxheSA9IHRoaXMub3ZlcmxheXMuc2hpZnQoKTtcclxuICAgICAgICAgICAgdGhpcy5vdmVybGF5cy5wdXNoKGN1cnJlbnRPdmVybGF5KTtcclxuICAgICAgICAgICAgbmV4dE92ZXJsYXkgPSB0aGlzLm92ZXJsYXlzWzBdO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY3VycmVudE92ZXJsYXkgPSB0aGlzLm92ZXJsYXlzWzBdO1xyXG4gICAgICAgICAgICBuZXh0T3ZlcmxheSA9IHRoaXMub3ZlcmxheXMucG9wKCk7XHJcbiAgICAgICAgICAgIHRoaXMub3ZlcmxheXMudW5zaGlmdChuZXh0T3ZlcmxheSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChjdXJyZW50T3ZlcmxheSkge1xyXG4gICAgICAgICAgICBjdXJyZW50T3ZlcmxheS5jYW52YXMuc3R5bGUuZGlzcGxhe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50YWJzID0gW1xyXG4gICAgICAgICAgICB7IG5hbWU6IFwiRW50aXRpZXNcIiwgaWNvbjogUGVyc29uSWNvbiwgY29udGVudDogW10gfSxcclxuICAgICAgICAgICAgeyBuYW1lOiBcIkNpdGllc1wiLCBpY29uOiBIb3VzZUljb24sIGNvbnRlbnQ6IFtdIH0sXHJcbiAgICAgICAgICAgIHsgbmFtZTogXCJSZXNvdXJjZXNcIiwgaWNvbjogQmFja3BhY2tJY29uLCBjb250ZW50OiBbXSB9LFxyXG4gICAgICAgICAgICB7IG5hbWU6IFwiQnVpbGRcIiwgaWNvbjogV3JlbmNoSWNvbiwgY29udGVudDogW10gfSxcclxuICAgICAgICBdO1xyXG4gICAgICAgIHRoaXMuaXNWaXNpYmxlID0gdHJ1ZTtcclxuICAgICAgICB0aGlzLmNvbnRhaW5lciA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoXCJkaXZcIik7XHJcbiAgICAgICAgdGhpcy5jb250YWluZXIuc3R5bGUucG9pbnRlckV2ZW50cyA9IFwiYXV0b1wiO1xyXG4gICAgICAgIHRoaXMuY29udGFpbmVyLnN0eWxlLnBvc2l0aW9uID0gXCJhYnNvbHV0ZVwiO1xyXG4gICAgICAgIHRoaXMuY29udGFpbmVyLnN0eWxlLnRvcCA9IFwiMTIwcHhcIjtcclxuICAgICAgICB0aGlzLmNvbnRhaW5lci5zdHlsZS5sZWZ0ID0gXCIwXCI7XHJcbiAgICAgICAgdGhpcy5jb250YWluZXIuc3R5bGUuYm90dG9tID0gXCIyMHB4XCI7XHJcbiAgICAgICAgdGhpcy5jb250YWluZXIuc3R5bGUud2lkdGggPSBcIjEyMHB4XCI7XHJcbiAgICAgICAgdGhpcy5jb250YWluZXIuc3R5bGUucGFkZGluZyA9IFwiMTBweFwiO1xyXG4gICAgICAgIHRoaXMuY29udGFpbmVyLnN0eWxlLnBhZGRpbmdSaWdodCA9IFwiMHB4XCI7XHJcbiAgICAgICAgdGhpcy5jb250YWluZXIuc3R5b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V0QXR0cmlidXRlKFwic3JjXCIsIHRoaXMuc2VsZWN0ZWRUYWIuaWNvbik7XHJcbiAgICAgICAgZHJvcGRvd25JY29uLnN0eWxlLmZvbnRTaXplID0gXCIyMHB4XCI7XHJcbiAgICAgICAgdGhpcy5kcm9wZG93bkJ0bi5hcHBlbmRDaGlsZChkcm9wZG93bkljb24pO1xyXG4gICAgICAgIHRoaXMuZHJvcGRvd24uYXBwZW5kQ2hpbGQodGhpcy5kcm9wZG93bkJ0bik7XHJcbiAgICAgICAgaWYgKHRoaXMuZHJvcGRvd25NZW51T3B0aW9ucykge1xyXG4gICAgICAgICAgICBmb3IgKGxldCBvcHRpb24gb2YgdGhpcy5kcm9wZG93bk1lbnVPcHRpb25zKSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmRyb3Bkb3duTWVudS5yZW1vdmVDaGlsZChvcHRpb24pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRoaXMuZHJvcGRvd25NZW51T3B0aW9ucyA9IFtdO1xyXG4gICAgICAgIGZvciAobGV0IHRhYiBvZiB0aGlzLnRhYnMpIHtcclxuICAgICAgICAgICAgaWYgKHRhYiA9PT0gdGhpcy5zZWxlY3RlZFRhYikge1xyXG4gICAgICAgICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY29uc3QgZHJvcGRvd25JdGVtID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcInNsLW1lbnUtaXRlbVwiKTtcclxuICAgICAgICAgICAgY29uc3QgZHJvcGRvd25JY29uID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcInNsLWljb25cIik7XHJcbiAgICAgICAgICAgIGRyb3Bkb3duSWNvbi5zdHlsZS5tYXJnaW5SaWdodCA9IFwiMTVweFwiO1xyXG4gICAgICAgICAgICBkcm9wZG93bkl0ZW0udGV4dENvbnRlbnQgPSB0YWIubmFtZTtcclxuICAgICAgICAgICAgZHJvcG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ogXCJQb3RlbnRpYWwgU2l0ZVwiLCBpY29uOiBHZW9JY29uIH0sXHJcbiAgICAgICAgLy8gICAgICAgeyBuYW1lOiBcIkNvbW1lcmNpYWwgRGlzdHJpY3RcIiwgaWNvbjogU2hvcFdpbmRvd0ljb24gfSxcclxuICAgICAgICAvLyAgICAgXTtcclxuICAgICAgICAvLyAgICAgYnJlYWs7XHJcbiAgICAgICAgLy8gICBjYXNlIFwiUmVzb3VyY2VzXCI6XHJcbiAgICAgICAgLy8gICAgIHBsYWNlaG9sZGVyUmVzb3VyY2VzID0gW1xyXG4gICAgICAgIC8vICAgICAgIHsgbmFtZTogXCJDdXJyZW5jeVwiLCBpY29uOiBDdXJyZW5jeUljb24gfSxcclxuICAgICAgICAvLyAgICAgICB7IG5hbWU6IFwiQW5pbWFsc1wiLCBpY29uOiBQaWdneUJhbmtJY29uIH0sXHJcbiAgICAgICAgLy8gICAgICAgeyBuYW1lOiBcIk1lZGljaW5lXCIsIGljb246IENhcHN1bGVJY29uIH0sXHJcbiAgICAgICAgLy8gICAgICAgeyBuYW1lOiBcIlBsYW50IE1hdGVyaWFsXCIsIGljb246IEZsb3dlckljb24gfSxcclxuICAgICAgICAvLyAgICAgXTtcclxuICAgICAgICAvLyAgICAgYnJlYWs7XHJcbiAgICAgICAgLy8gICBjYXNlIFwiQnVpbGRcIjpcclxuICAgICAgICAvLyAgICAgcGxhY2Vob2xkZXJSZXNvdXJjZXMgPSBbXHJcbiAgICAgICAgLy8gICAgICAgeyBuYW1lOiBcIlBsYW5uaW5nXCIsIGljb246IFBlbmNpbEljb24gfSxcclxuICAgICAgICAvLyAgICAgICB7IG5hbWU6IFwiSG91c2luZ1wiLCBpY29uOiBIb3VzZUljb24gfSxcclxuICAgICAgICAvLyAgICAgXTtcclxuICAgICAgICAvLyAgICAgYnJlYWs7XHJcbiAgICAgICAgLy8gfVxyXG4gICAgICAgIGlmICh0aGlzLm1lbnVDb250ZW50KSB7XHJcbiAgICAgICAgICAgIHRoaX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IHgsXG4gICAgICB5LFxuICAgICAgaW5pdGlhbFBsYWNlbWVudDogcGxhY2VtZW50LFxuICAgICAgcGxhY2VtZW50OiBzdGF0ZWZ1bFBsYWNlbWVudCxcbiAgICAgIHN0cmF0ZWd5LFxuICAgICAgbWlkZGxld2FyZURhdGEsXG4gICAgICByZWN0cyxcbiAgICAgIHBsYXRmb3JtLFxuICAgICAgZWxlbWVudHM6IHtcbiAgICAgICAgcmVmZXJlbmNlLFxuICAgICAgICBmbG9hdGluZ1xuICAgICAgfVxuICAgIH0pO1xuICAgIHggPSBuZXh0WCAhPSBudWxsID8gbmV4dFggOiB4O1xuICAgIHkgPSBuZXh0WSAhPSBudWxsID8gbmV4dFkgOiB5O1xuICAgIG1pZGRsZXdhcmVEYXRhID0ge1xuICAgICAgLi4ubWlkZGxld2FyZURhdGEsXG4gICAgICBbbmFtZV06IHtcbiAgICAgICAgLi4ubWlkZGxld2FyZURhdGFbbmFtZV0sXG4gICAgICAgIC4uLmRhdGFcbiAgICAgIH1cbiAgICB9O1xuICAgIGlmIChyZXNldCAmJiByZXNldENvdW50IDw9IDUwKSB7XG4gICAgICByZXNldENvdW50Kys7XG4gICAgICBpZiAodHlwZW9mIHJlc2V0ID09PSAnb2JqZWN0Jykge1xuICAgICAgICBpZiAocmVzZXQucGxhY2VtZW50KSB7XG4gICAgICAgICAgc3RhdGVmdWxQbGFjZW1lbnQgPSByZXNldC5wbGFjZW1lbnQ7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHJlc2V0LnJlY3RzKSB7XG4gICAgICAgICAgcmVjdHMgPSByZXNldC5yZWN0cyA9PT0gdHJ1ZSA/IGF3YWl0IHBsYXRmb3JtLmdldEVsZW1lbnRSZWN0cyh7XG4gICAgICAgICAgICByZWZlcmVuY2UsXG4gICAgICAgICAgICBmbG9hdGluZyxcbiAgICAgICAgICAgIHN0cmF0ZWd5XG4gICAgICAgICAgfSkgOiByZXNldC5yZWN0cztcbiAgICAgICAgfVxuICAgICAgICAo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2V0cyxcbiAgICAgICAgICAgICAgICByZWZlcmVuY2VIaWRkZW46IGlzQW55U2lkZUZ1bGx5Q2xpcHBlZChvZmZzZXRzKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH1cbiAgICAgICAgY2FzZSAnZXNjYXBlZCc6XG4gICAgICAgICAge1xuICAgICAgICAgICAgY29uc3Qgb3ZlcmZsb3cgPSBhd2FpdCBkZXRlY3RPdmVyZmxvdyhzdGF0ZSwge1xuICAgICAgICAgICAgICAuLi5kZXRlY3RPdmVyZmxvd09wdGlvbnMsXG4gICAgICAgICAgICAgIGFsdEJvdW5kYXJ5OiB0cnVlXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGNvbnN0IG9mZnNldHMgPSBnZXRTaWRlT2Zmc2V0cyhvdmVyZmxvdywgcmVjdHMuZmxvYXRpbmcpO1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgZGF0YToge1xuICAgICAgICAgICAgICAgIGVzY2FwZWRPZmZzZXRzOiBvZmZzZXRzLFxuICAgICAgICAgICAgICAgIGVzY2FwZWQ6IGlzQW55U2lkZUZ1bGx5Q2xpcHBlZChvZmZzZXRzKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH1cbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICB7XG4gICAgICAgICAgICByZXR1cm4ge307XG4gICAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfTtcbn07XG5cbmZ1bmN0aW9uIGdldEJvdW5kaW5nUmVjdChyZWN0cykge1xuICBjb25zdCBtaW5YID0gbWluKC4uLnJlY3RzLm1hcChyZWN0ID0+IHJlY3QubGVmdCkpO1xuICBjb25zdCBtaW5ZID0gbWluKC4uLnJlY3RzLm1hcChyZWN0ID0+IHJlY3QudG9wKSk7XG4gIGNvbnN0IG1heFggPSBtYXgoLi4ucmVjdHMubWFwKHJlY3QgPT4gcmVjdC5ya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WN0ID0gY2xpZW50UmVjdHNbMF07XG4gICAgICAgICAgICBjb25zdCBsYXN0UmVjdCA9IGNsaWVudFJlY3RzW2NsaWVudFJlY3RzLmxlbmd0aCAtIDFdO1xuICAgICAgICAgICAgY29uc3QgaXNUb3AgPSBnZXRTaWRlKHBsYWNlbWVudCkgPT09ICd0b3AnO1xuICAgICAgICAgICAgY29uc3QgdG9wID0gZmlyc3RSZWN0LnRvcDtcbiAgICAgICAgICAgIGNvbnN0IGJvdHRvbSA9IGxhc3RSZWN0LmJvdHRvbTtcbiAgICAgICAgICAgIGNvbnN0IGxlZnQgPSBpc1RvcCA/IGZpcnN0UmVjdC5sZWZ0IDogbGFzdFJlY3QubGVmdDtcbiAgICAgICAgICAgIGNvbnN0IHJpZ2h0ID0gaXNUb3AgPyBmaXJzdFJlY3QucmlnaHQgOiBsYXN0UmVjdC5yaWdodDtcbiAgICAgICAgICAgIGNvbnN0IHdpZHRoID0gcmlnaHQgLSBsZWZ0O1xuICAgICAgICAgICAgY29uc3QgaGVpZ2h0ID0gYm90dG9tIC0gdG9wO1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgdG9wLFxuICAgICAgICAgICAgICBib3R0b20sXG4gICAgICAgICAgICAgIGxlZnQsXG4gICAgICAgICAgICAgIHJpZ2h0LFxuICAgICAgICAgICAgICB3aWR0aCxcbiAgICAgICAgICAgICAgaGVpZ2h0LFxuICAgICAgICAgICAgICB4OiBsZWZ0LFxuICAgICAgICAgICAgICB5OiB0b3BcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfVxuICAgICAgICAgIGNvbnN0IGlzTGVmdFNpZGUgPSBnZXRTaWRlKHBsYWNlbWVudCkgPT09ICdsZWZ0JztcbiAgICAgICAgICBjb25zdCBtYXhSaWdodCA9IG1heCguLi5jbGllbnRSZWN0cy5tYXAocmVjdCA9PiByZWN0LnJpZ2h0KSk7XG4gICAgICAgICAgY29uc3QgbWluTGVmdCA9IG1pbiguLi5jbGllbnRSZWN0cy5tYXAocmVjdCA9PiByZWN0LmxlZnQpKTtcbiAgICAgICAgICBjb25zdCBtZWFzdXJlUmVjdHMgPSBjbGllbnRSZWN0cy5maWx0ZXIocmVjdCA9PiBpc0xlZnRTaWRlID8gcmVjdC5sZWZ0ID09PSBtaW5MZWZ0IDogcmVjdC5yaWdodCA9PT0gbWF4UmlnaHQpO1xuICAgICAgICAgIGNvbnN0IHRvcCA9IG1lYXN1cmVSZWN0c1swXS50b3A7XG4gICAgICAgICAgY29uc3QgYm90dG9tID0gbWVhc3VyZVJlY3RzW21lYXN1cmVSZWN0cy5sZW5ndGggLSAxXS5ib3R0b207XG4gICAgICAgICAgY29uc3QgbGVmdCA9IG1pbkxlZnQ7XG4gICAgICAgICAgY29uc3QgcmlnaHQgPSBtYXhSaWdodDtcbiAgICAgICAgICBjb25zdCB3aWR0aCA9IHJpZ2h0IC0gbGVmdDtcbiAgICAgICAgICBjb25zdCBoZWlnaHQgPSBib3R0b20gLSB0b3A7XG4gICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHRvcCxcbiAgICAgICAgICAgIGJvdHRvbSxcbiAgICAgICAgICAgIGxlZnQsXG4gICAgICAgICAgICByaWdodCxcbiAgICAgICAgICAgIHdpZHRoLFxuICAgICAgICAgICAgaGVpZ2h0LFxuICAgICAgICAgICAgeDogbGVmdCxcbiAgICAgICAgICAgIHk6IHRvcFxuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZhbGxiYWNrO1xuICAgICAgfVxuICAgICAgY29uc3QgcmVzZXRSZWN0cyA9IGF3YWl0IHBsYXRmb3JtLmdldEVsZW1lbnRSZWN0cyh7XG4gICAgICAgIHJlZmVyZW5jZToge1xuICAgICAgICAgIGdldEJvdW5kaW5nQ2xpZW50UmVjdFxuICAgICAgICB9LFxuICAgICAgICBmbG9hdGluZzogZWxlbWVudHMuZmxvYXRpbmcsXG4gICAgICAgIHN0cmF0ZWd5XG4gICAgICB9K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vZiBzdGFuZGFyZCBkZWNvcmF0b3JzXG4gICAgICAgICAgICAvLyAgIDIuIFRoZSBwcm9wZXJ0eSBkZXNjcmlwdG9yLCBpbiB0aGUgY2FzZSBvZiBleHBlcmltZW50YWwgZGVjb3JhdG9yc1xuICAgICAgICAgICAgLy8gICAgICBvbiBhdXRvLWFjY2Vzc29ycy5cbiAgICAgICAgICAgIC8vICAgMy4gRnVuY3Rpb25zIHRoYXQgYWNjZXNzIG91ciBvd24gY2FjaGUta2V5IHByb3BlcnR5IG9uIHRoZSBpbnN0YW5jZSxcbiAgICAgICAgICAgIC8vICAgICAgaW4gdGhlIGNhc2Ugb2YgZXhwZXJpbWVudGFsIGRlY29yYXRvcnMgb24gZmllbGRzLlxuICAgICAgICAgICAgY29uc3QgeyBnZXQsIHNldCB9ID0gdHlwZW9mIG5hbWVPckNvbnRleHQgPT09ICdvYmplY3QnXG4gICAgICAgICAgICAgICAgPyBwcm90b09yVGFyZ2V0XG4gICAgICAgICAgICAgICAgOiBkZXNjcmlwdG9yID8/XG4gICAgICAgICAgICAgICAgICAgICgoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBrZXkgPSBERVZfTU9ERVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gU3ltYm9sKGAke1N0cmluZyhuYW1lT3JDb250ZXh0KX0gKEBxdWVyeSgpIGNhY2hlKWApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBTeW1ib2woKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0KCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpc1trZXldO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0KHYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpc1trZXldID0gdjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgfSkoKTtcbiAgICAgICAgICAgIHJldHVybiBkZXNjKHByb3RvT3JUYXJnZXQsIG5hbWVPckNvbnRleHQsIHtcbiAgICAgICAgICAgICAgICBnZXQoKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCByZXN1bHQgPSBnZXQuY2FsbCh0aGlzKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBkb1F1ZXJ5KHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCAhPT0gbnVsbCB8fCB0aGlzLmhhc1VwZGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXQuY2FsbCh0aGlzLCByZXN1bHQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgLy8gVGhpcyBvYmplY3Qgd29ya3MgYXMgdGhlIHJldHVybiB0eXBlIGZvciBib3RoIHN0YW5kYXJkIGFuZFxuICAgICAgICAgICAgLy8gZXhwZXJpbWVudGFsIGRlY29yYXRvcnMuXG4gICAgICAgICAgICByZXR1cm4gZGVzYyhwcm90b09yVGFyZ2V0LCBuYW1lT3JDb250ZXh0LCB7XG4gICAgICAgICAgICAgICAgZ2V0KCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZG9RdWVyeSh0aGlzKTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9KTtcbn1cbi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meSh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH0sXG4gICAgZnJvbUF0dHJpYnV0ZSh2YWx1ZSwgdHlwZSkge1xuICAgICAgICBsZXQgZnJvbVZhbHVlID0gdmFsdWU7XG4gICAgICAgIHN3aXRjaCAodHlwZSkge1xuICAgICAgICAgICAgY2FzZSBCb29sZWFuOlxuICAgICAgICAgICAgICAgIGZyb21WYWx1ZSA9IHZhbHVlICE9PSBudWxsO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSBOdW1iZXI6XG4gICAgICAgICAgICAgICAgZnJvbVZhbHVlID0gdmFsdWUgPT09IG51bGwgPyBudWxsIDogTnVtYmVyKHZhbHVlKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgT2JqZWN0OlxuICAgICAgICAgICAgY2FzZSBBcnJheTpcbiAgICAgICAgICAgICAgICAvLyBEbyAqbm90KiBnZW5lcmF0ZSBleGNlcHRpb24gd2hlbiBpbnZhbGlkIEpTT04gaXMgc2V0IGFzIGVsZW1lbnRzXG4gICAgICAgICAgICAgICAgLy8gZG9uJ3Qgbm9ybWFsbHkgY29tcGxhaW4gb24gYmVpbmcgbWlzLWNvbmZpZ3VyZWQuXG4gICAgICAgICAgICAgICAgLy8gVE9ETyhzb3J2ZWxsKTogRG8gZ2VuZXJhdGUgZXhjZXB0aW9uIGluICpkZXYgbW9kZSouXG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgLy8gQXNzZXJ0IHRvIGFkaGVyZSB0byBCYXplbCdzIFwibXVzdCB0eXBlIGFzc2VydCBKU09OIHBhcnNlXCIgcnVsZS5cbiAgICAgICAgICAgICAgICAgICAgZnJvbVZhbHVlID0gSlNPTi5wYXJzZSh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAg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gZGVzY3JpcHRvciB0byBiZSBkZWZpbmVkIG9uIHRoZSBnaXZlbiBuYW1lZCBwcm9wZXJ0eS5cbiAgICAgKiBJZiBubyBkZXNjcmlwdG9yIGlzIHJldHVybmVkLCB0aGUgcHJvcGVydHkgd2lsbCBub3QgYmVjb21lIGFuIGFjY2Vzc29yLlxuICAgICAqIEZvciBleGFtcGxlLFxuICAgICAqXG4gICAgICogYGBgdHNcbiAgICAgKiBjbGFzcyBNeUVsZW1lbnQgZXh0ZW5kcyBMaXRFbGVtZW50IHtcbiAgICAgKiAgIHN0YXRpYyBnZXRQcm9wZXJ0eURlc2NyaXB0b3IobmFtZSwga2V5LCBvcHRpb25zKSB7XG4gICAgICogICAgIGNvbnN0IGRlZmF1bHREZXNjcmlwdG9yID1cbiAgICAgKiAgICAgICAgIHN1cGVyLmdldFByb3BlcnR5RGVzY3JpcHRvcihuYW1lLCBrZXksIG9wdGlvbnMpO1xuICAgICAqICAgICBjb25zdCBzZXR0ZXIgPSBkZWZhdWx0RGVzY3JpcHRvci5zZXQ7XG4gICAgICogICAgIHJldHVybiB7XG4gICAgICogICAgICAgZ2V0OiBkZWZhdWx0RGVzY3JpcHRvci5nZXQsXG4gICAgICogICAgICAgc2V0KHZhbHVlKSB7XG4gICAgICogICAgICAgICBzZXR0ZXIuY2FsbCh0aGlzLCB2YWx1ZSk7XG4gICAgICogICAgICAgICAvLyBjdXN0b20gYWN0aW9uLlxuICAgICAqICAgICAgIH0sXG4gICAgICogICAgICAgY29uZmlndXJhYmxlOiB0cnVlLFxuICAgICAqICAgICAgIGVudW1lcmFibGU6IHRydWVcbiAgICAgKiAgICAgfVxuICAgICAqICAgfVxuICAgICAqIH1cbiAgICAgKiBgYGBcbiAgICAgKlxuICAgICAqIEBub2NvbGxhcHNlXG4gICAgICogQGNhdGVnb3J5IHByb3BlcnRpZXNcbiAgICAgKi9cbiAgICBzdGF0aWMgZ2V0UHJvcGVydHlEZXNjcmlwdG9yKG5hbWUsIGtleSwgb3B0aW9ucykge1xuICAgICAgICBjb25zdCB7IGdldCwgc2V0IH0gPSBnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IodGhpcy5wcm90b3R5cGUsIG5hbWUpID8/IHtcbiAgICAgICAgICAgIGdldCgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpc1trZXldO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNldCh2KSB7XG4gICAgICAgICAgICAgICAgdGhpc1trZXldID0gdjtcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH07XG4gICAgICAgIGlmIChERVZfTU9ERSAmJiBnZXQgPT0gbnVsbCkge1xuICAgICAgICAgICAgaWYgKCd2YWx1ZScgaW4gKGdldE93blByb3BlcnR5RGVzY3JpcHRvcih0aGlzLnByb3RvdHlwZSwgbmFtZSkgPz8ge30pKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBGaWVsZCAke0pTT04uc3RyaW5naWZ5KFN0cmluZyhuYW1lKSl9IG9uIGAgK1xuICAgICAgICAgICAgICAgICAgICBgJHt0aGlzLm5hbWV9IHdhcyBkZWNsYXJlZCBhcyBhIHJlYWN0aXZlIHByb3BlcnR5IGAgK1xuICAgICAgICAgICAgICAgICAgICBgYnV0IGl0J3MgYWN0dWFsbHkgZGVjbGFyZWQgYXMgYSB2YWx1ZSBvbiB0aGUgcHJvdG90eXBlLiBgICtcbiAgICAgICAgICAgICAgICAgICAgYFVzdWFsbHkgdGhpcyBpcyBkdWUgdG8gdXNpbmcgQHByb3BlcnR5IG9yIEBzdGF0ZSBvbiBhIG1ldGhvZC5gKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlzc3VlV2FybmluZygncmVhY3RpdmUtcHJvcGVydHktd2l0aG91dC1nZXR0ZXInLCBgRmllbGQgJHtKU09OLnN0cmluZ2lmeShTdHJpbmcobmFtZSkpfSBvbiBgICtcbiAgICAgICAgICAgICAgICBgJHt0aGlzLm5hbWV9IHdhcyBk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gICAgICAgICAgIHRoaXMuXyRjaGFuZ2VQcm9wZXJ0eShwLCB0aGlzW3BdLCBvcHRpb25zKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgc2hvdWxkVXBkYXRlID0gZmFsc2U7XG4gICAgICAgIGNvbnN0IGNoYW5nZWRQcm9wZXJ0aWVzID0gdGhpcy5fJGNoYW5nZWRQcm9wZXJ0aWVzO1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgc2hvdWxkVXBkYXRlID0gdGhpcy5zaG91bGRVcGRhdGUoY2hhbmdlZFByb3BlcnRpZXMpO1xuICAgICAgICAgICAgaWYgKHNob3VsZFVwZGF0ZSkge1xuICAgICAgICAgICAgICAgIHRoaXMud2lsbFVwZGF0ZShjaGFuZ2VkUHJvcGVydGllcyk7XG4gICAgICAgICAgICAgICAgdGhpcy5fX2NvbnRyb2xsZXJzPy5mb3JFYWNoKChjKSA9PiBjLmhvc3RVcGRhdGU/LigpKTtcbiAgICAgICAgICAgICAgICB0aGlzLnVwZGF0ZShjaGFuZ2VkUHJvcGVydGllcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9fbWFya1VwZGF0ZWQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBjYXRjaCAoZSkge1xuICAgICAgICAgICAgLy8gUHJldmVudCBgZmlyc3RVcGRhdGVkYCBhbmQgYHVwZGF0ZWRgIGZyb20gcnVubmluZyB3aGVuIHRoZXJlJ3MgYW5cbiAgICAgICAgICAgIC8vIHVwZGF0ZSBleGNlcHRpb24uXG4gICAgICAgICAgICBzaG91bGRVcGRhdGUgPSBmYWxzZTtcbiAgICAgICAgICAgIC8vIEVuc3VyZSBlbGVtZW50IGNhbiBhY2NlcHQgYWRkaXRpb25hbCB1cGRhdGVzIGFmdGVyIG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JzW2pdLmNvZGVVYm8odWJvRWxlbWVudC5kYXRhLm5hbWUsIHVuaWZvcm0pXG4gICAgICAgICksIHBhcnNlZCA9ICEwO1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICB9XG4gICAgaWYgKCFwYXJzZWQpXG4gICAgICBpZiAodWJvRWxlbWVudC5kYXRhLnNpemUgPiAxKSB7XG4gICAgICAgIGNvbnN0IHNpemUyID0gbWFwU2l6ZSh1Ym9FbGVtZW50LmRhdGEudHlwZSksIHJvd1NpemUgPSBNYXRoLm1heChHTFNMX1RPX1NURDQwX1NJWkVbdWJvRWxlbWVudC5kYXRhLnR5cGVdIC8gMTYsIDEpLCBlbGVtZW50U2l6ZSA9IHNpemUyIC8gcm93U2l6ZSwgcmVtYWluZGVyID0gKDQgLSBlbGVtZW50U2l6ZSAlIDQpICUgNDtcbiAgICAgICAgZnVuY0ZyYWdtZW50cy5wdXNoKGBcbiAgICAgICAgICAgICAgICBjdiA9IHVkLiR7bmFtZX0udmFsdWU7XG4gICAgICAgICAgICAgICAgdiA9IHV2LiR7bmFtZX07XG4gICAgICAgICAgICAgICAgb2Zmc2V0ID0gJHt1Ym9FbGVtZW50Lm9mZnNldCAvIDR9O1xuXG4gICAgICAgICAgICAgICAgdCA9IDA7XG5cbiAgICAgICAgICAgICAgICBmb3IodmFyIGk9MDsgaSA8ICR7dWJvRWxlbWVudC5kYXRhLnNpemUgKiByb3dTaXplfTsgaSsrKVxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgZm9yKHZhciBqID0gMDsgaiA8ICR7ZWxlbWVudFNpemV9OyBqKyspXG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KytdID0gdlt0KytdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIG9mZnNldCArPSAke3JlbWFpbmRlcn07XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgIC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dG8gbWF0M1xuICB7XG4gICAgdGVzdDogKGRhdGEsIHVuaWZvcm0pID0+IGRhdGEudHlwZSA9PT0gXCJtYXQzXCIgJiYgZGF0YS5zaXplID09PSAxICYmICFkYXRhLmlzQXJyYXkgJiYgdW5pZm9ybS5hICE9PSB2b2lkIDAsXG4gICAgY29kZTogKG5hbWUpID0+IChcbiAgICAgIC8vIFRPRE8gYW5kIHNvbWUgc21hcnQgY2FjaGluZyBkaXJ0eSBpZHMgaGVyZSFcbiAgICAgIGBcbiAgICAgICAgICAgIGdsLnVuaWZvcm1NYXRyaXgzZnYodWRbXCIke25hbWV9XCJdLmxvY2F0aW9uLCBmYWxzZSwgdXZbXCIke25hbWV9XCJdLnRvQXJyYXkodHJ1ZSkpO1xuICAgICAgICAgICAgYFxuICAgICksXG4gICAgY29kZVVibzogKG5hbWUpID0+IGBcbiAgICAgICAgICAgICAgICB2YXIgJHtuYW1lfV9tYXRyaXggPSB1di4ke25hbWV9LnRvQXJyYXkodHJ1ZSk7XG5cbiAgICAgICAgICAgICAgICBkYXRhW29mZnNldF0gPSAke25hbWV9X21hdHJpeFswXTtcbiAgICAgICAgICAgICAgICBkYXRhW29mZnNldCsxXSA9ICR7bmFtZX1fbWF0cml4WzFdO1xuICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KzJdID0gJHtuYW1lfV9tYXRyaXhbMl07XG4gICAgICAgIFxuICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0ICsgNF0gPSAke25hbWV9X21hdHJpeFszXTtcbiAgICAgICAgICAgICAgICBkYXRhW29mZnNldCArIDVdID0gJHtuYW1lfV9tYXRyaXhbNF07XG4gICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQgKyA2XSA9ICR7bmFtZX1fbWF0cml4WzVdO1xuICAgICAgICBcbiAgICAgICAgICAgICAgICBkYXRhW29mZnNldCArIDhdID0gJHtuYW1lfV9tYXRyaXhbNl07XG4gICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQgKyA5XSA9ICR7bmFtZX1fbWF0cml4WzddO1xuICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0ICsgMTBdID0gJHtuYW1lfV9tYXRyaXhbOF07XG4gICAgICAgICAgICBgXG4gIH0sXG4gIC8vIHVwbG9hZGluZyBhIHBpeGkgcG9pbnQgYXMgYSB2ZWMyIHdpdGggY2FjaGluZyBsYXllclxuICB7XG4gICAgdGVzdDogKGRhdGEsIHVuaWZvcm0pID0+IGRhdGEudHlwZSA9PT0gXCJ2ZWMyXCIgJiYgZGF0YS5zaXplID09PSAxICYmICFkYXRhLmlzQXJyYXkgJiYgdW5pZm9ybS54ICE9PSB2b2lkIDAsXG4gICAgY29kZTogKG5hbWUpID0+IGBcbiAgICAgICAgICAgICAgICBjdiA9IHVkW1wiJHtuYW1lfVwiXS52YWx1ZTtcbiAgICAgICAgICAgICAgICB2ID0gdXZbXCIke25hbWV9XCJdO1xuXG4gICAgICAgICAgICAgICAgaWYoY3ZbMF0gIT09IHYueCB8fCBjdlsxXSAhPT0gdi55KVxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMF0gPSB2Lng7XG4gICAgICAgICAgICAgICAgICAgIGN2WzFdID0gdi55O1xuICAgICAgICAgICAgICAgICAgICBnbC51bmlmb3JtMmYodWRbXCIke25hbWV9XCJdLmxvY2F0aW9uLCB2LngsIHYueSk7XG4gICAgICAgICAgICAgICAgfWAsXG4gICAgY29kZVVibzogKG5hbWUpID0+IGBcbiAgICAgICAgICAgICAgICB2ID0gdXYuJHtuYW1lfTtcblxuICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0XSA9IHYueDtcbiAgICAgICAgICAgICAgICBkYXRhW29mZnNldCsxXSA9IHYueTtcbiAgICAgICAgICAgIGBcbiAgfSxcbiAgLy8gY2FjaGluZyBsYXllciBmb3IgYSB2ZWMyXG4gIHtcbiAgICB0ZXN0OiAoZGF0YSkgPT4gZGF0YS50eXBlID09PSBcInZlYzJcIiAmJiBkYXRhLnNpemUgPT09IDEgJiYgIWRhdGEuaXNBcnJheSxcbiAgICBjb2RlOiAobmFtZSkgPT4gYFxuICAgICAgICAgICAgICAgIGN2ID0gdWRbXCIke25hbWV9XCJdLnZhbHVlO1xuICAgICAgICAgICAgICAgIHYgPSB1dltcIiR7bmFtZX1cIl07XG5cbiAgICAgICAgICAgICAgICBpZihjdlswXSAhPT0gdlswXSB8fCBjdlsxXSAhPT0gdlsxXSlcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIGN2WzBdID0gdlswXTtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMV0gPSB2WzFdO1xuICAgICAgICAgICAgICAgICAgICBnbC51bmlmb3JtMmYodWRbXCIke25hbWV9XCJdLmxvY2F0aW9uLCB2WzBdLCB2WzFdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBgXG4gIH0sXG4gIC8vIHVwbG9hZCBhIHBpeGkgcmVjdGFuZ2xlIGFzIGEgdmVjNCB3aXRoIGNhY2hpbmcgbGF5ZXJcbiAge1xuICAgIHRlc3Q6IChkYXRhLCB1bmlmb3JtKSA9PiBkYXRhLnR5cGUgPT09IFwidmVjNFwiICYmIGRhdGEuc2l6ZSA9PT0gMSAmJiAhZGF0YS5pc0FycmF5ICYmIHVuaWZvcm0ud2lkdGggIT09IHZvaWQgMCxcbiAgICBjb2RlOiAobmFtZSkgPT4gYFxuICAgICAgICAgICAgICAgIGN2ID0gdWRbXCIke25hbWV9XCJdLnZhbHVlO1xuICAgICAgICAgICAgICAgIHYgPSB1dltcIiR7bmFtZX1cIl07XG5cbiAgICAgICAgICAgICAgICBpZihjdlswXSAhPT0gdi54IHx8IGN2WzFdICE9PSB2LnkgfHwgY3ZbMl0gIT09IHYud2lkdGggfHwgY3ZbM10gIT09IHYuaGVpZ2h0KVxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMF0gPSB2Lng7XG4gICAgICAgICAgICAgICAgICAgIGN2WzFdID0gdi55O1xuICAgICAgICAgICAgICAgICAgICBjdlsyXSA9IHYud2lkdGg7XG4gICAgICAgICAgICAgICAgICAgIGN2WzNdID0gdi5oZWlnaHQ7XG4gICAgICAgICAgICAgICAgICAgIGdsLnVuaWZvcm00Zih1ZFtcIiR7bmFtZX1cIl0ubG9jYXRpb24sIHYueCwgdi55LCB2LndpZHRoLCB2LmhlaWdodClcbiAgICAgICAgICAgICAgICB9YCxcbiAgICBjb2RlVWJvOiAobmFtZSkgPT4gYFxuICAgICAgICAgICAgICAgICAgICB2ID0gdXYuJHtuYW1lfTtcblxuICAgICAgICAgICAgICAgICAgICBkYXRhW29mZnNldF0gPSB2Lng7XG4gICAgICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KzFdID0gdi55O1xuICAgICAgICAgICAgICAgICAgICBkYXRhW29mZnNldCsyXSA9IHYud2lkdGg7XG4gICAgICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KzNdID0gdi5oZWlnaHQ7XG4gICAgICAgICAgICAgICAgYFxuICB9LFxuICAvLyB1cGxvYWQgYSBwaXhpIGNvbG9yIGFzIHZlYzQgd2l0aCBjYWNoaW5nIGxheWVyXG4gIHtcbiAgICB0ZXN0OiAoZGF0YSwgdW5pZm9ybSkgPT4gZGF0YS50eXBlID09PSBcInZlYzRcIiAmJiBkYXRhLnNpemUgPT09IDEgJiYgIWRhdGEuaXNBcnJheSAmJiB1bmlmb3JtLnJlZCAhPT0gdm9pZCAwLFxuICAgIGNvZGU6IChuYW1lKSA9PiBgXG4gICAgICAgICAgICAgICAgY3YgPSB1ZFtcIiR7bmFtZX1cIl0udmFsdWU7XG4gICAgICAgICAgICAgICAgdiA9IHV2W1wiJHtuYW1lfVwiXTtcblxuICAgICAgICAgICAgICAgIGlmKGN2WzBdICE9PSB2LnJlZCB8fCBjdlsxXSAhPT0gdi5ncmVlbiB8fCBjdlsyXSAhPT0gdi5ibHVlIHx8IGN2WzNdICE9PSB2LmFscGhhKVxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMF0gPSB2LnJlZDtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMV0gPSB2LmdyZWVuO1xuICAgICAgICAgICAgICAgICAgICBjdlsyXSA9IHYuYmx1ZTtcbiAgICAgICAgICAgICAgICAgICAgY3ZbM10gPSB2LmFscGhhO1xuICAgICAgICAgICAgICAgICAgICBnbC51bmlmb3JtNGYodWRbXCIke25hbWV9XCJdLmxvY2F0aW9uLCB2LnJlZCwgdi5ncmVlbiwgdi5ibHVlLCB2LmFscGhhKVxuICAgICAgICAgICAgICAgIH1gLFxuICAgIGNvZGVVYm86IChuYW1lKSA9PiBgXG4gICAgICAgICAgICAgICAgICAgIHYgPSB1di4ke25hbWV9O1xuXG4gICAgICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0XSA9IHYucmVkO1xuICAgICAgICAgICAgICAgICAgICBkYXRhW29mZnNldCsxXSA9IHYuZ3JlZW47XG4gICAgICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KzJdID0gdi5ibHVlO1xuICAgICAgICAgICAgICAgICAgICBkYXRhW29mZnNldCszXSA9IHYuYWxwaGE7XG4gICAgICAgICAgICAgICAgYFxuICB9LFxuICAvLyB1cGxvYWQgYSBwaXhpIGNvbG9yIGFzIGEgdmVjMyB3aXRoIGNhY2hpbmcgbGF5ZXJcbiAge1xuICAgIHRlc3Q6IChkYXRhLCB1bmlmb3JtKSA9PiBkYXRhLnR5cGUgPT09IFwidmVjM1wiICYmIGRhdGEuc2l6ZSA9PT0gMSAmJiAhZGF0YS5pc0FycmF5ICYmIHVuaWZvcm0ucmVkICE9PSB2b2lkIDAsXG4gICAgY29kZTogKG5hbWUpID0+IGBcbiAgICAgICAgICAgICAgICBjdiA9IHVkW1wiJHtuYW1lfVwiXS52YWx1ZTtcbiAgICAgICAgICAgICAgICB2ID0gdXZbXCIke25hbWV9XCJdO1xuXG4gICAgICAgICAgICAgICAgaWYoY3ZbMF0gIT09IHYucmVkIHx8IGN2WzFdICE9PSB2LmdyZWVuIHx8IGN2WzJdICE9PSB2LmJsdWUgfHwgY3ZbM10gIT09IHYuYSlcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIGN2WzBdID0gdi5yZWQ7XG4gICAgICAgICAgICAgICAgICAgIGN2WzFdID0gdi5ncmVlbjtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMl0gPSB2LmJsdWU7XG4gICAgXG4gICAgICAgICAgICAgICAgICAgIGdsLnVuaWZvcm0zZih1ZFtcIiR7bmFtZX1cIl0ubG9jYXRpb24sIHYucmVkLCB2LmdyZWVuLCB2LmJsdWUpXG4gICAgICAgICAgICAgICAgfWAsXG4gICAgY29kZVVibzogKG5hbWUpID0+IGBcbiAgICAgICAgICAgICAgICAgICAgdiA9IHV2LiR7bmFtZX07XG5cbiAgICAgICAgICAgICAgICAgICAgZGF0YVtvZmZzZXRdID0gdi5yZWQ7XG4gICAgICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KzFdID0gdi5ncmVlbjtcbiAgICAgICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQrMl0gPSB2LmJsdWU7XG4gICAgICAgICAgICAgICAgYFxuICB9LFxuICAvLyBhIGNhY2hpbmcgbGF5ZXIgZm9yIHZlYzQgdXBsb2FkaW5nXG4gIHtcbiAgICB0ZXN0OiAoZGF0YSkgPT4gZGF0YS50eXBlID09PSBcInZlYzRcIiAmJiBkYXRhLnNpemUgPT09IDEgJiYgIWRhdGEuaXNBcnJheSxcbiAgICBjb2RlOiAobmFtZSkgPT4gYFxuICAgICAgICAgICAgICAgIGN2ID0gdWRbXCIke25hbWV9XCJdLnZhbHVlO1xuICAgICAgICAgICAgICAgIHYgPSB1dltcIiR7bmFtZX1cIl07XG5cbiAgICAgICAgICAgICAgICBpZihjdlswXSAhPT0gdlswXSB8fCBjdlsxXSAhPT0gdlsxXSB8fCBjdlsyXSAhPT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bnN0IHsgcHJpbWFyeSwgc2Vjb25kYXJ5IH0gPSB0aGlzLmdldFRyYW5zbGF0aW9uRGF0YSgoX2EgPSBvcHRpb25zLmxhbmcpICE9PSBudWxsICYmIF9hICE9PSB2b2lkIDAgPyBfYSA6IHRoaXMubGFuZygpKTtcbiAgICAgICAgb3B0aW9ucyA9IE9iamVjdC5hc3NpZ24oeyBpbmNsdWRlRmFsbGJhY2s6IGZhbHNlIH0sIG9wdGlvbnMpO1xuICAgICAgICBpZiAoKHByaW1hcnkgJiYgcHJpbWFyeVtrZXldKSB8fFxuICAgICAgICAgICAgKHNlY29uZGFyeSAmJiBzZWNvbmRhcnlba2V5XSkgfHxcbiAgICAgICAgICAgIChvcHRpb25zLmluY2x1ZGVGYWxsYmFjayAmJiBmYWxsYmFjayAmJiBmYWxsYmFja1trZXldKSkge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgICB0ZXJtKGtleSwgLi4uYXJncykge1xuICAgICAgICBjb25zdCB7IHByaW1hcnksIHNlY29uZGFyeSB9ID0gdGhpcy5nZXRUcmFuc2xhdGlvbkRhdGEodGhpcy5sYW5nKCkpO1xuICAgICAgICBsZXQgdGVybTtcbiAgICAgICAgaWYgKHByaW1hcnkgJiYgcHJpbWFyeVtrZXldKSB7XG4gICAgICAgICAgICB0ZXJtID0gcHJpbWFyeVtrZXldO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHNlY29uZGFyeSAmJiBzZWNvbmRhcnlba2V5XSkge1xuICAgICAgICAgICAgdGVybSA9IHNlY29uZGFyeVtrZXldO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGZhbGxiYWNrICYmIGZhbGxiYWNrW2tleV0pIHtcbiAgICAgICAgICAgIHRlcm0gPSBmYWxsYmFja1trZXldO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgY29uc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gICAgICBjb25zdCBlbGVtZW50cyA9IHRoaXMuZm9ybS5xdWVyeVNlbGVjdG9yQWxsKFwiKlwiKTtcbiAgICAgICAgZm9yIChjb25zdCBlbGVtZW50IG9mIGVsZW1lbnRzKSB7XG4gICAgICAgICAgaWYgKHR5cGVvZiBlbGVtZW50LmNoZWNrVmFsaWRpdHkgPT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgICAgaWYgKCFlbGVtZW50LmNoZWNrVmFsaWRpdHkoKSkge1xuICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9O1xuICAgIHRoaXMucmVwb3J0Rm9ybVZhbGlkaXR5ID0gKCkgPT4ge1xuICAgICAgaWYgKHRoaXMuZm9ybSAmJiAhdGhpcy5mb3JtLm5vVmFsaWRhdGUpIHtcbiAgICAgICAgY29uc3QgZWxlbWVudHMgPSB0aGlzLmZvcm0ucXVlcnlTZWxlY3RvckFsbChcIipcIik7XG4gICAgICAgIGZvciAoY29uc3QgZWxlbWVudCBvZiBlbGVtZW50cykge1xuICAgICAgICAgIGlmICh0eXBlb2YgZWxlbWVudC5yZXBvcnRWYWxpZGl0eSA9PT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICAgICAgICBpZiAoIWVsZW1lbnQucmVwb3J0VmFsaWRpdHkoKSkge1xuICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9O1xuICAgICh0aGlzLmhvc3QgPSBob3N0KS5hZGRDb250cm9sbGVyKHRoaXMpO1xuICAgIHRoaXMub3B0aW9ucyA9IF9fc3ByZWFkVmFsdWVzKHtcbiAgICAgIGZvcm06IChpbnB1dCkgPT4ge1xuICAgICAgICBjb25zdCBmb3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IHJldHVybiBodG1sYFxuICAgICAgPGRpdlxuICAgICAgICBwYXJ0PVwiZm9ybS1jb250cm9sXCJcbiAgICAgICAgY2xhc3M9JHtjbGFzc01hcCh7XG4gICAgICBcImZvcm0tY29udHJvbFwiOiB0cnVlLFxuICAgICAgXCJmb3JtLWNvbnRyb2wtLW1lZGl1bVwiOiB0cnVlLFxuICAgICAgLy8gcmFuZ2Ugb25seSBoYXMgb25lIHNpemVcbiAgICAgIFwiZm9ybS1jb250cm9sLS1oYXMtbGFiZWxcIjogaGFzTGFiZWwsXG4gICAgICBcImZvcm0tY29udHJvbC0taGFzLWhlbHAtdGV4dFwiOiBoYXNIZWxwVGV4dFxuICAgIH0pfVxuICAgICAgPlxuICAgICAgICA8bGFiZWxcbiAgICAgICAgICBwYXJ0PVwiZm9ybS1jb250cm9sLWxhYmVsXCJcbiAgICAgICAgICBjbGFzcz1cImZvcm0tY29udHJvbF9fbGFiZWxcIlxuICAgICAgICAgIGZvcj1cImlucHV0XCJcbiAgICAgICAgICBhcmlhLWhpZGRlbj0ke2hhc0xhYmVsID8gXCJmYWxzZVwiIDogXCJ0cnVlXCJ9XG4gICAgICAgID5cbiAgICAgICAgICA8c2xvdCBuYW1lPVwibGFiZWxcIj4ke3RoaXMubGFiZWx9PC9zbG90PlxuICAgICAgICA8L2xhYmVsPlxuXG4gICAgICAgIDxkaXYgcGFydD1cImZvcm0tY29udHJvbC1pbnB1dFwiIGNsYXNzPVwiZm9ybS1jb250cm9sLWlucHV0XCI+XG4gICAgICAgICAgPGRpdlxuICAgICAgICAgICAgcGFydD1cImJhc2VcIlxuICAgICAgICAgICAgY2xhc3M9JHtjbGFzc01hcCh7XG4gICAgICByYW5nZTogdHJ1ZSxcbiAgICAgIFwicmFuZ2UtLWRpc2FibGVkXCI6IHRoaXMuZGlzYWJsZWQsXG4gICAgICBcInJhbmdlLS1mb2N1c2VkXCI6IHRoaXMuaGFzRm9jdXMsXG4gICAgICBcInJhbmdlLS1ydGxcIjogdGh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FydEluZm8pIHtcbiAgICAgICAgc3VwZXIocGFydEluZm8pO1xuICAgICAgICBpZiAocGFydEluZm8udHlwZSAhPT0gUGFydFR5cGUuQVRUUklCVVRFIHx8XG4gICAgICAgICAgICBwYXJ0SW5mby5uYW1lICE9PSAnY2xhc3MnIHx8XG4gICAgICAgICAgICBwYXJ0SW5mby5zdHJpbmdzPy5sZW5ndGggPiAyKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ2BjbGFzc01hcCgpYCBjYW4gb25seSBiZSB1c2VkIGluIHRoZSBgY2xhc3NgIGF0dHJpYnV0ZSAnICtcbiAgICAgICAgICAgICAgICAnYW5kIG11c3QgYmUgdGhlIG9ubHkgcGFydCBpbiB0aGUgYXR0cmlidXRlLicpO1xuICAgICAgICB9XG4gICAgfVxuICAgIHJlbmRlcihjbGFzc0luZm8pIHtcbiAgICAgICAgLy8gQWRkIHNwYWNlcyB0byBlbnN1cmUgc2VwYXJhdGlvbiBmcm9tIHN0YXRpYyBjbGFzc2VzXG4gICAgICAgIHJldHVybiAoJyAnICtcbiAgICAgICAgICAgIE9iamVjdC5rZXlzKGNsYXNzSW5mbylcbiAgICAgICAgICAgICAgICAuZmlsdGVyKChrZXkpID0+IGNsYXNzSW5mb1trZXldKVxuICAgICAgICAgICAgICAgIC5qb2luKCcgJykgK1xuICAgICAgICAgICAgJyAnKTtcbiAgICB9XG4gICAgdXBkYXRlKHBhcnQsIFtjbGFzc0luZm9dKSB7XG4gICAgICAgIC8vIFJlbWVtYmVyIGR5bmFtaWMgY2xhc3NlcyBvbiB0aGUgZmlyc3QgcmVuZGVyXG4gICAgICAgIGlmICh0aGlzLl9wcmV2aW91c0NsYXNzZXMgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgdGhpcy5fcHJldmlvdXNDbGFzc2VzID0gbmV3IFNldCgpO1xuICAgICAgICAgICAgaWYgKHBhcnQuc3RyaW5ncyAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fc3RhdGljQ2xhc3NlcyA9IG5ldyBTZXQocGFydC5zdHJpbmdzXG4gICAgICAgICAgICAgICAgICAgIC5qb2luKCcgJylcbiAgICAgICAgICAgICAgICAgICAgLnNwbGl0KC9cXHMvKVxuICAgICAgICAgICAgICAgICAgICAuZmlsdGVyKChzKSA9PiBzICE9PSAnJykpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZm9yIChjb25zdCBuYW1lIGluIGNsYXNzSW5mbykge1xuICAgICAgICAgICAgICAgIGlmIChjbGFzc0luZm9bbmFtZV0gJiYgIXRoaXMuX3N0YXRpY0NsYXNzZXM/LmhhcyhuYW1lKSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9wcmV2aW91c0NsYXNzZXMuYWRkKG5hbWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzLnJlbmRlcihjbGFzc0luZm8pO1xuICAgICAgICB9XG4gICAgICAgIGNvbnN0IGNsYXNzTGlzdCA9IHBhcnQuZWxlbWVudC5jbGFzc0xpc3Q7XG4gICAgICAgIC8vIFJlbW92ZSBvbGQgY2xhc3NlcyB0aGF0IG5vIGxvbmdlciBhcHBseVxuICAgICAgICBmb3IgKGNvbnN0IG5hbWUgb2YgdGhpcy5fcHJldmlvdXNDbGFzc2VzKSB7XG4gICAgICAgICAgICBpZiAoIShuYW1lIGluIGNsYXNzSW5mbykpIHtcbiAgICAgICAgICAgICAgICBjbGFzc0xpc3QucmVtb3ZlKG5hbWUpO1xuICAgICAgICAgICAgICAgIHRoaXMuX3ByZXZpb3VzQ2xhc3Nlcy5kZWxldGUobmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy8gQWRkIG9yIHJlbW92ZSBjbGFzc2VzIGJhc2VkIG9uIHRoZWlyIGNsYXNzTWFwIHZhbHVlXG4gICAgICAgIGZvciAoY29uc3QgbmFtZSBpbiB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JvdyBuZXcgRXJyb3IoJ2BsaXZlYCBiaW5kaW5ncyBjYW4gb25seSBjb250YWluIGEgc2luZ2xlIGV4cHJlc3Npb24nKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICByZW5kZXIodmFsdWUpIHtcbiAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cbiAgICB1cGRhdGUocGFydCwgW3ZhbHVlXSkge1xuICAgICAgICBpZiAodmFsdWUgPT09IG5vQ2hhbmdlIHx8IHZhbHVlID09PSBub3RoaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgIH1cbiAgICAgICAgY29uc3QgZWxlbWVudCA9IHBhcnQuZWxlbWVudDtcbiAgICAgICAgY29uc3QgbmFtZSA9IHBhcnQubmFtZTtcbiAgICAgICAgaWYgKHBhcnQudHlwZSA9PT0gUGFydFR5cGUuUFJPUEVSVFkpIHtcbiAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55XG4gICAgICAgICAgICBpZiAodmFsdWUgPT09IGVsZW1lbnRbbmFtZV0pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm9DaGFuZ2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAocGFydC50eXBlID09PSBQYXJ0VHlwZS5CT09MRUFOX0FUVFJJQlVURSkge1xuICAgICAgICAgICAgaWYgKCEhdmFsdWUgPT09IGVsZW1lbnQuaGFzQXR0cmlidXRlKG5hbWUpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5vQ2hhbmdlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHBhcnQudHlwZSA9PT0gUGFydFR5cGUuQVRUUklCVVRFKSB7XG4gICAgICAgICAgICBpZiAoZWxlbWVudC5nZXRBdHRyaWJ1dGUobmFtZSkgPT09IFN0c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V0KGNvbnRleHQpO1xuICAgICAgICAgICAgaWYgKGxhc3RFbGVtZW50Rm9yQ2FsbGJhY2sgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIGxhc3RFbGVtZW50Rm9yQ2FsbGJhY2sgPSBuZXcgV2Vha01hcCgpO1xuICAgICAgICAgICAgICAgIGxhc3RFbGVtZW50Rm9yQ29udGV4dEFuZENhbGxiYWNrLnNldChjb250ZXh0LCBsYXN0RWxlbWVudEZvckNhbGxiYWNrKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChsYXN0RWxlbWVudEZvckNhbGxiYWNrLmdldCh0aGlzLl9yZWYpICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9yZWYuY2FsbCh0aGlzLl9jb250ZXh0LCB1bmRlZmluZWQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGFzdEVsZW1lbnRGb3JDYWxsYmFjay5zZXQodGhpcy5fcmVmLCBlbGVtZW50KTtcbiAgICAgICAgICAgIC8vIENhbGwgdGhlIHJlZiB3aXRoIHRoZSBuZXcgZWxlbWVudCB2YWx1ZVxuICAgICAgICAgICAgaWYgKGVsZW1lbnQgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIHRoaXMuX3JlZi5jYWxsKHRoaXMuX2NvbnRleHQsIGVsZW1lbnQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5fcmVmLnZhbHVlID0gZWxlbWVudDtcbiAgICAgICAgfVxuICAgIH1cbiAgICBnZXQgX2xhc3RFbGVtZW50Rm9yUmVmKCkge1xuICAgICAgICByZXR1cm4gdHlwZW9mIHRoaXMuX3JlZiA9PT0gJ2Z1bmN0aW9uJ1xuICAgICAgICAgICAgPyBsYXN0RWxlbWVudEZvckNvbnRleHRBbmRDYWxsYmFja1xuICAgICAgICAgICAgICAgIC5nZXQodGhpcy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iAgICAgICAgICAgIC8vIE1ha2Ugc3VyZSB3ZSBzdGFydCBzZWFyY2hpbmcgZnJvbSB3aGVyZSB3ZSBwcmV2aW91c2x5IGxlZnQgb2ZmXG4gICAgICAgICAgICByZWdleC5sYXN0SW5kZXggPSBsYXN0SW5kZXg7XG4gICAgICAgICAgICBtYXRjaCA9IHJlZ2V4LmV4ZWMocyk7XG4gICAgICAgICAgICBpZiAobWF0Y2ggPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxhc3RJbmRleCA9IHJlZ2V4Lmxhc3RJbmRleDtcbiAgICAgICAgICAgIGlmIChyZWdleCA9PT0gdGV4dEVuZFJlZ2V4KSB7XG4gICAgICAgICAgICAgICAgaWYgKG1hdGNoW0NPTU1FTlRfU1RBUlRdID09PSAnIS0tJykge1xuICAgICAgICAgICAgICAgICAgICByZWdleCA9IGNvbW1lbnRFbmRSZWdleDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAobWF0Y2hbQ09NTUVOVF9TVEFSVF0gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAvLyBXZSBzdGFydGVkIGEgd2VpcmQgY29tbWVudCwgbGlrZSA8L3tcbiAgICAgICAgICAgICAgICAgICAgcmVnZXggPSBjb21tZW50MkVuZFJlZ2V4O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChtYXRjaFtUQUdfTkFNRV0gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAocmF3VGV4dEVsZW1lbnQudGVzdChtYXRjaFtUQUdfTkFNRV0pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBSZWNvcmQgaWYgd2UgZW5jb3VudGVyIGEgcmF3LXRleHQgZWxlbWVudC4gV2UnbGwgc3dpdGNoIHRvXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIHJlZ2V4IGF0IHRoZSBlbmQgb2YgdGhlIHRhZy5cbiAgICAgICAgICAgICAgICAgICAgICAgIHJhd1RleHRFbmRSZWdleCA9IG5ldyBSZWdFeHAoYDwvJHttYXRjaFtUQUdfTkFNRV19YCwgJ2cnKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZWdleCA9IHRhZ0VuZFJlZ2V4O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChtYXRjaFtEWU5BTUlDX1RBR19OQU1FXSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChERVZfTU9ERSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdCaW5kaW5ncyBpbiB0YWcgbmFtZXMgYXJlIG5vdCBzdXBwb3J0ZWQuIFBsZWFzZSB1c2Ugc3RhdGljIHRlbXBsYXRlcyBpbnN0ZWFkLiAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnU2VlIGh0dHBzOi8vbGl0LmRldi9kb2NzL3RlbXBsYXRlcy9leHByZXNzaW9ucy8jc3RhdGljLWV4cHJlc3Npb25zJyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmVnZXggPSB0YWdFbmRSZWdleDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChyZWdleCA9PT0gdGFnRW5kUmVnZXgpIHtcbiAgICAgICAgICAgICAgICBpZiAobWF0Y2hbRU5USVJFX01BVENIXSA9PT0gJz4nKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIEVuZCBvZiBhIHRhZy4gSWYgd2UgaGFkIHN0YXJ0ZWQgYSByYXctdGV4dCBlbGVtZW50LCB1c2UgdGhhdFxuICAgICAgICAgICAgICAgICAgICAvLyByZWdleFxuICAgICAgICAgICAgICAgICAgICByZWdleCA9IHJhd1RleHRFbmRSZWdleCA/PyB0ZXh0RW5kUmVnZXg7XG4gICAgICAgICAgICAgICAgICAgIC8vIFdlIG1heSBiZSBlbmRpbmcgYW4gdW5xdW90ZWQgYXR0cmlidXRlIHZhbHVlLCBzbyBtYWtlIHN1cmUgd2VcbiAgICAgICAgICAgICAgICAgICAgLy8gY2xlYXIgYW55IHBlbmRpbmcgYXR0ck5hbWVFbmRJbmRleFxuICAgICAgICAgICAgICAgICAgICBhdHRyTmFtZUVuZEluZGV4ID0gLTE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKG1hdGNoW0FUVFJJQlVURV9OQU1FXSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIEF0dHJpYnV0ZSBuYW1lIHBvc2l0aW9uXG4gICAgICAgICAgICAgICAgICAgIGF0dHJOYW1lRW5kSW5kZXggPSAtMjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGF0dHJOYW1lRW5kSW5kZXggPSByZWdleC5sYXN0SW5kZXggLSBtYXRjaFtTUEFDRVNfQU5EX0VRVUFMU10ubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICBhdHRyTmFtZSA9IG1hdGNoW0FUVFJJQlVURV9OQU1FXTtcbiAgICAgICAgICAgICAgICAgICAgcmVnZXggPVxuICAgICAgICAgICAgICAgICAgICAgICAgbWF0Y2hbUVVPVEVfQ0hBUl0gPT09IHVuZGVmaW5lZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdGFnRW5kUmVnZXhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1hdGNoW1FVT1RFX0NIQVJdID09PSAnXCInXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZG91YmxlUXVvdGVBdHRyRW5kUmVnZXhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBzaW5nbGVRdW90ZUF0dHJFbmRSZWdleDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChyZWdleCA9PT0gZG91YmxlUXVvdGVBdHRyRW5kUmVnZXggfHxcbiAgICAgICAgICAgICAgICByZWdleCA9PT0gc2luZ2xlUXVvdGVBdHRyRW5kUmVnZXgpIHtcbiAgICAgICAgICAgICAgICByZWdleCA9IHRhZ0VuZFJlZ2V4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAocmVnZXggPT09IGNvbW1lbnRFbmRSZWdleCB8fCByZWdleCA9PT0gY29tbWVudDJFbmRSZWdleCkge1xuICAgICAgICAgICAgICAgIHJlZ2V4ID0gdGV4dEVuZFJlZ2V4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gTm90IG9uZSBvZiB0aGUgZml2ZSBzdGF0ZSByZWdleGVzLCBzbyBpdCBtdXN0IGJlIHRoZSBkeW5hbWljYWxseVxuICAgICAgICAgICAgICAgIC8vIGNyZWF0ZWQgcmF3IHRleHQgcmVnZXggYW5kIHdlJ3JlIGF0IHRoZSBjbG9zZSBvZiB0aGF0IGVsZW1lbnQuXG4gICAgICAgICAgICAgICAgcmVnZXggPSB0YWdFbmRSZWdleDtcbiAgICAgICAgICAgICAgICByYXdUZXh0RW5kUmVnZXggPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKERFVl9NT0RFKSB7XG4gICAgICAgICAgICAvLyBJZiB3ZSBoYXZlIGEgYXR0ck5hbWVFbmRJbmRleCwgd2hpY2ggaW5kaWNhdGVzIHRoYXQgd2Ugc2hvdWxkXG4gICAgICAgICAgICAvLyByZXdyaXRlIHRoZSBhdHRyaWJ1dGUgbmFtZSwgYXNzZXJ0IHRoYXQgd2UncmUgaW4gYSB2YWxpZC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3ZSdyZSBpbiBhdHRyaWJ1dGUgbmFtZVxuICAgICAgICAvLyAgICAgcG9zaXRpb24gKGF0dHJOYW1lRW5kSW5kZXggPT09IC0yKSwgYWRkIGEgc2VxdWVudGlhbCBzdWZmaXggdG9cbiAgICAgICAgLy8gICAgIGdlbmVyYXRlIGEgdW5pcXVlIGF0dHJpYnV0ZSBuYW1lLlxuICAgICAgICAvLyBEZXRlY3QgYSBiaW5kaW5nIG5leHQgdG8gc2VsZi1jbG9zaW5nIHRhZyBlbmQgYW5kIGluc2VydCBhIHNwYWNlIHRvXG4gICAgICAgIC8vIHNlcGFyYXRlIHRoZSBtYXJrZXIgZnJvbSB0aGUgdGFnIGVuZDpcbiAgICAgICAgY29uc3QgZW5kID0gcmVnZXggPT09IHRhZ0VuZFJlZ2V4ICYmIHN0cmluZ3NbaSArIDFdLnN0YXJ0c1dpdGgoJy8+JykgPyAnICcgOiAnJztcbiAgICAgICAgaHRtbCArPVxuICAgICAgICAgICAgcmVnZXggPT09IHRleHRFbmRSZWdleFxuICAgICAgICAgICAgICAgID8gcyArIG5vZGVNYXJrZXJcbiAgICAgICAgICAgICAgICA6IGF0dHJOYW1lRW5kSW5kZXggPj0gMFxuICAgICAgICAgICAgICAgICAgICA/IChhdHRyTmFtZXMucHVzaChhdHRyTmFtZSksXG4gICAgICAgICAgICAgICAgICAgICAgICBzLnNsaWNlKDAsIGF0dHJOYW1lRW5kSW5kZXgpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3VuZEF0dHJpYnV0ZVN1ZmZpeCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcy5zbGljZShhdHRyTmFtZUVuZEluZGV4KSkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgbWFya2VyICtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVuZFxuICAgICAgICAgICAgICAgICAgICA6IHMgKyBtYXJrZXIgKyAoYXR0ck5hbWVFbmRJbmRleCA9PT0gLTIgPyBpIDogZW5kKTtcbi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Xx0ZW1wbGF0ZSkkL2kudGVzdCh0YWcpICYmXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLmlubmVySFRNTC5pbmNsdWRlcyhtYXJrZXIpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBtID0gYEV4cHJlc3Npb25zIGFyZSBub3Qgc3VwcG9ydGVkIGluc2lkZSBcXGAke3RhZ31cXGAgYCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYGVsZW1lbnRzLiBTZWUgaHR0cHM6Ly9saXQuZGV2L21zZy9leHByZXNzaW9uLWluLSR7dGFnfSBmb3IgbW9yZSBgICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBgaW5mb3JtYXRpb24uYDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0YWcgPT09ICd0ZW1wbGF0ZScpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IobSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNzdWVXYXJuaW5nKCcnLCBtKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBUT0RPIChqdXN0aW5mYWduYW5pKTogZm9yIGF0dGVtcHRlZCBkeW5hbWljIHRhZyBuYW1lcywgd2UgZG9uJ3RcbiAgICAgICAgICAgICAgICAvLyBpbmNyZW1lbnQgdGhlIGJpbmRpbmdJbmRleCwgYW5kIGl0J2xsIGJlIG9mZiBieSAxIGluIHRoZSBlbGVtZW50XG4gICAgICAgICAgICAgICAgLy8gYW5kIG9mZiBieSB0d28gYWZ0ZXIgaXQuXG4gICAgICAgICAgICAgICAgaWYgKG5vZGUuaGFzQXR0cmlidXRlcygpKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAoY29uc3QgbmFtZSBvZiBub2RlLmdldEF0dHJpYnV0ZU5hbWVzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuYW1lLmVuZHNXaXRoKGJvdW5kQXR0cmlidXRlU3VmZml4KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHJlYWxOYW1lID0gYXR0ck5hbWVzW2F0dHJOYW1lSW5kZXgrK107XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSBub2RlLmdldEF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzdGF0aWNzID0gdmFsdWUuc3BsaXQobWFya2VyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBtID0gLyhbLj9AXSk/KC4qKS8uZXhlYyhyZWFsTmFtZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IEFUVFJJQlVURV9QQVJULFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogbm9kZUluZGV4LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBtWzJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmdzOiBzdGF0aWNzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdG9yOiBtWzFdID09PSAnLidcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUHJvcGVydHlQYXJ0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICc/J1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQm9vbGVhbkF0dHJpYnV0ZVBhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICdAJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IEV2ZW50UGFydFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IEF0dHJpYnV0ZVBhcnQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5yZW1vdmVBdHRyaWJ1dGUobmFtZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChuYW1lLnN0YXJ0c1dpdGgobWFya2VyKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnRzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBFTEVNRU5UX1BBUlQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBub2RlSW5kZXgsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5yZW1vdmVBdHRyaWJ1dGUobmFtZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gVE9ETyAoanVzdGluZmFnbmFuaSk6IGJlbmNobWFyayB0aGUgcmVnZXggYWdhaW5zdCB0ZXN0aW5nIGZvciBlYWNoXG4gICAgICAgICAgICAgICAgLy8gb2YgdGhlIDMgcmF3IHRleHQgZWxlbWVudCBuYW1lcy5cbiAgICAgICAgICAgICAgICBpZiAocmF3VGV4dEVsZW1lbnQudGVzdChub2RlLnRhZ05hbWUpKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIEZvciByYXcgdGV4dCBlbGVtZW50cyB3ZSBuZWVkIHRvIHNwbGl0IHRoZSB0ZXh0IGNvbnRlbnQgb25cbiAgICAgICAgICAgICAgICAgICAgLy8gbWFya2VycywgY3JlYXRlIGEgVGV4dCBub2RlIGZvciBlYWNoIHNlZ21lbnQsIGFuZCBjcmVhdGVcbiAgICAgICAgICAgICAgICAgICAgLy8gYSBUZW1wbGF0ZVBhcnQgZm9yIGVhY2ggbWFya2VyLlxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzdHJpbmdzID0gbm9kZS50ZXh0Q29udGVudC5zcGxpdChtYXJrZXIpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBsYXN0SW5kZXggPSBzdHJpbmdzLmxlbmd0aCAtIDE7XG4gICAgICAgICAgICAgICAgICAgIGlmIChsYXN0SW5kZXggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLnRleHRDb250ZW50ID0gdHJ1c3RlZFR5cGVzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVzdGVkVHlwZXMuZW1wdHlTY3JpcHRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICcnO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gR2VuZXJhdGUgYSBuZXcgdGV4dCBub2RlIGZvciBlYWNoIGxpdGVyYWwgc2VjdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhlc2Ugbm9kZXMgYXJlIGFsc28gdXNlZCBhcyB0aGUgbWFya2VycyBmb3Igbm9kZSBwYXJ0c1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2UgY2FuJ3QgdXNlIGVtcHR5IHRleHQgbm9kZXMgYXMgbWFya2VycyBiZWNhdXNlIHRoZXkncmVcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vcm1hbGl6ZWQgd2hlbiBjbG9uaW5nIGluIElFIChjb3VsZCBzaW1wbGlmeSB3aGVuXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBJRSBpcyBubyBsb25nZXIgc3VwcG9ydGVkKVxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBsYXN0SW5kZXg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUuYXBwZW5kKHN0cmluZ3NbaV0sIGNyZWF0ZU1hcmtlcigpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBXYWxrIHBhc3QgdGhlIG1hcmtlciBub2RlIHdlIGp1c3QgYWRkZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3YWxrZXIubmV4dE5vZGUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHsgdHlwZTogQ0hJTERfUEFSVCwgaW5kZXg6ICsrbm9kZUluZGV4IH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gTm90ZSBiZWNhdXNlIHRoaXMgbWFya2VyIGlzIGFkZGVkIGFmdGVyIHRoZSB3YWxrZXIncyBjdXJyZW50XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBub2RlLCBpdCB3aWxsIGJlIHdhbGtlZCB0byBpbiB0aGUgb3V0ZXIgbG9vcCAoYW5kIGlnbm9yZWQpLCBzb1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2UgZG9uJ3QgbmVlZCB0byBhZGp1c3Qgbm9kZUluZGV4IGhlcmVcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUuYXBwZW5kKHN0cmluZ3NbbGFzdEluZGV4XSwgY3JlYXRlTWFya2VyKCkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAobm9kZS5ub2RlVHlwZSA9PT0gOCkge1xuICAgICAgICAgICAgICAgIGNvbnN0IGRhdGEgPSBub2RlLmRhdGE7XG4gICAgICAgICAgICAgICAgaWYgKGRhdGEgPT09IG1hcmtlck1hdGNoKSB7XG4gICAgICAgICAgICAgICAgICAgIHBhcnRzLnB1c2goeyB0eXBlOiBDSElMRF9QQVJULCBpbmRleDogbm9kZUluZGV4IH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGkgPSAtMTtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKChpID0gbm9kZS5kYXRhLmluZGV4T2YobWFya2VyLCBpICsgMSkpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gQ29tbWVudCBub2RlIGhhcyBhIGJpbmRpbmcgbWFya2VyIGluc2lkZSwgbWFrZSBhbiBpbmFjdGl2ZSBwYXJ0XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGUgYmluZGluZyB3b24ndCB3b3JrLCBidXQgc3Vic2VxdWVudCBiaW5kaW5ncyB3aWxsXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHsgdHlwZTogQ09NTUVOVF9QQVJULCBpbmRleDogbm9kZUluZGV4IH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gTW92ZSB0byB0aGUgZW5kIG9mIHRoZSBtYXRjaFxuICAgICAgICAgICAgICAgICAgICAgICAgaSArPSBtYXJrZXIubGVuZ3RoIC0gMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG5vZGVJbmRleCsrO1xuICAgICAgICB9XG4gICAgICAgIGlmIChERVZfTU9ERSkge1xuICAgICAgICAgICAgLy8gSWYgdGhlcmUgd2FzIGEgZHVwbGljYXRlIGF0dHJpYnV0ZSBvbiBhIHRhZywgdGhlbiB3aGVuIHRoZSB0YWcgaXNcbiAgICAgICAgICAgIC8vIHBhcnNlZCBpbnRvIGFuIGVsZW1lbnQgdGhlIGF0dHJpYnV0ZSBnZXRzIGRlLWR1cGxpY2F0ZWQuIFdlIGNhbiBkZXRlY3RcbiAgICAgICAgICAgIC8vIHRoaXMgbWlzbWF0Y2ggaWYgd2UgaGF2ZW4nd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9IHdhbGtlci5uZXh0Tm9kZSgpO1xuICAgICAgICBsZXQgbm9kZUluZGV4ID0gMDtcbiAgICAgICAgbGV0IHBhcnRJbmRleCA9IDA7XG4gICAgICAgIGxldCB0ZW1wbGF0ZVBhcnQgPSBwYXJ0c1swXTtcbiAgICAgICAgd2hpbGUgKHRlbXBsYXRlUGFydCAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICBpZiAobm9kZUluZGV4ID09PSB0ZW1wbGF0ZVBhcnQuaW5kZXgpIHtcbiAgICAgICAgICAgICAgICBsZXQgcGFydDtcbiAgICAgICAgICAgICAgICBpZiAodGVtcGxhdGVQYXJ0LnR5cGUgPT09IENISUxEX1BBUlQpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFydCA9IG5ldyBDaGlsZFBhcnQobm9kZSwgbm9kZS5uZXh0U2libGluZywgdGhpcywgb3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHRlbXBsYXRlUGFydC50eXBlID09PSBBVFRSSUJVVEVfUEFSVCkge1xuICAgICAgICAgICAgICAgICAgICBwYXJ0ID0gbmV3IHRlbXBsYXRlUGFydC5jdG9yKG5vZGUsIHRlbXBsYXRlUGFydC5uYW1lLCB0ZW1wbGF0ZVBhcnQuc3RyaW5ncywgdGhpcywgb3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHRlbXBsYXRlUGFydC50eXBlID09PSBFTEVNRU5UX1BBUlQpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFydCA9IG5ldyBFbGVtZW50UGFydChub2RlLCB0aGlzLCBvcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5fJHBhcnRzLnB1c2gocGFydCk7XG4gICAgICAgICAgICAgICAgdGVtcGxhdGVQYXJ0ID0gcGFydHNbKytwYXJ0SW5kZXhdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG5vZGVJbmRleCAhPT0gdGVtcGxhdGVQYXJ0Py5pbmRleCkge1xuICAgICAgICAgICAgICAgIG5vZGUgPSB3YWxrZXIubmV4dE5vZGUoKTtcbiAgICAgICAgICAgICAgICBub2RlSW5kZXgrKztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvLyBXZSBuZWVkIHRvIHNldCB0aGUgY3VycmVudE5vZGUgYXdheSBmcm9tIHRoZSBjbG9uZWQgdHJlZSBzbyB0aGF0IHdlXG4gICAgICAgIC8vIGRvbid0IGhvbGQgb250byB0aGUgdHJlZSBldmVuIGlmIHRoZSB0cmVlIGlzIGRldGFjaGVkIGFuZCBzaG91bGQgYmVcbiAgICAgICAgLy8gZnJlZWQuXG4gICAgICAgIHdhbGtlci5jdXJyZW50Tm9kZSA9IGQ7XG4gICAgICAgIHJldHVybiBmcmFnbWVudDtcbiAgICB9XG4gICAgX3VwZGF0ZSh2YWx1ZXMpIHtcbiAgICAgICAgbGV0IGkgPSAwO1xuICAgICAgICBmb3IgKGNvbnN0IHBhcnQgb2YgdGhpcy5fJHBhcnRzKSB7XG4gICAgICAgICAgICBpZiAocGFydCAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgZGVidWdMb2dFdmVudCAmJlxuICAgICAgICAgICAgICAgICAgICBkZWJ1Z0xvZ0V2ZW50KHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGtpbmQ6ICdzZXQgcGFydCcsXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJ0LFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHZhbHVlc1tpXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlSW5kZXg6IGksXG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZXMsXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZUluc3RhbmNlOiB0aGlzLFxuICAgICAgICAgICAgICAgICAgICB9KT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cXGAgb3IgXFxgdGV4dENvbnRlbnRcXGAgY2FuIGRvIHRoaXMuYCk7XG4gICAgICAgIH1cbiAgICAgICAgdmFsdWUgPSByZXNvbHZlRGlyZWN0aXZlKHRoaXMsIHZhbHVlLCBkaXJlY3RpdmVQYXJlbnQpO1xuICAgICAgICBpZiAoaXNQcmltaXRpdmUodmFsdWUpKSB7XG4gICAgICAgICAgICAvLyBOb24tcmVuZGVyaW5nIGNoaWxkIHZhbHVlcy4gSXQncyBpbXBvcnRhbnQgdGhhdCB0aGVzZSBkbyBub3QgcmVuZGVyXG4gICAgICAgICAgICAvLyBlbXB0eSB0ZXh0IG5vZGVzIHRvIGF2b2lkIGlzc3VlcyB3aXRoIHByZXZlbnRpbmcgZGVmYXVsdCA8c2xvdD5cbiAgICAgICAgICAgIC8vIGZhbGxiYWNrIGNvbnRlbnQuXG4gICAgICAgICAgICBpZiAodmFsdWUgPT09IG5vdGhpbmcgfHwgdmFsdWUgPT0gbnVsbCB8fCB2YWx1ZSA9PT0gJycpIHtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5fJGNvbW1pdHRlZFZhbHVlICE9PSBub3RoaW5nKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlYnVnTG9nRXZlbnQgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlYnVnTG9nRXZlbnQoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtpbmQ6ICdjb21taXQgbm90aGluZyB0byBjaGlsZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQ6IHRoaXMuXyRzdGFydE5vZGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5kOiB0aGlzLl8kZW5kTm9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnQ6IHRoaXMuXyRwYXJlbnQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9uczogdGhpcy5vcHRpb25zLFxuICAgICAgICAgICAgICAgICAgICAgIC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uYWwgIT09IG5vb3BTYW5pdGl6ZXIpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBwYXJlbnROb2RlTmFtZSA9IHRoaXMuXyRzdGFydE5vZGUucGFyZW50Tm9kZT8ubm9kZU5hbWU7XG4gICAgICAgICAgICAgICAgaWYgKHBhcmVudE5vZGVOYW1lID09PSAnU1RZTEUnIHx8IHBhcmVudE5vZGVOYW1lID09PSAnU0NSSVBUJykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9ICdGb3JiaWRkZW4nO1xuICAgICAgICAgICAgICAgICAgICBpZiAoREVWX01PREUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwYXJlbnROb2RlTmFtZSA9PT0gJ1NUWUxFJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgTGl0IGRvZXMgbm90IHN1cHBvcnQgYmluZGluZyBpbnNpZGUgc3R5bGUgbm9kZXMuIGAgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYFRoaXMgaXMgYSBzZWN1cml0eSByaXNrLCBhcyBzdHlsZSBpbmplY3Rpb24gYXR0YWNrcyBjYW4gYCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgZXhmaWx0cmF0ZSBkYXRhIGFuZCBzcG9vZiBVSXMuIGAgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYENvbnNpZGVyIGluc3RlYWQgdXNpbmcgY3NzXFxgLi4uXFxgIGxpdGVyYWxzIGAgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYHRvIGNvbXBvc2Ugc3R5bGVzLCBhbmQgbWFrZSBkbyBkeW5hbWljIHN0eWxpbmcgd2l0aCBgICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGBjc3MgY3VzdG9tIHByb3BlcnRpZXMsIDo6cGFydHMsIDxzbG90PnMsIGAgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYGFuZCBieSBtdXRhdGluZyB0aGUgRE9NIHJhdGhlciB0aGFuIHN0eWxlc2hlZXRzLmA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYExpdCBkb2VzIG5vdCBzdXBwb3J0IGJpbmRpbmcgaW5zaWRlIHNjcmlwdCBub2Rlcy4gYCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgVGhpcyBpcyBhIHNlY3VyaXR5IHJpc2ssIGFzIGl0IGNvdWxkIGFsbG93IGFyYml0cmFyeSBgICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGBjb2RlIGV4ZWN1dGlvbi5gO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkZWJ1Z0xvZ0V2ZW50ICYmXG4gICAgICAgICAgICAgICAgZGVidWdMb2dFdmVudCh7XG4gICAgICAgICAgICAgICAgICAgIGtpbmQ6ICdjb21taXQgbm9kZScsXG4gICAgICAgICAgICAgICAgICAgIHN0YXJ0OiB0aGlzLl8kc3RhcnROb2RlLFxuICAgICAgICAgICAgICAgICAgICBwYXJlbnQ6IHRoaXMuXyRwYXJlbnQsXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uczogdGhpcy5vcHRpb25zLFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgdGhpcy5f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b2dFdmVudCh7XG4gICAgICAgICAgICAgICAgICAgIGtpbmQ6ICdjb21taXQgdGV4dCcsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlLFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zOiB0aGlzLm9wdGlvbnMsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBub2RlLmRhdGEgPSB2YWx1ZTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGlmIChFTkFCTEVfRVhUUkFfU0VDVVJJVFlfSE9PS1MpIHtcbiAgICAgICAgICAgICAgICBjb25zdCB0ZXh0Tm9kZSA9IGQuY3JlYXRlVGV4dE5vZGUoJycpO1xuICAgICAgICAgICAgICAgIHRoaXMuX2NvbW1pdE5vZGUodGV4dE5vZGUpO1xuICAgICAgICAgICAgICAgIC8vIFdoZW4gc2V0dGluZyB0ZXh0IGNvbnRlbnQsIGZvciBzZWN1cml0eSBwdXJwb3NlcyBpdCBtYXR0ZXJzIGEgbG90XG4gICAgICAgICAgICAgICAgLy8gd2hhdCB0aGUgcGFyZW50IGlzLiBGb3IgZXhhbXBsZSwgPHN0eWxlPiBhbmQgPHNjcmlwdD4gbmVlZCB0byBiZVxuICAgICAgICAgICAgICAgIC8vIGhhbmRsZWQgd2l0aCBjYXJlLCB3aGlsZSA8c3Bhbj4gZG9lcyBub3QuIFNvIGZpcnN0IHdlIG5lZWQgdG8gcHV0IGFcbiAgICAgICAgICAgICAgICAvLyB0ZXh0IG5vZGUgaW50byB0aGUgZG9jdW1lbnQsIHRoZW4gd2UgY2FuIHNhbml0aXplIGl0cyBjb250ZW50LlxuICAgICAgICAgICAgICAgIGlmICh0aGlzLl90ZXh0U2FuaXRpemVyID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fdGV4dFNhbml0aXplciA9IGNyZWF0ZVNhbml0aXplcih0ZXh0Tm9kZSwgJ2RhdGEnLCAncHJvcGVydHknKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFsdWUgPSB0aGlzLl90ZXh0U2FuaXRpemVyKHZhbHVlKTtcbiAgICAgICAgICAgICAgICBkZWJ1Z0xvZ0V2ZW50ICYmXG4gICAgICAgICAgICAgICAgICAgIGRlYnVnTG9nRXZlbnQoe1xuICAgICAgICAgICAgICAgICAgICAgICAga2luZDogJ2NvbW1pdCB0ZXh0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGU6IHRleHROb2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zOiB0aGlzLm9wdGlvbnMsXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHRleHROb2RlLmRhdGEgPSB2YWx1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuX2NvbW1pdE5vZGUoZC5jcmVhdGVUZXh0Tm9kZSh2YWx1ZSkpO1xuICAgICAgICAgICAgICAgIGRlYnVnTG9nRXZlbnQgJiZcbiAgICAgICAgICAgICAgICAgICAgZGVidWdMb2dFdmVudCh7XG4gICAgICAgICAgICAgICAgICAgICAgICBraW5kOiAnY29tbWl0IHRleHQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZTogd3JhcCh0aGlzLl8kc3RhcnROb2RlKS5uZXh0U2libGluZyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9uczogdGhpcy5vcHRpb25zLFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aGlzLl8kY29tbWl0dGVkVmFsdWUgPSB2YWx1ZTtcbiAgICB9XG4gICAgX2NvbW1pdFRlbXBsYXRlUmVzdW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BkZWJ1Z0xvZ0V2ZW50KHtcbiAgICAgICAgICAgICAgICAgICAga2luZDogJ3RlbXBsYXRlIHVwZGF0aW5nJyxcbiAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGUsXG4gICAgICAgICAgICAgICAgICAgIGluc3RhbmNlOiB0aGlzLl8kY29tbWl0dGVkVmFsdWUsXG4gICAgICAgICAgICAgICAgICAgIHBhcnRzOiB0aGlzLl8kY29tbWl0dGVkVmFsdWUuXyRwYXJ0cyxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uczogdGhpcy5vcHRpb25zLFxuICAgICAgICAgICAgICAgICAgICB2YWx1ZXMsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB0aGlzLl8kY29tbWl0dGVkVmFsdWUuX3VwZGF0ZSh2YWx1ZXMpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgY29uc3QgaW5zdGFuY2UgPSBuZXcgVGVtcGxhdGVJbnN0YW5jZSh0ZW1wbGF0ZSwgdGhpcyk7XG4gICAgICAgICAgICBjb25zdCBmcmFnbWVudCA9IGluc3RhbmNlLl9jbG9uZSh0aGlzLm9wdGlvbnMpO1xuICAgICAgICAgICAgZGVidWdMb2dFdmVudCAmJlxuICAgICAgICAgICAgICAgIGRlYnVnTG9nRXZlbnQoe1xuICAgICAgICAgICAgICAgICAgICBraW5kOiAndGVtcGxhdGUgaW5zdGFudGlhdGVkJyxcbiAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGUsXG4gICAgICAgICAgICAgICAgICAgIGluc3RhbmNlLFxuICAgICAgICAgICAgICAgICAgICBwYXJ0czogaW5zdGFuY2UuXyRwYXJ0cyxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uczogdGhpcy5vcHRpb25zLFxuICAgICAgICAgICAgICAgICAgICBmcmFnbWVudCxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWVzLFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgaW5zdGFuY2UuX3VwZGF0ZSh2YWx1ZXMpO1xuICAgICAgICAgICAgZGVidWdMb2dFdmVudCAmJlxuICAgICAgICAgICAgICAgIGRlYnVnTG9nRXZlbnQoe1xuICAgICAgICAgICAgICAgICAgICBraW5kOiAndGVtcGxhdGUgaW5zdGFudGlhdGVkIGFuZCB1cGRhdGVkJyxcbiAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGUsXG4gICAgICAgICAgICAgICAgICAgIGluc3RhbmNlLFxuICAgICAgICAgICAgICAgICAgICBwYXJ0czogaW5zdGFuY2UuXyRwYXJ0cyxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uczogdGhpcy5vcHRpb25zLFxuICAgICAgICAgICAgICAgICAgICBmcmFnbWVudCxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWVzLFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgdGhpcy5fY29tbWl0Tm9kZShmcmFnbWVudCk7XG4gICAgICAgICAgICB0aGlzLl8kY29tbWl0dGVkVmFsdWUgPSBpbnN0YW5jZTtcbiAgICAgICAgfVxuICAgIH1cbiAgICAvLyBPdmVycmlkZGVuIHZpYSBgbGl0SHRtbFBvbHlmaWxsU3VwcG9ydGAgdG8gcHJvdmlkZSBwbGF0Zm9ybSBzdXBwb3J0LlxuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICBfJGdldFRlbXBsYXRlKHJlc3VsdCkge1xuICAgICAgICBsZXQgdGVtcGxhdGUgPSB0ZW1wbGF0ZUNhY2hlLmdldChyZXN1bHQuc3RyaW5ncyk7XG4gICAgICAgIGlmICh0ZW1wbGF0ZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICB0ZW1wbGF0ZUNhY2hlLnNldChyZXN1bHQuc3RyaW5ncywgKHRlbXBsYXRlID0gbmV3IFRlbXBsYXRlKHJlc3VsdCkpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGVtcGxhdGU7XG4gICAgf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tcbiAgICAgICAgICAgICAgICB2ID0gcmVzb2x2ZURpcmVjdGl2ZSh0aGlzLCB2YWx1ZXNbdmFsdWVJbmRleCArIGldLCBkaXJlY3RpdmVQYXJlbnQsIGkpO1xuICAgICAgICAgICAgICAgIGlmICh2ID09PSBub0NoYW5nZSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgdXNlci1wcm92aWRlZCB2YWx1ZSBpcyBgbm9DaGFuZ2VgLCB1c2UgdGhlIHByZXZpb3VzIHZhbHVlXG4gICAgICAgICAgICAgICAgICAgIHYgPSB0aGlzLl8kY29tbWl0dGVkVmFsdWVbaV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNoYW5nZSB8fD1cbiAgICAgICAgICAgICAgICAgICAgIWlzUHJpbWl0aXZlKHYpIHx8IHYgIT09IHRoaXMuXyRjb21taXR0ZWRWYWx1ZVtpXTtcbiAgICAgICAgICAgICAgICBpZiAodiA9PT0gbm90aGluZykge1xuICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IG5vdGhpbmc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHZhbHVlICE9PSBub3RoaW5nKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlICs9ICh2ID8/ICcnKSArIHN0cmluZ3NbaSArIDFdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBXZSBhbHdheXMgcmVjb3JkIGVhY2ggdmFsdWUsIGV2ZW4gaWYgb25lIGlzIGBub3RoaW5nYCwgZm9yIGZ1dHVyZVxuICAgICAgICAgICAgICAgIC8vIGNoYW5nZSBkZXRlY3Rpb24uXG4gICAgICAgICAgICAgICAgdGhpcy5fJGNvbW1pdHRlZFZhbHVlW2ldID0gdjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoY2hhbmdlICYmICFub0NvbW1pdCkge1xuICAgICAgICAgICAgdGhpcy5fY29tbWl0VmFsdWUodmFsdWUpO1xuICAgICAgICB9XG4gICAgfVxuICAgIC8qKiBAaW50ZXJuYWwgKi9cbiAgICBfY29tbWl0VmFsdWUodmFsdWUpIHtcbiAgICAgICAgaWYgKHZhbHVlID09PSBub3RoaW5nKSB7XG4gICAgICAgICAgICB3cmFwKHRoaXMuZWxlbWVudCkucmVtb3ZlQXR0cmlidXRlKHRoaXMubmFtZSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBpZiAoRU5BQkxFX0VYVFJBX1NFQ1VSSVRZX0hPT0tTKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuX3Nhbml0aXplciA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3Nhbml0aXplciA9IHNhbml0aXplckZhY3RvcnlJbnRlcm5hbCh0aGlzLmVsZW1lbnQsIHRoaXMubmFtZSwgJ2F0dHJpYnV0ZScpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YWx1ZSA9IHRoaXMuX3Nhbml0aXplcih2YWx1ZSA/PyAnJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkZWJ1Z0xvZ0V2ZW50ICYmXG4gICAgICAgICAgICAgICAgZGVidWdMb2dFdmVudCh7XG4gICAgICAgICAgICAgICAgICAgIGtpbmQ6ICdjb21taXQgYXR0cmlidXRlJyxcbiAgICAgICAgICAgICAgICAgICAgZWxlbWVudDogdGhpcy5lbGVtZW50LFxuICAgICAgICAgICAgICAgICAgICBuYW1lOiB0aGlzLm5hbWUsXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlLFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zOiB0aGlzLm9wdGlvbnMsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB3cmFwKHRoaXMuZWxlbWVudCkuc2V0QXR0cmlidXRlKHRoaXMubmFtZSwgKHZhbHVlID8/ICcnKSk7X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HByb3BlcnRpZXMgb2YgbnVsbCAocmVhZGluZ1xuICAgICAgICAvLyAgICAgJ18kbGl0UGFydCQnKVxuICAgICAgICAvLyB3aGljaCByZWFkcyBsaWtlIGFuIGludGVybmFsIExpdCBlcnJvci5cbiAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcihgVGhlIGNvbnRhaW5lciB0byByZW5kZXIgaW50byBtYXkgbm90IGJlICR7Y29udGFpbmVyfWApO1xuICAgIH1cbiAgICBjb25zdCByZW5kZXJJZCA9IERFVl9NT0RFID8gZGVidWdMb2dSZW5kZXJJZCsrIDogMDtcbiAgICBjb25zdCBwYXJ0T3duZXJOb2RlID0gb3B0aW9ucz8ucmVuZGVyQmVmb3JlID8/IGNvbnRhaW5lcjtcbiAgICAvLyBUaGlzIHByb3BlcnR5IG5lZWRzIHRvIHJlbWFpbiB1bm1pbmlmaWVkLlxuICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55XG4gICAgbGV0IHBhcnQgPSBwYXJ0T3duZXJOb2RlWydfJGxpdFBhcnQkJ107XG4gICAgZGVidWdMb2dFdmVudCAmJlxuICAgICAgICBkZWJ1Z0xvZ0V2ZW50KHtcbiAgICAgICAgICAgIGtpbmQ6ICdiZWdpbiByZW5kZXInLFxuICAgICAgICAgICAgaWQ6IHJlbmRlcklkLFxuICAgICAgICAgICAgdmFsdWUsXG4gICAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgICBvcHRpb25zLFxuICAgICAgICAgICAgcGFydCxcbiAgICAgICAgfSk7XG4gICAgaWYgKHBhcnQgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICBjb25zdCBlbmROb2RlID0gb3B0aW9ucz8ucmVuZGVyQmVmb3JlID8/IG51bGw7XG4gICAgICAgIC8vIFRoaXMgcHJvcGVydHkgbmVlZHMgdG8gcmVtYWluIHVubWluaWZpZWQuXG4gICAgICAgIC8vIGV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3JvdW5kJyxcbiAgICogICAgICAgICAgICAgICAgICAgICBzcmM6ICdzdW5zZXQucG5nJyxcbiAgICogICAgICAgICAgICAgICAgIH0sXG4gICAqICAgICAgICAgICAgICAgICB7XG4gICAqICAgICAgICAgICAgICAgICAgICAgYWxpYXM6ICdiYXInLFxuICAgKiAgICAgICAgICAgICAgICAgICAgIHNyYzogJ2xvYWQtYmFyLntwbmcsd2VicH0nLFxuICAgKiAgICAgICAgICAgICAgICAgfSxcbiAgICogICAgICAgICAgICAgXSxcbiAgICogICAgICAgICB9LFxuICAgKiAgICAgICAgIHtcbiAgICogICAgICAgICAgICAgbmFtZTogJ2dhbWUtc2NyZWVuJyxcbiAgICogICAgICAgICAgICAgYXNzZXRzOiBbXG4gICAqICAgICAgICAgICAgICAgICB7XG4gICAqICAgICAgICAgICAgICAgICAgICAgYWxpYXM6ICdjaGFyYWN0ZXInLFxuICAgKiAgICAgICAgICAgICAgICAgICAgIHNyYzogJ3JvYm90LnBuZycsXG4gICAqICAgICAgICAgICAgICAgICB9LFxuICAgKiAgICAgICAgICAgICAgICAge1xuICAgKiAgICAgICAgICAgICAgICAgICAgIGFsaWFzOiAnZW5lbXknLFxuICAgKiAgICAgICAgICAgICAgICAgICAgIHNyYzogJ2JhZC1ndXkucG5nJyxcbiAgICogICAgICAgICAgICAgICAgIH0sXG4gICAqICAgICAgICAgICAgIF0sXG4gICAqICAgICAgICAgfSxcbiAgICogICAgIF1cbiAgICogfTtcbiAgICpcbiAgICogYXdhaXQgQXNzZXRzLmluaXQoeyBtYW5pZmVzdCB9KTtcbiAgICpcbiAgICogLy8gTG9hZCBhIGJ1bmRsZS4uLlxuICAgKiBsb2FkU2NyZWVuQXNzZXRzID0gYXdhaXQgQXNzZXRzLmxvYWRCdW5kbGUoJ2xvYWQtc2NyZWVuJyk7XG4gICAqIC8vIExvYWQgYW5vdGhlciBidW5kbGUuLi5cbiAgICogZ2FtZVNjcmVlbkFzc2V0cyA9IGF3YWl0IEFzc2V0cy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AgICAgICAgdGhpcy5fYXNzZXRNYXBbYWxpYXNdID0gcmVzb2x2ZWRBc3NldHM7XG4gICAgICB9KTtcbiAgICB9KTtcbiAgfVxuICAvLyBUT0RPOiB0aGlzIG5lZWRzIGFuIG92ZXJsb2FkIGxpa2UgbG9hZCBkaWQgaW4gQXNzZXRzXG4gIC8qKlxuICAgKiBJZiB0aGUgcmVzb2x2ZXIgaGFzIGhhZCBhIG1hbmlmZXN0IHNldCB2aWEgc2V0TWFuaWZlc3QsIHRoaXMgd2lsbCByZXR1cm4gdGhlIGFzc2V0cyB1cmxzIGZvclxuICAgKiBhIGdpdmVuIGJ1bmRsZUlkIG9yIGJ1bmRsZUlkcy5cbiAgICogQGV4YW1wbGVcbiAgICogLy8gTWFuaWZlc3QgRXhhbXBsZVxuICAgKiBjb25zdCBtYW5pZmVzdCA9IHtcbiAgICogICAgIGJ1bmRsZXM6IFtcbiAgICogICAgICAgICB7XG4gICAqICAgICAgICAgICAgIG5hbWU6ICdsb2FkLXNjcmVlbicsXG4gICAqICAgICAgICAgICAgIGFzc2V0czogW1xuICAgKiAgICAgICAgICAgICAgICAge1xuICAgKiAgICAgICAgICAgICAgICAgICAgIGFsaWFzOiAnYmFja2dyb3VuZCcsXG4gICAqICAgICAgICAgICAgICAgICAgICAgc3JjOiAnc3Vuc2V0LnBuZycsXG4gICAqICAgICAgICAgICAgICAgICB9LFxuICAgKiAgICAgICAgICAgICAgICAge1xuICAgKiAgICAgICAgICAgICAgICAgICAgIGFsaWFzOiAnYmFyJyxcbiAgICogICAgICAgICAgICAgICAgICAgICBzcmM6ICdsb2FkLWJhci57cG5nLHdlYnB9JyxcbiAgICogICAgICAgICAgICAgICAgIH0sXG4gICAqICAgICAgICAgICAgIF0sXG4gICAqICAgICAgICAgfSxcbiAgICogICAgICAgICB7XG4gICAqICAgICAgICAgICAgIG5hbWU6ICdnYW1lLXNjcmVlbicsXG4gICAqICAgICAgICAgICAgIGFzc2V0czogW1xuICAgKiAgICAgICAgICAgICAgICAge1xuICAgKiAgICAgICAgICAgICAgICAgICAgIGFsaWFzOiAnY2hhcmFjdGVyJyxcbiAgICogICAgICAgICAgICAgICAgICAgICBzcmM6ICdyb2JvdC5wbmcnLFxuICAgKiAgICAgICAgICAgICAgICAgfSxcbiAgICogICAgICAgICAgICAgICAgIHtcbiAgICogICAgICAgICAgICAgICAgICAgICBhbGlhczogJ2VuZW15JyxcbiAgICogICAgICAgICAgICAgICAgICAgICBzcmM6ICdiYWQtZ3V5LnBuZycsXG4gICAqICAgICAgICAgICAgICAgICB9LFxuICAgKiAgICAgICAgICAgICBdLFxuICAgKiAgICAgICAgIH0sXG4gICAqICAgICBdXG4gICAqIH07XG4gICAqXG4gICAqIHJlc29sdmVyLnNldE1hbmlmZXN0KG1hbmlmZXN0KTtcbiAgICogY29uc3QgcmVzb2x2ZWQgPSByZXNvbHZlci5yZXNvbHZlQnVuZGxlKCdsb2FkLXNjcmVlbicpO1xuICAgKiBAcGFyYW0gYnVuZGxlSWRzIC0gVGhlIGJ1bmRsZSBpZHMgdG8gcmVzb2x2ZVxuICAgKiBAcmV0dXJucyBBbGwgdGhlIGJ1bmRsZXMgYXNzZXRzIG9yIGEgaGFzaCBvZiBhc3NldHMgZm9yIGVhY2ggYnVuZGxlIHNwZWNpZmllZFxuICAgKi9cbiAgcmVzb2x2ZUJ1bmRsZShidW5kbGVJZHMpIHtcbiAgICBjb25zdCBzaW5nbGVBc3NldCA9IGlzU2luZ2xlSXRlbShidW5kbGVJZHMpO1xuICAgIGJ1bmRsZUlkcyA9IGNvbnZlcnRUb0xpc3QoYnVuZGxlSWRzKTtcbiAgICBjb25zdCBvdXQgPSB7fTtcbiAgICByZXR1cm4gYnVuZGxlSWRzLmZvckVhY2goKGJ1bmRsZUlkKSA9PiB7XG4gICAgICBjb25zdCBhc3NldE5hbWVzID0gdGhpcy5fYnVuZGxlc1tidW5kbGVJZF07XG4gICAgICBpZiAoYXNzZXROYW1lcykge1xuICAgICAgICBjb25zdCByZ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XG4gICAgICAgICksIHBhcnNlZCA9ICEwO1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICB9XG4gICAgaWYgKCFwYXJzZWQpXG4gICAgICBpZiAodWJvRWxlbWVudC5kYXRhLnNpemUgPiAxKSB7XG4gICAgICAgIGNvbnN0IHNpemUyID0gbWFwU2l6ZSh1Ym9FbGVtZW50LmRhdGEudHlwZSksIHJvd1NpemUgPSBNYXRoLm1heChHTFNMX1RPX1NURDQwX1NJWkVbdWJvRWxlbWVudC5kYXRhLnR5cGVdIC8gMTYsIDEpLCBlbGVtZW50U2l6ZSA9IHNpemUyIC8gcm93U2l6ZSwgcmVtYWluZGVyID0gKDQgLSBlbGVtZW50U2l6ZSAlIDQpICUgNDtcbiAgICAgICAgZnVuY0ZyYWdtZW50cy5wdXNoKGBcbiAgICAgICAgICAgICAgICBjdiA9IHVkLiR7bmFtZX0udmFsdWU7XG4gICAgICAgICAgICAgICAgdiA9IHV2LiR7bmFtZX07XG4gICAgICAgICAgICAgICAgb2Zmc2V0ID0gJHt1Ym9FbGVtZW50Lm9mZnNldCAvIDR9O1xuXG4gICAgICAgICAgICAgICAgdCA9IDA7XG5cbiAgICAgICAgICAgICAgICBmb3IodmFyIGk9MDsgaSA8ICR7dWJvRWxlbWVudC5kYXRhLnNpemUgKiByb3dTaXplfTsgaSsrKVxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgZm9yKHZhciBqID0gMDsgaiA8ICR7ZWxlbWVudFNpemV9OyBqKyspXG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KytdID0gdlt0KytdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIG9mZnNldCArPSAke3JlbWFpbmRlcn07XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgYCk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBjb25zdCB0ZW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dGEudHlwZSA9PT0gXCJtYXQzXCIgJiYgZGF0YS5zaXplID09PSAxICYmICFkYXRhLmlzQXJyYXkgJiYgdW5pZm9ybS5hICE9PSB2b2lkIDAsXG4gICAgY29kZTogKG5hbWUpID0+IChcbiAgICAgIC8vIFRPRE8gYW5kIHNvbWUgc21hcnQgY2FjaGluZyBkaXJ0eSBpZHMgaGVyZSFcbiAgICAgIGBcbiAgICAgICAgICAgIGdsLnVuaWZvcm1NYXRyaXgzZnYodWRbXCIke25hbWV9XCJdLmxvY2F0aW9uLCBmYWxzZSwgdXZbXCIke25hbWV9XCJdLnRvQXJyYXkodHJ1ZSkpO1xuICAgICAgICAgICAgYFxuICAgICksXG4gICAgY29kZVVibzogKG5hbWUpID0+IGBcbiAgICAgICAgICAgICAgICB2YXIgJHtuYW1lfV9tYXRyaXggPSB1di4ke25hbWV9LnRvQXJyYXkodHJ1ZSk7XG5cbiAgICAgICAgICAgICAgICBkYXRhW29mZnNldF0gPSAke25hbWV9X21hdHJpeFswXTtcbiAgICAgICAgICAgICAgICBkYXRhW29mZnNldCsxXSA9ICR7bmFtZX1fbWF0cml4WzFdO1xuICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KzJdID0gJHtuYW1lfV9tYXRyaXhbMl07XG4gICAgICAgIFxuICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0ICsgNF0gPSAke25hbWV9X21hdHJpeFszXTtcbiAgICAgICAgICAgICAgICBkYXRhW29mZnNldCArIDVdID0gJHtuYW1lfV9tYXRyaXhbNF07XG4gICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQgKyA2XSA9ICR7bmFtZX1fbWF0cml4WzVdO1xuICAgICAgICBcbiAgICAgICAgICAgICAgICBkYXRhW29mZnNldCArIDhdID0gJHtuYW1lfV9tYXRyaXhbNl07XG4gICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQgKyA5XSA9ICR7bmFtZX1fbWF0cml4WzddO1xuICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0ICsgMTBdID0gJHtuYW1lfV9tYXRyaXhbOF07XG4gICAgICAgICAgICBgXG4gIH0sXG4gIC8vIHVwbG9hZGluZyBhIHBpeGkgcG9pbnQgYXMgYSB2ZWMyIHdpdGggY2FjaGluZyBsYXllclxuICB7XG4gICAgdGVzdDogKGRhdGEsIHVuaWZvcm0pID0+IGRhdGEudHlwZSA9PT0gXCJ2ZWMyXCIgJiYgZGF0YS5zaXplID09PSAxICYmICFkYXRhLmlzQXJyYXkgJiYgdW5pZm9ybS54ICE9PSB2b2lkIDAsXG4gICAgY29kZTogKG5hbWUpID0+IGBcbiAgICAgICAgICAgICAgICBjdiA9IHVkW1wiJHtuYW1lfVwiXS52YWx1ZTtcbiAgICAgICAgICAgICAgICB2ID0gdXZbXCIke25hbWV9XCJdO1xuXG4gICAgICAgICAgICAgICAgaWYoY3ZbMF0gIT09IHYueCB8fCBjdlsxXSAhPT0gdi55KVxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMF0gPSB2Lng7XG4gICAgICAgICAgICAgICAgICAgIGN2WzFdID0gdi55O1xuICAgICAgICAgICAgICAgICAgICBnbC51bmlmb3JtMmYodWRbXCIke25hbWV9XCJdLmxvY2F0aW9uLCB2LngsIHYueSk7XG4gICAgICAgICAgICAgICAgfWAsXG4gICAgY29kZVVibzogKG5hbWUpID0+IGBcbiAgICAgICAgICAgICAgICB2ID0gdXYuJHtuYW1lfTtcblxuICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0XSA9IHYueDtcbiAgICAgICAgICAgICAgICBkYXRhW29mZnNldCsxXSA9IHYueTtcbiAgICAgICAgICAgIGBcbiAgfSxcbiAgLy8gY2FjaGluZyBsYXllciBmb3IgYSB2ZWMyXG4gIHtcbiAgICB0ZXN0OiAoZGF0YSkgPT4gZGF0YS50eXBlID09PSBcInZlYzJcIiAmJiBkYXRhLnNpemUgPT09IDEgJiYgIWRhdGEuaXNBcnJheSxcbiAgICBjb2RlOiAobmFtZSkgPT4gYFxuICAgICAgICAgICAgICAgIGN2ID0gdWRbXCIke25hbWV9XCJdLnZhbHVlO1xuICAgICAgICAgICAgICAgIHYgPSB1dltcIiR7bmFtZX1cIl07XG5cbiAgICAgICAgICAgICAgICBpZihjdlswXSAhPT0gdlswXSB8fCBjdlsxXSAhPT0gdlsxXSlcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIGN2WzBdID0gdlswXTtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMV0gPSB2WzFdO1xuICAgICAgICAgICAgICAgICAgICBnbC51bmlmb3JtMmYodWRbXCIke25hbWV9XCJdLmxvY2F0aW9uLCB2WzBdLCB2WzFdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBgXG4gIH0sXG4gIC8vIHVwbG9hZCBhIHBpeGkgcmVjdGFuZ2xlIGFzIGEgdmVjNCB3aXRoIGNhY2hpbmcgbGF5ZXJcbiAge1xuICAgIHRlc3Q6IChkYXRhLCB1bmlmb3JtKSA9PiBkYXRhLnR5cGUgPT09IFwidmVjNFwiICYmIGRhdGEuc2l6ZSA9PT0gMSAmJiAhZGF0YS5pc0FycmF5ICYmIHVuaWZvcm0ud2lkdGggIT09IHZvaWQgMCxcbiAgICBjb2RlOiAobmFtZSkgPT4gYFxuICAgICAgICAgICAgICAgIGN2ID0gdWRbXCIke25hbWV9XCJdLnZhbHVlO1xuICAgICAgICAgICAgICAgIHYgPSB1dltcIiR7bmFtZX1cIl07XG5cbiAgICAgICAgICAgICAgICBpZihjdlswXSAhPT0gdi54IHx8IGN2WzFdICE9PSB2LnkgfHwgY3ZbMl0gIT09IHYud2lkdGggfHwgY3ZbM10gIT09IHYuaGVpZ2h0KVxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMF0gPSB2Lng7XG4gICAgICAgICAgICAgICAgICAgIGN2WzFdID0gdi55O1xuICAgICAgICAgICAgICAgICAgICBjdlsyXSA9IHYud2lkdGg7XG4gICAgICAgICAgICAgICAgICAgIGN2WzNdID0gdi5oZWlnaHQ7XG4gICAgICAgICAgICAgICAgICAgIGdsLnVuaWZvcm00Zih1ZFtcIiR7bmFtZX1cIl0ubG9jYXRpb24sIHYueCwgdi55LCB2LndpZHRoLCB2LmhlaWdodClcbiAgICAgICAgICAgICAgICB9YCxcbiAgICBjb2RlVWJvOiAobmFtZSkgPT4gYFxuICAgICAgICAgICAgICAgICAgICB2ID0gdXYuJHtuYW1lfTtcblxuICAgICAgICAgICAgICAgICAgICBkYXRhW29mZnNldF0gPSB2Lng7XG4gICAgICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KzFdID0gdi55O1xuICAgICAgICAgICAgICAgICAgICBkYXRhW29mZnNldCsyXSA9IHYud2lkdGg7XG4gICAgICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KzNdID0gdi5oZWlnaHQ7XG4gICAgICAgICAgICAgICAgYFxuICB9LFxuICAvLyB1cGxvYWQgYSBwaXhpIGNvbG9yIGFzIHZlYzQgd2l0aCBjYWNoaW5nIGxheWVyXG4gIHtcbiAgICB0ZXN0OiAoZGF0YSwgdW5pZm9ybSkgPT4gZGF0YS50eXBlID09PSBcInZlYzRcIiAmJiBkYXRhLnNpemUgPT09IDEgJiYgIWRhdGEuaXNBcnJheSAmJiB1bmlmb3JtLnJlZCAhPT0gdm9pZCAwLFxuICAgIGNvZGU6IChuYW1lKSA9PiBgXG4gICAgICAgICAgICAgICAgY3YgPSB1ZFtcIiR7bmFtZX1cIl0udmFsdWU7XG4gICAgICAgICAgICAgICAgdiA9IHV2W1wiJHtuYW1lfVwiXTtcblxuICAgICAgICAgICAgICAgIGlmKGN2WzBdICE9PSB2LnJlZCB8fCBjdlsxXSAhPT0gdi5ncmVlbiB8fCBjdlsyXSAhPT0gdi5ibHVlIHx8IGN2WzNdICE9PSB2LmFscGhhKVxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMF0gPSB2LnJlZDtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMV0gPSB2LmdyZWVuO1xuICAgICAgICAgICAgICAgICAgICBjdlsyXSA9IHYuYmx1ZTtcbiAgICAgICAgICAgICAgICAgICAgY3ZbM10gPSB2LmFscGhhO1xuICAgICAgICAgICAgICAgICAgICBnbC51bmlmb3JtNGYodWRbXCIke25hbWV9XCJdLmxvY2F0aW9uLCB2LnJlZCwgdi5ncmVlbiwgdi5ibHVlLCB2LmFscGhhKVxuICAgICAgICAgICAgICAgIH1gLFxuICAgIGNvZGVVYm86IChuYW1lKSA9PiBgXG4gICAgICAgICAgICAgICAgICAgIHYgPSB1di4ke25hbWV9O1xuXG4gICAgICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0XSA9IHYucmVkO1xuICAgICAgICAgICAgICAgICAgICBkYXRhW29mZnNldCsxXSA9IHYuZ3JlZW47XG4gICAgICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KzJdID0gdi5ibHVlO1xuICAgICAgICAgICAgICAgICAgICBkYXRhW29mZnNldCszXSA9IHYuYWxwaGE7XG4gICAgICAgICAgICAgICAgYFxuICB9LFxuICAvLyB1cGxvYWQgYSBwaXhpIGNvbG9yIGFzIGEgdmVjMyB3aXRoIGNhY2hpbmcgbGF5ZXJcbiAge1xuICAgIHRlc3Q6IChkYXRhLCB1bmlmb3JtKSA9PiBkYXRhLnR5cGUgPT09IFwidmVjM1wiICYmIGRhdGEuc2l6ZSA9PT0gMSAmJiAhZGF0YS5pc0FycmF5ICYmIHVuaWZvcm0ucmVkICE9PSB2b2lkIDAsXG4gICAgY29kZTogKG5hbWUpID0+IGBcbiAgICAgICAgICAgICAgICBjdiA9IHVkW1wiJHtuYW1lfVwiXS52YWx1ZTtcbiAgICAgICAgICAgICAgICB2ID0gdXZbXCIke25hbWV9XCJdO1xuXG4gICAgICAgICAgICAgICAgaWYoY3ZbMF0gIT09IHYucmVkIHx8IGN2WzFdICE9PSB2LmdyZWVuIHx8IGN2WzJdICE9PSB2LmJsdWUgfHwgY3ZbM10gIT09IHYuYSlcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIGN2WzBdID0gdi5yZWQ7XG4gICAgICAgICAgICAgICAgICAgIGN2WzFdID0gdi5ncmVlbjtcbiAgICAgICAgICAgICAgICAgICAgY3ZbMl0gPSB2LmJsdWU7XG4gICAgXG4gICAgICAgICAgICAgICAgICAgIGdsLnVuaWZvcm0zZih1ZFtcIiR7bmFtZX1cIl0ubG9jYXRpb24sIHYucmVkLCB2LmdyZWVuLCB2LmJsdWUpXG4gICAgICAgICAgICAgICAgfWAsXG4gICAgY29kZVVibzogKG5hbWUpID0+IGBcbiAgICAgICAgICAgICAgICAgICAgdiA9IHV2LiR7bmFtZX07XG5cbiAgICAgICAgICAgICAgICAgICAgZGF0YVtvZmZzZXRdID0gdi5yZWQ7XG4gICAgICAgICAgICAgICAgICAgIGRhdGFbb2Zmc2V0KzFdID0gdi5ncmVlbjtcbiAgICAgICAgICAgICAgICAgICAgZGF0YVtvZmZzZXQrMl0gPSB2LmJsdWU7XG4gICAgICAgICAgICAgICAgYFxuICB9LFxuICAvLyBhIGNhY2hpbmcgbGF5ZXIgZm9yIHZlYzQgdXBsb2FkaW5nXG4gIHtcbiAgICB0ZXN0OiAoZGF0YSkgPT4gZGF0YS50eXBlID09PSBcInZlYzRcIiAmJiBkYXRhLnNpemUgPT09IDEgJiYgIWRhdGEuaXNBcnJheSxcbiAgICBjb2RlOiAobmFtZSkgPT4gYFxuICAgICAgICAgICAgICAgIGN2ID0gdWRbXCIke25hbWV9XCJdLnZhbHVlO1xuICAgICAgICAgICAgICAgIHYgPSB1dltcIiR7bmFtZX1cIl07XG5cbiAgICAgICAgICAgICAgICBpZihjdlswXSAhPT0gdlswXSB8fCBjdlsxXSAhPT0gdlsxXSB8fCBjdlsyXSAhPT0gdlsyXSB8fCBjdlszXSAhPT0gdlszXSlcbiAgICAgICAgICAgICAgICB7XG4gIC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gYm91bmRzLm1pblggPCBtaW5YID8gYm91bmRzLm1pblggOiBtaW5YLCB0aGlzLm1pblkgPSBib3VuZHMubWluWSA8IG1pblkgPyBib3VuZHMubWluWSA6IG1pblksIHRoaXMubWF4WCA9IGJvdW5kcy5tYXhYID4gbWF4WCA/IGJvdW5kcy5tYXhYIDogbWF4WCwgdGhpcy5tYXhZID0gYm91bmRzLm1heFkgPiBtYXhZID8gYm91bmRzLm1heFkgOiBtYXhZO1xuICB9XG4gIC8qKlxuICAgKiBBZGRzIG90aGVyIEJvdW5kcywgbWFza2VkIHdpdGggQm91bmRzLlxuICAgKiBAcGFyYW0gYm91bmRzIC0gVGhlIEJvdW5kcyB0byBiZSBhZGRlZC5cbiAgICogQHBhcmFtIG1hc2sgLSBUT0RPXG4gICAqL1xuICBhZGRCb3VuZHNNYXNrKGJvdW5kcywgbWFzaykge1xuICAgIGNvbnN0IF9taW5YID0gYm91bmRzLm1pblggPiBtYXNrLm1pblggPyBib3VuZHMubWluWCA6IG1hc2subWluWCwgX21pblkgPSBib3VuZHMubWluWSA+IG1hc2subWluWSA/IGJvdW5kcy5taW5ZIDogbWFzay5taW5ZLCBfbWF4WCA9IGJvdW5kcy5tYXhYIDwgbWFzay5tYXhYID8gYm91bmRzLm1heFggOiBtYXNrLm1heFgsIF9tYXhZID0gYm91bmRzLm1heFkgPCBtYXNrLm1heFkgPyBib3VuZHMubWF4WSA6IG1hc2subWF4WTtcbiAgICBpZiAoX21pblggPD0gX21heFggJiYgX21pblkgPD0gX21heFkpIHtcbiAgICAgIGNvbnN0IG1pblggPSB0aGlzLm1pblgsIG1pblkgPSB0aGlzLm1pblksIG1heFggPSB0aGlzLm1heFgsIG1heFkgPSB0aGlzLm1heFk7XG4gICAgICB0aGlzLm1pblggPSBfbWluWCA8IG1pblggPyBfbWluWCA6IG1pblgsIHRoaXMubWluWSA9IF9taW5ZIDwgbWluWSA/IF9taW5ZIDogbWluWSwgdGhpcy5tYXhYID0gX21heFggPiBtYXhYID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1xuICAgICAgYy5yZ2IgLz0gYy5hO1xuICAgIH1cblxuICAgIHZlYzQgcmVzdWx0O1xuXG4gICAgcmVzdWx0LnIgPSAobVswXSAqIGMucik7XG4gICAgICAgIHJlc3VsdC5yICs9IChtWzFdICogYy5nKTtcbiAgICAgICAgcmVzdWx0LnIgKz0gKG1bMl0gKiBjLmIpO1xuICAgICAgICByZXN1bHQuciArPSAobVszXSAqIGMuYSk7XG4gICAgICAgIHJlc3VsdC5yICs9IG1bNF07XG5cbiAgICByZXN1bHQuZyA9IChtWzVdICogYy5yKTtcbiAgICAgICAgcmVzdWx0LmcgKz0gKG1bNl0gKiBjLmcpO1xuICAgICAgICByZXN1bHQuZyArPSAobVs3XSAqIGMuYik7XG4gICAgICAgIHJlc3VsdC5nICs9IChtWzhdICogYy5hKTtcbiAgICAgICAgcmVzdWx0LmcgKz0gbVs5XTtcblxuICAgIHJlc3VsdC5iID0gKG1bMTBdICogYy5yKTtcbiAgICAgICByZXN1bHQuYiArPSAobVsxMV0gKiBjLmcpO1xuICAgICAgIHJlc3VsdC5iICs9IChtWzEyXSAqIGMuYik7XG4gICAgICAgcmVzdWx0LmIgKz0gKG1bMTNdICogYy5hKTtcbiAgICAgICByZXN1bHQuYiArPSBtWzE0XTtcblxuICAgIHJlc3VsdC5hID0gKG1bMTVdICogYy5yKTtcbiAgICAgICByZXN1bHQuYSArPSAobVsxNl0gKiBjLmcpO1xuICAgICAgIHJlc3VsdC5hICs9IChtWzE3XSAqIGMuYik7XG4gICAgICAgcmVzdWx0LmEgKz0gKG1bMThdICogYy5hKTtcbiAgICAgICByZXN1bHQuYSArPSBtWzE5XTtcblxuICAgIHZlYzMgcmdiID0gbWl4KGMucmdiLCByZXN1bHQucmdiLCB1QWxwaGEpO1xuXG4gICAgLy8gUHJlbXVsdGlwbHkgYWxwaGEgYWdhaW4uXG4gICAgcmdiICo9IHJlc3VsdC5hO1xuXG4gICAgZ2xfRnJhZ0NvbG9yID0gdmVjNChyZ2IsIHJl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ArIGx1bWFTRSkpO1xuXG4gICAgZmxvYXQgZGlyUmVkdWNlID0gbWF4KChsdW1hTlcgKyBsdW1hTkUgKyBsdW1hU1cgKyBsdW1hU0UpICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgKDAuMjUgKiBGWEFBX1JFRFVDRV9NVUwpLCBGWEFBX1JFRFVDRV9NSU4pO1xuXG4gICAgZmxvYXQgcmNwRGlyTWluID0gMS4wIC8gKG1pbihhYnMoZGlyLngpLCBhYnMoZGlyLnkpKSArIGRpclJlZHVjZSk7XG4gICAgZGlyID0gbWluKHZlYzIoRlhBQV9TUEFOX01BWCwgRlhBQV9TUEFOX01BWCksXG4gICAgICAgICAgICAgIG1heCh2ZWMyKC1GWEFBX1NQQU5fTUFYLCAtRlhBQV9TUEFOX01BWCksXG4gICAgICAgICAgICAgICAgICBkaXIgKiByY3BEaXJNaW4pKSAqIGludmVyc2VWUDtcblxuICAgIHZlYzMgcmdiQSA9IDAuNSAqIChcbiAgICAgICAgICAgICAgICAgICAgICAgdGV4dHVyZTJEKHRleCwgZnJhZ0Nvb3JkICogaW52ZXJzZVZQICsgZGlyICogKDEuMCAvIDMuMCAtIDAuNSkpLnh5eiArXG4gICAgICAgICAgICAgICAgICAgICAgIHRleHR1cmUyRCh0ZXgsIGZyYWdDb29yZCAqIGludmVyc2VWUCArIGRpciAqICgyLjAgLyAzLjAgLSAwLjUpKS54eXopO1xuICAgIHZlYzMgcmdiQiA9IHJnYkEgKiAwLjUgKyAwLjI1ICogKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHR1cmUyRCh0ZXgsIGZyYWdDb29yZCAqIGludmVyc2VWUCArIGRpciAqIC0wLjUpLnh5eiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dHVyZTJEKHRleCwgZnJhZ0Nvb3JkICogaW52ZXJzZVZQICsgZGlyICogMC41KS54eXopO1xuXG4gICAgZmxvYXQgbHVtYUIgPSBkb3Qocm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nAxeSksIHBlcnAxeCAvPSBkaXN0LCBwZXJwMXkgLz0gZGlzdCwgcGVycDF4ICo9IHdpZHRoLCBwZXJwMXkgKj0gd2lkdGg7XG4gICAgY29uc3QgZHgwID0geDEgLSB4MCwgZHkwID0geTAgLSB5MSwgZHgxID0geDEgLSB4MiwgZHkxID0geTIgLSB5MSwgZG90ID0gZHgwICogZHgxICsgZHkwICogZHkxLCBjcm9zcyA9IGR5MCAqIGR4MSAtIGR5MSAqIGR4MCwgY2xvY2t3aXNlID0gY3Jvc3MgPCAwO1xuICAgIGlmIChNYXRoLmFicyhjcm9zcykgPCAxZS0zICogTWF0aC5hYnMoZG90KSkge1xuICAgICAgdmVydHMucHVzaChcbiAgICAgICAgeDEgLSBwZXJweCAqIGlubmVyV2VpZ2h0LFxuICAgICAgICB5MSAtIHBlcnB5ICogaW5uZXJXZWlnaHQsXG4gICAgICAgIHgxICsgcGVycHggKiBvdXRlcldlaWdodCxcbiAgICAgICAgeTEgKyBwZXJweSAqIG91dGVyV2VpZ2h0XG4gICAgICApLCBkb3QgPj0gMCAmJiAoc3R5bGUuam9pbiA9PT0gTElORV9KT0lOLlJPVU5EID8gaW5kZXhDb3VudCArPSByb3VuZChcbiAgICAgICAgeDEsXG4gICAgICAgIHkxLFxuICAgICAgICB4MSAtIHBlcnB4ICogaW5uZXJXZWlnaHQsXG4gICAgICAgIHkxIC0gcGVycHkgKiBpbm5lcldlaWdodCxcbiAgICAgICAgeDEgLSBwZXJwMXggKiBpbm5lcldlaWdodCxcbiAgICAgICAgeTEgLSBwZXJwMXkgKiBpbm5lcldlaWdodCxcbiAgICAgICAgdmVydHMsXG4gICAgICAgICExXG4gICAgICApICsgNCA6IGluZGV4Q291bnQgKz0gMiwgdmVydHMucHVzaChcbiAgICAgICAgeDEgLSBwZXJwMXggKiBvdXRlcldlaWdodCxcbiAgICAgICAgeTEgLSBwZXJwMXkgKiBvdXRlcldlaWdodCxcbiAgICAgICAgeDEgKyBwZXJwMXggKiBpbm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gJiYgcGRpc3QgLyB3aWR0aFNxdWFyZWQgPiBtaXRlckxpbWl0U3F1YXJlZCAmJiAoam9pbiA9IExJTkVfSk9JTi5CRVZFTCksIGluc2lkZU1pdGVyT2spXG4gICAgICBzd2l0Y2ggKGpvaW4pIHtcbiAgICAgICAgY2FzZSBMSU5FX0pPSU4uTUlURVI6IHtcbiAgICAgICAgICB2ZXJ0cy5wdXNoKFxuICAgICAgICAgICAgaW14LFxuICAgICAgICAgICAgaW15LFxuICAgICAgICAgICAgb214LFxuICAgICAgICAgICAgb215XG4gICAgICAgICAgKTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBjYXNlIExJTkVfSk9JTi5CRVZFTDoge1xuICAgICAgICAgIGNsb2Nrd2lzZSA/IHZlcnRzLnB1c2goXG4gICAgICAgICAgICBpbXgsXG4gICAgICAgICAgICBpbXksXG4gICAgICAgICAgICAvLyBpbm5lciBtaXRlciBwb2ludFxuICAgICAgICAgICAgeDEgKyBwZXJweCAqIG91dGVyV2VpZ2h0LFxuICAgICAgICAgICAgeTEgKyBwZXJweSAqIG91dGVyV2VpZ2h0LFxuICAgICAgICAgICAgLy8gZmlyc3Qgc2VnbWVudCdzIG91dGVyIHZlcnRleFxuICAgICAgICAgICAgaW14LFxuICAgICAgICAgICAgaW15LFxuICAgICAgICAgICAgLy8gaW5uZXIgbWl0ZXIgcG9pbnRcbiAgICAgICAgICAgIHgxICsgcGVycDF4ICogb3V0ZXJXZWlnaHQsXG4gICAgICAgICAgICB5MSArIHBlcnAxeSAqIG91dGVyV2VpZ2h0XG4gICAgICAgICAgKSA6IHZlcnRzLnB1c2goXG4gICAgICAgICAgICB4MSAtIHBlcnB4ICogaW5uZXJXZWlnaHQsXG4gICAgICAgICAgICB5MSAtIHBlcnB5ICogaW5uZXJXZWlnaHQsXG4gICAgICAgICAgICAvLyBmaXJzdCBzZWdtZW50J3MgaW5uZXIgdmVydGV4XG4gICAgICAgICAgICBvbXgsXG4gICAgICAgICAgICBvbXksXG4gICAgICAgICAgICAvLyBvdXRlciBtaXRlciBwb2ludFxuICAgICAgICAgICAgeDEgLSBwZXJwMXggKiBpbm5lcldlaWdodCxcbiAgICAgICAgICAgIHkxIC0gcGVycDF5ICogaW5uZXJXZWlnaHQsXG4gICAgICAgICAgICAvLyBzZWNvbmQgc2VnbWVudCdzIG91dGVyIHZlcnRleFxuICAgICAgICAgICAgb214LFxuICAgICAgICAgICAgb215XG4gICAgICAgICAgKSwgaW5kZXhDb3VudCArPSAyO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIGNhc2UgTElORV9KT0lOLlJPVU5EOiB7XG4gICAgICAgICAgY2xvY2t3aXNlID8gKHZlcnRzLnB1c2goXG4gICAgICAgICAgICBpbXgsXG4gICAgICAgICAgICBpbXksXG4gICAgICAgICAgICB4MSArIHBlcnB4ICogb3V0ZXJXZWlnaHQsXG4gICAgICAgICAgICB5MSArIHBlcnB5ICogb3V0ZXJXZWlnaHRcbiAgICAgICAgICApLCBpbmRleENvdW50ICs9IHJvdW5kKFxuICAgICAgICAgICAgeDEsXG4gICAgICAgICAgICB5MSxcbiAgICAgICAgICAgIHgxICsgcGVycHggKiBvdXRlcldlaWdodCxcbiAgICAgICAgICAgIHkxICsgcGVycHkgKiBvdXRlcldlaWdodCxcbiAgICAgICAgICAgIHgxICsgcGVycDF4ICogb3V0ZXJXZWlnaHQsXG4gICAgICAgICAgICB5MSArIHBlcnAxeSAqIG91dGVyV2VpZ2h0LFxuICAgICAgICAgICAgdmVydHMsXG4gICAgICAgICAgICAhMFxuICAgICAgICAgICkgKyA0LCB2ZXJ0cy5wdXNoKFxuICAgICAgICAgICAgaW14LFxuICAgICAgICAgICAgaW15LFxuICAgICAgICAgICAgeDEgKyBwZXJwMXggKiBvdXRlcldlaWdodCxcbiAgICAgICAgICAgIHkxICsgcGVycDF5ICogb3V0ZXJXZWlnaHRcbiAgICAgICAgICApKSA6ICh2ZXJ0cy5wdXNoKFxuICAgICAgICAgICAgeDEgLSBwZXJweCAqIGlubmVyV2VpZ2h0LFxuICAgICAgICAgICAgeTEgLSBwZXJweSAqIGlubmVyV2VpZ2h0LFxuICAgICAgICAgICAgb214LFxuICAgICAgICAgICAgb215XG4gICAgICAgICAgKSwgaW5kZXhDb3VudCArPSByb3VuZChcbiAgICAgICAgICAgIHgxLFxuICAgICAgICAgICAgeTEsXG4gICAgICAgICAgICB4MSAtIHBlcnB4ICogaW5uZXJXZWlnaHQsXG4gICAgICAgICAgICB5MSAtIHBlcnB5ICogaW5uZXJXZWlnaHQsXG4gICAgICAgICAgICB4MSAtIHBlcnAxeCAqIGlubmVyV2VpZ2h0LFxuICAgICAgICAgICAgeTEgLSBwZXJwMXkgKiBpbm5lcldlaWdodCxcbiAgICAgICAgICAgIHZlcnRzLFxuICAgICAgICAgICAgITFcbiAgICAgICAgICApICsgNCwgdmVydHMucHVzaChcbiAgICAgICAgICAgIHgxIC0gcGVycDF4ICogaW5uZXJXZWlnaHQsXG4gICAgICAgICAgICB5MSAtIHBlcnAxeSAqIGlubmVyV2VpZ2h0LFxuICAgICAgICAgICAgb214LFxuICAgICAgICAgICAgb215XG4gICAgICAgICAgKSk7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICBlbHNlIHtcbiAgICAgIHN3aXRjaCAodmVydHMucHVzaChcbiAgICAgICAgeDEgLSBwZXJweCAqIGlubmVyV2VpZ2h0LFxuICAgICAgICB5MSAtIHBlcnB5ICogaW5uZXJXZWlnaHQsXG4gICAgICAgIC8vIGZpcnN0IHNlZ21lbnQncyBpbm5lciB2ZXJ0ZXhcbiAgICAgICAgeDEgKyBwZXJweCAqIG91dGVyV2VpZ2h0LFxuICAgICAgICB5MSArIHBlcnB5ICogb3V0ZXJXZWlnaHRcbiAgICAgICksIGpvaW4pIHtcbiAgICAgICAgY2FzZSBMSU5FX0pPSU4uTUlURVI6IHtcbiAgICAgICAgICBjbG9ja3dpc2UgPyB2ZXJ0cy5wdXNoKFxuICAgICAgICAgICAgb214LFxuICAgICAgICAgICAgb215LFxuICAgICAgICAgICAgLy8gaW5uZXIgbWl0ZXIgcG9pbnRcbiAgICAgICAgICAgIG9teCxcbiAgICAgICAgICAgIG9teVxuICAgICAgICAgICkgOiB2ZXJ0cy5wdXNoKFxuICAgICAgICAgICAgaW14LFxuICAgICAgICAgICAgaW15LFxuICAgICAgICAgICAgLy8gb3V0ZXIgbWl0ZXIgcG9pbnRcbiAgICAgICAgICAgIGlteCxcbiAgICAgICAgICAgIGlteVxuICAgICAgICAgICksIGluZGV4Q291bnQgKz0gMjtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBjYXNlIExJTkVfSk9JTi5ST1VORDoge1xuICAgICAgICAgIGNsb2Nrd2lzZSA/IGluZGV4Q291bnQgKz0gcm91bmQoXG4gICAgICAgICAgICB4MSxcbiAgICAgICAgICAgIHkxLFxuICAgICAgICAgICAgeDEgKyBwZXJweCAqIG91dGVyV2VpZ2h0LFxuICAgICAgICAgICAgeTEgKyBwZXJweSAqIG91dGVyV2VpZ2h0LFxuICAgICAgICAgICAgeDEgKyBwZXJwMXggKiBvdXRlcldlaWdodCxcbiAgICAgICAgICAgIHkxICsgcGVycDF5ICogb3V0ZXJXZWlnaHQsXG4gICAgICAgICAgICB2ZXJ0cyxcbiAgICAgICAgICAgICEwXG4gICAgICAgICAgKSArIDIgOiBpbmRleENvdW50ICs9IHJvdW5kKFxuICAgICAgICAgICAgeDEsXG4gICAgICAgICAgICB5MSxcbiAgICAgICAgICAgIHgxIC0gcGVycHggKiBpbm5lcldlaWdodCxcbiAgICAgICAgICAgIHkxIC0gcGVycHkgKiBpbm5lcldlaWdodCxcbiAgICAgICAgICAgIHgxIC0gcGVycDF4ICogaW5uZXJXZWlnaHQsXG4gICAgICAgICAgICB5MSAtIHBlcnAxeSAqIGlubmVyV2VpZ2h0LFxuICAgICAgICAgICAgdmVydHMsXG4gICAgICAgICAgICA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AgfSxcbiAgdHJpYW5ndWxhdGUoZ3JhcGhpY3NEYXRhLCBncmFwaGljc0dlb21ldHJ5KSB7XG4gICAgbGV0IHBvaW50cyA9IGdyYXBoaWNzRGF0YS5wb2ludHM7XG4gICAgY29uc3QgaG9sZXMgPSBncmFwaGljc0RhdGEuaG9sZXMsIHZlcnRzID0gZ3JhcGhpY3NHZW9tZXRyeS5wb2ludHMsIGluZGljZXMgPSBncmFwaGljc0dlb21ldHJ5LmluZGljZXM7XG4gICAgaWYgKHBvaW50cy5sZW5ndGggPj0gNikge1xuICAgICAgZml4T3JpZW50YXRpb24ocG9pbnRzLCAhMSk7XG4gICAgICBjb25zdCBob2xlQXJyYXkgPSBbXTtcbiAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaG9sZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgY29uc3QgaG9sZSA9IGhvbGVzW2ldO1xuICAgICAgICBmaXhPcmllbnRhdGlvbihob2xlLnBvaW50cywgITApLCBob2xlQXJyYXkucHVzaChwb2ludHMubGVuZ3RoIC8gMiksIHBvaW50cyA9IHBvaW50cy5jb25jYXQoaG9sZS5wb2ludHMpO1xuICAgICAgfVxuICAgICAgY29uc3QgdHJpYW5nbGVzID0gdXRpbHMuZWFyY3V0KHBvaW50cywgaG9sZUFycmF5LCAyKTtcbiAgICAgIGlmICghdHJpYW5nbGVzKVxuICAgICAgICByZXR1cm47XG4gICAgICBjb25zdCB2ZXJ0UG9zID0gdmVydHMubGVuZ3RoIC8gMjtcbiAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdHJpYW5nbGVzLmxlbmd0aDsgaSArPSAzKVxuICAgICAgICBpbmRpY2VzLnB1c2godHJpYW5nbGVzW2ldICsgdmVydFBvcyksIGluZGljZXMucHVzaCh0cmlhbmdsZXNbaSArIDFdICsgdmVydFBvcyksIGluZGljZXMucHVzaCh0cmlhbmdsZXNbaSArIDJdICsgdmVydFBvcyk7XG4gICAgICBmb3IgKGxldCBpID0gMD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OyBpKyspIHtcbiAgICAgICAgICAgIHRoaXMuaGFuZGxlcnNbdHlwZV1baV0oZXZlbnQpO1xuICAgICAgICB9XG4gICAgfVxuICAgIG9uVG91Y2hTdGFydChldmVudCkge1xuICAgICAgICB2YXIgX2EsIF9iLCBfYywgX2QsIF9lLCBfZiwgX2csIF9oLCBfaiwgX2ssIF9sLCBfbSwgX28sIF9wLCBfcSwgX3IsIF9zLCBfdCwgX3UsIF92LCBfdywgX3gsIF95LCBfeiwgXzAsIF8xO1xuICAgICAgICBsZXQgZGlkVG91Y2gxID0gZmFsc2U7XG4gICAgICAgIGxldCBkaWRUb3VjaDIgPSBmYWxzZTtcbiAgICAgICAgaWYgKGV2ZW50LnR5cGUgIT09ICdtb3VzZWRvd24nKSB7XG4gICAgICAgICAgICBpZiAoIXRoaXMudG91Y2gxKSB7XG4gICAgICAgICAgICAgICAgdGhpcy50b3VjaDEgPSBldmVudC5jaGFuZ2VkVG91Y2hlc1swXTtcbiAgICAgICAgICAgICAgICBkaWRUb3VjaDEgPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCgoZGlkVG91Y2gxICYmIGV2ZW50LmNoYW5nZWRUb3VjaGVzLmxlbmd0aCA+IDEpIHx8ICFkaWRUb3VjaDEpICYmICF0aGlzLnRvdWNoMikge1xuICAgICAgICAgICAgICAgIHRoaXMudG91Y2gyID1cbiAgICAgICAgICAgICAgICAgICAgWy4uLmV2ZW50LmNoYW5nZWRUb3VjaGVzXS5maW5kKCh0b3VjaCkgPT4geyB2YXIgX2E7IHJldHVybiB0b3VjaC5pZGVudGlmaWVyICE9PSAoKF9hID0gdGhpcy50b3VjaDEpID09PSBudWxsIHx8IF9hID09PSB2b2lkIDAgPyB2b2lkIDAgOiBfYS5pZGVudGlmaWVyKTsgfSkgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGw7XG4gICAgICAgICAgICAgICAgdGhpcy5vcmlnaW5hbERpc3RhbmNlID0gTWF0aC5z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sICYmIF9kICE9PSB2b2lkIDAgPyBfZCA6IDApIC0gKChfZSA9IHRoaXMudG91Y2hTdGFydFkpICE9PSBudWxsICYmIF9lICE9PSB2b2lkIDAgPyBfZSA6IDApO1xuICAgICAgICAgICAgdGhpcy52ZWxvY2l0eVkgPSB0b3VjaE1vdmVZIC0gKChfZiA9IHRoaXMudG91Y2hNb3ZlWSkgIT09IG51bGwgJiYgX2YgIT09IHZvaWQgMCA/IF9mIDogMCk7XG4gICAgICAgICAgICB0aGlzLnRvdWNoTW92ZVkgPSB0b3VjaE1vdmVZO1xuICAgICAgICAgICAgY29uc3QgYWJzVG91Y2hNb3ZlWCA9IE1hdGguYWJzKHRoaXMudG91Y2hNb3ZlWCk7XG4gICAgICAgICAgICBjb25zdCBhYnNUb3VjaE1vdmVZID0gTWF0aC5hYnModGhpcy50b3VjaE1vdmVZKTtcbiAgICAgICAgICAgIHRoaXMuc3dpcGluZ0hvcml6b250YWwgPSBhYnNUb3VjaE1vdmVYID4gdGhpcy50aHJlc2hvbGRYO1xuICAgICAgICAgICAgdGhpcy5zd2lwaW5nVmVydGljYWwgPSBhYnNUb3VjaE1vdmVZID4gdGhpcy50aHJlc2hvbGRZO1xuICAgICAgICAgICAgdGhpcy5zd2lwaW5nRGlyZWN0aW9uID1cbiAgICAgICAgICAgICAgICBhYnNUb3VjaE1vdmVYID4gYWJzVG91Y2hNb3ZlWVxuICAgICAgICAgICAgICAgICAgICA/IHRoaXMuc3dpcGluZ0hvcml6b250YWxcbiAgICAgICAgICAgICAgICAgICAgICAgID8gJ2hvcml6b250YWwnXG4gICAgICAgICAgICAgICAgICAgICAgICA6ICdwcmUtaG9yaXpvbnRhbCdcbiAgICAgICAgICAgICAgICAgICAgOiB0aGlzLnN3aXBpbmdWZXJ0aWNhbFxuICAgICAgICAgICAgICAgICAgICAgICAgPyAndmVydGljYWwnXG4gICAgICAgICAgICAgICAgICAgICAgICA6ICdwcmUtdmVydGljYWwnO1xuICAgICAgICAgICAgaWYgK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pID09PSBudWxsIHx8IF9hID09PSB2b2lkIDAgPyB2b2lkIDAgOiBfYS5pZGVudGlmaWVyKTsgfSkpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnRvdWNoMSA9IG51bGw7XG4gICAgICAgICAgICAgICAgdGhpcy50b3VjaE1vdmUxID0gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghWy4uLmV2ZW50LnRvdWNoZXNdLmZpbmQoKHRvdWNoKSA9PiB7IHZhciBfYTsgcmV0dXJuIHRvdWNoLmlkZW50aWZpZXIgPT09ICgoX2EgPSB0aGlzLnRvdWNoMikgPT09IG51bGwgfHwgX2EgPT09IHZvaWQgMCA/IHZvaWQgMCA6IF9hLmlkZW50aWZpZXIpOyB9KSkge1xuICAgICAgICAgICAgICAgIHRoaXMudG91Y2gyID0gbnVsbDtcbiAgICAgICAgICAgICAgICB0aGlzLnRvdWNoTW92ZTIgPSBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChldmVudC50eXBlID09PSAnbW91c2V1cCcgJiYgKCF0aGlzLnRvdWNoU3RhcnRYIHx8IHRoaXMudG91Y2hFbmRYICE9PSBudWxsKSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmIChldmVudC50eXBlID09PSAnbW91c2V1cCcgfHwgdG91Y2gxKSB7XG4gICAgICAgICAgICB0aGlzLnRvdWNoRW5kWCA9IGV2ZW50LnR5cGUgPT09ICdtb3VzZXVwJyA/IGV2ZW50LnNjcmVlblggOiAoX2EgPSB0b3VjaDEgPT09IG51bGwgfHwgdG91Y2gxID09PSB2b2lkIDAgPyB2b2lkIDAgOiB0b3VjaDEuc2NyZWVuWCkgIT09IG51bGwgJiYgX2EgIT09IHZvaWQgMCA/IF9hIDogMDtcbiAgICAgICAgICAgIHRoaXMudG91Y2hFbmRZID0gZXZlbnQudHlwZSA9PT0gJ21vdXNldXAnID8gZXZlbnQuc2NyZWV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mJiAoYWJzRGlzdGFuY2UgPiB0aGlzLnRocmVzaG9sZFggfHwgYWJzRGlzdGFuY2UgPiB0aGlzLnRocmVzaG9sZFkpKSkge1xuICAgICAgICAgICAgICAgIHRoaXMuc3dpcGVkSG9yaXpvbnRhbCA9IGFic1ggPiB0aGlzLnRocmVzaG9sZFggfHwgKHRoaXMub3B0cy5kaWFnb25hbFN3aXBlcyAmJiBhYnNEaXN0YW5jZSA+IHRoaXMudGhyZXNob2xkWCk7XG4gICAgICAgICAgICAgICAgdGhpcy5zd2lwZWRWZXJ0aWNhbCA9IGFic1kgPiB0aGlzLnRocmVzaG9sZFkgfHwgKHRoaXMub3B0cy5kaWFnb25hbFN3aXBlcyAmJiBhYnNEaXN0YW5jZSA+IHRoaXMudGhyZXNob2xkWSk7XG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLm9wdHMuZGlhZ29uYWxTd2lwZXMgfHxcbiAgICAgICAgICAgICAgICAgICAgZGlhZ29uYWwgPCBNYXRoLnRhbigoKDQ1IC0gdGhpcy5vcHRzLmRpYWdvbmFsTGltaXQpICogTWF0aC5QSSkgLyAxODApIHx8XG4gICAgICAgICAgICAgICAgICAgIGRpYWdvbmFsID4gTWF0aC50YW4oKCg0NSArIHRoaXMub3B0cy5kaWFnb25hbExpbWl0KSAqIE1hdGguUEkpIC8gMTgwKSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoYWJzWCA+PSBhYnNZKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnN3aXBlZFZlcnRpY2FsID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKGFic1kgPiBhYnNYKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnN3aXBlZEhvcml6b250YWwgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAodGhpcy5zd2lwZWRIb3Jpem9udGFsKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh4IDwgMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoX2YgPSB0aGlzLnZlbG9jaXR5WCkgIT09IG51bGwgJiYgX2YgIT09IHZvaWQgMCA/IF9mIDogMCkgPCAtdGhpcy5vcHRzLnZlbG9jaXR5VGhyZXNob2xkIHx8IGRpc3RhbmNlIDwgLXRoaXMuZGlzcmVnYXJkVmVsb2NpdHlUaHJlc2hvbGRYKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5maXJlKCdzd2lwZWxlZnQnLCBldmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChfZyA9IHRoaXMudmVsb2NpdHlYKSAhPT0gbnVsbCAmJiBfZyAhPT0gdm9pZCAwID8gX2cgOiAwKSA+IHRoaXMub3B0cy52ZWxvY2l0eVRocmVzaG9sZCB8fCBkaXN0YW5jZSA+IHRoaXMuZGlzcmVnYXJkVmVsb2NpdHlUaHJlc2hvbGRYKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5maXJlKCdzd2lwZXJpZ2h0JywgZXZlbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICh0aGlzLnN3aXBlZFZlcnRpY2FsKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh5IDwgMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoX2ggPSB0aGlzLnZlbG9jaXR5WSkgIT09IG51bGwgJiYgX2ggIT09IHZvaWQgMCA/IF9oIDogMCkgPCAtdGhpcy5vcHRzLnZlbG9jaXR5VGhyZXNob2xkIHx8IGRpc3RhbmNlIDwgLXRoaXMuZGlzcmVnYXJkVmVsb2NpdHlUaHJlc2hvbGRZKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5maXJlKCdzd2lwZXVwJywgZXZlbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoX2ogPSB0aGlzLnZlbG9jaXR5WSkgIT09IG51bGwgJiYgX2ogIT09IHZvaWQgMCA/IF9qIDogMCkgPiB0aGlzLm9wdHMudmVsb2NpdHlUaHJlc2hvbGQgfHwgZGlzdGFuY2UgPiB0aGlzLmRpc3JlZ2FyZFZlbG9jaXR5VGhyZXNob2xkWSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZmlyZSgnc3dpcGVkb3duJywgZXZlbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoYWJzWCA8IHRoaXMub3B0cy5wcmVzc1RocmVzaG9sZCAmJiBhYnNZIDwgdGhpcy5vcHRzLnByZXNzVGhyZXNob2xkKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuZG91YmxlVGFwV2FpdGluZykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmRvdWJsZVRhcFdhaXRpbmcgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KChfayA9IHRoaXMuZG91YmxlVGFwVGltZXIpICE9PSBudWxsICYmIF9rICE9PSB2b2lkIDAgPyBfayA6IHVuZGVmaW5lZCk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZmlyZSgnZG91YmxldGFwJywgZXZlbnQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB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wcm9kIGFuZCBkZXZcclxuLy8gZHVyaW5nIGJ1aWxkIHByb2Nlc3MsIGFzc2V0cyBhcmUgY29waWVkIGZyb20gbm9kZSBtb2R1bGUgaW50byByb290IGFuZCBkaXN0IGZvbGRlclxyXG4vLyBzZXRCYXNlUGF0aChcInNob2VsYWNlXCIpO1xyXG5kb2N1bWVudC5ib2R5Lm9ubG9hZCA9ICgpID0+IF9fYXdhaXRlcih2b2lkIDAsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkge1xyXG4gICAgdmFyIGdhbWUgPSBuZXcgR2FtZSgpO1xyXG4gICAgeWllbGQgZ2FtZS5Jbml0KCk7XHJcbiAgICBnYW1lLnN0YXJ0KCk7XHJcbn0pO1xyXG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0= \ No newline at end of file diff --git a/src/camera.ts b/src/camera.ts index 4d53fb5..ff5211d 100644 --- a/src/camera.ts +++ b/src/camera.ts @@ -426,155 +426,24 @@ export class Camera { } // this.ui.components.tileSelectionIndicator.handleClick(x, y); const tilePos = this.screenToTilePos(x, y); - - this.selectTileAt(tilePos.x, tilePos.y); + if (tilePos) { + this.selectTileAt(tilePos.x, tilePos.y); + } }; public screenToTilePos(x: number, y: number): Point { - // offset from center of viewport/container - const scale = this.ui.gameDisplay.stage.scale.x; - const pivot = this.ui.gameDisplay.stage.pivot; - const viewport = this.viewportUnpadded; - // calculate initial pivot based on map size and tile size - const screenCenterX = this.ui.gameCanvasContainer.clientWidth / 2; - const screenCenterY = this.ui.gameCanvasContainer.clientHeight / 2; - const pivotX = pivot.x; - const pivotY = pivot.y; - - const centerTileX = viewport.center.x; - const centerTileY = viewport.center.y; - const centerTileScreenX = centerTileX * Tile.size; - const centerTileScreenY = centerTileY * Tile.size; - console.log("centerScreenX", centerTileScreenX); - const pivotDiffX = pivotX - centerTileScreenX; - const pivotDiffY = pivotY - centerTileScreenY; - console.log("pivotDiffX", pivotDiffX); - - // const pixelOffsetFromTileCenter = pivot.x % Tile.size; - // console.log("pixel offset from tile center", pixelOffsetFromTileCenter); - - // take into account how offset the stage is from the center of the tile - console.log( - "calculate offset, pivot, tile size, scale", - pivot.x, - Tile.size, - scale - ); - - const screenCenterXScaled = (screenCenterX - pivotDiffX) / scale; - const screenCenterYScaled = (screenCenterY - pivotDiffY) / scale; - const scaledClickOffsetX = x / scale - screenCenterXScaled; - const scaledClickOffsetY = y / scale - screenCenterYScaled; - - const tileOffsetX = Math.round(scaledClickOffsetX / Tile.size); - const tileOffsetY = Math.round(scaledClickOffsetY / Tile.size); - const tileX = viewport.center.x + tileOffsetX; - const tileY = viewport.center.y + tileOffsetY; - return new Point(tileX, tileY); + for (const key of this.viewportTilesUnpadded) { + const point = MapWorld.keyToPoint(key); + const sprite = this.game.renderer.getFromCache(point, Layer.TERRAIN); + if (sprite) { + const bounds = sprite.getBounds(); + if (bounds.contains(x, y)) { + return point; + } + } + } } - // public screenToTilePos(x: number, y: number): Point { - // // offset from center of viewport/container - // const scale = this.ui.gameDisplay.stage.scale.x; - // const pivot = this.ui.gameDisplay.stage.pivot; - // const viewport = this.getViewportInTiles(false); - // // calculate initial pivot based on map size and tile size - // const initialPivotX = (this.game.gameSize.width * Tile.size) / 2; - // const initialPivotY = (this.game.gameSize.height * Tile.size) / 2; - // const screenCenterX = this.ui.gameCanvasContainer.clientWidth / 2; - // const screenCenterY = this.ui.gameCanvasContainer.clientHeight / 2; - // const pivotX = pivot.x; - // const pivotY = pivot.y; - - // const centerTileX = viewport.center.x; - // const centerTileY = viewport.center.y; - // const centerScreenX = centerTileX * Tile.size; - // const centerScreenY = centerTileY * Tile.size; - // console.log("centerScreenX", centerScreenX); - // const pivotDiffX = pivotX - centerScreenX; - // const pivotDiffY = pivotY - centerScreenY; - // console.log("pivotDiffX", pivotDiffX); - - // // const pixelOffsetFromTileCenter = pivot.x % Tile.size; - // // console.log("pixel offset from tile center", pixelOffsetFromTileCenter); - - // // take into account how offset the stage is from the center of the tile - // console.log( - // "calculate offset, pivot, tile size, scale", - // pivot.x, - // Tile.size, - // scale - // ); - - // const screenCenterXScaled = (screenCenterX - pivotDiffX) / scale; - // const screenCenterYScaled = (screenCenterY - pivotDiffY) / scale; - // const scaledClickOffsetX = x / scale - screenCenterXScaled; - // const scaledClickOffsetY = y / scale - screenCenterYScaled; - - // const tileOffsetX = Math.round(scaledClickOffsetX / Tile.size); - // const tileOffsetY = Math.round(scaledClickOffsetY / Tile.size); - // const tileX = viewport.center.x + tileOffsetX; - // const tileY = viewport.center.y + tileOffsetY; - // return new Point(tileX, tileY); - // } - - // public screenToTilePos(x: number, y: number): Point { - // // offset from center of viewport/container - // const scale = this.ui.gameDisplay.stage.scale.x; - // const pivot = this.ui.gameDisplay.stage.pivot; - // const viewport = this.getViewportInTiles(false); - // let centerX = this.ui.gameCanvasContainer.clientWidth / 2; - // const centerY = this.ui.gameCanvasContainer.clientHeight / 2; - // // take into account how offset the stage is from the center of the tile - - // const pixelOffsetFromTileCenter = pivot.x % Tile.size; - // console.log("pixel offset from tile center", pixelOffsetFromTileCenter); - // // const scaledTileSizeX = Tile.size / scale; - // // const centerTileOffsetX = - // // ((pivot.x * 100000) % Math.round(Tile.size * 100000)) / 100000; - - // const centerTileOffsetY = pivot.y % (Tile.size / scale); - // const centerTileOffsetX = pixelOffsetFromTileCenter; - // console.log("centerTileOffsetX", centerTileOffsetX); - // console.log("pivotX, scaledtilesize, ", pivot.x, Tile.size / scale); - // centerX -= centerTileOffsetX; - - // const centerXScaled = centerX / scale; - // const centerYScaled = centerY / scale; - // const scaledClickOffsetX = (x + centerTileOffsetX) / scale - centerXScaled; - // const scaledClickOffsetY = (y - centerTileOffsetY) / scale - centerYScaled; - // // console.log("scaledClickOffsetX", scaledClickOffsetX); - - // const tileOffsetX = Math.round(scaledClickOffsetX / Tile.size); - // const tileOffsetY = Math.round(scaledClickOffsetY / Tile.size); - // const tileX = viewport.center.x + tileOffsetX; - // const tileY = viewport.center.y + tileOffsetY; - // return new Point(tileX, tileY); - // } - - // public screenToTilePos(x: number, y: number): Point { - // // offset from center of viewport/container - // const scale = this.ui.gameDisplay.stage.scale.x; - // const pivot = this.ui.gameDisplay.stage.pivot; - // const viewport = this.getViewportInTiles(false); - // const centerX = this.ui.gameCanvasContainer.clientWidth / 2; - // const centerY = this.ui.gameCanvasContainer.clientHeight / 2; - // // take into account how offset the stage is from the center of the tile - // const centerTileOffsetX = pivot.x % Tile.size; - // const centerTileOffsetY = pivot.y % Tile.size; - - // const centerXScaled = centerX / scale; - // const centerYScaled = centerY / scale; - // const scaledClickOffsetX = (x - centerTileOffsetX) / scale - centerXScaled; - // const scaledClickOffsetY = (y - centerTileOffsetY) / scale - centerYScaled; - - // const tileOffsetX = Math.round(scaledClickOffsetX / Tile.size); - // const tileOffsetY = Math.round(scaledClickOffsetY / Tile.size); - // const tileX = viewport.center.x + tileOffsetX; - // const tileY = viewport.center.y + tileOffsetY; - // return new Point(tileX, tileY); - // } - private handlePanStart = (g: TinyGesture) => { // console.log("pan start", g.velocityX, g.velocityY); // console.log( diff --git a/src/web-components/indicator-tile-selection.ts b/src/web-components/indicator-tile-selection.ts index e49489c..1f0fbc1 100644 --- a/src/web-components/indicator-tile-selection.ts +++ b/src/web-components/indicator-tile-selection.ts @@ -142,58 +142,4 @@ export class IndicatorTileSelection extends HTMLElement { this.isVisible = visible; this.style.display = visible ? "block" : "none"; } - - public handleClick(x: number, y: number) { - console.log("handle click", x, y); - const clickedPos = this.screenToTilePos(x, y); - console.log("clicked pos", clickedPos); - const clickedTile = this.game.map.getTile(clickedPos.x, clickedPos.y); - console.log("clicked tile", clickedTile); - this.game.map.setTile(clickedPos.x, clickedPos.y, Tile.shrub); - } - - public screenToTilePos(x: number, y: number): Point { - // offset from center of viewport/container - const scale = this.game.userInterface.gameDisplay.stage.scale.x; - const pivot = this.game.userInterface.gameDisplay.stage.pivot; - const viewport = this.game.userInterface.camera.getViewport().padded; - // calculate initial pivot based on map size and tile size - const screenCenterX = - this.game.userInterface.gameCanvasContainer.clientWidth / 2; - const screenCenterY = - this.game.userInterface.gameCanvasContainer.clientHeight / 2; - const pivotX = pivot.x; - const pivotY = pivot.y; - - const centerTileX = viewport.center.x; - const centerTileY = viewport.center.y; - const centerTileScreenX = centerTileX * Tile.size; - const centerTileScreenY = centerTileY * Tile.size; - console.log("--- centerScreenX", centerTileScreenX); - const pivotDiffX = pivotX - centerTileScreenX; - const pivotDiffY = pivotY - centerTileScreenY; - console.log("--- pivotDiffX", pivotDiffX); - - // const pixelOffsetFromTileCenter = pivot.x % Tile.size; - // console.log("pixel offset from tile center", pixelOffsetFromTileCenter); - - // take into account how offset the stage is from the center of the tile - console.log( - "--- calculate offset, pivot, tile size, scale", - pivot.x, - Tile.size, - scale - ); - - const screenCenterXScaled = (screenCenterX - pivotDiffX) / scale; - const screenCenterYScaled = (screenCenterY - pivotDiffY) / scale; - const scaledClickOffsetX = x / scale - screenCenterXScaled; - const scaledClickOffsetY = y / scale - screenCenterYScaled; - - const tileOffsetX = Math.round(scaledClickOffsetX / Tile.size); - const tileOffsetY = Math.round(scaledClickOffsetY / Tile.size); - const tileX = viewport.center.x + tileOffsetX; - const tileY = viewport.center.y + tileOffsetY; - return new Point(tileX, tileY); - } }