diff --git a/dist/tangram.debug.js b/dist/tangram.debug.js index 84bfd0b4d..a725bad4a 100644 --- a/dist/tangram.debug.js +++ b/dist/tangram.debug.js @@ -39283,8 +39283,16 @@ var Layer = function () { // Denormalize layer name to draw groups if (this.draw) { for (var group in this.draw) { - this.draw[group] = this.draw[group] || {}; - this.draw[group].layer_name = this.full_name; + if (this.draw[group] == null || (0, _typeof3.default)(this.draw[group]) !== 'object') { + // Invalid draw group + var msg = 'Draw group \'' + group + '\' for layer ' + this.full_name + ' is invalid, must be an object, '; + msg += 'but was set to `' + group + ': ' + this.draw[group] + '` instead'; + (0, _log2.default)('warn', msg); // TODO: fire external event that clients to subscribe to + + delete this.draw[group]; + } else { + this.draw[group].layer_name = this.full_name; + } } } } @@ -39314,7 +39322,7 @@ var Layer = function () { // Invalid filter var msg = 'Filter for layer ' + this.full_name + ' is invalid, filter value must be an object or function, '; msg += 'but was set to `filter: ' + this.filter + '` instead'; - (0, _log2.default)('warn', msg); + (0, _log2.default)('warn', msg); // TODO: fire external event that clients to subscribe to return; } @@ -39330,7 +39338,7 @@ var Layer = function () { // Invalid filter var _msg = 'Filter for layer ' + this.full_name + ' is invalid, `filter: ' + (0, _stringify2.default)(this.filter) + '` '; _msg += 'failed with error \'' + e.message + '\', stack trace: ' + e.stack; - (0, _log2.default)('warn', _msg); + (0, _log2.default)('warn', _msg); // TODO: fire external event that clients to subscribe to } } @@ -39639,7 +39647,7 @@ function parseLayerTree(name, layer, parent, styles) { } msg += ' instead?'; } - (0, _log2.default)('warn', msg); + (0, _log2.default)('warn', msg); // TODO: fire external event that clients to subscribe to } } } @@ -46343,11 +46351,13 @@ var MediaCapture = function () { var url = _utils2.default.createObjectURL(blob); // Explicitly remove all stream tracks, and set objects to null - var tracks = cap.stream.getTracks(); - tracks.forEach(function (track) { - track.stop(); - cap.stream.removeTrack(track); - }); + if (cap.stream) { + var tracks = cap.stream.getTracks() || []; + tracks.forEach(function (track) { + track.stop(); + cap.stream.removeTrack(track); + }); + } cap.stream = null; cap.media_recorder = null; _this2.video_capture = null; @@ -47591,7 +47601,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var pkg = JSON.parse("{\n \"name\": \"tangram\",\n \"version\": \"0.10.3\",\n \"description\": \"WebGL Maps for Vector Tiles\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git://github.com/tangrams/tangram.git\"\n },\n \"main\": \"dist/tangram.min.js\",\n \"homepage\": \"https://github.com/tangrams/tangram\",\n \"keywords\": [\n \"maps\",\n \"graphics\",\n \"rendering\",\n \"visualization\",\n \"WebGL\",\n \"OpenStreetMap\"\n ],\n \"scripts\": {\n \"start\": \"npm run watch\",\n \"test\": \"npm run lint && npm run build-test && npm run test-local\",\n \"test-ci\": \"npm run lint && npm run build-test && npm run test-remote\",\n \"test-remote\": \"./node_modules/karma/bin/karma start --browsers SL_Firefox --single-run\",\n \"test-local\": \"./node_modules/karma/bin/karma start --browsers Chrome --single-run\",\n \"karma-start\": \"./node_modules/karma/bin/karma start --browsers Chrome --no-watch\",\n \"karma-run\": \"./node_modules/karma/bin/karma run --browsers Chrome\",\n \"lint\": \"$(npm bin)/jshint src/ && jshint test/\",\n \"build\": \"npm run build-bundle -- -o dist/tangram.debug.js && npm run build-minify\",\n \"build-test\": \"npm run build-bundle -- -o dist/tangram.test.js\",\n \"build-debug\": \"npm run build-bundle -- -o dist/tangram.debug.js\",\n \"build-bundle\": \"$(npm bin)/browserify src/module.js -t [ babelify --presets [ es2015 ] --plugins transform-runtime ] -t brfs -s Tangram -p browserify-derequire --debug\",\n \"build-minify\": \"$(npm bin)/uglifyjs dist/tangram.debug.js -c warnings=false -m -o dist/tangram.min.js && npm run build-size\",\n \"build-size\": \"gzip dist/tangram.min.js -c | wc -c | awk '{kb=$1/1024; print kb}' OFMT='%.0fk minified+gzipped'\",\n \"watch\": \"$(npm bin)/budo src/module.js:dist/tangram.debug.js --port 8000 --cors --live -- -t [ babelify --presets [ es2015 ] --plugins transform-runtime ] -t brfs -s Tangram\"\n },\n \"author\": {\n \"name\": \"Mapzen\",\n \"email\": \"tangram@mapzen.com\"\n },\n \"contributors\": [\n {\n \"name\": \"Brett Camper\"\n },\n {\n \"name\": \"Peter Richardson\"\n },\n {\n \"name\": \"Patricio Gonzalez Vivo\"\n },\n {\n \"name\": \"Karim Naaji\"\n },\n {\n \"name\": \"Ivan Willig\"\n },\n {\n \"name\": \"Lou Huang\"\n },\n {\n \"name\": \"David Valdman\"\n }\n ],\n \"license\": \"MIT\",\n \"dependencies\": {\n \"babel-runtime\": \"6.11.6\",\n \"box-intersect\": \"1.0.0\",\n \"brfs\": \"1.4.3\",\n \"csscolorparser\": \"1.0.3\",\n \"earcut\": \"2.1.1\",\n \"fontfaceobserver\": \"1.7.1\",\n \"geojson-vt\": \"2.1.6\",\n \"gl-mat3\": \"1.0.0\",\n \"gl-mat4\": \"1.1.4\",\n \"gl-shader-errors\": \"1.0.3\",\n \"js-yaml\": \"tangrams/js-yaml#read-only\",\n \"jszip\": \"tangrams/jszip#read-only\",\n \"match-feature\": \"tangrams/match-feature#v1.3.1\",\n \"pbf\": \"1.3.2\",\n \"strip-comments\": \"0.3.2\",\n \"topojson\": \"1.6.19\",\n \"vector-tile\": \"1.1.2\"\n },\n \"devDependencies\": {\n \"babelify\": \"7.3.0\",\n \"babel-plugin-transform-runtime\": \"6.12.0\",\n \"babel-preset-es2015\": \"6.13.2\",\n \"browserify\": \"13.0.1\",\n \"browserify-derequire\": \"0.9.4\",\n \"budo\": \"8.2.1\",\n \"chai\": \"1.9.2\",\n \"chai-as-promised\": \"4.1.1\",\n \"glob\": \"4.0.6\",\n \"jshint\": \"jshint/jshint#3a8efa979dbb157bfb5c10b5826603a55a33b9ad\",\n \"karma\": \"0.12.23\",\n \"karma-browserify\": \"5.1.0\",\n \"karma-chrome-launcher\": \"0.1.4\",\n \"karma-mocha\": \"0.1.9\",\n \"karma-mocha-reporter\": \"1.0.0\",\n \"karma-sauce-launcher\": \"tangrams/karma-sauce-launcher#firefox-profiles\",\n \"karma-sinon\": \"1.0.4\",\n \"mocha\": \"1.21.4\",\n \"sinon\": \"1.10.3\",\n \"uglify-js\": \"2.4.14\",\n \"yargs\": \"1.3.2\"\n }\n}\n"); +var pkg = JSON.parse("{\n \"name\": \"tangram\",\n \"version\": \"0.10.4\",\n \"description\": \"WebGL Maps for Vector Tiles\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git://github.com/tangrams/tangram.git\"\n },\n \"main\": \"dist/tangram.min.js\",\n \"homepage\": \"https://github.com/tangrams/tangram\",\n \"keywords\": [\n \"maps\",\n \"graphics\",\n \"rendering\",\n \"visualization\",\n \"WebGL\",\n \"OpenStreetMap\"\n ],\n \"scripts\": {\n \"start\": \"npm run watch\",\n \"test\": \"npm run lint && npm run build-test && npm run test-local\",\n \"test-ci\": \"npm run lint && npm run build-test && npm run test-remote\",\n \"test-remote\": \"./node_modules/karma/bin/karma start --browsers SL_Firefox --single-run\",\n \"test-local\": \"./node_modules/karma/bin/karma start --browsers Chrome --single-run\",\n \"karma-start\": \"./node_modules/karma/bin/karma start --browsers Chrome --no-watch\",\n \"karma-run\": \"./node_modules/karma/bin/karma run --browsers Chrome\",\n \"lint\": \"$(npm bin)/jshint src/ && jshint test/\",\n \"build\": \"npm run build-bundle -- -o dist/tangram.debug.js && npm run build-minify\",\n \"build-test\": \"npm run build-bundle -- -o dist/tangram.test.js\",\n \"build-debug\": \"npm run build-bundle -- -o dist/tangram.debug.js\",\n \"build-bundle\": \"$(npm bin)/browserify src/module.js -t [ babelify --presets [ es2015 ] --plugins transform-runtime ] -t brfs -s Tangram -p browserify-derequire --debug\",\n \"build-minify\": \"$(npm bin)/uglifyjs dist/tangram.debug.js -c warnings=false -m -o dist/tangram.min.js && npm run build-size\",\n \"build-size\": \"gzip dist/tangram.min.js -c | wc -c | awk '{kb=$1/1024; print kb}' OFMT='%.0fk minified+gzipped'\",\n \"watch\": \"$(npm bin)/budo src/module.js:dist/tangram.debug.js --port 8000 --cors --live -- -t [ babelify --presets [ es2015 ] --plugins transform-runtime ] -t brfs -s Tangram\"\n },\n \"author\": {\n \"name\": \"Mapzen\",\n \"email\": \"tangram@mapzen.com\"\n },\n \"contributors\": [\n {\n \"name\": \"Brett Camper\"\n },\n {\n \"name\": \"Peter Richardson\"\n },\n {\n \"name\": \"Patricio Gonzalez Vivo\"\n },\n {\n \"name\": \"Karim Naaji\"\n },\n {\n \"name\": \"Ivan Willig\"\n },\n {\n \"name\": \"Lou Huang\"\n },\n {\n \"name\": \"David Valdman\"\n }\n ],\n \"license\": \"MIT\",\n \"dependencies\": {\n \"babel-runtime\": \"6.11.6\",\n \"box-intersect\": \"1.0.0\",\n \"brfs\": \"1.4.3\",\n \"csscolorparser\": \"1.0.3\",\n \"earcut\": \"2.1.1\",\n \"fontfaceobserver\": \"1.7.1\",\n \"geojson-vt\": \"2.1.6\",\n \"gl-mat3\": \"1.0.0\",\n \"gl-mat4\": \"1.1.4\",\n \"gl-shader-errors\": \"1.0.3\",\n \"js-yaml\": \"tangrams/js-yaml#read-only\",\n \"jszip\": \"tangrams/jszip#read-only\",\n \"match-feature\": \"tangrams/match-feature#v1.3.1\",\n \"pbf\": \"1.3.2\",\n \"strip-comments\": \"0.3.2\",\n \"topojson\": \"1.6.19\",\n \"vector-tile\": \"1.1.2\"\n },\n \"devDependencies\": {\n \"babelify\": \"7.3.0\",\n \"babel-plugin-transform-runtime\": \"6.12.0\",\n \"babel-preset-es2015\": \"6.13.2\",\n \"browserify\": \"13.0.1\",\n \"browserify-derequire\": \"0.9.4\",\n \"budo\": \"8.2.1\",\n \"chai\": \"1.9.2\",\n \"chai-as-promised\": \"4.1.1\",\n \"glob\": \"4.0.6\",\n \"jshint\": \"jshint/jshint#3a8efa979dbb157bfb5c10b5826603a55a33b9ad\",\n \"karma\": \"0.12.23\",\n \"karma-browserify\": \"5.1.0\",\n \"karma-chrome-launcher\": \"0.1.4\",\n \"karma-mocha\": \"0.1.9\",\n \"karma-mocha-reporter\": \"1.0.0\",\n \"karma-sauce-launcher\": \"tangrams/karma-sauce-launcher#firefox-profiles\",\n \"karma-sinon\": \"1.0.4\",\n \"mocha\": \"1.21.4\",\n \"sinon\": \"1.10.3\",\n \"uglify-js\": \"2.4.14\",\n \"yargs\": \"1.3.2\"\n }\n}\n"); var version = void 0; exports.default = version = 'v' + pkg.version; @@ -48831,4 +48841,4 @@ exports.default = View; },{"./camera":298,"./geo":299,"./tile":346,"./utils/log":352,"./utils/subscribe":356,"./utils/utils":358,"babel-runtime/core-js/object/keys":15,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22,"babel-runtime/helpers/slicedToArray":27}]},{},[321])(321) }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJub2RlX21vZHVsZXMvYXNhcC9icm93c2VyLWFzYXAuanMiLCJub2RlX21vZHVsZXMvYXNhcC9icm93c2VyLXJhdy5qcyIsIm5vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvYXJyYXkvZnJvbS5qcyIsIm5vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvZ2V0LWl0ZXJhdG9yLmpzIiwibm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9pcy1pdGVyYWJsZS5qcyIsIm5vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvanNvbi9zdHJpbmdpZnkuanMiLCJub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL21hcC5qcyIsIm5vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvbWF0aC9sb2cyLmpzIiwibm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvYXNzaWduLmpzIiwibm9kZV9tb2R1bGVzL2J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sID8gJ0Z1bGwnIDogJycpXG5cbiAgdmFyIGNvZGUgPSBbJ2Z1bmN0aW9uICcsIGZ1bmNOYW1lLCAnKCcsIEFSR1Muam9pbigpLCAnKXsnLFxuICAgICd2YXIgJywgRUxFTV9TSVpFLCAnPTIqJywgRElNRU5TSU9OLCAnOyddXG5cbiAgdmFyIHJlZExvb3AgPSBcbiAgICAnZm9yKHZhciBpPScgKyBSRURfU1RBUlQgKyAnLCcgKyBSRURfUFRSICsgJz0nICsgRUxFTV9TSVpFICsgJyonICsgUkVEX1NUQVJUICsgJzsnICtcbiAgICAgICAgJ2k8JyArIFJFRF9FTkQgKyc7JyArXG4gICAgICAgICcrK2ksJyArIFJFRF9QVFIgKyAnKz0nICsgRUxFTV9TSVpFICsgJyl7JyArXG4gICAgICAgICd2YXIgeDA9JyArIFJFRF9CT1hFUyArICdbJyArIEFYSVMgKyAnKycgKyBSRURfUFRSICsgJ10sJyArXG4gICAgICAgICAgICAneDE9JyArIFJFRF9CT1hFUyArICdbJyArIEFYSVMgKyAnKycgKyBSRURfUFRSICsgJysnICsgRElNRU5TSU9OICsgJ10sJyArXG4gICAgICAgICAgICAneGk9JyArIFJFRF9JTkRFWCArICdbaV07J1xuXG4gIHZhciBibHVlTG9vcCA9IFxuICAgICdmb3IodmFyIGo9JyArIEJMVUVfU1RBUlQgKyAnLCcgKyBCTFVFX1BUUiArICc9JyArIEVMRU1fU0laRSArICcqJyArIEJMVUVfU1RBUlQgKyAnOycgK1xuICAgICAgICAnajwnICsgQkxVRV9FTkQgKyAnOycgK1xuICAgICAgICAnKytqLCcgKyBCTFVFX1BUUiArICcrPScgKyBFTEVNX1NJWkUgKyAnKXsnICtcbiAgICAgICAgJ3ZhciB5MD0nICsgQkxVRV9CT1hFUyArICdbJyArIEFYSVMgKyAnKycgKyBCTFVFX1BUUiArICddLCcgK1xuICAgICAgICAgICAgKGZ1bGwgPyAneTE9JyArIEJMVUVfQk9YRVMgKyAnWycgKyBBWElTICsgJysnICsgQkxVRV9QVFIgKyAnKycgKyBESU1FTlNJT04gKyAnXSwnIDogJycpICtcbiAgICAgICAgICAgICd5aT0nICsgQkxVRV9JTkRFWCArICdbal07J1xuXG4gIGlmKHJlZE1ham9yKSB7XG4gICAgY29kZS5wdXNoKHJlZExvb3AsIElOTkVSX0xBQkVMLCAnOicsIGJsdWVMb29wKVxuICB9IGVsc2Uge1xuICAgIGNvZGUucHVzaChibHVlTG9vcCwgSU5ORVJfTEFCRUwsICc6JywgcmVkTG9vcClcbiAgfVxuXG4gIGlmKGZ1bGwpIHtcbiAgICBjb2RlLnB1c2goJ2lmKHkxPHgwfHx4MTx5MCljb250aW51ZTsnKVxuICB9IGVsc2UgaWYoZmxpcCkge1xuICAgIGNvZGUucHVzaCgnaWYoeTA8PXgwfHx4MTx5MCljb250aW51ZTsnKVxuICB9IGVsc2Uge1xuICAgIGNvZGUucHVzaCgnaWYoeTA8eDB8fHgxPHkwKWNvbnRpbnVlOycpXG4gIH1cblxuICBjb2RlLnB1c2goJ2Zvcih2YXIgaz0nK0FYSVMrJysxO2s8JytESU1FTlNJT04rJzsrK2speycrXG4gICAgJ3ZhciByMD0nK1JFRF9CT1hFUysnW2srJytSRURfUFRSKyddLCcrXG4gICAgICAgICdyMT0nK1JFRF9CT1hFUysnW2srJytESU1FTlNJT04rJysnK1JFRF9QVFIrJ10sJytcbiAgICAgICAgJ2IwPScrQkxVRV9CT1hFUysnW2srJytCTFVFX1BUUisnXSwnK1xuICAgICAgICAnYjE9JytCTFVFX0JPWEVTKydbaysnK0RJTUVOU0lPTisnKycrQkxVRV9QVFIrJ107JytcbiAgICAgICdpZihyMTxiMHx8YjE8cjApY29udGludWUgJyArIElOTkVSX0xBQkVMICsgJzt9JyArXG4gICAgICAndmFyICcgKyBSRVRWQUwgKyAnPScgKyBWSVNJVCArICcoJylcblxuICBpZihmbGlwKSB7XG4gICAgY29kZS5wdXNoKCd5aSx4aScpXG4gIH0gZWxzZSB7XG4gICAgY29kZS5wdXNoKC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gICAgICAgICAgcmVkU3RhcnQsIHJlZDAsIHJlZCwgcmVkSW5kZXgpXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgcmV0dmFsID0gc3dlZXAuc3dlZXBCaXBhcnRpdGUoXG4gICAgICAgICAgICBkLCB2aXNpdCxcbiAgICAgICAgICAgIHJlZFN0YXJ0LCByZWQwLCByZWQsIHJlZEluZGV4LFxuICAgICAgICAgICAgYmx1ZVN0YXJ0LCBibHVlRW5kLCBibHVlLCBibHVlSW5kZXgpXG4gICAgICAgIH1cbiAgICAgICAgaWYocmV0dmFsICE9PSB2b2lkIDApIHtcbiAgICAgICAgICByZXR1cm4gcmV0dmFsXG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGl0ZXJQdXNoKHRvcCsrLFxuICAgICAgICAgIGF4aXMrMSxcbiAgICAgICAgICByZWRTdGFydCwgcmVkMCxcbiAgICAgICAgICBibHVlU3RhcnQsIGJsdWVFbmQsXG4gICAgICAgICAgZmxpcCxcbiAgICAgICAgICAtSW5maW5pdHksIEluZmluaXR5KVxuICAgICAgICBpdGVyUHVzaCh0b3ArKyxcbiAgICAgICAgICBheGlzKzEsXG4gICAgICAgICAgYmx1ZVN0YXJ0LCBibHVlRW5kLFxuICAgICAgICAgIHJlZFN0YXJ0LCByZWQwLFxuICAgICAgICAgIGZsaXBeMSxcbiAgICAgICAgICAtSW5maW5pdHksIEluZmluaXR5KVxuICAgICAgfVxuICAgIH1cblxuICAgIC8vRGl2aWRlIGFuZCBjb25xdWVyIHBoYXNlXG4gICAgaWYocmVkMCA8IHJlZEVuZCkge1xuXG4gICAgICAvL0N1dCBibHVlIGludG8gMyBwYXJ0czpcbiAgICAgIC8vXG4gICAgICAvLyAgUG9pbnRzIDwgbWlkIHBvaW50XG4gICAgICAvLyAgUG9pbnRzID0gbWlkIHBvaW50XG4gICAgICAvLyAgUG9pbnRzID4gbWlkIHBvaW50XG4gICAgICAvL1xuICAgICAgdmFyIGJsdWU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7XG4gICAgICAgICAgcmV0dmFsID0gb25lUG9pbnRGdWxsKFxuICAgICAgICAgICAgZCwgYXhpcywgdmlzaXQsXG4gICAgICAgICAgICByZWQwLCByZWRFbmQsIHJlZCwgcmVkSW5kZXgsXG4gICAgICAgICAgICBibHVlMCwgYmx1ZSwgYmx1ZUluZGV4W2JsdWUwXSlcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICByZXR2YWwgPSBvbmVQb2ludFBhcnRpYWwoXG4gICAgICAgICAgICBkLCBheGlzLCB2aXNpdCwgZmxpcCxcbiAgICAgICAgICAgIHJlZDAsIHJlZEVuZCwgcmVkLCByZWRJbmRleCxcbiAgICAgICAgICAgIGJsdWUwLCBibHVlLCBibHVlSW5kZXhbYmx1ZTBdKVxuICAgICAgICB9XG4gICAgICAgIGlmKHJldHZhbCAhPT0gdm9pZCAwKSB7XG4gICAgICAgICAgcmV0dXJuIHJldHZhbFxuICAgICAgICB9XG4gICAgICB9IGVsc2UgaWYoYmx1ZTAgPCBibHVlMSkge1xuICAgICAgICB2YXIgcmVkMVxuICAgICAgICBpZihmdWxsKSB7XG4gICAgICAgICAgLy9JZiBmdWxsIGludGVyc2VjdGlvbiwgbmVlZCB0byBoYW5kbGUgc3BlY2lhbCBjYXNlXG4gICAgICAgICAgcmVkMSA9IHBhcnRpdGlvbkNvbnRhaW5zUG9pbnQoXG4gICAgICAgICAgICBkLCBheGlzLFxuICAgICAgICAgICAgcmVkMCwgcmVkRW5kLCByZWQsIHJlZEluZGV4LFxuICAgICAgICAgICAgbWlkKVxuICAgICAgICAgIGlmKHJlZDAgPCByZWQxKSB7XG4gICAgICAgICAgICB2YXIgcmVkWCA9IHBhcnRpdGlvblN0YXJ0RXF1YWwoXG4gICAgICAgICAgICAgIGQsIGF4aXMsXG4gICAgICAgICAgICAgIHJlZDAsIHJlZDEsIHJlZCwgcmVkSW5kZXgsXG4gICAgICAgICAgICAgIG1pZClcbiAgICAgICAgICAgIGlmKGF4aXMgPT09IGQtMikge1xuICAgICAgICAgICAgICAvL0RlZ2VuZXJhdGUgc3dlZXAgaW50ZXJzZWN0aW9uOlxuICAgICAgICAgICAgICAvLyAgW3JlZDAsIHJlZFhdIHdpdGggW2JsdWUwLCBibHVlMV1cbiAgICAgICAgICAgICAgaWYocmVkMCA8IHJlZFgpIHtcbiAgICAgICAgICAgICAgICByZXR2YWwgPSBzd2VlcC5zd2VlcENvbXBsZXRlKFxuICAgICAgICAgICAgICAgICAgZCwgdmlzaXQsXG4gICAgICAgICAgICAgICAgICByZWQwLCByZWRYLCByZWQsIHJlZEluZGV4LFxuICAgICAgICAgICAgICAgICAgYmx1ZTAsIGJsdWUxLCBibHVlLCBibHVlSW5kZXgpXG4gICAgICAgICAgICAgICAgaWYocmV0dmFsICE9PSB2b2lkIDApIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiByZXR2YWxcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAvL05vcm1hbCBzd2VlcCBpbnRlcnNlY3Rpb246XG4gICAgICAgICAgICAgIC8vICBbcmVkWCwgcmVkMV0gd2l0aCBbYmx1ZTAsIGJsdWUxXVxuICAgICAgICAgICAgICBpZihyZWRYIDwgcmVkMSkge1xuICAgICAgICAgICAgICAgIHJldHZhbCA9IHN3ZWVwLnN3ZWVwQmlwYXJ0aXRlKFxuICAgICAgICAgICAgICAgICAgZCwgdmlzaXQsXG4gICAgICAgICAgICAgICAgICByZWRYLCByZWQxLCByZWQsIHJlZEluZGV4LFxuICAgICAgICAgICAgICAgICAgYmx1ZTAsIGJsdWUxLCBibHVlLCBibHVlSW5kZXgpXG4gICAgICAgICAgICAgICAgaWYocmV0dmFsICE9PSB2b2lkIDApIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiByZXR2YWxcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGlmKHJlZDAgPCByZWRYKSB7XG4gICAgICAgICAgICAgICAgaXRlclB1c2godG9wKyssXG4gICAgICAgICAgICAgICAgICBheGlzKzEsXG4gICAgICAgICAgICAgICAgICByZWQwLCByZWRYLFxuICAgICAgICAgICAgICAgICAgYmx1ZTAsIGJsdWUxLFxuICAgICAgICAgICAgICAgICAgMTYsXG4gICAgICAgICAgICAgICAgICAtSW5maW5pdHksIEluZmluaXR5KVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmKHJlZFggPCByZWQxKSB7XG4gICAgICAgICAgICAgICAgaXRlclB1c2godG9wKyssXG4gICAgICAgICAgICAgICAgICBheGlzKzEsXG4gICAgICAgICAgICAgICAgICByZWRYLCByZWQxLFxuICAgICAgICAgICAgICAgICAgYmx1ZTAsIGJsdWUxLFxuICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgIC1JbmZpbml0eSwgSW5maW5pdHkpXG4gICAgICAgICAgICAgICAgaXRlclB1c2godG9wKyssXG4gICAgICAgICAgICAgICAgICBheGlzKzEsXG4gICAgICAgICAgICAgICAgICBibHVlMCwgYmx1ZTEsXG4gICAgICAgICAgICAgICAgICByZWRYLCByZWQxLFxuICAgICAgICAgICAgICAgICAgMSxcbiAgICAgICAgICAgICAgICAgIC1JbmZpbml0eSwgSW5maW5pdHkpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYoZmxpcCkge1xuICAgICAgICAgICAgcmVkMSA9IHBhcnRpdGlvbkNvbnRhaW5zUG9pbnRQcm9wZXIoXG4gICAgICAgICAgICAgIGQsIGF4aXMsXG4gICAgICAgICAgICAgIHJlZDAsIHJlZEVuZCwgcmVkLCByZWRJbmRleCxcbiAgICAgICAgICAgICAgbWlkKVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZWQxID0gcGFydGl0aW9uQ29udGFpbnNQb2ludChcbiAgICAgICAgICAgICAgZCwgYXhpcyxcbiAgICAgICAgICAgICAgcmVkMCwgcmVkRW5kLCByZWQsIHJlZEluZGV4LFxuICAgICAgICAgICAgICBtaWQpXG4gICAgICAgICAgfVxuICAgICAgICAgIGlmKHJlZDAgPCByZWQxKSB7XG4gICAgICAgICAgICBpZihheGlzID09PSBkLTIpIHtcbiAgICAgICAgICAgICAgaWYoZmxpcCkge1xuICAgICAgICAgICAgICAgIHJldHZhbCA9IHN3ZWVwLnN3ZWVwQmlwYXJ0aXRlKFxuICAgICAgICAgICAgICAgICAgZCwgdmlzaXQsXG4gICAgICAgICAgICAgICAgICBibHVlMCwgYmx1ZTEsIGJsdWUsIGJsdWVJbmRleCxcbiAgICAgICAgICAgICAgICAgIHJlZDAsIHJlZDEsIHJlZCwgcmVkSW5kZXgpXG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dmFsID0gc3dlZXAuc3dlZXBCaXBhcnRpdGUoXG4gICAgICAgICAgICAgICAgICBkLCB2aXNpdCxcbiAgICAgICAgICAgICAgICAgIHJlZDAsIHJlZDEsIHJlZCwgcmVkSW5kZXgsXG4gICAgICAgICAgICAgICAgICBibHVlMCwgYmx1ZTEsIGJsdWUsIGJsdWVJbmRleClcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgaXRlclB1c2godG9wKyssXG4gICAgICAgICAgICAgICAgYXhpcysxLFxuICAgICAgICAgICAgICAgIHJlZDAsIHJlZDEsXG4gICAgICAgICAgICAgICAgYmx1ZTAsIGJsdWUxLFxuICAgICAgICAgICAgICAgIGZsaXAsXG4gICAgICAgICAgICAgICAgLUluZmluaXR5LCBJbmZpbml0eSlcbiAgICAgICAgICAgICAgaXRlclB1c2godG9wKyssXG4gICAgICAgICAgICAgICAgYXhpcysxLFxuICAgICAgICAgICAgICAgIGJsdWUwLCBibHVlMSxcbiAgICAgICAgICAgICAgICByZWQwLCByZWQxLFx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gICAgIC8vSW50ZXJzZWN0IHdpdGggY29tbW9uXG4gICAgICBmb3IodmFyIGo9MDsgajxjb21tb25BY3RpdmU7ICsraikge1xuICAgICAgICB2YXIgcmV0dmFsID0gdmlzaXQoQ09NTU9OX1NXRUVQX1FVRVVFW2pdLCBpZClcbiAgICAgICAgaWYocmV0dmFsICE9PSB2b2lkIDApIHtcbiAgICAgICAgICByZXR1cm4gcmV0dmFsXG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYoY29sb3IgIT09IDApIHtcbiAgICAgICAgLy9JbnRlcnNlY3Qgd2l0aCByZWRcbiAgICAgICAgZm9yKHZhciBqPTA7IGo8cmVkQWN0aXZlOyArK2opIHtcbiAgICAgICAgICB2YXIgcmV0dmFsID0gdmlzaXQoUkVEX1NXRUVQX1FVRVVFW2pdLCBpZClcbiAgICAgICAgICBpZihyZXR2YWwgIT09IHZvaWQgMCkge1xuICAgICAgICAgICAgcmV0dXJuIHJldHZhbFxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZihjb2xvciAhPT0gMSkge1xuICAgICAgICAvL0ludGVyc2VjdCB3aXRoIGJsdWVcbiAgICAgICAgZm9yKHZhciBqPTA7IGo8Ymx1ZUFjdGl2ZTsgKytqKSB7XG4gICAgICAgICAgdmFyIHJldHZhbCA9IHZpc2l0KEJMVUVfU1dFRVBfUVVFVUVbal0sIGlkKVxuICAgICAgICAgIGlmKHJldHZhbCAhPT0gdm9pZCAwKSB7XG4gICAgICAgICAgICByZXR1cm4gcmV0dmFsXG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmKGNvbG9yID09PSAwKSB7XG4gICAgICAgIC8vUmVkXG4gICAgICAgIHNxUHVzaChSRURfU1dFRVBfUVVFVUUsIFJFRF9TV0VFUF9JTkRFWCwgcmVkQWN0aXZlKyssIGlkKVxuICAgICAgfSBlbHNlIGlmKGNvbG9yID09PSAxKSB7XG4gICAgICAg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gPCBiMCkge1xuICAgICAgICAgICAgY29udGludWVcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBmb3IodmFyIGs9YXhpcysyOyBrPGQ7ICsraykge1xuICAgICAgICAgICAgaWYoYmx1ZVtibHVlUHRyICsgayArIGRdIDwgcmVkW3JlZFB0ciArIGtdIHx8IFxuICAgICAgICAgICAgICAgcmVkW3JlZFB0ciArIGsgKyBkXSA8IGJsdWVbYmx1ZVB0ciArIGtdKSB7XG4gICAgICAgICAgICAgIGNvbnRpbnVlIHJlZF9sb29wXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdmFyIHJlZElkICA9IHJlZEluZGV4W29pZHhdXG4gICAgICAgICAgdmFyIHJldHZhbFxuICAgICAgICAgIGlmKGZsaXApIHtcbiAgICAgICAgICAgIHJldHZhbCA9IHZpc2l0KGJsdWVJZCwgcmVkSWQpXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHZhbCA9IHZpc2l0KHJlZElkLCBibHVlSWQpXG4gICAgICAgICAgfVxuICAgICAgICAgIGlmKHJldHZhbCAhPT0gdm9pZCAwKSB7XG4gICAgICAgICAgICByZXR1cm4gcmV0dmFsIFxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBzcVBvcChSRURfU1dFRVBfUVVFVUUsIFJFRF9TV0VFUF9JTkRFWCwgcmVkQWN0aXZlLS0sIGUgLSByZWRTaGlmdClcbiAgICB9XG4gIH1cbn1cblxuZnVuY3Rpb24gc2NhbkNvbXBsZXRlKFxuICBkLCBheGlzLCB2aXNpdCxcbiAgcmVkU3RhcnQsICByZWRFbmQsIHJlZCwgcmVkSW5kZXgsXG4gIGJsdWVTdGFydCwgYmx1ZUVuZCwgYmx1ZSwgYmx1ZUluZGV4KSB7XG5cbiAgdmFyIHB0ciAgICAgID0gMFxuICB2YXIgZWxlbVNpemUgPSAyKmRcbiAgdmFyIGlzdGF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PSAxXG4gICAgICAgIHZhciBibHVlSWQgID0gYmx1ZUluZGV4W2lkeF1cbiAgICAgICAgdmFyIGJsdWVQdHIgPSBlbGVtU2l6ZSAqIGlkeFxuXG4gICAgICAgIHZhciBiMCA9IGJsdWVbYmx1ZVB0citheGlzKzFdXG4gICAgICAgIHZhciBiMSA9IGJsdWVbYmx1ZVB0citheGlzKzErZF1cblxucmVkX2xvb3A6XG4gICAgICAgIGZvcih2YXIgaj0wOyBqPHJlZEFjdGl2ZTsgKytqKSB7XG4gICAgICAgICAgdmFyIG9pZHggICA9IFJFRF9TV0VFUF9RVUVVRVtqXVxuICAgICAgICAgIHZhciByZWRJZCAgPSByZWRJbmRleFtvaWR4XVxuXG4gICAgICAgICAgaWYocmVkSWQgPT09IGJsdWVJZCkge1xuICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICB2YXIgcmVkUHRyID0gZWxlbVNpemUgKiBvaWR4XG4gICAgICAgICAgaWYoYjEgPCByZWRbcmVkUHRyK2F4aXMrMV0gfHwgXG4gICAgICAgICAgICByZWRbcmVkUHRyK2F4aXMrMStkXSA8IGIwKSB7XG4gICAgICAgICAgICBjb250aW51ZVxuICAgICAgICAgIH1cbiAgICAgICAgICBmb3IodmFyIGs9YXhpcysyOyBrPGQ7ICsraykge1xuICAgICAgICAgICAgaWYoYmx1ZVtibHVlUHRyICsgayArIGRdIDwgcmVkW3JlZFB0ciArIGtdIHx8IFxuICAgICAgICAgICAgICAgcmVkW3JlZFB0ciArIGsgKyBkXSAgIDwgYmx1ZVtibHVlUHRyICsga10pIHtcbiAgICAgICAgICAgICAgY29udGludWUgcmVkX2xvb3BcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICB2YXIgcmV0dmFsID0gdmlzaXQocmVkSWQsIGJsdWVJZClcbiAgICAgICAgICBpZihyZXR2YWwgIT09IHZvaWQgMCkge1xuICAgICAgICAgICAgcmV0dXJuIHJldHZhbCBcbi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CBPKTtcbiAgICAgIGlmKFRZUEUpe1xuICAgICAgICBpZihJU19NQVApcmVzdWx0W2luZGV4XSA9IHJlczsgICAgICAgICAgICAvLyBtYXBcbiAgICAgICAgZWxzZSBpZihyZXMpc3dpdGNoKFRZUEUpe1xuICAgICAgICAgIGNhc2UgMzogcmV0dXJuIHRydWU7ICAgICAgICAgICAgICAgICAgICAvLyBzb21lXG4gICAgICAgICAgY2FzZSA1OiByZXR1cm4gdmFsOyAgICAgICAgICAgICAgICAgICAgIC8vIGZpbmRcbiAgICAgICAgICBjYXNlIDY6IHJldHVybiBpbmRleDsgICAgICAgICAgICAgICAgICAgLy8gZmluZEluZGV4XG4gICAgICAgICAgY2FzZSAyOiByZXN1bHQucHVzaCh2YWwpOyAgICAgICAgICAgICAgIC8vIGZpbHRlclxuICAgICAgICB9IGVsc2UgaWYoSVNfRVZFUlkpcmV0dXJuIGZhbHNlOyAgICAgICAgICAvLyBldmVyeVxuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gSVNfRklORF9JTkRFWCA/IC0xIDogSVNfU09NRSB8fCBJU19FVkVSWSA/IElTX0VWRVJZIDogcmVzdWx0O1xuICB9O1xufTsiLCJ2YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKVxuICAsIGlzQXJyYXkgID0gcmVxdWlyZSgnLi9faXMtYXJyYXknKVxuICAsIFNQRUNJRVMgID0gcmVxdWlyZSgnLi9fd2tzJykoJ3NwZWNpZXMnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbihvcmlnaW5hbCl7XG4gIHZhciBDO1xuICBpZihpc0FycmF5KG9yaWdpbmFsKSl7XG4gICAgQyA9IG9yaWdpbmFsLmNvbnN0cnVjdG9yO1xuICAgIC8vIGNyb3NzLXJlYWxtIGZhbGxiYWNrXG4gICAgaWYodHlwZW9mIEMgPT0gJ2Z1bmN0aW9uJyAmJiAoQyA9PT0gQXJyYXkgfHwgaXNBcnJheShDLnByb3Rvd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i4zLjcgU2V0LnByb3RvdHlwZS5oYXModmFsdWUpXG4gICAgICBoYXM6IGZ1bmN0aW9uIGhhcyhrZXkpe1xuICAgICAgICByZXR1cm4gISFnZXRFbnRyeSh0aGlzLCBrZXkpO1xuICAgICAgfVxuICAgIH0pO1xuICAgIGlmKERFU0NSSVBUT1JTKWRQKEMucHJvdG90eXBlLCAnc2l6ZScsIHtcbiAgICAgIGdldDogZnVuY3Rpb24oKXtcbiAgICAgICAgcmV0dXJuIGRlZmluZWQodGhpc1tTSVpFXSk7XG4gICAgICB9XG4gICAgfSk7XG4gICAgcmV0dXJuIEM7XG4gIH0sXG4gIGRlZjogZnVuY3Rpb24odGhhdCwga2V5LCB2YWx1ZSl7XG4gICAgdmFyIGVudHJ5ID0gZ2V0RW50cnkodGhhdCwga2V5KVxuICAgICAgLCBwcmV2LCBpbmRleDtcbiAgICAvLyBjaGFuZ2UgZXhpc3RpbmcgZW50cnlcbiAgICBpZihlbnRyeSl7XG4gICAgICBlbnRyeS52ID0gdmFsdWU7XG4gICAgLy8gY3JlYXRlIG5ldyBlbnRyeVxuICAgIH0gZWxzZSB7XG4gICAgICB0aGF0Ll9sID0gZW50cnkgPSB7XG4gICAgICAgIGk6IGluZGV4ID0gZmFzdEtleShrZXksIHRydWUpLCAvLyA8LSBpbmRleFxuICAgICAgICBrOiBrZXksICAgICAgICAgICAgICAgICAgICAgICAgLy8gPC0ga2V5XG4gICAgICAgIHY6IHZhbHVlLCAgICAgICAgICAgICAgICAgICAgICAvLyA8LSB2YWx1ZVxuICAgICAgICBwOiBwcmV2ID0gdGhhdC5fbCwgICAgICAgICAgICAgLy8gPC0gcHJldmlvdXMgZW50cnlcbiAgICAgICAgbjogdW5kZWZpbmVkLCAgICAgICAgICAgICAgICAgIC8vIDwtIG5leHQgZW50cnlcbiAgICAgICAgcjogZmFsc2UgICAgICAgICAgICAgICAgICAgICAgIC8vIDwtIHJlbW92ZWRcbiAgICAgIH07XG4gICAgICBpZighdGhhdC5fZil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Byb21pc2UsIGlzUmVqZWN0KXtcbiAgaWYocHJvbWlzZS5fbilyZXR1cm47XG4gIHByb21pc2UuX24gPSB0cnVlO1xuICB2YXIgY2hhaW4gPSBwcm9taXNlLl9jO1xuICBtaWNyb3Rhc2soZnVuY3Rpb24oKXtcbiAgICB2YXIgdmFsdWUgPSBwcm9taXNlLl92XG4gICAgICAsIG9rICAgID0gcHJvbWlzZS5fcyA9PSAxXG4gICAgICAsIGkgICAgID0gMDtcbiAgICB2YXIgcnVuID0gZnVuY3Rpb24ocmVhY3Rpb24pe1xuICAgICAgdmFyIGhhbmRsZXIgPSBvayA/IHJlYWN0aW9uLm9rIDogcmVhY3Rpb24uZmFpbFxuICAgICAgICAsIHJlc29sdmUgPSByZWFjdGlvbi5yZXNvbHZlXG4gICAgICAgICwgcmVqZWN0ICA9IHJlYWN0aW9uLnJlamVjdFxuICAgICAgICAsIGRvbWFpbiAgPSByZWFjdGlvbi5kb21haW5cbiAgICAgICAgLCByZXN1bHQsIHRoZW47XG4gICAgICB0cnkge1xuICAgICAgICBpZihoYW5kbGVyKXtcbiAgICAgICAgICBpZighb2spe1xuICAgICAgICAgICAgaWYocHJvbWlzZS5faCA9PSAyKW9uSGFuZGxlVW5oYW5kbGVkKHByb21pc2UpO1xuICAgICAgICAgICAgcHJvbWlzZS5faCA9IDE7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmKGhhbmRsZXIgPT09IHRydWUpcmVzdWx0ID0gdmFsdWU7XG4gICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBpZihkb21haW4pZG9tYWluLmVudGVyKCk7XG4gICAgICAgICAgICByZXN1bHQgPSBoYW5kbGVyKHZhbHVlKTtcbiAgICAgICAgICAgIGlmKGRvbWFpbilkb21haW4uZXhpdCgpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZihyZXN1bHQgPT09IHJlYWN0aW9uLnByb21pc2Upe1xuICAgICAgICAgICAgcmVqZWN0KFR5cGVFcnJvcignUHJvbWlzZS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jYW4ndCBiZSBhbiBlYXJcblxuICAgIC8vIHRyaWFuZ2xlIGJib3g7IG1pbiAmIG1heCBhcmUgY2FsY3VsYXRlZCBsaWtlIHRoaXMgZm9yIHNwZWVkXG4gICAgdmFyIG1pblRYID0gYS54IDwgYi54ID8gKGEueCA8IGMueCA/IGEueCA6IGMueCkgOiAoYi54IDwgYy54ID8gYi54IDogYy54KSxcbiAgICAgICAgbWluVFkgPSBhLnkgPCBiLnkgPyAoYS55IDwgYy55ID8gYS55IDogYy55KSA6IChiLnkgPCBjLnkgPyBiLnkgOiBjLnkpLFxuICAgICAgICBtYXhUWCA9IGEueCA+IGIueCA/IChhLnggPiBjLnggPyBhLnggOiBjLngpIDogKGIueCA+IGMueCA/IGIueCA6IGMueCksXG4gICAgICAgIG1heFRZID0gYS55ID4gYi55ID8gKGEueSA+IGMueSA/IGEueSA6IGMueSkgOiAoYi55ID4gYy55ID8gYi55IDogYy55KTtcblxuICAgIC8vIHotb3JkZXIgcmFuZ2UgZm9yIHRoZSBjdXJyZW50IHRyaWFuZ2xlIGJib3g7XG4gICAgdmFyIG1pblogPSB6T3JkZXIobWluVFgsIG1pblRZLCBtaW5YLCBtaW5ZLCBzaXplKSxcbiAgICAgICAgbWF4WiA9IHpPcmRlcihtYXhUWCwgbWF4VFksIG1pblgsIG1pblksIHNpemUpO1xuXG4gICAgLy8gZmlyc3QgbG9vayBmb3IgcG9pbnRzIGluc2lkZSB0aGUgdHJpYW5nbGUgaW4gaW5jcmVhc2luZyB6LW9yZGVyXG4gICAgdmFyIHAgPSBlYXIubmV4dFo7XG5cbiAgICB3aGlsZSAocCAmJiBwLnogPD0gbWF4Wikge1xuICAgICAgICBpZiAocCAhPT0gZWFyLnByZXYgJiYgcCAhPT0gZWFyLm5leHQgJiZcbiAgICAgICAgICAgIHBvaW50SW5UcmlhbmdsZShhLngsIGEueSwgYi54LCBiLnksIGMueCwgYy55LCBwLngsIHAueSkgJiZcbiAgICAgICAgICAgIGFyZWEocC5wcm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gIHF4ID0gLUluZmluaXR5LFxuICAgICAgICBtO1xuXG4gICAgLy8gZmluZCBhIHNlZ21lbnQgaW50ZXJzZWN0ZWQgYnkgYSByYXkgZnJvbSB0aGUgaG9sZSdzIGxlZnRtb3N0IHBvaW50IHRvIHRoZSBsZWZ0O1xuICAgIC8vIHNlZ21lbnQncyBlbmRwb2ludCB3aXRoIGxlc3NlciB4IHdpbGwgYmUgcG90ZW50aWFsIGNvbm5lY3Rpb24gcG9pbnRcbiAgICBkbyB7XG4gICAgICAgIGlmIChoeSA8PSBwLnkgJiYgaHkgPj0gcC5uZXh0LnkpIHtcbiAgICAgICAgICAgIHZhciB4ID0gcC54ICsgKGh5IC0gcC55KSAqIChwLm5leHQueCAtIHAueCkgLyAocC5uZXh0LnkgLSBwLnkpO1xuICAgICAgICAgICAgaWYgKHggPD0gaHggJiYgeCA+IHF4KSB7XG4gICAgICAgICAgICAgICAgcXggPSB4O1xuICAgICAgICAgICAgICAgIGlmICh4ID09PSBoeCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoaHkgPT09IHAueSkgcmV0dXJuIHA7XG4gICAgICAgICAgICAgICAgICAgIGlmIChoeSA9PT0gcC5uZXh0LnkpIHJldHVybiBwLm5leHQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG0gPSBwLnggPCBwLm5leHQueCA/IHAgOiBwLm5leHQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcCA9IHAubmV4dDtcbiAgICB9IHdoaWxlIChwICE9PSBvdXRlck5vZGUpO1xuXG4gICAgaWYgKCFtKSByZXR1cm4gbnVsbDtcblxuICAgIGlmIChoeCA9PT0gcXgpIHJldHVybiBtLnByZXY7IC8vIGhvbGUgdG91Y2hlcyBvdXRlciBzZWdtZW50OyBwaWNrIGxvd2VyIGVuZHBvaW50XG5cbiAgICAvLyBsb29rIGZvciBwb2ludHMgaW5zaWRlIHRoZSB0cmlhbmdsZSBvZiBob2xlIHBvaW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FydCwgbWluWCwgbWluWSwgc2l6ZSkge1xuICAgIHZhciBwID0gc3RhcnQ7XG4gICAgZG8ge1xuICAgICAgICBpZiAocC56ID09PSBudWxsKSBwLnogPSB6T3JkZXIocC54LCBwLnksIG1pblgsIG1pblksIHNpemUpO1xuICAgICAgICBwLnByZXZaID0gcC5wcmV2O1xuICAgICAgICBwLm5leHRaID0gcC5uZXh0O1xuICAgICAgICBwID0gcC5uZXh0O1xuICAgIH0gd2hpbGUgKHAgIT09IHN0YXJ0KTtcblxuICAgIHAucHJldloubmV4dFogPSBudWxsO1xuICAgIHAucHJldlogPSBudWxsO1xuXG4gICAgc29ydExpbmtlZChwKTtcbn1cblxuLy8gU2ltb24gVGF0aGFtJ3MgbGlua2VkIGxpc3QgbWVyZ2Ugc29ydCBhbGdvcml0aG1cbi8vIGh0dHA6Ly93d3cuY2hpYXJrLmdyZWVuZW5kLm9yZy51ay9+c2d0YXRoYW0vYWxnb3JpdGhtcy9saXN0c29ydC5odG1sXG5mdW5jdGlvbiBzb3J0TGlua2VkKGxpc3QpIHtcbiAgICB2YXIgaSwgcCwgcSwgZSwgdGFpbCwgbnVtTWVyZ2VzLCBwU2l6ZSwgcVNpemUsXG4gICAgICAgIGluU2l6ZSA9IDE7XG5cbiAgICBkbyB7XG4gICAgICAgIHAgPSBsaXN0O1xuICAgICAgICBsaXN0ID0gbnVsbDtcbiAgICAgICAgdGFpbCA9IG51bGw7XG4gICAgICAgIG51bU1lcmdlcyA9IDA7XG5cbiAgICAgICAgd2hpbGUgKHApIHtcbiAgICAgICAgICAgIG51bU1lcmdlcysrO1xuICAgICAgICAgICAgcSA9IHA7XG4gICAgICAgICAgICBwU2l6ZSA9IDA7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgaW5TaXplOyBpKyspIHtcbiAgICAgICAgICAgICAgICBwU2l6ZSsrO1xuICAgICAgICAgICAgICAgIHEgPSBxLm5leHRaO1xuICAgICAgICAgICAgICAgIGlmICghcSkgYnJlYWs7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHFTaXplID0gaW5TaXplO1xuXG4gICAgICAgICAgICB3aGlsZSAocFNpemUgPiAwIHx8IChxU2l6ZSA+IDAgJiYgcSkpIHtcblxuICAgICAgICAgICAgICAgIGlmIChwU2l6ZSA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBlID0gcTtcbiAgICAgICAgICAgICAgICAgICAgcSA9IHEubmV4dFo7XG4gICAgICAgICAgICAgICAgICAgIHFTaXplLS07XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChxU2l6ZSA9PT0gMCB8fCAhcSkge1xuICAgICAgICAgICAgICAgICAgICBlID0gcDtcbiAgICAgICAgICAgICAgICAgICAgcCA9IHAubmV4dFo7XG4gICAgICAgICAgICAgICAgICAgIHBTaXplLS07XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwLnogPD0gcS56KSB7XG4gICAgICAgICAgICAgICAgICAgIGUgPSBwO1xuICAgICAgICAgICAgICAgICAgICBwID0gcC5uZXh0WjtcbiAgICAgICAgICAgICAgICAgICAgcFNpemUtLTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBlID0gcTtcbiAgICAgICAgICAgICAgICAgICAgcSA9IHEubmV4dFo7XG4gICAgICAgICAgICAgICAgICAgIHFTaXplLS07XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKHRhaWwpIHRhaWwubmV4dFogPSBlO1xuICAgICAgICAgICAgICAgIGVsc2UgbGlzdCA9IGU7XG5cbiAgICAgICAgICAgICAgICBlLnByZXZaID0gdGFpbDtcbiAgICAgICAgICAgICAgICB0YWlsID0gZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcCA9IHE7XG4gICAgICAgIH1cblxuICAgICAgICB0YWlsLm5leHRaID0gbnVsbDtcbiAgICAgICAgaW5TaXplICo9IDI7XG5cbiAgICB9IHdoaWxlIChudW1NZXJ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QsIG1pbkFsbCwgbWF4QWxsKSB7XG5cbiAgICBrMSAvPSBzY2FsZTtcbiAgICBrMiAvPSBzY2FsZTtcblxuICAgIGlmIChtaW5BbGwgPj0gazEgJiYgbWF4QWxsIDw9IGsyKSByZXR1cm4gZmVhdHVyZXM7IC8vIHRyaXZpYWwgYWNjZXB0XG4gICAgZWxzZSBpZiAobWluQWxsID4gazIgfHwgbWF4QWxsIDwgazEpIHJldHVybiBudWxsOyAvLyB0cml2aWFsIHJlamVjdFxuXG4gICAgdmFyIGNsaXBwZWQgPSBbXTtcblxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZmVhdHVyZXMubGVuZ3RoOyBpKyspIHtcblxuICAgICAgICB2YXIgZmVhdHVyZSA9IGZlYXR1cmVzW2ldLFxuICAgICAgICAgICAgZ2VvbWV0cnkgPSBmZWF0dXJlLmdlb21ldHJ5LFxuICAgICAgICAgICAgdHlwZSA9IGZlYXR1cmUudHlwZSxcbiAgICAgICAgICAgIG1pbiwgbWF4O1xuXG4gICAgICAgIG1pbiA9IGZlYXR1cmUubWluW2F4aXNdO1xuICAgICAgICBtYXggPSBmZWF0dXJlLm1heFtheGlzXTtcblxuICAgICAgICBpZiAobWluID49IGsxICYmIG1heCA8PSBrMikgeyAvLyB0cml2aWFsIGFjY2VwdFxuICAgICAgICAgICAgY2xpcHBlZC5wdXNoKGZlYXR1cmUpO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH0gZWxzZSBpZiAobWluID4gazIgfHwgbWF4IDwgazEpIGNvbnRpbnVlOyAvLyB0cml2aWFsIHJlamVjdFxuXG4gICAgICAgIHZhciBzbGljZXMgPSB0eXBlID09PSAxID9cbiAgICAgICAgICAgICAgICBjbGlwUG9pbnRzKGdlb21ldHJ5LCBrMSwgazIsIGF4aXMpIDpcbiAgICAgICAgICAgICAgICBjbGlwR2VvbWV0cnkoZ2VvbWV0cnksIGsxLCBrMiwgYXhpcywgaW50ZXJzZWN0LCB0eXBlID09PSAzK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iAgICBmb3IgKHZhciBpID0gMDsgaSA8IGdlb21ldHJ5Lmxlbmd0aDsgaSsrKSB7XG5cbiAgICAgICAgdmFyIGFrID0gMCxcbiAgICAgICAgICAgIGJrID0gMCxcbiAgICAgICAgICAgIGIgPSBudWxsLFxuICAgICAgICAgICAgcG9pbnRzID0gZ2VvbWV0cnlbaV0sXG4gICAgICAgICAgICBhcmVhID0gcG9pbnRzLmFyZWEsXG4gICAgICAgICAgICBkaXN0ID0gcG9pbnRzLmRpc3QsXG4gICAgICAgICAgICBsZW4gPSBwb2ludHMubGVuZ3RoLFxuICAgICAgICAgICAgYSwgaiwgbGFzdDtcblxuICAgICAgICB2YXIgc2xpY2UgPSBbXTtcblxuICAgICAgICBmb3IgKGogPSAwOyBqIDwgbGVuIC0gMTsgaisrKSB7XG4gICAgICAgICAgICBhID0gYiB8fCBwb2ludHNbal07XG4gICAgICAgICAgICBiID0gcG9pbnRzW2ogKyAxXTtcbiAgICAgICAgICAgIGFrID0gYmsgfHwgYVtheGlzXTtcbiAgICAgICAgICAgIGJrID0gYltheGlzXTtcblxuICAgICAgICAgICAgaWYgKGFrIDwgazEpIHtcblxuICAgICAgICAgICAgICAgIGlmICgoYmsgPiBrMikpIHsgLy8gLS0tfC0tLS0tfC0tPlxuICAgICAgICAgICAgICAgICAgICBzbGljZS5wdXNoKGludGVyc2VjdChhLCBiLCBrMSksIGludGVyc2VjdChhLCBiLCBrMikpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWNsb3NlZCkgc2xpY2UgPSBuZXdTbGljZShzbGljZXMsIHNsaWNlLCBhcmVhLCBkaXN0KTtcblxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYmsgPj0gazEpIHNsaWNlLnB1c2goaW50ZXJzZWN0KGEsIGIsIGsxKSk7IC8vIC0tLXwtLT4gIHxcblxuICAgICAgICAgICAgfSBlbHNlIGlmIChhayA+IGsyKSB7XG5cbiAgICAgICAgICAgICAgICBpZiAoKGJrIDwgazEpKSB7IC8vIDwtLXwtLS0tLXwtLS1cbiAgICAgICAgICAgICAgICAgICAgc2xpY2UucHVzaChpbnRlcnNlY3QoYSwgYiwgazIpLCBpbnRlcnNlY3QoYSwgYiwgazEpKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFjbG9zZWQpIHNsaWNlID0gbmV3U2xpY2Uoc2xpY2VzLCBzbGljZSwgYXJlYSwgZGlzdCk7XG5cbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGJrIDw9IGsyKSBzbGljZS5wdXNoKGludGVyc2VjdChhLCBiLCBrMikpOyAvLyB8ICA8LS18LS0tXG5cbiAgICAgICAgICAgIH0gZWxzZSB7XG5cbiAgICAgICAgICAgICAgICBzbGljZS5wdXNoKGEpO1xuXG4gICAgICAgICAgICAgICAgaWYgKGJrIDwgazEpIHsgLy8gPC0tfC0tLSAgfFxuICAgICAgICAgICAgICAgICAgICBzbGljZS5wdXNoKGludGVyc2VjdChhLCBiLCBrMSkpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWNsb3NlZCkgc2xpY2UgPSBuZXdTbGljZShzbGljZXMsIHNsaWNlLCBhcmVhLCBkaXN0KTtcblxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYmsgPiBrMikgeyAvLyB8ICAtLS18LS0+XG4gICAgICAgICAgICAgICAgICAgIHNsaWNlLnB1c2goaW50ZXJzZWN0KGEsIGIsIGsyKSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghY2xvc2VkKSBzbGljZSA9IG5ld1NsaWNlKHNsaWNlcywgc2xpY2UsIGFyZWEsIGRpc3QpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyB8IC0tPiB8XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBhZGQgdGhlIGxhc3QgcG9pbnRcbiAgICAgICAgYSA9IHBvaW50c1tsZW4gLSAxXTtcbiAgICAgICAgYWsgPSBhW2F4aXNdO1xuICAgICAgICBp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WNrLnBvcCgpO1xuICAgICAgICBmZWF0dXJlcyA9IHN0YWNrLnBvcCgpO1xuXG4gICAgICAgIHZhciB6MiA9IDEgPDwgeixcbiAgICAgICAgICAgIGlkID0gdG9JRCh6LCB4LCB5KSxcbiAgICAgICAgICAgIHRpbGUgPSB0aGlzLnRpbGVzW2lkXSxcbiAgICAgICAgICAgIHRpbGVUb2xlcmFuY2UgPSB6ID09PSBvcHRpb25zLm1heFpvb20gPyAwIDogb3B0aW9ucy50b2xlcmFuY2UgLyAoejIgKiBvcHRpb25zLmV4dGVudCk7XG5cbiAgICAgICAgaWYgKCF0aWxlKSB7XG4gICAgICAgICAgICBpZiAoZGVidWcgPiAxKSBjb25zb2xlLnRpbWUoJ2NyZWF0aW9uJyk7XG5cbiAgICAgICAgICAgIHRpbGUgPSB0aGlzLnRpbGVzW2lkXSA9IGNyZWF0ZVRpbGUoZmVhdHVyZXMsIHoyLCB4LCB5LCB0aWxlVG9sZXJhbmNlLCB6ID09PSBvcHRpb25zLm1heFpvb20pO1xuICAgICAgICAgICAgdGhpcy50aWxlQ29vcmRzLnB1c2goe3o6IHosIHg6IHgsIHk6IHl9KTtcblxuICAgICAgICAgICAgaWYgKGRlYnVnKSB7XG4gICAgICAgICAgICAgICAgaWYgKGRlYnVnID4gMSkge1xuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygndGlsZSB6JWQtJWQtJWQgKGZlYXR1cmVzOiAlZCwgcG9pbnRzOiAlZCwgc2ltcGxpZmllZDogJWQpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHosIHgsIHksIHRpbGUubnVtRmVhdHVyZXMsIHRpbGUubnVtUG9pbnRzLCB0aWxlLm51bVNpbXBsaWZpZWQpO1xuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLnRpbWVFbmQoJ2NyZWF0aW9uJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBrZXkgPSAneicgKyB6O1xuICAgICAgICAgICAgICAg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bSB8fCB6ID09PSBjeikgY29udGludWU7XG5cbiAgICAgICAgICAgIC8vIHN0b3AgdGlsaW5nIGlmIGl0J3Mgbm90IGFuIGFuY2VzdG9yIG9mIHRoZSB0YXJnZXQgdGlsZVxuICAgICAgICAgICAgdmFyIG0gPSAxIDw8IChjeiAtIHopO1xuICAgICAgICAgICAgaWYgKHggIT09IE1hdGguZmxvb3IoY3ggLyBtKSB8fCB5ICE9PSBNYXRoLmZsb29yKGN5IC8gbSkpIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gaWYgd2Ugc2xpY2UgZnVydGhlciBkb3duLCBubyBuZWVkIHRvIGtlZXAgc291cmNlIGdlb21ldHJ5XG4gICAgICAgIHRpbGUuc291cmNlID0gbnVsbDtcblxuICAgICAgICBpZiAoZGVidWcgPiAxKSBjb25zb2xlLnRpbWUoJ2NsaXBwaW5nJyk7XG5cbiAgICAgICAgLy8gdmFsdWVzIHdlJ2xsIHVzZSBmb3IgY2xpcHBpbmdcbiAgICAgICAgdmFyIGsxID0gMC41ICogb3B0aW9ucy5idWZmZXIgLyBvcHRpb25zLmV4dGVudCxcbiAgICAgICAgICAgIGsyID0gMC41IC0gazEsXG4gICAgICAgICAgICBrMyA9IDAuNSArIGsxLFxuICAgICAgICAgICAgazQgPSAxICsgazEsXG4gICAgICAgICAgICB0bCwgYmwsIHRyLCBiciwgbGVmdCwgcmlnaHQ7XG5cbiAgICAgICAgdGwgPSBibCA9IHRyID0gYnIgPSBudWxsO1xuXG4gICAgICAgIGxlZnQgID0gY2xpcChmZWF0dXJlcywgejIsIHggLSBrMSwgeCArIGszLCAwLCBpbnRlcnNlY3RYLCB0aWxlLm1pblswXSwgdGlsZS5tYXhbMF0pO1xuICAgICAgICByaWdodCA9IGNsaXAoZmVhdHVyZXMsIHoyLCB4ICsgazIsIHggKyBrNCwgMCwgaW50ZXJzZWN0WCwgdGlsZS5taW5bMF0sIHRpbGUubWF4WzBdKTtcblxuICAgICAgICBpZiAobGVmdCkge1xuICAgICAgICAgICAgdGwgPSBjbGlwKGxlZnQsIHoyLCB5IC0gazEsIHkgKyBrMywgMSwgaW50ZXJzZWN0WSwgdGlsZS5taW5bMV0sIHRpbGUubWF4WzFdKTtcbiAgICAgICAgICAgIGJsID0gY2xpcChsZWZ0LCB6MiwgeSArIGsyLCB5ICsgazQsIDEsIGludGVyc2VjdFksIHRpbGUubWluWzFdLCB0aWxlLm1heFsxXSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAocmlnaHQpIHtcbiAgICAgICAgICAgIHRyID0gY2xpcChyaWdodCwgejIsIHkgLSBrMSwgeSArIGszLCAxLCBpbnRlcnNlY3RZLCB0aWxlLm1pblsxXSwgdGlsZS5tYXhbMV0pO1xuICAgICAgICAgICAgYnIgPSBjbGlwKHJpZ2h0LCB6MiwgeSArIGsyLCB5ICsgazQsIDEsIGludGVyc2VjdFksIHRpbGUubWluWzFdLCB0aWxlLm1heFsxXSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZGVidWcgPiAxKSBjb25zb2xlLnRpbWVFbmQoJ2NsaXBwaW5nJyk7XG5cbiAgICAgICAgaWYgKHRsKSBzdGFjay5wdXNoKHRsLCB6ICsgMSwgeCAqIDIsICAgICB5ICogMik7XG4gICAgICAgIGlmIChibCkgc3RhY2sucHVzaChibCwgeiArIDEsIHggKiAyLCAgICAgeSAqIDIgKyAxKTtcbiAgICAgICAgaWYgKHRyKSBzdGFjay5wdXNoKHRyLCB6ICsgMSwgeCAqIDIgKyAxLCB5ICogMik7XG4gICAgICAgIGlmIChicikgc3RhY2sucHVzaChiciwgeiArIDEsIHggKiAyICsgMSwgeSAqIDIgKyAxKTtcbiAgICB9XG59O1xuXG5HZW9KU09OVlQucHJvdG90eXBlLmdldFRpbGUgPSBmdW5jdGlvbiAoeiwgeCwgeSkge1xuICAgIHZhciBvcHRpb25zID0gdGhpcy5vcHRpb25zLFxuICAgICAgICBleHRlbnQgPSBvcHRpb25zLmV4dGVudCx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ZVRpbGU7XG5cbmZ1bmN0aW9uIGNyZWF0ZVRpbGUoZmVhdHVyZXMsIHoyLCB0eCwgdHksIHRvbGVyYW5jZSwgbm9TaW1wbGlmeSkge1xuICAgIHZhciB0aWxlID0ge1xuICAgICAgICBmZWF0dXJlczogW10sXG4gICAgICAgIG51bVBvaW50czogMCxcbiAgICAgICAgbnVtU2ltcGxpZmllZDogMCxcbiAgICAgICAgbnVtRmVhdHVyZXM6IDAsXG4gICAgICAgIHNvdXJjZTogbnVsbCxcbiAgICAgICAgeDogdHgsXG4gICAgICAgIHk6IHR5LFxuICAgICAgICB6MjogejIsXG4gICAgICAgIHRyYW5zZm9ybWVkOiBmYWxzZSxcbiAgICAgICAgbWluOiBbMiwgMV0sXG4gICAgICAgIG1heDogWy0xLCAwXVxuICAgIH07XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBmZWF0dXJlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICB0aWxlLm51bUZlYXR1cmVzKys7XG4gICAgICAgIGFkZEZlYXR1cmUodGlsZSwgZmVhdHVyZXNbaV0sIHRvbGVyYW5jZSwgbm9TaW1wbGlmeSk7XG5cbiAgICAgICAgdmFyIG1pbiA9IGZlYXR1cmVzW2ldLm1pbixcbiAgICAgICAgICAgIG1heCA9IGZlYXR1cmVzW2ldLm1heDtcblxuICAgICAgICBpZiAobWluWzBdIDwgdGlsZS5taW5bMF0pIHRpbGUubWluWzBdID0gbWluWzBdO1xuICAgICAgICBpZiAobWluWzFdIDwgdGlsZS5taW5bMV0pIHRpbGUubWluWzFdID0gbWluWzFdO1xuICAgICAgICBpZiAobWF4WzBdID4gdGlsZS5tYXhbMF0pIHRpbGUubWF4WzBdID0gbWF4WzBdO1xuICAgICAgICBpZiAobWF4WzFdID4gdGlsZS5tYXhbMV0pIHRpbGUubWF4WzFdID0gbWF4WzFdO1xuICAgIH1cbiAgICByZXR1cm4gdGlsZTtcbn1cblxuZnVuY3Rpb24gYWRkRmVhdHVyZSh0aWxl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gICB9XG5cbiAgICAgICAgICAgIHZhciBzaW1wbGlmaWVkUmluZyA9IFtdO1xuXG4gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgcmluZy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIHAgPSByaW5nW2pdO1xuICAgICAgICAgICAgICAgIC8vIGtlZXAgcG9pbnRzIHdpdGggaW1wb3J0YW5jZSA+IHRvbGVyYW5jZVxuICAgICAgICAgICAgICAgIGlmIChub1NpbXBsaWZ5IHx8IHBbMl0gPiBzcVRvbGVyYW5jZSkge1xuICAgICAgICAgICAgICAgICAgICBzaW1wbGlmaWVkUmluZy5wdXNoKHApO1xuICAgICAgICAgICAgICAgICAgICB0aWxlLm51bVNpbXBsaWZpZWQrKztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGlsZS5udW1Qb2ludHMrKztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgc2ltcGxpZmllZC5wdXNoKHNpbXBsaWZpZWRSaW5nKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlmIChzaW1wbGlmaWVkLmxlbmd0aCkge1xuICAgICAgICB0aWxlLmZlYXR1cmVzLnB1c2goe1xuICAgICAgICAgICAgZ2VvbWV0cnk6IHNpbXBsaWZpZWQsXG4gICAgICAgICAgICB0eXBlOiB0eXBlLFxuICAgICAgICAgICAgdGFnczogZmVhdHVyZS50YWdzIHx8IG51bGxcbiAgICAgICAgfSk7XG4gICAgfVxufVxuIiwiJ3VzZSBzdHJpY3QnO1xuXG52YXIgY2xpcCA9IHJlcXVpcmUoJy4vY2xpcCcpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IHdyYXA7XG5cbmZ1bmN0aW9uIHdyYXAoZmVhdHVyZXMsIGJ1ZmZlciwgaW50ZXJzZWN0WCkge1xuICAgIHZhciBtZXJnZWQgPSBmZWF0dXJlcyxcbiAgICAgICAgbGVmdCAgPSBjbGlwKGZlYXR1cmVzLCAxLCAtMSAtIGJ1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W50ZXIsIHVwKSB7XG4gICAgdmFyIHgwLCB4MSwgeDIsIHkwLCB5MSwgeTIsIHowLCB6MSwgejIsIGxlbixcbiAgICAgICAgZXlleCA9IGV5ZVswXSxcbiAgICAgICAgZXlleSA9IGV5ZVsxXSxcbiAgICAgICAgZXlleiA9IGV5ZVsyXSxcbiAgICAgICAgdXB4ID0gdXBbMF0sXG4gICAgICAgIHVweSA9IHVwWzFdLFxuICAgICAgICB1cHogPSB1cFsyXSxcbiAgICAgICAgY2VudGVyeCA9IGNlbnRlclswXSxcbiAgICAgICAgY2VudGVyeSA9IGNlbnRlclsxXSxcbiAgICAgICAgY2VudGVyeiA9IGNlbnRlclsyXTtcblxuICAgIGlmIChNYXRoLmFicyhleWV4IC0gY2VudGVyeCkgPCAwLjAwMDAwMSAmJlxuICAgICAgICBNYXRoLmFicyhleWV5IC0gY2VudGVyeSkgPCAwLjAwMDAwMSAmJlxuICAgICAgICBNYXRoLmFicyhleWV6IC0gY2VudGVyeikgPCAwLjAwMDAwMSkge1xuICAgICAgICByZXR1cm4gaWRlbnRpdHkob3V0KTtcbiAgICB9XG5cbiAgICB6MCA9IGV5ZXggLSBjZW50ZXJ4O1xuICAgIHoxID0gZXlleSAtIGNlbnRlcnk7XG4gICAgejIgPSBleWV6IC0gY2VudGVyejtcblxuICAgIGxlbiA9IDEgLyBNYXRoLnNxcnQoejAgKiB6MCArIHoxICogejEgKyB6MiAqIHoyKTtcbiAgICB6MCAqPSBsZW47XG4gICAgejEgKj0gbGVuO1xuICAgIHoyICo9IGxlbjtcblxuICAgIHgwID0gdXB5ICogejIgLSB1cHogKiB6MTtcbiAgICB4MSA9IHVweiAqIHowIC0gdXB4ICogejI7XG4gICAgeDIgPSB1cHggKiB6MSAtIHVweSAqIHowO1xuICAgIGxlbiA9IE1hdGguc3FydCh4MCAqIHgwICsgeDEgKiB4MSArIHgyICogeDIpO1xuICAgIGlmICghbGVuKSB7XG4gICAgICAgIHgwID0gMDtcbiAgICAgICAgeDEgPSAwO1xuICAgICAgICB4MiA9IDA7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgbGVuID0gMSAvIGxlbjtcbiAgICAgICAgeDAgKj0gbGVuO1xuICAgICAgICB4MSAqPSBsZW47XG4gICAgICAgIHgyICo9IGxlbjtcbiAgICB9XG5cbiAgICB5MCA9IHoxICogeDIgLSB6MiAqIHgxO1xuICAgIHkxID0gejIgKiB4MCAtIHowICogeDI7XG4gICAgeTIgPSB6MCAqIHgxIC0gejEgKiB4MDtcblxuICAgIGxlbiA9IE1hdGguc3FydCh5MCAqIHkwICsgeTEgKiB5MSArIHkyICogeTIpO1xuICAgIGlmICghbGVuKSB7XG4gICAgICAgIHkwID0gMDtcbiAgICAgICAgeTEgPSAwO1xuICAgICAgICB5MiA9IDA7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgbGVuID0gMSAvIGxlbjtcbiAgICAgICAgeTAgKj0gbGVuO1xuICAgICAgICB5MSAqPSBsZW47XG4gICAgICAgIHkyICo9IGxlbjtcbiAgICB9XG5cbiAgICBvdXRbMF0gPSB4MDtcbiAgICBvdXRbMV0gPSB5MDtcbiAgICBvdXRbMl0gPSB6MDtcbiAgICBvdXRbM10gPSAwO1xuICAgIG91dFs0XSA9IHgxO1xuICAgIG91dFs1XSA9IHkxO1xuICAgIG91dFs2XSA9IHoxO1xuICAgIG91dFs3XSA9IDA7XG4gICAgb3V0WzhdID0geDI7XG4gICAgb3V0WzldID0geTI7XG4gICAgb3V0WzEwXSA9IHoyO1xuICAgIG91dFsxMV0gPSAwO1xuICAgIG91dFsxMl0gPSAtKHgwICogZXlleCArIHgxICogZXlleSArIHgyICogZXlleik7XG4gICAgb3V0WzEzXSA9IC0oeTAgKiBleWV4ICsgeTEgKiBleWV5ICsgeTIgKiBleWV6KTtcbiAgICBvdXRbMTRdID0gLSh6MCAqIGV5ZXggKyB6MSAqIGV5ZXkgKyB6MiAqIGV5ZXopO1xuICAgIG91dFsxNV0gPSAxO1xuXG4gICAgcmV0d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Skge1xuICByZXR1cm4gZGF0YSAhPT0gbnVsbCA/IGRhdGEgOiB7fTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBuZXcgVHlwZSgndGFnOnlhbWwub3JnLDIwMDI6c2V0Jywge1xuICBraW5kOiAnbWFwcGluZycsXG4gIHJlc29sdmU6IHJlc29sdmVZYW1sU2V0LFxuICBjb25zdHJ1Y3Q6IGNvbnN0cnVjdFlhbWxTZXRcbn0pO1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG52YXIgVHlwZSA9IHJlcXVpcmUoJy4uL3R5cGUnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBuZXcgVHlwZSgndGFnOnlhbWwub3JnLDIwMDI6c3RyJywge1xuICBraW5kOiAnc2NhbGFyJyxcbiAgY29uc3RydWN0OiBmdW5jdGlvbiAoZGF0YSkgeyByZXR1cm4gZGF0YSAhPT0gbnVsbCA/IGRhdGEgOiAnJzsgfVxufSk7XG4iLCIndXNlIHN0cmljdCc7XG5cbnZhciBUeXBlID0gcmVxdWlyZSgnLi4vdHlwZScpO1xuXG52YXIgWUFNTF9USU1FU1RBTVBfUkVHRVhQID0gbmV3IFJlZ0V4cChcbiAgJ14oWzAtOV1bMC05XVswLTldWzAtOV0pJyAgICAgICAgICArIC8vIFsxXSB5ZWFyXG4gICctKFswLTldWzAtOV0/KScgICAgICAgICAgICAgICAgICAgKyAvLyBbMl0gbW9udGhcbiAgJy0oWzAtOV1bMC05XT8pJyAgICAgICAgICAgICAgICAgICArIC8vIFszXSBkYXlcbiAgJyg/Oig/OltUdF18WyBcXFxcdF0rKScgICAgICAgICAgICAgICsgLy8gLi4uXG4gICcoWzAtOV1bMC05XT8pJyAgICAgICAgICAgICAgICAgICAgKyAvLyBbNF0gaG91clxuICAnOihbMC05XVswLTldKScgICAgICAgICAgICAgICAgICAgICsgLy8gWzVdIG1pbnV0ZVxuICAnOihbMC05XVswLTldKScgICAgICAgICAgICAgICAgICAgICsgLy8gWzZdIHNlY29uZFxuIC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AgICAgICAgICAgcHJvbWlzZXMucHVzaChjaGVja0VudHJ5Q1JDMzIoZmlsZXNbaV0pKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZXh0ZXJuYWwuUHJvbWlzZS5hbGwocHJvbWlzZXMpO1xuICAgIH0pLnRoZW4oZnVuY3Rpb24gYWRkRmlsZXMocmVzdWx0cykge1xuICAgICAgICB2YXIgemlwRW50cmllcyA9IHJlc3VsdHMuc2hpZnQoKTtcbiAgICAgICAgdmFyIGZpbGVzID0gemlwRW50cmllcy5maWxlcztcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBmaWxlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFyIGlucHV0ID0gZmlsZXNbaV07XG4gICAgICAgICAgICB6aXAuZmlsZShpbnB1dC5maWxlTmFtZVN0ciwgaW5wdXQuZGVjb21wcmVzc2VkLCB7XG4gICAgICAgICAgICAgICAgYmluYXJ5OiB0cnVlLFxuICAgICAgICAgICAgICAgIG9wdGltaXplZEJpbmFyeVN0cmluZzogdHJ1ZSxcbiAgICAgICAgICAgICAgICBkYXRlOiBpbnB1dC5kYXRlLFxuICAgICAgICAgICAgICAgIGRpcjogaW5wdXQuZGlyLFxuICAgICAgICAgICAgICAgIGNvbW1lbnQgOiBpbnB1dC5maWxlQ29tbWVudFN0ci5sZW5ndGggPyBpbnB1dC5maWxlQ29tbWVudFN0ciA6IG51bGwsXG4gICAgICAgICAgICAgICAgdW5peFBlcm1pc3Npb25zIDogaW5wdXQudW5peFBlcm1pc3Npb25zLFxuICAgICAgICAgICAgICAgIGRvc1Blcm1pc3Npb25zIDogaW5wdXQuZG9zUGVybWlzc2lvbnMsXG4gICAgICAgICAgICAgICAgY3JlYXRlRm9sZGVyczogb3B0aW9ucy5jcmVhdGVGb2xkZXJzXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoemlwRW50cmllcy56aXBDb21tZW50Lm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G4gICAgICAgICAgICBpZiAoaXNSZWdFeHAobmFtZSkpIHtcbiAgICAgICAgICAgICAgICB2YXIgcmVnZXhwID0gbmFtZTtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5maWx0ZXIoZnVuY3Rpb24ocmVsYXRpdmVQYXRoLCBmaWxlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAhZmlsZS5kaXIgJiYgcmVnZXhwLnRlc3QocmVsYXRpdmVQYXRoKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgeyAvLyB0ZXh0XG4gICAgICAgICAgICAgICAgdmFyIG9iaiA9IHRoaXMuZmlsZXNbdGhpcy5yb290ICsgbmFtZV07XG4gICAgICAgICAgICAgICAgaWYgKG9iaiAmJiAhb2JqLmRpcikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb2JqO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIHsgLy8gbW9yZSB0aGFuIG9uZSBhcmd1bWVudCA6IHdlIGhhdmUgZGF0YSAhXG4gICAgICAgICAgICBuYW1lID0gdGhpcy5yb290ICsgbmFtZTtcbiAgICAgICAgICAgIGZpbGVBZGQuY2FsbCh0aGlzLCBuYW1lLCBkYXRhLCBvKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogQWRkIGEgZGlyZWN0b3J5IHRvIHRoZSB6aXAgZmlsZSwgb3Igc2VhcmNoLlxuICAgICAqIEBwYXJhbSAgIHtTdHJpbmd8UmVnRXhwfSBhcmcgVGhlIG5hbWUgb2YgdGhlIGRpcmVjdG9yeSB0byBhZGQsIG9yIGEgcmVnZXggdG8gc2VhcmNoIGZvbGRlcn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wZSA9PT0gXCJiaW5hcnlzdHJpbmdcIikge1xuICAgIC8vICAgICAgICAgb3B0cy50eXBlID0gXCJzdHJpbmdcIjtcbiAgICAvLyAgICAgICB9XG5cbiAgICAvLyAgICAgICBpZiAoIW9wdHMudHlwZSkge1xuICAgIC8vICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiTm8gb3V0cHV0IHR5cGUgc3BlY2lmaWVkLlwiKTtcbiAgICAvLyAgICAgICB9XG5cbiAgICAvLyAgICAgICB1dGlscy5jaGVja1N1cHBvcnQob3B0cy50eXBlKTtcblxuICAgIC8vICAgICAgIC8vIGFjY2VwdCBub2RlanMgYHByb2Nlc3MucGxhdGZvcm1gXG4gICAgLy8gICAgICAgaWYoXG4gICAgLy8gICAgICAgICAgIG9wdGlvbnMucGxhdGZvcm0gPT09ICdkYXJ3aW4nIHx8XG4gICAgLy8gICAgICAgICAgIG9wdGlvbnMucGxhdGZvcm0gPT09ICdmcmVlYnNkJyB8fFxuICAgIC8vICAgICAgICAgICBvcHRpb25zLnBsYXRmb3JtID09PSAnbGludXgnIHx8XG4gICAgLy8gICAgICAgICAgIG9wdGlvbnMucGxhdGZvcm0gPT09ICdzdW5vcydcbiAgICAvLyAgICAgICApIHtcbiAgICAvLyAgICAgICAgICAgb3B0aW9ucy5wbGF0Zm9ybSA9IFwiVU5JWFwiO1xuICAgIC8vICAgICAgIH1cbiAgICAvLyAgICAgICBpZiAob3B0aW9ucy5wbGF0Zm9ybSA9PT0gJ3dpbjMyJykge1xuICAgIC8vICAgICAgICAgICBvcHRpb25zLnBsYXRmb3JtID0gXCJET1NcIjtcbiAgICAvLyAgICAgICB9XG5cbiAgICAvLyAgICAgICB2YXIgY29tbWVudCA9IG9wdHMuY29tbWVudCB8fCB0aGlzLmNvbW1lbnQgfHwgXCJcIjtcbiAgICAvLyAgICAgICB3b3JrZXIgPSBnZW5lcmF0ZS5nZW5lcmF0ZVdvcmtlcih0aGlzLCBvcHRzLCBjb21tZW50KTtcbiAg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uX2ludGVybmFsVHlwZSxcbiAgICAgICAgICAgIHJlc3VsdFR5cGUgPSBoZWxwZXIuX291dHB1dFR5cGUsXG4gICAgICAgICAgICBtaW1lVHlwZSA9IGhlbHBlci5fbWltZVR5cGU7XG4gICAgICAgIGhlbHBlclxuICAgICAgICAub24oJ2RhdGEnLCBmdW5jdGlvbiAoZGF0YSwgbWV0YSkge1xuICAgICAgICAgICAgZGF0YUFycmF5LnB1c2goZGF0YSk7XG4gICAgICAgICAgICBpZih1cGRhdGVDYWxsYmFjaykge1xuICAgICAgICAgICAgICAgIHVwZGF0ZUNhbGxiYWNrKG1ldGEpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KVxuICAgICAgICAub24oJ2Vycm9yJywgZnVuY3Rpb24oZXJyKSB7XG4gICAgICAgICAgICBkYXRhQXJyYXkgPSBbXTtcbiAgICAgICAgICAgIHJlamVjdChlcnIpO1xuICAgICAgICB9KVxuICAgICAgICAub24oJ2VuZCcsIGZ1bmN0aW9uICgpe1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICB2YXIgcmVzdWx0ID0gdHJhbnNmb3JtWmlwT3V0cHV0KHJlc3VsdFR5cGUsIGNvbmNhdChjaHVua1R5cGUsIGRhdGFBcnJheSksIG1pbWVUeXBlKTtcbiAgICAgICAgICAgICAgICByZXNvbHZlKHJlc3VsdCk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgcmVqZWN0KGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZGF0YUFycmF5ID0gW107XG4gICAgICAgIH0pXG4gICAgICAgIC5yZXN1bWUoKTtcbiAgICB9KTtcbn1cblxuLyoqXG4gKiBBbiBoZWxwZXIgdG8gZWFzaWx5IHVzZSB3b3JrZXJzIG91dHNpZGUgb2YgSlNaaXAuXG4gKiBAY29uc3RydWN0b3JcbiAqIEBwYXJhbSB7V29ya2VyfSB3b3JrZXIgdGhlIHdvcmtlciB0byB3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rKztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBidWZfbGVuICs9IGMgPCAweDgwID8gMSA6IGMgPCAweDgwMCA/IDIgOiBjIDwgMHgxMDAwMCA/IDMgOiA0O1xuICAgIH1cblxuICAgIC8vIGFsbG9jYXRlIGJ1ZmZlclxuICAgIGlmIChzdXBwb3J0LnVpbnQ4YXJyYXkpIHtcbiAgICAgICAgYnVmID0gbmV3IFVpbnQ4QXJyYXkoYnVmX2xlbik7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgYnVmID0gbmV3IEFycmF5KGJ1Zl9sZW4pO1xuICAgIH1cblxuICAgIC8vIGNvbnZlcnRcbiAgICBmb3IgKGk9MCwgbV9wb3MgPSAwOyBpIDwgYnVmX2xlbjsgbV9wb3MrKykge1xuICAgICAgICBjID0gc3RyLmNoYXJDb2RlQXQobV9wb3MpO1xuICAgICAgICBpZiAoKGMgJiAweGZjMDApID09PSAweGQ4MDAgJiYgKG1fcG9zKzEgPCBzdHJfbGVuKSkge1xuICAgICAgICAgICAgYzIgPSBzdHIuY2hhckNvZGVBdChtX3BvcysxKTtcbiAgICAgICAgICAgIGlmICgoYzIgJiAweGZjMDApID09PSAweGRjMDApIHtcbiAgICAgICAgICAgICAgICBjID0gMHgxMDAwMCArICgoYyAtIDB4ZDgwMCkgPDwgMTApICsgKGMyIC0gMHhkYzAwKTtcbiAgICAgICAgICAgICAgICBtX3BvcysrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChjIDwgMHg4MCkge1xuICAgICAgICAgICAgLyogb25lIGJ5dGUgKi9cbiAgICAgICAgICAgIGJ1ZltpKytdID0gYztcbiAgICAgICAgfSBlbHNlIGlmIChjIDwgMHg4MDApIHtcbiAgICAgICAgICAgIC8qIHR3byBieXRlcyAqL1xuICAgICAgICAgICAgYnVmW2krK10gPSAweEMwIHwgKGMgPj4+IDYpO1xuICAgICAgICAgICAgYnVmW2krK10gPSAweDgwIHwgKGMgJ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2FkID0gZnVuY3Rpb24oZSkge1xuICAgICAgICAgICAgICAgIHJlc29sdmUoZS50YXJnZXQucmVzdWx0KTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZWFkZXIub25lcnJvciA9IGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICAgICAgICByZWplY3QoZS50YXJnZXQuZXJyb3IpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlYWRlci5yZWFkQXNBcnJheUJ1ZmZlcihpbnB1dERhdGEpO1xuICAgICAgICB9KTtcbiAgICB9IGVsc2Uge1xuICAgICAgICAvLyBpZiBkYXRhIGlzIGFscmVhZHkgYSBwcm9taXNlLCB0aGlzIGZsYXR0ZW4gaXQuXG4gICAgICAgIHByb21pc2UgPSBleHRlcm5hbC5Qcm9taXNlLnJlc29sdmUoaW5wdXREYXRhKTtcbiAgICB9XG5cbiAgICByZXR1cm4gcHJvbWlzZS50aGVuKGZ1bmN0aW9uKGRhdGEpIHtcbiAgICAgICAgdmFyIGRhdGFUeXBlID0gZXhwb3J0cy5nZXRUeXBlT2YoZGF0YSk7XG5cbiAgICAgICAgaWYgKCFkYXRhVHlwZSkge1xuICAgICAgICAgICAgcmV0dXJuIGV4dGVybmFsLlByb21pc2UucmVqZWN0KFxuICAgICAgICAgICAgICAgIG5ldyBFcnJvcihcIlRoZSBkYXRhIG9mICdcIiArIG5hbWUgKyBcIicgaXMgaW4gYW4gdW5zdXBwb3J0ZWQgZm9ybWF0ICFcIilcbiAgICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gc3BlY2lhbCBjYXNlIDogaXQncyB3YXkgZWFzaWVyIHRvIHdvcmsgd2l0aCBVaW50OEFycmF5IHRoYW4gd2l0aCBBcnJheUJ1ZmZlclxuICAgICAgICBpZiAoZGF0YVR5cGUgPT09IFwiYXJyYXlidWZmZXJcIikge1xuICAgICAgICAgICAgZGF0YSA9IGV4cG9ydHMudHJhbnNmb3JtVG8oXCJ1aW50OGFyc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XJ0ID09PSB1dGlscy5NQVhfVkFMVUVfMzJCSVRTKSB7XG4gICAgICAgICAgICB0aGlzLmRpc2tOdW1iZXJTdGFydCA9IGV4dHJhUmVhZGVyLnJlYWRJbnQoNCk7XG4gICAgICAgIH1cbiAgICB9LFxuICAgIC8qKlxuICAgICAqIFJlYWQgdGhlIGNlbnRyYWwgcGFydCBvZiBhIHppcCBmaWxlIGFuZCBhZGQgdGhlIGluZm8gaW4gdGhpcyBvYmplY3QuXG4gICAgICogQHBhcmFtIHtEYXRhUmVhZGVyfSByZWFkZXIgdGhlIHJlYWRlciB0byB1c2UuXG4gICAgICovXG4gICAgcmVhZEV4dHJhRmllbGRzOiBmdW5jdGlvbihyZWFkZXIpIHtcbiAgICAgICAgdmFyIGVuZCA9IHJlYWRlci5pbmRleCArIHRoaXMuZXh0cmFGaWVsZHNMZW5ndGgsXG4gICAgICAgICAgICBleHRyYUZpZWxkSWQsXG4gICAgICAgICAgICBleHRyYUZpZWxkTGVuZ3RoLFxuICAgICAgICAgICAgZXh0cmFGaWVsZFZhbHVlO1xuXG4gICAgICAgIGlmICghdGhpcy5leHRyYUZpZWxkcykge1xuICAgICAgICAgICAgdGhpcy5leHRyYUZpZWxkcyA9IHt9O1xuICAgICAgICB9XG5cbiAgICAgICAgd2hpbGUgKHJlYWRlci5pbmRleCA8IGVuZCkge1xuICAgICAgICAgICAgZXh0cmFGaWVsZElkID0gcmVhZGVyLnJlYWRJbnQoMik7XG4gICAgICAgICAgICBleHRyYUZpZWxkTGVuZ3RoID0gcmVhZGVyLnJlYWRJbnQoMik7XG4gICAgICAgICAgICBleHRyYUZpZWxkVmFsdWUgPSByZWFkZXIucmVhZERhdGEoZXh0cmFGaWVsZExlbmd0aCk7XG5cbiAgICAgICAgICAgIHRoaXMuZXh0cmFGaWVsZHNbZXh0cmFGaWVsZElkXSA9IHtcbiAgICAgICAgICAgICAgICBpZDogZXh0cmFGaWVsZElkLFxuICAgICAgICAgICAgICAgIGxlbmd0aDogZX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HJlYW0gICAgICA9IHJlcXVpcmUoJy4vemxpYi96c3RyZWFtJyk7XG5cbnZhciB0b1N0cmluZyA9IE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmc7XG5cbi8qIFB1YmxpYyBjb25zdGFudHMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG52YXIgWl9OT19GTFVTSCAgICAgID0gMDtcbnZhciBaX0ZJTklTSCAgICAgICAgPSA0O1xuXG52YXIgWl9PSyAgICAgICAgICAgID0gMDtcbnZhciBaX1NUUkVBTV9FTkQgICAgPSAxO1xudmFyIFpfU1lOQ19GTFVTSCAgICA9IDI7XG5cbnZhciBaX0RFRkFVTFRfQ09NUFJFU1NJT04gPSAtMTtcblxudmFyIFpfREVGQVVMVF9TVFJBVEVHWSAgICA9IDA7XG5cbnZhciBaX0RFRkxBVEVEICA9IDg7XG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxuLyoqXG4gKiBjbGFzcyBEZWZsYXRlXG4gKlxuICogR2VuZXJpYyBKUy1zdHlsZSB3cmFwcGVyIGZvciB6bGliIGNhbGxzLiBJZiB5b3UgZG9uJ3QgbmVlZFxuICogc3RyZWFtaW5nIGJlaGF2aW91ciAtIHVzZSBtb3JlIHNpbXBsZSBmdW5jdGlvbnM6IFtbZGVmbGF0ZV1dLFxuICogW1tkZWZsYXRlUmF3XV0gYW5kIFtbZ3ppcF1dLlxuICoqL1xuXG4vKiBpbnRlcm5hbFxuICogRGVmbGF0ZS5jaHVua3MgLT4gQXJyYXlcbiAqXG4gKiBDaHVua3Mgb2Ygb3V0cHV0IGRhdGEsIGlmIFtbRGVmbGF0ZSNvbkRhdGF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xUX0NPTVBSRVNTSU9OID0gLTE7XG5cblxudmFyIFpfRklMVEVSRUQgICAgICAgICAgICA9IDE7XG52YXIgWl9IVUZGTUFOX09OTFkgICAgICAgID0gMjtcbnZhciBaX1JMRSAgICAgICAgICAgICAgICAgPSAzO1xudmFyIFpfRklYRUQgICAgICAgICAgICAgICA9IDQ7XG52YXIgWl9ERUZBVUxUX1NUUkFURUdZICAgID0gMDtcblxuLyogUG9zc2libGUgdmFsdWVzIG9mIHRoZSBkYXRhX3R5cGUgZmllbGQgKHRob3VnaCBzZWUgaW5mbGF0ZSgpKSAqL1xuLy92YXIgWl9CSU5BUlkgICAgICAgICAgICAgID0gMDtcbi8vdmFyIFpfVEVYVCAgICAgICAgICAgICAgICA9IDE7XG4vL3ZhciBaX0FTQ0lJICAgICAgICAgICAgICAgPSAxOyAvLyA9IFpfVEVYVFxudmFyIFpfVU5LTk9XTiAgICAgICAgICAgICA9IDI7XG5cblxuLyogVGhlIGRlZmxhdGUgY29tcHJlc3Npb24gbWV0aG9kICovXG52YXIgWl9ERUZMQVRFRCAgPSA4O1xuXG4vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbnZhciBNQVhfTUVNX0xFVkVMID0gOTtcbi8qIE1heGltdW0gdmFsdWUgZm9yIG1lbUxldmVsIGluIGRlZmxhdGVJbml0MiAqL1xudmFyIE1BWF9XQklUUyA9IDE1O1xuLyogMzJLIExaNzcgd2luZG93ICovXG52YXIgREVGX01FTV9MRVZFTCA9IDg7XG5cblxudmFyIExFTkdUSF9DT0RFUyAgPSAyOTtcbi8qIG51bWJlciBvZiBsZW5ndGggY29kZXMsIG5vdCBjb3VudGluZyB0aGUgc3BlY2lhbCBFTkRfQkxPQ0sgY29kZSAqL1xudmFyIExJVEVSQUxTICAgICAgPSAyNTY7XG4vKiBudW1iZXIgb2YgbGl0ZXJhbCBieXRlcyAwLi4yNTU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gICAgICBfd2luWysrc2Nhbl0gPT09IF93aW5bKyttYXRjaF0gJiYgX3dpblsrK3NjYW5dID09PSBfd2luWysrbWF0Y2hdICYmXG4gICAgICAgICAgICAgX3dpblsrK3NjYW5dID09PSBfd2luWysrbWF0Y2hdICYmIF93aW5bKytzY2FuXSA9PT0gX3dpblsrK21hdGNoXSAmJlxuICAgICAgICAgICAgIF93aW5bKytzY2FuXSA9PT0gX3dpblsrK21hdGNoXSAmJiBfd2luWysrc2Nhbl0gPT09IF93aW5bKyttYXRjaF0gJiZcbiAgICAgICAgICAgICBzY2FuIDwgc3RyZW5kKTtcblxuICAgIC8vIEFzc2VydChzY2FuIDw9IHMtPndpbmRvdysodW5zaWduZWQpKHMtPndpbmRvd19zaXplLTEpLCBcIndpbGQgc2NhblwiKTtcblxuICAgIGxlbiA9IE1BWF9NQVRDSCAtIChzdHJlbmQgLSBzY2FuKTtcbiAgICBzY2FuID0gc3RyZW5kIC0gTUFYX01BVENIO1xuXG4gICAgaWYgKGxlbiA+IGJlc3RfbGVuKSB7XG4gICAgICBzLm1hdGNoX3N0YXJ0ID0gY3VyX21hdGNoO1xuICAgICAgYmVzdF9sZW4gPSBsZW47XG4gICAgICBpZiAobGVuID49IG5pY2VfbWF0Y2gpIHtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBzY2FuX2VuZDEgID0gX3dpbltzY2FuICsgYmVzdF9sZW4gLSAxXTtcbiAgICAgIHNjYW5fZW5kICAgPSBfd2luW3NjYW4gKyBiZXN0X2xlbl07XG4gICAgfVxuICB9IHdoaWxlICgoY3VyX21hdGNoID0gcHJldltjdXJfbWF0Y2ggJiB3bWFza10pID4gbGltaXQgJiYgLS1jaGFpbl9sZW5ndGggIT09IDApO1xuXG4gIGlmIChiZXN0X2xlbiA8PSBzLmxvb2thaGVhZCkge1xuICAgIHJldHVybiBiZXN0X2xlbjtcbiAgfVxuICByZXR1cm4gcy5sb29rYWhlYWQ7XG59XG5cblxuLyogPT09PT09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5sb29rYWhlYWQgPj0gTUlOX01BVENIICYmIHMuc3Ryc3RhcnQgPiAwKSB7XG4gICAgICBzY2FuID0gcy5zdHJzdGFydCAtIDE7XG4gICAgICBwcmV2ID0gX3dpbltzY2FuXTtcbiAgICAgIGlmIChwcmV2ID09PSBfd2luWysrc2Nhbl0gJiYgcHJldiA9PT0gX3dpblsrK3NjYW5dICYmIHByZXYgPT09IF93aW5bKytzY2FuXSkge1xuICAgICAgICBzdHJlbmQgPSBzLnN0cnN0YXJ0ICsgTUFYX01BVENIO1xuICAgICAgICBkbyB7XG4gICAgICAgICAgLypqc2hpbnQgbm9lbXB0eTpmYWxzZSovXG4gICAgICAgIH0gd2hpbGUgKHByZXYgPT09IF93aW5bKytzY2FuXSAmJiBwcmV2ID09PSBfd2luWysrc2Nhbl0gJiZcbiAgICAgICAgICAgICAgICAgcHJldiA9PT0gX3dpblsrK3NjYW5dICYmIHByZXYgPT09IF93aW5bKytzY2FuXSAmJlxuICAgICAgICAgICAgICAgICBwcmV2ID09PSBfd2luWysrc2Nhbl0gJiYgcHJldiA9PT0gX3dpblsrK3NjYW5dICYmXG4gICAgICAgICAgICAgICAgIHByZXYgPT09IF93aW5bKytzY2FuXSAmJiBwcmV2ID09PSBfd2luWysrc2Nhbl0gJiZcbiAgICAgICAgICAgICAgICAgc2NhbiA8IHN0cmVuZCk7XG4gICAgICAgIHMubWF0Y2hfbGVuZ3RoID0gTUFYX01BVENIIC0gKHN0cmVuZCAtIHNjYW4pO1xuICAgICAgICBpZiAocy5tYXRjaF9sZW5ndGggPiBzLmxvb2thaGVhZCkge1xuICAgICAgICAgIHMubWF0Y2hfbGVuZ3RoID0gcy5sb29rYWhlYWQ7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIC8vQXNzZXJ0KHNjYW4gPD0gcy0+d2luZG93Kyh1SW50KShzLT53aW5kb3dfc2l6ZS0xKSwgXCJ3aWxkIHNjYW5cIik7XG4gICAgfVxuXG4gICAgLyogRW1pdCBtYX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ywgMCk7XG4gICAgICAgIHB1dF9ieXRlKHMsIDApO1xuICAgICAgICBwdXRfYnl0ZShzLCAwKTtcbiAgICAgICAgcHV0X2J5dGUocywgcy5sZXZlbCA9PT0gOSA/IDIgOlxuICAgICAgICAgICAgICAgICAgICAocy5zdHJhdGVneSA+PSBaX0hVRkZNQU5fT05MWSB8fCBzLmxldmVsIDwgMiA/XG4gICAgICAgICAgICAgICAgICAgICA0IDogMCkpO1xuICAgICAgICBwdXRfYnl0ZShzLCBPU19DT0RFKTtcbiAgICAgICAgcy5zdGF0dXMgPSBCVVNZX1NUQVRFO1xuICAgICAgfVxuICAgICAgZWxzZSB7XG4gICAgICAgIHB1dF9ieXRlKHMsIChzLmd6aGVhZC50ZXh0ID8gMSA6IDApICtcbiAgICAgICAgICAgICAgICAgICAgKHMuZ3poZWFkLmhjcmMgPyAyIDogMCkgK1xuICAgICAgICAgICAgICAgICAgICAoIXMuZ3poZWFkLmV4dHJhID8gMCA6IDQpICtcbiAgICAgICAgICAgICAgICAgICAgKCFzLmd6aGVhZC5uYW1lID8gMCA6IDgpICtcbiAgICAgICAgICAgICAgICAgICAgKCFzLmd6aGVhZC5jb21tZW50ID8gMCA6IDE2KVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgIHB1dF9ieXRlKHMsIHMuZ3poZWFkLnRpbWUgJiAweGZmKTtcbiAgICAgICAgcHV0X2J5dGUocywgKHMuZ3poZWFkLnRpbWUgPj4gOCkgJiAweGZmKTtcbiAgICAgICAgcHV0X2J5dGUocywgKHMuZ3poZWFkLnRpbWUgPj4gMTYpICYgMHhmZik7XG4gICAgICAgIHB1dF9ieXRlKHMsIChzLmd6aGVhZC50aW1lID4+IDI0KSAmIDB4ZmYpO1xuICAgICAgICBwdXRfYnl0ZShzLCBzLmxldmVsID09PSA5ID8gMiA6XG4gICAgICAgICAgICAgICAgICAgIChzLnN0cmF0ZWd5ID49IFpfSFVGRk1BTl9PTkxZIHx8IHMubGV2ZWwgPCAyID9cbiAg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+IGJlZykge1xuICAgICAgICAgICAgc3RybS5hZGxlciA9IGNyYzMyKHN0cm0uYWRsZXIsIHMucGVuZGluZ19idWYsIHMucGVuZGluZyAtIGJlZywgYmVnKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgZmx1c2hfcGVuZGluZyhzdHJtKTtcbiAgICAgICAgICBiZWcgPSBzLnBlbmRpbmc7XG4gICAgICAgICAgaWYgKHMucGVuZGluZyA9PT0gcy5wZW5kaW5nX2J1Zl9zaXplKSB7XG4gICAgICAgICAgICB2YWwgPSAxO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIEpTIHNwZWNpZmljOiBsaXR0bGUgbWFnaWMgdG8gYWRkIHplcm8gdGVybWluYXRvciB0byBlbmQgb2Ygc3RyaW5nXG4gICAgICAgIGlmIChzLmd6aW5kZXggPCBzLmd6aGVhZC5uYW1lLmxlbmd0aCkge1xuICAgICAgICAgIHZhbCA9IHMuZ3poZWFkLm5hbWUuY2hhckNvZGVBdChzLmd6aW5kZXgrKykgJiAweGZmO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHZhbCA9IDA7XG4gICAgICAgIH1cbiAgICAgICAgcHV0X2J5dGUocywgdmFsKTtcbiAgICAgIH0gd2hpbGUgKHZhbCAhPT0gMCk7XG5cbiAgICAgIGlmIChzLmd6aGVhZC5oY3JjICYmIHMucGVuZGluZyA+IGJlZykge1xuICAgICAgICBzdHJtLmFkbGVyID0gY3JjMzIoc3RybS5hZGxlciwgcy5wZW5kaW5nX2J1Ziwgcy5wZW5kaW5nIC0gYmVnLCBiZWcpO1xuICAgICAgfVxuICAgICAgaWYgKHZhbCA9PT0gMCkge1xuICAgICAgICBzLmd6aW5kZXggPSAwO1xuICAgICAgICBzLnN0YXR1cyA9IENPTU1FTlRfU1RBVEU7XG4gICAgICB9XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgcy5zdGF0dXMgPSBDT01NRU5UX1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biAgICAgIGhvbGQgKz0gaW5wdXRbX2luKytdIDw8IGJpdHM7XG4gICAgICBiaXRzICs9IDg7XG4gICAgfVxuXG4gICAgaGVyZSA9IGxjb2RlW2hvbGQgJiBsbWFza107XG5cbiAgICBkb2xlbjpcbiAgICBmb3IgKDs7KSB7IC8vIEdvdG8gZW11bGF0aW9uXG4gICAgICBvcCA9IGhlcmUgPj4+IDI0LypoZXJlLmJpdHMqLztcbiAgICAgIGhvbGQgPj4+PSBvcDtcbiAgICAgIGJpdHMgLT0gb3A7XG4gICAgICBvcCA9IChoZXJlID4+PiAxNikgJiAweGZmLypoZXJlLm9wKi87XG4gICAgICBpZiAob3AgPT09IDApIHsgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGxpdGVyYWwgKi9cbiAgICAgICAgLy9UcmFjZXZ2KChzdGRlcnIsIGhlcmUudmFsID49IDB4MjAgJiYgaGVyZS52YWwgPCAweDdmID9cbiAgICAgICAgLy8gICAgICAgIFwiaW5mbGF0ZTogICAgICAgICBsaXRlcmFsICclYydcXG5cIiA6XG4gICAgICAgIC8vICAgICAgICBcImluZmxhdGU6ICAgICAgICAgbGl0ZXJhbCAweCUwMnhcXG5cIiwgaGVyZS52YWwpKTtcbiAgICAgICAgb3V0cHV0W19vdXQrK10gPSBoZXJlICYgMHhmZmZmLypoZXJlLnZhbCovO1xuICAgICAgfVxuICAgICAgZWxzZSBpZiAob3AgJiAxNikgeyAgICAgICAgICAgICAgICAgICAgIC8qIGxlbmd0aCBiYXNlICovXG4gICAgICAgIGxlbiA9IGhlcmUgJiAweGZmZmYvKmhlcmUudmFsKi87XG4gICAgICAgIG9wICY9IDE1OyAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIG51bWJlciBvZiBleHRyYSBiaXRzICovXG4gICAgICAgIGlmIChvcCkge1xuICAgICAgICAgIGlmIChiaXRzIDwgb3ApIHtcbiAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbX2luKytdIDw8IGJpdHM7XG4gICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgfVxuICAgICAgICAgIGxlbiArPSBob2xkICYgKCgxIDw8IG9wKSAtIDEpO1xuICAgICAgICAgIGhvbGQgPj4+PSBvcDtcbiAgICAgICAgICBiaXRzIC09IG9wO1xuICAgICAgICB9XG4gICAgICAgIC8vVHJhY2V2digoc3RkZXJyLCBcImluZmxhdGU6ICAgICAgICAgbGVuZ3RoICV1XFxuXCIsIGxlbikpO1xuICAgICAgICBpZiAoYml0cyA8IDE1KSB7XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtfaW4rK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtfaW4rK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgIH1cbiAgICAgICAgaGVyZSA9IGRjb2RlW2hvbGQgJiBkbWFza107XG5cbiAgICAgICAgZG9kaXN0OlxuICAgICAgICBmb3IgKDs7KSB7IC8vIGdvdG8gZW11bGF0aW9uXG4gICAgICAgICAgb3AgPSBoZXJlID4+PiAyNC8qaGVyZS5iaXRzKi87XG4gICAgICAgICAgaG9sZCA+Pj49IG9wO1xuICAgICAgICAgIGJpdHMgLT0gb3A7XG4gICAgICAgICAgb3AgPSAoaGVyZSA+Pj4gMTYpICYgMHhmZi8qaGVyZS5vcCovO1xuXG4gICAgICAgICAgaWYgKG9wICYgMTYpIHsgICAgICAgICAgICAgICAgICAgICAgLyogZGlzdGFuY2UgYmFzZSAqL1xuICAgICAgICAgICAgZGlzdCA9IGhlcmUgJiAweGZmZmYvKmhlcmUudmFsKi87XG4gICAgICAgICAgICBvcCAmPSAxNTsgICAgICAgICAgICAgICAgICAgICAgIC8qIG51bWJlciBvZiBleHRyYSBiaXRzICovXG4gICAgICAgICAgICBpZiAoYml0cyA8IG9wKSB7XG4gICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbX2luKytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgICAgaWYgKGJpdHMgPCBvcCkge1xuICAgICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbX2luKytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkaXN0ICs9IGhvbGQgJiAoKDEgPDwgb3ApIC0gMSk7XG4vLyNpZmRlZiBJTkZMQVRFX1NUUklDVFxuICAgICAgICAgICAgaWYgKGRpc3QgPiBkbWF4KSB7XG4gICAgICAgICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgZGlzdGFuY2UgdG9vIGZhciBiYWNrJztcbiAgICAgICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICAgICAgYnJlYWsgdG9wO1xuICAgICAgICAgICAgfVxuLy8jZW5kaWZcbiAgICAgICAgICAgIGhvbGQgPj4+PSBvcDtcbiAgICAgICAgICAgIGJpdHMgLT0gb3A7XG4gICAgICAgICAgICAvL1RyYWNldnYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgICAgICAgIGRpc3RhbmNlICV1XFxuXCIsIGRpc3QpKTtcbiAgICAgICAgICAgIG9wID0gX291dCAtIGJlZzsgICAgICAgICAgICAgICAgLyogbWF4IGRpc3RhbmNlIGluIG91dHB1dCAqL1xuICAgICAgICAgICAgaWYgKGRpc3QgPiBvcCkgeyAgICAgICAgICAgICAgICAvKiBzZWUgaWYgY29weSBmcm9tIHdpbmRvdyAqL1xuICAgICAgICAgICAgICBvcCA9IGRpc3QgLSBvcDsgICAgICAgICAgICAgICAvKiBkaXN0YW5jZSBiYWNrIGluIHdpbmRvdyAqL1xuICAgICAgICAgICAgICBpZiAob3AgPiB3aGF2ZSkge1xuICAgICAgICAgICAgICAgIGlmIChzdGF0ZS5zYW5lKSB7XG4gICAgICAgICAgICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGRpc3RhbmNlIHRvbyBmYXIgYmFjayc7XG4gICAgICAgICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgICAgICAgYnJlYWsgdG9wO1xuICAgICAgICAgICAgICAgIH1cblxuLy8gKCEpIFRoaXMgYmxvY2sgaXMgZGlzYWJsZWQgaW4gemxpYiBkZWZhaWx0cyxcbi8vIGRvbid0IGVuYWJsZSBpdCBmb3IgYmluYXJ5IGNvbXBhdGliaWxpdHlcbi8vI2lmZGVmIElORkxBVEVfQUxMT1dfSU5WQUxJRF9ESVNUQU5DRV9UT09GQVJfQVJSUlxuLy8gICAgICAgICAgICAgICAgaWYgKGxlbiA8PSBvcCAtIHdoYXZlKSB7XG4vLyAgICAgICAgICAgICAgICAgIGRvIHtcbi8vICAgICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IDA7XG4vLyAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tbGVuKTtcbi8vICAgICAgICAgICAgICAgICAgY29udGludWUgdG9wO1xuLy8gICAgICAgICAgICAgICAgfVxuLy8gICAgICAgICAgICAgICAgbGVuIC09IG9wIC0gd2hhdmU7XG4vLyAgICAgICAgICAgICAgICBkbyB7XG4vLyAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gMDtcbi8vICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tb3AgPiB3aGF2ZSk7XG4vLyAgICAgICAgICAgICAgICBpZiAob3AgPT09IDApIHtcbi8vICAgICAgICAgICAgICAgICAgZnJvbSA9IF9vdXQgLSBkaXN0O1xuLy8gICAgICAgICAgICAgICAgICBkbyB7XG4vLyAgICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBvdXRwdXRbZnJvbSsrXTtcbi8vICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1sZW4pO1xuLy8gICAgICAgICAgICAgICAgICBjb250aW51ZSB0b3A7XG4vLyAgICAgICAgICAgICAgICB9XG4vLyNlbmRpZlxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGZyb20gPSAwOyAvLyB3aW5kb3cgaW5kZXhcbiAgICAgICAgICAgICAgZnJvbV9zb3VyY2UgPSBzX3dpbmRvdztcbiAgICAgICAgICAgICAgaWYgKHduZXh0ID09PSAwKSB7ICAgICAgICAgICAvKiB2ZXJ5IGNvbW1vbiBjYXNlICovXG4gICAgICAgICAgICAgICAgZnJvbSArPSB3c2l6ZSAtIG9wO1xuICAgICAgICAgICAgICAgIGlmIChvcCA8IGxlbikgeyAgICAgICAgIC8qIHNvbWUgZnJvbSB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgICAgIGxlbiAtPSBvcDtcbiAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBzX3dpbmRvd1tmcm9tKytdO1xuICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1vcCk7XG4gICAgICAgICAgICAgICAgICBmcm9tID0gX291dCAtIGRpc3Q7ICAvKiByZXN0IGZyb20gb3V0cHV0ICovXG4gICAgICAgICAgICAgICAgICBmcm9tX3NvdXJjZSA9IG91dHB1dDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZWxzZSBpZiAod25leHQgPCBvcCkgeyAgICAgIC8qIHdyYXAgYXJvdW5kIHdpbmRvdyAqL1xuICAgICAgICAgICAgICAgIGZyb20gKz0gd3NpemUgKyB3bmV4dCAtIG9wO1xuICAgICAgICAgICAgICAgIG9wIC09IHduZXh0O1xuICAgICAgICAgICAgICAgIGlmIChvcCA8IGxlbikgeyAgICAgICAgIC8qIHNvbWUgZnJvbSBlbmQgb2Ygd2luZG93ICovXG4gICAgICAgICAgICAgICAgICBsZW4gLT0gb3A7XG4gICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gc193aW5kb3dbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tb3ApO1xuICAgICAgICAgICAgICAgICAgZnJvbSA9IDA7XG4gICAgICAgICAgICAgICAgICBpZiAod25leHQgPCBsZW4pIHsgIC8qIHNvbWUgZnJvbSBzdGFydCBvZiB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgICAgICAgb3AgPSB3bmV4dDtcbiAgICAgICAgICAgICAgICAgICAgbGVuIC09IG9wO1xuICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBzX3dpbmRvd1tmcm9tKytdO1xuICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgtLW9wKTtcbiAgICAgICAgICAgICAgICAgICAgZnJvbSA9IF9vdXQgLSBkaXN0OyAgICAgIC8qIHJlc3QgZnJvbSBvdXRwdXQgKi9cbiAgICAgICAgICAgICAgICAgICAgZnJvbV9zb3VyY2UgPSBvdXRwdXQ7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGVsc2UgeyAgICAgICAgICAgICAgICAgICAgICAvKiBjb250aWd1b3VzIGluIHdpbmRvdyAqL1xuICAgICAgICAgICAgICAgIGZyb20gKz0gd25leHQgLSBvcDtcbiAgICAgICAgICAgICAgICBpZiAob3AgPCBsZW4pIHsgICAgICAgICAvKiBzb21lIGZyb20gd2luZG93ICovXG4gICAgICAgICAgICAgICAgICBsZW4gLT0gb3A7XG4gICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gc193aW5kb3dbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tb3ApO1xuICAgICAgICAgICAgICAgICAgZnJvbSA9IF9vdXQgLSBkaXN0OyAgLyogcmVzdCBmcm9tIG91dHB1dCAqL1xuICAgICAgICAgICAgICAgICAgZnJvbV9zb3VyY2UgPSBvdXRwdXQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHdoaWxlIChsZW4gPiAyKSB7XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBmcm9tX3NvdXJjZVtmcm9tKytdO1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gZnJvbV9zb3VyY2VbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IGZyb21fc291cmNlW2Zyb20rK107XG4gICAgICAgICAgICAgICAgbGVuIC09IDM7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKGxlbikge1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gZnJvbV9zb3VyY2VbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBpZiAobGVuID4gMSkge1xuICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBmcm9tX3NvdXJjZVtmcm9tKytdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgIGZyb20gPSBfb3V0IC0gZGlzdDsgICAgICAgICAgLyogY29weSBkaXJlY3QgZnJvbSBvdXRwdXQgKi9cbiAgICAgICAgICAgICAgZG8geyAgICAgICAgICAgICAgICAgICAgICAgIC8qIG1pbmltdW0gbGVuZ3RoIGlzIHRocmVlICovXG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBvdXRwdXRbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IG91dHB1dFtmcm9tKytdO1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gb3V0cHV0W2Zyb20rK107XG4gICAgICAgICAgICAgICAgbGVuIC09IDM7XG4gICAgICAgICAgICAgIH0gd2hpbGUgKGxlbiA+IDIpO1xuICAgICAgICAgICAgICBpZiAobGVuKSB7XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBvdXRwdXRbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBpZiAobGVuID4gMSkge1xuICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBvdXRwdXRbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSBpZiAoKG9wICYgNjQpID09PSAwKSB7ICAgICAgICAgIC8qIDJuZCBsZXZlbCBkaXN0YW5jZSBjb2RlICovXG4gICAgICAgICAgICBoZXJlID0gZGNvZGVbKGhlcmUgJiAweGZmZmYpLypoZXJlLnZhbCovICsgKGhvbGQgJiAoKDEgPDwgb3ApIC0gMSkpXTtcbiAgICAgICAgICAgIGNvbnRpbnVlIGRvZGlzdDtcbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGRpc3RhbmNlIGNvZGUnO1xuICAgICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICAgIGJyZWFrIHRvcDtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBicmVhazsgLy8gbmVlZCB0byBlbXVsYXRlIGdvdG8gdmlhIFwiY29udGludWVcIlxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBlbHNlIGlmICgob3AgJiA2NCkgPT09IDApIHsgICAgICAgICAgICAgIC8qIDJuZCBsZXZlbCBsZW5ndGggY29kZSAqL1xuICAgICAgICBoZXJlID0gbGNvZGVbKGhlcmUgJiAweGZmZmYpLypoZXJlLnZhbCovICsgKGhvbGQgJiAoKDEgPDwgb3ApIC0gMSkpXTtcbiAgICAgICAgY29udGludWUgZG9sZW47XG4gICAgICB9XG4gICAgICBlbHNlIGlmIChvcCAmIDMyKSB7ICA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zID0gYml0cztcbiAgcmV0dXJuO1xufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuXG52YXIgdXRpbHMgICAgICAgICA9IHJlcXVpcmUoJy4uL3V0aWxzL2NvbW1vbicpO1xudmFyIGFkbGVyMzIgICAgICAgPSByZXF1aXJlKCcuL2FkbGVyMzInKTtcbnZhciBjcmMzMiAgICAgICAgID0gcmVxdWlyZSgnLi9jcmMzMicpO1xudmFyIGluZmxhdGVfZmFzdCAgPSByZXF1aXJlKCcuL2luZmZhc3QnKTtcbnZhciBpbmZsYXRlX3RhYmxlID0gcmVxdWlyZSgnLi9pbmZ0cmVlcycpO1xuXG52YXIgQ09ERVMgPSAwO1xudmFyIExFTlMgPSAxO1xudmFyIERJU1RTID0gMjtcblxuLyogUHVibGljIGNvbnN0YW50cyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxuLyogQWxsb3dlZCBmbHVzaCB2YWx1ZXM7IHNlZSBkZWZsYXRlKCkgYW5kIGluZmxhdGUoKSBiZWxvdyBmb3IgZGV0YWlscyAqL1xuLy92YXIgWl9OT19GTFVTSCAgICAgID0gMDtcbi8vdmFyIFpfUEFSVElBTF9GTFVTSCA9IDE7XG4vL3ZhciBaX1NZTkNfRkxVU0ggICAgPSAyO1xuLy92YXIgWl9GVUxMX0ZMVVNIICAgID0gMztcbnZhciBaX0ZJTklTSCAgICAgICAgPSA0O1xudmFyIFpfQkxPQ0sgICAgICAgICA9IDU7XG52YXIgWl9UUkVFUyAgICAgICAgID0gNjtcblxuXG4vKiBSZXR1cm4gY29kZXMgZm9yIHRoZSBjb21wcmVzc2lvbi9kZWNvbXByZXNzaW9uIGZ1bmN0aW9ucy4gTmVnYXRpdmUgdmFsdWVzXG4gKiBhcmUgZXJyb3JzLCBwb3NpdGl2ZSB2YWx1ZXMgYXJlIHVzZWQgZm9yIHNwZWNpYWwgYnV0IG5vcm1hbCBldmVudHMuXG4gKi9cbnZhciBaX09LICAgICAgICAgICAgPSAwO1xudmFyIFpfU1RSRUFNX0VORCAgICA9IDE7XG52YXIgWl9ORUVEX0RJQ1QgICAgID0gMjtcbi8vdmFyIFpfRVJSTk8gICAgICAgICA9IC0xO1xudmFyIFpfU1RSRUFNX0VSUk9SICA9IC0yO1xudmFyIFpfREFUQV9FUlJPUiAgICA9IC0zO1xudmFyIFpfTUVNX0VSUk9SICAgICA9IC00O1xudmFyIFpfQlVGX0VSUk9SICAgICA9IC01O1xuLy92YXIgWl9WRVJTSU9OX0VSUk9SID0gLTY7XG5cbi8qIFRoZSBkZWZsYXRlIGNvbXByZXNzaW9uIG1ldGhvZCAqL1xudmFyIFpfREVGTEFURUQgID0gODtcblxuXG4vKiBTVEFURVMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cblxuXG52YXIgICAgSEVBRCA9IDE7ICAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIG1hZ2ljIGhlYWRlciAqL1xudmFyICAgIEZMQUdTID0gMjsgICAgICAvKiBpOiB3YWl0aW5nIGZvciBtZXRob2QgYW5kIGZsYWdzIChnemlwKSAqL1xudmFyICAgIFRJTUUgPSAzOyAgICAgICAvKiBpOiB3YWl0aW5nIGZvciBtb2RpZmljYXRpb24gdGltZSAoZ3ppcCkgKi9cbnZhciAgICBPUyA9IDQ7ICAgICAgICAgLyogaTogd2FpdGluZyBmb3IgZXh0cmEgZmxhZ3MgYW5kIG9wZXJhdGluZyBzeXN0ZW0gKGd6aXApICovXG52YXIgICAgRVhMRU4gPSA1OyAgICAgIC8qIGk6IHdhaX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Y2sgdmFsdWUgKi9cbnZhciAgICBMRU5HVEggPSAyODsgICAgLyogaTogd2FpdGluZyBmb3IgMzItYml0IGxlbmd0aCAoZ3ppcCkgKi9cbnZhciAgICBET05FID0gMjk7ICAgICAgLyogZmluaXNoZWQgY2hlY2ssIGRvbmUgLS0gcmVtYWluIGhlcmUgdW50aWwgcmVzZXQgKi9cbnZhciAgICBCQUQgPSAzMDsgICAgICAgLyogZ290IGEgZGF0YSBlcnJvciAtLSByZW1haW4gaGVyZSB1bnRpbCByZXNldCAqL1xudmFyICAgIE1FTSA9IDMxOyAgICAgICAvKiBnb3QgYW4gaW5mbGF0ZSgpIG1lbW9yeSBlcnJvciAtLSByZW1haW4gaGVyZSB1bnRpbCByZXNldCAqL1xudmFyICAgIFNZTkMgPSAzMjsgICAgICAvKiBsb29raW5nIGZvciBzeW5jaHJvbml6YXRpb24gYnl0ZXMgdG8gcmVzdGFydCBpbmZsYXRlKCkgKi9cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cblxuXG5cbnZhciBFTk9VR0hfTEVOUyA9IDg1MjtcbnZhciBFTk9VR0hfRElTVFMgPSA1OTI7XG4vL3ZhciBFTk9VR0ggPSAgKEVOT1VHSF9MRU5TK0VOT1VHSF9ESVNUUyk7XG5cbnZhciBNQVhfV0JJVFMgPSAxNTtcbi8qIDMySyBMWjc3IHdpbmRvdyAqL1xudmFyIERFRl9XQklUUyA9IE1BWF9XQklUUztcblxuXG5mdW5jdGlvbiB6c3dhcDMyKHEpIHtcbiAgcmV0dXJuICAoKChxID4+PiAyNCkgJiAweGZmKSArXG4gICAgICAgICAgKChxID4+PiA4KSAmIDB4ZmYwMCkgK1xuICAgICAgICAgICgocSAmIDB4ZmYwMCkgPDwgOCkgK1xuICAgICAgICAgICgocSAmIDB4ZmYpIDw8IDI0KSk7XG59XG5cblxuZnVuY3Rpb24gSW5mbGF0ZVN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oKTtcbiAgICAgICAgaG9sZCA9IDA7XG4gICAgICAgIGJpdHMgPSAwO1xuICAgICAgICAvLz09PS8vXG4gICAgICAgIHN0YXRlLm1vZGUgPSBGTEFHUztcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBzdGF0ZS5mbGFncyA9IDA7ICAgICAgICAgICAvKiBleHBlY3QgemxpYiBoZWFkZXIgKi9cbiAgICAgIGlmIChzdGF0ZS5oZWFkKSB7XG4gICAgICAgIHN0YXRlLmhlYWQuZG9uZSA9IGZhbHNlO1xuICAgICAgfVxuICAgICAgaWYgKCEoc3RhdGUud3JhcCAmIDEpIHx8ICAgLyogY2hlY2sgaWYgemxpYiBoZWFkZXIgYWxsb3dlZCAqL1xuICAgICAgICAoKChob2xkICYgMHhmZikvKkJJVFMoOCkqLyA8PCA4KSArIChob2xkID4+IDgpKSAlIDMxKSB7XG4gICAgICAgIHN0cm0ubXNnID0gJ2luY29ycmVjdCBoZWFkZXIgY2hlY2snO1xuICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICAgIGlmICgoaG9sZCAmIDB4MGYpLypCSVRTKDQpKi8gIT09IFpfREVGTEFURUQpIHtcbiAgICAgICAgc3RybS5tc2cgPSAndW5rbm93biBjb21wcmVzc2lvbiBtZXRob2QnO1xuICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICAgIC8vLS0tIERST1BCSVRTKDQpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gNDtcbiAgICAgIGJpdHMgLT0gNDtcbiAgICAgIC8vLS0tLy9cbiAgICAgIGxlbiA9IChob2xkICYgMHgwZikvKkJJVFMoNCkqLyArIDg7XG4gICAgICBpZiAoc3RhdGUud2JpdHMgPT09IDApIHtcbiAgICAgICAgc3RhdGUud2JpdHMgPSBsZW47XG4gICAgICB9XG4gICAgICBlbHNlIGlmIChsZW4gPiBzdGF0ZS53Yml0cykge1xuICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIHdpbmRvdyBzaXplJztcbiAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBzdGF0ZS5kbWF4ID0gMSA8PCBsZW47XG4gICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgemxpYiBoZWFkZXIgb2tcXG5cIikpO1xuICAgICAgc3RybS5hZGxlciA9IHN0YXRlLmNoZWNrID0gMS8qYWRsZXIzMigwTCwgWl9OVUxMLCAwKSovO1xuICAgICAgc3RhdGUubW9kZSA9IGhvbGQgJiAweDIwMCA/IERJQ1RJRCA6IFRZUEU7XG4gICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgaG9sZCA9IDA7XG4gICAgICBiaXRzID0gMDtcbiAgICAgIC8vPT09Ly9cbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgRkxBR1M6XG4gICAgICAvLz09PSBORUVEQklUUygxNik7ICovXG4gICAgICB3aGlsZSAoYml0cyA8IDE2KSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICBoYXZlLS07XG4gICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICBiaXRzICs9IDg7XG4gICAgICB9XG4gICAgICAvLz09PS8vXG4gICAgICBzdGF0ZS5mbGFncyA9IGhvbGQ7XG4gICAgICBpZiAoKHN0YXRlLmZsYWdzICYgMHhmZikgIT09IFpfREVGTEFURUQpIHtcbiAgICAgICAgc3RybS5tc2cgPSAndW5rbm93biBjb21wcmVzc2lvbiBtZXRob2QnO1xuICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4ZTAwMCkge1xuICAgICAgICBzdHJtLm1zZ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iAgICAgICAgICAgICAgLy8gLSBubyBuZWVkIGZvciBhZGRpdGlvbmFsIHNpemUgY2hlY2tcbiAgICAgICAgICAgICAgY29weSxcbiAgICAgICAgICAgICAgLypsZW4gKyBjb3B5ID4gc3RhdGUuaGVhZC5leHRyYV9tYXggLSBsZW4gPyBzdGF0ZS5oZWFkLmV4dHJhX21heCA6IGNvcHksKi9cbiAgICAgICAgICAgICAgbGVuXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgLy96bWVtY3B5KHN0YXRlLmhlYWQuZXh0cmEgKyBsZW4sIG5leHQsXG4gICAgICAgICAgICAvLyAgICAgICAgbGVuICsgY29weSA+IHN0YXRlLmhlYWQuZXh0cmFfbWF4ID9cbiAgICAgICAgICAgIC8vICAgICAgICBzdGF0ZS5oZWFkLmV4dHJhX21heCAtIGxlbiA6IGNvcHkpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoc3RhdGUuZmxhZ3MgJiAweDAyMDApIHtcbiAgICAgICAgICAgIHN0YXRlLmNoZWNrID0gY3JjMzIoc3RhdGUuY2hlY2ssIGlucHV0LCBjb3B5LCBuZXh0KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaGF2ZSAtPSBjb3B5O1xuICAgICAgICAgIG5leHQgKz0gY29weTtcbiAgICAgICAgICBzdGF0ZS5sZW5ndGggLT0gY29weTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoc3RhdGUubGVuZ3RoKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgfVxuICAgICAgc3RhdGUubGVuZ3RoID0gMDtcbiAgICAgIHN0YXRlLm1vZGUgPSBOQU1FO1xuICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgIGNhc2UgTkFNRTpcbiAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MDgwMCkge1xuICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgY29weSA9IDA7XG4g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c3RhdGUubW9kZSA9IENIRUNLO1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICAgIC8vPT09IE5FRURCSVRTKDMpOyAqL1xuICAgICAgd2hpbGUgKGJpdHMgPCAzKSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICBoYXZlLS07XG4gICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICBiaXRzICs9IDg7XG4gICAgICB9XG4gICAgICAvLz09PS8vXG4gICAgICBzdGF0ZS5sYXN0ID0gKGhvbGQgJiAweDAxKS8qQklUUygxKSovO1xuICAgICAgLy8tLS0gRFJPUEJJVFMoMSkgLS0tLy9cbiAgICAgIGhvbGQgPj4+PSAxO1xuICAgICAgYml0cyAtPSAxO1xuICAgICAgLy8tLS0vL1xuXG4gICAgICBzd2l0Y2ggKChob2xkICYgMHgwMykvKkJJVFMoMikqLykge1xuICAgICAgY2FzZSAwOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogc3RvcmVkIGJsb2NrICovXG4gICAgICAgIC8vVHJhY2V2KChzdGRlcnIsIFwiaW5mbGF0ZTogICAgIHN0b3JlZCBibG9jayVzXFxuXCIsXG4gICAgICAgIC8vICAgICAgICBzdGF0ZS5sYXN0ID8gXCIgKGxhc3QpXCIgOiBcIlwiKSk7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBTVE9SRUQ7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAxOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZml4ZWQgYmxvY2sgKi9cbiAgICAgICAgZml4ZWR0YWJsZXMoc3RhdGUpO1xuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgICBmaXhlZCBjb2RlcyBibG9jayVzXFxuXCIsXG4gICAgICAgIC8vICAgICAgICBzdGF0ZS5sYXN0ID8gXCIgKGxhc3QpXCIgO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IC09IGhlcmVfYml0cztcbiAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgc3RhdGUubGVuc1tzdGF0ZS5oYXZlKytdID0gaGVyZV92YWw7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgaWYgKGhlcmVfdmFsID09PSAxNikge1xuICAgICAgICAgICAgLy89PT0gTkVFREJJVFMoaGVyZS5iaXRzICsgMik7XG4gICAgICAgICAgICBuID0gaGVyZV9iaXRzICsgMjtcbiAgICAgICAgICAgIHdoaWxlIChiaXRzIDwgbikge1xuICAgICAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICAgICAgaGF2ZS0tO1xuICAgICAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy89PT0vL1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoaGVyZS5iaXRzKSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IGhlcmVfYml0cztcbiAgICAgICAgICAgIGJpdHMgLT0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgICAgaWYgKHN0YXRlLmhhdmUgPT09IDApIHtcbiAgICAgICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBiaXQgbGVuZ3RoIHJlcGVhdCc7XG4gICAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGVuID0gc3RhdGUubGVuc1tzdGF0ZS5oYXZlIC0gMV07XG4gICAgICAgICAgICBjb3B5ID0gMyArIChob2xkICYgMHgwMyk7Ly9CSVRTKDIpO1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoMikgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSAyO1xuICAgICAgICAgICAgYml0cyAtPSAyO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIGlmIChoZXJlX3ZhbCA9PT0gMTcpIHtcbiAgICAgICAgICAgIC8vPT09IE5FRURCSVRTKGhlcmUuYml0cyArIDMpO1xuICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDM7XG4gICAgICAgICAgICB3aGlsZSAoYml0cyA8IG4pIHtcbiAgICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIGxlbiA9IDA7XG4gICAgICAgICAgICBjb3B5ID0gMyArIChob2xkICYgMHgwNyk7Ly9CSVRTKDMpO1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoMykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSAzO1xuICAgICAgICAgICAgYml0cyAtPSAzO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIC8vPT09IE5FRURCSVRTKGhlcmUuYml0cyArIDcpO1xuICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDc7XG4gICAgICAgICAgICB3aGlsZSAoYml0cyA8IG4pIHtcbiAgICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIGxlbiA9IDA7XG4gICAgICAgICAgICBjb3B5ID0gMTEgKyAoaG9sZCAmIDB4N2YpOy8vQklUUyg3KTtcbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDcpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gNztcbiAgICAgICAgICAgIGJpdHMgLT0gNztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHN0YXRlLmhhdmUgKyBjb3B5ID4gc3RhdGUubmxlbiArIHN0YXRlLm5kaXN0KSB7XG4gICAgICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGJpdCBsZW5ndGggcmVwZWF0JztcbiAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgICAgd2hpbGUgKGNvcHktLSkge1xuICAgICAgICAgICAgc3RhdGUubGVuc1tzdGF0ZS5oYXZlKytdID0gbGVuO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvKiBoYW5kbGUgZXJyb3IgYnJlYWtzIGluIHdoaWxlICovXG4gICAgICBpZiAoc3RhdGUubW9kZSA9PT0gQkFEKSB7IGJyZWF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iAxNikgJiAweGZmO1xuICAgICAgICAgIGhlcmVfdmFsID0gaGVyZSAmIDB4ZmZmZjtcblxuICAgICAgICAgIGlmICgobGFzdF9iaXRzICsgaGVyZV9iaXRzKSA8PSBiaXRzKSB7IGJyZWFrOyB9XG4gICAgICAgICAgLy8tLS0gUFVMTEJZVEUoKSAtLS0vL1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICB9XG4gICAgICAgIC8vLS0tIERST1BCSVRTKGxhc3QuYml0cykgLS0tLy9cbiAgICAgICAgaG9sZCA+Pj49IGxhc3RfYml0cztcbiAgICAgICAgYml0cyAtPSBsYXN0X2JpdHM7XG4gICAgICAgIC8vLS0tLy9cbiAgICAgICAgc3RhdGUuYmFjayArPSBsYXN0X2JpdHM7XG4gICAgICB9XG4gICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAvLy0tLS8vXG4gICAgICBzdGF0ZS5iYWNrICs9IGhlcmVfYml0cztcbiAgICAgIHN0YXRlLmxlbmd0aCA9IGhlcmVfdmFsO1xuICAgICAgaWYgKGhlcmVfb3AgPT09IDApIHtcbiAgICAgICAgLy9UcmFjZXZ2KChzdGRlcnIsIGhlcmUudmFsID49IDB4MjAgJiYgaGVyZS52YWwgPCAweDdmID9cbiAgICAgICAgLy8gICAgICAgIFwiaW5mbGF0ZTogICAgICAgICBsaXRlcmFsICclYydcXG5cIiA6XG4gICAgICAgIC8vICAgICAgICBcImluZmxhdGU6ICAgICAgICAgbGl0ZXJhbCAweCUwMnhcXG5cIiwgaGVyZS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iAoc3RhdGUud3JhcCAmJiBzdGF0ZS5mbGFncykge1xuICAgICAgICAvLz09PSBORUVEQklUUygzMik7XG4gICAgICAgIHdoaWxlIChiaXRzIDwgMzIpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgaWYgKGhvbGQgIT09IChzdGF0ZS50b3RhbCAmIDB4ZmZmZmZmZmYpKSB7XG4gICAgICAgICAgc3RybS5tc2cgPSAnaW5jb3JyZWN0IGxlbmd0aCBjaGVjayc7XG4gICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgICBob2xkID0gMDtcbiAgICAgICAgYml0cyA9IDA7XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgLy9UcmFjZXYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgIGxlbmd0aCBtYXRjaGVzIHRyYWlsZXJcXG5cIikpO1xuICAgICAgfVxuICAgICAgc3RhdGUubW9kZSA9IERPTkU7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBET05FOlxuICAgICAgcmV0ID0gWl9TVFJFQU1fRU5EO1xuICAgICAgYnJlYWsgaW5mX2xlYXZlO1xuICAgIGNhc2UgQkFEOlxuICAgICAgcmV0ID0gWl9EQVRBX0VSUk9SO1xuICAgICAgYnJlYWsgaW5mX2xlYXZlO1xuICAgIGNhc2UgTUVNOlxuICAgICAgcmV0dXJuIFpfTUVNX0VSUk9SO1xuICAgIGNhc2UgU1lOQzpcbiAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICBkZWZ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L1xuICBpZiAoaHVmZiAhPT0gMCkge1xuICAgIC8vdGFibGUub3BbbmV4dCArIGh1ZmZdID0gNjQ7ICAgICAgICAgICAgLyogaW52YWxpZCBjb2RlIG1hcmtlciAqL1xuICAgIC8vdGFibGUuYml0c1tuZXh0ICsgaHVmZl0gPSBsZW4gLSBkcm9wO1xuICAgIC8vdGFibGUudmFsW25leHQgKyBodWZmXSA9IDA7XG4gICAgdGFibGVbbmV4dCArIGh1ZmZdID0gKChsZW4gLSBkcm9wKSA8PCAyNCkgfCAoNjQgPDwgMTYpIHwwO1xuICB9XG5cbiAgLyogc2V0IHJldHVybiBwYXJhbWV0ZXJzICovXG4gIC8vb3B0cy50YWJsZV9pbmRleCArPSB1c2VkO1xuICBvcHRzLmJpdHMgPSByb290O1xuICByZXR1cm4gMDtcbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbm1vZHVsZS5leHBvcnRzID0ge1xuICAyOiAgICAgICduZWVkIGRpY3Rpb25hcnknLCAgICAgLyogWl9ORUVEX0RJQ1QgICAgICAgMiAgKi9cbiAgMTogICAgICAnc3RyZWFtIGVuZCcsICAgICAgICAgIC8qIFpfU1RSRUFNX0VORCAgICAgIDEgICovXG4gIDA6ICAgICAgJycsICAgICAgICAgICAgICAgICAgICAvKiBaX09LICAgICAgICAgICAgICAwICAqL1xuICAnLTEnOiAgICdmaWxlIGVycm9yJywgICAgICAgICAgLyogWl9FUlJOTyAgICAgICAgICgtMSkgKi9cbiAgJy0yJzogICAnc3RyZWFtIGVycm9yJywgICAgICAgIC8qIFpfU1RSRUFNX0VSUk9SICAoLTIpICovXG4gICctMyc6ICAgJ2RhdGEgZXJyb3InLCAgICAgICAgICAvKiBaX0RBVEFfRVJST1IgICAgKC0zKSAqL1xuICAnLTQnOiAgICdpbnN1ZmZpY2llbnQgbWVtb3J5JywgLyogWl9NRU1fRVJST1IgICAgICgtNCkgKi9cbiAgJy01JzogICAnYnVmZmVyIGVycm9yJywgICAgICAgIC8qIFpfQlVGX0VSUk9SICAgICAoLTUpICovXG4gICctNic6ICAgJ2luY29tcGF0aWJsZSB2ZXJzaW9uJyAvKiBaX1ZFUlNJT05fRVJST1IgKC02KSAqL1xufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuXG52YXIgdXRpbHMgPSByZXF1aXJlKCcuLi91dGlscy9jb21tb24nKTtcblxuLyogUHVibGljIGNvbnN0YW50cyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxuLy92YXIgWl9GSUxURVJFRCAgICAgICAgICA9IDE7XG4vL3ZhciBaX0hVRkZNQU5fT05MWSAgICAgID0gMjtcbi8vdmFyIFpfUkxFICAgICAgICAgICAgICAgPSAzO1xudmFyIFpfRklYRUQgICAgICAgICAgICAgICA9IDQ7XG4vL3ZhciBaX0RFRkFVTFRfU1RSQVRFR1kgID0gMDtcblxuLyogUG9zc2libGUgdmFsdWVzIG9mIHRoZSBkYXRhX3R5cGUgZmllbGQgKHRob3VnaCBzZWUgaW5mbGF0ZSgpKSAqL1xudmFyIFpfQklOQVJZICAgICAgICAgICAgICA9IDA7XG52YXIgWl9URVhUICAgICAgICAgICAgICAgID0gMTtcbi8vdmFyIFpfQVNDSUkgICAgICAgICAgICAgPSAxOyAvLyA9IFpfVEVYVFxudmFyIFpfVU5LTk9XTiAgICAgICAgICAgICA9IDI7XG5cbi8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxuZnVuY3Rpb24gemVybyhidWYpIHsgdmFyIGxlbiA9IGJ1Zi5sZW5ndGg7IHdoaWxlICgtLWxlbiA+PSAwKSB7IGJ1ZltsZW5dID0gMDsgfSB9XG5cbi8vIEZyb20genV0aWwuaFxuXG52Y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LyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBSZXZlcnNlIHRoZSBmaXJzdCBsZW4gYml0cyBvZiBhIGNvZGUsIHVzaW5nIHN0cmFpZ2h0Zm9yd2FyZCBjb2RlIChhIGZhc3RlclxuICogbWV0aG9kIHdvdWxkIHVzZSBhIHRhYmxlKVxuICogSU4gYXNzZXJ0aW9uOiAxIDw9IGxlbiA8PSAxNVxuICovXG5mdW5jdGlvbiBiaV9yZXZlcnNlKGNvZGUsIGxlbikge1xuICB2YXIgcmVzID0gMDtcbiAgZG8ge1xuICAgIHJlcyB8PSBjb2RlICYgMTtcbiAgICBjb2RlID4+Pj0gMTtcbiAgICByZXMgPDw9IDE7XG4gIH0gd2hpbGUgKC0tbGVuID4gMCk7XG4gIHJldHVybiByZXMgPj4+IDE7XG59XG5cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBGbHVzaCB0aGUgYml0IGJ1ZmZlciwga2VlcGluZyBhdCBtb3N0IDcgYml0cyBpbiBpdC5cbiAqL1xuZnVuY3Rpb24gYmlfZmx1c2gocykge1xuICBpZiAocy5iaV92YWxpZCA9PT0gMTYpIHtcbiAgICBwdXRfc2hvcnQocywgcy5iaV9idWYpO1xuICAgIHMuYmlfYnVmID0gMDtcbiAgICBzLmJpX3ZhbGlkID0gMDtcblxuICB9IGVsc2UgaWYgKHMuYmlfdmFsaWQgPj0gOCkge1xuICAgIHMucGVuZGluZ19idWZbcy5wZW5kaW5nKytdID0gcy5iaV9idWYgJiAweGZmO1xuICAgIHMuYmlfYnVmID4+PSA4O1xuICAgIHMuYmlfdmFsaWQgLT0gODtcbiAgfVxufVxuXG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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xuICAgICAgICBjb2RlID0gZF9jb2RlKGRpc3QpO1xuICAgICAgICAvL0Fzc2VydCAoY29kZSA8IERfQ09ERVMsIFwiYmFkIGRfY29kZVwiKTtcblxuICAgICAgICBzZW5kX2NvZGUocywgY29kZSwgZHRyZWUpOyAgICAgICAvKiBzZW5kIHRoZSBkaXN0YW5jZSBjb2RlICovXG4gICAgICAgIGV4dHJhID0gZXh0cmFfZGJpdHNbY29kZV07XG4gICAgICAgIGlmIChleHRyYSAhPT0gMCkge1xuICAgICAgICAgIGRpc3QgLT0gYmFzZV9kaXN0W2NvZGVdO1xuICAgICAgICAgIHNlbmRfYml0cyhzLCBkaXN0LCBleHRyYSk7ICAgLyogc2VuZCB0aGUgZXh0cmEgZGlzdGFuY2UgYml0cyAqL1xuICAgICAgICB9XG4gICAgICB9IC8qIGxpdGVyYWwgb3IgbWF0Y2ggcGFpciA/ICovXG5cbiAgICAgIC8qIENoZWNrIHRoYXQgdGhlIG92ZXJsYXkgYmV0d2VlbiBwZW5kaW5nX2J1ZiBhbmQgZF9idWYrbF9idWYgaXMgb2s6ICovXG4gICAgICAvL0Fzc2VydCgodUludCkocy0+cGVuZGluZykgPCBzLT5saXRfYnVmc2l6ZSArIDIqbHgsXG4gICAgICAvLyAgICAgICBcInBlbmRpbmdCdWYgb3ZlcmZsb3dcIik7XG5cbiAgICB9IHdoaWxlIChseCA8IHMubGFzdF9saXQpO1xuICB9XG5cbiAgc2VuZF9jb2RlKHMsIEVORF9CTE9DSywgbHRyZWUpO1xufVxuXG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQ29uc3RydWN0IG9uZSBIdWZmbWFuIHRyZWUgYW5kIGFzc2lnbnMgdGhlIGNvZGUgYml0IHN0cmluZ3MgYW5kIGxlbmd0aHMuXG4gKiBVcGRhdGUgdGhlIHRvdGFsIGJpdCBsZW5ndGggZm9yIHRoZSBjdXJ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gICAgbWluX2NvdW50ID0gMztcblxuICAgIH0gZWxzZSBpZiAoY3VybGVuID09PSBuZXh0bGVuKSB7XG4gICAgICBtYXhfY291bnQgPSA2O1xuICAgICAgbWluX2NvdW50ID0gMztcblxuICAgIH0gZWxzZSB7XG4gICAgICBtYXhfY291bnQgPSA3O1xuICAgICAgbWluX2NvdW50ID0gNDtcbiAgICB9XG4gIH1cbn1cblxuXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIFNlbmQgYSBsaXRlcmFsIG9yIGRpc3RhbmNlIHRyZWUgaW4gY29tcHJlc3NlZCBmb3JtLCB1c2luZyB0aGUgY29kZXMgaW5cbiAqIGJsX3RyZWUuXG4gKi9cbmZ1bmN0aW9uIHNlbmRfdHJlZShzLCB0cmVlLCBtYXhfY29kZSlcbi8vICAgIGRlZmxhdGVfc3RhdGUgKnM7XG4vLyAgICBjdF9kYXRhICp0cmVlOyAvKiB0aGUgdHJlZSB0byBiZSBzY2FubmVkICovXG4vLyAgICBpbnQgbWF4X2NvZGU7ICAgICAgIC8qIGFuZCBpdHMgbGFyZ2VzdCBjb2RlIG9mIG5vbiB6ZXJvIGZyZXF1ZW5jeSAqL1xue1xuICB2YXIgbjsgICAgICAgICAgICAgICAgICAgICAvKiBpdGVyYXRlcyBvdmVyIGFsbCB0cmVlIGVsZW1lbnRzICovXG4gIHZhciBwcmV2bGVuID0gLTE7ICAgICAgICAgIC8qIGxhc3QgZW1pdHRlZCBsZW5ndGggKi9cbiAgdmFyIGN1cmxlbjsgICAgICAgICAgICAgICAgLyogbGVuZ3RoIG9mIGN1cnJlbnQgY29kZSAqL1xuXG4gIHZhciBuZXh0bGVuID0gdHJlZVswICogMiArIDFdLyouTGVuKi87IC8qIGxlbmd0aCBvZiBuZXh0IGNvZGUgKi9cblxuICB2YXIgY291bnQgPSAwOyAgICAgICAgICAgICAvKiByZXBlYXQgY291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9pbnQgbGFzdDsgICAgICAgICAvKiBvbmUgaWYgdGhpcyBpcyB0aGUgbGFzdCBibG9jayBmb3IgYSBmaWxlICovXG57XG4gIHNlbmRfYml0cyhzLCAoU1RPUkVEX0JMT0NLIDw8IDEpICsgKGxhc3QgPyAxIDogMCksIDMpOyAgICAvKiBzZW5kIGJsb2NrIHR5cGUgKi9cbiAgY29weV9ibG9jayhzLCBidWYsIHN0b3JlZF9sZW4sIHRydWUpOyAvKiB3aXRoIGhlYWRlciAqL1xufVxuXG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogU2VuZCBvbmUgZW1wdHkgc3RhdGljIGJsb2NrIHRvIGdpdmUgZW5vdWdoIGxvb2thaGVhZCBmb3IgaW5mbGF0ZS5cbiAqIFRoaXMgdGFrZXMgMTAgYml0cywgb2Ygd2hpY2ggNyBtYXkgcmVtYWluIGluIHRoZSBiaXQgYnVmZmVyLlxuICovXG5mdW5jdGlvbiBfdHJfYWxpZ24ocykge1xuICBzZW5kX2JpdHMocywgU1RBVElDX1RSRUVTIDw8IDEsIDMpO1xuICBzZW5kX2NvZGUocywgRU5EX0JMT0NLLCBzdGF0aWNfbHRyZWUpO1xuICBiaV9mbHVzaChzKTtcbn1cblxuXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIERldGVybWluZSB0aGUgYmVzdCBlbmNvZGluZyBmb3IgdGhlIGN1cnJlbnQgYmxvY2s6IGR5bmFtaWMgdHJlZXMsIHN0YXRpY1xuICogdHJlZXMgb3Igc3RvcmUsIGFuZCBvdXRwdXQgdGhlIGVuY29kZWQgYmxvY2sgdG8gdGhlIHppcCBmaWxlLlxuICovXG5mdW5jdGlvbiBfdHJfZmx1c2hfYmxvY2socywgYnVmLCBzdG9yZWRfbGVuLCBsYXN0KV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sZW5ndGggPSBzdHIubGVuZ3RoLFxuICAgICAgICBieXRlcyA9IFtdO1xuXG4gICAgZm9yICh2YXIgaSA9IDAsIGMsIGxlYWQ7IGkgPCBsZW5ndGg7IGkrKykge1xuICAgICAgICBjID0gc3RyLmNoYXJDb2RlQXQoaSk7IC8vIGNvZGUgcG9pbnRcblxuICAgICAgICBpZiAoYyA+IDB4RDdGRiAmJiBjIDwgMHhFMDAwKSB7XG5cbiAgICAgICAgICAgIGlmIChsZWFkKSB7XG4gICAgICAgICAgICAgICAgaWYgKGMgPCAweERDMDApIHtcbiAgICAgICAgICAgICAgICAgICAgYnl0ZXMucHVzaCgweEVGLCAweEJGLCAweEJEKTtcbiAgICAgICAgICAgICAgICAgICAgbGVhZCA9IGM7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYyA9IGxlYWQgLSAweEQ4MDAgPDwgMTAgfCBjIC0gMHhEQzAwIHwgMHgxMDAwMDtcbiAgICAgICAgICAgICAgICAgICAgbGVhZCA9IG51bGw7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChjID4gMHhEQkZGIHx8IChpICsgMSA9PT0gbGVuZ3RoKSkgYnl0ZXMucHVzaCgweEVGLCAweEJGLCAweEJEKTtcbiAgICAgICAgICAgICAgICBlbHNlIGxlYWQgPSBjO1xuXG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgfSBlbHNlIGlmIChsZWFkKSB7XG4gICAgICAgICAgICBieXRlcy5wdXNoKDB4RUYsIDB4QkYsIDB4QkQpO1xuICAgICAgICAgICAgbGVhZCA9IG51bGw7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4ODApIGJ5dGVzLnB1c2goYyk7XG4gICAgICAgIGVsc2UgaWYgKGMgPC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B9LFxuXG4gICAgLy8gRmluZCB0aGUgYW5nbGUgb2YgdGhlIHR3byB2ZWN0b3JzLCBzb2x2aW5nIHRoZSBmb3JtdWxhIGZvciB0aGUgY3Jvc3MgcHJvZHVjdCBhIHggYiA9IHxhfHxifHNpbijOuCkgZm9yIM64LlxuICAgIGFuZ2xlV2l0aFNlcDogZnVuY3Rpb24oeCwgeSkge1xuICAgICAgICByZXR1cm4gTWF0aC5hdGFuMihcbiAgICAgICAgICAgIHRoaXMueCAqIHkgLSB0aGlzLnkgKiB4LFxuICAgICAgICAgICAgdGhpcy54ICogeCArIHRoaXMueSAqIHkpO1xuICAgIH0sXG5cbiAgICBfbWF0TXVsdDogZnVuY3Rpb24obSkge1xuICAgICAgICB2YXIgeCA9IG1bMF0gKiB0aGlzLnggKyBtWzFdICogdGhpcy55LFxuICAgICAgICAgICAgeSA9IG1bMl0gKiB0aGlzLnggKyBtWzNdICogdGhpcy55O1xuICAgICAgICB0aGlzLnggPSB4O1xuICAgICAgICB0aGlzLnkgPSB5O1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9LFxuXG4gICAgX2FkZDogZnVuY3Rpb24ocCkge1xuICAgICAgICB0aGlzLnggKz0gcC54O1xuICAgICAgICB0aGlzLnkgKz0gcC55O1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9LFxuXG4gICAgX3N1YjogZnVuY3Rpb24ocCkge1xuICAgICAgICB0aGlzLnggLT0gcC54O1xuICAgICAgICB0aGlzLnkgLT0gcC55O1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9LFxuXG4gICAgX211bHQ6IGZ1bmN0aW9uKGspIHtcbiAgICAgICAgdGhpcy54ICo9IGs7XG4gICAgICAgIHRoaXMueSAqPSBrO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9LFxuXG4gICAgX2RpdjogZnVuY3Rpb24oaykge1xuICAgICAgICB0aGlzLnggLz0gaztcbiAgICAgICAgdGhpcy55IC89IGs7XG4gICAgICAgI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d1wiO1xuICAgICAgICAgICAgICAgIGFyZyA9IHJlY29yZC5hcmc7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gXCJyZXR1cm5cIikge1xuICAgICAgICAgICAgICAvLyBDb250aW51ZSB3aXRoIHRoZSBvdXRlciByZXR1cm4sIG5vdyB0aGF0IHRoZSBkZWxlZ2F0ZVxuICAgICAgICAgICAgICAvLyBpdGVyYXRvciBoYXMgYmVlbiB0ZXJtaW5hdGVkLlxuICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICB2YXIgcmVjb3JkID0gdHJ5Q2F0Y2goXG4gICAgICAgICAgICBkZWxlZ2F0ZS5pdGVyYXRvclttZXRob2RdLFxuICAgICAgICAgICAgZGVsZWdhdGUuaXRlcmF0b3IsXG4gICAgICAgICAgICBhcmdcbiAgICAgICAgICApO1xuXG4gICAgICAgICAgaWYgKHJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgICAgICAgIGNvbnRleHQuZGVsZWdhdGUgPSBudWxsO1xuXG4gICAgICAgICAgICAvLyBMaWtlIHJldHVybmluZyBnZW5lcmF0b3IudGhyb3codW5jYXVnaHQpLCBidXQgd2l0aG91dCB0aGVcbiAgICAgICAgICAgIC8vIG92ZXJoZWFkIG9mIGFuIGV4dHJhIGZ1bmN0aW9uIGNhbGwuXG4gICAgICAgICAgICBtZXRob2QgPSBcInRocm93XCI7XG4gICAgICAgICAgICBhcmcgPSByZWNvcmQuYXJnO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy8gRGVsZWdhdGUgZ2VuZXJhdG9yIHJhbiBhbmQgaGFuZGxlZCBpdHMgb3duIGV4Y2VwdGlvbnMgc29cbiAgICAgICAgICAvLyByZWdhcmRsZXNzIG9mI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ZSBtaW5pZmllciB3aWxsIG5vdCBhbm9ueW1pemUgdGhlIGZ1bmN0aW9uLlxuICAgICAgbmV4dC5kb25lID0gdHJ1ZTtcbiAgICAgIHJldHVybiBuZXh0O1xuICAgIH07XG4gIH07XG5cbiAgZnVuY3Rpb24gdmFsdWVzKGl0ZXJhYmxlKSB7XG4gICAgaWYgKGl0ZXJhYmxlKSB7XG4gICAgICB2YXIgaXRlcmF0b3JNZXRob2QgPSBpdGVyYWJsZVtpdGVyYXRvclN5bWJvbF07XG4gICAgICBpZiAoaXRlcmF0b3JNZXRob2QpIHtcbiAgICAgICAgcmV0dXJuIGl0ZXJhdG9yTWV0aG9kLmNhbGwoaXRlcmFibGUpO1xuICAgICAgfVxuXG4gICAgICBpZiAodHlwZW9mIGl0ZXJhYmxlLm5leHQgPT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICByZXR1cm4gaXRlcmFibGU7XG4gICAgICB9XG5cbiAgICAgIGlmICghaXNOYU4oaXRlcmFibGUubGVuZ3RoKSkge1xuICAgICAgICB2YXIgaSA9IC0xLCBuZXh0ID0gZnVuY3Rpb24gbmV4dCgpIHtcbiAgICAgICAgICB3aGlsZSAoKytpIDwgaXRlcmFibGUubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAoaGFzT3duLmNhbGwoaXRlcmFibGUsIGkpKSB7XG4gICAgICAgICAgICAgIG5leHQudmFsdWUgPSBpdGVyYWJsZVtpXTtcbiAgICAgICAgICAgICAgbmV4dC5kb25lID0gZmFsc2U7XG4gICAgICAgICAgICAgIHJldHVybiBuZXh0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIG5leHQudmFsdWUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgbmV4dC5kb25lID0gdHJ1ZTtcblxuICAgICAgICAgIHJldHVybiBuZXh0O1xuICAgICAgICB9O1xuXG4gICAgICAgIHJldHVybiBuZXh0Lm5leHQgPSBuZXh0O1xuICAgICAgfVxuICAgIH1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ljZSgxKSkpIHtcbiAgICAgICAgICAgIHRoaXNbbmFtZV0gPSB1bmRlZmluZWQ7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcblxuICAgIHN0b3A6IGZ1bmN0aW9uKCkge1xuICAgICAgdGhpcy5kb25lID0gdHJ1ZTtcblxuICAgICAgdmFyIHJvb3RFbnRyeSA9IHRoaXMudHJ5RW50cmllc1swXTtcbiAgICAgIHZhciByb290UmVjb3JkID0gcm9vdEVudHJ5LmNvbXBsZXRpb247XG4gICAgICBpZiAocm9vdFJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgICAgdGhyb3cgcm9vdFJlY29yZC5hcmc7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiB0aGlzLnJ2YWw7XG4gICAgfSxcblxuICAgIGRpc3BhdGNoRXhjZXB0aW9uOiBmdW5jdGlvbihleGNlcHRpb24pIHtcbiAgICAgIGlmICh0aGlzLmRvbmUpIHtcbiAgICAgICAgdGhyb3cgZXhjZXB0aW9uO1xuICAgICAgfVxuXG4gICAgICB2YXIgY29udGV4dCA9IHRoaXM7XG4gICAgICBmdW5jdGlvbiBoYW5kbGUobG9jLCBjYXVnaHQpIHtcbiAgICAgICAgcmVjb3JkLnR5cGUgPSBcInRocm93XCI7XG4gICAgICAgIHJlY29yZC5hcmcgPSBleGNlcHRpb247XG4gICAgICAgIGNvbnRleHQubmV4dCA9IGxvYztcbiAgICAgICAgcmV0dXJuICEhY2F1Z2h0O1xuICAgICAgfVxuXG4gICAgICBmb3IgKHZhciBpID0gdGhpcy50cnlFbnRyaWVzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBlbnRyeSA9IHRoaXMudHJ5RW50cmllc1tpXTtcbiAgICAgICAgdmFyIHJlY29yZCA9IGVudHJ5LmNvbXBsZXRpb247XG5cbiAgICAgICAgaWYgKGVudHJ5LnRyeUxvYyA9PT0gXCJyb290XCIpIHtcbiAgICAgICAgICAvLyBFeGNlcHRpb24gdGhyb3duIG91dHNpZGUgb2YgYW55IHRyeSBibG9jayB0aGF0IGNvdWxkIGhhbmRsZVxuICAgICAgICAgIC8vIGl0LCBzbyBzZXQgdGhlIGNvbXBsZXRpb24gdmFsdWUgb2YgdGhlIGVudGlyZSBmdW5jdGlvbiB0b1xuICAgICAgICAgIC8vIHRocm93IHRoZSBleGNlcHRpb24uXG4gICAgICAgICAgcmV0dXJuIGhhbmRsZShcImVuZFwiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChlbnRyeS50cnlMb2MgPD0gdGhpcy5wcmV2KSB7XG4gICAgICAgICAgdmFyIGhhc0NhdGNoID0gaGFzT3duLmNhbGwoZW50cnksIFwiY2F0Y2hMb2NcIik7XG4gICAgICAgICAgdmFyIGhhc0ZpbmFsbHkgPSBoYXNPd24uY2FsbChlbnRyeSwgXCJmaW5hbGx5TG9jXCIpO1xuXG4gICAgICAgICAgaWYgKGhhc0NhdGNoICYmIGhhc0ZpbmFsbHkpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnByZXYgPCBlbnRyeS5jYXRjaExvYykge1xuICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlKGVudHJ5LmNhdGNoTG9jLCB0cnVlKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5wcmV2IDwgZW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlKGVudHJ5LmZpbmFsbHlMb2MpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSBlbHNlIGlmIChoYXNDYXRjaCkge1xuICAgICAgICAgICAgaWYgKHRoaXMucHJldiA8IGVudHJ5LmNhdGNoTG9jKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoYW5kbGUoZW50cnkuY2F0Y2hMb2MsIHRydWUpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSBlbHNlIGlmIChoYXNGaW5hbGx5KSB7XG4gICAgICAgICAgICBpZiAodGhpcy5wcmV2IDwgZW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlKGVudHJ5LmZpbmFsbHlMb2MpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcInRyeSBzdGF0ZW1lbnQgd2l0aG91dCBjYXRjaCBvciBmaW5hbGx5XCIpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG5cbiAgICBhYnJ1cHQ6IGZ1bmN0aW9uKHR5cGUsIGFyZykge1xuICAgICAgZm9yICh2YXIgaSA9IHRoaXMudHJ5RW50cmllcy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICB2YXIgZW50cnkgPSB0aGlzLnRyeUVudHJpZXNbaV07XG4gICAgICAgIGlmIChlbnRyeS50cnlMb2MgPD0gdGhpcy5wcmV2ICYmXG4gICAgICAgICAgICBoYXNPd24uY2FsbChlbnRyeSwgXCJmaW5hbGx5TG9jXCIpICYmXG4gICAgICAgICAgICB0aGlzLnByZXYgPCBlbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgICAgdmFyIGZpbmFsbHlFbnRyeSA9IGVudHJ5O1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChmaW5hbGx5RW50cnkgJiZcbiAgICAgICAgICAodHlwZSA9PT0gXCJicmVha1wiIHx8XG4gICAgICAgICAgIHR5cGUgPT09IFwiY29udGludWVcIikgJiZcbiAgICAgICAgICBmaW5hbGx5RW50cnkudHJ5TG9jIDw9IGFyZyAmJlxuICAgICAgICAgIGFyZyA8PSBmaW5hbGx5RW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAvLyBJZ25vcmUgdGhlIGZpbmFsbHkgZW50cnkgaWYgY29udHJvbCBpcyBub3QganVtcGluZyB0byBhXG4gICAgICAgIC8vIGxvY2F0aW9uIG91dHNpZGUgdGhlIHRyeS9jYXRjaCBibG9jay5cbiAgICAgICAgZmluYWxseUVudHJ5ID0gbnVsbDtcbiAgICAgIH1cblxuICAgICAgdmFyIHJlY29yZCA9IGZpbmFsbHlFbnRyeSA/IGZpbmFsbHlFbnRyeS5jb21wbGV0aW9uIDoge307XG4gICAgICByZWNvcmQudHlwZSA9IHR5cGU7XG4gICAgICByZWNvcmQuYXJnID0gYXJnO1xuXG4gICAgICBpZiAoZmluYWxseUVudHJ5KSB7XG4gICAgICAgIHRoaXMubmV4dCA9IGZpbmFsbHlFbnRyeS5maW5hbGx5TG9jO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdGhpcy5jb21wbGV0ZShyZWNvcmQpO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gQ29udGludWVTZW50aW5lbDtcbiAgICB9LFxuXG4gICAgY29tcGxldGU6IGZ1bmN0aW9uKHJlY29yZCwgYWZ0ZXJMb2MpIHtcbiAgICAgIGlmIChyZWNvcmQudHlwZSA9PT0gXCJ0aHJvd1wiKSB7XG4gICAgICAgIHRocm93IHJlY29yZC5hcmc7XG4gICAgICB9XG5cbiAgICAgIGlmIChyZWNvcmQudHlwZSA9PT0gXCJicmVha1wiIHx8XG4gICAgICAgICAgcmVjb3JkLnR5cGUgPT09IFwiY29udGludWVcIikge1xuICAgICAgICB0aGlzLm5leHQgPSByZWNvcmQuYXJnO1xuICAgICAgfSBlbHNlIGlmIChyZWNvcmQudHlwZSA9PT0gXCJyZXR1cm5cIikge1xuICAgICAgICB0aGlzLnJ2YWwgPSByZWNvcmQuYXJnO1xuICAgICAgICB0aGlzLm5leHQgPSBcImVuZFwiO1xuICAgICAgfSBlbHNlIGlmIChyZWNvcmQudHlwZSA9PT0gXCJub3JtYWxcIiAmJiBhZnRlckxvYykge1xuICAgICAgICB0aGlzLm5leHQgPSBhZnRlckxvYztcbiAgICAgIH1cbiAgICB9LFxuXG4gICAgZmluaXNoOiBmdW5jdGlvbihmaW5hbGx5TG9jKSB7XG4gICAgICBmb3IgKHZhciBpID0gdGhpcy50cnlFbnRyaWVzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBlbnRyeSA9IHRoaXMudHJ5RW50cmllc1tpXTtcbiAgICAgICAgaWYgKGVudHJ5LmZpbmFsbHlMb2MgPT09IGZpbmFsbHlMb2MpIHtcbiAgICAgICAgICB0aGlzLmNvbXBsZXRlKGVudHJ5LmNvbXBsZXRpb24sIGVudHJ5LmFmdGVyTG9jKTtcbiAgICAgICAgICByZXNldFRyeUVudHJ5KGVudHJ5KTtcbiAgICAgICAgICByZXR1cm4gQ29udGludWVTZW50aW5lbDtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG5cbiAgICBcImNhdGNoXCI6IGZ1bmN0aW9uKHRyeUxvYykge1xuICAgICAgZm9yICh2YXIgaSA9IHRoaXMudHJ5RW50cmllcy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICB2YXIgZW50cnkgPSB0aGlzLnRyeUVudHJpZXNbaV07XG4gICAgICAgIGlmIChlbnRyeS50cnlMb2MgPT09IHRyeUxvYykge1xuICAgICAgICAgIHZhciByZWNvcmQgPSBlbnRyeS5jb21wbGV0aW9uO1xuICAgICAgICAgIGlmIChyZWNvcmQudHlwZSA9PT0gXCJ0aHJvd1wiKSB7XG4gICAgICAgICAgICB2YXIgdGhyb3duID0gcmVjb3JkLmFyZztcbiAgICAgICAgICAgIHJlc2V0VHJ5RW50cnkoZW50cnkpO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gdGhyb3duO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIC8vIFRoZSBjb250ZXh0LmNhdGNoIG1ldGhvZCBtdXN0IG9ubHkgYmUgY2FsbGVkIHdpdGggYSBsb2NhdGlvblxuICAgICAgLy8gYXJndW1lbnQgdGhhdCBjb3JyZXNwb25kcyB0byBhIGtub3duIGN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dHlwZTogXCJQb2x5Z29uXCIsIGFyY3M6IFtyaW5nXX0pLmNvb3JkaW5hdGVzWzBdKSA+IDA7IC8vIFRPRE8gYWxsb3cgc3BoZXJpY2FsP1xuICAgIH1cblxuICAgIHBvbHlnb25zLmZvckVhY2goZnVuY3Rpb24ocG9seWdvbikge1xuICAgICAgaWYgKCFwb2x5Z29uLl8pIHtcbiAgICAgICAgdmFyIGNvbXBvbmVudCA9IFtdLFxuICAgICAgICAgICAgbmVpZ2hib3JzID0gW3BvbHlnb25dO1xuICAgICAgICBwb2x5Z29uLl8gPSAxO1xuICAgICAgICBjb21wb25lbnRzLnB1c2goY29tcG9uZW50KTtcbiAgICAgICAgd2hpbGUgKHBvbHlnb24gPSBuZWlnaGJvcnMucG9wKCkpIHtcbiAgICAgICAgICBjb21wb25lbnQucHVzaChwb2x5Z29uKTtcbiAgICAgICAgICBwb2x5Z29uLmZvckVhY2goZnVuY3Rpb24ocmluZykge1xuICAgICAgICAgICAgcmluZy5mb3JFYWNoKGZ1bmN0aW9uKGFyYykge1xuICAgICAgICAgICAgICBwb2x5Z29uc0J5QXJjW2FyYyA8IDAgPyB+YXJjIDogYXJjXS5mb3JFYWNoKGZ1bmN0aW9uKHBvbHlnb24pIHtcbiAgICAgICAgICAgICAgICBpZiAoIXBvbHlnb24uXykge1xuICAgICAgICAgICAgICAgICAgcG9seWdvbi5fID0gMTtcbiAgICAgICAgICAgICAgICAgIG5laWdoYm9ycy5wdXNoKHBvbHlnb24pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuXG4gICAgcG9seWdvbnMuZm9yRWFjaChmdW5jdGlvbihwb2x5Z29uKSB7XG4gICAgICBkZWxldGUgcG9seWdvbi5fO1xuICAgIH0pO1xuXG4gICAgcmV0dXJuIHtcbiAgICAgIHR5cGU6IFwiTXVsdGlQb2x5Z29uXCIsXG4gICAgICBhcmNzOiBjb21wb25lbnRzLm1hcChmdW5jdGlvbihwb2x5Z29ucykge1xuICAgICAgICB2YXIgYXJjcyA9IFtdO1xuXG4gICAgICAgIC8vIEV4dHJhY3QgdGhlIGV4dGVyaW9yICh1bmlxdWUpIGFyY3MuXG4gICAgICAgIHBvbHlnb25zLmZvckVhY2goZnVuY3Rpb24ocG9seWdvbikge1xuICAgICAgICAgIHBvbHlnb24uZm9yRWFjaChmdW5jdGlvbihyaW5nKSB7XG4gICAgICAgICAgICByaW5nLmZvckVhY2goZnVuY3Rpb24oYXJjKSB7XG4gICAgICAgICAgICAgIGlmIChwb2x5Z29uc0J5QXJjW2FyYyA8IDAgPyB+YXJjIDogYXJjXS5sZW5ndGggPCAyKSB7XG4gICAgICAgICAgICAgICAgYXJjcy5wdXNoKGFyYyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcblxuICAgICAgICAvLyBTdGl0Y2ggdGhlIGFyY3MgaW50byBvbmUgb3IgbW9yZSByaW5ncy5cbiAgICAgICAgYXJjcyA9IHN0aXRjaEFyY3ModG9wb2xvZ3ksIGFyY3MpO1xuXG4gICAgICAgIC8vIElmIG1vcmUgdGhhbiBvbmUgcmluZyBpcyByZXR1cm5lZCxcbiAgICAgICAgLy8gYXQgbW9zdCBvbmUgb2YgdGhlc2UgcmluZ3MgY2FuIGJlIHRoZSBleHRlcmlvcjtcbiAgICAgICAgLy8gdGhpcyBleHRlcmlvciByaW5nIGhhcyB0aGUgc2FtZSB3aW5kaW5nIG9yZGVyXG4gICAgICAgIC8vIGFzIGFueSBleHRlcmlvciByaW5nIGluIHRoZSBvcmlnaW5hbCBwb2x5Z29ucy5cbiAgICAgICAgaWYgKChuID0gYXJjcy5sZW5ndGgpID4gMSkge1xuICAgICAgICAgIHZhciBzZ24gPSBleHRlcmlvcihwb2x5Z29uc1swXVswXSk7XG4gICAgICAgICA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mF5QnVmZmVyKG4pXG4gIH0gZWxzZSB7XG4gICAgc3dpdGNoKGR0eXBlKSB7XG4gICAgICBjYXNlICd1aW50OCc6XG4gICAgICAgIHJldHVybiBtYWxsb2NVaW50OChuKVxuICAgICAgY2FzZSAndWludDE2JzpcbiAgICAgICAgcmV0dXJuIG1hbGxvY1VpbnQxNihuKVxuICAgICAgY2FzZSAndWludDMyJzpcbiAgICAgICAgcmV0dXJuIG1hbGxvY1VpbnQzMihuKVxuICAgICAgY2FzZSAnaW50OCc6XG4gICAgICAgIHJldHVybiBtYWxsb2NJbnQ4KG4pXG4gICAgICBjYXNlICdpbnQxNic6XG4gICAgICAgIHJldHVybiBtYWxsb2NJbnQxNihuKVxuICAgICAgY2FzZSAnaW50MzInOlxuICAgICAgICByZXR1cm4gbWFsbG9jSW50MzIobilcbiAgICAgIGNhc2UgJ2Zsb2F0JzpcbiAgICAgIGNhc2UgJ2Zsb2F0MzInOlxuICAgICAgICByZXR1cm4gbWFsbG9jRmxvYXQobilcbiAgICAgIGNhc2UgJ2RvdWJsZSc6XG4gICAgICBjYXNlICdmbG9hdDY0JzpcbiAgICAgICAgcmV0dXJuIG1hbGxvY0RvdWJsZShuKVxuICAgICAgY2FzZSAndWludDhfY2xhbXBlZCc6XG4gICAgICAgIHJldHVybiBtYWxsb2NVaW50OENsYW1wZWQobilcbiAgICAgIGNhc2UgJ2J1ZmZlcic6XG4gICAgICAgIHJldHVybiBtYWxsb2NCdWZmZXIobilcbiAgICAgIGNhc2UgJ2RhdGEnOlxuICAgICAgY2FzZSAnZGF0YXZpZXcnOlxuICAgICAgICByZXR1cm4gbWFsbG9jRGF0YVZpZXcobilcblxuICAgICAgZGVmYXVsdDpcbiAgICAgICAgcmV0dXJuIG51bGxcbiAgICB9XG4gIH1cbiAgcmV0dXJuIG51bGxcbn1cblxuZnVuY3Rpb24gbWFsbG9jQXJyYXlCdWZmZXIobikge1xuICB2YXIgbiA9IGJpdHMubmV4dFBvdzIobilcbiAgdmFy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XRyeSA9IGZ1bmN0aW9uKCkge1xuICAgIHZhciBwYmYgPSB0aGlzLl9wYmY7XG4gICAgcGJmLnBvcyA9IHRoaXMuX2dlb21ldHJ5O1xuXG4gICAgdmFyIGVuZCA9IHBiZi5yZWFkVmFyaW50KCkgKyBwYmYucG9zLFxuICAgICAgICBjbWQgPSAxLFxuICAgICAgICBsZW5ndGggPSAwLFxuICAgICAgICB4ID0gMCxcbiAgICAgICAgeSA9IDAsXG4gICAgICAgIGxpbmVzID0gW10sXG4gICAgICAgIGxpbmU7XG5cbiAgICB3aGlsZSAocGJmLnBvcyA8IGVuZCkge1xuICAgICAgICBpZiAoIWxlbmd0aCkge1xuICAgICAgICAgICAgdmFyIGNtZExlbiA9IHBiZi5yZWFkVmFyaW50KCk7XG4gICAgICAgICAgICBjbWQgPSBjbWRMZW4gJiAweDc7XG4gICAgICAgICAgICBsZW5ndGggPSBjbWRMZW4gPj4gMztcbiAgICAgICAgfVxuXG4gICAgICAgIGxlbmd0aC0tO1xuXG4gICAgICAgIGlmIChjbWQgPT09IDEgfHwgY21kID09PSAyKSB7XG4gICAgICAgICAgICB4ICs9IHBiZi5yZWFkU1ZhcmludCgpO1xuICAgICAgICAgICAgeSArPSBwYmYucmVhZFNWYXJpbnQoKTtcblxuICAgICAgICAgICAgaWYgKGNtZCA9PT0gMSkgeyAvLyBtb3ZlVG9cbiAgICAgICAgICAgICAgICBpZiAobGluZSkgbGluZXMucHVzaChsaW5lKTtcbiAgICAgICAgICAgICAgICBsaW5lID0gW107XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGxpbmUucHVzaChuZXcgUG9pbnQoeCwgeSkpO1xuXG4gICAgICAgIH0gZWxzZSBpZiAoY21kID09PSA3KSB7XG4gICAgICAgICAgICBsaW5lLnB1c2gobGluZVswXS5jbG9uZSgpKTsgLy8gY2xvc2VQb2x5Z29uXG5cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcigndW5rbm93biBjb21tYW5kICcgKyBjbWQpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgaWYgKGxpbmUpIGxpbmVzLnB1c2gobGluZSk7XG5cbiAgICByZXR1cm4gbGluZXM7XG59O1xuXG5WZWN0b3JUaWxlRmVhdHVyZS5wcm90b3R5cGUuYmJveCA9IGZ1bmN0aW9uKCkge1xuICAgIHZhciBwYmYgPSB0aGlzLl9wYmY7XG4gICAgcGJmLnBvcyA9IHRoaXMuX2dlb21ldHJ5O1xuXG4gICAgdmFyIGVuZCA9IHBiZi5yZWFkVmFyaW50KCkgKyBwYmYucG9zLFxuICAgICAgICBjbWQgPSAxLFxuICAgICAgICBsZW5ndGggPSAwLFxuICAgICAgICB4ID0gMCxcbiAgICAgICAgeSA9IDAsXG4gICAgICAgIHgxID0gSW5maW5pdHksXG4gICAgICAgIHgyID0gLUluZmluaXR5LFxuICAgICAgICB5MSA9IEluZmluaXR5LFxuICAgICAgICB5MiA9IC1JbmZpbml0eTtcblxuICAgIHdoaWxlIChwYmYucG9zIDwgZW5kKSB7XG4gICAgICAgIGlmICghbGVuZ3RoKSB7XG4gICAgICAgICAgICB2YXIgY21kTGVuID0gcGJmLnJlYWRWYXJpbnQoKTtcbiAgICAgICAgICAgIGNtZCA9IGNtZExlbiAmIDB4NztcbiAgICAgICAgICAgIGxlbmd0aCA9IGNtZExlbiA+PiAzO1xuICAgICAgICB9XG5cbiAgICAgICAgbGVuZ3RoLS07XG5cbiAgICAgICAgaWYgKGNtZCA9PT0gMSB8fCBjbWQgPT09IDIpIHtcbiAgICAgICAgICAgIHggKz0gcGJmLnJlYWRTVmFyaW50KCk7XG4gICAgICAgICAgICB5ICs9IHBiZi5yZWFkU1ZhcmludCgpO1xuICAgICAgICAgICAgaWYgKHggPCB4MSkgeDEgPSB4O1xuICAgICAgICAgICAgaWYgKHggPiB4MikgeDIgPSB4O1xuICAgICAgICAgICAgaWYgKHkgPCB5MSkgeTEgPSB5O1xuICAgICAgICAgICAgaWYg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ZV91ID0gKG1heF91IC0gbWluX3UpIC8gc3Bhbl94O1xuICAgICAgICAgICAgdmFyIHNjYWxlX3YgPSAobWF4X3YgLSBtaW5fdikgLyBzcGFuX3k7XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKHZhciByaW5nX2luZGV4ID0gMDsgcmluZ19pbmRleCA8IHBvbHlnb24ubGVuZ3RoOyByaW5nX2luZGV4Kyspe1xuICAgICAgICAgICAgLy8gQWRkIHZlcnRleCBkYXRhXG4gICAgICAgICAgICB2YXIgcG9seWdvbl9yaW5nID0gcG9seWdvbltyaW5nX2luZGV4XTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcG9seWdvbl9yaW5nLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgdmFyIHZlcnRleCA9IHBvbHlnb25fcmluZ1tpXTtcbiAgICAgICAgICAgICAgICB2ZXJ0ZXhfdGVtcGxhdGVbMF0gPSB2ZXJ0ZXhbMF07XG4gICAgICAgICAgICAgICAgdmVydGV4X3RlbXBsYXRlWzFdID0gdmVydGV4WzFdO1xuXG4gICAgICAgICAgICAgICAgLy8gQWRkIFVWc1xuICAgICAgICAgICAgICAgIGlmICh0ZXhjb29yZF9pbmRleCkge1xuICAgICAgICAgICAgICAgICAgICB2ZXJ0ZXhfdGVtcGxhdGVbdGV4Y29vcmRfaW5kZXggKyAwXSA9ICgodmVydGV4WzBdIC0gbWluX3gpICogc2NhbGVfdSArIG1pbl91KSAqIHRleGNvb3JkX25vcm1hbGl6ZTtcbiAgICAgICAgICAgICAgICAgICAgdmVydGV4X3RlbXBsYXRlW3RleGNvb3JkX2luZGV4ICsgMV0gPSAoKHZlcnRleFsxXSAtIG1pbl95KSAqIHNjYWxlX3YgKyBtaW5fdikgKiB0ZXhjb29yZF9ub3JtYWxpemU7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdmVydGV4X2RhdGEuYWRkVmVydGV4KHZlcnRleF90ZW1wbG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gICAgICAgICBmb3IgKHZhciB3PTA7IHcgPCBjb250b3VyLmxlbmd0aCAtIDE7IHcrKykge1xuICAgICAgICAgICAgICAgIGlmIChyZW1vdmVfdGlsZV9lZGdlcyAmJiBvdXRzaWRlVGlsZShjb250b3VyW3ddLCBjb250b3VyW3crMV0sIHRpbGVfZWRnZV90b2xlcmFuY2UpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOyAvLyBkb24ndCBleHRydWRlIHRpbGUgZWRnZXNcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBXYWxsIG9yZGVyIGlzIGRlcGVuZGVudCBvbiB3aW5kaW5nIG9yZGVyLCBzbyB0aGF0IG5vcm1hbHMgZmFjZSBvdXR3YXJkXG4gICAgICAgICAgICAgICAgbGV0IHcwLCB3MTtcbiAgICAgICAgICAgICAgICBpZiAod2luZGluZyA9PT0gJ0NDVycpIHtcbiAgICAgICAgICAgICAgICAgICAgdzAgPSB3O1xuICAgICAgICAgICAgICAgICAgICB3MSA9IHcrMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHcwID0gdysxO1xuICAgICAgICAgICAgICAgICAgICB3MSA9IHc7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gVHdvIHRyaWFuZ2xlcyBmb3IgdGhlIHF1YWQgZm9ybWVkIGJ5IGVhY2ggdmVydGV4IHBhaXIsIGdvaW5nIGZyb20gYm90dG9tIHRvIHRvcCBoZWlnaHRcbiAgICAgICAgICAgICAgICB2YXIgd2FsbF92ZXJ0aWNlcyA9IFtcbiAgICAgICAgICAgICAgICAgICAgW2NvbnRvdXJbdzFdWzBdLCBjb250b3VyW3cxXVsxXSwgbWF4X3pdLFxuICAgICAgICAgICAgICAgICAgICBbY29udG91clt3MV1bMF0sIGNvbnRvdXJbdzFdWzFdLCBtaW5fel0sXG4gICAgICAgICAgICAgICAgICAgIFtjb250b3VyW3cwXVswXSwgY29udG91clt3MF1bMV0sIG1pbl96XSxcbiAgICAgICAgICAgICAgICAgICAgW2NvbnRvdXJbdzBdWzBdLCBjb250b3VyW3cwXVsxXSwgbWF4X3pdXG4gICAgICAgICAgICAgICAgXTtcblxuICAgICAgICAgICAgICAgIC8vIENhbGMgdGhlIG5vcm1hbCBvZiB0aGUgd2FsbCBmcm9tIHVwIHZlY3RvciBhbmQgb25lIHNlZ21lbnQgb2YgdGhlIHdhbGwgdHJpYW5nbGVzXG4gICAgICAgICAgICAgICAgbGV0IHdhbGxfdmVjID0gVmVjdG9yLm5vcm1hbGl6ZShbY29udG91clt3MV1bMF0gLSBjb250b3VyW3cwXVswXSwgY29udG91clt3MV1bMV0gLSBjb250b3VyW3cwXVsxXSwgMF0pO1xuICAgICAgICAgICAgICAgIGxldCBub3JtYWwgPSBWZWN0b3IuY3Jvc3ModXBfdmVjMywgd2FsbF92ZWMpO1xuXG4gICAgICAgICAgICAgICAgLy8gVXBkYXRlIHZlcnRleCB0ZW1wbGF0ZSB3aXRoIGN1cnJlbnQgc3VyZmFjZSBub3JtYWxcbiAgICAgICAgICAgICAgICB2ZXJ0ZXhfdGVtcGxhdGVbbm9ybWFsX2luZGV4ICsgMF0gPSBub3JtYWxbMF0gKiBub3JtYWxfbm9ybWFsaXplO1xuICAgICAgICAgICAgICAgIHZlcnRleF90ZW1wbGF0ZVtub3JtYWxfaW5kZXggKyAxXSA9IG5vcm1hbFsxXSAqIG5vcm1hbF9ub3JtYWxpemU7XG4gICAgICAgICAgICAgICAgdmVydGV4X3RlbXBsYXRlW25vcm1hbF9pbmRleCArIDJdID0gbm9ybWFsWzJdICogbm9ybWFsX25vcm1hbGl6ZTtcblxuICAgICAgICAgICAgICAgIGZvciAodmFyIHd2PTA7IHd2IDwgd2FsbF92ZXJ0aWNlcy5sZW5ndGg7IHd2KyspIHtcbiAgICAgICAgICAgICAgICAgICAgdmVydGV4X3RlbXBsYXRlWzBdID0gd2FsbF92ZXJ0aWNlc1t3dl1bMF07XG4gICAgICAgICAgICAgICAgICAgIHZlcnRleF90ZW1wbGF0ZVsxXSA9IHdhbGxfdmVydGljZXNbd3ZdWzFdO1xuICAgICAgICAgICAgICAgICAgICB2ZXJ0ZXhfdGVtcGxhdGVbMl0gPSB3YWxsX3ZlcnRpY2VzW3d2XVsyXTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAodGV4Y29vcmRfaW5kZXgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZlcnRleF90ZW1wbGF0ZVt0ZXhjb29yZF9pbmRleCArIDBdID0gdGV4Y29vcmRzW3d2XVswXSAqIHRleGNvb3JkX25vcm1hbGl6ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZlcnRleF90ZW1wbGF0ZVt0ZXhjb29yZF9pbmRleCArIDFdID0gdGV4Y29vcmRzW3d2XVsxXSAqIHRleGNvb3JkX25vcm1hbGl6ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIHZlcnRleF9kYXRhLmFkZFZlcnRleCh2ZXJ0ZXhfdGVtcGxhdGUpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZlcnRleF9lbGVtZW50cy5wdXNoKGVsZW1lbnRfb2Zmc2V0ICsgMCk7XG4gICAgICAgICAgICAgICAgdmVydGV4X2VsZW1lbnRzLnB1c2goZWxlbWVudF9vZmZzZXQgKyAxKTtcbiAgICAgICAgICAgICAgICB2ZXJ0ZXhfZWxlbWVudHMucHVzaChlbGVtZW50X29mZnNldCArIDIpO1xuICAgICAgICAgICAgICAgIHZlcnRleF9lbGVtZW50cy5wdXNoKGVsZW1lbnRfb2Zmc2V0ICsgMik7XG4gICAgICAgICAgICAgICAgdmVydGV4X2VsZW1lbnRzLnB1c2goZWxlbWVudF9vZmZzZXQgKyAzKTtcbiAgICAgICAgICAgICAgICB2ZXJ0ZXhfZWxlbWVudHMucHVzaChlbG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cnIsIGNvb3JkTmV4dCwgdGlsZV9lZGdlX3RvbGVyYW5jZSkpIHtcbiAgICAgICAgICAgIGFkZFZlcnRleChjb29yZEN1cnIsIG5vcm1OZXh0LCBbMSwgdl0sIGNvbnRleHQpO1xuICAgICAgICAgICAgYWRkVmVydGV4KGNvb3JkQ3VyciwgVmVjdG9yLm5lZyhub3JtTmV4dCksIFswLCB2XSwgY29udGV4dCk7XG4gICAgICAgICAgICBpbmRleFBhaXJzKDEsIGNvbnRleHQpO1xuXG4gICAgICAgICAgICB2YXIgbm9uQm91bmRhcnlMaW5lcyA9IGdldE5leHROb25Cb3VuZGFyeVNlZ21lbnQobGluZSwgY3VyckluZGV4ICsgMSwgdGlsZV9lZGdlX3RvbGVyYW5jZSk7XG4gICAgICAgICAgICBpZiAobm9uQm91bmRhcnlMaW5lcykge1xuICAgICAgICAgICAgICAgIGV4dHJhX2xpbmVzLnB1c2gobm9uQm91bmRhcnlMaW5lcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBub3JtUHJldiA9IG5vcm1OZXh0O1xuICAgICAgICBub3JtTmV4dCA9IFZlY3Rvci5ub3JtYWxpemUoVmVjdG9yLnBlcnAoY29vcmRDdXJyLCBjb29yZE5leHQpKTtcblxuICAgICAgICAvLyBBZGQgam9pblxuICAgICAgICBpZiAoam9pbl90eXBlID09PSBKT0lOX1RZUEUubWl0ZXIpIHtcbiAgICAgICAgICAgIGFkZE1pdGVyKHYsIGNvb3JkQ3Vyciwgbm9ybVByZXYsIG5vcm1OZXh0LCBtaXRlcl9sZW5fc3EsIGZhbHNlLCBjb250ZXh0KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGFkZEpvaW4oam9pbl90eXBlLCB2LCBjb29yZEN1cnIsIG5vcm1QcmV2LCBub3JtTmV4dCwgZmFsc2UsIGNvbnRleHQpO1xuICAgICAgICB9XG5cbiAgICAgICAgdiAr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zAsIHZdLCBjb250ZXh0KTtcblxuICAgICAgICBpZiAoIWlzQmVnaW5uaW5nKSB7XG4gICAgICAgICAgICBpbmRleFBhaXJzKDEsIGNvbnRleHQpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGpvaW5fdHlwZSA9PT0gSk9JTl9UWVBFLmJldmVsKSB7XG4gICAgICAgICAgICBhZGRCZXZlbChjb29yZEN1cnIsXG4gICAgICAgICAgICAgICAgVmVjdG9yLm5lZyhub3JtUHJldiksIG1pdGVyVmVjLCBWZWN0b3IubmVnKG5vcm1OZXh0KSxcbiAgICAgICAgICAgICAgICBbMCwgdl0sIFsxLCB2XSwgWzAsIHZdLFxuICAgICAgICAgICAgICAgIGNvbnRleHRcbiAgICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoam9pbl90eXBlID09PSBKT0lOX1RZUEUucm91bmQpIHtcbiAgICAgICAgICAgIGFkZEZhbihjb29yZEN1cnIsXG4gICAgICAgICAgICAgICAgVmVjdG9yLm5lZyhub3JtUHJldiksIG1pdGVyVmVjLCBWZWN0b3IubmVnKG5vcm1OZXh0KSxcbiAgICAgICAgICAgICAgICBbMCwgdl0sIFsxLCB2XSwgWzAsIHZdLFxuICAgICAgICAgICAgICAgIGZhbHNlLCBjb250ZXh0XG4gICAgICAgICAgICApO1xuICAgICAgICB9XG5cbiAgICAgICAgYWRkVmVydGV4KGNvb3JkQ3VyciwgbWl0ZXJWZWMsIFsxLCB2XSwgY29udGV4dCk7XG4gICAgICAgIGFkZFZlcnRleChjb29yZEN1cnIsIFZlY3Rvci5uZWcobm9ybU5leHQpLCBbMCwgdl0sIGNvbnRleHQpO1xuICAgIH1cbiAgICBlbHNlIHtcbiAgICAgICAgYWRkVmVydGV4KGNvb3JkQ3Vyciwgbm9ybVByZXYsIFsxLCB2XSwgY29udGV4dCk7XG4gICAgICAgIGFkZFZlcnRleChjb29yZEN1cnIsIFZlY3Rvci5uZWcobWl0ZXJWZWMpLCBbMCwgdl0sIGNvbnRleHQpO1xuXG4gICAgICAgIGlmICghaXNCZWdpbm5pbmcpIHtcbiAgICAgICAgICAgIGluZGV4UGFpcnMoMSwgY29udGV4dCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoam9pbl90eXBlID09PSBKT0lOX1RZUEUuYmV2ZWwpIHtcbiAgICAgICAgICAgIGFkZEJldmVsKGNvb3JkQ3VycixcbiAgICAgICAgICAgICAgICBub3JtUHJldiwgVmVjdG9yLm5lZyhtaXRlclZlYyksIG5vcm1OZXh0LFxuICAgICAgICAgICAgICAgIFsxLCB2XSwgWzAsIHZdLCBbMSwgdl0sXG4gICAgICAgICAgICAgICAgY29udGV4dFxuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChqb2luX3R5cGUgPT09IEpPSU5fVFlQRS5yb3VuZCkge1xuICAgICAgICAgICAgYWRkRmFuKGNvb3JkQ3VycixcbiAgICAgICAgICAgICAgICBub3JtUHJldiwgVmVjdG9yLm5lZyhtaXRlclZlYyksIG5vcm1OZXh0LFxuICAgICAgICAgICAgICAgIFsxLCB2XSwgWzAsIHZdLCBbMSwgdl0sXG4gICAgICAgICAgICAgICAgZmFsc2UsIGNvbnRleHRcbiAgICAgICAgICAgICk7XG4gICAgICAgIH1cblxuICAgICAgICBhZGRWZXJ0ZXgoY29vcmRDdXJyLCBub3JtTmV4dCwgWzEsIHZdLCBjb250ZXh0KTtcbiAgICAgICAgYWRkVmVydGV4KGNvb3JkQ3VyciwgVmVjdG9yLm5lZyhtaXRlclZlYyksIFswLCB2XSwgY29udGV4dCk7XG4gICAgfVxufVxuXG4vLyBBZGQgaW5kaWNlcyB0byB2ZXJ0ZXhfZWxlbWVudHNcbmZ1bmN0aW9uIGluZGV4UGFpcnMobnVtX3BhaXJzLCBjb250ZXh0KXtcbiAgICB2YXIgdmVydGV4X2VsZW1lbnRzID0gY29udGV4dC52ZXJ0ZXhfZGF0YS52ZXJ0ZXhfZWxlbW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wgY29udGV4dCk7XG4gICAgICAgICAgICAgICAgYWRkVmVydGV4KGNvb3JkLCBWZWN0b3IuYWRkKG5lZ19ub3JtYWwsIHRhbmdlbnQpLCBbMCwgdl0sIGNvbnRleHQpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpbmRleFBhaXJzKDEsIGNvbnRleHQpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgQ0FQX1RZUEUucm91bmQ6XG4gICAgICAgICAgICB2YXIgbkEsIG5CLCB1dkEsIHV2QiwgdXZDO1xuICAgICAgICAgICAgaWYgKGlzQmVnaW5uaW5nKSB7XG4gICAgICAgICAgICAgICAgbkEgPSBub3JtYWw7XG4gICAgICAgICAgICAgICAgbkIgPSBuZWdfbm9ybWFsO1xuXG4gICAgICAgICAgICAgICAgaWYgKGNvbnRleHQudGV4Y29vcmRfaW5kZXggIT09IHVuZGVmaW5lZCl7XG4gICAgICAgICAgICAgICAgICAgIHYgKz0gMC41ICogY29udGV4dC50ZXhjb29yZF93aWR0aCAqIGNvbnRleHQudl9zY2FsZTtcbiAgICAgICAgICAgICAgICAgICAgdXZBID0gWzEsIHZdO1xuICAgICAgICAgICAgICAgICAgICB1dkIgPSBbMCwgdl07XG4gICAgICAgICAgICAgICAgICAgIHV2QyA9IFswLjUsIHZdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIG5BID0gbmVnX25vcm1hbDtcbiAgICAgICAgICAgICAgICBuQiA9IG5vcm1hbDtcblxuICAgICAgICAgICAgICAgIGlmIChjb250ZXh0LnRleGNvb3JkX2luZGV4ICE9PSB1bmRlZmluZWQpe1xuICAgICAgICAgICAgICAgICAgICB1dkEgPSBbMCwgdl07XG4gICAgICAgICAgICAgICAgICAgIHV2QiA9IFsxLCB2XTtcbiAgICAgICAgICAgICAgICAgICAgdXZDID0gWzAuNSwgdl07XG4gICAgICAgICAgICA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b2x5Z29uWzBdKVxuICAgIHZhciBudW1fY29vcmRzID0gcG9seWdvblswXS5sZW5ndGg7XG4gICAgZm9yICh2YXIgYz0wOyBjIDwgbnVtX2Nvb3JkczsgYysrKSB7XG4gICAgICAgIHZhciBjb29yZCA9IHBvbHlnb25bMF1bY107XG5cbiAgICAgICAgaWYgKGNvb3JkWzBdIDwgbWluX3gpIHtcbiAgICAgICAgICAgIG1pbl94ID0gY29vcmRbMF07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvb3JkWzFdIDwgbWluX3kpIHtcbiAgICAgICAgICAgIG1pbl95ID0gY29vcmRbMV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvb3JkWzBdID4gbWF4X3gpIHtcbiAgICAgICAgICAgIG1heF94ID0gY29vcmRbMF07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvb3JkWzFdID4gbWF4X3kpIHtcbiAgICAgICAgICAgIG1heF95ID0gY29vcmRbMV07XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gW21pbl94LCBtaW5feSwgbWF4X3gsIG1heF95XTtcbn07XG5cbi8vIENvbnZlcnQgZ2VvbWV0cnkgdHlwZSB0byBvbmUgb2Y6ICdwb2ludCcsICdsaW5lJywgJ3BvbHlnb24nXG5HZW8uZ2VvbWV0cnlUeXBlID0gZnVuY3Rpb24odHlwZSkge1xuICAgIGlmICh0eXBlID09PSAnUG9seWdvbicgfHwgdHlwZSA9PT0gJ011bHRpUG9seWdvbicpIHtcbiAgICAgICAgcmV0dXJuICdwb2x5Z29uJztcbiAgICB9XG4gICAgZWxzZSBpZiAodHlwZSA9PT0gJ0xpbmVTdHJpbmcnIHx8IHR5cGUgPT09ICdNdWx0aUxpbmVTdHJpbmcnKSB7XG4gICAgICAgIHJldHVybiAnbGluZSc7XG4gICAgfVxuICAgIGlmICh0eXBlID09PSAnUG9pbnQnIHx8IHR5cGUgPT09ICdNdWx0aVBvaW50Jykge1xuICAgICAgICByZXR1cm4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VtZXMgcmluZyB3aW5kaW5nIG9yZGVycyBhbHJlYWR5IGFsdGVybmF0ZSBhcyBleHBlY3RlZFxuICAgICAgICBpZiAoR2VvLnJpbmdXaW5kaW5nKHBvbHlbMF0pICE9PSB3aW5kaW5nKSB7XG4gICAgICAgICAgICBmb3IgKGxldCByaW5nIG9mIHBvbHkpIHtcbiAgICAgICAgICAgICAgICByaW5nLnJldmVyc2UoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gZ2VvbTtcbn07XG4iLCIvLyBXZWJHTCBjb25zdGFudHMgLSBuZWVkIHRvIGltcG9ydCB0aGVzZSBzZXBhcmF0ZWx5IHRvIG1ha2UgdGhlbSBhdmFpbGFibGUgaW4gdGhlIHdlYiB3b3JrZXJcblxudmFyIGdsO1xuZXhwb3J0IGRlZmF1bHQgZ2wgPSB7fTtcblxuLyogRGF0YVR5cGUgKi9cbmdsLkJZVEUgICAgICAgICAgICAgICAgICAgICAgICAgICA9IDB4MTQwMDtcbmdsLlVOU0lHTkVEX0JZVEUgICAgICAgICAgICAgICAgICA9IDB4MTQwMTtcbmdsLlNIT1JUICAgICAgICAgICAgICAgICAgICAgICAgICA9IDB4MTQwMjtcbmdsLlVOU0lHTkVEX1NIT1JUICAgICAgICAgICAgICAgICA9IDB4MTQwMztcbmdsLklOVCAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IDB4MTQwNDtcbmdsLlVOU0lHTkVEX0lOVCAgICAgICAgICAgICAgICAgICA9IDB4MTQwNTtcbmdsLkZMT0FUICAgICAgICAgICAgICAgICAgICAgICAgICA9IDB4MTQwNjtcbiIsIi8vIFdlYkdMIGNvbnRleHQgd3JhcHBlclxuXG52YXIgQ29udGV4dDtcbmV4cG9ydCBkZWZhdWx0IENvbnRleHQgPSB7fTtcblxuLy8gU2V0dXAgYSBXZWJHTCBjb250ZXh0XG4vLyBJZiBubyBjYW52YXMgZWxlbWVudCBpcyBwcm92aWRlZCwgb25lI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4gICAgICAgIHZhciB1O1xuXG4gICAgICAgIC8vIFNpbmdsZSBmbG9hdFxuICAgICAgICBpZiAodHlwZW9mIHVuaWZvcm0gPT09ICdudW1iZXInKSB7XG4gICAgICAgICAgICBwYXJzZWQucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogJ2Zsb2F0JyxcbiAgICAgICAgICAgICAgICBtZXRob2Q6ICcxZicsXG4gICAgICAgICAgICAgICAgbmFtZSxcbiAgICAgICAgICAgICAgICB2YWx1ZTogdW5pZm9ybSxcbiAgICAgICAgICAgICAgICBrZXksXG4gICAgICAgICAgICAgICAgdW5pZm9ybXNcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIC8vIEFycmF5OiB2ZWN0b3IsIGFycmF5IG9mIGZsb2F0cywgYXJyYXkgb2YgdGV4dHVyZXNcbiAgICAgICAgZWxzZSBpZiAoQXJyYXkuaXNBcnJheSh1bmlmb3JtKSkge1xuICAgICAgICAgICAgLy8gTnVtZXJpYyB2YWx1ZXNcbiAgICAgICAgICAgIGlmICh0eXBlb2YgdW5pZm9ybVswXSA9PT0gJ251bWJlcicpIHtcbiAgICAgICAgICAgICAgICAvLyBmbG9hdCB2ZWN0b3JzICh2ZWMyLCB2ZWMzLCB2ZWM0KVxuICAgICAgICAgICAgICAgIGlmICh1bmlmb3JtLmxlbmd0aCA+PSAyICYmIHVuaWZvcm0ubGVuZ3RoIDw9IDQpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyc2VkLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ3ZlYycgKyB1bmlmb3JtLmxlbmd0aCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogdW5pZm9ybS5sZW5ndGggKyAnZnYnLFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB1bmlmb3JtLFxuICAgICAgICAgICAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICAgICAgICAgICAgdW5pZm9ybXNcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGZsb2F0IGFycmF5XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAodW5pZm9ybS5sZW5ndGggPiA0KSB7XG4gICAgICAgICAgICAgICAgICAgIHBhcnNlZC5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdmbG9hdFtdJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJzFmdicsXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBuYW1lICsgJ1swXScsXG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdW5pZm9ybSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVuaWZvcm1zXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBUT0RPOiBhc3N1bWUgbWF0cml4IGZvciAodHlwZW9mID09IEZsb2F0MzJBcnJheSAmJiBsZW5ndGggPT0gMTYpP1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gQXJyYXkgb2YgdGV4dHVyZXNcbiAgICAgICAgICAgIGVsc2UgaWYgKHR5cGVvZiB1bmlmb3JtWzBdID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGZvciAodT0wOyB1IDwgdW5pZm9ybS5sZW5ndGg7IHUrKykge1xuICAgICAgICAgICAgICAgICAgICBwYXJzZWQucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAnc2FtcGxlcjJEJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJzFpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IG5hbWUgKyAnWycgKyB1ICsgJ10nLFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHVuaWZvcm1bdV0sXG4gICAgICAgICAgICAgICAgICAgICAgICBrZXk6IHUsXG4gICAgICAgICAgICAgICAgICAgICAgICB1bmlmb3JtczogdW5pZm9ybVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBBcnJheSBvZiBhcnJheXMgLSBidXQgb25seSBhcnJheXMgb2YgdmVjdG9ycyBhcmUgYWxsb3dlZCBpbiB0aGlzIGNhc2VcbiAgICAgICAgICAgIGVsc2UgaWYgKEFycmF5LmlzQXJyYXkodW5pZm9ybVswXSkgJiYgdHlwZW9mIHVuaWZvcm1bMF1bMF0gPT09ICdudW1iZXInKSB7XG4gICAgICAgICAgICAgICAgLy8gZmxvYXQgdmVjdG9ycyAodmVjMiwgdmVjMywgdmVjNClcbiAgICAgICAgICAgICAgICBpZiAodW5pZm9ybVswXS5sZW5ndGggPj0gMiAmJiB1bmlmb3JtWzBdLmxlbmd0aCA8PSA0KSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIFNldCBlYWNoIHZlY3RvciBpbiB0aGUgYXJyYXlcbiAgICAgICAgICAgICAgICAgICAgZm9yICh1PTA7IHUgPCB1bmlmb3JtLmxlbmd0aDsgdSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZWQucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ3ZlYycgKyB1bmlmb3JtWzBdLmxlbmd0aCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6IHVuaWZvcm1bdV0ubGVuZ3RoICsgJ2Z2JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBuYW1lICsgJ1snICsgdSArICddJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdW5pZm9ybVt1XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IHUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pZm9ybXM6IHVuaWZvcm1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gVE9ETzogZWxzZSB3YXJuaW5nXG4gICAgICAgIH1cbiAgICAgICAgLy8gQm9vbGVhblxuICAgICAgICBlbHNlIGlmICh0eXBlb2YgdW5pZm9ybSA9PT0gJ2Jvb2xlYW4nKSB7XG4gICAgICAgICAgICBwYXJzZWQucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogJ2Jvb2wnLFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJzFpJyxcbiAgICAgICAgICAgICAgICBuYW1lLFxuICAgICAgICAgICAgICAgIHZhbHVlOiB1bmlmb3JtLFxuICAgICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgICB1bmlmb3Jtc1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gVGV4dHVyZVxuICAgICAgICBlbHNlIGlmICh0eXBlb2YgdW5pZm9ybSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIHBhcnNlZC5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiAnc2FtcGxlcjJEJyxcbiAgICAgICAgICAgICAgICBtZXRob2Q6ICcxaScsXG4gICAgICAgICAgICAgICAgbmFtZSxcbiAgICAgICAgICAgICAgICB2YWx1ZTogdW5pZm9ybSxcbiAgICAgICAgICAgICAgICBrZXksXG4gICAgICAgICAgICAgICAgdW5pZm9ybXNcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIHBhcnNlZDtcbn07XG5cbi8qKlxuICAgIEdlbmVyYXRlIGEgR0xTTCB2YXJpYWJsZSBkZWZpbml0aW9uIGZyb20gYSBKUyBvYmplY3Rcb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GZpbmQgY29kZSByZXBsYWNlIHBvaW50cyBpbiBzaGFkZXJzXG4gICAgICAgICAgICByZWdleHAgPSBuZXcgUmVnRXhwKCdeXFxcXHMqI3ByYWdtYVxcXFxzK3RhbmdyYW06XFxcXHMrJyArIGtleSArICdcXFxccyokJywgJ20nKTtcbiAgICAgICAgICAgIHZhciBpbmplY3RfdmVydGV4ID0gdGhpcy5jb21wdXRlZF92ZXJ0ZXhfc291cmNlLm1hdGNoKHJlZ2V4cCk7XG4gICAgICAgICAgICB2YXIgaW5qZWN0X2ZyYWdtZW50ID0gdGhpcy5jb21wdXRlZF9mcmFnbWVudF9zb3VyY2UubWF0Y2gocmVnZXhwKTtcblxuICAgICAgICAgICAgLy8gQXZvaWQgbmV0d29yayByZXF1ZXN0IGlmIG5vdGhpbmcgdG8gcmVwbGFjZVxuICAgICAgICAgICAgaWYgKGluamVjdF92ZXJ0ZXggPT0gbnVsbCAmJiBpbmplY3RfZnJhZ21lbnQgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBDb21iaW5lIGFsbCBibG9ja3MgaW50byBvbmUgc3RyaW5nXG4gICAgICAgICAgICB2YXIgc291cmNlID0gJyc7XG4gICAgICAgICAgICBibG9jay5mb3JFYWNoKHZhbCA9PiB7XG4gICAgICAgICAgICAgICAgLy8gTWFyayBzdGFydCBhbmQgZW5kIG9mIGVhY2ggYmxvY2sgd2l0aCBtZXRhZGF0YSAod2hpY2ggY2FuIGJlIGV4dHJhY3RlZCBmcm9tXG4gICAgICAgICAgICAgICAgLy8gZmluYWwgc291cmNlIGZvciBlcnJvciBoYW5kbGluZywgZGVidWdnaW5nLCBldGMuKVxuICAgICAgICAgICAgICAgIGxldCBtYXJrID0gYCR7dmFsLnNjb3BlfSwgJHt2YWwua2V5fSwgJHt2YWwubnVtfWA7XG4gICAgICAgICAgICAgICAgc291cmNlICs9IGBcXG4vLyB0YW5ncm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FkZXIgZXJyb3IgaW5mb1xuICAgICAgICAgICAgaWYgKGVycm9yLnR5cGUgPT09ICd2ZXJ0ZXgnIHx8IGVycm9yLnR5cGUgPT09ICdmcmFnbWVudCcpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnNoYWRlcl9lcnJvcnMgPSBlcnJvci5lcnJvcnM7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgZSBvZiB0aGlzLnNoYWRlcl9lcnJvcnMpIHtcbiAgICAgICAgICAgICAgICAgICAgZS50eXBlID0gZXJyb3IudHlwZTtcbiAgICAgICAgICAgICAgICAgICAgZS5ibG9jayA9IHRoaXMuYmxvY2soZXJyb3IudHlwZSwgZS5saW5lKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRocm93KG5ldyBFcnJvcihgU2hhZGVyUHJvZ3JhbS5jb21waWxlKCk6IHByb2dyYW0gJHt0aGlzLmlkfSAoJHt0aGlzLm5hbWV9KSBlcnJvcjpgLCBlcnJvcikpO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy51c2UoKTtcbiAgICAgICAgdGhpcy5yZWZyZXNoVW5pZm9ybXMoKTtcbiAgICAgICAgdGhpcy5yZWZyZXNoQXR0cmlidXRlcygpO1xuICAgIH1cblxuICAgIC8vIE1ha2UgbGlzdCBvZiBkZWZpbmVzIChnbG9iYWwsIHRoZW4gcHJvZ3JhbS1zcGVjaWZpYylcbiAgICBidWlsZERlZmluZUxpc3QoKSB7XG4gICAgICAgIHZhciBkLCBkZWZpbmVzID0ge307XG4gICAgICAgIGZvciAoZCBpbiBTaGFkZXJQcm9ncmFtLmRlZmluZXMpIHtcbiAgICAgICAgICAgIGRlZmluZXNbZF0gPSBTaGFkZXJQcm9ncmFtLmRlZmluZXNbZF07XG4gICAgICAgIH1cbiAgICAgICAgZm9yIChkIGluIHRoaXMuZGVmaW5lcykge1xuICAgICAgICAgICAgZGVmaW5lc1tkXSA9IHRoaXMuZGVmaW5lc1tkXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZGVmaW5lcztcbiAgICB9XG5cbiAgICAvLyBNYWtlIGxpc3Qgb2Ygc2hhZGVyIGJsb2NrcyAoZ2xvYmFsLCB0aGVuIHByb2dyYW0tc3BlY2lmaWMpXG4gICAgYnVpbGRTaGFkZXJCbG9ja0xpc3QoKSB7XG4gICAgICAgIGxldCBrZXksIGJsb2NrcyA9IHt9O1xuXG4gICAgICAgIC8vIEdsb2JhbCBibG9ja3NcbiAgICAgICAgZm9yIChrZXkgaW4gU2hhZGVyUHJvZ3JhbS5ibG9ja3MpIHtcbiAgICAgICAgICAgIGJsb2Nrc1trZXldID0gW107XG5cbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KFNoYWRlclByb2dyYW0uYmxvY2tzW2tleV0pKSB7XG4gICAgICAgICAgICAgICAgYmxvY2tzW2tleV0ucHVzaChcbiAgICAgICAgICAgICAgICAgICAgLi4uU2hhZGVyUHJvZ3JhbS5ibG9ja3Nba2V5XS5tYXAoKHNvdXJjZSwgbnVtKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geyBrZXksIHNvdXJjZSwgbnVtLCBzY29wZTogJ1NoYWRlclByb2dyYW0nIH07XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGJsb2Nrc1trZXldID0gW3sga2V5LCBzb3VyY2U6IFNoYWRlclByb2dyYW0uYmxvY2tzW2tleV0sIG51bTogMCwgc2NvcGU6ICdTaGFkZXJQcm9ncmFtJyB9XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFByb2dyYW0tc3BlY2lmaWMgYmxvY2tzXG4gICAgICAgIGZvciAoa2V5IGluIHRoaXMuYmxvY2tzKSB7XG4gICAgICAgICAgICBibG9ja3Nba2V5XSA9IGJsb2Nrc1trZXldIHx8IFtdO1xuXG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheSh0aGlzLmJsb2Nrc1trZXldKSkge1xuICAgICAgICAgICAgICAgIGxldCBzY29wZXMgPSAodGhpcy5ibG9ja19zY29wZXMgJiYgdGhpcy5ibG9ja19zY29wZXNba2V5XSkgfHwgW107XG4gICAgICAgICAgICAgICAgbGV0IGN1cl9zY29wZSA9IG51bGwsIG51bSA9IDA7XG5cbiAgICAgICAgICAgICAgICBmb3IgKGxldCBiPTA7IGIgPCB0aGlzLmJsb2Nrc1trZXldLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIENvdW50IGJsb2NrcyByZWxhdGl2ZSB0byBjdXJyZW50IHNjb3BlXG4gICAgICAgICAgICAgICAgICAgIGlmIChzY29wZXNbYl0gIT09IGN1cl9zY29wZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY3VyX3Njb3BlID0gc2NvcGVzW2JdO1xuICAgICAgICAgICAgICAgICAgICAgICAgbnVtID0gMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGJsb2Nrc1trZXldLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlOiB0aGlzLmJsb2Nrc1trZXldW2JdLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVtLFxuICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGU6IGN1cl9zY29wZSB8fCB0aGlzLm5hbWVcbiAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgbnVtKys7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gVE9ETzogYWRkcmVzcyBkaXNjcmVwYW5jeSBpbiBhcnJheSB2cy4gc2luZ2xlLXZhbHVlIGJsb2Nrc1xuICAgICAgICAgICAgICAgIC8vIHN0eWxlcyBhc3N1bWUgYXJyYXkgd2hlbiB0cmFja2luZyBibG9jayBzY29wZXNcbiAgICAgICAgICAgICAgICBibG9ja3Nba2V5XS5wdXNoKHsga2V5LCBzb3VyY2U6IHRoaXMuYmxvY2tzW2tleV0sIG51bTogMCwgc2NvcGU6IHRoaXMubmFtZSB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gYmxvY2tzO1xuICAgIH1cblxuICAgIC8vIERldGVjdCB1bmlmb3JtIGRlZmluaXRpb25zLCBpbmplY3QgYW55IG1pc3Npbmcgb25lc1xuICAgIGVuc3VyZVVuaWZvcm1zKHVuaWZvcm1zKSB7XG4gICAgICAgIGlmICghdW5pZm9ybXMpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciB2cyA9IHN0cmlwKHRoaXMuY29tcHV0ZWRfdmVydGV4X3NvdXJjZSk7XG4gICAgICAgIHZhciBmcyA9IHN0cmlwKHRoaXMuY29tcHV0ZWRfZnJhZ21lbnRfc291cmNlKTtcbiAgICAgICAgdmFyIGluamVjdCwgdnNfaW5qZWN0aW9ucyA9IFtdLCBmc19pbmplY3Rpb25zID0gW107XG5cbiAgICAgICAgLy8gQ2hlY2sgZm9yIG1pc3NpbmcgdW5pZm9ybSBkZWZpbml0aW9uc1xuICAgICAgICBmb3IgKHZhciBuYW1lIGluIHVuaWZvcm1zKSB7XG4gICAgICAgICAgICBpbmplY3QgPSBudWxsO1xuXG4gICAgICAgICAgICAvLyBDaGVjayB2ZXJ0ZXggc2hhZGVyXG4gICAgICAgICAgICBpZiAoIUdMU0wuaXNVbmlmb3JtRGVmaW5lZChuYW1lLCB2cykpIHtcbiAgICAgICAgICAgICAgICBpZiAoIWluamVjdCkge1xuICAgICAgICAgICAgICAgICAgICBpbmplY3QgPSBHTFNMLmRlZmluZVVuaWZvcm0obmFtZSwgdW5pZm9ybXNbbmFtZV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBsb2coJ3RyYWNlJywgYFByb2dyYW0gJHt0aGlzLm5hbWV9OiAke25hbWV9IG5vdCBkZWZpbmVkIGluIHZlcnRleCBzaGFkZXIsIGluamVjdGluZzogJyR7aW5qZWN0fSdgKTtcbiAgICAgICAgICAgICAgICB2c19pbmplY3Rpb25zLnB1c2goaW5qZWN0KTtcblxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gQ2hlY2sgZnJhZ21lbnQgc2hhZGVyXG4gICAgICAgICAgICBpZiAoIUdMU0wuaXNVbmlmb3JtRGVmaW5lZChuYW1lLCBmcykpIHtcbiAgICAgICAgICAgICAgICBpZiAoIWluamVjdCkge1xuICAgICAgICAgICAgICAgICAgICBpbmplY3QgPSBHTFNMLmRlZmluZVVuaWZvcm0obmFtZSwgdW5pZm9ybXNbbmFtZV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBsb2coJ3RyYWNlJywgYFByb2dyYW0gJHt0aGlzLm5hbWV9OiAke25hbWV9IG5vdCBkZWZpbmVkIGluIGZyYWdtZW50IHNoYWRlciwgaW5qZWN0aW5nOiAnJHtpbmplY3R9J2ApO1xuICAgICAgICAgICAgICAgIGZzX2luamVjdGlvbnMucHVzaChpbmplY3QpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gSW5qZWN0IG1pc3NpbmcgdW5pZm9ybXNcbiAgICAgICAgLy8gTk9URTogdGhlc2UgYXJlIGluamVjdGVkIGF0IHRoZSB2ZXJ5IHRvcCBvZiB0aGUgc2hhZGVycywgZXZlbiBiZWZvcmUgYW55ICNkZWZpbmVzIG9yICNwcmFnbWFzIGFyZSBhZGRlZFxuICAgICAgICAvLyB0aGlzIGNvdWxkIGNhdXNlIHNvbWUgaXNzdWVzIHdpdGggY2VydGFpbiAjcHJhZ21hcywgb3Igb3RoZXIgZnVuY3Rpb25zIH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xuICAgICAgICAgICAgICAgIHRoaXMuZ2wudW5pZm9ybTFpKGxvY2F0aW9uLCB2YWx1ZSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICcxZic6XG4gICAgICAgICAgICAgICAgdGhpcy5nbC51bmlmb3JtMWYobG9jYXRpb24sIHZhbHVlKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJzJmJzpcbiAgICAgICAgICAgICAgICB0aGlzLmdsLnVuaWZvcm0yZihsb2NhdGlvbiwgdmFsdWVbMF0sIHZhbHVlWzFdKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJzNmJzpcbiAgICAgICAgICAgICAgICB0aGlzLmdsLnVuaWZvcm0zZihsb2NhdGlvbiwgdmFsdWVbMF0sIHZhbHVlWzFdLCB2YWx1ZVsyXSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICc0Zic6XG4gICAgICAgICAgICAgICAgdGhpcy5nbC51bmlmb3JtNGYobG9jYXRpb24sIHZhbHVlWzBdLCB2YWx1ZVsxXSwgdmFsdWVbMl0sIHZhbHVlWzNdKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJzFpdic6XG4gICAgICAgICAgICAgICAgdGhpcy5nbC51bmlmb3JtMWl2KGxvY2F0aW9uLCB2YWx1ZSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICczaXYnOlxuICAgICAgICAgICAgICAgIHRoaXMuZ2wudW5pZm9ybTNpdihsb2NhdGlvbiwgdmFsdWUpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnMWZ2JzpcbiAgICAgICAgICAgICAgICB0aGlzLmdsLnVuaWZvcm0xZnYobG9jYXRpb24sIHZhbHVlKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJzJmdic6XG4gICAgICAgICAgICAgICAgdGhpcy5nbC51bmlmb3JtMmZ2KGxvY2F0aW9uLCB2YWx1ZSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICczZnYnOlxuICAgICAgICAgICAgICAgIHRoaXMuZ2wudW5pZm9ybTNmdihsb2NhdGlvbiwgdmFsdWUpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnNGZ2JzpcbiAgICAgICAgICAgICAgICB0aGlzLmdsLnVuaWZvcm00ZnYobG9jYXRpb24sIHZhbHVlKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ01hdHJpeDNmdic6XG4gICAgICAgICAgICAgICAgdGhpcy5nbC51bmlmb3JtTWF0cml4M2Z2KGxvY2F0aW9uLCBmYWxzZSwgdmFsdWUpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnTWF0cml4NGZ2JzpcbiAgICAgICAgICAgICAgICB0aGlzLmdsLnVuaWZvcm1NYXRyaXg0ZnYobG9jYXRpb24sIGZhbHNlLCB2YWx1ZSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBSZWZyZXNoIHVuaWZvcm0gbG9jYXRpb25zIGFuZCBzZXQgdG8gbGFzdCBjYWNoZWQgdmFsdWVzXG4gICAgcmVmcmVzaFVuaWZvcm1zKCkge1xuICAgICAgICBpZiAoIXRoaXMuY29tcGlsZWQpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAodmFyIHUgaW4gdGhpcy51bmlmb3Jtcykge1xuICAgICAgICAgICAgbGV0IHVuaWZvcm0gPSB0aGlzLnVuaWZvcm1zW3VdO1xuICAgICAgICAgICAgdW5pZm9ybS5sb2NhdGlvbiA9IHRoaXMuZ2w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GF0aW9uIGZhaWx1cmUsIGl0IHdhcyBzaW1wbGVyIHRvIGtlZXAgaXQgc2VwYXJhdGUgdGhhbiB0byBidXJkZW4gdGhlIGNvcmVcbiAgICAvLyBjb21waWxhdGlvbiBwYXRoLlxuICAgIGJsb2NrKHR5cGUsIG51bSkge1xuICAgICAgICBsZXQgbGluZXMgPSB0aGlzLmxpbmVzKHR5cGUpO1xuICAgICAgICBsZXQgYmxvY2s7XG4gICAgICAgIGZvciAobGV0IGk9MDsgaSA8IG51bSAmJiBpIDwgbGluZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBsaW5lID0gbGluZXNbaV07XG4gICAgICAgICAgICBsZXQgbWF0Y2ggPSBsaW5lLm1hdGNoKC9cXC9cXC8gdGFuZ3JhbS1ibG9jay1zdGFydDogKFtBLVphLXowLTlfLV0rKSwgKFtBLVphLXowLTlfLV0rKSwgKFxcZCspLyk7XG4gICAgICAgICAgICBpZiAobWF0Y2ggJiYgbWF0Y2gubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgICAgIC8vIG1hcmsgY3VycmVudCBibG9ja1xuICAgICAgICAgICAgICAgIGJsb2NrID0ge1xuICAgICAgICAgICAgICAgICAgICBzY29wZTogbWF0Y2hbMV0sXG4gICAgICAgICAgICAgICAgICAgIG5hbWU6IG1hdGNoWzJdLFxuICAgICAgICAgICAgICAgICAgICBudW06IG1hdGNoWzNdXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIG1hdGNoID0gbGluZS5tYXRjaCgvXFwvXFwvIHRhbmdyYW0tYmxvY2stZW5kOiAoW0EtWmEtejAtOV8tXSspLCAoW0EtWmEtejAtOV8tXSspLCAoXFxkKykvKTtcbiAgICAgICAgICAgICAgICBpZiAobWF0Y2ggJiYgbWF0Y2gubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgICAgICAgICBibG9jayA9IG51bGw7IC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AgICAgICAgbG9nKCd0cmFjZScsIGBjcmVhdGluZyBUZXh0dXJlICR7dGhpcy5uYW1lfWApO1xuICAgIH1cblxuICAgIC8vIERlc3Ryb3kgYSBzaW5nbGUgdGV4dHVyZSBpbnN0YW5jZVxuICAgIGRlc3Ryb3koeyBmb3JjZSB9ID0ge30pIHtcbiAgICAgICAgaWYgKHRoaXMucmV0YWluX2NvdW50ID4gMCAmJiAhZm9yY2UpIHtcbiAgICAgICAgICAgIGxvZygnZXJyb3InLCBgVGV4dHVyZSAnJHt0aGlzLm5hbWV9JzogZGVzdHJveWluZyB0ZXh0dXJlIHdpdGggcmV0YWluIGNvdW50IG9mICcke3RoaXMucmV0YWluX2NvdW50fSdgKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghdGhpcy52YWxpZCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuZ2wuZGVsZXRlVGV4dHVyZSh0aGlzLnRleHR1cmUpO1xuICAgICAgICB0aGlzLnRleHR1cmUgPSBudWxsO1xuICAgICAgICBkZWxldGUgdGhpcy5kYXRhO1xuICAgICAgICB0aGlzLmRhdGEgPSBudWxsO1xuICAgICAgICBkZWxldGUgVGV4dHVyZS50ZXh0dXJlc1t0aGlzLm5hbWVdO1xuICAgICAgICB0aGlzLnZhbGlkID0gZmFsc2U7XG4gICAgICAgIGxvZygndHJhY2UnLCBgZGVzdHJveWluZyBUZXh0dXJlICR7dGhpcy5uYW1lfWApO1xuICAgIH1cblxuICAgIHJldGFpbiAoKSB7XG4gICAgICAgIHRoaXMucmV0YWluX2NvdW50Kys7XG4gICAgfVxuXG4gICAgcmVsZWFzZSAoKSB7XG4gICAgICAgIGlmICh0aGlzLnJldGFpbl9jb3VudCA8PSAwKSB7XG4gICAgICAgICAgICBsb2coJ2Vycm9yJywgYFRleHR1cmUgJyR7dGhpcy5uYW1lfSc6IHJlbGVhc2luZyB0ZXh0dXJlIHdpdGggcmV0YWluIGNvdW50IG9mICcke3RoaXMucmV0YWluX2NvdW50fSdgKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMucmV0YWluX2NvdW50LS07XG4gICAgICAgIGlmICh0aGlzLnJldGFpbl9jb3VudCA8PSAwKSB7XG4gICAgICAgICAgICB0aGlzLmRlc3Ryb3koKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGJpbmQodW5pdCA9IDApIHtcbiAgICAgICAgaWYgKCF0aGlzLnZhbGlkKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoVGV4dHVyZS5hY3RpdmVVbml0ICE9PSB1bml0KSB7XG4gICAgICAgICAgICB0aGlzLmdsLmFjdGl2ZVRleHR1cmUodGhpcy5nbC5URVhUVVJFMCArIHVuaXQpO1xuICAgICAgICAgICAgVGV4dHVyZS5hY3RpdmVVbml0ID0gdW5pdDtcbiAgICAgICAgICAgIFRleHR1cmUuYm91bmRUZXh0dXJlID0gbnVsbDsgLy8gdGV4dHVyZSBtdXN0IGJlIHJlLWJvdW5kIHdoZW4gdW5pdCBjaGFuZ2VzXG4gICAgICAgIH1cblxuICAgICAgICBpZiAoVGV4dHVyZS5ib3VuZFRleHR1cmUgIT09IHRoaXMudGV4dHVyZSkge1xuICAgICAgICAgICAgdGhpcy5nbC5iaW5kVGV4dHVyZSh0aGlzLmdsLlRFWFRVUkVfMkQsIHRoaXMudGV4dHVyZSk7XG4gICAgICAgICAgICBUZXh0dXJlLmJvdW5kVGV4dHVyZSA9IHRoaXMudGV4dHVyZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGxvYWQob3B0aW9ucykge1xuICAgICAgICBpZiAoIW9wdGlvbnMpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmxvYWRpbmcgfHwgUHJvbWlzZS5yZXNvbHZlKHRoaXMpO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5sb2FkaW5nID0gbnVsbDtcbiAgICAgICAgaWYgKHR5cGVvZiBvcHRpb25zLnVybCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIHRoaXMuY29uZmlnX3R5cGUgPSAndXJsJztcbiAgICAgICAgICAgIHRoaXMuc2V0VXJsKG9wdGlvbnMudXJsLCBvcHRpb25zKTtcbiAgICAgICAgfSBlbHNlIGlmIChvcHRpb25zLmVsZW1lbnQpIHtcbiAgICAgICAgICAgIHRoaXMuY29uZmlnX3R5cGUgPSAnZWxlbWVudCc7XG4gICAgICAgICAgICB0aGlzLnNldEVsZW1lbnQob3B0aW9ucy5lbGVtZW50LCBvcHRpb25zKTtcbiAgICAgICAgfSBlbHNlIGlmIChvcHRpb25zLmRhdGEgJiYgb3B0aW9ucy53aWR0aCAmJiBvcHRpb25zLmhlaWdodCkge1xuICAgICAgICAgICAgdGhpcy5jb25maWdfdHlwZSA9ICdkYXRhJztcbiAgICAgICAgICAgIHRoaXMuc2V0RGF0YShvcHRpb25zLndpZHRoLCBvcHRpb25zLmhlaWdodCwgb3B0aW9ucy5kYXRhLCBvcHRpb25zKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMubG9hZGluZyA9XG4gICAgICAgICAgICAodGhpcy5sb2FkaW5nICYmIHRoaXMubG9hZGluZy50aGVuKCgpID0+IHsgdGhpcy5jYWxjdWxhdGVTcHJpdGVzKCk7IHJldHVybiB0aGlzOyB9KSkgfHxcbiAgICAgICAgICAgIFByb21pc2UucmVzb2x2ZSh0aGlzKTtcbiAgICAgICAgcmV0dXJuIHRoaXMubG9hZGluZztcbiAgICB9XG5cbiAgICAvLyBTZXRzIHRleHR1cmUgZnJvbSBhbiB1cmxcbiAgICBzZXRVcmwodXJsLCBvcHRpb25zID0ge30pIHtcbiAgICAgICAgaWYgKCF0aGlzLnZhbGlkKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoVGV4dHVyZS5iYXNlX3VybCkge1xuICAgICAgICAgIC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gICAgICAgICAgcmVzb2x2ZSh0aGlzKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpbWFnZS5vbmVycm9yID0gZSA9PiB7XG4gICAgICAgICAgICAgICAgLy8gV2FybiBhbmQgcmVzb2x2ZSBvbiBlcnJvclxuICAgICAgICAgICAgICAgIHRoaXMubG9hZGVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgbG9nKCd3YXJuJywgYFRleHR1cmUgJyR7dGhpcy5uYW1lfSc6IGZhaWxlZCB0byBsb2FkIHVybDogJyR7dGhpcy5zb3VyY2V9J2AsIGUsIG9wdGlvbnMpO1xuICAgICAgICAgICAgICAgIFRleHR1cmUudHJpZ2dlcignd2FybmluZycsIHsgbWVzc2FnZTogYEZhaWxlZCB0byBsb2FkIHRleHR1cmUgZnJvbSAke3RoaXMuc291cmNlfWAsIGVycm9yOiBlLCB0ZXh0dXJlOiBvcHRpb25zIH0pO1xuICAgICAgICAgICAgICAgIHJlc29sdmUodGhpcyk7XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAvLyBTYWZhcmkgaGFzIGEgYnVnIGxvYWRpbmcgZGF0YS1VUkwgaW1hZ2VzIHdpdGggQ09SUyBlbmFibGVkLCBzbyBpdCBtdXN0IGJlIGRpc2FibGVkIGluIHRoYXQgY2FzZVxuICAgICAgICAgICAgLy8gaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTEyMzk3OFxuICAgICAgICAgICAgaWYgKCEoVXRpbHMuaXNTYWZhcmkoKSAmJiB0aGlzLnNvdXJjZS5zbGljZSgwLCA1KSA9PT0gJ2RhdGE6JykpIHtcbiAgICAgICAgICAgICAgICBpbWFnZS5jcm9zc09yaWdpbiA9ICdhbm9ueW1vdXMnO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpbWFnZS5zcmMgPSB0aGlzLnNvdXJjZTtcbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB0aGlzLmxvYW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rZWVwID0gc3RhdGUua2VlcDtcblxuICAgICAgICBSZXBlYXRHcm91cC5jbGVhcih0aWxlKTtcblxuICAgICAgICAvLyBQcm9jZXNzIGxhYmVscyBieSBwcmlvcml0eSwgdGhlbiBieSBzdHlsZVxuICAgICAgICBsZXQgcHJpb3JpdGllcyA9IE9iamVjdC5rZXlzKHN0YXRlLm9iamVjdHMpLnNvcnQoKGEsIGIpID0+IGEgLSBiKTtcbiAgICAgICAgZm9yIChsZXQgcHJpb3JpdHkgb2YgcHJpb3JpdGllcykge1xuICAgICAgICAgICAgbGV0IHN0eWxlX29iamVjdHMgPSBzdGF0ZS5vYmplY3RzW3ByaW9yaXR5XTtcbiAgICAgICAgICAgIGlmICghc3R5bGVfb2JqZWN0cykgeyAvLyBubyBsYWJlbHMgYXQgdGhpcyBwcmlvcml0eSwgc2tpcCB0byBuZXh0XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIEZvciBlYWNoIHN0eWxlXG4gICAgICAgICAgICBmb3IgKGxldCBzdHlsZSBpbiBzdHlsZV9vYmplY3RzKSB7XG4gICAgICAgICAgICAgICAgbGV0IG9iamVjdHMgPSBzdHlsZV9vYmplY3RzW3N0eWxlXTtcbiAgICAgICAgICAgICAgICBrZWVwW3N0eWxlXSA9IGtlZXBbc3R5bGVdIHx8IFtdO1xuXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBvYmplY3RzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBvYmplY3QgPSBvYmplY3RzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5jYW5CZVBsYWNlZChvYmplY3QsIHRpbGUsIG9iamVjdC5saW5rZWQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBLZWVwIG9iamVjdCBpZiBpdCBpc24ndCBkZXBlbmRlbnQgb24gYSBwYXJlbnQgb2JqZWN0XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW9iamVjdC5saW5rZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZWVwW3N0eWxlXS5wdXNoKG9iamVjdCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wbGFjZShvYmplY3QsIHRpbGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgb2JqZWN0IGlzIGRlcGVuZGVudCBvbiBhIHBhcmVudCwgb25seSBrZWVwIGlmIGJvdGggY2FuIGJlIHBsYWNlZFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAodGhpcy5jYW5CZVBsYWNlZChvYmplY3QubGlua2VkLCB0aWxlLCBvYmplY3QpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAga2VlcFtzdHlsZV0ucHVzaChvYmplY3QpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGxhY2Uob2JqZWN0LCB0aWxlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBsYWNlKG9iamVjdC5saW5rZWQsIHRpbGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZGVsZXRlIHRoaXMudGlsZXNbdGlsZV07XG4gICAgICAgIHN0YXRlLnJlc29sdmUoKTtcbiAgICB9LFxuXG4gICAgLy8gUnVuIGNvbGxpc2lvbiBhbmQgcmVwZWF0IGNoZWNrIHRvIHNlZSBpZiBsYWJlbCBjYW4gY3VycmVudGx5IGJlIHBsYWNlZFxuICAgIGNhbkJlUGxhY2VkIChvYmplY3QsIHRpbGUsIGV4Y2x1ZGUgPSBudWxsKSB7XG4gICAgICAgIGxldCBsYWJlbCA9IG9iamVjdC5sYWJlbDtcbiAgICAgICAgbG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AgICAgbGV0IGFhYmJzID0gYmJveGVzLmFhYmI7XG4gICAgICAgIGxldCBvYmJzID0gYmJveGVzLm9iYjtcblxuICAgICAgICAvLyBCcm9hZCBwaGFzZVxuICAgICAgICBpZiAoYWFiYnMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgYm94SW50ZXJzZWN0KFt0aGlzLmFhYmJdLCBhYWJicywgKGksIGopID0+IHtcbiAgICAgICAgICAgICAgICAvLyBsb2coJ3RyYWNlJywgJ2NvbGxpc2lvbjogYnJvYWQgcGhhc2UgY29sbGlkZScsIHRoaXMubGF5b3V0LmlkLCB0aGlzLCB0aGlzLmFhYmIsIGFhYmJzW2pdKTtcblxuICAgICAgICAgICAgICAgIC8vIFNraXAgaWYgY29sbGlkaW5nIHdpdGggZXhjbHVkZWQgbGFiZWxcbiAgICAgICAgICAgICAgICBpZiAoZXhjbHVkZSAmJiBhYWJic1tqXSA9PT0gZXhjbHVkZS5hYWJiKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGxvZygndHJhY2UnLCAnY29sbGlzaW9uOiBza2lwcGluZyBkdWUgdG8gZXhwbGljaXQgZXhjbHVzaW9uJywgdGhpcywgZXhjbHVkZSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBTa2lwIG5hcnJvdyBwaGFzZSBjb2xsaXNpb24gaWYgbm8gcm90YXRpb25cbiAgICAgICAgICAgICAgICBpZiAodGhpcy5vYmIuYW5nbGUgPT09IDAgJiYgb2Jic1tqXS5hbmdsZSA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAvLyBsb2coJ3RyYWNlJywgJ2NvbGxpc2lvbjogc2tpcCBuYXJyb3cgcGhhc2UgY29sbGlkZSBiZWNhdXNlIG5laXRoZXIgaXMgcm90YXRlZCcsIHRoaXMubGF5b3V0LmlkLCB0aGlzLCB0aGlzLm9iYiwgb2Jic1tqXSk7XG4gICAgICAgICAgICAgICAgICAgIGludGVyc2VjdCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIE5hcnJvdyBwaGFzZVxuICAgICAgICAgICAgICAgIGlmIChPQkIuaW50ZXJzZWN0KHRoaXMub2JiLCBvYmJzW2pdKSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBsb2coJ3RyYWNlJywgJ2NvbGxpc2lvbjogbmFycm93IHBoYXNlIGNvbGxpZGUnLCB0aGlzLmxheW91dC5pZCwgdGhpcywgdGhpcy5vYmIsIG9iYnNbal0pO1xuICAgICAgICAgICAgICAgICAgICBpbnRlcnNlY3QgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gaW50ZXJzZWN0O1xuICAgIH1cblxuICAgIC8vIEFkZCB0aGlzIGxhYmVsJ3MgYm91bmRpbmcgYm94IHRvIHRoZSBwcm92aWRlZCBzZXRcbiAgICBhZGQgKGJib3hlcykge1xuICAgICAgICB0aGlzLnBsYWNlZCA9IHRydWU7XG4gICAgICAgIGJib3hlcy5hYWJiLnB1c2godGhpcy5hYWJiKTtcbiAgICAgICAgYmJveGVzLm9iYi5wdXNoKHRoaXMub2JiKTtcbiAgICB9XG5cbiAgICAvLyBjaGVja3Mgd2hldGhlciB0aGUgbGFiZWwgaXMgd2l0aGluIHRoZSB0aWxlIGJvdW5kYXJpZXNcbiAgICBpblRpbGVCb3VuZHMgKCkge1xuICAgICAgICBsZXQgbWluID0gWyB0aGlzLmFhYmJbMF0sIHRoaXMuYWFiYlsxXSBdO1xuICAgICAgICBsZXQgbWF4ID0gWyB0aGlzLmFhYmJbMl0sIHRoaXMuYWFiYlszXSBdO1xuXG4gICAgICAgIGlmICghVXRpbHMucG9pbnRJblRpbGUobWluK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JvdGggc3RyYWlnaHQgYW5kIGFydGljdWxhdGVkIHNlZ21lbnRzLiBSZXR1cm5zIGZhbHNlIGlmIGFsbCBwb3NzaWJpbGl0aWVzXG4gICAgLy8gaGF2ZSBiZWVuIGV4aGF1c3RlZFxuICAgIGdldE5leHRTZWdtZW50KCkge1xuICAgICAgICBzd2l0Y2ggKHRoaXMucGxhY2VtZW50KSB7XG4gICAgICAgICAgICBjYXNlIFBMQUNFTUVOVC5DT1JORVI6XG4gICAgICAgICAgICAgICAgdGhpcy5wbGFjZW1lbnQgPSBQTEFDRU1FTlQuTUlEX1BPSU5UO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSBQTEFDRU1FTlQuTUlEX1BPSU5UOlxuICAgICAgICAgICAgICAgIGlmICh0aGlzLnNlZ21lbnRfaW5kZXggPj0gdGhpcy5saW5lcy5sZW5ndGggLSAyKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAodGhpcy5zaXplLmxlbmd0aCA+IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wbGFjZW1lbnQgPSBQTEFDRU1FTlQuQ09STkVSO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLnNlZ21lbnRfaW5kZXgrKztcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0aGlzLmdldEN1cnJlbnRTZWdtZW50KCk7XG4gICAgfVxuXG4gICAgLy8gUmV0dXJucyB0aGUgbGluZSBzZWdtZW50cyBuZWNlc3NhcnkgZm9yIG90aGVyIGNhbGN1bGF0aW9ucyBhdCB0aGUgY3VycmVudCBsaW5lIHNlZ21lbnQgaW5kZXguXG4gICAgLy8gVGhpcyBpcyB0aGUgY3VycmVudCBhbmQgbmV4dCBzZWdtZW50IGZvciBhIHN0cmFpZ2h0IGxpbmUsIGFuZCB0aGUgcHJldmlvdXMsIGN1cnJlbnQgYW5kIG5leHRcbiAgICAvLyBmb3IgYW4gYXJ0aWN1bGF0ZWQgc2VnbWVudC5cbiAgICBnZXRDdXJyZW50U2VnbWVudCgpIHtcbiAgICAgICAgbGV0IHAxLCBwMiwgc2VnbWVudDtcbiAgICAgICAgc3dpdGNoICh0aGlzLnBsYWNlbWVudCkge1xuICAgICAgICAgICAgY2FzZSBQTEFDRU1FTlQuQ09STkVSOlxuICAgICAgICAgICAgICAgIHAxID0gdGhpcy5saW5lc1t0aGlzLnNlZ21lbnRfaW5kZXggLSAxXTtcbiAgICAgICAgICAgICAgICBwMiA9IHRoaXMubGluZXNbdGhpcy5zZWdtZW50X2luZGV4XTtcbiAgICAgICAgICAgICAgICBsZXQgcDMgPSB0aGlzLmxpbmVzW3RoaXMuc2VnbWVudF9pbmRleCArIDFdO1xuICAgICAgICAgICAgICAgIHNlZ21lbnQgPSBbIHAxLCBwMiwgcDMgXTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgUExBQ0VNRU5ULk1JRF9QT0lOVDpcbiAgICAgICAgICAgICAgICBwMSA9IHRoaXMubGluZXNbdGhpcy5zZWdtZW50X2luZGV4XTtcbiAgICAgICAgICAgICAgICBwMiA9IHRoaXMubGluZXNbdGhpcy5zZWdtZW50X2luZGV4ICsgMV07XG4gICAgICAgICAgICAgICAgc2VnbWVudCA9IFsgcDEsIHAyIF07XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gc2VnbWVudDtcbiAgICB9XG5cbiAgICAvLyBSZXR1cm5zIG5leHQgc2VnbWVudCB0aGF0IGlzIHZhbGlkICh3aXRoaW4gdGlsZSwgaW5zaWRlIGFuZ2xlIHJlcXVpcmVtZW50cyBhbmQgd2l0aGluIGxpbmUgZ2VvbWV0cnkpLlxuICAgIGdldE5leHRGaXR0aW5nU2VnbWVudCh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oaXMudXBkYXRlQkJveGVzKCk7XG4gICAgfVxuXG4gICAgZ2V0Q3VycmVudEFuZ2xlKCkge1xuICAgICAgICBsZXQgc2VnbWVudCA9IHRoaXMuZ2V0Q3VycmVudFNlZ21lbnQoKTtcbiAgICAgICAgbGV0IGFuZ2xlcyA9IFtdO1xuXG4gICAgICAgIHN3aXRjaCAodGhpcy5wbGFjZW1lbnQpIHtcbiAgICAgICAgICAgIGNhc2UgUExBQ0VNRU5ULkNPUk5FUjpcbiAgICAgICAgICAgICAgICBsZXQgdGhldGExID0gZ2V0QW5nbGVGcm9tU2VnbWVudChzZWdtZW50WzBdLCBzZWdtZW50WzFdKTtcbiAgICAgICAgICAgICAgICBsZXQgdGhldGEyID0gZ2V0QW5nbGVGcm9tU2VnbWVudChzZWdtZW50WzFdLCBzZWdtZW50WzJdKTtcblxuICAgICAgICAgICAgICAgIGxldCBwMHAxID0gVmVjdG9yLnN1YihzZWdtZW50WzBdLCBzZWdtZW50WzFdKTtcbiAgICAgICAgICAgICAgICBsZXQgcDFwMiA9IFZlY3Rvci5zdWIoc2VnbWVudFsxXSwgc2VnbWVudFsyXSk7XG5cbiAgICAgICAgICAgICAgICBsZXQgb3JpZW50YXRpb24gPSAocDBwMVswXSA+PSAwICYmIHAxcDJbMF0gPj0gMCkgPyAxIDogLTE7XG4gICAgICAgICAgICAgICAgbGV0IGFuZ2xlO1xuXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aGlzLm51bV9zZWdtZW50czsgaSsrKXtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgPCB0aGlzLmtpbmtfaW5kZXgpe1xuICAgICAgICAgICAgICAgICAgICAgICAgYW5nbGUgPSAob3JpZW50YXRpb24gPiAwKSA/IHRoZXRhMiA6IHRoZXRhMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFuZ2xlID0gKG9yaWVudGF0aW9uID4gMCkgPyB0aGV0YTEgOiB0aGV0YTI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYW5nbGVzLnB1c2goYW5nbGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgUExBQ0VNRU5ULk1JRF9QT0lOVDpcbiAgICAgICAgICAgICAgICBsZXQgdGhldGEgPSBnZXRBbmdsZUZyb21TZWdtZW50KHNlZ21lbnRbMF0sIHNlZ21lbnRbMV0pO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy5udW1fc2VnbWVudHM7IGkrKyl7XG4gICAgICAgICAgICAgICAgICAgIGFuZ2xlcy5wdXNoKHRoZXRhKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gYW5nbGVzO1xuICAgIH1cblxuICAgIC8vIFJldHVybiB0aGUgcG9zaXRpb24gb2YgdGhlIGNlbnRlciBvZiB0aGUgbGFiZWxcbiAgICBnZXRDdXJyZW50UG9zaXRpb24oKSB7XG4gICAgICAgIGxldCBzZWdtZW50ID0gdGhpcy5nZXRDdXJyZW50U2VnbWVudCgpO1xuICAgICAgICBsZXQgcG9zaXRpb247XG5cbiAgICAgICAgc3dpdGNoICh0aGlzLnBsYWNlbWVudCkge1xuICAgICAgICAgICAgY2FzZSBQTEFDRU1FTlQuQ09STkVSOlxuICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gc2VnbWVudFsxXS5zbGljZSgpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSBQTEFDRU1FTlQuTUlEX1BPSU5UOlxuICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gW1xuICAgICAgICAgICAgICAgICAgICAwLjUgKiAoc2VnbWVudFswXVswXSArIHNlZ21lbnRbMV1bMF0pLFxuICAgICAgICAgICAgICAgICAgICAwLjUgKiAoc2VnbWVudFswXVsxXSArIHNlZ21lbnRbMV1bMV0pXG4gICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBwb3NpdGlvbjtcbiAgICB9XG5cbiAgICAvLyBDaGVjayBmb3IgYXJ0aWN1bGF0ZWQgbGFiZWxzIHRvIGJlIHdpdGhpbiBhbiBhbmdsZSByYW5nZSBbLU1BWF9BTkdMRSwgK01BWF9BTkdMRV1cbiAgICBpbkFuZ2xlQm91bmRzKCkge1xuICAgICAgICBzd2l0Y2ggKHRoaXMucGxhY2VtZW50KSB7XG4gICAgICAgICAgICBjYXNlIFBMQUNFTUVOVC5DT1JORVI6XG4gICAgICAgICAgICAgICAgbGV0IGFuZ2xlMCA9IHRoaXMuYW5nbGVbMF07XG4gICAgICAgICAgICAgICAgaWYgKGFuZ2xlMCA8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgYW5nbGUwICs9IDIgKiBNYXRoLlBJO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGxldCBhbmdsZTEgPSB0aGlzLmFuZ2xlWzFdO1xuICAgICAgICAgICAgICAgIGlmIChhbmdsZTEgPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGFuZ2xlMSArPSAyICogTWF0aC5QSTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBsZXQgdGhldGEgPSBNYXRoLmFicyhhbmdsZTEgLSBhbmdsZTApO1xuICAgICAgICAgICAgICAgIHRoZXRhID0gTWF0aC5taW4oMiAqIE1hdGguUEkgLSB0aGV0YSwgdGhldGEpO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoZXRhIDw9IE1BWF9BTkdMRTtcbiAgICAgICAgICAgIGNhc2UgUExBQ0VNRU5ULk1JRF9QT0lOVDpcbiAgICAgICAgICAgICAgICByZXR1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ogXCJcXC9cIiBvciBcIi9cXFwiXG4gICAgICAgICAgICAgICAgbGV0IGR4ID0gdGhpcy5zcHJlYWRfZmFjdG9yICogTWF0aC5hYnModGhpcy50b3RhbF9oZWlnaHQgKiBNYXRoLnRhbigwLjUgKiB0aGV0YSkpO1xuICAgICAgICAgICAgICAgIGxldCBudWRnZSA9IDAuNSAqICgtZHggLSB0aGlzLnNwYWNlX3dpZHRoKTtcblxuICAgICAgICAgICAgICAgIC8vIFBsYWNlIGxhYmVscyBiYWNrd2FyZHMgZnJvbSBraW5rIGluZGV4XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IHRoaXMua2lua19pbmRleCAtIDE7IGkgPj0gMDsgaS0tKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCB3aWR0aF9weCA9IHRoaXMuc2l6ZVtpXVswXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGFuZ2xlID0gdGhpcy5hbmdsZVtpXTtcblxuICAgICAgICAgICAgICAgICAgICBsZXQgd2lkdGggPSAod2lkdGhfcHggKyAyICogdGhpcy5sYXlvdXQuYnVmZmVyWzBdKSAqIHVwcCAqIExhYmVsLmVwc2lsb247XG5cbiAgICAgICAgICAgICAgICAgICAgbnVkZ2UgLT0gMC41ICogd2lkdGhfcHg7XG5cbiAgICAgICAgICAgICAgICAgICAgbGV0IG9mZnNldCA9IFZlY3Rvci5yb3QoW251ZGdlICogdXBwLCAwXSwgLWFuZ2xlKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBvc2l0aW9uID0gVmVjdG9yLmFkZCh0aGlzLnBvc2l0aW9uLCBvZmZzZXQpO1xuXG4gICAgICAgICAgICAgICAgICAgIGxldCBvYmIgPSBnZXRPQkIocG9zaXRpb24sIHdpZHRoLCBoZWlnaHQsIGFuZ2xlLCB0aGlzLm9mZnNldCwgdXBwKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGFhYmIgPSBvYmIuZ2V0RXh0ZW50KCk7XG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vYmJzLnB1c2gob2JiKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hYWJicy5wdXNoKGFhYmIpO1xuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMub2Zmc2V0c1tpXSA9IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMubGF5b3V0Lm9mZnNldFswXSArIG51ZGdlLFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5sYXlvdXQub2Zmc2V0WzFdXG4gICAgICAgICAgICAgICAgICAgIF07XG5cbiAgICAgICAgICAgICAgICAgICAgbnVkZ2UgLT0gMC41ICogd2lkdGhfcHggKyB0aGlzLnNwYWNlX3dpZHRoO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIFBsYWNlIGxhYmVscyBmb3J3YXJkcyBmcm9tIGtpbmsgaW5kZXhcbiAgICAgICAgICAgICAgICBudWRnZSA9IDAuNSAqIChkeCArIHRoaXMuc3BhY2Vfd2lkdGgpO1xuXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IHRoaXMua2lua19pbmRleDsgaSA8IHRoaXMubnVtX3NlZ21lbnRzOyBpKyspe1xuICAgICAgICAgICAgICAgICAgICBsZXQgd2lkdGhfcHggPSB0aGlzLnNpemVbaV1bMF07XG4gICAgICAgICAgICAgICAgICAgIGxldCBhbmdsZSA9IHRoaXMuYW5nbGVbaV07XG5cbiAgICAgICAgICAgICAgICAgICAgbGV0IHdpZHRoID0gKHdpZHRoX3B4ICsgMiAqIHRoaXMubGF5b3V0LmJ1ZmZlclswXSkgKiB1cHAgKiBMYWJlbC5lcHNpbG9uO1xuXG4gICAgICAgICAgICAgICAgICAgIG51ZGdlICs9IDAuNSAqIHdpZHRoX3B4O1xuXG4gICAgICAgICAgICAgICAgICAgIGxldCBvZmZzZXQgPSBWZWN0b3Iucm90KFtudWRnZSAqIHVwcCwgMF0sIC1hbmdsZSk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBwb3NpdGlvbiA9IFZlY3Rvci5hZGQodGhpcy5wb3NpdGlvbiwgb2Zmc2V0KTtcblxuICAgICAgICAgICAgICAgICAgICBsZXQgb2JiID0gZ2V0T0JCKHBvc2l0aW9uLCB3aWR0aCwgaGVpZ2h0LCBhbmdsZSwgdGhpcy5vZmZzZXQsIHVwcCk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBhYWJiID0gb2JiLmdldEV4dGVudCgpO1xuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMub2Jicy5wdXNoKG9iYik7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYWFiYnMucHVzaChhYWJiKTtcblxuICAgICAgICAgICAgICAgICAgICB0aGlzLm9mZnNldHNbaV0gPSBbXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmxheW91dC5vZmZzZXRbMF0gKyBudWRnZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMubGF5b3V0Lm9mZnNldFsxXVxuICAgICAgICAgICAgICAgICAgICBdO1xuXG4gICAgICAgICAgICAgICAgICAgIG51ZGdlICs9IDAuNSAqIHdpZHRoX3B4ICsgdGhpcy5zcGFjZV93aWR0aDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIFBMQUNFTUVOVC5NSURfUE9JTlQ6XG4gICAgICAgICAgICAgICAgbGV0IHNoaWZ0ID0gLTAuNSAqIHRoaXMudG90YWxfbGVuZ3RoOyAvLyBzaGlmdCBmb3IgY2VudGVyaW5nIHRoZSBsYWJlbHNcblxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy5udW1fc2VnbWVudHM7IGkrKyl7XG4gICAgICAgICAgICAgICAgICAgIGxldCB3aWR0aF9weCA9IHRoaXMuc2l6ZVtpXVswXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHdpZHRoID0gKHdpZHRoX3B4ICsgMiAqIHRoaXMubGF5b3V0LmJ1ZmZlclswXSkgKiB1cHAgKiBMYWJlbC5lcHNpbG9uO1xuICAgICAgICAgICAgICAgICAgICBsZXQgYW5nbGUgPSB0aGlzLmFuZ2xlW2ldO1xuXG4gICAgICAgICAgICAgICAgICAgIHNoaWZ0ICs9IDAuNSAqIHdpZHRoX3B4O1xuXG4gICAgICAgICAgICAgICAgICAgIGxldCBvZmZzZXQgPSBWZWN0b3Iucm90KFtzaGlmdCAqIHVwcCwgMF0sIC1hbmdsZSk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBwb3NpdGlvbiA9IFZlY3Rvci5hZGQodGhpcy5wb3NpdGlvbiwgb2Zmc2V0KTtcblxuICAgICAgICAgICAgICAgICAgICBsZXQgb2JiID0gZ2V0T0JCKHBvc2l0aW9uLCB3aWR0aCwgaGVpZ2h0LCBhbmdsZSwgdGhpcy5vZmZzZXQsIHVwcCk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBhYWJiID0gb2JiLmdldEV4dGVudCgpO1xuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMub2Jicy5wdXNoKG9iYik7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYWFiYnMucHVzaChhYWJiKTtcblxuICAgICAgICAgICAgICAgICAgICB0aGlzLm9mZnNldHNbaV0gPSBbXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmxheW91dC5vZmZzZXRbMF0gKyBzaGlmdCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMubGF5b3V0Lm9mZnNldFsxXVxuICAgICAgICAgICAgICAgICAgICBdO1xuXG4gICAgICAgICAgICAgICAgICAgIHNoaWZ0ICs9IDAuNSAqIHdpZHRoX3B4ICsgdGhpcy5zcGFjZV93aWR0aDtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIENoZWNrcyBlYWNoIHNlZ21lbnQgdG8gc2VlIGlmIGl0IGlzIH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m9QYWlyKSB7ICAgICAgICAvLyBwb2ludCBoYXMgYW4gb2Zmc2V0XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMub2Zmc2V0ID09PSBTdHlsZVBhcnNlci56ZXJvUGFpcikgeyAvLyBubyB0ZXh0IG9mZnNldCwgdXNlIHBvaW50J3NcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vZmZzZXQgPSBwYXJlbnQub2Zmc2V0O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0ZXh0IGhhcyBvZmZzZXQsIGFkZCBwb2ludCdzXG4gICAgICAgICAgICAgICAgICAgIHRoaXMub2Zmc2V0WzBdICs9IHBhcmVudC5vZmZzZXRbMF07XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub2Zmc2V0WzFdICs9IHBhcmVudC5vZmZzZXRbMV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5vZmZzZXQgPSBQb2ludEFuY2hvci5jb21wdXRlT2Zmc2V0KHRoaXMub2Zmc2V0LCB0aGlzLnNpemUsIHRoaXMuYW5jaG9yKTtcbiAgICB9XG5cbiAgICB1cGRhdGVCQm94ZXMgKCkge1xuICAgICAgICBsZXQgd2lkdGggPSAodGhpcy5zaXplWzBdICsgdGhpcy5sYXlvdXQuYnVmZmVyWzBdICogMikgKiB0aGlzLmxheW91dC51bml0c19wZXJfcGl4ZWwgKiBMYWJlbC5lcHNpbG9uO1xuICAgICAgICBsZXQgaGVpZ2h0ID0gKHRoaXMuc2l6ZVsxXSArIHRoaXMubGF5b3V0LmJ1ZmZlclsxXSAqIDIpICogdGhpcy5sYXlvdXQudW5pdHNfcGVyX3BpeGVsICogTGFiZWwuZXBzaWxvbjtcblxuICAgICAgICBsZXQgcCA9IFtcbiAgICAgICAgICAgIHRoaXMucG9zaXRpb25bMF0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xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuYWFiYlsxXSA8PSAtR2VvLnRpbGVfc2NhbGUpIHtcbiAgICAgICAgICAgIHRoaXMucG9zaXRpb25bMV0gLT0gdGhpcy5hYWJiWzFdICsgR2VvLnRpbGVfc2NhbGUgLSAxO1xuICAgICAgICAgICAgdXBkYXRlZCA9IHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodXBkYXRlZCkge1xuICAgICAgICAgICAgdGhpcy51cGRhdGVCQm94ZXMoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB1cGRhdGVkO1xuICAgIH1cblxuICAgIGdldE5leHRGaXQoKSB7XG4gICAgICAgIGlmICghdGhpcy5sYXlvdXQuY3VsbF9mcm9tX3RpbGUgfHwgdGhpcy5pblRpbGVCb3VuZHMoKSkge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5sYXlvdXQubW92ZV9pbnRvX3RpbGUpIHtcbiAgICAgICAgICAgIHRoaXMubW92ZUludG9UaWxlKCk7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHRoaXMubGF5b3V0LmFuY2hvcikpIHtcbiAgICAgICAgICAgICAgICAvLyBTdGFydCBvbiBzZWNvbmQgYW5jaG9yIChmaXJzdCBhbmNob3Igd2FzIHNldCBvbiBjcmVhdGlvbilcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMTsgaSA8IHRoaXMubGF5b3V0LmFuY2hvci5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmFuY2hvciA9IHRoaXMubGF5b3V0LmFuY2hvcltpXTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy51cGRhdGUoKTtcblxuICAgICAgICAgICAgICAgICAgICB0aGlzLnN0YXJ0X2FuY2hvcl9pbmRleCA9IGk7XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuaW5UaWxlQm91bmRzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gbm8gYW5jaG9ycyByZXN1bHQgaW4gZml0XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBkaXNjYXJkIChiYm94ZXMsIGV4Y2x1ZGUgPSBudWxsKSB7XG4gICAgICAgIGlmIChzdXBlci5kaXNjYXJkKGJib3hlcywgZXhjbHVkZSkpIHtcbiAgICAgICAgICAgIC8vIElmIG1vcmUgdGhhbiBvbmUgYW5jaG9yIHNwZWNpZmllZCwgdHJ5IHRoZW0gaW4gb3JkZXJcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHRoaXMubGF5b3V0LmFuY2hvcikpIHtcbiAgICAgICAgICAgICAgICAvLyBTdGFydCBvbiBzZWNvbmQgYW5jaG9yIChmaXJzdCBhbmNob3Igd2FzIHNldCBvbiBjcmVhdGlvbilcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpPXRoaXMuc3RhcnRfYW5jaG9yX2luZGV4OyBpIDwgdGhpcy5sYXlvdXQuYW5jaG9yLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYW5jaG9yID0gdGhpcy5sYXlvdXQuYW5jaG9yW2ldO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnVwZGF0ZSgpO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmxheW91dC5jdWxsX2Zyb21fdGlsZSAmJiAhdGhpcy5pblRpbGVCb3VuZHMoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgI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uYWwgbGVmdC9yaWdodCBvZmZzZXRcbiAgICAgICAgaWYgKHRoaXMuaXNMZWZ0QW5jaG9yKGFuY2hvcikpIHtcbiAgICAgICAgICAgIG9mZnNldDJbMF0gLT0gc2l6ZVswXSAvIDI7XG4gICAgICAgICAgICBpZiAoYW5jaG9yID09PSAnbGVmdCcpIHtcbiAgICAgICAgICAgICAgICBvZmZzZXQyWzBdIC09IGJ1ZmZlclswXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh0aGlzLmlzUmlnaHRBbmNob3IoYW5jaG9yKSkge1xuICAgICAgICAgICAgb2Zmc2V0MlswXSArPSBzaXplWzBdIC8gMjtcbiAgICAgICAgICAgIGlmIChhbmNob3IgPT09ICdyaWdodCcpIHtcbiAgICAgICAgICAgICAgICBvZmZzZXQyWzBdICs9IGJ1ZmZlclsxXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEFuIG9wdGlvbmFsIHRvcC9ib3R0b20gb2Zmc2V0XG4gICAgICAgIGlmICh0aGlzLmlzVG9wQW5jaG9yKGFuY2hvcikpIHtcbiAgICAgICAgICAgIG9mZnNldDJbMV0gLT0gc2l6ZVsxXSAvIDI7XG4gICAgICAgICAgICBpZiAoYW5jaG9yID09PSAndG9wJykge1xuICAgICAgICAgICAgICAgIG9mZnNldDJbMV0gLT0gYnVmZmVyWzJdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHRoaXMuaXNCb3R0b21BbmNob3IoYW5jaG9yKSkge1xuICAgICAgICAgICAgb2Zmc2V0MlsxXSArPSBzaXplWzFdIC8gMjtcbiAgICAgICAgICAgIGlmIChhbmNob3IgPT09ICdib3R0b20nKSB7XG4gICAgICAgICAgICAgICAgb2Zmc2V0MlsxXSArPSBidWZmZXJbM107XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gb2Zmc2V0Mjt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gICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgIGRpc3Rfc3E6IHRoaXMubWF4X3JlcGVhdF9kaXN0X3NxLFxuICAgICAgICAgICAgICAgICAgICByZXBlYXRfZGlzdF9zcTogdGhpcy5yZXBlYXRfZGlzdF9zcSxcbiAgICAgICAgICAgICAgICAgICAgb25lX3Blcl9ncm91cDogdGhpcy5vbmVfcGVyX2dyb3VwXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybjsgLy8gbm8gb2JqZWN0IGZvciB0aGlzIGdyb3VwIHlldFxuICAgICAgICB9XG5cbiAgICAgICAgLy8gQ2hlY2sgZGlzdGFuY2UgZnJvbSBuZXcgb2JqZWN0IHRvIG9iamVjdHMgYWxyZWFkeSBpbiBncm91cFxuICAgICAgICBsZXQgcDEgPSBvYmoucG9zaXRpb247XG4gICAgICAgIGZvciAobGV0IGk9MDsgaSA8IHRoaXMucG9zaXRpb25zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgcDIgPSB0aGlzLnBvc2l0aW9uc1tpXTtcbiAgICAgICAgICAgIGxldCBkeCA9IHAxWzBdIC0gcDJbMF07XG4gICAgICAgICAgICBsZXQgZHkgPSBwMVsxXSAtIHAyWzFdO1xuICAgICAgICAgICAgbGV0IGRpc3Rfc3EgPSBkeCAqIGR4ICsgZHkgKiBkeTtcblxuICAgICAgICAgICAgLy8gRm91bmQgYW4gZXhpc3Rpbmcgb2JqZWN0IHdpdGhpbiBhbGxvd2VkIGRpc3RhbmNlXG4gICAgICAgICAgICBpZiAoZGlzdF9zcSA8IHRoaXMucmVwZWF0X2Rpc3Rfc3EpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICBkaXN0X3NxLFxuICAgICAgICAgICAgICAgICAgICByZXBlYXRfZGlzdF9zcTogdGhpcy5yZXBlYXRfZGlzdF9zcVxuICAgICAgICAgICAg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vbnRhaW5lci5hcHBlbmRDaGlsZCh0aGlzLnNjZW5lLmNhbnZhcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIERlZmluZSBjdXN0b20gbGF5ZXIgbWV0aG9kc1xuICAgICAgICBPYmplY3QuYXNzaWduKGxheWVyQ2xhc3NDb25maWcsIHtcblxuICAgICAgICAgICAgaW5pdGlhbGl6ZTogZnVuY3Rpb24gKG9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAvLyBEZWZhdWx0c1xuICAgICAgICAgICAgICAgIG9wdGlvbnMuc2hvd0RlYnVnID0gKCFvcHRpb25zLnNob3dEZWJ1ZyA/IGZhbHNlIDogdHJ1ZSk7XG4gICAgICAgICAgICAgICAgb3B0aW9ucy53aGVlbERlYm91bmNlVGltZSA9IG9wdGlvbnMud2hlZWxEZWJvdW5jZVRpbWUgfHwgNDA7XG5cbiAgICAgICAgICAgICAgICBMLnNldE9wdGlvbnModGhpcywgb3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgdGhpcy5jcmVhdGVTY2VuZSgpO1xuICAgICAgICAgICAgICAgIHRoaXMuaG9va3MgPSB7fTtcbiAgICAgICAgICAgICAgICB0aGlzLl91cGRhdGluZ190YW5ncmFtID0gZmFsc2U7XG5cbiAgICAgICAgICAgICAgICAvLyBGb3JjZSBsZWFmbGV0IHpvb20gYW5pbWF0aW9ucyBvZmZcbiAgICAgICAgICAgICAgICB0aGlzLl96b29tQW5pbWF0ZWQgPSBmYWxzZTtcblxuICAgICAgICAgICAgICAgIHRoaXMuZGVib3VuY2VWaWV3UmVzZXQgPSBVdGlscy5kZWJvdW5jZSgoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX21hcC5maXJlKCd6b29tZW5kJyk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX21hcC5maXJlKCdtb3ZlZW5kJyk7XG4gICAgICAgICAgICAgICAgfSwgdGhpcy5vcHRpb25zLndoZWVsRGVib3VuY2VUaW1lKTtcbiAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgIGNyZWF0ZVNjZW5lOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zY2VuZSA9IFNjZW5lLmNyZWF0ZShcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcHRpb25zLnNjZW5lLFxuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICBudW1Xb3JrZXJzOiB0aGlzLm9wdGlvbnMubnVtV29ya2VycyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHByZVVwZGF0ZTogdGhpcy5vcHRpb25zLnByZVVwZGF0ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvc3RVcGRhdGU6IHRoaXMub3B0aW9ucy5wb3N0VXBkYXRlLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludW91c1pvb206IChMZWFmbGV0TGF5ZXIubGVhZmxldFZlcnNpb24gPT09ICcxLngnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhpZ2hEZW5zaXR5RGlzcGxheTogdGhpcy5vcHRpb25zLmhpZ2hEZW5zaXR5RGlzcGxheSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvZ0xldmVsOiB0aGlzLm9wdGlvbnMubG9nTGV2ZWwsXG4gICAgICAgICAgICAgICAgICAgICAgICBpbnRyb3NwZWN0aW9uOiB0aGlzLm9wdGlvbnMuaW50cm9zcGVjdGlvbixcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFkdmFuY2VkIG9wdGlvbiwgYXBwIHdpbGwgaGF2ZSB0byBtYW51YWxseSBjYWxsZWQgc2NlbmUudXBkYXRlKCkgcGVyIGZyYW1lXG4gICAgICAgICAgICAgICAgICAgICAgICBkaXNhYmxlUmVuZGVyTG9vcDogdGhpcy5vcHRpb25zLmRpc2FibGVSZW5kZXJMb29wLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYWR2YW5jZWQgb3B0aW9uLCB3aWxsIHJlcXVpcmUgbGlicmFyeSB0byBiZSBzZXJ2ZWQgYXMgc2FtZSBob3N0IGFzIHBhZ2VcbiAgICAgICAgICAgICAgICAgICAgICAgIGFsbG93Q3Jvc3NEb21haW5Xb3JrZXJzOiB0aGlzLm9wdGlvbnMuYWxsb3dDcm9zc0RvbWFpbldvcmtlcnNcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICAvLyBGaW5pc2ggaW5pdGlhbGl6aW5nIHNjZW5lIGFuZCBzZXR1cCBldmVudHMgd2hlbiBsYXllciBpcyBhZGRlZCB0byBtYXBcbiAgICAgICAgICAgIG9uQWRkOiBmdW5jdGlvbiAobWFwKSB7XG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLnNjZW5lKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3JlYXRlU2NlbmUoKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBsYXllckJhc2VDbGFzcy5wcm90b3R5cGUub25BZGQuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcblxuICAgICAgICAgICAgICAgIHRoaXMuaG9va3MucmVzaXplID0gKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl91cGRhdGluZ190YW5ncmFtID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy51cGRhdGVTaXplKCk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3VwZGF0aW5nX3RhbmdyYW0gPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIG1hcC5vbigncmVzaXplJywgdGhpcy5ob29rcy5yZXNpemUpO1xuXG4gICAgICAgICAgICAgICAgdGhpcy5ob29rcy5tb3ZlID0gKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fdXBkYXRpbmdfdGFuZ3JhbSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fdXBkYXRpbmdfdGFuZ3JhbSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIHZhciB2aWV3ID0gbWFwLmdldENlbnRlcigpO1xuICAgICAgICAgICAgICAgICAgICB2aWV3Lnpvb20gPSBNYXRoLm1pbihtYXAuZ2V0Wm9vbSgpLCBtYXAuZ2V0TWF4Wm9vbSgpIHx8IEdlby5kZWZhdWx0X3ZpZXdfbWF4X3pvb20pO1xuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2NlbmUudmlldy5zZXRWaWV3KHZpZXcpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNjZW5lLmltbWVkaWF0ZVJlZHJhdygpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnJldmVyc2VUcmFuc2Zvcm0oKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fdXBkYXRpbmdfdGFuZ3JhbSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgbWFwLm9uKCdtb3ZlJywgdGhpcy5ob29rcy5tb3ZlKTtcblxuICAgICAgICAgICAgICAgIHRoaXMuaG9va3Muem9vbXN0YXJ0ID0gKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fdXBkYXRpbmdfdGFuZ3JhbSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fdXBkYXRpbmdfdGFuZ3JhbSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2NlbmUudmlldy5zdGFydFpvb20oKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fdXBkYXRpbmdfdGFuZ3JhbSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgbWFwLm9uKCd6b29tc3RhcnQnLCB0aGlzLmhvb2tzLnpvb21zdGFydCk7XG5cbiAgICAgICAgICAgICAgICB0aGlzLmhvb2tzLmRyYWdzdGFydCA9ICgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zY2VuZS52aWV3LnBhbm5pbmcgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgbWFwLm9uKCdkcmFnc3RhcnQnLCB0aGlzLmhvb2tzLmRyYWdzdGFydCk7XG5cbiAgICAgICAgICAgICAgICB0aGlzLmhvb2tzLmRyYWdlbmQgPSAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2NlbmUudmlldy5wYW5uaW5nID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBtYXAub24oJ2RyYWdlbmQnLCB0aGlzLmhvb2tzLmRyYWdlbmQpO1xuXG4gICAgICAgICAgICAgICAgLy8gRm9yY2UgbGVhZmxldCB6b29tIGFuaW1hdGlvbnMgb2ZmXG4gICAgICAgICAgICAgICAgbWFwLl96b29tQW5pbWF0ZWQgPSBmYWxzZTtcblxuICAgICAgICAgICAgICAgIC8vIE1vZGlmeSBkZWZhdWx0IGxlYWZsZXQgc2Nyb2xsIHdoZWVsIGJlaGF2aW9yXG4gICAgICAgICAgICAgICAgdGhpcy5tb2RpZnlTY3JvbGxXaGVlbEJlaGF2aW9yKG1hcCk7XG5cbiAgICAgICAgICAgICAgICAvLyBTZXR1cCBmZWF0dXJlIHNlbGVjdGlvblxuICAgICAgICAgICAgICAgIHRoaXMuc2V0dXBTZWxlY3Rpb25FdmVudEhhbmRsZXJzKG1hcCk7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXRTZWxlY3Rpb25FdmVudHModGhpcy5vcHRpb25zLmV2ZW50cyk7XG5cbiAgICAgICAgICAgICAgICAvLyBBZGQgR0wgY2FudmFzIHRvIGxheWVyIGNvbnRhaW5lclxuICAgICAgICAgICAgICAgIHRoaXMuc2NlbmUuY29udGFpbmVyID0gdGhpcy5nZXRDb250YWluZXIoKTtcbiAgICAgICAgICAgICAgICB0aGlzLnVwZGF0ZVNpemUoKTtcblxuICAgICAgICAgICAgICAgIC8vIEluaXRpYWwgdmlld1xuICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlVmlldygpO1xuXG4gICAgICAgICAgICAgICAgLy8gU3Vic2NyaWJlIHRvIHRhbmdyYW0gZXZlbnRzXG4gICAgICAgICAgICAgICAgdGhpcy5zY2VuZS5zdWJzY3JpYmUoe1xuICAgICAgICAgICAgICAgICAgICBtb3ZlOiB0aGlzLm9uVGFuZ3JhbVZpZXdVcGRhdGUuYmluZCh0aGlzKVxuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgLy8gVXNlIGxlYWZsZXQncyBleGlzdGluZyBldmVudCBzeXN0ZW0gYXMgdGhlIGNhbGxiYWNrIG1lY2hhbmlzbVxuICAgICAgICAgICAgICAgIHRoaXMuc2NlbmUubG9hZCgpLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl91cGRhdGluZ190YW5ncmFtID0gdHJ1ZTtcblxuICAgICAgICAgICAgICAgICAgICB0aGlzLnVwZGF0ZVNpemUoKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy51cGRhdGVWaWV3KCk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmV2ZXJzZVRyYW5zZm9ybSgpO1xuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3VwZGF0aW5nX3RhbmdyYW0gPSBmYWxzZTtcblxuICAgICAgICAgICAgICAgICAgICB0aGlzLmZpcmUoJ2luaXQnKTtcbiAgICAgICAgICAgICAgICB9KS5jYXRjaChlcnJvciA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZmlyZSgnZXJyb3InLCBlcnJvcik7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICBvblJlbW92ZTogZnVuY3Rpb24gKG1hcCkge1xuICAgICAgICAgICAgICAgIGxheWVyQmFzZUNsYXNzLnByb3RvdHlwZS5vblJlbW92ZS5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xuXG4gICAgICAgICAgICAgICAgbWFwLm9mZigncmVzaXplJywgdGhpcy5ob29rcy5yZXNpemUpO1xuICAgICAgICAgICAgICAgIG1hcC5vZmYoJ21vdmUnLCB0aGlzLmhvb2tzLm1vdmUpO1xuICAgICAgICAgICAgICAgIG1hcC5vZmYoJ3pvb21zdGFydCcsIHRoaXMuaG9va3Muem9vbXN0YXJ0KTtcbiAgICAgICAgICAgICAgICBtYXAub2ZmKCdkcmFnc3RhcnQnLCB0aGlzLmhvb2tzLmRyYWdzdGFydCk7XG4gICAgICAgICAgICAgICAgbWFwLm9mZignZHJhZ2VuZCcsIHRoaXMuaG9va3MuZHJhZ2VuZCk7XG4gICAgICAgICAgICAgICAgbWFwLm9mZignY2xpY2snLCB0aGlzLmhvb2tzLmNsaWNrKTtcbiAgICAgICAgICAgICAgICBtYXAub2ZmKCdtb3VzZW1vdmUnLCB0aGlzLmhvb2tzLm1vdXNlbW92ZSk7XG4gICAgICAgICAgICAgICAgbWFwLm9mZignbW91c2VvdXQnLCB0aGlzLmhvb2tzLm1vdXNlb3V0KTtcbiAgICAgICAgICAgICAgICB0aGlzLmhvb2tzID0ge307XG5cbiAgICAgICAgICAgICAgICBpZiAodGhpcy5zY2VuZSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNjZW5lLmRlc3Ryb3koKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zY2VuZSA9IG51bGw7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgY3JlYXRlVGlsZTogZnVuY3Rpb24gKGNvb3Jkcykge1xuICAgICAgICAgICAgICAgIHZhciBrZXkgPSBjb29yZHMueCArICcvJyArIGNvb3Jkcy55ICsgJy8nICsgY29vcmRzLno7XG4gICAgICAgICAgICAgICAgdmFyIGRpdiA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2RpdicpO1xuICAgICAgICAgICAgICAgIGRpdi5zZXRBdHRyaWJ1dGUoJ2RhdGEtdGlsZS1rZXknLCBrZXkpO1xuICAgICAgICAgICAgICAgIGRpdi5zdHlsZS53aWR0aCA9ICcyNTZweCc7XG4gICAgICAgICAgICAgICAgZGl2LnN0eWxlLmhlaWdodCA9ICcyNTZweCc7XG5cbiAgICAgICAgICAgICAgICBpZiAodGhpcy5vcHRpb25zLnNob3dEZWJ1Zykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZGVidWdfb3ZlcmxheSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2RpdicpO1xuICAgICAgICAgICAgICAgICAgICBkZWJ1Z19vdmVybGF5LnRleHRDb250ZW50ID0ga2V5O1xuICAgICAgICAgICAgICAgICAgICBkZWJ1Z19vdmVybGF5LnN0eWxlLnBvc2l0aW9uID0gJ2Fic29sdXRlJztcbiAgICAgICAgICAgICAgICAgICAgZGVidWdfb3ZlcmxheS5zdHlsZS5sZWZ0ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgZGVidWdfb3ZlcmxheS5zdHlsZS50b3AgPSAwO1xuICAgICAgICAgICAgICAgICAgICBkZWJ1Z19vdmVybGF5LnN0eWxlLmNvbG9yID0gJ3doaXRlJztcbiAgICAgICAgICAgICAgICAgICAgZGVidWdfb3ZlcmxheS5zdHlsZS5mb250U2l6ZSA9ICcxNnB4JztcbiAgICAgICAgICAgICAgICAgICAgZGVidWdfb3ZlcmxheS5zdHlsZS50ZXh0T3V0bGluZSA9ICcxcHggIzAwMDAwMCc7XG4gICAgICAgICAgICAgICAgICAgIGRlYnVnX292ZXJsYXkuc3R5bGUucGFkZGluZyA9ICc4cHgnO1xuXG4gICAgICAgICAgICAgICAgICAgIGRpdi5hcHBlbmRDaGlsZChkZWJ1Z19vdmVybGF5KTtcbiAgICAgICAgICAgICAgICAgICAgZGl2LnN0eWxlLmJvcmRlclN0eWxlID0gJ3NvbGlkJztcbiAgICAgICAgICAgICAgICAgICAgZGl2LnN0eWxlLmJvcmRlckNvbG9yID0gJ3doaXRlJztcbiAgICAgICAgICAgICAgICAgICAgZGl2LnN0eWxlLmJvcmRlcldpZHRoID0gJzFweCc7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcmV0dXJuIGRpdjtcbiAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgIC8vIE1vZGlmeSBsZWFmbGV0J3MgZGVmYXVsdCBzY3JvbGwgd2hlZWwgYmVoYXZpb3IgdG8gaGF2ZSBhIG11Y2ggbW9yZSBzZW5zaXR2ZS9jb250aW51b3VzIHpvb21cbiAgICAgICAgICAgIC8vIE5vdGU6IHRoaXMgc2hvdWxkIGJlIGRlcHJlY2F0ZWQgb25jZSBsZWFmbGV0IGNvbnRpbnVvdXMgem9vbSBpcyBtb3JlIHdpZGVseSB1c2VkIGFuZCB0aGVcbiAgICAgICAgICAgIC8vIGRlZmF1bHQgYmVoYXZpb3IgaXMgcHJlc3VtYWJseSBpbXByb3ZlZFxuICAgICAgICAgICAgbW9kaWZ5U2Nyb2xsV2hlZWxCZWhhdmlvcjogZnVuY3Rpb24gKG1hcCkge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLnNjZW5lLnZpZXcuY29udGludW91c196b29tICYmIG1hcC5zY3JvbGxXaGVlbFpvb20gJiYgdGhpcy5vcHRpb25zLm1vZGlmeVNjcm9sbFdoZWVsICE9PSBmYWxzZSkge1xuICAgICAgICAgICAgICAgICAgICBtYXAub3B0aW9ucy56b29tU25hcCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIG1hcC5vcHRpb25zLndoZWVsUHhQZXJab29tTGV2ZWwgPSAxMDAwO1xuICAgICAgICAgICAgICAgICAgICBtYXAub3B0aW9ucy53aGVlbERlYm91bmNlVGltZSA9IDEwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgIHVwZGF0ZVZpZXc6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB2YXIgdmlldyA9IHRoaXMuX21hcC5nZXRDZW50ZXIoKTtcbiAgICAgICAgICAgICAgICB2aWV3Lnpvb20gPSBNYXRoLm1pbih0aGlzLl9tYXAuZ2V0Wm9vbSgpLCB0aGlzLl9tYXAuZ2V0TWF4Wm9vbSgpIHx8IEdlby5kZWZhdWx0X3ZpZXdfbWF4X3pvb20pO1xuICAgICAgICAgICAgICAgIHRoaXMuc2NlbmUudmlldy5zZXRWaWV3KHZpZXcpO1xuICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgdXBkYXRlU2l6ZTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciBzaXplID0gdGhpcy5fbWFwLmdldFNpemUoKTtcbiAgICAgICAgICAgICAgICB0aGlzLnNjZW5lLnJlc2l6ZU1hcChzaXplLngsIHNpemUueSk7XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICBvblRhbmdyYW1WaWV3VXBkYXRlOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLl9tYXAgfHwgdGhpcy5fdXBkYXRpbmdfdGFuZ3JhbSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMuX3VwZGF0aW5nX3RhbmdyYW0gPSB0cnVlO1xuICAgICAgICAgICAgICAgIHRoaXMuX21hcC5zZXRWaWV3KFt0aGlzLnNjZW5lLnZpZXcuY2VudGVyLmxhdCwgdGhpcy5zY2VuZS52aWV3LmNlbnRlci5sbmddLCB0aGlzLnNjZW5lLnZpZXcuem9vbSwgeyBhbmltYXRlOiBmYWxzZSB9KTtcbiAgICAgICAgICAgICAgICB0aGlzLnJldmVyc2VUcmFuc2Zvcm0oKTtcbiAgICAgICAgICAgICAgICB0aGlzLl91cGRhdGluZ190YW5ncmFtID0gZmFsc2U7XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICByZW5kZXI6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMuc2NlbmUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLnNjZW5lLnVwZGF0ZSgpO1xuICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgLy8gUmV2ZXJzZSB0aGUgQ1NTIHBvc2l0aW9uaW5nIExlYWZsZXQgYXBwbGllcyB0byB0aGUgbGF5ZXIsIHNpbmNlIFRhbmdyYW0ncyBXZWJHTCBjYW52YXNcbiAgICAgICAgICAgIC8vIGlzIGV4cGVjdGVkIHRvIGJlICdhYnNvbHV0ZWx5JyBwb3NpdGlvbmVkLlxuICAgICAgICAgICAgcmV2ZXJzZVRyYW5zZm9ybTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmICghdGhpcy5fbWFwIHx8ICF0aGlzLnNjZW5lIHx8ICF0aGlzLnNjZW5lLmNvbnRhaW5lcikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdmFyIHRvcF9sZWZ0ID0gdGhpcy5fbWFwLmNvbnRhaW5lclBvaW50VG9MYXllclBvaW50KFswLCAwXSk7XG4gICAgICAgICAgICAgICAgTC5Eb21VdGlsLnNldFBvc2l0aW9uKHRoaXMuc2NlbmUuY29udGFpbmVyLCB0b3BfbGVmdCk7XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICAvLyBUaWUgTGVhZmxldCBldmVudCBoYW5kbGVycyB0byBUYW5ncmFtIGZlYXR1cmUgc2VsZWN0aW9uXG4gICAgICAgICAgICBzZXR1cFNlbGVjdGlvbkV2ZW50SGFuZGxlcnM6IGZ1bmN0aW9uIChtYXApIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9zZWxlY3Rpb25fZXZlbnRzID0ge307XG5cbiAgICAgICAgICAgICAgICB0aGlzLmhvb2tzLmNsaWNrID0gKGV2ZW50KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdGhpcy5fc2VsZWN0aW9uX2V2ZW50cy5jbGljayA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zY2VuZS5nZXRGZWF0dXJlQXQoZXZlbnQuY29udGFpbmVyUG9pbnQpLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZW4oc2VsZWN0aW9uID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3VsdHMgPSBPYmplY3QuYXNzaWduKHt9LCBzZWxlY3Rpb24sIHsgbGVhZmxldF9ldmVudDogZXZlbnQgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX3NlbGVjdGlvbl9ldmVudHMuY2xpY2socmVzdWx0cyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIG1hcC5vbignY2xpY2snLCB0aGlzLmhvb2tzLmNsaWNrKTtcblxuICAgICAgICAgICAgICAgIHRoaXMuaG9va3MubW91c2Vtb3ZlID0gKGV2ZW50KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdGhpcy5fc2VsZWN0aW9uX2V2ZW50cy5ob3ZlciA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zY2VuZS5nZXRGZWF0dXJlQXQoZXZlbnQuY29udGFpbmVyUG9pbnQpLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZW4oc2VsZWN0aW9uID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3VsdHMgPSBPYmplY3QuYXNzaWduKHt9LCBzZWxlY3Rpb24sIHsgbGVhZmxldF9ldmVudDogZXZlbnQgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX3NlbGVjdGlvbl9ldmVudHMuaG92ZXIocmVzdWx0cyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIG1hcC5vbignbW91c2Vtb3ZlJywgdGhpcy5ob29rcy5tb3VzZW1vdmUpO1xuXG4gICAgICAgICAgICAgICAgdGhpcy5ob29rcy5tb3VzZW91dCA9IChldmVudCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAvLyBXaGVuIG1vdXNlIGxlYXZlcyBtYXAsIHNlbmQgYW4gYWRkaXRpb25hbCBzZWxlY3Rpb24gZXZlbnQgdG8gaW5kaWNhdGUgbm8gZmVhdHVyZSBpcyBzZWxlY3RlZFxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHRoaXMuX3NlbGVjdGlvbl9ldmVudHMuaG92ZXIgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX3NlbGVjdGlvbl9ldmVudHMuaG92ZXIoeyBjaGFuZ2VkOiB0cnVlLCBsZWFmbGV0X2V2ZW50OiBldmVudCB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgbWFwLm9uKCdtb3VzZW91dCcsIHRoaXMuaG9va3MubW91c2VvdXQpO1xuICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgLy8gU2V0IHVzZXItZGVmaW5lZCBoYW5kbGVycyBmb3IgZmVhdHVyZSBz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gICAgICAgIC8vIFVuIHJvbGwgdGhlIGxvb3Agb2YgaW5kaXZpZHVhbCBsaWd0aHMgdG8gY2FsY3VsYXRlXG4gICAgICAgICAgICAgICAgJHtjYWxjdWxhdGVMaWdodHN9XG5cbiAgICAgICAgICAgICAgICAvLyAgRmluYWwgbGlnaHQgaW50ZW5zaXR5IGNhbGN1bGF0aW9uXG4gICAgICAgICAgICAgICAgdmVjNCBjb2xvciA9IHZlYzQoMC4wKTtcblxuICAgICAgICAgICAgICAgIC8vIEtlZXAgbWF0ZXJpYWwgYWxwaGEgY2hhbm5lbCB3aGVuIGFscGhhIGJsZW5kaW5nIGlzIG9uXG4gICAgICAgICAgICAgICAgI2lmICFkZWZpbmVkKFRBTkdSQU1fQkxFTkRfT1BBUVVFKVxuICAgICAgICAgICAgICAgICAgICAjaWZkZWYgVEFOR1JBTV9NQVRFUklBTF9FTUlTU0lPTlxuICAgICAgICAgICAgICAgICAgICAgICAgY29sb3IgPSBtYXRlcmlhbC5lbWlzc2lvbjtcbiAgICAgICAgICAgICAgICAgICAgI2VuZGlmXG5cbiAgICAgICAgICAgICAgICAgICAgI2lmZGVmIFRBTkdSQU1fTUFURVJJQUxfQU1CSUVOVFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sb3IgKz0gbGlnaHRfYWNjdW11bGF0b3JfYW1iaWVudCAqIF9jb2xvciAqIG1hdGVyaWFsLmFtYmllbnQ7XG4gICAgICAgICAgICAgICAgICAgICNlbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICAjaWZkZWYgVEFOR1JBTV9NQVRFUklBTF9ESUZGVVNFXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3IgKz0gbGlnaHRfYWNjdW11bGF0b3JfYW1iaWVudCAqIF9jb2xvciAqIG1hdGVyaWFsLmRpZmZ1c2U7XG4gICAgICAgICAgICAgICAgICAgICAgICAjZW5kaWZcbiAgICAgICAgICAgICAgICAgICAgI2VuZGlmXG5cbiAgICAgICAgICAgICAgICAgICAgI2lmZGVmIFRBTkdSQU1fTUFURVJJQUxfRElGRlVTRVxuICAgICAgICAgICAgICAgICAgICAgICAgY29sb3IgKz0gbGlnaHRfYWNjdW11bGF0b3JfZGlmZnVzZSAqIF9jb2xvciAqIG1hdGVyaWFsLmRpZmZ1c2U7XG4gICAgICAgICAgICAgICAgICAgICNlbmRpZlxuXG4gICAgICAgICAgICAgICAgICAgICNpZmRlZiBUQU5HUkFNX01BVEVSSUFMX1NQRUNVTEFSXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xvciArPSBsaWdodF9hY2N1bXVsYXRvcl9zcGVjdWxhciAqIG1hdGVyaWFsLnNwZWN1bGFyO1xuICAgICAgICAgICAgICAgICAgICAjZW5kaWZcbiAgICAgICAgICAgICAgICAvLyBNdWx0aXBseSBtYXRlcmlhbCBhbHBoYSBjaGFubmVsIGludG8gbWF0ZXJpYWwgUkdCIHdoZW4gYWxwaGEgYmxlbmRpbmcgaXMgb2ZmXG4gICAgICAgICAgICAgICAgI2Vsc2VcbiAgICAgICAgICAgICAgICAgICAgY29sb3IuYSA9IF9jb2xvci5hOyAvLyB1c2UgdmVydGV4IGNvbG9yIGFscGhhXG5cbiAgICAgICAgICAgICAgICAgICAgI2lmZGVmIFRBTkdSQU1fTUFURVJJQUxfRU1JU1NJT05cbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yLnJnYiA9IG1hdGVyaWFsLmVtaXNzaW9uLnJnYiAqIG1hdGVyaWFsLmVtaXNzaW9uLmE7XG4gICAgICAgICAgICAgICAgICAgICNlbmRpZlxuXG4gICAgICAgICAgICAgICAgICAgICNpZmRlZiBUQU5HUkFNX01BVEVSSUFMX0FNQklFTlRcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yLnJnYiArPSBsaWdodF9hY2N1bXVsYXRvcl9hbWJpZW50LnJnYiAqIF9jb2xvci5yZ2IgKiBtYXRlcmlhbC5hbWJpZW50LnJnYiAqIG1hdGVyaWFsLmFtYmllbnQuYTtcbiAgICAgICAgICAgICAgICAgICAgI2Vsc2VcbiAgICAgICAgICAgICAgICAgICAgICAgICNpZmRlZiBUQU5HUkFNX01BVEVSSUFMX0RJRkZVU0VcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvci5yZ2IgKz0gbGlnaHRfYWNjdW11bGF0b3JfYW1iaWVudC5yZ2IgKiBfY29sb3IucmdiICogbWF0ZXJpYWwuZGlmZnVzZS5yZ2IgKiBtYXRlcmlhbC5kaWZmdXNlLmE7XG4gICAgICAgICAgICAgICAgICAgICAgICAjZW5kaWZcbiAgICAgICAgICAgICAgICAgICAgI2VuZGlmXG5cbiAgICAgICAgICAgICAgICAgICAgI2lmZGVmIFRBTkdSQU1fTUFURVJJQUxfRElGRlVTRVxuICAgICAgICAgICAgICAgICAgICAgICAgY29sb3IucmdiICs9IGxpZ2h0X2FjY3VtdWxhdG9yX2RpZmZ1c2UucmdiICogX2NvbG9yLnJnYiAqIG1hdGVyaWFsLmRpZmZ1c2UucmdiICogbWF0ZXJpYWwuZGlmZnVzZS5hO1xuICAgICAgICAgICAgICAgICAgICAjZW5kaWZcblxuICAgICAgICAgICAgICAgICAgICAjaWZkZWYgVEFOR1JBTV9NQVRFUklBTF9TUEVDVUxBUlxuICAgICAgICAgICAgICAgICAgICAgICAgY29sb3IucmdiICs9IGxpZ2h0X2FjY3VtdWxhdG9yX3NwZWN1bGFyLnJnYiAqIG1hdGVyaWFsLnNwZWN1bGFyLnJnYiAqIG1hdGVyaWFsLnNwZWN1bGFyLmE7XG4gICAgICAgICAgICAgICAgICAgICNlbmRpZlxuICAgICAgICAgICAgICAgICNlbmRpZlxuXG4gICAgICAgICAgICAgICAgLy8gQ2xhbXAgZmluYWwgY29sb3JcbiAgICAgICAgICAgICAgICBjb2xvciA9IGNsYW1wKGNvbG9yLCAwLjAsIDEuMCk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gY29sb3I7XG4gICAgICAgICAgICB9YDtcblxuICAgICAgICBTaGFkZX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SlcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAodHlwZW9mIHZhbHVlID09PSAnbnVtYmVyJyB8fCBBcnJheS5pc0FycmF5KHZhbHVlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzW3Byb3BdID0geyBhbW91bnQ6IEdMU0wuZXhwYW5kVmVjNCh2YWx1ZSkgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAodHlwZW9mIHZhbHVlID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzW3Byb3BdID0geyBhbW91bnQ6IFN0eWxlUGFyc2VyLnBhcnNlQ29sb3IodmFsdWUpIH07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aGlzW3Byb3BdID0gdmFsdWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gRXh0cmEgc3BlY3VsYXIgcHJvcHNcbiAgICAgICAgaWYgKHRoaXMuc3BlY3VsYXIpIHtcbiAgICAgICAgICAgIHRoaXMuc3BlY3VsYXIuc2hpbmluZXNzID0gY29uZmlnLnNoaW5pbmVzcyA/IHBhcnNlRmxvYXQoY29uZmlnLnNoaW5pbmVzcykgOiAwLjI7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBOb3JtYWwgbWFwcGluZ1xuICAgICAgICBpZiAoY29uZmlnLm5vcm1hbCAhPSBudWxsKSB7XG4gICAgICAgICAgICB0aGlzLm5vcm1hbCA9IHtcbiAgICAgICAgICAgICAgICB0ZXh0dXJlOiBjb25maWcubm9ybWFsLnRleHR1cmUsXG4gICAgICAgICAgICAgICAgbWFwcGluZzogY29uZmlnLm5vcm1hbC5tYXBwaW5nIHx8ICd0cmlwbGFuYXInLFxuICAgICAgICAgICAgICAgIHNjYWxlOiBHTFNMLmV4cGFuZFZlYzMoY29uZmlnLm5vcm1hbC5zY2FsZSAhPSBudWxsID8gY29uZmlnLm5vcm1hbC5zY2FsZSA6IDEpLFxuICAgICAgICAgICAgICAgIGFtb3VudDogY29uZmlnLm5vcm1hbC5hbW91bnQgIT0gbnVsbCA/IGNvbmZpZy5ub3JtYWwuYW1vdW50IDogMVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIERldGVybWluZSBpZiBhIG1hdGVyaWFsIGNvbmZpZyBibG9jayBoYXMgc3VmZmljaWVudCBwcm9wZXJ0aWVzIHRvIGNyZWF0ZSBhIG1hdGVyaWFsXG4gICAgc3RhdGljIGlzVmFsaWQgKGNvbmZpZykge1xuICAgICAgICBpZiAoY29uZmlnID09IG51bGwpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjb25maWcuZW1pc3Npb24gPT0gbnVsbCAmJlxuICAgICAgICAgICAgY29uZmlnLmFtYmllbnQgPT0gbnVsbCAmJlxuICAgICAgICAgICAgY29uZmlnLmRpZmZ1c2UgPT0gbnVsbCAmJlxuICAgICAgICAgICAgY29uZmlnLnNwZWN1bGFyID09IG51bGwpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIGluamVjdCAoc3R5bGUpIHtcbiAgICAgICAgLy8gRm9yIGVhY2ggcHJvcGVydHksIHNldHMgZGVmaW5lcyB0byBjb25maWd1cmUgdGV4dHVyZSBtYXBwaW5nLCB3aXRoIGEgcGF0dGVybiBsaWtlOlxuICAgICAgICAvLyAgIFRBTkdSQU1fTUFURVJJQUxfRElGRlVTRSwgVEFOR1JBTV9NQVRFUklBTF9ESUZGVVNFX1RFWFRVUkUsIFRBTkdSQU1fTUFURVJJQUxfRElGRlVTRV9URVhUVVJFX1NQSE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faW46IHRydWUgfSk7XG4gICAgICAgICAgICB9KS50aGVuKCgpID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLnVwZGF0aW5nLS07XG4gICAgICAgICAgICAgICAgdGhpcy5pbml0aWFsaXppbmcgPSBudWxsO1xuICAgICAgICAgICAgICAgIHRoaXMuaW5pdGlhbGl6ZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHRoaXMubGFzdF92YWxpZF9jb25maWdfc291cmNlID0gdGhpcy5jb25maWdfc291cmNlO1xuICAgICAgICAgICAgICAgIHRoaXMubGFzdF92YWxpZF9jb25maWdfcGF0aCA9IHRoaXMuY29uZmlnX3BhdGg7XG5cbiAgICAgICAgICAgICAgICBpZiAodGhpcy5yZW5kZXJfbG9vcCAhPT0gZmFsc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXR1cFJlbmRlckxvb3AoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5yZXF1ZXN0UmVkcmF3KCk7XG4gICAgICAgIH0pLmNhdGNoKGVycm9yID0+IHtcbiAgICAgICAgICAgIHRoaXMuaW5pdGlhbGl6aW5nID0gbnVsbDtcbiAgICAgICAgICAgIHRoaXMudXBkYXRpbmcgPSAwO1xuXG4gICAgICAgICAgICAvLyBSZXBvcnQgYW5kIHJldmVydCB0byBsYXN0IHZhbGlkIGNvbmZpZyBpZiBhdmFpbGFibGVcbiAgICAgICAgICAgIGxldCB0eXBlLCBtZXNzYWdlO1xuICAgICAgICAgICAgaWYgKGVycm9yLm5hbWUgPT09ICdZQU1MRXhjZXB0aW9uJykge1xuICAgICAgICAgICAgICAgIHR5cGUgPSAneWFtbCc7XG4gICAgICAgICAgICAgICAgbWVzc2FnZSA9ICdFcnJvciBwYXJzaW5nIHNjZW5lIFlBTUwnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gVE9ETzogbW9yZSBlcnJvciB0eXBlc1xuICAgICAgICAgICAgICAgIG1lc3NhZ2UgPSAnRXJyb3IgaW5pdGlhbGl6aW5nIHNjZW5lJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMudHJpZ2dlcignZXJyb3InLCB7IHR5cGUsIG1lc3NhZ2UsIGVycm9yLCB1cmw6IHRoaXMuY29uZmlnX3NvdXJjZSB9KTtcblxuICAgICAgICAgICAgbWVzc2FnZSA9IGBTY2VuZS5sb2FkKCkgZmFpbGVkIHRvIGxvYWQgJHt0aGlzLmNvbmZpZ19zb3VyY2V9OiAke2Vycm9yLm1lc3NhZ2V9YDtcbiAgICAgICAgICAgIGlmICh0aGlzLmxhc3RfdmFsaWRfY29uZmlnX3NvdXJjZSkge1xuICAgICAgICAgICAgICAgIGxvZygnd2FybicsIG1lc3NhZ2UsIGVycm9yKTtcbiAgICAgICAgICAgICAgICBsb2coJ2luZm8nLCBgU2NlbmUubG9hZCgpIHJldmVydGluZyB0byBsYXN0IHZhbGlkIGNvbmZpZ3VyYXRpb25gKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5sb2FkKHRoaXMubGFzdF92YWxpZF9jb25maWdfc291cmNlLCB0aGlzLmxhc3RfdmFsaWRfY29uZmlnX3BhdGgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbG9nKCdlcnJvcicsIG1lc3NhZ2UsIGVycm9yKTtcbiAgICAgICAgICAgIHRocm93IGVycm9yO1xuICAgICAgICB9KTtcblxuICAgICAgICByZXR1cm4gdGhpcy5pbml0aWFsaXppbmc7XG4gICAgfVxuXG4gICAgLy8gRm9yIEFQSSBjb21wYXRpYmlsaXR5XG4gICAgcmVsb2FkKGNvbmZpZ19zb3VyY2UgPSBudWxsLCBjb25maWdfcGF0aCA9IG51bGwpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubG9hZChjb25maWdfc291cmNlLCBjb25maWdfcGF0aCk7XG4gICAgfVxuXG4gICAgZGVzdHJveSgpIHtcbiAgICAgICAgdGhpcy5pbml0aWFsaXplZCA9IGZhbHNlO1xuICAgICAgICB0aGlzLnJlbmRlcl9sb29wX3N0b3AgPSB0cnVlOyAvLyBzY2hlZHVsZSByZW5kZXIgbG9vcCB0byBzdG9wXG5cbiAgICAgICAgdGhpcy5kZXN0cm95TGlzdGVuZXJzKCk7XG5cbiAgICAgICAgaWYgKHRoaXMuY2FudmFzICYmIHRoaXMuY2FudmFzLnBhcmVudE5vZGUpIHtcbiAgICAgICAgICAgIHRoaXMuY2FudmFzLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQodGhpcy5jYW52YXMpO1xuICAgICAgICAgICAgdGhpcy5jYW52YXMgPSBudWxsO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuY29udGFpbmVyID0gbnVsbDtcblxuICAgICAgICBpZiAodGhpcy5zZWxlY3Rpb24pIHtcbiAgICAgICAgICAgIHRoaXMuc2VsZWN0aW9uLmRlc3Ryb3koKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmdsKSB7XG4gICAgICAgICAgICBUZXh0dXJlLmRlc3Ryb3kodGhpcy5nbCk7XG4gICAgICAgICAgICB0aGlzLnN0eWxlX21hbmFnZXIuZGVzdHJveSh0aGlzLmdsKTtcbiAgICAgICAgICAgIHRoaXMuc3R5bGVzID0ge307XG5cbiAgICAgICAgICAgIC8vIEZvcmNlIGNvbnRleHQgbG9zc1xuICAgICAgICAgICAgbGV0IGV4dCA9IHRoaXMuZ2wuZ2V0RXh0ZW5zaW9uKCdXRUJHTF9sb3NlX2NvbnRleHQnKTtcbiAgICAgICAgICAgIGlmIChleHQpIHtcbiAgICAgICAgICAgICAgICBleHQubG9zZUNvbnRleHQoKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5nbCA9IG51bGw7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnNvdXJjZXMgPSB7fTtcblxuICAgICAgICB0aGlzLmRlc3Ryb3lXb3JrZXJzKCk7XG4gIC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XZlbCwgVXRpbHMuZGV2aWNlX3BpeGVsX3JhdGlvKS50aGVuKFxuICAgICAgICAgICAgICAgIChpZCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBsb2coJ2RlYnVnJywgYFNjZW5lLm1ha2VXb3JrZXJzOiBpbml0aWFsaXplZCB3b3JrZXIgJHtpZH1gKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlkO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgKGVycm9yKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGxvZygnZXJyb3InLCBgU2NlbmUubWFrZVdvcmtlcnM6IGZhaWxlZCB0byBpbml0aWFsaXplIHdvcmtlciAke19pZH06YCwgZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZWplY3QoZXJyb3IpO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICApO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5uZXh0X3dvcmtlciA9IDA7XG4gICAgICAgIHJldHVybiBQcm9taXNlLmFsbChxdWV1ZSkudGhlbigoKSA9PiB7XG4gICAgICAgICAgICBsb2cuc2V0V29ya2Vycyh0aGlzLndvcmtlcnMpO1xuXG4gICAgICAgICAgICAvLyBMZXQgVmVydGV4RWxlbWVudHMga25vdyBpZiAzMiBiaXQgaW5kaWNlcyBmb3IgZWxlbWVudCBhcnJheXMgYXJlIGF2YWlsYWJsZVxuICAgICAgICAgICAgbGV0IFVpbnQzMl9mbGFnID0gdGhpcy5nbC5nZXRFeHRlbnNpb24oXCJPRVNfZWxlbWVudF9pbmRleF91aW50XCIpID8gdHJ1ZSA6IGZhbHNlO1xuICAgICAgICAgICAgV29ya2VyQnJva2VyLnBvc3RNZXNzYWdlKHRoaXMud29ya2VycywgJ1ZlcnRleEVsZW1lbnRzLnNldFVpbnQzMkZsYWcnLCBVaW50MzJfZmxhZyk7XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGRlc3Ryb3lXb3JrZXJzKCkge1xuICAgICAgICBpZiAoQXJyYXkuaXNBcnJheSh0aGlzLndvcmtlcnMpKSB7XG4gICAgICAgICAgICBsb2cuc2V0V29ya2VycyhudWxsKTtcbiAgICAgICAgICAgIHRoaXMud29ya2Vycy5mb3JFYWNoKCh3b3JrZXIpID0+IHtcbiAgICAgICAgICAgICAgICB3b3JrZXIudGVybWluYXRlKCk7XG4gICAgICAgICAgICAgICAgV29ya2VyQnJva2VyLnJlbW92ZVdvcmtlcih3b3JrZXIpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB0aGlzLndvcmtlcnMgPSBudWxsO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gUm91bmQgcm9iaW4gc2VsZWN0aW9uIG9mIG5leHQgd29ya2VyXG4gICAgbmV4dFdvcmtlcigpIHtcbiAgICAgICAgdmFyIHdvcmtlciA9IHRoaXMud29ya2Vyc1t0aGlzLm5leHRfd29ya2VyXTtcbiAgICAgICAgdGhpcy5uZXh0X3dvcmtlciA9ICh0aGlzLm5leHRfd29ya2VyICsgMSkgJSB0aGlzLndvcmtlcnMubGVuZ3RoO1xuICAgICAgICByZXR1cm4gd29ya2VyO1xuICAgIH1cblxuICAgIC8vIFNjZW5lIGlzIHJlYWR5IGZvciByZW5kZXJpbmdcbiAgICByZWFkeSgpIHtcbiAgICAgICAgaWYgKCF0aGlzLnZpZXcucmVhZHkoKSB8fCBPYmplY3Qua2V5cyh0aGlzLnNvdXJjZXMpLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9XG5cbiAgICAvLyBSZXNpemUgdGhlIG1hcCB3aGVuIGRldmljZSBwaXhlbCByYXRpbyBjaGFuZ2VzLCBlLmcuIHdoZW4gc3dpdGNoaW5nIGJldHdlZW4gZGlzcGxheXNcbiAgICB1cGRhdGVEZXZpY2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VzLmxlbmd0aDsgdCsrKSB7XG4gICAgICAgICAgICBsZXQgdGlsZSA9IHRoaXMucmVuZGVyYWJsZV90aWxlc1t0XTtcblxuICAgICAgICAgICAgaWYgKHRpbGUubWVzaGVzW3N0eWxlXSA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIFN0eWxlLXNwZWNpZmljIHN0YXRlXG4gICAgICAgICAgICAvLyBPbmx5IHNldHVwIHN0eWxlIGlmIHJlbmRlcmluZyBmb3IgZmlyc3QgdGltZSB0aGlzIGZyYW1lXG4gICAgICAgICAgICAvLyAobGF6eSBpbml0LCBub3QgYWxsIHN0eWxlcyB3aWxsIGJlIHVzZWQgaW4gYWxsIHNjcmVlbiB2aWV3czsgc29tZSBzdHlsZXMgbWlnaHQgYmUgZGVmaW5lZCBidXQgbmV2ZXIgdXNlZClcbiAgICAgICAgICAgIGlmIChmaXJzdF9mb3Jfc3R5bGUgPT09IHRydWUpIHtcbiAgICAgICAgICAgICAgICBmaXJzdF9mb3Jfc3R5bGUgPSBmYWxzZTtcblxuICAgICAgICAgICAgICAgIHByb2dyYW0udXNlKCk7XG4gICAgICAgICAgICAgICAgdGhpcy5zdHlsZXNbc3R5bGVdLnNldHVwKCk7XG5cbiAgICAgICAgICAgICAgICBwcm9ncmFtLnVuaWZvcm0oJzFmJywgJ3VfdGltZScsIHRoaXMuYW5pbWF0ZWQgPyAoKCgrbmV3IERhdGUoKSkgLSB0aGlzLnN0YXJ0X3RpbWUpIC8gMTAwMCkgOiAwKTtcbiAgICAgICAgICAgICAgICB0aGlzLnZpZXcuc2V0dXBQcm9ncmFtKHByb2dyYW0pO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgaW4gdGhpcy5saWdodHMpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5saWdodHNbaV0uc2V0dXBQcm9ncmFtKHByb2dyYW0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gU2tpcCBwcm94eSB0aWxlcyBpZiBuZXcgdGlsZXMgaGF2ZSBmaW5pc2hlZCBsb2FkaW5nIHRoaXMgc3R5bGVcbiAgICAgICAgICAgIGlmICghdGlsZS5zaG91bGRQcm94eUZvclN0eWxlKHN0eWxlKSkge1xuICAgICAgICAgICAgICAgIC8vIGxvZygndHJhY2UnLCBgU2NlbmUucmVuZGVyU3R5bGUoKTogU2tpcCBwcm94eSB0aWxlIGZvciBzdHlsZSAnJHtzdHlsZX0nIGAsIHRpbGUsIHRpbGUucHJveHlfZm9yKTtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gVGlsZS1zcGVjaWZpYyBzdGF0ZVxuICAgICAgICAgICAgdGhpcy52aWV3LnNldHVwVGlsZSh0aWxlLCBwcm9ncmFtKTtcblxuICAgICAgICAgICAgLy8gUmVuZGVyIHRpbGVcbiAgICAgICAgICAgIGlmICh0aGlzLnN0eWxlc1tzdHlsZV0ucmVuZGVyKHRpbGUubWVzaGVzW3N0eWxlXSkpIHtcbiAgICAgICAgICAgICAgICAvLyBEb24ndCBpbmN1ciBhZGRpdGlvbmFsIHJlbmRlcnMgd2hpbGUgdmlld3BvcnQgaXMgbW92aW5nXG4gICAgICAgICAgICAgICAgaWYgKCEodGhpcy52aWV3LnBhbm5pbmcgfHwgdGhpcy52aWV3Lnpvb21pbmcpKSB7XG4gICAgICAgICAgICAgICAgICAgdGhpcy5yZXF1ZXN0UmVkcmF3KCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVuZGVyX2NvdW50ICs9IHRpbGUubWVzaGVzW3N0eWxlXS5nZW9tZXRyeV9jb3VudDtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiByZW5kZXJfY291bnQ7XG4gICAgfVxuXG4gICAgY2xlYXJGcmFtZSh7IGNsZW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YWxwaGE6IGdsLk9ORV9NSU5VU19TUkNfQUxQSEFcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIEFkZGl0aXZlIGJsZW5kaW5nXG4gICAgICAgICAgICBlbHNlIGlmIChibGVuZCA9PT0gJ2FkZCcpIHtcbiAgICAgICAgICAgICAgICByZW5kZXJfc3RhdGVzLmJsZW5kaW5nLnNldCh7XG4gICAgICAgICAgICAgICAgICAgIGJsZW5kOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICBzcmM6IGdsLk9ORSwgZHN0OiBnbC5PTkUsXG4gICAgICAgICAgICAgICAgICAgIHNyY19hbHBoYTogZ2wuT05FLCBkc3RfYWxwaGE6IGdsLk9ORV9NSU5VU19TUkNfQUxQSEFcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIE11bHRpcGxpY2F0aXZlIGJsZW5kaW5nXG4gICAgICAgICAgICBlbHNlIGlmIChibGVuZCA9PT0gJ211bHRpcGx5Jykge1xuICAgICAgICAgICAgICAgIHJlbmRlcl9zdGF0ZXMuYmxlbmRpbmcuc2V0KHtcbiAgICAgICAgICAgICAgICAgICAgYmxlbmQ6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgIHNyYzogZ2wuWkVSTywgZHN0OiBnbC5TUkNfQ09MT1IsXG4gICAgICAgICAgICAgICAgICAgIHNyY19hbHBoYTogZ2wuT05FLCBkc3RfYWxwaGE6IGdsLk9ORV9NSU5VU19TUkNfQUxQSEFcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJlbmRlcl9zdGF0ZXMuYmxlbmRpbmcuc2V0KHsgYmxlbmQ6IGZhbHNlIH0pO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gUmVxdWVzdCBmZWF0dXJlIHNlbGVjdGlvbiBhdCB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kge1xuICAgICAgICAgICAgICAgICAgICAvLyBub3RpZnkgcHJldmlvdXMgcmVxdWVzdCB0aGF0IGl0IGRpZCBub3QgY29tcGxldGVcbiAgICAgICAgICAgICAgICAgICAgbG9nKCdkZWJ1ZycsICdTY2VuZS5yZWJ1aWxkOiByZXF1ZXN0IHN1cGVyY2VkZWQgYnkgYSBuZXdlciBjYWxsJyk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYnVpbGRpbmcucXVldWVkLnJlc29sdmUoZmFsc2UpOyAvLyBmYWxzZSBmbGFnIGluZGljYXRlcyByZWJ1aWxkIHJlcXVlc3Qgd2FzIHN1cGVyY2VkZWRcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBTYXZlIHF1ZXVlZCByZXF1ZXN0XG4gICAgICAgICAgICAgICAgdGhpcy5idWlsZGluZy5xdWV1ZWQgPSB7IHJlc29sdmUsIHJlamVjdCB9O1xuICAgICAgICAgICAgICAgIGxvZygndHJhY2UnLCBgU2NlbmUucmVidWlsZCgpOiBxdWV1aW5nIHJlcXVlc3RgKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIFRyYWNrIHRpbGUgYnVpbGQgc3RhdGVcbiAgICAgICAgICAgIHRoaXMuYnVpbGRpbmcgPSB7IHJlc29sdmUsIHJlamVjdCB9O1xuXG4gICAgICAgICAgICAvLyBQcm9maWxpbmdcbiAgICAgICAgICAgIGlmIChwcm9maWxlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fcHJvZmlsZSgnU2NlbmUucmVidWlsZCcpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBVcGRhdGUgY29uZmlnIChpbiBjYXNlIEpTIG9iamVjdHMgd2VyZSBtYW5pcHVsYXRlZCBkaXJlY3RseSlcbiAgICAgICAgICAgIGlmIChzeW5jKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zeW5jQ29uZm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ZmlnLnNvdXJjZXNbbmFtZV0gPSBPYmplY3QuYXNzaWduKHt9LCBjb25maWcpO1xuXG4gICAgICAgIGlmIChzb3VyY2UuZGF0YSAmJiB0eXBlb2Ygc291cmNlLmRhdGEgPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICBzb3VyY2UudXJsID0gVXRpbHMuY3JlYXRlT2JqZWN0VVJMKG5ldyBCbG9iKFtKU09OLnN0cmluZ2lmeShzb3VyY2UuZGF0YSldKSk7XG4gICAgICAgICAgICBkZWxldGUgc291cmNlLmRhdGE7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobG9hZCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMudXBkYXRlQ29uZmlnKHsgcmVidWlsZDogeyBzb3VyY2VzOiBbbmFtZV0gfSB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnJlYnVpbGQoeyBzb3VyY2VzOiBbbmFtZV0gfSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBjcmVhdGVEYXRhU291cmNlcygpIHtcbiAgICAgICAgbGV0IHJlc2V0ID0gW107IC8vIHNvdXJjZXMgdG8gcmVzZXRcbiAgICAgICAgbGV0IHByZXZfc291cmNlX25hbWVzID0gT2JqZWN0LmtleXModGhpcy5zb3VyY2VzKTtcblxuICAgICAgICBmb3IgKHZhciBuYW1lIGluIHRoaXMuY29uZmlnLnNvdXJjZXMpIHtcbiAgICAgICAgICAgIGxldCBzb3VyY2UgPSB0aGlzLmNvbmZpZy5zb3VyY2VzW25hbWVdO1xuICAgICAgICAgICAgbGV0IHByZXZfc291cmNlID0gdGhpcy5zb3VyY2VzW25hbWVdO1xuXG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHRoaXMuc291cmNlc1tuYW1lXSA9IERhdGFTb3VyY2UuY3JlYXRlKE9iamVjdC5hc3NpZ24oe30sIHNvdXJjZSwge25hbWV9KSwgdGhpcy5zb3VyY2VzKTtcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMuc291cmNlc1tuYW1lXSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyB7fTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXRjaChlKSB7XG4gICAgICAgICAgICAgICAgZGVsZXRlIHRoaXMuc291cmNlc1tuYW1lXTtcbiAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IGBDb3VsZCBub3QgY3JlYXRlIGRhdGEgc291cmNlOiAke2UubWVzc2FnZX1gO1xuICAgICAgICAgICAgICAgIGxvZygnd2FybicsIGBTY2VuZTogJHttZXNzYWdlfWAsIHNvdXJjZSk7XG4gICAgICAgICAgICAgICAgdGhpcy50cmlnZ2VyKCd3YXJuaW5nJywgeyB0eXBlOiAnc291cmNlcycsIHNvdXJjZSwgbWVzc2FnZSB9KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gRGF0YSBzb3VyY2UgY2hhbmdlZD9cbiAgICAgICAgICAgIGlmIChEYXRhU291cmNlLmNoYW5nZWQodGhpcy5zb3VyY2VzW25hbWVdLCBwcmV2X3NvdXJjZSkpIHtcbiAgICAgICAgICAgICAgICByZXNldC5wdXNoKG5hbWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gU291cmNlcyB0aGF0IHdlcmUgcmVtb3ZlZFxuICAgICAgICBmb3IgKGxldCBzIG9mIHByZXZfc291cmNlX25hbWVzKSB7XG4gICAgICAgICAgICBpZiAoIXRoaXMuY29uZmlnLnNvdXJjZXNbc10pIHtcbiAgICAgICAgICAgICAgICBkZWxldGUgdGhpcy5zb3VyY2VzW3NdOyAvLyBUT0RPOiByZW1vdmUgZnJvbSB3b3JrZXJzIHRvbz9cbiAgICAgICAgICAgICAgICByZXNldC5wdXNoKHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gUmVtb3ZlIHRpbGVzI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biAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9wdGlvbmFsIGFkZGl0aW9uYWwgb3V0bGluZSBzdHlsZVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGdyb3VwLm91dGxpbmUgJiYgZ3JvdXAub3V0bGluZS5zdHlsZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlcy5wdXNoKGdyb3VwLm91dGxpbmUuc3R5bGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBzdHlsZXMgPSBzdHlsZXMuZmlsdGVyKHggPT4gdGhpcy5zdHlsZXNbeF0pLmZvckVhY2goc3R5bGVfbmFtZSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN0eWxlID0gdGhpcy5zdHlsZXNbc3R5bGVfbmFtZV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0eWxlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuYWN0aXZlX3N0eWxlc1tzdHlsZV9uYW1lXSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdHlsZS5hbmltYXRlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0ZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBVc2UgZXhwbGljaXRseSBzZXQgc2NlbmUgYW5pbWF0aW9uIGZsYWcgaWYgZGVmaW5lZCwgb3RoZXJ3aXNlIHR1cm4gb24gYW5pbWF0aW9uXG4gICAgICAgIC8vIGlmIHRoZXJlIGFy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ICMgb2YgdGltZXMgYW5kIHByaW50IGF2ZXJhZ2UsIG1pbiwgbWF4IHRpbWluZ3NcbiAgICAgICAgICAgIHRpbWVSZWJ1aWxkIChudW0gPSAxLCBvcHRpb25zID0ge30pIHtcbiAgICAgICAgICAgICAgICBsZXQgdGltZXMgPSBbXTtcbiAgICAgICAgICAgICAgICBsZXQgY3ljbGUgPSAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBzdGFydCA9ICtuZXcgRGF0ZSgpO1xuICAgICAgICAgICAgICAgICAgICBzY2VuZS5yZWJ1aWxkKG9wdGlvbnMpLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGltZXMucHVzaCgrbmV3IERhdGUoKSAtIHN0YXJ0KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRpbWVzLmxlbmd0aCA8IG51bSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN5Y2xlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXZnID0gfn4odGltZXMucmVkdWNlKChhLCBiKSA9PiBhICsgYikgLyB0aW1lcy5sZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZygnaW5mbycsIGBQcm9maWxlZCByZWJ1aWxkICR7bnVtfSB0aW1lczogJHthdmd9IGF2ZyAoJHtNYXRoLm1pbiguLi50aW1lcyl9IG1pbiwgJHtNYXRoLm1heCguLi50aW1lcyl9IG1heClgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBjeWNsZSgpO1xuICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgLy8gUmV0dXJuIGdlb21ldHJ5IGNvdW50cyBvZiB2aXNpYmxlIHRpbGVzLCBncm91cGVkIGJ5IHN0eWxlIG5hbWVcbiAgICAgICAgICAgIGdlb21ldHJ5Q291bnRCeVN0eWxlICgpIHtcbiAgICAgICAgICAgICAgICBsZXQgY291bnRzID0ge307XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgdGlsZSBvZiBzY2VuZS50aWxlX21hbmFnZXIuZ2V0UmVuZGVyYWJsZVRpbGVzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgc3R5bGUgaW4gdGlsZS5tZXNoZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50c1tzdHlsZV0gPSBjb3VudHNbc3R5bGVdIHx8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb3VudHNbc3R5bGVdICs9IHRpbGUubWVzaGVzW3N0eWxlXS5nZW9tZXRyeV9jb3VudDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gY291bnRzO1xuICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgZ2VvbWV0cnlDb3VudEJ5QmFzZVN0eWxlICgpIHtcbiAgICAgICAgICAgICAgICBsZXQgc3R5bGVfY291bnRzID0gc2NlbmUuZGVidWcuZ2VvbWV0cnlDb3VudEJ5U3R5bGUoKTtcbiAgICAgICAgICAgICAgICBsZXQgY291bnRzID0ge307XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgc3R5bGUgaW4gc3R5bGVfY291bnRzKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBiYXNlID0gc2NlbmUuc3R5bGVzW3N0eWxlXS5idWlsdF9pbiA/IHN0eWxlIDogc2NlbmUuc3R5bGVzW3N0eWxlXS5iYXNlO1xuICAgICAgICAgICAgICAgICAgICBjb3VudHNbYmFzZV0gPSBjb3VudHNbYmFzZV0gfHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY291bnRzW2Jhc2VdICs9IHN0eWxlX2NvdW50c1tzdHlsZV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haW5lcigpIHtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxufVxuXG5leHBvcnQgY2xhc3MgWmlwU2NlbmVCdW5kbGUgZXh0ZW5kcyBTY2VuZUJ1bmRsZSB7XG5cbiAgICBjb25zdHJ1Y3Rvcih1cmwsIHBhdGgsIHBhcmVudCkge1xuICAgICAgICBzdXBlcih1cmwsIHBhdGgsIHBhcmVudCk7XG4gICAgICAgIHRoaXMuemlwID0gbnVsbDtcbiAgICAgICAgdGhpcy5maWxlcyA9IHt9O1xuICAgICAgICB0aGlzLnJvb3QgPSBudWxsO1xuICAgICAgICB0aGlzLnBhdGggPSAnJztcbiAgICB9XG5cbiAgICBpc0NvbnRhaW5lcigpIHtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgbG9hZCgpIHtcbiAgICAgICAgdGhpcy56aXAgPSBuZXcgSlNaaXAoKTtcblxuICAgICAgICBpZiAodHlwZW9mIHRoaXMudXJsID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgcmV0dXJuIFV0aWxzLmlvKHRoaXMudXJsLCA2MDAwMCwgJ2FycmF5YnVmZmVyJylcbiAgICAgICAgICAgICAgICAudGhlbihib2R5ID0+IHRoaXMuemlwLmxvYWRBc3luYyhib2R5KSlcbiAgICAgICAgICAgICAgICAudGhlbigoKSA9PiB0aGlzLnBhcnNlWmlwRmlsZXMoKSlcbiAgICAgICAgICAgICAgICAudGhlbigoKSA9PiB0aGlzLmxvYWRSb290KCkpXG4gICAgICAgICAgICAgICAgLmNhdGNoKGUgPT4gUHJvbWlzZS5yZWplY3QoZSkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZSh0aGlzKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHVybEZvcih1cmwpIHtcbiAgICAgICAgaWYgKFV0aWxzLmlzUmVsYXRpdmVVUkwodXJsKSkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMudXJsRm9yWmlwRmlsZShVdGlscy5mbGF0dGVuUmVsYXRpdmVVUkwodXJsKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHN1cGVyLnVybEZvcih1cmwpO1xuICAgIH1cblxuICAgIHR5cGVGb3IodXJsKSB7XG4gICAgICAgIGlmIChVdGlscy5pc1JlbGF0aXZlVVJMKHVybCkpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnR5cGVGb3JaaXBGaWxlKHVybCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHN1cGVyLnR5cGVGb3IodXJsKTtcbiAgICB9XG5cbiAgICBsb2FkUm9vdCgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZmluZFJvb3QoKVxuICAgICAgICAgICAgLnRoZW4oKCkgPT4gVXRpbHMubG9hZFJlc291cmNlKHRoaXMudXJsRm9yWmlwRmlsZSh0aGlzLnJvb3QpKSk7XG4gICAgfVxuXG4gICAgZmluZFJvb3QoKSB7XG4gICAgICAgIC8vIFRoZXJlIG11c3QgYmUgYSBzaW5nbGUgWUFNTCBmaWxlIGF0IHRoZSB0b3AgbGV2ZWwgb2YgdGhlIHppcFxuICAgICAgICBjb25zdCB5YW1scyA9IE9iamVjdC5rZXlzKHRoaXMuZmlsZXMpXG4gICAgICAgICAgICAuZmlsdGVyKHBhdGggPT4gdGhpcy5maWxlc1twYXRoXS5kZXB0aCA9PT0gMClcbiAgICAgICAgICAgIC5maWx0ZXIocGF0aCA9PiBVdGlscy5leHRlbnNpb25Gb3JVUkwocGF0aCkgPT09ICd5YW1sJyk7XG5cbiAgICAgICAgaWYgKHlhbWxzLmxlbmd0aCA9PT0gMSkge1xuICAgICAgICAgICAgdGhpcy5yb290ID0geWFtbHNbMF07XG4gICAgICAgIH1cblxuICAgICAgICAvLyBObyByb290IGZvdW5kXG4gICAgICAgIGlmICghdGhpcy5yb290KSB7XG4gICAgICAgICAgICBsZXQgbXNnID0gYENvdWxkIG5vdCBmaW5kIHJvb3Qgc2NlbmUgZm9yIGJ1bmRsZSAnJHt0aGlzLnVybH0nOiBgO1xuICAgICAgICAgICAgbXNnICs9IGBUaGUgemlwIGFyY2hpdmUncyByb290IGxldmVsIG11c3QgY29udGFpbiBhIHNpbmdsZSBzY2VuZSBmaWxlIHdpdGggdGhlICcueWFtbCcgZXh0ZW5zaW9uLiBgO1xuICAgICAgICAgICAgaWYgKHlhbWxzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICBtc2cgKz0gYEZvdW5kIG11bHRpcGxlIFlBTUwgZmlsZXMgYXQgdGhlIHJvb3QgbGV2ZWw6ICR7eWFtbHMubWFwKHIgPT4gJ1xcJycgKyByICsgJ1xcJycgKS5qb2luKCcsICcpfS5gO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgbXNnICs9IGBGb3VuZCBOTyBZQU1MIGZpbGVzIGF0IHRoZSByb290IGxldmVsLmA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZWplY3QoRXJyb3IobXNnKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZSgpO1xuICAgIH1cblxuICAgIHBhcnNlWmlwRmlsZXMoKSB7XG4gICAgICAgIGxldCBwYXRocyA9IFtdO1xuICAgICAgICBsZXQgcXVldWUgPSBbXTtcbiAgICAgICAgdGhpcy56aXAuZm9yRWFjaCgocGF0aCwgZmlsZSkgPT4ge1xuICAgICAgICAgICAgaWYgKCFmaWxlLmRpcikge1xuICAgICAgICAgICAgICAgIHBhdGhzLnB1c2gocGF0aCk7XG4gICAgICAgICAgICAgICAgcXVldWUucHVzaChmaWxlLmFzeW5jKCdhcnJheWJ1ZmZlcicpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgcmV0dXJuIFByb21pc2UuYWxsKHF1ZXVlKS50aGVuKGRhdGEgPT4ge1xuICAgICAgICAgICAgZm9yIChsZXQgaT0wOyBpIDwgZGF0YS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBwYXRoID0gcGF0aHNbaV07XG4gICAgICAgICAgICAgICAgbGV0IGRlcHRoID0gcGF0aC5zcGxpdCgnLycpLmxlbmd0aCAtIDE7XG4gICAgICAgICAgICAgICAgdGhpcy5maWxlc1twYXRoXSA9IHtcbiAgICAgICAgICAgICAgICAgICAgZGF0YTogZGF0YVtpXSxcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogVXRpbHMuZXh0ZW5zaW9uRm9yVVJMKHBhdGgpLFxuICAgICAgICAgICAgICAgICAgICBkZXB0aFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHVybEZvclppcEZpbGUoZmlsZSkge1xuICAgICAgICBpZiAodGhpcy5maWxlc1tmaWxlXSkge1xuICAgICAgICAgICAgaWYgKCF0aGlzLmZpbGVzW2ZpbGVdLnVybCkge1xuICAgICAgICAgICAgICAgIHRoaXMuZmlsZXNbZmlsZV0udXJsID0gVXRpbHMuY3JlYXRlT2JqZWN0VVJMKG5ldyBCbG9iKFt0aGlzLmZpbGVzW2ZpbGVdLmRhdGFdKSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiB0aGlzLmZpbGVzW2ZpbGVdLnVybDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHR5cGVGb3JaaXBGaWxlKGZpbGUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZmlsZXNbZmlsZV0gJiYgdGhpcy5maWxlc1tmaWxlXS50eXBlO1xuICAgIH1cblxufVxuXG5leHBvcnQgZnVuY3Rpb24gY3JlYXRlU2NlbmVCdW5kbGUodXJsLCBwYXRoLCBwYXJlbnQsIHR5cGUgPSBudWxsKSB7XG4gICAgaWYgKHR5cGUgPT09ICd6aXAnIHx8ICh0eXBlb2Y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pb25cbiAgICAvLyAoZS5nLiBpbiBUYW5ncmFtIFBsYXksIHdoZW4gbW9kaWZpZWQgbG9jYWwgc2NlbmUgc2hvdWxkIHN0aWxsIHJlZmVyIHRvIG9yaWdpbmFsIHJlc291cmNlIFVSTHMpXG4gICAgbG9hZFNjZW5lUmVjdXJzaXZlKHsgdXJsLCBwYXRoLCB0eXBlIH0sIHBhcmVudCwgZXJyb3JzID0gW10pIHtcbiAgICAgICAgaWYgKCF1cmwpIHtcbiAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUoe30pO1xuICAgICAgICB9XG5cbiAgICAgICAgbGV0IGJ1bmRsZSA9IGNyZWF0ZVNjZW5lQnVuZGxlKHVybCwgcGF0aCwgcGFyZW50LCB0eXBlKTtcblxuICAgICAgICByZXR1cm4gYnVuZGxlLmxvYWQoKS50aGVuKGNvbmZpZyA9PiB7XG4gICAgICAgICAgICAvLyBhY2NlcHQgc2luZ2xlLXN0cmluZyBvciBhcnJheVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBjb25maWcuaW1wb3J0ID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGNvbmZpZy5pbXBvcnQgPSBbY29uZmlnLmltcG9ydF07XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICghQXJyYXkuaXNBcnJheShjb25maWcuaW1wb3J0KSkge1xuICAgICAgICAgICAgICAgIHRoaXMubm9ybWFsaXplKGNvbmZpZywgYnVuZGxlKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gY29uZmlnO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBDb2xsZWN0IFVSTHMgb2Ygc2NlbmVzIHRvIGltcG9ydFxuICAgICAgICAgICAgbGV0IGltcG9ydHMgPSBbXTtcbiAgICAgICAgICAgIGZvciAobGV0IHVybCBvZiBjb25maWcuaW1wb3J0KSB7XG4gICAgICAgICAgICAgICAgaW1wb3J0cy5wdXNoKGJ1bmRsZS5yZXNvdXJjZUZvcih1cmwpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRlbGV0ZSBjb25maWcuaW1wb3J0OyAvLyBkb24ndCB3YW50IHRvIG1lcmdlIHRoaXMgcHJvcGVydHlcblxuICAgICAgICAgICAgcmV0dXJuIFByb21pc2UuXG4gICAgICAgICAgICBhbGwoaW1wb3J0cy5tYXAocmVzb3VyY2UgPT4gdGhpcy5sb2FkU2NlbmVSZWN1cnNpdmUocmVzb3VyY2UsIGJ1bmRsZSwgZXJyb3JzKSkpLlxuICAgICAgICAgICAgICAgIHRoZW4oY29uZmlncyA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZyA9IG1lcmdlT2JqZWN0cyh7fSwgLi4uY29uZmlncywgY29uZmlnKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5ub3JtYWxpemUoY29uZmlnLCBidW5kbGUpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29uZmlnO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICB9KS5jYXRjaChlcnJvciA9PiB7XG4gICAgICAgICAgICAvLyBDb2xsZWN0IHNjZW5lIGxvYWQgZXJyb3JzIGFzIHdlIGdvXG4gICAgICAgICAgICBlcnJvci51cmwgPSB1cmw7XG4gICAgICAgICAgICBlcnJvcnMucHVzaChlcnJvcik7XG4gICAgICAgIH0pO1xuICAgIH0sXG5cbiAgICAvLyBOb3JtYWxpemUgcHJvcGVydGllcyB0aGF0IHNob3VsZCBiZSBhZGp1c3Qgd2l0aGluIGVhY2ggbG9jYWwgc2NlbmUgZmlsZSAodXN1YWxseSBieSBwYXRoKVxuICAgIG5vcm1hbGl6ZShjb25maWcsIGJ1bmRsZSkge1xuICAgICAgICB0aGlzLm5vcm1hbGl6ZURhdGFTb3VyY2VzKGNvbmZpZywgYnVuZGxlKTtcbiAgICAgICAgdGhpcy5ub3JtYWxpemVGb250cyhjb25maWcsIGJ1bmRsZSk7XG4gICAgICAgIHRoaXMubm9ybWFsaXplVGV4dHVyZXMoY29uZmlnLCBidW5kbGUpO1xuICAgICAgICByZXR1cm4gY29uZmlnO1xuICAgIH0sXG5cbiAgICAvLyBFeHBhbmQgcGF0aHMgZm9yIGRhdGEgc291cmNlXG4gICAgbm9ybWFsaXplRGF0YVNvdXJjZXMoY29uZmlnLCBidW5kbGUpIHtcbiAgICAgICAgY29uZmlnLnNvdXJjZXMgPSBjb25maWcuc291cmNlcyB8fCB7fTtcblxuICAgICAgICBmb3IgKGxldCBzb3VyY2Ugb2YgIFV0aWxzLnZhbHVlcyhjb25maWcuc291cmNlcykpIHtcbiAgICAgICAgICAgIHNvdXJjZS51cmwgPSBidW5kbGUudXJsRm9yKHNvdXJjZS51cmwpO1xuXG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShzb3VyY2Uuc2NyaXB0cykpIHtcbiAgICAgICAgICAgICAgICBzb3VyY2Uuc2NyaXB0cyA9IHNvdXJjZS5zY3JpcHRzLm1hcCh1cmwgPT4gYnVuZGxlLnVybEZvcih1cmwpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBjb25maWc7XG4gICAgfSxcblxuICAgIC8vIEV4cGFuZCBwYXRocyBmb3IgZm9udHNcbiAgICBub3JtYWxpemVGb250cyhjb25maWcsIGJ1bmRsZSkge1xuICAgICAgICBjb25maWcuZm9udHMgPSBjb25maWcuZm9udHMgfHwge307XG5cbiAgICAgICAgZm9yIChsZXQgdmFsIG9mIFV0aWxzLnJlY3Vyc2VWYWx1ZXMoY29uZmlnLmZvbnRzKSkge1xuICAgICAgICAgICAgaWYgKHZhbC51cmwpIHtcbiAgICAgICAgICAgICAgICB2YWwudXJsID0gYnVuZGxlLnVybEZvcih2YWwudXJsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBjb25maWc7XG4gICAgfSxcblxuICAgIC8vIEV4cGFuZCBwYXRocyBhbmQgY2VudHJhbGl6ZS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c3Npb24nLCAnYW1iaWVudCcsICdkaWZmdXNlJywgJ3NwZWN1bGFyJywgJ25vcm1hbCddKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBNYXRlcmlhbCBwcm9wZXJ0eSBoYXMgYSB0ZXh0dXJlXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGV4ID0gc3R5bGUubWF0ZXJpYWxbcHJvcF0gIT0gbnVsbCAmJiBzdHlsZS5tYXRlcmlhbFtwcm9wXS50ZXh0dXJlO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB0ZXggPT09ICdzdHJpbmcnICYmICFjb25maWcudGV4dHVyZXNbdGV4XSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleCA9IGJ1bmRsZS51cmxGb3IodGV4KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcudGV4dHVyZXNbdGV4XSA9IHsgdXJsOiB0ZXggfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHlsZS5tYXRlcmlhbFtwcm9wXS50ZXh0dXJlID0gdGV4O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gU2hhZGVyIHVuaWZvcm1zXG4gICAgICAgICAgICAgICAgaWYgKHN0eWxlLnNoYWRlcnMgJiYgc3R5bGUuc2hhZGVycy51bmlmb3Jtcykge1xuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCB7dHlwZSwgdmFsdWUsIGtleSwgdW5pZm9ybXN9IG9mIEdMU0wucGFyc2VVbmlmb3JtcyhzdHlsZS5zaGFkZXJzLnVuaWZvcm1zKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGV4dHVyZSBieSBVUkwgKHN0cmluZy1uYW1lZCB0ZXh0dXJlIG5vdCByZWZlcmVuY2luZyBleGlzdGluZyB0ZXh0dXJlIGRlZmluaXRpb24pXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gJ3NhbXBsZXIyRCcgJiYgdHlwZW9mIHZhbHVlID09PSAnc3RyaW5nJyAmJiAhY29uZmlnLnRleHR1cmVzW3ZhbHVlXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ZXggPSBidW5kbGUudXJsRm9yKHZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcudGV4dHVyZXNbdGV4XSA9IHsgdXJsOiB0ZXggfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlmb3Jtc1trZXldID0gdGV4O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gY29uZmlnO1xuICAgIH0sXG5cbiAgICAvLyBTdWJzdGl0dXRlcyBnbG9iYWwgc2NlbmUgcHJvcGVydGllcyAodGhvc2UgZGVmaW5lZCBpbiB0aGUgYGNvbmZpZy5nbG9iYWxgIG9iamVjdCkgZm9yIGFueSBzdHlsZSB2YWx1ZXNcbiAgICAvLyBvZiB0aGUgZm9ybSBgZ2xvYmFsLmAsIGZvciBleGFtcGxlIGBjb2xvcjogZ2xvYmFsLnBhcmtfY29sb3JgIHdvdWxkIGJlIHJlcGxhY2VkIHdpdGggdGhlIHZhbHVlIChpZiBhbnkpXG4gICAgLy8gZGVmaW5lZCBmb3IgdGhlIGBwYXJrX2NvbG9yYCBwcm9wZXJ0eSBpbiBgY29uZmlnLmdsb2JhbC5wYXJrX2NvbG9yYC5cbiAgICBhcHBseUdsb2JhbFByb3BlcnRpZXMoY29uZmlnLCBhcHBsaWVkKSB7XG4gICAgICAgIGlmICghY29uZmlnLmdsb2JhbCB8fCBPYmplY3Qua2V5cyhjb25maWcuZ2xvYmFsKS5sZW5ndGggPT09IDApIHtcbi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gICAgICAgICAgICAvLyBsb2coJ2luZm8nLCBgUmUtYXBwbHlpbmcgJHtwcm9wfSB3aXRoIHZhbHVlICR7cHJvcHNbcHJvcF19IHRvIGtleSAke2tleX0gaW5gLCB0YXJnZXQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICAvLyBGaW5kIGFuZCBhcHBseSBuZXcgcHJvcGVydGllc1xuICAgICAgICBmdW5jdGlvbiBhcHBseVByb3BzIChvYmosIHRhcmdldCwga2V5KSB7XG4gICAgICAgICAgICAvLyBDb252ZXJ0IHN0cmluZ1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBvYmogPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgcHJvcCA9IChvYmouc2xpY2UoMCwgNykgPT09ICdnbG9iYWwuJykgJiYgKG9iai5zbGljZSg3KS5yZXBsYWNlKC9cXC4vZywgc2VwYXJhdG9yKSk7XG4gICAgICAgICAgICAgICAgaWYgKHByb3AgJiYgcHJvcHNbcHJvcF0gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAvLyBTYXZlIHJlY29yZCBvZiB3aGVyZSBwcm9wZXJ0eSBpcyBhcHBsaWVkXG4gICAgICAgICAgICAgICAgICAgIGFwcGxpZWQucHVzaCh7IHByb3AsIHRhcmdldCwga2V5IH0pO1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIEFwcGx5IHByb3BlcnR5XG4gICAgICAgICAgICAgICAgICAgIG9iaiA9IHByb3BzW3Byb3BdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIExvb3AgdGhyb3VnaCBvYmplY3QgcHJvcGVydGllc1xuICAgICAgICAgICAgZWxzZSBpZiAodHlwZW9mIG9iaiA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBwIGluIG9iaikge1xuICAgICAgICAgICAgICAgICAgICBvYmpbcF0gPSBh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JhKSB7XG4gICAgICAgICAgICBjb25maWcuY2FtZXJhcy5kZWZhdWx0ID0gY29uZmlnLmNhbWVyYTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIElmIG5vIGNhbWVyYXMgc3BlY2lmaWVkLCBjcmVhdGUgb25lXG4gICAgICAgIGlmIChPYmplY3Qua2V5cyhjb25maWcuY2FtZXJhcykubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICBjb25maWcuY2FtZXJhcy5kZWZhdWx0ID0ge307XG4gICAgICAgIH1cblxuICAgICAgICAvLyBJZiBubyBsaWdodHMgc3BlY2lmaWVkLCBjcmVhdGUgZGVmYXVsdFxuICAgICAgICBpZiAoT2JqZWN0LmtleXMoY29uZmlnLmxpZ2h0cykubGVuZ3RoID09PSAwIHx8XG4gICAgICAgICAgICBPYmplY3Qua2V5cyhjb25maWcubGlnaHRzKS5ldmVyeShpID0+IGNvbmZpZy5saWdodHNbaV0udmlzaWJsZSA9PT0gZmFsc2UpKSB7XG4gICAgICAgICAgICBjb25maWcubGlnaHRzLmRlZmF1bHRfbGlnaHQgPSB7XG4gICAgICAgICAgICAgICAgdHlwZTogJ2RpcmVjdGlvbmFsJ1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBjb25maWc7XG4gICAgfVxuXG59O1xuXG4vLyBGbGF0dGVuIG5lc3RlZCBwcm9wZXJ0aWVzIGZvciBzaW1wbGVyIHN0cmluZyBsb29rLXVwc1xuLy8gZS5nLiBnbG9iYWwuYmFja2dyb3VuZC5jb2xvciAtPiAnZ2xvYmFsOmJhY2tncm91bmQ6Y29sb3InXG5mdW5jdGlvbiBmbGF0dGVuUHJvcGVydGllcyAob2JqLCBzZXBhcmF0b3IgPSAnOicsIHByZWZpeCA9IG51bGwsIHByb3BzID0ge30pIHtcbiAgICBwcmVmaXggPSBwcmVmaXggPyAocHJlZml4ICsgc2VwYXJhdG9yKSA6ICcnO1xuXG4gICAgZm9yIChsZXQgcC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mcgPSBzZWxmLnN5bmNpbmdfdGV4dHVyZXMudGhlbigoKSA9PiB7XG4gICAgICAgICAgICBsb2coJ2RlYnVnJywgYHVwZGF0ZWQgY29uZmlnYCk7XG4gICAgICAgIH0pO1xuICAgIH0sXG5cbiAgICAvLyBDcmVhdGUgZGF0YSBzb3VyY2VzIGFuZCBjbGVhciB0aWxlIGNhY2hlIGlmIG5lY2Vzc2FyeVxuICAgIGNyZWF0ZURhdGFTb3VyY2VzIChjb25maWcpIHtcbiAgICAgICAgY29uZmlnLnNvdXJjZXMgPSBVdGlscy5zdHJpbmdzVG9GdW5jdGlvbnMoY29uZmlnLnNvdXJjZXMpOyAvLyBwYXJzZSBuZXcgc291cmNlc1xuICAgICAgICBzZWxmLnNvdXJjZXMudGlsZXMgPSB7fTsgLy8gY2xlYXIgcHJldmlvdXMgc291cmNlc1xuICAgICAgICBmb3IgKGxldCBuYW1lIGluIGNvbmZpZy5zb3VyY2VzKSB7XG4gICAgICAgICAgICBsZXQgc291cmNlO1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBzb3VyY2UgPSBEYXRhU291cmNlLmNyZWF0ZShPYmplY3QuYXNzaWduKHt9LCBjb25maWcuc291cmNlc1tuYW1lXSwge25hbWV9KSwgc2VsZi5zb3VyY2VzLnRpbGVzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhdGNoKGUpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCFzb3VyY2UpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHNvdXJjZS50aWxlZCkge1xuICAgICAgICAgICAgICAgIHNlbGYuc291cmNlcy50aWxlc1tuYW1lXSA9IHNvdXJjZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIERpc3RyaWJ1dGUgb2JqZWN0IHNvdXJjZXMgYWNyb3NzIHdvcmtlcnNcbiAgICAgICAgICAgICAgICBpZiAoc291cmNlLmlkICUgc2VsZi5udW1fd29ya2VycyA9PT0gc2VsZi5fd29ya2VyX2lkKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIExvYWQgc291cmNlIGlmIG5vdCBjYWNoZWRcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5zb3VyY2VzLm9iamVjdHNbbmFtZV0gPSBzb3VyY2U7XG4gICAgICAgICAgICAgICAgICAgIGlmICghc2VsZi5vYmplY3RzW3NvdXJjZS5uYW1lXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5vYmplY3RzW3NvdXJjZS5uYW1lXSA9IHt9O1xuICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlLmxvYWQoc2VsZi5vYmplY3RzW3NvdXJjZS5uYW1lXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBDbGVhciB0aWxlIGNhY2hlIGlmIGRhdGEgc291cmNlIGNvbmZpZyBjaGFuZ2VkXG4gICAgICAgIGlmICghc2VsZi5jb25maWcuc291cmNlcyB8fFxuICAgICAgICAgICAgIXNlbGYubGFzdF9jb25maWcuc291cmNlcyB8fFxuICAgICAgICAgICAgT2JqZWN0LmtleXMoc2VsZi5jb25maWcuc291cmNlcykuc29tZShzID0+IHtcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoc2VsZi5jb25maWcuc291cmNlc1tzXSkgIT09IEpTT04uc3RyaW5naWZ5KHNlbGYubGFzdF9jb25maWcuc291cmNlc1tzXSk7XG4gICAgICAgICAgICB9KSkge1xuICAgICAgICAgICAgc2VsZi50aWxlcyA9IHt9O1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIC8vIFJldHVybnMgYSBwcm9taXNlIHRoYXQgZnVsZml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ICAgICAgICAgICAgICAgIHRpbGUubG9hZGVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgdGlsZS5lcnJvciA9IG51bGw7XG5cbiAgICAgICAgICAgICAgICBzZWxmLmxvYWRUaWxlU291cmNlRGF0YSh0aWxlKS50aGVuKCgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzZWxmLmdldFRpbGUodGlsZS5rZXkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsb2coJ3RyYWNlJywgYHN0b3AgdGlsZSBidWlsZCBhZnRlciBkYXRhIHNvdXJjZSBsb2FkIGJlY2F1c2UgdGlsZSB3YXMgcmVtb3ZlZDogJHt0aWxlLmtleX1gKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIC8vIFdhcm4gYW5kIGNvbnRpbnVlIG9uIGRhdGEgc291cmNlIGVycm9yXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aWxlLnNvdXJjZV9kYXRhLmVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsb2coJ3dhcm4nLCBgdGlsZSBsb2FkIGVycm9yKHMpIGZvciAke3RpbGUua2V5fTogJHt0aWxlLnNvdXJjZV9kYXRhLmVycm9yLnN0YWNrfWApO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgdGlsZS5sb2FkaW5nID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIHRpbGUubG9hZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgVGlsZS5idWlsZEdlb21ldHJ5KHRpbGUsIHNlbGYpO1xuICAgICAgICAgICAgICAgIH0pLmNhdGNoKChlcnJvcikgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0aWxlLmxvYWRpbmcgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgdGlsZS5sb2FkZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgdGlsZS5lcnJvciA9IGVycm9yLnN0YWNrO1xuICAgICAgICAgICAgICAgICAgICBsb2coJ2Vycm9yJywgYHRpbGUgbG9hZCBlcnJvciBmb3IgJHt0aWxlLmtleX06ICR7dGlsZS5lcnJvcn1gKTtcblxuICAgICAgICAgICAgICAgICAgICAvLyBTZW5kIGVycm9yIHRvIG1haW4gdGhyZWFkXG4gICAgICAgICAgICAgICAgICAgIFdvcmtlckJyb2tlci5wb3N0TWVzc2FnZShgVGlsZU1hbmFnZXJfJHtzZWxmLnNjZW5lX2lkfS5idWlsZFRpbGVFcnJvcmAsIFRpbGUuc2xpY2UodGlsZSkpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gVGlsZSBhbHJlYWR5IGxvYWRlZCwganVzdCByZWJ1aWxkXG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBsb2coJ3RyYWNlJywgYHVzZWQgd29ya2VyIGNhY2hlIGZvciB0aWxlICR7dGlsZS5rZXl9YCk7XG5cbiAgICAgICAgICAgICAgICAvLyBCdWlsZCBnZW9tZXRyeVxuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIFRpbGUuYnVpbGRHZW9tZXRyeSh0aWxlLCBzZWxmKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY2F0Y2goZXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gU2VuZCBlcnJvciB0byBtYWluIHRocmVhZFxuICAgICAgICAgICAgICAgICAgICB0aWxlLmVycm9yID0gZXJyb3IudG9TdHJpbmcoKTtcbiAgICAgICAgICAgICAgICAgICAgV29ya2VyQnJva2VyLnBvc3RNZXNzYWdlKGBUaWxlTWFuYWdlcl8ke3NlbGYuc2NlbmVfaWR9LmJ1aWxkVGlsZUVycm9yYCwgVGlsZS5zbGljZSh0aWxlKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9LFxuXG4gICAgLy8gTG9hZCB0aGlzIHRpbGUncyBkYXRhIHNvdXJjZVxuICAgIGxvYWRUaWxlU291cmNlRGF0YSAodGlsZSkge1xuICAgICAgICBpZiAoc2VsZi5zb3VyY2VzLnRpbGVzW3RpbGUuc291cmNlXSkge1xuICAgICAgICAgICAgcmV0dXJuIHNlbGYuc291cmNlcy50aWxlc1t0aWxlLnNvdXJjZV0ubG9hZCh0aWxlKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHRpbGUuc291cmNlX2RhdGEgPSB7IGVycm9yOiBgRGF0YSBzb3VyY2UgJyR7dGlsZS5zb3VyY2V9JyBub3QgZm91bmRgIH07XG4gICAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKHRpbGUpO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIGdldFRpbGUoa2V5KSB7XG4gICAgICAgIHJldHVybiBzZWxmLnRpbGVzW2tleV07XG4gICAgfSxcblxuICAgIC8vIFJlbW92ZSB0aWxlXG4gICAgcmVtb3ZlVGlsZSAoa2V5KSB7XG4gICAgICAgIHZhciB0aWxlID0gc2VsZi50aWxlc1trZXldO1xuXG4gICAgICAgIGlmICh0aWxlICE9IG51bGwpIHtcbiAgICAgICAgICAgIC8vIENhbmNlbCBpZiBsb2FkaW5nXG4gICAgICAgICAgICBpZiAodGlsZS5sb2FkaW5nID09PSB0cnVlKSB7XG4gICAgICAgICAgICAgICAgbG9nKCd0cmFjZScsIGBjYW5jZWwgdGlsZSBsb2FkIGZvciAke2tleX1gKTtcbiAgICAgICAgICAgICAgICB0aWxlLmxvYWRpbmcgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICBUaWxlLmNhbmNlbCh0aWxlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gUmVtb3ZlIGZyb20gY2FjaGVcbiAgICAgICAg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IGZvcmNlZCB0aGlzIGZ1bmN0aW9uIHRvIHdhaXQgZm9yIHRoZSBHUFUgdG8gZmluaXNoIHJlbmRlcmluZyBhbmQgcmV0cmlldmUgdGhlIHRleHR1cmUgY29udGVudHMuXG4gICAgICAgIGlmICh0aGlzLnJlYWRfZGVsYXlfdGltZXIgIT0gbnVsbCkge1xuICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHRoaXMucmVhZF9kZWxheV90aW1lcik7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5yZWFkX2RlbGF5X3RpbWVyID0gc2V0VGltZW91dCgoKSA9PiB7XG4gICAgICAgICAgICB2YXIgZ2wgPSB0aGlzLmdsO1xuXG4gICAgICAgICAgICBnbC5iaW5kRnJhbWVidWZmZXIoZ2wuRlJBTUVCVUZGRVIsIHRoaXMuZmJvKTtcblxuICAgICAgICAgICAgZm9yICh2YXIgciBpbiB0aGlzLnJlcXVlc3RzKSB7XG4gICAgICAgICAgICAgICAgdmFyIHJlcXVlc3QgPSB0aGlzLnJlcXVlc3RzW3JdO1xuXG4gICAgICAgICAgICAgICAgLy8gVGhpcyByZXF1ZXN0IHdhcyBhbHJlYWR5IHNlbnQgdG8gdGhlIHdvcmtlciwgd2UncmUganVzdCBhd2FpdGluZyBpdHMgcmVwbHlcbiAgICAgICAgICAgICAgICBpZiAocmVxdWVzdC5zZW50KSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIFRPRE86IHN1cHBvcnQgb3RoZXIgc2VsZWN0aW9uIHR5cGVzLCBzdWNoIGFzIGZlYXR1cmVzIHdpdGhpbiBhIGJveFxuICAgICAgICAgICAgICAgIGlmIChyZXF1ZXN0LnR5cGUgIT09ICdwb2ludCcpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gQ2hlY2sgc2VsZWN0aW9uIG1hcCBhZ2FpbnN0IEZCT1xuICAgICAgICAgICAgICAgIGdsLnJlYWRQaXhlbHMoXG4gICAgICAgICAgICAgICAgICAgIE1hdGguZmxvb3IocmVxdWVzdC5wb2ludC54ICogdGhpcy5mYm9fc2l6ZS53aWR0aCksXG4gICAgICAgICAgICAgICAgICAgIE1hdGguZmxvb3IoKDEgLSByZXF1ZXN0LnBvaW50LnkpICogdGhpcy5mYm9fc2l6ZS5oZWlnaHQpLFxuICAgICAgICAgICAgICAgICAgICAxLCAxLCBnbC5SR0JBLCBnbC5VTlNJR05FRF9CWVRFLCB0aGlzLnBpeGVsKTtcbiAgICAgICAgICAgICAgICB2YXIgZmVhdHVyZV9rZXkgPSAodGhpcy5waXhlbFswXSArICh0aGlzLnBpeGVsWzFdIDw8IDgpICsgKHRoaXMucGl4ZWxbMl0gPDwgMTYpICsgKHRoaXMucGl4ZWxbM10gPDwgMjQpKSA+Pj4gMDtcblxuICAgICAgICAgICAgICAgIC8vIElmIGZlYXR1cmUgZm91bmQsIGFzayBhcHByb3ByaWF0ZSB3ZWIgd29ya2VyIHRvIGxvb2t1cCBmZWF0dXJlXG4gICAgICAgICAgICAgICAgdmFyIHdvcmtlcl9pZCA9IHRoaXMucGl4ZWxbM107XG4gICAgICAgICAgICAgICAgaWYgKHdvcmtlcl9pZCAhPT0gMjU1KSB7IC8vIDI1NSBpbmRpY2F0ZXMgYW4gZW1wdHkgc2VsZWN0aW9uIGJ1ZmZlciBwaXhlbFxuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy53b3JrZXJzW3dvcmtlcl9pZF0gIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgV29ya2VyQnJva2VyLnBvc3RNZXNzYWdlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMud29ya2Vyc1t3b3JrZXJfaWRdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdzZWxmLmdldEZlYXR1cmVTZWxlY3Rpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgaWQ6IHJlcXVlc3QuaWQsIGtleTogZmVhdHVyZV9rZXkgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgIC50aGVuKG1lc3NhZ2UgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZmluaXNoUmVhZChtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIE5vIGZlYXR1cmUgZm91bmQsIGJ1dCBzdGlsbCBuZWVkIHRvIHJlc29sdmUgcHJvbWlzZVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmZpbmlzaFJlYWQoeyBpZDogcmVxdWVzdC5pZCwgZmVhdHVyZTogbnVsbCB9KTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICByZXF1ZXN0LnNlbnQgPSB0cnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBnbC5iaW5kRnJhbWVidWZmZXIoZ2wuRlJBTUVCVUZGRVIsIG51bGwpO1xuXG4gICAgICAgIH0sIHRoaXMucmVhZF9kZWxheSk7XG4gICAgfVxuXG4gICAgLy8gQ2FsbGVkIG9uIG1haW4gdGhyZWFkIHdoZW4gYSB3ZWIgd29ya2VyIGZpbmRzIGEgZmVhdHVyZSBpbiB0aGUgc2VsZWN0aW9uIGJ1ZmZlclxuICAgIGZpbmlzaFJlYWQgKG1lc3NhZ2UpIHtcbiAgICAgICAgdmFyIHJlcXVlc3QgPSB0aGlzLnJlcXVlc3RzW21lc3NhZ2UuaWRdO1xuICAgICAgICBpZiAoIXJlcXVlc3QpIHtcbiAgICAgICAgICAgIGxvZygnZXJyb3InLCBcIkZlYXR1cmVTZWxlY3Rpb24uZmluaXNoUmVhZCgpOiBjb3VsZCBub3QgZmluZCBtZXNz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dG8gcG9zaXRpdmUgI1xuXG4gICAgICAgIHRoaXMubWFwW2tleV0gPSB7XG4gICAgICAgICAgICBjb2xvcjogW3IsIGcsIGIsIGFdLFxuICAgICAgICB9O1xuICAgICAgICB0aGlzLm1hcF9zaXplKys7XG5cbiAgICAgICAgLy8gSW5pdGlhbGl6ZSB0aWxlLXNwZWNpZmljIHRyYWNraW5nIGluZm9cbiAgICAgICAgaWYgKCF0aGlzLnRpbGVzW3RpbGUua2V5XSkge1xuICAgICAgICAgICAgdGhpcy50aWxlc1t0aWxlLmtleV0gPSB7XG4gICAgICAgICAgICAgICAgZW50cmllczogW10sICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2V0IG9mIGZlYXR1cmUgZW50cmllcyBpbiB0aGlzIHRocmVhZFxuICAgICAgICAgICAgICAgIHRpbGU6IHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN1YnNldCBvZiB0aWxlIHByb3BlcnRpZXMgdG8gcGFzcyBiYWNrIHdpdGggZmVhdHVyZVxuICAgICAgICAgICAgICAgICAgICBrZXk6IHRpbGUua2V5LFxuICAgICAgICAgICAgICAgICAgICBjb29yZHM6IHRpbGUuY29vcmRzLFxuICAgICAgICAgICAgICAgICAgICBzdHlsZV96b29tOiB0aWxlLnN0eWxlX3pvb20sXG4gICAgICAgICAgICAgICAgICAgIHNvdXJjZTogdGlsZS5zb3VyY2UsXG4gICAgICAgICAgICAgICAgICAgIGdlbmVyYXRpb246IHRpbGUuZ2VuZXJhdGlvblxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnRpbGVzW3RpbGUua2V5XS5lbnRyaWVzLnB1c2goa2V5KTtcblxuICAgICAgICByZXR1cm4gdGhpcy5tYXBba2V5XTtcbiAgICB9XG5cbiAgICBzdGF0aWMgbWFrZUNvbG9yKGZlYXR1cmUsIHRpbGUsIGNvbnRleHQpIHtcbiAgICAgICAgdmFyIHNlbGVjdG9yID0gdGhpcy5tYWtlRW50cnkodGlsZSk7XG4gICAgICAgIHNlbGVjdG9yLmZlYXR1cmUgPSB7XG4gICAgICAgICAgICBpZDogZmVhdHVyZS5pZCxcbiAgICAgICAgICAgIHByb3BlcnRpZXM6IGZlYXR1cmUucHJvcGVydGllcyxcbiAgICAgICAgICAgIHNvdXJjZV9uYW1lOiBjb250ZXh0LnNvdXJjZSxcbiAgICAgICAgICAgIHNvdXJjZV9sYXllcjogY29udGV4dC5sYXllcixcbiAgICAgICAgICAgIGxheWVyczogY29udGV4dC5sYXllcnMsXG4gICAgICAgICAgICB0aWxlOiB0aGlzLnRpbGVzW3RpbGUua2V5XS50aWxlXG4gICAgICAgIH07XG5cbiAgICAgICAgcmV0dXJuIHNlbGVjdG9yLmNvbG9yO1xuICAgIH1cblxuICAgIHN0YXRpYyByZXNldCgpIHtcbiAgICAgICAgdGhpcy50aWxlcyA9IHt9O1xuICAgICAgICB0aGlzLm1hcCA9IHt9O1xuICAgICAgICB0aGlzLm1hcF9zaXplID0gMDtcbiAgICAgICAgdGhpcy5tYXBfZW50cnkgPSAwO1xuICAgIH1cblxuICAgIHN0YXRpYyBjbGVhclRpbGUoa2V5KSB7XG4gICAgICAgIGlmICh0aGlzLnRpbGVzW2tleV0pIHtcbiAgICAgICAgICAgIHRoaXMudGlsZXNba2V5XS5lbnRyaWVzLmZvckVhY2goayA9PiBkZWxldGUgdGhpcy5tYXBba10pO1xuICAgICAgICAgICAgdGhpcy5tYXBfc2l6ZSAtPSB0aGlzLnRpbGVzW2tleV0uZW50cmllcy5sZW5ndGg7XG4gICAgICAgICAgICBkZWxldGUgdGhpcy50aWxlc1trZXldO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgc3RhdGljIGdldE1hcFNpemUoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1hcF9zaXplO1xuICAgIH1cblxuICAgIHN0YXRpYyBzZXRQcmVmaXgocHJlZml4KSB7XG4gICAgICAgIHRoaXMubWFwX3ByZW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biAgICAgICAgICAgICAgICAgICAgY29vcmRbMF0gPSB4O1xuICAgICAgICAgICAgICAgICAgICBjb29yZFsxXSA9IHk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoc291cmNlLmRlYnVnICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIHNvdXJjZS5kZWJ1Zy5wcm9qZWN0aW9uID0gK25ldyBEYXRlKCkgLSB0aW1lcjtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8qKlxuICAgICBSZS1zY2FsZSBnZW9tZXRyaWVzIHdpdGhpbiBlYWNoIHNvdXJjZSB0byBpbnRlcm5hbCB0aWxlIHVuaXRzXG4gICAgKi9cbiAgICBzdGF0aWMgc2NhbGVEYXRhIChzb3VyY2UsIHtjb29yZHM6IHt6fSwgbWluLCBtYXh9KSB7XG4gICAgICAgIGxldCB1bml0c19wZXJfbWV0ZXIgPSBHZW8udW5pdHNQZXJNZXRlcih6KTtcbiAgICAgICAgZm9yICh2YXIgdCBpbiBzb3VyY2UubGF5ZXJzKSB7XG4gICAgICAgICAgICB2YXIgbnVtX2ZlYXR1cmVzID0gc291cmNlLmxheWVyc1t0XS5mZWF0dXJlcy5sZW5ndGg7XG4gICAgICAgICAgICBmb3IgKHZhciBmPTA7IGYgPCBudW1fZmVhdHVyZXM7IGYrKykge1xuICAgICAgICAgICAgICAgIHZhciBmZWF0dXJlID0gc291cmNlLmxheWVyc1t0XS5mZWF0dXJlc1tmXTtcbiAgICAgICAgICAgICAgICBHZW8udHJhbnNmb3JtR2VvbWV0cnkoZmVhdHVyZS5nZW9tZXRyeSwgY29vcmQgPT4ge1xuICAgICAgICAgICAgICAgICAgICBjb29yZFswXSA9IChjb29yZFswXSAtIG1pbi54KSAqIHVuaXRzX3Blcl9tZXRlcjtcbiAgICAgICAgICAgICAgICAgICAgY29vcmRbMV0gPSAoY29vcmRbMV0gLSBtaW4ueSkgKiB1bml0c19wZXJfbWV0ZXIgKiAtMTsgLy8gZmxpcCBjb29yZHMgcG9zaXRpdmVcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGxvYWQoZGVzdCkge1xuICAgICAgICBkZXN0LnNvdXJjZV9kYXRhID0ge307XG4gICAgICAgIGRlc3Quc291cmNlX2RhdGEubGF5ZXJzID0ge307XG4gICAgICAgIGRlc3QucGFkX3NjYWxlID0gdGhpcy5wYWRfc2NhbGU7XG4gICAgICAgIGRlc3QucmFzdGVycyA9IFsuLi50aGlzLnJhc3RlcnNdOyAvLyBjb3B5IGxpc3Qgb2YgcmFzdGVycyB0byBsb2FkIGZvciB0aWxlXG5cbiAgICAgICAgcmV0dXJuIHRoaXMuX2xvYWQoZGVzdCkudGhlbigoZGVzdCkgPT4ge1xuICAgICAgICAgICAgLy8gUG9zdC1wcm9jZXNzaW5nXG4gICAgICAgICAgICBmb3IgKGxldCBsYXllciBpbiBkZXN0LnNvdXJjZV9kYXRhLmxheWVycykge1xuICAgICAgICAgICAgICAgIGxldCBkYXRhID0gZGVzdC5zb3VyY2VfZGF0YS5sYXllcnNbbGF5ZXJdO1xuICAgICAgICAgICAgICAgIGlmIChkYXRhICYmIGRhdGEuZmVhdHVyZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5mZWF0dXJlcy5mb3JFYWNoKGZlYXR1cmUgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgR2VvLnRyYW5zZm9ybUdlb21ldHJ5KGZlYXR1cmUuZ2VvbWV0cnksIGNvb3JkID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBGbGlwIFkgY29vcmRzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29vcmRbMV0gPSAtY29vcmRbMV07XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBTbGlnaHRseSBzY2FsZSB1cCB0aWxlIHRvIGNvdmVyIHNlYW1zXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMucGFkX3NjYWxlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvb3JkWzBdID0gTWF0aC5yb3VuZChjb29yZFswXSAqICgxICsgdGhpcy5wYWRfc2NhbGUpIC0gKEdlby50aWxlX3NjYWxlICogdGhpcy5wYWRfc2NhbGUvMikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb29yZFsxXSA9IE1hdGgucm91bmQoY29vcmRbMV0gKiAoMSArIHRoaXMucGFkX3NjYWxlKSAtIChHZW8udGlsZV9zY2FsZSAqIHRoaXMucGFkX3NjYWxlLzIpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gVXNlIGZpcnN0IGVuY291bnRlcmVkIHBvbHlnb24gd2luZGluZyBvcmRlciBhcyBkZWZhdWx0IGZvciBkYXRhIHNvdXJjZVxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy51cGRhdGVEZWZhdWx0V2luZGluZyhmZWF0dXJlLmdlb21ldHJ5KTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBkZXN0LmRlZmF1bHRfd2luZGluZyA9IHRoaXMuZGVmYXVsdF93aW5kaW5nIHx8ICdDQ1cnO1xuICAgICAgICAgICAgcmV0dXJuIGRlc3Q7XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIC8vIFN1Yi1jbGFzc2VzIG11c3QgaW1wbGVtZW50XG4gICAgX2xvYWQoZGVzdCkge1xuICAgICAgICB0aHJvdyBuZXcgTWV0aG9kTm90SW1wbGVtZW50ZWQoJ19sb2FkJyk7XG4gICAgfVxuXG4gICAgLy8gSW5mZXIgd2luZGluZyBmb3IgZGF0YSBzb3VyY2UgZnJ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BmbGlwIHRpbGUgY29vcmRzIGZvciBUTVNcbiAgICAgICAgdGhpcy51cmxfaG9zdHMgPSBudWxsO1xuICAgICAgICB2YXIgaG9zdF9tYXRjaCA9IHRoaXMudXJsLm1hdGNoKC97czpcXFsoW159K10rKVxcXX0vKTtcbiAgICAgICAgaWYgKGhvc3RfbWF0Y2ggIT0gbnVsbCAmJiBob3N0X21hdGNoLmxlbmd0aCA+IDEpIHtcbiAgICAgICAgICAgIHRoaXMudXJsX2hvc3RzID0gaG9zdF9tYXRjaFsxXS5zcGxpdCgnLCcpO1xuICAgICAgICAgICAgdGhpcy5uZXh0X2hvc3QgPSAwO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gR2V0IGJvdW5kcyBmcm9tIHNvdXJjZSBjb25maWcgcGFyYW1ldGVyc1xuICAgIHBhcnNlQm91bmRzIChzb3VyY2UpIHtcbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoc291cmNlLmJvdW5kcykgJiYgc291cmNlLmJvdW5kcy5sZW5ndGggPT09IDQpIHtcbiAgICAgICAgICAgIHRoaXMuYm91bmRzID0gc291cmNlLmJvdW5kcztcbiAgICAgICAgICAgIGxldCBbdywgcywgZSwgbl0gPSB0aGlzLmJvdW5kcztcbiAgICAgICAgICAgIHRoaXMuYm91bmRzX21ldGVycyA9IHtcbiAgICAgICAgICAgICAgICBtaW46IEdlby5sYXRMbmdUb01ldGVycyhbdywgbl0pLFxuICAgICAgICAgICAgICAgIG1heDogR2VvLmxhdExuZ1RvTWV0ZXJzKFtlLCBzXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgdGhpcy5ib3VuZHNfdGlsZXMgPSB7IG1pbjoge30sIG1heDoge30gfTsgLy8gbWF4IHRpbGUgYm91bmRzIHBlciB6b29tIChsYXppbHkgZXZhbHVhdGVkKVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gUmV0dXJucyBmYWxzZSBpZiB0aWxlIGlzIG91dHNpZGUgZGF0YSBzb3VyY2UncyBib3VuZHMsIHRydWUgaWYgd2l0aGluXG4gICAgY2hlY2tCb3VuZHMgKGNvb3Jkcykge1xuICAgICAgICAvLyBDaGVjayB0aWxlIGJvdW5kc1xuICAgICAgICBpZiAodGhpcy5ib3VuZHMpIHtcbiAgICAgICAgICAgIGNvb3JkcyA9IEdlby53cmFwVGlsZShjb29yZHMsIHsgeDogdHJ1ZSB9KTtcblxuICAgICAgICAgICAgbGV0IG1pbiA9IHRoaXMuYm91bmRzX3RpbGVzLm1pbltjb29yZHMuel07XG4gICAgICAgICAgICBpZiAoIW1pbikge1xuICAgICAgICAgICAgICAgIG1pbiA9IHRoaXMuYm91bmRzX3RpbGVzLm1pbltjb29yZHMuel0gPSBHZW8udGlsZUZvck1ldGVycyh0aGlzLmJvdW5kc19tZXRlcnMubWluLCBjb29yZHMueik7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGxldCBtYXggPSB0aGlzLmJvdW5kc190aWxlcy5tYXhbY29vcmRzLnpdO1xuICAgICAgICAgICAgaWYgKCFtYXgpIHtcbiAgICAgICAgICAgICAgICBtYXggPSB0aGlzLmJvdW5kc190aWxlcy5tYXhbY29vcmRzLnpdID0gR2VvLnRpbGVGb3JNZXRlcnModGhpcy5ib3VuZHNfbWV0ZXJzLm1heCwgY29vcmRzLnopO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoY29vcmRzLnggPCBtaW4ueCB8fCBjb29yZHMueCA+IG1heC54IHx8XG4gICAgICAgICAgICAgICAgY29vcmRzLnkgPCBtaW4ueSB8fCBjb29yZHMueSA+IG1heC55KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIGluY2x1ZGVzVGlsZSAoY29vcmRzLCBzdHlsZV96b29tKSB7XG4gICAgICAgIGlmICghc3VwZXIuaW5jbHVkZXNUaWxlKGNvb3Jkcywgc3R5bGVfem9vbSkpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIENoZWNrIHRpbGUgYm91bmRzXG4gICAgICAgIGlmICghdGhpcy5jaGVja0JvdW5kcyhjb29yZHMpKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgZm9ybWF0VXJsKHVybF90ZW1wbGF0ZSwgdGlsZSkge1xuICAgICAgICBsZXQgY29vcmRzID0gR2VvLndyYXBUaWxlKHRpbGUuY29vcmRzLCB7IHg6IHRydWUgfSk7XG5cbiAgICAgICAgaWYgKHRoaXMudG1zKSB7XG4gICAgICAgICAgICBjb29yZHMueSA9IE1hdGgucG93KDIsIGNvb3Jkcy56KSAtIDEgLSBjb29yZHMueTsgLy8gb3B0aW9uYWxseSBmbGlwIHRpbGUgY29vcmRzIGZvciBUTVNcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCB1cmwgPSB1cmxfdGVtcGxhdGUucmVwbGFjZSgne3h9JywgY29vcmRzLngpLnJlcGxhY2UoJ3t5fScsIGNvb3Jkcy55KS5yZXBsYWNlKCd7en0nLCBjb29yZHMueik7XG5cbiAgICAgICAgaWYgKHRoaXMudXJsX2hvc3RzICE9IG51bGwpIHtcbiAgICAgICAgICAgIHVybCA9IHVybC5yZXBsYWNlKC97czpcXFsoW159K10rKVxcXX0vLCB0aGlzLnVybF9ob3N0c1t0aGlzLm5leHRfaG9zdF0pO1xuICAgICAgICAgICAgdGhpcy5uZXh0X2hvc3QgPSAodGhpcy5uZXh0X2hvc3QgKyAxKSAlIHRoaXMudXJsX2hvc3RzLmxlbmd0aDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdXJsO1xuICAgIH1cblxuICAgIC8vIENoZWNrcyBmb3IgdGhlIHgveS96IHRpbGUgcGF0dGVybiBpbiBVUkwgdGV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9IE1hdGgubWF4KHRoaXMubWF4X3pvb20gfHwgMCwgMTUpOyAvLyBUT0RPOiBtYXggem9vbSA8IDE1IGNhdXNlcyBhcnRpZmFjdHMvbm8tZHJhdyBhdCAyMCwgaW52ZXN0aWdhdGVcbiAgICAgICAgdGhpcy5wYWRfc2NhbGUgPSAwOyAvLyB3ZSBkb24ndCB3YW50IHBhZGRpbmcgb24gYXV0by10aWxlZCBzb3VyY2VzXG4gICAgfVxuXG4gICAgX2xvYWQoZGVzdCkge1xuICAgICAgICBpZiAoIXRoaXMubG9hZF9kYXRhKSB7XG4gICAgICAgICAgICB0aGlzLmxvYWRfZGF0YSA9IHN1cGVyLl9sb2FkKHsgc291cmNlX2RhdGE6IHsgbGF5ZXJzOiB7fSB9IH0pLnRoZW4oZGF0YSA9PiB7XG4gICAgICAgICAgICAgICAgLy8gV2FybiBhbmQgY29udGludWUgb24gZGF0YSBzb3VyY2UgZXJyb3JcbiAgICAgICAgICAgICAgICBpZiAoZGF0YS5zb3VyY2VfZGF0YS5lcnJvcikge1xuICAgICAgICAgICAgICAgICAgICBsb2coJ3dhcm4nLCBgZGF0YSBzb3VyY2UgbG9hZCBlcnJvcihzKSBmb3Igc291cmNlICcke3RoaXMubmFtZX0nLCBVUkwgJyR7dGhpcy51cmx9JzogJHtkYXRhLnNvdXJjZV9kYXRhLmVycm9yfWApO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGxldCBsYXllcnMgPSBkYXRhLnNvdXJjZV9kYXRhLmxheWVycztcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBsYXllcl9uYW1lIGluIGxheWVycykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnRpbGVfaW5kZXhlc1tsYXllcl9uYW1lXSA9IGdlb2pzb252dChsYXllcnNbbGF5ZXJfbmFtZV0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1heFpvb206IHRoaXMubWF4X3pvb20sICAvLyBtYXggem9vbSB0byBwcmVzZXJ2ZSBkZXRhaWwgb25cbiAgICAgICAgICAgICAgICAgICAgICAgIHRvbGVyYW5jZTogMywgLy8gc2ltcGxpZmljYXRpb24gdG9sZXJhbmNlIChoaWdoZXIgbWVhbnMgc2ltcGxlcilcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dGVudDogR2VvLnRpbGVfc2NhbGUsIC8vIHRpbGUgZXh0ZW50IChib3RoIHdpZHRoIGFuZCBoZWlnaHQpXG4gICAgICAgICAgICAgICAgICAgICAgICBidWZmZXI6IDAuMDAwMSAgICAgLy8gdGlsZSBidWZmZXIgb24gZWFjaCBzaWRlXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRoaXMubG9hZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZGF0YTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRoaXMubG9hZF9kYXRhLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgZm9yIChsZXQgbGF5ZXJfbmFtZSBpbiB0aGlzLnRpbGVfaW5kZXhlcykge1xuICAgICAgICAgICAgICAgIGRlc3Quc291cmNlX2RhdGEubGF5ZXJzW2xheWVyX25hbWVdID0gdGhpcy5nZXRUaWxlRmVhdHVyZXMoZGVzdCwgbGF5ZXJfbmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gZGVzdDtcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgZ2V0VGlsZUZlYXR1cmVzKHRpbGUsIGxheWVyX25hbWUpIHtcbiAgICAgICAgbGV0IGNvb3JkcyA9IEdlby53cmFwVGlsZSh0aWxlLmNvb3JkcywgeyB4OiB0cnVlIH0pO1xuXG4gICAgICAgIC8vIHJlcXVlc3QgYSBwYXJ0aWN1bGFyIHRpbGVcbiAgICAgICAgbGV0IHQgPSB0aGlzLnRpbGVfaW5kZXhlc1tsYXllcl9uYW1lXS5nZXRUaWxlKGNvb3Jkcy56LCBjb29yZHMueCwgY29vcmRzLnkpO1xuXG4gICAgICAgIC8vIENvbnZlcnQgZnJvbSBNVlQtc3R5bGUgSlNPTiBzdHJ1Y3QgdG8gR2VvSlNPTlxuICAgICAgICBsZXQgY29sbGVjdGlvbjtcbiAgICAgICAgaWYgKHQgJiYgdC5mZWF0dXJlcykge1xuICAgICAgICAgICAgY29sbGVjdGlvbiA9IHtcbiAgICAgICAgICAgICAgICB0eXBlOiAnRmVhdHVyZUNvbGxlY3Rpb24nLFxuICAgICAgICAgICAgICAgIGZlYXR1cmVzOiBbXVxuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgZm9yIChsZXQgZmVhdHVyZSBvZiB0LmZlYXR1cmVzKSB7XG4gICAgICAgICAgICAgICAgLy8gR2VvSlNPTiBmZWF0dXJlXG4gICAgICAgICAgICAgICAgbGV0IGYgPSB7XG4gICAgICAgICAgICAgICAgICAgIHR5cGU6ICdGZWF0dXJlJyxcbiAgICAgICAgICAgICAgICAgICAgZ2VvbWV0cnk6IHt9LFxuICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzOiBmZWF0dXJlLnRhZ3NcbiAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgaWYgKGZlYXR1cmUudHlwZSA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICBmLmdlb21ldHJ5LmNvb3JkaW5hdGVzID0gZmVhdHVyZS5nZW9tZXRyeS5tYXAoY29vcmQgPT4gW2Nvb3JkWzBdLCBjb29yZFsxXV0pO1xuICAgICAgICAgICAgICAgICAgICBmLmdlb21ldHJ5LnR5cGUgPSAnTXVsdGlQb2ludCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGZlYXR1cmUudHlwZSA9PT0gMiB8fCBmZWF0dXJlLnR5cGUgPT09IDMpIHtcbiAgICAgICAgICAgICAgICAgICAgZi5nZW9tZXRyeS5jb29yZGluYXRlcyA9IGZlYXR1cmUuZ2VvbWV0cnkubWFwKHJpbmcgPT5cbiAgICAgICAgICAgICAgICAgICAgICAgIHJpbmcubWFwKGNvb3JkID0+IFtjb29yZFswXSwgY29vcmRbMV1dKVxuICAgICAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmIChmZWF0dXJlLnR5cGUgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGYuZ2VvbWV0cnkudHlwZSA9ICdNdWx0aUxpbmVTdHJpbmcnO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2UgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGYuZ2VvbWV0cnkgPSBkZWNvZGVNdWx0aVBvbHlnb24oZi5nZW9tZXRyeSk7IC8vIHVuLWZsYXR0ZW4gcmluZ3NcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmLmdlb21ldHJ5ID09IG51bGwpIHsgLy8gc2tpcCBwb2x5cyB0aGF0IGNvdWxkbid0IGJlIGRlY29kZWQgKGUuZy4gZGVnZW5lcmF0ZSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgY29sbGVjdGlvbi5mZWF0dXJlcy5wdXNoKGYpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGNvbGxlY3Rpb247XG4gICAgfVxuXG4gICAgZm9ybWF0VXJsIChkZXN0KSB7XG4gICAgICAgIHJldHVybiB0aGlzLnVybDtcbiAgICB9XG5cbiAgICBwYXJzZVNvdXJjZURhdGEgKHRpbGUsIH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3BsYWNlbWVudFwiIDogdHJ1ZX07XG5cbiAgICAgICAgICAgIGZlYXR1cmVzLmZvckVhY2goZmVhdHVyZSA9PiB7XG4gICAgICAgICAgICAgICAgbGV0IGNvb3JkaW5hdGVzLCBjZW50cm9pZF9mZWF0dXJlO1xuICAgICAgICAgICAgICAgIHN3aXRjaCAoZmVhdHVyZS5nZW9tZXRyeS50eXBlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ1BvbHlnb24nOlxuICAgICAgICAgICAgICAgICAgICAgICAgY29vcmRpbmF0ZXMgPSBmZWF0dXJlLmdlb21ldHJ5LmNvb3JkaW5hdGVzO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2VudHJvaWRfZmVhdHVyZSA9IGdldENlbnRyb2lkRmVhdHVyZUZvclBvbHlnb24oY29vcmRpbmF0ZXMsIGZlYXR1cmUucHJvcGVydGllcywgY2VudHJvaWRfcHJvcGVydGllcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBmZWF0dXJlc19jZW50cm9pZC5wdXNoKGNlbnRyb2lkX2ZlYXR1cmUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ011bHRpUG9seWdvbic6XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBBZGQgY2VudHJvaWQgZmVhdHVyZSBmb3IgbGFyZ2VzdCBwb2x5Z29uXG4gICAgICAgICAgICAgICAgICAgICAgICBjb29yZGluYXRlcyA9IGZlYXR1cmUuZ2VvbWV0cnkuY29vcmRpbmF0ZXM7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbWF4X2FyZWEgPSAtSW5maW5pdHk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbWF4X2FyZWFfaW5kZXggPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaW5kZXggPSAwOyBpbmRleCA8IGNvb3JkaW5hdGVzLmxlbmd0aDsgaW5kZXgrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhcmVhID0gR2VvLnBvbHlnb25BcmVhKGNvb3JkaW5hdGVzW2luZGV4XSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFyZWEgPiBtYXhfYXJlYSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhfYXJlYSA9IGFyZWE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heF9hcmVhX2luZGV4ID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY2VudHJvaWRfZmVhdHVyZSA9IGdldENlbnRyb2lkRmVhdHVyZUZvclBvbHlnb24oY29vcmRpbmF0ZXNbbWF4X2FyZWFfaW5kZXhdLCBmZWF0dXJlLnByb3BlcnRpZXMsIGNlbnRyb2lkX3Byb3BlcnRpZXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZmVhdHVyZXNfY2VudHJvaWQucHVzaChjZW50cm9pZF9mZWF0dXJlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAvLyBhcHBlbmQgY2VudHJvaWQgZmVhdHVyZXMgdG8gZmVhdHVyZXMgYXJyYXlcbiAgICAgICAgICAgIEFycmF5LnByb3RvdHlwZS5wdXNoLmFwcGx5KGZlYXR1cmVzLCBmZWF0dXJlc19jZW50cm9pZCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gZmVhdHVyZXM7XG4gICAgfVxuXG4gICAgLy8gRGV0ZWN0IHNpbmdsZSBvciBtdWx0aXBsZSBsYXllcnMgaW4gcmV0dXJuZWQgZGF0YVxuICAgIGdldExheWVycyAoZGF0YSkge1xuICAgICAgICBpZiAoZGF0YS50eXBlID09PSAnRmVhdHVyZ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ICAgICAgLy8gUmVwbGFjZSBpbnN0YW5jZSB0eXBlXG4gICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBHZW9KU09OU291cmNlKHNvdXJjZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBQYXNzIGJhY2sgdG8gcGFyZW50IGNsYXNzIHRvIGluc3RhbnRpYXRlXG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgcGFyc2VTb3VyY2VEYXRhICh0aWxlLCBzb3VyY2UsIHJlc3BvbnNlKSB7XG4gICAgICAgIGxldCBkYXRhID0gSlNPTi5wYXJzZShyZXNwb25zZSk7XG4gICAgICAgIHRoaXMucHJlcGFyZUdlb0pTT04oZGF0YSwgdGlsZSwgc291cmNlKTtcbiAgICB9XG5cbiAgICBwcmVwYXJlR2VvSlNPTiAoZGF0YSwgdGlsZSwgc291cmNlKSB7XG4gICAgICAgIC8vIEFwcGx5IG9wdGlvbmFsIGRhdGEgdHJhbnNmb3JtXG4gICAgICAgIGlmICh0eXBlb2YgdGhpcy50cmFuc2Zvcm0gPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgIGRhdGEgPSB0aGlzLnRyYW5zZm9ybShkYXRhLCB0aGlzLmV4dHJhX2RhdGEpO1xuICAgICAgICB9XG5cbiAgICAgICAgc291cmNlLmxheWVycyA9IEdlb0pTT05Tb3VyY2UucHJvdG90eXBlLmdldExheWVycyhkYXRhKTtcblxuICAgICAgICAvLyBBIFwic3ludGhldGljXCIgdGlsZSB0aGF0IGFkanVzdHMgdGhlIHRpbGUgbWluIGFuY2hvciB0byBhY2NvdW50IGZvciB0aWxlIGxvbmdpdHVkZSB3cmFwcGluZ1xuICAgICAgICBsZXQgYW5jaG9yID0ge1xuICAgICAgICAgICAgY29vcmRzOiB0aWxlLmN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EpO1xuICAgICAgICBkZWxldGUgc291cmNlLmRhdGE7IC8vIGNvbW1lbnQgb3V0IHRvIHNhdmUgcmF3IGRhdGEgZm9yIGRlYnVnZ2luZ1xuICAgIH1cblxuICAgIC8vIExvb3AgdGhyb3VnaCBsYXllcnMvZmVhdHVyZXMgdXNpbmcgTWFwYm94IGxpYiBBUEksIGNvbnZlcnQgdG8gR2VvSlNPTiBmZWF0dXJlc1xuICAgIC8vIFJldHVybnMgYW4gb2JqZWN0IHdpdGgga2V5cyBmb3IgZWFjaCBsYXllciwgZS5nLiB7IGxheWVyOiBnZW9qc29uIH1cbiAgICB0b0dlb0pTT04gKHRpbGUpIHtcbiAgICAgICAgdmFyIGxheWVycyA9IHt9O1xuICAgICAgICBmb3IgKHZhciBsIGluIHRpbGUubGF5ZXJzKSB7XG4gICAgICAgICAgICB2YXIgbGF5ZXIgPSB0aWxlLmxheWVyc1tsXTtcbiAgICAgICAgICAgIHZhciBsYXllcl9nZW9qc29uID0ge1xuICAgICAgICAgICAgICAgIHR5cGU6ICdGZWF0dXJlQ29sbGVjdGlvbicsXG4gICAgICAgICAgICAgICAgZmVhdHVyZXM6IFtdXG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICBmb3IgKHZhciBmPTA7IGYgPCBsYXllci5sZW5ndGg7IGYrKykge1xuICAgICAgICAgICAgICAgIHZhciBmZWF0dXJlID0gbGF5ZXIuZmVhdHVyZShmKTtcbiAgICAgICAgICAgICAgICB2YXIgZmVhdHVyZV9nZW9qc29uID0ge1xuICAgICAgICAgICAgICAgICAgICB0eXBlOiAnRmVhdHVyZScsXG4gICAgICAgICAgICAgICAgICAgIGdlb21ldHJ5OiB7fSxcbiAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllczogZmVhdHVyZS5wcm9wZXJ0aWVzXG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIHZhciBnZW9tZXRyeSA9IGZlYXR1cmVfZ2VvanNvbi5nZW9tZXRyeTtcbiAgICAgICAgICAgICAgICB2YXIgY29vcmRpbmF0ZXMgPSBmZWF0dXJlLmxvYWRHZW9tZXRyeSgpO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIHI9MDsgciA8IGNvb3JkaW5hdGVzLmxlbmd0aDsgcisrKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciByaW5nID0gY29vcmRpbmF0ZXNbcl07XG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGM9MDsgYyA8IHJpbmcubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJpbmdbY10gPSBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmluZ1tjXS54LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJpbmdbY10ueVxuICAgICAgICAgICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBnZW9tZXRyeS5jb29yZGluYXRlcyA9IGNvb3JkaW5hdGVzO1xuXG4gICAgICAgICAgICAgICAgaWYgKFZlY3RvclRpbGVGZWF0dXJlLnR5cGVzW2ZlYXR1cmUudHlwZV0gPT09ICdQb2ludCcpIHtcbiAgICAgICAgICAgICAgICAgICAgZ2VvbWV0cnkudHlwZSA9ICdQb2ludCc7XG4gICAgICAgICAgICAgICAgICAgIGdlb21ldHJ5LmNvb3JkaW5hdGVzID0gZ2VvbWV0cnkuY29vcmRpbmF0ZXNbMF1bMF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKFZlY3RvclRpbGVGZWF0dXJlLnR5cGVzW2ZlYXR1cmUudHlwZV0gPT09ICdMaW5lU3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoY29vcmRpbmF0ZXMubGVuZ3RoID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBnZW9tZXRyeS50eXBlID0gJ0xpbmVTdHJpbmcnO1xuICA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0gW107XG4gICAgbGV0IHBvbHkgPSBbXTtcbiAgICBsZXQgb3V0ZXJfd2luZGluZztcbiAgICBmb3IgKGxldCByPTA7IHIgPCBnZW9tLmNvb3JkaW5hdGVzLmxlbmd0aDsgcisrKSB7XG4gICAgICAgIGxldCByaW5nID0gZ2VvbS5jb29yZGluYXRlc1tyXTtcbiAgICAgICAgbGV0IHdpbmRpbmcgPSBHZW8ucmluZ1dpbmRpbmcocmluZyk7XG4gICAgICAgIGlmICh3aW5kaW5nID09IG51bGwpIHtcbiAgICAgICAgICAgIGNvbnRpbnVlOyAvLyBza2lwIHplcm8tYXJlYSByaW5nc1xuICAgICAgICB9XG5cbiAgICAgICAgb3V0ZXJfd2luZGluZyA9IG91dGVyX3dpbmRpbmcgfHwgd2luZGluZzsgLy8gYXNzdW1lIGZpcnN0IHJpbmcgaW5kaWNhdGVzIG91dGVyIHJpbmcgd2luZGluZ1xuXG4gICAgICAgIGlmICh3aW5kaW5nID09PSBvdXRlcl93aW5kaW5nICYmIHBvbHkubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgcG9seXMucHVzaChwb2x5KTtcbiAgICAgICAgICAgIHBvbHkgPSBbXTtcbiAgICAgICAgfVxuICAgICAgICBwb2x5LnB1c2gocmluZyk7XG4gICAgfVxuICAgIGlmIChwb2x5Lmxlbmd0aCA+IDApIHtcbiAgICAgICAgcG9seXMucHVzaChwb2x5KTtcbiAgICB9XG5cbiAgICAvLyBTaW5nbGUgb3IgbXVsdGk/XG4gICAgaWYgKHBvbHlzLmxlbmd0aCA9PT0gMSkge1xuICAgICAgICBnZW9tLnR5cGUgPSAnUG9seWdvbic7XG4gICAgICAgIGdlb20uY29vcmRpbmF0ZXMgPSBwb2x5c1swXTtcbiAgICB9XG4gICAgZWxzZSBpZiAocG9seXMubGVuZ3RoID4gMSkge1xuICAgICAgICBnZW9tLnR5cGUgPSAnTXVsdGlQb2x5Z29uJztcbiAgICAgICAgZ2VvbS5jb29yZGluYXRlcyA9IHBvb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vc3RzXG4gICAgICAgIHRoaXMudGV4dHVyZXMgPSB7fTtcbiAgICB9XG5cbiAgICBsb2FkKHRpbGUpIHtcbiAgICAgICAgdGlsZS5zb3VyY2VfZGF0YSA9IHt9O1xuICAgICAgICB0aWxlLnNvdXJjZV9kYXRhLmxheWVycyA9IHt9O1xuICAgICAgICB0aWxlLnBhZF9zY2FsZSA9IHRoaXMucGFkX3NjYWxlO1xuICAgICAgICB0aWxlLnJhc3RlcnMgPSBbLi4udGhpcy5yYXN0ZXJzXTsgLy8gY29weSBsaXN0IG9mIHJhc3RlcnMgdG8gbG9hZCBmb3IgdGlsZVxuXG4gICAgICAgIC8vIEdlbmVyYXRlIGEgc2luZ2xlIHF1YWQgdGhhdCBmaWxscyB0aGUgZW50aXJlIHRpbGVcbiAgICAgICAgbGV0IHNjYWxlID0gR2VvLnRpbGVfc2NhbGU7XG4gICAgICAgIHRpbGUuc291cmNlX2RhdGEubGF5ZXJzID0ge1xuICAgICAgICAgICAgX2RlZmF1bHQ6IHtcbiAgICAgICAgICAgICAgICB0eXBlOiAnRmVhdHVyZUNvbGxlY3Rpb24nLFxuICAgICAgICAgICAgICAgIGZlYXR1cmVzOiBbe1xuICAgICAgICAgICAgICAgICAgICBnZW9tZXRyeToge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ1BvbHlnb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29vcmRpbmF0ZXM6IFtbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDBdLCBbc2NhbGUsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFtzY2FsZSwgLXNjYWxlXSwgWzAsIC1zY2FsZV0sIFswLCAwXVxuICAgICAgICAgICAgICAgICAgICAgICAgXV1cbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllczoge31cbiAgICAgICAgICAgICAgICB9XVxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuXG4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tb3VyY2UgZXh0ZW5kcyBHZW9KU09OU291cmNlIHtcblxuICAgIHBhcnNlU291cmNlRGF0YSAodGlsZSwgc291cmNlLCByZXNwb25zZSkge1xuICAgICAgICBsZXQgZGF0YSA9IEpTT04ucGFyc2UocmVzcG9uc2UpO1xuICAgICAgICBkYXRhID0gdGhpcy50b0dlb0pTT04oZGF0YSk7XG5cbiAgICAgICAgbGV0IGxheWVycyA9IHRoaXMuZ2V0TGF5ZXJzKGRhdGEpO1xuICAgICAgICBzdXBlci5wcmVwcm9jZXNzTGF5ZXJzKGxheWVycyk7XG4gICAgICAgIHNvdXJjZS5sYXllcnMgPSBsYXllcnM7XG4gICAgfVxuXG4gICAgdG9HZW9KU09OIChkYXRhKSB7XG4gICAgICAgIC8vIFNpbmdsZSBsYXllclxuICAgICAgICBpZiAoZGF0YS5vYmplY3RzICYmXG4gICAgICAgICAgICBPYmplY3Qua2V5cyhkYXRhLm9iamVjdHMpLmxlbmd0aCA9PT0gMSkge1xuICAgICAgICAgICAgbGV0IGxheWVyID0gT2JqZWN0LmtleXMoZGF0YS5vYmplY3RzKVswXTtcbiAgICAgICAgICAgIGRhdGEgPSBnZXRUb3BvSlNPTkZlYXR1cmUoZGF0YSwgZGF0YS5vYmplY3RzW2xheWVyXSk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gTXVsdGlwbGUgbGF5ZXJzXG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgbGV0IGxheWVycyA9IHt9O1xuICAgICAgICAgICAgZm9yIChsZXQga2V5IGluIGRhdGEub2JqZWN0cykge1xuICAgICAgICAgICAgICAgIGxheWVyc1trZXldID0gZ2V0VG9wb0pTT05GZWF0dXJlKGRhdGEsIGRhdGEub2JqZWN0c1trZXldKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRhdGEgPSBsYXllcnM7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGRhdGE7XG4gICAgfVxuXG59XG5cbmZ1bmN0aW9uIGdld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aGlzLnpvb21zW3pvb21dID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKEFycmF5LmlzQXJyYXkoem9vbSkpIHtcbiAgICAgICAgICAgICAgICBmb3IgKGxldCB6PTA7IHogPCB6b29tLmxlbmd0aDsgeisrKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuem9vbXNbem9vbVt6XV0gPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHp0eXBlID09PSAnb2JqZWN0JyAmJiAoem9vbS5taW4gIT0gbnVsbCB8fCB6b29tLm1heCAhPSBudWxsKSkge1xuICAgICAgICAgICAgICAgIGxldCB6bWluID0gem9vbS5taW4gfHwgMDtcbiAgICAgICAgICAgICAgICBsZXQgem1heCA9IHpvb20ubWF4IHx8IDI1OyAvLyBUT0RPOiByZXBsYWNlIGNvbnN0YW50IGZvciBtYXggcG9zc2libGUgem9vbVxuICAgICAgICAgICAgICAgIGZvciAobGV0IHo9em1pbjsgeiA8IHptYXg7IHorKykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnpvb21zW3pdID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGRlbGV0ZSB0aGlzLmZpbHRlci4kem9vbTsgLy8gZG9uJ3QgcHJvY2VzcyB6b29tIHRocm91Z2ggdXN1YWwgZ2VuZXJpYyBmaWx0ZXIgbG9naWNcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGJ1aWxkUHJvcE1hdGNoZXMoKSB7XG4gICAgICAgIGlmICghdGhpcy5maWx0ZXIgfHwgQXJyYXkuaXNBcnJheSh0aGlzLmZpbHRlcikgfHwgdHlwZW9mIHRoaXMuZmlsdGVyID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBPYmplY3Qua2V5cyh0aGlzLmZpbHRlcikuZm9yRWFjaChrZXkgPT4ge1xuICAgICAgICAgICAgaWYgKGJsYWNrbGlzdC5pbmRleE9mKGtleSkgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgbGV0IHZhbCA9IHRoaXMuZmlsdGVyW2tleV07XG4gICAgICAgICAgICAgICAgbGV0IHR5cGUgPSB0eXBlb2YgdmFsO1xuICAgICAgICAgICAgICAgIGxldCBhcnJheSA9IEFycmF5LmlzQXJyYXkodmFsKTtcblxuICAgICAgICAgICAgICAgIGlmICghKGFycmF5IHx8IHR5cGUgPT09ICdzdHJpbmcnIHx8IHR5cGUgPT09ICdudW1iZXInKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKGtleVswXSA9PT0gJyQnKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIENvbnRleHQgcHJvcGVydHlcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jb250ZXh0X3Byb3BfbWF0Y2hlcyA9IHRoaXMuY29udGV4dF9wcm9wX21hdGNoZXMgfHwgW107XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY29udGV4dF9wcm9wX21hdGNoZXMucHVzaChba2V5LnN1YnN0cmluZygxKSwgYXJyYXkgPyB2YWwgOiBbdmFsXV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gRmVhdHVyZSBwcm9wZXJ0eVxuICAgICAgICAgICAgICAgICAgICB0aGlzLmZlYXR1cmVfcHJvcF9tYXRjaGVzID0gdGhpcy5mZWF0dXJlX3Byb3BfbWF0Y2hlcyB8fCBbXTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5mZWF0dXJlX3Byb3BfbWF0Y2hlcy5wdXNoKFtrZXksIGFycmF5ID8gdmFsIDogW3ZhbF1dKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBkZWxldGUgdGhpcy5maWx0ZXJba2V5XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgZG9Qcm9wTWF0Y2hlcyAoY29udGV4dCkge1xuICAgICAgICBpZiAodGhpcy5mZWF0dXJlX3Byb3BfbWF0Y2hlcykge1xuICAgICAgICAgICAgZm9yIChsZXQgcj0wOyByIDwgdGhpcy5mZWF0dXJlX3Byb3BfbWF0Y2hlcy5sZW5ndGg7IHIrKykge1xuICAgICAgICAgICAgICAgIGxldCBtYXRjaCA9IHRoaXMuZmVhdHVyZV9wcm9wX21hdGNoZXNbcl07XG4gICAgICAgICAgICAgICAgbGV0IHZhbCA9IGNvbnRleHQuZmVhdHVyZS5wcm9wZXJ0aWVzW21hdGNoWzBdXTtcbiAgICAgICAgICAgICAgICBpZiAodmFsID09IG51bGwgfHwgbWF0Y2hbMV0uaW5kZXhPZih2YWwpID09PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuY29udGV4dF9wcm9wX21hdGNoZXMpIHtcbiAgICAgICAgICAgIGZvciAobGV0IHI9MDsgciA8IHRoaXMuY29udGV4dF9wcm9wX21hdGNoZXMubGVuZ3RoOyByKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgbWF0Y2ggPSB0aGlzLmNvbnRleHRfcHJvcF9tYXRjaGVzW3JdO1xuICAgICAgICAgICAgICAgIGxldCB2YWwgPSBjb250ZXh0W21hdGNoWzBdXTtcbiAgICAgICAgICAgICAgICBpZiAodmFsID09IG51bGwgfHwgbWF0Y2hbMV0uaW5kZXhPZih2YWwpID09PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbi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biAgICAgICAgICAgIC8vIE9ubHkgZXZhbHVhdGUgZWFjaCBsYXllciBjb21iaW5hdGlvbiBvbmNlICh1bmRlZmluZWQgbWVhbnMgbm90IHlldCBldmFsdWF0ZWQsXG4gICAgICAgICAgICAvLyBudWxsIG1lYW5zIGV2YWx1YXRlZCB3aXRoIG5vIGRyYXcgb2JqZWN0KVxuICAgICAgICAgICAgaWYgKGxheWVyX2NhY2hlW2NhY2hlX2tleV0gPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIC8vIEZpbmQgYWxsIHRoZSB1bmlxdWUgdmlzaWJsZSBkcmF3IGJsb2NrcyBmb3IgdGhpcyBsYXllciB0cmVlXG4gICAgICAgICAgICAgICAgbGV0IGRyYXdfZ3JvdXBzID0gbGF5ZXJzLm1hcCh4ID0+IHggJiYgeC52aXNpYmxlICE9PSBmYWxzZSAmJiB4LmNhbGN1bGF0ZWREcmF3KTtcbiAgICAgICAgICAgICAgICBsZXQgZHJhd19rZXlzID0ge307XG5cbiAgICAgICAgICAgICAgICBmb3IgKGxldCByPTA7IHIgPCBkcmF3X2dyb3Vwcy5sZW5ndGg7IHIrKykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbGF5ZXIgPSBkcmF3X2dyb3Vwc1tyXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFsYXllcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgZz0wOyBnIDwgbGF5ZXIubGVuZ3RoOyBnKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBncm91cCA9IGxheWVyW2ddO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQga2V5IGluIGdyb3VwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd19rZXlzW2tleV0gPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gQ2FsY3VsYXRlIGVhY2ggZHJhdyBncm91cFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGRyYXdfa2V5IGluIGRyYXdfa2V5cykge1xuICAgICAgICAgICAgICAgICAgICBsYXllcl9jYWNoZVtjYWNoZV9rZXldID0gbGF5ZXJfY2FjaGVbY2FjaGVfa2V5XSB8fCB7fTtcbiAgICAgICAgICAgICAgICAgICAgbGF5ZXJfY2FjaGVbY2FjaGVfa2V5XVtkcmF3X2tleV0gPSBtZXJnZVRyZWVzKGRyYXdfZ3JvdXBzLCBkcmF3X2tleSk7XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gT25seSBzYXZlIHRoZSBvbmVzIHRoYXQgd2VyZW4ndCBudWxsXG4gICAgICAgICAgICAgICAgICAgIGlmICghbGF5ZXJfY2FjaGVbY2FjaGVfa2V5XVtkcmF3X2tleV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBsYXllcl9jYWNoZVtjYWNoZV9rZXldW2RyYXdfa2V5XTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxheWVyX2NhY2hlW2NhY2hlX2tleV1bZHJhd19rZXldLmtleSA9IGNhY2hlX2tleSArICcvJyArIGRyYXdfa2V5O1xuICAgICAgICAgICAgICAgICAgICAgICAgbGF5ZXJfY2FjaGVbY2FjaGVfa2V5XVtkcmF3X2tleV0ubGF5ZXJzID0gbGF5ZXJzLm1hcCh4ID0+IHggJiYgeC5mdWxsX25hbWUpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gTm8gbGF5ZXJzIGV2YWx1YXRlZFxuICAgICAgICAgICAgICAgIGlmIChsYXllcl9jYWNoZVtjYWNoZV9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bWF0Y2hlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgY29sbGVjdGVkX2xheWVycy5wdXNoKGN1cnJlbnQpO1xuICAgICAgICAgICAgICAgIGNvbGxlY3RlZF9sYXllcnNfaWRzLnB1c2goY3VycmVudC5pZCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW50LmlzX3RyZWUpIHtcbiAgICAgICAgICAgIGlmIChjdXJyZW50LmRvZXNNYXRjaChjb250ZXh0KSkge1xuICAgICAgICAgICAgICAgIG1hdGNoZWQgPSB0cnVlO1xuXG4gICAgICAgICAgICAgICAgY2hpbGRNYXRjaGVkID0gbWF0Y2hGZWF0dXJlKFxuICAgICAgICAgICAgICAgICAgICBjb250ZXh0LFxuICAgICAgICAgICAgICAgICAgICBjdXJyZW50LmxheWVycyxcbiAgICAgICAgICAgICAgICAgICAgY29sbGVjdGVkX2xheWVycyxcbiAgICAgICAgICAgICAgICAgICAgY29sbGVjdGVkX2xheWVyc19pZHNcbiAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgaWYgKCFjaGlsZE1hdGNoZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29sbGVjdGVkX2xheWVycy5wdXNoKGN1cnJlbnQpO1xuICAgICAgICAgICAgICAgICAgICBjb2xsZWN0ZWRfbGF5ZXJzX2lkcy5wdXNoKGN1cnJlbnQuaWQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBtYXRjaGVkO1xufVxuIiwiLy8gUmVuZGVycyBhbiBhcnJheSBzcGVjaWZ5aW5nIGEgbGluZSBwYXR0ZXJuIG9mIGFsdGVybmF0aW5nIGRhc2hlcyBhbmQgc3BhY2VzLFxuLy8gc2ltaWxhciB0byBhbiBTVkcgYGRhc2hhcnJheWAgb3IgQ2FudmFzIHNldExpbmVEYXNoKCksIGludG8gYSBieXRlIGFycmF5IG9m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Rfd2lkdGgsIGNvbnRleHQpICogMjtcblxuICAgICAgICAgICAgaWYgKChvdXRsaW5lX3dpZHRoID09PSAwICYmIG91dGxpbmVfbmV4dF93aWR0aCA9PT0gMCkgfHwgb3V0bGluZV93aWR0aCA8IDAgfHwgb3V0bGluZV9uZXh0X3dpZHRoIDwgMCkge1xuICAgICAgICAgICAgICAgIC8vIHNraXAgbGluZXMgdGhhdCBkb24ndCBpbnRlcnBvbGF0ZSBiZXR3ZWVuIHplcm8gb3IgZ3JlYXRlciB3aWR0aFxuICAgICAgICAgICAgICAgIHN0eWxlLm91dGxpbmUud2lkdGgudmFsdWUgPSBudWxsO1xuICAgICAgICAgICAgICAgIHN0eWxlLm91dGxpbmUubmV4dF93aWR0aC52YWx1ZSA9IG51bGw7XG4gICAgICAgICAgICAgICAgc3R5bGUub3V0bGluZS5jb2xvciA9IG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBNYWludGFpbiBjb25zaXN0ZW50IG91dGxpbmUgd2lkdGggYXJvdW5kIHRoZSBsaW5lIGZpbGxcbiAgICAgICAgICAgICAgICBzdHlsZS5vdXRsaW5lLndpZHRoLnZhbHVlID0gb3V0bGluZV93aWR0aCArIHdpZHRoO1xuICAgICAgICAgICAgICAgIHN0eWxlLm91dGxpbmUubmV4dF93aWR0aC52YWx1ZSA9IG91dGxpbmVfbmV4dF93aWR0aCArIG5leHRfd2lkdGg7XG5cbiAgICAgICAgICAgICAgICBzdHlsZS5vdXRsaW5lLmNvbG9yID0gZHJhdy5vdXRsaW5lLmNvbG9yO1xuICAgICAgICAgICAgICAgIHN0eWxlLm91dGxpbmUuY2FwID0gZHJhdy5vdXRsaW5lLmNhcCB8fCBkcmF3LmNhcDtcbiAgICAgICAgICAgICAgICBzdHlsZS5vdXRsaW5lLmpvaW4gPSBkcmF3Lm91dGxpbmUuam9pbiB8fCBkcmF3LmpvaW47XG4gICAgICAgICAgICAgICAgc3R5bGUub3V0bGluZS5taXRlcl9saW1pdCA9IGRyYXcub3V0bGluZS5taXRlcl9saW1pdCB8fCBkcmF3Lm1pdGVyX2xpbWl0O1xuICAgICAgICAgICAgICAgIHN0eWxlLm91dGxpbmUuc3R5bGUgPSBkcmF3Lm91dGxpbmUuc3R5bGUgfHwgdGhpcy5uYW1lO1xuXG4gICAgICAgICAgICAgICAgLy8gRXhwbGljaXRseSBkZWZpbmVkIG91dGxpbmUgb3JkZXIsIG9yIGluaGVyaXRlZCBmcm9tIGlubmVyIGxpbmVcbiAgICAgICAgICAgICAgICBpZiAoZHJhdy5vdXRsaW5lLm9yZGVyKSB7XG4gICAgICAgICAgICAgICAgICAgIHN0eWxlLm91dGxpbmUub3JkZXIgPSB0aGlzLnBhcnNlT3JkZXIoZHJhdy5vdXRsaW5lLm9yZGVyLCBjb250ZXh0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHN0eWxlLm91dGxpbmUub3JkZXIgPSBzdHlsZS5vcmRlcjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBEb24ndCBsZXQgb3V0bGluZSBiZSBhYm92ZSBpbm5lciBsaW5lXG4gICAgICAgICAgICAgICAgaWYgKHN0eWxlLm91dGxpbmUub3JkZXIgPiBzdHlsZS5vcmRlcikge1xuICAgICAgICAgICAgICAgICAgICBzdHlsZS5vdXRsaW5lLm9yZGVyID0gc3R5bGUub3JkZXI7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gT3V0bGluZXMgYXJlIGFsd2F5cyBhdCBoYWxmLWxheWVyIGludGVydmFscyB0byBhdm9pZCBjb25mbGljdGluZyB3aXRoIGlubmVyIGxpbmVzXG4gICAgICAgICAgICAgICAgc3R5bGUub3V0bGluZS5vcmRlciAtPSAwLjU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZS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ZSwgY29udGV4dCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBNYWluIGxpbmVcbiAgICAgICAgdGhpcy5mZWF0dXJlX3N0eWxlID0gdGhpcy5pbmxpbmVfZmVhdHVyZV9zdHlsZTsgLy8gcmVzdG9yZSBjYWxjdWxhdGVkIHN0eWxlIGZvciBpbmxpbmVcbiAgICAgICAgbGV0IHZlcnRleF90ZW1wbGF0ZSA9IHRoaXMubWFrZVZlcnRleFRlbXBsYXRlKHN0eWxlKTtcbiAgICAgICAgYnVpbGRQb2x5bGluZXMoXG4gICAgICAgICAgICBsaW5lcyxcbiAgICAgICAgICAgIHN0eWxlLndpZHRoLFxuICAgICAgICAgICAgdmVydGV4X2RhdGEsXG4gICAgICAgICAgICB2ZXJ0ZXhfdGVtcGxhdGUsXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgY2FwOiBzdHlsZS5jYXAsXG4gICAgICAgICAgICAgICAgam9pbjogc3R5bGUuam9pbixcbiAgICAgICAgICAgICAgICBtaXRlcl9saW1pdDogc3R5bGUubWl0ZXJfbGltaXQsXG4gICAgICAgICAgICAgICAgc2NhbGluZ19pbmRleDogdGhpcy52ZXJ0ZXhfbGF5b3V0LmluZGV4LmFfZXh0cnVkZSxcbiAgICAgICAgICAgICAgICBzY2FsaW5nX25vcm1hbGl6ZTogMjU2LCAvLyB2YWx1ZXMgaGF2ZSBhbiA4LWJpdCBmcmFjdGlvblxuICAgICAgICAgICAgICAgIHRleGNvb3JkX2luZGV4OiB0aGlzLnZlcnRleF9sYXlvdXQuaW5kZXguYV90ZXhjb29yZCxcbiAgICAgICAgICAgICAgICB0ZXhjb29yZF93aWR0aDogKHN0eWxlLndpZHRoIHx8IHN0eWxlLm5leHRfd2lkdGgpIC8gY29udGV4dC50aWxlLm92ZXJ6b29tMiwgLy8gVVZzIGNhbid0IGNhbGMgZm9yIHplcm8td2lkdGgsIHVzZSBuZXh0IHpvb20gd2lkdGggaW4gdGh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ICghVGV4dHVyZS50ZXh0dXJlc1t0aGlzLnRleHR1cmVdLnNwcml0ZXNbc3ByaXRlXSkge1xuICAgICAgICAgICAgICAgIC8vIElmIHNwcml0ZSBub3QgZm91bmQsIGNoZWNrIGZvciBkZWZhdWx0IHNwcml0ZVxuICAgICAgICAgICAgICAgIGlmIChzdHlsZS5zcHJpdGVfZGVmYXVsdCkge1xuICAgICAgICAgICAgICAgICAgICBzcHJpdGUgPSBzdHlsZS5zcHJpdGVfZGVmYXVsdDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFUZXh0dXJlLnRleHR1cmVzW3RoaXMudGV4dHVyZV0uc3ByaXRlc1tzcHJpdGVdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsb2coJ3dhcm4nLCBgU3R5bGU6IGluIHN0eWxlICcke3RoaXMubmFtZX0nLCBjb3VsZCBub3QgZmluZCBkZWZhdWx0IHNwcml0ZSAnJHtzcHJpdGV9JyBmb3IgdGV4dHVyZSAnJHt0aGlzLnRleHR1cmV9J2ApO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXRoaXMudGV4dHVyZV9taXNzaW5nX3Nwcml0ZXNbc3ByaXRlXSkgeyAvLyBvbmx5IGxvZyBlYWNoIG1pc3Npbmcgc3ByaXRlIG9uY2VcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvZygnZGVidWcnLCBgU3R5bGU6IGluIHN0eWxlICcke3RoaXMubmFtZX0nLCBjb3VsZCBub3QgZmluZCBzcHJpdGUgJyR7c3ByaXRlfScgZm9yIHRleHR1cmUgJyR7dGhpcy50ZXh0dXJlfSdgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMudGV4dHVyZV9taXNzaW5nX3Nwcml0ZXNbc3ByaXRlXSA9IHRydWU7XG4gIC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ZSB3YXMgY2FuY2VsZWQ6ICR7dGlsZS5rZXl9YCk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgcXVldWUgPSB0aGlzLnF1ZXVlc1t0aWxlLmtleV07XG4gICAgICAgIHRoaXMucXVldWVzW3RpbGUua2V5XSA9IFtdO1xuXG4gICAgICAgIC8vIEZvciBlYWNoIHBvaW50IGZlYXR1cmUsIGNyZWF0ZSBvbmUgb3IgbW9yZSBsYWJlbHNcbiAgICAgICAgbGV0IHRleHRfb2JqcyA9IFtdO1xuICAgICAgICBsZXQgcG9pbnRfb2JqcyA9IFtdO1xuXG4gICAgICAgIHF1ZXVlLmZvckVhY2gocSA9PiB7XG4gICAgICAgICAgICBsZXQgc3R5bGUgPSBxLnN0eWxlO1xuICAgICAgICAgICAgbGV0IGZlYXR1cmUgPSBxLmZlYXR1cmU7XG4gICAgICAgICAgICBsZXQgZ2VvbWV0cnkgPSBmZWF0dXJlLmdlb21ldHJ5O1xuXG4gICAgICAgICAgICBsZXQgZmVhdHVyZV9sYWJlbHMgPSB0aGlzLmJ1aWxkTGFiZWxzKHN0eWxlLnNpemUsIGdlb21ldHJ5LCBzdHlsZSk7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGZlYXR1cmVfbGFiZWxzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGxhYmVsID0gZmVhdHVyZV9sYWJlbHNbaV07XG4gICAgICAgICAgICAgICAgbGV0IHBvaW50X29iaiA9IHtcbiAgICAgICAgICAgICAgICAgICAgZmVhdHVyZSxcbiAgICAgICAgICAgICAgICAgICAgZHJhdzogcS5kcmF3LFxuICAgICAgICAgICAgICAgICAgICBjb250ZXh0OiBxLmNvbnRleHQsXG4gICAgICAgICAgICAgICAgICAgIHN0eWxlLFxuICAgICAgICAgICAgICAgICAgICBsYWJlbFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgcG9pbnRfb2Jqcy5wdXNoKHBvaW50X29iaik7XG5cbiAgICAgICAgICAgICAgICBpZiAocS50ZXh0X2ZlYXR1cmUpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRleHRfb2JqID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgZmVhdHVyZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRyYXc6IHEudGV4dF9mZWF0dXJlLmRyYXcsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0OiBxLmNvbnRleHQsXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0OiBxLnRleHRfZmVhdHVyZS50ZXh0LFxuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dF9zZXR0aW5nc19rZXk6IHEudGV4dF9mZWF0dXJlLnRleHRfc2V0dGluZ3Nfa2V5LFxuICAgICAgICAgICAgICAgICAgICAgICAgbGF5b3V0OiBxLnRleHRfZmVhdHVyZS5sYXlvdXQsXG4gICAgICAgICAgICAgICAgICAgICAgICBwb2ludF9sYWJlbDogbGFiZWwsXG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5rZWQ6IHBvaW50X29iaiAgIC8vIGxpbmsgc28gdGV4dCBvbmx5IHJlbmRlcnMgd2hlbiBwYXJlbnQgcG9pbnQgaXMgcGxhY2VkXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIHRleHRfb2Jqcy5wdXNoKHRleHRfb2JqKTtcblxuICAgICAgICAgICAgICAgICAgICAvLyBVbmxlc3MgdGV4dCBmZWF0dXJlIGlzIG9wdGlvbmFsLCBjcmVhdGUgYSB0d28td2F5IGxpbmsgc28gdGhhdCBwYXJlbnRcbiAgICAgICAgICAgICAgICAgICAgLy8gcG9pbnQgd2lsbCBvbmx5IHJlbmRlciB3aGVuIHRleHQgaXMgYWxzbyBwbGFjZWRcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFxLmRyYXcudGV4dC5vcHRpb25hbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRfb2JqLmxpbmtlZCA9IHRleHRfb2JqOyAvLyB0d28td2F5IGxpbmtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gQ29sbGlkZSBib3RoIHBvaW50cyBhbmQgdGV4dCwgdGhlbiBidWlsZCBmZWF0dXJlc1xuICAgICAgICByZXR1cm4gUHJvbWlzZS5cbiAgICAgICAgICAgIGFsbChbXG4gICAgICAgICAgICAgICAgLy8gUG9pbnRzXG4gICAgICAgICAgICAgICAgQ29sbGlzaW9uLmNvbGxpZGUocG9pbnRfb2JqcywgdGhpcy5jb2xsaXNpb25fZ3JvdXBfcG9pbnRzLCB0aWxlLmtleSkudGhlbihwb2ludF9vYmpzID0+IHtcbiAgICAgICAgICAgICAgICAgICAgcG9pbnRfb2Jqcy5mb3JFYWNoKHEgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5mZWF0dXJlX3N0eWxlID0gcS5zdHlsZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZmVhdHVyZV9zdHlsZS5sYWJlbCA9IHEubGFiZWw7XG4gICAgICAgICAgICAgICAgICAgICAgICBTdHlsZS5hZGRGZWF0dXJlLmNhbGwodGhpcywgcS5mZWF0dXJlLCBxLmRyYXcsIHEuY29udGV4dCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgIC8vIExhYmVsc1xuICAgICAgICAgICAgICAgIHRoaXMucHJlcGFyZVRleHRMYWJlbHModGlsZSwgdGhpcy5jb2xsaXNpb25fZ3JvdXBfdGV4dCwgdGV4dF9vYmpzKS5cbiAgICAgICAgICAgICAgICAgICAgdGhlbihsYWJlbHMgPT4gdGhpcy5jb2xsaWRlQW5kUmVuZGVyVGV4dExhYmVscyh0aWxlLCB0aGlzLmNvbGxpc2lvbl9ncm91cF90ZXh0LCBsYWJlbHMpKVxuICAgICAgICAgICAgXSkudGhlbigoWywgeyBsYWJlbHMsIHRleHRzLCB0ZXh0dXJlIH1dKSA9PiB7XG4gICAgICAgICAgICAgICAgLy8gUHJvY2VzcyBsYWJlbHNcbiAgICAgICAgICAgICAgICBpZiAobGFiZWxzICYmIHRleHRzKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIEJ1aWxkIHF1ZXVlZCBmZWF0dXJlc1xuICAgICAgICAgICAgICAgICAgICBsYWJlbHMuZm9yRWFjaChxID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ZXh0X3NldHRpbmdzX2tleSA9IHEudGV4dF9zZXR0aW5nc19rZXk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGV4dF9pbmZvID0gdGV4dHNbdGV4dF9zZXR0aW5nc19rZXldICYmIHRleHRzW3RleHRfc2V0dGluZ3Nfa2V5XVtxLnRleHRdO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzZXR1cCBzdHlsaW5nIG9iamVjdCBleHBlY3RlZCBieSBTdHlsZSBjbGFzc1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN0eWxlID0gdGhpcy5mZWF0dXJlX3N0eWxlO1xuICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGUubGFiZWwgPSBxLmxhYmVsO1xuICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGUuc2l6ZSA9IHRleHRfaW5mby5zaXplLmxvZ2ljYWxfc2l6ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlLnRleGNvb3JkcyA9IHRleHRfaW5mby5hbGlnbltxLmxhYmVsLmFsaWduXS50ZXhjb29yZHM7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHlsZS5hbmdsZSA9IHEubGFiZWwuYW5nbGUgfHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlLnNhbXBsZXIgPSAxOyAvLyBub24tMCA9IGxhYmVsc1xuXG4gICAgICAgICAgICAgICAgICAgICAgICBTdHlsZS5hZGRGZWF0dXJlLmNhbGwodGhpcywgcS5mZWF0dXJlLCBxLmRyYXcsIHEuY29udGV4dCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLmZyZWVUZXh0KHRpbGUpO1xuXG4gICAgICAgICAgICAgICAgLy8gRmluaXNoIHRpbGUgbWVzaFxuICAgICAgICAgICAgICAgIHJldHVybiBTdHlsZS5lbmREYXRhLmNhbGwodGhpcywgdGlsZSkudGhlbih0aWxlX2RhdGEgPT4ge1xuICAgICAgICAgICAgICAgICAgICAvLyBBdHRhY2ggdGlsZS1zcGVjaWZpYyBsYWJlbCBhdGxhcyB0byBtZXNoIGFzIGEgdGV4dHVyZSB1bmlmb3JtXG4gICAgICAgICAgICAgICAgICAgIGlmICh0ZXh0dXJlICYmIHRpbGVfZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGlsZV9kYXRhLnVuaWZvcm1zID0gdGlsZV9kYXRhLnVuaWZvcm1zIHx8IHt9O1xuICAgICAgICAgICAgICAgICAgICAgICAgdGlsZV9kYXRhLnRleHR1cmVzID0gdGlsZV9kYXRhLnRleHR1cmVzIHx8IFtdO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICB0aWxlX2RhdGEudW5pZm9ybXMudV9sYWJlbF90ZXh0dXJlID0gdGV4dHVyZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpbGVfZGF0YS50ZXh0dXJlcy5wdXNoKHRleHR1cmUpOyAvLyBhc3NpZ24gdGV4dHVyZSBvd25lcnNoaXAgdG8gdGlsZVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aWxlX2RhdGE7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICB9LFxuXG4gICAgX3ByZXByb2Nlc3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ciBUZXh0TGFiZWxzIG1peGluXG4gICAgYnVpbGRUZXh0TGFiZWxzICh0aWxlX2tleSwgZmVhdHVyZV9xdWV1ZSkge1xuICAgICAgICBsZXQgbGFiZWxzID0gW107XG4gICAgICAgIGZvciAobGV0IGY9MDsgZiA8IGZlYXR1cmVfcXVldWUubGVuZ3RoOyBmKyspIHtcbiAgICAgICAgICAgIGxldCBmcSA9IGZlYXR1cmVfcXVldWVbZl07XG4gICAgICAgICAgICBsZXQgdGV4dF9pbmZvID0gdGhpcy50ZXh0c1t0aWxlX2tleV1bZnEudGV4dF9zZXR0aW5nc19rZXldW2ZxLnRleHRdO1xuICAgICAgICAgICAgbGV0IHNpemUgPSB0ZXh0X2luZm8uc2l6ZS5jb2xsaXNpb25fc2l6ZTtcbiAgICAgICAgICAgIGZxLmxhYmVsID0gbmV3IExhYmVsUG9pbnQoZnEucG9pbnRfbGFiZWwucG9zaXRpb24sIHNpemUsIGZxLmxheW91dCk7XG4gICAgICAgICAgICBsYWJlbHMucHVzaChmcSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGxhYmVscztcbiAgICB9LFxuXG4gICAgLy8gQnVpbGRzIG9uZSBvciBtb3JlIHBvaW50IGxhYmVscyBmb3IgYSBnZW9tZXRyeVxuICAgIGJ1aWxkTGFiZWxzIChzaXplLCBnZW9tZXRyeSwgb3B0aW9ucykge1xuICAgICAgICBsZXQgbGFiZWxzID0gW107XG5cbiAgICAgICAgaWYgKGdlb21ldHJ5LnR5cGUgPT09IFwiUG9pbnRcIikge1xuICAgICAgICAgICAgbGFiZWxzLnB1c2gobmV3IExhYmVsUG9pbnQoZ2VvbWV0cnkuY29vcmRpbmF0ZXMsIHNpemUsIG9wdGlvbnMpKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChnZW9tZXRyeS50eXBlID09PSBcIk11bHRpUG9pbnRcIikge1xuICAgICAgICAgICAgbGV0IHBvaW50cyA9IGdlb21ldHJ5LmNvb3JkaW5hdGVzO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBwb2ludHMubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgICAgICAgICBsZXQgcG9pbnQgPSBwb2ludHNbaV07XG4gICAgICAgICAgICAgICAgbGFiZWxzLnB1c2gobmV3IExhYmVsUG9pbnQocG9pbnQsIHNpemUsIG9wdGlvbnMpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChnZW9tZXRyeS50eXBlID09PSBcIkxpbmVTdHJpbmdcIikge1xuICAgICAgICAgICAgLy8gUG9pbnQgYXQgZWFjaCBsaW5lIHZlcnRleFxuICAgICAgICAgICAgbGV0IHBvaW50cyA9IGdlb21ldHJ5LmNvb3JkaW5hdGVzO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBwb2ludHMubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgICAgICAgICBsYWJlbHMucHVzaChuZXcgTGFiZWxQb2ludChwb2ludHNbaV0sIHNpemUsIG9wdGlvbnMpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChnZW9tZXRyeS50eXBlID09PSBcIk11bHRpTGluZVN0cmluZ1wiKSB7XG4gICAgICAgICAgICAvLyBQb2ludCBhdCBlYWNoIGxpbmUgdmVydGV4XG4gICAgICAgICAgICBsZXQgbGluZXMgPSBnZW9tZXRyeS5jb29yZGluYXRlcztcbiAgICAgICAgICAgIGZvciAobGV0IGxuID0gMDsgbG4gPCBsaW5lcy5sZW5ndGg7IGxuKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgcG9pbnRzID0gbGluZXNbbG5dO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcG9pbnRzLmxlbmd0aDsgKytpKSB7XG4gICAgICAgICAgICAgICAgICAgIGxhYmVscy5wdXNoKG5ldyBMYWJlbFBvaW50KHBvaW50c1tpXSwgc2l6ZSwgb3B0aW9ucykpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChnZW9tZXRyeS50eXBlID09PSBcIlBvbHlnb25cIikge1xuICAgICAgICAgICAgLy8gUG9pbnQgYXQgcG9seWdvbiBjZW50cm9pZCAob2Ygb3V0ZXIgcmluZylcbiAgICAgICAgICAgIGlmIChvcHRpb25zLmNlbnRyb2lkKSB7XG4gICAgICAgICAgICAgICAgbGV0IGNlbnRyb2lkID0gR2VvLmNlbnRyb2lkKGdlb21ldHJ5LmNvb3JkaW5hdGVzKTtcbiAgICAgICAgICAgICAgICBsYWJlbHMucHVzaChuZXcgTGFiZWxQb2ludChjZW50cm9pZCwgc2l6ZSwgb3B0aW9ucykpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gUG9pbnQgYXQgZWFjaCBwb2x5Z29uIHZlcnRleCAoYWxsIHJpbmdzKVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IHJpbmdzID0gZ2VvbWV0cnkuY29vcmRpbmF0ZXM7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgbG4gPSAwOyBsbiA8IHJpbmdzLmxlbmd0aDsgbG4rKykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgcG9pbnRzID0gcmluZ3NbbG5dO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHBvaW50cy5sZW5ndGg7ICsraSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGFiZWxzLnB1c2gobmV3IExhYmVsUG9pbnQocG9pbnRzW2ldLCBzaXplLCBvcHRpb25zKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoZ2VvbWV0cnkudHlwZSA9PT0gXCJNdWx0aVBvbHlnb25cIikge1xuICAgICAgICAgICAg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ZXhfZGF0YSwgdmVydGV4X3RlbXBsYXRlKSB7XG4gICAgICAgIGJ1aWxkUXVhZHNGb3JQb2ludHMoXG4gICAgICAgICAgICBwb2ludHMsXG4gICAgICAgICAgICB2ZXJ0ZXhfZGF0YSxcbiAgICAgICAgICAgIHZlcnRleF90ZW1wbGF0ZSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB0ZXhjb29yZF9pbmRleDogdGhpcy52ZXJ0ZXhfbGF5b3V0LmluZGV4LmFfdGV4Y29vcmQsXG4gICAgICAgICAgICAgICAgcG9zaXRpb25faW5kZXg6IHRoaXMudmVydGV4X2xheW91dC5pbmRleC5hX3Bvc2l0aW9uLFxuICAgICAgICAgICAgICAgIHNoYXBlX2luZGV4OiB0aGlzLnZlcnRleF9sYXlvdXQuaW5kZXguYV9zaGFwZSxcbiAgICAgICAgICAgICAgICBvZmZzZXRfaW5kZXg6IHRoaXMudmVydGV4X2xheW91dC5pbmRleC5hX29mZnNldFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBxdWFkOiBzaXplLFxuICAgICAgICAgICAgICAgIHF1YWRfbm9ybWFsaXplOiAyNTYsICAgIC8vIHZhbHVlcyBoYXZlIGFuIDgtYml0IGZyYWN0aW9uXG4gICAgICAgICAgICAgICAgb2Zmc2V0LFxuICAgICAgICAgICAgICAgIGFuZ2xlOiBhbmdsZSAqIDQwOTYsICAgIC8vIHZhbHVlcyBoYXZlIGEgMTItYml0IGZyYWN0aW9uXG4gICAgICAgICAgICAgICAgc2hhcGVfdzogc2FtcGxlcixcbiAgICAgICAgICAgICAgICB0ZXhjb29yZF9zY2FsZSxcbiAgICAgICAgICAgICAgICB0ZXhjb29yZF9ub3JtYWxpemU6IDY1NTM1XG4gICAgICAgICAgICB9XG4gICAgICAgICk7XG4gICAgfSxcblxuICAgIC8vIEJ1aWxkIHF1YWQgZm9yIHBvaW50IHNwcml0ZVxuICAgIGJ1aWxkIChzdHls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BkYXRhIGZvciBjdXJyZW50IHZlcnRleFxuICAgICAgICApO1xuICAgIH0sXG5cbiAgICBidWlsZEFydGljdWxhdGVkTGFiZWwgKGxhYmVsLCBzdHlsZSwgdmVydGV4X2RhdGEpIHtcbiAgICAgICAgbGV0IHZlcnRleF90ZW1wbGF0ZSA9IHRoaXMubWFrZVZlcnRleFRlbXBsYXRlKHN0eWxlKTtcblxuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxhYmVsLm51bV9zZWdtZW50czsgaSsrKXtcbiAgICAgICAgICAgIGxldCBhbmdsZSA9IGxhYmVsLmFuZ2xlW2ldO1xuICAgICAgICAgICAgbGV0IHNpemUgPSBzdHlsZS5zaXplW2ldO1xuICAgICAgICAgICAgbGV0IG9mZnNldCA9IGxhYmVsLm9mZnNldHNbaV07XG4gICAgICAgICAgICBsZXQgdGV4Y29vcmQgPSBzdHlsZS50ZXhjb29yZHNbaV07XG5cbiAgICAgICAgICAgIHRoaXMuYnVpbGRRdWFkKFxuICAgICAgICAgICAgICAgIFtsYWJlbC5wb3NpdGlvbl0sICAgICAgICAgICAgICAgLy8gcG9zaXRpb25cbiAgICAgICAgICAgICAgICBzaXplLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNpemUgaW4gcGl4ZWxzXG4gICAgICAgICAgICAgICAgYW5nbGUsICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhbmdsZSBpbiBkZWdyZWVzXG4gICAgICAgICAgICAgICAgc3R5bGUuc2FtcGxlciwgICAgICAgICAgICAgICAgICAvLyB0ZXh0dXJlIHNhbXBsZXIgdG8gdXNlXG4gICAgICAgICAgICAgICAgb2Zmc2V0LCAgICAgICAgICAgICAgICAgICAgICAgICAvLyBvZmZzZXQgZnJvbSBjZW50ZXIgaW4gcGl4ZWxzXG4gICAgICAgICAgICAgICAgdGV4Y29vcmQsICAgICAgICAgICAgICAgICAgICAgICAvLyB0ZXh0dXJlIFVWc1xuICAgICAgICAgICAgICAgIHZlcnR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jb29yZCxcbiAgICAgICAgICAgIHRleGNvb3JkX25vcm1hbGl6ZTogNjU1MzUsIC8vIHNjYWxlIFVWcyB0byB1bnNpZ25lZCBzaG9ydHNcbiAgICAgICAgICAgIHJlbW92ZV90aWxlX2VkZ2VzOiAhc3R5bGUudGlsZV9lZGdlcyxcbiAgICAgICAgICAgIHRpbGVfZWRnZV90b2xlcmFuY2U6IEdlby50aWxlX3NjYWxlICogY29udGV4dC50aWxlLnBhZF9zY2FsZSAqIDQsXG4gICAgICAgICAgICB3aW5kaW5nOiBjb250ZXh0LndpbmRpbmdcbiAgICAgICAgfTtcblxuICAgICAgICAvLyBFeHRydWRlZCBwb2x5Z29ucyAoZS5nLiAzRCBidWlsZGluZ3MpXG4gICAgICAgIGlmIChzdHlsZS5leHRydWRlICYmIHN0eWxlLmhlaWdodCkge1xuICAgICAgICAgICAgYnVpbGRFeHRydWRlZFBvbHlnb25zKFxuICAgICAgICAgICAgICAgIHBvbHlnb25zLFxuICAgICAgICAgICAgICAgIHN0eWxlLnosIHN0eWxlLmhlaWdodCwgc3R5bGUubWluX2hlaWdodCxcbiAgICAgICAgICAgICAgICB2ZXJ0ZXhfZGF0YSwgdmVydGV4X3RlbXBsYXRlLFxuICAgICAgICAgICAgICAgIHRoaXMudmVydGV4X2xheW91dC5pbmRleC5hX25vcm1hbCxcbiAgICAgICAgICAgICAgICAxMjcsIC8vIHNjYWxlIG5vcm1hbHMgdG8gc2lnbmVkIGJ5dGVzXG4gICAgICAgICAgICAgICAgb3B0aW9uc1xuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuICAgICAgICAvLyBSZWd1bGFyIHBvbHlnb25zXG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgYnVpbGRQb2x5Z29ucyhcbiAgICAgICAgICAgICAgICBwb2x5Z29ucyxcbiAgICAgICAgICAgICAgICB2ZXJ0ZXhfZGF0YSwgdmVydGV4X3RlbXBsYXRlLFxuICAgICAgICAgICAgICAgIG9wdGlvbnNcb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ICAgICAgdGhpcy5pbml0aWFsaXplZCA9IGZhbHNlO1xuICAgIH0sXG5cbiAgICByZXNldCAoKSB7XG4gICAgfSxcblxuICAgIGlzQnVpbHRJbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmhhc093blByb3BlcnR5KCdidWlsdF9pbicpICYmIHRoaXMuYnVpbHRfaW47XG4gICAgfSxcblxuICAgIGZpbGxWZXJ0ZXhUZW1wbGF0ZShhdHRyaWJ1dGUsIHZhbHVlLCB7IHNpemUsIG9mZnNldCB9KSB7XG4gICAgICAgIG9mZnNldCA9IChvZmZzZXQgPT09IHVuZGVmaW5lZCkgPyAwIDogb2Zmc2V0O1xuXG4gICAgICAgIGxldCBpbmRleCA9IHRoaXMudmVydGV4X2xheW91dC5pbmRleFthdHRyaWJ1dGVdO1xuICAgICAgICBpZiAoaW5kZXggPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgbG9nKCd3YXJuJywgYFN0eWxlOiBpbiBzdHlsZSAnJHt0aGlzLm5hbWV9Jywgbm8gaW5kZXggZm91bmQgaW4gdmVydGV4IGxheW91dCBmb3IgYXR0cmlidXRlICcke2F0dHJpYnV0ZX0nYCk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHNpemU7ICsraSkge1xuICAgICAgICAgICAgbGV0IHYgPSB2YWx1ZS5sZW5ndGggPiBpID8gdmFsdWVbaV0gOiB2YWx1ZTtcbiAgICAgICAgICAgIHRoaXMudmVydGV4X3RlbXBsYXRlW2luZGV4ICsgaSArIG9mZnNldF0gPSB2O1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIC8qKiogU3R5bGUgcGFyc2luZyBhbmQgZ2VvbWV0cnkgY29uc3RydWN0aW9uICoqKi9cblxuICAgIC8vIFJldHVybnMgYW4gb2JqZWN0IHRvIGhvbGQgZmVhdHVyZSBkYXRhIChmb3IgYSB0aWxlIG9yIG90aGVyIG9iamVjdClc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AgICAge1xuICAgICAgICAgICAgICAgICAgICBuYW1lOiB0aGlzLm5hbWUsXG4gICAgICAgICAgICAgICAgICAgIGRlZmluZXMsXG4gICAgICAgICAgICAgICAgICAgIHVuaWZvcm1zLFxuICAgICAgICAgICAgICAgICAgICBibG9ja3MsXG4gICAgICAgICAgICAgICAgICAgIGJsb2NrX3Njb3BlcyxcbiAgICAgICAgICAgICAgICAgICAgZXh0ZW5zaW9uc1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICB0aGlzLnByb2dyYW0uY29tcGlsZSgpO1xuXG4gICAgICAgICAgICBpZiAodGhpcy5zZWxlY3Rpb24pIHtcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdGlvbl9wcm9ncmFtID0gbmV3IFNoYWRlclByb2dyYW0oXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZ2wsXG4gICAgICAgICAgICAgICAgICAgIHRoaXMudmVydGV4X3NoYWRlcl9zcmMsXG4gICAgICAgICAgICAgICAgICAgIHNoYWRlclNyY19zZWxlY3Rpb25GcmFnbWVudCxcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogKHRoaXMubmFtZSArICcgKHNlbGVjdGlvbiknKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmluZXM6IHNlbGVjdGlvbl9kZWZpbmVzLFxuICAgICAgICAgICAgICAgICAgICAgICAgdW5pZm9ybXMsXG4gICAgICAgICAgICAgICAgICAgICAgICBibG9ja3MsXG4gICAgICAgICAgICAgICAgICAgICAgICBibG9ja19zY29wZXMsXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRlbnNpb25zXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0aW9uX3Byb2dyYW0uY29tcGlsZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7X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kZXIgYXMgYmxhY2spXG4gICAgICAgIHJldHVybiBXb3JrZXJCcm9rZXIucG9zdE1lc3NhZ2UodGhpcy5tYWluX3RocmVhZF90YXJnZXQrJy5sb2FkVGV4dHVyZXMnLCBjb25maWdzKVxuICAgICAgICAgICAgLnRoZW4odGV4dHVyZXMgPT4ge1xuICAgICAgICAgICAgICAgIGlmICghdGV4dHVyZXMgfHwgdGV4dHVyZXMubGVuZ3RoIDwgMSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiB3YXJuaW5nXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aWxlX2RhdGE7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gU2V0IHRleHR1cmUgdW5pZm9ybXMgKHJldHVybmVkIGFmdGVyIGxvYWRpbmcgZnJvbSBtYWluIHRocmVhZClcbiAgICAgICAgICAgICAgICB0aWxlX2RhdGEudW5pZm9ybXMgPSB0aWxlX2RhdGEudW5pZm9ybXMgfHwge307XG4gICAgICAgICAgICAgICAgdGlsZV9kYXRhLnRleHR1cmVzID0gdGlsZV9kYXRhLnRleHR1cmVzIHx8IFtdO1xuXG4gICAgICAgICAgICAgICAgbGV0IHVfc2FtcGxlcnMgPSB0aWxlX2RhdGEudW5pZm9ybXNbJ3VfcmFzdGVycyddID0gW107XG4gICAgICAgICAgICAgICAgbGV0IHVfc2l6ZXMgPSB0aWxlX2RhdGEudW5pZm9ybXNbJ3VfcmFzdGVyX3NpemVzJ10gPSBbXTtcbiAgICAgICAgICAgICAgICBsZXQgdV9vZmZzZXRzID0gdGlsZV9kYXRhLnVuaWZvcm1zWyd1X3Jhc3Rlcl9vZmZzZXRzJ10gPSBbXTtcblxuICAgICAgICAgICAgICAgIGZvciAobGV0IFt0bmFtZSwgdHdpZHRoLCB0aGVpZ2h0XSBvZiB0ZXh0dXJlcykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgaSA9IGluZGV4W3RuYW1lXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJhc3Rlcl9jb29yZHMgPSBjb25maWdzW3RuYW1lXS5jb29yZHM7IC8vIHRpbGUgY29vcmRzIG9mIHJhc3RlciB0aWxlXG5cbiAgICAgICAgICAgICAgICAgICAgdV9zYW1wbGVyc1tpXSA9IHRuYW1lO1xuICAgICAgICAgICAgICAgICAgICB0aWxlX2RhdGEudGV4dHVyZXMucHVzaCh0bmFtZSk7XG5cbiAgICAgICAgICAgICAgICAgICAgdV9zaXplc1tpXSA9IFt0d2lkdGgsIHRoZWlnaHRdO1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIFRpbGUgZ2VvbWV0cnkgbWF5IGJlIGF0IGEgaGlnaGVyIHpvb20gdGhhbiB0aGUgcmFzdGVyIHRpbGUgdGV4dHVyZSxcbiAgICAgICAgICAgICAgICAgICAgLy8gKGUuZy4gYW4gb3Zlcnpvb21lZCByYXN0ZXIgdGlsZSksIGluIHdoaWNoIGNhc2Ugd2UgbmVlZCB0byBhZGp1c3QgdGhlXG4gICAgICAgICAgICAgICAgICAgIC8vIHJhc3RlciB0ZXh0dXJlIFVWcyB0byBvZmZzZXQgdG8gdGhlIGFwcHJvcHJpYXRlIHN0YXJ0aW5nIHBvaW50IGZvclxuICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGdlb21ldHJ5IHRpbGUuXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aWxlLmNvb3Jkcy56ID4gcmFzdGVyX2Nvb3Jkcy56KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZHogPSB0aWxlLmNvb3Jkcy56IC0gcmFzdGVyX2Nvb3Jkcy56OyAvLyAjIG9mIGxldmVscyByYXN0ZXIgc291cmNlIGlzIG92ZXJ6b29tZWRcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkejIgPSBNYXRoLnBvdygyLCBkeik7XG4gICAgICAgICAgICAgICAgICAgICAgICB1X29mZnNldHNbaV0gPSBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRpbGUuY29vcmRzLnggJSBkejIpIC8gZHoyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkejIgLSAxIC0gKHRpbGUuY29vcmRzLnkgJSBkejIpKSAvIGR6MiwgLy8gR0wgdGV4dHVyZSBjb29yZHMgYXJlICtZIHVwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAvIGR6MlxuICAgICAgICAgICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHVfb2Zmc2V0c1tpXSA9IFswLCAwLCAxXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHJldHVybiB0aWxlX2RhdGE7XG4gICAgICAgICAgICB9XG4gICAgICAgICk7XG4gICAgfSxcblxuICAgIC8vIENhbGxlZCBvbiBtYWluIHRocmVhZFxuICAgIGxvYWRUZXh0dXJlcyAodGV4dHVyZXMpIHtcbiAgICAgICAgLy8gTkI6IG9ubHkgcmV0dXJuIG5hbWUgYW5kIHNpemUgb2YgdGV4dHVyZXMgbG9hZGVkLCBiZWNhdXNlIHdlIGNhbid0IHNlbmQgYWN0dWFsIHRleHR1cmUgb2JqZWN0cyB0byB3b3JrZXJcbiAgICAgICAgcmV0dXJuIFRleHR1cmUuY3JlYXRlRnJvbU9iamVjdCh0aGlzLmdsLCB0ZXh0dXJlcylcbiAgICAgICAgICAgIC50aGVuKCgpID0+IHtcbiAgICAgICAgICAgICAgICByZXR1cm4gUHJvbWlzZS5hbGwoT2JqZWN0LmtleXModGV4dHVyZXMpLm1hcCh0ID0+IHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFRleHR1cmUudGV4dHVyZXNbdF0gJiYgVGV4dHVyZS50ZXh0dXJlc1t0XS5sb2FkKCk7XG4gICAgICAgICAgICAgICAgfSkuZmlsdGVyKHggPT4ge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BlcnR5KHNoYWRlcnMudW5pZm9ybXMsIHUsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25maWd1cmFibGU6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBVbmlmb3JtIGlzIGV4cGxpY2l0bHkgZGVmaW5lZCBvbiB0aGlzIHN0eWxlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNoYWRlcnMuX3VuaWZvcm1zW3VdICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNoYWRlcnMuX3VuaWZvcm1zW3VdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBVbmlmb3JtIHdhcyBtaXhlZCBmcm9tIGFub3RoZXIgc3R5bGUsIGZvcndhcmQgcmVxdWVzdCB0aGVyZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElkZW50aWZ5IGNoZWNrIGlzIG5lZWRlZCB0byBwcmV2ZW50IGluZmluaXRlIHJlY3Vyc2lvbiBpZiBhIHByZXZpb3VzbHkgZGVmaW5lZCB1bmlmb3JtXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaXMgc2V0IHRvIHVuZGVmaW5lZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHN0eWxlc1tzaGFkZXJzLl91bmlmb3JtX3Njb3Blc1t1XV0uc2hhZGVycy51bmlmb3JtcyAhPT0gc2hhZGVycy51bmlmb3Jtcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3R5bGVzW3NoYWRlcnMuX3VuaWZvcm1fc2NvcGVzW3VdXS5zaGFkZXJzLnVuaWZvcm1zW3VdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hhZGVycy5fdW5pZm9ybXNbdV0gPSB2O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAvLyBFeHRlbnNpb25zOiBidWlsZCBhIGxpc3Qgb2YgdW5pcXVlIGV4dGVuc2lvbnNcbiAgICAgICAgc2hhZGVycy5leHRlbnNpb25zID0gT2JqZWN0LmtleXMoc2hhZGVyX21lcmdlc1xuICAgICAgICAgICAgLm1hcCh4ID0+IHguZXh0ZW5zaW9ucylcbiAgICAgICAgICAgIC5maWx0ZXIoeCA9PiB4KVxuICAgICAgICAgICAgLnJlZHVjZSgocHJldiwgY3VyKSA9PiB7XG4gICAgICAgICAgICAgICAgLy8gc2luZ2xlIGV4dGVuc2lvblxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgY3VyID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICBwcmV2W2N1cl0gPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBhcnJheSBvZiBleHRlbnNpb25zXG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGN1ci5mb3JFYWNoKHggPT4gcHJldlt4XSA9IHRydWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcHJldjtcbiAgICAgICAgICAgIH0sIHt9KSB8fCB7fVxuICAgICAgICApO1xuXG4gICAgICAgIC8vIFNoYWRlciBibG9ja3NcbiAgICAgICAgLy8gTWFyayBhbGwgc2hhZGVyIGJsb2NrcyB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oIXNvdXJjZS5ibG9ja3MpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgc2hhZGVycy5ibG9ja3MgPSBzaGFkZXJzLmJsb2NrcyB8fCB7fTtcbiAgICAgICAgICAgIHNoYWRlcnMuYmxvY2tfc2NvcGVzID0gc2hhZGVycy5ibG9ja19zY29wZXMgfHwge307XG4gICAgICAgICAgICBsZXQgbWl4ZWRfc291cmNlID0ge307IC8vIHNjb3BlcyBtaXhlZCBmb3IgdGhpcyBzb3VyY2Ugc3R5bGVcblxuICAgICAgICAgICAgZm9yIChsZXQgW3QsIGJsb2NrXSBvZiBVdGlscy5lbnRyaWVzKHNvdXJjZS5ibG9ja3MpKSB7XG4gICAgICAgICAgICAgICAgbGV0IGJsb2NrX3Njb3BlID0gc291cmNlLmJsb2NrX3Njb3Blc1t0XTtcblxuICAgICAgICAgICAgICAgIHNoYWRlcnMuYmxvY2tzW3RdID0gc2hhZGVycy5ibG9ja3NbdF0gfHwgW107XG4gICAgICAgICAgICAgICAgc2hhZGVycy5ibG9ja19zY29wZXNbdF0gPSBzaGFkZXJzLmJsb2NrX3Njb3Blc1t0XSB8fCBbXTtcblxuICAgICAgICAgICAgICAgIC8vIHN0YW5kYXJkaXplIG9uIGFycmF5cyAoYmxvY2sgY2FuIGJlIHNpbmdsZSBvciBtdWx0aS12YWx1ZSlcbiAgICAgICAgICAgICAgICBibG9jayA9IEFycmF5LmlzQXJyYXkoYmxvY2spID8gYmxvY2sgOiBbYmxvY2tdO1xuICAgICAgICAgICAgICAgIGJsb2NrX3Njb3BlID0gQXJyYXkuaXNBcnJheShibG9ja19zY29wZSkgPyBibG9ja19zY29wZSA6IFtibG9ja19zY29wZV07XG5cbiAgICAgICAgICAgICAgICBmb3IgKGxldCBiPTA7IGIgPCBibG9jay5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgICAgICAgICAvLyBTa2lwIGJsb2NrcyB3ZSd2ZSBhb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pemUgYWxsIHN0eWxlc1xuICAgIGluaXRTdHlsZXMgKHNjZW5lID0ge30pIHtcbiAgICAgICAgLy8gSW5pdGlhbGl6ZSBhbGxcbiAgICAgICAgZm9yIChsZXQgc25hbWUgaW4gdGhpcy5zdHlsZXMpIHtcbiAgICAgICAgICAgIHRoaXMuc3R5bGVzW3NuYW1lXS5pbml0KHNjZW5lKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIEdpdmVuIGEgc3R5bGUga2V5IGluIGEgc2V0IG9mIHN0eWxlcyB0byBhZGQsIGNvdW50IHRoZSBsZW5ndGggb2YgdGhlIGluaGVyaXRhbmNlIGNoYWluXG4gICAgaW5oZXJpdGFuY2VEZXB0aCAoa2V5LCBzdHlsZXMpIHtcbiAgICAgICAgbGV0IHBhcmVudHMgPSAwO1xuXG4gICAgICAgIHdoaWxlKHRydWUpIHtcbiAgICAgICAgICAgIGxldCBzdHlsZSA9IHN0eWxlc1trZXldO1xuICAgICAgICAgICAgaWYgKCFzdHlsZSkge1xuICAgICAgICAgICAgICAgIC8vIHRoaXMgaXMgYSBzY2VuZSBkZWYgZXJyb3IsIHRyeWluZyB0byBleHRlbmQgYSBzdHlsZSB0aGF0IGRvZXNuJ3QgZXhpc3RcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gRGVwZW5kZW5jeSBjaGFpbiBlbmRzIHdoZW4gdGhpcyBzdHlsZSBpc24ndCBtaXhpbmcgaW4gYW55IG90aGVyc1xuICAgICAgICAgICAgaWYgKCFzdHlsZS5taXgpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gVHJhdmVyc2UgbmV4dCBwYXJlbnQgc3R5bGVcbiAgICAgICAgICAgIHBhcmVudHMrKztcblxuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoc3R5bGUubWl4KSkge1xuICAgICAgICAgICAgICAgIC8vIElmIG11bHRpcGxlIG1peGlucywgZmluZCB0aGUgZGVlcGVzdCBvbmVcbiAgICAgICAgICAgICAgICBwYXJlbnRzICs9IE1hdGgubWF4KC4uLnN0eWxlLm1peC5tYXAocyA9PiB7XG4gICAgICAgICAgICAgICAgICAgIC8vIFRyeWluZyB0byBtaXggaW50byBpdHNlbGYhXG4gICAgICAgICAgICAgICAgICAgIGlmIChrZXkgPT09IHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmluaGVyaXRhbmNlRGVwdGgocywgc3R5bGVzKTtcbiAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBUcnlpbmcgdG8gbWl4IGludG8gaXRzZWxmIVxuICAgICAgICAgICAgICAgIGlmIChrZXkgPT09IHN0eWxlLm1peCkge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBJZiBzaW5nbGUgbWl4aW4sIGNvbnRpbnVlIGxvb3AgdXAgdGhlIHRyZWVcbiAgICAgICAgICAgICAgICBrZXkgPSBzdHlsZS5taXg7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHBhcmVudHM7XG4gICAgfVxuXG4gICAgLy8gQ29tcGlsZSBhbGwgc3R5bGVzXG4gICAgY29tcGlsZSAoa2V5cywgc2NlbmUpIHtcbiAgICAgICAga2V5cyA9IGtleXMgfHwgT2JqZWN0LmtleXModGhpcy5zdHlsZXMpO1xuICAgICAgICBmb3IgKGxldCBrZXkgb2Yga2V5cykge1xuICAgICAgICAgICAgbGV0IHN0eWxlID0gdGhpcy5zdHlsZXNba2V5XTtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgc3R5bGUuY29tcGlsZSgpO1xuICAgICAgICAgICAgICAgIGxvZygndHJhY2UnLCBgU3R5bGVNYW5hZ2VyLmNvbXBpbGUoKTogY29tcGlsZWQgc3R5bGUgJHtrZXl9YCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXRjaChlcnJvcikge1xuICAgICAgICAgICAgICAgIGxvZygnZXJyb3InLCBgU3R5bGVNYW5hZ2VyLmNvbXBpbGUoKTogZXJyb3IgY29tcGlsaW5nIHN0eWxlICR7a2V5fTpgLCBlcnJvcik7XG5cbiAgICAgICAgICAgICAgICBzY2VuZS50cmlnZ2VyKCd3YXJuaW5nJywge1xuICAgICAgICAgICAgICAgICAgICB0eXBlOiAnc3R5bGVzJyxcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogYEVycm9yIGNvbXBpbGluZyBzdHlsZSAke2tleX1gLFxuICAgICAgICAgICAgICAgICAgICBzdHlsZSxcbiAgICAgICAgICAgICAgICAgICAgc2hhZGVyX2Vycm9yczogc3R5bGUucHJvZ3JhbSAmJiBzdHlsZS5wcm9ncmFtLnNoYWRlcl9lcnJvcnNcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGxvZygnZGVidWcnLCBgU3R5bGVNYW5hZ2VyLmNvbXBpbGUoKTogY29tcGlsZWQgYWxsIHN0eWxlc2ApO1xuICAgIH1cblxuICAgIC8vIEdldCBhbGwgc3R5bGVzIHdpdGggbWVzaCBkYXRhIGZvciBhIGdpdmVuIHRpbGVcbiAgICBzdGF0aWMgc3R5bGVzRm9yVGlsZSAodGlsZV9rZXksIHN0eWxlcykge1xuICAgICAgICBsZXQgdGlsZV9zdHlsZXMgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcyBpbiBzdHlsZXMpIHtcbiAgICAgICAgICAgIGlmIChzdHlsZXNbc10uaGFzRGF0YUZvclRpbGUodGlsZV9rZXk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aW50ZXJwb2xhdGVkLCBjYWNoZWRcbiAgICAgICAgcmV0dXJuIHZhbC56b29tW2NvbnRleHQuem9vbV07XG4gICAgfVxuICAgIGVsc2UgeyAvLyBub3QgeWV0IGV2YXVsYXRlZCBmb3IgY2FjaGVcbiAgICAgICAgLy8gRHluYW1pYyBmdW5jdGlvbi1iYXNlZFxuICAgICAgICBpZiAodHlwZW9mIHZhbC52YWx1ZSA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgdmFsLmR5bmFtaWMgPSB2YWwudmFsdWU7XG4gICAgICAgICAgICBsZXQgdiA9IHZhbC5keW5hbWljKGNvbnRleHQpO1xuICAgICAgICAgICAgcmV0dXJuIHY7XG4gICAgICAgIH1cbiAgICAgICAgLy8gQXJyYXkgb2Ygem9vbS1pbnRlcnBvbGF0ZWQgc3RvcHMsIGUuZy4gW3pvb20sIHZhbHVlXSBwYWlyc1xuICAgICAgICBlbHNlIGlmIChBcnJheS5pc0FycmF5KHZhbC52YWx1ZSkgJiYgQXJyYXkuaXNBcnJheSh2YWwudmFsdWVbMF0pKSB7XG4gICAgICAgICAgICAvLyBDYWxjdWxhdGUgdmFsdWUgZm9yIGN1cnJlbnQgem9vbVxuICAgICAgICAgICAgdmFsLnpvb20gPSB2YWwuem9vbSB8fCB7fTtcbiAgICAgICAgICAgIHZhbC56b29tID0ge307XG4gICAgICAgICAgICB2YWwuem9vbVtjb250ZXh0Lnpvb21dID0gVXRpbHMuaW50ZXJwb2xhdGUoY29udGV4dC56b29tLCB2YWwudmFsdWUpO1xuICAgICAgICAgICAgcmV0dXJuIHZhbC56b29tW2NvbnRleHQuem9vbV07XG4gICAgICAgIH1cbiAgICAgICAgLy8gU2luZ2xlIHN0YXRpYyB2YWx1ZVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHZhbC5zdGF0aWMgPSB2YWwudmFsdWU7XG4gICAgICAgICAgICByZXR1cm4gdmFsLnN0YXRpYztcbiAgICAgICAgfVxuICAgIH1c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VybiB2O1xuICAgIH1cbiAgICBlbHNlIGlmICh2YWwuem9vbSAmJiB2YWwuem9vbVtjb250ZXh0Lnpvb21dKSB7XG4gICAgICAgIHJldHVybiB2YWwuem9vbVtjb250ZXh0Lnpvb21dO1xuICAgIH1cbiAgICBlbHNlIHtcbiAgICAgICAgLy8gRHluYW1pYyBmdW5jdGlvbi1iYXNlZFxuICAgICAgICBpZiAodHlwZW9mIHZhbC52YWx1ZSA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgdmFsLmR5bmFtaWMgPSB2YWwudmFsdWU7XG4gICAgICAgICAgICBsZXQgdiA9IHZhbC5keW5hbWljKGNvbnRleHQpO1xuICAgICAgICAgICAgcmV0dXJuIHY7XG4gICAgICAgIH1cbiAgICAgICAgLy8gQXJyYXkgb2Ygem9vbS1pbnRlcnBvbGF0ZWQgc3RvcHMsIGUuZy4gW3pvb20sIHZhbHVlXSBwYWlyc1xuICAgICAgICBlbHNlIGlmICh2YWwuem9vbSkge1xuICAgICAgICAgICAgLy8gQ2FsY3VsYXRlIHZhbHVlIGZvciBjdXJyZW50IHpvb21cbiAgICAgICAgICAgIC8vIERvIGZpbmFsIHVuaXQgY29udmVyc2lvbiBhcyBsYXRlIGFzIHBvc3NpYmxlLCB3aGVuIGludGVycG9sYXRpb24gdmFsdWVzIGhhdmUgYmVlbiBkZXRlcm1pbmVkXG4gICAgICAgICAgICB2YWwuem9vbVtjb250ZXh0Lnpvb21dID0gVXRpbHMuaW50ZXJwb2xhdGUoY29udGV4dC56b29tLCB2YWwudmFsdWUsXG4gICAgICAgICAgICAgICAgdiA9PiBTdHlsZVBhcnNlci5jb252ZXJ0VW5pdHModiwgY29udGV4dCkpO1xuXG4gICAgICAgICAgICByZXR1cm4gdmFsLnpvb21bY29udGV4dC56b29tXTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBTdHlsZVBhcnNlci5jb252ZXJ0VW5pdHModmFsLnZhbHV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ID09IG51bGwpIHtcbiAgICAgICAgICAgICAgICB2WzNdID0gMTsgLy8gZGVmYXVsdCBhbHBoYVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHY7XG4gICAgICAgIH1cbiAgICAgICAgLy8gU2luZ2xlIHN0cmluZyBjb2xvclxuICAgICAgICBlbHNlIGlmICh0eXBlb2YgdmFsLnZhbHVlID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgdmFsLnN0YXRpYyA9IFN0eWxlUGFyc2VyLmNvbG9yRm9yU3RyaW5nKHZhbC52YWx1ZSk7XG4gICAgICAgICAgICByZXR1cm4gdmFsLnN0YXRpYztcbiAgICAgICAgfVxuICAgICAgICAvLyBBcnJheSBvZiB6b29tLWludGVycG9sYXRlZCBzdG9wcywgZS5nLiBbem9vbSwgY29sb3JdIHBhaXJzXG4gICAgICAgIGVsc2UgaWYgKHZhbC56b29tKSB7XG4gICAgICAgICAgICAvLyBQYXJzZSBhbnkgc3RyaW5nIGNvbG9ycyBpbnNpZGUgc3RvcHMsIHRoZSBmaXJzdCB0aW1lIHdlIGVuY291bnRlciB0aGlzIHByb3BlcnR5XG4gICAgICAgICAgICBpZiAoIXZhbC56b29tX3ByZXByb2Nlc3NlZCkge1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGk9MDsgaSA8IHZhbC52YWx1ZS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgdiA9IHZhbC52YWx1ZVtpXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHYgJiYgdHlwZW9mIHZbMV0gPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2WzFdID0gU3R5bGVQYXJzZXIuY29sb3JGb3JTdHJpbmcodlsxXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFsLnpvb21fcHJlcHJvY2Vzc2VkID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gQ2FsY3VsYXRlIGNvbG9yIGZvciBjdXJyZW50IHpvb21cbiAgICAgICAgICAgIHZhbC56b29tW2NvbnRleHQuem9vbV0gPSBVdGlscy5pbnRlcnBvbGF0ZShjb250ZXh0Lnpvb20sIHZhbC52YWx1ZSk7XG4gICAgICAgICAgICB2YWwuem9vbVtjb250ZXh0Lnpvb21dWzNdID0gdmFsLnpvb21bY29udGV4dC56b29tXVszXSB8fCAxOyAvLyBkZWZhdWx0IGFscGhhXG4gICAgICAgICAgICByZXR1cm4gdmFsLnpvb21bY29udGV4dC56b29tXTtcbiAgICAgICAgfVxuICAgICAgICAvLyBTaW5nbGUgYXJyYXkgY29sb3JcbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB2YWwuc3RhdGljID0gdmFsLnZhbHVlO1xuICAgICAgICAgICAgaWYgKHZhbC5zdGF0aWMgJiYgdmFsLnN0YXRpY1szXSA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgdmFsLnN0YXRpY1szXSA9IDE7IC8vIGRlZmF1bHQgYWxwaGFcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB2YWwuc3RhdGljO1xuICAgICAgICB9XG4gICAgfVxufTtcblxuU3R5bGVQYXJzZXIucGFyc2VDb2xvciA9IGZ1bmN0aW9uKHZhbCwgY29udGV4dCA9IHt9KSB7XG4gICAgaWYgKHR5cGVvZiB2YWwgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgdmFsID0gdmFsKGNvbnRleHQpO1xuICAgIH1cblxuICAgIC8vIFBhcnNlIENTUy1zdHlsZSBjb2xvcnNcbiAgICAvLyBUT0RPOiBjaGFuZ2UgYWxsIGNvbG9ycyB0byB1c2UgMC0yNTUgcmFuZ2UgaW50ZXJuYWxseSB0byBhdm9pZCBkaXZpZGluZyBhbmQgdGhlbiByZS1tdWx0aXBseWluZyBpbiBnZW9tIGJ1aWxkZXJcbiAgICBpZiAodHlwZW9mIHZhbCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgdmFsID0gU3R5bGVQYXJzZXIuY29sb3JGb3JTdHJpbmcodmFsKTtcbiAgICB9XG4gICAgZWxzZSBpZiAoQXJyYXkuaXNBcnJheSh2YWwpICYmIEFycmF5LmlzQXJyYXkodmFsWzBdKSkge1xuICAgICAgICAvLyBBcnJheSBvZiB6b29tLWludGVycG9sYXRlZCBzdG9wcywgZS5nLiBbem9vbSwgY29sb3JdIHBhaXJzXG4gICAgICAgIGZvciAobGV0IGk9MDsgaSA8IHZhbC5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IHYgPSB2YWxbaV07XG4gICAgICAgICAgICBpZiAodHlwZW9mIHZbMV0gPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgdlsxXSA9IFN0eWxlUGFyc2VyLmNvbG9yRm9yU3RyaW5nKHZbMV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGNvbnRleHQuem9vbSkge1xuICAgICAgICAgICAgdmFsID0gVXRpbHMuaW50ZXJwb2xhdGUoY29udGV4dC56b29tLCB2YWwpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gRGVmYXVsdHNcbiAgICBpZiAodmFsKSB7XG4gICAgICAgIC8vIGFscGhhXG4gICAgICAgIGlmICh2YWxbM10gPT0gbnVsbCkge1xuICAgICAgICAgICAgdmFsWzNdID0gMTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBlbHNlIHtcbiAgICAgICAgdmFsID0gWzAsIDAsIDAsIDFdO1xuICAgIH1cblxuICAgIHJldHVybiB2YWw7XG59O1xuXG5TdHlsZVBhcnNlci5jYWxjdWxhdGVPcmRlciA9IGZ1bmN0aW9uKG9yZGVyLCBjb250ZXh0KSB7XG4gICAgLy8gQ29tcHV0ZWQgb3JkZXJcbiAgICBpZiAodHlwZW9mIG9yZGVyID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgIG9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ZGV2aWNlX3BpeGVsX3JhdGlvO1xuXG4gICAgICAgIGlmIChzdHJva2UgJiYgc3Ryb2tlX3dpZHRoID4gMCkge1xuICAgICAgICAgICAgY3R4LnN0cm9rZVN0eWxlID0gc3Ryb2tlO1xuICAgICAgICAgICAgY3R4LmxpbmVXaWR0aCA9IHN0cm9rZV93aWR0aCAqIGRwcjtcbiAgICAgICAgfVxuICAgICAgICBjdHguZmlsbFN0eWxlID0gZmlsbDtcblxuICAgICAgICBjdHguZm9udCA9IGZvbnRfY3NzO1xuICAgICAgICBjdHgubWl0ZXJMaW1pdCA9IDI7XG4gICAgfVxuXG4gICAgdGV4dFNpemVzICh0ZXh0cykge1xuICAgICAgICBsZXQgZHByID0gVXRpbHMuZGV2aWNlX3BpeGVsX3JhdGlvO1xuICAgICAgICByZXR1cm4gRm9udE1hbmFnZXIubG9hZEZvbnRzKCkudGhlbigoKSA9PiB7XG4gICAgICAgICAgICBmb3IgKGxldCBzdHlsZSBpbiB0ZXh0cykge1xuICAgICAgICAgICAgICAgIENhbnZhc1RleHQudGV4dF9jYWNoZVtzdHlsZV0gPSBDYW52YXNUZXh0LnRleHRfY2FjaGVbc3R5bGVdIHx8IHt9O1xuXG4gICAgICAgICAgICAgICAgbGV0IHRleHRfaW5mb3MgPSB0ZXh0c1tzdHlsZV07XG4gICAgICAgICAgICAgICAgbGV0IGZpcnN0ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBsZXQgc3BhY2Vfd2lkdGg7XG5cbiAgICAgICAgICAgICAgICBmb3IgKGxldCB0ZXh0IGluIHRleHRfaW5mb3MpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRleHRfaW5mbyA9IHRleHRfaW5mb3NbdGV4dF07XG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZXh0X3NldHRpbmdzID0gdGV4dF9pbmZvLnRleHRfc2V0dGluZ3M7XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKGZpcnN0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEZvbnQodGV4dF9zZXR0aW5ncyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBzcGFjZV93aWR0aCA9IHRoaXMuY29udGV4dC5tZWFzdXJlVGV4dCgnICcpLndpZHRoIC8gZHByO1xuICAgICAgICAgICAgICAgICAgICAgICAgZmlyc3QgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIHRleHRfaW5mby5zcGFjZV93aWR0aCA9IHNwYWNlX3dpZHRoO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICh0ZXh0X3NldHRpbmdzLmNhbl9hcnRpY3VsYXRlKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzZWdtZW50cyA9IHNwbGl0TGFiZWxUZXh0KHRleHQpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0X2luZm8uc2VnbWVudHMgPSBzZWdtZW50cztcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRfaW5mby5zaXplID0gW107XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgc2VnbWVudHMubGVuZ3RoOyBpKyspe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzZWdtZW50ID0gc2VnbWVudHNbaV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFDYW52YXNUZXh0LnRleHRfY2FjaGVbc3R5bGVdW3NlZ21lbnRdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENhbnZhc1RleHQudGV4dF9jYWNoZVtzdHlsZV1bc2VnbWVudF0gPSB0aGlzLnRleHRTaXplKHNlZ21lbnQsIHRleHRfc2V0dGluZ3MpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYW52YXNUZXh0LmNhY2hlX3N0YXRzLm1pc3NlcysrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2FudmFzVGV4dC5jYWNoZV9zdGF0cy5oaXRzKys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHRfaW5mby5zaXplLnB1c2goQ2FudmFzVGV4dC50ZXh0X2NhY2hlW3N0eWxlXVtzZWdtZW50XS5zaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghQ2FudmFzVGV4dC50ZXh0X2NhY2hlW3N0eWxlXVt0ZXh0XSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIENhbnZhc1RleHQudGV4dF9jYWNoZVtzdHlsZV1bdGV4dF0gPSB0aGlzLnRleHRTaXplKHRleHQsIHRleHRfc2V0dGluZ3MpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIENhbnZhc1RleHQuY2FjaGVfc3RhdHMubWlzc2VzKys7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYW52YXNUZXh0LmNhY2hlX3N0YXRzLmhpdHMrKztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIE9ubHkgc2VuZCB0ZXh0IHNpemVzIGJhY2sgdG8gd29ya2VyIChrZWVwIGNvbXB1dGVkIHRleHQgbGluZSBpbmZvXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBvbiBtYWluIHRocmVhZCwgZm9yIGZ1dHVyZSByZW5kZXJpbmcpXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0X2luZm8uc2l6ZSA9IENhbnZhc1RleHQudGV4dF9jY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gZm9yIChsZXQgdGV4dCBpbiB0ZXh0X2luZm9zKSB7XG4gICAgICAgICAgICAgICAgbGV0IHRleHRfaW5mbyA9IHRleHRfaW5mb3NbdGV4dF07XG4gICAgICAgICAgICAgICAgbGV0IHRleHRfc2V0dGluZ3MgPSB0ZXh0X2luZm8udGV4dF9zZXR0aW5ncztcblxuICAgICAgICAgICAgICAgIC8vIHNldCBmb250IG9uIGZpcnN0IG9jY3VyZW5jZSBvZiBuZXcgZm9udCBzdHlsZVxuICAgICAgICAgICAgICAgIGlmIChmaXJzdCkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEZvbnQodGV4dF9zZXR0aW5ncyk7XG4gICAgICAgICAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKHRleHRfc2V0dGluZ3MuY2FuX2FydGljdWxhdGUpe1xuICAgICAgICAgICAgICAgICAgICBsZXQgd29yZHMgPSB0ZXh0X2luZm8uc2VnbWVudHM7XG4gICAgICAgICAgICAgICAgICAgIHRleHRfaW5mby50ZXhjb29yZHMgPSBbXTtcblxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHdvcmRzLmxlbmd0aDsgaSsrKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB3b3JkID0gd29yZHNbaV07XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGV4Y29vcmQ7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChDYW52YXNUZXh0LnRleGNvb3JkX2NhY2hlW3RpbGVfa2V5XVtzdHlsZV1bd29yZF0udGV4Y29vcmQpe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleGNvb3JkID0gQ2FudmFzVGV4dC50ZXhjb29yZF9jYWNoZVt0aWxlX2tleV1bc3R5bGVdW3dvcmRdLnRleGNvb3JkO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRleHR1cmVfcG9zaXRpb24gPSBDYW52YXNUZXh0LnRleGNvb3JkX2NhY2hlW3RpbGVfa2V5XVtzdHlsZV1bd29yZF0udGV4dHVyZV9wb3NpdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc2l6ZSA9IENhbnZhc1RleHQudGV4dF9jYWNoZVtzdHlsZV1bd29yZF0uc2l6ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbGluZSA9IENhbnZhc1RleHQudGV4dF9jYWNoZVtzdHlsZV1bd29yZF0ubGluZXM7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRyYXdUZXh0TXVsdGlMaW5lKGxpbmUsIHRleHR1cmVfcG9zaXRpb24sIHNpemUsIHRleHRfc2V0dGluZ3MpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4Y29vcmQgPSBUZXh0dXJlLmdldFRleGNvb3Jkc0ZvclNwcml0ZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dHVyZV9wb3NpdGlvbixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZS50ZXh0dXJlX3NpemUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHR1cmVfc2l6ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYW52YXNUZXh0LnRleGNvb3JkX2NhY2hlW3RpbGVfa2V5XVtzdHlsZV1bd29yZF0udGV4Y29vcmQgPSB0ZXhjb29yZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dF9pbmZvLnRleGNvb3Jkcy5wdXNoKHRleGNvb3JkKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxpbmVzID0gQ2FudmFzVGV4dC50ZXh0X2NhY2hlW3N0eWxlXVt0ZXh0XS5saW5lczsgLy8gZ2V0IHByZXZpb3VzbHkgY29tcHV0ZWQgbGluZXMgb2YgdGV4dFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBhbGlnbiBpbiB0ZXh0X2luZm8uYWxpZ24pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZHJhd1RleHRNdWx0aUxpbmUobGluZXMsIHRleHRfaW5mby5hbGlnblthbGlnbl0udGV4dHVyZV9wb3NpdGlvbiwgdGV4dF9pbmZvLnNpemUsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJva2U6IHRleHRfc2V0dGluZ3Muc3Ryb2tlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cm9rZV93aWR0aDogdGV4dF9zZXR0aW5ncy5zdHJva2Vfd2lkdGgsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNmb3JtOiB0ZXh0X3NldHRpbmdzLnRyYW5zZm9ybSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGlnbjogYWxpZ25cbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0X2luZm8uYWxpZ25bYWxpZ25dLnRleGNvb3JkcyA9IFRleHR1cmUuZ2V0VGV4Y29vcmRzRm9yU3ByaXRlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHRfaW5mby5hbGlnblthbGlnbl0udGV4dHVyZV9wb3NpdGlvbixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0X2luZm8uc2l6ZS50ZXh0dXJlX3NpemUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dHVyZV9zaXplXG4gICAgICAgICAgICAgICAgIC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ge1xuICAgICAgICAgICAgICAgIGxldCB0ZXh0X2luZm8gPSB0ZXh0X2luZm9zW3RleHRdO1xuXG4gICAgICAgICAgICAgICAgaWYgKHRleHRfaW5mby50ZXh0X3NldHRpbmdzLmNhbl9hcnRpY3VsYXRlKXtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRleHR1cmVfcG9zaXRpb247XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGV4dF9pbmZvLnNpemUubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB3b3JkID0gdGV4dF9pbmZvLnNlZ21lbnRzW2ldO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUNhbnZhc1RleHQudGV4Y29vcmRfY2FjaGVbdGlsZV9rZXldW3N0eWxlXVt3b3JkXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzaXplID0gdGV4dF9pbmZvLnNpemVbaV0udGV4dHVyZV9zaXplO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzaXplWzBdID4gY29sdW1uX3dpZHRoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtbl93aWR0aCA9IHNpemVbMF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjeSArIHNpemVbMV0gPCBtYXhfdGV4dHVyZV9zaXplKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHR1cmVfcG9zaXRpb24gPSBbY3gsIGN5XTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjeSArPSBzaXplWzFdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3kgPiBoZWlnaHQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodCA9IGN5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeyAvLyBzdGFydCBuZXcgY29sdW1uIGlmIHRhbGxlciB0aGFuIHRleHR1cmVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3ggKz0gY29sdW1uX3dpZHRoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW5fd2lkdGggPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjeSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHR1cmVfcG9zaXRpb24gPSBbY3gsIGN5XTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYW52YXNUZXh0LnRleGNvb3JkX2NhY2hlW3RpbGVfa2V5XVtzdHlsZV1bd29yZF0gPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHR1cmVfcG9zaXRpb246IHRleHR1cmVfcG9zaXRpb25cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvLyByZW5kZXJlZCBzaXplIGlzIHNhbWUgZm9yIGFsbCBhbGlnbm1lbnRzXG4gICAgICAgICAgICAgICAgICAgIGxldCBzaXplID0gdGV4dF9pbmZvLnNpemUudGV4dHVyZV9zaXplO1xuICAgICAgICAgICAgICAgICAgICBpZiAoc2l6ZVswXSA+IGNvbHVtbl93aWR0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29sdW1uX3dpZHRoID0gc2l6ZVswXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIC8vIGJ1dCBlYWNoIGFsaWdubWVudCBuZWVkcyB0byBiZSByZW5kZXJlZCBzZXBhcmF0ZWx5XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGFsaWduIGluIHRleHRfaW5mby5hbGlnbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN5ICsgc2l6ZVsxXSA8IG1heF90ZXh0dXJlX3NpemUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0X2luZm8uYWxpZ25bYWxpZ25dLnRleHR1cmVfcG9zaXRpb24gPSBbY3gsIGN5XTsgLy8gYWRkIGxhYmVsIHRvIGN1cnJlbnQgY29sdW1uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY3kgKz0gc2l6ZVsxXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3kgPiBoZWlnaHQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0ID0gY3k7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7IC8vIHN0YXJ0IG5ldyBjb2x1bW4gaWYgdGFsbGVyIHRoYW4gdGV4dHVyZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN4ICs9IGNvbHVtbl93aWR0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW5fd2lkdGggPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN5ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0X2luZm8uYWxpZ25bYWxpZ25dLnRleHR1cmVfcG9zaXRpb24gPSBbY3gsIGN5XTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBbY3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KHR5cGVvZiBzaXplID09PSAnc3RyaW5nJykgPyBzaXplIDogU3RyaW5nKHNpemUpOyAvLyBuZWVkIGEgc3RyaW5nIGZvciByZWdleFxuXG4gICAgICAgIGxldCBbLCBweF9zaXplLCB1bml0c10gPSBzaXplLm1hdGNoKENhbnZhc1RleHQuZm9udF9zaXplX3JlKSB8fCBbXTtcbiAgICAgICAgdW5pdHMgPSB1bml0cyB8fCAncHgnO1xuXG4gICAgICAgIGlmICh1bml0cyA9PT0gXCJlbVwiKSB7XG4gICAgICAgICAgICBweF9zaXplICo9IDE2O1xuICAgICAgICB9IGVsc2UgaWYgKHVuaXRzID09PSBcInB0XCIpIHtcbiAgICAgICAgICAgIHB4X3NpemUgLz0gMC43NTtcbiAgICAgICAgfSBlbHNlIGlmICh1bml0cyA9PT0gXCIlXCIpIHtcbiAgICAgICAgICAgIHB4X3NpemUgLz0gNi4yNTtcbiAgICAgICAgfVxuXG4gICAgICAgIHB4X3NpemUgPSBwYXJzZUZsb2F0KHB4X3NpemUpO1xuICAgICAgICBweF9zaXplICo9IFV0aWxzLmRldmljZV9waXhlbF9yYXRpbztcbiAgICAgICAgcmV0dXJuIHB4X3NpemU7XG4gICAgfVxuXG4gICAgY2xlYXJUZXhjb29yZENhY2hlICh0aWxlX2tleSkge1xuICAgICAgICBDYW52YXNUZXh0LnRleGNvb3JkX2NhY2hlW3RpbGVfa2V5XSA9IHt9O1xuICAgIH1cblxufVxuXG4vLyBFeHRyYWN0IGZvbnQgc2l6ZSBhbmQgdW5pdHNcbkNhbnZhc1RleHQuZm9udF9zaXplX3JlID0gLygoPzpbMC05XSpcXC4pP1swLTldKylcXHMqKHB4fHB0fGVtfCUpPy87XG5cbi8vIENhY2hlIHNpemVzIG9mIHJlbmRlcmVkIHRleHRcbkNhbnZhc1RleHQudGV4dF9jYWNoZSA9IHt9OyAvLyBieSB0ZXh0IHN0eWxlLCB0aGVuIHRleHQgc3RyaW5nXG5DYW52YXNUZXh0LmNhY2hlX3N0YX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DtcbiAgICAgICAgdGhpcy5oZWlnaHQgPSAwO1xuICAgICAgICB0aGlzLmxpbmVzID0gW107XG5cbiAgICAgICAgdGhpcy5lbGxpcHNpcyA9ICcuLi4nO1xuICAgICAgICB0aGlzLmVsbGlwc2lzX3dpZHRoID0gY29udGV4dC5tZWFzdXJlVGV4dCh0aGlzLmVsbGlwc2lzKS53aWR0aDtcblxuICAgICAgICB0aGlzLm1heF9saW5lcyA9IG1heF9saW5lcztcbiAgICAgICAgdGhpcy50ZXh0X3dyYXAgPSB0ZXh0X3dyYXA7XG4gICAgICAgIHRoaXMuY29udGV4dCA9IGNvbnRleHQ7XG4gICAgfVxuXG4gICAgY3JlYXRlTGluZSAobGluZV9oZWlnaHQpe1xuICAgICAgICBpZiAodGhpcy5saW5lcy5sZW5ndGggPCB0aGlzLm1heF9saW5lcyl7XG4gICAgICAgICAgICByZXR1cm4gbmV3IExpbmUobGluZV9oZWlnaHQsIHRoaXMudGV4dF93cmFwKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHB1c2ggKGxpbmUpe1xuICAgICAgICBpZiAodGhpcy5saW5lcy5sZW5ndGggPCB0aGlzLm1heF9saW5lcyl7XG4gICAgICAgICAgICAvLyBtZWFzdXJlIGxpbmUgd2lkdGhcbiAgICAgICAgICAgIGxldCBsaW5lX3dpZHRoID0gdGhpcy5jb250ZXh0Lm1lYXN1cmVUZXh0KGxpbmUudGV4dCkud2lkdGg7XG4gICAgICAgICAgICBsaW5lLndpZHRoID0gbGluZV93aWR0aDtcblxuICAgICAgICAgICAgaWYgKGxpbmVfd2lkdGggPiB0aGlzLndpZHRoKXtcbiAgICAgICAgICAgICAgICB0aGlzLndpZHRoID0gTWF0aC5jZWlsKGxpbmVfd2lkdGgpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBhZGQgdG8gbGluZXMgYW5kIGluY3JlbWVudCBoZWlnaHRcbiAgICAgICAgICAgIHRoaXMubGluZXMucHVzaChsaW5lKTtcbiAgICAgICAgICAgIHRoaXMuaGVpZ2h0ICs9IGxpbmUuaGVpZ2h0O1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmFkZEVsbGlwc2lzKCk7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBwdXNoZXMgdG8gdGhlIGxpbmVzIGFycmF5IGFuZCByZXR1cm5zIGEgbmV3IGxpbmUgaWYgcG9zc2libGUgKGZhbHNlIG90aGVyd2lzZSlcbiAgICBhZHZhbmNlIChsaW5lLCBsaW5lX2hlaWdodCkge1xuICAgICAgICBsZXQgY2FuX3B1c2ggPSB0aGlzLnB1c2gobGluZSk7XG4gICAgICAgIGlmIChjYW5fcHVzaCl7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5jcmVhdGVMaW5lKGxpbmVfaGVpZ2h0KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGFkZEVsbGlwc2lzICgpe1xuICAgICAgICBsZXQgbGFzdF9saW5lID0gdGhpcy5saW5lc1t0aGlzLmxpbmVzLmxlbmd0aCAtIDFdO1xuXG4gICAgICAgIGxhc3RfbGluZS5hcHBlbmQodGhpcy5lbGxpcHNpcyk7XG4gICAgICAgIGxhc3RfbGluZS53aWR0aCArPSB0aGlzLmVsbGlwc2lzX3dpZHRoO1xuXG4gICAgICAgIGlmIChsYXN0X2xpbmUud2lkdGggPiB0aGlzLndpZHRoKSB7XG4gICAgICAgICAgICB0aGlzLndpZHRoID0gbGFzdF9saW5lLndpZHRoO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZmluaXNoIChsaW5lKXtcbiAgICAgICA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IG9uIHNwYWNlLWJyZWFrIGdyb3VwcyAod2lsbCBiZSBvbmUgaWYgbWF4IGxpbmUgbGVuZ3RoIG9mZiksIHRoZW4gaXRlcmF0ZSBvbiBsaW5lLWJyZWFrIGdyb3Vwc1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHdvcmRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYnJlYWtzID0gd29yZHNbaV0uc3BsaXQoJ1xcbicpOyAvLyBzcGxpdCBvbiBsaW5lIGJyZWFrc1xuICAgICAgICAgICAgbGV0IG5ld19saW5lID0gKGkgPT09IDApID8gdHJ1ZSA6IGZhbHNlO1xuXG4gICAgICAgICAgICBmb3IgKGxldCBuPTA7IG4gPCBicmVha3MubGVuZ3RoOyBuKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoIWxpbmUpe1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBsZXQgd29yZCA9IGJyZWFrc1tuXS50cmltKCk7XG5cbiAgICAgICAgICAgICAgICBpZiAoIXdvcmQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgbGV0IHNwYWNlZF93b3JkID0gKG5ld19saW5lKSA/IHdvcmQgOiAnICcgKyB3b3JkO1xuXG4gICAgICAgICAgICAgICAgLy8gaWYgYWRkaW5nIGN1cnJlbnQgd29yZCB3b3VsZCBvdmVyZmxvdywgYWRkIGEgbmV3IGxpbmUgaW5zdGVhZFxuICAgICAgICAgICAgICAgIC8vIGZpcnN0IHdvcmQgKGkgPT09IDApIGFsd2F5cyBhcHBlbmRzXG4gICAgICAgICAgICAgICAgaWYgKHRleHRfd3JhcCAmJiBpID4gMCAmJiBsaW5lLmV4Y2VlZHNUZXh0d3JhcChzcGFjZWRfd29yZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgbGluZSA9IG11bHRpbGluZS5hZHZhbmNlKGxpbmUsIGxpbmVfaGVpZ2h0KTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFsaW5lKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGxpbmUuYXBwZW5kKHdvcmQpO1xuICAgICAgICAgICAgICAgICAgICBuZXdfbGluZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBsaW5lLmFwcGVuZChzcGFjZWRfd29yZCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gaWYgbGluZSBicmVha3MgcHJlc2VudCwgYWRkIG5ldyBsaW5lICh1bmxlc3Mgb24gbGFzdCBsaW5lKVxuICAgICAgICAgICAgICAgIGlmIChuIDwgYnJlYWtzLmxlbmd0aCAtIDEpIHtcbiAgICAgICAgICAgICAgICAgICAgbGluZSA9IG11bHRpbGluZS5hZHZhbmNlKGxpbmUsIGxpbmVfaGVpZ2h0KTtcbiAgICAgICAgICAgICAgICAgICAgbmV3X2xpbmUgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGkgPT09IHdvcmRzLmxlbmd0aCAtIDEpe1xuICAgICAgICAgICAgICAgIG11bHRpbGluZS5maW5pc2gobGluZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG11bHRpbGluZTtcbiAgICB9XG59XG5cbi8vIEEgUHJpdmF0ZSBjbGFzcyB1c2VkIGJ5IE11bHRpTGluZSB0byBjb250YWluIHRoZSBsb2dpYyBmb3IgYSBzaW5nbGUgbGluZVxuLy8gaW5jbHVkaW5nIGNoYXJhY3RlciBjb3VudCwgd2lkdGgsIGhlaWdodCBhbmQgdGV4dFxuY2xhc3MgTGluZSB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SAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGluamVjdCA9IHRoaXMuaW5qZWN0Rm9udEZhY2Uob3B0aW9ucyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBXYWl0IGZvciBmb250IHRvIGxvYWRcbiAgICAgICAgbGV0IG9ic2VydmVyID0gbmV3IEZvbnRGYWNlT2JzZXJ2ZXIoZmFtaWx5LCBvcHRpb25zKTtcbiAgICAgICAgcmV0dXJuIGluamVjdC50aGVuKCgpID0+IG9ic2VydmVyLmxvYWQoKSkudGhlbihcbiAgICAgICAgICAgICgpID0+IHtcbiAgICAgICAgICAgICAgICAvLyBQcm9taXNlIHJlc29sdmVzLCBmb250IGlzIGF2YWlsYWJsZVxuICAgICAgICAgICAgICAgIGxvZygnZGVidWcnLCBgRm9udCBmYWNlICcke2ZhbWlseX0nIGlzIGF2YWlsYWJsZWAsIG9wdGlvbnMpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICgpID0+IHtcbiAgICAgICAgICAgICAgICAvLyBQcm9taXNlIHJlamVjdHMsIGZvbnQgaXMgbm90IGF2YWlsYWJsZVxuICAgICAgICAgICAgICAgIGxvZygnZGVidWcnLCBgRm9udCBmYWNlICcke2ZhbWlseX0nIGlzIE5PVCBhdmFpbGFibGVgLCBvcHRpb25zKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgKTtcbiAgICB9LFxuXG4gICAgLy8gTG9hZHMgYSBmb250IGZhY2UgdmlhIGVpdGhlciB0aGUgbmF0aXZlIEZvbnRGYWNlIEFQSSwgb3IgQ1NTIGluamVjdGlvblxuICAgIC8vIFRPRE86IGNvbnNpZGVyIHN1cHBvcnQgZm9yIG11bHRpcGxlIGZvcm1hdCBVUkxzIHBlciBmYWNlLCB1bmljb2RlIHJhbmdlc1xuICAgIGluamVjdEZvbnRGYWNlICh7IGZhbWlseSwgdXJsLCB3ZWlnaHQsIHN0eWxlIH0pIHtcbiAgICAgICAgaWYgKHR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ICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2RhdGE6Zm9udC9vcGVudHlwZTtiYXNlNjQsJyArIGJ0b2Eoc3RyKTsgLy8gYmFzZTY0IGVuY29kZSBhcyBkYXRhIFVSTFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHByZXByb2Nlc3MudGhlbihkYXRhID0+IHtcbiAgICAgICAgICAgIGlmICh0aGlzLnN1cHBvcnRzX25hdGl2ZV9mb250X2xvYWRpbmcpIHtcbiAgICAgICAgICAgICAgICAvLyBVc2UgbmF0aXZlIEZvbnRGYWNlIEFQSVxuICAgICAgICAgICAgICAgIGxldCBmYWNlO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZGF0YSA9PT0gJ3N0cmluZycpIHsgLy8gYWRkIGFzIFVSTFxuICAgICAgICAgICAgICAgICAgICBmYWNlID0gbmV3IEZvbnRGYWNlKGZhbWlseSwgYHVybCgke2VuY29kZVVSSShkYXRhKX0pYCwgeyB3ZWlnaHQsIHN0eWxlIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChkYXRhIGluc3RhbmNlb2YgVWludDhBcnJheSkgeyAvLyBhZGQgYXMgYmluYXJ5IGRhdGFcbiAgICAgICAgICAgICAgICAgICAgZmFjZSA9IG5ldyBGb250RmFjZShmYW1pbHksIGRhdGEsIHsgd2VpZ2h0LCBzdHlsZSB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZG9jdW1lbnQuZm9udHMuYWRkKGZhY2UpO1xuICAgICAgICAgICAgICAgIGxvZygndHJhY2UnLCAnQWRkaW5nIEZvbnRGYWNlIHRvIGRvY3VtZW50LmZvbnRzOicsIGZhY2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gVXNlIENTUyBpbmplY3Rpb25cbiAgICAgICAgICAgICAgICBsZXQgY3NzID0gYFxuICAgICAgICAgICAgICAgICAgICBAZm9udC1mYWNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtZmFtaWx5OiAnJHtmYW1pbHl9JztcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtd2VpZ2h0OiAke3dlaWdodCB8fCAnbm9ybWFsJ307XG4gICAgICAgICAgICAgICAgICAgICAgICBmb250LXN0eWxlOiAke3N0eWxlIHx8ICdub3JtYWwnfTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNyYzogdXJsKCR7ZW5jb2RlVVJJKGRhdGEpfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBgO1xuXG4gICAgICAgICAgICAgICAgbGV0IHN0eWxlX2VsID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnc3R5bGUnKTtcbiAgICAgICAgICAgICAgICBzdHlsZV9lbC5hcHBlbmRDaGlsZChkb2N1bWVudC5jcmVhdGVUZXh0Tm9kZShcIlwiKSk7XG4gICAgICAgICAgICAgICAgZG9jdW1lbnQuaGVhZC5hcHBlbmRDaGlsZChzdHlsZV9lbCk7XG4gICAgICAgICAgICAgICAgc3R5bGVfZWwuc2hlZXQuaW5zZXJ0UnVsZShjc3MsIDApO1xuICAgICAgICAgICAgICAgIGxvZygndHJhY2UnLCAnSW5qZWN0aW5nIENTUyBmb250IGZhY2U6JywgY3NzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfVxuXG59O1xuXG5leHBvcnQgZGVmYXVsdCBGb250TWFuYWdlcjtcbiIsIi8vIFRleHQgcmVuZGVyaW5nIHN0eWxlXG5cbmltcG9ydCBHZW8gZnJvbSAnLi4vLi4vZ2VvJztcbmltcG9ydCB7U3R5bGV9IGZyb20gJy4uL3N0eWxlJztcbmltcG9ydCB7UG9pbnRzfSBmcm9tICcuLi9wb2ludHMvcG9pbn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G4gICAgICAgIHRoaXMucXVldWVzW3RpbGUua2V5XSA9IFtdO1xuICAgICAgICByZXR1cm4gU3R5bGUuc3RhcnREYXRhLmNhbGwodGhpcywgdGlsZSk7XG4gICAgfSxcblxuICAgIC8vIE92ZXJyaWRlXG4gICAgZW5kRGF0YSAodGlsZSkge1xuICAgICAgICByZXR1cm4gdGhpcy5wcmVwYXJlVGV4dExhYmVscyh0aWxlLCB0aGlzLm5hbWUsIHRoaXMucXVldWVzW3RpbGUua2V5XSkuXG4gICAgICAgICAgICB0aGVuKGxhYmVscyA9PiB0aGlzLmNvbGxpZGVBbmRSZW5kZXJUZXh0TGFiZWxzKHRpbGUsIHRoaXMubmFtZSwgbGFiZWxzKSkuXG4gICAgICAgICAgICB0aGVuKCh7IGxhYmVscywgdGV4dHMsIHRleHR1cmUgfSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmICh0ZXh0cykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnRleHRzW3RpbGUua2V5XSA9IHRleHRzO1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIEJ1aWxkIHF1ZXVlZCBmZWF0dXJlc1xuICAgICAgICAgICAgICAgICAgICBsYWJlbHMuZm9yRWFjaChxID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ZXh0X3NldHRpbmdzX2tleSA9IHEudGV4dF9zZXR0aW5nc19rZXk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGV4dF9pbmZvID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnRleHRzW3RpbGUua2V5XVt0ZXh0X3NldHRpbmdzX2tleV0gJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnRleHRzW3RpbGUua2V5XVt0ZXh0X3NldHRpbmdzX2tleV1bcS50ZXh0XTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2V0dXAgc3R5bGluZyBvYmplY3QgZXhwZWN0ZWQgYnkgU3R5bGUgY2xhc3NcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdHlsZSA9IHRoaXMuZmVhdHVyZV9zdHlsZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlLmxhYmVsID0gcS5sYWJlbDtcblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRleHRfaW5mby50ZXh0X3NldHRpbmdzLmNhbl9hcnRpY3VsYXRlKXtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB1bnBhY2sgbG9naWNhbCBzaXplcyBvZiBlYWNoIHNlZ21lbnQgaW50byBhbiBhcnJheSBmb3IgdGhlIHN0eWxlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGUuc2l6ZSA9IHRleHRfaW5mby5zaXplLm1hcChmdW5jdGlvbihzaXplKXsgcmV0dXJuIHNpemUubG9naWNhbF9zaXplOyB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHlsZS50ZXhjb29yZHMgPSB0ZXh0X2luZm8udGV4Y29vcmRzO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGUuc2l6ZSA9IHRleHRfaW5mby5zaXplLmxvZ2ljYWxfc2l6ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHlsZS5hbmdsZSA9IHEubGFiZWwuYW5nbGUgfHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHlsZS50ZXhjb29yZHMgPSB0ZXh0X2luZm8uYWxpZ25bcS5sYWJlbC5hbGlnbl0udGV4Y29vcmRzO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBTdHlsZS5hZGRGZWF0dXJlLmNhbGwodGhpcywgcS5mZWF0dXJlLCBxLmRyYXcsIHEuY29udGV4dCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLmZyZWVUZXh0KHRpbGUpO1xuXG4gICAgICAgICAgICAgICAgLy8gRmluaXNoIHRpbGUgbWVzaFxuICAgICAgICAgICAgICAgIHJldHVybiBTdHlsZS5lbmREYXRhLmNhbGwodGhpcywgdGlsZSkudGhlbih0aWxlX2RhdGEgPT4ge1xuICAgICAgICAgICAgICAgICAgICAvLyBBdHRhY2ggdGlsZS1zcGVjaWZpYyBsYWJlbCBhdGxhcyB0byBtZXNoIGFzIGEgdGV4dHVyZSB1bmlmb3JtXG4gICAgICAgICAgICAgICAgICAgIGlmICh0ZXh0dXJlICYmIHRpbGVfZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGlsZV9kYXRhLnVuaWZvcm1zLnVfdGV4dHVyZSA9IHRleHR1cmU7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aWxlX2RhdGEudGV4dHVyZXMucHVzaCh0ZXh0dXJlKTsgLy8gYXNzaWduIHRleHR1cmUgb3duZXJzaGlwIHRvIHRpbGVcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aWxlX2RhdGE7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgIH0sXG5cbiAgICAvLyBTZXRzIHVwIGNhY2hpbmcgZm9yIGRyYXcgcHJvcGVydGllc1xuICAgIF9wcmVwcm9jZXNzIChkcmF3KSB7XG4gICAgICAgIHJldHVybiB0aGlzLnByZXByb2Nlc3NUZXh0KGRyYXcpO1xuICAgIH0sXG5cbiAgICAvLyBJbXBsZW1lbnRzIGxhYmVsIGJ1aWxkaW5nIGZvciBUZXh0TGFiZWxzIG1peGluXG4gICAgYnVpbGRUZXh0TGFiZWxzICh0aWxlX2tleSwgZmVhdHVyZV9xdWV1ZSkge1xuICAgICAgICBsZXQgbGFiZWxzID0gW107XG4gICAgICAgIGZvciAobGV0IGY9MDsgZiA8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FsIG5hbWVcbiAgICBwYXJzZVRleHRTb3VyY2UgKGZlYXR1cmUsIGRyYXcsIGNvbnRleHQpIHtcbiAgICAgICAgbGV0IHRleHQ7XG4gICAgICAgIGxldCBzb3VyY2UgPSBkcmF3LnRleHRfc291cmNlIHx8ICduYW1lJztcblxuICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShzb3VyY2UpKSB7XG4gICAgICAgICAgICBmb3IgKGxldCBzPTA7IHMgPCBzb3VyY2UubGVuZ3RoOyBzKyspIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHNvdXJjZVtzXSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgdGV4dCA9IGZlYXR1cmUucHJvcGVydGllc1tzb3VyY2Vbc11dO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIHNvdXJjZVtzXSA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgICAgICB0ZXh0ID0gc291cmNlW3NdKGNvbnRleHQpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmICh0ZXh0KSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrOyAvLyBzdG9wIGlmIHdlIGZvdW5kIGEgdGV4dCBwcm9wZXJ0eVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh0eXBlb2Ygc291cmNlID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgdGV4dCA9IGZlYXR1cmUucHJvcGVydGllc1tzb3VyY2VdO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBzb3VyY2UgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgIHRleHQgPSBzb3VyY2UoY29udGV4dCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRleHQ7XG4gICAgfSxcblxuICAgIHByZXBhcmVUZXh0TGFiZWxzICh0aWxlLCBjb2xsaXNpb25fZ3JvdXAsIHF1ZXVlKSB7XG4gICAgICAgIGlmIChPYmplY3Qua2V5cyh0aGlzLnRleHRzW3RpbGUua2V5XXx8e30pLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZSh7fSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBmaXJzdCBjYWxsIHRvIG1haW4gdGhyZWFkLCBhc2sgZm9yIHRleHQgcGl4ZWwgc2l6ZXNcbiAgICAgICAgcmV0dXJuIFdvcmtlckJyb2tlci5wb3N0TWVzc2FnZSh0aGlzLm1haW5fdGhyZWFkX3RhcmdldCsnLmNhbGNUZXh0U2l6ZXMnLCB0aGlzLnRleHRzW3RpbGUua2V5XSkudGhlbih0ZXh0cyA9PiB7XG5cbiAgICAgICAgICAgIGlmICh0aWxlLmNhbmNlbGVkKSB7XG4gICAgICAgICAgICAgICAgbG9nKCd0cmFjZScsIGBTdHlsZSAke3RoaXMubmFtZX06IHN0b3AgdGlsZSBidWlsZCBiZWNhdXNlIHRpbGUgd2FzIGNhbmNlbGVkOiAke3RpbGUua2V5fSwgcG9zdC1jYWxjVGV4dFNpemVzKClgKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRoaXMudGV4dHNbdGlsZS5rZXldID0gdGV4dHM7XG4gICAgICAgICAgICBpZiAoIXRleHRzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gdGhpcy5idWlsZFRleHRMYWJlbHModGlsZS5rZXksIHF1ZXVlKTtcbiAgICAgICAgfSk7XG4gICAgfSxcblxuICAgIGNvbGxpZGVBbmRSZW5kZXJUZXh0TGFiZWxzICh0aWxlLCBjb2xsaXNpb25fZ3JvdXAsIGxhYmVscykge1xuICAgICAgICBpZiAoIWxhYmVscykge1xuICAgICAgICAgICAgQ29sbGlzaW9uLmNvbGxpZGUoe30sIGNvbGxpc2lvbl9ncm91cCwgdGlsZS5rZXkpO1xuICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZSh7fSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gQ29sbGlzaW9uLmNvbGxpZGUobGFiZWxzLCBjb2xsaXNpb25fZ3JvdXAsIHRpbGUua2V5KS50aGVuKGxhYmVscyA9PiB7XG4gICAgICAgICAgICBpZiAodGlsZS5jYW5jZWxlZCkge1xuICAgICAgICAgICAgICAgIGxvZygndHJhY2UnLCBgc3RvcCB0aWxlIGJ1aWxkIGJlY2F1c2UgdGlsZSB3YXMgY2FuY2VsZWQ6ICR7dGlsZS5rZXl9LCBwb3N0LWNvbGxpZGUoKWApO1xuICAgICAgICAgICAgICAgIHJldHVybiB7fTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGxhYmVscy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4ge307XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGxldCB0ZXh0cyA9IHRoaXMudGV4dHNbdGlsZS5rZXldO1xuICAgICAgICAgICAgdGhpcy5jdWxsVGV4dFN0eWxlcyh0ZXh0cywgbGFiZWxzKTtcblxuICAgICAgICAgICAgLy8gc2V0IGFsaWdubWVudHNcbiAgICAgICAgICAgIGxhYmVscy5mb3JFYWNoKHEgPT4ge1xuICAgICAgICAgICAgICAgIGxldCB0ZXh0X3NldHRpbmdzX2tleSA9IHEudGV4dF9zZXR0aW5nc19rZXk7XG4gICAgICAgICAgICAgICAgbGV0IHRleHRfaW5mbyA9IHRleHRzW3RleHRfc2V0dGluZ3Nfa2V5XSAmJiB0ZXh0c1t0ZXh0X3NldHRpbmdzX2tleV1bcS50ZXh0XTtcbiAgICAgICAgICAgICAgICBpZiAoIXRleHRfaW5mby50ZXh0X3NldHRpbmdzLmNhbl9hcnRpY3VsYXRlKXtcbiAgICAgICAgICAgICAgICAgICAgdGV4dF9pbmZvLmFsaWduID0gdGV4dF9pbmZvLmFsaWduIHx8IHt9O1xuICAgICAgICAgICAgICAgICAgICB0ZXh0X2luZm8uYWxpZ25bcS5sYWJlbC5hbGlnbl0gPSB7fTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgLy8gc2Vjb25kIGNhbGwgdG8gbWFpbiB0aHJlYWQsIGZvciByYXN0ZXJpemluZyB0aGUgc2V0IG9mIHRleHRzXG4gICAgICAgICAgICByZXR1cm4gV29ya2VyQnJva2VyLnBvc3RNZXNzYWdlKHRoaXMubWFpbl90aHJlYWRfdGFyZ2V0KycucmFzdGVyaXplVGV4dHMnLCB0aWxlLmtleSwgdGV4dHMpLnRoZW4oKHsgdGV4dHMsIHRleHR1cmUgfSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmICh0aWxlLmNhbmNlbGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGxvZygndHJhY2UnLCBgc3RvcCB0aWxlIGJ1aWxkIGJlY2F1c2UgdGlsZSB3YXMgY2FuY2VsZWQ6ICR7dGlsZS5rZXl9LCBwb3N0LXJhc3Rlcml6ZVRleHRzKClgKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHt9O1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHJldHVybiB7IGxhYmVscywgdGV4dHMsIHRleHR1cmUgfTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICB9LFxuXG4gICAgLy8gUmVtb3ZlIHVudXNlZCB0ZXh0L3N0eWxlIGNvbWJpbmF0aW9ucyB0byBhdm9pZCB1bm5lY2Vzc2FyeSByYXN0ZXJpemF0aW9uXG4gICAgY3VsbFRleHRTdHlsZXModGV4dHMsIGxhYmVscykge1xuICAgICAgICAvLyBDb3VudCBob3cgbWFueSB0aW1lcyBlYWNoIHRleHQvc3R5bGUgY29tYmluYXRpb24gaXMgdXNlZFxuIC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ICBpZiAoeiAhPT0gem9vbSkge1xuICAgICAgICAgICAgbGV0IHpzY2FsZSA9IE1hdGgucG93KDIsIHogLSB6b29tKTtcbiAgICAgICAgICAgIHggPSBNYXRoLmZsb29yKHggLyB6c2NhbGUpO1xuICAgICAgICAgICAgeSA9IE1hdGguZmxvb3IoeSAvIHpzY2FsZSk7XG4gICAgICAgICAgICB6ID0gem9vbTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gVGlsZS5jb29yZCh7eCwgeSwgen0pO1xuICAgIH1cblxuICAgIHN0YXRpYyBjb29yZGluYXRlV2l0aE1heFpvb20oe3gsIHksIHp9LCBtYXhfem9vbSkge1xuICAgICAgICBpZiAobWF4X3pvb20gIT09IHVuZGVmaW5lZCAmJiB6ID4gbWF4X3pvb20pIHtcbiAgICAgICAgICAgIHJldHVybiBUaWxlLmNvb3JkaW5hdGVBdFpvb20oe3gsIHksIHp9LCBtYXhfem9vbSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIFRpbGUuY29vcmQoe3gsIHksIHp9KTtcbiAgICB9XG5cbiAgICBzdGF0aWMgY2hpbGRyZW5Gb3JDb29yZGluYXRlKHt4LCB5LCB6LCBrZXl9KSB7XG4gICAgICAgIGlmICghVGlsZS5jb29yZF9jaGlsZHJlbltrZXldKSB7XG4gICAgICAgICAgICB6Kys7XG4gICAgICAgICAgICB4ICo9IDI7XG4gICAgICAgICAgICB5ICo9IDI7XG4gICAgICAgICAgICBUaWxlLmNvb3JkX2NoaWxkcmVuW2tleV0gPSBbXG4gICAgICAgICAgICAgICAgVGlsZS5jb29yZCh7eCwgeSwgICAgICB6fSksIFRpbGUuY29vcmQoe3g6IHgrMSwgeSwgICAgICB6fSksXG4gICAgICAgICAgICAgICAgVGlsZS5jb29yZCh7eCwgeTogeSsxLCB6fSksIFRpbGUuY29vcmQoe3g6IHgrMSwgeTogeSsxLCB6fSlcbiAgICAgICAgICAgIF07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJu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CkpO1xuICAgICAgICB0aGlzLnRleHR1cmVzID0gW107XG5cbiAgICAgICAgdGhpcy5wcmV2aW91c190ZXh0dXJlcy5mb3JFYWNoKHQgPT4gVGV4dHVyZS5yZWxlYXNlKHQpKTtcbiAgICAgICAgdGhpcy5wcmV2aW91c190ZXh0dXJlcyA9IFtdO1xuICAgIH1cblxuICAgIGRlc3Ryb3koKSB7XG4gICAgICAgIHRoaXMud29ya2VyTWVzc2FnZSgnc2VsZi5yZW1vdmVUaWxlJywgdGhpcy5rZXkpO1xuICAgICAgICB0aGlzLmZyZWVSZXNvdXJjZXMoKTtcbiAgICAgICAgdGhpcy53b3JrZXIgPSBudWxsO1xuICAgIH1cblxuICAgIGJ1aWxkQXNNZXNzYWdlKCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAga2V5OiB0aGlzLmtleSxcbiAgICAgICAgICAgIHNvdXJjZTogdGhpcy5zb3VyY2UubmFtZSxcbiAgICAgICAgICAgIGNvb3JkczogdGhpcy5jb29yZHMsXG4gICAgICAgICAgICBtaW46IHRoaXMubWluLFxuICAgICAgICAgICAgbWF4OiB0aGlzLm1heCxcbiAgICAgICAgICAgIHVuaXRzX3Blcl9waXhlbDogdGhpcy51bml0c19wZXJfcGl4ZWwsXG4gICAgICAgICAgICBtZXRlcnNfcGVyX3BpeGVsOiB0aGlzLm1ldGVyc19wZXJfcGl4ZWwsXG4gICAgICAgICAgICBtZXRlcnNfcGVyX3BpeGVsX3NxOiB0aGlzLm1ldGVyc19wZXJfcGl4ZWxfc3EsXG4gICAgICAgICAgICB1bml0c19wZXJfbWV0ZXJfb3Zlcnpvb206IHRoaXMudW5pdHNfcGVyX21ldGVyX292ZXJ6b29tLFxuICAgICAgICAgICAgc3R5bGVfem9vbTogdGhpcy5zdHlsZV96b29tLFxuICAgICAgICAgICAgb3Zlcnpvb206IHRoaXMub3Zlcnpvb20sXG4gICAgICAgICAgICBvdmVyem9vbTI6IHRoaXMub3Zlcnpvb20yLFxuICAg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pZiAoIWxheWVyIHx8ICFsYXllci5jb25maWcuZGF0YSkge1xuICAgICAgICAgICAgICAgIGxvZygnd2FybicsIGBMYXllciAke2xheWVyX25hbWV9IHdhcyBkZWZpbmVkIHdpdGhvdXQgYSBnZW9tZXRyeSBkYXRhIHNvdXJjZSBhbmQgd2lsbCBub3QgYmUgcmVuZGVyZWQuYCk7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIFNvdXJjZSBuYW1lcyBkb24ndCBtYXRjaFxuICAgICAgICAgICAgaWYgKGxheWVyLmNvbmZpZy5kYXRhLnNvdXJjZSAhPT0gdGlsZS5zb3VyY2UpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gR2V0IGRhdGEgZm9yIG9uZSBvciBtb3JlIGxheWVycyBmcm9tIHNvdXJjZVxuICAgICAgICAgICAgbGV0IHNvdXJjZV9sYXllcnMgPSBUaWxlLmdldERhdGFGb3JTb3VyY2UoZGF0YSwgbGF5ZXIuY29uZmlnLmRhdGEsIGxheWVyX25hbWUpO1xuXG4gICAgICAgICAgICAvLyBSZW5kZXIgZmVhdHVyZXMgaW4gbGF5ZXJcbiAgICAgICAgICAgIGZvciAobGV0IHM9MDsgcyA8IHNvdXJjZV9sYXllcnMubGVuZ3RoOyBzKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgc291cmNlX2xheWVyID0gc291cmNlX2xheWVyc1tzXTtcbiAgICAgICAgICAgICAgICBsZXQgZ2VvbSA9IHNvdXJjZV9sYXllci5nZW9tO1xuICAgICAgICAgICAgICAgIGlmICghZ2VvbSkge1xuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmb3IgKGxldCBmID0gMDsgZiA8IGdlb20uZmVhdHVyZXMubGVuZ3RoOyBmKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZlYXR1cmUgPSBnZW9tLmZlYXR1cmVzW2ZdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZmVhdHVyZS5nZW9tZXRyeSA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsgLy8gc2tpcCBmZWF0dXJlcyB3L28gZ2VvbWV0cnkgKHZhbGlkIEdlb0pTT04pXG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBsZXQgY29udGV4dCA9IFN0eWxlUGFyc2VyLmdldEZlYXR1cmVQYXJzZUNvbnRleHQoZmVhdHVyZSwgdGlsZSwgZ2xvYmFsKTtcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC53aW5kaW5nID0gdGlsZS5kZWZhdWx0X3dpbmRpbmc7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQuc291cmNlID0gdGlsZS5zb3VyY2U7ICAgICAgICAvLyBhZGQgZGF0YSBzb3VyY2UgbmFtZVxuICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmxheWVyID0gc291cmNlX2xheWVyLmxheWVyOyAgLy8gYWRkIGRhdGEgc291cmNlIGxheWVyIG5hbWVcblxuICAgICAgICAgICAgICAgICAgICAvLyBHZXQgZHJhdyBncm91cHMgZm9yIHRoaXMgZmVhdHVyZVxuICAgICAgICAgICAgICAgICAgICBsZXQgZHJhd19ncm91cHMgPSBsYXllci5idWlsZERyYXdHcm91cHMoY29udGV4dCwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghZHJhd19ncm91cHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gUmVuZGVyIGRyYXcgZ3JvdXBzXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGdyb3VwX25hbWUgaW4gZHJhd19ncm91cHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBncm91cCA9IGRyYXdfZ3JvdXBzW2dyb3VwX25hbWVdO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFncm91cC52aXNpYmxlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIEFkZCB0byBzdHlsZVxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN0eWxlX25hbWUgPSBncm91cC5zdHlsZSB8fCBncm91cF9uYW1lO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN0eWxlID0gc3R5bGVzW3N0eWxlX25hbWVdO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXN0eWxlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCd3YXJuJywgYFN0eWxlICcke3N0eWxlX25hbWV9JyBub3QgZm91bmQsIHNraXBwaW5nIGxheWVyICcke2xheWVyX25hbWV9JzpgLCBncm91cCwgZmVhdHVyZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHQubGF5ZXJzID0gZ3JvdXAubGF5ZXJzOyAgLy8gYWRkIG1hdGNoaW5nIGRyYXcgbGF5ZXJzXG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlLmFkZEZlYXR1cmUoZmVhdHVyZSwgZ3JvdXAsIGNvbnRleHQpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgdGlsZS5kZWJ1Zy5mZWF0dXJlcysrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aWxlLmRlYnVnLnJlbmRlcmluZyA9ICtuZXcgRGF0ZSgpIC0gdGlsZS5kZW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IEdyb3VwIHN0eWxlc1xuICAgICAgICBsZXQgZ3JvdXBzID0ge307XG4gICAgICAgIHN0eWxlcy5mb3JFYWNoKHMgPT4ge1xuICAgICAgICAgICAgbGV0IGdyb3VwX25hbWUgPSBncm91cF9ieShzKTtcbiAgICAgICAgICAgIGdyb3Vwc1tncm91cF9uYW1lXSA9IGdyb3Vwc1tncm91cF9uYW1lXSB8fCBbXTtcbiAgICAgICAgICAgIGdyb3Vwc1tncm91cF9uYW1lXS5wdXNoKHMpO1xuICAgICAgICB9KTtcblxuICAgICAgICBpZiAoT2JqZWN0LmtleXMoZ3JvdXBzKS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBsZXQgcHJvZ3Jlc3MgPSB7IHN0YXJ0OiB0cnVlIH07XG4gICAgICAgICAgICB0aWxlLm1lc2hfZGF0YSA9IHt9O1xuXG4gICAgICAgICAgICBmb3IgKGxldCBncm91cF9uYW1lIGluIGdyb3Vwcykge1xuICAgICAgICAgICAgICAgIGxldCBncm91cCA9IGdyb3Vwc1tncm91cF9uYW1lXTtcblxuICAgICAgICAgICAgICAgIFByb21pc2UuYWxsKGdyb3VwLm1hcChzdHlsZSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzdHlsZS5lbmREYXRhKHRpbGUpLnRoZW4oc3R5bGVfZGF0YSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3R5bGVfZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbGUubWVzaF9kYXRhW3N0eWxlLm5hbWVdID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJ0ZXhfZGF0YTogc3R5bGVfZGF0YS52ZXJ0ZXhfZGF0YSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmVydGV4X2VsZW1lbnRzOiBzdHlsZV9kYXRhLnZlcnRleF9lbGVtZW50cyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pZm9ybXM6IHN0eWxlX2RhdGEudW5pZm9ybXMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHR1cmVzOiBzdHlsZV9kYXRhLnRleHR1cmVzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSkpXG4gICAgICAgICAgICAgICAgLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBsb2coJ3RyYWNlJywgYEZpbmlzaGVkIHN0eWxlIGdyb3VwICcke2dyb3VwX25hbWV9JyBmb3IgdGlsZSAke3RpbGUua2V5fWApO1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIENsZWFyIGdyb3VwIGFuZCBjaGVjayBpZiBhbGwgZ3JvdXBzIGZpbmlzaGVkXG4gICAgICAgICAgICAgICAgICAgIGdyb3Vwc1tncm91cF9uYW1lXSA9IFtdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMoZ3JvdXBzKS5ldmVyeShnID0+IGdyb3Vwc1tnXS5sZW5ndGggPT09IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9ncmVzcy5kb25lID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIC8vIFNlbmQgbWVzaGVzIHRvIG1haW4gdGhyZWFkXG4gICAgICAgICAgICAgICAgICAgIFdvcmtlckJyb2tlci5wb3N0TWVzc2FnZShcbiAgICAgICAgICAgICAgICAgICAgICAgIGBUaWxlTWFuYWdlcl8ke3NjZW5lX2lkfS5idWlsZFRpbGVTdHlsZXNDb21wbGV0ZWRgLFxuICAgICAgICAgICAgICAgICAgICAgICAgV29ya2VyQnJva2VyLndpdGhUcmFuc2ZlcmFibGVzKHsgdGlsZTogVGlsZS5zbGljZSh0aWxlLCBbJ21lc2hfZGF0YSddKSwgcHJvZ3Jlc3MgfSlcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3Muc3RhcnQgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICB0aWxlLm1lc2hfZGF0YSA9IHt9OyAvLyByZXNldCBzbyBlYWNoIGdyb3VwIHNlbmRzIHNlcGFyYXRlIHNldCBvZiBzdHlsZSBtZXNoZXNcblxuICAgICAgICAgICAgICAgICAgICBpZiAocHJvZ3Jlc3MuZG9uZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgQ29sbGlzaW9uLnJlc2V0VGlsZSh0aWxlLmtleSk7IC8vIGNsZWFyIGNvbGxpc2lvbiBpZiB3ZSdyZSBkb25lIHdpdGggdGhlIHRpbGVcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgLy8gTm90aGluZyB0byBidWlsZCwgcmV0dXJuIGVtcHR5IHRpbGUgdG8gbWFpbiB0aHJlYWRcbiAgICAgICAgICAgIFdvcmtlckJyb2tlci5wb3N0TWVzc2FnZShcbiAgICAgICAgICAgICAgICBgVGlsZU1hbmFnZXJfJHtzY2VuZV9pZH0uYnVpbGRUaWxlU3R5bGVzQ29tcGxldGVkYCxcbiAgICAgICAgICAgICAgICBXb3JrZXJCcm9rZXIud2l0aFRyYW5zZmVyYWJsZXMoeyB0aWxlOiBUaWxlLnNsaWNlKHRpbGUpLCBwcm9ncmVzczogeyBzdGFydDogdHJ1ZSwgZG9uZTogdHJ1ZSB9IH0pXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgQ29sbGlzaW9uLnJlc2V0VGlsZSh0aWxlLmtleSk7IC8vIGNsZWFyIGNvbGxpc2lvbiBpZiB3ZSdyZSBkb25lIHdpdGggdGhlIHRpbGVcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8qKlxuICAgICAgICBSZXRyaWV2ZXMgZ2VvbWV0cnkgZnJvbSBhIHRpbGUgYWNjb3JkaW5nIHRvIGEgZGF0YSBzb3VyY2UgZGVmaW5pdGlvblxuICAgICAgICBSZXR1cm5zIGFuIGFycmF5IG9mIG9iamVjdHMgd2l0aDpcbiAgICAgICAgICAgIGxheWVyOiBzb3VyY2UgbGF5ZXIgbmFtZVxuICAgICAgICAgICAgZ2VvbTogR2VvSlNPTiBGZWF0dXJlQ29sbGVjdGlvblxuICAgICovXG4gICAgc3RhdGljIGdldERhdGFGb3JTb3VyY2UgKHNvdXJjZV9kYXRhLCBzb3VyY2VfY29uZmlnLCBkZWZhdWx0X2xheWVyID0gbnVsbCkge1xuICAgICAgICB2YXIgbGF5ZXJzID0gW107XG5cbiAgICAgICAgaWYgKHNvdXJjZV9jb25maWcgIT0gbnVsbCkge1xuICAgICAgICAgICAgLy8gSWYgbm8gbGF5ZXIgc3BlY2lmaWVkLCBhbmQgYSBkZWZhdWx0IHNvdXJjZSBsYXllciBleGlzdHNcbiAgICAgICAgICAgIGlmICghc291cmNlX2NvbmZpZy5sYXllciAmJiBzb3VyY2VfZGF0YS5sYXllcnMuX2RlZmF1bHQpIHtcbiAgICAgICAgICAgICAgICBsYXllcnMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIGdlb206IHNvdXJjZV9kYXRhLmxheWVycy5fZGVmYXVsdFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gSWYgbm8gbGF5ZXIgc3BlY2lmaWVkLCBhbmQgYSBkZWZhdWx0IHJlcXVlc3RlZCBsYXllciBleGlzdHNcbiAgICAgICAgICAgIGVsc2UgaWYgKCFzb3VyY2VfY29uZmlnLmxheWVyICYmIGRlZmF1bHRfbGF5ZXIpIHtcbiAgICAgICAgICAgICAgICBsYXllcnMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIGxheWVyOiBkZWZhdWx0X2xheWVyLFxuICAgICAgICAgICAgICAgICAgICBnZW9tOiBzb3VyY2VfZGF0YS5sYXllcnNbZGVmYXVsdF9sYXllcl1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIElmIGEgbGF5ZXIgaXMgc3BlY2lmaWVkIGJ5IG5hbWUsIHVzZSBpdFxuICAgICAgICAgICAgZWxzZSBpZiAodHlwZW9mIHNvdXJjZV9jb25maWcubGF5ZXIgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgbGF5ZXJzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBsYXllcjogc291cmNlX2NvbmZpZy5sYXllcixcbiAgICAgICAgICAgICAgICAgICAgZ2VvbTogc291cmNlX2RhdGEubGF5ZXJzW3NvdXJjZV9jb25maWcubGF5ZXJdXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBJZiBtdWx0aXBsZSBsYXllcnMgYXJlIHNwZWNpZmllZCBieSBuYW1lLCBjb21iaW5lIHRoZW1cbiAgICAgICAgICAgIGVsc2UgaWYgKEFycmF5LmlzQXJyYXkoc291cmNlX2NvbmZpZy5sYXllcikpIHtcbiAgICAgICAgICAgICAgICBzb3VyY2VfY29uZmlnLmxheWVyLmZvckVhY2gobGF5ZXIgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoc291cmNlX2RhdGEubGF5ZXJzW2xheWVyXSAmJiBzb3VyY2VfZGF0YS5sYXllcnNbbGF5ZXJdLmZlYXR1cmVzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsYXllcnMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGF5ZXIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2VvbTogc291cmNlX2RhdGEubGF5ZXJzW2xheWVyXVxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiA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gaXQgaXMgcHJvcGVybHkgcmVsZWFzZWQgKHRvIG1hdGNoIGl0cyByZXRhaW4gY291bnQpLlxuICAgICAgICAgICAgICAgIGlmIChtZXNoX2RhdGFbc10udGV4dHVyZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgdGV4dHVyZXMucHVzaCguLi5tZXNoX2RhdGFbc10udGV4dHVyZXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBkZWxldGUgdGhpcy5tZXNoX2RhdGE7XG5cbiAgICAgICAgLy8gSW5pdGlhbGl6ZSB0cmFja2luZyBmb3IgdGhpcyB0aWxlIGdlbmVyYXRpb25cbiAgICAgICAgaWYgKHByb2dyZXNzLnN0YXJ0KSB7XG4gICAgICAgICAgICB0aGlzLm5ld19tZXNoX3N0eWxlcyA9IFtdOyAvLyBrZWVwIHRyYWNrIG9mIHdoaWNoIG1lc2hlcyB3ZXJlIGJ1aWx0IGFzIHBhcnQgb2YgY3VycmVudCBnZW5lcmF0aW9uXG4gICAgICAgICAgICB0aGlzLnByZXZpb3VzX3RleHR1cmVzID0gWy4uLnRoaXMudGV4dHVyZXNdOyAvLyBjb3B5IG9sZCBsaXN0IG9mIHRleHR1cmVzXG4gICAgICAgICAgICB0aGlzLnRleHR1cmVzID0gW107XG4gICAgICAgIH1cblxuICAgICAgICAvLyBOZXcgbWVzaGVzXG4gICAgICAgIGZvciAobGV0IG0gaW4gbWVzaGVzKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5tZXNoZXNbbV0pIHtcbiAgICAgICAgICAgICAgICB0aGlzLm1lc2hlc1ttXS5kZXN0cm95KCk7IC8vIGZyZWUgb2xkIG1lc2hcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMubWVzaGVzW21dID0gbWVzaGVzW21dOyAvLyBzZXQgbmV3IG1lc2hcbiAgICAgICAgICAgIHRoaXMubmV3X21lc2hfc3R5bGVzLnB1c2gobSk7XG4gICAgIC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ZSBiZWVuIGRpc2NhcmRlZFxuICAgICAgICBGcmVlcyByZXNvdXJjZXMgdGhhdCB3b3VsZCBoYXZlIGJlZW4gdHJhbnNmZXJyZWQgdG8gdGhlIHRpbGUgb2JqZWN0LlxuICAgICAgICBTdGF0aWMgbWV0aG9kIGJlY2F1c2UgdGhlIHRpbGUgb2JqZWN0IG5vIGxvbmdlciBleGlzdHMgKHRoZSB0aWxlIGRhdGEgcmV0dXJuZWQgYnkgdGhlIHdvcmtlciBpcyBwYXNzZWQgaW5zdGVhZCkuXG4gICAgKi9cbiAgICBzdGF0aWMgYWJvcnRCdWlsZCAodGlsZSkge1xuICAgICAgICAvLyBSZWxlYXNlcyBtZXNoZXNcbiAgICAgICAgaWYgKHRpbGUubWVzaF9kYXRhKSB7XG4gICAgICAgICAgICBmb3IgKGxldCBzIGluIHRpbGUubWVzaF9kYXRhKSB7XG4gICAgICAgICAgICAgICAgbGV0IHRleHR1cmVzID0gdGlsZS5tZXNoX2RhdGFbc10udGV4dHVyZXM7XG4gICAgICAgICAgICAgICAgaWYgKHRleHR1cmVzKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IHQgb2YgdGV4dHVyZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ZXh0dXJlID0gVGV4dHVyZS50ZXh0dXJlc1t0XTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0ZXh0dXJlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCd0cmFjZScsIGByZWxlYXNpbmcgdGV4dHVyZSAke3R9IGZvciB0aWxlICR7dGlsZS5rZXl9YCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dHVyZS5yZWxlYXNlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBVcGRhdGUgcmVsYXRpdmUgdG8gdmlld1xuICAgIHVwZGF0ZSAoKSB7XG4gICAgICAgIGxldCBjb29yZHMgPSB0aGlzLmNvb3JkcztcbiAgICAgICAgaWYgKGNvb3Jkcy56ICE9PSB0aGlzLnZpZXcuY2VudGVyLnRpbGUueikge1xuICAgICAgICAgICAgY29vcmRzID0gVGlsZS5jb29yZGluYXRlQXRab29tKGNvb3JkcywgdGhpcy52aWV3LmNlbnRlci50aWxlLnopO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuY2VudGVyX2Rpc3QgPSBNYXRoLmFicyh0aGlzLnZpZXcuY2VudGVyLnRpbGUueCAtIGNvb3Jkcy54KSArIE1hdGguYWJzKHRoaXMudmlldy5jZW50ZXIudGlsZS55IC0gY29vcmRzLnkpO1xuICAgIH1cblxuICAgIC8vIFNldCBhcyBhIHByb3h5IHRpbGUgZm9yIGFub3RoZXIgdGlsZVxuICAgIHNldFByb3h5Rm9yICh0aWxlKSB7XG4gICAgICAgIGlmICh0aWxlKSB7XG4gICAgICAgICAgICB0aGlzLnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgdGhpcy5wcm94eV9mb3IgPSB0aGlzLnByb3h5X2ZvciB8fCBbXTtcbiAgICAgICAgICAgIHRoaXMucHJveHlfZm9yLnB1c2godGlsZSk7XG4gICAgICAgICAgICB0aGlzLnByb3h5X2RlcHRoID0gMTsgLy8gZHJhdyBwcm94aWVzIGEgaGFsZi1sYXllciBiYWNrIChvcmRlciBpcyBzY2FsZWQgMnggdG8gYXZvaWQgaW50ZWdlciB0cnVuY2F0aW9uKVxuICAgICAgICAgICAgdGlsZS5wcm94aWVkX2FzID0gKHRpbGUuc3R5bGVfem9vbSA+IHRoaXMuc3R5bGVfem9vbSA/ICdjaGlsZCcgOiAncGFyZW50Jyk7XG4gICAgICAgICAgICB0aGlzLnVwZGF0ZSgpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5wcm94eV9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ZSBiYWNrIHRvIHRoZSBtYWluIHRocmVhZCwgdG8gbWluaW1pemUgdW5uZWNlc3NhcnkgZGF0YSB0cmFuc2ZlclxuICAgIC8vIChlLmcuIHZlcnkgbGFyZ2UgaXRlbXMgbGlrZSBmZWF0dXJlIGdlb21ldHJ5IGFyZSBub3QgbmVlZGVkIG9uIHRoZSBtYWluIHRocmVhZClcbiAgICBzdGF0aWMgc2xpY2UgKHRpbGUsIGtleXMpIHtcbiAgICAgICAgbGV0IGtlZXAgPSBbXG4gICAgICAgICAgICAna2V5JyxcbiAgICAgICAgICAgICdsb2FkaW5nJyxcbiAgICAgICAgICAgICdsb2FkZWQnLFxuICAgICAgICAgICAgJ2dlbmVyYXRpb24nLFxuICAgICAgICAgICAgJ2Vycm9yJyxcbiAgICAgICAgICAgICdkZWJ1ZydcbiAgICAgICAgXTtcbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoa2V5cykpIHtcbiAgICAgICAgICAgIGtlZXAucHVzaCguLi5rZXlzKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEJ1aWxkIHRoZSB0aWxlIHN1YnNldFxuICAgICAgICB2YXIgdGlsZV9zdWJzZXQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQga2V5IG9mIGtlZXApIHtcbiAgICAgICAgICAgIHRpbGVfc3Vic2V0W2tleV0gPSB0aWxlW2tleV07XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGlsZV9zdWJzZXQ7XG4gICAgfVxuXG4gICAgbWVyZ2Uob3RoZXIpIHtcbiAgICAgICAgZm9yICh2YXIga2V5IGluIG90aGVyKSB7XG4gICAgICAgICAgICBpZiAoa2V5ICE9PSAna2V5Jykge1xuICAgICAgICAgICAgICAgIHRoaXNba2V5XSA9IG90aGVyW2tleV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgcHJpbnREZWJ1ZyAoKSB7XG4gICAgICAg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V2X2Nvb3JkcyA9IE9iamVjdC5rZXlzKHRoaXMudmlzaWJsZV9jb29yZHMpO1xuICAgICAgICB0aGlzLnZpc2libGVfY29vcmRzID0ge307XG4gICAgICAgIGxldCB0aWxlX2Nvb3JkcyA9IHRoaXMudmlldy5maW5kVmlzaWJsZVRpbGVDb29yZGluYXRlcygpO1xuICAgICAgICBmb3IgKGxldCBjb29yZHMgb2YgdGlsZV9jb29yZHMpIHtcbiAgICAgICAgICAgIHRoaXMucXVldWVDb29yZGluYXRlKGNvb3Jkcyk7XG4gICAgICAgICAgICB0aGlzLnZpc2libGVfY29vcmRzW2Nvb3Jkcy5rZXldID0gY29vcmRzO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gQ2hlY2sgaWYgdmlzaWJsZSBjb29yZHMgY2hhbmdlZFxuICAgICAgICAvLyBUT0RPOiBtb3ZlIHRvIGEgbmV3IHZpZXcgbWFuYWdlciBvYmplY3RcbiAgICAgICAgbGV0IG5ld19jb29yZHMgPSBPYmplY3Qua2V5cyh0aGlzLnZpc2libGVfY29vcmRzKTtcbiAgICAgICAgbGV0IGNvb3Jkc19jaGFuZ2VkID0gZmFsc2U7XG4gICAgICAgIGlmIChwcmV2X2Nvb3Jkcy5sZW5ndGggIT09IG5ld19jb29yZHMubGVuZ3RoKSB7XG4gICAgICAgICAgICBjb29yZHNfY2hhbmdlZCA9IHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBwcmV2X2Nvb3Jkcy5zb3J0KCk7XG4gICAgICAgICAgICBuZXdfY29vcmRzLnNvcnQoKTtcbiAgICAgICAgICAgIGlmICghcHJldl9jb29yZHMuZXZlcnkoKGMsIGkpID0+IG5ld19jb29yZHNbaV0gPT09IGMpKSB7XG4gICAgICAgICAgICAgICAgY29vcmRzX2NoYW5nZWQgPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy51cGRhdGVUaWxlU3RhdGVzKCk7XG4gICAgfVxuXG4gICAgdXBkYXRlVGlsZVN0YXRlcyAoKSB7XG4gICAgICAgIHRoaXMuZm9yRWFjaFRpbGUodGlsZSA9PiB7XG4gICAgICAgICAgICB0aGlzLnVwZGF0ZVZpc2liaWxpdHkodGlsZSk7XG4gICAgICAgICAgICB0aWxlLnVwZGF0ZSgpO1xuICAgICAgICB9KTtcblxuICAgICAgICB0aGlzLmxvYWRRdWV1ZWRDb29yZGluYXRlcygpO1xuICAgICAgICB0aGlzLnVwZGF0ZVByb3h5VGlsZXMoKTtcbiAgICAgICAgdGhpcy52aWV3LnBydW5lVGlsZXNGb3JWaWV3KCk7XG4gICAgfVxuXG4gICAgdXBkYXRlUHJveHlUaWxlcyAoKSB7XG4gICAgICAgIGlmICh0aGlzLnZpZXcuem9vbV9kaXJlY3Rpb24gPT09IDApIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIENsZWFyIHByZXZpb3VzIHByb3hpZXNcbiAgICAgICAgdGhpcy5mb3JFYWNoVGlsZSh0aWxlID0+IHRpbGUuc2V0UHJveHlGb3IobnVsbCkpO1xuXG4gICAgICAgIGxldCBwcm94eSA9IGZhbHNlO1xuICAgICAgICB0aGlzLmZvckVhY2hUaWxlKHRpbGUgPT4ge1xuICAgICAgICAgICAgaWYgKHRoaXMudmlldy56b29tX2RpcmVjdGlvbiA9PT0gMSkge1xuICAgICAgICAgICAgICAgIGlmICh0aWxlLnZpc2libGUgJiYgIXRpbGUuYnVpbHQgJiYgdGlsZS5jb29yZHMueiA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHAgPSB0aGlzLnB5cmFtaWQuZ2V0QW5jZXN0b3IodGlsZSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwLnNldFByb3h5Rm9yKHRpbGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcHJveHkgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAodGhpcy52aWV3Lnpvb21fZGlyZWN0aW9uID09PSAtMSkge1xuICAgICAgICAgICAgICAgIGlmICh0aWxlLnZpc2libGUgJiYgIXRpbGUuYnVpbHQpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSB0aGlzLnB5cmFtaWQuZ2V0RGVzY2VuZGFudHModGlsZSk7XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IHQgb2YgZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdC5zZXRQcm94eUZvcih0aWxlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb3h5ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgaWYgKCFwcm94eSkge1xuICAgICAgICAgICAgdGhpcy52aWV3Lnpvb21fZGlyZWN0aW9uID0gMDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHVwZGF0ZVZpc2liaWxpdHkodGlsZSkge1xuICAgICAgICB0aWxlLnZpc2libGUgPSBmYWxzZTtcbiAgICAgICAgaWYgKHRpbGUuc3R5bGVfem9vbSA9PT0gdGhpcy52aWV3LnRpbGVfem9vbSkge1xuICAgICAgICAgICAgaWYgKHRoaXMudmlzaWJsZV9jb29yZHNbdGlsZS5jb29yZHMua2V5XSkge1xuICAgICAgICAgICAgICAgIHRpbGUudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBicnV0ZSBmb3JjZVxuICAgICAgICAgICAgICAgIGZvciAobGV0IGtleSBpbiB0aGlzLnZpc2libGVfY29vcmRzKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChUaWxlLmlzRGVzY2VuZGFudCh0aWxlLmNvb3JkcywgdGhpcy52aXNpYmxlX2Nvb3Jkc1trZXldKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGlsZS52aXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gUmVtb3ZlIHRpbGVzIHRoYXQgYXJlbid0IHZpc2libGUsIGFuZCBmbGFnIHJlbWFpbmluZyB2aXNpYmxlIG9uZXMgdG8gYmUgdXBkYXRlZCAoZm9yIGxvYWRpbmcsIHByb3h5LCBldGMuKVxuICAgIHBydW5lVG9WaXNpYmxlVGlsZXMgKCkge1xuICAgICAgICB0aGlzLnJlbW92ZVRpbGVzKHRpbGUgPT4gIXRpbGUudmlzaWJsZSk7XG4gICAgfVxuXG4gICAgZ2V0UmVuZGVyYWJsZVRpbGVzKCkge1xuICAgICAgICBsZXQgdGlsZXMgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgdCBpbiB0aGlzLnRpbGVzKSB7XG4gICAgICAgICAgICBsZXQgdGlsZSA9IHRoaXMudGlsZXNbdF07XG4gICAgICAgICAgICBpZiAodGlsZS52aXNpYmxlICYmIHRpbGUubG9hZGVkKSB7XG4gICAgICAgICAgICAgICAgdGlsZXMucHVzaCh0aWxlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGlsZXM7XG4gICAgfVxuXG4gICAgaXNMb2FkaW5nVmlzaWJsZVRpbGVzKCkge1xuICAgICAgICByZXR1cm4gT2JqZWN0LmtleXModGhpcy50aWxlcykuc29tZShrID0+IHRoaXMudGlsZXNba10udmlzaWJsZSAmJiAhdGhpcy50aWxlc1trXS5idWlsdCk7XG4gICAgfVxuXG4gICAgLy8gUXVldWUgYSB0aWxlIGZvciBsb2FkXG4gICAgcXVldWVDb29yZG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bm90IGF0IGN1cnJlbnQgc2NlbmUgem9vbVxuICAgICAgICBpZiAoY29vcmRzLnogIT09IHRoaXMudmlldy5jZW50ZXIudGlsZS56KSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICAvLyBEZXRlcm1pbmUgbmVjZXNzYXJ5IHRpbGVzIGZvciBlYWNoIHNvdXJjZVxuICAgICAgICBmb3IgKGxldCBzIGluIHRoaXMuc2NlbmUuc291cmNlcykge1xuICAgICAgICAgICAgbGV0IHNvdXJjZSA9IHRoaXMuc2NlbmUuc291cmNlc1tzXTtcbiAgICAgICAgICAgIC8vIENoZWNrIGlmIGRhdGEgc291cmNlIHNob3VsZCBidWlsZCB0aGlzIHRpbGVcbiAgICAgICAgICAgIGlmICghc291cmNlLmJ1aWxkc19nZW9tZXRyeV90aWxlcyB8fCAhc291cmNlLmluY2x1ZGVzVGlsZShjb29yZHMsIHRoaXMudmlldy50aWxlX3pvb20pKSB7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGxldCBrZXkgPSBUaWxlLmtleShjb29yZHMsIHNvdXJjZSwgdGhpcy52aWV3LnRpbGVfem9vbSk7XG4gICAgICAgICAgICBpZiAoa2V5ICYmICF0aGlzLmhhc1RpbGUoa2V5KSkge1xuICAgICAgICAgICAgICAgIGxldCB0aWxlID0gVGlsZS5jcmVhdGUoe1xuICAgICAgICAgICAgICAgICAgICBzb3VyY2UsXG4gICAgICAgICAgICAgICAgICAgIGNvb3JkcyxcbiAgICAgICAgICAgICAgICAgICAgd29ya2VyOiB0aGlzLnNjZW5lLm5leHRXb3JrZXIoKSxcbiAgICAgICAgICAgICAgICAgICAgc3R5bGVfem9vbTogdGhpcy52aWV3LnN0eWxlWm9vbShjb29yZHMueiksXG4gICAgICAgICAgICAgICAgICAgIHZpZXc6IHRoaXMudmlld1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgdG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gICAgICAgICAgIGNvb3JkID0gdGhpcy5jb29yZHNba2V5XSA9IHsgZGVzY2VuZGFudHM6IDAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghY29vcmQuc291cmNlcykge1xuICAgICAgICAgICAgY29vcmQuc291cmNlcyA9IG5ldyBNYXAoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghY29vcmQuc291cmNlcy5nZXQodGlsZS5zb3VyY2UubmFtZSkpIHtcbiAgICAgICAgICAgIGNvb3JkLnNvdXJjZXMuc2V0KHRpbGUuc291cmNlLm5hbWUsIG5ldyBNYXAoKSk7XG4gICAgICAgIH1cbiAgICAgICAgY29vcmQuc291cmNlcy5nZXQodGlsZS5zb3VyY2UubmFtZSkuc2V0KHRpbGUuc3R5bGVfem9vbSwgdGlsZSk7XG5cbiAgICAgICAgLy8gSW5jcmVtZW50IHJlZmVyZW5jZSBjb3VudCB1cCB0aGUgdGlsZSBweXJhbWlkXG4gICAgICAgIGZvciAobGV0IHogPSB0aWxlLmNvb3Jkcy56IC0gMTsgeiA+PSAwOyB6LS0pIHtcbiAgICAgICAgICAgIGxldCB1cCA9IFRpbGUuY29vcmRpbmF0ZUF0Wm9vbSh0aWxlLmNvb3Jkcywgeik7XG4gICAgICAgICAgICBpZiAoIXRoaXMuY29vcmRzW3VwLmtleV0pIHtcbiAgICAgICAgICAgICAgICB0aGlzLmNvb3Jkc1t1cC5rZXldID0geyBkZXNjZW5kYW50czogMCB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy5jb29yZHNbdXAua2V5XS5kZXNjZW5kYW50cysrO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmVtb3ZlVGlsZSh0aWxlKSB7XG4gICAgICAgIC8vIFJlbW92ZSB0YXJnZXQgdGlsZVxuICAgICAgICBsZXQgc291cmNlX3RpbGVzID0gdGhpcy5zb3VyY2VUaWxlcyh0aWxlLmNvb3JkcywgdGlsZS5zb3VyY2UpO1xuICAgICAgICBsZXQga2V5ID0gdGlsZS5jb29yZHMua2V5O1xuXG4gICAgICAgIGlmIChzb3VyY2VfdGlsZXMpIHtcbiAgICAgICAgICAgIHNvdXJjZV90aWxlcy5kZWxldGUodGlsZS5zdHlsZV96b29tKTtcbiAgICAgICAgICAgIGlmIChzb3VyY2VfdGlsZXMuc2l6ZSA9PT0gMCkge1xuICAgICAgICAgICAgICAgIC8vIHJlbW92ZSBzb3VyY2VcbiAgICAgICAgICAgICAgICB0aGlzLmNvb3Jkc1trZXldLnNvdXJjZXMuZGVsZXRlKHRpbGUuc291cmNlLm5hbWUpO1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLmNvb3Jkc1trZXldLnNvdXJjZXMuc2l6ZSA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgdGhpcy5jb29yZHNba2V5XS5zb3VyY2VzO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmNvb3Jkc1trZXldLmRlc2NlbmRhbnRzID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyByZW1vdmUgd2hvbGUgY29vcmRcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSB0aGlzLmNvb3Jkc1trZXldO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gRGVjcmVtZW50IHJlZmVyZW5jZSBjb3VudCB1cCB0aGUgdGlsZSBweXJhbWlkXG4gICAgICAgIGZvciAobGV0IHogPSB0aWxlLmNvb3Jkcy56IC0gMTsgeiA+PSAwOyB6LS0pIHtcbiAgICAgICAgICAgIGxldCBkb3duID0gVGlsZS5jb29yZGluYXRlQXRab29tKHRpbGUuY29vcmRzLCB6KTtcbiAgICAgICAgICAgIGlmICh0aGlzLmNvb3Jkc1tkb3duLmtleV0gJiYgdGhpcy5jb29yZHNbZG93bi5rZXldLmRlc2NlbmRhbnRzID4gMCkge1xuICAgICAgICAgICAgICAgIHRoaXMuY29vcmRzW2Rvd24ua2V5XS5kZXNjZW5kYW50cy0tO1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLmNvb3Jkc1tkb3duLmtleV0uZGVzY2VuZGFudHMgPT09IDAgJiYgIXRoaXMuY29vcmRzW2Rvd24ua2V5XS5zb3VyY2VzKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSB0aGlzLmNvb3Jkc1tkb3duLmtleV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZ2V0QW5jZXN0b3IgKHsgY29vcmRzLCBzdHlsZV96b29tLCBzb3VyY2UgfSkge1xuICAgICAgICAvLyBGaXJzdCBjaGVjayBvdmVyem9vbWVkIHRpbGVzIGF0IHNhbWUgY29vcmRpbmF0ZSB6b29tXG4gICAgICAgIGlmIChzdHlsZV96b29tID4gc291cmNlLm1heF96b29tKSB7XG4gICAgICAgICAgICBsZXQgc291cmNlX3RpbGVzID0gdGhpcy5zb3VyY2VUaWxlcyhjb29yZHMsIHNvdXJjZSk7XG4gICAgICAgICAgICBpZiAoc291cmNlX3RpbGVzKSB7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgeiA9IHN0eWxlX3pvb20gLSAxOyB6ID49IHNvdXJjZS5tYXhfem9vbTsgei0tKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzb3VyY2VfdGlsZXMuaGFzKHopICYmIHNvdXJjZV90aWxlcy5nZXQoeikubG9hZGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc291cmNlX3RpbGVzLmdldCh6KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHN0eWxlX3pvb20gPSBzb3VyY2UubWF4X3pvb207XG4gICAgICAgIH1cblxuICAgICAgICAvLyBDaGVjayB0aWxlcyBhdCBuZXh0IHpvb20gdXBcbiAgICAgICAgc3R5bGVfem9vbS0tO1xuICAgICAgICBsZXQgcGFyZW50ID0gVGlsZS5jb29yZGluYXRlQXRab29tKGNvb3JkcywgY29vcmRzLnogLSAxKTtcbiAgICAgICAgbGV0IHBhcmVudF90aWxlcyA9IHRoaXMuc291cmNlVGlsZXMocGFyZW50LCBzb3VyY2UpO1xuICAgICAgICBpZiAocGFyZW50X3RpbGVzICYmIHBhcmVudF90aWxlcy5oYXMoc3R5bGVfem9vbSkgJiYgcGFyZW50X3RpbGVzLmdldChzdHlsZV96b29tKS5sb2FkZWQpIHtcbiAgICAgICAgICAgIHJldHVybiBwYXJlbnRfdGlsZXMuZ2V0KHN0eWxlX3pvb20pO1xuICAgICAgICB9XG4gICAgICAgIC8vIGRpZG4ndCBmaW5kIGFuY2VzdG9yLCB0cnkgbmV4dCBsZXZlbFxuICAgICAgICAvLyBUT0RPOiBtYXggZGVwdGggbGV2ZWxzIHRvIGNoZWNrXG4gICAgICAgIGlmIChwYXJlbnQueiA+IDApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmdldEFuY2VzdG9yKHsgY29vcmRzOiBwYXJlbnQsIHN0eWxlX3pvb20sIHNvdXJjZSB9KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGdldERlc2NlbmRhbnRzICh7IGNvb3Jkcywgc3R5bGVfem9vbSwgc291cmNlIH0sIGxldmVsID0gMSkge1xuICAgICAgICBsZXQgZGVzY2VuZGFudHMgPSBbXTtcblxuICAgICAgICAvLyBGaXJzdCBjaGVjayBvdmVyem9vbWVkIHRpbGVzIGF0IHNhbWUgY29vcmRpbmF0ZSB6b29tXG4gICAgICAgIGlmIChzdHlsZV96b29tID49IHNvdXJjZS5tYXhfem9vbSkge1xuICAgICAgICAgICAgbGV0IHNvdXJjZV90aWxlcyA9IHRoaXMuc291cmNlVGlsZXMoY29vcmRzLCBzb3VyY2UpO1xuICAgICAgICAgICAgaWYgKHNvdXJjZV90aWxlcykge1xuICAgICAgICAgICAgICAgIGxldCBzZWFyY2hfbWF4X3pvb20gPSBNYXRoLm1heChHZW8uZGVmYXVsdF92aWV3X21heF96b29tLCBzdHlsZV96b29tICsgdGhpcy5tYXhfcHJveHlfZGVzY2VuZGFudF9kZXB0aCk7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgeiA9IHN0eWxlX3pvb20gKyAxOyB6IDw9IHNlYXJjaF9tYXhfem9vbTsgeisrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzb3VyY2VfdGlsZXMuaGFzKHopICYmIHNvdXJjZV90aWxlcy5nZXQoeikubG9hZGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjZW5kYW50cy5wdXNoKHNvdXJjZV90aWxlcy5nZXQoeikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRlc2NlbmRhbnRzO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGRlc2NlbmRhbnRzO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gQ2hlY2sgdGlsZXMgYXQgbmV4dCB6b29tIGRvd25cbiAgICAgICAgaWYgKHRoaXMuY29vcmRzW2Nvb3Jkcy5rZXldICYmIHRoaXMuY29vcmRzW2Nvb3Jkcy5rZXldLmRlc2NlbmRhbnRzID4gMCkge1xuICAgICAgICAgICAgc3R5bGVfem9vbSsrO1xuICAgICAgICAgICAgZm9yIChsZXQgY2hpbGQgb2YgVGlsZS5jaGlsZHJlbkZvckNvb3JkaW5hdGUoY29vcmRzKSkge1xuICAgICAgICAgICAgICAgIGxldCBjaGlsZF90aWxlcyA9IHRoaXMuc291cmNlVGlsZXMoY2hpbGQsIHNvdXJjZSk7XG4gICAgICAgICAgICAgICAgaWYgKGNoaWxkX3RpbGVzICYmIGNoaWxkX3RpbGVzLmhhcyhzdHlsZV96b29tKSAmJiBjaGlsZF90aWxlcy5nZXQoc3R5b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sZW5ndGggPiAxKSB7XG4gICAgICAgICAgICAgICAgbG9nZ2VyKGBUYW5ncmFtICR7dmVyc2lvbn0gWyR7bXNnX2xldmVsfV06ICR7bXNnWzBdfWAsIC4uLm1zZy5zbGljZSgxKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBsb2dnZXIoYFRhbmdyYW0gJHt2ZXJzaW9ufSBbJHttc2dfbGV2ZWx9XTogJHttc2dbMF19YCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG59XG5cbmxvZy5sZXZlbCA9ICdpbmZvJztcbmxvZy53b3JrZXJzID0gbnVsbDtcblxubG9nLnNldExldmVsID0gZnVuY3Rpb24gKGxldmVsKSB7XG4gICAgbG9nLmxldmVsID0gbGV2ZWw7XG5cbiAgICBpZiAoVGhyZWFkLmlzX21haW4gJiYgQXJyYXkuaXNBcnJheShsb2cud29ya2VycykpIHtcbiAgICAgICAgV29ya2VyQnJva2VyLnBvc3RNZXNzYWdlKGxvZy53b3JrZXJzLCAnX2xvZ1NldExldmVsUHJveHknLCBsZXZlbCk7XG4gICAgfVxufTtcblxuaWYgKFRocmVhZC5pc19tYWluKSB7XG4gICAgbG9nLnNldFdvcmtlcnMgPSBmdW5jdGlvbiAod29ya2Vycykge1xuICAgICAgICBsb2cud29ya2VycyA9IHdvcmtlcnM7XG4gICAgfTtcblxuXG59XG5cbldvcmtlckJyb2tlci5hZGRUYXJnZXQoJ19sb2dQcm94eScsIGxvZyk7ICAgICAgICAgICAgICAgICAgIC8vIHByb3h5IGxvZyBtZXNzYWdlcyBmcm9tIHdvcmtlciB0byBtYWluIHRocmVhZFxuV29ya2VyQnJva2VyLmFkZFRhcmdldCgnX2xvZ1NldExldmVsUHJveHknLCBsb2cuc2V0TGV2ZWwpOyAgLy8gcHJveHkgbG9nIGxldmVsIHNldHRpbmcgZnJvbSBtYWluIHRvIHdvcmtlciB0aHJlYWRcbiIsIi8qIGds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ja3MoKTtcbiAgICAgICAgICAgICAgICAgICAgdHJhY2tzLmZvckVhY2godHJhY2sgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhY2suc3RvcCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FwLnN0cmVhbS5yZW1vdmVUcmFjayh0cmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBjYXAuc3RyZWFtID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgY2FwLm1lZGlhX3JlY29yZGVyID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy52aWRlb19jYXB0dXJlID0gbnVsbDtcblxuICAgICAgICAgICAgICAgICAgICBjYXAucmVzb2x2ZSh7IHVybCwgYmxvYiwgdHlwZTogJ3dlYm0nIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBjYXAubWVkaWFfcmVjb3JkZXIuc3RhcnQoKTtcbiAgICAgICAgfVxuICAgICAgICBjYXRjaCAoZSkge1xuICAgICAgICAgICAgdGhpcy52aWRlb19jYXB0dXJlID0gbnVsbDtcbiAgICAgICAgICAgIGxvZygnZXJyb3InLCAnU2NlbmUgdmlkZW8gY2FwdHVyZSBmYWlsZWQnLCBlKTtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9XG5cbiAgICAvLyBTdG9wcyBjYXB0dXJpbmcgYSB2aWRlbyBzdHJlYW0gZnJvbSB0aGUgY2FudmFzLCByZXR1cm5zIGEgcHJvbWlzZSB0aGF0IHJlc29sdmVzIHdpdGggdGhlIHZpZGVvIHdoZW4gYXZhaWxhYmxlXG4gICAgc3RvcFZpZGVvQ2FwdHVyZSAoKSB7XG4gICAgICAgIGlmICghdGhpcy52aWRlb19jYXB0dXJlKSB7XG4gICAgICAgICAgICBsb2coJ3dhcm4nLCAnTm8gc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KSBvciBkYXRhLCBhZGQgYmFzZVxuICAgIGVsc2UgaWYgKHVybC5zZWFyY2goL14oaHR0cHxodHRwc3xkYXRhfGJsb2IpOi8pIDwgMCkge1xuICAgICAgICB2YXIgcmVsYXRpdmUgPSAodXJsWzBdICE9PSAnLycpO1xuICAgICAgICB2YXIgYmFzZV9pbmZvO1xuICAgICAgICBpZiAoYmFzZSkge1xuICAgICAgICAgICAgYmFzZV9pbmZvID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnYScpOyAvLyB1c2UgYSB0ZW1wb3JhcnkgZWxlbWVudCB0byBwYXJzZSBVUkxcbiAgICAgICAgICAgIGJhc2VfaW5mby5ocmVmID0gYmFzZTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGJhc2VfaW5mbyA9IHdpbmRvdy5sb2NhdGlvbjtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChyZWxhdGl2ZSkge1xuICAgICAgICAgICAgbGV0IHBhdGggPSBVdGlscy5wYXRoRm9yVVJMKGJhc2VfaW5mby5ocmVmKTtcbiAgICAgICAgICAgIHVybCA9IHBhdGggKyB1cmw7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAvLyBFYXN5IHdheVxuICAgICAgICAgICAgaWYgKGJhc2VfaW5mby5vcmlnaW4pIHtcbiAgICAgICAgICAgICAgICB1cmwgPSBiYXNlX2luZm8ub3JpZ2luICsgJy8nICsgdXJsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gSGFyZCB3YXkgKElFMTEpXG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB2YXIgb3JpZ2luID0gdXJsLm1hdGNoKC9eKChodHRwfGh0dHBzfGRhdGF8YmxvYik6XFwvXFwvW15cXC9dKlxcLykvKTtcbiAgICAgICAgICAgICAgICBvcmlnaW4gPSAob3JpZ2luICYmIG9yaWdpbi5sZW5ndGggPiAxKSA/IG9yaWdpblswXSA6ICcnO1xuICAgICAgICAgICAgICAgIHVybCA9IG9yaWdpbiArIHVybDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gdXJsO1xufTtcblxuVXRpbHMucGF0aEZvclVSTCA9IGZ1bmN0aW9uICh1cmwpIHtcbiAgICBpZiAodHlwZW9mIHVybCA9PT0gJ3N0cmluZycgJiYgdXJsLnNlYXJjaCgvXihkYXRhfGJsb2IpOi8pID09PSAtMSkge1xuICAgICAgICBsZXQgcXMgPSB1cmwuaW5kZXhPZignPycpO1xuICAgICAgICBpZiAocXMgPiAtMSkge1xuICAgICAgICAgICAgdXJsID0gdXJsLnN1YnN0cigwLCBxcyk7XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgaGFzaCA9IHVybC5pbmRleE9mKCcjJyk7XG4gICAgICAgIGlmIChoYXNoID4gLTEpIHtcbiAgICAgICAgICAgIHVybCA9IHVybC5zdWJzdHIoMCwgaGFzaCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdXJsLnN1YnN0cigwLCB1cmwubGFzdEluZGV4T2YoJy8nKSArIDEpIHx8ICcnO1xuICAgIH1cbiAgICByZXR1cm4gJyc7XG59O1xuXG5VdGlscy5pc1JlbGF0aXZlVVJMID0gZnVuY3Rpb24gKHVybCkge1xuICAgIGlmICh0eXBlb2YgdXJsICE9PSAnc3RyaW5nJykge1xuICAgICAgICByZXR1cm47XG4gICAgfVxuICAgIHJldHVybiAhKHVybC5zZWFyY2goL14oaHR0cHxodHRwc3xkYXRhfGJsb2IpOi8pID4gLTEgfHwgdXJsLnN1YnN0cigwLCAyKSA9PT0gJy8vJyk7XG59O1xuXG4vLyBSZXNvbHZlcyAnLi8nIGFuZCAnLi4vJyBjb21wb25lbnRzIGZyb20gcmVsYXRpdmUgcGF0aCwgdG8gZ2V0IGEgXCJmbGF0dGVuZWRcIiBwYXRoXG5VdGlscy5mbGF0dGVuUmVsYXRpdmVVUkwgPSBmdW5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2Uge1xuICAgICAgICByZXR1cm4gdXJsO1xuICAgIH1cbn07XG5cblV0aWxzLmlvID0gZnVuY3Rpb24gKHVybCwgdGltZW91dCA9IDYwMDAwLCByZXNwb25zZVR5cGUgPSAndGV4dCcsIG1ldGhvZCA9ICdHRVQnLCBoZWFkZXJzID0ge30pIHtcbiAgICB2YXIgcmVxdWVzdCA9IG5ldyBYTUxIdHRwUmVxdWVzdCgpO1xuICAgIHZhciBwcm9taXNlID0gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgICByZXF1ZXN0Lm9wZW4obWV0aG9kLCB1cmwsIHRydWUpO1xuICAgICAgICByZXF1ZXN0LnRpbWVvdXQgPSB0aW1lb3V0O1xuICAgICAgICByZXF1ZXN0LnJlc3BvbnNlVHlwZSA9IHJlc3BvbnNlVHlwZTtcbiAgICAgICAgcmVxdWVzdC5vbmxvYWQgPSAoKSA9PiB7XG4gICAgICAgICAgICBpZiAocmVxdWVzdC5zdGF0dXMgPT09IDIwMCkge1xuICAgICAgICAgICAgICAgIGlmIChbJ3RleHQnLCAnanNvbiddLmluZGV4T2YocmVxdWVzdC5yZXNwb25zZVR5cGUpID4gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShyZXF1ZXN0LnJlc3BvbnNlVGV4dCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHJlcXVlc3QucmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVqZWN0KEVycm9yKCdSZXF1ZXN0IGVycm9yIHdpdGggYSBzdGF0dXMgb2YgJyArIHJlcXVlc3Quc3RhdHVzVGV4dCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICByZXF1ZXN0Lm9uZXJyb3IgPSAoZXZ0KSA9PiB7X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YTtcbn07XG5cblV0aWxzLmxvYWRSZXNvdXJjZSA9IGZ1bmN0aW9uIChzb3VyY2UpIHtcbiAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgICBpZiAodHlwZW9mIHNvdXJjZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIFV0aWxzLmlvKHNvdXJjZSkudGhlbigoYm9keSkgPT4ge1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBkYXRhID0gVXRpbHMucGFyc2VSZXNvdXJjZShib2R5KTtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShkYXRhKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY2F0Y2goZSkge1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSwgcmVqZWN0KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlc29sdmUoc291cmNlKTtcbiAgICAgICAgfVxuICAgIH0pO1xufTtcblxuLy8gTmVlZGVkIGZvciBvbGRlciBicm93c2VycyB0aGF0IHN0aWxsIHN1cHBvcnQgV2ViR0wgKFNhZmFyaSA2IGV0Yy4pXG5VdGlscy5yZXF1ZXN0QW5pbWF0aW9uRnJhbWVQb2x5ZmlsbCA9IGZ1bmN0aW9uICgpIHtcbiAgICBpZiAodHlwZW9mIHdpbmRvdy5yZXF1ZXN0QW5pbWF0aW9uRnJhbWUgIT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgd2luZG93LnJlcXVlc3RBbmltYXRpb25GcmFtZSA9XG4gICAgICAgICAgICB3aW5kb3cud2Via2l0UmVxdWVzdEFuaW1hdGlvbkZyYW1lIHx8XG4gICAgICAgICAgICB3aW5kb3cubW96UmVxdWVzdEFuaW1hdGlvbkZyYW1lICAgIHx8XG4gICAgICAgICAgICB3aW5kb3cub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KHggPj0gcG9pbnRzW2ldWzBdICYmIHggPCBwb2ludHNbaSsxXVswXSkge1xuICAgICAgICAgICAgICAgIC8vIExpbmVhciBpbnRlcnBvbGF0aW9uXG4gICAgICAgICAgICAgICAgeDEgPSBwb2ludHNbaV1bMF07XG4gICAgICAgICAgICAgICAgeDIgPSBwb2ludHNbaSsxXVswXTtcblxuICAgICAgICAgICAgICAgIC8vIE11bHRpcGxlIHZhbHVlc1xuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHBvaW50c1tpXVsxXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgeSA9IFtdO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBjPTA7IGMgPCBwb2ludHNbaV1bMV0ubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdHJhbnNmb3JtID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeTEgPSB0cmFuc2Zvcm0ocG9pbnRzW2ldWzFdW2NdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB5MiA9IHRyYW5zZm9ybShwb2ludHNbaSsxXVsxXVtjXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IHkyIC0geTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeVtjXSA9IGQgKiAoeCAtIHgxKSAvICh4MiAtIHgxKSArIHkxO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IHBvaW50c1tpKzFdWzFdW2NdIC0gcG9pbnRzW2ldWzFdW2NdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlbY10gPSBkICogKHggLSB4MSkgLyAoeDIgLSB4MSkgKyBwb2ludHNbaV1bMV1bY107XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gU2luZ2xlIHZhbHVlXG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdHJhbnNmb3JtID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB5MSA9IHRyYW5zZm9ybShwb2ludHNbaV1bMV0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgeTIgPSB0cmFuc2Zvcm0ocG9pbnRzW2krMV1bMV0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IHkyIC0geTE7XG4gICAgICAgICAgICAgICAgICAgICAgICB5ID0gZCAqICh4IC0geDEpIC8gKHgyIC0geDEpICsgeTE7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gcG9pbnRzW2krMV1bMV0gLSBwb2ludHNbaV1bMV07XG4gICAgICAgICAgICAgICAgICAgICAgICB5ID0gZCAqICh4IC0geDEpIC8gKHgyIC0geDEpICsgcG9pbnRzW2ldWzFdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiB5O1xufTtcblxuLy8gSXRlcmF0b3JzIChFUzYgZ2VuZXJhdG9ycylcblxuLy8gSXRlcmF0b3IgZm9yIGtleS92YWx1ZSBwYWlycyBvZiBhbiBvYmplY3RcblV0aWxzLmVudHJpZXMgPSBmdW5jdGlvbiogKG9iaikge1xuICAgIGZvciAodmFyIGtleSBvZiBPYmplY3Qua2V5cyhvYmopKSB7XG4gICAgICAgIHlpZWxkIFtrZXksIG9ialtrZXldXTtcbiAgICB9XG59O1xuXG4vLyBJdGVyYXRvciBmb3IgdmFsdWVzIG9mIGFuIG9iamVjdFxuVXRpbHMudmFsdWVzID0gZnVuY3Rpb24qIChvYmopIHtcbiAgICBmb3IgKHZhciBrZXkgb2YgT2JqZWN0LmtleXMob2JqKSkge1xuICAgICAgICB5aWVsZCBvYmpba2V5XTtcbiAgICB9XG59O1xuXG4vLyBSZWN1cnNpdmUgaXRlcmF0b3JzIGZvciBhbGwgcHJvcGVydGllcyBvZiBhbiBvYmplY3QsIG5vIG1hdHRlciBob3cgZGVlcGx5IG5lc3RlZFxuLy8gVE9ETzogZml4IGZvciBjaXJjdWxhciBzdHJ1Y3R1cmVzXG5VdGlscy5yZWN1cnNlRW50cmllcyA9IGZ1bmN0aW9uKiAob2JqKSB7XG4gICAgaWYgKCFvYmopIHtcbiAgICAgICAgcmV0dXJuO1xuICAgIH1cbiAgICBmb3IgKHZhciBrZXkgb2YgT2JqZWN0LmtleXMob2JqKSkge1xuICAgICAgICBpZiAob2JqW2tleV0pIHtcbiAgICAgICAgICAgIHlpZWxkIFtrZXksIG9ialtrZXldLCBvYmpdO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBvYmpba2V5XSA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICB5aWVsZCogVXRpbHMucmVjdXJzZUVudHJpZXMob2JqW2tleV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufTtcblxuVXRpbHMucmVjdXJzZVZhbHVlcyA9IGZ1bmN0aW9uKiAob2JqKSB7XG4gICAgaWYgKCFvYmopIHtcbiAgICAgICAgcmV0dXJuO1xuICAgIH1cbiAgICBmb3IgKHZhciBrZXkgb2YgT2JqZWN0LmtleXMob2JqKSkge1xuICAgICAgICBpZiAob2JqW2tleV0pIHtcbiAgICAgICAgICAgIHlpZWxkIG9ialtrZXldO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBvYmpba2V5XSA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICB5aWVsZCogVXRpbHMucmVjdXJzZVZhb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29ya2VyLCB3b3JrZXJfaWQrKyk7XG5cbiAgICAgICAgd29ya2VyLmFkZEV2ZW50TGlzdGVuZXIoJ21lc3NhZ2UnLCBmdW5jdGlvbiBXb3JrZXJCcm9rZXJNYWluVGhyZWFkSGFuZGxlcihldmVudCkge1xuICAgICAgICAgICAgbGV0IGRhdGEgPSBtYXliZURlY29kZShldmVudC5kYXRhKTtcbiAgICAgICAgICAgIGxldCBpZCA9IGRhdGEubWVzc2FnZV9pZDtcblxuICAgICAgICAgICAgLy8gTGlzdGVuIGZvciBtZXNzYWdlcyBjb21pbmcgYmFjayBmcm9tIHRoZSB3b3JrZXIsIGFuZCBmdWxmaWxsIHRoYXQgbWVzc2FnZSdzIHByb21pc2VcbiAgICAgICAgICAgIGlmIChkYXRhLnR5cGUgPT09ICd3b3JrZXJfcmVwbHknKSB7XG4gICAgICAgICAgICAgICAgLy8gUGFzcyB0aGUgcmVzdWx0IHRvIHRoZSBwcm9taXNlXG4gICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2VzW2lkXSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoZGF0YS5lcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZXNbaWRdLnJlamVjdChkYXRhLmVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2VzW2lkXS5yZXNvbHZlKGRhdGEubWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIG1lc3NhZ2VzW2lkXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBMaXN0ZW4gZm9yIG1lc3NhZ2VzIGluaXRpYXRpbmcgYSBjYWxsIGZyb20gdGhlIHdvcmtlciwgZGlzcGF0Y2ggdGhlbSxcbiAgICAgICAgICAgIC8vIGFuZC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WV0aG9kIHdpdGggdGhhdCBuYW1lYCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdmFyIHJlc3VsdCwgZXJyb3I7XG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gbWV0aG9kLmFwcGx5KHRhcmdldCwgZGF0YS5tZXNzYWdlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY2F0Y2goZSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBUaHJvd24gZXJyb3JzIHdpbGwgYmUgcGFzc2VkIGJhY2sgKGluIHN0cmluZyBmb3JtKSB0byB3b3JrZXJcbiAgICAgICAgICAgICAgICAgICAgZXJyb3IgPSBlO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIFNlbmQgcmV0dXJuIHZhbHVlIHRvIHdvcmtlclxuICAgICAgICAgICAgICAgIGxldCBwYXlsb2FkLCB0cmFuc2ZlcmFibGVzID0gW107XG5cbiAgICAgICAgICAgICAgICAvLyBBc3luYyByZXN1bHRcbiAgICAgICAgICAgICAgICBpZiAocmVzdWx0IGluc3RhbmNlb2YgUHJvbWlzZSkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQudGhlbigodmFsdWUpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSBpbnN0YW5jZW9mIFdvcmtlckJyb2tlci53aXRoVHJhbnNmZXJhYmxlcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zZmVyYWJsZXMgPSB2YWx1ZS50cmFuc2ZlcmFibGVzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gdmFsdWUudmFsdWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHBheWxvYWQgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ21haW5fcmVwbHknLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2VfaWQ6IGlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6IHZhbHVlXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgcGF5bG9hZCA9IG1heWJlRW5jb2RlKHBheWxvYWQsIHRyYW5zZmVyYWJsZXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHBheWxvYWQsIHRyYW5zZmVyYWJsZXMubWFwKHQgPT4gdC5vYmplY3QpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZyZWVUcmFuc2ZlcmFibGVzKHRyYW5zZmVyYWJsZXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRyYW5zZmVyYWJsZXMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZygndHJhY2UnLCBgJyR7bWV0aG9kX25hbWV9JyB0cmFuc2ZlcnJlZCAke3RyYW5zZmVyYWJsZXMubGVuZ3RofSBvYmplY3RzIHRvIHdvcmtlciB0aHJlYWRgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICB9LCAoZXJyb3IpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ21haW5fcmVwbHknLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2VfaWQ6IGlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yOiAoZXJyb3IgaW5zdGFuY2VvZiBFcnJvciA/IGAke2Vycm9yLm1lc3NhZ2V9OiAke2Vycm9yLnN0YWNrfWAgOiBlcnJvcilcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gSW1tZWRpYXRlIHJlc3VsdFxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0IGluc3RhbmNlb2YgV29ya2VyQnJva2VyLndpdGhUcmFuc2ZlcmFibGVzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2ZlcmFibGVzID0gcmVzdWx0LnRyYW5zZmVyYWJsZXM7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSByZXN1bHQudmFsdWU7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBwYXlsb2FkID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ21haW5fcmVwbHknLFxuICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZV9pZDogaWQsXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOiByZXN1bHQsXG4gICAgICAgICAgICAgICAgICAgICAgICBlcnJvcjogKGVycm9yIGluc3RhbmNlb2YgRXJyb3IgPyBgJHtlcnJvci5tZXNzYWdlfTogJHtlcnJvci5zdGFja31gIDogZXJyb3IpXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIHBheWxvYWQgPSBtYXliZUVuY29kZShwYXlsb2FkLCB0cmFuc2ZlcmFibGVzKTtcbiAgICAgICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHBheWxvYWQsIHRyYW5zZmVyYWJsZXMubWFwKHQgPT4gdC5vYmplY3QpKTtcbiAgICAgICAgICAgICAgICAgICAgZnJlZVRyYW5zZmVyYWJsZXModHJhbnNmZXJhYmxlcyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0cmFuc2ZlcmFibGVzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvZygndHJhY2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sIGVycm9yO1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICByZXN1bHQgPSBtZXRob2QuYXBwbHkodGFyZ2V0LCBkYXRhLm1lc3NhZ2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2F0Y2goZSkge1xuICAgICAgICAgICAgICAgIC8vIFRocm93biBlcnJvcnMgd2lsbCBiZSBwYXNzZWQgYmFjayAoaW4gc3RyaW5nIGZvcm0pIHRvIG1haW4gdGhyZWFkXG4gICAgICAgICAgICAgICAgZXJyb3IgPSBlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBTZW5kIHJldHVybiB2YWx1ZSB0byBtYWluIHRocmVhZFxuICAgICAgICAgICAgbGV0IHBheWxvYWQsIHRyYW5zZmVyYWJsZXMgPSBbXTtcblxuICAgICAgICAgICAgLy8gQXN5bmMgcmVzdWx0XG4gICAgICAgICAgICBpZiAocmVzdWx0IGluc3RhbmNlb2YgUHJvbWlzZSkge1xuICAgICAgICAgICAgICAgIHJlc3VsdC50aGVuKCh2YWx1ZSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgaW5zdGFuY2VvZiBXb3JrZXJCcm9rZXIud2l0aFRyYW5zZmVyYWJsZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zZmVyYWJsZXMgPSB2YWx1ZS50cmFuc2ZlcmFibGVzO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSB2YWx1ZS52YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIHBheWxvYWQgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAnd29ya2VyX3JlcGx5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2VfaWQ6IGlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogdmFsdWVcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgcGF5bG9hZCA9IG1heWJlRW5jb2RlKHBheWxvYWQsIHRyYW5zZmVyYWJsZXMpO1xuICAgICAgICAgICAgICAgICAgICBzZWxmLnBvc3RNZXNzYWdlKHBheWxvYWQsIHRyYW5zZmVyYWJsZXMubWFwKHQgPT4gdC5vYmplY3QpKTtcbiAgICAgICAgICAgICAgICAgICAgZnJlZVRyYW5zZmVyYWJsZXModHJhbnNmZXJhYmxlcyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0cmFuc2ZlcmFibGVzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvZygndHJhY2UnLCBgJyR7bWV0aG9kX25hbWV9JyB0cmFuc2ZlcnJlZCAke3RyYW5zZmVyYWJsZXMubGVuZ3RofSBvYmplY3RzIHRvIG1haW4gdGhyZWFkYCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LCAoZXJyb3IpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAnd29ya2VyX3JlcGx5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2VfaWQ6IGlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3I6IChlcnJvciBpbnN0YW5jZW9mIEVycm9yID8gYCR7ZXJyb3IubWVzc2FnZX06ICR7ZXJyb3Iuc3RhY2t9YCA6IGVycm9yKVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIEltbWVkaWF0ZSByZXN1bHRcbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChyZXN1bHQgaW5zdGFuY2VvZiBXb3JrZXJCcm9rZXIud2l0aFRyYW5zZmVyYWJsZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgdHJhbnNmZXJhYmxlcyA9IHJlc3VsdC50cmFuc2ZlcmFibGVzO1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSByZXN1bHQudmFsdWU7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcGF5bG9hZCA9IHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogJ3dvcmtlcl9yZXBseScsXG4gICAgICAgICAgICAgICAgICAgIG1lc3NhZ2VfaWQ6IGlkLFxuICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOiByZXN1bHQsXG4gICAgICAgICAgICAgICAgICAgIGVycm9yOiAoZXJyb3IgaW5zdGFuY2VvZiBFcnJvciA/IGAke2Vycm9yLm1lc3NhZ2V9OiAke2Vycm9yLnN0YWNrfWAgOiBlcnJvcilcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHBheWxvYWQgPSBtYXliZUVuY29kZShwYXlsb2FkLCB0cmFuc2ZlcmFibGVzKTtcbiAgICAgICAgICAgICAgICBzZWxmLnBvc3RNZXNzYWdlKHBheWxvYWQsIHRyYW5zZmVyYWJsZXMubWFwKHQgPT4gdC5vYmplY3QpKTtcbiAgICAgICAgICAgICAgICBmcmVlVHJhbnNmZXJhYmxlcyh0cmFuc2ZlcmFibGVzKTtcbiAgICAgICAgICAgICAgICBpZiAodHJhbnNmZXJhYmxlcy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGxvZygndHJhY2UnLCBgJyR7bWV0aG9kX25hbWV9JyB0cmFuc2ZlcnJlZCAke3RyYW5zZmVyYWJsZXMubGVuZ3RofSBvYmplY3RzIHRvIG1haW4gdGhyZWFkYCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSk7XG5cbn1cblxuLy8gU3BlY2lhbCB2YWx1ZSB3cmFwcGVyLCB0byBpbmRpY2F0ZSB0aGF0IHdlIHdhbnQgdG8gZmluZ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YgdHlwZW9mIGxhdCA9PT0gJ251bWJlcicpIHtcbiAgICAgICAgICAgIGlmICghdGhpcy5jZW50ZXIgfHwgbG5nICE9PSB0aGlzLmNlbnRlci5sbmcgfHwgbGF0ICE9PSB0aGlzLmNlbnRlci5sYXQpIHtcbiAgICAgICAgICAgICAgICBjaGFuZ2VkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB0aGlzLmNlbnRlciA9IHsgbG5nOiBHZW8ud3JhcExuZyhsbmcpLCBsYXQgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFNldCB6b29tXG4gICAgICAgIGlmICh0eXBlb2Ygem9vbSA9PT0gJ251bWJlcicgJiYgem9vbSAhPT0gdGhpcy56b29tKSB7XG4gICAgICAgICAgICBjaGFuZ2VkID0gdHJ1ZTtcbiAgICAgICAgICAgIHRoaXMuc2V0Wm9vbSh6b29tKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjaGFuZ2VkKSB7XG4gICAgICAgICAgICB0aGlzLnVwZGF0ZUJvdW5kcygpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBjaGFuZ2VkO1xuICAgIH1cblxuICAgIHNldFpvb20gKHpvb20pIHtcbiAgICAgICAgaWYgKHRoaXMuem9vbWluZykge1xuICAgICAgICAgICAgdGhpcy56b29taW5nID0gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmxhc3Rfem9vbSA9IHRoaXMuem9vbTtcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCBsYXN0X3RpbGVfem9vbSA9IHRoaXMudGlsZV96b29tO1xuICAgICAgICBsZXQgdGlsZV96b29tID0gdGhpcy50aWxlWm9vbSh6b29tKTtcbiAgICAgICAgaWYgKCF0aGlzLmNvbnRpbnVvdXNfem9vbSkge1xuICAgICAgICAgICAgem9vbSA9IHRpbGVfem9vbTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh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MudGlsZV9zaW1wbGlmaWNhdGlvbl9sZXZlbDtcbiAgICB9XG5cbiAgICByZWFkeSAoKSB7XG4gICAgICAgIC8vIFRPRE86IGJldHRlciBjb25jZXB0IG9mIFwicmVhZGluZXNzXCIgc3RhdGU/XG4gICAgICAgIGlmICh0eXBlb2YgdGhpcy5zaXplLmNzcy53aWR0aCAhPT0gJ251bWJlcicgfHxcbiAgICAgICAgICAgIHR5cGVvZiB0aGlzLnNpemUuY3NzLmhlaWdodCAhPT0gJ251bWJlcicgfHxcbiAgICAgICAgICAgIHRoaXMuY2VudGVyID09IG51bGwgfHxcbiAgICAgICAgICAgIHR5cGVvZiB0aGlzLnpvb20gIT09ICdudW1iZXInKSB7XG4gICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIC8vIENhbGN1bGF0ZSB2aWV3cG9ydCBib3VuZHMgYmFzZWQgb24gY3VycmVudCBjZW50ZXIgYW5kIHpvb21cbiAgICB1cGRhdGVCb3VuZHMgKCkge1xuICAgICAgICBpZiAoIXRoaXMucmVhZHkoKSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5tZXRlcnNfcGVyX3BpeGVsID0gR2VvLm1ldGVyc1BlclBpeGVsKHRoaXMuem9vbSk7XG5cbiAgICAgICAgLy8gU2l6ZSBvZiB0aGUgaGFsZi12aWV3cG9ydCBpbiBtZXRlcnMgYXQgY3VycmVudCB6b29tXG4gICAgICAgIHRoaXMuc2l6ZS5tZXRlcnMgPSB7XG4gICAgICAgICAgICB4OiB0aGlzLnNpemUuY3NzLndpZHRoICogdGhpcy5tZXRlcnNfcGVyX3BpeGVsLFxuICAgICAgICAgICAgeTogdGhpcy5zaXplLmNzcy5oZWlnaHQgKiB0aGlzLm1ldGVyc19wZXJfcGl4ZWxcbiAgICAgICAgfTtcblxuICAgICAgICAvLyBDZW50ZXIgb2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FyIGNvZGUgPSBbJ2Z1bmN0aW9uICcsIGZ1bmNOYW1lLCAnKCcsIEFSR1Muam9pbigpLCAnKXsnLFxuICAgICd2YXIgJywgRUxFTV9TSVpFLCAnPTIqJywgRElNRU5TSU9OLCAnOyddXG5cbiAgdmFyIHJlZExvb3AgPSBcbiAgICAnZm9yKHZhciBpPScgKyBSRURfU1RBUlQgKyAnLCcgKyBSRURfUFRSICsgJz0nICsgRUxFTV9TSVpFICsgJyonICsgUkVEX1NUQVJUICsgJzsnICtcbiAgICAgICAgJ2k8JyArIFJFRF9FTkQgKyc7JyArXG4gICAgICAgICcrK2ksJyArIFJFRF9QVFIgKyAnKz0nICsgRUxFTV9TSVpFICsgJyl7JyArXG4gICAgICAgICd2YXIgeDA9JyArIFJFRF9CT1hFUyArICdbJyArIEFYSVMgKyAnKycgKyBSRURfUFRSICsgJ10sJyArXG4gICAgICAgICAgICAneDE9JyArIFJFRF9CT1hFUyArICdbJyArIEFYSVMgKyAnKycgKyBSRURfUFRSICsgJysnICsgRElNRU5TSU9OICsgJ10sJyArXG4gICAgICAgICAgICAneGk9JyArIFJFRF9JTkRFWCArICdbaV07J1xuXG4gIHZhciBibHVlTG9vcCA9IFxuICAgICdmb3IodmFyIGo9JyArIEJMVUVfU1RBUlQgKyAnLCcgKyBCTFVFX1BUUiArICc9JyArIEVMRU1fU0laRSArICcqJyArIEJMVUVfU1RBUlQgKyAnOycgK1xuICAgICAgICAnajwnICsgQkxVRV9FTkQgKyAnOycgK1xuICAgICAgICAnKytqLCcgKyBCTFVFX1BUUiArICcrPScgKyBFTEVNX1NJWkUgKyAnKXsnICtcbiAgICAgICAgJ3ZhciB5MD0nICsgQkxVRV9CT1hFUyArICdbJyArIEFYSVMgKyAnKycgKyBCTFVFX1BUUiArICddLCcgK1xuICAgICAgICAgICAgKGZ1bGwgPyAneTE9JyArIEJMVUVfQk9YRVMgKyAnWycgKyBBWElTICsgJysnICsgQkxVRV9QVFIgKyAnKycgKyBESU1FTlNJT04gKyAnXSwnIDogJycpICtcbiAgICAgICAgICAgICd5aT0nICsgQkxVRV9JTkRFWCArICdbal07J1xuXG4gIGlmKHJlZE1ham9yKSB7XG4gICAgY29kZS5wdXNoKHJlZExvb3AsIElOTkVSX0xBQkVMLCAnOicsIGJsdWVMb29wKVxuICB9IGVsc2Uge1xuICAgIGNvZGUucHVzaChibHVlTG9vcCwgSU5ORVJfTEFCRUwsICc6JywgcmVkTG9vcClcbiAgfVxuXG4gIGlmKGZ1bGwpIHtcbiAgICBjb2RlLnB1c2goJ2lmKHkxPHgwfHx4MTx5MCljb250aW51ZTsnKVxuICB9IGVsc2UgaWYoZmxpcCkge1xuICAgIGNvZGUucHVzaCgnaWYoeTA8PXgwfHx4MTx5MCljb250aW51ZTsnKVxuICB9IGVsc2Uge1xuICAgIGNvZGUucHVzaCgnaWYoeTA8eDB8fHgxPHkwKWNvbnRpbnVlOycpXG4gIH1cblxuICBjb2RlLnB1c2goJ2Zvcih2YXIgaz0nK0FYSVMrJysxO2s8JytESU1FTlNJT04rJzsrK2speycrXG4gICAgJ3ZhciByMD0nK1JFRF9CT1hFUysnW2srJytSRURfUFRSKyddLCcrXG4gICAgICAgICdyMT0nK1JFRF9CT1hFUysnW2srJytESU1FTlNJT04rJysnK1JFRF9QVFIrJ10sJytcbiAgICAgICAgJ2IwPScrQkxVRV9CT1hFUysnW2srJytCTFVFX1BUUisnXSwnK1xuICAgICAgICAnYjE9JytCTFVFX0JPWEVTKydbaysnK0RJTUVOU0lPTisnKycrQkxVRV9QVFIrJ107JytcbiAgICAgICdpZihyMTxiMHx8YjE8cjApY29udGludWUgJyArIElOTkVSX0xBQkVMICsgJzt9JyArXG4gICAgICAndmFyICcgKyBSRVRWQUwgKyAnPScgKyBWSVNJVCArICcoJylcblxuICBpZihmbGlwKSB7XG4gICAgY29kZS5wdXNoKCd5aSx4aScpXG4gIH0gZWxzZSB7XG4gICAgY29kZS5wdXNoKCd4aSx5aScpXG4gIH1cblxuICBjb2RlLnB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IHJlZCwgcmVkSW5kZXgpXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgcmV0dmFsID0gc3dlZXAuc3dlZXBCaXBhcnRpdGUoXG4gICAgICAgICAgICBkLCB2aXNpdCxcbiAgICAgICAgICAgIHJlZFN0YXJ0LCByZWQwLCByZWQsIHJlZEluZGV4LFxuICAgICAgICAgICAgYmx1ZVN0YXJ0LCBibHVlRW5kLCBibHVlLCBibHVlSW5kZXgpXG4gICAgICAgIH1cbiAgICAgICAgaWYocmV0dmFsICE9PSB2b2lkIDApIHtcbiAgICAgICAgICByZXR1cm4gcmV0dmFsXG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGl0ZXJQdXNoKHRvcCsrLFxuICAgICAgICAgIGF4aXMrMSxcbiAgICAgICAgICByZWRTdGFydCwgcmVkMCxcbiAgICAgICAgICBibHVlU3RhcnQsIGJsdWVFbmQsXG4gICAgICAgICAgZmxpcCxcbiAgICAgICAgICAtSW5maW5pdHksIEluZmluaXR5KVxuICAgICAgICBpdGVyUHVzaCh0b3ArKyxcbiAgICAgICAgICBheGlzKzEsXG4gICAgICAgICAgYmx1ZVN0YXJ0LCBibHVlRW5kLFxuICAgICAgICAgIHJlZFN0YXJ0LCByZWQwLFxuICAgICAgICAgIGZsaXBeMSxcbiAgICAgICAgICAtSW5maW5pdHksIEluZmluaXR5KVxuICAgICAgfVxuICAgIH1cblxuICAgIC8vRGl2aWRlIGFuZCBjb25xdWVyIHBoYXNlXG4gICAgaWYocmVkMCA8IHJlZEVuZCkge1xuXG4gICAgICAvL0N1dCBibHVlIGludG8gMyBwYXJ0czpcbiAgICAgIC8vXG4gICAgICAvLyAgUG9pbnRzIDwgbWlkIHBvaW50XG4gICAgICAvLyAgUG9pbnRzID0gbWlkIHBvaW50XG4gICAgICAvLyAgUG9pbnRzID4gbWlkIHBvaW50XG4gICAgICAvL1xuICAgICAgdmFyIGJsdWUwID0gZmluZE1lZGlhbihcbiAgICAgICAgZC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9pbnRGdWxsKFxuICAgICAgICAgICAgZCwgYXhpcywgdmlzaXQsXG4gICAgICAgICAgICByZWQwLCByZWRFbmQsIHJlZCwgcmVkSW5kZXgsXG4gICAgICAgICAgICBibHVlMCwgYmx1ZSwgYmx1ZUluZGV4W2JsdWUwXSlcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICByZXR2YWwgPSBvbmVQb2ludFBhcnRpYWwoXG4gICAgICAgICAgICBkLCBheGlzLCB2aXNpdCwgZmxpcCxcbiAgICAgICAgICAgIHJlZDAsIHJlZEVuZCwgcmVkLCByZWRJbmRleCxcbiAgICAgICAgICAgIGJsdWUwLCBibHVlLCBibHVlSW5kZXhbYmx1ZTBdKVxuICAgICAgICB9XG4gICAgICAgIGlmKHJldHZhbCAhPT0gdm9pZCAwKSB7XG4gICAgICAgICAgcmV0dXJuIHJldHZhbFxuICAgICAgICB9XG4gICAgICB9IGVsc2UgaWYoYmx1ZTAgPCBibHVlMSkge1xuICAgICAgICB2YXIgcmVkMVxuICAgICAgICBpZihmdWxsKSB7XG4gICAgICAgICAgLy9JZiBmdWxsIGludGVyc2VjdGlvbiwgbmVlZCB0byBoYW5kbGUgc3BlY2lhbCBjYXNlXG4gICAgICAgICAgcmVkMSA9IHBhcnRpdGlvbkNvbnRhaW5zUG9pbnQoXG4gICAgICAgICAgICBkLCBheGlzLFxuICAgICAgICAgICAgcmVkMCwgcmVkRW5kLCByZWQsIHJlZEluZGV4LFxuICAgICAgICAgICAgbWlkKVxuICAgICAgICAgIGlmKHJlZDAgPCByZWQxKSB7XG4gICAgICAgICAgICB2YXIgcmVkWCA9IHBhcnRpdGlvblN0YXJ0RXF1YWwoXG4gICAgICAgICAgICAgIGQsIGF4aXMsXG4gICAgICAgICAgICAgIHJlZDAsIHJlZDEsIHJlZCwgcmVkSW5kZXgsXG4gICAgICAgICAgICAgIG1pZClcbiAgICAgICAgICAgIGlmKGF4aXMgPT09IGQtMikge1xuICAgICAgICAgICAgICAvL0RlZ2VuZXJhdGUgc3dlZXAgaW50ZXJzZWN0aW9uOlxuICAgICAgICAgICAgICAvLyAgW3JlZDAsIHJlZFhdIHdpdGggW2JsdWUwLCBibHVlMV1cbiAgICAgICAgICAgICAgaWYocmVkMCA8IHJlZFgpIHtcbiAgICAgICAgICAgICAgICByZXR2YWwgPSBzd2VlcC5zd2VlcENvbXBsZXRlKFxuICAgICAgICAgICAgICAgICAgZCwgdmlzaXQsXG4gICAgICAgICAgICAgICAgICByZWQwLCByZWRYLCByZWQsIHJlZEluZGV4LFxuICAgICAgICAgICAgICAgICAgYmx1ZTAsIGJsdWUxLCBibHVlLCBibHVlSW5kZXgpXG4gICAgICAgICAgICAgICAgaWYocmV0dmFsICE9PSB2b2lkIDApIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiByZXR2YWxcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAvL05vcm1hbCBzd2VlcCBpbnRlcnNlY3Rpb246XG4gICAgICAgICAgICAgIC8vICBbcmVkWCwgcmVkMV0gd2l0aCBbYmx1ZTAsIGJsdWUxXVxuICAgICAgICAgICAgICBpZihyZWRYIDwgcmVkMSkge1xuICAgICAgICAgICAgICAgIHJldHZhbCA9IHN3ZWVwLnN3ZWVwQmlwYXJ0aXRlKFxuICAgICAgICAgICAgICAgICAgZCwgdmlzaXQsXG4gICAgICAgICAgICAgICAgICByZWRYLCByZWQxLCByZWQsIHJlZEluZGV4LFxuICAgICAgICAgICAgICAgICAgYmx1ZTAsIGJsdWUxLCBibHVlLCBibHVlSW5kZXgpXG4gICAgICAgICAgICAgICAgaWYocmV0dmFsICE9PSB2b2lkIDApIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiByZXR2YWxcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGlmKHJlZDAgPCByZWRYKSB7XG4gICAgICAgICAgICAgICAgaXRlclB1c2godG9wKyssXG4gICAgICAgICAgICAgICAgICBheGlzKzEsXG4gICAgICAgICAgICAgICAgICByZWQwLCByZWRYLFxuICAgICAgICAgICAgICAgICAgYmx1ZTAsIGJsdWUxLFxuICAgICAgICAgICAgICAgICAgMTYsXG4gICAgICAgICAgICAgICAgICAtSW5maW5pdHksIEluZmluaXR5KVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmKHJlZFggPCByZWQxKSB7XG4gICAgICAgICAgICAgICAgaXRlclB1c2godG9wKyssXG4gICAgICAgICAgICAgICAgICBheGlzKzEsXG4gICAgICAgICAgICAgICAgICByZWRYLCByZWQxLFxuICAgICAgICAgICAgICAgICAgYmx1ZTAsIGJsdWUxLFxuICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgIC1JbmZpbml0eSwgSW5maW5pdHkpXG4gICAgICAgICAgICAgICAgaXRlclB1c2godG9wKyssXG4gICAgICAgICAgICAgICAgICBheGlzKzEsXG4gICAgICAgICAgICAgICAgICBibHVlMCwgYmx1ZTEsXG4gICAgICAgICAgICAgICAgICByZWRYLCByZWQxLFxuICAgICAgICAgICAgICAgICAgMSxcbiAgICAgICAgICAgICAgICAgIC1JbmZpbml0eSwgSW5maW5pdHkpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYoZmxpcCkge1xuICAgICAgICAgICAgcmVkMSA9IHBhcnRpdGlvbkNvbnRhaW5zUG9pbnRQcm9wZXIoXG4gICAgICAgICAgICAgIGQsIGF4aXMsXG4gICAgICAgICAgICAgIHJlZDAsIHJlZEVuZCwgcmVkLCByZWRJbmRleCxcbiAgICAgICAgICAgICAgbWlkKVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZWQxID0gcGFydGl0aW9uQ29udGFpbnNQb2ludChcbiAgICAgICAgICAgICAgZCwgYXhpcyxcbiAgICAgICAgICAgICAgcmVkMCwgcmVkRW5kLCByZWQsIHJlZEluZGV4LFxuICAgICAgICAgICAgICBtaWQpXG4gICAgICAgICAgfVxuICAgICAgICAgIGlmKHJlZDAgPCByZWQxKSB7XG4gICAgICAgICAgICBpZihheGlzID09PSBkLTIpIHtcbiAgICAgICAgICAgICAgaWYoZmxpcCkge1xuICAgICAgICAgICAgICAgIHJldHZhbCA9IHN3ZWVwLnN3ZWVwQmlwYXJ0aXRlKFxuICAgICAgICAgICAgICAgICAgZCwgdmlzaXQsXG4gICAgICAgICAgICAgICAgICBibHVlMCwgYmx1ZTEsIGJsdWUsIGJsdWVJbmRleCxcbiAgICAgICAgICAgICAgICAgIHJlZDAsIHJlZDEsIHJlZCwgcmVkSW5kZXgpXG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dmFsID0gc3dlZXAuc3dlZXBCaXBhcnRpdGUoXG4gICAgICAgICAgICAgICAgICBkLCB2aXNpdCxcbiAgICAgICAgICAgICAgICAgIHJlZDAsIHJlZDEsIHJlZCwgcmVkSW5kZXgsXG4gICAgICAgICAgICAgICAgICBibHVlMCwgYmx1ZTEsIGJsdWUsIGJsdWVJbmRleClcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgaXRlclB1c2godG9wKyssXG4gICAgICAgICAgICAgICAgYXhpcysxLFxuICAgICAgICAgICAgICAgIHJlZDAsIHJlZDEsXG4gICAgICAgICAgICAgICAgYmx1ZTAsIGJsdWUxLFxuICAgICAgICAgICAgICAgIGZsaXAsXG4gICAgICAgICAgICAgICAgLUluZmluaXR5LCBJbmZpbml0eSlcbiAgICAgICAgICAgICAgaXRlclB1c2godG9wKyssXG4gICAgICAgICAgICAgICAgYXhpcysxLFxuICAgICAgICAgICAgICAgIGJsdWUwLCBibHVlMSxcbiAgICAgICAgICAgICAgICByZWQwLCByZWQxLFxuICAgICAgICAgICAgICAgIGZsaXBeMSxcbi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bW9uXG4gICAgICBmb3IodmFyIGo9MDsgajxjb21tb25BY3RpdmU7ICsraikge1xuICAgICAgICB2YXIgcmV0dmFsID0gdmlzaXQoQ09NTU9OX1NXRUVQX1FVRVVFW2pdLCBpZClcbiAgICAgICAgaWYocmV0dmFsICE9PSB2b2lkIDApIHtcbiAgICAgICAgICByZXR1cm4gcmV0dmFsXG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYoY29sb3IgIT09IDApIHtcbiAgICAgICAgLy9JbnRlcnNlY3Qgd2l0aCByZWRcbiAgICAgICAgZm9yKHZhciBqPTA7IGo8cmVkQWN0aXZlOyArK2opIHtcbiAgICAgICAgICB2YXIgcmV0dmFsID0gdmlzaXQoUkVEX1NXRUVQX1FVRVVFW2pdLCBpZClcbiAgICAgICAgICBpZihyZXR2YWwgIT09IHZvaWQgMCkge1xuICAgICAgICAgICAgcmV0dXJuIHJldHZhbFxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZihjb2xvciAhPT0gMSkge1xuICAgICAgICAvL0ludGVyc2VjdCB3aXRoIGJsdWVcbiAgICAgICAgZm9yKHZhciBqPTA7IGo8Ymx1ZUFjdGl2ZTsgKytqKSB7XG4gICAgICAgICAgdmFyIHJldHZhbCA9IHZpc2l0KEJMVUVfU1dFRVBfUVVFVUVbal0sIGlkKVxuICAgICAgICAgIGlmKHJldHZhbCAhPT0gdm9pZCAwKSB7XG4gICAgICAgICAgICByZXR1cm4gcmV0dmFsXG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmKGNvbG9yID09PSAwKSB7XG4gICAgICAgIC8vUmVkXG4gICAgICAgIHNxUHVzaChSRURfU1dFRVBfUVVFVUUsIFJFRF9TV0VFUF9JTkRFWCwgcmVkQWN0aXZlKyssIGlkKVxuICAgICAgfSBlbHNlIGlmKGNvbG9yID09PSAxKSB7XG4gICAgICAgIC8vQmx1ZVxuICAgICAgICBzcVB1c2goQ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gYmx1ZUluZGV4W2lkeF1cbiAgICAgICAgdmFyIGJsdWVQdHIgPSBlbGVtU2l6ZSAqIGlkeFxuXG4gICAgICAgIHZhciBiMCA9IGJsdWVbYmx1ZVB0citheGlzKzFdXG4gICAgICAgIHZhciBiMSA9IGJsdWVbYmx1ZVB0citheGlzKzErZF1cblxucmVkX2xvb3A6XG4gICAgICAgIGZvcih2YXIgaj0wOyBqPHJlZEFjdGl2ZTsgKytqKSB7XG4gICAgICAgICAgdmFyIG9pZHggICA9IFJFRF9TV0VFUF9RVUVVRVtqXVxuICAgICAgICAgIHZhciByZWRJZCAgPSByZWRJbmRleFtvaWR4XVxuXG4gICAgICAgICAgaWYocmVkSWQgPT09IGJsdWVJZCkge1xuICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICB2YXIgcmVkUHRyID0gZWxlbVNpemUgKiBvaWR4XG4gICAgICAgICAgaWYoYjEgPCByZWRbcmVkUHRyK2F4aXMrMV0gfHwgXG4gICAgICAgICAgICByZWRbcmVkUHRyK2F4aXMrMStkXSA8IGIwKSB7XG4gICAgICAgICAgICBjb250aW51ZVxuICAgICAgICAgIH1cbiAgICAgICAgICBmb3IodmFyIGs9YXhpcysyOyBrPGQ7ICsraykge1xuICAgICAgICAgICAgaWYoYmx1ZVtibHVlUHRyICsgayArIGRdIDwgcmVkW3JlZFB0ciArIGtdIHx8IFxuICAgICAgICAgICAgICAgcmVkW3JlZFB0ciArIGsgKyBkXSAgIDwgYmx1ZVtibHVlUHRyICsga10pIHtcbiAgICAgICAgICAgICAgY29udGludWUgcmVkX2xvb3BcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICB2YXIgcmV0dmFsID0gdmlzaXQocmVkSWQsIGJsdWVJZClcbiAgICAgICAgICBpZihyZXR2YWwgIT09IHZvaWQgMCkge1xuICAgICAgICAgICAgcmV0dXJuIHJldHZhbCBcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgIC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ICAgICAgICBpZihJU19NQVApcmVzdWx0W2luZGV4XSA9IHJlczsgICAgICAgICAgICAvLyBtYXBcbiAgICAgICAgZWxzZSBpZihyZXMpc3dpdGNoKFRZUEUpe1xuICAgICAgICAgIGNhc2UgMzogcmV0dXJuIHRydWU7ICAgICAgICAgICAgICAgICAgICAvLyBzb21lXG4gICAgICAgICAgY2FzZSA1OiByZXR1cm4gdmFsOyAgICAgICAgICAgICAgICAgICAgIC8vIGZpbmRcbiAgICAgICAgICBjYXNlIDY6IHJldHVybiBpbmRleDsgICAgICAgICAgICAgICAgICAgLy8gZmluZEluZGV4XG4gICAgICAgICAgY2FzZSAyOiByZXN1bHQucHVzaCh2YWwpOyAgICAgICAgICAgICAgIC8vIGZpbHRlclxuICAgICAgICB9IGVsc2UgaWYoSVNfRVZFUlkpcmV0dXJuIGZhbHNlOyAgICAgICAgICAvLyBldmVyeVxuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gSVNfRklORF9JTkRFWCA/IC0xIDogSVNfU09NRSB8fCBJU19FVkVSWSA/IElTX0VWRVJZIDogcmVzdWx0O1xuICB9O1xufTsiLCJ2YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKVxuICAsIGlzQXJyYXkgID0gcmVxdWlyZSgnLi9faXMtYXJyYXknKVxuICAsIFNQRUNJRVMgID0gcmVxdWlyZSgnLi9fd2tzJykoJ3NwZWNpZXMnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbihvcmlnaW5hbCl7XG4gIHZhciBDO1xuICBpZihpc0FycmF5KG9yaWdpbmFsKSl7XG4gICAgQyA9IG9yaWdpbmFsLmNvbnN0cnVjdG9yO1xuICAgIC8vIGNyb3NzLXJlYWxtIGZhbGxiYWNrXG4gICAgaWYodHlwZW9mIEMgPT0gJ2Z1bmN0aW9uJyAmJiAoQyA9PT0gQXJyYXkgfHwgaXNBcnJheShDLnByb3RvdHlwZSkpKUMgPSB1bmRlZmluZWQ7XG4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FsdWUpXG4gICAgICBoYXM6IGZ1bmN0aW9uIGhhcyhrZXkpe1xuICAgICAgICByZXR1cm4gISFnZXRFbnRyeSh0aGlzLCBrZXkpO1xuICAgICAgfVxuICAgIH0pO1xuICAgIGlmKERFU0NSSVBUT1JTKWRQKEMucHJvdG90eXBlLCAnc2l6ZScsIHtcbiAgICAgIGdldDogZnVuY3Rpb24oKXtcbiAgICAgICAgcmV0dXJuIGRlZmluZWQodGhpc1tTSVpFXSk7XG4gICAgICB9XG4gICAgfSk7XG4gICAgcmV0dXJuIEM7XG4gIH0sXG4gIGRlZjogZnVuY3Rpb24odGhhdCwga2V5LCB2YWx1ZSl7XG4gICAgdmFyIGVudHJ5ID0gZ2V0RW50cnkodGhhdCwga2V5KVxuICAgICAgLCBwcmV2LCBpbmRleDtcbiAgICAvLyBjaGFuZ2UgZXhpc3RpbmcgZW50cnlcbiAgICBpZihlbnRyeSl7XG4gICAgICBlbnRyeS52ID0gdmFsdWU7XG4gICAgLy8gY3JlYXRlIG5ldyBlbnRyeVxuICAgIH0gZWxzZSB7XG4gICAgICB0aGF0Ll9sID0gZW50cnkgPSB7XG4gICAgICAgIGk6IGluZGV4ID0gZmFzdEtleShrZXksIHRydWUpLCAvLyA8LSBpbmRleFxuICAgICAgICBrOiBrZXksICAgICAgICAgICAgICAgICAgICAgICAgLy8gPC0ga2V5XG4gICAgICAgIHY6IHZhbHVlLCAgICAgICAgICAgICAgICAgICAgICAvLyA8LSB2YWx1ZVxuICAgICAgICBwOiBwcmV2ID0gdGhhdC5fbCwgICAgICAgICAgICAgLy8gPC0gcHJldmlvdXMgZW50cnlcbiAgICAgICAgbjogdW5kZWZpbmVkLCAgICAgICAgICAgICAgICAgIC8vIDwtIG5leHQgZW50cnlcbiAgICAgICAgcjogZmFsc2UgICAgICAgICAgICAgICAgICAgICAgIC8vIDwtIHJlbW92ZWRcbiAgICAgIH07XG4gICAgICBpZighdGhhdC5fZil0aGF0Ll9mID0gZW50cnk7XG4gICAgICBp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YocHJvbWlzZS5fbilyZXR1cm47XG4gIHByb21pc2UuX24gPSB0cnVlO1xuICB2YXIgY2hhaW4gPSBwcm9taXNlLl9jO1xuICBtaWNyb3Rhc2soZnVuY3Rpb24oKXtcbiAgICB2YXIgdmFsdWUgPSBwcm9taXNlLl92XG4gICAgICAsIG9rICAgID0gcHJvbWlzZS5fcyA9PSAxXG4gICAgICAsIGkgICAgID0gMDtcbiAgICB2YXIgcnVuID0gZnVuY3Rpb24ocmVhY3Rpb24pe1xuICAgICAgdmFyIGhhbmRsZXIgPSBvayA/IHJlYWN0aW9uLm9rIDogcmVhY3Rpb24uZmFpbFxuICAgICAgICAsIHJlc29sdmUgPSByZWFjdGlvbi5yZXNvbHZlXG4gICAgICAgICwgcmVqZWN0ICA9IHJlYWN0aW9uLnJlamVjdFxuICAgICAgICAsIGRvbWFpbiAgPSByZWFjdGlvbi5kb21haW5cbiAgICAgICAgLCByZXN1bHQsIHRoZW47XG4gICAgICB0cnkge1xuICAgICAgICBpZihoYW5kbGVyKXtcbiAgICAgICAgICBpZighb2spe1xuICAgICAgICAgICAgaWYocHJvbWlzZS5faCA9PSAyKW9uSGFuZGxlVW5oYW5kbGVkKHByb21pc2UpO1xuICAgICAgICAgICAgcHJvbWlzZS5faCA9IDE7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmKGhhbmRsZXIgPT09IHRydWUpcmVzdWx0ID0gdmFsdWU7XG4gICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBpZihkb21haW4pZG9tYWluLmVudGVyKCk7XG4gICAgICAgICAgICByZXN1bHQgPSBoYW5kbGVyKHZhbHVlKTtcbiAgICAgICAgICAgIGlmKGRvbWFpbilkb21haW4uZXhpdCgpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZihyZXN1bHQgPT09IHJlYWN0aW9uLnByb21pc2Upe1xuICAgICAgICAgICAgcmVqZWN0KFR5cGVFcnJvcignUHJvbWlzZS1jaGFpbiBjeWNsZScpKTtcbiAgICAgICA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vIHRyaWFuZ2xlIGJib3g7IG1pbiAmIG1heCBhcmUgY2FsY3VsYXRlZCBsaWtlIHRoaXMgZm9yIHNwZWVkXG4gICAgdmFyIG1pblRYID0gYS54IDwgYi54ID8gKGEueCA8IGMueCA/IGEueCA6IGMueCkgOiAoYi54IDwgYy54ID8gYi54IDogYy54KSxcbiAgICAgICAgbWluVFkgPSBhLnkgPCBiLnkgPyAoYS55IDwgYy55ID8gYS55IDogYy55KSA6IChiLnkgPCBjLnkgPyBiLnkgOiBjLnkpLFxuICAgICAgICBtYXhUWCA9IGEueCA+IGIueCA/IChhLnggPiBjLnggPyBhLnggOiBjLngpIDogKGIueCA+IGMueCA/IGIueCA6IGMueCksXG4gICAgICAgIG1heFRZID0gYS55ID4gYi55ID8gKGEueSA+IGMueSA/IGEueSA6IGMueSkgOiAoYi55ID4gYy55ID8gYi55IDogYy55KTtcblxuICAgIC8vIHotb3JkZXIgcmFuZ2UgZm9yIHRoZSBjdXJyZW50IHRyaWFuZ2xlIGJib3g7XG4gICAgdmFyIG1pblogPSB6T3JkZXIobWluVFgsIG1pblRZLCBtaW5YLCBtaW5ZLCBzaXplKSxcbiAgICAgICAgbWF4WiA9IHpPcmRlcihtYXhUWCwgbWF4VFksIG1pblgsIG1pblksIHNpemUpO1xuXG4gICAgLy8gZmlyc3QgbG9vayBmb3IgcG9pbnRzIGluc2lkZSB0aGUgdHJpYW5nbGUgaW4gaW5jcmVhc2luZyB6LW9yZGVyXG4gICAgdmFyIHAgPSBlYXIubmV4dFo7XG5cbiAgICB3aGlsZSAocCAmJiBwLnogPD0gbWF4Wikge1xuICAgICAgICBpZiAocCAhPT0gZWFyLnByZXYgJiYgcCAhPT0gZWFyLm5leHQgJiZcbiAgICAgICAgICAgIHBvaW50SW5UcmlhbmdsZShhLngsIGEueSwgYi54LCBiLnksIGMueCwgYy55LCBwLngsIHAueSkgJiZcbiAgICAgICAgICAgIGFyZWEocC5wcmV2LCBwLCBwLm5leHQpID49IDApIHJldHVybi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BtO1xuXG4gICAgLy8gZmluZCBhIHNlZ21lbnQgaW50ZXJzZWN0ZWQgYnkgYSByYXkgZnJvbSB0aGUgaG9sZSdzIGxlZnRtb3N0IHBvaW50IHRvIHRoZSBsZWZ0O1xuICAgIC8vIHNlZ21lbnQncyBlbmRwb2ludCB3aXRoIGxlc3NlciB4IHdpbGwgYmUgcG90ZW50aWFsIGNvbm5lY3Rpb24gcG9pbnRcbiAgICBkbyB7XG4gICAgICAgIGlmIChoeSA8PSBwLnkgJiYgaHkgPj0gcC5uZXh0LnkpIHtcbiAgICAgICAgICAgIHZhciB4ID0gcC54ICsgKGh5IC0gcC55KSAqIChwLm5leHQueCAtIHAueCkgLyAocC5uZXh0LnkgLSBwLnkpO1xuICAgICAgICAgICAgaWYgKHggPD0gaHggJiYgeCA+IHF4KSB7XG4gICAgICAgICAgICAgICAgcXggPSB4O1xuICAgICAgICAgICAgICAgIGlmICh4ID09PSBoeCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoaHkgPT09IHAueSkgcmV0dXJuIHA7XG4gICAgICAgICAgICAgICAgICAgIGlmIChoeSA9PT0gcC5uZXh0LnkpIHJldHVybiBwLm5leHQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG0gPSBwLnggPCBwLm5leHQueCA/IHAgOiBwLm5leHQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcCA9IHAubmV4dDtcbiAgICB9IHdoaWxlIChwICE9PSBvdXRlck5vZGUpO1xuXG4gICAgaWYgKCFtKSByZXR1cm4gbnVsbDtcblxuICAgIGlmIChoeCA9PT0gcXgpIHJldHVybiBtLnByZXY7IC8vIGhvbGUgdG91Y2hlcyBvdXRlciBzZWdtZW50OyBwaWNrIGxvd2VyIGVuZHBvaW50XG5cbiAgICAvLyBsb29rIGZvciBwb2ludHMgaW5zaWRlIHRoZSB0cmlhbmdsZSBvZiBob2xlIHBvaW50LCBzZWdtZW50IGludGVyc2VjdGlvbiBh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uICAgIHZhciBwID0gc3RhcnQ7XG4gICAgZG8ge1xuICAgICAgICBpZiAocC56ID09PSBudWxsKSBwLnogPSB6T3JkZXIocC54LCBwLnksIG1pblgsIG1pblksIHNpemUpO1xuICAgICAgICBwLnByZXZaID0gcC5wcmV2O1xuICAgICAgICBwLm5leHRaID0gcC5uZXh0O1xuICAgICAgICBwID0gcC5uZXh0O1xuICAgIH0gd2hpbGUgKHAgIT09IHN0YXJ0KTtcblxuICAgIHAucHJldloubmV4dFogPSBudWxsO1xuICAgIHAucHJldlogPSBudWxsO1xuXG4gICAgc29ydExpbmtlZChwKTtcbn1cblxuLy8gU2ltb24gVGF0aGFtJ3MgbGlua2VkIGxpc3QgbWVyZ2Ugc29ydCBhbGdvcml0aG1cbi8vIGh0dHA6Ly93d3cuY2hpYXJrLmdyZWVuZW5kLm9yZy51ay9+c2d0YXRoYW0vYWxnb3JpdGhtcy9saXN0c29ydC5odG1sXG5mdW5jdGlvbiBzb3J0TGlua2VkKGxpc3QpIHtcbiAgICB2YXIgaSwgcCwgcSwgZSwgdGFpbCwgbnVtTWVyZ2VzLCBwU2l6ZSwgcVNpemUsXG4gICAgICAgIGluU2l6ZSA9IDE7XG5cbiAgICBkbyB7XG4gICAgICAgIHAgPSBsaXN0O1xuICAgICAgICBsaXN0ID0gbnVsbDtcbiAgICAgICAgdGFpbCA9IG51bGw7XG4gICAgICAgIG51bU1lcmdlcyA9IDA7XG5cbiAgICAgICAgd2hpbGUgKHApIHtcbiAgICAgICAgICAgIG51bU1lcmdlcysrO1xuICAgICAgICAgICAgcSA9IHA7XG4gICAgICAgICAgICBwU2l6ZSA9IDA7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgaW5TaXplOyBpKyspIHtcbiAgICAgICAgICAgICAgICBwU2l6ZSsrO1xuICAgICAgICAgICAgICAgIHEgPSBxLm5leHRaO1xuICAgICAgICAgICAgICAgIGlmICghcSkgYnJlYWs7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHFTaXplID0gaW5TaXplO1xuXG4gICAgICAgICAgICB3aGlsZSAocFNpemUgPiAwIHx8IChxU2l6ZSA+IDAgJiYgcSkpIHtcblxuICAgICAgICAgICAgICAgIGlmIChwU2l6ZSA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBlID0gcTtcbiAgICAgICAgICAgICAgICAgICAgcSA9IHEubmV4dFo7XG4gICAgICAgICAgICAgICAgICAgIHFTaXplLS07XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChxU2l6ZSA9PT0gMCB8fCAhcSkge1xuICAgICAgICAgICAgICAgICAgICBlID0gcDtcbiAgICAgICAgICAgICAgICAgICAgcCA9IHAubmV4dFo7XG4gICAgICAgICAgICAgICAgICAgIHBTaXplLS07XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwLnogPD0gcS56KSB7XG4gICAgICAgICAgICAgICAgICAgIGUgPSBwO1xuICAgICAgICAgICAgICAgICAgICBwID0gcC5uZXh0WjtcbiAgICAgICAgICAgICAgICAgICAgcFNpemUtLTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBlID0gcTtcbiAgICAgICAgICAgICAgICAgICAgcSA9IHEubmV4dFo7XG4gICAgICAgICAgICAgICAgICAgIHFTaXplLS07XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKHRhaWwpIHRhaWwubmV4dFogPSBlO1xuICAgICAgICAgICAgICAgIGVsc2UgbGlzdCA9IGU7XG5cbiAgICAgICAgICAgICAgICBlLnByZXZaID0gdGFpbDtcbiAgICAgICAgICAgICAgICB0YWlsID0gZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcCA9IHE7XG4gICAgICAgIH1cblxuICAgICAgICB0YWlsLm5leHRaID0gbnVsbDtcbiAgICAgICAgaW5TaXplICo9IDI7XG5cbiAgICB9IHdoaWxlIChudW1NZXJnZXMgPiAxKTtcblxuICAgIHJldHVybiBsa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biAgICBrMSAvPSBzY2FsZTtcbiAgICBrMiAvPSBzY2FsZTtcblxuICAgIGlmIChtaW5BbGwgPj0gazEgJiYgbWF4QWxsIDw9IGsyKSByZXR1cm4gZmVhdHVyZXM7IC8vIHRyaXZpYWwgYWNjZXB0XG4gICAgZWxzZSBpZiAobWluQWxsID4gazIgfHwgbWF4QWxsIDwgazEpIHJldHVybiBudWxsOyAvLyB0cml2aWFsIHJlamVjdFxuXG4gICAgdmFyIGNsaXBwZWQgPSBbXTtcblxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZmVhdHVyZXMubGVuZ3RoOyBpKyspIHtcblxuICAgICAgICB2YXIgZmVhdHVyZSA9IGZlYXR1cmVzW2ldLFxuICAgICAgICAgICAgZ2VvbWV0cnkgPSBmZWF0dXJlLmdlb21ldHJ5LFxuICAgICAgICAgICAgdHlwZSA9IGZlYXR1cmUudHlwZSxcbiAgICAgICAgICAgIG1pbiwgbWF4O1xuXG4gICAgICAgIG1pbiA9IGZlYXR1cmUubWluW2F4aXNdO1xuICAgICAgICBtYXggPSBmZWF0dXJlLm1heFtheGlzXTtcblxuICAgICAgICBpZiAobWluID49IGsxICYmIG1heCA8PSBrMikgeyAvLyB0cml2aWFsIGFjY2VwdFxuICAgICAgICAgICAgY2xpcHBlZC5wdXNoKGZlYXR1cmUpO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH0gZWxzZSBpZiAobWluID4gazIgfHwgbWF4IDwgazEpIGNvbnRpbnVlOyAvLyB0cml2aWFsIHJlamVjdFxuXG4gICAgICAgIHZhciBzbGljZXMgPSB0eXBlID09PSAxID9cbiAgICAgICAgICAgICAgICBjbGlwUG9pbnRzKGdlb21ldHJ5LCBrMSwgazIsIGF4aXMpIDpcbiAgICAgICAgICAgICAgICBjbGlwR2VvbWV0cnkoZ2VvbWV0cnksIGsxLCBrMiwgYXhpcywgaW50ZXJzZWN0LCB0eXBlID09PSAzKTtcblxuICAgICAgICBpZiAoc2xpY2VzLmx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dlb21ldHJ5Lmxlbmd0aDsgaSsrKSB7XG5cbiAgICAgICAgdmFyIGFrID0gMCxcbiAgICAgICAgICAgIGJrID0gMCxcbiAgICAgICAgICAgIGIgPSBudWxsLFxuICAgICAgICAgICAgcG9pbnRzID0gZ2VvbWV0cnlbaV0sXG4gICAgICAgICAgICBhcmVhID0gcG9pbnRzLmFyZWEsXG4gICAgICAgICAgICBkaXN0ID0gcG9pbnRzLmRpc3QsXG4gICAgICAgICAgICBsZW4gPSBwb2ludHMubGVuZ3RoLFxuICAgICAgICAgICAgYSwgaiwgbGFzdDtcblxuICAgICAgICB2YXIgc2xpY2UgPSBbXTtcblxuICAgICAgICBmb3IgKGogPSAwOyBqIDwgbGVuIC0gMTsgaisrKSB7XG4gICAgICAgICAgICBhID0gYiB8fCBwb2ludHNbal07XG4gICAgICAgICAgICBiID0gcG9pbnRzW2ogKyAxXTtcbiAgICAgICAgICAgIGFrID0gYmsgfHwgYVtheGlzXTtcbiAgICAgICAgICAgIGJrID0gYltheGlzXTtcblxuICAgICAgICAgICAgaWYgKGFrIDwgazEpIHtcblxuICAgICAgICAgICAgICAgIGlmICgoYmsgPiBrMikpIHsgLy8gLS0tfC0tLS0tfC0tPlxuICAgICAgICAgICAgICAgICAgICBzbGljZS5wdXNoKGludGVyc2VjdChhLCBiLCBrMSksIGludGVyc2VjdChhLCBiLCBrMikpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWNsb3NlZCkgc2xpY2UgPSBuZXdTbGljZShzbGljZXMsIHNsaWNlLCBhcmVhLCBkaXN0KTtcblxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYmsgPj0gazEpIHNsaWNlLnB1c2goaW50ZXJzZWN0KGEsIGIsIGsxKSk7IC8vIC0tLXwtLT4gIHxcblxuICAgICAgICAgICAgfSBlbHNlIGlmIChhayA+IGsyKSB7XG5cbiAgICAgICAgICAgICAgICBpZiAoKGJrIDwgazEpKSB7IC8vIDwtLXwtLS0tLXwtLS1cbiAgICAgICAgICAgICAgICAgICAgc2xpY2UucHVzaChpbnRlcnNlY3QoYSwgYiwgazIpLCBpbnRlcnNlY3QoYSwgYiwgazEpKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFjbG9zZWQpIHNsaWNlID0gbmV3U2xpY2Uoc2xpY2VzLCBzbGljZSwgYXJlYSwgZGlzdCk7XG5cbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGJrIDw9IGsyKSBzbGljZS5wdXNoKGludGVyc2VjdChhLCBiLCBrMikpOyAvLyB8ICA8LS18LS0tXG5cbiAgICAgICAgICAgIH0gZWxzZSB7XG5cbiAgICAgICAgICAgICAgICBzbGljZS5wdXNoKGEpO1xuXG4gICAgICAgICAgICAgICAgaWYgKGJrIDwgazEpIHsgLy8gPC0tfC0tLSAgfFxuICAgICAgICAgICAgICAgICAgICBzbGljZS5wdXNoKGludGVyc2VjdChhLCBiLCBrMSkpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWNsb3NlZCkgc2xpY2UgPSBuZXdTbGljZShzbGljZXMsIHNsaWNlLCBhcmVhLCBkaXN0KTtcblxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYmsgPiBrMikgeyAvLyB8ICAtLS18LS0+XG4gICAgICAgICAgICAgICAgICAgIHNsaWNlLnB1c2goaW50ZXJzZWN0KGEsIGIsIGsyKSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghY2xvc2VkKSBzbGljZSA9IG5ld1NsaWNlKHNsaWNlcywgc2xpY2UsIGFyZWEsIGRpc3QpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyB8IC0tPiB8XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBhZGQgdGhlIGxhc3QgcG9pbnRcbiAgICAgICAgYSA9IHBvaW50c1tsZW4gLSAxXTtcbiAgICAgICAgYWsgPSBhW2F4aXNdO1xuICAgICAgICBpZiAoYWsgPj0gazEgJiYgYWsgPD0gazIp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JlcyA9IHN0YWNrLnBvcCgpO1xuXG4gICAgICAgIHZhciB6MiA9IDEgPDwgeixcbiAgICAgICAgICAgIGlkID0gdG9JRCh6LCB4LCB5KSxcbiAgICAgICAgICAgIHRpbGUgPSB0aGlzLnRpbGVzW2lkXSxcbiAgICAgICAgICAgIHRpbGVUb2xlcmFuY2UgPSB6ID09PSBvcHRpb25zLm1heFpvb20gPyAwIDogb3B0aW9ucy50b2xlcmFuY2UgLyAoejIgKiBvcHRpb25zLmV4dGVudCk7XG5cbiAgICAgICAgaWYgKCF0aWxlKSB7XG4gICAgICAgICAgICBpZiAoZGVidWcgPiAxKSBjb25zb2xlLnRpbWUoJ2NyZWF0aW9uJyk7XG5cbiAgICAgICAgICAgIHRpbGUgPSB0aGlzLnRpbGVzW2lkXSA9IGNyZWF0ZVRpbGUoZmVhdHVyZXMsIHoyLCB4LCB5LCB0aWxlVG9sZXJhbmNlLCB6ID09PSBvcHRpb25zLm1heFpvb20pO1xuICAgICAgICAgICAgdGhpcy50aWxlQ29vcmRzLnB1c2goe3o6IHosIHg6IHgsIHk6IHl9KTtcblxuICAgICAgICAgICAgaWYgKGRlYnVnKSB7XG4gICAgICAgICAgICAgICAgaWYgKGRlYnVnID4gMSkge1xuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygndGlsZSB6JWQtJWQtJWQgKGZlYXR1cmVzOiAlZCwgcG9pbnRzOiAlZCwgc2ltcGxpZmllZDogJWQpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHosIHgsIHksIHRpbGUubnVtRmVhdHVyZXMsIHRpbGUubnVtUG9pbnRzLCB0aWxlLm51bVNpbXBsaWZpZWQpO1xuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLnRpbWVFbmQoJ2NyZWF0aW9uJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBrZXkgPSAneicgKyB6O1xuICAgICAgICAgICAgICAgIHRoaXMuc3RhdHNba2V5XSA9ICh0aGl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biAgICAgICAgICAgIC8vIHN0b3AgdGlsaW5nIGlmIGl0J3Mgbm90IGFuIGFuY2VzdG9yIG9mIHRoZSB0YXJnZXQgdGlsZVxuICAgICAgICAgICAgdmFyIG0gPSAxIDw8IChjeiAtIHopO1xuICAgICAgICAgICAgaWYgKHggIT09IE1hdGguZmxvb3IoY3ggLyBtKSB8fCB5ICE9PSBNYXRoLmZsb29yKGN5IC8gbSkpIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gaWYgd2Ugc2xpY2UgZnVydGhlciBkb3duLCBubyBuZWVkIHRvIGtlZXAgc291cmNlIGdlb21ldHJ5XG4gICAgICAgIHRpbGUuc291cmNlID0gbnVsbDtcblxuICAgICAgICBpZiAoZGVidWcgPiAxKSBjb25zb2xlLnRpbWUoJ2NsaXBwaW5nJyk7XG5cbiAgICAgICAgLy8gdmFsdWVzIHdlJ2xsIHVzZSBmb3IgY2xpcHBpbmdcbiAgICAgICAgdmFyIGsxID0gMC41ICogb3B0aW9ucy5idWZmZXIgLyBvcHRpb25zLmV4dGVudCxcbiAgICAgICAgICAgIGsyID0gMC41IC0gazEsXG4gICAgICAgICAgICBrMyA9IDAuNSArIGsxLFxuICAgICAgICAgICAgazQgPSAxICsgazEsXG4gICAgICAgICAgICB0bCwgYmwsIHRyLCBiciwgbGVmdCwgcmlnaHQ7XG5cbiAgICAgICAgdGwgPSBibCA9IHRyID0gYnIgPSBudWxsO1xuXG4gICAgICAgIGxlZnQgID0gY2xpcChmZWF0dXJlcywgejIsIHggLSBrMSwgeCArIGszLCAwLCBpbnRlcnNlY3RYLCB0aWxlLm1pblswXSwgdGlsZS5tYXhbMF0pO1xuICAgICAgICByaWdodCA9IGNsaXAoZmVhdHVyZXMsIHoyLCB4ICsgazIsIHggKyBrNCwgMCwgaW50ZXJzZWN0WCwgdGlsZS5taW5bMF0sIHRpbGUubWF4WzBdKTtcblxuICAgICAgICBpZiAobGVmdCkge1xuICAgICAgICAgICAgdGwgPSBjbGlwKGxlZnQsIHoyLCB5IC0gazEsIHkgKyBrMywgMSwgaW50ZXJzZWN0WSwgdGlsZS5taW5bMV0sIHRpbGUubWF4WzFdKTtcbiAgICAgICAgICAgIGJsID0gY2xpcChsZWZ0LCB6MiwgeSArIGsyLCB5ICsgazQsIDEsIGludGVyc2VjdFksIHRpbGUubWluWzFdLCB0aWxlLm1heFsxXSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAocmlnaHQpIHtcbiAgICAgICAgICAgIHRyID0gY2xpcChyaWdodCwgejIsIHkgLSBrMSwgeSArIGszLCAxLCBpbnRlcnNlY3RZLCB0aWxlLm1pblsxXSwgdGlsZS5tYXhbMV0pO1xuICAgICAgICAgICAgYnIgPSBjbGlwKHJpZ2h0LCB6MiwgeSArIGsyLCB5ICsgazQsIDEsIGludGVyc2VjdFksIHRpbGUubWluWzFdLCB0aWxlLm1heFsxXSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZGVidWcgPiAxKSBjb25zb2xlLnRpbWVFbmQoJ2NsaXBwaW5nJyk7XG5cbiAgICAgICAgaWYgKHRsKSBzdGFjay5wdXNoKHRsLCB6ICsgMSwgeCAqIDIsICAgICB5ICogMik7XG4gICAgICAgIGlmIChibCkgc3RhY2sucHVzaChibCwgeiArIDEsIHggKiAyLCAgICAgeSAqIDIgKyAxKTtcbiAgICAgICAgaWYgKHRyKSBzdGFjay5wdXNoKHRyLCB6ICsgMSwgeCAqIDIgKyAxLCB5ICogMik7XG4gICAgICAgIGlmIChicikgc3RhY2sucHVzaChiciwgeiArIDEsIHggKiAyICsgMSwgeSAqIDIgKyAxKTtcbiAgICB9XG59O1xuXG5HZW9KU09OVlQucHJvdG90eXBlLmdldFRpbGUgPSBmdW5jdGlvbiAoeiwgeCwgeSkge1xuICAgIHZhciBvcHRpb25zID0gdGhpcy5vcHRpb25zLFxuICAgICAgICBleHRlbnQgPSBvcHRpb25zLmV4dGVudCxcbiAgICAgICAgZGVidWcgPSBvcHRpb25zL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WF0ZVRpbGUoZmVhdHVyZXMsIHoyLCB0eCwgdHksIHRvbGVyYW5jZSwgbm9TaW1wbGlmeSkge1xuICAgIHZhciB0aWxlID0ge1xuICAgICAgICBmZWF0dXJlczogW10sXG4gICAgICAgIG51bVBvaW50czogMCxcbiAgICAgICAgbnVtU2ltcGxpZmllZDogMCxcbiAgICAgICAgbnVtRmVhdHVyZXM6IDAsXG4gICAgICAgIHNvdXJjZTogbnVsbCxcbiAgICAgICAgeDogdHgsXG4gICAgICAgIHk6IHR5LFxuICAgICAgICB6MjogejIsXG4gICAgICAgIHRyYW5zZm9ybWVkOiBmYWxzZSxcbiAgICAgICAgbWluOiBbMiwgMV0sXG4gICAgICAgIG1heDogWy0xLCAwXVxuICAgIH07XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBmZWF0dXJlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICB0aWxlLm51bUZlYXR1cmVzKys7XG4gICAgICAgIGFkZEZlYXR1cmUodGlsZSwgZmVhdHVyZXNbaV0sIHRvbGVyYW5jZSwgbm9TaW1wbGlmeSk7XG5cbiAgICAgICAgdmFyIG1pbiA9IGZlYXR1cmVzW2ldLm1pbixcbiAgICAgICAgICAgIG1heCA9IGZlYXR1cmVzW2ldLm1heDtcblxuICAgICAgICBpZiAobWluWzBdIDwgdGlsZS5taW5bMF0pIHRpbGUubWluWzBdID0gbWluWzBdO1xuICAgICAgICBpZiAobWluWzFdIDwgdGlsZS5taW5bMV0pIHRpbGUubWluWzFdID0gbWluWzFdO1xuICAgICAgICBpZiAobWF4WzBdID4gdGlsZS5tYXhbMF0pIHRpbGUubWF4WzBdID0gbWF4WzBdO1xuICAgICAgICBpZiAobWF4WzFdID4gdGlsZS5tYXhbMV0pIHRpbGUubWF4WzFdID0gbWF4WzFdO1xuICAgIH1cbiAgICByZXR1cm4gdGlsZTtcbn1cblxuZnVuY3Rpb24gYWRkRmVhdHVyZSh0aWxlLCBmZWF0dXJlLCB0b2xlcmFuY2UsIG5vU2ltcGxpZnkpIHtcblxuICAgIHZhciBnZW9tID0gZmVhdHVyZS5nZW9tZXRyeSxcbiAgICAgICAgdHlwZSA9IGZlYXR1cmUudHlwZSxcbiAgICAgICAgc2ltcGxpZmllZCA9IFtdLFxuICAgICAgICBzcVRvbGVyYW5jZSA9IHRvbGVyYW5jZSAqIHRvbGVyYW5jZSxcbiAgICAgICAgaSwgaiwgcmluZywgcDtcblxuICAgIGlmICh0eXBlID09PSAxKSB7XG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBnZW9tLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBzaW1wbGlmaWVkLnB1c2goZ2VvbVtpXSk7XG4gICAgICAgICAgICB0aWxlLm51bVBvaW50cysrO1xuICAgICAgICAgICAgdGlsZS5udW1TaW1wbGlmaWVkKys7XG4gICAgICAgIH1cblxuICAgIH0gZWxzZSB7XG5cbiAgICAgICAgLy8gc2ltcGxpZnkgYW5kIHRyYW5zZm9ybSBwcm9qZWN0ZWQgY29vcmRpbmF0ZXMgZm9yIHRpbGUgZ2VvbWV0cnlcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IGdlb20ubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIHJpbmcgPSBnZW9tW2ldO1xuXG4gICAgICAgICAgICAvLyBmaWx0ZXIgb3V0IHRpbnkgcG9seWxpbmVzICYgcG9seWdvbnNcbiAgICAgICAgICAgIGlmICghbm9TaW1wbGlmeSAmJiAoKHR5cGUgPT09IDIgJiYgcmluZy5kaXN0IDwgdG9sZXJhbmNlKSB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodHlwZSA9PT0gMyAmJiByaW5nLmFyZWEgPCBzcVRvbGVyYW5jZSkpKSB7XG4gICAgICAgICAgICAgICAgdGlsZS5udW1Qb2ludHMgKz0gcmluZy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBzaW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LCB4MSwgeDIsIHkwLCB5MSwgeTIsIHowLCB6MSwgejIsIGxlbixcbiAgICAgICAgZXlleCA9IGV5ZVswXSxcbiAgICAgICAgZXlleSA9IGV5ZVsxXSxcbiAgICAgICAgZXlleiA9IGV5ZVsyXSxcbiAgICAgICAgdXB4ID0gdXBbMF0sXG4gICAgICAgIHVweSA9IHVwWzFdLFxuICAgICAgICB1cHogPSB1cFsyXSxcbiAgICAgICAgY2VudGVyeCA9IGNlbnRlclswXSxcbiAgICAgICAgY2VudGVyeSA9IGNlbnRlclsxXSxcbiAgICAgICAgY2VudGVyeiA9IGNlbnRlclsyXTtcblxuICAgIGlmIChNYXRoLmFicyhleWV4IC0gY2VudGVyeCkgPCAwLjAwMDAwMSAmJlxuICAgICAgICBNYXRoLmFicyhleWV5IC0gY2VudGVyeSkgPCAwLjAwMDAwMSAmJlxuICAgICAgICBNYXRoLmFicyhleWV6IC0gY2VudGVyeikgPCAwLjAwMDAwMSkge1xuICAgICAgICByZXR1cm4gaWRlbnRpdHkob3V0KTtcbiAgICB9XG5cbiAgICB6MCA9IGV5ZXggLSBjZW50ZXJ4O1xuICAgIHoxID0gZXlleSAtIGNlbnRlcnk7XG4gICAgejIgPSBleWV6IC0gY2VudGVyejtcblxuICAgIGxlbiA9IDEgLyBNYXRoLnNxcnQoejAgKiB6MCArIHoxICogejEgKyB6MiAqIHoyKTtcbiAgICB6MCAqPSBsZW47XG4gICAgejEgKj0gbGVuO1xuICAgIHoyICo9IGxlbjtcblxuICAgIHgwID0gdXB5ICogejIgLSB1cHogKiB6MTtcbiAgICB4MSA9IHVweiAqIHowIC0gdXB4ICogejI7XG4gICAgeDIgPSB1cHggKiB6MSAtIHVweSAqIHowO1xuICAgIGxlbiA9IE1hdGguc3FydCh4MCAqIHgwICsgeDEgKiB4MSArIHgyICogeDIpO1xuICAgIGlmICghbGVuKSB7XG4gICAgICAgIHgwID0gMDtcbiAgICAgICAgeDEgPSAwO1xuICAgICAgICB4MiA9IDA7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgbGVuID0gMSAvIGxlbjtcbiAgICAgICAgeDAgKj0gbGVuO1xuICAgICAgICB4MSAqPSBsZW47XG4gICAgICAgIHgyICo9IGxlbjtcbiAgICB9XG5cbiAgICB5MCA9IHoxICogeDIgLSB6MiAqIHgxO1xuICAgIHkxID0gejIgKiB4MCAtIHowICogeDI7XG4gICAgeTIgPSB6MCAqIHgxIC0gejEgKiB4MDtcblxuICAgIGxlbiA9IE1hdGguc3FydCh5MCAqIHkwICsgeTEgKiB5MSArIHkyICogeTIpO1xuICAgIGlmICghbGVuKSB7XG4gICAgICAgIHkwID0gMDtcbiAgICAgICAgeTEgPSAwO1xuICAgICAgICB5MiA9IDA7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgbGVuID0gMSAvIGxlbjtcbiAgICAgICAgeTAgKj0gbGVuO1xuICAgICAgICB5MSAqPSBsZW47XG4gICAgICAgIHkyICo9IGxlbjtcbiAgICB9XG5cbiAgICBvdXRbMF0gPSB4MDtcbiAgICBvdXRbMV0gPSB5MDtcbiAgICBvdXRbMl0gPSB6MDtcbiAgICBvdXRbM10gPSAwO1xuICAgIG91dFs0XSA9IHgxO1xuICAgIG91dFs1XSA9IHkxO1xuICAgIG91dFs2XSA9IHoxO1xuICAgIG91dFs3XSA9IDA7XG4gICAgb3V0WzhdID0geDI7XG4gICAgb3V0WzldID0geTI7XG4gICAgb3V0WzEwXSA9IHoyO1xuICAgIG91dFsxMV0gPSAwO1xuICAgIG91dFsxMl0gPSAtKHgwICogZXlleCArIHgxICogZXlleSArIHgyICogZXlleik7XG4gICAgb3V0WzEzXSA9IC0oeTAgKiBleWV4ICsgeTEgKiBleWV5ICsgeTIgKiBleWV6KTtcbiAgICBvdXRbMTRdID0gLSh6MCAqIGV5ZXggKyB6MSAqIGV5ZXkgKyB6MiAqIGV5ZXopO1xuICAgIG91dFsxNV0gPSAxO1xuXG4gICAgcmV0dXJuIG91dDtcbn07IiwibW9kdWxlLmV4cG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XFwtIztcXC9cXD86QCY9XFwrXFwkLF9cXC4hflxcKidcXChcXClcXFtcXF1dKSokL2k7XG5cblxuZnVuY3Rpb24gaXNfRU9MKGMpIHtcbiAgcmV0dXJuIChjID09PSAweDBBLyogTEYgKi8pIHx8IChjID09PSAweDBELyogQ1IgKi8pO1xufVxuXG5mdW5jdGlvbiBpc19XSElURV9TUEFDRShjKSB7XG4gIHJldHVybiAoYyA9PT0gMHgwOS8qIFRhYiAqLykgfHwgKGMgPT09IDB4MjAvKiBTcGFjZSAqLyk7XG59XG5cbmZ1bmN0aW9uIGlzX1dTX09SX0VPTChjKSB7XG4gIHJldHVybiAoYyA9PT0gMHgwOS8qIFRhYiAqLykgfHxcbiAgICAgICAgIChjID09PSAweDIwLyogU3BhY2UgKi8pIHx8XG4gICAgICAgICAoYyA9PT0gMHgwQS8qIExGICovKSB8fFxuICAgICAgICAgKGMgPT09IDB4MEQvKiBDUiAqLyk7XG59XG5cbmZ1bmN0aW9uIGlzX0ZMT1dfSU5ESUNBVE9SKGMpIHtcbiAgcmV0dXJuIGMgPT09IDB4MkMvKiAsICovIHx8XG4gICAgICAgICBjID09PSAweDVCLyogWyAqLyB8fFxuICAgICAgICAgYyA9PT0gMHg1RC8qIF0gKi8gfHxcbiAgICAgICAgIGMgPT09IDB4N0IvKiB7ICovIHx8XG4gICAgICAgICBjID09PSAweDdELyogfSAqLztcbn1cblxuZnVuY3Rpb24gZnJvbUhleENvZGUoYykge1xuICB2YXIgbGM7XG5cbiAgaWYgKCgweDMwLyogMCAqLyA8PSBjKSAmJiAoYyA8PSAweDM5LyogOSAqLykpIHtcbiAgICByZXR1cm4gYyAtIDB4MzA7XG4gIH1cblxuICAvKmVzbGludC1kaXNhYmxlIG5vLWJpdHdpc2UqL1xuICBsYyA9IGMgfCAweDIwO1xuXG4gIGlmICgoMHg2MS8qIGEgKi8gPD0gbGMpICYmIChsYyA8PSAweDY2LyogZiAqLykpIHtcbiAgICByZXR1cm4gbGMgLSAweDYxICsgMTA7XG4gIH1cblxuICByZXR1cm4gLTE7XG59XG5cbmZ1bmN0aW9uIGVzY2FwZWRIZXhMZW4oYykge1xuICBpZiAoYyA9PT0gMHg3OC8qIHggKi8pIHsgcmV0dXJuIDI7IH1cbiAgaWYgKGMgPT09IDB4NzUvKiB1ICovKSB7IHJldHVybiA0OyB9XG4gIGlmIChjID09PSAweDU1LyogVSAqLykgeyByZXR1cm4gODsgfVxuICByZXR1cm4gMDtcbn1cblxuZnVuY3Rpb24gZnJvbURlY2ltYWxDb2RlKGMpIHtcbiAgaWYgKCgweDMwLyogMCAqLyA8PSBjKSAmJiAoYyA8PSAweDM5LyogOSAqLykpIHtcbiAgICByZXR1cm4gYyAtIDB4MzA7XG4gIH1cblxuICByZXR1cm4gLTE7XG59XG5cbmZ1bmN0aW9uIHNpbXBsZUVzY2FwZVNlcXVlbmNlKGMpIHtcbiAgcmV0dXJuIChjID09PSAweDMwLyogMCAqLykgPyAnXFx4MDAnIDpcbiAgICAgICAgKGMgPT09IDB4NjEvKiBhICovKSA/ICdcXHgwNycgOlxuICAgICAgICAoYyA9PT0gMHg2Mi8qIGIgKi8pID8gJ1xceDA4JyA6XG4gICAgICAgIChjID09PSAweDc0LyogdCAqLykgPyAnXFx4MDknIDpcbiAgICAgICAgKGMgPT09IDB4MDkvKiBUYWIgKi8pID8gJ1xceDA5JyA6XG4gICAgICAgIChjID09PSAweDZFLyogbiAqLykgPyAnXFx4MEEnIDpcbiAgICAgICAgKGMgPT09IDB4NzYvKiB2ICovKSA/ICdcXHgwQicgOlxuICAgICAgICAoYyA9PT0gMHg2Ni8qIGYgKi8pID8gJ1xceDBDJyA6XG4gICAgICAgIChjID09PSAweDcyLyogciAqLykgPyAnXFx4MEQnIDpcbiAgICAgICAgKGMgPT09IDB4NjUvKiBlICovKSA/ICdcXHgxQicgOlxuICAgICAgICAoYyA9PT0gMHgyMC8qIFNwYWNlICovKSA/ICcgJyA6XG4gICAgICAgIChjID09PSAweDIyLyogXCIgKi8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ICAgICBjYXB0dXJlU3RhcnQsXG4gICAgICBjYXB0dXJlRW5kLFxuICAgICAgaGFzUGVuZGluZ0NvbnRlbnQsXG4gICAgICBfbGluZSxcbiAgICAgIF9saW5lU3RhcnQsXG4gICAgICBfbGluZUluZGVudCxcbiAgICAgIF9raW5kID0gc3RhdGUua2luZCxcbiAgICAgIF9yZXN1bHQgPSBzdGF0ZS5yZXN1bHQsXG4gICAgICBjaDtcblxuICBjaCA9IHN0YXRlLmlucHV0LmNoYXJDb2RlQXQoc3RhdGUucG9zaXRpb24pO1xuXG4gIGlmIChpc19XU19PUl9FT0woY2gpICAgICAgfHxcbiAgICAgIGlzX0ZMT1dfSU5ESUNBVE9SKGNoKSB8fFxuICAgICAgY2ggPT09IDB4MjMvKiAjICovICAgIHx8XG4gICAgICBjaCA9PT0gMHgyNi8qICYgKi8gICAgfHxcbiAgICAgIGNoID09PSAweDJBLyogKiAqLyAgICB8fFxuICAgICAgY2ggPT09IDB4MjEvKiAhICovICAgIHx8XG4gICAgICBjaCA9PT0gMHg3Qy8qIHwgKi8gICAgfHxcbiAgICAgIGNoID09PSAweDNFLyogPiAqLyAgICB8fFxuICAgICAgY2ggPT09IDB4MjcvKiAnICovICAgIHx8XG4gICAgICBjaCA9PT0gMHgyMi8qIFwiICovICAgIHx8XG4gICAgICBjaCA9PT0gMHgyNS8qICUgKi8gICAgfHxcbiAgICAgIGNoID09PSAweDQwLyogQCAqLyAgICB8fFxuICAgICAgY2ggPT09IDB4NjAvKiBgICovKSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG5cbiAgaWYgKGNoID09PSAweDNGLyogPyAqLyB8fCBjaCA9PT0gMHgyRC8qIC0gKi8pIHtcbiAgICBmb2xsb3dpbmcgPSBzdGF0ZS5pbnB1dC5jaGFyQ29kZUF0KHN0YXRlLnBvc2l0aW9uICsgMSk7XG5cbiAgICBpZiAoaXNfV1NfT1JfRU9MKGZvbGxvd2luZykgfHxcbiAgICAgICAgd2l0aGluRmx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VsbCA/IGRhdGEgOiB7fTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBuZXcgVHlwZSgndGFnOnlhbWwub3JnLDIwMDI6c2V0Jywge1xuICBraW5kOiAnbWFwcGluZycsXG4gIHJlc29sdmU6IHJlc29sdmVZYW1sU2V0LFxuICBjb25zdHJ1Y3Q6IGNvbnN0cnVjdFlhbWxTZXRcbn0pO1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG52YXIgVHlwZSA9IHJlcXVpcmUoJy4uL3R5cGUnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBuZXcgVHlwZSgndGFnOnlhbWwub3JnLDIwMDI6c3RyJywge1xuICBraW5kOiAnc2NhbGFyJyxcbiAgY29uc3RydWN0OiBmdW5jdGlvbiAoZGF0YSkgeyByZXR1cm4gZGF0YSAhPT0gbnVsbCA/IGRhdGEgOiAnJzsgfVxufSk7XG4iLCIndXNlIHN0cmljdCc7XG5cbnZhciBUeXBlID0gcmVxdWlyZSgnLi4vdHlwZScpO1xuXG52YXIgWUFNTF9USU1FU1RBTVBfUkVHRVhQID0gbmV3IFJlZ0V4cChcbiAgJ14oWzAtOV1bMC05XVswLTldWzAtOV0pJyAgICAgICAgICArIC8vIFsxXSB5ZWFyXG4gICctKFswLTldWzAtOV0/KScgICAgICAgICAgICAgICAgICAgKyAvLyBbMl0gbW9udGhcbiAgJy0oWzAtOV1bMC05XT8pJyAgICAgICAgICAgICAgICAgICArIC8vIFszXSBkYXlcbiAgJyg/Oig/OltUdF18WyBcXFxcdF0rKScgICAgICAgICAgICAgICsgLy8gLi4uXG4gICcoWzAtOV1bMC05XT8pJyAgICAgICAgICAgICAgICAgICAgKyAvLyBbNF0gaG91clxuICAnOihbMC05XVswLTldKScgICAgICAgICAgICAgICAgICAgICsgLy8gWzVdIG1pbnV0ZVxuICAnOihbMC05XVswLTldKScgICAgICAgICAgICAgICAgICAgICsgLy8gWzZdIHNlY29uZFxuICAnKD86XFxcXC4oWzAtOV0qKSk/JyAgIC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GVja0VudHJ5Q1JDMzIoZmlsZXNbaV0pKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZXh0ZXJuYWwuUHJvbWlzZS5hbGwocHJvbWlzZXMpO1xuICAgIH0pLnRoZW4oZnVuY3Rpb24gYWRkRmlsZXMocmVzdWx0cykge1xuICAgICAgICB2YXIgemlwRW50cmllcyA9IHJlc3VsdHMuc2hpZnQoKTtcbiAgICAgICAgdmFyIGZpbGVzID0gemlwRW50cmllcy5maWxlcztcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBmaWxlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFyIGlucHV0ID0gZmlsZXNbaV07XG4gICAgICAgICAgICB6aXAuZmlsZShpbnB1dC5maWxlTmFtZVN0ciwgaW5wdXQuZGVjb21wcmVzc2VkLCB7XG4gICAgICAgICAgICAgICAgYmluYXJ5OiB0cnVlLFxuICAgICAgICAgICAgICAgIG9wdGltaXplZEJpbmFyeVN0cmluZzogdHJ1ZSxcbiAgICAgICAgICAgICAgICBkYXRlOiBpbnB1dC5kYXRlLFxuICAgICAgICAgICAgICAgIGRpcjogaW5wdXQuZGlyLFxuICAgICAgICAgICAgICAgIGNvbW1lbnQgOiBpbnB1dC5maWxlQ29tbWVudFN0ci5sZW5ndGggPyBpbnB1dC5maWxlQ29tbWVudFN0ciA6IG51bGwsXG4gICAgICAgICAgICAgICAgdW5peFBlcm1pc3Npb25zIDogaW5wdXQudW5peFBlcm1pc3Npb25zLFxuICAgICAgICAgICAgICAgIGRvc1Blcm1pc3Npb25zIDogaW5wdXQuZG9zUGVybWlzc2lvbnMsXG4gICAgICAgICAgICAgICAgY3JlYXRlRm9sZGVyczogb3B0aW9ucy5jcmVhdGVGb2xkZXJzXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoemlwRW50cmllcy56aXBDb21tZW50Lmxlbmd0aCkge1xuICAgICAgICAgICAgemlwLm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obmFtZSkpIHtcbiAgICAgICAgICAgICAgICB2YXIgcmVnZXhwID0gbmFtZTtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5maWx0ZXIoZnVuY3Rpb24ocmVsYXRpdmVQYXRoLCBmaWxlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAhZmlsZS5kaXIgJiYgcmVnZXhwLnRlc3QocmVsYXRpdmVQYXRoKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgeyAvLyB0ZXh0XG4gICAgICAgICAgICAgICAgdmFyIG9iaiA9IHRoaXMuZmlsZXNbdGhpcy5yb290ICsgbmFtZV07XG4gICAgICAgICAgICAgICAgaWYgKG9iaiAmJiAhb2JqLmRpcikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb2JqO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIHsgLy8gbW9yZSB0aGFuIG9uZSBhcmd1bWVudCA6IHdlIGhhdmUgZGF0YSAhXG4gICAgICAgICAgICBuYW1lID0gdGhpcy5yb290ICsgbmFtZTtcbiAgICAgICAgICAgIGZpbGVBZGQuY2FsbCh0aGlzLCBuYW1lLCBkYXRhLCBvKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogQWRkIGEgZGlyZWN0b3J5IHRvIHRoZSB6aXAgZmlsZSwgb3Igc2VhcmNoLlxuICAgICAqIEBwYXJhbSAgIHtTdHJpbmd8UmVnRXhwfSBhcmcgVGhlIG5hbWUgb2YgdGhlIGRpcmVjdG9yeSB0byBhZGQsIG9yIGEgcmVnZXggdG8gc2VhcmNoIGZvbGRlcnMuXG4gICAgICogQHJldHVybiAge0pTWmlwfS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EByZXR1cm4ge0pTWmlwfSB0aGlzIEpTWmlwIG9iamVjdFxuICAgICAqL1xuICAgIC8vIHJlbW92ZTogZnVuY3Rpb24obmFtZSkge1xuICAgIC8vICAgICBuYW1lID0gdGhpcy5yb290ICsgbmFtZTtcbiAgICAvLyAgICAgdmFyIGZpbGUgPSB0aGlzLmZpbGVzW25hbWVdO1xuICAgIC8vICAgICBpZiAoIWZpbGUpIHtcbiAgICAvLyAgICAgICAgIC8vIExvb2sgZm9yIGFueSBmb2xkZXJzXG4gICAgLy8gICAgICAgICBpZiAobmFtZS5zbGljZSgtMSkgIT09IFwiL1wiKSB7XG4gICAgLy8gICAgICAgICAgICAgbmFtZSArPSBcIi9cIjtcbiAgICAvLyAgICAgICAgIH1cbiAgICAvLyAgICAgICAgIGZpbGUgPSB0aGlzLmZpbGVzW25hbWVdO1xuICAgIC8vICAgICB9XG5cbiAgICAvLyAgICAgaWYgKGZpbGUgJiYgIWZpbGUuZGlyKSB7XG4gICAgLy8gICAgICAgICAvLyBmaWxlXG4gICAgLy8gICAgICAgICBkZWxldGUgdGhpcy5maWxlc1tuYW1lXTtcbiAgICAvLyAgICAgfSBlbHNlIHtcbiAgICAvLyAgICAgICAgIC8vIG1heWJlIGEgZm9sZGVyLCBkZWxldGUgcmVjdXJzaXZlbHlcbiAgICAvLyAgICAgICAgIHZhciBraWRzID0gdGhpcy5maWx0ZXIoZnVuY3Rpb24ocmVsYXRpdmVQYXRoLCBmaWxlKSB7XG4gICAgLy8gICAgICAgICAgICAgcmV0dXJuIGZpbGUubmFtZS5zbGljZSgwLCBuYW1lLmxlbmd0aCkgPT09IG5hbWU7XG4gICAgLy8gICAgICAgICB9KTtcbiAgICAvLyAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwga2lkcy5sZW5ndGg7IGkrKykge1xuICAgIC8vICAgICAgICAgICAgIGRlbGV0ZSB0aGlzLmZpbGVzW2tpZHNbaV0ubmFtZV07XG4gICAgLy8gICAgICAgICB9XG4gICAg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ikge1xuICAgIC8vICAgICAgICAgb3B0cy50eXBlID0gXCJzdHJpbmdcIjtcbiAgICAvLyAgICAgICB9XG5cbiAgICAvLyAgICAgICBpZiAoIW9wdHMudHlwZSkge1xuICAgIC8vICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiTm8gb3V0cHV0IHR5cGUgc3BlY2lmaWVkLlwiKTtcbiAgICAvLyAgICAgICB9XG5cbiAgICAvLyAgICAgICB1dGlscy5jaGVja1N1cHBvcnQob3B0cy50eXBlKTtcblxuICAgIC8vICAgICAgIC8vIGFjY2VwdCBub2RlanMgYHByb2Nlc3MucGxhdGZvcm1gXG4gICAgLy8gICAgICAgaWYoXG4gICAgLy8gICAgICAgICAgIG9wdGlvbnMucGxhdGZvcm0gPT09ICdkYXJ3aW4nIHx8XG4gICAgLy8gICAgICAgICAgIG9wdGlvbnMucGxhdGZvcm0gPT09ICdmcmVlYnNkJyB8fFxuICAgIC8vICAgICAgICAgICBvcHRpb25zLnBsYXRmb3JtID09PSAnbGludXgnIHx8XG4gICAgLy8gICAgICAgICAgIG9wdGlvbnMucGxhdGZvcm0gPT09ICdzdW5vcydcbiAgICAvLyAgICAgICApIHtcbiAgICAvLyAgICAgICAgICAgb3B0aW9ucy5wbGF0Zm9ybSA9IFwiVU5JWFwiO1xuICAgIC8vICAgICAgIH1cbiAgICAvLyAgICAgICBpZiAob3B0aW9ucy5wbGF0Zm9ybSA9PT0gJ3dpbjMyJykge1xuICAgIC8vICAgICAgICAgICBvcHRpb25zLnBsYXRmb3JtID0gXCJET1NcIjtcbiAgICAvLyAgICAgICB9XG5cbiAgICAvLyAgICAgICB2YXIgY29tbWVudCA9IG9wdHMuY29tbWVudCB8fCB0aGlzLmNvbW1lbnQgfHwgXCJcIjtcbiAgICAvLyAgICAgICB3b3JrZXIgPSBnZW5lcmF0ZS5nZW5lcmF0ZVdvcmtlcih0aGlzLCBvcHRzLCBjb21tZW50KTtcbiAgICAvLyAgIH0gY2F0Y2ggKGUpIHtcbi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AgIHJlc3VsdFR5cGUgPSBoZWxwZXIuX291dHB1dFR5cGUsXG4gICAgICAgICAgICBtaW1lVHlwZSA9IGhlbHBlci5fbWltZVR5cGU7XG4gICAgICAgIGhlbHBlclxuICAgICAgICAub24oJ2RhdGEnLCBmdW5jdGlvbiAoZGF0YSwgbWV0YSkge1xuICAgICAgICAgICAgZGF0YUFycmF5LnB1c2goZGF0YSk7XG4gICAgICAgICAgICBpZih1cGRhdGVDYWxsYmFjaykge1xuICAgICAgICAgICAgICAgIHVwZGF0ZUNhbGxiYWNrKG1ldGEpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KVxuICAgICAgICAub24oJ2Vycm9yJywgZnVuY3Rpb24oZXJyKSB7XG4gICAgICAgICAgICBkYXRhQXJyYXkgPSBbXTtcbiAgICAgICAgICAgIHJlamVjdChlcnIpO1xuICAgICAgICB9KVxuICAgICAgICAub24oJ2VuZCcsIGZ1bmN0aW9uICgpe1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICB2YXIgcmVzdWx0ID0gdHJhbnNmb3JtWmlwT3V0cHV0KHJlc3VsdFR5cGUsIGNvbmNhdChjaHVua1R5cGUsIGRhdGFBcnJheSksIG1pbWVUeXBlKTtcbiAgICAgICAgICAgICAgICByZXNvbHZlKHJlc3VsdCk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgcmVqZWN0KGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZGF0YUFycmF5ID0gW107XG4gICAgICAgIH0pXG4gICAgICAgIC5yZXN1bWUoKTtcbiAgICB9KTtcbn1cblxuLyoqXG4gKiBBbiBoZWxwZXIgdG8gZWFzaWx5IHVzZSB3b3JrZXJzIG91dHNpZGUgb2YgSlNaaXAuXG4gKiBAY29uc3RydWN0b3JcbiAqIEBwYXJhbSB7V29ya2VyfSB3b3JrZXIgdGhlIHdvcmtlciB0byB3cmFwXG4gKiBAcGFyYW0ge1N0cmluZ30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gfVxuICAgICAgICBidWZfbGVuICs9IGMgPCAweDgwID8gMSA6IGMgPCAweDgwMCA/IDIgOiBjIDwgMHgxMDAwMCA/IDMgOiA0O1xuICAgIH1cblxuICAgIC8vIGFsbG9jYXRlIGJ1ZmZlclxuICAgIGlmIChzdXBwb3J0LnVpbnQ4YXJyYXkpIHtcbiAgICAgICAgYnVmID0gbmV3IFVpbnQ4QXJyYXkoYnVmX2xlbik7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgYnVmID0gbmV3IEFycmF5KGJ1Zl9sZW4pO1xuICAgIH1cblxuICAgIC8vIGNvbnZlcnRcbiAgICBmb3IgKGk9MCwgbV9wb3MgPSAwOyBpIDwgYnVmX2xlbjsgbV9wb3MrKykge1xuICAgICAgICBjID0gc3RyLmNoYXJDb2RlQXQobV9wb3MpO1xuICAgICAgICBpZiAoKGMgJiAweGZjMDApID09PSAweGQ4MDAgJiYgKG1fcG9zKzEgPCBzdHJfbGVuKSkge1xuICAgICAgICAgICAgYzIgPSBzdHIuY2hhckNvZGVBdChtX3BvcysxKTtcbiAgICAgICAgICAgIGlmICgoYzIgJiAweGZjMDApID09PSAweGRjMDApIHtcbiAgICAgICAgICAgICAgICBjID0gMHgxMDAwMCArICgoYyAtIDB4ZDgwMCkgPDwgMTApICsgKGMyIC0gMHhkYzAwKTtcbiAgICAgICAgICAgICAgICBtX3BvcysrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChjIDwgMHg4MCkge1xuICAgICAgICAgICAgLyogb25lIGJ5dGUgKi9cbiAgICAgICAgICAgIGJ1ZltpKytdID0gYztcbiAgICAgICAgfSBlbHNlIGlmIChjIDwgMHg4MDApIHtcbiAgICAgICAgICAgIC8qIHR3byBieXRlcyAqL1xuICAgICAgICAgICAgYnVmW2krK10gPSAweEMwIHwgKGMgPj4+IDYpO1xuICAgICAgICAgICAgYnVmW2krK10gPSAweDgwIHwgKGMgJiAweDNmKTtcbiAgICAgICAgfSBlbHNlIG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gICAgICAgICAgIHJlc29sdmUoZS50YXJnZXQucmVzdWx0KTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZWFkZXIub25lcnJvciA9IGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICAgICAgICByZWplY3QoZS50YXJnZXQuZXJyb3IpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlYWRlci5yZWFkQXNBcnJheUJ1ZmZlcihpbnB1dERhdGEpO1xuICAgICAgICB9KTtcbiAgICB9IGVsc2Uge1xuICAgICAgICAvLyBpZiBkYXRhIGlzIGFscmVhZHkgYSBwcm9taXNlLCB0aGlzIGZsYXR0ZW4gaXQuXG4gICAgICAgIHByb21pc2UgPSBleHRlcm5hbC5Qcm9taXNlLnJlc29sdmUoaW5wdXREYXRhKTtcbiAgICB9XG5cbiAgICByZXR1cm4gcHJvbWlzZS50aGVuKGZ1bmN0aW9uKGRhdGEpIHtcbiAgICAgICAgdmFyIGRhdGFUeXBlID0gZXhwb3J0cy5nZXRUeXBlT2YoZGF0YSk7XG5cbiAgICAgICAgaWYgKCFkYXRhVHlwZSkge1xuICAgICAgICAgICAgcmV0dXJuIGV4dGVybmFsLlByb21pc2UucmVqZWN0KFxuICAgICAgICAgICAgICAgIG5ldyBFcnJvcihcIlRoZSBkYXRhIG9mICdcIiArIG5hbWUgKyBcIicgaXMgaW4gYW4gdW5zdXBwb3J0ZWQgZm9ybWF0ICFcIilcbiAgICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gc3BlY2lhbCBjYXNlIDogaXQncyB3YXkgZWFzaWVyIHRvIHdvcmsgd2l0aCBVaW50OEFycmF5IHRoYW4gd2l0aCBBcnJheUJ1ZmZlclxuICAgICAgICBpZiAoZGF0YVR5cGUgPT09IFwiYXJyYXlidWZmZXJcIikge1xuICAgICAgICAgICAgZGF0YSA9IGV4cG9ydHMudHJhbnNmb3JtVG8oXCJ1aW50OGFycmF5XCIsIGRhdGEpO1xuICAgICAgICB9IG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gdGhpcy5yZWFkZXIucmVhZEludCg0KTtcbiAgICAgICAgdGhpcy5jZW50cmFsRGlyUmVjb3Jkc09uVGhpc0Rpc2sgPSB0aGlzLnJlYWRlci5yZWFkSW50KDgpO1xuICAgICAgICB0aGlzLmNlbnRyYWxEaXJSZWNvcmRzID0gdGhpcy5yZWFkZXIucmVhZEludCg4KTtcbiAgICAgICAgdGhpcy5jZW50cmFsRGlyU2l6ZSA9IHRoaXMucmVhZGVyLnJlYWRJbnQoOCk7XG4gICAgICAgIHRoaXMuY2VudHJhbERpck9mZnNldCA9IHRoaXMucmVhZGVyLnJlYWRJbnQoOCk7XG5cbiAgICAgICAgdGhpcy56aXA2NEV4dGVuc2libGVEYXRhID0ge307XG4gICAgICAgIHZhciBleHRyYURhdGFTaXplID0gdGhpcy56aXA2NEVuZE9mQ2VudHJhbFNpemUgLSA0NCxcbiAgICAgICAgICAgIGluZGV4ID0gMCxcbiAgICAgICAgICAgIGV4dHJhRmllbGRJZCxcbiAgICAgICAgICAgIGV4dHJhRmllbGRMZW5ndGgsXG4gICAgICAgICAgICBleHRyYUZpZWxkVmFsdWU7XG4gICAgICAgIHdoaWxlIChpbmRleCA8IGV4dHJhRGF0YVNpemUpIHtcbiAgICAgICAgICAgIGV4dHJhRmllbGRJZCA9IHRoaXMucmVhZGVyLnJlYWRJbnQoMik7XG4gICAgICAgICAgICBleHRyYUZpZWxkTGVuZ3RoID0gdGhpcy5yZWFkZXIucmVhZEludCg0KTtcbiAgICAgICAgICAgIGV4dHJhRmllbGRWYWx1ZSA9IHRoaXMucmVhZGVyLnJlYWREYXRhKGV4dHJhRmllbGRMZW5ndGgpO1xuICAgICAgICAgICAgdGhpcy56aXA2NEV4dGVuc2libGVEYXRhW2V4dHJhRmllbGRJZF0gPSB7XG4gICAgICAgICAgICAgICAgaWQ6IGV4dHJhRmllbGRJZCxcbiAgICAgICAgICAgICAgICBsZW5ndGg6IGV4dHJhRmllbGRMZW5ndGgsXG4gICAgICAgICAgICAgIC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MzJCSVRTKSB7XG4gICAgICAgICAgICB0aGlzLmRpc2tOdW1iZXJTdGFydCA9IGV4dHJhUmVhZGVyLnJlYWRJbnQoNCk7XG4gICAgICAgIH1cbiAgICB9LFxuICAgIC8qKlxuICAgICAqIFJlYWQgdGhlIGNlbnRyYWwgcGFydCBvZiBhIHppcCBmaWxlIGFuZCBhZGQgdGhlIGluZm8gaW4gdGhpcyBvYmplY3QuXG4gICAgICogQHBhcmFtIHtEYXRhUmVhZGVyfSByZWFkZXIgdGhlIHJlYWRlciB0byB1c2UuXG4gICAgICovXG4gICAgcmVhZEV4dHJhRmllbGRzOiBmdW5jdGlvbihyZWFkZXIpIHtcbiAgICAgICAgdmFyIGVuZCA9IHJlYWRlci5pbmRleCArIHRoaXMuZXh0cmFGaWVsZHNMZW5ndGgsXG4gICAgICAgICAgICBleHRyYUZpZWxkSWQsXG4gICAgICAgICAgICBleHRyYUZpZWxkTGVuZ3RoLFxuICAgICAgICAgICAgZXh0cmFGaWVsZFZhbHVlO1xuXG4gICAgICAgIGlmICghdGhpcy5leHRyYUZpZWxkcykge1xuICAgICAgICAgICAgdGhpcy5leHRyYUZpZWxkcyA9IHt9O1xuICAgICAgICB9XG5cbiAgICAgICAgd2hpbGUgKHJlYWRlci5pbmRleCA8IGVuZCkge1xuICAgICAgICAgICAgZXh0cmFGaWVsZElkID0gcmVhZGVyLnJlYWRJbnQoMik7XG4gICAgICAgICAgICBleHRyYUZpZWxkTGVuZ3RoID0gcmVhZGVyLnJlYWRJbnQoMik7XG4gICAgICAgICAgICBleHRyYUZpZWxkVmFsdWUgPSByZWFkZXIucmVhZERhdGEoZXh0cmFGaWVsZExlbmd0aCk7XG5cbiAgICAgICAgICAgIHRoaXMuZXh0cmFGaWVsZHNbZXh0cmFGaWVsZElkXSA9IHtcbiAgICAgICAgICAgICAgICBpZDogZXh0cmFGaWVsZElkLFxuICAgICAgICAgICAgICAgIGxlbmd0aDogZXh0cmFGaWVsZExlbmd0aCxcbiAgICAgICA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nKTtcblxudmFyIHBha28gPSB7fTtcblxuYXNzaWduKHBha28sIGRlZmxhdGUsIGluZmxhdGUsIGNvbnN0YW50cyk7XG5cbm1vZHVsZS5leHBvcnRzID0gcGFrbztcbiIsIid1c2Ugc3RyaWN0JztcblxuXG52YXIgemxpYl9kZWZsYXRlID0gcmVxdWlyZSgnLi96bGliL2RlZmxhdGUnKTtcbnZhciB1dGlscyAgICAgICAgPSByZXF1aXJlKCcuL3V0aWxzL2NvbW1vbicpO1xudmFyIHN0cmluZ3MgICAgICA9IHJlcXVpcmUoJy4vdXRpbHMvc3RyaW5ncycpO1xudmFyIG1zZyAgICAgICAgICA9IHJlcXVpcmUoJy4vemxpYi9tZXNzYWdlcycpO1xudmFyIFpTdHJlYW0gICAgICA9IHJlcXVpcmUoJy4vemxpYi96c3RyZWFtJyk7XG5cbnZhciB0b1N0cmluZyA9IE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmc7XG5cbi8qIFB1YmxpYyBjb25zdGFudHMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG52YXIgWl9OT19GTFVTSCAgICAgID0gMDtcbnZhciBaX0ZJTklTSCAgICAgICAgPSA0O1xuXG52YXIgWl9PSyAgICAgICAgICAgID0gMDtcbnZhciBaX1NUUkVBTV9FTkQgICAgPSAxO1xudmFyIFpfU1lOQ19GTFVTSCAgICA9IDI7XG5cbnZhciBaX0RFRkFVTFRfQ09NUFJFU1NJT04gPSAtMTtcblxudmFyIFpfREVGQVVMVF9TVFJBVEVHWSAgICA9IDA7XG5cbnZhciBaX0RFRkxBVEVEICA9IDg7XG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG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L3ZhciBaX0VSUk5PICAgICAgICAgPSAtMTtcbnZhciBaX1NUUkVBTV9FUlJPUiAgPSAtMjtcbnZhciBaX0RBVEFfRVJST1IgICAgPSAtMztcbi8vdmFyIFpfTUVNX0VSUk9SICAgICA9IC00O1xudmFyIFpfQlVGX0VSUk9SICAgICA9IC01O1xuLy92YXIgWl9WRVJTSU9OX0VSUk9SID0gLTY7XG5cblxuLyogY29tcHJlc3Npb24gbGV2ZWxzICovXG4vL3ZhciBaX05PX0NPTVBSRVNTSU9OICAgICAgPSAwO1xuLy92YXIgWl9CRVNUX1NQRUVEICAgICAgICAgID0gMTtcbi8vdmFyIFpfQkVTVF9DT01QUkVTU0lPTiAgICA9IDk7XG52YXIgWl9ERUZBVUxUX0NPTVBSRVNTSU9OID0gLTE7XG5cblxudmFyIFpfRklMVEVSRUQgICAgICAgICAgICA9IDE7XG52YXIgWl9IVUZGTUFOX09OTFkgICAgICAgID0gMjtcbnZhciBaX1JMRSAgICAgICAgICAgICAgICAgPSAzO1xudmFyIFpfRklYRUQgICAgICAgICAgICAgICA9IDQ7XG52YXIgWl9ERUZBVUxUX1NUUkFURUdZICAgID0gMDtcblxuLyogUG9zc2libGUgdmFsdWVzIG9mIHRoZSBkYXRhX3R5cGUgZmllbGQgKHRob3VnaCBzZWUgaW5mbGF0ZSgpKSAqL1xuLy92YXIgWl9CSU5BUlkgICAgICAgICAgICAgID0gMDtcbi8vdmFyIFpfVEVYVCAgICAgICAgICAgICAgICA9IDE7XG4vL3ZhciBaX0FTQ0lJICAgICAgICAgICAgICAgPSAxOyAvLyA9IFpfVEVYVFxudmFyIFpfVU5LTk9XTiAgICAgICAgICAgICA9IDI7XG5cblxuLyogVGhlIGRlZmxhdGUgY29tcHJlc3Npb24gbWV0aG9kICovXG52YXIgWl9ERUZMQVRFRCAgPSA4O1xuXG4vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0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Dw9IE1BWF9NQVRDSCkge1xuICAgICAgZmlsbF93aW5kb3cocyk7XG4gICAgICBpZiAocy5sb29rYWhlYWQgPD0gTUFYX01BVENIICYmIGZsdXNoID09PSBaX05PX0ZMVVNIKSB7XG4gICAgICAgIHJldHVybiBCU19ORUVEX01PUkU7XG4gICAgICB9XG4gICAgICBpZiAocy5sb29rYWhlYWQgPT09IDApIHsgYnJlYWs7IH0gLyogZmx1c2ggdGhlIGN1cnJlbnQgYmxvY2sgKi9cbiAgICB9XG5cbiAgICAvKiBTZWUgaG93IG1hbnkgdGltZXMgdGhlIHByZXZpb3VzIGJ5dGUgcmVwZWF0cyAqL1xuICAgIHMubWF0Y2hfbGVuZ3RoID0gMDtcbiAgICBpZiAocy5sb29rYWhlYWQgPj0gTUlOX01BVENIICYmIHMuc3Ryc3RhcnQgPiAwKSB7XG4gICAgICBzY2FuID0gcy5zdHJzdGFydCAtIDE7XG4gICAgICBwcmV2ID0gX3dpbltzY2FuXTtcbiAgICAgIGlmIChwcmV2ID09PSBfd2luWysrc2Nhbl0gJiYgcHJldiA9PT0gX3dpblsrK3NjYW5dICYmIHByZXYgPT09IF93aW5bKytzY2FuXSkge1xuICAgICAgICBzdHJlbmQgPSBzLnN0cnN0YXJ0ICsgTUFYX01BVENIO1xuICAgICAgICBkbyB7XG4gICAgICAgICAgLypqc2hpbnQgbm9lbXB0eTpmYWxzZSovXG4gICAgICAgIH0gd2hpbGUgKHByZXYgPT09IF93aW5bKytzY2FuXSAmJiBwcmV2ID09PSBfd2luWysrc2Nhbl0gJiZcbiAgICAgICAgICAgICAgICAgcHJldiA9PT0gX3dpblsrK3NjYW5dICYmIHByZXYgPT09IF93aW5bKytzY2FuXSAmJlxuICAgICAgICAgICAgICAgICBwcmV2ID09PSBfd2luWysrc2Nhbl0gJiYgcHJldiA9PT0gX3dpblsrK3NjYW5dICYmXG4gICAgICAgICAgICAgICAgIHByZXYgPT09IF93aW5bKytzY2FuXSAmJiBwcmV2ID09PSBfd2luW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G4gIGlmIChzLnN0YXR1cyA9PT0gSU5JVF9TVEFURSkge1xuXG4gICAgaWYgKHMud3JhcCA9PT0gMikgeyAvLyBHWklQIGhlYWRlclxuICAgICAgc3RybS5hZGxlciA9IDA7ICAvL2NyYzMyKDBMLCBaX05VTEwsIDApO1xuICAgICAgcHV0X2J5dGUocywgMzEpO1xuICAgICAgcHV0X2J5dGUocywgMTM5KTtcbiAgICAgIHB1dF9ieXRlKHMsIDgpO1xuICAgICAgaWYgKCFzLmd6aGVhZCkgeyAvLyBzLT5nemhlYWQgPT0gWl9OVUxMXG4gICAgICAgIHB1dF9ieXRlKHMsIDApO1xuICAgICAgICBwdXRfYnl0ZShzLCAwKTtcbiAgICAgICAgcHV0X2J5dGUocywgMCk7XG4gICAgICAgIHB1dF9ieXRlKHMsIDApO1xuICAgICAgICBwdXRfYnl0ZShzLCAwKTtcbiAgICAgICAgcHV0X2J5dGUocywgcy5sZXZlbCA9PT0gOSA/IDIgOlxuICAgICAgICAgICAgICAgICAgICAocy5zdHJhdGVneSA+PSBaX0hVRkZNQU5fT05MWSB8fCBzLmxldmVsIDwgMiA/XG4gICAgICAgICAgICAgICAgICAgICA0IDogMCkpO1xuICAgICAgICBwdXRfYnl0ZShzLCBPU19DT0RFKTtcbiAgICAgICAgcy5zdGF0dXMgPSBCVVNZX1NUQVRFO1xuICAgICAgfVxuICAgICAgZWxzZSB7XG4gICAgICAgIHB1dF9ieXRlKHMsIChzLmd6aGVhZC50ZXh0ID8gMSA6IDApICtcbiAgICAgICAgICAgICAgICAgICAgKHMuZ3poZWFkLmhjcmMgPyAyIDogMCkgK1xuICAgICAgICAgICAgICAgICAgICAoIXMuZ3poZWFkLmV4dHJhID8gMCA6IDQpICtcbiAgICAgICAgICAgICAgICAgICAgKCFzLmd6aGVhZC5uYW1lID8gMCA6IDgpICtcbiAgICAgICAgICAgICAgICAgICAgKCFzLmd6aGVhZC5jb21tZW50ID8gMCA6IDE2KVxuICAgICAgICAgICAgICAgICk7XG4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AgICBlbHNlIHtcbiAgICAgIHMuc3RhdHVzID0gTkFNRV9TVEFURTtcbiAgICB9XG4gIH1cbiAgaWYgKHMuc3RhdHVzID09PSBOQU1FX1NUQVRFKSB7XG4gICAgaWYgKHMuZ3poZWFkLm5hbWUvKiAhPSBaX05VTEwqLykge1xuICAgICAgYmVnID0gcy5wZW5kaW5nOyAgLyogc3RhcnQgb2YgYnl0ZXMgdG8gdXBkYXRlIGNyYyAqL1xuICAgICAgLy9pbnQgdmFsO1xuXG4gICAgICBkbyB7XG4gICAgICAgIGlmIChzLnBlbmRpbmcgPT09IHMucGVuZGluZ19idWZfc2l6ZSkge1xuICAgICAgICAgIGlmIChzLmd6aGVhZC5oY3JjICYmIHMucGVuZGluZyA+IGJlZykge1xuICAgICAgICAgICAgc3RybS5hZGxlciA9IGNyYzMyKHN0cm0uYWRsZXIsIHMucGVuZGluZ19idWYsIHMucGVuZGluZyAtIGJlZywgYmVnKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgZmx1c2hfcGVuZGluZyhzdHJtKTtcbiAgICAgICAgICBiZWcgPSBzLnBlbmRpbmc7XG4gICAgICAgICAgaWYgKHMucGVuZGluZyA9PT0gcy5wZW5kaW5nX2J1Zl9zaXplKSB7XG4gICAgICAgICAgICB2YWwgPSAxO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIEpTIHNwZWNpZmljOiBsaXR0bGUgbWFnaWMgdG8gYWRkIHplcm8gdGVybWluYXRvciB0byBlbmQgb2Ygc3RyaW5nXG4gICAgICAgIGlmIChzLmd6aW5kZXggPCBzLmd6aGVhZC5uYW1lLmxlbmd0aCkge1xuICAgICAgICAgIHZhbCA9IHMuZ3poZWFkLm5hbWUuY2hhckNvZGVBdChzLmd6aW5kZXgrKykgJiAweGZmO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHZhbCA9IDA7XG4gICAgICAgIH1cbiAgICAgICAgcHV0X2J5dG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gICAgICAgICAgICAgLyogdmFsaWQgYnl0ZXMgaW4gdGhlIHdpbmRvdyAqL1xuICB2YXIgd25leHQ7ICAgICAgICAgICAgICAgICAgLyogd2luZG93IHdyaXRlIGluZGV4ICovXG4gIC8vIFVzZSBgc193aW5kb3dgIGluc3RlYWQgYHdpbmRvd2AsIGF2b2lkIGNvbmZsaWN0IHdpdGggaW5zdHJ1bWVudGF0aW9uIHRvb2xzXG4gIHZhciBzX3dpbmRvdzsgICAgICAgICAgICAgICAvKiBhbGxvY2F0ZWQgc2xpZGluZyB3aW5kb3csIGlmIHdzaXplICE9IDAgKi9cbiAgdmFyIGhvbGQ7ICAgICAgICAgICAgICAgICAgIC8qIGxvY2FsIHN0cm0uaG9sZCAqL1xuICB2YXIgYml0czsgICAgICAgICAgICAgICAgICAgLyogbG9jYWwgc3RybS5iaXRzICovXG4gIHZhciBsY29kZTsgICAgICAgICAgICAgICAgICAvKiBsb2NhbCBzdHJtLmxlbmNvZGUgKi9cbiAgdmFyIGRjb2RlOyAgICAgICAgICAgICAgICAgIC8qIGxvY2FsIHN0cm0uZGlzdGNvZGUgKi9cbiAgdmFyIGxtYXNrOyAgICAgICAgICAgICAgICAgIC8qIG1hc2sgZm9yIGZpcnN0IGxldmVsIG9mIGxlbmd0aCBjb2RlcyAqL1xuICB2YXIgZG1hc2s7ICAgICAgICAgICAgICAgICAgLyogbWFzayBmb3IgZmlyc3QgbGV2ZWwgb2YgZGlzdGFuY2UgY29kZXMgKi9cbiAgdmFyIGhlcmU7ICAgICAgICAgICAgICAgICAgIC8qIHJldHJpZXZlZCB0YWJsZSBlbnRyeSAqL1xuICB2YXIgb3A7ICAgICAgICAgICAgICAgICAgICAgLyogY29kZSBiaXRzLCBvcGVyYXRpb24sIGV4dHJhIGJpdHMsIG9yICovXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAgd2luZG93IHBvc2l0aW9uLCB3aW5kb3cgYnl0ZXMgdG8gY29weSAqL1xuICB2YXIgbGVu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V0cHV0W19vdXQrK10gPSBoZXJlICYgMHhmZmZmLypoZXJlLnZhbCovO1xuICAgICAgfVxuICAgICAgZWxzZSBpZiAob3AgJiAxNikgeyAgICAgICAgICAgICAgICAgICAgIC8qIGxlbmd0aCBiYXNlICovXG4gICAgICAgIGxlbiA9IGhlcmUgJiAweGZmZmYvKmhlcmUudmFsKi87XG4gICAgICAgIG9wICY9IDE1OyAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIG51bWJlciBvZiBleHRyYSBiaXRzICovXG4gICAgICAgIGlmIChvcCkge1xuICAgICAgICAgIGlmIChiaXRzIDwgb3ApIHtcbiAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbX2luKytdIDw8IGJpdHM7XG4gICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgfVxuICAgICAgICAgIGxlbiArPSBob2xkICYgKCgxIDw8IG9wKSAtIDEpO1xuICAgICAgICAgIGhvbGQgPj4+PSBvcDtcbiAgICAgICAgICBiaXRzIC09IG9wO1xuICAgICAgICB9XG4gICAgICAgIC8vVHJhY2V2digoc3RkZXJyLCBcImluZmxhdGU6ICAgICAgICAgbGVuZ3RoICV1XFxuXCIsIGxlbikpO1xuICAgICAgICBpZiAoYml0cyA8IDE1KSB7XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtfaW4rK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtfaW4rK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgIH1cbiAgICAgICAgaGVyZSA9IGRjb2RlW2hvbGQgJiBkbWFza107XG5cbiAgICAgICAgZG9kaXN0OlxuICAgICAgICBmb3IgKDs7KSB7IC8vIGdvdG8gZW11bGF0aW9uXG4gICAgICAgICAgb3AgPSBoZXJlID4+PiAyNC8qaGVyZS5iaXRzKi87XG4gICAgICAgICAgaG9sZCA+Pj49IG9wO1xuICAgICAgICAgIGJpdHMgLT0gb3A7XG4gICAgICAgICAgb3AgPSAoaGVyZSA+Pj4gMTYpICYgMHhmZi8qaGVyZS5vcCovO1xuXG4gICAgICAgICAgaWYgKG9wICYgMTYpIHsgICAgICAgICAgICAgICAgICAgICAgLyogZGlzdGFuY2UgYmFzZSAqL1xuICAgICAgICAgICAgZGlzdCA9IGhlcmUgJiAweGZmZmYvKmhlcmUudmFsKi87XG4gICAgICAgICAgICBvcCAmPSAxNTsgICAgICAgICAgICAgICAgICAgICAgIC8qIG51bWJlciBvZiBleHRyYSBiaXRzICovXG4gICAgICAgICAgICBpZiAoYml0cyA8IG9wKSB7XG4gICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbX2luKytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgICAgaWYgKGJpdHMgPCBvcCkge1xuICAgICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbX2luKytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkaXN0ICs9IGhvbGQgJiAoKDEgPDwgb3ApIC0gMSk7XG4vLyNpZmRlZiBJTkZMQVRFX1NUUklDVFxuICAgICAgICAgICAgaWYgKGRpc3QgPiBkbWF4KSB7XG4gICAgICAgICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgZGlzdGFuY2UgdG9vIGZhciBiYWNrJztcbiAgICAgICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICAgICAgYnJlYWsgdG9wO1xuICAgICAgICAgICAgfVxuLy8jZW5kaWZcbiAgICAgICAgICAgIGhvbGQgPj4+PSBvcDtcbiAgICAgICAgICAgIGJpdHMgLT0gb3A7XG4gICAgICAgICAgICAvL1RyYWNldnYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgICAgICAgIGRpc3RhbmNlICV1XFxuXCIsIGRpc3QpKTtcbiAgICAgICAgICAgIG9wID0gX291dCAtIGJlZzsgICAgICAgICAgICAgICAgLyogbWF4IGRpc3RhbmNlIGluIG91dHB1dCAqL1xuICAgICAgICAgICAgaWYgKGRpc3QgPiBvcCkgeyAgICAgICAgICAgICAgICAvKiBzZWUgaWYgY29weSBmcm9tIHdpbmRvdyAqL1xuICAgICAgICAgICAgICBvcCA9IGRpc3QgLSBvcDsgICAgICAgICAgICAgICAvKiBkaXN0YW5jZSBiYWNrIGluIHdpbmRvdyAqL1xuICAgICAgICAgICAgICBpZiAob3AgPiB3aGF2ZSkge1xuICAgICAgICAgICAgICAgIGlmIChzdGF0ZS5zYW5lKSB7XG4gICAgICAgICAgICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGRpc3RhbmNlIHRvbyBmYXIgYmFjayc7XG4gICAgICAgICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgICAgICAgYnJlYWsgdG9wO1xuICAgICAgICAgICAgICAgIH1cblxuLy8gKCEpIFRoaXMgYmxvY2sgaXMgZGlzYWJsZWQgaW4gemxpYiBkZWZhaWx0cyxcbi8vIGRvbid0IGVuYWJsZSBpdCBmb3IgYmluYXJ5IGNvbXBhdGliaWxpdHlcbi8vI2lmZGVmIElORkxBVEVfQUxMT1dfSU5WQUxJRF9ESVNUQU5DRV9UT09GQVJfQVJSUlxuLy8gICAgICAgICAgICAgICAgaWYgKGxlbiA8PSBvcCAtIHdoYXZlKSB7XG4vLyAgICAgICAgICAgICAgICAgIGRvIHtcbi8vICAgICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IDA7XG4vLyAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tbGVuKTtcbi8vICAgICAgICAgICAgICAgICAgY29udGludWUgdG9wO1xuLy8gICAgICAgICAgICAgICAgfVxuLy8gICAgICAgICAgICAgICAgbGVuIC09IG9wIC0gd2hhdmU7XG4vLyAgICAgICAgICAgICAgICBkbyB7XG4vLyAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gMDtcbi8vICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tb3AgPiB3aGF2ZSk7XG4vLyAgICAgICAgICAgICAgICBpZiAob3AgPT09IDApIHtcbi8vICAgICAgICAgICAgICAgICAgZnJvbSA9IF9vdXQgLSBkaXN0O1xuLy8gICAgICAgICAgICAgICAgICBkbyB7XG4vLyAgICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBvdXRwdXRbZnJvbSsrXTtcbi8vICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1sZW4pO1xuLy8gICAgICAgICAgICAgICAgICBjb250aW51ZSB0b3A7XG4vLyAgICAgICAgICAgICAgICB9XG4vLyNlbmRpZlxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGZyb20gPSAwOyAvLyB3aW5kb3cgaW5kZXhcbiAgICAgICAgICAgICAgZnJvbV9zb3VyY2UgPSBzX3dpbmRvdztcbiAgICAgICAgICAgICAgaWYgKHduZXh0ID09PSAwKSB7ICAgICAgICAgICAvKiB2ZXJ5IGNvbW1vbiBjYXNlICovXG4gICAgICAgICAgICAgICAgZnJvbSArPSB3c2l6ZSAtIG9wO1xuICAgICAgICAgICAgICAgIGlmIChvcCA8IGxlbikgeyAgICAgICAgIC8qIHNvbWUgZnJvbSB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgICAgIGxlbiAtPSBvcDtcbiAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBzX3dpbmRvd1tmcm9tKytdO1xuICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1vcCk7XG4gICAgICAgICAgICAgICAgICBmcm9tID0gX291dCAtIGRpc3Q7ICAvKiByZXN0IGZyb20gb3V0cHV0ICovXG4gICAgICAgICAgICAgICAgICBmcm9tX3NvdXJjZSA9IG91dHB1dDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZWxzZSBpZiAod25leHQgPCBvcCkgeyAgICAgIC8qIHdyYXAgYXJvdW5kIHdpbmRvdyAqL1xuICAgICAgICAgICAgICAgIGZyb20gKz0gd3NpemUgKyB3bmV4dCAtIG9wO1xuICAgICAgICAgICAgICAgIG9wIC09IHduZXh0O1xuICAgICAgICAgICAgICAgIGlmIChvcCA8IGxlbikgeyAgICAgICAgIC8qIHNvbWUgZnJvbSBlbmQgb2Ygd2luZG93ICovXG4gICAgICAgICAgICAgICAgICBsZW4gLT0gb3A7XG4gICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gc193aW5kb3dbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tb3ApO1xuICAgICAgICAgICAgICAgICAgZnJvbSA9IDA7XG4gICAgICAgICAgICAgICAgICBpZiAod25leHQgPCBsZW4pIHsgIC8qIHNvbWUgZnJvbSBzdGFydCBvZiB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgICAgICAgb3AgPSB3bmV4dDtcbiAgICAgICAgICAgICAgICAgICAgbGVuIC09IG9wO1xuICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBzX3dpbmRvd1tmcm9tKytdO1xuICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgtLW9wKTtcbiAgICAgICAgICAgICAgICAgICAgZnJvbSA9IF9vdXQgLSBkaXN0OyAgICAgIC8qIHJlc3QgZnJvbSBvdXRwdXQgKi9cbiAgICAgICAgICAgICAgICAgICAgZnJvbV9zb3VyY2UgPSBvdXRwdXQ7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGVsc2UgeyAgICAgICAgICAgICAgICAgICAgICAvKiBjb250aWd1b3VzIGluIHdpbmRvdyAqL1xuICAgICAgICAgICAgICAgIGZyb20gKz0gd25leHQgLSBvcDtcbiAgICAgICAgICAgICAgICBpZiAob3AgPCBsZW4pIHsgICAgICAgICAvKiBzb21lIGZyb20gd2luZG93ICovXG4gICAgICAgICAgICAgICAgICBsZW4gLT0gb3A7XG4gICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gc193aW5kb3dbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tb3ApO1xuICAgICAgICAgICAgICAgICAgZnJvbSA9IF9vdXQgLSBkaXN0OyAgLyogcmVzdCBmcm9tIG91dHB1dCAqL1xuICAgICAgICAgICAgICAgICAgZnJvbV9zb3VyY2UgPSBvdXRwdXQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHdoaWxlIChsZW4gPiAyKSB7XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBmcm9tX3NvdXJjZVtmcm9tKytdO1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gZnJvbV9zb3VyY2VbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IGZyb21fc291cmNlW2Zyb20rK107XG4gICAgICAgICAgICAgICAgbGVuIC09IDM7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKGxlbikge1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gZnJvbV9zb3VyY2VbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBpZiAobGVuID4gMSkge1xuICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBmcm9tX3NvdXJjZVtmcm9tKytdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgIGZyb20gPSBfb3V0IC0gZGlzdDsgICAgICAgICAgLyogY29weSBkaXJlY3QgZnJvbSBvdXRwdXQgKi9cbiAgICAgICAgICAgICAgZG8geyAgICAgICAgICAgICAgICAgICAgICAgIC8qIG1pbmltdW0gbGVuZ3RoIGlzIHRocmVlICovXG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBvdXRwdXRbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IG91dHB1dFtmcm9tKytdO1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gb3V0cHV0W2Zyb20rK107XG4gICAgICAgICAgICAgICAgbGVuIC09IDM7XG4gICAgICAgICAgICAgIH0gd2hpbGUgKGxlbiA+IDIpO1xuICAgICAgICAgICAgICBpZiAobGVuKSB7XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBvdXRwdXRbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBpZiAobGVuID4gMSkge1xuICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBvdXRwdXRbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSBpZiAoKG9wICYgNjQpID09PSAwKSB7ICAgICAgICAgIC8qIDJuZCBsZXZlbCBkaXN0YW5jZSBjb2RlICovXG4gICAgICAgICAgICBoZXJlID0gZGNvZGVbKGhlcmUgJiAweGZmZmYpLypoZXJlLnZhbCovICsgKGhvbGQgJiAoKDEgPDwgb3ApIC0gMSkpXTtcbiAgICAgICAgICAgIGNvbnRpbnVlIGRvZGlzdDtcbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGRpc3RhbmNlIGNvZGUnO1xuICAgICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICAg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mb3IgZGV0YWlscyAqL1xuLy92YXIgWl9OT19GTFVTSCAgICAgID0gMDtcbi8vdmFyIFpfUEFSVElBTF9GTFVTSCA9IDE7XG4vL3ZhciBaX1NZTkNfRkxVU0ggICAgPSAyO1xuLy92YXIgWl9GVUxMX0ZMVVNIICAgID0gMztcbnZhciBaX0ZJTklTSCAgICAgICAgPSA0O1xudmFyIFpfQkxPQ0sgICAgICAgICA9IDU7XG52YXIgWl9UUkVFUyAgICAgICAgID0gNjtcblxuXG4vKiBSZXR1cm4gY29kZXMgZm9yIHRoZSBjb21wcmVzc2lvbi9kZWNvbXByZXNzaW9uIGZ1bmN0aW9ucy4gTmVnYXRpdmUgdmFsdWVzXG4gKiBhcmUgZXJyb3JzLCBwb3NpdGl2ZSB2YWx1ZXMgYXJlIHVzZWQgZm9yIHNwZWNpYWwgYnV0IG5vcm1hbCBldmVudHMuXG4gKi9cbnZhciBaX09LICAgICAgICAgICAgPSAwO1xudmFyIFpfU1RSRUFNX0VORCAgICA9IDE7XG52YXIgWl9ORUVEX0RJQ1QgICAgID0gMjtcbi8vdmFyIFpfRVJSTk8gICAgICAgICA9IC0xO1xudmFyIFpfU1RSRUFNX0VSUk9SICA9IC0yO1xudmFyIFpfREFUQV9FUlJPUiAgICA9IC0zO1xudmFyIFpfTUVNX0VSUk9SICAgICA9IC00O1xudmFyIFpfQlVGX0VSUk9SICAgICA9IC01O1xuLy92YXIgWl9WRVJTSU9OX0VSUk9SID0gLTY7XG5cbi8qIFRoZSBkZWZsYXRlIGNvbXByZXNzaW9uIG1ldGhvZCAqL1xudmFyIFpfREVGTEFURUQgID0gODtcblxuXG4vKiBTVEFURVMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cblxuXG52YXIgICAgS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udmFyICAgICAgICBUWVBFRE8gPSAxMzsgICAgLyogaTogc2FtZSwgYnV0IHNraXAgY2hlY2sgdG8gZXhpdCBpbmZsYXRlIG9uIG5ldyBibG9jayAqL1xudmFyICAgICAgICBTVE9SRUQgPSAxNDsgICAgLyogaTogd2FpdGluZyBmb3Igc3RvcmVkIHNpemUgKGxlbmd0aCBhbmQgY29tcGxlbWVudCkgKi9cbnZhciAgICAgICAgQ09QWV8gPSAxNTsgICAgIC8qIGkvbzogc2FtZSBhcyBDT1BZIGJlbG93LCBidXQgb25seSBmaXJzdCB0aW1lIGluICovXG52YXIgICAgICAgIENPUFkgPSAxNjsgICAgICAvKiBpL286IHdhaXRpbmcgZm9yIGlucHV0IG9yIG91dHB1dCB0byBjb3B5IHN0b3JlZCBibG9jayAqL1xudmFyICAgICAgICBUQUJMRSA9IDE3OyAgICAgLyogaTogd2FpdGluZyBmb3IgZHluYW1pYyBibG9jayB0YWJsZSBsZW5ndGhzICovXG52YXIgICAgICAgIExFTkxFTlMgPSAxODsgICAvKiBpOiB3YWl0aW5nIGZvciBjb2RlIGxlbmd0aCBjb2RlIGxlbmd0aHMgKi9cbnZhciAgICAgICAgQ09ERUxFTlMgPSAxOTsgIC8qIGk6IHdhaXRpbmcgZm9yIGxlbmd0aC9saXQgYW5kIGRpc3RhbmNlIGNvZGUgbGVuZ3RocyAqL1xudmFyICAgICAgICAgICAgTEVOXyA9IDIwOyAgICAgIC8qIGk6IHNhbWUgYXMgTEVOIGJlbG93LCBidXQgb25seSBmaXJzdCB0aW1lIGluICovXG52YXIgICAgICAgICAgICBMRU4gPSAyMTsgICAgICAgLyogaTogd2FpdGluZyBmb3IgbGVuZ3RoL2xpdC9lb2IgY29kZSAqL1xudmFyICAgICAgICAgICAgTEVORVhUID0gMjI7ICAgIC8qIGk6IHdhaXRpbmcgZm9yIGxlbmd0aCBleHRyYSBiaXRzICovXG52YXIgICAgICAgICAgICBESVNUID0gMjM7ICAgICAgLyogaTogd2FpdGluZyBmb3IgZGlzdGFuY2UgY29kZSAqL1xudmFyICAgICAgICAgICAgRElTVEVYVCA9IDI0OyAgIC8qIGk6IHdhaXRpbmcgZm9yIGRpc3RhbmNlIGV4dHJhIGJpdHMgKi9cbnZhciAgICAgICAgICAgIE1BVENIID0gMjU7ICAgICAvKiBvOiB3YWl0aW5nIGZvciBvdXRwdXQgc3BhY2UgdG8gY29weSBzdHJpbmcgKi9cbnZhciAgICAgICAgICAgIExJVCA9IDI2OyAgICAgICAvKiBvOiB3YWl0aW5nIGZvciBvdXRwdXQgc3BhY2UgdG8gd3JpdGUgbGl0ZXJhbCAqL1xudmFyICAgIENIRUNLID0gMjc7ICAgICAvKiBpOiB3YWl0aW5nIGZvciAzMi1iaXQgY2hlY2sgdmFsdWUgKi9cbnZhciAgICBMRU5HVEggPSAyODsgICAgLyogaTogd2FpdGluZyBmb3IgMzItYml0IGxlbmd0aCAoZ3ppcCkgKi9cbnZhciAgICBET05FID0gMjk7ICAgICAgLyogZmluaXNoZWQgY2hlY2ssIGRvbmUgLS0gcmVtYWluIGhlcmUgdW50aWwgcmVzZXQgKi9cbnZhciAgICBCQUQgPSAzMDsgICAgICAgLyogZ290IGEgZGF0YSBlcnJvciAtLSByZW1haW4gaGVyZSB1bnRpbCByZXNldCAqL1xudmFyICAgIE1FTSA9IDMxOyAgICAgICAvKiBnb3QgYW4gaW5mbGF0ZSgpIG1lbW9yeSBlcnJvciAtLSByZW1haW4gaGVyZSB1bnRpbCByZXNldCAqL1xudmFyICAgIFNZTkMgPSAzMjsgICAgICAvKiBsb29raW5nIGZvciBzeW5jaHJvbml6YXRpb24gYnl0ZXMgdG8gcmVzdGFydCBpbmZsYXRlKCkgKi9cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cblxuXG5cbnZhciBFTk9VR0hfTEVOUyA9IDg1MjtcbnZhciBFTk9VR0hfRElTVFMgPSA1OTI7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AgICAgc3RybS5tc2cgPSAndW5rbm93biBjb21wcmVzc2lvbiBtZXRob2QnO1xuICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICAgIC8vLS0tIERST1BCSVRTKDQpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gNDtcbiAgICAgIGJpdHMgLT0gNDtcbiAgICAgIC8vLS0tLy9cbiAgICAgIGxlbiA9IChob2xkICYgMHgwZikvKkJJVFMoNCkqLyArIDg7XG4gICAgICBpZiAoc3RhdGUud2JpdHMgPT09IDApIHtcbiAgICAgICAgc3RhdGUud2JpdHMgPSBsZW47XG4gICAgICB9XG4gICAgICBlbHNlIGlmIChsZW4gPiBzdGF0ZS53Yml0cykge1xuICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIHdpbmRvdyBzaXplJztcbiAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBzdGF0ZS5kbWF4ID0gMSA8PCBsZW47XG4gICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgemxpYiBoZWFkZXIgb2tcXG5cIikpO1xuICAgICAgc3RybS5hZGxlciA9IHN0YXRlLmNoZWNrID0gMS8qYWRsZXIzMigwTCwgWl9OVUxMLCAwKSovO1xuICAgICAgc3RhdGUubW9kZSA9IGhvbGQgJiAweDIwMCA/IERJQ1RJRCA6IFRZUEU7XG4gICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgaG9sZCA9IDA7XG4gICAgICBiaXRzID0gMDtcbiAgICAgIC8vPT09Ly9cbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgRkxBR1M6XG4gICAgICAvLz09PSBORUVEQklUUygxNik7ICovXG4gICAgICB3aGlsZSAoYml0cyA8IDE2KSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICBoYXZlLS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YXNlIFRJTUU6XG4gICAgICAvLz09PSBORUVEQklUUygzMik7ICovXG4gICAgICB3aGlsZSAoYml0cyA8IDMyKSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICBoYXZlLS07XG4gICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICBiaXRzICs9IDg7XG4gICAgICB9XG4gICAgICAvLz09PS8vXG4gICAgICBpZiAoc3RhdGUuaGVhZCkge1xuICAgICAgICBzdGF0ZS5oZWFkLnRpbWUgPSBob2xkO1xuICAgICAgfVxuICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwMjAwKSB7XG4gICAgICAgIC8vPT09IENSQzQoc3RhdGUuY2hlY2ssIGhvbGQpXG4gICAgICAgIGhidWZbMF0gPSBob2xkICYgMHhmZjtcbiAgICAgICAgaGJ1ZlsxXSA9IChob2xkID4+PiA4KSAmIDB4ZmY7XG4gICAgICAgIGhidWZbMl0gPSAoaG9sZCA+Pj4gMTYpICYgMHhmZjtcbiAgICAgICAgaGJ1ZlszXSA9IChob2xkID4+PiAyNCkgJiAweGZmO1xuICAgICAgICBzdGF0ZS5jaGVjayA9IGNyYzMyKHN0YXRlLmNoZWNrLCBoYnVmLCA0LCAwKTtcbiAgICAgICAgLy89PT1cbiAgICAgIH1cbiAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICBob2xkID0gMDtcbiAgICAgIGJpdHMgPSAwO1xuICAgICAgLy89PT0vL1xuICAgICAgc3RhdGUubW9kZSA9IE9TO1xuICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgIGNhc2UgT1M6XG4gICAgICAvLz09PSBORUVEQklUUygxNik7ICovXG4gICAgICB3aGlsZSAoYml0cyA8IDE2KSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICBoYXZlLS07XG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xuICAgICAgICAgICAgICAvLyBVc2UgdW50eXBlZCBhcnJheSBmb3IgbW9yZSBjb252ZW5pZW5kIHByb2Nlc3NpbmcgbGF0ZXJcbiAgICAgICAgICAgICAgc3RhdGUuaGVhZC5leHRyYSA9IG5ldyBBcnJheShzdGF0ZS5oZWFkLmV4dHJhX2xlbik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB1dGlscy5hcnJheVNldChcbiAgICAgICAgICAgICAgc3RhdGUuaGVhZC5leHRyYSxcbiAgICAgICAgICAgICAgaW5wdXQsXG4gICAgICAgICAgICAgIG5leHQsXG4gICAgICAgICAgICAgIC8vIGV4dHJhIGZpZWxkIGlzIGxpbWl0ZWQgdG8gNjU1MzYgYnl0ZXNcbiAgICAgICAgICAgICAgLy8gLSBubyBuZWVkIGZvciBhZGRpdGlvbmFsIHNpemUgY2hlY2tcbiAgICAgICAgICAgICAgY29weSxcbiAgICAgICAgICAgICAgLypsZW4gKyBjb3B5ID4gc3RhdGUuaGVhZC5leHRyYV9tYXggLSBsZW4gPyBzdGF0ZS5oZWFkLmV4dHJhX21heCA6IGNvcHksKi9cbiAgICAgICAgICAgICAgbGVuXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgLy96bWVtY3B5KHN0YXRlLmhlYWQuZXh0cmEgKyBsZW4sIG5leHQsXG4gICAgICAgICAgICAvLyAgICAgICAgbGVuICsgY29weSA+IHN0YXRlLmhlYWQuZXh0cmFfbWF4ID9cbiAgICAgICAgICAgIC8vICAgICAgICBzdGF0ZS5oZWFkLmV4dHJhX21heCAtIGxlbiA6IGNvcHkpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoc3RhdGUuZmxhZ3MgJiAweDAyMDApIHtcbiAgICAgICAgICAgIHN0YXRlLmNoZWNrID0gY3JjMzIoc3RhdGUuY2hlY2ssIGlucHV0LCBjb3B5LCBuZXh0KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaGF2ZSAtPSBjb3B5O1xuICAgICAgICAgI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CArPSBjb3B5O1xuICAgICAgICBpZiAobGVuKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgfVxuICAgICAgZWxzZSBpZiAoc3RhdGUuaGVhZCkge1xuICAgICAgICBzdGF0ZS5oZWFkLmNvbW1lbnQgPSBudWxsO1xuICAgICAgfVxuICAgICAgc3RhdGUubW9kZSA9IEhDUkM7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBIQ1JDOlxuICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwMjAwKSB7XG4gICAgICAgIC8vPT09IE5FRURCSVRTKDE2KTsgKi9cbiAgICAgICAgd2hpbGUgKGJpdHMgPCAxNikge1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgIH1cbiAgICAgICAgLy89PT0vL1xuICAgICAgICBpZiAoaG9sZCAhPT0gKHN0YXRlLmNoZWNrICYgMHhmZmZmKSkge1xuICAgICAgICAgIHN0cm0ubXNnID0gJ2hlYWRlciBjcmMgbWlzbWF0Y2gnO1xuICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgLy89PT0gSU5JVEJJVFMoKTtcbiAgICAgICAgaG9sZCA9IDA7XG4gICAgICAgIGJpdHMgPSAwO1xuICAgICAgICAvLz09PS8vXG4gICAgICB9XG4gICAgICBpZiAoc3RhdGUuaGVhZCkge1xuICAgICAgICBzdGF0ZS5oZWFkLmhjcmMgPSAoKHN0YXRlLmZsYWdzID4+IDkpICYgMSk7XG4gICAgICAgIHN0YXRlLmhlYWQuZG9uZSA9IHRydWU7XG4gICAgICB9XG4gICAgICBzdHJtLmFkbGVyID0gc3RhdGUuY2h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ubW9kZSA9IFRZUEU7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBUWVBFOlxuICAgICAgaWYgKGZsdXNoID09PSBaX0JMT0NLIHx8IGZsdXNoID09PSBaX1RSRUVTKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgIGNhc2UgVFlQRURPOlxuICAgICAgaWYgKHN0YXRlLmxhc3QpIHtcbiAgICAgICAgLy8tLS0gQllURUJJVFMoKSAtLS0vL1xuICAgICAgICBob2xkID4+Pj0gYml0cyAmIDc7XG4gICAgICAgIGJpdHMgLT0gYml0cyAmIDc7XG4gICAgICAgIC8vLS0tLy9cbiAgICAgICAgc3RhdGUubW9kZSA9IENIRUNLO1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICAgIC8vPT09IE5FRURCSVRTKDMpOyAqL1xuICAgICAgd2hpbGUgKGJpdHMgPCAzKSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICBoYXZlLS07XG4gICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICBiaXRzICs9IDg7XG4gICAgICB9XG4gICAgICAvLz09PS8vXG4gICAgICBzdGF0ZS5sYXN0ID0gKGhvbGQgJiAweDAxKS8qQklUUygxKSovO1xuICAgICAgLy8tLS0gRFJPUEJJVFMoMSkgLS0tLy9cbiAgICAgIGhvbGQgPj4+PSAxO1xuICAgICAgYml0cyAtPSAxO1xuICAgICAgLy8tLS0vL1xuXG4gICAgICBzd2l0Y2ggKChob2xkICYgMHgwMykvKkJJVFMoMikqLykge1xuICAgICAgY2FzZSAwOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogc3RvcmVkIGJsb2NrICovXG4gICAgICAgIC8vVHJhY2V2KChzdGRlcnIsIFwiaW5mbGF0ZTogICAgIHN0b3JlZCBibG9j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iAgICAgICAgICAvLy0tLSBQVUxMQllURSgpIC0tLS8vXG4gICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgaGF2ZS0tO1xuICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAvLy0tLS8vXG4gICAgICAgIH1cbiAgICAgICAgaWYgKGhlcmVfdmFsIDwgMTYpIHtcbiAgICAgICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICAgICAgaG9sZCA+Pj49IGhlcmVfYml0cztcbiAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgc3RhdGUubGVuc1tzdGF0ZS5oYXZlKytdID0gaGVyZV92YWw7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgaWYgKGhlcmVfdmFsID09PSAxNikge1xuICAgICAgICAgICAgLy89PT0gTkVFREJJVFMoaGVyZS5iaXRzICsgMik7XG4gICAgICAgICAgICBuID0gaGVyZV9iaXRzICsgMjtcbiAgICAgICAgICAgIHdoaWxlIChiaXRzIDwgbikge1xuICAgICAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICAgICAgaGF2ZS0tO1xuICAgICAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy89PT0vL1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoaGVyZS5iaXRzKSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IGhlcmVfYml0cztcbiAgICAgICAgICAgIGJpdHMgLT0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgICAgaWYgKHN0YXRlLmhhdmUgPT09IDApIHtcbiAgICAgICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBiaXQgbGVuZ3RoIHJlcGVhdCc7XG4gICAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGVuID0gc3RhdGUubGVuc1tzdGF0ZS5oYXZlIC0gMV07XG4gICAgICAgICAgICBjb3B5ID0gMyArIChob2xkICYgMHgwMyk7Ly9CSVRTKDIpO1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoMikgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSAyO1xuICAgICAgICAgICAgYml0cyAtPSAyO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIGlmIChoZXJlX3ZhbCA9PT0gMTcpIHtcbiAgICAgICAgICAgIC8vPT09IE5FRURCSVRTKGhlcmUuYml0cyArIDMpO1xuICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDM7XG4gICAgICAgICAgICB3aGlsZSAoYml0cyA8IG4pIHtcbiAgICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIGxlbiA9IDA7XG4gICAgICAgICAgICBjb3B5ID0gMyArIChob2xkICYgMHgwNyk7Ly9CSVRTKDMpO1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoMykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSAzO1xuICAgICAgICAgICAgYml0cyAtPSAzO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIC8vPT09IE5FRURCSVRTKGhlcmUuYml0cyArIDcpO1xuICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDc7XG4gICAgICAgICAgICB3aGlsZSAoYml0cyA8IG4pIHtcbiAgICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIGxlbiA9IDA7XG4gICAgICAgICAgICBjb3B5ID0gMTEgKyAoaG9sZCAmIDB4N2YpOy8vQklUUyg3KTtcbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDcpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gNztcbiAgICAgICAgICAgIGJpdHMgLT0gNztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHN0YXRlLmhhdmUgKyBjb3B5ID4gc3RhdGUubmxlbiArIHN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XRzID0gaGVyZV9iaXRzO1xuICAgICAgICBsYXN0X29wID0gaGVyZV9vcDtcbiAgICAgICAgbGFzdF92YWwgPSBoZXJlX3ZhbDtcbiAgICAgICAgZm9yICg7Oykge1xuICAgICAgICAgIGhlcmUgPSBzdGF0ZS5sZW5jb2RlW2xhc3RfdmFsICtcbiAgICAgICAgICAgICAgICAgICgoaG9sZCAmICgoMSA8PCAobGFzdF9iaXRzICsgbGFzdF9vcCkpIC0gMSkpLypCSVRTKGxhc3QuYml0cyArIGxhc3Qub3ApKi8gPj4gbGFzdF9iaXRzKV07XG4gICAgICAgICAgaGVyZV9iaXRzID0gaGVyZSA+Pj4gMjQ7XG4gICAgICAgICAgaGVyZV9vcCA9IChoZXJlID4+PiAxNikgJiAweGZmO1xuICAgICAgICAgIGhlcmVfdmFsID0gaGVyZSAmIDB4ZmZmZjtcblxuICAgICAgICAgIGlmICgobGFzdF9iaXRzICsgaGVyZV9iaXRzKSA8PSBiaXRzKSB7IGJyZWFrOyB9XG4gICAgICAgICAgLy8tLS0gUFVMTEJZVEUoKSAtLS0vL1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICB9XG4gICAgICAgIC8vLS0tIERST1BCSVRTKGxhc3QuYml0cykgLS0tLy9cbiAgICAgICAgaG9sZCA+Pj49IGxhc3RfYml0cztcbiAgICAgICAgYml0cyAtPSBsYXN0X2JpdHM7XG4gICAgICAgIC8vLS0tLy9cbiAgICAgICAgc3RhdGUuYmFjayArPSBsYXN0X2JpdHM7XG4gICAgICB9XG4gICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgIC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CBkYXRhIGNoZWNrJztcbiAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICAgIGhvbGQgPSAwO1xuICAgICAgICBiaXRzID0gMDtcbiAgICAgICAgLy89PT0vL1xuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgY2hlY2sgbWF0Y2hlcyB0cmFpbGVyXFxuXCIpKTtcbiAgICAgIH1cbiAgICAgIHN0YXRlLm1vZGUgPSBMRU5HVEg7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBMRU5HVEg6XG4gICAgICBpZiAoc3RhdGUud3JhcCAmJiBzdGF0ZS5mbGFncykge1xuICAgICAgICAvLz09PSBORUVEQklUUygzMik7XG4gICAgICAgIHdoaWxlIChiaXRzIDwgMzIpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgaWYgKGhvbGQgIT09IChzdGF0ZS50b3RhbCAmIDB4ZmZmZmZmZmYpKSB7XG4gICAgICAgICAgc3RybS5tc2cgPSAnaW5jb3JyZWN0IGxlbmd0aCBjaGVjayc7XG4gICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgICBob2xkID0gMDtcbiAgICAgICAgYml0cyA9IDA7XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgLy9UcmFjZXYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgIGxlbmd0aCBtYXR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iBudW1iZXIgb2YgaW5kZXggYml0cyBmb3Igcm9vdCB0YWJsZSAqL1xuICB2YXIgY3VyciA9IDA7ICAgICAgICAgICAgICAvKiBudW1iZXIgb2YgaW5kZXggYml0cyBmb3IgY3VycmVudCB0YWJsZSAqL1xuICB2YXIgZHJvcCA9IDA7ICAgICAgICAgICAgICAvKiBjb2RlIGJpdHMgdG8gZHJvcCBmb3Igc3ViLXRhYmxlICovXG4gIHZhciBsZWZ0ID0gMDsgICAgICAgICAgICAgICAgICAgLyogbnVtYmVyIG9mIHByZWZpeCBjb2RlcyBhdmFpbGFibGUgKi9cbiAgdmFyIHVzZWQgPSAwOyAgICAgICAgICAgICAgLyogY29kZSBlbnRyaWVzIGluIHRhYmxlIHVzZWQgKi9cbiAgdmFyIGh1ZmYgPSAwOyAgICAgICAgICAgICAgLyogSHVmZm1hbiBjb2RlICovXG4gIHZhciBpbmNyOyAgICAgICAgICAgICAgLyogZm9yIGluY3JlbWVudGluZyBjb2RlLCBpbmRleCAqL1xuICB2YXIgZmlsbDsgICAgICAgICAgICAgIC8qIGluZGV4IGZvciByZXBsaWNhdGluZyBlbnRyaWVzICovXG4gIHZhciBsb3c7ICAgICAgICAgICAgICAgLyogbG93IGJpdHMgZm9yIGN1cnJlbnQgcm9vdCBlbnRyeSAqL1xuICB2YXIgbWFzazsgICAgICAgICAgICAgIC8qIG1hc2sgZm9yIGxvdyByb290IGJpdHMgKi9cbiAgdmFyIG5leHQ7ICAgICAgICAgICAgIC8qIG5leHQgYXZhaWxhYmxlIHNwYWNlIGluIHRhYmxlICovXG4gIHZhciBiYXNlID0gbnVsbDsgICAgIC8qIGJhc2UgdmFsdWUgdGFibGUgdG8gdXNlICovXG4gIHZhciBiYXNlX2luZGV4ID0gMDtcbi8vICB2YXIgc2hvZXh0cmE7ICAgIC8qIGV4dHJhIGJpdHMgdGFibGUgdG8gdXNlICovXG4gIHZhciBlbmQ7ICAgICAgICAgICAgICAgICAgICAvKiB1c2UgYmFzZSBhbm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ICAgICAgLyogaWYgZmlyc3QgdGltZSwgdHJhbnNpdGlvbiB0byBzdWItdGFibGVzICovXG4gICAgICBpZiAoZHJvcCA9PT0gMCkge1xuICAgICAgICBkcm9wID0gcm9vdDtcbiAgICAgIH1cblxuICAgICAgLyogaW5jcmVtZW50IHBhc3QgbGFzdCB0YWJsZSAqL1xuICAgICAgbmV4dCArPSBtaW47ICAgICAgICAgICAgLyogaGVyZSBtaW4gaXMgMSA8PCBjdXJyICovXG5cbiAgICAgIC8qIGRldGVybWluZSBsZW5ndGggb2YgbmV4dCB0YWJsZSAqL1xuICAgICAgY3VyciA9IGxlbiAtIGRyb3A7XG4gICAgICBsZWZ0ID0gMSA8PCBjdXJyO1xuICAgICAgd2hpbGUgKGN1cnIgKyBkcm9wIDwgbWF4KSB7XG4gICAgICAgIGxlZnQgLT0gY291bnRbY3VyciArIGRyb3BdO1xuICAgICAgICBpZiAobGVmdCA8PSAwKSB7IGJyZWFrOyB9XG4gICAgICAgIGN1cnIrKztcbiAgICAgICAgbGVmdCA8PD0gMTtcbiAgICAgIH1cblxuICAgICAgLyogY2hlY2sgZm9yIGVub3VnaCBzcGFjZSAqL1xuICAgICAgdXNlZCArPSAxIDw8IGN1cnI7XG4gICAgICBpZiAoKHR5cGUgPT09IExFTlMgJiYgdXNlZCA+IEVOT1VHSF9MRU5TKSB8fFxuICAgICAgICAodHlwZSA9PT0gRElTVFMgJiYgdXNlZCA+IEVOT1VHSF9ESVNUUykpIHtcbiAgICAgICAgcmV0dXJuIDE7XG4gICAgICB9XG5cbiAgICAgIC8qIHBvaW50IGVudHJ5IGluIHJvb3QgdGFibGUgdG8gc3ViLXRhYmxlICovXG4gICAgICBsb3cgPSBodWZmICYgbWFzaztcbiAgICAgIC8qdGFibGUub3BbbG93XSA9IGN1cnI7XG4gICAgICB0YWJsZS5iaXRzW2xvd10gPSByb290O1xuICAgICAgdGFibGUudmFsW2xvd10gPSBuZXh0IC0gb3B0cy50YWJsZV9pbmRleDsqL1xuIC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AgICAgICAgICAvKiBaX09LICAgICAgICAgICAgICAwICAqL1xuICAnLTEnOiAgICdmaWxlIGVycm9yJywgICAgICAgICAgLyogWl9FUlJOTyAgICAgICAgICgtMSkgKi9cbiAgJy0yJzogICAnc3RyZWFtIGVycm9yJywgICAgICAgIC8qIFpfU1RSRUFNX0VSUk9SICAoLTIpICovXG4gICctMyc6ICAgJ2RhdGEgZXJyb3InLCAgICAgICAgICAvKiBaX0RBVEFfRVJST1IgICAgKC0zKSAqL1xuICAnLTQnOiAgICdpbnN1ZmZpY2llbnQgbWVtb3J5JywgLyogWl9NRU1fRVJST1IgICAgICgtNCkgKi9cbiAgJy01JzogICAnYnVmZmVyIGVycm9yJywgICAgICAgIC8qIFpfQlVGX0VSUk9SICAgICAoLTUpICovXG4gICctNic6ICAgJ2luY29tcGF0aWJsZSB2ZXJzaW9uJyAvKiBaX1ZFUlNJT05fRVJST1IgKC02KSAqL1xufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuXG52YXIgdXRpbHMgPSByZXF1aXJlKCcuLi91dGlscy9jb21tb24nKTtcblxuLyogUHVibGljIGNvbnN0YW50cyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxuLy92YXIgWl9GSUxURVJFRCAgICAgICAgICA9IDE7XG4vL3ZhciBaX0hVRkZNQU5fT05MWSAgICAgID0gMjtcbi8vdmFyIFpfUkxFICAgICAgICAgICAgICAgPSAzO1xudmFyIFpfRklYRUQgICAgICAgICAgICAgICA9IDQ7XG4vL3ZhciBaX0RFRkFVTFRfU1RSQVRFR1kgID0gMDtcblxuLyogUG9zc2libGUgdmFsdWVzIG9mIHRoZSBkYXRhX3R5cGUgZmllbGQgKHRob3VnaCBzZWUgaW5mbGF0ZSgpKSAqL1xudmFyIFpfQklOQVJZICAgICAgICAgICAgICA9IDA7XG52YXIgWl9URVhUICAgICAgICAgICAgICAgID0gMTtcbi8vdmFyIFpfQVNDSUkgICAgICAgICAgICAgPSAxOyAvLyA9IFpfVEVYVFxudmFyIFpfVU5LTk9XTiAgICAgICAgICAgICA9IDI7XG5cbi8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxuZnVuY3Rpb24gemVybyhidWYpIHsgdmFyIGxlbiA9IGJ1Zi5sZW5ndGg7IHdoaWxlICgtLWxlbiA+PSAwKSB7IGJ1ZltsZW5dID0gMDsgfSB9XG5cbi8vIEZyb20genV0aWwuaFxuXG52YXIgU1RPUkVEX0JMT0NLID0gMDtcbnZhciBTVEFUSUNfVFJFRVMgPSAxO1xudmFyIERZTl9UUkVFUyAgICA9IDI7XG4vKiBUaGUgdGhyZWUga2luZHMgb2YgYmxvY2sgdHlwZSAqL1xuXG52YXIgTUlOX01BVENIICAgID0gMztcbnZhciBNQVhfTUFUQ0ggICAgPSAyNTg7XG4vKiBUaGUgbWluaW11bSBhbmQgbWF4aW11bSBtYXRjaCBsZW5ndGhzICovXG5cbi8vIEZyb20gZGVmbGF0ZS5oXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIEludGVybmFsIGNvbXByZXNzaW9uIHN0YXRlLlxuICovXG5cbnZhciBMRU5HVEhfQ09ERVMgID0gMjk7XG4vKiBudW1iZXIgb2YgbGVuZ3RoIGNvZGVzLCBub3QgY291bnRpbmcgdGhlIHNwZWNpYWwgRU5EX0JMT0NLIGNvZGUgKi9cblxudmFyIExJVEVSQUxTICAgICAgPSAyNTY7XG4vKiBudW1iZXIgb2YgbGl0ZXJhbCBieXRlcyAwLi4yNTUgKi9cblxudmFyIExfQ09ERVMgICAgICAgPSBMSVRFUkFMU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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIEluaXRpYWxpemUgYSBuZXcgYmxvY2suXG4gKi9cbmZ1bmN0aW9uIGluaXRfYmxvY2socykge1xuICB2YXIgbjsgLyogaXRlcmF0ZXMgb3ZlciB0cmVlIGVsZW1lbnRzICovXG5cbiAgLyogSW5pdGlhbGl6ZSB0aGUgdHJlZXMuICovXG4gIGZvciAobiA9IDA7IG4gPCBMX0NPREVTOyAgbisrKSB7IHMuZHluX2x0cmVlW24gKiAyXS8qLkZyZXEqLyA9IDA7IH1cbiAgZm9yIChuID0gMDsgbiA8IERfQ09ERVM7ICBuKyspIHsgcy5keW5fZHRyZWVbbiAqIDJdLyouRnJlcSovID0gMDsgfVxuICBmb3IgKG4gPSAwOyBuIDwgQkxfQ09ERVM7IG4rKykgeyBzLmJsX3RyZWVbbiAqIDJdLyouRnJlcSovID0gMDsgfVxuXG4gIHMuZHluX2x0cmVlW0VORF9CTE9DSyAqIDJdLyouRnJlcSovID0gMTtcbiAgcy5vcHRfbGVuID0gcy5zdGF0aWNfbGVuID0gMDtcbiAgcy5sYXN0X2xpdCA9IHMubWF0Y2hlcyA9IDA7XG59XG5cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBGbHVzaCB0aGUgYml0IGJ1ZmZlciBhbmQgYWxpZ24gdGhlIG91dHB1dCBvbiBhIGJ5dGUgYm91bmRhcnlcbiAqL1xuZnVuY3Rpb24gYmlfd2luZHVwKHMpXG57XG4gIGlmIChzLmJpX3ZhbGlkID4gOCkge1xuICAgIHB1dF9zaG9ydChzLCBzLmJpX2J1Zik7XG4gIH0gZWxzZSBpZiAocy5iaV92YWxpZCA+IDApIHtcbiAgICAvL3B1dF9ieXRlKHMsIChCeXRlKXMtPmJpX2J1Zik7XG4gICAgcy5w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lKTsgfSB3aGlsZSAoLS1jb3VudCAhPT0gMCk7XG5cbiAgICB9IGVsc2UgaWYgKGN1cmxlbiAhPT0gMCkge1xuICAgICAgaWYgKGN1cmxlbiAhPT0gcHJldmxlbikge1xuICAgICAgICBzZW5kX2NvZGUocywgY3VybGVuLCBzLmJsX3RyZWUpO1xuICAgICAgICBjb3VudC0tO1xuICAgICAgfVxuICAgICAgLy9Bc3NlcnQoY291bnQgPj0gMyAmJiBjb3VudCA8PSA2LCBcIiAzXzY/XCIpO1xuICAgICAgc2VuZF9jb2RlKHMsIFJFUF8zXzYsIHMuYmxfdHJlZSk7XG4gICAgICBzZW5kX2JpdHMocywgY291bnQgLSAzLCAyKTtcblxuICAgIH0gZWxzZSBpZiAoY291bnQgPD0gMTApIHtcbiAgICAgIHNlbmRfY29kZShzLCBSRVBaXzNfMTAsIHMuYmxfdHJlZSk7XG4gICAgICBzZW5kX2JpdHMocywgY291bnQgLSAzLCAzKTtcblxuICAgIH0gZWxzZSB7XG4gICAgICBzZW5kX2NvZGUocywgUkVQWl8xMV8xMzgsIHMuYmxfdHJlZSk7XG4gICAgICBzZW5kX2JpdHMocywgY291bnQgLSAxMSwgNyk7XG4gICAgfVxuXG4gICAgY291bnQgPSAwO1xuICAgIHByZXZsZW4gPSBjdXJsZW47XG4gICAgaWYgKG5leHRsZW4gPT09IDApIHtcbiAgICAgIG1heF9jb3VudCA9IDEzODtcbiAgICAgIG1pbl9jb3VudCA9IDM7XG5cbiAgICB9IGVsc2UgaWYgKGN1cmxlbiA9PT0gbmV4dGxlbikge1xuICAgICAgbWF4X2NvdW50ID0gNjtcbiAgICAgIG1pbl9jb3VudCA9IDM7XG5cbiAgICB9IGVsc2Uge1xuICAgICAgbWF4X2NvdW50ID0gNztcbiAgICAgIG1pbl9jb3VudCA9IDQ7XG4gICAgfVxuICB9XG59XG5cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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YgdGhlIGZpcnN0IGZpbGU6ICovXG4gIGluaXRfYmxvY2socyk7XG59XG5cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBTZW5kIGEgc3RvcmVkIGJsb2NrXG4gKi9cbmZ1bmN0aW9uIF90cl9zdG9yZWRfYmxvY2socywgYnVmLCBzdG9yZWRfbGVuLCBsYXN0KVxuLy9EZWZsYXRlU3RhdGUgKnM7XG4vL2NoYXJmICpidWY7ICAgICAgIC8qIGlucHV0IGJsb2NrICovXG4vL3VsZyBzdG9yZWRfbGVuOyAgIC8qIGxlbmd0aCBvZiBpbnB1dCBibG9jayAqL1xuLy9pbnQgbGFzdDsgICAgICAgICAvKiBvbmUgaWYgdGhpcyBpcyB0aGUgbGFzdCBibG9jayBmb3IgYSBmaWxlICovXG57XG4gIHNlbmRfYml0cyhzLCAoU1RPUkVEX0JMT0NLIDw8IDEpICsgKGxhc3QgPyAxIDogMCksIDMpOyAgICAvKiBzZW5kIGJsb2NrIHR5cGUgKi9cbiAgY29weV9ibG9jayhzLCBidWYsIHN0b3JlZF9sZW4sIHRydWUpOyAvKiB3aXRoIGhlYWRlciAqL1xufVxuXG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogU2VuZCBvbmUgZW1wdHkgc3RhdGljIGJsb2NrIHRvIGdpdmUgZW5vdWdoIGxvb2thaGVhZCBmb3IgaW5mbGF0ZS5cbiAqIFRoaXMgdGFrZXMgMTAgYml0cywgb2Ygd2hpY2ggNyBtYXkgcmVtYWluIGluIHRoZSBiaXQgYnVmZmVyLlxuICovXG5mdW5jdGlvbiBfdHJfYWxpZ24ocykge1xuICBzZW5kX2JpdHMocywgU1RBVElDX1RSRUVTIDw8IDEsIDMpO1xuICBzZW5kX2NvZGUocywgRU5EX0JMT0NLLCBz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SBzdGFydDsgaSA8IGVuZDsgaSsrKSB7XG4gICAgICAgICAgICB2YXIgY2ggPSB0aGlzW2ldO1xuICAgICAgICAgICAgaWYgKGNoIDw9IDB4N0YpIHtcbiAgICAgICAgICAgICAgICBzdHIgKz0gZGVjb2RlVVJJQ29tcG9uZW50KHRtcCkgKyBTdHJpbmcuZnJvbUNoYXJDb2RlKGNoKTtcbiAgICAgICAgICAgICAgICB0bXAgPSAnJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdG1wICs9ICclJyArIGNoLnRvU3RyaW5nKDE2KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHN0ciArPSBkZWNvZGVVUklDb21wb25lbnQodG1wKTtcblxuICAgICAgICByZXR1cm4gc3RyO1xuICAgIH0sXG5cbiAgICB3cml0ZTogZnVuY3Rpb24oc3RyLCBwb3MpIHtcbiAgICAgICAgdmFyIGJ5dGVzID0gc3RyID09PSBsYXN0U3RyID8gbGFzdFN0ckVuY29kZWQgOiBlbmNvZGVTdHJpbmcoc3RyKTtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBieXRlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdGhpc1twb3MgKyBpXSA9IGJ5dGVzW2ldO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIHNsaWNlOiBmdW5jdGlvbihzdGFydCwgZW5kKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnN1YmFycmF5KHN0YXJ0LCBlbmQpO1xuICAgIH0sXG5cbiAgICBjb3B5OiBmdW5jdGlvbihidWYsIHBvcykge1xuICAgICAgICBwb3MgPSBwb3MgfHwgMDtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0aGlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBidWZbcG9zICsgaV0gPSB0aGlzW2ldO1xuICAgICAgICB9XG4gICAgfVxufTtcblxuQnVmZmVyTWV0aG9kcy53cml0ZUludDMyTEUgPSBCdWZmZXJNZXRob2RzLndyaXRlVUludDMyTEU7XG5cbkJ1ZmZlci5ieXRlTGVuZ3RoID0gZnVuY3Rpb24oc3RyKSB7XG4gICAgbGFzdFN0ciA9IHN0cjtcbiAgICBsYXN0U3RyRW5jb2RlZCA9IGVuY29kZVN0cmluZyhzdHIpO1xuICAgIHJldHVybiBsYXN0U3RyRW5jb2RlZC5sZW5ndGg7XG59O1xuXG5CdWZmZXIuaXNCdWZmZXIgPSBmdW5jdGlvbihidWYpIHtcbiAgICByZXR1cm4gISEoYnVmICYmIGJ1Zi5faXNCdWZmZXIpO1xufTtcblxuZnVuY3Rpb24gZW5jb2RlU3RyaW5nKHN0cikge1xuICAgIHZhciBsZW5ndGggPSBzdHIubGVuZ3RoLFxuICAgICAgICBieXRlcyA9IFtdO1xuXG4gICAgZm9yICh2YXIgaSA9IDAsIGMsIGxlYWQ7IGkgPCBsZW5ndGg7IGkrKykge1xuICAgICAgICBjID0gc3RyLmNoYXJDb2RlQXQoaSk7IC8vIGNvZGUgcG9pbnRcblxuICAgICAgICBpZiAoYyA+IDB4RDdGRiAmJiBjIDwgMHhFMDAwKSB7XG5cbiAgICAgICAgICAgIGlmIChsZWFkKSB7XG4gICAgICAgICAgICAgICAgaWYgKGMgPCAweERDMDApIHtcbiAgICAgICAgICAgICAgICAgICAgYnl0ZXMucHVzaCgweEVGLCAweEJGLCAweEJEKTtcbiAgICAgICAgICAgICAgICAgICAgbGVhZCA9IGM7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYyA9IGxlYWQgLSAweEQ4MDAgPDwgMTAgfCBjIC0gMHhEQzAwIHwgMHgxMDAwMDtcbiAgICAgICAgICAgICAgICAgICAgbGVhZCA9IG51bGw7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC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AgICAgICAgIHRoaXMuYnVmW3RoaXMucG9zKytdID0gKCh2YWwgPj4+IDcpICYgMHg3Zik7XG5cbiAgICAgICAgfSBlbHNlIGlmICh2YWwgPD0gMHgxZmZmZmYpIHtcbiAgICAgICAgICAgIHRoaXMucmVhbGxvYygzKTtcbiAgICAgICAgICAgIHRoaXMuYnVmW3RoaXMucG9zKytdID0gKCh2YWwgPj4+IDApICYgMHg3ZikgfCAweDgwO1xuICAgICAgICAgICAgdGhpcy5idWZbdGhpcy5wb3MrK10gPSAoKHZhbCA+Pj4gNykgJiAweDdmKSB8IDB4ODA7XG4gICAgICAgICAgICB0aGlzLmJ1Zlt0aGlzLnBvcysrXSA9ICgodmFsID4+PiAxNCkgJiAweDdmKTtcblxuICAgICAgICB9IGVsc2UgaWYgKHZhbCA8PSAweGZmZmZmZmYpIHtcbiAgICAgICAgICAgIHRoaXMucmVhbGxvYyg0KTtcbiAgICAgICAgICAgIHRoaXMuYnVmW3RoaXMucG9zKytdID0gKCh2YWwgPj4+IDApICYgMHg3ZikgfCAweDgwO1xuICAgICAgICAgICAgdGhpcy5idWZbdGhpcy5wb3MrK10gPSAoKHZhbCA+Pj4gNykgJiAweDdmKSB8IDB4ODA7XG4gICAgICAgICAgICB0aGlzLmJ1Zlt0aGlzLnBvcysrXSA9ICgodmFsID4+PiAxNCkgJiAweDdmKSB8IDB4ODA7XG4gICAgICAgICAgICB0aGlzLmJ1Zlt0aGlzLnBvcysrXSA9ICgodmFsID4+PiAyMSkgJiAweDdmKTtcblxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFyIHBvcyA9IHRoaXMucG9zO1xuICAgICAgICAgICAgd2hpbGUgKHZhbCA+PSAweDgwKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5yZWFsbG9jKDEpO1xuICAgICAgICAgICAgICAgIHRoaXMuYnVmW3RoaXMucG9zKytdID0gKHZhbCAmIDB4ZmYpIHwgMHg4MDtcbiAgICAgICAgICAgICAgICB2YWwgLz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kgKz0gcC55O1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9LFxuXG4gICAgX3N1YjogZnVuY3Rpb24ocCkge1xuICAgICAgICB0aGlzLnggLT0gcC54O1xuICAgICAgICB0aGlzLnkgLT0gcC55O1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9LFxuXG4gICAgX211bHQ6IGZ1bmN0aW9uKGspIHtcbiAgICAgICAgdGhpcy54ICo9IGs7XG4gICAgICAgIHRoaXMueSAqPSBrO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9LFxuXG4gICAgX2RpdjogZnVuY3Rpb24oaykge1xuICAgICAgICB0aGlzLnggLz0gaztcbiAgICAgICAgdGhpcy55IC89IGs7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH0sXG5cbiAgICBfdW5pdDogZnVuY3Rpb24oKSB7XG4gICAgICAgIHRoaXMuX2Rpdih0aGlzLm1hZygpKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfSxcblxuICAgIF9wZXJwOiBmdW5jdGlvbigpIHtcbiAgICAgICAgdmFyIHkgPSB0aGlzLnk7XG4gICAgICAgIHRoaXMueSA9IHRoaXMueDtcbiAgICAgICAgdGhpcy54ID0gLXk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH0sXG5cbiAgICBfcm90YXRlOiBmdW5jdGlvbihhbmdsZSkge1xuICAgICAgICB2YXIgY29zID0gTWF0aC5jb3MoYW5nbGUpLFxuICAgICAgICAgICAgc2luID0gTWF0aC5zaW4oYW5nbGUpLFxuICAgICAgICAgICAgeCA9IGNvcyAqIHRoaXMueCAtIHNpbiAqIHRoaXMueSxcbiAgICAgICAgICAgIHkgPSBzaW4gKiB0aGlzLnggKyBjb3MgKiB0aGlzLnk7XG4gICAgICAgIHRoaXMueCA9IHg7XG4gICAgICAgIHRoaXMueSA9IHk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH0sXG5cbiAgICBfcm91bmQ6IGZ1bmN0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ocmV0dXJuTWV0aG9kKSB7XG4gICAgICAgICAgICAgIHZhciByZWNvcmQgPSB0cnlDYXRjaChyZXR1cm5NZXRob2QsIGRlbGVnYXRlLml0ZXJhdG9yLCBhcmcpO1xuICAgICAgICAgICAgICBpZiAocmVjb3JkLnR5cGUgPT09IFwidGhyb3dcIikge1xuICAgICAgICAgICAgICAgIC8vIElmIHRoZSByZXR1cm4gbWV0aG9kIHRocmV3IGFuIGV4Y2VwdGlvbiwgbGV0IHRoYXRcbiAgICAgICAgICAgICAgICAvLyBleGNlcHRpb24gcHJldmFpbCBvdmVyIHRoZSBvcmlnaW5hbCByZXR1cm4gb3IgdGhyb3cuXG4gICAgICAgICAgICAgICAgbWV0aG9kID0gXCJ0aHJvd1wiO1xuICAgICAgICAgICAgICAgIGFyZyA9IHJlY29yZC5hcmc7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gXCJyZXR1cm5cIikge1xuICAgICAgICAgICAgICAvLyBDb250aW51ZSB3aXRoIHRoZSBvdXRlciByZXR1cm4sIG5vdyB0aGF0IHRoZSBkZWxlZ2F0ZVxuICAgICAgICAgICAgICAvLyBpdGVyYXRvciBoYXMgYmVlbiB0ZXJtaW5hdGVkLlxuICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICB2YXIgcmVjb3JkID0gdHJ5Q2F0Y2goXG4gICAgICAgICAgICBkZWxlZ2F0ZS5pdGVyYXRvclttZXRob2RdLFxuICAgICAgICAgICAgZGVsZWdhdGUuaXRlcmF0b3IsXG4gICAgICAgICAgICBhcmdcbiAgICAgICAgICApO1xuXG4gICAgICAgICAgaWYgKHJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgICAgICAgIGNvbnRleHQuZGVsZWdhdGUgPSBudWxsO1xuXG4gICAgICAgICAgICAvLyBMaWtlIHJldHVybmluZyBnZW5lcmF0b3IudGhyb3codW5jYXVnaHQpLCBidXQgd2l0aG91dCB0aGVcbiAgICAgICAgICAgIC8vIG92ZXJoZWFkIG9mIGFuIGV4dHJhIGZ1bmN0aW9uIGNhbGwuXG4gICAgICAgICAgICBtZXRob2QgPSBcInRocm93XCI7XG4gICAgICAgICAgICBhcmcgPSByZWNvcmQuYXJnO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy8gRGVsZWdhdGUgZ2VuZXJhdG9yIHJhbiBhbmQgaGFuZGxlZCBpdHMgb3duIGV4Y2VwdGlvbnMgc29cbiAgICAgICAgICAvLyByZWdhcmRsZXNzIG9mIHdoYXQgdGhlIG1ldGhvZCB3YXMsIHdlIGNvbnRpbnVlIGFzIGlmIGl0IGlzXG4gICAgICAgICAgLy8gXCJuZXh0XCIgd2l0aCBhbiB1bmRlZmluZWQgYXJnLlxuICAgICAgICAgIG1ldGhvZCA9IFwibmV4dFwiO1xuICAgICAgICAgIGFyZyA9IHVuZGVmaW5lZDtcblxuICAgICAgICAgIHZhciBpbmZvID0gcmVjb3JkLmFyZztcbiAgICAgICAgICBpZiAoaW5mby5kb25lKSB7XG4gICAgICAgICAgICBjb250ZXh0W2RlbGVnYXRlLnJlc3VsdE5hbWVdID0gaW5mby52YWx1ZTtcbiAgICAgICAgICAgIGNvbnRleHQubmV4dCA9IGRlbGVnYXRlLm5leHRMb2M7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHN0YXRlID0gR2VuU3RhdGVTdXNwZW5kZWRZaWVsZDtcbiAgICAgICAgICAgIHJldHVybiBpbmZvO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGNvbnRleHQuZGVsZWdhdGUgPSBudWxsO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG1ldGhvZCA9PT0gXCJuZXh0XCIpIHtcbiAgICAgICAgICAvLyBTZXR0aW5nIGNvb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B0aW9uIGlzIHRocm93biBmcm9tIGlubmVyRm4sIHdlIGxlYXZlIHN0YXRlID09PVxuICAgICAgICAgIC8vIEdlblN0YXRlRXhlY3V0aW5nIGFuZCBsb29wIGJhY2sgZm9yIGFub3RoZXIgaW52b2NhdGlvbi5cbiAgICAgICAgICBzdGF0ZSA9IGNvbnRleHQuZG9uZVxuICAgICAgICAgICAgPyBHZW5TdGF0ZUNvbXBsZXRlZFxuICAgICAgICAgICAgOiBHZW5TdGF0ZVN1c3BlbmRlZFlpZWxkO1xuXG4gICAgICAgICAgdmFyIGluZm8gPSB7XG4gICAgICAgICAgICB2YWx1ZTogcmVjb3JkLmFyZyxcbiAgICAgICAgICAgIGRvbmU6IGNvbnRleHQuZG9uZVxuICAgICAgICAgIH07XG5cbiAgICAgICAgICBpZiAocmVjb3JkLmFyZyA9PT0gQ29udGludWVTZW50aW5lbCkge1xuICAgICAgICAgICAgaWYgKGNvbnRleHQuZGVsZWdhdGUgJiYgbWV0aG9kID09PSBcIm5leHRcIikge1xuICAgICAgICAgICAgICAvLyBEZWxpYmVyYXRlbHkgZm9yZ2V0IHRoZSBsYXN0IHNlbnQgdmFsdWUgc28gdGhhdCB3ZSBkb24ndFxuICAgICAgICAgICAgICAvLyBhY2NpZGVudGFsbHkgcGFzcyBpdCBvbiB0byB0aGUgZGVsZWdhdGUuXG4gICAgICAgICAgICAgIGFyZyA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIGluZm87XG4gICAgICAgICAgfVxuXG4gICAgICAgIH0gZWxzZSBpZiAocmVjb3JkLnR5cGUgPT09IFwidGhyb3dcIikge1xuICAgICAgICAgIHN0YXRlID0gR2VuU3RhdGVDb21wbGV0ZWQ7XG4gICAgICAgICAgLy8gRGlzcGF0Y2ggdGhlIGV4Y2VwdGlvbiBieSBsb29waW5nIGJhY2sgYXJvdW5kIHRvIHRoZVxuICAgICAgICAgIC8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WxlZ2F0ZSA9IG51bGw7XG5cbiAgICAgIHRoaXMudHJ5RW50cmllcy5mb3JFYWNoKHJlc2V0VHJ5RW50cnkpO1xuXG4gICAgICBpZiAoIXNraXBUZW1wUmVzZXQpIHtcbiAgICAgICAgZm9yICh2YXIgbmFtZSBpbiB0aGlzKSB7XG4gICAgICAgICAgLy8gTm90IHN1cmUgYWJvdXQgdGhlIG9wdGltYWwgb3JkZXIgb2YgdGhlc2UgY29uZGl0aW9uczpcbiAgICAgICAgICBpZiAobmFtZS5jaGFyQXQoMCkgPT09IFwidFwiICYmXG4gICAgICAgICAgICAgIGhhc093bi5jYWxsKHRoaXMsIG5hbWUpICYmXG4gICAgICAgICAgICAgICFpc05hTigrbmFtZS5zbGljZSgxKSkpIHtcbiAgICAgICAgICAgIHRoaXNbbmFtZV0gPSB1bmRlZmluZWQ7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcblxuICAgIHN0b3A6IGZ1bmN0aW9uKCkge1xuICAgICAgdGhpcy5kb25lID0gdHJ1ZTtcblxuICAgICAgdmFyIHJvb3RFbnRyeSA9IHRoaXMudHJ5RW50cmllc1swXTtcbiAgICAgIHZhciByb290UmVjb3JkID0gcm9vdEVudHJ5LmNvbXBsZXRpb247XG4gICAgICBpZiAocm9vdFJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgICAgdGhyb3cgcm9vdFJlY29yZC5hcmc7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiB0aGlzLnJ2YWw7XG4gICAgfSxcblxuICAgIGRpc3BhdGNoRXhjZXB0aW9uOiBmdW5jdGlvbihleGNlcHRpb24pIHtcbiAgICAgIGlmICh0aGlzLmRvbmUpIHtcbiAgICAgICAgdGhyb3cgZXhjZXB0aW9uO1xuICAgICAgfVxuXG4gICAgICB2YXIgY29udGV4dCA9IHRoaXM7XG4gICAgICBmdW5jdGlvbiBoYW5kbGUobG9jLCBjYXVnaHQpIHtcbiAgICAgICAgcm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0cnVlKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5wcmV2IDwgZW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlKGVudHJ5LmZpbmFsbHlMb2MpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSBlbHNlIGlmIChoYXNDYXRjaCkge1xuICAgICAgICAgICAgaWYgKHRoaXMucHJldiA8IGVudHJ5LmNhdGNoTG9jKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoYW5kbGUoZW50cnkuY2F0Y2hMb2MsIHRydWUpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSBlbHNlIGlmIChoYXNGaW5hbGx5KSB7XG4gICAgICAgICAgICBpZiAodGhpcy5wcmV2IDwgZW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlKGVudHJ5LmZpbmFsbHlMb2MpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcInRyeSBzdGF0ZW1lbnQgd2l0aG91dCBjYXRjaCBvciBmaW5hbGx5XCIpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG5cbiAgICBhYnJ1cHQ6IGZ1bmN0aW9uKHR5cGUsIGFyZykge1xuICAgICAgZm9yICh2YXIgaSA9IHRoaXMudHJ5RW50cmllcy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICB2YXIgZW50cnkgPSB0aGlzLnRyeUVudHJpZXNbaV07XG4gICAgICAgIGlmIChlbnRyeS50cnlMb2MgPD0gdGhpcy5wcmV2ICYmXG4gICAgICAgICAgICBoYXNPd24uY2FsbChlbnRyeSwgXCJmaW5hbGx5TG9jXCIpICYmXG4gICAgICAgICAgICB0aGlzLnByZXYgPCBlbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgICAgdmFyIGZpbmFsbHlFbnRyeSA9IGVudHJ5O1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChmaW5hbGx5RW50cnkgJiZcbiAgICAgICAgICAodHlwZSA9PT0gXCJicmVha1wiIHx8XG4gICAgICAgICAgIHR5cGUgPT09IFwiY29udGludWVcIikgJiZcbiAgICAgICAgICBmaW5hbGx5RW50cnkudHJ5TG9jIDw9IGFyZyAmJlxuICAgICAgICAgIGFyZyA8PSBmaW5hbGx5RW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAvLyBJZ25vcmUgdGhlIGZpbmFsbHkgZW50cnkgaWYgY29udHJvbCBpcyBub3QganVtcGluZyB0byBhXG4gICAgICAgIC8vIGxvY2F0aW9uIG91dHNpZGUgdGhlIHRyeS9jYXRjaCBibG9jay5cbiAgICAgICAgZmluYWxseUVudHJ5ID0gbnVsbDtcbiAgICAgIH1cblxuICAgICAgdmFyIHJlY29yZCA9IGZpbmFsbHlFbnRyeSA/IGZpbmFsbHlFbnRyeS5jb21wbGV0aW9uIDoge307XG4gICAgICByZWNvcmQudHlwZSA9IHR5cGU7XG4gICAgICByZWNvcmQuYXJnID0gYXJnO1xuXG4gICAgICBpZiAoZmluYWxseUVudHJ5KSB7XG4gICAgICAgIHRoaXMubmV4dCA9IGZpbmFsbHlFbnRyeS5maW5hbGx5TG9jO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdGhpcy5jb21wbGV0ZShyZWNvcmQpO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gQ29udGludWVTZW50aW5lbDtcbiAgICB9LFxuXG4gICAgY29tcGxldGU6IGZ1bmN0aW9uKHJlY29yZCwgYWZ0ZXJMb2MpIHtcbiAgICAgIGlmIChyZWNvcmQudHlwZSA9PT0gXCJ0aHJvd1wiKSB7XG4gICAgICAgIHRocm93IHJlY29yZC5hcmc7XG4gICAgICB9XG5cbiAgICAgIGlmIChyZWNvcmQudHlwZSA9PT0gXCJicmVha1wiIHx8XG4gICAgICAgICAgcmVjb3JkLnR5cGUgPT09IFwiY29udGludWVcIikge1xuICAgICAgICB0aGlzLm5leHQgPSByZWNvcmQuYXJnO1xuICAgICAgfSBlbHNlIGlmIChyZWNvcmQudHlwZSA9PT0gXCJyZXR1cm5cIikge1xuICAgICAgICB0aGlzLnJ2YWwgPSByZWNvcmQuYXJnO1xuICAgICAgICB0aGlzLm5leHQgPSBcImVuZFwiO1xuICAgICAgfSBlbHNlIGlmIChyZWNvcmQudHlwZSA9PT0gXCJub3JtYWxcIiAmJiBhZnRlckxvYykge1xuICAgICAgICB0aGlzLm5leHQgPSBhZnRlckxvYztcbiAgICAgIH1cbiAgICB9LFxuXG4gICAgZmluaXNoOiBmdW5jdGlvbihmaW5hbGx5TG9jKSB7XG4gICAgICBmb3IgKHZhciBpID0gdGhpcy50cnlFbnRyaWVzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBlbnRyeSA9IHRoaXMudHJ5RW50cmllc1tpXTtcbiAgICAgICAgaWYgKGVudHJ5LmZpbmFsbHlMb2MgPT09IGZpbmFsbHlMb2MpIHtcbiAgICAgICAgICB0aGlzLmNvbXBsZXRlKGVudHJ5LmNvbXBsZXRpb24sIGVudHJ5LmFmdGVyTG9jKTtcbiAgICAgICAgICByZXNldFRyeUVudHJ5KGVudHJ5KTtcbiAgICAgICAgICByZXR1cm4gQ29udGludWVTZW50aW5lbDtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG5cbiAgICBcImNhdGNoXCI6IGZ1bmN0aW9uKHRyeUxvYykge1xuICAgICAgZm9yICh2YXIgaSA9IHRoaXMudHJ5RW50cmllcy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICB2YXIgZW50cnkgPSB0aGlzLnRyeUVudHJpZXNbaV07XG4gICAgICAgIGlmIChlbnRyeS50cnlMb2MgPT09IHRyeUxvYykge1xuICAgICAgICAgIHZhciByZWNvcmQgPS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AgICAgICAgICAgICAgICBpZiAoIXBvbHlnb24uXykge1xuICAgICAgICAgICAgICAgICAgcG9seWdvbi5fID0gMTtcbiAgICAgICAgICAgICAgICAgIG5laWdoYm9ycy5wdXNoKHBvbHlnb24pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuXG4gICAgcG9seWdvbnMuZm9yRWFjaChmdW5jdGlvbihwb2x5Z29uKSB7XG4gICAgICBkZWxldGUgcG9seWdvbi5fO1xuICAgIH0pO1xuXG4gICAgcmV0dXJuIHtcbiAgICAgIHR5cGU6IFwiTXVsdGlQb2x5Z29uXCIsXG4gICAgICBhcmNzOiBjb21wb25lbnRzLm1hcChmdW5jdGlvbihwb2x5Z29ucykge1xuICAgICAgICB2YXIgYXJjcyA9IFtdO1xuXG4gICAgICAgIC8vIEV4dHJhY3QgdGhlIGV4dGVyaW9yICh1bmlxdWUpIGFyY3MuXG4gICAgICAgIHBvbHlnb25zLmZvckVhY2goZnVuY3Rpb24ocG9seWdvbikge1xuICAgICAgICAgIHBvbHlnb24uZm9yRWFjaChmdW5jdGlvbihyaW5nKSB7XG4gICAgICAgICAgICByaW5nLmZvckVhY2goZnVuY3Rpb24oYXJjKSB7XG4gICAgICAgICAgICAgIGlmIChwb2x5Z29uc0J5QXJjW2FyYyA8IDAgPyB+YXJjIDogYXJjXS5sZW5ndGggPCAyKSB7XG4gICAgICAgICAgICAgICAgYXJjcy5wdXNoKGFyYyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcblxuICAgICAgICAvLyBTdGl0Y2ggdGhlIGFyY3MgaW50byBvbmUgb3IgbW9yZSByaW5ncy5cbiAgICAgICAgYXJjcyA9IHN0aXRjaEFyY3ModG9wb2xvZ3ksIGFyY3MpO1xuXG4gICAgICA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nBvcztcblxuICAgIHdoaWxlIChwYmYucG9zIDwgZW5kKSB7XG4gICAgICAgIHZhciBrZXkgPSBmZWF0dXJlLl9rZXlzW3BiZi5yZWFkVmFyaW50KCldLFxuICAgICAgICAgICAgdmFsdWUgPSBmZWF0dXJlLl92YWx1ZXNbcGJmLnJlYWRWYXJpbnQoKV07XG4gICAgICAgIGZlYXR1cmUucHJvcGVydGllc1trZXldID0gdmFsdWU7XG4gICAgfVxufVxuXG5WZWN0b3JUaWxlRmVhdHVyZS50eXBlcyA9IFsnVW5rbm93bicsICdQb2ludCcsICdMaW5lU3RyaW5nJywgJ1BvbHlnb24nXTtcblxuVmVjdG9yVGlsZUZlYXR1cmUucHJvdG90eXBlLmxvYWRHZW9tZXRyeSA9IGZ1bmN0aW9uKCkge1xuICAgIHZhciBwYmYgPSB0aGlzLl9wYmY7XG4gICAgcGJmLnBvcyA9IHRoaXMuX2dlb21ldHJ5O1xuXG4gICAgdmFyIGVuZCA9IHBiZi5yZWFkVmFyaW50KCkgKyBwYmYucG9zLFxuICAgICAgICBjbWQgPSAxLFxuICAgICAgICBsZW5ndGggPSAwLFxuICAgICAgICB4ID0gMCxcbiAgICAgICAgeSA9IDAsXG4gICAgICAgIGxpbmVzID0gW10sXG4gICAgICAgIGxpbmU7XG5cbiAgICB3aGlsZSAocGJmLnBvcyA8IGVuZCkge1xuICAgICAgICBpZiAoIWxlbmd0aCkge1xuICAgICAgICAgICAgdmFyIGNtZExlbiA9IHBiZi5yZWFkVmFyaW50KCk7XG4gICAgICAgICAgICBjbWQgPSBjbWRMZW4gJiAweDc7XG4gICAgICAgICAgICBsZW5ndGggPSBjbWRMZW4gPj4gMztcbiAgICAgICAgfVxuXG4gICAgICAgIGxlbmd0aC0tO1xuXG4gICAgICAgIGlmIChjbWQgPT09IDEgfHwgY21kID09PSAyKSB7XG4gICAgICAgICAgICB4ICs9IHBiZi5yZWFkU1ZhcmludCgpO1xuICAgICAgICAgICAgeSArPSBwYmYucmVhZFNWYXJpbnQoKTtcblxuICAgICAgICAgICAgaWYgKGNtZCA9PT0gMSkgeyAvLyBtb3ZlVG9cbiAgICAgICAgICAgICAgICBpZiAobGluZSkgbGluZXMucHVzaChsaW5lKTtcbiAgICAgICAgICAgICAgICBsaW5lID0gW107XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGxpbmUucHVzaChuZXcgUG9pbnQoeCwgeSkpO1xuXG4gICAgICAgIH0gZWxzZSBpZiAoY21kID09PSA3KSB7XG4gICAgICAgICAgICBsaW5lLnB1c2gobGluZVswXS5jbG9uZSgpKTsgLy8gY2xvc2VQb2x5Z29uXG5cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcigndW5rbm93biBjb21tYW5kICcgKyBjbWQpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgaWYgKGxpbmUpIGxpbmVzLnB1c2gobGluZSk7XG5cbiAgICByZXR1cm4gbGluZXM7XG59O1xuXG5WZWN0b3JUaWxlRmVhdHVyZS5wcm90b3R5cGUuYmJveCA9IGZ1bmN0aW9uKCkge1xuICAgIHZhciBwYmYgPSB0aGlzLl9wYmY7XG4gICAgcGJmLnBvcyA9IHRoaXMuX2dlb21ldHJ5O1xuXG4gICAgdmFyIGVuZCA9IHBiZi5yZWFkVmFyaW50KCkgKyBwYmYucG9zLFxuICAgICAgICBjbWQgPSAxLFxuICAgICAgICBsZW5ndGggPSAwLFxuICAgICAgICB4ID0gMCxcbiAgICAgICAgeSA9IDAsXG4gICAgICAgIHgxID0gSW5maW5pdHksXG4gICAgICAgIHgyID0gLUluZmluaXR5LFxuICAgICAgICB5MSA9IEluZmluaXR5LFxuICAgICAgICB5MiA9IC1JbmZpbml0eTtcblxuICAgIHdoaWxlIChwYmYucG9zIDwgZW5kKSB7XG4gICAgICAgIGlmICghbGVuZ3RoKSB7XG4gICAgICAgICAgICB2YXIgY21kTGVuID0gcGJmLnJlYWRWYXJpbnQoKTtcbiAgICAgICAgICAg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A9IDA7IGogPCBsaW5lLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICB2YXIgcCA9IGxpbmVbal0sIHkyID0gMTgwIC0gKHAueSArIHkwKSAqIDM2MCAvIHNpemU7XG4gICAgICAgICAgICBsaW5lW2pdID0gW1xuICAgICAgICAgICAgICAgIChwLnggKyB4MCkgKiAzNjAgLyBzaXplIC0gMTgwLFxuICAgICAgICAgICAgICAgIDM2MCAvIE1hdGguUEkgKiBNYXRoLmF0YW4oTWF0aC5leHAoeTIgKiBNYXRoLlBJIC8gMTgwKSkgLSA5MFxuICAgICAgICAgICAgXTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlmICh0eXBlID09PSAnUG9pbnQnICYmIGNvb3Jkcy5sZW5ndGggPT09IDEpIHtcbiAgICAgICAgY29vcmRzID0gY29vcmRzWzBdWzBdO1xuICAgIH0gZWxzZSBpZiAodHlwZSA9PT0gJ1BvaW50Jykge1xuICAgICAgICBjb29yZHMgPSBjb29yZHNbMF07XG4gICAgICAgIHR5cGUgPSAnTXVsdGlQb2ludCc7XG4gICAgfSBlbHNlIGlmICh0eXBlID09PSAnTGluZVN0cmluZycgJiYgY29vcmRzLmxlbmd0aCA9PT0gMSkge1xuICAgICAgICBjb29yZHMgPSBjb29yZHNbMF07XG4gICAgfSBlbHNlIGlmICh0eXBlID09PSAnTGluZVN0cmluZycpIHtcbiAgICAgICAgdHlwZSA9ICdNdWx0aUxpbmVTdHJpbmcnO1xuICAgIH1cblxuICAgIHJldHVybiB7XG4gICAgICAgIHR5cGU6IFwiRmVhdHVyZVwiLFxuICAgICAgICBnZW9tZXRyeToge1xuICAgICAgICAgICAgdHlwZTogdHlwZSxcbiAgICAgICAgICAgIGNvb3JkaW5hdGVzOiBjb29yZHNcbiAgICAgICAgfSxcbiAgICAgICAgcHJvcGVydGllczogdGhpcy5wcm9wZXJ0aWVzXG4gICAgfTtcbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbnZhciBWZWN0b3JUaWxlR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Hlnb25zW3BdO1xuXG4gICAgICAgIC8vIEZpbmQgcG9seWdvbiBleHRlbnRzIHRvIGNhbGN1bGF0ZSBVVnMsIGZpdCB0aGVtIHRvIHRoZSBheGlzLWFsaWduZWQgYm91bmRpbmcgYm94XG4gICAgICAgIGlmICh0ZXhjb29yZF9pbmRleCkge1xuICAgICAgICAgICAgdmFyIFttaW5feCwgbWluX3ksIG1heF94LCBtYXhfeV0gPSBHZW8uZmluZEJvdW5kaW5nQm94KHBvbHlnb24pO1xuICAgICAgICAgICAgdmFyIHNwYW5feCA9IG1heF94IC0gbWluX3g7XG4gICAgICAgICAgICB2YXIgc3Bhbl95ID0gbWF4X3kgLSBtaW5feTtcbiAgICAgICAgICAgIHZhciBzY2FsZV91ID0gKG1heF91IC0gbWluX3UpIC8gc3Bhbl94O1xuICAgICAgICAgICAgdmFyIHNjYWxlX3YgPSAobWF4X3YgLSBtaW5fdikgLyBzcGFuX3k7XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKHZhciByaW5nX2luZGV4ID0gMDsgcmluZ19pbmRleCA8IHBvbHlnb24ubGVuZ3RoOyByaW5nX2luZGV4Kyspe1xuICAgICAgICAgICAgLy8gQWRkIHZlcnRleCBkYXRhXG4gICAgICAgICAgICB2YXIgcG9seWdvbl9yaW5nID0gcG9seWdvbltyaW5nX2luZGV4XTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcG9seWdvbl9yaW5nLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgdmFyIHZlcnRleCA9IHBvbHlnb25fcmluZ1tpXTtcbiAgICAgICAgICAgICAgICB2ZXJ0ZXhfdGVtcGxhdGVbMF0gPSB2ZXJ0ZXhbMF07XG4gICAgICAgICAgICAgICAgdmVydGV4X3RlbXBsYXRlWzFdID0gdmVydGV4WzFdO1xuXG4gICAgICAgICAgICAgICAgLy8gQWRkIFVWc1xuICAgICAgICAgICAgICAgIGlmICh0ZXhjb29yZF9pbmRleCkge1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ICAgICAgICBbbWluX3UsIG1pbl92XSxcbiAgICAgICAgICAgIFttYXhfdSwgbWluX3ZdLFxuICAgICAgICAgICAgW21heF91LCBtYXhfdl1cbiAgICAgICAgXTtcbiAgICB9XG5cbiAgICB2YXIgbnVtX3BvbHlnb25zID0gcG9seWdvbnMubGVuZ3RoO1xuICAgIGZvciAodmFyIHA9MDsgcCA8IG51bV9wb2x5Z29uczsgcCsrKSB7XG4gICAgICAgIHZhciBwb2x5Z29uID0gcG9seWdvbnNbcF07XG5cbiAgICAgICAgZm9yICh2YXIgcT0wOyBxIDwgcG9seWdvbi5sZW5ndGg7IHErKykge1xuICAgICAgICAgICAgdmFyIGNvbnRvdXIgPSBwb2x5Z29uW3FdO1xuXG4gICAgICAgICAgICBmb3IgKHZhciB3PTA7IHcgPCBjb250b3VyLmxlbmd0aCAtIDE7IHcrKykge1xuICAgICAgICAgICAgICAgIGlmIChyZW1vdmVfdGlsZV9lZGdlcyAmJiBvdXRzaWRlVGlsZShjb250b3VyW3ddLCBjb250b3VyW3crMV0sIHRpbGVfZWRnZV90b2xlcmFuY2UpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOyAvLyBkb24ndCBleHRydWRlIHRpbGUgZWRnZXNcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBXYWxsIG9yZGVyIGlzIGRlcGVuZGVudCBvbiB3aW5kaW5nIG9yZGVyLCBzbyB0aGF0IG5vcm1hbHMgZmFjZSBvdXR3YXJkXG4gICAgICAgICAgICAgICAgbGV0IHcwLCB3MTtcbiAgICAgICAgICAgICAgICBpZiAod2luZGluZyA9PT0gJ0NDVycpIHtcbiAgICAgICAgICAgICAgICAgICAgdzAgPSB3O1xuICAgICAgICAgICAgICAgICAgICB3MSA9IHcrMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHcwID0gdysxO1xuICAgICAgICAgICAgICAgICAgICB3MSA9IHc7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gVHdvIHRyaWFuZ2xlcyBmb3IgdGhlIHF1YWQgZm9ybWVkIGJ5IGVhY2ggdmVydGV4IHBhaXIsIGdvaW5nIGZyb20gYm90dG9tIHRvIHRvcCBoZWlnaHRcbiAgICAgICAgICAgICAgICB2YXIgd2FsbF92ZXJ0aWNlcyA9IFtcbiAgICAgICAgICAgICAgICAgICAgW2NvbnRvdXJbdzFdWzBdLCBjb250b3VyW3cxXVsxXSwgbWF4X3pdLFxuICAgICAgICAgICAgICAgICAgICBbY29udG91clt3MV1bMF0sIGNvbnRvdXJbdzFdWzFdLCBtaW5fel0sXG4gICAgICAgICAgICAgICAgICAgIFtjb250b3VyW3cwXVswXSwgY29udG91clt3MF1bMV0sIG1pbl96XSxcbiAgICAgICAgICAgICAgICAgICAgW2NvbnRvdXJbdzBdWzBdLCBjb250b3VyW3cwXVsxXSwgbWF4X3pdXG4gICAgICAgICAgICAgICAgXTtcblxuICAgICAgICAgICAgICAgIC8vIENhbGMgdGhlIG5vcm1hbCBvZiB0aGUgd2FsbCBmcm9tIHVwIHZlY3RvciBhbmQgb25lIHNlZ21lbnQgb2YgdGhlIHdhbGwgdHJpYW5nbGVzXG4gICAgICAgICAgICAgICAgbGV0IHdhbGxfdmVjID0gVmVjdG9yLm5vcm1hbGl6ZShbY29udG91clt3MV1bMF0gLSBjb250b3VyW3cwXVswXSwgY29udG91clt3MV1bMV0gLSBjb250b3VyW3cwXVsxXSwgMF0pO1xuICAgICAgICAgICAgICAgIGxldCBub3JtYWwgPSBWZWN0b3IuY3Jvc3ModXBfdmVjMywgd2FsbF92ZWMpO1xuXG4gICAgICAgICAgICAgICAgLy8gVXBkYXRlIHZlcnRleCB0ZW1wbGF0ZSB3aXRoIGN1cnJlbnQgc3VyZmFjZSBub3JtYWxcbiAgICAgICAgICAgICAgICB2ZXJ0ZXhfdGVtcGxhdGVbbm9ybWFsX2luZGV4ICsgMF0gPSBub3JtYWxbMF0gKiBub3JtYWxfbm9ybWFsaXplO1xuICAgICAgICAgICAgICAgIHZlcnRleF90ZW1wbGF0ZVtub3JtYWxfaW5kZXggKyAxXSA9IG5vcm1hbFsxXSAqIG5vcm1hbF9ub3JtYWxpemU7XG4gICAgICAgICAgICAgICAgdmVydGV4X3RlbXBsYXRlW25vcm1hbF9pbmRleCArIDJdID0gbm9ybWFsWzJdICogbm9ybWFsX25vcm1hbGl6ZTtcblxuICAgICAgICAgICAgICAgIGZvciAodmFyIHd2PTA7IHd2IDwgd2FsbF92ZXJ0aWNlcy5sZW5ndGg7IHd2KyspIHtcbiAgICAgICAgICAgICAgICAgICAgdmVydGV4X3RlbXBsYXRlWzBdID0gd2FsbF92ZXJ0aWNlc1t3dl1bMF07XG4gICAgICAgICAgICAgICAgICAgIHZlcnRleF90ZW1wbGF0ZVsxXSA9IHdhbGxfdmVydGljZXNbd3ZdWzFdO1xuICAgICAgICAgICAgICAgICAgICB2ZXJ0ZXhfdGVtcGxhdGVbMl0gPSB3YWxsX3ZlcnRpY2VzW3d2XVsyXTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAodGV4Y29vcmRfaW5kZXgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZlcnRleF90ZW1wbGF0ZVt0ZXhjb29yZF9pbmRleCArIDBdID0gdGV4Y29vcmRzW3d2XVswXSAqIHRleGNvb3JkX25vcm1hbGl6ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZlcnRleF90ZW1wbGF0ZVt0ZXhjb29yZF9pbmRleCArIDFdID0gdGV4Y29vcmRzW3d2XVsxXSAqIHRleGNvb3JkX25vcm1hbGl6ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIHZlcnRleF9kYXRhLmFkZFZlcnRleCh2ZXJ0ZXhfdGVtcGxhdGUpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZlcnR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G4gICAgICAgIHZhciBuZXh0SW5kZXggPSBpICsgMTtcbiAgICAgICAgY29vcmRDdXJyID0gbGluZVtjdXJySW5kZXhdO1xuICAgICAgICBjb29yZE5leHQgPSBsaW5lW25leHRJbmRleF07XG5cbiAgICAgICAgLy8gU2tpcCByZWR1bmRhbnQgdmVydGljZXNcbiAgICAgICAgaWYgKFZlY3Rvci5pc0VxdWFsKGNvb3JkQ3VyciwgY29vcmROZXh0KSkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBSZW1vdmUgdGlsZSBib3VuZGFyaWVzXG4gICAgICAgIGlmIChyZW1vdmVfdGlsZV9lZGdlcyAmJiBvdXRzaWRlVGlsZShjb29yZEN1cnIsIGNvb3JkTmV4dCwgdGlsZV9lZGdlX3RvbGVyYW5jZSkpIHtcbiAgICAgICAgICAgIGFkZFZlcnRleChjb29yZEN1cnIsIG5vcm1OZXh0LCBbMSwgdl0sIGNvbnRleHQpO1xuICAgICAgICAgICAgYWRkVmVydGV4KGNvb3JkQ3VyciwgVmVjdG9yLm5lZyhub3JtTmV4dCksIFswLCB2XSwgY29udGV4dCk7XG4gICAgICAgICAgICBpbmRleFBhaXJzKDEsIGNvbnRleHQpO1xuXG4gICAgICAgICAgICB2YXIgbm9uQm91bmRhcnlMaW5lcyA9IGdldE5leHROb25Cb3VuZGFyeVNlZ21lbnQobGluZSwgY3VyckluZGV4ICsgMSwgdGlsZV9lZGdlX3RvbGVyYW5jZSk7XG4gICAgICAgICAgICBpZiAobm9uQm91bmRhcnlMaW5lcykge1xuICAgICAgICAgICAgICAgIGV4dHJhX2xpbmVzLnB1c2gobm9uQm91bmRhcnlMaW5lcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBub3JtUHJldiA9IG5vcm1OZXh0O1xuICAgICAgICBub3JtTmV4dCA9IFZlY3Rvci5ub3JtYWxpemUoVmVjdG9yLnBlcnAo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AgICAgICAgICAgIGZhbHNlLCBjb250ZXh0XG4gICAgICAgICAgICApO1xuICAgICAgICB9XG5cbiAgICAgICAgYWRkVmVydGV4KGNvb3JkQ3VyciwgbWl0ZXJWZWMsIFsxLCB2XSwgY29udGV4dCk7XG4gICAgICAgIGFkZFZlcnRleChjb29yZEN1cnIsIFZlY3Rvci5uZWcobm9ybU5leHQpLCBbMCwgdl0sIGNvbnRleHQpO1xuICAgIH1cbiAgICBlbHNlIHtcbiAgICAgICAgYWRkVmVydGV4KGNvb3JkQ3Vyciwgbm9ybVByZXYsIFsxLCB2XSwgY29udGV4dCk7XG4gICAgICAgIGFkZFZlcnRleChjb29yZEN1cnIsIFZlY3Rvci5uZWcobWl0ZXJWZWMpLCBbMCwgdl0sIGNvbnRleHQpO1xuXG4gICAgICAgIGlmICghaXNCZWdpbm5pbmcpIHtcbiAgICAgICAgICAgIGluZGV4UGFpcnMoMSwgY29udGV4dCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoam9pbl90eXBlID09PSBKT0lOX1RZUEUuYmV2ZWwpIHtcbiAgICAgICAgICAgIGFkZEJldmVsKGNvb3JkQ3VycixcbiAgICAgICAgICAgICAgICBub3JtUHJldiwgVmVjdG9yLm5lZyhtaXRlclZlYyksIG5vcm1OZXh0LFxuICAgICAgICAgICAgICAgIFsxLCB2XSwgWzAsIHZdLCBbMSwgdl0sXG4gICAgICAgICAgICAgICAgY29udGV4dFxuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChqb2luX3R5cGUgPT09IEpPSU5fVFlQRS5yb3VuZCkge1xuICAgICAgICAgICAgYWRkRmFuKGNvb3JkQ3VycixcbiAgICAgICAgICAgICAgICBub3JtUHJldiwgVmVjdG9yLm5lZyhtaXRlclZlYyksIG5vcm1OZXh0LFxuICAgICAgICAgICAgICAgIFsxLCB2XSwgWzAsIHZdLCBbMSwgdl0sXG4gICAgICAgICAgICAgICAgZmFsc2UsIGNvbnRleHRcbi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BpZiAoaXNDYXApe1xuICAgICAgICAgICAgICAgIC8vIFVWIHRleHR1cmVzIGdvIFwidGhyb3VnaFwiIHRoZSBjYXBcbiAgICAgICAgICAgICAgICBhZmZpbmVfdXZDdXJyID0gVmVjdG9yLnJvdChhZmZpbmVfdXZDdXJyLCBhbmdsZV9zdGVwKTtcbiAgICAgICAgICAgICAgICB1dkN1cnJbMF0gPSBhZmZpbmVfdXZDdXJyWzBdICsgdXZDWzBdO1xuICAgICAgICAgICAgICAgIHV2Q3VyclsxXSA9IGFmZmluZV91dkN1cnJbMV0gKiBjb250ZXh0LnRleGNvb3JkX3dpZHRoICogY29udGV4dC52X3NjYWxlICsgdXZDWzFdOyAvLyBzY2FsZSB0aGUgdi1jb29yZGluYXRlXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBVViB0ZXh0dXJlcyBnbyBcImFyb3VuZFwiIHRoZSBqb2luXG4gICAgICAgICAgICAgICAgdXZDdXJyID0gVmVjdG9yLmFkZCh1dkN1cnIsIHV2X2RlbHRhKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGFkZFZlcnRleChjb29yZCwgYmxhZGUsIHV2Q3VyciwgY29udGV4dCk7XG5cbiAgICAgICAgdmVydGV4X2VsZW1lbnRzLnB1c2gocGl2b3RJbmRleCArIGkgKyAoKGNyb3NzID4gMCkgPyAyIDogMSkpO1xuICAgICAgICB2ZXJ0ZXhfZWxlbWVudHMucHVzaChwaXZvdEluZGV4KTtcbiAgICAgICAgdmVydGV4X2VsZW1lbnRzLnB1c2gocGl2b3RJbmRleCArIGkgKyAoKGNyb3NzID4gMCkgPyAxIDogMikpO1xuICAgIH1cbn1cblxuLy8gIGFkZEJldmVsICAgIEEgLS0tLS0gQlxuLy8gICAgICAgICAgICAgLyBcXCAgICAgLyBcXFxuLy8gICAgICAgICAgIC8gICAvXFwgICAvXFwgIFxcXG4vLyAgICAgICAgICAgICAg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0ZXgoY29vcmQsIG5vcm1hbCwgWzEsIHZdLCBjb250ZXh0KTtcbiAgICAgICAgICAgICAgICBhZGRWZXJ0ZXgoY29vcmQsIG5lZ19ub3JtYWwsIFswLCB2XSwgY29udGV4dCk7XG5cbiAgICAgICAgICAgICAgICAvLyBBZGQgbGVuZ3RoIG9mIHNxdWFyZSBjYXAgdG8gdGV4dHVyZSBjb29yZGluYXRlXG4gICAgICAgICAgICAgICAgdiArPSAwLjUgKiBjb250ZXh0LnRleGNvb3JkX3dpZHRoICogY29udGV4dC52X3NjYWxlO1xuXG4gICAgICAgICAgICAgICAgYWRkVmVydGV4KGNvb3JkLCBWZWN0b3IuYWRkKG5vcm1hbCwgdGFuZ2VudCksIFsxLCB2XSwgY29udGV4dCk7XG4gICAgICAgICAgICAgICAgYWRkVmVydGV4KGNvb3JkLCBWZWN0b3IuYWRkKG5lZ19ub3JtYWwsIHRhbmdlbnQpLCBbMCwgdl0sIGNvbnRleHQpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpbmRleFBhaXJzKDEsIGNvbnRleHQpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgQ0FQX1RZUEUucm91bmQ6XG4gICAgICAgICAgICB2YXIgbkEsIG5CLCB1dkEsIHV2QiwgdXZDO1xuICAgICAgICAgICAgaWYgKGlzQmVnaW5uaW5nKSB7XG4gICAgICAgICAgICAgICAgbkEgPSBub3JtYWw7XG4gICAgICAgICAgICAgICAgbkIgPSBuZWdfbm9ybWFsO1xuXG4gICAgICAgICAgICAgICAgaWYgKGNvbnRleHQudGV4Y29vcmRfaW5kZXggIT09IHVuZGVmaW5lZCl7XG4gICAgICAgICAgICAgICAgICAgIHYgKz0gMC41ICogY29udGV4dC50ZXhjb29yZF93aWR0aCAqIGNvbnRleHQudl9zY2FsZTtcbiAgICAgICAgICAgICAgICAgICAgdXZBID0gWzEsIHZdO1xuICAgICAgICAgICAgICAgICAgICB1dkIgPSBbMCwgdl07XG4gICAgICAgICAgICAgICAgICAgIHV2QyA9IFswLjUsIHZdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIG5BID0gbmVnX25vcm1hbDtcbiAgICAgICAgICAgICAgICBuQiA9IG5vcm1hbDtcblxuICAgICAgICAgICAgICAgIGlmIChjb250ZXh0LnRleGNvb3JkX2luZGV4ICE9PSB1bmRlZmluZWQpe1xuICAgICAgICAgICAgICAgICAgICB1dkEgPSBbMCwgdl07XG4gICAgICAgICAgICAgICAgICAgIHV2QiA9IFsxLCB2XTtcbiAgICAgICAgICAgICAgICAgICAgdXZDID0gWzAuNSwgdl07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBhZGRGYW4oY29vcmQsXG4gICAgICAgICAgICAgICAgbkEsIHplcm9fdmVjMiwgbkIsXG4gICAgICAgICAgICAgICAgdXZBLCB1dkMsIHV2QixcbiAgICAgICAgICAgICAgICB0cnVlLCBjb250ZXh0XG4gICAgICAgICAgICApO1xuXG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBDQVBfVFlQRS5idXR0OlxuICAgICAgICAgICAgcmV0dXJuO1xuICAgIH1cbn1cblxuLy8gQ2FsY3VsYXRlIG51bWJlciBvZiB0cmlhbmdsZXMgZm9yIGEgZmFuIGdpdmVuIGFuIGFuZ2xlIGFuZCBsaW5lIHdpZHRoXG5mdW5jdGlvbiB0cmlhbmdsZXNQZXJBcmMgKGFuZ2xlLCB3aWR0aCkge1xuICAgIGlmIChhbmdsZSA8IDApIHtcbiAgICAgICAgYW5nbGUgPSAtYW5nbGU7XG4gICAgfVxuXG4gICAgdmFyIG51bVRyaWFuZ2xlcyA9ICh3aWR0aCA+IDIgKiBERUZBVUxULk1JTl9GQU5fV0lEVEgpID8gTWF0aC5sb2cyKHdpZHRoIC8gREVGQVVMVC5NSU5fRkFOX1dJRFRIKSA6I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gIGIyLnN3LnkgPiBiMS5uZS55IHx8XG4gICAgICAgIGIyLm5lLnkgPCBiMS5zdy55XG4gICAgKTtcbn07XG5cbi8vIEZpbmRzIHRoZSBheGlzLWFsaWduZWQgYm91bmRpbmcgYm94IGZvciBhIHBvbHlnb25cbkdlby5maW5kQm91bmRpbmdCb3ggPSBmdW5jdGlvbiAocG9seWdvbikge1xuICAgIHZhciBtaW5feCA9IEluZmluaXR5LFxuICAgICAgICBtYXhfeCA9IC1JbmZpbml0eSxcbiAgICAgICAgbWluX3kgPSBJbmZpbml0eSxcbiAgICAgICAgbWF4X3kgPSAtSW5maW5pdHk7XG5cbiAgICAvLyBPbmx5IG5lZWQgdG8gZXhhbWluZSBvdXRlciByaW5nIChwb2x5Z29uWzBdKVxuICAgIHZhciBudW1fY29vcmRzID0gcG9seWdvblswXS5sZW5ndGg7XG4gICAgZm9yICh2YXIgYz0wOyBjIDwgbnVtX2Nvb3JkczsgYysrKSB7XG4gICAgICAgIHZhciBjb29yZCA9IHBvbHlnb25bMF1bY107XG5cbiAgICAgICAgaWYgKGNvb3JkWzBdIDwgbWluX3gpIHtcbiAgICAgICAgICAgIG1pbl94ID0gY29vcmRbMF07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvb3JkWzFdIDwgbWluX3kpIHtcbiAgICAgICAgICAgIG1pbl95ID0gY29vcmRbMV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvb3JkWzBdID4gbWF4X3gpIHtcbiAgICAgICAgICAgIG1heF94ID0gY29vcmRbMF07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvb3JkWzFdID4gbWF4X3kpIHtcbiAgICAgICAgICAgIG1heF95ID0gY29vcmRbMV07XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gW21pbl94LCBtaW5feSwgbWF4X3gsIG1heF95XTtcbn07XG5cbi8vIENvbnZlcnQgZ2VvbWV0cnkgdHlwZSB0byBvbmUgb2Y6ICdwb2ludCcsICdsaW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ZWMzLCB2ZWM0KVxuICAgICAgICAgICAgICAgIGlmICh1bmlmb3JtLmxlbmd0aCA+PSAyICYmIHVuaWZvcm0ubGVuZ3RoIDw9IDQpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyc2VkLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ3ZlYycgKyB1bmlmb3JtLmxlbmd0aCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogdW5pZm9ybS5sZW5ndGggKyAnZnYnLFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB1bmlmb3JtLFxuICAgICAgICAgICAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICAgICAgICAgICAgdW5pZm9ybXNcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGZsb2F0IGFycmF5XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAodW5pZm9ybS5sZW5ndGggPiA0KSB7XG4gICAgICAgICAgICAgICAgICAgIHBhcnNlZC5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdmbG9hdFtdJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJzFmdicsXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBuYW1lICsgJ1swXScsXG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdW5pZm9ybSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVuaWZvcm1zXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBUT0RPOiBhc3N1bWUgbWF0cml4IGZvciAodHlwZW9mID09IEZsb2F0MzJBcnJheSAmJiBsZW5ndGggPT0gMTYpP1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gQXJyYXkgb2YgdGV4dHVyZXNcbiAgICAgICAgICAgIGVsc2UgaWYgKHR5cGVvZiB1bmlmb3JtWzBdID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGZvciAodT0wOyB1IDwgdW5pZm9ybS5sZW5ndGg7IHUrKykge1xuICAgICAgICAgICAgICAgICAgICBwYXJzZWQucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAnc2FtcGxlcjJEJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJzFpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IG5hbWUgKyAnWycgKyB1ICsgJ10nLFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHVuaWZvcm1bdV0sXG4gICAgICAgICAgICAgICAgICAgICAgICBrZXk6IHUsXG4gICAgICAgICAgICAgICAgICAgICAgICB1bmlmb3JtczogdW5pZm9ybVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBBcnJheSBvZiBhcnJheXMgLSBidXQgb25seSBhcnJheXMgb2YgdmVjdG9ycyBhcmUgYWxsb3dlZCBpbiB0aGlzIGNhc2VcbiAgICAgICAgICAgIGVsc2UgaWYgKEFycmF5LmlzQXJyYXkodW5pZm9ybVswXSkgJiYgdHlwZW9mIHVuaWZvcm1bMF1bMF0gPT09ICdudW1iZXInKSB7XG4gICAgICAgICAgICAgICAgLy8gZmxvYXQgdmVjdG9ycyAodmVjMiwgdmVjMywgdmVjNClcbiAgICAgICAgICAgICAgICBpZiAodW5pZm9ybVswXS5sZW5ndGggPj0gMiAmJiB1bmlmb3JtWzBdLmxlbmd0aCA8PSA0KSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIFNldCBlYWNoIHZlY3RvciBpbiB0aGUgYXJyYXlcbiAgICAgICAgICAgICAgICAgICAgZm9yICh1PTA7IHUgPCB1bmlmb3JtLmxlbmd0aDsgdSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZWQucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ3ZlYycgKyB1bmlmb3JtWzBdLmxlbmd0aCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6IHVuaWZvcm1bdV0ubGVuZ3RoICsgJ2Z2JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBuYW1lICsgJ1snICsgdSArICddJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdW5pZm9ybVt1XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IHUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pZm9ybXM6IHVuaWZvcm1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gVE9ETzogZWxzZSB3YXJuaW5nXG4gICAgICAgIH1cbiAgICAgICAgLy8gQm9vbGVhblxuICAgICAgICBlbHNlIGlmICh0eXBlb2YgdW5pZm9ybSA9PT0gJ2Jvb2xlYW4nKSB7XG4gICAgICAgICAgICBwYXJzZWQucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogJ2Jvb2wnLFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJzFpJyxcbiAgICAgICAgICAgICAgICBuYW1lLFxuICAgICAgICAgICAgICAgIHZhbHVlOiB1bmlmb3JtLFxuICAgICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgICB1bmlmb3Jtc1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gVGV4dHVyZVxuICAgICAgICBlbHNlIGlmICh0eXBlb2YgdW5pZm9ybSA9PT0gJ3N0cmluZycpIHtcbiAg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0aGlzLmJsZW5kaW5nID0gbmV3IFJlbmRlclN0YXRlKHtcbiAgICAgICAgICAgICAgICBibGVuZDogdGhpcy5kZWZhdWx0cy5ibGVuZGluZyxcbiAgICAgICAgICAgICAgICBzcmM6IHRoaXMuZGVmYXVsdHMuYmxlbmRpbmdfc3JjLFxuICAgICAgICAgICAgICAgIGRzdDogdGhpcy5kZWZhdWx0cy5ibGVuZGluZ19kc3QsXG4gICAgICAgICAgICAgICAgc3JjX2FscGhhOiB0aGlzLmRlZmF1bHRzLmJsZW5kaW5nX3NyY19hbHBoYSxcbiAgICAgICAgICAgICAgICBkc3RfYWxwaGE6IHRoaXMuZGVmYXVsdHMuYmxlbmRpbmdfZHN0X2FscGhhXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgKHZhbHVlKSA9PiB7XG4gICAgXHRcdFx0aWYgKHZhbHVlLmJsZW5kKSB7XG4gICAgICAgICAgICBcdFx0Z2wuZW5hYmxlKGdsLkJMRU5EKTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUuc3JjX2FscGhhICYmIHZhbHVlLmRzdF9hbHBoYSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZ2wuYmxlbmRGdW5jU2VwYXJhdGUodmFsdWUuc3JjLCB2YWx1ZS5kc3QsIHZhbHVlLnNyY19hbHBoYSwgdmFsdWUuZHN0X2FscGhhKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGdsLmJsZW5kRnVuYyh2YWx1ZS5zcmMsIHZhbHVlLmRzdCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICBcdFx0XHR9IGVsc2Uge1xuICAgIFx0XHRcdFx0Z2wuZGlzYWJsZShnbC5CTEVORCk7XG4gICAgXHRcdFx0fVxuICAgIFx0XHR9XG4gICAgXHQpO1xuXG4gICAgXHQvLyBEZXB0aCB3cml0ZVxuICAgICAgICB0aGlzLm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ICAgLy8gR2F0aGVyIGFsbCBibG9jayBjb2RlIHNuaXBwZXRzXG4gICAgICAgIHZhciBibG9ja3MgPSB0aGlzLmJ1aWxkU2hhZGVyQmxvY2tMaXN0KCk7XG4gICAgICAgIHZhciByZWdleHA7XG5cbiAgICAgICAgZm9yICh2YXIga2V5IGluIGJsb2Nrcykge1xuICAgICAgICAgICAgdmFyIGJsb2NrID0gYmxvY2tzW2tleV07XG4gICAgICAgICAgICBpZiAoIWJsb2NrIHx8IChBcnJheS5pc0FycmF5KGJsb2NrKSAmJiBibG9jay5sZW5ndGggPT09IDApKSB7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIEZpcnN0IGZpbmQgY29kZSByZXBsYWNlIHBvaW50cyBpbiBzaGFkZXJzXG4gICAgICAgICAgICByZWdleHAgPSBuZXcgUmVnRXhwKCdeXFxcXHMqI3ByYWdtYVxcXFxzK3RhbmdyYW06XFxcXHMrJyArIGtleSArICdcXFxccyokJywgJ20nKTtcbiAgICAgICAgICAgIHZhciBpbmplY3RfdmVydGV4ID0gdGhpcy5jb21wdXRlZF92ZXJ0ZXhfc291cmNlLm1hdGNoKHJlZ2V4cCk7XG4gICAgICAgICAgICB2YXIgaW5qZWN0X2ZyYWdtZW50ID0gdGhpcy5jb21wdXRlZF9mcmFnbWVudF9zb3VyY2UubWF0Y2gocmVnZXhwKTtcblxuICAgICAgICAgICAgLy8gQXZvaWQgbmV0d29yayByZXF1ZXN0IGlmIG5vdGhpbmcgdG8gcmVwbGFjZVxuICAgICAgICAgICAgaWYgKGluamVjdF92ZXJ0ZXggPT0gbnVsbCAmJiBpbmplY3RfZnJhZ21lbnQgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBDb21iaW5lIGFsbCBibG9ja3MgaW50byBvbmUgc3RyaW5nXG4gICAgICAgICAgICB2YXIgc291cmNlID0gJyc7XG4gICAgICAgICAgICBibG9jay5mb3JFYWNoKHZhbCA9PiB7XG4gICAgICAgICAgICAgICAgLy8gTWFyayBzdGFydCBhbmQgZW5kIG9mIGVhY2ggYmxvY2sgd2l0aCBtZXRhZGF0YSAod2hpY2ggY2FuIGJlIGV4dHJhY3RlZCBmcm9tXG4gICAgICAgICAgICAgICAgLy8gZmluYWwgc291cmNlIGZvciBlcnJvciBoYW5kbGluZywgZGVidWdnaW5nLCBldGMuKVxuICAgICAgICAgICAgICAgIGxldCBtYXJrID0gYCR7dmFsLnNjb3BlfSwgJHt2YWwua2V5fSwgJHt2YWwubnVtfWA7XG4gICAgICAgICAgICAgICAgc291cmNlICs9IGBcXG4vLyB0YW5ncmFtLWJsb2NrLXN0YXJ0OiAke21hcmt9XFxuYDtcbiAgICAgICAgICAgICAgICBzb3VyY2UgKz0gdmFsLnNvdXJjZTtcbiAgICAgICAgICAgICAgICBzb3VyY2UgKz0gYFxcbi8vIHRhbmdyYW0tYmxvY2stZW5kOiAke21hcmt9XFxuYDtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAvLyBJbmplY3RcbiAgICAgICAgICAgIGlmIChpbmplY3RfdmVydGV4ICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmNvbXB1dGVkX3ZlcnRleF9zb3VyY2UgPSB0aGlzLmNvbXB1dGVkX3ZlcnRleF9zb3VyY2UucmVwbGFjZShyZWdleHAsIHNvdXJjZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaW5qZWN0X2ZyYWdtZW50ICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmNvbXB1dGVkX2ZyYWdtZW50X3NvdXJjZSA9IHRoaXMuY29tcHV0ZWRfZnJhZ21lbnRfc291cmNlLnJlcGxhY2UocmVnZXhwLCBzb3VyY2UpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBBZGQgYSAjZGVmaW5lIGZ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yYW0nIH07XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGJsb2Nrc1trZXldID0gW3sga2V5LCBzb3VyY2U6IFNoYWRlclByb2dyYW0uYmxvY2tzW2tleV0sIG51bTogMCwgc2NvcGU6ICdTaGFkZXJQcm9ncmFtJyB9XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFByb2dyYW0tc3BlY2lmaWMgYmxvY2tzXG4gICAgICAgIGZvciAoa2V5IGluIHRoaXMuYmxvY2tzKSB7XG4gICAgICAgICAgICBibG9ja3Nba2V5XSA9IGJsb2Nrc1trZXldIHx8IFtdO1xuXG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheSh0aGlzLmJsb2Nrc1trZXldKSkge1xuICAgICAgICAgICAgICAgIGxldCBzY29wZXMgPSAodGhpcy5ibG9ja19zY29wZXMgJiYgdGhpcy5ibG9ja19zY29wZXNba2V5XSkgfHwgW107XG4gICAgICAgICAgICAgICAgbGV0IGN1cl9zY29wZSA9IG51bGwsIG51bSA9IDA7XG5cbiAgICAgICAgICAgICAgICBmb3IgKGxldCBiPTA7IGIgPCB0aGlzLmJsb2Nrc1trZXldLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIENvdW50IGJsb2NrcyByZWxhdGl2ZSB0byBjdXJyZW50IHNjb3BlXG4gICAgICAgICAgICAgICAgICAgIGlmIChzY29wZXNbYl0gIT09IGN1cl9zY29wZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY3VyX3Njb3BlID0gc2NvcGVzW2JdO1xuICAgICAgICAgICAgICAgICAgICAgICAgbnVtID0gMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGJsb2Nrc1trZXldLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlOiB0aGlzLmJsb2Nrc1trZXldW2JdLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVtLFxuICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGU6IGN1cl9zY29wZSB8fCB0aGlzLm5hbWVcbiAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgbnVtKys7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gVE9ETzogYWRkcmVzcyBkaXNjcmVwYW5jeSBpbiBhcnJheSB2cy4gc2luZ2xlLXZhbHVlIGJsb2Nrc1xuICAgICAgICAgICAgICAgIC8vIHN0eWxlcyBhc3N1bWUgYXJyYXkgd2hlbiB0cmFja2luZyBibG9jayBzY29wZXNcbiAgICAgICAgICAgICAgICBibG9ja3Nba2V5XS5wdXNoKHsga2V5LCBzb3VyY2U6IHRoaXMuYmxvY2tzW2tleV0sIG51bTogMCwgc2NvcGU6IHRoaXMubmFtZSB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gYmxvY2tzO1xuICAgIH1cblxuICAgIC8vIERldGVjdCB1bmlmb3JtIGRlZmluaXRpb25zLCBpbmplY3QgYW55IG1pc3Npbmcgb25lc1xuICAgIGVuc3VyZVVuaWZvcm1zKHVuaWZvcm1zKSB7XG4gICAgICAgIGlmICghdW5pZm9ybXMpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciB2cyA9IHN0cmlwKHRoaXMuY29tcHV0ZWRfdmVydGV4X3NvdXJjZSk7XG4gICAgICAgIHZhciBmcyA9IHN0cmlwKHRoaXMuY29tcHV0ZWRfZnJhZ21lbnRfc291cmNlKTtcbiAgICAgICAgdmFyIGluamVjdCwgdnNfaW5qZWN0aW9ucyA9IFtdLCBmc19pbmplY3Rpb25zID0gW107XG5cbiAgICAgICAgLy8gQ2hlY2sgZm9yIG1pc3NpbmcgdW5pZm9ybSBkZWZpbml0aW9uc1xuICAgICAgICBmb3IgKHZhciBuYW1lIGluIHVuaWZvcm1zKSB7XG4gICAgICAgICAgICBpbmplY3QgPSBudWxsO1xuXG4gICAgICAgICAgICAvLyBDaGVjayB2ZXJ0ZXggc2hhZGVyXG4gICAgICAgICAgICBpZiAoIUdMU0wuaXNVbmlmb3JtRGVmaW5lZChuYW1lLCB2cykpIHtcbiAgICAgICAgICAgICAgICBpZiAoIWluamVjdCkge1xuICAgICAgICAgICAgICAgICAgICBpbmplY3QgPSBHTFNMLmRlZmluZVVuaWZvcm0obmFtZSwgdW5pZm9ybXNbbmFtZV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBsb2coJ3RyYWNlJywgYFByb2dyYW0gJHt0aGlzLm5hbWV9OiAke25hbWV9IG5vdCBkZWZpbmVkIGluIHZlcnRleCBzaGFkZXIsIGluamVjdGluZzogJyR7aW5qZWN0fSdgKTtcbiAgICAgICAgICAgICAgICB2c19pbmplY3Rpb25zLnB1c2goaW5qZWN0KTtcblxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gQ2hlY2sgZnJhZ21lbnQgc2hhZGVyXG4gICAgICAgICAgICBpZiAoIUdMU0wuaXNVbmlmb3JtRGVmaW5lZChuYW1lLCBmcykpIHtcbiAgICAgICAgICAgICAgICBpZiAoIWluamVjdCkge1xuICAgICAgICAgICAgICAgICAgICBpbmplY3QgPSBHTFNMLmRlZmluZVVuaWZvcm0obmFtZSwgdW5pZm9ybXNbbmFtZV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBsb2coJ3RyYWNlJywgYFByb2dyYW0gJHt0aGlzLm5hbWV9OiAke25hbWV9IG5vdCBkZWZpbmVkIGluIGZyYWdtZW50IHNoYWRlciwgaW5qZWN0aW5nOiAnJHtpbmplY3R9J2Ap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sbCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy51c2UoKTtcbiAgICAgICAgdGhpcy5jb21taXRVbmlmb3JtKHVuaWZvcm0pO1xuICAgIH1cblxuICAgIC8vIENvbW1pdHMgdGhlIHVuaWZvcm0gdG8gdGhlIEdQVVxuICAgIGNvbW1pdFVuaWZvcm0odW5pZm9ybSl7XG4gICAgICAgIGxldCBsb2NhdGlvbiA9IHVuaWZvcm0ubG9jYXRpb247XG4gICAgICAgIGxldCB2YWx1ZSA9IHVuaWZvcm0udmFsdWU7XG5cbiAgICAgICAgc3dpdGNoICh1bmlmb3JtLm1ldGhvZCkge1xuICAgICAgICAgICAgY2FzZSAnMWknOlxuICAgICAgICAgICAgICAgIHRoaXMuZ2wudW5pZm9ybTFpKGxvY2F0aW9uLCB2YWx1ZSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICcxZic6XG4gICAgICAgICAgICAgICAgdGhpcy5nbC51bmlmb3JtMWYobG9jYXRpb24sIHZhbHVlKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJzJmJzpcbiAgICAgICAgICAgICAgICB0aGlzLmdsLnVuaWZvcm0yZihsb2NhdGlvbiwgdmFsdWVbMF0sIHZhbHVlWzFdKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJzNmJzpcbiAgICAgICAgICAgICAgICB0aGlzLmdsLnVuaWZvcm0zZihsb2NhdGlvbiwgdmFsdWVbMF0sIHZhbHVlWzFdLCB2YWx1ZVsyXSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICc0Zic6XG4gICAgICAgICAgICAgICAgdGhpcy5nbC51bmlmb3JtNGYobG9jYXRpb24sIHZhbHVlWzBdLCB2YWx1ZVsxXSwgdmFsdWVbMl0sIHZhbHVlWzNdKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJzFpdic6XG4gICAgICAgICAgICAgICAgdGhpcy5nbC51bmlmb3JtMWl2KGxvY2F0aW9uLCB2YWx1ZSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICczaXYnOlxuICAgICAgICAgICAgICAgIHRoaXMuZ2wudW5pZm9ybTNpdihsb2NhdGlvbiwgdmFsdWUpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnMWZ2JzpcbiAgICAgICAgICAgICAgICB0aGlzLmdsLnVuaWZvcm0xZnYobG9jYXRpb24sIHZhbHVlKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJzJmdic6XG4gICAgICAgICAgICAgICAgdGhpcy5nbC51bmlmb3JtMmZ2KGxvY2F0aW9uLCB2YWx1ZSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICczZnYnOlxuICAgICAgICAgICAgICAgIHRoaXMuZ2wudW5pZm9ybTNmdihsb2NhdGlvbiwgdmFsdWUpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnNGZ2JzpcbiAgICAgICAgICAgICAgICB0aGlzLmdsLnVuaWZvcm00ZnYobG9jYXRpb24sIHZhbHVlKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ01hdHJpeDNmdic6XG4gICAgICAgICAgICAgICAgdGhpcy5nbC51bmlmb3JtTWF0cml4M2Z2KGxvY2F0aW9uLCBmYWxzZSwgdmFsdWUpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnTWF0cml4NGZ2JzpcbiAgICAgICAgICAgICAgICB0aGlzLmdsLnVuaWZvcm1NYXRyaXg0ZnYobG9jYXRpb24sIGZhbHNlLCB2YWx1ZSk7XG4gICAgICAgICAgIC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hbMV0sXG4gICAgICAgICAgICAgICAgICAgIG5hbWU6IG1hdGNoWzJdLFxuICAgICAgICAgICAgICAgICAgICBudW06IG1hdGNoWzNdXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIG1hdGNoID0gbGluZS5tYXRjaCgvXFwvXFwvIHRhbmdyYW0tYmxvY2stZW5kOiAoW0EtWmEtejAtOV8tXSspLCAoW0EtWmEtejAtOV8tXSspLCAoXFxkKykvKTtcbiAgICAgICAgICAgICAgICBpZiAobWF0Y2ggJiYgbWF0Y2gubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgICAgICAgICBibG9jayA9IG51bGw7IC8vIGNsZWFyIGN1cnJlbnQgYmxvY2tcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIHVwZGF0ZSBsaW5lICMgYW5kIGNvbnRlbnRcbiAgICAgICAgICAgIGlmIChibG9jaykge1xuICAgICAgICAgICAgICAgIC8vIGluaXQgdG8gLTEgc28gdGhhdCBsaW5lIDAgaXMgZmlyc3QgYWN0dWFsIGxpbmUgb2YgYmxvY2sgY29kZSwgYWZ0ZXIgY29tbWVudCBtYXJrZXJcbiAgICAgICAgICAgICAgICBibG9jay5saW5lID0gKGJsb2NrLmxpbmUgPT0gbnVsbCkgPyAtMSA6IGJsb2NrLmxpbmUgKyAxO1xuICAgICAgICAgICAgICAgIGJsb2NrLnNvdXJjZSA9IGxpbmU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGJsb2NrO1xuICAgIH1cblxuICAgIC8vIFJldHVybnMgbGlzdCBvZiBhdmFpbGFibGUgZXh0ZW5zaW9ucyBmcm9tIHRob3NlIHJlcXVlc3RlZFxuICAgIC8vIFNldHMgaW50ZXJuYWwgI2RlZmluZXMgaW5kaWNhdGluZyBhdmFpbGFiaWxpdHkgb2YgZWFj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BkZWxldGUgVGV4dHVyZS50ZXh0dXJlc1t0aGlzLm5hbWVdO1xuICAgICAgICB0aGlzLnZhbGlkID0gZmFsc2U7XG4gICAgICAgIGxvZygndHJhY2UnLCBgZGVzdHJveWluZyBUZXh0dXJlICR7dGhpcy5uYW1lfWApO1xuICAgIH1cblxuICAgIHJldGFpbiAoKSB7XG4gICAgICAgIHRoaXMucmV0YWluX2NvdW50Kys7XG4gICAgfVxuXG4gICAgcmVsZWFzZSAoKSB7XG4gICAgICAgIGlmICh0aGlzLnJldGFpbl9jb3VudCA8PSAwKSB7XG4gICAgICAgICAgICBsb2coJ2Vycm9yJywgYFRleHR1cmUgJyR7dGhpcy5uYW1lfSc6IHJlbGVhc2luZyB0ZXh0dXJlIHdpdGggcmV0YWluIGNvdW50IG9mICcke3RoaXMucmV0YWluX2NvdW50fSdgKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMucmV0YWluX2NvdW50LS07XG4gICAgICAgIGlmICh0aGlzLnJldGFpbl9jb3VudCA8PSAwKSB7XG4gICAgICAgICAgICB0aGlzLmRlc3Ryb3koKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGJpbmQodW5pdCA9IDApIHtcbiAgICAgICAgaWYgKCF0aGlzLnZhbGlkKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoVGV4dHVyZS5hY3RpdmVVbml0ICE9PSB1bml0KSB7XG4gICAgICAgICAgICB0aGlzLmdsLmFjdGl2ZVRleHR1cmUodGhpcy5nbC5URVhUVVJFMCArIHVuaXQpO1xuICAgICAgICAgICAgVGV4dHVyZS5hY3RpdmVVbml0ID0gdW5pdDtcbiAgICAgICAgICAgIFRleHR1cmUuYm91bmRUZXh0dXJlID0gbnVsbDsgLy8gdGV4dHVyZSBtdXN0IGJlIHJlLWJvdW5kIHdoZW4gdW5pdCBjaGFuZ2VzXG4gICAgICAgIH1cblxuICAgICAgICBpZiAoVGV4dHVyZS5ib3VuZFRleHR1cmUgIT09IHRoaXMudGV4dHVyZSkge1xuICAgICAgICAgICAgdGhpcy5nbC5iaW5kVGV4dHVyZSh0aGlzLmdsLlRFWFRVUkVfMkQsIHRoaXMudGV4dHVyZSk7XG4gICAgICAgICAgICBUZXh0dXJlLmJvdW5kVGV4dHVyZSA9IHRoaXMudGV4dHVyZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGxvYWQob3B0aW9ucykge1xuICAgICAgICBpZiAoIW9wdGlvbnMpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmxvYWRpbmcgfHwgUHJvbWlzZS5yZXNvbHZlKHRoaXMpO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5sb2FkaW5nID0gbnVsbDtcbiAgICAgICAgaWYgKHR5cGVvZiBvcHRpb25zLnVybCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIHRoaXMuY29uZmlnX3R5cGUgPSAndXJsJztcbiAgICAgICAgICAgIHRoaXMuc2V0VXJsKG9wdGlvbnMudXJsLCBvcHRpb25zKTtcbiAgICAgICAgfSBlbHNlIGlmIChvcHRpb25zLmVsZW1lbnQpIHtcbiAgICAgICAgICAgIHRoaXMuY29uZmlnX3R5cGUgPSAnZWxlbWVudCc7XG4gICAgICAgICAgICB0aGlzLnNldEVsZW1lbnQob3B0aW9ucy5lbGVtZW50LCBvcHRpb25zKTtcbiAgICAgICAgfSBlbHNlIGlmIChvcHRpb25zLmRhdGEgJiYgb3B0aW9ucy53aWR0aCAmJiBvcHRpb25zLmhlaWdodCkge1xuICAgICAgICAgICAgdGhpcy5jb25maWdfdHlwZSA9ICdkYXRhJztcbiAgICAgICAgICAgIHRoaXMuc2V0RGF0YShvcHRpb25zLndpZHRoLCBvcHRpb25zLmhlaWdodCwgb3B0aW9ucy5kYXRhLCBvcHRpb25zKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMubG9hZGluZyA9XG4gICAgICAgICAgICAodGhpcy5sb2FkaW5nICYmIHRoaXMubG9hZGluZy50aGVuKCgpID0+IHsgdGhpcy5jYWxjdWxhdGVTcHJpdGVzKCk7IHJldHVybiB0aGlzOyB9KSkgfHxcbiAgICAgICAgICAgIFByb21pc2UucmVzb2x2ZSh0aGlzKTtcbiAgICAgICAgcmV0dXJuIHRoaXMubG9hZGluZztcbiAgICB9XG5cbiAgICAvLyBTZXRzIHRleHR1cmUgZnJvbSBhbiB1cmxcbiAgICBzZXRVcmwodXJsLCBvcHRpb25zID0ge30pIHtcbiAgICAgICAgaWYgKCF0aGlzLnZhbGlkKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoVGV4dHVyZS5iYXNlX3VybCkge1xuICAgICAgICAgICAgdXJsID0gVXRpbHMuYWRkQmFzZVVSTCh1cmwsIFRleHR1cmUuYmFzZV91cmwpO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy51cmwgPSB1cmw7IC8vIHNhdmUgVVJMIHJlZmVyZW5jZSAod2lsbCBiZSBvdmVyd3JpdHRlbiB3aGVuIGVsZW1lbnQgaXMgbG9hZGVkIGJlbG93KVxuICAgICAgICB0aGlzLnNvdXJjZSA9IHRoaXMudXJsO1xuICAgICAgICB0aGlzLnNvdXJjZV90eXBlID0gJ3VybCc7XG5cbiAgICAgICAgdGhpcy5sb2FkaW5nID0gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgICAgICAgbGV0IGltYWdlID0gbmV3IEltYWdlKCk7XG4gICAgICAgICAgICBpbWFnZS5vbmxvYWQgPSAoKSA9PiB7XG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRFbGVtZW50KGltYWdlLCBvcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5sb2FkZWQgPSBmYWxzZTtcbiA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dHJpYnMpIHtcbiAgICAgICAgICAgIGF0dHJpYi5vZmZzZXQgPSB0aGlzLnN0cmlkZTtcbiAgICAgICAgICAgIGF0dHJpYi5ieXRlX3NpemUgPSBhdHRyaWIuc2l6ZTtcbiAgICAgICAgICAgIHZhciBzaGlmdCA9IDA7XG5cbiAgICAgICAgICAgIHN3aXRjaCAoYXR0cmliLnR5cGUpIHtcbiAgICAgICAgICAgICAgICBjYXNlIGdsLkZMT0FUOlxuICAgICAgICAgICAgICAgIGNhc2UgZ2wuSU5UOlxuICAgICAgICAgICAgICAgIGNhc2UgZ2wuVU5TSUdORURfSU5UOlxuICAgICAgICAgICAgICAgICAgICBhdHRyaWIuYnl0ZV9zaXplICo9IDQ7XG4gICAgICAgICAgICAgICAgICAgIHNoaWZ0ID0gMjtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSBnbC5TSE9SVDpcbiAgICAgICAgICAgICAgICBjYXNlIGdsLlVOU0lHTkVEX1NIT1JUOlxuICAgICAgICAgICAgICAgICAgICBhdHRyaWIuYnl0ZV9zaXplICo9IDI7XG4gICAgICAgICAgICAgICAgICAgIHNoaWZ0ID0gMTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIEZvcmNlIDQtYnl0ZSBhbGlnbm1lbnQgb24gYXR0cmlidXRlc1xuICAgICAgICAgICAgdGhpcy5zdHJpZGUgKz0gYXR0cmliLmJ5dGVfc2l6ZTtcbiAgICAgICAgICAgIGlmICh0aGlzLnN0cmlkZSAmIDMpIHsgLy8gcGFkIHRvIG11bHRpcGxlIG9mIDQgYnl0ZXNcbiAgICAgICAgICAgICAgICB0aGlzLnN0cmlkZSArPSA0IC0gKHRoaXMuc3RyaWRlICYgMyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIEFkZCBpbmZvIHRvIGxpc3Qgb2YgYXR0cmlidXRlIGNvbXBvbmVudHNcbiAgICAgICAgICAgIC8vIFVzZWQgdG8gYnVpbGQgdGhlIHZlcnRleCBkYXRhLCBwcm92aWRlcyBwb2ludGVycyBhbmQgb2Zmc2V0cyBpbnRvIGVhY2ggdHlwZWQgYXJyYXkgdmlld1xuICAgICAgICAgICAgLy8gRWFjaCBjb21wb25lbnQgaXMgYW4gYXJyYXkgb2Y6XG4gICAgICAgICAgICAvLyBbR0wgYXR0cmliIHR5cGUsIHBvaW50ZXIgdG8gdHlwZWQgYXJyYXkgdmlldywgYml0cyB0byBzaGlmdCByaWdodCB0byBkZXRlcm1pbmUgYnVmZmVyIG9mZnNldCwgYWRkaXRpb25hbCBidWZmZXIgb2Zmc2V0IGZvciB0aGUgY29tcG9uZW50XVxuICAgICAgICAgICAgdmFyIG9mZnNldF90eXBlZCA9IGF0dHJpYi5vZmZzZXQgPj4gc2hpZnQ7XG4gICAgICAgICAgICBpZiAoYXR0cmliLnNpemUgPiAxKSB7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgYT0wOyBhIDwgYXR0cmliLnNpemU7IGErKykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbXBvbmVudHMucHVzaChbYXR0cmliLnR5cGUsIG51bGwsIHNoaWZ0LCBvZmZzZXRfdHlwZWQrK10pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuY29tcG9uZW50cy5wdXNoKFthdHRyaWIudHlwZSwgbnVsbCwgc2hpZnQsIG9mZnNldF90eXBlZF0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBQcm92aWRlIGFuIGluZGV4IGludG8gdGhlIHZlcnRleCBkYXRhIGJ1ZmZlciBmb3IgZWFjaCBhdHRyaWJ1dGUgY29tcG9uZW50XG4gICAgICAgICAgICB0aGlzLmluZGV4W2F0dHJpYi5uYW1lXSA9IGNvdW50O1xuICAgICAgICAgICAgY291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HN0eWxlc1xuICAgICAgICByZXR1cm4gc3RhdGUuY29tcGxldGUudGhlbigoKSA9PiB7XG4gICAgICAgICAgICByZXR1cm4gc3RhdGUua2VlcFtzdHlsZV0gfHwgW107XG4gICAgICAgIH0pO1xuICAgIH0sXG5cbiAgICAvLyBUZXN0IGxhYmVscyBmb3IgY29sbGlzaW9ucywgaGlnaGVyIHRvIGxvd2VyIHByaW9yaXR5XG4gICAgLy8gV2hlbiB0d28gY29sbGlkZSwgZGlzY2FyZCB0aGUgbG93ZXItcHJpb3JpdHkgbGFiZWxcbiAgICBlbmRUaWxlICh0aWxlKSB7XG4gICAgICAgIGxldCBzdGF0ZSA9IHRoaXMudGlsZXNbdGlsZV07XG4gICAgICAgIGxldCBrZWVwID0gc3RhdGUua2VlcDtcblxuICAgICAgICBSZXBlYXRHcm91cC5jbGVhcih0aWxlKTtcblxuICAgICAgICAvLyBQcm9jZXNzIGxhYmVscyBieSBwcmlvcml0eSwgdGhlbiBieSBzdHlsZVxuICAgICAgICBsZXQgcHJpb3JpdGllcyA9IE9iamVjdC5rZXlzKHN0YXRlLm9iamVjdHMpLnNvcnQoKGEsIGIpID0+IGEgLSBiKTtcbiAgICAgICAgZm9yIChsZXQgcHJpb3JpdHkgb2YgcHJpb3JpdGllcykge1xuICAgICAgICAgICAgbGV0IHN0eWxlX29iamVjdHMgPSBzdGF0ZS5vYmplY3RzW3ByaW9yaXR5XTtcbiAgICAgICAgICAgIGlmICghc3R5bGVfb2JqZWN0cykgeyAvLyBubyBsYWJlbHMgYXQgdGhpcyBwcmlvcml0eSwgc2tpcCB0byBuZXh0XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIEZvciBlYWNoIHN0eWxlXG4gICAgICAgICAgICBmb3IgKGxldCBzdHlsZSBpbiBzdHlsZV9vYmplY3RzKSB7XG4gICAgICAgICAgICAgICAgbGV0IG9iamVjdHMgPSBzdHlsZV9vYmplY3RzW3N0eWxlXTtcbiAgICAgICAgICAgICAgICBrZWVwW3N0eWxlXSA9IGtlZXBbc3R5bGVdIHx8IFtdO1xuXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBvYmplY3RzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBvYmplY3QgPSBvYmplY3RzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5jYW5CZVBsYWNlZChvYmplY3QsIHRpbGUsIG9iamVjdC5saW5rZWQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBLZWVwIG9iamVjdCBpZiBpdCBpc24ndCBkZXBlbmRlbnQgb24gYSBwYXJlbnQgb2JqZWN0XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW9iamVjdC5saW5rZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZWVwW3N0eWxlXS5wdXNoKG9iamVjdCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wbGFjZShvYmplY3QsIHRpbGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgb2JqZWN0IGlzIGRlcGVuZGVudCBvbiBhIHBhcmVudCwgb25seSBrZWVwIGlmIGJvdGggY2FuIGJlIHBsYWNlZFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAodGhpcy5jYW5CZVBsYWNlZChvYmplY3QubGlua2VkLCB0aWxlLCBvYmplY3QpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAga2VlcFtzdHlsZV0ucHVzaChvYmplY3QpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGxhY2Uob2JqZWN0LCB0aWxlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBsYWNlKG9iamVjdC5saW5rZWQsIHRpbGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVx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HVybjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBTa2lwIG5hcnJvdyBwaGFzZSBjb2xsaXNpb24gaWYgbm8gcm90YXRpb25cbiAgICAgICAgICAgICAgICBpZiAodGhpcy5vYmIuYW5nbGUgPT09IDAgJiYgb2Jic1tqXS5hbmdsZSA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAvLyBsb2coJ3RyYWNlJywgJ2NvbGxpc2lvbjogc2tpcCBuYXJyb3cgcGhhc2UgY29sbGlkZSBiZWNhdXNlIG5laXRoZXIgaXMgcm90YXRlZCcsIHRoaXMubGF5b3V0LmlkLCB0aGlzLCB0aGlzLm9iYiwgb2Jic1tqXSk7XG4gICAgICAgICAgICAgICAgICAgIGludGVyc2VjdCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIE5hcnJvdyBwaGFzZVxuICAgICAgICAgICAgICAgIGlmIChPQkIuaW50ZXJzZWN0KHRoaXMub2JiLCBvYmJzW2pdKSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBsb2coJ3RyYWNlJywgJ2NvbGxpc2lvbjogbmFycm93IHBoYXNlIGNvbGxpZGUnLCB0aGlzLmxheW91dC5pZCwgdGhpcywgdGhpcy5vYmIsIG9iYnNbal0pO1xuICAgICAgICAgICAgICAgICAgICBpbnRlcnNlY3QgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gaW50ZXJzZWN0O1xuICAgIH1cblxuICAgIC8vIEFkZCB0aGlzIGxhYmVsJ3MgYm91bmRpbmcgYm94IHRvIHRoZSBwcm92aWRlZCBzZXRcbiAgICBhZGQgKGJib3hlcykge1xuICAgICAgICB0aGlzLnBsYWNlZCA9IHRydW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FTlQuQ09STkVSO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLnNlZ21lbnRfaW5kZXgrKztcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0aGlzLmdldEN1cnJlbnRTZWdtZW50KCk7XG4gICAgfVxuXG4gICAgLy8gUmV0dXJucyB0aGUgbGluZSBzZWdtZW50cyBuZWNlc3NhcnkgZm9yIG90aGVyIGNhbGN1bGF0aW9ucyBhdCB0aGUgY3VycmVudCBsaW5lIHNlZ21lbnQgaW5kZXguXG4gICAgLy8gVGhpcyBpcyB0aGUgY3VycmVudCBhbmQgbmV4dCBzZWdtZW50IGZvciBhIHN0cmFpZ2h0IGxpbmUsIGFuZCB0aGUgcHJldmlvdXMsIGN1cnJlbnQgYW5kIG5leHRcbiAgICAvLyBmb3IgYW4gYXJ0aWN1bGF0ZWQgc2VnbWVudC5cbiAgICBnZXRDdXJyZW50U2VnbWVudCgpIHtcbiAgICAgICAgbGV0IHAxLCBwMiwgc2VnbWVudDtcbiAgICAgICAgc3dpdGNoICh0aGlzLnBsYWNlbWVudCkge1xuICAgICAgICAgICAgY2FzZSBQTEFDRU1FTlQuQ09STkVSOlxuICAgICAgICAgICAgICAgIHAxID0gdGhpcy5saW5lc1t0aGlzLnNlZ21lbnRfaW5kZXggLSAxXTtcbiAgICAgICAgICAgICAgICBwMiA9IHRoaXMubGluZXNbdGhpcy5zZWdtZW50X2luZGV4XTtcbiAgICAgICAgICAgICAgICBsZXQgcDMgPSB0aGlzLmxpbmVzW3RoaXMuc2VnbWVudF9pbmRleCArIDFdO1xuICAgICAgICAgICAgICAgIHNlZ21lbnQgPSBbIHAxLCBwMiwgcDMgXTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgUExBQ0VNRU5ULk1JRF9QT0lOVDpcbiAgICAgICAgICAgICAgICBwMSA9IHRoaXMubGluZXNbdGhpcy5zZWdtZW50X2luZGV4XTtcbiAgICAgICAgICAgICAgICBwMiA9IHRoaXMubGluZXNbdGhpcy5zZWdtZW50X2luZGV4ICsgMV07XG4gICAgICAgICAgICAgICAgc2VnbWVudCA9IFsgcDEsIHAyIF07XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gc2VnbWVudDtcbiAgICB9XG5cbiAgICAvLyBSZXR1cm5zIG5leHQgc2VnbWVudCB0aGF0IGlzIHZhbGlkICh3aXRoaW4gdGlsZSwgaW5zaWRlIGFuZ2xlIHJlcXVpcmVtZW50cyBhbmQgd2l0aGluIGxpbmUgZ2VvbWV0cnkpLlxuICAgIGdldE5leHRGaXR0aW5nU2VnbWVudChzZWdtZW50KSB7XG4gICAgICAgIHNlZ21lbnQgPSBzZWdtZW50IHx8IHRoaXMuZ2V0TmV4dFNlZ21lbnQoKTtcbiAgICAgICAgaWYgKCFzZWdtZW50KSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5kb2VzU2VnbWVudEZpdChzZWdtZW50KSkge1xuICAgICAgICAgICAgdGhpcy51cGRhdGUoKTtcbiAgICAgICAgICAgIGlmICh0aGlzLmluVGlsZUJvdW5kcygpICYmIHRoaXMuaW5BbmdsZUJvdW5kcygpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHNlZ21lbnQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGhpcy5nZXROZXh0Rml0dGluZ1NlZ21lbnQoKTtcbiAgICB9XG5cbiAgICAvLyBSZXR1cm5zIGJvb2xlYW4gaW5kaWNhdGluZyB3aGV0aGVyIGN1cnJlbnQgc2VnbWVudCBpcyB2YWxpZFxuICAgIGRvZXNTZWdtZW50Rml0KHNlZ21lbnQpIHtcbiAgICAgICAgc3dpdGNoICh0aGlzLnBsYWNlbWVudCkge1xuICAgICAgICAgICAgY2Fz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SAwICYmIHAxcDJbMF0gPj0gMCkgPyAxIDogLTE7XG4gICAgICAgICAgICAgICAgbGV0IGFuZ2xlO1xuXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aGlzLm51bV9zZWdtZW50czsgaSsrKXtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgPCB0aGlzLmtpbmtfaW5kZXgpe1xuICAgICAgICAgICAgICAgICAgICAgICAgYW5nbGUgPSAob3JpZW50YXRpb24gPiAwKSA/IHRoZXRhMiA6IHRoZXRhMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFuZ2xlID0gKG9yaWVudGF0aW9uID4gMCkgPyB0aGV0YTEgOiB0aGV0YTI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYW5nbGVzLnB1c2goYW5nbGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgUExBQ0VNRU5ULk1JRF9QT0lOVDpcbiAgICAgICAgICAgICAgICBsZXQgdGhldGEgPSBnZXRBbmdsZUZyb21TZWdtZW50KHNlZ21lbnRbMF0sIHNlZ21lbnRbMV0pO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy5udW1fc2VnbWVudHM7IGkrKyl7XG4gICAgICAgICAgICAgICAgICAgIGFuZ2xlcy5wdXNoKHRoZXRhKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gYW5nbGVzO1xuICAgIH1cblxuICAgIC8vIFJldHVybiB0aGUgcG9zaXRpb24gb2YgdGhlIGNlbnRlciBvZiB0aGUgbGFiZWxcbiAgICBnZXRDdXJyZW50UG9zaXRpb24oKSB7XG4gICAgICAgIGxldCBzZWdtZW50ID0gdGhpcy5nZXRDdXJyZW50U2VnbWVudCgpO1xuICAgICAgICBsZXQgcG9zaXRpb247XG5cbiAgICAgICAgc3dpdGNoICh0aGlzLnBsYWNlbWVudCkge1xuICAgICAgICAgICAgY2FzZSBQTEFDRU1FTlQuQ09STkVSOlxuICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gc2VnbWVudFsxXS5zbGljZSgpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSBQTEFDRU1FTlQuTUlEX1BPSU5UOlxuICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gW1xuICAgICAgICAgICAgICAgICAgICAwLjUgKiAoc2VnbWVudFswXVswXSArIHNlZ21lbnRbMV1bMF0pLFxuICAgICAgICAgICAgICAgICAgICAwLjUgKiAoc2VnbWVudFswXVsxXSArIHNlZ21lbnRbMV1bMV0pXG4gICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBwb3NpdGlvbjtcbiAgICB9XG5cbiAgICAvLyBDaGVjayBmb3IgYXJ0aWN1bGF0ZWQgbGFiZWxzIHRvIGJlIHdpdGhpbiBhbiBhbmdsZSByYW5nZSBbLU1BWF9BTkdMRSwgK01BWF9BTkdMRV1cbiAgICBpbkFuZ2xlQm91bmRzKCkge1xuICAgICAgICBzd2l0Y2ggKHRoaXMucGxhY2VtZW50KSB7XG4gICAgICAgICAgICBjYXNlIFBMQUNFTUVOVC5DT1JORVI6XG4gICAgICAgICAgICAgICAgbGV0IGFuZ2xlMCA9IHRoaXMuYW5nbGVbMF07XG4gICAgICAgICAgICAgICAgaWYgKGFuZ2xlMCA8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgYW5nbGUwICs9IDIgKiBNYXRoLlBJO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGxldCBhbmdsZTEgPSB0aGlzLmFuZ2xlWzFdO1xuICAgICAgICAgICAgICAgIGlmIChhbmdsZTEgPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGFuZ2xlMSArPSAyICogTWF0aC5QSTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBsZXQgdGhldGEgPSBNYXRoLmFicyhhbmdsZTEgLSBhbmdsZTApO1xuICAgICAgICAgICAgICAgIHRoZXRhID0gTWF0aC5taW4oMiAqIE1hdGguUEkgLSB0aGV0YSwgdGhldGEpO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoZXRhIDw9IE1BWF9BTkdMRTtcbiAgICAgICAgICAgIGNhc2UgUExBQ0VNRU5ULk1JRF9QT0lOVDpcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIENhbGN1bGF0ZSBib3VuZGluZyBib3hlc1xuICAgIHVwZGF0ZUJCb3hlcygpIHtcbiAgICAgICAgbGV0IHVwcCA9IHRoaXMubGF5b3V0LnVuaXRzX3Blcl9waXhlbDtcbiAgICAgICAgbGV0IGhlaWdodCA9ICh0aGlzLnRvdGFsX2hlaWdodCArIHRoaXMubGF5b3V0LmJ1ZmZlclsxXSAqIDIpICogdXBwICogTGFiZWwuZXBzaWxvbjtcblxuICAgICAgICAvLyByZXNldCBib3VuZGluZyBib3hlc1xuICAgICAgICB0aGlzLm9iYnMgPSBbXTtcbiAgICAgICAgdGhpcy5hYWJicyA9IFtdO1xuXG4gICAgICAgIHN3aXRjaCAodGhpcy5wbGFjZW1lbnQpIHtcbiAgICAgICAgICAgIGNhc2UgUExBQ0VNRU5ULkNPUk5FUjpcbiAgICAgICAgICAgICAgICBsZXQgYW5nbGUwID0gdGhpcy5hbmdsZVt0aGlzLmtpbmtfaW5kZXggLSAxXTsgLy8gYW5nbGUgYmVmb3JlIGtpbmtcbiAgICAgICAgICAgICAgICBsZXQgYW5nbGUxID0gdGhpcy5hbmdsZVt0aGlzLmtpbmtfaW5kZ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C41ICogd2lkdGhfcHg7XG5cbiAgICAgICAgICAgICAgICAgICAgbGV0IG9mZnNldCA9IFZlY3Rvci5yb3QoW251ZGdlICogdXBwLCAwXSwgLWFuZ2xlKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBvc2l0aW9uID0gVmVjdG9yLmFkZCh0aGlzLnBvc2l0aW9uLCBvZmZzZXQpO1xuXG4gICAgICAgICAgICAgICAgICAgIGxldCBvYmIgPSBnZXRPQkIocG9zaXRpb24sIHdpZHRoLCBoZWlnaHQsIGFuZ2xlLCB0aGlzLm9mZnNldCwgdXBwKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGFhYmIgPSBvYmIuZ2V0RXh0ZW50KCk7XG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vYmJzLnB1c2gob2JiKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hYWJicy5wdXNoKGFhYmIpO1xuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMub2Zmc2V0c1tpXSA9IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMubGF5b3V0Lm9mZnNldFswXSArIG51ZGdlLFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5sYXlvdXQub2Zmc2V0WzFdXG4gICAgICAgICAgICAgICAgICAgIF07XG5cbiAgICAgICAgICAgICAgICAgICAgbnVkZ2UgLT0gMC41ICogd2lkdGhfcHggKyB0aGlzLnNwYWNlX3dpZHRoO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIFBsYWNlIGxhYmVscyBmb3J3YXJkcyBmcm9tIGtpbmsgaW5kZXhcbiAgICAgICAgICAgICAgICBudWRnZSA9IDAuNSAqIChkeCArIHRoaXMuc3BhY2Vfd2lkdGgpO1xuXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IHRoaXMua2lua19pbmRleDsgaSA8IHRoaXMubnVtX3NlZ21lbnRzOyBpKyspe1xuICAgICAgICAgICAgICAgICAgICBsZXQgd2lkdGhfcHggPSB0aGlzLnNpemVbaV1bMF07XG4gICAgICAgICAgICAgICAgICAgIGxldCBhbmdsZSA9IHRoaXMuYW5nbGVbaV07XG5cbiAgICAgICAgICAgICAgICAgICAgbGV0IHdpZHRoID0gKHdpZHRoX3B4ICsgMiAqIHRoaXMubGF5b3V0LmJ1ZmZlclswXSkgKiB1cHAgKiBMYWJlbC5lcHNpbG9uO1xuXG4gICAgICAgICAgICAgICAgICAgIG51ZGdlICs9IDAuNSAqIHdpZHRoX3B4O1xuXG4gICAgICAgICAgICAgICAgICAgIGxldCBvZmZzZXQgPSBWZWN0b3Iucm90KFtudWRnZSAqIHVwcCwgMF0sIC1hbmdsZSk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBwb3NpdGlvbiA9IFZlY3Rvci5hZGQodGhpcy5wb3NpdGlvbiwgb2Zmc2V0KTtcblxuICAgICAgICAgICAgICAgICAgICBsZXQgb2JiID0gZ2V0T0JCKHBvc2l0aW9uLCB3aWR0aCwgaGVpZ2h0LCBhbmdsZSwgdGhpcy5vZmZzZXQsIHVwcCk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBhYWJiID0gb2JiLmdldEV4dGVudCgpO1xuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMub2Jicy5wdXNoKG9iYik7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYWFiYnMucHVzaChhYWJiKTtcblxuICAgICAgICAgICAgICAgICAgICB0aGlzLm9mZnNldHNbaV0gPSBbXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmxheW91dC5vZmZzZXRbMF0gKyBudWRnZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMubGF5b3V0Lm9mZnNldFsxXVxuICAgICAgICAgICAgICAgICAgICBdO1xuXG4gICAgICAgICAgICAgICAgICAgIG51ZGdlICs9IDAuNSAqIHdpZHRoX3B4ICsgdGhpcy5zcGFjZV93aWR0aDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIFBMQUNFTUVOVC5NSURfUE9JTlQ6XG4gICAgICAgICAgICAgICAgbGV0IHNoaWZ0ID0gLTAuNSAqIHRoaXMudG90YWxfbGVuZ3RoOyAvLyBzaGlmdCBmb3IgY2VudGVyaW5nIHRoZSBsYWJlbHNcblxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy5udW1fc2VnbWVudHM7IGkrKyl7XG4gICAgICAgICAgICAgICAgICAgIGxldCB3aWR0aF9weCA9IHRoaXMuc2l6ZVtpXVswXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHdpZHRoID0gKHdpZHRoX3B4ICsgMiAqIHRoaXMubGF5b3V0LmJ1ZmZlclswXSkgKiB1cHAgKiBMYWJlbC5lcHNpbG9uO1xuICAgICAgICAgICAgICAgICAgICBsZXQgYW5nbGUgPSB0aGlzLmFuZ2xlW2ldO1xuXG4gICAgICAgICAgICAgICAgICAgIHNoaWZ0ICs9IDAuNSAqIHdpZHRoX3B4O1xuXG4gICAgICAgICAgICAgICAgICAgIGxldCBvZmZzZXQgPSBWZWN0b3Iucm90KFtzaGlmdCAqIHVwcCwgMF0sIC1hbmdsZSk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBwb3NpdGlvbiA9IFZlY3Rvci5hZGQodGhpcy5wb3NpdGlvbiwgb2Zmc2V0KTtcblxuICAgICAgICAgICAgICAgICAgICBsZXQgb2JiID0gZ2V0T0JCKHBvc2l0aW9uLCB3aWR0aCwgaGVpZ2h0LCBhbmdsZSwgdGhpcy5vZmZzZXQsIHVwcCk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBhYWJiID0gb2JiLmdldEV4dGVudCgpO1xuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMub2Jicy5wdXNoKG9iYik7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYWFiYnMucHVzaChhYWJiKTtcblxuICAgICAgICAgICAgICAgICAgICB0aGlzLm9mZnNldHNbaV0gPSBbXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmxheW91dC5vZmZzZXRbMF0gKyBzaGlmdCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMubGF5b3V0Lm9mZnNldFsxXVxuICAgICAgICAgICAgICAgICAgICBdO1xuXG4gICAgICAgICAgICAgICAgICAgIHNoaWZ0ICs9IDAuNSAqIHdpZHRoX3B4ICsgdGhpcy5zcGFjZV93aWR0aDtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIENoZWNrcyBlYWNoIHNlZ21lbnQgdG8gc2VlIGlmIGl0IGlzIHdpdGhpbiB0aGUgdGlsZS4gSWYgYW55IHNlZ21lbnQgZmFpbHMgdGhpcyB0ZXN0LCB0aGV5IGFsbCBmYWlsLlxuICAgIC8vIFRPRE86IGxhYmVsIGdyb3VwXG4gICAgaW5UaWxlQm91bmRzKCkge1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRoaXMuYWFiYnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBhYWJiID0gdGhpcy5hYWJic1tpXTtcbiAgICAgICAgICAgIGxldCBvYmogPSB7IGFhYmIgfTtcbiAgICAgICAgICAgIGxldCBpbl9ib3VuZHMgPSBMYWJlbC5wcm90b3R5cGUuaW5UaWxlQm91bmRzLmNhbGwob2JqKTtcbiAgICAgICAgICAgIGlmICghaW5fYm91bmRzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIC8vIEFkZHMgZWFjaCBzZWdtZW50IHRvIHRoZSBjb2xsaXNpb24gcGFzcyBhcyBpdHMgb3duIGJvdW5kaW5nIGJveFxuICAgIC8vIFRPRE86IGxhYmVsIGdyb3VwXG4gIC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Gl0aW9uYWwgcG9pbnQgb2Zmc2V0XG4gICAgICAgICAgICB0aGlzLm9mZnNldCA9IFBvaW50QW5jaG9yLmNvbXB1dGVPZmZzZXQodGhpcy5vZmZzZXQsIHBhcmVudC5zaXplLCBwYXJlbnQuYW5jaG9yLCBQb2ludEFuY2hvci56ZXJvX2J1ZmZlcik7XG4gICAgICAgICAgICB0aGlzLm9mZnNldCA9IFBvaW50QW5jaG9yLmNvbXB1dGVPZmZzZXQodGhpcy5vZmZzZXQsIHBhcmVudC5zaXplLCB0aGlzLmFuY2hvciwgUG9pbnRBbmNob3IuemVyb19idWZmZXIpO1xuICAgICAgICAgICAgaWYgKHBhcmVudC5vZmZzZXQgIT09IFN0eWxlUGFyc2VyLnplcm9QYWlyKSB7ICAgICAgICAvLyBwb2ludCBoYXMgYW4gb2Zmc2V0XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMub2Zmc2V0ID09PSBTdHlsZVBhcnNlci56ZXJvUGFpcikgeyAvLyBubyB0ZXh0IG9mZnNldCwgdXNlIHBvaW50J3NcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vZmZzZXQgPSBwYXJlbnQub2Zmc2V0O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0ZXh0IGhhcyBvZmZzZXQsIGFkZCBwb2ludCdzXG4gICAgICAgICAgICAgICAgICAgIHRoaXMub2Zmc2V0WzBdICs9IHBhcmVudC5vZmZzZXRbMF07XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub2Zmc2V0WzFdICs9IHBhcmVudC5vZmZzZXRbMV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5vZmZzZXQgPSBQb2ludEFuY2hvci5jb21wdXRlT2Zmc2V0KHRoaXMub2Zmc2V0LCB0aGlzLnNpemUsIHRoaXMuYW5ja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swXTtcbiAgICAgICAgICAgIHVwZGF0ZWQgPSB0cnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuYWFiYlsyXSA+PSBHZW8udGlsZV9zY2FsZSkge1xuICAgICAgICAgICAgdGhpcy5wb3NpdGlvblswXSAtPSB0aGlzLmFhYmJbMl0gLSBHZW8udGlsZV9zY2FsZSArIDE7XG4gICAgICAgICAgICB1cGRhdGVkID0gdHJ1ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmFhYmJbM10gPiAwKSB7XG4gICAgICAgICAgICB0aGlzLnBvc2l0aW9uWzFdIC09IHRoaXMuYWFiYlszXTtcbiAgICAgICAgICAgIHVwZGF0ZWQgPSB0cnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuYWFiYlsxXSA8PSAtR2VvLnRpbGVfc2NhbGUpIHtcbiAgICAgICAgICAgIHRoaXMucG9zaXRpb25bMV0gLT0gdGhpcy5hYWJiWzFdICsgR2VvLnRpbGVfc2NhbGUgLSAxO1xuICAgICAgICAgICAgdXBkYXRlZCA9IHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodXBkYXRlZCkge1xuICAgICAgICAgICAgdGhpcy51cGRhdGVCQm94ZXMoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB1cGRhdGVkO1xuICAgIH1cblxuICAgIGdldE5leHRGaXQoKSB7XG4gICAgICAgIGlmICghdGhpcy5sYXlvdXQuY3VsbF9mcm9tX3RpbGUgfHwgdGhpcy5pblRpbGVCb3VuZHMoKSkge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5sYXlvdXQubW92ZV9pbnRvX3RpbGUpIHtcbiAgICAgICAgICAgIHRoaXMubW92ZUludG9UaWxlKCk7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHRoaXMubGF5b3V0LmFuY2hvcikpIHtcbiAgICAgICAgICAgICAgICAvLyBTdGFydCBvbiBzZWNvbmQgYW5jaG9yIChmaXJzdCBhbmNob3Igd2FzIHNldCBvbiBjcmVhdGlvbilcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMTsgaSA8IHRoaXMubGF5b3V0LmFuY2hvci5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmFuY2hvciA9IHRoaXMubGF5b3V0LmFuY2hvcltpXTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy51cGRhdGUoKTtcblxuICAgICAgICAgICAgICAgICAgICB0aGlzLnN0YXJ0X2FuY2hvcl9pbmRleCA9IGk7XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuaW5UaWxlQm91bmRzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gbm8gYW5jaG9ycyByZXN1bHQgaW4gZml0XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBkaXNjYXJkIChiYm94ZXMsIGV4Y2x1ZGUgPSBudWxsKSB7XG4gICAgICAgIGlmIChzdXBlci5kaXNjYXJkKGJib3hlcywgZXhjbHVkZSkpIHtcbiAgICAgICAgICAgIC8vIElmIG1vcmUgdGhhbiBvbmUgYW5jaG9yIHNwZWNpZmllZCwgdHJ5IHRoZW0gaW4gb3JkZXJcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHRoaXMubGF5b3V0LmFuY2hvcikpIHtcbiAgICAgICAgICAgICAgICAvLyBTdGFydCBvbiBzZWNvbmQgYW5jaG9yIChmaXJzdCBhbmNob3Igd2FzIHNldCBvbiBjcmVhdGlvbilcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpPXRoaXMuc3RhcnRfYW5jaG9yX2luZGV4OyBpIDwgdGhpcy5sYXlvdXQuYW5jaG9yLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYW5jaG9yID0gdGhpcy5sYXlvdXQuYW5jaG9yW2ldO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnVwZGF0ZSgpO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmxheW91dC5jdWxsX2Zyb21fdGlsZSAmJiAhdGhpcy5pblRpbGVCb3VuZHMoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBpZiAoIXN1cGVyLmRpc2NhcmQoYmJveGVzLCBleGNsdWRlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxufVxuIiwiLy8gU2V0cyBvZiB2YWx1ZXMgdG8gbWF0Y2ggZm9yIGRpcmVjdGlvbmFsIGFuZCBjb3JuZXIgYW5jaG9yc1xuY29uc3QgbGVmdHMgPSBbJ2xlZnQnLCAndG9wLWxlZnQnLCAnYm90dG9tLWxlZnQnXTtcbmNvbnN0IHJpZ2h0cyA9IFsncmlnaHQnLCAndG9wLXJpZ2h0JywgJ2JvdHRvbS1yaWdodCddO1xuY29uc3QgdG9wcyA9IFsndG9wJywgJ3RvcC1sZWZ0JywgJ3RvcC1yaWdodCddO1xuY29uc3QgYm90dG9tcyA9IFsnYm90dG9tJywgJ2JvdHRvbS1sZWZ0JywgJ2JvdHRvbS1yaWdodCddO1xuXG5sZXQgUG9p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XG4gICAgICAgICAgICBpZiAoYW5jaG9yID09PSAndG9wJykge1xuICAgICAgICAgICAgICAgIG9mZnNldDJbMV0gLT0gYnVmZmVyWzJdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHRoaXMuaXNCb3R0b21BbmNob3IoYW5jaG9yKSkge1xuICAgICAgICAgICAgb2Zmc2V0MlsxXSArPSBzaXplWzFdIC8gMjtcbiAgICAgICAgICAgIGlmIChhbmNob3IgPT09ICdib3R0b20nKSB7XG4gICAgICAgICAgICAgICAgb2Zmc2V0MlsxXSArPSBidWZmZXJbM107XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gb2Zmc2V0MjtcbiAgICB9LFxuXG4gICAgYWxpZ25Gb3JBbmNob3IgKGFuY2hvcikge1xuICAgICAgICBpZiAoYW5jaG9yICYmIGFuY2hvciAhPT0gJ2NlbnRlcicpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLmlzTGVmdEFuY2hvcihhbmNob3IpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdyaWdodCc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICh0aGlzLmlzUmlnaHRBbmNob3IoYW5jaG9yKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnbGVmdCc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuICdjZW50ZXInO1xuICAgIH0sXG5cbiAgICBpc0xlZnRBbmNob3IgKGFuY2hvcikge1xuICAgICAgICByZXR1cm4gKGxlZnRzLmluZGV4T2YoYW5jaG9yKSA+IC0xKTtcbiAgICB9LFxuXG4gICAgaXNSaWdodEFuY2hvciAoYW5jaG9yKSB7XG4gICAgICAgIHJldHVybiAocmlnaHRzLmluZGV4T2YoYW5jaG9yKSA+IC0xKTtcbiAgICB9LFxuXG4gICAgaXNUb3BBbmNob3IgKGFuY2hvcikge1xuICAgICAgICByZXR1c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BsYXllckNsYXNzQ29uZmlnLl9yZXNldCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIGxheWVyQmFzZUNsYXNzLnByb3RvdHlwZS5fcmVzZXQuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgICAgICAgICAvLyByZS1hZGQgdGhlIGNhbnZhcyBzaW5jZSBiYXNlIGNsYXNzIGB2aWV3cmVzZXRgIGV2ZW50IGNhbiByZW1vdmUgaXRcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5zY2VuZSAmJiB0aGlzLnNjZW5lLmNvbnRhaW5lciAmJiB0aGlzLnNjZW5lLmNhbnZhcykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNjZW5lLmNvbnRhaW5lci5hcHBlbmRDaGlsZCh0aGlzLnNjZW5lLmNhbnZhcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIERlZmluZSBjdXN0b20gbGF5ZXIgbWV0aG9kc1xuICAgICAgICBPYmplY3QuYXNzaWduKGxheWVyQ2xhc3NDb25maWcsIHtcblxuICAgICAgICAgICAgaW5pdGlhbGl6ZTogZnVuY3Rpb24gKG9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAvLyBEZWZhdWx0c1xuICAgICAgICAgICAgICAgIG9wdGlvbnMuc2hvd0RlYnVnID0gKCFvcHRpb25zLnNob3dEZWJ1ZyA/IGZhbHNlIDogdHJ1ZSk7XG4gICAgICAgICAgICAgICAgb3B0aW9ucy53aGVlbERlYm91bmNlVGltZSA9IG9wdGlvbnMud2hlZWxEZWJvdW5jZVRpbWUgfHwgNDA7XG5cbiAgICAgICAgICAgICAgICBMLnNldE9wdGlvbnModGhpcywgb3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgdGhpcy5jcmVhdGVTY2VuZSgpO1xuICAgICAgICAgICAgICAgIHRoaXMuaG9va3MgPSB7fTtcbiAgICAgICAgICAgICAgICB0aGlzLl91cGRhdGluZ190YW5ncmFtID0gZmFsc2U7XG5cbiAgICAgICAgICAgICAgICAvLyBGb3JjZSBsZWFmbGV0IHpvb20gYW5pbWF0aW9ucyBvZmZcbiAgICAgICAgICAgICAgICB0aGlzLl96b29tQW5pbWF0ZWQgPSBmYWxzZTtcblxuICAgICAgICAgICAgICAgIHRoaXMuZGVib3VuY2VWaWV3UmVzZXQgPSBVdGlscy5kZWJvdW5jZSgoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX21hcC5maXJlKCd6b29tZW5kJyk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX21hcC5maXJlKCdtb3ZlZW5kJyk7XG4gICAgICAgICAgICAgICAgfSwgdGhpcy5vcHRpb25zLndoZWVsRGVib3VuY2VUaW1lKTtcbiAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgIGNyZWF0ZVNjZW5lOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zY2VuZSA9IFNjZW5lLmNyZWF0ZShcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcHRpb25zLnNjZW5lLFxuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICBudW1Xb3JrZXJzOiB0aGlzLm9wdGlvbnMubnVtV29ya2VycyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHByZVVwZGF0ZTogdGhpcy5vcHRpb25zLnByZVVwZGF0ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvc3RVcGRhdGU6IHRoaXMub3B0aW9ucy5wb3N0VXBkYXRlLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludW91c1pvb206IChMZWFmbGV0TGF5ZXIubGVhZmxldFZlcnNpb24gPT09ICcxLngnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhpZ2hEZW5zaXR5RGlzcGxheTogdGhpcy5vcHRpb25zLmhpZ2hEZW5zaXR5RGlzcGxheSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvZ0xldmVsOiB0aGlzLm9wdGlvbnMubG9nTGV2ZWwsXG4gICAgICAgICAgICAgICAgICAgICAgICBpbnRyb3NwZWN0aW9uOiB0aGlzLm9wdGlvbnMuaW50cm9zcGVjdGlvbixcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFkdmFuY2VkIG9wdGlvbiwgYXBwIHdpbGwgaGF2ZSB0byBtYW51YWxseSBjYWxsZWQgc2NlbmUudXBkYXRlKCkgcGVyIGZyYW1lXG4gICAgICAgICAgICAgICAgICAgICAgICBkaXNhYmxlUmVuZGVyTG9vcDogdGhpcy5vcHRpb25zLmRpc2FibGVSZW5kZXJMb29wLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYWR2YW5jZWQgb3B0aW9uLCB3aWxsIHJlcXVpcmUgbGlicmFyeSB0byBiZSBzZXJ2ZWQgYXMgc2FtZSBob3N0IGFzIHBhZ2VcbiAgICAgICAgICAgICAgICAgICAgICAgIGFsbG93Q3Jvc3NEb21haW5Xb3JrZXJzOiB0aGlzLm9wdGlvbnMuYWxsb3dDcm9zc0RvbWFpbldvcmtlcnNcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICAvLyBGaW5pc2ggaW5pdGlhbGl6aW5nIHNjZW5lIGFuZCBzZXR1cCBldmVudHMgd2hlbiBsYXllciBpcyBhZGRlZCB0byBtYXBcbiAgICAgICAgICAgIG9uQWRkOiBmdW5jdGlvbiAobWFwKSB7XG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLnNjZW5lKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3JlYXRlU2NlbmUoKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBsYXllckJhc2VDbGFzcy5wcm90b3R5cGUub25BZGQuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcblxuICAgICAgICAgICAgICAgIHRoaXMuaG9va3MucmVzaXplID0gKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl91cGRhdGluZ190YW5ncmFtID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy51cGRhdGVTaXplKCk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3VwZGF0aW5nX3RhbmdyYW0gPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIG1hcC5vbigncmVzaXplJywgdGhpcy5ob29rcy5yZXNpemUpO1xuXG4gICAgICAgICAgICAgICAgdGhpcy5ob29rcy5tb3ZlID0gKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fdXBkYXRpbmdfdGFuZ3JhbSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fdXBkYXRpbmdfdGFuZ3JhbSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIHZhciB2aWV3ID0gbWFwLmdldENlbnRlcigpO1xuICAgICAgICAgICAgICAgICAgICB2aWV3Lnpvb20gPSBNYXRoLm1pbihtYXAuZ2V0Wm9vbSgpLCBtYXAuZ2V0TWF4Wm9vbSgpIHx8IEdlby5kZWZhdWx0X3ZpZXdfbWF4X3pvb20pO1xuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2NlbmUudmlldy5zZXRWaWV3KHZpZXcpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNjZW5lLmltbWVkaWF0ZVJlZHJhdygpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnJldmVyc2VUcmFuc2Zvcm0oKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fdXBkYXRpbmdfdGFuZ3JhbSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgbWFwLm9uKCdtb3ZlJywgdGhpcy5ob29rcy5tb3ZlKTtcblxuICAgICAgICAgICAgICAgIHRoaXMuaG9va3Muem9vbXN0YXJ0ID0gKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fdXBkYXRpbmdfdGFuZ3JhbSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fdXBkYXRpbmdfdGFuZ3JhbSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2NlbmUudmlldy5zdGFydFpvb20oKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fdXBkYXRpbmdfdGFuZ3JhbSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgbWFwLm9uKCd6b29tc3RhcnQnLCB0aGlzLmhvb2tzLnpvb21zdGFydCk7XG5cbiAgICAgICAgICAgICAgICB0aGlzLmhvb2tzLmRyYWdzdGFydCA9ICgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zY2VuZS52aWV3LnBhbm5pbmcgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgbWFwLm9uKCdkcmFnc3RhcnQnLCB0aGlzLmhvb2tzLmRyYWdzdGFydCk7XG5cbiAgICAgICAgICAgICAgICB0aGlzLmhvb2tzLmRyYWdlbmQgPSAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2NlbmUudmlldy5wYW5uaW5nID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBtYXAub24oJ2RyYWdlbmQnLCB0aGlzLmhvb2tzLmRyYWdlbmQpO1xuXG4gICAgICAgICAgICAgICAgLy8gRm9yY2UgbGVhZmxldCB6b29tIGFuaW1hdGlvbnMgb2ZmXG4gICAgICAgICAgICAgICAgbWFwLl96b29tQW5pbWF0ZWQgPSBmYWxzZTtcblxuICAgICAgICAgICAgICAgIC8vIE1vZGlmeSBkZWZhdWx0IGxlYWZsZXQgc2Nyb2xsIHdoZWVsIGJlaGF2aW9yXG4gICAgICAgICAgICAgICAgdGhpcy5tb2RpZnlTY3JvbGxXaGVlbEJlaGF2aW9yKG1hcCk7XG5cbiAgICAgICAgICAgICAgICAvLyBTZXR1cCBmZWF0dXJlIHNlbGVjdGlvblxuICAgICAgICAgICAgICAgIHRoaXMuc2V0dXBTZWxlY3Rpb25FdmVudEhhbmRsZXJzKG1hcCk7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXRTZWxlY3Rpb25FdmVudHModGhpcy5vcHRpb25zLmV2ZW50cyk7XG5cbiAgICAgICAgICAgICAgICAvLyBBZGQgR0wgY2FudmFzIHRvIGxheWVyIGNvbnRhaW5lclxuICAgICAgICAgICAgICAgIHRoaXMuc2NlbmUuY29udGFpbmVyID0gdGhpcy5nZXRDb250YWluZXIoKTtcbiAgICAgICAgICAgICAgICB0aGlzLnVwZGF0ZVNpemUoKTtcblxuICAgICAgICAgICAgICAgIC8vIEluaXRpYWwgdmlld1xuICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlVmlldygpO1xuXG4gICAgICAgICAgICAgICAgLy8gU3Vic2NyaWJlIHRvIHRhbmdyYW0gZXZlbnRzXG4gICAgICAgICAgICAgICAgdGhpcy5zY2VuZS5zdWJzY3JpYmUoe1xuICAgICAgICAgICAgICAgICAgICBtb3ZlOiB0aGlzLm9uVGFuZ3JhbVZpZXdVcGRhdGUuYmluZCh0aGlzKVxuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgLy8gVXNlIGxlYWZsZXQncyBleGlzdGluZyBldmVudCBzeXN0ZW0gYXMgdGhlIGNhbGxiYWNrIG1lY2hhbmlzbVxuICAgICAgICAgICAgICAgIHRoaXMuc2NlbmUubG9hZCgpLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl91cGRhdGluZ190YW5ncmFtID0gdHJ1ZTtcblxuICAgICAgICAgICAgICAgICAgICB0aGlzLnVwZGF0ZVNpemUoKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy51cGRhdGVWaWV3KCk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmV2ZXJzZVRyYW5zZm9ybSgpO1xuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3VwZGF0aW5nX3RhbmdyYW0gPSBmYWxzZTtcblxuICAgICAgICAgICAgICAgICAgICB0aGlzLmZpcmUoJ2luaXQnKTtcbiAgICAgICAgICAgICAgICB9KS5jYXRjaChlcnJvciA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZmlyZSgnZXJyb3InLCBlcnJvcik7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICBvblJlbW92ZTogZnVuY3Rpb24gKG1hcCkge1xuICAgICAgICAgICAgICAgIGxheWVyQmFzZUNsYXNzLnByb3RvdHlwZS5vblJlbW92ZS5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xuXG4gICAgICAgICAgICAgICAgbWFwLm9mZigncmVzaXplJywgdGhpcy5ob29rcy5yZXNpemUpO1xuICAgICAgICAgICAgICAgIG1hcC5vZmYoJ21vdmUnLCB0aGlzLmhvb2tzLm1vdmUpO1xuICAgICAgICAgICAgICAgIG1hcC5vZmYoJ3pvb21zdGFydCcsIHRoaXMuaG9va3Muem9vbXN0YXJ0KTtcbiAgICAgICAgICAgICAgICBtYXAub2ZmKCdkcmFnc3RhcnQnLCB0aGlzLmhvb2tzLmRyYWdzdGFydCk7XG4gICAgICAgICAgICAgICAgbWFwLm9mZignZHJhZ2VuZCcsIHRoaXMuaG9va3MuZHJhZ2VuZCk7XG4gICAgICAgICAgICAgICAgbWFwLm9mZignY2xpY2snLCB0aGlzLmhvb2tzLmNsaWNrKTtcbiAgICAgICAgICAgICAgICBtYXAub2ZmKCdtb3VzZW1vdmUnLCB0aGlzLmhvb2tzLm1vdXNlbW92ZSk7XG4gICAgICAgICAgICAgICAgbWFwLm9mZignbW91c2VvdXQnLCB0aGlzLmhvb2tzLm1vdXNlb3V0KTtcbiAgICAgICAgICAgICAgICB0aGlzLmhvb2tzID0ge307XG5cbiAgICAgICAgICAgICAgICBpZiAodGhpcy5zY2VuZSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNjZW5lLmRlc3Ryb3koKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zY2VuZSA9IG51bGw7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgY3JlYXRlVGlsZTogZnVuY3Rpb24gKGNvb3Jkcykge1xuICAgICAgICAgICAgICAgIHZhciBrZXkgPSBjb29yZHMueCArICcvJyArIGNvb3Jkcy55ICsgJy8nICsgY29vcmRzLno7XG4gICAgICAgICAgICAgICAgdmFyIGRpdiA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2RpdicpO1xuICAgICAgICAgICAgICAgIGRpdi5zZXRBdHRyaWJ1dGUoJ2RhdGEtdGlsZS1rZXknLCBrZXkpO1xuICAgICAgICAgICAgICAgIGRpdi5zdHlsZS53aWR0aCA9ICcyNTZweCc7XG4gICAgICAgICAgICAgICAgZGl2LnN0eWxlLmhlaWdodCA9ICcyNTZweCc7XG5cbiAgICAgICAgICAgICAgICBpZiAodGhpcy5vcHRpb25zLnNob3dEZWJ1Zykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZGVidWdfb3ZlcmxheSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2RpdicpO1xuICAgICAgICAgICAgICAgICAgICBkZWJ1Z19vdmVybGF5LnRleHRDb250ZW50ID0ga2V5O1xuICAgICAgICAgICAgICAgICAgICBkZWJ1Z19vdmVybGF5LnN0eWxlLnBvc2l0aW9uID0gJ2Fic29sdXRlJztcbiAgICAgICAgICAgICAgICAgICAgZGVidWdfb3ZlcmxheS5zdHlsZS5sZWZ0ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgZGVidWdfb3ZlcmxheS5zdHlsZS50b3AgPSAwO1xuICAgICAgICAgICAgICAgICAgICBkZWJ1Z19vdmVybGF5LnN0eWxlLmNvbG9yID0gJ3doaXRlJztcbiAgICAgICAgICAgICAgICAgICAgZGVidWdfb3ZlcmxheS5zdHlsZS5mb250U2l6ZSA9ICcxNnB4JztcbiAgICAgICAgICAgICAgICAgICAgZGVidWdfb3ZlcmxheS5zdHlsZS50ZXh0T3V0bGluZSA9ICcxcHggIzAwMDAwMCc7XG4gICAgICAgICAgICAgICAgICAgIGRlYnVnX292ZXJsYXkuc3R5bGUucGFkZGluZyA9ICc4cHgnO1xuXG4gICAgICAgICAgICAgICAgICAgIGRpdi5hcHBlbmRDaGlsZChkZWJ1Z19vdmVybGF5KTtcbiAgICAgICAgICAgICAgICAgICAgZGl2LnN0eWxlLmJvcmRlclN0eWxlID0gJ3NvbGlkJztcbiAgICAgICAgICAgICAgICAgICAgZGl2LnN0eWxlLmJvcmRlckNvbG9yID0gJ3doaXRlJztcbiAgICAgICAgICAgICAgICAgICAgZGl2LnN0eWxlLmJvcmRlcldpZHRoID0gJzFweCc7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcmV0dXJuIGRpdjtcbiAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgIC8vIE1vZGlmeSBsZWFmbGV0J3MgZGVmYXVsdCBzY3JvbGwgd2hlZWwgYmVoYXZpb3IgdG8gaGF2ZSBhIG11Y2ggbW9yZSBzZW5zaXR2ZS9jb250aW51b3VzIHpvb21cbiAgICAgICAgICAgIC8vIE5vdGU6IHRoaXMgc2hvdWxkIGJlIGRlcHJlY2F0ZWQgb25jZSBsZWFmbGV0IGNvbnRpbnVvdXMgem9vbSBpcyBtb3JlIHdpZGVseSB1c2VkIGFuZCB0aGVcbiAgICAgICAgICAgIC8vIGRlZmF1bHQgYmVoYXZpb3IgaXMgcHJlc3VtYWJseSBpbXByb3ZlZFxuICAgICAgICAgICAgbW9kaWZ5U2Nyb2xsV2hlZWxCZWhhdmlvcjogZnVuY3Rpb24gKG1hcCkge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLnNjZW5lLnZpZXcuY29udGludW91c196b29tICYmIG1hcC5zY3JvbGxXaGVlbFpvb20gJiYgdGhpcy5vcHRpb25zLm1vZGlmeVNjcm9sbFdoZWVsICE9PSBmYWxzZSkge1xuICAgICAgICAgICAgICAgICAgICBtYXAub3B0aW9ucy56b29tU25hcCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIG1hcC5vcHRpb25zLndoZWVsUHhQZXJab29tTGV2ZWwgPSAxMDAwO1xuICAgICAgICAgICAgICAgICAgICBtYXAub3B0aW9ucy53aGVlbERlYm91bmNlVGltZSA9IDEwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgIHVwZGF0ZVZpZXc6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB2YXIgdmlldyA9IHRoaXMuX21hcC5nZXRDZW50ZXIoKTtcbiAgICAgICAgICAgICAgICB2aWV3Lnpvb20gPSBNYXRoLm1pbih0aGlzLl9tYXAuZ2V0Wm9vbSgpLCB0aGlzLl9tYXAuZ2V0TWF4Wm9vbSgpIHx8IEdlby5kZWZhdWx0X3ZpZXdfbWF4X3pvb20pO1xuICAgICAgICAgICAgICAgIHRoaXMuc2NlbmUudmlldy5zZXRWaWV3KHZpZXcpO1xuICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgdXBkYXRlU2l6ZTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciBzaXplID0gdGhpcy5fbWFwLmdldFNpemUoKTtcbiAgICAgICAgICAgICAgICB0aGlzLnNjZW5lLnJlc2l6ZU1hcChzaXplLngsIHNpemUueSk7XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICBvblRhbmdyYW1WaWV3VXBkYXRlOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLl9tYXAgfHwgdGhpcy5fdXBkYXRpbmdfdGFuZ3JhbSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMuX3VwZGF0aW5nX3RhbmdyYW0gPSB0cnVlO1xuICAgICAgICAgICAgICAgIHRoaXMuX21hcC5zZXRWaWV3KFt0aGlzLnNjZW5lLnZpZXcuY2VudGVyLmxhdCwgdGhpcy5zY2VuZS52aWV3LmNlbnRlci5sbmddLCB0aGlzLnNjZW5lLnZpZXcuem9vbSwgeyBhbmltYXRlOiBmYWxzZSB9KTtcbiAgICAgICAgICAgICAgICB0aGlzLnJldmVyc2VUcmFuc2Zvcm0oKTtcbiAgICAgICAgICAgICAgICB0aGlzLl91cGRhdGluZ190YW5ncmFtID0gZmFsc2U7XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICByZW5kZXI6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMuc2NlbmUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLnNjZW5lLnVwZGF0ZSgpO1xuICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgLy8gUmV2ZXJzZSB0aGUgQ1NTIHBvc2l0aW9uaW5nIExlYWZsZXQgYXBwbGllcyB0byB0aGUgbGF5ZXIsIHNpbmNlIFRhbmdyYW0ncyBXZWJHTCBjYW52YXNcbiAgICAgICAgICAgIC8vIGlzIGV4cGVjdGVkIHRvIGJlICdhYnNvbHV0ZWx5JyBwb3NpdGlvbmVkLlxuICAgICAgICAgICAgcmV2ZXJzZVRyYW5zZm9ybTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmICghdGhpcy5fbWFwIHx8ICF0aGlzLnNjZW5lIHx8ICF0aGlzLnNjZW5lLmNvbnRhaW5lcikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdmFyIHRvcF9sZWZ0ID0gdGhpcy5fbWFwLmNvbnRhaW5lclBvaW50VG9MYXllclBvaW50KFswLCAwXSk7XG4gICAgICAgICAgICAgICAgTC5Eb21VdGlsLnNldFBvc2l0aW9uKHRoaXMuc2NlbmUuY29udGFpbmVyLCB0b3BfbGVmdCk7XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICAvLyBUaWUgTGVhZmxldCBldmVudCBoYW5kbGVycyB0byBUYW5ncmFtIGZlYXR1cmUgc2VsZWN0aW9uXG4gICAgICAgICAgICBzZXR1cFNlbGVjdGlvbkV2ZW50SGFuZGxlcnM6IGZ1bmN0aW9uIChtYXApIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9zZWxlY3Rpb25fZXZlbnRzID0ge307XG5cbiAgICAgICAgICAgICAgICB0aGlzLmhvb2tzLmNsaWNrID0gKGV2ZW50KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdGhpcy5fc2VsZWN0aW9uX2V2ZW50cy5jbGljayA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zY2VuZS5nZXRGZWF0dXJlQXQoZXZlbnQuY29udGFpbmVyUG9pbnQpLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZW4oc2VsZWN0aW9uID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3VsdHMgPSBPYmplY3QuYXNzaWduKHt9LCBzZWxlY3Rpb24sIHsgbGVhZmxldF9ldmVudDogZXZlbnQgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX3NlbGVjdGlvbl9ldmVudHMuY2xpY2socmVzdWx0cyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIG1hcC5vbignY2xpY2snLCB0aGlzLmhvb2tzLmNsaWNrKTtcblxuICAgICAgICAgICAgICAgIHRoaXMuaG9va3MubW91c2Vtb3ZlID0gKGV2ZW50KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdGhpcy5fc2VsZWN0aW9uX2V2ZW50cy5ob3ZlciA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zY2VuZS5nZXRGZWF0dXJlQXQoZXZlbnQuY29udGFpbmVyUG9pbnQpLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZW4oc2VsZWN0aW9uID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3VsdHMgPSBPYmplY3QuYXNzaWduKHt9LCBzZWxlY3Rpb24sIHsgbGVhZmxldF9ldmVudDogZXZlbnQgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX3NlbGVjdGlvbl9ldmVudHMuaG92ZXIocmVzdWx0cyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIG1hcC5vbignbW91c2Vtb3ZlJywgdGhpcy5ob29rcy5tb3VzZW1vdmUpO1xuXG4gICAgICAgICAgICAgICAgdGhpcy5ob29rcy5tb3VzZW91dCA9IChldmVudCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAvLyBXaGVuIG1vdXNlIGxlYXZlcyBtYXAsIHNlbmQgYW4gYWRkaXRpb25hbCBzZWxlY3Rpb24gZXZlbnQgdG8gaW5kaWNhdGUgbm8gZmVhdHVyZSBpcyBzZWxlY3RlZFxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9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gICAgY29sb3IgKz0gbGlnaHRfYWNjdW11bGF0b3JfYW1iaWVudCAqIF9jb2xvciAqIG1hdGVyaWFsLmFtYmllbnQ7XG4gICAgICAgICAgICAgICAgICAgICNlbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICAjaWZkZWYgVEFOR1JBTV9NQVRFUklBTF9ESUZGVVNFXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3IgKz0gbGlnaHRfYWNjdW11bGF0b3JfYW1iaWVudCAqIF9jb2xvciAqIG1hdGVyaWFsLmRpZmZ1c2U7XG4gICAgICAgICAgICAgICAgICAgICAgICAjZW5kaWZcbiAgICAgICAgICAgICAgICAgICAgI2VuZGlmXG5cbiAgICAgICAgICAgICAgICAgICAgI2lmZGVmIFRBTkdSQU1fTUFURVJJQUxfRElGRlVTRVxuICAgICAgICAgICAgICAgICAgICAgICAgY29sb3IgKz0gbGlnaHRfYWNjdW11bGF0b3JfZGlmZnVzZSAqIF9jb2xvciAqIG1hdGVyaWFsLmRpZmZ1c2U7XG4gICAgICAgICAgICAgICAgICAgICNlbmRpZlxuXG4gICAgICAgICAgICAgICAgICAgICNpZmRlZiBUQU5HUkFNX01BVEVSSUFMX1NQRUNVTEFSXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xvciArPSBsaWdodF9hY2N1bXVsYXRvcl9zcGVjdWxhciAqIG1hdGVyaWFsLnNwZWN1bGFyO1xuICAgICAgICAgICAgICAgICAgICAjZW5kaWZcbiAgICAgICAgICAgICAgICAvLyBNdWx0aXBseSBtYXRlcmlhbCBhbHBoYSBjaGFubmVsIGludG8gbWF0ZXJpYWwgUkdCIHdoZW4gYWxwaGEgYmxlbmRpbmcgaXMgb2ZmXG4gICAgICAgICAgICAgICAgI2Vsc2VcbiAgICAgICAgICAgICAgICAgICAgY29sb3IuYSA9IF9jb2xvci5hOyAvLyB1c2UgdmVydGV4IGNvbG9yIGFscGhhXG5cbiAgICAgICAgICAgICAgICAgICAgI2lmZGVmIFRBTkdSQU1fTUFURVJJQUxfRU1JU1NJT05cbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yLnJnYiA9IG1hdGVyaWFsLmVtaXNzaW9uLnJnYiAqIG1hdGVyaWFsLmVtaXNzaW9uLmE7XG4gICAgICAgICAgICAgICAgICAgICNlbmRpZlxuXG4gICAgICAgICAgICAgICAgICAgICNpZmRlZiBUQU5HUkFNX01BVEVSSUFMX0FNQklFTlRcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yLnJnYiArPSBsaWdodF9hY2N1bXVsYXRvcl9hbWJpZW50LnJnYiAqIF9jb2xvci5yZ2IgKiBtYXRlcmlhbC5hbWJpZW50LnJnYiAqIG1hdGVyaWFsLmFtYmllbnQuYTtcbiAgICAgICAgICAgICAgICAgICAgI2Vsc2VcbiAgICAgICAgICAgICAgICAgICAgICAgICNpZmRlZiBUQU5HUkFNX01BVEVSSUFMX0RJRkZVU0VcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvci5yZ2IgKz0gbGlnaHRfYWNjdW11bGF0b3JfYW1iaWVudC5yZ2IgKiBfY29sb3IucmdiICogbWF0ZXJpYWwuZGlmZnVzZS5yZ2IgKiBtYXRlcmlhbC5kaWZmdXNlLmE7XG4gICAgICAgICAgICAgICAgICAgICAgICAjZW5kaWZcbiAgICAgICAgICAgICAgICAgICAgI2VuZGlmXG5cbiAgICAgICAgICAgICAgICAgICAgI2lmZGVmIFRBTkdSQU1fTUFURVJJQUxfRElGRlVTRVxuICAgICAgICAgICAgICAgICAgICAgICAgY29sb3IucmdiICs9IGxpZ2h0X2FjY3VtdWxhdG9yX2RpZmZ1c2UucmdiICogX2NvbG9yLnJnYiAqIG1hdGVyaWFsLmRpZmZ1c2UucmdiICogbWF0ZXJpYWwuZGlmZnVzZS5hO1xuICAgICAgICAgICAgICAgICAgICAjZW5kaWZcblxuICAgICAgICAgICAgICAgICAgICAjaWZkZWYgVEFOR1JBTV9NQVRFUklBTF9TUEVDVUxBUlxuICAgICAgICAgICAgICAgICAgICAgICAgY29sb3IucmdiICs9IGxpZ2h0X2FjY3VtdWxhdG9yX3NwZWN1bGFyLnJnYiAqIG1hdGVyaWFsLnNwZWN1bGFyLnJnYiAqIG1hdGVyaWFsLnNwZWN1bGFyLmE7XG4gICAgICAgICAgICAgICAgICAgICNlbmRpZlxuICAgICAgICAgICAgICAgICNlbmRpZlxuXG4gICAgICAgICAgICAgICAgLy8gQ2xhbXAgZmluYWwgY29sb3JcbiAgICAgICAgICAgICAgICBjb2xvciA9IGNsYW1wKGNvbG9yLCAwLjAsIDEuMCk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gY29sb3I7XG4gICAgICAgICAgICB9YDtcblxuICAgICAgICBTaGFkZXJQcm9ncmFtLmFkZEJsb2NrKExpZ2h0LmJsb2NrLCBjYWxjdWxhdGVGdW5jdGlvbik7XG4gICAgfVxuXG4gICAgLy8gQ29tbW9uIGluc3RhbmNlIGRlZmluaXRpb25cbiAgICBpbmplY3QgKCkge1xuICAgICAgICBsZXQgaW5zdGFuY2UgPSAgYFxuICAgICAgICAgICAgdW5pZm9ybSAke3RoaXMuc3RydWN0X25hbWV9IHVfJHt0aGlzLm5hbWV9O1xuICAgICAgICAgICAgJHt0aGlzLnN0cnVjdF9uYW1lfSAke3RoaXMubmFtZX07XG4gICAgICAgICAgICBgO1xuICAgICAgICBsZXQgYXNzaWduID0gYFxuICAgICAgICAgICAgJHt0aGlzLm5hbWV9ID0gdV8ke3RoaXMubmFtZX07XFxuXG4gICAgICAgIGA7XG5cbiAgICAgICAgU2hhZGVyUHJvZ3JhbS5hZGRCbG9jayhMaWdodC5ibG9jaywgaW5zdGFuY2UpO1xuICAgICAgICBTaGFkZXJQcm9ncmFtLmFkZEJsb2NrKCdzZXR1cCcsIGFzc2lnbik7XG4gICAgfVxuXG4gICAgLy8gVXBkYXRlIG1ldGhvZCBjYWxsZWQgb25jZSBwZXIgZnJhbWVcbiAgICB1cGRhdGUgKCkge1xuICAgIH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AgICAgICAgICAgICAgICAgdGhpc1twcm9wXSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHR1cmU6IHZhbHVlLnRleHR1cmUsXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXBwaW5nOiB2YWx1ZS5tYXBwaW5nIHx8ICdzcGhlcmVtYXAnLFxuICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGU6IEdMU0wuZXhwYW5kVmVjMyh2YWx1ZS5zY2FsZSAhPSBudWxsID8gdmFsdWUuc2NhbGUgOiAxKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFtb3VudDogR0xTTC5leHBhbmRWZWM0KHZhbHVlLmFtb3VudCAhPSBudWxsID8gdmFsdWUuYW1vdW50IDogMSlcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAodHlwZW9mIHZhbHVlID09PSAnbnVtYmVyJyB8fCBBcnJheS5pc0FycmF5KHZhbHVlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzW3Byb3BdID0geyBhbW91bnQ6IEdMU0wuZXhwYW5kVmVjNCh2YWx1ZSkgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAodHlwZW9mIHZhbHVlID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzW3Byb3BdID0geyBhbW91bnQ6IFN0eWxlUGFyc2VyLnBhcnNlQ29sb3IodmFsdWUpIH07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aGlzW3Byb3BdID0gdmFsdWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gRXh0cmEgc3BlY3VsYXIgcHJvcHNcbiAgICAgICAgaWYgKHRoaXMuc3BlY3VsYXIpIHtcbiAgICAgICAgICAgIHRoaXMuc3BlY3VsYXIuc2hpbmluZXNzID0gY29uZmlnLnNoaW5pbmVzcyA/IHBhcnNlRmxvYXQoY29uZmlnLnNoaW5pbmVzcykgOiAwLjI7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBOb3JtYWwgbWFwcGluZ1xuICAgICAgICBpZiAoY29uZmlnLm5vcm1hbCAhPSBudWxsKSB7XG4gICAgICAgICAgICB0aGlzLm5vcm1hbCA9IHtcbiAgICAgICAgICAgICAgICB0ZXh0dXJlOiBjb25maWcubm9ybWFsLnRleHR1cmUsXG4gICAgICAgICAgICAgICAgbWFwcGluZzogY29uZmlnLm5vcm1hbC5tYXBwaW5nIHx8ICd0cmlwbGFuYXInLFxuICAgICAgICAgICAgICAgIHNjYWxlOiBHTFNMLmV4cGFuZFZlYzMoY29uZmlnLm5vcm1hbC5zY2FsZSAhPSBudWxsID8gY29uZmlnLm5vcm1hbC5zY2FsZSA6IDEpLFxuICAgICAgICAgICAgICAgIGFtb3VudDogY29uZmlnLm5vcm1hbC5hbW91bnQgIT0gbnVsbCA/IGNvbmZpZy5ub3JtYWwuYW1vdW50IDogMVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIERldGVybWluZSBpZiBhIG1hdGVyaWFsIGNvbmZpZyBibG9jayBoYXMgc3VmZmljaWVudCBwcm9wZXJ0aWVzIHRvIGNyZWF0ZSBhIG1hdGVyaWFsXG4gICAgc3RhdGljIGlzVmFsaWQgKGNvbmZpZykge1xuICAgICAgICBpZiAoY29uZmlnID09IG51bGwpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjb25maWcuZW1pc3Npb24gPT0gbnVsbCAmJlxuICAgICAgICAgICAgY29uZmlnLmFtYmllbnQgPT0gbnVsbCAmJlxuICAgICAgICAgICAgY29uZmlnLmRpZmZ1c2UgPT0gbnVsbCAmJlxuICAgICAgICAgICAgY29uZmlnLnNwZWN1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udGFpbiBjb21waWxlZCBKUyBmdW5jdGlvbnNcbiAgICAgICAgICAgICAgICAvLyB3aGljaCBuZWVkIHRvIGJlIHNlcmlhbGl6ZWQsIHdoaWxlIG9uZSBsb2FkZWQgb25seSBmcm9tIGEgVVJMIGRvZXMgbm90LlxuICAgICAgICAgICAgICAgIGNvbnN0IHNlcmlhbGl6ZV9mdW5jcyA9ICgodHlwZW9mIHRoaXMuY29uZmlnX3NvdXJjZSA9PT0gJ29iamVjdCcpIHx8IHRoaXMuaGFzU3Vic2NyaWJlcnNGb3IoJ2xvYWQnKSk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy51cGRhdGVDb25maWcoeyBzZXJpYWxpemVfZnVuY3MsIGZhZGVfaW46IHRydWUgfSk7XG4gICAgICAgICAgICB9KS50aGVuKCgpID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLnVwZGF0aW5nLS07XG4gICAgICAgICAgICAgICAgdGhpcy5pbml0aWFsaXppbmcgPSBudWxsO1xuICAgICAgICAgICAgICAgIHRoaXMuaW5pdGlhbGl6ZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHRoaXMubGFzdF92YWxpZF9jb25maWdfc291cmNlID0gdGhpcy5jb25maWdfc291cmNlO1xuICAgICAgICAgICAgICAgIHRoaXMubGFzdF92YWxpZF9jb25maWdfcGF0aCA9IHRoaXMuY29uZmlnX3BhdGg7XG5cbiAgICAgICAgICAgICAgICBpZiAodGhpcy5yZW5kZXJfbG9vcCAhPT0gZmFsc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXR1cFJlbmRlckxvb3AoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5yZXF1ZXN0UmVkcmF3KCk7XG4gICAgICAgIH0pLmNhdGNoKGVycm9yID0+IHtcbiAgICAgICAgICAgIHRoaXMuaW5pdGlhbGl6aW5nID0gbnVsbDtcbiAgICAgICAgICAgIHRoaXMudXBkYXRpbmcgPSAwO1xuXG4gICAgICAgICAgICAvLyBSZXBvcnQgYW5kIHJldmVydCB0byBsYXN0IHZhbGlkIGNvbmZpZyBpZiBhdmFpbGFibGVcbiAgICAgICAgICAgIGxldCB0eXBlLCBtZXNzYWdlO1xuICAgICAgICAgICAgaWYgKGVycm9yLm5hbWUgPT09ICdZQU1MRXhjZXB0aW9uJykge1xuICAgICAgICAgICAgICAgIHR5cGUgPSAneWFtbCc7XG4gICAgICAgICAgICAgICAgbWVzc2FnZSA9ICdFcnJvciBwYXJzaW5nIHNjZW5lIFlBTUwnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gVE9ETzogbW9yZSBlcnJvciB0eXBlc1xuICAgICAgICAgICAgICAgIG1lc3NhZ2UgPSAnRXJyb3IgaW5pdGlhbGl6aW5nIHNjZW5lJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMudHJpZ2dlcignZXJyb3InLCB7IHR5cGUsIG1lc3NhZ2UsIGVycm9yLCB1cmw6IHRoaXMuY29uZmlnX3NvdXJjZSB9KTtcblxuICAgICAgICAgICAgbWVzc2FnZSA9IGBTY2VuZS5sb2FkKCkgZmFpbGVkIHRvIGxvYWQgJHt0aGlzLmNvbmZpZ19zb3VyY2V9OiAke2Vycm9yLm1lc3NhZ2V9YDtcbiAgICAgICAgICAgIGlmICh0aGlzLmxhc3RfdmFsaWRfY29uZmlnX3NvdXJjZSkge1xuICAgICAgICAgICAgICAgIGxvZygnd2FybicsIG1lc3NhZ2UsIGVycm9yKTtcbiAgICAgICAgICAgICAgICBsb2coJ2luZm8nLCBgU2NlbmUubG9hZCgpIHJldmVydGluZyB0byBsYXN0IHZhbGlkIGNvbmZpZ3VyYXRpb25gKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5sb2FkKHRoaXMubGFzdF92YWxpZF9jb25maWdfc291cmNlLCB0aGlzLmxhc3RfdmFsaWRfY29uZmlnX3BhdGgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbG9nKCdlcnJvcicsIG1lc3NhZ2UsIGVycm9yKTtcbiAgICAgICAgICAgIHRocm93IGVycm9yO1xuICAgICAgICB9KTtcblxuICAgICAgICByZXR1cm4gdGhpcy5pbml0aWFsaXppbmc7XG4gICAgfVxuXG4gICAgLy8gRm9yIEFQSSBjb21wYXRpYmlsaXR5XG4gICAgcmVsb2FkKGNvbmZpZ19zb3VyY2UgPSBudWxsLCBjb25maWdfcGF0aCA9IG51bGwpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubG9hZChjb25maWdfc291cmNlLCBjb25maWdfcGF0aCk7XG4gICAgfVxuXG4gICAgZGVzdHJveSgpIHtcbiAgICAgICAgdGhpcy5pbml0aWFsaXplZCA9IGZhbHNlO1xuICAgICAgICB0aGlzLnJlbmRlcl9sb29wX3N0b3AgPSB0cnVlOyAvLyBzY2hlZHVsZSByZW5kZXIgbG9vcCB0byBzdG9wXG5cbiAgICAgICAgdGhpcy5kZXN0cm95TGlzdGVuZXJzKCk7XG5cbiAgICAgICAgaWYgKHRoaXMuY2FudmFzICYmIHRoaXMuY2FudmFzLnBhcmVudE5vZGUpIHtcbiAgICAgICAgICAgIHRoaXMuY2FudmFzLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQodGhpcy5jYW52YXMpO1xuICAgICAgICAgICAgdGhpcy5jYW52YXMgPSBudWxsO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuY29udGFpbmVyID0gbnVsbDtcblxuICAgICAgICBpZiAodGhpcy5zZWxlY3Rpb24pIHtcbiAgICAgICAgICAgIHRoaXMuc2VsZWN0aW9uLmRlc3Ryb3koKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmdsKSB7XG4gICAgICAgICAgICBUZXh0dXJlLmRlc3Ryb3kodGhpcy5nbCk7XG4gICAgICAgICAgICB0aGlzLnN0eWxlX21hbmFnZXIuZGVzdHJveSh0aGlzLmdsKTtcbiAgICAgICAgICAgIHRoaXMuc3R5bGVzID0ge307XG5cbiAgICAgICAgICAgIC8vIEZvcmNlIGNvbnRleHQgbG9zc1xuICAgICAgICAgICAgbGV0IGV4dCA9IHRoaXMuZ2wuZ2V0RXh0ZW5zaW9uKCdXRUJHTF9sb3NlX2NvbnRleHQnKTtcbiAgICAgICAgICAgIGlmIChleHQpIHtcbiAgICAgICAgICAgICAgICBleHQubG9zZUNvbnRleHQoKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5nbCA9IG51bGw7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnNvdXJjZXMgPSB7fTtcblxuICAgICAgICB0aGlzLmRlc3Ryb3lXb3JrZXJzKCk7XG4gICAgICAgIHRoaXMudGlsZV9tYW5hZ2VyLmRlc3Ryb3koKTtcbiAgICAgICAgdGhpcy50aWxlX21hbmFnZXIgPSBudWxsO1xuICAgIH1cblxuICAgIGNyZWF0ZUNhbnZhcygpIHtcbiAgICAgICAgaWYgKHRoaXMuY2FudmFzKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmNvbnRhaW5lciA9IHRoaXMuY29udGFpbmVyIHx8IGRvY3VtZW50LmJvZHk7XG4gICAgICAgIHRoaXMuY2FudmFzID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnY2FudmFzJyk7XG4gICAgICAgIHRoaXMuY2FudmFzLnN0eWxlLnBvc2l0aW9uID0gJ2Fic29sdXRlJztcbiAgICAgICAgdGhpcy5jYW52YXMuc3R5bGUudG9wID0gMDtcbiAgICAgICAgdGhpcy5jYW52YXMuc3R5bGUubGVmdCA9IDA7XG5cbiAgICAgICAgLy8gRm9yY2UgdGFuZ3JhbSBjYW52YXMgdW5kZXJuZWF0aCBhbGwgbGVhZmxldCBsYXllcnMsIGFuZCBzZXQgYmFja2dyb3VuZCB0byB0cmFuc3BhcmVudFxuICAgICAgICB0aGlzLmNvbnRhaW5lci5z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VyKHVybCk7XG4gICAgICAgICAgICB0aGlzLndvcmtlcnNbaWRdID0gd29ya2VyO1xuXG4gICAgICAgICAgICBXb3JrZXJCcm9rZXIuYWRkV29ya2VyKHdvcmtlcik7XG5cbiAgICAgICAgICAgIGxvZygnZGVidWcnLCBgU2NlbmUubWFrZVdvcmtlcnM6IGluaXRpYWxpemluZyB3b3JrZXIgJHtpZH1gKTtcbiAgICAgICAgICAgIGxldCBfaWQgPSBpZDtcbiAgICAgICAgICAgIHF1ZXVlLnB1c2goV29ya2VyQnJva2VyLnBvc3RNZXNzYWdlKHdvcmtlciwgJ3NlbGYuaW5pdCcsIHRoaXMuaWQsIGlkLCB0aGlzLm51bV93b3JrZXJzLCB0aGlzLmxvZ19sZXZlbCwgVXRpbHMuZGV2aWNlX3BpeGVsX3JhdGlvKS50aGVuKFxuICAgICAgICAgICAgICAgIChpZCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBsb2coJ2RlYnVnJywgYFNjZW5lLm1ha2VXb3JrZXJzOiBpbml0aWFsaXplZCB3b3JrZXIgJHtpZH1gKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlkO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgKGVycm9yKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGxvZygnZXJyb3InLCBgU2NlbmUubWFrZVdvcmtlcnM6IGZhaWxlZCB0byBpbml0aWFsaXplIHdvcmtlciAke19pZH06YCwgZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZWplY3QoZXJyb3IpO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICApO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5uZXh0X3dvcmtlciA9IDA7XG4gICAgICAgIHJldHVybiBQcm9taXNlLmFsbChxdWV1ZSkudGhlbigoKSA9PiB7XG4gICAgICAgICAgICBsb2cuc2V0V29ya2Vycyh0aGlzLndvcmtlcnMpO1xuXG4gICAgICAgICAgICAvLyBMZXQgVmVydGV4RWxlbWVudHMga25vdyBpZiAzMiBiaXQgaW5kaWNlcyBmb3IgZWxlbWVudCBhcnJheXMgYXJlIGF2YWlsYWJsZVxuICAgICAgICAgICAgbGV0IFVpbnQzMl9mbGFnID0gdGhpcy5nbC5nZXRFeHRlbnNpb24oXCJPRVNfZWxlbWVudF9pbmRleF91aW50XCIpID8gdHJ1ZSA6IGZhbHNlO1xuICAgICAgICAgICAgV29ya2VyQnJva2VyLnBvc3RNZXNzYWdlKHRoaXMud29ya2VycywgJ1ZlcnRleEVsZW1lbnRzLnNldFVpbnQzMkZsYWcnLCBVaW50MzJfZmxhZyk7XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGRlc3Ryb3lXb3JrZXJzKCkge1xuICAgICAgICBpZiAoQXJyYXkuaXNBcnJheSh0aGlzLndvcmtlcnMpKSB7XG4gICAgICAgICAgICBsb2cuc2V0V29ya2VycyhudWxsKTtcbiAgICAgICAgICAgIHRoaXMud29ya2Vycy5mb3JFYWNoKCh3b3JrZXIpID0+IHtcbiAgICAgICAgICAgICAgICB3b3JrZXIudGVybWluYXRlKCk7XG4gICAgICAgICAgICAgICAgV29ya2VyQnJva2VyLnJlbW92ZVdvcmtlcih3b3JrZXIpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB0aGlzLndvcmtlcnMgPSBudWxsO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gUm91bmQgcm9iaW4gc2VsZWN0aW9uIG9mIG5leHQgd29ya2VyXG4gICAgbmV4dFdvcmtlcigpIHtcbiAgICAgICAgdmFyIHdvcmtlciA9IHRoaXMud29ya2Vyc1t0aGlzLm5leHRfd29ya2VyXTtcbiAgICAgICAgdGhpcy5uZXh0X3dvcmtlciA9ICh0aGlzLm5leHRfd29ya2VyICsgMSkgJSB0aGlzLndvcmtlcnMubGVuZ3RoO1xuICAgICAgICByZXR1cm4gd29ya2VyO1xuICAgIH1cblxuIC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G4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBUcmFkaXRpb25hbCBhbHBoYSBibGVuZGluZ1xuICAgICAgICAgICAgZWxzZSBpZiAoYmxlbmQgPT09ICdvdmVybGF5JyB8fCBibGVuZCA9PT0gJ2lubGF5Jykge1xuICAgICAgICAgICAgICAgIHJlbmRlcl9zdGF0ZXMuYmxlbmRpbmcuc2V0KHtcbiAgICAgICAgICAgICAgICAgICAgYmxlbmQ6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgIHNyYzogZ2wuU1JDX0FMUEhBLCBkc3Q6IGdsLk9ORV9NSU5VU19TUkNfQUxQSEEsXG4gICAgICAgICAgICAgICAgICAgIHNyY19hbHBoYTogZ2wuT05FLCBkc3RfYWxwaGE6IGdsLk9ORV9NSU5VU19TUkNfQUxQSEFcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIEFkZGl0aXZlIGJsZW5kaW5nXG4gICAgICAgICAgICBlbHNlIGlmIChibGVuZCA9PT0gJ2FkZCcpIHtcbiAgICAgICAgICAgICAgICByZW5kZXJfc3RhdGVzLmJsZW5kaW5nLnNldCh7XG4gICAgICAgICAgICAgICAgICAgIGJsZW5kOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICBzcmM6IGdsLk9ORSwgZHN0OiBnbC5PTkUsXG4gICAgICAgICAgICAgICAgICAgIHNyY19hbHBoYTogZ2wuT05FLCBkc3RfYWxwaGE6IGdsLk9ORV9NSU5VU19TUkNfQUxQSEFcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIE11bHRpcGxpY2F0aXZlIGJsZW5kaW5nXG4gICAgICAgICAgICBlbHNlIGlmIChibGVuZCA9PT0gJ211bHRpcGx5Jykge1xuICAgICAgICAgICAgICAgIHJlbmRlcl9zdGF0ZXMuYmxlbmRpbmcuc2V0KHtcbiAgICAgICAgICAgICAgICAgICAgYmxlbmQ6IH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VfaW4gPSBmYWxzZSB9ID0ge30pIHtcbiAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgICAgICAgIC8vIFNraXAgcmVidWlsZCBpZiBhbHJlYWR5IGluIHByb2dyZXNzXG4gICAgICAgICAgICBpZiAodGhpcy5idWlsZGluZykge1xuICAgICAgICAgICAgICAgIC8vIFF1ZXVlIHVwIHRvIG9uZSByZWJ1aWxkIGNhbGwgYXQgYSB0aW1lLCBvbmx5IHNhdmUgbGFzdCByZXF1ZXN0XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuYnVpbGRpbmcucXVldWVkICYmIHRoaXMuYnVpbGRpbmcucXVldWVkLnJlamVjdCkge1xuICAgICAgICAgICAgICAgICAgICAvLyBub3RpZnkgcHJldmlvdXMgcmVxdWVzdCB0aGF0IGl0IGRpZCBub3QgY29tcGxldGVcbiAgICAgICAgICAgICAgICAgICAgbG9nKCdkZWJ1ZycsICdTY2VuZS5yZWJ1aWxkOiByZXF1ZXN0IHN1cGVyY2VkZWQgYnkgYSBuZXdlciBjYWxsJyk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYnVpbGRpbmcucXVldWVkLnJlc29sdmUoZmFsc2UpOyAvLyBmYWxzZSBmbGFnIGluZGljYXRlcyByZWJ1aWxkIHJlcXVlc3Qgd2FzIHN1cGVyY2VkZWRcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBTYXZlIHF1ZXVlZCByZXF1ZXN0XG4gICAgICAgICAgICAgICAgdGhpcy5idWlsZGluZy5xdWV1ZWQgPSB7IHJlc29sdmUsIHJlamVjdCB9O1xuICAgICAgICAgICAgICAgIGxvZygndHJhY2UnLCBgU2NlbmUucmVidWlsZCgpOiBxdWV1aW5nIHJlcXVlc3RgKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIFRyYWNrIHRpbG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XMuYnVpbGRpbmcgPSBudWxsO1xuICAgICAgICAgICAgaWYgKHF1ZXVlZCkge1xuICAgICAgICAgICAgICAgIGxvZygnZGVidWcnLCBgU2NlbmU6IHN0YXJ0aW5nIHF1ZXVlZCByZWJ1aWxkKCkgcmVxdWVzdGApO1xuICAgICAgICAgICAgICAgIHRoaXMucmVidWlsZCgpLnRoZW4ocXVldWVkLnJlc29sdmUsIHF1ZXVlZC5yZWplY3QpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICAgTG9hZCAob3IgcmVsb2FkKSB0aGUgc2NlbmUgY29uZmlnXG4gICAgICAgQHJldHVybiB7UHJvbWlzZX1cbiAgICAqL1xuICAgIGxvYWRTY2VuZShjb25maWdfc291cmNlID0gbnVsbCwgY29uZmlnX3BhdGggPSBudWxsKSB7XG4gICAgICAgIHRoaXMuY29uZmlnX3NvdXJjZSA9IGNvbmZpZ19zb3VyY2UgfHwgdGhpcy5jb25maWdfc291cmNlO1xuICAgICAgICB0aGlzLmNvbmZpZ19nbG9iYWxzX2FwcGxpZWQgPSBbXTtcblxuICAgICAgICBpZiAodHlwZW9mIHRoaXMuY29uZmlnX3NvdXJjZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIHRoaXMuY29uZmlnX3BhdGggPSBVdGlscy5wYXRoRm9yVVJMKGNvbmZpZ19wYXRoIHx8IHRoaXMuY29uZmlnX3NvdXJjZSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNvbmZpZ19wYXRoID0gVXRpbHMucGF0aEZvclVSTChjb25maWdfcGF0aCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gU2NlbmVMb2FkZXIubG9hZFNjZW5lKHRoaXMuY29uZmlnX3NvdXJjZSwgdGhpcy5jb25maWdfcGF0aCkudGhlbihjb25maWcgPT4ge1xuICAgICAgICAgICAgdGhpcy5jb25maWcgPSBjb25maW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hdGFTb3VyY2UgKG5hbWUsIGNvbmZpZykge1xuICAgICAgICBpZiAoIW5hbWUgfHwgIWNvbmZpZyB8fCAhY29uZmlnLnR5cGUgfHwgKCFjb25maWcudXJsICYmICFjb25maWcuZGF0YSkpIHtcbiAgICAgICAgICAgIGxvZygnZXJyb3InLCBcIk5vIG5hbWUgcHJvdmlkZWQgb3Igbm90IGEgdmFsaWQgY29uZmlnOlwiLCBuYW1lLCBjb25maWcpO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgbGV0IGxvYWQgPSAodGhpcy5jb25maWcuc291cmNlc1tuYW1lXSA9PSBudWxsKTtcbiAgICAgICAgbGV0IHNvdXJjZSA9IHRoaXMuY29uZmlnLnNvdXJjZXNbbmFtZV0gPSBPYmplY3QuYXNzaWduKHt9LCBjb25maWcpO1xuXG4gICAgICAgIGlmIChzb3VyY2UuZGF0YSAmJiB0eXBlb2Ygc291cmNlLmRhdGEgPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICBzb3VyY2UudXJsID0gVXRpbHMuY3JlYXRlT2JqZWN0VVJMKG5ldyBCbG9iKFtKU09OLnN0cmluZ2lmeShzb3VyY2UuZGF0YSldKSk7XG4gICAgICAgICAgICBkZWxldGUgc291cmNlLmRhdGE7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobG9hZCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMudXBkYXRlQ29uZmlnKHsgcmVidWlsZDogeyBzb3VyY2VzOiBbbmFtZV0gfSB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnJlYnVpbGQoeyBzb3VyY2VzOiBbbmFtZV0gfSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBjcmVhdGVEYXRhU291cmNlcygpIHtcbiAgICAgICAgbGV0IHJlc2V0ID0gW107IC8vIHNvdXJjZXMgdG8gcmVzZXRcbiAgICAgICAgbGV0IHByZXZfc291cmNlX25hbWVzID0gT2JqZWN0LmtleXModGhpcy5zb3VyY2VzKTtcblxuICAgICAgICBmb3IgKHZhciBuYW1lIGluIHRoaXMuY29uZmlnLnNvdXJjZXMpIHtcbiAgICAgICAgICAgIGxldCBzb3VyY2UgPSB0aGlzLmNvbmZpZy5zb3VyY2VzW25hbWVdO1xuICAgICAgICAgICAgbGV0IHByZXZfc291cmNlID0gdGhpcy5zb3VyY2VzW25hbWVdO1xuXG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHRoaXMuc291cmNlc1tuYW1lXSA9IERhdGFTb3VyY2UuY3JlYXRlKE9iamVjdC5hc3NpZ24oe30sIHNvdXJjZSwge25hbWV9KSwgdGhpcy5zb3VyY2VzKTtcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMuc291cmNlc1tuYW1lXSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyB7fTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXRjaChlKSB7XG4gICAgICAgICAgICAgICAgZGVsZXRlIHRoaXMuc291cmNlc1tuYW1lXTtcbiAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IGBDb3VsZCBub3QgY3JlYXRlIGRhdGEgc291cmNlOiAke2UubWVzc2FnZX1gO1xuICAgICAgICAgICAgICAgIGxvZygnd2FybicsIGBTY2VuZTogJHttZXNzYWdlfWAsIHNvdXJjZSk7XG4gICAgICAgICAgICAgICAgdGhpcy50cmlnZ2VyKCd3YXJuaW5nJywgeyB0eXBlOiAnc291cmNlcycsIHNvdXJjZSwgbWVzc2FnZSB9KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gRGF0YSBzb3VyY2UgY2hhbmdlZD9cbiAgICAgICAgICAgIGlmIChEYXRhU291cmNlLmNoYW5nZWQodGhpcy5zb3VyY2VzW25hbWVdLCBwcmV2X3NvdXJjZSkpIHtcbiAgICAgICAgICAgICAgICByZXNldC5wdXNoKG5hbWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gU291cmNlcyB0aGF0IHdlcmUgcmVtb3ZlZFxuICAgICAgICBmb3IgKGxldCBzIG9mIHByZXZfc291cmNlX25hbWVzKSB7XG4gICAgICAgICAgICBpZiAoIXRoaXMuY29uZmlnLnNvdXJjZXNbc10pIHtcbiAgICAgICAgICAgICAgICBkZWxldGUgdGhpcy5zb3VyY2VzW3NdOyAvLyBUT0RPOiByZW1vdmUgZnJvbSB3b3JrZXJzIHRvbz9cbiAgICAgICAgICAgICAgICByZXNldC5wdXNoKHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gUmVtb3ZlIHRpbGVzIGZyb20gc291cmNlcyB0aGF0IGhhdmUgY2hhbmdlZFxuICAgICAgICBpZiAocmVzZXQubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgdGhpcy50aWxlX21hbmFnZXIucmVtb3ZlVGlsZXModGlsZSA9PiB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIChyZXNldC5pbmRleE9mKHRpbGUuc291cmNlLm5hbWUpID4gLTEpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBNYXJrIHNvdXJjZXMgdGhhdCB3aWxsIGdlbmVyYXRlIGdlb21ldHJ5IHRpbGVzXG4gICAgICAgIC8vIChhbGwgZXhjZXB0IHRob3NlIHRoYXQgYXJlIG9ubHkgcmFzdGVyIHNvdXJjZXMgYXR0YWNoZWQgdG8gb3RoZXIgc291cmNlcylcbiAgICAgICAgZm9yIChsZXQgbGF5ZXIgb2YgVXRpbHMudmFsdWVzKHRoaXMuY29uZmlnLmxheWVycykpIHtcbiAgICAgICAgICAgIGlmIChsYXllci5kYXRhICYmIHRoaXMuc291cmNlc1tsYXllci5kYXRhLnNvdXJjZV0pIHtcbiAgICAgICAgICAgICAgICB0aGlzLnNvdXJjZXNbbGF5ZXIuZGF0YS5zb3VyY2V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WUsIGdyb3VwXSBvZiBVdGlscy5lbnRyaWVzKGxheWVyLmRyYXcpKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IHdhcm4gb24gbm9uLW9iamVjdCBkcmF3IGdyb3VwXG4gICAgICAgICAgICAgICAgICAgIGlmIChncm91cCAhPSBudWxsICYmIHR5cGVvZiBncm91cCA9PT0gJ29iamVjdCcgJiYgZ3JvdXAudmlzaWJsZSAhPT0gZmFsc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdHlsZV9uYW1lID0gZ3JvdXAuc3R5bGUgfHwgbmFtZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdHlsZXMgPSBbc3R5bGVfbmFtZV07XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9wdGlvbmFsIGFkZGl0aW9uYWwgb3V0bGluZSBzdHlsZVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGdyb3VwLm91dGxpbmUgJiYgZ3JvdXAub3V0bGluZS5zdHlsZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlcy5wdXNoKGdyb3VwLm91dGxpbmUuc3R5bGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBzdHlsZXMgPSBzdHlsZXMuZmlsdGVyKHggPT4gdGhpcy5zdHlsZXNbeF0pLmZvckVhY2goc3R5bGVfbmFtZSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN0eWxlID0gdGhpcy5zdHlsZXNbc3R5bGVfbmFtZV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0eWxlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuYWN0aXZlX3N0eWxlc1tzdHlsZV9uYW1lXSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdHlsZS5hbmltYXRlZCkge1x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JhKG5hbWUpO1xuICAgIH1cblxuICAgIC8vIENyZWF0ZSBsaWdodGluZ1xuICAgIGNyZWF0ZUxpZ2h0cygpIHtcbiAgICAgICAgdGhpcy5saWdodHMgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSBpbiB0aGlzLmNvbmZpZy5saWdodHMpIHtcbiAgICAgICAgICAgIGlmICghdGhpcy5jb25maWcubGlnaHRzW2ldIHx8IHR5cGVvZiB0aGlzLmNvbmZpZy5saWdodHNbaV0gIT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgbGlnaHQgPSB0aGlzLmNvbmZpZy5saWdodHNbaV07XG4gICAgICAgICAgICBsaWdodC5uYW1lID0gaS5yZXBsYWNlKCctJywgJ18nKTsgLy8gbGlnaHQgbmFtZXMgYXJlIGluamVjdGVkIGluIHNoYWRlcnMsIGNhbid0IGhhdmUgaHlwaGVuc1xuICAgICAgICAgICAgbGlnaHQudmlzaWJsZSA9IChsaWdodC52aXNpYmxlID09PSBmYWxzZSkgPyBmYWxzZSA6IHRydWU7XG4gICAgICAgICAgICBpZiAobGlnaHQudmlzaWJsZSkge1xuICAgICAgICAgICAgICAgIHRoaXMubGlnaHRzW2xpZ2h0Lm5hbWVdID0gTGlnaHQuY3JlYXRlKHRoaXMudmlldywgbGlnaHQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIExpZ2h0LmluamVjdCh0aGlzLmxpZ2h0cyk7XG4gICAgfVxuXG4gICAgLy8gU2V0IGJhY2tncm91bmQgY29sb3JcbiAgICBzZXRCYWNrZ3JvdW5kKCkge1xuICAgICAgICBsZXQgYmcgPSB0aGlzLmNvbmZpZy5zY2VuZS5iYWNrZ3JvdW5kO1xuICAgICAgICB0aGlzLmJhY2tncm91bmQgPSB7fTtcbiAgICAgICAgaWYgKGJnICYmIGJnLmNvbG9yKSB7XG4gICAgICAgICAgICB0aGlzLmJ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uXG4gICAgX3Byb2ZpbGVFbmQobmFtZSkge1xuICAgICAgICBjb25zb2xlLnByb2ZpbGVFbmQoYG1haW4gdGhyZWFkOiAke25hbWV9YCk7XG4gICAgICAgIFdvcmtlckJyb2tlci5wb3N0TWVzc2FnZSh0aGlzLndvcmtlcnMsICdzZWxmLnByb2ZpbGVFbmQnLCBuYW1lKTtcbiAgICB9XG5cbiAgICAvLyBEZWJ1ZyBjb25maWcgYW5kIGZ1bmN0aW9uc1xuICAgIHNldHVwRGVidWcgKCkge1xuICAgICAgICBsZXQgc2NlbmUgPSB0aGlzO1xuICAgICAgICB0aGlzLmRlYnVnID0ge1xuICAgICAgICAgICAgLy8gUmVidWlsZCBnZW9tZXRyeSBhIGdpdmVuICMgb2YgdGltZXMgYW5kIHByaW50IGF2ZXJhZ2UsIG1pbiwgbWF4IHRpbWluZ3NcbiAgICAgICAgICAgIHRpbWVSZWJ1aWxkIChudW0gPSAxLCBvcHRpb25zID0ge30pIHtcbiAgICAgICAgICAgICAgICBsZXQgdGltZXMgPSBbXTtcbiAgICAgICAgICAgICAgICBsZXQgY3ljbGUgPSAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBzdGFydCA9ICtuZXcgRGF0ZSgpO1xuICAgICAgICAgICAgICAgICAgICBzY2VuZS5yZWJ1aWxkKG9wdGlvbnMpLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGltZXMucHVzaCgrbmV3IERhdGUoKSAtIHN0YXJ0KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRpbWVzLmxlbmd0aCA8IG51bSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN5Y2xlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXZnID0gfn4odGltZXMucmVkdWNlKChhLCBiKSA9PiBhICsgYikgLyB0aW1lcy5sZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZygnaW5mbycsIGBQcm9maWxlZCByZWJ1aWxkICR7bnVtfSB0aW1lczogJHthdmd9IGF2ZyAoJHtNYXRoLm1pbiguLi50aW1lcyl9IG1pbiwgJHtNYXRoLm1heCguLi50aW1lcyl9IG1heClgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBjeWNsZSgpO1xuICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgLy8gUmV0dXJuIGdlb21ldHJ5IGNvdW50cyBvZiB2aXNpYmxlIHRpbGVzLCBncm91cGVkIGJ5IHN0eWxlIG5hbWVcbiAgICAgICAgICAgIGdlb21ldHJ5Q291bnRCeVN0eWxlICgpIHtcbiAgICAgICAgICAgICAgICBsZXQgY291bnRzID0ge307XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgdGlsZSBvZiBzY2VuZS50aWxlX21hbmFnZXIuZ2V0UmVuZGVyYWJsZVRpbGVzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgc3R5bGUgaW4gdGlsZS5tZXNoZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50c1tzdHlsZV0gPSBjb3VudHNbc3R5bGVdIHx8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb3VudHNbc3R5bGVdICs9IHRpbGUubWVzaGVzW3N0eWxlXS5nZW9tZXRyeV9jb3VudDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gY291bnRzO1xuICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgZ2VvbWV0cnlDb3VudEJ5QmFzZVN0eWxlICgpIHtcbiAgICAgICAgICAgICAgICBsZXQgc3R5bGVfY291bnRzID0gc2NlbmUuZGV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MKHVybCkgJiYgdGhpcy5jb250YWluZXIpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnBhcmVudC51cmxGb3IodGhpcy5wYXRoX2Zvcl9wYXJlbnQgKyB1cmwpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBVdGlscy5hZGRCYXNlVVJMKHVybCwgdGhpcy5wYXRoKTtcbiAgICB9XG5cbiAgICBwYXRoRm9yKHVybCkge1xuICAgICAgICByZXR1cm4gVXRpbHMucGF0aEZvclVSTCh1cmwpO1xuICAgIH1cblxuICAgIHR5cGVGb3IodXJsKSB7XG4gICAgICAgIHJldHVybiBVdGlscy5leHRlbnNpb25Gb3JVUkwodXJsKTtcbiAgICB9XG5cbiAgICBpc0NvbnRhaW5lcigpIHtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxufVxuXG5leHBvcnQgY2xhc3MgWmlwU2NlbmVCdW5kbGUgZXh0ZW5kcyBTY2VuZUJ1bmRsZSB7XG5cbiAgICBjb25zdHJ1Y3Rvcih1cmwsIHBhdGgsIHBhcmVudCkge1xuICAgICAgICBzdXBlcih1cmwsIHBhdGgsIHBhcmVudCk7XG4gICAgICAgIHRoaXMuemlwID0gbnVsbDtcbiAgICAgICAgdGhpcy5maWxlcyA9IHt9O1xuICAgICAgICB0aGlzLnJvb3QgPSBudWxsO1xuICAgICAgICB0aGlzLnBhdGggPSAnJztcbiAgICB9XG5cbiAgICBpc0NvbnRhaW5lcigpIHtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgbG9hZCgpIHtcbiAgICAgICAgdGhpcy56aXAgPSBuZXcgSlNaaXAoKTtcblxuICAgICAgICBpZiAodHlwZW9mIHRoaXMudXJsID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgcmV0dXJuIFV0aWxzLmlvKHRoaXMudXJsLCA2MDAwMCwgJ2FycmF5YnVmZmVyJylcbiAgICAgICAgICAgICAgICAudGhlbihib2R5ID0+IHRoaXMuem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IE9iamVjdC5rZXlzKHRoaXMuZmlsZXMpXG4gICAgICAgICAgICAuZmlsdGVyKHBhdGggPT4gdGhpcy5maWxlc1twYXRoXS5kZXB0aCA9PT0gMClcbiAgICAgICAgICAgIC5maWx0ZXIocGF0aCA9PiBVdGlscy5leHRlbnNpb25Gb3JVUkwocGF0aCkgPT09ICd5YW1sJyk7XG5cbiAgICAgICAgaWYgKHlhbWxzLmxlbmd0aCA9PT0gMSkge1xuICAgICAgICAgICAgdGhpcy5yb290ID0geWFtbHNbMF07XG4gICAgICAgIH1cblxuICAgICAgICAvLyBObyByb290IGZvdW5kXG4gICAgICAgIGlmICghdGhpcy5yb290KSB7XG4gICAgICAgICAgICBsZXQgbXNnID0gYENvdWxkIG5vdCBmaW5kIHJvb3Qgc2NlbmUgZm9yIGJ1bmRsZSAnJHt0aGlzLnVybH0nOiBgO1xuICAgICAgICAgICAgbXNnICs9IGBUaGUgemlwIGFyY2hpdmUncyByb290IGxldmVsIG11c3QgY29udGFpbiBhIHNpbmdsZSBzY2VuZSBmaWxlIHdpdGggdGhlICcueWFtbCcgZXh0ZW5zaW9uLiBgO1xuICAgICAgICAgICAgaWYgKHlhbWxzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICBtc2cgKz0gYEZvdW5kIG11bHRpcGxlIFlBTUwgZmlsZXMgYXQgdGhlIHJvb3QgbGV2ZWw6ICR7eWFtbHMubWFwKHIgPT4gJ1xcJycgKyByICsgJ1xcJycgKS5qb2luKCcsICcpfS5gO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgbXNnICs9IGBGb3VuZCBOTyBZQU1MIGZpbGVzIGF0IHRoZSByb290IGxldmVsLmA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZWplY3QoRXJyb3IobXNnKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZSgpO1xuICAgIH1cblxuICAgIHBhcnNlWmlwRmlsZXMoKSB7XG4gICAgICAgIGxldCBwYXRocyA9IFtdO1xuICAgICAgICBsZXQgcXVldWUgPSBbXTtcbiAgICAgICAgdGhpcy56aXAuZm9yRWFjaCgocGF0aCwgZmlsZSkgPT4ge1xuICAgICAgICAgICAgaWYgKCFmaWxlLmRpcikge1xuICAgICAgICAgICAgICAgIHBhdGhzLnB1c2gocGF0aCk7XG4gICAgICAgICAgICAgICAgcXVldWUucHVzaChmaWxlLmFzeW5jKCdhcnJheWJ1ZmZlcicpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgcmV0dXJuIFByb21pc2UuYWxsKHF1ZXVlKS50aGVuKGRhdGEgPT4ge1xuICAgICAgICAgICAgZm9yIChsZXQgaT0wOyBpIDwgZGF0YS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBwYXRoID0gcGF0aHNbaV07XG4gICAgICAgICAgICAgICAgbGV0IGRlcHRoID0gcGF0aC5zcGxpdCgnLycpLmxlbmd0aCAtIDE7XG4gICAgICAgICAgICAgICAgdGhpcy5maWxlc1twYXRoXSA9IHtcbiAgICAgICAgICAgICAgICAgICAgZGF0YTogZGF0YVtpXSxcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogVXRpbHMuZXh0ZW5zaW9uRm9yVVJMKHBhdGgpLFxuICAgICAgICAgICAgICAgICAgICBkZXB0aFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHVybEZvclppcEZpbGUoZmlsZSkge1xuICAgICAgICBpZiAodGhpcy5maWxlc1tmaWxlXSkge1xuICAgICAgICAgICAgaWYgKCF0aGlzLmZpbGVzW2ZpbGVdLnVybCkge1xuICAgICAgICAgICAgICAgIHRoaXMuZmlsZXNbZmlsZV0udXJsID0gVXRpbHMuY3JlYXRlT2JqZWN0VVJMKG5ldyBCbG9iKFt0aGlzL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vbnMgZnJvbSBVUkwgJiBwcm9wcm9jZXNzXG4gICAgbG9hZFNjZW5lKHVybCwgcGF0aCA9IG51bGwpIHtcbiAgICAgICAgbGV0IGVycm9ycyA9IFtdO1xuICAgICAgICByZXR1cm4gdGhpcy5sb2FkU2NlbmVSZWN1cnNpdmUoeyB1cmwsIHBhdGggfSwgbnVsbCwgZXJyb3JzKS5cbiAgICAgICAgICAgIHRoZW4oY29uZmlnID0+IHRoaXMuZmluYWxpemUoY29uZmlnKSkuXG4gICAgICAgICAgICB0aGVuKGNvbmZpZyA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCFjb25maWcpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gcm9vdCBzY2VuZSBmYWlsZWQgdG8gbG9hZCwgcmVqZWN0IHdpdGggZmlyc3QgZXJyb3JcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVqZWN0KGVycm9yc1swXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGVycm9ycy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIHNjZW5lIGxvYWRlZCwgYnV0IHNvbWUgaW1wb3J0cyBoYWQgZXJyb3JzXG4gICAgICAgICAgICAgICAgICAgIGVycm9ycy5mb3JFYWNoKGVycm9yID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gYEZhaWxlZCB0byBpbXBvcnQgc2NlbmU6ICR7ZXJyb3IudXJsfWA7XG4gICAgICAgICAgICAgICAgICAgICAgICBsb2coJ2Vycm9yJywgbWVzc2FnZSwgZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy50cmlnZ2VyKCdlcnJvcicsIHsgdHlwZTogJ3NjZW5lX2ltcG9ydCcsIG1lc3NhZ2UsIGVycm9yLCB1cmw6IGVycm9yLnVybCB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAg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gICB9XG5cbiAgICAgICAgICAgIGlmICghQXJyYXkuaXNBcnJheShjb25maWcuaW1wb3J0KSkge1xuICAgICAgICAgICAgICAgIHRoaXMubm9ybWFsaXplKGNvbmZpZywgYnVuZGxlKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gY29uZmlnO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBDb2xsZWN0IFVSTHMgb2Ygc2NlbmVzIHRvIGltcG9ydFxuICAgICAgICAgICAgbGV0IGltcG9ydHMgPSBbXTtcbiAgICAgICAgICAgIGZvciAobGV0IHVybCBvZiBjb25maWcuaW1wb3J0KSB7XG4gICAgICAgICAgICAgICAgaW1wb3J0cy5wdXNoKGJ1bmRsZS5yZXNvdXJjZUZvcih1cmwpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRlbGV0ZSBjb25maWcuaW1wb3J0OyAvLyBkb24ndCB3YW50IHRvIG1lcmdlIHRoaXMgcHJvcGVydHlcblxuICAgICAgICAgICAgcmV0dXJuIFByb21pc2UuXG4gICAgICAgICAgICBhbGwoaW1wb3J0cy5tYXAocmVzb3VyY2UgPT4gdGhpcy5sb2FkU2NlbmVSZWN1cnNpdmUocmVzb3VyY2UsIGJ1bmRsZSwgZXJyb3JzKSkpLlxuICAgICAgICAgICAgICAgIHRoZW4oY29uZmlncyA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZyA9IG1lcmdlT2JqZWN0cyh7fSwgLi4uY29uZmlncywgY29uZmlnKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5ub3JtYWxpemUoY29uZmlnLCBidW5kbGUpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29uZmlnO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICB9KS5jYXRjaChlcnJvciA9PiB7XG4gICAgICAgICAgICAvLyBDb2xsZWN0IHNjZW5lIGxvYWQgZXJyb3JzIGFzIHdlIGdvXG4gICAgICAgICAgICBlcnJvci51cmwg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HNcbiAgICBub3JtYWxpemVGb250cyhjb25maWcsIGJ1bmRsZSkge1xuICAgICAgICBjb25maWcuZm9udHMgPSBjb25maWcuZm9udHMgfHwge307XG5cbiAgICAgICAgZm9yIChsZXQgdmFsIG9mIFV0aWxzLnJlY3Vyc2VWYWx1ZXMoY29uZmlnLmZvbnRzKSkge1xuICAgICAgICAgICAgaWYgKHZhbC51cmwpIHtcbiAgICAgICAgICAgICAgICB2YWwudXJsID0gYnVuZGxlLnVybEZvcih2YWwudXJsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBjb25maWc7XG4gICAgfSxcblxuICAgIC8vIEV4cGFuZCBwYXRocyBhbmQgY2VudHJhbGl6ZSB0ZXh0dXJlIGRlZmluaXRpb25zIGZvciBhIHNjZW5lIG9iamVjdFxuICAgIG5vcm1hbGl6ZVRleHR1cmVzKGNvbmZpZywgYnVuZGxlKSB7XG4gICAgICAgIGNvbmZpZy50ZXh0dXJlcyA9IGNvbmZpZy50ZXh0dXJlcyB8fCB7fTtcblxuICAgICAgICAvLyBBZGQgY3VycmVudCBzY2VuZSdzIGJhc2UgcGF0aCB0byBnbG9iYWxseSBkZWZpbmVkIHRleHR1cmVzXG4gICAgICAgIC8vIE9ubHkgYWRkcyBwYXRoIGZvciB0ZXh0dXJlcyB3aXRoIHJlbGF0aXZlIFVSTHMsIHNvIHRleHR1cmVzIGluIGltcG9ydGVkIHNjZW5lcyBnZXQgdGhlIGJhc2VcbiAgICAgICAgLy8gcGF0aCBvZiB0aGVpciBpbW1lZGlhdGUgc2NlbmUgZmlsZVxuICAgICAgICBpZiAoY29uZmlnLnRleHR1cmVzKSB7XG4gICAgICAgICAgICBmb3IgKGxldCB0ZXh0dXJlIG9mIFV0aWxzLnZhbHVlcyhjb25maWcudGV4dHVyZXMpKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRleHR1cmUudXJsKSB7XG4gICAgICAgICAgICAgICAgICAgIHRleHR1cmUudXJs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2YgdGV4ID09PSAnc3RyaW5nJyAmJiAhY29uZmlnLnRleHR1cmVzW3RleF0pIHtcbiAgICAgICAgICAgICAgICAgICAgdGV4ID0gYnVuZGxlLnVybEZvcih0ZXgpO1xuICAgICAgICAgICAgICAgICAgICBjb25maWcudGV4dHVyZXNbdGV4XSA9IHsgdXJsOiB0ZXggfTtcbiAgICAgICAgICAgICAgICAgICAgc3R5bGUudGV4dHVyZSA9IHRleDtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBNYXRlcmlhbFxuICAgICAgICAgICAgICAgIGlmIChzdHlsZS5tYXRlcmlhbCkge1xuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBwcm9wIG9mIFsnZW1pc3Npb24nLCAnYW1iaWVudCcsICdkaWZmdXNlJywgJ3NwZWN1bGFyJywgJ25vcm1hbCddKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBNYXRlcmlhbCBwcm9wZXJ0eSBoYXMgYSB0ZXh0dXJlXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGV4ID0gc3R5bGUubWF0ZXJpYWxbcHJvcF0gIT0gbnVsbCAmJiBzdHlsZS5tYXRlcmlhbFtwcm9wXS50ZXh0dXJlO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB0ZXggPT09ICdzdHJpbmcnICYmICFjb25maWcudGV4dHVyZXNbdGV4XSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleCA9IGJ1bmRsZS51cmxGb3IodGV4KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcudGV4dHVyZXNbdGV4XSA9IHsgdXJsOiB0ZXggfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHlsZS5tYXRlcmlhbFtwcm9wXS50ZXh0dXJlID0gdGV4O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gU2hhZGVyIHVuaWZvcm1zXG4gICAgICAgICAgICAgICAgaWYgKHN0eWxlLnNoYWRlcnMgJiYgc3R5bGUuc2hhZGVycy51bmlmb3Jtcykge1xuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCB7dHlwZSwgdmFsdWUsIGtleSwgdW5pZm9ybXN9IG9mIEdMU0wucGFyc2VVbmlmb3JtcyhzdHlsZS5zaGFkZXJzLnVuaWZvcm1zKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGV4dHVyZSBieSBVUkwgKHN0cmluZy1uYW1lZCB0ZXh0dXJlIG5vdCByZWZlcmVuY2luZyBleGlzdGluZyB0ZXh0dXJlIGRlZmluaXRpb24pXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gJ3NhbXBsZXIyRCcgJiYgdHlwZW9mIHZhbHVlID09PSAnc3RyaW5nJyAmJiAhY29uZmlnLnRleHR1cmVzW3ZhbHVlXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ZXggPSBidW5kbGUudXJsRm9yKHZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcudGV4dHVyZXNbdGV4XSA9IHsgdXJsOiB0ZXggfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmlmb3Jtc1trZXldID0gdGV4O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gY29uZmlnO1xuICAgIH0sXG5cbiAgICAvLyBTdWJzdGl0dXRlcyBnbG9iYWwgc2NlbmUgcHJvcGVydGllcyAodGhvc2UgZGVmaW5lZCBpbiB0aGUgYGNvbmZpZy5nbG9iYWxgIG9iamVjdCkgZm9yIGFueSBzdHlsZSB2YWx1ZXNcbiAgICAvLyBvZi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ICAgICAgICAgICAgIGFwcGxpZWQucHVzaCh7IHByb3AsIHRhcmdldCwga2V5IH0pO1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIEFwcGx5IHByb3BlcnR5XG4gICAgICAgICAgICAgICAgICAgIG9iaiA9IHByb3BzW3Byb3BdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIExvb3AgdGhyb3VnaCBvYmplY3QgcHJvcGVydGllc1xuICAgICAgICAgICAgZWxzZSBpZiAodHlwZW9mIG9iaiA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBwIGluIG9iaikge1xuICAgICAgICAgICAgICAgICAgICBvYmpbcF0gPSBhcHBseVByb3BzKG9ialtwXSwgb2JqLCBwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gb2JqO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGFwcGx5UHJvcHMoY29uZmlnKTtcbiAgICB9LFxuXG4gICAgLy8gTm9ybWFsaXplIHNvbWUgc2NlbmUtd2lkZSBzZXR0aW5ncyB0aGF0IGFwcGx5IHRvIHRoZSBmaW5hbCwgbWVyZ2VkIHNjZW5lXG4gICAgZmluYWxpemUoY29uZmlnKSB7XG4gICAgICAgIGlmICghY29uZmlnKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICAvLyBFbnN1cmUgdG9wLWxldmVsIHByb3BlcnRpZXNcbiAgICAgICAgY29uZmlnLnNjZW5lID0gY29uZmlnLnNjZW5lIHx8IHt9O1xuICAgICAgICBjb25maWcuY2FtZXJhcyA9IGNvbmZpZy5jYW1lcmFzIHx8IHt9O1xuICAgICAgICBjb25maWcubGlnaHRzID0gY29uZmlnLmxpZ2h0cyB8fCB7fTtcbiAgICAgICAgY29uZmlnLnN0eWxlcyA9IGNvbmZpZy5zdHlsZXMgfHwge307XG4gICAgICAgIGNvbmZpZy5sYXllcnMgPSBjb25maWcubGF5ZXJzIHx8IHt9O1xuXG4gICAgICAgIC8vIEFzc2lnbiBpZHMgdG8gZGF0YSBzb3VyY2VzXG4gICAgICAgIGxldCBzb3VyY2VfaWQgPSAwO1xuICAgICAgICBmb3IgKGxldCBzb3VyY2UgaW4gY29uZmlnLnNvdXJjZXMpIHtcbiAgICAgICAgICAgIGNvbmZpZy5zb3VyY2VzW3NvdXJjZV0uaWQgPSBzb3VyY2VfaWQrKztcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIElmIG9ubHkgb25lIGNhbWVyYSBzcGVjaWZpZWQsIHNldCBpdCBhcyBkZWZhdWx0XG4gICAgICAgIGlmIChjb25maWcuY2FtZXJhKSB7XG4gICAgICAgICAgICBjb25maWcuY2FtZXJhcy5kZWZhdWx0ID0gY29uZmlnLmNhbWVyYTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIElmIG5vIGNhbWVyYXMgc3BlY2lmaWVkLCBjcmVhdGUgb25lXG4gICAgICAgIGlmIChPYmplY3Qua2V5cyhjb25maWcuY2FtZXJhcykubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICBjb25maWcuY2FtZXJhcy5kZWZhdWx0ID0ge307XG4gICAgICAgIH1cblxuICAgICAgICAvLyBJZiBubyBsaWdodHMgc3BlY2lmaWVkLCBjcmVhdGUgZGVmYXVsdFxuICAgICAgICBpZiAoT2JqZWN0LmtleXMoY29uZmlnLmxpZ2h0cykubGVuZ3RoID09PSAwIHx8XG4gICAgICAgICAgICBPYmplY3Qua2V5cyhjb25maWcubGlnaHRzKS5ldmVyeShpID0+IGNvbmZpZy5saWdodHNbaV0udmlzaWJsZSA9PT0gZmFsc2UpKSB7XG4gICAgICAgICAgICBjb25maWcubGlnaHRzLmRlZmF1bHRfbGlnaHQgPSB7XG4gICAgICAgICAgICAgICAgdHlwZTogJ2RpcmVjdGlvbmFsJ1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxu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25hbWV9KSwgc2VsZi5zb3VyY2VzLnRpbGVzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhdGNoKGUpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCFzb3VyY2UpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHNvdXJjZS50aWxlZCkge1xuICAgICAgICAgICAgICAgIHNlbGYuc291cmNlcy50aWxlc1tuYW1lXSA9IHNvdXJjZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIERpc3RyaWJ1dGUgb2JqZWN0IHNvdXJjZXMgYWNyb3NzIHdvcmtlcnNcbiAgICAgICAgICAgICAgICBpZiAoc291cmNlLmlkICUgc2VsZi5udW1fd29ya2VycyA9PT0gc2VsZi5fd29ya2VyX2lkKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIExvYWQgc291cmNlIGlmIG5vdCBjYWNoZWRcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5zb3VyY2VzLm9iamVjdHNbbmFtZV0gPSBzb3VyY2U7XG4gICAgICAgICAgICAgICAgICAgIGlmICghc2VsZi5vYmplY3RzW3NvdXJjZS5uYW1lXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5vYmplY3RzW3NvdXJjZS5uYW1lXSA9IHt9O1xuICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlLmxvYWQoc2VsZi5vYmplY3RzW3NvdXJjZS5uYW1lXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBDbGVhciB0aWxlIGNhY2hlIGlmIGRhdGEgc291cmNlIGNvbmZpZyBjaGFuZ2VkXG4gICAgICAgIGlmICghc2VsZi5jb25maWcuc291cmNlcyB8fFxuICAgICAgICAgICAgIXNlbGYubGFzdF9jb25maWcuc291cmNlcyB8fFxuICAgICAgICAgICAgT2JqZWN0LmtleXMoc2VsZi5jb25maWcuc291cmNlcykuc29tZShzID0+IHtcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoc2VsZi5jb25maWcuc291cmNlc1tzXSkgIT09IEpTT04uc3RyaW5naWZ5KHNlbGYubGFzdF9jb25maWcuc291cmNlc1tzXSk7XG4gICAgICAgICAgICB9KSkge1xuICAgICAgICAgICAgc2VsZi50aWxlcyA9IHt9O1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIC8vIFJldHVybnMgYSBwcm9taXNlIHRoYXQgZnVsZmlsbHMgd2hlbiBjb25maWcgcmVmcmVzaCBpcyBmaW5pc2hlZFxuICAgIGF3YWl0Q29uZmlndXJhdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiBzZWxmLmNvbmZpZ3VyaW5nO1xuICAgIH0sXG5cbiAgICAvLyBCdWlsZCBhIHRpbGU6IGxvYWQgZnJvbSB0aWxlIHNvdXJjZSBpZiBidWlsZGluZyBmb3IgZmlyc3QgdGltZSwgb3RoZXJ3aXNlIHJlYnVpbGQgd2l0aCBleGlzdGluZyBkYXRhXG4gICAgYnVpbGRUaWxlICh7IHRpbGUgfSkge1xuICAgICAgICAvLyBUaWxlIGNhY2hlZD9cbiAgICAgICAgaWYgKHNlbGYuZ2V0VGlsZSh0aWxlLmtleSkgIT0gbnVsbCkge1xuICAgICAgICAgICAgLy8gQWxyZWFkeSBsb2FkaW5nP1xuICAgICAgICAgICAgaWYgKHNlbGYuZ2V0VGlsZSh0aWxlLmtleSkubG9hZGluZyA9PT0gdHJ1ZSkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFVwZGF0ZSB0aWxlIGNhY2hlXG4gICAgICAgIHRpbGUgPSBzZWxmLnRpbGVzW3RpbGUua2V5XSA9IE9iamVjdC5hc3NpZ24oc2VsZi5nZXRUaWxlKHRpbGUua2V5KSB8fCB7fSwgdGlsZSk7XG5cbiAgICAgICAgLy8gVXBkYXRlIGNvbmZpZyAoc3R5bGVzLCBldGMuKSwgdGhlbiBidWlsZCB0aWxlXG4gICAgICAgIHJldHVybiBzZWxmLmF3YWl0Q29uZmlndXJhdGlvbigpLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgLy8gRmlyc3QgdGltZSBidWlsZGluZyB0aGUgdGlsZVxuICAgICAgICAgICAgaWYgKHRpbGUubG9hZGVkICE9PSB0cnVlKSB7XG5cbiAgICAgICAgICAgICAgICB0aWxlLmxvYWRpbmcgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHRpbGUubG9hZGVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgdGlsZS5lcnJvciA9IG51bGw7XG5cbiAgICAgICAgICAgICAgICBzZWxmLmxvYWRUaWxlU291cmNlRGF0YSh0aWxlKS50aGVuKCgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzZWxmLmdldFRpbGUodGlsZS5rZXkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsb2coJ3RyYWNlJywgYHN0b3AgdGlsZSBidWlsZCBhZnRlciBkYXRhIHNvdXJjZSBsb2FkIGJlY2F1c2UgdGlsZSB3YXMgcmVtb3ZlZDogJHt0aWxlLmtleX1gKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIC8vIFdhcm4gYW5kIGNvbnRpbnVlIG9uIGRhdGEgc291cmNlIGVycm9yXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aWxlLnNvdXJjZV9kYXRhLmVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsb2coJ3dhcm4nLCBgdGlsZSBsb2FkIGVycm9yKHMpIGZvciAke3RpbGUua2V5fTogJHt0aWxlLnNvdXJjZV9kYXRhLmVycm9yLnN0YWNrfWApO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgdGlsZS5sb2FkaW5nID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIHRpbGUubG9hZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgVGlsZS5idWlsZEdlb21ldHJ5KHRpbGUsIHNlbGYpO1xuICAgICAgICAgICAgICAgIH0pLmNhdGNoKChlcnJvcikgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0aWxlLmxvYWRpbmcgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgdGlsZS5sb2FkZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgdGlsZS5lcnJvciA9IGVycm9yLnN0YWNrO1xuICAgICAgICAgICAgICAgICAgICBsb2coJ2Vycm9yJywgYHRpbGUgbG9hZCBlcnJvciBmb3IgJHt0aWxlLmtleX06ICR7dGlsZS5lcnJvcn1gKTtcblxuICAgICAgICAgICAgICAgICAgICAvLyBTZW5kIGVycm9yIHRvIG1haW4gdGhyZWFkXG4gICAgICAgICAgICAgICAgICAgIFdvcmtlckJyb2tlci5wb3N0TWVzc2FnZShgVGlsZU1hbmFnZXJfJHtzZWxmLnNjZW5lX2lkfS5idWlsZFRpbGVFcnJvcmAsIFRpbGUuc2xpY2UodGlsZSkpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gVGlsZSBhbHJlYWR5IGxvYWRlZCwganVzdCByZWJ1aWxkXG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBsb2coJ3RyYWNlJywgYHVzZWQgd29ya2VyIGNhY2hlIGZvciB0aWxlICR7dGlsZS5rZXl9YCk7XG5cbiAgICAgICAgICAgICAgICAvLyBCdWlsZCBnZW9tZXRyeVxuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIFRpbGUuYnVpbGRHZW9tZXRyeSh0aWxlLCBzZWxmKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY2F0Y2goZXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gU2VuZCBlcnJvciB0byBtYWluIHRocmVhZFxuICAgICAgICAgICAgICAgICAgICB0aWxlLmVycm9yID0gZXJyb3IudG9TdHJpbmcoKTtcbiAgICAgICAgICAgICAgICAgICAgV29ya2VyQnJva2VyLnBvc3RNZXNzYWdlKGBUaWxlTWFuYWdlcl8ke3NlbGYuc2NlbmVfaWR9LmJ1aWxkVGlsZUVycm9yYCwgVGlsZS5zbGljZSh0aWxlKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9LFxuXG4gICAgLy8gTG9hZCB0aGlzIHRpbGUncyBkYXRhIHNvdXJjZVxuICAgIGxvYWRUaWxlU291cmNlRGF0YSAodGlsZSkge1xuICAgICAgICBpZiAoc2VsZi5zb3VyY2VzLnRpbGVzW3RpbGUuc291cmNlXSkge1xuICAgICAgICAgICAgcmV0dXJuIHNlbGYuc291cmNlcy50aWxlc1t0aWxlLnNvdXJjZV0ubG9hZCh0aWxlKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHRpbGUuc291cmNlX2RhdGEgPSB7IGVycm9yOiBgRGF0YSBzb3VyY2UgJyR7dGlsZS5zb3VyY2V9JyBub3QgZm91bmRgIH07XG4gICAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKHRpbGUpO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIGdldFRpbGUoa2V5KSB7XG4gICAgICAgIHJldHVybiBzZWxmLnRpbGVzW2tleV07XG4gICAgfSxcblxuICAgIC8vIFJlbW92ZSB0aWxlXG4gICAgcmVtb3ZlVGlsZSAoa2V5KSB7XG4gICAgICAgIHZhciB0aWxlID0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2FpdGluZyBpdHMgcmVwbHlcbiAgICAgICAgICAgICAgICBpZiAocmVxdWVzdC5zZW50KSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIFRPRE86IHN1cHBvcnQgb3RoZXIgc2VsZWN0aW9uIHR5cGVzLCBzdWNoIGFzIGZlYXR1cmVzIHdpdGhpbiBhIGJveFxuICAgICAgICAgICAgICAgIGlmIChyZXF1ZXN0LnR5cGUgIT09ICdwb2ludCcpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gQ2hlY2sgc2VsZWN0aW9uIG1hcCBhZ2FpbnN0IEZCT1xuICAgICAgICAgICAgICAgIGdsLnJlYWRQaXhlbHMoXG4gICAgICAgICAgICAgICAgICAgIE1hdGguZmxvb3IocmVxdWVzdC5wb2ludC54ICogdGhpcy5mYm9fc2l6ZS53aWR0aCksXG4gICAgICAgICAgICAgICAgICAgIE1hdGguZmxvb3IoKDEgLSByZXF1ZXN0LnBvaW50LnkpICogdGhpcy5mYm9fc2l6ZS5oZWlnaHQpLFxuICAgICAgICAgICAgICAgICAgICAxLCAxLCBnbC5SR0JBLCBnbC5VTlNJR05FRF9CWVRFLCB0aGlzLnBpeGVsKTtcbiAgICAgICAgICAgICAgICB2YXIgZmVhdHVyZV9rZXkgPSAodGhpcy5waXhlbFswXSArICh0aGlzLnBpeGVsWzFdIDw8IDgpICsgKHRoaXMucGl4ZWxbMl0gPDwgMTYpICsgKHRoaXMucGl4ZWxbM10gPDwgMjQpKSA+Pj4gMDtcblxuICAgICAgICAgICAgICAgIC8vIElmIGZlYXR1cmUgZm91bmQsIGFzayBhcHByb3ByaWF0ZSB3ZWIgd29ya2VyIHRvIGxvb2t1cCBmZWF0dXJlXG4gICAgICAgICAgICAgICAgdmFyIHdvcmtlcl9pZCA9IHRoaXMucGl4ZWxbM107XG4gICAgICAgICAgICAgICAgaWYgKHdvcmtlcl9pZCAhPT0gMjU1KSB7IC8vIDI1NSBpbmRpY2F0ZXMgYW4gZW1wdHkgc2VsZWN0aW9uIGJ1ZmZlciBwaXhlbFxuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy53b3JrZXJzW3dvcmtlcl9pZF0gIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgV29ya2VyQnJva2VyLnBvc3RNZXNzYWdlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMud29ya2Vyc1t3b3JrZXJfaWRdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdzZWxmLmdldEZlYXR1cmVTZWxlY3Rpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgaWQ6IHJlcXVlc3QuaWQsIGtleTogZmVhdHVyZV9rZXkgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgIC50aGVuKG1lc3NhZ2UgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZmluaXNoUmVhZChtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIE5vIGZlYXR1cmUgZm91bmQsIGJ1dCBzdGlsbCBuZWVkIHRvIHJlc29sdmUgcHJvbWlzZVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmZpbmlzaFJlYWQoeyBpZDogcmVxdWVzdC5pZCwgZmVhdHVyZTogbnVsbCB9KTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICByZXF1ZXN0LnNlbnQgPSB0cnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBnbC5iaW5kRnJhbWVidWZmZXIoZ2wuRlJBTUVCVUZGRVIsIG51bGwpO1xuXG4gICAgICAgIH0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KSAmIDI1NTtcbiAgICAgICAgdmFyIGliID0gKHRoaXMubWFwX2VudHJ5ID4+IDE2KSAmIDI1NTtcbiAgICAgICAgdmFyIGlhID0gdGhpcy5tYXBfcHJlZml4O1xuICAgICAgICB2YXIgciA9IGlyIC8gMjU1O1xuICAgICAgICB2YXIgZyA9IGlnIC8gMjU1O1xuICAgICAgICB2YXIgYiA9IGliIC8gMjU1O1xuICAgICAgICB2YXIgYSA9IGlhIC8gMjU1O1xuICAgICAgICB2YXIga2V5ID0gKGlyICsgKGlnIDw8IDgpICsgKGliIDw8IDE2KSArIChpYSA8PCAyNCkpID4+PiAwOyAvLyBuZWVkIHVuc2lnbmVkIHJpZ2h0IHNoaWZ0IHRvIGNvbnZlcnQgdG8gcG9zaXRpdmUgI1xuXG4gICAgICAgIHRoaXMubWFwW2tleV0gPSB7XG4gICAgICAgICAgICBjb2xvcjogW3IsIGcsIGIsIGFdLFxuICAgICAgICB9O1xuICAgICAgICB0aGlzLm1hcF9zaXplKys7XG5cbiAgICAgICAgLy8gSW5pdGlhbGl6ZSB0aWxlLXNwZWNpZmljIHRyYWNraW5nIGluZm9cbiAgICAgICAgaWYgKCF0aGlzLnRpbGVzW3RpbGUua2V5XSkge1xuICAgICAgICAgICAgdGhpcy50aWxlc1t0aWxlLmtleV0gPSB7XG4gICAgICAgICAgICAgICAgZW50cmllczogW10sICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2V0IG9mIGZlYXR1cmUgZW50cmllcyBpbiB0aGlzIHRocmVhZFxuICAgICAgICAgICAgICAgIHRpbGU6IHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN1YnNldCBvZiB0aWxlIHByb3BlcnRpZXMgdG8gcGFzcyBiYWNrIHdpdGggZmVhdHVyZVxuICAgICAgICAgICAgICAgICAgICBrZXk6IHRpbGUua2V5LFxuICAgICAgICAgICAgICAgICAgICBjb29yZHM6IHRpbGUuY29vcmRzLFxuICAgICAgICAgICAgICAgICAgICBzdHlsZV96b29tOiB0aWxlLnN0eWxlX3pvb20sXG4gICAgICAgICAgICAgICAgICAgIHNvdXJjZTogdGlsZS5zb3VyY2UsXG4gICAgICAgICAgICAgICAgICAgIGdlbmVyYXRpb246IHRpbGUuZ2VuZXJhdGlvblxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnRpbGVzW3RpbGUua2V5XS5lbnRyaWVzLnB1c2goa2V5KTtcblxuICAgICAgICByZXR1cm4gdGhpcy5tYXBba2V5XTtcbiAgICB9XG5cbiAgICBzdGF0aWMgbWFrZUNvbG9yKGZlYXR1cmUsIHRpbGUsIGNvbnRleHQpIHtcbiAgICAgICAgdmFyIHNlbGVjdG9yID0gdGhpcy5tYWtlRW50cnkodGlsZSk7XG4gICAgICAgIHNlbGVjdG9yLmZlYXR1cmUgPSB7XG4gICAgICAgICAgICBpZDogZmVhdHVyZS5pZCxcbiAgICAgICAgICAgIHByb3BlcnRpZXM6IGZlYXR1cmUucHJvcGVydGllcyxcbiAgICAgICAgICAgIHNvdXJjZV9uYW1lOiBjb250ZXh0LnNvdXJjZSxcbiAgICAgICAgICAgIHNvdXJjZV9sYXllcjogY29udGV4dC5sYXllcixcbiAgICAgICAgICAgIGxheWVyczogY29udGV4dC5sYXllcnMsXG4gICAgICAgICAgICB0aWxlOiB0aGlzLnRpbGVzW3RpbGUua2V5XS50aWxlXG4gICAgICAgIH07XG5cbiAgICAgICAgcmV0dXJuIHNlbGVjdG9yLmNvbG9yO1xuICAgIH1cblxuICAgIHN0YXRpYyByZXNldCgpIHtcbiAgICAgICAgdGhpcy50aWxlcyA9IHt9O1xuICAgICAgICB0aGlzLm1hcCA9IHt9O1xuICAgICAgICB0aGlzLm1hcF9zaXplID0gMDtcbiAgICAgICAgdGhpcy5tYXBfZW50cnkgPSAwO1xuICAgIH1cblxuICAgIHN0YXRpYyBjbGVhclRpbGUoa2V5KSB7XG4gICAgICAgIGlmICh0aGlzLnRpbG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ZXJzKSB7XG4gICAgICAgICAgICB2YXIgbnVtX2ZlYXR1cmVzID0gc291cmNlLmxheWVyc1t0XS5mZWF0dXJlcy5sZW5ndGg7XG4gICAgICAgICAgICBmb3IgKHZhciBmPTA7IGYgPCBudW1fZmVhdHVyZXM7IGYrKykge1xuICAgICAgICAgICAgICAgIHZhciBmZWF0dXJlID0gc291cmNlLmxheWVyc1t0XS5mZWF0dXJlc1tmXTtcbiAgICAgICAgICAgICAgICBHZW8udHJhbnNmb3JtR2VvbWV0cnkoZmVhdHVyZS5nZW9tZXRyeSwgY29vcmQgPT4ge1xuICAgICAgICAgICAgICAgICAgICB2YXIgW3gsIHldID0gR2VvLmxhdExuZ1RvTWV0ZXJzKGNvb3JkKTtcbiAgICAgICAgICAgICAgICAgICAgY29vcmRbMF0gPSB4O1xuICAgICAgICAgICAgICAgICAgICBjb29yZFsxXSA9IHk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoc291cmNlLmRlYnVnICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIHNvdXJjZS5kZWJ1Zy5wcm9qZWN0aW9uID0gK25ldyBEYXRlKCkgLSB0aW1lcjtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8qKlxuICAgICBSZS1zY2FsZSBnZW9tZXRyaWVzIHdpdGhpbiBlYWNoIHNvdXJjZSB0byBpbnRlcm5hbCB0aWxlIHVuaXRzXG4gICAgKi9cbiAgICBzdGF0aWMgc2NhbGVEYXRhIChzb3VyY2UsIHtjb29yZHM6IHt6fSwgbWluLCBtYXh9KSB7XG4gICAgICAgIGxldCB1bml0c19wZXJfbWV0ZXIgPSBHZW8udW5pdHNQZXJNZXRlcih6KTtcbiAgICAgICAgZm9yICh2YXIgdCBpbiBzb3VyY2UubGF5ZXJzKSB7XG4gICAgICAgICAgICB2YXIgbnVtX2ZlYXR1cmVzID0gc291cmNlLmxheWVyc1t0XS5mZWF0dXJlcy5sZW5ndGg7XG4gICAgICAgICAgICBmb3IgKHZhciBmPTA7IGYgPCBudW1fZmVhdHVyZXM7IGYrKykge1xuICAgICAgICAgICAgICAgIHZhciBmZWF0dXJlID0gc291cmNlLmxheWVyc1t0XS5mZWF0dXJlc1tmXTtcbiAgICAgICAgICAgICAgICBHZW8udHJhbnNmb3JtR2VvbWV0cnkoZmVhdHVyZS5nZW9tZXRyeSwgY29vcmQgPT4ge1xuICAgICAgICAgICAgICAgICAgICBjb29yZFswXSA9IChjb29yZFswXSAtIG1pbi54KSAqIHVuaXRzX3Blcl9tZXRlcjtcbiAgICAgICAgICAgICAgICAgICAgY29vcmRbMV0gPSAoY29vcmRbMV0gLSBtaW4ueSkgKiB1bml0c19wZXJfbWV0ZXIgKiAtMTsgLy8gZmxpcCBjb29yZHMgcG9zaXRpdmVcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGxvYWQoZGVzdCkge1xuICAgICAgICBkZXN0LnNvdXJjZV9kYXRhID0ge307XG4gICAgICAgIGRlc3Quc291cmNlX2RhdGEubGF5ZXJzID0ge307XG4gICAgICAgIGRlc3QucGFkX3NjYWxlID0gdGhpcy5wYWRfc2NhbGU7XG4gICAgICAgIGRlc3QucmFzdGVycyA9IFsuLi50aGlzLnJhc3RlcnNdOyAvLyBjb3B5IGxpc3Qgb2YgcmFzdGVycyB0byBsb2FkIGZvciB0aWxlXG5cbiAgICAgICAgcmV0dXJuIHRoaXMuX2xvYWQoZGVzdCkudGhlbigoZGVzdCkgPT4ge1xuICAgICAgICAgICAgLy8gUG9zdC1wcm9jZXNzaW5nXG4gICAgICAgICAgICBmb3IgKGxldCBsYXllciBpbiBkZXN0LnNvdXJjZV9kYXRhLmxheWVycykge1xuICAgICAgICAgICAgICAgIGxldCBkYXRhID0gZGVzdC5zb3VyY2VfZGF0YS5sYXllcnNbbGF5ZXJdO1xuICAgICAgICAgICAgICAgIGlmIChkYXRhICYmIGRhdGEuZmVhdHVyZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5mZWF0dXJlcy5mb3JFYWNoKGZlYXR1cmUgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgR2VvLnRyYW5zZm9ybUdlb21ldHJ5KGZlYXR1cmUuZ2VvbWV0cnksIGNvb3JkID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBGbGlwIFkgY29vcmRzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29vcmRbMV0gPSAtY29vcmRbMV07XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBTbGlnaHRseSBzY2FsZSB1cCB0aWxlIHRvIGNvdmVyIHNlYW1zXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMucGFkX3NjYWxlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvb3JkWzBdID0gTWF0aC5yb3VuZChjb29yZFswXSAqICgxICsgdGhpcy5wYWRfc2NhbGUpIC0gKEdlby50aWxlX3NjYWxlICogdGhpcy5wYWRfc2NhbGUvMikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb29yZFsxXSA9IE1hdGgucm91bmQoY29vcmRbMV0gKiAoMSArIHRoaXMucGFkX3NjYWxlKSAtIChHZW8udGlsZV9zY2FsZSAqIHRoaXMucGFkX3NjYWxlLzIpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gVXNlIGZpcnN0IGVuY291bnRlcmVkIHBvbHlnb24gd2luZGluZyBvcmRlciBhcyBkZWZhdWx0IGZvciBkYXRhIHNvdXJjZVxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy51cGRhdGVEZWZhdWx0V2luZGluZyhmZWF0dXJlLmdlb21ldHJ5KTtcbiAgICAgICAgICAgICAgICA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cbiAgICAgICAgICAgIHRoaXMuYm91bmRzX21ldGVycyA9IHtcbiAgICAgICAgICAgICAgICBtaW46IEdlby5sYXRMbmdUb01ldGVycyhbdywgbl0pLFxuICAgICAgICAgICAgICAgIG1heDogR2VvLmxhdExuZ1RvTWV0ZXJzKFtlLCBzXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgdGhpcy5ib3VuZHNfdGlsZXMgPSB7IG1pbjoge30sIG1heDoge30gfTsgLy8gbWF4IHRpbGUgYm91bmRzIHBlciB6b29tIChsYXppbHkgZXZhbHVhdGVkKVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gUmV0dXJucyBmYWxzZSBpZiB0aWxlIGlzIG91dHNpZGUgZGF0YSBzb3VyY2UncyBib3VuZHMsIHRydWUgaWYgd2l0aGluXG4gICAgY2hlY2tCb3VuZHMgKGNvb3Jkcykge1xuICAgICAgICAvLyBDaGVjayB0aWxlIGJvdW5kc1xuICAgICAgICBpZiAodGhpcy5ib3VuZHMpIHtcbiAgICAgICAgICAgIGNvb3JkcyA9IEdlby53cmFwVGlsZShjb29yZHMsIHsgeDogdHJ1ZSB9KTtcblxuICAgICAgICAgICAgbGV0IG1pbiA9IHRoaXMuYm91bmRzX3RpbGVzLm1pbltjb29yZHMuel07XG4gICAgICAgICAgICBpZiAoIW1pbikge1xuICAgICAgICAgICAgICAgIG1pbiA9IHRoaXMuYm91bmRzX3RpbGVzLm1pbltjb29yZHMuel0gPSBHZW8udGlsZUZvck1ldGVycyh0aGlzLmJvdW5kc19tZXRlcnMubWluLCBjb29yZHMueik7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGxldCBtYXggPSB0aGlzLmJvdW5kc190aWxlcy5tYXhbY29vcmRzLnpdO1xuICAgICAgICAgICAgaWYgKCFtYXgpIHtcbiAgICAgICAgICAgICAgICBtYXggPSB0aGlzLmJvdW5kc190aWxlcy5tYXhbY29vcmRzLnpdID0gR2VvLnRpbGVGb3JNZXRlcnModGhpcy5ib3VuZHNfbWV0ZXJzLm1heCwgY29vcmRzLnopO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoY29vcmRzLnggPCBtaW4ueCB8fCBjb29yZHMueCA+IG1heC54IHx8XG4gICAgICAgICAgICAgICAgY29vcmRzLnkgPCBtaW4ueSB8fCBjb29yZHMueSA+IG1heC55KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIGluY2x1ZGVzVGlsZSAoY29vcmRzLCBzdHlsZV96b29tKSB7XG4gICAgICAgIGlmICghc3VwZXIuaW5jbHVkZXNUaWxlKGNvb3Jkcywgc3R5bGVfem9vbSkpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIENoZWNrIHRpbGUgYm91bmRzXG4gICAgICAgIGlmICghdGhpcy5jaGVja0JvdW5kcyhjb29yZHMpKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgZm9ybWF0VXJsKHVybF90ZW1wbGF0ZSwgdGlsZSkge1xuICAgICAgICBsZXQgY29vcmRzID0gR2VvLndyYXBUaWxlKHRpbGUuY29vcmRzLCB7IHg6IHRydWUgfSk7XG5cbiAgICAgICAgaWYgKHRoaXMudG1zKSB7XG4gICAgICAgICAgICBjb29yZHMueSA9IE1hdGgucG93KDIsIGNvb3Jkcy56KSAtIDEgLSBjb29yZHMueTsgLy8gb3B0aW9uYWxseSBmbGlwIHRpbGUgY29vcmRzIGZvciBUTVNcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCB1cmwgPSB1cmxfdGVtcGxhdGUucmVwbGFjZSgne3h9JywgY29vcmRzLngpLnJlcGxhY2UoJ3t5fScsIGNvb3Jkcy55KS5yZXBsYW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UkwgJyR7dGhpcy51cmx9JzogJHtkYXRhLnNvdXJjZV9kYXRhLmVycm9yfWApO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGxldCBsYXllcnMgPSBkYXRhLnNvdXJjZV9kYXRhLmxheWVycztcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBsYXllcl9uYW1lIGluIGxheWVycykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnRpbGVfaW5kZXhlc1tsYXllcl9uYW1lXSA9IGdlb2pzb252dChsYXllcnNbbGF5ZXJfbmFtZV0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1heFpvb206IHRoaXMubWF4X3pvb20sICAvLyBtYXggem9vbSB0byBwcmVzZXJ2ZSBkZXRhaWwgb25cbiAgICAgICAgICAgICAgICAgICAgICAgIHRvbGVyYW5jZTogMywgLy8gc2ltcGxpZmljYXRpb24gdG9sZXJhbmNlIChoaWdoZXIgbWVhbnMgc2ltcGxlcilcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dGVudDogR2VvLnRpbGVfc2NhbGUsIC8vIHRpbGUgZXh0ZW50IChib3RoIHdpZHRoIGFuZCBoZWlnaHQpXG4gICAgICAgICAgICAgICAgICAgICAgICBidWZmZXI6IDAuMDAwMSAgICAgLy8gdGlsZSBidWZmZXIgb24gZWFjaCBzaWRlXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRoaXMubG9hZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZGF0YTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRoaXMubG9hZF9kYXRhLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgZm9yIChsZXQgbGF5ZXJfbmFtZSBpbiB0aGlzLnRpbGVfaW5kZXhlcykge1xuICAgICAgICAgICAgICAgIGRlc3Quc291cmNlX2RhdGEubGF5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XG4gICAgICAgICAgICAgICAgaWYgKGZlYXR1cmUudHlwZSA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICBmLmdlb21ldHJ5LmNvb3JkaW5hdGVzID0gZmVhdHVyZS5nZW9tZXRyeS5tYXAoY29vcmQgPT4gW2Nvb3JkWzBdLCBjb29yZFsxXV0pO1xuICAgICAgICAgICAgICAgICAgICBmLmdlb21ldHJ5LnR5cGUgPSAnTXVsdGlQb2ludCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGZlYXR1cmUudHlwZSA9PT0gMiB8fCBmZWF0dXJlLnR5cGUgPT09IDMpIHtcbiAgICAgICAgICAgICAgICAgICAgZi5nZW9tZXRyeS5jb29yZGluYXRlcyA9IGZlYXR1cmUuZ2VvbWV0cnkubWFwKHJpbmcgPT5cbiAgICAgICAgICAgICAgICAgICAgICAgIHJpbmcubWFwKGNvb3JkID0+IFtjb29yZFswXSwgY29vcmRbMV1dKVxuICAgICAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmIChmZWF0dXJlLnR5cGUgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGYuZ2VvbWV0cnkudHlwZSA9ICdNdWx0aUxpbmVTdHJpbmcnO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2UgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGYuZ2VvbWV0cnkgPSBkZWNvZGVNdWx0aVBvbHlnb24oZi5nZW9tZXRyeSk7IC8vIHVuLWZsYXR0ZW4gcmluZ3NcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmLmdlb21ldHJ5ID09IG51bGwpIHsgLy8gc2tpcCBwb2x5cyB0aGF0IGNvdWxkbid0IGJlIGRlY29kZWQgKGUuZy4gZGVnZW5lcmF0ZSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgY29sbGVjdGlvbi5mZWF0dXJlcy5wdXNoKGYpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGNvbGxlY3Rpb247XG4gICAgfVxuXG4gICAgZm9ybWF0VXJsIChkZXN0KSB7XG4gICAgICAgIHJldHVybiB0aGlzLnVybDtcbiAgICB9XG5cbiAgICBwYXJzZVNvdXJjZURhdGEgKHRpbGUsIHNvdXJjZSwgcmVzcG9uc2UpIHtcbiAgICAgICAgbGV0IHBhcnNlZF9yZXNwb25zZSA9IEpTT04ucGFyc2UocmVzcG9uc2UpO1xuICAgICAgICBsZXQgbGF5ZXJzID0gdGhpcy5nZXRMYXllcnMocGFyc2VkX3Jlc3BvbnNlKTtcbiAgICAgICAgdGhpcy5wcmVwcm9jZXNzTGF5ZXJzKGxheWVycyk7XG4gICAgICAgIHNvdXJjZS5sYXllcnMgPSBsYXllcnM7XG4gICAgfVxuXG4gICAgcHJlcHJvY2Vzc0xheWVycyAobGF5ZXJzKXtcbiAgICAgICAgZm9yIChsZXQga2V5IGluIGxheWVycykge1xuICAgICAgICAgICAgbGV0IGxheWVyID0gbGF5ZXJzW2tleV07XG4gICAgICAgICAgICB0aGlzLnByZXByb2Nlc3NGZWF0dXJlcyhsYXllci5mZWF0dXJlcyk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBQcmVwcm9jZXNzIGZlYXR1cmVzLiBDdXJyZW50bHkgdXNlZCB0byBhZGQgYSBuZXcgXCJjZW50cm9pZFwiIGZlYXR1cmUgZm9yIHBvbHlnb24gbGFiZWxpbmdcbiAgICBwcmVwcm9jZXNzRmVhdHVyZXMgKGZlYXR1cmVzKSB7XG4gICAgICAgIC8vIERlZmluZSBjZW50cm9pZHMgZm9yIHBvbHlnb25zIGZvciBjZW50cm9pZCBsYWJlbCBwbGFjZW1lbnRcbiAgICAgICAgLy8gQXZvaWRzIHJlZHVuZGFudCBsYWJlbCBwbGFjZW1lbnQgZm9yIGVhY2ggZ2VuZXJhdGVkIHRpbGUgYXQgaGlnaGVyIHpvb20gbGV2ZWxzXG4gICAgICAgIGlmICh0aGlzLmNvbmZpZy5nZW5lcmF0ZV9sYWJlbF9jZW50cm9pZHMpe1xuICAgICAgICAgICAgbGV0IGZlYXR1cmVzX2NlbnRyb2lkID0gW107XG4gICAgICAgICAgICBsZXQgY2VudHJvaWRfcHJvcGVydGllcyA9IHtcImxhYmVsX3BsYWNlbWVudFwiIDogdHJ1ZX07XG5cbiAgICAgICAgICAgIGZlYXR1cmVzLmZvckVhY2goZmVhdHVyZSA9PiB7XG4gICAgICAgICAgICAgICAgbGV0IGNvb3JkaW5hdGVzLCBjZW50cm9pZF9mZWF0dXJlO1xuICAgICAgICAgICAgICAgIHN3aXRjaCAoZmVhdHVyZS5nZW9tZXRyeS50eXBlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ1BvbHlnb24nOlxuICAgICAgICAgICAgICAgICAgICAgICAgY29vcmRpbmF0ZXMgPSBmZWF0dXJlLmdlb21ldHJ5LmNvb3JkaW5hdGVzO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2VudHJvaWRfZmVhdHVyZSA9IGdldENlbnRyb2lkRmVhdHVyZUZvclBvbHlnb24oY29vcmRpbmF0ZXMsIGZlYXR1cmUucHJvcGVydGllcywgY2VudHJvaWRfcHJvcGVydGllcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBmZWF0dXJlc19jZW50cm9pZC5wdXNoKGNlbnRyb2lkX2ZlYXR1cmUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ011bHRpUG9seWdvbic6XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBBZGQgY2VudHJvaWQgZmVhdHVyZSBmb3IgbGFyZ2VzdCBwb2x5Z29uXG4gICAgICAgICAgICAgICAgICAgICAgICBjb29yZGluYXRlcyA9IGZlYXR1cmUuZ2VvbWV0cnkuY29vcmRpbmF0ZXM7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbWF4X2FyZWEgPSAtSW5maW5pdHk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbWF4X2FyZWFfaW5kZXggPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaW5kZXggPSAwOyBpbmRleCA8IGNvb3JkaW5hdGVzLmxlbmd0aDsgaW5kZXgrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhcmVhID0gR2VvLnBvbHlnb25BcmVhKGNvb3JkaW5hdGVzW2luZGV4XSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFyZWEgPiBtYXhfYXJlYSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhfYXJlYSA9IGFyZWE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heF9hcmVhX2luZGV4ID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY2VudHJvaWRfZmVhdHVyZSA9IGdldENlbnRyb2lkRmVhdHVyZUZvclBvbHlnb24oY29vcmRpbmF0ZXNbbWF4X2FyZWFfaW5kZXhdLCBmZWF0dXJlLnByb3BlcnRpZXMsIGNlbnRyb2lkX3Byb3BlcnRpZXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZmVhdHVyZXNfY2VudHJvaWQucHVzaChjZW50cm9pZF9mZWF0dXJlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1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mPTA7IGYgPCBsYXllci5sZW5ndGg7IGYrKykge1xuICAgICAgICAgICAgICAgIHZhciBmZWF0dXJlID0gbGF5ZXIuZmVhdHVyZShmKTtcbiAgICAgICAgICAgICAgICB2YXIgZmVhdHVyZV9nZW9qc29uID0ge1xuICAgICAgICAgICAgICAgICAgICB0eXBlOiAnRmVhdHVyZScsXG4gICAgICAgICAgICAgICAgICAgIGdlb21ldHJ5OiB7fSxcbiAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllczogZmVhdHVyZS5wcm9wZXJ0aWVzXG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIHZhciBnZW9tZXRyeSA9IGZlYXR1cmVfZ2VvanNvbi5nZW9tZXRyeTtcbiAgICAgICAgICAgICAgICB2YXIgY29vcmRpbmF0ZXMgPSBmZWF0dXJlLmxvYWRHZW9tZXRyeSgpO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIHI9MDsgciA8IGNvb3JkaW5hdGVzLmxlbmd0aDsgcisrKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciByaW5nID0gY29vcmRpbmF0ZXNbcl07XG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGM9MDsgYyA8IHJpbmcubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJpbmdbY10gPSBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmluZ1tjXS54LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJpbmdbY10ueVxuICAgICAgICAgICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBnZW9tZXRyeS5jb29yZGluYXRlcyA9IGNvb3JkaW5hdGVzO1xuXG4gICAgICAgICAgICAgICAgaWYgKFZlY3RvclRpbGVGZWF0dXJlLnR5cGVzW2ZlYXR1cmUudHlwZV0gPT09ICdQb2ludCcpIHtcbiAgICAgICAgICAgICAgICAgICAgZ2VvbWV0cnkudHlwZSA9ICdQb2ludCc7XG4gICAgICAgICAgICAgICAgICAgIGdlb21ldHJ5LmNvb3JkaW5hdGVzID0gZ2VvbWV0cnkuY29vcmRpbmF0ZXNbMF1bMF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKFZlY3RvclRpbGVGZWF0dXJlLnR5cGVzW2ZlYXR1cmUudHlwZV0gPT09ICdMaW5lU3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoY29vcmRpbmF0ZXMubGVuZ3RoID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBnZW9tZXRyeS50eXBlID0gJ0xpbmVTdHJpbmcnO1xuICAgICAgICAgICAgICAgICAgICAgICAgZ2VvbWV0cnkuY29vcmRpbmF0ZXMgPSBnZW9tZXRyeS5jb29yZGluYXRlc1swXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGdlb21ldHJ5LnR5cGUgPSAnTXVsdGlMaW5lU3RyaW5nJztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChWZWN0b3JUaWxlRmVhdHVyZS50eXBlc1tmZWF0dXJlLnR5cGVdID09PSAnUG9seWdvbicpIHtcbiAgICAgICAgICAgICAgICAgICAgZ2VvbWV0cnkgPSBkZWNvZGVNdWx0aVBvbHlnb24oZ2VvbWV0cnkpOyAvLyB1bi1mbGF0dGVuIHJpbmdzXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgbGF5ZXJfZ2VvanNvbi5mZWF0dXJlcy5wdXNoKGZlYXR1cmVfZ2VvanNvbik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsYXllcnNbbF0gPSBsYXllcl9nZW9qc29uO1xuICAgICAgICB9XG4gICAgICAgI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yeToge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ1BvbHlnb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29vcmRpbmF0ZXM6IFtbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDBdLCBbc2NhbGUsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFtzY2FsZSwgLXNjYWxlXSwgWzAsIC1zY2FsZV0sIFswLCAwXVxuICAgICAgICAgICAgICAgICAgICAgICAgXV1cbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllczoge31cbiAgICAgICAgICAgICAgICB9XVxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIHRpbGUuZGVmYXVsdF93aW5kaW5nID0gJ0NXJztcbiAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZSh0aWxlKTtcbiAgICB9XG5cbiAgICAvLyBSZXR1cm4gdGV4dHVyZSBpbmZvIGZvciBhIHJhc3RlciB0aWxlXG4gICAgdGlsZVRleHR1cmUgKHRpbGUpIHtcbiAgICAgICAgbGV0IGtleSA9IHRpbGUuY29vcmRzLmtleTtcbiAgICAgICAgaWYgKCF0aGlzLnRleHR1cmVzW2tleV0pIHtcbiAgICAgICAgICAgIGxldCBjb29yZHMgPSBUaWxlLmNvb3JkaW5hdGVXaXRoTWF4Wm9vbSh0aWxlLmNvb3JkcywgdGhpcy5tYXhfem9vbSk7XG4gICAgICAgICAgICBsZXQgdXJsID0gdGhpcy5mb3JtYXRVcmwodGhpcy51cmwsIHsgY29vcmRzIH0pO1xuICAgICAgICAgICAgdGhpcy50ZXh0dXJlc1trZXldID0geyB1cmwsIGZpbHRlcmluZzogdGhpcy5maWx0ZXJpbmcsIGNvb3JkcyB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnRleHR1cmVzW2tleV07XG4gICAgfVxuXG59XG5cbkRhdGFTb3VyY2UucmVnaX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nNcbiAgICAgICAgICAgIHRoaXMuem9vbXMgPSB7fTtcblxuICAgICAgICAgICAgaWYgKHp0eXBlID09PSAnbnVtYmVyJykge1xuICAgICAgICAgICAgICAgIHRoaXMuem9vbXNbem9vbV0gPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoQXJyYXkuaXNBcnJheSh6b29tKSkge1xuICAgICAgICAgICAgICAgIGZvciAobGV0IHo9MDsgeiA8IHpvb20ubGVuZ3RoOyB6KyspIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy56b29tc1t6b29tW3pdXSA9IHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoenR5cGUgPT09ICdvYmplY3QnICYmICh6b29tLm1pbiAhPSBudWxsIHx8IHpvb20ubWF4ICE9IG51bGwpKSB7XG4gICAgICAgICAgICAgICAgbGV0IHptaW4gPSB6b29tLm1pbiB8fCAwO1xuICAgICAgICAgICAgICAgIGxldCB6bWF4ID0gem9vbS5tYXggfHwgMjU7IC8vIFRPRE86IHJlcGxhY2UgY29uc3RhbnQgZm9yIG1heCBwb3NzaWJsZSB6b29tXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgej16bWluOyB6IDwgem1heDsgeisrKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuem9vbXNbel0gPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZGVsZXRlIHRoaXMuZmlsdGVyLiR6b29tOyAvLyBkb24ndCBwcm9jZXNzIHpvb20gdGhyb3VnaCB1c3VhbCBnZW5lcmljIGZpbHRlciBsb2dpY1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgYnVpbGRQcm9wTWF0Y2hlcygpIHtcbiAgICAgICAgaWYgKCF0aGlzLmZpbHRlciB8fCBBcnJheS5pc0FycmF5KHRoaXMuZmlsdGVyKSB8fCB0eXBlb2YgdGhpcy5maWx0ZXIgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIE9iamVjdC5rZXlzKHRoaXMuZmlsdGVyKS5mb3JFYWNoKGtleSA9PiB7XG4gICAgICAgICAgICBpZiAoYmxhY2tsaXN0LmluZGV4T2Yoa2V5KSA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICBsZXQgdmFsID0gdGhpcy5maWx0ZXJba2V5XTtcbiAgICAgICAgICAgICAgICBsZXQgdHlwZSA9IHR5cGVvZiB2YWw7XG4gICAgICAgICAgICAgICAgbGV0IGFycmF5ID0gQXJyYXkuaXNBcnJheSh2YWwpO1xuXG4gICAgICAgICAgICAgICAgaWYgKCEoYXJyYXkgfHwgdHlwZSA9PT0gJ3N0cmluZycgfHwgdHlwZSA9PT0gJ251bWJlcicpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoa2V5WzBdID09PSAnJCcpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gQ29udGV4dCBwcm9wZXJ0eVxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnRleHRfcHJvcF9tYXRjaGVzID0gdGhpcy5jb250ZXh0X3Byb3BfbWF0Y2hlcyB8fCBbXTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jb250ZXh0X3Byb3BfbWF0Y2hlcy5wdXNoKFtrZXkuc3Vic3RyaW5nKDEpLCBhcnJheSA/IHZhbCA6IFt2YWxdXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvLyBGZWF0dXJlIHByb3BlcnR5XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZmVhdHVyZV9wcm9wX21hdGNoZXMgPSB0aGlzLmZlYXR1cmVfcHJvcF9tYXRjaGVzIHx8IFtdO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmZlYXR1cmVfcHJvcF9tYXRjaGVzLnB1c2goW2tleSwgYXJyYXkgPyB2YWwgOiBbdmFsXV0pO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGRlbGV0ZSB0aGlzLmZpbHRlcltrZXldO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBkb1Byb3BNYXRjaGVzIChjb250ZXh0KSB7XG4gICAgICAgIGlmICh0aGlzLmZlYXR1cmVfcHJvcF9tYXRjaGVzKSB7XG4gICAgICAgICAgICBmb3IgKGxldCByPTA7IHIgPCB0aGlzLmZlYXR1cmVfcHJvcF9tYXRjaGVzLmxlbmd0aDsgcisrKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hdGNoID0gdGhpcy5mZWF0dXJlX3Byb3BfbWF0Y2hlc1tyXTtcbiAgICAgICAgICAgICAgICBsZXQgdmFsID0gY29udGV4dC5mZWF0dXJlLnByb3BlcnRpZXNbbWF0Y2hbMF1dO1xuICAgICAgICAgICAgICAgIGlmICh2YWwgPT0gbnVsbCB8fCBtYXRjaFsxXS5pbmRleE9mKHZhbCkgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5jb250ZXh0X3Byb3BfbWF0Y2hlcykge1xuICAgICAgICAgICAgZm9yIChsZXQgcj0wOyByIDwgdGhpcy5jb250ZXh0X3Byb3BfbWF0Y2hlcy5sZW5ndGg7IHIrKykge1xuICAgICAgICAgICAgICAgIGxldCBtYXRjaCA9IHRoaXMuY29udGV4dF9wcm9wX21hdGNoZXNbcl07XG4gICAgICAgICAgICAgICAgbGV0IHZhbCA9IGNvbnRleHRbbWF0Y2hbMF1dO1xuICAgICAgICAgICAgICAgIGlmICh2YWwgPT0gbnVsbCB8fCBtYXRjaFsxXS5pbmRleE9mKHZhbCkgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9XG5cbiAgICBkb2VzTWF0Y2ggKGNvbnRleHQpIHtcbiAgICAgICAgaWYgKCF0aGlzLmlzX2J1aWx0KSB7XG4gICAgICAgICAgICB0aGlzLmJ1aWxkKCk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyB6b29tIHByZS1maWx0ZXI6IHNraXAgcmVzdCBvZiBmaWx0ZXIgaWYgb3V0IG9mIGxheWVyIHpvb20gcmFuZ2VcbiAgICAgICAgaWYgKHRoaXMuem9vbXMgIT0gbnVsbCAmJiAhdGhpcy56b29tc1tjb250ZXh0Lnpvb21dKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBkaXJlY3QgZmVhdHVyZSBwcm9wZXJ0eSBtYXRjaGVzXG4gICAgICAgIGlmICghdGhpcy5kb1Byb3BNYXRjaGVzKGNvbnRleHQpKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBhbnkgcmVtYWluaW5nIGZpbHRlciAobW9yZSBjb21wbGV4IG1hdGNoZXMgb3IgZHluYW1pYyBmdW5jdGlvbilcbiAgICAgICAgaWYgKHRoaXMuZmlsdGVyIGluc3RhbmNlb2YgRnVuY3Rpb24pe1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5maWx0ZXIoY29udGV4dCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICAgICAgICAvLyBGaWx0ZXIgZnVuY3Rpb24gZXJyb3JcbiAgICAgICAgICAgICAgICBsZXQgbXNnID0gYEZpbHRlciBmb3IgdGhpcyAke3RoaXMuZnVsbF9uYW1lfTogXFxgZmlsdGVyOiAke3RoaXMuZmlsdGVyX29yaWdpbmFsfVxcYCBgO1xuICAgICAgICAgICAgICAgIG1zZyArPSBgZmFpbGVkIHdpdGggZXJyb3IgJyR7ZXJyb3IubWVzc2FnZX0nLCBzdGFjayB0cmFjZTogJHtlcnJvci5zdGFja31gO1xuICAgICAgICAgICAgICAgIGxvZygnZXJyb3InLCBtc2csIGNvbnRleHQuZmVhdHVyZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5maWx0ZXIgPT0gbnVsbDtcbiAgICAgICAgfVxuICAgIH1cblxufVxuXG5MYXllci5pZCA9IDA7XG5cblxuZXhwb3J0IGNsYXNzIExheWVyTGVhZiBleHRlbmRzIExheWVyIHtcbiAgICBjb25zdHJ1Y3RvciAoY29uZmlnKSB7XG4gICAgICAgIHN1cGVyKGNvbmZpZyk7XG4gICAgICAgIHRoaXMuaXNfbGVhZiA9IHRydWU7XG4gICAgfVxuXG59XG5cbmV4cG9ydCBjbGFzcyBMYXllclRyZWUgZXh0ZW5kcyBMYXllciB7XG4gICAgY29uc3RydWN0b3IgKGNvbmZpZykge1xuICAgICAgICBzdXBlcihjb25maWcpO1xuICAgICAgICB0aGlzLmlzX3RyZWUgPSB0cnVlO1xuICAgICAgICB0aGlzLmxheWVycyA9IGNvbmZpZy5sYXllcnMgfHwgW107XG4gICAgfVxuXG4gICAgYWRkTGF5ZXIgKGxheWVyKSB7XG4gICAgICAgIHRoaXMubGF5ZXJzLnB1c2gobGF5ZXIpO1xuICAgIH1cblxuICAgIGJ1aWxkRHJhd0dyb3VwcyAoY29udGV4dCkge1xuICAgICAgICBsZXQgbGF5ZXJzID0gW10sIGxheWVyX2lkcyA9IFtdO1xuICAgICAgICBtYXRjaEZlYXR1cmUoY29udGV4dCwgW3RoaXNdLCBsYXllcnMsIGxheWVyX2lkcyk7XG5cbiAgICAgICAgaWYgKGxheWVycy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBsZXQgY2FjaGVfa2V5ID0gY2FjaGVLZXkobGF5ZXJfaWRzKTtcblxuICAgICAgICAgICAgLy8gT25seSBldmFsdWF0ZSBlYWNoIGxheWVyIGNvbWJpbmF0aW9uIG9uY2UgKHVuZGVmaW5lZCBtZWFucyBub3QgeWV0IGV2YWx1YXRlZCxcbiAgICAgICAgICAgIC8vIG51bGwgbWVhbnMgZXZhbHVhdGVkIHdpdGggbm8gZHJhdyBvYmplY3QpXG4gICAgICAgICAgICBpZiAobGF5ZXJfY2FjaGVbY2FjaGVfa2V5XSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgLy8gRmluZCBhbGwgdGhlIHVuaXF1ZSB2aXNpYmxlIGRyYXcgYmxvY2tzIGZvciB0aGlzIGxheWVyIHRyZWVcbiAgICAgICAgICAgICAgICBsZXQgZHJhd19ncm91cHMgPSBsYXllcnMubWFwKHggPT4geCAmJiB4LnZpc2libGUgIT09IGZhbHNlICYmIHguY2FsY3VsYXRlZERyYXcpO1xuICAgICAgICAgICAgICAgIGxldCBkcmF3X2tleXMgPSB7fTtcblxuICAgICAgICAgICAgICAgIGZvciAobGV0IHI9MDsgciA8IGRyYXdfZ3JvdXBzLmxlbmd0aDsgcisrKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBsYXllciA9IGRyYXdfZ3JvdXBzW3JdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWxheWVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBnPTA7IGcgPCBsYXllci5sZW5ndGg7IGcrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGdyb3VwID0gbGF5ZXJbZ107XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBrZXkgaW4gZ3JvdXApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X2tleXNba2V5XSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBDYWxjdWxhdGUgZWFjaCBkcmF3IGdyb3VwXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgZHJhd19rZXkgaW4gZHJhd19rZXlzKSB7XG4gICAgICAgICAgICAgICAgICAgIGxheWVyX2NhY2hlW2NhY2hlX2tleV0gPSBsYXllcl9jYWNoZVtjYWNoZV9rZXldIHx8IHt9O1xuICAgICAgICAgICAgICAgICAgICBsYXllcl9jYWNoZVtjYWNoZV9rZXldW2RyYXdfa2V5XSA9IG1lcmdlVHJlZXMoZHJhd19ncm91cHMsIGRyYXdfa2V5KTtcblxuICAgICAgICAgICAgICAgICAgICAvLyBPbmx5IHNhdmUgdGhlIG9uZXMgdGhhdCB3ZXJlbid0IG51bGxcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFsYXllcl9jYWNoZVtjYWNoZV9rZXldW2RyYXdfa2V5XSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGxheWVyX2NhY2hlW2NhY2hlX2tleV1bZHJhd19rZXldO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGF5ZXJfY2FjaGVbY2FjaGVfa2V5XVtkcmF3X2tleV0ua2V5ID0gY2FjaGVfa2V5ICsgJy8nICsgZHJhd19rZXk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsYXllcl9jYWNoZVtjYWNoZV9rZXldW2RyYXdfa2V5XS5sYXllcnMgPSBsYXllcnMubWFwKHggPT4geCAmJiB4LmZ1bGxfbmFtZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICA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hICdkcmF3JyBncm91cGA7XG4gICAgICAgICAgICAgICAgICAgIGlmIChwYXJlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1zZyArPSBgIHVuZGVyICcke3BhcmVudC5uYW1lfSdgO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIG1zZyArPSBgIGluc3RlYWQ/YDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbG9nKCd3YXJuJywgbXNnKTsgLy8gVE9ETzogZmlyZSBleHRlcm5hbCBldmVudCB0aGF0IGNsaWVudHMgdG8gc3Vic2NyaWJlIHRvXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgIH1cblxuICAgIHJldHVybiByO1xufVxuXG5cbmV4cG9ydCBmdW5jdGlvbiBwYXJzZUxheWVycyAobGF5ZXJzLCBzdHlsZXMpIHtcbiAgICBsZXQgbGF5ZXJfdHJlZXMgPSB7fTtcblxuICAgIGZvciAobGV0IGtleSBpbiBsYXllcnMpIHtcbiAgICAgICAgbGV0IGxheWVyID0gbGF5ZXJzW2tleV07XG4gICAgICAgIGlmIChsYXllcikge1xuICAgICAgICAgICAgbGF5ZXJfdHJlZXNba2V5XSA9IHBhcnNlTGF5ZXJUcmVlKGtleSwgbGF5ZXIsIG51bGwsIHN0eWxlcyk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gbGF5ZXJfdHJlZXM7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBtYXRjaEZlYXR1cmUoY29udGV4dCwgbGF5ZXJzLCBjb2xsZWN0ZWRfbGF5ZXJzLCBjb2xsZWN0ZWRfbGF5ZXJzX2lkcykge1xuICAgIGxldCBtYXRjaGVkID0gZmFsc2U7XG4gICAgbGV0IGNoaWxkTWF0Y2hlZCA9IGZhbHNlO1xuXG4gICAgaWYgKGxheWVycy5sZW5ndGggPT09IDApIHsgcmV0dXJuOyB9XG5cbiAgICBmb3IgKGxldCByPTA7IHIgPCBsYXllcnMubGVuZ3RoOyByKyspIHtcbiAgICAgICAgbGV0IGN1cnJlbnQgPSBsYXllcnNbcl07XG5cbiAgICAgICAgaWYgKGN1cnJlbnQuaXNfbGVhZikge1xuICAgICAgICAgICAgaWYgKGN1cnJlbnQuZG9lc01hdGNoKGNvbnRleHQpKSB7XG4gICAgICAgICAgICAgICAgbWF0Y2hlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgY29sbGVjdGVkX2xheWVycy5wdXNoKGN1cnJlbnQpO1xuICAgICAgICAgICAgICAgIGNvbGxlY3RlZF9sYXllcnNfaWRzLnB1c2goY3VycmVudC5pZCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW50LmlzX3RyZWUpIHtcbiAgICAgICAgICAgIGlmIChjdXJyZW50LmRvZXNNYXRjaChjb250ZXh0KSkge1xuICAgICAgICAgICAgICAgIG1hdGNoZWQgPSB0cnVlO1xuXG4gICAgICAgICAgICAgICAgY2hpbGRNYXRjaGVkID0gbWF0Y2hGZWF0dXJlKFxuICAgICAgICAgICAgICAgICAgICBjb250ZXh0LFxuICAgICAgICAgICAgICAgICAgICBjdXJyZW50LmxheWVycyxcbiAgICAgICAgICAgICAgICAgICAgY29sbGVjdGVkX2xheWVycyxcbiAgICAgICAgICAgICAgICAgICAgY29sbGVjdGVkX2xheWVyc19pZHNcbiAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgaWYgKCFjaGlsZE1hdGNoZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29sbGVjdGVkX2xheWVycy5wdXNoKGN1cnJlbnQpO1xuICAgICAgICAgICAgICAgICAgICBjb2xsZWN0ZWRfbGF5ZXJzX2lkcy5wdXNoKGN1cnJlbnQuaWQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBtYXRjaGVkO1xufVxuIiwiLy8gUmVuZGVycy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AgICAgICBsZXQgb3V0bGluZV93aWR0aCA9IHRoaXMuY2FsY1dpZHRoKGRyYXcub3V0bGluZS53aWR0aCwgY29udGV4dCkgKiAyO1xuICAgICAgICAgICAgbGV0IG91dGxpbmVfbmV4dF93aWR0aCA9IHRoaXMuY2FsY1dpZHRoTmV4dFpvb20oZHJhdy5vdXRsaW5lLm5leHRfd2lkdGgsIGNvbnRleHQpICogMjtcblxuICAgICAgICAgICAgaWYgKChvdXRsaW5lX3dpZHRoID09PSAwICYmIG91dGxpbmVfbmV4dF93aWR0aCA9PT0gMCkgfHwgb3V0bGluZV93aWR0aCA8IDAgfHwgb3V0bGluZV9uZXh0X3dpZHRoIDwgMCkge1xuICAgICAgICAgICAgICAgIC8vIHNraXAgbGluZXMgdGhhdCBkb24ndCBpbnRlcnBvbGF0ZSBiZXR3ZWVuIHplcm8gb3IgZ3JlYXRlciB3aWR0aFxuICAgICAgICAgICAgICAgIHN0eWxlLm91dGxpbmUud2lkdGgudmFsdWUgPSBudWxsO1xuICAgICAgICAgICAgICAgIHN0eWxlLm91dGxpbmUubmV4dF93aWR0aC52YWx1ZSA9IG51bGw7XG4gICAgICAgICAgICAgICAgc3R5bGUub3V0bGluZS5jb2xvciA9IG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBNYWludGFpbiBjb25zaXN0ZW50IG91dGxpbmUgd2lkdGggYXJvdW5kIHRoZSBsaW5lIGZpbGxcbiAgICAgICAgICAgICAgICBzdHlsZS5vdXRsaW5lLndpZHRoLnZhbHVlID0gb3V0bGluZV93aWR0aCArIHdpZHRoO1xuICAgICAgICAgICAgICAgIHN0eWxlLm91dGxpbmUubmV4dF93aWR0aC52YWx1ZSA9IG91dGxpbmVfbmV4dF93aWR0aCArIG5leHRfd2lkdGg7XG5cbiAgICAgICAgICAgICAgICBzdHlsZS5vdXRsaW5lLmNvbG9yID0gZHJhdy5vdXRsaW5lLmNvbG9yO1xuICAgICAgICAgICAgICAgIHN0eWxlLm91dGxpbmUuY2FwID0gZHJhdy5vdXRsaW5lLmNhcCB8fCBkcmF3LmNhcDtcbiAgICAgICAgICAgICAgICBzdHlsZS5vdXRsaW5lLmpvaW4gPSBkcmF3Lm91dGxpbmUuam9pbiB8fCBkcmF3LmpvaW47XG4gICAgICAgICAgICAgICAgc3R5bGUub3V0bGluZS5taXRlcl9saW1pdCA9IGRyYXcub3V0bGluZS5taXRlcl9saW1pdCB8fCBkcmF3Lm1pdGVyX2xpbWl0O1xuICAgICAgICAgICAgICAgIHN0eWxlLm91dGxpbmUuc3R5bGUgPSBkcmF3Lm91dGxpbmUuc3R5bGUgfHwgdGhpcy5uYW1lO1xuXG4gICAgICAgICAgICAgICAgLy8gRXhwbGljaXRseSBkZWZpbmVkIG91dGxpbmUgb3JkZXIsIG9yIGluaGVyaXRlZCBmcm9tIGlubmVyIGxpbmVcbiAgICAgICAgICAgICAgICBpZiAoZHJhdy5vdXRsaW5lLm9yZGVyKSB7XG4gICAgICAgICAgICAgICAgICAgIHN0eWxlLm91dGxpbmUub3JkZXIgPSB0aGlzLnBhcnNlT3JkZXIoZHJhdy5vdXRsaW5lLm9yZGVyLCBjb250ZXh0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHN0eWxlLm91dGxpbmUub3JkZXIgPSBzdHlsZS5vcmRlcjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBEb24ndCBsZXQgb3V0bGluZSBiZSBhYm92ZSBpbm5lciBsaW5lXG4gICAgICAgICAgICAgICAgaWYgKHN0eWxlLm91dGxpbmUub3JkZXIgPiBzdHlsZS5vcmRlcikge1xuICAgICAgICAgICAgICAgICAgICBzdHlsZS5vdXRsaW5lLm9yZGVyID0gc3R5bGUub3JkZXI7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gT3V0bGluZ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IFRleHR1cmUudGV4dHVyZXNbdGhpcy50ZXh0dXJlXS5zcHJpdGVzKSB7XG4gICAgICAgICAgICBpZiAoIXNwcml0ZSAmJiAhc3R5bGUuc3ByaXRlX2RlZmF1bHQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICghVGV4dHVyZS50ZXh0dXJlc1t0aGlzLnRleHR1cmVdLnNwcml0ZXNbc3ByaXRlXSkge1xuICAgICAgICAgICAgICAgIC8vIElmIHNwcml0ZSBub3QgZm91bmQsIGNoZWNrIGZvciBkZWZhdWx0IHNwcml0ZVxuICAgICAgICAgICAgICAgIGlmIChzdHlsZS5zcHJpdGVfZGVmYXVsdCkge1xuICAgICAgICAgICAgICAgICAgICBzcHJpdGUgPSBzdHlsZS5zcHJpdGVfZGVmYXVsdDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFUZXh0dXJlLnRleHR1cmVzW3RoaXMudGV4dHVyZV0uc3ByaXRlc1tzcHJpdGVdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsb2coJ3dhcm4nLCBgU3R5bGU6IGluIHN0eWxlICcke3RoaXMubmFtZX0nLCBjb3VsZCBub3QgZmluZCBkZWZhdWx0IHNwcml0ZSAnJHtzcHJpdGV9JyBmb3IgdGV4dHVyZSAnJHt0aGlzLnRleHR1cmV9J2ApO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXRoaXMudGV4dHVyZV9taXNzaW5nX3Nwcml0ZXNbc3ByaXRlXSkgeyAvLyBvbmx5IGxvZyBlYWNoIG1pc3Npbmcgc3ByaXRlIG9uY2VcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvZygnZGVidWcnLCBgU3R5bGU6IGluIHN0eWxlICcke3Ro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ICAgICAgICAgICAgICAgICAgZHJhdzogcS5kcmF3LFxuICAgICAgICAgICAgICAgICAgICBjb250ZXh0OiBxLmNvbnRleHQsXG4gICAgICAgICAgICAgICAgICAgIHN0eWxlLFxuICAgICAgICAgICAgICAgICAgICBsYWJlbFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgcG9pbnRfb2Jqcy5wdXNoKHBvaW50X29iaik7XG5cbiAgICAgICAgICAgICAgICBpZiAocS50ZXh0X2ZlYXR1cmUpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRleHRfb2JqID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgZmVhdHVyZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRyYXc6IHEudGV4dF9mZWF0dXJlLmRyYXcsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0OiBxLmNvbnRleHQsXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0OiBxLnRleHRfZmVhdHVyZS50ZXh0LFxuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dF9zZXR0aW5nc19rZXk6IHEudGV4dF9mZWF0dXJlLnRleHRfc2V0dGluZ3Nfa2V5LFxuICAgICAgICAgICAgICAgICAgICAgICAgbGF5b3V0OiBxLnRleHRfZmVhdHVyZS5sYXlvdXQsXG4gICAgICAgICAgICAgICAgICAgICAgICBwb2ludF9sYWJlbDogbGFiZWwsXG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5rZWQ6IHBvaW50X29iaiAgIC8vIGxpbmsgc28gdGV4dCBvbmx5IHJlbmRlcnMgd2hlbiBwYXJlbnQgcG9pbnQgaXMgcGxhY2VkXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIHRleHRfb2Jqcy5wdXNoKHRleHRfb2JqKTtcblxuICAgICAgICAgICAgICAgICAgICAvLyBVbmxlc3MgdGV4dCBmZWF0dXJlIGlzIG9wdGlvbmFsLCBjcmVhdGUgYSB0d28td2F5IGxpbmsgc28gdGhhdCBwYXJlbnRcbiAgICAgICAgICAgICAgICAgICAgLy8gcG9pbnQgd2lsbCBvbmx5IHJlbmRlciB3aGVuIHRleHQgaXMgYWxzbyBwbGFjZWRcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFxLmRyYXcudGV4dC5vcHRpb25hbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRfb2JqLmxpbmtlZCA9IHRleHRfb2JqOyAvLyB0d28td2F5IGxpbmtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gQ29sbGlkZSBib3RoIHBvaW50cyBhbmQgdGV4dCwgdGhlbiBidWlsZCBmZWF0dXJlc1xuICAgICAgICByZXR1cm4gUHJvbWlzZS5cbiAgICAgICAgICAgIGFsbChbXG4gICAgICAgICAgICAgICAgLy8gUG9pbnRzXG4gICAgICAgICAgICAgICAgQ29sbGlzaW9uLmNvbGxpZGUocG9pbnRfb2JqcywgdGhpcy5jb2xsaXNpb25fZ3JvdXBfcG9pbnRzLCB0aWxlLmtleSkudGhlbihwb2ludF9vYmpzID0+IHtcbiAgICAgICAgICAgICAgICAgICAgcG9pbnRfb2Jqcy5mb3JFYWNoKHEgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5mZWF0dXJlX3N0eWxlID0gcS5zdHlsZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZmVhdHVyZV9zdHlsZS5sYWJlbCA9IHEubGFiZWw7XG4gICAgICAgICAgICAgICAgICAgICAgICBTdHlsZS5hZGRGZWF0dXJlLmNhbGwodGhpcywgcS5mZWF0dXJlLCBxLmRyYXcsIHEuY29udGV4dCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgIC8vIExhYmVsc1xuICAgICAgICAgICAgICAgIHRoaXMucHJlcGFyZVRleHRMYWJlbHModGlsZSwgdGhpcy5jb2xsaXNpb25fZ3JvdXBfdGV4dCwgdGV4dF9vYmpzKS5cbiAgICAgICAgICAgICAgICAgICAgdGhlbihsYWJlbHMgPT4gdGhpcy5jb2xsaWRlQW5kUmVuZGVyVGV4dExhYmVscyh0aWxlLCB0aGlzLmNvbGxpc2lvbl9ncm91cF90ZXh0LCBsYWJlbHMpKVxuICAgICAgICAgICAgXSkudGhlbigoWywgeyBsYWJlbHMsIHRleHRzLCB0ZXh0dXJlIH1dKSA9PiB7XG4gICAgICAgICAgICAgICAgLy8gUHJvY2VzcyBsYWJlbHNcbiAgICAgICAgICAgICAgICBpZiAobGFiZWxzICYmIHRleHRzKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIEJ1aWxkIHF1ZXVlZCBmZWF0dXJlc1xuICAgICAgICAgICAgICAgICAgICBsYWJlbHMuZm9yRWFjaChxID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ZXh0X3NldHRpbmdzX2tleSA9IHEudGV4dF9zZXR0aW5nc19rZXk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGV4dF9pbmZvID0gdGV4dHNbdGV4dF9zZXR0aW5nc19rZXldICYmIHRleHRzW3RleHRfc2V0dGluZ3Nfa2V5XVtxLnRleHRdO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzZXR1cCBzdHlsaW5nIG9iamVjdCBleHBlY3RlZCBieSBTdHlsZSBjbGFzc1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN0eWxlID0gdGhpcy5mZWF0dXJlX3N0eWxlO1xuICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGUubGFiZWwgPSBxLmxhYmVsO1xuICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGUuc2l6ZSA9IHRleHRfaW5mby5zaXplLmxvZ2ljYWxfc2l6ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlLnRleGNvb3JkcyA9IHRleHRfaW5mby5hbGlnbltxLmxhYmVsLmFsaWduXS50ZXhjb29yZHM7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHlsZS5hbmdsZSA9IHEubGFiZWwuYW5nbGUgfHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlLnNhbXBsZXIgPSAxOyAvLyBub24tMCA9IGxhYmVsc1xuXG4gICAgICAgICAgICAgICAgICAgICAgICBTdHlsZS5hZGRGZWF0dXJlLmNhbGwodGhpcywgcS5mZWF0dXJlLCBxLmRyYXcsIHEuY29udGV4dCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLmZyZWVUZXh0KHRpbGUpO1xuXG4gICAgICAgICAgICAgICAgLy8gRmluaXNoIHRpbGUgbWVzaFxuICAgICAgICAgICAgICAgIHJldHVybiBTdHlsZS5lbmREYXRhLmNhbGwodGhpcywgdGlsZSkudGhlbih0aWxlX2RhdGEgPT4ge1xuICAgICAgICAgICAgICAgICAgICAvLyBBdHRhY2ggdGlsZS1zcGVjaWZpYyBsYWJlbCBhdGxhcyB0byBtZXNoIGFzIGEgdGV4dHVyZSB1bmlmb3JtXG4gICAgICAgICAgICAgICAgICAgIGlmICh0ZXh0dXJlICYmIHRpbGVfZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGlsZV9kYXRhLnVuaWZvcm1zID0gdGlsZV9kYXRhLnVuaWZvcm1zIHx8IHt9O1xuICAgICAgICAgICAgICAgICAgICAgICAgdGlsZV9kYXRhLnRleHR1cmVzID0gdGlsZV9kYXRhLnRleHR1cmVzIHx8IFtdO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICB0aWxlX2RhdGEudW5pZm9ybXMudV9sYWJlbF90ZXh0dXJlID0gdGV4dHVyZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpbGVfZGF0YS50ZXh0dXJlcy5wdXNoKHRleHR1cmUpOyAv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pbnQoZ2VvbWV0cnkuY29vcmRpbmF0ZXMsIHNpemUsIG9wdGlvbnMpKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChnZW9tZXRyeS50eXBlID09PSBcIk11bHRpUG9pbnRcIikge1xuICAgICAgICAgICAgbGV0IHBvaW50cyA9IGdlb21ldHJ5LmNvb3JkaW5hdGVzO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBwb2ludHMubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgICAgICAgICBsZXQgcG9pbnQgPSBwb2ludHNbaV07XG4gICAgICAgICAgICAgICAgbGFiZWxzLnB1c2gobmV3IExhYmVsUG9pbnQocG9pbnQsIHNpemUsIG9wdGlvbnMpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChnZW9tZXRyeS50eXBlID09PSBcIkxpbmVTdHJpbmdcIikge1xuICAgICAgICAgICAgLy8gUG9pbnQgYXQgZWFjaCBsaW5lIHZlcnRleFxuICAgICAgICAgICAgbGV0IHBvaW50cyA9IGdlb21ldHJ5LmNvb3JkaW5hdGVzO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBwb2ludHMubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgICAgICAgICBsYWJlbHMucHVzaChuZXcgTGFiZWxQb2ludChwb2ludHNbaV0sIHNpemUsIG9wdGlvbnMpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChnZW9tZXRyeS50eXBlID09PSBcIk11bHRpTGluZVN0cmluZ1wiKSB7XG4gICAgICAgICAgICAvLyBQb2ludCBhdCBlYWNoIGxpbmUgdmVydGV4XG4gICAgICAgICAgICBsZXQgbGluZXMgPSBnZW9tZXRyeS5jb29yZGluYXRlcztcbiAgICAgICAgICAgIGZvciAobGV0IGxuID0gMDsgbG4gPCBsaW5lcy5sZW5ndGg7IGxuKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgcG9pbnRzID0gbGluZXNbbG5dO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcG9pbnRzLmxlbmd0aDsgKytpKSB7XG4gICAgICAgICAgICAgICAgICAgIGxhYmVscy5wdXNoKG5ldyBMYWJlbFBvaW50KHBvaW50c1tpXSwgc2l6ZSwgb3B0aW9ucykpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChnZW9tZXRyeS50eXBlID09PSBcIlBvbHlnb25cIikge1xuICAgICAgICAgICAgLy8gUG9pbnQgYXQgcG9seWdvbiBjZW50cm9pZCAob2Ygb3V0ZXIgcmluZylcbiAgICAgICAgICAgIGlmIChvcHRpb25zLmNlbnRyb2lkKSB7XG4gICAgICAgICAgICAgICAgbGV0IGNlbnRyb2lkID0gR2VvLmNlbnRyb2lkKGdlb21ldHJ5LmNvb3JkaW5hdGVzKTtcbiAgICAgICAgICAgICAgICBsYWJlbHMucHVzaChuZXcgTGFiZWxQb2ludChjZW50cm9pZCwgc2l6ZSwgb3B0aW9ucykpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gUG9pbnQgYXQgZWFjaCBwb2x5Z29uIHZlcnRleCAoYWxsIHJpbmdzKVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IHJpbmdzID0gZ2VvbWV0cnkuY29vcmRpbmF0ZXM7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgbG4gPSAwOyBsbiA8IHJpbmdzLmxlbmd0aDsgbG4rKykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgcG9pbnRzID0gcmluZ3NbbG5dO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHBvaW50cy5sZW5ndGg7ICsraSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGFiZWxzLnB1c2gobmV3IExhYmVsUG9pbnQocG9pb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AgICAgICB0ZXhjb29yZF9zY2FsZSxcbiAgICAgICAgICAgICAgICB0ZXhjb29yZF9ub3JtYWxpemU6IDY1NTM1XG4gICAgICAgICAgICB9XG4gICAgICAgICk7XG4gICAgfSxcblxuICAgIC8vIEJ1aWxkIHF1YWQgZm9yIHBvaW50IHNwcml0ZVxuICAgIGJ1aWxkIChzdHlsZSwgdmVydGV4X2RhdGEpIHtcbiAgICAgICAgbGV0IGxhYmVsID0gc3R5bGUubGFiZWw7XG4gICAgICAgIGlmIChsYWJlbC5udW1fc2VnbWVudHMpIHtcbiAgICAgICAgICAgIHRoaXMuYnVpbGRBcnRpY3VsYXRlZExhYmVsKGxhYmVsLCBzdHlsZSwgdmVydGV4X2RhdGEpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5idWlsZExhYmVsKGxhYmVsLCBzdHlsZSwgdmVydGV4X2RhdGEpO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIGJ1aWxkTGFiZWwgKGxhYmVsLCBzdHlsZSwgdmVydGV4X2RhdGEpIHtcbiAgICAgICAgbGV0IHZlcnRleF90ZW1wbGF0ZSA9IHRoaXMubWFrZVZlcnRleFRlbXBsYXRlKHN0eWxlKTtcblxuICAgICAgICB0aGlzLmJ1aWxkUXVhZChcbiAgICAgICAgICAgIFtsYWJlbC5wb3NpdGlvbl0sICAgICAgICAgICAgICAgLy8gcG9zaXRpb25cbiAgICAgICAgICAgIHN0eWxlLnNpemUsICAgICAgICAgICAgICAgICAgICAgLy8gc2l6ZSBpbiBwaXhlbHNcbiAgICAgICAgICAgIHN0eWxlLmFuZ2xlLCAgICAgICAgICAgICAgICAgICAgLy8gYW5nbGUgaW4gcmFkaWFuc1xuICAgICAgICAgICAgc3R5bGUuc2FtcGxlciwgICAgICAgICAgICAgICAgICAvLyB0ZXh0dXJlIHNhbXBsZXIgdG8gdXNlXG4gICAgICAgICAgICBsYWJlbC5vZmZzZXQsICAgICAgICAgICAgICAgICAgIC8vIG9mZnNldCBmcm9tIGNlbnRlciBpbiBwaXhlbHNcbiAgICAgICAgICAgIHN0eWxlLnRleGNvb3JkcywgICAgICAgICAgICAgICAgLy8gdGV4dHVyZSBVVnNcbiAgICAgICAgICAgIHZlcnRleF9kYXRhLCB2ZXJ0ZXhfdGVtcGxhdGUgICAgLy8gVkJPIGFuZCBkYXRhIGZvciBjdXJyZW50IHZlcnRleFxuICAgICAgICApO1xuICAgIH0sXG5cbiAgICBidWlsZEFydGljdWxhdGVkTGFiZWwgKGxhYmVsLCBzdHlsZSwgdmVydGV4X2RhdGEpIHtcbiAgICAgICAgbGV0IHZlcnRleF90ZW1wbGF0ZSA9IHRoaXMubWFrZVZlcnRleFRlbXBsYXRlKHN0eWxlKTtcblxuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxhYmVsLm51bV9zZWdtZW50czsgaSsrKXtcbiAgICAgICAgICAgIGxldCBhbmdsZSA9IGxhYmVsLmFuZ2xlW2ldO1xuICAgICAgICAgICAgbGV0IHNpemUgPSBzdHlsZS5zaXplW2ldO1xuICAgICAgICAgICAgbGV0IG9mZnNldCA9IGxhYmVsLm9mZnNldHNbaV07XG4gICAgICAgICAgICBsZXQgdGV4Y29vcmQgPSBzdHlsZS50ZXhjb29yZHNbaV07XG5cbiAgICAgICAgICAgIHRoaXMuYnVpbGRRdWFkKFxuICAgICAgICAgICAgICAgIFtsYWJlbC5wb3NpdGlvbl0sICAgICAgICAgICAgICAgLy8gcG9zaXRpb25cbiAgICAgICAgICAgICAgICBzaXplLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNpemUgaW4gcGl4ZWxzXG4gICAgICAgICAgICAgICAgYW5nbGUsICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhbmdsZSBpbiBkZWdyZWVzXG4gICAgICAgICAgICAgICAgc3R5bGUuc2FtcGxlciwgICAgICAgICAgICAgICAgICAvLyB0ZXh0dXJlIHNhbXBsZXIgdG8gdXNlXG4gICAgIC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4dCkge1xuICAgICAgICBsZXQgdmVydGV4X3RlbXBsYXRlID0gdGhpcy5tYWtlVmVydGV4VGVtcGxhdGUoc3R5bGUpO1xuICAgICAgICBsZXQgb3B0aW9ucyA9IHtcbiAgICAgICAgICAgIHRleGNvb3JkX2luZGV4OiB0aGlzLnZlcnRleF9sYXlvdXQuaW5kZXguYV90ZXhjb29yZCxcbiAgICAgICAgICAgIHRleGNvb3JkX25vcm1hbGl6ZTogNjU1MzUsIC8vIHNjYWxlIFVWcyB0byB1bnNpZ25lZCBzaG9ydHNcbiAgICAgICAgICAgIHJlbW92ZV90aWxlX2VkZ2VzOiAhc3R5bGUudGlsZV9lZGdlcyxcbiAgICAgICAgICAgIHRpbGVfZWRnZV90b2xlcmFuY2U6IEdlby50aWxlX3NjYWxlICogY29udGV4dC50aWxlLnBhZF9zY2FsZSAqIDQsXG4gICAgICAgICAgICB3aW5kaW5nOiBjb250ZXh0LndpbmRpbmdcbiAgICAgICAgfTtcblxuICAgICAgICAvLyBFeHRydWRlZCBwb2x5Z29ucyAoZS5nLiAzRCBidWlsZGluZ3MpXG4gICAgICAgIGlmIChzdHlsZS5leHRydWRlICYmIHN0eWxlLmhlaWdodCkge1xuICAgICAgICAgICAgYnVpbGRFeHRydWRlZFBvbHlnb25zKFxuICAgICAgICAgICAgICAgIHBvbHlnb25zLFxuICAgICAgICAgICAgICAgIHN0eWxlLnosIHN0eWxlLmhlaWdodCwgc3R5bGUubWluX2hlaWdodCxcbiAgICAgICAgICAgICAgICB2ZXJ0ZXhfZGF0YSwgdmVydGV4X3RlbXBsYXRlLFxuICAgICAgICAgICAgICAgIHRoaXMudmVydGV4X2xheW91dC5pbmRleC5hX25vcm1hbCxcbiAgICAgICAgICAgICAgICAxMjcsIC8vIHNjYWxlIG5vcm1hbHMgdG8gc2lnbmVkIGJ5dGVzXG4gICAgICAgICAgICAgICAgb3B0aW9uc1xuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuICAgICAgICAvLyBSZWd1bG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MucHJvZ3JhbSA9IG5ldyBTaGFkZXJQcm9ncmFtKFxuICAgICAgICAgICAgICAgIHRoaXMuZ2wsXG4gICAgICAgICAgICAgICAgdGhpcy52ZXJ0ZXhfc2hhZGVyX3NyYyxcbiAgICAgICAgICAgICAgICB0aGlzLmZyYWdtZW50X3NoYWRlcl9zcmMsXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBuYW1lOiB0aGlzLm5hbWUsXG4gICAgICAgICAgICAgICAgICAgIGRlZmluZXMsXG4gICAgICAgICAgICAgICAgICAgIHVuaWZvcm1zLFxuICAgICAgICAgICAgICAgICAgICBibG9ja3MsXG4gICAgICAgICAgICAgICAgICAgIGJsb2NrX3Njb3BlcyxcbiAgICAgICAgICAgICAgICAgICAgZXh0ZW5zaW9uc1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICB0aGlzLnByb2dyYW0uY29tcGlsZSgpO1xuXG4gICAgICAgICAgICBpZiAodGhpcy5zZWxlY3Rpb24pIHtcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdGlvbl9wcm9ncmFtID0gbmV3IFNoYWRlclByb2dyYW0oXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZ2wsXG4gICAgICAgICAgICAgICAgICAgIHRoaXMudmVydGV4X3NoYWRlcl9zcmMsXG4gICAgICAgICAgICAgICAgICAgIHNoYWRlclNyY19zZWxlY3Rpb25GcmFnbWVudCxcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogKHRoaXMubmFtZSArICcgKHNlbGVjdGlvbiknKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmluZXM6IHNlbGVjdGlvbl9kZWZpbmVzLFxuICAgICAgICAgICAgICAgICAgICAgICAgdW5pZm9ybXMsXG4gICAgICAgICAgICAgICAgICAgICAgICBibG9ja3MsXG4gICAgICAgICAgICAgICAgICAgICAgICBibG9ja19zY29wZXMsXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRlbnNpb25zXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0aW9uX3Byb2dyYW0uY29tcGlsZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3Rpb25fcHJvZ3JhbSA9IG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgY2F0Y2goZXJyb3IpIHtcbiAgICAgICAgICAgIHRoaXMuY29tcGlsaW5nID0gZmFsc2U7XG4gICAgICAgICAgICB0aGlzLmNvbXBpbGVkID0gZmFsc2U7XG4gICAgICAgICAgICB0aHJvdyhuZXcgRXJyb3IoYHN0eWxlLmNvbXBpbGUoKTogc3R5bGUgJHt0aGlzLm5hbWV9IGVycm9yOmAsIGVycm9yKSk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmNvbXBpbGluZyA9IGZhbHNlO1xuICAgICAgICB0aGlzLmNvbXBpbGVkID0gdHJ1ZTtcbiAgICB9LFxuXG4gICAgLy8gQWRkIGEgc2hhZGVyIGJsb2NrXG4gICAgYWRkU2hhZGVyQmxvY2sgKGtleSwgYmxvY2ssIHNjb3BlID0gbnVsbCkge1xuICAgICAgICB0aGlzLnNoYWRlcnMuYmxvY2tzID0gdGhpcy5zaGFkZXJzLmJsb2NrcyB8fCB7fTtcbiAgICAgICAgdGhpcy5zaGFkZXJzLmJsb2Nrc1trZXldID0gdGhpcy5zaGFkZXJzLmJsb2Nrc1trZXldIHx8IFtdO1xuICAgICAgICB0aGlzLnNoYWRlcnMuYmxvY2tzW2tleV0ucHVzaChibG9jayk7XG5cbiAgICAgICAgdGhpcy5zaGFkZXJzLmJsb2NrX3Njb3BlcyA9IHRoaXMuc2hhZGVycy5ibG9ja19zY29wZXMgfHwge307XG4gICAgICAgIHRoaXMuc2hhZ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N0eWxlc1xuICAgICAgICBpZiAodGhpcy5kZWZpbmVzICE9IG51bGwpIHtcbiAgICAgICAgICAgIGZvciAodmFyIGQgaW4gdGhpcy5kZWZpbmVzKSB7XG4gICAgICAgICAgICAgICAgZGVmaW5lc1tkXSA9IHRoaXMuZGVmaW5lc1tkXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5zaGFkZXJzICE9IG51bGwgJiYgdGhpcy5zaGFkZXJzLmRlZmluZXMgIT0gbnVsbCkge1xuICAgICAgICAgICAgZm9yIChkIGluIHRoaXMuc2hhZGVycy5kZWZpbmVzKSB7XG4gICAgICAgICAgICAgICAgZGVmaW5lc1tkXSA9IHRoaXMuc2hhZGVycy5kZWZpbmVzW2RdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBkZWZpbmVzO1xuXG4gICAgfSxcblxuICAgIC8vIERldGVybWluZXMgaWYgJ3Jhc3RlcicgcGFyYW1ldGVyIGlzIHNldCB0byBhIHZhbGlkIHZhbHVlXG4gICAgaGFzUmFzdGVycyAoKSB7XG4gICAgICAgIHJldHVybiAoWydjb2xvcicsICdub3JtYWwnLCAnY3VzdG9tJ10uaW5kZXhPZih0aGlzLnJhc3RlcikgPiAtMSk7XG4gICAgfSxcblxuICAgIC8vIFNldHVwIHJhc3RlciBhY2Nlc3MgaW4gc2hhZGVyc1xuICAgIHNldHVwUmFzdGVycyAoKSB7XG4gICAgICAgIGlmICghdGhpcy5oYXNSYXN0ZXJzKCkpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEVuYWJsZSByYXN0ZXIgdGV4dHVyZXMgYW5kIGNvbmZpZ3VyZSBob3cgZmlyc3QgcmFzdGVyIGlzIGFwcGxpZWRcbiAgICAgICAgaWYgKHRoaXMucmFzdGVyID09PSAnY29sb3InKSB7XG4gICAgICAgICAgICB0aGlzLmRlZmluZXMuVEFOR1JBTV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AgICAvLyBXZSB3YW50IHRvIGJsb2NrIHRoZSBidWlsZGluZyBvZiBhIHJhc3RlciB0aWxlIG1lc2ggdW50aWwgaXRzIHRleHR1cmUgaXMgbG9hZGVkLFxuICAgICAgICAvLyB0byBhdm9pZCBmbGlja2VyaW5nIHdoaWxlIGxvYWRpbmcgKHRleHR1cmUgd2lsbCByZW5kZXIgYXMgYmxhY2spXG4gICAgICAgIHJldHVybiBXb3JrZXJCcm9rZXIucG9zdE1lc3NhZ2UodGhpcy5tYWluX3RocmVhZF90YXJnZXQrJy5sb2FkVGV4dHVyZXMnLCBjb25maWdzKVxuICAgICAgICAgICAgLnRoZW4odGV4dHVyZXMgPT4ge1xuICAgICAgICAgICAgICAgIGlmICghdGV4dHVyZXMgfHwgdGV4dHVyZXMubGVuZ3RoIDwgMSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiB3YXJuaW5nXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aWxlX2RhdGE7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gU2V0IHRleHR1cmUgdW5pZm9ybXMgKHJldHVybmVkIGFmdGVyIGxvYWRpbmcgZnJvbSBtYWluIHRocmVhZClcbiAgICAgICAgICAgICAgICB0aWxlX2RhdGEudW5pZm9ybXMgPSB0aWxlX2RhdGEudW5pZm9ybXMgfHwge307XG4gICAgICAgICAgICAgICAgdGlsZV9kYXRhLnRleHR1cmVzID0gdGlsZV9kYXRhLnRleHR1cmVzIHx8IFtdO1xuXG4gICAgICAgICAgICAgICAgbGV0IHVfc2FtcGxlcnMgPSB0aWxlX2RhdGEudW5pZm9ybXNbJ3VfcmFzdGVycyddID0gW107XG4gICAgICAgICAgICAgICAgbGV0IHVfc2l6ZXMgPSB0aWxlX2RhdGEudW5pZm9ybXNbJ3VfcmFzdGVyX3NpemVzJ10gPSBbXTtcbiAgICAgICAgICAgICAgICBsZXQgdV9vZmZzZXRzID0gdGlsZV9kYXRhLnVuaW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kcy56OyAvLyAjIG9mIGxldmVscyByYXN0ZXIgc291cmNlIGlzIG92ZXJ6b29tZWRcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkejIgPSBNYXRoLnBvdygyLCBkeik7XG4gICAgICAgICAgICAgICAgICAgICAgICB1X29mZnNldHNbaV0gPSBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRpbGUuY29vcmRzLnggJSBkejIpIC8gZHoyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkejIgLSAxIC0gKHRpbGUuY29vcmRzLnkgJSBkejIpKSAvIGR6MiwgLy8gR0wgdGV4dHVyZSBjb29yZHMgYXJlICtZIHVwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAvIGR6MlxuICAgICAgICAgICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHVfb2Zmc2V0c1tpXSA9IFswLCAwLCAxXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHJldHVybiB0aWxlX2RhdGE7XG4gICAgICAgICAgICB9XG4gICAgICAgICk7XG4gICAgfSxcblxuICAgIC8vIENhbGxlZCBvbiBtYWluIHRocmVhZFxuICAgIGxvYWRUZXh0dXJlcyAodGV4dHVyZXMpIHtcbiAgICAgICAgLy8gTkI6IG9ubHkgcmV0dXJuIG5hbWUgYW5kIHNpemUgb2YgdGV4dHVyZXMgbG9hZGVkLCBiZWNhdXNlIHdlIGNhbid0IHNlbmQgYWN0dWFsIHRleHR1cmUgb2JqZWN0cyB0byB3b3JrZXJcbiAgICAgICAgcmV0dXJuIFRleHR1cmUuY3JlYXRlRnJvbU9iamVjdCh0aGlzLmdsLCB0ZXh0dXJlcylcbiAgICAgICAgICAgIC50aGVuKCgpID0+IHtcbiAgICAgICAgICAgICAgICByZXR1cm4gUHJv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W1lfWApO1xuXG4gICAgICAgICAgICAgICAgaWYgKCFzdHlsZS5pc0J1aWx0SW4oKSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnJlbW92ZShzdHlsZS5uYW1lKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc3R5bGUuZGVzdHJveSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICAvLyBSZWdpc3RlciBhIHN0eWxlXG4gICAgcmVnaXN0ZXIgKHN0eWxlKSB7XG4gICAgICAgIHRoaXMuc3R5bGVzW3N0eWxlLm5hbWVdID0gc3R5bGU7XG4gICAgICAgIHRoaXMuYmFzZV9zdHlsZXNbc3R5bGUubmFtZV0gPSBzdHlsZTtcbiAgICB9XG5cbiAgICAvLyBSZW1vdmUgYSBzdHlsZVxuICAgIHJlbW92ZSAobmFtZSkge1xuICAgICAgICBkZWxldGUgdGhpcy5zdHlsZXNbbmFtZV07XG4gICAgfVxuXG4gICAgbWl4IChzdHlsZSwgc3R5bGVzKSB7XG4gICAgICAgIC8vIEV4aXQgZWFybHkgaWYgd2UgaGF2ZSBhbHJlYWR5IGFwcGxpZWQgbWl4aW5zIHRvIHRoaXMgc3R5bGVcbiAgICAgICAgaWYgKHN0eWxlLm1peGVkKSB7XG4gICAgICAgICAgICByZXR1cm4gc3R5bGU7XG4gICAgICAgIH1cbiAgICAgICAgc3R5bGUubWl4ZWQgPSB7fTtcblxuICAgICAgICAvLyBNaXhpbiBzb3VyY2VzLCBpbiBvcmRlclxuICAgICAgICBsZXQgc291cmNlcyA9IFtdO1xuICAgICAgICBpZiAoc3R5bGUubWl4KSB7XG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShzdHlsZS5taXgpKSB7XG4gICAgICAgICAgICAgICAgc291cmNlcy5wdXNoKC4uLnN0eWxlLm1peCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBzb3Vy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sZSBvciBub3QpXG4gICAgICAgICAgICAgICAgICAgIC8vIE1pbWljcyBKUyBwcm90b3R5cGUvaGFzT3duUHJvcGVydHkgYmVoYXZpb3IsIGJ1dCB3aXRoIG11bHRpcGxlIGFuY2VzdG9ycyAodmlhIG1peGlucylcbiAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHNoYWRlcnMudW5pZm9ybXMsIHUsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25maWd1cmFibGU6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBVbmlmb3JtIGlzIGV4cGxpY2l0bHkgZGVmaW5lZCBvbiB0aGlzIHN0eWxlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNoYWRlcnMuX3VuaWZvcm1zW3VdICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNoYWRlcnMuX3VuaWZvcm1zW3VdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBVbmlmb3JtIHdhcyBtaXhlZCBmcm9tIGFub3RoZXIgc3R5bGUsIGZvcndhcmQgcmVxdWVzdCB0aGVyZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElkZW50aWZ5IGNoZWNrIGlzIG5lZWRlZCB0byBwcmV2ZW50IGluZmluaXRlIHJlY3Vyc2lvbiBpZiBhIHByZXZpb3VzbHkgZGVmaW5lZCB1bmlmb3JtXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaXMgc2V0IHRvIHVuZGVmaW5lZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHN0eWxlc1tzaGFkZXJzLl91bmlmb3JtX3Njb3Blc1t1XV0uc2hhZGVycy51bmlmb3JtcyAhPT0gc2hhZGVycy51bmlmb3Jtcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3R5bGVzW3NoYWRlcnMuX3VuaWZvcm1fc2NvcGVzW3VdXS5zaGFkZXJzLnVuaWZvcm1zW3VdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hhZGVycy5fdW5pZm9ybXNbdV0gPSB2O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAvLyBFeHRlbnNpb25zOiBidWlsZCBhIGxpc3Qgb2YgdW5pcXVlIGV4dGVuc2lvbnNcbiAgICAgICAgc2hhZGVycy5leHRlbnNpb25zID0gT2JqZWN0LmtleXMoc2hhZGVyX21lcmdlc1xuICAgICAgICAgICAgLm1hcCh4ID0+IHguZXh0ZW5zaW9ucylcbiAgICAgICAgICAgIC5maWx0ZXIoeCA9PiB4KVxuICAgICAgICAgICAgLnJlZHVjZSgocHJldiwgY3VyKSA9PiB7XG4gICAgICAgICAgICAgICAgLy8gc2luZ2xlIGV4dGVuc2lvblxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgY3VyID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICBwcmV2W2N1cl0gPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBhcnJheSBvZiBleHRlbnNpb25zXG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGN1ci5mb3JFYWNoKHggPT4gcHJldlt4XSA9IHRydWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcHJldjtcbiAgICAgICAgICAgIH0sIHt9KSB8fCB7fVxuICAgICAgICApO1xuXG4gICAgICAgIC8vIFNoYWRlciBibG9ja3NcbiAgICAgICAgLy8gTWFyayBhbGwgc2hhZGVyIGJsb2NrcyBmb3IgdGhlIHRhcmdldCBzdHlsZSBhcyBvcmlnaW5hdGluZyB3aXRoIGl0cyBvd24gbmFtZVxuICAgICAgICBpZiAoc3R5bGUuc2hhZGVycyAmJiBzdHlsZS5zaGFkZXJzLmJsb2Nrcykge1xuICAgICAgICAgICAgc3R5bGUuc2hhZGVycy5ibG9ja19zY29wZXMgPSBzdHlsZS5zaGFkZXJzLmJsb2NrX3Njb3BlcyB8fCB7fTtcbiAgICAgICAgICAgIGZvciAobGV0IFtrLCBibG9ja10gb2YgVXRpbHMuZW50cmllcyhzdHlsZS5zaGFkZXJzLmJsb2NrcykpIHtcbiAgICAgICAgICAgICAgICBzdHlsZS5zaGFkZXJzLmJsb2NrX3Njb3Blc1trXSA9IHN0eWxlLnNoYWRlcnMuYmxvY2tfc2NvcGVzW2tdIHx8IFtdO1xuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGJsb2NrKSkge1xuICAgICAgICAgICAgICAgICAgICBzdHlsZS5zaGFkZXJzLmJsb2NrX3Njb3Blc1trXS5wdXNoKC4uLmJsb2NrLm1hcCgoKSA9PiBzdHlsZS5uYW1lKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzdHlsZS5zaGFkZXJzLmJsb2NrX3Njb3Blc1trXS5wdXNoKHN0eWxlLm5hbWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIE1lcmdlIHNoYWRlciBibG9ja3MsIGtlZXBpbmcgdHJhY2sgb2Ygd2hpY2ggc3R5bGUgZWFjaCBibG9jayBvcmlnaW5hdGVkIGZyb21cbiAgICAgICAgbGV0IG1peGVkID0ge307IC8vIGFsbCBzY29wZXMgbWl4ZWQgc28gZmFyXG4gICAgICAgIGZvciAobGV0IHNvdXJjZSBvZiBzaGFkZXJfbWVyZ2VzKSB7XG4gICAgICAgICAgICBpZiAoIXNvdXJjZS5ibG9ja3MpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgc2hhZGVycy5ibG9ja3MgPSBzaGFkZXJzLmJsb2NrcyB8fCB7fTtcbiAgICAgICAgICAgIHNoYWRlcnMuYmxvY2tfc2NvcGVzID0gc2hhZGVycy5ibG9ja19zY29wZXMgfHwge307XG4gICAgICAgICAgICBsZXQgbWl4ZWRfc291cmNlID0ge307IC8vIHNjb3BlcyBtaXhlZCBmb3IgdGhpcyBzb3VyY2Ugc3R5bGVcblxuICAgICAgICAgICAgZm9yIChsZXQgW3QsIGJsb2NrXSBvZiBVdGlscy5lbnRyaWVzKHNvdXJjZS5ibG9ja3MpKSB7XG4gICAgICAgICAgICAgICAgbGV0IGJsb2NrX3Njb3BlID0gc291cmNlLmJsb2NrX3Njb3Blc1t0XTtcblxuICAgICAgICAgICAgICAgIHNoYWRlcnMuYmxvY2tzW3RdID0gc2hhZGVycy5ibG9ja3NbdF0gfHwgW107XG4gICAgICAgICAgICAgICAgc2hhZGVycy5ibG9ja19zY29wZXNbdF0gPSBzaGFkZXJzLmJsb2NrX3Njb3Blc1t0XSB8fCBbXTtcblxuICAgICAgICAgICAgICAgIC8vIHN0YW5kYXJkaXplIG9uIGFycmF5cyAoYmxvY2sgY2FuIGJlIHNpbmdsZSBvciBtdWx0aS12YWx1ZSlcbiAgICAgICAgICAgICAgICBibG9jayA9IEFycmF5LmlzQXJyYXkoYmxvY2spID8gYmxvY2sgOiBbYmxvY2tdO1xuICAgICAgICAgICAgICAgIGJsb2NrX3Njb3BlID0gQXJyYXkuaXNBcnJheShibG9ja19zY29wZSkgPyBibG9ja19zY29wZSA6IFtibG9ja19zY29wZV07XG5cbiAgICAgICAgICAgICAgICBmb3IgKGxldCBiPTA7IGIgPCBibG9jay5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgICAgICAgICAvLyBTa2lwIGJsb2NrcyB3ZSd2ZSBhbHJlYWR5IG1peGVkIGluIGZyb20gdGhlIHNhbWUgc2NvcGVcbiAgICAgICAgICAgICAgICAgICAgLy8gUmVwZWF0aW5nIHNjb3BlIGluZGljYXRlcyBhIGRpYW1vbmQgcGF0dGVybiB3aGVyZSBhIHN0eWxlIGlzIGJlaW5nIG1peGVkIG11bHRpcGxlIHRpbWVzXG4gICAgICAgICAgICAgICAgICAgIGlmIChtaXhlZFtibG9ja19zY29wZVtiXV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIG1peGVkX3NvdXJjZVtibG9ja19zY29wZVtiXV0gPSB0cnVlO1xuXG4gICAgICAgICAgICAgICAgICAgIHNoYWRlcnMuYmxvY2tzW3RdLnB1c2goYmxvY2tbYl0pO1xuICAgICAgICAgICAgICAgICAgICBzaGFkZXJzLmJsb2NrX3Njb3Blc1t0XS5wdXNoKGJsb2NrX3Njb3BlW2JdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIEFkZCBzdHlsZXMgbWl4ZWQgaW4gZnJvbSB0aGlzIHNvdXJjZSAtIHRoZXkgY291bGQgYmUgbXVsdGktbGV2ZWwgYW5jZXN0b3JzLFxuICAgICAgICAgICAgLy8gYmV5b25kIHRoZSBmaXJzdC1sZXZlbCBcInBhcmVudHNcIiBkZWZpbmVkIGluIHRoaXMgc3R5bGUncyBgbWl4YCBsaXN0XG4gICAgICAgICAgICBPYmplY3QuYXNzaWduKG1peGVkLCBtaXhlZF9zb3VyY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AgICBicmVhaztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gVHJhdmVyc2UgbmV4dCBwYXJlbnQgc3R5bGVcbiAgICAgICAgICAgIHBhcmVudHMrKztcblxuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoc3R5bGUubWl4KSkge1xuICAgICAgICAgICAgICAgIC8vIElmIG11bHRpcGxlIG1peGlucywgZmluZCB0aGUgZGVlcGVzdCBvbmVcbiAgICAgICAgICAgICAgICBwYXJlbnRzICs9IE1hdGgubWF4KC4uLnN0eWxlLm1peC5tYXAocyA9PiB7XG4gICAgICAgICAgICAgICAgICAgIC8vIFRyeWluZyB0byBtaXggaW50byBpdHNlbGYhXG4gICAgICAgICAgICAgICAgICAgIGlmIChrZXkgPT09IHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmluaGVyaXRhbmNlRGVwdGgocywgc3R5bGVzKTtcbiAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBUcnlpbmcgdG8gbWl4IGludG8gaXRzZWxmIVxuICAgICAgICAgICAgICAgIGlmIChrZXkgPT09IHN0eWxlLm1peCkge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBJZiBzaW5nbGUgbWl4aW4sIGNvbnRpbnVlIGxvb3AgdXAgdGhlIHRyZWVcbiAgICAgICAgICAgICAgICBrZXkgPSBzdHlsZS5taXg7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHBhcmVudHM7XG4gICAgfVxuXG4gICAgLy8gQ29tcGlsZSBhbGwgc3R5bGVzXG4gICAgY29tcGlsZSAoa2V5cywgc2NlbmUpIHtcbiAgICAgICAga2V5cyA9IGtleXMgfHwgT2JqZWN0LmtleXModGhpcy5zdHlsZXMpO1xuICAgICAgICBmb3IgKGxldCBrZXkgb2Yga2V5cykge1xuICAgICAgICAgICAgbGV0IHN0eWxlID0gdGhpcy5zdHlsZXNba2V5XTtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgc3R5bGUuY29tcGlsZSgpO1xuICAgICAgICAgICAgICAgIGxvZygndHJhY2UnLCBgU3R5bGVNYW5hZ2VyLmNvbXBpbGUoKTogY29tcGlsZWQgc3R5bGUgJHtrZXl9YCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXRjaChlcnJvcikge1xuICAgICAgICAgICAgICAgIGxvZygnZXJyb3InLCBgU3R5bGVNYW5hZ2VyLmNvbXBpbGUoKTogZXJyb3IgY29tcGlsaW5nIHN0eWxlICR7a2V5fTpgLCBlcnJvcik7XG5cbiAgICAgICAgICAgICAgICBzY2VuZS50cmlnZ2VyKCd3YXJuaW5nJywge1xuICAgICAgICAgICAgICAgICAgICB0eXBlOiAnc3R5bGVzJyxcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogYEVycm9yIGNvbXBpbGluZyBzdHlsZSAke2tleX1gLFxuICAgICAgICAgICAgICAgICAgICBzdHlsZSxcbiAgICAgICAgICAgICAgICAgICAgc2hhZGVyX2Vycm9yczogc3R5bGUucHJvZ3JhbSAmJiBzdHlsZS5wcm9ncmFtLnNoYWRlcl9lcnJvcnNcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGxvZygnZGVidWcnLCBgU3R5bGVNYW5hZ2VyLmNvbXBpbGUoKTogY29tcGlsZWQgYWxsIHN0eWxlc2ApO1xuICAgIH1cblxuICAgIC8vIEdldCBhbGwgc3R5bGVzIHdpdGggbWVzaCBkYXRhIGZvciBhIGdpdmVuIHRpbGVcbiAgICBzdGF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5keW5hbWljKGNvbnRleHQpO1xuXG4gICAgICAgICAgICBpZiAodHlwZW9mIHYgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgdiA9IFN0eWxlUGFyc2VyLmNvbG9yRm9yU3RyaW5nKHYpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodiAmJiB2WzNdID09IG51bGwpIHtcbiAgICAgICAgICAgICAgICB2WzNdID0gMTsgLy8gZGVmYXVsdCBhbHBoYVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHY7XG4gICAgICAgIH1cbiAgICAgICAgLy8gU2luZ2xlIHN0cmluZyBjb2xvclxuICAgICAgICBlbHNlIGlmICh0eXBlb2YgdmFsLnZhbHVlID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgdmFsLnN0YXRpYyA9IFN0eWxlUGFyc2VyLmNvbG9yRm9yU3RyaW5nKHZhbC52YWx1ZSk7XG4gICAgICAgICAgICByZXR1cm4gdmFsLnN0YXRpYztcbiAgICAgICAgfVxuICAgICAgICAvLyBBcnJheSBvZiB6b29tLWludGVycG9sYXRlZCBzdG9wcywgZS5nLiBbem9vbSwgY29sb3JdIHBhaXJzXG4gICAgICAgIGVsc2UgaWYgKHZhbC56b29tKSB7XG4gICAgICAgICAgICAvLyBQYXJzZSBhbnkgc3RyaW5nIGNvbG9ycyBpbnNpZGUgc3RvcHMsIHRoZSBmaXJzdCB0aW1lIHdlIGVuY291bnRlciB0aGlzIHByb3BlcnR5XG4gICAgICAgICAgICBpZiAoIXZhbC56b29tX3ByZXByb2Nlc3NlZCkge1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGk9MDsgaSA8IHZhbC52YWx1ZS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgdiA9IHZhbC52YWx1ZVtpXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHYgJiYgdHlwZW9mIHZbMV0gPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2WzFdID0gU3R5bGVQYXJzZXIuY29sb3JGb3JTdHJpbmcodlsxXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFsLnpvb21fcHJlcHJvY2Vzc2VkID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gQ2FsY3VsYXRlIGNvbG9yIGZvciBjdXJyZW50IHpvb21cbiAgICAgICAgICAgIHZhbC56b29tW2NvbnRleHQuem9vbV0gPSBVdGlscy5pbnRlcnBvbGF0ZShjb250ZXh0Lnpvb20sIHZhbC52YWx1ZSk7XG4gICAgICAgICAgICB2YWwuem9vbVtjb250ZXh0Lnpvb21dWzNdID0gdmFsLnpvb21bY29udGV4dC56b29tXVszXSB8fCAxOyAvLyBkZWZhdWx0IGFscGhhXG4gICAgICAgICAgICByZXR1cm4gdmFsLnpvb21bY29udGV4dC56b29tXTtcbiAgICAgICAgfVxuICAgICAgICAvLyBTaW5nbGUgYXJyYXkgY29sb3JcbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB2YWwuc3RhdGljID0gdmFsLnZhbHVlO1xuICAgICAgICAgICAgaWYgKHZhbC5zdGF0aWMgJiYgdmFsLnN0YXRpY1szXSA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgdmFsLnN0YXRpY1szXSA9IDE7IC8vIGRlZmF1bHQgYWxwaGFcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB2YWwuc3RhdGljO1xuICAgICAgICB9XG4gICAgfVxufTtcblxuU3R5bGVQYXJzZXIucGFyc2VDb2xvciA9IGZ1bmN0aW9uKHZhbCwgY29udGV4dCA9IHt9KSB7XG4gICAgaWYgKHR5cGVvZiB2YWwgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgdmFsID0gdmFsKGNvbnRleHQpO1xuICAgIH1cblxuICAgIC8vIFBhcnNlIENTUy1zdHlsZSBjb2xvcnNcbiAgICAvLyBUT0RPOiBjaGFuZ2UgYWxsIGNvbG9ycyB0byB1c2UgMC0yNTUgcmFuZ2UgaW50ZXJuYWxseSB0byBhdm9pZCBkaXZpZGluZyBhbmQgdGhlbiByZS1tdWx0aXBseWluZyBpbiBnZW9tIGJ1aWxkZXJcbiAgICBpZiAodHlwZW9mIHZhbCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgdmFsID0gU3R5bGVQYXJzZXIuY29sb3JGb3JTdHJpbmcodmFsKTtcbiAgICB9XG4gICAgZWxzZSBpZiAoQXJyYXkuaXNBcnJheSh2YWwpICYmIEFycmF5LmlzQXJyYXkodmFsWzBdKSkge1xuICAgICAgICAvLyBBcnJheSBvZiB6b29tLWludGVycG9sYXRlZCBzdG9wcywgZS5nLiBbem9vbSwgY29sb3JdIHBhaXJzXG4gICAgICAgIGZvciAobGV0IGk9MDsgaSA8IHZhbC5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IHYgPSB2YWxbaV07XG4gICAgICAgICAgICBpZiAodHlwZW9mIHZbMV0gPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgdlsxXSA9IFN0eWxlUGFyc2VyLmNvbG9yRm9yU3RyaW5nKHZbMV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGNvbnRleHQuem9vbSkge1xuICAgICAgICAgICAgdmFsID0gVXRpbHMuaW50ZXJwb2xhdGUoY29udGV4dC56b29tLCB2YWwpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gRGVmYXVsdHNcbiAgICBpZiAodmFsKSB7XG4gICAgICAgIC8vIGFscGhhXG4gICAgICAgIGlmICh2YWxbM10gPT0gbnVsbCkge1xuICAgICAgICAgICAgdmFsWzNdID0gMTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBlbHNlIHtcbiAgICAgICAgdmFsID0gWzAsIDAsIDAsIDFdO1xuICAgIH1cblxuICAgI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Agc2V0Rm9udCAoeyBmb250X2NzcywgZmlsbCwgc3Ryb2tlLCBzdHJva2Vfd2lkdGgsIHB4X3NpemUgfSkge1xuICAgICAgICB0aGlzLnB4X3NpemUgPSBweF9zaXplO1xuICAgICAgICBsZXQgY3R4ID0gdGhpcy5jb250ZXh0O1xuICAgICAgICBsZXQgZHByID0gVXRpbHMuZGV2aWNlX3BpeGVsX3JhdGlvO1xuXG4gICAgICAgIGlmIChzdHJva2UgJiYgc3Ryb2tlX3dpZHRoID4gMCkge1xuICAgICAgICAgICAgY3R4LnN0cm9rZVN0eWxlID0gc3Ryb2tlO1xuICAgICAgICAgICAgY3R4LmxpbmVXaWR0aCA9IHN0cm9rZV93aWR0aCAqIGRwcjtcbiAgICAgICAgfVxuICAgICAgICBjdHguZmlsbFN0eWxlID0gZmlsbDtcblxuICAgICAgICBjdHguZm9udCA9IGZvbnRfY3NzO1xuICAgICAgICBjdHgubWl0ZXJMaW1pdCA9IDI7XG4gICAgfVxuXG4gICAgdGV4dFNpemVzICh0ZXh0cykge1xuICAgICAgICBsZXQgZHByID0gVXRpbHMuZGV2aWNlX3BpeGVsX3JhdGlvO1xuICAgICAgICByZXR1cm4gRm9udE1hbmFnZXIubG9hZEZvbnRzKCkudGhlbigoKSA9PiB7XG4gICAgICAgICAgICBmb3IgKGxldCBzdHlsZSBpbiB0ZXh0cykge1xuICAgICAgICAgICAgICAgIENhbnZhc1RleHQudGV4dF9jYWNoZVtzdHlsZV0gPSBDYW52YXNUZXh0LnRleHRfY2FjaGVbc3R5bGVdIHx8IHt9O1xuXG4gICAgICAgICAgICAgICAgbGV0IHRleHRfaW5mb3MgPSB0ZXh0c1tzdHlsZV07XG4gICAgICAgICAgICAgICAgbGV0IGZpcnN0ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBsZXQgc3BhY2Vfd2lkdGg7XG5cbiAgICAgICAgICAgICAgICBmb3IgKGxldCB0ZXh0IGluIHRleHRfaW5mb3MpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRleHRfaW5mbyA9IHRleHRfaW5mb3NbdGV4dF07XG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZXh0X3NldHRpbmdzID0gdGV4dF9pbmZvLnRleHRfc2V0dGluZ3M7XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKGZpcnN0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEZvbnQodGV4dF9zZXR0aW5ncyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBzcGFjZV93aWR0aCA9IHRoaXMuY29udGV4dC5tZWFzdXJlVGV4dCgnICcpLndpZHRoIC8gZHByO1xuICAgICAgICAgICAgICAgICAgICAgICAgZmlyc3QgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIHRleHRfaW5mby5zcGFjZV93aWR0aCA9IHNwYWNlX3dpZHRoO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICh0ZXh0X3NldHRpbmdzLmNhbl9hcnRpY3VsYXRlKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzZWdtZW50cyA9IHNwbGl0TGFiZWxUZXh0KHRleHQpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0X2luZm8uc2VnbWVudHMgPSBzZWdtZW50cztcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRfaW5mby5zaXplID0gW107XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgc2VnbWVudHMubGVuZ3RoOyBpKyspe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzZWdtZW50ID0gc2VnbWVudHNbaV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFDYW52YXNUZXh0LnRleHRfY2FjaGVbc3R5bGVdW3NlZ21lbnRdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENhbnZhc1RleHQudGV4dF9jYWNoZVtzdHlsZV1bc2VnbWVudF0gPSB0aGlzLnRleHRTaXplKHNlZ21lbnQsIHRleHRfc2V0dGluZ3MpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYW52YXNUZXh0LmNhY2hlX3N0YXRzLm1pc3NlcysrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2FudmFzVGV4dC5jYWNoZV9zdGF0cy5oaXRzKys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHRfaW5mby5zaXplLnB1c2goQ2FudmFzVGV4dC50ZXh0X2NhY2hlW3N0eWxlXVtzZWdtZW50XS5zaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghQ2FudmFzVGV4dC50ZXh0X2NhY2hlW3N0eWxlXVt0ZXh0XSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIENhbnZhc1RleHQudGV4dF9jYWNoZVtzdHlsZV1bdGV4dF0gPSB0aGlzLnRleHRTaXplKHRleHQsIHRleHRfc2V0dGluZ3MpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIENhbnZhc1RleHQuY2FjaGVfc3RhdHMubWlzc2VzKys7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYW52YXNUZXh0LmNhY2hlX3N0YXRzLmhpdHMrKztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIE9ubHkgc2VuZCB0ZXh0IHNpemVzIGJhY2sgdG8gd29ya2V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HRleHR1cmVfc2l6ZSwgdGlsZV9rZXkpIHtcbiAgICAgICAgZm9yIChsZXQgc3R5bGUgaW4gdGV4dHMpIHtcbiAgICAgICAgICAgIGxldCB0ZXh0X2luZm9zID0gdGV4dHNbc3R5bGVdO1xuICAgICAgICAgICAgbGV0IGZpcnN0ID0gdHJ1ZTtcblxuICAgICAgICAgICAgZm9yIChsZXQgdGV4dCBpbiB0ZXh0X2luZm9zKSB7XG4gICAgICAgICAgICAgICAgbGV0IHRleHRfaW5mbyA9IHRleHRfaW5mb3NbdGV4dF07XG4gICAgICAgICAgICAgICAgbGV0IHRleHRfc2V0dGluZ3MgPSB0ZXh0X2luZm8udGV4dF9zZXR0aW5ncztcblxuICAgICAgICAgICAgICAgIC8vIHNldCBmb250IG9uIGZpcnN0IG9jY3VyZW5jZSBvZiBuZXcgZm9udCBzdHlsZVxuICAgICAgICAgICAgICAgIGlmIChmaXJzdCkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEZvbnQodGV4dF9zZXR0aW5ncyk7XG4gICAgICAgICAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKHRleHRfc2V0dGluZ3MuY2FuX2FydGljdWxhdGUpe1xuICAgICAgICAgICAgICAgICAgICBsZXQgd29yZHMgPSB0ZXh0X2luZm8uc2VnbWVudHM7XG4gICAgICAgICAgICAgICAgICAgIHRleHRfaW5mby50ZXhjb29yZHMgPSBbXTtcblxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHdvcmRzLmxlbmd0aDsgaSsrKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB3b3JkID0gd29yZHNbaV07XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGV4Y29vcmQ7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChDYW52YXNUZXh0LnRleGNvb3JkX2NhY2hlW3RpbGVfa2V5XVtzdHlsZV1bd29yZF0udGV4Y29vcmQpe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleGNvb3JkID0gQ2FudmFzVGV4dC50ZXhjb29yZF9jYWNoZVt0aWxlX2tleV1bc3R5bGVdW3dvcmRdLnRleGNvb3JkO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRleHR1cmVfcG9zaXRpb24gPSBDYW52YXNUZXh0LnRleGNvb3JkX2NhY2hlW3RpbGVfa2V5XVtzdHlsZV1bd29yZF0udGV4dHVyZV9wb3NpdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc2l6ZSA9IENhbnZhc1RleHQudGV4dF9jYWNoZVtzdHlsZV1bd29yZF0uc2l6ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbGluZSA9IENhbnZhc1RleHQudGV4dF9jYWNoZVtzdHlsZV1bd29yZF0ubGluZXM7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRyYXdUZXh0TXVsdGlMaW5lKGxpbmUsIHRleHR1cmVfcG9zaXRpb24sIHNpemUsIHRleHRfc2V0dGluZ3MpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4Y29vcmQgPSBUZXh0dXJlLmdldFRleGNvb3Jkc0ZvclNwcml0ZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dHVyZV9wb3NpdGlvbixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZS50ZXh0dXJlX3NpemUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHR1cmVfc2l6ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYW52YXNUZXh0LnRleGNvb3JkX2NhY2hlW3RpbGVfa2V5XVtzdHlsZV1bd29yZF0udGV4Y29vcmQgPSB0ZXhjb29yZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dF9pbmZvLnRleGNvb3Jkcy5wdXNoKHRleGNvb3JkKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxpbmVzID0gQ2FudmFzVGV4dC50ZXh0X2NhY2hlW3N0eWxlXVt0ZXh0XS5saW5lczsgLy8gZ2V0IHByZXZpb3VzbHkgY29tcHV0ZWQgbGluZXMgb2YgdGV4dFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBhbGlnbiBpbiB0ZXh0X2luZm8uYWxpZ24pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZHJhd1RleHRNdWx0aUxpbmUobGluZXMsIHRleHRfaW5mby5hbGlnblthbGlnbl0udGV4dHVyZV9wb3NpdGlvbiwgdGV4dF9pbmZvLnNpemUsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJva2U6IHRleHRfc2V0dGluZ3Muc3Ryb2tlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cm9rZV93aWR0aDogdGV4dF9zZXR0aW5ncy5zdHJva2Vfd2lkdGgsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNmb3JtOiB0ZXh0X3NldHRpbmdzLnRyYW5zZm9ybSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGlnbjogYWxpZ25cbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0X2luZm8uYWxpZ25bYWxpZ25dLnRleGNvb3JkcyA9IFRleHR1cmUuZ2V0VGV4Y29vcmRzRm9yU3ByaXRlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHRfaW5mby5hbGlnblthbGlnbl0udGV4dHVyZV9wb3NpdGlvbixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0X2luZm8uc2l6ZS50ZXh0dXJlX3NpemUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dHVyZV9zaXplXG4gICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gUGxhY2UgdGV4dCBsYWJlbHMgd2l0aGluIGFuIGF0bGFzIG9mIHRoZSBnaXZlbiBtYXggc2l6ZVxuICAgIHNldFRleHR1cmVUZXh0UG9zaXRpb25zICh0ZXh0cywgbWF4X3RleHR1cmVfc2l6ZSwgdGlsZV9rZXkpIHtcbiAgICAgICAgaWYgKCFDYW52YXNUZXh0LnRleGNvb3JkX2NhY2hlW3RpbGVfa2V5XSkge1xuICAgICAgICAgICAgQ2FudmFzVGV4dC50ZXhjb29yZF9jYWNoZVt0aWxlX2tleV0gPSB7fTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEtlZXAgdHJhY2sgb2YgY29sdW1uIHdpZHRoXG4gICAgICAgIGxldCBjb2x1bW5fd2lkdGggPSAwO1xuXG4gICAgICAgIC8vIExheW91dCBsYWJlbHMsIHN0YWNrZWQgaW4gY29sdW1uc1xuICAgICAgICBsZXQgY3ggPSAwLCBjeSA9IDA7IC8vIGN1cnJlbnQgeC95IHBvc2l0aW9uIGluIGF0bGFzXG4gICAgICAgIGxldCBoZWlnaHQgPSAwOyAgICAgLy8gb3ZlcmFsbCBhdGxhcyBoZWlnaHRcbiAgICAgICAgZm9yIChsZXQgc3R5bGUgaW4gdGV4dHMpIHtcbiAgICAgICAgICAgIGlmICghQ2FudmFzVGV4dC50ZXhjb29yZF9jYWNoZVt0aWxlX2tleV1bc3R5bGVdKSB7XG4gICAgICAgICAgICAgICBDYW52YXNUZXh0LnRleGNvb3JkX2NhY2hlW3RpbGVfa2V5XVtzdHlsZV0gPSB7fTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgbGV0IHRleHRfaW5mb3MgPSB0ZXh0c1tzdHlsZV07XG5cbiAgICAgICAgICAgIGZvciAobGV0IHRleHQgaW4gdGV4dF9pbmZvcykge1xuICAgICAgICAgICAgICAgIGxldCB0ZXh0X2luZm8gPSB0ZXh0X2luZm9zW3RleHRdO1xuXG4gICAgICAgICAgICAgICAgaWYgKHRleHRfaW5mby50ZXh0X3NldHRpbmdzLmNhbl9hcnRpY3VsYXRlKXtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRleHR1cmVfcG9zaXRpb247XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGV4dF9pbmZvLnNpemUubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB3b3JkID0gdGV4dF9pbmZvLnNlZ21lbnRzW2ldO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUNhbnZhc1RleHQudGV4Y29vcmRfY2FjaGVbdGlsZV9rZXldW3N0eWxlXVt3b3JkXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzaXplID0gdGV4dF9pbmZvLnNpemVbaV0udGV4dHVyZV9zaXplO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzaXplWzBdID4gY29sdW1uX3dpZHRoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtbl93aWR0aCA9IHNpemVbMF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjeSArIHNpemVbMV0gPCBtYXhfdGV4dHVyZV9zaXplKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHR1cmVfcG9zaXRpb24gPSBbY3gsIGN5XTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjeSArPSBzaXplWzFdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3kgPiBoZWlnaHQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodCA9IGN5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeyAvLyBzdGFydCBuZXcgY29sdW1uIGlmIHRhbGxlciB0aGFuIHRleHR1cmVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3ggKz0gY29sdW1uX3dpZHRoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW5fd2lkdGggPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjeSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHR1cmVfcG9zaXRpb24gPSBbY3gsIGN5XTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYW52YXNUZXh0LnRleGNvb3JkX2NhY2hlW3RpbGVfa2V5XVtzdHlsZV1bd29yZF0gPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHR1cmVfcG9zaXRpb246IHRleHR1cmVfcG9zaXRpb25cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvLyByZW5kZXJlZCBzaXplIGlzIHNhbWUgZm9yIGFsbCBhbGlnbm1lbnRzXG4gICAgICAgICAgICAgICAgICAgIGxldCBzaXplID0gdGV4dF9pbmZvLnNpemUudGV4dHVyZV9zaXplO1xuICAgICAgICAgICAgICAgICAgICBpZiAoc2l6ZVswXSA+IGNvbHVtbl93aWR0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29sdW1uX3dpZHRoID0gc2l6ZVswXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIC8vIGJ1dCBlYWNoIGFsaWdubWVudCBuZWVkcyB0byBiZSByZW5kZXJlZCBzZXBhcmF0ZWx5XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGFsaWduIGluIHRleHRfaW5mby5hbGlnbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN5ICsgc2l6ZVsxXSA8IG1heF90ZXh0dXJlX3NpemUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0X2luZm8uYWxpZ25bYWxpZ25dLnRleHR1cmVfcG9zaXRpb24gPSBbY3gsIGN5XTsgLy8gYWRkIGxhYmVsIHRvIGN1cnJlbnQgY29sdW1uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY3kgKz0gc2l6ZVsxXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3kgPiBoZWlnaHQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0ID0gY3k7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7IC8vIHN0YXJ0IG5ldyBjb2x1bW4gaWYgdGFsbGVyIHRoYW4gdGV4dHVyZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN4ICs9IGNvbHVtbl93aWR0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW5fd2lkdGggPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN5ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0X2luZm8uYWxpZ25bYWxpZ25dLnRleHR1cmVfcG9zaXRpb24gPSBbY3gsIGN5XTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBbY3ggKyBjb2x1bW5fd2lkdGgsIGhlaWdodF07IC8vIG92ZXJhbGwgYXRsYXMgc2l6ZVxuICAgIH1cblxuICAgIC8vIENhbGxlZCBiZWZvcmUgcmFzdGVyaXphdGlvblxuICAgIGFwcGx5VGV4dFRyYW5zZm9ybSAodGV4dCwgdHJhbnNmb3JtKSB7XG4gICAgICAgIGlmICh0cmFuc2Zvcm0gPT09ICdjYXBpdGFsaXplJykge1xuICAgICAgICAgICAgcmV0dXJuIHRleHQucmVwbGFjZSgvXFx3XFxTKi9nLCBmdW5jdGlvbiAodHh0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHR4dC5jaGFyQXQoMCkudG9VcHBlckNhc2UoKSArIHR4dC5zdWJzdHIoMSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh0cmFuc2Zvcm0gPT09ICd1cHBlcmNhc2UnKSB7XG4gICAgICAgICAgICByZXR1cm4gdGV4dC50b1VwcGVyQ2FzZSgpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHRyYW5zZm9ybSA9PT0gJ2xvd2VyY2FzZScpIHtcbiAgICAgICAgICAgIHJldHVybiB0ZXh0LnRvTG93ZXJDYXNlKCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRleHQ7XG4gICAgfVxuXG4gICAgLy8gQ29udmVydCBmb250IENTUy1zdHlsZSBzaXplICgnMTJweCcsICcxNHB0JywgJzEuNWVtJywgZXRjLikgdG8gcGl4ZWwgc2l6ZSAoYWRqdXN0ZWQgZm9yIGRldmljZSBwaXhlbCByYXRpbylcbiAgICAvLyBEZWZhdWx0cyB1bml0cyB0byBwaXhlbHMgaWYgbm90IHNwZWNpZmllZFxuICAgIHN0YXRpYyBmb250UGl4ZWxTaXplIChzaXplKSB7XG4gICAgICAgIGlmIChzaXplID09IG51bGwpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBzaXplID0gKHR5cGVvZiBzaXplID09PSAnc3RyaW5nJykgPyBzaXplIDogU3RyaW5nKHNpemUpOyAvLyBuZWVkIGEgc3RyaW5nIGZvciByZWdleFxuXG4gICAgICAgIGxldCBbLCBweF9zaXplLCB1bml0c10gPSBzaXplLm1hdGNoKENhbnZhc1RleHQuZm9udF9zaXplX3JlKSB8fCBbXTtcbiAgICAgICAgdW5pdHMgPSB1bml0cyB8fCAncHgnO1xuXG4gICAgICAgIGlmICh1bml0cyA9PT0gXCJlbVwiKSB7XG4gICAgICAgICAgICBweF9zaXplICo9IDE2O1xuICAgICAgICB9IGVsc2UgaWYgKHVuaXRzID09PSBcInB0XCIpIHtcbiAgICAgICAgICAgIHB4X3NpemUgLz0gMC43NTtcbiAgICAgICAgfSBlbHNlIGlmICh1bml0cyA9PT0gXCIlXCIpIHtcbiAgICAgICAgICAgIHB4X3NpemUgLz0gNi4yNTtcbiAgICAgICAgfVxuXG4gICAgICAgIHB4X3NpemUgPSBwYXJzZUZsb2F0KHB4X3NpemUpO1xuICAgICAgICBweF9zaXplICo9IFV0aWxzLmRldmljZV9waXhlbF9yYXRpbztcbiAgICAgICAgcmV0dXJuIHB4X3NpemU7XG4gICAgfVxuXG4gICAgY2xlYXJUZXhjb29yZENhY2hlICh0aWxlX2tleSkge1xuICAgICAgICBDYW52YXNUZXh0LnRleGNvb3JkX2NhY2hlW3RpbGVfa2V5XSA9IHt9O1xuICAgIH1cblxufVxuXG4vLyBFeHRyYWN0IGZvbnQgc2l6ZSBhbmQgdW5pdHNcbkNhbnZhc1RleHQuZm9udF9zaXplX3JlID0gLygoPzpbMC05XSpcXC4p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FwidGV4dCB3cmFwXCIgYW5kIFwibWF4IGxpbmVcIiB2YWx1ZXNcbmNsYXNzIE11bHRpTGluZSB7XG4gICAgY29uc3RydWN0b3IgKGNvbnRleHQsIG1heF9saW5lcyA9IEluZmluaXR5LCB0ZXh0X3dyYXAgPSBJbmZpbml0eSkge1xuICAgICAgICB0aGlzLndpZHRoID0gMDtcbiAgICAgICAgdGhpcy5oZWlnaHQgPSAwO1xuICAgICAgICB0aGlzLmxpbmVzID0gW107XG5cbiAgICAgICAgdGhpcy5lbGxpcHNpcyA9ICcuLi4nO1xuICAgICAgICB0aGlzLmVsbGlwc2lzX3dpZHRoID0gY29udGV4dC5tZWFzdXJlVGV4dCh0aGlzLmVsbGlwc2lzKS53aWR0aDtcblxuICAgICAgICB0aGlzLm1heF9saW5lcyA9IG1heF9saW5lcztcbiAgICAgICAgdGhpcy50ZXh0X3dyYXAgPSB0ZXh0X3dyYXA7XG4gICAgICAgIHRoaXMuY29udGV4dCA9IGNvbnRleHQ7XG4gICAgfVxuXG4gICAgY3JlYXRlTGluZSAobGluZV9oZWlnaHQpe1xuICAgICAgICBpZiAodGhpcy5saW5lcy5sZW5ndGggPCB0aGlzLm1heF9saW5lcyl7XG4gICAgICAgICAgICByZXR1cm4gbmV3IExpbmUobGluZV9oZWlnaHQsIHRoaXMudGV4dF93cmFwKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHB1c2ggKGxpbmUpe1xuICAgICAgICBpZiAodGhpcy5saW5lcy5sZW5ndGggPCB0aGlzLm1heF9saW5lcyl7XG4gICAgICAgICAgICAvLyBtZWFzdXJlIGxpbmUgd2lkdGhcbiAgICAgICAgICAgIGxldCBsaW5lX3dpZHRoID0gdGhpcy5jb250ZXh0Lm1lYXN1cmVUZXh0KGxpbmUudGV4dCkud2lkdGg7XG4gICAgICAgICAgICBsaW5lLndpZHRoID0gbGluZV93aWR0aDtcblxuICAgICAgICAgICAgaWYgKGxpbmVfd2lkdGggPiB0aGlzLndpZHRoKXtcbiAgICAgICAgICAgICAgICB0aGlzLndpZHRoID0gTWF0aC5jZWlsKGxpbmVfd2lkdGgpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBhZGQgdG8gbGluZXMgYW5kIGluY3JlbWVudCBoZWlnaHRcbiAgICAgICAgICAgIHRoaXMubGluZXMucHVzaChsaW5lKTtcbiAgICAgICAgICAgIHRoaXMuaGVpZ2h0ICs9IGxpbmUuaGVpZ2h0O1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmFkZEVsbGlwc2lzKCk7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBwdXNoZXMgdG8gdGhlIGxpbmVzIGFycmF5IGFuZCByZXR1cm5zIGEgbmV3IGxpbmUgaWYgcG9zc2libGUgKGZhbHNlIG90aGVyd2lzZSlcbiAgICBhZHZhbmNlIChsaW5lLCBsaW5lX2hlaWdodCkge1xuICAgICAgICBsZXQgY2FuX3B1c2ggPSB0aGlzLnB1c2gobGluZSk7XG4gICAgICAgIGlmIChjYW5fcHVzaCl7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5jcmVhdGVMaW5lKGxpbmVfaGVpZ2h0KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGFkZEVsbGlwc2lzICgpe1xuICAgICAgICBsZXQgbGFzdF9saW5lID0gdGhpcy5saW5lc1t0aGlzLmxpbmVzLmxlbmd0aCAtIDFdO1xuXG4gICAgICAgIGxhc3RfbGluZS5hcHBlbmQodGhpcy5lbGxpcHNpcyk7XG4gICAgICAgIGxhc3RfbGluZS53aWR0aCArPSB0a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G4gICAgICAgIGxldCBtdWx0aWxpbmUgPSBuZXcgTXVsdGlMaW5lKGN0eCwgbWF4X2xpbmVzLCB0ZXh0X3dyYXApO1xuICAgICAgICBsZXQgbGluZSA9IG11bHRpbGluZS5jcmVhdGVMaW5lKGxpbmVfaGVpZ2h0KTtcblxuICAgICAgICAvLyBGaXJzdCBpdGVyYXRlIG9uIHNwYWNlLWJyZWFrIGdyb3VwcyAod2lsbCBiZSBvbmUgaWYgbWF4IGxpbmUgbGVuZ3RoIG9mZiksIHRoZW4gaXRlcmF0ZSBvbiBsaW5lLWJyZWFrIGdyb3Vwc1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHdvcmRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYnJlYWtzID0gd29yZHNbaV0uc3BsaXQoJ1xcbicpOyAvLyBzcGxpdCBvbiBsaW5lIGJyZWFrc1xuICAgICAgICAgICAgbGV0IG5ld19saW5lID0gKGkgPT09IDApID8gdHJ1ZSA6IGZhbHNlO1xuXG4gICAgICAgICAgICBmb3IgKGxldCBuPTA7IG4gPCBicmVha3MubGVuZ3RoOyBuKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoIWxpbmUpe1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBsZXQgd29yZCA9IGJyZWFrc1tuXS50cmltKCk7XG5cbiAgICAgICAgICAgICAgICBpZiAoIXdvcmQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgbGV0IHNwYWNlZF93b3JkID0gKG5ld19saW5lKSA/IHdvcmQgOiAnICcgKyB3b3JkO1xuXG4gICAgICAgICAgICAgICAgLy8gaWYgYWRkaW5nIGN1cnJlbnQgd29yZCB3b3VsZCBvdmVyZmxvdywgYWRkIGEgbmV3IGxpbmUgaW5zdGVhZFxuICAgICAgICAgICAgICAgIC8vIGZpcnN0IHdvcmQgKGkgPT09IDApIGFsd2F5cyBhcHBlbmRzXG4gICAgICAgICAgICAgICAgaWYgKHRleHRfd3JhcCAmJiBpID4gMCAmJiBsaW5lLmV4Y2VlZHNUZXh0d3JhcChzcGFjZWRfd29yZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgbGluZSA9IG11bHRpbGluZS5hZHZhbmNlKGxpbmUsIGxpbmVfaGVpZ2h0KTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFsaW5lKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGxpbmUuYXBwZW5kKHdvcmQpO1xuICAgICAgICAgICAgICAgICAgICBuZXdfbGluZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBsaW5lLmFwcGVuZChzcGFjZWRfd29yZCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gaWYgbGluZSBicmVha3MgcHJlc2VudCwgYWRkIG5ldyBsaW5lICh1bmxlc3Mgb24gbGFzdCBsaW5lKVxuICAgICAgICAgICAgICAgIGlmIChuIDwgYnJlYWtzLmxlbmd0aCAtIDEpIHtcbiAgICAgICAgICAgICAgICAgICAgbGluZSA9IG11bHRpbGluZS5hZHZhbmNlKGxpbmUsIGxpbmVfaGVpZ2h0KTtcbiAgICAgICAgICAgICAgICAgICAgbmV3X2xpbmUgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGkgPT09IHdvcmRzLmxlbmd0aCAtIDEpe1xuICAgICAgICAgICAgICAgIG11bHRpbGluZS5maW5pc2gobGluZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG11bHRpbGluZTtcbiAgICB9XG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T0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgIE9iamVjdC5hc3NpZ24ob3B0aW9ucywgZmFjZSk7XG5cbiAgICAgICAgICAgIC8vIElmIFVSTCBpcyBkZWZpbmVkLCBpbmplY3QgZm9udCBpbnRvIGRvY3VtZW50XG4gICAgICAgICAgICBpZiAodHlwZW9mIGZhY2UudXJsID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGluamVjdCA9IHRoaXMuaW5qZWN0Rm9udEZhY2Uob3B0aW9ucyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBXYWl0IGZvciBmb250IHRvIGxvYWRcbiAgICAgICAgbGV0IG9ic2VydmVyID0gbmV3IEZvbnRGYWNlT2JzZXJ2ZXIoZmFtaWx5LCBvcHRpb25zKTtcbiAgICAgICAgcmV0dXJuIGluamVjdC50aGVuKCgpID0+IG9ic2VydmVyLmxvYWQoKSkudGhlbihcbiAgICAgICAgICAgICgpID0+IHtcbiAgICAgICAgICAgICAgICAvLyBQcm9taXNlIHJlc29sdmVzLCBmb250IGlzIGF2YWlsYWJsZVxuICAgICAgICAgICAgICAgIGxvZygnZGVidWcnLCBgRm9udCBmYWNlICcke2ZhbWlseX0nIGlzIGF2YWlsYWJsZWAsIG9wdGlvbnMpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICgpID0+IHtcbiAgICAgICAgICAgICAgICAvLyBQcm9taXNlIHJlamVjdHMsIGZvbnQgaXMgbm90IGF2YWlsYWJsZVxuICAgICAgICAgICAgICAgIGxvZygnZGVidWcnLCBgRm9udCBmYWNlICcke2ZhbWlseX0nIGlzIE5PVCBhdmFpbGFibGVgLCBvcHRpb25zKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgKTtcbiAgICB9LFxuXG4gICAgLy8gTG9hZHMgYSBmb250IGZhY2UgdmlhIGVpdGhlciB0aGUgbmF0aXZlIEZvbnRGYWNlIEFQSSwgb3IgQ1NTIGluamVjdGlvblxuIC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ICAgICAgICAgICAgICBsZXQgc3RyID0gJyc7XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYnl0ZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ciArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKGJ5dGVzW2ldKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2RhdGE6Zm9udC9vcGVudHlwZTtiYXNlNjQsJyArIGJ0b2Eoc3RyKTsgLy8gYmFzZTY0IGVuY29kZSBhcyBkYXRhIFVSTFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHByZXByb2Nlc3MudGhlbihkYXRhID0+IHtcbiAgICAgICAgICAgIGlmICh0aGlzLnN1cHBvcnRzX25hdGl2ZV9mb250X2xvYWRpbmcpIHtcbiAgICAgICAgICAgICAgICAvLyBVc2UgbmF0aXZlIEZvbnRGYWNlIEFQSVxuICAgICAgICAgICAgICAgIGxldCBmYWNlO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZGF0YSA9PT0gJ3N0cmluZycpIHsgLy8gYWRkIGFzIFVSTFxuICAgICAgICAgICAgICAgICAgICBmYWNlID0gbmV3IEZvbnRGYWNlKGZhbWlseSwgYHVybCgke2VuY29kZVVSSShkYXRhKX0pYCwgeyB3ZWlnaHQsIHN0eWxlIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChkYXRhIGluc3RhbmNlb2YgVWludDhBcnJheSkgeyAvLyBhZGQgYXMgYmluYXJ5IGRhdGFcbiAgICAgICAgICAgICAgICAgICAgZmFjZSA9IG5ldyBGb250RmFjZShmYW1pbHksIGRhdGEsIHsgd2VpZ2h0LCBzdHlsZSB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZG9jdW1lbnQuZm9udHMuYWRkKGZhY2UpO1xuICAgICAgICAgICAgICAgIGxvZygndHJhY2UnLCAnQWRkaW5nIEZvbnRGYWNlIHRvIGRvY3VtZW50LmZvbnRzOicsIGZhY2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gVXNlIENTUyBpbmplY3Rpb25cbiAgICAgICAgICAgICAgICBsZXQgY3NzID0gYFxuICAgICAgICAgICAgICAgICAgICBAZm9udC1mYWNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtZmFtaWx5OiAnJHtmYW1pbHl9JztcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtd2VpZ2h0OiAke3dlaWdodCB8fCAnbm9ybWFsJ307XG4gICAgICAgICAgICAgICAgICAgICAgICBmb250LXN0eWxlOiAke3N0eWxlIHx8ICdub3JtYWwnfTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNyYzogdXJsKCR7ZW5jb2RlVVJJKGRhdGEpfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBgO1xuXG4gICAgICAgICAgICAgICAgbGV0IHN0eWxlX2VsID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnc3R5bGUnKTtcbiAgICAgICAgICAgICAgICBzdHlsZV9lbC5hcHBlbmRDaGlsZChkb2N1bWVudC5jcmVhdGVUZXh0Tm9kZShcIlwiKSk7XG4gICAgICAgICAgICAgICAgZG9jdW1lbnQuaGVhZC5hcHBlbmRDaGlsZChzdHlsZV9lbCk7XG4gICAgICAgICAgICAgICAgc3R5bGVfZWwuc2hlZXQuaW5zZXJ0UnVsZShjc3MsIDApO1xuICAgICAgICAgICAgICAgIGxvZygndHJhY2UnLCAnSW5qZWN0aW5nIENTUyBmb250IGZhY2U6JywgY3NzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfVxuXG59O1xuXG5leHBvcnQgZGVmY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gocSk7XG5cbiAgICAgICAgLy8gUmVnaXN0ZXIgd2l0aCBjb2xsaXNpb24gbWFuYWdlclxuICAgICAgICBDb2xsaXNpb24uYWRkU3R5bGUodGhpcy5uYW1lLCB0aWxlLmtleSk7XG4gICAgfSxcblxuICAgIC8vIE92ZXJyaWRlXG4gICAgc3RhcnREYXRhICh0aWxlKSB7XG4gICAgICAgIHRoaXMucXVldWVzW3RpbGUua2V5XSA9IFtdO1xuICAgICAgICByZXR1cm4gU3R5bGUuc3RhcnREYXRhLmNhbGwodGhpcywgdGlsZSk7XG4gICAgfSxcblxuICAgIC8vIE92ZXJyaWRlXG4gICAgZW5kRGF0YSAodGlsZSkge1xuICAgICAgICByZXR1cm4gdGhpcy5wcmVwYXJlVGV4dExhYmVscyh0aWxlLCB0aGlzLm5hbWUsIHRoaXMucXVldWVzW3RpbGUua2V5XSkuXG4gICAgICAgICAgICB0aGVuKGxhYmVscyA9PiB0aGlzLmNvbGxpZGVBbmRSZW5kZXJUZXh0TGFiZWxzKHRpbGUsIHRoaXMubmFtZSwgbGFiZWxzKSkuXG4gICAgICAgICAgICB0aGVuKCh7IGxhYmVscywgdGV4dHMsIHRleHR1cmUgfSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmICh0ZXh0cykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnRleHRzW3RpbGUua2V5XSA9IHRleHRzO1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIEJ1aWxkIHF1ZXVlZCBmZWF0dXJlc1xuICAgICAgICAgICAgICAgICAgICBsYWJlbHMuZm9yRWFjaChxID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ZXh0X3NldHRpbmdzX2tleSA9IHEudGV4dF9zZXR0aW5nc19rZXk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGV4dF9pbmZvID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnRleHRzW3RpbGUua2V5XVt0ZXh0X3NldHRpbmdzX2tleV0gJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnRleHRzW3RpbGUua2V5XVt0ZXh0X3NldHRpbmdzX2tleV1bcS50ZXh0XTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2V0dXAgc3R5bGluZyBvYmplY3QgZXhwZWN0ZWQgYnkgU3R5bGUgY2xhc3NcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdHlsZSA9IHRoaXMuZmVhdHVyZV9zdHlsZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlLmxhYmVsID0gcS5sYWJlbDtcblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRleHRfaW5mby50ZXh0X3NldHRpbmdzLmNhbl9hcnRpY3VsYXRlKXtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB1bnBhY2sgbG9naWNhbCBzaXplcyBvZiBlYWNoIHNlZ21lbnQgaW50byBhbiBhcnJheSBmb3IgdGhlIHN0eWxlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGUuc2l6ZSA9IHRleHRfaW5mby5zaXplLm1hcChmdW5jdGlvbihzaXplKXsgcmV0dXJuIHNpemUubG9naWNhbF9zaXplOyB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHlsZS50ZXhjb29yZHMgPSB0ZXh0X2luZm8udGV4Y29vcmRzO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGUuc2l6ZSA9IHRleHRfaW5mby5zaXplLmxvZ2ljYWxfc2l6ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHlsZS5hbmdsZSA9IHEubGFiZWwuYW5nbGUgfHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHlsZS50ZXhjb29yZHMgPSB0ZXh0X2luZm8uYWxpZ25bcS5sYWJlbC5hbGlnbl0udGV4Y29vcmRzO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBTdHlsZS5hZGRGZWF0dXJlLmNhbGwodGhpcywgcS5mZWF0dXJlLCBxLmRyYXcsIHEuY29udGV4dCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLmZyZWVUZXh0KHRpbGUpO1xuXG4gICAgICAgICAgICAgICAgLy8gRmluaXNoIHRpbGUgbWVzaFxuICAgICAgICAgICAgICAgIHJldHVybiBTdHlsZS5lbmREYXRhLmNhbGwodGhpcywgdGlsZSkudGhlbih0aWxlX2RhdGEgPT4ge1xuICAgICAgICAgICAgICAgICAgICAvLyBBdHRhY2ggdGlsZS1zcGVjaWZpYyBsYWJlbCBhdGxhcyB0byBtZXNoIGFzIGEgdGV4dHVyZSB1bmlmb3JtXG4gICAgICAgICAgICAgICAgICAgIGlmICh0ZXh0dXJlICYmIHRpbGVfZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGlsZV9kYXRhLnVuaWZvcm1zLnVfdGV4dHVyZSA9IHRleHR1cmU7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aWxlX2RhdGEudGV4dHVyZXMucHVzaCh0ZXh0dXJlKTsgLy8gYXNzaWduIHRleHR1cmUgb3duZXJzaGlwIHRvIHRpbGVcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aWxlX2RhdGE7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgIH0sXG5cbiAgICAvLyBTZXRzIHVwIGNhY2hpbmcgZm9yIGRyYXcgcHJvcGVydGllc1xuICAgIF9wcmVwcm9jZXNzIChkcmF3KSB7XG4gICAgICAgIHJldHVybiB0aGlzLnByZXByb2Nlc3NUZXh0KGRyYXcpO1xuICAgIH0sXG5cbiAgIC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YWJlbHModGlsZS5rZXksIHF1ZXVlKTtcbiAgICAgICAgfSk7XG4gICAgfSxcblxuICAgIGNvbGxpZGVBbmRSZW5kZXJUZXh0TGFiZWxzICh0aWxlLCBjb2xsaXNpb25fZ3JvdXAsIGxhYmVscykge1xuICAgICAgICBpZiAoIWxhYmVscykge1xuICAgICAgICAgICAgQ29sbGlzaW9uLmNvbGxpZGUoe30sIGNvbGxpc2lvbl9ncm91cCwgdGlsZS5rZXkpO1xuICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZSh7fSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gQ29sbGlzaW9uLmNvbGxpZGUobGFiZWxzLCBjb2xsaXNpb25fZ3JvdXAsIHRpbGUua2V5KS50aGVuKGxhYmVscyA9PiB7XG4gICAgICAgICAgICBpZiAodGlsZS5jYW5jZWxlZCkge1xuICAgICAgICAgICAgICAgIGxvZygndHJhY2UnLCBgc3RvcCB0aWxlIGJ1aWxkIGJlY2F1c2UgdGlsZSB3YXMgY2FuY2VsZWQ6ICR7dGlsZS5rZXl9LCBwb3N0LWNvbGxpZGUoKWApO1xuICAgICAgICAgICAgICAgIHJldHVybiB7fTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGxhYmVscy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4ge307XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGxldCB0ZXh0cyA9IHRoaXMudGV4dHNbdGlsZS5rZXldO1xuICAgICAgICAgICAgdGhpcy5jdWxsVGV4dFN0eWxlcyh0ZXh0cywgbGFiZWxzKTtcblxuICAgICAgICAgICAgLy8gc2V0IGFsaWdubWVudHNcbiAgICAgICAgICAgIGxhYmVscy5mb3JFYWNoKHEgPT4ge1xuICAgICAgICAgICAgICAgIGxldCB0ZXh0X3NldHRpbmdzX2tleSA9IHEudGV4dF9zZXR0aW5nc19rZXk7XG4gICAgICAgICAgICAgICAgbGV0I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bWJpbmF0aW9ucyB0byBhdm9pZCB1bm5lY2Vzc2FyeSByYXN0ZXJpemF0aW9uXG4gICAgY3VsbFRleHRTdHlsZXModGV4dHMsIGxhYmVscykge1xuICAgICAgICAvLyBDb3VudCBob3cgbWFueSB0aW1lcyBlYWNoIHRleHQvc3R5bGUgY29tYmluYXRpb24gaXMgdXNlZFxuICAgICAgICBmb3IgKGxldCBpPTA7IGkgPCBsYWJlbHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBsYWJlbCA9IGxhYmVsc1tpXTtcbiAgICAgICAgICAgIHRleHRzW2xhYmVsLnRleHRfc2V0dGluZ3Nfa2V5XVtsYWJlbC50ZXh0XS5yZWYrKztcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFJlbW92ZSB0ZXh0L3N0eWxlIGNvbWJpbmF0aW9ucyB0aGF0IGhhdmUgbm8gdmlzaWJsZSBsYWJlbHNcbiAgICAgICAgZm9yIChsZXQgc3R5bGUgaW4gdGV4dHMpIHtcbiAgICAgICAgICAgIGZvciAobGV0IHRleHQgaW4gdGV4dHNbc3R5bGVdKSB7XG4gICAgICAgICAgICAgICAgLy8gbm8gbGFiZWxzIGZvciB0aGlzIHRleHRcbiAgICAgICAgICAgICAgICBpZiAodGV4dHNbc3R5bGVdW3RleHRdLnJlZiA8IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHRleHRzW3N0eWxlXVt0ZXh0XTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKGxldCBzdHlsZSBpbiB0ZXh0cykge1xuICAgICAgICAgICAgLy8gbm8gbGFiZWxzIGZvciB0aGlzIHN0eWxlXG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXModGV4dHNbc3R5bGVdKS5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICBkZWxldGUgdGV4dHNbc3R5bGVdO1xuICAgICAgICAgICAgfVxuICA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G4gICAgICAgIHJldHVybiBbc291cmNlLm5hbWUsIHN0eWxlX3pvb20sIGNvb3Jkcy54LCBjb29yZHMueSwgY29vcmRzLnpdLmpvaW4oJy8nKTtcbiAgICB9XG5cbiAgICBzdGF0aWMgY29vcmRpbmF0ZUF0Wm9vbSh7eCwgeSwgeiwga2V5fSwgem9vbSkge1xuICAgICAgICBpZiAoeiAhPT0gem9vbSkge1xuICAgICAgICAgICAgbGV0IHpzY2FsZSA9IE1hdGgucG93KDIsIHogLSB6b29tKTtcbiAgICAgICAgICAgIHggPSBNYXRoLmZsb29yKHggLyB6c2NhbGUpO1xuICAgICAgICAgICAgeSA9IE1hdGguZmxvb3IoeSAvIHpzY2FsZSk7XG4gICAgICAgICAgICB6ID0gem9vbTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gVGlsZS5jb29yZCh7eCwgeSwgen0pO1xuICAgIH1cblxuICAgIHN0YXRpYyBjb29yZGluYXRlV2l0aE1heFpvb20oe3gsIHksIHp9LCBtYXhfem9vbSkge1xuICAgICAgICBpZiAobWF4X3pvb20gIT09IHVuZGVmaW5lZCAmJiB6ID4gbWF4X3pvb20pIHtcbiAgICAgICAgICAgIHJldHVybiBUaWxlLmNvb3JkaW5hdGVBdFpvb20oe3gsIHksIHp9LCBtYXhfem9vbSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIFRpbGUuY29vcmQoe3gsIHksIHp9KTtcbiAgICB9XG5cbiAgICBzdGF0aWMgY2hpbGRyZW5Gb3JDb29yZGluYXRlKHt4LCB5LCB6LCBrZXl9KSB7XG4gICAgICAgIGlmICghVGlsZS5jb29yZF9jaGlsZHJlbltrZXldKSB7XG4gICAgICAgICAgICB6Kys7XG4gICAgICAgICAgICB4ICo9IDI7XG4gICAgICAgICAgICB5ICo9IDI7XG4gICAgICAgICAgICBUaWxlLmNvb3JkX2NoaWxkcmVuW2tleV0gPSBbXG4gICAgICAgICAgICAgICAgVGlsZS5jb29yZCh7eCwgeSwgICAgIC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GxldCBtIGluIHRoaXMubWVzaGVzKSB7XG4gICAgICAgICAgICB0aGlzLm1lc2hlc1ttXS5kZXN0cm95KCk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5tZXNoZXMgPSB7fTtcblxuICAgICAgICB0aGlzLnRleHR1cmVzLmZvckVhY2godCA9PiBUZXh0dXJlLnJlbGVhc2UodCkpO1xuICAgICAgICB0aGlzLnRleHR1cmVzID0gW107XG5cbiAgICAgICAgdGhpcy5wcmV2aW91c190ZXh0dXJlcy5mb3JFYWNoKHQgPT4gVGV4dHVyZS5yZWxlYXNlKHQpKTtcbiAgICAgICAgdGhpcy5wcmV2aW91c190ZXh0dXJlcyA9IFtdO1xuICAgIH1cblxuICAgIGRlc3Ryb3koKSB7XG4gICAgICAgIHRoaXMud29ya2VyTWVzc2FnZSgnc2VsZi5yZW1vdmVUaWxlJywgdGhpcy5rZXkpO1xuICAgICAgICB0aGlzLmZyZWVSZXNvdXJjZXMoKTtcbiAgICAgICAgdGhpcy53b3JrZXIgPSBudWxsO1xuICAgIH1cblxuICAgIGJ1aWxkQXNNZXNzYWdlKCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAga2V5OiB0aGlzLmtleSxcbiAgICAgICAgICAgIHNvdXJjZTogdGhpcy5zb3VyY2UubmFtZSxcbiAgICAgICAgICAgIGNvb3JkczogdGhpcy5jb29yZHMsXG4gICAgICAgICAgICBtaW46IHRoaXMubWluLFxuICAgICAgICAgICAgbWF4OiB0aGlzLm1heCxcbiAgICAgICAgICAgIHVuaXRzX3Blcl9waXhlbDogdGhpcy51bml0c19wZXJfcGl4ZWwsXG4gICAgICAgICAgICBtZXRlcnNfcGVyX3BpeGVsOiB0aGlzLm1ldGVyc19wZXJfcGl4ZWwsXG4gICAgICAgICAgICBtZXRlcnNfcGVyX3BpeGVsX3NxOiB0aGlzLm1ldGVyc19wZXJfcGl4ZWxfc3EsXG4gICAgICAgICAgICB1bml0c19wZXJfbWV0ZXJfb3Zlcnp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sYXllclxuICAgICAgICBmb3IgKGxldCBsYXllcl9uYW1lIGluIGxheWVycykge1xuICAgICAgICAgICAgbGV0IGxheWVyID0gbGF5ZXJzW2xheWVyX25hbWVdO1xuICAgICAgICAgICAgLy8gU2tpcCBsYXllcnMgd2l0aCBubyBkYXRhIHNvdXJjZSBkZWZpbmVkXG4gICAgICAgICAgICBpZiAoIWxheWVyIHx8ICFsYXllci5jb25maWcuZGF0YSkge1xuICAgICAgICAgICAgICAgIGxvZygnd2FybicsIGBMYXllciAke2xheWVyX25hbWV9IHdhcyBkZWZpbmVkIHdpdGhvdXQgYSBnZW9tZXRyeSBkYXRhIHNvdXJjZSBhbmQgd2lsbCBub3QgYmUgcmVuZGVyZWQuYCk7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIFNvdXJjZSBuYW1lcyBkb24ndCBtYXRjaFxuICAgICAgICAgICAgaWYgKGxheWVyLmNvbmZpZy5kYXRhLnNvdXJjZSAhPT0gdGlsZS5zb3VyY2UpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gR2V0IGRhdGEgZm9yIG9uZSBvciBtb3JlIGxheWVycyBmcm9tIHNvdXJjZVxuICAgICAgICAgICAgbGV0IHNvdXJjZV9sYXllcnMgPSBUaWxlLmdldERhdGFGb3JTb3VyY2UoZGF0YSwgbGF5ZXIuY29uZmlnLmRhdGEsIGxheWVyX25hbWUpO1xuXG4gICAgICAgICAgICAvLyBSZW5kZXIgZmVhdHVyZXMgaW4gbGF5ZXJcbiAgICAgICAgICAgIGZvciAobGV0IHM9MDsgcyA8IHNvdXJjZV9sYXllcnMubGVuZ3RoOyBzKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgc291cmNlX2xheWVyID0gc291cmNlX2xheWVyc1tzXTtcbiAgICAgICAgICAgICAgICBsZXQgZ2VvbSA9IHNvdXJjZV9sYXllci5nZW9tO1xuICAgICAgICAgICAgICAgIGlmICghZ2VvbSkge1xuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmb3IgKGxldCBmID0gMDsgZiA8IGdlb20uZmVhdHVyZXMubGVuZ3RoOyBmKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZlYXR1cmUgPSBnZW9tLmZlYXR1cmVzW2ZdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZmVhdHVyZS5nZW9tZXRyeSA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsgLy8gc2tpcCBmZWF0dXJlcyB3L28gZ2VvbWV0cnkgKHZhbGlkIEdlb0pTT04pXG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBsZXQgY29udGV4dCA9IFN0eWxlUGFyc2VyLmdldEZlYXR1cmVQYXJzZUNvbnRleHQoZmVhdHVyZSwgdGlsZSwgZ2xvYmFsKTtcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC53aW5kaW5nID0gdGlsZS5kZWZhdWx0X3dpbmRpbmc7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQuc291cmNlID0gdGlsZS5zb3VyY2U7ICAgICAgICAvLyBhZGQgZGF0YSBzb3VyY2UgbmFtZVxuICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmxheWVyID0gc291cmNlX2xheWVyLmxheWVyOyAgLy8gYWRkIGRhdGEgc291cmNlIGxheWVyIG5hbWVcblxuICAgICAgICAgICAgICAgICAgICAvLyBHZXQgZHJhdyBncm91cHMgZm9yIHRoaXMgZmVhdHVyZVxuICAgICAgICAgICAgICAgICAgICBsZXQgZHJhd19ncm91cHMgPSBsYXllci5idWlsZERyYXdHcm91cHMoY29udGV4dCwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghZHJhd19ncm91cHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gUmVuZGVyIGRyYXcgZ3JvdXBzXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGdyb3VwX25hbWUgaW4gZHJhd19ncm91cHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBncm91cCA9IGRyYXdfZ3JvdXBzW2dyb3VwX25hbWVdO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFncm91cC52aXNpYmxlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIEFkZCB0byBzdHlsZVxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN0eWxlX25hbWUgPSBncm91cC5zdHlsZSB8fCBncm91cF9uYW1lO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN0eWxlID0gc3R5bGVzW3N0eWxlX25hbWVdO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXN0eWxlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCd3YXJuJywgYFN0eWxlICcke3N0eWxlX25hbWV9JyBub3QgZm91bmQsIHNraXBwaW5nIGxheWVyICcke2xheWVyX25hbWV9JzpgLCBncm91cCwgZmVhdHVyZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHQubGF5ZXJzID0gZ3JvdXAubGF5ZXJzOyAgLy8gYWRkIG1hdGNoaW5nIGRyYXcgbGF5ZXJzXG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlLmFkZEZlYXR1cmUoZmVhdHVyZSwgZ3JvdXAsIGNvbnRleHQpO1xuICAgICAgICAgIC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gKGFzIHRoZXkgZmluaXNoIGJ1aWxkaW5nKSxcbiAgICAvLyBncm91cGVkIGJ5IHRoZSBwcm92aWRlZCBmdW5jdGlvblxuICAgIHN0YXRpYyBzZW5kU3R5bGVHcm91cHModGlsZSwgc3R5bGVzLCB7IHNjZW5lX2lkIH0sIGdyb3VwX2J5KSB7XG4gICAgICAgIC8vIEdyb3VwIHN0eWxlc1xuICAgICAgICBsZXQgZ3JvdXBzID0ge307XG4gICAgICAgIHN0eWxlcy5mb3JFYWNoKHMgPT4ge1xuICAgICAgICAgICAgbGV0IGdyb3VwX25hbWUgPSBncm91cF9ieShzKTtcbiAgICAgICAgICAgIGdyb3Vwc1tncm91cF9uYW1lXSA9IGdyb3Vwc1tncm91cF9uYW1lXSB8fCBbXTtcbiAgICAgICAgICAgIGdyb3Vwc1tncm91cF9uYW1lXS5wdXNoKHMpO1xuICAgICAgICB9KTtcblxuICAgICAgICBpZiAoT2JqZWN0LmtleXMoZ3JvdXBzKS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBsZXQgcHJvZ3Jlc3MgPSB7IHN0YXJ0OiB0cnVlIH07XG4gICAgICAgICAgICB0aWxlLm1lc2hfZGF0YSA9IHt9O1xuXG4gICAgICAgICAgICBmb3IgKGxldCBncm91cF9uYW1lIGluIGdyb3Vwcykge1xuICAgICAgICAgICAgICAgIGxldCBncm91cCA9IGdyb3Vwc1tncm91cF9uYW1lXTtcblxuICAgICAgICAgICAgICAgIFByb21pc2UuYWxsKGdyb3VwLm1hcChzdHlsZSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzdHlsZS5lbmREYXRhKHRpbGUpLnRoZW4oc3R5bGVfZGF0YSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3R5bGVfZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbGUubWVzaF9kYXRhW3N0eWxlLm5hbWVdID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJ0ZXhfZGF0YTogc3R5bGVfZGF0YS52ZXJ0ZXhfZGF0YSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmVydGV4X2VsZW1lbnRzOiBzdHlsZV9kYXRhLnZlcnRleF9lbGVtZW50cyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pZm9ybXM6IHN0eWxlX2RhdGEudW5pZm9ybXMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHR1cmVzOiBzdHlsZV9kYXRhLnRleHR1cmVzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSkpXG4gICAgICAgICAgICAgICAgLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBsb2coJ3RyYWNlJywgYEZpbmlzaGVkIHN0eWxlIGdyb3VwICcke2dyb3VwX25hbWV9JyBmb3IgdGlsZSAke3RpbGUua2V5fWApO1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIENsZWFyIGdyb3VwIGFuZCBjaGVjayBpZiBhbGwgZ3JvdXBzIGZpbmlzaGVkXG4gICAgICAgICAgICAgICAgICAgIGdyb3Vwc1tncm91cF9uYW1lXSA9IFtdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMoZ3JvdXBzKS5ldmVyeShnID0+IGdyb3Vwc1tnXS5sZW5ndGggPT09IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9ncmVzcy5kb25lID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIC8vIFNlbmQgbWVzaGVzIHRvIG1haW4gdGhyZWFkXG4gICAgICAgICAgICAgICAgICAgIFdvcmtlckJyb2tlci5wb3N0TWVzc2FnZShcbiAgICAgICAgICAgICAgICAgICAgICAgIG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GlzdHNcbiAgICAgICAgICAgIGVsc2UgaWYgKCFzb3VyY2VfY29uZmlnLmxheWVyICYmIGRlZmF1bHRfbGF5ZXIpIHtcbiAgICAgICAgICAgICAgICBsYXllcnMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIGxheWVyOiBkZWZhdWx0X2xheWVyLFxuICAgICAgICAgICAgICAgICAgICBnZW9tOiBzb3VyY2VfZGF0YS5sYXllcnNbZGVmYXVsdF9sYXllcl1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIElmIGEgbGF5ZXIgaXMgc3BlY2lmaWVkIGJ5IG5hbWUsIHVzZSBpdFxuICAgICAgICAgICAgZWxzZSBpZiAodHlwZW9mIHNvdXJjZV9jb25maWcubGF5ZXIgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgbGF5ZXJzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBsYXllcjogc291cmNlX2NvbmZpZy5sYXllcixcbiAgICAgICAgICAgICAgICAgICAgZ2VvbTogc291cmNlX2RhdGEubGF5ZXJzW3NvdXJjZV9jb25maWcubGF5ZXJdXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBJZiBtdWx0aXBsZSBsYXllcnMgYXJlIHNwZWNpZmllZCBieSBuYW1lLCBjb21iaW5lIHRoZW1cbiAgICAgICAgICAgIGVsc2UgaWYgKEFycmF5LmlzQXJyYXkoc291cmNlX2NvbmZpZy5sYXllcikpIHtcbiAgICAgICAgICAgICAgICBzb3VyY2VfY29uZmlnLmxheWVyLmZvckVhY2gobGF5ZXIgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoc291cmNlX2RhdGEubGF5ZXJzW2xheWVyXSAmJiBzb3VyY2VfZGF0YS5sYXllcnNbbGF5ZXJdLmZlYXR1cmVzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsYXllcnMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGF5ZXIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2VvbTogc291cmNlX2RhdGEubGF5ZXJzW2xheWVyXVxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBsYXllcnM7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICAgQ2FsbGVkIG9uIG1haW4gdGhyZWFkIHdoZW4gYSB3ZWIgd29ya2VyIGNvbXBsZXRlcyBwcm9jZXNzaW5nXG4gICAgICAgZm9yIGEgc2luZ2xlIHRpbGUuXG4gICAgKi9cbiAgICBidWlsZE1lc2hlcyhzdHlsZXMsIHByb2dyZXNzKSB7XG4gICAgICAgIGlmICh0aGlzLmVycm9yKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICAvLyBEZWJ1Z1xuICAgICAgICB0aGlzLmRlYnVnLmdlb21ldHJpZXMgPSAwO1xuICAgICAgICB0aGlzLmRlYnVnLmJ1ZmZlcl9zaXplID0gMDtcblxuICAgICAgICAvLyBDcmVhdGUgVkJPc1xuICAgICAgICBsZXQgbWVzaGVzID0ge30sIHRleHR1cmVzID0gW107IC8vIG5ldyBkYXRhIHRvIGJlIGFkZGVkIHRvIHRpbGVcbiAgICAgICAgbGV0IG1lc2hfZGF0YSA9IHRoaXMubWVzaF9kYXRhO1xuICAgICAgICBpZiAobWVzaF9kYXRhKSB7XG4gICAgICAgICAgICBmb3IgKHZhciBzIGluIG1lc2hfZGF0YSkge1xuICAgICAgICAgICAgICAgIGlmIChtZXNoX2RhdGFbc10udmVydGV4X2RhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kZWJ1Zy5idWZmZXJfc2l6ZSArPSBtZXNoX2RhdGFbc10udmVydGV4X2RhdGEuYnl0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YCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dHVyZS5yZWxlYXNlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBVcGRhdGUgcmVsYXRpdmUgdG8gdmlld1xuICAgIHVwZGF0ZSAoKSB7XG4gICAgICAgIGxldCBjb29yZHMgPSB0aGlzLmNvb3JkcztcbiAgICAgICAgaWYgKGNvb3Jkcy56ICE9PSB0aGlzLnZpZXcuY2VudGVyLnRpbGUueikge1xuICAgICAgICAgICAgY29vcmRzID0gVGlsZS5jb29yZGluYXRlQXRab29tKGNvb3JkcywgdGhpcy52aWV3LmNlbnRlci50aWxlLnopO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuY2VudGVyX2Rpc3QgPSBNYXRoLmFicyh0aGlzLnZpZXcuY2VudGVyLnRpbGUueCAtIGNvb3Jkcy54KSArIE1hdGguYWJzKHRoaXMudmlldy5jZW50ZXIudGlsZS55IC0gY29vcmRzLnkpO1xuICAgIH1cblxuICAgIC8vIFNldCBhcyBhIHByb3h5IHRpbGUgZm9yIGFub3RoZXIgdGlsZVxuICAgIHNldFByb3h5Rm9yICh0aWxlKSB7XG4gICAgICAgIGlmICh0aWxlKSB7XG4gICAgICAgICAgICB0aGlzLnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgdGhpcy5wcm94eV9mb3IgPSB0aGlzLnByb3h5X2ZvciB8fCBbXTtcbiAgICAgICAgICAgIHRoaXMucHJveHlfZm9yLnB1c2godGlsZSk7XG4gICAgICAgICAgICB0aGlzLnByb3h5X2RlcHRoID0gMTsgLy8gZHJhdyBwcm94aWVzIGEgaGFsZi1sYXllciBiYWNrIChvcmRlciBpcyBzY2FsZWQgMnggdG8gYXZvaWQgaW50ZWdlciB0cnVuY2F0aW9uKVxuICAgICAgICAgICAgdG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AgIGlmICghcHJldl9jb29yZHMuZXZlcnkoKGMsIGkpID0+IG5ld19jb29yZHNbaV0gPT09IGMpKSB7XG4gICAgICAgICAgICAgICAgY29vcmRzX2NoYW5nZWQgPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy51cGRhdGVUaWxlU3RhdGVzKCk7XG4gICAgfVxuXG4gICAgdXBkYXRlVGlsZVN0YXRlcyAoKSB7XG4gICAgICAgIHRoaXMuZm9yRWFjaFRpbGUodGlsZSA9PiB7XG4gICAgICAgICAgICB0aGlzLnVwZGF0ZVZpc2liaWxpdHkodGlsZSk7XG4gICAgICAgICAgICB0aWxlLnVwZGF0ZSgpO1xuICAgICAgICB9KTtcblxuICAgICAgICB0aGlzLmxvYWRRdWV1ZWRDb29yZGluYXRlcygpO1xuICAgICAgICB0aGlzLnVwZGF0ZVByb3h5VGlsZXMoKTtcbiAgICAgICAgdGhpcy52aWV3LnBydW5lVGlsZXNGb3JWaWV3KCk7XG4gICAgfVxuXG4gICAgdXBkYXRlUHJveHlUaWxlcyAoKSB7XG4gICAgICAgIGlmICh0aGlzLnZpZXcuem9vbV9kaXJlY3Rpb24gPT09IDApIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIENsZWFyIHByZXZpb3VzIHByb3hpZXNcbiAgICAgICAgdGhpcy5mb3JFYWNoVGlsZSh0aWxlID0+IHRpbGUuc2V0UHJveHlGb3IobnVsbCkpO1xuXG4gICAgICAgIGxldCBwcm94eSA9IGZhbHNlO1xuICAgICAgICB0aGlzLmZvckVhY2hUaWxlKHRpbGUgPT4ge1xuICAgICAgICAgICAgaWYgKHRoaXMudmlldy56b29tX2RpcmVjdGlvbiA9PT0gMSkge1xuICAgICAgICAgICAgICAgIGlmICh0aWxlLnZpc2libGUgJiYgIXRpbGUuYnVpbHQgJiYgdGlsZS5jb29yZHMueiA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHAgPSB0aGlzLnB5cmFtaWQuZ2V0QW5jZXN0b3IodGlsZSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwLnNldFByb3h5Rm9yKHRpbGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcHJveHkgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAodGhpcy52aWV3Lnpvb21fZGlyZWN0aW9uID09PSAtMSkge1xuICAgICAgICAgICAgICAgIGlmICh0aWxlLnZpc2libGUgJiYgIXRpbGUuYnVpbHQpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSB0aGlzLnB5cmFtaWQuZ2V0RGVzY2VuZGFudHModGlsZSk7XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IHQgb2YgZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdC5zZXRQcm94eUZvcih0aWxlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb3h5ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgaWYgKCFwcm94eSkge1xuICAgICAgICAgICAgdGhpcy52aWV3Lnpvb21fZGlyZWN0aW9uID0gMDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHVwZGF0ZVZpc2liaWxpdHkodGlsZSkge1xuICAgICAgICB0aWxlLnZpc2libGUgPSBmYWxzZTtcbiAgICAgICAgaWYgKHRpbGUuc3R5bGVfem9vbSA9PT0gdGhpcy52aWV3LnRpbGVfem9vbSkge1xuICAgICAgICAgICAgaWYgKHRoaXMudmlzaWJsZV9jb29yZHNbdGlsZS5jb29yZHMua2V5XSkge1xuICAgICAgICAgICAgICAgIHRpbGUudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBicnV0ZSBmb3JjZVxuICAgICAgICAgICAgICAgIGZvciAobGV0IGtleSBpbiB0aGlzLnZpc2libGVfY29vcmRzKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChUaWxlLmlzRGVzY2VuZGFudCh0aWxlLmNvb3JkcywgdGhpcy52aXNpYmxlX2Nvb3Jkc1trZXldKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGlsZS52aXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gUmVtb3ZlIHRpbGVzIHRoYXQgYXJlbid0IHZpc2libGUsIGFuZCBmbGFnIHJlbWFpbmluZyB2aXNpYmxlIG9uZXMgdG8gYmUgdXBkYXRlZCAoZm9yIGxvYWRpbmcsIHByb3h5LCBldGMuKVxuICAgIHBydW5lVG9WaXNpYmxlVGlsZXMgKCkge1xuICAgICAgICB0aGlzLnJlbW92ZVRpbGVzKHRpbGUgPT4gIXRpbGUudmlzaWJsZSk7XG4gICAgfVxuXG4gICAgZ2V0UmVuZGVyYWJsZVRpbGVzKCkge1xuICAgICAgICBsZXQgdGlsZXMgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgdCBpbiB0aGlzLnRpbGVzKSB7XG4gICAgICAgICAgICBsZXQgdGlsZSA9IHRoaXMudGlsZXNbdF07XG4gICAgICAgICAgICBpZiAodGlsZS52aXNpYmxlICYmIHRpbGUubG9hZGVkKSB7XG4gICAgICAgICAgICAgICAgdGlsZXMucHVzaCh0aWxlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGlsZXM7XG4gICAgfVxuXG4gICAgaXNMb2FkaW5nVmlzaWJsZVRpbGVzKCkge1xuICAgICAgICByZXR1cm4gT2JqZWN0LmtleXModGhpcy50aWxlcykuc29tZShrID0+IHRoaXMudGlsZXNba10udmlzaWJsZSAmJiAhdGhpcy50aWxlc1trXS5idWlsdCk7XG4gICAgfVxuXG4gICAgLy8gUXVldWUgYSB0aWxlIGZvciBsb2FkXG4gICAgcXVldWVDb29yZGluYXRlKGNvb3Jkcykge1xuICAgICAgICB0aGlzLnF1ZXVlZF9jb29yZHNbdGhpcy5xdWV1ZWRfY29vcmRzLmxlbmd0aF0gPSBjb29yZHM7XG4gICAgfVxuXG4gICAgLy8gTG9hZCBhbGwgcXVldWVkIHRpbGVzXG4gICAgbG9hZFF1ZXVlZENvb3JkaW5hdGVzKCkge1xuICAgICAgICBpZiAodGhpcy5xdWV1ZWRfY29vcmRzLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gU29ydCBxdWV1ZWQgdGlsZXMgZnJvbSBjZW50ZXIgdGlsZVxuICAgICAgICB0aGlzLnF1ZXVlZF9jb29yZHMuc29ydCgoYSwgYikgPT4ge1xuICAgICAgICAgICAgbGV0IGFkID0gTWF0aC5hYnModGhpcy52aWV3LmNlbnRlci50aWxlLnggLSBhLngpICsgTWF0aC5hYnModGhpcy52aWV3LmNlbnRlci50aWxlLnkgLSBhLnkpO1xuICAgICAgICAgICAgbGV0IGJkID0gTWF0aC5hYnModGhpcy52aWV3LmNlbnRlci50aWxlLnggLSBiLngpICsgTWF0aC5hYnModGhpcy52aWV3LmNlbnRlci50aWxlLnkgLSBiLnkpO1xuICAgICAgICAgICAgcmV0dXJuIChiZCA+IGFkID8gLTEgOiAoYmQgPT09IGFkID8gMCA6IDEpKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMucXVldWVkX2Nvb3Jkcy5mb3JFYWNoKGNvb3JkcyA9PiB0aGlzLmxvYWRDb29yZGluYXRlKGNvb3JkcykpO1xuICAgICAgICB0aGlzLnF1ZXVlZF9jb29yZHMgPSBbXTtcbiAgICB9XG5cbiAgICAvLyBMb2FkIGFsbCB0aWxlcyB0byBjb3ZlciBhIGdpdmVuIGxvZ2ljYWwgdGlsZSBjb29yZGluYXRlXG4gICAgbG9hZENvb3JkaW5hdGUoY29vcmRzKSB7XG4gICAgICAgIC8vIFNraXAgaWYgbm90IGF0IGN1cnJlbnQgc2NlbmUgem9vbVxuICAgICAgICBpZiAoY29vcmRzLnogIT09IHRoaXMudmlldy5jZW50ZXIudGlsZS56KSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICAvLyBEZXRlcm1pbmUgbmVjZXNzYXJ5IHRpbGVzIGZvciBlYWNoIHNvdXJjZVxuICAgICAgICBmb3IgKGxldCBzIGluIHRoaXMuc2NlbmUuc291cmNlcykge1xuICAgICAgICAgICAgbGV0IHNvdXJjZSA9IHRoaXMuc2NlbmUuc291cmNlc1tzXTtcbiAgICAgICAgICAgIC8vIENoZWNrIGlmIGRhdGEgc291cmNlIHNob3VsZCBidWlsZCB0aGlzIHRpbGVcbiAgICAgICAgICAgIGlmICghc291cmNlLmJ1aWxkc19nZW9tZXRyeV90aWxlcyB8fCAhc291cmNlLmluY2x1ZGVzVGlsZShjb29yZHMsIHRoaXMudmlldy50aWxlX3pvb20pKSB7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGxldCBrZXkgPSBUaWxlLmtleShjb29yZHMsIHNvdXJjZSwgdGhpcy52aWV3LnRpbGVfem9vbSk7XG4gICAgICAgICAgICBpZiAoa2V5ICYmICF0aGlzLmhhc1RpbGUoa2V5KSkge1xuICAgICAgICAgICAgICAgIGxldCB0aWxlID0gVGlsZS5jcmVhdGUoe1xuICAgICAgICAgICAgICAgICAgICBzb3VyY2UsXG4gICAgICAgICAgICAgICAgICAgIGNvb3JkcyxcbiAgICAgICAgICAgICAgICAgICAgd29ya2VyOiB0aGl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B9XG5cbiAgICBhZGRUaWxlKHRpbGUpIHtcbiAgICAgICAgLy8gQWRkIHRhcmdldCB0aWxlXG4gICAgICAgIGxldCBrZXkgPSB0aWxlLmNvb3Jkcy5rZXk7XG4gICAgICAgIGxldCBjb29yZCA9IHRoaXMuY29vcmRzW2tleV07XG4gICAgICAgIGlmICghY29vcmQpIHtcbiAgICAgICAgICAgIGNvb3JkID0gdGhpcy5jb29yZHNba2V5XSA9IHsgZGVzY2VuZGFudHM6IDAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghY29vcmQuc291cmNlcykge1xuICAgICAgICAgICAgY29vcmQuc291cmNlcyA9IG5ldyBNYXAoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghY29vcmQuc291cmNlcy5nZXQodGlsZS5zb3VyY2UubmFtZSkpIHtcbiAgICAgICAgICAgIGNvb3JkLnNvdXJjZXMuc2V0KHRpbGUuc291cmNlLm5hbWUsIG5ldyBNYXAoKSk7XG4gICAgICAgIH1cbiAgICAgICAgY29vcmQuc291cmNlcy5nZXQodGlsZS5zb3VyY2UubmFtZSkuc2V0KHRpbGUuc3R5bGVfem9vbSwgdGlsZSk7XG5cbiAgICAgICAgLy8gSW5jcmVtZW50IHJlZmVyZW5jZSBjb3VudCB1cCB0aGUgdGlsZSBweXJhbWlkXG4gICAgICAgIGZvciAobGV0IHogPSB0aWxlLmNvb3Jkcy56IC0gMTsgeiA+PSAwOyB6LS0pIHtcbiAgICAgICAgICAgIGxldCB1cCA9IFRpbGUuY29vcmRpbmF0ZUF0Wm9vbSh0aWxlLmNvb3Jkcywgeik7XG4gICAgICAgICAgICBpZiAoIXRoaXMuY29vcmRzW3VwLmtleV0pIHtcbiAgICAgICAgICAgICAgICB0aGlzLmNvb3Jkc1t1cC5rZXldID0geyBkZXNjZW5kYW50czogMCB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy5jb29yZHNbdXAua2V5XS5kZXNjZW5kYW50cysrO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmVtb3ZlVGlsZSh0aWxlKSB7XG4gICAgICAgIC8vIFJlbW92ZSB0YXJnZXQgdGlsZVxuICAgICAgICBsZXQgc291cmNlX3RpbGVzID0gdGhpcy5zb3VyY2VUaWxlcyh0aWxlLmNvb3JkcywgdGlsZS5zb3VyY2UpO1xuICAgICAgICBsZXQga2V5ID0gdGlsZS5jb29yZHMua2V5O1xuXG4gICAgICAgIGlmIChzb3VyY2VfdGlsZXMpIHtcbiAgICAgICAgICAgIHNvdXJjZV90aWxlcy5kZWxldGUodGlsZS5zdHlsZV96b29tKTtcbiAgICAgICAgICAgIGlmIChzb3VyY2VfdGlsZXMuc2l6ZSA9PT0gMCkge1xuICAgICAgICAgICAgICAgIC8vIHJlbW92ZSBzb3VyY2VcbiAgICAgICAgICAgICAgICB0aGlzLmNvb3Jkc1trZXldLnNvdXJjZXMuZGVsZXRlKHRpbGUuc291cmNlLm5hbWUpO1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLmNvb3Jkc1trZXldLnNvdXJjZXMuc2l6ZSA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgdGhpcy5jb29yZHNba2V5XS5zb3VyY2VzO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmNvb3Jkc1trZXldLmRlc2NlbmRhbnRzID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyByZW1vdmUgd2hvbGUgY29vcmRcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSB0aGlzLmNvb3Jkc1trZXldO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gRGVjcmVtZW50IHJlZmVyZW5jZSBjb3VudCB1cCB0aGUgdGlsZSBweXJhbWlkXG4gICAgICAgIGZvciAobGV0IHogPSB0aWxlLmNvb3Jkcy56IC0gMTsgeiA+PSAwOyB6LS0pIHtcbiAgICAgICAgICAgIGxldCBkb3duID0gVGlsZS5jb29yZGluYXRlQXRab29tKHRpbGUuY29vcmRzLCB6KTtcbiAgICAgICAgICAgIGlmICh0aGlzLmNvb3Jkc1tkb3duLmtleV0gJiYgdGhpcy5jb29yZHNbZG93bi5rZXldLmRlc2NlbmRhbnRzID4gMCkge1xuICAgICAgICAgICAgICAgIHRoaXMuY29vcmRzW2Rvd24ua2V5XS5kZXNjZW5kYW50cy0tO1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLmNvb3Jkc1tkb3duLmtleV0uZGVzY2VuZGFudHMgPT09IDAgJiYgIXRoaXMuY29vcmRzW2Rvd24ua2V5XS5zb3VyY2VzKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSB0aGlzLmNvb3Jkc1tkb3duLmtleV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZ2V0QW5jZXN0b3IgKHsgY29vcmRzLCBzdHlsZV96b29tLCBzb3VyY2UgfSkge1xuICAgICAgICAvLyBGaXJzdCBjaGVjayBvdmVyem9vbWVkIHRpbGVzIGF0IHNhbWUgY29vcmRpbmF0ZSB6b29tXG4gICAgICAgIGlmIChzdHlsZV96b29tID4gc291cmNlLm1heF96b29tKSB7XG4gICAgICAgICAgICBsZXQgc291cmNlX3RpbGVzID0gdGhpcy5zb3VyY2VUaWxlcyhjb29yZHMsIHNvdXJjZSk7XG4gICAgICAgICAgICBpZiAoc291cmNlX3RpbGVzKSB7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgeiA9IHN0eWxlX3pvb20gLSAxOyB6ID49IHNvdXJjZS5tYXhfem9vbTsgei0tKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzb3VyY2VfdGlsZXMuaGFzKHopICYmIHNvdXJjZV90aWxlcy5nZXQoeikubG9hZGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc291cmNlX3RpbGVzLmdldCh6KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHN0eWxlX3pvb20gPSBzb3VyY2UubWF4X3pvb207XG4gICAgICAgIH1cblxuICAgICAgICAvLyBDaGVjayB0aWxlcyBhdCBuZXh0IHpvb20gdXBcbiAgICAgICAgc3R5bGVfem9vbS0tO1xuICAgICAgICBsZXQgcGFyZW50ID0gVGlsZS5jb29yZGluYXRlQXRab29tKGNvb3JkcywgY29vcmRzLnogLSAxKTtcbiAgICAgICAgbGV0IHBhcmVudF90aWxlcyA9IHRoaXMuc291cmNlVGlsZXMocGFyZW50LCBzb3VyY2UpO1xuICAgICAgICBpZiAocGFyZW50X3RpbGVzICYmIHBhcmVudF90aWxlcy5oYXMoc3R5bGVfem9vbSkgJiYgcGFyZW50X3RpbGVzLmdldChzdHlsZV96b29tKS5sb2FkZWQpIHtcbiAgICAgICAgICAgIHJldHVybiBwYXJlbnRfdGlsZXMuZ2V0KHN0eWxlX3pvb20pO1xuICAgICAgICB9XG4gICAgICAgIC8vIGRpZG4ndCBmaW5kIGFuY2VzdG9yLCB0cnkgbmV4dCBsZXZlbFxuICAgICAgICAvLyBUT0RPOiBtYXggZGVwdGggbGV2ZWxzIHRvIGNoZWNrXG4gICAgICAgIGlmIChwYXJlbnQueiA+IDApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmdldEFuY2VzdG9yKHsgY29vcmRzOiBwYXJlbnQsIHN0eWxlX3pvb20sIHNvdXJjZSB9KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGdldERlc2NlbmRhbnRzICh7IGNvb3Jkcywgc3R5bGVfem9vbSwgc291cmNlIH0sIGxldmVsID0gMSkge1xuICAgICAgICBsZXQgZGVzY2VuZGFudHMgPSBbXTtcblxuICAgICAgICAvLyBGaXJzdCBjaGVjayBvdmVyem9vbWVkIHRpbGVzIGF0IHNhbWUgY29vcmRpbmF0ZSB6b29tXG4gICAgICAgIGlmIChzdHlsZV96b29tID49IHNvdXJjZS5tYXhfem9vbSkge1xuICAgICAgICAgICAgbGV0IHNvdXJjZV90aWxlcyA9IHRoaXMuc291cmNlVGlsZXMoY29vcmRzLCBzb3VyY2UpO1xuICAgICAgICAgICAgaWYgKHNvdXJjZV90aWxlcykge1xuICAgICAgICAgICAgICAgIGxldCBzZWFyY2hfbWF4X3pvb20gPSBNYXRoLm1heChHZW8uZGVmYXVsdF92aWV3X21heF96b29tLCBzdHlsZV96b29tICsgdGhpcy5tYXhfcHJveHlfZGVzY2VuZGFudF9kZXB0aCk7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgeiA9IHN0eWxlX3pvb20gKyAxOyB6IDw9IHNlYXJjaF9tYXhfem9vbTsgeisrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzb3VyY2VfdGlsZXMuaGFzKHopICYmIHNvdXJjZV90aWxlcy5nZXQoeikubG9hZGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjZW5kYW50cy5wdXNoKHNvdXJjZV90aWxlcy5nZXQoeikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRlc2NlbmRhbnRzO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGRlc2NlbmRhbnRzO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gQ2hlY2sgdGlsZXMgYXQgbmV4dCB6b29tIGRvd25cbiAgICAgICAgaWYgKHRoaXMuY29vcmRzW2Nvb3Jkcy5rZXldICYmIHRoaXMuY29vcmRzW2Nvb3Jkcy5rZXldLmRlc2NlbmRhbnRzID4gMCkge1xuICAgICAgICAgICAgc3R5bGVfem9vbSsrO1xuICAgICAgICAgICAgZm9yIChsZXQgY2hpbGQgb2YgVGlsZS5jaGlsZHJlbkZvckNvb3JkaW5hdGUoY29vcmRzKSkge1xu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1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgbGV0IGxvZ2dlciA9IG1ldGhvZEZvckxldmVsKG1zZ19sZXZlbCk7XG5cbiAgICAgICAgICAgIC8vIFdyaXRlIHRvIGNvbnNvbGUgKG9uIG1haW4gdGhyZWFkKVxuICAgICAgICAgICAgaWYgKG1zZy5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgICAgICAgbG9nZ2VyKGBUYW5ncmFtICR7dmVyc2lvbn0gWyR7bXNnX2xldmVsfV06ICR7bXNnWzBdfWAsIC4uLm1zZy5zbGljZSgxKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBsb2dnZXIoYFRhbmdyYW0gJHt2ZXJzaW9ufSBbJHttc2dfbGV2ZWx9XTogJHttc2dbMF19YCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG59XG5cbmxvZy5sZXZlbCA9ICdpbmZvJztcbmxvZy53b3JrZXJzID0gbnVsbDtcblxubG9nLnNldExldmVsID0gZnVuY3Rpb24gKGxldmVsKSB7XG4gICAgbG9nLmxldmVsID0gbGV2ZWw7XG5cbiAgICBpZiAoVGhyZWFkLmlzX21haW4gJiYgQXJyYXkuaXNBcnJheShsb2cud29ya2VycykpIHtcbiAgICAgICAgV29ya2VyQnJva2VyLnBvc3RNZXNzYWdlKGxvZy53b3JrZXJzLCAnX2xvZ1NldExldmVsUHJveHknLCBsZXZlbCk7XG4gICAgfVxufTtcblxuaWYgKFRocmVhZC5pc19tYWluKSB7XG4gICAgbG9nLnNldFdvcmtlcnMgPSBmdW5jdGlvbiAod29ya2Vycykge1xuICAgICAgICBsb2cud29ya2VycyA9IHdvcmtlcnM7XG4gICAgfTtcblxuXG59XG5cbldvcmtlckJyb2tlci5hZGRUYXJnZXQoJ19sb2dQcm94eScsIGxvZyk7ICAgICAgICAgICAgICAgICAgIC8vIHByb3h5IGxvZyBtZXNzYWdlcy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N0VVJMKGJsb2IpO1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIEV4cGxpY2l0bHkgcmVtb3ZlIGFsbCBzdHJlYW0gdHJhY2tzLCBhbmQgc2V0IG9iamVjdHMgdG8gbnVsbFxuICAgICAgICAgICAgICAgICAgICBpZiAoY2FwLnN0cmVhbSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRyYWNrcyA9IGNhcC5zdHJlYW0uZ2V0VHJhY2tzKCkgfHwgW107XG4gICAgICAgICAgICAgICAgICAgICAgICB0cmFja3MuZm9yRWFjaCh0cmFjayA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhY2suc3RvcCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhcC5zdHJlYW0ucmVtb3ZlVHJhY2sodHJhY2spO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgY2FwLnN0cmVhbSA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGNhcC5tZWRpYV9yZWNvcmRlciA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMudmlkZW9fY2FwdHVyZSA9IG51bGw7XG5cbiAgICAgICAgICAgICAgICAgICAgY2FwLnJlc29sdmUoeyB1cmwsIGJsb2IsIHR5cGU6ICd3ZWJtJyB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgY2FwLm1lZGlhX3JlY29yZGVyLnN0YXJ0KCk7XG4gICAgICAgIH1cbiAgICAgICAgY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIHRoaXMudmlkZW9fY2FwdHVyZSA9IG51bGw7XG4gICAgICAgICAgICBsb2coJ2Vycm9yJywgJ1NjZW5lIHZpZGVvIGNhcHR1cmUgZmFpbGVkJywgZSk7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAg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vic2NyaWJlQWxsKCkge1xuICAgICAgICAgICAgbGlzdGVuZXJzLmNsZWFyKCk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgdHJpZ2dlcihldmVudCwgLi4uZGF0YSkge1xuICAgICAgICAgICAgZm9yIChsZXQgbGlzdGVuZXIgb2YgbGlzdGVuZXJzKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBsaXN0ZW5lcltldmVudF0gPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICAgICAgbGlzdGVuZXJbZXZlbnRdKC4uLmRhdGEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICBoYXNTdWJzY3JpYmVyc0ZvcihldmVudCkge1xuICAgICAgICAgICAgZm9yIChsZXQgbGlzdGVuZXIgb2YgbGlzdGVuZXJzKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBsaXN0ZW5lcltldmVudF0gPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG5cbiAgICB9KTtcblxufVxuIiwiLypqc2hpbnQgd29ya2VyOiB0cnVlKi9cblxuLy8gTWFyayB0aHJlYWQgYXMgbWFpbiBvciB3b3JrZXJcbmNvbnN0IFRocmVhZCA9IHt9O1xuXG5leHBvcnQgZGVmYXVsdCBUaHJlYWQ7XG5cbnRyeSB7XG4gICAgaWYgKHdpbmRvdy5kb2N1bWVudCAhPT0gSFRNTERvY3VtZW50KSB7IC8vIGpzaGludCBpZ25vcmU6bGluZVxuICAgICAgICBUaHJlYWQuaXNfd29ya2VyID0gZmFsc2U7XG4gICAgICAgIFRocmVhZC5pc19tYWluICAgPSB0cnVlO1xuICAgIH1cbn1cbmNhdGNoIChlKSB7XG4gICAgaWYgKHN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XG4gICAgICAgICAgICAgICAgdXJsID0gYmFzZV9pbmZvLm9yaWdpbiArICcvJyArIHVybDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIEhhcmQgd2F5IChJRTExKVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIG9yaWdpbiA9IHVybC5tYXRjaCgvXigoaHR0cHxodHRwc3xkYXRhfGJsb2IpOlxcL1xcL1teXFwvXSpcXC8pLyk7XG4gICAgICAgICAgICAgICAgb3JpZ2luID0gKG9yaWdpbiAmJiBvcmlnaW4ubGVuZ3RoID4gMSkgPyBvcmlnaW5bMF0gOiAnJztcbiAgICAgICAgICAgICAgICB1cmwgPSBvcmlnaW4gKyB1cmw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIHVybDtcbn07XG5cblV0aWxzLnBhdGhGb3JVUkwgPSBmdW5jdGlvbiAodXJsKSB7XG4gICAgaWYgKHR5cGVvZiB1cmwgPT09ICdzdHJpbmcnICYmIHVybC5zZWFyY2goL14oZGF0YXxibG9iKTovKSA9PT0gLTEpIHtcbiAgICAgICAgbGV0IHFzID0gdXJsLmluZGV4T2YoJz8nKTtcbiAgICAgICAgaWYgKHFzID4gLTEpIHtcbiAgICAgICAgICAgIHVybCA9IHVybC5zdWJzdHIoMCwgcXMpO1xuICAgICAgICB9XG5cbiAgICAgICAgbGV0IGhhc2ggPSB1cmwuaW5kZXhPZignIycpO1xuICAgICAgICBpZiAoaGFzaCA+IC0xKSB7XG4gICAgICAgICAgICB1cmwgPSB1cmwuc3Vic3RyKDAsIGhhc2gpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHVybC5zdWJzdHIoMCwgdXJsLmxhc3RJbmRleE9mKCcvJykgKyAxKSB8fCAnJztcbiAgICB9XG4gICAgcmV0dXJuICcnO1xufTtcblxuVXRpbHMuaXNSZWxhdGl2ZVVSTCA9IGZ1bmN0aW9uICh1cmwpIHt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ICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShyZXF1ZXN0LnJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJlamVjdChFcnJvcignUmVxdWVzdCBlcnJvciB3aXRoIGEgc3RhdHVzIG9mICcgKyByZXF1ZXN0LnN0YXR1c1RleHQpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgcmVxdWVzdC5vbmVycm9yID0gKGV2dCkgPT4ge1xuICAgICAgICAgICAgcmVqZWN0KEVycm9yKCdUaGVyZSB3YXMgYSBuZXR3b3JrIGVycm9yJyArIGV2dC50b1N0cmluZygpKSk7XG4gICAgICAgIH07XG4gICAgICAgIHJlcXVlc3Qub250aW1lb3V0ID0gKGV2dCkgPT4ge1xuICAgICAgICAgICAgcmVqZWN0KEVycm9yKCd0aW1lb3V0ICcrIGV2dC50b1N0cmluZygpKSk7XG4gICAgICAgIH07XG4gICAgICAgIHJlcXVlc3Quc2VuZCgpO1xuICAgIH0pO1xuXG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHByb21pc2UsICdyZXF1ZXN0Jywge1xuICAgICAgICB2YWx1ZTogcmVxdWVzdFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIHByb21pc2U7XG59O1xuXG5VdGlscy5wYXJzZVJlc291cmNlID0gZnVuY3Rpb24gKGJvZHkpIHtcbiAgICB2YXIgZGF0YTtcbiAgICB0cnkge1xuICAgICAgICAvLyBqc3lhbWwgJ2pzb24nIG9wdGlvbiBhbGxvd3MgZHVwbGljYXRlIGtleXNcbiAgICAgICAgLy8gS2VlcGluZyB0aGlzIGZvciBiYWNrd2FyZHMgY29tcGF0aWJpbGl0eSwgYnV0IHNob3VsZCBjb25zaWRlciBtaWdyYXRpbmcgdG8gcmVxdWlyaW5nXG4gICAgICAgIC8vIHVua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1xuICAgICAgICB5ID0gcG9pbnRzW3BvaW50cy5sZW5ndGgtMV1bMV07XG4gICAgICAgIGlmICh0eXBlb2YgdHJhbnNmb3JtID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICB5ID0gdHJhbnNmb3JtKHkpO1xuICAgICAgICB9XG4gICAgfVxuICAgIC8vIEZpbmQgd2hpY2ggY29udHJvbCBwb2ludHMgeCBpcyBiZXR3ZWVuXG4gICAgZWxzZSB7XG4gICAgICAgIGZvciAodmFyIGk9MDsgaSA8IHBvaW50cy5sZW5ndGggLSAxOyBpKyspIHtcbiAgICAgICAgICAgIGlmICh4ID49IHBvaW50c1tpXVswXSAmJiB4IDwgcG9pbnRzW2krMV1bMF0pIHtcbiAgICAgICAgICAgICAgICAvLyBMaW5lYXIgaW50ZXJwb2xhdGlvblxuICAgICAgICAgICAgICAgIHgxID0gcG9pbnRzW2ldWzBdO1xuICAgICAgICAgICAgICAgIHgyID0gcG9pbnRzW2krMV1bMF07XG5cbiAgICAgICAgICAgICAgICAvLyBNdWx0aXBsZSB2YWx1ZXNcbiAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShwb2ludHNbaV1bMV0pKSB7XG4gICAgICAgICAgICAgICAgICAgIHkgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgYz0wOyBjIDwgcG9pbnRzW2ldWzFdLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHRyYW5zZm9ybSA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHkxID0gdHJhbnNmb3JtKHBvaW50c1tpXVsxXVtjXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeTIgPSB0cmFuc2Zvcm0ocG9pbnRzW2krMV1bMV1bY10pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSB5MiAtIHkxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlbY10gPSBkICogKHggLSB4MSkgLyAoeDIgLSB4MSkgKyB5MTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSBwb2ludHNbaSsxXVsxXVtjXSAtIHBvaW50c1tpXVsxXVtjXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB5W2NdID0gZCAqICh4IC0geDEpIC8gKHgyIC0geDEpICsgcG9pbnRzW2ldWzFdW2NdO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIFNpbmdsZSB2YWx1ZVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHRyYW5zZm9ybSA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgeTEgPSB0cmFuc2Zvcm0ocG9pbnRzW2ldWzFdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHkyID0gdHJhbnNmb3JtKHBvaW50c1tpKzFdWzFdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSB5MiAtIHkxO1xuICAgICAgICAgICAgICAgICAgICAgICAgeSA9IGQgKiAoeCAtIHgxKSAvICh4MiAtIHgxKSArIHkxO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IHBvaW50c1tpKzFdWzFdIC0gcG9pbnRzW2ldWzFdO1xuICAgICAgICAgICAgICAgICAgICAgICAgeSA9IGQgKiAoeCAtIHgxKSAvICh4MiAtIHgxKSArIHBvaW50c1tpXVsxXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgIC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gICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn07XG5cblV0aWxzLnJlY3Vyc2VWYWx1ZXMgPSBmdW5jdGlvbiogKG9iaikge1xuICAgIGlmICghb2JqKSB7XG4gICAgICAgIHJldHVybjtcbiAgICB9XG4gICAgZm9yICh2YXIga2V5IG9mIE9iamVjdC5rZXlzKG9iaikpIHtcbiAgICAgICAgaWYgKG9ialtrZXldKSB7XG4gICAgICAgICAgICB5aWVsZCBvYmpba2V5XTtcbiAgICAgICAgICAgIGlmICh0eXBlb2Ygb2JqW2tleV0gPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAgICAgeWllbGQqIFV0aWxzLnJlY3Vyc2VWYWx1ZXMob2JqW2tleV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufTtcblxuVXRpbHMucmFkVG9EZWcgPSBmdW5jdGlvbiAocmFkaWFucykge1xuICAgIHJldHVybiByYWRpYW5zICogMTgwIC8gTWF0aC5QSTtcbn07XG5cblV0aWxzLnRvQ1NTQ29sb3IgPSBmdW5jdGlvbiAoY29sb3IpIHtcbiAgICBpZiAoY29sb3JbM10gPT09IDEpIHsgLy8gZnVsbCBvcGFjaXR5XG4gICAgICAgIHJldHVybiBgcmdiKCR7Y29sb3Iuc2xpY2UoMCwgMykubWFwKGMgPT4gTWF0aC5yb3VuZChjICogMjU1KSkuam9pbignLCAnKX0pYDtcbiAgICB9XG4gICAgLy8gUkdCIGlzIGJldHdlZW4gWzAsIDI1NV0gb3BhY2l0eSBpcyBiZXR3ZWVuIFswLCAxXVxuICAgIHJldHVybiBgcmdiYSgke2NvbG9yLm1hcCgoYywgaSkgPT4gKGkgPCAzICYmIE1hdGgucm91bmQoYyAqIDI1NSkpIHx8IGMpLmpvaW4oJywgJyl9KWA7XG59O1xuXG5VdGlscy5wb2ludEluVGlsZSA9IGZ1bmN0aW9uIChwb2ludCkge1xuICAgIHJldHVybiBwb2ludFswXSA+PSAwICYmwqBwb2ludFsxXSA+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ik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlc1tpZF0ucmVzb2x2ZShkYXRhLm1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBtZXNzYWdlc1tpZF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gTGlzdGVuIGZvciBtZXNzYWdlcyBpbml0aWF0aW5nIGEgY2FsbCBmcm9tIHRoZSB3b3JrZXIsIGRpc3BhdGNoIHRoZW0sXG4gICAgICAgICAgICAvLyBhbmQgc2VuZCBhbnkgcmV0dXJuIHZhbHVlIGJhY2sgdG8gdGhlIHdvcmtlclxuICAgICAgICAgICAgLy8gVW5pcXVlIGlkIGZvciB0aGlzIG1lc3NhZ2UgJiByZXR1cm4gY2FsbCB0byBtYWluIHRocmVhZFxuICAgICAgICAgICAgZWxzZSBpZiAoZGF0YS50eXBlID09PSAnd29ya2VyX3NlbmQnICYmIGlkICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICAvLyBDYWxsIHRoZSByZXF1ZXN0ZWQgbWV0aG9kIGFuZCBzYXZlIHRoZSByZXR1cm4gdmFsdWVcbiAgICAgICAgICAgICAgICB2YXIgW21ldGhvZF9uYW1lLCB0YXJnZXRdID0gZmluZFRhcmdldChkYXRhLm1ldGhvZCk7XG4gICAgICAgICAgICAgICAgaWYgKCF0YXJnZXQpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgRXJyb3IoYFdvcmtlciBicm9rZXIgY291bGQgbm90IGRpc3BhdGNoIG1lc3NhZ2UgdHlwZSAke2RhdGEubWV0aG9kfSBvbiB0YXJnZXQgJHtkYXRhLnRhcmdldH0gYmVjYXVzZSBubyBvYmplY3Qgd2l0aCB0aGF0IG5hbWUgaXMgcmVnaXN0ZXJlZCBvbiBtYWluIHRocmVhZGApO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZhciBtZXRob2QgPSAodHlwZW9mIHRhcmdldFttZXRob2RfbmFtZV0gPT09ICdmdW5jdGlvbicpICYmIHRhcmdldFttZXRob2RfbmFtZV07XG4gICAgICAgICAgICAgICAgaWYgKCFtZXRob2QpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgRXJyb3IoYFdvcmtlciBicm9rZXIgY291bGQgbm90IGRpc3BhdGNoIG1lc3NhZ2UgdHlwZSAke2RhdGEubWV0aG9kfSBvbiB0YXJnZXQgJHtkYXRhLnRhcmdldH0gYmVjYXVzZSBvYmplY3QgaGFzIG5vIG1ldGhvZCB3aXRoIHRoYXQgbmFtZWApO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZhciByZXN1bHQsIGVycm9yO1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IG1ldGhvZC5hcHBseSh0YXJnZXQsIGRhdGEubWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNhdGNoKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gVGhyb3duIGVycm9ycyB3aWxsIGJlIHBhc3NlZCBiYWNrIChpbiBzdHJpbmcgZm9ybSkgdG8gd29ya2VyXG4gICAgICAgICAgICAgICAgICAgIGVycm9yID0gZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBTZW5kIHJldHVybiB2YWx1ZSB0byB3b3JrZXJcbiAgICAgICAgICAgICAgICBsZXQgcGF5bG9hZCwgdHJhbnNmZXJhYmxlcyA9IFtdO1xuXG4gICAgICAgICAgICAgICAgLy8gQXN5bmMgcmVzdWx0XG4gICAgICAgICAgICAgICAgaWYgKHJlc3VsdCBpbnN0YW5jZW9mIFByb21pc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnRoZW4oKHZhbHVlKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgaW5zdGFuY2VvZiBXb3JrZXJCcm9rZXIud2l0aFRyYW5zZmVyYWJsZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2ZlcmFibGVzID0gdmFsdWUudHJhbnNmZXJhYmxlcztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHZhbHVlLnZhbHVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXlsb2FkID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdtYWluX3JlcGx5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlX2lkOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOiB2YWx1ZVxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBheWxvYWQgPSBtYXliZUVuY29kZShwYXlsb2FkLCB0cmFuc2ZlcmFibGVzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdvcmtlci5wb3N0TWVzc2FnZShwYXlsb2FkLCB0cmFuc2ZlcmFibGVzLm1hcCh0ID0+IHQub2JqZWN0KSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBmcmVlVHJhbnNmZXJhYmxlcyh0cmFuc2ZlcmFibGVzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0cmFuc2ZlcmFibGVzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coJ3RyYWNlJywgYCcke21ldGhvZF9uYW1lfScgdHJhbnNmZXJyZWQgJHt0cmFuc2ZlcmFibGVzLmxlbmd0aH0gb2JqZWN0cyB0byB3b3JrZXIgdGhyZWFkYCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgfSwgKGVycm9yKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3b3JrZXIucG9zdE1lc3NhZ2Uoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdtYWluX3JlcGx5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlX2lkOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcnJvcjogKGVycm9yIGluc3RhbmNlb2YgRXJyb3IgPyBgJHtlcnJvci5tZXNzYWdlfTogJHtlcnJvci5zdGFja31gIDogZXJyb3IpXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIEltbWVkaWF0ZSByZXN1bHRcbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCBpbnN0YW5jZW9mIFdvcmtlckJyb2tlci53aXRoVHJhbnNmZXJhYmxlcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNmZXJhYmxlcyA9IHJlc3VsdC50cmFuc2ZlcmFibGVzO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gcmVzdWx0LnZhbHVlO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgcGF5bG9hZCA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdtYWluX3JlcGx5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2VfaWQ6IGlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogcmVzdWx0LFxuICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3I6IChlcnJvciBpbnN0YW5jZW9mIEVycm9yID8gYCR7ZXJyb3IubWVzc2FnZX06ICR7ZXJyb3Iuc3RhY2t9YCA6IGVycm9yKVxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICBwYXlsb2FkID0gbWF5YmVFbmNvZGUocGF5bG9hZCwgdHJhbnNmZXJhYmxlcyk7XG4gICAgICAgICAgICAgICAgICAgIHdvcmtlci5wb3N0TWVzc2FnZShwYXlsb2FkLCB0cmFuc2ZlcmFibGVzLm1hcCh0ID0+IHQub2JqZWN0KSk7XG4gICAgICAgICAgICAgICAgICAgIGZyZWVUcmFuc2ZlcmFibGVzKHRyYW5zZmVyYWJsZXMpO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHJhbnNmZXJhYmxlcy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsb2coJ3RyYWNlJywgYCcke21ldGhvZF9uYW1lfScgdHJhbnNmZXJyZWQgJHt0cmFuc2ZlcmFibGVzLmxlbmd0aH0gb2JqZWN0cyB0byB3b3JrZXIgdGhyZWFkYCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgfTtcblxuICAgIFdvcmtlckJyb2tlci5yZW1vdmVXb3JrZXIgPSBmdW5jdGlvbiAod29ya2VyKSB7XG4gICAgICAgIGlmICghd29ya2Vycy5oYXMod29ya2VyKSkge1xuICAgICAgICAgICAgdGhyb3cgRXJyb3IoYFdvcmtlciBicm9rZXIgY291bGQgbm90IHJlbW92ZSB1bnJlZ2lzdGVyZWQgb2JqZWN0YCwgd29ya2VyKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHdvcmtlcnMuZGVsZXRlKHdvcmtlcik7XG4gICAgICAgIC8vIFRPRE86IHJlbW92ZSBldmVudCBoYW5kbGVycyBmcm9tIHdvcmtlciBhcyB3ZWxsP1xuICAgIH07XG5cbiAgICAvLyBFeHBvc2UgZm9yIGRlYnVnZ2luZ1xuICAgIFdvcmtlckJyb2tlci5nZXRNZXNzYWdlcyA9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AgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgbWV0aG9kID0gKHR5cGVvZiB0YXJnZXRbbWV0aG9kX25hbWVdID09PSAnZnVuY3Rpb24nKSAmJiB0YXJnZXRbbWV0aG9kX25hbWVdO1xuXG4gICAgICAgICAgICBpZiAoIW1ldGhvZCkge1xuICAgICAgICAgICAgICAgIHRocm93IEVycm9yKGBXb3JrZXIgYnJva2VyIGNvdWxkIG5vdCBkaXNwYXRjaCBtZXNzYWdlIHR5cGUgJHtkYXRhLm1ldGhvZH0gYmVjYXVzZSB3b3JrZXIgaGFzIG5vIG1ldGhvZCB3aXRoIHRoYXQgbmFtZWApO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgcmVzdWx0LCBlcnJvcjtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gbWV0aG9kLmFwcGx5KHRhcmdldCwgZGF0YS5tZXNzYWdlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhdGNoKGUpIHtcbiAgICAgICAgICAgICAgICAvLyBUaHJvd24gZXJyb3JzIHdpbGwgYmUgcGFzc2VkIGJhY2sgKGluIHN0cmluZyBmb3JtKSB0byBtYWluIHRocmVhZFxuICAgICAgICAgICAgICAgIGVycm9yID0gZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gU2VuZCByZXR1cm4gdmFsdWUgdG8gbWFpbiB0aHJlYWRcbiAgICAgICAgICAgIGxldCBwYXlsb2FkLCB0cmFuc2ZlcmFibGVzID0gW107XG5cbiAgICAgICAgICAgIC8vIEFzeW5jIHJlc3VsdFxuICAgICAgICAgICAgaWYgKHJlc3VsdCBpbnN0YW5jZW9mIFByb21pc2UpIHtcbiAgICAgICAgICAgICAgICByZXN1bHQudGhlbigodmFsdWUpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlIGluc3RhbmNlb2YgV29ya2VyQnJva2VyLndpdGhUcmFuc2ZlcmFibGVzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2ZlcmFibGVzID0gdmFsdWUudHJhbnNmZXJhYmxlcztcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gdmFsdWUudmFsdWU7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBwYXlsb2FkID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ3dvcmtlcl9yZXBseScsXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlX2lkOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6IHZhbHVlXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIHBheWxvYWQgPSBtYXliZUVuY29kZShwYXlsb2FkLCB0cmFuc2ZlcmFibGVzKTtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5wb3N0TWVzc2FnZShwYXlsb2FkLCB0cmFuc2ZlcmFibGVzLm1hcCh0ID0+IHQub2JqZWN0KSk7XG4gICAgICAgICAgICAgICAgICAgIGZyZWVUcmFuc2ZlcmFibGVzKHRyYW5zZmVyYWJsZXMpO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHJhbnNmZXJhYmxlcy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsb2coJ3RyYWNlJywgYCcke21ldGhvZF9uYW1lfScgdHJhbnNmZXJyZWQgJHt0cmFuc2ZlcmFibGVzLmxlbmd0aH0gb2JqZWN0cyB0byBtYWluIHRocmVhZGApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSwgKGVycm9yKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHNlbGYucG9zdE1lc3NhZ2Uoe1xuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ3dvcmtlcl9yZXBseScsXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlX2lkOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yOiAoZXJyb3IgaW5zdGFuY2VvZiBFcnJvciA/IGAke2Vycm9yLm1lc3NhZ2V9OiAke2Vycm9yLnN0YWNrfWAgOiBlcnJvcilcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBJbW1lZGlhdGUgcmVzdWx0XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAocmVzdWx0IGluc3RhbmNlb2YgV29ya2VyQnJva2VyLndpdGhUcmFuc2ZlcmFibGVzKSB7XG4gICAgICAgICAgICAgICAgICAgIHRyYW5zZmVyYWJsZXMgPSByZXN1bHQudHJhbnNmZXJhYmxlcztcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gcmVzdWx0LnZhbHVlO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHBheWxvYWQgPSB7XG4gICAgICAgICAgICAgICAgICAgIHR5cGU6ICd3b3JrZXJfcmVwbHknLFxuICAgICAgICAgICAgICAgICAgICBtZXNzYWdlX2lkOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogcmVzdWx0LFxuICAgICAgICAgICAgICAgICAgICBlcnJvcjogKGVycm9yIGluc3RhbmNlb2YgRXJyb3IgPyBgJHtlcnJvci5tZXNzYWdlfTogJHtlcnJvci5zdGFja31gIDogZXJyb3IpXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBwYXlsb2FkID0gbWF5YmVFbmNvZGUocGF5bG9hZCwgdHJhbnNmZXJhYmxlcyk7XG4gICAgICAgICAgICAgICAgc2VsZi5wb3N0TWVzc2FnZShwYXlsb2FkLCB0cmFuc2ZlcmFibGVzLm1hcCh0ID0+IHQub2JqZWN0KSk7XG4gICAgICAgICAgICAgICAgZnJlZVRyYW5zZmVyYWJsZXModHJh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ICB9O1xuICAgICAgICB0aGlzLmFzcGVjdCA9IHRoaXMuc2l6ZS5jc3Mud2lkdGggLyB0aGlzLnNpemUuY3NzLmhlaWdodDtcbiAgICAgICAgdGhpcy51cGRhdGVCb3VuZHMoKTtcbiAgICB9XG5cbiAgICAvLyBTZXQgdGhlIG1hcCB2aWV3LCBjYW4gYmUgcGFzc2VkIGFuIG9iamVjdCB3aXRoIGxhdC9sbmcgYW5kL29yIHpvb21cbiAgICBzZXRWaWV3ICh7IGxuZywgbGF0LCB6b29tIH0gPSB7fSkge1xuICAgICAgICB2YXIgY2hhbmdlZCA9IGZhbHNlO1xuXG4gICAgICAgIC8vIFNldCBjZW50ZXJcbiAgICAgICAgaWYgKHR5cGVvZiBsbmcgPT09ICdudW1iZXInICYmIHR5cGVvZiBsYXQgPT09ICdudW1iZXInKSB7XG4gICAgICAgICAgICBpZiAoIXRoaXMuY2VudGVyIHx8IGxuZyAhPT0gdGhpcy5jZW50ZXIubG5nIHx8IGxhdCAhPT0gdGhpcy5jZW50ZXIubGF0KSB7XG4gICAgICAgICAgICAgICAgY2hhbmdlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgdGhpcy5jZW50ZXIgPSB7IGxuZzogR2VvLndyYXBMbmcobG5nKSwgbGF0IH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBTZXQgem9vbVxuICAgICAgICBpZiAodHlwZW9mIHpvb20gPT09ICdudW1iZXInICYmIHpvb20gIT09IHRoaXMuem9vbSkge1xuICAgICAgICAgICAgY2hhbmdlZCA9IHRydWU7XG4gICAgICAgICAgICB0aGlzLnNldFpvb20oem9vbSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoY2hhbmdlZCkge1xuICAgICAgICAgICAgdGhpcy51cGRhdGVCb3VuZHMoKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gY2hhbmdlZDtcbiAgICB9XG5cbiAgICBzZXRab29tICh6b29tKSB7XG4gICAgICAgIGlmICh0aGlzLnpvb21pbmcpIHtcbiAgICAgICAgICAgIHRoaXMuem9vbWluZyA9IGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5sYXN0X3pvb20gPSB0aGlzLnpvb207XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgbGFzdF90aWxlX3pvb20gPSB0aGlzLnRpbGVfem9vbTtcbiAgICAgICAgbGV0IHRpbGVfem9vbSA9IHRoaXMudGlsZVpvb20oem9vbSk7XG4gICAgICAgIGlmICghdGhpcy5jb250aW51b3VzX3pvb20pIHtcbiAgICAgICAgICAgIHpvb20gPSB0aWxlX3pvb207XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGlsZV96b29tICE9PSBsYXN0X3RpbGVfem9vbSkge1xuICAgICAgICAgICAgdGhpcy56b29tX2RpcmVjdGlvbiA9IHRpbGVfem9vbSA+IGxhc3RfdGlsZV96b29tID8gMSA6IC0xO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5sYXN0X3pvb20gPSB0aGlzLnpvb207XG4gICAgICAgIHRoaXMuem9vbSA9IHpvb207XG4gICAgICAgIHRoaXMudGlsZV96b29tID0gdGlsZV96b29tO1xuXG4gICAgICAgIHRoaXMudXBkYXRlQm91bmRzKCk7XG4gICAgICAgIHRoaXMuc2NlbmUucmVxdWVzdFJlZHJhdygpO1xuICAgIH1cblxuICAgIHN0YXJ0Wm9vbSAoKSB7XG4gICAgICAgIHRoaXMubGFzdF96b29tID0gdGhpcy56b29tO1xuICAgICAgICB0aGlzLnpvb21pbmcgPSB0cnVlO1xuICAgIH1cblxuICAgIC8vIENob29zZSB0aGUgYmFzZSB6b29tIGxldmVsIHRvIHVzZSBmb3IgYSBnaXZlbiBmcmFjdGlvbmFsIHpvb21cbiAgICBiYXNlWm9vbSAoem9vbSkge1xuICAgICAgICByZXR1cm4gTWF0aC5mbG9vcih6b29tKTtcbiAgICB9XG5cbiAgICAvLyBGb3IgYSBnaXZlb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GluZyAmJiB0aWxlLnN0eWxlX3pvb20gIT09IHRoaXMudGlsZV96b29tKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIERpc2NhcmQgaWYgdG9vIGZhciBmcm9tIGN1cnJlbnQgem9vbVxuICAgICAgICAgICAgbGV0IHpkaWZmID0gTWF0aC5hYnModGlsZS5zdHlsZV96b29tIC0gdGhpcy50aWxlX3pvb20pO1xuICAgICAgICAgICAgaWYgKHpkaWZmID4gdGhpcy5wcmVzZXJ2ZV90aWxlc193aXRoaW5fem9vbSkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBIYW5kbGUgdGlsZXMgYXQgZGlmZmVyZW50IHpvb21zXG4gICAgICAgICAgICBsZXQgY29vcmRzID0gVGlsZS5jb29yZGluYXRlQXRab29tKHRpbGUuY29vcmRzLCB0aGlzLnRpbGVfem9vbSk7XG5cbiAgICAgICAgICAgIC8vIERpc2NhcmQgdGlsZXMgb3V0c2lkZSBhbiBhcmVhIHN1cnJvdW5kaW5nIHRoZSB2aWV3cG9ydFxuICAgICAgICAgICAgaWYgKE1hdGguYWJzKGNvb3Jkcy54IC0gdGhpcy5jZW50ZXIudGlsZS54KSAtIGJvcmRlcl90aWxlc1swXSA+IHRoaXMuYnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgbG9nKCd0cmFjZScsIGBWaWV3OiByZW1vdmUgdGlsZSAke3RpbGUua2V5fSAoYXMgJHtjb29yZHMueH0vJHtjb29yZHMueX0vJHt0aGlzLnRpbGVfem9vbX0pIGZvciBiZWluZyB0b28gZmFyIG91dCBvZiB2aXNpYmxlIGFyZWEgKioqYCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChNYXRoLmFicyhjb29yZHMueSAtIHRoaXMuY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3VfbWV0ZXJzX3Blcl9waXhlbCcsIHRoaXMubWV0ZXJzX3Blcl9waXhlbCk7XG4gICAgICAgIHByb2dyYW0udW5pZm9ybSgnMWYnLCAndV9kZXZpY2VfcGl4ZWxfcmF0aW8nLCBVdGlscy5kZXZpY2VfcGl4ZWxfcmF0aW8pO1xuXG4gICAgICAgIHRoaXMuY2FtZXJhLnNldHVwUHJvZ3JhbShwcm9ncmFtKTtcbiAgICB9XG5cbn1cbiJdfQ== diff --git a/dist/tangram.min.js b/dist/tangram.min.js index e45970d90..8a87bbcd7 100644 --- a/dist/tangram.min.js +++ b/dist/tangram.min.js @@ -12,9 +12,9 @@ r=e.coordinates}for(var n=0;n0?(this.vertex_buffer=e.array_pool.pop(),this.byte_length=this.vertex_buffer.byteLength,this.size=Math.floor(this.byte_length/this.vertex_layout.stride),v.default("trace","VertexData: reused buffer of bytes "+this.byte_length+", "+this.size+" vertices")):(this.size=i,this.byte_length=this.vertex_layout.stride*this.size,this.vertex_buffer=new Uint8Array(this.byte_length)),this.offset=0,this.components=[];var a=!0,s=!1,u=void 0;try{for(var f,h=l.default(this.vertex_layout.components);!(a=(f=h.next()).done);a=!0){var d=f.value;this.components.push([].concat(o.default(d)))}}catch(p){s=!0,u=p}finally{try{!a&&h.return&&h.return()}finally{if(s)throw u}}this.vertex_count=0,this.realloc_count=0,this.setBufferViews()}return h.default(e,[{key:"setBufferViews",value:function(){this.views={},this.views[_.default.UNSIGNED_BYTE]=this.vertex_buffer;var e=!0,t=!1,r=void 0;try{for(var n,i=l.default(this.vertex_layout.attribs);!(e=(n=i.next()).done);e=!0){var a=n.value;if(null==this.views[a.type]){var o=x[a.type];this.views[a.type]=new o(this.vertex_buffer.buffer)}}}catch(s){t=!0,r=s}finally{try{!e&&i.return&&i.return()}finally{if(t)throw r}}var u=!0,c=!1,f=void 0;try{for(var h,d=l.default(this.components);!(u=(h=d.next()).done);u=!0){var p=h.value;p[1]=this.views[p[0]]}}catch(s){c=!0,f=s}finally{try{!u&&d.return&&d.return()}finally{if(c)throw f}}}},{key:"checkBufferSize",value:function(){if(this.offset+this.vertex_layout.stride>this.byte_length){this.size=Math.floor(1.5*this.size),this.size-=this.size%4,this.byte_length=this.vertex_layout.stride*this.size;var t=new Uint8Array(this.byte_length);t.set(this.vertex_buffer),e.array_pool.push(this.vertex_buffer),this.vertex_buffer=t,this.setBufferViews(),this.realloc_count++}}},{key:"addVertex",value:function(e){this.checkBufferSize();for(var t=0,r=this.components.length,n=0;r>n;n++){var i=this.components[n];i[1][(this.offset>>i[2])+i[3]]=e[t++]}this.offset+=this.vertex_layout.stride,this.vertex_count++}},{key:"end",value:function(){return this.vertex_buffer=this.vertex_buffer.subarray(0,this.offset),this.element_buffer=this.vertex_elements.end(),v.default("trace","VertexData: "+this.size+" vertices total, realloc count "+this.realloc_count),this}}]),e}();r.default=w,w.array_pool=[]},{"../utils/log":352,"./constants":300,"./vertex_elements":310,"babel-runtime/core-js/get-iterator":4,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22,"babel-runtime/helpers/defineProperty":23,"babel-runtime/helpers/toConsumableArray":28}],310:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){var r=t&&h?Uint32Array:Uint16Array;return new r(e)}Object.defineProperty(r,"__esModule",{value:!0});var a=e("babel-runtime/helpers/classCallCheck"),o=n(a),s=e("babel-runtime/helpers/createClass"),l=n(s),u=e("../utils/worker_broker"),c=n(u),f=Math.pow(2,16)-1,h=!1,d=function(){function e(){o.default(this,e),this.array=[],this.has_overflown=!1}return l.default(e,[{key:"push",value:function(e){(!this.has_overflown||h)&&(e>f&&(this.has_overflown=!0,!h)||this.array.push(e))}},{key:"end",value:function(){if(this.array.length){var e=i(this.array,this.has_overflown);return this.array=[],this.has_overflown=!1,e}return!1}}]),e}();r.default=d,d.setUint32Flag=function(e){h=e},c.default.addTarget("VertexElements",d)},{"../utils/worker_broker":360,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22}],311:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var i=e("babel-runtime/core-js/get-iterator"),a=n(i),o=e("babel-runtime/helpers/classCallCheck"),s=n(o),l=e("babel-runtime/helpers/createClass"),u=n(l),c=e("./constants"),f=n(c),h=e("./vertex_data"),d=n(h),p=function(){function e(t){s.default(this,e),this.attribs=t,this.components=[],this.index={},this.stride=0;var r=0,n=!0,i=!1,o=void 0;try{for(var l,u=a.default(this.attribs);!(n=(l=u.next()).done);n=!0){var c=l.value;c.offset=this.stride,c.byte_size=c.size;var h=0;switch(c.type){case f.default.FLOAT:case f.default.INT:case f.default.UNSIGNED_INT:c.byte_size*=4,h=2;break;case f.default.SHORT:case f.default.UNSIGNED_SHORT:c.byte_size*=2,h=1}this.stride+=c.byte_size,3&this.stride&&(this.stride+=4-(3&this.stride));var d=c.offset>>h;if(c.size>1)for(var p=0;p0&&f.default([this.aabb],i,function(e,o){return r&&i[o]===r.aabb?void 0:0===t.obb.angle&&0===a[o].angle?(n=!0,!0):m.default.intersect(t.obb,a[o])?(n=!0,!0):void 0}),n}},{key:"add",value:function(e){this.placed=!0,e.aabb.push(this.aabb),e.obb.push(this.obb)}},{key:"inTileBounds",value:function(){var e=[this.aabb[0],this.aabb[1]],t=[this.aabb[2],this.aabb[3]];return d.default.pointInTile(e)&&d.default.pointInTile(t)?!0:!1}},{key:"discard",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];return this.throw_away?!0:this.occluded(e,t)}}]),e}();r.default=_,_.epsilon=.9999},{"../utils/obb":355,"../utils/utils":358,"./point_anchor":316,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22,"box-intersect":33}],314:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,r,n,i,a){var o=void 0,s=void 0;return!i||0===i[0]&&0===i[1]?(o=e[0],s=e[1]):(i=_.default.rot(i,n),o=e[0]+i[0]*a,s=e[1]-i[1]*a),new v.default(o,s,-n,t,r)}function a(e,t){var r=Math.PI,n=r/2,i=_.default.sub(e,t),a=Math.atan2(i[0],i[1])+n;return a>n?(a+=r,a%=2*Math.PI):0>a&&(a+=2*r),a}function o(e,t){return 1-e/t}Object.defineProperty(r,"__esModule",{value:!0});var s=e("babel-runtime/core-js/object/create"),l=n(s),u=e("babel-runtime/helpers/classCallCheck"),c=n(u),f=e("babel-runtime/helpers/createClass"),h=n(f),d=e("./label"),p=n(d),m=e("../vector"),_=n(m),g=e("../utils/obb"),v=n(g),y={MID_POINT:0,CORNER:1},b=Math.PI/2,x=.7,w=.6,k=function(){function e(t,r,n){c.default(this,e),this.size=t,this.layout=n,this.lines=r,this.space_width=n.space_width,this.num_segments=t.length,this.total_length=t.reduce(function(e,t){return e+t[0]},0)+(t.length-1)*this.space_width,this.total_height=t[0][1],this.placement=void 0===n.placement?y.MID_POINT:n.placement,this.kink_index=0,this.spread_factor=.5,this.fitness=0,this.position=[],this.angle=[],this.offsets=[],this.obbs=[],this.aabbs=[],this.segment_index=n.segment_index||n.segment_start||0,this.segment_max=n.segment_end||this.lines.length;var i=this.getNextFittingSegment(this.getCurrentSegment());this.throw_away=!i}return h.default(e,[{key:"getNextSegment",value:function(){switch(this.placement){case y.CORNER:this.placement=y.MID_POINT;break;case y.MID_POINT:if(this.segment_index>=this.lines.length-2)return!1;this.size.length>1&&(this.placement=y.CORNER),this.segment_index++}return this.getCurrentSegment()}},{key:"getCurrentSegment",value:function(){var e=void 0,t=void 0,r=void 0;switch(this.placement){case y.CORNER:e=this.lines[this.segment_index-1],t=this.lines[this.segment_index];var n=this.lines[this.segment_index+1];r=[e,t,n];break;case y.MID_POINT:e=this.lines[this.segment_index],t=this.lines[this.segment_index+1],r=[e,t]}return r}},{key:"getNextFittingSegment",value:function(e){return e=e||this.getNextSegment(),e?this.doesSegmentFit(e)&&(this.update(),this.inTileBounds()&&this.inAngleBounds())?e:this.getNextFittingSegment():!1}},{key:"doesSegmentFit",value:function(e){switch(this.placement){case y.CORNER:return this.fitKinkedSegment(e);case y.MID_POINT:return this.fitStraightSegment(e)}}},{key:"fitKinkedSegment",value:function(e){var t=this.layout.units_per_pixel,r=_.default.sub(e[0],e[1]),n=_.default.sub(e[1],e[2]);if(r[0]*n[0]<0&&r[1]*n[1]>0)return!1;for(var i=_.default.length(r)/t,a=_.default.length(n)/t,s=this.total_length,l=0,u=void 0,c=0,f=this.num_segments-1,h=[];f>0;)u=this.size[f][0]+this.space_width,s-=u,l+=u,c=Math.max(o(i,s),o(a,l)),h.unshift(c),f--;var d=Math.max.apply(null,h);return w>d?(this.kink_index=h.indexOf(d)+1,this.fitness=d,!0):(this.kink_index=0,!1)}},{key:"fitStraightSegment",value:function(e){var t=this.layout.units_per_pixel,r=_.default.length(_.default.sub(e[0],e[1]))/t,n=o(r,this.total_length);return x>n?(this.fitness=n,!0):!1}},{key:"update",value:function(){this.angle=this.getCurrentAngle(),this.position=this.getCurrentPosition(),this.updateBBoxes()}},{key:"getCurrentAngle",value:function(){var e=this.getCurrentSegment(),t=[];switch(this.placement){case y.CORNER:for(var r=a(e[0],e[1]),n=a(e[1],e[2]),i=_.default.sub(e[0],e[1]),o=_.default.sub(e[1],e[2]),s=i[0]>=0&&o[0]>=0?1:-1,l=void 0,u=0;u0?n:r:s>0?r:n,t.push(l);break;case y.MID_POINT:for(var c=a(e[0],e[1]),f=0;fe&&(e+=2*Math.PI);var t=this.angle[1];0>t&&(t+=2*Math.PI);var r=Math.abs(t-e);return r=Math.min(2*Math.PI-r,r),b>=r;case y.MID_POINT:return!0}}},{key:"updateBBoxes",value:function(){var e=this.layout.units_per_pixel,t=(this.total_height+2*this.layout.buffer[1])*e*p.default.epsilon;switch(this.obbs=[],this.aabbs=[],this.placement){case y.CORNER:for(var r=this.angle[this.kink_index-1],n=this.angle[this.kink_index],a=Math.abs(n-r),o=this.spread_factor*Math.abs(this.total_height*Math.tan(.5*a)),s=.5*(-o-this.space_width),l=this.kink_index-1;l>=0;l--){var u=this.size[l][0],c=this.angle[l],f=(u+2*this.layout.buffer[0])*e*p.default.epsilon;s-=.5*u;var h=_.default.rot([s*e,0],-c),d=_.default.add(this.position,h),m=i(d,f,t,c,this.offset,e),g=m.getExtent();this.obbs.push(m),this.aabbs.push(g),this.offsets[l]=[this.layout.offset[0]+s,this.layout.offset[1]],s-=.5*u+this.space_width}s=.5*(o+this.space_width);for(var v=this.kink_index;v=x.default.tile_scale&&(this.position[0]-=this.aabb[2]-x.default.tile_scale+1,e=!0),this.aabb[3]>0&&(this.position[1]-=this.aabb[3],e=!0),this.aabb[1]<=-x.default.tile_scale&&(this.position[1]-=this.aabb[1]+x.default.tile_scale-1,e=!0),e&&this.updateBBoxes(),e}},{key:"getNextFit",value:function(){if(!this.layout.cull_from_tile||this.inTileBounds())return!0;if(this.layout.move_into_tile)return this.moveIntoTile(),!0;if(Array.isArray(this.layout.anchor))for(var e=1;e-1},isRightAnchor:function(e){return i.indexOf(e)>-1},isTopAnchor:function(e){return a.indexOf(e)>-1},isBottomAnchor:function(e){return o.indexOf(e)>-1},default_buffer:[2.5,2.5,1.5,.75],zero_buffer:[0,0,0,0]}},{}],317:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var i=e("babel-runtime/helpers/classCallCheck"),a=n(i),o=e("babel-runtime/helpers/createClass"),s=n(o),l=e("../geo"),u=n(l),c=function(){function e(t,r,n){a.default(this,e),this.key=t,this.repeat_dist=r,this.repeat_dist_sq=this.repeat_dist*this.repeat_dist,this.max_repeat_dist_sq=n*n,this.one_per_group=this.repeat_dist_sq>=this.max_repeat_dist_sq?!0:!1,this.positions=[]}return s.default(e,[{key:"check",value:function(e){if(this.one_per_group){if(this.positions.length>0)return{dist_sq:this.max_repeat_dist_sq,repeat_dist_sq:this.repeat_dist_sq,one_per_group:this.one_per_group}}else for(var t=e.position,r=0;r 0.0) {\n vec3 reflectVector = reflect(_light.direction, _normal);\n float eyeDotR = max(dot(normalize(_eyeToPoint), reflectVector), 0.0);\n pf = pow(eyeDotR, material.shininess);\n }\n light_accumulator_specular.rgb += _light.specular * pf;\n #endif\n}\n",z="/*\n\nExpected globals:\nmaterial\nlight_accumulator_*\n\n*/\n\nstruct PointLight {\n vec3 ambient;\n vec3 diffuse;\n vec3 specular;\n vec4 position;\n\n#ifdef TANGRAM_POINTLIGHT_ATTENUATION_EXPONENT\n float attenuationExponent;\n#endif\n\n#ifdef TANGRAM_POINTLIGHT_ATTENUATION_INNER_RADIUS\n float innerRadius;\n#endif\n\n#ifdef TANGRAM_POINTLIGHT_ATTENUATION_OUTER_RADIUS\n float outerRadius;\n#endif\n};\n\nvoid calculateLight(in PointLight _light, in vec3 _eyeToPoint, in vec3 _normal) {\n\n float dist = length(_light.position.xyz - _eyeToPoint);\n\n // Compute vector from surface to light position\n vec3 VP = (_light.position.xyz - _eyeToPoint) / dist;\n\n // Normalize the vector from surface to light position\n float nDotVP = clamp(dot(VP, _normal), 0.0, 1.0);\n\n // Attenuation defaults\n float attenuation = 1.0;\n #ifdef TANGRAM_POINTLIGHT_ATTENUATION_EXPONENT\n float Rin = 1.0;\n float e = _light.attenuationExponent;\n\n #ifdef TANGRAM_POINTLIGHT_ATTENUATION_INNER_RADIUS\n Rin = _light.innerRadius;\n #endif\n\n #ifdef TANGRAM_POINTLIGHT_ATTENUATION_OUTER_RADIUS\n float Rdiff = _light.outerRadius-Rin;\n float d = clamp(max(0.0,dist-Rin)/Rdiff, 0.0, 1.0);\n attenuation = 1.0-(pow(d,e));\n #else\n // If no outer is provide behaves like:\n // https://imdoingitwrong.wordpress.com/2011/01/31/light-attenuation/\n float d = max(0.0,dist-Rin)/Rin+1.0;\n attenuation = clamp(1.0/(pow(d,e)), 0.0, 1.0);\n #endif\n #else\n float Rin = 0.0;\n\n #ifdef TANGRAM_POINTLIGHT_ATTENUATION_INNER_RADIUS\n Rin = _light.innerRadius;\n #ifdef TANGRAM_POINTLIGHT_ATTENUATION_OUTER_RADIUS\n float Rdiff = _light.outerRadius-Rin;\n float d = clamp(max(0.0,dist-Rin)/Rdiff, 0.0, 1.0);\n attenuation = 1.0-d*d;\n #else\n // If no outer is provide behaves like:\n // https://imdoingitwrong.wordpress.com/2011/01/31/light-attenuation/\n float d = max(0.0,dist-Rin)/Rin+1.0;\n attenuation = clamp(1.0/d, 0.0, 1.0);\n #endif\n #else\n #ifdef TANGRAM_POINTLIGHT_ATTENUATION_OUTER_RADIUS\n float d = clamp(dist/_light.outerRadius, 0.0, 1.0);\n attenuation = 1.0-d*d;\n #else\n attenuation = 1.0;\n #endif\n #endif\n #endif\n\n // Computer accumulators\n light_accumulator_ambient.rgb += _light.ambient * attenuation;\n\n #ifdef TANGRAM_MATERIAL_DIFFUSE\n light_accumulator_diffuse.rgb += _light.diffuse * nDotVP * attenuation;\n #endif\n\n #ifdef TANGRAM_MATERIAL_SPECULAR\n float pf = 0.0; // power factor for shiny speculars\n if (nDotVP > 0.0) {\n vec3 reflectVector = reflect(-VP, _normal);\n float eyeDotR = max(0.0, dot(-normalize(_eyeToPoint), reflectVector));\n pf = pow(eyeDotR, material.shininess);\n }\n\n light_accumulator_specular.rgb += _light.specular * pf * attenuation;\n #endif\n}\n",C="/*\n\nExpected globals:\nmaterial\nlight_accumulator_*\n\n*/\n\nstruct SpotLight {\n vec3 ambient;\n vec3 diffuse;\n vec3 specular;\n vec4 position;\n\n#ifdef TANGRAM_POINTLIGHT_ATTENUATION_EXPONENT\n float attenuationExponent;\n#endif\n\n#ifdef TANGRAM_POINTLIGHT_ATTENUATION_INNER_RADIUS\n float innerRadius;\n#endif\n\n#ifdef TANGRAM_POINTLIGHT_ATTENUATION_OUTER_RADIUS\n float outerRadius;\n#endif\n\n vec3 direction;\n float spotCosCutoff;\n float spotExponent;\n};\n\nvoid calculateLight(in SpotLight _light, in vec3 _eyeToPoint, in vec3 _normal) {\n\n float dist = length(_light.position.xyz - _eyeToPoint);\n\n // Compute vector from surface to light position\n vec3 VP = (_light.position.xyz - _eyeToPoint) / dist;\n\n // normal . light direction\n float nDotVP = clamp(dot(_normal, VP), 0.0, 1.0);\n\n // Attenuation defaults\n float attenuation = 1.0;\n #ifdef TANGRAM_POINTLIGHT_ATTENUATION_EXPONENT\n float Rin = 1.0;\n float e = _light.attenuationExponent;\n\n #ifdef TANGRAM_POINTLIGHT_ATTENUATION_INNER_RADIUS\n Rin = _light.innerRadius;\n #endif\n\n #ifdef TANGRAM_POINTLIGHT_ATTENUATION_OUTER_RADIUS\n float Rdiff = _light.outerRadius-Rin;\n float d = clamp(max(0.0,dist-Rin)/Rdiff, 0.0, 1.0);\n attenuation = 1.0-(pow(d,e));\n #else\n // If no outer is provide behaves like:\n // https://imdoingitwrong.wordpress.com/2011/01/31/light-attenuation/\n float d = max(0.0,dist-Rin)/Rin+1.0;\n attenuation = clamp(1.0/(pow(d,e)), 0.0, 1.0);\n #endif\n #else\n float Rin = 0.0;\n\n #ifdef TANGRAM_POINTLIGHT_ATTENUATION_INNER_RADIUS\n Rin = _light.innerRadius;\n #ifdef TANGRAM_POINTLIGHT_ATTENUATION_OUTER_RADIUS\n float Rdiff = _light.outerRadius-Rin;\n float d = clamp(max(0.0,dist-Rin)/Rdiff, 0.0, 1.0);\n attenuation = 1.0-d*d;\n #else\n // If no outer is provide behaves like:\n // https://imdoingitwrong.wordpress.com/2011/01/31/light-attenuation/\n float d = max(0.0,dist-Rin)/Rin+1.0;\n attenuation = clamp(1.0/d, 0.0, 1.0);\n #endif\n #else\n #ifdef TANGRAM_POINTLIGHT_ATTENUATION_OUTER_RADIUS\n float d = clamp(dist/_light.outerRadius, 0.0, 1.0);\n attenuation = 1.0-d*d;\n #else\n attenuation = 1.0;\n #endif\n #endif\n #endif\n\n // spotlight attenuation factor\n float spotAttenuation = 0.0;\n\n // See if point on surface is inside cone of illumination\n float spotDot = clamp(dot(-VP, _light.direction), 0.0, 1.0);\n\n if (spotDot >= _light.spotCosCutoff) {\n spotAttenuation = pow(spotDot, _light.spotExponent);\n }\n\n light_accumulator_ambient.rgb += _light.ambient * attenuation * spotAttenuation;\n\n #ifdef TANGRAM_MATERIAL_DIFFUSE\n light_accumulator_diffuse.rgb += _light.diffuse * nDotVP * attenuation * spotAttenuation;\n #endif\n\n #ifdef TANGRAM_MATERIAL_SPECULAR\n // Power factor for shiny speculars\n float pf = 0.0;\n if (nDotVP > 0.0) {\n vec3 reflectVector = reflect(-VP, _normal);\n float eyeDotR = max(dot(-normalize(_eyeToPoint), reflectVector), 0.0);\n pf = pow(eyeDotR, material.shininess);\n }\n light_accumulator_specular.rgb += _light.specular * pf * attenuation * spotAttenuation;\n #endif\n}\n",P=function(){function e(t,r){g.default(this,e),this.name=r.name,this.view=t,this.ambient=null==r.ambient||"number"==typeof r.ambient?k.default.expandVec3(r.ambient||0):R.StyleParser.parseColor(r.ambient).slice(0,3),this.diffuse=null==r.diffuse||"number"==typeof r.diffuse?k.default.expandVec3(null!=r.diffuse?r.diffuse:1):R.StyleParser.parseColor(r.diffuse).slice(0,3),this.specular=null==r.specular||"number"==typeof r.specular?k.default.expandVec3(r.specular||0):R.StyleParser.parseColor(r.specular).slice(0,3) }return y.default(e,[{key:"inject",value:function(){var t="\n uniform "+this.struct_name+" u_"+this.name+";\n "+this.struct_name+" "+this.name+";\n ",r="\n "+this.name+" = u_"+this.name+";\n\n ";x.default.addBlock(e.block,t),x.default.addBlock("setup",r)}},{key:"update",value:function(){}},{key:"setupProgram",value:function(e){e.uniform("3fv","u_"+this.name+".ambient",this.ambient),e.uniform("3fv","u_"+this.name+".diffuse",this.diffuse),e.uniform("3fv","u_"+this.name+".specular",this.specular)}}],[{key:"create",value:function(t,r){return e.types[r.type]?new e.types[r.type](t,r):void 0}},{key:"setMode",value:function(t,r){t===!0&&(t="fragment"),t=e.enabled&&(null!=t?t:"fragment"),r.defines.TANGRAM_LIGHTING_FRAGMENT="fragment"===t,r.defines.TANGRAM_LIGHTING_VERTEX="vertex"===t}},{key:"inject",value:function(t){if(x.default.removeBlock(e.block),e.enabled){var r="";if(t&&m.default(t).length>0){var n={};for(var i in t)n[t[i].type]=!0;for(var a in n)e.types[a].inject();for(var o in t)t[o].inject(),r+="calculateLight("+o+", _eyeToPoint, _normal);\n"}var s="\n vec4 calculateLighting(in vec3 _eyeToPoint, in vec3 _normal, in vec4 _color) {\n\n // Do initial material calculations over normal, emission, ambient, diffuse and specular values\n calculateMaterial(_eyeToPoint,_normal);\n\n // Un roll the loop of individual ligths to calculate\n "+r+"\n\n // Final light intensity calculation\n vec4 color = vec4(0.0);\n\n // Keep material alpha channel when alpha blending is on\n #if !defined(TANGRAM_BLEND_OPAQUE)\n #ifdef TANGRAM_MATERIAL_EMISSION\n color = material.emission;\n #endif\n\n #ifdef TANGRAM_MATERIAL_AMBIENT\n color += light_accumulator_ambient * _color * material.ambient;\n #else\n #ifdef TANGRAM_MATERIAL_DIFFUSE\n color += light_accumulator_ambient * _color * material.diffuse;\n #endif\n #endif\n\n #ifdef TANGRAM_MATERIAL_DIFFUSE\n color += light_accumulator_diffuse * _color * material.diffuse;\n #endif\n\n #ifdef TANGRAM_MATERIAL_SPECULAR\n color += light_accumulator_specular * material.specular;\n #endif\n // Multiply material alpha channel into material RGB when alpha blending is off\n #else\n color.a = _color.a; // use vertex color alpha\n\n #ifdef TANGRAM_MATERIAL_EMISSION\n color.rgb = material.emission.rgb * material.emission.a;\n #endif\n\n #ifdef TANGRAM_MATERIAL_AMBIENT\n color.rgb += light_accumulator_ambient.rgb * _color.rgb * material.ambient.rgb * material.ambient.a;\n #else\n #ifdef TANGRAM_MATERIAL_DIFFUSE\n color.rgb += light_accumulator_ambient.rgb * _color.rgb * material.diffuse.rgb * material.diffuse.a;\n #endif\n #endif\n\n #ifdef TANGRAM_MATERIAL_DIFFUSE\n color.rgb += light_accumulator_diffuse.rgb * _color.rgb * material.diffuse.rgb * material.diffuse.a;\n #endif\n\n #ifdef TANGRAM_MATERIAL_SPECULAR\n color.rgb += light_accumulator_specular.rgb * material.specular.rgb * material.specular.a;\n #endif\n #endif\n\n // Clamp final color\n color = clamp(color, 0.0, 1.0);\n\n return color;\n }";x.default.addBlock(e.block,s)}}}]),e}();r.default=P,P.types={},P.block="lighting",P.enabled=!0;var N=function(e){function t(e,r){g.default(this,t);var n=f.default(this,u.default(t).call(this,e,r));return n.type="ambient",n.struct_name="AmbientLight",n}return d.default(t,e),y.default(t,[{key:"setupProgram",value:function(e){e.uniform("3fv","u_"+this.name+".ambient",this.ambient)}}],[{key:"inject",value:function(){x.default.addBlock(P.block,j)}}]),t}(P);P.types.ambient=N;var L=function(e){function t(e,r){g.default(this,t);var n=f.default(this,u.default(t).call(this,e,r));if(n.type="directional",n.struct_name="DirectionalLight",r.direction)n._direction=r.direction;else{var i=135,a=Math.sin(60*Math.PI/180);n._direction=[Math.cos(Math.PI*i/180)*a,Math.sin(Math.PI*i/180)*a,-.5],null==r.ambient&&(n.ambient=k.default.expandVec3(.5))}return n.direction=n._direction.map(parseFloat),n}return d.default(t,e),y.default(t,[{key:"setupProgram",value:function(e){s.default(u.default(t.prototype),"setupProgram",this).call(this,e),e.uniform("3fv","u_"+this.name+".direction",this.direction)}},{key:"direction",get:function(){return this._direction},set:function(e){this._direction=S.default.normalize(e)}}],[{key:"inject",value:function(){x.default.addBlock(P.block,M)}}]),t}(P);P.types.directional=L;var O=function(e){function t(e,r){g.default(this,t);var n=f.default(this,u.default(t).call(this,e,r));return n.type="point",n.struct_name="PointLight",n.position=r.position||[0,0,"100px"],n.position_eye=[],n.origin=r.origin||"ground",n.attenuation=isNaN(parseFloat(r.attenuation))?0:parseFloat(r.attenuation),n.radius=r.radius?Array.isArray(r.radius)&&2===r.radius.length?r.radius:[null,r.radius]:null,n}return d.default(t,e),y.default(t,[{key:"inject",value:function(){s.default(u.default(t.prototype),"inject",this).call(this),x.default.defines.TANGRAM_POINTLIGHT_ATTENUATION_EXPONENT=0!==this.attenuation,x.default.defines.TANGRAM_POINTLIGHT_ATTENUATION_INNER_RADIUS=null!=this.radius&&null!=this.radius[0],x.default.defines.TANGRAM_POINTLIGHT_ATTENUATION_OUTER_RADIUS=null!=this.radius}},{key:"update",value:function(){this.updateEyePosition()}},{key:"updateEyePosition",value:function(){if("world"===this.origin){var e=T.default.latLngToMeters(this.position),t=a.default(e,2),r=t[0],n=t[1];this.position_eye[0]=r-this.view.camera.position_meters[0],this.position_eye[1]=n-this.view.camera.position_meters[1],this.position_eye[2]=R.StyleParser.convertUnits(this.position[2],{zoom:this.view.zoom,meters_per_pixel:T.default.metersPerPixel(this.view.zoom)}),this.position_eye[2]=this.position_eye[2]-this.view.camera.position_meters[2]}else("ground"===this.origin||"camera"===this.origin)&&(this.position_eye=R.StyleParser.convertUnits(this.position,{zoom:this.view.zoom,meters_per_pixel:T.default.metersPerPixel(this.view.zoom)}),"ground"===this.origin&&(this.position_eye[2]=this.position_eye[2]-this.view.camera.position_meters[2]));this.position_eye[3]=1}},{key:"setupProgram",value:function(e){s.default(u.default(t.prototype),"setupProgram",this).call(this,e),e.uniform("4fv","u_"+this.name+".position",this.position_eye),x.default.defines.TANGRAM_POINTLIGHT_ATTENUATION_EXPONENT&&e.uniform("1f","u_"+this.name+".attenuationExponent",this.attenuation),x.default.defines.TANGRAM_POINTLIGHT_ATTENUATION_INNER_RADIUS&&e.uniform("1f","u_"+this.name+".innerRadius",R.StyleParser.convertUnits(this.radius[0],{zoom:this.view.zoom,meters_per_pixel:T.default.metersPerPixel(this.view.zoom)})),x.default.defines.TANGRAM_POINTLIGHT_ATTENUATION_OUTER_RADIUS&&e.uniform("1f","u_"+this.name+".outerRadius",R.StyleParser.convertUnits(this.radius[1],{zoom:this.view.zoom,meters_per_pixel:T.default.metersPerPixel(this.view.zoom)}))}}],[{key:"inject",value:function(){x.default.addBlock(P.block,z)}}]),t}(P);P.types.point=O;var I=function(e){function t(e,r){g.default(this,t);var n=f.default(this,u.default(t).call(this,e,r));return n.type="spotlight",n.struct_name="SpotLight",n.direction=n._direction=(r.direction||[0,0,-1]).map(parseFloat),n.exponent=r.exponent?parseFloat(r.exponent):.2,n.angle=r.angle?parseFloat(r.angle):20,n}return d.default(t,e),y.default(t,[{key:"setupProgram",value:function(e){s.default(u.default(t.prototype),"setupProgram",this).call(this,e),e.uniform("3fv","u_"+this.name+".direction",this.direction),e.uniform("1f","u_"+this.name+".spotCosCutoff",Math.cos(3.14159*this.angle/180)),e.uniform("1f","u_"+this.name+".spotExponent",this.exponent)}},{key:"direction",get:function(){return this._direction},set:function(e){this._direction=S.default.normalize(e)}}],[{key:"inject",value:function(){x.default.addBlock(P.block,C)}}]),t}(O);P.types.spotlight=I},{"./geo":299,"./gl/glsl":303,"./gl/shader_program":305,"./styles/style_parser":340,"./vector":361,"babel-runtime/core-js/object/get-prototype-of":14,"babel-runtime/core-js/object/keys":15,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22,"babel-runtime/helpers/get":24,"babel-runtime/helpers/inherits":25,"babel-runtime/helpers/possibleConstructorReturn":26,"babel-runtime/helpers/slicedToArray":27}],320:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var i=e("babel-runtime/helpers/classCallCheck"),a=n(i),o=e("babel-runtime/helpers/createClass"),s=n(o),l=e("./gl/glsl"),u=n(l),c=e("./styles/style_parser"),f="/*\n\nDefines globals:\nmaterial\nlight_accumulator_*\n\n*/\n\n\n// MATERIALS\n//\nstruct Material {\n #ifdef TANGRAM_MATERIAL_EMISSION\n vec4 emission;\n #ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE\n vec3 emissionScale;\n #endif\n #endif\n\n #ifdef TANGRAM_MATERIAL_AMBIENT\n vec4 ambient;\n #ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE\n vec3 ambientScale;\n #endif\n #endif\n\n #ifdef TANGRAM_MATERIAL_DIFFUSE\n vec4 diffuse;\n #ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE\n vec3 diffuseScale;\n #endif\n #endif\n\n #ifdef TANGRAM_MATERIAL_SPECULAR\n vec4 specular;\n float shininess;\n #ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE\n vec3 specularScale;\n #endif\n #endif\n\n\n #ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE\n vec3 normalScale;\n float normalAmount;\n #endif\n};\n\n// Note: uniform is copied to a global instance to allow modification\nuniform Material u_material;\nMaterial material;\n\n#ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE\nuniform sampler2D u_material_emission_texture;\n#endif\n\n#ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE\nuniform sampler2D u_material_ambient_texture;\n#endif\n\n#ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE\nuniform sampler2D u_material_diffuse_texture;\n#endif\n\n#ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE\nuniform sampler2D u_material_specular_texture;\n#endif\n\n#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE\nuniform sampler2D u_material_normal_texture;\n#endif\n\n// Global light accumulators for each property\nvec4 light_accumulator_ambient = vec4(vec3(0.0), 1.);\nvec4 light_accumulator_diffuse = vec4(vec3(0.0), 1.);\n#ifdef TANGRAM_MATERIAL_SPECULAR\n vec4 light_accumulator_specular = vec4(vec3(0.0), 1.);\n#endif\n\n\n#ifdef TANGRAM_MATERIAL_TEXTURE_SPHEREMAP\nvec4 getSphereMap (in sampler2D _tex, in vec3 _eyeToPoint, in vec3 _normal, in vec2 _skew) {\n vec3 eye = normalize(_eyeToPoint);\n eye.xy -= _skew;\n eye = normalize(eye);\n\n vec3 r = reflect(eye, _normal);\n r.z += 1.0;\n float m = 2. * length(r);\n vec2 uv = r.xy / m + .5;\n return texture2D(_tex, uv);\n}\n#endif\n\n\n#ifdef TANGRAM_MATERIAL_TEXTURE_TRIPLANAR\nvec3 getTriPlanarBlend (in vec3 _normal) {\n vec3 blending = abs(_normal);\n blending = normalize(max(blending, 0.00001));\n float b = (blending.x + blending.y + blending.z);\n return blending / b;\n}\n\nvec4 getTriPlanar (in sampler2D _tex, in vec3 _pos, in vec3 _normal, in vec3 _scale) {\n vec3 blending = getTriPlanarBlend(_normal);\n vec4 xaxis = texture2D(_tex, fract(_pos.yz * _scale.x));\n vec4 yaxis = texture2D(_tex, fract(_pos.xz * _scale.y));\n vec4 zaxis = texture2D(_tex, fract(_pos.xy * _scale.z));\n return xaxis * blending.x + yaxis * blending.y + zaxis * blending.z;\n}\n#endif\n\n\n#ifdef TANGRAM_MATERIAL_TEXTURE_PLANAR\nvec4 getPlanar (in sampler2D _tex, in vec3 _pos, in vec2 _scale) {\n return texture2D( _tex, fract(_pos.xy * _scale.x) );\n}\n#endif\n\n\n#ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE\nvoid calculateNormal (inout vec3 _normal) {\n // Get NORMALMAP\n //------------------------------------------------\n #ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE_UV\n _normal += texture2D(u_material_normal_texture, fract(v_texcoord*material.normalScale.xy)).rgb*2.0-1.0;\n #endif\n\n #ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE_PLANAR\n vec3 normalTex = getPlanar(u_material_normal_texture, v_world_position.xyz, material.normalScale.xy).rgb*2.0-1.0;\n _normal += normalTex;\n #endif\n\n #ifdef TANGRAM_MATERIAL_NORMAL_TEXTURE_TRIPLANAR\n vec3 normalTex = getTriPlanar(u_material_normal_texture, v_world_position.xyz, _normal, material.normalScale).rgb*2.0-1.0;\n _normal += normalTex;\n #endif\n\n _normal = normalize(_normal);\n}\n#endif\n\nvoid calculateMaterial (in vec3 _eyeToPoint, inout vec3 _normal) {\n // get EMISSION TEXTUREMAP\n //------------------------------------------------\n #ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE\n #ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_UV\n material.emission *= texture2D(u_material_emission_texture,v_texcoord);\n #endif\n\n #ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_PLANAR\n material.emission *= getPlanar(u_material_emission_texture, v_world_position.xyz, material.emissionScale.xy);\n #endif\n\n #ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_TRIPLANAR\n material.emission *= getTriPlanar(u_material_emission_texture, v_world_position.xyz, _normal, material.emissionScale);\n #endif\n\n #ifdef TANGRAM_MATERIAL_EMISSION_TEXTURE_SPHEREMAP\n material.emission *= getSphereMap(u_material_emission_texture, _eyeToPoint, _normal, u_vanishing_point);\n #endif\n #endif\n\n // get AMBIENT TEXTUREMAP\n //------------------------------------------------\n #ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE\n #ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_UV\n material.ambient *= texture2D(u_material_ambient_texture,v_texcoord);\n #endif\n\n #ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_PLANAR\n material.ambient *= getPlanar(u_material_ambient_texture, v_world_position.xyz, material.ambientScale.xy);\n #endif\n\n #ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_TRIPLANAR\n material.ambient *= getTriPlanar(u_material_ambient_texture, v_world_position.xyz, _normal, material.ambientScale);\n #endif\n\n #ifdef TANGRAM_MATERIAL_AMBIENT_TEXTURE_SPHEREMAP\n material.ambient *= getSphereMap(u_material_ambient_texture, _eyeToPoint, _normal, u_vanishing_point);\n #endif\n #endif\n\n // get DIFFUSE TEXTUREMAP\n //------------------------------------------------\n #ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE\n #ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_UV\n material.diffuse *= texture2D(u_material_diffuse_texture,v_texcoord);\n #endif\n\n #ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_PLANAR\n material.diffuse *= getPlanar(u_material_diffuse_texture, v_world_position.xyz, material.diffuseScale.xy);\n #endif\n\n #ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_TRIPLANAR\n material.diffuse *= getTriPlanar(u_material_diffuse_texture, v_world_position.xyz, _normal, material.diffuseScale);\n #endif\n\n #ifdef TANGRAM_MATERIAL_DIFFUSE_TEXTURE_SPHEREMAP\n material.diffuse *= getSphereMap(u_material_diffuse_texture, _eyeToPoint, _normal, u_vanishing_point);\n #endif\n #endif\n\n // get SPECULAR TEXTUREMAP\n //------------------------------------------------\n #ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE\n #ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_UV\n material.specular *= texture2D(u_material_specular_texture,v_texcoord);\n #endif\n\n #ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_PLANAR\n material.specular *= getPlanar(u_material_specular_texture, v_world_position.xyz, material.specularScale.xy);\n #endif\n\n #ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_TRIPLANAR\n material.specular *= getTriPlanar(u_material_specular_texture, v_world_position.xyz, _normal, material.specularScale);\n #endif\n\n #ifdef TANGRAM_MATERIAL_SPECULAR_TEXTURE_SPHEREMAP\n material.specular *= getSphereMap(u_material_specular_texture, _eyeToPoint, _normal, u_vanishing_point);\n #endif\n #endif\n}\n",h=function(){function e(t){a.default(this,e),t=t||{};for(var r=["emission","ambient","diffuse","specular"],n=0;n0&&T.default("debug","loading custom data source scripts in worker:",n),this.data_source_scripts=(e=[]).concat.apply(e,g.default(n)).sort(),!(this.data_source_scripts.length===r.length&&this.data_source_scripts.every(function(e,t){return e===r[t]}))}},{key:"createWorkers",value:function(){return this.updateDataSourceScripts()&&this.destroyWorkers(),this.workers?d.default.resolve():this.makeWorkers(this.getWorkerUrl())}},{key:"makeWorkers",value:function(e){var t=this,r=[];this.workers=[];for(var n=function(){a=new Worker(e),t.workers[i]=a,j.default.addWorker(a),T.default("debug","Scene.makeWorkers: initializing worker "+i);var n=i;r.push(j.default.postMessage(a,"self.init",t.id,i,t.num_workers,t.log_level,S.default.device_pixel_ratio).then(function(e){return T.default("debug","Scene.makeWorkers: initialized worker "+e),e},function(e){return T.default("error","Scene.makeWorkers: failed to initialize worker "+n+":",e),d.default.reject(e)}))},i=0;i0||this.ready()===!1);return"function"==typeof this.preUpdate&&this.preUpdate(e),e?(this.dirty=!1,this.updateDevicePixelRatio(),this.render(),this.updateViewComplete(),this.media_capture.completeScreenshot(),"function"==typeof this.postUpdate&&this.postUpdate(e),this.animated===!0&&(this.dirty=!0),this.frame++,T.default("trace","Scene.render()"),!0):!1}},{key:"render",value:function(){var e=this,t=this.gl;if(this.view.update(),m.default(this.active_styles).forEach(function(t){return e.styles[t].update()}),m.default(this.lights).forEach(function(t){return e.lights[t].update()}),this.renderable_tiles=this.tile_manager.getRenderableTiles(),this.renderable_tiles_count=this.renderable_tiles.length,this.render_count=this.renderPass(),this.selection.pendingRequests()){if(this.view.panning||this.view.zooming)return void this.selection.clearPendingRequests();this.selection.bind(),this.renderPass("selection_program",{allow_blend:!1}),this.selection.read(),t.bindFramebuffer(t.FRAMEBUFFER,null),t.viewport(0,0,this.canvas.width,this.canvas.height)}return this.render_count_changed=!1,this.render_count!==this.last_render_count&&(this.render_count_changed=!0,this.getFeatureSelectionMapSize().then(function(t){t&&T.default("info","Scene: rendered "+e.render_count+" primitives ("+t+" features in selection map)")})),this.last_render_count=this.render_count,!0}},{key:"renderPass",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?"program":arguments[0],r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=r.allow_blend;n=null==n?!0:n,this.clearFrame({clear_color:!0,clear_depth:!0});for(var i=m.default(this.active_styles).map(function(t){return e.styles[t] }).sort(U.Style.blendOrderSort),a=0,o=void 0,s=0;s-1)&&e.tile_manager.buildTile(t,{fade_in:c})}),e.tile_manager.updateTilesForView(),void e.tile_manager.checkBuildQueue())}).then(function(){l&&e._profileEnd("Scene.rebuild")})}},{key:"tileManagerBuildDone",value:function(){if(this.building){T.default("info","Scene: build geometry finished"),this.building.resolve&&this.building.resolve(!0);var e=this.building.queued;this.building=null,e&&(T.default("debug","Scene: starting queued rebuild() request"),this.rebuild().then(e.resolve,e.reject))}}},{key:"loadScene",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?null:arguments[0],r=arguments.length<=1||void 0===arguments[1]?null:arguments[1];return this.config_source=t||this.config_source,this.config_globals_applied=[],this.config_path=S.default.pathForURL("string"==typeof this.config_source?r||this.config_source:r),G.default.loadScene(this.config_source,this.config_path).then(function(t){return e.config=t,e.trigger("load",{config:e.config}),e.config})}},{key:"setDataSource",value:function(e,t){if(!e||!t||!t.type||!t.url&&!t.data)return void T.default("error","No name provided or not a valid config:",e,t);var r=null==this.config.sources[e],n=this.config.sources[e]=f.default({},t);return n.data&&"object"===y.default(n.data)&&(n.url=S.default.createObjectURL(new Blob([u.default(n.data)])),delete n.data),r?this.updateConfig({rebuild:{sources:[e]}}):this.rebuild({sources:[e]})}},{key:"createDataSources",value:function(){var e=[],t=m.default(this.sources);for(var r in this.config.sources){var n=this.config.sources[r],i=this.sources[r];try{if(this.sources[r]=J.default.create(f.default({},n,{name:r}),this.sources),!this.sources[r])throw{}}catch(a){delete this.sources[r];var o="Could not create data source: "+a.message;T.default("warn","Scene: "+o,n),this.trigger("warning",{type:"sources",source:n,message:o})}J.default.changed(this.sources[r],i)&&e.push(r)}var l=!0,u=!1,c=void 0;try{for(var h,d=s.default(t);!(l=(h=d.next()).done);l=!0){var p=h.value;this.config.sources[p]||(delete this.sources[p],e.push(p))}}catch(_){u=!0,c=_}finally{try{!l&&d.return&&d.return()}finally{if(u)throw c}}e.length>0&&this.tile_manager.removeTiles(function(t){return e.indexOf(t.source.name)>-1});var g=!0,v=!1,y=void 0;try{for(var b,x=s.default(S.default.values(this.config.layers));!(g=(b=x.next()).done);g=!0){var w=b.value;w.data&&this.sources[w.data.source]&&(this.sources[w.data.source].builds_geometry_tiles=!0)}}catch(_){v=!0,y=_}finally{try{!g&&x.return&&x.return()}finally{if(v)throw y}}}},{key:"loadTextures",value:function(){var e=this;return L.default.createFromObject(this.gl,this.config.textures).then(function(){return L.default.createDefault(e.gl)})}},{key:"updateStyles",value:function(){if(!this.initialized&&!this.initializing)throw new Error("Scene.updateStyles() called before scene was initialized");this.styles=this.style_manager.build(this.config.styles),this.style_manager.initStyles(this);var e=!0,t=!1,r=void 0;try{for(var n,i=s.default(S.default.values(this.styles));!(e=(n=i.next()).done);e=!0){var a=n.value;a.setGL(this.gl)}}catch(o){t=!0,r=o}finally{try{!e&&i.return&&i.return()}finally{if(t)throw r}}this.updateActiveStyles(),this.style_manager.compile(m.default(this.active_styles),this),this.dirty=!0}},{key:"updateActiveStyles",value:function(){var e=this,t=m.default(this.active_styles||{});this.active_styles={};var r=!1,n=!0,i=!1,o=void 0;try{for(var l,u=s.default(S.default.recurseValues(this.config.layers));!(n=(l=u.next()).done);n=!0){var c=l.value;if(c&&c.draw){var f=!0,h=!1,d=void 0;try{for(var p,_=s.default(S.default.entries(c.draw));!(f=(p=_.next()).done);f=!0){var g=a.default(p.value,2),v=g[0],b=g[1];if(null!=b&&"object"===("undefined"==typeof b?"undefined":y.default(b))&&b.visible!==!1){var x=b.style||v,w=[x];b.outline&&b.outline.style&&w.push(b.outline.style),w=w.filter(function(t){return e.styles[t]}).forEach(function(t){var n=e.styles[t];n&&(e.active_styles[t]=!0,n.animated&&(r=!0))})}}}catch(k){h=!0,d=k}finally{try{!f&&_.return&&_.return()}finally{if(h)throw d}}}}}catch(k){i=!0,o=k}finally{try{!n&&u.return&&u.return()}finally{if(i)throw o}}return this.animated=void 0!==this.config.scene.animated?this.config.scene.animated:r,m.default(this.active_styles).filter(function(e){return-1===t.indexOf(e)})}},{key:"getActiveCamera",value:function(){return this.view.getActiveCamera()}},{key:"setActiveCamera",value:function(e){return this.view.setActiveCamera(e)}},{key:"createLights",value:function(){this.lights={};for(var e in this.config.lights)if(this.config.lights[e]&&"object"===y.default(this.config.lights[e])){var t=this.config.lights[e];t.name=e.replace("-","_"),t.visible=t.visible===!1?!1:!0,t.visible&&(this.lights[t.name]=Z.default.create(this.view,t))}Z.default.inject(this.lights)}},{key:"setBackground",value:function(){var e,t=this.config.scene.background;this.background={},t&&t.color&&(this.background.color=D.StyleParser.parseColor(t.color)),this.background.color||(this.background.color=[0,0,0,0]),this.canvas.style.backgroundColor=1===this.background.color[3]?"rgba("+this.background.color.map(function(e){return Math.floor(255*e)}).join(", ")+")":"transparent",(e=this.gl).clearColor.apply(e,g.default(this.background.color))}},{key:"setIntrospection",value:function(e){this.introspection=e||!1,this.updateConfig()}},{key:"updateConfig",value:function(){var t=this,r=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=r.rebuild,i=void 0===n?!0:n,a=r.serialize_funcs,o=r.fade_in,s=void 0===o?!1:o;this.generation=++e.generation,this.updating++,this.config=G.default.applyGlobalProperties(this.config,this.config_globals_applied),this.style_manager.init(),this.view.reset(),this.createLights(),this.createDataSources(),this.loadTextures(),this.setBackground(),rt.default.loadFonts(this.config.fonts),this.updateStyles();var l=i?this.rebuild(f.default({serialize_funcs:a,fade_in:s},"object"===("undefined"==typeof i?"undefined":y.default(i))&&i)):this.syncConfigToWorker({serialize_funcs:a});return l.then(function(){t.updating--,t.view.updateBounds(),t.requestRedraw()})}},{key:"syncConfigToWorker",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.serialize_funcs,r=void 0===t?!0:t;return this.config_serialized=r?S.default.serializeWithFunctions(this.config):u.default(this.config),j.default.postMessage(this.workers,"self.updateConfig",{config:this.config_serialized,generation:this.generation,introspection:this.introspection})}},{key:"createListeners",value:function(){var e=this;this.listeners={},this.listeners.view={move:function(){return e.trigger("move")}},this.view.subscribe(this.listeners.view),this.listeners.texture={update:function(){return e.dirty=!0},warning:function(t){return e.trigger("warning",f.default({type:"textures"},t))}},L.default.subscribe(this.listeners.texture),this.listeners.scene_loader={error:function(t){return e.trigger("error",f.default({type:"scene"},t))}},G.default.subscribe(this.listeners.scene_loader)}},{key:"destroyListeners",value:function(){this.unsubscribeAll(),this.view.unsubscribe(this.listeners.view),L.default.unsubscribe(this.listeners.texture),G.default.unsubscribe(this.listeners.scene_loader),this.listeners=null}},{key:"resetFeatureSelection",value:function(){this.selection?this.workers&&j.default.postMessage(this.workers,"self.resetFeatureSelection"):this.selection=new $.default(this.gl,this.workers)}},{key:"getFeatureSelectionMapSize",value:function(){var e=this;return this.fetching_selection_map?d.default.resolve():(this.fetching_selection_map=!0,j.default.postMessage(this.workers,"self.getFeatureSelectionMapSize").then(function(t){return e.fetching_selection_map=!1,t.reduce(function(e,t){return e+t})}))}},{key:"resetTime",value:function(){this.start_time=+new Date}},{key:"updateViewComplete",value:function(){!this.render_count_changed&&this.generation===this.last_complete_generation||this.tile_manager.isLoadingVisibleTiles()||(this.last_complete_generation=this.generation,this.trigger("view_complete"))}},{key:"resetViewComplete",value:function(){this.last_complete_generation=null}},{key:"screenshot",value:function(){return this.requestRedraw(),this.media_capture.screenshot()}},{key:"startVideoCapture",value:function(){return this.requestRedraw(),this.media_capture.startVideoCapture()}},{key:"stopVideoCapture",value:function(){return this.media_capture.stopVideoCapture()}},{key:"_profile",value:function(e){console.profile("main thread: "+e),j.default.postMessage(this.workers,"self.profile",e)}},{key:"_profileEnd",value:function(e){console.profileEnd("main thread: "+e),j.default.postMessage(this.workers,"self.profileEnd",e)}},{key:"setupDebug",value:function(){var e=this;this.debug={timeRebuild:function(){var t=arguments.length<=0||void 0===arguments[0]?1:arguments[0],r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=[],i=function a(){var i=+new Date;e.rebuild(r).then(function(){if(n.push(+new Date-i),n.length0?"Found multiple YAML files at the root level: "+t.map(function(e){return"'"+e+"'"}).join(", ")+".":"Found NO YAML files at the root level.",l.default.reject(Error(r))}return l.default.resolve()}},{key:"parseZipFiles",value:function(){var e=this,t=[],r=[];return this.zip.forEach(function(e,n){n.dir||(t.push(e),r.push(n.async("arraybuffer")))}),l.default.all(r).then(function(r){for(var n=0;n0&&n.forEach(function(e){var r="Failed to import scene: "+e.url;g.default("error",r,e),t.trigger("error",{type:"scene_import",message:r,error:e,url:e.url})}),e):m.default.reject(n[0])})},loadSceneRecursive:function(e,t){var r=e.url,n=e.path,i=e.type,a=this,o=arguments.length<=2||void 0===arguments[2]?[]:arguments[2];if(!r)return m.default.resolve({});var s=E.createSceneBundle(r,n,t,i);return s.load().then(function(e){if("string"==typeof e.import&&(e.import=[e.import]),!Array.isArray(e.import))return a.normalize(e,s),e;var t=[],r=!0,n=!1,i=void 0;try{for(var l,u=f.default(e.import);!(r=(l=u.next()).done);r=!0){var c=l.value;t.push(s.resourceFor(c))}}catch(h){n=!0,i=h}finally{try{!r&&u.return&&u.return()}finally{if(n)throw i}}return delete e.import,m.default.all(t.map(function(e){return a.loadSceneRecursive(e,s,o)})).then(function(t){return e=k.default.apply(void 0,[{}].concat(d.default(t),[e])),a.normalize(e,s),e})}).catch(function(e){e.url=r,o.push(e)})},normalize:function(e,t){return this.normalizeDataSources(e,t),this.normalizeFonts(e,t),this.normalizeTextures(e,t),e},normalizeDataSources:function(e,t){e.sources=e.sources||{};var r=!0,n=!1,i=void 0;try{for(var a,o=f.default(y.default.values(e.sources));!(r=(a=o.next()).done);r=!0){var s=a.value;s.url=t.urlFor(s.url),Array.isArray(s.scripts)&&(s.scripts=s.scripts.map(function(e){return t.urlFor(e)}))}}catch(l){n=!0,i=l}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}return e},normalizeFonts:function(e,t){e.fonts=e.fonts||{};var r=!0,n=!1,i=void 0;try{for(var a,o=f.default(y.default.recurseValues(e.fonts));!(r=(a=o.next()).done);r=!0){var s=a.value;s.url&&(s.url=t.urlFor(s.url))}}catch(l){n=!0,i=l}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}return e},normalizeTextures:function(e,t){if(e.textures=e.textures||{},e.textures){var r=!0,n=!1,i=void 0;try{for(var a,o=f.default(y.default.values(e.textures));!(r=(a=o.next()).done);r=!0){var s=a.value;s.url&&(s.url=t.urlFor(s.url))}}catch(l){n=!0,i=l}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}}if(e.styles){var u=!0,c=!1,h=void 0;try{for(var d,p=f.default(y.default.values(e.styles));!(u=(d=p.next()).done);u=!0){var m=d.value,_=m.texture;if("string"!=typeof _||e.textures[_]||(_=t.urlFor(_),e.textures[_]={url:_},m.texture=_),m.material)for(var g=["emission","ambient","diffuse","specular","normal"],v=0;v0?N.default.syncTexturesToWorker(t):s.default.resolve()},updateDevicePixelRatio:function(e){g.default.device_pixel_ratio=e},profile:function(e){console.profile("worker "+self._worker_id+": "+e)},profileEnd:function(e){console.profileEnd("worker "+self._worker_id+": "+e)}}),x.default.addTarget("self",self))},{"./gl/texture":306,"./selection":326,"./sources/data_source":327,"./styles/layer":332,"./styles/style_manager":339,"./styles/style_parser":340,"./tile":346,"./utils/log":352,"./utils/merge":354,"./utils/thread":357,"./utils/utils":358,"./utils/worker_broker":360,"babel-runtime/core-js/json/stringify":6,"babel-runtime/core-js/object/assign":9,"babel-runtime/core-js/object/keys":15,"babel-runtime/core-js/promise":17,"babel-runtime/helpers/toConsumableArray":28}],326:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var i=e("babel-runtime/core-js/json/stringify"),a=n(i),o=e("babel-runtime/core-js/promise"),s=n(o),l=e("babel-runtime/helpers/classCallCheck"),u=n(l),c=e("babel-runtime/helpers/createClass"),f=n(c),h=e("./utils/log"),d=n(h),p=e("./gl/texture"),m=n(p),_=e("./utils/worker_broker"),g=n(_),v=function(){function e(t,r){u.default(this,e),this.gl=t,this.workers=r,this.init()}return f.default(e,[{key:"init",value:function(){this.requests={},this.feature=null,this.read_delay=5,this.read_delay_timer=null,this.pixel=new Uint8Array(4),this.pixel32=new Float32Array(this.pixel.buffer),this.fbo=this.gl.createFramebuffer(),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this.fbo),this.fbo_size={width:256,height:256},this.fbo_size.aspect=this.fbo_size.width/this.fbo_size.height;var e=m.default.create(this.gl,"selection_fbo",{filtering:"nearest"});e.setData(this.fbo_size.width,this.fbo_size.height,null,{filtering:"nearest"}),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,e.texture,0);var t=this.gl.createRenderbuffer();this.gl.bindRenderbuffer(this.gl.RENDERBUFFER,t),this.gl.renderbufferStorage(this.gl.RENDERBUFFER,this.gl.DEPTH_COMPONENT16,this.fbo_size.width,this.fbo_size.height),this.gl.framebufferRenderbuffer(this.gl.FRAMEBUFFER,this.gl.DEPTH_ATTACHMENT,this.gl.RENDERBUFFER,t),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null)}},{key:"destroy",value:function(){this.gl&&this.fbo&&(this.gl.deleteFramebuffer(this.fbo),this.fbo=null,this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null))}},{key:"bind",value:function(){this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this.fbo),this.gl.viewport(0,0,this.fbo_size.width,this.fbo_size.height)}},{key:"getFeatureAt",value:function(e){var t=this;return new s.default(function(r,n){t.selection_request_id=t.selection_request_id+1||0,t.requests[t.selection_request_id]={type:"point",id:t.selection_request_id,point:e,resolve:r,reject:n}})}},{key:"pendingRequests",value:function(){return this.requests}},{key:"clearPendingRequests",value:function(){for(var e in this.requests){var t=this.requests[e];t.sent||(t.reject({request:t}),delete this.requests[e])}}},{key:"read",value:function(){var e=this;null!=this.read_delay_timer&&clearTimeout(this.read_delay_timer),this.read_delay_timer=setTimeout(function(){var t=e.gl;t.bindFramebuffer(t.FRAMEBUFFER,e.fbo);for(var r in e.requests){var n=e.requests[r];if(!n.sent&&"point"===n.type){t.readPixels(Math.floor(n.point.x*e.fbo_size.width),Math.floor((1-n.point.y)*e.fbo_size.height),1,1,t.RGBA,t.UNSIGNED_BYTE,e.pixel); -var i=e.pixel[0]+(e.pixel[1]<<8)+(e.pixel[2]<<16)+(e.pixel[3]<<24)>>>0,a=e.pixel[3];255!==a?null!=e.workers[a]&&g.default.postMessage(e.workers[a],"self.getFeatureSelection",{id:n.id,key:i}).then(function(t){e.finishRead(t)}):e.finishRead({id:n.id,feature:null}),n.sent=!0}}t.bindFramebuffer(t.FRAMEBUFFER,null)},this.read_delay)}},{key:"finishRead",value:function(e){var t=this.requests[e.id];if(!t)return void d.default("error","FeatureSelection.finishRead(): could not find message",e);var r=e.feature,n=!1;(null!=r&&null==this.feature||null==r&&null!=this.feature||null!=r&&null!=this.feature&&a.default(r)!==a.default(this.feature))&&(n=!0),this.feature=r,t.resolve({feature:r,changed:n,request:t}),delete this.requests[e.id]}}],[{key:"makeEntry",value:function(e){this.map_entry++;var t=255&this.map_entry,r=this.map_entry>>8&255,n=this.map_entry>>16&255,i=this.map_prefix,a=t/255,o=r/255,s=n/255,l=i/255,u=t+(r<<8)+(n<<16)+(i<<24)>>>0;return this.map[u]={color:[a,o,s,l]},this.map_size++,this.tiles[e.key]||(this.tiles[e.key]={entries:[],tile:{key:e.key,coords:e.coords,style_zoom:e.style_zoom,source:e.source,generation:e.generation}}),this.tiles[e.key].entries.push(u),this.map[u]}},{key:"makeColor",value:function(e,t,r){var n=this.makeEntry(t);return n.feature={id:e.id,properties:e.properties,source_name:r.source,source_layer:r.layer,layers:r.layers,tile:this.tiles[t.key].tile},n.color}},{key:"reset",value:function(){this.tiles={},this.map={},this.map_size=0,this.map_entry=0}},{key:"clearTile",value:function(e){var t=this;this.tiles[e]&&(this.tiles[e].entries.forEach(function(e){return delete t.map[e]}),this.map_size-=this.tiles[e].entries.length,delete this.tiles[e])}},{key:"getMapSize",value:function(){return this.map_size}},{key:"setPrefix",value:function(e){this.map_prefix=e}}]),e}();r.default=v,v.map={},v.tiles={},v.map_size=0,v.map_entry=0,v.map_prefix=0,v.defaultColor=[0,0,0,1]},{"./gl/texture":306,"./utils/log":352,"./utils/worker_broker":360,"babel-runtime/core-js/json/stringify":6,"babel-runtime/core-js/promise":17,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22}],327:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0}),r.NetworkTileSource=r.NetworkSource=void 0;var i=e("babel-runtime/helpers/get"),a=n(i),o=e("babel-runtime/core-js/promise"),s=n(o),l=e("babel-runtime/core-js/object/get-prototype-of"),u=n(l),c=e("babel-runtime/helpers/possibleConstructorReturn"),f=n(c),h=e("babel-runtime/helpers/inherits"),d=n(h),p=e("babel-runtime/helpers/slicedToArray"),m=n(p),_=e("babel-runtime/core-js/json/stringify"),g=n(_),v=e("babel-runtime/core-js/object/assign"),y=n(v),b=e("babel-runtime/core-js/get-iterator"),x=n(b),w=e("babel-runtime/core-js/set"),k=n(w),A=e("babel-runtime/helpers/toConsumableArray"),T=n(A),E=e("babel-runtime/helpers/classCallCheck"),S=n(E),R=e("babel-runtime/helpers/createClass"),j=n(R),M=e("../geo"),z=n(M),C=e("../utils/errors"),P=e("../utils/utils"),N=n(P),L=function(){function e(t,r){S.default(this,e),this.config=t,this.sources=r,this.id=t.id,this.name=t.name,this.pad_scale=t.pad_scale||1e-4,this.default_winding=null,this.rasters=Array.isArray(t.rasters)?[].concat(T.default(new k.default(t.rasters))):[],this.transform=t.transform,"function"==typeof this.transform&&this.transform.bind(this),this.extra_data=t.extra_data,this.scripts=t.scripts,this.max_zoom=null!=t.max_zoom?t.max_zoom:z.default.default_source_max_zoom,this.min_display_zoom=null!=t.min_display_zoom?t.min_display_zoom:0,this.max_display_zoom=null!=t.max_display_zoom?t.max_display_zoom:null}return j.default(e,[{key:"load",value:function(e){var t=this;return e.source_data={},e.source_data.layers={},e.pad_scale=this.pad_scale,e.rasters=[].concat(T.default(this.rasters)),this._load(e).then(function(e){for(var r in e.source_data.layers){var n=e.source_data.layers[r];n&&n.features&&n.features.forEach(function(e){z.default.transformGeometry(e.geometry,function(e){e[1]=-e[1],t.pad_scale&&(e[0]=Math.round(e[0]*(1+t.pad_scale)-z.default.tile_scale*t.pad_scale/2),e[1]=Math.round(e[1]*(1+t.pad_scale)-z.default.tile_scale*t.pad_scale/2))}),t.updateDefaultWinding(e.geometry)})}return e.default_winding=t.default_winding||"CCW",e})}},{key:"_load",value:function(){throw new C.MethodNotImplemented("_load")}},{key:"updateDefaultWinding",value:function(e){return null==this.default_winding&&("Polygon"===e.type?this.default_winding=z.default.ringWinding(e.coordinates[0]):"MultiPolygon"===e.type&&(this.default_winding=z.default.ringWinding(e.coordinates[0][0]))),this.default_winding}},{key:"includesTile",value:function(e,t){if(e.zthis.max_display_zoom)return!1;var r=!0,n=!1,i=void 0;try{for(var a,o=x.default(this.rasters);!(r=(a=o.next()).done);r=!0){var s=a.value;if(this.sources[s]&&this.sources[s]!==this&&!this.sources[s].includesTile(e,e.z))return!1}}catch(l){n=!0,i=l}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}return!0}}],[{key:"create",value:function(t,r){return e.types[t.type]?new e.types[t.type](t,r):void 0}},{key:"changed",value:function(e,t){if(!e||!t)return!0;var r=y.default({},e.config,{id:null}),n=y.default({},t.config,{id:null});return g.default(r)!==g.default(n)}},{key:"projectData",value:function(e){var t=+new Date;for(var r in e.layers)for(var n=e.layers[r].features.length,i=0;n>i;i++){var a=e.layers[r].features[i];z.default.transformGeometry(a.geometry,function(e){var t=z.default.latLngToMeters(e),r=m.default(t,2),n=r[0],i=r[1];e[0]=n,e[1]=i})}void 0!==e.debug&&(e.debug.projection=+new Date-t)}},{key:"scaleData",value:function(e,t){var r=t.coords.z,n=t.min,i=(t.max,z.default.unitsPerMeter(r));for(var a in e.layers)for(var o=e.layers[a].features.length,s=0;o>s;s++){var l=e.layers[a].features[s];z.default.transformGeometry(l.geometry,function(e){e[0]=(e[0]-n.x)*i,e[1]=(e[1]-n.y)*i*-1})}}},{key:"register",value:function(t,r){t&&r&&(e.types[r]=t)}}]),e}();r.default=L,L.types={};{var O=r.NetworkSource=function(e){function t(e,r){S.default(this,t);var n=f.default(this,u.default(t).call(this,e,r));if(n.url=N.default.addParamsToURL(e.url,e.url_params),n.response_type="",null==n.url)throw Error("Network data source must provide a `url` property");return n}return d.default(t,e),j.default(t,[{key:"_load",value:function(e){var t=this,r=this.formatUrl(this.url,e),n=e.source_data;return n.url=r,e.debug=e.debug||{},e.debug.network=+new Date,new s.default(function(i){n.error=null;var a=N.default.io(r,6e4,t.response_type);n.request=a.request,a.then(function(r){e.debug.response_size=r.length||r.byteLength,e.debug.network=+new Date-e.debug.network,e.debug.parsing=+new Date,t.parseSourceData(e,n,r),e.debug.parsing=+new Date-e.debug.parsing,i(e)}).catch(function(t){n.error=t.stack,i(e)})})}},{key:"formatUrl",value:function(){throw new C.MethodNotImplemented("formatUrl")}},{key:"parseSourceData",value:function(){throw new C.MethodNotImplemented("parseSourceData")}}]),t}(L);r.NetworkTileSource=function(e){function t(e,r){S.default(this,t);var n=f.default(this,u.default(t).call(this,e,r));n.tiled=!0,n.parseBounds(e),n.builds_geometry_tiles=!1,n.tms=e.tms===!0,n.url_hosts=null;var i=n.url.match(/{s:\[([^}+]+)\]}/);return null!=i&&i.length>1&&(n.url_hosts=i[1].split(","),n.next_host=0),n}return d.default(t,e),j.default(t,[{key:"parseBounds",value:function(e){if(Array.isArray(e.bounds)&&4===e.bounds.length){this.bounds=e.bounds;var t=m.default(this.bounds,4),r=t[0],n=t[1],i=t[2],a=t[3];this.bounds_meters={min:z.default.latLngToMeters([r,a]),max:z.default.latLngToMeters([i,n])},this.bounds_tiles={min:{},max:{}}}}},{key:"checkBounds",value:function(e){if(this.bounds){e=z.default.wrapTile(e,{x:!0});var t=this.bounds_tiles.min[e.z];t||(t=this.bounds_tiles.min[e.z]=z.default.tileForMeters(this.bounds_meters.min,e.z));var r=this.bounds_tiles.max[e.z];if(r||(r=this.bounds_tiles.max[e.z]=z.default.tileForMeters(this.bounds_meters.max,e.z)),e.xr.x||e.yr.y)return!1}return!0}},{key:"includesTile",value:function(e,r){return a.default(u.default(t.prototype),"includesTile",this).call(this,e,r)&&this.checkBounds(e)?!0:!1}},{key:"formatUrl",value:function(e,t){var r=z.default.wrapTile(t.coords,{x:!0});this.tms&&(r.y=Math.pow(2,r.z)-1-r.y);var n=e.replace("{x}",r.x).replace("{y}",r.y).replace("{z}",r.z);return null!=this.url_hosts&&(n=n.replace(/{s:\[([^}+]+)\]}/,this.url_hosts[this.next_host]),this.next_host=(this.next_host+1)%this.url_hosts.length),n}},{key:"urlHasTilePattern",value:function(e){return e&&e.search("{x}")>-1&&e.search("{y}")>-1&&e.search("{z}")>-1}}]),t}(O)}},{"../geo":299,"../utils/errors":350,"../utils/utils":358,"babel-runtime/core-js/get-iterator":4,"babel-runtime/core-js/json/stringify":6,"babel-runtime/core-js/object/assign":9,"babel-runtime/core-js/object/get-prototype-of":14,"babel-runtime/core-js/promise":17,"babel-runtime/core-js/set":18,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22,"babel-runtime/helpers/get":24,"babel-runtime/helpers/inherits":25,"babel-runtime/helpers/possibleConstructorReturn":26,"babel-runtime/helpers/slicedToArray":27,"babel-runtime/helpers/toConsumableArray":28}],328:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,r){var n=S.default.centroid(e),i={};return o.default(i,t,r),{type:"Feature",properties:i,geometry:{type:"Point",coordinates:n}}}Object.defineProperty(r,"__esModule",{value:!0}),r.GeoJSONTileSource=r.GeoJSONSource=void 0;var a=e("babel-runtime/core-js/object/assign"),o=n(a),s=e("babel-runtime/core-js/get-iterator"),l=n(s),u=e("babel-runtime/core-js/object/get-prototype-of"),c=n(u),f=e("babel-runtime/helpers/classCallCheck"),h=n(f),d=e("babel-runtime/helpers/createClass"),p=n(d),m=e("babel-runtime/helpers/possibleConstructorReturn"),_=n(m),g=e("babel-runtime/helpers/get"),v=n(g),y=e("babel-runtime/helpers/inherits"),b=n(y),x=e("../utils/log"),w=n(x),k=e("./data_source"),A=n(k),T=e("./mvt"),E=e("../geo"),S=n(E),R=e("geojson-vt"),j=n(R),M=r.GeoJSONSource=function(e){function t(e,r){h.default(this,t);var n=_.default(this,c.default(t).call(this,e,r));return n.tiled=!0,n.load_data=null,n.tile_indexes={},n.max_zoom=Math.max(n.max_zoom||0,15),n.pad_scale=0,n}return b.default(t,e),p.default(t,[{key:"_load",value:function(e){var r=this;return this.load_data||(this.load_data=v.default(c.default(t.prototype),"_load",this).call(this,{source_data:{layers:{}}}).then(function(e){e.source_data.error&&w.default("warn","data source load error(s) for source '"+r.name+"', URL '"+r.url+"': "+e.source_data.error);var t=e.source_data.layers;for(var n in t)r.tile_indexes[n]=j.default(t[n],{maxZoom:r.max_zoom,tolerance:3,extent:S.default.tile_scale,buffer:1e-4});return r.loaded=!0,e})),this.load_data.then(function(){for(var t in r.tile_indexes)e.source_data.layers[t]=r.getTileFeatures(e,t);return e})}},{key:"getTileFeatures",value:function(e,t){var r=S.default.wrapTile(e.coords,{x:!0}),n=this.tile_indexes[t].getTile(r.z,r.x,r.y),i=void 0;if(n&&n.features){i={type:"FeatureCollection",features:[]};var a=!0,o=!1,s=void 0;try{for(var u,c=l.default(n.features);!(a=(u=c.next()).done);a=!0){var f=u.value,h={type:"Feature",geometry:{},properties:f.tags};if(1===f.type)h.geometry.coordinates=f.geometry.map(function(e){return[e[0],e[1]]}),h.geometry.type="MultiPoint";else{if(2!==f.type&&3!==f.type)continue;if(h.geometry.coordinates=f.geometry.map(function(e){return e.map(function(e){return[e[0],e[1]]})}),2===f.type)h.geometry.type="MultiLineString";else if(h.geometry=T.decodeMultiPolygon(h.geometry),null==h.geometry)continue}i.features.push(h)}}catch(d){o=!0,s=d}finally{try{!a&&c.return&&c.return()}finally{if(o)throw s}}}return i}},{key:"formatUrl",value:function(){return this.url}},{key:"parseSourceData",value:function(e,t,r){var n=JSON.parse(r),i=this.getLayers(n);this.preprocessLayers(i),t.layers=i}},{key:"preprocessLayers",value:function(e){for(var t in e){var r=e[t];this.preprocessFeatures(r.features)}}},{key:"preprocessFeatures",value:function(e){return this.config.generate_label_centroids&&!function(){var t=[],r={label_placement:!0};e.forEach(function(e){var n=void 0,a=void 0;switch(e.geometry.type){case"Polygon":n=e.geometry.coordinates,a=i(n,e.properties,r),t.push(a);break;case"MultiPolygon":n=e.geometry.coordinates;for(var o=-1/0,s=0,l=0;lo&&(o=u,s=l)}a=i(n[s],e.properties,r),t.push(a)}}),Array.prototype.push.apply(e,t)}(),e}},{key:"getLayers",value:function(e){return"Feature"===e.type?{_default:{type:"FeatureCollection",features:[e]}}:"FeatureCollection"===e.type?{_default:e}:e}}]),t}(k.NetworkSource),z=r.GeoJSONTileSource=function(e){function t(e,r){var n;h.default(this,t);var i=_.default(this,c.default(t).call(this,e,r));if(!i.urlHasTilePattern(i.url)){if("GeoJSON"===e.type){var a;return a=new M(e),_.default(i,a)}var o;return o=null,_.default(i,o)}return n=i,_.default(i,n)}return b.default(t,e),p.default(t,[{key:"parseSourceData",value:function(e,t,r){var n=JSON.parse(r);this.prepareGeoJSON(n,e,t)}},{key:"prepareGeoJSON",value:function(e,t,r){"function"==typeof this.transform&&(e=this.transform(e,this.extra_data)),r.layers=M.prototype.getLayers(e);var n={coords:t.coords,min:S.default.metersForTile(S.default.wrapTile(t.coords,{x:!0}))};A.default.projectData(r),A.default.scaleData(r,n)}}]),t}(k.NetworkTileSource);A.default.register(z,"GeoJSON")},{"../geo":299,"../utils/log":352,"./data_source":327,"./mvt":329,"babel-runtime/core-js/get-iterator":4,"babel-runtime/core-js/object/assign":9,"babel-runtime/core-js/object/get-prototype-of":14,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22,"babel-runtime/helpers/get":24,"babel-runtime/helpers/inherits":25,"babel-runtime/helpers/possibleConstructorReturn":26,"geojson-vt":172}],329:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e){for(var t=[],r=[],n=void 0,i=0;i0&&(t.push(r),r=[]),r.push(a))}return r.length>0&&t.push(r),1===t.length?(e.type="Polygon",e.coordinates=t[0]):t.length>1?(e.type="MultiPolygon",e.coordinates=t):e=null,e}Object.defineProperty(r,"__esModule",{value:!0}),r.MVTSource=void 0;var a=e("babel-runtime/core-js/object/get-prototype-of"),o=n(a),s=e("babel-runtime/helpers/classCallCheck"),l=n(s),u=e("babel-runtime/helpers/createClass"),c=n(u),f=e("babel-runtime/helpers/possibleConstructorReturn"),h=n(f),d=e("babel-runtime/helpers/inherits"),p=n(d);r.decodeMultiPolygon=i;var m=e("./data_source"),_=n(m),g=e("../geo"),v=n(g),y=e("pbf"),b=n(y),x=e("vector-tile"),w=r.MVTSource=function(e){function t(e,r){l.default(this,t);var n=h.default(this,o.default(t).call(this,e,r));return n.response_type="arraybuffer",n}return p.default(t,e),c.default(t,[{key:"parseSourceData",value:function(e,t,r){var n=new Uint8Array(r),i=new b.default(n);t.data=new x.VectorTile(i),t.layers=this.toGeoJSON(t.data),delete t.data}},{key:"toGeoJSON",value:function(e){var t={};for(var r in e.layers){for(var n=e.layers[r],a={type:"FeatureCollection",features:[]},o=0;o1){for(var t=e[0],r=1;rn&&(n=e[a].length);if(0===n)return null;for(var o=function(n){return r=e.map(function(e){return e[n]&&e[n][t]}),0===r.length?"continue":(r.sort(function(e,t){return(e&&e.layer_name)>(t&&t.layer_name)?1:-1}),B.default.apply(void 0,[i].concat(N.default(r))),void delete i.layer_name)},s=0;n>s;s++){{o(s)}}return i.visible===!1?null:i}function o(e){return V.indexOf(e)>-1}function s(e){return 0===E.default(e).length}function l(e){var t={},r={};for(var n in e)o(n)?t[n]=e[n]:r[n]=e[n];return[t,r]}function u(e){var t=[];if(e.parent){var r=e.parent.calculatedDraw||[];t.push.apply(t,N.default(r))}return t.push(e.draw),t}function c(e,t,r,n){var i={name:e,layer:t,parent:r},a=l(t),o=_.default(a,2),u=o[0],f=o[1],h=s(f),d=void 0;d=h&&null!=r?H:X;var m=new d(p.default(i,u));if(r&&r.addLayer(m),!h)for(var g in f){var v=f[g];if("object"!==("undefined"==typeof v?"undefined":R.default(v))||Array.isArray(v)){var y="Layer value must be an object: cannot create layer '"+g+": "+A.default(v)+"'";y+=", under parent layer '"+m.full_name+"'.",n[m.name]&&(y+=" The parent name '"+m.name+"' is also the name of a style, did you mean to create a 'draw' group",r&&(y+=" under '"+r.name+"'"),y+=" instead?"),U.default("warn",y)}else c(g,v,m,n)}return m}function f(e,t){var r={};for(var n in e){var i=e[n];i&&(r[n]=c(n,i,null,t))}return r}function h(e,t,r,n){var i=!1,a=!1;if(0!==t.length){for(var o=0;o0)?G.match(this.filter,Y):null}catch(r){var n="Filter for layer "+this.full_name+" is invalid, `filter: "+A.default(this.filter)+"` ";n+="failed with error '"+r.message+"', stack trace: "+r.stack,U.default("warn",n)}}},{key:"buildZooms",value:function(){var e=this.filter&&this.filter.$zoom,t="undefined"==typeof e?"undefined":R.default(e);if(null!=e&&"function"!==t){if(this.zooms={},"number"===t)this.zooms[e]=!0;else if(Array.isArray(e))for(var r=0;ra;a++)this.zooms[a]=!0;delete this.filter.$zoom}}},{key:"buildPropMatches",value:function(){var e=this;this.filter&&!Array.isArray(this.filter)&&"function"!=typeof this.filter&&E.default(this.filter).forEach(function(t){if(-1===q.indexOf(t)){var r=e.filter[t],n="undefined"==typeof r?"undefined":R.default(r),i=Array.isArray(r);if(!i&&"string"!==n&&"number"!==n)return;"$"===t[0]?(e.context_prop_matches=e.context_prop_matches||[],e.context_prop_matches.push([t.substring(1),i?r:[r]])):(e.feature_prop_matches=e.feature_prop_matches||[],e.feature_prop_matches.push([t,i?r:[r]])),delete e.filter[t]}})}},{key:"doPropMatches",value:function(e){if(this.feature_prop_matches)for(var t=0;t0){var n=i(r);if(void 0===W[n]){for(var o=t.map(function(e){return e&&e.visible!==!1&&e.calculatedDraw}),s={},l=0;lh;h++)Array.prototype.push.apply(u,l?r:n);l=!l}u=new Uint8Array(u);var d=u.length/4;return{pixels:u,length:d}}Object.defineProperty(r,"__esModule",{value:!0}),r.default=n;var i=[255,255,255,255],a=[0,0,0,0]},{}],334:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0}),r.Lines=void 0;var i=e("babel-runtime/core-js/object/assign"),a=n(i),o=e("babel-runtime/core-js/object/create"),s=n(o),l=e("../style"),u=e("../style_parser"),c=e("../../gl/constants"),f=n(c),h=e("../../gl/texture"),d=n(h),p=e("../../gl/vertex_layout"),m=n(p),_=e("../../builders/polylines"),g=e("./dasharray"),v=n(g),y=e("../../geo"),b=n(y),x=e("../polygons/polygons"),w=r.Lines=s.default(l.Style);a.default(w,{name:"lines",built_in:!0,vertex_shader_src:x.shaderSrc_polygonsVertex,fragment_shader_src:x.shaderSrc_polygonsFragment,selection:!0,init:function(){l.Style.init.apply(this,arguments);var e=[{name:"a_position",size:4,type:f.default.SHORT,normalized:!1},{name:"a_extrude",size:4,type:f.default.SHORT,normalized:!1},{name:"a_color",size:4,type:f.default.UNSIGNED_BYTE,normalized:!0}];this.defines.TANGRAM_LAYER_ORDER=!0,this.defines.TANGRAM_EXTRUDE_LINES=!0,this.selection&&e.push({name:"a_selection_color",size:4,type:f.default.UNSIGNED_BYTE,normalized:!0}),(this.texture||this.dash)&&(this.texcoords=!0),this.texcoords&&(this.defines.TANGRAM_TEXTURE_COORDS=!0,this.defines.TANGRAM_DASH_SCALE=1,this.defines.TANGRAM_V_SCALE_ADJUST=b.default.tile_scale*this.defines.TANGRAM_DASH_SCALE,e.push({name:"a_texcoord",size:2,type:f.default.UNSIGNED_SHORT,normalized:!0})),this.vertex_layout=new m.default(e),this.outline_feature_style={},this.inline_feature_style=this.feature_style},compile:function(){return this.parseLineTexture(),l.Style.compile.apply(this,arguments)},parseLineTexture:function(){var e=this;if(this.dash){this.dash_background_color&&(this.dash_background_color=u.StyleParser.parseColor(this.dash_background_color),this.defines.TANGRAM_LINE_BACKGROUND_COLOR="vec3("+this.dash_background_color.slice(0,3).join(", ")+")"),this.defines.TANGRAM_DASH_SCALE=20,this.defines.TANGRAM_V_SCALE_ADJUST=b.default.tile_scale*this.defines.TANGRAM_DASH_SCALE;var t=v.default(this.dash,{scale:this.defines.TANGRAM_DASH_SCALE});this.texture="_"+this.name+"_dasharray",d.default.create(this.gl,this.texture,{data:t.pixels,height:t.length,width:1,filtering:"nearest"})}this.texture&&(this.defines.TANGRAM_LINE_TEXTURE=!0,this.defines.TANGRAM_ALPHA_TEST=.5,this.shaders.uniforms=this.shaders.uniforms||{},this.shaders.uniforms.u_texture=this.texture,this.shaders.uniforms.u_texture_ratio=1,d.default.getInfo(this.texture).then(function(t){t&&(e.shaders.uniforms.u_texture_ratio=t.height/t.width)}))},calcWidth:function(e,t){return e&&u.StyleParser.evalCachedDistanceProperty(e,t)||0},calcWidthNextZoom:function(e,t){t.zoom++;var r=this.calcWidth(e,t);return t.zoom--,r},_parseFeature:function(e,t,r){var n=this.feature_style,i=this.calcWidth(t.width,r);if(!(0>i)){var a=this.calcWidthNextZoom(t.next_width,r);if(!(0===i&&0===a||0>a)&&(n.width=i*r.units_per_meter_overzoom,n.next_width=2*a-i,n.next_width*=r.units_per_meter_overzoom,n.next_width/=2,n.color=this.parseColor(t.color,r),n.color)){if(n.z=t.z&&u.StyleParser.evalCachedDistanceProperty(t.z||0,r)||u.StyleParser.defaults.z,n.height=e.properties.height||u.StyleParser.defaults.height,n.extrude=u.StyleParser.evalProperty(t.extrude,r),n.extrude&&("number"==typeof n.extrude?n.height=n.extrude:Array.isArray(n.extrude)&&(n.height=n.extrude[1])),n.extrude&&n.height&&(n.z+=n.height),n.z*=b.default.height_scale,n.height*=b.default.height_scale,n.cap=t.cap,n.join=t.join,n.miter_limit=t.miter_limit,n.tile_edges=t.tile_edges,n.outline=n.outline||{width:{},next_width:{},preprocessed:!0},t.outline&&t.outline.visible!==!1&&t.outline.color&&t.outline.width){var o=2*this.calcWidth(t.outline.width,r),s=2*this.calcWidthNextZoom(t.outline.next_width,r); +var i=e.pixel[0]+(e.pixel[1]<<8)+(e.pixel[2]<<16)+(e.pixel[3]<<24)>>>0,a=e.pixel[3];255!==a?null!=e.workers[a]&&g.default.postMessage(e.workers[a],"self.getFeatureSelection",{id:n.id,key:i}).then(function(t){e.finishRead(t)}):e.finishRead({id:n.id,feature:null}),n.sent=!0}}t.bindFramebuffer(t.FRAMEBUFFER,null)},this.read_delay)}},{key:"finishRead",value:function(e){var t=this.requests[e.id];if(!t)return void d.default("error","FeatureSelection.finishRead(): could not find message",e);var r=e.feature,n=!1;(null!=r&&null==this.feature||null==r&&null!=this.feature||null!=r&&null!=this.feature&&a.default(r)!==a.default(this.feature))&&(n=!0),this.feature=r,t.resolve({feature:r,changed:n,request:t}),delete this.requests[e.id]}}],[{key:"makeEntry",value:function(e){this.map_entry++;var t=255&this.map_entry,r=this.map_entry>>8&255,n=this.map_entry>>16&255,i=this.map_prefix,a=t/255,o=r/255,s=n/255,l=i/255,u=t+(r<<8)+(n<<16)+(i<<24)>>>0;return this.map[u]={color:[a,o,s,l]},this.map_size++,this.tiles[e.key]||(this.tiles[e.key]={entries:[],tile:{key:e.key,coords:e.coords,style_zoom:e.style_zoom,source:e.source,generation:e.generation}}),this.tiles[e.key].entries.push(u),this.map[u]}},{key:"makeColor",value:function(e,t,r){var n=this.makeEntry(t);return n.feature={id:e.id,properties:e.properties,source_name:r.source,source_layer:r.layer,layers:r.layers,tile:this.tiles[t.key].tile},n.color}},{key:"reset",value:function(){this.tiles={},this.map={},this.map_size=0,this.map_entry=0}},{key:"clearTile",value:function(e){var t=this;this.tiles[e]&&(this.tiles[e].entries.forEach(function(e){return delete t.map[e]}),this.map_size-=this.tiles[e].entries.length,delete this.tiles[e])}},{key:"getMapSize",value:function(){return this.map_size}},{key:"setPrefix",value:function(e){this.map_prefix=e}}]),e}();r.default=v,v.map={},v.tiles={},v.map_size=0,v.map_entry=0,v.map_prefix=0,v.defaultColor=[0,0,0,1]},{"./gl/texture":306,"./utils/log":352,"./utils/worker_broker":360,"babel-runtime/core-js/json/stringify":6,"babel-runtime/core-js/promise":17,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22}],327:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0}),r.NetworkTileSource=r.NetworkSource=void 0;var i=e("babel-runtime/helpers/get"),a=n(i),o=e("babel-runtime/core-js/promise"),s=n(o),l=e("babel-runtime/core-js/object/get-prototype-of"),u=n(l),c=e("babel-runtime/helpers/possibleConstructorReturn"),f=n(c),h=e("babel-runtime/helpers/inherits"),d=n(h),p=e("babel-runtime/helpers/slicedToArray"),m=n(p),_=e("babel-runtime/core-js/json/stringify"),g=n(_),v=e("babel-runtime/core-js/object/assign"),y=n(v),b=e("babel-runtime/core-js/get-iterator"),x=n(b),w=e("babel-runtime/core-js/set"),k=n(w),A=e("babel-runtime/helpers/toConsumableArray"),T=n(A),E=e("babel-runtime/helpers/classCallCheck"),S=n(E),R=e("babel-runtime/helpers/createClass"),j=n(R),M=e("../geo"),z=n(M),C=e("../utils/errors"),P=e("../utils/utils"),N=n(P),L=function(){function e(t,r){S.default(this,e),this.config=t,this.sources=r,this.id=t.id,this.name=t.name,this.pad_scale=t.pad_scale||1e-4,this.default_winding=null,this.rasters=Array.isArray(t.rasters)?[].concat(T.default(new k.default(t.rasters))):[],this.transform=t.transform,"function"==typeof this.transform&&this.transform.bind(this),this.extra_data=t.extra_data,this.scripts=t.scripts,this.max_zoom=null!=t.max_zoom?t.max_zoom:z.default.default_source_max_zoom,this.min_display_zoom=null!=t.min_display_zoom?t.min_display_zoom:0,this.max_display_zoom=null!=t.max_display_zoom?t.max_display_zoom:null}return j.default(e,[{key:"load",value:function(e){var t=this;return e.source_data={},e.source_data.layers={},e.pad_scale=this.pad_scale,e.rasters=[].concat(T.default(this.rasters)),this._load(e).then(function(e){for(var r in e.source_data.layers){var n=e.source_data.layers[r];n&&n.features&&n.features.forEach(function(e){z.default.transformGeometry(e.geometry,function(e){e[1]=-e[1],t.pad_scale&&(e[0]=Math.round(e[0]*(1+t.pad_scale)-z.default.tile_scale*t.pad_scale/2),e[1]=Math.round(e[1]*(1+t.pad_scale)-z.default.tile_scale*t.pad_scale/2))}),t.updateDefaultWinding(e.geometry)})}return e.default_winding=t.default_winding||"CCW",e})}},{key:"_load",value:function(){throw new C.MethodNotImplemented("_load")}},{key:"updateDefaultWinding",value:function(e){return null==this.default_winding&&("Polygon"===e.type?this.default_winding=z.default.ringWinding(e.coordinates[0]):"MultiPolygon"===e.type&&(this.default_winding=z.default.ringWinding(e.coordinates[0][0]))),this.default_winding}},{key:"includesTile",value:function(e,t){if(e.zthis.max_display_zoom)return!1;var r=!0,n=!1,i=void 0;try{for(var a,o=x.default(this.rasters);!(r=(a=o.next()).done);r=!0){var s=a.value;if(this.sources[s]&&this.sources[s]!==this&&!this.sources[s].includesTile(e,e.z))return!1}}catch(l){n=!0,i=l}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}return!0}}],[{key:"create",value:function(t,r){return e.types[t.type]?new e.types[t.type](t,r):void 0}},{key:"changed",value:function(e,t){if(!e||!t)return!0;var r=y.default({},e.config,{id:null}),n=y.default({},t.config,{id:null});return g.default(r)!==g.default(n)}},{key:"projectData",value:function(e){var t=+new Date;for(var r in e.layers)for(var n=e.layers[r].features.length,i=0;n>i;i++){var a=e.layers[r].features[i];z.default.transformGeometry(a.geometry,function(e){var t=z.default.latLngToMeters(e),r=m.default(t,2),n=r[0],i=r[1];e[0]=n,e[1]=i})}void 0!==e.debug&&(e.debug.projection=+new Date-t)}},{key:"scaleData",value:function(e,t){var r=t.coords.z,n=t.min,i=(t.max,z.default.unitsPerMeter(r));for(var a in e.layers)for(var o=e.layers[a].features.length,s=0;o>s;s++){var l=e.layers[a].features[s];z.default.transformGeometry(l.geometry,function(e){e[0]=(e[0]-n.x)*i,e[1]=(e[1]-n.y)*i*-1})}}},{key:"register",value:function(t,r){t&&r&&(e.types[r]=t)}}]),e}();r.default=L,L.types={};{var O=r.NetworkSource=function(e){function t(e,r){S.default(this,t);var n=f.default(this,u.default(t).call(this,e,r));if(n.url=N.default.addParamsToURL(e.url,e.url_params),n.response_type="",null==n.url)throw Error("Network data source must provide a `url` property");return n}return d.default(t,e),j.default(t,[{key:"_load",value:function(e){var t=this,r=this.formatUrl(this.url,e),n=e.source_data;return n.url=r,e.debug=e.debug||{},e.debug.network=+new Date,new s.default(function(i){n.error=null;var a=N.default.io(r,6e4,t.response_type);n.request=a.request,a.then(function(r){e.debug.response_size=r.length||r.byteLength,e.debug.network=+new Date-e.debug.network,e.debug.parsing=+new Date,t.parseSourceData(e,n,r),e.debug.parsing=+new Date-e.debug.parsing,i(e)}).catch(function(t){n.error=t.stack,i(e)})})}},{key:"formatUrl",value:function(){throw new C.MethodNotImplemented("formatUrl")}},{key:"parseSourceData",value:function(){throw new C.MethodNotImplemented("parseSourceData")}}]),t}(L);r.NetworkTileSource=function(e){function t(e,r){S.default(this,t);var n=f.default(this,u.default(t).call(this,e,r));n.tiled=!0,n.parseBounds(e),n.builds_geometry_tiles=!1,n.tms=e.tms===!0,n.url_hosts=null;var i=n.url.match(/{s:\[([^}+]+)\]}/);return null!=i&&i.length>1&&(n.url_hosts=i[1].split(","),n.next_host=0),n}return d.default(t,e),j.default(t,[{key:"parseBounds",value:function(e){if(Array.isArray(e.bounds)&&4===e.bounds.length){this.bounds=e.bounds;var t=m.default(this.bounds,4),r=t[0],n=t[1],i=t[2],a=t[3];this.bounds_meters={min:z.default.latLngToMeters([r,a]),max:z.default.latLngToMeters([i,n])},this.bounds_tiles={min:{},max:{}}}}},{key:"checkBounds",value:function(e){if(this.bounds){e=z.default.wrapTile(e,{x:!0});var t=this.bounds_tiles.min[e.z];t||(t=this.bounds_tiles.min[e.z]=z.default.tileForMeters(this.bounds_meters.min,e.z));var r=this.bounds_tiles.max[e.z];if(r||(r=this.bounds_tiles.max[e.z]=z.default.tileForMeters(this.bounds_meters.max,e.z)),e.xr.x||e.yr.y)return!1}return!0}},{key:"includesTile",value:function(e,r){return a.default(u.default(t.prototype),"includesTile",this).call(this,e,r)&&this.checkBounds(e)?!0:!1}},{key:"formatUrl",value:function(e,t){var r=z.default.wrapTile(t.coords,{x:!0});this.tms&&(r.y=Math.pow(2,r.z)-1-r.y);var n=e.replace("{x}",r.x).replace("{y}",r.y).replace("{z}",r.z);return null!=this.url_hosts&&(n=n.replace(/{s:\[([^}+]+)\]}/,this.url_hosts[this.next_host]),this.next_host=(this.next_host+1)%this.url_hosts.length),n}},{key:"urlHasTilePattern",value:function(e){return e&&e.search("{x}")>-1&&e.search("{y}")>-1&&e.search("{z}")>-1}}]),t}(O)}},{"../geo":299,"../utils/errors":350,"../utils/utils":358,"babel-runtime/core-js/get-iterator":4,"babel-runtime/core-js/json/stringify":6,"babel-runtime/core-js/object/assign":9,"babel-runtime/core-js/object/get-prototype-of":14,"babel-runtime/core-js/promise":17,"babel-runtime/core-js/set":18,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22,"babel-runtime/helpers/get":24,"babel-runtime/helpers/inherits":25,"babel-runtime/helpers/possibleConstructorReturn":26,"babel-runtime/helpers/slicedToArray":27,"babel-runtime/helpers/toConsumableArray":28}],328:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,r){var n=S.default.centroid(e),i={};return o.default(i,t,r),{type:"Feature",properties:i,geometry:{type:"Point",coordinates:n}}}Object.defineProperty(r,"__esModule",{value:!0}),r.GeoJSONTileSource=r.GeoJSONSource=void 0;var a=e("babel-runtime/core-js/object/assign"),o=n(a),s=e("babel-runtime/core-js/get-iterator"),l=n(s),u=e("babel-runtime/core-js/object/get-prototype-of"),c=n(u),f=e("babel-runtime/helpers/classCallCheck"),h=n(f),d=e("babel-runtime/helpers/createClass"),p=n(d),m=e("babel-runtime/helpers/possibleConstructorReturn"),_=n(m),g=e("babel-runtime/helpers/get"),v=n(g),y=e("babel-runtime/helpers/inherits"),b=n(y),x=e("../utils/log"),w=n(x),k=e("./data_source"),A=n(k),T=e("./mvt"),E=e("../geo"),S=n(E),R=e("geojson-vt"),j=n(R),M=r.GeoJSONSource=function(e){function t(e,r){h.default(this,t);var n=_.default(this,c.default(t).call(this,e,r));return n.tiled=!0,n.load_data=null,n.tile_indexes={},n.max_zoom=Math.max(n.max_zoom||0,15),n.pad_scale=0,n}return b.default(t,e),p.default(t,[{key:"_load",value:function(e){var r=this;return this.load_data||(this.load_data=v.default(c.default(t.prototype),"_load",this).call(this,{source_data:{layers:{}}}).then(function(e){e.source_data.error&&w.default("warn","data source load error(s) for source '"+r.name+"', URL '"+r.url+"': "+e.source_data.error);var t=e.source_data.layers;for(var n in t)r.tile_indexes[n]=j.default(t[n],{maxZoom:r.max_zoom,tolerance:3,extent:S.default.tile_scale,buffer:1e-4});return r.loaded=!0,e})),this.load_data.then(function(){for(var t in r.tile_indexes)e.source_data.layers[t]=r.getTileFeatures(e,t);return e})}},{key:"getTileFeatures",value:function(e,t){var r=S.default.wrapTile(e.coords,{x:!0}),n=this.tile_indexes[t].getTile(r.z,r.x,r.y),i=void 0;if(n&&n.features){i={type:"FeatureCollection",features:[]};var a=!0,o=!1,s=void 0;try{for(var u,c=l.default(n.features);!(a=(u=c.next()).done);a=!0){var f=u.value,h={type:"Feature",geometry:{},properties:f.tags};if(1===f.type)h.geometry.coordinates=f.geometry.map(function(e){return[e[0],e[1]]}),h.geometry.type="MultiPoint";else{if(2!==f.type&&3!==f.type)continue;if(h.geometry.coordinates=f.geometry.map(function(e){return e.map(function(e){return[e[0],e[1]]})}),2===f.type)h.geometry.type="MultiLineString";else if(h.geometry=T.decodeMultiPolygon(h.geometry),null==h.geometry)continue}i.features.push(h)}}catch(d){o=!0,s=d}finally{try{!a&&c.return&&c.return()}finally{if(o)throw s}}}return i}},{key:"formatUrl",value:function(){return this.url}},{key:"parseSourceData",value:function(e,t,r){var n=JSON.parse(r),i=this.getLayers(n);this.preprocessLayers(i),t.layers=i}},{key:"preprocessLayers",value:function(e){for(var t in e){var r=e[t];this.preprocessFeatures(r.features)}}},{key:"preprocessFeatures",value:function(e){return this.config.generate_label_centroids&&!function(){var t=[],r={label_placement:!0};e.forEach(function(e){var n=void 0,a=void 0;switch(e.geometry.type){case"Polygon":n=e.geometry.coordinates,a=i(n,e.properties,r),t.push(a);break;case"MultiPolygon":n=e.geometry.coordinates;for(var o=-1/0,s=0,l=0;lo&&(o=u,s=l)}a=i(n[s],e.properties,r),t.push(a)}}),Array.prototype.push.apply(e,t)}(),e}},{key:"getLayers",value:function(e){return"Feature"===e.type?{_default:{type:"FeatureCollection",features:[e]}}:"FeatureCollection"===e.type?{_default:e}:e}}]),t}(k.NetworkSource),z=r.GeoJSONTileSource=function(e){function t(e,r){var n;h.default(this,t);var i=_.default(this,c.default(t).call(this,e,r));if(!i.urlHasTilePattern(i.url)){if("GeoJSON"===e.type){var a;return a=new M(e),_.default(i,a)}var o;return o=null,_.default(i,o)}return n=i,_.default(i,n)}return b.default(t,e),p.default(t,[{key:"parseSourceData",value:function(e,t,r){var n=JSON.parse(r);this.prepareGeoJSON(n,e,t)}},{key:"prepareGeoJSON",value:function(e,t,r){"function"==typeof this.transform&&(e=this.transform(e,this.extra_data)),r.layers=M.prototype.getLayers(e);var n={coords:t.coords,min:S.default.metersForTile(S.default.wrapTile(t.coords,{x:!0}))};A.default.projectData(r),A.default.scaleData(r,n)}}]),t}(k.NetworkTileSource);A.default.register(z,"GeoJSON")},{"../geo":299,"../utils/log":352,"./data_source":327,"./mvt":329,"babel-runtime/core-js/get-iterator":4,"babel-runtime/core-js/object/assign":9,"babel-runtime/core-js/object/get-prototype-of":14,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22,"babel-runtime/helpers/get":24,"babel-runtime/helpers/inherits":25,"babel-runtime/helpers/possibleConstructorReturn":26,"geojson-vt":172}],329:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e){for(var t=[],r=[],n=void 0,i=0;i0&&(t.push(r),r=[]),r.push(a))}return r.length>0&&t.push(r),1===t.length?(e.type="Polygon",e.coordinates=t[0]):t.length>1?(e.type="MultiPolygon",e.coordinates=t):e=null,e}Object.defineProperty(r,"__esModule",{value:!0}),r.MVTSource=void 0;var a=e("babel-runtime/core-js/object/get-prototype-of"),o=n(a),s=e("babel-runtime/helpers/classCallCheck"),l=n(s),u=e("babel-runtime/helpers/createClass"),c=n(u),f=e("babel-runtime/helpers/possibleConstructorReturn"),h=n(f),d=e("babel-runtime/helpers/inherits"),p=n(d);r.decodeMultiPolygon=i;var m=e("./data_source"),_=n(m),g=e("../geo"),v=n(g),y=e("pbf"),b=n(y),x=e("vector-tile"),w=r.MVTSource=function(e){function t(e,r){l.default(this,t);var n=h.default(this,o.default(t).call(this,e,r));return n.response_type="arraybuffer",n}return p.default(t,e),c.default(t,[{key:"parseSourceData",value:function(e,t,r){var n=new Uint8Array(r),i=new b.default(n);t.data=new x.VectorTile(i),t.layers=this.toGeoJSON(t.data),delete t.data}},{key:"toGeoJSON",value:function(e){var t={};for(var r in e.layers){for(var n=e.layers[r],a={type:"FeatureCollection",features:[]},o=0;o1){for(var t=e[0],r=1;rn&&(n=e[a].length);if(0===n)return null;for(var o=function(n){return r=e.map(function(e){return e[n]&&e[n][t]}),0===r.length?"continue":(r.sort(function(e,t){return(e&&e.layer_name)>(t&&t.layer_name)?1:-1}),B.default.apply(void 0,[i].concat(N.default(r))),void delete i.layer_name)},s=0;n>s;s++){{o(s)}}return i.visible===!1?null:i}function o(e){return V.indexOf(e)>-1}function s(e){return 0===E.default(e).length}function l(e){var t={},r={};for(var n in e)o(n)?t[n]=e[n]:r[n]=e[n];return[t,r]}function u(e){var t=[];if(e.parent){var r=e.parent.calculatedDraw||[];t.push.apply(t,N.default(r))}return t.push(e.draw),t}function c(e,t,r,n){var i={name:e,layer:t,parent:r},a=l(t),o=_.default(a,2),u=o[0],f=o[1],h=s(f),d=void 0;d=h&&null!=r?H:X;var m=new d(p.default(i,u));if(r&&r.addLayer(m),!h)for(var g in f){var v=f[g];if("object"!==("undefined"==typeof v?"undefined":R.default(v))||Array.isArray(v)){var y="Layer value must be an object: cannot create layer '"+g+": "+A.default(v)+"'";y+=", under parent layer '"+m.full_name+"'.",n[m.name]&&(y+=" The parent name '"+m.name+"' is also the name of a style, did you mean to create a 'draw' group",r&&(y+=" under '"+r.name+"'"),y+=" instead?"),U.default("warn",y)}else c(g,v,m,n)}return m}function f(e,t){var r={};for(var n in e){var i=e[n];i&&(r[n]=c(n,i,null,t))}return r}function h(e,t,r,n){var i=!1,a=!1;if(0!==t.length){for(var o=0;o0)?G.match(this.filter,Y):null}catch(r){var n="Filter for layer "+this.full_name+" is invalid, `filter: "+A.default(this.filter)+"` ";n+="failed with error '"+r.message+"', stack trace: "+r.stack,U.default("warn",n)}}},{key:"buildZooms",value:function(){var e=this.filter&&this.filter.$zoom,t="undefined"==typeof e?"undefined":R.default(e);if(null!=e&&"function"!==t){if(this.zooms={},"number"===t)this.zooms[e]=!0;else if(Array.isArray(e))for(var r=0;ra;a++)this.zooms[a]=!0;delete this.filter.$zoom}}},{key:"buildPropMatches",value:function(){var e=this;this.filter&&!Array.isArray(this.filter)&&"function"!=typeof this.filter&&E.default(this.filter).forEach(function(t){if(-1===q.indexOf(t)){var r=e.filter[t],n="undefined"==typeof r?"undefined":R.default(r),i=Array.isArray(r);if(!i&&"string"!==n&&"number"!==n)return;"$"===t[0]?(e.context_prop_matches=e.context_prop_matches||[],e.context_prop_matches.push([t.substring(1),i?r:[r]])):(e.feature_prop_matches=e.feature_prop_matches||[],e.feature_prop_matches.push([t,i?r:[r]])),delete e.filter[t]}})}},{key:"doPropMatches",value:function(e){if(this.feature_prop_matches)for(var t=0;t0){var n=i(r);if(void 0===W[n]){for(var o=t.map(function(e){return e&&e.visible!==!1&&e.calculatedDraw}),s={},l=0;lh;h++)Array.prototype.push.apply(u,l?r:n);l=!l}u=new Uint8Array(u);var d=u.length/4;return{pixels:u,length:d}}Object.defineProperty(r,"__esModule",{value:!0}),r.default=n;var i=[255,255,255,255],a=[0,0,0,0]},{}],334:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0}),r.Lines=void 0;var i=e("babel-runtime/core-js/object/assign"),a=n(i),o=e("babel-runtime/core-js/object/create"),s=n(o),l=e("../style"),u=e("../style_parser"),c=e("../../gl/constants"),f=n(c),h=e("../../gl/texture"),d=n(h),p=e("../../gl/vertex_layout"),m=n(p),_=e("../../builders/polylines"),g=e("./dasharray"),v=n(g),y=e("../../geo"),b=n(y),x=e("../polygons/polygons"),w=r.Lines=s.default(l.Style);a.default(w,{name:"lines",built_in:!0,vertex_shader_src:x.shaderSrc_polygonsVertex,fragment_shader_src:x.shaderSrc_polygonsFragment,selection:!0,init:function(){l.Style.init.apply(this,arguments);var e=[{name:"a_position",size:4,type:f.default.SHORT,normalized:!1},{name:"a_extrude",size:4,type:f.default.SHORT,normalized:!1},{name:"a_color",size:4,type:f.default.UNSIGNED_BYTE,normalized:!0}];this.defines.TANGRAM_LAYER_ORDER=!0,this.defines.TANGRAM_EXTRUDE_LINES=!0,this.selection&&e.push({name:"a_selection_color",size:4,type:f.default.UNSIGNED_BYTE,normalized:!0}),(this.texture||this.dash)&&(this.texcoords=!0),this.texcoords&&(this.defines.TANGRAM_TEXTURE_COORDS=!0,this.defines.TANGRAM_DASH_SCALE=1,this.defines.TANGRAM_V_SCALE_ADJUST=b.default.tile_scale*this.defines.TANGRAM_DASH_SCALE,e.push({name:"a_texcoord",size:2,type:f.default.UNSIGNED_SHORT,normalized:!0})),this.vertex_layout=new m.default(e),this.outline_feature_style={},this.inline_feature_style=this.feature_style},compile:function(){return this.parseLineTexture(),l.Style.compile.apply(this,arguments)},parseLineTexture:function(){var e=this;if(this.dash){this.dash_background_color&&(this.dash_background_color=u.StyleParser.parseColor(this.dash_background_color),this.defines.TANGRAM_LINE_BACKGROUND_COLOR="vec3("+this.dash_background_color.slice(0,3).join(", ")+")"),this.defines.TANGRAM_DASH_SCALE=20,this.defines.TANGRAM_V_SCALE_ADJUST=b.default.tile_scale*this.defines.TANGRAM_DASH_SCALE;var t=v.default(this.dash,{scale:this.defines.TANGRAM_DASH_SCALE});this.texture="_"+this.name+"_dasharray",d.default.create(this.gl,this.texture,{data:t.pixels,height:t.length,width:1,filtering:"nearest"})}this.texture&&(this.defines.TANGRAM_LINE_TEXTURE=!0,this.defines.TANGRAM_ALPHA_TEST=.5,this.shaders.uniforms=this.shaders.uniforms||{},this.shaders.uniforms.u_texture=this.texture,this.shaders.uniforms.u_texture_ratio=1,d.default.getInfo(this.texture).then(function(t){t&&(e.shaders.uniforms.u_texture_ratio=t.height/t.width)}))},calcWidth:function(e,t){return e&&u.StyleParser.evalCachedDistanceProperty(e,t)||0},calcWidthNextZoom:function(e,t){t.zoom++;var r=this.calcWidth(e,t);return t.zoom--,r},_parseFeature:function(e,t,r){var n=this.feature_style,i=this.calcWidth(t.width,r);if(!(0>i)){var a=this.calcWidthNextZoom(t.next_width,r);if(!(0===i&&0===a||0>a)&&(n.width=i*r.units_per_meter_overzoom,n.next_width=2*a-i,n.next_width*=r.units_per_meter_overzoom,n.next_width/=2,n.color=this.parseColor(t.color,r),n.color)){if(n.z=t.z&&u.StyleParser.evalCachedDistanceProperty(t.z||0,r)||u.StyleParser.defaults.z,n.height=e.properties.height||u.StyleParser.defaults.height,n.extrude=u.StyleParser.evalProperty(t.extrude,r),n.extrude&&("number"==typeof n.extrude?n.height=n.extrude:Array.isArray(n.extrude)&&(n.height=n.extrude[1])),n.extrude&&n.height&&(n.z+=n.height),n.z*=b.default.height_scale,n.height*=b.default.height_scale,n.cap=t.cap,n.join=t.join,n.miter_limit=t.miter_limit,n.tile_edges=t.tile_edges,n.outline=n.outline||{width:{},next_width:{},preprocessed:!0},t.outline&&t.outline.visible!==!1&&t.outline.color&&t.outline.width){var o=2*this.calcWidth(t.outline.width,r),s=2*this.calcWidthNextZoom(t.outline.next_width,r); 0===o&&0===s||0>o||0>s?(n.outline.width.value=null,n.outline.next_width.value=null,n.outline.color=null):(n.outline.width.value=o+i,n.outline.next_width.value=s+a,n.outline.color=t.outline.color,n.outline.cap=t.outline.cap||t.cap,n.outline.join=t.outline.join||t.join,n.outline.miter_limit=t.outline.miter_limit||t.miter_limit,n.outline.style=t.outline.style||this.name,n.outline.order=t.outline.order?this.parseOrder(t.outline.order,r):n.order,n.outline.order>n.order&&(n.outline.order=n.order),n.outline.order-=.5)}else n.outline.width.value=null,n.outline.next_width.value=null,n.outline.color=null;return n}}},_preprocess:function(e){return e.color=u.StyleParser.createColorPropertyCache(e.color),e.width=u.StyleParser.createPropertyCache(e.width,u.StyleParser.parseUnits),e.next_width=u.StyleParser.createPropertyCache(e.width,u.StyleParser.parseUnits),e.z=u.StyleParser.createPropertyCache(e.z,u.StyleParser.parseUnits),e.outline&&(e.outline.color=u.StyleParser.createColorPropertyCache(e.outline.color),e.outline.width=u.StyleParser.createPropertyCache(e.outline.width,u.StyleParser.parseUnits),e.outline.next_width=u.StyleParser.createPropertyCache(e.outline.width,u.StyleParser.parseUnits)),e},makeVertexTemplate:function(e){var t=0;return this.vertex_template[t++]=0,this.vertex_template[t++]=0,this.vertex_template[t++]=e.z||0,this.vertex_template[t++]=this.scaleOrder(e.order),this.vertex_template[t++]=0,this.vertex_template[t++]=0,this.vertex_template[t++]=0,this.vertex_template[t++]=e.next_width,this.vertex_template[t++]=255*e.color[0],this.vertex_template[t++]=255*e.color[1],this.vertex_template[t++]=255*e.color[2],this.vertex_template[t++]=255*e.color[3],this.selection&&(this.vertex_template[t++]=255*e.selection_color[0],this.vertex_template[t++]=255*e.selection_color[1],this.vertex_template[t++]=255*e.selection_color[2],this.vertex_template[t++]=255*e.selection_color[3]),this.texcoords&&(this.vertex_template[t++]=0,this.vertex_template[t++]=0),this.vertex_template},buildLines:function(e,t,r,n,i){if(this.feature_style=this.outline_feature_style,t.outline&&null!=t.outline.color&&null!=t.outline.width.value){var a=this.styles[t.outline.style];a&&a.addFeature(n.feature,t.outline,n)}this.feature_style=this.inline_feature_style;var o=this.makeVertexTemplate(t);_.buildPolylines(e,t.width,r,o,{cap:t.cap,join:t.join,miter_limit:t.miter_limit,scaling_index:this.vertex_layout.index.a_extrude,scaling_normalize:256,texcoord_index:this.vertex_layout.index.a_texcoord,texcoord_width:(t.width||t.next_width)/n.tile.overzoom2,texcoord_normalize:65535,closed_polygon:i&&i.closed_polygon,remove_tile_edges:!t.tile_edges&&i&&i.remove_tile_edges,tile_edge_tolerance:b.default.tile_scale*n.tile.pad_scale*4})},buildPolygons:function(e,t,r,n){for(var i=0;i 0\n applyLayerOrder(a_position.w + u_tile_proxy_depth + 1., position);\n #endif\n\n // Apply pixel offset in screen-space\n // Multiply by 2 is because screen is 2 units wide Normalized Device Coords (and u_resolution device pixels wide)\n // Device pixel ratio adjustment is because shape is in logical pixels\n position.xy += shape * position.w * 2. * u_device_pixel_ratio / u_resolution;\n\n gl_Position = position;\n}\n",L="uniform vec2 u_resolution;\nuniform float u_time;\nuniform vec3 u_map_position;\nuniform vec4 u_tile_origin;\nuniform float u_meters_per_pixel;\nuniform float u_device_pixel_ratio;\nuniform float u_visible_time;\nuniform bool u_fade_in;\n\nuniform mat3 u_normalMatrix;\nuniform mat3 u_inverseNormalMatrix;\n\nuniform sampler2D u_texture;\n\n#ifdef TANGRAM_MULTI_SAMPLER\nuniform sampler2D u_label_texture;\nvarying float v_sampler;\n#endif\n\nvarying vec4 v_color;\nvarying vec2 v_texcoord;\nvarying vec4 v_world_position;\n\n#define TANGRAM_NORMAL vec3(0., 0., 1.)\n\n// Alpha discard threshold (substitute for alpha blending)\n#ifndef TANGRAM_ALPHA_TEST\n#define TANGRAM_ALPHA_TEST 0.5\n#endif\n\n// Alpha fade range for edges of points\n#ifndef TANGRAM_FADE_RANGE\n#define TANGRAM_FADE_RANGE .15\n#endif\n#define TANGRAM_FADE_START (1. - TANGRAM_FADE_RANGE)\n\n#pragma tangram: camera\n#pragma tangram: material\n#pragma tangram: lighting\n#pragma tangram: raster\n#pragma tangram: global\n\nvoid main (void) {\n // Initialize globals\n #pragma tangram: setup\n\n vec4 color = v_color;\n\n #ifdef TANGRAM_MULTI_SAMPLER\n if (v_sampler == 0.) { // sprite sampler\n #endif\n #ifdef TANGRAM_POINT_TEXTURE\n // Draw sprite\n color *= texture2D(u_texture, v_texcoord);\n #else\n // Draw a point\n vec2 uv = v_texcoord * 2. - 1.; // fade alpha near circle edge\n float point_dist = length(uv);\n color.a = clamp(color.a - (smoothstep(0., TANGRAM_FADE_RANGE, (point_dist - TANGRAM_FADE_START)) / TANGRAM_FADE_RANGE), 0., color.a);\n #endif\n #ifdef TANGRAM_MULTI_SAMPLER\n }\n else { // label sampler\n color = texture2D(u_label_texture, v_texcoord);\n color.rgb /= max(color.a, 0.001); // un-multiply canvas texture\n }\n #endif\n\n // Manually un-multiply alpha, for cases where texture has pre-multiplied alpha\n #ifdef TANGRAM_UNMULTIPLY_ALPHA\n color.rgb /= max(color.a, 0.001);\n #endif\n\n // If blending is off, use alpha discard as a lower-quality substitute\n #if !defined(TANGRAM_BLEND_OVERLAY) && !defined(TANGRAM_BLEND_INLAY)\n if (color.a < TANGRAM_ALPHA_TEST) {\n discard;\n }\n #endif\n\n #pragma tangram: color\n\n // Fade in (if requested) based on time mesh has been visible\n #ifdef TANGRAM_FADE_IN_RATE\n if (u_fade_in) {\n color.a *= clamp(u_visible_time * TANGRAM_FADE_IN_RATE, 0., 1.);\n }\n #endif\n\n // Fade out when tile is zooming out, e.g. acting as proxy tiles\n // NB: this is mostly done to compensate for text label collision happening at the label's 1x zoom. As labels\n // in proxy tiles are scaled down, they begin to overlap, and the fade is a simple way to ease the transition.\n #ifdef TANGRAM_FADE_ON_ZOOM_OUT\n color.a *= clamp(1. - TANGRAM_FADE_ON_ZOOM_OUT_RATE * (u_tile_origin.z - u_map_position.z), 0., 1.);\n #endif\n\n #pragma tangram: filter\n\n gl_FragColor = color;\n}\n",O=r.Points=f.default(p.Style);u.default(O,z.TextLabels),u.default(O,{name:"points",built_in:!0,selection:!0,collision:!0,blend:"overlay",init:function(){arguments.length<=0||void 0===arguments[0]?{}:arguments[0];p.Style.init.apply(this,arguments),this.vertex_shader_src=N,this.fragment_shader_src=L;var e=[{name:"a_position",size:4,type:g.default.SHORT,normalized:!1},{name:"a_shape",size:4,type:g.default.SHORT,normalized:!1},{name:"a_texcoord",size:2,type:g.default.UNSIGNED_SHORT,normalized:!0},{name:"a_offset",size:2,type:g.default.SHORT,normalized:!1},{name:"a_color",size:4,type:g.default.UNSIGNED_BYTE,normalized:!0}];this.selection&&e.push({name:"a_selection_color",size:4,type:g.default.UNSIGNED_BYTE,normalized:!0}),this.vertex_layout=new y.default(e),"overlay"!==this.blend&&(this.defines.TANGRAM_LAYER_ORDER=!0),this.shaders.uniforms=this.shaders.uniforms||{},this.shaders.uniforms.u_label_texture=w.default.default,this.texture&&(this.defines.TANGRAM_POINT_TEXTURE=!0,this.shaders.uniforms.u_texture=this.texture),this.defines.TANGRAM_MULTI_SAMPLER=!0,this.defines.TANGRAM_FADE_ON_ZOOM_OUT=!0,this.defines.TANGRAM_FADE_ON_ZOOM_OUT_RATE=2,P.default.suppress_label_fade_in===!0?(this.fade_in_time=0,this.defines.TANGRAM_FADE_IN_RATE=null):(this.fade_in_time=.15,this.defines.TANGRAM_FADE_IN_RATE=1/this.fade_in_time),this.collision_group_points=this.name+"-points",this.collision_group_text=this.name+"-text",this.reset()},reset:function(){this.queues={},this.resetText(),this.texture_missing_sprites={}},addFeature:function(e,t,r){var n=r.tile;if(n.generation===this.generation&&(t=this.preprocess(t))){var i={};if(i.color=this.parseColor(t.color,r),!i.color&&!this.texture)return null;var a=i.sprite=m.StyleParser.evalProperty(t.sprite,r);if(i.sprite_default=t.sprite_default,this.texture&&w.default.textures[this.texture]&&w.default.textures[this.texture].sprites){if(!a&&!i.sprite_default)return;if(!w.default.textures[this.texture].sprites[a]){if(!i.sprite_default)return void(this.texture_missing_sprites[a]||(d.default("debug","Style: in style '"+this.name+"', could not find sprite '"+a+"' for texture '"+this.texture+"'"),this.texture_missing_sprites[a]=!0));if(a=i.sprite_default,!w.default.textures[this.texture].sprites[a])return void d.default("warn","Style: in style '"+this.name+"', could not find default sprite '"+a+"' for texture '"+this.texture+"'")}}else a&&(d.default("warn","Style: in style '"+this.name+"', sprite '"+a+"' was specified, but texture '"+this.texture+"' has no sprites"),a=null);var o=void 0;this.texture&&a?(o=w.default.getSpriteInfo(this.texture,a),i.texcoords=o.texcoords):i.texcoords=null,i.z=t.z&&m.StyleParser.evalCachedDistanceProperty(t.z,r)||m.StyleParser.defaults.z,i.size=t.size,i.size=i.size?m.StyleParser.evalCachedProperty(i.size,r):o?o.size:[16,16],i.size=[Math.min(i.size[0]||i.size,256),Math.min(i.size[1]||i.size,256)],i.angle=m.StyleParser.evalProperty(t.angle,r)*Math.PI/180||0,i.sampler=0,this.computeLayout(i,e,t,r,n);var s=t.text&&t.text.visible!==!1&&this.parseTextFeature(e,t.text,r,n);s&&(s.layout.parent=i,s.layout.priority=t.text.priority?Math.max(s.layout.priority,i.priority+.5):i.priority+.5,s.layout.move_into_tile=!1,R.default.addStyle(this.collision_group_text,n.key)),this.tile_data[n.key]||this.startData(n),this.queues[n.key].push({feature:e,draw:t,context:r,style:i,text_feature:s}),R.default.addStyle(this.collision_group_points,n.key)}},startData:function(e){return this.queues[e.key]=[],p.Style.startData.call(this,e)},endData:function(e){var t=this;if(e.canceled)return void d.default("trace","Style "+this.name+": stop tile build because tile was canceled: "+e.key);var r=this.queues[e.key];this.queues[e.key]=[];var n=[],i=[];return r.forEach(function(e){for(var r=e.style,a=e.feature,o=a.geometry,s=t.buildLabels(r.size,o,r),l=0;l>>0,a.priority=o,a},buildTextLabels:function(e,t){for(var r=[],n=0;n 0\n applyLayerOrder(a_position.w + u_tile_proxy_depth + 1., position);\n\n gl_Position = position;\n}\n',v="uniform vec2 u_resolution;\nuniform float u_time;\nuniform vec3 u_map_position;\nuniform vec4 u_tile_origin;\nuniform float u_meters_per_pixel;\nuniform float u_device_pixel_ratio;\nuniform float u_visible_time;\nuniform bool u_fade_in;\n\nuniform mat3 u_normalMatrix;\nuniform mat3 u_inverseNormalMatrix;\n\nvarying vec4 v_position;\nvarying vec3 v_normal;\nvarying vec4 v_color;\nvarying vec4 v_world_position;\n\n#define TANGRAM_NORMAL v_normal\n\n#ifdef TANGRAM_TEXTURE_COORDS\n varying vec2 v_texcoord;\n#endif\n\n#ifdef TANGRAM_MODEL_POSITION_BASE_ZOOM_VARYING\n varying vec4 v_modelpos_base_zoom;\n#endif\n\n#if defined(TANGRAM_LIGHTING_VERTEX)\n varying vec4 v_lighting;\n#endif\n\n#pragma tangram: camera\n#pragma tangram: material\n#pragma tangram: lighting\n#pragma tangram: raster\n#pragma tangram: global\n\nvoid main (void) {\n // Initialize globals\n #pragma tangram: setup\n\n vec4 color = v_color;\n vec3 normal = TANGRAM_NORMAL;\n\n // Apply raster to vertex color\n #ifdef TANGRAM_RASTER_TEXTURE_COLOR\n color *= sampleRaster(0); // multiplied to tint texture color\n #endif\n\n // Apply line texture\n #ifdef TANGRAM_LINE_TEXTURE\n vec2 _line_st = vec2(v_texcoord.x, fract(v_texcoord.y / u_texture_ratio));\n vec4 _line_color = texture2D(u_texture, _line_st);\n\n if (_line_color.a < TANGRAM_ALPHA_TEST) {\n #ifdef TANGRAM_LINE_BACKGROUND_COLOR\n color.rgb = TANGRAM_LINE_BACKGROUND_COLOR;\n #elif !defined(TANGRAM_BLEND_OVERLAY) && !defined(TANGRAM_BLEND_INLAY)\n discard; // use discard when alpha blending is unavailable\n #else\n color.a = 0.; // use alpha channel when blending is available\n #endif\n }\n else {\n color *= _line_color;\n }\n #endif\n\n // First, get normal from raster tile (if applicable)\n #ifdef TANGRAM_RASTER_TEXTURE_NORMAL\n normal = normalize(sampleRaster(0).rgb * 2. - 1.);\n #endif\n\n // Second, alter normal with normal map texture (if applicable)\n #if defined(TANGRAM_LIGHTING_FRAGMENT) && defined(TANGRAM_MATERIAL_NORMAL_TEXTURE)\n calculateNormal(normal);\n #endif\n\n // Normal modification applied here for fragment lighting or no lighting,\n // and in vertex shader for vertex lighting\n #if !defined(TANGRAM_LIGHTING_VERTEX)\n #pragma tangram: normal\n #endif\n\n // Color modification before lighting is applied\n #pragma tangram: color\n\n #if defined(TANGRAM_LIGHTING_FRAGMENT)\n // Calculate per-fragment lighting\n color = calculateLighting(v_position.xyz - u_eye, normal, color);\n #elif defined(TANGRAM_LIGHTING_VERTEX)\n // Apply lighting intensity interpolated from vertex shader\n color *= v_lighting;\n #endif\n\n // Post-processing effects (modify color after lighting)\n #pragma tangram: filter\n\n gl_FragColor = color;\n}\n",y=r.Polygons=s.default(l.Style);r.shaderSrc_polygonsVertex=g,r.shaderSrc_polygonsFragment=v,a.default(y,{name:"polygons",built_in:!0,vertex_shader_src:g,fragment_shader_src:v,selection:!0,init:function(){l.Style.init.apply(this,arguments);var e=[{name:"a_position",size:4,type:f.default.SHORT,normalized:!1},{name:"a_normal",size:3,type:f.default.BYTE,normalized:!0},{name:"a_color",size:4,type:f.default.UNSIGNED_BYTE,normalized:!0}];this.defines.TANGRAM_NORMAL_ATTRIBUTE=!0,this.defines.TANGRAM_LAYER_ORDER=!0,this.selection&&e.push({name:"a_selection_color",size:4,type:f.default.UNSIGNED_BYTE,normalized:!0}),this.texcoords&&(this.defines.TANGRAM_TEXTURE_COORDS=!0,e.push({name:"a_texcoord",size:2,type:f.default.UNSIGNED_SHORT,normalized:!0})),this.vertex_layout=new d.default(e)},_parseFeature:function(e,t,r){var n=this.feature_style;return n.color=this.parseColor(t.color,r),n.color?(n.z=t.z&&u.StyleParser.evalCachedDistanceProperty(t.z,r)||u.StyleParser.defaults.z,n.z*=_.default.height_scale,n.extrude=u.StyleParser.evalProperty(t.extrude,r),n.extrude&&(n.extrude===!0?(n.height=e.properties.height||u.StyleParser.defaults.height,n.min_height=e.properties.min_height||u.StyleParser.defaults.min_height):"number"==typeof n.extrude?(n.height=n.extrude,n.min_height=0):Array.isArray(n.extrude)&&(n.min_height=n.extrude[0],n.height=n.extrude[1]),n.height*=_.default.height_scale,n.min_height*=_.default.height_scale),n.tile_edges=t.tile_edges,n):null},_preprocess:function(e){return e.color=u.StyleParser.createColorPropertyCache(e.color),e.z=u.StyleParser.createPropertyCache(e.z,u.StyleParser.parseUnits),e},makeVertexTemplate:function(e){var t=0;return this.vertex_template[t++]=0,this.vertex_template[t++]=0,this.vertex_template[t++]=e.z||0,this.vertex_template[t++]=this.scaleOrder(e.order),this.vertex_template[t++]=0,this.vertex_template[t++]=0,this.vertex_template[t++]=127,this.vertex_template[t++]=255*e.color[0],this.vertex_template[t++]=255*e.color[1],this.vertex_template[t++]=255*e.color[2],this.vertex_template[t++]=255*e.color[3],this.selection&&(this.vertex_template[t++]=255*e.selection_color[0],this.vertex_template[t++]=255*e.selection_color[1],this.vertex_template[t++]=255*e.selection_color[2],this.vertex_template[t++]=255*e.selection_color[3]),this.texcoords&&(this.vertex_template[t++]=0,this.vertex_template[t++]=0),this.vertex_template},buildPolygons:function(e,t,r,n){var i=this.makeVertexTemplate(t),a={texcoord_index:this.vertex_layout.index.a_texcoord,texcoord_normalize:65535,remove_tile_edges:!t.tile_edges,tile_edge_tolerance:_.default.tile_scale*n.tile.pad_scale*4,winding:n.winding};t.extrude&&t.height?p.buildExtrudedPolygons(e,t.z,t.height,t.min_height,r,i,this.vertex_layout.index.a_normal,127,a):p.buildPolygons(e,r,i,a)}})},{"../../builders/polygons":296,"../../geo":299,"../../gl/constants":300,"../../gl/vertex_layout":311,"../style":338,"../style_parser":340,"babel-runtime/core-js/object/assign":9,"babel-runtime/core-js/object/create":10}],337:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0}),r.RasterStyle=void 0;var i=e("babel-runtime/core-js/object/assign"),a=n(i),o=e("babel-runtime/core-js/object/create"),s=n(o),l=e("../style_parser"),u=e("../polygons/polygons"),c=r.RasterStyle=s.default(u.Polygons);a.default(c,{name:"raster","super":u.Polygons,built_in:!0,selection:!1,init:function(){this.raster=this.raster||"color",this.super.init.apply(this,arguments)},_preprocess:function(e){return e.color=e.color||l.StyleParser.defaults.color,this.super._preprocess.apply(this,arguments)}})},{"../polygons/polygons":336,"../style_parser":340,"babel-runtime/core-js/object/assign":9,"babel-runtime/core-js/object/create":10}],338:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0}),r.Style=void 0;var i=e("babel-runtime/helpers/slicedToArray"),a=n(i),o=e("babel-runtime/core-js/get-iterator"),s=n(o),l=e("babel-runtime/core-js/object/keys"),u=n(l),c=e("babel-runtime/core-js/object/assign"),f=n(c),h=e("babel-runtime/core-js/promise"),d=n(h),p=e("./style_parser"),m=e("../selection"),_=n(m),g=e("../gl/shader_program"),v=n(g),y=e("../gl/vbo_mesh"),b=n(y),x=e("../gl/texture"),w=n(x),k=e("../material"),A=n(k),T=e("../light"),E=n(T),S=e("../sources/raster"),R=e("../utils/log"),j=n(R),M=e("../utils/thread"),z=n(M),C=e("../utils/worker_broker"),P=n(C),N="// Fragment shader for feature selection passes\n// Renders in silhouette according to selection (picking) color, or black if none defined\n\n#ifdef TANGRAM_FEATURE_SELECTION\n varying vec4 v_selection_color;\n#endif\n\nvoid main (void) {\n #ifdef TANGRAM_FEATURE_SELECTION\n gl_FragColor = v_selection_color;\n #else\n gl_FragColor = vec4(0., 0., 0., 1.);\n #endif\n}\n",L="// Uniforms defining raster textures and macros for accessing them\n\n#ifdef TANGRAM_FRAGMENT_SHADER\nuniform sampler2D u_rasters[TANGRAM_NUM_RASTER_SOURCES]; // raster tile texture samplers\nuniform vec2 u_raster_sizes[TANGRAM_NUM_RASTER_SOURCES]; // raster tile texture sizes (width/height in pixels)\nuniform vec3 u_raster_offsets[TANGRAM_NUM_RASTER_SOURCES]; // raster tile texture UV starting offset for tile\n\n// Note: the raster accessors below are #defines rather than functions to\n// avoid issues with constant integer expressions for array indices\n\n// Adjusts UVs in model space to account for raster tile texture overzooming\n// (applies scale and offset adjustments)\n#define adjustRasterUV(raster_index, uv) \\\n ((uv) * u_raster_offsets[raster_index].z + u_raster_offsets[raster_index].xy)\n\n// Returns the UVs of the current model position for a raster sampler\n#define currentRasterUV(raster_index) \\\n (adjustRasterUV(raster_index, v_modelpos_base_zoom.xy))\n\n// Returns pixel location in raster tile texture at current model position\n#define currentRasterPixel(raster_index) \\\n (currentRasterUV(raster_index) * rasterPixelSize(raster_index))\n\n// Samples a raster tile texture for the current model position\n#define sampleRaster(raster_index) \\\n (texture2D(u_rasters[raster_index], currentRasterUV(raster_index)))\n\n// Samples a raster tile texture for a given pixel\n#define sampleRasterAtPixel(raster_index, pixel) \\\n (texture2D(u_rasters[raster_index], adjustRasterUV(raster_index, (pixel) / rasterPixelSize(raster_index))))\n\n// Returns size of raster sampler in pixels\n#define rasterPixelSize(raster_index) \\\n (u_raster_sizes[raster_index])\n\n#endif\n",O=r.Style={init:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.generation,r=e.styles,n=e.sources,i=void 0===n?{}:n,a=e.introspection; this.isBuiltIn()||(this.built_in=!1),this.generation=t,this.styles=r,this.sources=i,this.defines=this.hasOwnProperty("defines")&&this.defines||{},this.shaders=this.hasOwnProperty("shaders")&&this.shaders||{},this.introspection=a||!1,this.selection=this.selection||this.introspection||!1,this.compiling=!1,this.compiled=!1,this.program=null,this.selection_program=null,this.feature_style={},this.vertex_template=[],this.tile_data={},this.main_thread_target=["Style",this.name,this.generation].join("/"),z.default.is_main&&P.default.addTarget(this.main_thread_target,this),this.defines.TANGRAM_WORLD_POSITION_WRAP=1e5,this.blend=this.blend||"opaque",this.defines["TANGRAM_BLEND_"+this.blend.toUpperCase()]=!0,null==this.blend_order&&(this.blend_order=-1),this.material instanceof A.default||(A.default.isValid(this.material)||(this.material=p.StyleParser.defaults.material),this.material=new A.default(this.material)),this.material.inject(this),E.default.setMode(this.lighting,this),this.setupRasters(),this.initialized=!0},destroy:function(){this.program&&(this.program.destroy(),this.program=null),this.selection_program&&(this.selection_program.destroy(),this.selection_program=null),this.gl=null,this.initialized=!1},reset:function(){},isBuiltIn:function(){return this.hasOwnProperty("built_in")&&this.built_in},fillVertexTemplate:function(e,t,r){var n=r.size,i=r.offset;i=void 0===i?0:i;var a=this.vertex_layout.index[e];if(void 0===a)return void j.default("warn","Style: in style '"+this.name+"', no index found in vertex layout for attribute '"+e+"'");for(var o=0;n>o;++o){var s=t.length>o?t[o]:t;this.vertex_template[a+o+i]=s}},startData:function(e){return this.tile_data[e.key]={vertex_data:null,uniforms:{},textures:[]},this.tile_data[e.key]},endData:function(e){var t=this.tile_data[e.key];return this.tile_data[e.key]=null,t&&t.vertex_data&&t.vertex_data.vertex_count>0?(t.vertex_data.end(),t.vertex_elements=t.vertex_data.element_buffer,t.vertex_data=t.vertex_data.vertex_buffer,this.buildRasterTextures(e,t).then(function(){return t})):d.default.resolve(null)},hasDataForTile:function(e){return null!=this.tile_data[e]},addFeature:function(e,t,r){var n=r.tile;if(n.generation===this.generation){this.tile_data[n.key]||this.startData(n);var i=this.parseFeature(e,t,r);i&&(this.tile_data[n.key].vertex_data||(this.tile_data[n.key].vertex_data=this.vertex_layout.createVertexData()),this.buildGeometry(e.geometry,i,this.tile_data[n.key].vertex_data,r))}},buildGeometry:function(e,t,r,n){"Polygon"===e.type?this.buildPolygons([e.coordinates],t,r,n):"MultiPolygon"===e.type?this.buildPolygons(e.coordinates,t,r,n):"LineString"===e.type?this.buildLines([e.coordinates],t,r,n):"MultiLineString"===e.type?this.buildLines(e.coordinates,t,r,n):"Point"===e.type?this.buildPoints([e.coordinates],t,r,n):"MultiPoint"===e.type&&this.buildPoints(e.coordinates,t,r,n)},parseFeature:function(e,t,r){try{var n=this.feature_style;if(t=this.preprocess(t),!t)return;n.order=this.parseOrder(t.order,r);var i=!1;return n.interactive=this.introspection||t.interactive,this.selection&&(i=p.StyleParser.evalProperty(n.interactive,r)),n.selection_color=i?_.default.makeColor(e,r.tile,r):_.default.defaultColor,n=this._parseFeature(e,t,r)}catch(a){j.default("error","Style.parseFeature: style parsing error",e,n,a)}},_parseFeature:function(){return this.feature_style},preprocess:function(e){if(!e.preprocessed){if(e=this._preprocess(e),!e)return;e.preprocessed=!0}return e},_preprocess:function(e){return e},parseOrder:function(e,t){return"number"!=typeof e?p.StyleParser.calculateOrder(e,t):e},scaleOrder:function(e){return 2*e},parseColor:function(e,t){return e?p.StyleParser.evalCachedColorProperty(e,t):this.shaders.blocks.color||this.shaders.blocks.filter?p.StyleParser.defaults.color:void 0},buildPolygons:function(){},buildLines:function(){},buildPoints:function(){},setGL:function(e){this.gl=e,this.max_texture_size=w.default.getMaxTextureSize(this.gl)},makeMesh:function(e,t){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return new b.default(this.gl,e,t,this.vertex_layout,r)},render:function(e){return e.render()},compile:function(){if(!this.gl)throw new Error("style.compile(): skipping for "+this.name+" because no GL context");if(this.compiling)throw new Error("style.compile(): skipping for "+this.name+" because style is already compiling");this.compiling=!0,this.compiled=!1;var e=this.buildDefineList();if(this.selection){var t=f.default({},e);t.TANGRAM_FEATURE_SELECTION=!0}var r=this.shaders&&this.shaders.blocks,n=this.shaders&&this.shaders.block_scopes,i=f.default({},this.shaders&&this.shaders.uniforms),a=this.shaders&&this.shaders.extensions;"string"==typeof a&&(a=[a]);try{this.program=new v.default(this.gl,this.vertex_shader_src,this.fragment_shader_src,{name:this.name,defines:e,uniforms:i,blocks:r,block_scopes:n,extensions:a}),this.program.compile(),this.selection?(this.selection_program=new v.default(this.gl,this.vertex_shader_src,N,{name:this.name+" (selection)",defines:t,uniforms:i,blocks:r,block_scopes:n,extensions:a}),this.selection_program.compile()):this.selection_program=null}catch(o){throw this.compiling=!1,this.compiled=!1,new Error("style.compile(): style "+this.name+" error:",o)}this.compiling=!1,this.compiled=!0},addShaderBlock:function(e,t){var r=arguments.length<=2||void 0===arguments[2]?null:arguments[2];this.shaders.blocks=this.shaders.blocks||{},this.shaders.blocks[e]=this.shaders.blocks[e]||[],this.shaders.blocks[e].push(t),this.shaders.block_scopes=this.shaders.block_scopes||{},this.shaders.block_scopes[e]=this.shaders.block_scopes[e]||[],this.shaders.block_scopes[e].push(r)},removeShaderBlock:function(e){this.shaders.blocks&&(this.shaders.blocks[e]=null)},replaceShaderBlock:function(e,t){var r=arguments.length<=2||void 0===arguments[2]?null:arguments[2];this.removeShaderBlock(e),this.addShaderBlock(e,t,r)},buildDefineList:function(){var e={};if(null!=this.defines)for(var t in this.defines)e[t]=this.defines[t];if(null!=this.shaders&&null!=this.shaders.defines)for(t in this.shaders.defines)e[t]=this.shaders.defines[t];return e},hasRasters:function(){return["color","normal","custom"].indexOf(this.raster)>-1},setupRasters:function(){var e=this;if(this.hasRasters()){"color"===this.raster?this.defines.TANGRAM_RASTER_TEXTURE_COLOR=!0:"normal"===this.raster&&(this.defines.TANGRAM_RASTER_TEXTURE_NORMAL=!0);var t=u.default(this.sources).filter(function(t){return e.sources[t]instanceof S.RasterTileSource}).length;this.defines.TANGRAM_NUM_RASTER_SOURCES="int("+t+")",t>0&&(this.defines.TANGRAM_MODEL_POSITION_BASE_ZOOM_VARYING=!0,this.replaceShaderBlock("raster",L,"Raster"))}},buildRasterTextures:function(e,t){var r=this;if(!this.hasRasters())return d.default.resolve(t);var n={},i={};return e.rasters.map(function(e){return r.sources[e]}).filter(function(e){return e}).forEach(function(t,r){if(t instanceof S.RasterTileSource){var a=t.tileTexture(e);n[a.url]=a,i[a.url]=r}}),0===u.default(n).length?d.default.resolve(t):P.default.postMessage(this.main_thread_target+".loadTextures",n).then(function(r){if(!r||r.length<1)return t;t.uniforms=t.uniforms||{},t.textures=t.textures||[];var o=t.uniforms.u_rasters=[],l=t.uniforms.u_raster_sizes=[],u=t.uniforms.u_raster_offsets=[],c=!0,f=!1,h=void 0;try{for(var d,p=s.default(r);!(c=(d=p.next()).done);c=!0){var m=a.default(d.value,3),_=m[0],g=m[1],v=m[2],y=i[_],b=n[_].coords;if(o[y]=_,t.textures.push(_),l[y]=[g,v],e.coords.z>b.z){var x=e.coords.z-b.z,w=Math.pow(2,x);u[y]=[e.coords.x%w/w,(w-1-e.coords.y%w)/w,1/w]}else u[y]=[0,0,1]}}catch(k){f=!0,h=k}finally{try{!c&&p.return&&p.return()}finally{if(f)throw h}}return t})},loadTextures:function(e){return w.default.createFromObject(this.gl,e).then(function(){return d.default.all(u.default(e).map(function(e){return w.default.textures[e]&&w.default.textures[e].load()}).filter(function(e){return e}))}).then(function(e){return e.forEach(function(e){return e.retain()}),e.map(function(e){return[e.name,e.width,e.height]})})},setup:function(){this.setUniforms(),this.material.setupProgram(v.default.current)},setUniforms:function(){var e=v.default.current;e&&e.setUniforms(this.shaders&&this.shaders.uniforms,!0)},render_states:{opaque:{depth_test:!0,depth_write:!0},add:{depth_test:!0,depth_write:!1},multiply:{depth_test:!0,depth_write:!1},inlay:{depth_test:!0,depth_write:!1},overlay:{depth_test:!1,depth_write:!1}},default_blend_orders:{opaque:0,add:1,multiply:2,inlay:3,overlay:4},blendOrderSort:function(e,t){return"opaque"===e.blend||"opaque"===t.blend?"opaque"===e.blend&&"opaque"===t.blend?e.namet.blend_order?1:O.default_blend_orders[e.blend]O.default_blend_orders[t.blend]?1:e.name0;)t.push(r.pop());t.push(a)}}for(;r.length>0;)t.push(r.pop());return t}function o(e){var t=e.split(" ");return a(t)}Object.defineProperty(r,"__esModule",{value:!0});var s=e("babel-runtime/helpers/slicedToArray"),l=n(s),u=e("babel-runtime/helpers/classCallCheck"),c=n(u),f=e("babel-runtime/helpers/createClass"),h=n(f),d=e("../../utils/utils"),p=n(d),m=e("../../gl/texture"),_=n(m),g=e("./font_manager"),v=n(g),y=e("../../utils/debug_settings"),b=n(y),x=function(){function e(){c.default(this,e),this.canvas=document.createElement("canvas"),this.canvas.style.backgroundColor="transparent",this.context=this.canvas.getContext("2d"),this.vertical_text_buffer=8,this.horizontal_text_buffer=4}return h.default(e,[{key:"resize",value:function(e,t){this.canvas.width=e,this.canvas.height=t,this.context.clearRect(0,0,e,t)}},{key:"setFont",value:function(e){var t=e.font_css,r=e.fill,n=e.stroke,i=e.stroke_width,a=e.px_size;this.px_size=a;var o=this.context,s=p.default.device_pixel_ratio;n&&i>0&&(o.strokeStyle=n,o.lineWidth=i*s),o.fillStyle=r,o.font=t,o.miterLimit=2}},{key:"textSizes",value:function(t){var r=this,n=p.default.device_pixel_ratio;return v.default.loadFonts().then(function(){for(var i in t){e.text_cache[i]=e.text_cache[i]||{};var a=t[i],s=!0,l=void 0;for(var u in a){var c=a[u],f=c.text_settings;if(s&&(r.setFont(f),l=r.context.measureText(" ").width/n,s=!1),c.space_width=l,f.can_articulate){var h=o(u);c.segments=h,c.size=[];for(var d=0;d0&&this.context.strokeText(y,b,x),this.context.fillText(y,b,x)}},{key:"rasterize",value:function(t,r,n){for(var i in t){var a=t[i],o=!0;for(var s in a){var l=a[s],u=l.text_settings;if(o&&(this.setFont(u),o=!1),u.can_articulate){var c=l.segments;l.texcoords=[];for(var f=0;fi&&(i=m[0]),o+m[1]s&&(s=o)):(a+=i,i=0,o=0,h=[a,o]),e.texcoord_cache[n][l][p]={texture_position:h}}}else{var _=f.size.texture_size;_[0]>i&&(i=_[0]);for(var g in f.align)o+_[1]s&&(s=o)):(a+=i,i=0,o=0,f.align[g].texture_position=[a,o])}}}return[a+i,s]}},{key:"applyTextTransform",value:function(e,t){return"capitalize"===t?e.replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1)}):"uppercase"===t?e.toUpperCase():"lowercase"===t?e.toLowerCase():e}},{key:"clearTexcoordCache",value:function(t){e.texcoord_cache[t]={}}}],[{key:"fontPixelSize",value:function(t){if(null!=t){t="string"==typeof t?t:String(t);var r=t.match(e.font_size_re)||[],n=l.default(r,3),i=n[1],a=n[2];return a=a||"px","em"===a?i*=16:"pt"===a?i/=.75:"%"===a&&(i/=6.25),i=parseFloat(i),i*=p.default.device_pixel_ratio}}}]),e}();r.default=x,x.font_size_re=/((?:[0-9]*\.)?[0-9]+)\s*(px|pt|em|%)?/,x.text_cache={},x.cache_stats={hits:0,misses:0},x.texcoord_cache={};var w=function(){function e(t){var r=arguments.length<=1||void 0===arguments[1]?1/0:arguments[1],n=arguments.length<=2||void 0===arguments[2]?1/0:arguments[2]; c.default(this,e),this.width=0,this.height=0,this.lines=[],this.ellipsis="...",this.ellipsis_width=t.measureText(this.ellipsis).width,this.max_lines=r,this.text_wrap=n,this.context=t}return h.default(e,[{key:"createLine",value:function(e){return this.lines.lengththis.width&&(this.width=Math.ceil(t)),this.lines.push(e),this.height+=e.height,!0}return this.addEllipsis(),!1}},{key:"advance",value:function(e,t){var r=this.push(e);return r?this.createLine(t):!1}},{key:"addEllipsis",value:function(){var e=this.lines[this.lines.length-1];e.append(this.ellipsis),e.width+=this.ellipsis_width,e.width>this.width&&(this.width=e.width)}},{key:"finish",value:function(e){e?this.push(e):this.addEllipsis()}}],[{key:"parse",value:function(t,r,n,i,a){var o=void 0;o="number"==typeof r?t.split(" "):[t];for(var s=new e(a,n,r),l=s.createLine(i),u=0;u0&&l.exceedsTextwrap(p)){if(l=s.advance(l,i),!l)break;l.append(d),f=!0}else l.append(p);hthis.text_wrap}}]),e}()},{"../../gl/texture":306,"../../utils/debug_settings":349,"../../utils/utils":358,"./font_manager":342,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22,"babel-runtime/helpers/slicedToArray":27}],342:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var i=e("babel-runtime/core-js/object/assign"),a=n(i),o=e("babel-runtime/helpers/typeof"),s=n(o),l=e("babel-runtime/core-js/promise"),u=n(l),c=e("../../utils/log"),f=n(c),h=e("../../utils/utils"),d=n(h),p=e("fontfaceobserver"),m=n(p),_={fonts_loaded:u.default.resolve(),loadFonts:function(e){var t=this;return e&&!function(){var r=[],n=function(n){Array.isArray(e[n])?e[n].forEach(function(e){return r.push(t.loadFontFace(n,e))}):r.push(t.loadFontFace(n,e[n]))};for(var i in e)n(i);t.fonts_loaded=u.default.all(r.filter(function(e){return e}))}(),this.fonts_loaded},loadFontFace:function(e,t){if(null!=t&&("object"===("undefined"==typeof t?"undefined":s.default(t))||"external"===t)){var r={family:e},n=u.default.resolve();"object"===("undefined"==typeof t?"undefined":s.default(t))&&(a.default(r,t),"string"==typeof t.url&&(n=this.injectFontFace(r)));var i=new m.default(e,r);return n.then(function(){return i.load()}).then(function(){f.default("debug","Font face '"+e+"' is available",r)},function(){f.default("debug","Font face '"+e+"' is NOT available",r)})}},injectFontFace:function(e){var t=this,r=e.family,n=e.url,i=e.weight,a=e.style;void 0===this.supports_native_font_loading&&(this.supports_native_font_loading=void 0!==window.FontFace);var o=u.default.resolve(n);return"blob:"===n.slice(0,5)&&(o=d.default.io(n,6e4,"arraybuffer").then(function(e){var r=new Uint8Array(e);if(t.supports_native_font_loading)return r;for(var n="",i=0;i0?e.fitness1){for(var o=(e.length-1)/a,s=0;a>s;s++)r.segment_start=Math.floor(s*o),r.segment_end=Math.floor((s+1)*o),n.push(new v.default(t,e,r));r.segment_start=null,r.segment_end=null}else{var l=new v.default(t,e,r);if(!l.throw_away){var u=i(l);u&&n.push(u)}}}});var b=.4,x=.5;y.texture_id=0},{"../../geo":299,"../../labels/collision":312,"../../labels/label_line":314,"../../labels/label_point":315,"../points/points":335,"../style":338,"babel-runtime/core-js/object/assign":9,"babel-runtime/core-js/object/create":10}],344:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0}),r.TextLabels=void 0;{var i=e("babel-runtime/helpers/typeof"),a=n(i),o=e("babel-runtime/helpers/toConsumableArray"),s=n(o),l=e("babel-runtime/core-js/promise"),u=n(l),c=e("babel-runtime/core-js/object/keys"),f=n(c),h=e("../style_parser"),d=e("../../gl/texture"),p=n(d),m=e("../../geo"),_=n(m),g=e("../../utils/log"),v=n(g),y=e("../../utils/thread"),b=n(y),x=e("../../utils/worker_broker"),w=n(x),k=e("../../labels/collision"),A=n(k),T=e("../text/text_settings"),E=n(T),S=e("../text/canvas_text"),R=n(S),j=0;r.TextLabels={resetText:function(){b.default.is_main?this.canvas=new R.default:b.default.is_worker&&(this.texts={})},freeText:function(e){delete this.texts[e.key]},parseTextFeature:function(e,t,r,n){var i=this.parseTextSource(e,t,r);if(null!=i){var a=this.computeTextLayout({},e,t,r,n,i),o=E.default.compute(e,t,r),s=E.default.key(o);this.texts[n.key]=this.texts[n.key]||{};var l=this.texts[n.key][s]=this.texts[n.key][s]||{};return l[i]||(l[i]={text_settings:o,ref:0}),{draw:t,text:i,text_settings_key:s,layout:a}}},parseTextSource:function(e,t,r){var n=void 0,i=t.text_source||"name";if(Array.isArray(i))for(var a=0;ar;r++)t[r]=arguments[r];return S.default.postMessage.apply(S.default,[this.worker].concat(t))}},{key:"build",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=t.fade_in,n=void 0===r?!0:r;return this.generation=e,this.fade_in=n,this.loaded||(this.loading=!0,this.built=!1),this.workerMessage("self.buildTile",{tile:this.buildAsMessage()}).catch(function(e){throw e})}},{key:"buildMeshes",value:function(e,t){var r;if(!this.error){this.debug.geometries=0,this.debug.buffer_size=0;var n={},i=[],a=this.mesh_data;if(a)for(var o in a){if(a[o].vertex_data){if(this.debug.buffer_size+=a[o].vertex_data.byteLength,a[o].vertex_elements&&(this.debug.buffer_size+=a[o].vertex_elements.byteLength),!e[o]){y.default("warn","Could not create mesh because style '"+o+"' not found, for tile "+this.key+", aborting tile");break}n[o]=e[o].makeMesh(a[o].vertex_data,a[o].vertex_elements,a[o]),this.debug.geometries+=n[o].geometry_count}a[o].textures&&i.push.apply(i,d.default(a[o].textures))}delete this.mesh_data,t.start&&(this.new_mesh_styles=[],this.previous_textures=[].concat(d.default(this.textures)),this.textures=[]);for(var s in n)this.meshes[s]&&this.meshes[s].destroy(),this.meshes[s]=n[s],this.new_mesh_styles.push(s);if((r=this.textures).push.apply(r,i),t.done){for(var l in this.meshes)-1===this.new_mesh_styles.indexOf(l)&&this.meshes[l].destroy();this.new_mesh_styles=[],this.previous_textures.forEach(function(e){return j.default.release(e)}),this.previous_textures=[],this.debug.geom_ratio=(this.debug.geometries/this.debug.features).toFixed(1),this.printDebug()}}}},{key:"update",value:function(){var t=this.coords;t.z!==this.view.center.tile.z&&(t=e.coordinateAtZoom(t,this.view.center.tile.z)),this.center_dist=Math.abs(this.view.center.tile.x-t.x)+Math.abs(this.view.center.tile.y-t.y)}},{key:"setProxyFor",value:function(e){e?(this.visible=!0,this.proxy_for=this.proxy_for||[],this.proxy_for.push(e),this.proxy_depth=1,e.proxied_as=e.style_zoom>this.style_zoom?"child":"parent",this.update()):(this.proxy_for=null,this.proxy_depth=0)}},{key:"shouldProxyForStyle",value:function(e){return!this.proxy_for||this.proxy_for.some(function(t){return null==t.meshes[e]})}},{key:"setupProgram",value:function(e,t){var r=e.model,n=e.model32;t.uniform("4fv","u_tile_origin",[this.min.x,this.min.y,this.style_zoom,this.coords.z]),t.uniform("1f","u_tile_proxy_depth",this.proxy_depth),M.mat4.identity(r),M.mat4.translate(r,r,M.vec3.fromValues(this.min.x,this.min.y,0)),M.mat4.scale(r,r,M.vec3.fromValues(this.span.x/x.default.tile_scale,-1*this.span.y/x.default.tile_scale,1)),M.mat4.copy(n,r),t.uniform("Matrix4fv","u_model",n),t.uniform("1i","u_fade_in",this.fade_in&&"child"!==this.proxied_as)}},{key:"merge",value:function(e){for(var t in e)"key"!==t&&(this[t]=e[t]);return this}},{key:"printDebug",value:function(){y.default("debug","Tile: debug for "+this.key+": [ "+f.default(this.debug)+" ]")}}],[{key:"create",value:function(t){return new e(t)}},{key:"coord",value:function(t){return{x:t.x,y:t.y,z:t.z,key:e.coordKey(t)}}},{key:"coordKey",value:function(e){var t=e.x,r=e.y,n=e.z;return t+"/"+r+"/"+n}},{key:"key",value:function(t,r,n){return t=e.coordinateWithMaxZoom(t,r.max_zoom),t.y<0||t.y>=1<r?e.coordinateAtZoom({x:n,y:i,z:a},r):e.coord({x:n,y:i,z:a})}},{key:"childrenForCoordinate",value:function(t){var r=t.x,n=t.y,i=t.z,a=t.key;return e.coord_children[a]||(i++,r*=2,n*=2,e.coord_children[a]=[e.coord({x:r,y:n,z:i}),e.coord({x:r+1,y:n,z:i}),e.coord({x:r,y:n+1,z:i}),e.coord({x:r+1,y:n+1,z:i})]),e.coord_children[a]}},{key:"isDescendant",value:function(t,r){if(r.z>t.z){var n=e.coordinateAtZoom(r,t.z),i=n.x,a=n.y;return t.x===i&&t.y===a}return!1}},{key:"sort",value:function(e){return e.sort(function(e,t){var r=e.center_dist,n=t.center_dist;return n>r?-1:n===r?0:1})}},{key:"cancel",value:function(t){t&&(t.canceled=!0,t.source_data&&t.source_data.request&&t.source_data.request.abort(),e.abortBuild(t))}},{key:"buildGeometry",value:function(t,r){var n=r.scene_id,i=r.layers,a=r.styles,o=r.global;t.debug.rendering=+new Date,t.debug.features=0;var s=t.source_data;T.default.startTile(t.key);for(var l in i){var u=i[l];if(u&&u.config.data){if(u.config.data.source===t.source)for(var c=e.getDataForSource(s,u.config.data,l),f=0;f0?!function(){var r={start:!0};t.mesh_data={};var n=function(n){var i=o[n];s.default.all(i.map(function(e){return e.endData(t).then(function(r){r&&(t.mesh_data[e.name]={vertex_data:r.vertex_data,vertex_elements:r.vertex_elements,uniforms:r.uniforms,textures:r.textures})})})).then(function(){y.default("trace","Finished style group '"+n+"' for tile "+t.key),o[n]=[],u.default(o).every(function(e){return 0===o[e].length})&&(r.done=!0),S.default.postMessage("TileManager_"+a+".buildTileStylesCompleted",S.default.withTransferables({tile:e.slice(t,["mesh_data"]),progress:r})),r.start=null,t.mesh_data={},r.done&&T.default.resetTile(t.key)})};for(var i in o)n(i)}():(S.default.postMessage("TileManager_"+a+".buildTileStylesCompleted",S.default.withTransferables({tile:e.slice(t),progress:{start:!0,done:!0}})),T.default.resetTile(t.key))}},{key:"getDataForSource",value:function(e,t){var r=arguments.length<=2||void 0===arguments[2]?null:arguments[2],n=[];return null!=t&&(!t.layer&&e.layers._default?n.push({geom:e.layers._default}):!t.layer&&r?n.push({layer:r,geom:e.layers[r]}):"string"==typeof t.layer?n.push({layer:t.layer,geom:e.layers[t.layer]}):Array.isArray(t.layer)&&t.layer.forEach(function(t){e.layers[t]&&e.layers[t].features&&n.push({layer:t,geom:e.layers[t]})})),n}},{key:"abortBuild",value:function(e){if(e.mesh_data)for(var t in e.mesh_data){var r=e.mesh_data[t].textures;if(r){var n=!0,i=!1,o=void 0;try{for(var s,l=a.default(r);!(n=(s=l.next()).done);n=!0){var u=s.value,c=j.default.textures[u];c&&(y.default("trace","releasing texture "+u+" for tile "+e.key),c.release())}}catch(f){i=!0,o=f}finally{try{!n&&l.return&&l.return()}finally{if(i)throw o}}}}}},{key:"slice",value:function(e,t){var r=["key","loading","loaded","generation","error","debug"];Array.isArray(t)&&r.push.apply(r,d.default(t));var n={},i=!0,o=!1,s=void 0;try{for(var l,u=a.default(r);!(i=(l=u.next()).done);i=!0){var c=l.value;n[c]=e[c]}}catch(f){o=!0,s=f}finally{try{!i&&u.return&&u.return()}finally{if(o)throw s}}return n}}]),e}();r.default=z,z.coord_children={}},{"./geo":299,"./gl/texture":306,"./labels/collision":312,"./styles/style_manager":339,"./styles/style_parser":340,"./utils/gl-matrix":351,"./utils/log":352,"./utils/worker_broker":360,"babel-runtime/core-js/get-iterator":4,"babel-runtime/core-js/json/stringify":6,"babel-runtime/core-js/object/keys":15,"babel-runtime/core-js/promise":17,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22,"babel-runtime/helpers/toConsumableArray":28}],347:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var i=e("babel-runtime/core-js/get-iterator"),a=n(i),o=e("babel-runtime/core-js/object/keys"),s=n(o),l=e("babel-runtime/helpers/classCallCheck"),u=n(l),c=e("babel-runtime/helpers/createClass"),f=n(c),h=e("./tile"),d=n(h),p=e("./tile_pyramid"),m=n(p),_=e("./utils/log"),g=n(_),v=e("./utils/worker_broker"),y=n(v),b=function(){function e(t){var r=t.scene,n=t.view;u.default(this,e),this.scene=r,this.view=n,this.tiles={},this.pyramid=new m.default,this.visible_coords={},this.queued_coords=[],this.building_tiles=null,this.main_thread_target=["TileManager",this.scene.id].join("_"),y.default.addTarget(this.main_thread_target,this)}return f.default(e,[{key:"destroy",value:function(){this.forEachTile(function(e){return e.destroy()}),this.tiles={},this.pyramid=null,this.visible_coords={},this.queued_coords=[],this.scene=null,this.view=null}},{key:"keepTile",value:function(e){this.tiles[e.key]=e,this.pyramid.addTile(e)}},{key:"hasTile",value:function(e){return void 0!==this.tiles[e]}},{key:"forgetTile",value:function(e){if(this.hasTile(e)){var t=this.tiles[e];this.pyramid.removeTile(t)}delete this.tiles[e],this.tileBuildStop(e)}},{key:"removeTile",value:function(e){g.default("trace","tile unload for "+e);var t=this.tiles[e];null!=t&&t.destroy(),this.forgetTile(t.key),this.scene.requestRedraw()}},{key:"forEachTile",value:function(e){for(var t in this.tiles)e(this.tiles[t])}},{key:"removeTiles",value:function(e){var t=[];for(var r in this.tiles){var n=this.tiles[r];e(n)&&t.push(r)}for(var i=0;i0){var n=e.pyramid.getAncestor(r);n&&(n.setProxyFor(r),t=!0)}}else if(-1===e.view.zoom_direction&&r.visible&&!r.built){var i=e.pyramid.getDescendants(r),o=!0,s=!1,l=void 0;try{for(var u,c=a.default(i);!(o=(u=c.next()).done);o=!0){var f=u.value;f.setProxyFor(r),t=!0}}catch(h){s=!0,l=h}finally{try{!o&&c.return&&c.return()}finally{if(s)throw l}}}}),t||(this.view.zoom_direction=0)}}},{key:"updateVisibility",value:function(e){if(e.visible=!1,e.style_zoom===this.view.tile_zoom)if(this.visible_coords[e.coords.key])e.visible=!0;else for(var t in this.visible_coords)if(d.default.isDescendant(e.coords,this.visible_coords[t])){e.visible=!0;break}}},{key:"pruneToVisibleTiles",value:function(){this.removeTiles(function(e){return!e.visible})}},{key:"getRenderableTiles",value:function(){var e=[];for(var t in this.tiles){var r=this.tiles[t];r.visible&&r.loaded&&e.push(r)}return e}},{key:"isLoadingVisibleTiles",value:function(){var e=this;return s.default(this.tiles).some(function(t){return e.tiles[t].visible&&!e.tiles[t].built})}},{key:"queueCoordinate",value:function(e){this.queued_coords[this.queued_coords.length]=e}},{key:"loadQueuedCoordinates",value:function(){var e=this;0!==this.queued_coords.length&&(this.queued_coords.sort(function(t,r){var n=Math.abs(e.view.center.tile.x-t.x)+Math.abs(e.view.center.tile.y-t.y),i=Math.abs(e.view.center.tile.x-r.x)+Math.abs(e.view.center.tile.y-r.y);return i>n?-1:i===n?0:1}),this.queued_coords.forEach(function(t){return e.loadCoordinate(t)}),this.queued_coords=[])}},{key:"loadCoordinate",value:function(e){if(e.z===this.view.center.tile.z)for(var t in this.scene.sources){var r=this.scene.sources[t];if(r.builds_geometry_tiles&&r.includesTile(e,this.view.tile_zoom)){var n=d.default.key(e,r,this.view.tile_zoom);if(n&&!this.hasTile(n)){var i=d.default.create({source:r,coords:e,worker:this.scene.nextWorker(),style_zoom:this.view.styleZoom(e.z),view:this.view});this.keepTile(i),this.buildTile(i)}}}}},{key:"buildTiles",value:function(e){var t=this;d.default.sort(e).forEach(function(e){return t.buildTile(e)}),this.checkBuildQueue()}},{key:"buildTile",value:function(e,t){this.tileBuildStart(e.key),this.updateVisibility(e),e.update(),e.build(this.scene.generation,t)}},{key:"buildTileStylesCompleted",value:function(e){var t=e.tile,r=e.progress;null==this.tiles[t.key]?(g.default("trace","discarded tile "+t.key+" in TileManager.buildTileStylesCompleted because previously removed"),d.default.abortBuild(t),this.updateTileStates()):t.generation!==this.scene.generation?(g.default("debug","discarded tile "+t.key+" in TileManager.buildTileStylesCompleted because built with "+("scene config gen "+t.generation+", current "+this.scene.generation)),d.default.abortBuild(t),this.updateTileStates()):(this.tiles[t.key]&&(t=this.tiles[t.key].merge(t)),r.done&&(t.built=!0),t.buildMeshes(this.scene.styles,r),this.updateTileStates(),this.scene.requestRedraw()),r.done&&this.tileBuildStop(t.key) -}},{key:"buildTileError",value:function(e){g.default("error","Error building tile "+e.key+":",e.error),this.forgetTile(e.key),d.default.abortBuild(e)}},{key:"tileBuildStart",value:function(e){this.building_tiles=this.building_tiles||{},this.building_tiles[e]=!0,g.default("trace","tileBuildStart for "+e+": "+s.default(this.building_tiles).length)}},{key:"tileBuildStop",value:function(e){this.building_tiles&&(g.default("trace","tileBuildStop for "+e+": "+s.default(this.building_tiles).length),delete this.building_tiles[e],this.checkBuildQueue())}},{key:"checkBuildQueue",value:function(){this.building_tiles&&0!==s.default(this.building_tiles).length||(this.building_tiles=null,this.scene.tileManagerBuildDone())}},{key:"getDebugSum",value:function(e,t){var r=0;for(var n in this.tiles)null==this.tiles[n].debug[e]||"function"==typeof t&&t(this.tiles[n])!==!0||(r+=this.tiles[n].debug[e]);return r}},{key:"getDebugAverage",value:function(e,t){return this.getDebugSum(e,t)/s.default(this.tiles).length}}]),e}();r.default=b},{"./tile":346,"./tile_pyramid":348,"./utils/log":352,"./utils/worker_broker":360,"babel-runtime/core-js/get-iterator":4,"babel-runtime/core-js/object/keys":15,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22}],348:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var i=e("babel-runtime/helpers/toConsumableArray"),a=n(i),o=e("babel-runtime/core-js/get-iterator"),s=n(o),l=e("babel-runtime/core-js/map"),u=n(l),c=e("babel-runtime/helpers/classCallCheck"),f=n(c),h=e("babel-runtime/helpers/createClass"),d=n(h),p=e("./geo"),m=n(p),_=e("./tile"),g=n(_),v=function(){function e(){f.default(this,e),this.coords={},this.max_proxy_descendant_depth=3}return d.default(e,[{key:"sourceTiles",value:function(e,t){return this.coords[e.key]&&this.coords[e.key].sources&&this.coords[e.key].sources.get(t.name)}},{key:"addTile",value:function(e){var t=e.coords.key,r=this.coords[t];r||(r=this.coords[t]={descendants:0}),r.sources||(r.sources=new u.default),r.sources.get(e.source.name)||r.sources.set(e.source.name,new u.default),r.sources.get(e.source.name).set(e.style_zoom,e);for(var n=e.coords.z-1;n>=0;n--){var i=g.default.coordinateAtZoom(e.coords,n);this.coords[i.key]||(this.coords[i.key]={descendants:0}),this.coords[i.key].descendants++}}},{key:"removeTile",value:function(e){var t=this.sourceTiles(e.coords,e.source),r=e.coords.key;t&&(t.delete(e.style_zoom),0===t.size&&(this.coords[r].sources.delete(e.source.name),0===this.coords[r].sources.size&&(delete this.coords[r].sources,0===this.coords[r].descendants&&delete this.coords[r])));for(var n=e.coords.z-1;n>=0;n--){var i=g.default.coordinateAtZoom(e.coords,n);this.coords[i.key]&&this.coords[i.key].descendants>0&&(this.coords[i.key].descendants--,0!==this.coords[i.key].descendants||this.coords[i.key].sources||delete this.coords[i.key])}}},{key:"getAncestor",value:function(e){var t=e.coords,r=e.style_zoom,n=e.source;if(r>n.max_zoom){var i=this.sourceTiles(t,n);if(i)for(var a=r-1;a>=n.max_zoom;a--)if(i.has(a)&&i.get(a).loaded)return i.get(a);r=n.max_zoom}r--;var o=g.default.coordinateAtZoom(t,t.z-1),s=this.sourceTiles(o,n);return s&&s.has(r)&&s.get(r).loaded?s.get(r):o.z>0?this.getAncestor({coords:o,style_zoom:r,source:n}):void 0}},{key:"getDescendants",value:function(e){var t=e.coords,r=e.style_zoom,n=e.source,i=arguments.length<=1||void 0===arguments[1]?1:arguments[1],o=[];if(r>=n.max_zoom){var l=this.sourceTiles(t,n);if(l)for(var u=Math.max(m.default.default_view_max_zoom,r+this.max_proxy_descendant_depth),c=r+1;u>=c;c++)if(l.has(c)&&l.get(c).loaded)return o.push(l.get(c)),o;return o}if(this.coords[t.key]&&this.coords[t.key].descendants>0){r++;var f=!0,h=!1,d=void 0;try{for(var p,_=s.default(g.default.childrenForCoordinate(t));!(f=(p=_.next()).done);f=!0){var v=p.value,y=this.sourceTiles(v,n);y&&y.has(r)&&y.get(r).loaded?o.push(y.get(r)):i<=this.max_proxy_descendant_depth&&v.z<=n.max_zoom&&o.push.apply(o,a.default(this.getDescendants({coords:v,source:n,style_zoom:r},i+1)))}}catch(b){h=!0,d=b}finally{try{!f&&_.return&&_.return()}finally{if(h)throw d}}}return o}}]),e}();r.default=v},{"./geo":299,"./tile":346,"babel-runtime/core-js/get-iterator":4,"babel-runtime/core-js/map":7,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22,"babel-runtime/helpers/toConsumableArray":28}],349:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default={draw_label_collision_boxes:!1,draw_label_texture_boxes:!1,suppress_label_fade_in:!1}},{}],350:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0}),r.MethodNotImplemented=void 0;{var i=e("babel-runtime/core-js/object/get-prototype-of"),a=n(i),o=e("babel-runtime/helpers/classCallCheck"),s=n(o),l=e("babel-runtime/helpers/possibleConstructorReturn"),u=n(l),c=e("babel-runtime/helpers/inherits"),f=n(c);r.MethodNotImplemented=function(e){function t(e){s.default(this,t);var r=u.default(this,a.default(t).call(this));return r.name="MethodNotImplemented",r.message="Method "+e+" must be implemented in subclass",r}return f.default(t,e),t}(Error)}},{"babel-runtime/core-js/object/get-prototype-of":14,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/inherits":25,"babel-runtime/helpers/possibleConstructorReturn":26}],351:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0}),r.mat4=r.mat3=r.vec3=void 0;var i=e("gl-mat3/normal-from-mat4"),a=n(i),o=e("gl-mat3/invert"),s=n(o),l=e("gl-mat4/multiply"),u=n(l),c=e("gl-mat4/translate"),f=n(c),h=e("gl-mat4/scale"),d=n(h),p=e("gl-mat4/perspective"),m=n(p),_=e("gl-mat4/lookAt"),g=n(_),v=e("gl-mat4/identity"),y=n(v),b=e("gl-mat4/copy"),x=n(b),w={fromValues:function(e,t,r){var n=new Float64Array(3);return n[0]=e,n[1]=t,n[2]=r,n}},k={normalFromMat4:a.default,invert:s.default},A={multiply:u.default,translate:f.default,scale:d.default,perspective:m.default,lookAt:g.default,identity:y.default,copy:x.default};r.vec3=w,r.mat3=k,r.mat4=A},{"gl-mat3/invert":176,"gl-mat3/normal-from-mat4":177,"gl-mat4/copy":178,"gl-mat4/identity":179,"gl-mat4/lookAt":180,"gl-mat4/multiply":181,"gl-mat4/perspective":182,"gl-mat4/scale":183,"gl-mat4/translate":184}],352:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e){return f.default.is_main?(m[e]=m[e]||(console[e]?console[e]:console.log).bind(console),m[e]):void 0}function a(e){if(p[e]<=p[a.level]){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];if(f.default.is_worker)d.default.postMessage.apply(d.default,["_logProxy",e].concat(r));else{var o=i(e);r.length>1?o.apply(void 0,["Tangram "+u.default+" ["+e+"]: "+r[0]].concat(s.default(r.slice(1)))):o("Tangram "+u.default+" ["+e+"]: "+r[0])}}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("babel-runtime/helpers/toConsumableArray"),s=n(o);r.default=a;var l=e("./version"),u=n(l),c=e("./thread"),f=n(c),h=e("./worker_broker"),d=n(h),p={silent:-1,error:0,warn:1,info:2,debug:3,trace:4},m={};a.level="info",a.workers=null,a.setLevel=function(e){a.level=e,f.default.is_main&&Array.isArray(a.workers)&&d.default.postMessage(a.workers,"_logSetLevelProxy",e)},f.default.is_main&&(a.setWorkers=function(e){a.workers=e}),d.default.addTarget("_logProxy",a),d.default.addTarget("_logSetLevelProxy",a.setLevel)},{"./thread":357,"./version":359,"./worker_broker":360,"babel-runtime/helpers/toConsumableArray":28}],353:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var i=e("babel-runtime/core-js/promise"),a=n(i),o=e("babel-runtime/helpers/classCallCheck"),s=n(o),l=e("babel-runtime/helpers/createClass"),u=n(l),c=e("./log"),f=n(c),h=e("./utils"),d=n(h),p=function(){function e(){s.default(this,e),this.queue_screenshot=null,this.video_capture=null}return u.default(e,[{key:"setCanvas",value:function(e){this.canvas=e}},{key:"screenshot",value:function(){var e=this;return null!=this.queue_screenshot?this.queue_screenshot.promise:(this.queue_screenshot={},this.queue_screenshot.promise=new a.default(function(t,r){e.queue_screenshot.resolve=t,e.queue_screenshot.reject=r}),this.queue_screenshot.promise)}},{key:"completeScreenshot",value:function(){if(null!=this.queue_screenshot){for(var e=this.canvas.toDataURL("image/png"),t=atob(e.slice(22)),r=new Uint8Array(t.length),n=0;n0&&t.chunks.push(r.data),t.resolve){var n=new Blob(t.chunks,{type:t.options.mimeType}),i=d.default.createObjectURL(n),a=t.stream.getTracks();a.forEach(function(e){e.stop(),t.stream.removeTrack(e)}),t.stream=null,t.media_recorder=null,e.video_capture=null,t.resolve({url:i,blob:n,type:"webm"})}},t.media_recorder.start()}()}catch(t){return this.video_capture=null,f.default("error","Scene video capture failed",t),!1}return!0}},{key:"stopVideoCapture",value:function(){var e=this;return this.video_capture?(this.video_capture.promise=new a.default(function(t,r){e.video_capture.resolve=t,e.video_capture.reject=r}),this.video_capture.media_recorder.stop(),this.video_capture.promise):(f.default("warn","No scene video capture in progress, call Scene.startVideoCapture() first"),a.default.resolve({}))}}]),e}();r.default=p},{"./log":352,"./utils":358,"babel-runtime/core-js/promise":17,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22}],354:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];for(var a=0;ar;++r)t[0]=Math.min(this.quad[r][0],t[0]),t[1]=Math.min(this.quad[r][1],t[1]),t[2]=Math.max(this.quad[r][0],t[2]),t[3]=Math.max(this.quad[r][1],t[3]);return t}},{key:"perpAxes",value:function(){this.axes[0]=u.default.normalize(u.default.sub(this.quad[2],this.quad[3])),this.axes[1]=u.default.normalize(u.default.sub(this.quad[2],this.quad[1]))}},{key:"update",value:function(){var e=[Math.cos(this.angle),Math.sin(this.angle)],t=[-Math.sin(this.angle),Math.cos(this.angle)];e=u.default.mult(e,this.dimension[0]/2),t=u.default.mult(t,this.dimension[1]/2),this.quad[0]=u.default.sub(u.default.sub(this.centroid,e),t),this.quad[1]=u.default.sub(u.default.add(this.centroid,e),t),this.quad[2]=u.default.add(u.default.add(this.centroid,e),t),this.quad[3]=u.default.add(u.default.sub(this.centroid,e),t),this.perpAxes()}}],[{key:"projectToAxis",value:function(e,t){for(var r=1e6,n=r,i=-r,a=e.quad,o=0;4>o;++o){var s=u.default.dot(a[o],t);n=Math.min(n,s),i=Math.max(i,s)}return[n,i]}},{key:"axisCollide",value:function(t,r,n){for(var i=0;2>i;++i){var a=e.projectToAxis(t,n[i]),o=e.projectToAxis(r,n[i]);if(o[0]>a[1]||o[1]1?r-1:0),i=1;r>i;i++)n[i-1]=arguments[i];var a=!0,s=!1,l=void 0;try{for(var u,c=o.default(t);!(a=(u=c.next()).done);a=!0){var f=u.value;"function"==typeof f[e]&&f[e].apply(f,n)}}catch(h){s=!0,l=h}finally{try{!a&&c.return&&c.return()}finally{if(s)throw l}}},hasSubscribersFor:function(e){var r=!0,n=!1,i=void 0;try{for(var a,s=o.default(t);!(r=(a=s.next()).done);r=!0){var l=a.value;if("function"==typeof l[e])return!0}}catch(u){n=!0,i=u}finally{try{!r&&s.return&&s.return()}finally{if(n)throw i}}return!1}})}Object.defineProperty(r,"__esModule",{value:!0});var a=e("babel-runtime/core-js/get-iterator"),o=n(a),s=e("babel-runtime/core-js/object/assign"),l=n(s),u=e("babel-runtime/core-js/set"),c=n(u);r.default=i},{"babel-runtime/core-js/get-iterator":4,"babel-runtime/core-js/object/assign":9,"babel-runtime/core-js/set":18}],357:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={};r.default=n;try{window.document!==HTMLDocument&&(n.is_worker=!1,n.is_main=!0)}catch(i){void 0!==self&&(n.is_worker=!0,n.is_main=!1,self.window={document:{}},self.document=self.window.document)}},{}],358:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var i,a=e("babel-runtime/regenerator"),o=n(a),s=e("babel-runtime/core-js/math/log2"),l=n(s),u=e("babel-runtime/core-js/get-iterator"),c=n(u),f=e("babel-runtime/helpers/toConsumableArray"),h=n(f),d=e("babel-runtime/helpers/typeof"),p=n(d),m=e("babel-runtime/core-js/json/stringify"),_=n(m),g=e("babel-runtime/core-js/promise"),v=n(g),y=e("babel-runtime/core-js/object/keys"),b=n(y),x=e("./thread"),w=n(x),k=e("./log"),A=n(k),T=e("../geo"),E=n(T),S=e("js-yaml"),R=n(S);r.default=i={},i.addBaseURL=function(e,t){if(e){if("//"===e.substr(0,2))e=window.location.protocol+e;else if(e.search(/^(http|https|data|blob):/)<0){var r,n="/"!==e[0];if(t?(r=document.createElement("a"),r.href=t):r=window.location,n){var a=i.pathForURL(r.href);e=a+e}else if(r.origin)e=r.origin+"/"+e;else{var o=e.match(/^((http|https|data|blob):\/\/[^\/]*\/)/);o=o&&o.length>1?o[0]:"",e=o+e}}return e}},i.pathForURL=function(e){if("string"==typeof e&&-1===e.search(/^(data|blob):/)){var t=e.indexOf("?");t>-1&&(e=e.substr(0,t));var r=e.indexOf("#");return r>-1&&(e=e.substr(0,r)),e.substr(0,e.lastIndexOf("/")+1)||""}return""},i.isRelativeURL=function(e){return"string"==typeof e?!(e.search(/^(http|https|data|blob):/)>-1||"//"===e.substr(0,2)):void 0},i.flattenRelativeURL=function(e){for(var t=(e||"").split("/"),r=1;r-1?e.substring(t+1):void 0},i.addParamsToURL=function(e,t){if(!t||0===b.default(t).length)return e;var r=e.indexOf("?"),n=e.indexOf("#"),i="";n>-1&&(i=e.slice(n),e=e.slice(0,n)),-1===r&&(r=e.length,e+="?"),r++;var a="";for(var o in t)a+=o+"="+t[o]+"&";return e=e.slice(0,r)+a+e.slice(r)+i},i.isSafari=function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},i._createObjectURL=void 0,i.createObjectURL=function(e){return void 0===i._createObjectURL&&(i._createObjectURL=window.URL&&window.URL.createObjectURL||window.webkitURL&&window.webkitURL.createObjectURL,"function"!=typeof i._createObjectURL&&(i._createObjectURL=null,A.default("warn","window.URL.createObjectURL (or vendor prefix) not found, unable to create local blob URLs"))),i._createObjectURL?i._createObjectURL(e):e},i.io=function(e){var t=arguments.length<=1||void 0===arguments[1]?6e4:arguments[1],r=arguments.length<=2||void 0===arguments[2]?"text":arguments[2],n=arguments.length<=3||void 0===arguments[3]?"GET":arguments[3],i=(arguments.length<=4||void 0===arguments[4]?{}:arguments[4],new XMLHttpRequest),a=new v.default(function(a,o){i.open(n,e,!0),i.timeout=t,i.responseType=r,i.onload=function(){200===i.status?a(["text","json"].indexOf(i.responseType)>-1?i.responseText:i.response):o(Error("Request error with a status of "+i.statusText))},i.onerror=function(e){o(Error("There was a network error"+e.toString()))},i.ontimeout=function(e){o(Error("timeout "+e.toString()))},i.send()});return Object.defineProperty(a,"request",{value:i}),a},i.parseResource=function(e){var t;try{t=R.default.safeLoad(e,{json:!0})}catch(r){throw r}return t},i.loadResource=function(e){return new v.default(function(t,r){"string"==typeof e?i.io(e).then(function(e){try{var n=i.parseResource(e);t(n)}catch(a){r(a)}},r):t(e)})},i.requestAnimationFramePolyfill=function(){"function"!=typeof window.requestAnimationFrame&&(window.requestAnimationFrame=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)})},i.serializeWithFunctions=function(e){var t=_.default(e,function(e,t){return"function"==typeof t?t.toString():t});return t},i.stringsToFunctions=function(e,t){if("string"==typeof e)e=i.stringToFunction(e,t);else if(null!=e&&"object"===("undefined"==typeof e?"undefined":p.default(e)))for(var r in e)e[r]=i.stringsToFunctions(e[r],t);return e},i.stringToFunction=function(e,t){var r="string"==typeof e&&e.match(/^\s*function[^(]*\(([^)]*)\)\s*?\{([\s\S]*)\}$/m);if(r&&r.length>2)try{var n=r[2],i=r[1].length>0&&r[1].split(",").map(function(e){return e.trim()}).filter(function(e){return e});return i=i.length>0?i:["context"],"function"==typeof t?new(Function.prototype.bind.apply(Function,[null].concat(h.default(i),[t(n)]))):new(Function.prototype.bind.apply(Function,[null].concat(h.default(i),[n])))}catch(a){return e}return e},i.use_high_density_display=!0,i.updateDevicePixelRatio=function(){var e=i.device_pixel_ratio;return i.device_pixel_ratio=i.use_high_density_display&&window.devicePixelRatio||1,i.device_pixel_ratio!==e},w.default.is_main&&i.updateDevicePixelRatio(),i.findCurrentURL=function(){for(var e=document.currentScript,t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];if(e)return e.src;if(Array.isArray(r))for(var i=document.getElementsByTagName("script"),a=0;a-1)return i[a].src}}catch(d){s=!0,l=d}finally{try{!o&&f.return&&f.return()}finally{if(s)throw l}}}},i.isPowerOf2=function(e){return 0===(e&e-1)},i.nextPowerOf2=function(e){return Math.pow(2,Math.ceil(l.default(e)))},i.interpolate=function(e,t,r){if(!Array.isArray(t)||!Array.isArray(t[0]))return t;if(t.length<1)return t;var n,i,a,o,s,l;if(e<=t[0][0])o=t[0][1],"function"==typeof r&&(o=r(o));else if(e>=t[t.length-1][0])o=t[t.length-1][1],"function"==typeof r&&(o=r(o));else for(var u=0;u=t[u][0]&&et&&Math.round(255*e)||e}).join(", ")+")"},i.pointInTile=function(e){return e[0]>=0&&e[1]>-E.default.tile_scale&&e[0]r;r++){var i=e.charCodeAt(r);t=(t<<5)-t+i,t|=0}return t},i.debounce=function(e,t,r){var n=void 0;return function(){var i=this,a=arguments,o=function(){n=null,r||e.apply(i,a)},s=r&&!n;clearTimeout(n),n=setTimeout(o,t),s&&e.apply(i,a)}}},{"../geo":299,"./log":352,"./thread":357,"babel-runtime/core-js/get-iterator":4,"babel-runtime/core-js/json/stringify":6,"babel-runtime/core-js/math/log2":8,"babel-runtime/core-js/object/keys":15,"babel-runtime/core-js/promise":17,"babel-runtime/helpers/toConsumableArray":28,"babel-runtime/helpers/typeof":29,"babel-runtime/regenerator":30,"js-yaml":190}],359:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=JSON.parse('{\n "name": "tangram",\n "version": "0.10.3",\n "description": "WebGL Maps for Vector Tiles",\n "repository": {\n "type": "git",\n "url": "git://github.com/tangrams/tangram.git"\n },\n "main": "dist/tangram.min.js",\n "homepage": "https://github.com/tangrams/tangram",\n "keywords": [\n "maps",\n "graphics",\n "rendering",\n "visualization",\n "WebGL",\n "OpenStreetMap"\n ],\n "scripts": {\n "start": "npm run watch",\n "test": "npm run lint && npm run build-test && npm run test-local",\n "test-ci": "npm run lint && npm run build-test && npm run test-remote",\n "test-remote": "./node_modules/karma/bin/karma start --browsers SL_Firefox --single-run",\n "test-local": "./node_modules/karma/bin/karma start --browsers Chrome --single-run",\n "karma-start": "./node_modules/karma/bin/karma start --browsers Chrome --no-watch",\n "karma-run": "./node_modules/karma/bin/karma run --browsers Chrome",\n "lint": "$(npm bin)/jshint src/ && jshint test/",\n "build": "npm run build-bundle -- -o dist/tangram.debug.js && npm run build-minify",\n "build-test": "npm run build-bundle -- -o dist/tangram.test.js",\n "build-debug": "npm run build-bundle -- -o dist/tangram.debug.js",\n "build-bundle": "$(npm bin)/browserify src/module.js -t [ babelify --presets [ es2015 ] --plugins transform-runtime ] -t brfs -s Tangram -p browserify-derequire --debug",\n "build-minify": "$(npm bin)/uglifyjs dist/tangram.debug.js -c warnings=false -m -o dist/tangram.min.js && npm run build-size",\n "build-size": "gzip dist/tangram.min.js -c | wc -c | awk \'{kb=$1/1024; print kb}\' OFMT=\'%.0fk minified+gzipped\'",\n "watch": "$(npm bin)/budo src/module.js:dist/tangram.debug.js --port 8000 --cors --live -- -t [ babelify --presets [ es2015 ] --plugins transform-runtime ] -t brfs -s Tangram"\n },\n "author": {\n "name": "Mapzen",\n "email": "tangram@mapzen.com"\n },\n "contributors": [\n {\n "name": "Brett Camper"\n },\n {\n "name": "Peter Richardson"\n },\n {\n "name": "Patricio Gonzalez Vivo"\n },\n {\n "name": "Karim Naaji"\n },\n {\n "name": "Ivan Willig"\n },\n {\n "name": "Lou Huang"\n },\n {\n "name": "David Valdman"\n }\n ],\n "license": "MIT",\n "dependencies": {\n "babel-runtime": "6.11.6",\n "box-intersect": "1.0.0",\n "brfs": "1.4.3",\n "csscolorparser": "1.0.3",\n "earcut": "2.1.1",\n "fontfaceobserver": "1.7.1",\n "geojson-vt": "2.1.6",\n "gl-mat3": "1.0.0",\n "gl-mat4": "1.1.4",\n "gl-shader-errors": "1.0.3",\n "js-yaml": "tangrams/js-yaml#read-only",\n "jszip": "tangrams/jszip#read-only",\n "match-feature": "tangrams/match-feature#v1.3.1",\n "pbf": "1.3.2",\n "strip-comments": "0.3.2",\n "topojson": "1.6.19",\n "vector-tile": "1.1.2"\n },\n "devDependencies": {\n "babelify": "7.3.0",\n "babel-plugin-transform-runtime": "6.12.0",\n "babel-preset-es2015": "6.13.2",\n "browserify": "13.0.1",\n "browserify-derequire": "0.9.4",\n "budo": "8.2.1",\n "chai": "1.9.2",\n "chai-as-promised": "4.1.1",\n "glob": "4.0.6",\n "jshint": "jshint/jshint#3a8efa979dbb157bfb5c10b5826603a55a33b9ad",\n "karma": "0.12.23",\n "karma-browserify": "5.1.0",\n "karma-chrome-launcher": "0.1.4",\n "karma-mocha": "0.1.9",\n "karma-mocha-reporter": "1.0.0",\n "karma-sauce-launcher": "tangrams/karma-sauce-launcher#firefox-profiles",\n "karma-sinon": "1.0.4",\n "mocha": "1.21.4",\n "sinon": "1.10.3",\n "uglify-js": "2.4.14",\n "yargs": "1.3.2"\n }\n}\n'),i=void 0;r.default=i="v"+n.version},{}],360:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e){var t=[];"string"==typeof e&&(t=e.split("."),e=t.pop());for(var r=M,n=0;n2?r-2:0),i=2;r>i;i++)n[i-2]=arguments[i];if(Array.isArray(e))return x.default.all(e.map(function(e){var r;return(r=f).postMessage.apply(r,[e,t].concat(y.default(n)))}));var a=new x.default(function(e,r){j[R]={method:t,message:n,resolve:e,reject:r}}),o=void 0,s=[];return n&&1===n.length&&n[0]instanceof f.withTransferables&&(s=n[0].transferables,n=n[0].value),o={type:"main_send",message_id:R,method:t,message:n},o=u(o,s),e.postMessage(o,s.map(function(e){return e.object})),l(s),s.length>0&&S.default("trace","'"+t+"' transferred "+s.length+" objects to worker thread"),R++,a},f.addWorker=function(r){if(!(r instanceof Worker))throw Error("Worker broker could not add non-Worker object",r);t.set(r,e++),r.addEventListener("message",function(e){var t=c(e.data),n=t.message_id;if("worker_reply"===t.type)j[n]&&(t.error?j[n].reject(t.error):j[n].resolve(t.message),delete j[n]);else if("worker_send"===t.type&&null!=n){var a,o,s,h,d;!function(){var e=i(t.method),c=g.default(e,2);if(a=c[0],o=c[1],!o)throw Error("Worker broker could not dispatch message type "+t.method+" on target "+t.target+" because no object with that name is registered on main thread");if(s="function"==typeof o[a]&&o[a],!s)throw Error("Worker broker could not dispatch message type "+t.method+" on target "+t.target+" because object has no method with that name");try{h=s.apply(o,t.message)}catch(p){d=p}var m=void 0,_=[];h instanceof x.default?h.then(function(e){e instanceof f.withTransferables&&(_=e.transferables,e=e.value),m={type:"main_reply",message_id:n,message:e},m=u(m,_),r.postMessage(m,_.map(function(e){return e.object})),l(_),_.length>0&&S.default("trace","'"+a+"' transferred "+_.length+" objects to worker thread")},function(e){r.postMessage({type:"main_reply",message_id:n,error:e instanceof Error?e.message+": "+e.stack:e})}):(h instanceof f.withTransferables&&(_=h.transferables,h=h.value),m={type:"main_reply",message_id:n,message:h,error:d instanceof Error?d.message+": "+d.stack:d},m=u(m,_),r.postMessage(m,_.map(function(e){return e.object})),l(_),_.length>0&&S.default("trace","'"+a+"' transferred "+_.length+" objects to worker thread"))}()}})},f.removeWorker=function(e){if(!t.has(e))throw Error("Worker broker could not remove unregistered object",e);t.delete(e)},f.getMessages=function(){return j},f.getMessageId=function(){return R}}function o(){f.postMessage=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];var i=new x.default(function(t,n){j[R]={method:e,message:r,resolve:t,reject:n}}),a=void 0,o=[];return r&&1===r.length&&r[0]instanceof f.withTransferables&&(o=r[0].transferables,r=r[0].value),a={type:"worker_send",message_id:R,method:e,message:r},a=u(a,o),self.postMessage(a,o.map(function(e){return e.object})),l(o),o.length>0&&S.default("trace","'"+e+"' transferred "+o.length+" objects to main thread"),R++,i},self.addEventListener("message",function(e){var t=c(e.data),r=t.message_id;if("main_reply"===t.type)j[r]&&(t.error?j[r].reject(t.error):j[r].resolve(t.message),delete j[r]);else if("main_send"===t.type&&null!=r){var n,a,o,s,h;!function(){var e=i(t.method),c=g.default(e,2);if(n=c[0],a=c[1],!a)throw Error("Worker broker could not dispatch message type "+t.method+" on target "+t.target+" because no object with that name is registered on main thread");if(o="function"==typeof a[n]&&a[n],!o)throw Error("Worker broker could not dispatch message type "+t.method+" because worker has no method with that name");try{s=o.apply(a,t.message)}catch(d){h=d}var p=void 0,m=[];s instanceof x.default?s.then(function(e){e instanceof f.withTransferables&&(m=e.transferables,e=e.value),p={type:"worker_reply",message_id:r,message:e},p=u(p,m),self.postMessage(p,m.map(function(e){return e.object})),l(m),m.length>0&&S.default("trace","'"+n+"' transferred "+m.length+" objects to main thread") +}},{key:"buildTileError",value:function(e){g.default("error","Error building tile "+e.key+":",e.error),this.forgetTile(e.key),d.default.abortBuild(e)}},{key:"tileBuildStart",value:function(e){this.building_tiles=this.building_tiles||{},this.building_tiles[e]=!0,g.default("trace","tileBuildStart for "+e+": "+s.default(this.building_tiles).length)}},{key:"tileBuildStop",value:function(e){this.building_tiles&&(g.default("trace","tileBuildStop for "+e+": "+s.default(this.building_tiles).length),delete this.building_tiles[e],this.checkBuildQueue())}},{key:"checkBuildQueue",value:function(){this.building_tiles&&0!==s.default(this.building_tiles).length||(this.building_tiles=null,this.scene.tileManagerBuildDone())}},{key:"getDebugSum",value:function(e,t){var r=0;for(var n in this.tiles)null==this.tiles[n].debug[e]||"function"==typeof t&&t(this.tiles[n])!==!0||(r+=this.tiles[n].debug[e]);return r}},{key:"getDebugAverage",value:function(e,t){return this.getDebugSum(e,t)/s.default(this.tiles).length}}]),e}();r.default=b},{"./tile":346,"./tile_pyramid":348,"./utils/log":352,"./utils/worker_broker":360,"babel-runtime/core-js/get-iterator":4,"babel-runtime/core-js/object/keys":15,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22}],348:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var i=e("babel-runtime/helpers/toConsumableArray"),a=n(i),o=e("babel-runtime/core-js/get-iterator"),s=n(o),l=e("babel-runtime/core-js/map"),u=n(l),c=e("babel-runtime/helpers/classCallCheck"),f=n(c),h=e("babel-runtime/helpers/createClass"),d=n(h),p=e("./geo"),m=n(p),_=e("./tile"),g=n(_),v=function(){function e(){f.default(this,e),this.coords={},this.max_proxy_descendant_depth=3}return d.default(e,[{key:"sourceTiles",value:function(e,t){return this.coords[e.key]&&this.coords[e.key].sources&&this.coords[e.key].sources.get(t.name)}},{key:"addTile",value:function(e){var t=e.coords.key,r=this.coords[t];r||(r=this.coords[t]={descendants:0}),r.sources||(r.sources=new u.default),r.sources.get(e.source.name)||r.sources.set(e.source.name,new u.default),r.sources.get(e.source.name).set(e.style_zoom,e);for(var n=e.coords.z-1;n>=0;n--){var i=g.default.coordinateAtZoom(e.coords,n);this.coords[i.key]||(this.coords[i.key]={descendants:0}),this.coords[i.key].descendants++}}},{key:"removeTile",value:function(e){var t=this.sourceTiles(e.coords,e.source),r=e.coords.key;t&&(t.delete(e.style_zoom),0===t.size&&(this.coords[r].sources.delete(e.source.name),0===this.coords[r].sources.size&&(delete this.coords[r].sources,0===this.coords[r].descendants&&delete this.coords[r])));for(var n=e.coords.z-1;n>=0;n--){var i=g.default.coordinateAtZoom(e.coords,n);this.coords[i.key]&&this.coords[i.key].descendants>0&&(this.coords[i.key].descendants--,0!==this.coords[i.key].descendants||this.coords[i.key].sources||delete this.coords[i.key])}}},{key:"getAncestor",value:function(e){var t=e.coords,r=e.style_zoom,n=e.source;if(r>n.max_zoom){var i=this.sourceTiles(t,n);if(i)for(var a=r-1;a>=n.max_zoom;a--)if(i.has(a)&&i.get(a).loaded)return i.get(a);r=n.max_zoom}r--;var o=g.default.coordinateAtZoom(t,t.z-1),s=this.sourceTiles(o,n);return s&&s.has(r)&&s.get(r).loaded?s.get(r):o.z>0?this.getAncestor({coords:o,style_zoom:r,source:n}):void 0}},{key:"getDescendants",value:function(e){var t=e.coords,r=e.style_zoom,n=e.source,i=arguments.length<=1||void 0===arguments[1]?1:arguments[1],o=[];if(r>=n.max_zoom){var l=this.sourceTiles(t,n);if(l)for(var u=Math.max(m.default.default_view_max_zoom,r+this.max_proxy_descendant_depth),c=r+1;u>=c;c++)if(l.has(c)&&l.get(c).loaded)return o.push(l.get(c)),o;return o}if(this.coords[t.key]&&this.coords[t.key].descendants>0){r++;var f=!0,h=!1,d=void 0;try{for(var p,_=s.default(g.default.childrenForCoordinate(t));!(f=(p=_.next()).done);f=!0){var v=p.value,y=this.sourceTiles(v,n);y&&y.has(r)&&y.get(r).loaded?o.push(y.get(r)):i<=this.max_proxy_descendant_depth&&v.z<=n.max_zoom&&o.push.apply(o,a.default(this.getDescendants({coords:v,source:n,style_zoom:r},i+1)))}}catch(b){h=!0,d=b}finally{try{!f&&_.return&&_.return()}finally{if(h)throw d}}}return o}}]),e}();r.default=v},{"./geo":299,"./tile":346,"babel-runtime/core-js/get-iterator":4,"babel-runtime/core-js/map":7,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22,"babel-runtime/helpers/toConsumableArray":28}],349:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default={draw_label_collision_boxes:!1,draw_label_texture_boxes:!1,suppress_label_fade_in:!1}},{}],350:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0}),r.MethodNotImplemented=void 0;{var i=e("babel-runtime/core-js/object/get-prototype-of"),a=n(i),o=e("babel-runtime/helpers/classCallCheck"),s=n(o),l=e("babel-runtime/helpers/possibleConstructorReturn"),u=n(l),c=e("babel-runtime/helpers/inherits"),f=n(c);r.MethodNotImplemented=function(e){function t(e){s.default(this,t);var r=u.default(this,a.default(t).call(this));return r.name="MethodNotImplemented",r.message="Method "+e+" must be implemented in subclass",r}return f.default(t,e),t}(Error)}},{"babel-runtime/core-js/object/get-prototype-of":14,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/inherits":25,"babel-runtime/helpers/possibleConstructorReturn":26}],351:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0}),r.mat4=r.mat3=r.vec3=void 0;var i=e("gl-mat3/normal-from-mat4"),a=n(i),o=e("gl-mat3/invert"),s=n(o),l=e("gl-mat4/multiply"),u=n(l),c=e("gl-mat4/translate"),f=n(c),h=e("gl-mat4/scale"),d=n(h),p=e("gl-mat4/perspective"),m=n(p),_=e("gl-mat4/lookAt"),g=n(_),v=e("gl-mat4/identity"),y=n(v),b=e("gl-mat4/copy"),x=n(b),w={fromValues:function(e,t,r){var n=new Float64Array(3);return n[0]=e,n[1]=t,n[2]=r,n}},k={normalFromMat4:a.default,invert:s.default},A={multiply:u.default,translate:f.default,scale:d.default,perspective:m.default,lookAt:g.default,identity:y.default,copy:x.default};r.vec3=w,r.mat3=k,r.mat4=A},{"gl-mat3/invert":176,"gl-mat3/normal-from-mat4":177,"gl-mat4/copy":178,"gl-mat4/identity":179,"gl-mat4/lookAt":180,"gl-mat4/multiply":181,"gl-mat4/perspective":182,"gl-mat4/scale":183,"gl-mat4/translate":184}],352:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e){return f.default.is_main?(m[e]=m[e]||(console[e]?console[e]:console.log).bind(console),m[e]):void 0}function a(e){if(p[e]<=p[a.level]){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];if(f.default.is_worker)d.default.postMessage.apply(d.default,["_logProxy",e].concat(r));else{var o=i(e);r.length>1?o.apply(void 0,["Tangram "+u.default+" ["+e+"]: "+r[0]].concat(s.default(r.slice(1)))):o("Tangram "+u.default+" ["+e+"]: "+r[0])}}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("babel-runtime/helpers/toConsumableArray"),s=n(o);r.default=a;var l=e("./version"),u=n(l),c=e("./thread"),f=n(c),h=e("./worker_broker"),d=n(h),p={silent:-1,error:0,warn:1,info:2,debug:3,trace:4},m={};a.level="info",a.workers=null,a.setLevel=function(e){a.level=e,f.default.is_main&&Array.isArray(a.workers)&&d.default.postMessage(a.workers,"_logSetLevelProxy",e)},f.default.is_main&&(a.setWorkers=function(e){a.workers=e}),d.default.addTarget("_logProxy",a),d.default.addTarget("_logSetLevelProxy",a.setLevel)},{"./thread":357,"./version":359,"./worker_broker":360,"babel-runtime/helpers/toConsumableArray":28}],353:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var i=e("babel-runtime/core-js/promise"),a=n(i),o=e("babel-runtime/helpers/classCallCheck"),s=n(o),l=e("babel-runtime/helpers/createClass"),u=n(l),c=e("./log"),f=n(c),h=e("./utils"),d=n(h),p=function(){function e(){s.default(this,e),this.queue_screenshot=null,this.video_capture=null}return u.default(e,[{key:"setCanvas",value:function(e){this.canvas=e}},{key:"screenshot",value:function(){var e=this;return null!=this.queue_screenshot?this.queue_screenshot.promise:(this.queue_screenshot={},this.queue_screenshot.promise=new a.default(function(t,r){e.queue_screenshot.resolve=t,e.queue_screenshot.reject=r}),this.queue_screenshot.promise)}},{key:"completeScreenshot",value:function(){if(null!=this.queue_screenshot){for(var e=this.canvas.toDataURL("image/png"),t=atob(e.slice(22)),r=new Uint8Array(t.length),n=0;n0&&t.chunks.push(r.data),t.resolve){var n=new Blob(t.chunks,{type:t.options.mimeType}),i=d.default.createObjectURL(n);if(t.stream){var a=t.stream.getTracks()||[];a.forEach(function(e){e.stop(),t.stream.removeTrack(e)})}t.stream=null,t.media_recorder=null,e.video_capture=null,t.resolve({url:i,blob:n,type:"webm"})}},t.media_recorder.start()}()}catch(t){return this.video_capture=null,f.default("error","Scene video capture failed",t),!1}return!0}},{key:"stopVideoCapture",value:function(){var e=this;return this.video_capture?(this.video_capture.promise=new a.default(function(t,r){e.video_capture.resolve=t,e.video_capture.reject=r}),this.video_capture.media_recorder.stop(),this.video_capture.promise):(f.default("warn","No scene video capture in progress, call Scene.startVideoCapture() first"),a.default.resolve({}))}}]),e}();r.default=p},{"./log":352,"./utils":358,"babel-runtime/core-js/promise":17,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22}],354:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];for(var a=0;ar;++r)t[0]=Math.min(this.quad[r][0],t[0]),t[1]=Math.min(this.quad[r][1],t[1]),t[2]=Math.max(this.quad[r][0],t[2]),t[3]=Math.max(this.quad[r][1],t[3]);return t}},{key:"perpAxes",value:function(){this.axes[0]=u.default.normalize(u.default.sub(this.quad[2],this.quad[3])),this.axes[1]=u.default.normalize(u.default.sub(this.quad[2],this.quad[1]))}},{key:"update",value:function(){var e=[Math.cos(this.angle),Math.sin(this.angle)],t=[-Math.sin(this.angle),Math.cos(this.angle)];e=u.default.mult(e,this.dimension[0]/2),t=u.default.mult(t,this.dimension[1]/2),this.quad[0]=u.default.sub(u.default.sub(this.centroid,e),t),this.quad[1]=u.default.sub(u.default.add(this.centroid,e),t),this.quad[2]=u.default.add(u.default.add(this.centroid,e),t),this.quad[3]=u.default.add(u.default.sub(this.centroid,e),t),this.perpAxes()}}],[{key:"projectToAxis",value:function(e,t){for(var r=1e6,n=r,i=-r,a=e.quad,o=0;4>o;++o){var s=u.default.dot(a[o],t);n=Math.min(n,s),i=Math.max(i,s)}return[n,i]}},{key:"axisCollide",value:function(t,r,n){for(var i=0;2>i;++i){var a=e.projectToAxis(t,n[i]),o=e.projectToAxis(r,n[i]);if(o[0]>a[1]||o[1]1?r-1:0),i=1;r>i;i++)n[i-1]=arguments[i];var a=!0,s=!1,l=void 0;try{for(var u,c=o.default(t);!(a=(u=c.next()).done);a=!0){var f=u.value;"function"==typeof f[e]&&f[e].apply(f,n)}}catch(h){s=!0,l=h}finally{try{!a&&c.return&&c.return()}finally{if(s)throw l}}},hasSubscribersFor:function(e){var r=!0,n=!1,i=void 0;try{for(var a,s=o.default(t);!(r=(a=s.next()).done);r=!0){var l=a.value;if("function"==typeof l[e])return!0}}catch(u){n=!0,i=u}finally{try{!r&&s.return&&s.return()}finally{if(n)throw i}}return!1}})}Object.defineProperty(r,"__esModule",{value:!0});var a=e("babel-runtime/core-js/get-iterator"),o=n(a),s=e("babel-runtime/core-js/object/assign"),l=n(s),u=e("babel-runtime/core-js/set"),c=n(u);r.default=i},{"babel-runtime/core-js/get-iterator":4,"babel-runtime/core-js/object/assign":9,"babel-runtime/core-js/set":18}],357:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={};r.default=n;try{window.document!==HTMLDocument&&(n.is_worker=!1,n.is_main=!0)}catch(i){void 0!==self&&(n.is_worker=!0,n.is_main=!1,self.window={document:{}},self.document=self.window.document)}},{}],358:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var i,a=e("babel-runtime/regenerator"),o=n(a),s=e("babel-runtime/core-js/math/log2"),l=n(s),u=e("babel-runtime/core-js/get-iterator"),c=n(u),f=e("babel-runtime/helpers/toConsumableArray"),h=n(f),d=e("babel-runtime/helpers/typeof"),p=n(d),m=e("babel-runtime/core-js/json/stringify"),_=n(m),g=e("babel-runtime/core-js/promise"),v=n(g),y=e("babel-runtime/core-js/object/keys"),b=n(y),x=e("./thread"),w=n(x),k=e("./log"),A=n(k),T=e("../geo"),E=n(T),S=e("js-yaml"),R=n(S);r.default=i={},i.addBaseURL=function(e,t){if(e){if("//"===e.substr(0,2))e=window.location.protocol+e;else if(e.search(/^(http|https|data|blob):/)<0){var r,n="/"!==e[0];if(t?(r=document.createElement("a"),r.href=t):r=window.location,n){var a=i.pathForURL(r.href);e=a+e}else if(r.origin)e=r.origin+"/"+e;else{var o=e.match(/^((http|https|data|blob):\/\/[^\/]*\/)/);o=o&&o.length>1?o[0]:"",e=o+e}}return e}},i.pathForURL=function(e){if("string"==typeof e&&-1===e.search(/^(data|blob):/)){var t=e.indexOf("?");t>-1&&(e=e.substr(0,t));var r=e.indexOf("#");return r>-1&&(e=e.substr(0,r)),e.substr(0,e.lastIndexOf("/")+1)||""}return""},i.isRelativeURL=function(e){return"string"==typeof e?!(e.search(/^(http|https|data|blob):/)>-1||"//"===e.substr(0,2)):void 0},i.flattenRelativeURL=function(e){for(var t=(e||"").split("/"),r=1;r-1?e.substring(t+1):void 0},i.addParamsToURL=function(e,t){if(!t||0===b.default(t).length)return e;var r=e.indexOf("?"),n=e.indexOf("#"),i="";n>-1&&(i=e.slice(n),e=e.slice(0,n)),-1===r&&(r=e.length,e+="?"),r++;var a="";for(var o in t)a+=o+"="+t[o]+"&";return e=e.slice(0,r)+a+e.slice(r)+i},i.isSafari=function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},i._createObjectURL=void 0,i.createObjectURL=function(e){return void 0===i._createObjectURL&&(i._createObjectURL=window.URL&&window.URL.createObjectURL||window.webkitURL&&window.webkitURL.createObjectURL,"function"!=typeof i._createObjectURL&&(i._createObjectURL=null,A.default("warn","window.URL.createObjectURL (or vendor prefix) not found, unable to create local blob URLs"))),i._createObjectURL?i._createObjectURL(e):e},i.io=function(e){var t=arguments.length<=1||void 0===arguments[1]?6e4:arguments[1],r=arguments.length<=2||void 0===arguments[2]?"text":arguments[2],n=arguments.length<=3||void 0===arguments[3]?"GET":arguments[3],i=(arguments.length<=4||void 0===arguments[4]?{}:arguments[4],new XMLHttpRequest),a=new v.default(function(a,o){i.open(n,e,!0),i.timeout=t,i.responseType=r,i.onload=function(){200===i.status?a(["text","json"].indexOf(i.responseType)>-1?i.responseText:i.response):o(Error("Request error with a status of "+i.statusText))},i.onerror=function(e){o(Error("There was a network error"+e.toString()))},i.ontimeout=function(e){o(Error("timeout "+e.toString()))},i.send()});return Object.defineProperty(a,"request",{value:i}),a},i.parseResource=function(e){var t;try{t=R.default.safeLoad(e,{json:!0})}catch(r){throw r}return t},i.loadResource=function(e){return new v.default(function(t,r){"string"==typeof e?i.io(e).then(function(e){try{var n=i.parseResource(e);t(n)}catch(a){r(a)}},r):t(e)})},i.requestAnimationFramePolyfill=function(){"function"!=typeof window.requestAnimationFrame&&(window.requestAnimationFrame=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)})},i.serializeWithFunctions=function(e){var t=_.default(e,function(e,t){return"function"==typeof t?t.toString():t});return t},i.stringsToFunctions=function(e,t){if("string"==typeof e)e=i.stringToFunction(e,t);else if(null!=e&&"object"===("undefined"==typeof e?"undefined":p.default(e)))for(var r in e)e[r]=i.stringsToFunctions(e[r],t);return e},i.stringToFunction=function(e,t){var r="string"==typeof e&&e.match(/^\s*function[^(]*\(([^)]*)\)\s*?\{([\s\S]*)\}$/m);if(r&&r.length>2)try{var n=r[2],i=r[1].length>0&&r[1].split(",").map(function(e){return e.trim()}).filter(function(e){return e});return i=i.length>0?i:["context"],"function"==typeof t?new(Function.prototype.bind.apply(Function,[null].concat(h.default(i),[t(n)]))):new(Function.prototype.bind.apply(Function,[null].concat(h.default(i),[n])))}catch(a){return e}return e},i.use_high_density_display=!0,i.updateDevicePixelRatio=function(){var e=i.device_pixel_ratio;return i.device_pixel_ratio=i.use_high_density_display&&window.devicePixelRatio||1,i.device_pixel_ratio!==e},w.default.is_main&&i.updateDevicePixelRatio(),i.findCurrentURL=function(){for(var e=document.currentScript,t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];if(e)return e.src;if(Array.isArray(r))for(var i=document.getElementsByTagName("script"),a=0;a-1)return i[a].src}}catch(d){s=!0,l=d}finally{try{!o&&f.return&&f.return()}finally{if(s)throw l}}}},i.isPowerOf2=function(e){return 0===(e&e-1)},i.nextPowerOf2=function(e){return Math.pow(2,Math.ceil(l.default(e)))},i.interpolate=function(e,t,r){if(!Array.isArray(t)||!Array.isArray(t[0]))return t;if(t.length<1)return t;var n,i,a,o,s,l;if(e<=t[0][0])o=t[0][1],"function"==typeof r&&(o=r(o));else if(e>=t[t.length-1][0])o=t[t.length-1][1],"function"==typeof r&&(o=r(o));else for(var u=0;u=t[u][0]&&et&&Math.round(255*e)||e}).join(", ")+")"},i.pointInTile=function(e){return e[0]>=0&&e[1]>-E.default.tile_scale&&e[0]r;r++){var i=e.charCodeAt(r);t=(t<<5)-t+i,t|=0}return t},i.debounce=function(e,t,r){var n=void 0;return function(){var i=this,a=arguments,o=function(){n=null,r||e.apply(i,a)},s=r&&!n;clearTimeout(n),n=setTimeout(o,t),s&&e.apply(i,a)}}},{"../geo":299,"./log":352,"./thread":357,"babel-runtime/core-js/get-iterator":4,"babel-runtime/core-js/json/stringify":6,"babel-runtime/core-js/math/log2":8,"babel-runtime/core-js/object/keys":15,"babel-runtime/core-js/promise":17,"babel-runtime/helpers/toConsumableArray":28,"babel-runtime/helpers/typeof":29,"babel-runtime/regenerator":30,"js-yaml":190}],359:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=JSON.parse('{\n "name": "tangram",\n "version": "0.10.4",\n "description": "WebGL Maps for Vector Tiles",\n "repository": {\n "type": "git",\n "url": "git://github.com/tangrams/tangram.git"\n },\n "main": "dist/tangram.min.js",\n "homepage": "https://github.com/tangrams/tangram",\n "keywords": [\n "maps",\n "graphics",\n "rendering",\n "visualization",\n "WebGL",\n "OpenStreetMap"\n ],\n "scripts": {\n "start": "npm run watch",\n "test": "npm run lint && npm run build-test && npm run test-local",\n "test-ci": "npm run lint && npm run build-test && npm run test-remote",\n "test-remote": "./node_modules/karma/bin/karma start --browsers SL_Firefox --single-run",\n "test-local": "./node_modules/karma/bin/karma start --browsers Chrome --single-run",\n "karma-start": "./node_modules/karma/bin/karma start --browsers Chrome --no-watch",\n "karma-run": "./node_modules/karma/bin/karma run --browsers Chrome",\n "lint": "$(npm bin)/jshint src/ && jshint test/",\n "build": "npm run build-bundle -- -o dist/tangram.debug.js && npm run build-minify",\n "build-test": "npm run build-bundle -- -o dist/tangram.test.js",\n "build-debug": "npm run build-bundle -- -o dist/tangram.debug.js",\n "build-bundle": "$(npm bin)/browserify src/module.js -t [ babelify --presets [ es2015 ] --plugins transform-runtime ] -t brfs -s Tangram -p browserify-derequire --debug",\n "build-minify": "$(npm bin)/uglifyjs dist/tangram.debug.js -c warnings=false -m -o dist/tangram.min.js && npm run build-size",\n "build-size": "gzip dist/tangram.min.js -c | wc -c | awk \'{kb=$1/1024; print kb}\' OFMT=\'%.0fk minified+gzipped\'",\n "watch": "$(npm bin)/budo src/module.js:dist/tangram.debug.js --port 8000 --cors --live -- -t [ babelify --presets [ es2015 ] --plugins transform-runtime ] -t brfs -s Tangram"\n },\n "author": {\n "name": "Mapzen",\n "email": "tangram@mapzen.com"\n },\n "contributors": [\n {\n "name": "Brett Camper"\n },\n {\n "name": "Peter Richardson"\n },\n {\n "name": "Patricio Gonzalez Vivo"\n },\n {\n "name": "Karim Naaji"\n },\n {\n "name": "Ivan Willig"\n },\n {\n "name": "Lou Huang"\n },\n {\n "name": "David Valdman"\n }\n ],\n "license": "MIT",\n "dependencies": {\n "babel-runtime": "6.11.6",\n "box-intersect": "1.0.0",\n "brfs": "1.4.3",\n "csscolorparser": "1.0.3",\n "earcut": "2.1.1",\n "fontfaceobserver": "1.7.1",\n "geojson-vt": "2.1.6",\n "gl-mat3": "1.0.0",\n "gl-mat4": "1.1.4",\n "gl-shader-errors": "1.0.3",\n "js-yaml": "tangrams/js-yaml#read-only",\n "jszip": "tangrams/jszip#read-only",\n "match-feature": "tangrams/match-feature#v1.3.1",\n "pbf": "1.3.2",\n "strip-comments": "0.3.2",\n "topojson": "1.6.19",\n "vector-tile": "1.1.2"\n },\n "devDependencies": {\n "babelify": "7.3.0",\n "babel-plugin-transform-runtime": "6.12.0",\n "babel-preset-es2015": "6.13.2",\n "browserify": "13.0.1",\n "browserify-derequire": "0.9.4",\n "budo": "8.2.1",\n "chai": "1.9.2",\n "chai-as-promised": "4.1.1",\n "glob": "4.0.6",\n "jshint": "jshint/jshint#3a8efa979dbb157bfb5c10b5826603a55a33b9ad",\n "karma": "0.12.23",\n "karma-browserify": "5.1.0",\n "karma-chrome-launcher": "0.1.4",\n "karma-mocha": "0.1.9",\n "karma-mocha-reporter": "1.0.0",\n "karma-sauce-launcher": "tangrams/karma-sauce-launcher#firefox-profiles",\n "karma-sinon": "1.0.4",\n "mocha": "1.21.4",\n "sinon": "1.10.3",\n "uglify-js": "2.4.14",\n "yargs": "1.3.2"\n }\n}\n'),i=void 0;r.default=i="v"+n.version},{}],360:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e){var t=[];"string"==typeof e&&(t=e.split("."),e=t.pop());for(var r=M,n=0;n2?r-2:0),i=2;r>i;i++)n[i-2]=arguments[i];if(Array.isArray(e))return x.default.all(e.map(function(e){var r;return(r=f).postMessage.apply(r,[e,t].concat(y.default(n)))}));var a=new x.default(function(e,r){j[R]={method:t,message:n,resolve:e,reject:r}}),o=void 0,s=[];return n&&1===n.length&&n[0]instanceof f.withTransferables&&(s=n[0].transferables,n=n[0].value),o={type:"main_send",message_id:R,method:t,message:n},o=u(o,s),e.postMessage(o,s.map(function(e){return e.object})),l(s),s.length>0&&S.default("trace","'"+t+"' transferred "+s.length+" objects to worker thread"),R++,a},f.addWorker=function(r){if(!(r instanceof Worker))throw Error("Worker broker could not add non-Worker object",r);t.set(r,e++),r.addEventListener("message",function(e){var t=c(e.data),n=t.message_id;if("worker_reply"===t.type)j[n]&&(t.error?j[n].reject(t.error):j[n].resolve(t.message),delete j[n]);else if("worker_send"===t.type&&null!=n){var a,o,s,h,d;!function(){var e=i(t.method),c=g.default(e,2);if(a=c[0],o=c[1],!o)throw Error("Worker broker could not dispatch message type "+t.method+" on target "+t.target+" because no object with that name is registered on main thread");if(s="function"==typeof o[a]&&o[a],!s)throw Error("Worker broker could not dispatch message type "+t.method+" on target "+t.target+" because object has no method with that name");try{h=s.apply(o,t.message)}catch(p){d=p}var m=void 0,_=[];h instanceof x.default?h.then(function(e){e instanceof f.withTransferables&&(_=e.transferables,e=e.value),m={type:"main_reply",message_id:n,message:e},m=u(m,_),r.postMessage(m,_.map(function(e){return e.object})),l(_),_.length>0&&S.default("trace","'"+a+"' transferred "+_.length+" objects to worker thread")},function(e){r.postMessage({type:"main_reply",message_id:n,error:e instanceof Error?e.message+": "+e.stack:e})}):(h instanceof f.withTransferables&&(_=h.transferables,h=h.value),m={type:"main_reply",message_id:n,message:h,error:d instanceof Error?d.message+": "+d.stack:d},m=u(m,_),r.postMessage(m,_.map(function(e){return e.object})),l(_),_.length>0&&S.default("trace","'"+a+"' transferred "+_.length+" objects to worker thread"))}()}})},f.removeWorker=function(e){if(!t.has(e))throw Error("Worker broker could not remove unregistered object",e);t.delete(e)},f.getMessages=function(){return j},f.getMessageId=function(){return R}}function o(){f.postMessage=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];var i=new x.default(function(t,n){j[R]={method:e,message:r,resolve:t,reject:n}}),a=void 0,o=[];return r&&1===r.length&&r[0]instanceof f.withTransferables&&(o=r[0].transferables,r=r[0].value),a={type:"worker_send",message_id:R,method:e,message:r},a=u(a,o),self.postMessage(a,o.map(function(e){return e.object})),l(o),o.length>0&&S.default("trace","'"+e+"' transferred "+o.length+" objects to main thread"),R++,i},self.addEventListener("message",function(e){var t=c(e.data),r=t.message_id;if("main_reply"===t.type)j[r]&&(t.error?j[r].reject(t.error):j[r].resolve(t.message),delete j[r]);else if("main_send"===t.type&&null!=r){var n,a,o,s,h;!function(){var e=i(t.method),c=g.default(e,2);if(n=c[0],a=c[1],!a)throw Error("Worker broker could not dispatch message type "+t.method+" on target "+t.target+" because no object with that name is registered on main thread");if(o="function"==typeof a[n]&&a[n],!o)throw Error("Worker broker could not dispatch message type "+t.method+" because worker has no method with that name");try{s=o.apply(a,t.message)}catch(d){h=d}var p=void 0,m=[];s instanceof x.default?s.then(function(e){e instanceof f.withTransferables&&(m=e.transferables,e=e.value),p={type:"worker_reply",message_id:r,message:e},p=u(p,m),self.postMessage(p,m.map(function(e){return e.object})),l(m),m.length>0&&S.default("trace","'"+n+"' transferred "+m.length+" objects to main thread") },function(e){self.postMessage({type:"worker_reply",message_id:r,error:e instanceof Error?e.message+": "+e.stack:e})}):(s instanceof f.withTransferables&&(m=s.transferables,s=s.value),p={type:"worker_reply",message_id:r,message:s,error:h instanceof Error?h.message+": "+h.stack:h},p=u(p,m),self.postMessage(p,m.map(function(e){return e.object})),l(m),m.length>0&&S.default("trace","'"+n+"' transferred "+m.length+" objects to main thread"))}()}})}function s(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1],r=arguments.length<=2||void 0===arguments[2]?null:arguments[2],n=arguments.length<=3||void 0===arguments[3]?[]:arguments[3];if(!e)return n;if(Array.isArray(e))e.forEach(function(t,r){return s(t,e,r,n)});else if("object"===("undefined"==typeof e?"undefined":m.default(e)))if(e instanceof ArrayBuffer)n.push({object:e,parent:t,property:r});else if(e.buffer instanceof ArrayBuffer)n.push({object:e.buffer,parent:t,property:r});else for(var i in e)s(e[i],e,i,n);return n}function l(e){Array.isArray(e)&&e.filter(function(e){return e.parent&&e.property}).forEach(function(e){return delete e.parent[e.property]})}function u(e,t){return 0===t.length&&(e=d.default(e)),e}function c(e){return"string"==typeof e?JSON.parse(e):e}Object.defineProperty(r,"__esModule",{value:!0});var f,h=e("babel-runtime/core-js/json/stringify"),d=n(h),p=e("babel-runtime/helpers/typeof"),m=n(p),_=e("babel-runtime/helpers/slicedToArray"),g=n(_),v=e("babel-runtime/helpers/toConsumableArray"),y=n(v),b=e("babel-runtime/core-js/promise"),x=n(b),w=e("babel-runtime/core-js/map"),k=n(w),A=e("./thread"),T=n(A),E=e("./log"),S=n(E);r.default=f={};var R=0,j={},M={};f.addTarget=function(e,t){M[e]=t},f.withTransferables=function(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return this instanceof f.withTransferables?(this.value=t,void(this.transferables=s(this.value))):new(Function.prototype.bind.apply(f.withTransferables,[null].concat(t)))},T.default.is_main&&a(),T.default.is_worker&&o()},{"./log":352,"./thread":357,"babel-runtime/core-js/json/stringify":6,"babel-runtime/core-js/map":7,"babel-runtime/core-js/promise":17,"babel-runtime/helpers/slicedToArray":27,"babel-runtime/helpers/toConsumableArray":28,"babel-runtime/helpers/typeof":29}],361:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var i,a=e("babel-runtime/helpers/slicedToArray"),o=n(a);r.default=i={},i.set=function(e){for(var t=[],r=e.length,n=0;r>n;n++)t[n]=e[n];return t},i.neg=function(e){for(var t=[],r=e.length,n=0;r>n;n++)t[n]=-1*e[n];return t},i.add=function(e,t){for(var r=[],n=Math.min(e.length,t.length),i=0;n>i;i++)r[i]=e[i]+t[i];return r},i.sub=function(e,t){for(var r=[],n=Math.min(e.length,t.length),i=0;n>i;i++)r[i]=e[i]-t[i];return r},i.signed_area=function(e,t,r){return(t[0]-e[0])*(r[1]-e[1])-(r[0]-e[0])*(t[1]-e[1])},i.mult=function(e,t){var r,n=[],i=e.length;if("number"==typeof t)for(r=0;i>r;r++)n[r]=e[r]*t;else for(i=Math.min(e.length,t.length),r=0;i>r;r++)n[r]=e[r]*t[r];return n},i.div=function(e,t){var r,n=[];if("number"==typeof t)for(r=0;rr;r++)n[r]=e[r]/t[r]}return n},i.perp=function(e,t){return[t[1]-e[1],e[0]-t[0]]},i.rot=function(e,t){var r=Math.cos(t),n=Math.sin(t);return[e[0]*r-e[1]*n,e[0]*n+e[1]*r]},i.angle=function(e){var t=o.default(e,2),r=t[0],n=t[1];return Math.atan2(n,r)},i.angleBetween=function(e,t){var r=i.dot(e,t);return-1>r&&(r=-1),Math.acos(r)},i.isEqual=function(e,t){for(var r=e.length,n=0;r>n;n++)if(e[n]!==t[n])return!1;return!0},i.lengthSq=function(e){return 2===e.length?e[0]*e[0]+e[1]*e[1]:e.length>=3?e[0]*e[0]+e[1]*e[1]+e[2]*e[2]:0},i.length=function(e){return Math.sqrt(i.lengthSq(e))},i.normalize=function(e){var t;return 2===e.length?(t=e[0]*e[0]+e[1]*e[1],t=Math.sqrt(t),0!==t?[e[0]/t,e[1]/t]:[0,0]):e.length>=3&&(t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],t=Math.sqrt(t),0!==t)?[e[0]/t,e[1]/t,e[2]/t]:[0,0,0]},i.cross=function(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]},i.dot=function(e,t){for(var r=0,n=Math.min(e.length,t.length),i=0;n>i;i++)r+=e[i]*t[i];return r}},{"babel-runtime/helpers/slicedToArray":27}],362:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var i=e("babel-runtime/helpers/slicedToArray"),a=n(i),o=e("babel-runtime/core-js/object/keys"),s=n(o),l=e("babel-runtime/helpers/classCallCheck"),u=n(l),c=e("babel-runtime/helpers/createClass"),f=n(c),h=e("./geo"),d=n(h),p=e("./tile"),m=n(p),_=e("./camera"),g=n(_),v=e("./utils/utils"),y=n(v),b=e("./utils/subscribe"),x=n(b),w=e("./utils/log"),k=n(w),A=function(){function e(t,r){u.default(this,e),x.default(this),this.scene=t,this.createMatrices(),this.zoom=null,this.center=null,this.bounds=null,this.meters_per_pixel=null,this.panning=!1,this.zooming=!1,this.zoom_direction=0,this.size={css:{},device:{},meters:{}},this.aspect=null,this.buffer=0,this.continuous_zoom="boolean"==typeof r.continuousZoom?r.continuousZoom:!0,this.tile_simplification_level=0,this.preserve_tiles_within_zoom=1,this.reset()}return f.default(e,[{key:"reset",value:function(){this.createCamera()}},{key:"createCamera",value:function(){var e=this.getActiveCamera();e&&(this.camera=g.default.create(e,this,this.scene.config.cameras[e]),this.camera.updateView())}},{key:"getActiveCamera",value:function(){if(this.scene.config&&this.scene.config.cameras){for(var e in this.scene.config.cameras)if(this.scene.config.cameras[e].active)return e;var t=s.default(this.scene.config.cameras);return t.length&&t[0]}}},{key:"setActiveCamera",value:function(e){var t=this.getActiveCamera();return this.scene.config.cameras[e]&&(this.scene.config.cameras[e].active=!0,t&&t!==e&&this.scene.config.cameras[t]&&delete this.scene.config.cameras[t].active),this.scene.updateConfig({rebuild:!1}),this.getActiveCamera()}},{key:"update",value:function(){this.camera.update()}},{key:"setViewportSize",value:function(e,t){this.size.css={width:e,height:t},this.size.device={width:Math.round(this.size.css.width*y.default.device_pixel_ratio),height:Math.round(this.size.css.height*y.default.device_pixel_ratio)},this.aspect=this.size.css.width/this.size.css.height,this.updateBounds()}},{key:"setView",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.lng,r=e.lat,n=e.zoom,i=!1;return"number"==typeof t&&"number"==typeof r&&(this.center&&t===this.center.lng&&r===this.center.lat||(i=!0,this.center={lng:d.default.wrapLng(t),lat:r})),"number"==typeof n&&n!==this.zoom&&(i=!0,this.setZoom(n)),i&&this.updateBounds(),i}},{key:"setZoom",value:function(e){this.zooming?this.zooming=!1:this.last_zoom=this.zoom;var t=this.tile_zoom,r=this.tileZoom(e);this.continuous_zoom||(e=r),r!==t&&(this.zoom_direction=r>t?1:-1),this.last_zoom=this.zoom,this.zoom=e,this.tile_zoom=r,this.updateBounds(),this.scene.requestRedraw()}},{key:"startZoom",value:function(){this.last_zoom=this.zoom,this.zooming=!0}},{key:"baseZoom",value:function(e){return Math.floor(e)}},{key:"tileZoom",value:function(e){return this.baseZoom(e)-this.tile_simplification_level}},{key:"styleZoom",value:function(e){return this.baseZoom(e)+this.tile_simplification_level}},{key:"ready",value:function(){return"number"!=typeof this.size.css.width||"number"!=typeof this.size.css.height||null==this.center||"number"!=typeof this.zoom?!1:!0}},{key:"updateBounds",value:function(){if(this.ready()){this.meters_per_pixel=d.default.metersPerPixel(this.zoom),this.size.meters={x:this.size.css.width*this.meters_per_pixel,y:this.size.css.height*this.meters_per_pixel};var e=d.default.latLngToMeters([this.center.lng,this.center.lat]),t=a.default(e,2),r=t[0],n=t[1];this.center.meters={x:r,y:n},this.center.tile=d.default.tileForMeters([this.center.meters.x,this.center.meters.y],this.tile_zoom),this.bounds={sw:{x:this.center.meters.x-this.size.meters.x/2,y:this.center.meters.y-this.size.meters.y/2},ne:{x:this.center.meters.x+this.size.meters.x/2,y:this.center.meters.y+this.size.meters.y/2}},this.scene.tile_manager.updateTilesForView(),this.trigger("move"),this.scene.requestRedraw()}}},{key:"findVisibleTileCoordinates",value:function(){if(!this.bounds)return[];for(var e=this.tile_zoom,t=d.default.tileForMeters([this.bounds.sw.x,this.bounds.sw.y],e),r=d.default.tileForMeters([this.bounds.ne.x,this.bounds.ne.y],e),n=[],i=t.x-this.buffer;i<=r.x+this.buffer;i++)for(var a=r.y-this.buffer;a<=t.y+this.buffer;a++)n.push(m.default.coord({x:i,y:a,z:e}));return n}},{key:"pruneTilesForView",value:function(){var e=this;if(this.ready()){var t=[Math.ceil((Math.floor(this.size.css.width/d.default.tile_size)+2)/2),Math.ceil((Math.floor(this.size.css.height/d.default.tile_size)+2)/2)];this.scene.tile_manager.removeTiles(function(r){if(r.visible||r.proxy_for)return!1;if(r.loading&&r.style_zoom!==e.tile_zoom)return!0;var n=Math.abs(r.style_zoom-e.tile_zoom);if(n>e.preserve_tiles_within_zoom)return!0;var i=m.default.coordinateAtZoom(r.coords,e.tile_zoom);return Math.abs(i.x-e.center.tile.x)-t[0]>e.buffer?(k.default("trace","View: remove tile "+r.key+" (as "+i.x+"/"+i.y+"/"+e.tile_zoom+") for being too far out of visible area ***"),!0):Math.abs(i.y-e.center.tile.y)-t[1]>e.buffer?(k.default("trace","View: remove tile "+r.key+" (as "+i.x+"/"+i.y+"/"+e.tile_zoom+") for being too far out of visible area ***"),!0):!1})}}},{key:"createMatrices",value:function(){this.matrices={},this.matrices.model=new Float64Array(16),this.matrices.model32=new Float32Array(16),this.matrices.model_view=new Float64Array(16),this.matrices.model_view32=new Float32Array(16),this.matrices.normal=new Float64Array(9),this.matrices.normal32=new Float32Array(9),this.matrices.inverse_normal32=new Float32Array(9)}},{key:"setupTile",value:function(e,t){e.setupProgram(this.matrices,t),this.camera.setupMatrices(this.matrices,t)}},{key:"setupProgram",value:function(e){e.uniform("2fv","u_resolution",[this.size.device.width,this.size.device.height]),e.uniform("3fv","u_map_position",[this.center.meters.x,this.center.meters.y,this.zoom]),e.uniform("1f","u_meters_per_pixel",this.meters_per_pixel),e.uniform("1f","u_device_pixel_ratio",y.default.device_pixel_ratio),this.camera.setupProgram(e)}}]),e}();r.default=A},{"./camera":298,"./geo":299,"./tile":346,"./utils/log":352,"./utils/subscribe":356,"./utils/utils":358,"babel-runtime/core-js/object/keys":15,"babel-runtime/helpers/classCallCheck":21,"babel-runtime/helpers/createClass":22,"babel-runtime/helpers/slicedToArray":27}]},{},[321])(321)}); \ No newline at end of file diff --git a/package.json b/package.json index 8a2aab75d..779b77aeb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tangram", - "version": "0.10.3", + "version": "0.10.4", "description": "WebGL Maps for Vector Tiles", "repository": { "type": "git",