From 43293675c875de291b2e9a3b2d2b9463c164c7ba Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sat, 13 Jan 2018 12:12:00 +0000 Subject: [PATCH] 1.10.681 [ci skip] --- build/ccxt.browser.js | 8 ++++---- ccxt.js | 2 +- package.json | 2 +- php/Exchange.php | 2 +- php/okcoinusd.php | 4 ++-- python/ccxt/__init__.py | 2 +- python/ccxt/async/__init__.py | 2 +- python/ccxt/async/base/exchange.py | 2 +- python/ccxt/async/okcoinusd.py | 4 ++-- python/ccxt/base/exchange.py | 2 +- python/ccxt/okcoinusd.py | 4 ++-- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/build/ccxt.browser.js b/build/ccxt.browser.js index ac746cebdebf..4bf670d032b8 100644 --- a/build/ccxt.browser.js +++ b/build/ccxt.browser.js @@ -45,7 +45,7 @@ const errors = require ('./js/base/errors') //----------------------------------------------------------------------------- // this is updated by vss.js when building -const version = '1.10.680' +const version = '1.10.681' Exchange.ccxtVersion = version @@ -26361,7 +26361,7 @@ module.exports = class okcoinusd extends Exchange { // obsolete metainfo interface 'hasFetchOHLCV': true, 'hasFetchOrder': true, - 'hasFetchOrders': true, + 'hasFetchOrders': false, 'hasFetchOpenOrders': true, 'hasFetchClosedOrders': true, 'hasWithdraw': true, @@ -26369,7 +26369,7 @@ module.exports = class okcoinusd extends Exchange { 'has': { 'fetchOHLCV': true, 'fetchOrder': true, - 'fetchOrders': true, + 'fetchOrders': false, 'fetchOpenOrders': true, 'fetchClosedOrders': true, 'withdraw': true, @@ -39347,4 +39347,4 @@ exports.isBuffer = function isBuffer(obj) { }; },{}]},{},[1]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJjY3h0LmJyb3dzZXIuanMiLCJjY3h0LmpzIiwianMvXzFicm9rZXIuanMiLCJqcy9fMWJ0Y3hlLmpzIi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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5jb25zdCBleGNoYW5nZXMgPSB7XG4gICAgJ18xYnJva2VyJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvXzFicm9rZXIuanMnKSxcbiAgICAnXzFidGN4ZSc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9fMWJ0Y3hlLmpzJyksXG4gICAgJ2FjeCc6ICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYWN4LmpzJyksXG4gICAgJ2FsbGNvaW4nOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYWxsY29pbi5qcycpLFxuICAgICdhbnhwcm8nOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2FueHByby5qcycpLFxuICAgICdiaWJveCc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpYm94LmpzJyksXG4gICAgJ2JpbmFuY2UnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYmluYW5jZS5qcycpLFxuICAgICdiaXQyYyc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdDJjLmpzJyksXG4gICAgJ2JpdGJheSc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0YmF5LmpzJyksXG4gICAgJ2JpdGNvaW5jb2lkJzogICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0Y29pbmNvaWQuanMnKSxcbiAgICAnYml0ZmluZXgnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRmaW5leC5qcycpLFxuICAgICdiaXRmaW5leDInOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGZpbmV4Mi5qcycpLFxuICAgICdiaXRmbHllcic6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGZseWVyLmpzJyksXG4gICAgJ2JpdGh1bWInOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0aHVtYi5qcycpLFxuICAgICdiaXRsaXNoJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGxpc2guanMnKSxcbiAgICAnYml0bWFya2V0JzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRtYXJrZXQuanMnKSxcbiAgICAnYml0bWV4JzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRtZXguanMnKSxcbiAgICAnYml0c28nOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRzby5qcycpLFxuICAgICdiaXRzdGFtcCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdHN0YW1wLmpzJyksXG4gICAgJ2JpdHN0YW1wMSc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0c3RhbXAxLmpzJyksXG4gICAgJ2JpdHRyZXgnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0dHJleC5qcycpLFxuICAgICdibDNwJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JsM3AuanMnKSxcbiAgICAnYmxldXRyYWRlJzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9ibGV1dHJhZGUuanMnKSxcbiAgICAnYnJhemlsaWV4JzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9icmF6aWxpZXguanMnKSxcbiAgICAnYnRjYm94JzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGNib3guanMnKSxcbiAgICAnYnRjY2hpbmEnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGNjaGluYS5qcycpLFxuICAgICdidGNleGNoYW5nZSc6ICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y2V4Y2hhbmdlLmpzJyksXG4gICAgJ2J0Y21hcmtldHMnOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjbWFya2V0cy5qcycpLFxuICAgICdidGN0cmFkZXVhJzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y3RyYWRldWEuanMnKSxcbiAgICAnYnRjdHVyayc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGN0dXJrLmpzJyksXG4gICAgJ2J0Y3gnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjeC5qcycpLFxuICAgICdidGVyJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0ZXIuanMnKSxcbiAgICAnYnhpbnRoJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9ieGludGguanMnKSxcbiAgICAnY2NleCc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jY2V4LmpzJyksXG4gICAgJ2NleCc6ICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY2V4LmpzJyksXG4gICAgJ2NoYnRjJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY2hidGMuanMnKSxcbiAgICAnY2hpbGViaXQnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jaGlsZWJpdC5qcycpLFxuICAgICdjb2luY2hlY2snOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5jaGVjay5qcycpLFxuICAgICdjb2luZXhjaGFuZ2UnOiAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5leGNoYW5nZS5qcycpLFxuICAgICdjb2luZmxvb3InOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5mbG9vci5qcycpLFxuICAgICdjb2luZ2knOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5naS5qcycpLFxuICAgICdjb2lubWFya2V0Y2FwJzogICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5tYXJrZXRjYXAuanMnKSxcbiAgICAnY29pbm1hdGUnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jb2lubWF0ZS5qcycpLFxuICAgICdjb2luc2VjdXJlJzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5zZWN1cmUuanMnKSxcbiAgICAnY29pbnNwb3QnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jb2luc3BvdC5qcycpLFxuICAgICdjcnlwdG9waWEnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NyeXB0b3BpYS5qcycpLFxuICAgICdkc3gnOiAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2RzeC5qcycpLFxuICAgICdleG1vJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2V4bW8uanMnKSxcbiAgICAnZmxvd2J0Yyc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9mbG93YnRjLmpzJyksXG4gICAgJ2ZveGJpdCc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZm94Yml0LmpzJyksXG4gICAgJ2Z5YnNlJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZnlic2UuanMnKSxcbiAgICAnZnlic2cnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9meWJzZy5qcycpLFxuICAgICdnYXRlY29pbic6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dhdGVjb2luLmpzJyksXG4gICAgJ2dhdGVpbyc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZ2F0ZWlvLmpzJyksXG4gICAgJ2dkYXgnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZ2RheC5qcycpLFxuICAgICdnZW1pbmknOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dlbWluaS5qcycpLFxuICAgICdnZXRidGMnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dldGJ0Yy5qcycpLFxuICAgICdoaXRidGMnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2hpdGJ0Yy5qcycpLFxuICAgICdoaXRidGMyJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2hpdGJ0YzIuanMnKSxcbiAgICAnaHVvYmknOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9odW9iaS5qcycpLFxuICAgICdodW9iaWNueSc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2h1b2JpY255LmpzJyksXG4gICAgJ2h1b2JpcHJvJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvaHVvYmlwcm8uanMnKSxcbiAgICAnaW5kZXBlbmRlbnRyZXNlcnZlJzogICAgICByZXF1aXJlICgnLi9qcy9pbmRlcGVuZGVudHJlc2VydmUuanMnKSxcbiAgICAnaXRiaXQnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9pdGJpdC5qcycpLFxuICAgICdqdWJpJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2p1YmkuanMnKSxcbiAgICAna3Jha2VuJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rcmFrZW4uanMnKSxcbiAgICAna3Vjb2luJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rdWNvaW4uanMnKSxcbiAgICAna3VuYSc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rdW5hLmpzJyksXG4gICAgJ2xha2VidGMnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbGFrZWJ0Yy5qcycpLFxuICAgICdsaXF1aSc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2xpcXVpLmpzJyksXG4gICAgJ2xpdmVjb2luJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbGl2ZWNvaW4uanMnKSxcbiAgICAnbHVubyc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9sdW5vLmpzJyksXG4gICAgJ2x5a2tlJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbHlra2UuanMnKSxcbiAgICAnbWVyY2Fkbyc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9tZXJjYWRvLmpzJyksXG4gICAgJ21peGNvaW5zJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbWl4Y29pbnMuanMnKSxcbiAgICAnbm92YSc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9ub3ZhLmpzJyksXG4gICAgJ29rY29pbmNueSc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvb2tjb2luY255LmpzJyksXG4gICAgJ29rY29pbnVzZCc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvb2tjb2ludXNkLmpzJyksXG4gICAgJ29rZXgnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvb2tleC5qcycpLFxuICAgICdwYXltaXVtJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3BheW1pdW0uanMnKSxcbiAgICAncG9sb25pZXgnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9wb2xvbmlleC5qcycpLFxuICAgICdxcnlwdG9zJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3FyeXB0b3MuanMnKSxcbiAgICAncXVhZHJpZ2FjeCc6ICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9xdWFkcmlnYWN4LmpzJyksXG4gICAgJ3F1b2luZSc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvcXVvaW5lLmpzJyksXG4gICAgJ3NvdXRoeGNoYW5nZSc6ICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvc291dGh4Y2hhbmdlLmpzJyksXG4gICAgJ3N1cmJpdGNvaW4nOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvc3VyYml0Y29pbi5qcycpLFxuICAgICd0aGVyb2NrJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3RoZXJvY2suanMnKSxcbiAgICAndGlkZXgnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy90aWRleC5qcycpLFxuICAgICd1cmR1Yml0JzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3VyZHViaXQuanMnKSxcbiAgICAndmF1bHRvcm8nOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy92YXVsdG9yby5qcycpLFxuICAgICd2YnRjJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3ZidGMuanMnKSxcbiAgICAndmlyd294JzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy92aXJ3b3guanMnKSxcbiAgICAnd2V4JzogICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy93ZXguanMnKSxcbiAgICAneGJ0Y2UnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy94YnRjZS5qcycpLFxuICAgICd5b2JpdCc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3lvYml0LmpzJyksXG4gICAgJ3l1bmJpJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMveXVuYmkuanMnKSxcbiAgICAnemFpZic6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy96YWlmLmpzJyksXG4gICAgJ3piJzogICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvemIuanMnKSwgICAgXG59XG5cbi8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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W1pdCc6IDE1MDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MicsXG4gICAgICAgICAgICAnaGFzUHVibGljQVBJJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUcmFkZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICc2MCcsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICc5MDAnLFxuICAgICAgICAgICAgICAgICcxaCc6ICczNjAwJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnODY0MDAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYwMjEtNDIwYmQ5ZmMtNWVjYi0xMWU3LThlZDYtNTZkMDA4MWVmZWQyLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovLzFicm9rZXIuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovLzFicm9rZXIuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vMWJyb2tlci5jb20vP2M9ZW4vY29udGVudC9hcGktZG9jdW1lbnRhdGlvbicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2JhcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9jYXRlZ29yaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvZGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2xpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9xdW90ZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC90aWNrcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jcmVhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29wZW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2Nsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9jbG9zZV9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2VkaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL29wZW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL3NoYXJlZC9nZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NvY2lhbC9wcm9maWxlX3N0YXRpc3RpY3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NvY2lhbC9wcm9maWxlX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9iaXRjb2luX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9kZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL292ZXJ2aWV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3F1b3RhX3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci90cmFuc2FjdGlvbl9sb2cnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaENhdGVnb3JpZXMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRNYXJrZXRDYXRlZ29yaWVzICgpO1xuICAgICAgICAvLyB0aGV5IHJldHVybiBhbiBlbXB0eSBzdHJpbmcgYW1vbmcgdGhlaXIgY2F0ZWdvcmllcywgd3RmP1xuICAgICAgICBsZXQgY2F0ZWdvcmllcyA9IHJlc3BvbnNlWydyZXNwb25zZSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY2F0ZWdvcmllcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKGNhdGVnb3JpZXNbaV0pXG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKGNhdGVnb3JpZXNbaV0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHRoaXNfID0gdGhpczsgLy8gd29ya2Fyb3VuZCBmb3IgQmFiZWwgYnVnIChub3QgcGFzc2luZyBgdGhpc2AgdG8gX3JlY3Vyc2l2ZSgpIGNhbGwpXG4gICAgICAgIGxldCBjYXRlZ29yaWVzID0gYXdhaXQgdGhpcy5mZXRjaENhdGVnb3JpZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjYXRlZ29yaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgY2F0ZWdvcnkgPSBjYXRlZ29yaWVzW2NdO1xuICAgICAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzXy5wcml2YXRlR2V0TWFya2V0TGlzdCAoe1xuICAgICAgICAgICAgICAgICdjYXRlZ29yeSc6IGNhdGVnb3J5LnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHNbJ3Jlc3BvbnNlJ10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sncmVzcG9uc2UnXVtwXTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGlmICgoY2F0ZWdvcnkgPT0gJ0ZPUkVYJykgfHwgKGNhdGVnb3J5ID09ICdDUllQVE8nKSkge1xuICAgICAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ25hbWUnXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBhcnRzID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgICAgICAgICBiYXNlID0gcGFydHNbMF07XG4gICAgICAgICAgICAgICAgICAgIHF1b3RlID0gcGFydHNbMV07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYmFzZSA9IGlkO1xuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9ICdVU0QnO1xuICAgICAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJhc2UgPSB0aGlzXy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpc18uY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldFVzZXJPdmVydmlldyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYmFsYW5jZVsncmVzcG9uc2UnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIH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CxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdiaWRzJzogWyBiaWQgXSxcbiAgICAgICAgICAgICdhc2tzJzogWyBhc2sgXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sKSB7XG4gICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaFRyYWRlcyAoKSBtZXRob2Qgbm90IGltcGxlbWVudGVkIHlldCcpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRNYXJrZXRCYXJzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAncmVzb2x1dGlvbic6IDYwLFxuICAgICAgICAgICAgJ2xpbWl0JzogMSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLmZldGNoT3JkZXJCb29rIChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzdWx0WydyZXNwb25zZSddWzBdO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRpY2tlclsnZGF0ZSddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgIC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AgICAgICAgICAgICAgICcxZCc6ICcxeWVhcicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjA0OS0yYjI5NDQwOC01ZWNjLTExZTctODVjYy1hZGFmZjAxM2RjMWEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vMWJ0Y3hlLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly8xYnRjeGUuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vMWJ0Y3hlLmNvbS9hcGktZG9jcy5waHAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yaWNhbC1wcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyLWJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMtYW5kLWluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4tb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyLXRyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnRjLWRlcG9zaXQtYWRkcmVzcy9nZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J0Yy1kZXBvc2l0LWFkZHJlc3MvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0cy9nZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL2dldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL2VkaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL25ldycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ1VTRCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdFVVInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvQ05ZJzogeyAnaWQnOiAnQ05ZJywgJ3N5bWJvbCc6ICdCVEMvQ05ZJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0NOWScgfSxcbiAgICAgICAgICAgICAgICAnQlRDL1JVQic6IHsgJ2lkJzogJ1JVQicsICdzeW1ib2wnOiAnQlRDL1JVQicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdSVUInIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9DSE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JyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnMjQwJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzcyMCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzE0NDAnLFxuICAgICAgICAgICAgICAgICczZCc6ICc0MzIwJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMTAwODAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzAyNDc2MTQtMWZlNjFjNzQtOTYyMS0xMWU3LTllOGMtZjFhNjI3YWZhMjc5LmpwZycsXG4gICAgICAgICAgICAgICAgJ2V4dGVuc2lvbic6ICcuanNvbicsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FjeC5pby9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9hY3guaW8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9hY3guaW8vZG9jdW1lbnRzL2FwaV92MicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLCAvLyBHZXQgYWxsIGF2YWlsYWJsZSBtYXJrZXRzXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsIC8vIEdldCB0aWNrZXIgb2YgYWxsIG1hcmtldHNcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzL3ttYXJrZXR9JywgLy8gR2V0IHRpY2tlciBvZiBzcGVjaWZpYyBtYXJrZXRcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLCAvLyBHZXQgcmVjZW50IHRyYWRlcyBvbiB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QgYWNjb3VudHMgaW5mb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzJywgLy8gR2V0IHlvdXIgZGVwb3NpdHMgaGlzdG9yeVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnLCAvLyBHZXQgZGV0YWlscyBvZiBzcGVjaWZpYyBkZXBvc2l0XG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdF9hZGRyZXNzJywgLy8gV2hlcmUgdG8gZGVwb3NpdCBUaGUgYWRkcmVzcyBmaWVsZCBjb3VsZCBiZSBlbXB0eSB3aGVuIGEgbmV3IGFkZHJlc3MgaXMgZ2VuZXJhdGluZyAoZS5nLiBmb3IgYml0Y29pbiksIHlvdSBzaG91bGQgdHJ5IGFnYWluIGxhdGVyIGluIHRoYXQgY2FzZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLCAvLyBHZXQgeW91ciBvcmRlcnMsIHJlc3VsdHMgaXMgcGFnaW5hdGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLCAvLyBHZXQgaW5mb3JtYXRpb24gb2Ygc3BlY2lmaWVkIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL215JywgLy8gR2V0IHlvdXIgZXhlY3V0ZWQgdHJhZGVzIFRyYWRlcyBhcmUgc29ydGVkIGluIHJldmVyc2UgY3JlYXRpb24gb3JkZXIuXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdzJywgLy8gR2V0IHlvdXIgY3J5cHRvY3VycmVuY3kgd2l0aGRyYXdzXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLCAvLyBHZXQgeW91ciBjcnlwdG9jdXJyZW5jeSB3aXRoZHJhd1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLCAvLyBDcmVhdGUgYSBTZWxsL0J1eSBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9tdWx0aScsIC8vIENyZWF0ZSBtdWx0aXBsZSBzZWxsL2J1eSBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvY2xlYXInLCAvLyBDYW5jZWwgYWxsIG15IG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2RlbGV0ZScsIC8vIENhbmNlbCBhbiBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JywgLy8gQ3JlYXRlIGEgd2l0aGRyYXdcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IDAuMCwgLy8gVGhlcmUgaXMgb25seSAxJSBmZWUgb24gd2l0aGRyYXdhbHMgdG8geW91ciBiYW5rIGFjY291bnQuXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0TWVtYmVyc01lICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnYWNjb3VudHMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYmFsYW5jZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2xvY2tlZCddKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0RGVwdGggKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ2xpbWl0JzogMzAwLFxuICAgICAgICB9LCBw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XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgICAgIGJhc2UgPSBiYXNlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gcXVvdGUudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0I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IHtcbiAgICAgICAgICAgIHN0YXR1cyA9ICdjbG9zZWQnO1xuICAgICAgICB9IGVsc2UgaWYgKHN0YXRlID09ICd3YWl0Jykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICB9IGVsc2UgaWYgKHN0YXRlID09ICdjYW5jZWwnKSB7XG4gICAgICAgICAgICBzdGF0dXMgPSAnY2FuY2VsZWQnO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnaWQnXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ29yZF90eXBlJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwYXJzZUZsb2F0IChvcmRlclsncHJpY2UnXSksXG4gICAgICAgICAgICAnYW1vdW50JzogcGFyc2VGbG9hdCAob3JkZXJbJ3ZvbHVtZSddKSxcbiAgICAgICAgICAgICdmaWxsZWQnOiBwYXJzZUZsb2F0IChvcmRlclsnZXhlY3V0ZWRfdm9sdW1lJ10pLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHBhcnNlRmxvYXQgKG9yZGVyWydyZW1haW5pbmdfdm9sdW1lJ10pLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cG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NbaV07XG4gICAgICAgICAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAob3JkZXIpO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDwga2V5cy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgICAgICBsZXQga2V5ID0ga2V5c1trXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHZhbHVlID0gb3JkZXJba2V5XTtcbiAgICAgICAgICAgICAgICAgICAgcXVlcnkgKz0gJyZvcmRlcnMlNUIlNUQlNUInICsga2V5ICsgJyU1RD0nICsgdmFsdWUudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHF1ZXJ5O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnVybGVuY29kZSAodGhpcy5rZXlzb3J0IChwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXF1ZXN0ID0gJy9hcGknICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBpZiAoJ2V4dGVuc2lvbicgaW4gdGhpcy51cmxzKVxuICAgICAgICAgICAgcmVxdWVzdCArPSB0aGlzLnVybHNbJ2V4dGVuc2lvbiddO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgcmVxdWVzdDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmVuY29kZVBhcmFtcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYWNjZXNzX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICd0b25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG1ldGhvZCArICd8JyArIHJlcXVlc3QgKyAnfCcgKyBxdWVyeTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBsZXQgc3VmZml4ID0gcXVlcnkgKyAnJnNpZ25hdHVyZT0nICsgc2lnbmF0dXJlO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyBzdWZmaXg7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGJvZHkgPSBzdWZmaXg7XG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ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cbiAgICAgICAgICAgICduYW1lJzogJ0FsbGNvaW4nLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDQScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2V4dGVuc2lvbic6ICcnLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMTU2MTgwOS1jMzE2YjM3Yy1iMDYxLTExZTctOGQ1YS1iNTQ3YjRkNzMwZWIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd3d3LmFsbGNvaW4uY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2FwaS5hbGxjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5hbGxjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5hbGxjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5hbGxjb2luLmNvbS9BYm91dC9BUElSZWZlcmVuY2UnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdIb21lL01hcmtldE92ZXJWaWV3RGV0YWlsLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrbGluZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhdGNoX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyc19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXBheW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyaW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHVuZGVmaW5lZCxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLndlYkdldEhvbWVNYXJrZXRPdmVyVmlld0RldGFpbCAoKTtcbiAgICAgICAgbGV0IGNvaW5zID0gcmVzcG9uc2VbJ21hcmtldENvaW5zJ107XG4gICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgY29pbnMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXRzID0gY29pbnNbal1bJ01hcmtldHMnXTtcbiAgICAgICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDwgbWFya2V0cy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2tdWydNYXJrZXQnXTtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnUHJpbWFyeSddO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnU2Vjb25kYXJ5J107XG4gICAgICAgICAgICAgICAgbGV0IGlkID0gYmFzZS50b0xvd2VyQ2FzZSAoKSArICdfJyArIHF1b3RlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICd0eXBlJzogJ3Nwb3QnLFxuICAgICAgICAgICAgICAgICAgICAnc3BvdCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdmdXR1cmUnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyU3RhdHVzIChzdGF0dXMpIHtcbiAgICAgICAgaWYgKHN0YXR1cyA9PSAtMSlcbiA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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgYW54cHJvIGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2FueHBybycsXG4gICAgICAgICAgICAnbmFtZSc6ICdBTlhQcm8nLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ0pQJywgJ1NHJywgJ0hLJywgJ05aJyBdLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAnMicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUcmFkZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY1OTgzLWZkODU5NWRhLTVlYzktMTFlNy04MmUzLWFkYjNhYjhjMjYxMi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hbnhwcm8uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2FueHByby5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwOi8vZG9jcy5hbnh2Mi5hcGlhcnkuaW8nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hbnhwcm8uY29tL3BhZ2VzL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L2RlcHRoL2Z1bGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS90cmFkZS9mZXRjaCcsIC8vIGRpc2FibGVkIGJ5IEFOWFByb1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9hZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9xdW90ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L29yZGVyL3Jlc3VsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkve2N1cnJlbmN5fS9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb25leS97Y3VycmVuY3l9L3NlbmRfc2ltcGxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb25leS9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb25leS90cmFkZS9saXN0J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dFQlRDJywgJ3N5bWJvbCc6ICdET0dFL0JUQycsICdiYXNlJzogJ0RPR0UnLCAncXVvdGUnOiAnQlRDJywgJ211bHRpcGxpZXInOiAxMDAwMDAwMDAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4zIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjYgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE1vbmV5SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlWydXYWxsZXRzJ10pO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2UgfTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZVsnV2FsbGV0cyddKSB7XG4gICAgICAgICAgICAgICAgbGV0IHdhbGxldCA9IGJhbGFuY2VbJ1dhbGxldHMnXVtjdXJyZW5jeV07XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAod2FsbGV0WydBdmFpb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oaXMucHVibGljR2V0Q3VycmVuY3lQYWlyTW9uZXlUaWNrZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3lfcGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IHQgPSBwYXJzZUludCAodGlja2VyWydkYXRhVXBkYXRlVGltZSddKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0IC8gMTAwMCk7XG4gICAgICAgIGxldCBiaWQgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyWydidXknXSwgJ3ZhbHVlJyk7XG4gICAgICAgIGxldCBhc2sgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyWydzZWxsJ10sICd2YWx1ZScpOztcbiAgICAgICAgbGV0IGJhc2VWb2x1bWUgPSBwYXJzZUZsb2F0ICh0aWNrZXJbJ3ZvbCddWyd2YWx1ZSddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXVsndmFsdWUnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXVsndmFsdWUnXSksXG4gICAgICAgICAgICAnYmlkJzogYmlkLFxuICAgICAgICAgICAgJ2Fzayc6IGFzayxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmR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MudGltZW91dCAgICAgICAgICA9IDEwMDAwIC8vIG1pbGxpc2Vjb25kc1xuICAgICAgICB0aGlzLnZlcmJvc2UgICAgICAgICAgPSBmYWxzZVxuICAgICAgICB0aGlzLmRlYnVnICAgICAgICAgICAgPSBmYWxzZVxuICAgICAgICB0aGlzLmpvdXJuYWwgICAgICAgICAgPSAnZGVidWcuanNvbidcbiAgICAgICAgdGhpcy51c2VyQWdlbnQgICAgICAgID0gdW5kZWZpbmVkXG4gICAgICAgIHRoaXMudHdvZmEgICAgICAgICAgICA9IGZhbHNlIC8vIHR3by1mYWN0b3IgYXV0aGVudGljYXRpb24gKDJGQSlcbiAgICAgICAgdGhpcy50aW1lZnJhbWVzICAgICAgID0gdW5kZWZpbmVkXG4gICAgICAgIHRoaXMuaGFzUHVibGljQVBJICAgICAgICAgPSB0cnVlXG4gICAgICAgIHRoaXMuaGFzUHJpdmF0ZUFQSSAgICAgICAgPSB0cnVlXG4gICAgICAgIHRoaXMuaGFzQ09SUyAgICAgICAgICAgICAgPSBmYWxzZVxuICAgICAgICB0aGlzLmhhc0RlcG9zaXQgICAgICAgICAgID0gZmFsc2VcbiAgICAgICAgdGhpcy5oYXNGZXRjaEJhbGFuY2UgICAgICA9IHRydWVcbiAgICAgICAgdGhpcy5oYXNGZXRjaENsb3NlZE9yZGVycyA9IGZhbHNlXG4gICAgICAgIHRoaXMuaGFzRmV0Y2hDdXJyZW5jaWVzICAgPSBmYWxzZVxuICAgICAgICB0aGlzLmhhc0ZldGNoTXlUcmFkZXMgICAgID0gZmFsc2VcbiAgICAgICAgdGhpcy5oYXNGZXRjaE9ITENWICAgICAgICA9IGZhbHNlXG4gICAgICAgIHRoaXMuaGFzRmV0Y2hPcGVuT3JkZXJzICAgPSBmYWxzZVxuICAgICAgICB0aGlzLmhhc0ZldGNoT3JkZXIgICAgICAgID0gZmFsc2VcbiAgICAgICAgdGhpcy5oYXNGZXRjaE9yZGVyQm9vayAgICA9IHRydWVcbiAgICAgICAgdGhpcy5oYXNGZXRjaE9yZGVycyAgICAgICA9IGZhbHNlXG4gICAgICAgIHRoaXMuaGFzRmV0Y2hUaWNrZXIgICAgICAgPSB0cnVlXG4gICAgICAgIHRoaXMuaGFzRmV0Y2hUaWNrZXJzICAgICAgPSBmYWxzZVxuICAgICAgICB0aGlzLmhhc0ZldGNoVHJhZGVzICAgICAgID0gdHJ1ZVxuICAgICAgICB0aGlzLmhhc1dpdGhkcmF3ICAgICAgICAgID0gZmFsc2VcbiAgICAgICAgdGhpcy5oYXNDcmVhdGVPcmRlciAgICAgICA9IHRoaXMuaGFzUHJpdmF0ZUFQSVxuICAgICAgICB0aGlzLmhhc0NhbmNlbE9yZGVyICAgICAgID0gdGhpcy5oYXNQcml2YXRlQVBJXG5cbiAgICAgICAgdGhpcy5hcGlLZXkgICA9IHVuZGVmaW5lZFxuICAgICAgICB0aGlzLnNlY3JldCAgID0gdW5kZWZpbmVkXG4gICAgICAgIHRoaXMudWlkICAgICAgPSB1bmRlZmluZWRcbiAgICAgICAgdGhpcy5sb2dpbiAgICA9IHVuZGVmaW5lZFxuICAgICAgICB0aGlzLnBhc3N3b3JkID0gdW5kZWZpbmVkXG5cbiAgICAgICAgdGhpcy5yZXF1aXJlZENyZWRlbnRpYWxzID0ge1xuICAgICAgICAgICAgJ2FwaUtleSc6ICAgdHJ1ZSxcbiAgICAgICAgICAgICdzZWNyZXQnOiAgIHRydWUsXG4gICAgICAgICAgICAndWlkJzogICAgICBmYWxzZSxcbiAgICAgICAgICAgICdsb2dpbic6ICAgIGZhbHNlLFxuICAgICAgICAgICAgJ3Bhc3N3b3JkJzogZmFsc2UsXG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmJhbGFuY2UgICAgPSB7fVxuICAgICAgICB0aGlzLm9yZGVyYm9va3MgPSB7fVxuICAgICAgICB0aGlzLnRpY2tlcnMgICAgPSB7fVxuICAgICAgICB0aGlzLmZlZXMgICAgICAgPSB7fVxuICAgICAgICB0aGlzLm9yZGVycyAgICAg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gICAgPSB0aGlzLmZldGNoTDJPcmRlckJvb2tcbiAgICAgICAgdGhpcy5mZXRjaF9vcmRlcl9ib29rICAgICAgICAgICAgPSB0aGlzLmZldGNoT3JkZXJCb29rXG4gICAgICAgIHRoaXMuZmV0Y2hfdGlja2VycyAgICAgICAgICAgICAgID0gdGhpcy5mZXRjaFRpY2tlcnNcbiAgICAgICAgdGhpcy5mZXRjaF90aWNrZXIgICAgICAgICAgICAgICAgPSB0aGlzLmZldGNoVGlja2VyXG4gICAgICAgIHRoaXMuZmV0Y2hfdHJhZGVzICAgICAgICAgICAgICAgID0gdGhpcy5mZXRjaFRyYWRlc1xuICAgICAgICB0aGlzLmZldGNoX29yZGVyICAgICAgICAgICAgICAgICA9IHRoaXMuZmV0Y2hPcmRlclxuICAgICAgICB0aGlzLmZldGNoX29yZGVycyAgICAgICAgICAgICAgICA9IHRoaXMuZmV0Y2hPcmRlcnNcbiAgICAgICAgdGhpcy5mZXRjaF9vcGVuX29yZGVycyAgICAgICAgICAgPSB0aGlzLmZldGNoT3Blbk9yZGVyc1xuICAgICAgICB0aGlzLmZldGNoX2Nsb3NlZF9vcmRlcnMgICAgICAgICA9IHRoaXMuZmV0Y2hDbG9zZWRPcmRlcnNcbiAgICAgICAgdGhpcy5mZXRjaF9vcmRlcl9zdGF0dXMgICAgICAgICAgPSB0aGlzLmZldGNoT3JkZXJTdGF0dXNcbiAgICAgICAgdGhpcy5mZXRjaF9tYXJrZXRzICAgICAgICAgICAgICAgPSB0aGlzLmZldGNoTWFya2V0c1xuICAgICAgICB0aGlzLmxvYWRfbWFya2V0cyAgICAgICAgICAgICAgICA9IHRoaXMubG9hZE1hcmtldHNcbiAgICAgICAgdGhpcy5zZXRfbWFya2V0cyAgICAgICAgICAgICAgICAgPSB0aGlzLnNldE1hcmtldHNcbiAgICAgICAgdGhpcy5wYXJzZV9iYWxhbmNlICAgICAgICAgICAgICAgPSB0aGlzLnBhcnNlQmFsYW5jZVxuICAgICAgICB0aGlzLnBh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ICByZXR1cm4gZW5jb2RlVVJJQ29tcG9uZW50ICguLi5hcmdzKVxuICAgIH1cblxuICAgIGNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKSB7XG4gICAgICAgIE9iamVjdC5rZXlzICh0aGlzLnJlcXVpcmVkQ3JlZGVudGlhbHMpLm1hcCAoa2V5ID0+IHtcbiAgICAgICAgICAgIGlmICh0aGlzLnJlcXVpcmVkQ3JlZGVudGlhbHNba2V5XSAmJiAhdGhpc1trZXldKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yICh0aGlzLmlkICsgJyByZXF1aXJlcyBgJyArIGtleSArICdgJylcbiAgICAgICAgfSlcbiAgICB9XG5cbiAgICBpbml0UmVzdFJhdGVMaW1pdGVyICgpIHtcblxuICAgICAgICB0aGlzLnRva2VuQnVja2V0ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgIHJlZmlsbFJhdGU6ICAxIC8gdGhpcy5yYXRlTGltaXQsXG4gICAgICAgICAgICBkZWxheTogICAgICAgMSxcbiAgICAgICAgICAgIGNhcGFjaXR5OiAgICAxLFxuICAgICAgICAgICAgZGVmYXVsdENvc3Q6IDEsXG4gICAgICAgICAgICBtYXhDYXBhY2l0eTogMTAwMCxcbiAgICAgICAgfSwgdGhpcy50b2tlbkJ1Y2tldClcblxuICAgICAgICB0aGlzLnRocm90dGxlID0gdGhyb3R0bGUgKHRoaXMudG9rZW5CdWNrZXQpXG5cbiAgICAgICAgdGhpcy5leGVjdXRlUmVzdFJlcXVlc3QgPSBmdW5jdGlvbiAodXJsLCBtZXRob2QgPSAnR0VUJywgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuXG4gICAgICAgICAgICBsZXQgcHJvbWlzZSA9XG4gICAgICAgICAgICAgICAgdGhpcy5mZXRjaEltcGxlbWVudGF0aW9uICh1cmwsIHsgJ21ldGhvZCc6IG1ldGhvZCwgJ2hlYWRlcnMnOiBoZWFkZXJzLCAnYm9keSc6IGJvZHksICdhZ2VudCc6IHRoaXMudHVubmVsQWdlbnQgfHwgbnVsbCwgdGltZW91dDogdGhpcy50aW1lb3V0fSlcbiAgICAgICAgICAgICAgICAgICAgLmNhdGNoIChlID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc05vZGUpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlTm90QXZhaWxhYmxlIChbIHRoaXMuaWQsIG1ldGhvZCwgdXJsLCBlLnR5cGUsIGUubWVzc2FnZSBdLmpvaW4gKCcgJykpXG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBlIC8vIHJldGhyb3cgYWxsIHVua25vd24gZXJyb3JzXG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC50aGVuIChyZXNwb25zZSA9PiB0aGlzLmhhbmRsZVJlc3RFcnJvcnMgKHJlc3BvbnNlLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkpXG4gICAgICAgICAgICAgICAgICAgIC50aGVuIChyZXNwb25zZSA9PiB0aGlzLmhhbmRsZVJlc3RSZXNwb25zZSAocmVzcG9uc2UsIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSlcblxuICAgICAgICAgICAgcmV0dXJuIHRpbWVvdXQgKHRoaXMudGltZW91dCwgcHJvbWlzZSkuY2F0Y2ggKGUgPT4ge1xuICAgICAgICAgICAgICAgIGlmIChlIGluc3RhbmNlb2YgUmVxdWVzdFRpbWVvdXQpXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBSZXF1ZXN0VGltZW91dCAodGhpcy5pZCArICcgJyArIG1ldGhvZCArICcgJyArIHVybCArICcgJyArIGUubWVzc2FnZSArICcgKCcgKyB0aGlzLnRpbWVvdXQgKyAnIG1zKScpXG4gICAgICAgICAgICAgICAgdGhyb3cgZVxuICAgICAgICAgICAgfSlcbi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JylcblxuICAgICAgICAgICAgICAgICAgICBpZiAoY2FtZWxjYXNlU3VmZml4LmluZGV4T2YgKGNhbWVsY2FzZU1ldGhvZCkgPT09IDApXG4gICAgICAgICAgICAgICAgICAgICAgICBjYW1lbGNhc2VTdWZmaXggPSBjYW1lbGNhc2VTdWZmaXguc2xpY2UgKGNhbWVsY2FzZU1ldGhvZC5sZW5ndGgpXG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKHVuZGVyc2NvcmVTdWZmaXguaW5kZXhPZiAobG93ZXJjYXNlTWV0aG9kKSA9PT0gMClcbiAgICAgICAgICAgICAgICAgICAgICAgIHVuZGVyc2NvcmVTdWZmaXggPSB1bmRlcnNjb3JlU3VmZml4LnNsaWNlIChsb3dlcmNhc2VNZXRob2QubGVuZ3RoKVxuXG4gICAgICAgICAgICAgICAgICAgIGxldCBjYW1lbGNhc2UgID0gdHlwZSArIGNhbWVsY2FzZU1ldGhvZCArIHRoaXMuY2FwaXRhbGl6ZSAoY2FtZWxjYXNlU3VmZml4KVxuICAgICAgICAgICAgICAgICAgICBsZXQgdW5kZXJzY29yZSA9IHR5cGUgKyAnXycgKyBsb3dlcmNhc2VNZXRob2QgKyAnXycgKyB1bmRlcnNjb3JlU3VmZml4XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCdzdWZmaXhlcycgaW4gb3B0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCdjYW1lbGNhc2UnIGluIG9wdGlvbnNbJ3N1ZmZpeGVzJ10pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FtZWxjYXNlICs9IG9wdGlvbnNbJ3N1ZmZpeGVzJ11bJ2NhbWVsY2FzZSddXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJ3VuZGVyc2NvcmUnIGluIG9wdGlvbnMuc3VmZml4ZXMpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5kZXJzY29yZSArPSBvcHRpb25zWydzdWZmaXhlcyddWyd1bmRlcnNjb3JlJ11cbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmICgndW5kZXJzY29yZV9zdWZmaXgnIGluIG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgICAgICAgICB1bmRlcnNjb3JlICs9IG9wdGlvbnMudW5kZXJzY29yZVN1ZmZpeDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCdjYW1lbGNhc2Vfc3VmZml4JyBpbiBvcHRpb25zKVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FtZWxjYXNlICs9IG9wdGlvbnMuY2FtZWxjYXNlU3VmZml4O1xuXG4gICAgICAgICAgICAgICAgICAgIGxldCBwYXJ0aWFsID0gYXN5bmMgcGFyYW1zID0+IHRoaXNbbWV0aG9kTmFtZV0gKHVybCwgdHlwZSwgdXBwZXJjYXNlTWV0aG9kLCBwYXJhbXMgfHwge30pXG5cbiAgICAgICAgICAgICAgICAgICAgdGhpc1tjYW1lbGNhc2VdICA9IHBhcnRpYWxcbiAgICAgICAgICAgICAgICAgICAgdGhpc1t1bmRlcnNjb3JlXSA9IHBhcnRpYWxcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmZXRjaCAodXJsLCBtZXRob2QgPSAnR0VUJywgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuXG4gICAgICAgIGlmIChpc05vZGUgJiYgdGhpcy51c2VyQWdlbnQpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgdGhpcy51c2VyQWdlbnQgPT0gJ3N0cmluZycpXG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IGV4dGVuZCAoeyAnVXNlci1BZ2VudCc6IHRoaXMudXNlckFnZW50IH0sIGhlYWRlcnMpXG4gICAgICAgICAgICBlbHNlIGlmICgodHlwZW9mIHRoaXMudXNlckFnZW50ID09ICdvYmplY3QnKSAmJiAoJ1VzZXItQ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ICAgICAgICByZXR1cm4gYm9keVxuICAgICAgICBsZXQgZXJyb3IgPSB1bmRlZmluZWRcbiAgICAgICAgdGhpcy5sYXN0X2h0dHBfcmVzcG9uc2UgPSBib2R5XG4gICAgICAgIGxldCBkZXRhaWxzID0gYm9keVxuICAgICAgICBsZXQgbWF0Y2ggPSBib2R5Lm1hdGNoICgvXFw8dGl0bGVcXD4oW148XSspL2kpXG4gICAgICAgIGlmIChtYXRjaClcbiAgICAgICAgICAgIGRldGFpbHMgPSBtYXRjaFsxXS50cmltICgpO1xuICAgICAgICBpZiAoWyA0MTgsIDQyOSBdLmluY2x1ZGVzIChjb2RlKSkge1xuICAgICAgICAgICAgZXJyb3IgPSBERG9TUHJvdGVjdGlvblxuICAgICAgICB9IGVsc2UgaWYgKFsgNDA0LCA0MDksIDQyMiwgNTAwLCA1MDEsIDUwMiwgNTIwLCA1MjEsIDUyMiwgNTI1IF0uaW5jbHVkZXMgKGNvZGUpKSB7XG4gICAgICAgICAgICBlcnJvciA9IEV4Y2hhbmdlTm90QXZhaWxhYmxlXG4gICAgICAgIH0gZWxzZSBpZiAoWyA0MDAsIDQwMywgNDA1LCA1MDMsIDUzMCBdLmluY2x1ZGVzIChjb2RlKSkge1xuICAgICAgICAgICAgbGV0IGRkb3NQcm90ZWN0aW9uID0gYm9keS5tYXRjaCAoL2Nsb3VkZmxhcmV8aW5jYXBzdWxhL2kpXG4gICAgICAgICAgICBpZiAoZGRvc1Byb3RlY3Rpb24pIHtcbiAgICAgICAgICAgICAgICBlcnJvciA9IEREb1NQcm90ZWN0aW9uXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGVycm9yID0gRXhjaGFuZ2VOb3RBdmFpbGFibGVcbiAgICAgICAgICAgICAgICBkZXRhaWxzICs9ICcgKHBvc3NpYmxlIHJlYXNvbnM6ICcgKyBbXG4gICAgICAgICAgICAgICAgICAgICdpbnZhbGlkIEFQSSBrZXlzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2JhZCBvciBvbGQgbm9uY2UnLFxuICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UgaXMgZG93biBvciBvZmZsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgJ29uIG1haW50ZW5hbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgJ0REb1MgcHJvdGVjdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICdyYXRlLWxpbWl0aW5nJyxcbiAgICAgICAgICAgICAgICBdLmpvaW4gKCcsICcpICsgJyknXG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAoWyA0MDgsIDUwNCBdLmluY2x1ZGVzIChjb2RlKSkge1xuICAgICAgICAgICAgZXJyb3IgPSBSZXF1ZXN0VGltZW91dFxuICAgICAgICB9IGVsc2UgaWYgKFsgNDAxLCA1MTEgXS5pbmNsdWRlcyAoY29kZSkpIHtcbiAgICAgICAgICAgIGVycm9yID0gQXV0aGVudGljYXRpb25FcnJvclxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZXJyb3IgPSBFeGNoYW5nZUVycm9yXG4gICAgICAgIH1cbiAgICAgICAgdGhyb3cgbmV3IGVycm9yIChbIHRoaXMuaWQsIG1ldGhvZCwgdXJsLCBjb2RlLCByZWFzb24sIGRldGFpbHMgXS5qb2luICgnICcpKVxuICAgIH1cblxuICAgIGhhbmRsZVJlc3RFcnJvcnMgKHJlc3BvbnNlLCB1cmwsIG1ldGhvZCA9ICdHRVQnLCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG5cbiAgICAgICAgaWYgKHR5cGVvZiByZXNwb25zZSA9PT0gJ3N0cmluZycpXG4gICAgICAgICAgICByZXR1cm4gcmVzcG9uc2VcblxuICAgICAgICByZXR1cm4gcmVzcG9uc2UudGV4dCAoKS50aGVuICh0ZXh0ID0+IHtcblxuICAgICAgICAgICAgY29uc3QgYXJncyA9IFsgcmVzcG9uc2Uuc3RhdHVzLCByZXNwb25zZS5zdGF0dXNUZXh0LCB1cmwsIG1ldGhvZCwgaGVhZGVycywgdGV4dCBdXG5cbiAgICAgICAgICAgIHRoaXMuaGFuZGxlRXJyb3JzICguLi5hcmdzKVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuZGVmYXVsdEVycm9ySGFuZGxlciAoLi4uYXJncylcbiAgICAgICAgfSlcbiAgICB9XG5cbiAgICBoYW5kbGVSZXN0UmVzcG9uc2UgKHJlc3BvbnNlLCB1cmwsIG1ldGhvZCA9ICdHRVQnLCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG5cbiAgICAgICAgdHJ5IHtcblxuICAgICAgICAgICAgdGhpcy5sYXN0X2h0dHBfcmVzcG9uc2UgPSByZXNwb25zZVxuICAgICAgICAgICAgaWYgKHRoaXMucGFyc2VKc29uUmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmxhc3RfanNvbl9yZXNwb25zZSA9XG4gICAgICAgICAgICAgICAgICAgICgodHlwZW9mIHJlc3BvbnNlID09PSAnc3RyaW5nJykgJiYgKHJlc3BvbnNlLmxlbmd0aCA+IDEpKSA/XG4gICAgICAgICAgICAgICAgICAgICAgICBKU09OLnBhcnNlIChyZXNwb25zZSkgOiByZXNwb25zZVxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmxhc3RfanNvbl9yZXNwb25zZVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gcmVzcG9uc2VcblxuICAgICAgICB9IGNhdGNoIChlKSB7XG5cbiAgICAgICAgICAgIGxldCBtYWludGVuYW5jZSA9IHJlc3BvbnNlLm1hdGNoICgvb2ZmbGluZXxidXN5fHJldHJ5fHdhaXR8dW5hdmFpbGFibGV8bWFpbnRhaW58bWFpbnRlbmFuY2V8bWFpbnRlbmFuY2luZy9pKVxuICAgICAgICAgICAgbGV0IGRkb3NQcm90ZWN0aW9uID0gcmVzcG9uc2UubWF0Y2ggKC9jbG91ZGZsYXJlfGluY2Fwc3VsYXxvdmVybG9hZC9pKVxuXG4gICAgICAgICAgICBpZiAoZSBpbnN0YW5jZW9mIFN5bnRheEVycm9yKSB7XG5cbiAgICAgICAgICAgICAgICBsZXQgZXJyb3IgPSBFeGNoYW5nZU5vdEF2YWlsYWJsZVxuICAgICAgICAgICAgICAgIGxldCBkZXRhaWxzID0gJ25vdCBhY2Nlc3NpYmxlIGZyb20gdGhpcyBsb2NhdGlvbiBhdCB0aGUgbW9tZW50J1xuICAgICAgICAgICAgICAgIGlmIChtYWludGVuYW5jZSlcbiAgICAgICAgICAgICAgICAgICAgZGV0YWlscyA9ICdvZmZsaW5lLCBvbiBtYWludGVuYW5jZSBvciB1bnJlYWNoYWJsZSBmcm9tIHRoaXMgbG9jYXRpb24gYXQgdGhlIG1vbWVudCdcbiAgICAgICAgICAgICAgICBpZiAoZGRvc1Byb3RlY3Rpb24pXG4gICAgICAgICAgICAgICAgICAgIGVycm9yID0gRERvU1Byb3RlY3Rpb25cbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgZXJyb3IgKFsgdGhpcy5pZCwgbWV0aG9kLCB1cmwsIGRldGFpbHMgXS5qb2luICgnICcpKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy52ZXJib3NlKVxuICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nICh0aGlzLmlkLCBtZXRob2QsIHVybCwgJ2Vycm9yJywgZSwgXCJyZXNwb25zZSBib2R5OlxcbidcIiArIHJlc3BvbnNlICsgXCInXCIpXG5cbiAgICAgICAgICAgIHRocm93IGVcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHNldE1hcmtldHMgKG1hcmtldHMsIGN1cnJlbmNpZXMgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHZhbHVlcyA9IE9iamVjdC52YWx1ZXMgKG1hcmtldHMpLm1hcCAobWFya2V0ID0+IGRlZXBFeHRlbmQgKHtcbiAgICAgICAgICA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bWFya2V0LnByZWNpc2lvbi5hbW91bnQpIDogOCxcbiAgICAgICAgICAgICAgICAgICAgfSkpXG4gICAgICAgICAgICBjb25zdCBxdW90ZUN1cnJlbmNpZXMgPVxuICAgICAgICAgICAgICAgIHZhbHVlcy5maWx0ZXIgKG1hcmtldCA9PiAncXVvdGUnIGluIG1hcmtldClcbiAgICAgICAgICAgICAgICAgICAgLm1hcCAobWFya2V0ID0+ICh7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogbWFya2V0LnF1b3RlSWQgfHwgbWFya2V0LnF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29kZTogbWFya2V0LnF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uOiBtYXJrZXQucHJlY2lzaW9uID8gKG1hcmtldC5wcmVjaXNpb24ucXVvdGUgfHwgbWFya2V0LnByZWNpc2lvbi5wcmljZSkgOiA4LFxuICAgICAgICAgICAgICAgICAgICB9KSlcbiAgICAgICAgICAgIGNvbnN0IGFsbEN1cnJlbmNpZXMgPSBiYXNlQ3VycmVuY2llcy5jb25jYXQgKHF1b3RlQ3VycmVuY2llcylcbiAgICAgICAgICAgIGNvbnN0IGdyb3VwZWRDdXJyZW5jaWVzID0gZ3JvdXBCeSAoYWxsQ3VycmVuY2llcywgJ2NvZGUnKVxuICAgICAgICAgICAgY29uc3QgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChncm91cGVkQ3VycmVuY2llcykubWFwIChjb2RlID0+XG4gICAgICAgICAgICAgICAgZ3JvdXBlZEN1cnJlbmNpZXNbY29kZV0ucmVkdWNlICgocHJldmlvdXMsIGN1cnJlbnQpID0+XG4gICAgICAgICAgICAgICAgICAgICgocHJldmlvdXMucHJlY2lzaW9uID4gY3VycmVudC5wcmVjaXNpb24pID8gcHJldmlvdXMgOiBjdXJyZW50KSwgZ3JvdXBlZEN1cnJlbmNpZXNbY29kZV1bMF0pKVxuICAgICAgICAgICAgY29uc3Qgc29ydGV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gICAgICByZXR1cm4gJ0JUQydcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCQ0MnKVxuICAgICAgICAgICAgcmV0dXJuICdCQ0gnXG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnRFJLJylcbiAgICAgICAgICAgIHJldHVybiAnREFTSCdcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5XG4gICAgfVxuXG4gICAgY3VycmVuY3kgKGNvZGUpIHtcblxuICAgICAgICBpZiAodHlwZW9mIHRoaXMuY3VycmVuY2llcyA9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHJldHVybiBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgY3VycmVuY2llcyBub3QgbG9hZGVkJylcblxuICAgICAgICBpZiAoKHR5cGVvZiBjb2RlID09PSAnc3RyaW5nJykgJiYgKGNvZGUgaW4gdGhpcy5jdXJyZW5jaWVzKSlcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmN1cnJlbmNpZXNbY29kZV1cblxuICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZG9lcyBub3QgaGF2ZSBjdXJyZW5jeSBjb2RlICcgKyBjb2RlKVxuICAgIH1cblxuXG4gICAgbWFya2V0IChzeW1ib2wpIHtcblxuICAgICAgICBpZiAodHlwZW9mIHRoaXMubWFya2V0cyA9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHJldHVybiBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgbWFya2V0cyBub3QgbG9hZGVkJylcblxuICAgICAgICBpZiAoKHR5cGVvZiBzeW1ib2wgPT09ICdzdHJpbmcnKSAmJiAoc3ltYm9sIGluIHRoaXMubWFya2V0cykpXG4gICAgICAgICAgICByZXR1cm4gdGhpcy5tYXJrZXRzW3N5bWJvbF1cblxuICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZG9lcyBub3QgaGF2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mVtYWluaW5nJ11cbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSA9PSBtYXJrZXRbJ2Jhc2UnXSAmJiBvcmRlclsnc2lkZSddID09ICdzZWxsJykge1xuICAgICAgICAgICAgICAgIHJldHVybiB0b3RhbCArIGFtb3VudFxuICAgICAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSBtYXJrZXRbJ3F1b3RlJ10gJiYgb3JkZXJbJ3NpZGUnXSA9PSAnYnV5Jykge1xuICAgICAgICAgICAgICAgIHJldHVybiB0b3RhbCArIChvcmRlclsnY29zdCddIHx8IChvcmRlclsncHJpY2UnXSAqIGFtb3VudCkpXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB0b3RhbFxuICAgICAgICAgICAgfVxuICAgICAgICB9LCAwKVxuICAgIH1cblxuICAgIHBhcnNlQmFsYW5jZSAoYmFsYW5jZSkge1xuXG4gICAgICAgIGNvbnN0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAodGhpcy5vbWl0IChiYWxhbmNlLCAnaW5mbycpKTtcblxuICAgICAgICBjdXJyZW5jaWVzLmZvckVhY2ggKGN1cnJlbmN5ID0+IHtcblxuICAgICAgICAgICAgaWYgKHR5cGVvZiBiYWxhbmNlW2N1cnJlbmN5XS51c2VkID09ICd1bmRlZmluZWQnKSB7XG5cbiAgICAgICAgICAgICAgICBpZiAodGhpcy5wYXJzZUJhbGFuY2VGcm9tT3Blbk9yZGVycyAmJiAoJ29wZW5fb3JkZXJzJyBpbiBiYWxhbmNlWydpbmZvJ10pKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGV4Y2hhbmdlT3JkZXJzQ291bnQgPSBiYWxhbmNlWydpbmZvJ11bJ29wZW5fb3JkZXJzJ107XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNhY2hlZE9yZGVyc0NvdW50ID0gT2JqZWN0LnZhbHVlcyAodGhpcy5vcmRlcnMpLmZpbHRlciAob3JkZXIgPT4gKG9yZGVyWydzdGF0dXMnXSA9PSAnb3BlbicpKS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjYWNoZWRPcmRlcnNDb3VudCA9PSBleGNoYW5nZU9yZGVyc0NvdW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBiYWxhbmNlW2N1cnJlbmN5XS51c2VkID0gdGhpcy5nZXRDdXJyZW5jeVVzZWRPbk9wZW5PcmRlcnMgKGN1cnJlbmN5KVxuICAgICAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVtjdXJyZW5jeV0udG90YWwgPSBiYWxhbmNlW2N1cnJlbmN5XS51c2VkICsgYmFsYW5jZVtjdXJyZW5jeV0uZnJlZVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVtjdXJyZW5jeV0udXNlZCA9IHRoaXMuZ2V0Q3VycmVuY3lVc2VkT25PcGVuT3JkZXJzIChjdXJyZW5jeSlcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVtjdXJyZW5jeV0udG90YWwgPSBiYWxhbmNlW2N1cnJlbmN5XS51c2VkICsgYmFsYW5jZVtjdXJyZW5jeV0uZnJlZVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgWyAnZnJlZScsICd1c2VkJywgJ3RvdGFsJyBdLmZvckVhY2ggKGFjY291bnQgPT4ge1xuICAgICAgICAgICAgICAgIGJhbGFuY2VbYWNjb3VudF0gPSBiYWxhbmNlW2FjY291bnRdIHx8IHt9XG4gICAgICAgICAgICAgICAgYmFsYW5jZVthY2NvdW50XVtjdXJyZW5jeV0gPSBiYWxhbmNlW2N1cnJlbmN5XVthY2NvdW50XVxuICAgICAgICAgICAgfSlcbiAgICAgICAgfSlcblxuICAgICAgICByZXR1cm4gYmFsYW5jZVxuICAgIH1cblxuICAgIGFzeW5jIGZldGNoU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nLScgKyBtICsgJy0nICsgZFxuICAgIH1cblxuICAgIFltZEhNUyAodGltZXN0YW1wLCBpbmZpeCA9ICcgJykge1xuICAgICAgICBsZXQgZGF0ZSA9IG5ldyBEYXRlICh0aW1lc3RhbXApXG4gICAgICAgIGxldCBZID0gZGF0ZS5nZXRVVENGdWxsWWVhciAoKVxuICAgICAgICBsZXQgbSA9IGRhdGUuZ2V0VVRDTW9udGggKCkgKyAxXG4gICAgICAgIGxldCBkID0gZGF0ZS5nZXRVVENEYXRlICgpXG4gICAgICAgIGxldCBIID0gZGF0ZS5nZXRVVENIb3VycyAoKVxuICAgICAgICBsZXQgTSA9IGRhdGUuZ2V0VVRDTWludXRlcyAoKVxuICAgICAgICBsZXQgUyA9IGRhdGUuZ2V0VVRDU2Vjb25kcyAoKVxuICAgICAgICBtID0gbSA8IDEwID8gKCcwJyArIG0pIDogbVxuICAgICAgICBkID0gZCA8IDEwID8gKCcwJyArIGQpIDogZFxuICAgICAgICBIID0gSCA8IDEwID8gKCcwJyArIEgpIDogSFxuICAgICAgICBNID0gTSA8IDEwID8gKCcwJyArIE0pIDogTVxuICAgICAgICBTID0gUyA8IDEwID8gKCcwJyArIFMpIDogU1xuICAgICAgICByZXR1cm4gWSArICctJyArIG0gKyAnLScgKyBkICsgaW5maXggKyBIICsgJzonICsgTSArICc6JyArIFNcbiAgICB9XG59XG4iLCJcInVzZSBzdHJpY3RcIjtcblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBNYXJrZXQge1xuXG4gICAgY29uc3RydWN0b3IgKGV4Y2hhbmdlLCBzeW1ib2wpIHtcbiAgICAgICAgdGhpcy5leGNoYW5nZSA9IGV4Y2hhbmdlO1xuICAgICAgICB0aGlzLnN5bWJvbCA9IHN5bWJvbDtcbiAgICAgICAgdGhpcy5tYXJrZXQgPSBleGNoYW5nZS5tYXJrZXRzW3N5bWJvbF07XG4gICAgfVxuXG4gICAgYW1vdW50VG9QcmVjaXNpb24gKGFtb3VudCkge1xuICAg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gYXJnIG9mIGFyZ3MpIHtcblxuICAgICAgICBpZiAoYXJnICYmICh0eXBlb2YgYXJnID09PSAnb2JqZWN0JykgJiYgKGFyZy5jb25zdHJ1Y3RvciA9PT0gT2JqZWN0IHx8ICEoJ2NvbnN0cnVjdG9yJyBpbiBhcmcpKSkge1xuXG4gICAgICAgICAgICBpZiAodHlwZW9mIHJlc3VsdCAhPT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICByZXN1bHQgPSB7fVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmb3IgKGNvbnN0IGtleSBpbiBhcmcpIHtcbiAgICAgICAgICAgICAgICByZXN1bHRba2V5XSA9IGRlZXBFeHRlbmQgKHJlc3VsdFtrZXldLCBhcmdba2V5XSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICB9IGVsc2Uge1xuXG4gICAgICAgICAgICByZXN1bHQgPSBhcmdcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiByZXN1bHRcbn1cblxuY29uc3Qgb21pdCA9IChvYmplY3QsIC4uLmFyZ3MpID0+IHtcbiAgICBjb25zdCByZXN1bHQgPSBleHRlbmQgKG9iamVjdClcbiAgICBmb3IgKGNvbnN0IHggb2YgYXJncykge1xuICAgICAgICBpZiAodHlwZW9mIHggPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICBkZWxldGUgcmVzdWx0W3hdXG4gICAgICAgIH0gZWxzZSBpZiAoQXJyYXkuaXNBcnJheSAoeCkpIHtcbiAgICAgICAgICAgIGZvciAoY29uc3QgayBvZiB4KVxuICAgICAgICAgICAgICAgIGRlbGV0ZSByZXN1bHRba11cbiAgICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gcmVzdWx0XG59XG5cbmNvbnN0IGdyb3VwQnkgPSAoYXJyYXksIGtleSkgPT4ge1xuICAgIGNvbnN0IHJlc3VsdCA9IHt9XG4gICAgT2JqZWN0XG4gICAgICAgIC52YWx1ZXMgKGFycmF5KVxuICAgICAgICA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pZ24gKGNvc3QgPT4ge1xuXG4gICAgICAgIGlmIChxdWV1ZS5sZW5ndGggPiBjZmcubWF4Q2FwYWNpdHkpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IgKCdCYWNrbG9nIGlzIG92ZXIgbWF4IGNhcGFjaXR5IG9mICcgKyBjZmcubWF4Q2FwYWNpdHkpXG5cbiAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlIChhc3luYyAocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG5cbiAgICAgICAgICAgIHRyeSB7XG5cbiAgICAgICAgICAgICAgICBxdWV1ZS5wdXNoICh7IGNvc3QsIHJlc29sdmUsIHJlamVjdCB9KVxuXG4gICAgICAgICAgICAgICAgaWYgKCFydW5uaW5nKSB7XG4gICAgICAgICAgICAgICAgICAgIHJ1bm5pbmcgPSB0cnVlXG4gICAgICAgICAgICAgICAgICAgIHdoaWxlIChxdWV1ZS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBoYXNFbm91Z2hUb2tlbnMgPSBjZmcuY2FwYWNpdHkgPyAobnVtVG9rZW5zID4gMCkgOiAobnVtVG9rZW5zID49IDApXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGFzRW5vdWdoVG9rZW5zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHF1ZXVlLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHsgY29zdCwgcmVzb2x2ZSwgcmVqZWN0IH0gPSBxdWV1ZVswXVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3N0ID0gKGNvc3QgfHwgY2ZnLmRlZmF1bHRDb3N0KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobnVtVG9rZW5zID49IE1hdGgubWluIChjb3N0LCBjZmcuY2FwYWNpdHkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1Ub2tlbnMgLT0gY29zdFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVldWUuc2hpZnQgKClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUgKClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBub3cgPSBEYXRlLm5vdyAoKVxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGVsYXBzZWQgPSBub3cgLSBsYXN0VGltZXN0YW1wXG4gICAgICAgICAgICAgICAgICAgICAgICBsYXN0VGltZXN0YW1wID0gbm93XG4gICAgICAgICAgICAgICAgICAgICAgICBudW1Ub2tlbnMgPSBNYXRoLm1pbiAoY2ZnLmNhcGFjaXR5LCBudW1Ub2tlbnMgKyBlbGFwc2VkICogY2ZnLnJlZmlsbFJhdGUpXG4gICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBzbGVlcCAoY2ZnLmRlbGF5KVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJ1bm5pbmcgPSBmYWxzZVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuXG4gICAgICAgICAgICAgICAgcmVqZWN0IChlKVxuICAgICAgICAgICAgfVxuICAgICAgICB9KVxuXG4gICAgfSwgY2ZnLCB7XG4gICAgICAgIGNvbmZpZ3VyZTogbmV3Q2ZnID0+IHRocm90dGxlIChPYmplY3QuYXNzaWduICh7fSwgY2ZnLCBuZXdDZmcpKVxuICAgIH0pXG59XG5cbm1vZHVsZS5leHBvcnRzID0gdGhyb3R0bGVcbiIsIlwidXNlIHN0cmljdFwiO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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AgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoQmFsYW5jZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtaW4nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bWluJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bWluJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbWluJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMWhvdXInLFxuICAgICAgICAgICAgICAgICc4aCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICdkYXknLFxuICAgICAgICAgICAgICAgICcxdyc6ICd3ZWVrJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM0OTAyNjExLTJiZThiZjFhLWY4MzAtMTFlNy05MWEyLTExYjJmMjkyZTc1MC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuYmlib3guY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpYm94LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vQmlib3hjb20vYXBpX3JlZmVyZW5jZS93aWtpL2hvbWVfZW4nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYmlib3guemVuZGVzay5jb20vaGMvZW4tdXMvYXJ0aWNsZXMvMTE1MDA0NDE3MDEzLUZlZS1TdHJ1Y3R1cmUtb24tQmlib3gnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiByZXdvcmsgZm9yIGZ1bGwgZW5kcG9pbnQvY21kIHBhdGhzIGhlcmVcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZGF0YScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJwZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JzogMC4wLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY1Bvc3RNZGF0YSAoe1xuICAgICAgICAgICAgJ2NtZCc6ICdhcGkvbWFya2V0QWxsJyxcbiAgICAgICAgICAgICdib2R5Jzoge30sXG4gICAgICAgIH0pO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ2NvaW5fc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ2N1cnJlbmN5X3N5bWJvbCddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgaWQgPSBiYXNlICsgJ18nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSk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gYXdhaXQgdGhpcy5wdWJsaWNQb3N0TWRhdGEgKHtcbiAgICAgICAgICAgICdjbWQnOiAnYXBpL21hcmtldEFsbCcsXG4gICAgICAgICAgICAnYm9keSc6IHt9LFxuICAgICAgICB9KTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgdCA9IDA7IHQgPCB0aWNrZXJzLmxlbmd0aDsgdCsrKSB7XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2Vyc1t0XSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gdGlja2VyWydzeW1ib2wnXTtcbiAgICAgICAgICAgIGlmIChzeW1ib2xzICYmICghKHN5bWJvbCBpbiBzeW1ib2xzKSkpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGlja2VyO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ3RpbWUnXTtcbiAgICAgICAgbGV0IHNpZGUgPSAodHJhZGVbJ3NpZGUnXSA9PT0gJzEnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydhbW91bnQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHNpemUgPSAobGltaXQpID8gbGltaXQgOiAyMDA7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljUG9zdE1kYXRhICh7XG4gICAgICAgICAgICAnY21kJzogJ2FwaS9kZWFscycsXG4gICAgICAgICAgICAnYm9keSc6IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3BhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAgICAgJ3NpemUnOiBzaXplLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSxcbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZVsncmVzdWx0J10sIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRo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xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IDg7XG4gICAgICAgICAgICBsZXQgZGVwb3NpdCA9IGN1cnJlbmN5WydlbmFibGVfZGVwb3NpdCddO1xuICAgICAgICAgICAgbGV0IHdpdGhkcmF3ID0gY3VycmVuY3lbJ2VuYWJsZV93aXRoZHJhdyddO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChkZXBvc2l0ICYmIHdpdGhkcmF3KTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WyduYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYW5zZmVyICh7XG4gICAgICAgICAgICAnY21kJzogJ3RyYW5zZmVyL2Fzc2V0cycsXG4gICAgICAgICAgICAnYm9keSc6IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3NlbGVjdCc6IDEsXG4gICAgICAgICAgICB9LCBwYXJhbXMpLFxuICAgICAgICB9KTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBpbmRleGVkID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2Fzc2V0c19saXN0JyBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgaW5kZXhlZCA9IHRoaXMuaW5kZXhCeSAoYmFsYW5jZXNbJ2Fzc2V0c19saXN0J10sICdjb2luX3N5bWJvbCcpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaW5kZXhlZCA9IHt9O1xuICAgICAgICB9XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKGluZGV4ZWQpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGtleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNbaV07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGluZGV4ZWRbaWRdO1xuICAgICAgICAgICAgbGV0IHVzZWQgPSBwYXJzZUZsb2F0IChiYWxhbmNlWydmcmVlemUnXSk7XG4gICAgICAgICAgICBsZXQgZnJlZSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2JhbGFuY2UnXSk7XG4gICAgICAgICAgICBsZXQgdG90YWwgPSB0aGlzLnN1bSAoZnJlZSwgdXNlZCk7XG4gICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBmcmVlO1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gdXNlZDtcbiAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSB0b3RhbDtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlclR5cGUgPSAodHlwZSA9PT0gJ2xpbWl0JykgPyAyIDogMTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE9yZGVyICh7XG4gICAgICAgICAgICAnY21kJzogJ29yZGVycGVuZGluZy90cmFkZScsXG4gICAgICAgICAgICAnYm9keSc6IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3BhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAgICAgJ2FjY291bnRfdHlwZSc6IDAsXG4gICAgICAgICAgICAgICAgJ29yZGVyX3R5cGUnOiBvcmRlclR5cGUsXG4gICAgICAgICAgICAgICAgJ29yZGVyX3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgICAgICdwYXlfYml4JzogMCxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSxcbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ3Jlc3VsdCcpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0Q2FuY2VsT3JkZXIgKHtcbiAgICAgICAgICAgICdjbWQnOiAnb3JkZXJwZW5kaW5nL2NhbmNlbFRyYWRlJyxcbiAgICAgICAgICAgICdib2R5JzogdGhpc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XMgKG9yZGVyWydzdGF0dXMnXSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKG9yZGVyLCAnaWQnKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBwcmljZSAqIGZpbGxlZCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdmZWUnOiB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdmZWUnKSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyU3RhdHVzIChzdGF0dXMpIHtcbiAgICAgICAgbGV0IHN0YXR1c2VzID0ge1xuICAgICAgICAgICAgJzEnOiAncGVuZGluZycsXG4gICAgICAgICAgICAnMic6ICdvcGVuJyxcbiAgICAgICAgICAgICczJzogJ2Nsb3NlZCcsXG4gICAgICAgICAgICAnNCc6ICdjYW5jZWxlZCcsXG4gICAgICAgICAgICAnNSc6ICdjYW5jZWxlZCcsXG4gICAgICAgICAgICAnNic6ICdjYW5jZWxlZCcsXG4gICAgICAgIH07XG4gICAgICAgI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W5kICh7XG4gICAgICAgICAgICAgICAgJ2NvaW5fc3ltYm9sJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICAgICAnYWRkcic6IGFkZHJlc3MsXG4gICAgICAgICAgICAgICAgJ2FkZHJfcmVtYXJrJzogJycsXG4gICAgICAgICAgICB9LCBwYXJhbXMpLFxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGxldCBjbWRzID0gdGhpcy5qc29uIChbIHBhcmFtcyBdKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGJvZHkgPSB7XG4gICAgICAgICAgICAgICAgJ2NtZHMnOiBjbWRzLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgYm9keSA9IHtcbiAgICAgICAgICAgICAgICAnY21kcyc6IGNtZHMsXG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoY21kcyksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdtZDUnKSxcbiA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KCksIHtcbiAgICAgICAgICAgICdpZCc6ICdiaW5hbmNlJyxcbiAgICAgICAgICAgICduYW1lJzogJ0JpbmFuY2UnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdKUCcsIC8vIEphcGFuXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogNTAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgIC8vIG9ic29sZXRlIG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhc0ZldGNoRnVsbFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgLy8gbmV3IG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hGdWxsVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzNtJzogJzNtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMmgnLFxuICAgICAgICAgICAgICAgICc0aCc6ICc0aCcsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnOGgnOiAnOGgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgICAgICczZCc6ICczZCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzF3JyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjk2MDQwMjAtZDU0ODNjZGMtODdlZS0xMWU3LTk0YzctZDFhOGQ5MTY5MjkzLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL3d3dy5iaW5hbmNlLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICd3YXBpJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL3dhcGkvdjMnLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL2FwaS92MScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL2FwaS92MycsXG4gICAgICAgICAgICAgICAgICAgICd2Myc6ICdodHRwczovL2FwaS5iaW5hbmNlLmNvbS9hcGkvdjMnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaW5hbmNlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vYmluYW5jZS1leGNoYW5nZS9iaW5hbmNlLW9mZmljaWFsLWFwaS1kb2NzL2Jsb2IvbWFzdGVyL3Jlc3QtYXBpLm1kJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYmluYW5jZS56ZW5kZXNrLmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDA0MjkzMzInLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9zdXBwb3J0LmJpbmFuY2UuY29tL2hjL2VuLXVzL2FydGljbGVzLzExNTAwMDU4MzMxMScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3ZWInOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvcHVibGljL3Byb2R1Y3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3dhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0SGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndjMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3ByaWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvYm9va1RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlSW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGltZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FnZ1RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvMjRocicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL2FsbFByaWNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL2FsbEJvb2tUaWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvcHJpY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci9ib29rVGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbGxPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3Rlc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJEYXRhU3RyZWFtJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyRGF0YVN0cmVhbScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJEYXRhU3RyZWFtJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOQic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOVCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk5UJzogMS4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0FTJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAyNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09BWCc6IDYuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlQnOiA2MC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DTyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMC40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAxMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUUkFUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOR0xTJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUVgnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS05DJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDgwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSU5LJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYVkcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RSJzogNy4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NBTFQnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU9UQSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNREEnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRMJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVQic6IDQuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDM1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5HJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FTVCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVlgnOiAyLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVRJzogMTUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMUkMnOiAxMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQic6IDIwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFNSJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDMwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9XUic6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUksnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWU9ZTyc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4xNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNT0QnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5KJzogODAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVE9SSic6IDMuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS01EJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05VTFMnOiA0LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkNOJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRE4nOiAwLjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETFQnOiAxNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNQic6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFUJzogMTUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ1BUJzogMTQuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUk4nOiA3LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1ZUJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEVCc6IDM1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1hTJzogMC4zLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPRSc6IDUwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVNQJzogMzAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVFMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFpDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMU0snOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5UJzogMzUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVUVMJzogNjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQU5BJzogMzAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0QnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdEJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRFgnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQURBJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTVQnOiAxNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hMTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05EJzogMTgwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEVORCc6IDUwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0FCSSc6IDQuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTkInOiA3MC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dBVkVTJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNYJzogMS41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dUTyc6IDMwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1NUJzogMTUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTEYnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUlPTic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORUJMJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUkQnOiAzLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMS41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dJTkdTJzogMy4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05BVic6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVU4nOiAwLjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJJRyc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQk5CJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0FTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPQVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUUkFUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlFYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLTkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSU5LJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYVkcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FMVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU9UQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTURBJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VORyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVNUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVRJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMUkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFNSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPV1InOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSSyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWU9ZTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNT0QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOSic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RPUkonOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEV4Y2hhbmdlSW5mbyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnc3ltYm9scyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnYmFzZUFzc2V0J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsncXVvdGVBc3NldCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgZmlsdGVycyA9IHRoaXMuaW5kZXhCeSAobWFya2V0WydmaWx0ZXJzJ10sICdmaWx0ZXJUeXBlJyk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdiYXNlJzogbWFya2V0WydiYXNlQXNzZXRQcmVjaXNpb24nXSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBtYXJrZXRbJ3F1b3RlUHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYmFzZUFzc2V0UHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydxdW90ZVByZWNpc2lvbiddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAobWFya2V0WydzdGF0dXMnXSA9PSAnVFJBRElORycpO1xuICAgICAgICAgICAgbGV0IGxvdCA9IC0xICogTWF0aC5sb2cxMCAocHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICBsZXQgZW50cnkgPSB0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAtMSAqIE1hdGgubG9nMTAgKHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlmICgnUFJJQ0VfRklMVEVSJyBpbiBmaWx0ZXJzKSB7XG4gICAgICAgICAgICAgICAgbGV0IGZpbHRlciA9IGZpbHRlcnNbJ1BSSUNFX0ZJTFRFUiddO1xuICAgICAgICAgICAgICAgIGVudHJ5WydwcmVjaXNpb24nXVsncHJpY2UnXSA9IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAoZmlsdGVyWyd0aWNrU2l6ZSddKTtcbiAgICAgICAgICAgICAgICBlbnRyeVsnbGltaXRzJ11bJ3ByaWNlJ10gPSB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChmaWx0ZXJbJ21pblByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogcGFyc2VGbG9hdCAoZmlsdGVyWydtYXhQcmljZSddKSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdMT1RfU0laRScgaW4gZmlsdGVycykge1xuICAgICAgICAgICAgICAgIGxldCBmaWx0ZXIgPSBmaWx0ZXJzWydMT1RfU0laRSddO1xuICAgICAgICAgICAgICAgIGVudHJ5WydwcmVjaXNpb24nXVsnYW1vdW50J10gPSB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKGZpbHRlclsnc3RlcFNpemUnXSk7XG4gICAgICAgICAgICAgICAgZW50cnlbJ2xvdCddID0gcGFyc2VGbG9hdCAoZmlsdGVyWydzdGVwU2l6ZSddKTtcbiAgICAgICAgICAgICAgICBlbnRyeVsnbGltaXRzJ11bJ2Ftb3VudCddID0ge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogcGFyc2VGbG9hdCAoZmlsdGVyWydtaW5RdHknXSksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiBwYXJzZUZsb2F0IChmaWx0ZXJbJ21heFF0eSddKSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdNSU5fTk9USU9OQUwnIGluIGZpbHRlcnMpIHtcbiAgICAgICAgICAgICAgICBlbnRyeVsnbGltaXRzJ11bJ2Nvc3QnXVsnbWluJ10gPSBwYXJzZUZsb2F0IChmaWx0ZXJzWydNSU5fTk9USU9OQUwnXVsnbWluTm90aW9uYWwnXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoZW50cnkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgY2FsY3VsYXRlRmVlIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UsIHRha2VyT3JNYWtlciA9ICd0YWtlcicsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNbc3ltYm9sXTtcbiAgICAgICAgbGV0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XQgdGltZXN0YW1wID0gdGhpcy5zYWZlSW50ZWdlciAodGlja2VyLCAnY2xvc2VUaW1lJyk7XG4gICAgICAgIGlmICh0eXBlb2YgdGltZXN0YW1wID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdGlja2VyWydzeW1ib2wnXTtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGlmIChzeW1ib2wgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3N5bWJvbF07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2hQcmljZScpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3dQcmljZScpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiaWRQcmljZScpLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2tQcmljZScpLFxuICAgICAgICAgICAgJ3Z3YXAnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnd2VpZ2h0ZWRBdmdQcmljZScpLFxuICAgICAgICAgIC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dxJyA6ICdxdHknO1xuICAgICAgICBsZXQgYW1vdW50ID0gcGFyc2VGbG9hdCAodHJhZGVbYW1vdW50RmllbGRdKTtcbiAgICAgICAgbGV0IGlkRmllbGQgPSAoJ2EnIGluIHRyYWRlKSA/ICdhJyA6ICdpZCc7XG4gICAgICAgIGxldCBpZCA9IHRyYWRlW2lkRmllbGRdLnRvU3RyaW5nICgpO1xuICAgICAgICBsZXQgc2lkZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IG9yZGVyID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ29yZGVySWQnIGluIHRyYWRlKVxuICAgICAgICAgICAgb3JkZXIgPSB0cmFkZVsnb3JkZXJJZCddLnRvU3RyaW5nICgpO1xuICAgICAgICBpZiAoJ20nIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBzaWRlID0gdHJhZGVbJ20nXSA/ICdzZWxsJyA6ICdidXknOyAvLyB0aGlzIGlzIHJldmVyc2VkIGludGVudGlvbmFsbHlcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHNpZGUgPSAodHJhZGVbJ2lzQnV5ZXInXSkgPyAnYnV5JyA6ICdzZWxsJzsgLy8gdGhpcyBpcyBhIHRydWUgc2lkZVxuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnY29tbWlzc2lvbicgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IHBhcnNlRmxvYXQgKHRyYWRlWydjb21taXNzaW9uJ10pLFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlICh0cmFkZVsnY29tbWlzc2lvbkFzc2V0J10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXIsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBwcmljZSAqIGFtb3VudCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH07XG4gICAgICAgIGlmIChzaW5jZSkge1xuICAgICAgICAgICAgcmVxdWVzdFsnc3RhcnRUaW1lJ10gPSBzaW5jZTtcbiAgICAgICAgICAgIHJlcXVlc3RbJ2VuZFRpbWUnXSA9IHNpbmNlICsgMzYwMDAwMDtcbiAgICAgICAgfVxuICAgICAgICBpZiAobGltaXQpXG4gICAgICAgICAgICByZXF1ZXN0WydsaW1pdCddID0gbGltaXQ7XG4gICAgICAgIC8vICdmcm9tSWQnOiAxMjMsICAgIC8vIElEIHRvIGdldCBhZ2dyZWdhdGUgd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W1haW5pbmcgPSBNYXRoLm1heCAoYW1vdW50IC0gZmlsbGVkLCAwLjApO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydvcmRlcklkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ3R5cGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3NpZGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6I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wYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLndhcGlHZXREZXBvc2l0QWRkcmVzcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdhc3NldCc6IHRoaXMuY3VycmVuY3lJZCAoY3VycmVuY3kpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydzdWNjZXNzJ10pIHtcbiAgICAgICAgICAgICAgICBsZXQgYWRkcmVzcyA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdhZGRyZXNzJyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgICAgICdhZGRyZXNzJzogYWRkcmVzcyxcbiAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZmV0Y2hEZXBvc2l0QWRkcmVzcyBmYWlsZWQ6ICcgKyB0aGlzLmxhc3RfaHR0cF9yZXNwb25zZSk7XG4gICAgfVxuXG4gICAgYXN5bmMgd2l0aGRyYXcgKGN1cnJlbmN5LCBhbW91bnQsIGFkZHJlc3MsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMud2FwaVBvc3RXaXRoZHJhdyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdhc3NldCc6IHRoaXMuY3VycmVuY3lJZCAoY3VycmVuY3kpLFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHBhcnNlRmxvYXQgKGFtb3VudCksXG4gICAgICAgICAgICAnbmFtZSc6IGFkZHJlc3MsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdpZCcpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXTtcbiAgICAgICAgdXJsICs9ICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT0gJ3dhcGknKVxuICAgICAgICAgICAgdXJsICs9ICcuaHRtbCc7XG4gICAgICAgIGlmICgoYXBpID09ICdwcml2YXRlJykgfHwgKGFwaSA9PSAnd2FwaScpKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdyZWN2V2luZG93JzogMTAwMDAwLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIHF1ZXJ5ICs9ICcmJyArICdzaWduYXR1cmU9JyArIHNpZ25hdHVyZTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ1gtTUJYLUFQSUtFWSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmICgobWV0aG9kID09ICdHRVQnKSB8fCAoYXBpID09ICd3YXBpJykpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGJvZHkgPSBxdWVyeTtcbiAgICAgICAgICAgICAgICBoZWFkZXJzWydDb250ZW50LVR5cGUnXSA9ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGNvZGUgPj0gNDAwKSB7XG4gICAgICAgICAgICBpZiAoY29kZSA9PSA0MTgpXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uICh0aGlzLmlkICsgJyAnICsgY29kZS50b1N0cmluZyAoKSArICcgJyArIHJlYXNvbiArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgaWYgKGJvZHkuaW5kZXhPZiAoJ1ByaWNlICogUVRZIGlzIHplcm8gb3IgbGVzcycpID49IDApXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgb3JkZXIgY29zdCA9IGFtb3VudCAqIHByaWNlIGlzIHplcm8gb3IgbGVzcyAnICsgYm9keSk7XG4gICAgICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnTUlOX05PVElPTkFMJykgPj0gMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyBvcmRlciBjb3N0ID0gYW1vdW50ICogcHJpY2UgaXMgdG9vIHNtYWxsICcgKyBib2R5KTtcbiAgICAgICAgICAgIGlmIChib2R5LmluZGV4T2YgKCdMT1RfU0laRScpID49IDApXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgb3JkZXIgYW1vdW50IHNob3VsZCBiZSBldmVubHkgZGl2aXNpYmxlIGJ5IGxvdCBzaXplLCB1c2UgdGhpcy5hbW91bnRUb0xvdHMgKHN5bWJvbCwgYW1vdW50KSAnICsgYm9keSk7XG4gICAgICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnUFJJQ0VfRklMVEVSJykgPj0gMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyBvcmRlciBwcmljZSBleGNlZWRzIGFsbG93ZWQgcHJpY2UgcHJlY2lzaW9uIG9yIGludmFsaWQsIHVzZSB0aGlzLnByaWNlVG9QcmVjaXNpb24gKHN5bWJvbCwgYW1vdW50KSAnICsgYm9keSk7XG4gICAgICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnT3JkZXIgZG9lcyBub3QgZXhpc3QnKSA+PSAwKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGJvZHlbMF0gPT0gXCJ7XCIpIHtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgbGV0IGVycm9yID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAnY29kZScpO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBlcnJvciAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoZXJyb3IgPT0gLTIwMTApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEluc3VmZmljaWVudEZ1bmRzICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gLTIwMTEpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSAtMTAxMykgeyAvLyBJbnZhbGlkIHF1YW50aXR5XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciA8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufVxuIiwiXCJ1c2Ugc3RyaWN0XCI7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0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AgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9PZmVyRS9iaXQyYycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnRXhjaGFuZ2VzL3twYWlyfS9UaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0V4Y2hhbmdlcy97cGFpcn0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFeGNoYW5nZXMve3BhaXJ9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9CYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0JhbGFuY2UvdjInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01lcmNoYW50L0NyZWF0ZUNoZWNrb3V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9BY2NvdW50SGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkQ29pbkZ1bmRzUmVxdWVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkRnVuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZE9yZGVyTWFya2V0UHJpY2VCdXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZE9yZGVyTWFya2V0UHJpY2VTZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9DYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvTXlPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BheW1lbnQvR2V0TXlJZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUGF5bWVudC9TZW5kJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvTklTJzogeyAnaWQnOiAnQnRjTmlzJywgJ3N5bWJvbCc6ICdCVEMvTklTJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ05JUycgfSxcbiAgICAgICAgICAgICAgICAnQkNIL05JUyc6IHsgJ2lkJzogJ0JjaE5pcycsICdzeW1ib2wnOiAnQkNIL05JUycsICdiYXNlJzogJ0JDSCcsICdxdW90ZSc6ICdOSVMnIH0sXG4gICAgICAgICAgICAgICAgJ0xUQy9OSVMnOiB7ICdpZCc6ICdMdGNOaXMnLCAnc3ltYm9sJzogJ0xUQy9OSVMnLCAnYmFzZSc6ICdMVEMnLCAncXVvdGUnOiAnTklTJyB9LFxuICAgICAgICAgICAgICAgICdCVEcvTklTJzogeyAnaWQnOiAnQnRnTmlzJywgJ3N5bWJvbCc6ICdCVEcvTklTJywgJ2Jhc2UnOiAnQlRHJywgJ3F1b3RlJzogJ05JUycgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC41IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjUgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZld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xuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsbCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZVByaWNlLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGUnXSkgKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW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ZXhwb3J0cyA9IGNsYXNzIGJpdGJheSBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdiaXRiYXknLFxuICAgICAgICAgICAgJ25hbWUnOiAnQml0QmF5JyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdQTCcsICdFVScgXSwgLy8gUG9sYW5kXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MTMyLTk3OGE3YmQ4LTVlY2UtMTFlNy05NTQwLWJjOTZkMWU5YmJiOC5qcGcnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9iaXRiYXkubmV0JyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYml0YmF5Lm5ldC9BUEkvUHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9iaXRiYXkubmV0L0FQSS9UcmFkaW5nL3RyYWRpbmdBcGkucGhwJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpdGJheS5uZXQvcHVibGljLWFwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpdGJheS5uZXQvYWNjb3VudC90YWItYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9CaXRCYXlOZXQvQVBJJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYml0YmF5Lm5ldC9lbi9mZWVzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAg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dzeW1ib2wnOiAnR0FNRS9QTE4nLCAnYmFzZSc6ICdHQU1FJywgJ3F1b3RlJzogJ1BMTicsICdiYXNlSWQnOiAnR0FNRScsICdxdW90ZUlkJzogJ1BMTicgfSxcbiAgICAgICAgICAgICAgICAnR0FNRS9CVEMnOiB7ICdpZCc6ICdHQU1FQlRDJywgJ3N5bWJvbCc6ICdHQU1FL0JUQycsICdiYXNlJzogJ0dBTUUnLCAncXVvdGUnOiAnQlRDJywgJ2Jhc2VJZCc6ICdHQU1FJywgJ3F1b3RlSWQnOiAnQlRDJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjMgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDA0MyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDAxMjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFNLJzogMC4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQU1FJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMDAwOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTE4nOiA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDEuNSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0SW5mbyAoKTtcbiAgICAgICAgaWYgKCdiYWxhbmNlcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ2JhbGFuY2VzJ107XG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2UgfTtcbiAgICAgICAgICAgIGxldCBjb2RlcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjb2Rlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBjb2RlID0gY29kZXNbaV07XG4gICAgICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jaWVzW2NvZGVdO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmN5WydpZCddO1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgICAgIGlmIChpZCBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbaWRdWydhdmFpbGFibGUnXSk7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbaWRdWydsb2NrZWQnXSk7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSB0aGlzLnN1bSAoYWNjb3VudFsnZnJlZSddLCBhY2NvdW50Wyd1c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gICBsZXQgcXVvdGVWb2x1bWUgPSBiYXNlVm9sdW1lICogdndhcDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbWF4JyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21pbicpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiaWQnKSxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYXNrJyksXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2F2ZXJhZ2UnKSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZ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1cnJlbmN5ID0gdGhpcy5jdXJyZW5jeSAoY29kZSk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3lbJ2lkJ10sXG4gICAgICAgICAgICAncXVhbnRpdHknOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0aGlzLmlzRmlhdCAoY29kZSkpIHtcbiAgICAgICAgICAgIG1ldGhvZCA9ICdwcml2YXRlUG9zdFdpdGhkcmF3JztcbiAgICAgICAgICAgIC8vIHJlcXVlc3RbJ2FjY291bnQnXSA9IHBhcmFtc1snYWNjb3VudCddOyAvLyB0aGV5IGRlbWFuZCBhbiBhY2NvdW50IG51bWJlclxuICAgICAgICAgICAgLy8gcmVxdWVzdFsnZXhwcmVzcyddID0gcGFyYW1zWydleHByZXNzJ107IC8vIHdoYXRldmVyIGl0IG1lYW5zLCB0aGV5IGRvbid0IGV4cGxhaW5cbiAgICAgICAgICAgIC8vIHJlcXVlc3RbJ2JpYyddID0gJyc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtZXRob2QgPSAncHJpdmF0ZVBvc3RUcmFuc2Zlcic7XG4gICAgICAgICAgICByZXF1ZXN0WydhZGRyZXNzJ10gPSBhZGRyZXNzO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gIC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BmYWxzZSxcbiAgICAgICAgICAgIC8vIG5ldyBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAnMS43JywgLy8gYXMgb2YgNiBOb3ZlbWJlciAyMDE3XG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MTM4LTA0M2M3Nzg2LTVlY2YtMTFlNy04ODJiLTgwOWMxNGYzOGI1My5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly92aXAuYml0Y29pbi5jby5pZC9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3ZpcC5iaXRjb2luLmNvLmlkL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRjb2luLmNvLmlkJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly92aXAuYml0Y29pbi5jby5pZC9kb3dubG9hZHMvQklUQ09JTkNPSUQtQVBJLURPQ1VNRU5UQVRJT04ucGRmJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vdmlwLmJpdGNvaW4uY28uaWQvdHJhZGVfYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cGFpcn0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cGFpcn0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cGFpcn0vZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckhpc3RvcnknXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgIC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IGxldCBjb2RlID0gY29kZXNbaV07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmN1cnJlbmNpZXNbY29kZV07XG4gICAgICAgICAgICBsZXQgbG93ZXJjYXNlID0gY3VycmVuY3lbJ2lkJ107XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlWydiYWxhbmNlJ10sIGxvd2VyY2FzZSwgMC4wKTtcbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlWydiYWxhbmNlX2hvbGQnXSwgbG93ZXJjYXNlLCAwLjApO1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQYWlyRGVwdGggKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdidXknLCAnc2VsbCcpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1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WZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gbWFya2V0WydxdW90ZUlkJ107XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydiYXNlSWQnXTtcbiAgICAgICAgICAgIGlmICgobWFya2V0WydxdW90ZUlkJ10gPT0gJ2lkcicpICYmICgnb3JkZXJfcnAnIGluIG9yZGVyKSlcbiAgICAgICAgICAgICAgICBxdW90ZUlkID0gJ3JwJztcbiAgICAgICAgICAgIGlmICgobWFya2V0WydiYXNlSWQnXSA9PSAnaWRyJykgJiYgKCdyZW1haW5fcnAnIGluIG9yZGVyKSlcbiAgICAgICAgICAgICAgICBiYXNlSWQgPSAncnAnO1xuICAgICAgICAgICAgY29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ29yZGVyXycgKyBxdW90ZUlkKTtcbiAgICAgICAgICAgIGlmIChjb3N0KSB7XG4gICAgICAgICAgICAgICAgYW1vdW50ID0gY29zdCAvIHByaWNlO1xuICAgICAgICAgICAgICAgIGxldCByZW1haW5pbmdDb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncmVtYWluXycgKyBxdW90ZUlkKTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZ0Nvc3QgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlbWFpbmluZyA9IHJlbWFpbmluZ0Nvc3QgLyBwcmljZTtcbiAgICAgICAgICAgICAgICAgICAgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnb3JkZXJfJyArIGJhc2VJZCk7XG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICAgICAgICAgIHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3JlbWFpbl8nICsgYmFzZUlkKTtcbiAgICAgICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGF2ZXJhZ2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChmaWxsZWQpXG4gICAgICAgICAgICBhdmVyYWdlID0gY29zdCAvIGZpbGxlZDtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChvcmRlclsnc3VibWl0X3RpbWUnXSk7XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyX2lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ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BlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnYmFzZUlkJ107XG4gICAgICAgIG9yZGVyW2Jhc2VdID0gYW1vdW50O1xuICAgICAgICBsZXQgcmVzdWx0ID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXN1bHQsXG4gICAgICAgICAgICAnaWQnOiByZXN1bHRbJ3JldHVybiddWydvcmRlcl9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ29yZGVyX2lkJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdub25jZSc6IHRoaXMubm9uY2UgKCksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGJvZHkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyByZXNwb25zZVsnZXJyb3InXSk7XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG59XG4i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gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgLy8gbmV3IG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG0nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaCcsXG4gICAgICAgICAgICAgICAgJzNoJzogJzNoJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMUQnLFxuICAgICAgICAgICAgICAgICcxdyc6ICc3RCcsXG4gICAgICAgICAgICAgICAgJzJ3JzogJzE0RCcsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFNJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MjQ0LWUzMjhhNTBjLTVlZDItMTFlNy05NDdiLTA0MTQxNjU3OWJiMy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuYml0ZmluZXguY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdGZpbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0ZmluZXgucmVhZG1lLmlvL3YxL2RvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL2JpdGZpbmV4Y29tL2JpdGZpbmV4LWFwaS1ub2RlJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3YyJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0ve3NlY3Rpb259JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2xhc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ2NhbmRsZXMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRib29rL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRzL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3B1YnRpY2tlci97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHNfZGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndG9kYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudF9mZWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50X2luZm9zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFza2V0X21hbmFnZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlZGl0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdC9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmcvY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnkvbW92ZW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrZXlfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luX2luZm9zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteXRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXNfZnVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2ZmZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvZmZlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29mZmVyL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2ZmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvZmZlcnMvaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwvbXVsdGknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC9yZXBsYWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL25ldy9tdWx0aScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9jbGFpbScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0YWtlbl9mdW5kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndG90YWxfdGFrZW5fZnVuZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1bnVzZWRfdGFrZW5fZnVuZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI1MDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzc1MDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAwLCAwLjE4IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTUwMDAwMDAsIDAuMTYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwMCwgMC4xNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI1MDAwMDAwLCAwLjEyIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMzAwMDAwMDAsIDAuMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAsIDAuMDggLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwLCAwLjA2IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMCwgMC4wNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMDAsIDAuMDIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs3NTAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxNTAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFszMDAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSwgLy8gdHJ1ZSBmb3IgdGllci1iYXNlZC9wcm9ncmVzc2l2ZVxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLCAvLyBmaXhlZCBjb21taXNzaW9uXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJT1RBJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFBSJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdZWVcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFUQSc6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFTSCc6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRE8nOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lPVEEnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUFInOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lZVyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVRBJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVNIJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDUsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgY29uc3QgY3VycmVuY2llcyA9IHtcbiAgICAgICAgICAgICdEU0gnOiAnREFTSCcsIC8vIEJpdGZpbmV4IG5hbWVzIERhc2ggYXMgRFNILCBpbnN0ZWFkIG9mIERBU0hcbiAgICAgICAgICAgICdRVE0nOiAnUVRVTScsXG4gICAgICAgICAgICAnQkNDJzogJ0NTVF9CQ0MnLFxuICAgICAgICAgICAgJ0JDVSc6ICdDU1RfQkNVJyxcbiAgICAgICAgICAgICdJT1QnOiAnSU9UQScsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiAoY3VycmVuY3kgaW4gY3VycmVuY2llcykgPyBjdXJyZW5jaWVzW2N1cnJlbmN5XSA6IGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRTeW1ib2xzRGV0YWlscyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydwYWlyJ10udG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwcmljZV9wcmVjaXNpb24nXSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0WydwcmljZV9wcmVjaXNpb24nXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWluaW11bV9vcmRlcl9zaXplJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWF4aW11bV9vcmRlcl9zaXplJ10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VUeXBlID0gdGhpcy5zYWZlU3RyaW5nIChwYXJhbXMsICd0eXBlJywgJ2V4Y2hhbmdlJyk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RCYWxhbmNlcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2ldO1xuICAgICAgICAgICAgaWYgKGJhbGFuY2VbJ3R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ayAob3JkZXJib29rLCB1bmRlZmluZWQsICdiaWRzJywgJ2Fza3MnLCAncHJpY2UnLCAnYW1vdW50Jyk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VycyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRpY2tlcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2ldO1xuICAgICAgICAgICAgaWYgKCdwYWlyJyBpbiB0aWNrZXIpIHtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSB0aWNrZXJbJ3BhaXInXTtcbiAgICAgICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGZldGNoVGlja2VycygpIGZhaWxlZCB0byByZWNvZ25pemUgc3ltYm9sICcgKyBpZCArICcgJyArIHRoaXMuanNvbiAodGlja2VyKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBl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gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyB1bnJlY29nbml6ZWQgdGlja2VyIHN5bWJvbCAnICsgaWQgKyAnICcgKyB0aGlzLmpzb24gKHRpY2tlcikpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0X3ByaWNlJ10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ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AgcmVxdWVzdFsnbGltaXQnXSA9IGxpbWl0O1xuICAgICAgICBpZiAoc2luY2UpXG4gICAgICAgICAgICByZXF1ZXN0WydzdGFydCddID0gc2luY2U7XG4gICAgICAgIHJlcXVlc3QgPSB0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy52MkdldENhbmRsZXNUcmFkZVRpbWVmcmFtZVN5bWJvbEhpc3QgKHJlcXVlc3QpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9ITENWcyAocmVzcG9uc2UsIG1hcmtldCwgdGltZWZyYW1lLCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGdldEN1cnJlbmN5TmFtZSAoY3VycmVuY3kpIHtcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCVEMnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ2JpdGNvaW4nO1xuICAgICAgICB9IGVsc2UgaWYgKGN1cnJlbmN5ID09ICdMVEMnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ2xpdGVjb2luJztcbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSAnRVRIJykge1xuICAgICAgICAgICAgcmV0dXJuICdldGhlcmV1bSc7XG4gICAgICAgIH0gZWxzZSBpZiAoY3VycmVuY3kgPT0gJ0VUQycpIHtcbiAgICAgICAgICAgIHJldHVybiAnZXRoZXJldW1jJztcbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSAnT01OSScpIHtcbiAgICAgICAgICAgIHJldHVybiAnbWFzdGVyY29pbic7IC8vID8/P1xuICAgICAgICB9IGVsc2UgaWYgKGN1cnJlbmN5ID09ICdaRUMnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ3pjYXNoJztcbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSAnWE1SJykge1xuICAgICAgICAgICAgcmV0dXJuICdtb25lcm8nO1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XN0O1xuICAgICAgICBpZiAoKGFwaSA9PSAncHVibGljJykgfHwgKHBhdGguaW5kZXhPZiAoJy9oaXN0JykgPj0gMCkpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGxldCBzdWZmaXggPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgICAgIHVybCArPSBzdWZmaXg7XG4gICAgICAgICAgICAgICAgcmVxdWVzdCArPSBzdWZmaXg7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFwaSA9PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICAgICAncmVxdWVzdCc6IHJlcXVlc3QsXG4gICAgICAgICAgICB9LCBxdWVyeSk7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLmVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgbGV0IHBheWxvYWQgPSB0aGlzLnN0cmluZ1RvQmFzZTY0IChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgc2VjcmV0ID0gdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHBheWxvYWQsIHNlY3JldCwgJ3NoYTM4NCcpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnWC1CRlgtQVBJS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1gtQkZYLVBBWUxPQUQnOiB0aGlzLmRlY29kZSAocGF5bG9hZCksXG4gICAgICAgICAgICAgICAgJ1gtQkZYLVNJR05BVFVSRSc6IHNpZ25hdHVyZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGNvZGUgPT0gNDAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSA9PSBcIntcIikge1xuICAgICAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gcmVzcG9uc2VbJ21lc3NhZ2UnXTtcbiAgICAgICAgICAgICAgICBpZiAobWVzc2FnZS5pbmRleE9mICgnS2V5IHByaWNlIHNob3VsZCBiZSBhIGRlY2ltYWwgbnVtYmVyJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgbWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlLmluZGV4T2YgKCdJbnZhbGlkIG9yZGVyOiBub3QgZW5vdWdoIGV4Y2hhbmdlIGJhbGFuY2UnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZS5pbmRleE9mICgnSW52YWxp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GludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdkZXBvc2l0JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnM2gnOiAnM2gnLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aCcsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmgnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxRCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzdEJyxcbiAgICAgICAgICAgICAgICAnMncnOiAnMTREJyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjI0NC1lMzI4YTUwYy01ZWQyLTExZTctOTQ3Yi0wNDE0MTY1NzliYjMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJpdGZpbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRmaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpdGZpbmV4LnJlYWRtZS5pby92Mi9kb2NzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9iaXRmaW5leGNvbS9iaXRmaW5leC1hcGktbm9kZScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5iaXRmaW5leC5jb20vZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYXRmb3JtL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS97cHJlY2lzaW9ufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9SMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sc19kZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L3tzaWRlfS97c2VjdGlvbn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzMS97a2V5fTp7c2l6ZX06e3N5bWJvbH0vbG9uZy9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L2xvbmcvaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS9zaG9ydC9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L3Nob3J0L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0ve3NlY3Rpb259JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2xhc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbGMvdHJhZGUvYXZnJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3Ivd2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL29yZGVycy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL29yZGVycy97c3ltYm9sfS9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlcnMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL29yZGVyL3tzeW1ib2x9OntpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvdHJhZGVzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9wb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL29mZmVycy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvb2ZmZXJzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL2xvYW5zL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9sb2Fucy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9jcmVkaXRzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9jcmVkaXRzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL3RyYWRlcy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvaW5mby9tYXJnaW4ve2tleX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9pbmZvL2Z1bmRpbmcve2tleX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9tb3ZlbWVudHMve2N1c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0WkVDVVNEJywgJ3N5bWJvbCc6ICdaRUMvVVNEJywgJ2Jhc2UnOiAnWkVDJywgJ3F1b3RlJzogJ1VTRCcgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lPVCc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRE8nOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FWVCc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICAvLyBpc3N1ZSAjNCBCaXRmaW5leCBuYW1lcyBEYXNoIGFzIERTSCwgaW5zdGVhZCBvZiBEQVNIXG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnRFNIJylcbiAgICAgICAgICAgIHJldHVybiAnREFTSCc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnUVRNJylcbiAgICAgICAgICAgIHJldHVybiAnUVRVTSc7XG4gICAgICAgIC8vIGlzc3VlICM3OTZcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdJT1QnKVxuICAgICAgICAgICAgcmV0dXJuICdJT1RBJztcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEF1dGhSV2FsbGV0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VUeXBlID0gdGhpcy5zYWZlU3RyaW5nIChwYXJhbXMsICd0eXBlJywgJ2V4Y2hhbmdlJyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCByZXNwb25zZS5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSByZXNwb25zZVtiXTtcbiAgICAgICAgICAgIGxldCBbIGFjY291bnRUeXBlLCBjdXJyZW5jeSwgdG90YWwsIGludGVyZXN0LCBhdmFpbGFibGUgXSA9IGJhbGFuY2U7XG4gICAgICAgICAgICBpZiAoYWNjb3VudFR5cGUgPT0gYmFsYW5jZVR5cGUpIHtcbiAgICAgICAgICAgICAgICBpZiAoY3VycmVuY3lbMF0gPT0gJ3QnKVxuICAgICAgICAgICAgICAgICAgICBjdXJyZW5jeSA9IGN1cnJlbmN5LnNsaWNlICgxKTtcbiAgICAgICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gY3VycmVuY3kudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgdXBwZXJjYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHVwcGVyY2FzZSk7XG4gICAgICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYXZhaWxhYmxlO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSB0b3RhbDtcbiAgICAgICAgICAgICAgICBpZiAoYWNjb3VudFsnZnJlZSddKVxuICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgICAgIHJlc3VsdFt1cHBlcmNhc2VdID0gYWNjb3VudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0Qm9va1N5bWJvbFByZWNpc2lvbiAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6ICdSMCcsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnYmlkcyc6IFtdLFxuICAgICAgICAgICAgJ2Fza3MnOiBbXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgIH07XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb3JkZXJib29rLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSBvcmRlcmJvb2tbaV07XG4gICAgICAgICAgICBsZXQgcHJpY2UgPSBvcmRlclsxXTtcbiAgICAgICAgICAgIGxldCBhbW91bnQgPSBvcmRlclsyXTtcbiAgICAgICAgICAgIGxldCBzaWRlID0gKGFtb3VudCA+IDApID8gJ2JpZHMnIDogJ2Fza3MnO1xuICAgICAgICAgICAgYW1vdW50ID0gTWF0aC5hYnMgKGFtb3VudCk7XG4gICAgICAgICAgICByZXN1bHRbc2lkZV0ucHVzaCAoWyBwcmljZSwgYW1vdW50IF0pO1xuICAgICAgICB9XG4gICAgICAgIHJlc3VsdFsnYmlkcyddID0gdGhpcy5zb3J0QnkgKHJlc3VsdFsnYmlkcyddLCAwLCB0cnVlKTtcbiAgICAgICAgcmVzdWx0Wydhc2tzJ10gPSB0aGlzLnNvcnRCeSAocmVzdWx0Wydhc2tzJ10sIDApO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgbGVuZ3RoID0gdGlja2VyLmxlbmd0aDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aWNrZXJbbGVuZ3RoIC0gMl0sXG4gICAgICAgICAgICAnbG93JzogdGlja2VyW2xlbmd0aCAtIDFdLFxuICAgICAgICAgICAgJ2JpZCc6IHRpY2tlcltsZW5ndGggLSAxMF0sXG4gICAgICAgICAgICAnYXNrJzogdGlja2VyW2xlbmd0aCAtIDhdLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGlja2VyW2xlbmd0aCAtIDRdLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHRpY2tlcltsZW5ndGggLSA2XSxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdGlja2VyW2xlbmd0aCAtIDVdLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICA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AgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IFsgaWQsIHRpbWVzdGFtcCwgYW1vdW50LCBwcmljZSBdID0gdHJhZGU7XG4gICAgICAgIGxldCBzaWRlID0gKGFtb3VudCA8IDApID8gJ3NlbGwnIDogJ2J1eSc7XG4gICAgICAgIGlmIChhbW91bnQgPCAwKSB7XG4gICAgICAgICAgICBhbW91bnQgPSAtYW1vdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZC50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbW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ZSxcbiAgICAgICAgICAgICAgICAnYmZ4LWFwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdiZngtc2lnbmF0dXJlJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmIChyZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnbWVzc2FnZSddLmluZGV4T2YgKCdub3QgZW5vdWdoIGV4Y2hhbmdlIGJhbGFuY2UnKSA+PSAwKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgICAgIH0gZWxzZSBp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I4MDUxNjQyLTU2MTU0MTgyLTY2MGUtMTFlNy05YjBkLTYwNDJkMWU2ZWRkOC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuYml0Zmx5ZXIuanAnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9iaXRmbHllci5qcCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JpdGZseWVyLmpwL0FQSScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG1hcmtldHMnLCAgICAvLyBvciAnbWFya2V0cydcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRib2FyZCcsICAgICAgLy8gb3IgJ2JvYXJkJ1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHRpY2tlcicsICAgICAvLyBvciAndGlja2VyJ1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGV4ZWN1dGlvbnMnLCAvLyBvciAnZXhlY3V0aW9ucydcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRoZWFsdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGNoYXRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBlcm1pc3Npb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjb2xsYXRlcmFsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjb2xsYXRlcmFsYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29pbmlucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29pbm91dHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbmthY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHdpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjaGlsZG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0cGFyZW50b3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRwYXJlbnRvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZXhlY3V0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0cG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR0cmFkaW5nY29tbWlzc2lvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbmRjb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VuZGNoaWxkb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbGNoaWxkb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbmRwYXJlbnRvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VscGFyZW50b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbGFsbGNoaWxkb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0Wydwcm9kdWN0X2NvZGUnXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jaWVzID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZDtcbiAgICAgICAgICAgIGxldCBudW1DdXJyZW5jaWVzID0gY3VycmVuY2llcy5sZW5ndGg7XG4gICAgICAgICAgICBpZiAobnVtQ3VycmVuY2llcyA9PSAxKSB7XG4gICAgICAgICAgICAgICAgYmFzZSA9IHN5bWJvbC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICAgICAgcXVvdGUgPSBzeW1ib2wuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChudW1DdXJyZW5jaWVzID09IDIpIHtcbiAgICAgICAgICAgICAgICBiYXNlID0gY3VycmVuY2llc1swXTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IGN1cnJlbmNpZXNbMV07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBiYXNlID0gY3VycmVuY2llc1sxXTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IGN1cnJlbmNpZXNbMl07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHt9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IHJlc3BvbnNlLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHJlc3BvbnNlW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYWNjb3VudFsnY3VycmVuY3lfY29kZSddO1xuICAgICAgICAgICAgYmFsYW5jZXNbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VzKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IGJhbGFuY2VzW2N1cnJlbmN5XVsnYW1vdW50J107XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYmFsYW5jZXNbY3VycmVuY3ldWydhdmFpbGFibGUnXTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEJvYXJkICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3Byb2R1Y3RfY29kZSc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdiaWRzJywgJ2Fza3MnLCAncHJpY2UnLCAnc2l6ZScpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwcm9kdWN0X2NvZGUnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0aWNrZXJbJ3RpbWVzdGFtcCddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmVzdF9iaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydiZXN0X2FzayddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbHRwJ10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZ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cbiAgICAgICAgICAgICduYW1lJzogJ0JpdGh1bWInLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdLUicsIC8vIFNvdXRoIEtvcmVhXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogNTAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgLy8gb2Jzb2xldGUgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAvLyBuZXcgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMDU5NzE3Ny1lYTgwMDE3Mi05ZDVlLTExZTctODA0Yy1iOWQ0ZmE5YjU2YjAuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJpdGh1bWIuY29tL3B1YmxpYycsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJpdGh1bWIuY29tJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0aHVtYi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuYml0aHVtYi5jb20vdTEvVVMxMjcnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vay9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlY2VudF90cmFuc2FjdGlvbnMve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVjZW50X3RyYW5zYWN0aW9ucy9hbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL3dhbGxldF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vdXNlcl90cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL3BsYWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL29yZGVyX2RldGFpbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9idGNfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUva3J3X2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2tyd193aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9tYXJrZXRfYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9tYXJrZXRfc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlckFsbCAoKTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAobWFya2V0c1snZGF0YSddKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBpZiAoaWQgIT0gJ2RhdGUnKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ2RhdGEnXVtpZF07XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBpZDtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSAnS1JXJztcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAgICAgJ2xvdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEluZm9CYWxhbmNlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogJ0FMTCcsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgbGV0IGxvd2VyY2FzZSA9IGN1cnJlbmN5LnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlcywgJ3RvdGFsXycgKyBsb3dlcmNhc2UpO1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gdGhpcy5z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JzZUludCAodGlja2VyWydkYXRlJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbWF4X3ByaWNlJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21pbl9wcmljZScpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdidXlfcHJpY2UnKSxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnc2VsbF9wcmljZScpLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdvcGVuaW5nX3ByaWNlJyksXG4gICAgICAgICAgICAnY2xvc2UnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnY2xvc2luZ19wcmljZScpLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdF90cmFkZScpLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYXZlcmFnZV9wcmljZScpLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sdW1lXzFkYXknKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJBbGwgKHBhcmFtcyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHJlc3BvbnNlWydkYXRhJ11bJ2RhdGUnXTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSB0aGlzLm9taXQgKHJlc3BvbnNlWydkYXRhJ10sICdkYXRlJyk7XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAodGlja2Vycyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCB0aWNrZXI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hY3Rpb25zQ3VycmVuY3kgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ2Jhc2UnXSxcbiAgICAgICAgICAgICdjb3VudCc6IDEwMCwgLy8gbWF4ID0gMTAwXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2VbJ2RhdGEnXSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3RUcmFkZSc7XG4gICAgICAgIGlmICh0eXBlID09ICdsaW1pdCcpIHtcbiAgICAgICAgICAgIHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAgICAgJ29yZGVyX2N1cnJlbmN5JzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgICAgICdQYXltZW50X2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgICAgICd1bml0cyc6IGFtb3VudCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICAgICAndHlwZSc6IChzaWRlID09ICdidXknKSA/ICdiaWQnIDogJ2FzaycsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbWV0aG9kICs9ICdQbGFjZSc7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PSAnbWFya2V0Jykge1xuICAgICAgICAgICAgcmVxdW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0dCJywgJ0VVJywgJ1JVJyBdLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjI3NS1kY2ZjNmMzMC01ZWQzLTExZTctODM5ZC0wMGE4NDYzODVkMGIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYml0bGlzaC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYml0bGlzaC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9iaXRsaXNoLmNvbS9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMyAvIDEwMCwgLy8gYW5vbnltb3VzIDAuMyUsIHZlcmlmaWVkIDAuMiVcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDUwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2hsY3YnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNfZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29obGN2JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzX2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHNfb3BlcmF0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfdHJhZGVzX2J5X2lkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX2FsbF90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZV9iY29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX3RlbXBsYXRlX3dhbGxldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X2FjY291bnRzX29wZXJhdGlvbnNfZnJvbV90cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9hY3RpdmVfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X2Jjb2RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9teV9tYXRjaGVzX2Zyb21fdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfbXlfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X215X3RyYWRzX2Zyb21fdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfcGF5bWVudF9tZXRob2RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X3BheW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWRlZW1fY29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVzaWduJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzaWduaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NpZ25vdXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2RldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX29wdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19ieV9pZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgaWYgKCF0aGlzLnN1YnN0aXR1dGVDb21tb25DdXJyZW5jeUNvZGVzKVxuICAgICAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ1hCVCcpXG4gICAgICAgICAgICByZXR1cm4gJ0JUQyc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQkNDJylcbiAgICAgICAgICAgIHJldHVybiAnQkNIJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdEUksnKVxuICAgICAgICAgICAgcmV0dXJuICdEQVNIJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdEU0gnKVxuICAgICAgICAgICAgY3VycmVuY3kgPSAnREFTSCc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnWERHJylcbiAgICAgICAgICAgIGN1cnJlbmN5ID0gJ0RPR0UnO1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFBhaXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2tleXNbcF1dO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbWF4JyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21pbicpLFxuICAgICAgICAgICAgJ2JpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2ZpcnN0JyksXG4gICAgICAgICAgICAnbGFzdCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0JyksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAncHJjJyksXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3N1bScpLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VycyAocGFyYW1zKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA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07XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ2Z1bmRzJ10pO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbY3VycmVuY3ldWydob2xkZWQnXSk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgc2lnbkluICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMucHJpdmF0ZVBvc3RTaWduaW4gKHtcbiAgICAgICAgICAgICdsb2dpbic6IHRoaXMubG9naW4sXG4gICAgICAgICAgICAncGFzc3dkJzogdGhpcy5wYXNzd29yZCxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ3BhaXJfaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ2Rpcic6IChzaWRlID09ICdidXknKSA/ICdiaWQnIDogJ2FzaycsXG4gICAgICAgICA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3N0V2l0aGRyYXcgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0IChhbW91bnQpLFxuICAgICAgICAgICAgJ2FjY291bnQnOiBhZGRyZXNzLFxuICAgICAgICAgICAgJ3BheW1lbnRfbWV0aG9kJzogJ2JpdGNvaW4nLCAvLyB0aGV5IGRpZCBub3QgZG9jdW1lbnQgb3RoZXIgdHlwZXMuLi5cbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ21lc3NhZ2VfaWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHBhcmFtcyk7XG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICd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iAnQml0TWFya2V0JyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdQTCcsICdFVScgXSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnOTBtJzogJzkwbScsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgICAgICcxdyc6ICc3ZCcsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnM00nOiAnM20nLFxuICAgICAgICAgICAgICAgICc2TSc6ICc2bScsXG4gICAgICAgICAgICAgICAgJzF5JzogJzF5JyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY3MjU2LWE4NTU1MjAwLTVlZjktMTFlNy05NmZkLTQ2OWE2NWUyYjBiZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3LmJpdG1hcmtldC5wbC9hcGkyLycsIC8vIGxhc3Qgc2xhc2ggaXMgY3JpdGljYWxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQucGwnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldC9kb2NzLnBocD9maWxlPWFwaV9wdWJsaWMuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQubmV0L2RvY3MucGhwP2ZpbGU9YXBpX3ByaXZhdGUuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYml0bWFya2V0LW5ldC9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2pzb24ve21hcmtldH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdqc29uL3ttYXJrZXR9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnanNvbi97bWFya2V0fS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2pzb24vY3RyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vOTBtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vNmgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8xZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzdkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vMW0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8zbScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzZtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vMXknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ2Rlc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmdkZXNrU3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nZGVza0NvbmZpcm0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyeXB0b3RyYWRpbmdkZXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcnlwdG90cmFkaW5nZGVza1N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3J5cHRvdHJhZGluZ2Rlc2tDb25maXJtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdGaWF0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd1BMTlBQJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd0ZpYXRGYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5MaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5PcGVuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5DbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luQ2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5Nb2RpZnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkJhbGFuY2VBZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkJhbGFuY2VSZW1vdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N3YXBMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzd2FwT3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3dhcENsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCQ0gvUExOJzogeyAnaWQnOiAnQkNDUExOJywgJ3N5bWJvbCc6ICdCQ0gvUExOJywgJ2Jhc2UnOiAnQkNIJywgJ3F1b3RlJzogJ1BMTicgfSxcbiAgICAgICAgICAgICAgICAnQlRHL1BMTic6IHsgJ2lkJzogJ0JUR1BMTicsICdzeW1ib2wnOiAnQlRHL1BMTicsICdiYXNlJzogJ0JURycsICdxdW90ZSc6ICdQTE4nIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9QTE4nOiB7ICdpZCc6ICdCVENQTE4nLCAnc3ltYm9sJzogJ0JUQy9QTE4nLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnUExOJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnQlRDRVVSJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgICAgICAnTFRDL1BMTic6IHsgJ2lkJzogJ0xUQ1BMTicsICdzeW1ib2wnOiAnTFRDL1BMTicsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdQTE4nIH0sXG4gICAgICAgICAgICAgICAgJ0xUQy9CVEMnOiB7ICdpZCc6ICdMVENCVEMnLCAnc3ltYm9sJzogJ0xUQy9CVEMnLCAnYmFzZSc6ICdMVEMnLCAncXVvdGUnOiAnQlRDJyB9LFxuICAgICAgICAgICAgICAgICdMaXRlTWluZVgvQlRDJzogeyAnaWQnOiAnTGl0ZU1pbmVYQlRDJywgJ3N5bWJvbCc6ICdMaXRlTWluZVgvQlRDJywgJ2Jhc2UnOiAnTGl0ZU1pbmVYJywgJ3F1b3RlJzogJ0JUQycgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC40NSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjQ1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTkuOTksIDAuNDQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTkuOTksIDAuNDMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTkuOTksIDAuNDIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTkuOTksIDAuNDEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5Ljk5LCAwLjQwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OS45OSwgMC4zOSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQ5OTkuOTksIDAuMzggLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTk5Ljk5LCAwLjM3IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTk5OTkuOTksIDAuMzYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTk5OS45OSwgMC4zNSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQ5OTk5Ljk5LCAwLjM0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OTkuOTksIDAuMzMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5OTkuOTksIDAuMzIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTk5OTkuOTksIDAuMzEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OTkuOTksIDAuMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjE1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTkuOTksIDAuMTQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTkuOTksIDAuMTMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTkuOTksIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTkuOTksIDAuMTEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5Ljk5LCAwLjEwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OS45OSwgMC45IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDk5OS45OSwgMC44IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OS45OSwgMC43IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTk5OTkuOTksIDAuNiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI5OTk5Ljk5LCAwLjUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OS45OSwgMC40IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OTkuOTksIDAuMyAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzE5OTk5OS45OSwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OTk5Ljk5LCAwLjEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OTkuOTksIDAuMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDA4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExOJzogMixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMiwgLy8gU0VQQS4gVHJhbnNmZXIgSU5UIChTSEEpOiA1IEVVUlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMTic6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEluZm8gKCk7XG4gICAgICAgIGxldCBkYXRhID0gcmVzcG9uc2VbJ2Rh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eSxcbiAgICAgICAgICAgICdxdWFudGl0eSc6IGFtb3VudCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHRoaXMuaXNGaWF0IChjdXJyZW5jeSkpIHtcbiAgICAgICAgICAgIG1ldGhvZCA9ICdwcml2YXRlUG9zdFdpdGhkcmF3RmlhdCc7XG4gICAgICAgICAgICBpZiAoJ2FjY291bnQnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgICAgIHJlcXVlc3RbJ2FjY291bnQnXSA9IHBhcmFtc1snYWNjb3VudCddOyAvLyBiYW5rIGFjY291bnQgY29kZSBmb3Igd2l0aGRyYXdhbFxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcmVxdWlyZXMgYWNjb3VudCBwYXJhbWV0ZXIgdG8gd2l0aGRyYXcgZmlhdCBjdXJyZW5jeScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdhY2NvdW50MicgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICAgICAgcmVxdWVzdFsnYWNjb3VudDInXSA9IHBhcmFtc1snYWNjb3VudDInXTsgLy8gYmFuayBTV0lGVCBjb2RlIChFVVIgb25seSlcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdFVVInKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcmVxdWlyZXMgYWNjb3VudDIgcGFyYW1ldGVyIHRvIHdpdGhkcmF3IEVVUicpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCd3aXRoZHJhd2FsX25vdGUnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgICAgIHJlcXVlc3RbJ3dpdGhkcmF3YWxfbm90ZSddID0gcGFyYW1zWyd3aXRoZHJhd2FsX25vdGUnXTsgLy8gY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Xh0ZW5kcyBFeGNoYW5nZSB7XG5cbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnYml0bWV4JyxcbiAgICAgICAgICAgICduYW1lJzogJ0JpdE1FWCcsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1NDJywgLy8gU2V5Y2hlbGxlc1xuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ3VzZXJBZ2VudCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW0nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICd0ZXN0JzogJ2h0dHBzOi8vdGVzdG5ldC5iaXRtZXguY29tJyxcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MzE5LWY2NTNjNmU2LTVlZDQtMTFlNy05MzNkLWYwYmMzNjk5YWU4Zi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuYml0bWV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRtZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWV4LmNvbS9hcHAvYXBpT3ZlcnZpZXcnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0JpdE1FWC9hcGktY29ubmVjdG9ycy90cmVlL21hc3Rlci9vZmZpY2lhbC1odHRwJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbm5vdW5jZW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Fubm91bmNlbWVudC91cmdlbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnQvYWN0aXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2FjdGl2ZUFuZEluZGljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnQvYWN0aXZlSW50ZXJ2YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2NvbXBvc2l0ZUluZGV4JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2luZGljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3VyYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVhZGVyYm9hcmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpcXVpZGF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyQm9vay9MMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlL2J1Y2tldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzY2hlbWEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NjaGVtYS93ZWJzb2NrZXRIZWxwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZXR0bGVtZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2J1Y2tldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhdC9jaGFubmVscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhdC9jb25uZWN0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4ZWN1dGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhlY3V0aW9uL3RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbm90aWZpY2F0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYWZmaWxpYXRlU3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NoZWNrUmVmZXJyYWxDb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NvbW1pc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWFyZ2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21pbldpdGhkcmF3YWxGZWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldEhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0U3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXBpS2V5L2Rpc2FibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleS9lbmFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9idWxrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWxBbGxBZnRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2xvc2VQb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vaXNvbGF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vbGV2ZXJhZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL3Jpc2tMaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vdHJhbnNmZXJNYXJnaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY2FuY2VsV2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jb25maXJtRW1haWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY29uZmlybUVuYWJsZVRGQScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jb25maXJtV2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9kaXNhYmxlVEZBJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2xvZ291dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9sb2dvdXRBbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJlZmVyZW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcmVxdWVzdEVuYWJsZVRGQScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9yZXF1ZXN0V2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2J1bGsnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuIC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dW90ZTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaWQuaW5kZXhPZiAoJ0JfJykgPj0gMCkge1xuICAgICAgICAgICAgICAgIHByZWRpY3Rpb24gPSB0cnVlO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAncHJlZGljdGlvbic7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGZ1dHVyZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgdHlwZSA9ICdmdXR1cmUnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG1ha2VyID0gbWFya2V0WydtYWtlckZlZSddO1xuICAgICAgICAgICAgbGV0IHRha2VyID0gbWFya2V0Wyd0YWtlckZlZSddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICAgICAnc3BvdCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdzd2FwJzogc3dhcCxcbiAgICAgICAgICAgICAgICAnZnV0dXJlJzogZnV0dXJlLFxuICAgICAgICAgICAgICAgICdwcmVkaWN0aW9uJzogcHJlZGljdGlvbixcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRVc2VyTWFyZ2luICh7ICdjdXJyZW5jeSc6ICdhbGwnIH0pO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgcmVzcG9uc2UubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydhdmFpbGFibGVNYXJnaW4nXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWydtYXJnaW5CYWxhbmNlJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCVEMnKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYWNjb3VudFsnZnJlZSddICogMC4wMDAwMDAwMTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gYWNjb3VudFsndG90YWwnXSAqIDAuMDAwMDAwMDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE9yZGVyQm9va0wyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnYmlkcyc6IFtdLFxuICAgICAgICAgICAgJ2Fza3MnOiBbXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgIH07XG4gICAgICAgIGZvciAobGV0IG8gPSAwOyBvIDwgb3JkZXJib29rLmxlbmd0aDsgbysrKSB7XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSBvcmRlcmJvb2tbb107XG4gICAgICAgICAgICBsZXQgc2lkZSA9IChvcmRlclsnc2lkZSddID09ICdTZWxsJykgPyAnYXNrcycgOiAnYmlkcyc7XG4gICAgICAgICAgICBsZXQgYW1vdW50ID0gb3JkZXJbJ3NpemUnXTtcbiAgICAgICAgICAgIGxldCBwcmljZSA9IG9yZGVyWydwcmljZSddO1xuICAgICAgICAgICAgcmVzdWx0W3NpZGVdLnB1c2ggKFsgcHJpY2UsIGFtb3VudCBdKTtcbiAgICAgICAgfVxuICAgICAgICByZXN1bHRbJ2JpZHMnXSA9IHRoa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AgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJ21lc3NhZ2UnIGluIHJlc3BvbnNlWydlcnJvciddKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm5lZCBhbiBlbXB0eSByZXNwb25zZScpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcXVlcnkgPSAnL2FwaScgKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAobWV0aG9kICE9ICdQVVQnKVxuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICBxdWVyeSArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyBxdWVyeTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbWV0aG9kICsgcXVlcnkgKyBub25jZTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT0gJ1BPU1QnIHx8IG1ldGhvZCA9PSAnUFVUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocGFyYW1zKTtcbiAgICAgICAgICAgICAgICAgICAgYXV0aCArPSBib2R5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgICAgICAnYXBpLW5vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ2FwaS1rZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnYXBpLXNpZ25hdHVyZSc6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG59XG4iLCJcInVzZSBzdHJpY3RcIjtcblxuLy8gIC0tLS0tLS0tLS0tL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wczovL2JpdHNvLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JpdHNvLmNvbS9hcGlfaW5mbycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2F2YWlsYWJsZV9ib29rcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudF9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZlZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmdzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5ncy97ZmlkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19kZXN0aW5hdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAna3ljX2RvY3VtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVkZ2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvZmVlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVkZ2VyL2Z1bmRpbmdzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvd2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ214X2JhbmtfY29kZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl90cmFkZXMve29pZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97b2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhZGVzL3t0aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL3t3aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZWJpdF9jYXJkX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aGVyX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGhvbmVfbnVtYmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwaG9uZV92ZXJpZmljYXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bob25lX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NwZWlfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tvaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEF2YWlsYWJsZUJvb2tzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0c1sncGF5bG9hZCddLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sncGF5bG9hZCddW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0Wydib29rJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQudG9VcHBlckNhc2UgKCkucmVwbGFjZSAoJ18nLCAnLycpO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWluaW11bV9hbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21heGltdW1fYW1vdW50J10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogcGFyc2VGbG9hdCAobWFya2V0WydtaW5pbXVtX3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogcGFyc2VGbG9hdCAobWFya2V0WydtYXhpbXVtX3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21pbmltdW1fdmFsdWUnXSksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21heGltdW1fdmFsdWUnXSksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsnbWluaW11bV9hbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ21pbmltdW1fcHJpY2UnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IGxpbWl0c1snYW1vdW50J11bJ21pbiddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRCYWxhbmNlICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncGF5bG9hZCddWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhdmFpbGFibGUnXSksXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydsb2NrZWQnXSksXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsndG90YWwnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJCb29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2Jvb2snOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgb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pZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnY3JlYXRlZF9hdCddKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGlmICgnYm9vaycgaW4gdHJhZGUpXG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydib29rJ11dO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AgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBxdWVyeSA9ICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyBxdWVyeTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IFsgbm9uY2UsIG1ldGhvZCwgcXVlcnkgXS5qb2luICgnJyk7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocGFyYW1zKTtcbiAgICAgICAgICAgICAgICByZXF1ZXN0ICs9IGJvZHk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocmVxdWVzdCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLmFwaUtleSArICc6JyArIG5vbmNlICsgJzonICsgc2lnbmF0dXJlO1xu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2VlYy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuYml0c3RhbXAubmV0L2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuYml0c3RhbXAubmV0L2FwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2sve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyX2hvdXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nLXBhaXJzLWluZm8vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiY2hfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JjaF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFuc2FjdGlvbnMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYW5zYWN0aW9ucy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycy9hbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9zdGF0dXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXkve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5L21hcmtldC97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwvbWFya2V0L3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2x0Y193aXRoZHJhd2FsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbHRjX2FkZHJlc3MvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldGhfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAneHJwX3dpdGhkcmF3YWwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd4cnBfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyLXRvLW1haW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2Zlci1mcm9tLW1haW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsL29wZW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsL3N0YXR1cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWwvY2FuY2VsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlxdWlkYXRpb25fYWRkcmVzcy9uZXcvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXF1aWRhdGlvbl9hZGRyZXNzL2luZm8vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd2MSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl9kZXBvc2l0X2FkZHJlc3MvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1bmNvbmZpcm1lZF9idGMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX3dpdGhkcmF3YWwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyaXBwbGVfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JpcHBsZV9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjI1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAsIDAuMjQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAsIDAuMjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0MDAwMDAsIDAuMjAgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs2MDAwMDAsIDAuMTUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwLCAwLjE0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMCwgMC4xMyAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQwMDAwMDAsIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwMCwgMC4xMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAxLCAwLjEwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDAuMjUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMCwgMC4yNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMCwgMC4yMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQwMDAwMCwgMC4yMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzYwMDAwMCwgMC4xNSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAsIDAuMTQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwLCAwLjEzIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDAwMDAwMCwgMC4xMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAwLCAwLjExIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMDEsIDAuMTAgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogMjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMC45MCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRCc6IDI1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkaW5nUGFpcnNJbmZvICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGJhc2UudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IHF1b3RlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbElkID0gYmFzZUlkICsgJ18nICsgcXVvdGVJZDtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsndXJsX3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0WydiYXNlX2RlY2ltYWxzJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0Wydjb3VudGVyX2RlY2ltYWxzJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IFsgY29zdCwgY3VycmVuY3kgXSA9IG1hcmtldFsnbWluaW11bV9vcmRlciddLnNwbGl0ICgnICcpO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChtYXJrZXRbJ3RyYWRpbmcnXSA9PSAnRW5hYmxlZCcpO1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sSWQnOiBzeW1ib2xJZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogcGFyc2VGbG9hdCAoY29zdCksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE9yZGVyQm9va1BhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKG9yZGVyYm9va1sndGltZXN0YW1wJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdGltZXN0YW1wKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJQYWlyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0aWNrZXJbJ3RpbWVzdGFtcCddKSAqIDEwMDA7XG4gICAgICAgIGxldCB2d2FwID0gcGFyc2VGbG9hdCAodGlja2VyWyd2d2FwJ10pO1xuICAgICAgICBsZXQgYmFzZVZvbHVtZSA9IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sdW1lJ10pO1xuICAgICAgICBsZXQgcXVvdGVWb2x1bWUgPSBiYXNlVm9sdW1lICogdndhcDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHBhcnNlRmxvYXQgKHRpY2tlclsnb3BlbiddKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxu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GVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZSArIHRoaXMudWlkICsgdGhpcy5hcGlLZXk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5lbmNvZGUgKHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKSk7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBxdWVyeSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gY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yc6ICdHQicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3ODYzNzctOGM4YWI1N2UtNWZlOS0xMWU3LThlYTQtMmIwNWI2YmNjZWVjLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdHN0YW1wLm5ldCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfaG91cicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldXJfdXNkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfYWxsX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndW5jb25maXJtZWRfYnRjJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyaXBwbGVfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmlwcGxlX2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxfcmVxdWVzdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ2J0Y3VzZCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnLCAnbWFrZXInOiAwLjAwMjUsICd0YWtlcic6IDAuMDAyNSB9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BpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE15VHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAvLyBuZXcgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnb25lTWluJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnZml2ZU1pbicsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICd0aGlydHlNaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICdob3VyJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnZGF5JyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MzUyLWNmMGIzYzI2LTVlZDUtMTFlNy04MmI3LWYzODI2YjdhOTdkOC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnYWNjb3VudCc6ICdodHRwczovL2JpdHRyZXguY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdtYXJrZXQnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAndjInOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGkvdjIuMC9wdWInLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2JpdHRyZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9Ib21lL0FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5ucG1qcy5vcmcvcGFja2FnZS9ub2RlLmJpdHRyZXguYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9GZWVzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5iaXR0cmV4LmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDAxOTk2NTEtV2hhdC1mZWVzLWRvZXMtQml0dHJleC1jaGFyZ2UtJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3YyJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMvR2V0QlRDUHJpY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9HZXRUaWNrcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L0dldExhdGVzdFRpY2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01hcmtldHMvR2V0TWFya2V0U3VtbWFyaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvR2V0TGF0ZXN0VGljaycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHN1bW1hcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0c3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2FjY291bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRhZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0aGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdtYXJrZXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5bGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eW1hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVub3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxtYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVEMnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkREJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWFQnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1QnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JERCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjb3N0VG9QcmVjaXNpb24gKHN5bWJvbCwgY29zdCkge1xuICAgICAgICByZXR1cm4gdGhpcy50cnVuY2F0ZSAocGFyc2VGbG9hdCAoY29zdCksIHRoaXMubWFya2V0c1tzeW1ib2xdWydwcmVjaXNpb24nXVsncHJpY2UnXSk7XG4gICAgfVxuXG4gICAgZmVlVG9QcmVjaXNpb24gKHN5bWJvbCwgZmVlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnRydW5jYXRlIChwYXJzZUZsb2F0IChmZWUpLCB0aGlzLm1hcmtldHNbc3ltYm9sXVsncHJlY2lzaW9uJ11bJ3ByaWNlJ10pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMudjJHZXRNYXJrZXRzR2V0TWFya2V0U3VtbWFyaWVzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcmVzcG9uc2VbJ3Jlc3VsdCddLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gcmVzcG9uc2VbJ3Jlc3VsdCddW2ldWydNYXJrZXQnXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnTWFya2V0TmFtZSddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ01hcmtldEN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ0Jhc2VDdXJyZW5jeSddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IG1hcmtldFsnSXNBY3RpdmUnXTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydNaW5UcmFkZVNpemUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuYWNjb3VudEdldEJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGluZGV4ZWQgPSB0aGlzLmluZGV4QnkgKGJhbGFuY2VzLCAnQ3VycmVuY3knKTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAoaW5kZXhlZCk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChpZCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gaW5kZXhlZFtpZF07XG4gICAgICAgICAgICBsZXQgZnJlZSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ0F2YWlsYWJsZSddKTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ0JhbGFuY2UnXSk7XG4gICAgICAgICAgICBsZXQgdXNlZCA9IHRvdGFsIC0gZnJlZTtcbiAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGZyZWU7XG4gICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSB1c2VkO1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRvdGFsO1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAndHlwZSc6ICdib3RoJyxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGlmICgndHlwZScgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICBpZiAocGFyYW1zWyd0eXBlJ10gPT0gJ2J1eScpIHtcbiAgICAgICAgICAgICAgICBvcmRlcmJvb2sgPSB7XG4gICAgICAgICAgICAgICAgICAgICdidXknOiByZXNwb25zZVsncmVzdWx0J10sXG4gICAgICAgICAgICAgICAgICAgICdzZWxsJzogW10sXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocGFyYW1zWyd0eXBlJ10gPT0gJ3NlbGwnKSB7XG4gICAgICAgICAgICAgICAgb3JkZXJib29rID0ge1xuICAgICAgICAgICAgICAgICAgICAnYnV5JzogW10sXG4gICAgICAgICAgICAgICAgICAgICdzZWxsJzogcmVzcG9uc2VbJ3Jlc3VsdCddLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYnV5JywgJ3NlbGwnLCAnUmF0ZScsICdRdWFudGl0eScpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRpY2tlclsnVGltZVN0YW1wJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnSGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdMb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnQmlkJyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0FzaycpLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5l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IC8vIGRpZmZlcmVudGlhdGVkIGZlZXMgZm9yIGVhY2ggcGFydGljdWxhciBtZXRob2RcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSA4OyAvLyBkZWZhdWx0IHByZWNpc2lvbiwgdG9kbzogZml4IFwibWFnaWMgY29uc3RhbnRzXCJcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WydDdXJyZW5jeUxvbmcnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogY3VycmVuY3lbJ0lzQWN0aXZlJ10sXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5WydUeEZlZSddLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ1R4RmVlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHN1bW1hcmllcyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgdCA9IDA7IHQgPCB0aWNrZXJzLmxlbmd0aDsgdCsrKSB7XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1t0XTtcbiAgICAgICAgICAgIGxldCBpZCA9IHRpY2tlclsnTWFya2V0TmFtZSddO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBbIHF1b3RlLCBiYXNlIF0gPSBpZC5zcGxpdCAoJy0nKTtcbiAgICAgICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzdW1tYXJ5ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVsncmVzdWx0J11bMF07XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydUaW1lU3RhbXAnXSk7XG4gICAgICAgIGxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHJhZGVbJ09yZGVyVHlwZSddID09ICdCVVknKSB7XG4gICAgICAgICAgICBzaWRlID0gJ2J1eSc7XG4gICAgICAgIH0gZWxzZSBpZiAodHJhZGVbJ09yZGVyVHlwZSddID09ICdTRUxMJykge1xuICAgICAgICAgICAgc2lkZSA9ICdzZWxsJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnSWQnIGluIHRyYWRlKVxuICAgICAgICAgICAgaWQgPSB0cmFkZVsnSWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydQcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnUXVhbnRpdHknXSksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmlu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pZWxkICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSB7fTtcbiAgICAgICAgICAgIHJlcXVlc3Rbb3JkZXJJZEZpZWxkXSA9IGlkO1xuICAgICAgICAgICAgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLm1hcmtldEdldENhbmNlbCAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5sYXN0X2pzb25fcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAodGhpcy5sYXN0X2pzb25fcmVzcG9uc2UsICdtZXNzYWdlJyk7XG4gICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UgPT0gJ09SREVSX05PVF9PUEVOJylcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgY2FuY2VsT3JkZXIoKSBlcnJvcjogJyArIHRoaXMubGFzdF9odHRwX3Jlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSA9PSAnVVVJRF9JTlZBTElEJylcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKHRoaXMuaWQgKyAnIGNhbmNlbE9yZGVyKCkgZXJyb3I6ICcgKyB0aGlzLmxhc3RfaHR0cF9yZXNwb25zZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ09yZGVyVHlwZScgaW4gb3JkZXIpXG4gICAgICAgICAgICBzaWRlID0gKG9y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EgKG9yZGVyWydUaW1lU3RhbXAnXSk7XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBjb21taXNzaW9uID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ0NvbW1pc3Npb24nIGluIG9yZGVyKSB7XG4gICAgICAgICAgICBjb21taXNzaW9uID0gJ0NvbW1pc3Npb24nO1xuICAgICAgICB9IGVsc2UgaWYgKCdDb21taXNzaW9uUGFpZCcgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGNvbW1pc3Npb24gPSAnQ29tbWlzc2lvblBhaWQnO1xuICAgICAgICB9XG4gICAgICAgIGlmIChjb21taXNzaW9uKSB7XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0IChvcmRlcltjb21taXNzaW9uXSksXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdMaW1pdCcpO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ1ByaWNlJyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdRdWFudGl0eScpO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnUXVhbnRpdHlSZW1haW5pbmcnLCAwLjApO1xuICAgICAgICBsZXQgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICBpZiAoIWNvc3QpIHtcbiAgICAgICAgICAgIGlmIChwcmljZSAmJiBhbW91bnQpXG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICB9XG4gICAgICAgIGlmICghcHJpY2UpIHtcbiAgICAgICAgICAgIGlmIChjb3N0ICYmIGZpbGxlZClcbiAgICAgICAgICAgICAgICBwcmljZSA9IGNvc3QgLyBmaWxsZWQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGF2ZXJhZ2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdQcmljZVBlclVuaXQnKTtcbiAgICAgICAgbGV0IGlkID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ09yZGVyVXVpZCcpO1xuICAgICAgICBpZiAodHlwZW9mIGlkID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGlkID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ09yZGVySWQnKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IGF2ZXJhZ2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3lu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ZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmFjY291bnRHZXRXaXRoZHJhdyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5SWQsXG4gICAgICAgICAgICAncXVhbnRpdHknOiBhbW91bnQsXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgncmVzdWx0JyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCd1dWlkJyBpbiByZXNwb25zZVsncmVzdWx0J10pXG4gICAgICAgICAgICAgICAgaWQgPSByZXNwb25zZVsncmVzdWx0J11bJ3V1aWQnXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXSArICcvJztcbiAgICAgICAgaWYgKGFwaSAhPSAndjInKVxuICAgICAgICAgICAgdXJsICs9IHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IGFwaSArICcvJyArIG1ldGhvZC50b0xvd2VyQ2FzZSAoKSArIHBhdGg7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT0gJ3YyJykge1xuICAgICAgICAgICAgdXJsICs9IHBhdGg7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIHVybCArPSBhcGkgKyAnLyc7XG4gICAgICAgICAgICBpZiAoKChhcGkgPT0gJ2FjY291bnQnKSAmJiAocGF0aCAhPSAnd2l0aGRyYXcnKSkgfHwgKHBhdGggPT0gJ29wZW5vcmRlcnMnKSlcbiAgICAgICAgICAgICAgICB1cmwgKz0gbWV0aG9kLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgdXJsICs9IHBhdGggKyAnPycgKyB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlICh1cmwpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyk7XG4gICAgICAgICAgICBoZWFkZXJzID0geyAnYXBpc2lnbic6IHNpZ25hdHVyZSB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgdGhyb3dF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lkT3JkZXIgKHRoaXMuaWQgKyAnIG9yZGVyIGNvc3Qgc2hvdWxkIGJlIG92ZXIgNTBrIHNhdG9zaGkgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoY29kZSA+PSA0MDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdID09IFwie1wiKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgdGhpcy50aHJvd0V4Y2VwdGlvbk9yRXJyb3IgKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcmVzcG9uc2VbJ3N1Y2Nlc3MnXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy50aHJvd0V4Y2VwdGlvbk9uRXJyb3IgKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcyw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JzogWyAnTkwnLCAnRVUnIF0sIC8vIE5ldGhlcmxhbmRzLCBFVVxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICcxJyxcbiAgICAgICAgICAgICdjb21tZW50JzogJ0FuIGV4Y2hhbmdlIG1hcmtldCBieSBCaXRvbmljTkwnLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjg1MDE3NTItNjBjMjFiODItNmZlYi0xMWU3LTgxOGItMDU1ZWU2ZDBlNzU0LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5ibDNwLmV1JyxcbiAgICAgICAgICAgICAgICAnd3d3JzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9ibDNwLmV1JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0b25pYy5ubCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0JpdG9uaWNOTC9ibDNwLWFwaS90cmVlL21hc3Rlci9kb2NzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYmwzcC5ldS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRvbmljLm5sL2VuL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvZGVwdGgvZnVsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvb3JkZXIvYWRkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9vcmRlci9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L21vbmV5L29yZGVyL3Jlc3VsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9vcmRlcnMvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvdHJhZGVzL2ZldGNoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRU5NS1QvbW9uZXkvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VOTUtUL21vbmV5L2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VOTUtUL21vbmV5L25ld19kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dFTk1LVC9tb25leS93YWxsZXQvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VOTUtUL21vbmV5L3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFx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kge1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlW2N1cnJlbmN5XVsnYXZhaWxhYmxlJ11bJ3ZhbHVlJ10pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCdiYWxhbmNlJyBpbiBiYWxhbmNlW2N1cnJlbmN5XSkge1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ2JhbGFuY2UnXVsndmFsdWUnXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGFjY291bnRbJ3RvdGFsJ10pIHtcbiAgICAgICAgICAgICAgICBpZiAoYWNjb3VudFsnZnJlZSddKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIHBhcnNlQmlkQXNrIChiaWRhc2ssIHByaWNlS2V5ID0gMCwgYW1vdW50S2V5ID0gMCkge1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgYmlkYXNrWydwcmljZV9pbnQnXSAvIDEwMDAwMC4wLFxuICAgICAgICAgICAgYmlkYXNrWydhbW91bnRfaW50J10gLyAxMDAwMDAwMDAuMCxcbiAgICAgICAgXTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0T3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRUaWNrZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3RpbWVzdGFtcCddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUnXVsnMjRoJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RyYWRlX2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdHJhZGVbJ2RhdGUnXSxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodHJhZGVbJ2RhdGUnXSksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2VfaW50J10gLyAxMDAwMDAuMCxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZV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2FjY291bnQnOiAnaHR0cHM6Ly9ibGV1dHJhZGUuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdtYXJrZXQnOiAnaHR0cHM6Ly9ibGV1dHJhZGUuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYmxldXRyYWRlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JsZXV0cmFkZS5jb20vaGVscC9BUEknLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYmxldXRyYWRlLmNvbS9oZWxwL2ZlZXNfYW5kX2RlYWRsaW5lcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdBREMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICdCVEEnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICdCSVRCJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ0JUQ0QnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnQkxLJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnQ0ROJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnQ0xBTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICdEQ1InOiAwLjA1LFxuICAgICAgICAgICAgICAgICAgICAnREdDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnRFAnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICdEUEMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICdET0dFJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAnRUZMJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgJ0VYUCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgJ0ZKQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgJ0JTVFknOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ0dCJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnTkxHJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnSFRNTCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnTU9OQSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICdNT09OJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAnTk1DJzogMC4wMTUsXG4gICAgICAgICAgICAgICAgICAgICdORU9TJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnTlZDJzogMC4wNSxcbiAgICAgICAgICAgICAgICAgICAgJ09LJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnUE9UJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnWFBNJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICdRVFVNJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnUkREJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnU0xSJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnU1RBUlQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICdTTEcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICdUUk9MTCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgJ1VOTyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICdWUkMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICdWVEMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICdYVlAnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICdXREMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ1pFVCc6IDAuMSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWydyZXN1bHQnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ3Jlc3VsdCddW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydNYXJrZXROYW1lJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnTWFya2V0Q3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnQmFzZUN1cnJlbmN5J107XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gbWFya2V0WydJc0FjdGl2ZSddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ01pblRyYWRlU2l6ZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBnZXRPcmRlcklkRmllbGQgKCkge1xuICAgICAgICByZXR1cm4gJ29yZGVyaWQnO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAndHlwZSc6ICdBTEwnLFxuICAgICAgICAgICAgJ2RlcHRoJzogNTAsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdidXknLCAnc2VsbCcsICdSYXRlJywgJ1F1YW50aXR5Jyk7XG4gICAgfVxuXG4gICAgdGhyb3dFeGNlcHRpb25PbkVycm9yIChyZXNwb25zZSkge1xuICAgICAgICBpZiAoJ21lc3NhZ2UnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBpZiAocmVzcG9uc2VbJ21lc3NhZ2UnXSA9PSAnSW5zdWZmaWNpZW50IGZ1bmRzIScpXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEluc3VmZmljaWVudEZ1bmRzICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydtZXNzYWdlJ10gPT0gJ01JTl9UUkFERV9SRVFVSVJFTUVOVF9OT1RfTUVUJylcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgdGhpcy5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1NC8zNDcwMzU5My1jNDQ5ODY3NC1mNTA0LTExZTctOGQxNC1mZjhlNDRmYjc4YzEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYnJhemlsaWV4LmNvbS9hcGkvdjEnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9icmF6aWxpZXguY29tLycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JyYXppbGlleC5jb20vZXhjaGFuZ2UvYXBpLnBocCcsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9icmF6aWxpZXguY29tL2V4Y2hhbmdlL2ZlZXMucGhwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY2llcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vay97bWFya2V0fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVoaXN0b3J5L3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb21wbGV0ZV9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDA1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hDdXJyZW5jaWVzIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY2llcyAocGFyYW1zKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChjdXJyZW5jaWVzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpZF07XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0gY3VycmVuY3lbJ2RlY2ltYWwnXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBpZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHVwcGVyY2FzZSk7XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gY3VycmVuY3lbJ2FjdGl2ZSddID09IDE7XG4gICAgICAgICAgICBsZXQgc3RhdHVzID0gJ29rJztcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeVsndW5kZXJfbWFpbnRlbmFuY2UnXSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgYWN0aXZlID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgc3RhdHVzID0gJ21haW50ZW5hbmNlJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBjYW5XaXRoZHJhdyA9IGN1cnJlbmN5Wydpc193aXRoZHJhd2FsX2FjdGl2ZSddID09IDE7XG4gICAgICAgICAgICBsZXQgY2FuRGVwb3NpdCA9IGN1cnJlbmN5Wydpc19kZXBvc2l0X2FjdGl2ZSddID09IDE7XG4gICAgICAgICAgICBpZiAoIWNhbldpdGhkcmF3IHx8ICFjYW5EZXBvc2l0KVxuICAgICAgICAgICAgICAgIGFjdGl2ZSA9IGZhbHNlO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WyduYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ3dhbGxldCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3MnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICdleHRyYSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGNhbldpdGhkcmF3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5Wyd0eFdpdGhkcmF3YWxGZWUnXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnYWN0aXZlJzogY2FuRGVwb3NpdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmZWUnOiBjdXJyZW5jeVsndHhEZXBvc2l0RmVlJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydtaW5BbW91bnRUcmFkZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ01pbldpdGhkcmF3YWwnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydtaW5EZXBvc2l0J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICgpO1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpZF07XG4gICAgICAgICAgICBsZXQgaWRVcHBlckNhc2UgPSBpZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBpZFVwcGVyQ2FzZS5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IG1hcmtldFsnYWN0aXZlJ10gPT0gMTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ2RhdGUnXTtcbiAgICAgICAgdGlja2VyID0gdGlja2VyWyd0aWNrZXInXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2hlc3RCaWQyNCddKSxcbiAgICAgICAgICAgICdsb3cnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xvd2VzdEFzazI0J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnaGlnaGVzdEJpZCddKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xvd2VzdEFzayddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3BlcmNlbnRDaGFuZ2UnXSksXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2Jhc2VWb2x1bWUyNCddKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsncXVvdGVWb2x1bWUyNCddKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyTWFya2V0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHRpY2tlciA9IHtcbiAgICAgICAgICAgICdkYXRlJzogdGhpcy5taWxsaXNlY29uZHMgKCksXG4gICAgICAgICAgICAndGlja2VyJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gdG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bWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ2lkJzogdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ19pZCcpLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXJJZCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdHJhZGVzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkZWhpc3RvcnlNYXJrZXQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHRyYWRlcywgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENvbXBsZXRlQmFsYW5jZSAocGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaWRdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlJ10pLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ3RvdGFsJ10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgbGV0IG1hcmtldElkID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ21hcmtldCcpO1xuICAgICA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ZXJfbnVtYmVyJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ3N0YXR1cyc6ICdvcGVuJyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmVlJzogdGhpcy5zYWZlVmFsdWUgKG9yZGVyLCAnZmVlJyksXG4gICAgICAgICAgICAnaW5mbyc6IGluZm8sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3ByaXZhdGVQb3N0JyArIHRoaXMuY2FwaXRhbGl6ZSAoc2lkZSk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdtYXJrZXQnOiBtYXJrZXRbJ2lkJ10sXG4gICAg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gICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2NvbW1hbmQnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdub25jZSc6IHRoaXMubm9uY2UgKCksXG4gICAgICAgICAgICB9LCBxdWVyeSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChib2R5KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdTaWduJzogdGhpcy5kZWNvZGUgKHNpZ25hdHVyZSksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICA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yA9IGNsYXNzIGJ0Y2JveCBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdidGNib3gnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQnRjQm94JyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnSlAnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT0hMQ1YnOiBmYWxzZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzEyNzU4MDMtNGRmNzU1YTgtYWFhMS0xMWU3LTlhYmItMTFlYzJmYWQ5ZjJkLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5idGNib3guY28uanAvYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJ0Y2JveC5jby5qcC8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuYnRjYm94LmNvLmpwL2hlbHAvYXNtJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbGx0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2FkZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV92aWV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9KUFknOiB7ICdpZCc6ICdCVEMvSlBZJywgJ3N5bWJvbCc6ICdCVEMvSlBZJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0pQWScgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAodGhpcy5jdXJyZW5jaWVzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aD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1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHt9O1xuICAgICAgICBsZXQgbnVtU3ltYm9scyA9IHRoaXMuc3ltYm9scy5sZW5ndGg7XG4gICAgICAgIGlmIChudW1TeW1ib2xzID4gMSlcbiAgICAgICAgICAgIHJlcXVlc3RbJ2NvaW4nXSA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10sXG4gICAgICAgICAgICAnb3Jk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gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcyk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgc2VjcmV0ID0gdGhpcy5oYXNoICh0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIHF1ZXJ5WydzaWduYXR1cmUnXSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHJlcXVlc3QpLCB0aGlzLmVuY29kZSAoc2VjcmV0KSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICA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9IGNsYXNzIGJ0Y2NoaW5hIGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2J0Y2NoaW5hJyxcbiAgICAgICAgICAgICduYW1lJzogJ0JUQ0NoaW5hJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQ04nLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MzY4LTQ2NWIzMjg2LTVlZDYtMTFlNy05YTExLTBmNjQ2N2UxZDgyYi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwbHVzJzogJ2h0dHBzOi8vcGx1cy1hcGkuYnRjY2hpbmEuY29tL21hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9kYXRhLmJ0Y2NoaW5hLmNvbS9kYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkuYnRjY2hpbmEuY29tL2FwaV90cmFkZV92MS5waHAnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5idGNjaGluYS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuYnRjY2hpbmEuY29tL2FwaWRvY3MnXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncGx1cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5ZGF0YScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQnV5SWNlYmVyZ09yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCdXlPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQnV5T3JkZXIyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCdXlTdG9wT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbEljZWJlcmdPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbFN0b3BPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QWNjb3VudEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEFyY2hpdmVkT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEFyY2hpdmVkT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREZXBvc2l0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0SWNlYmVyZ09yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRJY2ViZXJnT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXREZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0RGVwdGgyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRTdG9wT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFN0b3BPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0V2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0V2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlcXVlc3RXaXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZWxsSWNlYmVyZ09yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZWxsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlbGxPcmRlcjInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlbGxTdG9wT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9DTlknOiB7ICdpZCc6ICdidGNjbnknLCAnc3ltYm9sJzogJ0JUQy9DT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pO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBrZXkgPSBrZXlzW3BdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNba2V5XTtcbiAgICAgICAgICAgIGxldCBwYXJ0cyA9IGtleS5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGxldCBpZCA9IHBhcnRzWzFdO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBiYXNlID0gYmFzZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIHF1b3RlID0gcXVvdGUudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0QWNjb3VudEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJ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ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ0hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydMb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydCaWRQcmljZSddKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ0Fza1ByaWNlJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHBhcnNlRmxvYXQgKHRpY2tlclsnT3BlbiddKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsnUHJldkNscyddKSxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydMYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsnVm9sdW1lMjRIJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgK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OiBbIGlkLCBtYXJrZXQgXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWNyb3NlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IHAgPSBbXTtcbiAgICAgICAgICAgIGlmICgncGFyYW1zJyBpbiBwYXJhbXMpXG4gICAgICAgICAgICAgICAgcCA9IHBhcmFtc1sncGFyYW1zJ107XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ2lkJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ3BhcmFtcyc6IHAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcCA9IHAuam9pbiAoJywnKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHJlcXVlc3QpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gKFxuICAgICAgICAgICAgICAgICd0b25jZT0nICsgbm9uY2UgK1xuICAgICAgICAgICAgICAgICcmYWNjZXNza2V5PScgKyB0aGlzLmFwaUtleSArXG4gICAgICAgICAgICAgICAgJyZyZXF1ZXN0bWV0aG9kPScgKyBtZXRob2Qud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VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI5MTQyOTExLTBlMWFjZmMyLTdkNWMtMTFlNy05OGM0LTA3ZDk1MzJiMjlkNy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuYnRjbWFya2V0cy5uZXQnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9idGNtYXJrZXRzLm5ldC8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL0JUQ01hcmtldHMvQVBJJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3tpZH0vdGljaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3tpZH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tpZH0vdHJhZGluZ2ZlZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmR0cmFuc2Zlci93aXRoZHJhd0NyeXB0bycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHRyYW5zZmVyL3dpdGhkcmF3RUZUJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jcmVhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvdHJhZGUvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY3JlYXRlQmF0Y2gnLCAvLyB0aGV5IHByb21pc2UgaXQncyBjb21pbmcgc29vbi4uLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2RldGFpbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0FVRCc6IHsgJ2lkJzogJ0JUQy9BVUQnLCAnc3ltYm9sJzogJ0JUQy9BVUQnLCAnYm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AgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IG9yZGVyYm9va1sndGltZXN0YW1wJ10gKiAxMDAwO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB0aW1lc3RhbXApO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd0aW1lc3RhbXAnXSAqIDEwMDA7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsb3cnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiZXN0QmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmVzdEFzayddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdFByaWNlJ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YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddIC8gbXVsdGlwbGllcixcbiAgICAgICAgICAgICdmZWUnOiB7XG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB0cmFkZVsnZmVlJ10gLyBtdWx0aXBsaWVyLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsndm9sdW1lJ10gLyBtdWx0aXBsaWVyLFxuICAgICAgICAgICAgJ29yZGVyJzogdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ29yZGVySWQnKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZU15VHJhZGVzICh0cmFkZXMsIG1hcmtldCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0cmFkZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCB0cmFkZSA9IHRoaXMucGFyc2VNeVRyYWRlICh0cmFkZXNbaV0sIG1hcmtldCk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodHJhZGUpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgbXVsdGlwbGllciA9IDEwMDA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W5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdvcGVuVm9sdW1lJywgMC4wKSAvIG11bHRpcGxpZXI7XG4gICAgICAgIGxldCBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgIGxldCBjb3N0ID0gcHJpY2UgKiBhbW91bnQ7XG4gICAgICAgIGxldCB0cmFkZXMgPSB0aGlzLnBhcnNlTXlUcmFkZXMgKG9yZGVyWyd0cmFkZXMnXSwgbWFya2V0KTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gIC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ICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB1cmkgKyBcIlxcblwiICsgbm9uY2UgKyBcIlxcblwiO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgICAgICdhcGlrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAndGltZXN0YW1wJzogbm9uY2UsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChwYXJhbXMpO1xuICAgICAgICAgICAgICAgIGF1dGggKz0gYm9keTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBzZWNyZXQgPSB0aGlzLmJhc2U2NFRvQmluYXJ5ICh0aGlzLnNlY3JldCk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHNlY3JldCwgJ3NoYTUxMicsICdiYXNlNjQnKTtcbiAgICAgICAgICAgIGhlYWRlcnNbJ3NpZ25hdHVyZSddID0gdGhpcy5kZWNvZGUgKHNpZ25hdHVyZSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25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0JUQyBUcmFkZSBVQScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1VBJywgLy8gVWtyYWluZSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAzMDAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk0MTQ4My03OWZjNzM1MC02MmQ5LTExZTctOWY2MS1hYzQ3ZjI4ZmNkOTYuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYnRjLXRyYWRlLmNvbS51YS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9idGMtdHJhZGUuY29tLnVhJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZG9jcy5nb29nbGUuY29tL2RvY3VtZW50L2QvMW9jWUEweU15X1JYZDU2MXNmRzNxRVBaODBreWxsMzZIVXh2Q1JlNUdiaEUvZWRpdCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlYWxzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvc2VsbC97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL2J1eS97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnamFwYW5fc3RhdC9oaWdoL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhc2sve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpZC97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5L3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteV9vcmRlcnMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3N0YXR1cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZW1vdmUvb3JkZXIve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbC97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQkNIL1VBSCc6IHsgJ2lkJzogJ2JjaF91YWgnLCAnc3ltYm9sJzogJ0JDSC9VQUgnLCAnYmFzZSc6ICdCQ0gnLCAncXVvdGUnOiAnVUFIJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvVUFIJzogeyAnaWQnOiAnYnRjX3VhaCcsICdzeW1ib2wnOiAnQlRDL1VBSCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVQUgnLCAncHJlY2lzaW9uJzogeyAncHJpY2UnOiAxIH0sICdsaW1pdHMnOiB7ICdhbW91bnQnOiB7ICdtaW4nOiAwLjAwMDAwMDAwMDEgfX19LFxuICAgICAgICAgICAgICAgICdEQVNIL0JUQyc6IHsgJ2lkJzogJ2Rhc2hfYnRjJywgJ3N5bWJvbCc6ICdEQVNIL0JUQycsICdiYXNlJzogJ0RBU0gnLCAncXVvdGUnOiAnQlRDJyB9LFxuICAgICAgICAgICA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zoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05WQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDEwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBzaWduSW4gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5wcml2YXRlUG9zdEF1dGggKCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBpZiAoJ2FjY291bnRzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgbGV0IGFjY291bnRzID0gcmVzcG9uc2VbJ2FjY291bnRzJ107XG4gICAgICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGFjY291bnRzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGFjY291bnQgPSBhY2NvdW50c1tiXTtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBhY2NvdW50WydjdXJyZW5jeSddO1xuICAgICAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcGFyc2VGbG9hdCAoYWNjb3VudFsnYmFsYW5jZSddKTtcbiAgICAgICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0ge1xuICAgICAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2UsXG4gICAgICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IGJpZHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlc0J1eVN5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgYXNrcyA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVzU2VsbFN5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0ge1xuICAgICAgICAgICAgJ2JpZHMnOiBbXSxcbiAgICAgICAgICAgICdhc2tzJzogW10sXG4gICAgICAgIH07XG4gICAgICAgIGlmIChiaWRzKSB7XG4gICAgICAgICAgICBpZiAoJ2xpc3QnIGluIGJpZHMpXG4gICAgICAgICAgICAgICAgb3JkZXJib29rWydiaWRzJ10gPSBiaWRzWydsaXN0J107XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFza3MpIHtcbiAgICAgICAgICAgIGlmICgnbGlzdCcgaW4gYXNrcylcbiAgICAgICAgICAgICAgICBvcmRlcmJvb2tbJ2Fza3MnXSA9IGFza3NbJ2xpc3QnXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZ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pbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsb3cnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkJzogYmlkLFxuICAgICAgICAgICAgJ2Fzayc6IGFzayxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHRpY2tlckxlbmd0aCA9IHRpY2tlci5sZW5ndGg7XG4gICAgICAgIGlmICh0aWNrZXJMZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBsZXQgc3RhcnQgPSBNYXRoLm1heCAodGlja2VyTGVuZ3RoIC0gNDgsIDApO1xuICAgICAgICAgICAgZm9yIChsZXQgdCA9IHN0YXJ0OyB0IDwgdGlja2VyLmxlbmd0aDsgdCsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGNhbmRsZSA9IHRpY2tlclt0XTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJlc3VsdFsnb3BlbiddID09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ29wZW4nXSA9IGNhbmRsZVsxXTtcbiAgICAgICAgICAgICAgICBpZiAoKHR5cGVvZiByZXN1bHRbJ2hpZ2gnXSA9PSAndW5kZWZpbmVkJykgfHwgKHJlc3VsdFsnaGlnaCddIDwgY2FuZGxlWzJdKSlcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0WydoaWdoJ10gPSBjYW5kbGVbMl07XG4gICAgICAgICAgICAgICAgaWYgKCh0eXBlb2YgcmVzdWx0Wydsb3cnXSA9PSAndW5kZWZpbmVkJykgfHwgKHJlc3VsdFsnbG93J10gPiBjYW5kbGVbM10pKVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ2xvdyddID0gY2FuZGxlWzNdO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVzdWx0WydiYXNlVm9sdW1lJ10gPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFsnYmFzZVZvbHVtZSddID0gLWNhbmRsZVs1XTtcbiAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFsnYmFzZVZvbHVtZSddIC09IGNhbmRsZVs1XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBsYXN0ID0gdGlja2VyTGVuZ3RoIC0gMTtcbiAgICAgICAgICAgIHJlc3VsdFsnY2xvc2UnXSA9IHRpY2tlcltsYXN0XVs0XTtcbiAgICAgICAgICAgIHJlc3VsdFsnYmFzZVZvbHVtZSddID0gLTEgKiByZXN1bHRbJ2Jhc2VWb2x1bWUnXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGNvbnZlcnRDeXJpbGxpY01vbnRoTmFtZVRvU3RyaW5nIChjeXJpbGxpYykge1xuICAgICAgICBsZXQgbW9udGhzID0ge1xuICAgICAgICAgICAgJ9GP0L3QstCw0YDRjyc6ICcwMScsXG4gICAgICAgICAgICAn0YTQtdCy0YDQsNC70Y8nOiAnMDInLFxuICAgICAgICAgICAgJ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xuICAgICAgICBsZXQgaG1zTGVuZ3RoID0gaG1zLmxlbmd0aDtcbiAgICAgICAgaWYgKGhtc0xlbmd0aCA9PSA3KSB7XG4gICAgICAgICAgICBobXMgPSAnMCcgKyBobXM7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGRheS5sZW5ndGggPT0gMSkge1xuICAgICAgICAgICAgZGF5ID0gJzAnICsgZGF5O1xuICAgICAgICB9XG4gICAgICAgIGxldCB5bWQgPSBbIHllYXIsIG1vbnRoLCBkYXkgXS5qb2luICgnLScpO1xuICAgICAgICBsZXQgeW1kaG1zID0geW1kICsgJ1QnICsgaG1zO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHltZGhtcyk7XG4gICAgICAgIC8vIHNlcnZlciByZXBvcnRzIGxvY2FsIHRpbWUsIGFkanVzdCB0byBVVENcbiAgICAgICAgbGV0IG1kID0gWyBtb250aCwgZGF5IF0uam9pbiAoJycpO1xuICAgICAgICBtZCA9IHBhcnNlSW50IChtZCk7XG4gICAgICAgIC8vIGEgc3BlY2lhbCBjYXNlIGZvciBEU1RcbiAgICAgICAgLy8gc3VidHJhY3QgMiBob3VycyBkdXJpbmcgd2ludGVyXG4gICAgICAgIGlmIChtZCA8IDMyNSB8fCBtZCA+IDEwMjgpXG4gICAgICAgICAgICByZXR1cm4gdGltZXN0YW1wIC0gNzIwMDAwMDtcbiAgICAgICAgLy8gc3VidHJhY3QgMyBob3VycyBkdXJpbmcgc3VtbWVyXG4gICAgICAgIHJldHVybiB0aW1lc3RhbXAgLSAxMDgwMDAwMDtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlQ3lyaWxsaWNEYXRldGltZSAodHJhZGVbJ3B1Yl9kYXRlJ10pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ2l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pKyspIHtcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVtpXVsnaWQnXSAlIDIpIHtcbiAgICAgICAgICAgICAgICB0cmFkZXMucHVzaCAocmVzcG9uc2VbaV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzICh0cmFkZXMsIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3ByaXZhdGVQb3N0JyArIHRoaXMuY2FwaXRhbGl6ZSAoc2lkZSkgKyAnSWQnO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnY291bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY3VycmVuY3kxJzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydiYXNlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RSZW1vdmVPcmRlcklkICh7ICdpZCc6IGlkIH0pO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ2lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLCAvLyB1bnRpbCB0aGV5IGZpeCB0aGVpciB0aW1lc3RhbXBcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzdGF0dXMnOiAnb3BlbicsXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsndHlwZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2FtbnRfdHJhZGUnXSxcbiAgICAgICAgICAgICdmaWxsZWQnOiAwLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHRyYWRlWydhbW50X3RyYWRlJ10sXG4gICAgICAgICAgICAndHJhZGVzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9wZW5PcmRlcnMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBpZiAoIXN5bWJvbClcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXR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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIGJ0Y3R1cmsgZXh0ZW5kcyBFeGNoYW5nZSB7XG5cbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnYnRjdHVyaycsXG4gICAgICAgICAgICAnbmFtZSc6ICdCVENUdXJrJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnVFInLCAvLyBUdXJrZXlcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc5OTI3MDktMThlMTU2NDYtNjRhMy0xMWU3LTlmYTItYjA5NTBlYzc3MTJmLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5idGN0dXJrLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYnRjdHVyay5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL0JUQ1RyYWRlci9icm9rZXItYXBpLWRvY3MnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvaGxjZGF0YScsIC8vID9sYXN0PUNPVU5UXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsICAgLy8gP2xhc3Q9Q09VTlQgKG1heCA1MClcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJUcmFuc2FjdGlvbnMnLCAvLyA/b2Zmc2V0PTAmbGltaXQ9MjUmc29ydD1hc2NcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1RSWSc6IHsgJ2lkJzogJ0JUQ1RSWScsICdzeW1ib2wnOiAnQlRDL1RSWScsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdUUlknLCAnbWFrZXInOiAwLjAwMiAqIDEuMTgsICd0YWtlcic6IDAuMDAzNSAqIDEuMTggfSxc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W1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogcGFyc2VGbG9hdCAodGlja2VyWydvcGVuJ10pLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYXZlcmFnZSddKSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlcnMgKHN5bWJvbHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHBhcmFtcyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aWNrZXJzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSB0aWNrZXJbJ3BhaXInXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoc3ltYm9sIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtzeW1ib2xdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gYXdhaXQgdGhpcy5mZXRjaFRpY2tlcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChzeW1ib2wgaW4gdGlja2VycylcbiAgICAgICAgICAgIHJlc3VsdCA9IHRpY2tlcnNbc3ltYm9sXTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAg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Rob2QgPSAncHJpdmF0ZVBvc3QnICsgdGhpcy5jYXBpdGFsaXplIChzaWRlKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ1R5cGUnOiAoc2lkZSA9PSAnYnV5JykgPyAnQnV5QnRjJyA6ICdTZWxCdGMnLFxuICAgICAgICAgICAgJ0lzTWFya2V0T3JkZXInOiAodHlwZSA9PSAnbWFya2V0JykgPyAxIDogMCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHR5cGUgPT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIGlmIChzaWRlID09ICdidXknKVxuICAgICAgICAgICAgICAgIG9yZGVyWydUb3RhbCddID0gYW1vdW50O1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIG9yZGVyWydBbW91bnQnXSA9IGFtb3VudDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9yZGVyWydQcmljZSddID0gcHJpY2U7XG4gICAgICAgICAgICBvcmRlclsnQW1vdW50J10gPSBhbW91bnQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh7ICdpZCc6IGlkIH0pO1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIHNp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XMgdmVyeSBwb29yLCB1bmFibGUgdG8gdGVsbCByYXRlIGxpbWl0c1xuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYzODUtOWZkY2M5OGMtNWVkNi0xMWU3LThmMTQtNjZkNWU1Y2Q0N2U2LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2J0Yy14LmlzL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2J0Yy14LmlzJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYnRjLXguaXMvY3VzdG9tL2FwaS1kb2N1bWVudC5odG1sJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve2lkfS97bGltaXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfS97bGltaXR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWRlZW0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ2J0Yy91c2QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnYnRjL2V1cicsICdzeW1ib2wnOiAnQlRDL0VVUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdFVVInIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RCYWxhbmNlICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzKTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlc1tjdXJyZW5jeV0sXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZXNbY3VycmVuY3ldLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdFt1cHBlcmNhc2VdID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0RGVwdGhJZExpbWl0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICdsaW1pdCc6IDEwMDAsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdiaWRzJywgJ2Fza3MnLCAncHJpY2UnLCAnYW1vdW50Jyk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VySWQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndGltZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgIC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A9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdNZXRob2QnOiBwYXRoLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgICAgICdOb25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ25hdHVyZSc6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGJvZHkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG59XG4iLCJcInVzZSBzdH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y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc5ODA0NzktY2ZhMzE4OGMtNjM4Ny0xMWU3LTgxOTEtOTNmYzQxODRiYTVjLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2RhdGEuYnRlci5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkuYnRlci5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9idGVyLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2J0ZXIuY29tL2FwaTInLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYnRlci5jb20vZmVlJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGxpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckJvb2sve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVIaXN0b3J5L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlSGlzdG9yeS97aWR9L3t0aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ25ld0FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzV2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbEFsbE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldGluZm8gKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAncGFpcnMnKTtcbiAgICAgICAgaWYgKCFtYXJrZXRzKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGZldGNoTWFya2V0cyBnb3QgYW4gdW5yZWNvZ25pemVkIHJlc3BvbnNlJyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldCk7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzWzBdO1xuICAgICAgICAgICAgbGV0IGRldGFpbHMgPSBtYXJrZXRbaWRdO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgYmFzZSA9IGJhc2UudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBxdW90ZSA9IHF1b3RlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBkZXRhaWxzWydkZWNpbWFsX3BsYWNlcyddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IGRldGFpbHNbJ2RlY2ltYWxfcGxhY2VzJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFtb3VudExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogZGV0YWlsc1snbWluX2Ftb3VudCddLFxuICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByaWNlTGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnRMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBkZXRhaWxzWydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBkZXRhaWxzWydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZSB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmICgnYXZhaWxhYmxlJyBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VbJ2F2YWlsYWJsZSddKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2F2YWlsYWJsZSddW2N1cnJlbmN5XSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdsb2NrZWQnIGluIGJhbGFuY2UpIHtcbiAgICAgICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZVsnbG9ja2VkJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnbG9ja2VkJ11bY3VycmVuY3ldKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IGFjY291bnQ7X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5cyAodGlja2Vycyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgWyBiYXNlSWQsIHF1b3RlSWQgXSA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBiYXNlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBxdW90ZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKHN5bWJvbCBpbiB0aGlzLm1hcmtldHMpXG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICA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JpdmF0ZScpID8gKGFwaSArICcvJykgOiAnJztcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXSArIHRoaXMudmVyc2lvbiArICcvMS8nICsgcHJlZml4ICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0geyAnbm9uY2UnOiBub25jZSB9O1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcXVlcnkpKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChib2R5KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiBzaWduYXR1cmUsXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgIC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IGJ4aW50aCBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdieGludGgnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQlguaW4udGgnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdUSCcsIC8vIFRoYWlsYW5kXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY0MTItNTY3YjFlYjQtNWVkNy0xMWU3LTk0YTgtZmY2YTM4ODRmNmM1LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2J4LmluLnRoL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2J4LmluLnRoJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYnguaW4udGgvaW5mby9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICcnLCAvLyB0aWNrZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb25ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZWhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpbGxlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlsbGdyb3VwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaWxscGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWlzc3VlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLW15aXNzdWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1teWJpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLW15b3B0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWV4ZXJjaXNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24taGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWwtaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFBhaXJpbmcgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNba2V5c1twXV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3BhaXJpbmdfaWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydzZWNvbmRhcnlfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncHJpbWFyeV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBjb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KSB7XG4gICAgICAgIC8vIHdoeSB3b3VsZCB0aGV5IHVzZSB0aHJlZSBsZXR0ZXJzIGluc3RlYWQgb2YgZm91ciBmb3IgY3VycmVuY3kgY29kZXNcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdEQVMnKVxuICAgICAgICAgICAgcmV0dXJuICdEQVNIJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdET0cnKVxuICAgICAgICAgICAgcmV0dXJuICdET0dFJztcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2UpO1xuICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGN1cnJlbmNpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbY3VycmVuY3ldWydhdmFpbGFibGUnXSksXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ3RvdGFsJ10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRPcmRlcmJvb2sgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcmluZyc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpb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uICAgICAgICBsZXQgcGFpcmluZyA9IHVuZGVmaW5lZDsgLy8gVE9ETyBmaXhtZVxuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbCAoe1xuICAgICAgICAgICAgJ29yZGVyX2lkJzogaWQsXG4gICAgICAgICAgICAncGFpcmluZyc6IHBhaXJpbmcsXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLyc7XG4gICAgICAgIGlmIChwYXRoKVxuICAgICAgICAgICAgdXJsICs9IHBhdGggKyAnLyc7XG4gICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IHRoaXMuYXBpS2V5ICsgbm9uY2UudG9TdHJpbmcgKCkgKyB0aGlzLnNlY3JldDtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhhc2ggKHRoaXMuZW5jb2RlIChhdXRoKSwgJ3NoYTI1NicpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiB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2FwaV9wdWIuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYy1jZXguY29tL3QvYXBpLmh0bWwnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2MtY2V4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2MtY2V4LmNvbS8/aWQ9YXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd0aWNrZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvaW5uYW1lcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ZvbHVtZV97Y29pbn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlZGlzdHJpYnV0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzdW1tYXJpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXlsaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0b3Blbm9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG9yZGVyaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxsaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdJT1QnKVxuICAgICAgICAgICAgcmV0dXJuICdJb1Rjb2luJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCTEMnKVxuICAgICAgICAgICAgcmV0dXJuICdDcnlwdG9idWxsY29pbic7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnWElEJylcbiAgICAgICAgICAgIHJldHVybiAnSW50ZXJuYXRpb25hbERpYW1vbmQnO1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWydyZXN1bHQnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ3Jlc3VsdCddW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydNYXJrZXROYW1lJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnTWFya2V0Q3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnQmFzZUN1cnJlbmN5J107XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0c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AgICAgICAgICAndHlwZSc6ICdib3RoJyxcbiAgICAgICAgICAgICdkZXB0aCc6IDEwMCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHVuZGVmaW5lZCwgJ2J1eScsICdzZWxsJywgJ1JhdGUnLCAnUXVhbnRpdHknKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndXBkYXRlZCddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYnV5J10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnc2VsbCddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICA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Q7XG4gICAgICAgICAgICBpZiAodXBwZXJjYXNlIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFt1cHBlcmNhc2VdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSB1cHBlcmNhc2Uuc3BsaXQgKCctJyk7XG4gICAgICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMudGlja2Vyc0dldE1hcmtldCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdtYXJrZXQnOiBtYXJrZXRbJ2lkJ10udG9Mb3dlckNhc2UgKCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3RpY2tlciddO1xuICAgICAgICByZXR1cm4gdGhp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lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5rZXlzb3J0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ2FwaXNpZ24nOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlICh1cmwpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJykgfTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYSc6ICdnZXQnICsgcGF0aCxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdXJsICs9ICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKSArICcuanNvbic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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIGNleCBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdjZXgnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQ0VYLklPJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdHQicsICdFVScsICdDWScsICdSVScgXSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQ0Mi04ZGRjMzNiMC01ZWQ4LTExZTctOGI5OC1mNzg2YWVmMGYzYzkuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vY2V4LmlvL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2NleC5pbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2NleC5pby9jZXgtYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3lfbGltaXRzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdF9wcmljZS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlcy97Y3VycmVuY2llc30vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvaGxjdi9oZC97eXl5eW1tZGR9L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vay97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2Vycy97Y3VycmVuY2llc30vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9oaXN0b3J5L3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb252ZXJ0L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2Vfc3RhdHMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY3RpdmVfb3JkZXJzX3N0YXR1cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FyY2hpdmVkX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfcmVwbGFjZV9vcmRlci97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjbG9zZV9wb3NpdGlvbi97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9teWZlZS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlcl90eC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9wb3NpdGlvbi97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX3Bvc2l0aW9ucy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZV9vcmRlci97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDdXJyZW5jeUxpbWl0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHNbJ2RhdGEnXVsncGFpcnMnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ2RhdGEnXVsncGFpcnMnXVtwXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnc3ltYm9sMSddICsgJy8nICsgbWFya2V0WydzeW1ib2wyJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsnbWluUHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiAtMSAqIE1hdGgubG9nMTAgKG1hcmtldFsnbWluTG90U2l6ZSddKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydtaW5Mb3RTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhMb3RTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21pblByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWF4UHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbWluTG90U2l6ZVMyJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgbGV0IG9tbWl0ZWQgPSBbICd1c2VybmFtZScsICd0aW1lc3RhbXAnIF07XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHRoaXMub21pdCAocmVzcG9uc2UsIG9tbWl0ZWQpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICAgICAnZnJlZSc6IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlc1tjdXJyZW5jeV0sICdhdmFpbGFibGUnLCAwLjApLFxuICAgICAgICAgICAgICAgICAgICAndXNlZCc6IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlc1tjdXJyZW5jeV0sICdvcmRlcnMnLCAwLjApLFxuICAgICAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJCb29rUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBvcmR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LCAnYXNrJyk7XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGlzbzg2MDEsXG4gICAgICAgICAgICAnaGlnaCc6IGhpZ2gsXG4gICAgICAgICAgICAnbG93JzogbG93LFxuICAgICAgICAgICAgJ2JpZCc6IGJpZCxcbiAgICAgICAgICAgICdhc2snOiBhc2ssXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb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1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlSGlzdG9yeVBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcb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hc2UnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUZlZSA9ICdmYTonICsgbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgbGV0IGZlZVJhdGUgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICd0cmFkaW5nRmVlTWFrZXInKTtcbiAgICAgICAgICAgIGlmICghZmVlUmF0ZSlcbiAgICAgICAgICAgICAgICBmZWVSYXRlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAndHJhZGluZ0ZlZVRha2VyJywgZmVlUmF0ZSk7XG4gICAgICAgICAgICBpZiAoZmVlUmF0ZSlcbiAgICAgICAgICAgICAgICBmZWVSYXRlIC89IDEwMC4wOyAvLyBjb252ZXJ0IHRvIG1hdGhlbWF0aWNhbGx5LWNvcnJlY3QgcGVyY2VudGFnZSBjb2VmZmljaWVudHM6IDEuMCA9IDEwMCVcbiAgICAgICAgICAgIGlmIChiYXNlRmVlIGluIG9yZGVyKSB7XG4gICAgICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ2Jhc2UnXSxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUnOiBmZWVSYXRlLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgYmFzZUZlZSksXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocXVvdGVGZWUgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUnOiBmZWVSYXRlLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgcXVvdGVGZWUpLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFjb3N0KVxuICAgICAgICAgICAgY29zdCA9IHByaWNlICogZmlsbGVkO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3Blbk9yZGVycyAoc3ltYm9sID0gdW5kZWZpbmVkLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge307XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3RPcGVuT3JkZXJzJztcbiAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYg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SwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG5vbmNlICsgdGhpcy51aWQgKyB0aGlzLmFwaUtleTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICghcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm5lZCAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICB9IGVsc2UgaWYgKHJlc3BvbnNlID09IHRydWUpIHtcbiAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgfSBlbHNlIGlmICgnZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmICgnb2snIGluIHJlc3BvbnNlKVxuICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnb2snXSA9PSAnb2snKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgfSBlbHNlIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBpZiAocmVzcG9uc2VbJ2Vycm9yJ10pXG4gICAgICAg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naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODU1NTY1OS1mMDA0MGRjMi03MTA5LTExZTctOWQ5OS02ODhhNDM4YmY5ZjQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHA6Ly9hcGkuY2hidGMuY29tL2RhdGEnLCAvLyBubyBodHRwcyBmb3IgcHVibGljIEFQSVxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3RyYWRlLmNoYnRjLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3RyYWRlLmNoYnRjLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuY2hidGMuY29tL2kvZGV2ZWxvcGVyJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGdldE1hcmtldEZpZWxkTmFtZSAoKSB7XG4gICAgICAgIHJldHVybiAnY3VycmVuY3knO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnQlRDL0NOWSc6IHsgJ2lkJzogJ2J0Y19jbnknLCAnc3ltYm9sJzogJ0JUQy9DTlknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ05ZJyB9LFxuICAgICAgICAgICAgJ0xUQy9DTlknOiB7ICdpZCc6ICdsdGNfY255JywgJ3N5bWJvbCc6ICdMVEMvQ05ZJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ0NOWScgfSxcbiAgICAgICAgICAgICdFVEgvQ05ZJzogeyAnaWQnOiAnZXRoX2NueScsICdzeW1ib2wnOiAnRVRIL0NOWScsICdiYXNlJzogJ0VUSCcsICdxdW90ZSc6ICdDTlknIH0sXG4gICAgICAgICAgICAnR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uZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2NvaW5jaGVjaycsXG4gICAgICAgICAgICAnbmFtZSc6ICdjb2luY2hlY2snLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ0pQJywgJ0lEJyBdLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQ2NC0zYjVjM2M3NC01ZWQ5LTExZTctODQwZS0zMWIzMjk2OGUxZGEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vY29pbmNoZWNrLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2luY2hlY2suY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vY29pbmNoZWNrLmNvbS9kb2N1bWVudHMvZXhjaGFuZ2UvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3JhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyYXRlL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL2xldmVyYWdlX2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbmtfYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRfbW9uZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVycy9vcGVucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3RyYW5zYWN0aW9uc19wYWdpbmF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9sZXZlcmFnZS9wb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRpbmcvYm9ycm93cy9tYXRjaGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kX21vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYW5rX2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X21vbmV5L3tpZH0vZmFzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90cmFuc2ZlcnMvdG9fbGV2ZXJhZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RyYW5zZmVycy9mcm9tX2xldmVyYWdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kaW5nL2JvcnJvd3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRpbmcvYm9ycm93cy97aWR9L3JlcGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kX21vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbmtfYWNjb3VudHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvSlBZJzogeyAnaWQnOiAnYnRjX2pweScsICdzeW1ib2wnOiAnQlRDL0pQWScsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdKUFknIH0sIC8vIHRoZSBvbmx5IHJlYWwgcGFpclxuICAgICAgICAgICAgICAgIC8vICdFVEgvSlBZJzogeyAnaWQnOiAnZXRoX2pweScsICdzeW1ib2wnOiAnRVRIL0pQWScsICdiYXNlJzogJ0VUSCcsICdxdW90ZSc6ICdKUFknIH0sXG4gICAgICAgICAgICAgICAgLy8gJ0VUQy9KUFknOiB7ICdpZCc6ICdldGNfanB5JywgJ3N5bWJvbCc6ICdFVEMvSlBZJywgJ2Jhc2U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gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3ZvbHVtZSddKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnY3JlYXRlZF9hdCddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydvcmRlcl90eXBlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwYXJzZUZsb2F0ICh0cmFkZVsncmF0ZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgfTtcbiAgIC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4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG5vbmNlICsgdXJsICsgcXVlcnlTdHJpbmc7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnQUNDRVNTLUtFWSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdBQ0NFU1MtTk9OQ0UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnQUNDRVNTLVNJR05BVFVSRSc6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJylcbiAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSlcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnc3VjY2VzcyddKVxuICAgICAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgdGhyb3cgbmV3IEV4Y2h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gICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIC8vIG5ldyBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoVHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zNDg0MjMwMy0yOWM5OWZjYS1mNzFjLTExZTctODNjMS0wOWQ5MDBjYjIzMzQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmNvaW5leGNoYW5nZS5pby9hcGkvdjEnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuY29pbmV4Y2hhbmdlLmlvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vY29pbmV4Y2hhbmdlaW8uZ2l0aHViLmlvL3NsYXRlLycsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cuY29pbmV4Y2hhbmdlLmlvL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y3VycmVuY2llcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0bWFya2V0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0bWFya2V0c3VtbWFyaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRtYXJrZXRzdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxNSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDE1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hDdXJyZW5jaWVzIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY2llcyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHByZWNpc2lvbiA9IHRoaXMucHJlY2lzaW9uWydhbW91bnQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jeVsnQ3VycmVuY3lJRCddO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3lbJ1RpY2tlckNvZGUnXSk7XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gY3VycmVuY3lbJ1dhbGxldFN0YXR1cyddID09ICdvbmxpbmUnO1xuICAgICAgICAgICAgbGV0IHN0YXR1cyA9ICdvayc7XG4gICAgICAgICAgICBpZiAoIWFjdGl2ZSlcbiAgICAgICAgICAgICAgICBzdGF0dXMgPSAnZGlzYWJsZWQnO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WydOYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydNYXJrZXRJRCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAobWFya2V0WydNYXJrZXRBc3NldENvZGUnXSk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAobWFya2V0WydCYXNlQ3VycmVuY3lDb2RlJ10pO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGlmICghbWFya2V0KSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0SWQgPSB0aWNrZXJbJ01hcmtldElEJ107XG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNCeUlkW21hcmtldElkXTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnSGlnaFByaWNlJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnTG93UHJpY2UnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydCaWRQcmljZSddKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ0Fza1ByaWNlJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydMYXN0UHJpY2UnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogcGFyc2VGbG9hdCAodGlja2VyWydDaGFuZ2UnXSksXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ1ZvbHVtZSddKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0c3VtbWFyeSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdtYXJrZXRfaWQnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2V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IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9jb2luZmxvb3IvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmNvaW5mbG9vci5jby51ay9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vdGlja2VyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9vcmRlcl9ib29rLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS90cmFuc2FjdGlvbnMvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2JhbGFuY2UvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3VzZXJfdHJhbnNhY3Rpb25zLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9vcGVuX29yZGVycy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vY2FuY2VsX29yZGVyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9idXkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3NlbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgIC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ICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRJZFRpY2tlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICA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S0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgY29pbmdpIGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2NvaW5naScsXG4gICAgICAgICAgICAnbmFtZSc6ICdDb2luZ2knLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnUEEnLCAnQkcnLCAnQ04nLCAnVVMnIF0sIC8vIFBhbmFtYSwgQnVsZ2FyaWEsIENoaW5hLCBVU1xuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODYxOTcwNy01YzkyMzJhOC03MjEyLTExZTctODZkNi05OGZlNWQxNWNjNmUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vY29pbmdpLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW50JzogJ2h0dHBzOi8vYXBpLmNvaW5naS5jb20nLFxuICAgICAgICAgICAgICAgICAgICAndXNlcic6ICdodHRwczovL2FwaS5jb2luZ2kuY29tJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2luZ2kuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHA6Ly9kb2NzLmNvaW5naS5hcGlhcnkuaW8vJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3d3cnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdjdXJyZW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyLWJvb2sve3BhaXJ9L3thc2tDb3VudH0ve2JpZENvdW50fS97ZGVwdGh9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMve3BhaXJ9L3ttYXhDb3VudH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJzI0aG91ci1yb2xsaW5nLWFnZ3JlZ2F0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd1c2VyJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhZGQtb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbC1vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZS1jcnlwdG8td2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdWVEMnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTk1DJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogMTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTk1DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIHRoaXMucGFyc2VKc29uUmVzcG9uc2UgPSBmYWxzZTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy53d3dHZXQgKCk7XG4gICAgICAgIHRoaXMucGFyc2VKc29uUmVzcG9uc2UgPSB0cnVlO1xuICAgICAgICBsZXQgcGFydHMgPSByZXNwb25zZS5zcGxpdCAoJ2RvPWN1cnJlbmN5UGFpclNlbGVjdG9yLXNlbGVjdEN1cnJlbmN5UGFpclwiIGNsYXNzPVwiYWN0aXZlXCI+Jyk7XG4gICAgICAgIGxldCBjdXJyZW5jeVBhcnRzID0gcGFydHNbMV0uc3BsaXQgKCc8ZGl2IGNsYXNzPVwiY3VycmVuY3ktcGFpci1sYWJlbFwiPicpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAxOyBpIDwgY3VycmVuY3lQYXJ0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5UGFydCA9IGN1cnJlbmN5UGFydHNbaV07XG4gICAgICAgICAgICBsZXQgaWRQYXJ0cyA9IGN1cnJlbmN5UGFydC5zcGxpdCAoJzwvZGl2PicpO1xuICAgICAgICAgICAgbGV0IGlkID0gaWRQYXJ0c1swXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZDtcbiAgICAgICAgICAgIGlkID0gaWQucmVwbGFjZSAoJy8nLCAnLScpO1xuICAgICAgICAgICAgaWQgPSBpZC50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBzeW1ib2wuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGlkLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGxvd2VyY2FzZUN1cnJlbmNpZXMgPSBbXTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAodGhpcy5jdXJyZW5jaWVzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbG93ZXJjYXNlQ3VycmVuY2llcy5wdXNoIChjdXJyZW5jeS50b0xvd2VyQ2FzZSAoKSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy51c2VyUG9zdEJhbGFuY2UgKHtcbiAgICAgICAgICAgICdjdXJyZW5jaWVzJzogbG93ZXJjYXNlQ3VycmVuY2llcy5qb2luICgnLCcpXG4gICAgICAgIH0pO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddWyduYW1lJ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gKHN5bWJvbCBpbiB0aGlzLm1hcmtldHMpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNbc3ltYm9sXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLmZldGNoVGlja2VycyAodW5kZWZpbmVkLCBwYXJhbXMpO1xuICAgICAgICBpZiAoc3ltYm9sIGluIHRpY2tlcnMpXG4gICAgICAgICAgICByZXR1cm4gdGlja2Vyc1tzeW1ib2xdO1xuICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcmV0dXJuIGRpZCBub3QgY29udGFpbiAnICsgc3ltYm9sKTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGlmICghbWFya2V0KVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydjdXJyZW5jeVBhaXInXV07XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdHJhZGVbJ3RpbWVzdGFtcCddLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0cmFkZVsndGltZXN0YW1wJ10pLFxuICAgICAgICAgICAgJ3N5bWJ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C5jb2lubWFya2V0Y2FwLmNvbScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vY29pbm1hcmtldGNhcC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9jb2lubWFya2V0Y2FwLmNvbS9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnZmlsZXMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2VuZXJhdGVkL3N0YXRzL2dsb2JhbC5qc29uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdncmFwaHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY2llcy97bmFtZX0vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3tpZH0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnbG9iYWwvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjdXJyZW5jeUNvZGVzJzogW1xuICAgICAgICAgICAgICAgICdBVUQnLFxuICAgICAgICAgICAgICAgICdCUkwnLFxuICAgICAgICAgICAgICAgICdDQUQnLFxuICAgICAgICAgICAgICAgICdDSEYnLFxuICAgICAgICAgICAgICAgICdDTlknLFxuICAgICAgICAgICAgICAgICdFVVInLFxuICAgICAgICAgICAgICAgICdHQlAnLFxuICAgICAgICAgICAgICAgICdIS0QnLFxuICAgICAgICAgICAgICAgICdJRFInLFxuICAgICAgICAgICAgICAgICdJTlInLFxuICAgICAgICAgICAgICAgICdKUFknLFxuICAgICAgICAgICAgICAgICdLUlcnLFxuICAgICAgICAgICAgICAgICdNWE4nLFxuICAgICAgICAgICAgICAgICdSVUInLFxuICAgICAgICAgICAgICAgICdVU0QnLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKCdGZXRjaGluZyBvcmRlciBib29rcyBpcyBub3Qgc3VwcG9ydGVkIGJ5IHRoZSBBUEkgb2YgJyArIHRoaXMuaWQpO1xuICAgIH1cblxuICAgIGN1cnJlbmN5Q29kZSAoYmFzZSwgbmFtZSkge1xuICAgICAgICBjb25zdCBjdXJyZW5jaWVzID0ge1xuICAgICAgICAgICAgJ0JpdGdlbSc6ICdCaXRnZW0nLFxuICAgICAgICAgICAgJ05ldENvaW4nOiAnTmV0Q29pbicsXG4gICAgICAgICAgICAnQmF0Q29pbic6ICdCYXRDb2luJyxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKG5hbWUgaW4gY3VycmVuY2llcylcbiAgICAgICAgICAgIHJldHVybiBjdXJyZW5jaWVzW25hbWVdO1xuICAgICAgICByZXR1cm4gYmFzZTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh7XG4gICAgICAgICAgICAnbGltaXQnOiAwLFxuICAgICAgICB9KTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSB0aGlzLmN1cnJlbmN5Q29kZXM7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZUlkID0gcXVvdGUudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY3VycmVuY3lDb2RlIChtYXJrZXRbJ3N5bWJvbCddLCBtYXJrZXRbJ25hbWUnXSk7XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBiYXNlSWQgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAg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IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHZvbHVtZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgbGV0IHByaWNlS2V5ID0gJ3ByaWNlXycgKyBtYXJrZXRbJ3F1b3RlSWQnXTtcbiAgICAgICAgICAgIGlmIChwcmljZUtleSBpbiB0aWNrZXIpXG4gICAgICAgICAgICAgICAgaWYgKHRpY2tlcltwcmljZUtleV0pXG4gICAgICAgICAgICAgICAgICAgIGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCBwcmljZUtleSk7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IHZvbHVtZUtleSA9ICcyNGhfdm9sdW1lXycgKyBtYXJrZXRbJ3F1b3RlSWQnXTtcbiAgICAgICAgICAgIGlmICh2b2x1bWVLZXkgaW4gdGlja2VyKVxuICAgICAgICAgICAgICAgIGlmICh0aWNrZXJbdm9sdW1lS2V5XSlcbiAgICAgICAgICAgICAgICAgICAgdm9sdW1lID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgdm9sdW1lS2V5KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsb3cnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZW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gICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRpY2tlcnNbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGlja2VycztcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjb252ZXJ0JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydiYXNlSWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJJZCAocmVxdWVzdCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVswXTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbGltaXQnOiAwXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmN5WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBuYW1lID0gY3VycmVuY3lbJ25hbWUnXTtcbiAgICAgICAgICAgIC8vIHRvZG86IHdpbGwgbmVlZCB0byByZXRoaW5rIHRoZSBmZWVzXG4gICAgICAgICAgICAvLyB0byBhZGQgc3VwcG9ydCBmb3IgbXVsdGlwbGUgd2l0aGRyYXdhbC9kZXBvc2l0IG1ldGhvZHMgYW5kXG4gICAgICAgICAgICAvLyBkaWZmZXJlbnRpYXRlZCBmZWVzIGZvciBlYWNoIHBhcnRpY3VsYXIgbWV0aG9kXG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0gODsgLy8gZGVmYXVsdCBwcmVjaXNpb24sIHRvZG86IGZpeCBcIm1hZ2ljIGNvbnN0YW50c1wiXG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY3VycmVuY3lDb2RlIChpZCwgbmFtZSk7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBuYW1lLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsIC8vIHRvZG86IHJlZGVzaWduXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGkn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gICAgICAnaHR0cDovL2RvY3MuY29pbm1hdGUuYXBpYXJ5LmlvJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vY29pbm1hdGUuaW8vZGV2ZWxvcGVycycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJCb29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5XaXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luRGVwb3NpdEFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5SW5zdGFudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5TGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcldpdGhJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGVWb3VjaGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWRlZW1Wb3VjaGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsSW5zdGFudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbExpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbkhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VuY29uZmlybWVkQml0Y29pbkRlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnQlRDX0VVUicsICdzeW1ib2wnOiAnQlRDL0VVUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdFVVInLCAncHJlY2lzaW9uJzogeyAnYW1vdW50JzogNCwgJ3ByaWNlJzogMiB9fSxcbiAgICAgICAgICAgICAgICAnQlRDL0NaSyc6IHsgJ2lkJzogJ0JUQ19DWksnLCAnc3ltYm9sJzogJ0JUQy9DWksnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ1pLJywgJ3ByZWNpc2lvbic6IHsgJ2Ftb3VudCc6IDQsICdwcmljZSc6IDIgfX0sXG4gICAgICAgICAgICAgICAgJ0xUQy9CVEMnOiB7ICdpZCc6ICdMVENfQlRDJywgJ3N5bWJvbCc6ICdMVEMvQlRDJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ0JUQycsICdwcmVjaXNpb24nOiB7ICdhbW91bnQnOiA0LCAncHJpY2UnOiA1IH19LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAzNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAodGhpcy5jdXJyZW5jaWVzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZXMpIHtcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBiYWxhbmNlc1tjdXJyZW5jeV1bJ2F2YWlsYWJsZSddO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGJhbGFuY2VzW2N1cnJlbmN5XVsncmVzZXJ2ZWQnXTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gYmFsYW5jZXNbY3VycmVuY3ldWydiYWxhbmNlJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4g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GFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYW1vdW50J10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAoIW1hcmtldClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFt0cmFkZVsnY3VycmVuY3lQYWlyJ11dO1xuICAgICAgICByZXR1cm4ge1xu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IHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3QnICsgdGhpcy5jYXBpdGFsaXplIChzaWRlKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2N1cnJlbmN5UGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdtYXJrZXQnKSB7XG4gICAgICAgICAgICBpZiAoc2lkZSA9PSAnYnV5JylcbiAgICAgICAgICAgICAgICBvcmRlclsndG90YWwnXSA9IGFtb3VudDsgLy8gYW1vdW50IGluIGZpYXRcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBvcmRlclsnYW1vdW50J10gPSBhbW91bnQ7IC8vIGFtb3VudCBpbiBmaWF0XG4gICAgICAgICAgICBtZXRob2QgKz0gJ0luc3RhbnQnO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb3JkZXJbJ2Ftb3VudCddID0gYW1vdW50OyAvLyBhbW91bnQgaW4gY3J5cHRvXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICAgICAgbWV0aG9kICs9IHRoaXMuY2FwaXRhbGl6ZSAodHlwZSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdIChzZWxmLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydkYXRhJ10udG9TdHJpbmcgKCksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLnByaXZhdGVQb3N0Q2FuY2VsT3JkZXIgKHsgJ29yZGVySWQnOiBpZCB9KTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG5vbmNlICsgdGhpcy51aWQgKyB0aGlzLmFwaUtleTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2NsaWVudElkJzogdGhpcy51aWQsXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ3B1YmxpY0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICB9LCBwYXJhbXM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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIGNvaW5zZWN1cmUgZXh0ZW5kcyBFeGNoYW5nZSB7XG5cbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnY29pbnNlY3VyZScsXG4gICAgICAgICAgICAnbmFtZSc6ICdDb2luc2VjdXJlJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnSU4nLCAvLyBJbmRpYVxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NDcyLTljYmQyMDBhLTVlZDktMTFlNy05NTUxLTIyNjdhZDdiYWMwOC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuY29pbnNlY3VyZS5pbicsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2NvaW5zZWN1cmUuaW4nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS5jb2luc2VjdXJlLmluJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9jb2luc2VjdXJlL3BsdWdpbnMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luL3NlYXJjaC9jb25maXJtYXRpb24ve3R4aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9hc2svbG93JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9hc2svb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9iaWQvaGlnaCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYmlkL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvbGFzdFRyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9tYXgyNEhyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9taW4yNEhyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZmEvYXV0aHkvY2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWZhL2F1dGh5L3NtcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbmV0a2kvc2VhcmNoL3tuZXRraU5hbWV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2Jhbmsvb3RwL3tudW1iZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2t5Yy9vdHAve251bWJlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJvZmlsZS9waG9uZS9vdHAve251bWJlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vYWRkcmVzcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2RlcG9zaXQvY29uZmlybWVkL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9kZXBvc2l0L2NvbmZpcm1lZC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2RlcG9zaXQvdW5jb25maXJtZWQvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2RlcG9zaXQvdW5jb25maXJtZWQve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi93YWxsZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvYmFsYW5jZS9hdmFpbGFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2JhbGFuY2UvcGVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvYmFsYW5jZS90b3RhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvZGVwb3NpdC9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2RlcG9zaXQvdW52ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvZGVwb3NpdC92ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L3ZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Fzay9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYXNrL2NvbXBsZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9hc2svcGVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iaWQvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmlkL3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vYmFsYW5jZS9hdmFpbGFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2JhbGFuY2UvcGVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vYmFsYW5jZS90b3RhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vZGVwb3NpdC9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2RlcG9zaXQvdW52ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vZGVwb3NpdC92ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L3ZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Jhbmsvc3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9jb2luL2ZlZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9maWF0L2ZlZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9reWNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL3JlZmVycmFsL2NvaW4vcGFpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9yZWZlcnJhbC9jb2luL3N1Y2Nlc3NmdWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvcmVmZXJyYWwvZmlhdC9wYWlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL3JlZmVycmFscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS90cmFkZS9zdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2xvZ2luL3Rva2VuL3t0b2tlbn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvc3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvc3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2NvaW4vd2l0aGRyYXcvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvY29pbi93aXRoZHJhdy9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC9jb2luL3dpdGhkcmF3L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC9jb2luL3dpdGhkcmF3L3ZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9naW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvZ2luL2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2dpbi9wYXNzd29yZC9mb3Jnb3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21mYS9hdXRoeS9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWZhL2dhL2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzaWdudXAnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbmV0a2kvdXBkYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Byb2ZpbGUvaW1hZ2UvdXBkYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvbmV3VmVyaWZ5Y29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvaW5pdGlhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L25ld1ZlcmlmeWNvZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcGFzc3dvcmQvY2hhbmdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Bhc3N3b3JkL3Jlc2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL3dpdGhkcmF3L2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvY29pbi93aXRoZHJhdy9uZXdWZXJpZnljb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzaWdudXAvdmVyaWZ5L3t0b2tlbn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2Uva3ljJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9kZXBvc2l0L25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9hc2svbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvaW5zdGFudC9idXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvaW5zdGFudC9zZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy92ZXJpZnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2FjY291bnQvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy92ZXJpZnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWZhL2F1dGh5L2luaXRpYXRlL2VuYWJsZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9tZmEvZ2EvaW5pdGlhdGUvZW5hYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL25ldGtpL2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL3Bob25lL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9hZGRyZXNzL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vd2l0aGRyYXcvc2VuZFRvRXhjaGFuZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vd2l0aGRyYXcvdmVyaWZ5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2djbS97Y29kZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbG9nb3V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy91bnZlcmlmaWVkL2NhbmNlbC97d2l0aGRyYXdJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2RlcG9zaXQvY2FuY2VsL3tkZXBvc2l0SUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Fzay9jYW5jZWwve29yZGVySUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9jYW5jZWwve29yZGVySUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy91bnZlcmlmaWVkL2NhbmNlbC97d2l0aGRyYXdJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWZhL2F1dGh5L2Rpc2FibGUve2NvZGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21mYS9nYS9kaXNhYmxlL3tjb2RlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL3Bob25lL2RlbGV0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL2ltYWdlL2RlbGV0ZS97bmV0a2lOYW1lfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi93aXRoZHJhdy91bnZlcmlmaWVkL2NhbmNlbC97d2l0aGRyYXdJRH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9JTlInOiB7ICdpZCc6ICdCVEMvSU5SJywgJ3N5bWJvbCc6ICdCVEMvSU5SJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0lOUicgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC40IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjQgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0VXNlckV4Y2hhbmdlQmFua1N1bW1hcnkgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ21lc3NhZ2UnXTtcbiAgICAgICAgbGV0IGNvaW4gPSB7XG4gICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ2F2YWlsYWJsZUNvaW5CYWxhbmNlJ10sXG4gICAgICAgICAgICAndXNlZCc6IGJhbGFuY2VbJ3BlbmRpbmdDb2luQmFsYW5jZSddLFxuICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZVsndG90YWxDb2luQmFsYW5jZSddLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgZmlhdCA9IHtcbiAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZVsnYXZhaWxhYmxlRmlhdEJhbGFuY2UnXSxcbiAgICAgICAgICAgICd1c2VkJzogYmFsYW5j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aXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBoZWFkZXJzID0geyAnQXV0aG9yaXphdGlvbic6IHRoaXMuYXBpS2V5IH07XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgaGVhZGVyc1snQ29udGVudC1UeXBlJ10gPSAnYXBwbGljYXRpb24vanNvbic7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGNvZGUgPT0gMjAwKSB7XG4gICAgICAgICAgICBpZiAoKGJvZHlbMF0gPT0gJ3snKSB8fCAoYm9keVswXSA9PSAnWycpKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgc3VjY2VzcyA9IHJlc3BvbnNlWydzdWNjZXNzJ107XG4gICAgICAgICAgICA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W5zcG90LmNvbS5hdScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5jb2luc3BvdC5jb20uYXUvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGF0ZXN0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9jb2luL2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L2NvaW4vc2VuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGUvYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZS9zZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9iYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9idXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L2J1eS9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L3NlbGwvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvQVVEJzogeyAnaWQnOiAnQlRDJywgJ3N5bWJ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c6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI5NDg0Mzk0LTdiNGVhNmUyLTg0YzYtMTFlNy04M2U1LTFmY2NmNGIyZGM4MS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuY3J5cHRvcGlhLmNvLm56L2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5jcnlwdG9waWEuY28ubnonLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5jcnlwdG9waWEuY28ubnovRm9ydW0vQ2F0ZWdvcnkvNDUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuY3J5cHRvcGlhLmNvLm56L0ZvcnVtL1RocmVhZC8yNTUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuY3J5cHRvcGlhLmNvLm56L0ZvcnVtL1RocmVhZC8yNTYnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEN1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYWRlUGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0cy97aG91cnN9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRzL3tpZH0ve2hvdXJzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldC97aWR9L3tob3Vyc30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldEhpc3Rvcnkve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0SGlzdG9yeS97aWR9L3tob3Vyc30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldE9yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRPcmRlcnMve2lkfS97Y291bnR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRPcmRlckdyb3Vwcy97aWRzfS97Y291bnR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxUcmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0RGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTdWJtaXRUaXAnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1N1Ym1pdFRyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTdWJtaXRUcmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3VibWl0V2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KSB7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQ0MnKVxuICAgICAgICAgICAgcmV0dXJuICdDQ1gnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0ZDTicpXG4gICAgICAgICAgICByZXR1cm4gJ0ZhY2lsZWNvaW4nO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ05FVCcpXG4gICAgICAgICAgICByZXR1cm4gJ05ldENvaW4nO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0JURycpXG4gICAgICAgICAgICByZXR1cm4gJ0JpdGdlbSc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnRlVFTCcpXG4gICAgICAgICAgICByZXR1cm4gJ0ZDMic7IC8vIEZ1ZWxDb2luICE9IEZVRUxcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdXUkMnKVxuICAgICAgICAgICAgcmV0dXJuICdXYXJDb2luJztcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGN1cnJlbmN5SWQgKGN1cnJlbmN5KSB7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQ0NYJylcbiAgICAgICAgICAgIHJldHVybiAnQ0MnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0ZhY2lsZWNvaW4nKVxuICAgICAgICAgICAgcmV0dXJuICdGQ04nO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ05ldENvaW4nKVxuICAgICAgICAgICAgcmV0dXJuICdORVQnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0JpdGdlbScpXG4gICAgICAgICAgICByZXR1cm4gJ0JURyc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnRkMyJylcbiAgICAgICAgICAgIHJldHVybiAnRlVFTCc7IC8vIEZ1ZWxDb2luICE9IEZVRUxcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVQYWlycyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydEYXRhJ107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ0lkJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydMYWJlbCddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFtb3VudExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydNaW5pbXVtVHJhZGUnXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydNYXhpbXVtVHJhZGUnXVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydNaW5pbXVtUHJpY2UnXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydNYXhpbXVtUHJpY2UnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnRMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IG1hcmtldFsnU3RhdHVzJ10gPT0gJ09LJztcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogbWFya2V0WydUcmFkZUZlZSddIC8gMTAwLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IG1hcmtldFsnVHJhZGVGZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAnbG90JzogYW1vdW50TGltaXRzWydtaW4nXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhp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mFkZSkge1xuICAgICAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHRyYWRlWydGZWUnXSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ1R5cGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydBbW91bnQnXSxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBob3VycyA9IDI0OyAvLyB0aGUgZGVmYXVsdFxuICAgICAgICBpZiAoc2luY2UpIHtcbiAgICAgICAgICAgIGxldCBlbGFw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gICAgICAgICBsZXQgc3RhdHVzID0gY3VycmVuY3lbJ1N0YXR1cyddLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSAnb2snKVxuICAgICAgICAgICAgICAgIGFjdGl2ZSA9IGZhbHNlO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ05hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5WydXaXRoZHJhd0ZlZSddLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnTWluQmFzZVRyYWRlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnTWluV2l0aGRyYXcnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBjdXJyZW5jeVsnTWF4V2l0aGRyYXcnXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydEYXRhJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYWxhbmNlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tpXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gYmFsYW5jZVsnU3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY29kZSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ0F2YWlsYWJsZSddLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAg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dGUnOiBwcmljZSxcbiAgICAgICAgICAgICdBbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RTdWJtaXRUcmFkZSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBpZiAoIXJlc3BvbnNlKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGNyZWF0ZU9yZGVyIHJldHVybmVkIHVua25vd24gZXJyb3I6ICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgIGxldCBpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGZpbGxlZCA9IDAuMDtcbiAgICAgICAgaWYgKCdEYXRhJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCdPcmRlcklkJyBpbiByZXNwb25zZVsnRGF0YSddKSB7XG4gICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydEYXRhJ11bJ09yZGVySWQnXSkge1xuICAgICAgICAgICAgICAgICAgICBpZCA9IHJlc3BvbnNlWydEYXRhJ11bJ09yZGVySWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoJ0ZpbGxlZE9yZGVycycgaW4gcmVzcG9uc2VbJ0RhdGEnXSkge1xuICAgICAgICAgICAgICAgIGxldCBmaWxsZWRPcmRlcnMgPSByZXNwb25zZVsnRGF0YSddWydGaWxsZWRPcmRlcnMnXTtcbiAgICAgICAgICAgICAgICBsZXQgZmlsbGVkT3JkZXJzTGVuZ3RoID0gZmlsbGVkT3JkZXJzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBpZiAoZmlsbGVkT3JkZXJzTGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBwcmljZSAqIGFtb3VudCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAvLyAndHJhZGVzJzogdGhpcy5wYXJzZVRyYWRlcyAob3JkZXJbJ3RyYWRlcyddLCBtYXJrZXQpLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoaWQpXG4gICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSBvcmRlcjtcbiAgICAgICAgcmV0dXJuIHRoaXMuZXh0ZW5kICh7ICdpbmZvJzogcmVzcG9uc2UgfSwgb3JkZXIpO1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxUcmFkZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnVHlwZSc6ICdUcmFkZScsXG4gICAgICAgICAgICAgICAgJ09yZGVySWQnOiBpZCxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMub3JkZXJzKVxuICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXVsnc3RhdHVzJ10gPSAnY2FuY2VsZWQnO1xuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5sYXN0X2pzb25fcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAodGhpcy5sYXN0X2pzb25fcmVzcG9uc2UsICdFcnJvcicpO1xuICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlLmluZGV4T2YgKCdkb2VzIG5vdCBleGlzdCcpID49IDApXG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAodGhpcy5pZCArICcgY2FuY2VsT3JkZXIoKSBlcnJvcjogJyArIHRoaXMubGFzdF9odHRwX3Jlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQ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lZEJ5SWRbaWRdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRlcnNbaWRdO1xuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3RhdHVzJ10gPT0gJ29wZW4nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiBvcmRlclsnYW1vdW50J10gKiBvcmRlclsncHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWxsZWQnOiBvcmRlclsnYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVtYWluaW5nJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSB0aGlzLm9yZGVyc1tpZF07XG4gICAgICAgICAgICBpZiAob3JkZXJbJ3N5bWJvbCddID09IHN5bWJvbClcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAob3JkZXIpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLmZpbHRlckJ5U2luY2VMaW1pdCAocmVzdWx0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlkID0gaWQudG9TdHJpbmcgKCk7XG4gICAgICAgIGxldCBvcmRlcnMgPSBhd2FpdCB0aGlzLmZldGNoT3JkZXJzIChzeW1ib2wsIHVuZGVmaW5lZCwgdW5kZWZpbmVkLCBwYXJhbXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gM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xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vZHN4LnVrL21hcGknLCAvLyBtYXJrZXQgZGF0YVxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2RzeC51ay90YXBpJywgLy8gdHJhZGluZ1xuICAgICAgICAgICAgICAgICAgICAnZHdhcGknOiAnaHR0cHM6Ly9kc3gudWsvZHdhcGknLCAvLyBkZXBvc2l0L3dpdGhkcmF3XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vZHN4LnVrJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkuZHN4LnVrJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZHN4LnVrL2FwaV9kb2NzL3B1YmxpYycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2RzeC51ay9hcGlfZG9jcy9wcml2YXRlJyxcbiAgICAgICAgICAgICAgICAgICAgJycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgIC8vIG1hcmtldCBkYXRhIChwdWJsaWMpXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYXJzRnJvbU1vbWVudC97aWR9L3twZXJpb2R9L3tzdGFydH0nLCAvLyBlbXB0eSByZXBseSA6XFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhc3RCYXJzL3tpZH0ve3BlcmlvZH0ve2Ftb3VudH0nLCAvLyBwZXJpb2QgaXMgKG0sIGggb3IgZClcbiAgICAgICAgICAgICAgICAgICAgICAgICdwZXJpb2RCYXJzL3tpZH0ve3BlcmlvZH0ve3N0YXJ0fS97ZW5kfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAvLyB0cmFkaW5nIChwcml2YXRlKVxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFuc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY3RpdmVPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAvLyBkZXBvc2l0IC8gd2l0aGRyYXcgKHByaXZhdGUpXG4gICAgICAgICAgICAgICAgJ2R3YXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRDcnlwdG9EZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3J5cHRvV2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpYXRXaXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VHJhbnNhY3Rpb25TdGF0dXMnLFxuICAgIC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ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NDkxLTFiMGVhOTU2LTVlZGEtMTFlNy05MjI1LTQwZDY3YjQ4MWI4ZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuZXhtby5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9leG1vLm1lJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9leG1vLm1lL2VuL2FwaV9kb2MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL2V4bW8tZGV2L2V4bW9fYXBpX2xpYi90cmVlL21hc3Rlci9ub2RlanMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9leG1vLmNvbS9lbi9kb2NzL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcl9zZXR0aW5ncycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfY3JlYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX2NhbmNlbGxlZF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVxdWlyZWRfYW1vdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2NyeXB0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19nZXRfdHhpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjb2RlX2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjb2RlX2xvYWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldF9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0ZGhyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dBVkVTJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDI1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogMzUwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogNTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQYWlyU2V0dGluZ3MgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1twXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZC5yZXBsYWNlICgnXycsICcvJyk7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbWluX3F1YW50aXR5J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhfcXVhbnRpdHknXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbWluX3ByaWNlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhfcHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydtaW5fYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhfYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RVc2VySW5mbyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiByZXNwb25zZVsnYmFsYW5jZXMnXSlcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBwYXJzZUZsb2F0IChyZXNwb25zZVsnYmFsYW5jZXMnXVtjdXJyZW5jeV0pO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIHJlc3BvbnNlWydyZXNlcnZlZCddKVxuICAgICAgICAgICAgIC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BtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndXBkYXRlZCddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYnV5X3ByaWNlJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnc2VsbF9wcmljZSddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdF90cmFkZSddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogcGFyc2VGbG9hdCAodGlja2VyWydhdmcnXSksXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNl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ldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHJlc3BvbnNlW21hcmtldFsnaWQnXV0sIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndHJhZGVfaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsncXVhbnRpdHknXSksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2VbbWFya2V0WydpZCddXSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBwcmVmaXggPSAnJztcbiAgICAgICAgaWYgKHR5cGUgPT0gJ21hcmtldCcpXG4gICAgICAgICAgICBwcmVmaXggPSAnbWFya2V0Xyc7XG4gICAgICAgIGlmICh0eXBlb2YgcHJpY2UgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgcHJpY2UgPSAwO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAncXVhbnRpdHknOiBhbW91bnQsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICd0eXBlJzogcHJlZml4ICsgc2lkZSxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE9yZGVyQ3JlYXRlICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydvcmRlcl9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFz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ogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjgxNjI0NjUtY2Q4MTVkNGMtNjdjZi0xMWU3LThlNTctNDM4YmVhMDUyM2EyLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5mbG93YnRjLmNvbTo4NDAwL2FqYXgnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly90cmFkZXIuZmxvd2J0Yy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cDovL3d3dy5mbG93YnRjLmNvbS5ici9hcGkvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZXNCeURhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9yZGVyQm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0UHJvZHVjdFBhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRQcm9kdWN0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ3JlYXRlQWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VXNlckluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NldFVzZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRBY2NvdW50SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QWNjb3VudFRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0RGVwb3NpdEFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NyZWF0ZU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNb2RpZnlPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbEFsbE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QWNjb3VudE9wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9yZGVyRmVlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNQb3N0R2V0UHJvZHVjdFBhaXJzICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydwcm9kdWN0UGFpcnMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsncHJvZHVjdDFMYWJlbCddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0Wydwcm9kdWN0MkxhYmVsJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0QWNjb3VudEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydjdXJyZW5jaWVzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ25hbWUnXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmV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JzZUZsb2F0ICh0aWNrZXJbJ3ZvbHVtZTI0aHJQcm9kdWN0MiddKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRyYWRlWyd1bml4dGltZSddICogMTAwMDtcbiAgICAgICAgbGV0IHNpZGUgPSAodHJhZGVbJ2luY29taW5nT3JkZXJTaWRlJ10gPT0gMCkgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydweCddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydxdHknXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQ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AgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2ZveGJpdC5leGNoYW5nZScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JsaW5rdHJhZGUuY29tL2RvY3MnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tZW50JzogJ0JsaW5rdHJhZGUgQVBJJyxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3l9L3RpY2tlcicsICAgIC8vID9jcnlwdG9fY3VycmVuY3k9QlRDXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5fS9vcmRlcmJvb2snLCAvLyA/Y3J5cHRvX2N1cnJlbmN5PUJUQ1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeX0vdHJhZGVzJywgICAgLy8gP2NyeXB0b19jdXJyZW5jeT1CVEMmc2luY2U9PFRJTUVTVEFNUD4mbGltaXQ9PE5VTUJFUj5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdEJywgICAvLyBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0YnLCAgIC8vIGNhbmNlbCBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ1UyJywgIC8vIGJhbGFuY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICdVNCcsICAvLyBteSBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdVNicsICAvLyB3aXRoZHJhd1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1UxOCcsIC8vIGRlcG9zaXRcbiAgICAgICAgICAgICAgICAgICAgICAgICdVMjQnLCAvLyBjb25maXJtIHdpdGhkcmF3YWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVMjYnLCAvLyBsaXN0IHdpdGhkcmF3YWxzXG4gICAgICAgICAgICAgICAgICAgICAgICAnVTMwJywgLy8gbGlzdCBkZXBvc2l0c1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1UzNCcsIC8vIGxlZGdlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ1U3MCcsIC8vIGNhbmNlbCB3aXRoZHJhd2FsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1ZFRic6IHsgJ2lkJzogJ0JUQ1ZFRicsICdzeW1ib2wnOiAnQlRDL1ZFRicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdWRUYnLCAnYnJva2VySWQnOiAxLCAnYnJva2VyJzogJ1N1ckJpdGNvaW4nIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9WTkQnOiB7ICdpZCc6ICdCVENWTkQnLCAnc3ltYm9sJzogJ0JUQy9WTkQnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVk5EJywgJ2Jyb2tlcklkJzogMywgJ2Jyb2tlcic6ICdWQlRDJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvQlJMJzogeyAnaWQnOiAnQlRDQlJMJywgJ3N5bWJvbCc6ICdCVEMvQlJMJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0JSTCcsICdicm9rZXJJZCc6IDQsICdicm9rZXInOiAnRm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ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMuZXh0ZW5kICh7ICdNc2dUeXBlJzogcGF0aCB9LCBxdWVyeSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChyZXF1ZXN0KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0FQSUtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdOb25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdTaWduYXR1cmUnOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChub25jZSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9I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yBTd2VkZW5cbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1MTItMzEwMTk3NzItNWVkYi0xMWU3LTgyNDEtMmU2NzVlNjc5N2YxLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5meWJzZS5zZS9hcGkvU0VLJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmZ5YnNlLnNlJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHA6Ly9kb2NzLmZ5Yi5hcGlhcnkuaW8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcmRldGFpbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YWNjaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0cGVuZGluZ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V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xcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsb3cnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0cmFkZVsnZGF0ZSddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbm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HBlckNhc2UgKClcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ3BlbmRpbmdfb2lkJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLnByaXZhdGVQb3N0Q2FuY2VscGVuZGluZ29yZGVyICh7ICdvcmRlck5vJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSAnLmpzb24nO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoeyAndGltZXN0YW1wJzogbm9uY2UgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAna2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ3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AnMWQnOiAnMjRoJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4NjQ2ODE3LTUwODQ1N2YyLTcyNmMtMTFlNy05ZWViLTM1MjhkMjQxM2E1OC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuZ2F0ZWNvaW4uY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vZ2F0ZWNvaW4uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9nYXRlY29pbi5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9HYXRlY29pbi9SRVNUZnVsLUFQSS1JbXBsZW1lbnRhdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS5nYXRlY29pbi5jb20vc3dhZ2dlci11aS9pbmRleC5odG1sJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdQdWJsaWMvRXhjaGFuZ2VSYXRlJywgLy8gR2V0IHRoZSBleGNoYW5nZSByYXRlc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1B1YmxpYy9MaXZlVGlja2VyJywgLy8gR2V0IGxpdmUgdGlja2VyIGZvciBhbGwgY3VycmVuY3lcbiAgICAgICAgICAgICAgICAgICAgICAgICdQdWJsaWMvTGl2ZVRpY2tlci97Q3VycmVuY3lQYWlyfScsIC8vIEdldCBsaXZlIHRpY2tlciBie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SBsaXN0LlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZW5jZS9Db3VudHJpZXMnLCAvLyBHZXQgdGhlIGNvdW50cnkgbGlzdC5cbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVuY2UvQ3VycmVuY2llcycsIC8vIEdldCB0aGUgY3VycmVuY3kgbGlzdC5cbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVuY2UvQ3VycmVuY3lQYWlycycsIC8vIEdldCB0aGUgY3VycmVuY3kgcGFpciBsaXN0LlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZW5jZS9DdXJyZW50U3RhdHVzTGlzdCcsIC8vIEdldCB0aGUgY3VycmVudCBzdGF0dXMgbGlzdC5cbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVuY2UvSWRlbnR5ZG9jdW1lbnRUeXBlcycsIC8vIEdldCB0aGUgZGlmZmVyZW50IHR5cGVzIG9mIGlkZW50aXR5IGRvY3VtZW50cyBwb3NzaWJsZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVuY2UvSW5jb21lUmFuZ2VMaXN0JywgLy8gR2V0IHRoZSBpbmNvbWUgcmFuZ2UgbGlzdC5cbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVuY2UvSW5jb21lU291cmNlTGlzdCcsIC8vIEdldCB0aGUgaW5jb21lIHNvdXJjZSBsaXN0LlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZW5jZS9WZXJpZmljYXRpb25MZXZlbExpc3QnLCAvLyBHZXQgdGhlIHZlcmlmIGxldmVsIGxpc3QuXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3RyZWFtL1B1YmxpY0NoYW5uZWwnLCAvLyBHZXQgdGhlIHB1YmxpYyBwdWJudWIgY2hhbm5lbCBsaXN0XG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0V4cG9ydC9UcmFuc2FjdGlvbnMnLCAvLyBSZXF1ZXN0IGEgZXhwb3J0IG9mIGFsbCB0cmFkZXMgZnJvbSBiYXNlZCBvbiBjdXJyZW5jeXBhaXIsIHN0YXJ0IGRhdGUgYW5kIGVuZCBkYXRlXG4gICAgICAgICAgICAgICAgICAgICAgICAnUGluZycsIC8vIFBvc3QgYSBzdHJpbmcsIHRoZW4gZ2V0IGl0IGJhY2suXG4gICAgICAgICAgICAgICAgICAgICAgICAnUHVibGljL1Vuc3Vic2NyaWJlL3tFbWFpbENvZGV9JywgLy8gTGV0cyB0aGUgdXNlciB1bnN1YnNjcmliZSBmcm9tIGVtYWlsc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZ2lzdGVyVXNlcicsIC8vIEluaXRpYWwgdHJhZGVyIHJlZ2lzdHJhdGlvbi5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvQ29ycG9yYXRlRGF0YScsIC8vIEdldCBjb3Jwb3JhdGUgYWNjb3VudCBkYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudEFkZHJlc3MnLCAvLyBDaGVjayBpZiByZXNpZGVuY2UgcHJvb2YgdXBsb2FkZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50Q29ycG9yYXRpb24nLCAvLyBDaGVjayBpZiByZWdpc3RlcmVkIGRvY3VtZW50IHVwbG9hZGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudElEJywgLy8gQ2hlY2sgaWYgSUQgZG9jdW1lbnQgY29weSB1cGxvYWRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRJbmZvcm1hdGlvbicsIC8vIEdldCBTdGVwMyBEYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9FbWFpbCcsIC8vIEdldCB1c2VyIGVtYWlsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9GZWVSYXRlJywgLy8gR2V0IGZlZSByYXRlIG9mIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9MZXZlbCcsIC8vIEdldCB2ZXJpZiBsZXZlbCBvZiBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUGVyc29uYWxJbmZvcm1hdGlvbicsIC8vIEdldCBTdGVwMSBEYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9QaG9uZScsIC8vIEdldCB1c2VyIHBob25lIG51bWJlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUHJvZmlsZScsIC8vIEdldCB0cmFkZXIgcHJvZmlsZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUXVlc3Rpb25uYWlyZScsIC8vIEZpbGwgdGhlIHF1ZXN0aW9ubmFpcmVcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1JlZmVycmFsJywgLy8gR2V0IHJlZmVycmFsIGluZm9ybWF0aW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJhbENvZGUnLCAvLyBHZXQgdGhlIHJlZmVycmFsIGNvZGUgb2YgdGhlIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJhbE5hbWVzJywgLy8gR2V0IG5hbWVzIG9mIHJlZmVycmVkIHRyYWRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1JlZmVycmFsUmV3YXJkJywgLy8gR2V0IHJlZmVycmFsIHJld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W50Q29ycG9yYXRpb24nLCAvLyBVcGxvYWQgcmVnaXN0ZXJlZCBkb2N1bWVudCBkb2N1bWVudFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRJRCcsIC8vIFVwbG9hZCBJRCBkb2N1bWVudCBjb3B5XG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9FbWFpbC9SZXF1ZXN0VmVyaWZ5JywgLy8gUmVxdWVzdCBmb3IgdmVyaWZpY2F0aW9uIGVtYWlsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9FbWFpbC9WZXJpZnknLCAvLyBWZXJpZmljYXRpb24gZW1haWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0dvb2dsZUF1dGgnLCAvLyBFbmFibGUgZ29vZ2xlIGF1dGhcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0xldmVsJywgLy8gUmVxdWVzdCB2ZXJpZiBsZXZlbCBvZiBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUXVlc3Rpb25uYWlyZScsIC8vIEZpbGwgdGhlIHF1ZXN0aW9ubmFpcmVcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1JlZmVycmFsJywgLy8gUG9zdCBhIHJlZmVycmFsIGVtYWlsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVBJS2V5L0FQSUtleScsIC8vIENyZWF0ZSBhIG5ldyBBUEkga2V5IGZvciBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0F1dGgvQ2hhbmdlUGFzc3dvcmQnLCAvLyBDaGFuZ2UgcGFzc3dvcmQuXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXV0aC9Gb3Jnb3RQYXNzd29yZCcsIC8vIFJlcXVlc3QgcmVzZXQgcGFzc3dvcmRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBdXRoL0Zv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ICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Db3Jwb3JhdGVEYXRhJywgLy8gVXBkYXRlIHVzZXIgY29tcGFueSBkYXRhIGZvciBjb3Jwb3JhdGUgYWNjb3VudFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRJRCcsIC8vIFVwZGF0ZSBJRCBkb2N1bWVudCBtZXRhIGRhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50SW5mb3JtYXRpb24nLCAvLyBVcGRhdGUgU3RlcDMgRGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRW1haWwnLCAvLyBVcGRhdGUgdXNlciBlbWFpbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUGVyc29uYWxJbmZvcm1hdGlvbicsIC8vIFVwZGF0ZSBTdGVwMSBEYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9QaG9uZScsIC8vIFVwZGF0ZSB1c2VyIHBob25lIG51bWJlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUXVlc3Rpb25uYWlyZScsIC8vIHVwZGF0ZSB0aGUgcXVlc3Rpb25uYWlyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyZWRDb2RlJywgLy8gVXBkYXRlIHJlZmVycmFsIGNvZGVcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1Jlc2lkZW50SW5mb3JtYXRpb24nLCAvLyBVcGRhdGUgU3RlcDIgRGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvU2VjdXJpdHlTZXR0aW5ncycsIC8vIFVwZGF0ZSB2ZXJpZiBkZXRhaWxzIG9mIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Vc2VyJywgLy8gV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gICd0YWtlcic6IDAuMDAzNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQdWJsaWNMaXZlVGlja2VycyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsndGlja2VycyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2N1cnJlbmN5UGFpciddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRCYWxhbmNlQmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydhdmFpbGFibGVCYWxhbmNlJ10sXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiB0aGlzLnN1bSAoXG4gICAgICAgICAgICAgICAgICAgIGJhbGFuY2VbJ3BlbmRpbmdJbmNvbWluZyddLFxuICAgICAgICAgICAgICAgICAgICBiYWxhbmNlWydwZW5kaW5nT3V0Z29pbmcnXSxcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVsnb3Blbk9yZGVyJ10pLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VbJ2JhbGFuY2UnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYX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nO1xuICAgICAgICAgICAgbGV0IG9yZGVySWQgPSB0cmFkZVsnd2F5J10gKyAnT3JkZXJJZCc7XG4gICAgICAgICAgICBvcmRlciA9IHRyYWRlW29yZGVySWRdO1xuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ3RyYW5zYWN0aW9uVGltZSddKSAqIDEwMDA7XG4gICAgICAgIGlmICghbWFya2V0KVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydjdXJyZW5jeVBhaXInXV07XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RyYW5zYWN0aW9uSWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVyLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsncXVhbnRpdHknXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgIC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iAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlU3RyaW5nID0gbm9uY2UudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgY29udGVudFR5cGUgPSAobWV0aG9kID09ICdHRVQnKSA/ICcnIDogJ2FwcGxpY2F0aW9uL2pzb24nO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBtZXRob2QgKyB1cmwgKyBjb250ZW50VHlwZSArIG5vbmNlU3RyaW5nO1xuICAgICAgICAgICAgYXV0aCA9IGF1dGgudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGEyNTYnLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBUElfUFVCTElDX0tFWSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdBUElfUkVRVUVTVF9TSUdOQVRVUkUnOiB0aGlzLmRlY29kZSAoc2lnbmF0dXJlKSxcbiAgICAgICAgICAgICAgICAnQVBJX1JFUVVFU1RfREFURSc6IG5vbmNlU3RyaW5nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgIT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICBoZWFkZXJzWydDb250ZW50LVR5cGUnXSA9I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QnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiA2MCxcbiAgICAgICAgICAgICAgICAnNW0nOiAzMDAsXG4gICAgICAgICAgICAgICAgJzE1bSc6IDkwMCxcbiAgICAgICAgICAgICAgICAnMzBtJzogMTgwMCxcbiAgICAgICAgICAgICAgICAnMWgnOiAzNjAwLFxuICAgICAgICAgICAgICAgICcyaCc6IDcyMDAsXG4gICAgICAgICAgICAgICAgJzRoJzogMTQ0MDAsXG4gICAgICAgICAgICAgICAgJzEyaCc6IDQzMjAwLFxuICAgICAgICAgICAgICAgICcxZCc6IDg2NDAwLFxuICAgICAgICAgICAgICAgICcxdyc6IDYwNDgwMCxcbiAgICAgICAgICAgICAgICAnMU0nOiAyNTkyMDAwLFxuICAgICAgICAgICAgICAgICcxeSc6IDMxNTM2MDAwLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICd0ZXN0JzogJ2h0dHBzOi8vYXBpLXB1YmxpYy5zYW5kYm94LmdkYXguY29tJyxcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTI3LWIxYmU0MWM2LTVlZGItMTFlNy05NWY2LTViNDk2YzQ2OWUyYy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuZ2RheC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuZ2RheC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9kb2NzLmdkYXguY29tJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmdkYXguY29tL2ZlZXMnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9zdXBwb3J0LmdkYXguY29tL2N1c3RvbWVyL2VuL3BvcnRhbC90b3BpY3MvOTM5NDAyLWRlcG9zaXRpbmctYW5kLXdpdGhkcmF3aW5nLWZ1bmRzL2FydGljbGVzJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwYXNzd29yZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9L2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0vY2FuZGxlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS9zdGF0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aW1lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L2hvbGRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L2xlZGdlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29pbmJhc2UtYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpbGxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50LW1ldGhvZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXBvcnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJzL3NlbGYvdHJhaWxpbmctdm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMvY29pbmJhc2UtYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMvcGF5bWVudC1tZXRob2QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmcvcmVwYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2ZpbGVzL21hcmdpbi10cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVwb3J0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMvY29pbmJhc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL2NyeXB0bycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMvcGF5bWVudC1tZXRob2QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiB0cnVlLCAvLyBjb21wbGljYXRlZCB0aWVyIHN5c3RlbSBwZXIgY29pblxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4zMCAvIDEwMCwgLy8gd29yc3QtY2FzZSBzY2VuYXJpbzogaHR0cHM6Ly93d3cuZ2RheC5jb20vZmVlcy9CVEMtVVNEXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAwLjE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRCc6IDI1LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAuMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogMTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQcm9kdWN0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ2Jhc2VfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncXVvdGVfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgYW1vdW50TGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ2Jhc2VfbWluX3NpemUnXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydiYXNlX21heF9zaXplJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByaWNlTGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ3F1b3RlX2luY3JlbWVudCddLFxuICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGNvc3RMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IHByaWNlTGltaXRzWydtaW4nXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudExpbWl0cyxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZUxpbWl0cyxcbiAgICAgICAgICAgICAgICAnY29zdCc6IGNvc3RMaW1pdHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogLU1hdGgubG9nMTAgKHBhcnNlRmxvYXQgKGFtb3VudExpbWl0c1snbWluJ10pKSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiAtTWF0aC5sb2cxMCAocGFyc2VGbG9hdCAocHJpY2VMaW1pdHNbJ21pbiddKSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHRha2VyID0gdGhpcy5mZWVzWyd0cmFkaW5nJ11bJ3Rha2VyJ107XG4gICAgICAgICAgICBpZiAoKGJhc2UgPT0gJ0VUSCcpIHx8IChiYXNlID09ICdMVEMnKSkge1xuICAgICAgICAgICAgICAgIHRha2VyID0gMC4wMDM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gbWFya2V0WydzdGF0dXMnXSA9PSAnb25saW5lJztcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogdGFrZXIsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQ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ICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdwcmljZScpLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sdW1lJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWyd0aW1lJ10pO1xuICAgICAgICBsZXQgc2lkZSA9ICh0cmFkZVsnc2lkZSddID09ICdidXknKSA/ICdzZWxsJyA6ICdidXknO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGZlZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdmaWxsX2ZlZXMnIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0ICh0cmFkZVsnZmlsbF9mZWVzJ10pLFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgIH07XG4gICAgIC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ClcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbb3JkZXJbJ3Byb2R1Y3RfaWQnXV07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHN0YXR1cyA9IHRoaXMucGFyc2VPcmRlclN0YXR1cyAob3JkZXJbJ3N0YXR1cyddKTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3NpemUnKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2ZpbGxlZF9zaXplJyk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSBhbW91bnQgLSBmaWxsZWQ7XG4gICAgICAgIGxldCBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZXhlY3V0ZWRfdmFsdWUnKTtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnaWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgIC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wgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVxdWVzdCA9ICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAobWV0aG9kID09ICdHRVQnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgcmVxdWVzdCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgcmVxdWVzdDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBwYXlsb2FkID0gJyc7XG4gICAgICAgICAgICBpZiAobWV0aG9kICE9ICdHRVQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICAgICAgcGF5bG9hZCA9IGJvZHk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gbGV0IHBheWxvYWQgPSAoYm9keSkgPyBib2R5IDogJyc7XG4gICAgICAgICAgICBsZXQgd2hhdCA9IG5vbmNlICsgbWV0aG9kICsgcmVxdWVzdCArIHBheWxvYWQ7XG4gICAgICAgICAgICBsZXQgc2VjcmV0ID0gdGhpcy5iYXNlNjRUb0JpbmFyeSAodGhpcy5zZWNyZXQpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHdoYXQpLCBzZWNyZXQsICdzaGEyNTYnLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDQi1BQ0NFU1MtS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0NCLUFDQ0VTUy1TSUdOJzogdGhpcy5kZWNvZGUgKHNpZ25hdHVyZSksXG4gICAgICAgICAgICAgICAgJ0NCLUFDQ0VTUy1USU1FU1RBTVAnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnQ0ItQUNDRVNTLVBBU1NQSFJBU0UnOiB0aGlzLnBhc3N3b3JkLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09IDQwMCkge1xuICAgICAgICAgICAgaWYgKGJvZHlbMF0gPT0gXCJ7XCIpIHtcbiAgICAgICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHJlc3BvbnNlWydtZXNzYWdlJ107XG4gICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ3ByaWNlIHRvbyBzbWFsbCcpID49IDApIHtcbiAgICAgICAgICAgICAgICAg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nQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzgxNjg1Ny1jZTdiZTY0NC02MDk2LTExZTctODJkNi0zYzI1NzI2MzIyOWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmdlbWluaS5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9nZW1pbmkuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9kb2NzLmdlbWluaS5jb20vcmVzdC1hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9kb2NzLnNhbmRib3guZ2VtaW5pLmNvbScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAndGVzdCc6ICdodHRwczovL2FwaS5zYW5kYm94LmdlbWluaS5jb20nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9nZW1pbmkuY29tL2ZlZS1zY2hlZHVsZS8nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9nZW1pbmkuY29tL3RyYW5zZmVyLWZlZXMvJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2xzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwdWJ0aWNrZXIve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXVjdGlvbi97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXVjdGlvbi97c3ltYm9sfS9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsL3Nlc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteXRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGV2b2x1bWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0L3tjdXJyZW5jeX0vbmV3QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGVhcnRiZWF0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFN5bWJvbHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IGlkO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IG1hcmtldC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdXBwZXJjYXNlLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHVwcGVyY2FzZS5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMjVcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0Qm9va1N5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0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VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUnXVtiYXNlVm9sdW1lXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3ZvbHVtZSddW3F1b3RlVm9sdW1lXSksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndGltZXN0YW1wbXMnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZ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tcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlJ10pLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2Ftb3VudCddKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGlmICh0eXBlID09ICdtYXJrZXQnKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGFsbG93cyBsaW1pdCBvcmRlcnMgb25seScpO1xuICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnY2xpZW50X29yZGVyX2lkJzogbm9uY2UudG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnc3ltYm9sJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQudG9TdHJpbmcgKCksXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZS50b1N0cmluZyAoKSxcbiAgICAgICAgIC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W5kLWxpbWl0cycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne3N5bWJvbH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7c3ltYm9sfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tzeW1ib2x9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3N5bWJvbH0vdHJhZGVzL3JlY2VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9scycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aW1lLCdcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9hY3RpdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9yZWNlbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvYnkvb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ25ld19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwYXltZW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3Mve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMve3RyYW5zYWN0aW9ufScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyX3RvX3RyYWRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyX3RvX21haW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3Mve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5b3V0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogLTAuMDEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMDg1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDQyc6IDAuMDAxOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMjE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAxOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICcxU1QnOiAwLjg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEWCc6IDUuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRSc6IDYuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRU9OJzogMC4wMTAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSVInOiA1NjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU1QJzogOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTlQnOiA2LjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJEUic6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJOJzogMTguNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUlQnOiAyNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEInOiAwLjAwMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRMJzogMjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRNJzogNTA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUUyc6IDg2MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAxLjksXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFTJzogMTEzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDTic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCRVQnOiAxMjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQktCJzogNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1DJzogMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1UJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDIuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlFYJzogNC43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUWCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVTJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0NUJzogMTE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEVCc6IDEwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRFgnOiAzMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRkknOiA2MSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTEQnOiAwLjg4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NORCc6IDU3NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTlgnOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPU1MnOiA2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDU05PJzogMTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RSJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RYJzogMTQ2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NWQyc6IDguNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREJJWCc6IDAuMDE2OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ04nOiAxMjAwMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENUJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEREYnOiAzNDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREVOVCc6IDYyNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdCJzogMC40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHRCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRElDRSc6IDAuMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRExUJzogMC4yNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlQnOiAwLjIxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPVic6IDM0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSUFUnOiAyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlQnOiAyNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFNIJzogMC4wMTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJFVCc6IDg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVEMnOiAyMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQlRDT0xEJzogNi42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VDQVQnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFREcnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDIuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTEUnOiAwLjAwMTcyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMTSc6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNQyc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1HTyc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOSic6IDE2MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAxLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRCUyc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDUuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWE4nOiA0NTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlJEJzogNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVFTCc6IDEyMy4wMDEwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAyMDIuOTU5ODMwOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWU4nOiAxLjg0OSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWVAnOiA2Ni4xMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLjAwMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1VQJzogNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVlQnOiAxLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEFDJzogMTQ0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hERyc6IDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEdUJzogMTA4MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdIUEMnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFZOJzogMTIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAuNTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPUyc6IDAuMzUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5EJzogNzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5ESSc6IDU5MTMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVRTJzogMTUuMDAxMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdJWFQnOiAxMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLQlInOiAxNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0lDSyc6IDExMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQSc6IDQxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBVCc6IDEuNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElGRSc6IDEzMDAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDI3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xTSyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVU4nOiAwLjM0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BSUQnOiA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BTkEnOiAxNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNBUCc6IDUuNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlQUyc6IDQzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ORSc6IDEuMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVNQJzogMTIxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDkyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ZQic6IDMuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOREMnOiAxNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVCTCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVUJzogMy45NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVE8nOiA5OTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhDJzogMTMuMzksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPQVgnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPRE4nOiAwLjAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09QVCc6IDMzNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUk1FJzogMi44LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09UTic6IDAuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFZJzogMy4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJWCc6IDk2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMQlQnOiAwLjMzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMUic6IDExNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFUnOiAwLjg3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPRSc6IDc4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0xMJzogMy41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQVCc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJFJzogMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJHJzogMzksXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJPJzogNDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJTJzogNjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFRPWSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVUnOiA2MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQ04nOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FWVCc6IDY0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUCc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUktDJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlZUJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMi4yNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQkQnOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NDTCc6IDIuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSVNBJzogMTY0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS0lOJzogNDA3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNQVJUJzogMC40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNUyc6IDAuMDM3NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkMnOiAzNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogNDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMjMzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NURUVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RVJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RYJzogMTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VCJzogMTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VSJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTV1QnOiAwLjUxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RBQVMnOiAwLjkxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RCVCc6IDIuMzcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEZMJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElNRSc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElYJzogNy4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RLTic6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtSJzogODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5UJzogOTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJTVCc6IDEuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAxMzk1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VFVCc6IDQ4MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVR1QnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRVJJJzogMC4wMzcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCJzogNTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCRSc6IDE0NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT0lTRSc6IDYxOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXRUFMVEgnOiAwLjAxNjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOR1MnOiAyLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMC43NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVVSJzogMy4yMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRE4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hFTSc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hVQyc6IDAuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdZT1lPVyc6IDE0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaQVAnOiAyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAyMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaU0MnOiAxOTEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnMVNUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRU9OJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUkRSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUk4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JBUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCRVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JLQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlFYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVE0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQ1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRkknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NMRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05EJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPU1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NTTk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RCSVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEREYnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RFTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdESUNFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9WJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlBVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RTSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJFVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQ09MRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUNBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRE8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNR08nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOSic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFUk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQlMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VYTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlJEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVUVMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRllQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dVUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1ZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIQUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hERyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEdUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIUEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hWTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ08nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDT1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lORCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5ESSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVRTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJWFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tCUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0lDSyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEEnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElGRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFJDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMU0snOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xVTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFJRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFOQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNBUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlQUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU5FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNU1AnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVlCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOREMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FQkwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlRPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05YVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0FYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPRE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1BUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUk1FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPVE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BBWSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUElYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTEJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0xMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFRPWSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSS0MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NDTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0lTQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0tJTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01BUlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NURUVNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTV1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RBQVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RCVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEZMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSU1FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RLTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSU1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVR1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVSSSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUJFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT0lTRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0VBTFRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXSU5HUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVVSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hFTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFVDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdZT1lPVyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkFQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pTQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdYQlQnKVxuICAgICAgICAgICAgcmV0dXJuICdCVEMnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0RSSycpXG4gICAgICAgICAgICByZXR1cm4gJ0RBU0gnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0NBVCcpXG4gICAgICAgICAgICByZXR1cm4gJ0JpdENsYXZlJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdVU0QnKVxuICAgICAgICAgICAgcmV0dXJuICdVU0RUJztcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRTeW1ib2xzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1snc3ltYm9scyddLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1snc3ltYm9scyddW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBtYXJrZXRbJ2NvbW1vZGl0eSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBtYXJrZXRbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgbG90ID0gcGFyc2VGbG9hdCAobWFya2V0Wydsb3QnXSk7XG4gICAgICAgICAgICBsZXQgc3RlcCA9IHBhcnNlRmxvYXQgKG1hcmtldFsnc3RlcCddKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdzdGVwJzogc3RlcCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ2xvdCddKSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ3N0ZXAnXSksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBzdGVwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtZXRob2QgPSB0aGlzLnNhZmVTdHJpbmcgKHBhcmFtcywgJ3R5cGUnLCAndHJhZGluZycpO1xuICAgICAgICBtZXRob2QgKz0gJ0dldEJhbGFuY2UnO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQg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ib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSAnLycgKyAnYXBpJyArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIGFwaSArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IHsgJ25vbmNlJzogbm9uY2UsICdhcGlrZXknOiB0aGlzLmFwaUtleSB9O1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLmV4dGVuZCAocGF5bG9hZCwgcXVlcnkpO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJylcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBheWxvYWQpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB1cmw7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09ICdQT1NUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBib2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aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICdNMScsXG4gICAgICAgICAgICAgICAgJzNtJzogJ00zJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnTTUnLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnTTE1JyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJ00zMCcsIC8vIGRlZmF1bHRcbiAgICAgICAgICAgICAgICAnMWgnOiAnSDEnLFxuICAgICAgICAgICAgICAgICc0aCc6ICdINCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJ0QxJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnRDcnLFxuICAgICAgICAgICAgICAgICcxTSc6ICcxTScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjU1NS04ZWFlYzIwZS01ZWRjLTExZTctOWM1Yi02ZGM2OWZjNDJmNWUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmhpdGJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9oaXRidGMuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYXBpLmhpdGJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9oaXRidGMuY29tL2ZlZXMtYW5kLWxpbWl0cycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3N1cHBvcnQuaGl0YnRjLmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDUxNDg2MDUtRmVlcy1hbmQtbGltaXRzJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2wnLCAvLyBBdmFpbGFibGUgQ3VycmVuY3kgU3ltYm9sc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbC97c3ltYm9sfScsIC8vIEdldCBzeW1ib2wgaW5mb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JywgLy8gQXZhaWxhYmxlIEN1cnJlbmNpZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeS97Y3VycmVuY3l9JywgLy8gR2V0IGN1cnJlbmN5IGluZm9cbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLCAvLyBUaWNrZXIgbGlzdCBmb3IgYWxsIHN5bWJvbHNcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3N5bWJvbH0nLCAvLyBUaWNrZXIgZm9yIHN5bWJvbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97c3ltYm9sfScsIC8vIFRyYWRlc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vay97c3ltYm9sfScsIC8vIE9yZGVyYm9va1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMve3N5bWJvbH0nLCAvLyBDYW5kbGVzXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsIC8vIExpc3QgeW91ciBjdXJyZW50IG9wZW4gb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIve2NsaWVudE9yZGVySWR9JywgLy8gR2V0IGEgc2luZ2xlIG9yZGVyIGJ5IGNsaWVudE9yZGVySWRcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nL2JhbGFuY2UnLCAvLyBHZXQgdHJhZGluZyBiYWxhbmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZy9mZWUve3N5bWJvbH0nLCAvLyBHZXQgdHJhZGluZyBmZWUgcmF0ZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnkvdHJhZGVzJywgLy8gR2V0IGhpc3RvcmljYWwgdHJhZGVzXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS9vcmRlcicsIC8vIEdldCBoaXN0b3JpY2FsIG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3Rvcnkvb3JkZXIve2lkfS90cmFkZXMnLCAvLyBHZXQgaGlzdG9yaWNhbCB0cmFkZXMgYnkgc3BlY2lmaWVkIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9iYWxhbmNlJywgLy8gR2V0IG1haW4gYWNjY291bnQgYmFsYW5jZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvdHJhbnNhY3Rpb25zJywgLy8gR2V0IGFjY291bnQgdHJhbnNhY3Rpb25zXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC90cmFuc2FjdGlvbnMve2lkfScsIC8vIEdldCBhY2NvdW50IHRyYW5zYWN0aW9uIGJ5IGlkXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9jcnlwdG8vYWRkcmVzcy97Y3VycmVuY3l9JywgLy8gR2V0IGRlcG9zaXQgY3J5cHJvIGFkZHJlc3NcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLCAvLyBDcmVhdGUgbmV3IG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9jcnlwdG8vd2l0aGRyYXcnLCAvLyBXaXRoZHJhdyBjcnlwcm9cbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by9hZGRyZXNzL3tjdXJyZW5jeX0nLCAvLyBDcmVhdGUgbmV3IGRlcG9zaXQgY3J5cHJvIGFkZHJlc3NcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3RyYW5zZmVyJywgLy8gVHJhbnNmZXIgYW1vdW50IHRvIHRyYWRpbmdcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci97Y2xpZW50T3JkZXJJZH0nLCAvLyBDcmVhdGUgbmV3IG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9jcnlwdG8vd2l0aGRyYXcve2lkfScsIC8vIENvbW1pdCB3aXRoZHJhdyBjcnlwcm9cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsIC8vIENhbmNlbCBhbGwgb3BlbiBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci97Y2xpZW50T3JkZXJJZH0nLCAvLyBDYW5jZWwgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by93aXRoZHJhdy97aWR9JywgLy8gUm9sbGJhY2sgd2l0aGRyYXcgY3J5cHJvXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwYXRjaCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci97Y2xpZW50T3JkZXJJZH0nLCAvLyBDYW5jZWwgUmVwbGFjZSBvcmRlclxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAtMC4wMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwODUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNDJzogMC4wMDE4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDAyMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDE4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAxMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLjA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJzFTVCc6IDAuODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQURYJzogNS43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFJzogNi43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFT04nOiAwLjAxMDA2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FJUic6IDU2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTVAnOiA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FOVCc6IDYuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUkRSJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUk4nOiAxOC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSVCc6IDI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUQic6IDAuMDAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEwnOiAyNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVE0nOiA1MDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRTJzogODYwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FWVCc6IDEuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQVMnOiAxMTMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNOJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFVCc6IDEyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCS0InOiA0NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTUMnOiAzMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTVQnOiAxMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk5UJzogMi41NyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUVgnOiA0LjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRNJzogNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRYJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVVMnOiAwLjAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQ1QnOiAxMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RUJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEWCc6IDMwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NGSSc6IDYxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NMRCc6IDAuODgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05EJzogNTc0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NOWCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ09TUyc6IDY1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NTTk8nOiAxNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFInOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFgnOiAxNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1ZDJzogOC40NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQklYJzogMC4wMTY4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDTic6IDEyMDAwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ1QnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RERic6IDM0MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdERU5UJzogNjI0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0InOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdEJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdESUNFJzogMC4zMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdETFQnOiAwLjI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROVCc6IDAuMjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9WJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJQVSc6IDI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSVCc6IDI0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEU0gnOiAwLjAxNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQkVUJzogODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQyc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVENPTEQnOiA2LjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUNBVCc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VERyc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMi45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMRSc6IDAuMDAxNzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxNJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1DJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUdPJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5KJzogMTYzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDEuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFUk8nOiAzNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEJTJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVZYJzogNS40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VYTic6IDQ1NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdGUkQnOiA2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVUVMJzogMTIzLjAwMTA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDIwMi45NTk4MzA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZTic6IDEuODQ5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZUCc6IDY2LjEzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOTyc6IDAuMDAzNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVVAnOiA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dWVCc6IDEuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdIQUMnOiAxNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSERHJzogNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIR1QnOiAxMDgyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hQQyc6IDAuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIVk4nOiAxMjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMC41NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ08nOiAzNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ09TJzogMC4zNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkQnOiA3NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkRJJzogNTkxMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJVFMnOiAxNS4wMDEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lYVCc6IDExLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tCUic6IDE0MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogMTEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBJzogNDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEFUJzogMS40NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSUZFJzogMTMwMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFJDJzogMjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFNLJzogMC4zLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xVTic6IDAuMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFJRCc6IDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFOQSc6IDE0MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQ0FQJzogNS40NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNSVBTJzogNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU5FJzogMS4zMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNU1AnOiAxMjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRIJzogOTIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVlCJzogMy45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05EQyc6IDE2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORUJMJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORVQnOiAzLjk2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05UTyc6IDk5OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWEMnOiAxMy4zOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWFQnOiAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09BWCc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09ETic6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1BUJzogMzM1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09STUUnOiAyLjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1ROJzogMC41NyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVknOiAzLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUElYJzogOTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExCVCc6IDAuMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExSJzogMTE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMVSc6IDAuODcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9FJzogNzg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPTEwnOiAzLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBUJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkUnOiAzMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkcnOiAzOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUk8nOiA0MSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUlMnOiA2MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQVE9ZJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FBVSc6IDYzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FDTic6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVZUJzogNjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdSS0MnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSVlQnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAyLjI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NCRCc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0NMJzogMi42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NJU0EnOiAxNjQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NLSU4nOiA0MDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01BUlQnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01TJzogMC4wMzc1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOQyc6IDM2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOR0xTJzogNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTk0nOiA0OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAyMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RFRU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUUkFUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFUnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFgnOiAxMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiAxNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVVInOiAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NXVCc6IDAuNTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEFBUyc6IDAuOTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEJUJzogMi4zNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdURkwnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSU1FJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSVgnOiA3LjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtOJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUS1InOiA4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTlQnOiA5MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlNUJzogMS42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDEzOTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUVUJzogNDgwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VHVCc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFTic6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFUkknOiAwLjAzNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUInOiA1MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUJFJzogMTQ1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZPSVNFJzogNjE4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dFQUxUSCc6IDAuMDE2OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXSU5HUyc6IDIuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXVEMnOiAwLjc1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hBVVInOiAzLjIzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hETic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEVNJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFVDJzogMC45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lPWU9XJzogMTQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pBUCc6IDI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pSWCc6IDIzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pTQyc6IDE5MSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJzFTVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQURYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUVPTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUlSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJEUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVE0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCS0InOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JNQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JRWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JVUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0NUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0ZJJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTEQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NORCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05YJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDT1NTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDU05PJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1ZDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQklYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRERGJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdERU5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0InOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRElDRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRExUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPVic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJQVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEU0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCRVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVENPTEQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VDQVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VERyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTEUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUdPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTkonOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEJTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVZYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZSRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVFTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05PJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEFDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIREcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hHVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFBDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIVk4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ09TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lOREknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lUUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVhUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLQlInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tJQ0snOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xJRkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFNLJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BSUQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BTkEnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DQVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01JUFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ORSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVNQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ZQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORUJMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05UTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09BWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0ROJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09QVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1JNRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1ROJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExCVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9MTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUlMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BUT1knOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FBVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUktDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NBTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0JEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQ0wnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NJU0EnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NLSU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNQVJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05HTFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVEVFTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RSQVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1dUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUQUFTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUQlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RGTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElNRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUS04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RLUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlNUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VFVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUdUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFUkknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVk9JU0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dFQUxUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOR1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEFVUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEROJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRU0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hVQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWU9ZT1cnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pBUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlJYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaU0MnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KSB7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnWEJ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gICAgICBsZXQgbG90ID0gcGFyc2VGbG9hdCAobWFya2V0WydxdWFudGl0eUluY3JlbWVudCddKTtcbiAgICAgICAgICAgIGxldCBzdGVwID0gcGFyc2VGbG9hdCAobWFya2V0Wyd0aWNrU2l6ZSddKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ3RpY2tTaXplJ10pLFxuICAgICAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsncXVhbnRpdHlJbmNyZW1lbnQnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHRha2VyID0gcGFyc2VGbG9hdCAobWFya2V0Wyd0YWtlTGlxdWlkaXR5UmF0ZSddKTtcbiAgICAgICAgICAgIGxldCBtYWtlciA9IHBhcnNlRmxvYXQgKG1hcmtldFsncHJvdmlkZUxpcXVpZGl0eVJhdGUnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnc3RlcCc6IHN0ZXAsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogdGFrZXIsXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogbWFrZXIsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBzdGVwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90ICogc3RlcCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQ3VycmVuY2llcyAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEN1cnJlbmN5IChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmN5WydpZCddO1xuICAgICAgICAgICAgLy8gdG9kbzogd2lsbCBuZWVkIHRvIHJldGhpbmsgdGhlIGZlZXNcbiAgICAgICAgICAgIC8vIHRvIGFkZCBzdXBwb3J0IGZvciBtdWx0aXBsZSB3aXRoZHJhd2FsL2RlcG9zaXQgbWV0aG9kcyBhbmRcbiAgICAgICAgICAgIC8vIGRpZmZlcmVudGlhdGVkIGZlZXMgZm9yIGVhY2ggcGFydGljdWxhciBtZXRob2RcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSA4OyAvLyBkZWZhdWx0IHByZWNpc2lvbiwgdG9kbzogZml4IFwibWFnaWMgY29uc3RhbnRzXCJcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBwYXlpbiA9IGN1cnJlbmN5WydwYXlpbkVuYWJsZWQnXTtcbiAgICAgICAgICAgIGxldCBwYXlvdXQgPSBjdXJyZW5jeVsncGF5b3V0RW5hYmxlZCddO1xuICAgICAgICAgICAgbGV0IHRyYW5zZmVyID0gY3VycmVuY3lbJ3RyYW5zZmVyRW5hYmxlZCddO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IHBheWluICYmIHBheW91dCAmJiB0cmFuc2ZlcjtcbiAgICAgICAgICAgIGxldCBzdGF0dXMgPSAnb2snO1xuICAgICAgICAgICAgaWYgKCdkaXNhYmxlZCcgaW4gY3VycmVuY3kpXG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5WydkaXNhYmxlZCddKVxuICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSAnZGlzYWJsZWQnO1xuICAgICAgICAgICAgbGV0IHR5cGUgPSAoY3VycmVuY3lbJ2NyeXB0byddKSA/ICdjcnlwdG8nIDogJ2ZpYXQnO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAgICAgJ3BheWluJzogcGF5aW4sXG4gICAgICAgICAgICAgICAgJ3BheW91dCc6IHBheW91dCxcbiAgICAgICAgICAgICAgICAndHJhbnNmZXInOiB0cmFuc2ZlcixcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ2Z1bGxOYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsIC8vIHRvZG86IHJlZGVzaWduXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdHlwZSA9IHRoaXMuc2FmZVN0cmluZyAocGFyYW1zLCAndHlwZScsICd0cmFkaW5nJyk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZUdldCcgKyB0aGlzLmNhcGl0YWxpemUgKHR5cGUpICsgJ0JhbGFuY2UnO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzW21ldGhvZF0gKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjb2RlKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlJ10pLFxuICAgICAgICAgICAgICAgIC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RoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiB0aWNrZXIpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRpY2tlclsnbWVzc2FnZSddKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodHJhZGVbJ3RpbWVzdGFtcCddKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGxldCBpZCA9IHRyYWRlWydzeW1ib2wnXTtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnZmVlJyBpbiB0cmFkZSkge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gbWFya2V0ID8gbWFya2V0WydxdW90ZSddIDogdW5kZWZpbmVkO1xuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAodHJhZGVbJ2ZlZSddKSxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG9yZGVySWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnY2xpZW50T3JkZXJJZCcgaW4gdHJhZGUpXG4gICAgICAgICAgICBvcmRlcklkID0gdHJhZGVbJ2NsaWVudE9yZGVySWQnXTtcbiAgICAgICAgbGV0IHByaWNlID0gcGFyc2VGbG9hdCAodHJhZGVbJ3ByaWNlJ10pO1xuICAgICAgICBsZXQgYW1vdW50ID0gcGFyc2VGbG9hdCAodHJhZGVbJ3F1YW50aXR5J10pO1xuICAgICAgICBsZXQgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXJJZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY29zd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A9PSAncGFydGlhbGx5RmlsbGVkJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICB9IGVsc2UgaWYgKHN0YXR1cyA9PSAnZmlsbGVkJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGlkID0gb3JkZXJbJ2NsaWVudE9yZGVySWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgaWYgKHR5cGVvZiBwcmljZSA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm9yZGVycylcbiAgICAgICAgICAgICAgICBwcmljZSA9IHRoaXMub3JkZXJzW2lkXVsncHJpY2UnXTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVtYWluaW5nID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGZpbGxlZCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICByZW1haW5pbmcgPSBhbW91bnQgLSBmaWxsZWQ7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgY29zdCA9IGZpbGxlZCAqIHByaWNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogY3JlYXRlZCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAoY3JlYXRlZCksXG4gICAgICAgICAgICAnY3JlYXRlZCc6IGNyZWF0ZWQsXG4gICAgICAgICAgICAndXBkYXRlZCc6IHVwZGF0ZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0SGlzdG9yeU9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2NsaWVudE9yZGVySWQnOiBpZCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBudW1PcmRlcnMgPSByZXNwb25zZS5sZW5ndGg7XG4gICAgICAgIGlmIChudW1PcmRlcnMgPiAwKVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlciAocmVzcG9uc2VbMF0pO1xuICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAodGhpcy5pZCArICcgb3JkZXIg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ICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnaWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSAnL2FwaScgKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLyc7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IGFwaSArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgdXJsICs9IHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBwYXlsb2FkID0gdGhpcy5lbmNvZGUgKHRoaXMuYXBpS2V5ICsgJzonICsgdGhpcy5zZWNyZXQpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLnN0cmluZ1RvQmFzZTY0IChwYXlsb2FkKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0F1dGhvcml6YXRpb24nOiBcIkJhc2ljIFwiICsgdGhpcy5kZWNvZGUgKGF1dGgpLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyB1cmw7XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09PSA0MDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdID09PSBcIntcIikge1xuICAgICAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2VbJ2Vycm9yJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gcmVzcG9uc2VbJ2Vycm9yJ11bJ21lc3NhZ2UnXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlID09PSAnT3JkZXIgbm90IGZvdW5kJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyBvcmRlciBub3QgZm91bmQgaW4gYWN0aXZlIG9yZGVycycpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnSW5zdWZmaWNpZW50IGZ1bmRzJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnRHVwbGljYXRlIGNsaWVudE9yZGVySWQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGh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biAgICAgICAgICAgICAgICAnMW0nOiAnMDAxJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnMDA1JyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzAxNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICcwMzAnLFxuICAgICAgICAgICAgICAgICcxaCc6ICcwNjAnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxMDAnLFxuICAgICAgICAgICAgICAgICcxdyc6ICcyMDAnLFxuICAgICAgICAgICAgICAgICcxTSc6ICczMDAnLFxuICAgICAgICAgICAgICAgICcxeSc6ICc0MDAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1NjktMTVhYTdiOWEtNWVkZC0xMWU3LTllN2YtNDQ3OTFmNGVlNDljLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwOi8vYXBpLmh1b2JpLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5odW9iaS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2h1b2JpYXBpL0FQSV9Eb2NzX2VuL3dpa2knLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3N0YXRpY21hcmtldCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9X2tsaW5lX3twZXJpb2R9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfV97bGVuZ3RofScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsX3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3VzZG1hcmtldCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9X2tsaW5lX3twZXJpb2R9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfV97bGVuZ3RofScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsX3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3RyYWRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfYWNjb3VudF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eV9tYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxfbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9uZXdfZGVhbF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlcl9pZF9ieV90cmFkZV9pZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfY29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3dpdGhkcmF3X2NvaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF93aXRoZHJhd19jb2luX3Jlc3VsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcGF5bWVudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2xvYW5fYXZhaWxhYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfbG9hbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9DTlknOiB7ICdpZCc6ICdidGMnLCAnc3ltYm9sJzogJ0JUQy9DTlknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ05ZJywgJ3R5cGUnOiAnc3RhdGljbWFya2V0JywgJ2NvaW5UeXBlJzogMSB9LFxuICAgICAgICAgICAgICAgICdMVEMvQ05ZJzogeyAnaWQnOiAnbHRjJywgJ3N5bWJvbCc6ICdMVEMvQ05ZJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ0NOWScsICd0eXBlJzogJ3N0YXRpY21hcmtldCcsICdjb2luVHlwZSc6IDIgfSxcbiAgICAgICAgICAgICAgICAvLyAnQlRDL1VTRCc6IHsgJ2lkJzogJ2J0YycsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnLCAndHlwZSc6ICd1c2RtYXJrZXQnLCAgICAnY29pblR5cGUnOiAxIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgK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Wyd0aWNrZXInXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChyZXNwb25zZVsndGltZSddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2J1eScpLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ29wZW4nKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAnaW5mb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J3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXTtcbiAgICAgICAgaWYgKGFwaSA9PSAndHJhZGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIHVybCArPSAnL2FwaScgKyB0aGlzLnZlcnNpb247XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmtleXNvcnQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ2FjY2Vzc19rZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlZCc6IHRoaXMubm9uY2UgKCksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGxldCBxdWVyeVN0cmluZyA9IHRoaXMudXJsZW5jb2RlICh0aGlzLm9taXQgKHF1ZXJ5LCAnbWFya2V0JykpO1xuICAgICAgICAgICAgLy8gc2VjcmV0IGtleSBtdXN0IGJlIGFwcGVuZGVkIHRvIHRoZSBxdWVyeSBiZWZvcmUgc2lnbmluZ1xuICAgICAgICAgICAgcXVlcnlTdHJpbmcgKz0gJyZzZWNyZXRfa2V5PScgKyB0aGlzLnNlY3JldDtcbiAgICAgICAgICAgIHF1ZXJ5WydzaWduJ10gPSB0aGlzLmhhc2ggKHRoaXMuZW5jb2RlIChxdWVyeVN0cmluZykpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNv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iAgICAgICAgICAgICdob3N0bmFtZSc6ICdhcGkuaHVvYmkucHJvJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAvLyBvYnNvbGV0ZSBtZXRhaW5mbyBzdHJ1Y3R1cmVcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIC8vIG5ldyBtZXRhaW5mbyBzdHJ1Y3R1cmVcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hDTFYnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtaW4nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bWluJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bWluJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbWluJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnNjBtaW4nLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMXdlZWsnLFxuICAgICAgICAgICAgICAgICcxTSc6ICcxbW9uJyxcbiAgICAgICAgICAgICAgICAnMXknOiAnMXllYXInLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1NjktMTVhYTdiOWEtNWVkZC0xMWU3LTllN2YtNDQ3OTFmNGVlNDljLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5odW9iaS5wcm8nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaHVvYmkucHJvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2l0aHViLmNvbS9odW9iaWFwaS9BUElfRG9jcy93aWtpL1JFU1RfYXBpX3JlZmVyZW5jZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnbWFya2V0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3Rvcnkva2xpbmUnLCAvLyDojrflj5ZL57q/5pWw5o2uXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsL21lcmdlZCcsIC8vIOiOt+WPluiBmuWQiOihjOaDhShUaWNrZXIpXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLCAvLyDojrflj5YgTWFya2V0IERlcHRoIOaVsOaNrlxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJywgLy8g6I635Y+WIFRyYWRlIERldGFpbCDmlbDmja5cbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L3RyYWRlJywgLy8g5om56YeP6I635Y+W5pyA6L+R55qE5Lqk5piT6K6w5b2VXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsJywgLy8g6I635Y+WIE1hcmtldCBEZXRhaWwgMjTlsI/ml7bmiJDkuqTph4/mlbDmja5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL3N5bWJvbHMnLCAvLyDmn6Xor6Lns7vnu5/mlK/mjIHnmoTmiYDmnInkuqTmmJPlr7lcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb21tb24vY3VycmVuY3lzJywgLy8g5p+l6K+i57O757uf5pSv5oyB55qE5omA5pyJ5biB56eNXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL3RpbWVzdGFtcCcsIC8vIOafpeivouezu+e7n+W9k+WJjeaXtumXtFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9hY2NvdW50cycsIC8vIOafpeivouW9k+WJjeeUqOaIt+eahOaJgOaciei0puaItyjljbNhY2NvdW50LWlkKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvYWNjb3VudHMve2lkfS9iYWxhbmNlJywgLy8g5p+l6K+i5oyH5a6a6LSm5oi355qE5L2Z6aKdXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL3tpZH0nLCAvLyDmn6Xor6Lmn5DkuKrorqLljZXor6bmg4VcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMve2lkfS9tYXRjaHJlc3VsdHMnLCAvLyDmn6Xor6Lmn5DkuKrorqLljZXnmoTmiJDkuqTmmI7nu4ZcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMnLCAvLyDmn6Xor6LlvZPliY3lp5TmiZjjgIHljoblj7Llp5TmiZhcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9tYXRjaHJlc3VsdHMnLCAvLyDmn6Xor6LlvZPliY3miJDkuqTjgIHljoblj7LmiJDkuqRcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy93aXRoZHJhdy12aXJ0dWFsL2FkZHJlc3NlcycsIC8vIOafpeivouiZmuaLn+W4geaPkOeOsOWcsOWdgFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMvcGxhY2UnLCAvLyDliJvlu7rlubbmiafooYzkuIDkuKrmlrDorqLljZUgKOS4gOatpeS4i+WNle+8jCDmjqjojZDkvb/nlKgpXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzJywgLy8g5Yib5bu65LiA5Liq5paw55qE6K6i5Y2V6K+35rGCIO+8iOS7heWIm+W7uuiuouWNle+8jOS4jeaJp+ihjOS4i+WNle+8iVxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy97aWR9L3BsYWNlJywgLy8g5omn6KGM5LiA5Liq6K6i5Y2VIO+8iOS7heaJp+ihjOW3suWIm+W7uueahOiuouWNle+8iVxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy97aWR9L3N1Ym1pdGNhbmNlbCcsIC8vIOeUs+ivt+aSpOmUgOS4gOS4quiuouWNleivt+axglxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy9iYXRjaGNhbmNlbCcsIC8vIOaJuemHj+aSpOmUgOiuouWNlVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L2JhbGFuY2UvdHJhbnNmZXInLCAvLyDotYTkuqfliJLovaxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy93aXRoZHJhdy12aXJ0dWFsL2NyZWF0ZScsIC8vIOeUs+ivt+aPkOeOsOiZmuaLn+W4gVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwve2lkfS9wbGFjZScsIC8vIOehruiupOeUs+ivt+iZmuaLn+W4geaPkOeOsFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwve2lkfS9jYW5jZWwnLCAvLyDnlLPor7flj5bmtojmj5DnjrDomZrmi5/luIFcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDb21tb25TeW1ib2xzICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCBudW1NYXJrZXRzID0gbWFya2V0cy5sZW5ndGg7XG4gICAgICAgIGlmIChudW1NYXJrZXRzIDwgMSlcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBwdWJsaWNHZXRDb21tb25TeW1ib2xzIHJldHVybmVkIGVtcHR5IHJlc3BvbnNlOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydiYXNlLWN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsncXVvdGUtY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gYmFzZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBpZCA9IGJhc2VJZCArIHF1b3RlSWQ7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYW1vdW50LXByZWNpc2lvbiddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsncHJpY2UtcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gKGJhc2UgPT0gJ09NRycpID8gMCA6IDAuMiAvIDEwMDtcbiAgICAgICAgICAgIGxldCB0YWtlciA9IChiYXNlID09ICdPTUcnKSA/IDAgOiAwLjIgLyAxMDA7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAndGFrZXInOiB0YWtlcixcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBtYWtlcixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGxhc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnbGFzdCcgaW4gdGlja2VyKVxuICAgICAgICAgICAgbGFzdCA9IHRpY2tlclsnbGFzdCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGlmICgndHMnIGluIHRpY2tlcilcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRpY2tlclsndHMnXTtcbiAgICAgICAgbGV0IGJpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGFzayA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdiaWQnIGluIHRpY2tlcikge1xuICAgICAgICAgICAgaWYgKHRpY2tlclsnYmlkJ10pXG4gICAgICAgICAgICAgICAgYmlkID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlclsnYmlkJ10sIDApO1xuICAgICAgICB9XG4gICAgICAgIGlmICgnYXNrJyBpbiB0aWNrZXIpIHtcbiAgICAgICAgICAgIGlmICh0aWNrZXJbJ2FzayddKVxuICAgICAgICAgICAgICAgIGFzayA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXJbJ2FzayddLCAwKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRpY2tlclsnaGlnaCddLFxuICAgICAgICAgICAgJ2xvdyc6IHRpY2tlclsnbG93J10sXG4gICAgICAgICAgICAnYmlkJzogYmlkLFxuICAgICAgICAgICAgJ2Fzayc6IGFzayxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB0aWNrZXJbJ29wZW4nXSxcbiAgICAgICAgICAgICdjbG9zZSc6IHRpY2tlclsnY2xvc2UnXSxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2Ftb3VudCddKSxcbiAgICAg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MuZmV0Y2hBY2NvdW50cyAoKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmICh0aGlzLmFjY291bnRzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuYWNjb3VudHM7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuYWNjb3VudHMgPSBhd2FpdCB0aGlzLmZldGNoQWNjb3VudHMgKCk7XG4gICAgICAgICAgICAgICAgdGhpcy5hY2NvdW50c0J5SWQgPSB0aGlzLmluZGV4QnkgKHRoaXMuYWNjb3VudHMsICdpZCcpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLmFjY291bnRzO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQWNjb3VudHMgKCkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRBY2NvdW50QWNjb3VudHMgKCk7XG4gICAgICAgIHJldHVybiByZXNwb25zZVsnZGF0YSddO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkQWNjb3VudHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRBY2NvdW50c0lkQmFsYW5jZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMuYWNjb3VudHNbMF1bJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnZGF0YSddWydsaXN0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcm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0ZW5kICh7XG4gICAgICAgICAgICAnc3RhdHVzJzogb3BlbixcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlclN0YXR1cyAoc3RhdHVzKSB7XG4gICAgICAgIGlmIChzdGF0dXMgPT0gJ3BhcnRpYWwtZmlsbGVkJykge1xuICAgICAgICAgICAgcmV0dXJuICdvcGVuJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT0gJ2ZpbGxlZCcpIHtcbiAgICAgICAgICAgIHJldHVybiAnY2xvc2VkJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT0gJ2NhbmNlbGVkJykge1xuICAgICAgICAgICAgcmV0dXJuICdjYW5jZWxlZCc7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09ICdzdWJtaXR0ZWQnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ29wZW4nO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc2lkZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHR5cGUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBzdGF0dXMgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgndHlwZScgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGxldCBvcmRlclR5cGUgPSBvcmRlclsndHlwZSddLnNwbGl0ICgnLScpO1xuICAgICAgICAgICAgc2lkZSA9IG9yZGVyVHlwZVswXTtcbiAgICAgICAgICAgIHR5cGUgPSBvcmRlclR5cGVbMV07XG4gICAgICAgICAgICBzdGF0dXMgPSB0aGlzLnBhcnNlT3JkZXJTdGF0dXMgKG9yZGVyWydzdGF0ZSddKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdzeW1ib2wnIGluIG9yZGVyKSB7XG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydzeW1ib2wnXSBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IG1hcmtldElkID0gb3JkZXJbJ3N5bWJvbCddO1xuICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbbWFya2V0SWRdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IG9yZGVyWydjcmVhdGVkLWF0J107XG4gICAgICAgIGxldCBhbW91bnQgPSBwYXJzZUZsb2F0IChvcmRlclsnYW1vdW50J10pO1xuICAgICAgICBsZXQgZmlsbGVkID0gcGFyc2VGbG9hdCAob3JkZXJbJ2ZpZWxkLWFtb3VudCddKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IGFtb3VudCAtIGZpbGxlZDtcbiAgICAgICAgbGV0IHByaWNlID0gcGFyc2VGbG9hdCAob3JkZXJbJ3ByaWNlJ10pO1xuICAgICAgICBsZXQgY29zdCA9IHBhcnNlRmxvYXQgKG9yZGVyWydmaWVsZC1jYXNoLWFtb3VudCddKTtcbiAgICAgICAgbGV0IGF2ZXJhZ2UgPSAwO1xuICAgICAgICBpZiAoZmlsbGVkKVxuICAgICAgICAgICAgYXZlcmFnZSA9IHBhcnNlRmxvYXQgKGNvc3QgLyBmaWxsZWQpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZEFjY291bnRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdhY2NvdW50LWlkJzogdGhpcy5hY2NvdW50c1swXVsnaWQnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlICsgJy0nICsgdHlwZS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lcnZlLmNvbS9Qcml2YXRlJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaW5kZXBlbmRlbnRyZXNlcnZlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5pbmRlcGVuZGVudHJlc2VydmUuY29tL0FQSScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkUHJpbWFyeUN1cnJlbmN5Q29kZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkU2Vjb25kYXJ5Q3VycmVuY3lDb2RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRMaW1pdE9yZGVyVHlwZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkTWFya2V0T3JkZXJUeXBlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRPcmRlclR5cGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRWYWxpZFRyYW5zYWN0aW9uVHlwZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldFN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9yZGVyQm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVIaXN0b3J5U3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0UmVjZW50VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRGeFJhdGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdQbGFjZUxpbWl0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BsYWNlTWFya2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRDbG9zZWRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldENsb3NlZEZpbGxlZE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3JkZXJEZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRBY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREaWdpdGFsQ3VycmVuY3lEZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0RGlnaXRhbEN1cnJlbmN5RGVwb3NpdEFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3luY2hEaWdpdGFsQ3VycmVuY3lEZXBvc2l0QWRkcmVzc1dpdGhCbG9ja2NoYWluJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0RpZ2l0YWxDdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVxdWVzdEZpYXRXaXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgYmFzZUN1cnJlbmNpZX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ICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiB0YWtlcixcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogbWFrZXIsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogaWQsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRBY2NvdW50cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2ldO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5Q29kZSA9IGJhbGFuY2VbJ0N1cnJlbmN5Q29kZSddO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5Q29kZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IH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0J1eU9yZGVycycsICdTZWxsT3JkZXJzJywgJ1ByaWNlJywgJ1ZvbHVtZScpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRpY2tlclsnQ3JlYXRlZFRpbWVzdGFtcFV0YyddKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGlja2VyWydEYXlIaWdoZXN0UHJpY2UnXSxcbiAgICAgICAgICAgICdsb3cnOiB0aWNrZXJbJ0RheUxvd2VzdFByaWNlJ10sXG4gICAgICAgICAgICAnYmlkJzogdGlja2VyWydDdXJyZW50SGlnaGVzdEJpZFByaWNlJ10sXG4gICAgICAgICAgICAnYXNrJzogdGlja2VyWydDdXJyZW50TG93ZXN0T2ZmZXJQcmljZSddLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGlja2VyWydMYXN0UHJpY2UnXSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5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J2lkJzogcmVzcG9uc2VbJ09yZGVyR3VpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh7ICdvcmRlckd1aWQnOiBpZCB9KTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gW1xuICAgICAgICAgICAgICAgIHVybCxcbiAgICAgICAgICAgICAgICAnYXBpS2V5PScgKyB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2U9JyArIG5vbmNlLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgXTtcbiAgICAgICAgICAgIGxldCBrZXlzb3J0ZWQgPSB0aGlzLmtleXNvcnQgKHBhcmFtcyk7XG4gICAgICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChrZXlzb3J0ZWQpO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGtleSA9IGtleXNbaV07XG4gICAgICAgICAgICAgICAgYXV0aC5wdXNoIChrZXkgKyAnPScgKyBwYXJhbXNba2V5XSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgbWVzc2FnZSA9IGF1dGguam9pbiAoJywnKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChtZXNzYWdlKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmtleXNvcnQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0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Y29udGVudC5jb20vMTI5NDQ1NC8yNzgyMjE1OS02NjE1MzYyMC02MGFkLTExZTctODllNy0wMDVmNmQ3ZjNkZTAuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLml0Yml0LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5pdGJpdC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS5pdGJpdC5jb20vZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5pdGJpdC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3tzeW1ib2x9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy97c3ltYm9sfS9vcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3tzeW1ib2x9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9iYWxhbmNlcy97Y3VycmVuY3lDb2RlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L2Z1bmRpbmdfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0X3RyYW5zZmVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L2NyeXB0b2N1cnJlbmN5X2RlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0vY3J5cHRvY3VycmVuY3lfd2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpcmVfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvVVNEJzogeyAnaWQnOiAnWEJUVVNEJywgJ3N5bWJvbCc6ICdCVEMvVVNEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1VTRCcgfSxcbiAgICAgICAgICAgICAgICAnQlRDL1NHRCc6IHsgJ2lkJzogJ1hCVFNHRCcsICdzeW1ib2wnOiAnQlRDL1NHRCcsICdiYXNlJzogJ0JUQyc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gICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0UHJpY2UnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWyd0aW1lc3RhbXAnXSk7XG4gICAgICAgIGxldCBpZCA9IHRyYWRlWydtYXRjaE51bWJlciddLnRvU3RyaW5nICgpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ29yZGVyJzogaWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogcGFyc2VGbG9hdCAodHJhZGVbJ3ByaWNlJ10pLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHBhcnNlRmxvYXQgKHRyYWRlWydhbW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lzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIGJvZHkgPSAnJztcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgdGltZXN0YW1wID0gbm9uY2U7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IFsgbWV0aG9kLCB1cmwsIGJvZHksIG5vbmNlLCB0aW1lc3RhbXAgXTtcbiAgICAgICAgICAgIGxldCBtZXNzYWdlID0gbm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WQ4MjM2YzBlNjkyLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5qdWJpLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuanViaS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuanViaS5jb20vaGVscC9hcGkuaHRtbCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0QWxsdGlja2VyICgpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNbcF07XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gJ0NOWSc7IC8vIHRvZG9cbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mby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ludGVyZmFjZVxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAvLyBuZXcgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0c0J5QWx0bmFtZSc6IHt9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzEnLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1JyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1JyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnNjAnLFxuICAgICAgICAgICAgICAgICc0aCc6ICcyNDAnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxNDQwJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMTAwODAnLFxuICAgICAgICAgICAgICAgICcydyc6ICcyMTYwMCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjU5OS0yMjcwOTMwNC01ZWRlLTExZTctOWRlMS05ZjMzNzMyZTE1MDkuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmtyYWtlbi5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cua3Jha2VuLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmtyYWtlbi5jb20vZW4tdXMvaGVscC9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL25vdGhpbmdpc2RlYWQvbnBtLWtyYWtlbi1hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5rcmFrZW4uY29tL2VuLXVzL2hlbHAvZmVlcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3N1cHBvcnQua3Jha2VuLmNvbS9oYy9lbi11cy9hcnRpY2xlcy8yMDEzOTY3NzctV2hhdC1hcmUtdGhlLWRlcG9zaXQtZmVlcy0nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9zdXBwb3J0LmtyYWtlbi5jb20vaGMvZW4tdXMvYXJ0aWNsZXMvMjAxODkzNjA4LVdoYXQtYXJlLXRoZS13aXRoZHJhd2FsLWZlZXMtJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjI2IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjE2IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGllcnMnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAndGFrZXInOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDAuMjYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMCwgMC4yNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMCwgMC4yMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI1MDAwMCwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwLCAwLjE4IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMCwgMC4xNiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI1MDAwMDAsIDAuMTQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAwLCAwLjEyIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAsIDAuMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjE2IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAsIDAuMTQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAsIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAsIDAuMTAgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAsIDAuOCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAsIDAuNiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI1MDAwMDAsIDAuNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAwLCAwLjAgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hMTSc6IDAuMDAwMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMDEwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNTE4nOiAwLjAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLjA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiA1LCAvLyBpZiBkb21lc3RpYyB3aXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogNSwgLy8gaWYgZG9tZXN0aWMgd2lyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NBRCc6IDEwLCAvLyBDQUQgRUZUIFdpdGhkcmF3YWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdKUFknOiAzMDAsIC8vIGlmIGRvbWVzdGljIHdpcmVcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWExNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUxOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRCc6IDUsIC8vIGlmIGRvbWVzdGljIHdpcmVcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAwLCAvLyBmcmVlIGRlcG9zaXQgaWYgRVVSIFNFUEEgRGVwb3NpdFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NBRCc6IDUsIC8vIGlmIGRvbWVzdGljIHdpcmVcbiAgICAgICAgICAgICAgICAgICAgICAgICdKUFknOiAwLCAvLyBEb21lc3RpYyBEZXBvc2l0IChGcmVlLCDCpTUsMDAwIGRlcG9zaXQgbWluaW11bSlcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBc3NldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0Fzc2V0UGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPSExDJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTcHJlYWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVGltZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBZGRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0Nsb3NlZE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRGVwb3NpdEFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRGVwb3NpdE1ldGhvZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RlcG9zaXRTdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xlZGdlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09wZW5Qb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1F1ZXJ5TGVkZ2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUXVlcnlPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1F1ZXJ5VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZUJhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlVm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdDYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdTdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjb3N0VG9QcmVjaXNpb24gKHN5bWJvbCwgY29zdCkge1xuICAgICAgICByZXR1cm4gdGhpcy50cnVuY2F0ZSAocGFyc2VGbG9hdCAoY29zdCksIHRoaXMubWFya2V0c1tzeW1ib2xdWydwcmVjaXNpb24nXVsncHJpY2UnXSk7XG4gICAgfVxuXG4gICAgZmVlVG9QcmVjaXNpb24gKHN5bWJvbCwgZmVlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnRydW5jYXRlIChwYXJzZUZsb2F0IChmZWUpLCB0aGlzLm1hcmtldHNbc3ltYm9sXVsncHJlY2lzaW9uJ11bJ2Ftb3VudCddKTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGJvZHkuaW5kZXhPZiAoJ0ludmFsaWQgbm9uY2UnKSA+PSAwKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWROb25jZSAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnSW5zdWZmaWNpZW50IGZ1bmRzJykgPj0gMClcbiAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnQ2FuY2VsIHBlbmRpbmcnKSA+PSAwKVxuICAgICAgICAgICAgdGhyb3cgbmV3IENhbmNlbFBlbmRpbmcgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgaWYgKGJvZHkuaW5kZXhPZiAoJ0ludmFsaWQgYXJndW1lbnRzOnZvbHVtZScpID49IDApXG4gICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEFzc2V0UGFpcnMgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHNbJ3Jlc3VsdCddKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGtleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNbaV07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sncmVzdWx0J11baWRdO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ2Jhc2UnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgICAgIGlmICgoYmFzZVswXSA9PSAnWCcpIHx8IChiYXNlWzBdID09ICdaJykpXG4gICAgICAgICAgICAgICAgYmFzZSA9IGJhc2Uuc2xpY2UgKDEpO1xuICAgICAgICAgICAgaWYgKChxdW90ZVswXSA9PSAnWCcpIHx8IChxdW90ZVswXSA9PSAnWicpKVxuICAgICAgICAgICAgICAgIHF1b3RlID0gcXVvdGUuc2xpY2UgKDEpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBkYXJrcG9vbCA9IGlkLmluZGV4T2YgKCcuZCcpID49IDA7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gZGFya3Bvb2wgPyBtYXJrZXRbJ2FsdG5hbWUnXSA6IChiYXNlICsgJy8nICsgcXVvdGUpO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKCdmZWVzX21ha2VyJyBpbiBtYXJrZXQpIHtcbiAgICAgICAgICAgICAgICBtYWtlciA9IHBhcnNlRmxvYXQgKG1hcmtldFsnZmVlc19tYWtlciddWzBdWzFdKSAvIDEwMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnbG90X2RlY2ltYWxzJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwYWlyX2RlY2ltYWxzJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnZGFya3Bvb2wnOiBkYXJrcG9vbCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnYWx0bmFtZSc6IG1hcmtldFsnYWx0bmFtZSddLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHBhcnNlRmxvYXQgKG1hcmtldFsnZmVlcyddWzBdWzFdKSAvIDEwMCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmVzdWx0ID0gdGhpcy5hcHBlbmRJbmFjdGl2ZU1hcmtldHMgKHJlc3VsdCk7XG4gICAgICAgIHRoaXMubWFya2V0c0J5QWx0bmFtZSA9IHRoaXMuaW5kZXhCeSAocmVzdWx0LCAnYWx0bmFtZScpO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFwcGVuZEluYWN0aXZlTWFya2V0cyAocmVzdWx0ID0gW10pIHtcbiAgICAgICAgbGV0IHByZWNpc2lvbiA9IHsgJ2Ftb3VudCc6IDgsICdwcmljZSc6IDggfTtcbiAgICAgICAgbGV0IGNvc3RMaW1pdHMgPSB7ICdtaW4nOiAwLCAnbWF4JzogdW5kZWZpbmVkIH07XG4gICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHsgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksICdtYXgnOiB1bmRlZmluZWQgfTtcbiAgICAgICAgbGV0IGFtb3VudExpbWl0cyA9IHsgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLCAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSB9O1xuICAgICAgICBsZXQgbGltaXRzID0geyAnYW1vdW50JzogYW1vdW50TGltaXRzLCAncHJpY2UnOiBwcmljZUxpbWl0cywgJ2Nvc3QnOiBjb3N0TGltaXRzIH07XG4gICAgICAgIGxldCBkZWZhdWx0cyA9IHtcbiAgICAgICAgICAgICdkYXJrcG9vbCc6IGZhbHNlLFxuICAgICAgICAgICAgJ2luZm8nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbWFrZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGFrZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG90JzogYW1vdW50TGltaXRzWydtaW4nXSxcbiAgICAgICAgICAgICdhY3RpdmUnOiBmYWxzZSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAnbGltaXRzJzogbGltaXRzLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgbWFya2V0cyA9IFtcbiAgICAgICAgICAgIHsgJ2lkJzogJ1hYTE1aRVVSJywgJ3N5bWJvbCc6ICdYTE0vRVVSJywgJ2Jhc2UnOiAnWExNJywgJ3F1b3RlJzogJ0VVUicsICdhbHRuYW1lJzogJ1hMTUVVUicgfSxcbiAgICAgICAgXTtc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Y29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGRhcmtwb29sID0gc3ltYm9sLmluZGV4T2YgKCcuZCcpID49IDA7XG4gICAgICAgIGlmIChkYXJrcG9vbClcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBkb2VzIG5vdCBwcm92aWRlIGFuIG9yZGVyIGJvb2sgZm9yIGRhcmtwb29sIHN5bWJvbCAnICsgc3ltYm9sKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldERlcHRoICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAvLyAnY291bnQnOiAxMDAsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gcmVzcG9uc2VbJ3Jlc3VsdCddW21hcmtldFsnaWQnXV07XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2spO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAg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biAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcGFpcnMgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcyA9IDA7IHMgPCB0aGlzLnN5bWJvbHMubGVuZ3RoOyBzKyspIHtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSB0aGlzLnN5bWJvbHNbc107XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgICAgICBpZiAobWFya2V0WydhY3RpdmUnXSlcbiAgICAgICAgICAgICAgICBpZiAoIW1hcmtldFsnZGFya3Bvb2wnXSlcbiAgICAgICAgICAgICAgICAgICAgcGFpcnMucHVzaCAobWFya2V0WydpZCddKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgZmlsdGVyID0gcGFpcnMuam9pbiAoJywnKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IGZpbHRlcixcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsg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2F0ICh0cmFkZVsndm9sJ10pO1xuICAgICAgICAgICAgaWYgKCdmZWUnIGluIHRyYWRlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbmN5ID0gbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0ICh0cmFkZVsnZmVlJ10pLFxuICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWzJdICogMTAwMCk7XG4gICAgICAgICAgICBzaWRlID0gKHRyYWRlWzNdID09ICdzJykgPyAnc2VsbCcgOiAnYnV5JztcbiAgICAgICAgICAgIHR5cGUgPSAodHJhZGVbNF0gPT0gJ2wnKSA/ICdsaW1pdCcgOiAnbWFya2V0JztcbiAgICAgICAgICAgIHByaWNlID0gcGFyc2VGbG9hdCAodHJhZGVbMF0pO1xuICAgICAgICAgICAgYW1vdW50ID0gcGFyc2VGbG9hdCAodHJhZGVbMV0pO1xuICAgICAgICB9XG4gICAgICAgIGxldCBzeW1ib2wgPSAobWFya2V0KSA/IG1hcmtldFsnc3ltYm9sJ10gOiB1bmRlZmluZWQ7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVyLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRp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2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gY3VycmVuY3k7XG4gICAgICAgICAgICAvLyBYLUlTTzQyMTctQTMgc3RhbmRhcmQgY3VycmVuY3kgY29kZXNcbiAgICAgICAgICAgIGlmIChjb2RlWzBdID09ICdYJykge1xuICAgICAgICAgICAgICAgIGNvZGUgPSBjb2RlLnNsaWNlICgxKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY29kZVswXSA9PSAnWicpIHtcbiAgICAgICAgICAgICAgICBjb2RlID0gY29kZS5zbGljZSAoMSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGNvZGUpO1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBwYXJzZUZsb2F0IChiYWxhbmNlc1tjdXJyZW5jeV0pO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2UsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyY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cmljZSlcbiAgICAgICAgICAgIHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGlmICgnZmVlJyBpbiBvcmRlcikge1xuICAgICAgICAgICAgICAgIGxldCBmbGFncyA9IG9yZGVyWydvZmxhZ3MnXTtcbiAgICAgICAgICAgICAgICBsZXQgZmVlQ29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2ZlZScpO1xuICAgICAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiBmZWVDb3N0LFxuICAgICAgICAgICAgICAgICAgICAncmF0ZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGlmIChmbGFncy5pbmRleE9mICgnZmNpcScpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZmVlWydjdXJyZW5jeSddID0gbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZmxhZ3MuaW5kZXhPZiAoJ2ZjaWInKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGZlZVsnY3VycmVuY3knXSA9IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzdGF0dXMnOiBvcmRlclsnc3RhdHVzJ10sXG4gICAgICAg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JzID0ge1xuICAgICAgICAgICAgICAgICdBUEktS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0FQSS1TaWduJzogdGhpcy5kZWNvZGUgKHNpZ25hdHVyZSksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgdXJsO1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoJ2Vycm9yJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgbGV0IG51bUVycm9ycyA9IHJlc3BvbnNlWydlcnJvciddLmxlbmd0aDtcbiAgICAgICAgICAgIGlmIChudW1FcnJvcnMpIHtcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHJlc3BvbnNlWydlcnJvciddLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnZXJyb3InXVtpXSA9PSAnRVNlcnZpY2U6VW5hdmFp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IHRydWUsIC8vIHNlZSB0aGUgbWV0aG9kIGltcGxlbWVudGF0aW9uIGJlbG93XG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzEnLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1JyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1JyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnNjAnLFxuICAgICAgICAgICAgICAgICc4aCc6ICc0ODAnLFxuICAgICAgICAgICAgICAgICcxZCc6ICdEJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnVycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMzc5NTY1NS1iM2M0NmU0OC1kY2Y2LTExZTctOGFiZS1kYzQ1ODhiYTc5MDEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmt1Y29pbi5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9rdWNvaW4uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8va3Vjb2luYXBpZG9jcy5kb2NzLmFwaWFyeS5pbycsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9uZXdzLmt1Y29pbi5jb20vZW4vZmVlJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9jaGFydC9jb25maWcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vY2hhcnQvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9jaGFydC9zeW1ib2wnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vY3VycmVuY2llcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9kZWFsLW9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9rbGluZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9sYW5nLWxpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL29yZGVycy1idXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vb3JkZXJzLXNlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vdGljaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW4vY29pbi1pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbi9jb2lucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW4vY29pbnMtdHJlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVuL3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tjb2lufS93YWxsZXQvYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC97Y29pbn0vd2FsbGV0L3JlY29yZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQve2NvaW59L2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvcHJvbW90aW9uL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvcHJvbW90aW9uL3N1bScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVhbC1vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2FjdGl2ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvYWN0aXZlLW1hcCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvZGVhbHQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlZmVycmVyL2Rlc2NlbmRhbnQvY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQve2NvaW59L3dpdGhkcmF3L2FwcGx5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tjb2lufS93aXRoZHJhdy9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbC1vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY2hhbmdlLWxhbmcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDEwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0tDUyc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0FTJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tOQyc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVE0nOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1ZDJzogMy4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVknOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCSEMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFNSJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXVEMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVOJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlBYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUSc6IDIwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVZYJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01PRCc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORUJMJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHQic6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQUcnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0ZEJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JETic6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVS0cnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNQVCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUFQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUWCc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVUxTJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dWVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIU1QnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFVSQSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVNQJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPV1InOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRkxJWFgnOiAxMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xFTkQnOiAyMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNQic6IDMuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSSE9DJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1InOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREVOVCc6IDUwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJHTic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBQ1QnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JzogMC4wMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRPcGVuU3ltYm9scyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ2NvaW5UeXBlJ107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ2NvaW5UeXBlUGFpciddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IG1hcmtldFsndHJhZGluZyddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0T3BlbkNvaW5zIChwYXJhbXMpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY3lbJ2NvaW4nXTtcbiAgICAgICAgICAgIC8vIHRvZG86IHdpbGwgbmVlZCB0byByZXRoaW5rIHRoZSBmZWVzXG4gICAgICAgICAgICAvLyB0byBhZGQgc3VwcG9ydCBmb3IgbXVsdGlwbGUgd2l0aGRyYXdhbC9kZXBvc2l0IG1ldGhvZHMgYW5kXG4gICAgICAgICAgICAvLyBkaWZmZXJlbnRpYXRlZCBmZWVzIGZvciBlYWNoIHBhcnRpY3VsYXIgbWV0aG9kXG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChpZCk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0gY3VycmVuY3lbJ3RyYWRlUHJlY2lzaW9uJ107XG4gICAgICAgICAgICBsZXQgZGVwb3NpdCA9IGN1cnJlbmN5WydlbmFibGVEZXBvc2l0J107XG4gICAgICAgICAgICBsZXQgd2l0aGRyYXcgPSBjdXJyZW5jeVsnZW5hYmxlV2l0aGRyYXcnXTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAoZGVwb3NpdCAmJiB3aXRoZHJhdyk7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5Wyd3aXRoZHJhd0ZlZVJhdGUnXSwgLy8gdG9kbzogcmVkZXNpZ25cbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5Wyd3aXRoZHJhd01pbkFtb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudEJhbGFuY2UgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbGltaXQnOiAyMCwgLy8gZGVmYXVsdCAxMiwgbWF4IDIwXG4gICAgICAgICAgICAncGFnZSc6IDEsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBpbmRleGVkID0gdGhpcy5pbmRleEJ5IChiYWxhbmNlcywgJ2NvaW5UeXBlJyk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleX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gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgc3ltYm9sID0gdGlja2VyWydjb2luVHlwZSddICsgJy8nICsgdGlja2VyWydjb2luVHlwZVBhaXInXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdoaWdoJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvdycpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdidXknKSxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnc2VsbCcpLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3REZWFsUHJpY2UnKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4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iAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVswXTtcbiAgICAgICAgbGV0IHNpZGUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0cmFkZVsxXSA9PSAnQlVZJykge1xuICAgICAgICAgICAgc2lkZSA9ICdidXknO1xuICAgICAgICB9IGVsc2UgaWYgKHRyYWRlWzFdID09ICdTRUxMJykge1xuICAgICAgICAgICAgc2lkZSA9ICdzZWxsJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWzJdLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWzNdLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2Ug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ICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgZW5kID0gdGhpcy5zZWNvbmRzICgpO1xuICAgICAgICBsZXQgcmVzb2x1dGlvbiA9IHRoaXMudGltZWZyYW1lc1t0aW1lZnJhbWVdO1xuICAgICAgICAvLyBjb252ZXJ0ICdyZXNvbHV0aW9uJyB0byBtaW51dGVzIGluIG9yZGVyIHRvIGNhbGN1bGF0ZSAnZnJvbScgbGF0ZXJcbiAgICAgICAgbGV0IG1pbnV0ZXMgPSByZXNvbHV0aW9uO1xuICAgICAgICBpZiAobWludXRlcyA9PSAnRCcpIHtcbiAgICAgICAgICAgIGlmICghbGltaXQpXG4gICAgICAgICAgICAgICAgbGltaXQgPSAzMDsgLy8gMzAgZGF5cywgMSBtb250aFxuICAgICAgICAgICAgbWludXRlcyA9IDE0NDA7XG4gICAgICAgIH0gZWxzZSBpZiAobWludXRlcyA9PSAnVycpIHtcbiAgICAgICAgICAgIGlmICghbGltaXQpXG4gICAgICAgICAgICAgICAgbGltaXQgPSA1MjsgLy8gNTIgd2Vla3MsIDEgeWVhclxuICAgICAgICAgICAgbWludXRlcyA9IDEwMDgwO1xuICAgICAgICB9IGVsc2UgaWYgKCFsaW1pdCkge1xuICAgICAgICAgICAgbGltaXQgPSAxNDQwO1xuICAgICAgICAgICAgbWludXRlcyA9IDE0NDA7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHN0YXJ0ID0gZW5kIC0gbWludXRlcyAqIDYwICogbGltaXQ7XG4gICAgICAgIGlmIChzaW5jZSkge1xuICAgICAgICAgICAgc3RhcnQgPSBwYXJzZUludCAoc2luY2UgLyAxMDAwKTtcbiAgICAgICAgICAgIGVuZCA9IHRoaXMuc3VtIChzdGFydCwgbWludXRlcyAqIDYwICogbGltaXQpO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1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0gJz8nICsgcXVlcnlTdHJpbmc7XG4gICAgICAgICAgICAgICAgaWYgKG1ldGhvZCAhPSAnR0VUJykge1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gcXVlcnlTdHJpbmc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IGF1dGggPSBlbmRwb2ludCArICcvJyArIG5vbmNlICsgJy8nICsgcXVlcnlTdHJpbmc7XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IHRoaXMuc3RyaW5nVG9CYXNlNjQgKHRoaXMuZW5jb2RlIChhdXRoKSk7XG4gICAgICAgICAgICAvLyBwYXlsb2FkIHNob3VsZCBiZSBcImVuY29kZWRcIiBhcyByZXR1cm5lZCBmcm9tIHN0cmluZ1RvQmFzZTY0XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjIChwYXlsb2FkLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMjU2Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdLQy1BUEktS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0tDLUFQSS1OT05DRSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdLQy1BUEktU0lHTkFUVVJFJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIHRocm93RXhjZXB0aW9uT25FcnJvciAocmVzcG9uc2UpIHtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCFyZXNwb25zZVsnc3VjY2VzcyddKSB7XG4gICAgICAgICAgICAgICAgaWYgKCdjb2RlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdtc2cnKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydjb2RlJ10gPT0gJ1VOQVVUSCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlID09ICdJbnZhbGlkIG5vbmNlJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE5vbmNlICh0aGlzLmlkICsgJyAnICsgbWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChyZXNwb25zZVsnY29kZSddID09ICdFUlJPUicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlLmluZGV4T2YgKCdwcmVjaXNpb24gb2YgYW1vdW50JykgPj0gMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgbWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGJvZHkgJiYgKGJvZHlbMF0gPT0gXCJ7XCIpKSB7XG4gICAgICAgICAgICBs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uXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIGt1bmEgZXh0ZW5kcyBhY3gge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2t1bmEnLFxuICAgICAgICAgICAgJ25hbWUnOiAnS3VuYScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1VBJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjInLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogZmFsc2UsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMxNjk3NjM4LTkxMjgyNGZhLWIzYzEtMTFlNy04YzM2LWNmOTYwNmViOTRhYy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9rdW5hLmlvJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8va3VuYS5pbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2t1bmEuaW8vZG9jdW1lbnRzL2FwaScsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9rdW5hLmlvL2RvY3VtZW50cy9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97bWFya2V0fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGltZXN0YW1wJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21lbWJlcnMvbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL215JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9kZWxldGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9VQUgnOiB7ICdpZCc6ICdidGN1YWgnLCAnc3ltYm9sJzogJ0JUQy9VQUgnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVUFIJywgJ3ByZWNpc2lvbic6IHsgJ2Ftb3VudCc6IDYsICdwcmljZSc6IDAgfSwgJ2xvdCc6IDAuMDAwMDAxLCAnbGltaXRzJzogeyAnYW1vdW50JzogeyAnbWluJzogMC4wMDAwMDEsICdtYXgnOiB1bmRlZmluZWQgfSwgJ3ByaWNlJzogeyAnbWluJzogMSwgJ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HJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdVQUgnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0FWRVMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dPTCc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQkcnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnUk1DJzogMC4wMDEgQlRDXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnQVJOJzogMC4wMSBFVEhcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdSJzogMC4wMSBFVEhcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdFVlInOiAwLjAxIEVUSFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdVQUgnOiAoYW1vdW50KSA9PiBhbW91bnQgKiAwLjAwMSArIDVcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09IDQwMCkge1xuICAgICAgICAgICAgbGV0IGRhdGEgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGxldCBlcnJvciA9IGRhdGFbJ2Vycm9yJ107XG4gICAgICAgICAgICBsZXQgZXJyb3JDb2RlID0gZXJyb3JbJ2NvZGUnXTtcbiAgICAgICAgICAgIGl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0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJpY2UnOiBwYXJzZUZsb2F0ICh0cmFkZVsncHJpY2UnXSksXG4gICAgICAgICAgICAnYW1vdW50JzogcGFyc2VGbG9hdCAodHJhZGVbJ3ZvbHVtZSddKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIHBhcnNlTXlUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydjcmVhdGVkX2F0J10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgIC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ICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4MDc0MTIwLTcyYjdjMzhhLTY2NjAtMTFlNy05MmQ5LWQ5MDI3NTAyMjgxZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkubGFrZWJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cubGFrZWJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5sYWtlYnRjLmNvbS9zL2FwaV92MicsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5sYWtlYnRjLmNvbS9zL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmNvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JjdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEFjY291bnRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRFeHRlcm5hbEFjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjE1IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDwga2V5cy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1trXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgYmFzZSA9IGJhc2UudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBxdW90ZSA9IHF1b3RlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEFjY291bnRJbmZvICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnYmFsYW5jZSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzKTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBwYXJzZUZsb2F0IChiYWxhbmNlc1tjdXJyZW5jeV0pO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2UsXG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LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy52ZXJzaW9uO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICB1cmwgKz0gJy8nICsgcGF0aDtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICBwYXJhbXMgPSBwYXJhbXMuam9pbiAoJywnKTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBwYXJhbXMgPSAnJztcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMudXJsZW5jb2RlICh7XG4gICAgICAgICAgICAgICAgJ3RvbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ2FjY2Vzc2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdyZXF1ZXN0bWV0aG9kJzogbWV0aG9kLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgICAgICdpZCc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdwYXJhbXMnOiBwYXJhbXMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAncGFyYW1zJzogcGFyYW1zLFxuICAgICAgICAgICAgICAgICdpZCc6IG5vbmNlLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMScpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLmVuY29kZSAodGhpcy5hcGlLZXkgKyAnOicgKyBzaWduYXR1cmUpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnSnNvbi1ScGMtVG9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnQXV0aG9yaXphdGlvbic6IFwiQmFzaWMgXCIgKyB0aGlzLmRlY29kZSAodGhpcy5zdHJpbmdUb0Jhc2U2NCAoYXV0aCkpLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgK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AgICAgICAgICAgICdoYXNGZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAvLyBuZXcgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk4MjAyMi03NWFlYTgyOC02M2EwLTExZTctOTUxMS1jYTU4NGE4ZWRkNzQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmxpcXVpLmlvL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmxpcXVpLmlvL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2xpcXVpLmlvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vbGlxdWkuaW8vYXBpJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL2xpcXVpLmlvL2ZlZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFuc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NvaW5EZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdDb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDcmVhdGVDb3Vwb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZGVlbUNvdXBvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzogMC4wLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY2FsY3VsYXRlRmVlIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UsIHRha2VyT3JNYWtlciA9ICd0YWtlcicsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNbc3ltYm9sXTtcbiAgICAgICAgbGV0IGtleSA9ICdxdW90ZSc7XG4gICAgICAgIGxldCByYXRlID0gbWFya2V0W3Rha2VyT3JNYWtlcl07XG4gICAgICAgIGxldCBjb3N0ID0gcGFyc2VGbG9hdCAodGhpcy5jb3N0VG9QcmVjaXNpb24gKHN5bWJvbCwgYW1vdW50ICogcmF0ZSkpO1xuICAgICAgICBpZiAoc2lkZSA9PSAnc2VsbCcpIHtcbiAgICAgICAgICAgIGNvc3QgKj0gcHJpY2U7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBrZXkgPSAnYmFzZSc7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICd0eXBlJzogdGFrZXJPck1ha2VyLFxuICAg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SB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0SW5mbyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsncGFpcnMnXTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBrZXlzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW3BdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaWRdO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHRoaXMuZ2V0QmFzZVF1b3RlRnJvbU1hcmtldElkIChpZCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogdGhpcy5zYWZlSW50ZWdlciAobWFya2V0LCAnZGVjaW1hbF9wbGFjZXMnKSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnNhZmVJbnRlZ2VyIChtYXJrZXQsICdkZWNpbWFsX3BsYWNlcycpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhbW91bnRMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5fYW1vdW50JyksXG4gICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYXhfYW1vdW50JyksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByaWNlTGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluX3ByaWNlJyksXG4gICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYXhfcHJpY2UnKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgY29zdExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbl90b3RhbCcpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudExpbWl0cyxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZUxpbWl0cyxcbiAgICAgICAgICAgICAgICAnY29zdCc6IGNvc3RMaW1pdHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChtYXJrZXRbJ2hpZGRlbiddID09IDApO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogbWFya2V0WydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAnbG90JzogYW1vdW50TGltaXRzWydtaW4nXSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJu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FsnYmlkcyddLCAwLCB0cnVlKTtcbiAgICAgICAgcmVzdWx0Wydhc2tzJ10gPSB0aGlzLnNvcnRCeSAocmVzdWx0Wydhc2tzJ10sIDApO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd1cGRhdGVkJ10gKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0JyksXG4gICAgICAgICAgICA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Wx1ZSAodHJhZGUsICdpc195b3VyX29yZGVyJyk7XG4gICAgICAgIC8vIGxldCB0YWtlck9yTWFrZXIgPSAndGFrZXInO1xuICAgICAgICAvLyBpZiAoaXNZb3VyT3JkZXIpXG4gICAgICAgIC8vICAgICB0YWtlck9yTWFrZXIgPSAnbWFrZXInO1xuICAgICAgICAvLyBsZXQgZmVlID0gdGhpcy5jYWxjdWxhdGVGZWUgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSwgdGFrZXJPck1ha2VyKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXIsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICB9O1xuICAgICAgICBpZiAobGlt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yaW5nIChyZXNwb25zZVsncmV0dXJuJ10sIHRoaXMuZ2V0T3JkZXJJZEtleSAoKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgcHJpY2UgPSBwYXJzZUZsb2F0IChwcmljZSk7XG4gICAgICAgIGFtb3VudCA9IHBhcnNlRmxvYXQgKGFtb3VudCk7XG4gICAgICAgIGxldCBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgIGlmIChpZCA9PSAnMCcpIHtcbiAgICAgICAgICAgIGlkID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZVsncmV0dXJuJ10sICdpbml0X29yZGVyX2lkJyk7XG4gICAgICAgICAgICBzdGF0dXMgPSAnY2xvc2VkJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgZmlsbGVkID0gdGhpcy5zYWZlRmxvYXQgKHJlc3BvbnNlWydyZXR1cm4nXSwgJ3JlY2VpdmVkJywgMC4wKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChyZXNwb25zZVsncmV0dXJuJ10sICdyZW1haW5zJywgYW1vdW50KTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBmaWxsZWQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuIC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MubGFzdF9qc29uX3Jlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSB0aGlzLnNhZmVTdHJpbmcgKHRoaXMubGFzdF9qc29uX3Jlc3BvbnNlLCAnZXJyb3InKTtcbiAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAobWVzc2FnZS5pbmRleE9mICgnbm90IGZvdW5kJykgPj0gMClcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyBjYW5jZWxPcmRlcigpIGVycm9yOiAnICsgdGhpcy5sYXN0X2h0dHBfcmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IGU7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IGlkID0gb3JkZXJbJ2lkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgIGxldCBzdGF0dXMgPSBvcmRlclsnc3RhdHVzJ107XG4gICAgICAgIGlmIChzdGF0dXMgPT0gMCkge1xuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICB9IGVsc2UgaWYgKHN0YXR1cyA9PSAxKSB7XG4gICAgICAgICAgICBzdGF0dXMgPSAnY2xvc2VkJztcbiAgICAgICAgfSBlbHNlIGlmICgoc3RhdHVzID09IDIpIHx8IChzdGF0dXMgPT0gMykpIHtcbiAgICAgICAgICAgIHN0YXR1cyA9ICdjYW5jZWxlZCc7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChvcmRlclsndGltZXN0YW1wX2NyZWF0ZWQnXSkgKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtvcmRlclsncGFpciddXTtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBhbW91bnQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3JhdGUnKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnc3RhcnRfYW1vdW50JyBpbiBvcmRlcikge1xuICAgICAgICAgICAgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnc3RhcnRfYW1vdW50Jyk7XG4gICAgICAgICAgICByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdhbW91bnQnKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2Ftb3VudCcpO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMub3JkZXJzKVxuICAgICAgICAgICAgICAgIGFtb3VudCA9IHRoaXMub3JkZXJzW2lkXVsnYW1vdW50J107XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogZmlsbGVkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlcnMgKG9yZGVycywgbWFya2V0ID0gdW5kZWZpbmVkLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChvcmRlcnMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSBvcmRlcnNbaWRdO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V0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBrID0gMDsgayA8IGNhY2hlZE9yZGVySWRzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBjYWNoZWRPcmRlcklkc1trXTtcbiAgICAgICAgICAgIGlmIChpZCBpbiBvcGVuT3JkZXJzSW5kZXhlZEJ5SWQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSB0aGlzLmV4dGVuZCAodGhpcy5vcmRlcnNbaWRdLCBvcGVuT3JkZXJzSW5kZXhlZEJ5SWRbaWRdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRlcnNbaWRdO1xuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3RhdHVzJ10gPT0gJ29wZW4nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiBvcmRlclsnYW1vdW50J10gKiBvcmRlclsncHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWxsZWQnOiBvcmRlclsnYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVtYWluaW5nJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSB0aGlzLm9yZGVyc1tpZF07XG4gICAgICAgICAgICBpZiAoc3ltYm9sKSB7XG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydzeW1ib2wnXSA9PSBzeW1ib2wpXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoIChvcmRlcik7XG4g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G4gICAgICAgICAgICAnYW1vdW50JzogcGFyc2VGbG9hdCAoYW1vdW50KSxcbiAgICAgICAgICAgICdhZGRyZXNzJzogYWRkcmVzcyxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ3JldHVybiddWyd0SWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduQm9keVdpdGhTZWNyZXQgKGJvZHkpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGJvZHkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyk7XG4gICAgfVxuXG4gICAgZ2V0VmVyc2lvblN0cmluZyAoKSB7XG4gICAgICAgIHJldHVybiAnLycgKyB0aGlzLnZlcnNpb247XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuc2lnbkJvZHlXaXRoU2VjcmV0IChib2R5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHNpZ25hdHVyZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB1cmwgKz0gdGhpcy5nZXRWZXJzaW9uU3RyaW5nICgpICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgnc3VjY2VzcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmICghcmVzcG9uc2VbJ3N1Y2Nlc3MnXSkge1xuICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnZXJyb3InXS5pbmRleE9mICgnTm90IGVub3VndGgnKSA+PSAwKSB7IC8vIG5vdCBlbm91Z1RoIGlzIGEgdHlwbyBpbnNpZGUgTGlxdWkncyBvd24gQVBJLi4uXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJlc3BvbnNlWydlcnJvciddID09ICdSZXF1ZXN0cyB0b28gb2Z0ZW4nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBERG9TUHJvdGVjdGlvbiAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChyZXNwb25zZVsnZXJyb3InXSA9PSAnbm90IGF2YWlsYWJsZScpIHx8IChyZXNwb25zZVsnZXJyb3InXSA9PSAnZXh0ZXJuYWwgc2VydmljZSB1bmF2YWlsYWJsZScpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBERG9TUHJvdGVjdGlvbiAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cbn1cbiIsIlwidXNlIHN0cmljdFwiO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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hcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3OTgwNzY4LWYyMmZjNDI0LTYzOGEtMTFlNy04OWM5LTYwMTBhNTRmZjliZS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkubGl2ZWNvaW4ubmV0JyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmxpdmVjb2luLm5ldCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5saXZlY29pbi5uZXQvYXBpP2xhbmc9ZW4nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9hbGwvb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvbGFzdF90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL21heGJpZF9taW5hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3Jlc3RyaWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvdGlja2VyJywgLy8gb21pdCBwYXJhbXMgdG8gZ2V0IGFsbCB0aWNrZXJzIGF0IG9uY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL2NvaW5JbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2NsaWVudF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2NvbW1pc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2NvbW1pc3Npb25Db21tb25JbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvZ2V0L2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvaGlzdG9yeS9zaXplJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2hpc3RvcnkvdHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYnV5bGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2J1eW1hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvY2FuY2VsbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3NlbGxsaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvc2VsbG1hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvY2FwaXRhbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvY2FyZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvY29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvb2twYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L3BheWVlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvcGVyZmVjdG1vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L3ZvdWNoZXIvYW1vdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L3ZvdWNoZXIvbWFrZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC92b3VjaGVyL3JlZGVlbScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMTggLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMTggLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRFeGNoYW5nZVRpY2tlciAoKTtcbiAgICAgICAgbGV0IHJlc3RyaWN0aW9ucyA9IGF3YWl0IHRoaXMucHVibGljR2V0RXhjaGFuZ2VSZXN0cmljdGlvbnMgKCk7XG4gICAgICAgIGxldCByZXN0cmljdGlvbnNCeUlkID0gdGhpcy5pbmRleEJ5IChyZXN0cmljdGlvbnNbJ3Jlc3RyaWN0aW9ucyddLCAnY3VycmVuY3lQYWlyJyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgbGV0IGNvaW5SZXN0cmljdGlvbnMgPSB0aGlzLnNhZmVWYWx1ZSAocmVzdHJpY3Rpb25zQnlJZCwgc3ltYm9sKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogNSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAnY29zdCc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKGNvaW5SZXN0cmljdGlvbnMpIHtcbiAgICAgICAgICAgICAgICBwcmVjaXNpb25bJ3ByaWNlJ10gPSB0aGlzLnNhZmVJbnRlZ2VyIChjb2luUmVzdHJpY3Rpb25zLCAncHJpY2VTY2FsZScsIDUpO1xuICAgICAgICAgICAgICAgIGxpbWl0c1snYW1vdW50J11bJ21pbiddID0gdGhpcy5zYWZlRmxvYXQgKGNvaW5SZXN0cmljdGlvbnMsICdtaW5MaW1pdFF1YW50aXR5JywgbGltaXRzWydhbW91bnQnXVsnbWluJ10pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGltaXRzWydwcmljZSddID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFze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ICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ25hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmZWUnOiBjdXJyZW5jeVsnd2l0aGRyYXdGZWUnXSwgLy8gdG9kbzogcmVkZXNpZ25cbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ21pbk9yZGVyQW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydtaW5PcmRlckFtb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydtaW5XaXRoZHJhd0Ftb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ21pbkRlcG9zaXRBbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmVzdWx0ID0gdGhpcy5hcHBlbmRGaWF0Q3VycmVuY2llcyAocmVzdWx0KTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhcHBlbmRGaWF0Q3VycmVuY2llcyAocmVzdWx0ID0gW10pIHtcbiAgICAgICAgbGV0IHByZWNpc2lvbiA9IDg7XG4gICAgICAgIGxldCBkZWZhdWx0cyA9IHtcbiAgICAgICAgICAgICdpbmZvJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7ICdtaW4nOiB1bmRlZmluZWQsICdtYXgnOiB1bmRlZmluZWQgfSxcbiAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHsgJ21pbic6IHVuZGVmaW5lZCwgJ21heCc6IHVuZGVmaW5lZCB9LFxuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7ICdtaW4nOiB1bmRlZmluZWQsICdtYXgnOiB1bmRlZmluZWQgfSxcbiAgICAgICAgICAgICAgICAnY29zdCc6IHsgJ21pbic6IHVuZGVmaW5lZCwgJ21heCc6IHVuZGVmaW5lZCB9LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gW1xuICAgICAgICAgICAgeyAnaWQnOiAnVVNEJywgJ2NvZGUnOiAnVVNEJywgJ25hbWUnOiAnVVMgRG9sbGFyJyB9LFxuICAgICAgICAgICAgeyAnaWQnOiAnRVVSJywgJ2NvZGUnOiAnRVVSJywgJ25hbWUnOiAnRXVybycgfSxcbiAgICAgICAgICAgIHsgJ2lkJzogJ1JVUicsICdjb2RlJzogJ1JVUicsICduYW1lJzogJ1J1c3NpYW4gcnVibGUnIH0sXG4gICAgICAgIF07XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gY3VycmVuY3lbJ2NvZGUnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHRoaXMuZXh0ZW5kIChkZWZhdWx0cywgY3VycmVuY3kpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRQYXltZW50QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJz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ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0RXhjaGFuZ2VUaWNrZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3lQYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndGltZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsndHlwZSddLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ3F1YW50aXR5J10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc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lJywgMC4wKTtcbiAgICAgICAgbGV0IGNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdjb21taXNzaW9uQnlUcmFkZScsIDAuMCk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdyZW1haW5pbmdRdWFudGl0eScsIDAuMCk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdxdWFudGl0eScsIHJlbWFpbmluZyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgICAgICAnZmVlJzoge1xuICAgICAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBxdW90ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmM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cnJlbmN5LFxuICAgICAgICB9O1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRQYXltZW50R2V0QWRkcmVzcyAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgYWRkcmVzcyA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICd3YWxsZXQnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyBwYXRoO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5rZXlzb3J0IChwYXJhbXMpKTtcbiAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyBxdWVyeTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09ICdQT1NUJylcbiAgICAgICAgICAgICAgICBib2R5ID0gcXVlcnk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMjU2Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBcGktS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoY29kZSA+PSAzMDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdID09IFwie1wiKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgaWYgKCdlcnJvckNvZGUnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBlcnJvciA9IHJlc3BvbnNlWydlcnJvckNvZGUnXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycm9yID09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgnZXJyb3JNZXNzYWdlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnZXJyb3JNZXNzYWdlJ10gPT0gJ1VzZXIgbm90IGZvdW5kJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEF1dGhlbnRpY2F0aW9uRXJyb3IgKHRoaXMuaWQgKyAnICcgKyByZXNwb25zZVsnZXJyb3JNZXNzYWdlJ10pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoZXJyb3IgPT0gMTApIHx8IChlcnJvciA9PSAxMSkgfHwgKGVycm9yID09IDEyKSB8fCAoZXJyb3IgPT0gMjApIHx8IChlcnJvciA9PSAzMCkgfHwgKGVycm9yID09IDEwMSkgfHwgKGVycm9yID09IDEwMikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IDMxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgTm90U3VwcG9ydGVkICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IDMyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSAxMDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJzogSW52YWxpZCBwYXJhbWV0ZXJzICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gMTAzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJzogSW52YWxpZCBjdXJyZW5jeSAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IDEwNCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICc6IEludmFsaWQgYW1vdW50ICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gMTA1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJzogVW5hYmxlIHRvIGJsb2NrIGZ1bmRzICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gNTAzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VOb3RBdmFpbGFibGUgKHRoaXMuaWQgKyAnOiBFeGNoYW5nZSBpcyBub3QgYXZhaWxhYmxlICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgIC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NvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lmx1bm8uY29tL2VuL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL25wbWpzLm9yZy9wYWNrYWdlL2JpdHgnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL2JhdXNtZWllci9ub2RlLWJpdHgnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMve2lkfS9wZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmdfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdHRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3Rlcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3N0b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdG9wb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmdfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2F1dGgyL2dyYW50JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VycyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHNbJ3RpY2tlcnMnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ3RpY2tlcnMnXVtwXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsncGFpciddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2JhbGFuY2UnXTtcbiAgICAgIC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mVuY3knOiB1bmRlZmluZWQgfTtcbiAgICAgICAgaWYgKHF1b3RlRmVlKSB7XG4gICAgICAgICAgICBmZWVbJ3NpZGUnXSA9ICdxdW90ZSc7XG4gICAgICAgICAgICBmZWVbJ2Nvc3QnXSA9IHF1b3RlRmVlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZmVlWydzaWRlJ10gPSAnYmFzZSc7XG4gICAgICAgICAgICBmZWVbJ2Nvc3QnXSA9IGJhc2VGZWU7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydvcmRlcl9pZCddLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0cmFkZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRPcmRlcnNJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlciAocmVzcG9uc2UpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd0aW1lc3RhbXAnXTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xvdyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiaWQnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2JpZCddKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2FzayddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdF90cmFkZSddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAg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GludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRyYWRlcyc6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM0NDg3NjIwLTMxMzlhN2IwLWVmZTYtMTFlNy05MGY1LWU1MjBjZWY3NDQ1MS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdtb2JpbGUnOiAnaHR0cHM6Ly9hcGkubHlra2V4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vaGZ0LWFwaS5seWtrZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9oZnQtYXBpLmx5a2tlLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAndGVzdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb2JpbGUnOiAnaHR0cHM6Ly9hcGkubHlra2V4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2hmdC1zZXJ2aWNlLWRldi5seWtrZXgubmV0L2FwaScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2hmdC1zZXJ2aWNlLWRldi5seWtrZXgubmV0L2FwaScsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lmx5a2tlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vaGZ0LWFwaS5seWtrZS5jb20vc3dhZ2dlci91aS8nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubHlra2UuY29tL2x5a2tlX2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5seWtrZS5jb20vdHJhZGluZy1jb25kaXRpb25zJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdtb2JpbGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWxsQXNzZXRQYWlyUmF0ZXMve21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0Fzc2V0UGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0Fzc2V0UGFpcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSXNBbGl2ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJCb29rcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJCb29rcy97QXNzZXRQYWlySWR9J1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVycy9saW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJzL21hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJzL3tpZH0vQ2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDEwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMTksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO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bXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnSWQnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydCYXNlQXNzZXRJZCddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydRdW90aW5nQXNzZXRJZCddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ05hbWUnXTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnQWNjdXJhY3knXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ0ludmVydGVkQWNjdXJhY3knXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB0aWNrZXIgPSB0aWNrZXJbJ1Jlc3VsdCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRp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bXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyU3RhdHVzIChzdGF0dXMpIHtcbiAgICAgICAgaWYgKHN0YXR1cyA9PSAnUGVuZGluZycpIHtcbiAgICAgICAgICAgIHJldHVybiAnb3Blbic7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09ICdJbk9yZGVyQm9vaycpIHtcbiAgICAgICAgICAgIHJldHVybiAnb3Blbic7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09ICdQcm9jZXNzaW5nJykge1xuICAgICAgICAgICAgcmV0dXJuICdvcGVuJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT0gJ01hdGNoZWQnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ2Nsb3NlZCc7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09ICdDYW5jZWxsZWQnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ2NhbmNlbGVkJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT0gJ05vdEVub3VnaEZ1bmRzJykge1xuICAgICAgICAgICAgcmV0dXJuICdOb3RFbm91Z2hGdW5kcyc7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09ICdOb0xpcXVpZGl0eScpIHtcbiAgICAgICAgICAgIHJldHVybiAnTm9MaXF1aWRpdHknO1xuICAgICAgICB9IGVsc2UgaWYgKHN0YXR1cyA9PSAnVW5rbm93bkFzc2V0Jykge1xuICAgICAgICAgICAgcmV0dXJuICdVbmtub3duQXNzZXQnO1xuICAgICAgICB9IGVsc2UgaWYgKHN0YXR1cyA9PSAnTGVhZFRvTmVnYXRpdmVTcHJlYWQnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ0xlYWRUb05lZ2F0aXZlU3ByZWFkJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc3R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ZGVyLCAnUHJpY2UnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ1ZvbHVtZScpO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnUmVtYWluaW5nVm9sdW1lJyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgIGxldCBjb3N0ID0gZmlsbGVkICogcHJpY2U7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ0lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbG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25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldE9yZGVycyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzdGF0dXMnOiAnTWF0Y2hlZCcsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVycyAocmVzcG9uc2UsIHVuZGVmaW5lZCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE9yZGVyQm9va3NBc3NldFBhaXJJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdBc3NldFBhaXJJZCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0ge1xuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiaWRzJzogW10sXG4gICAgICAgICAgICAnYXNrcyc6IFtdLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdW5kZWZpbmVkO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHJlc3BvbnNlLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgc2lkZSA9IHJlc3BvbnNlW2ldO1xuICAgICAgICAgICAgaWYgKHNpZGVbJ0lzQnV5J10pIHtcbiAgICAgICAgICAgICAgICBvcmRlcmJvb2tbJ2JpZHMnXSA9IHRoaXMuYXJyYXlDb25jYXQgKG9yZGVyYm9va1snYmlkcyddLCBzaWRlWydQcmljZXMnXSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG9yZGVyYm9va1snYXNrcyddID0gdGhpcy5hcnJheUNvbmNhdCAob3JkZXJib29rWydhc2tzJ10sIHNpZGVbJ1ByaWNlcyddKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAoc2lkZVsnVGltZXN0YW1wJ10pO1xuICAgICAgICAgICAgaWYgKCFvcmRlcmJvb2tbJ3RpbWVzdGFtcCddKSB7XG4gICAgICAgICAgICAgICAgb3JkZXJib29rWyd0aW1lc3RhbXAnXSA9IHRpbWVzdGFtcDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgb3JkZXJib29rWyd0aW1lc3RhbXAnXSA9IE1hdGgubWF4IChvcmRlcmJvb2tbJ3RpbWVzdGFtcCddLCB0aW1lc3RhbXApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICghdGltZXN0YW1wKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIG9yZGVyYm9va1sndGltZXN0YW1wJ10sICdiaWRzJywgJ2Fza3MnLCAnUHJpY2UnLCAnVm9sdW1lJyk7XG4gICAgfVxuXG4gICAgcGFyc2VCaWRBc2sgKGJpZGFzaywgcHJpY2VLZXkgPSAwLCBhbW91bnRLZXkgPSAxKSB7XG4gICAgICAgIGxldCBwcmljZSA9IHBhcnNlRmxvYXQgKGJpZGFza1twcmljZUtleV0pO1xuICAgICAgICBsZXQgYW1vdW50ID0gcGFyc2VGbG9hdCAoYmlkYXNrW2Ftb3VudEtleV0pO1xuICAgICAgICBpZiAoYW1vdW50IDwgMClcbiAgICAgICAgICAgIGFtb3VudCA9IC1hbW91bnQ7XG4gICAgICAgIHJldHVybiBbIHByaWNlLCBhbW91bnQgXTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2UgaWYgKGFwaSA9PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT0gJ0dFVCcpXG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnYXBpLWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdBY2NlcHQnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAobWV0aG9kID09ICdQT1NUJylcbiAgICAgICAgICAgICAgICBpZiAoT2J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F3JzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc4MzcwNjAtZTdjNTg3MTQtNjBlYS0xMWU3LTkxOTItZjA1ZTg2YWRiODNmLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cubWVyY2Fkb2JpdGNvaW4ubmV0L3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5jb20uYnInLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5jb20uYnIvYXBpLWRvYycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5jb20uYnIvdHJhZGUtYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y29pbn0vb3JkZXJib29rLycsIC8vIGxhc3Qgc2xhc2ggY3JpdGljYWxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y29pbn0vdGlja2VyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L3RyYWRlcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjb2lufS90cmFkZXMve2Zyb219LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L3RyYWRlcy97ZnJvbX0ve3RvfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L2RheS1zdW1tYXJ5L3t5ZWFyfS97bW9udGh9L3tkYXl9LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfYWNjb3VudF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X3N5c3RlbV9tZXNzYWdlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3Rfb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZV9idXlfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlX3NlbGxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2NvaW4nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9CUkwnOiB7ICdpZCc6ICdCUkxCVEMnLCAnc3ltYm9sJzogJ0JUQy9CUkwnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQlJMJywgJ3N1ZmZpeCc6ICdCaXRjb2luJyB9LFxuICAgICAg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SA9IGF3YWl0IHRoaXMucHVibGljR2V0Q29pblRpY2tlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjb2luJzogbWFya2V0WydiYXNlJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3RpY2tlciddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRpY2tlclsnZGF0ZSddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYnV5J10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnc2VsbCddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB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9KSB7XG4gICAgICAgIGlmICghc3ltYm9sKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGNhbmNlbE9yZGVyKCkgcmVxdWlyZXMgYSBzeW1ib2wgYXJndW1lbnQnKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2NvaW5fcGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdvcmRlcl9pZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ29yZGVyX3R5cGUnIGluIG9yZGVyKVxuICAgICAgICAgICAgc2lkZSA9IChvcmRlclsnb3JkZXJfdHlwZSddID09IDEpID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIGxldCBzdGF0dXMgPSBvcmRlclsnc3RhdHVzJ107XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICghbWFya2V0KSB7XG4gICAgICAgICAgICBpZiAoJ2NvaW5fcGFpcicgaW4gb3JkZXIpXG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydjb2luX3BhaXInXSBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtvcmRlclsnY29pbl9wYWlyJ11dO1xuICAgICAgICB9XG4gICAgICAgIGlmIChtYXJrZXQpXG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7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyX2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiBhdmVyYWdlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgaWYgKCFzeW1ib2wpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgY2FuY2VsT3JkZXIoKSByZXF1aXJlcyBhIHN5bWJvbCBhcmd1bWVudCcpO1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9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ICAgICAgJ3d3dyc6ICdodHRwczovL21peGNvaW5zLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL21peGNvaW5zLmNvbS9oZWxwL2FwaS8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ2J0Y191c2QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJywgJ21ha2VyJzogMC4wMDE1LCAndGFrZXInOiAwLjAwMjUgfSxcbiAgICAgICAgICAgICAgICAnRVRIL0JUQyc6IHsgJ2lkJzogJ2V0aF9idGMnLCAnc3ltYm9sJzogJ0VUS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hc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2wnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGUnXSkgKiAxMDAwO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IH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zZVsncmVzdWx0J11bJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLnByaXZhdGVQb3N0Q2FuY2VsICh7ICdpZCc6IGlkIH0pO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tleSc6IHRoaXMuYXBpS2V5LFxuICAgIC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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3Mgbm92YSBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdub3ZhJyxcbiAgICAgICAgICAgICduYW1lJzogJ05vdmFleGNoYW5nZScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1RaJywgLy8gVGFuemFuaWFcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAyMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjInLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzA1MTg1NzEtNzhjYTBiY2EtOWI4YS0xMWU3LTg4NDAtNjRiODNhNGE5NGIyLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL25vdmFleGNoYW5nZS5jb20vcmVtb3RlJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vbm92YWV4Y2hhbmdlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL25vdmFleGNoYW5nZS5jb20vcmVtb3RlL2ZhcScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3tiYXNlY3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2luZm8ve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29yZGVyaGlzdG9yeS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbm9yZGVycy97cGFpcn0vYnV5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW5vcmRlcnMve3BhaXJ9L3NlbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbm9yZGVycy97cGFpcn0vYm90aC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVub3JkZXJzL3twYWlyfS97b3JkZXJ0eXBlfS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbGFuY2VzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YmFsYW5jZS97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdHMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR3aXRoZHJhd2Fscy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG5ld2RlcG9zaXRhZGRyZXNzL3tjdXJyZW5jeX0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRkZXBvc2l0YWRkcmVzcy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXlvcGVub3JkZXJzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXlvcGVub3JkZXJzX21hcmtldC97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxvcmRlci97b3JkZXJpZH0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVoaXN0b3J5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdGhpc3RvcnkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR3aXRoZHJhd2FsaGlzdG9yeS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHN0YXR1cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHN0YXR1cy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnbWFya2V0cyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBpZiAoIW1hcmtldFsnZGlzYWJsZWQnXSkge1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnbWFya2V0bmFtZSddO1xuICAgICAgICAgICAgICAgIGxldCBbIHF1b3RlLCBiYXNlIF0gPSBpZC5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldE9wZW5vcmRlcnNQYWlyQm90aCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHVuZGVmaW5lZCwgJ2J1eW9yZGVycycsICdzZWxsb3JkZXJzJywgJ3ByaWNlJywgJ2Ftb3VudCcpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0SW5mb1BhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBh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AodGlja2VyWyd2b2x1bWUyNGgnXSksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndW5peF90X2RhdGVzdGFtcCddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3RyYWRldHlwZSddLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3ByaWNlJzogcGFyc2VGbG9hdCAodHJhZGVbJ3ByaWNlJ10pLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHBhcnNlRmxvYXQgKHRyYWRlWydhbW91bnQnXSksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0T3JkZXJoaXN0b3J5UGFpci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lWydhbW91bnRfdG90YWwnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICh0eXBlID09ICdtYXJrZXQnKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGFsbG93cyBsaW1pdCBvcmRlcnMgb25seScpO1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBhbW91bnQgPSBhbW91bnQudG9TdHJpbmcgKCk7XG4gICAgICAgIHByaWNlID0gcHJpY2UudG9TdHJpbmcgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ3RyYWRldHlwZSc6IHNpZGUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAndHJhZGVhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAndHJhZGVwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ3RyYWRlYmFzZSc6IDEsXG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlUGFpciAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgIC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G4gICAgICAgICAgICAgICAgJzFtJzogJzFtaW4nLFxuICAgICAgICAgICAgICAgICczbSc6ICczbWluJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW1pbicsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNW1pbicsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG1pbicsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFob3VyJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMmhvdXInLFxuICAgICAgICAgICAgICAgICc0aCc6ICc0aG91cicsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZob3VyJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzEyaG91cicsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFkYXknLFxuICAgICAgICAgICAgICAgICczZCc6ICczZGF5JyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMXdlZWsnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMvcHJvZHVjdHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2VfcmF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfZXN0aW1hdGVkX3ByaWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfaG9sZF9hbW91bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9pbmRleCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2tsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfcHJpY2VfbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2tsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvdGNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudF9yZWNvcmRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYXRjaF90cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9ycm93X21vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib3Jyb3dfb3JkZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9ycm93c19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfYm9ycm93JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vdGNfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF93aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2JhdGNoX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfZGV2b2x2ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2V4cGxvc2l2ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9vcmRlcnNfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfcG9zaXRpb25fNGZpeCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdHJhZGVzX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV91c2VyaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3VzZXJpbmZvXzRmaXgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRfZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2ZlZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ290Y19vcmRlcl9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvdGNfb3JkZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVwYXltZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdWJtaXRfb3RjX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfb3RjX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndW5yZXBheW1lbnRzX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY3OTEtODlmZmI1MDItNWVlNS0xMWU3LThhNWItYzU5NTBiNjhhYzY1LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL3d3dy5va2NvaW4uY29tL3YyJyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3d3dy5va2NvaW4uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3Lm9rY29pbi5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cub2tjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm9rY29pbi5jb20vcmVzdF9nZXRTdGFydGVkLmh0bWwnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubnBtanMuY29tL3BhY2thZ2Uvb2tjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAyLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLndlYkdldE1hcmtldHNQcm9kdWN0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0c1tpXVsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gaWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gdXBwZXJjYXNlLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldHNbaV1bJ21heFNpemVEaWdpdCddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldHNbaV1bJ21heFByaWNlRGlnaXQnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXRzW2ldLFxuICAgICAgICAgICAgICAgICd0eXBlJzogJ3Nwb3QnLFxuICAgICAgICAgICAgICAgICdzcG90JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZnV0dXJlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0c1tpXVsnbWluVHJhZGVTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAobWFya2V0KTtcbiAgICAgICAgICAgIGlmICgodGhpcy5oYXNGdXR1cmVNYXJrZXRzKSAmJiAobWFya2V0WydxdW90ZSddID09ICdVU0RUJykpIHtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKG1hcmtldCwge1xuICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiAnVVNEJyxcbiAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnYmFzZSddICsgJy9VU0QnLFxuICAgICAgICAgICAgICAgICAgICAnaWQnOiBtYXJrZXRbJ2lkJ10ucmVwbGFjZSAoJ3VzZHQnLCAndXNkJyksXG4gICAgICAgICAgICAgICAgICAgICd0eXBlJzogJ2Z1dHVyZScsXG4gICAgICAgICAgICAgICAgICAgICdzcG90JzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdmdXR1cmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9ICdwdWJsaWNHZXQnO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH07XG4gICAgICAgIGlmIChtYXJrZXRbJ2Z1dHVyZSddKSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ0Z1dHVyZSc7XG4gICAgICAgICAgICByZXF1ZXN0Wydjb250cmFjdF90eXBlJ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Wydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydidXknXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydzZWxsJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3B1YmxpY0dldCc7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKG1hcmtldFsnZnV0dXJlJ10pIHtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnRnV0dXJlJztcbiAgICAgICAgIC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H1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9ICdwcml2YXRlUG9zdCc7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAndHlwZSc6IHNpZGUsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChtYXJrZXRbJ2Z1dHVyZSddKSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ0Z1dHVyZSc7XG4gICAgICAgICAgICBvcmRlciA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICdjb250cmFjdF90eXBlJzogJ3RoaXNfd2VlaycsIC8vIG5leHRfd2VlaywgcXVhcnRlclxuICAgICAgICAgICAgICAgICdtYXRjaF9wcmljZSc6IDAsIC8vIG1hdGNoIGJlc3QgY291bnRlciBwYXJ0eSBwcmljZT8gMCBvciAxLCBpZ25vcmVzIHByaWNlIGlmIDFcbiAgICAgICAgICAgICAgICAnbGV2ZXJfcmF0ZSc6IDEwLCAvLyBsZXZlcmFnZSByYXRlIHZhbHVlOiAxMCBvciAyMCAoMTAgYnkgZGVmYXVsdClcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAodHlwZSA9PSAnbGltaXQnKSB7XG4gICAgICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSBwcmljZTtcbiAgICAgICAgICAgICAgICBvcmRlclsnYW1vdW50J10gPSBhbW91bnQ7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG9yZGVyWyd0eXBlJ10gKz0gJ19tYXJrZXQnO1xuICAgICAgICAgICAgICAgIGlmIChzaWRlID09ICdidXknKSB7XG4gICAgICAgICAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gdGhpcy5zYWZlRmxvYXQgKHBhcmFtcywgJ2Nvc3QnKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFvcmRlclsncHJpY2UnXSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBtYXJrZXQgYnV5IG9yZGVycyByZXF1aXJlIGFuIGFkZGl0aW9uYWwgY29zdCBwYXJhbWV0ZXIsIGNvc3QgPSBwcmljZSAqIGFtb3VudCcpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcGFyYW1zID0gdGhpcy5vbWl0IChwYXJhbXMsICdjb3N0Jyk7XG4gICAgICAgIG1ldGhvZCArPSAnVHJhZGUnO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ29yZGVyX2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4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ICAgICAgICAgIHJldHVybiAncGFydGlhbCc7XG4gICAgICAgIGlmIChzdGF0dXMgPT0gMilcbiAgICAgICAgICAgIHJldHVybiAnY2xvc2VkJztcbiAgICAgICAgaWYgKHN0YXR1cyA9PSA0KVxuICAgICAgICAgICAgcmV0dXJuICdjYW5jZWxlZCc7XG4gICAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc2lkZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHR5cGUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgndHlwZScgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGlmICgob3JkZXJbJ3R5cGUnXSA9PSAnYnV5JykgfHwgKG9yZGVyWyd0eXBlJ10gPT0gJ3NlbGwnKSkge1xuICAgICAgICAgICAgICAgIHNpZGUgPSBvcmRlclsndHlwZSddO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAnbGltaXQnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBzaWRlID0gKG9yZGVyWyd0eXBlJ10gPT0gJ2J1eV9tYXJrZXQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAnbWFya2V0JztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5wYXJzZU9yZGVyU3RhdHVzIChvcmRlclsnc3RhdHVzJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdzeW1ib2wnIGluIG9yZGVyKVxuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3ltYm9sJ10gaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgICAgICBtYXJr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jcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnb2tleCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdPS0VYJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdDTicsICdVUycgXSxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRnV0dXJlTWFya2V0cyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMyNTUyNzY4LTBkNmRkM2M2LWM0YTYtMTFlNy05MGY4LWMwNDNiNjQ3NTZhNy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly93d3cub2tleC5jb20vdjInLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vd3d3Lm9rZXguY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3Lm9rZXguY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lm9rZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3Lm9rZXguY29tL3Jlc3RfZ2V0U3RhcnRlZC5odG1sJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5va2V4LmNvbS9mZWVzLmh0bWwnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxufVxuIiwiXCJ1c2Ugc3RyaWN0XCI7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS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xuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vUGF5bWl1bS9hcGktZG9jdW1lbnRhdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5wYXltaXVtLmNvbS9wYWdlL2RldmVsb3BlcnMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvdW50cmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGF0YS97aWR9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGF0YS97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGF0YS97aWR9L2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX2NoYXJ0cy97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl9jaGFydHMve2lkfS9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZXJjaGFudC9nZXRfcGF5bWVudC97VVVJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2FkZHJlc3Nlcy97YnRjX2FkZHJlc3N9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vcmRlcnMve1VVSUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3ByaWNlX2FsZXJ0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wYXltZW50X3JlcXVlc3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3ByaWNlX2FsZXJ0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWVyY2hhbnQvY3JlYXRlX3BheW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXJzL3tVVUlEfS9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJpY2VfYWxlcnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdldXInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwNTksXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDA1OSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4g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ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2JpZCcpLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICd2d2FwJzogdndhcCxcbiAgICAgICAgICAgICdvcGVuJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ29wZW4nKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ByaWNlJyksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndmFyaWF0aW9uJyksXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJb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1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHBhcmFtcyk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZSArIHVybCArIGJvZHk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBcGktS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0FwaS1TaWduYXR1cmUnOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5zZWNyZXQpLFxuICAgICAgICAgICAgICAgICdBcGktTm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuIC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kZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzVtJzogMzAwLFxuICAgICAgICAgICAgICAgICcxNW0nOiA5MDAsXG4gICAgICAgICAgICAgICAgJzMwbSc6IDE4MDAsXG4gICAgICAgICAgICAgICAgJzJoJzogNzIwMCxcbiAgICAgICAgICAgICAgICAnNGgnOiAxNDQwMCxcbiAgICAgICAgICAgICAgICAnMWQnOiA4NjQwMCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2ODE3LWU5NDU2MzEyLTVlZTYtMTFlNy05YjNjLWI2MjhjYTU2MjZhNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vcHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vdHJhZGluZ0FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vcG9sb25pZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9wb2xvbmlleC5jb20vc3VwcG9ydC9hcGkvJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHA6Ly9wYXN0ZWJpbi5jb20vZE1YN21aRTAnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybjI0aFZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuQ2hhcnREYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5DdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5Mb2FuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVyblRpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbExvYW5PZmZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nsb3NlTWFyZ2luUG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZUxvYW5PZmZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2VuZXJhdGVOZXdBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRNYXJnaW5Qb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luQnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5TZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb3ZlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkFjdGl2ZUxvYW5zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5BdmFpbGFibGVBY2NvdW50QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5Db21wbGV0ZUJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5EZXBvc2l0QWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5EZXBvc2l0c1dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5GZWVJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5MZW5kaW5nSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuTWFyZ2luQWNjb3VudFN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybk9wZW5Mb2FuT2ZmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcmRlclRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGFibGVCYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0b2dnbGVBdXRvUmVuZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxNSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDI1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiAwLjAsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogMC4wMDAwMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IDEwMDAwMDAwMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMDAwMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogMTAwMDAwMDAwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogMC4wMDAwMDAwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IDEwMDAwMDAwMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjYWxjdWxhdGVGZWUgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSwgdGFrZXJPck1ha2VyID0gJ3Rha2VyJywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICBsZXQga2V5ID0gJ3F1b3RlJztcbiAgICAgICAgbGV0IHJhdGUgPSBtYXJrZXRbdGFrZXJPck1ha2VyXTtcbiAgICAgICAgbGV0IGNvc3QgPSBwYXJzZUZsb2F0ICh0aGlzLmNvc3RUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQgKiByYXRlKSk7XG4gICAgICAgIGlmIChzaWRlID09ICdzZWxsJykge1xuICAgICAgICAgICAgY29zdCAqPSBwcmljZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGtleSA9ICdiYXNlJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3R5cGUnOiB0YWtlck9yTWFrZXIsXG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRba2V5XSxcbiAgICAgICAgICAgICdyYXRlJzogcmF0ZSxcbiAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAodGhpcy5mZWVUb1ByZWNpc2lvbiAoc3ltYm9sLCBjb3N0KSksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0JUTScpXG4gICAgICAgICAgICByZXR1cm4gJ0JpdG1hcmsnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ1NUUicpXG4gICAgICAgICAgICByZXR1cm4gJ1hMTSc7XG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBjdXJyZW5jeUlkIChjdXJyZW5jeSkge1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0JpdG1hcmsnKVxuICAgICAgICAgICAgcmV0dXJuICdCVE0nO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ1hMTScpXG4gICAgICAgICAgICByZXR1cm4gJ1NUUic7XG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBwYXJzZU9ITENWIChvaGxjdiwgbWFya2V0ID0gdW5kZWZpbmVkLCB0aW1lZnJhbWUgPSAnNW0nLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgIG9obGN2WydkYXRlJ10gKiAxMDAwLFxuICAgICAgICAgICAgb2hsY3ZbJ29wZW4nXSxcbiAgICAgICAgICAgIG9obGN2WydoaWdoJ10sXG4gICAgICAgICAgICBvaGxjdlsnbG93J10sXG4gICAgICAgICAgICBvaGxjdlsnY2xvc2UnXSxcbiAgICAgICAgICAgIG9obGN2Wyd2b2x1bWUnXSxcbiAgICAgICAgXTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9ITENWIChzeW1ib2wsIHRpbWVmcmFtZSA9ICc1bScsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBpZiAoIXNpbmNlKVxuICAgICAgICAgICAgc2luY2UgPSAwO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdjdXJyZW5jeVBhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAncGVyaW9kJzogdGhpcy50aW1lZnJhbWVzW3RpbWVmcmFtZV0sXG4gICAgICAgICAgICAnc3RhcnQn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lIChpZCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2F2YWlsYWJsZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ29uT3JkZXJzJ10pLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IDAuMCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEZlZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBmZWVzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFJldHVybkZlZUluZm8gKCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IGZlZXMsXG4gICAgICAgICAgICAnbWFrZXInOiBwYXJzZUZsb2F0IChmZWVzWydtYWtlckZlZSddKSxcbiAgICAgICAgICAgICd0YWtlcic6IHBhcnNlRmxvYXQgKGZlZXNbJ3Rha2VyRmVlJ10pLFxuICAgICAgICAgICAgJ3dpdGhkcmF3JzogMC4wLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFJldHVybk9yZGVyQm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeVBhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgLy8gJ2RlcHRoJzogMTAwLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vayk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoMjRociddKSxcbiAgICAgICAgICAgICdsb3cnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xvdzI0aHInXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoZXN0QmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93ZXN0QXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICA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dkaXNhYmxlZCcgOiAnb2snO1xuICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSAnb2snKVxuICAgICAgICAgICAgICAgIGFjdGl2ZSA9IGZhbHNlO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ25hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5Wyd0eEZlZSddLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ3R4RmVlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0UmV0dXJuVGlja2VyIChwYXJhbXMpO1xuICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1ttYXJrZXRbJ2lkJ11dO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnZGF0ZSddKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGJhc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBxdW90ZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCghbWFya2V0KSAmJiAoJ2N1cnJlbmN5UGFpcicgaW4gdHJhZGUpKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3lQYWlyID0gdHJhZGVbJ2N1cnJlbmN5UGFpciddO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5UGFpciBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbY3VycmVuY3lQYWlyXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IHBhcnRzID0gY3VycmVuY3lQYWlyLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gcGFydHNbMF07XG4gICAgICAgICAgICAgICAgYmFzZSA9IHBhcnRzWzFdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgYmFzZSA9IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgcXVvdGUgPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHNpZGUgPSB0cmFkZVsndHlwZSddO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3RvdGFsJyk7XG4gICAgICAgIGxldCBhbW91bnQgPSBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pO1xuICAgICAgICBpZiAoJ2ZlZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIGxldCByYXRlID0gcGFyc2VGbG9hdCAodHJhZGVbJ2ZlZSddKTtcbiAgICAgICAgICAgIGxldCBmZWVDb3N0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKHNpZGUgPT0gJ2J1eScpIHtcbiAgICAgICAgICAgICAgICBjdXJyZW5jeSA9IGJhc2U7XG4gICAgICAgICAgICAgICAgZmVlQ29zdCA9IGFtb3VudCAqIHJhdGU7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGN1cnJlbmN5ID0gcXVvdGU7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBjb3N0ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgZmVlQ29zdCA9IGNvc3QgKiByYXRlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdyYXRlJzogcmF0ZSxcbiAgICAgICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAndHJhZGVJRCcpLFxuICAgICAgICAgICAgJ29yZGVyJzogdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ29yZGVyTnVtYmVyJyksXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwYXJzZUZsb2F0ICh0cmFkZVsncmF0ZSddKSx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XQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoc3ltYm9sKVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBwYWlyID0gbWFya2V0ID8gbWFya2V0WydpZCddIDogJ2FsbCc7XG4gICAgICAgIGxldCByZXF1ZXN0ID0geyAnY3VycmVuY3lQYWlyJzogcGFpciB9O1xuICAgICAgICBpZiAoc2luY2UpIHtcbiAgICAgICAgICAgIHJlcXVlc3RbJ3N0YXJ0J10gPSBwYXJzZUludCAoc2luY2UgLyAxMDAwKTtcbiAgICAgICAgICAgIHJlcXVlc3RbJ2VuZCddID0gdGhpcy5zZWNvbmRzICgpO1xuICAgICAgICB9XG4gICAgICAgIC8vIGxpbWl0IGlzIGRpc2FibGVkIChkb2VzIG5vdCByZWFsbHkgd29yayBhcyBleHBlY3RlZClcbiAgICAgICAgLy8gaWYgKGxpbWl0KVxuICAgICAgICAvLyAgICAgcmVxdWVzdFsnbGltaXQnXSA9IHBhcnNlSW50IChsaW1pdCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RSZXR1cm5UcmFkZUhpc3RvcnkgKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICByZXN1bHQgPSB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChyZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgICAgIGxldCB0cmFkZXMgPSB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZVtpZF0sIG1hcmtldCk7XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgdHJhZGVzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAodHJhZGVzW2pdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5maWx0ZXJCeVNpbmNlTGltaXQgKHJlc3VsdCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnNhZmVJbnRlZ2VyIChvcmRlciwgJ3RpbWVzdGFtcCcpO1xuICAgICAgICBpZiAoIXRpbWVzdGFtcClcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxIChvcmRlclsnZGF0ZSddKTtcbiAgICAgICAgbGV0IHRyYWRlcyA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdyZXN1bHRpbmdUcmFkZXMnIGluIG9yZGVyKVxuICAgICAgICAgICAgdHJhZGVzID0gdGhpcy5wYXJzZVRyYWRlcyAob3JkZXJbJ3Jlc3VsdGluZ1RyYWRlcyddLCBtYXJrZXQpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHByaWNlID0gcGFyc2VGbG9hdCAob3JkZXJbJ3ByaWNlJ10pO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3RvdGFsJywgMC4wKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2Ftb3VudCcpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnc3RhcnRpbmdBbW91bnQnLCByZW1haW5pbmcpO1xuICAgICAgICBsZXQgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydvcmRlck51bWJlciddLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzdGF0dXMnOiBvcmRlclsnc3RhdHVzJ10sXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsnc2lkZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAndHJhZGVzJzogdHJhZGVzLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZU9wZW5PcmRlcnMgKG9yZGVycywgbWFya2V0LCByZXN1bHQgPSBbXSkge1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG9yZGVycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG9yZGVyID0gb3JkZXJzW2ldO1xuICAgICAgICAgICAgbGV0IGV4dGVuZGVkID0gdGhpcy5leHRlbmQgKG9yZGVyLCB7XG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvcGVuJyxcbiAgICAgICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG9yZGVyWydyYXRlJ10sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLnBhcnNlT3JkZXIgKGV4dGVuZGVkLCBtYXJrZXQpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJzIChzeW1ib2wgPSB1bmRlZmluZWQsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHN5bWJvbClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcGFpciA9IG1hcmtldCA/IG1hcmtldFsnaWQnXSA6ICdhbGwnO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0UmV0dXJuT3Blbk9yZGVycyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeVBhaXInOiBwYWlyLFxuICAgICAgICB9KSk7XG4gICAgICAgIGxldCBvcGVuT3JkZXJzID0gW107XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIG9wZW5PcmRlcnMgPSB0aGlzLnBhcnNlT3Blbk9yZGVycyAocmVzcG9uc2UsIG1hcmtldCwgb3Blbk9yZGVycyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0SWRzID0gT2JqZWN0LmtleXMgKHJlc3BvbnNlKTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0SWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldElkID0gbWFya2V0SWRzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBvcmRlcnMgPSByZXNwb25zZVttYXJrZXRJZF07XG4gICAgICAgICAgICAgICAgbGV0IG0gPSB0aGlzLm1hcmtldHNfYnlfaWRbbWFya2V0SWRdO1xuICAgICAgICAgICAgICAgIG9wZW5PcmRlcnMgPSB0aGlzLnBhcnNlT3Blbk9yZGVycyAob3JkZXJzLCBtLCBvcGVuT3JkZXJzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IG9wZW5PcmRlcnMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgIHRoaXMub3JkZXJzW29wZW5PcmRlcnNbal1bJ2lkJ11dID0gb3Blbk9yZGVyc1tqXTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgb3Blbk9yZGVyc0luZGV4ZWRCeUlkID0gdGhpcy5pbmRleEJ5IChvcGVuT3JkZXJzLCAnaWQnKTtcbiAgICAgICAgbGV0IGNhY2hlZE9yZGVySWRzID0gT2JqZWN0LmtleXMgKHRoaXMub3JkZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBrID0gMDsgayA8IGNhY2hlZE9yZGVySWRzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBjYWNoZWRPcmRlcklkc1trXTtcbiAgICAgICAgICAgIGlmIChpZCBpbiBvcGVuT3JkZXJzSW5kZXhlZEJ5SWQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSB0aGlzLmV4dGVuZCAodGhpcy5vcmRlcnNbaWRdLCBvcGVuT3JkZXJzSW5kZXhlZEJ5SWRbaWRdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRlcnNbaWRdO1xuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3RhdHVzJ10gPT0gJ29wZW4nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiBvcmRlclsnYW1vdW50J10gKiBvcmRlclsncHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWxsZWQnOiBvcmRlclsnYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVtYWluaW5nJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSB0aGlzLm9yZGVyc1tpZF07XG4gICAgICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydzeW1ib2wnXSA9PSBzeW1ib2wpXG4gICAgICAgICAgICAgICAgICAgIHJlc3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Cc6IG5ld2lkLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvcGVuJyxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcmVzdWx0ID0gdGhpcy5leHRlbmQgKHRoaXMub3JkZXJzW25ld2lkXSwgeyAnaW5mbyc6IHJlc3BvbnNlIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmVzdWx0ID0ge1xuICAgICAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ29yZGVyTnVtYmVyJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdvcmRlck51bWJlcic6IGlkLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5vcmRlcnMpXG4gICAgICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdWydzdGF0dXMnXSA9ICdjYW5jZWxlZCc7XG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLmxhc3RfaHR0cF9yZXNwb25zZSkge1xuICAgICAgICAgICAgICAg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gICAgICAgaWYgKGJvZHlbMF0gPT0gXCJ7XCIpIHtcbiAgICAgICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgICAgICBpZiAoJ2Vycm9yJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgZXJyb3IgPSB0aGlzLmlkICsgJyAnICsgYm9keTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydlcnJvciddLmluZGV4T2YgKCdUb3RhbCBtdXN0IGJlIGF0IGxlYXN0JykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAoZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJlc3BvbnNlWydlcnJvciddLmluZGV4T2YgKCdOb3QgZW5vdWdoJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEluc3VmZmljaWVudEZ1bmRzIChlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAoZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKSB7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AnbmFtZSc6ICdRUllQVE9TJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdDTicsICdUVycgXSxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJzInLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMDk1MzkxNS1iMTYxMWRjMC1hNDM2LTExZTctODk0Ny1jOTViZDVhNDIwODYuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLnFyeXB0b3MuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LnFyeXB0b3MuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZGV2ZWxvcGVycy5xdW9pbmUuY29tJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0vcHJpY2VfbGV2ZWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGVjdXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpcl9sYWRkZXJzL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMvYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3J5cHRvX2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGVjdXRpb25zL21lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWF0X2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2FuX2JpZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW5zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3tpZH0vbG9hbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmdfYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmdfYWNjb3VudHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpYXRfYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW5fYmlkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2FuX2JpZHMve2lkfS9jbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97aWR9L2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97aWR9L2Nsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvY2xvc2VfYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nX2FjY291bnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0UHJvZHVjdHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnaWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydiYXNlX2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ3F1b3RlZF9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBtYWtlciA9IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYWtlcl9mZWUnKTtcbiAgICAgICAgICAgIGxldCB0YWtlciA9IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICd0YWtlcl9mZWUnKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAhbWFya2V0WydkaXNhYmxlZCddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBtYWtlcixcbiAgICAgICAgICAgICAgICAndGFrZXInOiB0YWtlcixcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRzQmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2JhbGFuY2UnXSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHRvdGFsLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IHRvdGFsLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQcm9kdWN0c0lkUHJpY2VMZXZlbHMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYnV5X3ByaWNlX2xldmVscycsICdzZWxsX3ByaWNlX2xldmVscycpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBsYXN0ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2xhc3RfdHJhZGVkX3ByaWNlJyBpbiB0aWNrZXIpIHtcbiAgICAgICAgICAgIGlmICh0aWNrZXJbJ2xhc3RfdHJhZGVkX3ByaWNlJ10pIHtcbiAgICAgICAgICAgICAgICBsZXQgbGVuZ3RoID0gdGlja2VyWydsYXN0X3RyYWRlZF9wcmljZSddLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBpZiAobGVuZ3RoID4gMClcbiAgICAgICAgICAgICAgICAgICAgbGFzdCA9IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdF90cmFkZWRfcHJpY2UnXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2hfbWFya2V0X2FzaycpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3dfbWFya2V0X2JpZCcpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdtYXJrZXRfYmlkJyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21hcmtldF9hc2snKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbHVtZV8yNGgnKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFByb2R1Y3RzIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IHQgPSAwOyB0IDwgdGlja2Vycy5sZW5ndGg7IHQrKykge1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbdF07XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRpY2tlclsnYmFzZV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGlja2VyWydxdW90ZWRfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0UHJvZHVjdHNJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2NyZWF0ZWRfYXQnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3Rha2VyX3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBw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O1xuICAgICAgICBsZXQgc3RhdHVzID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ3N0YXR1cycgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGlmIChvcmRlclsnc3RhdHVzJ10gPT0gJ2xpdmUnKSB7XG4gICAgICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChvcmRlclsnc3RhdHVzJ10gPT0gJ2ZpbGxlZCcpIHtcbiAgICAgICAgICAgICAgICBzdGF0dXMgPSAnY2xvc2VkJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAob3JkZXJbJ3N0YXR1cyddID09ICdjYW5jZWxsZWQnKSB7IC8vICdsbCcgaW50ZW5kZWRcbiAgICAgICAgICAgICAgICBzdGF0dXMgPSAnY2FuY2VsZWQnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBhbW91bnQgPSBwYXJzZUZsb2F0IChvcmRlclsncXVhbnRpdHknXSk7XG4gICAgICAgIGxldCBmaWxsZWQgPSBwYXJzZUZsb2F0IChvcmRlclsnZmlsbGVkX3F1YW50aXR5J10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWydvcmRlcl90eXBlJ10sXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJ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gKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAoY29kZSA9PSA0MjIpIHtcbiAgICAgICAgICAgIGlmICgnZXJyb3JzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIGxldCBlcnJvcnMgPSByZXNwb25zZVsnZXJyb3JzJ107XG4gICAgICAgICAgICAgICAgaWYgKCd1c2VyJyBpbiBlcnJvcnMpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2VzID0gZXJyb3JzWyd1c2VyJ107XG4gICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlcy5pbmRleE9mICgnbm90X2Vub3VnaF9mcmVlX2JhbGFuY2UnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJ3F1YW50aXR5JyBpbiBlcnJvcnMpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2VzID0gZXJyb3JzWydxdWFudGl0eSddO1xuICAgICAgICAgICAgICAgICAgICBpZiAobWVzc2FnZXMuaW5kZXhPZiAoJ2xlc3NfdGhhbl9vcmRlcl9zaXplJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAnWC1RdW9pbmUtQVBJLVZlcnNpb24nOiB0aGlzLnZlcnNpb24sXG4gICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBs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zLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAncXVhZHJpZ2FjeCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdRdWFkcmlnYUNYJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQ0EnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MicsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAvLyBvYnNvbGV0ZSBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAvLyBuZXcgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjgyNS05OGE2ZDBkZS01ZWU3LTExZTctOWZhNC0zOGUxMWEyYzZmNTIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLnF1YWRyaWdhY3guY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LnF1YWRyaWdhY3guY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LnF1YWRyaWdhY3guY29tL2FwaV9pbmZvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldGhlcl9kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aGVyX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvb2t1cF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICA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1ttZXRob2RdICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IFsgbm9uY2UudG9TdHJpbmcgKCksIHRoaXMudWlkLCB0aGlzLmFwaUtleSBdLmpvaW4gKCcnKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChyZXF1ZXN0KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnc2lnbmF0dXJlJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgfSwg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ZS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuc291dGh4Y2hhbmdlLmNvbS9Ib21lL0FwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsTWFya2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2VuZXJhdGVuZXdhZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFswXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsxXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgaWQgPSBzeW1ib2w7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICA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yBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRCb29rU3ltYm9sICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdCdXlPcmRlcnMnLCAnU2VsbE9yZGVycycsICdQcmljZScsICdBbW91bnQnKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdCaWQnKSxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnQXNrJyksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5l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N5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdsaXN0aW5nQ3VycmVuY3knOiBtYXJrZXRbJ2Jhc2UnXSxcbiAgICAgICAgICAgICdyZWZlcmVuY2VDdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsnbGltaXRQcmljZSddID0gcHJpY2U7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RQbGFjZU9yZGVyICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ29yZGVyQ29kZSc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBhc3luYyB3aXRoZHJhdyAoY3VycmVuY3ksIGFtb3VudCwgYWRkcmVzcywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFdpdGhkcmF3ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHF1ZXJ5KTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgICAgICAnSGFzaCc6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gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2lkfS9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMvdGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGlzY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkaXNjb3VudHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9wb3NpdGlvbl9iYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L3Bvc2l0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L3Bvc2l0aW9ucy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19saW1pdHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfbGltaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXRtcy93aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzL3JlbW92ZV9hbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQQyc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMi41LCAgLy8gd29yc3QtY2FzZSBzY2VuYXJpbzogaHR0cHM6Ly90aGVyb2NrdHJhZGluZy5jb20vZW4vcGFnZXMvZmVlc1xuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0RnVuZHNUaWNrZXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1sndGlja2VycyddLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sndGlja2VycyddW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydmdW5kX2lkJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IGlkLnNsaWNlICgzKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnYmFsYW5jZXMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBmcmVlID0gYmFsYW5jZVsndHJhZGluZ19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ICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRGdW5kc0lkVGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGlmICghbWFya2V0KVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydmdW5kX2lkJ11dO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydkYXRlJ10pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnYW1vdW50J10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyB0aWRleCBleHRlbmRzIGxpcXVpIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICd0aWRleCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdUaWRleCcsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1VLJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAyMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAnMycsXG4gICAgICAgICAgICAvLyAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgLy8gJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMwNzgxNzgwLTAzMTQ5ZGM0LWExMmUtMTFlNy04MmJiLTMxM2IyNjlkMjRkNC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkudGlkZXguY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLnRpZGV4LmNvbS90YXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly90aWRleC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly90aWRleC5jb20vcHVibGljLWFwaScsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3RpZGV4LmNvbS9hc3NldHMtc3BlYycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3RpZGV4LmNvbS9wYWlycy1zcGVjJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVFMnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RFRU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dBVkVTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXQ1QnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dCVEMnOiAwLjAwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5DTlQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNUlQnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUVSJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FRVUEnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSQlgnOiAxMDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUS1MnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1VTRCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXRVVSJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dHTyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTlQnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURHJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JMQyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAwLjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOR1MnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVlNMJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RJTUUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RBQVMnOiAwLjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS09MSU9OJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JJRERMRSc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU5UJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VGWVQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUdPJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dFVFQnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZUVUVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRUkwnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZU1HTyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTlQnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUkMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMzAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQ08nOiAwLjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RPUkonOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMC4zLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dHUic6IDMuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVEEnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEJUJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAxMjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd1NVUic6IDAuMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VSJzogMC4wNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNU1AnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSW5QYXknOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRMJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FIVCc6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQSU5HJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPVCc6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRSc6IDMuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQSVgnOiAxMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NSRURPJzogMzAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSUZFJzogMTAwMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTUMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJDVCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLTkMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVNEJzogMC4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVQic6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5KJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVlgnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0NMJzogMy4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VORyc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdURFgnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEEnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJHJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDT1MnOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiA0MC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSTic6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSWVonOiAxMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0IyQic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQVQnOiAxMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOT1YnOiAyNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSR04nOiAzLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElFJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiA1MC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dBWCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBR0knOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVFJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxufVxuIiwiXCJ1c2Ugc3RyaWN0XCI7XG5cbi8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5jb25zdCBmb3hiaXQgPSByZXF1aXJlICgnLi9mb3hiaXQuanMnKVxuXG4vLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyB1cmR1Yml0IGV4dGVuZHMgZm94Yml0IHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICd1cmR1Yml0JyxcbiAgICAgICAgICAgICduYW1lJzogJ1VyZHVCaXQnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdQSycsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk5MTQ1My0xNTZiZjNhZS02NDgwLTExZTctODJlYi03Mjk1ZmUxYjViYjQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3VyZHViaXQuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYmxpbmt0cmFkZS5jb20vZG9jcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG59XG4iLCJcInVzZSBzdHJpY3RcIjtcblxuLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbmNvbnN0IEV4Y2hhbmdlID0gcmVxdWlyZSAoJy4vYmFzZS9FeG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GFzaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5b3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXRlc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhdGVzdHRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMvZGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMvaG91cicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zL21vbnRoJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXkve3N5bWJvbH0ve3R5cGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbC97c3ltYm9sfS97dHlwZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICg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W5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ2N1cnJlbmN5X2NvZGUnXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBmcmVlID0gYmFsYW5jZVsnY2FzaCddO1xuICAgICAgICAgICAgbGV0IHVzZWQgPSBiYWxhbmNlWydyZXNlcnZlZCddO1xuICAgICAgICAgICAgbGV0IHRvdGFsID0gdGhpcy5zdW0gKGZyZWUsIHVzZWQpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBmcmVlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdXNlZCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiB0b3RhbCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rIChwYXJhbXMpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0ge1xuICAgICAgICAgICAgJ2JpZHMnOiByZXNwb25zZVsnZGF0YSddWzBdWydiJ10sXG4gICAgICAgICAgICAnYXNrcyc6IHJlc3BvbnNlWydkYXRhJ11b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hIaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnMjRoTG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IGJpZFswXSxcbiAgICAgICAgICAgICdhc2snOiBhc2tbMF0sXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ0xhc3RQcmljZSddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJzI0aFZvbHVtZSddKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnVGltZSddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9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d3LnZpcndveC5jb20vZGV2ZWxvcGVycy5waHAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnbG9naW4nOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwYXNzd29yZCc6IHRydWVcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5zdHJ1bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEJlc3RQcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE1hcmtldERlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdlc3RpbWF0ZU1hcmtldE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFkZWRQcmljZVZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0UmF3VHJhZGVEYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRTdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUZXJtaW5hbExpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEdyaWRMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRHcmlkU3RhdGlzdGljcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEluc3RydW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRCZXN0UHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRNYXJrZXREZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXN0aW1hdGVNYXJrZXRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VHJhZGVkUHJpY2VWb2x1bWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFJhd1RyYWRlRGF0YScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0U3RhdGlzdGljcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VGVybWluYWxMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRHcmlkTGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0R3JpZFN0YXRpc3RpY3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRDb21taXNzaW9uRGlzY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRDb21taXNzaW9uRGlzY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEluc3RydW1lbnRzICgpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzWydyZXN1bHQnXSk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBrZXlzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sncmVzdWx0J11ba2V5c1twXV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2luc3RydW1lbnRJRCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnbG9uZ0N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ3Nob3J0Q3VycmVuY3knXTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncmVzdWx0J11bJ2FjY291bnRMaXN0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgdG90YWwgPSBiYWxhbmNlWydiYWxhbmNlJ107XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHRvdGFsLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IHRvdGFsLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldFByaWNlIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljUG9zdEdldEJlc3RQcmljZXMgKHRoaXMuZXh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Glja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogbWFya2V0UHJpY2VbJ2JpZCddLFxuICAgICAgICAgICAgJ2Fzayc6IG1hcmtldFByaWNlWydhc2snXSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ29wZW4nXSksXG4gICAgICAgICAgICAnY2xvc2UnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2Nsb3NlJ10pLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWydsb25nVm9sdW1lJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWydzaG9ydFZvbHVtZSddKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBzeW1ib2wgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHNlYyA9IHRoaXMuc2FmZUludGVnZXIgKHRyYWRlLCAndGltZScpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gc2VjICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzd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gIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdpbnN0cnVtZW50JzogdGhpcy5zeW1ib2wgKG1hcmtldCksXG4gICAgICAgICAgICAnb3JkZXJUeXBlJzogc2lkZS50b1VwcGVyQ2FzZSAoKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0UGxhY2VPcmRlciAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnb3JkZXJJRCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ29yZGVySUQnOiBpZCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBsZXQgYXV0aCA9IHt9O1xuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBhdXRoWydrZXknXSA9IHRoaXMuYXBpS2V5O1xuICAgICAgICAgICAgYXV0aFsndXNlciddID0gdGhpcy5sb2dpbjtcbiAgICAgICAgICAgIGF1dGhbJ3Bhc3MnXSA9IHRoaXMucGFzc3dvcmQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJykge1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdpZCc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgYXV0aCwgcGFyYW1zKSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBoZWFkZXJzID0geyAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nIH07XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uICh7XG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ3BhcmFtcyc6IHRoaXMuZXh0ZW5kIChhdXRoLCBwYXJhbXMpLFxuICAgICAgICAgICAgICAgICdpZCc6IG5vbmNlLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGNvZGUgPT0gMjAwKSB7XG4gICAgICAgICAgICBpZiAoKGJvZHlbMF0gPT0gJ3snKSB8fCAoYm9keVswXSA9PSAnWycpKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgaWYgKCdyZXN1bHQnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCByZXN1bHQgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgICAgICAgICAgICAgIGlmICgnZXJyb3JDb2RlJyBpbiByZXN1bHQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBlcnJvckNvZGUgPSByZXN1bHRbJ2Vycm9yQ29kZSddO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVycm9yQ29kZSAhPSAnT0snKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGVycm9yIHJldHVybmVkOiAnICsgYm9keSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgbWFsZm9ybWVkIHJlc3BvbnNlOiBubyByZXN1bHQgaW4gcmVzcG9uc2U6ICcgKyBib2R5KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIGlmIG5vdCBhIEpTT04gcmVzcG9uc2VcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcmV0dXJuZWQgYSBub24tSlNPTiByZXBseTogJyArIGJvZHkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufVxuIiwiXCJ1c2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G4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93ZXgubnovYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93ZXgubnovdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd2V4Lm56JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93ZXgubnovYXBpLzMvZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3dleC5uei90YXBpL2RvY3MnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93ZXgubnovZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFuc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NvaW5EZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdDb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDcmVhdGVDb3Vwb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZGVlbUNvdXBvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05NQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVkMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICA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VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2F2ZycpLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sX2N1cicpLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbCcpLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09IDIwMCkge1xuICAgICAgICAgICAgaWYgKGJvZHlbMF0gIT0gJ3snKSB7XG4gICAgICAgICAgICAgICAgLy8gcmVzcG9uc2UgaXMgbm90IEpTT05cbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcmV0dXJuZWQgYSBub24tSlNPTiByZXBseTogJyArIGJvZHkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFyZXNwb25zZVsnc3VjY2VzcyddKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBlcnJvciA9IHRoaXMuc2FmZVZhbHVlIChyZXNwb25zZSwgJ2Vycm9yJyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghZXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm5lZCBhIG1hbGZvcm1lZCBlcnJvcjogJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09ICdiYWQgc3RhdHVzJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKHRoaXMuaWQgKyAnICcgKyBlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IuaW5kZXhPZiAoJ0l0IGlzIG5vdCBlbm91Z2gnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKHRoaXMuaWQgKyAnICcgKyBlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gJ1JlcXVlc3RzIHRvbyBvZnRlbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBERG9TUHJvdGVjdGlvbiAodGhpcy5pZCArICcgJyArIGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSAnbm90IGF2YWlsYWJsZScpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBERG9TUHJvdGVjdGlvbiAodGhpcy5pZCArICcgJyArIGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSAnZXh0ZXJuYWwgc2VydmljZSB1bmF2YWlsYWJsZScpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBERG9TUHJvdGVjdGlvbiAodGhpcy5pZCArICcgJyArIGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgLy8gdGhhdCdzIHdoYXQgZmV0Y2hPcGVuT3JkZXJzIHJldHVybiBpZiBubyBvcGVuIG9yZGVycyAoZml4IGZvciAjNDg5KVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yICE9ICdubyBvcmRlcnMnKSB7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ICAgICAgICAgICAnbmFtZSc6ICd4QlRDZScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1JVJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAyMDAwLCAvLyByZXNwb25zZXMgYXJlIGNhY2hlZCBldmVyeSAyIHNlY29uZHNcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXNQdWJsaWNBUEknOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogZmFsc2UsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4MDU5NDE0LWUyMzU5NzBjLTY2MmMtMTFlNy04YzNhLTA4ZTMxZjc4Njg0Yi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9jcnlwdG90dGxpdmV3ZWJhcGkueGJ0Y2UubmV0Ojg0NDMvYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LnhidGNlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LnhidGNlLmNvbS90cmFkZWFwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3N1cHBvcnQueGJ0Y2UuaW5mby9Lbm93bGVkZ2ViYXNlL0FydGljbGUvVmlldy81Mi8yNS94YnRjZS1leGNoYW5nZS1hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeS97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGV2ZWwyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZXZlbDIve2ZpbHRlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2JpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L2xldmVsMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3RpY2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2wnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbC97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGljaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGljay97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2ZpbHRlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc2Vzc2lvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNlcnZlcmluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc2Vzc2lvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZXZlbDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xldmVsMi97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2wve2ZpbHRlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2sve2ZpbHRlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Fzc2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhc3NldC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24ve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2Fzay9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2JpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9iaWQvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L2xldmVsMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L2xldmVsMi9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vcGVyaW9kaWNpdGllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3RpY2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vdGlja3MvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L2NhY2hlL3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS9jYWNoZS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3RvcnkvY2FjaGUve3N5bWJvbH0vbGV2ZWwyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3RvcnkvY2FjaGUve3N5bWJvbH0vdGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS9zeW1ib2xzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3RvcnkvdmVyc2lvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZWhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0U3ltYm9sICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ1N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ01hcmdpbkN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ1Byb2ZpdEN1cnJlbmN5J107XG4gICAgICAgICAgICBpZiAoYmFzZSA9PSAnRFNIJylcbiAgICAgICAgICAgICAgICBiYXNlID0gJ0RBU0gnO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnSXNUcmFkZUFsbG93ZWQnXSA/IHN5bWJvbCA6IGlkO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRBc3NldCAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIC8vIHhidGNlIG5hbWVzIERBU0ggaW5jb3JyZWN0bHkgYXMgRFNIXG4gICAgICAgICAgICBpZiAodXBwZXJjYXNlID09ICdEU0gnKVxuICAgICAgICAgICAgICAgIHVwcGVyY2FzZSA9ICdEQVNIJztcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZVsnRnJlZUFtb3VudCddLFxuICAgICAgICAgICAgICAgICd1c2VkJzogYmFsYW5jZVsnTG9ja2VkQW1vdW50J10sXG4gIC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ltZXN0YW1wID0gdGlja2VyWydMYXN0QnV5VGltZXN0YW1wJ107XG4gICAgICAgICAgICAgICAgbGFzdCA9IHRpY2tlclsnTGFzdEJ1eVByaWNlJ107XG4gICAgICAgICAgICB9XG4gICAgICAgIGlmICgnTGFzdFNlbGxUaW1lc3RhbXAnIGluIHRpY2tlcilcbiAgICAgICAgICAgIGlmICh0aW1lc3RhbXAgPCB0aWNrZXJbJ0xhc3RTZWxsVGltZXN0YW1wJ10pIHtcbiAgICAgICAgICAgICAgICB0aW1lc3RhbXAgPSB0aWNrZXJbJ0xhc3RTZWxsVGltZXN0YW1wJ107XG4gICAgICAgICAgICAgICAgbGFzdCA9IHRpY2tlclsnTGFzdFNlbGxQcmljZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICBpZiAoIXRpbWVzdGFtcClcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aWNrZXJbJ0RhaWx5QmVzdEJ1eVByaWNlJ10sXG4gICAgICAgICAgICAnbG93JzogdGlja2VyWydEYWlseUJlc3RTZWxsUHJpY2UnXSxcbiAgICAgICAgICAgICdiaWQnOiB0aWNrZXJbJ0Jlc3RCaWQnXSxcbiAgICAgICAgICAgICdhc2snOiB0aWNrZXJbJ0Jlc3RBc2snXSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ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SB7XG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICAgICAgaWYgKGJhc2UgPT0gJ0RTSCcpXG4gICAgICAgICAgICAgICAgICAgIGJhc2UgPSAnREFTSCc7XG4gICAgICAgICAgICAgICAgaWYgKHF1b3RlID09ICdEU0gnKVxuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9ICdEQVNIJztcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlckZpbHRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdmaWx0ZXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgbGVuZ3RoID0gdGlja2Vycy5sZW5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zIChyZXNwb25zZVsnQmFycyddLCBtYXJrZXQsIHRpbWVmcmFtZSwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy50YXBpUG9zdFRyYWRlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdyYXRlJzogcHJpY2UsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydJZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlRGVsZXRlVHJhZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnVHlwZSc6ICdDYW5jZWwnLFxuICAgICAgICAgICAgJ0lkJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgIH1cblxuICAgIG5v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hpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0FjY2VwdC1FbmNvZGluZyc6ICdnemlwLCBkZWZsYXRlJyB9O1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT0gJ1BPU1QnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnNbJ0NvbnRlbnQtVHlwZSddID0gJ2FwcGxpY2F0aW9uL2pzb24nO1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZSArIHRoaXMudWlkICsgdGhpcy5hcGlLZXkgKyBtZXRob2QgKyB1cmw7XG4gICAgICAgICAgICBpZiAoYm9keSlcbiAgICAgICAgICAgICAgICBhdXRoICs9IGJvZHk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGEyNTYnLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBsZXQgY3JlZGVudGlhbHMgPSB0aGlzLnVpZCArICc6JyArIHRoaXMuYXBpS2V5ICsgJzonICsgbm9uY2UgKyAnOicgKyB0aGlzLmJpbmFyeVRvU3RyaW5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gICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY5MTAtY2RjYmZkYWUtNWVlYS0xMWU3LTk4NTktMDNmZWE4NzMyNzJkLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3lvYml0Lm5ldC9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3lvYml0Lm5ldC90YXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cueW9iaXQubmV0JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LnlvYml0Lm5ldC9lbi9hcGkvJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy55b2JpdC5uZXQvZW4vZmVlcy8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlckluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3Q29pbnNUb0FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMixcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzogMC4wLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IDAuMDAwNSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgbGV0IHN1YnN0aXR1dGlvbnMgPSB7XG4gICAgICAgICAgICAnQUlSJzogJ0FpckNvaW4nLFxuICAgICAgICAgICAgJ0FOSSc6ICdBTklDb2luJyxcbiAgICAgICAgICAgICdBTlQnOiAnQW50c0NvaW4nLFxuICAgICAgICAgICAgJ0FUTSc6ICdBdXR1bW5jb2luJyxcbiAgICAgICAgICAgICdCQ0MnOiAnQkNIJyxcbiAgICAgICAgICAgICdCVFMnOiAnQml0c2hhcmVzMicsXG4gICAgICAgICAgICAnRENUJzogJ0Rpc2NvdW50JyxcbiAgICAgICAgICAgICdER0QnOiAnRGFya0dvbGRDb2luJyxcbiAgICAgICAgICAgICdJQ04nOiAnaUNvaW4nLFxuICAgICAgICAgICAgJ0xJWkknOiAnTGlaaScsXG4gICAgICAgICAgICAnTFVOJzogJ0x1bmFyQ29pbicsXG4gICAgICAgICAgICAnTkFWJzogJ05hdmFqb0NvaW4nLFxuICAgICAgICAgICAgJ09NRyc6ICdPTUdhbWUnLFxuICAgICAgICAgICAgJ1BBWSc6ICdFUEFZJyxcbiAgICAgICAgICAgICdSRVAnOiAnUmVwdWJsaWNvaW4nLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoY3VycmVuY3kgaW4gc3Vic3RpdHV0aW9ucylcbiAgICAgICAgICAgIHJldHVybiBzdWJzdGl0dXRpb25zW2N1cnJlbmN5XTtcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGN1cnJlbmN5SWQgKGNvbW1vbkNvZGUpIHtcbiAgICAgICAgbGV0IHN1YnN0aXR1dGlvbnMgPSB7XG4gICAgICAgICAgICAnQWlyQ29pbic6ICdBSVInLFxuICAgICAgICAgICAgJ0FOSUNvaW4nOiAnQU5JJyxcbiAgICAgICAgICAgICdBbnRzQ29pbic6ICdBTlQnLFxuICAgICAgICAgICAgJ0F1dHVtbmNvaW4nOiAnQVRNJyxcbiAgICAgICAgICAgICdCQ0gnOiAnQkNDJyxcbiAgICAgICAgICAgICdCaXRzaGFyZXMyJzogJ0JUUycsXG4gICAgICAgICAgICAnRGlzY291bnQnOiAnRENUJyxcbiAgICAgICAgICAgICdEYXJrR29sZENvaW4nOiAnREdEJyxcbiAgICAgICAgICAgICdpQ29pbic6ICdJQ04nLFxuICAgICAgICAgICAgJ0xpWmknOiAnTElaSScsXG4gICAgICAgICAgICAnTHVuYXJDb2luJzogJ0xVTicsXG4gICAgICAgICAgICAnTmF2YWpvQ29pbic6ICdOQVYnLFxuICAgICAgICAgICAgJ09NR2FtZSc6ICdPTUcnLFxuICAgICAgICAgICAgJ0VQQVknOiAnUEFZJyxcbiAgICAgICAgICAgICdSZXB1YmxpY29pbic6ICdSRVAnLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoY29tbW9uQ29kZSBpbiBzdWJzdGl0dXRpb25zKVxuICAgICAgICAgICAgcmV0dXJuIHN1YnN0aXR1dGlvbnNbY29tbW9uQ29kZV07XG4gICAgICAgIHJldHVybiBjb21tb25Db2RlO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXR1cm4nXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgc2lkZXMgPSB7ICdmcmVlJzogJ2Z1bmRzJywgJ3RvdGFsJzogJ2Z1bmRzX2luY2xfb3JkZXJzJyB9O1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChzaWRlcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGtleSA9IGtleXNbaV07XG4gICAgICAgICAgICBsZXQgc2lkZSA9IHNpZGVzW2tleV07XG4gICAgICAgICAgICBpZiAoc2lkZSBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzW3NpZGVdKTtcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGN1cnJlbmNpZXMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxvd2VyY2FzZSA9IGN1cnJlbmNpZXNbal07XG4gICAgICAgICAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBsb3dlcmNhc2UudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlICh1cHBlcmNhc2UpO1xuICAgICAgICAgICAgICAgICAgICBsZXQgYWNjb3VudCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIHJlc3VsdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYWNjb3VudCA9IHJlc3VsdFtjdXJyZW5jeV07XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRba2V5XSA9IGJhbGFuY2VzW3NpZGVdW2xvd2VyY2FzZV07XG4gICAgICAgICAgICAgICAgICAgIGlmIChhY2NvdW50Wyd0b3RhbCddICYmIGFjY291bnRbJ2ZyZWUnXSlcbiAgICAgICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgY3J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cycpID49IDApIHsgLy8gbm90IGVub3VnVGggaXMgYSB0eXBvIGluc2lkZSBMaXF1aSdzIG93biBBUEkuLi5cbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEluc3VmZmljaWVudEZ1bmRzICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocmVzcG9uc2VbJ2Vycm9yJ10gPT0gJ1JlcXVlc3RzIHRvbyBvZnRlbicpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHJlc3BvbnNlWydlcnJvciddID09ICdub3QgYXZhaWxhYmxlJykgfHwgKHJlc3BvbnNlWydlcnJvciddID09ICdleHRlcm5hbCBzZXJ2aWNlIHVuYXZhaWxhYmxlJykpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgfVxuXG59XG4iLCJcInVzZSBzdHJpY3RcIjtcblxuLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbmNvbnN0IGFjeCA9IHJlcXVpcmUgKCcuL2FjeC5qcycpXG5cbi8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIHl1bmJpIGV4dGVuZHMgYWN4IHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICd5dW5iaScsXG4gICAgICAgICAgICAnbmFtZSc6ICdZVU5CSScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0NOJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjInLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzEnLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1JyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1JyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnNjAnLFxuICAgICAgICAgICAgICAgICcyaCc6ICcxMjAnLFxuICAgICAgICAgICAgICAgICc0aCc6ICcyNDAnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnNzIwJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMTQ0MCcsXG4gICAgICAgICAgICAgICAgJzNkJzogJzQzMjAnLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxMDA4MCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODU3MDU0OC00ZDY0NmM0MC03MTQ3LTExZTctOWNmNi04MzliOTNlNmQ2MjIuanBnJyxcbiAgICAgICAgICAgICAgICAnZXh0ZW5zaW9uJzogJy5qc29uJywgLy8gZGVmYXVsdCBleHRlbnNpb24gYXBwZW5kZWQgdG8gZW5kcG9pbnQgVVJMc1xuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly95dW5iaS5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly95dW5iaS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3l1bmJpLmNvbS9kb2N1bWVudHMvYXBpL2d1aWRlJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8veXVuYmkuY29tL3N3YWdnZXIvJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrX3dpdGhfcGVuZGluZ190cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpbWVzdGFtcCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWRkcmVzc2VzL3thZGRyZXNzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFydG5lcnMvb3JkZXJzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZW1iZXJzL21lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9teScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2RlbGV0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvbXVsdGknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9jbGVhcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cbn1cbiIsIlwidXNlIHN0cmljdFwiO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbmN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HM6Ly96YWlmLmpwJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cDovL3RlY2hidXJlYXUtYXBpLWRvY3VtZW50LnJlYWR0aGVkb2NzLmlvL2phL2xhdGVzdC9pbmRleC5odG1sJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vY29ycC56YWlmLmpwL2FwaS1kb2NzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vY29ycC56YWlmLmpwL2FwaS1kb2NzL2FwaV9saW5rcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5ucG1qcy5jb20vcGFja2FnZS96YWlmLmpwJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS95b3UyMTk3OS9ub2RlLXphaWYnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY2llcy97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeV9wYWlycy97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5X3BhaXJzL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdF9wcmljZS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZV9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdF9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfaWRfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9pbmZvMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X3BlcnNvbmFsX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZWNhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZUludm9pY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEludm9pY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEludm9pY2VJZHNCeU9yZGVyTnVtYmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxJbnZvaWNlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd0bGFwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X3Bvc2l0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb25faGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWN0aXZlX3Bvc2l0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjaGFuZ2VfcG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9wb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZmFwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdncm91cHMve2dyb3VwX2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdF9wcmljZS97Z3JvdXBfaWR9L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3tncm91cF9pZH0ve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve2dyb3VwX2lkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3tncm91cF9pZH0ve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEN1cnJlbmN5UGFpcnNBbGwgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnY3VycmVuY3lfcGFpciddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXR1cm4nXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlc1snZnVuZHMnXSk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbJ2Z1bmRzJ11bY3VycmVuY3ldO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2UsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKCdkZXBvc2l0JyBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlc1snZGVwb3NpdCddKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBiYWxhbmNlc1snZGVwb3NpdCddW2N1cnJlbmN5XTtcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldERlcHRoUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2spO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlclBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCB2d2FwID0gdGlja2VyWyd2d2FwJ107XG4gICAgICAgIGxldCBiYXNlVm9sdW1lID0gdGlja2VyWyd2b2x1bWUnXTtcbiAgICAgICAgbGV0IHF1b3RlVm9sdW1lID0gYmFzZVZvbHVtZSAqIHZ3YXA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGlja2VyWydoaWdoJ10sXG4gICAgICAgICAgICAnbG93JzogdGlja2VyWydsb3cnXSxcbiAgICAgICAgICAgICdiaWQnOiB0aWNrZXJbJ2JpZCddLFxuICAgICAgICAgICAgJ2Fzayc6IHRpY2tlclsnYXNrJ10sXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGlja2VyWydsYXN0J10sXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc2lkZSA9ICh0cmFkZVsndHJhZGVfdHlwZSddID09ICdiaWQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIGxldCBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdpZCcpO1xuICAgICAgICBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0aWQnLCBpZCk7XG4gICAgICAgIGlmICghbWFya2V0KVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydjdXJyZW5jeV9wYWlyJ11dO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQudG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2Un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AgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzdGF0dXMnOiAnb3BlbicsXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBwcmljZSAqIGFtb3VudCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0cmFkZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJzIChvcmRlcnMsIG1hcmtldCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAob3JkZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG9yZGVyID0gb3JkZXJzW2lkXTtcbiAgICAgICAgICAgIGxldCBleHRlbmRlZCA9IHRoaXMuZXh0ZW5kIChvcmRlciwgeyAnaWQnOiBpZCB9KTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLnBhcnNlT3JkZXIgKGV4dGVuZGVkLCBtYXJrZX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bXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGlmIChhcGkgPT0gJ2VjYXBpJykge1xuICAgICAgICAgICAgICAgIHVybCArPSAnZWNhcGknO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChhcGkgPT0gJ3RsYXBpJykge1xuICAgICAgICAgICAgICAgIHVybCArPSAndGxhcGknO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJ3RhcGknO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdTaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAnYXBpJywgbW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mUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3piJyxcbiAgICAgICAgICAgICduYW1lJzogJ1pCJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQ04nLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMjg1OTE4Ny1jZDUyMTRmMC1jYTVlLTExZTctOTY3ZC05NjU2OGUyZTJiZDEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHA6Ly9hcGkuemIuY29tL2RhdGEnLCAvLyBubyBodHRwcyBmb3IgcHVibGljIEFQSVxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3RyYWRlLnpiLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3RyYWRlLnpiLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuemIuY29tL2kvZGV2ZWxvcGVyJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy56Yi5jb20vaS9yYXRlJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrbGluZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcnNOZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVyc0lnbm9yZVRyYWRlVHlwZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VW5maW5pc2hlZE9yZGVyc0lnbm9yZVRyYWRlVHlwZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QWNjb3VudEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFVzZXJBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRXaXRoZHJhd0FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFdpdGhkcmF3UmVjb3JkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRDaGFyZ2VSZWNvcmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENueVdpdGhkcmF3UmVjb3JkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRDbnlDaGFyZ2VSZWNvcmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRTJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogJzAuMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FDQVNIJzogNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTksnOiAyMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUVic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEJUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0hBVCc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdENOWSc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hMQyc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNXJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBnZXRUcmFkaW5nRmVlRnJvbUJhc2VRdW90ZSAoYmFzZSwgcXVvdGUpIHtcbiAgICAgICAgLy8gYmFzZTogcXVvdGVcbiAgICAgICAgbGV0IGZlZXMgPSB7XG4gICAgICAgICAgICAnQlRDJzogeyAnVVNEVCc6IDAuMCB9LFxuICAgICAgICAgICAgJ0JDSCc6IHsgJ0JUQyc6IDAuMDAxLCAnVVNEVCc6IDAuMDAxIH0sXG4gICAgICAgICAgICAnTFRDJzogeyAnQlRDJzogMC4wMDEsICdVU0RUJzogMC4wIH0sXG4gICAgICAgICAgICAnRVRIJzogeyAnQlRDJzogMC4wMDEsICdVU0RUJzogMC4wIH0sXG4gICAgICAgICAgICAnRVRDJzogeyAnQlRDJzogMC4wMDEsICdVU0RUJzogMC4wIH0sXG4gICAgICAgICAgICAnQlRTJzogeyAnQlRDJzogMC4wMDEsICdVU0RUJzogMC4wMDEgfSxcbiAgICAgICAgICAgICdFT1MnOiB7ICdCVEMnOiAwLjAwMSwgJ1VTRFQnOiAwLjAwMSB9LFxuICAgICAgICAgICAgJ0hTUic6IHsgJ0JUQyc6IDAuMDAxLCAnVVNEVCc6IDAuMDAxIH0sXG4gICA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RoaXMuZ2V0VHJhZGluZ0ZlZUZyb21CYXNlUXVvdGUgKGJhc2UsIHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYW1vdW50U2NhbGUnXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ3ByaWNlU2NhbGUnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdtYWtlcic6IGZlZSxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBmZWUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRBY2NvdW50SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VzWydiYWxhbmNlJ10pXG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCA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5hbWVdID0gbWFya2V0WydpZCddO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlciAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3RpY2tlciddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYnV5J10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnc2VsbCddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBwYXJzZUZsb2F0ICh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5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICB1cmwgKz0gJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgcGF0aDtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgcGFyYW1zTGVuZ3RoID0gcGFyYW1zLmxlbmd0aDsgLy8gcGFyYW1zIHNob3VsZCBiZSBhIHN0cmluZyBoZXJlXG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSAnbWV0aG9kPScgKyBwYXRoO1xuICAgICAgICAgICAgYXV0aCArPSAnJmFjY2Vzc2tleT0nICsgdGhpcy5hcGlLZXk7XG4gICAgICAgICAgICBhdXRoICs9IHBhcmFtc0xlbmd0aCA/IHBhcmFtcyA6ICcnO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuaGFzaCAodGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTEnKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHNlY3JldCksICdtZDUnKTtcbiAgICAgICAgICAgIGxldCBzdWZmaXggPSAnc2lnbj0nICsgc2lnbmF0dXJlICsgJyZyZXFUaW1lPScgKyBub25jZS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIHVybCArPSAnLycg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gIGZvciAodmFyIGkgPSAwOyBpIDwgMjU2OyBpKyspIHtcblx0ICAgICAgICAgICAgaWYgKGkgPCAxMjgpIHtcblx0ICAgICAgICAgICAgICAgIGRbaV0gPSBpIDw8IDE7XG5cdCAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICBkW2ldID0gKGkgPDwgMSkgXiAweDExYjtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblxuXHQgICAgICAgIC8vIFdhbGsgR0YoMl44KVxuXHQgICAgICAgIHZhciB4ID0gMDtcblx0ICAgICAgICB2YXIgeGkgPSAwO1xuXHQgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjU2OyBpKyspIHtcblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBzYm94XG5cdCAgICAgICAgICAgIHZhciBzeCA9IHhpIF4gKHhpIDw8IDEpIF4gKHhpIDw8IDIpIF4gKHhpIDw8IDMpIF4gKHhpIDw8IDQpO1xuXHQgICAgICAgICAgICBzeCA9IChzeCA+Pj4gOCkgXiAoc3ggJiAweGZmKSBeIDB4NjM7XG5cdCAgICAgICAgICAgIFNCT1hbeF0gPSBzeDtcblx0ICAgICAgICAgICAgSU5WX1NCT1hbc3hdID0geDtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIG11bHRpcGxpY2F0aW9uXG5cdCAgICAgICAgICAgIHZhciB4MiA9IGRbeF07XG5cdCAgICAgICAgICAgIHZhciB4NCA9IGRbeDJdO1xuXHQgICAgICAgICAgICB2YXIgeDggPSBkW3g0XTtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIHN1YiBieXRlcywgbWl4IGNvbHVtbnMgdGFibGVzXG5cdCAgICAgICAgICAgIHZhciB0ID0gKGRbc3hdICogMHgxMDEpIF4gKHN4ICogMHgxMDEwMTAwKTtcblx0ICAgICAgICAgICAgU1VCX01JWF8wW3hdID0gKHQgPDwgMjQpIHwgKHQgPj4+IDgpO1xuXHQgICAgICAgICA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ZXlTY2hlZHVsZSA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBrc1JvdyA9IDA7IGtzUm93IDwga3NSb3dzOyBrc1JvdysrKSB7XG5cdCAgICAgICAgICAgICAgICBpZiAoa3NSb3cgPCBrZXlTaXplKSB7XG5cdCAgICAgICAgICAgICAgICAgICAga2V5U2NoZWR1bGVba3NSb3ddID0ga2V5V29yZHNba3NSb3ddO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGtleVNjaGVkdWxlW2tzUm93IC0gMV07XG5cblx0ICAgICAgICAgICAgICAgICAgICBpZiAoIShrc1JvdyAlIGtleVNpemUpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJvdCB3b3JkXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAodCA8PCA4KSB8ICh0ID4+PiAyNCk7XG5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgLy8gU3ViIHdvcmRcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdCA9IChTQk9YW3QgPj4+IDI0XSA8PCAyNCkgfCAoU0JPWFsodCA+Pj4gMTYpICYgMHhmZl0gPDwgMTYpIHwgKFNCT1hbKHQgPj4+IDgpICYgMHhmZl0gPDwgOCkgfCBTQk9YW3QgJiAweGZmXTtcblxuXHQgICAgICAgICAgICAgICAgICAgICAgICAvLyBNaXggUmNvblxuXHQgICAgICAgICAgICAgICAgICAgICAgICB0IF49IFJDT05bKGtzUm93IC8ga2V5U2l6ZSkgfCAwXSA8PCAyNDtcblx0ICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtleVNpemUgPiA2ICYmIGtzUm93ICUga2V5U2l6ZSA9PSA0KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN1YiB3b3JkXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAoU0JPWFt0ID4+PiAyNF0gPDwgMjQpIHwgKFNCT1hbKHQgPj4+IDE2KSAmIDB4ZmZdIDw8IDE2KSB8IChTQk9YWyh0ID4+PiA4KSAmIDB4ZmZdIDw8IDgpIHwgU0JPWFt0ICYgMHhmZl07XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAgICAga2V5U2NoZWR1bGVba3NSb3ddID0ga2V5U2NoZWR1bGVba3NSb3cgLSBrZXlTaXplXSBeIHQ7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIGludiBrZXkgc2NoZWR1bGVcblx0ICAgICAgICAgICAgdmFyIGludktleVNjaGVkdWxlID0gdGhpcy5faW52S2V5U2NoZWR1bGUgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaW52S3NSb3cgPSAwOyBpbnZLc1JvdyA8IGtzUm93czsgaW52S3NSb3crKykge1xuXHQgICAgICAgICAgICAgICAgdmFyIGtzUm93ID0ga3NSb3dzIC0gaW52S3NSb3c7XG5cblx0ICAgICAgICAgICAgICAgIGlmIChpbnZLc1JvdyAlIDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGtleVNjaGVkdWxlW2tzUm93XTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHQgPSBrZXlTY2hlZHVsZVtrc1JvdyAtIDRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICBpZiAoaW52S3NSb3cgPCA0IHx8IGtzUm93IDw9IDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICBpbnZLZXlTY2hlZHVsZVtpbnZLc1Jvd10gPSB0O1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICBpbnZLZXlTY2hlZHVsZVtpbnZLc1Jvd10gPSBJTlZfU1VCX01JWF8wW1NCT1hbdCA+P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dCAgICAgICAgICAgIGZ1bmN0aW9uIHNlbGVjdENpcGhlclN0cmF0ZWd5KGtleSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBrZXkgPT0gJ3N0cmluZycpIHtcblx0ICAgICAgICAgICAgICAgICAgICByZXR1cm4gUGFzc3dvcmRCYXNlZENpcGhlcjtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNlcmlhbGl6YWJsZUNpcGhlcjtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAoY2lwaGVyKSB7XG5cdCAgICAgICAgICAgICAgICByZXR1cm4ge1xuXHQgICAgICAgICAgICAgICAgICAgIGVuY3J5cHQ6IGZ1bmN0aW9uIChtZXNzYWdlLCBrZXksIGNmZykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2VsZWN0Q2lwaGVyU3RyYXRlZ3koa2V5KS5lbmNyeXB0KGNpcGhlciwgbWVzc2FnZSwga2V5LCBjZmcpO1xuXHQgICAgICAgICAgICAgICAgICAgIH0sXG5cblx0ICAgICAgICAgICAgICAgICAgICBkZWNyeXB0OiBmdW5jdGlvbiAoY2lwaGVydGV4dCwga2V5LCBjZmcpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNlbGVjdENpcGhlclN0cmF0ZWd5KGtleSkuZGVjcnlwdChjaXBoZXIsIGNpcGhlcnRleHQsIGtleSwgY2ZnKTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9O1xuXHQgICAgICAgICAgICB9O1xuXHQgICAgICAgIH0oKSlcblx0ICAgIH0pO1xuXG5cdCAgICAvKipcblx0ICAgICAqIEFic3RyYWN0IGJhc2Ugc3RyZWFtIGNpcGhlciB0ZW1wbGF0ZS5cblx0ICAgICAqXG5cdCAg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gVGhlIElWIHdvcmRzLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgbW9kZSA9IENyeXB0b0pTLm1vZGUuQ0JDLmNyZWF0ZUVuY3J5cHRvcihjaXBoZXIsIGl2LndvcmRzKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBjcmVhdGVFbmNyeXB0b3I6IGZ1bmN0aW9uIChjaXBoZXIsIGl2KSB7XG5cdCAgICAgICAgICAgIHJldHVybiB0aGlzLkVuY3J5cHRvci5jcmVhdGUoY2lwaGVyLCBpdik7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENyZWF0ZXMgdGhpcyBtb2RlIGZvciBkZWNyeXB0aW9uLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtDaXBoZXJ9IGNpcGhlciBBIGJsb2NrIGNpcGhlciBpbnN0YW5jZS5cblx0ICAgICAgICAgKiBAcGFyYW0ge0FycmF5fSBpdiBUaGUgSVYgd29yZHMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBtb2RlID0gQ3J5cHRvSlMubW9kZS5DQkMuY3JlYXRlRGVjcnlwdG9yKGNpcGhlciwgaXYud29yZHMpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGNyZWF0ZURlY3J5cHRvcjogZnVuY3Rpb24gKGNpcGhlciwgaXYpIHtcblx0ICAgICAgICAgICAgcmV0dXJuIHRoaXMuRGVjcnlwdG9yLmNyZWF0ZShjaXBoZXIsIGl2KTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICog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ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtBcnJheX0gd29yZHMgVGhlIGRhdGEgd29yZHMgdG8gb3BlcmF0ZSBvbi5cblx0ICAgICAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IG9mZnNldCBUaGUgb2Zmc2V0IHdoZXJlIHRoZSBibG9jayBzdGFydHMuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBtb2RlLnByb2Nlc3NCbG9jayhkYXRhLndvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgcHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAod29yZHMsIG9mZnNldCkge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgY2lwaGVyID0gdGhpcy5fY2lwaGVyO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrU2l6ZSA9IGNpcGhlci5ibG9ja1NpemU7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFhPUiBhbmQgZW5jcnlwdFxuXHQgICAgICAgICAgICAgICAgeG9yQmxvY2suY2FsbCh0aGlzLCB3b3Jkcywgb2Zmc2V0LCBibG9ja1NpemUpO1xuXHQgICAgICAgICAgICAgICAgY2lwaGVyLmVuY3J5cHRCbG9jayh3b3Jkcywgb2Zmc2V0KTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVtZW1iZXIgdGhpcyBibG9jayB0byB1c2Ugd2l0aCBuZXh0IGJsb2NrXG5cdCAgICAgICAgICAgICAgICB0aGlzLl9wcmV2QmxvY2sgPSB3b3Jkcy5zbGljZShvZmZzZXQsIG9mZnNldCArIGJsb2NrU2l6ZSk7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9KTtcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENCQyBkZWNyeXB0b3IuXG5cdCAgICAgICAgICovXG5cdCAgICAgICAgQ0JDLkRlY3J5cHRvciA9IENCQy5leHRlbmQoe1xuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogUHJvY2Vzc2VzIHRoZSBkYXRhIGJsb2NrIGF0IG9mZnNldC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtBcnJheX0gd29yZHMgVGhlIGRhdGEgd29yZHMgdG8gb3BlcmF0ZSBvbi5cblx0ICAgICAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IG9mZnNldCBUaGUgb2Zmc2V0IHdoZXJlIHRoZSBibG9jayBzdGFydHMuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBtb2RlLnByb2Nlc3NCbG9jayhkYXRhLndvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgcHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAod29yZHMsIG9mZnNldCkge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgY2lwaGVyID0gdGhpcy5fY2lwaGVyO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrU2l6ZSA9IGNpcGhlci5ibG9ja1NpemU7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJlbWVtYmVyIHRoaXMgYmxvY2sgdG8gdXNlIHdpdGggbmV4dCBibG9ja1xuXHQgICAgICAgICAgICAgICAgdmFyIHRoaXNCbG9jayA9IHdvcmRzLnNsaWNlKG9mZnNldCwgb2Zmc2V0ICsgYmxvY2tTaXplKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gRGVjcnlwdCBhbmQgWE9SXG5cdCAgICAgICAgICAgICAgICBjaXBoZXIuZGVjcnlwdEJsb2NrKHdvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgICAgeG9yQmxvY2suY2FsbCh0aGlzLCB3b3Jkcywgb2Zmc2V0LCBibG9ja1NpemUpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBUaGlzIGJsb2NrIGJlY29tZXMgdGhlIHByZXZpb3VzIGJsb2NrXG5cdCAgICAgICAgICAgICAgICB0aGlzLl9wcmV2QmxvY2sgPSB0aGlzQmxvY2s7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9KTtcblxuXHQgICAgICAgIGZ1bmN0aW9uIHhvckJsb2NrKHdvcmRzLCBvZmZzZXQsIGJsb2NrU2l6ZSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgaXYgPSB0aGlzLl9pdjtcblxuXHQgICAgICAgICAgICAvLyBDaG9vc2UgbWl4aW5nIGJsb2NrXG5cdCAgICAgICAgICAgIGlmIChpdikge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gaXY7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJlbW92ZSBJViBmb3Igc3Vic2VxdWVudCBibG9ja3Ncblx0ICAgICAgICAgICAgICAgIHRoaXMuX2l2ID0gdW5kZWZpbmVkO1xuXHQgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gdGhpcy5fcHJldkJsb2NrO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gWE9SIGJsb2Nrc1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGJsb2NrU2l6ZTsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tvZmZzZXQgKyBpXSBePSBibG9ja1tpXTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblxuXHQgICAgICAgIHJldHVybiBDQkM7XG5cdCAgICB9KCkpO1xuXG5cdC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AgICAgICogICAgICAgICBhbGdvcml0aG06IENyeXB0b0pTLmFsZ28uQUVTLFxuXHQgICAgICAgICAqICAgICAgICAgbW9kZTogQ3J5cHRvSlMubW9kZS5DQkMsXG5cdCAgICAgICAgICogICAgICAgICBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUEtDUzcsXG5cdCAgICAgICAgICogICAgICAgICBibG9ja1NpemU6IDQsXG5cdCAgICAgICAgICogICAgICAgICBmb3JtYXR0ZXI6IENyeXB0b0pTLmZvcm1hdC5PcGVuU1NMXG5cdCAgICAgICAgICogICAgIH0pO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGluaXQ6IGZ1bmN0aW9uIChjaXBoZXJQYXJhbXMpIHtcblx0ICAgICAgICAgICAgdGhpcy5taXhJbihjaXBoZXJQYXJhbXMpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyB0aGlzIGNpcGhlciBwYXJhbXMgb2JqZWN0IHRvIGEgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtGb3JtYXR9IGZvcm1hdHRlciAoT3B0aW9uYWwpIFRoZSBmb3JtYXR0aW5nIHN0cmF0ZWd5IHRvIHVzZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIHN0cmluZ2lmaWVkIGNpcGhlciBwYXJhbXMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAdGhyb3dzIEVycm9yIElmIG5laXRoZXIgdGhlIGZvcm1hdHRlciBub3IgdGhlIGRlZmF1bHQgZm9ybWF0dGVyIGlzIHNldC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHN0cmluZyA9IGNpcGhlclBhcmFtcyArICcnO1xuXHQgICAgICAgICAqICAgICB2YXIgc3RyaW5nID0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fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBMaWJyYXJ5IG5hbWVzcGFjZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIENfbGliID0gQy5saWIgPSB7fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBCYXNlIG9iamVjdCBmb3IgcHJvdG90eXBhbCBpbmhlcml0YW5jZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIEJhc2UgPSBDX2xpYi5CYXNlID0gKGZ1bmN0aW9uICgpIHtcblxuXG5cdCAgICAgICAgcmV0dXJuIHtcblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIENyZWF0ZXMgYSBuZXcgb2JqZWN0IHRoYXQgaW5oZXJpdHMgZnJvbSB0aGlzIG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IG92ZXJyaWRlcyBQcm9wZXJ0aWVzIHRvIGNvcHkgaW50byB0aGUgbmV3IG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHJldHVybiB7T2JqZWN0fSBUaGUgbmV3IG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiAgICAgdmFyIE15VHlwZSA9IENyeXB0b0pTLmxpYi5CYXNlLmV4dGVuZCh7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgZmllbGQ6ICd2YWx1ZScsXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICAgICAgbWV0aG9kOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgfVxuXHQgICAgICAgICAgICAgKiAgICAgfSk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBleHRlbmQ6IGZ1bmN0aW9uIChvdmVycmlkZXMpIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNwYXduXG5cdCAgICAgICAgICAgICAgICB2YXIgc3VidHlwZSA9IGNyZWF0ZSh0aGlzKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gQXVnbWVudFxuXHQgICAgICAgICAgICAgICAgaWYgKG92ZXJyaWRlcykge1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YnR5cGUubWl4SW4ob3ZlcnJpZGVzKTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIGRlZmF1bHQgaW5pdGlhbGl6ZXJcblx0ICAgICAgICAgICAgICAgIGlmICghc3VidHlwZS5oYXNPd25Qcm9wZXJ0eSgnaW5pdCcpIHx8IHRoaXMuaW5pdCA9PT0gc3VidHlwZS5pbml0KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgc3VidHlwZS5pbml0ID0gZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0eXBlLiRzdXBlci5pbml0LmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG5cdCAgICAgICAgICAgICAgICAgICAgfTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gSW5pdGlhbGl6ZXIncyBwcm90b3R5cGUgaXMgdGhlIHN1YnR5cGUgb2JqZWN0XG5cdCAgICAgICAgICAgICAgICBzdWJ0eXBlLmluaXQucHJvdG90eXBlID0gc3VidHlwZTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVmZXJlbmNlIHN1cGVydHlwZVxuXHQgICAgICAgICAgICAgICAgc3VidHlwZS4kc3VwZXIgPSB0aGlzO1xuXG5cdCAgICAgICAgICAgICAgICByZXR1cm4gc3VidHlwZTtcblx0ICAgICAgICAgICAgfSxcblxuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogRXh0ZW5kcyB0aGlzIG9iamVjdCBhbmQgcnVucyB0aGUgaW5pdCBtZXRob2QuXG5cdCAgICAgICAgICAgICAqIEFyZ3VtZW50cyB0byBjcmVhdGUoKSB3aWxsIGJlIHBhc3NlZCB0byBpbml0KCkuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEByZXR1cm4ge09iamVjdH0gVGhlIG5ldyBvYmplY3QuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIHZhciBpbnN0YW5jZSA9IE15VHlwZS5jcmVhdGUoKTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIGNyZWF0ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgdmFyIGluc3RhbmNlID0gdGhpcy5leHRlbmQoKTtcblx0ICAgICAgICAgICAgICAgIGluc3RhbmNlLmluaXQuYXBwbHkoaW5zdGFuY2UsIGFyZ3VtZW50cyk7XG5cblx0ICAgICAgICAgICAgICAgIHJldHVybiBpbnN0YW5jZTtcblx0ICAgICAgICAgICAgfSxcblxuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogSW5pdGlhbGl6ZXMgYSBuZXdseSBjcmVhdGVkIG9iamVjdC5cblx0ICAgICAgICAgICAgICogT3ZlcnJpZGUgdGhpcyBtZXRob2QgdG8gYWRkIHNvbWUgbG9naWMgd2hlbiB5b3VyIG9iamVjdHMgYXJlIGNyZWF0ZWQuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICB2YXIgTXlUeXBlID0gQ3J5cHRvSlMubGliLkJhc2UuZXh0ZW5kKHtcblx0ICAgICAgICAgICAgICogICAgICAgICBpbml0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgICAgIC8vIC4uLlxuXHQgICAgICAgICAgICAgKiAgICAgICAgIH1cblx0ICAgICAgICAgICAgICogICAgIH0pO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgaW5pdDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICB9LFxuXG5cdCAgICAgICAgICAgIC8qKlxuXHQgICAgICAgICAgICAgKiBDb3BpZXMgcHJvcGVydGllcyBpbnRvIHRoaXMgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gcHJvcGVydGllcyBUaGUgcHJvcGVydGllcyB0byBtaXggaW4uXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBNeVR5cGUubWl4SW4oe1xuXHQgICAgICAgICAgICAgKiAgICAgICAgIGZpZWxkOiAndmFsdWUnXG5cdCAgICAgICAgICAgICAqICAgICB9KTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIG1peEluOiBmdW5jdGlvbiAocHJvcGVydGllcykge1xuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgcHJvcGVydHlOYW1lIGluIHByb3BlcnRpZXMpIHtcblx0ICAgICAgICAgICAgICAgICAgICBpZiAocHJvcGVydGllcy5oYXNPd25Qcm9wZXJ0eShwcm9wZXJ0eU5hbWUpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNbcHJvcGVydHlOYW1lXSA9IHByb3BlcnRpZXNbcHJvcGVydHlOYW1lXTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIElFIHdvbid0IGNvcHkgdG9TdHJpbmcgdXNpbmcgdGhlIGxvb3AgYWJvdmVcblx0ICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0aWVzLmhhc093blByb3BlcnR5KCd0b1N0cmluZycpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdGhpcy50b1N0cmluZyA9IHByb3BlcnRpZXMudG9TdHJpbmc7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH0sXG5cblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIENyZWF0ZXMgYSBjb3B5IG9mIHRoaXMgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAcmV0dXJuIHtPYmplY3R9IFRoZSBjbG9uZS5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIHZhciBjbG9uZSA9IGluc3RhbmNlLmNsb25lKCk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBjbG9uZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuaW5pdC5wcm90b3R5cGUuZXh0ZW5kKHRoaXMpO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfTtcblx0ICAgIH0oKSk7XG5cblx0ICAgIC8qKlxuXHQgICAgICogQW4gYXJyYXkgb2YgMzItYml0IHdvcmRzLlxuXHQgICAgICpcblx0ICAgICAqIEBwcm9wZXJ0eSB7QXJyYXl9IHdvcmRzIFRoZSBhcnJheSBvZiAzMi1iaXQgd29yZHMuXG5cdCAgICAgKiBAcHJvcGVydHkge251bWJlcn0gc2lnQnl0ZXMgVGhlIG51bWJlciBvZiBzaWduaWZpY2FudCBieXRlcyBpbiB0aGlzIHdvcmQgYXJyYXkuXG5cdCAgICAgKi9cblx0ICAgIHZhciBXb3JkQXJyYXkgPSBDX2xpYi5Xb3JkQXJyYXkgPSBCYXNlLmV4dGVuZCh7XG5cdCAgICAgICAg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gICB9XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIHRoaXMgd29yZCBhcnJheSB0byBhIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7RW5jb2Rlcn0gZW5jb2RlciAoT3B0aW9uYWwpIFRoZSBlbmNvZGluZyBzdHJhdGVneSB0byB1c2UuIERlZmF1bHQ6IENyeXB0b0pTLmVuYy5IZXhcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIHN0cmluZ2lmaWVkIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBzdHJpbmcgPSB3b3JkQXJyYXkgKyAnJztcblx0ICAgICAgICAgKiAgICAgdmFyIHN0cmluZyA9IHdvcmRBcnJheS50b1N0cmluZygpO1xuXHQgICAgICAgICAqICAgICB2YXIgc3RyaW5nID0gd29yZEFycmF5LnRvU3RyaW5nKENyeXB0b0pTLmVuYy5VdGY4KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICB0b1N0cmluZzogZnVuY3Rpb24gKGVuY29kZXIpIHtcblx0ICAgICAgICAgICAgcmV0dXJuIChlbmNvZGVyIHx8IEhleCkuc3RyaW5naWZ5KHRoaXMpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb25jYXRlbmF0ZXMgYSB3b3JkIGFycmF5IHRvIHRoaXMgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fSB3b3JkQXJyYXkgVGhlIHdvcmQgYXJyYXkgdG8gYXBwZW5kLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGlzIHdvcmQgYXJyYXk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XHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDcmVhdGVzIGEgY29weSBvZiB0aGlzIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSBjbG9uZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGNsb25lID0gd29yZEFycmF5LmNsb25lKCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIGNsb25lID0gQmFzZS5jbG9uZS5jYWxsKHRoaXMpO1xuXHQgICAgICAgICAgICBjbG9uZS53b3JkcyA9IHRoaXMud29yZHMuc2xpY2UoMCk7XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGNsb25lO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDcmVhdGVzIGEgd29yZCBhcnJheSBmaWxsZWQgd2l0aCByYW5kb20gYnl0ZXMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbkJ5dGVzIFRoZSBudW1iZXIgb2YgcmFuZG9tIGJ5dGVzIHRvIGdlbmVyYXRlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgcmFuZG9tIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5saWIuV29yZEFycmF5LnJhbmRvbSgxNik7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcmFuZG9tOiBmdW5jdGlvbiAobkJ5dGVzKSB7XG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IFtdO1xuXG5cdCAgICAgICAgICAgIHZhciByID0gKGZ1bmN0aW9uIChtX3cpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBtX3cgPSBtX3c7XG5cdCAgICAgICAgICAgICAgICB2YXIgbV96ID0gMHgzYWRlNjhiMTtcblx0ICAgICAgICAgICAgICAgIHZhciBtYXNrID0gMHhmZmZmZmZmZjtcblxuXHQgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgICAgICAgICBtX3ogPSAoMHg5MDY5ICogKG1feiAmIDB4RkZGRikgKyAobV96ID4+IDB4MTApKSAmIG1hc2s7XG5cdCAgICAgICAgICAgICAgICAgICAgbV93ID0gKDB4NDY1MCAqIChtX3cgJiAweEZGRkYpICsgKG1fdyA+PiAweDEwKSkgJiBtYXNrO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciByZXN1bHQgPSAoKG1feiA8PCAweDEwKSArIG1fdykgJiBtYXNrO1xuXHQgICAgICAgICAgICAgICAgICAgIHJlc3VsdCAvPSAweDEwMDAwMDAwMDtcblx0ICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gMC41O1xuXHQgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKiAoTWF0aC5yYW5kb20oKSA+IC41ID8gMSA6IC0xKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfSk7XG5cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDAsIHJjYWNoZTsgaSA8IG5CeXRlczsgaSArPSA0KSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgX3IgPSByKChyY2FjaGUgfHwgTWF0aC5yYW5kb20oKSkgKiAweDEwMDAwMDAwMCk7XG5cblx0ICAgICAgICAgICAgICAgIHJjYWNoZSA9IF9yKCkgKiAweDNhZGU2N2I3O1xuXHQgICAgICAgICAgICAgICAgd29yZHMucHVzaCgoX3IoKSAqIDB4MTAwMDAwMDAwKSB8IDApO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIG5ldyBXb3JkQXJyYXkuaW5pdCh3b3JkcywgbkJ5dGVzKTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBFbmNvZGVyIG5hbWVzcGFjZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIENfZW5jID0gQy5lbmMgPSB7fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBIZXggZW5jb2Rpbmcgc3RyYXRlZ3kuXG5cdCAgICAgKi9cblx0ICAgIHZhciBIZXggPSBDX2VuYy5IZXggPSB7XG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSB3b3JkIGFycmF5IHRvIGEgaGV4IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fSB3b3JkQXJyYXkgVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtzdHJpbmd9IFRoZSBoZXggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgaGV4U3RyaW5nID0gQ3J5cHRvSlMuZW5jLkhleC5zdHJpbmdpZnkod29yZEFycmF5KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBzdHJpbmdpZnk6IGZ1bmN0aW9uICh3b3JkQXJyYXkpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IHdvcmRBcnJheS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNpZ0J5dGVzID0gd29yZEFycmF5LnNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIENvbnZlcnRcblx0ICAgICAgICAgICAgdmFyIGhleENoYXJzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2lnQnl0ZXM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJpdGUgPSAod29yZHNbaSA+Pj4gMl0gPj4+ICgyNCAtIChpICUgNCkgKiA4KSkgJiAweGZmO1xuXHQgICAgICAgICAgICAgICAgaGV4Q2hhcnMucHVzaCgoYml0ZSA+Pj4gNCkudG9TdHJpbmcoMTYpKTtcblx0ICAgICAgICAgICAgICAgIGhleENoYXJzLnB1c2goKGJpdGUgJiAweDBmKS50b1N0cmluZygxNikpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGhleENoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIGhleCBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IGhleFN0ciBUaGUgaGV4IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1dvcmRBcnJheX0gVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5lbmMuSGV4LnBhcnNlKGhleFN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChoZXhTdHIpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgdmFyIGhleFN0ckxlbmd0aCA9IGhleFN0ci5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBoZXhTdHJMZW5ndGg7IGkgKz0gMikge1xuXHQgICAgICAgICAgICAgICAgd29yZHNbaSA+Pj4gM10gfD0gcGFyc2VJbnQoaGV4U3RyLnN1YnN0cihpLCAyKSwgMTYpIDw8ICgyNCAtIChpICUgOCkgKiA0KTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBuZXcgV29yZEFycmF5LmluaXQod29yZHMsIGhleFN0ckxlbmd0aCAvIDIpO1xuXHQgICAgICAgIH1cblx0ICAgIH07XG5cblx0ICAgIC8qKlxuXHQgICAgICogTGF0aW4xIGVuY29kaW5nIHN0cmF0ZWd5LlxuXHQgICAgICovXG5cdCAgICB2YXIgTGF0aW4xID0gQ19lbmMuTGF0aW4xID0ge1xuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgd29yZCBhcnJheSB0byBhIExhdGluMSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgTGF0aW4xIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGxhdGluMVN0cmluZyA9IENyeXB0b0pTLmVuYy5MYXRpbjEuc3RyaW5naWZ5KHdvcmRBcnJheSk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgc3RyaW5naWZ5OiBmdW5jdGlvbiAod29yZEFycmF5KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSB3b3JkQXJyYXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBzaWdCeXRlcyA9IHdvcmRBcnJheS5zaWdCeXRlcztcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciBsYXRpbjFDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciBiaXRlID0gKHdvcmRzW2kgPj4+IDJdID4+PiAoMjQgLSAoaSAlIDQpICogOCkpICYgMHhmZjtcblx0ICAgICAgICAgICAgICAgIGxhdGluMUNoYXJzLnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShiaXRlKSk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gbGF0aW4xQ2hhcnMuam9pbignJyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgTGF0aW4xIHN0cmluZyB0byBhIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbGF0aW4xU3RyIFRoZSBMYXRpbjEgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5MYXRpbjEucGFyc2UobGF0aW4xU3RyaW5nKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBwYXJzZTogZnVuY3Rpb24gKGxhdGluMVN0cikge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgbGF0aW4xU3RyTGVuZ3RoID0gbGF0aW4xU3RyLmxlbmd0aDtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxhdGluMVN0ckxlbmd0aDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tpID4+PiAyXSB8PSAobGF0aW4xU3RyLmNoYXJDb2RlQXQoaSkgJiAweGZmKSA8PCAoMjQgLSAoaSAlIDQpICogOCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gbmV3IFdvcmRBcnJheS5pbml0KHdvcmRzLCBsYXRpbjFTdHJMZW5ndGgpO1xuXHQgICAgICAgIH1cblx0ICAgIH07XG5cblx0ICAgIC8qKlxuXHQgICAgICogVVRGLTggZW5jb2Rpbmcgc3RyYXRlZ3kuXG5cdCAgICAgKi9cblx0ICAgIHZhciBVdGY4ID0gQ19lbmMuVXRmOCA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBVVEYtOCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgVVRGLTggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgdXRmOFN0cmluZyA9IENyeXB0b0pTLmVuYy5VdGY4LnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICB0cnkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIGRlY29kZVVSSUNvbXBvbmVudChlc2NhcGUoTGF0aW4xLnN0cmluZ2lmeSh3b3JkQXJyYXkpKSk7XG5cdCAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcblx0ICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignTWFsZm9ybWVkIFVURi04IGRhdGEnKTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi04IHN0cmluZyB0byBhIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gdXRmOFN0ciBUaGUgVVRGLTggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKHV0ZjhTdHJpbmcpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHBhcnNlOiBmdW5jdGlvbiAodXRmOFN0cikge1xuXHQgICAgICAgICAgICByZXR1cm4gTGF0aW4xLnBhcnNlKHVuZXNjYXBlKGVuY29kZVVSSUNvbXBvbmVudCh1dGY4U3RyKSkpO1xuXHQgICAgICAgIH1cblx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UsIGNmZykge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBoYXNoZXIuaW5pdChjZmcpLmZpbmFsaXplKG1lc3NhZ2UpO1xuXHQgICAgICAgICAgICB9O1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDcmVhdGVzIGEgc2hvcnRjdXQgZnVuY3Rpb24gdG8gdGhlIEhNQUMncyBvYmplY3QgaW50ZXJmYWNlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtIYXNoZXJ9IGhhc2hlciBUaGUgaGFzaGVyIHRvIHVzZSBpbiB0aGlzIEhNQUMgaGVscGVyLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7RnVuY3Rpb259IFRoZSBzaG9ydGN1dCBmdW5jdGlvbi5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIEhtYWNTSEEyNTYgPSBDcnlwdG9KUy5saWIuSGFzaGVyLl9jcmVhdGVIbWFjSGVscGVyKENyeXB0b0pTLmFsZ28uU0hBMjU2KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBfY3JlYXRlSG1hY0hlbHBlcjogZnVuY3Rpb24gKGhhc2hlcikge1xuXHQgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKG1lc3NhZ2UsIGtleSkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBDX2FsZ28uSE1BQy5pbml0KGhhc2hlciwga2V5KS5maW5hbGl6ZShtZXNzYWdlKTtcblx0ICAgICAgICAgICAgfTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBBbGdvcml0aG0gbmFtZXNwYWNlLlxuXHQgICAgICovXG5cdCAgICB2YXIgQ19hbG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JyYXl9IHdvcmRBcnJheSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIEJhc2U2NCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBiYXNlNjRTdHJpbmcgPSBDcnlwdG9KUy5lbmMuQmFzZTY0LnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gd29yZEFycmF5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB3b3JkQXJyYXkuc2lnQnl0ZXM7XG5cdCAgICAgICAgICAgIHZhciBtYXAgPSB0aGlzLl9tYXA7XG5cblx0ICAgICAgICAgICAgLy8gQ2xhbXAgZXhjZXNzIGJpdHNcblx0ICAgICAgICAgICAgd29yZEFycmF5LmNsYW1wKCk7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgYmFzZTY0Q2hhcnMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzaWdCeXRlczsgaSArPSAzKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgYnl0ZTEgPSAod29yZHNbaSA+Pj4gMl0gICAgICAgPj4+ICgyNCAtIChpICUgNCkgKiA4KSkgICAgICAgJiAweGZmO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJ5dGUyID0gKHdvcmRzWyhpICsgMSkgPj4+IDJdID4+PiAoMjQgLSAoKGkgKyAxKSAlIDQpICogOCkpICYgMHhmZjtcblx0ICAgICAgICAgICAgICAgIHZhciBieXRlMyA9ICh3b3Jkc1soaSArIDIpID4+PiAyXSA+Pj4gKDI0IC0gKChpICsgMikgJSA0KSAqIDgpKSAmIDB4ZmY7XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0cmlwbGV0ID0gKGJ5dGUxIDw8IDE2KSB8IChieXRlMiA8PCA4KSB8IGJ5dGUzO1xuXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgKGogPCA0KSAmJiAoaSArIGogKiAwLjc1IDwgc2lnQnl0ZXMpOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICBiYXNlNjRDaGFycy5wdXNoKG1hcC5jaGFyQXQoKHRyaXBsZXQgPj4+ICg2ICogKDMgLSBqKSkpICYgMHgzZikpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQWRkIHBhZGRpbmdcblx0ICAgICAgICAgICAgdmFyIHBhZGRpbmdDaGFyID0gbWFwLmNoYXJBdCg2NCk7XG5cdCAgICAgICAgICAgIGlmIChwYWRkaW5nQ2hhcikge1xuXHQgICAgICAgICAgICAgICAgd2hpbGUgKGJhc2U2NENoYXJzLmxlbmd0aCAlIDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICBiYXNlNjRDaGFycy5wdXNoKHBhZGRpbmdDaGFyKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBiYXNlNjRDaGFycy5qb2luKCcnKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSBCYXNlNjQgc3RyaW5nIHRvIGEgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBiYXNlNjRTdHIgVGhlIEJhc2U2NCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMuZW5jLkJhc2U2NC5wYXJzZShiYXNlNjRTdHJpbmcpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoYmFzZTY0U3RyKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgYmFzZTY0U3RyTGVuZ3RoID0gYmFzZTY0U3RyLmxlbmd0aDtcblx0ICAgICAgICAgICAgdmFyIG1hcCA9IHRoaXMuX21hcDtcblx0ICAgICAgICAgICAgdmFyIHJldmVyc2VNYXAgPSB0aGlzLl9yZXZlcnNlTWFwO1xuXG5cdCAgICAgICAgICAgIGlmICghcmV2ZXJzZU1hcCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHJldmVyc2VNYXAgPSB0aGlzLl9yZXZlcnNlTWFwID0gW107XG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBtYXAubGVuZ3RoOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgcmV2ZXJzZU1hcFttYXAuY2hhckNvZGVBdChqKV0gPSBqO1xuXHQgICAgICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIElnbm9yZSBwYWRkaW5nXG5cdCAgICAgICAgICAgIHZhciBwYWRkaW5nQ2hhciA9IG1hcC5jaGFyQXQoNjQpO1xuXHQgICAgICAgICAgICBpZiAocGFkZGluZ0NoYXIpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBwYWRkaW5nS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mMTYgPSBDX2VuYy5VdGYxNkJFID0ge1xuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgd29yZCBhcnJheSB0byBhIFVURi0xNiBCRSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgVVRGLTE2IEJFIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHV0ZjE2U3RyaW5nID0gQ3J5cHRvSlMuZW5jLlV0ZjE2LnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gd29yZEFycmF5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB3b3JkQXJyYXkuc2lnQnl0ZXM7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgdXRmMTZDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpICs9IDIpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBjb2RlUG9pbnQgPSAod29yZHNbaSA+Pj4gMl0gPj4+ICgxNiAtIChpICUgNCkgKiA4KSkgJiAweGZmZmY7XG5cdCAgICAgICAgICAgICAgICB1dGYxNkNoYXJzLnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShjb2RlUG9pbnQpKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiB1dGYxNkNoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi0xNiBCRSBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IHV0ZjE2U3RyIFRoZSBVVEYtMTYgQkUgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5VdGYxNi5wYXJzZSh1dGYxNlN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uICh1dGYxNlN0cikge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgdXRmMTZTdHJMZW5ndGggPSB1dGYxNlN0ci5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB1dGYxNlN0ckxlbmd0aDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tpID4+PiAxXSB8PSB1dGYxNlN0ci5jaGFyQ29kZUF0KGkpIDw8ICgxNiAtIChpICUgMikgKiAxNik7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gV29yZEFycmF5LmNyZWF0ZSh3b3JkcywgdXRmMTZTdHJMZW5ndGggKiAyKTtcblx0ICAgICAgICB9XG5cdCAgICB9O1xuXG5cdCAgICAvKipcblx0ICAgICAqIFVURi0xNiBMRSBlbmNvZGluZyBzdHJhdGVneS5cblx0ICAgICAqL1xuXHQgICAgQ19lbmMuVXRmMTZMRSA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBVVEYtMTYgTEUgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl9IHdvcmRBcnJheSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIFVURi0xNiBMRSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB1dGYxNlN0ciA9IENyeXB0b0pTLmVuYy5VdGYxNkxFLnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gd29yZEFycmF5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB3b3JkQXJyYXkuc2lnQnl0ZXM7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgdXRmMTZDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpICs9IDIpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBjb2RlUG9pbnQgPS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bHQgQSBzYWx0LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgZGVyaXZlZCBrZXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBrZXkgPSBrZGYuY29tcHV0ZShwYXNzd29yZCwgc2FsdCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY29tcHV0ZTogZnVuY3Rpb24gKHBhc3N3b3JkLCBzYWx0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBjZmcgPSB0aGlzLmNmZztcblxuXHQgICAgICAgICAgICAvLyBJbml0IGhhc2hlclxuXHQgICAgICAgICAgICB2YXIgaGFzaGVyID0gY2ZnLmhhc2hlci5jcmVhdGUoKTtcblxuXHQgICAgICAgICAgICAvLyBJbml0aWFsIHZhbHVlc1xuXHQgICAgICAgICAgICB2YXIgZGVyaXZlZEtleSA9IFdvcmRBcnJheS5jcmVhdGUoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGRlcml2ZWRLZXlXb3JkcyA9IGRlcml2ZWRLZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaXplID0gY2ZnLmtleVNpemU7XG5cdCAgICAgICAgICAgIHZhciBpdGVyYXRpb25zID0gY2ZnLml0ZXJhdGlvbnM7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5XG5cdCAgICAgICAgICAgIHdoaWxlIChkZXJpdmVkS2V5V29yZHMubGVuZ3RoIDwga2V5U2l6ZSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKGJsb2NrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgaGFzaGVyLnVwZGF0ZShibG9jayk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB2YXIgYmxvY2sgPSBoYXNoZXIudXBkYXRlKHBhc3N3b3JkKS5maW5hbGl6ZShzYWx0KTtcblx0ICAgICAgICAgICAgICAgIGhhc2hlci5yZXNldCgpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBJdGVyYXRpb25zXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IGl0ZXJhdGlvbnM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGJsb2NrID0gaGFzaGVyLmZpbmFsaXplKGJsb2NrKTtcblx0ICAgICAgICAgICAgICAgICAgICBoYXNoZXIucmVzZXQoKTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgZGVyaXZlZEtleS5jb25jYXQoYmxvY2spO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIGRlcml2ZWRLZXkuc2lnQnl0ZXMgPSBrZXlTaXplICogNDtcblxuXHQgICAgICAgICAgICByZXR1cm4gZGVyaXZlZEtleTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBEZXJpdmVzIGEga2V5IGZyb20gYSBwYXNzd29yZC5cblx0ICAgICAqXG5cdCAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHBhc3N3b3JkIFRoZSBwYXNzd29yZC5cblx0ICAgICAqIEBwYXJhbSB7V29yZEFycmF5fHN0cmluZ30gc2FsdCBBIHNhbHQuXG5cdCAgICAgKiBAcGFyYW0ge09iamVjdH0gY2ZnIChPcHRpb25hbCkgVGhlIGNvbmZpZ3VyYXRpb24gb3B0aW9ucyB0byB1c2UgZm9yIHRoaXMgY29tcHV0YXRpb24uXG5cdCAgICAgKlxuXHQgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgZGVyaXZlZCBrZXkuXG5cdCAgICAgKlxuXHQgICAgICogQHN0YXRpY1xuXHQgICAgICpcblx0ICAgICAqIEBleGFtcGxlXG5cd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hZC1vbmNlIG9wZXJhdGlvbi5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fHN0cmluZ30gbWVzc2FnZVVwZGF0ZSAoT3B0aW9uYWwpIEEgZmluYWwgbWVzc2FnZSB1cGRhdGUuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSBITUFDLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgaG1hYyA9IGhtYWNIYXNoZXIuZmluYWxpemUoKTtcblx0ICAgICAgICAgKiAgICAgdmFyIGhtYWMgPSBobWFjSGFzaGVyLmZpbmFsaXplKCdtZXNzYWdlJyk7XG5cdCAgICAgICAgICogICAgIHZhciBobWFjID0gaG1hY0hhc2hlci5maW5hbGl6ZSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGZpbmFsaXplOiBmdW5jdGlvbiAobWVzc2FnZVVwZGF0ZSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgaGFzaGVyID0gdGhpcy5faGFzaGVyO1xuXG5cdCAgICAgICAgICAgIC8vIENvbXB1dGUgSE1BQ1xuXHQgICAgICAgICAgICB2YXIgaW5uZXJIYXNoID0gaGFzaGVyLmZpbmFsaXplKG1lc3NhZ2VVcGRhdGUpO1xuXHQgICAgICAgICAgICBoYXNoZXIucmVzZXQoKTtcblx0ICAgICAgICAgICAgdmFyIGhtYWMgPSBoYXNoZXIuZmluYWxpemUodGhpcy5fb0tleS5jbG9uZSgpLmNvbmNhdChpbm5lckhhc2gpKTtcblxuXHQgICAgICAgICAgICByZXR1cm4gaG1hYztcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblx0fSgpKTtcblxuXG59KSk7IiwiOyhmdW5jdGlvbiAocm9vdCwgZmFjdG9yeS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gIH1cblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIEggPSB0aGlzLl9oYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8wICA9IE1bb2Zmc2V0ICsgMF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xICA9IE1bb2Zmc2V0ICsgMV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8yICA9IE1bb2Zmc2V0ICsgMl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8zICA9IE1bb2Zmc2V0ICsgM107XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF80ICA9IE1bb2Zmc2V0ICsgNF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF81ICA9IE1bb2Zmc2V0ICsgNV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF82ICA9IE1bb2Zmc2V0ICsgNl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF83ICA9IE1bb2Zmc2V0ICsgN107XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF84ICA9IE1bb2Zmc2V0ICsgOF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF85ICA9IE1bb2Zmc2V0ICsgOV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xMCA9IE1bb2Zmc2V0ICsgMTBdO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfMTEgPSBNW29mZnNldCArIDExXTtcblx0ICAgICAgICAgICAgdmFyIE1fb2Zmc2V0XzEyID0gTVtvZmZzZXQgKyAxMl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xMyA9IE1bb2Zmc2V0ICsgMTNdO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfMTQgPSBNW29mZnNldCArIDE0XTtcblx0ICAgICAgICAgICAgdmFyIE1fb2Zmc2V0XzE1ID0gTVtvZmZzZXQgKyAxNV07XG5cblx0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dGFsTCA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICgoKG5CaXRzVG90YWxMIDw8IDI0KSB8IChuQml0c1RvdGFsTCA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICk7XG5cblx0ICAgICAgICAgICAgZGF0YS5zaWdCeXRlcyA9IChkYXRhV29yZHMubGVuZ3RoICsgMSkgKiA0O1xuXG5cdCAgICAgICAgICAgIC8vIEhhc2ggZmluYWwgYmxvY2tzXG5cdCAgICAgICAgICAgIHRoaXMuX3Byb2Nlc3MoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGhhc2ggPSB0aGlzLl9oYXNoO1xuXHQgICAgICAgICAgICB2YXIgSCA9IGhhc2gud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gU3dhcCBlbmRpYW5cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICB2YXIgSF9pID0gSFtpXTtcblxuXHQgICAgICAgICAgICAgICAgSFtpXSA9ICgoKEhfaSA8PCA4KSAgfCAoSF9pID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICAgICgoKEhfaSA8PCAyNCkgfCAoSF9pID4+PiA4KSkgICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBSZXR1cm4gZmluYWwgY29tcHV0ZWQgaGFzaFxuXHQgICAgICAgICAgICByZXR1cm4gaGFzaDtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIGNsb25lID0gSGFzaGVyLmNsb25lLmNhbGwodGhpcyk7XG5cdCAgICAg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1dHNcblx0ICAgICAgICAgICAgdmFyIGNpcGhlciA9IHRoaXMuX2NpcGhlclxuXHQgICAgICAgICAgICB2YXIgYmxvY2tTaXplID0gY2lwaGVyLmJsb2NrU2l6ZTtcblx0ICAgICAgICAgICAgdmFyIGl2ID0gdGhpcy5faXY7XG5cdCAgICAgICAgICAgIHZhciBjb3VudGVyID0gdGhpcy5fY291bnRlcjtcblxuXHQgICAgICAgICAgICAvLyBHZW5lcmF0ZSBrZXlzdHJlYW1cblx0ICAgICAgICAgICAgaWYgKGl2KSB7XG5cdCAgICAgICAgICAgICAgICBjb3VudGVyID0gdGhpcy5fY291bnRlciA9IGl2LnNsaWNlKDApO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBSZW1vdmUgSVYgZm9yIHN1YnNlcXVlbnQgYmxvY2tzXG5cdCAgICAgICAgICAgICAgICB0aGlzLl9pdiA9IHVuZGVmaW5lZDtcblx0ICAgICAgICAgICAgfVxuXG5cdFx0XHRcdGluY0NvdW50ZXIoY291bnRlcik7XG5cblx0XHRcdFx0dmFyIGtleXN0cmVhbSA9IGNvdW50ZXIuc2xpY2UoMCk7XG5cdCAgICAgICAgICAgIGNpcGhlci5lbmNyeXB0QmxvY2soa2V5c3RyZWFtLCAwKTtcblxuXHQgICAgICAgICAgICAvLyBFbmNyeXB0XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYmxvY2tTaXplOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHdvcmRzW29mZnNldCArIGldIF49IGtleXN0cmVhbVtpXTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblx0ICAgIH0pO1xuXG5cdCAgICBDVFJHbGFkbWFuLkRlY3J5cHRvciA9IEVuY3J5cHRvcjtcblxuXHQgICAgcmV0dXJuIENUUkdsYWRtYW47XG5cdH0oKSk7XG5cblxuXG5cblx0cmV0dXJuIENyeXB0b0pTLm1vZGUuQ1RSR2xhZG1hbjtcblxufSkpOyIsIjsoZnV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gICAgICAgICAgICB2YXIgY291bnRlciA9IHRoaXMuX2NvdW50ZXI7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5c3RyZWFtXG5cdCAgICAgICAgICAgIGlmIChpdikge1xuXHQgICAgICAgICAgICAgICAgY291bnRlciA9IHRoaXMuX2NvdW50ZXIgPSBpdi5zbGljZSgwKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVtb3ZlIElWIGZvciBzdWJzZXF1ZW50IGJsb2Nrc1xuXHQgICAgICAgICAgICAgICAgdGhpcy5faXYgPSB1bmRlZmluZWQ7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgdmFyIGtleXN0cmVhbSA9IGNvdW50ZXIuc2xpY2UoMCk7XG5cdCAgICAgICAgICAgIGNpcGhlci5lbmNyeXB0QmxvY2soa2V5c3RyZWFtLCAwKTtcblxuXHQgICAgICAgICAgICAvLyBJbmNyZW1lbnQgY291bnRlclxuXHQgICAgICAgICAgICBjb3VudGVyW2Jsb2NrU2l6ZSAtIDFdID0gKGNvdW50ZXJbYmxvY2tTaXplIC0gMV0gKyAxKSB8IDBcblxuXHQgICAgICAgICAgICAvLyBFbmNyeXB0XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYmxvY2tTaXplOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHdvcmRzW29mZnNldCArIGldIF49IGtleXN0cmVhbVtpXTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblx0ICAgIH0pO1xuXG5cdCAgICBDVFIuRGVjcnlwdG9yID0gRW5jcnlwdG9yO1xuXG5cdCAgICByZXR1cm4gQ1RSO1xuXHR9KCkpO1xuXG5cblx0cmV0dXJuIENyeXB0b0pTLm1vZGUuQ1RSO1xuXG59KSk7IiwiOyhmdW5jdGlvbiAocm9vdCwgZmFjdG9yeSwgdW5kZWYpIHtcblx0aWYgKHR5cGVvZiBleHBvcnRzID09PSBcIm9iamVjdFwiKSB7X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ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHNhbHQgQSBzYWx0LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgZGVyaXZlZCBrZXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBrZXkgPSBrZGYuY29tcHV0ZShwYXNzd29yZCwgc2FsdCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY29tcHV0ZTogZnVuY3Rpb24gKHBhc3N3b3JkLCBzYWx0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBjZmcgPSB0aGlzLmNmZztcblxuXHQgICAgICAgICAgICAvLyBJbml0IEhNQUNcblx0ICAgICAgICAgICAgdmFyIGhtYWMgPSBITUFDLmNyZWF0ZShjZmcuaGFzaGVyLCBwYXNzd29yZCk7XG5cblx0ICAgICAgICAgICAgLy8gSW5pdGlhbCB2YWx1ZXNcblx0ICAgICAgICAgICAgdmFyIGRlcml2ZWRLZXkgPSBXb3JkQXJyYXkuY3JlYXRlKCk7XG5cdCAgICAgICAgICAgIHZhciBibG9ja0luZGV4ID0gV29yZEFycmF5LmNyZWF0ZShbMHgwMDAwMDAwMV0pO1xuXG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGVyaXZlZEtleVdvcmRzID0gZGVyaXZlZEtleS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGJsb2NrSW5kZXhXb3JkcyA9IGJsb2NrSW5kZXgud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaXplID0gY2ZnLmtleVNpemU7XG5cdCAgICAgICAgICAgIHZhciBpdGVyYXRpb25zID0gY2ZnLml0ZXJhdGlvbnM7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5XG5cdCAgICAgICAgICAgIHdoaWxlIChkZXJpdmVkS2V5V29yZHMubGVuZ3RoIDwga2V5U2l6ZSkge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gaG1hYy51cGRhdGUoc2FsdCkuZmluYWxpemUoYmxvY2tJbmRleCk7XG5cdCAgICAgICAgICAgICAgICBobWFjLnJlc2V0KCk7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrV29yZHMgPSBibG9jay53b3Jkcztcblx0ICAgICAgICAgICAgICAgIHZhciBibG9ja1dvcmRzTGVuZ3RoID0gYmxvY2tXb3Jkcy5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgICAgIC8vIEl0ZXJhdGlvbnNcblx0ICAgICAgICAgICAgICAgIHZhciBpbnRlcm1lZGlhdGUgPSBibG9jaztcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAxOyBpIDwgaXRlcmF0aW9uczsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgaW50ZXJtZWRpYXRlID0gaG1hYy5maW5hbGl6ZShpbnRlcm1lZGlhdGUpO1xuXHQgICAgICAgICAgICAgICAgICAgIGhtYWMucmVzZXQoKTtcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGludGVybWVkaWF0ZVdvcmRzID0gaW50ZXJtZWRpYXRlLndvcmRzO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgLy8gWE9SIGludGVybWVkaWF0ZSB3aXRoIGJsb2NrXG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBibG9ja1dvcmRzTGVuZ3RoOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgYmxvY2tXb3Jkc1tqXSBePSBpbnRlcm1lZGlhdGVXb3Jkc1tqXTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIGRlcml2ZWRLZXkuY29uY2F0KGJsb2NrKTtcblx0ICAgICAgICAgICAgICAgIGJsb2NrSW5kZXhXb3Jkc1swXSsrO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIGRlcml2ZWRLZXkuc2lnQnl0ZXMgPSBrZXlTaXplICogNDtcblxuXHQgICAgICAgICAgICByZXR1cm4gZGVyaXZlZEtleTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBDb21wdXRlcyB0aGUgUGFzc3dvcmQtQmFzZWQgS2V5IERlcml2YXRpb24gRnVuY3Rpb24gMi5cblx0ICAgICAqXG5cdCAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHBhc3N3b3JkIFRoZSBwYXNzd29yZC5cblx0ICAgICAqIEBwYXJhbSB7V29yZEFycmF5fHN0cmluZ30gc2FsdCBBIHNhbHQuXG5cdCAgICAgKiBAcGFyYW0ge09iamVjdH0gY2ZnIChPcHRpb25hbCkgVGhlIGNvbmZpZ3VyYXRpb24gb3B0aW9ucyB0byB1c2UgZm9yIHRoaXMgY29tcHV0YXRpb24uXG5cdCAgICAgKlxuXHQgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgZGVyaXZlZCBrZXkuXG5cdCAgICAgKlxuXHQgICAgICogQHN0YXRpY1xuXHQgICAgICpcblx0ICAgICAqIEBleGFtcGxlXG5cdCAgICAgKlxuXHQgICAgICogICAgIHZhciBrZXkgPSBDcnlwdG9KUy5QQktERjIocGFzc3dvcmQsIHNhbHQpO1xuXHQgICAgICogICAgIHZhciBrZXkgPSBDcnlwdG9KUy5QQktERjIocGFzc3dvcmQsIHNhbHQsIHsga2V5U2l6ZTogOCB9KTtcblx0ICAgICAqICAgICB2YXIga2V5ID0gQ3J5cHRvSlMuUEJLREYyKHBhc3N3b3JkLCBzY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gICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBNb2RpZnkgdGhlIGNvdW50ZXJzXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBDW2ldIF49IFhbKGkgKyA0KSAmIDddO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSVYgc2V0dXBcblx0ICAgICAgICAgICAgaWYgKGl2KSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBJViA9IGl2LndvcmRzO1xuXHQgICAgICAgICAgICAgICAgdmFyIElWXzAgPSBJVlswXTtcblx0ICAgICAgICAgICAgICAgIHZhciBJVl8xID0gSVZbMV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIEdlbmVyYXRlIGZvdXIgc3VidmVjdG9yc1xuXHQgICAgICAgICAgICAgICAgdmFyIGkwID0gKCgoSVZfMCA8PCA4KSB8IChJVl8wID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfCAoKChJVl8wIDw8IDI0KSB8IChJVl8wID4+PiA4KSkgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMiA9ICgoKElWXzEgPDwgOCkgfCAoSVZfMSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHwgKCgoSVZfMSA8PCAyNCkgfCAoSVZfMSA+Pj4gOCkpICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTEgPSAoaTAgPj4+IDE2KSB8IChpMiAmIDB4ZmZmZjAwMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkzID0gKGkyIDw8IDE2KSAgfCAoaTAgJiAweDAwMDBmZmZmKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gTW9kaWZ5IGNvdW50ZXIgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICBDWzBdIF49IGkwO1xuXHQgICAgICAgICAgICAgICAgQ1sxXSBePSBpMTtcblx0ICAgICAgICAgICAgICAgIENbMl0gXj0gaTI7XG5cdCAgICAgICAgICAgICAgICBDWzNdIF49IGkzO1xuXHQgICAgICAgICAgICAgICAgQ1s0XSBePSBpMDtcblx0ICAgICAgICAgICAgICAgIENbNV0gXj0gaTE7XG5cdCAgICAgICAgICAgICAgICBDWzZdIF49IGkyO1xuXHQgICAgICAgICAgICAgICAgQ1s3XSBePSBpMztcblxuXHQgICAgICAgICAgICAgICAgLy8gSXRlcmF0ZSB0aGUgc3lzdGVtIGZvdXIgdGltZXNcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBYID0gdGhpcy5fWDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW1cblx0ICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUgZm91ciBrZXlzdHJlYW0gd29yZHNcblx0ICAgICAgICAgICAgU1swXSA9IFhbMF0gXiAoWFs1XSA+Pj4gMTYpIF4gKFhbM10gPDwgMTYpO1xuXHQgICAgICAgICAgICBTWzFdID0gWFsyXSBeIChYWzddID4+PiAxNikgXiAoWFs1XSA8PCAxNik7XG5cdCAgICAgICAgICAgIFNbMl0gPSBYWzRdIF4gKFhbMV0gPj4+IDE2KSBeIChYWzddIDw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Ll9rZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBpdiA9IHRoaXMuY2ZnLml2O1xuXG5cdCAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBLW2ldID0gKCgoS1tpXSA8PCA4KSAgfCAoS1tpXSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAgICAoKChLW2ldIDw8IDI0KSB8IChLW2ldID4+PiA4KSkgICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBHZW5lcmF0ZSBpbml0aWFsIHN0YXRlIHZhbHVlc1xuXHQgICAgICAgICAgICB2YXIgWCA9IHRoaXMuX1ggPSBbXG5cdCAgICAgICAgICAgICAgICBLWzBdLCAoS1szXSA8PCAxNikgfCAoS1syXSA+Pj4gMTYpLFxuXHQgICAgICAgICAgICAgICAgS1sxXSwgKEtbMF0gPDwgMTYpIHwgKEtbM10gPj4+IDE2KSxcblx0ICAgICAgICAgICAgICAgIEtbMl0sIChLWzFdIDw8IDE2KSB8IChLWzBdID4+PiAxNiksXG5cdCAgICAgICAgICAgICAgICBLWzNdLCAoS1syXSA8PCAxNikgfCAoS1sxXSA+Pj4gMTYpXG5cdCAgICAgICAgICAgIF07XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUgaW5pdGlhbCBjb3VudGVyIHZhbHVlc1xuXHQgICAgICAgICAgICB2YXIgQyA9IHRoaXMuX0MgPSBbXG5cdCAgICAgICAgICAgICAgICAoS1syXSA8PCAxNikgfCAoS1syXSA+Pj4gMTYpLCAoS1swXSAmIDB4ZmZmZjAwMDApIHwgKEtbMV0gJiAweDAwMDBmZmZmKSxcblx0ICAgICAgICAgICAgICAgIChLWzNdIDw8IDE2KSB8IChLWzNdID4+PiAxNiksIChLWzFdICYgMHhmZmZmMDAwMCkgfCAoS1syXSAmIDB4MDAwMGZmZmYpLFxuXHQgICAgICAgICAgICAgICAgKEtbMF0gPDwgMTYpIHwgKEtbMF0gPj4+IDE2KSwgKEtbMl0gJiAweGZmZmYwMDAwKSB8IChLWzNdICYgMHgwMDAwZmZmZiksXG5cdCAgICAgICAgICAgICAgICAoS1sxXSA8PCAxNikgfCAoS1sxXSA+Pj4gMTYpLCAoS1szXSAmIDB4ZmZmZjAwMDApIHwgKEtbMF0gJiAweDAwMDBmZmZmKVxuXHQgICAgICAgICAgICBdO1xuXG5cdCAgICAgICAgICAgIC8vIENhcnJ5IGJpdFxuXHQgICAgICAgICAgICB0aGlzLl9iID0gMDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW0gZm91ciB0aW1lc1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDQ7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBNb2RpZnkgdGhlIGNvdW50ZXJzXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBDW2ldIF49IFhbKGkgKyA0KSAmIDddO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSVYgc2V0dXBcblx0ICAgICAgICAgICAgaWYgKGl2KSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBJViA9IGl2LndvcmRzO1xuXHQgICAgICAgICAgICAgICAgdmFyIElWXzAgPSBJVlswXTtcblx0ICAgICAgICAgICAgICAgIHZhciBJVl8xID0gSVZbMV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIEdlbmVyYXRlIGZvdXIgc3VidmVjdG9yc1xuXHQgICAgICAgICAgICAgICAgdmFyIGkwID0gKCgoSVZfMCA8PCA4KSB8IChJVl8wID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfCAoKChJVl8wIDw8IDI0KSB8IChJVl8wID4+PiA4KSkgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMiA9ICgoKElWXzEgPDwgOCkgfCAoSVZfMSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHwgKCgoSVZfMSA8PCAyNCkgfCAoSVZfMSA+Pj4gOCkpICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTEgPSAoaTAgPj4+IDE2KSB8IChpMiAmIDB4ZmZmZjAwMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkzID0gKGkyIDw8IDE2KSAgfCAoaTAgJiAweDAwMDBmZmZmKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gTW9kaWZ5IGNvdW50ZXIgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICBDWzBdIF49IGkwO1xuXHQgICAgICAgICAgICAgICAgQ1sxXSBePSBpMTtcblx0ICAgICAgICAgICAgICAgIENbMl0gXj0gaTI7XG5cdCAgICAgICAgICAgICAgICBDWzNdIF49IGkzO1xuXHQgICAgICAgICAgICAgICAgQ1s0XSBePSBpMDtcblx0ICAgICAgICAgICAgICAgIENbNV0gXj0gaTE7XG5cdCAgICAgICAgICAgICAgICBDWzZdIF49IGkyO1xuXHQgICAgICAgICAgICAgICAgQ1s3XSBePSBpMztcblxuXHQgICAgICAgICAgICAgICAgLy8gSXRlcmF0ZSB0aGUgc3lzdGVtIGZvdXIgdGltZXNcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgIC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AgdmFyIFN0cmVhbUNpcGhlciA9IENfbGliLlN0cmVhbUNpcGhlcjtcblx0ICAgIHZhciBDX2FsZ28gPSBDLmFsZ287XG5cblx0ICAgIC8qKlxuXHQgICAgICogUkM0IHN0cmVhbSBjaXBoZXIgYWxnb3JpdGhtLlxuXHQgICAgICovXG5cdCAgICB2YXIgUkM0ID0gQ19hbGdvLlJDNCA9IFN0cmVhbUNpcGhlci5leHRlbmQoe1xuXHQgICAgICAgIF9kb1Jlc2V0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIga2V5ID0gdGhpcy5fa2V5O1xuXHQgICAgICAgICAgICB2YXIga2V5V29yZHMgPSBrZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaWdCeXRlcyA9IGtleS5zaWdCeXRlcztcblxuXHQgICAgICAgICAgICAvLyBJbml0IHNib3hcblx0ICAgICAgICAgICAgdmFyIFMgPSB0aGlzLl9TID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjU2OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIFNbaV0gPSBpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gS2V5IHNldHVwXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwLCBqID0gMDsgaSA8IDI1NjsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIga2V5Qnl0ZUluZGV4ID0gaSAlIGtleVNpZ0J5dGVzO1xuXHQgICAgICAgICAgICAgICAgdmFyIGtleUJ5dGUgPSAoa2V5V29yZHNba2V5Qnl0ZUluZGV4ID4+PiAyXSA+Pj4gKDI0IC0gKGtleUJ5dGVJbmRleCAlIDQpICogOCkpICYgMHhmZjtcblxuXHQgICAgICAgICAgICAgICAgaiA9IChqICsgU1tpXSArIGtleUJ5dGUpICUgMjU2O1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwXG5cdCAgICAgICAgICAgICAgICB2YXIgdCA9IFNbaV07XG5cdCAgICAgICAgICAgICAgICBTW2ldID0gU1tqXTtcblx0ICAgICAgICAgICAgICAgIFNbal0gPSB0O1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQ291bnRlcnNcblx0ICAgICAgICAgICAgdGhpcy5faSA9IHRoaXMuX2ogPSAwO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9Qcm9jZXNzQmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgTVtvZmZzZXRdIF49IGdlbmVyYXRlS2V5c3RyZWFtV29yZC5jYWxsKHRoaXMpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBrZXlTaXplOiAyNTYvMzIsXG5cblx0ICAgICAgICBpdlNpemU6IDBcblx0ICAgIH0pO1xuXG5cdCAgICBmdW5jdGlvbiBnZW5lcmF0ZUtleXN0cmVhbVdvcmQoKSB7XG5cdCAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgdmFyIFMgPSB0aGlzLl9TO1xuXHQgICAgICAgIHZhciBpID0gdGhpcy5faTtcblx0ICAgICAgICB2YXIgaiA9IHRoaXMuX2o7XG5cblx0ICAgICAgICAvLyBHZW5lcmF0ZSBrZXlzdHJlYW0gd29yZFxuXHQgICAgICAgIHZhciBrZXlzdHJlYW1Xb3JkID0gMDtcblx0ICAgICAgICBmb3IgKHZhciBuID0gMDsgbiA8IDQ7IG4rKykge1xuXHQgICAgICAgICAgICBpID0gKGkgKyAxKSAlIDI1Njtcblx0ICAgICAgICAgICAgaiA9IChqICsgU1tpXSkgJSAyNTY7XG5cblx0ICAgICAgICAgICAgLy8gU3dhcFxuXHQgICAgICAgICAgICB2YXIgdCA9IFNbaV07XG5cdCAgICAgICAgICAgIFNbaV0gPSBTW2pdO1xuXHQgICAgICAgICAgICBTW2pdID0gdDtcblxuXHQgICAgICA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gICAgICAgICAgICAgICAgdmFyIG9mZnNldF9pID0gb2Zmc2V0ICsgaTtcblx0ICAgICAgICAgICAgICAgIHZhciBNX29mZnNldF9pID0gTVtvZmZzZXRfaV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXBcblx0ICAgICAgICAgICAgICAgIE1bb2Zmc2V0X2ldID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE1fb2Zmc2V0X2kgPDwgOCkgIHwgKE1fb2Zmc2V0X2kgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTV9vZmZzZXRfaSA8PCAyNCkgfCAoTV9vZmZzZXRfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBIICA9IHRoaXMuX2hhc2gud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBobCA9IF9obC53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGhyID0gX2hyLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgemwgPSBfemwud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB6ciA9IF96ci53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNsID0gX3NsLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc3IgPSBfc3Iud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gV29ya2luZyB2YXJpYWJsZXNcblx0ICAgICAgICAgICAgdmFyIGFsLCBibCwgY2wsIGRsLCBlbDtcblx0ICAgICAgICAgICAgdmFyIGFyLCBiciwgY3IsIGRyLCBlcjtcblxuXHQgICAgICAgICAgICBhciA9IGFsID0gSFswXTtcblx0ICAgICAgICAgICAgYnIgPSBibCA9IEhbMV07XG5cdCAgICAgICAgICAgIGNyID0gY2wgPSBIWzJdO1xuXHQgICAgICAgICAgICBkciA9IGRsID0gSFszXTtcblx0ICAgICAgICAgICAgZXIgPSBlbCA9IEhbNF07XG5cdCAgICAgICAgICAgIC8vIENvbXB1dGF0aW9uXG5cdCAgICAgICAgICAgIHZhciB0O1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDgwOyBpICs9IDEpIHtcblx0ICAgICAgICAgICAgICAgIHQgPSAoYWwgKyAgTVtvZmZzZXQremxbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJsLGNsLGRsKSArIGhsWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjIoYmwsY2wsZGwpICsgaGxbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhibCxjbCxkbCkgKyBobFsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY0KGJsLGNsLGRsKSArIGhsWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJsLGNsLGRsKSArIGhsWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNsW2ldKTtcblx0ICAgICAgICAgICAgICAgIHQgPSAodCtlbCl8MDtcblx0ICAgICAgICAgICAgICAgIGFsID0gZWw7XG5cdCAgICAgICAgICAgICAgICBlbCA9IGRsO1xuXHQgICAgICAgICAgICAgICAgZGwgPSByb3RsKGNsLCAxMCk7XG5cdCAgICAgICAgICAgICAgICBjbCA9IGJsO1xuXHQgICAgICAgICAgICAgICAgYmwgPSB0O1xuXG5cdCAgICAgICAgICAgICAgICB0ID0gKGFyICsgTVtvZmZzZXQrenJbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJyLGNyLGRyKSArIGhyWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjQoYnIsY3IsZHIpICsgaHJbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhicixjcixkcikgKyBoclsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYyKGJyLGNyLGRyKSArIGhyWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJyLGNyLGRyKSArIGhyWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNyW2ldKSA7XG5cdCAgICAgICAgICAgICAgICB0ID0gKHQrZXIpfDA7XG5cdCAgICAgICAgICAgICAgICBhciA9IGVyO1xuXHQgICAgICAgICAgICAgICAgZXIgPSBkcjtcblx0ICAgICAgICAgICAgICAgIGRyID0gcm90bChjciwgMTApO1xuXHQgICAgICAgICAgICAgICAgY3IgPSBicjtcblx0ICAgICAgICAgICAgICAgIGJyID0gdDtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZGlhdGUgaGFzaCB2YWx1ZVxuXHQgICAgICAgICAgICB0ICAgID0gKEhbMV0gKyBjbCArIGRyKXwwO1xuXHQgICAgICAgICAgICBIWzFdID0gKEhbMl0g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blxuXHQgICAgICAgICAgICAvLyBIYXNoIGZpbmFsIGJsb2Nrc1xuXHQgICAgICAgICAgICB0aGlzLl9wcm9jZXNzKCk7XG5cblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciBoYXNoID0gdGhpcy5faGFzaDtcblx0ICAgICAgICAgICAgdmFyIEggPSBoYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNTsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgdmFyIEhfaSA9IEhbaV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXBcblx0ICAgICAgICAgICAgICAgIEhbaV0gPSAoKChIX2kgPDwgOCkgIHwgKEhfaSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAgICAoKChIX2kgPDwgMjQpIHwgKEhfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUmV0dXJuIGZpbmFsIGNvbXB1dGVkIGhhc2hcblx0ICAgICAgICAgICAgcmV0dXJuIGhhc2g7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIGNsb25lOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIHZhciBjbG9uZSA9IEhhc2hlci5jbG9uZS5jYWxsKHRoaXMpO1xuXHQgICAgICAgICAgICBjbG9uZS5faGFzaCA9IHRoaXMuX2hhc2guY2xvbmUoKTtcblxuXHQgICAgICAgICAgICByZXR1cm4gY2xvbmU7XG5cdCAgICAgICAgfVxuXHQgICAgfSk7XG5cblxuXHQgICAgZnVuY3Rpb24gZjEoeCwgeSwgeikge1xuXHQgICAgICAgIHJldHVybiAoKHgpIF4gKHkpIF4g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IFdvcmtpbmcgdmFyaWFibGVzXG5cdCAgICAgICAgICAgIHZhciBhID0gSFswXTtcblx0ICAgICAgICAgICAgdmFyIGIgPSBIWzFdO1xuXHQgICAgICAgICAgICB2YXIgYyA9IEhbMl07XG5cdCAgICAgICAgICAgIHZhciBkID0gSFszXTtcblx0ICAgICAgICAgICAgdmFyIGUgPSBIWzRdO1xuXG5cdCAgICAgICAgICAgIC8vIENvbXB1dGF0aW9uXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODA7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKGkgPCAxNikge1xuXHQgICAgICAgICAgICAgICAgICAgIFdbaV0gPSBNW29mZnNldCArIGldIHwgMDtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIG4gPSBXW2kgLSAzXSBeIFdbaSAtIDhdIF4gV1tpIC0gMTRdIF4gV1tpIC0gMTZdO1xuXHQgICAgICAgICAgICAgICAgICAgIFdbaV0gPSAobiA8PCAxKSB8IChuID4+PiAzMSk7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0ID0gKChhIDw8IDUpIHwgKGEgPj4+IDI3KSkgKyBlICsgV1tpXTtcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMjApIHtcblx0ICAgICAgICAgICAgICAgICAgICB0ICs9ICgoYiAmIGMpIHwgKH5iICYgZCkpICsgMHg1YTgyNzk5OTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaSA8IDQwKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdCArPSAoYiBeIGMgXiBkKSArIDB4NmVkOWViYTE7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGkgPCA2MCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHQgKz0gKChiICYgYykgfCAoYiAmIGQpIHwgKGMgJiBkKSkgLSAweDcwZTQ0MzI0O1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIC8qIGlmIChpIDwgODApICovIHtcblx0ICAgICAgICAgICAgICAgICAgICB0ICs9IChiIF4gYyBeIGQpIC0gMHgzNTlkM2UyYTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgZSA9IGQ7XG5cdCAgICAgICAgICAgICAgICBkID0gYztcblx0ICAgICAgICAgICAgICAgIGMgPSAoYiA8PCAzMCkgfCAoYiA+Pj4gMik7XG5cdCAgICAgICAgICAgICAgICBiID0gYTtcblx0ICAgICAgICAgICAgICAgIGEgPSB0O1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSW50ZXJtZWRpYXRlIGhhc2ggdmFsdWVcblx0ICAgICAgICAgICAgSFswXSA9IChIWzBdICsgYSkgfCAwO1xuXHQgICAgICAgICAgICBIWzFdID0gKEhbMV0gKyBiKSB8IDA7XG5cdCAgICAgICAgICAgIEhbMl0gPSAoSFsyXSArIGMpIHwgMDtcblx0ICAgICAgICAgICAgSFszXSA9IChIWzNdICsgZCkgfCAwO1xuXHQgICAgICAgICAgICBIWzRdID0gKEhbNF0gKyBlKSB8IDA7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb0ZpbmFsaXplOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGF0YSA9IHRoaXMuX2RhdGE7XG5cdCAgICAgICAgICAgIHZhciBkYXRhV29yZHMgPSBkYXRhLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBuQml0c1RvdGFsID0gdGhpcy5fbkRhdGFCeXRlcyAqIDg7XG5cdCAgICAgICAgICAgIHZhciBuQml0c0xlZnQgPSBkYXRhLnNpZ0J5dGVzICogODtcblxuXHQgICAgICAgICAgICAvLyBBZGQgcGFkZGluZ1xuXHQgICAgICAgICAgICBkYXRhV29yZHNbbkJpdHNMZWZ0ID4+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29yZEFycmF5O1xuXHQgICAgdmFyIEhhc2hlciA9IENfbGliLkhhc2hlcjtcblx0ICAgIHZhciBDX2FsZ28gPSBDLmFsZ287XG5cblx0ICAgIC8vIEluaXRpYWxpemF0aW9uIGFuZCByb3VuZCBjb25zdGFudHMgdGFibGVzXG5cdCAgICB2YXIgSCA9IFtdO1xuXHQgICAgdmFyIEsgPSBbXTtcblxuXHQgICAgLy8gQ29tcHV0ZSBjb25zdGFudHNcblx0ICAgIChmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgZnVuY3Rpb24gaXNQcmltZShuKSB7XG5cdCAgICAgICAgICAgIHZhciBzcXJ0TiA9IE1hdGguc3FydChuKTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgZmFjdG9yID0gMjsgZmFjdG9yIDw9IHNxcnROOyBmYWN0b3IrKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKCEobiAlIGZhY3RvcikpIHtcblx0ICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcblx0ICAgICAgICB9XG5cblx0ICAgICAgICBmdW5jdGlvbiBnZXRGcmFjdGlvbmFsQml0cyhuKSB7XG5cdCAgICAgICAgICAgIHJldHVybiAoKG4gLSAobiB8IDApKSAqIDB4MTAwMDAwMDAwKSB8IDA7XG5cdCAgICAgICAgfVxuXG5cdCAgICAgICAgdmFyIG4gPSAyO1xuXHQgICAgICAgIHZhciBuUHJpbWUgPSAwO1xuXHQgICAgICAgIHdoaWxlIChuUHJpbWUgPCA2NCkge1xuXHQgICAgICAgICAgICBpZiAoaXNQcmltZShuKSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKG5QcmltZSA8IDgpIHtcblx0ICAgICAgICAgICAgICAgICAgICBIW25QcmltZV0gPSBnZXRGcmFjdGlvbmFsQml0cyhNYXRoLnBvdyhuLCAxIC8gMikpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgS1tuUHJpbWVdID0gZ2V0RnJhY3Rpb25hbEJpdHMoTWF0aC5wb3cobiwgMSAvIDMpKTtcblxuXHQgICAgICAgICAgICAgICAgblByaW1lKys7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICBuKys7XG5cdCAgICAgICAgfVxuXHQgICAgfSgpKTtcblxuXHQgICAgLy8gUmV1c2FibGUgb2JqZWN0XG5cdCAgICB2YXIgVyA9IFtdO1xuXG5cdCAgICAvKipcblx0ICAgICAqIFNIQS0yNTYgaGFzaCBhbGdvcml0aG0uXG5cdCAgICAgKi9cblx0ICAgIHZhciBTSEEyNTYgPSBDX2FsZ28uU0hBMjU2ID0gSGFzaGVyLmV4dGVuZCh7XG5cdCAgICAgICAgX2RvUmVzZXQ6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdGhpcy5faGFzaCA9IG5ldyBXb3JkQXJyYXkuaW5pdChILnNsaWNlKDApKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBIID0gdGhpcy5faGFzaC53b3JkcztcblxuXHQgICAgICAgICAgICAvLyBXb3JraW5nIHZhcmlhYmxlc1xuXHQgICAgICAgICAgICB2YXIgYSA9IEhbMF07XG5cdCAgICAgICAgICAgIHZhciBiID0gSFsxXTtcblx0ICAgICAgICAgICAgdmFyIGMgPSBIWzJdO1xuXHQgICAgICAgICAgICB2YXIgZCA9IEhbM107XG5cdCAgICAgICAgICAgIHZhciBlID0gSFs0XTtcblx0ICAgICAgICAgICAgdmFyIGYgPSBIWzVdO1xuXHQgICAgICAgICAgICB2YXIgZyA9IEhbNl07XG5cdCAgICAgICAgICAgIHZhciBoID0gSFs3XTtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRhdGlvblxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDY0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMTYpIHtcblx0ICAgICAgICAgICAgICAgICAgICBXW2ldID0gTVtvZmZzZXQgKyBpXSB8IDA7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTB4ID0gV1tpIC0gMTVdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTAgID0gKChnYW1tYTB4IDw8IDI1KSB8IChnYW1tYTB4ID4+PiA3KSkgIF5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZ2FtbWEweCA8PCAxNCkgfCAoZ2FtbWEweCA+Pj4gMTgpKSBeXG5cdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdhbW1hMHggPj4+IDMpO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMXggPSBXW2kgLSAyXTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExICA9ICgoZ2FtbWExeCA8PCAxNSkgfCAoZ2FtbWExeCA+Pj4gMTcpKSBeXG5cdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGdhbW1hMXggPDwgMTMpIHwgKGdhbW1hMXggPj4+IDE5KSkgXlxuXHQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChnYW1tYTF4ID4+PiAxMCk7XG5cblx0ICAgICAgICAgICAgICAgICAgICBXW2ldID0gZ2FtbWEwICsgV1tpIC0gN10gKyBnYW1tYTEgKyBXW2kgLSAxNl07XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIHZhciBjaCAgPSAoZSAmIGYpIF4gKH5lICYgZyk7XG5cdCAgICAgICAgICAgICAgICB2YXIgbWFqID0gKGEgJiBiKSBeIChhICYgYykgXiAoYiAmIGMpO1xuXG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWEwID0gKChhIDw8IDMwKSB8IChhID4+PiAyKSkgXiAoKGEgPDwgMTkpIHwgKGEgPj4+IDEzKSkgXiAoKGEgPDwgMTApIHwgKGEgPj4+IDIyKSk7XG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWExID0gKChlIDw8IDI2KSB8IChlID4+PiA2KSkgXiAoKGUgPDwgMjEpIHwgKGUgPj4+IDExKSkgXiAoKGUgPDwgNykgIHwgKGUgPj4+IDI1KSk7XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0MSA9IGggKyBzaWdtYTEgKyBjaCArIEtbaV0gKyBXW2ldO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQyID0gc2lnbWEwICsgbWFqO1xuXG5cdCAgICAgICAgICAgICAgICBoID0gZztcblx0ICAgICAgICAgICAgICAgIGcgPSBmO1xuXHQgICAgICAgICAgICAgICAgZiA9IGU7XG5cdCAgICAgICAgICAgICAgICBlID0gKGQgKyB0MSkgfCAwO1xuXHQgICAgICAgICAgICAgICAgZCA9IGM7XG5cdCAgICAgICAgICAgICAgICBjID0gYjtcblx0ICAgICAgICAgICAgICAgIGIgPSBhO1xuXHQgICAgICAgICAgICAgICAgYSA9ICh0MSArIHQyKSB8IDA7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZGlhdGUgaGFzaCB2YWx1ZVxuXHQgICAgICAgICAgICBIWzBdID0gKEhbMF0gKyBhKSB8IDA7XG5cdCAgICAgICAgICAgIEhbMV0gPSAoSFsxXSArIGIpIHwgMDtcblx0ICAgICAgICAgICAgSFsyXSA9IChIWzJdICsgYykgfCAwO1xuXHQgICAgICAgICAgICBIWzNdID0gKEhbM10gKyBkKSB8IDA7XG5cdCAgICAgICAgICAgIEhbNF0gPSAoSFs0XSArIGUpIHwgMDtcblx0ICAgICAgICAgICAgSFs1XSA9IChIWzVdIC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cblx0ICAgIHZhciBDX2xpYiA9IEMubGliO1xuXHQgICAgdmFyIFdvcmRBcnJheSA9IENfbGliLldvcmRBcnJheTtcblx0ICAgIHZhciBIYXNoZXIgPSBDX2xpYi5IYXNoZXI7XG5cdCAgICB2YXIgQ194NjQgPSBDLng2NDtcblx0ICAgIHZhciBYNjRXb3JkID0gQ194NjQuV29yZDtcblx0ICAgIHZhciBDX2FsZ28gPSBDLmFsZ287XG5cblx0ICAgIC8vIENvbnN0YW50cyB0YWJsZXNcblx0ICAgIHZhciBSSE9fT0ZGU0VUUyA9IFtdO1xuXHQgICAgdmFyIFBJX0lOREVYRVMgID0gW107XG5cdCAgICB2YXIgUk9VTkRfQ09OU1RBTlRTID0gW107XG5cblx0ICAgIC8vIENvbXB1dGUgQ29uc3RhbnRzXG5cdCAgICAoZnVuY3Rpb24gKCkge1xuXHQgICAgICAgIC8vIENvbXB1dGUgcmhvIG9mZnNldCBjb25zdGFudHNcblx0ICAgICAgICB2YXIgeCA9IDEsIHkgPSAwO1xuXHQgICAgICAgIGZvciAodmFyIHQgPSAwOyB0IDwgMjQ7IHQrKykge1xuXHQgICAgICAgICAgICBSSE9fT0ZGU0VUU1t4ICsgNSAqIHldID0gKCh0ICsgMSkgKiAodCArIDIpIC8gMikgJSA2NDtcblxuXHQgICAgICAgICAgICB2YXIgbmV3WCA9IHkgJSA1O1xuXHQgICAgICAgICAgICB2YXIgbmV3WSA9ICgyICogeCArIDMgKiB5KSAlIDU7XG5cdCAgICAgICAgICAgIHggPSBuZXdYO1xuXHQgICAgICAgICAgICB5ID0gbmV3WTtcblx0ICAgICAgICB9XG5cblx0ICAgICAgICAvLyBDb21wdXRlIHBpIGluZGV4IGNvbnN0YW50c1xuXHQgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgNTsgeSsrKSB7XG5cdCAgICAgICAgICAgICAgICBQSV9JTkRFWEVTW3ggKyA1ICogeV0gPSB5ICsgKCgyICogeCArIDMgKiB5KSAlIDUpICogNTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblxuXHQgICAgICAgIC8vIENvbXB1dGUgcm91bmQgY29uc3RhbnRzXG5cdCAgICAgICAgdmFyIExGU1IgPSAweDAxO1xuXHQgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjQ7IGkrKykge1xuXHQgICAgICAgICAgICB2YXIgcm91bmRDb25zdGFudE1zdyA9IDA7XG5cdCAgICAgICAgICAgIHZhciByb3VuZENvbnN0YW50THN3ID0gMDtcblxuXHQgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IDc7IGorKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKExGU1IgJiAweDAxKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGJpdFBvc2l0aW9uID0gKDEgPDwgaikgLSAxO1xuXHQgICAgICAgICAgICAgICAgICAgIGlmIChiaXRQb3NpdGlvbiA8IDMyKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHJvdW5kQ29uc3RhbnRMc3cgXj0gMSA8PCBiaXRQb3NpdGlvbjtcblx0ICAgICAgICAgICAgICAgICAgICB9IGVsc2UgLyogaWYgKGJpdFBvc2l0aW9uID49IDMyKSAqLyB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHJvdW5kQ29uc3RhbnRNc3cgXj0gMSA8PCAoYml0UG9zaXRpb24gLSAzMik7XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAvLyBDb21wdXRlIG5leHQgTEZTUlxuXHQgICAgICAgICAgICAgICAgaWYgKExGU1IgJiAweDgwKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gUHJpbWl0aXZlIHBvbHlub21pYWwgb3ZlciBHRigyKTogeF44ICsgeF42ICsgeF41ICsgeF40ICsgMVxuXHQgICAgICAgICAg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uXHQgICAgICAgIGNmZzogSGFzaGVyLmNmZy5leHRlbmQoe1xuXHQgICAgICAgICAgICBvdXRwdXRMZW5ndGg6IDUxMlxuXHQgICAgICAgIH0pLFxuXG5cdCAgICAgICAgX2RvUmVzZXQ6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIHN0YXRlID0gdGhpcy5fc3RhdGUgPSBbXVxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI1OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHN0YXRlW2ldID0gbmV3IFg2NFdvcmQuaW5pdCgpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgdGhpcy5ibG9ja1NpemUgPSAoMTYwMCAtIDIgKiB0aGlzLmNmZy5vdXRwdXRMZW5ndGgpIC8gMzI7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb1Byb2Nlc3NCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHN0YXRlID0gdGhpcy5fc3RhdGU7XG5cdCAgICAgICAgICAgIHZhciBuQmxvY2tTaXplTGFuZXMgPSB0aGlzLmJsb2NrU2l6ZSAvIDI7XG5cblx0ICAgICAgICAgICAgLy8gQWJzb3JiXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbkJsb2NrU2l6ZUxhbmVzOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIE0yaSAgPSBNW29mZnNldCArIDIgKiBpXTtcblx0ICAgICAgICAgICAgICAgIHZhciBNMmkxID0gTVtvZmZzZXQgKyAyICogaSArIDFdO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwIGVuZGlhblxuXHQgICAgICAgICAgICAgICAgTTJpID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaSA8PCA4KSAgfCAoTTJpID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaSA8PCAyNCkgfCAoTTJpID4+PiA4KSkgICYgMHhmZjAwZmYwMClcblx0ICAgICAgICAgICAgICAgICk7XG5cdCAgICAgICAgICAgICAgICBNMmkxID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaTEgPDwgOCkgIHwgKE0yaTEgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTTJpMSA8PCAyNCkgfCAoTTJpMSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBBYnNvcmIgbWVzc2FnZSBpbnRvIHN0YXRlXG5cdCAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW2ldO1xuXHQgICAgICAgICAgICAgICAgbGFuZS5oaWdoIF49IE0yaTE7XG5cdCAgICAgICAgICAgICAgICBsYW5lLmxvdyAgXj0gTTJpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUm91bmRzXG5cdCAgICAgICAgICAgIGZvciAodmFyIHJvdW5kID0gMDsgcm91bmQgPCAyNDsgcm91bmQrKykge1xuXHQgICAgICAgICAgICAgICAgLy8gVGhldGFcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gTWl4IGNvbHVtbiBsYW5lc1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0TXN3ID0gMCwgdExzdyA9IDA7XG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgeSA9IDA7IHkgPCA1OyB5KyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVt4ICsgNSAqIHldO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB0TXN3IF49IGxhbmUuaGlnaDtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdExzdyBePSBsYW5lLmxvdztcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBUZW1wb3JhcnkgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4ID0gVFt4XTtcblx0ICAgICAgICAgICAgICAgICAgICBUeC5oaWdoID0gdE1zdztcblx0ICAgICAgICAgICAgICAgICAgICBUeC5sb3cgID0gdExzdztcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4NCA9IFRbKHggKyA0KSAlIDVdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBUeDEgPSBUWyh4ICsgMSkgJSA1XTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVHgxTXN3ID0gVHgxLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4MUxzdyA9IFR4MS5sb3c7XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBNaXggc3Vycm91bmRpbmcgY29sdW1uc1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0TXN3ID0gVHg0LmhpZ2ggXiAoKFR4MU1zdyA8PCAxKSB8IChUeDFMc3cgPj4+IDMxKSk7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHRMc3cgPSBUeDQubG93ICBeICgoVHgxTHN3IDw8IDEpIHwgKFR4MU1zdyA+Pj4gMzEpKTtcblx0ICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciB5ID0gMDsgeSA8IDU7IHkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW3ggKyA1ICogeV07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUuaGlnaCBePSB0TXN3O1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBsYW5lLmxvdyAgXj0gdExzdztcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJobyBQaVxuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgbGFuZUluZGV4ID0gMTsgbGFuZUluZGV4IDwgMjU7IGxhbmVJbmRleCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVtsYW5lSW5kZXhdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lTXN3ID0gbGFuZS5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lTHN3ID0gbGFuZS5sb3c7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHJob09mZnNldCA9IFJIT19PRkZTRVRTW2xhbmVJbmRleF07XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBSb3RhdGUgbGFuZXNcblx0ICAgICAgICAgICAgICAgICAgICBpZiAocmhvT2Zmc2V0IDwgMzIpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRNc3cgPSAobGFuZU1zdyA8PCByaG9PZmZzZXQpIHwgKGxhbmVMc3cgPj4+ICgzMiAtIHJob09mZnNldCkpO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdExzdyA9IChsYW5lTHN3IDw8IHJob09mZnNldCkgfCAobGFuZU1zdyA+Pj4gKDMyIC0gcmhvT2Zmc2V0KSk7XG5cdCAgICAgICAgICAgICAgICAgICAgfSBlbHNlIC8qIGlmIChyaG9PZmZzZXQgPj0gMzIpICovIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRNc3cgPSAobGFuZUxzdyA8PCAocmhvT2Zmc2V0IC0gMzIpKSB8IChsYW5lTXN3ID4+PiAoNjQgLSByaG9PZmZzZXQpKTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRMc3cgPSAobGFuZU1zdyA8PCAocmhvT2Zmc2V0IC0gMzIpKSB8IChsYW5lTHN3ID4+PiAoNjQgLSByaG9PZmZzZXQpKTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBUcmFuc3Bvc2UgbGFuZXNcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVFBpTGFuZSA9IFRbUElfSU5ERVhFU1tsYW5lSW5kZXhdXTtcblx0ICAgICAgICAgICAgICAgICAgICBUUGlMYW5lLmhpZ2ggPSB0TXN3O1xuXHQgICAgICAgICAgICAgICAgICAgIFRQaUxhbmUubG93ICA9IHRMc3c7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJobyBwaSBhdCB4ID0geSA9IDBcblx0ICAgICAgICAgICAgICAgIHZhciBUMCA9IFRbMF07XG5cdCAgICAgICAgICAgICAgICB2YXIgc3RhdGUwID0gc3RhdGVbMF07XG5cdCAgICAgICAgICAgICAgICBUMC5oaWdoID0gc3RhdGUwLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICBUMC5sb3cgID0gc3RhdGUwLmxvdztcblxuXHQgICAgICAgICAgICAgICAgLy8gQ2hpXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciB4ID0gMDsgeCA8IDU7IHgrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgNTsgeSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZUluZGV4ID0geCArIDUgKiB5O1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW2xhbmVJbmRleF07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBUTGFuZSA9IFRbbGFuZUluZGV4XTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIFR4MUxhbmUgPSBUWygoeCArIDEpICUgNSkgKyA1ICogeV07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBUeDJMYW5lID0gVFsoKHggKyAyKSAlIDUpICsgNSAqIHldO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIE1peCByb3dzXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUuaGlnaCA9IFRMYW5lLmhpZ2ggXiAoflR4MUxhbmUuaGlnaCAmIFR4MkxhbmUuaGlnaCk7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUubG93ICA9IFRMYW5lLmxvdyAgXiAoflR4MUxhbmUubG93ICAmIFR4MkxhbmUubG93KTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIElvdGFcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lID0gc3RhdGVbMF07XG5cdCAgICAgICAgICAgICAgICB2YXIgcm91bmRDb25zdGFudCA9IFJPVU5EX0NPTlNUQU5UU1tyb3VuZF07XG5cdCAgICAgICAgICAgICAgICBsYW5lLmhpZ2ggXj0gcm91bmRDb25zdGFudC5oaWdoO1xuXHQgICAgICAgICAgICAgICAgbGFuZS5sb3cgIF49IHJvdW5kQ29uc3RhbnQubG93Oztcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9GaW5hbGl6ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGRhdGEgPSB0aGlzLl9kYXRhO1xuXHQgICAgICAgICAgICB2YXIgZGF0YVdvcmRzID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G5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lID0gc3RhdGVbaV07XG5cdCAgICAgICAgICAgICAgICB2YXIgbGFuZU1zdyA9IGxhbmUuaGlnaDtcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lTHN3ID0gbGFuZS5sb3c7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgICAgICBsYW5lTXN3ID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKGxhbmVNc3cgPDwgOCkgIHwgKGxhbmVNc3cgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgobGFuZU1zdyA8PCAyNCkgfCAobGFuZU1zdyA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICAgICAgbGFuZUxzdyA9IChcblx0ICAgICAgICAgICAgICAgICAgICAoKChsYW5lTHN3IDw8IDgpICB8IChsYW5lTHN3ID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKGxhbmVMc3cgPDwgMjQpIHwgKGxhbmVMc3cgPj4+IDgpKSAgJiAweGZmMDBmZjAwKVxuXHQgICAgICAgICAgICAgICAgKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gU3F1ZWV6ZSBzdGF0ZSB0byByZXRyaWV2ZSBoYXNoXG5cdCAgICAgICAgICAgICAgICBoYXNoV29yZHMucHVzaChsYW5lTHN3KTtcblx0ICAgICAgICAgICAgICAgIGhhc2hXb3Jkcy5wdXNoKGxhbmVNc3cpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUmV0dXJuIGZpbmFsIGNvbXB1dGVkIGhhc2hcblx0ICAgICAgICAgICAgcmV0dXJuIG5ldyBXb3JkQXJyYXkuaW5pdChoY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QoMHgxZjgzZDlhYiwgMHhmYjQxYmQ2YiksIG5ldyBYNjRXb3JkLmluaXQoMHg1YmUwY2QxOSwgMHgxMzdlMjE3OSlcblx0ICAgICAgICAgICAgXSk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb1Byb2Nlc3NCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIEggPSB0aGlzLl9oYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBIMCA9IEhbMF07XG5cdCAgICAgICAgICAgIHZhciBIMSA9IEhbMV07XG5cdCAgICAgICAgICAgIHZhciBIMiA9IEhbMl07XG5cdCAgICAgICAgICAgIHZhciBIMyA9IEhbM107XG5cdCAgICAgICAgICAgIHZhciBINCA9IEhbNF07XG5cdCAgICAgICAgICAgIHZhciBINSA9IEhbNV07XG5cdCAgICAgICAgICAgIHZhciBINiA9IEhbNl07XG5cdCAgICAgICAgICAgIHZhciBINyA9IEhbN107XG5cblx0ICAgICAgICAgICAgdmFyIEgwaCA9IEgwLmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBIMGwgPSBIMC5sb3c7XG5cdCAgICAgICAgICAgIHZhciBIMWggPSBIMS5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDFsID0gSDEubG93O1xuXHQgICAgICAgICAgICB2YXIgSDJoID0gSDIuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEgybCA9IEgyLmxvdztcblx0ICAgICAgICAgICAgdmFyIEgzaCA9IEgzLmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBIM2wgPSBIMy5sb3c7XG5cdCAgICAgICAgICAgIHZhciBINGggPSBINC5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDRsID0gSDQubG93O1xuXHQgICAgICAgICAgICB2YXIgSDVoID0gSDUuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEg1bCA9IEg1Lmxvdztcblx0ICAgICAgICAgICAgdmFyIEg2aCA9IEg2LmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBINmwgPSBINi5sb3c7XG5cdCAgICAgICAgICAgIHZhciBIN2ggPSBINy5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDdsID0gSDcubG93O1xuXG5cdCAgICAgICAgICAgIC8vIFdvcmtpbmcgdmFyaWFibGVzXG5cdCAgICAgICAgICAgIHZhciBhaCA9IEgwaDtcblx0ICAgICAgICAgICAgdmFyIGFsID0gSDBsO1xuXHQgICAgICAgICAgICB2YXIgYmggPSBIMWg7XG5cdCAgICAgICAgICAgIHZhciBibCA9IEgxbDtcblx0ICAgICAgICAgICAgdmFyIGNoID0gSDJoO1xuXHQgICAgICAgICAgICB2YXIgY2wgPSBIMmw7XG5cdCAgICAgICAgICAgIHZhciBkaCA9IEgzaDtcblx0ICAgICAgICAgICAgdmFyIGRsID0gSDNsO1xuXHQgICAgICAgICAgICB2YXIgZWggPSBINGg7XG5cdCAgICAgICAgICAgIHZhciBlbCA9IEg0bDtcblx0ICAgICAgICAgICAgdmFyIGZoID0gSDVoO1xuXHQgICAgICAgICAgICB2YXIgZmwgPSBINWw7XG5cdCAgICAgICAgICAgIHZhciBnaCA9IEg2aDtcblx0ICAgICAgICAgICAgdmFyIGdsID0gSDZsO1xuXHQgICAgICAgICAgICB2YXIgaGggPSBIN2g7XG5cdCAgICAgICAgICAgIHZhciBobCA9IEg3bDtcblxuXHQgICAgICAgICAgICAvLyBSb3VuZHNcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA4MDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgdmFyIFdpID0gV1tpXTtcblxuXHQgICAgICAgICAgICAgICAgLy8gRXh0ZW5kIG1lc3NhZ2Vcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMTYpIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2loID0gV2kuaGlnaCA9IE1bb2Zmc2V0ICsgaSAqIDJdICAgICB8IDA7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpbCA9IFdpLmxvdyAgPSBNW29mZnNldCArIGkgKiAyICsgMV0gfCAwO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICAvLyBHYW1tYTBcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWEweCAgPSBXW2kgLSAxNV07XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMHhoID0gZ2FtbWEweC5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTB4bCA9IGdhbW1hMHgubG93O1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTBoICA9ICgoZ2FtbWEweGggPj4+IDEpIHwgKGdhbW1hMHhsIDw8IDMxKSkgXiAoKGdhbW1hMHhoID4+PiA4KSB8IChnYW1tYTB4bCA8PCAyNCkpIF4gKGdhbW1hMHhoID4+PiA3KTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWEwbCAgPSAoKGdhbW1hMHhsID4+PiAxKSB8IChnYW1tYTB4aCA8PCAzMSkpIF4gKChnYW1tYTB4bCA+Pj4gOCkgfCAoZ2FtbWEweGggPDwgMjQpKSBeICgoZ2FtbWEweGwgPj4+IDcpIHwgKGdhbW1hMHhoIDw8IDI1KSk7XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBHYW1tYTFcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExeCAgPSBXW2kgLSAyXTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExeGggPSBnYW1tYTF4LmhpZ2g7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMXhsID0gZ2FtbWExeC5sb3c7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMWggID0gKChnYW1tYTF4aCA+Pj4gMTkpIHwgKGdhbW1hMXhsIDw8IDEzKSkgXiAoKGdhbW1hMXhoIDw8IDMpIHwgKGdhbW1hMXhsID4+PiAyOSkpIF4gKGdhbW1hMXhoID4+PiA2KTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExbCAgPSAoKGdhbW1hMXhsID4+PiAxOSkgfCAoZ2FtbWExeGggPDwgMTMpKSBeICgoZ2FtbWExeGwgPDwgMykgfCAoZ2FtbWExeGggPj4+IDI5KSkgXiAoKGdhbW1hMXhsID4+PiA2KSB8IChnYW1tYTF4aCA8PCAyNikpO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgLy8gV1tpXSA9IGdhbW1hMCArIFdbaSAtIDddICsgZ2FtbWExICsgV1tpIC0gMTZdXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpNyAgPSBXW2kgLSA3XTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2k3aCA9IFdpNy5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaTdsID0gV2k3LmxvdztcblxuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaTE2ICA9IFdbaSAtIDE2XTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2kxNmggPSBXaTE2LmhpZ2g7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpMTZsID0gV2kxNi5sb3c7XG5cblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2lsID0gZ2FtbWEwbCArIFdpN2w7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpaCA9IGdhbW1hMGggKyBXaTdoICsgKChXaWwgPj4+IDApIDwgKGdhbW1hMGwgPj4+IDApID8gMSA6IDApO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaWwgPSBXaWwgKyBnYW1tYTFsO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaWggPSBXaWggKyBnYW1tYTFoICsgKChXaWwgPj4+IDApIDwgKGdhbW1hMWwgPj4+IDApID8gMSA6IDApO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaWwgPSBXaWwgKyBXaTE2bDtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2loID0gV2loICsgV2kxNmggKyAoKFdpbCA+Pj4gMCkgPCAoV2kxNmwgPj4+IDApID8gMSA6IDApO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgV2kuaGlnaCA9IFdpaDtcblx0ICAgICAgICAgICAgICAgICAgICBXaS5sb3cgID0gV2lsO1xuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICB2YXIgY2hoICA9IChlaCAmIGZoKSBeICh+ZWggJiBnaCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgY2hsICA9IChlbCAmIGZsKSBeICh+ZWwgJiBnbCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgbWFqaCA9IChhaCAmIGJoKSBeIChhaCAmIGNoKSBeIChiaCAmIGNoKTtcblx0ICAgICAgICAgICAgICAgIHZhciBtYWpsID0gKGFsICYgYmwpIF4gKGFsICYgY2wpIF4gKGJsICYgY2wpO1xuXG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWEwaCA9ICgoYWggPj4+IDI4KSB8IChhbCA8PCA0KSkgIF4gKChhaCA8PCAzMCkgIHwgKGFsID4+PiAyKSkgXiAoKGFoIDw8IDI1KSB8IChhbCA+Pj4gNykpO1xuXHQgICAgICAgICAgICAgICAgdmFyIHNpZ21hMGwgPSAoKGFsID4+PiAyOCkgfCAoYWggPDwgNCkpICBeICgoYWwgPDwgMzApICB8IChhaCA+Pj4gMikpIF4gKChhbCA8PCAyNSkgfCAoYWggPj4+IDcpKTtcblx0ICAgICAgICAgICAgICAgIHZhciBzaWdtYTFoID0gKChlaCA+Pj4gMTQpIHwgKGVsIDw8IDE4KSkgXiAoKGVoID4+PiAxOCkgfCAoZWwgPDwgMTQpKSBeICgoZWggPDwgMjMpIHwgKGVsID4+PiA5KSk7XG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWExbCA9ICgoZWwgPj4+IDE0KSB8IChlaCA8PCAxOCkpIF4gKChlbCA+Pj4gMTgpIHwgKGVoIDw8IDE0KSkgXiAoKGVsIDw8IDIzKSB8IChlaCA+Pj4gOSkpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyB0MSA9IGggKyBzaWdtYTEgKyBjaCArIEtbaV0gKyBXW2ldXG5cdCAgICAgICAgICAgICAgICB2YXIgS2kgID0gS1tpXTtcblx0ICAgICAgICAgICAgICAgIHZhciBLaWggPSBLaS5oaWdoO1xuXHQgICAgICAgICAgICAgICAgdmFyIEtpbCA9IEtpLmxvdztcblxuXHQgICAgICAgICAgICAgICAgdmFyIHQxbCA9IGhsICsgc2lnbWExbDtcblx0ICAgICAgICAgICAgICAgIHZhciB0MWggPSBoaCArIHNpZ21hMWggKyAoKHQxbCA+Pj4gMCkgPCAoaGwgPj4+IDApID8gMSA6IDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQxbCA9IHQxbCArIGNobDtcblx0ICAgICAgICAgICAgICAgIHZhciB0MWggPSB0MWggKyBjaGggKyAoKHQxbCA+Pj4gMCkgPCAoY2hsID4+PiAwKSA/IDEgOiAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciB0MWwgPSB0MWwgKyBLaWw7XG5cdCAgICAgICAgICAgICAgICB2YXIgdDFoID0gdDFoICsgS2loICsgKCh0MWwgPj4+IDApIDwgKEtpbCA+Pj4gMCkgPyAxIDogMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgdDFsID0gdDFsICsgV2lsO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQxaCA9IHQxaCArIFdpaCArICgodDFsID4+PiAwKSA8IChXaWwgPj4+IDApID8gMSA6IDApO1xuXG5cdCAgICAgICAgICAgICAgICAvLyB0MiA9IHNpZ21hMCArIG1halxuXHQgICAgICAgICAgICAgICAgdmFyIHQybCA9IHNpZ21hMGwgKyBtYWpsO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQyaCA9IHNpZ21hMGggKyBtYWpoICsgKCh0MmwgPj4+IDApIDwgKHNpZ21hMGwgPj4+IDApID8gMSA6IDApO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBVcGRhdGUgd29ya2luZyB2YXJpYWJsZXNcblx0ICAgICAgICAgICAgICAgIGhoID0gZ2g7XG5cdCAgICAgICAgICAgICAgICBobCA9IGdsO1xuXHQgICAgICAgICAgICAgICAgZ2ggPSBmaDtcblx0ICAgICAgICAgICAgICAgIGdsID0gZmw7XG5cdCAgICAgICAgICAgICAgICBmaCA9IGVoO1xuXHQgICAgICAgICAgICAgICAgZmwgPSBlbDtcblx0ICAgICAgICAgICAgICAgIGVsID0gKGRsICsgdDFsKSB8IDA7XG5cdCAgICAgICAgICAgICAgICBlaCA9IChkaCArIHQxaCArICgoZWwgPj4+IDApIDwgKGRsID4+PiAwKSA/IDEgOiAwKSkgfCAwO1xuXHQgICAgICAgICAgICAgICAgZGggPSBjaDtcblx0ICAgICAgICAgICAgICAgIGRsID0gY2w7XG5cdCAgICAgICAgICAgICAgICBjaCA9IGJoO1xuXHQgICAgICAgICAgICAgICAgY2wgPSBibDtcblx0ICAgICAgICAgICAgICAgIGJoID0gYWg7XG5cdCAgICAgICAgICAgICAgICBibCA9IGFsO1xuXHQgICAgICAgICAgICAgICAgYWwgPSAodDFsICsgdDJsKSB8IDA7XG5cdCAgICAgICAgICAgICAgICBhaCA9ICh0MWggKyB0MmggKyAoKGFsID4+PiAwKSA8ICh0MWwgPj4+IDApID8gMSA6IDApKSB8IDA7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZGlhdGUgaGFzaCB2YWx1ZVxuXHQgICAgICAgICAgICBIMGwgPSBIMC5sb3cgID0gKEgwbCArIGFsKTtcblx0ICAgICAgICAgICAgSDAuaGlnaCA9IChIMGggKyBhaCArICgoSDBsID4+PiAwKSA8IChhbCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBIMWwgPSBIMS5sb3cgID0gKEgxbCArIGJsKTtcblx0ICAgICAgICAgICAgSDEuaGlnaCA9IChIMWggKyBiaCArICgoSDFsID4+PiAwKSA8IChibCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBIMmwgPSBIMi5sb3cgID0gKEgybCArIGNsKTtcblx0ICAgICAgICAgICAgSDIuaGlnaCA9IChIMmggKyBjaCArICgoSDJsID4+PiAwKSA8IChjbCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBIM2wgPSBIMy5sb3cgID0gKEgzbCArIGRsKTtcblx0ICAgICAgICAgICAgSDMuaGlnaCA9IChIM2ggKyBkaCArICgoSDNsID4+PiAwKSA8IChkbCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBINGwgPSBINC5sb3cgID0gKEg0bCArIGVsKTtcblx0ICAgICAgICAgICAgSDQuaGlnaCA9IChINGggKyBlaCArICgoSDRsID4+PiAwKSA8IChlbCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBINWwgPSBINS5sb3cgID0gKEg1bCArIGZsKTtcblx0ICAgICAgICAgICAgSDUuaGlnaCA9IChINWggKyBmaCArICgoSDVsID4+PiAwKSA8IChmbCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBINmwgPSBINi5sb3cgID0gKEg2bCArIGdsKTtcblx0ICAgICAgICAgICAgSDYuaGlnaCA9IChINmggKyBnaCArICgoSDZsID4+PiAwKSA8IChnbCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBIN2wgPSBINy5sb3cgID0gKEg3bCArIGhsKTtcblx0ICAgICAgICAgICAgSDcuaGlnaCA9IChIN2ggKyBoaCArICgoSDdsID4+PiAwKSA8IChobCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9GaW5h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AgICAgICAgMHhkMDAwMDAwMDogMHg4MDAwMDIsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhmMDAwMDAwMDogMHg4MjAyLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxODAwMDAwMDogMHg4MDgyMDIsXG5cdCAgICAgICAgICAgIDB4MjgwMDAwMDA6IDB4ODIwMixcblx0ICAgICAgICAgICAgMHgzODAwMDAwMDogMHg4MDAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDAwOiAweDgwODIwMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDAwMDogMHgyMDAsXG5cdCAgICAgICAgICAgIDB4NjgwMDAwMDA6IDB4ODA4MDAyLFxuXHQgICAgICAgICAgICAweDc4MDAwMDAwOiAweDIsXG5cdCAgICAgICAgICAgIDB4ODgwMDAwMDA6IDB4ODAwMjAwLFxuXHQgICAgICAgICAgICAweDk4MDAwMDAwOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDAwMDA6IDB4ODA4MDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwMDAwOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHhjODAwMDAwMDogMHg4MDAwMDIsXG5cdCAgICAgICAgICAgIDB4ZDgwMDAwMDA6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhlODAwMDAwMDogMHgyMDIsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwMDA6IDB4ODAwMDAwLFxuXHQgICAgICAgICAgICAweDE6IDB4ODAwMCxcblx0ICAgICAgICAgICAgMHgxMDAwMDAwMTogMHgyLFxuXHQgICAgICAgICAgICAweDIwMDAwMDAxOiAweDgwODIwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDAwMTogMHg4MDAwMDAsXG5cdCAgICAgICAgICAgIDB4NDAwMDAwMDE6IDB4ODA4MDAyLFxuXHQgICAgICAgICAgICAweDUwMDAwMDAxOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4NjAwMDAwMDE6IDB4MjAwLFxuXHQgICAgICAgICAgICAweDcwMDAwMDAxOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMTogMHg4MDgyMDIsXG5cdCAgICAgICAgICAgIDB4OTAwMDAwMDE6IDB4ODA4MDAwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDAxOiAweDgwMDAwMixcblx0ICAgICAgICAgICAgMHhiMDAwMDAwMTogMHg4MjAyLFxuXHQgICAgICAgICAgICAweGMwMDAwMDAxOiAweDIwMixcblx0ICAgICAgICAgICAgMHhkMDAwMDAwMTogMHg4MDAyMDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwMDE6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhmMDAwMDAwMTogMHgwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE6IDB4ODA4MjAyLFxuXHQgICAgICAgICAgICAweDE4MDAwMDAxOiAweDgwODAwMCxcblx0ICAgICAgICAgICAgMHgyODAwMDAwMTogMHg4MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MzgwMDAwMDE6IDB4MjAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDAxOiAweDgwMDAsXG5cdCAgICAgICAgICAgIDB4NTgwMDAwMDE6IDB4ODAwMDAyLFxuXHQgICAgICAgICAgICAweDY4MDAwMDAxOiAweDIsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwMDE6IDB4ODIwMixcblx0ICAgICAgICAgICAgMHg4ODAwMDAwMTogMHg4MDAyLFxuXHQgICAgICAgICAgICAweDk4MDAwMDAxOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHhhODAwMDAwMTogMHgyMDIsXG5cdCAgICAgICAgICAgIDB4YjgwMDAwMDE6IDB4ODA4MjAwLFxuXHQgICAgICAgICAgICAweGM4MDAwMDAxOiAweDgwMDIwMCxcblx0ICAgICAgICAgICAgMHhkODAwMDAwMTogMHgwLFxuXHQgICAgICAgICAgICAweGU4MDAwMDAxOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwMDE6IDB4ODA4MDAyXG5cdCAgICAgICAgfSxcblx0ICAgICAgICB7XG5cdCAgICAgICAgICAgIDB4MDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHgxMDAwMDAwOiAweDQwMDAsXG5cdCAgICAgICAgICAgIDB4MjAwMDAwMDogMHg4MDAwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDAwOiAweDQwMDgwMDEwLFxuXHQgICAgICAgICAgICAweDQwMDAwMDA6IDB4NDAwMDAwMTAsXG5cdCAgICAgICAgICAgIDB4NTAwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHg2MDAwMDAwOiAweDQwMDA0MDAwLFxuXHQgICAgICAgICAgICAweDcwMDAwMDA6IDB4MTAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDogMHg4NDAwMCxcblx0ICAgICAgICAgICAgMHg5MDAwMDAwOiAweDQwMDA0MDEwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDA6IDB4NDAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4YjAwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHhjMDAwMDAwOiAweDgwMDEwLFxuXHQgICAgICAgICAgICAweGQwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhlMDAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4ZjAwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDA6IDB4NDAwMDQwMDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHgyODAwMDAwOiAweDEwLFxuXHQgICAgICAgICAgICAweDM4MDAwMDA6IDB4NDAwMDQwMTAsXG5cdCAgICAgICAgICAgIDB4NDgwMDAwMDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDAwOiAweDQwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDY4MDAwMDA6IDB4ODAwMDAsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwMDogMHg0MDA4MDAxMCxcblx0ICAgICAgICAgICAgMHg4ODAwMDAwOiAweDgwMDEwLFxuXHQgICAgICAgICAgICAweDk4MDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhhODAwMDAwOiAweDQwMDAsXG5cdCAgICAgICAgICAgIDB4YjgwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHhjODAwMDAwOiAweDQwMDAwMDEwLFxuXHQgICAgICAgICAgICAweGQ4MDAwMDA6IDB4ODQwMDAsXG5cdCAgICAgICAgICAgIDB4ZTgwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHhmODAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4MTAwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxMTAwMDAwMDogMHg0MDA4MDAxMCxcblx0ICAgICAgICAgICAgMHgxMjAwMDAwMDogMHg0MDAwNDAxMCxcblx0ICAgICAgICAgICAgMHgxMzAwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHgxNDAwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHgxNTAwMDAwMDogMHgxMCxcblx0ICAgICAgICAgICAgMHgxNjAwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHgxNzAwMDAwMDogMHg0MDAwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4MTkwMDAwMDA6IDB4ODAwMDAsXG5cdCAgICAgICAgICAgIDB4MWEwMDAwMDA6IDB4ODAwMTAsXG5cdCAgICAgICAgICAgIDB4MWIwMDAwMDA6IDB4NDAwMDAwMTAsXG5cdCAgICAgICAgICAgIDB4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Cxcblx0ICAgICAgICAgICAgMHgzMDAwMDA6IDB4MTAxMDQsXG5cdCAgICAgICAgICAgIDB4NDAwMDAwOiAweDEwMDA0LFxuXHQgICAgICAgICAgICAweDUwMDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDYwMDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDcwMDAwMDogMHg0MDEwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDogMHg0MDAwMDAwLFxuXHQgICAgICAgICAgICAweDkwMDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDogMHgxMDEwMCxcblx0ICAgICAgICAgICAgMHhiMDAwMDA6IDB4NDAxMDAwNCxcblx0ICAgICAgICAgICAgMHhjMDAwMDA6IDB4NDAwMDEwNCxcblx0ICAgICAgICAgICAgMHhkMDAwMDA6IDB4MTAwMDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwOiAweDQsXG5cdCAgICAgICAgICAgIDB4ZjAwMDAwOiAweDEwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDogMHg0MDEwMDA0LFxuXHQgICAgICAgICAgICAweDI4MDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDM4MDAwMDogMHg0MDAwMTAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDU4MDAwMDogMHgxMDAwMCxcblx0ICAgICAgICAgICAgMHg2ODAwMDA6IDB4MTAwMDQsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwOiAweDEwNCxcblx0ICAgICAgICAgICAgMHg4ODAwMDA6IDB4NCxcblx0ICAgICAgICAgICAgMHg5ODAwMDA6IDB4MTAwLFxuXHQgICAgICAgICAgICAweGE4MDAwMDogMHg0MDEwMDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwMDogMHgxMDEwNCxcblx0ICAgICAgICAgICAgMHhjODAwMDA6IDB4MTAxMDAsXG5cdCAgICAgICAgICAgIDB4ZDgwMDAwOiAweDQwMDAxMDQsXG5cdCAgICAgICAgICAgIDB4ZTgwMDAwOiAweDQwMTAxMDQsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwOiAweDQwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTAwMDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweDExMDAwMDA6IDB4MTAwMDQsXG5cdCAgICAgICAgICAgIDB4MTIwMDAwMDogMHgxMDAwMCxcblx0ICAgICAgICAgICAgMHgxMzAwMDAwOiAweDQwMDAxMDAsXG5cdCAgICAgICAgICAgIDB4MTQwMDAwMDogMHgxMDAsXG5cdCAgICAgICAgICAgIDB4MTUwMDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDE2MDAwMDA6IDB4NDAwMDAwNCxcblx0ICAgICAgICAgICAgMHgxNzAwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwMDogMHg0MDAwMTA0LFxuXHQgICAgICAgICAgICAweDE5MDAwMDA6IDB4NDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYTAwMDAwOiAweDQsXG5cdCAgICAgICAgICAgIDB4MWIwMDAwMDogMHgxMDEwMCxcblx0ICAgICAgICAgICAgMHgxYzAwMDAwOiAweDQwMTAwMDAsXG5cdCAgICAgICAgICAgIDB4MWQwMDAwMDogMHgxMDQsXG5cdCAgICAgICAgICAgIDB4MWUwMDAwMDogMHgxMDEwNCxcblx0ICAgICAgICAgICAgMHgxZjAwMDAwOiAweDQwMTAwMDQsXG5cdCAgICAgICAgICAgIDB4MTA4MDAwMDogMHg0MDAwMDAwLFxuXHQgICAgICAgICAgICAweDExODAwMDA6IDB4MTA0LFxuXHQgICAgICAgICAgICAweDEyODAwMDA6IDB4NDAxMDEwMCxcblx0ICAgICAgICAgICAgMHgxMzgwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTQ4MDAwMDogMHgxMDAwNCxcblx0ICAgICAgICAgICAgMHgxNTgwMDAwOiAweDQwMDAxMDAsXG5cdCAgICAgICAgICAgIDB4MTY4MDAwMDogMHgxMDAsXG5cdCAgICAgICAgICAgIDB4MTc4MDAwMDogMHg0MDEwMDA0LFxuXHQgICAgICAgICAgICAweDE4ODAwMDA6IDB4MTAwMDAsXG5cdCAgICAgICAgICAgIDB4MTk4MDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDFhODAwMDA6IDB4MTAxMDQsXG5cdCAgICAgICAgICAgIDB4MWI4MDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDFjODAwMDA6IDB4NDAwMDEwNCxcblx0ICAgICAgICAgICAgMHgxZDgwMDAwOiAweDQwMTAwMDAsXG5cdCAgICAgICAgICAgIDB4MWU4MDAwMDogMHg0LFxuXHQgICAgICAgICAgICAweDFmODAwMDA6IDB4MTAxMDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwNDAxMDAwLFxuXHQgICAgICAgICAgICAweDEwMDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDIwMDAwOiAweDQwMTA0MCxcblx0ICAgICAgICAgICAgMHgzMDAwMDogMHg4MDQwMDAwMCxcblx0ICAgICAgICAgICAgMHg0MDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDUwMDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHg2MDAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHg3MDAwMDogMHg0MDAwNDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4OTAwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweGEwMDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweGIwMDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweGMwMDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweGQwMDAwOiAweDEwNDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDA6IDB4MTAwMCxcblx0ICAgICAgICAgICAgMHhmMDAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHg4MDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDE4MDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDI4MDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweDM4MDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHg2ODAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDc4MDAwOiAweDgwNDAwMDAwLFxuXHQgICAgICAgICAgICAweDg4MDAwOiAweDEwMDAsXG5cdCAgICAgICAgICAgIDB4OTgwMDA6IDB4ODA0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwOiAweDEwNDAsXG5cdCAgICAgICAgICAgIDB4YzgwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ZDgwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweGU4MDAwOiAweDQwMTA0MCxcblx0ICAgICAgICAgICAgMHhmODAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHgxMDAwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweDExMDAwMDogMHg0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4MTIwMDAwOiAweDgwMDAwMDQwLFxuXHQgICAgICAgICAgICAweDEzMDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDE0MDAwMDogMHgxMDQwLFxuXHQgICAgICAgICAgICAweDE1MDAwMDogMHg4MDQwMDA0MCxcblx0ICAgICAgICAgICAgMHgxNjAwMDA6IDB4ODA0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4MTcwMDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHgxOTAwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWEwMDAwOiAweDgwNDAwMDAwLFxuXHQgICAgICAgICAgICAweDFiMDAwMDogMHg0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4MWMwMDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweDFkMDAwMDogMHg0MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWUwMDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDFmMDAwMDogMHgxMDAwLFxuXHQgICAgICAgICAgICAweDEwODAwMDogMHg4MDQwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMTgwMDA6IDB4ODA0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTI4MDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHgxNDgwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweDE1ODAwMDogMHg4MDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNjgwMDA6IDB4ODAwMDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTc4MDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDE4ODAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHgxOTgwMDA6IDB4MTAwMCxcblx0ICAgICAgICAgICAgMHgxYTgwMDA6IDB4ODAwMDEwMDAsXG5cdCAgICAgICAgICAgIDB4MWI4MDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweDFjODAwMDogMHgxMDQwLFxuXHQgICAgICAgICAgICAweDFkODAwMDogMHg4MDQwMTAwMCxcblx0ICAgICAgICAgICAgMHgxZTgwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweDFmODAwMDogMHg0MDEwNDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwLFxuXHQgICAgICAgICAgICAweDEwMDA6IDB4MTA0MDAwMCxcblx0ICAgICAgICAgICAgMHgyMDAwOiAweDQwMDAwLFxuXHQgICAgICAgICAgICAweDMwMDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4NDAwMDogMHgyMDA0MDA4MCxcblx0ICAgICAgICAgICAgMHg1MDAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4NjAwMDogMHgyMTAwMDA4MCxcblx0ICAgICAgICAgICAgMHg3MDAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDgwMDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHg5MDAwOiAweDIwMDQwMDAwLFxuXHQgICAgICAgICAgICAweGEwMDA6IDB4MjAwMDAwODAsXG5cdCAgICAgICAgICAgIDB4YjAwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHhjMDAwOiAweDIxMDQwMDAwLFxuXHQgICAgICAgICAgICAweGQwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhlMDAwOiAweDEwNDAwODAsXG5cdCAgICAgICAgICAgIDB4ZjAwMDogMHgyMTAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxODAwOiAweDIxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDI4MDA6IDB4ODAsXG5cdCAgICAgICAgICAgIDB4MzgwMDogMHgxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDA6IDB4NDAwMDAsXG5cdCAgICAgICAgICAgIDB4NTgwMDogMHgyMDA0MDA4MCxcblx0ICAgICAgICAgICAgMHg2ODAwOiAweDIxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDc4MDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODgwMDogMHgyMDA0MDAwMCxcblx0ICAgICAgICAgICAgMHg5ODAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHhiODAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4YzgwMDogMHgyMDAwMDA4MCxcblx0ICAgICAgICAgICAgMHhkODAwOiAweDIxMDAwMDAwLFxuXHQgICAgICAgICAgICAweGU4MDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHhmODAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDEwMDAwOiAweDQwMDAwLFxuXHQgICAgICAgICAgICAweDExMDAwOiAweDgwLFxuXHQgICAgICAgICAgICAweDEyMDAwOiAweDIwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEzMDAwOiAweDIxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDE0MDAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MTUwMDA6IDB4MjEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTYwMDA6IDB4MjAwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTcwMDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxODAwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxOTAwMDogMHgyMTAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYTAwMDogMHgxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDFiMDAwOiAweDIwMDQwMDAwLFxuXHQgICAgICAgICAgICAweDFjMDAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDFkMDAwOiAweDIwMDAwMDgwLFxuXHQgICAgICAgICAgICAweDFlMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MWYwMDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxMDgwMDogMHgyMTAwMDA4MCxcblx0ICAgICAgICAgICAgMHgxMTgwMDogMHgxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEyODAwOiAweDEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDA6IDB4MjAwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTQ4MDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTU4MDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxNjgwMDogMHg4MCxcblx0ICAgICAgICAgICAgMHgxNzgwMDogMHgyMTA0MDAwMCxcblx0ICAgICAgICAgICAgMHgxODgwMDogMHg0MDA4MCxcblx0ICAgICAgICAgICAgMHgxOTgwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxYTgwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFiODAwOiAweDIxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDFjODAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MWQ4MDA6IDB4NDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWU4MDA6IDB4MjAwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWY4MDA6IDB4MjAwMDAwODBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDEwMDAwMDA4LFxuXHQgICAgICAgICAgICAweDEwMDogMHgyMDAwLFxuXHQgICAgICAgICAgICAweDIwMDogMHgxMDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgzMDA6IDB4MTAyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4NDAwOiAweDEwMDAyMDAwLFxuXHQgICAgICAgICAgICAweDUwMDogMHgyMDAwMDAsXG5cdCAgICAgICAgICAgIDB4NjAwOiAweDIwMDAwOCxcblx0ICAgICAgICAgICAgMHg3MDA6IDB4MTAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4OTAwOiAweDEwMDAyMDA4LFxuXHQgICAgICAgICAgICAweGEwMDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4YjAwOiAweDgsXG5cdCAgICAgICAgICAgIDB4YzAwOiAweDEwMjAwMDA4LFxuXHQgICAgICAgICAgICAweGQwMDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4ZTAwOiAweDIwMDgsXG5cdCAgICAgICAgICAgIDB4ZjAwOiAweDEwMjAyMDAwLFxuXHQgICAgICAgICAgICAweDgwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDE4MDogMHgxMDIwMjAwOCxcblx0ICAgICAgICAgICAgMHgyODA6IDB4OCxcblx0ICAgICAgICAgICAgMHgzODA6IDB4MjAwMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4NTgwOiAweDEwMDAwMDA4LFxuXHQgICAgICAgICAgICAweDY4MDogMHgxMDAwMjAwMCxcblx0ICAgICAgICAgICAgMHg3ODA6IDB4MjAwOCxcblx0ICAgICAgICAgICAgMHg4ODA6IDB4MjAwMDA4LFxuXHQgICAgICAgICAgICAweDk4MDogMHgyMDAwLFxuXHQgICAgICAgICAgICAweGE4MDogMHgxMDAwMjAwOCxcblx0ICAgICAgICAgICAgMHhiODA6IDB4MTAyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4YzgwOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZDgwOiAweDEwMjAyMDAwLFxuXHQgICAgICAgICAgICAweGU4MDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4ZjgwOiAweDEwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEwMDA6IDB4MTAwMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTEwMDogMHgxMDIwMDAwOCxcblx0ICAgICAgICAgICAgMHgxMjAwOiAweDEwMjAyMDA4LFxuXHQgICAgICAgICAgICAweDEzMDA6IDB4MjAwOCxcblx0ICAgICAgICAgICAgMHgxNDAwOiAweDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNTAwOiAweDEwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDE2MDA6IDB4MTAwMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTcwMDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MTkwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFhMDA6IDB4OCxcblx0ICAgICAgICAgICAgMHgxYjAwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDFjMDA6IDB4MjAwMCxcblx0ICAgICAgICAgICAgMHgxZDAwOiAweDEwMDAyMDA4LFxuXHQgICAgICAgICAgICAweDFlMDA6IDB4MTAyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MWYwMDogMHgyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTA4MDogMHg4LFxuXHQgICAgICAgICAgICAweDExODA6IDB4MjAyMDAwLFxuXHQgICAgICAgICAgICAweDEyODA6IDB4MjAwMDAwLFxuXHQgICAgICAgICAgICAweDEzODA6IDB4MTAwMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTQ4MDogMHgxMDAwMjAwMCxcblx0ICAgICAgICAgICAgMHgxNTgwOiAweDIwMDgsXG5cdCAgICAgICAgICAgIDB4MTY4MDogMHgxMDIwMjAwOCxcblx0ICAgICAgICAgICAgMHgxNzgwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDE4ODA6IDB4MTAyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTk4MDogMHgxMDIwMDAwOCxcblx0ICAgICAgICAgICAgMHgxYTgwOiAweDIwMDAsXG5cdCAgICAgICAgICAgIDB4MWI4MDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MWM4MDogMHgyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MWQ4MDogMHgwLFxuXHQgICAgICAgICAgICAweDFlODA6IDB4MTAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWY4MDogMHgxMDAwMjAwOFxuXHQgICAgICAgIH0sXG5cdCAgICAgICAge1xuXHQgICAgICAgICAgICAweDA6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDEwOiAweDIwMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MjA6IDB4NDAwLFxuXHQgICAgICAgICAgICAweDMwOiAweDEwMDQwMSxcblx0ICAgICAgICAgICAgMHg0MDogMHgyMTAwNDAxLFxuXHQgICAgICAgICAgICAweDUwOiAweDAsXG5cdCAgICAgICAgICAgIDB4NjA6IDB4MSxcblx0ICAgICAgICAgICAgMHg3MDogMHgyMTAwMDAxLFxuXHQgICAgICAgICAgICAweDgwOiAweDIwMDA0MDAsXG5cdCAgICAgICAgICAgIDB4OTA6IDB4MTAwMDAxLFxuXHQgICAgICAgICAgICAweGEwOiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4YjA6IDB4MjEwMDQwMCxcblx0ICAgICAgICAgICAgMHhjMDogMHgyMTAwMDAwLFxuXHQgICAgICAgICAgICAweGQwOiAweDQwMSxcblx0ICAgICAgICAgICAgMHhlMDogMHgxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4ZjA6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4OiAweDIxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MTg6IDB4MCxcblx0ICAgICAgICAgICAgMHgyODogMHgyMDAwNDAxLFxuXHQgICAgICAgICAgICAweDM4OiAweDIxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4NDg6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDU4OiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4Njg6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHg3ODogMHg0MDEsXG5cdCAgICAgICAgICAgIDB4ODg6IDB4MTAwNDAxLFxuXHQgICAgICAgICAgICAweDk4OiAweDIwMDA0MDAsXG5cdCAgICAgICAgICAgIDB4YTg6IDB4MjEwMDAwMCxcblx0ICAgICAgICAgICAgMHhiODogMHgxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4Yzg6IDB4NDAwLFxuXHQgICAgICAgICAgICAweGQ4OiAweDIxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4ZTg6IDB4MSxcblx0ICAgICAgICAgICAgMHhmODogMHgxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MTAwOiAweDIwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTEwOiAweDEwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMjA6IDB4MjAwMDQwMSxcblx0ICAgICAgICAgICAgMHgxMzA6IDB4MjEwMDAwMSxcblx0ICAgICAgICAgICAgMHgxNDA6IDB4MTAwMDAxLFxuXHQgICAgICAgICAgICAweDE1MDogMHgyMDAwNDAwLFxuXHQgICAgICAgICAgICAweDE2MDogMHgyMTAwNDAwLFxuXHQgICAgICAgICAgICAweDE3MDogMHgxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MTgwOiAweDQwMSxcblx0ICAgICAgICAgICAgMHgxOTA6IDB4MjEwMDQwMSxcblx0ICAgICAgICAgICAgMHgxYTA6IDB4MTAwNDAwLFxuXHQgICAgICAgICAgICAweDFiMDogMHgxLFxuXHQgICAgICAgICAgICAweDFjMDogMHgwLFxuXHQgICAgICAgICAgICAweDFkMDogMHgyMTAwMDAwLFxuXHQgICAgICAgICAgICAweDFlMDogMHgyMDAwMDAxLFxuXHQgICAgICAgICAgICAweDFmMDogMHg0MDAsXG5cdCAgICAgICAgICAgIDB4MTA4OiAweDEwMDQwMCxcblx0ICAgICAgICAgICAgMHgxMTg6IDB4MjAwMDQwMSxcblx0ICAgICAgICAgICAgMHgxMjg6IDB4MjEwMDAwMSxcblx0ICAgICAgICAgICAgMHgxMzg6IDB4MSxcblx0ICAgICAgICAgICAgMHgxNDg6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNTg6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDE2ODogMHg0MDEsXG5cdCAgICAgICAgICAgIDB4MTc4OiAweDIxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MTg4OiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MTk4OiAweDIxMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWE4OiAweDAsXG5cdCAgICAgICAgICAgIDB4MWI4OiAweDIxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MWM4OiAweDEwMDQwMSxcblx0ICAgICAgICAgICAgMHgxZDg6IDB4NDAwLFxuXHQgICAgICAgICAgICAweDFlODogMHgyMDAwNDAwLFxuXHQgICAgICAgICAgICAweDFmODogMHgxMDAwMDFcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwMDA4MjAsXG5cdCAgICAgICAgICAgIDB4MTogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgyOiAweDgwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MzogMHgyMCxcblx0ICAgICAgICAgICAgMHg0OiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDU6IDB4ODAyMDgyMCxcblx0ICAgICAgICAgICAgMHg2OiAweDgwMjA4MDAsXG5cdCAgICAgICAgICAgIDB4NzogMHg4MDAsXG5cdCAgICAgICAgICAgIDB4ODogMHg4MDIwMDAwLFxuXHQgICAgICAgICAgICAweDk6IDB4ODAwMDgwMCxcblx0ICAgICAgICAgICAgMHhhOiAweDIwODAwLFxuXHQgICAgICAgICAgICAweGI6IDB4ODAyMDAyMCxcblx0ICAgICAgICAgICAgMHhjOiAweDgyMCxcblx0ICAgICAgICAgICAgMHhkOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZTogMHg4MDAwMDIwLFxuXHQgICAgICAgICAgICAweGY6IDB4MjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDA6IDB4ODAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDAxOiAweDgwMjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDI6IDB4ODAwMDgyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMzogMHg4MDAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA0OiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDU6IDB4MjA4MDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDY6IDB4MjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDc6IDB4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDg6IDB4ODAwMDAyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwOTogMHg4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGE6IDB4MjAwMjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGI6IDB4ODAyMDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwYzogMHgwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDBkOiAweDgwMjAwMjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGU6IDB4ODAwMDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwZjogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgxMDogMHgyMDgyMCxcblx0ICAgICAgICAgICAgMHgxMTogMHg4MDIwODAwLFxuXHQgICAgICAgICAgICAweDEyOiAweDIwLFxuXHQgICAgICAgICAgICAweDEzOiAweDgwMCxcblx0ICAgICAgICAgICAgMHgxNDogMHg4MDAwODAwLFxuXHQgICAgICAgICAgICAweDE1OiAweDgwMDAwMjAsXG5cdCAgICAgICAgICAgIDB4MTY6IDB4ODAyMDAyMCxcblx0ICAgICAgICAgICAgMHgxNzogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgxODogMHgwLFxuXHQgICAgICAgICAgICAweDE5OiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDFhOiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4MWI6IDB4ODAwMDgyMCxcblx0ICAgICAgICAgICAgMHgxYzogMHg4MDIwODIwLFxuXHQgICAgICAgICAgICAweDFkOiAweDIwODAwLFxuXHQgICAgICAgICAgICAweDFlOiAweDgyMCxcblx0ICAgICAgICAgICAgMHgxZjogMHg4MDAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDEwOiAweDIwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDExOiAweDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxMjogMHg4MDIwMDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDEzOiAweDIwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE0OiAweDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE1OiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMTY6IDB4ODAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxNzogMHg4MDAwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE4OiAweDgwMjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMTk6IDB4ODAwMDAyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxYTogMHg4MDAwODAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFiOiAweDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMWM6IDB4MjA4MDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMWQ6IDB4ODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFlOiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFmOiAweDgwMjA4MDBcblx0ICAgICAgICB9XG5cdCAgICBdO1xuXG5cdCAgICAvLyBNYXNrcyB0aGF0IHNlbGVjdCB0aGUgU0JPWCBpbnB1dFxuXHQgICAgdmFyIFNCT1hfTUFTSyA9IFtcblx0ICAgICAgICAweGY4MDAwMDAxLCAweDFmODAwMDAwLCAweDAxZjgwMDAwLCAweDAwMWY4MDAwLFxuXHQgICAgICAgIDB4MDAwMWY4MDAsIDB4MDAwMDFmODAsIDB4MDAwMDAxZjgsIDB4ODAwMDAwMWZcblx0ICAgIF07XG5cblx0ICAgIC8qKlxuXHQgICAgICogREVTIGJsb2NrIGNpcGhlciBhbGdvcml0aG0uXG5cdCAgICAgKi9cblx0ICAgIHZhciBERVMgPSBDX2FsZ28uREVTID0gQmxvY2tDaXBoZXIuZXh0ZW5kKHtcblx0ICAgICAgICBfZG9SZXNldDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGtleSA9IHRoaXMuX2tleTtcblx0ICAgICAgICAgICAgdmFyIGtleVdvcmRzID0ga2V5LndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFNlbGVjdCA1NiBiaXRzIGFjY29yZGluZyB0byBQQzFcblx0ICAgICAgICAgICAgdmFyIGtleUJpdHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA1NjsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIga2V5Qml0UG9zID0gUEMxW2ldIC0gMTtcblx0ICAgICAgICAgICAgICAgIGtleUJpdHNbaV0gPSAoa2V5V29yZHNba2V5Qml0UG9zID4+PiA1XSA+Pj4gKDMxIC0ga2V5Qml0UG9zICUgMzIpKSAmIDE7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBBc3NlbWJsZSAxNiBzdWJrZXlzXG5cdCAgICAgICAgICAgIHZhciBzdWJLZXlzID0gdGhpcy5fc3ViS2V5cyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBuU3ViS2V5ID0gMDsgblN1YktleSA8IDE2OyBuU3ViS2V5KyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIENyZWF0ZSBzdWJrZXlcblx0ICAgICAgICAgICAgICAgIHZhciBzdWJLZXkgPSBzdWJLZXlzW25TdWJLZXldID0gW107XG5cblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICB2YXIgYml0U2hpZnQgPSBCSVRfU0hJRlRTW25TdWJLZXldO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTZWxlY3QgNDggYml0cyBhY2NvcmRpbmcgdG8gUEMyXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAvLyBTZWxlY3QgZnJvbSB0aGUgbGVmdCAyOCBrZXkgYml0c1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVsoaSAvIDYpIHwgMF0gfD0ga2V5Qml0c1soKFBDMltpXSAtIDEpICsgYml0U2hpZnQpICUgMjhdIDw8ICgzMSAtIGkgJSA2KTtcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFNlbGVjdCBmcm9tIHRoZSByaWdodCAyOCBrZXkgYml0c1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVs0ICsgKChpIC8gNikgfCAwKV0gfD0ga2V5Qml0c1syOCArICgoKFBDMltpICsgMjRdIC0gMSkgKyBiaXRTaGlmdCkgJSAyOCldIDw8ICgzMSAtIGkgJSA2KTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gU2luY2UgZWFjaCBzdWJrZXkgaXMgYXBwbGllZCB0byBhbiBleHBhbmRlZCAzMi1iaXQgaW5wdXQsXG5cdCAgICAgICAgICAgICAgICAvLyB0aGUgc3Via2V5IGNhbiBiZSBicm9rZW4gaW50byA4IHZhbHVlcyBzY2FsZWQgdG8gMzItYml0cyxcblx0ICAgICAgICAgICAgICAgIC8vIHdoaWNoIGFsbG93cyB0aGUga2V5IHRvIGJlIHVzZWQgd2l0aG91dCBleHBhbnNpb25cblx0ICAgICAgICAgICAgICAgIHN1YktleVswXSA9IChzdWJLZXlbMF0gPDwgMSkgfCAoc3ViS2V5WzBdID4+PiAzMSk7XG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IDc7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVtpXSA9IHN1YktleVtpXSA+Pj4gKChpIC0gMSkgKiA0ICsgMyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICBzdWJLZXlbN10gPSAoc3ViS2V5WzddIDw8IDUpIHwgKHN1YktleVs3XSA+Pj4gMjcpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBpbnZlcnNlIHN1YmtleXNcblx0ICAgICAgICAgICAgdmFyIGludlN1YktleXMgPSB0aGlzLl9pbnZTdWJLZXlzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMTY7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgaW52U3ViS2V5c1tpXSA9IHN1YktleXNbMTUgLSBpXTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBlbmNyeXB0QmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgdGhpcy5fZG9DcnlwdEJsb2NrKE0sIG9mZnNldCwgdGhpcy5fc3ViS2V5cyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIGRlY3J5cHRCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICB0aGlzLl9kb0NyeXB0QmxvY2soTSwgb2Zmc2V0LCB0aGlzLl9pbnZTdWJLZXlzKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvQ3J5cHRCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCwgc3ViS2V5cykge1xuXHQgICAgICAgICAgICAvLyBHZXQgaW5wdXRcblx0ICAgICAgICAgICAgdGhpcy5fbEJsb2NrID0gTVtvZmZzZXRdO1xuXHQgICAgICAgICAgICB0aGlzLl9yQmxvY2sgPSBNW29mZnNldCArIDFdO1xuXG5cdCAgICAgICAgICAgIC8vIEluaXRpYWwgcGVybXV0YXRpb25cblx0ICAgICAgICAgICAgZXhjaGFuZ2VMUi5jYWxsKHRoaXMsIDQsICAweDBmMGYwZjBmKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VMUi5jYWxsKHRoaXMsIDE2LCAweDAwMDBmZmZmKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VSTC5jYWxsKHRoaXMsIDIsICAweDMzMzMzMzMzKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VSTC5jYWxsKHRoaXMsIDgsICAweDAwZmYwMGZmKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VMUi5jYWxsKHRoaXMsIDEsICAweDU1NTU1NTU1KTtcblxuXHQgICAgICAgICAgICAvLyBSb3VuZHNcblx0ICAgICAgICAgICAgZm9yICh2YXIgcm91bmQgPSAwOyByb3VuZCA8IDE2OyByb3VuZCsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBzdWJLZXkgPSBzdWJLZXlzW3JvdW5kXTtcblx0ICAgICAgICAgICAgICAgIHZhciBsQmxvY2sgPSB0aGlzLl9sQmxvY2s7XG5cdCAgICAgICAgICAgICAgICB2YXIgckJsb2NrID0gdGhpcy5fckJsb2NrO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBGZWlzdGVsIGZ1bmN0aW9uXG5cdCAgICAgICAgICAgICAgICB2YXIgZiA9IDA7XG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDg7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGYgfD0gU0JPWF9QW2ldWygockJsb2NrIF4gc3ViS2V5W2ldKSAmIFNCT1hfTUFTS1tpXSkgPj4+IDBdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdGhpcy5fbEJsb2NrID0gckJsb2NrO1xuXHQgICAgICAgICAgICAgICAgdGhpcy5fckJsb2NrID0gbEJsb2NrIF4gZjtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIFVuZG8gc3dhcCBmcm9tIGxhc3Qgcm91bmRcblx0ICAgICAgICAgICAgdmFyIHQgPSB0aGlzLl9sQmxvY2s7XG5cdCAgICAgICAgICAgIHRoaXMuX2xCbG9jayA9IHRoaXMuX3JCbG9jaztcblx0ICAgICAgICAgICAgdGhpcy5fckJsb2NrID0gdDtcblxuXHQgICAgICAgICAgICAvLyBGaW5hbCBwZXJtdXRhdGlvblxuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgMSwgIDB4NTU1NTU1NTUpO1xuXHQgICAgICAgICAgICBleGNoYW5nZVJMLmNhbGwodGhpcywgOCwgIDB4MDBmZjAwZmYpO1xuXHQgICAgICAgICAgICBleGNoYW5nZVJMLmNhbGwodGhpcywgMiwgIDB4MzMzMzMzMzMpO1xuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgMTYsIDB4MDAwMGZmZmYpO1xuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgNCwgIDB4MGYwZjBmMGYpO1xuXG5cdCAgICAgICAgICAgIC8vIFNldCBvdXRwdXRcblx0ICAgICAgICAgICAgTVtvZmZzZXRdID0gdGhpcy5fbEJsb2NrO1xuXHQgICAgICAgICAgICBNW29mZnNldCArIDFdID0gdGhpcy5fckJsb2NrO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBrZXlTaXplOiA2NC8zMixcblxuXHQgICAgICAgIGl2U2l6ZTogNjQvMzIsXG5cblx0ICAgICAgICBibG9ja1NpemU6IDY0LzMyXG5cdCAgICB9KTtcblxuXHQgICAgLy8gU3dhcC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AgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgYW5kZWQgPSB4NjRXb3JkLmFuZChhbm90aGVyWDY0V29yZCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgLy8gYW5kOiBmdW5jdGlvbiAod29yZCkge1xuXHQgICAgICAgICAgICAvLyB2YXIgaGlnaCA9IHRoaXMuaGlnaCAmIHdvcmQuaGlnaDtcblx0ICAgICAgICAgICAgLy8gdmFyIGxvdyA9IHRoaXMubG93ICYgd29yZC5sb3c7XG5cblx0ICAgICAgICAgICAgLy8gcmV0dXJuIFg2NFdvcmQuY3JlYXRlKGhpZ2gsIGxvdyk7XG5cdCAgICAgICAgLy8gfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIEJpdHdpc2UgT1JzIHRoaXMgd29yZCB3aXRoIHRoZSBwYXNzZWQgd29yZC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7WDY0V29yZH0gd29yZCBUaGUgeDY0LVdvcmQgdG8gT1Igd2l0aCB0aGlzIHdvcmQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtYNjRXb3JkfSBBIG5ldyB4NjQtV29yZCBvYmplY3QgYWZ0ZXIgT1JpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBvcmVkID0geDY0V29yZC5vcihhbm90aGVyWDY0V29yZCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgLy8gb3I6IGZ1bmN0aW9uICh3b3JkKSB7XG5cdCAgICAgICAgICAgIC8vIHZhciBoaWdoID0gdGhpcy5oaWdoIHwgd29yZC5oaWdoO1xuXHQgICAgICAgICAgICAvLyB2YXIgbG93ID0gdGhpcy5sb3cgfCB3b3JkLmxvdztcblxuXHQgICAgICAgICAgICAvLy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4gdGhpcy5zaGlmdEwobikub3IodGhpcy5zaGlmdFIoNjQgLSBuKSk7XG5cdCAgICAgICAgLy8gfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIFJvdGF0ZXMgdGhpcyB3b3JkIG4gYml0cyB0byB0aGUgcmlnaHQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbiBUaGUgbnVtYmVyIG9mIGJpdHMgdG8gcm90YXRlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZH0gQSBuZXcgeDY0LVdvcmQgb2JqZWN0IGFmdGVyIHJvdGF0aW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgcm90YXRlZCA9IHg2NFdvcmQucm90Uig3KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICAvLyByb3RSOiBmdW5jdGlvbiAobikge1xuXHQgICAgICAgICAgICAvLyByZXR1cm4gdGhpcy5zaGlmdFIobikub3IodGhpcy5zaGlmdEwoNjQgLSBuKSk7XG5cdCAgICAgICAgLy8gfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIEFkZHMgdGhpcyB3b3JkIHdpdGggdGhlIHBhc3NlZCB3b3JkLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtYNjRXb3JkfSB3b3JkIFRoZSB4NjQtV29yZCB0byBhZGQgd2l0aCB0aGlzIHdvcmQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtYNjRXb3JkfSBBIG5ldyB4NjQtV29yZCBvYmplY3QgYWZ0ZXIgYWRkaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgYWRkZWQgPSB4NjRXb3JkLmFkZCh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aWdCeXRlcyAoT3B0aW9uYWwpIFRoZSBudW1iZXIgb2Ygc2lnbmlmaWNhbnQgYnl0ZXMgaW4gdGhlIHdvcmRzLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMueDY0LldvcmRBcnJheS5jcmVhdGUoKTtcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMueDY0LldvcmRBcnJheS5jcmVhdGUoW1xuXHQgICAgICAgICAqICAgICAgICAgQ3J5cHRvSlMueDY0LldvcmQuY3JlYXRlKDB4MDAwMTAyMDMsIDB4MDQwNTA2MDcpLFxuXHQgICAgICAgICAqICAgICAgICAgQ3J5cHRvSlMueDY0LldvcmQuY3JlYXRlKDB4MTgxOTFhMWIsIDB4MWMxZDFlMWYpXG5cdCAgICAgICAgICogICAgIF0pO1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy54NjQuV29yZEFycmF5LmNyZWF0ZShbXG5cdCAgICAgICAgICogICAgICAgICBDcnlwdG9KUy54NjQuV29yZC5jcmVhdGUoMHgwMDAxMDIwMywgMHgwNDA1MDYwNyksXG5cdCAgICAgICAgICogICAgICAgICBDcnlwdG9KUy54NjQuV29yZC5jcmVhdGUoMHgxODE5MWExYiwgMHgxYzFkMWUxZilcblx0ICAgICAgICAgKiAgICAgXSwgMTApO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGluaXQ6IGZ1bmN0aW9uICh3b3Jkcywgc2lnQnl0ZXMpIHtcblx0ICAgICAgICAgICAgd29yZHMgPSB0aGlzLndvcmRzID0gd29yZHMgfHwgW107XG5cblx0ICAgICAgICAgICAgaWYgKHNpZ0J5dGVzICE9IHVuZGVmaW5lZCkge1xuXHQgICAgICAgICAgICAgICAgdGhpcy5zaWdCeXRlcyA9IHNpZ0J5dGVzO1xuXHQgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgdGhpcy5zaWdCeXRlcyA9IHdvcmRzLmxlbmd0aCAqIDg7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgdGhpcyA2NC1iaXQgd29yZCBhcnJheSB0byBhIDMyLWJpdCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7Q3J5cHRvSlMubGliLldvcmRBcnJheX0gVGhpcyB3b3JkIGFycmF5J3MgZGF0YSBhcyBhIDMyLWJpdCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgeDMyV29yZEFycmF5ID0geDY0V29yZEFycmF5LnRvWDMyKCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgdG9YMzI6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB4NjRXb3JkcyA9IHRoaXMud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB4NjRXb3Jkc0xlbmd0aCA9IHg2NFdvcmRzLmxlbmd0aDtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciB4MzJXb3JkcyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHg2NFdvcmRzTGVuZ3RoOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciB4NjRXb3JkID0geDY0V29yZHNbaV07XG5cdCAgICAgICAgICAgICAgICB4MzJXb3Jkcy5wdXNoKHg2NFdvcmQuaGlnaCk7XG5cdCAgICAgICAgICAgICAgICB4MzJXb3Jkcy5wdXNoKHg2NFdvcmQubG93KTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBYMzJXb3JkQXJyYXkuY3JlYXRlKHgzMldvcmRzLCB0aGlzLnNpZ0J5dGVzKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ3JlYXRlcyBhIGNvcHkgb2YgdGhpcyB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZEFycmF5fSBUaGUgY2xvbmUuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBjbG9uZSA9IHg2NFdvcmRBcnJheS5jbG9uZSgpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGNsb25lOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIHZhciBjbG9uZSA9IEJhc2UuY2xvbmUuY2FsbCh0aGlzKTtcblxuXHQgICAgICAgICAgICAvLyBDbG9uZSBcIndvcmRzXCIgYXJyYXlcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gY2xvbmUud29yZHMgPSB0aGlzLndvcmRzLnNsaWNlKDApO1xuXG5cdCAgICAgICAgICAgIC8vIENsb25lIGVhY2ggWDY0V29yZCBvYmplY3Rcblx0ICAgICAgICAgICAgdmFyIHdvcmRzTGVuZ3RoID0gd29yZHMubGVuZ3RoO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHdvcmRzTGVuZ3RoOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHdvcmRzW2ldID0gd29yZHNbaV0uY2xvbmUoKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBjbG9uZTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblx0fSgpKTtcblxuXG5cdHJldHVybiBDcnlwdG9KUztcblxuf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KGUpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSkoKSxcbiAgICAgICAgICBmb3JtRGF0YTogJ0Zvcm1EYXRhJyBpbiBzZWxmLFxuICAgICAgICAgIGFycmF5QnVmZmVyOiAnQXJyYXlCdWZmZXInIGluIHNlbGZcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChzdXBwb3J0LmFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgdmFyIHZpZXdDbGFzc2VzID0gW1xuICAgICAgICAgICAgJ1tvYmplY3QgSW50OEFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBVaW50OEFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBVaW50OENsYW1wZWRBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgSW50MTZBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgVWludDE2QXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IEludDMyQXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IFVpbnQzMkFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBGbG9hdDMyQXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IEZsb2F0NjRBcnJheV0nXG4gICAgICAgICAgXVxuXG4gICAgICAgICAgdmFyIGlzRGF0YVZpZXcgPSBmdW5jdGlvbihvYmopIHtcbiAgICAgICAgICAgIHJldHVybiBvYmogJiYgRGF0YVZpZXcucHJvdG90eXBlLmlzUHJvdG90eXBlT2Yob2JqKVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHZhciBpc0FycmF5QnVmZmVyVmlldyA9IEFycmF5QnVmZmVyLmlzVmlldyB8fCBmdW5jdGlvbihvYmopIHtcbiAgICAgICAgICAgIHJldHVybiBvYmogJiYgdmlld0NsYXNzZXMuaW5kZXhPZihPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwob2JqKSkgPiAtMVx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VzXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBjb25zdW1lZChib2R5KSB7XG4gICAgICAgICAgaWYgKGJvZHkuYm9keVVzZWQpIHtcbiAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlamVjdChuZXcgVHlwZUVycm9yKCdBbHJlYWR5IHJlYWQnKSlcbiAgICAgICAgICB9XG4gICAgICAgICAgYm9keS5ib2R5VXNlZCA9IHRydWVcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGZpbGVSZWFkZXJSZWFkeShyZWFkZXIpIHtcbiAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICByZWFkZXIub25sb2FkID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJlc29sdmUocmVhZGVyLnJlc3VsdClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlYWRlci5vbmVycm9yID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJlamVjdChyZWFkZXIuZXJyb3IpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlYWRCbG9iQXNBcnJheUJ1ZmZlcihibG9iKSB7XG4gICAgICAgICAgdmFyIHJlYWRlciA9IG5ldyBGaWxlUmVhZGVyKClcbiAgICAgICAgICB2YXIgcHJvbWlzZSA9IGZpbGVSZWFkZXJSZWFkeShyZWFkZXIpXG4gICAgICAgICAgcmVhZGVyLnJlYWRBc0FycmF5QnVmZmVyKGJsb2IpXG4gICAgICAgICAgcmV0dXJuIHByb21pc2VcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlYWRCbG9iQXNUZXh0KGJsb2IpIHtcbiAgICAgICAgICB2YXIgcmVhZGVyID0gbmV3IEZpbGVSZWFkZXIoKVxuICAgICAgICAgIHZhciBwcm9taXNlID0gZmlsZVJlYWRlclJlYWR5KHJlYWRlcilcbiAgICAgICAgICByZWFkZXIucmVhZEFzVGV4dChibG9iKVxuICAgICAgICAgIHJldHVybiBwcm9taXNlXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiByZWFkQXJyYXlCdWZmZXJBc1RleHQoYnVmKSB7XG4gICAgICAgICAgdmFyIHZpZXcgPSBuZXcgVWludDhBcnJheShidWYpXG4gICAgICAgICAgdmFyIGNoYXJzID0gbmV3IEFycmF5KHZpZXcubGVuZ3RoKVxuXG4gICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB2aWV3Lmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBjaGFyc1tpXSA9IFN0cmluZy5mcm9tQ2hhckNvZGUodmlld1tpXSlcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIGNoYXJzLmpvaW4oJycpXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBidWZmZXJDbG9uZShidWYpIHtcbiAgICAgICAgICBpZiAoYnVmLnNsaWNlKSB7XG4gICAgICAgICAgICByZXR1cm4gYnVmLnNsaWNlKDApXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciB2aWV3ID0gbmV3IFVpbnQ4QXJyYXkoYnVmLmJ5dGVMZW5ndGgpXG4gICAgICAgICAgICB2aWV3LnNldChuZXcgVWludDhBcnJheShidWYpKVxuICAgICAgICAgICAgcmV0dXJuIHZpZXcuYnVmZmVyXG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gQm9keSgpIHtcbiAgICAgICAgICB0aGlzLmJvZHlVc2VkID0gZmFsc2VcblxuICAgICAgICAgIHRoaXMuX2luaXRCb2R5ID0gZnVuY3Rpb24oYm9keSkge1xuICAgICAgICAgICAgdGhpcy5fYm9keUluaXQgPSBib2R5XG4gICAgICAgICAgICBpZiAoIWJvZHkpIHtcbiAgICAgICAgICAgICAgdGhpcy5fYm9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AgICAgICAgICB2YXIgcmVqZWN0ZWQgPSBjb25zdW1lZCh0aGlzKVxuICAgICAgICAgICAgICBpZiAocmVqZWN0ZWQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0ZWRcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGlmICh0aGlzLl9ib2R5QmxvYikge1xuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keUJsb2IpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShuZXcgQmxvYihbdGhpcy5fYm9keUFycmF5QnVmZmVyXSkpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUZvcm1EYXRhKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdjb3VsZCBub3QgcmVhZCBGb3JtRGF0YSBib2R5IGFzIGJsb2InKVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUobmV3IEJsb2IoW3RoaXMuX2JvZHlUZXh0XSkpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5hcnJheUJ1ZmZlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBpZiAodGhpcy5fYm9keUFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbnN1bWVkKHRoaXMpIHx8IFByb21pc2UucmVzb2x2ZSh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpXG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuYmxvYigpLnRoZW4ocmVhZEJsb2JBc0FycmF5QnVmZmVyKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGhpcy50ZXh0ID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgcmVqZWN0ZWQgPSBjb25zdW1lZCh0aGlzKVxuICAgICAgICAgICAgaWYgKHJlamVjdGVkKSB7XG4gICAgICAgICAgICAgIHJldHVybiByZWplY3RlZFxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy5fYm9keUJsb2IpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHJlYWRCbG9iQXNUZXh0KHRoaXMuX2JvZHlCbG9iKVxuICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShyZWFkQXJyYXlCdWZmZXJBc1RleHQodGhpcy5fYm9keUFycmF5QnVmZmVyKSlcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUZvcm1EYXRhKSB7XG4gICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignY291bGQgbm90IHJlYWQgRm9ybURhdGEgYm9keSBhcyB0ZXh0JylcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keVRleHQpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHN1cHBvcnQuZm9ybURhdGEpIHtcbiAgICAgICAgICAgIHRoaXMuZm9ybURhdGEgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHRoaXMudGV4dCgpLnRoZW4oZGVjb2RlKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHRoaXMuanNvbiA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMudGV4dCgpLnRoZW4oSlNPTi5wYXJzZSlcbiAgICAgICAgICB9XG5cbiAgICAgICAgICByZXR1cm4gdGhpc1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gSFRUUCBtZXRob2RzIHdob3NlIGNhcGl0YWxpemF0aW9uIHNob3VsZCBiZSBub3JtYWxpemVkXG4gICAgICAgIHZhciBtZXRob2RzID0gWydERUxFVEUnLCAnR0VUJywgJ0hFQUQnLCAnT1BUSU9OUycsICdQT1NUJywgJ1BVVCddXG5cbiAgICAgICAgZnVuY3Rpb24gbm9ybWFsaXplTWV0aG9kKG1ldGhvZCkge1xuICAgICAgICAgIHZhciB1cGNhc2VkID0gbWV0aG9kLnRvVXBwZXJDYXNlKClcbiAgICAgICAgICByZXR1cm4gKG1ldGhvZHMuaW5kZXhPZih1cGNhc2VkKSA+IC0xKSA/IHVwY2FzZWQgOiBtZXRob2RcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIFJlcXVlc3QoaW5wdXQsIG9wdGlvbnMpIHtcbiAgICAgICAgICBvcHRpb25zID0gb3B0aW9ucyB8fCB7fVxuICAgICAgICAgIHZhciBib2R5ID0gb3B0aW9ucy5ib2R5XG5cbiAgICAgICAgICBpZiAoaW5wdXQgaW5zdGFuY2VvZiBSZXF1ZXN0KSB7XG4gICAgICAgICAgICBpZiAoaW5wdXQuYm9keVVzZWQpIHtcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignQWxyZWFkeSByZWFkJylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMudXJsID0gaW5wdXQudXJsXG4gICAgICAgICAgICB0aGlzLmNyZWRlbnRpYWxzID0gaW5wdXQuY3JlZGVudGlhbHNcbiAgICAgICAgICAgIGlmICghb3B0aW9ucy5oZWFkZXJzKSB7XG4gICAgICAgICAgICAgIHRoaXMuaGVhZGVycyA9IG5ldyBIZWFkZXJzKGlucHV0LmhlYWRlcnMpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLm1ld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pXG4gICAgICAgIH1cblxuICAgICAgICBSZXF1ZXN0LnByb3RvdHlwZS5jbG9uZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiBuZXcgUmVxdWVzdCh0aGlzLCB7IGJvZHk6IHRoaXMuX2JvZHlJbml0IH0pXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBkZWNvZGUoYm9keSkge1xuICAgICAgICAgIHZhciBmb3JtID0gbmV3IEZvcm1EYXRhKClcbiAgICAgICAgICBib2R5LnRyaW0oKS5zcGxpdCgnJicpLmZvckVhY2goZnVuY3Rpb24oYnl0ZXMpIHtcbiAgICAgICAgICAgIGlmIChieXRlcykge1xuICAgICAgICAgICAgICB2YXIgc3BsaXQgPSBieXRlcy5zcGxpdCgnPScpXG4gICAgICAgICAgICAgIHZhciBuYW1lID0gc3BsaXQuc2hpZnQoKS5yZXBsYWNlKC9cXCsvZywgJyAnKVxuICAgICAgICAgICAgICB2YXIgdmFsdWUgPSBzcGxpdC5qb2luKCc9JykucmVwbGFjZSgvXFwrL2csICcgJylcbiAgICAgICAgICAgICAgZm9ybS5hcHBlbmQoZGVjb2RlVVJJQ29tcG9uZW50KG5hbWUpLCBkZWNvZGVVUklDb21wb25lbnQodmFsdWUpKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmV0dXJuIGZvcm1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHBhcnNlSGVhZGVycyhyYXdIZWFkZXJzKSB7XG4gICAgICAgICAgdmFyIGhlYWRlcnMgPSBuZXcgSGVhZGVycygpXG4gICAgICAgICAgcmF3SGVhZGVycy5zcGxpdCgvXFxyP1xcbi8pLmZvckVhY2goZnVuY3Rpb24obGluZSkge1xuICAgICAgICAgICAgdmFyIHBhcnRzID0gbGluZS5zcGxpdCgnOicpXG4gICAgICAgICAgICB2YXIga2V5ID0gcGFydHMuc2hpZnQoKS50cmltKClcbiAgICAgICAgICAgIGlmIChrZXkpIHtcbiAgICAgICAgICAgICAgdmFyIHZhbHVlID0gcGFydHMuam9pbignOicpLnRyaW0oKVxuICAgICAgICAgICAgICBoZWFkZXJzLmFwcGVuZChrZXksIHZhbHVlKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmV0dXJuIGhlYWRlcnNcbiAgICAgICAgfVxuXG4gICAgICAgIEJvZHkuY2FsbChSZXF1ZXN0LnByb3RvdHlwZSlcblxuICAgICAgICBmdW5jdGlvbiBSZXNwb25zZShib2R5SW5pdCwgb3B0aW9ucykge1xuICAgICAgICAgIGlmICghb3B0aW9ucykge1xuICAgICAgICAgICAgb3B0aW9ucyA9IHt9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGhpcy50eXBlID0gJ2RlZmF1bHQnXG4gICAgICAgICAgdGhpcy5zdGF0dXMgPSAnc3RhdHVzJyBpbiBvcHRpb25zID8gb3B0aW9ucy5zdGF0dXMgOiAyMDBcbiAgICAgICAgICB0aGlzLm9rID0gdGhpcy5zdGF0dXMgPj0gMjAwICYmIHRoaXMuc3RhdHVzIDwgMzAwXG4gICAgICAgICAgdGhpcy5zdGF0dXNUZXh0ID0gJ3N0YXR1c1RleHQnIGluIG9wdGlvbnMgPyBvcHRpb25zLnN0YXR1c1RleHQgOiAnT0snXG4gICAgICAgICAgdGhpcy5oZWFkZXJzID0gbmV3IEhlYWRlcnMob3B0aW9ucy5oZWFkZXJzKVxuICAgICAgICAgIHRoaXMudXJsID0gb3B0aW9ucy51cmwgfHwgJydcbiAgICAgICAgICB0aGlzLl9pbml0Qm9keShib2R5SW5pdClcbiAgICAgICAgfVxuXG4gICAgICAgIEJvZHkuY2FsbChSZXNwb25zZS5wcm90b3R5cGUpXG5cbiAgICAgICAgUmVzcG9uc2UucHJvdG90eXBlLmNsb25lID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgcmV0dXJuIG5ldyBSZXNwb25zZSh0aGlzLl9ib2R5SW5pdCwge1xuICAgICA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luaXQpIHtcbiAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICB2YXIgcmVxdWVzdCA9IG5ldyBSZXF1ZXN0KGlucHV0LCBpbml0KVxuICAgICAgICAgICAgdmFyIHhociA9IG5ldyBYTUxIdHRwUmVxdWVzdCgpXG5cbiAgICAgICAgICAgIHhoci5vbmxvYWQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgdmFyIG9wdGlvbnMgPSB7XG4gICAgICAgICAgICAgICAgc3RhdHVzOiB4aHIuc3RhdHVzLFxuICAgICAgICAgICAgICAgIHN0YXR1c1RleHQ6IHhoci5zdGF0dXNUZXh0LFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHBhcnNlSGVhZGVycyh4aHIuZ2V0QWxsUmVzcG9uc2VIZWFkZXJzKCkgfHwgJycpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgb3B0aW9ucy51cmwgPSAncmVzcG9uc2VVUkwnIGluIHhociA/IHhoci5yZXNwb25zZVVSTCA6IG9wdGlvbnMuaGVhZGVycy5nZXQoJ1gtUmVxdWVzdC1VUkwnKVxuICAgICAgICAgICAgICB2YXIgYm9keSA9ICdyZXNwb25zZScgaW4geGhyID8geGhyLnJlc3BvbnNlIDogeGhyLnJlc3BvbnNlVGV4dFxuICAgICAgICAgICAgICByZXNvbHZlKG5ldyBSZXNwb25zZShib2R5LCBvcHRpb25zKSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgeGhyLm9uZXJyb3IgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmVqZWN0KG5ldyBUeXBlRXJyb3IoJ05ldHdvcmsgcmVxdWVzdCBmYWlsZWQnKSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgeGhyLm9udGltZW91dCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICByZWplY3QobmV3IFR5cG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109Jyk7XG4gICAgICAgIHZhciBwb3MgPSBicmFja2V0RXF1YWxzUG9zID09PSAtMSA/IHBhcnQuaW5kZXhPZignPScpIDogYnJhY2tldEVxdWFsc1BvcyArIDE7XG5cbiAgICAgICAgdmFyIGtleSwgdmFsO1xuICAgICAgICBpZiAocG9zID09PSAtMSkge1xuICAgICAgICAgICAga2V5ID0gb3B0aW9ucy5kZWNvZGVyKHBhcnQsIGRlZmF1bHRzLmRlY29kZXIpO1xuICAgICAgICAgICAgdmFsID0gb3B0aW9ucy5zdHJpY3ROdWxsSGFuZGxpbmcgPyBudWxsIDogJyc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBrZXkgPSBvcHRpb25zLmRlY29kZXIocGFydC5zbGljZSgwLCBwb3MpLCBkZWZhdWx0cy5kZWNvZGVyKTtcbiAgICAgICAgICAgIHZhbCA9IG9wdGlvbnMuZGVjb2RlcihwYXJ0LnNsaWNlKHBvcyArIDEpLCBkZWZhdWx0cy5kZWNvZGVyKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoaGFzLmNhbGwob2JqLCBrZXkpKSB7XG4gICAgICAgICAgICBvYmpba2V5XSA9IFtdLmNvbmNhdChvYmpba2V5XSkuY29uY2F0KHZhbCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvYmpba2V5XSA9IHZhbDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBvYmo7XG59O1xuXG52YXIgcGFyc2VPYmplY3QgPSBmdW5jdGlvbiAoY2hhaW4sIHZhbCwgb3B0aW9ucykge1xuICAgIHZhciBsZWFmID0gdmFsO1xuXG4gICAgZm9yICh2YXIgaSA9IGNoYWluLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBvYmo7XG4gICAgICAgIHZhciByb290ID0gY2hhaW5baV07XG5cbiAgICAgICAgaWYgKHJvb3QgPT09ICdbXScpIHtcbiAgICAgICAgICAgIG9iaiA9IFtdO1xuICAgICAgICAgICAgb2JqID0gb2JqLmNvbmNhdChsZWFmKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9iaiA9IG9wdGlvbnMucGxhaW5PYmplY3RzID8gT2JqZWN0LmNyZWF0ZShudWxsKSA6IHt9O1xuICAgICAgICAgICAgdmFyIGNsZWFuUm9vdCA9IHJvb3QuY2hhckF0KDApID09PSAnWycgJiYgcm9vdC5jaGFyQXQocm9vdC5sZW5ndGggLSAxKSA9PT0gJ10nID8gcm9vdC5zbGljZSgxLCAtMSkgOiByb290O1xuICAgICAgICAgICAgdmFyIGluZGV4ID0gcGFyc2VJbnQoY2xlYW5Sb290LCAxMCk7XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgIWlzTmFOKGluZGV4KVxuICAgICAgICAgICAgICAgICYmIHJvb3QgIT09IGNsZWFuUm9vdFxuICAgICAgICAgICAgICAgICYmIFN0cmluZyhpbmRleCkgPT09IGNsZWFuUm9vdFxuICAgICAgICAgICAgICAgICYmIGluZGV4ID49IDBcbiAgICAgICAgICAgICAgICAmJiAob3B0aW9ucy5wYXJzZUFycmF5cyAmJiBpbmRleCA8PSBvcHRpb25zLmFycmF5TGltaXQpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBvYmogPSBbXTtcbiAgICAgICAgICAgICAgICBvYmpbaW5kZXhdID0gbGVhZjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgb2JqW2NsZWFuUm9vdF0gPSBsZWFmO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgbGVhZiA9IG9iajtcbiAgICB9XG5cbiAgICByZXR1cm4gbGVhZjtcbn07XG5cbnZhciBwYXJzZUtleXMgPSBmdW5jdGlvbiBwYXJzZVF1ZXJ5U3RyaW5nS2V5cyhnaXZlbktleSwgdmFsLCBvcHRpb25zKSB7XG4gICAgaWYgKCFnaXZlbktleSkge1xuICAgICAgICByZ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ICB2YXIga2V5ID0gb2JqS2V5c1tpXTtcblxuICAgICAgICBpZiAoc2tpcE51bGxzICYmIG9ialtrZXldID09PSBudWxsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9iaikpIHtcbiAgICAgICAgICAgIHZhbHVlcyA9IHZhbHVlcy5jb25jYXQoc3RyaW5naWZ5KFxuICAgICAgICAgICAgICAgIG9ialtrZXldLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgocHJlZml4LCBrZXkpLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICAgICAgc3RyaWN0TnVsbEhhbmRsaW5nLFxuICAgICAgICAgICAgICAgIHNraXBOdWxscyxcbiAgICAgICAgICAgICAgICBlbmNvZGVyLFxuICAgICAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgICAgICBzb3J0LFxuICAgICAgICAgICAgICAgIGFsbG93RG90cyxcbiAgICAgICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgICAgIGZvcm1hdHRlcixcbiAgICAgICAgICAgICAgICBlbmNvZGVWYWx1ZXNPbmx5XG4gICAgICAgICAgICApKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhbHVlcyA9IHZhbHVlcy5jb25jYXQoc3RyaW5naWZ5KFxuICAgICAgICAgICAgICAgIG9ialtrZXldLFxuICAgICAgICAgICAgICAgIHByZWZpeCArIChhbGxvd0RvdHMgPyAnLicgKyBrZXkgOiAnWycgKyBrZXkgKyAnXScpLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICAgICAgc3RyaWN0TnVsbEhhbmRsaW5nLFxuICAgICAgICAgICAgICAgIHNraXBOdWxscyxcbiAgICAgICAgICAgICAgICBlbmNvZGVyLFxuICAgICAgICA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hdGVBcnJheVByZWZpeCA9IGFycmF5UHJlZml4R2VuZXJhdG9yc1thcnJheUZvcm1hdF07XG5cbiAgICBpZiAoIW9iaktleXMpIHtcbiAgICAgICAgb2JqS2V5cyA9IE9iamVjdC5rZXlzKG9iaik7XG4gICAgfVxuXG4gICAgaWYgKHNvcnQpIHtcbiAgICAgICAgb2JqS2V5cy5zb3J0KHNvcnQpO1xuICAgIH1cblxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb2JqS2V5cy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIga2V5ID0gb2JqS2V5c1tpXTtcblxuICAgICAgICBpZiAoc2tpcE51bGxzICYmIG9ialtrZXldID09PSBudWxsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGtleXMgPSBrZXlzLmNvbmNhdChzdHJpbmdpZnkoXG4gICAgICAgICAgICBvYmpba2V5XSxcbiAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICBzdHJpY3ROdWxsSGFuZGxpbmcsXG4gICAgICAgICAgICBza2lwTnVsbHMsXG4gICAgICAgICAgICBlbmNvZGUgPyBlbmNvZGVyIDogbnVsbCxcbiAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgIHNvcnQsXG4gICAgICAgICAgICBhbGxvd0RvdHMsXG4gICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgZm9ybWF0dGVyLFxuICAgICAgICAgICAgZW5jb2RlVmFsdWVzT25seVxuICAgICAgICApKTtcbiAgICB9XG5cbiAgICB2YXIgam9pbmVkID0ga2V5cy5qb2luKGRlbGltaXRlcik7XG4gICAgdmFyIHByZWZpeCA9IG9wdGlvbnMuYWRkUXVlcnlQcmVmaXggPT09IHRydWUgPyAnPycgOiAnJztcblxuICAgIHJldHVybiBqb2luZWQubGVuZ3RoID4gMCA/IHByZWZpeCArIGpvaW5lZCA6ICcnO1xufTtcbiIsIid1c2Ugc3RyaWN0JztcblxudmFyIGhhcyA9IE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHk7XG5cbnZhciBoZXhUYWJsZSA9IChmdW5jdGlvbiAoKSB7XG4gICAgdmFyIGFycmF5ID0gW107XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCAyNTY7ICsraSkge1xuICAgICAgICBhcnJheS5wdXNoKCclJyArICgoaSA8IDE2ID8gJzAnIDogJycpICsgaS50b1N0cmluZygxNikpLnRvVXBwZXJDYXNlKCkpO1xuICAgIH1cblxuICAgIHJldHVybiBhcnJheTtcbn0oKSk7XG5cbnZhciBjb21wYWN0UXVldWUgPSBmdW5jdGlvbiBjb21wYWN0UXVldWUocXVldWUpIHtcbiAgICB2YXIgb2JqO1xuXG4gICAgd2hpbGUgKHF1ZXVlLmxlbmd0aCkge1xuICAgICAgICB2YXIgaXRlbSA9IHF1ZXVlLnBvcCgpO1xuICAgICAgICBvYmogPSBpdGVtLm9ialtpdGVtLnByb3BdO1xuXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9iaikpIHtcbiAgICAgICAgICAgIHZhciBjb21wYWN0ZWQgPSBbXTtcblxuICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBvYmoubGVuZ3RoOyArK2opIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9ialtqXSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgY29tcGFjdGVkLnB1c2gob2JqW2pdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGl0ZW0ub2JqW2l0ZW0ucHJvcF0gPSBjb21wYWN0ZWQ7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gb2JqO1xufTtcblxuZXhwb3J0cy5hcnJheVRvT2JqZWN0ID0gZnVuY3Rpb24gYXJyYXlUb09iamVjdChzb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W9mIHN0ciA9PT0gJ3N0cmluZycgPyBzdHIgOiBTdHJpbmcoc3RyKTtcblxuICAgIHZhciBvdXQgPSAnJztcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0cmluZy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIgYyA9IHN0cmluZy5jaGFyQ29kZUF0KGkpO1xuXG4gICAgICAgIGlmIChcbiAgICAgICAgICAgIGMgPT09IDB4MkQgLy8gLVxuICAgICAgICAgICAgfHwgYyA9PT0gMHgyRSAvLyAuXG4gICAgICAgICAgICB8fCBjID09PSAweDVGIC8vIF9cbiAgICAgICAgICAgIHx8IGMgPT09IDB4N0UgLy8gflxuICAgICAgICAgICAgfHwgKGMgPj0gMHgzMCAmJiBjIDw9IDB4MzkpIC8vIDAtOVxuICAgICAgICAgICAgfHwgKGMgPj0gMHg0MSAmJiBjIDw9IDB4NUEpIC8vIGEtelxuICAgICAgICAgICAgfHwgKGMgPj0gMHg2MSAmJiBjIDw9IDB4N0EpIC8vIEEtWlxuICAgICAgICApIHtcbiAgICAgICAgICAgIG91dCArPSBzdHJpbmcuY2hhckF0KGkpO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4ODApIHtcbiAgICAgICAgICAgIG91dCA9IG91dCArIGhleFRhYmxlW2NdO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4ODAwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyAoaGV4VGFibGVbMHhDMCB8IChjID4+IDYpXSArIGhleFRhYmxlWzB4ODAgfCAoYyAmIDB4M0YpXSk7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjIDwgMHhEODAwIHx8IGMgPj0gMHhFMDAwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyAoaGV4VGFibGVbMHhFMCB8IChjID4+IDEyKV0gKyBoZXhUYWJsZVsweDgwIHwgKChjID4+IDYpICYgMHgzRildICsgaGV4VGFibGVbMHg4MCB8IChjICYgMHgzRildKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaSArPSAxO1xuICAgICAgICBjID0gMHgxMDAwMCArICgoKGMgJiAweDNGRikgPDwgMTApIHwgKHN0cmluZy5jaGFyQ29kZUF0KGkpICYgMHgzRkYpKTtcbiAgICAgICAgb3V0ICs9IGhleFRhYmxlWzB4RjAgfCAoYyA+PiAxOCldXG4gICAgICAgICAgICArIGhleFRhYmxlWzB4ODAgfCAoKGMgPj4gMTIpICYgMHgzRildXG4gICAgICAgICAgICArIGhleFRhYmxlWzB4ODAgfCAoKGMgPj4gNikgJiAweDNGKV1cbiAgICAgICAgICAgICsgaGV4VGFibGVbMHg4MCB8IChjICYgMHgzRildO1xuICAgIH1cblxuICAgIHJldHVybiBvdXQ7XG59O1xuXG5leHBvcnRzLmNvbXBhY3QgPSBmdW5jdGlvbiBjb21wYWN0KHZhbHVlKSB7XG4gICAgdmFyIHF1ZXVlID0gW3sgb2JqOiB7IG86IHZhbHVlIH0sIHByb3A6ICdvJyB9XTtcbiAgICB2YXIgcmVmcyA9IFtdO1xuXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBxdWV1ZS5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIgaXRlbSA9IHF1ZXVlW2ldO1xuICAgICAgICB2YXIgb2JqID0gaXRlbS5vYmpbaXRlbS5wcm9wXTtcblxuICAgICAgICB2YXIga2V5cyA9IE9iamVjdC5rZXlzKG9iaik7XG4gICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwga2V5cy5sZW5ndGg7ICsraikge1xuICAgICAgICAgICAgdmFyIGtleSA9IGtleXNbal07XG4gICAgICAgICAgICB2YXIgdmFsID0gb2JqW2tleV07XG4gICAgICAgICAgICBpZiAodHlwZW9mIHZhbCA9PT0gJ29iamVjdCcgJiYgdmFsICE9PSBudWxsICYmIHJlZnMuaW5kZXhPZih2YWwpID09PSAtMSkge1xuICAgICAgICAgICAgICAgIHF1ZXVlLnB1c2goeyBvYmo6IG9iaiwgcHJvcDoga2V5IH0pO1xuICAgICAgICAgICAgICAgIHJlZnMucHVzaCh2YWwpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGNvbXBhY3RRdWV1ZShxdWV1ZSk7XG59O1xuXG5leHBvcnRzLmlzUmVnRXhwID0gZnVuY3Rpb24gaXNSZWdFeHAob2JqKSB7XG4gICAgcmV0dXJuIE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChvYmopID09PSAnW29iamVjdCBSZWdFeHBdJztcbn07XG5cbmV4cG9ydHMuaXNCdWZmZXIgPSBmdW5jdGlvbiBpc0J1ZmZlcihvYmopIHtcbiAgICBpZiAob2JqID09PSBudWxsIHx8IHR5cGVvZiBvYmogPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG5cbiAgICByZXR1cm4gISEob2JqLmNvbnN0cnVjdG9yICYmIG9iai5jb25zdHJ1Y3Rvci5pc0J1ZmZlciAmJiBvYmouY29uc3RydWN0b3IuaXNCdWZmZXIob2JqKSk7XG59O1xuIl19 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJjY3h0LmJyb3dzZXIuanMiLCJjY3h0LmpzIiwianMvXzFicm9rZXIuanMiLCJqcy9fMWJ0Y3hlLmpzIiwianMvYWN4LmpzIiwianMvYWxsY29pbi5qcyIsImpzL2FueHByby5qcyIsImpzL2Jhc2UvRXhjaGFuZ2UuanMiLCJqcy9iYXNlL01hcmtldC5qcyIsImpzL2Jhc2UvZXJyb3JzLmpzIiwianMvYmFzZS9mdW5jdGlvbnMuanMiLC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xdWlyZSAoJy4vanMvXzFicm9rZXIuanMnKSxcbiAgICAnXzFidGN4ZSc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9fMWJ0Y3hlLmpzJyksXG4gICAgJ2FjeCc6ICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYWN4LmpzJyksXG4gICAgJ2FsbGNvaW4nOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYWxsY29pbi5qcycpLFxuICAgICdhbnhwcm8nOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2FueHByby5qcycpLFxuICAgICdiaWJveCc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpYm94LmpzJyksXG4gICAgJ2JpbmFuY2UnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYmluYW5jZS5qcycpLFxuICAgICdiaXQyYyc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdDJjLmpzJyksXG4gICAgJ2JpdGJheSc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0YmF5LmpzJyksXG4gICAgJ2JpdGNvaW5jb2lkJzogICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0Y29pbmNvaWQuanMnKSxcbiAgICAnYml0ZmluZXgnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRmaW5leC5qcycpLFxuICAgICdiaXRmaW5leDInOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGZpbmV4Mi5qcycpLFxuICAgICdiaXRmbHllcic6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGZseWVyLmpzJyksXG4gICAgJ2JpdGh1bWInOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0aHVtYi5qcycpLFxuICAgICdiaXRsaXNoJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGxpc2guanMnKSxcbiAgICAnYml0bWFya2V0JzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRtYXJrZXQuanMnKSxcbiAgICAnYml0bWV4JzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRtZXguanMnKSxcbiAgICAnYml0c28nOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRzby5qcycpLFxuICAgICdiaXRzdGFtcCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdHN0YW1wLmpzJyksXG4gICAgJ2JpdHN0YW1wMSc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0c3RhbXAxLmpzJyksXG4gICAgJ2JpdHRyZXgnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0dHJleC5qcycpLFxuICAgICdibDNwJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JsM3AuanMnKSxcbiAgICAnYmxldXRyYWRlJzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9ibGV1dHJhZGUuanMnKSxcbiAgICAnYnJhemlsaWV4JzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9icmF6aWxpZXguanMnKSxcbiAgICAnYnRjYm94JzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGNib3guanMnKSxcbiAgICAnYnRjY2hpbmEnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGNjaGluYS5qcycpLFxuICAgICdidGNleGNoYW5nZSc6ICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y2V4Y2hhbmdlLmpzJyksXG4gICAgJ2J0Y21hcmtldHMnOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjbWFya2V0cy5qcycpLFxuICAgICdidGN0cmFkZXVhJzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y3RyYWRldWEuanMnKSxcbiAgICAnYnRjdHVyayc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGN0dXJrLmpzJyksXG4gICAgJ2J0Y3gnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjeC5qcycpLFxuICAgICdidGVyJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0ZXIuanMnKSxcbiAgICAnYnhpbnRoJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9ieGludGguanMnKSxcbiAgICAnY2NleCc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jY2V4LmpzJyksXG4gICAgJ2NleCc6ICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY2V4LmpzJyksXG4gICAgJ2NoYnRjJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY2hidGMuanMnKSxcbiAgICAnY2hpbGViaXQnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jaGlsZWJpdC5qcycpLFxuICAgICdjb2luY2hlY2snOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5jaGVjay5qcycpLFxuICAgICdjb2luZXhjaGFuZ2UnOiAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5leGNoYW5nZS5qcycpLFxuICAgICdjb2luZmxvb3InOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5mbG9vci5qcycpLFxuICAgICdjb2luZ2knOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5naS5qcycpLFxuICAgICdjb2lubWFya2V0Y2FwJzogICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5tYXJrZXRjYXAuanMnKSxcbiAgICAnY29pbm1hdGUnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jb2lubWF0ZS5qcycpLFxuICAgICdjb2luc2VjdXJlJzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5zZWN1cmUuanMnKSxcbiAgICAnY29pbnNwb3QnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jb2luc3BvdC5qcycpLFxuICAgICdjcnlwdG9waWEnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NyeXB0b3BpYS5qcycpLFxuICAgICdkc3gnOiAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2RzeC5qcycpLFxuICAgICdleG1vJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2V4bW8uanMnKSxcbiAgICAnZmxvd2J0Yyc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9mbG93YnRjLmpzJyksXG4gICAgJ2ZveGJpdCc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZm94Yml0LmpzJyksXG4gICAgJ2Z5YnNlJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZnlic2UuanMnKSxcbiAgICAnZnlic2cnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9meWJzZy5qcycpLFxuICAgICdnYXRlY29pbic6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dhdGVjb2luLmpzJyksXG4gICAgJ2dhdGVpbyc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZ2F0ZWlvLmpzJyksXG4gICAgJ2dkYXgnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZ2RheC5qcycpLFxuICAgICdnZW1pbmknOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dlbWluaS5qcycpLFxuICAgICdnZXRidGMnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dldGJ0Yy5qcycpLFxuICAgICdoaXRidGMnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2hpdGJ0Yy5qcycpLFxuICAgICdoaXRidGMyJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2hpdGJ0YzIuanMnKSxcbiAgICAnaHVvYmknOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9odW9iaS5qcycpLFxuICAgICdodW9iaWNueSc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2h1b2JpY255LmpzJyksXG4gICAgJ2h1b2JpcHJvJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvaHVvYmlwcm8uanMnKSxcbiAgICAnaW5kZXBlbmRlbnRyZXNlcnZlJzogICAgICByZXF1aXJlICgnLi9qcy9pbmRlcGVuZGVudHJlc2VydmUuanMnKSxcbiAgICAnaXRiaXQnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9pdGJpdC5qcycpLFxuICAgICdqdWJpJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2p1YmkuanMnKSxcbiAgICAna3Jha2VuJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rcmFrZW4uanMnKSxcbiAgICAna3Vjb2luJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rdWNvaW4uanMnKSxcbiAgICAna3VuYSc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rdW5hLmpzJyksXG4gICAgJ2xha2VidGMnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbGFrZWJ0Yy5qcycpLFxuICAgICdsaXF1aSc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2xpcXVpLmpzJyksXG4gICAgJ2xpdmVjb2luJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbGl2ZWNvaW4uanMnKSxcbiAgICAnbHVubyc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9sdW5vLmpzJyksXG4gICAgJ2x5a2tlJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbHlra2UuanMnKSxcbiAgICAnbWVyY2Fkbyc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9tZXJjYWRvLmpzJyksXG4gICAgJ21peGNvaW5zJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbWl4Y29pbnMuanMnKSxcbiAgICAnbm92YSc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9ub3ZhLmpzJyksXG4gICAgJ29rY29pbmNueSc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvb2tjb2luY255LmpzJyksXG4gICAgJ29rY29pbnVzZCc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvb2tjb2ludXNkLmpzJyksXG4gICAgJ29rZXgnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvb2tleC5qcycpLFxuICAgICdwYXltaXVtJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3BheW1pdW0uanMnKSxcbiAgICAncG9sb25pZXgnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9wb2xvbmlleC5qcycpLFxuICAgICdxcnlwdG9zJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3FyeXB0b3MuanMnKSxcbiAgICAncXVhZHJpZ2FjeCc6ICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9xdWFkcmlnYWN4LmpzJyksXG4gICAgJ3F1b2luZSc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvcXVvaW5lLmpzJyksXG4gICAgJ3NvdXRoeGNoYW5nZSc6ICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvc291dGh4Y2hhbmdlLmpzJyksXG4gICAgJ3N1cmJpdGNvaW4nOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvc3VyYml0Y29pbi5qcycpLFxuICAgICd0aGVyb2NrJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3RoZXJvY2suanMnKSxcbiAgICAndGlkZXgnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy90aWRleC5qcycpLFxuICAgICd1cmR1Yml0JzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3VyZHViaXQuanMnKSxcbiAgICAndmF1bHRvcm8nOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy92YXVsdG9yby5qcycpLFxuICAgICd2YnRjJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3ZidGMuanMnKSxcbiAgICAndmlyd294JzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy92aXJ3b3guanMnKSxcbiAgICAnd2V4JzogICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy93ZXguanMnKSxcbiAgICAneGJ0Y2UnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy94YnRjZS5qcycpLFxuICAgICd5b2JpdCc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3lvYml0LmpzJyksXG4gICAgJ3l1bmJpJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMveXVuYmkuanMnKSxcbiAgICAnemFpZic6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy96YWlmLmpzJyksXG4gICAgJ3piJzogICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvemIuanMnKSwgICAgXG59XG5cbi8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBPYmplY3QuYXNzaWduICh7IHZlcnNpb24sIEV4Y2hhbmdlLCBleGNoYW5nZXM6IE9iamVjdC5rZXlzI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XMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICc2MCcsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICc5MDAnLFxuICAgICAgICAgICAgICAgICcxaCc6ICczNjAwJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnODY0MDAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYwMjEtNDIwYmQ5ZmMtNWVjYi0xMWU3LThlZDYtNTZkMDA4MWVmZWQyLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovLzFicm9rZXIuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovLzFicm9rZXIuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vMWJyb2tlci5jb20vP2M9ZW4vY29udGVudC9hcGktZG9jdW1lbnRhdGlvbicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2JhcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9jYXRlZ29yaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvZGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2xpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9xdW90ZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC90aWNrcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jcmVhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29wZW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2Nsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9jbG9zZV9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2VkaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL29wZW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL3NoYXJlZC9nZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NvY2lhbC9wcm9maWxlX3N0YXRpc3RpY3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NvY2lhbC9wcm9maWxlX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9iaXRjb2luX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9kZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL292ZXJ2aWV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3F1b3RhX3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci90cmFuc2FjdGlvbl9sb2cnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICA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GlzdCAoe1xuICAgICAgICAgICAgICAgICdjYXRlZ29yeSc6IGNhdGVnb3J5LnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHNbJ3Jlc3BvbnNlJ10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sncmVzcG9uc2UnXVtwXTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGlmICgoY2F0ZWdvcnkgPT0gJ0ZPUkVYJykgfHwgKGNhdGVnb3J5ID09ICdDUllQVE8nKSkge1xuICAgICAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ25hbWUnXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBhcnRzID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgICAgICAgICBiYXNlID0gcGFydHNbMF07XG4gICAgICAgICAgICAgICAgICAgIHF1b3RlID0gcGFydHNbMV07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYmFzZSA9IGlkO1xuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9ICdVU0QnO1xuICAgICAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJhc2UgPSB0aGlzXy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpc18uY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldFVzZXJPdmVydmlldyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYmFsYW5jZVsncmVzcG9uc2UnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRvdGFsID0gcGFyc2VGbG9hdCAocmVzcG9uc2VbJ2JhbGFuY2UnXSk7XG4gICAgICAgIHJlc3VsdFsnQlRDJ11bJ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iAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sKSB7XG4gICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaFRyYWRlcyAoKSBtZXRob2Qgbm90IGltcGxlbWVudGVkIHlldCcpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRNYXJrZXRCYXJzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAncmVzb2x1dGlvbic6IDYwLFxuICAgICAgICAgICAgJ2xpbWl0JzogMSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLmZldGNoT3JkZXJCb29rIChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzdWx0WydyZXNwb25zZSddWzBdO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRpY2tlclsnZGF0ZSddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsJ10pLFxuICAgICAgICAgICAgJ2JpZCc6IG9yZGVyYm9va1snYmlkcyddWzBdWzBdLFxuICAgICAgICAgICAgJ2Fzayc6IG9yZGVyYm9va1snYXNrcyddWzBdWzBdLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHBhcnNlRmxvYXQgKHRpY2tlclsnbyddKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYyddKSxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlT0hMQ1YgKG9obGN2LCBtYXJrZXQgPSB1bmRlZmluZWQsIHRpbWVmcmFtZSA9ICcxbScsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCkge1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgdGhpcy5wYXJzZTg2MDEgKG9obGN2WydkYXRlJ10pLFxuICAgICAgICAgICAgcGFyc2VGbG9hdCAob2hsY3ZbJ28nXSksXG4gICAgICAgICAgICBwYXJzZUZsb2F0IChvaGxjdlsnaCddKSxcbiAgICAgICAgICAgIHBhcnNlRmxvYXQgKG9obGN2WydsJ10pLFxuICAgICAgICAgICAgcGFyc2VGbG9hdCAob2hsY3ZbJ2MnXSksXG4gICAgICAgICAgICB1bmRlZmluZWQsXG4gICAgICAgIF07XG4gICAgfVxuXG4gICAgYXN5bmMgZ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MTI5NDQ1NC8yNzc2NjA0OS0yYjI5NDQwOC01ZWNjLTExZTctODVjYy1hZGFmZjAxM2RjMWEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vMWJ0Y3hlLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly8xYnRjeGUuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vMWJ0Y3hlLmNvbS9hcGktZG9jcy5waHAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yaWNhbC1wcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyLWJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMtYW5kLWluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4tb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyLXRyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnRjLWRlcG9zaXQtYWRkcmVzcy9nZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J0Yy1kZXBvc2l0LWFkZHJlc3MvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0cy9nZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL2dldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL2VkaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL25ldycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ1VTRCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdFVVInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvQ05ZJzogeyAnaWQnOiAnQ05ZJywgJ3N5bWJvbCc6ICdCVEMvQ05ZJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0NOWScgfSxcbiAgICAgICAgICAgICAgICAnQlRDL1JVQic6IHsgJ2lkJzogJ1JVQicsICdzeW1ib2wnOiAnQlRDL1JVQicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdSVUInIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9DSEYnOiB7ICdpZCc6ICdDSEYnLCAnc3ltYm9sJzogJ0JUQy9DSEYnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ0hGJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvSlBZJzogeyAnaWQnOiAnSlBZJywgJ3N5bWJvbCc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waXRhbCcpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgaXMgYW4gYWJzdHJhY3QgYmFzZSBBUEkgZm9yIF8xYnRjeGUnKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYXBpX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IHRoaXMubm9uY2UgKCksXG4gICAgICAgICAgICB9LCBwYXJhbXMpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgIHF1ZXJ5WydzaWduYXR1cmUnXSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHJlcXVlc3QpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIG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L2Jhc2UvZXJyb3JzJylcblxuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgYWN4IGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2FjeCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdBQ1gnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdBVScsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YyJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMCcsXG4gICAgICAgICAgICAgICAgJzFoJzogJzYwJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMTIwJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnMjQwJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzcyMCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzE0NDAnLFxuICAgICAgICAgICAgICAgICczZCc6ICc0MzIwJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMTAwODAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzAyNDc2MTQtMWZlNjFjNzQtOTYyMS0xMWU3LTllOGMtZjFhNjI3YWZhMjc5LmpwZycsXG4gICAgICAgICAgICAgICAgJ2V4dGVuc2lvbic6ICcuanNvbicsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FjeC5pby9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9hY3guaW8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9hY3guaW8vZG9jdW1lbnRzL2FwaV92MicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLCAvLyBHZXQgYWxsIGF2YWlsYWJsZSBtYXJrZXRzXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsIC8vIEdldCB0aWNrZXIgb2YgYWxsIG1hcmtldHNcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzL3ttYXJrZXR9JywgLy8gR2V0IHRpY2tlciBvZiBzcGVjaWZpYyBtYXJrZXRcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLCAvLyBHZXQgcmVjZW50IHRyYWRlcyBvbiBtYXJrZXQsIGVhY2ggdHJhZGUgaXMgaW5jbHVkZWQgb25seSBvbmNlIFRyYWRlcyBhcmUgc29ydGVkIGluIHJldmVyc2UgY3JlYXRpb24gb3JkZXIuXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsIC8vIEdld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yBvZiBzcGVjaWZpYyBkZXBvc2l0XG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdF9hZGRyZXNzJywgLy8gV2hlcmUgdG8gZGVwb3NpdCBUaGUgYWRkcmVzcyBmaWVsZCBjb3VsZCBiZSBlbXB0eSB3aGVuIGEgbmV3IGFkZHJlc3MgaXMgZ2VuZXJhdGluZyAoZS5nLiBmb3IgYml0Y29pbiksIHlvdSBzaG91bGQgdHJ5IGFnYWluIGxhdGVyIGluIHRoYXQgY2FzZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLCAvLyBHZXQgeW91ciBvcmRlcnMsIHJlc3VsdHMgaXMgcGFnaW5hdGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLCAvLyBHZXQgaW5mb3JtYXRpb24gb2Ygc3BlY2lmaWVkIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL215JywgLy8gR2V0IHlvdXIgZXhlY3V0ZWQgdHJhZGVzIFRyYWRlcyBhcmUgc29ydGVkIGluIHJldmVyc2UgY3JlYXRpb24gb3JkZXIuXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdzJywgLy8gR2V0IHlvdXIgY3J5cHRvY3VycmVuY3kgd2l0aGRyYXdzXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLCAvLyBHZXQgeW91ciBjcnlwdG9jdXJyZW5jeSB3aXRoZHJhd1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLCAvLyBDcmVhdGUgYSBTZWxsL0J1eSBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9tdWx0aScsIC8vIENyZWF0ZSBtdWx0aXBsZSBzZWxsL2J1eSBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvY2xlYXInLCAvLyBDYW5jZWwgYWxsIG15IG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2RlbGV0ZScsIC8vIENhbmNlbCBhbiBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JywgLy8gQ3JlYXRlIGEgd2l0aGRyYXdcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IDAuMCwgLy8gVGhlcmUgaXMgb25seSAxJSBmZWUgb24gd2l0aGRyYXdhbHMgdG8geW91ciBiYW5rIGFjY291bnQuXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0TWVtYmVyc01lICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnYWNjb3VudHMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYmFsYW5jZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2xvY2tlZCddKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0RGVwdGggKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ2xpbWl0JzogMzAwLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IG9yZGVyYm9va1sndGltZXN0YW1wJ10gKiAxMDAwO1xuICAgICAgICBsZXQgcmVzdWx0ID0gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB0aW1lc3RhbX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A9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgICAgIGJhc2UgPSBiYXNlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gcXVvdGUudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlcnNNYXJrZXQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogbWFya2V0WydpZCddLFxuICAgICAgICB9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dW50LCBhZGRyZXNzLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFdpdGhkcmF3ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3kudG9Mb3dlckNhc2UgKCksXG4gICAgICAgICAgICAnc3VtJzogYW1vdW50LFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzdWx0LFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIGVuY29kZVBhcmFtcyAocGFyYW1zKSB7XG4gICAgICAgIGlmICgnb3JkZXJzJyBpbiBwYXJhbXMpIHtcbiAgICAgICAgICAgIGxldCBvcmRlcnMgPSBwYXJhbXNbJ29yZGVycyddO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMua2V5c29ydCAodGhpcy5vbWl0IChwYXJhbXMsICdvcmRlcnMnKSkpO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBvcmRlcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgb3JkZXIgPSBvcmRlcnNbaV07XG4gICAgICAgICAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAob3JkZXIpO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDwga2V5cy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgICAgICBsZXQga2V5ID0ga2V5c1trXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHZhbHVlID0gb3JkZXJba2V5XTtcbiAgICAgICAgICAgICAgICAgICAgcXVlcnkgKz0gJyZvcmRlcnMlNUIlNUQlNUInICsga2V5ICsgJyU1RD0nICsgdmFsdWUudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHF1ZXJ5O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnVybGVuY29kZSAodGhpcy5rZXlzb3J0IChwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXF1ZXN0ID0gJy9hcGknICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBpZiAoJ2V4dGVuc2lvbicgaW4gdGhpcy51cmxzKVxuICAgICAgICAgICAgcmVxdWVzdCArPSB0aGlzLnVybHNbJ2V4dGVuc2lvbiddO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgcmVxdWVzdDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmVuY29kZVBhcmFtcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYWNjZXNzX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICd0b25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG1ldGhvZCArICd8JyArIHJlcXVlc3QgKyAnfCcgKyBxdWVyeTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBsZXQgc3VmZml4ID0gcXVlcnkgKyAnJnNpZ25hdHVyZT0nICsgc2lnbmF0dXJlO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyBzdWZmaXg7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGJvZHkgPSBzdWZmaXg7XG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0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gICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMTU2MTgwOS1jMzE2YjM3Yy1iMDYxLTExZTctOGQ1YS1iNTQ3YjRkNzMwZWIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd3d3LmFsbGNvaW4uY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2FwaS5hbGxjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5hbGxjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5hbGxjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5hbGxjb2luLmNvbS9BYm91dC9BUElSZWZlcmVuY2UnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdIb21lL01hcmtldE92ZXJWaWV3RGV0YWlsLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrbGluZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhdGNoX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyc19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXBheW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyaW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHVuZGVmaW5lZCxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLndlYkdldEhvbWVNYXJrZXRPdmVyVmlld0RldGFpbCAoKTtcbiAgICAgICAgbGV0IGNvaW5zID0gcmVzcG9uc2VbJ21hcmtldENvaW5zJ107XG4gICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgY29pbnMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXRzID0gY29pbnNbal1bJ01hcmtldHMnXTtcbiAgICAgICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDwgbWFya2V0cy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2tdWydNYXJrZXQnXTtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnUHJpbWFyeSddO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnU2Vjb25kYXJ5J107XG4gICAgICAgICAgICAgICAgbGV0IGlkID0gYmFzZS50b0xvd2VyQ2FzZSAoKSArICdfJyArIHF1b3RlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICd0eXBlJzogJ3Nwb3QnLFxuICAgICAgICAgICAgICAgICAgICAnc3BvdCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdmdXR1cmUnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyU3RhdHVzIChzdGF0dXMpIHtcbiAgICAgICAgaWYgKHN0YXR1cyA9PSAtMSlcbiAgICAgICAgICAgIHJldHVybiAnY2FuY2VsZWQnO1xuICAgICAgICBpZiAoc3RhdHVzID09IDApXG4gICAgICAgICAgICByZXR1cm4gJ29wZW4nO1xuICAgICAgICBpZiAoc3RhdHVzID09IDEpXG4gICAgICAgICAgICByZXR1cm4gJ29wZW4nOyA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ZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2FueHBybycsXG4gICAgICAgICAgICAnbmFtZSc6ICdBTlhQcm8nLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ0pQJywgJ1NHJywgJ0hLJywgJ05aJyBdLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAnMicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUcmFkZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY1OTgzLWZkODU5NWRhLTVlYzktMTFlNy04MmUzLWFkYjNhYjhjMjYxMi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hbnhwcm8uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2FueHByby5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwOi8vZG9jcy5hbnh2Mi5hcGlhcnkuaW8nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hbnhwcm8uY29tL3BhZ2VzL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L2RlcHRoL2Z1bGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS90cmFkZS9mZXRjaCcsIC8vIGRpc2FibGVkIGJ5IEFOWFByb1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9hZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9xdW90ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L29yZGVyL3Jlc3VsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkve2N1cnJlbmN5fS9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb25leS97Y3VycmVuY3l9L3NlbmRfc2ltcGxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb25leS9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb25leS90cmFkZS9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb25leS93YWxsZXQvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICA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AgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4zIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjYgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE1vbmV5SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlWydXYWxsZXRzJ10pO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2UgfTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZVsnV2FsbGV0cyddKSB7XG4gICAgICAgICAgICAgICAgbGV0IHdhbGxldCA9IGJhbGFuY2VbJ1dhbGxldHMnXVtjdXJyZW5jeV07XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAod2FsbGV0WydBdmFpbGFibGVfQmFsYW5jZSddWyd2YWx1ZSddKTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gcGFyc2VGbG9hdCAod2FsbGV0WydCYWxhbmNlJ11bJ3ZhbHVlJ10pO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3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ICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IHQgPSBwYXJzZUludCAodGlja2VyWydkYXRhVXBkYXRlVGltZSddKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0IC8gMTAwMCk7XG4gICAgICAgIGxldCBiaWQgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyWydidXknXSwgJ3ZhbHVlJyk7XG4gICAgICAgIGxldCBhc2sgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyWydzZWxsJ10sICd2YWx1ZScpOztcbiAgICAgICAgbGV0IGJhc2VWb2x1bWUgPSBwYXJzZUZsb2F0ICh0aWNrZXJbJ3ZvbCddWyd2YWx1ZSddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXVsndmFsdWUnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXVsndmFsdWUnXSksXG4gICAgICAgICAgICAnYmlkJzogYmlkLFxuICAgICAgICAgICAgJ2Fzayc6IGFzayxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddWyd2YWx1ZSddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZ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mRzICAgICA9IERhdGUubm93XG4gICAgICAgIHRoaXMubWljcm9zZWNvbmRzICAgICA9ICgpID0+IE1hdGguZmxvb3IgKHRoaXMubWlsbGlzZWNvbmRzICgpICogMTAwMClcbiAgICAgICAgdGhpcy5zZWNvbmRzICAgICAgICAgID0gKCkgPT4gTWF0aC5mbG9vciAodGhpcy5taWxsaXNlY29uZHMgKCkgLyAxMDAwKVxuICAgICAgICB0aGlzLmlkICAgICAgICAgICAgICAgPSB1bmRlZmluZWRcblxuICAgICAgICAvLyByYXRlIGxpbWl0ZXIgc2V0dGluZ3NcbiAgICAgICAgdGhpcy5lbmFibGVSYXRlTGltaXQgID0gZmFsc2VcbiAgICAgICAgdGhpcy5yYXRlTGltaXQgICAgICAgID0gMjAwMCAgLy8gbWlsbGlzZWNvbmRzID0gc2Vjb25kcyAqIDEwMDBcblxuICAgICAgICB0aGlzLnBhcnNlSnNvblJlc3BvbnNlICAgICAgICAgICAgID0gdHJ1ZSAgLy8gd2hldGhlciBhIHJlcGx5IGlzIHJlcXVpcmVkIHRvIGJlIGluIEpTT04gb3Igbm90XG4gICAgICAgIHRoaXMuc3Vic3RpdHV0ZUNvbW1vbkN1cnJlbmN5Q29kZXMgPSB0cnVlICAvLyByZXNlcnZlZFxuICAgICAgICB0aGlzLnBhcnNlQmFsYW5jZUZyb21PcGVuT3JkZXJzICAgID0gZmFsc2UgLy8gc29tZSBleGNoYW5nZXMgcmV0dXJuIGJhbGFuY2UgdXBkYXRlcyBmcm9tIG9yZGVyIEFQSSBlbmRwb2ludHNcblxuICAgICAgICB0aGlzLmZldGNoSW1wbGVtZW50YXRpb24gPSBmZXRjaFxuXG4gICAgICAgIHRoaXMudGltZW91dCAgICAgICAgICA9IDEwMDAwIC8vIG1pbGxpc2Vjb25kc1xuICAgICAgICB0aGlzLnZlcmJvc2UgICAgICAgICAgPSBmYWxzZVxuICAgICAgICB0aGlzLmRlYnVnICAgICAgICAgICAgPSBmYWxzZVxuICAgICAgICB0aGlzLm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zLmhhc0ZldGNoVHJhZGVzICAgICAgID0gdHJ1ZVxuICAgICAgICB0aGlzLmhhc1dpdGhkcmF3ICAgICAgICAgID0gZmFsc2VcbiAgICAgICAgdGhpcy5oYXNDcmVhdGVPcmRlciAgICAgICA9IHRoaXMuaGFzUHJpdmF0ZUFQSVxuICAgICAgICB0aGlzLmhhc0NhbmNlbE9yZGVyICAgICAgID0gdGhpcy5oYXNQcml2YXRlQVBJXG5cbiAgICAgICAgdGhpcy5hcGlLZXkgICA9IHVuZGVmaW5lZFxuICAgICAgICB0aGlzLnNlY3JldCAgID0gdW5kZWZpbmVkXG4gICAgICAgIHRoaXMudWlkICAgICAgPSB1bmRlZmluZWRcbiAgICAgICAgdGhpcy5sb2dpbiAgICA9IHVuZGVmaW5lZFxuICAgICAgICB0aGlzLnBhc3N3b3JkID0gdW5kZWZpbmVkXG5cbiAgICAgICAgdGhpcy5yZXF1aXJlZENyZWRlbnRpYWxzID0ge1xuICAgICAgICAgICAgJ2FwaUtleSc6ICAgdHJ1ZSxcbiAgICAgICAgICAgICdzZWNyZXQnOiAgIHRydWUsXG4gICAgICAgICAgICAndWlkJzogICAgICBmYWxzZSxcbiAgICAgICAgICAgICdsb2dpbic6ICAgIGZhbHNlLFxuICAgICAgICAgICAgJ3Bhc3N3b3JkJzogZmFsc2UsXG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmJhbGFuY2UgICAgPSB7fVxuICAgICAgICB0aGlzLm9yZGVyYm9va3MgPSB7fVxuICAgICAgICB0aGlzLnRpY2tlcnMgICAgPSB7fVxuICAgICAgICB0aGlzLmZlZXMgICAgICAgPSB7fVxuICAgICAgICB0aGlzLm9yZGVycyAgICAgPSB7fVxuICAgICAgICB0aGlzLnRyYWRlcyAgICAgPSB7fVxuICAgICAgICB0aGlzLmN1cnJlbmNpZXMgPSB7fVxuXG4gICAgICAgIHRoaXMubGFzdF9odHRwX3Jlc3BvbnNlID0gdW5kZWZpbmVkXG4gICAgICAgIHRoaXMubGFzdF9qc29uX3Jlc3BvbnNlID0gdW5kZWZpbmVkXG5cbiAgICAgICAgdGhpcy5hcnJheUNvbmNhdCA9IChhLCBiKSA9PiBhLmNvbmNhdCAoYilcblxuICAgICAgICAvLyBUT0RPOiBnZW5lcmF0ZVxuICAgICAgICB0aGlzLm1hcmtldF9pZCAgICAgICAgICAgICAgICAgICA9IHRoaXMubWFya2V0SWRcbiAgICAgICAgdGhpcy5tYXJrZXRfaWRzICAgICAgICAgICAgICAgICAgPSB0aGlzLm1hcmtldElkc1xuICAgICAgICB0aGlzLmFycmF5X2NvbmNhdCAgICAgICAgICAgICAgICA9IHRoaXMuYXJyYXlDb25jYXRcbiAgICAgICAgdGhpcy5pbXBsb2RlX3BhcmFtcyAgICAgICAgICAgICAgPSB0aGlzLmltcGxvZGVQYXJhbXNcbiAgICAgICAgdGhpcy5leHRyYWN0X3BhcmFtcyAgICAgICAgICAgICAgPSB0aGlzLmV4dHJhY3RQYXJhbXNcbiAgICAgICAgdGhpcy5mZXRjaF9iYWxhbmNlICAgICAgICAgICAgICAgPSB0aGlzLmZldGNoQmFsYW5jZVxuICAgICAgICB0aGlzLmZldGNoX2ZyZWVfYmFsYW5jZSAgICAgICAgICA9IHRoaXMuZmV0Y2hGcmVlQmFsYW5jZVxuICAgICAgICB0aGlzLmZldGNoX3VzZWRfYmFsYW5jZSAgICAgICAgICA9IHRoaXMuZmV0Y2hVc2VkQmFsYW5jZVxuICAgICAgICB0aGlzLmZldGNoX3RvdGFsX2JhbGFuY2UgICAgICAgICA9IHRoaXMuZmV0Y2hUb3RhbEJhbGFuY2VcbiAgICAgICAgdGhpcy5mZXRjaF9sMl9vcmRlcl9ib29rICAgICAgICAgPSB0aGlzLmZldGNoTDJPcmRlckJvb2tcbiAgICAgICAgdGhpcy5mZXRjaF9vcmRlcl9ib29rICAgICAgICAgICAgPSB0aGlzLmZldGNoT3JkZXJCb29rXG4gICAgICAgIHRoaXMuZmV0Y2hfdGlja2VycyAgICAgICAgICAgICAgID0gdGhpcy5mZXRjaFRpY2tlcnNcbiAgICAgICAgdGhpcy5mZXRjaF90aWNrZXIgICAgICAgICAgICAgICAgPSB0aGlzLmZldGNoVGlja2VyXG4gICAgICAgIHRoaXMuZmV0Y2hfdHJhZGVzICAgICAgICAgICAgICAgID0gdGhpcy5mZXRjaFRyYWRlc1xuICAgICAgICB0aGlzLmZldGNoX29yZGVyICAgICAgICAgICAgICAgICA9IHRoaXMuZmV0Y2hPcmRlclxuICAgICAgICB0aGlzLmZldGNoX29yZGVycyAgICAgICAgICAgICAgICA9IHRoaXMuZmV0Y2hPcmRlcnNcbiAgICAgICAgdGhpcy5mZXRjaF9vcGVuX29yZGVycyAgICAgICAgICAgPSB0aGlzLmZldGNoT3Blbk9yZGVyc1xuICAgICAgICB0aGlzLmZldGNoX2Nsb3NlZF9vcmRlcnMgICAgICAgICA9IHRoaXMuZmV0Y2hDbG9zZWRPcmRlcnNcbiAgICAgICAgdGhpcy5mZXRjaF9vcmRlcl9zdGF0dXMgICAgICAgICAgPSB0aGlzLmZldGNoT3JkZXJTdGF0dXNcbiAgICAgICAgdGhpcy5mZXRjaF9tYXJrZXRzICAgICAgICAgICAgICAgPSB0aGlzLmZldGNoTWFya2V0c1xuICAgICAgICB0aGlzLmxvYWRfbWFya2V0cyAgICAgICAgICAgICAgICA9IHRoaXMubG9hZE1hcmtldHNcbiAgICAgICAgdGhpcy5zZXRfbWFya2V0cyAgICAgICAgICAgICAgICAgPSB0aGlzLnNldE1hcmtldHNcbiAgICAgICAgdGhpcy5wYXJzZV9iYWxhbmNlICAgICAgICAgICAgICAgPSB0aGlzLnBhcnNlQmFsYW5jZVxuICAgICAgICB0aGlzLnBhcnNlX2JpZF9hc2sgICAgICAgICAgICAgICA9IHRoaXMucGFyc2VCaWRBc2tcbiAgICAgICAgdGhpcy5wYXJzZV9iaWRzX2Fza3MgICAgICAgICAgICAgPSB0aGlzLnBhcnNlQmlkc0Fza3NcbiAgICAgICAgdGhpcy5wYXJzZV9v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yZWF0ZV9vcmRlciAgICAgICAgICAgICAgICA9IHRoaXMuY3JlYXRlT3JkZXJcbiAgICAgICAgdGhpcy5jYWxjdWxhdGVfZmVlICAgICAgICAgICAgICAgPSB0aGlzLmNhbGN1bGF0ZUZlZVxuICAgICAgICB0aGlzLmNvbW1vbl9jdXJyZW5jeV9jb2RlICAgICAgICA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlXG4gICAgICAgIHRoaXMucHJpY2VfdG9fcHJlY2lzaW9uICAgICAgICAgID0gdGhpcy5wcmljZVRvUHJlY2lzaW9uXG4gICAgICAgIHRoaXMuYW1vdW50X3RvX3ByZWNpc2lvbiAgICAgICAgID0gdGhpcy5hbW91bnRUb1ByZWNpc2lvblxuICAgICAgICB0aGlzLmFtb3VudF90b19zdHJpbmcgICAgICAgICAgICA9IHRoaXMuYW1vdW50VG9TdHJpbmdcbiAgICAgICAgdGhpcy5mZWVfdG9fcHJlY2lzaW9uICAgICAgICAgICAgPSB0aGlzLmZlZVRvUHJlY2lzaW9uXG4gICAgICAgIHRoaXMuY29zdF90b19wcmVjaXNpb24gICAgICAgICAgID0gdGhpcy5jb3N0VG9QcmVjaXNpb25cbiAgICAgICAgdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nICAgICAgICAgPSBwcmVjaXNpb25Gcm9tU3RyaW5nXG4gICAgICAgIHRoaXMucHJlY2lzaW9uX2Zyb21fc3RyaW5nICAgICAgID0gcHJlY2lzaW9uRnJvbVN0cmluZ1xuICAgICAgICB0aGlzLnRydW5jYXRlICAgICAgICAgICAgICAgICAgICA9IGZ1bmN0aW9ucy50cnVuY2F0ZVxuICAgICAgICB0aGlzLnRydW5jYXRlX3RvX3N0cmluZyAgICAgICAgICA9IGZ1bmN0aW9ucy50cnVuY2F0ZV90b19zdHJpbmdcbiAgICAgICAgdGhpcy51dWlkICAgICAgICAgICAgICAgICAgICAgICAgPSB1dWlkXG5cbiAgICAgICAgLy8gQVBJIG1ldGhvZHMgbWV0YWluZ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pLm1hcCAoa2V5ID0+IHtcbiAgICAgICAgICAgIGlmICh0aGlzLnJlcXVpcmVkQ3JlZGVudGlhbHNba2V5XSAmJiAhdGhpc1trZXldKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yICh0aGlzLmlkICsgJyByZXF1aXJlcyBgJyArIGtleSArICdgJylcbiAgICAgICAgfSlcbiAgICB9XG5cbiAgICBpbml0UmVzdFJhdGVMaW1pdGVyICgpIHtcblxuICAgICAgICB0aGlzLnRva2VuQnVja2V0ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgIHJlZmlsbFJhdGU6ICAxIC8gdGhpcy5yYXRlTGltaXQsXG4gICAgICAgICAgICBkZWxheTogICAgICAgMSxcbiAgICAgICAgICAgIGNhcGFjaXR5OiAgICAxLFxuICAgICAgICAgICAgZGVmYXVsdENvc3Q6IDEsXG4gICAgICAgICAgICBtYXhDYXBhY2l0eTogMTAwMCxcbiAgICAgICAgfSwgdGhpcy50b2tlbkJ1Y2tldClcblxuICAgICAgICB0aGlzLnRocm90dGxlID0gdGhyb3R0bGUgKHRoaXMudG9rZW5CdWNrZXQpXG5cbiAgICAgICAgdGhpcy5leGVjdXRlUmVzdFJlcXVlc3QgPSBmdW5jdGlvbiAodXJsLCBtZXRob2QgPSAnR0VUJywgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuXG4gICAgICAgICAgICBsZXQgcHJvbWlzZSA9XG4gICAgICAgICAgICAgICAgdGhpcy5mZXRjaEltcGxlbWVudGF0aW9uICh1cmwsIHsgJ21ldGhvZCc6IG1ldGhvZCwgJ2hlYWRlcnMnOiBoZWFkZXJzLCAnYm9keSc6IGJvZHksICdhZ2VudCc6IHRoaXMudHVubmVsQWdlbnQgfHwgbnVsbCwgdGltZW91dDogdGhpcy50aW1lb3V0fSlcbiAgICAgICAgICAgICAgICAgICAgLmNhdGNoIChlID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc05vZGUpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlTm90QXZhaWxhYmxlIChbIHRoaXMuaWQsIG1ldGhvZCwgdXJsLCBlLnR5cGUsIGUubWVzc2FnZSBdLmpvaW4gKCcgJykpXG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBlIC8vIHJldGhyb3cgYWxsIHVua25vd24gZXJyb3JzXG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC50aGVuIChyZXNwb25zZSA9PiB0aGlzLmhhbmRsZVJlc3RFcnJvcnMgKHJlc3BvbnNlLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkpXG4gICAgICAgICAgICAgICAgICAgIC50aGVuIChyZXNwb25zZSA9PiB0aGlzLmhhbmRsZVJlc3RSZXNwb25zZSAocmVzcG9uc2UsIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSlcblxuICAgICAgICAgICAgcmV0dXJuIHRpbWVvdXQgKHRoaXMudGltZW91dCwgcHJvbWlzZSkuY2F0Y2ggKGUgPT4ge1xuICAgICAgICAgICAgICAgIGlmIChlIGluc3RhbmNlb2YgUmVxdWVzdFRpbWVvdXQpXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBSZXF1ZXN0VGltZW91dCAodGhpcy5pZCArICcgJyArIG1ldGhvZCArICcgJyArIHVybCArICcgJyArIGUubWVzc2FnZSArICcgKCcgKyB0aGlzLnRpbWVvdXQgKyAnIG1zKScpXG4gICAgICAgICAgICAgICAgdGhyb3cgZVxuICAgICAgICAgICAgfSlcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGRlZmluZVJlc3RBcGkgKGFwaSwgbWV0aG9kTmFtZSwgb3B0aW9ucyA9IHt9KSB7XG5cbiAgICAgICAgZm9yIChjb25zdCB0eXBlIG9mIE9iamVjdC5rZXlzIChhcGkpKSB7XG4gICAgIC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aXguc2xpY2UgKGNhbWVsY2FzZU1ldGhvZC5sZW5ndGgpXG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKHVuZGVyc2NvcmVTdWZmaXguaW5kZXhPZiAobG93ZXJjYXNlTWV0aG9kKSA9PT0gMClcbiAgICAgICAgICAgICAgICAgICAgICAgIHVuZGVyc2NvcmVTdWZmaXggPSB1bmRlcnNjb3JlU3VmZml4LnNsaWNlIChsb3dlcmNhc2VNZXRob2QubGVuZ3RoKVxuXG4gICAgICAgICAgICAgICAgICAgIGxldCBjYW1lbGNhc2UgID0gdHlwZSArIGNhbWVsY2FzZU1ldGhvZCArIHRoaXMuY2FwaXRhbGl6ZSAoY2FtZWxjYXNlU3VmZml4KVxuICAgICAgICAgICAgICAgICAgICBsZXQgdW5kZXJzY29yZSA9IHR5cGUgKyAnXycgKyBsb3dlcmNhc2VNZXRob2QgKyAnXycgKyB1bmRlcnNjb3JlU3VmZml4XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCdzdWZmaXhlcycgaW4gb3B0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCdjYW1lbGNhc2UnIGluIG9wdGlvbnNbJ3N1ZmZpeGVzJ10pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FtZWxjYXNlICs9IG9wdGlvbnNbJ3N1ZmZpeGVzJ11bJ2NhbWVsY2FzZSddXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJ3VuZGVyc2NvcmUnIGluIG9wdGlvbnMuc3VmZml4ZXMpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5kZXJzY29yZSArPSBvcHRpb25zWydzdWZmaXhlcyddWyd1bmRlcnNjb3JlJ11cbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmICgndW5kZXJzY29yZV9zdWZmaXgnIGluIG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgICAgICAgICB1bmRlcnNjb3JlICs9IG9wdGlvbnMudW5kZXJzY29yZVN1ZmZpeDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCdjYW1lbGNhc2Vfc3VmZml4JyBpbiBvcHRpb25zKVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FtZWxjYXNlICs9IG9wdGlvbnMuY2FtZWxjYXNlU3VmZml4O1xuXG4gICAgICAgICAgICAgICAgICAgIGxldCBwYXJ0aWFsID0gYXN5bmMgcGFyYW1zID0+IHRoaXNbbWV0aG9kTmFtZV0gKHVybCwgdHlwZSwgdXBwZXJjYXNlTWV0aG9kLCBwYXJhbXMgfHwge30pXG5cbiAgICAgICAgICAgICAgICAgICAgdGhpc1tjYW1lbGNhc2VdICA9IHBhcnRpYWxcbiAgICAgICAgICAgICAgICAgICAgdGhpc1t1bmRlcnNjb3JlXSA9IHBhcnRpYWxcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmZXRjaCAodXJsLCBtZXRob2QgPSAnR0VUJywgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuXG4gICAgICAgIGlmIChpc05vZGUgJiYgdGhpcy51c2VyQWdlbnQpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgdGhpcy51c2VyQWdlbnQgPT0gJ3N0cmluZycpXG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IGV4dGVuZCAoeyAnVXNlci1BZ2VudCc6IHRoaXMudXNlckFnZW50IH0sIGhlYWRlcnMpXG4gICAgICAgICAgICBlbHNlIGlmICgodHlwZW9mIHRoaXMudXNlckFnZW50ID09ICdvYmplY3QnKSAmJiAoJ1VzZXItQWdlbnQnIGluIHRoaXMudXNlckFnZW50KSlcbiAgICAgICAgICAgICAgICBoZWFkZXJzID0gZXh0ZW5kICh0aGlzLnVzZXJBZ2VudCwgaGVhZGVycylcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0eXBlb2YgdGhpcy5wcm94eSA9P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F0Y2ggPSBib2R5Lm1hdGNoICgvXFw8dGl0bGVcXD4oW148XSspL2kpXG4gICAgICAgIGlmIChtYXRjaClcbiAgICAgICAgICAgIGRldGFpbHMgPSBtYXRjaFsxXS50cmltICgpO1xuICAgICAgICBpZiAoWyA0MTgsIDQyOSBdLmluY2x1ZGVzIChjb2RlKSkge1xuICAgICAgICAgICAgZXJyb3IgPSBERG9TUHJvdGVjdGlvblxuICAgICAgICB9IGVsc2UgaWYgKFsgNDA0LCA0MDksIDQyMiwgNTAwLCA1MDEsIDUwMiwgNTIwLCA1MjEsIDUyMiwgNTI1IF0uaW5jbHVkZXMgKGNvZGUpKSB7XG4gICAgICAgICAgICBlcnJvciA9IEV4Y2hhbmdlTm90QXZhaWxhYmxlXG4gICAgICAgIH0gZWxzZSBpZiAoWyA0MDAsIDQwMywgNDA1LCA1MDMsIDUzMCBdLmluY2x1ZGVzIChjb2RlKSkge1xuICAgICAgICAgICAgbGV0IGRkb3NQcm90ZWN0aW9uID0gYm9keS5tYXRjaCAoL2Nsb3VkZmxhcmV8aW5jYXBzdWxhL2kpXG4gICAgICAgICAgICBpZiAoZGRvc1Byb3RlY3Rpb24pIHtcbiAgICAgICAgICAgICAgICBlcnJvciA9IEREb1NQcm90ZWN0aW9uXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGVycm9yID0gRXhjaGFuZ2VOb3RBdmFpbGFibGVcbiAgICAgICAgICAgICAgICBkZXRhaWxzICs9ICcgKHBvc3NpYmxlIHJlYXNvbnM6ICcgKyBbXG4gICAgICAgICAgICAgICAgICAgICdpbnZhbGlkIEFQSSBrZXlzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2JhZCBvciBvbGQgbm9uY2UnLFxuICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UgaXMgZG93biBvciBvZmZsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgJ29uIG1haW50ZW5hbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgJ0REb1MgcHJvdGVjdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICdyYXRlLWxpbWl0aW5nJyxcbiAgICAgICAgICAgICAgICBdLmpvaW4gKCcsICcpICsgJyknXG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAoWyA0MDgsIDUwNCBdLmluY2x1ZGVzIChjb2RlKSkge1xuICAgICAgICAgICAgZXJyb3IgPSBSZXF1ZXN0VGltZW91dFxuICAgICAgICB9IGVsc2UgaWYgKFsgNDAxLCA1MTEgXS5pbmNsdWRlcyAoY29kZSkpIHtcbiAgICAgICAgICAgIGVycm9yID0gQXV0aGVudGljYXRpb25FcnJvclxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZXJyb3IgPSBFeGNoYW5nZUVycm9yXG4gICAgICAgIH1cbiAgICAgICAgdGhyb3cgbmV3IGVycm9yIChbIHRoaXMuaWQsIG1ldGhvZCwgdXJsLCBjb2RlLCByZWFzb24sIGRldGFpbHMgXS5qb2luICgnICcpKVxuICAgIH1cblxuICAgIGhhbmRsZVJlc3RFcnJvcnMgKHJlc3BvbnNlLCB1cmwsIG1ldGhvZCA9ICdHRVQnLCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG5cbiAgICAgICAgaWYgKHR5cGVvZiByZXNwb25zZSA9PT0gJ3N0cmluZycpXG4gICAgICAgICAgICByZXR1cm4gcmVzcG9uc2VcblxuICAgICAgICByZXR1cm4gcmVzcG9uc2UudGV4dCAoKS50aGVuICh0ZXh0ID0+IHtcblxuICAgICAgICAgICAgY29uc3QgYXJncyA9IFsgcmVzcG9uc2Uuc3RhdHVzLCByZXNwb25zZS5zdGF0dXNUZXh0LCB1cmwsIG1ldGhvZCwgaGVhZGVycywgdGV4dCBdXG5cbiAgICAgICAgICAgIHRoaXMuaGFuZGxlRXJyb3JzICguLi5hcmdzKVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuZGVmYXVsdEVycm9ySGFuZGxlciAoLi4uYXJncylcbiAgICAgICAgfSlcbiAgICB9XG5cbiAgICBoYW5kbGVSZXN0UmVzcG9uc2UgKHJlc3BvbnNlLCB1cmwsIG1ldGhvZCA9ICdHRVQnLCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG5cbiAgICAgICAgdHJ5IHtcblxuICAgICAgICAgICAgdGhpcy5sYXN0X2h0dHBfcmVzcG9uc2UgPSByZXNwb25zZVxuICAgICAgICAgICAgaWYgKHRoaXMucGFyc2VKc29uUmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmxhc3RfanNvbl9yZXNwb25zZSA9XG4gICAgICAgICAgICAgICAgICAgICgodHlwZW9mIHJlc3BvbnNlID09PSAnc3RyaW5nJykgJiYgKHJlc3BvbnNlLmxlbmd0aCA+IDEpKSA/XG4gICAgICAgICAgICAgICAgICAgICAgICBKU09OLnBhcnNlIChyZXNwb25zZSkgOiByZXNwb25zZVxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmxhc3RfanNvbl9yZXNwb25zZVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gcmVzcG9uc2VcblxuICAgICAgICB9IGNhdGNoIChlKSB7XG5cbiAgICAgICAgICAgIGxldCBtYWludGVuYW5jZSA9IHJlc3BvbnNlLm1hdGNoICgvb2ZmbGluZXxidXN5fHJldHJ5fHdhaXR8dW5hdmFpbGFibGV8bWFpbnRhaW58bWFpbnRlbmFuY2V8bWFpbnRlbmFuY2luZy9pKVxuICAgICAgICAgICAgbGV0IGRkb3NQcm90ZWN0aW9uID0gcmVzcG9uc2UubWF0Y2ggKC9jbG91ZGZsYXJlfGluY2Fwc3VsYXxvdmVybG9hZC9pKVxuXG4gICAgICAgICAgICBpZiAoZSBpbnN0YW5jZW9mIFN5bnRheEVycm9yKSB7XG5cbiAgICAgICAgICAgICAgICBsZXQgZXJyb3IgPSBFeGNoYW5nZU5vdEF2YWlsYWJsZVxuICAgICAgICAgICAgICAgIGxldCBkZXRhaWxzID0gJ25vdCBhY2Nlc3NpYmxlIGZyb20gdGhpcyBsb2NhdGlvbiBhdCB0aGUgbW9tZW50J1xuICAgICAgICAgICAgICAgIGlmIChtYWludGVuYW5jZSlcbiAgICAgICAgICAgICAgICAgICAgZGV0YWlscyA9ICdvZmZsaW5lLCBvbiBtYWludGVuYW5jZSBvciB1bnJlYWNoYWJsZSBmcm9tIHRoaXMgbG9jYXRpb24gYXQgdGhlIG1vbWVudCdcbiAgICAgICAgICAgICAgICBpZiAoZGRvc1Byb3RlY3Rpb24pXG4gICAgICAgICAgICAgICAgICAgIGVycm9yID0gRERvU1Byb3RlY3Rpb25cbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgZXJyb3IgKFsgdGhpcy5pZCwgbWV0aG9kLCB1cmwsIGRldGFpbHMgXS5qb2luICgnICcpKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy52ZXJib3NlKVxuICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nICh0aGlzLmlkLCBtZXRob2QsIHVybCwgJ2Vycm9yJywgZSwgXCJyZXNwb25zZSBib2R5OlxcbidcIiArIHJlc3BvbnNlICsgXCInXCIpXG5cbiAgICAgICAgICAgIHRocm93IGVcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHNldE1hcmtldHMgKG1hcmtldHMsIGN1cnJlbmNpZXMgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHZhbHVlcyA9IE9iamVjdC52YWx1ZXMgKG1hcmtldHMpLm1hcCAobWFya2V0ID0+IGRlZXBFeHRlbmQgKHtcbiAgICAgICAgICAgICdsaW1pdHMnOiB0aGlzLmxpbWl0cyxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiB0aGlzLnByZWNpc2lvbixcbiAgICAgICAgfSwgdGhpcy5mZWVzWyd0cmFkaW5nJ10sIG1hcmtldCkpXG4gICAgICAgIHRoaXMubWFya2V0cyA9IGRlZXBFeHRlbmQgKHRoaXMubWFya2V0cywgaW5kZXhCeSAodmFsdWVzLCAnc3ltYm9sJykpXG4gICAgICAgIHRoaXMubWFya2V0c0J5SWQgPSBpbmRleEJ5IChtYXJrZXRzLCAnaWQnKVxuICAgICAgICB0aGlzLm1hcmtldHNfYnlfaWQgPSB0aGlzLm1hcmtldHNCeUlkXG4gICAgICAgIHRoaXMuc3ltYm9scyA9IE9iamVjdC5rZXlzICh0aGlzLm1hcmtldHMpLnNvcnQgKClcbiAgICAgICAgdGhpcy5pZHMgPSBPYmplY3Qua2V5cyAodGhpcy5tYXJrZXRzX2J5X2lkKS5zb3J0ICgpXG4gICAgICAgIGlmIChjdXJyZW5jaWVzKSB7XG4gICAgICAgICAgICB0aGlzLmN1cnJlbmNpZXMgPSBkZWVwRXh0ZW5kIChjdXJyZW5jaWVzLCB0aGlzLmN1cnJlbmNpZXMpXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjb25zdCBiYXNlQ3VycmVuY2llcyA9XG4gICAgICAgICAgICAgICAgdmFsdWVzLmZpbHRlciAobWFya2V0ID0+ICdiYXNlJyBpbiBtYXJrZXQpXG4gICAgICAgICAgICAgICAgICAgIC5tYXAgKG1hcmtldCA9PiAoe1xuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IG1hcmtldC5iYXNlSWQgfHwgbWFya2V0LmJhc2UsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2RlOiBtYXJrZXQuYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHByZWNpc2lvbjogbWFya2V0LnByZWNpc2lvbiA/IChtYXJrZXQucHJlY2lzaW9uLmJhc2UgfHwgbWFya2V0LnByZWNpc2lvbi5hbW91bnQpIDogOCxcbiAgICAgICAgICAgICAgICAgICAgfSkpXG4gICAgICAgICAgICBjb25zdCBxdW90ZUN1cnJlbmNpZXMgPVxuICAgICAgICAgICAgICAgIHZhbHVlcy5maWx0ZXIgKG1hcmtldCA9PiAncXVvdGUnIGluIG1hcmtldClcbiAgICAgICAgICAgICAgICAgICAgLm1hcCAobWFya2V0ID0+ICh7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogbWFya2V0LnF1b3RlSWQgfHwgbWFya2V0LnF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29kZTogbWFya2V0LnF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uOiBtYXJrZXQucHJlY2lzaW9uID8gKG1hcmtldC5wcmVjaXNpb24ucXVvdGUgfHwgbWFya2V0LnByZWNpc2lvbi5wcmljZSkgOiA4LFxuICAgICAgICAgICAgICAgICAgICB9KSlcbiAgICAgICAgICAgIGNvbnN0IGFsbEN1cnJlbmNpZXMgPSBiYXNlQ3VycmVuY2llcy5jb25jYXQgKHF1b3RlQ3VycmVuY2llcylcbiAgICAgICAgICAgIGNvbnN0IGdyb3VwZWRDdXJyZW5jaWVzID0gZ3JvdXBCeSAoYWxsQ3VycmVuY2llcywgJ2NvZGUnKVxuICAgICAgICAgICAgY29uc3QgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChncm91cGVkQ3VycmVuY2llcykubWFwIChjb2RlID0+XG4gICAgICAgICAgICAgICAgZ3JvdXBlZEN1cnJlbmNpZXNbY29kZV0ucmVkdWNlICgocHJldmlvdXMsIGN1cnJlbnQpID0+XG4gICAgICAgICAgICAgICAgICAgICgocHJldmlvdXMucHJlY2lzaW9uID4gY3VycmVudC5wcmVjaXNpb24pID8gcHJldmlvdXMgOiBjdXJyZW50KSwgZ3JvdXBlZEN1cnJlbmNpZXNbY29kZV1bMF0pKVxuICAgICAgICAgICAgY29uc3Qgc29ydGVkQ3VycmVuY2llcyA9IHNvcnRCeSAoZmxhdHRlbiAoY3VycmVuY2llcyksICdjb2RlJylcbiAgICAgICAgICAgIHRoaXMuY3VycmVuY2llcyA9IGRlZXBFeHRlbmQgKGluZGV4QnkgKHNvcnRlZEN1cnJlbmNpZXMsICdjb2RlJy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SCdcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5XG4gICAgfVxuXG4gICAgY3VycmVuY3kgKGNvZGUpIHtcblxuICAgICAgICBpZiAodHlwZW9mIHRoaXMuY3VycmVuY2llcyA9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHJldHVybiBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgY3VycmVuY2llcyBub3QgbG9hZGVkJylcblxuICAgICAgICBpZiAoKHR5cGVvZiBjb2RlID09PSAnc3RyaW5nJykgJiYgKGNvZGUgaW4gdGhpcy5jdXJyZW5jaWVzKSlcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmN1cnJlbmNpZXNbY29kZV1cblxuICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZG9lcyBub3QgaGF2ZSBjdXJyZW5jeSBjb2RlICcgKyBjb2RlKVxuICAgIH1cblxuXG4gICAgbWFya2V0IChzeW1ib2wpIHtcblxuICAgICAgICBpZiAodHlwZW9mIHRoaXMubWFya2V0cyA9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHJldHVybiBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgbWFya2V0cyBub3QgbG9hZGVkJylcblxuICAgICAgICBpZiAoKHR5cGVvZiBzeW1ib2wgPT09ICdzdHJpbmcnKSAmJiAoc3ltYm9sIGluIHRoaXMubWFya2V0cykpXG4gICAgICAgICAgICByZXR1cm4gdGhpcy5tYXJrZXRzW3N5bWJvbF1cblxuICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZG9lcyBub3QgaGF2ZSBtYXJrZXQgc3ltYm9sICcgKyBzeW1ib2wpXG4gICAgfVxuXG4gICAgbWFya2V0SWQgKHN5bWJvbCkge1xuICAgICAgICByZXR1cm4gdGhpcy5tYXJrZXQgKHN5bWJvbCkuaWQgfHwgc3ltYm9sXG4gICAgfVxuXG4gICAg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3VudEtleSA9IDEpIHtcbiAgICAgICAgdGltZXN0YW1wID0gdGltZXN0YW1wIHx8IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2JpZHMnOiAoYmlkc0tleSBpbiBvcmRlcmJvb2spID8gdGhpcy5wYXJzZUJpZHNBc2tzIChvcmRlcmJvb2tbYmlkc0tleV0sIHByaWNlS2V5LCBhbW91bnRLZXkpIDogW10sXG4gICAgICAgICAgICAnYXNrcyc6IChhc2tzS2V5IGluIG9yZGVyYm9vaykgPyB0aGlzLnBhcnNlQmlkc0Fza3MgKG9yZGVyYm9va1thc2tzS2V5XSwgcHJpY2VLZXksIGFtb3VudEtleSkgOiBbXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBnZXRDdXJyZW5jeVVzZWRPbk9wZW5PcmRlcnMgKGN1cnJlbmN5KSB7XG4gICAgICAgIHJldHVybiBPYmplY3QudmFsdWVzICh0aGlzLm9yZGVycykuZmlsdGVyIChvcmRlciA9PiAob3JkZXJbJ3N0YXR1cyddID09ICdvcGVuJykpLnJlZHVjZSAoKHRvdGFsLCBvcmRlcikgPT4ge1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG9yZGVyWydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNbc3ltYm9sXTtcbiAgICAgICAgICAgIGxldCBhbW91bnQgPSBvcmRlclsncmVtYWluaW5nJ11cbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSA9PSBtYXJrZXRbJ2Jhc2UnXSAmJiBvcmRlclsnc2lkZSddID09ICdzZWxsJykge1xuICAgICAgICAgICAgICAgIHJldHVybiB0b3RhbCArIGFtb3VudFxuICAgICAgICAg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AgICAgICAgICBiYWxhbmNlW2N1cnJlbmN5XS51c2VkID0gdGhpcy5nZXRDdXJyZW5jeVVzZWRPbk9wZW5PcmRlcnMgKGN1cnJlbmN5KVxuICAgICAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVtjdXJyZW5jeV0udG90YWwgPSBiYWxhbmNlW2N1cnJlbmN5XS51c2VkICsgYmFsYW5jZVtjdXJyZW5jeV0uZnJlZVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVtjdXJyZW5jeV0udXNlZCA9IHRoaXMuZ2V0Q3VycmVuY3lVc2VkT25PcGVuT3JkZXJzIChjdXJyZW5jeSlcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVtjdXJyZW5jeV0udG90YWwgPSBiYWxhbmNlW2N1cnJlbmN5XS51c2VkICsgYmFsYW5jZVtjdXJyZW5jeV0uZnJlZVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgWyAnZnJlZScsICd1c2VkJywgJ3RvdGFsJyBdLmZvckVhY2ggKGFjY291bnQgPT4ge1xuICAgICAgICAgICAgICAgIGJhbGFuY2VbYWNjb3VudF0gPSBiYWxhbmNlW2FjY291bnRdIHx8IHt9XG4gICAgICAgICAgICAgICAgYmFsYW5jZVthY2NvdW50XVtjdXJyZW5jeV0gPSBiYWxhbmNlW2N1cnJlbmN5XVthY2NvdW50XVxuICAgICAgICAgICAgfSlcbiAgICAgICAgfSlcblxuICAgICAgICByZXR1cm4gYmFsYW5jZVxuICAgIH1cblxuICAgIGFzeW5jIGZldGNoUGFydGlhbEJhbGFuY2UgKHBhcnQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBiYWxhbmNlID0gYXdhaXQgdGhpcy5mZXRjaEJhbGFuY2UgKHBhcmFtcylcbiAgICAgICAgcmV0dXJuIGJhbGFuY2VbcGFydF1cbiAg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VVENGdWxsWWVhciAoKVxuICAgICAgICBsZXQgbSA9IGRhdGUuZ2V0VVRDTW9udGggKCkgKyAxXG4gICAgICAgIGxldCBkID0gZGF0ZS5nZXRVVENEYXRlICgpXG4gICAgICAgIGxldCBIID0gZGF0ZS5nZXRVVENIb3VycyAoKVxuICAgICAgICBsZXQgTSA9IGRhdGUuZ2V0VVRDTWludXRlcyAoKVxuICAgICAgICBsZXQgUyA9IGRhdGUuZ2V0VVRDU2Vjb25kcyAoKVxuICAgICAgICBtID0gbSA8IDEwID8gKCcwJyArIG0pIDogbVxuICAgICAgICBkID0gZCA8IDEwID8gKCcwJyArIGQpIDogZFxuICAgICAgICBIID0gSCA8IDEwID8gKCcwJyArIEgpIDogSFxuICAgICAgICBNID0gTSA8IDEwID8gKCcwJyArIE0pIDogTVxuICAgICAgICBTID0gUyA8IDEwID8gKCcwJyArIFMpIDogU1xuICAgICAgICByZXR1cm4gWSArICctJyArIG0gKyAnLScgKyBkICsgaW5maXggKyBIICsgJzonICsgTSArICc6JyArIFNcbiAgICB9XG59XG4iLCJcInVzZSBzdHJpY3RcIjtcblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBNYXJrZXQge1xuXG4gICAgY29uc3RydWN0b3IgKGV4Y2hhbmdlLCBzeW1ib2wpIHtcbiAgICAgICAgdGhpcy5leGNoYW5nZSA9IGV4Y2hhbmdlO1xuICAgICAgICB0aGlzLnN5bWJvbCA9IHN5bWJvbDtcbiAgICAgICAgdGhpcy5tYXJrZXQgPSBleGNoYW5nZS5tYXJrZXRzW3N5bWJvbF07XG4gICAgfVxuXG4gICAgYW1vdW50VG9QcmVjaXNpb24gKGFtb3VudCkge1xuICAgICAgICByZXR1cm4gdGhpcy5leGNoYW5nZS5hbW91bnRUb1ByZWNpc2lvbiAodGhpcy5zeW1ib2wsIGFtb3VudClcbiAgICB9XG5cbiAgICBjcmVhdGVMaW1pdEJ1eU9yZGVyKGFtb3VudCwgcHJpY2UpIHtcbiAgICAgICAgcm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1xuXG4gICAgICAgICAgICBpZiAodHlwZW9mIHJlc3VsdCAhPT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICByZXN1bHQgPSB7fVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmb3IgKGNvbnN0IGtleSBpbiBhcmcpIHtcbiAgICAgICAgICAgICAgICByZXN1bHRba2V5XSA9IGRlZXBFeHRlbmQgKHJlc3VsdFtrZXldLCBhcmdba2V5XSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICB9IGVsc2Uge1xuXG4gICAgICAgICAgICByZXN1bHQgPSBhcmdcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiByZXN1bHRcbn1cblxuY29uc3Qgb21pdCA9IChvYmplY3QsIC4uLmFyZ3MpID0+IHtcbiAgICBjb25zdCByZXN1bHQgPSBleHRlbmQgKG9iamVjdClcbiAgICBmb3IgKGNvbnN0IHggb2YgYXJncykge1xuICAgICAgICBpZiAodHlwZW9mIHggPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICBkZWxldGUgcmVzdWx0W3hdXG4gICAgICAgIH0gZWxzZSBpZiAoQXJyYXkuaXNBcnJheSAoeCkpIHtcbiAgICAgICAgICAgIGZvciAoY29uc3QgayBvZiB4KVxuICAgICAgICAgICAgICAgIGRlbGV0ZSByZXN1bHRba11cbiAgICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gcmVzdWx0XG59XG5cbmNvbnN0IGdyb3VwQnkgPSAoYXJyYXksIGtleSkgPT4ge1xuICAgIGNvbnN0IHJlc3VsdCA9IHt9XG4gICAgT2JqZWN0XG4gICAgICAgIC52YWx1ZXMgKGFycmF5KVxuICAgICAgICAuZmlsdGVyIChlbnRyeSA9PiB0eXBlb2YgZW50cnlba2V5XSAhPSAndW5kZWZpbmVkJylcbiAgICAgICAgLmZvckVhY2ggKGVudHJ5ID0+IHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgcmVzdWx0W2VudHJ5W2tleV1dID09ICd1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ICcgKyBjZmcubWF4Q2FwYWNpdHkpXG5cbiAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlIChhc3luYyAocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG5cbiAgICAgICAgICAgIHRyeSB7XG5cbiAgICAgICAgICAgICAgICBxdWV1ZS5wdXNoICh7IGNvc3QsIHJlc29sdmUsIHJlamVjdCB9KVxuXG4gICAgICAgICAgICAgICAgaWYgKCFydW5uaW5nKSB7XG4gICAgICAgICAgICAgICAgICAgIHJ1bm5pbmcgPSB0cnVlXG4gICAgICAgICAgICAgICAgICAgIHdoaWxlIChxdWV1ZS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBoYXNFbm91Z2hUb2tlbnMgPSBjZmcuY2FwYWNpdHkgPyAobnVtVG9rZW5zID4gMCkgOiAobnVtVG9rZW5zID49IDApXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGFzRW5vdWdoVG9rZW5zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHF1ZXVlLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHsgY29zdCwgcmVzb2x2ZSwgcmVqZWN0IH0gPSBxdWV1ZVswXVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3N0ID0gKGNvc3QgfHwgY2ZnLmRlZmF1bHRDb3N0KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobnVtVG9rZW5zID49IE1hdGgubWluIChjb3N0LCBjZmcuY2FwYWNpdHkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1Ub2tlbnMgLT0gY29zdFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVldWUuc2hpZnQgKClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUgKClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBub3cgPSBEYXRlLm5vdyAoKVxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGVsYXBzZWQgPSBub3cgLSBsYXN0VGltZXN0YW1wXG4gICAgICAgICAgICAgICAgICAgICAgICBsYXN0VGltZXN0YW1wID0gbm93XG4gICAgICAgICAgICAgICAgICAgICAgICBudW1Ub2tlbnMgPSBNYXRoLm1pbiAoY2ZnLmNhcGFjaXR5LCBudW1Ub2tlbnMgKyBlbGFwc2VkICogY2ZnLnJlZmlsbFJhdGUpXG4gICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBzbGVlcCAoY2ZnLmRlbGF5KVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJ1bm5pbmcgPSBmYWxzZVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuXG4gICAgICAgICAgICAgICAgcmVqZWN0IChlKVxuICAgICAgICAgICAgfVxuICAgICAgICB9KVxuXG4gICAgfSwgY2ZnLCB7XG4gICAgICAgIGNvbmZpZ3VyZTogbmV3Q2ZnID0+IHRocm90dGxlIChPYmplY3QuYXNzaWduICh7fSwgY2ZnLCBuZXdDZmcpKVxuICAgIH0pXG59XG5cbm1vZHVsZS5leHBvcnRzID0gdGhyb3R0bGVcbiIsIlwidXNlIHN0cmljdFwiO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbmNvbnN0IEV4Y2hhbmdlID0gcmVxdWlyZSAoJy4vYmFzZS9FeGNoYW5nZScpO1xuY29uc3QgeyBFeGNoYW5nZUVycm9yLCBBdXRoZW50aWNhdGlvbk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4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtaW4nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bWluJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bWluJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbWluJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMWhvdXInLFxuICAgICAgICAgICAgICAgICc4aCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICdkYXknLFxuICAgICAgICAgICAgICAgICcxdyc6ICd3ZWVrJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM0OTAyNjExLTJiZThiZjFhLWY4MzAtMTFlNy05MWEyLTExYjJmMjkyZTc1MC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuYmlib3guY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpYm94LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vQmlib3hjb20vYXBpX3JlZmVyZW5jZS93aWtpL2hvbWVfZW4nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYmlib3guemVuZGVzay5jb20vaGMvZW4tdXMvYXJ0aWNsZXMvMTE1MDA0NDE3MDEzLUZlZS1TdHJ1Y3R1cmUtb24tQmlib3gnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiByZXdvcmsgZm9yIGZ1bGwgZW5kcG9pbnQvY21kIHBhdGhzIGhlcmVcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZGF0YScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJwZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JzogMC4wLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY1Bvc3RNZGF0YSAoe1xuICAgICAgICAgICAgJ2NtZCc6ICdhcGkvbWFya2V0QWxsJyxcbiAgICAgICAgICAgICdib2R5Jzoge30sXG4gICAgICAgIH0pO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ2NvaW5fc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ2N1cnJlbmN5X3N5bWJvbCddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgaWQgPSBiYXNlICsgJ18nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMuc2FmZ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Nwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgdCA9IDA7IHQgPCB0aWNrZXJzLmxlbmd0aDsgdCsrKSB7XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2Vyc1t0XSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gdGlja2VyWydzeW1ib2wnXTtcbiAgICAgICAgICAgIGlmIChzeW1ib2xzICYmICghKHN5bWJvbCBpbiBzeW1ib2xzKSkpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGlja2VyO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ3RpbWUnXTtcbiAgICAgICAgbGV0IHNpZGUgPSAodHJhZGVbJ3NpZGUnXSA9PT0gJzEnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydhbW91bnQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHNpemUgPSAobGltaXQpID8gbGltaXQgOiAyMDA7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljUG9zdE1kYXRhICh7XG4gICAgICAgICAgICAnY21kJzogJ2FwaS9kZWFscycsXG4gICAgICAgICAgICAnYm9keSc6IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3BhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAgICAgJ3NpemUnOiBzaXplLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSxcbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZVsncmVzdWx0J10sIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljUG9zdE1kYXRhICh7XG4gICAgICAgICAgICAnY21kJzogJ2FwaS9kZXB0aCcsXG4gICAgICAgICAgICAnYm9keSc6IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3BhaXInOiBtYXJrZXRbJ2lkJ10sXG4g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ZV93aXRoZHJhdyddO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChkZXBvc2l0ICYmIHdpdGhkcmF3KTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WyduYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYW5zZmVyICh7XG4gICAgICAgICAgICAnY21kJzogJ3RyYW5zZmVyL2Fzc2V0cycsXG4gICAgICAgICAgICAnYm9keSc6IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3NlbGVjdCc6IDEsXG4gICAgICAgICAgICB9LCBwYXJhbXMpLFxuICAgICAgICB9KTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBpbmRleGVkID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2Fzc2V0c19saXN0JyBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgaW5kZXhlZCA9IHRoaXMuaW5kZXhCeSAoYmFsYW5jZXNbJ2Fzc2V0c19saXN0J10sICdjb2luX3N5bWJvbCcpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaW5kZXhlZCA9IHt9O1xuICAgICAgICB9XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKGluZGV4ZWQpO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ID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE9yZGVyICh7XG4gICAgICAgICAgICAnY21kJzogJ29yZGVycGVuZGluZy90cmFkZScsXG4gICAgICAgICAgICAnYm9keSc6IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3BhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAgICAgJ2FjY291bnRfdHlwZSc6IDAsXG4gICAgICAgICAgICAgICAgJ29yZGVyX3R5cGUnOiBvcmRlclR5cGUsXG4gICAgICAgICAgICAgICAgJ29yZGVyX3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgICAgICdwYXlfYml4JzogMCxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSxcbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ3Jlc3VsdCcpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0Q2FuY2VsT3JkZXIgKHtcbiAgICAgICAgICAgICdjbWQnOiAnb3JkZXJwZW5kaW5nL2NhbmNlbFRyYWRlJyxcbiAgICAgICAgICAgICdib2R5JzogdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnb3JkZXJzX2lkJzogaWQsXG4gICAgICAgICAgICB9LCBwYXJhbXMpLFxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZX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AgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKGN1cnJlbmN5KTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYW5zZmVyICh7XG4gICAgICAgICAgICAnY21kJzogJ3RyYW5zZmVyL3RyYW5zZmVyT3V0SW5mbycsXG4gICAgICAgICAgICAnYm9keSc6IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2NvaW5fc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSxcbiAgICAgICAgfSk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgd2l0aGRyYXcgKGNvZGUsIGFtb3VudCwgYWRkcmVzcywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jeSAoY29kZSk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RUcmFuc2ZlciAoe1xuICAgICAgICAgICAgJ2NtZCc6ICd0cmFuc2Zlci90cmFuc2Zlck91dCcsXG4gICAgICAgICAgICAnYm9keSc6IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2NvaW5fc3ltYm9sJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICAgICAnYWRkcic6IGFkZHJlc3MsXG4gICAgICAgICAgICAgICAgJ2FkZHJfcmVtYXJrJzogJycsXG4gICAgICAgICAgICB9LCBwYXJhbXMpLFxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGxldCBjbWRzID0gdGhpcy5qc29uIChbIHBhcmFtcyBdKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGJvZHkgPSB7XG4gICAgICAgICAgICAgICAgJ2NtZHMnOiBjbWRzLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgYm9keSA9IHtcbiAgICAgICAgICAgICAgICAnY21kcyc6IGNtZHMsXG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoY21kcyksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdtZDUnKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyB9O1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLC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ogNTAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgIC8vIG9ic29sZXRlIG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhc0ZldGNoRnVsbFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgLy8gbmV3IG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hGdWxsVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzNtJzogJzNtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMmgnLFxuICAgICAgICAgICAgICAgICc0aCc6ICc0aCcsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnOGgnOiAnOGgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgICAgICczZCc6ICczZCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzF3JyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjk2MDQwMjAtZDU0ODNjZGMtODdlZS0xMWU3LTk0YzctZDFhOGQ5MTY5MjkzLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL3d3dy5iaW5hbmNlLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICd3YXBpJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL3dhcGkvdjMnLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL2FwaS92MScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL2FwaS92MycsXG4gICAgICAgICAgICAgICAgICAgICd2Myc6ICdodHRwczovL2FwaS5iaW5hbmNlLmNvbS9hcGkvdjMnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaW5hbmNlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vYmluYW5jZS1leGNoYW5nZS9iaW5hbmNlLW9mZmljaWFsLWFwaS1kb2NzL2Jsb2IvbWFzdGVyL3Jlc3QtYXBpLm1kJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYmluYW5jZS56ZW5kZXNrLmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDA0MjkzMzInLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9zdXBwb3J0LmJpbmFuY2UuY29tL2hjL2VuLXVzL2FydGljbGVzLzExNTAwMDU4MzMxMScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3ZWInOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvcHVibGljL3Byb2R1Y3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3dhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0SGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndjMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3ByaWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvYm9va1RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlSW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGltZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FnZ1RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvMjRocicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL2FsbFByaWNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL2FsbEJvb2tUaWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvcHJpY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci9ib29rVGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbGxPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3Rlc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJEYXRhU3RyZWFtJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyRGF0YVN0cmVhbScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJEYXRhU3RyZWFtJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOQic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOVCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk5UJzogMS4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0FTJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAyNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09BWCc6IDYuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlQnOiA2MC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DTyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMC40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAxMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUUkFUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOR0xTJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUVgnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS05DJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDgwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSU5LJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYVkcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RSJzogNy4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NBTFQnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU9UQSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNREEnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRMJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVQic6IDQuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDM1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5HJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FTVCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVlgnOiAyLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVRJzogMTUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMUkMnOiAxMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQic6IDIwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFNSJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDMwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9XUic6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUksnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWU9ZTyc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4xNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNT0QnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5KJzogODAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVE9SSic6IDMuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS01EJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05VTFMnOiA0LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkNOJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRE4nOiAwLjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETFQnOiAxNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNQic6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFUJzogMTUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ1BUJzogMTQuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUk4nOiA3LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1ZUJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEVCc6IDM1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1hTJzogMC4zLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPRSc6IDUwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVNQJzogMzAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVFMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFpDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMU0snOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5UJzogMzUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVUVMJzogNjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQU5BJzogMzAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0QnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdEJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRFgnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQURBJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTVQnOiAxNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hMTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05EJzogMTgwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEVORCc6IDUwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0FCSSc6IDQuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTkInOiA3MC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dBVkVTJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNYJzogMS41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dUTyc6IDMwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1NUJzogMTUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTEYnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUlPTic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORUJMJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUkQnOiAzLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMS41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dJTkdTJzogMy4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05BVic6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVU4nOiAwLjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJJRyc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQk5CJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0FTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPQVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUUkFUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlFYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLTkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSU5LJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYVkcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FMVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU9UQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTURBJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VORyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVNUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVRJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMUkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFNSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPV1InOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSSyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWU9ZTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNT0QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOSic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RPUkonOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEV4Y2hhbmdlSW5mbyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnc3ltYm9scyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnYmFzZUFzc2V0J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsncXVvdGVBc3NldCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgZmlsdGVycyA9IHRoaXMuaW5kZXhCeSAobWFya2V0WydmaWx0ZXJzJ10sICdmaWx0ZXJUeXBlJyk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdiYXNlJzogbWFya2V0WydiYXNlQXNzZXRQcmVjaXNpb24nXSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBtYXJrZXRbJ3F1b3RlUHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYmFzZUFzc2V0UHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydxdW90ZVByZWNpc2lvbiddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAobWFya2V0WydzdGF0dXMnXSA9PSAnVFJBRElORycpO1xuICAgICAgICAgICAgbGV0IGxvdCA9IC0xICogTWF0aC5sb2cxMCAocHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICBsZXQgZW50cnkgPSB0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAtMSAqIE1hdGgubG9nMTAgKHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlmICgnUFJJQ0VfRklMVEVSJyBpbiBmaWx0ZXJzKSB7XG4gICAgICAgICAgICAgICAgbGV0IGZpbHRlciA9IGZpbHRlcnNbJ1BSSUNFX0ZJTFRFUiddO1xuICAgICAgICAgICAgICAgIGVudHJ5WydwcmVjaXNpb24nXVsncHJpY2UnXSA9IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAoZmlsdGVyWyd0aWNrU2l6ZSddKTtcbiAgICAgICAgICAgICAgICBlbnRyeVsnbGltaXRzJ11bJ3ByaWNlJ10gPSB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChmaWx0ZXJbJ21pblByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogcGFyc2VGbG9hdCAoZmlsdGVyWydtYXhQcmljZSddKSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdMT1RfU0laRScgaW4gZmlsdGVycykge1xuICAgICAgICAgICAgICAgIGxldCBmaWx0ZXIgPSBmaWx0ZXJzWydMT1RfU0laRSddO1xuICAgICAgICAgICAgICAgIGVudHJ5WydwcmVjaXNpb24nXVsnYW1vdW50J10gPSB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKGZpbHRlclsnc3RlcFNpemUnXSk7XG4gICAgICAgICAgICAgICAgZW50cnlbJ2xvdCddID0gcGFyc2VGbG9hdCAoZmlsdGVyWydzdGVwU2l6ZSddKTtcbiAgICAgICAgICAgICAgICBlbnRyeVsnbGltaXRzJ11bJ2Ftb3VudCddID0ge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogcGFyc2VGbG9hdCAoZmlsdGVyWydtaW5RdHknXSksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiBwYXJzZUZsb2F0IChmaWx0ZXJbJ21heFF0eSddKSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdNSU5fTk9USU9OQUwnIGluIGZpbHRlcnMpIHtcbiAgICAgICAgICAgICAgICBlbnRyeVsnbGltaXRzJ11bJ2Nvc3QnXVsnbWluJ10gPSBwYXJzZUZsb2F0IChmaWx0ZXJzWydNSU5fTk9USU9OQUwnXVsnbWluTm90aW9uYWwnXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoZW50cnkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgY2FsY3VsYXRlRmVlIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UsIHRha2VyT3JNYWtlciA9ICd0YWtlcicsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNbc3ltYm9sXTtcbiAgICAgICAgbGV0IGtleSA9ICdxdW90ZSc7XG4gICAgICAgIGxldCByYXRlID0gbWFya2V0W3Rha2VyT3JNYWtlcl07XG4gICAgICAgIGxldCBjb3N0ID0gcGFyc2VGbG9hdCAodGhpcy5jb3N0VG9QcmVjaXNpb24gKHN5bWJvbCwgYW1vdW50ICogc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ubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdGlja2VyWydzeW1ib2wnXTtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGlmIChzeW1ib2wgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3N5bWJvbF07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2hQcmljZScpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3dQcmljZScpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiaWRQcmljZScpLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2tQcmljZScpLFxuICAgICAgICAgICAgJ3Z3YXAnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnd2VpZ2h0ZWRBdmdQcmljZScpLFxuICAgICAgICAgICAgJ29wZW4nOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnb3BlblByaWNlJyksXG4gICAgICAgICAgICAnY2xvc2UnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAncHJldkNsb3NlUHJpY2UnKSxcbiAgICAgICAgICAgICdmaXJzd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GxldCBpZCA9IHRyYWRlW2lkRmllbGRdLnRvU3RyaW5nICgpO1xuICAgICAgICBsZXQgc2lkZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IG9yZGVyID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ29yZGVySWQnIGluIHRyYWRlKVxuICAgICAgICAgICAgb3JkZXIgPSB0cmFkZVsnb3JkZXJJZCddLnRvU3RyaW5nICgpO1xuICAgICAgICBpZiAoJ20nIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBzaWRlID0gdHJhZGVbJ20nXSA/ICdzZWxsJyA6ICdidXknOyAvLyB0aGlzIGlzIHJldmVyc2VkIGludGVudGlvbmFsbHlcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHNpZGUgPSAodHJhZGVbJ2lzQnV5ZXInXSkgPyAnYnV5JyA6ICdzZWxsJzsgLy8gdGhpcyBpcyBhIHRydWUgc2lkZVxuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnY29tbWlzc2lvbicgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IHBhcnNlRmxvYXQgKHRyYWRlWydjb21taXNzaW9uJ10pLFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlICh0cmFkZVsnY29tbWlzc2lvbkFzc2V0J10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICA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Ym9sJ107XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBvcmRlclsnc3ltYm9sJ107XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgndGltZScgaW4gb3JkZXIpXG4gICAgICAgICAgICB0aW1lc3RhbXAgPSBvcmRlclsndGltZSddO1xuICAgICAgICBlbHNlIGlmICgndHJhbnNhY3RUaW1lJyBpbiBvcmRlcilcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IG9yZGVyWyd0cmFuc2FjdFRpbWUnXTtcbiAgICAgICAgZWxzZVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIG1hbGZvcm1lZCBvcmRlcjogJyArIHRoaXMuanNvbiAob3JkZXIpKTtcbiAgICAgICAgbGV0IHByaWNlID0gcGFyc2VGbG9hdCAob3JkZXJbJ3ByaWNlJ10pO1xuICAgICAgICBsZXQgYW1vdW50ID0gcGFyc2VGbG9hdCAob3JkZXJbJ29yaWdRdHknXSk7XG4gICAgICAgIGxldCBmaWxsZWQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdleGVjdXRlZFF0eScsIDAuMCk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSBNYXRoLm1heCAoYW1vdW50IC0gZmlsbGVkLCAwLjApO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydvcmRlcklkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ3R5cGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3NpZGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdxdWFudGl0eSc6IHRoaXMuYW1vdW50VG9TdHJpbmcgKHN5bWJvbCwgYW1vdW50KSxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZS50b1VwcGVyQ2FzZSAoKSxcbiAgICAgICAgICA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ycmVuY3kpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydzdWNjZXNzJ10pIHtcbiAgICAgICAgICAgICAgICBsZXQgYWRkcmVzcyA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdhZGRyZXNzJyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgICAgICdhZGRyZXNzJzogYWRkcmVzcyxcbiAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZmV0Y2hEZXBvc2l0QWRkcmVzcyBmYWlsZWQ6ICcgKyB0aGlzLmxhc3RfaHR0cF9yZXNwb25zZSk7XG4gICAgfVxuXG4gICAgYXN5bmMgd2l0aGRyYXcgKGN1cnJlbmN5LCBhbW91bnQsIGFkZHJlc3MsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMud2FwaVBvc3RXaXRoZHJhdyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdhc3NldCc6IHRoaXMuY3VycmVuY3lJZCAoY3VycmVuY3kpLFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHBhcnNlRmxvYXQgKGFtb3VudCksXG4gICAgICAgICAgICAnbmFtZSc6IGFkZHJlc3MsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdpZCcpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXTtcbiAgICAgICAgdXJsICs9ICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT0gJ3dhcGknKVxuICAgICAgICAgICAgdXJsICs9ICcuaHRtbCc7XG4gICAgICAgIGlmICgoYXBpID09ICdwcml2YXRlJykgfHwgKGFwaSA9PSAnd2FwaScpKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdyZWN2V2luZG93JzogMTAwMDAwLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIHF1ZXJ5ICs9ICcmJyArICdzaWduYXR1cmU9JyArIHNpZ25hdHVyZTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ1gtTUJYLUFQSUtFWSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmICgobWV0aG9kID09ICdHRVQnKSB8fCAoYXBpID09ICd3YXBpJykpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGJvZHkgPSBxdWVyeTtcbiAgICAgICAgICAgICAgICBoZWFkZXJzWydDb250ZW50LVR5cGUnXSA9ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGNvZGUgPj0gNDAwKSB7XG4gICAgICAgICAgICBpZiAoY29kZSA9PSA0MTgpXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uICh0aGlzLmlkICsgJyAnICsgY29kZS50b1N0cmluZyAoKSArICcgJyArIHJlYXNvbiArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgaWYgKGJvZHkuaW5kZXhPZiAoJ1ByaWNlICogUVRZIGlzIHplcm8gb3IgbGVzcycpID49IDApXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgb3JkZXIgY29zdCA9IGFtb3VudCAqIHByaWNlIGlzIHplcm8gb3IgbGVzcyAnICsgYm9keSk7XG4gICAgICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnTUlOX05PVElPTkFMJykgPj0gMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyBvcmRlciBjb3N0ID0gYW1vdW50ICogcHJpY2UgaXMgdG9vIHNtYWxsICcgKyBib2R5KTtcbiAgICAgICAgICAgIGlmIChib2R5LmluZGV4T2YgKCdMT1RfU0laRScpID49IDApXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgb3JkZXIgYW1vdW50IHNob3VsZCBiZSBldmVubHkgZGl2aXNpYmxlIGJ5IGxvdCBzaXplLCB1c2UgdGhpcy5hbW91bnRUb0xvdHMgKHN5bWJvbCwgYW1vdW50KSAnICsgYm9keSk7XG4gICAgICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnUFJJQ0VfRklMVEVSJykgPj0gMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyBvcmRlciBwcmljZSBleGNlZWRzIGFsbG93ZWQgcHJpY2UgcHJlY2lzaW9uIG9yIGludmFsaWQsIHVzZSB0aGlzLnByaWNlVG9QcmVjaXNpb24gKHN5bWJvbCwgYW1vdW50KSAnICsgYm9keSk7XG4gICAgICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnT3JkZXIgZG9lcyBub3QgZXhpc3QnKSA+PSAwKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGJvZHlbMF0gPT0gXCJ7XCIpIHtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgbGV0IGVycm9yID0gdG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gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnRXhjaGFuZ2VzL3twYWlyfS9UaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0V4Y2hhbmdlcy97cGFpcn0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFeGNoYW5nZXMve3BhaXJ9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9CYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0JhbGFuY2UvdjInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01lcmNoYW50L0NyZWF0ZUNoZWNrb3V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9BY2NvdW50SGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkQ29pbkZ1bmRzUmVxdWVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkRnVuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZE9yZGVyTWFya2V0UHJpY2VCdXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZE9yZGVyTWFya2V0UHJpY2VTZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9DYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvTXlPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BheW1lbnQvR2V0TXlJZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUGF5bWVudC9TZW5kJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvTklTJzogeyAnaWQnOiAnQnRjTmlzJywgJ3N5bWJvbCc6ICdCVEMvTklTJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ05JUycgfSxcbiAgICAgICAgICAgICAgICAnQkNIL05JUyc6IHsgJ2lkJzogJ0JjaE5pcycsICdzeW1ib2wnOiAnQkNIL05JUycsICdiYXNlJzogJ0JDSCcsICdxdW90ZSc6ICdOSVMnIH0sXG4gICAgICAgICAgICAgICAgJ0xUQy9OSVMnOiB7ICdpZCc6ICdMdGNOaXMnLCAnc3ltYm9sJzogJ0xUQy9OSVMnLCAnYmFzZSc6ICdMVEMnLCAncXVvdGUnOiAnTklTJyB9LFxuICAgICAgICAgICAgICAgICdCVEcvTklTJzogeyAnaWQnOiAnQnRnTmlzJywgJ3N5bWJvbCc6ICdCVEcvTklTJywgJ2Jhc2UnOiAnQlRHJywgJ3F1b3RlJzogJ05JUycgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC41IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjUgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QWNjb3VudEJhbGFuY2VWMiAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgYXZhaWxhYmxlID0gJ0FWQUlMQUJMRV8nICsgY3VycmVuY3k7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYmFsYW5jZVthdmFpbGFibGVdO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBiYWxhbmNlW2N1cnJlbmN5XTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEV4Y2hhbmdlc1BhaXJPcmRlcmJvb2sgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3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biAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsbCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZVByaWNlLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGUnXSkgKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFk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gICAgICdpZCc6ICdiaXRiYXknLFxuICAgICAgICAgICAgJ25hbWUnOiAnQml0QmF5JyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdQTCcsICdFVScgXSwgLy8gUG9sYW5kXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MTMyLTk3OGE3YmQ4LTVlY2UtMTFlNy05NTQwLWJjOTZkMWU5YmJiOC5qcGcnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9iaXRiYXkubmV0JyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYml0YmF5Lm5ldC9BUEkvUHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9iaXRiYXkubmV0L0FQSS9UcmFkaW5nL3RyYWRpbmdBcGkucGhwJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpdGJheS5uZXQvcHVibGljLWFwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpdGJheS5uZXQvYWNjb3VudC90YWItYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9CaXRCYXlOZXQvQVBJJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYml0YmF5Lm5ldC9lbi9mZWVzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9VU0QnOiB7ICdpZCc6ICdCVENVU0QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJywgJ2Jhc2VJZCc6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c6ICdHQU1FQlRDJywgJ3N5bWJvbCc6ICdHQU1FL0JUQycsICdiYXNlJzogJ0dBTUUnLCAncXVvdGUnOiAnQlRDJywgJ2Jhc2VJZCc6ICdHQU1FJywgJ3F1b3RlSWQnOiAnQlRDJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjMgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDA0MyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDAxMjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFNLJzogMC4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQU1FJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMDAwOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTE4nOiA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDEuNSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0SW5mbyAoKTtcbiAgICAgICAgaWYgKCdiYWxhbmNlcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ2JhbGFuY2VzJ107XG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2UgfTtcbiAgICAgICAgICAgIGxldCBjb2RlcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjb2Rlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBjb2RlID0gY29kZXNbaV07XG4gICAgICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jaWVzW2NvZGVdO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmN5WydpZCddO1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgICAgIGlmIChpZCBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbaWRdWydhdmFpbGFibGUnXSk7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbaWRdWydsb2NrZWQnXSk7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSB0aGlzLnN1bSAoYWNjb3VudFsnZnJlZSddLCBhY2NvdW50Wyd1c2VkJ10pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgICAg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AgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbWF4JyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21pbicpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiaWQnKSxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYXNrJyksXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2F2ZXJhZ2UnKSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10sXG4gICAgICAgICAgICAnaW5mbyc6IH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XG4gICAgICAgIH07XG4gICAgICAgIGlmICh0aGlzLmlzRmlhdCAoY29kZSkpIHtcbiAgICAgICAgICAgIG1ldGhvZCA9ICdwcml2YXRlUG9zdFdpdGhkcmF3JztcbiAgICAgICAgICAgIC8vIHJlcXVlc3RbJ2FjY291bnQnXSA9IHBhcmFtc1snYWNjb3VudCddOyAvLyB0aGV5IGRlbWFuZCBhbiBhY2NvdW50IG51bWJlclxuICAgICAgICAgICAgLy8gcmVxdWVzdFsnZXhwcmVzcyddID0gcGFyYW1zWydleHByZXNzJ107IC8vIHdoYXRldmVyIGl0IG1lYW5zLCB0aGV5IGRvbid0IGV4cGxhaW5cbiAgICAgICAgICAgIC8vIHJlcXVlc3RbJ2JpYyddID0gJyc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtZXRob2QgPSAncHJpdmF0ZVBvc3RUcmFuc2Zlcic7XG4gICAgICAgICAgICByZXF1ZXN0WydhZGRyZXNzJ10gPSBhZGRyZXNzO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV07XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk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9ITENWJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAnMS43JywgLy8gYXMgb2YgNiBOb3ZlbWJlciAyMDE3XG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MTM4LTA0M2M3Nzg2LTVlY2YtMTFlNy04ODJiLTgwOWMxNGYzOGI1My5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly92aXAuYml0Y29pbi5jby5pZC9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3ZpcC5iaXRjb2luLmNvLmlkL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRjb2luLmNvLmlkJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly92aXAuYml0Y29pbi5jby5pZC9kb3dubG9hZHMvQklUQ09JTkNPSUQtQVBJLURPQ1VNRU5UQVRJT04ucGRmJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vdmlwLmJpdGNvaW4uY28uaWQvdHJhZGVfYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cGFpcn0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cGFpcn0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cGFpcn0vZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckhpc3RvcnknXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0lEUic6IHsgJ2lkJzogJ2J0Y19pZHInLCAnc3ltYm9sJzogJ0JUQy9JRFInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiA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gICAgICAgbGV0IHJlbWFpbmluZyA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gbWFya2V0WydxdW90ZUlkJ107XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydiYXNlSWQnXTtcbiAgICAgICAgICAgIGlmICgobWFya2V0WydxdW90ZUlkJ10gPT0gJ2lkcicpICYmICgnb3JkZXJfcnAnIGluIG9yZGVyKSlcbiAgICAgICAgICAgICAgICBxdW90ZUlkID0gJ3JwJztcbiAgICAgICAgICAgIGlmICgobWFya2V0WydiYXNlSWQnXSA9PSAnaWRyJykgJiYgKCdyZW1haW5fcnAnIGluIG9yZGVyKSlcbiAgICAgICAgICAgICAgICBiYXNlSWQgPSAncnAnO1xuICAgICAgICAgICAgY29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ29yZGVyXycgKyBxdW90ZUlkKTtcbiAgICAgICAgICAgIGlmIChjb3N0KSB7XG4gICAgICAgICAgICAgICAgYW1vdW50ID0gY29zdCAvIHByaWNlO1xuICAgICAgICAgICAgICAgIGxldCByZW1haW5pbmdDb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncmVtYWluXycgKyBxdW90ZUlkKTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZ0Nvc3QgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlbWFpbmluZyA9IHJlbWFpbmluZ0Nvc3QgLyBwcmljZTtcbiAgICAgICAgICAgICAgICAgICAgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnb3JkZXJfJyArIGJhc2VJZCk7XG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICAgICAgICAgIHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3JlbWFpbl8nICsgYmFzZUlkKTtcbiAgICAgICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGF2ZXJhZ2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChmaWxsZWQpXG4gICAgICAgICAgICBhdmVyYWdlID0gY29zdCAvIGZpbGxlZDtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChvcmRlclsnc3VibWl0X3RpbWUnXSk7XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyX2lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiBhdmVyYWdlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWlu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mVzdWx0ID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXN1bHQsXG4gICAgICAgICAgICAnaWQnOiByZXN1bHRbJ3JldHVybiddWydvcmRlcl9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ29yZGVyX2lkJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdub25jZSc6IHRoaXMubm9uY2UgKCksXG4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Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgLy8gbmV3IG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG0nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaCcsXG4gICAgICAgICAgICAgICAgJzNoJzogJzNoJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMUQnLFxuICAgICAgICAgICAgICAgICcxdyc6ICc3RCcsXG4gICAgICAgICAgICAgICAgJzJ3JzogJzE0RCcsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFNJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MjQ0LWUzMjhhNTBjLTVlZDItMTFlNy05NDdiLTA0MTQxNjU3OWJiMy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuYml0ZmluZXguY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdGZpbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0ZmluZXgucmVhZG1lLmlvL3YxL2RvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL2JpdGZpbmV4Y29tL2JpdGZpbmV4LWFwaS1ub2RlJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3YyJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0ve3NlY3Rpb259JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2xhc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ2NhbmRsZXMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRib29rL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRzL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3B1YnRpY2tlci97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHNfZGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndG9kYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudF9mZWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50X2luZm9zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFza2V0X21hbmFnZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlZGl0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdC9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmcvY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnkvbW92ZW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrZXlfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luX2luZm9zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteXRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXNfZnVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2ZmZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvZmZlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29mZmVyL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2ZmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvZmZlcnMvaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwvbXVsdGknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC9yZXBsYWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL25ldy9tdWx0aScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9jbGFpbScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0YWtlbl9mdW5kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndG90YWxfdGFrZW5fZnVuZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1bnVzZWRfdGFrZW5fZnVuZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI1MDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzc1MDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAwLCAwLjE4IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTUwMDAwMDAsIDAuMTYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwMCwgMC4xNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI1MDAwMDAwLCAwLjEyIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMzAwMDAwMDAsIDAuMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAsIDAuMDggLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwLCAwLjA2IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMCwgMC4wNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMDAsIDAuMDIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs3NTAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxNTAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFszMDAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSwgLy8gdHJ1ZSBmb3IgdGllci1iYXNlZC9wcm9ncmVzc2l2ZVxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLCAvLyBmaXhlZCBjb21taXNzaW9uXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJT1RBJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFBSJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdZWVcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFUQSc6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFTSCc6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRE8nOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lPVEEnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUFInOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lZVyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVRBJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVNIJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDUsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgY29uc3QgY3VycmVuY2llcyA9IHtcbiAgICAgICAgICAgICdEU0gnOiAnREFTSCcsIC8vIEJpdGZpbmV4IG5hbWVzIERhc2ggYXMgRFNILCBpbnN0ZWFkIG9mIERBU0hcbiAgICAgICAgICAgICdRVE0nOiAnUVRVTScsXG4gICAgICAgICAgICAnQkNDJzogJ0NTVF9CQ0MnLFxuICAgICAgICAgICAgJ0JDVSc6ICdDU1RfQkNVJyxcbiAgICAgICAgICAgICdJT1QnOiAnSU9UQScsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiAoY3VycmVuY3kgaW4gY3VycmVuY2llcykgPyBjdXJyZW5jaWVzW2N1cnJlbmN5XSA6IGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRTeW1ib2xzRGV0YWlscyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydwYWlyJ10udG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwcmljZV9wcmVjaXNpb24nXSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0WydwcmljZV9wcmVjaXNpb24nXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWluaW11bV9vcmRlcl9zaXplJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWF4aW11bV9vcmRlcl9zaXplJ10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VUeXBlID0gdGhpcy5zYWZlU3RyaW5nIChwYXJhbXMsICd0eXBlJywgJ2V4Y2hhbmdlJyk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RCYWxhbmNlcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2ldO1xuICAgICAgICAgICAgaWYgKGJhbGFuY2VbJ3R5cGUnXSA9PSBiYWxhbmNlVHlwZSkge1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYX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fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VycyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRpY2tlcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2ldO1xuICAgICAgICAgICAgaWYgKCdwYWlyJyBpbiB0aWNrZXIpIHtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSB0aWNrZXJbJ3BhaXInXTtcbiAgICAgICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGZldGNoVGlja2VycygpIGZhaWxlZCB0byByZWNvZ25pemUgc3ltYm9sICcgKyBpZCArICcgJyArIHRoaXMuanNvbiAodGlja2VyKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZmV0Y2hUaWNrZXJzKCkgcmVzcG9uc2Ugbm90IHJlY29nbml6ZWQgJyArIHRoaXMuanNvbiAodGlja2VycykpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQdWJ0aWNrZXJTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlRmxvYXQgKHRpY2tlclsndGltZXN0YW1wJ10pICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgfSBlbHNlIGlmICgncGFpcicgaW4gdGlja2VyKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSB0aWNrZXJbJ3BhaXInXTtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyB1bnJlY29nbml6ZWQgdGlja2VyIHN5bWJvbCAnICsgaWQgKyAnICcgKyB0aGlzLmpzb24gKHRpY2tlcikpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0X3ByaWNlJ10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ21pZCddKSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAocGFyc2VGbG9hdCAodHJhZGVbJ3RpbWVzdGFtcCddKSkgKiAxMDAwO1xuICAgICAgICBsZXQgc2lkZSA9IHRyYWRlWyd0eXBlJ10udG9Mb3dlckNhc2UgKCk7XG4gICAgICAgIGxldCBvcmRlcklkID0gdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ29yZGVyX2lkJyk7XG4gICAgICAgIGxldCBwcmljZSA9IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHBhcnNlRmxvYXQgKHRyYWRlWydhbW91bnQnXSk7XG4gICAgICAgIGxldCBjb3N0ID0gcHJpY2UgKiBhbW91bnQ7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcklkLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbi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W1zKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy52MkdldENhbmRsZXNUcmFkZVRpbWVmcmFtZVN5bWJvbEhpc3QgKHJlcXVlc3QpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9ITENWcyAocmVzcG9uc2UsIG1hcmtldCwgdGltZWZyYW1lLCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGdldEN1cnJlbmN5TmFtZSAoY3VycmVuY3kpIHtcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCVEMnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ2JpdGNvaW4nO1xuICAgICAgICB9IGVsc2UgaWYgKGN1cnJlbmN5ID09ICdMVEMnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ2xpdGVjb2luJztcbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSAnRVRIJykge1xuICAgICAgICAgICAgcmV0dXJuICdldGhlcmV1bSc7XG4gICAgICAgIH0gZWxzZSBpZiAoY3VycmVuY3kgPT0gJ0VUQycpIHtcbiAgICAgICAgICAgIHJldHVybiAnZXRoZXJldW1jJztcbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSAnT01OSScpIHtcbiAgICAgICAgICAgIHJldHVybiAnbWFzdGVyY29pbic7IC8vID8/P1xuICAgICAgICB9IGVsc2UgaWYgKGN1cnJlbmN5ID09ICdaRUMnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ3pjYXNoJztcbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSAnWE1SJykge1xuICAgICAgICAgICAgcmV0dXJuICdtb25lcm8nO1xuICAgICAgICB9IGVsc2UgaWYgKGN1cnJlbmN5ID09ICdVU0QnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ3dpcmUnO1xuICAgICAgICB9IGVsc2UgaWYgKGN1cnJlbmN5ID09ICdEQVNIJykge1xuICAgICAgICAgICAgcmV0dXJuICd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IGxldCBzdWZmaXggPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgICAgIHVybCArPSBzdWZmaXg7XG4gICAgICAgICAgICAgICAgcmVxdWVzdCArPSBzdWZmaXg7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFwaSA9PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICAgICAncmVxdWVzdCc6IHJlcXVlc3QsXG4gICAgICAgICAgICB9LCBxdWVyeSk7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLmVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgbGV0IHBheWxvYWQgPSB0aGlzLnN0cmluZ1RvQmFzZTY0IChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgc2VjcmV0ID0gdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHBheWxvYWQsIHNlY3JldCwgJ3NoYTM4NCcpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnWC1CRlgtQVBJS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1gtQkZYLVBBWUxPQUQnOiB0aGlzLmRlY29kZSAocGF5bG9hZCksXG4gICAgICAgICAgICAgICAgJ1gtQkZYLVNJR05BVFVSRSc6IHNpZ25hdHVyZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGNvZGUgPT0gNDAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSA9PSBcIntcIikge1xuICAgICAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gcmVzcG9uc2VbJ21lc3NhZ2UnXTtcbiAgICAgICAgICAgICAgICBpZiAobWVzc2FnZS5pbmRleE9mICgnS2V5IHByaWNlIHNob3VsZCBiZSBhIGRlY2ltYWwgbnVtYmVyJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgbWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlLmluZGV4T2YgKCdJbnZhbGlkIG9yZGVyOiBub3QgZW5vdWdoIGV4Y2hhbmdlIGJhbGFuY2UnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZS5pbmRleE9mICgnSW52YWxpZCBvcmRlcicpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZS5pbmRleE9mICgnT3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XInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdkZXBvc2l0JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnM2gnOiAnM2gnLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aCcsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmgnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxRCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzdEJyxcbiAgICAgICAgICAgICAgICAnMncnOiAnMTREJyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjI0NC1lMzI4YTUwYy01ZWQyLTExZTctOTQ3Yi0wNDE0MTY1NzliYjMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJpdGZpbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRmaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpdGZpbmV4LnJlYWRtZS5pby92Mi9kb2NzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9iaXRmaW5leGNvbS9iaXRmaW5leC1hcGktbm9kZScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5iaXRmaW5leC5jb20vZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYXRmb3JtL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS97cHJlY2lzaW9ufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9SMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sc19kZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L3tzaWRlfS97c2VjdGlvbn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzMS97a2V5fTp7c2l6ZX06e3N5bWJvbH0vbG9uZy9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L2xvbmcvaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS9zaG9ydC9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L3Nob3J0L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0ve3NlY3Rpb259JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2xhc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbGMvdHJhZGUvYXZnJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3Ivd2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL29yZGVycy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL29yZGVycy97c3ltYm9sfS9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlcnMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL29yZGVyL3tzeW1ib2x9OntpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvdHJhZGVzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9wb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL29mZmVycy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvb2ZmZXJzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL2xvYW5zL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9sb2Fucy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9jcmVkaXRzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9jcmVkaXRzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL3RyYWRlcy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvaW5mby9tYXJnaW4ve2tleX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9pbmZvL2Z1bmRpbmcve2tleX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9tb3ZlbWVudHMve2N1cnJlbmN5fS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3Ivc3RhdHMvcGVyZjp7dGltZWZyYW1lfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvYWxlcnRzJyxcbiAgICAgICAgICAgICA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c6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lPVCc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRE8nOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FWVCc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICAvLyBpc3N1ZSAjNCBCaXRmaW5leCBuYW1lcyBEYXNoIGFzIERTSCwgaW5zdGVhZCBvZiBEQVNIXG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnRFNIJylcbiAgICAgICAgICAgIHJldHVybiAnREFTSCc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnUVRNJylcbiAgICAgICAgICAgIHJldHVybiAnUVRVTSc7XG4gICAgICAgIC8vIGlzc3VlICM3OTZcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdJT1QnKVxuICAgICAgICAgICAgcmV0dXJuICdJT1RBJztcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEF1dGhSV2FsbGV0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VUeXBlID0gdGhpcy5zYWZlU3RyaW5nIChwYXJhbXMsICd0eXBlJywgJ2V4Y2hhbmdlJyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCByZXNwb25zZS5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSByZXNwb25zZVtiXTtcbiAgICAgICAgICAgIGxldCBbIGFjY291bnRUeXBlLCBjdXJyZW5jeSwgdG90YWwsIGludGVyZXN0LCBhdmFpbGFibGUgXSA9IGJhbGFuY2U7XG4gICAgICAgICAgICBpZiAoYWNjb3VudFR5cGUgPT0gYmFsYW5jZVR5cGUpIHtcbiAgICAgICAgICAgICAgICBpZiAoY3VycmVuY3lbMF0gPT0gJ3QnKVxuICAgICAgICAgICAgICAgICAgICBjdXJyZW5jeSA9IGN1cnJlbmN5LnNsaWNlICgxKTtcbiAgICAgICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gY3VycmVuY3kudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgdXBwZXJjYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHVwcGVyY2FzZSk7XG4gICAgICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYXZhaWxhYmxlO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSB0b3RhbDtcbiAgICAgICAgICAgICAgICBpZiAoYWNjb3VudFsnZnJlZSddKVxuICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgICAgIHJlc3VsdFt1cHBlcmNhc2VdID0gYWNjb3VudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0Qm9va1N5bWJvbFByZWNpc2lvbiAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6ICdSMCcsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnYmlkcyc6IFtdLFxuICAgICAgICAgICAgJ2Fza3MnOiBbXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgIH07XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb3JkZXJib29rLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSBvcmRlcmJvb2tbaV07XG4gICAgICAgICAgICBsZXQgcHJpY2UgPSBvcmRlclsxXTtcbiAgICAgICAgICAgIGxldCBhbW91bnQgPSBvcmRlclsyXTtcbiAgICAgICAgICAgIGxldCBzaWRlID0gKGFtb3VudCA+IDApID8gJ2JpZHMnIDogJ2Fza3MnO1xuICAgICAgICAgICAgYW1vdW50ID0gTWF0aC5hYnMgKGFtb3VudCk7XG4gICAgICAgICAgICByZXN1bHRbc2lkZV0ucHVzaCAoWyBwcmljZSwgYW1vdW50IF0pO1xuICAgICAgICB9XG4gICAgICAgIHJlc3VsdFsnYmlkcyddID0gdGhpcy5zb3J0QnkgKHJlc3VsdFsnYmlkcyddLCAwLCB0cnVlKTtcbiAgICAgICAgcmVzdWx0Wydhc2tzJ10gPSB0aGlzLnNvcnRCeSAocmVzdWx0Wydhc2tzJ10sIDApO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgbGVuZ3RoID0gdGlja2VyLmxlbmd0aDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aWNrZXJbbGVuZ3RoIC0gMl0sXG4gICAgICAgICAgICAnbG93JzogdGlja2VyW2xlbmd0aCAtIDFdLFxuICAgICAgICAgICAgJ2JpZCc6IHRpY2tlcltsZW5ndGggLSAxMF0sXG4gICAgICAgICAgICAnYXNrJzogdGlja2VyW2xlbmd0aCAtIDhdLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGlja2VyW2xlbmd0aCAtIDRdLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHRpY2tlcltsZW5ndGggLSA2XSxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdGlja2VyW2xlbmd0aCAtIDVdLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRpY2tlcltsZW5ndGggLSAzXSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgI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gKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IFsgaWQsIHRpbWVzdGFtcCwgYW1vdW50LCBwcmljZSBdID0gdHJhZGU7XG4gICAgICAgIGxldCBzaWRlID0gKGFtb3VudCA8IDApID8gJ3NlbGwnIDogJ2J1eSc7XG4gICAgICAgIGlmIChhbW91bnQgPCAwKSB7XG4gICAgICAgICAgICBhbW91bnQgPSAtYW1vdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZC50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoc2luY2UpIHtcbiAgICAgICAgICAgIHJlcXVlc3RbJ3N0YXJ0J10gPSBzaW5jZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobGltaXQpIHtcbiAgICAgICAgICAgIHJlcX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gICBsZXQgcmVxdWVzdCA9IHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHJlcXVlc3Q7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSAnL2FwaScgKyAnLycgKyByZXF1ZXN0ICsgbm9uY2UgKyBib2R5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMzg0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdiZngtbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYmZ4LWFwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdiZngtc2lnbmF0dXJlJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmIChyZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnbWVzc2FnZSddLmluZGV4T2YgKCdub3QgZW5vdWdoIGV4Y2hhbmdlIGJhbGFuY2UnKSA+PSAwKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgICAgIH0gZWxzZSBpZiAocmVzcG9uc2UgPT0gJycpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm5lZCBlbXB0eSByZXNwb25zZScpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcb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aHR0cHM6Ly9iaXRmbHllci5qcCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JpdGZseWVyLmpwL0FQSScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG1hcmtldHMnLCAgICAvLyBvciAnbWFya2V0cydcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRib2FyZCcsICAgICAgLy8gb3IgJ2JvYXJkJ1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHRpY2tlcicsICAgICAvLyBvciAndGlja2VyJ1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGV4ZWN1dGlvbnMnLCAvLyBvciAnZXhlY3V0aW9ucydcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRoZWFsdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGNoYXRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBlcm1pc3Npb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjb2xsYXRlcmFsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjb2xsYXRlcmFsYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29pbmlucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29pbm91dHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbmthY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHdpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjaGlsZG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0cGFyZW50b3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRwYXJlbnRvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZXhlY3V0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0cG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR0cmFkaW5nY29tbWlzc2lvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbmRjb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VuZGNoaWxkb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbGNoaWxkb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbmRwYXJlbnRvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VscGFyZW50b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbGFsbGNoaWxkb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0Wydwcm9kdWN0X2NvZGUnXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jaWVzID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZDtcbiAgICAgICAgICAgIGxldCBudW1DdXJyZW5jaWVzID0gY3VycmVuY2llcy5sZW5ndGg7XG4gICAgICAgICAgICBpZiAobnVtQ3VycmVuY2llcyA9PSAxKSB7XG4gICAgICAgICAgICAgICAgYmFzZSA9IHN5bWJvbC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICAgICAgcXVvdGUgPSBzeW1ib2wuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChudW1DdXJyZW5jaWVzID09IDIpIHtcbiAgICAgICAgICAgICAgICBiYXNlID0gY3VycmVuY2llc1swXTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IGN1cnJlbmNpZXNbMV07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBiYXNlID0gY3VycmVuY2llc1sxXTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IGN1cnJlbmNpZXNbMl07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHt9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IHJlc3BvbnNlLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHJlc3BvbnNlW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYWNjb3VudFsnY3VycmVuY3lfY29kZSddO1xuICAgICAgICAgICAgYmFsYW5jZXNbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VzKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IGJhbGFuY2VzW2N1cnJlbmN5XVsnYW1vdW50J107XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYmFsYW5jZXNbY3VycmVuY3ldWydhdmFpbGFibGUnXTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEJvYXJkICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3Byb2R1Y3RfY29kZSc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdiaWRzJywgJ2Fza3MnLCAncHJpY2UnLCAnc2l6ZScpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwcm9kdWN0X2NvZGUnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0aWNrZXJbJ3RpbWVzdGFtcCddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmVzdF9iaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydiZXN0X2FzayddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbHRwJ10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sdW1lX2J5X3Byb2R1Y3QnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgb3JkZXIgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnc2lkZScgaW4gdHJhZGUpXG4gICAgICAgICAgICBpZiAodHJhZGVbJ3NpZGUnXSkge1xuICAgICAgICAgICAgICAgIHNpZGUgPSB0cmFkZVsnc2lkZSddLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IHNpZGUgKyAnX2NoaWxkX29yZGVyX2FjY2VwdGFuY2VfaWQnO1xuICAgICAgICAgICAgICAgIGlmIChpZCBpbiB0cmFkZSlcbiAgICAgICAgICAgICAgICAgICAgb3JkZXIgPSB0cmFkZVtpZF07XG4gICAgICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodHJhZGVbJ2V4ZWNfZGF0ZSddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVyLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2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iB0cnVlLFxuICAgICAgICAgICAgLy8gb2Jzb2xldGUgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAvLyBuZXcgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMDU5NzE3Ny1lYTgwMDE3Mi05ZDVlLTExZTctODA0Yy1iOWQ0ZmE5YjU2YjAuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJpdGh1bWIuY29tL3B1YmxpYycsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJpdGh1bWIuY29tJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0aHVtYi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuYml0aHVtYi5jb20vdTEvVVMxMjcnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vay9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlY2VudF90cmFuc2FjdGlvbnMve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVjZW50X3RyYW5zYWN0aW9ucy9hbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL3dhbGxldF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vdXNlcl90cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL3BsYWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL29yZGVyX2RldGFpbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9idGNfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUva3J3X2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2tyd193aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9tYXJrZXRfYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9tYXJrZXRfc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlckFsbCAoKTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAobWFya2V0c1snZGF0YSddKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBpZiAoaWQgIT0gJ2RhdGUnKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ2RhdGEnXVtpZF07XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBpZDtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSAnS1JXJztcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAgICAgJ2xvdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0pKTtcbiAg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aW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJBbGwgKHBhcmFtcyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHJlc3BvbnNlWydkYXRhJ11bJ2RhdGUnXTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSB0aGlzLm9taXQgKHJlc3BvbnNlWydkYXRhJ10sICdkYXRlJyk7XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAodGlja2Vycyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHRpY2tlclsnZGF0ZSddID0gdGltZXN0YW1wO1xuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAg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cmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2VbJ2RhdGEnXSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3RUcmFkZSc7XG4gICAgICAgIGlmICh0eXBlID09ICdsaW1pdCcpIHtcbiAgICAgICAgICAgIHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAgICAgJ29yZGVyX2N1cnJlbmN5JzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgICAgICdQYXltZW50X2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgICAgICd1bml0cyc6IGFtb3VudCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICAgICAndHlwZSc6IChzaWRlID09ICdidXknKSA/ICdiaWQnIDogJ2FzaycsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbWV0aG9kICs9ICdQbGFjZSc7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PSAnbWFya2V0Jykge1xuICAgICAgICAgICAgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAgICAgJ3VuaXRzJzogYW1vdW50LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnTWFya2V0JyArIH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ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjI3NS1kY2ZjNmMzMC01ZWQzLTExZTctODM5ZC0wMGE4NDYzODVkMGIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYml0bGlzaC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYml0bGlzaC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9iaXRsaXNoLmNvbS9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMyAvIDEwMCwgLy8gYW5vbnltb3VzIDAuMyUsIHZlcmlmaWVkIDAuMiVcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDUwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2hsY3YnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNfZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29obGN2JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzX2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHNfb3BlcmF0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfdHJhZGVzX2J5X2lkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX2FsbF90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZV9iY29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX3RlbXBsYXRlX3dhbGxldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X2FjY291bnRzX29wZXJhdGlvbnNfZnJvbV90cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9hY3RpdmVfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X2Jjb2RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9teV9tYXRjaGVzX2Zyb21fdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfbXlfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X215X3RyYWRzX2Zyb21fdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfcGF5bWVudF9tZXRob2RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X3BheW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWRlZW1fY29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVzaWduJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzaWduaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NpZ25vdXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2RldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX29wdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19ieV9pZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgaWYgKCF0aGlzLnN1YnN0aXR1dGVDb21tb25DdXJyZW5jeUNvZGVzKVxuICAgICAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ1hCVCcpXG4gICAgICAgICAgICByZXR1cm4gJ0JUQyc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQkNDJylcbiAgICAgICAgICAgIHJldHVybiAnQkNIJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdEUksnKVxuICAgICAgICAgICAgcmV0dXJuICdEQVNIJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdEU0gnKVxuICAgICAgICAgICAgY3VycmVuY3kgPSAnREFTSCc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnWERHJylcbiAgICAgICAgICAgIGN1cnJlbmN5ID0gJ0RPR0UnO1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFBhaXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2tleXNbcF1dO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbWF4JyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21pbicpLFxuICAgICAgICAgICAgJ2JpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICA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dWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHJlc3BvbnNlKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSByZXNwb25zZVtjdXJyZW5jeV07XG4gICAgICAgICAgICBjdXJyZW5jeSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgLy8gaXNzdWUgIzQgYml0bGlzaCBuYW1lcyBEYXNoIGFzIERTSCwgaW5zdGVhZCBvZiBEQVNIXG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0RTSCcpXG4gICAgICAgICAgICAgICAgY3VycmVuY3kgPSAnREFTSCc7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ1hERycpXG4gICAgICAgICAgICAgICAgY3VycmVuY3kgPSAnRE9HRSc7XG4gICAgICAgICAgICBiYWxhbmNlW2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ2Z1bmRzJ10pO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbY3VycmVuY3ldWydob2xkZWQnXSk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgc2lnbkluICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMucHJpdmF0ZVBvc3RTaWduaW4gKHtcbiAgICAgICAgICAgICdsb2dpbic6IHRoaXMubG9naW4sXG4gICAgICAgICAgICAncGFzc3dkJzogdGhpcy5wYXNzd29yZCxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ3BhaXJfaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ2Rpcic6IChzaWRlID09ICdidXknKSA/ICdiaWQnIDogJ2FzaycsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PSAnbGltaXQnKVxuICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSBwcmljZTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IGF3YWl0IHRoaXM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gICAgJ2FjY291bnQnOiBhZGRyZXNzLFxuICAgICAgICAgICAgJ3BheW1lbnRfbWV0aG9kJzogJ2JpdGNvaW4nLCAvLyB0aGV5IGRpZCBub3QgZG9jdW1lbnQgb3RoZXIgdHlwZXMuLi5cbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ21lc3NhZ2VfaWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHBhcmFtcyk7XG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uICh0a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XNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnOTBtJzogJzkwbScsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgICAgICcxdyc6ICc3ZCcsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnM00nOiAnM20nLFxuICAgICAgICAgICAgICAgICc2TSc6ICc2bScsXG4gICAgICAgICAgICAgICAgJzF5JzogJzF5JyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY3MjU2LWE4NTU1MjAwLTVlZjktMTFlNy05NmZkLTQ2OWE2NWUyYjBiZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3LmJpdG1hcmtldC5wbC9hcGkyLycsIC8vIGxhc3Qgc2xhc2ggaXMgY3JpdGljYWxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQucGwnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldC9kb2NzLnBocD9maWxlPWFwaV9wdWJsaWMuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQubmV0L2RvY3MucGhwP2ZpbGU9YXBpX3ByaXZhdGUuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYml0bWFya2V0LW5ldC9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2pzb24ve21hcmtldH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdqc29uL3ttYXJrZXR9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnanNvbi97bWFya2V0fS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2pzb24vY3RyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vOTBtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vNmgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8xZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzdkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vMW0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8zbScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzZtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vMXknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ2Rlc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmdkZXNrU3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nZGVza0NvbmZpcm0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyeXB0b3RyYWRpbmdkZXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcnlwdG90cmFkaW5nZGVza1N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3J5cHRvdHJhZGluZ2Rlc2tDb25maXJtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdGaWF0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd1BMTlBQJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd0ZpYXRGYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5MaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5PcGVuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5DbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luQ2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5Nb2RpZnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkJhbGFuY2VBZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkJhbGFuY2VSZW1vdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N3YXBMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzd2FwT3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3dhcENsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCQ0gvUExOJzogeyAnaWQnOiAnQkNDUExOJywgJ3N5bWJvbCc6ICdCQ0gvUExOJywgJ2Jhc2UnOiAnQkNIJywgJ3F1b3RlJzogJ1BMTicgfSxcbiAgICAgICAgICAgICAgICAnQlRHL1BMTic6IHsgJ2lkJzogJ0JUR1BMTicsICdzeW1ib2wnOiAnQlRHL1BMTicsICdiYXNlJzogJ0JURycsICdxdW90ZSc6ICdQTE4nIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9QTE4nOiB7ICdpZCc6ICdCVENQTE4nLCAnc3ltYm9sJzogJ0JUQy9QTE4nLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnUExOJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnQlRDRVVSJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgICAgICAnTFRDL1BMTic6IHsgJ2lkJzogJ0xUQ1BMTicsICdzeW1ib2wnOiAnTFRDL1BMTicsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdQTE4nIH0sXG4gICAgICAgICAgICAgICAgJ0xUQy9CVEMnOiB7ICdpZCc6ICdMVENCVEMnLCAnc3ltYm9sJzogJ0xUQy9CVEMnLCAnYmFzZSc6ICdMVEMnLCAncXVvdGUnOiAnQlRDJyB9LFxuICAgICAgICAgICAgICAgICdMaXRlTWluZVgvQlRDJzogeyAnaWQnOiAnTGl0ZU1pbmVYQlRDJywgJ3N5bWJvbCc6ICdMaXRlTWluZVgvQlRDJywgJ2Jhc2UnOiAnTGl0ZU1pbmVYJywgJ3F1b3RlJzogJ0JUQycgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC40NSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjQ1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTkuOTksIDAuNDQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTkuOTksIDAuNDMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTkuOTksIDAuNDIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTkuOTksIDAuNDEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5Ljk5LCAwLjQwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OS45OSwgMC4zOSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQ5OTkuOTksIDAuMzggLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTk5Ljk5LCAwLjM3IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTk5OTkuOTksIDAuMzYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTk5OS45OSwgMC4zNSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQ5OTk5Ljk5LCAwLjM0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OTkuOTksIDAuMzMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5OTkuOTksIDAuMzIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTk5OTkuOTksIDAuMzEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OTkuOTksIDAuMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjE1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTkuOTksIDAuMTQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTkuOTksIDAuMTMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTkuOTksIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTkuOTksIDAuMTEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5Ljk5LCAwLjEwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OS45OSwgMC45IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDk5OS45OSwgMC44IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OS45OSwgMC43IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTk5OTkuOTksIDAuNiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI5OTk5Ljk5LCAwLjUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OS45OSwgMC40IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OTkuOTksIDAuMyAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzE5OTk5OS45OSwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OTk5Ljk5LCAwLjEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OTkuOTksIDAuMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDA4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExOJzogMixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMiwgLy8gU0VQQS4gVHJhbnNmZXIgSU5UIChTSEEpOiA1IEVVUlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMTic6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEluZm8gKCk7XG4gICAgICAgIGxldCBkYXRhID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBkYXRhWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGRhdGEgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAodG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ZUZsb2F0ICh0aWNrZXJbJ2JpZCddKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2FzayddKSxcbiAgICAgICAgICAgICd2d2FwJzogdndhcCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc2lkZSA9ICh0cmFkZVsndHlwZSddID09ICdiaWQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJ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mlhdCc7XG4gICAgICAgICAgICBpZiAoJ2FjY291bnQnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgICAgIHJlcXVlc3RbJ2FjY291bnQnXSA9IHBhcmFtc1snYWNjb3VudCddOyAvLyBiYW5rIGFjY291bnQgY29kZSBmb3Igd2l0aGRyYXdhbFxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcmVxdWlyZXMgYWNjb3VudCBwYXJhbWV0ZXIgdG8gd2l0aGRyYXcgZmlhdCBjdXJyZW5jeScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdhY2NvdW50MicgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICAgICAgcmVxdWVzdFsnYWNjb3VudDInXSA9IHBhcmFtc1snYWNjb3VudDInXTsgLy8gYmFuayBTV0lGVCBjb2RlIChFVVIgb25seSlcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdFVVInKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcmVxdWlyZXMgYWNjb3VudDIgcGFyYW1ldGVyIHRvIHdpdGhkcmF3IEVVUicpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCd3aXRoZHJhd2FsX25vdGUnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgICAgIHJlcXVlc3RbJ3dpdGhkcmF3YWxfbm90ZSddID0gcGFyYW1zWyd3aXRoZHJhd2FsX25vdGUnXTsgLy8gYSAxMC1jaGFyYWN0ZXIgdXNlci1zcGVjaWZpZWQgd2l0aGRyYXdhbCBub3RlIChQTE4gb25seSlcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdQTE4nKVxuICAgICAgICAgICAg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gICAgICAgICduYW1lJzogJ0JpdE1FWCcsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1NDJywgLy8gU2V5Y2hlbGxlc1xuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ3VzZXJBZ2VudCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW0nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICd0ZXN0JzogJ2h0dHBzOi8vdGVzdG5ldC5iaXRtZXguY29tJyxcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MzE5LWY2NTNjNmU2LTVlZDQtMTFlNy05MzNkLWYwYmMzNjk5YWU4Zi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuYml0bWV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRtZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWV4LmNvbS9hcHAvYXBpT3ZlcnZpZXcnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0JpdE1FWC9hcGktY29ubmVjdG9ycy90cmVlL21hc3Rlci9vZmZpY2lhbC1odHRwJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbm5vdW5jZW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Fubm91bmNlbWVudC91cmdlbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnQvYWN0aXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2FjdGl2ZUFuZEluZGljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnQvYWN0aXZlSW50ZXJ2YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2NvbXBvc2l0ZUluZGV4JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2luZGljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3VyYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVhZGVyYm9hcmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpcXVpZGF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyQm9vay9MMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlL2J1Y2tldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzY2hlbWEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NjaGVtYS93ZWJzb2NrZXRIZWxwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZXR0bGVtZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2J1Y2tldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhdC9jaGFubmVscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhdC9jb25uZWN0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4ZWN1dGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhlY3V0aW9uL3RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbm90aWZpY2F0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYWZmaWxpYXRlU3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NoZWNrUmVmZXJyYWxDb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NvbW1pc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWFyZ2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21pbldpdGhkcmF3YWxGZWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldEhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0U3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXBpS2V5L2Rpc2FibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleS9lbmFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9idWxrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWxBbGxBZnRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2xvc2VQb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vaXNvbGF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vbGV2ZXJhZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL3Jpc2tMaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vdHJhbnNmZXJNYXJnaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY2FuY2VsV2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jb25maXJtRW1haWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY29uZmlybUVuYWJsZVRGQScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jb25maXJtV2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9kaXNhYmxlVEZBJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2xvZ291dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9sb2dvdXRBbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJlZmVyZW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcmVxdWVzdEVuYWJsZVRGQScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9yZXF1ZXN0V2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2J1bGsnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRJbnN0cnVtZW50QWN0aXZlQW5kSW5kaWNlcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO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ICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGZ1dHVyZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgdHlwZSA9ICdmdXR1cmUnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG1ha2VyID0gbWFya2V0WydtYWtlckZlZSddO1xuICAgICAgICAgICAgbGV0IHRha2VyID0gbWFya2V0Wyd0YWtlckZlZSddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICAgICAnc3BvdCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdzd2FwJzogc3dhcCxcbiAgICAgICAgICAgICAgICAnZnV0dXJlJzogZnV0dXJlLFxuICAgICAgICAgICAgICAgICdwcmVkaWN0aW9uJzogcHJlZGljdGlvbixcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRVc2VyTWFyZ2luICh7ICdjdXJyZW5jeSc6ICdhbGwnIH0pO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgcmVzcG9uc2UubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydhdmFpbGFibGVNYXJnaW4nXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWydtYXJnaW5CYWxhbmNlJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCVEMnKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYWNjb3VudFsnZnJlZSddICogMC4wMDAwMDAwMTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gYWNjb3VudFsndG90YWwnXSAqIDAuMDAwMDAwMDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IH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xdWFydGVybHksIGFuZCBiaXF1YXJ0ZXJseVxuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdiaW5TaXplJzogdGhpcy50aW1lZnJhbWVzW3RpbWVmcmFtZV0sXG4gICAgICAgICAgICAncGFydGlhbCc6IHRydWUsICAgICAvLyB0cnVlID09IGluY2x1ZGUgeWV0LWluY29tcGxldGUgY3VycmVudCBiaW5zXG4gICAgICAgICAgICAvLyAnZmlsdGVyJzogZmlsdGVyLCAvLyBmaWx0ZXIgYnkgaW5kaXZpZHVhbCBmaWVsZHMgYW5kIGRvIGFkdmFuY2VkIHF1ZXJpZXNcbiAgICAgICAgICAgIC8vICdjb2x1bW5zJzogW10sICAgIC8vIHdpbGwgcmV0dXJuIGFsbCBjb2x1bW5zIGlmIG9taXR0ZWRcbiAgICAgICAgICAgIC8vICdzdGFydCc6IDAsICAgICAgIC8vIHN0YXJ0aW5nIHBvaW50IGZvciByZXN1bHRzICh3dGY/KVxuICAgICAgICAgICAgLy8gJ3JldmVyc2UnOiBmYWxzZSwgLy8gdHJ1ZSA9PSBuZXdlc3QgZmlyc3RcbiAgICAgICAgICAgIC8vICdlbmRUaW1lJzogJycsICAgIC8vIGVuZGluZyBkYXRlIGZpbHRlciBmb3IgcmVzdWx0c1xuICAgICAgICB9O1xuICAgICAgICBpZiAoc2luY2UpIHtcbiAgICAgICAgICAgIGxldCB5bWRobXMgPSB0aGlzLlltZEhNUyAoc2luY2UpO1xuICAgICAgICAgICAgbGV0IHltZGhtID0geW1kaG1zLnNsaWNlICgwLCAxNik7XG4gICAgICAgICAgICByZXF1ZXN0WydzdGFydFRpbWUnXSA9IHltZGhtOyAvLyBzdGFydGluZyBkYXRlIGZpbHRlciBmb3IgcmVzdWx0c1xuICAgICAgICB9XG4gICA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Swgb3RoZXIgY3VycmVuY2llcyBjb21pbmcgc29vbi4uLicpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6ICdYQnQnLCAvLyB0ZW1wb3JhcmlseVxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdhZGRyZXNzJzogYWRkcmVzcyxcbiAgICAgICAgICAgIC8vICdvdHBUb2tlbic6ICcxMjM0NTYnLCAvLyByZXF1aXJlcyBpZiB0d28tZmFjdG9yIGF1dGggKE9UUCkgaXMgZW5hYmxlZFxuICAgICAgICAgICAgLy8gJ2ZlZSc6IDAuMDAxLCAvLyBiaXRjb2luIG5ldHdvcmsgZmVlXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RVc2VyUmVxdWVzdFdpdGhkcmF3YWwgKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsndHJhbnNhY3RJRCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoY29kZSA+PSA0MDApIHtcbiAgICAgICAgICAgIGlmIChib2R5KSB7XG4gICAgICAgICAgICAgICAgaWYgKGJvZHlbMF0gPT0gXCJ7XCIpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJ21lc3NhZ2UnIGluIHJlc3BvbnNlWydlcnJvciddKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm5lZCBhbiBlbXB0eSByZXNwb25zZScpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcXVlcnkgPSAnL2FwaScgKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAobWV0aG9kICE9ICdQVVQnKVxuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICBxdWVyeSArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyBxdWVyeTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgb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ICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2F2YWlsYWJsZV9ib29rcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudF9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZlZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmdzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5ncy97ZmlkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19kZXN0aW5hdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAna3ljX2RvY3VtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVkZ2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvZmVlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVkZ2VyL2Z1bmRpbmdzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvd2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ214X2JhbmtfY29kZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl90cmFkZXMve29pZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97b2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhZGVzL3t0aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL3t3aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZWJpdF9jYXJkX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aGVyX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGhvbmVfbnVtYmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwaG9uZV92ZXJpZmljYXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bob25lX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NwZWlfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tvaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEF2YWlsYWJsZUJvb2tzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0c1sncGF5bG9hZCddLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sncGF5bG9hZCddW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0Wydib29rJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQudG9VcHBlckNhc2UgKCkucmVwbGFjZSAoJ18nLCAnLycpO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWluaW11bV9hbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21heGltdW1fYW1vdW50J10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogcGFyc2VGbG9hdCAobWFya2V0WydtaW5pbXVtX3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogcGFyc2VGbG9hdCAobWFya2V0WydtYXhpbXVtX3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21pbmltdW1fdmFsdWUnXSksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21heGltdW1fdmFsdWUnXSksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsnbWluaW11bV9hbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ21pbmltdW1fcHJpY2UnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IGxpbWl0c1snYW1vdW50J11bJ21pbiddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRCYWxhbmNlICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncGF5bG9hZCddWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhdmFpbGFibGUnXSksXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydsb2NrZWQnXSksXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsndG90YWwnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJCb29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2Jvb2snOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IHJlc3BvbnNlWydwYXlsb2FkJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAob3JkZXJib29rWyd1cGRhdGVkX2F0J10pO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU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4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnY3JlYXRlZF9hdCddKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGlmICgnYm9vaycgaW4gdHJhZGUpXG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydib29rJ11dO1xuICAgICAgICB9XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nIC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SA9ICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyBxdWVyeTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IFsgbm9uY2UsIG1ldGhvZCwgcXVlcnkgXS5qb2luICgnJyk7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocGFyYW1zKTtcbiAgICAgICAgICAgICAgICByZXF1ZXN0ICs9IGJvZHk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocmVxdWVzdCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLmFwaUtleSArICc6JyArIG5vbmNlICsgJzonICsgc2lnbmF0dXJlO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQXV0aG9yaXphdGlvbic6IFwiQml0c28gXCIgKyBhdXRoLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICA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1bGUuZXhwb3J0cyA9IGNsYXNzIGJpdHN0YW1wIGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2JpdHN0YW1wJyxcbiAgICAgICAgICAgICduYW1lJzogJ0JpdHN0YW1wJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnR0InLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MicsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgLy8gb2Jzb2xldGUgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgLy8gbmV3IG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3Nzg2Mzc3LThjOGFiNTdlLTVmZTktMTFlNy04ZWE0LTJiMDViNmJjY2VlYy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuYml0c3RhbXAubmV0L2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuYml0c3RhbXAubmV0L2FwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2sve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyX2hvdXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nLXBhaXJzLWluZm8vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiY2hfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JjaF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFuc2FjdGlvbnMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYW5zYWN0aW9ucy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycy9hbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9zdGF0dXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXkve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5L21hcmtldC97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwvbWFya2V0L3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2x0Y193aXRoZHJhd2FsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbHRjX2FkZHJlc3MvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldGhfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAneHJwX3dpdGhkcmF3YWwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd4cnBfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyLXRvLW1haW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2Zlci1mcm9tLW1haW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsL29wZW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsL3N0YXR1cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWwvY2FuY2VsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlxdWlkYXRpb25fYWRkcmVzcy9uZXcvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXF1aWRhdGlvbl9hZGRyZXNzL2luZm8vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd2MSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl9kZXBvc2l0X2FkZHJlc3MvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1bmNvbmZpcm1lZF9idGMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX3dpdGhkcmF3YWwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyaXBwbGVfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JpcHBsZV9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjI1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAsIDAuMjQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAsIDAuMjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0MDAwMDAsIDAuMjAgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs2MDAwMDAsIDAuMTUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwLCAwLjE0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMCwgMC4xMyAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQwMDAwMDAsIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwMCwgMC4xMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAxLCAwLjEwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDAuMjUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMCwgMC4yNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMCwgMC4yMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQwMDAwMCwgMC4yMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzYwMDAwMCwgMC4xNSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAsIDAuMTQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwLCAwLjEzIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDAwMDAwMCwgMC4xMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAwLCAwLjExIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMDEsIDAuMTAgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogMjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMC45MCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRCc6IDI1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkaW5nUGFpcnNJbmZvICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGJhc2UudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IHF1b3RlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbElkID0gYmFzZUlkICsgJ18nICsgcXVvdGVJZDtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsndXJsX3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0WydiYXNlX2RlY2ltYWxzJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0Wydjb3VudGVyX2RlY2ltYWxzJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IFsgY29zdCwgY3VycmVuY3kgXSA9IG1hcmtldFsnbWluaW11bV9vcmRlciddLnNwbGl0ICgnICcpO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChtYXJrZXRbJ3RyYWRpbmcnXSA9PSAnRW5hYmxlZCcpO1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sSWQnOiBzeW1ib2xJZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogcGFyc2VGbG9hdCAoY29zdCksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICA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eW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHBhcnNlRmxvYXQgKHRpY2tlclsnb3BlbiddKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdkYXRlJyBpbiB0cmFkZSkge1xuICAgICAgICAgICAgd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XSk7XG4gICAgICAgICAgICBpZiAodG90YWwgaW4gYmFsYW5jZSlcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVt0b3RhbF0pO1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3QnICsgdGhpcy5jYXBpdGFsaXplIChzaWRlKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHR5cGUgPT0gJ21hcmtldCcpXG4gICAgICAgICAgICBtZXRob2QgKz0gJ01hcmtldCc7XG4gICAgICAgIGVsc2VcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gcHJpY2U7XG4gICAgICAgIG1ldGhvZCArPSAnUGFpcic7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnaWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmR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AgIG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcGFpciA9IG1hcmtldCA/IG1hcmtldFsnaWQnXSA6ICdhbGwnO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMuZXh0ZW5kICh7ICdwYWlyJzogcGFpciB9LCBwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VXNlclRyYW5zYWN0aW9uc1BhaXIgKHJlcXVlc3QpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2UsIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE9yZGVyU3RhdHVzICh7ICdpZCc6IGlkIH0pO1xuICAgIH1cblxuICAgIGdldEN1cnJlbmN5TmFtZSAoY29kZSkge1xuICAgICAgICBpZiAoY29kZSA9PSAnQlRDJylcbiAgICAgICAgICAgIHJldHVybiAnYml0Y29pbic7XG4gICAgICAgIHJldHVybiBjb2RlLnRvTG93ZXJDYXNlICgpO1xuICAgIH1cblxuICAgIGlzRmlhdCAoY29kZSkge1xuICAgICAgICBpZiAoY29kZSA9PSAnVVNEJylcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICBpZiAoY29kZSA9PSAnRVVSJylcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgYXN5bmMgd2l0aGRyYXcgKGNvZGUsIGFtb3VudCwgYWRkcmVzcywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IGlzR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SBkZXN0aW5hdGlvbl90YWcgcGFyYW0gZm9yICcgKyBjb2RlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBxdWVyeSkpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLyc7XG4gICAgICAgIGlmIChhcGkgIT0gJ3YxJylcbiAgICAgICAgICAgIHVybCArPSB0aGlzLnZlcnNpb24gKyAnLyc7XG4gICAgICAgIHVybCArPSB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB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gICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3ODYzNzctOGM4YWI1N2UtNWZlOS0xMWU3LThlYTQtMmIwNWI2YmNjZWVjLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdHN0YW1wLm5ldCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfaG91cicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldXJfdXNkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfYWxsX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndW5jb25maXJtZWRfYnRjJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyaXBwbGVfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmlwcGxlX2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxfcmVxdWVzdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ2J0Y3VzZCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnLCAnbWFrZXInOiAwLjAwMjUsICd0YWtlcic6IDAuMDAyNSB9LFxuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnYnRjZXVyJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicsICdtYWtlcic6IDAuMDAyNSwgJ3Rha2VyJz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ZSkge1xuICAgICAgICAgICAgLy8gdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydkYXRldGltZSddKTtcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0cmFkZVsnZGF0ZXRpbWUnXSkgKiAxMDAwO1xuICAgICAgICB9XG4gICAgICAgIGxldCBzaWRlID0gKHRyYWRlWyd0eXBlJ10gPT0gMCkgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgbGV0IG9yZGVyID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ29yZGVyX2lkJyBpbiB0cmFkZSlcbiAgICAgICAgICAgIG9yZGVyID0gdHJhZGVbJ29yZGVyX2lkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgIGlmICgnY3VycmVuY3lfcGFpcicgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIGlmICh0cmFkZVsnY3VycmVuY3lfcGFpciddIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbdHJhZGVbJ2N1cnJlbmN5X3BhaXInXV07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcixcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcGFyc2VGbG9hdCAodHJhZGV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ICAgICAgJ2hhc0ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE15VHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAvLyBuZXcgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnb25lTWluJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnZml2ZU1pbicsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICd0aGlydHlNaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICdob3VyJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnZGF5JyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MzUyLWNmMGIzYzI2LTVlZDUtMTFlNy04MmI3LWYzODI2YjdhOTdkOC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnYWNjb3VudCc6ICdodHRwczovL2JpdHRyZXguY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdtYXJrZXQnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAndjInOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGkvdjIuMC9wdWInLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2JpdHRyZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9Ib21lL0FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5ucG1qcy5vcmcvcGFja2FnZS9ub2RlLmJpdHRyZXguYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9GZWVzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5iaXR0cmV4LmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDAxOTk2NTEtV2hhdC1mZWVzLWRvZXMtQml0dHJleC1jaGFyZ2UtJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3YyJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMvR2V0QlRDUHJpY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9HZXRUaWNrcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L0dldExhdGVzdFRpY2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01hcmtldHMvR2V0TWFya2V0U3VtbWFyaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvR2V0TGF0ZXN0VGljaycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHN1bW1hcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0c3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2FjY291bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRhZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0aGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdtYXJrZXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5bGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eW1hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVub3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxtYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVEMnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkREJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWFQnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1QnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JERCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICA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lICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IG1hcmtldFsnSXNBY3RpdmUnXTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydNaW5UcmFkZVNpemUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSk7XG4gIC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sndG90YWwnXSA9IHRvdGFsO1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAndHlwZSc6ICdib3RoJyxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGlmICgndHlwZScgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICBpZiAocGFyYW1zWyd0eXBlJ10gPT0gJ2J1eScpIHtcbiAgICAgICAgICAgICAgICBvcmRlcmJvb2sgPSB7XG4gICAgICAgICAgICAgICAgICAgICdidXknOiByZXNwb25zZVsncmVzdWx0J10sXG4gICAgICAgICAgICAgICAgICAgICdzZWxsJzogW10sXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocGFyYW1zWyd0eXBlJ10gPT0gJ3NlbGwnKSB7XG4gICAgICAgICAgICAgICAgb3JkZXJib29rID0ge1xuICAgICAgICAgICAgICAgICAgICAnYnV5JzogW10sXG4gICAgICAgICAgICAgICAgICAgICdzZWxsJzogcmVzcG9uc2VbJ3Jlc3VsdCddLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYnV5JywgJ3NlbGwnLCAnUmF0ZScsICdRdWFudGl0eScpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRpY2tlclsnVGltZVN0YW1wJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnSGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdMb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnQmlkJyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0FzaycpLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0xhc3QnKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAg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gPSA4OyAvLyBkZWZhdWx0IHByZWNpc2lvbiwgdG9kbzogZml4IFwibWFnaWMgY29uc3RhbnRzXCJcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WydDdXJyZW5jeUxvbmcnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogY3VycmVuY3lbJ0lzQWN0aXZlJ10sXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5WydUeEZlZSddLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ1R4RmVlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHN1bW1hcmllcyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgdCA9IDA7IHQgPCB0aWNrZXJzLmxlbmd0aDsgdCsrKSB7XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1t0XTtcbiAgICAgICAgICAgIGxldCBpZCA9IHRpY2tlclsnTWFya2V0TmFtZSddO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtld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7XG4gICAgICAgIGxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHJhZGVbJ09yZGVyVHlwZSddID09ICdCVVknKSB7XG4gICAgICAgICAgICBzaWRlID0gJ2J1eSc7XG4gICAgICAgIH0gZWxzZSBpZiAodHJhZGVbJ09yZGVyVHlwZSddID09ICdTRUxMJykge1xuICAgICAgICAgICAgc2lkZSA9ICdzZWxsJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnSWQnIGluIHRyYWRlKVxuICAgICAgICAgICAgaWQgPSB0cmFkZVsnSWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydQcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnUXVhbnRpdHknXSksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgI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lbCAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5sYXN0X2pzb25fcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAodGhpcy5sYXN0X2pzb25fcmVzcG9uc2UsICdtZXNzYWdlJyk7XG4gICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UgPT0gJ09SREVSX05PVF9PUEVOJylcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgY2FuY2VsT3JkZXIoKSBlcnJvcjogJyArIHRoaXMubGFzdF9odHRwX3Jlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSA9PSAnVVVJRF9JTlZBTElEJylcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKHRoaXMuaWQgKyAnIGNhbmNlbE9yZGVyKCkgZXJyb3I6ICcgKyB0aGlzLmxhc3RfaHR0cF9yZXNwb25zZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ09yZGVyVHlwZScgaW4gb3JkZXIpXG4gICAgICAgICAgICBzaWRlID0gKG9yZGVyWydPcmRlclR5cGUnXSA9PSAnTElNSVRfQlVZJykgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgaWYgKCdUeXBlJyBpbiBvcmRlcilcbiAgICAgICAgICAgIHNpZGUgPSAob3JkZXJbJ1R5cGUnXSA9PSAnTElNSVRfQl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4gICAgICAgICAgICBjb21taXNzaW9uID0gJ0NvbW1pc3Npb24nO1xuICAgICAgICB9IGVsc2UgaWYgKCdDb21taXNzaW9uUGFpZCcgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGNvbW1pc3Npb24gPSAnQ29tbWlzc2lvblBhaWQnO1xuICAgICAgICB9XG4gICAgICAgIGlmIChjb21taXNzaW9uKSB7XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0IChvcmRlcltjb21taXNzaW9uXSksXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdMaW1pdCcpO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ1ByaWNlJyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdRdWFudGl0eScpO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnUXVhbnRpdHlSZW1haW5pbmcnLCAwLjApO1xuICAgICAgICBsZXQgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICBpZiAoIWNvc3QpIHtcbiAgICAgICAgICAgIGlmIChwcmljZSAmJiBhbW91bnQpXG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICB9XG4gICAgICAgIGlmICghcHJpY2UpIHtcbiAgICAgICAgICAgIGlmIChjb3N0ICYmIGZpbGxlZClcbiAgICAgICAgICAgICAgICBwcmljZSA9IGNvc3QgLyBmaWxsZWQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGF2ZXJhZ2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdQcmljZVBlclVuaXQnKTtcbiAgICAgICAgbGV0IGlkID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ09yZGVyVXVpZCcpO1xuICAgICAgICBpZiAodHlwZW9mIGlkID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGlkID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ09yZGVySWQnKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IGF2ZXJhZ2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSB1bmRlZmluZWQ7XG4g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G4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgncmVzdWx0JyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCd1dWlkJyBpbiByZXNwb25zZVsncmVzdWx0J10pXG4gICAgICAgICAgICAgICAgaWQgPSByZXNwb25zZVsncmVzdWx0J11bJ3V1aWQnXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXSArICcvJztcbiAgICAgICAgaWYgKGFwaSAhPSAndjInKVxuICAgICAgICAgICAgdXJsICs9IHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IGFwaSArICcvJyArIG1ldGhvZC50b0xvd2VyQ2FzZSAoKSArIHBhdGg7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT0gJ3YyJykge1xuICAgICAgICAgICAgdXJsICs9IHBhdGg7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIHVybCArPSBhcGkgKyAnLyc7XG4gICAgICAgICAgICBpZiAoKChhcGkgPT0gJ2FjY291bnQnKSAmJiAocGF0aCAhPSAnd2l0aGRyYXcnKSkgfHwgKHBhdGggPT0gJ29wZW5vcmRlcnMnKSlcbiAgICAgICAgICAgICAgICB1cmwgKz0gbWV0aG9kLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgdXJsICs9IHBhdGggKyAnPycgKyB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlICh1cmwpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyk7XG4gICAgICAgICAgICBoZWFkZXJzID0geyAnYXBpc2lnbic6IHNpZ25hdHVyZSB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgdGhyb3dFeGNlcHRpb25PbkVycm9yIChyZXNwb25zZSkge1xuICAgICAgICBpZiAoJ21lc3NhZ2UnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBpZiAocmVzcG9uc2VbJ21lc3NhZ2UnXSA9PSAnSU5TVUZGSUNJRU5UX0ZVTkRTJ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Y29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoY29kZSA+PSA0MDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdID09IFwie1wiKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgdGhpcy50aHJvd0V4Y2VwdGlvbk9yRXJyb3IgKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcmVzcG9uc2VbJ3N1Y2Nlc3MnXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy50aHJvd0V4Y2VwdGlvbk9uRXJyb3IgKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgnc3VjY2VzcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnc3VjY2VzcyddKSB7XG4gICAgICAgICAgICAgICAgLy8gYSB3b3JrYXJvdW5kIGZvciBB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2hhbmdlIG1hcmtldCBieSBCaXRvbmljTkwnLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjg1MDE3NTItNjBjMjFiODItNmZlYi0xMWU3LTgxOGItMDU1ZWU2ZDBlNzU0LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5ibDNwLmV1JyxcbiAgICAgICAgICAgICAgICAnd3d3JzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9ibDNwLmV1JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0b25pYy5ubCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0JpdG9uaWNOTC9ibDNwLWFwaS90cmVlL21hc3Rlci9kb2NzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYmwzcC5ldS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRvbmljLm5sL2VuL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvZGVwdGgvZnVsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvb3JkZXIvYWRkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9vcmRlci9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L21vbmV5L29yZGVyL3Jlc3VsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9vcmRlcnMvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvdHJhZGVzL2ZldGNoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRU5NS1QvbW9uZXkvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VOTUtUL21vbmV5L2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VOTUtUL21vbmV5L25ld19kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dFTk1LVC9tb25leS93YWxsZXQvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VOTUtUL21vbmV5L3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnQlRDRVVSJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3Rl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iAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCdiYWxhbmNlJyBpbiBiYWxhbmNlW2N1cnJlbmN5XSkge1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ2JhbGFuY2UnXVsndmFsdWUnXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGFjY291bnRbJ3RvdGFsJ10pIHtcbiAgICAgICAgICAgICAgICBpZiAoYWNjb3VudFsnZnJlZSddKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIHBhcnNlQmlkQXNrIChiaWRhc2ssIHByaWNlS2V5ID0gMCwgYW1vdW50S2V5ID0gMCkge1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgYmlkYXNrWydwcmljZV9pbnQnXSAvIDEwMDAwMC4wLFxuICAgICAgICAgICAgYmlkYXNrWydhbW91bnRfaW50J10gLyAxMDAwMDAwMDAuMCxcbiAgICAgICAgXTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0T3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRUaWNrZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3RpbWVzdGFtcCddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUnXVsnMjRoJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RyYWRlX2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdHJhZGVbJ2RhdGUnXSxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodHJhZGVbJ2RhdGUnXSksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2VfaW50J10gLyAxMDAwMDAuMCxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnYW1vdW50X2ludCddIC8gMTAwMDAwMDAwLjAsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBs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AgICAnd3d3JzogJ2h0dHBzOi8vYmxldXRyYWRlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JsZXV0cmFkZS5jb20vaGVscC9BUEknLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYmxldXRyYWRlLmNvbS9oZWxwL2ZlZXNfYW5kX2RlYWRsaW5lcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdBREMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICdCVEEnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICdCSVRCJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ0JUQ0QnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnQkxLJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnQ0ROJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnQ0xBTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICdEQ1InOiAwLjA1LFxuICAgICAgICAgICAgICAgICAgICAnREdDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnRFAnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICdEUEMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICdET0dFJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAnRUZMJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgJ0VYUCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgJ0ZKQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgJ0JTVFknOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ0dCJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnTkxHJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnSFRNTCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnTU9OQSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICdNT09OJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAnTk1DJzogMC4wMTUsXG4gICAgICAgICAgICAgICAgICAgICdORU9TJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnTlZDJzogMC4wNSxcbiAgICAgICAgICAgICAgICAgICAgJ09LJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnUE9UJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnWFBNJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICdRVFVNJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnUkREJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnU0xSJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAnU1RBUlQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICdTTEcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICdUUk9MTCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgJ1VOTyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICdWUkMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICdWVEMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICdYVlAnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICdXREMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ1pFVCc6IDAuMSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWydyZXN1bHQnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ3Jlc3VsdCddW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydNYXJrZXROYW1lJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnTWFya2V0Q3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnQmFzZUN1cnJlbmN5J107XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gbWFya2V0WydJc0FjdGl2ZSddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ01pblRyYWRlU2l6ZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBnZXRPcmRlcklkRmllbGQgKCkge1xuICAgICAgICByZXR1cm4gJ29yZGVyaWQnO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAndHlwZSc6ICdBTEwnLFxuICAgICAgICAgICAgJ2RlcHRoJzogNTAsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdidXknLCAnc2VsbCcsICdSYXRlJywgJ1F1YW50aXR5Jyk7XG4gICAgfVxuXG4gICAgdGhyb3dFeGNlcHRpb25PbkVycm9yIChyZXNwb25zZSkge1xuICAgICAgICBpZiAoJ21lc3NhZ2UnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBpZiAocmVzcG9uc2VbJ21lc3NhZ2UnXSA9PSAnSW5zdWZmaWNpZW50IGZ1bmRzIScpXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEluc3VmZmljaWVudEZ1bmRzICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydtZXNzYWdlJ10gPT0gJ01JTl9UUkFERV9SRVFVSVJFTUVOVF9OT1RfTUVUJylcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydtZXNzYWdlJ10gPT0gJ0FQSUtFWV9JTlZBTElEJykge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLmhhc0FscmVhZHlBdXRoZW50aWNhdGVkU3VjY2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3d3cnOiAnaHR0cHM6Ly9icmF6aWxpZXguY29tLycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JyYXppbGlleC5jb20vZXhjaGFuZ2UvYXBpLnBocCcsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9icmF6aWxpZXguY29tL2V4Y2hhbmdlL2ZlZXMucGhwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY2llcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vay97bWFya2V0fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVoaXN0b3J5L3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb21wbGV0ZV9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDA1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hDdXJyZW5jaWVzIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY2llcyAocGFyYW1zKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChjdXJyZW5jaWVzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpZF07XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0gY3VycmVuY3lbJ2RlY2ltYWwnXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBpZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHVwcGVyY2FzZSk7XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gY3VycmVuY3lbJ2FjdGl2ZSddID09IDE7XG4gICAgICAgICAgICBsZXQgc3RhdHVzID0gJ29rJztcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeVsndW5kZXJfbWFpbnRlbmFuY2UnXSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgYWN0aXZlID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgc3RhdHVzID0gJ21haW50ZW5hbmNlJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBjYW5XaXRoZHJhdyA9IGN1cnJlbmN5Wydpc193aXRoZHJhd2FsX2FjdGl2ZSddID09IDE7XG4gICAgICAgICAgICBsZXQgY2FuRGVwb3NpdCA9IGN1cnJlbmN5Wydpc19kZXBvc2l0X2FjdGl2ZSddID09IDE7XG4gICAgICAgICAgICBpZiAoIWNhbldpdGhkcmF3IHx8ICFjYW5EZXBvc2l0KVxuICAgICAgICAgICAgICAgIGFjdGl2ZSA9IGZhbHNlO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WyduYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ3dhbGxldCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3MnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICdleHRyYSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGNhbldpdGhkcmF3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5Wyd0eFdpdGhkcmF3YWxGZWUnXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnYWN0aXZlJzogY2FuRGVwb3NpdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmZWUnOiBjdXJyZW5jeVsndHhEZXBvc2l0RmVlJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydtaW5BbW91bnRUcmFkZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ01pbldpdGhkcmF3YWwnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydtaW5EZXBvc2l0J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICgpO1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpZF07XG4gICAgICAgICAgICBsZXQgaWRVcHBlckNhc2UgPSBpZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBpZFVwcGVyQ2FzZS5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IG1hcmtldFsnYWN0aXZlJ10gPT0gMTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ2RhdGUnXTtcbiAgICAgICAgdGlja2VyID0gdGlja2VyWyd0aWNrZXInXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2hlc3RCaWQyNCddKSxcbiAgICAgICAgICAgICdsb3cnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xvd2VzdEFzazI0J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnaGlnaGVzdEJpZCddKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xvd2VzdEFzayddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxv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4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaWRdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlJ10pLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ3RvdGFsJ10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgbGV0IG1hcmtldElkID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ21hcmtldCcpO1xuICAgICAgICAgICAgaWYgKG1hcmtldElkKVxuICAgICAgICAgICAgICAgIGlmIChtYXJrZXRJZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFttYXJrZXRJZF07XG4g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AgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBzdWNjZXNzID0gdGhpcy5zYWZlSW50ZWdlciAocmVzcG9uc2UsICdzdWNjZXNzJyk7XG4gICAgICAgIGlmIChzdWNjZXNzICE9IDEpXG4gICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICBsZXQgcGFydHMgPSByZXNwb25zZVsnbWVzc2FnZSddLnNwbGl0ICgnIC8gJyk7XG4gICAgICAgIHBhcnRzID0gcGFydHMuc2xpY2UgKDEpO1xuICAgICAgICBsZXQgZmVlUGFydHMgPSBwYXJ0c1s1XS5zcGxpdCAoJyAnKTtcbiAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5wYXJzZU9yZGVyICh7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGhpcy5taWxsaXNlY29uZHMgKCksXG4gICAgICAgICAgICAnb3JkZXJfbnVtYmVyJzogcmVzcG9uc2VbJ29yZGVyX251bWJlciddLFxuICAgICAgICAgICAgJ3R5cGUnOiBwYXJ0c1swXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdtYXJrZXQnOiBwYXJ0c1swXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJ0c1syXS5zcGxpdCAoJyAnKVsxXSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnRzWzNdLnNwbGl0ICgnICcpWzFdLFxuICAgICAgICAgICAgJ3RvdGFsJzogcGFydHNbNF0uc3BsaXQgKCcgJylbMV0sXG4gICAgICAgICAgICAnZmVlJzoge1xuICAgICAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAoZmVlUGFydHNbMV0pLFxuICAgICAgICAgICAgICAgICdj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ZCc6ICdidGNib3gnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQnRjQm94JyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnSlAnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT0hMQ1YnOiBmYWxzZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzEyNzU4MDMtNGRmNzU1YTgtYWFhMS0xMWU3LTlhYmItMTFlYzJmYWQ5ZjJkLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5idGNib3guY28uanAvYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJ0Y2JveC5jby5qcC8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuYnRjYm94LmNvLmpwL2hlbHAvYXNtJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbGx0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2FkZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV92aWV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9KUFknOiB7ICdpZCc6ICdCVEMvSlBZJywgJ3N5bWJvbCc6ICdCVEMvSlBZJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0pQWScgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAodGhpcy5jdXJyZW5jaWVzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGxvd2VyY2FzZSA9IGN1cnJlbmN5LnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgaWYgKGxvd2VyY2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cbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHt9O1xuICAgICAgICBsZXQgbnVtU3ltYm9scyA9IHRoaXMuc3ltYm9scy5sZW5ndGg7XG4gICAgICAgIGlmIChudW1TeW1ib2xzID4gMSlcbiAgICAgICAgICAgIHJlcXVlc3RbJ2NvaW4nXSA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10sXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsn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ljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcyk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgc2VjcmV0ID0gdGhpcy5oYXNoICh0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIHF1ZXJ5WydzaWduYXR1cmUnXSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHJlcXVlc3QpLCB0aGlzLmVuY29kZSAoc2VjcmV0KSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGg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lkJzogJ2J0Y2NoaW5hJyxcbiAgICAgICAgICAgICduYW1lJzogJ0JUQ0NoaW5hJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQ04nLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MzY4LTQ2NWIzMjg2LTVlZDYtMTFlNy05YTExLTBmNjQ2N2UxZDgyYi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwbHVzJzogJ2h0dHBzOi8vcGx1cy1hcGkuYnRjY2hpbmEuY29tL21hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9kYXRhLmJ0Y2NoaW5hLmNvbS9kYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkuYnRjY2hpbmEuY29tL2FwaV90cmFkZV92MS5waHAnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5idGNjaGluYS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuYnRjY2hpbmEuY29tL2FwaWRvY3MnXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncGx1cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5ZGF0YScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQnV5SWNlYmVyZ09yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCdXlPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQnV5T3JkZXIyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCdXlTdG9wT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbEljZWJlcmdPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbFN0b3BPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QWNjb3VudEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEFyY2hpdmVkT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEFyY2hpdmVkT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREZXBvc2l0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0SWNlYmVyZ09yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRJY2ViZXJnT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXREZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0RGVwdGgyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRTdG9wT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFN0b3BPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0V2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0V2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlcXVlc3RXaXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZWxsSWNlYmVyZ09yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZWxsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlbGxPcmRlcjInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlbGxTdG9wT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9DTlknOiB7ICdpZCc6ICdidGNjbnknLCAnc3ltYm9sJzogJ0JUQy9DTlknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ05ZJywgJ2FwaSc6ICdwdWJsaWMnLCAncGx1cyc6IGZhbHNlIH0sXG4gICAgICAgICAgICAgICAgJ0xUQy9DTlknOiB7ICdpZCc6ICdsdGNjbnknLCAnc3ltYm9sJzog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AgIGxldCBwYXJ0cyA9IGtleS5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGxldCBpZCA9IHBhcnRzWzFdO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBiYXNlID0gYmFzZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIHF1b3RlID0gcXVvdGUudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0QWNjb3VudEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubG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SddKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3NlbGwnXSksXG4gICAgICAgICAgICAndndhcCc6IHBhcnNlRmxvYXQgKHRpY2tlclsndndhcCddKSxcbiAgICAgICAgICAgICdvcGVuJzogcGFyc2VGbG9hdCAodGlja2VyWydvcGVuJ10pLFxuICAgICAgICAgICAgJ2Nsb3NlJzogcGFyc2VGbG9hdCAodGlja2VyWydwcmV2X2Nsb3NlJ10pLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2wnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlclBsdXMgKHRpY2tlciwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ1RpbWVzdGFtcCddO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW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YXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IHAgPSBbXTtcbiAgICAgICAgICAgIGlmICgncGFyYW1zJyBpbiBwYXJhbXMpXG4gICAgICAgICAgICAgICAgcCA9IHBhcmFtc1sncGFyYW1zJ107XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ2lkJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ3BhcmFtcyc6IHAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcCA9IHAuam9pbiAoJywnKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHJlcXVlc3QpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gKFxuICAgICAgICAgICAgICAgICd0b25jZT0nICsgbm9uY2UgK1xuICAgICAgICAgICAgICAgICcmYWNjZXNza2V5PScgKyB0aGlzLmFwaUtleSArXG4gICAgICAgICAgICAgICAgJyZyZXF1ZXN0bWV0aG9kPScgKyBtZXRob2QudG9Mb3dlckNhc2UgKCkgK1xuICAgICAgICAgICAgICAgICcmaWQ9JyArIG5vbmNlICtcbiAgICAgICAgICAgICAgICAnJm1ldGhvZD0nICsgcGF0aCArXG4gICAgICAgICAgICAgICAgJyZwYXJhbXM9JyArIHBcbiAgICAgICAgICAgICk7XG4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rIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdidGNleGNoYW5nZScsXG4gICAgICAgICAgICAnbmFtZSc6ICdCVENFeGNoYW5nZScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1BIJywgLy8gUGhpbGlwcGluZXNcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc5OTMwNTItNGM5MjkxMWEtNjRhYS0xMWU3LTk2ZDgtZWM2YWMzNDM1NzU3LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5idGNleGNoYW5nZS5waC9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYnRjZXhjaGFuZ2UucGgnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL0JUQ1RyYWRlci9icm9rZXItYXBpLWRvY3MnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvUEhQJzogeyAnaWQnOiAnQlRDL1BIUCcsICdzeW1ib2wnOiAnQlRDL1BIUCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdQSFAnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG59XG4iLCJcInVzZSBzdHJpY3RcIjtcblxuLy8gIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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gICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI5MTQyOTExLTBlMWFjZmMyLTdkNWMtMTFlNy05OGM0LTA3ZDk1MzJiMjlkNy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuYnRjbWFya2V0cy5uZXQnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9idGNtYXJrZXRzLm5ldC8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL0JUQ01hcmtldHMvQVBJJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3tpZH0vdGljaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3tpZH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tpZH0vdHJhZGluZ2ZlZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmR0cmFuc2Zlci93aXRoZHJhd0NyeXB0bycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHRyYW5zZmVyL3dpdGhkcmF3RUZUJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jcmVhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvdHJhZGUvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY3JlYXRlQmF0Y2gnLCAvLyB0aGV5IHByb21pc2UgaXQncyBjb21pbmcgc29vbi4uLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2RldGFpbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0FVRCc6IHsgJ2lkJzogJ0JUQy9BVUQnLCAnc3ltYm9sJzogJ0JUQy9BVUQnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQVVEJywgJ21ha2VyJzogMC4wMDg1LCAndGFrZXInOiAwLjAwODUgfSxcbiAgICAgICAgICAgICAgICAnTFRDL0FVRCc6IHsgJ2lkJzogJ0xUQy9BVUQnLCAnc3ltYm9sJzogJ0xUQy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yQm9vayAob3JkZXJib29rLCB0aW1lc3RhbXApO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd0aW1lc3RhbXAnXSAqIDEwMDA7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsb3cnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiZXN0QmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmVzdEFzayddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdFByaWNlJ10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZV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gICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddIC8gbXVsdGlwbGllcixcbiAgICAgICAgICAgICdmZWUnOiB7XG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB0cmFkZVsnZmVlJ10gLyBtdWx0aXBsaWVyLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsndm9sdW1lJ10gLyBtdWx0aXBsaWVyLFxuICAgICAgICAgICAgJ29yZGVyJzogdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ29yZGVySWQnKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZU15VHJhZGVzICh0cmFkZXMsIG1hcmtldCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0cmFkZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCB0cmFkZSA9IHRoaXMucGFyc2VNeVRyYWRlICh0cmFkZXNbaV0sIG1hcmtldCk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodHJhZGUpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgbXVsdGlwbGllciA9IDEwMDAwMDAwMDtcbiAgICAgICAgbGV0IHNpZGUgPSAob3JkZXJbJ29yZGVyU2lkZSddID09ICdCaWQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICBsZXQgdHlwZSA9IChvcmRlclsnb3JkZXJ0eXBlJ10gPT0gJ0xpbWl0JykgP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Y2UgKiBhbW91bnQ7XG4gICAgICAgIGxldCB0cmFkZXMgPSB0aGlzLnBhcnNlTXlUcmFkZXMgKG9yZGVyWyd0cmFkZXMnXSwgbWFya2V0KTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBpZHMgPSBbIHBhcnNlSW50IChpZCkgXTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE9yZGVyRGV0YWls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gJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk0MTQ4My03OWZjNzM1MC02MmQ5LTExZTctOWY2MS1hYzQ3ZjI4ZmNkOTYuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYnRjLXRyYWRlLmNvbS51YS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9idGMtdHJhZGUuY29tLnVhJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZG9jcy5nb29nbGUuY29tL2RvY3VtZW50L2QvMW9jWUEweU15X1JYZDU2MXNmRzNxRVBaODBreWxsMzZIVXh2Q1JlNUdiaEUvZWRpdCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlYWxzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvc2VsbC97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL2J1eS97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnamFwYW5fc3RhdC9oaWdoL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhc2sve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpZC97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5L3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteV9vcmRlcnMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3N0YXR1cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZW1vdmUvb3JkZXIve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbC97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQkNIL1VBSCc6IHsgJ2lkJzogJ2JjaF91YWgnLCAnc3ltYm9sJzogJ0JDSC9VQUgnLCAnYmFzZSc6ICdCQ0gnLCAncXVvdGUnOiAnVUFIJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvVUFIJzogeyAnaWQnOiAnYnRjX3VhaCcsICdzeW1ib2wnOiAnQlRDL1VBSCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVQUgnLCAncHJlY2lzaW9uJzogeyAncHJpY2UnOiAxIH0sICdsaW1pdHMnOiB7ICdhbW91bnQnOiB7ICdtaW4nOiAwLjAwMDAwMDAwMDEgfX19LFxuICAgICAgICAgICAgICAgICdEQVNIL0JUQyc6IHsgJ2lkJzogJ2Rhc2hfYnRjJywgJ3N5bWJvbCc6ICdEQVNIL0JUQycsICdiYXNlJzogJ0RBU0gnLCAncXVvdGUnOiAnQlRDJyB9LFxuICAgICAgICAgICAgICAgICdEQVNIL1VBSCc6IHsgJ2lkJzogJ2Rhc2hfdWFoJywgJ3N5bWJvbCc6ICdEQVNIL1VBSCcsICdiYXNlJzogJ0RBU0gnLCAncXVvdGUnOiAnVUFIJyB9LFxuICAgICAgICAgICAgICAgICdET0dFL0JUQyc6IHsgJ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aWQnOiAnbnZjX3VhaCcsICdzeW1ib2wnOiAnTlZDL1VBSCcsICdiYXNlJzogJ05WQycsICdxdW90ZSc6ICdVQUgnIH0sXG4gICAgICAgICAgICAgICAgJ1BQQy9CVEMnOiB7ICdpZCc6ICdwcGNfYnRjJywgJ3N5bWJvbCc6ICdQUEMvQlRDJywgJ2Jhc2UnOiAnUFBDJywgJ3F1b3RlJzogJ0JUQycgfSxcbiAgICAgICAgICAgICAgICAnU0lCL1VBSCc6IHsgJ2lkJzogJ3NpYl91YWgnLCAnc3ltYm9sJzogJ1NJQi9VQUgnLCAnYmFzZSc6ICdTSUInLCAncXVvdGUnOiAnVUFIJyB9LFxuICAgICAgICAgICAgICAgICdYTVIvVUFIJzogeyAnaWQnOiAneG1yX3VhaCcsICdzeW1ib2wnOiAnWE1SL1VBSCcsICdiYXNlJzogJ1hNUicsICdxdW90ZSc6ICdVQUgnIH0sXG4gICAgICAgICAgICAgICAgJ1pFQy9VQUgnOiB7ICdpZCc6ICd6ZWNfdWFoJywgJ3N5bWJvbCc6ICdaRUMvVUFIJywgJ2Jhc2UnOiAnWkVDJywgJ3F1b3RlJzogJ1VBSCcgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05WQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDEwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBzaWduSW4gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5wcml2YXRlUG9zdEF1dGggKCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBpZiAoJ2FjY291bnRzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgbGV0IGFjY291bnRzID0gcmVzcG9uc2VbJ2FjY291bnRzJ107XG4gICAgICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGFjY291bnRzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGFjY291bnQgPSBhY2NvdW50c1tiXTtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBhY2NvdW50WydjdXJyZW5jeSddO1xuICAgICAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcGFyc2VGbG9hdCAoYWNjb3VudFsnYmFsYW5jZSddKTtcbiAgICAgICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0ge1xuICAgICAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2UsXG4gICAgICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IGJpZHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlc0J1eVN5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgYXNrcyA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVzU2VsbFN5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0ge1xuICAgICAgICAgICAgJ2JpZHMnOiBbXSxcbiAgICAgICAgICAgICdhc2tzJzogW10sXG4gICAgICAgIH07XG4gICAgICAgIGlmIChiaWRzKSB7XG4gICAgICAgICAgICBpZiAoJ2xpc3QnIGluIGJpZHMpXG4gICAgICAgICAgICAgICAgb3JkZXJib29rWydiaWRzJ10gPSBiaWRzWydsaXN0J107XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFza3MpIHtcbiAgICAgICAgICAgIGlmICgnbGlzdCcgaW4gYXNrcylcbiAgICAgICAgICAgICAgICBvcmRlcmJvb2tbJ2Fza3MnXSA9IGFza3NbJ2xpc3QnXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdiaWRzJywgJ2Fza3MnLCAncHJpY2UnLCAnY3VycmVuY3lfdHJhZGUnKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPS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gICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHRpY2tlckxlbmd0aCA9IHRpY2tlci5sZW5ndGg7XG4gICAgICAgIGlmICh0aWNrZXJMZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBsZXQgc3RhcnQgPSBNYXRoLm1heCAodGlja2VyTGVuZ3RoIC0gNDgsIDApO1xuICAgICAgICAgICAgZm9yIChsZXQgdCA9IHN0YXJ0OyB0IDwgdGlja2VyLmxlbmd0aDsgdCsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGNhbmRsZSA9IHRpY2tlclt0XTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJlc3VsdFsnb3BlbiddID09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ29wZW4nXSA9IGNhbmRsZVsxXTtcbiAgICAgICAgICAgICAgICBpZiAoKHR5cGVvZiByZXN1bHRbJ2hpZ2gnXSA9PSAndW5kZWZpbmVkJykgfHwgKHJlc3VsdFsnaGlnaCddIDwgY2FuZGxlWzJdKSlcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0WydoaWdoJ10gPSBjYW5kbGVbMl07XG4gICAgICAgICAgICAgICAgaWYgKCh0eXBlb2YgcmVzdWx0Wydsb3cnXSA9PSAndW5kZWZpbmVkJykgfHwgKHJlc3VsdFsnbG93J10gPiBjYW5kbGVbM10pKVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ2xvdyddID0gY2FuZGxlWzNdO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVzdWx0WydiYXNlVm9sdW1lJ10gPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFsnYmFzZVZvbHVtZSddID0gLWNhbmRsZVs1XTtcbiAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFsnYmFzZVZvbHVtZSddIC09IGNhbmRsZVs1XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBsYXN0ID0gdGlja2VyTGVuZ3RoIC0gMTtcbiAgICAgICAgICAgIHJlc3VsdFsnY2xvc2UnXSA9IHRpY2tlcltsYXN0XVs0XTtcbiAgICAgICAgICAgIHJlc3VsdFsnYmFzZVZvbHVtZSddID0gLTEgKiByZXN1bHRbJ2Jhc2VWb2x1bWUnXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGNvbnZlcnRDeXJpbGxpY01vbnRoTmFtZVRvU3RyaW5nIChjeXJpbGxpYykge1xuICAgICAgICBsZXQgbW9udGhzID0ge1xuICAgICAgICAgICAgJ9GP0L3QstCw0YDRjyc6ICcwMScsXG4gICAgICAgICAgICAn0YTQtdCy0YDQsNC70Y8nOiAnMDInLFxuICAgICAgICAgICAgJ9C80LDRgNGC0LAnOiAnMDMnLFxuICAgICAgICAgICAgJ9Cw0L/RgNC10LvRjyc6ICcwNCcsXG4gICAgICAgICAgICAn0LzQsNGPJzogJzA1JyxcbiAgICAgICAgICAgICfQuNGO0L3Rjyc6ICcwNicsXG4gICAgICAgICAgICAn0Lj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ndGggPT0gMSkge1xuICAgICAgICAgICAgZGF5ID0gJzAnICsgZGF5O1xuICAgICAgICB9XG4gICAgICAgIGxldCB5bWQgPSBbIHllYXIsIG1vbnRoLCBkYXkgXS5qb2luICgnLScpO1xuICAgICAgICBsZXQgeW1kaG1zID0geW1kICsgJ1QnICsgaG1zO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHltZGhtcyk7XG4gICAgICAgIC8vIHNlcnZlciByZXBvcnRzIGxvY2FsIHRpbWUsIGFkanVzdCB0byBVVENcbiAgICAgICAgbGV0IG1kID0gWyBtb250aCwgZGF5IF0uam9pbiAoJycpO1xuICAgICAgICBtZCA9IHBhcnNlSW50IChtZCk7XG4gICAgICAgIC8vIGEgc3BlY2lhbCBjYXNlIGZvciBEU1RcbiAgICAgICAgLy8gc3VidHJhY3QgMiBob3VycyBkdXJpbmcgd2ludGVyXG4gICAgICAgIGlmIChtZCA8IDMyNSB8fCBtZCA+IDEwMjgpXG4gICAgICAgICAgICByZXR1cm4gdGltZXN0YW1wIC0gNzIwMDAwMDtcbiAgICAgICAgLy8gc3VidHJhY3QgMyBob3VycyBkdXJpbmcgc3VtbWVyXG4gICAgICAgIHJldHVybiB0aW1lc3RhbXAgLSAxMDgwMDAwMDtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlQ3lyaWxsaWNEYXRldGltZSAodHJhZGVbJ3B1Yl9kYXRlJ10pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSx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ICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ2lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLCAvLyB1bnRpbCB0aGV5IGZpeCB0aGVpciB0aW1lc3RhbXBcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzdGF0dXMnOiAnb3BlbicsXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsndHlwZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2FtbnRfdHJhZGUnXSxcbiAgICAgICAgICAgICdmaWxsZWQnOiAwLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHRyYWRlWydhbW50X3RyYWRlJ10sXG4gICAgICAgICAgICAndHJhZGVzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9wZW5PcmRlcnMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBpZiAoIXN5bWJvbClcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaE9wZW5PcmRlcnMgcmVxdWlyZXMgYSBzeW1ib2wgcGFyYW0nKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGV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IHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnYnRjdHVyaycsXG4gICAgICAgICAgICAnbmFtZSc6ICdCVENUdXJrJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnVFInLCAvLyBUdXJrZXlcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc5OTI3MDktMThlMTU2NDYtNjRhMy0xMWU3LTlmYTItYjA5NTBlYzc3MTJmLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5idGN0dXJrLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYnRjdHVyay5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL0JUQ1RyYWRlci9icm9rZXItYXBpLWRvY3MnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvaGxjZGF0YScsIC8vID9sYXN0PUNPVU5UXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsICAgLy8gP2xhc3Q9Q09VTlQgKG1heCA1MClcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJUcmFuc2FjdGlvbnMnLCAvLyA/b2Zmc2V0PTAmbGltaXQ9MjUmc29ydD1hc2NcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1RSWSc6IHsgJ2lkJzogJ0JUQ1RSWScsICdzeW1ib2wnOiAnQlRDL1RSWScsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdUUlknLCAnbWFrZXInOiAwLjAwMiAqIDEuMTgsICd0YWtlcic6IDAuMDAzNSAqIDEuMTggfSxcbiAgICAgICAgICAgICAgICAnRVRIL1RSWSc6IHsgJ2lkJzogJ0VUSFRSWScsICdzeW1ib2wnOiAnRVRIL1RSWScsICdiYXNlJzogJ0VUSCcsICdxdW90ZSc6ICdUUlknLCAnbWFrZXInOiAwLjAwMiAqIDEuMTgsICd0YWtlcic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XJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogcGFyc2VGbG9hdCAodGlja2VyWydvcGVuJ10pLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYXZlcmFnZSddKSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlcnMgKHN5bWJvbHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHBhcmFtcyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aWNrZXJzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSB0aWNrZXJbJ3BhaXInXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoc3ltYm9sIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtzeW1ib2xdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gYXdhaXQgdGhpcy5mZXRjaFRpY2tlcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChzeW1ib2wgaW4gdGlja2VycylcbiAgICAgICAgICAgIHJlc3VsdCA9IHRpY2tlcnNbc3ltYm9sXTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsnZGF0ZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnd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nLFxuICAgICAgICAgICAgJ0lzTWFya2V0T3JkZXInOiAodHlwZSA9PSAnbWFya2V0JykgPyAxIDogMCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHR5cGUgPT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIGlmIChzaWRlID09ICdidXknKVxuICAgICAgICAgICAgICAgIG9yZGVyWydUb3RhbCddID0gYW1vdW50O1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIG9yZGVyWydBbW91bnQnXSA9IGFtb3VudDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9yZGVyWydQcmljZSddID0gcHJpY2U7XG4gICAgICAgICAgICBvcmRlclsnQW1vdW50J10gPSBhbW91bnQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh7ICdpZCc6IGlkIH0pO1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKHRoaXMuaWQgPT0gJ2J0Y3RyYWRlcicpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgaXMgYW4gYWJzdHJhY3QgYmFzZSBBUEkgZm9yIEJUQ0V4Y2hhbmdlLCBCVENUdXJrJyk7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgICAgICBsZXQgc2VjcmV0ID0gdGhpcy5iYXNlNjRUb0JpbmFyeSAodGhpcy5zZWNyZXQpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLmFwaUtleSArIG5vbmNlO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnWC1QQ0snOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnWC1TdGFtcCc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdYLVNpZ25hdHVyZSc6IHRoaXMuc3RyaW5nVG9CYXNlNjQodGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHNlY3JldCwgJ3NoYTI1NicsICdiaW5hcnknKSksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICA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ICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYzODUtOWZkY2M5OGMtNWVkNi0xMWU3LThmMTQtNjZkNWU1Y2Q0N2U2LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2J0Yy14LmlzL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2J0Yy14LmlzJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYnRjLXguaXMvY3VzdG9tL2FwaS1kb2N1bWVudC5odG1sJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve2lkfS97bGltaXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfS97bGltaXR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWRlZW0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICA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ydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydzZWxsJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYnV5J10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sdW1lJ10pLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgbGV0IHNpZGUgPSAodHJhZGVbJ3R5cGUnXSA9PSAnYXNrJykgPyAnc2VsbCcgOiAnYnV5JztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2M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FnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc5ODA0NzktY2ZhMzE4OGMtNjM4Ny0xMWU3LTgxOTEtOTNmYzQxODRiYTVjLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2RhdGEuYnRlci5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkuYnRlci5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9idGVyLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2J0ZXIuY29tL2FwaTInLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYnRlci5jb20vZmVlJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGxpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckJvb2sve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVIaXN0b3J5L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlSGlzdG9yeS97aWR9L3t0aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ25ld0FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzV2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbEFsbE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldGluZm8gKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAncGFpcnMnKTtcbiAgICAgICAgaWYgKCFtYXJrZXRzKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGZldGNoTWFya2V0cyBnb3QgYW4gdW5yZWNvZ25pemVkIHJlc3BvbnNlJyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldCk7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzWzBdO1xuICAgICAgICAgICAgbGV0IGRldGFpbHMgPSBtYXJrZXRbaWRdO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgYmFzZSA9IGJhc2UudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBxdW90ZSA9IHF1b3RlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBkZXRhaWxzWydkZWNpbWFsX3BsYWNlcyddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IGRldGFpbHNbJ2RlY2ltYWxfcGxhY2VzJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFtb3VudExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogZGV0YWlsc1snbWluX2Ftb3VudCddLFxuICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByaWNlTGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnRMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBkZXRhaWxzWydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBkZXRhaWxzWydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZSB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA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IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBiYXNlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBxdW90ZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKHN5bWJvbCBpbiB0aGlzLm1hcmtldHMpXG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VySWQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiBtYXJr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XJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0geyAnbm9uY2UnOiBub25jZSB9O1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcXVlcnkpKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChib2R5KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiBzaWduYXR1cmUsXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdw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nLFxuICAgICAgICAgICAgJ25hbWUnOiAnQlguaW4udGgnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdUSCcsIC8vIFRoYWlsYW5kXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY0MTItNTY3YjFlYjQtNWVkNy0xMWU3LTk0YTgtZmY2YTM4ODRmNmM1LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2J4LmluLnRoL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2J4LmluLnRoJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYnguaW4udGgvaW5mby9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICcnLCAvLyB0aWNrZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb25ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZWhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpbGxlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlsbGdyb3VwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaWxscGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWlzc3VlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLW15aXNzdWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1teWJpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLW15b3B0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWV4ZXJjaXNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24taGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWwtaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFBhaXJpbmcgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNba2V5c1twXV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3BhaXJpbmdfaWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydzZWNvbmRhcnlfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncHJpbWFyeV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYX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sZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbY3VycmVuY3ldWydhdmFpbGFibGUnXSksXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ3RvdGFsJ10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRPcmRlcmJvb2sgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcmluZyc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICA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AgICAgICAncGFpcmluZyc6IHBhaXJpbmcsXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLyc7XG4gICAgICAgIGlmIChwYXRoKVxuICAgICAgICAgICAgdXJsICs9IHBhdGggKyAnLyc7XG4gICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IHRoaXMuYXBpS2V5ICsgbm9uY2UudG9TdHJpbmcgKCkgKyB0aGlzLnNlY3JldDtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhhc2ggKHRoaXMuZW5jb2RlIChhdXRoKSwgJ3NoYTI1NicpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnc2lnbmF0dXJlJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgICAgIC8vIHR3b2ZhOiB0aGlzLnR3b2ZhLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJz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SAoJy4vYmFzZS9lcnJvcnMnKVxuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgY2NleCBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdjY2V4JyxcbiAgICAgICAgICAgICduYW1lJzogJ0MtQ0VYJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdERScsICdFVScgXSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQzMy0xNjg4MWY5MC01ZWQ4LTExZTctOTJmOC0zZDkyY2M3NDdhNmMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAndGlja2Vycyc6ICdodHRwczovL2MtY2V4LmNvbS90JyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2MtY2V4LmNvbS90L2FwaV9wdWIuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYy1jZXguY29tL3QvYXBpLmh0bWwnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2MtY2V4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2MtY2V4LmNvbS8/aWQ9YXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd0aWNrZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvaW5uYW1lcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ZvbHVtZV97Y29pbn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlZGlzdHJpYnV0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzdW1tYXJpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXlsaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0b3Blbm9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG9yZGVyaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxsaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdJT1QnKVxuICAgICAgICAgICAgcmV0dXJuICdJb1Rjb2luJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCTEMnKVxuICAgICAgICAgICAgcmV0dXJuICdDcnlwdG9idWxsY29pbic7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnWElEJylcbiAgICAgICAgICAgIHJldHVybiAnSW50ZXJuYXRpb25hbERpYW1vbmQnO1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWydyZXN1bHQnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ3Jlc3VsdCddW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydNYXJrZXROYW1lJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnTWFya2V0Q3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnQmFzZUN1cnJlbmN5J107XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSBiYWxhbmNlWydDdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGNvZGUpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydBdmFpbGFibGUnXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IGJhbGFuY2VbJ1BlbmRpbmcnXSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWydCYWxhbmNlJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAndHlwZSc6ICdib3RoJyxcbiAgICAgICAgICAgICdkZXB0aCc6IDEwMCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHVuZGVmaW5lZCwgJ2J1eScsICdzZWxsJywgJ1JhdGUnLCAnUXVhbnRpdHknKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndXBkYXRlZCddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYnV5J10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnc2VsbCddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdHByaWNlJ10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZ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VN0YW1wJ10pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ0lkJ10sXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydPcmRlclR5cGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydQcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydRdWFudGl0eSddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldGhpc3RvcnkgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3R5cGUnOiAnYm90aCcsXG4gICAgICAgICAgICAnZGVwdGgnOiAxMDAsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2VbJ3Jlc3VsdCddLC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hcGknXVthcGldO1xuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5rZXlzb3J0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ2FwaXNpZ24nOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlICh1cmwpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJykgfTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYSc6ICdnZXQnICsgcGF0aCxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdXJsICs9ICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKSArICcuanNvbic7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChw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ICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdjZXgnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQ0VYLklPJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdHQicsICdFVScsICdDWScsICdSVScgXSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQ0Mi04ZGRjMzNiMC01ZWQ4LTExZTctOGI5OC1mNzg2YWVmMGYzYzkuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vY2V4LmlvL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2NleC5pbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2NleC5pby9jZXgtYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3lfbGltaXRzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdF9wcmljZS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlcy97Y3VycmVuY2llc30vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvaGxjdi9oZC97eXl5eW1tZGR9L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vay97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2Vycy97Y3VycmVuY2llc30vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9oaXN0b3J5L3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb252ZXJ0L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2Vfc3RhdHMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY3RpdmVfb3JkZXJzX3N0YXR1cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FyY2hpdmVkX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfcmVwbGFjZV9vcmRlci97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjbG9zZV9wb3NpdGlvbi97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9teWZlZS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlcl90eC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9wb3NpdGlvbi97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX3Bvc2l0aW9ucy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZV9vcmRlci97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDdXJyZW5jeUxpbWl0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHNbJ2RhdGEnXVsncGFpcnMnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ2RhdGEnXVsncGFpcnMnXVtwXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnc3ltYm9sMSddICsgJy8nICsgbWFya2V0WydzeW1ib2wyJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsnbWluUHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiAtMSAqIE1hdGgubG9nMTAgKG1hcmtldFsnbWluTG90U2l6ZSddKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydtaW5Mb3RTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhMb3RTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21pblByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWF4UHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbWluTG90U2l6ZVMyJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgbGV0IG9tbWl0ZWQgPSBbICd1c2VybmFtZScsICd0aW1lc3RhbXAnIF07XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHRoaXMub21pdCAocmVzcG9uc2UsIG9tbWl0ZWQpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICAgICAnZnJlZSc6IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlc1tjdXJyZW5jeV0sICdhdmFpbGFibGUnLCAwLjApLFxuICAgICAgICAgICAgICAgICAgICAndXNlZCc6IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlc1tjdXJyZW5jeV0sICdvcmRlcnMnLCAwLjApLFxuICAgICAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJCb29rUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBvcmRlcmJvb2tbJ3RpbWVzdGFtcCddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdGltZXN0YW1wKTtcbiAgICB9XG5cbiAgICBwYXJzZU9ITENWIChvaGxjdiwgbWFya2V0ID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AgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGlzbzg2MDEsXG4gICAgICAgICAgICAnaGlnaCc6IGhpZ2gsXG4gICAgICAgICAgICAnbG93JzogbG93LFxuICAgICAgICAgICAgJ2JpZCc6IGJpZCxcbiAgICAgICAgICAgICdhc2snOiBhc2ssXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAodGhpcy5jdXJyZW5jaWVzKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJzQ3VycmVuY2llcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jaWVzJzogY3VycmVuY2llcy5qb2luICgnLycpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IHQgPSAwOyB0IDwgdGlja2Vycy5sZW5ndGg7IHQrKykge1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbdF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gdGlja2VyWydwYWlyJ10ucmVwbGFjZSAoJzonLCAnLycpO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlclBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlSGlzdG9yeVBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdwYWlyJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdsaW1pdCcpIHtcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gcHJpY2U7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBmb3IgbWFya2V0IGJ1eSBDRVguaW8gcmVxdWlyZXMgdGhlIGFtb3VudCBvZiBxdW90ZSBjdXJyZW5jeSB0byBzcGVuZFxuICAgICAgICAgICAgaWYgKHNpZGUgPT0gJ2J1eScpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXByaWNlKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKCdGb3IgbWFya2V0IGJ1eSBvcmRlcnMgJyArIHRoaXMuaWQgKyBcIiByZXF1aXJlcyB0aGUgYW1vdW50IG9mIHF1b3RlIGN1cnJlbmN5IHRvIHNwZW5kLCB0byBjYWxjdWxhdGUgcHJvcGVyIGNvc3RzIGNhbGwgY3JlYXRlT3JkZXIgKHN5bWJvbCwgJ21hcmtldCcsICdidXknLCBhbW91bnQsIHByaWNlKVwiKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgb3JkZXJbJ2Ftb3VudCddID0gYW1vdW50ICogcHJpY2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBvcmRlclsnb3JkZXJfdHlwZSddID0gdHlwZTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSB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iAgICAgICAgICAgIHN0YXR1cyA9ICdjYW5jZWxlZCc7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09ICdjJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2NhbmNlbGVkJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT0gJ2QnKSB7XG4gICAgICAgICAgICBzdGF0dXMgPSAnY2xvc2VkJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnYW1vdW50Jyk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwZW5kaW5nJyk7XG4gICAgICAgIGlmICghcmVtYWluaW5nKVxuICAgICAgICAgICAgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncmVtYWlucycpO1xuICAgICAgICBsZXQgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICd0YTonICsgbWFya2V0WydxdW90ZSddKTtcbiAgICAgICAgICAgIGxldCBiYXNlRmVlID0gJ2ZhOicgKyBtYXJrZXRbJ2Jhc2UnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUZlZSA9ICdmYTonICsgbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgbGV0IGZlZVJhdGUgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICd0cmFkaW5nRmVlTWFrZXInKTtcbiAgICAgICAgICAgIGlmICghZmVlUmF0ZSlcbiAgICAgICAgICAgICAgICBmZWVSYXRlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAndHJhZGluZ0ZlZVRha2VyJywgZmVlUmF0ZSk7XG4gICAgICAgICAgICBpZiAoZmVlUmF0ZSlcbiAgICAgICAgICAgICAgICBmZWVSYXRlIC89IDEwMC4wOyAvLyBjb252ZXJ0IHRvIG1hdGhlbWF0aWNhbGx5LWNvcnJlY3QgcGVyY2VudGFnZSBjb2VmZmljaWVudHM6IDEuMCA9IDEwMCVcbiAgICAgICAgICAgIGlmIChiYXNlRmVlIGluIG9yZGVyKSB7XG4gICAgICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ2Jhc2UnXSxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUnOiBmZWVSYXRlLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgYmFzZUZlZSksXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocXVvdGVGZWUgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUnOiBmZWVSYXRlLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgcXVvdGVGZWUpLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFjb3N0KVxuICAgICAgICAgICAgY29zdCA9IHByaWNlICogZmlsbGVkO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3Blbk9yZGVycyAoc3ltYm9sID0gdW5kZWZpbmVkLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge307XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3RPcGVuT3JkZXJzJztcbiAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHN5bWJvbCkge1xuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgICAgICByZXF1ZXN0WydwYWlyJ10gPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgICAgICBtZXRob2QgKz0gJ1BhaXInO1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gbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG5vbmNlICsgdGhpcy51aWQgKyB0aGlzLmFwaUtleTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICghcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm5lZCAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICB9IGVsc2UgaWYgKHJlc3BvbnNlID09IHRydWUpIHtcbiAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgfSBlbHNlIGlmICgnZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmICgnb2snIGluIHJlc3BvbnNlKVxuICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnb2snXSA9PSAnb2snKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgfSBlbHNlIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBpZiAocmVzcG9uc2VbJ2Vycm9yJ10pXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cbn1cbiIsIlw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Sc6ICdjb2luY2hlY2snLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ0pQJywgJ0lEJyBdLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQ2NC0zYjVjM2M3NC01ZWQ5LTExZTctODQwZS0zMWIzMjk2OGUxZGEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vY29pbmNoZWNrLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2luY2hlY2suY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vY29pbmNoZWNrLmNvbS9kb2N1bWVudHMvZXhjaGFuZ2UvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3JhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyYXRlL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL2xldmVyYWdlX2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbmtfYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRfbW9uZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVycy9vcGVucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3RyYW5zYWN0aW9uc19wYWdpbmF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9sZXZlcmFnZS9wb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRpbmcvYm9ycm93cy9tYXRjaGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kX21vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYW5rX2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X21vbmV5L3tpZH0vZmFzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90cmFuc2ZlcnMvdG9fbGV2ZXJhZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RyYW5zZmVycy9mcm9tX2xldmVyYWdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kaW5nL2JvcnJvd3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRpbmcvYm9ycm93cy97aWR9L3JlcGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kX21vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbmtfYWNjb3VudHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvSlBZJzogeyAnaWQnOiAnYnRjX2pweScsICdzeW1ib2wnOiAnQlRDL0pQWScsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdKUFknIH0sIC8vIHRoZSBvbmx5IHJlYWwgcGFpclxuICAgICAgICAgICAgICAgIC8vICdFVEgvSlBZJzogeyAnaWQnOiAnZXRoX2pweScsICdzeW1ib2wnOiAnRVRIL0pQWScsICdiYXNlJzogJ0VUSCcsICdxdW90ZSc6ICdKUFknIH0sXG4gICAgICAgICAgICAgICAgLy8gJ0VUQy9KUFknOiB7ICdpZCc6ICdldGNfanB5JywgJ3N5bWJvbCc6ICdFVEMvSlBZJywgJ2Jhc2UnOiAnRVRDJywgJ3F1b3RlJzogJ0pQWScgfSxcbiAgICAgICAgICAgICAgICAvLyAnREFPL0pQWSc6IHsgJ2lkJzogJ2Rhb19qcHknLCAnc3ltYm9sJzogJ0RBTy9KUFknLCAnYmFzZSc6ICdEQU8nLCAncXVvdGUnOiAnSl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YW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnlTdHJpbmcgPSAnJztcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAodGhpcy5rZXlzb3J0IChxdWVyeSkpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmtleXNvcnQgKHF1ZXJ5KSk7XG4gICAgICAgICAgICAgICAgICAgIHF1ZXJ5U3RyaW5nID0gYm9keTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG5vbmNlICsgdXJsICsgcXVlcnlTdHJpbmc7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC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Fsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zNDg0MjMwMy0yOWM5OWZjYS1mNzFjLTExZTctODNjMS0wOWQ5MDBjYjIzMzQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmNvaW5leGNoYW5nZS5pby9hcGkvdjEnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuY29pbmV4Y2hhbmdlLmlvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vY29pbmV4Y2hhbmdlaW8uZ2l0aHViLmlvL3NsYXRlLycsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cuY29pbmV4Y2hhbmdlLmlvL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y3VycmVuY2llcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0bWFya2V0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0bWFya2V0c3VtbWFyaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRtYXJrZXRzdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxNSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDE1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hDdXJyZW5jaWVzIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY2llcyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHByZWNpc2lvbiA9IHRoaXMucHJlY2lzaW9uWydhbW91bnQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jeVsnQ3VycmVuY3lJRCddO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3lbJ1RpY2tlckNvZGUnXSk7XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gY3VycmVuY3lbJ1dhbGxldFN0YXR1cyddID09ICdvbmxpbmUnO1xuICAgICAgICAgICAgbGV0IHN0YXR1cyA9ICdvayc7XG4gICAgICAgICAgICBpZiAoIWFjdGl2ZSlcbiAgICAgICAgICAgICAgICBzdGF0dXMgPSAnZGlzYWJsZWQnO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WydOYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydNYXJrZXRJRCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAobWFya2V0WydNYXJrZXRBc3NldENvZGUnXSk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAobWFya2V0WydCYXNlQ3VycmVuY3lDb2RlJ10pO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGlmICghbWFya2V0KSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0SWQgPSB0aWNrZXJbJ01hcmtldElEJ107XG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNCeUlkW21hcmtldElkXTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnSGlnaFByaWNlJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnTG93UHJpY2UnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydCaWRQcmljZSddKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ0Fza1ByaWNlJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydMYXN0UHJpY2UnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogcGFyc2VGbG9hdCAodGlja2VyWydDaGFuZ2UnXSksXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ1ZvbHVtZSddKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0c3VtbWFyeSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdtYXJrZXRfaWQnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV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0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vdGlja2VyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9vcmRlcl9ib29rLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS90cmFuc2FjdGlvbnMvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2JhbGFuY2UvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3VzZXJfdHJhbnNhY3Rpb25zLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9vcGVuX29yZGVycy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vY2FuY2VsX29yZGVyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9idXkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3NlbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2J1eV9tYXJrZXQvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3NlbGxfbWFya2V0LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9lc3RpbWF0ZV9zZWxsX21hcmtldC8nLFxuICAgICAgICAgICAgIC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FzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRJZFRpY2tlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBw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lci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2NvaW5naScsXG4gICAgICAgICAgICAnbmFtZSc6ICdDb2luZ2knLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnUEEnLCAnQkcnLCAnQ04nLCAnVVMnIF0sIC8vIFBhbmFtYSwgQnVsZ2FyaWEsIENoaW5hLCBVU1xuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODYxOTcwNy01YzkyMzJhOC03MjEyLTExZTctODZkNi05OGZlNWQxNWNjNmUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vY29pbmdpLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW50JzogJ2h0dHBzOi8vYXBpLmNvaW5naS5jb20nLFxuICAgICAgICAgICAgICAgICAgICAndXNlcic6ICdodHRwczovL2FwaS5jb2luZ2kuY29tJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2luZ2kuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHA6Ly9kb2NzLmNvaW5naS5hcGlhcnkuaW8vJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3d3cnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdjdXJyZW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyLWJvb2sve3BhaXJ9L3thc2tDb3VudH0ve2JpZENvdW50fS97ZGVwdGh9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMve3BhaXJ9L3ttYXhDb3VudH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJzI0aG91ci1yb2xsaW5nLWFnZ3JlZ2F0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd1c2VyJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhZGQtb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbC1vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZS1jcnlwdG8td2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdWVEMnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTk1DJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogMTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTk1DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAg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ICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGlkLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtc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hcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHVuZGVmaW5lZCwgJ2JpZHMnLCAnYXNrcycsICdwcmljZScsICdiYXNlQW1vdW50Jyk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGlja2VyWydoaWdoJ10sXG4gICAgICAgICAgICAnbG93JzogdGlja2VyWydsb3cnXSxcbiAgICAgICAgICAgICdiaWQnOiB0aWNrZXJbJ2hpZ2hlc3RCaWQnXSxcbiAgICAgICAgICAgICdhc2snOiB0aWNrZXJbJ2xvd2VzdEFzayddLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgIC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zZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLmZldGNoVGlja2VycyAodW5kZWZpbmVkLCBwYXJhbXMpO1xuICAgICAgICBpZiAoc3ltYm9sIGluIHRpY2tlcnMpXG4gICAgICAgICAgICByZXR1cm4gdGlja2Vyc1tzeW1ib2xdO1xuICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcmV0dXJuIGRpZCBub3QgY29udGFpbiAnICsgc3ltYm9sKTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGlmICghbWFya2V0KVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydjdXJyZW5jeVBhaXInXV07XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdHJhZGVbJ3RpbWVzdGFtcCddLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0cmFkZVsndGltZXN0YW1wJ10pLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLCAvLyB0eXBlXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXS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GZhbHNlLFxuICAgICAgICAgICAgJ2hhc0NyZWF0ZU9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzQ2FuY2VsT3JkZXInOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaEJhbGFuY2UnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVyQm9vayc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4MjQ0MjQ0LTliZTYzMTJhLTY5ZWQtMTFlNy05OWMxLTdjMTc5NzI3NTI2NS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkuY29pbm1hcmtldGNhcC5jb20nLFxuICAgICAgICAgICAgICAgICAgICAnZmlsZXMnOiAnaHR0cHM6Ly9maWxlcy5jb2lubWFya2V0Y2FwLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICdjaGFydHMnOiAnaHR0cHM6Ly9ncmFwaC5jb2lubWFya2V0Y2FwLmNvbScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vY29pbm1hcmtldGNhcC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9jb2lubWFya2V0Y2FwLmNvbS9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnZmlsZXMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2VuZXJhdGVkL3N0YXRzL2dsb2JhbC5qc29uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdncmFwaHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY2llcy97bmFtZX0vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3tpZH0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnbG9iYWwvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjdXJyZW5jeUNvZGVzJzogW1xuICAgICAgICAgICAgICAgICdBVUQnLFxuICAgICAgICAgICAgICAgICdCUkwnLFxuICAgICAgICAgICAgICAgICdDQUQnLFxuICAgICAgICAgICAgICAgICdDSEYnLFxuICAgICAgICAgICAgICAgICdDTlknLFxuICAgICAgICAgICAgICAgICdFVVInLFxuICAgICAgICAgICAgICAgICdHQlAnLFxuICAgICAgICAgICAgICAgICdIS0QnLFxuICAgICAgICAgICAgICAgICdJRFInLFxuICAgICAgICAgICAgICAgICdJTlInLFxuICAgICAgICAgICAgICAgICdKUFknLFxuICAgICAgICAgICAgICAgICdLUlcnLFxuICAgICAgICAgICAgICAgICdNWE4nLFxuICAgICAgICAgICAgICAgICdSVUInLFxuICAgICAgICAgICAgICAgICdVU0QnLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKCdGZXRjaGluZyBvcmRlciBib29rcyBpcyBub3Qgc3VwcG9ydGVkIGJ5IHRoZSBBUEkgb2YgJyArIHRoaXMuaWQpO1xuICAgIH1cblxuICAgIGN1cnJlbmN5Q29kZSAoYmFzZSwgbmFtZSkge1xuICAgICAgICBjb25zdCBjdXJyZW5jaWVzID0ge1xuICAgICAgICAgICAgJ0JpdGdlbSc6ICdCaXRnZW0nLFxuICAgICAgICAgICAgJ05ldENvaW4nOiAnTmV0Q29pbicsXG4gICAgICAgICAgICAnQmF0Q29pbic6ICdCYXRDb2luJyxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKG5hbWUgaW4gY3VycmVuY2llcylcbiAgICAgICAgICAgIHJldHVybiBjdXJyZW5jaWVzW25hbWVdO1xuICAgICAgICByZXR1cm4gYmFzZTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh7XG4gICAgICAgICAgICAnbGltaXQnOiAwLFxuICAgICAgICB9KTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSB0aGlzLmN1cnJlbmN5Q29kZXM7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZUlkID0gcXVvdGUudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY3VycmVuY3lDb2RlIChtYXJrZXRbJ3N5bWJvbCddLCBtYXJrZXRbJ25hbWUnXSk7XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBiYXNlSWQgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoR2xvYmFsIChjdXJ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biAgICAgICAgICAgIGlmIChwcmljZUtleSBpbiB0aWNrZXIpXG4gICAgICAgICAgICAgICAgaWYgKHRpY2tlcltwcmljZUtleV0pXG4gICAgICAgICAgICAgICAgICAgIGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCBwcmljZUtleSk7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IHZvbHVtZUtleSA9ICcyNGhfdm9sdW1lXycgKyBtYXJrZXRbJ3F1b3RlSWQnXTtcbiAgICAgICAgICAgIGlmICh2b2x1bWVLZXkgaW4gdGlja2VyKVxuICAgICAgICAgICAgICAgIGlmICh0aWNrZXJbdm9sdW1lS2V5XSlcbiAgICAgICAgICAgICAgICAgICAgdm9sdW1lID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgdm9sdW1lS2V5KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsb3cnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAnY2hhbmdlJzogY2hhbmdlLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChjdXJyZW5jeSA9ICdVU0QnLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdsaW1pdCc6IDEwMDAwLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoY3VycmVuY3kpXG4gICAgICAgICAgICByZXF1ZXN0Wydjb252ZXJ0J10gPSBjdXJyZW5jeTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgdCA9IDA7IHQgPCByZXNwb25zZS5sZW5ndGg7IHQrKykge1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHJlc3BvbnNlW3RdO1xuICAgICAgICAgICAgbGV0IGlkID0gdGlja2VyWydpZCddICsgJy8nICsgY3VycmVuY3k7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICA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ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmN5WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBuYW1lID0gY3VycmVuY3lbJ25hbWUnXTtcbiAgICAgICAgICAgIC8vIHRvZG86IHdpbGwgbmVlZCB0byByZXRoaW5rIHRoZSBmZWVzXG4gICAgICAgICAgICAvLyB0byBhZGQgc3VwcG9ydCBmb3IgbXVsdGlwbGUgd2l0aGRyYXdhbC9kZXBvc2l0IG1ldGhvZHMgYW5kXG4gICAgICAgICAgICAvLyBkaWZmZXJlbnRpYXRlZCBmZWVzIGZvciBlYWNoIHBhcnRpY3VsYXIgbWV0aG9kXG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0gODsgLy8gZGVmYXVsdCBwcmVjaXNpb24sIHRvZG86IGZpeCBcIm1hZ2ljIGNvbnN0YW50c1wiXG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY3VycmVuY3lDb2RlIChpZCwgbmFtZSk7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBuYW1lLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsIC8vIHRvZG86IHJlZGVzaWduXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1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gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJCb29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5XaXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luRGVwb3NpdEFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5SW5zdGFudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5TGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcldpdGhJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGVWb3VjaGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWRlZW1Wb3VjaGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsSW5zdGFudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbExpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbkhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VuY29uZmlybWVkQml0Y29pbkRlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnQlRDX0VVUicsICdzeW1ib2wnOiAnQlRDL0VVUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdFVVInLCAncHJlY2lzaW9uJzogeyAnYW1vdW50JzogNCwgJ3ByaWNlJzogMiB9fSxcbiAgICAgICAgICAgICAgICAnQlRDL0NaSyc6IHsgJ2lkJzogJ0JUQ19DWksnLCAnc3ltYm9sJzogJ0JUQy9DWksnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ1pLJywgJ3ByZWNpc2lvbic6IHsgJ2Ftb3VudCc6IDQsICdwcmljZSc6IDIgfX0sXG4gICAgICAgICAgICAgICAgJ0xUQy9CVEMnOiB7ICdpZCc6ICdMVENfQlRDJywgJ3N5bWJvbCc6ICdMVEMvQlRDJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ0JUQycsICdwcmVjaXNpb24nOiB7ICdhbW91bnQnOiA0LCAncHJpY2UnOiA1IH19LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAzNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuX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vdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYW1vdW50J10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAoIW1hcmtldClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFt0cmFkZVsnY3VycmVuY3lQYWlyJ11dO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RyYW5zYWN0aW9uSWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdHJhZGVbJ3RpbWVzdGFtcCddLFxuICAgICAgICAgICAgJ2Rh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IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdtYXJrZXQnKSB7XG4gICAgICAgICAgICBpZiAoc2lkZSA9PSAnYnV5JylcbiAgICAgICAgICAgICAgICBvcmRlclsndG90YWwnXSA9IGFtb3VudDsgLy8gYW1vdW50IGluIGZpYXRcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBvcmRlclsnYW1vdW50J10gPSBhbW91bnQ7IC8vIGFtb3VudCBpbiBmaWF0XG4gICAgICAgICAgICBtZXRob2QgKz0gJ0luc3RhbnQnO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb3JkZXJbJ2Ftb3VudCddID0gYW1vdW50OyAvLyBhbW91bnQgaW4gY3J5cHRvXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICAgICAgbWV0aG9kICs9IHRoaXMuY2FwaXRhbGl6ZSAodHlwZSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdIChzZWxmLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydkYXRhJ10udG9TdHJpbmcgKCksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLnByaXZhdGVQb3N0Q2FuY2VsT3JkZXIgKHsgJ29yZGVySWQnOiBpZCB9KTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG5vbmNlICsgdGhpcy51aWQgKyB0aGlzLmFwaUtleTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2NsaWVudElkJzogdGhpcy51aWQsXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ3B1YmxpY0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICA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GNoYW5nZSB7XG5cbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnY29pbnNlY3VyZScsXG4gICAgICAgICAgICAnbmFtZSc6ICdDb2luc2VjdXJlJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnSU4nLCAvLyBJbmRpYVxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NDcyLTljYmQyMDBhLTVlZDktMTFlNy05NTUxLTIyNjdhZDdiYWMwOC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuY29pbnNlY3VyZS5pbicsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2NvaW5zZWN1cmUuaW4nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS5jb2luc2VjdXJlLmluJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9jb2luc2VjdXJlL3BsdWdpbnMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luL3NlYXJjaC9jb25maXJtYXRpb24ve3R4aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9hc2svbG93JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9hc2svb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9iaWQvaGlnaCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYmlkL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvbGFzdFRyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9tYXgyNEhyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9taW4yNEhyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZmEvYXV0aHkvY2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWZhL2F1dGh5L3NtcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbmV0a2kvc2VhcmNoL3tuZXRraU5hbWV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2Jhbmsvb3RwL3tudW1iZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2t5Yy9vdHAve251bWJlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJvZmlsZS9waG9uZS9vdHAve251bWJlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vYWRkcmVzcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2RlcG9zaXQvY29uZmlybWVkL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9kZXBvc2l0L2NvbmZpcm1lZC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2RlcG9zaXQvdW5jb25maXJtZWQvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2RlcG9zaXQvdW5jb25maXJtZWQve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi93YWxsZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvYmFsYW5jZS9hdmFpbGFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2JhbGFuY2UvcGVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvYmFsYW5jZS90b3RhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvZGVwb3NpdC9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2RlcG9zaXQvdW52ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvZGVwb3NpdC92ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L3ZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Fzay9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYXNrL2NvbXBsZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9hc2svcGVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iaWQvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmlkL3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vYmFsYW5jZS9hdmFpbGFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2JhbGFuY2UvcGVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vYmFsYW5jZS90b3RhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vZGVwb3NpdC9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2RlcG9zaXQvdW52ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vZGVwb3NpdC92ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L3ZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Jhbmsvc3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9jb2luL2ZlZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9maWF0L2ZlZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9reWNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL3JlZmVycmFsL2NvaW4vcGFpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9yZWZlcnJhbC9jb2luL3N1Y2Nlc3NmdWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvcmVmZXJyYWwvZmlhdC9wYWlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL3JlZmVycmFscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS90cmFkZS9zdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2xvZ2luL3Rva2VuL3t0b2tlbn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvc3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvc3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2NvaW4vd2l0aGRyYXcvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvY29pbi93aXRoZHJhdy9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC9jb2luL3dpdGhkcmF3L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC9jb2luL3dpdGhkcmF3L3ZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9naW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvZ2luL2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2dpbi9wYXNzd29yZC9mb3Jnb3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21mYS9hdXRoeS9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWZhL2dhL2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzaWdudXAnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbmV0a2kvdXBkYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Byb2ZpbGUvaW1hZ2UvdXBkYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvbmV3VmVyaWZ5Y29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvaW5pdGlhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L25ld1ZlcmlmeWNvZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcGFzc3dvcmQvY2hhbmdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Bhc3N3b3JkL3Jlc2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL3dpdGhkcmF3L2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvY29pbi93aXRoZHJhdy9uZXdWZXJpZnljb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzaWdudXAvdmVyaWZ5L3t0b2tlbn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2Uva3ljJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9kZXBvc2l0L25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9hc2svbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvaW5zdGFudC9idXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvaW5zdGFudC9zZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy92ZXJpZnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2FjY291bnQvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy92ZXJpZnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWZhL2F1dGh5L2luaXRpYXRlL2VuYWJsZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9tZmEvZ2EvaW5pdGlhdGUvZW5hYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL25ldGtpL2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL3Bob25lL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9hZGRyZXNzL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vd2l0aGRyYXcvc2VuZFRvRXhjaGFuZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vd2l0aGRyYXcvdmVyaWZ5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2djbS97Y29kZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbG9nb3V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy91bnZlcmlmaWVkL2NhbmNlbC97d2l0aGRyYXdJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2RlcG9zaXQvY2FuY2VsL3tkZXBvc2l0SUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Fzay9jYW5jZWwve29yZGVySUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9jYW5jZWwve29yZGVySUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy91bnZlcmlmaWVkL2NhbmNlbC97d2l0aGRyYXdJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWZhL2F1dGh5L2Rpc2FibGUve2NvZGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21mYS9nYS9kaXNhYmxlL3tjb2RlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL3Bob25lL2RlbGV0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL2ltYWdlL2RlbGV0ZS97bmV0a2lOYW1lfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi93aXRoZHJhdy91bnZlcmlmaWVkL2NhbmNlbC97d2l0aGRyYXdJRH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9JTlInOiB7ICdpZCc6ICdCVEMvSU5SJywgJ3N5bWJvbCc6ICdCVEMvSU5SJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0lOUicgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC40IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjQgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0VXNlckV4Y2hhbmdlQmFua1N1bW1hcnkgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ21lc3NhZ2UnXTtcbiAgICAgICAgbGV0IGNvaW4gPSB7XG4gICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ2F2YWlsYWJsZUNvaW5CYWxhbmNlJ10sXG4gICAgICAgICAgICAndXNlZCc6IGJhbGFuY2VbJ3BlbmRpbmdDb2luQmFsYW5jZSddLFxuICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZVsndG90YWxDb2luQmFsYW5jZSddLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgZmlhdCA9IHtcbiAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZVsnYXZhaWxhYmxlRmlhdEJhbGFuY2UnXSxcbiAgICAgICAgICAgICd1c2VkJzogYmFsYW5jZVsncGVuZGluZ0ZpYXRCYWxhbmNlJ10sXG4gICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWyd0b3RhbEZpYXRCYWxhbmNlJ10sXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc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AgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBoZWFkZXJzID0geyAnQXV0aG9yaXphdGlvbic6IHRoaXMuYXBpS2V5IH07XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgaGVhZGVyc1snQ29udGVudC1UeXBlJ10gPSAnYXBwbGljYXRpb24vanNvbic7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGNvZGUgPT0gMjAwKSB7XG4gICAgICAgICAgICBpZiAoKGJvZHlbMF0gPT0gJ3snKSB8fCAoYm9keVswXSA9PSAnWycpKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgc3VjY2VzcyA9IHJlc3BvbnNlWydzdWNjZXNzJ107XG4gICAgICAgICAgICAgICAgICAgIGlmICghc3VjY2Vzcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGVycm9yIHJldHVybmVkOiAnICsgYm9keSk7XG4gICAgICAgICAgICAgICAgICAgIH1c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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIGNvaW5zcG90IGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2NvaW5zcG90JyxcbiAgICAgICAgICAgICduYW1lJzogJ0NvaW5TcG90JyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQVUnLCAvLyBBdXN0cmFsaWFcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjgyMDg0MjktM2NhY2RmOWEtNjg5Ni0xMWU3LTg1NGUtNGM3OWE3NzJhMzBmLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3d3dy5jb2luc3BvdC5jb20uYXUvcHViYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cuY29pbnNwb3QuY29tLmF1L2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmNvaW5zcG90LmNvbS5hdScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5jb2luc3BvdC5jb20uYXUvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGF0ZXN0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9jb2luL2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L2NvaW4vc2VuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGUvYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZS9zZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9iYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9idXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L2J1eS9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L3NlbGwvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvQVVEJzogeyAnaWQnOiAnQlRDJywgJ3N5bWJvbCc6ICdCVEMvQVVEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0FVRCcgfSxcbiAgICAgICAgICAgICAgICAnTFRDL0FVRCc6IHsgJ2lkJzogJ0xUQycsICdzeW1ib2wnOiAnTFRDL0FVRCcsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdBVUQnIH0sXG4gICAgICAgICAgICAgICAgJ0RPR0UvQVVEJzogeyAnaWQnOiAnRE9HRScsICdzeW1ib2wnOiAnRE9HRS9BVUQnLCAnYmFzZSc6ICdET0dFJywgJ3F1b3RlJzogJ0FVRCcgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE15QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgaWYgKCdiYWxhbmNlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzKTtcbiAgICAgICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VzW2N1cnJlbmN5XSxcbiAgICAgICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VzW2N1cnJlbmN5XSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGlmICh1cHBlcmNhc2UgPT0gJ0RSSycpXG4gICAgICAgICAgIC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oKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IHJlc3BvbnNlWydwcmljZXMnXVtpZF07XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbm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5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuY3J5cHRvcGlhLmNvLm56L2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5jcnlwdG9waWEuY28ubnonLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5jcnlwdG9waWEuY28ubnovRm9ydW0vQ2F0ZWdvcnkvNDUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuY3J5cHRvcGlhLmNvLm56L0ZvcnVtL1RocmVhZC8yNTUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuY3J5cHRvcGlhLmNvLm56L0ZvcnVtL1RocmVhZC8yNTYnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEN1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYWRlUGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0cy97aG91cnN9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRzL3tpZH0ve2hvdXJzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldC97aWR9L3tob3Vyc30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldEhpc3Rvcnkve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0SGlzdG9yeS97aWR9L3tob3Vyc30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldE9yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRPcmRlcnMve2lkfS97Y291bnR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRPcmRlckdyb3Vwcy97aWRzfS97Y291bnR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxUcmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0RGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTdWJtaXRUaXAnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1N1Ym1pdFRyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTdWJtaXRUcmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3VibWl0V2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KSB7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQ0MnKVxuICAgICAgICAgICAgcmV0dXJuICdDQ1gnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0ZDTicpXG4gICAgICAgICAgICByZXR1cm4gJ0ZhY2lsZWNvaW4nO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ05FVCcpXG4gICAgICAgICAgICByZXR1cm4gJ05ldENvaW4nO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0JURycpXG4gICAgICAgICAgICByZXR1cm4gJ0JpdGdlbSc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnRlVFTCcpXG4gICAgICAgICAgICByZXR1cm4gJ0ZDMic7IC8vIEZ1ZWxDb2luICE9IEZVRUxcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdXUkMnKVxuICAgICAgICAgICAgcmV0dXJuICdXYXJDb2luJztcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGN1cnJlbmN5SWQgKGN1cnJlbmN5KSB7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQ0NYJylcbiAgICAgICAgICAgIHJldHVybiAnQ0MnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0ZhY2lsZWNvaW4nKVxuICAgICAgICAgICAgcmV0dXJuICdGQ04nO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ05ldENvaW4nKVxuICAgICAgICAgICAgcmV0dXJuICdORVQnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0JpdGdlbScpXG4gICAgICAgICAgICByZXR1cm4gJ0JURyc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnRkMyJylcbiAgICAgICAgICAgIHJldHVybiAnRlVFTCc7IC8vIEZ1ZWxDb2luICE9IEZVRUxcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVQYWlycyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydEYXRhJ107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ0lkJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydMYWJlbCddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFtb3VudExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydNaW5pbXVtVHJhZGUnXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydNYXhpbXVtVHJhZGUnXVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydNaW5pbXVtUHJpY2UnXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydNYXhpbXVtUHJpY2UnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnRMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IG1hcmtldFsnU3RhdHVzJ10gPT0gJ09LJztcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogbWFya2V0WydUcmFkZUZlZSddIC8gMTAwLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IG1hcmtldFsnVHJhZGVGZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAnbG90JzogYW1vdW50TGltaXRzWydtaW4nXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRPcmRlcnNJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMubWFya2V0SWQgKH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ICB9IGVsc2UgaWYgKCdUaW1lU3RhbXAnIGluIHRyYWRlKSB7XG4gICAgICAgICAgICB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodHJhZGVbJ1RpbWVTdGFtcCddKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdQcmljZScpO1xuICAgICAgICBpZiAoIXByaWNlKVxuICAgICAgICAgICAgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdSYXRlJyk7XG4gICAgICAgIGxldCBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnVG90YWwnKTtcbiAgICAgICAgbGV0IGlkID0gdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ1RyYWRlSWQnKTtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGlmICgnVHJhZGVQYWlySWQnIGluIHRyYWRlKVxuICAgICAgICAgICAgICAgIGlmICh0cmFkZVsnVHJhZGVQYWlySWQnXSBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFt0cmFkZVsnVHJhZGVQYWlySWQnXV07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGZlZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGlmICgnRmVlJyBpbiB0cmFkZSkge1xuICAgICAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHRyYWRlWydGZWUnXSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ1R5cGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydBbW91bnQnXSxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBob3VycyA9IDI0OyAvLyB0aGUgZGVmYXVsdFxuICAgICAgICBpZiAoc2luY2UpIHtcbiAgICAgICAgICAgIGxldCBlbGFwc2VkID0gdGhpcy5taWxsaXNlY29uZHMgKCkgLSBzaW5jZTtcbiAgICAgICAgICAgIGxldCBob3VyID0gMTAwMCAqIDYwICogNjA7XG4gICAgICAgICAgICBob3VycyA9IHBhcnNlSW50IChlbGFwc2VkIC8gaG91cik7XG4gICAgICAgIH1cb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gICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ05hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5WydXaXRoZHJhd0ZlZSddLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnTWluQmFzZVRyYWRlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnTWluV2l0aGRyYXcnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBjdXJyZW5jeVsnTWF4V2l0aGRyYXcnXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydEYXRhJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYWxhbmNlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tpXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gYmFsYW5jZVsnU3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY29kZSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ0F2YWlsYWJsZSddLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VbJ1RvdGFsJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAg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lc3QsIHBhcmFtcykpO1xuICAgICAgICBpZiAoIXJlc3BvbnNlKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGNyZWF0ZU9yZGVyIHJldHVybmVkIHVua25vd24gZXJyb3I6ICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgIGxldCBpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGZpbGxlZCA9IDAuMDtcbiAgICAgICAgaWYgKCdEYXRhJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCdPcmRlcklkJyBpbiByZXNwb25zZVsnRGF0YSddKSB7XG4gICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydEYXRhJ11bJ09yZGVySWQnXSkge1xuICAgICAgICAgICAgICAgICAgICBpZCA9IHJlc3BvbnNlWydEYXRhJ11bJ09yZGVySWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoJ0ZpbGxlZE9yZGVycycgaW4gcmVzcG9uc2VbJ0RhdGEnXSkge1xuICAgICAgICAgICAgICAgIGxldCBmaWxsZWRPcmRlcnMgPSByZXNwb25zZVsnRGF0YSddWydGaWxsZWRPcmRlcnMnXTtcbiAgICAgICAgICAgICAgICBsZXQgZmlsbGVkT3JkZXJzTGVuZ3RoID0gZmlsbGVkT3JkZXJzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBpZiAoZmlsbGVkT3JkZXJzTGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBwcmljZSAqIGFtb3VudCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAvLyAndHJhZGVzJzogdGhpcy5wYXJzZVRyYWRlcyAob3JkZXJbJ3RyYWRlcyddLCBtYXJrZXQpLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoaWQpXG4gICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSBvcmRlcjtcbiAgICAgICAgcmV0dXJuIHRoaXMuZXh0ZW5kICh7ICdpbmZvJzogcmVzcG9uc2UgfSwgb3JkZXIpO1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxUcmFkZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnVHlwZSc6ICdUcmFkZScsXG4gICAgICAgICAgICAgICAgJ09yZGVySWQnOiBpZCxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMub3JkZXJzKVxuICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXVsnc3RhdHVzJ10gPSAnY2FuY2VsZWQnO1xuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5sYXN0X2pzb25fcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAodGhpcy5sYXN0X2pzb25fcmVzcG9uc2UsICdFcnJvcicpO1xuICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlLmluZGV4T2YgKCdkb2VzIG5vdCBleGlzdCcpID49IDApXG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAodGhpcy5pZCArICcgY2FuY2VsT3JkZXIoKSBlcnJvcjogJyArIHRoaXMubGFzdF9odHRwX3Jlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIH0gZWxzZSBpZiAoJ01hcmtldCcgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGxldCBpZCA9IG9yZGVyWydNYXJrZXQnXTtcbiAgICA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XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiBvcmRlclsnYW1vdW50J10gKiBvcmRlclsncHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWxsZWQnOiBvcmRlclsnYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVtYWluaW5nJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSB0aGlzLm9yZGVyc1tpZF07XG4gICAgICAgICAgICBpZiAob3JkZXJbJ3N5bWJvbCddID09IHN5bWJvbClcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAob3JkZXIpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLmZpbHRlckJ5U2luY2VMaW1pdCAocmVzdWx0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlkID0gaWQudG9TdHJpbmcgKCk7XG4gICAgICAgIGxldCBvcmRlcnMgPSBhd2FpdCB0aGlzLmZldGNoT3JkZXJzIChzeW1ib2wsIHVuZGVmaW5lZCwgdW5kZWZpbmVkLCBwYXJhbXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG9yZGVycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKG9yZGVyc1tpXVsnaWQnXSA9PSBpZClcbiAgICAgICAgICAgICAgICByZXR1cm4gb3JkZXJzW2ldO1xuICAgICAgICB9XG4gICAgICAgIHRocm93IG5ldyBP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AgICAgICAgICAgICAgICAgICAnZHdhcGknOiAnaHR0cHM6Ly9kc3gudWsvZHdhcGknLCAvLyBkZXBvc2l0L3dpdGhkcmF3XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vZHN4LnVrJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkuZHN4LnVrJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZHN4LnVrL2FwaV9kb2NzL3B1YmxpYycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2RzeC51ay9hcGlfZG9jcy9wcml2YXRlJyxcbiAgICAgICAgICAgICAgICAgICAgJycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgIC8vIG1hcmtldCBkYXRhIChwdWJsaWMpXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYXJzRnJvbU1vbWVudC97aWR9L3twZXJpb2R9L3tzdGFydH0nLCAvLyBlbXB0eSByZXBseSA6XFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhc3RCYXJzL3tpZH0ve3BlcmlvZH0ve2Ftb3VudH0nLCAvLyBwZXJpb2QgaXMgKG0sIGggb3IgZClcbiAgICAgICAgICAgICAgICAgICAgICAgICdwZXJpb2RCYXJzL3tpZH0ve3BlcmlvZH0ve3N0YXJ0fS97ZW5kfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAvLyB0cmFkaW5nIChwcml2YXRlKVxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFuc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY3RpdmVPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAvLyBkZXBvc2l0IC8gd2l0aGRyYXcgKHByaXZhdGUpXG4gICAgICAgICAgICAgICAgJ2R3YXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRDcnlwdG9EZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3J5cHRvV2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpYXRXaXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VHJhbnNhY3Rpb25TdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGdldEJhc2VRdW90ZUZ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AndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NDkxLTFiMGVhOTU2LTVlZGEtMTFlNy05MjI1LTQwZDY3YjQ4MWI4ZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuZXhtby5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9leG1vLm1lJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9leG1vLm1lL2VuL2FwaV9kb2MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL2V4bW8tZGV2L2V4bW9fYXBpX2xpYi90cmVlL21hc3Rlci9ub2RlanMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9leG1vLmNvbS9lbi9kb2NzL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcl9zZXR0aW5ncycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfY3JlYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX2NhbmNlbGxlZF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVxdWlyZWRfYW1vdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2NyeXB0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19nZXRfdHhpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjb2RlX2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjb2RlX2xvYWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldF9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0ZGhyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dBVkVTJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDI1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogMzUwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogNTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQYWlyU2V0dGluZ3MgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1twXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZC5yZXBsYWNlICgnXycsICcvJyk7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbWluX3F1YW50aXR5J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhfcXVhbnRpdHknXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbWluX3ByaWNlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhfcHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydtaW5fYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhfYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RVc2VySW5mbyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiByZXNwb25zZVsnYmFsYW5jZXMnXSlcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBwYXJzZUZsb2F0IChyZXNwb25zZVsnYmFsYW5jZXMnXVtjdXJyZW5jeV0pO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIHJlc3BvbnNlWydyZXNlcnZlZCddKVxuICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHBhcnNlRmxvYXQgKHJlc3BvbnNlWydyZXNlcnZlZCddW2N1cnJlbmN5XSk7XG4gICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgY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AgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYnV5X3ByaWNlJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnc2VsbF9wcmljZSddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdF90cmFkZSddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogcGFyc2VGbG9hdCAodGlja2VyWydhdmcnXSksXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2xfY3VyciddKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblx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odHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndHJhZGVfaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsncXVhbnRpdHknXSksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2VbbWFya2V0WydpZCddXSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBwcmVmaXggPSAnJztcbiAgICAgICAgaWYgKHR5cGUgPT0gJ21hcmtldCcpXG4gICAgICAgICAgICBwcmVmaXggPSAnbWFya2V0Xyc7XG4gICAgICAgIGlmICh0eXBlb2YgcHJpY2UgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgcHJpY2UgPSAwO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAncXVhbnRpdHknOiBhbW91bnQsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICd0eXBlJzogcHJlZml4ICsgc2lkZSxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE9yZGVyQ3JlYXRlICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydvcmRlcl9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG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HRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7ICdub25jZSc6IG5vbmNlIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdTaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgaWYgKCdyZXN1bHQnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBpZiAocmVzcG9uc2VbJ3Jlc3VsdCddKVxuICAgICAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVyb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waSc6ICdodHRwczovL2FwaS5mbG93YnRjLmNvbTo4NDAwL2FqYXgnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly90cmFkZXIuZmxvd2J0Yy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cDovL3d3dy5mbG93YnRjLmNvbS5ici9hcGkvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZXNCeURhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9yZGVyQm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0UHJvZHVjdFBhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRQcm9kdWN0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ3JlYXRlQWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VXNlckluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NldFVzZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRBY2NvdW50SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QWNjb3VudFRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0RGVwb3NpdEFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NyZWF0ZU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNb2RpZnlPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbEFsbE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QWNjb3VudE9wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9yZGVyRmVlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNQb3N0R2V0UHJvZHVjdFBhaXJzICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydwcm9kdWN0UGFpcnMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsncHJvZHVjdDFMYWJlbCddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0Wydwcm9kdWN0MkxhYmVsJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0QWNjb3VudEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydjdXJyZW5jaWVzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ25hbWUnXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZVsnYmFsYW5jZSddLFxuICAgICAgICAgICAgICAgICd1c2VkJzogYmFsYW5jZVsnaG9sZCddLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IDAuMCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBhY2NvdW50Wyd0b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gICAgICAgbGV0IHRpbWVzdGFtcCA9IHRyYWRlWyd1bml4dGltZSddICogMTAwMDtcbiAgICAgICAgbGV0IHNpZGUgPSAodHJhZGVbJ2luY29taW5nT3JkZXJTaWRlJ10gPT0gMCkgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydweCddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydxdHknXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNQb3N0R2V0VHJhZGVzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lucyc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdzdGFydEluZGV4JzogLTEsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuIC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G4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2ZveGJpdC5leGNoYW5nZScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JsaW5rdHJhZGUuY29tL2RvY3MnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tZW50JzogJ0JsaW5rdHJhZGUgQVBJJyxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3l9L3RpY2tlcicsICAgIC8vID9jcnlwdG9fY3VycmVuY3k9QlRDXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5fS9vcmRlcmJvb2snLCAvLyA/Y3J5cHRvX2N1cnJlbmN5PUJUQ1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeX0vdHJhZGVzJywgICAgLy8gP2NyeXB0b19jdXJyZW5jeT1CVEMmc2luY2U9PFRJTUVTVEFNUD4mbGltaXQ9PE5VTUJFUj5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdEJywgICAvLyBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0YnLCAgIC8vIGNhbmNlbCBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ1UyJywgIC8vIGJhbGFuY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICdVNCcsICAvLyBteSBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdVNicsICAvLyB3aXRoZHJhd1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1UxOCcsIC8vIGRlcG9zaXRcbiAgICAgICAgICAgICAgICAgICAgIC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XG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMuZXh0ZW5kICh7ICdNc2dUeXBlJzogcGF0aCB9LCBxdWVyeSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChyZXF1ZXN0KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0FQSUtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdOb25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdTaWduYXR1cmUnOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChub25jZSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmIC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WFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1MTItMzEwMTk3NzItNWVkYi0xMWU3LTgyNDEtMmU2NzVlNjc5N2YxLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5meWJzZS5zZS9hcGkvU0VLJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmZ5YnNlLnNlJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHA6Ly9kb2NzLmZ5Yi5hcGlhcnkuaW8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcmRldGFpbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YWNjaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0cGVuZGluZ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0b3JkZXJoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxwZW5kaW5nb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3J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AgICAgICdsb3cnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0cmFkZVsnZGF0ZSddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCdd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gICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLnByaXZhdGVQb3N0Q2FuY2VscGVuZGluZ29yZGVyICh7ICdvcmRlck5vJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSAnLmpzb24nO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoeyAndGltZXN0YW1wJzogbm9uY2UgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAna2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ3NpZyc6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGJvZHkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMScpXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdt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kVycm9yIH0gPSByZXF1aXJlICgnLi9iYXNlL2Vycm9ycycpXG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBnYXRlY29pbiBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdnYXRlY29pbicsXG4gICAgICAgICAgICAnbmFtZSc6ICdHYXRlY29pbicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwMCxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnSEsnLCAvLyBIb25nIEtvbmdcbiAgICAgICAgICAgICdjb21tZW50JzogJ2EgcmVndWxhdGVkL2xpY2Vuc2VkIGV4Y2hhbmdlJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNW0nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaCcsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMjRoJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4NjQ2ODE3LTUwODQ1N2YyLTcyNmMtMTFlNy05ZWViLTM1MjhkMjQxM2E1OC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuZ2F0ZWNvaW4uY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vZ2F0ZWNvaW4uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9nYXRlY29pbi5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9HYXRlY29pbi9SRVNUZnVsLUFQSS1JbXBsZW1lbnRhdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS5nYXRlY29pbi5jb20vc3dhZ2dlci11aS9pbmRleC5odG1sJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdQdWJsaWMvRXhjaGFuZ2VSYXRlJywgLy8gR2V0IHRoZSBleGNoYW5nZSByYXRlc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1B1YmxpYy9MaXZlVGlja2VyJywgLy8gR2V0IGxpdmUgdGlja2VyIGZvciBhbGwgY3VycmVuY3lcbiAgICAgICAgICAgICAgICAgICAgICAgICdQdWJsaWMvTGl2ZVRpY2tlci97Q3VycmVuY3lQYWlyfScsIC8vIEdldCBsaXZlIHRpY2tlciBieSBjdXJyZW5jeVxuICAgICAgICAgICAgICAgICAgICAgICAgJ1B1YmxpYy9MaXZlVGlja2VycycsIC8vIEdldCBsaXZlIHRpY2tlciBmb3IgYWxsIGN1cnJlbmN5XG4gICAgICAgICAgICAgICAgICAgICAgICAnUHVibGljL01hcmtldERlcHRo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YXRlXG4gICAgICAgICAgICAgICAgICAgICAgICAnUGluZycsIC8vIFBvc3QgYSBzdHJpbmcsIHRoZW4gZ2V0IGl0IGJhY2suXG4gICAgICAgICAgICAgICAgICAgICAgICAnUHVibGljL1Vuc3Vic2NyaWJlL3tFbWFpbENvZGV9JywgLy8gTGV0cyB0aGUgdXNlciB1bnN1YnNjcmliZSBmcm9tIGVtYWlsc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZ2lzdGVyVXNlcicsIC8vIEluaXRpYWwgdHJhZGVyIHJlZ2lzdHJhdGlvbi5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvQ29ycG9yYXRlRGF0YScsIC8vIEdldCBjb3Jwb3JhdGUgYWNjb3VudCBkYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudEFkZHJlc3MnLCAvLyBDaGVjayBpZiByZXNpZGVuY2UgcHJvb2YgdXBsb2FkZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50Q29ycG9yYXRpb24nLCAvLyBDaGVjayBpZiByZWdpc3RlcmVkIGRvY3VtZW50IHVwbG9hZGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudElEJywgLy8gQ2hlY2sgaWYgSUQgZG9jdW1lbnQgY29weSB1cGxvYWRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRJbmZvcm1hdGlvbicsIC8vIEdldCBTdGVwMyBEYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9FbWFpbCcsIC8vIEdldCB1c2VyIGVtYWlsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9GZWVSYXRlJywgLy8gR2V0IGZlZSByYXRlIG9mIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9MZXZlbCcsIC8vIEdldCB2ZXJpZiBsZXZlbCBvZiBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUGVyc29uYWxJbmZvcm1hdGlvbicsIC8vIEdldCBTdGVwMSBEYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9QaG9uZScsIC8vIEdldCB1c2VyIHBob25lIG51bWJlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUHJvZmlsZScsIC8vIEdldCB0cmFkZXIgcHJvZmlsZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUXVlc3Rpb25uYWlyZScsIC8vIEZpbGwgdGhlIHF1ZXN0aW9ubmFpcmVcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1JlZmVycmFsJywgLy8gR2V0IHJlZmVycmFsIGluZm9ybWF0aW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJhbENvZGUnLCAvLyBHZXQgdGhlIHJlZmVycmFsIGNvZGUgb2YgdGhlIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJhbE5hbWVzJywgLy8gR2V0IG5hbWVzIG9mIHJlZmVycmVkIHRyYWRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1JlZmVycmFsUmV3YXJkJywgLy8gR2V0IHJlZmVycmFsIHJld2FyZCBpbmZvcm1hdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyZWRDb2RlJywgLy8gR2V0IHJlZmVycmFsIGNvZGVcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1Jlc2lkZW50SW5mb3Jt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XG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9FbWFpbC9SZXF1ZXN0VmVyaWZ5JywgLy8gUmVxdWVzdCBmb3IgdmVyaWZpY2F0aW9uIGVtYWlsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9FbWFpbC9WZXJpZnknLCAvLyBWZXJpZmljYXRpb24gZW1haWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0dvb2dsZUF1dGgnLCAvLyBFbmFibGUgZ29vZ2xlIGF1dGhcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0xldmVsJywgLy8gUmVxdWVzdCB2ZXJpZiBsZXZlbCBvZiBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUXVlc3Rpb25uYWlyZScsIC8vIEZpbGwgdGhlIHF1ZXN0aW9ubmFpcmVcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1JlZmVycmFsJywgLy8gUG9zdCBhIHJlZmVycmFsIGVtYWlsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVBJS2V5L0FQSUtleScsIC8vIENyZWF0ZSBhIG5ldyBBUEkga2V5IGZvciBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0F1dGgvQ2hhbmdlUGFzc3dvcmQnLCAvLyBDaGFuZ2UgcGFzc3dvcmQuXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXV0aC9Gb3Jnb3RQYXNzd29yZCcsIC8vIFJlcXVlc3QgcmVzZXQgcGFzc3dvcmRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBdXRoL0ZvcmdvdFVzZXJJRCcsIC8vIFJlcXVlc3QgdXNlciBpZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0F1dGgvTG9naW4nLCAvLyBUcmFkZXIgc2Vzc2lvbiBsb2cgaW4uXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXV0aC9Mb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gICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRJRCcsIC8vIFVwZGF0ZSBJRCBkb2N1bWVudCBtZXRhIGRhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50SW5mb3JtYXRpb24nLCAvLyBVcGRhdGUgU3RlcDMgRGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRW1haWwnLCAvLyBVcGRhdGUgdXNlciBlbWFpbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUGVyc29uYWxJbmZvcm1hdGlvbicsIC8vIFVwZGF0ZSBTdGVwMSBEYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9QaG9uZScsIC8vIFVwZGF0ZSB1c2VyIHBob25lIG51bWJlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUXVlc3Rpb25uYWlyZScsIC8vIHVwZGF0ZSB0aGUgcXVlc3Rpb25uYWlyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyZWRDb2RlJywgLy8gVXBkYXRlIHJlZmVycmFsIGNvZGVcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1Jlc2lkZW50SW5mb3JtYXRpb24nLCAvLyBVcGRhdGUgU3RlcDIgRGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvU2VjdXJpdHlTZXR0aW5ncycsIC8vIFVwZGF0ZSB2ZXJpZiBkZXRhaWxzIG9mIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Vc2VyJywgLy8gVXBkYXRlIGFsbCB1c2VyIGluZm9cbiAgICAgICAgICAgICAgICAgICAgICAgICdCYW5rL1VzZXJBY2NvdW50cycsIC8vIFVwZGF0ZSB0aGUgbGFiZWwgb2YgZXhpc3RpbmcgdXNlciBiYW5rIGFjY291bm50XG4gICAgICAgICAgICAgIC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xldGUgYW4gZGlnaXRhbCBjdXJyZW5jeSBhZGRyZXNzZXMgcmVsYXRlZCB0byB0aGUgbG9nZ2VkIGluIHVzZXIuXG4gICAgICAgICAgICAgICAgICAgICAgICAnRWxlY3Ryb25pY1dhbGxldC9Vc2VyV2FsbGV0cy97RGlnaUN1cnJlbmN5fS97QWRkcmVzc05hbWV9JywgLy8gRGVsZXRlIGFuIGV4dGVybmFsIGRpZ2l0YWwgY3VycmVuY3kgYWRkcmVzc2VzIHJlbGF0ZWQgdG8gdGhlIGxvZ2dlZCBpbiB1c2VyLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlL09yZGVycycsIC8vIENhbmNlbHMgYWxsIGV4aXN0aW5nIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUvT3JkZXJzL3tPcmRlcklEfScsIC8vIENhbmNlbHMgYW4gZXhpc3Rpbmcgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZS9TdG9wT3JkZXJzJywgLy8gQ2FuY2VscyBhbGwgZXhpc3Rpbmcgc3RvcCBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZS9TdG9wT3JkZXJzL3tJRH0nLCAvLyBDYW5jZWxzIGFuIGV4aXN0aW5nIHN0b3Agb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAzNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQdWJsaWNMaXZlVGlja2VycyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsndGlja2VycyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2N1cnJlbmN5UGFpciddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRCYWxhbmNlQmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydhdmFpbGFibGVCYWxhbmNlJ10sXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiB0aGlzLnN1bSAoXG4gICAgICAgICAgICAgICAgICAgIGJhbGFuY2VbJ3BlbmRpbmdJbmNvbWluZyddLFxuICAgICAgICAgICAgICAgICAgICBiYWxhbmNlWydwZW5kaW5nT3V0Z29pbmcnXSxcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVsnb3Blbk9yZGVyJ10pLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VbJ2JhbGFuY2UnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQdWJsaWNNYXJrZXREZXB0aEN1cnJlbmN5UGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdDdXJyZW5jeVBhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcyk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B9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlU3RyaW5nID0gbm9uY2UudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgY29udGVudFR5cGUgPSAobWV0aG9kID09ICdHRVQnKSA/ICcnIDogJ2FwcGxpY2F0aW9uL2pzb24nO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBtZXRob2QgKyB1cmwgKyBjb250ZW50VHlwZSArIG5vbmNlU3RyaW5nO1xuICAgICAgICAgICAgYXV0aCA9IGF1dGgudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGEyNTYnLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBUElfUFVCTElDX0tFWSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdBUElfUkVRVUVTVF9TSUdOQVRVUkUnOiB0aGlzLmRlY29kZSAoc2lnbmF0dXJlKSxcbiAgICAgICAgICAgICAgICAnQVBJX1JFUVVFU1RfREFURSc6IG5vbmNlU3RyaW5nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgIT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICBoZWFkZXJzWydDb250ZW50LVR5cGUnXSA9IGNvbnRlbnRUeXBlO1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHRoaXMuZXh0ZW5kICh7ICdub25jZSc6IG5vbmNlIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB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8gZXh0ZW5kcyBidGVyIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdnYXRlaW8nLFxuICAgICAgICAgICAgJ25hbWUnOiAnR2F0ZS5pbycsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0NOJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMTc4NDAyOS0wMzEzYzcwMi1iNTA5LTExZTctOWNjYy1iYzBkYTZhMGU0MzUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vZGF0YS5nYXRlLmlvL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vZGF0YS5nYXRlLmlvL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vZ2F0ZS5pby8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9nYXRlLmlvL2FwaTInLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vZ2F0ZS5pby9mZWUnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICAvLyBleGNoYW5nZSByZXBvcnRzIGxvY2FsIHRpbWUgKFVUQys4KVxuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydkYXRlJ10pIC0g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KSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnZ2RheCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdHREFYJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnVVMnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndXNlckFnZW50JzogdGhpcy51c2VyQWdlbnRzWydjaHJvbWUnXSxcbiAgICAgICAgICAgIC8vIG9ic29sZXRlIG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0RlcG9zaXQnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAvLyBuZXcgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiA2MCxcbiAgICAgICAgICAgICAgICAnNW0nOiAzMDAsXG4gICAgICAgICAgICAgICAgJzE1bSc6IDkwMCxcbiAgICAgICAgICAgICAgICAnMzBtJzogMTgwMCxcbiAgICAgICAgICAgICAgICAnMWgnOiAzNjAwLFxuICAgICAgICAgICAgICAgICcyaCc6IDcyMDAsXG4gICAgICAgICAgICAgICAgJzRoJzogMTQ0MDAsXG4gICAgICAgICAgICAgICAgJzEyaCc6IDQzMjAwLFxuICAgICAgICAgICAgICAgICcxZCc6IDg2NDAwLFxuICAgICAgICAgICAgICAgICcxdyc6IDYwNDgwMCxcbiAgICAgICAgICAgICAgICAnMU0nOiAyNTkyMDAwLFxuICAgICAgICAgICAgICAgICcxeSc6IDMxNTM2MDAwLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICd0ZXN0JzogJ2h0dHBzOi8vYXBpLXB1YmxpYy5zYW5kYm94LmdkYXguY29tJyxcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTI3LWIxYmU0MWM2LTVlZGItMTFlNy05NWY2LTViNDk2YzQ2OWUyYy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuZ2RheC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuZ2RheC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9kb2NzLmdkYXguY29tJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmdkYXguY29tL2ZlZXMnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9zdXBwb3J0LmdkYXguY29tL2N1c3RvbWVyL2VuL3BvcnRhbC90b3BpY3MvOTM5NDAyLWRlcG9zaXRpbmctYW5kLXdpdGhkcmF3aW5nLWZ1bmRzL2FydGljbGVzJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwYXNzd29yZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9L2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0vY2FuZGxlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS9zdGF0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aW1lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L2hvbGRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L2xlZGdlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29pbmJhc2UtYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpbGxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50LW1ldGhvZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXBvcnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJzL3NlbGYvdHJhaWxpbmctdm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMvY29pbmJhc2UtYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMvcGF5bWVudC1tZXRob2QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmcvcmVwYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2ZpbGVzL21hcmdpbi10cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVwb3J0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMvY29pbmJhc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL2NyeXB0bycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMvcGF5bWVudC1tZXRob2QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiB0cnVlLCAvLyBjb21wbGljYXRlZCB0aWVyIHN5c3RlbSBwZXIgY29pblxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4zMCAvIDEwMCwgLy8gd29yc3QtY2FzZSBzY2VuYXJpbzogaHR0cHM6Ly93d3cuZ2RheC5jb20vZmVlcy9CVEMtVVNEXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAwLjE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRCc6IDI1LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAuMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogMTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQcm9kdWN0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ2Jhc2VfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncXVvdGVfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgYW1vdW50TGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ2Jhc2VfbWluX3NpemUnXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydiYXNlX21heF9zaXplJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByaWNlTGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ3F1b3RlX2luY3JlbWVudCddLFxuICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGNvc3RMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IHByaWNlTGltaXRzWydtaW4nXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudExpbWl0cyxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZUxpbWl0cyxcbiAgICAgICAgICAgICAgICAnY29zdCc6IGNvc3RMaW1pdHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogLU1hdGgubG9nMTAgKHBhcnNlRmxvYXQgKGFtb3VudExpbWl0c1snbWluJ10pKSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiAtTWF0aC5sb2cxMCAocGFyc2VGbG9hdCAocHJpY2VMaW1pdHNbJ21pbiddKSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHRha2VyID0gdGhpcy5mZWVzWyd0cmFkaW5nJ11bJ3Rha2VyJ107XG4gICAgICAgICAgICBpZiAoKGJhc2UgPT0gJ0VUSCcpIHx8IChiYXNlID09ICdMVEMnKSkge1xuICAgICAgICAgICAgICAgIHRha2VyID0gMC4wMDM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gbWFya2V0WydzdGF0dXMnXSA9PSAnb25saW5lJztcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogdGFrZXIsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ2N1cnJlbmN5J107XG4g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1xuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQcm9kdWN0c0lkVGlja2VyIChyZXF1ZXN0KTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0aWNrZXJbJ3RpbWUnXSk7XG4gICAgICAgIGxldCBiaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBhc2sgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnYmlkJyBpbiB0aWNrZXIpXG4gICAgICAgICAgICBiaWQgPSBwYXJzZUZsb2F0ICh0aWNrZXJbJ2JpZCddKTtcbiAgICAgICAgaWYgKCdhc2snIGluIHRpY2tlcilcbiAgICAgICAgICAgIGFzayA9IHBhcnNlRmxvYXQgKHRpY2tlclsnYXNrJ10pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsb3cnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkJzogYmlkLFxuICAgICAgICAgICAgJ2Fzayc6IGFzayxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdwcmljZScpLFxuICAgICAgICAgICAgJ2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U9ITENWcyAocmVzcG9uc2UsIG1hcmtldCwgdGltZWZyYW1lLCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGltZSAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IHRoaXMucHVibGljR2V0VGltZSAoKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2U4NjAxIChyZXNwb25zZVsnaXNvJ10pO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJTdGF0dXMgKHN0YXR1cykge1xuICAgICAgICBsZXQgc3RhdHVzZXMgPSB7XG4gICAgICAgICAgICAncGVuZGluZyc6ICdvcGVuJyxcbiAgICAgICAgICAgICdhY3RpdmUnOiAnb3BlbicsXG4gICAgICAgICAgICAnb3Blbic6ICdvcGVuJyxcbiAgICAgICAgICAgICdkb25lJzogJ2Nsb3NlZCcsXG4gICAgICAgICAgICAnY2FuY2VsZWQnOiAnY2FuY2VsZWQnLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gdGhpcy5zYWZlU3RyaW5nIChzdGF0dXNlcywgc3RhdHVzLCBzdGF0dXMpO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxIChvcmRlclsnY3JlYXRlZF9hdCddKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGlmIChvcmRlclsncHJvZHVjdF9pZCddIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbb3JkZXJbJ3Byb2R1Y3RfaWQnXV07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHN0YXR1cyA9IHRoaXMucGFyc2VPcmRlclN0YXR1cyAob3JkZXJbJ3N0YXR1cyddKTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3NpemUnKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2ZpbGxlZF9zaXplJyk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSBhbW91bnQgLSBmaWxsZWQ7XG4gICAgICAgIGxldCBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZXhlY3V0ZWRfdmFsdWUnKTtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnaWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgf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IHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAobWV0aG9kID09ICdHRVQnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgcmVxdWVzdCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgcmVxdWVzdDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBwYXlsb2FkID0gJyc7XG4gICAgICAgICAgICBpZiAobWV0aG9kICE9ICdHRVQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICAgICAgcGF5bG9hZCA9IGJvZHk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gbGV0IHBheWxvYWQgPSAoYm9keSkgPyBib2R5IDogJyc7XG4gICAgICAgICAgICBsZXQgd2hhdCA9IG5vbmNlICsgbWV0aG9kICsgcmVxdWVzdCArIHBheWxvYWQ7XG4gICAgICAgICAgICBsZXQgc2VjcmV0ID0gdGhpcy5iYXNlNjRUb0JpbmFyeSAodGhpcy5zZWNyZXQpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHdoYXQpLCBzZWNyZXQsICdzaGEyNTYnLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDQi1BQ0NFU1MtS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0NCLUFDQ0VTUy1TSUdOJzogdGhpcy5kZWNvZGUgKHNpZ25hdHVyZSksXG4gICAgICAgICAgICAgICAgJ0NCLUFDQ0VTUy1USU1FU1RBTVAnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnQ0ItQUNDRVNTLVBBU1NQSFJBU0UnOiB0aGlzLnBhc3N3b3JkLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09IDQwMCkge1xuICAgICAgICAgICAgaWYgKGJvZHlbMF0gPT0gXCJ7XCIpIHtcbiAgICAgICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHJlc3BvbnNlWydtZXNzYWdlJ107XG4gICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ3ByaWNlIHRvbyBzbWFsbCcpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZS5pbmRleE9mICgncHJpY2UgdG9vIHByZWNpc2UnKSA+PSAwKSB7XG4gICAg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y5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzgxNjg1Ny1jZTdiZTY0NC02MDk2LTExZTctODJkNi0zYzI1NzI2MzIyOWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmdlbWluaS5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9nZW1pbmkuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9kb2NzLmdlbWluaS5jb20vcmVzdC1hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9kb2NzLnNhbmRib3guZ2VtaW5pLmNvbScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAndGVzdCc6ICdodHRwczovL2FwaS5zYW5kYm94LmdlbWluaS5jb20nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9nZW1pbmkuY29tL2ZlZS1zY2hlZHVsZS8nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9nZW1pbmkuY29tL3RyYW5zZmVyLWZlZXMvJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2xzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwdWJ0aWNrZXIve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXVjdGlvbi97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXVjdGlvbi97c3ltYm9sfS9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsL3Nlc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteXRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGV2b2x1bWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0L3tjdXJyZW5jeX0vbmV3QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGVhcnRiZWF0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFN5bWJvbHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IGlkO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IG1hcmtldC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdXBwZXJjYXNlLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHVwcGVyY2FzZS5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMjVcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0Qm9va1N5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYmlkcycsICdhc2tzJywgJ3ByaWNlJywg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ZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUnXVtiYXNlVm9sdW1lXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3ZvbHVtZSddW3F1b3RlVm9sdW1lXSksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndGltZXN0YW1wbXMnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICB9O1xuICAgI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AgICAgICAgICAgICAne3N5bWJvbH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7c3ltYm9sfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tzeW1ib2x9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3N5bWJvbH0vdHJhZGVzL3JlY2VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9scycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aW1lLCdcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9hY3RpdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9yZWNlbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvYnkvb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ25ld19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwYXltZW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3Mve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMve3RyYW5zYWN0aW9ufScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyX3RvX3RyYWRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyX3RvX21haW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3Mve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5b3V0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogLTAuMDEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMDg1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDQyc6IDAuMDAxOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMjE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAxOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICcxU1QnOiAwLjg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEWCc6IDUuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRSc6IDYuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRU9OJzogMC4wMTAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSVInOiA1NjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU1QJzogOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTlQnOiA2LjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJEUic6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJOJzogMTguNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUlQnOiAyNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEInOiAwLjAwMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRMJzogMjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRNJzogNTA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUUyc6IDg2MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAxLjksXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFTJzogMTEzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDTic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCRVQnOiAxMjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQktCJzogNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1DJzogMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1UJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDIuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlFYJzogNC43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUWCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVTJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0NUJzogMTE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEVCc6IDEwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRFgnOiAzMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRkknOiA2MSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTEQnOiAwLjg4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NORCc6IDU3NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTlgnOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPU1MnOiA2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDU05PJzogMTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RSJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RYJzogMTQ2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NWQyc6IDguNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREJJWCc6IDAuMDE2OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ04nOiAxMjAwMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENUJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEREYnOiAzNDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREVOVCc6IDYyNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdCJzogMC40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHRCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRElDRSc6IDAuMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRExUJzogMC4yNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlQnOiAwLjIxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPVic6IDM0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSUFUnOiAyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlQnOiAyNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFNIJzogMC4wMTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJFVCc6IDg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVEMnOiAyMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQlRDT0xEJzogNi42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VDQVQnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFREcnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDIuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTEUnOiAwLjAwMTcyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMTSc6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNQyc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1HTyc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOSic6IDE2MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAxLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRCUyc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDUuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWE4nOiA0NTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlJEJzogNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVFTCc6IDEyMy4wMDEwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAyMDIuOTU5ODMwOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWU4nOiAxLjg0OSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWVAnOiA2Ni4xMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLjAwMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1VQJzogNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVlQnOiAxLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEFDJzogMTQ0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hERyc6IDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEdUJzogMTA4MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdIUEMnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFZOJzogMTIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAuNTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPUyc6IDAuMzUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5EJzogNzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5ESSc6IDU5MTMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVRTJzogMTUuMDAxMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdJWFQnOiAxMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLQlInOiAxNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0lDSyc6IDExMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQSc6IDQxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBVCc6IDEuNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElGRSc6IDEzMDAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDI3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xTSyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVU4nOiAwLjM0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BSUQnOiA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BTkEnOiAxNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNBUCc6IDUuNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlQUyc6IDQzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ORSc6IDEuMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVNQJzogMTIxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDkyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ZQic6IDMuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOREMnOiAxNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVCTCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVUJzogMy45NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVE8nOiA5OTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhDJzogMTMuMzksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPQVgnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPRE4nOiAwLjAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09QVCc6IDMzNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUk1FJzogMi44LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09UTic6IDAuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFZJzogMy4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJWCc6IDk2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMQlQnOiAwLjMzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMUic6IDExNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFUnOiAwLjg3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPRSc6IDc4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0xMJzogMy41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQVCc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJFJzogMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJHJzogMzksXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJPJzogNDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJTJzogNjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFRPWSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVUnOiA2MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQ04nOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FWVCc6IDY0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUCc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUktDJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlZUJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMi4yNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQkQnOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NDTCc6IDIuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSVNBJzogMTY0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS0lOJzogNDA3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNQVJUJzogMC40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNUyc6IDAuMDM3NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkMnOiAzNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogNDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMjMzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NURUVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RVJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RYJzogMTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VCJzogMTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VSJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTV1QnOiAwLjUxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RBQVMnOiAwLjkxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RCVCc6IDIuMzcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEZMJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElNRSc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElYJzogNy4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RLTic6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtSJzogODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5UJzogOTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJTVCc6IDEuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAxMzk1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VFVCc6IDQ4MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVR1QnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRVJJJzogMC4wMzcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCJzogNTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCRSc6IDE0NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT0lTRSc6IDYxOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXRUFMVEgnOiAwLjAxNjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOR1MnOiAyLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMC43NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVVSJzogMy4yMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRE4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hFTSc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hVQyc6IDAuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdZT1lPVyc6IDE0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaQVAnOiAyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAyMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaU0MnOiAxOTEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnMVNUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRU9OJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUkRSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUk4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JBUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCRVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JLQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlFYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVE0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQ1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRkknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NMRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05EJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPU1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NTTk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RCSVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEREYnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RFTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdESUNFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9WJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlBVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RTSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJFVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQ09MRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUNBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRE8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNR08nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOSic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFUk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQlMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VYTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlJEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVUVMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRllQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dVUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1ZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIQUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hERyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEdUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIUEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hWTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ08nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDT1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lORCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5ESSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVRTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJWFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tCUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0lDSyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEEnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElGRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFJDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMU0snOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xVTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFJRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFOQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNBUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlQUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU5FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNU1AnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVlCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOREMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FQkwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlRPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05YVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0FYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPRE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1BUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUk1FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPVE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BBWSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUElYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTEJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0xMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFRPWSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSS0MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NDTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0lTQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0tJTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01BUlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NURUVNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTV1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RBQVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RCVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEZMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSU1FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RLTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSU1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVR1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVSSSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUJFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT0lTRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0VBTFRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXSU5HUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVVSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hFTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFVDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdZT1lPVyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkFQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pTQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdYQlQnKVxuICAgICAgICAgICAgcmV0dXJuICdCVEMnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0RSSycpXG4gICAgICAgICAgICByZXR1cm4gJ0RBU0gnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0NBVCcpXG4gICAgICAgICAgICByZXR1cm4gJ0JpdENsYXZlJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdVU0QnKVxuICAgICAgICAgICAgcmV0dXJuICdVU0RUJztcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRTeW1ib2xzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1snc3ltYm9scyddLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1snc3ltYm9scyddW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBtYXJrZXRbJ2NvbW1vZGl0eSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBtYXJrZXRbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgbG90ID0gcGFyc2VGbG9hdCAobWFya2V0Wydsb3QnXSk7XG4gICAgICAgICAgICBsZXQgc3RlcCA9IHBhcnNlRmxvYXQgKG1hcmtldFsnc3RlcCddKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdzdGVwJzogc3RlcCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ2xvdCddKSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ3N0ZXAnXSksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBzdGVwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtZXRob2QgPSB0aGlzLnNhZmVTdHJpbmcgKHBhcmFtcywgJ3R5cGUnLCAndHJhZGluZycpO1xuICAgICAgICBtZXRob2QgKz0gJ0dldEJhbGFuY2UnO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgJ3R5cGUnKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdIChxdWVyeSk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydiYWxhbmNlJ107XG4gICAgICAgIGxldCBy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ZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnb3JkZXJRdWFudGl0eScpO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncXVhbnRpdHlMZWF2ZXMnKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBhbW91bnQgKj0gbWFya2V0Wydsb3QnXTtcbiAgICAgICAgICAgIHJlbWFpbmluZyAqPSBtYXJrZXRbJ2xvdCddO1xuICAgICAgICB9XG4gICAgICAgIGlmIChhbW91bnQgJiYgcmVtYWluaW5nKSB7XG4gICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgICAgICBjb3N0ID0gYXZlcmFnZVByaWNlICogZmlsbGVkO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnY2xpZW50T3JkZXJJZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0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AgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IHsgJ25vbmNlJzogbm9uY2UsICdhcGlrZXknOiB0aGlzLmFwaUtleSB9O1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLmV4dGVuZCAocGF5bG9hZCwgcXVlcnkpO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJylcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBheWxvYWQpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB1cmw7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09ICdQT1NUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICAgICAgYXV0aCArPSBib2R5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgIC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AgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgIC8vIG5ldyBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICdNMScsXG4gICAgICAgICAgICAgICAgJzNtJzogJ00zJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnTTUnLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnTTE1JyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJ00zMCcsIC8vIGRlZmF1bHRcbiAgICAgICAgICAgICAgICAnMWgnOiAnSDEnLFxuICAgICAgICAgICAgICAgICc0aCc6ICdINCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJ0QxJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnRDcnLFxuICAgICAgICAgICAgICAgICcxTSc6ICcxTScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjU1NS04ZWFlYzIwZS01ZWRjLTExZTctOWM1Yi02ZGM2OWZjNDJmNWUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmhpdGJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9oaXRidGMuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYXBpLmhpdGJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9oaXRidGMuY29tL2ZlZXMtYW5kLWxpbWl0cycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3N1cHBvcnQuaGl0YnRjLmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDUxNDg2MDUtRmVlcy1hbmQtbGltaXRzJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2wnLCAvLyBBdmFpbGFibGUgQ3VycmVuY3kgU3ltYm9sc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbC97c3ltYm9sfScsIC8vIEdldCBzeW1ib2wgaW5mb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JywgLy8gQXZhaWxhYmxlIEN1cnJlbmNpZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeS97Y3VycmVuY3l9JywgLy8gR2V0IGN1cnJlbmN5IGluZm9cbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLCAvLyBUaWNrZXIgbGlzdCBmb3IgYWxsIHN5bWJvbHNcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3N5bWJvbH0nLCAvLyBUaWNrZXIgZm9yIHN5bWJvbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97c3ltYm9sfScsIC8vIFRyYWRlc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vay97c3ltYm9sfScsIC8vIE9yZGVyYm9va1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMve3N5bWJvbH0nLCAvLyBDYW5kbGVzXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsIC8vIExpc3QgeW91ciBjdXJyZW50IG9wZW4gb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIve2NsaWVudE9yZGVySWR9JywgLy8gR2V0IGEgc2luZ2xlIG9yZGVyIGJ5IGNsaWVudE9yZGVySWRcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nL2JhbGFuY2UnLCAvLyBHZXQgdHJhZGluZyBiYWxhbmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZy9mZWUve3N5bWJvbH0nLCAvLyBHZXQgdHJhZGluZyBmZWUgcmF0ZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnkvdHJhZGVzJywgLy8gR2V0IGhpc3RvcmljYWwgdHJhZGVzXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS9vcmRlcicsIC8vIEdldCBoaXN0b3JpY2FsIG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3Rvcnkvb3JkZXIve2lkfS90cmFkZXMnLCAvLyBHZXQgaGlzdG9yaWNhbCB0cmFkZXMgYnkgc3BlY2lmaWVkIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9iYWxhbmNlJywgLy8gR2V0IG1haW4gYWNjY291bnQgYmFsYW5jZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvdHJhbnNhY3Rpb25zJywgLy8gR2V0IGFjY291bnQgdHJhbnNhY3Rpb25zXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC90cmFuc2FjdGlvbnMve2lkfScsIC8vIEdldCBhY2NvdW50IHRyYW5zYWN0aW9uIGJ5IGlkXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9jcnlwdG8vYWRkcmVzcy97Y3VycmVuY3l9JywgLy8gR2V0IGRlcG9zaXQgY3J5cHJvIGFkZHJlc3NcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLCAvLyBDcmVhdGUgbmV3IG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9jcnlwdG8vd2l0aGRyYXcnLCAvLyBXaXRoZHJhdyBjcnlwcm9cbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by9hZGRyZXNzL3tjdXJyZW5jeX0nLCAvLyBDcmVhdGUgbmV3IGRlcG9zaXQgY3J5cHJvIGFkZHJlc3NcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3RyYW5zZmVyJywgLy8gVHJhbnNmZXIgYW1vdW50IHRvIHRyYWRpbmdcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci97Y2xpZW50T3JkZXJJZH0nLCAvLyBDcmVhdGUgbmV3IG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9jcnlwdG8vd2l0aGRyYXcve2lkfScsIC8vIENvbW1pdCB3aXRoZHJhdyBjcnlwcm9cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsIC8vIENhbmNlbCBhbGwgb3BlbiBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci97Y2xpZW50T3JkZXJJZH0nLCAvLyBDYW5jZWwgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by93aXRoZHJhdy97aWR9JywgLy8gUm9sbGJhY2sgd2l0aGRyYXcgY3J5cHJvXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwYXRjaCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci97Y2xpZW50T3JkZXJJZH0nLCAvLyBDYW5jZWwgUmVwbGFjZSBvcmRlclxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAtMC4wMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwODUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNDJzogMC4wMDE4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDAyMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDE4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAxMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLjA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJzFTVCc6IDAuODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQURYJzogNS43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFJzogNi43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFT04nOiAwLjAxMDA2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FJUic6IDU2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTVAnOiA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FOVCc6IDYuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUkRSJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUk4nOiAxOC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSVCc6IDI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUQic6IDAuMDAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEwnOiAyNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVE0nOiA1MDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRTJzogODYwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FWVCc6IDEuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQVMnOiAxMTMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNOJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFVCc6IDEyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCS0InOiA0NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTUMnOiAzMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTVQnOiAxMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk5UJzogMi41NyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUVgnOiA0LjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRNJzogNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRYJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVVMnOiAwLjAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQ1QnOiAxMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RUJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEWCc6IDMwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NGSSc6IDYxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NMRCc6IDAuODgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05EJzogNTc0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NOWCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ09TUyc6IDY1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NTTk8nOiAxNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFInOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFgnOiAxNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1ZDJzogOC40NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQklYJzogMC4wMTY4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDTic6IDEyMDAwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ1QnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RERic6IDM0MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdERU5UJzogNjI0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0InOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdEJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdESUNFJzogMC4zMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdETFQnOiAwLjI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROVCc6IDAuMjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9WJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJQVSc6IDI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSVCc6IDI0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEU0gnOiAwLjAxNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQkVUJzogODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQyc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVENPTEQnOiA2LjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUNBVCc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VERyc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMi45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMRSc6IDAuMDAxNzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxNJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1DJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUdPJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5KJzogMTYzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDEuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFUk8nOiAzNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEJTJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVZYJzogNS40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VYTic6IDQ1NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdGUkQnOiA2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVUVMJzogMTIzLjAwMTA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDIwMi45NTk4MzA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZTic6IDEuODQ5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZUCc6IDY2LjEzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOTyc6IDAuMDAzNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVVAnOiA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dWVCc6IDEuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdIQUMnOiAxNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSERHJzogNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIR1QnOiAxMDgyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hQQyc6IDAuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIVk4nOiAxMjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMC41NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ08nOiAzNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ09TJzogMC4zNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkQnOiA3NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkRJJzogNTkxMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJVFMnOiAxNS4wMDEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lYVCc6IDExLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tCUic6IDE0MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogMTEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBJzogNDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEFUJzogMS40NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSUZFJzogMTMwMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFJDJzogMjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFNLJzogMC4zLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xVTic6IDAuMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFJRCc6IDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFOQSc6IDE0MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQ0FQJzogNS40NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNSVBTJzogNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU5FJzogMS4zMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNU1AnOiAxMjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRIJzogOTIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVlCJzogMy45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05EQyc6IDE2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORUJMJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORVQnOiAzLjk2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05UTyc6IDk5OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWEMnOiAxMy4zOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWFQnOiAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09BWCc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09ETic6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1BUJzogMzM1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09STUUnOiAyLjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1ROJzogMC41NyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVknOiAzLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUElYJzogOTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExCVCc6IDAuMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExSJzogMTE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMVSc6IDAuODcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9FJzogNzg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPTEwnOiAzLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBUJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkUnOiAzMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkcnOiAzOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUk8nOiA0MSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUlMnOiA2MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQVE9ZJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FBVSc6IDYzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FDTic6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVZUJzogNjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdSS0MnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSVlQnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAyLjI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NCRCc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0NMJzogMi42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NJU0EnOiAxNjQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NLSU4nOiA0MDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01BUlQnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01TJzogMC4wMzc1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOQyc6IDM2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOR0xTJzogNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTk0nOiA0OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAyMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RFRU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUUkFUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFUnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFgnOiAxMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiAxNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVVInOiAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NXVCc6IDAuNTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEFBUyc6IDAuOTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEJUJzogMi4zNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdURkwnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSU1FJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSVgnOiA3LjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtOJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUS1InOiA4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTlQnOiA5MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlNUJzogMS42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDEzOTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUVUJzogNDgwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VHVCc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFTic6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFUkknOiAwLjAzNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUInOiA1MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUJFJzogMTQ1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZPSVNFJzogNjE4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dFQUxUSCc6IDAuMDE2OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXSU5HUyc6IDIuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXVEMnOiAwLjc1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hBVVInOiAzLjIzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hETic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEVNJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFVDJzogMC45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lPWU9XJzogMTQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pBUCc6IDI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pSWCc6IDIzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pTQyc6IDE5MSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJzFTVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQURYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUVPTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUlSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJEUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVE0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCS0InOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JNQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JRWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JVUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0NUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0ZJJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTEQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NORCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05YJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDT1NTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDU05PJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1ZDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQklYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRERGJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdERU5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0InOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRElDRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRExUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPVic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJQVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEU0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCRVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVENPTEQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VDQVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VERyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTEUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUdPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTkonOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEJTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVZYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZSRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVFTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05PJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEFDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIREcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hHVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFBDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIVk4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ09TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lOREknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lUUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVhUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLQlInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tJQ0snOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xJRkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFNLJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BSUQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BTkEnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DQVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01JUFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ORSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVNQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ZQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORUJMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05UTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09BWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0ROJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09QVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1JNRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1ROJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExCVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9MTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUlMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BUT1knOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FBVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUktDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NBTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0JEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQ0wnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NJU0EnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NLSU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNQVJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05HTFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVEVFTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RSQVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1dUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUQUFTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUQlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RGTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElNRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUS04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RLUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlNUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VFVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUdUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFUkknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVk9JU0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dFQUxUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOR1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEFVUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEROJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRU0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hVQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWU9ZT1cnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pBUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlJYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaU0MnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KSB7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnWEJUJylcbiAgICAgICAgICAgIHJldHVybiAnQlRDJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdEUksnKVxuICAgICAgICAgICAgcmV0dXJuICdEQVNIJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdDQVQnKVxuICAgICAgICAgICAgc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mVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ3RpY2tTaXplJ10pLFxuICAgICAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsncXVhbnRpdHlJbmNyZW1lbnQnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHRha2VyID0gcGFyc2VGbG9hdCAobWFya2V0Wyd0YWtlTGlxdWlkaXR5UmF0ZSddKTtcbiAgICAgICAgICAgIGxldCBtYWtlciA9IHBhcnNlRmxvYXQgKG1hcmtldFsncHJvdmlkZUxpcXVpZGl0eVJhdGUnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnc3RlcCc6IHN0ZXAsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogdGFrZXIsXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogbWFrZXIsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBzdGVwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90ICogc3RlcCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQ3VycmVuY2llcyAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEN1cnJlbmN5IChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmN5WydpZCddO1xuICAgICAgICAgICAgLy8gdG9kbzogd2lsbCBuZWVkIHRvIHJldGhpbmsgdGhlIGZlZXNcbiAgICAgICAgICAgIC8vIHRvIGFkZCBzdXBwb3J0IGZvciBtdWx0aXBsZSB3aXRoZHJhd2FsL2RlcG9zaXQgbWV0aG9kcyBhbmRcbiAgICAgICAgICAgIC8vIGRpZmZlcmVudGlhdGVkIGZlZXMgZm9yIGVhY2ggcGFydGljdWxhciBtZXRob2RcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSA4OyAvLyBkZWZhdWx0IHByZWNpc2lvbiwgdG9kbzogZml4IFwibWFnaWMgY29uc3RhbnRzXCJcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBwYXlpbiA9IGN1cnJlbmN5WydwYXlpbkVuYWJsZWQnXTtcbiAgICAgICAgICAgIGxldCBwYXlvdXQgPSBjdXJyZW5jeVsncGF5b3V0RW5hYmxlZCddO1xuICAgICAgICAgICAgbGV0IHRyYW5zZmVyID0gY3VycmVuY3lbJ3RyYW5zZmVyRW5hYmxlZCddO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IHBheWluICYmIHBheW91dCAmJiB0cmFuc2ZlcjtcbiAgICAgICAgICAgIGxldCBzdGF0dXMgPSAnb2snO1xuICAgICAgICAgICAgaWYgKCdkaXNhYmxlZCcgaW4gY3VycmVuY3kpXG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5WydkaXNhYmxlZCddKVxuICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSAnZGlzYWJsZWQnO1xuICAgICAgICAgICAgbGV0IHR5cGUgPSAoY3VycmVuY3lbJ2NyeXB0byddKSA/ICdjcnlwdG8nIDogJ2ZpYXQnO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAgICAgJ3BheWluJzogcGF5aW4sXG4gICAgICAgICAgICAgICAgJ3BheW91dCc6IHBheW91dCxcbiAgICAgICAgICAgICAgICAndHJhbnNmZXInOiB0cmFuc2ZlcixcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ2Z1bGxOYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsIC8vIHRvZG86IHJlZGVzaWduXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdHlwZSA9IHRoaXMuc2FmZVN0cmluZyAocGFyYW1zLCAndHlwZScsICd0cmFkaW5nJyk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZUdldCcgKyB0aGlzLmNhcGl0YWxpemUgKHR5cGUpICsgJ0JhbGFuY2UnO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzW21ldGhvZF0gKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjb2RlKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlJ10pLFxuICAgICAgICAgICAgICAgICd1c2VkJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsncmVzZXJ2ZWQnXSksXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogMC4wLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSB0aGlzLnN1bS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ZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2x1bWVRdW90ZScpLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGlja2Vycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSB0aWNrZXJbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiB0aWNrZXIpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRpY2tlclsnbWVzc2FnZSddKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodHJhZGVbJ3RpbWVzdGFtcCddKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGxldCBpZCA9IHRyYWRlWydzeW1ib2wnXTtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnZmVlJyBpbiB0cmFkZSkge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gbWFya2V0ID8gbWFya2V0WydxdW90ZSddIDogdW5kZWZpbmVkO1xuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAodHJhZGVbJ2ZlZSddKSxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG9yZGVySWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnY2xpZW50T3JkZXJJZCcgaW4gdHJhZGUpXG4gICAgICAgICAgICBvcmRlcklkID0gdHJhZGVbJ2NsaWVudE9yZGVySWQnXTtcbiAgICAgICAgbGV0IHByaWNlID0gcGFyc2VGbG9hdCAodHJhZGVbJ3ByaWNlJ10pO1xuICAgICAgICBsZXQgYW1vdW50ID0gcGFyc2VGbG9hdCAodHJhZGVbJ3F1YW50aXR5J10pO1xuICAgICAgICBsZXQgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXJJZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyY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AgICAgIH1cbiAgICAgICAgbGV0IGlkID0gb3JkZXJbJ2NsaWVudE9yZGVySWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgaWYgKHR5cGVvZiBwcmljZSA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm9yZGVycylcbiAgICAgICAgICAgICAgICBwcmljZSA9IHRoaXMub3JkZXJzW2lkXVsncHJpY2UnXTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVtYWluaW5nID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGZpbGxlZCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICByZW1haW5pbmcgPSBhbW91bnQgLSBmaWxsZWQ7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgY29zdCA9IGZpbGxlZCAqIHByaWNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogY3JlYXRlZCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAoY3JlYXRlZCksXG4gICAgICAgICAgICAnY3JlYXRlZCc6IGNyZWF0ZWQsXG4gICAgICAgICAgICAndXBkYXRlZCc6IHVwZGF0ZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IH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ICAgICAgICAgIGxldCBwYXlsb2FkID0gdGhpcy5lbmNvZGUgKHRoaXMuYXBpS2V5ICsgJzonICsgdGhpcy5zZWNyZXQpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLnN0cmluZ1RvQmFzZTY0IChwYXlsb2FkKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0F1dGhvcml6YXRpb24nOiBcIkJhc2ljIFwiICsgdGhpcy5kZWNvZGUgKGF1dGgpLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyB1cmw7XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09PSA0MDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdID09PSBcIntcIikge1xuICAgICAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2VbJ2Vycm9yJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gcmVzcG9uc2VbJ2Vycm9yJ11bJ21lc3NhZ2UnXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlID09PSAnT3JkZXIgbm90IGZvdW5kJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyBvcmRlciBub3QgZm91bmQgaW4gYWN0aXZlIG9yZGVycycpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnSW5zdWZmaWNpZW50IGZ1bmRzJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnRHVwbGljYXRlIGNsaWVudE9yZGVySWQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoJ2Vycm9yJyBpbiByZXNwb25zZSlcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICA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cxaCc6ICcwNjAnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxMDAnLFxuICAgICAgICAgICAgICAgICcxdyc6ICcyMDAnLFxuICAgICAgICAgICAgICAgICcxTSc6ICczMDAnLFxuICAgICAgICAgICAgICAgICcxeSc6ICc0MDAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1NjktMTVhYTdiOWEtNWVkZC0xMWU3LTllN2YtNDQ3OTFmNGVlNDljLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwOi8vYXBpLmh1b2JpLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5odW9iaS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2h1b2JpYXBpL0FQSV9Eb2NzX2VuL3dpa2knLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3N0YXRpY21hcmtldCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9X2tsaW5lX3twZXJpb2R9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfV97bGVuZ3RofScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsX3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3VzZG1hcmtldCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9X2tsaW5lX3twZXJpb2R9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfV97bGVuZ3RofScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsX3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3RyYWRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfYWNjb3VudF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eV9tYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxfbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9uZXdfZGVhbF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlcl9pZF9ieV90cmFkZV9pZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfY29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3dpdGhkcmF3X2NvaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF93aXRoZHJhd19jb2luX3Jlc3VsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcGF5bWVudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2xvYW5fYXZhaWxhYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfbG9hbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9DTlknOiB7ICdpZCc6ICdidGMnLCAnc3ltYm9sJzogJ0JUQy9DTlknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ05ZJywgJ3R5cGUnOiAnc3RhdGljbWFya2V0JywgJ2NvaW5UeXBlJzogMSB9LFxuICAgICAgICAgICAgICAgICdMVEMvQ05ZJzogeyAnaWQnOiAnbHRjJywgJ3N5bWJvbCc6ICdMVEMvQ05ZJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ0NOWScsICd0eXBlJzogJ3N0YXRpY21hcmtldCcsICdjb2luVHlwZSc6IDIgfSxcbiAgICAgICAgICAgICAgICAvLyAnQlRDL1VTRCc6IHsgJ2lkJzogJ2J0YycsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnLCAndHlwZSc6ICd1c2RtYXJrZXQnLCAgICAnY29pblR5cGUnOiAxIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMudHJhZGVQb3N0R2V0QWNjb3VudEluZm8gKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICA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YgKGFwaSA9PSAndHJhZGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIHVybCArPSAnL2FwaScgKyB0aGlzLnZlcnNpb247XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmtleXNvcnQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ2FjY2Vzc19rZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlZCc6IHRoaXMubm9uY2UgKCksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGxldCBxdWVyeVN0cmluZyA9IHRoaXMudXJsZW5jb2RlICh0aGlzLm9taXQgKHF1ZXJ5LCAnbWFya2V0JykpO1xuICAgICAgICAgICAgLy8gc2VjcmV0IGtleSBtdXN0IGJlIGFwcGVuZGVkIHRvIHRoZSBxdWVyeSBiZWZvcmUgc2lnbmluZ1xuICAgICAgICAgICAgcXVlcnlTdHJpbmcgKz0gJyZzZWNyZXRfa2V5PScgKyB0aGlzLnNlY3JldDtcbiAgICAgICAgICAgIHF1ZXJ5WydzaWduJ10gPSB0aGlzLmhhc2ggKHRoaXMuZW5jb2RlIChxdWVyeVN0cmluZykpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB1cmwgKz0gJy8nICsgYXBpICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpICsgJ19qc29uLmpzJztcbiAgICAg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oYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIC8vIG5ldyBtZXRhaW5mbyBzdHJ1Y3R1cmVcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hDTFYnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtaW4nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bWluJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bWluJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbWluJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnNjBtaW4nLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMXdlZWsnLFxuICAgICAgICAgICAgICAgICcxTSc6ICcxbW9uJyxcbiAgICAgICAgICAgICAgICAnMXknOiAnMXllYXInLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1NjktMTVhYTdiOWEtNWVkZC0xMWU3LTllN2YtNDQ3OTFmNGVlNDljLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5odW9iaS5wcm8nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaHVvYmkucHJvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2l0aHViLmNvbS9odW9iaWFwaS9BUElfRG9jcy93aWtpL1JFU1RfYXBpX3JlZmVyZW5jZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnbWFya2V0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3Rvcnkva2xpbmUnLCAvLyDojrflj5ZL57q/5pWw5o2uXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsL21lcmdlZCcsIC8vIOiOt+WPluiBmuWQiOihjOaDhShUaWNrZXIpXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLCAvLyDojrflj5YgTWFya2V0IERlcHRoIOaVsOaNrlxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJywgLy8g6I635Y+WIFRyYWRlIERldGFpbCDmlbDmja5cbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L3RyYWRlJywgLy8g5om56YeP6I635Y+W5pyA6L+R55qE5Lqk5piT6K6w5b2VXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsJywgLy8g6I635Y+WIE1hcmtldCBEZXRhaWwgMjTlsI/ml7bmiJDkuqTph4/mlbDmja5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL3N5bWJvbHMnLCAvLyDmn6Xor6Lns7vnu5/mlK/mjIHnmoTmiYDmnInkuqTmmJPlr7lcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb21tb24vY3VycmVuY3lzJywgLy8g5p+l6K+i57O757uf5pSv5oyB55qE5omA5pyJ5biB56eNXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL3RpbWVzdGFtcCcsIC8vIOafpeivouezu+e7n+W9k+WJjeaXtumXtFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9hY2NvdW50cycsIC8vIOafpeivouW9k+WJjeeUqOaIt+eahOaJgOaciei0puaItyjljbNhY2NvdW50LWlkKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvYWNjb3VudHMve2lkfS9iYWxhbmNlJywgLy8g5p+l6K+i5oyH5a6a6LSm5oi355qE5L2Z6aKdXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL3tpZH0nLCAvLyDmn6Xor6Lmn5DkuKrorqLljZXor6bmg4VcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMve2lkfS9tYXRjaHJlc3VsdHMnLCAvLyDmn6Xor6Lmn5DkuKrorqLljZXnmoTmiJDkuqTmmI7nu4ZcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMnLCAvLyDmn6Xor6LlvZPliY3lp5TmiZjjgIHljoblj7Llp5TmiZhcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9tYXRjaHJlc3VsdHMnLCAvLyDmn6Xor6LlvZPliY3miJDkuqTjgIHljoblj7LmiJDkuqRcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy93aXRoZHJhdy12aXJ0dWFsL2FkZHJlc3NlcycsIC8vIOafpeivouiZmuaLn+W4geaPkOeOsOWcsOWdgFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMvcGxhY2UnLCAvLyDliJvlu7rlubbmiafooYzkuIDkuKrmlrDorqLljZUgKOS4gOatpeS4i+WNle+8jCDmjqjojZDkvb/nlKgpXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzJywgLy8g5Yib5bu65LiA5Liq5paw55qE6K6i5Y2V6K+35rGCIO+8iOS7heWIm+W7uuiuouWNle+8jOS4jeaJp+ihjOS4i+WNle+8iVxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy97aWR9L3BsYWNlJywgLy8g5omn6KGM5LiA5Liq6K6i5Y2VIO+8iOS7heaJp+ihjOW3suWIm+W7uueahOiuouWNle+8iVxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy97aWR9L3N1Ym1pdGNhbmNlbCcsIC8vIOeUs+ivt+aSpOmUgOS4gOS4quiuouWNleivt+axglxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy9iYXRjaGNhbmNlbCcsIC8vIOaJuemHj+aSpOmUgOiuouWNlVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L2JhbGFuY2UvdHJhbnNmZXInLCAvLyDotYTkuqfliJLovaxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy93aXRoZHJhdy12aXJ0dWFsL2NyZWF0ZScsIC8vIOeUs+ivt+aPkOeOsOiZmuaLn+W4gVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwve2lkfS9wbGFjZScsIC8vIOehruiupOeUs+ivt+iZmuaLn+W4geaPkOeOsFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwve2lkfS9jYW5jZWwnLCAvLyDnlLPor7flj5bmtojmj5DnjrDomZrmi5/luIFcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDb21tb25TeW1ib2xzICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCBudW1NYXJrZXRzID0gbWFya2V0cy5sZW5ndGg7XG4gICAgICAgIGlmIChudW1NYXJrZXRzIDwgMSlcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBwdWJsaWNHZXRDb21tb25TeW1ib2xzIHJldHVybmVkIGVtcHR5IHJlc3BvbnNlOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydiYXNlLWN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsncXVvdGUtY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gYmFzZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBpZCA9IGJhc2VJZCArIHF1b3RlSWQ7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYW1vdW50LXByZWNpc2lvbiddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsncHJpY2UtcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gKGJhc2UgPT0gJ09NRycpID8gMCA6IDAuMiAvIDEwMDtcbiAgICAgICAgICAgIGxldCB0YWtlciA9IChiYXNlID09ICdPTUcnKSA/IDAgOiAwLjIgLyAxMDA7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAndGFrZXInOiB0YWtlcixcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBtYWtlcixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGxhc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnbGFzdCcgaW4gdGlja2VyKVxuICAgICAgICAgICAgbGFzdCA9IHRpY2tlclsnbGFzdCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGlmICgndHMnIGluIHRpY2tlcilcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRpY2tlclsndHMnXTtcbiAgICAgICAgbGV0IGJpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGFzayA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdiaWQnIGluIHRpY2tlcikge1xuICAgICAgICAgICAgaWYgKHRpY2tlclsnYmlkJ10pXG4gICAgICAgICAgICAgICAgYmlkID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlclsnYmlkJ10sIDApO1xuICAgICAgICB9XG4gICAgICAgIGlmICgnYXNrJyBpbiB0aWNrZXIpIHtcbiAgICAgICAgICAgIGlmICh0aWNrZXJbJ2FzayddKVxuICAgICAgICAgICAgICAgIGFzayA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXJbJ2FzayddLCAwKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRpY2tlclsnaGlnaCddLFxuICAgICAgICAgICAgJ2xvdyc6IHRpY2tlclsnbG93J10sXG4gICAgICAgICAgICAnYmlkJzogYmlkLFxuICAgICAgICAgICAgJ2Fzayc6IGFzayxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB0aWNrZXJbJ29wZW4nXSxcbiAgICAgICAgICAgICdjbG9zZSc6IHRpY2tlclsnY2xvc2UnXSxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHRpY2tlclsndm9sJ10sXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPS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Ghpcy5tYXJrZXRHZXREZXRhaWxNZXJnZWQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHJlc3BvbnNlWyd0aWNrJ10sIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ3RzJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ2RpcmVjdGlvbiddLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGVzRGF0YSAoZGF0YSwgbWFya2V0LCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGRhdGEubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCB0cmFkZXMgPSB0aG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xuICAgICAgICAgICAgICAgIHRoaXMuYWNjb3VudHMgPSBhd2FpdCB0aGlzLmZldGNoQWNjb3VudHMgKCk7XG4gICAgICAgICAgICAgICAgdGhpcy5hY2NvdW50c0J5SWQgPSB0aGlzLmluZGV4QnkgKHRoaXMuYWNjb3VudHMsICdpZCcpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLmFjY291bnRzO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQWNjb3VudHMgKCkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRBY2NvdW50QWNjb3VudHMgKCk7XG4gICAgICAgIHJldHVybiByZXNwb25zZVsnZGF0YSddO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkQWNjb3VudHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRBY2NvdW50c0lkQmFsYW5jZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMuYWNjb3VudHNbMF1bJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnZGF0YSddWydsaXN0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYWxhbmNlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tpXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc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RpYWwtZmlsbGVkJykge1xuICAgICAgICAgICAgcmV0dXJuICdvcGVuJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT0gJ2ZpbGxlZCcpIHtcbiAgICAgICAgICAgIHJldHVybiAnY2xvc2VkJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT0gJ2NhbmNlbGVkJykge1xuICAgICAgICAgICAgcmV0dXJuICdjYW5jZWxlZCc7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09ICdzdWJtaXR0ZWQnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ29wZW4nO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc2lkZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHR5cGUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBzdGF0dXMgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgndHlwZScgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGxldCBvcmRlclR5cGUgPSBvcmRlclsndHlwZSddLnNwbGl0ICgnLScpO1xuICAgICAgICAgICAgc2lkZSA9IG9yZGVyVHlwZVswXTtcbiAgICAgICAgICAgIHR5cGUgPSBvcmRlclR5cGVbMV07XG4gICAgICAgICAgICBzdGF0dXMgPSB0aGlzLnBhcnNlT3JkZXJTdGF0dXMgKG9yZGVyWydzdGF0ZSddKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdzeW1ib2wnIGluIG9yZGVyKSB7XG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydzeW1ib2wnXSBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IG1hcmtldElkID0gb3JkZXJbJ3N5bWJvbCddO1xuICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbbWFya2V0SWRdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IG9yZGVyWydjcmVhdGVkLWF0J107XG4gICAgICAgIGxldCBhbW91bnQgPSBwYXJzZUZsb2F0IChvcmRlclsnYW1vdW50J10pO1xuICAgICAgICBsZXQgZmlsbGVkID0gcGFyc2VGbG9hdCAob3JkZXJbJ2ZpZWxkLWFtb3VudCddKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IGFtb3VudCAtIGZpbGxlZDtcbiAgICAgICAgbGV0IHByaWNlID0gcGFyc2VGbG9hdCAob3JkZXJbJ3ByaWNlJ10pO1xuICAgICAgICBsZXQgY29zdCA9IHBhcnNlRmxvYXQgKG9yZGVyWydmaWVsZC1jYXNoLWFtb3VudCddKTtcbiAgICAgICAgbGV0IGF2ZXJhZ2UgPSAwO1xuICAgICAgICBpZiAoZmlsbGVkKVxuICAgICAgICAgICAgYXZlcmFnZSA9IHBhcnNlRmxvYXQgKGNvc3QgLyBmaWxsZWQpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZEFjY291bnRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdhY2NvdW50LWlkJzogdGhpcy5hY2NvdW50c1swXVsnaWQnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlICsgJy0nICsgdHlwZSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHR5cGUgPT0gJ2xpbWl0JylcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gdGhpcy5wcmljZVRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlKTtcbiAgICAgICAgbGV0IHJlc3Bv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AoKSwgJ1QnKTtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0gdGhpcy5rZXlzb3J0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdTaWduYXR1cmVNZXRob2QnOiAnSG1hY1NIQTI1NicsXG4gICAgICAgICAgICAgICAgJ1NpZ25hdHVyZVZlcnNpb24nOiAnMicsXG4gICAgICAgICAgICAgICAgJ0FjY2Vzc0tleUlkJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgIH0sIHF1ZXJ5KSk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IHRoaXMudXJsZW5jb2RlIChyZXF1ZXN0KTtcbiAgICAgICAgICAgIGxldCBwYXlsb2FkID0gWyBtZXRob2QsIHRoaXMuaG9zdG5hbWUsIHVybCwgYXV0aCBdLmpvaW4gKFwiXFxuXCIpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHBheWxvYWQpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMjU2JywgJ2Jhc2U2NCcpO1xuICAgICAgICAgICAgYXV0aCArPSAnJicgKyB0aGlzLnVybGVuY29kZSAoeyAnU2lnbmF0dXJlJzogc2lnbmF0dXJlIH0pO1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIGF1dGg7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09ICdQT1NUJykge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZi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L3d3dy5pbmRlcGVuZGVudHJlc2VydmUuY29tL0FQSScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkUHJpbWFyeUN1cnJlbmN5Q29kZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkU2Vjb25kYXJ5Q3VycmVuY3lDb2RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRMaW1pdE9yZGVyVHlwZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkTWFya2V0T3JkZXJUeXBlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRPcmRlclR5cGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRWYWxpZFRyYW5zYWN0aW9uVHlwZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldFN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9yZGVyQm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVIaXN0b3J5U3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0UmVjZW50VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRGeFJhdGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdQbGFjZUxpbWl0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BsYWNlTWFya2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRDbG9zZWRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldENsb3NlZEZpbGxlZE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3JkZXJEZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRBY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREaWdpdGFsQ3VycmVuY3lEZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0RGlnaXRhbEN1cnJlbmN5RGVwb3NpdEFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3luY2hEaWdpdGFsQ3VycmVuY3lEZXBvc2l0QWRkcmVzc1dpdGhCbG9ja2NoYWluJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0RpZ2l0YWxDdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVxdWVzdEZpYXRXaXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgYmFzZUN1cnJlbmNpZXMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFZhbGlkUHJpbWFyeUN1cnJlbmN5Q29kZXMgKCk7XG4gICAgICAgIGxldCBxdW90ZUN1cnJlbmNpZXMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFZhbGlkU2Vjb25kYXJ5Q3VycmVuY3lDb2RlcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhc2VDdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gYmFzZUN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgYmFzZUlkVXBwZXJjYXNlID0gYmFzZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkVXBwZXJjYXNlKTtcbiAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgcXVvdGVDdXJyZW5jaWVzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBxdW90ZUN1cnJlbmNpZXNbal07XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlSWRVcHBlcmNhc2UgPSBxdW90ZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkVXBwZXJjYXNlKTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBiYXNlSWQgKyAnLycgKyBxdW90ZUlkO1xuICAgICAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICAgICAgbGV0IHRha2VyID0gMC41IC8gMTAwO1xuICAgICAgICAgICAgICAgIGxldCBtYWtlciA9IDAuNSAvIDEwMDtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiB0YWtlcixcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogbWFrZXIsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogaWQsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRBY2NvdW50cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2ldO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5Q29kZSA9IGJhbGFuY2VbJ0N1cnJlbmN5Q29kZSddO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5Q29kZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlICh1cHBlcmNhc2UpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBiYWxhbmNlWydBdmFpbGFibGVCYW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Ghpcy5wYXJzZTg2MDEgKHRpY2tlclsnQ3JlYXRlZFRpbWVzdGFtcFV0YyddKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGlja2VyWydEYXlIaWdoZXN0UHJpY2UnXSxcbiAgICAgICAgICAgICdsb3cnOiB0aWNrZXJbJ0RheUxvd2VzdFByaWNlJ10sXG4gICAgICAgICAgICAnYmlkJzogdGlja2VyWydDdXJyZW50SGlnaGVzdEJpZFByaWNlJ10sXG4gICAgICAgICAgICAnYXNrJzogdGlja2VyWydDdXJyZW50TG93ZXN0T2ZmZXJQcmljZSddLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGlja2VyWydMYXN0UHJpY2UnXSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdGlja2VyWydEYXlBdmdQcmljZSddLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aWNrZXJbJ0RheVZvbHVtZVhidEluU2Vjb25kYXJ5Q3VycnJlbmN5J10sXG4gICAgICAg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0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh7ICdvcmRlckd1aWQnOiBpZCB9KTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gW1xuICAgICAgICAgICAgICAgIHVybCxcbiAgICAgICAgICAgICAgICAnYXBpS2V5PScgKyB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2U9JyArIG5vbmNlLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgXTtcbiAgICAgICAgICAgIGxldCBrZXlzb3J0ZWQgPSB0aGlzLmtleXNvcnQgKHBhcmFtcyk7XG4gICAgICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChrZXlzb3J0ZWQpO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGtleSA9IGtleXNbaV07XG4gICAgICAgICAgIC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ICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5pdGJpdC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS5pdGJpdC5jb20vZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5pdGJpdC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3tzeW1ib2x9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy97c3ltYm9sfS9vcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3tzeW1ib2x9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9iYWxhbmNlcy97Y3VycmVuY3lDb2RlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L2Z1bmRpbmdfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0X3RyYW5zZmVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L2NyeXB0b2N1cnJlbmN5X2RlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0vY3J5cHRvY3VycmVuY3lfd2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpcmVfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvVVNEJzogeyAnaWQnOiAnWEJUVVNEJywgJ3N5bWJvbCc6ICdCVEMvVVNEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1VTRCcgfSxcbiAgICAgICAgICAgICAgICAnQlRDL1NHRCc6IHsgJ2lkJzogJ1hCVFNHRCcsICdzeW1ib2wnOiAnQlRDL1NHRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdTR0QnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdYQlRFVVInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJyB9LFxuICAgICAg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hlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIGJvZHkgPSAnJztcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgdGltZXN0YW1wID0gbm9uY2U7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IFsgbWV0aG9kLCB1cmwsIGJvZHksIG5vbmNlLCB0aW1lc3RhbXAgXTtcbiAgICAgICAgICAgIGxldCBtZXNzYWdlID0gbm9uY2UgKyB0aGlzLmpzb24gKGF1dGgpO1xuICAgICAgICAgICAgbGV0IGhhc2ggPSB0aGlzLmhhc2ggKHRoaXMuZW5jb2RlIChtZXNzYWdlKSwgJ3NoYTI1NicsICdiaW5hcnknKTtcbiAgICAgICAgICAgIGxldCBiaW5oYXNo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dkb2MnOiAnaHR0cHM6Ly93d3cuanViaS5jb20vaGVscC9hcGkuaHRtbCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0QWxsdGlja2VyICgpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNbcF07XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gJ0NOWSc7IC8vIHRvZG9cbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGlkLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG59XG4iLCJcInVzZSBzdHJpY3RcIjtcblxuLy8gIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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FzRmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAvLyBuZXcgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0c0J5QWx0bmFtZSc6IHt9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzEnLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1JyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1JyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnNjAnLFxuICAgICAgICAgICAgICAgICc0aCc6ICcyNDAnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxNDQwJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMTAwODAnLFxuICAgICAgICAgICAgICAgICcydyc6ICcyMTYwMCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjU5OS0yMjcwOTMwNC01ZWRlLTExZTctOWRlMS05ZjMzNzMyZTE1MDkuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmtyYWtlbi5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cua3Jha2VuLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmtyYWtlbi5jb20vZW4tdXMvaGVscC9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL25vdGhpbmdpc2RlYWQvbnBtLWtyYWtlbi1hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5rcmFrZW4uY29tL2VuLXVzL2hlbHAvZmVlcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3N1cHBvcnQua3Jha2VuLmNvbS9oYy9lbi11cy9hcnRpY2xlcy8yMDEzOTY3NzctV2hhdC1hcmUtdGhlLWRlcG9zaXQtZmVlcy0nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9zdXBwb3J0LmtyYWtlbi5jb20vaGMvZW4tdXMvYXJ0aWNsZXMvMjAxODkzNjA4LVdoYXQtYXJlLXRoZS13aXRoZHJhd2FsLWZlZXMtJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjI2IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjE2IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGllcnMnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAndGFrZXInOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDAuMjYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMCwgMC4yNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMCwgMC4yMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI1MDAwMCwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwLCAwLjE4IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMCwgMC4xNiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI1MDAwMDAsIDAuMTQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAwLCAwLjEyIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAsIDAuMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjE2IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAsIDAuMTQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAsIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAsIDAuMTAgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAsIDAuOCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAsIDAuNiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI1MDAwMDAsIDAuNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAwLCAwLjAgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hMTSc6IDAuMDAwMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMDEwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNTE4nOiAwLjAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLjA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiA1LCAvLyBpZiBkb21lc3RpYyB3aXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogNSwgLy8gaWYgZG9tZXN0aWMgd2lyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NBRCc6IDEwLCAvLyBDQUQgRUZUIFdpdGhkcmF3YWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdKUFknOiAzMDAsIC8vIGlmIGRvbWVzdGljIHdpcmVcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWExNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUxOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRCc6IDUsIC8vIGlmIGRvbWVzdGljIHdpcmVcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAwLCAvLyBmcmVlIGRlcG9zaXQgaWYgRVVSIFNFUEEgRGVwb3NpdFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NBRCc6IDUsIC8vIGlmIGRvbWVzdGljIHdpcmVcbiAgICAgICAgICAgICAgICAgICAgICAgICdKUFknOiAwLCAvLyBEb21lc3RpYyBEZXBvc2l0IChGcmVlLCDCpTUsMDAwIGRlcG9zaXQgbWluaW11bSlcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBc3NldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0Fzc2V0UGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPSExDJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTcHJlYWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVGltZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBZGRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0Nsb3NlZE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRGVwb3NpdEFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRGVwb3NpdE1ldGhvZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RlcG9zaXRTdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xlZGdlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09wZW5Qb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1F1ZXJ5TGVkZ2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUXVlcnlPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1F1ZXJ5VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZUJhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlVm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdDYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdTdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjb3N0VG9QcmVjaXNpb24gKHN5bWJvbCwgY29zdCkge1xuICAgICAgICByZXR1cm4gdGhpcy50cnVuY2F0ZSAocGFyc2VGbG9hdCAoY29zdCksIHRoaXMubWFya2V0c1tzeW1ib2xdWydwcmVjaXNpb24nXVsncHJpY2UnXSk7XG4gICAgfVxuXG4gICAgZmVlVG9QcmVjaXNpb24gKHN5bWJvbCwgZmVlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnRydW5jYXRlIChwYXJzZUZsb2F0IChmZWUpLCB0aGlzLm1hcmtldHNbc3ltYm9sXVsncHJlY2lzaW9uJ11bJ2Ftb3VudCddKTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGJvZHkuaW5kZXhPZiAoJ0ludmFsaWQgbm9uY2UnKSA+PSAwKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWROb25jZSAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnSW5zdWZmaWNpZW50IGZ1bmRzJykgPj0gMClcbiAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnQ2FuY2VsIHBlbmRpbmcnKSA+PSAwKVxuICAgICAgICAgICAgdGhyb3cgbmV3IENhbmNlbFBlbmRpbmcgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgaWYgKGJvZHkuaW5kZXhPZiAoJ0ludmFsaWQgYXJndW1lbnRzOnZvbHVtZScpID49IDApXG4gICAgICAgICAgICB0a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XNlICsgJy8nICsgcXVvdGUpO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKCdmZWVzX21ha2VyJyBpbiBtYXJrZXQpIHtcbiAgICAgICAgICAgICAgICBtYWtlciA9IHBhcnNlRmxvYXQgKG1hcmtldFsnZmVlc19tYWtlciddWzBdWzFdKSAvIDEwMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnbG90X2RlY2ltYWxzJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwYWlyX2RlY2ltYWxzJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnZGFya3Bvb2wnOiBkYXJrcG9vbCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnYWx0bmFtZSc6IG1hcmtldFsnYWx0bmFtZSddLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHBhcnNlRmxvYXQgKG1hcmtldFsnZmVlcyddWzBdWzFdKSAvIDEwMCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmVzdWx0ID0gdGhpcy5hcHBlbmRJbmFjdGl2ZU1hcmtldHMgKHJlc3VsdCk7XG4gICAgICAgIHRoaXMubWFya2V0c0J5QWx0bmFtZSA9IHRoaXMuaW5kZXhCeSAocmVzdWx0LCAnYWx0bmFtZScpO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFwcGVuZEluYWN0aXZlTWFya2V0cyAocmVzdWx0ID0gW10pIHtcbiAgICAgICAgbGV0IHByZWNpc2lvbiA9IHsgJ2Ftb3VudCc6IDgsICdwcmljZSc6IDggfTtcbiAgICAgICAgbGV0IGNvc3RMaW1pdHMgPSB7ICdtaW4nOiAwLCAnbWF4JzogdW5kZWZpbmVkIH07XG4gICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHsgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksICdtYXgnOiB1bmRlZmluZWQgfTtcbiAgICAgICAgbGV0IGFtb3VudExpbWl0cyA9IHsgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLCAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSB9O1xuICAgICAgICBsZXQgbGltaXRzID0geyAnYW1vdW50JzogYW1vdW50TGltaXRzLCAncHJpY2UnOiBwcmljZUxpbWl0cywgJ2Nvc3QnOiBjb3N0TGltaXRzIH07XG4gICAgICAgIGxldCBkZWZhdWx0cyA9IHtcbiAgICAgICAgICAgICdkYXJrcG9vbCc6IGZhbHNlLFxuICAgICAgICAgICAgJ2luZm8nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbWFrZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGFrZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG90JzogYW1vdW50TGltaXRzWydtaW4nXSxcbiAgICAgICAgICAgICdhY3RpdmUnOiBmYWxzZSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAnbGltaXRzJzogbGltaXRzLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgbWFya2V0cyA9IFtcbiAgICAgICAgICAgIHsgJ2lkJzogJ1hYTE1aRVVSJywgJ3N5bWJvbCc6ICdYTE0vRVVSJywgJ2Jhc2UnOiAnWExNJywgJ3F1b3RlJzogJ0VVUicsICdhbHRuYW1lJzogJ1hMTUVVUicgfSxcbiAgICAgICAgXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKGRlZmF1bHRzLCBtYXJrZXRzW2ldKSk7XG4gICAgICAgIH1cbiA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AgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZ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AgICAgICAgICAgICAgIGN1cnJlbmN5ID0gbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0ICh0cmFkZVsnZmVlJ10pLFxuICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWzJdICogMTAwMCk7XG4gICAgICAgICAgICBzaWRlID0gKHRyYWRlWzNdID09ICdzJykgPyAnc2VsbCcgOiAnYnV5JztcbiAgICAgICAgICAgIHR5cGUgPSAodHJhZGVbNF0gPT0gJ2wnKSA/ICdsaW1pdCcgOiAnbWFya2V0JztcbiAgICAgICAgICAgIHByaWNlID0gcGFyc2VGbG9hdCAodHJhZGVbMF0pO1xuICAgICAgICAgICAgYW1vdW50ID0gcGFyc2VGbG9hdCAodHJhZGVbMV0pO1xuICAgICAgICB9XG4gICAgICAgIGxldCBzeW1ib2wgPSAobWFya2V0KSA/IG1hcmtldFsnc3ltYm9sJ10gOiB1bmRlZmluZWQ7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVyLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAg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ICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gY3VycmVuY3k7XG4gICAgICAgICAgICAvLyBYLUlTTzQyMTctQTMgc3RhbmRhcmQgY3VycmVuY3kgY29kZXNcbiAgICAgICAgICAgIGlmIChjb2RlWzBdID09ICdYJykge1xuICAgICAgICAgICAgICAgIGNvZGUgPSBjb2RlLnNsaWNlICgxKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY29kZVswXSA9PSAnWicpIHtcbiAgICAgICAgICAgICAgICBjb2RlID0gY29kZS5zbGljZSAoMSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGNvZGUpO1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBwYXJzZUZsb2F0IChiYWxhbmNlc1tjdXJyZW5jeV0pO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2UsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAncGFpcic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gIGlmICgnZmVlJyBpbiBvcmRlcikge1xuICAgICAgICAgICAgICAgIGxldCBmbGFncyA9IG9yZGVyWydvZmxhZ3MnXTtcbiAgICAgICAgICAgICAgICBsZXQgZmVlQ29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2ZlZScpO1xuICAgICAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiBmZWVDb3N0LFxuICAgICAgICAgICAgICAgICAgICAncmF0ZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGlmIChmbGFncy5pbmRleE9mICgnZmNpcScpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZmVlWydjdXJyZW5jeSddID0gbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZmxhZ3MuaW5kZXhPZiAoJ2ZjaWInKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGZlZVsnY3VycmVuY3knXSA9IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzdGF0dXMnOiBvcmRlclsnc3RhdHVzJ10sXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3Qs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ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgdXJsO1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoJ2Vycm9yJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgbGV0IG51bUVycm9ycyA9IHJlc3BvbnNlWydlcnJvciddLmxlbmd0aDtcbiAgICAgICAgICAgIGlmIChudW1FcnJvcnMpIHtcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHJlc3BvbnNlWydlcnJvciddLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnZXJyb3InXVtpXSA9PSAnRVNlcnZpY2U6VW5hdmFpbGFibGUnKVxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlTm90QXZhaWxhYmxlICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc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gICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzEnLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1JyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1JyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnNjAnLFxuICAgICAgICAgICAgICAgICc4aCc6ICc0ODAnLFxuICAgICAgICAgICAgICAgICcxZCc6ICdEJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnVycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMzc5NTY1NS1iM2M0NmU0OC1kY2Y2LTExZTctOGFiZS1kYzQ1ODhiYTc5MDEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmt1Y29pbi5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9rdWNvaW4uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8va3Vjb2luYXBpZG9jcy5kb2NzLmFwaWFyeS5pbycsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9uZXdzLmt1Y29pbi5jb20vZW4vZmVlJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9jaGFydC9jb25maWcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vY2hhcnQvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9jaGFydC9zeW1ib2wnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vY3VycmVuY2llcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9kZWFsLW9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9rbGluZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9sYW5nLWxpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL29yZGVycy1idXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vb3JkZXJzLXNlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vdGljaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW4vY29pbi1pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbi9jb2lucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW4vY29pbnMtdHJlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVuL3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tjb2lufS93YWxsZXQvYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC97Y29pbn0vd2FsbGV0L3JlY29yZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQve2NvaW59L2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvcHJvbW90aW9uL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvcHJvbW90aW9uL3N1bScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVhbC1vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2FjdGl2ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvYWN0aXZlLW1hcCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvZGVhbHQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlZmVycmVyL2Rlc2NlbmRhbnQvY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQve2NvaW59L3dpdGhkcmF3L2FwcGx5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tjb2lufS93aXRoZHJhdy9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbC1vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY2hhbmdlLWxhbmcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDEwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0tDUyc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0FTJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tOQyc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVE0nOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1ZDJzogMy4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVknOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCSEMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFNSJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXVEMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVOJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlBYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUSc6IDIwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVZYJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01PRCc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORUJMJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHQic6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQUcnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0ZEJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JETic6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVS0cnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNQVCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUFQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUWCc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVUxTJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dWVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIU1QnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFVSQSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVNQJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPV1InOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRkxJWFgnOiAxMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xFTkQnOiAyMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNQic6IDMuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSSE9DJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1InOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREVOVCc6IDUwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJHTic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBQ1QnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JzogMC4wMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRPcGVuU3ltYm9scyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ2NvaW5UeXBlJ107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ2NvaW5UeXBlUGFpciddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IG1hcmtldFsndHJhZGluZyddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICA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xlV2l0aGRyYXcnXTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAoZGVwb3NpdCAmJiB3aXRoZHJhdyk7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5Wyd3aXRoZHJhd0ZlZVJhdGUnXSwgLy8gdG9kbzogcmVkZXNpZ25cbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5Wyd3aXRoZHJhd01pbkFtb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudEJhbGFuY2UgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbGltaXQnOiAyMCwgLy8gZGVmYXVsdCAxMiwgbWF4IDIwXG4gICAgICAgICAgICAncGFnZSc6IDEsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBpbmRleGVkID0gdGhpcy5pbmRleEJ5IChiYWxhbmNlcywgJ2NvaW5UeXBlJyk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKGluZGV4ZWQpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGtleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNbaV07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmNvbW1vbk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ICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdoaWdoJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvdycpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdidXknKSxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnc2VsbCcpLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3REZWFsUHJpY2UnKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sVmFsdWUnKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2V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gPSB0cmFkZVswXTtcbiAgICAgICAgbGV0IHNpZGUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0cmFkZVsxXSA9PSAnQlVZJykge1xuICAgICAgICAgICAgc2lkZSA9ICdidXknO1xuICAgICAgICB9IGVsc2UgaWYgKHRyYWRlWzFdID09ICdTRUxMJykge1xuICAgICAgICAgICAgc2lkZSA9ICdzZWxsJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWzJdLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWzNdLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE9wZW5EZWFsT3JkZXJzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybi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lvbiA9IHRoaXMudGltZWZyYW1lc1t0aW1lZnJhbWVdO1xuICAgICAgICAvLyBjb252ZXJ0ICdyZXNvbHV0aW9uJyB0byBtaW51dGVzIGluIG9yZGVyIHRvIGNhbGN1bGF0ZSAnZnJvbScgbGF0ZXJcbiAgICAgICAgbGV0IG1pbnV0ZXMgPSByZXNvbHV0aW9uO1xuICAgICAgICBpZiAobWludXRlcyA9PSAnRCcpIHtcbiAgICAgICAgICAgIGlmICghbGltaXQpXG4gICAgICAgICAgICAgICAgbGltaXQgPSAzMDsgLy8gMzAgZGF5cywgMSBtb250aFxuICAgICAgICAgICAgbWludXRlcyA9IDE0NDA7XG4gICAgICAgIH0gZWxzZSBpZiAobWludXRlcyA9PSAnVycpIHtcbiAgICAgICAgICAgIGlmICghbGltaXQpXG4gICAgICAgICAgICAgICAgbGltaXQgPSA1MjsgLy8gNTIgd2Vla3MsIDEgeWVhclxuICAgICAgICAgICAgbWludXRlcyA9IDEwMDgwO1xuICAgICAgICB9IGVsc2UgaWYgKCFsaW1pdCkge1xuICAgICAgICAgICAgbGltaXQgPSAxNDQwO1xuICAgICAgICAgICAgbWludXRlcyA9IDE0NDA7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHN0YXJ0ID0gZW5kIC0gbWludXRlcyAqIDYwICogbGltaXQ7XG4gICAgICAgIGlmIChzaW5jZSkge1xuICAgICAgICAgICAgc3RhcnQgPSBwYXJzZUludCAoc2luY2UgLyAxMDAwKTtcbiAgICAgICAgICAgIGVuZCA9IHRoaXMuc3VtIChzdGFydCwgbWludXRlcyAqIDYwICogbGltaXQpO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0eXBlJzogdGhpcy50aW1lZnJhbWVzW3RpbWVmcmFtZV0sXG4gICAgICAgICAgICAncmVzb2x1dGlvbic6IHJlc29sdXRpb24sXG4gICAgICAg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aXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyBlbmRwb2ludDtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIC8vIHRoZWlyIG5vbmNlIGlzIGFsd2F5cyBhIGNhbGlicmF0ZWQgc3luY2hlZCBtaWxsaXNlY29uZHMtdGltZXN0YW1wXG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeVN0cmluZyA9ICcnO1xuICAgICAgICAgICAgbm9uY2UgPSBub25jZS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHF1ZXJ5U3RyaW5nID0gdGhpcy5yYXdlbmNvZGUgKHRoaXMua2V5c29ydCAocXVlcnkpKTtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnlTdHJpbmc7XG4gICAgICAgICAgICAgICAgaWYgKG1ldGhvZCAhPSAnR0VUJykge1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gcXVlcnlTdHJpbmc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IGF1dGggPSBlbmRwb2ludCArICcvJyArIG5vbmNlICsgJy8nICsgcXVlcnlTdHJpbmc7XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IHRoaXMuc3RyaW5nVG9CYXNlNjQgKHRoaXMuZW5jb2RlIChhdXRoKSk7XG4gICAgICAgICAgICAvLyBwYXlsb2FkIHNob3VsZCBiZSBcImVuY29kZWRcIiBhcyByZXR1cm5lZCBmcm9tIHN0cmluZ1RvQmFzZTY0XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjIChwYXlsb2FkLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMjU2Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdLQy1BUEktS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0tDLUFQSS1OT05DRSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdLQy1BUEktU0lHTkFUVVJFJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIHRocm93RXhjZXB0aW9uT25FcnJvciAocmVzcG9uc2UpIHtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCFyZXNwb25zZVsnc3VjY2VzcyddKSB7XG4gICAgICAgICAgICAgICAgaWYgKCdjb2RlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdtc2cnKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydjb2RlJ10gPT0gJ1VOQVVUSCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlID09ICdJbnZhbGlkIG5vbmNlJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE5vbmNlICh0aGlzLmlkICsgJyAnICsgbWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChyZXNwb25zZVsnY29kZSddID09ICdFUlJPUicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlLmluZGV4T2YgKCdwcmVjaXNpb24gb2YgYW1vdW50JykgPj0gMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgbWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGJvZHkgJiYgKGJvZHlbMF0gPT0gXCJ7XCIpKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIHRoaXMudGhyb3dFeGNlcHRpb25PbkVycm9yIChyZXNwb25zZSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvZGUgPj0gNDAwKSB7XG4gICAgICA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ICAgICAgJ2lkJzogJ2t1bmEnLFxuICAgICAgICAgICAgJ25hbWUnOiAnS3VuYScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1VBJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjInLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogZmFsc2UsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMxNjk3NjM4LTkxMjgyNGZhLWIzYzEtMTFlNy04YzM2LWNmOTYwNmViOTRhYy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9rdW5hLmlvJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8va3VuYS5pbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2t1bmEuaW8vZG9jdW1lbnRzL2FwaScsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9rdW5hLmlvL2RvY3VtZW50cy9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97bWFya2V0fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGltZXN0YW1wJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21lbWJlcnMvbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL215JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9kZWxldGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9VQUgnOiB7ICdpZCc6ICdidGN1YWgnLCAnc3ltYm9sJzogJ0JUQy9VQUgnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVUFIJywgJ3ByZWNpc2lvbic6IHsgJ2Ftb3VudCc6IDYsICdwcmljZSc6IDAgfSwgJ2xvdCc6IDAuMDAwMDAxLCAnbGltaXRzJzogeyAnYW1vdW50JzogeyAnbWluJzogMC4wMDAwMDEsICdtYXgnOiB1bmRlZmluZWQgfSwgJ3ByaWNlJzogeyAnbWluJzogMSwgJ21heCc6IHVuZGVmaW5lZCB9fX0sXG4gICAgICAgICAgICAgICAgJ0VUSC9VQUgnOiB7ICdpZCc6ICdldGh1YWgnLCAnc3ltYm9sJzogJ0VUSC9VQUgnLCAnYmFzZSc6ICdFVEgnLCAncXVvdGUnOiAnVUFIJywgJ3ByZWN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gICAgICAgICAgJ0IyQi9CVEMnOiB7ICdpZCc6ICdiMmJidGMnLCAnc3ltYm9sJzogJ0IyQi9CVEMnLCAnYmFzZSc6ICdCMkInLCAncXVvdGUnOiAnQlRDJ30sXG4gICAgICAgICAgICAgICAgJ0VWUi9CVEMnOiB7ICdpZCc6ICdldnJidGMnLCAnc3ltYm9sJzogJ0VWUi9CVEMnLCAnYmFzZSc6ICdFVlInLCAncXVvdGUnOiAnQlRDJ30sXG4gICAgICAgICAgICAgICAgJ0dPTC9HQkcnOiB7ICdpZCc6ICdnb2xnYmcnLCAnc3ltYm9sJzogJ0dPTC9HQkcnLCAnYmFzZSc6ICdHT0wnLCAncXVvdGUnOiAnR0JHJ30sXG4gICAgICAgICAgICAgICAgJ1IvQlRDJzogeyAnaWQnOiAncmJ0YycsICdzeW1ib2wnOiAnUi9CVEMnLCAnYmFzZSc6ICdSJywgJ3F1b3RlJzogJ0JUQyd9LFxuICAgICAgICAgICAgICAgICdSTUMvQlRDJzogeyAnaWQnOiAncm1jYnRjJywgJ3N5bWJvbCc6ICdSTUMvQlRDJywgJ2Jhc2UnOiAnUk1DJywgJ3F1b3RlJzogJ0JUQyd9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdVQUgnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0FWRVMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dPTCc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQkcnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnUk1DJzogMC4wMDEgQlRDXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnQVJOJzogMC4wMSBFVEhcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdSJzogMC4wMSBFVEhcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdFVlInOiAwLjAxIEVUSFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdVQUgnOiAoYW1vdW50KSA9PiBhbW91bnQgKiAwLjAwMSArIDVcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09IDQwMCkge1xuICAgICAgICAgICAgbGV0IGRhdGEgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGxldCBlcnJvciA9IGRhdGFbJ2Vycm9yJ107XG4gICAgICAgICAgICBsZXQgZXJyb3JDb2RlID0gZXJyb3JbJ2NvZGUnXTtcbiAgICAgICAgICAgIGlmIChlcnJvckNvZGUgPT0gMjAwMikge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAoWyB0aGlzLmlkLCBtZXRob2QsIHVybCwgY29kZSwgcmVhc29uLCBib2R5IF0uam9pbiAoJyAnKSk7XG4gICA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uICAgICAgICAgICAgJ3NpZGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJpY2UnOiBwYXJzZUZsb2F0ICh0cmFkZVsncHJpY2UnXSksXG4gICAgICAgICAgICAnYW1vdW50JzogcGFyc2VGbG9hdCAodHJhZGVbJ3ZvbHVtZSddKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIHBhcnNlTXlUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydjcmVhdGVkX2F0J10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbi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wLTcyYjdjMzhhLTY2NjAtMTFlNy05MmQ5LWQ5MDI3NTAyMjgxZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkubGFrZWJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cubGFrZWJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5sYWtlYnRjLmNvbS9zL2FwaV92MicsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5sYWtlYnRjLmNvbS9zL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmNvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JjdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEFjY291bnRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRFeHRlcm5hbEFjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjE1IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDwga2V5cy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1trXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgYmFzZSA9IGJhc2UudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBxdW90ZSA9IHF1b3RlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEFjY291bnRJbmZvICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnYmFsYW5jZSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzKTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBwYXJzZUZsb2F0IChiYWxhbmNlc1tjdXJyZW5jeV0pO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2UsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIG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nKSB7XG4gICAgICAgICAgICB1cmwgKz0gJy8nICsgcGF0aDtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICBwYXJhbXMgPSBwYXJhbXMuam9pbiAoJywnKTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBwYXJhbXMgPSAnJztcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMudXJsZW5jb2RlICh7XG4gICAgICAgICAgICAgICAgJ3RvbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ2FjY2Vzc2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdyZXF1ZXN0bWV0aG9kJzogbWV0aG9kLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgICAgICdpZCc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdwYXJhbXMnOiBwYXJhbXMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAncGFyYW1zJzogcGFyYW1zLFxuICAgICAgICAgICAgICAgICdpZCc6IG5vbmNlLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29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GZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAvLyBuZXcgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk4MjAyMi03NWFlYTgyOC02M2EwLTExZTctOTUxMS1jYTU4NGE4ZWRkNzQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmxpcXVpLmlvL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmxpcXVpLmlvL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2xpcXVpLmlvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vbGlxdWkuaW8vYXBpJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL2xpcXVpLmlvL2ZlZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFuc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NvaW5EZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdDb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDcmVhdGVDb3Vwb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZGVlbUNvdXBvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzogMC4wLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY2FsY3VsYXRlRmVlIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UsIHRha2VyT3JNYWtlciA9ICd0YWtlcicsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNbc3ltYm9sXTtcbiAgICAgICAgbGV0IGtleSA9ICdxdW90ZSc7XG4gICAgICAgIGxldCByYXRlID0gbWFya2V0W3Rha2VyT3JNYWtlcl07XG4gICAgICAgIGxldCBjb3N0ID0gcGFyc2VGbG9hdCAodGhpcy5jb3N0VG9QcmVjaXNpb24gKHN5bWJvbCwgYW1vdW50ICogcmF0ZSkpO1xuICAgICAgICBpZiAoc2lkZSA9PSAnc2VsbCcpIHtcbiAgICAgICAgICAgIGNvc3QgKj0gcHJpY2U7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBrZXkgPSAnYmFzZSc7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICd0eXBlJzogdGFrZXJPck1ha2VyLFxuICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0W2tleV0sXG4gICAgICAgICAgICAncmF0ZSc6IHJhdGUsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlICh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Fya2V0cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBrZXlzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW3BdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaWRdO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHRoaXMuZ2V0QmFzZVF1b3RlRnJvbU1hcmtldElkIChpZCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogdGhpcy5zYWZlSW50ZWdlciAobWFya2V0LCAnZGVjaW1hbF9wbGFjZXMnKSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnNhZmVJbnRlZ2VyIChtYXJrZXQsICdkZWNpbWFsX3BsYWNlcycpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhbW91bnRMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5fYW1vdW50JyksXG4gICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYXhfYW1vdW50JyksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByaWNlTGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluX3ByaWNlJyksXG4gICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYXhfcHJpY2UnKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgY29zdExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbl90b3RhbCcpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudExpbWl0cyxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZUxpbWl0cyxcbiAgICAgICAgICAgICAgICAnY29zdCc6IGNvc3RMaW1pdHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChtYXJrZXRbJ2hpZGRlbiddID09IDApO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogbWFya2V0WydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAnbG90JzogYW1vdW50TGltaXRzWydtaW4nXSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRJbmZvICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncmV0dXJuJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGZ1bmRzID0gYmFsYW5jZXNbJ2Z1bmRzJ107XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGZ1bmRzKTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgdXBwZXJjYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHVwcGVyY2FzZSk7XG4gICAgICAgICAgICBsZXQgdG90YWwgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgdXNlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChiYWxhbmNlc1snb3Blbl9vcmRlcnMnXSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgdG90YWwgPSBmdW5kc1tjdXJyZW5jeV07XG4gICAgICAgICAgICAgICAgdXNlZCA9IDAuMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogZnVuZHNbY3VycmVuY3ldLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdXNlZCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiB0b3RhbCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VC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ICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd1cGRhdGVkJ10gKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0JyksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhdmcnKSxcbiAgICAgICAgICAgIC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WFrZXInO1xuICAgICAgICAvLyBsZXQgZmVlID0gdGhpcy5jYWxjdWxhdGVGZWUgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSwgdGFrZXJPck1ha2VyKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXIsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICB9O1xuICAgICAgICBpZiAobGltaXQpXG4gICAgICAgICAgICByZXF1ZXN0WydsaW1pdCddID0gbGltaXQ7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVzUGFpciAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuIC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ChwcmljZSk7XG4gICAgICAgIGFtb3VudCA9IHBhcnNlRmxvYXQgKGFtb3VudCk7XG4gICAgICAgIGxldCBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgIGlmIChpZCA9PSAnMCcpIHtcbiAgICAgICAgICAgIGlkID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZVsncmV0dXJuJ10sICdpbml0X29yZGVyX2lkJyk7XG4gICAgICAgICAgICBzdGF0dXMgPSAnY2xvc2VkJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgZmlsbGVkID0gdGhpcy5zYWZlRmxvYXQgKHJlc3BvbnNlWydyZXR1cm4nXSwgJ3JlY2VpdmVkJywgMC4wKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChyZXNwb25zZVsncmV0dXJuJ10sICdyZW1haW5zJywgYW1vdW50KTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBmaWxsZWQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgLy8gJ3RyYWRlcyc6IHRoaXMucGFyc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WVzc2FnZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAobWVzc2FnZS5pbmRleE9mICgnbm90IGZvdW5kJykgPj0gMClcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyBjYW5jZWxPcmRlcigpIGVycm9yOiAnICsgdGhpcy5sYXN0X2h0dHBfcmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IGU7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IGlkID0gb3JkZXJbJ2lkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgIGxldCBzdGF0dXMgPSBvcmRlclsnc3RhdHVzJ107XG4gICAgICAgIGlmIChzdGF0dXMgPT0gMCkge1xuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICB9IGVsc2UgaWYgKHN0YXR1cyA9PSAxKSB7XG4gICAgICAgICAgICBzdGF0dXMgPSAnY2xvc2VkJztcbiAgICAgICAgfSBlbHNlIGlmICgoc3RhdHVzID09IDIpIHx8IChzdGF0dXMgPT0gMykpIHtcbiAgICAgICAgICAgIHN0YXR1cyA9ICdjYW5jZWxlZCc7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChvcmRlclsndGltZXN0YW1wX2NyZWF0ZWQnXSkgKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtvcmRlclsncGFpciddXTtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBhbW91bnQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3JhdGUnKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnc3RhcnRfYW1vdW50JyBpbiBvcmRlcikge1xuICAgICAgICAgICAgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnc3RhcnRfYW1vdW50Jyk7XG4gICAgICAgICAgICByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdhbW91bnQnKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2Ftb3VudCcpO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMub3JkZXJzKVxuICAgICAgICAgICAgICAgIGFtb3VudCA9IHRoaXMub3JkZXJzW2lkXVsnYW1vdW50J107XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogZmlsbGVkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlcnMgKG9yZGVycywgbWFya2V0ID0gdW5kZWZpbmVkLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChvcmRlcnMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSBvcmRlcnNbaWRdO1xuICAgICAgICAgICAgbGV0IGV4dGVuZGVkID0gdGhpcy5leHRlbmQgKG9yZGVyLCB7ICdpZCc6IGlkIH0pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMucGFyc2VPcmRlciAoZXh0ZW5kZWQsIG1hcmtldCkpO1x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ChpZCBpbiBvcGVuT3JkZXJzSW5kZXhlZEJ5SWQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSB0aGlzLmV4dGVuZCAodGhpcy5vcmRlcnNbaWRdLCBvcGVuT3JkZXJzSW5kZXhlZEJ5SWRbaWRdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRlcnNbaWRdO1xuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3RhdHVzJ10gPT0gJ29wZW4nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiBvcmRlclsnYW1vdW50J10gKiBvcmRlclsncHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWxsZWQnOiBvcmRlclsnYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVtYWluaW5nJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSB0aGlzLm9yZGVyc1tpZF07XG4gICAgICAgICAgICBpZiAoc3ltYm9sKSB7XG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydzeW1ib2wnXSA9PSBzeW1ib2wpXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoIChvcmRlcik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoIChvcmRlcik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMuZmlsdGVyQnlTaW5jZUxpbWl0IChyZXN1bHQsIH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XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHNpZ25hdHVyZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB1cmwgKz0gdGhpcy5nZXRWZXJzaW9uU3RyaW5nICgpICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgnc3VjY2VzcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmICghcmVzcG9uc2VbJ3N1Y2Nlc3MnXSkge1xuICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnZXJyb3InXS5pbmRleE9mICgnTm90IGVub3VndGgnKSA+PSAwKSB7IC8vIG5vdCBlbm91Z1RoIGlzIGEgdHlwbyBpbnNpZGUgTGlxdWkncyBvd24gQVBJLi4uXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJlc3BvbnNlWydlcnJvciddID09ICdSZXF1ZXN0cyB0b28gb2Z0ZW4nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBERG9TUHJvdGVjdGlvbiAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChyZXNwb25zZVsnZXJyb3InXSA9PSAnbm90IGF2YWlsYWJsZScpIHx8IChyZXNwb25zZVsnZXJyb3InXSA9PSAnZXh0ZXJuYWwgc2VydmljZSB1bmF2YWlsYWJsZScpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBERG9TUHJvdGVjdGlvbiAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cbn1cbiIsIlwidXNlIHN0cmljdFwiO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbmNvbnN0IEV4Y2hhbmdlID0gcmVxdWlyZSAoJy4vYmFzZS9FeGNoYW5nZScpXG5jb25zdCB7IEV4Y2hhbmdlRXJ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ICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3OTgwNzY4LWYyMmZjNDI0LTYzOGEtMTFlNy04OWM5LTYwMTBhNTRmZjliZS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkubGl2ZWNvaW4ubmV0JyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmxpdmVjb2luLm5ldCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5saXZlY29pbi5uZXQvYXBpP2xhbmc9ZW4nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9hbGwvb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvbGFzdF90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL21heGJpZF9taW5hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3Jlc3RyaWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvdGlja2VyJywgLy8gb21pdCBwYXJhbXMgdG8gZ2V0IGFsbCB0aWNrZXJzIGF0IG9uY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL2NvaW5JbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2NsaWVudF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2NvbW1pc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2NvbW1pc3Npb25Db21tb25JbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvZ2V0L2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvaGlzdG9yeS9zaXplJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2hpc3RvcnkvdHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYnV5bGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2J1eW1hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvY2FuY2VsbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3NlbGxsaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvc2VsbG1hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvY2FwaXRhbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvY2FyZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvY29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvb2twYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L3BheWVlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvcGVyZmVjdG1vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L3ZvdWNoZXIvYW1vdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L3ZvdWNoZXIvbWFrZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC92b3VjaGVyL3JlZGVlbScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMTggLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMTggLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRFeGNoYW5nZVRpY2tlciAoKTtcbiAgICAgICAgbGV0IHJlc3RyaWN0aW9ucyA9IGF3YWl0IHRoaXMucHVibGljR2V0RXhjaGFuZ2VSZXN0cmljdGlvbnMgKCk7XG4gICAgICAgIGxldCByZXN0cmljdGlvbnNCeUlkID0gdGhpcy5pbmRleEJ5IChyZXN0cmljdGlvbnNbJ3Jlc3RyaWN0aW9ucyddLCAnY3VycmVuY3lQYWlyJyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgbGV0IGNvaW5SZXN0cmljdGlvbnMgPSB0aGlzLnNhZmVWYWx1ZSAocmVzdHJpY3Rpb25zQnlJZCwgc3ltYm9sKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogNSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAnY29zdCc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKGNvaW5SZXN0cmljdGlvbnMpIHtcbiAgICAgICAgICAgICAgICBwcmVjaXNpb25bJ3ByaWNlJ10gPSB0aGlzLnNhZmVJbnRlZ2VyIChjb2luUmVzdHJpY3Rpb25zLCAncHJpY2VTY2FsZScsIDUpO1xuICAgICAgICAgICAgICAgIGxpbWl0c1snYW1vdW50J11bJ21pbiddID0gdGhpcy5zYWZlRmxvYXQgKGNvaW5SZXN0cmljdGlvbnMsICdtaW5MaW1pdFF1YW50aXR5JywgbGltaXRzWydhbW91bnQnXVsnbWluJ10pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGltaXRzWydwcmljZSddID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQ3VycmVuY2llcyAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRJbmZvQ29pbkluZm8gKHBhcmFtcyk7XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0g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Vsnd2l0aGRyYXdGZWUnXSwgLy8gdG9kbzogcmVkZXNpZ25cbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ21pbk9yZGVyQW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydtaW5PcmRlckFtb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydtaW5XaXRoZHJhd0Ftb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ21pbkRlcG9zaXRBbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmVzdWx0ID0gdGhpcy5hcHBlbmRGaWF0Q3VycmVuY2llcyAocmVzdWx0KTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhcHBlbmRGaWF0Q3VycmVuY2llcyAocmVzdWx0ID0gW10pIHtcbiAgICAgICAgbGV0IHByZWNpc2lvbiA9IDg7XG4gICAgICAgIGxldCBkZWZhdWx0cyA9IHtcbiAgICAgICAgICAgICdpbmZvJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7ICdtaW4nOiB1bmRlZmluZWQsICdtYXgnOiB1bmRlZmluZWQgfSxcbiAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHsgJ21pbic6IHVuZGVmaW5lZCwgJ21heCc6IHVuZGVmaW5lZCB9LFxuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7ICdtaW4nOiB1bmRlZmluZWQsICdtYXgnOiB1bmRlZmluZWQgfSxcbiAgICAgICAgICAgICAgICAnY29zdCc6IHsgJ21pbic6IHVuZGVmaW5lZCwgJ21heCc6IHVuZGVmaW5lZCB9LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAs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xldCB2d2FwID0gcGFyc2VGbG9hdCAodGlja2VyWyd2d2FwJ10pO1xuICAgICAgICBsZXQgYmFzZVZvbHVtZSA9IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sdW1lJ10pO1xuICAgICAgICBsZXQgcXVvdGVWb2x1bWUgPSBiYXNlVm9sdW1lICogdndhcDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiZXN0X2JpZCddKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2Jlc3RfYXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3Z3YXAnXSksXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvd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HRoaXMucHVibGljR2V0RXhjaGFuZ2VUaWNrZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3lQYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndGltZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsndHlwZSddLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ3F1YW50aXR5J10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bW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ZW1haW5pbmdRdWFudGl0eScsIDAuMCk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdxdWFudGl0eScsIHJlbWFpbmluZyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgICAgICAnZmVlJzoge1xuICAgICAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBxdW90ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlcnMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1x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WRkcmVzcyA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICd3YWxsZXQnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyBwYXRoO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5rZXlzb3J0IChwYXJhbXMpKTtcbiAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyBxdWVyeTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09ICdQT1NUJylcbiAgICAgICAgICAgICAgICBib2R5ID0gcXVlcnk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMjU2Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBcGktS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoY29kZSA+PSAzMDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdID09IFwie1wiKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgaWYgKCdlcnJvckNvZGUnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBlcnJvciA9IHJlc3BvbnNlWydlcnJvckNvZGUnXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycm9yID09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgnZXJyb3JNZXNzYWdlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnZXJyb3JNZXNzYWdlJ10gPT0gJ1VzZXIgbm90IGZvdW5kJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEF1dGhlbnRpY2F0aW9uRXJyb3IgKHRoaXMuaWQgKyAnICcgKyByZXNwb25zZVsnZXJyb3JNZXNzYWdlJ10pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoZXJyb3IgPT0gMTApIHx8IChlcnJvciA9PSAxMSkgfHwgKGVycm9yID09IDEyKSB8fCAoZXJyb3IgPT0gMjApIHx8IChlcnJvciA9PSAzMCkgfHwgKGVycm9yID09IDEwMSkgfHwgKGVycm9yID09IDEwMikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IDMxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgTm90U3VwcG9ydGVkICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IDMyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSAxMDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJzogSW52YWxpZCBwYXJhbWV0ZXJzICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gMTAzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJzogSW52YWxpZCBjdXJyZW5jeSAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IDEwNCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICc6IEludmFsaWQgYW1vdW50ICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gMTA1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJzogVW5hYmxlIHRvIGJsb2NrIGZ1bmRzICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gNTAzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VOb3RBdmFpbGFibGUgKHRoaXMuaWQgKyAnOiBFeGNoYW5nZSBpcyBub3QgYXZhaWxhYmxlICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAg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uZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2x1bm8nLFxuICAgICAgICAgICAgJ25hbWUnOiAnbHVubycsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnR0InLCAnU0cnLCAnWkEnIF0sXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICcxJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY2MDctOGMxYTY5ZDgtNWVkZS0xMWU3LTkzMGMtNTQwYjVlYjliZTI0LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5teWJpdHguY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5sdW5vLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lmx1bm8uY29tL2VuL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL25wbWpzLm9yZy9wYWNrYWdlL2JpdHgnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL2JhdXNtZWllci9ub2RlLWJpdHgnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMve2lkfS9wZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmdfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdHRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3Rlcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3N0b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdG9wb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmdfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2F1dGgyL2dyYW50JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VycyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHNbJ3RpY2tlcnMnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ3RpY2tlcnMnXVtwXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsncGFpciddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2Jd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9IGVsc2Uge1xuICAgICAgICAgICAgZmVlWydzaWRlJ10gPSAnYmFzZSc7XG4gICAgICAgICAgICBmZWVbJ2Nvc3QnXSA9IGJhc2VGZWU7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydvcmRlcl9pZCddLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0cmFkZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRPcmRlcnNJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlciAocmVzcG9uc2UpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd0aW1lc3RhbXAnXTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xvdyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiaWQnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2JpZCddKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2FzayddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdF90cmFkZSddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3JvbGxpbmdfMjRfaG91c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gICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM0NDg3NjIwLTMxMzlhN2IwLWVmZTYtMTFlNy05MGY1LWU1MjBjZWY3NDQ1MS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdtb2JpbGUnOiAnaHR0cHM6Ly9hcGkubHlra2V4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vaGZ0LWFwaS5seWtrZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9oZnQtYXBpLmx5a2tlLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAndGVzdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb2JpbGUnOiAnaHR0cHM6Ly9hcGkubHlra2V4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2hmdC1zZXJ2aWNlLWRldi5seWtrZXgubmV0L2FwaScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2hmdC1zZXJ2aWNlLWRldi5seWtrZXgubmV0L2FwaScsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lmx5a2tlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vaGZ0LWFwaS5seWtrZS5jb20vc3dhZ2dlci91aS8nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubHlra2UuY29tL2x5a2tlX2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5seWtrZS5jb20vdHJhZGluZy1jb25kaXRpb25zJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdtb2JpbGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWxsQXNzZXRQYWlyUmF0ZXMve21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0Fzc2V0UGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0Fzc2V0UGFpcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSXNBbGl2ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJCb29rcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJCb29rcy97QXNzZXRQYWlySWR9J1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVycy9saW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJzL21hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJzL3tpZH0vQ2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDEwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMTksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR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cbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydCYXNlQXNzZXRJZCddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydRdW90aW5nQXNzZXRJZCddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ05hbWUnXTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnQWNjdXJhY3knXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ0ludmVydGVkQWNjdXJhY3knXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB0aWNrZXIgPSB0aWNrZXJbJ1Jlc3VsdCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsb3cnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydSYXRlJ11bJ0JpZCddKSxcbiAg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aW5nVm9sdW1lJyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgIGxldCBjb3N0ID0gZmlsbGVkICogcHJpY2U7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ0lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0T3JkZXJzSWQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBh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JzZU9yZGVycyAocmVzcG9uc2UsIHVuZGVmaW5lZCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE9yZGVyQm9va3NBc3NldFBhaXJJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdBc3NldFBhaXJJZCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0ge1xuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiaWRzJzogW10sXG4gICAgICAgICAgICAnYXNrcyc6IFtdLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdW5kZWZpbmVkO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHJlc3BvbnNlLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgc2lkZSA9IHJlc3BvbnNlW2ldO1xuICAgICAgICAgICAgaWYgKHNpZGVbJ0lzQnV5J10pIHtcbiAgICAgICAgICAgICAgICBvcmRlcmJvb2tbJ2JpZHMnXSA9IHRoaXMuYXJyYXlDb25jYXQgKG9yZGVyYm9va1snYmlkcyddLCBzaWRlWydQcmljZXMnXSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG9yZGVyYm9va1snYXNrcyddID0gdGhpcy5hcnJheUNvbmNhdCAob3JkZXJib29rWydhc2tzJ10sIHNpZGVbJ1ByaWNlcyddKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzL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VybHNbJ2FwaSddW2FwaV0gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2UgaWYgKGFwaSA9PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT0gJ0dFVCcpXG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnYXBpLWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdBY2NlcHQnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAobWV0aG9kID09ICdQT1NUJylcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChwYXJhbXMpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib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tNjBlYS0xMWU3LTkxOTItZjA1ZTg2YWRiODNmLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cubWVyY2Fkb2JpdGNvaW4ubmV0L3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5jb20uYnInLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5jb20uYnIvYXBpLWRvYycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5jb20uYnIvdHJhZGUtYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y29pbn0vb3JkZXJib29rLycsIC8vIGxhc3Qgc2xhc2ggY3JpdGljYWxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y29pbn0vdGlja2VyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L3RyYWRlcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjb2lufS90cmFkZXMve2Zyb219LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L3RyYWRlcy97ZnJvbX0ve3RvfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L2RheS1zdW1tYXJ5L3t5ZWFyfS97bW9udGh9L3tkYXl9LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfYWNjb3VudF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X3N5c3RlbV9tZXNzYWdlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3Rfb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZV9idXlfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlX3NlbGxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2NvaW4nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9CUkwnOiB7ICdpZCc6ICdCUkxCVEMnLCAnc3ltYm9sJzogJ0JUQy9CUkwnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQlJMJywgJ3N1ZmZpeCc6ICdCaXRjb2luJyB9LFxuICAgICAgICAgICAgICAgICdMVEMvQlJMJzogeyAnaWQnOiAnQlJMTFRDJywgJ3N5bWJvbCc6ICdMVEMvQlJMJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ0JSTCcsICdzdWZmaXgnOiAnTGl0ZWNvaW4nIH0sXG4gICAgICAgICAgICAgICAgJ0JDSC9CUkwnOiB7ICdpZCc6ICdCUkxCQ0gnLCAnc3ltYm9sJzogJ0JDSC9CUkwnLCAnYmFzZSc6ICdCQ0gnLCAncXVvdGUnOiAnQlJMJywgJ3N1ZmZpeCc6ICdCQ2FzaCcgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4zIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjcgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0Q29pbk9yZGVyYm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjb2luJzogbWFya2V0WydiYXNlJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0Q29pblRpY2tlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjb2luJzogbWFya2V0WydiYXNlJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3RpY2tlciddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRpY2tlclsnZGF0ZSddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYnV5J10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnc2VsbCddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3ZvbCddKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJh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AgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2NvaW5fcGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdvcmRlcl9pZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ29yZGVyX3R5cGUnIGluIG9yZGVyKVxuICAgICAgICAgICAgc2lkZSA9IChvcmRlclsnb3JkZXJfdHlwZSddID09IDEpID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIGxldCBzdGF0dXMgPSBvcmRlclsnc3RhdHVzJ107XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICghbWFya2V0KSB7XG4gICAgICAgICAgICBpZiAoJ2NvaW5fcGFpcicgaW4gb3JkZXIpXG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydjb2luX3BhaXInXSBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtvcmRlclsnY29pbl9wYWlyJ11dO1xuICAgICAgICB9XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2NyZWF0ZWRfdGltZXN0YW1wJyBpbiBvcmRlcilcbiAgICAgICAgICA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0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiBhdmVyYWdlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgaWYgKCFzeW1ib2wpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgY2FuY2VsT3JkZXIoKSByZXF1aXJlcyBhIHN5bWJvbCBhcmd1bWVudCcpO1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0T3JkZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY29pbl9wYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICAgIC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AgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0V2l0aGRyYXdDb2luICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ3Jlc3BvbnNlX2RhdGEnXVsnd2l0aGRyYXdhbCddWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXSArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgdXJsICs9IHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3RhcGlfbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAndGFwaV9ub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9ICcvdGFwaS8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgJz8nICsgYm9keTtcbiAgICAgICAgIC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ICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ2J0Y191c2QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJywgJ21ha2VyJzogMC4wMDE1LCAndGFrZXInOiAwLjAwMjUgfSxcbiAgICAgICAgICAgICAgICAnRVRIL0JUQyc6IHsgJ2lkJzogJ2V0aF9idGMnLCAnc3ltYm9sJzogJ0VUSC9CVEMnLCAnYmFzZSc6ICdFVEgnLCAncXVvdGUnOiAnQlRDJywgJ21ha2VyJzogMC4wMDEsICd0YWtlcic6IDAuMDAxNSB9LFxuICAgICAgICAgICAgICAgICdCQ0gvQlRDJzogeyAnaWQnOiAnYmNoX2J0YycsICdzeW1ib2wn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Sc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2wnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGUnXSkgKiAxMDAwO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlcyAodGhpcy5leH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HVybiBhd2FpdCB0aGlzLnByaXZhdGVQb3N0Q2FuY2VsICh7ICdpZCc6IGlkIH0pO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdTaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuc2VjcmV0LCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob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tcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdub3ZhJyxcbiAgICAgICAgICAgICduYW1lJzogJ05vdmFleGNoYW5nZScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1RaJywgLy8gVGFuemFuaWFcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAyMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjInLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzA1MTg1NzEtNzhjYTBiY2EtOWI4YS0xMWU3LTg4NDAtNjRiODNhNGE5NGIyLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL25vdmFleGNoYW5nZS5jb20vcmVtb3RlJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vbm92YWV4Y2hhbmdlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL25vdmFleGNoYW5nZS5jb20vcmVtb3RlL2ZhcScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3tiYXNlY3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2luZm8ve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29yZGVyaGlzdG9yeS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbm9yZGVycy97cGFpcn0vYnV5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW5vcmRlcnMve3BhaXJ9L3NlbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbm9yZGVycy97cGFpcn0vYm90aC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVub3JkZXJzL3twYWlyfS97b3JkZXJ0eXBlfS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbGFuY2VzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YmFsYW5jZS97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdHMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR3aXRoZHJhd2Fscy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG5ld2RlcG9zaXRhZGRyZXNzL3tjdXJyZW5jeX0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRkZXBvc2l0YWRkcmVzcy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXlvcGVub3JkZXJzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXlvcGVub3JkZXJzX21hcmtldC97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxvcmRlci97b3JkZXJpZH0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVoaXN0b3J5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdGhpc3RvcnkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR3aXRoZHJhd2FsaGlzdG9yeS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHN0YXR1cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHN0YXR1cy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnbWFya2V0cyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBpZiAoIW1hcmtldFsnZGlzYWJsZWQnXSkge1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnbWFya2V0bmFtZSddO1xuICAgICAgICAgICAgICAgIGxldCBbIHF1b3RlLCBiYXNlIF0gPSBpZC5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldE9wZW5vcmRlcnNQYWlyQm90aCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHVuZGVmaW5lZCwgJ2J1eW9yZGVycycsICdzZWxsb3JkZXJzJywgJ3ByaWNlJywgJ2Ftb3VudCcpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0SW5mb1BhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ21hcmtldHMnXVswXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ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SB0cmFkZVsndW5peF90X2RhdGVzdGFtcCddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3RyYWRldHlwZSddLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3ByaWNlJzogcGFyc2VGbG9hdCAodHJhZGVbJ3ByaWNlJ10pLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHBhcnNlRmxvYXQgKHRyYWRlWydhbW91bnQnXSksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0T3JkZXJoaXN0b3J5UGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlWydpdGVtcyddLCBtYXJrZX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TAwIG1zXG4gICAgICAgICAgICAvLyBvYnNvbGV0ZSBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVycyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIC8vIG5ldyBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4dGVuc2lvbic6ICcuZG8nLCAvLyBhcHBlbmRlZCB0byBlbmRwb2ludCBVUkxcbiAgICAgICAgICAgICdoYXNGdXR1cmVNYXJrZXRzJzogZmFsc2UsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW1pbicsXG4gICAgICAgICAgICAgICAgJzNtJzogJzNtaW4nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bWluJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bWluJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbWluJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMWhvdXInLFxuICAgICAgICAgICAgICAgICcyaCc6ICcyaG91cicsXG4gICAgICAgICAgICAgICAgJzRoJzogJzRob3VyJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmhvdXInLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJob3VyJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWRheScsXG4gICAgICAgICAgICAgICAgJzNkJzogJzNkYXknLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxd2VlaycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnd2ViJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMvY3VycmVuY2llcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy9wcm9kdWN0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZV9yYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9lc3RpbWF0ZWRfcHJpY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9ob2xkX2Ftb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2luZGV4JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfa2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9wcmljZV9saW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ290Y3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50X3JlY29yZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhdGNoX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib3Jyb3dfbW9uZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JvcnJvd19vcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib3Jyb3dzX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9ib3Jyb3cnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX290Y19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfYmF0Y2hfdHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9kZXZvbHZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfZXhwbG9zaXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfb3JkZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX29yZGVyc19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfcG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9wb3NpdGlvbl80Zml4JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV90cmFkZXNfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3VzZXJpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdXNlcmluZm9fNGZpeCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVuZF9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfZmVlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnNfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3RjX29yZGVyX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ290Y19vcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXBheW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N1Ym1pdF9vdGNfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9vdGNfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1bnJlcGF5bWVudHNfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcmluZm8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2Njc5MS04OWZmYjUwMi01ZWU1LTExZTctOGE1Yi1jNTk1MGI2OGFjNjUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd3d3Lm9rY29pbi5jb20vdjInLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vd3d3Lm9rY29pbi5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cub2tjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5va2NvaW4uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cub2tjb2luLmNvbS9yZXN0X2dldFN0YXJ0ZWQuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5ucG1qcy5jb20vcGFja2FnZS9va2NvaW4uY29tJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMud2ViR2V0TWFya2V0c1Byb2R1Y3RzICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRzW2ldWydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBpZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSB1cHBlcmNhc2Uuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0c1tpXVsnbWF4U2l6ZURpZ2l0J10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0c1tpXVsnbWF4UHJpY2VEaWdpdCddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldHNbaV0sXG4gICAgICAgICAgICAgICAgJ3R5cGUnOiAnc3BvdCcsXG4gICAgICAgICAgICAgICAgJ3Nwb3QnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmdXR1cmUnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRzW2ldWydtaW5UcmFkZVNpemUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoIChtYXJrZXQpO1xuICAgICAgICAgICAgaWYgKCh0aGlzLmhhc0Z1dHVyZU1hcmtldHMpICYmIChtYXJrZXRbJ3F1b3RlJ10gPT0gJ1VTRFQnKSkge1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAobWFya2V0LCB7XG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6ICdVU0QnLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydiYXNlJ10gKyAnL1VTRCcsXG4gICAgICAgICAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXS5yZXBsYWNlICgndXNkdCcsICd1c2QnKSxcbiAgICAgICAgICAgICAgICAgICAgJ3R5cGUnOiAnZnV0dXJlJyxcbiAgICAgICAgICAgICAgICAgICAgJ3Nwb3QnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3B1YmxpY0dldCc7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKG1hcmtldFsnZnV0dXJlJ10pIHtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnRnV0dXJlJztcbiAgICAgICAgICAgIHJlcXVlc3RbJ2NvbnRyYWN0X3R5cGUnXSA9ICd0aGlzX3dlZWsnOyAvLyBuZXh0X3dlZWssIHF1YXJ0ZXJcbiAgICAgICAgfVxuICAgICAgICBtZXRob2QgKz0gJ0RlcHRoJztcbiAgICAgICAgbGV0IG9yZG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3NlbGwnXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2wnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHVibGljR2V0JztcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9O1xuICAgICAgICBpZiAobWFya2V0WydmdXR1cmUnXSkge1xuICAgICAgICAgICAgbWV0aG9kICs9ICdGdXR1cmUnO1xuICAgICAgICAgICAgcmVxdWVzdFsnY29udHJhY3RfdHlwZSddID0gJ3RoaXNfd2Vlayc7IC8vIG5leHRfd2VlaywgcXVhcnRlclxuICAgICAgICB9XG4gICAgICAgIG1ldGhvZCArPSAnVGlja2VyJzt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WydhbW91bnQnXSksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHVibGljR2V0JztcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9O1xuICAgICAgICBpZiAobWFya2V0WydmdXR1cmUnXSkge1xuICAgICAgICAgICAgbWV0aG9kICs9ICdGdXR1cmUnO1xuICAgICAgICAgICAgcmVxdWVzdFsnY29udHJhY3RfdHlwZSddID0gJ3RoaXNfd2Vlayc7IC8vIG5leHRfd2VlaywgcXVhcnRlclxuICAgICAgICB9XG4gICAgICAgIG1ldGhvZCArPSAnVHJhZGVzJztcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT0hMQ1YgKHN5bWJvbCwgdGltZWZyYW1lID0gJzFtJywgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gMTQ0MCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3B1Ymx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yAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3ByaXZhdGVQb3N0JztcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKG1hcmtldFsnZnV0dXJlJ10pIHtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnRnV0dXJlJztcbiAgICAgICAgICAgIG9yZGVyID0gdGhpcy5leHRlbmQgKG9yZGVyLCB7XG4gICAgICAgICAgICAgICAgJ2NvbnRyYWN0X3R5cGUnOiAndGhpc193ZWVrJywgLy8gbmV4dF93ZWVrLCBxdWFydGVyXG4gICAgICAgICAgICAgICAgJ21hdGNoX3ByaWNlJzogMCwgLy8gbWF0Y2ggYmVzdCBjb3VudGVyIHBhcnR5IHByaWNlPyAwIG9yIDEsIGlnbm9yZXMgcHJpY2UgaWYgMVxuICAgICAgICAgICAgICAgICdsZXZlcl9yYXRlJzogMTAsIC8vIGxldmVyYWdlIHJhdGUgdmFsdWU6IDEwIG9yIDIwICgxMCBieSBkZWZhdWx0KVxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmICh0eXBlID09ICdsaW1pdCcpIHtcbiAgICAgICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgb3JkZXJbJ3R5cGUnXSArPSAnX21hcmtldCc7XG4gICAgICAgICAgICAgICAgaWYgKHNpZGUgPT0gJ2J1eScpIHtcbiAgICAgICAgICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSB0aGlzLnNhZmVGbG9hdCAocGFyYW1zLCAnY29zdCcpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIW9yZGVyWydwcmljZSddKVxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIG1hcmtldCBidXkgb3JkZXJzIHJlcXVpcmUgYW4gYWRkaXRpb25hbCBjb3N0IHBhcmFtZXRlciwgY29zdCA9IHByaWNlICogYW1vdW50Jyk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgb3JkZXJbJ2Ftb3VudCddID0gYW1vdW50O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBwYXJhbXMgPSB0aGlzLm9taXQgKHBhcmFtcywgJ2Nvc3QnKTtcbiAgICAgICAgbWV0aG9kICs9ICdUcmFkZSc7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnb3JkZXJfaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgaWYgKCFzeW1ib2wpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgY2FuY2VsT3JkZXIoKSByZXF1aXJlcyBhIHN5bWJvbCBhcmd1bWVudCcpO1xuICAgICAgICB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4gJ2NhbmNlbGVkJztcbiAgICAgICAgcmV0dXJuIHN0YXR1cztcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgdHlwZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCd0eXBlJyBpbiBvcmRlcikge1xuICAgICAgICAgICAgaWYgKChvcmRlclsndHlwZSddID09ICdidXknKSB8fCAob3JkZXJbJ3R5cGUnXSA9PSAnc2VsbCcpKSB7XG4gICAgICAgICAgICAgICAgc2lkZSA9IG9yZGVyWyd0eXBlJ107XG4gICAgICAgICAgICAgICAgdHlwZSA9ICdsaW1pdCc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHNpZGUgPSAob3JkZXJbJ3R5cGUnXSA9PSAnYnV5X21hcmtldCcpID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgICAgICAgICAgdHlwZSA9ICdtYXJrZXQnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBzdGF0dXMgPSB0aGlzLnBhcnNlT3JkZXJTdGF0dXMgKG9yZGVyWydzdGF0dXMnXSk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICghbWFya2V0KSB7XG4gICAgICAgICAgICBpZiAoJ3N5bWJvbCcgaW4gb3JkZXIpXG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydzeW1ib2wnXSBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtvcmRlclsnc3ltYm9sJ11dO1xuICAgICAgICB9XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY3JlYXRlRGF0ZUZpZWxkID0gdGhpcy5nZXRDcmVhdGVEYXRlRmllbGQgKCk7XG4gICAgICAgIGlmIChjcmVhdGVEYXRlRmllbGQgaW4gb3JkZXIpXG4gICAgICAgICAgICB0aW1lc3RhbXAgPSBvcmRlcltjcmVhdGVEYXRlRmllbGRdO1xuICAgICAgICBsZXQgYW1vdW50ID0gb3JkZXJbJ2Ftb3VudCddO1xuICAgICAgICBsZXQgZmlsbGVkID0gb3JkZXJbJ2RlYWxfYW1vdW50J107XG4gICAgICAgIGxldCByZW1haW5pbmcgPSBhbW91bnQgLSBmaWxsZWQ7XG4gICAgICAgIGxldCBhdmVyYWdlID0gb3JkZXJbJ2F2Z19wcmljZSddO1xuICAgICAgICBsZXQgY29zdCA9IGF2ZXJhZ2UgKiBmaWxsZWQ7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyX2lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IG9yZGVyWydwcmljZSddLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiBhdmVyYWdlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgIC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ICAgICAgICAgICBpZiAoJ3R5cGUnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgICAgIHN0YXR1cyA9IHBhcmFtc1sndHlwZSddO1xuICAgICAgICAgICAgfSBlbHNlIGlmICgnc3RhdHVzJyBpbiBwYXJhbXMpIHtcbiAgICAgICAgICAgICAgICBzdGF0dXMgPSBwYXJhbXNbJ3N0YXR1cyddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZmV0Y2hPcmRlcnMoKSByZXF1aXJlcyB0eXBlIHBhcmFtIG9yIHN0YXR1cyBwYXJhbSBmb3Igc3BvdCBtYXJrZXQgJyArIHN5bWJvbCArICcgKDAgb3IgXCJvcGVuXCIgZm9yIHVuZmlsbGVkIG9yZGVycywgMSBvciBcImNsb3NlZFwiIGZvciBmaWxsZWQgb3JkZXJzKScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSAnb3BlbicpXG4gICAgICAgICAgICAgICAgc3RhdHVzID0gMDtcbiAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gJ2Nsb3NlZCcpXG4gICAgICAgICAgICAgICAgc3RhdHVzID0gMTtcbiAgICAgICAgICAgIGlmIChvcmRlcl9pZF9pbl9wYXJhbXMpIHtcbiAgICAgICAgICAgICAgICBtZXRob2QgKz0gJ09yZGVyc0luZm8nO1xuICAgICAgICAgICAgICAgIHJlcXVlc3QgPSB0aGlzLmV4dGVuZCAocmVxdWVzdCwge1xuICAgICAgICAgICAgICAgICAgICAndHlwZSc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbWV0aG9kICs9ICdPcmRlckhpc3RvcnknO1xuICAgICAgICAgICAgICAgIHJlcXVlc3QgPSB0aGlzLmV4dGVuZCAocmVxdWVzdCwge1xuICAgICAgICA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L3BhZ2UvZGV2ZWxvcGVycycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY291bnRyaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkYXRhL3tpZH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkYXRhL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkYXRhL3tpZH0vZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fY2hhcnRzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX2NoYXJ0cy97aWR9L2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21lcmNoYW50L2dldF9wYXltZW50L3tVVUlEfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9hZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYWRkcmVzc2VzL3tidGNfYWRkcmVzc30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL29yZGVycy97VVVJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJpY2VfYWxlcnRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3BheW1lbnRfcmVxdWVzdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJpY2VfYWxlcnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZXJjaGFudC9jcmVhdGVfcGF5bWVudCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vcmRlcnMve1VVSUR9L2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcmljZV9hbGVydHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0VVUic6IHsgJ2lkJzogJ2V1cicsICdzeW1ib2wnOiAnQlRDL0VVUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdFVVInIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDA1OSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDU5LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldFVzZXIgKCk7XG4gICAgICAgIGxldCByZXN1bHQg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0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocGFyYW1zKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG5vbmNlICsgdXJsICsgYm9keTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0FwaS1LZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnQXBpLVNpZ25hdHVyZSc6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLnNlY3JldCksXG4gICAgICAgICAgICAgICAgJ0FwaS1Ob25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuIC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llcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnNW0nOiAzMDAsXG4gICAgICAgICAgICAgICAgJzE1bSc6IDkwMCxcbiAgICAgICAgICAgICAgICAnMzBtJzogMTgwMCxcbiAgICAgICAgICAgICAgICAnMmgnOiA3MjAwLFxuICAgICAgICAgICAgICAgICc0aCc6IDE0NDAwLFxuICAgICAgICAgICAgICAgICcxZCc6IDg2NDAwLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY4MTctZTk0NTYzMTItNWVlNi0xMWU3LTliM2MtYjYyOGNhNTYyNmE1LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3BvbG9uaWV4LmNvbS9wdWJsaWMnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3BvbG9uaWV4LmNvbS90cmFkaW5nQXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3BvbG9uaWV4LmNvbS9zdXBwb3J0L2FwaS8nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cDovL3Bhc3RlYmluLmNvbS9kTVg3bVpFMCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3BvbG9uaWV4LmNvbS9mZWVzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuMjRoVm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5DaGFydERhdGEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkN1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkxvYW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybk9yZGVyQm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5UcmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsTG9hbk9mZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2xvc2VNYXJnaW5Qb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlTG9hbk9mZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZW5lcmF0ZU5ld0FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE1hcmdpblBvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5CdXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpblNlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21vdmVPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuQWN0aXZlTG9hbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkF2YWlsYWJsZUFjY291bnRCYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuQmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkNvbXBsZXRlQmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkRlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkRlcG9zaXRzV2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkZlZUluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkxlbmRpbmdIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5NYXJnaW5BY2NvdW50U3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuT3BlbkxvYW5PZmZlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybk9wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybk9yZGVyVHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5UcmFkYWJsZUJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5UcmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RvZ2dsZUF1dG9SZW5ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXJCYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDE1LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IDAuMCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMDAwMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogMTAwMDAwMDAwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAuMDAwMDAwMDEsXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiAxMDAwMDAwMDAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMDAwMDAwLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogMTAwMDAwMDAwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNhbGN1bGF0ZUZlZSAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlLCB0YWtlck9yTWFrZXIgPSAndGFrZXInLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgIGxldCBrZXkgPSAncXVvdGUnO1xuICAgICAgICBsZXQgcmF0ZSA9IG1hcmtldFt0YWtlck9yTWFrZXJdO1xuICAgICAgICBsZXQgY29zdCA9IHBhcnNlRmxvYXQgKHRoaXMuY29zdFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCAqIHJhdGUpKTtcbiAgICAgICAgaWYgKHNpZGUgPT0gJ3NlbGwnKSB7XG4gICAgICAgICAgICBjb3N0ICo9IHByaWNlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAga2V5ID0gJ2Jhc2UnO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndHlwZSc6IHRha2VyT3JNYWtlcixcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFtrZXldLFxuICAgICAgICAgICAgJ3JhdGUnOiByYXRlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0ICh0aGlzLmZlZVRvUHJlY2lzaW9uIChzeW1ib2wsIGNvc3QpKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBjb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KSB7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQlRNJylcbiAgICAgICAgICAgIHJldHVybiAnQml0bWFyayc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnU1RSJylcbiAgICAgICAgICAgIHJldHVybiAnWExNJztcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGN1cnJlbmN5SWQgKGN1cnJlbmN5KSB7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQml0bWFyaycpXG4gICAgICAgICAgICByZXR1cm4gJ0JUTSc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnWExNJylcbiAgICAgICAgICAgIHJldHVybiAnU1RSJztcbiAgICAgICAgcmV0dXJuIGN1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gICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnbG90JzogdGhpcy5saW1pdHNbJ2Ftb3VudCddWydtaW4nXSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFJldHVybkNvbXBsZXRlQmFsYW5jZXMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnYWNjb3VudCc6ICdhbGwnLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaWRdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlJ10pLFxuICAgICAgICAgICAgICAgICd1c2VkJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnb25PcmRlcnMnXSksXG4gIC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R1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gyNGhyJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93MjRociddKSxcbiAgICAgICAgICAgICdiaWQnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2hlc3RCaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydsb3dlc3RBc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogcGFyc2VGbG9hdCAodGlja2VyWydwZXJjZW50Q2hhbmdlJ10pLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWydxdW90ZVZvbHVtZSddKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmFzZVZvbHVtZSddKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFJldHVyblRpY2tlciAocGFyYW1zKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hDdXJyZW5jaWVzIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgY3VycmVuY2llc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2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAnZmVlJzogY3VycmVuY3lbJ3R4RmVlJ10sIC8vIHRvZG86IHJlZGVzaWduXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsndHhGZWUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRSZXR1cm5UaWNrZXIgKHBhcmFtcyk7XG4gICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW21hcmtldFsnaWQnXV07XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydkYXRlJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgYmFzZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHF1b3RlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoKCFtYXJrZXQpICYmICgnY3VycmVuY3lQYWlyJyBpbiB0cmFkZSkpIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeVBhaXIgPSB0cmFkZVsnY3VycmVuY3lQYWlyJ107XG4gICAgICAgICAgICBpZiAoY3VycmVuY3lQYWlyIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtjdXJyZW5jeVBhaXJdO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgcGFydHMgPSBjdXJyZW5jeVBhaXIuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICAgICAgcXVvdGUgPSBwYXJ0c1swXTtcbiAgICAgICAgICAgICAgICBiYXNlID0gcGFydHNbMV07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBiYXNlID0gbWFya2V0WydiYXNlJ107XG4gICAgICAgICAgICBxdW90ZSA9IG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgc2lkZSA9IHRyYWRlWyd0eXBlJ107XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAndG90YWwnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHBhcnNlRmxvYXQgKHRyYWRlWydhbW91bnQnXSk7XG4gICAgICAgIGlmICgnZmVlJyBpbiB0cmFkZSkge1xuICAgICAgICAgICAgbGV0IHJhdGUgPSBwYXJzZUZsb2F0ICh0cmFkZVsnZmVlJ10pO1xuICAgICAgICAgICAgbGV0IGZlZUNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoc2lkZSA9PSAnYnV5Jykge1xuICAgICAgICAgICAgICAgIGN1cnJlbmN5ID0gYmFzZTtcbiAgICAgICAgICAgICAgICBmZWVDb3N0ID0gYW1vdW50ICogcmF0ZTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY3VycmVuY3kgPSBxdW90ZTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvc3QgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBmZWVDb3N0ID0gY29zdCAqIHJhdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ3JhdGUnOiByYXRlLFxuICAgICAgICAgICAgICAgICdjb3N0JzogZmVlQ29zdCxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0cmFkZUlEJyksXG4gICAgICAgICAgICAnb3JkZXInOiB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAnb3JkZXJOdW1iZXInKSxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydyYXRlJ10pLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZp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B7ICdjdXJyZW5jeVBhaXInOiBwYWlyIH07XG4gICAgICAgIGlmIChzaW5jZSkge1xuICAgICAgICAgICAgcmVxdWVzdFsnc3RhcnQnXSA9IHBhcnNlSW50IChzaW5jZSAvIDEwMDApO1xuICAgICAgICAgICAgcmVxdWVzdFsnZW5kJ10gPSB0aGlzLnNlY29uZHMgKCk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gbGltaXQgaXMgZGlzYWJsZWQgKGRvZXMgbm90IHJlYWxseSB3b3JrIGFzIGV4cGVjdGVkKVxuICAgICAgICAvLyBpZiAobGltaXQpXG4gICAgICAgIC8vICAgICByZXF1ZXN0WydsaW1pdCddID0gcGFyc2VJbnQgKGxpbWl0KTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFJldHVyblRyYWRlSGlzdG9yeSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlLCBtYXJrZXQpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRyYWRlcyA9IHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlW2lkXSwgbWFya2V0KTtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCB0cmFkZXMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0cmFkZXNbal0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLmZpbHRlckJ5U2luY2VMaW1pdCAocmVzdWx0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMuc2FmZUludGVnZXIgKG9yZGVyLCAndGltZXN0YW1wJyk7XG4gICAgICAgIGlmICghdGltZXN0YW1wKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKG9yZGVyWydkYXRlJ10pO1xuICAgICAgICBsZXQgdHJhZGVzID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ3Jlc3VsdGluZ1RyYWRlcycgaW4gb3JkZXIpXG4gICAgICAgICAgICB0cmFkZXMgPSB0aGlzLnBhcnNlVHJhZGVzIChvcmRlclsncmVzdWx0aW5nVHJhZGVzJ10sIG1hcmtldCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgcHJpY2UgPSBwYXJzZUZsb2F0IChvcmRlclsncHJpY2UnXSk7XG4gICAgICAgIGxldCBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAndG90YWwnLCAwLjApO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnYW1vdW50Jyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdzdGFydGluZ0Ftb3VudCcsIHJlbWFpbmluZyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyTnVtYmVyJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IG9yZGVyWydzdGF0dXMnXSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlT3Blbk9yZGVycyAob3JkZXJzLCBtYXJrZXQsIHJlc3VsdCA9IFtdKSB7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb3JkZXJzLmxlbmd0a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gICAgICAgb3Blbk9yZGVycyA9IHRoaXMucGFyc2VPcGVuT3JkZXJzIChyZXNwb25zZSwgbWFya2V0LCBvcGVuT3JkZXJzKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXRJZHMgPSBPYmplY3Qua2V5cyAocmVzcG9uc2UpO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRJZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgbWFya2V0SWQgPSBtYXJrZXRJZHNbaV07XG4gICAgICAgICAgICAgICAgbGV0IG9yZGVycyA9IHJlc3BvbnNlW21hcmtldElkXTtcbiAgICAgICAgICAgICAgICBsZXQgbSA9IHRoaXMubWFya2V0c19ieV9pZFttYXJrZXRJZF07XG4gICAgICAgICAgICAgICAgb3Blbk9yZGVycyA9IHRoaXMucGFyc2VPcGVuT3JkZXJzIChvcmRlcnMsIG0sIG9wZW5PcmRlcnMpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgb3Blbk9yZGVycy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgdGhpcy5vcmRlcnNbb3Blbk9yZGVyc1tqXVsnaWQnXV0gPSBvcGVuT3JkZXJzW2pdO1xuICAgICAgICB9XG4gICAgICAgIGxldCBvcGVuT3JkZXJzSW5kZXhlZEJ5SWQgPSB0aGlzLmluZGV4QnkgKG9wZW5PcmRlcnMsICdpZCcpO1xuICAgICAgICBsZXQgY2FjaGVkT3JkZXJJZHMgPSBPYmplY3Qua2V5cyAodGhpcy5vcmRlcnMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDwgY2FjaGVkT3JkZXJJZHMubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGNhY2hlZE9yZGVySWRzW2tdO1xuICAgICAgICAgICAgaWYgKGlkIGluIG9wZW5PcmRlcnNJbmRleGVkQnlJZCkge1xuICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHRoaXMuZXh0ZW5kICh0aGlzLm9yZGVyc1tpZF0sIG9wZW5PcmRlcnNJbmRleGVkQnlJZFtpZF0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgb3JkZXIgPSB0aGlzLm9yZGVyc1tpZF07XG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydzdGF0dXMnXSA9PSAnb3BlbicpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gdGhpcy5leHRlbmQgKG9yZGVyLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ2Nsb3NlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29zdCc6IG9yZGVyWydhbW91bnQnXSAqIG9yZGVyWydwcmljZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpbGxlZCc6IG9yZGVyWydhbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZW1haW5pbmcnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBvcmRlciA9IHRoaXMub3JkZXJzW2lkXTtcbiAgICAgICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgICAgICBpZiAob3JkZXJbJ3N5bWJvbCddID09IHN5bWJvbClcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKG9yZGVyKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKG9yZGVyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5maWx0ZXJCeVNpbmNlTGltaXQgKHJlc3V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gICAgfSk7XG4gICAgICAgICAgICByZXN1bHQgPSB0aGlzLmV4dGVuZCAodGhpcy5vcmRlcnNbbmV3aWRdLCB7ICdpbmZvJzogcmVzcG9uc2UgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXN1bHQgPSB7XG4gICAgICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnb3JkZXJOdW1iZXInXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gdW5kZWZpbmVkO1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0Q2FuY2VsT3JkZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ29yZGVyTnVtYmVyJzogaWQsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm9yZGVycylcbiAgICAgICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF1bJ3N0YXR1cyddID0gJ2NhbmNlbGVkJztcbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgaWYgKHRoaXMubGFzdF9odHRwX3Jlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMubGFzdF9odHRwX3Jlc3BvbnNlLmluZGV4T2YgKCdJbnZhbGlkIG9yZGVyJykgPj0gMClcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKHRoaXMuaWQ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B7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICdhZGRyZXNzJzogYWRkcmVzcyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIHdpdGhkcmF3IChjdXJyZW5jeSwgYW1vdW50LCBhZGRyZXNzLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgY3VycmVuY3lJZCA9IHRoaXMuY3VycmVuY3lJZCAoY3VycmVuY3kpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFdpdGhkcmF3ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3lJZCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXN1bHQsXG4gICAgICAgICAgICAnaWQnOiByZXN1bHRbJ3Jlc3BvbnNlJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmV4dGVuZCAoeyAnY29tbWFuZCc6IHBhdGggfSwgcGFyYW1zKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIHF1ZXJ5Wydub25jZSddID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdTaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGNvZGUgPj0gNDAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSA9PSBcIntcIikge1xuICAgICAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBlcnJvciA9IHRoaXMuaWQgKyAnICcgKyBib2R5O1xuICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2VbJ2Vycm9yJ10uaW5kZXhPZiAoJ1RvdGFsIG11c3QgYmUgYXQgbGVhc3QnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyIChlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocmVzcG9uc2VbJ2Vycm9yJ10uaW5kZXhPZiAoJ05vdCBlbm91Z2gnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yIChlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgaWYgKCdlcnJvcicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGxldCBlcnJvciA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICAgICAgIGxldCBmYWlsZWQgPSByZXNwb25zZVsnZXJyb3InXS5pbmRleE9mICgnTm90IGVub3VnaCcpID49ID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gICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMwOTUzOTE1LWIxNjExZGMwLWE0MzYtMTFlNy04OTQ3LWM5NWJkNWE0MjA4Ni5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkucXJ5cHRvcy5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cucXJ5cHRvcy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9kZXZlbG9wZXJzLnF1b2luZS5jb20nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS9wcmljZV9sZXZlbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4ZWN1dGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2lyX2xhZGRlcnMve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcnlwdG9fYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4ZWN1dGlvbnMvbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpYXRfYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW5fYmlkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve2lkfS9sb2FucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ19hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ19hY2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlhdF9hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbl9iaWRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW5fYmlkcy97aWR9L2Nsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2Fucy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0vY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3tpZH0vY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9jbG9zZV9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmdfYWNjb3VudHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQcm9kdWN0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ2Jhc2VfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncXVvdGVkX2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21ha2VyX2ZlZScpO1xuICAgICAgICAgICAgbGV0IHRha2VyID0gdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ3Rha2VyX2ZlZScpO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9ICFtYXJrZXRbJ2Rpc2FibGVkJ107XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudHNCYWxhbmNlICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHRvdGFsID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnYmFsYW5jZSddKTtcbiAgICAgICAgICAgIGx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3ByaWNlJ10ubGVuZ3RoO1xuICAgICAgICAgICAgICAgIGlmIChsZW5ndGggPiAwKVxuICAgICAgICAgICAgICAgICAgICBsYXN0ID0gcGFyc2VGbG9hdCAodGlja2VyWydsYXN0X3RyYWRlZF9wcmljZSddKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaF9tYXJrZXRfYXNrJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvd19tYXJrZXRfYmlkJyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21hcmtldF9iaWQnKSxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbWFya2V0X2FzaycpLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAg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AgICAgICBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG9yZGVyWydzdGF0dXMnXSA9PSAnZmlsbGVkJykge1xuICAgICAgICAgICAgICAgIHN0YXR1cyA9ICdjbG9zZWQnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChvcmRlclsnc3RhdHVzJ10gPT0gJ2NhbmNlbGxlZCcpIHsgLy8gJ2xsJyBpbnRlbmRlZFxuICAgICAgICAgICAgICAgIHN0YXR1cyA9ICdjYW5jZWxlZCc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGFtb3VudCA9IHBhcnNlRmxvYXQgKG9yZGVyWydxdWFudGl0eSddKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHBhcnNlRmxvYXQgKG9yZGVyWydmaWxsZWRfcXVhbnRpdHknXSk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ29yZGVyX3R5cGUnXSxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsnc2lkZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogb3JkZXJbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ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hpcy5mZXRjaE9yZGVycyAoc3ltYm9sLCBzaW5jZSwgbGltaXQsIHRoaXMuZXh0ZW5kICh7ICdzdGF0dXMnOiAnY2xvc2VkJyB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoY29kZSA9PSAyMDAgfHwgY29kZSA9PSA0MDQgfHwgY29kZSA9PSA0MjIpIHtcbiAgICAgICAgICAgIGlmICgoYm9keVswXSA9PSAneycpIHx8IChib2R5WzBdID09ICdbJykpIHtcbiAgICAgICAgICAgICAgICByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBpZiBub3QgYSBKU09OIHJlc3BvbnNlXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIHJldHVybmVkIGEgbm9uLUpTT04gcmVwbHk6ICcgKyBib2R5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoY29kZSA9PSA0MDQpIHtcbiAgICAgICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2VbJ21lc3NhZ2UnXSA9PSAnT3JkZXIgbm90IGZvdW5kJykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChjb2RlID09IDQyMikge1xuICAgICAgICAgICAgaWYgKCdlcnJvcnMnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGVycm9ycyA9IHJlc3BvbnNlWydlcnJvcnMnXTtcbiAgICAgICAgICAgICAgICBpZiAoJ3VzZXInIGluIGVycm9ycykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZXMgPSBlcnJvcnNbJ3VzZXInXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2VzLmluZGV4T2YgKCdub3RfZW5vdWdoX2ZyZWVfYmFsYW5jZScpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgncXVhbnRpdHknIGluIGVycm9ycykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZXMgPSBlcnJvcnNbJ3F1YW50aXR5J107XG4gICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlcy5pbmRleE9mICgnbGVzc190aGFuX29yZGVyX3NpemUnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICdYLVF1b2luZS1BUEktVmVyc2lvbic6IHRoaXMudmVyc2lvbixcbiAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgICAgICdwYXRoJzogdXJsLFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICd0b2tlbl9pZCc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdpYXQnOiBNYXRoLmZsb29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F0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YyJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgIC8vIG9ic29sZXRlIG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIC8vIG5ldyBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2ODI1LTk4YTZkMGRlLTVlZTctMTFlNy05ZmE0LTM4ZTExYTJjNmY1Mi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkucXVhZHJpZ2FjeC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cucXVhZHJpZ2FjeC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cucXVhZHJpZ2FjeC5jb20vYXBpX2luZm8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd1aWQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl9kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aGVyX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXRoZXJfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9va3VwX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9DQUQnOiB7ICdpZCc6ICdidGNfY2FkJywgJ3N5bWJvbCc6ICdCVEMvQ0FEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0NBRCcsICdtYWtlcic6IDAuMDA1LCAndGFrZXInOiAwLjAwNSB9LFxuICAgICAgICAgICAgICA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93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB2d2FwLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGUnXSkgKiAxMDAwO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRlc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gfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0gWyBub25jZS50b1N0cmluZyAoKSwgdGhpcy51aWQsIHRoaXMuYXBpS2V5IF0uam9pbiAoJycpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHJlcXVlc3QpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9LCBwYXJhbXMpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAg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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBzb3V0aHhjaGFuZ2UgZXh0ZW5kcyBFeGNoYW5nZSB7XG5cbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnc291dGh4Y2hhbmdlJyxcbiAgICAgICAgICAgICduYW1lJzogJ1NvdXRoWGNoYW5nZScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0FSJywgLy8gQXJnZW50aW5hXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3ODM4OTEyLTRmOTRlYzhhLTYwZjYtMTFlNy05ZTVkLWJiZjliZDUwYTU1OS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuc291dGh4Y2hhbmdlLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuc291dGh4Y2hhbmdlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5zb3V0aHhjaGFuZ2UuY29tL0hvbWUvQXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2Uve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxNYXJrZXRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZW5lcmF0ZW5ld2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RCYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGxhY2VPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WzBdO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WzFdO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBpZCA9IHN5bWJvbDtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdExpc3RCYWxhbmNlcyAoKTtcbiAgICAgICAgaWYgKCFiYWxhbmNlcylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaEJhbGFuY2UgZ290IGFuIHVucmVjb2duaXplZCByZXNwb25zZScpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydDdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGZyZWUgPSBwYXJzZUZsb2F0IChiYWxhbmNlWydBdmFpbGFibGUnXSk7XG4gICAgICAgICAgICBsZXQgdXNlZCA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ1VuY29uZmlybWVkJ10pO1xuICAgICAgICAgICAgbGV0IHRvdGFsID0gdGhpcy5zdW0gKGZyZWUsIHVzZWQpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBmcmVlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdXNlZCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiB0b3RhbCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEJvb2tTeW1ib2wgKHRoaXMuZXh0ZW5kICh7X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gICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0UHJpY2VTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsnQXQnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydUeXBlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsnUHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnQW1vdW50J10sXG4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XJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcXVlcnkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgICAgICdIYXNoJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZW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W1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2ODY5LTc1MDU3ZmEyLTVlZTktMTFlNy05YTZmLTEzZTY0MWZhNDcwNy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkudGhlcm9ja3RyYWRpbmcuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vdGhlcm9ja3RyYWRpbmcuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkudGhlcm9ja3RyYWRpbmcuY29tL2RvYy92MS9pbmRleC5odG1sJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYXBpLnRoZXJvY2t0cmFkaW5nLmNvbS9kb2MvJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97aWR9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2lkfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy90aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkaXNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Rpc2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9vcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L3Bvc2l0aW9uX2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vcG9zaXRpb25zL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2xpbWl0cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19saW1pdHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdG1zL3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9vcmRlcnMvcmVtb3ZlX2FsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAyLjUsICAvLyB3b3JzdC1jYXNlIHNjZW5hcmlvOiBodHRwczovL3RoZXJvY2t0cmFkaW5nLmNvbS9lbi9wYWdlcy9mZWVzXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRGdW5kc1RpY2tlcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWyd0aWNrZXJzJ10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWyd0aWNrZXJzJ11bcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2Z1bmRfaWQnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGZyZWUgPSBiYWxhbmNlWyd0cmFkaW5nX2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IGJhbGFuY2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCB1c2VkID0gdG90YWwgLSBmcmVlO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBmcmVlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdXNlZCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiB0b3RhbCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0RnVuZHNJZE9yZGVyYm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKG9yZGVyYm9va1snZGF0ZSddKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdGltZXN0YW1wLCAnYmlkcycsICdhc2tzJywgJ3ByaWNlJywgJ2Ftb3VudCcpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRpY2tlclsnZGF0ZSddKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgIC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4JyxcbiAgICAgICAgICAgICduYW1lJzogJ1RpZGV4JyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnVUsnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDIwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICczJyxcbiAgICAgICAgICAgIC8vICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAvLyAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzA3ODE3ODAtMDMxNDlkYzQtYTEyZS0xMWU3LTgyYmItMzEzYjI2OWQyNGQ0LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2FwaS50aWRleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkudGlkZXguY29tL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3RpZGV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3RpZGV4LmNvbS9wdWJsaWMtYXBpJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vdGlkZXguY29tL2Fzc2V0cy1zcGVjJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vdGlkZXguY29tL3BhaXJzLXNwZWMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUUyc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVEVFTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0FWRVMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dDVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0JUQyc6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkNOVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01SVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNRVInOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVFVQSc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JCWCc6IDEwMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RLUyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXVVNEJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dFVVInOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0dPJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFREcnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkxDJzogMC4zLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXSU5HUyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWU0wnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElNRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEFBUyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLT0xJT04nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUklERExFJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTlQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUZZVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNR08nOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd0VUVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdlRVRUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FSTCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdlTUdPJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTk0nOiAxMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pSQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAzMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DTyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVE9SSic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0dSJzogMy4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUQSc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQlQnOiAwLjAwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEyNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3U1VSJzogMC4wNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVVInOiAwLjA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01TUCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJblBheSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEwnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUhUJzogMC4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJTkcnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9UJzogMC4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFJzogMy4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJWCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1JFRE8nOiAzMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xJRkUnOiAxMDAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRIJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JNQyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUkNUJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tOQyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNU0QnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VCJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTkonOiAyMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPQ0wnOiAzLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5HJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1REWCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQSc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkcnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPUyc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDQwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJOJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JZWic6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQjJCJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NBVCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05PVic6IDI1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJHTic6IDMuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSUUnOiAyMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDUwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0FYJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FHSSc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRUUnOiAyMC4wLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG59XG4iLCJcInVzZSBzdHJpY3RcIjtcblxuLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbmNvbnN0IGZveGJpdCA9IHJlcXVpcmUgKCcuL2ZveGJpdC5qcycpXG5cbi8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIHVyZHViaXQgZXh0ZW5kcyBmb3hiaXQge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3VyZHViaXQnLFxuICAgICAgICAgICAgJ25hbWUnOiAnVXJkdUJpdCcsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1BLJy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GlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAndmF1bHRvcm8nLFxuICAgICAgICAgICAgJ25hbWUnOiAnVmF1bHRvcm8nLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDSCcsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJzEnLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2Njg4MC1mMjA1ZTg3MC01ZWU5LTExZTctOGZlMi0wZDViMTU4ODA3NTIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLnZhdWx0b3JvLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy52YXVsdG9yby5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9hcGkudmF1bHRvcm8uY29tJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlkYW5kYXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXlvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhdGVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGF0ZXN0dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy9kYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy9ob3VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMvbW9udGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eS97c3ltYm9sfS97dHlwZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL3tzeW1ib2x9L3t0eXBlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1snZGF0YSddO1xuICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnQmFzZUN1cnJlbmN5J107XG4gICAgICAgIGxldCBxdW90ZSA9IG1hcmt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gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnTGFzdFByaWNlJ10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsnMjRoVm9sdW1lJ10pLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydUaW1lJ10pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsnR29sZF9QcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydHb2xkX0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HtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnZGF0YSddWydPcmRlcl9JRCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbElkICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLyc7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSBwYXRoO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgdXJsICs9IHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgfSwgdGhpcy5vbWl0IChwYXJh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ICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICd2aXJ3b3gnLFxuICAgICAgICAgICAgJ25hbWUnOiAnVmlyV29YJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdBVCcsICdFVScgXSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2Njg5NC02ZGE5ZDM2MC01ZWVhLTExZTctOTBhYS00MWYyNzExYjc0MDUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHA6Ly9hcGkudmlyd294LmNvbS9hcGkvanNvbi5waHAnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3d3dy52aXJ3b3guY29tL2FwaS90cmFkaW5nLnBocCcsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LnZpcndveC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cudmlyd294LmNvbS9kZXZlbG9wZXJzLnBocCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdsb2dpbic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3Bhc3N3b3JkJzogdHJ1ZVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbnN0cnVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmVzdFByaWNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0TWFya2V0RGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2VzdGltYXRlTWFya2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRyYWRlZFByaWNlVm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRSYXdUcmFkZURhdGEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFN0YXRpc3RpY3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRlcm1pbmFsTGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0R3JpZExpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEdyaWRTdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5zdHJ1bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEJlc3RQcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE1hcmtldERlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdlc3RpbWF0ZU1hcmtldE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFkZWRQcmljZVZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0UmF3VHJhZGVEYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRTdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUZXJtaW5hbExpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEdyaWRMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRHcmlkU3RhdGlzdGljcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENvbW1pc3Npb25EaXNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENvbW1pc3Npb25EaXNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0SW5zdHJ1bWVudHMgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHNbJ3Jlc3VsdCddKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydyZXN1bHQnXVtrZXlzW3BdXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnaW5zdHJ1bWVudElEJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0Wydsb25nQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnc2hvcnRDdXJyZW5jeSddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3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FzcyddID0gdGhpcy5wYXNzd29yZDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICBpZiAobWV0aG9kID09ICdHRVQnKSB7XG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ2lkJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBhdXRoLCBwYXJhbXMpKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicgfTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAncGFyYW1zJzogdGhpcy5leHRlbmQgKGF1dGgsIHBhcmFtcyksXG4gICAgICAgICAgICAgICAgJ2lkJzogbm9uY2UsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoY29kZSA9PSAyMDApIHtcbiAgICAgICAgICAgIGlmICgoYm9keVswXSA9PSAneycpIHx8IChib2R5WzBdID09ICdbJykpIHtcbiAgICAgICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgICAgICBpZiAoJ3Jlc3VsdCcgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCdlcnJvckNvZGUnIGluIHJlc3VsdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGVycm9yQ29kZSA9IHJlc3VsdFsnZXJyb3JDb2RlJ107XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3JDb2RlICE9ICdPSycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZXJyb3IgcmV0dXJuZWQ6ICcgKyBib2R5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBtYWxmb3JtZWQgcmVzcG9uc2U6IG5vIHJlc3VsdCBpbiByZXNwb25zZTogJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gaWYgbm90IGEgSlNPTiByZXNwb25zZVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm5lZCBhIG5vbi1KU09OIHJlcGx5OiAnICsgYm9keSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG59XG4iLCJcInVzZSBzdHJpY3RcIjtcblxuLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbmNvbnN0IGxpcXVpID0gcmVxdWlyZSAoJy4vbGlxdWkuanMnKVxuY29uc3QgeyBFeGNoYW5nZUVycm9yLCB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ICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3dleC5uei9hcGkvMy9kb2NzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd2V4Lm56L3RhcGkvZG9jcycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3dleC5uei9mZWVzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWN0aXZlT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlckluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYW5zSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ29pbkRlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0NvaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NyZWF0ZUNvdXBvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVkZWVtQ291cG9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTk1DJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05WQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndXBkYXRlZCddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdCcpLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYXZnJyksXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2xfY3VyJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGNvZGUgPT0gMjAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSAhPSAneycpIHtcbiAgICAgICAgICAgICAgICAvLyByZXNwb25zZSBpcyBub3QgSlNPTlxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm5lZCBhIG5vbi1KU09OIHJlcGx5OiAnICsgYm9keSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmICgnc3VjY2VzcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXJlc3BvbnNlWydzdWNjZXNzJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGVycm9yID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAnZXJyb3InKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFlcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIHJldHVybmVkIGEgbWFsZm9ybWVkIGVycm9yOiAnICsgYm9keSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gJ2JhZCBzdGF0dXMnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAodGhpcy5pZCArICcgJyArIGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvci5pbmRleE9mICgnSXQgaXMgbm90IGVub3VnaCcpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSAnUmVxdWVzdHMgdG9vIG9mdGVuJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uICh0aGlzLmlkICsgJyAnICsgZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09ICdub3QgYXZhaWxhYmxlJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uICh0aGlzLmlkICsgJyAnICsgZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09ICdleHRlcm5hbCBzZXJ2aWNlIHVuYXZhaWxhYmxlJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uICh0aGlzLmlkICsgJyAnICsgZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICAvLyB0aGF0J3Mgd2hhdCBmZXRjaE9wZW5PcmRlcnMgcmV0dXJuIGlmIG5vIG9wZW4gb3JkZXJzIChmaXggZm9yICM0ODkpXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgIT0gJ25vIG9yZGVycycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwga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J2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT0hMQ1YnOiBmYWxzZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjgwNTk0MTQtZTIzNTk3MGMtNjYyYy0xMWU3LThjM2EtMDhlMzFmNzg2ODRiLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2NyeXB0b3R0bGl2ZXdlYmFwaS54YnRjZS5uZXQ6ODQ0My9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cueGJ0Y2UuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cueGJ0Y2UuY29tL3RyYWRlYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC54YnRjZS5pbmZvL0tub3dsZWRnZWJhc2UvQXJ0aWNsZS9WaWV3LzUyLzI1L3hidGNlLWV4Y2hhbmdlLWFwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZXZlbDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xldmVsMi97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vdGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzZXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc2VydmVyaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzZXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3kve2ZpbHRlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xldmVsMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGV2ZWwyL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2wnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbC97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGljaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGljay97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXNzZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Fzc2V0L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYXNrL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2JpZC9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS9wZXJpb2RpY2l0aWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vdGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS90aWNrcy9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3RvcnkvY2FjaGUve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2FzaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L2NhY2hlL3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9iaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS9jYWNoZS97c3ltYm9sfS9sZXZlbDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS9jYWNoZS97c3ltYm9sfS90aWNrcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS92ZXJzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRTeW1ib2wgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnU3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnTWFyZ2luQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnUHJvZml0Q3VycmVuY3knXTtcbiAgICAgICAgICAgIGlmIChiYXNlID09ICdEU0gnKVxuICAgICAgICAgICAgICAgIGJhc2UgPSAnREFTSCc7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydJc1RyYWRlQWxsb3dlZCddID8gc3ltYm9sIDogaWQ7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV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nTGFzdFNlbGxUaW1lc3RhbXAnXSkge1xuICAgICAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRpY2tlclsnTGFzdFNlbGxUaW1lc3RhbXAnXTtcbiAgICAgICAgICAgICAgICBsYXN0ID0gdGlja2VyWydMYXN0U2VsbFByaWNlJ107XG4gICAgICAgICAgICB9XG4gICAgICAgIGlmICghdGltZXN0YW1wKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRpY2tlclsnRGFpbHlCZXN0QnV5UHJpY2UnXSxcbiAgICAgICAgICAgICdsb3cnOiB0aWNrZXJbJ0RhaWx5QmVzdFNlbGxQcmljZSddLFxuICAgICAgICAgICAgJ2JpZCc6IHRpY2tlclsnQmVzdEJpZCddLFxuICAgICAgICAgICAgJ2Fzayc6IHRpY2tlclsnQmVzdEFzayddLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aWNrZXJbJ0RhaWx5VHJhZGVkVG90YWxWb2x1bWUnXSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlciAocGFyYW1zKTtcbiAgICAgICAgdGlja2VycyA9IHRoaXMuaW5kZXhCeSAodGlja2VycywgJ1N5bWJvbCcpO1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgICAgIGxldCBx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W5lZCkge1xuICAgICAgICBpZiAoIXRoaXMuYXBpS2V5KVxuICAgICAgICAgICAgdGhyb3cgbmV3IEF1dGhlbnRpY2F0aW9uRXJyb3IgKHRoaXMuaWQgKyAnIHJlcXVpcmVzIGFwaUtleSBmb3IgYWxsIHJlcXVlc3RzLCB0aGVpciBwdWJsaWMgQVBJIGlzIGFsd2F5cyBidXN5Jyk7XG4gICAgICAgIGlmICghdGhpcy51aWQpXG4gICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgcmVxdWlyZXMgdWlkIHByb3BlcnR5IGZvciBhdXRoZW50aWNhdGlvbiBhbmQgdHJhZGluZywgdGhlaXIgcHVibGljIEFQSSBpcyBhbHdheXMgYnVzeScpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbjtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJylcbiAgICAgICAgICAgIHVybCArPSAnLycgKyBhcGk7XG4gICAgICAgIHVybCArPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBoZWFkZXJzID0geyAnQWNjZXB0LUVuY29kaW5nJzogJ2d6aXAsIGRlZmxhdGUnIH07XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyc1snQ29udGVudC1UeXBlJ10gPSAnYXBwbGljYXRpb24vanNvbic7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG5vbmNlICsgdGhpcy51aWQgKyB0aGlzLmFwaUtleSArIG1ldGhvZCArIHVybDtcbiAgICAgICAgICAgIGlmIChib2R5KVxuICAgICAgICAgICAgICAgIGF1dGggKz0gYm9keTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTI1NicsICdiYXNlNjQnKTtcbiAgICAgICAgICAgIGxldCBjcmVkZW50aWFscyA9IHRoaXMudWlkICsgJzonICsgdGhpcy5hcGlLZXkgKyAnOicgKyBub25jZSArICc6JyArIHRoaXMuYmluYXJ5VG9TdHJpbmcgKHNpZ25hdHVyZSk7XG4gICAgICAgICAgICBoZWFkZXJzWydBdXRob3JpemF0aW9uJ10gPSAnSE1BQyAnICsgY3JlZGVudGlhbHM7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlc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1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjkxMC1jZGNiZmRhZS01ZWVhLTExZTctOTg1OS0wM2ZlYTg3MzI3MmQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8veW9iaXQubmV0L2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8veW9iaXQubmV0L3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy55b2JpdC5uZXQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cueW9iaXQubmV0L2VuL2FwaS8nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vd3d3LnlvYml0Lm5ldC9lbi9mZWVzLycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWN0aXZlT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0RGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVySW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdDb2luc1RvQWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogMC4wMDA1LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICBsZXQgc3Vic3RpdHV0aW9ucyA9IHtcbiAgICAgICAgICAgICdBSVInOiAnQWlyQ29pbicsXG4gICAgICAgICAgICAnQU5JJzogJ0FOSUNvaW4nLFxuICAgICAgICAgICAgJ0FOVCc6ICdBbnRzQ29pbicsXG4gICAgICAgICAgICAnQVRNJzogJ0F1dHVtbmNvaW4nLFxuICAgICAgICAgICAgJ0JDQyc6ICdCQ0gnLFxuICAgICAgICAgICAgJ0JUUyc6ICdCaXRzaGFyZXMyJyxcbiAgICAgICAgICAgICdEQ1QnOiAnRGlzY291bnQnLFxuICAgICAgICAgICAgJ0RHRCc6ICdEYXJrR29sZENvaW4nLFxuICAgICAgICAgICAgJ0lDTic6ICdpQ29pbicsXG4gICAgICAgICAgICAnTElaSSc6ICdMaVppJyxcbiAgICAgICAgICAgICdMVU4nOiAnTHVuYXJDb2luJyxcbiAgICAgICAgICAgICdOQVYnOiAnTmF2YWpvQ29pbicsXG4gICAgICAgICAgICAnT01HJzogJ09NR2FtZScsXG4gICAgICAgICAgICAnUEFZJzogJ0VQQVknLFxuICAgICAgICAgICAgJ1JFUCc6ICdSZXB1YmxpY29pbicsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChjdXJyZW5jeSBpbiBzdWJzdGl0dXRpb25zKVxuICAgICAgICAgICAgcmV0dXJuIHN1YnN0aXR1dGlvbnNbY3VycmVuY3ldO1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgY3VycmVuY3lJZCAoY29tbW9uQ29kZSkge1xuICAgICAgICBsZXQgc3Vic3RpdHV0aW9ucyA9IHtcbiAgICAgICAgICAgICdBaXJDb2luJzogJ0FJUicsXG4gICAgICAgICAgICAnQU5JQ29pbic6ICdBTkknLFxuICAgICAgICAgICAgJ0FudHNDb2luJzogJ0FOVCcsXG4gICAgICAgICAgICAnQXV0dW1uY29pbic6ICdBVE0nLFxuICAgICAgICAgICAgJ0JDSCc6ICdCQ0MnLFxuICAgICAgICAgICAgJ0JpdHNoYXJlczInOiAnQlRTJyxcbiAgICAgICAgICAgICdEaXNjb3VudCc6ICdEQ1QnLFxuICAgICAgICAgICAgJ0RhcmtHb2xkQ29pbic6ICdER0QnLFxuICAgICAgICAgICAgJ2lDb2luJzogJ0lDTicsXG4gICAgICAgICAgICAnTGlaaSc6ICdMSVpJJyxcbiAgICAgICAgICAgICdMdW5hckNvaW4nOiAnTFVOJyxcbiAgICAgICAgICAgICdOYXZham9Db2luJzogJ05BVicsXG4gICAgICAgICAgICAnT01HYW1lJzogJ09NRycsXG4gICAgICAgICAgICAnRVBBWSc6ICdQQVknLFxuICAgICAgICAgICAgJ1JlcHVibGljb2luJzogJ1JFUCcsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChjb21tb25Db2RlIGluIHN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gICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHVwcGVyY2FzZSk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gcmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY2NvdW50ID0gcmVzdWx0W2N1cnJlbmN5XTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFtrZXldID0gYmFsYW5jZXNbc2lkZV1bbG93ZXJjYXNlXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGFjY291bnRbJ3RvdGFsJ10gJiYgYWNjb3VudFsnZnJlZSddKVxuICAgICAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVEZXBvc2l0QWRkcmVzcyAoY3VycmVuY3ksIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2hEZXBvc2l0QWRkcmVzcyAoY3VycmVuY3ksIHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbmVlZF9uZXcnOiAxLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV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RXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3l1bmJpJyxcbiAgICAgICAgICAgICduYW1lJzogJ1lVTkJJJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQ04nLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MicsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzUnLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTUnLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzAnLFxuICAgICAgICAgICAgICAgICcxaCc6ICc2MCcsXG4gICAgICAgICAgICAgICAgJzJoJzogJzEyMCcsXG4gICAgICAgICAgICAgICAgJzRoJzogJzI0MCcsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICc3MjAnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxNDQwJyxcbiAgICAgICAgICAgICAgICAnM2QnOiAnNDMyMCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzEwMDgwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4NTcwNTQ4LTRkNjQ2YzQwLTcxNDctMTFlNy05Y2Y2LTgzOWI5M2U2ZDYyMi5qcGcnLFxuICAgICAgICAgICAgICAgICdleHRlbnNpb24nOiAnLmpzb24nLCAvLyBkZWZhdWx0IGV4dGVuc2lvbiBhcHBlbmRlZCB0byBlbmRwb2ludCBVUkxzXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3l1bmJpLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3l1bmJpLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8veXVuYmkuY29tL2RvY3VtZW50cy9hcGkvZ3VpZGUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly95dW5iaS5jb20vc3dhZ2dlci8nLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMve21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2tfd2l0aF9wZW5kaW5nX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGltZXN0YW1wJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhZGRyZXNzZXMve2FkZHJlc3N9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXJ0bmVycy9vcmRlcnMve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21lbWJlcnMvbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL215JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvZGVsZXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9tdWx0aScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL2NsZWFyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxufVxuIiwiXCJ1c2Ugc3RyaWN0XCI7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuY29uc3QgRXhjaGFuZ2UgPSByZXF1aXJlICgnLi9iYXNlL0V4Y2hhbmdlJylcbmNvbnN0IHsgRXhjaGFuZ2VFcnJvciB9ID0gcmVxdWlyZSAoJy4vYmFzZS9lcnJvcnMnKVxuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgemFpZiBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICd6YWlmJyxcbiAgICAgICAgICAgICduYW1lJzogJ1phaWYnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdKUCcsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJzEnLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2OTI3LTM5Y2EyYWRhLTVlZWItMTFlNy05NzJmLTFiNDE5OTUxOGNhNi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuemFpZi5qcCcsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3phaWYuanAnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwOi8vdGVjaGJ1cmVhdS1hcGktZG9jdW1lbnQucmVhZHRoZWRvY3MuaW8vamEvbGF0ZXN0L2luZGV4Lmh0bWwnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9jb3JwLnphaWYuanAvYXBpLWRvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9jb3JwLnphaWYuanAvYXBpLWRvY3MvYXBpX2xpbmtzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5wbWpzLmNvbS9wYWNrYWdlL3phaWYuanAnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL3lvdTIxOTc5L25vZGUtemFpZicsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jaWVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY2llcy9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5X3BhaXJzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3lfcGFpcnMvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWN0aXZlX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9pZF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2luZm8yJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfcGVyc29uYWxfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdlY2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlSW52b2ljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW52b2ljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW52b2ljZUlkc0J5T3JkZXJOdW1iZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbEludm9pY2UnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3RsYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbl9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY3RpdmVfcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGVfcG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYW5nZV9wb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyb3Vwcy97Z3JvdXBfaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlL3tncm91cF9pZH0ve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2dyb3VwX2lkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97Z3JvdXBfaWR9L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve2dyb3VwX2lkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY3lQYWlyc0FsbCAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydjdXJyZW5jeV9wYWlyJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3JldHVybiddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzWydmdW5kcyddKTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1snZnVuZHMnXVtjdXJyZW5jeV07XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gY3VycmVuY3kudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2UsXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoJ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G4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkZXNQYWlyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2UsIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5X3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ2FjdGlvbic6IChzaWRlID09ICdidXknKSA/ICdiaWQnIDogJ2FzaycsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJl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GRyZXNzLFxuICAgICAgICAgICAgLy8gJ21lc3NhZ2UnOiAnSGkhJywgLy8gWEVNIG9ubHlcbiAgICAgICAgICAgIC8vICdvcHRfZmVlJzogMC4wMDMsIC8vIEJUQyBhbmQgTU9OQSBvbmx5XG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXN1bHQsXG4gICAgICAgICAgICAnaWQnOiByZXN1bHRbJ3JldHVybiddWyd0eGlkJ10sXG4gICAgICAgICAgICAnZmVlJzogcmVzdWx0WydyZXR1cm4nXVsnZmVlJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICdhcGkvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT0gJ2ZhcGknKSB7XG4gICAgICAgICAgICB1cmwgKz0gJ2ZhcGkvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaWYgKGFwaSA9PSAnZWNhcGknKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICdlY2FwaSc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGFwaSA9PSAndGxhcGknKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICd0bGFwaSc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHVybCArPSAndGFwaSc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChib2R5KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdhcGknLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoJ2Vycm9yJyBpbiByZXNwb25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YxJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMyODU5MTg3LWNkNTIxNGYwLWNhNWUtMTFlNy05NjdkLTk2NTY4ZTJlMmJkMS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cDovL2FwaS56Yi5jb20vZGF0YScsIC8vIG5vIGh0dHBzIGZvciBwdWJsaWMgQVBJXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vdHJhZGUuemIuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vdHJhZGUuemIuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy56Yi5jb20vaS9kZXZlbG9wZXInLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vd3d3LnpiLmNvbS9pL3JhdGUnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2tsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVyc05ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzSWdub3JlVHJhZGVUeXBlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRVbmZpbmlzaGVkT3JkZXJzSWdub3JlVHJhZGVUeXBlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRBY2NvdW50SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VXNlckFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFdpdGhkcmF3QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0V2l0aGRyYXdSZWNvcmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENoYXJnZVJlY29yZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Q255V2l0aGRyYXdSZWNvcmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENueUNoYXJnZVJlY29yZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDA2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVFMnOiAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFNSJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAnMC4xJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUNBU0gnOiA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lOSyc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RWJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDSEFUJzogMjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Q05ZJzogMjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSExDJzogMjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ1cnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGdldFRyYWRpbmdGZWVGcm9tQmFzZVF1b3RlIChiYXNlLCBxdW90ZSkge1xuICAgICAgICAvLyBiYXNlOiBxdW90ZVxuICAgICAgICBsZXQgZmVlcyA9IHtcbiAgICAgICAgICAgICdCVEMnOiB7ICdVU0RUJzogMC4wIH0sXG4gICAgICAgICAgICAnQkNIJzogeyAnQlRDJzogMC4wMDEsICdVU0RUJzogMC4wMDEgfSxcbiAgICAgICAgICAgICdMVEMnOiB7ICdCVEMnOiAwLjAwMSwgJ1VTRFQnOiAwLjAgfSxcbiAgICAgICAgICAgICdFVEgnOiB7ICdCVEMnOiAwLjAwMSwgJ1VTRFQnOiAwLjAgfSxcbiAgICAgICAgICAgICdFVEMnOiB7ICdCVEMnOiAwLjAwMSwgJ1VTRFQnOiAwLjAgfSxcbiAgICAgICAgICAgICdCVFMnOiB7ICdCVEMnOiAwLjAwMSwgJ1VTRFQnOiAwLjAwMSB9LFxuICAgICAgICAgICAgJ0VPUyc6IHsgJ0JUQyc6IDAuMDAxLCAnVVNEVCc6IDAuMDAxIH0sXG4gICAgICAgICAgICAnSFNSJzogeyAnQlRDJzogMC4wMDEsICdVU0RUJzogMC4wMDEgfSxcbiAgICAgICAgICAgICdRVFVNJzogeyAnQlRDJzogMC4wMDEsICdVU0RUJzogMC4wMDEgfSxcbiAgICAgICAgICAgICdVU0RUJzogeyAnQlRDJzogMC4wIH0sXG4gICAgICAgIH07XG4gICAgICAgIGlmIChiYXNlIGluIGZlZXMpIHtcbiAgICAgICAgICAgIGxldCBxdW90ZUZlZXMgPSBmZWVzW2Jhc2VdO1xuICAgICAgICAgICAgaWYgKHF1b3RlIGluIHF1b3RlRmVlcylcbiAgICAgICAgICAgICAgICByZXR1cm4gcXVvdGVGZWVzW3F1b3RlXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGtleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNbaV07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpZF07XG4gICAgICAgICAgICBsZXQgWyBiYXNlSWQsIHF1b3RlSWQgXSA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkLnRvVXBwZXJDYXNlICgpKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkLnRvVXBwZXJDYXNlICgpKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgZmVlID0gdGhpcy5nZXRUcmFkaW5nRmVlRnJvbUJhc2VRdW90ZSAoYmFzZSwgcXVvdGUpO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0WydhbW91bnRTY2FsZSddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsncHJpY2VTY2FsZSddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogZmVlLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IGZlZSxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEFjY291bnRJbmZvICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAodGhpcy5jdXJyZW5jaWVzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZXNbJ2JhbGFuY2UnXSlcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlc1snYmFsYW5jZSddW2N1cnJlbmN5XVsnYW1vdW50J10pO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VzWydmcm96ZW4nXSlcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlc1snZnJvemVuJ11bY3VycmVuY3ldWydhbW91bnQnXSk7XG4gICAgICAgICAgICBhY2NvdW50Wyd0b3Rhb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HtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydidXknXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydzZWxsJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIGxldCBz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2lwIHJlc2V0IG9mIG5Sb3VuZHMgaGFzIGJlZW4gc2V0IGJlZm9yZSBhbmQga2V5IGRpZCBub3QgY2hhbmdlXG5cdCAgICAgICAgICAgIGlmICh0aGlzLl9uUm91bmRzICYmIHRoaXMuX2tleVByaW9yUmVzZXQgPT09IHRoaXMuX2tleSkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciBrZXkgPSB0aGlzLl9rZXlQcmlvclJlc2V0ID0gdGhpcy5fa2V5O1xuXHQgICAgICAgICAgICB2YXIga2V5V29yZHMgPSBrZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaXplID0ga2V5LnNpZ0J5dGVzIC8gNDtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIG51bWJlciBvZiByb3VuZHNcblx0ICAgICAgICAgICAgdmFyIG5Sb3VuZHMgPSB0aGlzLl9uUm91bmRzID0ga2V5U2l6ZSArIDY7XG5cblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBudW1iZXIgb2Yga2V5IHNjaGVkdWxlIHJvd3Ncblx0ICAgICAgICAgICAgdmFyIGtzUm93cyA9IChuUm91bmRzICsgMSkgKiA0O1xuXG5cdCAgICAgICAgICAgIC8vIENvbXB1dGUga2V5IHNjaGVkdWxlXG5cdCAgICAgICAgICAgIHZhciBrZXlTY2hlZHVsZSA9IHRoaXMuX2tleVNjaGVkdWxlID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGtzUm93ID0gMDsga3NSb3cgPCBrc1Jvd3M7IGtzUm93KyspIHtcblx0ICAgICAgICAgICAgICAgIGlmIChrc1JvdyA8IGtleVNpemUpIHtcblx0ICAgICAgICAgICAgICAgICAgICBrZXlTY2hlZHVsZVtrc1Jvd10gPSBrZXlXb3Jkc1trc1Jvd107XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0ID0ga2V5U2NoZWR1bGVba3NSb3cgLSAxXTtcblxuXHQgICAgICAgICAgICAgICAgICAgIGlmICghKGtzUm93ICUga2V5U2l6ZSkpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgLy8gUm90IHdvcmRcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdCA9ICh0IDw8IDgpIHwgKHQgPj4+IDI0KTtcblxuXHQgICAgICAgICAgICAgICAgICAgICAgICAvLyBTdWIgd29yZFxuXHQgICAgICAgICAgICAgICAgICAgICAgICB0ID0gKFNCT1hbdCA+Pj4gMjRdIDw8IDI0KSB8IChTQk9YWyh0ID4+PiAxNikgJiAweGZmXSA8PCAxNikgfCAoU0JPWFsodCA+Pj4gOCkgJiAweGZmXSA8PCA4KSB8IFNCT1hbdCAmIDB4ZmZdO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIE1peCBSY29uXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHQgXj0gUkNPTlsoa3NSb3cgLyBrZXlTaXplKSB8IDBdIDw8IDI0O1xuXHQgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoa2V5U2l6ZSA+IDYgJiYga3NSb3cgJSBrZXlTaXplID09IDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgLy8gU3ViIHdvcmRcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdCA9IChTQk9YW3QgPj4+IDI0XSA8PCAyNCkgfCAoU0JPWFsodCA+Pj4gMTYpICYgMHhmZl0gPDwgMTYpIHwgKFNCT1hbKHQgPj4+IDgpICYgMHhmZl0gPDwgOCkgfCBTQk9YW3QgJiAweGZmXTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgICAgICBrZXlTY2hlZHVsZVtrc1Jvd10gPSBrZXlTY2hlZHVsZVtrc1JvdyAtIGtleVNpemVdIF4gdDtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIENvbXB1dGUgaW52IGtleSBzY2hlZHVsZVxuXHQgICAgICAgICAgICB2YXIgaW52S2V5U2NoZWR1bGUgPSB0aGlzLl9pbnZLZXlTY2hlZHVsZSA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpbnZLc1JvdyA9IDA7IGludktzUm93IDwga3NSb3dzOyBpbnZLc1JvdysrKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIga3NSb3cgPSBrc1Jvd3MgLSBpbnZLc1JvdztcblxuXHQgICAgICAgICAgICAgICAgaWYgKGludktzUm93ICUgNCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0ID0ga2V5U2NoZWR1bGVba3NSb3ddO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGtleVNjaGVkdWxlW2tzUm93IC0gNF07XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIGlmIChpbnZLc1JvdyA8IDQgfHwga3NSb3cgPD0gNCkge1xuXHQgICAgICAgICAgICAgICAgICAgIGludktleVNjaGVkdWxlW2ludktzUm93XSA9IHQ7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgICAgIGludktleVNjaGVkdWxlW2ludktzUm93XSA9IElOVl9TVUJfTUlYXzBbU0JPWFt0ID4+PiAyNF1dIF4gSU5WX1NVQl9NSVhfMVtTQk9YWyh0ID4+PiAxNikgJiAweGZmXV0gXlxuXHQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElOVl9TVUJfTUlYXzJbU0JPWFsodCA+Pj4gOCkgJiAweGZmXV0gXiBJTlZfU1VCX01JWF8zW1NCT1hbdCAmIDB4ZmZdXTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXHQgICAgIC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cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBuUm91bmRzID0gdGhpcy5fblJvdW5kcztcblxuXHQgICAgICAgICAgICAvLyBHZXQgaW5wdXQsIGFkZCByb3VuZCBrZXlcblx0ICAgICAgICAgICAgdmFyIHMwID0gTVtvZmZzZXRdICAgICBeIGtleVNjaGVkdWxlWzBdO1xuXHQgICAgICAgICAgICB2YXIgczEgPSBNW29mZnNldCArIDFdIF4ga2V5U2NoZWR1bGVbMV07XG5cdCAgICAgICAgICAgIHZhciBzMiA9IE1bb2Zmc2V0ICsgMl0gXiBrZXlTY2hlZHVsZVsyXTtcblx0ICAgICAgICAgICAgdmFyIHMzID0gTVtvZmZzZXQgKyAzXSBeIGtleVNjaGVkdWxlWzNdO1xuXG5cdCAgICAgICAgICAgIC8vIEtleSBzY2hlZHVsZSByb3cgY291bnRlclxuXHQgICAgICAgICAgICB2YXIga3NSb3cgPSA0O1xuXG5cdCAgICAgICAgICAgIC8vIFJvdW5kc1xuXHQgICAgICAgICAgICBmb3IgKHZhciByb3VuZCA9IDE7IHJvdW5kIDwgblJvdW5kczsgcm91bmQrKykge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hpZnQgcm93cywgc3ViIGJ5dGVzLCBtaXggY29sdW1ucywgYWRkIHJvdW5kIGtleVxuXHQgICAgICAgICAgICAgICAgdmFyIHQwID0gU1VCX01JWF8wW3MwID4+PiAyNF0gXiBTVUJfTUlYXzFbKHMxID4+PiAxNikgJiAweGZmXSBeIFNVQl9NSVhfMlsoczIgPj4+IDgpICYgMHhmZl0gXiBTVUJfTUlYXzNbczMgJiAweGZmXSBeIGtleVNjaGVkdWxlW2tzUm93KytdO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQxID0gU1VCX01JWF8wW3MxID4+PiAyNF0gXiBTVUJfTUlYXzFbKHMyID4+PiAxNikgJiAweGZmXSBeIFNVQl9NSVhfMlsoczMgPj4+IDgpICYgMHhmZl0gXiBTVU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gICAgKiBAcGFyYW0ge251bWJlcn0gb2Zmc2V0IFRoZSBvZmZzZXQgd2hlcmUgdGhlIGJsb2NrIHN0YXJ0cy5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIG1vZGUucHJvY2Vzc0Jsb2NrKGRhdGEud29yZHMsIG9mZnNldCk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBwcm9jZXNzQmxvY2s6IGZ1bmN0aW9uICh3b3Jkcywgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBjaXBoZXIgPSB0aGlzLl9jaXBoZXI7XG5cdCAgICAgICAgICAgICAgICB2YXIgYmxvY2tTaXplID0gY2lwaGVyLmJsb2NrU2l6ZTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVtZW1iZXIgdGhpcyBibG9jayB0byB1c2Ugd2l0aCBuZXh0IGJsb2NrXG5cdCAgICAgICAgICAgICAgICB2YXIgdGhpc0Jsb2NrID0gd29yZHMuc2xpY2Uob2Zmc2V0LCBvZmZzZXQgKyBibG9ja1NpemUpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBEZWNyeXB0IGFuZCBYT1Jcblx0ICAgICAgICAgICAgICAgIGNpcGhlci5kZWNyeXB0QmxvY2sod29yZHMsIG9mZnNldCk7XG5cdCAgICAgICAgICAgICAgICB4b3JCbG9jay5jYWxsKHRoaXMsIHdvcmRzLCBvZmZzZXQsIGJsb2NrU2l6ZSk7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFRoaXMgYmxvY2sgYmVjb21lcyB0aGUgcHJldmlvdXMgYmxvY2tcblx0ICAgICAgICAgICAgICAgIHRoaXMuX3ByZXZCbG9jayA9IHRoaXNCbG9jaztcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0pO1xuXG5cdCAgICAgICAgZnVuY3Rpb24geG9yQmxvY2sod29yZHMsIG9mZnNldCwgYmxvY2tTaXplKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBpdiA9IHRoaXMuX2l2O1xuXG5cdCAgICAgICAgICAgIC8vIENob29zZSBtaXhpbmcgYmxvY2tcblx0ICAgICAgICAgICAgaWYgKGl2KSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgYmxvY2sgPSBpdjtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVtb3ZlIElWIGZvciBzdWJzZXF1ZW50IGJsb2Nrc1xuXHQgICAgICAgICAgICAgICAgdGhpcy5faXYgPSB1bmRlZmluZWQ7XG5cdCAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgYmxvY2sgPSB0aGlzLl9wcmV2QmxvY2s7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBYT1IgYmxvY2tzXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYmxvY2tTaXplOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHdvcmRzW29mZnNldCArIGldIF49IGJsb2NrW2ldO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfVxuXG5cdCAgICAgICAgcmV0dXJuIENCQztcblx0ICAgIH0oKSk7XG5cblx0ICAgIC8qKlxuXHQgICAgICogUGFkZGluZyBuYW1lc3BhY2UuXG5cdCAgICAgKi9cblx0ICAgIHZhciBDX3BhZCA9IEMucGFkID0ge307XG5cblx0ICAgIC8qKlxuXHQgICAgICogUEtDUyAjNS83IHBhZGRpbmcgc3RyYXRlZ3kuXG5cdCAgICAgKi9cblx0ICAgIHZhciBQa2NzNyA9IENfcGFkLlBrY3M3ID0ge1xuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIFBhZHMgZGF0YSB1c2luZyB0aGUgYWxnb3JpdGhtIGRlZmluZWQgaW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8gYSBzdHJpbmcuXG5cdCAgICAgKi9cblx0ICAgIHZhciBDaXBoZXJQYXJhbXMgPSBDX2xpYi5DaXBoZXJQYXJhbXMgPSBCYXNlLmV4dGVuZCh7XG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogSW5pdGlhbGl6ZXMgYSBuZXdseSBjcmVhdGVkIGNpcGhlciBwYXJhbXMgb2JqZWN0LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IGNpcGhlclBhcmFtcyBBbiBvYmplY3Qgd2l0aCBhbnkgb2YgdGhlIHBvc3NpYmxlIGNpcGhlciBwYXJhbWV0ZXJzLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgY2lwaGVyUGFyYW1zID0gQ3J5cHRvSlMubGliLkNpcGhlclBhcmFtcy5jcmVhdGUoe1xuXHQgICAgICAgICAqICAgICAgICAgY2lwaGVydGV4dDogY2lwaGVydGV4dFdvcmRBcnJheSxcblx0ICAgICAgICAgKiAgICAgICAgIGtleToga2V5V29yZEFycmF5LFxuXHQgICAgICAgICAqICAgICAgICAgaXY6IGl2V29yZEFycmF5LFxuXHQgICAgICAgICAqICAgICAgICAgc2FsdDogc2FsdFdvcmRBcnJheSxcblx0ICAgICAgICAgKiAgICAgICAgIGFsZ29yaXRobTogQ3J5cHRvSlMuYWxnby5BRVMsXG5cdCAgICAgICAgICogICAgICAgICBtb2RlOiBDcnlwdG9KUy5tb2RlLkNCQyxcblx0ICAgICAgICAgKiAgICAgICAgIHBhZGRpbmc6IENyeXB0b0pTLnBhZC5QS0NTNyxcblx0ICAgICAgICAgKiAgICAgICAgIGJsb2NrU2l6ZTogNCxcblx0ICAgICAgICAgKiAgICAgICAgIGZvcm1hdHRlcjogQ3J5cHRvSlMuZm9ybWF0Lk9wZW5TU0xcblx0ICAgICAgICAgKiAgICAgfSk7XG5cdCAgICAgIC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zLnNhbHQ7XG5cblx0ICAgICAgICAgICAgLy8gRm9ybWF0XG5cdCAgICAgICAgICAgIGlmIChzYWx0KSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgd29yZEFycmF5ID0gV29yZEFycmF5LmNyZWF0ZShbMHg1MzYxNmM3NCwgMHg2NTY0NWY1Zl0pLmNvbmNhdChzYWx0KS5jb25jYXQoY2lwaGVydGV4dCk7XG5cdCAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgd29yZEFycmF5ID0gY2lwaGVydGV4dDtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiB3b3JkQXJyYXkudG9TdHJpbmcoQmFzZTY0KTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYW4gT3BlblNTTC1jb21wYXRpYmxlIHN0cmluZyB0byBhIGNpcGhlciBwYXJhbXMgb2JqZWN0LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IG9wZW5TU0xTdHIgVGhlIE9wZW5TU0wtY29tcGF0aWJsZSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtDaXBoZXJQYXJhbXN9IFRoZSBjaXBoZXIgcGFyYW1zIG9iamVjdC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGNpcGhlclBhcmFtcyA9IENyeXB0b0pTLmZvcm1hdC5PcGVuU1NMLnBhcnNlKG9wZW5TU0xTdHJpbmcpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHBhcnNlOiBmdW5jdGlvbiAob3BlblNTTFN0cikge1xuXHQgICAgICAgICAgICAvLyBQYXJzZSBiYXNlNjRcblx0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ICAgICAgICAgICogQ3JlYXRlcyBhIG5ldyBvYmplY3QgdGhhdCBpbmhlcml0cyBmcm9tIHRoaXMgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gb3ZlcnJpZGVzIFByb3BlcnRpZXMgdG8gY29weSBpbnRvIHRoZSBuZXcgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAcmV0dXJuIHtPYmplY3R9IFRoZSBuZXcgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICB2YXIgTXlUeXBlID0gQ3J5cHRvSlMubGliLkJhc2UuZXh0ZW5kKHtcblx0ICAgICAgICAgICAgICogICAgICAgICBmaWVsZDogJ3ZhbHVlJyxcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgICAgICBtZXRob2Q6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgICogICAgICAgICB9XG5cdCAgICAgICAgICAgICAqICAgICB9KTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIGV4dGVuZDogZnVuY3Rpb24gKG92ZXJyaWRlcykge1xuXHQgICAgICAgICAgICAgICAgLy8gU3Bhd25cblx0ICAgICAgICAgICAgICAgIHZhciBzdWJ0eXBlID0gY3JlYXRlKHRoaXMpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBBdWdtZW50XG5cdCAgICAgICAgICAgICAgICBpZiAob3ZlcnJpZGVzKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgc3VidHlwZS5taXhJbihvdmVycmlkZXMpO1xuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAvLyBDcmVhdGUgZGVmYXVsdCBpbml0aWFsaXplclxuXHQgICAgICAgICAgICAgICAgaWYgKCFzdWJ0eXBlLmhhc093blByb3BlcnR5KCdpbml0JykgfHwgdGhpcy5pbml0ID09PSBzdWJ0eXBlLmluaXQpIHtcblx0ICAgICAgICAgICAgICAgICAgICBzdWJ0eXBlLmluaXQgPSBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHN1YnR5cGUuJHN1cGVyLmluaXQuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcblx0ICAgICAgICAgICAgICAgICAgICB9O1xuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAvLyBJbml0aWFsaXplcidzIHByb3RvdHlwZSBpcyB0aGUgc3VidHlwZSBvYmplY3Rcblx0ICAgICAgICAgICAgICAgIHN1YnR5cGUuaW5pdC5wcm90b3R5cGUgPSBzdWJ0eXBlO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBSZWZlcmVuY2Ugc3VwZXJ0eXBlXG5cdCAgICAgICAgICAgICAgICBzdWJ0eXBlLiRzdXBlciA9IHRoaXM7XG5cblx0ICAgICAgICAgICAgICAgIHJldHVybiBzdWJ0eXBlO1xuXHQgICAgICAgICAgICB9LFxuXG5cdCAgICAgICAgICAgIC8qKlxuXHQgICAgICAgICAgICAgKiBFeHRlbmRzIHRoaXMgb2JqZWN0IGFuZCBydW5zIHRoZSBpbml0IG1ldGhvZC5cblx0ICAgICAgICAgICAgICogQXJndW1lbnRzIHRvIGNyZWF0ZSgpIHdpbGwgYmUgcGFzc2VkIHRvIGluaXQoKS5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHJldHVybiB7T2JqZWN0fSBUaGUgbmV3IG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiAgICAgdmFyIGluc3RhbmNlID0gTXlUeXBlLmNyZWF0ZSgpO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgY3JlYXRlOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgaW5zdGFuY2UgPSB0aGlzLmV4dGVuZCgpO1xuXHQgICAgICAgICAgICAgICAgaW5zdGFuY2UuaW5pdC5hcHBseShpbnN0YW5jZSwgYXJndW1lbnRzKTtcblxuXHQgICAgICAgICAgICAgICAgcmV0dXJuIGluc3RhbmNlO1xuXHQgICAgICAgICAgICB9LFxuXG5cdCAgICAgICAgICAgIC8qKlxuXHQgICAgICAgICAgICAgKiBJbml0aWFsaXplcyBhIG5ld2x5IGNyZWF0ZWQgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKiBPdmVycmlkZSB0aGlzIG1ldGhvZCB0byBhZGQgc29tZSBsb2dpYyB3aGVuIHlvdXIgb2JqZWN0cyBhcmUgY3JlYXRlZC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIHZhciBNeVR5cGUgPSBDcnlwdG9KUy5saWIuQmFzZS5leHRlbmQoe1xuXHQgICAgICAgICAgICAgKiAgICAgICAgIGluaXQ6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgICogICAgICAgICAgICAgLy8gLi4uXG5cdCAgICAgICAgICAgICAqICAgICAgICAgfVxuXHQgICAgICAgICAgICAgKiAgICAgfSk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBpbml0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIH0sXG5cblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIENvcGllcyBwcm9wZXJ0aWVzIGludG8gdGhpcyBvYmplY3QuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBwYXJhbSB7T2JqZWN0fSBwcm9wZXJ0aWVzIFRoZSBwcm9wZXJ0aWVzIHRvIG1peCBpbi5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIE15VHlwZS5taXhJbih7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgZmllbGQ6ICd2YWx1ZSdcblx0ICAgICAgICAgICAgICogICAgIH0pO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgbWl4SW46IGZ1bmN0aW9uIChwcm9wZXJ0aWVzKSB7XG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBwcm9wZXJ0eU5hbWUgaW4gcHJvcGVydGllcykge1xuXHQgICAgICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0aWVzLmhhc093blByb3BlcnR5KHByb3BlcnR5TmFtZSkpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdGhpc1twcm9wZXJ0eU5hbWVdID0gcHJvcGVydGllc1twcm9wZXJ0eU5hbWVdO1xuXHQgICAgICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gSUUgd29uJ3QgY29weSB0b1N0cmluZyB1c2luZyB0aGUgbG9vcCBhYm92ZVxuXHQgICAgICAgICAgICAgICAgaWYgKHByb3BlcnRpZXMuaGFzT3duUHJvcGVydHkoJ3RvU3RyaW5nJykpIHtcblx0ICAgICAgICAgICAgICAgICAgICB0aGlzLnRvU3RyaW5nID0gcHJvcGVydGllcy50b1N0cmluZztcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfSxcblxuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogQ3JlYXRlcyBhIGNvcHkgb2YgdGhpcyBvYmplY3QuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAg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aW5naWZpZWQgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHN0cmluZyA9IHdvcmRBcnJheSArICcnO1xuXHQgICAgICAgICAqICAgICB2YXIgc3RyaW5nID0gd29yZEFycmF5LnRvU3RyaW5nKCk7XG5cdCAgICAgICAgICogICAgIHZhciBzdHJpbmcgPSB3b3JkQXJyYXkudG9TdHJpbmcoQ3J5cHRvSlMuZW5jLlV0ZjgpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHRvU3RyaW5nOiBmdW5jdGlvbiAoZW5jb2Rlcikge1xuXHQgICAgICAgICAgICByZXR1cm4gKGVuY29kZXIgfHwgSGV4KS5zdHJpbmdpZnkodGhpcyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbmNhdGVuYXRlcyBhIHdvcmQgYXJyYXkgdG8gdGhpcyB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl9IHdvcmRBcnJheSBUaGUgd29yZCBhcnJheSB0byBhcHBlbmQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoaXMgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgd29yZEFycmF5MS5jb25jYXQod29yZEFycmF5Mik7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY29uY2F0OiBmdW5jdGlvbiAod29yZEFycmF5KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgdGhpc1dvcmRzID0gdGhpcy53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHRoYXRXb3JkcyA9IHdvcmR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AgdGhpcy5zaWdCeXRlcyArPSB0aGF0U2lnQnl0ZXM7XG5cblx0ICAgICAgICAgICAgLy8gQ2hhaW5hYmxlXG5cdCAgICAgICAgICAgIHJldHVybiB0aGlzO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBSZW1vdmVzIGluc2lnbmlmaWNhbnQgYml0cy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgd29yZEFycmF5LmNsYW1wKCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY2xhbXA6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IHRoaXMud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBzaWdCeXRlcyA9IHRoaXMuc2lnQnl0ZXM7XG5cblx0ICAgICAgICAgICAgLy8gQ2xhbXBcblx0ICAgICAgICAgICAgd29yZHNbc2lnQnl0ZXMgPj4+IDJdICY9IDB4ZmZmZmZmZmYgPDwgKDMyIC0gKHNpZ0J5dGVzICUgNCkgKiA4KTtcblx0ICAgICAgICAgICAgd29yZHMubGVuZ3RoID0gTWF0aC5jZWlsKHNpZ0J5dGVzIC8gNCk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENyZWF0ZXMgYSBjb3B5IG9mIHRoaXMgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1dvcmRBcnJheX0gVGhlIGNsb25lLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgY2xvbmUgPSB3b3JkQXJyYXkuY2xvbmUoKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBjbG9uZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICB2YXIgY2xvbmUgPSBCYXNlLmNsb25lLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIGNsb25lLndvcmRzID0gdGhpcy53b3Jkcy5zbGljZSgwKTtcblxuXHQgICAgICAgICAgICByZXR1cm4gY2xvbmU7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENyZWF0ZXMgYSB3b3JkIGFycmF5IGZpbGxlZCB3aXRoIHJhbmRvbSBieXRlcy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7bnVtYmVyfSBuQnl0ZXMgVGhlIG51bWJlciBvZiByYW5kb20gYnl0ZXMgdG8gZ2VuZXJhdGUuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSByYW5kb20gd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmxpYi5Xb3JkQXJyYXkucmFuZG9tKDE2KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICByYW5kb206IGZ1bmN0aW9uIChuQnl0ZXMpIHtcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gW107XG5cblx0ICAgICAgICAgICAgdmFyIHIgPSAoZnVuY3Rpb24gKG1fdykge1xuXHQgICAgICAgICAgICAgICAgdmFyIG1fdyA9IG1fdztcblx0ICAgICAgICAgICAgICAgIHZhciBtX3ogPSAweDNhZGU2OGIxO1xuXHQgICAgICAgICAgICAgICAgdmFyIG1hc2sgPSAweGZmZmZmZmZmO1xuXG5cdCAgICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgICAgIG1feiA9ICgweDkwNjkgKiAobV96ICYgMHhGRkZGKSArIChtX3ogPj4gMHgxMCkpICYgbWFzaztcblx0ICAgICAgICAgICAgICAgICAgICBtX3cgPSAoMHg0NjUwICogKG1fdyAmIDB4RkZGRikgKyAobV93ID4+IDB4MTApKSAmIG1hc2s7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHJlc3VsdCA9ICgobV96IDw8IDB4MTApICsgbV93KSAmIG1hc2s7XG5cdCAgICAgICAgICAgICAgICAgICAgcmVzdWx0IC89IDB4MTAwMDAwMDAwO1xuXHQgICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAwLjU7XG5cdCAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCAqIChNYXRoLnJhbmRvbSgpID4gLjUgPyAxIDogLTEpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9KTtcblxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMCwgcmNhY2hlOyBpIDwgbkJ5dGVzOyBpICs9IDQpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBfciA9IHIoKHJjYWNoZSB8fCBNYXRoLnJhbmRvbSgpKSAqIDB4MTAwMDAwMDAwKTtcblxuXHQgICAgICAgICAgICAgICAgcmNhY2hlID0gX3IoKSAqIDB4M2FkZTY3Yjc7XG5cdCAgICAgICAgICAgICAgICB3b3Jkcy5wdXNoKChfcigpICogMHgxMDAwMDAwMDApIHwgMCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gbmV3IFdvcmRBcnJheS5pbml0KHdvcmRzLCBuQnl0ZXMpO1xuXHQgICAgICAgIH1cblx0ICAgIH0pO1xuXG5cdCAgICAvKipcblx0ICAgICAqIEVuY29kZXIgbmFtZXNwYWNlLlxuXHQgICAgICovXG5cdCAgICB2YXIgQ19lbmMgPSBDLmVuYyA9IHt9O1xuXG5cdCAgICAvKipcblx0ICAgICAqIEhleCBlbmNvZGluZyBzdHJhdGVneS5cblx0ICAgICAqL1xuXHQgICAgdmFyIEhleCA9IENfZW5jLkhleCA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBoZXggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl9IHdvcmRBcnJheSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIGhleCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBoZXhTdHJpbmcgPSBDcnlwdG9KUy5lbmMuSGV4LnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gd29yZEFycmF5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB3b3JkQXJyYXkuc2lnQnl0ZXM7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgaGV4Q2hhcnMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzaWdCeXRlczsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgYml0ZSA9ICh3b3Jkc1tpID4+PiAyXSA+Pj4gKDI0IC0gKGkgJSA0KSAqIDgpKSAmIDB4ZmY7XG5cdCAgICAgICAgICAgICAgICBoZXhDaGFycy5wdXNoKChiaXRlID4+PiA0KS50b1N0cmluZygxNikpO1xuXHQgICAgICAgICAgICAgICAgaGV4Q2hhcnMucHVzaCgoYml0ZSAmIDB4MGYpLnRvU3RyaW5nKDE2KSk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gaGV4Q2hhcnMuam9pbignJyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgaGV4IHN0cmluZyB0byBhIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gaGV4U3RyIFRoZSBoZXggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5IZXgucGFyc2UoaGV4U3RyaW5nKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBwYXJzZTogZnVuY3Rpb24gKGhleFN0cikge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgaGV4U3RyTGVuZ3RoID0gaGV4U3RyLmxlbmd0aDtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGhleFN0ckxlbmd0aDsgaSArPSAyKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tpID4+PiAzXSB8PSBwYXJzZUludChoZXhTdHIuc3Vic3RyKGksIDIpLCAxNikgPDwgKDI0IC0gKGkgJSA4KSAqIDQpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgIC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ZXM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJpdGUgPSAod29yZHNbaSA+Pj4gMl0gPj4+ICgyNCAtIChpICUgNCkgKiA4KSkgJiAweGZmO1xuXHQgICAgICAgICAgICAgICAgbGF0aW4xQ2hhcnMucHVzaChTdHJpbmcuZnJvbUNoYXJDb2RlKGJpdGUpKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBsYXRpbjFDaGFycy5qb2luKCcnKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSBMYXRpbjEgc3RyaW5nIHRvIGEgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBsYXRpbjFTdHIgVGhlIExhdGluMSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMuZW5jLkxhdGluMS5wYXJzZShsYXRpbjFTdHJpbmcpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHBhcnNlOiBmdW5jdGlvbiAobGF0aW4xU3RyKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBsYXRpbjFTdHJMZW5ndGggPSBsYXRpbjFTdHIubGVuZ3RoO1xuXG5cdCAgICAgICAgICAgIC8vIENvbnZlcnRcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGF0aW4xU3RyTGVuZ3RoOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHdvcmRzW2kgPj4+IDJdIHw9IChsYXRpbjFTdHIuY2hhckNvZGVBdChpKSAmIDB4ZmYpIDw8ICgyNCAtIChpICUgNCkgKiA4KTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBuZXcgV29yZEFycmF5LmluaXQod29yZHMsIGxhdGluMVN0ckxlbmd0aCk7XG5cdCAgICAgICAgfVxuXHQgICAgfTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBVVEYtOCBlbmNvZGluZyBzdHJhdGVneS5cblx0ICAgICAqL1xuXHQgICAgdmFyIFV0ZjggPSBDX2VuYy5VdGY4ID0ge1xuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgd29yZCBhcnJheSB0byBhIFVURi04IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fSB3b3JkQXJyYXkgVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtzdHJpbmd9IFRoZSBVVEYtOCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB1dGY4U3RyaW5nID0gQ3J5cHRvSlMuZW5jLlV0Zjguc3RyaW5naWZ5KHdvcmRBcnJheSk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgc3RyaW5naWZ5OiBmdW5jdGlvbiAod29yZEFycmF5KSB7XG5cdCAgICAgICAgICAgIHRyeSB7XG5cdCAgICAgICAgICAgICAgICByZXR1cm4gZGVjb2RlVVJJQ29tcG9uZW50KGVzY2FwZShMYXRpbjEuc3RyaW5naWZ5KHdvcmRBcnJheSkpKTtcblx0ICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuXHQgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdNYWxmb3JtZWQgVVRGLTggZGF0YScpO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgVVRGLTggc3RyaW5nIHRvIGEgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSB1dGY4U3RyIFRoZSBVVEYtOCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMuZW5jLlV0ZjgucGFyc2UodXRmOFN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uICh1dGY4U3RyKSB7XG5cdCAgICAgICAgICAgIHJldHVybiBMYXRpbjEucGFyc2UodW5lc2NhcGUoZW5jb2RlVVJJQ29tcG9uZW50KHV0ZjhTdHIpKSk7XG5cdCAgICAgICAgfVxuXHQgICAgfTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBBYnN0cmFjdCBidWZmZXJlZCBibG9jayBhbGdvcml0aG0gdGVtcGxhdGUuXG5cdCAgICAgKlxuXHQgICAgICogVGhlIHByb3BlcnR5IGJsb2NrU2l6ZSBtdXN0IGJlIGltcGxlbWVudGVkIGluIGEgY29uY3JldGUgc3VidHlwZS5cblx0ICAgICAqXG5cdCAgICAgKiBAcHJvcGVydHkge251bWJlcn0gX21pbkJ1ZmZlclNpemUgVGhlIG51bWJlciBvZiBibG9ja3MgdG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G5cdCAgICAgICAgc3RyaW5naWZ5OiBmdW5jdGlvbiAod29yZEFycmF5KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSB3b3JkQXJyYXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBzaWdCeXRlcyA9IHdvcmRBcnJheS5zaWdCeXRlcztcblx0ICAgICAgICAgICAgdmFyIG1hcCA9IHRoaXMuX21hcDtcblxuXHQgICAgICAgICAgICAvLyBDbGFtcCBleGNlc3MgYml0c1xuXHQgICAgICAgICAgICB3b3JkQXJyYXkuY2xhbXAoKTtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciBiYXNlNjRDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpICs9IDMpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBieXRlMSA9ICh3b3Jkc1tpID4+PiAyXSAgICAgICA+Pj4gKDI0IC0gKGkgJSA0KSAqIDgpKSAgICAgICAmIDB4ZmY7XG5cdCAgICAgICAgICAgICAgICB2YXIgYnl0ZTIgPSAod29yZHNbKGkgKyAxKSA+Pj4gMl0gPj4+ICgyNCAtICgoaSArIDEpICUgNCkgKiA4KSkgJiAweGZmO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJ5dGUzID0gKHdvcmRzWyhpICsgMikgPj4+IDJdID4+PiAoMjQgLSAoKGkgKyAyKSAlIDQpICogOCkpICYgMHhmZjtcblxuXHQgICAgICAgICAgICAgICAgdmFyIHRyaXBsZXQgPSAoYnl0ZTEgPDwgMTYpIHwgKGJ5dGUyIDw8IDgpIHwgYnl0ZTM7XG5cblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyAoaiA8IDQpICYmIChpICsgaiAqIDAuNzUgPCBzaWdCeXRlcyk7IGorKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGJhc2U2NENoYXJzLnB1c2gobWFwLmNoYXJBdCgodHJpcGxldCA+Pj4gKDYgKiAoMyAtIGopKSkgJiAweDNmKSk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBBZGQgcGFkZGluZ1xuXHQgICAgICAgICAgICB2YXIgcGFkZGluZ0NoYXIgPSBtYXAuY2hhckF0KDY0KTtcblx0ICAgICAgICAgICAgaWYgKHBhZGRpbmdDaGFyKSB7XG5cdCAgICAgICAgICAgICAgICB3aGlsZSAoYmFzZTY0Q2hhcnMubGVuZ3RoICUgNCkge1xuXHQgICAgICAgICAgICAgICAgICAgIGJhc2U2NENoYXJzLnB1c2gocGFkZGluZ0NoYXIpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGJhc2U2NENoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIEJhc2U2NCBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IGJhc2U2NFN0ciBUaGUgQmFzZTY0IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1dvcmRBcnJheX0gVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5lbmMuQmFzZTY0LnBhcnNlKGJhc2U2NFN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChiYXNlNjRTdHIpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciBiYXNlNjRTdHJMZW5ndGggPSBiYXNlNjRTdHIubGVuZ3RoO1xuXHQgICAgICAgICAgICB2YXIgbWFwID0gdGhpcy5fbWFwO1xuXHQgICAgICAgICAgICB2YXIgcmV2ZXJzZU1hcCA9IHRoaXMuX3JldmVyc2VNYXA7XG5cblx0ICAgICAgICAgICAgaWYgKCFyZXZlcnNlTWFwKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgcmV2ZXJzZU1hcCA9IHRoaXMuX3JldmVyc2VNYXAgPSBbXTtcblx0ICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IG1hcC5sZW5ndGg7IGorKykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICByZXZlcnNlTWFwW21hcC5jaGFyQ29kZUF0KGopXSA9IGo7XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSWdub3JlIHBhZGRpbmdcblx0ICAgICAgICAgICAgdmFyIHBhZGRpbmdDaGFyID0gbWFwLmNoYXJBdCg2NCk7XG5cdCAgICAgICAgICAgIGlmIChwYWRkaW5nQ2hhcikge1xuXHQgICAgICAgICAgICAgICAgdmFyIHBhZGRpbmdJbmRleCA9IGJhc2U2NFN0ci5pbmRleE9mKHBhZGRpbmdDaGFyKTtcblx0ICAgICAgICAgICAgICAgIGlmIChwYWRkaW5nSW5kZXggIT09IC0xKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgYmFzZTY0U3RyTGVuZ3RoID0gcGFkZGluZ0luZGV4O1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICByZXR1cm4gcGFyc2VMb29wKGJhc2U2NFN0ciwgYmFzZTY0U3RyTGVuZ3RoLCByZXZlcnNlTWFwKTtc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oZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgVVRGLTE2IExFIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHV0ZjE2U3RyID0gQ3J5cHRvSlMuZW5jLlV0ZjE2TEUuc3RyaW5naWZ5KHdvcmRBcnJheSk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgc3RyaW5naWZ5OiBmdW5jdGlvbiAod29yZEFycmF5KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSB3b3JkQXJyYXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBzaWdCeXRlcyA9IHdvcmRBcnJheS5zaWdCeXRlcztcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciB1dGYxNkNoYXJzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2lnQnl0ZXM7IGkgKz0gMikge1xuXHQgICAgICAgICAgICAgICAgdmFyIGNvZGVQb2ludCA9IHN3YXBFbmRpYW4oKHdvcmRzW2kgPj4+IDJdID4+PiAoMTYgLSAoaSAlIDQpICogOCkpICYgMHhmZmZmKTtcblx0ICAgICAgICAgICAgICAgIHV0ZjE2Q2hhcnMucHVzaChTdHJpbmcuZnJvbUNoYXJDb2RlKGNvZGVQb2ludCkpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIHV0ZjE2Q2hhcnMuam9pbignJyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgVVRGLTE2IExFIHN0cmluZyB0byBhIH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UgZGVyaXZhdGlvbi5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGtkZiA9IENyeXB0b0pTLmFsZ28uRXZwS0RGLmNyZWF0ZSgpO1xuXHQgICAgICAgICAqICAgICB2YXIga2RmID0gQ3J5cHRvSlMuYWxnby5FdnBLREYuY3JlYXRlKHsga2V5U2l6ZTogOCB9KTtcblx0ICAgICAgICAgKiAgICAgdmFyIGtkZiA9IENyeXB0b0pTLmFsZ28uRXZwS0RGLmNyZWF0ZSh7IGtleVNpemU6IDgsIGl0ZXJhdGlvbnM6IDEwMDAgfSk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgaW5pdDogZnVuY3Rpb24gKGNmZykge1xuXHQgICAgICAgICAgICB0aGlzLmNmZyA9IHRoaXMuY2ZnLmV4dGVuZChjZmcpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBEZXJpdmVzIGEga2V5IGZyb20gYSBwYXNzd29yZC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fHN0cmluZ30gcGFzc3dvcmQgVGhlIHBhc3N3b3JkLlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fHN0cmluZ30gc2FsdCBBIHNhbHQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSBkZXJpdmVkIGtleS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGtleSA9IGtkZi5jb21wdXRlKHBhc3N3b3JkLCBzYWx0KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBjb21wdXRlOiBmdW5jdGlvbiAocGFzc3dvcmQsIHNhbHQpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgdmFyIGNmZyA9IHRoaXMuY2ZnO1xuXG5cdCAgICAgICAgICAgIC8vIEluaXQgaGFzaGVyXG5cdCAgICAgICAgICAgIHZhciBoYXNoZXIgPSBjZmcuaGFzaGVyLmNyZWF0ZSgpO1xuXG5cdCAgICAgICAgICAgIC8vIEluaXRpYWwgdmFsdWVzXG5cdCAgICAgICAgICAgIHZhciBkZXJpdmVkS2V5ID0gV29yZEFycmF5LmNyZWF0ZSgpO1xuXG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGVyaXZlZEtleVdvcmRzID0gZGVyaXZlZEtleS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGtleVNpemUgPSBjZmcua2V5U2l6ZTtcblx0ICAgICAgICAgICAgdmFyIGl0ZXJhdGlvbnMgPSBjZmcuaXRlcmF0aW9ucztcblxuXHQgICAgICAgICAgICAvLyBHZW5lcmF0ZSBrZXlcblx0ICAgICAgICAgICAgd2hpbGUgKGRlcml2ZWRLZXlXb3Jkcy5sZW5ndGggPCBrZXlTaXplKSB7XG5cdCAgICAgICAgICAgICAgICBpZiAoYmxvY2spIHtcblx0ICAgICAgICAgICAgICAgICAgICBoYXNoZXIudXBkYXRlKGJsb2NrKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgICAgIHZhciBibG9jayA9IGhhc2hlci51cGRhdGUocGFzc3dvcmQpLmZpbmFsaXplKHNhbHQpO1xuXHQgICAgICAgICAgICAgICAgaGFzaGVyLnJlc2V0KCk7XG5cblx0ICAgICAgICAgICAgICAgIC8vIEl0ZXJhdGlvbnNcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAxOyBpIDwgaXRlcmF0aW9uczsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgYmxvY2sgPSBoYXNoZXIuZmluYWxpemUoYmxvY2spO1xuXHQgICAgICAgICAgICAgICAgICAgI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ICAgICAgICAgICAgLy8gWE9SIGtleXMgd2l0aCBwYWQgY29uc3RhbnRzXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgaGFzaGVyQmxvY2tTaXplOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIG9LZXlXb3Jkc1tpXSBePSAweDVjNWM1YzVjO1xuXHQgICAgICAgICAgICAgICAgaUtleVdvcmRzW2ldIF49IDB4MzYzNjM2MzY7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgb0tleS5zaWdCeXRlcyA9IGlLZXkuc2lnQnl0ZXMgPSBoYXNoZXJCbG9ja1NpemVCeXRlcztcblxuXHQgICAgICAgICAgICAvLyBTZXQgaW5pdGlhbCB2YWx1ZXNcblx0ICAgICAgICAgICAgdGhpcy5yZXNldCgpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBSZXNldHMgdGhpcyBITUFDIHRvIGl0cyBpbml0aWFsIHN0YXRlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICBobWFjSGFzaGVyLnJlc2V0KCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcmVzZXQ6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgdmFyIGhhc2hlciA9IHRoaXMuX2hhc2hlcjtcblxuXHQgICAgICAgICAgICAvLyBSZXNldFxuXHQgICAgICAgICAgICBoYXNoZXIucmVzZXQoKTtcblx0ICAgICAgICAgICAgaGFzaGVyLnVwZGF0ZSh0aGlzLl9pS2V5KTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogVXBkYXRlcyB0aGlzIEhNQUMgd2l0aCBhIG1lc3NhZ2UuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1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njc0NTIzMDEsIDB4ZWZjZGFiODksXG5cdCAgICAgICAgICAgICAgICAweDk4YmFkY2ZlLCAweDEwMzI1NDc2XG5cdCAgICAgICAgICAgIF0pO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9Qcm9jZXNzQmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgLy8gU3dhcCBlbmRpYW5cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCAxNjsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBvZmZzZXRfaSA9IG9mZnNldCArIGk7XG5cdCAgICAgICAgICAgICAgICB2YXIgTV9vZmZzZXRfaSA9IE1bb2Zmc2V0X2ldO1xuXG5cdCAgICAgICAgICAgICAgICBNW29mZnNldF9pXSA9IChcblx0ICAgICAgICAgICAgICAgICAgICAoKChNX29mZnNldF9pIDw8IDgpICB8IChNX29mZnNldF9pID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE1fb2Zmc2V0X2kgPDwgMjQpIHwgKE1fb2Zmc2V0X2kgPj4+IDgpKSAgJiAweGZmMDBmZjAwKVxuXHQgICAgICAgICAgICAgICAgKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgSCA9IHRoaXMuX2hhc2gud29yZHM7XG5cblx0ICAgICAgICAgICAgdmFyIE1fb2Zmc2V0XzAgID0gTVtvZmZzZXQgKyAwXTtcblx0ICAgICAgICAgICAgdmFyIE1fb2Zmc2V0XzEgID0gTVtvZmZzZXQgKyAxXTtcblx0ICAgICAgICAgICAgdmFyIE1fb2Zmc2V0XzIgID0gTVtvZmZzZXQgKyAyXTtcblx0ICAgICAgICAgICAgdmFyIE1fb2Zmc2V0XzMgID0gTVtvZm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AgdGhpcy5fcHJvY2VzcygpO1xuXG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgaGFzaCA9IHRoaXMuX2hhc2g7XG5cdCAgICAgICAgICAgIHZhciBIID0gaGFzaC53b3JkcztcblxuXHQgICAgICAgICAgICAvLyBTd2FwIGVuZGlhblxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDQ7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgICAgIHZhciBIX2kgPSBIW2ldO1xuXG5cdCAgICAgICAgICAgICAgICBIW2ldID0gKCgoSF9pIDw8IDgpICB8IChIX2kgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgICAgKCgoSF9pIDw8IDI0KSB8IChIX2kgPj4+IDgpKSAgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIFJldHVybiBmaW5hbCBjb21wdXRlZCBoYXNoXG5cdCAgICAgICAgICAgIHJldHVybiBoYXNoO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBjbG9uZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICB2YXIgY2xvbmUgPSBIYXNoZXIuY2xvbmUuY2FsbCh0aGlzKTtcblx0ICAgICAgICAgICAgY2xvbmUuX2hhc2ggPSB0aGlzLl9oYXNoLmNsb25lKCk7XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGNsb25lO1xuXHQgICAgICAgIH1cblx0ICAgIH0pO1xuXG5cdCAgICBmdW5jdGlvbiBGRihhLCBiLCBjLCBkLCB4LCBzLCB0KSB7XG5cdCAgICAgICAgdmFyIG4gPSBhICsgKChiICYgYykgfCAofmIgJiBkKSkgKyB4ICsgdDtcblx0ICAgICAgICByZXR1cm4gKChuIDw8IHMpIHwgKG4gPj4+ICgzMiAtIHMpKSkg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LndvcmRzO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrV29yZHNMZW5ndGggPSBibG9ja1dvcmRzLmxlbmd0aDtcblxuXHQgICAgICAgICAgICAgICAgLy8gSXRlcmF0aW9uc1xuXHQgICAgICAgICAgICAgICAgdmFyIGludGVybWVkaWF0ZSA9IGJsb2NrO1xuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDE7IGkgPCBpdGVyYXRpb25zOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICBpbnRlcm1lZGlhdGUgPSBobWFjLmZpbmFsaXplKGludGVybWVkaWF0ZSk7XG5cdCAgICAgICAgICAgICAgICAgICAgaG1hYy5yZXNldCgpO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgaW50ZXJtZWRpYXRlV29yZHMgPSBpbnRlcm1lZGlhdGUud29yZHM7XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBYT1IgaW50ZXJtZWRpYXRlIHdpdGggYmxvY2tcblx0ICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IGJsb2NrV29yZHNMZW5ndGg7IGorKykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBibG9ja1dvcmRzW2pdIF49IGludGVybWVkaWF0ZVdvcmRzW2pdO1xuXHQgICAgICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgZGVyaXZlZEtleS5jb25jYXQoYmxvY2spO1xuXHQgICAgICAgICAgICAgICAgYmxvY2tJbmRleFdvcmRzWzBdKys7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgZGVyaXZlZEtleS5zaWdCeXRlcyA9IGtleVNpemUgKiA0O1xuXG5cdCAgICAgICAgICAgIHJldHVybiBkZXJpdmVkS2V5O1xuXHQgICAgICAgIH1cblx0ICAgIH0pO1xuXG5cdCAgICA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50ZXIgdmFsdWVzXG5cdCAgICAgICAgICAgIHZhciBDID0gdGhpcy5fQyA9IFtcblx0ICAgICAgICAgICAgICAgIChLWzJdIDw8IDE2KSB8IChLWzJdID4+PiAxNiksIChLWzBdICYgMHhmZmZmMDAwMCkgfCAoS1sxXSAmIDB4MDAwMGZmZmYpLFxuXHQgICAgICAgICAgICAgICAgKEtbM10gPDwgMTYpIHwgKEtbM10gPj4+IDE2KSwgKEtbMV0gJiAweGZmZmYwMDAwKSB8IChLWzJdICYgMHgwMDAwZmZmZiksXG5cdCAgICAgICAgICAgICAgICAoS1swXSA8PCAxNikgfCAoS1swXSA+Pj4gMTYpLCAoS1syXSAmIDB4ZmZmZjAwMDApIHwgKEtbM10gJiAweDAwMDBmZmZmKSxcblx0ICAgICAgICAgICAgICAgIChLWzFdIDw8IDE2KSB8IChLWzFdID4+PiAxNiksIChLWzNdICYgMHhmZmZmMDAwMCkgfCAoS1swXSAmIDB4MDAwMGZmZmYpXG5cdCAgICAgICAgICAgIF07XG5cblx0ICAgICAgICAgICAgLy8gQ2FycnkgYml0XG5cdCAgICAgICAgICAgIHRoaXMuX2IgPSAwO1xuXG5cdCAgICAgICAgICAgIC8vIEl0ZXJhdGUgdGhlIHN5c3RlbSBmb3VyIHRpbWVzXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBuZXh0U3RhdGUuY2FsbCh0aGlzKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIE1vZGlmeSB0aGUgY291bnRlcnNcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA4OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIENbaV0gXj0gWFsoaSArIDQpICYgN107XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBJViBzZXR1cFxuXHQgICAgICAgICAgICBpZiAoaXYpIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIElWID0gaXYud29yZHM7XG5cdCAgICAgICAgICAgICAgICB2YXIgSVZfMCA9IElWWzBdO1xuXHQgICAgICAgICAgICAgICAgdmFyIElWXzEgPSBJVlsxXTtcblxuXHQgICAgICAgICAgICAgICAgLy8gR2VuZXJhdGUgZm91ciBzdWJ2ZWN0b3JzXG5cdCAgICAgICAgICAgICAgICB2YXIgaTAgPSAoKChJVl8wIDw8IDgpIHwgKElWXzAgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8ICgoKElWXzAgPDwgMjQpIHwgKElWXzAgPj4+IDgpKSAmIDB4ZmYwMGZmMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkyID0gKCgoSVZfMSA8PCA4KSB8IChJVl8xID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfCAoKChJVl8xIDw8IDI0KSB8IChJVl8xID4+PiA4KSkgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMSA9IChpMCA+Pj4gMTYpIHwgKGkyICYgMHhmZmZmMDAwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTMgPSAoaTIgPDwgMTYpICB8IChpMCAmIDB4MDAwMGZmZmYpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBNb2RpZnkgY291bnRlciB2YWx1ZXNcblx0ICAgICAgICAgICAgICAgIENbMF0gXj0gaTA7XG5cdCAgICAgICAgICAgICAgICBDWzFdIF49IGkxO1xuXHQgICAgICAgICAgICAgICAgQ1syXSBePSBpMjtcblx0ICAgICAgICAgICAgICAgIENbM10gXj0gaTM7XG5cdCAgICAgICAgICAgICAgICBDWzRdIF49IGkwO1xuXHQgICAgICAgICAgICAgICAgQ1s1XSBePSBpMTtcblx0ICAgICAgICAgICAgICAgIENbNl0gXj0gaTI7XG5cdCAgICAgICAgICAgICAgICBDWzddIF49IGkzO1xuXG5cdCAgICAgICAgICAgICAgICAvLyB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0gPj4+IDgpKSAgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIEdlbmVyYXRlIGluaXRpYWwgc3RhdGUgdmFsdWVzXG5cdCAgICAgICAgICAgIHZhciBYID0gdGhpcy5fWCA9IFtcblx0ICAgICAgICAgICAgICAgIEtbMF0sIChLWzNdIDw8IDE2KSB8IChLWzJdID4+PiAxNiksXG5cdCAgICAgICAgICAgICAgICBLWzFdLCAoS1swXSA8PCAxNikgfCAoS1szXSA+Pj4gMTYpLFxuXHQgICAgICAgICAgICAgICAgS1syXSwgKEtbMV0gPDwgMTYpIHwgKEtbMF0gPj4+IDE2KSxcblx0ICAgICAgICAgICAgICAgIEtbM10sIChLWzJdIDw8IDE2KSB8IChLWzFdID4+PiAxNilcblx0ICAgICAgICAgICAgXTtcblxuXHQgICAgICAgICAgICAvLyBHZW5lcmF0ZSBpbml0aWFsIGNvdW50ZXIgdmFsdWVzXG5cdCAgICAgICAgICAgIHZhciBDID0gdGhpcy5fQyA9IFtcblx0ICAgICAgICAgICAgICAgIChLWzJdIDw8IDE2KSB8IChLWzJdID4+PiAxNiksIChLWzBdICYgMHhmZmZmMDAwMCkgfCAoS1sxXSAmIDB4MDAwMGZmZmYpLFxuXHQgICAgICAgICAgICAgICAgKEtbM10gPDwgMTYpIHwgKEtbM10gPj4+IDE2KSwgKEtbMV0gJiAweGZmZmYwMDAwKSB8IChLWzJdICYgMHgwMDAwZmZmZiksXG5cdCAgICAgICAgICAgICAgICAoS1swXSA8PCAxNikgfCAoS1swXSA+Pj4gMTYpLCAoS1syXSAmIDB4ZmZmZjAwMDApIHwgKEtbM10gJiAweDAwMDBmZmZmKSxcblx0ICAgICAgICAgICAgICAgIChLWzFdIDw8IDE2KSB8IChLWzFdID4+PiAxNiksIChLWzNdICYgMHhmZmZmMDAwMCkgfCAoS1swXSAmIDB4MDAwMGZmZmYpXG5cdCAgICAgICAgICAgIF07XG5cblx0ICAgICAgICAgICAgLy8gQ2FycnkgYml0XG5cdCAgICAgICAgICAgIHRoaXMuX2IgPSAwO1xuXG5cdCAgICAgICAgICAgIC8vIEl0ZXJhdGUgdGhlIHN5c3RlbSBmb3VyIHRpbWVzXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBuZXh0U3RhdGUuY2FsbCh0aGlzKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIE1vZGlmeSB0aGUgY291bnRlcnNcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA4OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIENbaV0gXj0gWFsoaSArIDQpICYgN107XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBJViBzZXR1cFxuXHQgICAgICAgICAgICBpZiAoaXYpIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIElWID0gaXYud29yZHM7XG5cdCAgICAgICAgICAgICAgICB2YXIgSVZfMCA9IElWWzBdO1xuXHQgICAgICAgICAgICAgICAgdmFyIElWXzEgPSBJVlsxXTtcblxuXHQgICAgICAgICAgICAgICAgLy8gR2VuZXJhdGUgZm91ciBzdWJ2ZWN0b3JzXG5cdCAgICAgICAgICAgICAgICB2YXIgaTAgPSAoKChJVl8wIDw8IDgpIHwgKElWXzAgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8ICgoKElWXzAgPDwgMjQpIHwgKElWXzAgPj4+IDgpKSAmIDB4ZmYwMGZmMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkyID0gKCgoSVZfMSA8PCA4KSB8IChJVl8xID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfCAoKChJVl8xIDw8IDI0KSB8IChJVl8xID4+PiA4KSkgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMSA9IChpMCA+Pj4gMTYpIHwgKGkyICYgMHhmZmZmMDAwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTMgPSAoaTIgPDwgMTYpICB8IChpMCAmIDB4MDAwMGZmZmYpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBNb2RpZnkgY291bnRlciB2YWx1ZXNcblx0ICAgICAgICAgICAgICAgIENbMF0gXj0gaTA7XG5cdCAgICAgICAgICAgICAgICBDWzFdIF49IGkxO1xuXHQgICAgICAgICAgICAgICAgQ1syXSBePSBpMjtcblx0ICAgICAgICAgICAgICAgIENbM10gXj0gaTM7XG5cdCAgICAgICAgICAgICAgICBDWzRdIF49IGkwO1xuXHQgICAgICAgICAgICAgICAgQ1s1XSBePSBpMTtcblx0ICAgICAgICAgICAgICAgIENbNl0gXj0gaTI7XG5cdCAgICAgICAgICAgICAgICBDWzddIF49IGkzO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW0gZm91ciB0aW1lc1xuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICBuZXh0U3RhdGUuY2FsbCh0aGlzKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9Qcm9jZXNzQmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgdmFyIFggPSB0aGlzLl9YO1xuXG5cdCAgICAgICAgICAgIC8vIEl0ZXJhdGUgdGhlIHN5c3RlbVxuXHQgICAgICAgICAgICBuZXh0U3RhdGUuY2FsbCh0aGlzKTtcblxuXHQgICAgICAgICAgICAvLyBHZW5lcmF0ZSBmb3VyIGtleXN0cmVhbSB3b3Jkc1xuXHQgICAgICAgICAgICBTWzBdID0gWFswXSBeICh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zXG5cdCAgICAgICAgICAgIHZhciBrZXkgPSB0aGlzLl9rZXk7XG5cdCAgICAgICAgICAgIHZhciBrZXlXb3JkcyA9IGtleS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGtleVNpZ0J5dGVzID0ga2V5LnNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIEluaXQgc2JveFxuXHQgICAgICAgICAgICB2YXIgUyA9IHRoaXMuX1MgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCAyNTY7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgU1tpXSA9IGk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBLZXkgc2V0dXBcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDAsIGogPSAwOyBpIDwgMjU2OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciBrZXlCeXRlSW5kZXggPSBpICUga2V5U2lnQnl0ZXM7XG5cdCAgICAgICAgICAgICAgICB2YXIga2V5Qnl0ZSA9IChrZXlXb3Jkc1trZXlCeXRlSW5kZXggPj4+IDJdID4+PiAoMjQgLSAoa2V5Qnl0ZUluZGV4ICUgNCkgKiA4KSkgJiAweGZmO1xuXG5cdCAgICAgICAgICAgICAgICBqID0gKGogKyBTW2ldICsga2V5Qnl0ZSkgJSAyNTY7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXBcblx0ICAgICAgICAgICAgICAgIHZhciB0ID0gU1tpXTtcblx0ICAgICAgICAgICAgICAgIFNbaV0gPSBTW2pdO1xuXHQgICAgICAgICAgICAgICAgU1tqXSA9IHQ7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBDb3VudGVyc1xuXHQgICAgICAgICAgICB0aGlzLl9pID0gdGhpcy5faiA9IDA7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb1Byb2Nlc3NCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNld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AmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAoKChNX29mZnNldF9pIDw8IDI0KSB8IChNX29mZnNldF9pID4+PiA4KSkgICYgMHhmZjAwZmYwMClcblx0ICAgICAgICAgICAgICAgICk7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgdmFyIEggID0gdGhpcy5faGFzaC53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGhsID0gX2hsLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgaHIgPSBfaHIud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB6bCA9IF96bC53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHpyID0gX3pyLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2wgPSBfc2wud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBzciA9IF9zci53b3JkcztcblxuXHQgICAgICAgICAgICAvLyBXb3JraW5nIHZhcmlhYmxlc1xuXHQgICAgICAgICAgICB2YXIgYWwsIGJsLCBjbCwgZGwsIGVsO1xuXHQgICAgICAgICAgICB2YXIgYXIsIGJyLCBjciwgZHIsIGVyO1xuXG5cdCAgICAgICAgICAgIGFyID0gYWwgPSBIWzBdO1xuXHQgICAgICAgICAgICBiciA9IGJsID0gSFsxXTtcblx0ICAgICAgICAgICAgY3IgPSBjbCA9IEhbMl07XG5cdCAgICAgICAgICAgIGRyID0gZGwgPSBIWzNdO1xuXHQgICAgICAgICAgICBlciA9IGVsID0gSFs0XTtcblx0ICAgICAgICAgICAgLy8gQ29tcHV0YXRpb25cblx0ICAgICAgICAgICAgdmFyIHQ7XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODA7IGkgKz0gMSkge1xuXHQgICAgICAgICAgICAgICAgdCA9IChhbCArICBNW29mZnNldCt6bFtpXV0pfDA7XG5cdCAgICAgICAgICAgICAgICBpZiAoaTwxNil7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjEoYmwsY2wsZGwpICsgaGxbMF07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8MzIpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMihibCxjbCxkbCkgKyBobFsxXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw0OCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYzKGJsLGNsLGRsKSArIGhsWzJdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDY0KSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjQoYmwsY2wsZGwpICsgaGxbM107XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Ugey8vIGlmIChpPDgwKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjUoYmwsY2wsZGwpICsgaGxbNF07XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB0ID0gdHwwO1xuXHQgICAgICAgICAgICAgICAgdCA9ICByb3RsKHQsc2xbaV0pO1xuXHQgICAgICAgICAgICAgICAgdCA9ICh0K2VsKXwwO1xuXHQgICAgICAgICAgICAgICAgYWwgPSBlbDtcblx0ICAgICAgICAgICAgICAgIGVsID0gZGw7XG5cdCAgICAgICAgICAgICAgICBkbCA9IHJvdGwoY2wsIDEwKTtcblx0ICAgICAgICAgICAgICAgIGNsID0gYmw7XG5cdCAgICAgICAgICAgICAgICBibCA9IHQ7XG5cblx0ICAgICAgICAgICAgICAgIHQgPSAoYXIgKyBNW29mZnNldCt6cltpXV0pfDA7XG5cdCAgICAgICAgICAgICAgICBpZiAoaTwxNil7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjUoYnIsY3IsZHIpICsgaHJbMF07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8MzIpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmNChicixjcixkcikgKyBoclsxXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw0OCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYzKGJyLGNyLGRyKSArIGhyWzJdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDY0KSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjIoYnIsY3IsZHIpICsgaHJbM107XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Ugey8vIGlmIChpPDgwKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjEoYnIsY3IsZHIpICsgaHJbNF07XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB0ID0gdHwwO1xuXHQgICAgICAgICAgICAgICAgdCA9ICByb3RsKHQsc3JbaV0pIDtcblx0ICAgICAgICAgICAgICAgIHQgPSAodCtlcil8MDtcblx0ICAgICAgICAgICAgICAgIGFyID0gZXI7XG5cdCAgICAgICAgICAgICAgICBlciA9IGRyO1xuXHQgICAgICAgICAgICAgICAgZHIgPSByb3RsKGNyLCAxMCk7XG5cdCAgICAgICAgICAgICAgICBjciA9IGJyO1xuXHQgICAgICAgICAgICAgICAgYnIgPSB0O1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIC8vIEludGVybWVkaWF0ZSBoYXNoIHZhbHVlXG5cdCAgICAgICAgICAgIHQgICAgPSAoSFsxXSArIGNsICsgZHIpfDA7XG5cdCAgICAgICAgICAgIEhbMV0gPSAoSFsyXSArIGRsICsgZXIpfDA7XG5cdCAgICAgICAgICAgIEhbMl0gPSAoSFszXSArIGVsICsgYXIpfDA7XG5cdCAgICAgICAgICAgIEhbM10gPSAoSFs0XSArIGFsICsgYnIpfDA7XG5cdCAgICAgICAgICAgIEhbNF0gPSAoSFswXSArIGJsICsgY3IpfDA7XG5cdCAgICAgICAgICAgIEhbMF0gPSAgdDtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvRmluYWxpemU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgLy8gU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GkgPCA1OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICB2YXIgSF9pID0gSFtpXTtcblxuXHQgICAgICAgICAgICAgICAgLy8gU3dhcFxuXHQgICAgICAgICAgICAgICAgSFtpXSA9ICgoKEhfaSA8PCA4KSAgfCAoSF9pID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICAgICgoKEhfaSA8PCAyNCkgfCAoSF9pID4+PiA4KSkgICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBSZXR1cm4gZmluYWwgY29tcHV0ZWQgaGFzaFxuXHQgICAgICAgICAgICByZXR1cm4gaGFzaDtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIGNsb25lID0gSGFzaGVyLmNsb25lLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIGNsb25lLl9oYXNoID0gdGhpcy5faGFzaC5jbG9uZSgpO1xuXG5cdCAgICAgICAgICAgIHJldHVybiBjbG9uZTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXG5cdCAgICBmdW5jdGlvbiBmMSh4LCB5LCB6KSB7XG5cdCAgICAgICAgcmV0dXJuICgoeCkgXiAoeSkgXiAoeikpO1xuXG5cdCAgICB9XG5cblx0ICAgIGZ1bmN0aW9uIGYyKHgsIHksIHopIHtcblx0ICAgICAgICByZXR1cm4gKCgoeCkmKHkpKSB8ICgofngpJih6KSkpO1xuXHQgICAgfVxuXG5cdCAgICBmdW5jdGlvbiBmMyh4LCB5LCB6KSB7XG5cdCAgICAgICAgcmV0dXJuICgoKHgpIHwgKH4oeSkpKSBeICh6KSk7XG5cdCAgICB9XG5cblx0ICAgIGZ1bmN0aW9uIGY0KHgsIHksIHopIHtcblx0ICAgICAgICByZXR1cm4g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gPSBDX2xpYi5Xb3JkQXJyYXk7XG5cdCAgICB2YXIgSGFzaGVyID0gQ19saWIuSGFzaGVyO1xuXHQgICAgdmFyIENfYWxnbyA9IEMuYWxnbztcblxuXHQgICAgLy8gUmV1c2FibGUgb2JqZWN0XG5cdCAgICB2YXIgVyA9IFtdO1xuXG5cdCAgICAvKipcblx0ICAgICAqIFNIQS0xIGhhc2ggYWxnb3JpdGhtLlxuXHQgICAgICovXG5cdCAgICB2YXIgU0hBMSA9IENfYWxnby5TSEExID0gSGFzaGVyLmV4dGVuZCh7XG5cdCAgICAgICAgX2RvUmVzZXQ6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdGhpcy5faGFzaCA9IG5ldyBXb3JkQXJyYXkuaW5pdChbXG5cdCAgICAgICAgICAgICAgICAweDY3NDUyMzAxLCAweGVmY2RhYjg5LFxuXHQgICAgICAgICAgICAgICAgMHg5OGJhZGNmZSwgMHgxMDMyNTQ3Nixcblx0ICAgICAgICAgICAgICAgIDB4YzNkMmUxZjBcblx0ICAgICAgICAgICAgXSk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb1Byb2Nlc3NCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgSCA9IHRoaXMuX2hhc2gud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gV29ya2luZyB2YXJpYWJsZXNcblx0ICAgICAgICAgICAgdmFyIGEgPSBIWzBdO1xuXHQgICAgICAgICAgICB2YXIgYiA9IEhbMV07XG5cdCAgICAgICAgICAgIHZhciBjID0gSFsyXTtcblx0ICAgICAgICAgICAgdmFyIGQgPSBIWzNdO1xuXHQgICAgICAgICAgICB2YXIgZSA9IEhbNF07XG5cblx0ICAgICAgICAgICAgLy8gQ29tcHV0YXRpb25cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA4MDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBpZiAoaSA8IDE2KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgV1tpXSA9IE1bb2Zmc2V0ICsgaV0gfCAwO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgbiA9IFdbaSAtIDNdIF4gV1tpIC0gOF0gXiBXW2kgLSAxNF0gXiBXW2kgLSAxNl07XG5cdCAgICAgICAgICAgICAgICAgICAgV1tpXSA9IChuIDw8IDEpIHwgKG4gPj4+IDMxKTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgdmFyIHQgPSAoKGEgPDwgNSkgfCAoYSA+Pj4gMjcpKSArIGUgKyBXW2ldO1xuXHQgICAgICAgICAgICAgICAgaWYgKGkgPCAyMCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHQgKz0gKChiICYgYykgfCAofmIgJiBkKSkgKyAweDVhODI3OTk5O1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpIDwgNDApIHtcblx0ICAgICAgICAgICAgICAgICAgICB0ICs9IChiIF4gYyBeIGQpICsgMHg2ZWQ5ZWJhMTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaSA8IDYwKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdCArPSAoKGIgJiBjKSB8IChiICYgZCkgfCAoYyAmIGQpKSAtIDB4NzBlNDQzMjQ7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgLyogaWYgKGkgPCA4MCkgKi8ge1xuXHQgICAgICAgICAgICAgICAgICAgIHQgKz0gKGIgXiBjIF4gZCkgLSAweDM1OWQzZTJhO1xuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICBlID0gZDtcblx0ICAgICAgICAgICAgICAgIGQgPSBjO1xuXHQgICAgICAgICAgICAgICAgYyA9IChiIDw8IDMwKSB8IChiID4+PiAyKTtcblx0ICAgICAgICAgIC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50c1xuXHQgICAgKGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICBmdW5jdGlvbiBpc1ByaW1lKG4pIHtcblx0ICAgICAgICAgICAgdmFyIHNxcnROID0gTWF0aC5zcXJ0KG4pO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBmYWN0b3IgPSAyOyBmYWN0b3IgPD0gc3FydE47IGZhY3RvcisrKSB7XG5cdCAgICAgICAgICAgICAgICBpZiAoIShuICUgZmFjdG9yKSkge1xuXHQgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiB0cnVlO1xuXHQgICAgICAgIH1cblxuXHQgICAgICAgIGZ1bmN0aW9uIGdldEZyYWN0aW9uYWxCaXRzKG4pIHtcblx0ICAgICAgICAgICAgcmV0dXJuICgobiAtIChuIHwgMCkpICogMHgxMDAwMDAwMDApIHwgMDtcblx0ICAgICAgICB9XG5cblx0ICAgICAgICB2YXIgbiA9IDI7XG5cdCAgICAgICAgdmFyIG5QcmltZSA9IDA7XG5cdCAgICAgICAgd2hpbGUgKG5QcmltZSA8IDY0KSB7XG5cdCAgICAgICAgICAgIGlmIChpc1ByaW1lKG4pKSB7XG5cdCAgICAgICAgICAgICAgICBpZiAoblByaW1lIDwgOCkge1xuXHQgICAgICAgICAgICAgICAgICAgIEhbblByaW1lXSA9IGdldEZyYWN0aW9uYWxCaXRzKE1hdGgucG93KG4sIDEgLyAyKSk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICBLW25QcmltZV0gPSBnZXRGcmFjdGlvbmFsQml0cyhNYXRoLnBvdyhuLCAxIC8gMykpO1xuXG5cdCAgICAgICAgICAgICAgICBuUHJpbWUrKztcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIG4rKztcblx0ICAgICAgICB9XG5cdCAgICB9KCkpO1xuXG5cdCAgICAvLyBSZXVzYWJsZSBvYmplY3Rcblx0ICAgIHZhciBXID0gW107XG5cblx0ICAgIC8qKlxuXHQgICAgICogU0hBLTI1NiBoYXNoIGFsZ29yaXRobS5cblx0ICAgICAqL1xuXHQgICAgdmFyIFNIQTI1NiA9IENfYWxnby5TSEEyNTYgPSBIYXNoZXIuZXh0ZW5kKHtcblx0ICAgICAgICBfZG9SZXNldDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICB0aGlzLl9oYXNoID0gbmV3IFdvcmRBcnJheS5pbml0KEguc2xpY2UoMCkpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9Qcm9jZXNzQmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgdmFyIEggPSB0aGlzLl9oYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFdvcmtpbmcgdmFyaWFibGVzXG5cdCAgICAgICAgICAgIHZhciBhID0gSFswXTtcblx0ICAgICAgICAgICAgdmFyIGIgPSBIWzFdO1xuXHQgICAgICAgICAgICB2YXIgYyA9IEhbMl07XG5cdCAgICAgICAgICAgIHZhciBkID0gSFszXTtcblx0ICAgICAgICAgICAgdmFyIGUgPSBIWzRdO1xuXHQgICAgICAgICAgICB2YXIgZiA9IEhbNV07XG5cdCAgICAgICAgICAgIHZhciBnID0gSFs2XTtcblx0ICAgICAgICAgICAgdmFyIGggPSBIWzddO1xuXG5cdCAgICAgICAgICAgIC8vIENvbXB1dGF0aW9uXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNjQ7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKGkgPCAxNikge1xuXHQgICAgICAgICAgICAgICAgICAgIFdbaV0gPSBNW29mZnNldCArIGldIHwgMDtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMHggPSBXW2kgLSAxNV07XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMCAgPSAoKGdhbW1hMHggPDwgMjUpIHwgKGdhbW1hMHggPj4+IDcpKSAgXlxuXHQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChnYW1tYTB4IDw8IDE0KSB8IChnYW1tYTB4ID4+PiAxOCkpIF5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZ2FtbWEweCA+Pj4gMyk7XG5cblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExeCA9IFdbaSAtIDJdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTEgID0gKChnYW1tYTF4IDw8IDE1KSB8IChnYW1tYTF4ID4+PiAxNykpIF5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZ2FtbWExeCA8PCAxMykgfCAoZ2FtbWExeCA+Pj4gMTkpKSBeXG5cdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdhbW1hMXggPj4+IDEwKTtcblxuXHQgICAgICAgICAgICAgICAgICAgIFdbaV0gPSBnYW1tYTAgKyBXW2kgLSA3XSArIGdhbW1hMSArIFdbaSAtIDE2XTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgdmFyIGNoICA9IChlICYgZikgXiAofmUgJiBnKTtcblx0ICAgICAgICAgICAgICAgIHZhciBtYWogPSAoYSAmIGIpIF4gKGEgJiBjKSBeIChiICYgYyk7XG5cblx0ICAgICAgICAgICAgICAgIHZhciBzaWdtYTAgPSAoKGEgPDwgMzApIHwgKGEgPj4+IDIpKSBeICgoYSA8PCAxOSkgfCAoYSA+Pj4gMTMpKSBeICgoYSA8PCAxMCkgfCAoYSA+Pj4gMjIpKTtcblx0ICAgICAgICAgICAgICAgIHZhciBzaWdtYTEgPSAoKGUgPDwgMjYpIHwgKGUgPj4+IDYpKSBeICgoZSA8PCAyMSkgfCAoZSA+Pj4gMTEpKSBeICgoZSA8PCA3KSAgfCAoZSA+Pj4gMjUpKTtcblxuXHQgICAgICAgICAgICAgICAgdmFyIHQxID0gaCArIHNpZ21hMSArIGNoICsgS1tpXSArIFdbaV07XG5cdCAgICAgICAgICAgICAgICB2YXIgdDIgPSBzaWdtYTAgKyBtYWo7XG5cblx0ICAgICAgICAgICAgICAgIGggPSBnO1xuXHQgICAgICAgICAgICAgICAgZyA9IGY7XG5cdCAgICAgICAgICAgICAgICBmID0gZTtcblx0ICAgICAgICAgICAgICAgIGUgPSAoZCArIHQxKSB8IDA7XG5cdCAgICAgICAgICAgICAgICBkID0gYztcblx0ICAgICAgICAgICAgICAgIGMgPSBiO1xuXHQgICAgICAgICAgICAgICAgYiA9IGE7XG5cdCAgICAgICAgICAgICAgICBhID0gKHQxICsgdDIpIHwgMDtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIEludGVybWVkaWF0ZSBoYXNoIHZhbHVlXG5cdCAgICAgICAgICAgIEhbMF0gPSAoSFswXSArIGEpIHwgMDtcblx0ICAgICAgICAgICAgSFsxXSA9IChIWzFdICsgYikgfCAwO1xuXHQgICAgICAgICAgICBIWzJdID0gKEhbMl0gKyBjKSB8IDA7XG5cdCAgICAgICAgICAgIEhbM10gPSAoSFszXSArIGQpIHwgMDtcblx0ICAgICAgICAgICAgSFs0XSA9IChIWzRdICsgZSkgfCAwO1xuXHQgICAgICAgICAgICBIWzVdID0gKEhbNV0gKyBmKSB8IDA7XG5cdCAgICAgICAgICAgIEhbNl0gPSAoSFs2XSArIGcpIHwgMDtcblx0ICAgICAgICAgICAgSFs3XSA9IChIWzddICsgaCkgfCAwO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9GaW5hbGl6ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGRhdGEgPSB0aGlzLl9kYXRhO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VuZENvbnN0YW50TXN3ID0gMDtcblx0ICAgICAgICAgICAgdmFyIHJvdW5kQ29uc3RhbnRMc3cgPSAwO1xuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgNzsgaisrKSB7XG5cdCAgICAgICAgICAgICAgICBpZiAoTEZTUiAmIDB4MDEpIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgYml0UG9zaXRpb24gPSAoMSA8PCBqKSAtIDE7XG5cdCAgICAgICAgICAgICAgICAgICAgaWYgKGJpdFBvc2l0aW9uIDwgMzIpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgcm91bmRDb25zdGFudExzdyBePSAxIDw8IGJpdFBvc2l0aW9uO1xuXHQgICAgICAgICAgICAgICAgICAgIH0gZWxzZSAvKiBpZiAoYml0UG9zaXRpb24gPj0gMzIpICovIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgcm91bmRDb25zdGFudE1zdyBePSAxIDw8IChiaXRQb3NpdGlvbiAtIDMyKTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIENvbXB1dGUgbmV4dCBMRlNSXG5cdCAgICAgICAgICAgICAgICBpZiAoTEZTUiAmIDB4ODApIHtcblx0ICAgICAgICAgICAgICAgICAgICAvLyBQcmltaXRpdmUgcG9seW5vbWlhbCBvdmVyIEdGKDIpOiB4XjggKyB4XjYgKyB4XjUgKyB4XjQgKyAxXG5cdCAgICAgICAgICAgICAgICAgICAgTEZTUiA9IChMRlNSIDw8IDEpIF4gMHg3MTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgTEZTUiA8PD0gMTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIFJPVU5EX0NPTlNUQU5UU1tpXSA9IFg2NFdvcmQuY3JlYXRlKHJvdW5kQ29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GkrKykge1xuXHQgICAgICAgICAgICAgICAgc3RhdGVbaV0gPSBuZXcgWDY0V29yZC5pbml0KCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICB0aGlzLmJsb2NrU2l6ZSA9ICgxNjAwIC0gMiAqIHRoaXMuY2ZnLm91dHB1dExlbmd0aCkgLyAzMjtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgc3RhdGUgPSB0aGlzLl9zdGF0ZTtcblx0ICAgICAgICAgICAgdmFyIG5CbG9ja1NpemVMYW5lcyA9IHRoaXMuYmxvY2tTaXplIC8gMjtcblxuXHQgICAgICAgICAgICAvLyBBYnNvcmJcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBuQmxvY2tTaXplTGFuZXM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgTTJpICA9IE1bb2Zmc2V0ICsgMiAqIGldO1xuXHQgICAgICAgICAgICAgICAgdmFyIE0yaTEgPSBNW29mZnNldCArIDIgKiBpICsgMV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgICAgICBNMmkgPSAoXG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTTJpIDw8IDgpICB8IChNMmkgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTTJpIDw8IDI0KSB8IChNMmkgPj4+IDgpKSAgJiAweGZmMDBmZjAwKVxuXHQgICAgICAgICAgICAgICAgKTtcblx0ICAgICAgICAgICAgICAgIE0yaTEgPSAoXG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTTJpMSA8PCA4KSAgfCAoTTJpMSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAoKChNMmkxIDw8IDI0KSB8IChNMmkxID4+PiA4KSkgICYgMHhmZjAwZmYwMClcblx0ICAgICAgICAgICAgICAgICk7XG5cblx0ICAgICAgICAgICAgICAgIC8vIEFic29yYiBtZXNzYWdlIGludG8gc3RhdGVcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lID0gc3RhdGVbaV07XG5cdCAgICAgICAgICAgICAgICBsYW5lLmhpZ2ggXj0gTTJpMTtcblx0ICAgICAgICAgICAgICAgIGxhbmUubG93ICBePSBNMmk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBSb3VuZHNcblx0ICAgICAgICAgICAgZm9yICh2YXIgcm91bmQgPSAwOyByb3VuZCA8IDI0OyByb3VuZCsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBUaGV0YVxuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgeCA9IDA7IHggPCA1OyB4KyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAvLyBNaXggY29sdW1uIGxhbmVzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHRNc3cgPSAwLCB0THN3ID0gMDtcblx0ICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciB5ID0gMDsgeSA8IDU7IHkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW3ggKyA1ICogeV07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHRNc3cgXj0gbGFuZS5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB0THN3IF49IGxhbmUubG93O1xuXHQgICAgICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFRlbXBvcmFyeSB2YWx1ZXNcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVHggPSBUW3hdO1xuXHQgICAgICAgICAgICAgICAgICAgIFR4LmhpZ2ggPSB0TXN3O1xuXHQgICAgICAgICAgICAgICAgICAgIFR4LmxvdyAgPSB0THN3O1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgeCA9IDA7IHggPCA1OyB4KyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVHg0ID0gVFsoeCArIDQpICUgNV07XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4MSA9IFRbKHggKyAxKSAlIDVdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBUeDFNc3cgPSBUeDEuaGlnaDtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVHgxTHN3ID0gVHgxLmxvdztcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIE1peCBzdXJyb3VuZGluZyBjb2x1bW5zXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHRNc3cgPSBUeDQuaGlnaCBeICgoVHgxTXN3IDw8IDEpIHwgKFR4MUxzdyA+Pj4gMzEpKTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdExzdyA9IFR4NC5sb3cgIF4gKChUeDFMc3cgPDwgMSkgfCAoVHgxTXN3ID4+PiAzMSkpO1xuXHQgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgNTsgeSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lID0gc3RhdGVbeCArIDUgKiB5XTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgbGFuZS5oaWdoIF49IHRNc3c7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUubG93ICBePSB0THN3O1xuXHQgICAgICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gUmhvIFBpXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBsYW5lSW5kZXggPSAxOyBsYW5lSW5kZXggPCAyNTsgbGFuZUluZGV4KyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW2xhbmVJbmRleF07XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmVNc3cgPSBsYW5lLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmVMc3cgPSBsYW5lLmxvdztcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgcmhvT2Zmc2V0ID0gUkhPX09GRlNFVFNbbGFuZUluZGV4XTtcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFJvdGF0ZSBsYW5lc1xuXHQgICAgICAgICAgICAgICAgICAgIGlmIChyaG9PZmZzZXQgPCAzMikge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdE1zdyA9IChsYW5lTXN3IDw8IHJob09mZnNldCkgfCAobGFuZUxzdyA+Pj4gKDMyIC0gcmhvT2Zmc2V0KSk7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0THN3ID0gKGxhbmVMc3cgPDwgcmhvT2Zmc2V0KSB8IChsYW5lTXN3ID4+PiAoMzIgLSByaG9PZmZzZXQpKTtcblx0ICAgICAgICAgICAgICAgICAgICB9IGVsc2UgLyogaWYgKHJob09mZnNldCA+PSAzMikgKi8ge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdE1zdyA9IChsYW5lTHN3IDw8IChyaG9PZmZzZXQgLSAzMikpIHwgKGxhbmVNc3cgPj4+ICg2NCAtIHJob09mZnNldCkpO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdExzdyA9IChsYW5lTXN3IDw8IChyaG9PZmZzZXQgLSAzMikpIHwgKGxhbmVMc3cgPj4+ICg2NCAtIHJob09mZnNldCkpO1xuXHQgICAgICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFRyYW5zcG9zZSBsYW5lc1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBUUGlMYW5lID0gVFtQSV9JTkRFWEVTW2xhbmVJbmRleF1dO1xuXHQgICAgICAgICAgICAgICAgICAgIFRQaUxhbmUuaGlnaCA9IHRNc3c7XG5cdCAgICAgICAgICAgICAgICAgICAgVFBpTGFuZS5sb3cgID0gdExzdztcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gUmhvIHBpIGF0IHggPSB5ID0gMFxuXHQgICAgICAgICAgICAgICAgdmFyIFQwID0gVFswXTtcblx0ICAgICAgICAgICAgICAgIHZhciBzdGF0ZTAgPSBzdGF0ZVswXTtcblx0ICAgICAgICAgICAgICAgIFQwLmhpZ2ggPSBzdGF0ZTAuaGlnaDtcblx0ICAgICAgICAgICAgICAgIFQwLmxvdyAgPSBzdGF0ZTAubG93O1xuXG5cdCAgICAgICAgICAgICAgICAvLyBDaGlcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgeSA9IDA7IHkgPCA1OyB5KyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lSW5kZXggPSB4ICsgNSAqIHk7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lID0gc3RhdGVbbGFuZUluZGV4XTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIFRMYW5lID0gVFtsYW5lSW5kZXhdO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgVHgxTGFuZSA9IFRbKCh4ICsgMSkgJSA1KSArIDUgKiB5XTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIFR4MkxhbmUgPSBUWygoeCArIDIpICUgNSkgKyA1ICogeV07XG5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgLy8gTWl4IHJvd3Ncblx0ICAgICAgICAgICAgICAgICAgICAgICAgbGFuZS5oaWdoID0gVExhbmUuaGlnaCBeICh+VHgxTGFuZS5oaWdoICYgVHgyTGFuZS5oaWdoKTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgbGFuZS5sb3cgID0gVExhbmUubG93ICBeICh+VHgxTGFuZS5sb3cgICYgVHgyTGFuZS5sb3cpO1xuXHQgICAgICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gSW90YVxuXHQgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVswXTtcblx0ICAgICAgICAgICAgICAgIHZhciByb3VuZENvbnN0YW50ID0gUk9VTkRfQ09OU1RBTlRTW3JvdW5kXTtcblx0ICAgICAgICAgICAgICAgIGxhbmUuaGlnaCBePSByb3VuZENvbnN0YW50LmhpZ2g7XG5cdCAgICAgICAgICAgICAgICBsYW5lLmxvdyAgXj0gcm91bmRDb25zdGFudC5sb3c7O1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb0ZpbmFsaXplOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGF0YSA9IHRoaXMuX2RhdGE7XG5cdCAgICAgICAgICAgIHZhciBkYXRhV29yZHMgPSBkYXRhLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgbkJpdHNUb3RhbCA9IHRoaXMuX25EYXRhQnl0ZXMgKiA4O1xuXHQgICAgICAgICAgICB2YXIgbkJpdHNMZWZ0ID0gZGF0YS5zaWdCeXRlcyAqIDg7XG5cdCAgICAgICAgICAgIHZhciBibG9ja1NpemVCaXRzID0gdGhpcy5ibG9ja1NpemUgKiAzMjtcblxuXHQgICAgICAgICAgICAvLyBBZGQgcGFkZ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AgICAgICB2YXIgSCA9IHRoaXMuX2hhc2gud29yZHM7XG5cblx0ICAgICAgICAgICAgdmFyIEgwID0gSFswXTtcblx0ICAgICAgICAgICAgdmFyIEgxID0gSFsxXTtcblx0ICAgICAgICAgICAgdmFyIEgyID0gSFsyXTtcblx0ICAgICAgICAgICAgdmFyIEgzID0gSFszXTtcblx0ICAgICAgICAgICAgdmFyIEg0ID0gSFs0XTtcblx0ICAgICAgICAgICAgdmFyIEg1ID0gSFs1XTtcblx0ICAgICAgICAgICAgdmFyIEg2ID0gSFs2XTtcblx0ICAgICAgICAgICAgdmFyIEg3ID0gSFs3XTtcblxuXHQgICAgICAgICAgICB2YXIgSDBoID0gSDAuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEgwbCA9IEgwLmxvdztcblx0ICAgICAgICAgICAgdmFyIEgxaCA9IEgxLmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBIMWwgPSBIMS5sb3c7XG5cdCAgICAgICAgICAgIHZhciBIMmggPSBIMi5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDJsID0gSDIubG93O1xuXHQgICAgICAgICAgICB2YXIgSDNoID0gSDMuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEgzbCA9IEgzLmxvdztcblx0ICAgICAgICAgICAgdmFyIEg0aCA9IEg0LmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBINGwgPSBINC5sb3c7XG5cdCAgICAgICAgICAgIHZhciBINWggPSBINS5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDVsID0gSDUubG93O1xuXHQgICAgICAgICAgICB2YXIgSDZoID0gSDYuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEg2bCA9IEg2Lmxvdztcblx0ICAgICAgICAgICAgdmFyIEg3aCA9IEg3LmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBIN2wgPSBINy5sb3c7XG5cblx0ICAgICAgICAgICAgLy8gV29ya2luZyB2YXJpYWJsZXNcblx0ICAgICAgICAgICAgdmFyIGFoID0gSDBoO1xuXHQgICAgICAgICAgICB2YXIgYWwgPSBIMGw7XG5cdCAgICAgICAgICAgIHZhciBiaCA9IEgxaDtcblx0ICAgICAgICAgICAgdmFyIGJsID0gSDFsO1xuXHQgICAgICAgICAgICB2YXIgY2ggPSBIMmg7XG5cdCAgICAgICAgICAgIHZhciBjbCA9IEgybDtcblx0ICAgICAgICAgICAgdmFyIGRoID0gSDNoO1xuXHQgICAgICAgICAgICB2YXIgZGwgPSBIM2w7XG5cdCAgICAgICAgICAgIHZhciBlaCA9IEg0aDtcblx0ICAgICAgICAgICAgdmFyIGVsID0gSDRsO1xuXHQgICAgICAgICAgICB2YXIgZmggPSBINWg7XG5cdCAgICAgICAgICAgIHZhciBmbCA9IEg1bDtcblx0ICAgICAgICAgICAgdmFyIGdoID0gSDZoO1xuXHQgICAgICAgICAgICB2YXIgZ2wgPSBINmw7XG5cdCAgICAgICAgICAgIHZhciBoaCA9IEg3aDtcblx0ICAgICAgICAgICAgdmFyIGhsID0gSDdsO1xuXG5cdCAgICAgICAgICAgIC8vIFJvdW5kc1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDgwOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICB2YXIgV2kgPSBXW2ldO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBFeHRlbmQgbWVzc2FnZVxuXHQgICAgICAgICAgICAgICAgaWYgKGkgPCAxNikge1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaWggPSBXaS5oaWdoID0gTVtvZmZzZXQgKyBpICogMl0gICAgIHwgMDtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2lsID0gV2kubG93ICA9IE1bb2Zmc2V0ICsgaSAqIDIgKyAxXSB8IDA7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgICAgIC8vIEdhbW1hMFxuXHQgICAgICAgIC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nYW1tYTF4bCA8PCAzKSB8IChnYW1tYTF4aCA+Pj4gMjkpKSBeICgoZ2FtbWExeGwgPj4+IDYpIHwgKGdhbW1hMXhoIDw8IDI2KSk7XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBXW2ldID0gZ2FtbWEwICsgV1tpIC0gN10gKyBnYW1tYTEgKyBXW2kgLSAxNl1cblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2k3ICA9IFdbaSAtIDddO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaTdoID0gV2k3LmhpZ2g7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpN2wgPSBXaTcubG93O1xuXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpMTYgID0gV1tpIC0gMTZdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaTE2aCA9IFdpMTYuaGlnaDtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2kxNmwgPSBXaTE2LmxvdztcblxuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaWwgPSBnYW1tYTBsICsgV2k3bDtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2loID0gZ2FtbWEwaCArIFdpN2ggKyAoKFdpbCA+Pj4gMCkgPCAoZ2FtbWEwbCA+Pj4gMCkgPyAxIDogMCk7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpbCA9IFdpbCArIGdhbW1hMWw7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpaCA9IFdpaCArIGdhbW1hMWggKyAoKFdpbCA+Pj4gMCkgPCAoZ2FtbWExbCA+Pj4gMCkgPyAxIDogMCk7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpbCA9IFdpbCArIFdpMTZsO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaWggPSBXaWggKyBXaTE2aCArICgoV2lsID4+PiAwKSA8IChXaTE2bCA+Pj4gMCkgPyAxIDogMCk7XG5cblx0ICAgICAgICAgICAg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tpXSArIFdbaV1cblx0ICAgICAgICAgICAgICAgIHZhciBLaSAgPSBLW2ldO1xuXHQgICAgICAgICAgICAgICAgdmFyIEtpaCA9IEtpLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICB2YXIgS2lsID0gS2kubG93O1xuXG5cdCAgICAgICAgICAgICAgICB2YXIgdDFsID0gaGwgKyBzaWdtYTFsO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQxaCA9IGhoICsgc2lnbWExaCArICgodDFsID4+PiAwKSA8IChobCA+Pj4gMCkgPyAxIDogMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgdDFsID0gdDFsICsgY2hsO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQxaCA9IHQxaCArIGNoaCArICgodDFsID4+PiAwKSA8IChjaGwgPj4+IDApID8gMSA6IDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQxbCA9IHQxbCArIEtpbDtcblx0ICAgICAgICAgICAgICAgIHZhciB0MWggPSB0MWggKyBLaWggKyAoKHQxbCA+Pj4gMCkgPCAoS2lsID4+PiAwKSA/IDEgOiAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciB0MWwgPSB0MWwgKyBXaWw7XG5cdCAgICAgICAgICAgICAgICB2YXIgdDFoID0gdDFoICsgV2loICsgKCh0MWwgPj4+IDApIDwgKFdpbCA+Pj4gMCkgPyAxIDogMCk7XG5cblx0ICAgICAgICAgICAgICAgIC8vIHQyID0gc2lnbWEwICsgbWFqXG5cdCAgICAgICAgICAgICAgICB2YXIgdDJsID0gc2lnbWEwbCArIG1hamw7XG5cdCAgICAgICAgICAgICAgICB2YXIgdDJoID0gc2lnbWEwaCArIG1hamggKyAoKHQybCA+Pj4gMCkgPCAoc2lnbWEwbCA+Pj4gMCkgPyAxIDogMCk7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFVwZGF0ZSB3b3JraW5nIHZhcmlhYmxlc1xuXHQgICAgICAgICAgICAgICAgaGggPSBnaDtcblx0ICAgICAgICAgICAgICAgIGhsID0gZ2w7XG5cdCAgICAgICAgICAgICAgICBnaCA9IGZoO1xuXHQgICAgICAgICAgICAgICAgZ2wgPSBmbDtcblx0ICAgICAgICAgICAgICAgIGZoID0gZWg7XG5cdCAgICAgICAgICAgICAgICBmbCA9IGVsO1xuXHQgICAgICAgICAgICAgICAgZWwgPSAoZGwgKyB0MWwpIHwgMDtcblx0ICAgICAgICAgICAgICAgIGVoID0gKGRoICsgdDFoICsgKChlbCA+Pj4gMCkgPCAoZGwgPj4+IDApID8gMSA6IDApKSB8IDA7XG5cdCAgICAgICAgICAgICAgICBkaCA9IGNoO1xuXHQgICAgICAgICAgICAgICAgZGwgPSBjbDtcblx0ICAgICAgICAgICAgICAgIGNoID0gYmg7XG5cdCAgICAgICAgICAgICAgICBjbCA9IGJsO1xuXHQgICAgICAgICAgICAgICAgYmggPSBhaDtcblx0ICAgICAgICAgICAgICAgIGJsID0gYWw7XG5cdCAgICAgICAgICAgICAgICBhbCA9ICh0MWwgKyB0MmwpIHwgMDtcblx0ICAgICAgICAgICAgICAgIGFoID0gKHQxaCArIHQyaCArICgoYWwgPj4+IDApIDwgKHQxbCA+Pj4gMCkgPyAxIDogMCkpIHwgMDtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIEludGVybWVkaWF0ZSBoYXNoIHZhbHVlXG5cdCAgICAgICAgICAgIEgwbCA9IEgwLmxvdyAgPSAoSDBsICsgYWwpO1xuXHQgICAgICAgICAgICBIMC5oaWdoID0gKEgwaCArIGFoICsgKChIMGwgPj4+IDApIDwgKGFsID4+PiAwKSA/IDEgOiAwKSk7XG5cdCAgICAgICAgICAgIEgxbCA9IEgxLmxvdyAgPSAoSDFsICsgYmwpO1xuXHQgICAgICAgICAgICBIMS5oaWdoID0gKEgxaCArIGJoICsgKChIMWwgPj4+IDApIDwgKGJsID4+PiAwKSA/IDEgOiAwKSk7XG5cdCAgICAgICAgICAgIEgybCA9IEgyLmxvdyAgPSAoSDJsICsgY2wpO1xuXHQgICAgICAgICAgICBIMi5oaWdoID0gKEgyaCArIGNoICsgKChIMmwgPj4+IDApIDwgKGNsID4+PiAwKSA/IDEgOiAwKSk7XG5cdCAgICAgICAgICAgIEgzbCA9IEgzLmxvdyAgPSAoSDNsICsgZGwpO1xuXHQgICAgICAgICAgICBIMy5oaWdoID0gKEgzaCArIGRoICsgKChIM2wgPj4+IDApIDwgKGRsID4+PiAwKSA/IDEgOiAwKSk7XG5cdCAgICAgICAgICAgIEg0bCA9IEg0LmxvdyAgPSAoSDRsICsgZWwpO1xuXHQgICAgICAgICAgICBINC5oaWdoID0gKEg0aCArIGVoICsgKChINGwgPj4+IDApIDwgKGVsID4+PiAwKSA/IDEgOiAwKSk7XG5cdCAgICAgICAgICAgIEg1bCA9IEg1LmxvdyAgPSAoSDVsICsgZmwpO1xuXHQgICAgICAgICAgICBINS5oaWdoID0gKEg1aCArIGZoICsgKChINWwgPj4+IDApIDwgKGZsID4+PiAwKSA/IDEgOiAwKSk7XG5cdCAgICAgICAgICAgIEg2bCA9IEg2LmxvdyAgPSAoSDZsICsgZ2wpO1xuXHQgICAgICAgICAgICBINi5oaWdoID0gKEg2aCArIGdoICsgKChINmwgPj4+IDApIDwgKGdsID4+PiAwKSA/IDEgOiAwKSk7XG5cdCAgICAgICAgICAgIEg3bCA9IEg3LmxvdyAgPSAoSDdsICsgaGwpO1xuXHQgICAgICAgICAgICBINy5oaWdoID0gKEg3aCArIGhoICsgKChIN2wgPj4+IDApIDwgKGhsID4+PiAwKSA/IDEgOiAwKSk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb0ZpbmFsaXplOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGF0YSA9IHRoaXMuX2RhdGE7XG5cdCAgICAgICAgICAgIHZhciBkYXRhV29yZHMgPSBkYXRhLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBuQml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yOSwgMzJcblx0ICAgIF07XG5cblx0ICAgIC8vIEN1bXVsYXRpdmUgYml0IHNoaWZ0IGNvbnN0YW50c1xuXHQgICAgdmFyIEJJVF9TSElGVFMgPSBbMSwgIDIsICA0LCAgNiwgIDgsICAxMCwgMTIsIDE0LCAxNSwgMTcsIDE5LCAyMSwgMjMsIDI1LCAyNywgMjhdO1xuXG5cdCAgICAvLyBTQk9YZXMgYW5kIHJvdW5kIHBlcm11dGF0aW9uIGNvbnN0YW50c1xuXHQgICAgdmFyIFNCT1hfUCA9IFtcblx0ICAgICAgICB7XG5cdCAgICAgICAgICAgIDB4MDogMHg4MDgyMDAsXG5cdCAgICAgICAgICAgIDB4MTAwMDAwMDA6IDB4ODAwMCxcblx0ICAgICAgICAgICAgMHgyMDAwMDAwMDogMHg4MDgwMDIsXG5cdCAgICAgICAgICAgIDB4MzAwMDAwMDA6IDB4Mixcblx0ICAgICAgICAgICAgMHg0MDAwMDAwMDogMHgyMDAsXG5cdCAgICAgICAgICAgIDB4NTAwMDAwMDA6IDB4ODA4MjAyLFxuXHQgICAgICAgICAgICAweDYwMDAwMDAwOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHg3MDAwMDAwMDogMHg4MDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDA6IDB4MjAyLFxuXHQgICAgICAgICAgICAweDkwMDAwMDAwOiAweDgwMDIwMCxcblx0ICAgICAgICAgICAgMHhhMDAwMDAwMDogMHg4MjAwLFxuXHQgICAgICAgICAgICAweGIwMDAwMDAwOiAweDgwODAwMCxcblx0ICAgICAgICAgICAgMHhjMDAwMDAwMDogMHg4MDAyLFxuXHQgICAgICAgICAgICAweGQwMDAwMDAwOiAweDgwMDAwMixcblx0ICAgICAgICAgICAgMHhlMDAwMDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweGYwMDAwMDAwOiAweDgyMDIsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDAwOiAweDgwODIwMixcblx0ICAgICAgICAgICAgMHgyODAwMDAwMDogMHg4MjAyLFxuXHQgICAgICAgICAgICAweDM4MDAwMDAwOiAweDgwMDAsXG5cdCAgICAgICAgICAgIDB4NDgwMDAwMDA6IDB4ODA4MjAwLFxuXHQgICAgICAgICAgICAweDU4MDAwMDAwOiAweDIwMCxcblx0ICAgICAgICAgICAgMHg2ODAwMDAwMDogMHg4MDgwMDIsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwMDA6IDB4Mixcblx0ICAgICAgICAgICAgMHg4ODAwMDAwMDogMHg4MDAyMDAsXG5cdCAgICAgICAgICAgIDB4OTgwMDAwMDA6IDB4ODIwMCxcblx0ICAgICAgICAgICAgMHhhODAwMDAwMDogMHg4MDgwMDAsXG5cdCAgICAgICAgICAgIDB4YjgwMDAwMDA6IDB4ODAwMjAyLFxuXHQgICAgICAgICAgICAweGM4MDAwMDAwOiAweDgwMDAwMixcblx0ICAgICAgICAgICAgMHhkODAwMDAwMDogMHg4MDAyLFxuXHQgICAgICAgICAgICAweGU4MDAwMDAwOiAweDIwMixcblx0ICAgICAgICAgICAgMHhmODAwMDAwMDogMHg4MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTogMHg4MDAwLFxuXHQgICAgICAgICAgICAweDEwMDAwMDAxOiAweDIsXG5cdCAgICAgICAgICAgIDB4MjAwMDAwMDE6IDB4ODA4MjAwLFxuXHQgICAgICAgICAgICAweDMwMDAwMDAxOiAweDgwMDAwMCxcblx0ICAgICAgICAgICAgMHg0MDAwMDAwMTogMHg4MDgwMDIsXG5cdCAgICAgICAgICAgIDB4NTAwMDAwMDE6IDB4ODIwMCxcblx0ICAgICAgICAgICAgMHg2MDAwMDAwMTogMHgyMDAsXG5cdCAgICAgICAgICAgIDB4NzAwMDAwMDE6IDB4ODAwMjAyLFxuXHQgICAgICAgICAgICAweDgwMDAwMDAxOiAweDgwODIwMixcblx0ICAgICAgICAgICAgMHg5MDAwMDAwMTogMHg4MDgwMDAsXG5cdCAgICAgICAgICAgIDB4YTAwMDAwMDE6IDB4ODAwMDAyLFxuXHQgICAgICAgICAgICAweGIwMDAwMDAxOiAweDgyMDIsXG5cdCAgICAgICAgICAgIDB4YzAwMDAwMDE6IDB4MjAyLFxuXHQgICAgICAgICAgICAweGQwMDAwMDAxOiAweDgwMDIwMCxcblx0ICAgICAgICAgICAgMHhlMDAwMDAwMTogMHg4MDAyLFxuXHQgICAgICAgICAgICAweGYwMDAwMDAxOiAweDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMTogMHg4MDgyMDIsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwMDE6IDB4ODA4MDAwLFxuXHQgICAgICAgICAgICAweDI4MDAwMDAxOiAweDgwMDAwMCxcblx0ICAgICAgICAgICAgMHgzODAwMDAwMTogMHgyMDAsXG5cdCAgICAgICAgICAgIDB4NDgwMDAwMDE6IDB4ODAwMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDAwMTogMHg4MDAwMDIsXG5cdCAgICAgICAgICAgIDB4NjgwMDAwMDE6IDB4Mixcblx0ICAgICAgICAgICAgMHg3ODAwMDAwMTogMHg4MjAyLFxuXHQgICAgICAgICAgICAweDg4MDAwMDAxOiAweDgwMDIsXG5cdCAgICAgICAgICAgIDB4OTgwMDAwMDE6IDB4ODAwMjAyLFxuXHQgICAgICAgICAgICAweGE4MDAwMDAxOiAweDIwMixcblx0ICAgICAgICAgICAgMHhiODAwMDAwMTogMHg4MDgyMDAsXG5cdCAgICAgICAgICAgIDB4YzgwMDAwMDE6IDB4ODAwMjAwLFxuXHQgICAgICAgICAgICAweGQ4MDAwMDAxOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZTgwMDAwMDE6IDB4ODIwMCxcblx0ICAgICAgICAgICAgMHhmODAwMDAwMTogMHg4MDgwMDJcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDQwMDg0MDEwLFxuXHQgICAgICAgICAgICAweDEwMDAwMDA6IDB4NDAwMCxcblx0ICAgICAgICAgICAgMHgyMDAwMDAwOiAweDgwMDAwLFxuXHQgICAgICAgICAgICAweDMwMDAwMDA6IDB4NDAwODAwMTAsXG5cdCAgICAgICAgICAgIDB4NDAwMDAwMDogMHg0MDAwMDAxMCxcblx0ICAgICAgICAgICAgMHg1MDAwMDAwOiAweDQwMDg0MDAwLFxuXHQgICAgICAgICAgICAweDYwMDAwMDA6IDB4NDAwMDQwMDAsXG5cdCAgICAgICAgICAgIDB4NzAwMDAwMDogMHgxMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwOiAweDg0MDAwLFxuXHQgICAgICAgICAgICAweDkwMDAwMDA6IDB4NDAwMDQwMTAsXG5cdCAgICAgICAgICAgIDB4YTAwMDAwMDogMHg0MDAwMDAwMCxcblx0ICAgICAgICAgICAgMHhiMDAwMDAwOiAweDg0MDEwLFxuXHQgICAgICAgICAgICAweGMwMDAwMDA6IDB4ODAwMTAsXG5cdCAgICAgICAgICAgIDB4ZDAwMDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweGUwMDAwMDA6IDB4NDAxMCxcblx0ICAgICAgICAgICAgMHhmMDAwMDAwOiAweDQwMDgwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDogMHg0MDAwNDAwMCxcblx0ICAgICAgICAgICAgMHgxODAwMDAwOiAweDg0MDEwLFxuXHQgICAgICAgICAgICAweDI4MDAwMDA6IDB4MTAsXG5cdCAgICAgICAgICAgIDB4MzgwMDAwMDogMHg0MDAwNDAxMCxcblx0ICAgICAgICAgICAgMHg0ODAwMDAwOiAweDQwMDg0MDEwLFxuXHQgICAgICAgICAgICAweDU4MDAwMDA6IDB4NDAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4NjgwMDAwMDogMHg4MDAwMCxcblx0ICAgICAgICAgICAgMHg3ODAwMDAwOiAweDQwMDgwMDEwLFxuXHQgICAgICAgICAgICAweDg4MDAwMDA6IDB4ODAwMTAsXG5cdCAgICAgICAgICAgIDB4OTgwMDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweGE4MDAwMDA6IDB4NDAwMCxcblx0ICAgICAgICAgICAgMHhiODAwMDAwOiAweDQwMDgwMDAwLFxuXHQgICAgICAgICAgICAweGM4MDAwMDA6IDB4NDAwMDAwMTAsXG5cdCAgICAgICAgICAgIDB4ZDgwMDAwMDogMHg4NDAwMCxcblx0ICAgICAgICAgICAgMHhlODAwMDAwOiAweDQwMDg0MDAwLFxuXHQgICAgICAgICAgICAweGY4MDAwMDA6IDB4NDAxMCxcblx0ICAgICAgICAgICAgMHgxMDAwMDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDExMDAwMDAwOiAweDQwMDgwMDEwLFxuXHQgICAgICAgICAgICAweDEyMDAwMDAwOiAweDQwMDA0MDEwLFxuXHQgICAgICAgICAgICAweDEzMDAwMDAwOiAweDQwMDg0MDAwLFxuXHQgICAgICAgICAgICAweDE0MDAwMDAwOiAweDQwMDgwMDAwLFxuXHQgICAgICAgICAgICAweDE1MDAwMDAwOiAweDEwLFxuXHQgICAgICAgICAgICAweDE2MDAwMDAwOiAweDg0MDEwLFxuXHQgICAgICAgICAgICAweDE3MDAwMDAwOiAweDQwMDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwMDA6IDB4NDAxMCxcblx0ICAgICAgICAgICAgMHgxOTAwMDAwMDogMHg4MDAwMCxcblx0ICAgICAgICAgICAgMHgxYTAwMDAwMDogMHg4MDAxMCxcblx0ICAgICAgICAgICAgMHgxYjAwMDAwMDogMHg0MDAwMDAxMCxcblx0ICAgICAgICAgICAgMHgxYzAwMDAwMDogMHg4NDAwMCxcblx0ICAgICAgICAgICAgMHgxZDAwMDAwMDogMHg0MDAwNDAwMCxcblx0ICAgICAgICAgICAgMHgxZTAwMDAwMDogMHg0MDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxZjAwMDAwMDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHgxMDgwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHgxMTgwMDAwMDogMHg4MDAwMCxcblx0ICAgICAgICAgICAgMHgxMjgwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHgxMzgwMDAwMDogMHg0MDAwLFxuXHQgICAgICAgICAgICAweDE0ODAwMDAwOiAweDQwMDA0MDAwLFxuXHQgICAgICAgICAgICAweDE1ODAwMDAwOiAweDQwMDg0MDEwLFxuXHQgICAgICAgICAgICAweDE2ODAwMDAwOiAweDEwLFxuXHQgICAgICAgICAgICAweDE3ODAwMDAwOiAweDQwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDE4ODAwMDAwOiAweDQwMDg0MDAwLFxuXHQgICAgICAgICAgICAweDE5ODAwMDAwOiAweDQwMDAwMDEwLFxuXHQgICAgICAgICAgICAweDFhODAwMDAwOiAweDQwMDA0MDEwLFxuXHQgICAgICAgICAgICAweDFiODAwMDAwOiAweDgwMDEwLFxuXHQgICAgICAgICAgICAweDFjODAwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MWQ4MDAwMDA6IDB4NDAxMCxcblx0ICAgICAgICAgICAgMHgxZTgwMDAwMDogMHg0MDA4MDAxMCxcblx0ICAgICAgICAgICAgMHgxZjgwMDAwMDogMHg4NDAwMFxuXHQgICAgICAgIH0sXG5cdCAgICAgICAge1xuXHQgICAgICAgICAgICAweDA6IDB4MTA0LFxuXHQgICAgICAgICAgICAweDEwMDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDIwMDAwMDogMHg0MDAwMTAwLFxuXHQgICAgICAgICAgICAweDMwMDAwMDogMHgxMDEwNCxcblx0ICAgICAgICAgICAgMHg0MDAwMDA6IDB4MTAwMDQsXG5cdCAgICAgICAgICAgIDB4NTAwMDAwOiAweDQwMDAwMDQsXG5cdCAgICAgICAgICAgIDB4NjAwMDAwOiAweDQwMTAxMDQsXG5cdCAgICAgICAgICAgIDB4NzAwMDAwOiAweDQwMTAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwOiAweDQwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4OTAwMDAwOiAweDQwMTAxMDAsXG5cdCAgICAgICAgICAgIDB4YTAwMDAwOiAweDEwMTAwLFxuXHQgICAgICAgICAgICAweGIwMDAwMDogMHg0MDEwMDA0LFxuXHQgICAgICAgICAgICAweGMwMDAwMDogMHg0MDAwMTA0LFxuXHQgICAgICAgICAgICAweGQwMDAwMDogMHgxMDAwMCxcblx0ICAgICAgICAgICAgMHhlMDAwMDA6IDB4NCxcblx0ICAgICAgICAgICAgMHhmMDAwMDA6IDB4MTAwLFxuXHQgICAgICAgICAgICAweDgwMDAwOiAweDQwMTAxMDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwOiAweDQwMTAwMDQsXG5cdCAgICAgICAgICAgIDB4MjgwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MzgwMDAwOiAweDQwMDAxMDAsXG5cdCAgICAgICAgICAgIDB4NDgwMDAwOiAweDQwMDAwMDQsXG5cdCAgICAgICAgICAgIDB4NTgwMDAwOiAweDEwMDAwLFxuXHQgICAgICAgICAgICAweDY4MDAwMDogMHgxMDAwNCxcblx0ICAgICAgICAgICAgMHg3ODAwMDA6IDB4MTA0LFxuXHQgICAgICAgICAgICAweDg4MDAwMDogMHg0LFxuXHQgICAgICAgICAgICAweDk4MDAwMDogMHgxMDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDAwOiAweDQwMTAwMDAsXG5cdCAgICAgICAgICAgIDB4YjgwMDAwOiAweDEwMTA0LFxuXHQgICAgICAgICAgICAweGM4MDAwMDogMHgxMDEwMCxcblx0ICAgICAgICAgICAgMHhkODAwMDA6IDB4NDAwMDEwNCxcblx0ICAgICAgICAgICAgMHhlODAwMDA6IDB4NDAxMDEwNCxcblx0ICAgICAgICAgICAgMHhmODAwMDA6IDB4NDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMDAwMDAwOiAweDQwMTAxMDAsXG5cdCAgICAgICAgICAgIDB4MTEwMDAwMDogMHgxMDAwNCxcblx0ICAgICAgICAgICAgMHgxMjAwMDAwOiAweDEwMDAwLFxuXHQgICAgICAgICAgICAweDEzMDAwMDA6IDB4NDAwMDEwMCxcblx0ICAgICAgICAgICAgMHgxNDAwMDAwOiAweDEwMCxcblx0ICAgICAgICAgICAgMHgxNTAwMDAwOiAweDQwMTAxMDQsXG5cdCAgICAgICAgICAgIDB4MTYwMDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDE3MDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxODAwMDAwOiAweDQwMDAxMDQsXG5cdCAgICAgICAgICAgIDB4MTkwMDAwMDogMHg0MDAwMDAwLFxuXHQgICAgICAgICAgICAweDFhMDAwMDA6IDB4NCxcblx0ICAgICAgICAgICAgMHgxYjAwMDAwOiAweDEwMTAwLFxuXHQgICAgICAgICAgICAweDFjMDAwMDA6IDB4NDAxMDAwMCxcblx0ICAgICAgICAgICAgMHgxZDAwMDAwOiAweDEwNCxcblx0ICAgICAgICAgICAgMHgxZTAwMDAwOiAweDEwMTA0LFxuXHQgICAgICAgICAgICAweDFmMDAwMDA6IDB4NDAxMDAwNCxcblx0ICAgICAgICAgICAgMHgxMDgwMDAwOiAweDQwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTE4MDAwMDogMHgxMDQsXG5cdCAgICAgICAgICAgIDB4MTI4MDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweDEzODAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxNDgwMDAwOiAweDEwMDA0LFxuXHQgICAgICAgICAgICAweDE1ODAwMDA6IDB4NDAwMDEwMCxcblx0ICAgICAgICAgICAgMHgxNjgwMDAwOiAweDEwMCxcblx0ICAgICAgICAgICAgMHgxNzgwMDAwOiAweDQwMTAwMDQsXG5cdCAgICAgICAgICAgIDB4MTg4MDAwMDogMHgxMDAwMCxcblx0ICAgICAgICAgICAgMHgxOTgwMDAwOiAweDQwMTAxMDQsXG5cdCAgICAgICAgICAgIDB4MWE4MDAwMDogMHgxMDEwNCxcblx0ICAgICAgICAgICAgMHgxYjgwMDAwOiAweDQwMDAwMDQsXG5cdCAgICAgICAgICAgIDB4MWM4MDAwMDogMHg0MDAwMTA0LFxuXHQgICAgICAgICAgICAweDFkODAwMDA6IDB4NDAxMDAwMCxcblx0ICAgICAgICAgICAgMHgxZTgwMDAwOiAweDQsXG5cdCAgICAgICAgICAgIDB4MWY4MDAwMDogMHgxMDEwMFxuXHQgICAgICAgIH0sXG5cdCAgICAgICAge1xuXHQgICAgICAgICAgICAweDA6IDB4ODA0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4MTAwMDA6IDB4ODAwMDEwNDAsXG5cdCAgICAgICAgICAgIDB4MjAwMDA6IDB4NDAxMDQwLFxuXHQgICAgICAgICAgICAweDMwMDAwOiAweDgwNDAwMDAwLFxuXHQgICAgICAgICAgICAweDQwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4NTAwMDA6IDB4NDAxMDAwLFxuXHQgICAgICAgICAgICAweDYwMDAwOiAweDgwMDAwMDQwLFxuXHQgICAgICAgICAgICAweDcwMDAwOiAweDQwMDA0MCxcblx0ICAgICAgICAgICAgMHg4MDAwMDogMHg4MDAwMDAwMCxcblx0ICAgICAgICAgICAgMHg5MDAwMDogMHg0MDAwMDAsXG5cdCAgICAgICAgICAgIDB4YTAwMDA6IDB4NDAsXG5cdCAgICAgICAgICAgIDB4YjAwMDA6IDB4ODAwMDEwMDAsXG5cdCAgICAgICAgICAgIDB4YzAwMDA6IDB4ODA0MDAwNDAsXG5cdCAgICAgICAgICAgIDB4ZDAwMDA6IDB4MTA0MCxcblx0ICAgICAgICAgICAgMHhlMDAwMDogMHgxMDAwLFxuXHQgICAgICAgICAgICAweGYwMDAwOiAweDgwNDAxMDQwLFxuXHQgICAgICAgICAgICAweDgwMDA6IDB4ODAwMDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDA6IDB4NDAsXG5cdCAgICAgICAgICAgIDB4MjgwMDA6IDB4ODA0MDAwNDAsXG5cdCAgICAgICAgICAgIDB4MzgwMDA6IDB4ODAwMDEwMDAsXG5cdCAgICAgICAgICAgIDB4NDgwMDA6IDB4NDAxMDAwLFxuXHQgICAgICAgICAgICAweDU4MDAwOiAweDgwNDAxMDQwLFxuXHQgICAgICAgICAgICAweDY4MDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4NzgwMDA6IDB4ODA0MDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODgwMDA6IDB4MTAwMCxcblx0ICAgICAgICAgICAgMHg5ODAwMDogMHg4MDQwMTAwMCxcblx0ICAgICAgICAgICAgMHhhODAwMDogMHg0MDAwMDAsXG5cdCAgICAgICAgICAgIDB4YjgwMDA6IDB4MTA0MCxcblx0ICAgICAgICAgICAgMHhjODAwMDogMHg4MDAwMDAwMCxcblx0ICAgICAgICAgICAgMHhkODAwMDogMHg0MDAwNDAsXG5cdCAgICAgICAgICAgIDB4ZTgwMDA6IDB4NDAxMDQwLFxuXHQgICAgICAgICAgICAweGY4MDAwOiAweDgwMDAwMDQwLFxuXHQgICAgICAgICAgICAweDEwMDAwMDogMHg0MDAwNDAsXG5cdCAgICAgICAgICAgIDB4MTEwMDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHgxMjAwMDA6IDB4ODAwMDAwNDAsXG5cdCAgICAgICAgICAgIDB4MTMwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTQwMDAwOiAweDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTUwMDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweDE2MDAwMDogMHg4MDQwMTAwMCxcblx0ICAgICAgICAgICAgMHgxNzAwMDA6IDB4ODAwMDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwOiAweDgwNDAxMDQwLFxuXHQgICAgICAgICAgICAweDE5MDAwMDogMHg4MDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYTAwMDA6IDB4ODA0MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWIwMDAwOiAweDQwMTA0MCxcblx0ICAgICAgICAgICAgMHgxYzAwMDA6IDB4ODAwMDEwMDAsXG5cdCAgICAgICAgICAgIDB4MWQwMDAwOiAweDQwMDAwMCxcblx0ICAgICAgICAgICAgMHgxZTAwMDA6IDB4NDAsXG5cdCAgICAgICAgICAgIDB4MWYwMDAwOiAweDEwMDAsXG5cdCAgICAgICAgICAgIDB4MTA4MDAwOiAweDgwNDAwMDAwLFxuXHQgICAgICAgICAgICAweDExODAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHgxMjgwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxMzgwMDA6IDB4NDAxMDAwLFxuXHQgICAgICAgICAgICAweDE0ODAwMDogMHg0MDAwNDAsXG5cdCAgICAgICAgICAgIDB4MTU4MDAwOiAweDgwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDE2ODAwMDogMHg4MDAwMTA0MCxcblx0ICAgICAgICAgICAgMHgxNzgwMDA6IDB4NDAsXG5cdCAgICAgICAgICAgIDB4MTg4MDAwOiAweDgwMDAwMDQwLFxuXHQgICAgICAgICAgICAweDE5ODAwMDogMHgxMDAwLFxuXHQgICAgICAgICAgICAweDFhODAwMDogMHg4MDAwMTAwMCxcblx0ICAgICAgICAgICAgMHgxYjgwMDA6IDB4ODA0MDAwNDAsXG5cdCAgICAgICAgICAgIDB4MWM4MDAwOiAweDEwNDAsXG5cdCAgICAgICAgICAgIDB4MWQ4MDAwOiAweDgwNDAxMDAwLFxuXHQgICAgICAgICAgICAweDFlODAwMDogMHg0MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWY4MDAwOiAweDQwMTA0MFxuXHQgICAgICAgIH0sXG5cdCAgICAgICAge1xuXHQgICAgICAgICAgICAweDA6IDB4ODAsXG5cdCAgICAgICAgICAgIDB4MTAwMDogMHgxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDIwMDA6IDB4NDAwMDAsXG5cdCAgICAgICAgICAgIDB4MzAwMDogMHgyMDAwMDAwMCxcblx0ICAgICAgICAgICAgMHg0MDAwOiAweDIwMDQwMDgwLFxuXHQgICAgICAgICAgICAweDUwMDA6IDB4MTAwMDA4MCxcblx0ICAgICAgICAgICAgMHg2MDAwOiAweDIxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDcwMDA6IDB4NDAwODAsXG5cdCAgICAgICAgICAgIDB4ODAwMDogMHgxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDkwMDA6IDB4MjAwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4YTAwMDogMHgyMDAwMDA4MCxcblx0ICAgICAgICAgICAgMHhiMDAwOiAweDIxMDQwMDgwLFxuXHQgICAgICAgICAgICAweGMwMDA6IDB4MjEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4ZDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweGUwMDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHhmMDAwOiAweDIxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDogMHgxMDQwMDgwLFxuXHQgICAgICAgICAgICAweDE4MDA6IDB4MjEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MjgwMDogMHg4MCxcblx0ICAgICAgICAgICAgMHgzODAwOiAweDEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4NDgwMDogMHg0MDAwMCxcblx0ICAgICAgICAgICAgMHg1ODAwOiAweDIwMDQwMDgwLFxuXHQgICAgICAgICAgICAweDY4MDA6IDB4MjEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4NzgwMDogMHgyMDAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4ODAwOiAweDIwMDQwMDAwLFxuXHQgICAgICAgICAgICAweDk4MDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhhODAwOiAweDIxMDQwMDgwLFxuXHQgICAgICAgICAgICAweGI4MDA6IDB4MTAwMDA4MCxcblx0ICAgICAgICAgICAgMHhjODAwOiAweDIwMDAwMDgwLFxuXHQgICAgICAgICAgICAweGQ4MDA6IDB4MjEwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ZTgwMDogMHgxMDAwMDAwLFxuXHQgICAgICAgICAgICAweGY4MDA6IDB4NDAwODAsXG5cdCAgICAgICAgICAgIDB4MTAwMDA6IDB4NDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTEwMDA6IDB4ODAsXG5cdCAgICAgICAgICAgIDB4MTIwMDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTMwMDA6IDB4MjEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MTQwMDA6IDB4MTAwMDA4MCxcblx0ICAgICAgICAgICAgMHgxNTAwMDogMHgyMTA0MDAwMCxcblx0ICAgICAgICAgICAgMHgxNjAwMDogMHgyMDA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxNzAwMDogMHgxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDE4MDAwOiAweDIxMDQwMDgwLFxuXHQgICAgICAgICAgICAweDE5MDAwOiAweDIxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDFhMDAwOiAweDEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWIwMDA6IDB4MjAwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWMwMDA6IDB4NDAwODAsXG5cdCAgICAgICAgICAgIDB4MWQwMDA6IDB4MjAwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MWUwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxZjAwMDogMHgxMDQwMDgwLFxuXHQgICAgICAgICAgICAweDEwODAwOiAweDIxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDExODAwOiAweDEwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTI4MDA6IDB4MTA0MDAwMCxcblx0ICAgICAgICAgICAgMHgxMzgwMDogMHgyMDA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxNDgwMDogMHgyMDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNTgwMDogMHgxMDQwMDgwLFxuXHQgICAgICAgICAgICAweDE2ODAwOiAweDgwLFxuXHQgICAgICAgICAgICAweDE3ODAwOiAweDIxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDE4ODAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDE5ODAwOiAweDIxMDQwMDgwLFxuXHQgICAgICAgICAgICAweDFhODAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MWI4MDA6IDB4MjEwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWM4MDA6IDB4MTAwMDA4MCxcblx0ICAgICAgICAgICAgMHgxZDgwMDogMHg0MDAwMCxcblx0ICAgICAgICAgICAgMHgxZTgwMDogMHgyMDA0MDAwMCxcblx0ICAgICAgICAgICAgMHgxZjgwMDogMHgyMDAwMDA4MFxuXHQgICAgICAgIH0sXG5cdCAgICAgICAge1xuXHQgICAgICAgICAgICAweDA6IDB4MTAwMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTAwOiAweDIwMDAsXG5cdCAgICAgICAgICAgIDB4MjAwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDMwMDogMHgxMDIwMjAwOCxcblx0ICAgICAgICAgICAgMHg0MDA6IDB4MTAwMDIwMDAsXG5cdCAgICAgICAgICAgIDB4NTAwOiAweDIwMDAwMCxcblx0ICAgICAgICAgICAgMHg2MDA6IDB4MjAwMDA4LFxuXHQgICAgICAgICAgICAweDcwMDogMHgxMDAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDA6IDB4MCxcblx0ICAgICAgICAgICAgMHg5MDA6IDB4MTAwMDIwMDgsXG5cdCAgICAgICAgICAgIDB4YTAwOiAweDIwMjAwMCxcblx0ICAgICAgICAgICAgMHhiMDA6IDB4OCxcblx0ICAgICAgICAgICAgMHhjMDA6IDB4MTAyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4ZDAwOiAweDIwMjAwOCxcblx0ICAgICAgICAgICAgMHhlMDA6IDB4MjAwOCxcblx0ICAgICAgICAgICAgMHhmMDA6IDB4MTAyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4ODA6IDB4MTAyMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTgwOiAweDEwMjAyMDA4LFxuXHQgICAgICAgICAgICAweDI4MDogMHg4LFxuXHQgICAgICAgICAgICAweDM4MDogMHgyMDAwMDAsXG5cdCAgICAgICAgICAgIDB4NDgwOiAweDIwMjAwOCxcblx0ICAgICAgICAgICAgMHg1ODA6IDB4MTAwMDAwMDgsXG5cdCAgICAgICAgICAgIDB4NjgwOiAweDEwMDAyMDAwLFxuXHQgICAgICAgICAgICAweDc4MDogMHgyMDA4LFxuXHQgICAgICAgICAgICAweDg4MDogMHgyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4OTgwOiAweDIwMDAsXG5cdCAgICAgICAgICAgIDB4YTgwOiAweDEwMDAyMDA4LFxuXHQgICAgICAgICAgICAweGI4MDogMHgxMDIwMDAwOCxcblx0ICAgICAgICAgICAgMHhjODA6IDB4MCxcblx0ICAgICAgICAgICAgMHhkODA6IDB4MTAyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4ZTgwOiAweDIwMjAwMCxcblx0ICAgICAgICAgICAgMHhmODA6IDB4MTAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTAwMDogMHgxMDAwMjAwMCxcblx0ICAgICAgICAgICAgMHgxMTAwOiAweDEwMjAwMDA4LFxuXHQgICAgICAgICAgICAweDEyMDA6IDB4MTAyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MTMwMDogMHgyMDA4LFxuXHQgICAgICAgICAgICAweDE0MDA6IDB4MjAwMDAwLFxuXHQgICAgICAgICAgICAweDE1MDA6IDB4MTAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTYwMDogMHgxMDAwMDAwOCxcblx0ICAgICAgICAgICAgMHgxNzAwOiAweDIwMjAwMCxcblx0ICAgICAgICAgICAgMHgxODAwOiAweDIwMjAwOCxcblx0ICAgICAgICAgICAgMHgxOTAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MWEwMDogMHg4LFxuXHQgICAgICAgICAgICAweDFiMDA6IDB4MTAyMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWMwMDogMHgyMDAwLFxuXHQgICAgICAgICAgICAweDFkMDA6IDB4MTAwMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MWUwMDogMHgxMDIwMjAwMCxcblx0ICAgICAgICAgICAgMHgxZjAwOiAweDIwMDAwOCxcblx0ICAgICAgICAgICAgMHgxMDgwOiAweDgsXG5cdCAgICAgICAgICAgIDB4MTE4MDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTI4MDogMHgyMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDogMHgxMDAwMDAwOCxcblx0ICAgICAgICAgICAgMHgxNDgwOiAweDEwMDAyMDAwLFxuXHQgICAgICAgICAgICAweDE1ODA6IDB4MjAwOCxcblx0ICAgICAgICAgICAgMHgxNjgwOiAweDEwMjAyMDA4LFxuXHQgICAgICAgICAgICAweDE3ODA6IDB4MTAyMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTg4MDogMHgxMDIwMjAwMCxcblx0ICAgICAgICAgICAgMHgxOTgwOiAweDEwMjAwMDA4LFxuXHQgICAgICAgICAgICAweDFhODA6IDB4MjAwMCxcblx0ICAgICAgICAgICAgMHgxYjgwOiAweDIwMjAwOCxcblx0ICAgICAgICAgICAgMHgxYzgwOiAweDIwMDAwOCxcblx0ICAgICAgICAgICAgMHgxZDgwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MWU4MDogMHgxMDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxZjgwOiAweDEwMDAyMDA4XG5cdCAgICAgICAgfSxcblx0ICAgICAgICB7XG5cdCAgICAgICAgICAgIDB4MDogMHgxMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTA6IDB4MjAwMDQwMSxcblx0ICAgICAgICAgICAgMHgyMDogMHg0MDAsXG5cdCAgICAgICAgICAgIDB4MzA6IDB4MTAwNDAxLFxuXHQgICAgICAgICAgICAweDQwOiAweDIxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4NTA6IDB4MCxcblx0ICAgICAgICAgICAgMHg2MDogMHgxLFxuXHQgICAgICAgICAgICAweDcwOiAweDIxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4ODA6IDB4MjAwMDQwMCxcblx0ICAgICAgICAgICAgMHg5MDogMHgxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4YTA6IDB4MjAwMDAwMSxcblx0ICAgICAgICAgICAgMHhiMDogMHgyMTAwNDAwLFxuXHQgICAgICAgICAgICAweGMwOiAweDIxMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ZDA6IDB4NDAxLFxuXHQgICAgICAgICAgICAweGUwOiAweDEwMDQwMCxcblx0ICAgICAgICAgICAgMHhmMDogMHgyMDAwMDAwLFxuXHQgICAgICAgICAgICAweDg6IDB4MjEwMDAwMSxcblx0ICAgICAgICAgICAgMHgxODogMHgwLFxuXHQgICAgICAgICAgICAweDI4OiAweDIwMDA0MDEsXG5cdCAgICAgICAgICAgIDB4Mzg6IDB4MjEwMDQwMCxcblx0ICAgICAgICAgICAgMHg0ODogMHgxMDAwMDAsXG5cdCAgICAgICAgICAgIDB4NTg6IDB4MjAwMDAwMSxcblx0ICAgICAgICAgICAgMHg2ODogMHgyMDAwMDAwLFxuXHQgICAgICAgICAgICAweDc4OiAweDQwMSxcblx0ICAgICAgICAgICAgMHg4ODogMHgxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4OTg6IDB4MjAwMDQwMCxcblx0ICAgICAgICAgICAgMHhhODogMHgyMTAwMDAwLFxuXHQgICAgICAgICAgICAweGI4OiAweDEwMDAwMSxcblx0ICAgICAgICAgICAgMHhjODogMHg0MDAsXG5cdCAgICAgICAgICAgIDB4ZDg6IDB4MjEwMDQwMSxcblx0ICAgICAgICAgICAgMHhlODogMHgxLFxuXHQgICAgICAgICAgICAweGY4OiAweDEwMDQwMCxcblx0ICAgICAgICAgICAgMHgxMDA6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMTA6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDEyMDogMHgyMDAwNDAxLFxuXHQgICAgICAgICAgICAweDEzMDogMHgyMTAwMDAxLFxuXHQgICAgICAgICAgICAweDE0MDogMHgxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MTUwOiAweDIwMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MTYwOiAweDIxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MTcwOiAweDEwMDQwMSxcblx0ICAgICAgICAgICAgMHgxODA6IDB4NDAxLFxuXHQgICAgICAgICAgICAweDE5MDogMHgyMTAwNDAxLFxuXHQgICAgICAgICAgICAweDFhMDogMHgxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MWIwOiAweDEsXG5cdCAgICAgICAgICAgIDB4MWMwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MWQwOiAweDIxMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWUwOiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MWYwOiAweDQwMCxcblx0ICAgICAgICAgICAgMHgxMDg6IDB4MTAwNDAwLFxuXHQgICAgICAgICAgICAweDExODogMHgyMDAwNDAxLFxuXHQgICAgICAgICAgICAweDEyODogMHgyMTAwMDAxLFxuXHQgICAgICAgICAgICAweDEzODogMHgxLFxuXHQgICAgICAgICAgICAweDE0ODogMHgyMDAwMDAwLFxuXHQgICAgICAgICAgICAweDE1ODogMHgxMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTY4OiAweDQwMSxcblx0ICAgICAgICAgICAgMHgxNzg6IDB4MjEwMDQwMCxcblx0ICAgICAgICAgICAgMHgxODg6IDB4MjAwMDAwMSxcblx0ICAgICAgICAgICAgMHgxOTg6IDB4MjEwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYTg6IDB4MCxcblx0ICAgICAgICAgICAgMHgxYjg6IDB4MjEwMDQwMSxcblx0ICAgICAgICAgICAgMHgxYzg6IDB4MTAwNDAxLFxuXHQgICAgICAgICAgICAweDFkODogMHg0MDAsXG5cdCAgICAgICAgICAgIDB4MWU4OiAweDIwMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MWY4OiAweDEwMDAwMVxuXHQgICAgICAgIH0sXG5cdCAgICAgICAge1xuXHQgICAgICAgICAgICAweDA6IDB4ODAwMDgyMCxcblx0ICAgICAgICAgICAgMHgxOiAweDIwMDAwLFxuXHQgICAgICAgICAgICAweDI6IDB4ODAwMDAwMCxcblx0ICAgICAgICAgICAgMHgzOiAweDIwLFxuXHQgICAgICAgICAgICAweDQ6IDB4MjAwMjAsXG5cdCAgICAgICAgICAgIDB4NTogMHg4MDIwODIwLFxuXHQgICAgICAgICAgICAweDY6IDB4ODAyMDgwMCxcblx0ICAgICAgICAgICAgMHg3OiAweDgwMCxcblx0ICAgICAgICAgICAgMHg4OiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4OTogMHg4MDAwODAwLFxuXHQgICAgICAgICAgICAweGE6IDB4MjA4MDAsXG5cdCAgICAgICAgICAgIDB4YjogMHg4MDIwMDIwLFxuXHQgICAgICAgICAgICAweGM6IDB4ODIwLFxuXHQgICAgICAgICAgICAweGQ6IDB4MCxcblx0ICAgICAgICAgICAgMHhlOiAweDgwMDAwMjAsXG5cdCAgICAgICAgICAgIDB4ZjogMHgyMDgyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMDogMHg4MDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDE6IDB4ODAyMDgyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMjogMHg4MDAwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDAzOiAweDgwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDQ6IDB4ODAyMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwNTogMHgyMDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwNjogMHgyMDgyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwNzogMHgyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwODogMHg4MDAwMDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA5OiAweDgyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwYTogMHgyMDAyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwYjogMHg4MDIwODAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDBjOiAweDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGQ6IDB4ODAyMDAyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwZTogMHg4MDAwODAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDBmOiAweDIwMDAwLFxuXHQgICAgICAgICAgICAweDEwOiAweDIwODIwLFxuXHQgICAgICAgICAgICAweDExOiAweDgwMjA4MDAsXG5cdCAgICAgICAgICAgIDB4MTI6IDB4MjAsXG5cdCAgICAgICAgICAgIDB4MTM6IDB4ODAwLFxuXHQgICAgICAgICAgICAweDE0OiAweDgwMDA4MDAsXG5cdCAgICAgICAgICAgIDB4MTU6IDB4ODAwMDAyMCxcblx0ICAgICAgICAgICAgMHgxNjogMHg4MDIwMDIwLFxuXHQgICAgICAgICAgICAweDE3OiAweDIwMDAwLFxuXHQgICAgICAgICAgICAweDE4OiAweDAsXG5cdCAgICAgICAgICAgIDB4MTk6IDB4MjAwMjAsXG5cdCAgICAgICAgICAgIDB4MWE6IDB4ODAyMDAwMCxcblx0ICAgICAgICAgICAgMHgxYjogMHg4MDAwODIwLFxuXHQgICAgICAgICAgICAweDFjOiAweDgwMjA4MjAsXG5cdCAgICAgICAgICAgIDB4MWQ6IDB4MjA4MDAsXG5cdCAgICAgICAgICAgIDB4MWU6IDB4ODIw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gXTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBERVMgYmxvY2sgY2lwaGVyIGFsZ29yaXRobS5cblx0ICAgICAqL1xuXHQgICAgdmFyIERFUyA9IENfYWxnby5ERVMgPSBCbG9ja0NpcGhlci5leHRlbmQoe1xuXHQgICAgICAgIF9kb1Jlc2V0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIga2V5ID0gdGhpcy5fa2V5O1xuXHQgICAgICAgICAgICB2YXIga2V5V29yZHMgPSBrZXkud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gU2VsZWN0IDU2IGJpdHMgYWNjb3JkaW5nIHRvIFBDMVxuXHQgICAgICAgICAgICB2YXIga2V5Qml0cyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDU2OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciBrZXlCaXRQb3MgPSBQQzFbaV0gLSAxO1xuXHQgICAgICAgICAgICAgICAga2V5Qml0c1tpXSA9IChrZXlXb3Jkc1trZXlCaXRQb3MgPj4+IDVdID4+PiAoMzEgLSBrZXlCaXRQb3MgJSAzMikpICYgMTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIEFzc2VtYmxlIDE2IHN1YmtleXNcblx0ICAgICAgICAgICAgdmFyIHN1YktleXMgPSB0aGlzLl9zdWJLZXlzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIG5TdWJLZXkgPSAwOyBuU3ViS2V5IDwgMTY7IG5TdWJLZXkrKykge1xuXHQgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIHN1YmtleVxuXHQgICAgICAgICAgICAgICAgdmFyIHN1YktleSA9IHN1YktleXNbblN1YktleV0gPSBbXTtcblxuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgICAgIHZhciBiaXRTaGlmdCA9IE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0ICAgICAgICAgICAgLy8gSW5pdGlhbCBwZXJtdXRhdGlvblxuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgNCwgIDB4MGYwZjBmMGYpO1xuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgMTYsIDB4MDAwMGZmZmYpO1xuXHQgICAgICAgICAgICBleGNoYW5nZVJMLmNhbGwodGhpcywgMiwgIDB4MzMzMzMzMzMpO1xuXHQgICAgICAgICAgICBleGNoYW5nZVJMLmNhbGwodGhpcywgOCwgIDB4MDBmZjAwZmYpO1xuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgMSwgIDB4NTU1NTU1NTUpO1xuXG5cdCAgICAgICAgICAgIC8vIFJvdW5kc1xuXHQgICAgICAgICAgICBmb3IgKHZhciByb3VuZCA9IDA7IHJvdW5kIDwgMTY7IHJvdW5kKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIHN1YktleSA9IHN1YktleXNbcm91bmRdO1xuXHQgICAgICAgICAgICAgICAgdmFyIGxCbG9jayA9IHRoaXMuX2xCbG9jaztcblx0ICAgICAgICAgICAgICAgIHZhciByQmxvY2sgPSB0aGlzLl9yQmxvY2s7XG5cblx0ICAgICAgICAgICAgICAgIC8vIEZlaXN0ZWwgZnVuY3Rpb25cblx0ICAgICAgICAgICAgICAgIHZhciBmID0gMDtcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgZiB8PSBTQk9YX1BbaV1bKChyQmxvY2sgXiBzdWJLZXlbaV0pICYgU0JPWF9NQVNLW2ldKSA+Pj4gMF07XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB0aGlzLl9sQmxvY2sgPSByQmxvY2s7XG5cdCAgICAgICAgICAgICAgICB0aGlzLl9yQmxv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ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy54NjQuV29yZEFycmF5LmNyZWF0ZSgpO1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy54NjQuV29yZEFycmF5LmNyZWF0ZShbXG5cdCAgICAgICAgICogICAgICAgICBDcnlwdG9KUy54NjQuV29yZC5jcmVhdGUoMHgwMDAxMDIwMywgMHgwNDA1MDYwNyksXG5cdCAgICAgICAgICogICAgICAgICBDcnlwdG9KUy54NjQuV29yZC5jcmVhdGUoMHgxODE5MWExYiwgMHgxYzFkMWUxZilcblx0ICAgICAgICAgKiAgICAgXSk7XG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLng2NC5Xb3JkQXJyYXkuY3JlYXRlKFtcblx0ICAgICAgICAgKiAgICAgICAgIENyeXB0b0pTLng2NC5Xb3JkLmNyZWF0ZSgweDAwMDEwMjAzLCAweDA0MDUwNjA3KSxcblx0ICAgICAgICAgKiAgICAgICAgIENyeXB0b0pTLng2NC5Xb3JkLmNyZWF0ZSgweDE4MTkxYTFiLCAweDFjMWQxZTFmKVxuXHQgICAgICAgICAqICAgICBdLCAxMCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgaW5pdDogZnVuY3Rpb24gKHdvcmRzLCBzaWdCeXRlcykge1xuXHQgICAgICAgICAgICB3b3JkcyA9IHRoaXMud29yZHMgPSB3b3JkcyB8fCBbXTtcblxuXHQgICAgICAgICAgICBpZiAoc2lnQnl0ZXMgIT0gdW5kZWZpbmVkKSB7XG5cdCAgICAgICAgICAgICAgICB0aGlzLnNpZ0J5dGVzID0gc2lnQnl0ZXM7XG5cdCAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICB0aGlzLnNpZ0J5dGVzID0gd29yZHMubGVuZ3RoICogODtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyB0aGlzIDY0LWJpdCB3b3JkIGFycmF5IHRvIGEgMzItYml0IHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtDcnlwdG9KUy5saWIuV29yZEFycmF5fSBUaGlzIHdvcmQgYXJyYXkncyBkYXRhIGFzIGEgMzItYml0IHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB4MzJXb3JkQXJyYXkgPSB4NjRXb3JkQXJyYXkudG9YMzIoKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICB0b1gzMjogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHg2NFdvcmRzID0gdGhpcy53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHg2NFdvcmRzTGVuZ3RoID0geDY0V29yZHMubGVuZ3RoO1xuXG5cdCAgICAgICAgICAgIC8vIENvbnZlcnRcblx0ICAgICAgICAgICAgdmFyIHgzMldvcmRzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgeDY0V29yZHNMZW5ndGg7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgdmFyIHg2NFdvcmQgPSB4NjRXb3Jkc1tpXTtcblx0ICAgICAgICAgICAgICAgIHgzMldvcmRzLnB1c2goeDY0V29yZC5oaWdoKTtcblx0ICAgICAgICAgICAgICAgIHgzMldvcmRzLnB1c2goeDY0V29yZC5sb3cpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIFgzMldvcmRBcnJheS5jcmVhdGUoeDMyV29yZHMsIHRoaXMuc2lnQnl0ZXMpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDcmVhdGVzIGEgY29weSBvZiB0aGlzIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtYNjRXb3JkQXJyYXl9IFRoZSBjbG9uZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGNsb25lID0geDY0V29yZEFycmF5LmNsb25lKCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIGNsb25lID0gQmFzZS5jbG9uZS5jYWxsKHRoaXMpO1xuXG5cdCAgICAgICAgICAgIC8vIENsb25lIFwid29yZHNcIiBhcnJheVxuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBjbG9uZS53b3JkcyA9IHRoaXMud29yZHMuc2xpY2UoMCk7XG5cblx0ICAgICAgICAgICAgLy8gQ2xvbmUgZWFjaCBYNjRXb3JkIG9iamVjdFxuXHQgICAgICAgICAgICB2YXIgd29yZHNMZW5ndGggPSB3b3Jkcy5sZW5ndGg7XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgd29yZHNMZW5ndGg7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgd29yZHNbaV0gPSB3b3Jkc1tpXS5jbG9uZSgpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGNsb25lO1xuXHQgICAgICAgIH1cblx0ICAgIH0pO1xuXHR9KCkpO1xuXG5cblx0cmV0dXJuIENyeXB0b0pTO1xuXG59KSk7IiwiKGZ1bmN0aW9uIChzZWxmKSB7XG4gICd1c2Ugc3RyaWN0JztcblxuICBmdW5jdGlvbiBmZXRjaFBvbnlmaWxsKG9wdGlvbnMpIHt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ybURhdGEnIGluIHNlbGYsXG4gICAgICAgICAgYXJyYXlCdWZmZXI6ICdBcnJheUJ1ZmZlcicgaW4gc2VsZlxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHN1cHBvcnQuYXJyYXlCdWZmZXIpIHtcbiAgICAgICAgICB2YXIgdmlld0NsYXNzZXMgPSBbXG4gICAgICAgICAgICAnW29iamVjdCBJbnQ4QXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IFVpbnQ4QXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IFVpbnQ4Q2xhbXBlZEFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBJbnQxNkFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBVaW50MTZBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgSW50MzJBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgVWludDMyQXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IEZsb2F0MzJBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgRmxvYXQ2NEFycmF5XSdcbiAgICAgICAgICBdXG5cbiAgICAgICAgICB2YXIgaXNEYXRhVmlldyA9IGZ1bmN0aW9uKG9iaikge1xuICAgICAgICAgICAgcmV0dXJuIG9iaiAmJiBEYXRhVmlldy5wcm90b3R5cGUuaXNQcm90b3R5cGVPZihvYmopXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdmFyIGlzQXJyYXlCdWZmZXJWaWV3ID0gQXJyYXlCdWZmZXIuaXNWaWV3IHx8IGZ1bmN0aW9uKG9iaikge1xuICAgICAgICAgICAgcmV0dXJuIG9iaiAmJiB2aWV3Q2xhc3Nlcy5pbmRleE9mKE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChvYmopKSA+IC0xXG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gbm9ybWFsaXplTmFtZShuYW1lKSB7XG4gICAgICAgICAgaWYgKHR5cGVvZiBuYW1lICE9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgbmFtZSA9IFN0cmluZyhuYW1lKVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoL1teYS16MC05XFwtIyQlJicqKy5cXF5fYHx+XS9pLnRlc3QobmFtZSkpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoJ0ludmFsaWQgY2hhcmFjdGVyIGluIGhlYWRlciBmaWVsZCBuYW1lJylcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIG5hbWUudG9Mb3dlckNhc2UoKVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gbm9ybWFsaXplVmFsdWUodmFsdWUpIHtcbiAgICAgICAgICBpZiAodHlwZW9mIHZhbHVlICE9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgdmFsdWUgPSBTdHJpbmcodmFsdWUpXG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiB2YWx1ZVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gQnVpbGQgYSBkZXN0cnVjdGl2ZSBpdGVyYXRvciBmb3IgdGhlIHZhbHVlIGxpc3RcbiAgICAgICAgZnVuY3Rpb24gaXRlcmF0b3JGb3IoaXRlbXMpIHtcbiAgICAgICAgICB2YXIgaXRlcmF0b3IgPSB7XG4gICAgICAgICAgICBuZXh0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgdmFyIHZhbHVlID0gaXRlbXMuc2hpZnQoKVxuICAgICAgICAgICAgICByZXR1cm4ge2RvbmU6IHZhbHVlID09PSB1bmRlZmluZWQsIHZhbHVlOiB2YWx1ZX1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoc3VwcG9ydC5pdGVyYWJsZSkge1xuICAgICAgICAgICAgaXRlcmF0b3JbU3ltYm9sLml0ZXJhdG9yXSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICByZXR1cm4gaXRlcmF0b3JcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICByZXR1cm4gaXRlcmF0b3JcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIEhlYWRlcnMoaGVhZGVycykge1xuICAgICAgICAgIHRoaXMubWFwID0ge31cblxuICAgICAgICAgIGlmIChoZWFkZXJzIGluc3RhbmNlb2YgSGVhZGVycykge1xuICAgICAgICAgICAgaGVhZGVycy5mb3JFYWNoKGZ1bmN0aW9uKHZhbHVlLCBuYW1lKSB7XG4gICAgICAgICAgICAgIHRoaXMuYXBwZW5kKG5hbWUsIHZhbHVlKVxuICAgICAgICAgICAgfSwgdGhpcylcbiAgICAgICAgICB9IGVsc2UgaWYgKEFycmF5LmlzQXJyYXkoaGVhZGVycykpIHtcbiAgICAgICAgICAgIGhlYWRlcnMuZm9yRWFjaChmdW5jdGlvbihoZWFkZXIpIHtcbiAgICAgICAgICAgICAgdGhpcy5hcHBlbmQoaGVhZGVyWzBdLCBoZWFkZXJbMV0pXG4gICAgICAgICAgICB9LCB0aGlzKVxuICAgICAgICAgIH0gZWxzZSBpZiAoaGVhZGVycykge1xuICAgICAgICAgICAgT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXMoaGVhZGVycykuZm9yRWFjaChmdW5jdGlvbihuYW1lKSB7XG4gICAgICAgICAgICAgIHRoaXMuYXBwZW5kKG5hbWUsIGhlYWRlcnNbbmFtZV0pXG4gICAgICAgICAgICB9LCB0aGlzKVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIEhlYWRlcnMucHJvdG90eXBlLmFwcGVuZCA9IGZ1bmN0aW9uKG5hbWUsIHZhbHVlKSB7XG4gICAgICAgICAgbmFtZSA9IG5vcm1hbGl6ZU5hbWUobmFtZSlcbiAgICAgICAgICB2YWx1ZSA9IG5vcm1hbGl6ZVZhbHVlKHZhbHVlKVxuICAgICAgICAgIHZhciBvbGRWYWx1ZSA9IH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V0dXJuIFByb21pc2UucmVqZWN0KG5ldyBUeXBlRXJyb3IoJ0FscmVhZHkgcmVhZCcpKVxuICAgICAgICAgIH1cbiAgICAgICAgICBib2R5LmJvZHlVc2VkID0gdHJ1ZVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gZmlsZVJlYWRlclJlYWR5KHJlYWRlcikge1xuICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbihyZXNvbHZlLCByZWplY3QpIHtcbiAgICAgICAgICAgIHJlYWRlci5vbmxvYWQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmVzb2x2ZShyZWFkZXIucmVzdWx0KVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVhZGVyLm9uZXJyb3IgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmVqZWN0KHJlYWRlci5lcnJvcilcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gcmVhZEJsb2JBc0FycmF5QnVmZmVyKGJsb2IpIHtcbiAgICAgICAgICB2YXIgcmVhZGVyID0gbmV3IEZpbGVSZWFkZXIoKVxuICAgICAgICAgIHZhciBwcm9taXNlID0gZmlsZVJlYWRlclJlYWR5KHJlYWRlcilcbiAgICAgICAgICByZWFkZXIucmVhZEFzQXJyYXlCdWZmZXIoYmxvYilcbiAgICAgICAgICByZXR1cm4gcHJvbWlzZVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gcmVhZEJsb2JBc1RleHQoYmxvYikge1xuICAgICAgICAgIHZhciByZWFkZXIgPSBuZXcgRmlsZVJlYWRlcigpXG4gICAgICAgICAgdmFyIHByb21pc2UgPSBmaWxlUmVhZGVyUmVhZHkocmVhZGVyKVxuICAgICAgICAgIHJlYWRlci5yZWFkQXNUZXh0KGJsb2IpXG4gICAgICAgICAgcmV0dXJuIHByb21pc2VcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlYWRBcnJheUJ1ZmZlckFzVGV4dChidWYpIHtcbiAgICAgICAgICB2YXIgdmlldyA9IG5ldyBVaW50OEFycmF5KGJ1ZilcbiAgICAgICAgICB2YXIgY2hhcnMgPSBuZXcgQXJyYXkodmlldy5sZW5ndGgpXG5cbiAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHZpZXcubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGNoYXJzW2ldID0gU3RyaW5nLmZyb21DaGFyQ29kZSh2aWV3W2ldKVxuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gY2hhcnMuam9pbignJylcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGJ1ZmZlckNsb25lKGJ1Zikge1xuICAgICAgICAgIGlmIChidWYuc2xpY2UpIHtcbiAgICAgICAgICAgIHJldHVybiBidWYuc2xpY2UoMClcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFyIHZpZXcgPSBuZXcgVWludDhBcnJheShidWYuYnl0ZUxlbmd0aClcbiAgICAgICAgICAgIHZpZXcuc2V0KG5ldyBVaW50OEFycmF5KGJ1ZikpXG4gICAgICAgICAgICByZXR1cm4gdmlldy5idWZmZXJcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBCb2R5KCkge1xuICAgICAgICAgIHRoaXMuYm9keVVzZWQgPSBmYWxzZVxuXG4gICAgICAgICAgdGhpcy5faW5pdEJvZHkgPSBmdW5jdGlvbihib2R5KSB7XG4gICAgICAgICAgICB0aGlzLl9ib2R5SW5pdCA9IGJvZHlcbiAgICAgICAgICAgIGlmICghYm9keSkge1xuICAgICAgICAgICAgICB0aGlzLl9ib2R5VGV4dCA9ICcnXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBib2R5ID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICB0aGlzLl9ib2R5VGV4dCA9IGJv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JvZHkpXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ3Vuc3VwcG9ydGVkIEJvZHlJbml0IHR5cGUnKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoIXRoaXMuaGVhZGVycy5nZXQoJ2NvbnRlbnQtdHlwZScpKSB7XG4gICAgICAgICAgICAgIGlmICh0eXBlb2YgYm9keSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmhlYWRlcnMuc2V0KCdjb250ZW50LXR5cGUnLCAndGV4dC9wbGFpbjtjaGFyc2V0PVVURi04JylcbiAgICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLl9ib2R5QmxvYiAmJiB0aGlzLl9ib2R5QmxvYi50eXBlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5oZWFkZXJzLnNldCgnY29udGVudC10eXBlJywgdGhpcy5fYm9keUJsb2IudHlwZSlcbiAgICAgICAgICAgICAgfSBlbHNlIGlmIChzdXBwb3J0LnNlYXJjaFBhcmFtcyAmJiBVUkxTZWFyY2hQYXJhbXMucHJvdG90eXBlLmlzUHJvdG90eXBlT2YoYm9keSkpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmhlYWRlcnMuc2V0KCdjb250ZW50LXR5cGUnLCAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkO2NoYXJzZXQ9VVRGLTgnKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHN1cHBvcnQuYmxvYikge1xuICAgICAgICAgICAgdGhpcy5ibG9iID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHZhciByZWplY3RlZCA9IGNvbnN1bWVkKHRoaXMpXG4gICAgICAgICAgICAgIGlmIChyZWplY3RlZCkge1xuICAgICAgICAgICAgICAgIHJldHVybiByZWplY3RlZFxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgaWYgKHRoaXMuX2JvZHlCbG9iKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZSh0aGlzLl9ib2R5QmxvYilcbiAgICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKG5ldyBCbG9iKFt0aGlzLl9ib2R5QXJyYXlCdWZmZXJdKSlcbiAgICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLl9ib2R5Rm9ybURhdGEpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ2NvdWxkIG5vdCByZWFkIEZvcm1EYXRhIGJvZHkgYXMgYmxvYicpXG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShuZXcgQmxvYihbdGhpcy5fYm9keVRleHRdKSlcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0aGlzLmFycmF5QnVmZmVyID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIGlmICh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY29uc3VtZWQodGhpcykgfHwgUHJvbWlzZS5yZXNvbHZlKHRoaXMuX2JvZHlBcnJheUJ1ZmZlcilcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5ibG9iKCkudGhlbihyZWFkQmxvYkFzQXJyYXlCdWZmZXIpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICB0aGlzLnRleHQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHZhciByZWplY3RlZCA9IGNvbnN1bWVkKHRoaXMpXG4gICAgICAgICAgICBpZiAocmVqZWN0ZWQpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHJlamVjdGVkXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICh0aGlzLl9ib2R5QmxvYikge1xuICAgICAgICAgICAgICByZXR1cm4gcmVhZEJsb2JBc1RleHQodGhpcy5fYm9keUJsb2IpXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHRoaXMuX2JvZHlBcnJheUJ1ZmZlcikge1xuICAgICAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKHJlYWRBcnJheUJ1ZmZlckFzVGV4dCh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpKVxuICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLl9ib2R5Rm9ybURhdGEpIHtcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdjb3VsZCBub3QgcmVhZCBGb3JtRGF0YSBib2R5IGFzIHRleHQnKVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZSh0aGlzLl9ib2R5VGV4dClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoc3VwcG9ydC5mb3JtRGF0YSkge1xuICAgICAgICAgICAgdGhpcy5mb3JtRGF0YSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICByZXR1cm4gdGhpcy50ZXh0KCkudGhlbihkZWNvZGUpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGhpcy5qc29uID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy50ZXh0KCkudGhlbihKU09OLnBhcnNlKVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiB0aGlzXG4gICAgICAgIH1cblxuICAgICAgICAvLyBIVFRQIG1ldGhvZHMgd2hvc2UgY2FwaXRhbGl6YXRpb24gc2hvdWxkIGJlIG5vcm1hbGl6ZWRcbiAgICAgICAgdmFyIG1ldGhvZHMgPSBbJ0RFTEVURScsICdHRVQnLCAnSEVBRCcsICdPUFRJT05TJywgJ1BPU1QnLCAnUFVUJ11cblxuICAgICAgICBmdW5jdGlvbiBub3JtYWxpemVNZXRob2QobWV0aG9kKSB7XG4gICAgICAgICAgdmFyIHVwY2FzZWQgPSBtZXRob2QudG9VcHBlckNhc2UoKVxuICAgICAgICAgIHJldHVybiAobWV0aG9kcy5pbmRleE9mKHVwY2FzZWQpID4gLTEpID8gdXBjYXNlZCA6IG1ldGhvZFxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gUmVxdWVzdChpbnB1dCwgb3B0aW9ucykge1xuICAgICAgICAgIG9wdGlvbnMgPSBvcHRpb25zIHx8IHt9XG4gICAgICAgICAgdmFyIGJvZHkgPSBvcHRpb25zLmJvZHlcblxuICAgICAgICAgIGlmIChpbnB1dCBpbnN0YW5jZW9mIFJlcXVlc3QpIHtcbiAgICAgICAgICAgIGlmIChpbnB1dC5ib2R5VXNlZCkge1xuICAgICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdBbHJlYWR5IHJlYWQnKVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy51cmwgPSBpbnB1dC51cmxcbiAgICAgICAgICAgIHRoaXMuY3JlZGVudGlhbHMgPSBpbnB1dC5jcmVkZW50aWFsc1xuICAgICAgICAgICAgaWYgKCFvcHRpb25zLmhlYWRlcnMpIHtcbiAgICAgICAgICAgICAgdGhpcy5oZWFkZXJzID0gbmV3IEhlYWRlcnMoaW5wdXQuaGVhZGVycylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMubWV0aG9kID0gaW5wdXQubWV0aG9kXG4gICAgICAgICAgICB0aGlzLm1vZGUgPSBpbnB1dC5tb2RlXG4gICAgICAgICAgICBpZiAoIWJvZHkgJiYgaW5wdXQuX2JvZHlJbml0ICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgYm9keSA9IGlucHV0Ll9ib2R5SW5pdFxuICAgICAgICAgICAgICBpbnB1dC5ib2R5VXNlZCA9IHRydWVcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy51cmwgPSBTdHJpbmcoaW5wdXQpXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGhpcy5jcmVkZW50aWFscyA9IG9wdGlvbnMuY3JlZGVudGlhbHMgfHwgdGhpcy5jcmVkZW50aWFscyB8fCAnb21pdCdcbiAgICAgICAgICBpZiAob3B0aW9ucy5oZWFkZXJzIHx8ICF0aGlzLmhlYWRlcnMpIHtcbiAgICAgICAgICAgIHRoaXMuaGVhZGVycyA9IG5ldyBIZWFkZXJzKG9wdGlvbnMuaGVhZGVycylcbiAgICAgICAgICB9XG4gICAgICAgICAgdGhpcy5tZXRob2QgPSBub3JtYWxpemVNZXRob2Qob3B0aW9ucy5tZXRob2QgfHwgdGhpcy5tZXRob2QgfHwgJ0dFVCcpXG4gICAgICAgICAgdGhpcy5tb2RlID0gb3B0aW9ucy5tb2RlIHx8IHRoaXMubW9kZSB8fCBudWxsXG4gICAgICAgICAgdGhpcy5yZWZlcnJlciA9IG51bGxcblxuICAgICAgICAgIGlmICgodGhpcy5tZXRob2QgPT09ICdHRVQnIHx8IHRoaXMubWV0aG9kID09PSAnSEVBRCcpICYmIGJvZHkpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoJ0JvZHkgbm90IGFsbG93ZWQgZm9yIEdFVCBvciBIRUFEIHJlcXVlc3RzJylcbiAgICAgICAgICB9XG4gICAgICAgICAgdGhpcy5faW5pdEJvZHkoYm9keSlcbiAgICAgICAgfVxuXG4gICAgICAgIFJlcXVlc3QucHJvdG90eXBlLmNsb25lID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgcmV0dXJuIG5ldyBSZXF1ZXN0KHRoaXMsIHsgYm9keTogdGhpcy5fYm9keUluaXQgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGRlY29kZShib2R5KSB7XG4gICAgICAgICAgdmFyIGZvcm0gPSBuZXcgRm9ybURhdGEoKVxuICAgICAgICAgIGJvZHkudHJpbSgpLnNwbGl0KCcmJykuZm9yRWFjaChmdW5jdGlvbihieXRlcykge1xuICAgICAgICAgICAgaWYgKGJ5dGVzKSB7XG4gICAgICAgICAgICAgIHZhciBzcGxpdCA9IGJ5dGVzLnNwbGl0KCc9JylcbiAgICAgICAgICAgICAgdmFyIG5hbWUgPSBzcGxpdC5zaGlmdCgpLnJlcGxhY2UoL1xcKy9nLCAnICcpXG4gICAgICAgICAgICAgIHZhciB2YWx1ZSA9IHNwbGl0LmpvaW4oJz0nKS5yZXBsYWNlKC9cXCsvZywgJyAnKVxuICAgICAgICAgICAgICBmb3JtLmFwcGVuZChkZWNvZGVVUklDb21wb25lbnQobmFtZSksIGRlY29kZVVSSUNvbXBvbmVudCh2YWx1ZSkpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSlcbiAgICAgICAgICByZXR1cm4gZm9ybVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gcGFyc2VIZWFkZXJzKHJhd0hlYWRlcnMpIHtcbiAgICAgICAgICB2YXIgaGVhZGVycyA9IG5ldyBIZWFkZXJzKClcbiAgICAgICAgICByYXdIZWFkZXJzLnNwbGl0KC9cXHI/XFxuLykuZm9yRWFjaChmdW5jdGlvbihsaW5lKSB7XG4gICAgICAgICAgICB2YXIgcGFydHMgPSBsaW5lLnNwbGl0KCc6JylcbiAgICAgICAgICAgIHZhciBrZXkgPSBwYXJ0cy5zaGlmdCgpLnRyaW0oKVxuICAgICAgICAgICAgaWYgKGtleSkge1xuICAgICAgICAgICAgICB2YXIgdmFsdWUgPSBwYXJ0cy5qb2luKCc6JykudHJpbSgpXG4gICAgICAgICAgICAgIGhlYWRlcnMuYXBwZW5kKGtleSwgdmFsdWU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bmV3IFJlcXVlc3QoaW5wdXQsIGluaXQpXG4gICAgICAgICAgICB2YXIgeGhyID0gbmV3IFhNTEh0dHBSZXF1ZXN0KClcblxuICAgICAgICAgICAgeGhyLm9ubG9hZCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICB2YXIgb3B0aW9ucyA9IHtcbiAgICAgICAgICAgICAgICBzdGF0dXM6IHhoci5zdGF0dXMsXG4gICAgICAgICAgICAgICAgc3RhdHVzVGV4dDogeGhyLnN0YXR1c1RleHQsXG4gICAgICAgICAgICAgICAgaGVhZGVyczogcGFyc2VIZWFkZXJzKHhoci5nZXRBbGxSZXNwb25zZUhlYWRlcnMoKSB8fCAnJylcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBvcHRpb25zLnVybCA9ICdyZXNwb25zZVVSTCcgaW4geGhyID8geGhyLnJlc3BvbnNlVVJMIDogb3B0aW9ucy5oZWFkZXJzLmdldCgnWC1SZXF1ZXN0LVVSTCcpXG4gICAgICAgICAgICAgIHZhciBib2R5ID0gJ3Jlc3BvbnNlJyBpbiB4aHIgPyB4aHIucmVzcG9uc2UgOiB4aHIucmVzcG9uc2VUZXh0XG4gICAgICAgICAgICAgIHJlc29sdmUobmV3IFJlc3BvbnNlKGJvZHksIG9wdGlvbnMpKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB4aHIub25lcnJvciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICByZWplY3QobmV3IFR5cGVFcnJvcignTmV0d29yayByZXF1ZXN0IGZhaWxlZCcpKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB4aHIub250aW1lb3V0ID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJlamVjdChuZXcgVHlwZUVycm9yKCdOZXR3b3JrIHJlcXVlc3QgZmFpbGVkJykpXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHhoci5vcGVuKHJlcXVlc3QubWV0aG9kLCByZXF1ZXN0LnV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ICAgIGlmIChwb3MgPT09IC0xKSB7XG4gICAgICAgICAgICBrZXkgPSBvcHRpb25zLmRlY29kZXIocGFydCwgZGVmYXVsdHMuZGVjb2Rlcik7XG4gICAgICAgICAgICB2YWwgPSBvcHRpb25zLnN0cmljdE51bGxIYW5kbGluZyA/IG51bGwgOiAnJztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGtleSA9IG9wdGlvbnMuZGVjb2RlcihwYXJ0LnNsaWNlKDAsIHBvcyksIGRlZmF1bHRzLmRlY29kZXIpO1xuICAgICAgICAgICAgdmFsID0gb3B0aW9ucy5kZWNvZGVyKHBhcnQuc2xpY2UocG9zICsgMSksIGRlZmF1bHRzLmRlY29kZXIpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChoYXMuY2FsbChvYmosIGtleSkpIHtcbiAgICAgICAgICAgIG9ialtrZXldID0gW10uY29uY2F0KG9ialtrZXldKS5jb25jYXQodmFsKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9ialtrZXldID0gdmFsO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIG9iajtcbn07XG5cbnZhciBwYXJzZU9iamVjdCA9IGZ1bmN0aW9uIChjaGFpbiwgdmFsLCBvcHRpb25zKSB7XG4gICAgdmFyIGxlYWYgPSB2YWw7XG5cbiAgICBmb3IgKHZhciBpID0gY2hhaW4ubGVuZ3RoIC0gMTsgaSA+PSAwOyAtLWkpIHtcbiAgICAgICAgdmFyIG9iajtcbiAgICAgICAgdmFyIHJvb3QgPSBjaGFpbltpXTtcblxuICAgICAgICBpZiAocm9vdCA9PT0gJ1tdJykge1xuICAgICAgICAgICAgb2JqID0gW107XG4gICAgICAgICAgICBvYmogPSBvYmouY29uY2F0KGxlYWYpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb2JqID0gb3B0aW9ucy5wbGFpbk9iamVjdHMgPyBPYmplY3QuY3JlYXRlKG51bGwpIDoge307XG4gICAgICAgICAgICB2YXIgY2xlYW5Sb290ID0gcm9vdC5jaGFyQXQoMCkgPT09ICdbJyAmJiByb290LmNoYXJBdChyb290Lmxlbmd0aCAtIDEpID09PSAnXScgPyByb290LnNsaWNlKDEsIC0xKSA6IHJvb3Q7XG4gICAgICAgICAgICB2YXIgaW5kZXggPSBwYXJzZUludChjbGVhblJvb3QsIDEwKTtcbiAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAhaXNOYU4oaW5kZXgpXG4gICAgICAgICAgICAgICAgJiYgcm9vdCAhPT0gY2xlYW5Sb290XG4gICAgICAgICAgICAgICAgJiYgU3RyaW5nKGluZGV4KSA9PT0gY2xlYW5Sb290XG4gICAgICAgICAgICAgICAgJiYgaW5kZXggPj0gMFxuICAgICAgICAgICAgICAgICYmIChvcHRpb25zLnBhcnNlQXJyYXlzICYmIGluZGV4IDw9IG9wdGlvbnMuYXJyYXlMaW1pdClcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIG9iaiA9IFtdO1xuICAgICAgICAgICAgICAgIG9ialtpbmRleF0gPSBsZWFmO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBvYmpbY2xlYW5Sb290XSA9IGxlYWY7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBsZWFmID0gb2JqO1xuICAgIH1cblxuICAgIHJldHVybiBsZWFmO1xufTtcblxudmFyIHBhcnNlS2V5cyA9IGZ1bmN0aW9uIHBhcnNlUXVlcnlTdHJpbmdLZXlzKGdpdmVuS2V5LCB2YWwsIG9wdGlvbnMpIHtcbiAgICBpZiAoIWdpdmVuS2V5KSB7XG4gICAgICAgIHJldHVybjtcbiAgICB9XG5cbiAgICAvLyBUcmFuc2Zvcm0gZG90IG5vdGF0aW9uIHRvIGJyYWNrZXQgbm90YXRpb25cbiAgICB2YXIga2V5ID0gb3B0aW9ucy5hbGxvd0RvdHMgPyBnaXZlbktleS5yZXBsYWNlKC9cXC4oW14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KEFycmF5LmlzQXJyYXkob2JqKSkge1xuICAgICAgICAgICAgdmFsdWVzID0gdmFsdWVzLmNvbmNhdChzdHJpbmdpZnkoXG4gICAgICAgICAgICAgICAgb2JqW2tleV0sXG4gICAgICAgICAgICAgICAgZ2VuZXJhdGVBcnJheVByZWZpeChwcmVmaXgsIGtleSksXG4gICAgICAgICAgICAgICAgZ2VuZXJhdGVBcnJheVByZWZpeCxcbiAgICAgICAgICAgICAgICBzdHJpY3ROdWxsSGFuZGxpbmcsXG4gICAgICAgICAgICAgICAgc2tpcE51bGxzLFxuICAgICAgICAgICAgICAgIGVuY29kZXIsXG4gICAgICAgICAgICAgICAgZmlsdGVyLFxuICAgICAgICAgICAgICAgIHNvcnQsXG4gICAgICAgICAgICAgICAgYWxsb3dEb3RzLFxuICAgICAgICAgICAgICAgIHNlcmlhbGl6ZURhdGUsXG4gICAgICAgICAgICAgICAgZm9ybWF0dGVyLFxuICAgICAgICAgICAgICAgIGVuY29kZVZhbHVlc09ubHlcbiAgICAgICAgICAgICkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFsdWVzID0gdmFsdWVzLmNvbmNhdChzdHJpbmdpZnkoXG4gICAgICAgICAgICAgICAgb2JqW2tleV0sXG4gICAgICAgICAgICAgICAgcHJlZml4ICsgKGFsbG93RG90cyA/ICcuJyArIGtleSA6ICdbJyArIGtleSArICddJyksXG4gICAgICAgICAgICAgICAgZ2VuZXJhdGVBcnJheVByZWZpeCxcbiAgICAgICAgICAgICAgICBzdHJpY3ROdWxsSGFuZGxpbmcsXG4gICAgICAgICAgICAgICAgc2tpcE51bGxzLFxuICAgICAgICAgICAgICAgIGVuY29kZXIsXG4gICAgICAgICAgICAgICAgZmlsdGVyLFxuICAgICAgICAgICAgICAgIHNvcnQsXG4gICAgICAgICAgICAgICAgYWxsb3dEb3RzLFxuICAgICAgICAgICAgICAgIHNlcmlhbGl6ZURhdGUsXG4gICAgICAgICAgICAgICAgZm9ybWF0dGVyLF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biAgICBpZiAoc29ydCkge1xuICAgICAgICBvYmpLZXlzLnNvcnQoc29ydCk7XG4gICAgfVxuXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBvYmpLZXlzLmxlbmd0aDsgKytpKSB7XG4gICAgICAgIHZhciBrZXkgPSBvYmpLZXlzW2ldO1xuXG4gICAgICAgIGlmIChza2lwTnVsbHMgJiYgb2JqW2tleV0gPT09IG51bGwpIHtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAga2V5cyA9IGtleXMuY29uY2F0KHN0cmluZ2lmeShcbiAgICAgICAgICAgIG9ialtrZXldLFxuICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgZ2VuZXJhdGVBcnJheVByZWZpeCxcbiAgICAgICAgICAgIHN0cmljdE51bGxIYW5kbGluZyxcbiAgICAgICAgICAgIHNraXBOdWxscyxcbiAgICAgICAgICAgIGVuY29kZSA/IGVuY29kZXIgOiBudWxsLFxuICAgICAgICAgICAgZmlsdGVyLFxuICAgICAgICAgICAgc29ydCxcbiAgICAgICAgICAgIGFsbG93RG90cyxcbiAgICAgICAgICAgIHNlcmlhbGl6ZURhdGUsXG4gICAgICAgICAgICBmb3JtYXR0ZXIsXG4gICAgICAgICAgICBlbmNvZGVWYWx1ZXNPbmx5XG4gICAgICAgICkpO1xuICAgIH1cblxuICAgIHZhciBqb2luZWQgPSBrZXlzLmpvaW4oZGVsaW1pdGVyKTtcbiAgICB2YXIgcHJlZml4ID0gb3B0aW9ucy5hZGRRdWVyeVByZWZpeCA9PT0gdHJ1ZSA/ICc/JyA6ICcnO1xuXG4gICAgcmV0dXJuIGpvaW5lZC5sZW5ndGggPiAwID8gcHJlZml4ICsgam9pbmVkIDogJyc7XG59O1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG52YXIgaGFzID0gT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eTtcblxudmFyIGhleFRhYmxlID0gKGZ1bmN0aW9uICgpIHtcbiAgICB2YXIgYXJyYXkgPSBbXTtcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI1NjsgKytpKSB7XG4gICAgICAgIGFycmF5LnB1c2goJyUnICsgKChpIDwgMTYgPyAnMCcgOiAnJykgKyBpLnRvU3RyaW5nKDE2KSkudG9VcHBlckNhc2UoKSk7XG4gICAgfVxuXG4gICAgcmV0dXJuIGFycmF5O1xufSgpKTtcblxudmFyIGNvbXBhY3RRdWV1ZSA9IGZ1bmN0aW9uIGNvbXBhY3RRdWV1ZShxdWV1ZSkge1xuICAgIHZhciBvYmo7XG5cbiAgICB3aGlsZSAocXVldWUubGVuZ3RoKSB7XG4gICAgICAgIHZhciBpdGVtID0gcXVldWUucG9wKCk7XG4gICAgICAgIG9iaiA9IGl0ZW0ub2JqW2l0ZW0ucHJvcF07XG5cbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkob2JqKSkge1xuICAgICAgICAgICAgdmFyIGNvbXBhY3RlZCA9IFtdO1xuXG4gICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IG9iai5sZW5ndGg7ICsraikge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb2JqW2pdICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICBjb21wYWN0ZWQucHVzaChvYmpbal0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaXRlbS5vYmpbaXRlbS5wcm9wXSA9IGNvbXBhY3RlZDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBvYmo7XG59O1xuXG5leHBvcnRzLmFycmF5VG9PYmplY3QgPSBmdW5jdGlvbiBhcnJheVRvT2JqZWN0KHNvdXJjZSwgb3B0aW9ucykge1xuICAgIHZhciBvYmogPSBvcHRpb25zICYmIG9wdGlvbnMucGxhaW5PYmplY3RzID8gT2JqZWN0LmNyZWF0ZShudWxsKSA6IHt9O1xuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc291cmNlLmxlbmd0aDsgKytpKSB7XG4gICAgICAgIGlmICh0eXBlb2Ygc291cmNlW2ldICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgb2JqW2ldID0gc291cmNlW2ldO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIG9iajtcbn07XG5cbmV4cG9ydHMubWVyZ2UgPSBmdW5jdGlvbiBtZXJnZSh0YXJnZXQsIHNvdXJjZSwgb3B0aW9ucykge1xuICAgIGlmICghc291cmNlKSB7XG4gICAgICAgIHJldHVybiB0YXJnZXQ7XG4gICAgfVxuXG4gICAgaWYgKHR5cGVvZiBzb3VyY2UgIT09ICdvYmplY3QnKSB7XG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KHRhcmdldCkpIHtcbiAgICAgICAgICAgIHRhcmdldC5wdXNoKHNvdXJjZSk7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIHRhcmdldCA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgIGlmIChvcHRpb25zLnBsYWluT2JqZWN0cyB8fCBvcHRpb25zLmFsbG93UHJvdG90eXBlcyB8fCAhaGFzLmNhbGwoT2JqZWN0LnByb3RvdHlwZSwgc291cmNlKSkge1xuICAgICAgICAgICAgICAgIHRhcmdldFtzb3VyY2VdID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBbdGFyZ2V0LCBzb3VyY2VdO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRhcmdldDtcbiAgICB9XG5cbiAgICBpZiAodHlwZW9mIHRhcmdldCAhPT0gJ29iamVjdCcpIHtcbiAgICAgICAgcmV0dXJuIFt0YXJnZXRdLmNvbmNhdChzb3VyY2UpO1xuICAgIH1cblxuICAgIHZhciBtZXJnZVRhcmdldCA9IHRhcmdldDtcbiAgICBpZiAoQXJyYXkuaXNBcnJheSh0YXJnZXQpICYmICFBcnJheS5pc0FycmF5KHNvdXJjZSkpIHtcbiAgICAgICAgbWVyZ2VUYXJnZXQgPSBleHBvcnRzLmFycmF5VG9PYmplY3QodGFyZ2V0LCBvcHRpb25zKTtcbiAgICB9XG5cbiAgICBpZiAoQXJyYXkuaXNBcnJheSh0YXJnZXQpICYmIEFycmF5LmlzQXJyYXkoc291cmNlKSkge1xuICAgICAgICBzb3VyY2UuZm9yRWFjaChmdW5jdGlvbiAoaXRlbSwgaSkge1xuICAgICAgICAgICAgaWYgKGhhcy5jYWxsKHRhcmdldCwgaSkpIHtcbiAgICAgICAgICAgICAgICBpZiAodGFyZ2V0W2ldICYmIHR5cGVvZiB0YXJnZXRbaV0gPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAgICAgICAgIHRhcmdldFtpXSA9IGV4cG9ydHMubWVyZ2UodGFyZ2V0W2ldLCBpdGVtLCBvcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0YXJnZXQucHVzaChpdGVtKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRhcmdldFtpXSA9IGl0ZW07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gdGFyZ2V0O1xuICAgIH1cblxuICAgIHJldHVybiBPYmplY3Qua2V5cyhzb3VyY2UpLnJlZHVjZShmdW5jdGlvbiAoYWNjLCBrZXkpIHtcbiAgICAgICAgdmFyIHZhbHVlID0gc291cmNlW2tleV07XG5cbiAgICAgICAgaWYgKGhhcy5jYWxsKGFjYywga2V5KSkge1xuICAgICAgICAgICAgYWNjW2tleV0gPSBleHBvcnRzLm1lcmdlKGFjY1trZXldLCB2YWx1ZSwgb3B0aW9ucyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBhY2Nba2V5XSA9IHZhbHVlO1xuICAgICAgICB9XG4gICAgICAgI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BjID0gc3RyaW5nLmNoYXJDb2RlQXQoaSk7XG5cbiAgICAgICAgaWYgKFxuICAgICAgICAgICAgYyA9PT0gMHgyRCAvLyAtXG4gICAgICAgICAgICB8fCBjID09PSAweDJFIC8vIC5cbiAgICAgICAgICAgIHx8IGMgPT09IDB4NUYgLy8gX1xuICAgICAgICAgICAgfHwgYyA9PT0gMHg3RSAvLyB+XG4gICAgICAgICAgICB8fCAoYyA+PSAweDMwICYmIGMgPD0gMHgzOSkgLy8gMC05XG4gICAgICAgICAgICB8fCAoYyA+PSAweDQxICYmIGMgPD0gMHg1QSkgLy8gYS16XG4gICAgICAgICAgICB8fCAoYyA+PSAweDYxICYmIGMgPD0gMHg3QSkgLy8gQS1aXG4gICAgICAgICkge1xuICAgICAgICAgICAgb3V0ICs9IHN0cmluZy5jaGFyQXQoaSk7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjIDwgMHg4MCkge1xuICAgICAgICAgICAgb3V0ID0gb3V0ICsgaGV4VGFibGVbY107XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjIDwgMHg4MDApIHtcbiAgICAgICAgICAgIG91dCA9IG91dCArIChoZXhUYWJsZVsweEMwIHwgKGMgPj4gNildICsgaGV4VGFibGVbMHg4MCB8IChjICYgMHgzRildKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGMgPCAweEQ4MDAgfHwgYyA+PSAweEUwMDApIHtcbiAgICAgICAgICAgIG91dCA9IG91dCArIChoZXhUYWJsZVsweEUwIHwgKGMgPj4gMTIpXSArIGhleFRhYmxlWzB4ODAgfCAoKGMgPj4gNikgJiAweDNGKV0gKyBoZXhUYWJsZVsweDgwIHwgKGMgJiAweDNGKV0pO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpICs9IDE7XG4gICAgICAgIGMgPSAweDEwMDAwICsgKCgoYyAmIDB4M0ZGKSA8PCAxMCkgfCAoc3RyaW5nLmNoYXJDb2RlQXQoaSkgJiAweDNGRikpO1xuICAgICAgICBvdXQgKz0gaGV4VGFibGVbMHhGMCB8IChjID4+IDE4KV1cbiAgICAgICAgICAgICsgaGV4VGFibGVbMHg4MCB8ICgoYyA+PiAxMikgJiAweDNGKV1cbiAgICAgICAgICAgICsgaGV4VGFibGVbMHg4MCB8ICgoYyA+PiA2KSAmIDB4M0YpXVxuICAgICAgICAgICAgKyBoZXhUYWJsZVsweDgwIHwgKGMgJiAweDNGKV07XG4gICAgfVxuXG4gICAgcmV0dXJuIG91dDtcbn07XG5cbmV4cG9ydHMuY29tcGFjdCA9IGZ1bmN0aW9uIGNvbXBhY3QodmFsdWUpIHtcbiAgICB2YXIgcXVldWUgPSBbeyBvYmo6IHsgbzogdmFsdWUgfSwgcHJvcDogJ28nIH1dO1xuICAgIHZhciByZWZzID0gW107XG5cbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IHF1ZXVlLmxlbmd0aDsgKytpKSB7XG4gICAgICAgIHZhciBpdGVtID0gcXVldWVbaV07XG4gICAgICAgIHZhciBvYmogPSBpdGVtLm9ialtpdGVtLnByb3BdO1xuXG4gICAgICAgIHZhciBrZXlzID0gT2JqZWN0LmtleXMob2JqKTtcbiAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBrZXlzLmxlbmd0aDsgKytqKSB7XG4gICAgICAgICAgICB2YXIga2V5ID0ga2V5c1tqXTtcbiAgICAgICAgICAgIHZhciB2YWwgPSBvYmpba2V5XTtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgdmFsID09PSAnb2JqZWN0JyAmJiB2YWwgIT09IG51bGwgJiYgcmVmcy5pbmRleE9mKHZhbCkgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgcXVldWUucHVzaCh7IG9iajogb2JqLCBwcm9wOiBrZXkgfSk7XG4gICAgICAgICAgICAgICAgcmVmcy5wdXNoKHZhbCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gY29tcGFjdFF1ZXVlKHF1ZXVlKTtcbn07XG5cbmV4cG9ydHMuaXNSZWdFeHAgPSBmdW5jdGlvbiBpc1JlZ0V4cChvYmopIHtcbiAgICByZXR1cm4gT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZy5jYWxsKG9iaikgPT09ICdbb2JqZWN0IFJlZ0V4cF0nO1xufTtcblxuZXhwb3J0cy5pc0J1ZmZlciA9IGZ1bmN0aW9uIGlzQnVmZmVyKG9iaikge1xuICAgIGlmIChvYmogPT09IG51bGwgfHwgdHlwZW9mIG9iaiA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIHJldHVybiAhIShvYmouY29uc3RydWN0b3IgJiYgb2JqLmNvbnN0cnVjdG9yLmlzQnVmZmVyICYmIG9iai5jb25zdHJ1Y3Rvci5pc0J1ZmZlcihvYmopKTtcbn07XG4iXX0= diff --git a/ccxt.js b/ccxt.js index 08cdcce1018a..effa8cca8171 100644 --- a/ccxt.js +++ b/ccxt.js @@ -37,7 +37,7 @@ const errors = require ('./js/base/errors') //----------------------------------------------------------------------------- // this is updated by vss.js when building -const version = '1.10.680' +const version = '1.10.681' Exchange.ccxtVersion = version diff --git a/package.json b/package.json index 86afa239371c..74de8795b743 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ccxt", - "version": "1.10.680", + "version": "1.10.681", "description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 90+ exchanges", "main": "./ccxt.js", "unpkg": "build/ccxt.browser.js", diff --git a/php/Exchange.php b/php/Exchange.php index 8c16c9f59af8..b36dd1734550 100644 --- a/php/Exchange.php +++ b/php/Exchange.php @@ -30,7 +30,7 @@ namespace ccxt; -$version = '1.10.680'; +$version = '1.10.681'; abstract class Exchange { diff --git a/php/okcoinusd.php b/php/okcoinusd.php index 75a17da80426..0165735057cd 100644 --- a/php/okcoinusd.php +++ b/php/okcoinusd.php @@ -15,7 +15,7 @@ public function describe () { // obsolete metainfo interface 'hasFetchOHLCV' => true, 'hasFetchOrder' => true, - 'hasFetchOrders' => true, + 'hasFetchOrders' => false, 'hasFetchOpenOrders' => true, 'hasFetchClosedOrders' => true, 'hasWithdraw' => true, @@ -23,7 +23,7 @@ public function describe () { 'has' => array ( 'fetchOHLCV' => true, 'fetchOrder' => true, - 'fetchOrders' => true, + 'fetchOrders' => false, 'fetchOpenOrders' => true, 'fetchClosedOrders' => true, 'withdraw' => true, diff --git a/python/ccxt/__init__.py b/python/ccxt/__init__.py index 9a3802fbed11..da39461bb4a9 100644 --- a/python/ccxt/__init__.py +++ b/python/ccxt/__init__.py @@ -28,7 +28,7 @@ # ---------------------------------------------------------------------------- -__version__ = '1.10.680' +__version__ = '1.10.681' # ---------------------------------------------------------------------------- diff --git a/python/ccxt/async/__init__.py b/python/ccxt/async/__init__.py index cf5cde49bee5..e91eebe77d06 100644 --- a/python/ccxt/async/__init__.py +++ b/python/ccxt/async/__init__.py @@ -4,7 +4,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.10.680' +__version__ = '1.10.681' # ----------------------------------------------------------------------------- diff --git a/python/ccxt/async/base/exchange.py b/python/ccxt/async/base/exchange.py index 055c1510ea51..6738c69b2d1c 100644 --- a/python/ccxt/async/base/exchange.py +++ b/python/ccxt/async/base/exchange.py @@ -2,7 +2,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.10.680' +__version__ = '1.10.681' # ----------------------------------------------------------------------------- diff --git a/python/ccxt/async/okcoinusd.py b/python/ccxt/async/okcoinusd.py index 42f8a5508270..1a5adb1c4b72 100644 --- a/python/ccxt/async/okcoinusd.py +++ b/python/ccxt/async/okcoinusd.py @@ -20,7 +20,7 @@ def describe(self): # obsolete metainfo interface 'hasFetchOHLCV': True, 'hasFetchOrder': True, - 'hasFetchOrders': True, + 'hasFetchOrders': False, 'hasFetchOpenOrders': True, 'hasFetchClosedOrders': True, 'hasWithdraw': True, @@ -28,7 +28,7 @@ def describe(self): 'has': { 'fetchOHLCV': True, 'fetchOrder': True, - 'fetchOrders': True, + 'fetchOrders': False, 'fetchOpenOrders': True, 'fetchClosedOrders': True, 'withdraw': True, diff --git a/python/ccxt/base/exchange.py b/python/ccxt/base/exchange.py index 59ea911a8b48..957e2d2bc3cc 100644 --- a/python/ccxt/base/exchange.py +++ b/python/ccxt/base/exchange.py @@ -4,7 +4,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.10.680' +__version__ = '1.10.681' # ----------------------------------------------------------------------------- diff --git a/python/ccxt/okcoinusd.py b/python/ccxt/okcoinusd.py index 0c3a93121856..556b1f840374 100644 --- a/python/ccxt/okcoinusd.py +++ b/python/ccxt/okcoinusd.py @@ -20,7 +20,7 @@ def describe(self): # obsolete metainfo interface 'hasFetchOHLCV': True, 'hasFetchOrder': True, - 'hasFetchOrders': True, + 'hasFetchOrders': False, 'hasFetchOpenOrders': True, 'hasFetchClosedOrders': True, 'hasWithdraw': True, @@ -28,7 +28,7 @@ def describe(self): 'has': { 'fetchOHLCV': True, 'fetchOrder': True, - 'fetchOrders': True, + 'fetchOrders': False, 'fetchOpenOrders': True, 'fetchClosedOrders': True, 'withdraw': True,