diff --git a/build/ccxt.browser.js b/build/ccxt.browser.js index a22ab77b291b..8c551a8b868d 100644 --- a/build/ccxt.browser.js +++ b/build/ccxt.browser.js @@ -45,7 +45,7 @@ const Exchange = require ('./js/base/Exchange') //----------------------------------------------------------------------------- // this is updated by vss.js when building -const version = '1.13.143' +const version = '1.13.144' Exchange.ccxtVersion = version @@ -51621,4 +51621,4 @@ exports.isBuffer = function isBuffer(obj) { }; },{}]},{},[1]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJjY3h0LmJyb3dzZXIuanMiLCJjY3h0LmpzIiwianMvXzFicm9rZXIuanMiLCJqcy9fMWJ0Y3hlLmpzIiwianMvYWN4LmpzIiwianMvYWxsY29pbi5qcyIsImpzL2FueHByby5qcyIsImpzL2Jhc2UvRXhjaGFuZ2UuanMiLCJqcy9iYXNlL01hcmtldC5qcyIsImpzL2Jhc2UvZXJyb3JzLmpzIiwianMvYmFzZS9mdW5jdGlvbnMuanMiLCJqcy9iYXNlL2Z1bmN0aW9ucy9jcnlwdG8uanMiLCJqcy9iYXNlL2Z1bmN0aW9ucy9lbmNvZGUuanMiLCJqcy9iYXNlL2Z1bmN0aW9ucy9nZW5lcmljLmpzIiwianMvYmFzZS9mdW5jdGlvbnMvbWlzYy5qcyIsImpzL2Jhc2UvZnVuY3Rpb25zL251bWJlci5qcyIsImpzL2Jhc2UvZnVuY3Rpb25zL3BsYXRmb3JtLmpzIiwianMvYmFzZS9mdW5jdGlvbnMvc3RyaW5nLmpzIiwianMvYmFzZS9mdW5jdGlvbnMvdGhyb3R0bGUuanMiLCJqcy9iYXNlL2Z1bmN0aW9ucy90aW1lLmpzIiwianMvYmFzZS9mdW5jdGlvbnMvdHlwZS5qcyIsImpzL2JpYm94LmpzIiwianMvYmluYW5jZS5qcyIsImpzL2JpdDJjLmpzIiwianMvYml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ICAgcmVxdWlyZSAoJy4vanMvXzFicm9rZXIuanMnKSxcbiAgICAnXzFidGN4ZSc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9fMWJ0Y3hlLmpzJyksXG4gICAgJ2FjeCc6ICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYWN4LmpzJyksXG4gICAgJ2FsbGNvaW4nOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYWxsY29pbi5qcycpLFxuICAgICdhbnhwcm8nOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2FueHByby5qcycpLFxuICAgICdiaWJveCc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpYm94LmpzJyksXG4gICAgJ2JpbmFuY2UnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYmluYW5jZS5qcycpLFxuICAgICdiaXQyYyc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdDJjLmpzJyksXG4gICAgJ2JpdGJhbmsnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0YmFuay5qcycpLFxuICAgICdiaXRiYXknOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGJheS5qcycpLFxuICAgICdiaXRmaW5leCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGZpbmV4LmpzJyksXG4gICAgJ2JpdGZpbmV4Mic6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0ZmluZXgyLmpzJyksXG4gICAgJ2JpdGZseWVyJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0Zmx5ZXIuanMnKSxcbiAgICAnYml0aHVtYic6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRodW1iLmpzJyksXG4gICAgJ2JpdGtrJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0a2suanMnKSxcbiAgICAnYml0bGlzaCc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRsaXNoLmpzJyksXG4gICAgJ2JpdG1hcmtldCc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0bWFya2V0LmpzJyksXG4gICAgJ2JpdG1leCc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0bWV4LmpzJyksXG4gICAgJ2JpdHNvJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0c28uanMnKSxcbiAgICAnYml0c3RhbXAnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRzdGFtcC5qcycpLFxuICAgICdiaXRzdGFtcDEnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdHN0YW1wMS5qcycpLFxuICAgICdiaXR0cmV4JzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdHRyZXguanMnKSxcbiAgICAnYml0eic6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXR6LmpzJyksXG4gICAgJ2JsM3AnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYmwzcC5qcycpLFxuICAgICdibGV1dHJhZGUnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JsZXV0cmFkZS5qcycpLFxuICAgICdicmF6aWxpZXgnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JyYXppbGlleC5qcycpLFxuICAgICdidGNib3gnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y2JveC5qcycpLFxuICAgICdidGNjaGluYSc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y2NoaW5hLmpzJyksXG4gICAgJ2J0Y2V4Y2hhbmdlJzogICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjZXhjaGFuZ2UuanMnKSxcbiAgICAnYnRjbWFya2V0cyc6ICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGNtYXJrZXRzLmpzJyksXG4gICAgJ2J0Y3RyYWRlaW0nOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjdHJhZGVpbS5qcycpLFxuICAgICdidGN0cmFkZXVhJzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y3RyYWRldWEuanMnKSxcbiAgICAnYnRjdHVyayc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGN0dXJrLmpzJyksXG4gICAgJ2J0Y3gnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjeC5qcycpLFxuICAgICdieGludGgnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J4aW50aC5qcycpLFxuICAgICdjY2V4JzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NjZXguanMnKSxcbiAgICAnY2V4JzogICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jZXguanMnKSxcbiAgICAnY2hidGMnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jaGJ0Yy5qcycpLFxuICAgICdjaGlsZWJpdCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NoaWxlYml0LmpzJyksXG4gICAgJ2NvYmluaG9vZCc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29iaW5ob29kLmpzJyksXG4gICAgJ2NvaW5jaGVjayc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbmNoZWNrLmpzJyksXG4gICAgJ2NvaW5lZ2cnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbmVnZy5qcycpLFxuICAgICdjb2luZXgnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5leC5qcycpLFxuICAgICdjb2luZXhjaGFuZ2UnOiAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5leGNoYW5nZS5qcycpLFxuICAgICdjb2luZmxvb3InOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5mbG9vci5qcycpLFxuICAgICdjb2luZ2knOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5naS5qcycpLFxuICAgICdjb2lubWFya2V0Y2FwJzogICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5tYXJrZXRjYXAuanMnKSxcbiAgICAnY29pbm1hdGUnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jb2lubWF0ZS5qcycpLFxuICAgICdjb2lubmVzdCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5uZXN0LmpzJyksXG4gICAgJ2NvaW5vbmUnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbm9uZS5qcycpLFxuICAgICdjb2luc2VjdXJlJzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5zZWN1cmUuanMnKSxcbiAgICAnY29pbnNwb3QnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jb2luc3BvdC5qcycpLFxuICAgICdjb2ludGlnZXInOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW50aWdlci5qcycpLFxuICAgICdjb29sY29pbic6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2Nvb2xjb2luLmpzJyksXG4gICAgJ2NyeXB0b3BpYSc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY3J5cHRvcGlhLmpzJyksXG4gICAgJ2RzeCc6ICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZHN4LmpzJyksXG4gICAgJ2V0aGZpbmV4JzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZXRoZmluZXguanMnKSxcbiAgICAnZXhtbyc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9leG1vLmpzJyksXG4gICAgJ2V4eCc6ICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZXh4LmpzJyksXG4gICAgJ2Zsb3didGMnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZmxvd2J0Yy5qcycpLFxuICAgICdmb3hiaXQnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2ZveGJpdC5qcycpLFxuICAgICdmeWJzZSc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2Z5YnNlLmpzJyksXG4gICAgJ2Z5YnNnJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZnlic2cuanMnKSxcbiAgICAnZ2F0ZWNvaW4nOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9nYXRlY29pbi5qcycpLFxuICAgICdnYXRlaW8nOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dhdGVpby5qcycpLFxuICAgICdnZGF4JzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dkYXguanMnKSxcbiAgICAnZ2VtaW5pJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9nZW1pbmkuanMnKSxcbiAgICAnZ2V0YnRjJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9nZXRidGMuanMnKSxcbiAgICAnaGFkYXgnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9oYWRheC5qcycpLFxuICAgICdoaXRidGMnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2hpdGJ0Yy5qcycpLFxuICAgICdoaXRidGMyJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2hpdGJ0YzIuanMnKSxcbiAgICAnaHVvYmknOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9odW9iaS5qcycpLFxuICAgICdodW9iaWNueSc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2h1b2JpY255LmpzJyksXG4gICAgJ2h1b2JpcHJvJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvaHVvYmlwcm8uanMnKSxcbiAgICAnaWNlM3gnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9pY2UzeC5qcycpLFxuICAgICdpbmRlcGVuZGVudHJlc2VydmUnOiAgICAgIHJlcXVpcmUgKCcuL2pzL2luZGVwZW5kZW50cmVzZXJ2ZS5qcycpLFxuICAgICdpbmRvZGF4JzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2luZG9kYXguanMnKSxcbiAgICAnaXRiaXQnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9pdGJpdC5qcycpLFxuICAgICdqdWJpJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2p1YmkuanMnKSxcbiAgICAna3Jha2VuJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rcmFrZW4uanMnKSxcbiAgICAna3Vjb2luJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rdWNvaW4uanMnKSxcbiAgICAna3VuYSc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rdW5hLmpzJyksXG4gICAgJ2xha2VidGMnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbGFrZWJ0Yy5qcycpLFxuICAgICdsYmFuayc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2xiYW5rLmpzJyksXG4gICAgJ2xpcXVpJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbGlxdWkuanMnKSxcbiAgICAnbGl2ZWNvaW4nOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9saXZlY29pbi5qcycpLFxuICAgICdsdW5vJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2x1bm8uanMnKSxcbiAgICAnbHlra2UnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9seWtrZS5qcycpLFxuICAgICdtZXJjYWRvJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL21lcmNhZG8uanMnKSxcbiAgICAnbWl4Y29pbnMnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9taXhjb2lucy5qcycpLFxuICAgICduZWdvY2llY29pbnMnOiAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL25lZ29jaWVjb2lucy5qcycpLFxuICAgICdub3ZhJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL25vdmEuanMnKSxcbiAgICAnb2tjb2luY255JzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9va2NvaW5jbnkuanMnKSxcbiAgICAnb2tjb2ludXNkJzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9va2NvaW51c2QuanMnKSxcbiAgICAnb2tleCc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9va2V4LmpzJyksXG4gICAgJ3BheW1pdW0nOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvcGF5bWl1bS5qcycpLFxuICAgICdwb2xvbmlleCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3BvbG9uaWV4LmpzJyksXG4gICAgJ3FyeXB0b3MnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvcXJ5cHRvcy5qcycpLFxuICAgICdxdWFkcmlnYWN4JzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3F1YWRyaWdhY3guanMnKSxcbiAgICAncXVvaW5leCc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9xdW9pbmV4LmpzJyksXG4gICAgJ3NvdXRoeGNoYW5nZSc6ICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvc291dGh4Y2hhbmdlLmpzJyksXG4gICAgJ3N1cmJpdGNvaW4nOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvc3VyYml0Y29pbi5qcycpLFxuICAgICd0aGVyb2NrJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3RoZXJvY2suanMnKSxcbiAgICAndGlkZWJpdCc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy90aWRlYml0LmpzJyksXG4gICAgJ3RpZGV4JzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvdGlkZXguanMnKSxcbiAgICAndXJkdWJpdCc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy91cmR1Yml0LmpzJyksXG4gICAgJ3ZhdWx0b3JvJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvdmF1bHRvcm8uanMnKSxcbiAgICAndmJ0Yyc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy92YnRjLmpzJyksXG4gICAgJ3ZpcndveCc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvdmlyd294LmpzJyksXG4gICAgJ3dleCc6ICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvd2V4LmpzJyksXG4gICAgJ3hidGNlJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMveGJ0Y2UuanMnKSxcbiAgICAneW9iaXQnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy95b2JpdC5qcycpLFxuICAgICd5dW5iaSc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3l1bmJpLmpzJyksXG4gICAgJ3phaWYnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvemFpZi5qcycpLFxuICAgICd6Yic6ICAgICAgICAgICAgICAgICAgICAgIHJlc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hbWUnOiAnMUJyb2tlcicsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1VTJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjInLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljQVBJJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRyYWRlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnNjAnLCAvLyBub3Qgd29ya2luZyBmb3Igc29tZSByZWFzb24sIHJldHVybnMge1wic2VydmVyX3RpbWVcIjpcIjIwMTgtMDMtMjZUMDM6NTI6MjcuOTEyWlwiLFwiZXJyb3JcIjp0cnVlLFwid2FybmluZ1wiOmZhbHNlLFwicmVzcG9uc2VcIjpudWxsLFwiZXJyb3JfY29kZVwiOi0xLFwiZXJyb3JfbWVzc2FnZVwiOlwiRXJyb3Igd2hpbGUgdHJ5aW5nIHRvIGZldGNoIGhpc3RvcmljYWwgbWFya2V0IGRhdGEuIEFuIGludmFsaWQgcmVzb2x1dGlvbiB3YXMgcHJvYmFibHkgdXNlZC5cIn1cbiAgICAgICAgICAgICAgICAnMTVtJzogJzkwMCcsXG4gICAgICAgICAgICAgICAgJzFoJzogJzM2MDAnLFxuICAgICAgICAgICAgICAgICcxZCc6ICc4NjQwMCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjAyMS00MjBiZDlmYy01ZWNiLTExZTctOGVkNi01NmQwMDgxZWZlZDIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vMWJyb2tlci5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vMWJyb2tlci5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly8xYnJva2VyLmNvbS8/Yz1lbi9jb250ZW50L2FwaS1kb2N1bWVudGF0aW9uJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvYmFycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2NhdGVnb3JpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9kZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3F1b3RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3RpY2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2Nsb3NlX2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vZWRpdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vb3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vc2hhcmVkL2dldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc29jaWFsL3Byb2ZpbGVfc3RhdGlzdGljcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc29jaWFsL3Byb2ZpbGVfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2JpdGNvaW5fZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2RldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3ZlcnZpZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcXVvdGFfc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3RyYW5zYWN0aW9uX2xvZycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQ2F0ZWdvcmllcyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldE1hcmtldENhdGVnb3JpZXMgKCk7XG4gICAgICAgIC8vIHRoZXkgcmV0dXJuIGFuIGVtcHR5IHN0cmluZyBhbW9uZyB0aGVpciBjYXRlZ29yaWVzLCB3dGY/XG4gICAgICAgIGxldCBjYXRlZ29yaWVzID0gcmVzcG9uc2VbJ3Jlc3BvbnNlJ107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjYXR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gICAgICBsZXQgcXVvdGUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgaWYgKChjYXRlZ29yeSA9PT0gJ0ZPUkVYJykgfHwgKGNhdGVnb3J5ID09PSAnQ1JZUFRPJykpIHtcbiAgICAgICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICAgICAgICAgIGxldCBwYXJ0cyA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgICAgICAgICAgYmFzZSA9IHBhcnRzWzBdO1xuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9IHBhcnRzWzFdO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGJhc2UgPSBpZDtcbiAgICAgICAgICAgICAgICAgICAgcXVvdGUgPSAnVVNEJztcbiAgICAgICAgICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBiYXNlID0gdGhpc18uY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IHRoaXNfLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW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R2V0TWFya2V0QmFycyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ3Jlc29sdXRpb24nOiA2MCxcbiAgICAgICAgICAgICdsaW1pdCc6IDEsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzdWx0WydyZXNwb25zZSddWzBdO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRpY2tlclsnZGF0ZSddKTtcbiAgICAgICAgbGV0IG9wZW4gPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbycpO1xuICAgICAgICBsZXQgY2xvc2UgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYycpO1xuICAgICAgICBsZXQgY2hhbmdlID0gY2xvc2UgLSBvcGVuO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdoJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2wnKSxcbiAgICAgICAgICAgICdiaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogb3BlbixcbiAgICAgICAgICAgICdjbG9zZSc6IGNs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ICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vMWJ0Y3hlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovLzFidGN4ZS5jb20vYXBpLWRvY3MucGhwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcmljYWwtcHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci1ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzLWFuZC1pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuLW9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci10cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J0Yy1kZXBvc2l0LWFkZHJlc3MvZ2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidGMtZGVwb3NpdC1hZGRyZXNzL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMvZ2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9nZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9lZGl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvY2FuY2Vs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zdGFtcCddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ21ha2VyX3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3ByaWNlJyksXG4gICAgICAgICAgICAnYW1vdW50JzogdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnYW1vdW50JyksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhbnNhY3Rpb25zICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRyYWRlcyA9IHRoaXMub21pdCAocmVzcG9uc2VbJ3RyYW5zYWN0aW9ucyddLCAncmVxdWVzdF9jdXJyZW5jeScpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAodHJhZGVz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RNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0V2l0aGRyYXdhbHNOZXcgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0IChhbW91bnQpLFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsncmVzdWx0J11bJ3V1aWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGlmICh0aGlzLmlkID09PSAnY3J5cHRvY2FwaXRhbCcpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgaXMgYW4gYWJzdHJhY3QgYmFzZSBBUEkgZm9yIF8xYnRjeGUnKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeS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lcnNpb24nOiAndjInLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMCcsXG4gICAgICAgICAgICAgICAgJzFoJzogJzYwJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMTIwJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnMjQwJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzcyMCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzE0NDAnLFxuICAgICAgICAgICAgICAgICczZCc6ICc0MzIwJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMTAwODAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzAyNDc2MTQtMWZlNjFjNzQtOTYyMS0xMWU3LTllOGMtZjFhNjI3YWZhMjc5LmpwZycsXG4gICAgICAgICAgICAgICAgJ2V4dGVuc2lvbic6ICcuanNvbicsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FjeC5pby9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9hY3guaW8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9hY3guaW8vZG9jdW1lbnRzL2FwaV92MicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJywgLy8gR2V0IGRlcHRoIG9yIHNwZWNpZmllZCBtYXJrZXQgQm90aCBhc2tzIGFuZCBiaWRzIGFyZSBzb3J0ZWQgZnJvbSBoaWdoZXN0IHByaWNlIHRvIGxvd2VzdC5cbiAgICAgICAgICAgICAgICAgICAgICAgICdrX3dpdGhfcGVuZGluZ190cmFkZXMnLCAvLyBHZXQgSyBkYXRhIHdpdGggcGVuZGluZyB0cmFkZXMsIHdoaWNoIGFyZSB0aGUgdHJhZGVzIG5vdCBpbmNsdWRlZCBpbiBLIGRhdGEgeWV0LCBiZWNhdXNlIHRoZXJlJ3MgZGVsYXkgYmV0d2VlbiB0cmFkZSBnZW5lcmF0ZWQgYW5kIHByb2Nlc3NlZCBieSBLIGRhdGEgZ2VuZXJhdG9yXG4gICAgICAgICAgICAgICAgICAgICAgICAnaycsIC8vIEdldCBPSExDKGsgbGluZSkgb2Ygc3BlY2lmaWMgbWFya2V0XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cycsIC8vIEdldCBhbGwgYXZhaWxhYmxlIG1hcmtldHNcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJywgLy8gR2V0IHRoZSBvcmRlciBib29rIG9mIHNwZWNpZmllZCBtYXJrZXRcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJywgLy8gR2V0IHRpY2tlciBvZiBhbGwgbWFya2V0c1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMve21hcmtldH0nLCAvLyBHZXQgdGlja2VyIG9mIHNwZWNpZmljIG1hcmtldFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpbWVzdGFtcCcsIC8vIEdldCBzZXJ2ZXIgY3VycmVudCB0aW1lLCBpbiBzZWNvbmRzIHNpbmNlIFVuaXggZXBvY2hcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLCAvLyBHZXQgcmVjZW50IHRyYWRlcyBvbiBtYXJrZXQsIGVhY2ggdHJhZGUgaXMgaW5jbHVkZWQgb25seSBvbmNlIFRyYWRlcyBhcmUgc29ydGVkIGluIHJldmVyc2UgY3JlYXRpb24gb3JkZXIuXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21lbWJlcnMvbWUnLCAvLyBHZXQgeW91ciBwcm9maWxlIGFuZCBhY2NvdW50cyBpbmZvXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMnLCAvLyBHZXQgeW91ciBkZXBvc2l0cyBoaXN0b3J5XG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCcsIC8vIEdldCBkZXRhaWxzIG9mIHNwZWNpZmljIGRlcG9zaXRcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2FkZHJlc3MnLCAvLyBXaGVyZSB0byBkZXBvc2l0IFRoZSBhZGRyZXNzIGZpZWxkIGNvdWxkIGJlIGVtcHR5IHdoZW4gYSBuZXcgYWRkcmVzcyBpcyBnZW5lcmF0aW5nIChlLmcuIGZvciBiaXRjb2luKSwgeW91IHNob3VsZCB0cnkgYWdhaW4gbGF0ZXIgaW4gdGhhdCBjYXNlLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsIC8vIEdldCB5b3VyIG9yZGVycywgcmVzdWx0cyBpcyBwYWdpbmF0ZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsIC8vIEdldCBpbmZvcm1hdGlvbiBvZiBzcGVjaWZpZWQgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvbXknLCAvLyBHZXQgeW91ciBleGVjdXRlZCB0cmFkZXMgVHJhZGVzIGFyZSBzb3J0ZWQgaW4gcmV2ZXJzZSBjcmVhdGlvbiBvcmRlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd3MnLCAvLyBHZXQgeW91ciBjcnlwdG9jdXJyZW5jeSB3aXRoZHJhd3NcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsIC8vIEdldCB5b3VyIGNyeXB0b2N1cnJlbmN5IHdpdGhkcmF3XG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsIC8vIENyZWF0ZSBhIFNlbGwvQnV5IG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL211bHRpJywgLy8gQ3JlYXRlIG11bHRpcGxlIHNlbGwvYnV5IG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9jbGVhcicsIC8vIENhbmNlbCBhbGwgbXkgb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvZGVsZXRlJywgLy8gQ2FuY2VsIGFuIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLCAvLyBDcmVhdGUgYSB3aXRoZHJhd1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge30sIC8vIFRoZXJlIGlzIG9ubHkgMSUgZmVlIG9uIHdpdGhkcmF3YWxzIHRvIHlvdXIgYmFuayBhY2NvdW50LlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzIwMDInOiBJbnN1ZmZpY2llbnRGdW5kcyxcbiAgICAgICAgICAgICAgICAnMjAwMyc6IE9yZGVyTm90Rm91bmQsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldE1lbWJlcnNNZSAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2FjY291bnRzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gY3VycmVuY3kudG9VcHBlckNhc2UgKCk7X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gICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICAgICAgYmFzZSA9IGJhc2UudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgcXVvdGUgPSBxdW90ZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJzTWFya2V0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2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aXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlLCBtYXJrZXQsIHNpbmNlLCBsaW1pdCk7XG4gICAgfVxuXG4gICAgcGFyc2VPSExDViAob2hsY3YsIG1hcmtldCA9IHVuZGVmaW5lZCwgdGltZWZyYW1lID0gJzFtJywgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICBvaGxjdlswXSAqIDEwMDAsXG4gICAgICAgICAgICBvaGxjdlsxXSxcbiAgICAgICAgICAgIG9obGN2WzJdLFxuICAgICAgICAgICAgb2hsY3ZbM10sXG4gICAgICAgICAgICBvaGxjdls0XSxcbiAgICAgICAgICAgIG9obGN2WzVdLFxuICAgICAgICBdO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT0hMQ1YgKHN5bWJvbCwgdGltZWZyYW1lID0gJzFtJywgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGlmICghbGltaXQpXG4gICAgICAgICAgICBsaW1pdCA9IDUwMDsgLy8gZGVmYXVsdCBpcyAzMFxuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdtYXJrZXQnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAncGVyaW9kJzogdGhpcy50aW1lZnJhbWVzW3RpbWVmcmFtZV0sXG4gICAgICAgICAgICAnbGltaXQnOiBsaW1pdCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHR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ICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHBhcnNlSW50IChpZCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyIChyZXNwb25zZSk7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ21hcmtldCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAndm9sdW1lJzogYW1vdW50LnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZF90eXBlJzogdHlwZSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHR5cGUgPT09ICdsaW1pdCcpIHtcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gcHJpY2UudG9TdHJpbmcgKCk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE9yZGVycyAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtyZXNwb25zZVsnbWFya2V0J11dO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyIChyZXNwb25zZSwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgIC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AgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgZW5jb2RlUGFyYW1zIChwYXJhbXMpIHtcbiAgICAgICAgaWYgKCdvcmRlcnMnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgbGV0IG9yZGVycyA9IHBhcmFtc1snb3JkZXJzJ107XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5rZXlzb3J0ICh0aGlzLm9taXQgKHBhcmFtcywgJ29yZGVycycpKSk7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG9yZGVycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBvcmRlciA9IG9yZGVyc1tpXTtcbiAgICAgICAgICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChvcmRlcik7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgayA9IDA7IGsgPCBrZXlzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBrZXkgPSBrZXlzW2tdO1xuICAgICAgICAgICAgICAgICAgICBsZXQgdmFsdWUgPSBvcmRlcltrZXldO1xuICAgICAgICAgICAgICAgICAgICBxdWVyeSArPSAnJm9yZGVycyU1QiU1RCU1QicgKyBrZXkgKyAnJTVEPScgKyB2YWx1ZS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcXVlcnk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMudXJsZW5jb2RlICh0aGlzLmtleXNvcnQgKHBhcmFtcykpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSAnL2FwaScgKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGlmICgnZXh0ZW5zaW9uJyBpbiB0aGlzLnVybHMpXG4gICAgICAgICAgICByZXF1ZXN0ICs9IHRoaXMudXJsc1snZXh0ZW5zaW9uJ107XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyByZXF1ZXN0O1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmVuY29kZVBhcmFtcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYWNjZXNzX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICd0b25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG1ldGhvZCArICd8JyArIHJlcXVlc3QgKyAnfCcgKyBxdWVyeTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBsZXQgc3VmZml4ID0gcXVlcnkgKyAnJnNpZ25hdHVyZT0nICsgc2lnbmF0dXJlO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgc3VmZml4O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gc3VmZml4O1xuICAgICAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09PSA0MDApIHtcbiAgICAgICAgICAgIGNvbnN0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBjb25zdCBlcnJvciA9IHRoaXMuc2FmZVZhbHVlIChyZXNwb25zZSwgJ2Vycm9yJyk7XG4gICAgICAgICAgICBjb25zdCBlcnJvckNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKGVycm9yLCAnY29kZScpO1xuICAgICAgICAgICAgY29uc3QgZmVlZGJhY2sgPSB0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSk7XG4gICAgICAgICAgICBjb25zdCBleGNlcHRpb25zID0gdGhpcy5leGNlcHRpb25zO1xuICAgICAgICAgICAgaWYgKGVycm9yQ29kZSBpbiBleGNlcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3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FxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly93d3cuYWxsY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmFsbGNvaW4uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmFsbGNvaW4uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmFsbGNvaW4uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmFsbGNvaW4uY29tL0Fib3V0L0FQSVJlZmVyZW5jZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnd2ViJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0hvbWUvTWFya2V0T3ZlclZpZXdEZXRhaWwvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2tsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmF0Y2hfdHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcGF5bWVudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzogdW5kZWZpbmVkLFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMud2ViR2V0SG9tZU1hcmtldE92ZXJWaWV3RGV0YWlsICgpO1xuICAgICAgICBsZXQgY29pbnMgPSByZXNwb25zZVsnbWFya2V0Q29pbnMnXTtcbiAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBjb2lucy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldHMgPSBjb2luc1tqXVsnTWFya2V0cyddO1xuICAgICAgICAgICAgZm9yIChsZXQgayA9IDA7IGsgPCBtYXJrZXRzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNba11bJ01hcmtldCddO1xuICAgICAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydQcmltYXJ5J107XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydTZWNvbmRhcnknXTtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZUlkID0gYmFzZS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGVJZCA9IHF1b3RlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IGJhc2VJZCArICdfJyArIHF1b3RlSWQ7XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICBsZXQgYWN0aXZlID0gbWFya2V0WydUcmFkZUVuYWJsZWQnXSAmJiBtYXJrZXRbJ0J1eUVuYWJsZWQnXSAmJiBtYXJrZXRbJ1NlbGxFbmFibGVkJ107XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3R5cGUnOiAnc3BvdCcsXG4gICAgICAgICAgICAgICAgICAgICdzcG90JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiBtYXJrZXRbJ0Fza0ZlZVJhdGUnXSwgLy8gQmlkRmVlUmF0ZSAwLCBBc2tGZWVSYXRlIDAuMDAyLCB3ZSB1c2UganVzdCB0aGUgQXNrRmVlUmF0ZSBoZXJlXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IG1hcmtldFsnQXNrRmVlUmF0ZSddLCAvLyBCaWRGZWVSYXRlIDAsIEFza0ZlZVJhdGUgMC4wMDIsIHdlIHVzZSBqdXN0IHRoZSBBc2tGZWVSYXRlIGhlcmVcbiAgICAgICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiBtYXJrZXRbJ1ByaW1hcnlEaWdpdHMnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsnU2Vjb25kYXJ5RGlnaXRzJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ01pblRyYWRlQW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IG1hcmtldFsnTWF4VHJhZGVBbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnTWluT3JkZXJQcmljZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBtYXJrZXRbJ01heE9yZGVyUHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcm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J2h0dHBzOi8vYW54cHJvLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9hbnhwcm8uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cDovL2RvY3MuYW54djIuYXBpYXJ5LmlvJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYW54cHJvLmNvbS9wYWdlcy9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9kZXB0aC9mdWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvdHJhZGUvZmV0Y2gnLCAvLyBkaXNhYmxlZCBieSBBTlhQcm9cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvb3JkZXIvYWRkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvb3JkZXIvcXVvdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9yZXN1bHQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21vbmV5L3tjdXJyZW5jeX0vYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkve2N1cnJlbmN5fS9zZW5kX3NpbXBsZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkvdHJhZGUvbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkvd2FsbGV0L2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9VU0QnOiB7ICdpZCc6ICdCVENVU0QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJywgJ211bHRpcGxpZXInOiAxMDAwMDAgfSxcbiAgICAgICAgICAgICAgICAnQlRDL0hLRCc6IHsgJ2lkJzogJ0JUQ0hLRCcsICdzeW1ib2wnOiAnQlRDL0hLRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdIS0QnLCAnbXVsdGlwbGllcic6IDEwMDAwMCB9LFxuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnQlRDRVVSJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicsICdtdWx0aXBsaWVyJzogMTAwMDAwIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9DQUQnOiB7ICdpZCc6ICdCVENDQUQnLCAnc3ltYm9sJzogJ0JUQy9DQUQnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ0FEJywgJ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IGlmIChtYXJrZXRDbGFzcylcbiAgICAgICAgICAgIHJldHVybiBtYXJrZXRDbGFzc1xuXG4gICAgICAgIG1hcmtldENsYXNzID0gbmV3IE1hcmtldCAodGhpcywgc3ltYm9sKVxuICAgICAgICB0aGlzLm1hcmtldENsYXNzZXNbc3ltYm9sXSA9IG1hcmtldENsYXNzIC8vIG9ubHkgb25lIE1hcmtldCBpbnN0YW5jZSBwZXIgbWFya2V0XG4gICAgICAgIHJldHVybiBtYXJrZXRDbGFzc1xuICAgIH1cblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICduYW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdlbmFibGVSYXRlTGltaXQnOiBmYWxzZSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAyMDAwLCAvLyBtaWxsaXNlY29uZHMgPSBzZWNvbmRzICogMTAwMFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdwdWJsaWNBUEknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwcml2YXRlQVBJJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlRGVwb3NpdEFkZHJlc3MnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZUxpbWl0T3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgIC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sc2UsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAnd3d3JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdkb2MnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiAgIHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6ICAgdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogICAgICBmYWxzZSxcbiAgICAgICAgICAgICAgICAnbG9naW4nOiAgICBmYWxzZSxcbiAgICAgICAgICAgICAgICAncGFzc3dvcmQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAndHdvZmEnOiAgICBmYWxzZSwgLy8gMi1mYWN0b3IgYXV0aGVudGljYXRpb24gKG9uZS10aW1lIHBhc3N3b3JkIGtleSlcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHVuZGVmaW5lZCwgLy8gdG8gYmUgZmlsbGVkIG1hbnVhbGx5IG9yIGJ5IGZldGNoTWFya2V0c1xuICAgICAgICAgICAgJ2N1cnJlbmNpZXMnOiB7fSwgLy8gdG8gYmUgZmlsbGVkIG1hbnVhbGx5IG9yIGJ5IGZldGNoTWFya2V0c1xuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB1bmRlZmluZWQsIC8vIHJlZGVmaW5lIGlmIHRoZSBleGNoYW5nZSBoYXMuZmV0Y2hPSExDVlxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge30sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge30sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncGFyc2VKc29uUmVzcG9uc2UnOiB0cnVlLCAvLyB3aGV0aGVyIGEgcmVwbHkgaXMgcmVxdWlyZWQgdG8gYmUgaW4gSlNPTiBvciBub3RcbiAgICAgICAgICAgICdza2lwSnNvbk9uU3RhdHVzQ29kZXMnOiBbXSwgLy8gYXJyYXkgb2YgaHR0cCBzdGF0dXMgY29kZXMgd2hpY2ggb3ZlcnJpZGUgcmVxdWlyZW1lbnQgZm9yIEpTT04gcmVzcG9uc2VcbiAgICAgICAgICAgICdleGNlcHRpb25zJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgLy8gc29tZSBleGNoYW5nZXMgcmVwb3J0IG9ubHkgJ2ZyZWUnIG9uIGBmZXRjaEJsYW5jZWAgY2FsbCAoaS5lLiByZXBvcnQgbm8gJ3VzZWQnIGZ1bmRzKVxuICAgICAgICAgICAgLy8gaW4gdGhpcyBjYXNlIGNje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ICAgICAgIHRoaXMucHJveHkgPSAnJ1xuICAgICAgICB0aGlzLm9yaWdpbiA9ICcqJyAvLyBDT1JTIG9yaWdpblxuXG4gICAgICAgIHRoaXMuaXNvODYwMSAgICAgICAgICA9IHRpbWVzdGFtcCA9PiAoKHR5cGVvZiB0aW1lc3RhbXAgPT09ICd1bmRlZmluZWQnKSA/IHRpbWVzdGFtcCA6IG5ldyBEYXRlICh0aW1lc3RhbXApLnRvSVNPU3RyaW5nICgpKVxuICAgICAgICB0aGlzLnBhcnNlODYwMSAgICAgICAgPSB4ID0+IERhdGUucGFyc2UgKCgoKHguaW5kZXhPZiAoJysnKSA+PSAwKSB8fCAoeC5zbGljZSAoLTEpID09PSAnWicpKSA/IHggOiAoeCArICdaJykucmVwbGFjZSAoL1xccyhcXGRcXGQpOi8sICdUJDE6JykpKVxuICAgICAgICB0aGlzLnBhcnNlRGF0ZSAgICAgICAgPSAoeCkgPT4ge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiB4ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICByZXR1cm4geFxuICAgICAgICAgICAgcmV0dXJuICgoeC5pbmRleE9mICgnR01UJykgPj0gMCkgP1xuICAgICAgICAgICAgICAgIERhdGUucGFyc2UgKHgpIDpcbiAgICAgICAgICAgICAgICB0aGlzLnBhcnNlODYwMSAoeCkpXG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5taWNyb3NlY29uZHMgICAgID0gKCkgPT4gbm93ICgpICogMTAwMCAvLyBUT0RPOiB1dGlsaXplIHBlcmZvcm1hbmNlLm5vdyBmb3IgdGhhdCBwdXJwb3NlXG4gICAgICAgIHRoaXMuc2Vjb25kcyAgICAgICAgICA9ICgpID0+IE1hdGguZmxvb3IgKG5vdyAoKSAvIDEwMDApXG5cbiAgICAgICAgdGhpcy5taW5GdW5kaW5nQWRkcmVzc0xlbmd0aCA9IDEgLy8gdXNlZCBpbiBjaGVja0FkZHJlc3NcbiAgICAgICAgdGhpcy5zdW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mZhY2VcbiAgICAgICAgZm9yIChjb25zdCBrIGluIHRoaXMuaGFzKSB7XG4gICAgICAgICAgICB0aGlzWydoYXMnICsgY2FwaXRhbGl6ZSAoayldID0gISF0aGlzLmhhc1trXSAvLyBjb252ZXJ0cyAnZW11bGF0ZWQnIHRvIHRydWVcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmFwaSlcbiAgICAgICAgICAgIHRoaXMuZGVmaW5lUmVzdEFwaSAodGhpcy5hcGksICdyZXF1ZXN0JylcblxuICAgICAgICB0aGlzLmluaXRSZXN0UmF0ZUxpbWl0ZXIgKClcblxuICAgICAgICBpZiAodGhpcy5tYXJrZXRzKVxuICAgICAgICAgICAgdGhpcy5zZXRNYXJrZXRzICh0aGlzLm1hcmtldHMpXG5cbiAgICAgICAgaWYgKHRoaXMuZGVidWcgJiYgam91cm5hbCkge1xuICAgICAgICAgICAgam91cm5hbCAoKCkgPT4gdGhpcy5qb3VybmFsLCB0aGlzLCBPYmplY3Qua2V5cyAodGhpcy5oYXMpKVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZGVmYXVsdHMgKCkge1xuICAgICAgICByZXR1cm4geyAvKiBvdmVycmlkZSBtZSAqLyB9XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5zZWNvbmRzICgpXG4gICAgfVxuXG4gICAgbWlsbGlzZWNvbmRzICgpIHtcbiAgICAgICAgcmV0dXJuIG5vdyAoKVxuICAgIH1cblxuICAgIGVuY29kZVVSSUNvbXBvbmVudCAoLi4uYXJncykge1xuICAgICAgICByZXR1cm4gZW5jb2RlVVJJQ29tcG9uZW50ICguLi5hcmdzKVxuICAgIH1cblxuICAgIGNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKSB7XG4gICAgICAgIE9iamVjdC5rZXlzICh0aGlzLnJlcXVpcmVkQ3JlZGVudGlhbHMpLmZvckVhY2ggKChrZXkpID0+IHtcbiAgICAgICAgICAgIGlm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tZW50YXRpb25cblxuICAgICAgICBpZiAodGhpcy5yYXRlTGltaXQgPT09IHVuZGVmaW5lZClcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvciAodGhpcy5pZCArICcucmF0ZUxpbWl0IHByb3BlcnR5IGlzIG5vdCBjb25maWd1cmVkJylcblxuICAgICAgICB0aGlzLnRva2VuQnVja2V0ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgIHJlZmlsbFJhdGU6ICAxIC8gdGhpcy5yYXRlTGltaXQsXG4gICAgICAgICAgICBkZWxheTogICAgICAgMSxcbiAgICAgICAgICAgIGNhcGFjaXR5OiAgICAxLFxuICAgICAgICAgICAgZGVmYXVsdENvc3Q6IDEsXG4gICAgICAgICAgICBtYXhDYXBhY2l0eTogMTAwMCxcbiAgICAgICAgfSwgdGhpcy50b2tlbkJ1Y2tldClcblxuICAgICAgICB0aGlzLnRocm90dGxlID0gdGhyb3R0bGUgKHRoaXMudG9rZW5CdWNrZXQpXG5cbiAgICAgICAgdGhpcy5leGVjdXRlUmVzdFJlcXVlc3QgPSBmdW5jdGlvbiAodXJsLCBtZXRob2QgPSAnR0VUJywgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuXG4gICAgICAgICAgICBsZXQgcHJvbWlzZSA9XG4gICAgICAgICAgICAgICAgZmV0Y2hJbXBsZW1lbnRhdGlvbiAodXJsLCB7IG1ldGhvZCwgaGVhZGVycywgYm9keSwgJ2FnZW50JzogdGhpcy5hZ2VudCB8fCBudWxsLCB0aW1lb3V0OiB0aGlzLnRpbWVvdXQgfSlcbiAgICAgICAgICAgICAgICAgICAgLmNhdGNoIChlID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc05vZGUpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlTm90QXZhaWxhYmxlIChbIHRoaXMuaWQsIG1ldGhvZCwgdXJsLCBlLnR5cGUsIGUubWVzc2FnZSBdLmpvaW4gKCcgJykpXG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBlIC8vIHJldGhyb3cgYWxsIHVua25vd24gZXJyb3JzXG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC50aGVuIChyZXNwb25zZSA9PiB0aGlzLmhhbmRsZVJlc3RSZXNwb25zZSAocmVzcG9uc2UsIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSlcblxuICAgICAgICAgICAgcmV0dXJuIHRpbWVvdXQgKHRoaXMudGltZW91dCwgcHJvbWlzZSkuY2F0Y2ggKGUgPT4ge1xuICAgICAgICAgICAgICAgIGlmIChlIGluc3RhbmNlb2YgVGltZWRPdXQpXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBSZXF1ZXN0VGltZW91dCAodGhpcy5pZCArICcgJyArIG1ldGhvZCArICcgJyArIHVybCArICcgcmVxdWVzdCB0aW1lZCBvdXQgKCcgKyB0aGlzLnRpbWVvdXQgKyAnIG1zKScpXG4gICAgICAgICAgICAgICAgdGhyb3cgZVxuICAgICAgICAgICAgfSlcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGRlZmluZVJlc3RBcGkgKGFwaSwgbWV0aG9kTmFtZSwgb3B0aW9ucyA9IHt9KSB7XG5cbiAgICAgICAgZm9yIChjb25zdCB0eXBlIG9mIE9iamVjdC5rZXlzIChhcGkpKSB7XG4gICAgICAgICAgICBmb3IgKGNvbnN0IGh0dHBNZXRob2Qgb2YgT2JqZWN0LmtleXMgKGFwaVt0eXBlXSkpIHtcblxuICAgICAgICAgICAgICAgIGxldCBwYXRocyA9IGFwaVt0eXBlXVtodHRwTWV0aG9kXVxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcGF0aHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBhdGggPSBwYXRoc1tpXS50cmltICgpXG4gICAgICAgICAgICAgICAgICAgIGxldCBzcGxpdFBhdGggPSBwYXRoLnNwbGl0ICgvW15hLXpBLVowLTldLylcblxuICAgICAgICAgICAgICAgICAgICBsZXQgdXBwZXJjYXNlTWV0aG9kICA9IGh0dHBNZXRob2QudG9VcHBlckNhc2UgKClcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxvd2VyY2FzZU1ldGhvZCAgPSBodHRwTWV0aG9kLnRvTG93ZXJDYXNlICgpXG4gICAgICAgICAgICAgICAgICAgIGxldCBjYW1lbGNhc2VNZXRob2QgID0gdGhpcy5jYXBpdGFsaXplIChsb3dlcmNhc2VNZXRob2QpXG4gICAgICAgICAgICAgICAgICAgIGxldCBjYW1lbGNhc2VTdWZmaXggID0gc3BsaXRQYXRoLm1hcCAodGhpcy5jYXBpdGFsaXplKS5qb2luICgnJylcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVuZGVyc2NvcmVTdWZmaXggPSBzcGxpdFBhdGgubWFwICh4ID0+IHgudHJpbSAoKS50b0xvd2VyQ2FzZSAoKSkuZmlsdGVyICh4ID0+IHgubGVuZ3RoID4gMCkuam9pbiAoJ18nKVxuXG4gICAgICAgICAgICAgICAgICAgIGxldCBjYW1lbGNhc2UgID0gdHlwZSArIGNhbWVsY2FzZU1ldGhvZCArIHRoaXMuY2FwaXRhbGl6ZSAoY2FtZWxjYXNlU3VmZml4KVxuICAgICAgICAgICAgICAgICAgICBsZXQgdW5kZXJzY29yZSA9IHR5cGUgKyAnXycgKyBsb3dlcmNhc2VNZXRob2QgKyAnXycgKyB1bmRlcnNjb3JlU3VmZml4XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCdzdWZmaXhlcycgaW4gb3B0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCdjYW1lbGNhc2UnIGluIG9wdGlvbnNbJ3N1ZmZpeGVzJ10pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FtZWxjYXNlICs9IG9wdGlvbnNbJ3N1ZmZpeGVzJ11bJ2NhbWVsY2FzZSddXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJ3VuZGVyc2NvcmUnIGluIG9wdGlvbnMuc3VmZml4ZXMpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5kZXJzY29yZSArPSBvcHRpb25zWydzdWZmaXhlcyddWyd1bmRlcnNjb3JlJ11cbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmICgndW5kZXJzY29yZV9zdWZmaXgnIGluIG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgICAgICAgICB1bmRlcnNjb3JlICs9IG9wdGlvbnMudW5kZXJzY29yZVN1ZmZpeDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCdjYW1lbGNhc2Vfc3VmZml4JyBpbiBvcHRpb25zKVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FtZWxjYXNlICs9IG9wdGlvbnMuY2FtZWxjYXNlU3VmZml4O1xuXG4gICAgICAgICAgICAgICAgICAgIGxldCBwYXJ0aWFsID0gYXN5bmMgcGFyYW1zID0+IHRoaXNbbWV0aG9kTmFtZV0gKHBhdGgsIHR5cGUsIHVwcGVyY2FzZU1ldGhvZCwgcGFyYW1zIHx8IHt9KVxuXG4gICAgICAgICAgICAgICAgICAgIHRoaXNbY2FtZWxjYXNlXSAgPSBwYXJ0aWFsXG4gICAgICAgICAgICAgICAgICAgIHRoaXNbdW5kZXJzY29yZV0gPSBwYXJ0aWFsXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZmV0Y2ggKHVybCwgbWV0aG9kID0gJ0dFVCcsIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcblxuICAgICAgICBpZiAoaXNOb2RlICYmIHRoaXMudXNlckFnZW50KSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHRoaXMudXNlckFnZW50ID09PSAnc3RyaW5nJylcbiAgICAgICAgICAgICAgICBoZWFkZXJzID0gZXh0ZW5kICh7ICdVc2VyLUFnZW50JzogdGhpcy51c2VyQWdlbnQgfSwgaGVhZGVycylcbiAgICAgICAgICAgIGVsc2UgaWYgKCh0eXBlb2YgdGhpcy51c2VyQWdlbnQgPT09ICdvYmplY3QnKSAmJiAoJ1VzZXItQWdlbnQnIGluIHRoaXMudXNlckFnZW50KSlcbiAgICAgICAgICAgICAgICBoZWFkZXJzID0gZXh0ZW5kICh0aGlzLnVzZXJBZ2VudCwgaGVhZGVycylcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0eXBlb2YgdGhpcy5wcm94eSA9PT0gJ2Z1bmN0aW9uJykge1xuXG4gICAgICAgICAgICB1cmwgPSB0aGlzLnByb3h5ICh1cmwpXG4gICAgICAgICAgICBpZiAoaXNOb2RlKVxuICAgICAgICAgICAgICAgIGhlYWRlcnMgPSBleHRlbmQgKHsgJ09yaWdpbic6IHRoaXMub3JpZ2luIH0sIGhlYWRlcnMpXG5cbiAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgdGhpcy5wcm94eSA9PT0gJ3N0cmluZycpIHtcblxuICAgICAgICAgICAgaWYgKHRoaXMucHJveHkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIGlmIChpc05vZGUpXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnMgPSBleHRlbmQgKHsgJ09yaWdpbic6IHRoaXMub3JpZ2luIH0sIGhlYWRlcnMpXG5cbiAgICAgICAgICAgIHVybCA9IHRoaXMucHJveHkgKyB1cmxcbiAgICAgICAgfVxuXG4gICAgICAgIGhlYWRlcnMgPSBleHRlbmQgKHRoaXMuaGVhZGVycywgaGVhZGVycylcblxuICAgICAgICBpZiAodGhpcy52ZXJib3NlKVxuICAgICAgICAgICAgY29uc29sZS5sb2cgKFwiZmV0Y2g6XFxuXCIsIHRoaXMuaWQsIG1ldGhvZCwgdXJsLCBcIlxcblJlcXVlc3Q6XFxuXCIsIGhlYW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XRjaClcbiAgICAgICAgICAgIGRldGFpbHMgPSBtYXRjaFsxXS50cmltICgpO1xuICAgICAgICBpZiAoWyA0MTgsIDQyOSBdLmluY2x1ZGVzIChjb2RlKSkge1xuICAgICAgICAgICAgZXJyb3IgPSBERG9TUHJvdGVjdGlvblxuICAgICAgICB9IGVsc2UgaWYgKFsgNDA0LCA0MDksIDUwMCwgNTAxLCA1MDIsIDUyMCwgNTIxLCA1MjIsIDUyNSBdLmluY2x1ZGVzIChjb2RlKSkge1xuICAgICAgICAgICAgZXJyb3IgPSBFeGNoYW5nZU5vdEF2YWlsYWJsZVxuICAgICAgICB9IGVsc2UgaWYgKFsgNDAwLCA0MDMsIDQwNSwgNTAzLCA1MzAgXS5pbmNsdWRlcyAoY29kZSkpIHtcbiAgICAgICAgICAgIGxldCBkZG9zUHJvdGVjdGlvbiA9IHJlc3BvbnNlQm9keS5tYXRjaCAoL2Nsb3VkZmxhcmV8aW5jYXBzdWxhL2kpXG4gICAgICAgICAgICBpZiAoZGRvc1Byb3RlY3Rpb24pIHtcbiAgICAgICAgICAgICAgICBlcnJvciA9IEREb1NQcm90ZWN0aW9uXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGVycm9yID0gRXhjaGFuZ2VOb3RBdmFpbGFibGVcbiAgICAgICAgICAgICAgICBkZXRhaWxzICs9ICcgKHBvc3NpYmxlIHJlYXNvbnM6ICcgKyBbXG4gICAgICAgICAgICAgICAgICAgICdpbnZhbGlkIEFQSSBrZXlzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2JhZCBvciBvbGQgbm9uY2UnLFxuICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UgaXMgZG93biBvciBvZmZsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgJ29uIG1haW50ZW5hbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgJ0REb1MgcHJvdGVjdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICdyYXRlLWxpbWl0aW5nJyxcbiAgICAgICAgICAgICAgICBdLmpvaW4gKCcsICcpICsgJyknXG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAoWyA0MDgsIDUwNCBdLmluY2x1ZGVzIChjb2RlKSkge1xuICAgICAgICAgICAgZXJyb3IgPSBSZXF1ZXN0VGltZW91dFxuICAgICAgICB9IGVsc2UgaWYgKFsgNDAxLCA1MTEgXS5pbmNsdWRlcyAoY29kZSkpIHtcbiAgICAgICAgICAgIGVycm9yID0gQXV0aGVudGljYXRpb25FcnJvclxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZXJyb3IgPSBFeGNoYW5nZUVycm9yXG4gICAgICAgIH1cbiAgICAgICAgdGhyb3cgbmV3IGVycm9yIChbIHRoaXMuaWQsIG1ldGhvZCwgdXJsLCBjb2RlLCByZWFzb24sIGRldGFpbHMgXS5qb2luICgnICcpKVxuICAgIH1cblxuICAgIGhhbmRsZVJlc3RSZXNwb25zZSAocmVzcG9uc2UsIHVybCwgbWV0aG9kID0gJ0dFVCcsIHJlcXVlc3RIZWFkZXJzID0gdW5kZWZpbmVkLCByZXF1ZXN0Qm9keSA9IHVuZGVmaW5lZCkge1xuXG4gICAgICAgIHJldHVybiByZXNwb25zZS50ZXh0ICgpLnRoZW4gKChyZXNwb25zZUJvZHkpID0+IHtcblxuICAgICAgICAgICAgbGV0IGpzb25SZXF1aXJlZCA9IHRoaXMucGFyc2VKc29uUmVzcG9uc2UgJiYgIXRoaXMuc2tpcEpzb25PblN0YXR1c0NvZGVzLmluY2x1ZGVzIChyZXNwb25zZS5zdGF0dXMpXG4gICAgICAgICAgICBsZXQganNvbiA9IGpzb25SZXF1aXJlZCA/IHRoaXMucGFyc2VKc29uIChyZXNwb25zZSwgcmVzcG9uc2VCb2R5LCB1cmwsIG1ldGhvZCkgOiB1bmRlZmluZWRcblxuICAgICAgICAgICAgbGV0IHJlc3BvbnNlSGVhZGVycyA9IHt9XG4gICAgICAgICAgICByZXNwb25zZS5o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BlbHNlIHtcbiAgICAgICAgICAgIGNvbnN0IGJhc2VDdXJyZW5jaWVzID1cbiAgICAgICAgICAgICAgICB2YWx1ZXMuZmlsdGVyIChtYXJrZXQgPT4gJ2Jhc2UnIGluIG1hcmtldClcbiAgICAgICAgICAgICAgICAgICAgLm1hcCAobWFya2V0ID0+ICh7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogbWFya2V0LmJhc2VJZCB8fCBtYXJrZXQuYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bWVyaWNJZDogKHR5cGVvZiBtYXJrZXQuYmFzZU51bWVyaWNJZCAhPT0gJ3VuZGVmaW5lZCcpID8gbWFya2V0LmJhc2VOdW1lcmljSWQgOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2RlOiBtYXJrZXQuYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHByZWNpc2lvbjogbWFya2V0LnByZWNpc2lvbiA/IChtYXJrZXQucHJlY2lzaW9uLmJhc2UgfHwgbWFya2V0LnByZWNpc2lvbi5hbW91bnQpIDogOCxcbiAgICAgICAgICAgICAgICAgICAgfSkpXG4gICAgICAgICAgICBjb25zdCBxdW90ZUN1cnJlbmNpZXMgPVxuICAgICAgICAgICAgICAgIHZhbHVlcy5maWx0ZXIgKG1hcmtldCA9PiAncXVvdGUnIGluIG1hcmtldClcbiAgICAgICAgICAgICAgICAgICAgLm1hcCAobWFya2V0ID0+ICh7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogbWFya2V0LnF1b3RlSWQgfHwgbWFya2V0LnF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVtZXJpY0lkOiAodHlwZW9mIG1hcmtldC5xdW90ZU51bWVyaWNJZCAhPT0gJ3VuZGVmaW5lZCcpID8gbWFya2V0LnF1b3RlTnVtZXJpY0lkIDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29kZTogbWFya2V0LnF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uOiBtYXJrZXQucHJlY2lzaW9uID8gKG1hcmtldC5wcmVjaXNpb24ucXVvdGUgfHwgbWFya2V0LnByZWNpc2lvbi5wcmljZSkgOiA4LFxuICAgICAgICAgICAgICAgICAgICB9KSlcbiAgICAgICAgICAgIGNvbnN0IGFsbEN1cnJlbmNpZXMgPSBiYXNlQ3VycmVuY2llcy5jb25jYXQgKHF1b3RlQ3VycmVuY2llcylcbiAgICAgICAgICAgIGNvbnN0IGdyb3VwZWRDdXJyZW5jaWVzID0gZ3JvdXBCeSAoYWxsQ3VycmVuY2llcywgJ2NvZGUnKVxuICAgICAgICAgICAgY29uc3QgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChncm91cGVkQ3VycmVuY2llcykubWFwIChjb2RlID0+XG4gICAgICAgICAgICAgICAgZ3JvdXBlZEN1cnJlbmNpZXNbY29kZV0ucmVkdWNlICgocHJldmlvdXMsIGN1cnJlbnQpID0+XG4gICAgICAgICAgICAgICAgICAgICgocHJldmlvdXMucHJlY2lzaW9uID4gY3VycmVudC5wcmVjaXNpb24pID8gcHJldmlvdXMgOiBjdXJyZW50KSwgZ3JvdXBlZEN1cnJlbmNpZXNbY29kZV1bMF0pKVxuICAgICAgICAgICAgY29uc3Qgc29ydGVkQ3VycmVuY2llcyA9IHNvcnRCeSAoZmxhdHRlbiAoY3VycmVuY2llcyksICdjb2RlJylcbiAgICAgICAgICAgIHRoaXMuY3VycmVuY2llcyA9IGRlZXBFeHRlbmQgKGluZGV4QnkgKHNvcnRlZEN1cnJlbmNpZXMsICdjb2RlJyksIHRoaXMuY3VycmVuY2llcylcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmN1cnJlbmNpZXNfYnlfaWQgPSBpbmRleEJ5ICh0aGlzLmN1cnJlbmNpZXMsICdpZCcpXG4gICAgICAgIHJldHVybiB0aGlzLm1hcmtldHNcbiAgICB9XG5cbiAgICBhc3luYyBsb2FkTWFya2V0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5wdXNoIChbXG4gICAgICAgICAgICAgICAgb2hsY3ZzWyd0J11baV0gKiAxMDAwLFxuICAgICAgICAgICAgICAgIG9obGN2c1snbyddW2ldLFxuICAgICAgICAgICAgICAgIG9obGN2c1snaCddW2ldLFxuICAgICAgICAgICAgICAgIG9obGN2c1snbCddW2ldLFxuICAgICAgICAgICAgICAgIG9obGN2c1snYyddW2ldLFxuICAgICAgICAgICAgICAgIG9obGN2c1sndiddW2ldLFxuICAgICAgICAgICAgXSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBjb252ZXJ0T0hMQ1ZUb1RyYWRpbmdWaWV3IChvaGxjdnMpIHtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICd0JzogW10sXG4gICAgICAgICAgICAnbyc6IFtdLFxuICAgICAgICAgICAgJ2gnOiBbXSxcbiAgICAgICAgICAgICdsJzogW10sXG4gICAgICAgICAgICAnYyc6IFtdLFxuICAgICAgICAgICAgJ3YnOiBbXSxcbiAgICAgICAgfTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBvaGxjdnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIHJlc3VsdFsndCddLnB1c2ggKHBhcnNlSW50IChvaGxjdnNbaV1bMF0gLyAxMDAwKSk7XG4gICAgICAgICAgICByZXN1bHRbJ28nXS5wdXNoIChvaGxjdnNbaV1bMV0pO1xuICAgICAgICAgICAgcmVzdWx0WydoJ10ucHVzaCAob2hsY3ZzW2ldWzJdKTtcbiAgICAgICAgICAgIHJlc3VsdFsnbCddLnB1c2ggKG9obGN2c1tpXVszXSk7XG4gICAgICAgICAgICByZXN1bHRbJ2MnXS5wdXNoIChvaGxjdnNbaV1bNF0pO1xuICAgICAgICAgICAgcmVzdWx0Wyd2J10ucHVzaCAob2hsY3ZzW2ldWzVdKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1x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lclsnc2lkZSddID09PSAnYnV5Jykge1xuICAgICAgICAgICAgICAgIHJldHVybiB0b3RhbCArIChvcmRlclsncHJpY2UnXSAqIHJlbWFpbmluZylcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRvdGFsXG4gICAgICAgICAgICB9XG4gICAgICAgIH0sIDApXG4gICAgfVxuXG4gICAgcGFyc2VCYWxhbmNlIChiYWxhbmNlKSB7XG5cbiAgICAgICAgY29uc3QgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLm9taXQgKGJhbGFuY2UsICdpbmZvJykpO1xuXG4gICAgICAgIGN1cnJlbmNpZXMuZm9yRWFjaCAoKGN1cnJlbmN5KSA9PiB7XG5cbiAgICAgICAgICAgIGlmICh0eXBlb2YgYmFsYW5jZVtjdXJyZW5jeV0udXNlZCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAvLyBleGNoYW5nZSByZXBvcnRzIG9ubHkgJ2ZyZWUnIGJhbGFuY2UgLT4gdHJ5IHRvIGRlcml2ZSAndXNlZCcgZnVuZHMgZnJvbSBvcGVuIG9yZGVycyBjYWNoZVxuXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuZG9udEdldFVzZWRCYWxhbmNlRnJvbVN0YWxlQ2FjaGUgJiYgKCdvcGVuX29yZGVycycgaW4gYmFsYW5jZVsnaW5mbyddKSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBsaXF1aSBleGNoYW5nZSByZXBvcnRzIG51bWJlciBvZiBvcGVuIG9yZGVycyB3aXRoIGJhbGFuY2UgcmVzcG9uc2VcbiAgICAgICAgICAgICAgICAgICAgLy8gdXNlIGl0IHRvIHZhbGlkYXRlIHRoZSBjYWNoZVxuICAgICAgICAgICAgICAgICAgICBjb25zdCBleGNoYW5nZU9yZGVyc0NvdW50ID0gYmFsYW5jZVsnaW5mbyddWydvcGVuX29yZGVycyddO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBjYWNoZWRPcmRlcnNDb3VudCA9IE9iamVjdC52YWx1ZXMgKHRoaXMub3JkZXJzKS5maWx0ZXIgKG9yZGVyID0+IChvcmRlclsnc3RhdHVzJ10gPT09ICdvcGVuJykpLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNhY2hlZE9yZGVyc0NvdW50ID09PSBleGNoYW5nZU9yZGVyc0NvdW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBiYWxhbmNlW2N1cnJlbmN5XS51c2VkID0gdGhpcy5nZXRDdXJyZW5jeVVzZWRPbk9wZW5PcmRlcnMgKGN1cnJlbmN5KVxuICAgICAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVtjdXJyZW5jeV0udG90YWwgPSBiYWxhbmNlW2N1cnJlbmN5XS51c2VkICsgYmFsYW5jZVtjdXJyZW5jeV0uZnJlZVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVtjdXJyZW5jeV0udXNlZCA9IHRoaXMuZ2V0Q3VycmVuY3lVc2VkT25PcGVuT3JkZXJzIChjdXJyZW5jeSlcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVtjdXJyZW5jeV0udG90YWwgPSBiYWxhbmNlW2N1cnJlbmN5XS51c2VkICsgYmFsYW5jZVtjdXJyZW5jeV0uZnJlZVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgWyAnZnJlZScsICd1c2VkJywgJ3RvdGFsJyBdLmZvckVhY2ggKChhY2NvdW50KSA9PiB7XG4gICAgICAgICAgICAgICAgYmFsYW5jZVthY2NvdW50XSA9IGJhbGFuY2VbYWNjb3VudF0gfHwge31cbiAgICAgICAgICAgICAgICBiYWxhbmNlW2FjY291bnRdW2N1cnJlbmN5XSA9IGJhbGFuY2VbY3VycmVuY3ldW2FjY291bnRdXG4gICAgICAgICAg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YXRpb25FcnJvcic6XG4gICAgICAgICAgICAgICAgeyAnUGVybWlzc2lvbkRlbmllZCc6ICAgICAgIHt9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgLCAnSW5zdWZmaWNpZW50RnVuZHMnOiAgICAgICAgICB7fVxuICAgICAgICAgICAgLCAnSW52YWxpZEFkZHJlc3MnOiAgICAgICAgICAgICB7fVxuICAgICAgICAgICAgLCAnSW52YWxpZE9yZGVyJzpcbiAgICAgICAgICAgICAgICB7ICdPcmRlck5vdEZvdW5kJzogICAgICAgICAge31cbiAgICAgICAgICAgICAgICAsICdPcmRlck5vdENhY2hlZCc6ICAgICAgICAge31cbiAgICAgICAgICAgICAgICAsICdDYW5jZWxQZW5kaW5nJzogICAgICAgICAge31cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICwgJ05ldHdvcmtFcnJvcic6XG4gICAgICAgICAgICB7ICdERG9TUHJvdGVjdGlvbic6ICAgICAgICAge31cbiAgICAgICAgICAgICwgJ1JlcXVlc3RUaW1lb3V0JzogICAgICAgICB7fVxuICAgICAgICAgICAgLCAnRXhjaGFuZ2VOb3RBdmFpbGFibGUnOiAgIHt9XG4gICAgICAgICAgICAsICdJbnZhbGlkTm9uY2UnOiAgICAgICAgICAge31cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbilcblxuLyogIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqL1xuXG5mdW5jdGlvbiBzdWJjbGFzcyAoQmFzZUNsYXNzLCBjbGFzc2VzLCBuYW1lc3BhY2UgPSB7fSkge1xuXG4gICAgZm9yIChjb25zdCBbJGNsYXNzLCBzdWJjbGFzc2VzXSBvZiBPYmplY3QuZW50cmllcyAoY2xhc3NlcykpIHtcblxuICAgICAgICBjb25zdCBDbGFzcyA9IE9iamVjdC5hc3Np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IG1hcDpcbiAgICAgIHtcbiAgICAgICAgICB2YWx1ZTE6IFtcbiAgICAgICAgICAgIHsgc29tZUtleTogJ3ZhbHVlMScsIGFub3RoZXJLZXk6ICdhbm90aGVyVmFsdWUxJyB9LFxuICAgICAgICAgICAgeyBzb21lS2V5OiAndmFsdWUxJywgYW5vdGhlcktleTogJ2Fub3RoZXJWYWx1ZTInIH0sXG4gICAgICAgICAgXVxuICAgICAgICAgIHZhbHVlMzogW1xuICAgICAgICAgICAgeyBzb21lS2V5OiAndmFsdWUzJywgYW5vdGhlcktleTogJ2Fub3RoZXJWYWx1ZTMnIH1cbiAgICAgICAgICBdLFxuICAgICAgfVxuICAgICovXG5cbiAgICAsIGdyb3VwQnkgKHgsIGssIG91dCA9IHt9KSB7XG5cbiAgICAgICAgZm9yIChjb25zdCB2IG9mIHZhbHVlcyAoeCkpIHtcbiAgICAgICAgICAgIGlmIChrIGluIHYpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBwID0gdltrXVxuICAgICAgICAgICAgICAgIG91dFtwXSA9IG91dFtwXSB8fCBbXVxuICAgICAgICAgICAgICAgIG91dFtwXS5wdXNoICh2KVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBvdXRcbiAgICB9XG5cbi8qICAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4gICAqL1xuXG4gICAgLypcbiAgICAgICBBY2NlcHRzIGEgbWFwL2FycmF5IG9mIG9iamVjdHMsIGEga2V5IG5hbWUgYW5kIGEga2V5IHZhbHVlIHRvIGJlIHVzZWQgYXMgYSBmaWx0ZXI6XG4gICAgICAgYXJyYXkgPSBbXG4gICAgICAgICAgeyBzb21lS2V5OiAndmFsdWUxJywgYW5vdGhlcktleTogJ2Fub3RoZXJWYWx1ZTEnIH0sXG4gICAgICAgICAgeyBzb21lS2V5OiAndmFsdWUyJywgYW5vdGhlcktleTogJ2Fub3RoZXJWYWx1ZTInIH0sXG4gICAgICAgICAgeyBzb21lS2V5OiAndmFsdWUzJywgYW5vdGhlcktleTogJ2Fub3RoZXJWYWx1ZTMnIH0sXG4gICAgICAgXVxuICAgICAgIGtleSA9ICdzb21lS2V5J1xuICAgICAgIHZhbHVlID0gJ3ZhbHVlMSdcblxuICAgICAgIFJldHVybnMgYW4gYXJyYXk6XG4gICAgICBbXG4gICAgICAgICAgdmFsdWUxOiB7IHNvbWVLZXk6ICd2YWx1ZTEnLCBhbm90aGVyS2V5OiAnYW5vdGhlclZhbHVlMScgfSxcbiAgICAgIF1cbiAgICAqL1xuXG4gICAgLCBmaWx0ZXJCeSAoeCwgaywgdmFsdWUgPSB1bmRlZmluZWQsIG91dCA9IFtdKSB7XG5cbiAgICAgICAgZm9yIChjb25zdCB2IG9mIHZhbHVlcyAoeCkpXG4gICAgICAgICAgICBpZiAodltrXSA9PT0gdmFsdWUpXG4gICAgICAgICAgICAgICAgb3V0LnB1c2ggKHYpXG5cbiAgICAgICAgcmV0dXJuIG91dFxuICAgIH1cblxuLyogIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLiAgICovXG5cbiAgICAsIHNvcnRCeTogKGFycmF5LCAvLyBOQjogTVVUQVRFUyBBUlJBWSFcbiAgICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgIGRlc2NlbmRpbmcgPSBmYWxzZSxcbiAgICAgICAgICAgICAgIGRpcmVjdGlvbiAgPSBkZXNjZW5kaW5nID8gLTEgOiAxKSA9PiBhcnJheS5zb3J0ICgoYSwgYikgPT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGFba2V5XSA8IGJba2V5XSkgPyAtZGlyZWN0aW9uIDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGFba2V5XSA+IGJba2V5XSkgPyAgZGlyZWN0aW9uIDogMCkpKVxuXG4vKiAgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgKi9cblxuICAgICwgZmxhdHRlbjogZnVuY3Rpb24gZmxhdHRlbiAoeCwgb3V0ID0gW10pIHtcblxuICAgICAgICBmb3IgKGNvbnN0IHYgb2YgeCkge1xuICAgICAgICAgICAgaWYgKGlzQXJyYXkgKHYpKSBmbGF0dGVuICh2LCBvdXQpXG4gICAgICAgICAgICBlbHNlIG91dC5wdXNoICh2KVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIG91dFxuICAgIH1cblxuLyogIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLiAgICovXG5cbiAgICAsIHBsdWNrOiAoeCwgaykgPT4gdmFsdWVzICh4KVxuICAgICAgICAgICAgICAgICAgICAgICAgLmZpbHRlciAodiA9PiBrIGluIHYpXG4gICAgICAgICAgICAgICAgICAgICAgICAubWFwICh2ID0+IHZba10pXG5cbi8qICAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4gICAqL1xuXG4gICAgLCBvbWl0ICh4LCAuLi5hcmdzKSB7XG5cbiAgICAgICAgY29uc3Qgb3V0ID0gY2xvbmUgKHgpXG5cbiAgICAgICAgZm9yIChjb25zdCBrIG9mIGFyZ3MpIHtcblxuICAgICAgICAgICAgaWYgKGlzQXJyYXkgKGspKSAvLyBvbWl0ICh4LCBbJ2EnLCAnYiddKVxuICAgICAgICAgICAgICAgIGZvciAoY29uc3Qga2sgb2YgaylcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIG91dFtra11cblxuICAgICAgICAgICAgZWxzZSBkZWxldGUgb3V0W2tdIC8vIG9taXQgKHgsICdhJywgJ2InKVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIG91dFxuICAgIH1cblxuLyogIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLiAgICovXG5cbiAgICAsIHN1bSAoLi4ueHMpIHtcblxuICAgICAgICBjb25zdCBucyA9IHhzLmZpbHRlciAoaXNOdW1iZXIpIC8vIGxlYXZlIG9ubHkgbnVtYmVyc1xuXG4gICAgICAgIHJldHVybiAobnMubGVuZ3RoID4gMClcbiAgICAgICAgICAgICAgICAgICAgPyBucy5yZWR1Y2UgKChhLCBiKSA9PiBhICsgYiwgMClcbiAgICAgICAgICAgICAgICAgICAgOiB1bmRlZmluZWRcbiAgICB9XG5cbi8qICAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4gICAqL1xuXG4gICAgLCBkZWVwRXh0ZW5kOiBmdW5jdGlvbiBkZWVwRXh0ZW5kICguLi54cykge1xuXG4gICAgICAgIGxldCBvdXQgPSB1bmRlZmluZWRcblxuICAgICAgICBmb3IgKGNvbnN0IHggb2YgeHMpIHtcblxuICAgICAgICAgICAgaWYgKGlzRGljdGlvbmFyeSAoeCkpIHtcblxuICAgICAgICAgICAgICAgIGlmICghaXNPYmplY3QgKG91dCkpXG4gICAgICAgICAgICAgICAgICAgIG91dCA9IHt9XG5cbiAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IGsgaW4geClcbiAgICAgICAgICAgICAgICAgICAgb3V0W2tdID0gZGVlcEV4dGVuZCAob3V0W2tdLCB4W2tdKVxuXG4gICAgICAgICAgICB9IGVsc2Ugb3V0ID0geFxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIG91dFxuICAgIH1cblxuLyogIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqL1xuXG59XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vLS0tLS0tLS0tLS0tLS0tLS0tLS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0tLS0tLS0tLS0tLS0tICovXG5cbmNvbnN0IGRlY2ltYWxUb1ByZWNpc2lvbiA9ICh4LCByb3VuZGluZ01vZGVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLCBudW1QcmVjaXNpb25EaWdpdHNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLCBjb3VudGluZ01vZGUgICAgICAgPSBERUNJTUFMX1BMQUNFU1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAsIHBhZGRpbmdNb2RlICAgICAgICA9IE5PX1BBRERJTkcpID0+IHtcblxuICAgIGlmIChudW1QcmVjaXNpb25EaWdpdHMgPCAwKSB0aHJvdyBuZXcgRXJyb3IgKCduZWdhdGl2ZSBwcmVjaXNpb24gaXMgbm90IHlldCBzdXBwb3J0ZWQnKVxuXG4vKiAgQ29udmVydCB0byBhIHN0cmluZyAoaWYgbmVlZGVkKSwgc2tpcCBsZWFkaW5nIG1pbnVzIHNpZ24gKGlmIGFueSkgICAqL1xuXG4gICAgY29uc3Qgc3RyICAgICAgICAgID0gbnVtYmVyVG9TdHJpbmcgKHgpXG4gICAgICAgICwgaXNOZWdhdGl2ZSAgID0gc3RyWzBdID09PSAnLSdcbiAgICAgICAgLCBzdHJTdGFydCAgICAgPSBpc05lZ2F0aXZlID8gMSA6IDBcbiAgICAgICAgLCBzdHJFbmQgICAgICAgPSBzdHIubGVuZ3RoXG5cbi8qICBGaW5kIHRoZSBkb3QgcG9zaXRpb24gaW4gdGhlIHNvdXJjZSBidWZmZXIgICAqL1xuXG4gICAgZm9yICh2YXIgc3RyRG90ID0gMDsgc3RyRG90IDwgc3RyRW5kOyBzdHJEb3QrKylcbiAgICAgICAgaWYgKHN0cltzdHJEb3RdID09PSAnLicpXG4gICAgICAgICAgICBicmVha1xuXG4gICAgY29uc3QgaGFzRG90ID0gc3RyRG90IDwgc3RyLmxlbmd0aFxuXG4vKiAgQ2hhciBjb2RlIGNvbnN0YW50cyAgICAgICAgICovXG5cbiAgICBjb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4YW1wbGUpOlxuXG4gICAgICAgIHN0ZXAgID0gICAgICAgICAgaT0zICAgICAgaT0yICAgICAgaT0xICAgICAgaT0wXG5cbiAgICAgICAgY2hhcnMgPSAgICAgICAgIDA5OTkgICAgIDA5OTkgICAgIDA5MDAgICAgIDEwMDBcbiAgICAgICAgbWVtbyAgPSAgICAgICAgIC0tLTAgICAgIC0tMS0gICAgIC0xLS0gICAgIDAtLS0gICAgICAgICAgICAgICAgICAgICAqL1xuXG4gICAgZm9yIChsZXQgaSA9IGNoYXJzLmxlbmd0aCAtIDEsIG1lbW8gPSAwOyBpID49IDA7IGktLSkge1xuXG4gICAgICAgIGxldCBjID0gY2hhcnNbaV1cblxuICAgICAgICBpZiAoaSAhPT0gMCkge1xuICAgICAgICAgICAgYyArPSBtZW1vXG5cbiAgICAgICAgICAgIGlmIChpID49IChwcmVjaXNpb25TdGFydCArIG51bVByZWNpc2lvbkRpZ2l0cykpIHtcblxuICAgICAgICAgICAgICAgIGNvbnN0IGNlaWwgPSAocm91bmRpbmdNb2RlID09PSBST1VORCkgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGMgPj0gRklWRSkgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAhKChjID09PSBGSVZFKSAmJiBtZW1vKSAvLyBwcmV2ZW50cyByb3VuZGluZyBvZiAxLjQ1IHRvIDJcblxuICAgICAgICAgICAgICAgIGMgPSBjZWlsID8gKE5JTkUgKyAxKSA6IFpFUk9cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjID4gTklORSkgeyBjID0gWkVSTzsgbWVtbyA9IDE7IH1cbiAgICAgICAgICAgIGVsc2UgbWVtbyA9IDBcblxuICAgICAgICB9IGVsc2UgaWYgKG1lbW8pIGMgPSBPTkUgLy8gbGVhZGluZyBleHRyYSBkaWdpdCAoMDkwMCDihpIgMTAwMClcblxuICAgICAgICBjaGFyc1tpXSA9IGNcblxuICAgICAgICBpZiAoYyAhPT0gWkVSTykge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MTIzKS40NTZcbiAgICAgICAgLCBuQWZ0ZXJEb3QgICAgID0gbWF4IChyZWFkRW5kIC0gYWZ0ZXJEb3QsIDApICAgICAgICAgICAgIC8vIC0xMjMuKDQ1NilcbiAgICAgICAgLCBhY3R1YWxMZW5ndGggID0gICAgIChyZWFkRW5kIC0gcmVhZFN0YXJ0KSAgICAgICAgICAgICAgIC8vIC0oMTIzLjQ1NilcbiAgICAgICAgLCBkZXNpcmVkTGVuZ3RoID0gICAgIChwYWRkaW5nTW9kZSA9PT0gTk9fUEFERElORylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gKGFjdHVhbExlbmd0aCkgICAgICAgICAgICAgIC8vIC0oMTIzLjQ1NilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHByZWNpc2lvbkVuZCAtIHJlYWRTdGFydCkgIC8vIC0oMTIzLjQ1NiAgICApXG5cbiAgICAgICAgLCBwYWQgICAgICAgICAgID0gbWF4IChkZXNpcmVkTGVuZ3RoIC0gYWN0dWFsTGVuZ3RoLCAwKSAgIC8vICAtMTIzLjQ1NiggICAgKVxuICAgICAgICAsIHBhZFN0YXJ0ICAgICAgPSAgICAgKG5CZWZvcmVEb3QgKyAxICsgbkFmdGVyRG90KSAgICAgICAgLy8gIC0xMjMuNDU2KCApXG4gICAgICAgICwgcGFkRW5kICAgICAgICA9ICAgICAocGFkU3RhcnQgKyBwYWQpICAgICAgICAgICAgICAgICAgICAvLyAgLTEyMy40NTYgICAgICggKVxuICAgICAgICAsIGlzSW50ZWdlciAgICAgPSAgICAgKG5BZnRlckRvdCArIHBhZCkgPT09IDAgICAgICAgICAgICAgLy8gIC0xMjNcblxuLyogIEZpbGwgdGhlIG91dHB1dCBidWZmZXIgd2l0aCBjaGFyYWN0ZXJzICAgICovXG5cbiAgICBjb25zdCBvdXQgPSBuZXcgVWludDhBcnJheSAobkJlZm9yZURvdCArIChpc0ludGVnZXIgPyAwIDogMSkgKyBuQWZ0ZXJEb3QgKyBwYWQpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuICAgIGlmICAoaXNOZWdhdGl2ZSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dFswXSAgICAgICAgICA9IE1JTlVTICAgICAvLyAtICAgICBtaW51cyBzaWduXG4gICAgZm9yIChpID0gblNpZ24sIGogPSByZWFkU3RhcnQ7ICAgICAgICAgIGkgPCBuQmVmb3JlRG90OyBpKyssIGorKykgb3V0W2ldICAgICAgICAgID0gY2hhcnNbal0gIC8vIDEyMyAgIGJlZm9yZSBkb3RcbiAgICBpZiAgKCFpc0ludGVnZXIpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRbbkJlZm9yZURvdF0gPSBET1QgICAgICAgLy8gLiAgICAgZG90XG4gICAgZm9yIChpID0gbkJlZm9yZURvdCArIDEsIGogPSBhZnRlckRvdDsgIGkgPCBwYWRTdGFydDsgICBpKyssIGorKykgb3V0W2ldICAgICAgICAgID0gY2hhcnNbal0gIC8vIDQ1NiAgIGFmdGVyIGRvdFxuICAgIGZvciAoaSA9IHBhZFN0YXJ0OyAgICAgICAgICAgICAgICAgICAgICBpIDwgcGFkRW5kOyAgICAgaSsrKSAgICAgIG91dFtpXSAgICAgICAgICA9IFpFUk8gICAgICAvLyAwMDAgICBwYWRkaW5nXG5cbi8qICBCdWlsZCBhIHN0cmluZyBmcm9tIHRoZSBvdXRwdXQgYnVmZmVyICAgICAqL1xuXG4gICAgcmV0dXJuIFN0cmluZy5mcm9tQ2hhckNvZGUgKC4uLm91dClcbn1cblxuLyogIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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xdWV1ZS5wdXNoICh7IGNvc3QsIHJlc29sdmUsIHJlamVjdCB9KVxuXG4gICAgICAgICAgICAgICAgICAgIGlmICghcnVubmluZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcnVubmluZyA9IHRydWVcbiAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChxdWV1ZS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgaGFzRW5vdWdoVG9rZW5zID0gY2ZnLmNhcGFjaXR5ID8gKG51bVRva2VucyA+IDApIDogKG51bVRva2VucyA+PSAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoYXNFbm91Z2hUb2tlbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHF1ZXVlLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB7IGNvc3QsIHJlc29sdmUsIHJlamVjdCB9ID0gcXVldWVbMF1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvc3QgPSAoY29zdCB8fCBjZmcuZGVmYXVsdENvc3QpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobnVtVG9rZW5zID49IE1hdGgubWluIChjb3N0LCBjZmcuY2FwYWNpdHkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtVG9rZW5zIC09IGNvc3RcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWV1ZS5zaGlmdCAoKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUgKClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICA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mV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogZmFsc2UsIC8vIG9yIHRoZXkgd2lsbCByZXR1cm4gaHR0cHM6Ly9naXRodWIuY29tL2NjeHQvY2N4dC9pc3N1ZXMvMjMzOFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtaW4nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bWluJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bWluJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbWluJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMWhvdXInLFxuICAgICAgICAgICAgICAgICc4aCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICdkYXknLFxuICAgICAgICAgICAgICAgICcxdyc6ICd3ZWVrJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM0OTAyNjExLTJiZThiZjFhLWY4MzAtMTFlNy05MWEyLTExYjJmMjkyZTc1MC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuYmlib3guY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpYm94LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9CaWJveGNvbS9hcGlfcmVmZXJlbmNlL3dpa2kvaG9tZV9lbicsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vQmlib3hjb20vYXBpX3JlZmVyZW5jZS93aWtpL2FwaV9yZWZlcmVuY2UnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9iaWJveC56ZW5kZXNrLmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDQ0MTcwMTMtRmVlLVN0cnVjdHVyZS1vbi1CaWJveCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IHJld29yayBmb3IgZnVsbCBlbmRwb2ludC9jbWQgcGF0aHMgaGVyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ21kYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZGF0YScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJwZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7fSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7fSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcyMDIxJzogSW5zdWZmaWNpZW50RnVuZHMsIC8vIEluc3VmZmljaWVudCBiYWxhbmNlIGF2YWlsYWJsZSBmb3Igd2l0aGRyYXdhbFxuICAgICAgICAgICAgICAgICcyMDE1JzogQXV0aGVudGljYXRpb25FcnJvciwgLy8gR29vZ2xlIGF1dGhlbnRpY2F0b3IgaXMgd3JvbmdcbiAgICAgICAgICAgICAgICAnMjAzMyc6IE9yZGVyTm90Rm91bmQsIC8vIG9wZXJhdGlvbiBmYWlsZWQhIE9yZGVycyBoYXZlIGJlZW4gY29tcGxldGVkIG9yIHJldm9rZWRcbiAgICAgICAgICAgICAgICAnMjA2Nyc6IEludmFsaWRPcmRlciwgLy8gRG9lcyBub3Qgc3VwcG9ydCBtYXJrZXQgb3JkZXJzXG4gICAgICAgICAgICAgICAgJzIwNjgnOiBJbnZhbGlkT3JkZXIsIC8vIFRoZSBudW1iZXIgb2Ygb3JkZXJzIGNhbiBub3QgYmUgbGVzcyB0aGFuXG4gICAgICAgICAgICAgICAgJzMwMTInOiBBdXRoZW50aWNhdGlvbkVycm9yLCAvLyBpbnZhbGlkIGFwaUtleVxuICAgICAgICAgICAgICAgICczMDI0JzogUGVybWlzc2lvbkRlbmllZCwgLy8gd3JvbmcgYXBpa2V5IHBlcm1pc3Npb25zXG4gICAgICAgICAgICAgICAgJzMwMjUnOiBBdXRoZW50aWNhdGlvbkVycm9yLCAvLyBzaWduYXR1cmUgZmFpbGVkXG4gICAgICAgICAgICAgICAgJzQwMDAnOiBFeGNoYW5nZU5vdEF2YWlsYWJsZSwgLy8gY3VycmVudCBuZXR3b3JrIGlzIHVuc3RhYmxlXG4gICAgICAgICAgICAgICAgJzQwMDMnOiBERG9TUHJvdGVjdGlvbiwgLy8gc2VydmVyIGJ1c3kgcGxlYXNlIHRyeSBhZ2FpbiBsYXRlclxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdLRVknOiAnQmlodScsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWRhdGEgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY21kJzogJ21hcmtldEFsbCcsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnY29pbl9zeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gbWFya2V0WydjdXJyZW5jeV9zeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IGlkID0gYmFzZSArICdfJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIC8vIHdlIGRvbid0IHNldCB2YWx1ZXMgdGhhdCBhcmUgbm90IGRlZmluZWQgYnkgdGhlIGV4Y2hhbmdlXG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnNhZmVJbnRlZ2VyICh0aWNrZXIsICd0aW1lc3RhbXAnKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGlja2VyWydjb2luX3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGlja2VyWydjdXJyZW5jeV9zeW1ib2wnXTtcbiAgICAgICAgICAgIHN5bWJvbCA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKSArICcvJyArIHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgIH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FmZUludGVnZXIgKHRyYWRlLCAnb3JkZXJfc2lkZScsIHNpZGUpO1xuICAgICAgICBzaWRlID0gKHNpZGUgPT09IDEpID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIGlmICh0eXBlb2YgbWFya2V0ID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgbGV0IG1hcmtldElkID0gdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ3BhaXInKTtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgbWFya2V0SWQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIGlmIChtYXJrZXRJZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFttYXJrZXRJZF07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHN5bWJvbCA9ICh0eXBlb2YgbWFya2V0ICE9PSAndW5kZWZpbmVkJykgPyBtYXJrZXRbJ3N5bWJvbCddIDogdW5kZWZpbmVkO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2ZlZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2ZlZScpLFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdpZCcpLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgIC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xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IDg7XG4gICAgICAgICAgICBsZXQgZGVwb3NpdCA9IGN1cnJlbmN5WydlbmFibGVfZGVwb3NpdCddO1xuICAgICAgICAgICAgbGV0IHdpdGhkcmF3ID0gY3VycmVuY3lbJ2VuYWJsZV93aXRoZHJhdyddO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChkZXBvc2l0ICYmIHdpdGhkcmF3KSA/IHRydWUgOiBmYWxzZTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WyduYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYW5zZmVyICh7XG4gICAgICAgICAgICAnY21kJzogJ3RyYW5zZmVyL2Fzc2V0cycsXG4gICAgICAgICAgICAnYm9keSc6IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3NlbGVjdCc6IDEsXG4gICAgICAgICAgICB9LCBwYXJhbXMpLFxuICAgICAgICB9KTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBpbmRleGVkID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2Fzc2V0c19saXN0JyBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgaW5kZXhlZCA9IHRoaXMuaW5kZXhCeSAoYmFsYW5jZXNbJ2Fzc2V0c19saXN0J10sICdjb2luX3N5bWJvbCcpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaW5kZXhlZCA9IGJhbGFuY2VzO1xuICAgICAgICB9XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKGluZGV4ZWQpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGtleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNbaV07XG4gICAgICAgICAgICBsZXQgY29kZSA9IGlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgaWYgKGNvZGUuaW5kZXhPZiAoJ1RPVEFMXycpID49IDApIHtcbiAgICAgICAgICAgICAgICBjb2RlID0gY29kZS5zbGljZSAoNik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoY29kZSBpbiB0aGlzLmN1cnJlbmNpZXNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBjb2RlID0gdGhpcy5jdXJyZW5jaWVzX2J5X2lkW2NvZGVdWydjb2RlJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gaW5kZXhlZFtpZF07XG4gICAgICAgICAgICBpZiAodHlwZW9mIGJhbGFuY2UgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgYmFsYW5jZSA9IHBhcnNlRmxvYXQgKGJhbGFuY2UpO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGJhbGFuY2U7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gMC4wO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBiYWxhbmNlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBhY2NvdW50W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ICAgICAgICAgICAgICAgJ29yZGVyX3NpZGUnOiBvcmRlclNpZGUsXG4gICAgICAgICAgICAgICAgJ3BheV9iaXgnOiAwLFxuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICB9LCBwYXJhbXMpLFxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAncmVzdWx0JyksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlcnBlbmRpbmcgKHtcbiAgICAgICAgICAgICdjbWQnOiAnb3JkZXJwZW5kaW5nL2NhbmNlbFRyYWRlJyxcbiAgICAgICAgICAgICdib2R5JzogdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnb3JkZXJzX2lkJzogaWQsXG4gICAgICAgICAgICB9LCBwYXJhbXMpLFxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG9yZGVyWydjb2luX3N5bWJvbCddICsgJy8nICsgb3JkZXJbJ2N1cnJlbmN5X3N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c3RhdHVzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKG9yZGVyLCAnaWQnKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCA/IGNvc3QgOiBwYXJzZUZsb2F0IChwcmljZSkgKiBmaWxsZWQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZmVlJyksXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlclN0YXR1cyAoc3RhdHVzKSB7XG4gICAgICAgIGxldCBzdGF0dXNlcyA9IHtcbiAgICAgICAgICAgIC8vIG9yaWdpbmFsIGNvbW1lbnRzIGZyb20gYmlib3g6XG4gICAgICAgICAgICAnMSc6ICdwZW5kaW5nJywgLy8gcGVuZGluZ1xuICAgICAgICAgICAgJzInOiAnb3BlbicsIC8vIHBhcnQgY29tcGxldGVkXG4gICAgICAgICAgICA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W5jeSAoY29kZSk7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VHJhbnNmZXIgKHtcbiAgICAgICAgICAgICAgICAnY21kJzogJ3RyYW5zZmVyL3RyYW5zZmVyT3V0SW5mbycsXG4gICAgICAgICAgICAgICAgJ2JvZHknOiB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICAgICAnY29pbl9zeW1ib2wnOiBjdXJyZW5jeVsnaWQnXSxcbiAgICAgICAgICAgICAgICB9LCBwYXJhbXMpLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBpbmZvW2NvZGVdID0gcmVzcG9uc2U7XG4gICAgICAgICAgICB3aXRoZHJhd0ZlZXNbY29kZV0gPSByZXNwb25zZVsncmVzdWx0J11bJ3dpdGhkcmF3X2ZlZSddO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IGluZm8sXG4gICAgICAgICAgICAnd2l0aGRyYXcnOiB3aXRoZHJhd0ZlZXMsXG4gICAgICAgICAgICAnZGVwb3NpdCc6IHt9LFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBsZXQgY21kcyA9IHRoaXMuanNvbiAoWyBwYXJhbXMgXSk7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAobWV0aG9kICE9PSAnR0VUJylcbiAgICAgICAgICAgICAgICBib2R5ID0geyAnY21kcyc6IGNtZHMgfTtcbiAgICAgICAgICAgIGVsc2UgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB7XG4gICAgICAgICAgICAgICAgJ2NtZHMnOiBjbWRzLFxuICAgICAgICAgICAgICAgICdhcGlrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnc2lnbic6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGNtZHMpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnbWQ1JyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2YgYm9keSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChib2R5LCB7ICdjb252ZXJ0QXJyYXlzVG9PYmplY3RzJzogdHJ1ZSB9KTtcbiAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyB9O1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoYm9keS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgaWYgKCdlcnJvcicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCdjb2RlJyBpbiByZXNwb25zZVsnZXJyb3InXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlWydlcnJvciddLCAnY29kZScpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGZlZWRiYWNrID0gdGhpcy5pZCArICcgJyArIGJvZHk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBleGNlcHRpb25zID0gdGhpcy5leGNlcHRpb25zO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGUgaW4gZXhjZXB0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBleGNlcHRpb25zW2NvZGVdIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnOiBcImVycm9yXCIgaW4gcmVzcG9uc2U6ICcgKyBib2R5KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCEoJ3Jlc3VsdCcgaW4gcmVzcG9uc2UpKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVh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HtcbiAgICAgICAgICAgICdpZCc6ICdiaW5hbmNlJyxcbiAgICAgICAgICAgICduYW1lJzogJ0JpbmFuY2UnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdKUCcsIC8vIEphcGFuXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogNTAwLFxuICAgICAgICAgICAgLy8gbmV3IG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hEZXBvc2l0QWRkcmVzcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hCaWRzQXNrcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRnVuZGluZ0ZlZXMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzNtJzogJzNtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMmgnLFxuICAgICAgICAgICAgICAgICc0aCc6ICc0aCcsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnOGgnOiAnOGgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgICAgICczZCc6ICczZCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzF3JyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjk2MDQwMjAtZDU0ODNjZGMtODdlZS0xMWU3LTk0YzctZDFhOGQ5MTY5MjkzLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL3d3dy5iaW5hbmNlLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICd3YXBpJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL3dhcGkvdjMnLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL2FwaS92MScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL2FwaS92MycsXG4gICAgICAgICAgICAgICAgICAgICd2Myc6ICdodHRwczovL2FwaS5iaW5hbmNlLmNvbS9hcGkvdjMnLFxuICAgICAgICAgICAgICAgICAgICAndjEnOiAnaHR0cHM6Ly9hcGkuYmluYW5jZS5jb20vYXBpL3YxJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYmluYW5jZS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2JpbmFuY2UtZXhjaGFuZ2UvYmluYW5jZS1vZmZpY2lhbC1hcGktZG9jcy9ibG9iL21hc3Rlci9yZXN0LWFwaS5tZCcsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpbmFuY2UuemVuZGVzay5jb20vaGMvZW4tdXMvYXJ0aWNsZXMvMTE1MDAwNDI5MzMyJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5iaW5hbmNlLmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDA1ODMzMTEnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnd2ViJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3B1YmxpYy9wcm9kdWN0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3YXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdEhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3SGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRTdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5c3RlbVN0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdGZWUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3YzJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci9wcmljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL2Jvb2tUaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZUluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhZ2dUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2tsaW5lcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyLzI0aHInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci9hbGxQcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci9hbGxCb29rVGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3ByaWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvYm9va1RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2VJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFsgJ3VzZXJEYXRhU3RyZWFtJyBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFsgJ3VzZXJEYXRhU3RyZWFtJyBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogWyAndXNlckRhdGFTdHJlYW0nIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWxsT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteVRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci90ZXN0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIC8vIHNob3VsZCBiZSBkZWxldGVkLCB0aGVzZSBhcmUgb3V0ZGF0ZWQgYW5kIGluYWNjdXJhdGVcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQURBJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEWCc6IDQuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSU9OJzogMS45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNQic6IDExLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVBQQyc6IDYuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUksnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJOJzogMy4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FTVCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFUJzogMTguMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0QnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNQVCc6IDEwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOQic6IDAuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTlQnOiAxLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlFYJzogMS42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JSRCc6IDYuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVE0nOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRTJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEVCc6IDY3LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ01UJzogMzcuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTkQnOiA0Ny4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUUic6IDUuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdEJzogMC4wNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdETFQnOiAxMS43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROVCc6IDUxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMi41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMRic6IDYuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTkcnOiAyLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5KJzogNDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEYnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVlgnOiAyLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVFTCc6IDQ1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVOJzogODUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dUTyc6IDIwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1ZUJzogMC41MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHWFMnOiAwLjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSENDJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAzLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNYJzogMS4zLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lOUyc6IDEuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJT1RBJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tNRCc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tOQyc6IDIuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMRU5EJzogNTQuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSU5LJzogMTIuOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMTFQnOiA1NC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDkuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMU0snOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVU4nOiAwLjI5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BTkEnOiA3NC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DTyc6IDAuODYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTURBJzogNC43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01PRCc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEgnOiAzNC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01UTCc6IDEuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOQVYnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVCTCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05VTFMnOiAyLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0FYJzogOC4zLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1NUJzogMTcuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0UnOiA4OC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPV1InOiA4LjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBUJzogMC4yNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRU1AnOiAyMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JDTic6IDM1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkROJzogMi4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUSc6IDE4LjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkxDJzogNC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NBTFQnOiAxLjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0JUQyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDQyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOTSc6IDI5LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMzIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVE9SSic6IDUuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiA3LjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5CJzogODIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTlQnOiA0Ny4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSSUcnOiA2LjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJYJzogMTI5LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDIzLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVOJzogMS44LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQic6IDI4LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCRSc6IDcuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdXQUJJJzogMy41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dBVkVTJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOR1MnOiA5LjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hMTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLjI1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hWRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYWkMnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lPWU9XJzogMzkuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiA1LjcsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge30sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnWU9ZTyc6ICdZT1lPVycsXG4gICAgICAgICAgICAgICAgJ0JDQyc6ICdCQ0gnLFxuICAgICAgICAgICAgICAgICdOQU5PJzogJ1hSQicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gZXh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cy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIHRoaXMub3B0aW9uc1sndGltZURpZmZlcmVuY2UnXSA9IHBhcnNlSW50IChhZnRlciAtIHJlc3BvbnNlWydzZXJ2ZXJUaW1lJ10pO1xuICAgICAgICByZXR1cm4gdGhpcy5vcHRpb25zWyd0aW1lRGlmZmVyZW5jZSddO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0RXhjaGFuZ2VJbmZvICgpO1xuICAgICAgICBpZiAodGhpcy5vcHRpb25zWydhZGp1c3RGb3JUaW1lRGlmZmVyZW5jZSddKVxuICAgICAgICAgICAgYXdhaXQgdGhpcy5sb2FkVGltZURpZmZlcmVuY2UgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3N5bWJvbHMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIC8vIFwiMTIzNDU2XCIgaXMgYSBcInRlc3Qgc3ltYm9sL21hcmtldFwiXG4gICAgICAgICAgICBpZiAoaWQgPT09ICcxMjM0NTYnKVxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnYmFzZUFzc2V0J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsncXVvdGVBc3NldCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgZmlsdGVycyA9IHRoaXMuaW5kZXhCeSAobWFya2V0WydmaWx0ZXJzJ10sICdmaWx0ZXJUeXBlJyk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdiYXNlJzogbWFya2V0WydiYXNlQXNzZXRQcmVjaXNpb24nXSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBtYXJrZXRbJ3F1b3RlUHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYmFzZUFzc2V0UHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydxdW90ZVByZWNpc2lvbiddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAobWFya2V0WydzdGF0dXMnXSA9PT0gJ1RSQURJTkcnKTtcbiAgICAgICAgICAgIC8vIGxvdCBzaXplIGlzIGRlcHJlY2F0ZWQgYXMgb2YgMjAxOC4wMi4wNlxuICAgICAgICAgICAgbGV0IGxvdCA9IC0xICogTWF0aC5sb2cxMCAocHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICBsZXQgZW50cnkgPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCwgLy8gbG90IHNpemUgaXMgZGVwcmVjYXRlZCBhcyBvZiAyMDE4LjAyLjA2XG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoJ1BSSUNFX0ZJTFRFUicgaW4gZmlsdGVycykge1xuICAgICAgICAgICAgICAgIGxldCBmaWx0ZXIgPSBmaWx0ZXJzWydQUklDRV9GSUxURVInXTtcbiAgICAgICAgICAgICAgICBlbnRyeVsncHJlY2lzaW9uJ11bJ3ByaWNlJ10gPSB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKGZpbHRlclsndGlja1NpemUnXSk7XG4gICAgICAgICAgICAgICAgZW50cnlbJ2xpbWl0cyddWydwcmljZSddID0ge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKGZpbHRlciwgJ21pblByaWNlJyksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAoZmlsdGVyLCAnbWF4UHJpY2UnKSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdMT1RfU0laRScgaW4gZmlsdGVycykge1xuICAgICAgICAgICAgICAgIGxldCBmaWx0ZXIgPSBmaWx0ZXJzWydMT1RfU0laRSddO1xuICAgICAgICAgICAgICAgIGVudHJ5WydwcmVjaXNpb24nXVsnYW1vdW50J10gPSB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKGZpbHRlclsnc3RlcFNpemUnXSk7XG4gICAgICAgICAgICAgICAgZW50cnlbJ2xvdCddID0gdGhpcy5zYWZlRmxvYXQgKGZpbHRlciwgJ3N0ZXBTaXplJyk7IC8vIGxvdCBzaXplIGlzIGRlcHJlY2F0ZWQgYXMgb2YgMjAxOC4wMi4wNlxuICAgICAgICAgICAgICAgIGVudHJ5WydsaW1pdHMnXVsnYW1vdW50J10gPSB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAoZmlsdGVyLCAnbWluUXR5JyksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAoZmlsdGVyLCAnbWF4UXR5JyksXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICgnTUlOX05PVElPTkFMJyBpbiBmaWx0ZXJzKSB7XG4gICAgICAgICAgICAgICAgZW50cnlbJ2xpbWl0cyddWydjb3N0J11bJ21pbiddID0gcGFyc2VGbG9hdCAoZmlsdGVyc1snTUlOX05PVElPTkFMJ11bJ21pbk5vdGlvbmFsJ10pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKGVudHJ5KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGNhbGN1bGF0ZUZlZSAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlLCB0YWtlck9yTWFrZXIgPSAndGFrZXInLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgIGxldCBrZXkgPSAncXVvdGUnO1xuICAgICAgICBsZXQgcmF0ZSA9IG1hcmtldFt0YWtlck9yTWFrZXJdO1xuICAgICAgICBsZXQgY29zdCA9IHBhcnNlRmxvYXQgKHRoaXMuY29zdFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCAqIHJhdGUpKTtcbiAgICAgICAgaWYgKHNpZGUgPT09ICdzZWxsJykge1xuICAgICAgICAgICAgY29zdCAqPSBwcmljZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGtleSA9ICdiYXNlJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3R5cGUnOiB0YWtlck9yTWFrZXIsXG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRba2V5XSxcbiAgICAgICAgICAgICdyYXRlJzogcmF0ZSxcbiAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAodGhpcy5mZWVUb1ByZWNpc2lvbiAoc3ltYm9sLCBjb3N0KSksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRBY2NvdW50IChwYXJhbXMpO1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iAgICAgICAgICAgICAgICAnY3VycmVuY3knOiB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAodHJhZGVbJ2NvbW1pc3Npb25Bc3NldCddKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRha2VyT3JNYWtlciA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdpc01ha2VyJyBpbiB0cmFkZSlcbiAgICAgICAgICAgIHRha2VyT3JNYWtlciA9IHRyYWRlWydpc01ha2VyJ10gPyAnbWFrZXInIDogJ3Rha2VyJztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVyLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGFrZXJPck1ha2VyJzogdGFrZXJPck1ha2VyLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IHByaWNlICogYW1vdW50LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V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SAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHNpZGUgPSBzaWRlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGlzbzg2MDEsXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICAvLyB0aGUgbmV4dCA1IGxpbmVzIGFyZSBhZGRlZCB0byBzdXBwb3J0IGZvciB0ZXN0aW5nIG9yZGVyc1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3ByaXZhdGVQb3N0T3JkZXInO1xuICAgICAgICBsZXQgdGVzdCA9IHRoaXMuc2FmZVZhbHVlIChwYXJhbXMsICd0ZXN0JywgZmFsc2UpO1xuICAgICAgICBpZiAodGVzdCkge1xuICAgICAgICAgICAgbWV0aG9kICs9ICdUZXN0JztcbiAgICAgICAgICAgIHBhcmFtcyA9IHRoaXMub21pdCAocGFyYW1zLCAndGVzdCcpO1xuICAgICAgICB9XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAncXVhbnRpdHknOiB0aGlzLmFtb3VudFRvU3RyaW5nIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUudG9VcHBlckNhc2UgKCksXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09PSAnbGltaXQnKSB7XG4gICAgICAgICAgICBvcmRlclsndHlwZSddID0gdGhpcy5vcHRpb25zWydkZWZhdWx0TGltaXRPcmRlclR5cGUnXS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIG9yZGVyID0gdGhpcy5leHRlbmQgKG9yZGVyLCB7XG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmljZVRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlKSxcbiAgICAgICAgICAgICAgICAndGltZUluRm9yY2UnOiAnR1RDJywgLy8gJ0dUQycgPSBHb29kIFRvIENhbmNlbCAoZGVmYXVsdCksICdJT0MnID0gSW1tZWRpYXRlIE9yIENhbmNlbFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PT0gJ2xpbWl0X21ha2VyJykge1xuICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSB0aGlzLnByaWNlVG9QcmVjaXNpb24gKHN5bW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AgICAgICAgICdhc3NldCc6IGN1cnJlbmN5WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydzdWNjZXNzJ10pIHtcbiAgICAgICAgICAgICAgICBsZXQgYWRkcmVzcyA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdhZGRyZXNzJyk7XG4gICAgICAgICAgICAgICAgbGV0IHRhZyA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdhZGRyZXNzVGFnJyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY29kZSxcbiAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3MnOiB0aGlzLmNoZWNrQWRkcmVzcyAoYWRkcmVzcyksXG4gICAgICAgICAgICAgICAgICAgICd0YWcnOiB0YWcsXG4gICAgICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEZ1bmRpbmdGZWVzIChjb2RlcyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgLy8gIGJ5IGRlZmF1bHQgaXQgd2lsbCB0cnkgbG9hZCB3aXRoZHJhd2FsIGZlZXMgb2YgYWxsIGN1cnJlbmNpZXMgKHdpdGggc2VwYXJhdGUgcmVxdWVzdHMpXG4gICAgICAgIC8vICBob3dldmVyIGlmIHlvdSBkZWZpbmUgY29kZXMgPSBbICdFVEgnLCAnQlRDJyBdIGluIGFyZ3MgaXQgd2lsbCBvbmx5IGxvYWQgdGhvc2VcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2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gYm9keSA9IHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnWC1NQlgtQVBJS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIGlmICgoYXBpID09PSAncHJpdmF0ZScpIHx8IChhcGkgPT09ICd3YXBpJykpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRoaXMubm9uY2UgKCksXG4gICAgICAgICAgICAgICAgJ3JlY3ZXaW5kb3cnOiB0aGlzLm9wdGlvbnNbJ3JlY3ZXaW5kb3cnXSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHF1ZXJ5KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBxdWVyeSArPSAnJicgKyAnc2lnbmF0dXJlPScgKyBzaWduYXR1cmU7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdYLU1CWC1BUElLRVknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoKG1ldGhvZCA9PT0gJ0dFVCcpIHx8IChhcGkgPT09ICd3YXBpJykpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC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VGhlIGNvaW4gZG9lcyBub3QgZXhpc3QuJywgJ3N1Y2Nlc3MnOiB0cnVlL2ZhbHNlfVxuICAgICAgICAgICAgICAgIGxldCBzdWNjZXNzID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAnc3VjY2VzcycsIHRydWUpO1xuICAgICAgICAgICAgICAgIGlmICghc3VjY2Vzcykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoJ21zZycgaW4gcmVzcG9uc2UpXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlID0gSlNPTi5wYXJzZSAocmVzcG9uc2VbJ21zZyddKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNwb25zZSA9IHt9O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBjaGVja3MgYWdhaW5zdCBlcnJvciBjb2Rlc1xuICAgICAgICAgICAgICAgIGxldCBlcnJvciA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdjb2RlJyk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBlcnJvciAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZXhjZXB0aW9ucyA9IHRoaXMuZXhjZXB0aW9ucztcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycm9yIGluIGV4Y2VwdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGEgd29ya2Fyb3VuZCBmb3Ige1wiY29kZVwiOi0yMDE1LFwibXNnXCI6XCJJbnZhbGlkIEFQSS1rZXksIElQLCBvciBwZXJtaXNzaW9ucyBmb3IgYWN0aW9uLlwifVxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZGVzcGl0ZSB0aGF0IHRoZWlyIG1lc3NhZ2UgaXMgdmVyeSBjb25mdXNpbmcsIGl0IGlzIHJhaXNlZCBieSBCaW5hbmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBvbiBhIHRlbXBvcmFyeSBiYW4gKHRoZSBBUEkga2V5IGlzIHZhbGlkLCBidXQgZGlzYWJsZWQgZm9yIGEgd2hpbGUpXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGVycm9yID09PSAnLTIwMTUnKSAmJiB0aGlzLm9wdGlvbnNbJ2hhc0FscmVhZHlBdXRoZW50aWNhdGVkU3VjY2Vzc2Z1bGx5J10pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRERvU1Byb3RlY3Rpb24gKHRoaXMuaWQgKyAnIHRlbXBvcmFyeSBiYW5uZWQ6ICcgKyBib2R5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBleGNlcHRpb25zW2Vycm9yXSAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnOiB1bmtub3duIGVycm9yIGNvZGU6ICcgKyBib2R5ICsgJyAnICsgZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghc3VjY2Vzcykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICc6IHN1Y2Nlc3MgdmFsdWUgZmFsc2U6ICcgKyBib2R5KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJyw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uIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdiaXQyYycsXG4gICAgICAgICAgICAnbmFtZSc6ICdCaXQyQycsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0lMJywgLy8gSXNyYWVsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMzAwMCxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MTE5LTM1OTMyMjBlLTVlY2UtMTFlNy04YjNhLTVhMDQxZjZiY2MzZi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9iaXQyYy5jby5pbCcsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXQyYy5jby5pbCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmJpdDJjLmNvLmlsL2hvbWUvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9PZmVyRS9iaXQyYycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnRXhjaGFuZ2VzL3twYWlyfS9UaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0V4Y2hhbmdlcy97cGFpcn0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFeGNoYW5nZXMve3BhaXJ9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRXhjaGFuZ2VzL3twYWlyfS9sYXN0dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdNZXJjaGFudC9DcmVhdGVDaGVja291dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkQ29pbkZ1bmRzUmVxdWVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkRnVuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZE9yZGVyTWFya2V0UHJpY2VCdXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZE9yZGVyTWFya2V0UHJpY2VTZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9DYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkQ29pbkZ1bmRzUmVxdWVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkU3RvcE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQYXltZW50L0dldE15SWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BheW1lbnQvU2VuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUGF5bWVudC9QYXknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9CYWxhbmNlL3YyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9NeU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvR2V0QnlJZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWNjb3VudEhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL09yZGVySGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL05JUyc6IHsgJ2lkJzogJ0J0Y05pcycsICdzeW1ib2wnOiAnQlRDL05JUycsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdOSVMnIH0sXG4gICAgICAgICAgICAgICAgJ0JDSC9OSVMnOiB7ICdpZCc6ICdCY2hOaXMnLCAnc3ltYm9sJzogJ0JDSC9OSVMnLCAnYmFzZSc6ICdCQ0gnLCAncXVvdGUnOiAnTklTJyB9LFxuICAgICAgICAgICAgICAgICdMVEMvTklTJzogeyAnaWQnOiAnTHRjTmlzJywgJ3N5bWJvbCc6ICdMVEMvTklTJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ05JUycgfSxcbiAgICAgICAgICAgICAgICAnQlRHL05JUyc6IHsgJ2lkJzogJ0J0Z05pcycsICdzeW1ib2wnOiAnQlRHL05JUycsICdiYXNlJzogJ0JURycsICdxdW90ZSc6ICdOSVMnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC41IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBiYWxhbmNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudEJhbGFuY2VWMiAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgYXZhaWxhYmxlID0gJ0FWQUlMQUJMRV8nICsgY3VycmVuY3k7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYmFsYW5jZVthdmFpbGFibGVdO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBiYWxhbmNlW2N1cnJlbmN5XTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW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kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICcuanNvbic7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmV4dGVuZCAoeyAnbm9uY2UnOiBub25jZSB9LCBwYXJhbXMpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAna2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ3NpZ24nOiB0aGlzLmRlY29kZSAoc2lnbmF0dXJlKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9wZW5PcmRlcnMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0g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Nvc3QgPSBwcmljZSAqIGFtb3VudDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHNpZGUgPSB0aGlzLnNhZmVWYWx1ZSAob3JkZXIsICd0eXBlJyk7XG4gICAgICAgIGlmIChzaWRlID09PSAwKSB7XG4gICAgICAgICAgICBzaWRlID0gJ2J1eSc7XG4gICAgICAgIH0gZWxzZSBpZiAoc2lkZSA9PT0gMSkge1xuICAgICAgICAgICAgc2lkZSA9ICdzZWxsJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgaWQgPSB0aGlzLnNhZmVTdHJpbmcgKG9yZGVyLCAnaWQnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ3N0YXR1cycpLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3Q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gICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbWluJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW1pbicsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNW1pbicsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG1pbicsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFob3VyJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnNGhvdXInLFxuICAgICAgICAgICAgICAgICc4aCc6ICc4aG91cicsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMXdlZWsnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzc4MDgwODEtYjg3ZjJkOWMtMmU1OS0xMWU4LTg5NGQtYzE5MDBiNzU4NGZlLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3B1YmxpYy5iaXRiYW5rLmNjJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkuYml0YmFuay5jYycsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYml0YmFuay5jYy8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9kb2NzLmJpdGJhbmsuY2MvJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL2JpdGJhbmsuY2MvZG9jcy9mZWVzLycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3BhaXJ9L3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3BhaXJ9L3RyYW5zYWN0aW9ucy97WVlZWU1NRER9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cGFpcn0vY2FuZGxlc3RpY2sve2NhbmRsZS10eXBlfS97WVlZWU1NRER9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYXNzZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Nwb3Qvb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvc3BvdC9hY3RpdmVfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Nwb3QvdHJhZGVfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93aXRoZHJhd2FsX2FjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtc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gICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdKUFknOiBhbW91bnQgPT4gYW1vdW50ID4gMzAwMDAgPyA3NTYgOiA1NDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4xNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU9OQSc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcyMDAwMSc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzIwMDAyJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMjAwMDMnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcyMDAwNSc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzIwMDA0JzogSW52YWxpZE5vbmNlLFxuICAgICAgICAgICAgICAgICc0MDAyMCc6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAnNDAwMjEnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJzQwMDI1JzogRXhjaGFuZ2VFcnJvcixcbiAgICAgICAgICAgICAgICAnNDAwMTMnOiBPcmRlck5vdEZvdW5kLFxuICAgICAgICAgICAgICAgICc0MDAxNCc6IE9yZGVyTm90Rm91bmQsXG4gICAgICAgICAgICAgICAgJzUwMDA4JzogUGVybWlzc2lvbkRlbmllZCxcbiAgICAgICAgICAgICAgICAnNTAwMDknOiBPcmRlck5vdEZvdW5kLFxuICAgICAgICAgICAgICAgICc1MDAxMCc6IE9yZGVyTm90Rm91bmQsXG4gICAgICAgICAgICAgICAgJzYwMDAxJzogSW5zdWZmaWNpZW50RnVuZHMsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3RpbWVzdGFtcCddO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0Jyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2J1eScpLFxuICAgICAgICAgICAgJ2JpZFZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnc2VsbCcpLFxuICAgICAgICAgICAgJ2Fza1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ICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ3F1b3RlJ10sXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdmZWVfYW1vdW50X3F1b3RlJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ29yZGVyJzogdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ29yZGVyX2lkJyksXG4gICAgICAgICAgICAndHlwZSc6IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0eXBlJyksXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRyYWRlcyA9IGF3YWl0IHRoaXMucHVibGljR2V0UGFpclRyYW5zYWN0aW9ucyAodGh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XMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGlmICh0eXBlb2YgcHJpY2UgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgY3JlYXRlT3JkZXIgcmVxdWlyZXMgYSBwcmljZSBhcmd1bWVudCBmb3IgYm90aCBtYXJrZXQgYW5kIGxpbWl0IG9yZGVycycpO1xuICAgICAgICBsZXQ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dXJsICs9IHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2U7XG4gICAgICAgICAgICB1cmwgKz0gdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ1BPU1QnKSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgIGF1dGggKz0gYm9keTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYXV0aCArPSAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBxdWVyeSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyBxdWVyeTtcbiAgICAgICAgICAgICAgICAgICAgYXV0aCArPSAnPycgKyBxdWVyeTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAg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uICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYxMzItOTc4YTdiZDgtNWVjZS0xMWU3LTk1NDAtYmM5NmQxZTliYmI4LmpwZycsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2JpdGJheS5uZXQnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9iaXRiYXkubmV0L0FQSS9QdWJsaWMnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2JpdGJheS5uZXQvQVBJL1RyYWRpbmcvdHJhZGluZ0FwaS5waHAnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0YmF5Lm5ldC9wdWJsaWMtYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0YmF5Lm5ldC9hY2NvdW50L3RhYi1hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0JpdEJheU5ldC9BUEknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9iaXRiYXkubmV0L2VuL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9tYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ0JUQ1VTRCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnLCAnYmFzZUlkJzogJ0JUQycsICdxdW90ZUlkJzogJ1VTRCcgfSxcbiAgICAgICAgICAgICAgICAnQlRDL0VVUic6IHsgJ2lkJzogJ0JUQ0VVUicsICdzeW1ib2wnOiAnQlRDL0VVUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdFVVInLCAnYmFzZUlkJzogJ0JUQycsICdxdW90ZUlkJzogJ0VVUicgfSxcbiAgICAgICAgICAgICAgICAnQlRDL1BMTic6IHsgJ2lkJ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Ti9CVEMnOiB7ICdpZCc6ICdYSU5CVEMnLCAnc3ltYm9sJzogJ1hJTi9CVEMnLCAnYmFzZSc6ICdYSU4nLCAncXVvdGUnOiAnQlRDJywgJ2Jhc2VJZCc6ICdYSU4nLCAncXVvdGVJZCc6ICdCVEMnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMyAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDQzLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMDksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDEyNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMU0snOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDA2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dBTUUnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDA4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMTic6IDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMS41LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzQwMCc6IEV4Y2hhbmdlRXJyb3IsIC8vIEF0IGxlYXN0IG9uZSBwYXJhbWV0ZXIgd2Fzbid0IHNldFxuICAgICAgICAgICAgICAgICc0MDEnOiBJbnZhbGlkT3JkZXIsIC8vIEludmFsaWQgb3JkZXIgdHlwZVxuICAgICAgICAgICAgICAgICc0MDInOiBJbnZhbGlkT3JkZXIsIC8vIE5vIG9yZGVycyB3aXRoIHNwZWNpZmllZCBjdXJyZW5jaWVzXG4gICAgICAgICAgICAgICAgJzQwMyc6IEludmFsaWRPcmRlciwgLy8gSW52YWxpZCBwYXltZW50IGN1cnJlbmN5IG5hbWVcbiAgICAgICAgICAgICAgICAnNDA0JzogSW52YWxpZE9yZGVyLCAvLyBFcnJvci4gV3JvbmcgdHJhbnNhY3Rpb24gdHlwZVxuICAgICAgICAgICAgICAgICc0MDUnOiBJbnZhbGlkT3JkZXIsIC8vIE9yZGVyIHdpdGggdGhpcyBpZCBkb2Vzbid0IGV4aXN0XG4gICAgICAgICAgICAgICAgJzQwNic6IEluc3VmZmljaWVudEZ1bmRzLCAvLyBObyBlbm91Z2ggbW9uZXkgb3IgY3J5cHRvXG4gICAgICAgICAgICAgICAgLy8gY29kZSA0MDcgbm90IHNwZWNpZmllZCBhcmUgbm90IHNwZWNpZmllZCBpbiB0aGVpciBkb2NzXG4gICAgICAgICAgICAgICAgJzQwOCc6IEludmFsaWRPcmRlciwgLy8gSW52YWxpZCBjdXJyZW5jeSBuYW1lXG4gICAgICAgICAgICAgICAgJzUwMSc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsIC8vIEludmFsaWQgcHVibGljIGtleVxuICAgICAgICAgICAgICAgICc1MDInOiBBdXRoZW50aWNhdGlvbkVycm9yLCAvLyBJbnZhbGlkIHNpZ25cbiAgICAgICAgICAgICAgICAnNTAzJzogSW52YWxpZE5vbmNlLCAvLyBJbnZhbGlkIG1vbWVudCBwYXJhbWV0ZXIuIFJlcXVlc3QgdGltZSBkb2Vzbid0IG1hdGNoIGN1cnJlbnQgc2VydmVyIHRpbWVcbiAgICAgICAgICAgICAgICAnNTA0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SA9IGNvZGVzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY3VycmVuY2llc1tjb2RlXTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jeVsnaWQnXTtcbiAgICAgICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgICAgICBpZiAoaWQgaW4gYmFsYW5jZSkge1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlW2lkXVsnYXZhaWxhYmxlJ10pO1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlW2lkXVsnbG9ja2VkJ10pO1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0gYWNjb3VudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICAgICAgfVxuICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZW1wdHkgYmFsYW5jZSByZXNwb25zZSAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRJZE9yZGVyYm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMubWFya2V0SWQgKHN5bW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ogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2F2ZXJhZ2UnKSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10sXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICA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BpXTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgICAgIHVybCArPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcykgKyAnLmpzb24nO1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnbW9tZW50JzogdGhpcy5ub25jZSAoKSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0FQSS1LZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnQVBJLUhhc2gnOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChib2R5KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoaHR0cENvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2Q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lciB0eXBlXG4gICAgICAgICAgICAgICAgLy8gICAgICA0MDIgTm8gb3JkZXJzIHdpdGggc3BlY2lmaWVkIGN1cnJlbmNpZXNcbiAgICAgICAgICAgICAgICAvLyAgICAgIDQwMyBJbnZhbGlkIHBheW1lbnQgY3VycmVuY3kgbmFtZVxuICAgICAgICAgICAgICAgIC8vICAgICAgNDA0IEVycm9yLiBXcm9uZyB0cmFuc2FjdGlvbiB0eXBlXG4gICAgICAgICAgICAgICAgLy8gICAgICA0MDUgT3JkZXIgd2l0aCB0aGlzIGlkIGRvZXNuJ3QgZXhpc3RcbiAgICAgICAgICAgICAgICAvLyAgICAgIDQwNiBObyBlbm91Z2ggbW9uZXkgb3IgY3J5cHRvXG4gICAgICAgICAgICAgICAgLy8gICAgICA0MDggSW52YWxpZCBjdXJyZW5jeSBuYW1lXG4gICAgICAgICAgICAgICAgLy8gICAgICA1MDEgSW52YWxpZCBwdWJsaWMga2V5XG4gICAgICAgICAgICAgICAgLy8gICAgICA1MDIgSW52YWxpZCBzaWduXG4gICAgICAgICAgICAgICAgLy8gICAgICA1MDMgSW52YWxpZCBtb21lbnQgcGFyYW1ldGVyLiBSZXF1ZXN0IHRpbWUgZG9lc24ndCBtYXRjaCBjdXJyZW50IHNlcnZlciB0aW1lXG4gICAgICAgICAgICAgICAgLy8gICAgICA1MDQgSW52YWxpZCBtZXRob2RcbiAgICAgICAgICAgICAgICAvLyAgICAgIDUwNSBLZXkgaGFzIG5vIHBlcm1pc3Npb24gZm9yIHRoaXMgYWN0aW9uXG4gICAgICAgICAgICAgICAgLy8gICAgICA1MDYgQWNjb3VudCBsb2NrZWQuIFBsZWFzZSBjb250YWN0IHdpdGggY3VzdG9tZXIgc2VydmljZVxuICAgICAgICAgICAgICAgIC8vICAgICAgNTA5IFRoZSBCSUMvU1dJRlQgaXMgcmVxdWlyZWQgZm9yIHRoaXMgY3VycmVuY3lcbiAgICAgICAgICAgICAgICAvLyAgICAgIDUxMCBJbnZhbGlkIG1hcm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AgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW0nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNW0nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMWgnLFxuICAgICAgICAgICAgICAgICczaCc6ICczaCcsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzEyaCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFEJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnN0QnLFxuICAgICAgICAgICAgICAgICcydyc6ICcxNEQnLFxuICAgICAgICAgICAgICAgICcxTSc6ICcxTScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjI0NC1lMzI4YTUwYy01ZWQyLTExZTctOTQ3Yi0wNDE0MTY1NzliYjMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJpdGZpbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRmaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpdGZpbmV4LnJlYWRtZS5pby92MS9kb2NzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9iaXRmaW5leGNvbS9iaXRmaW5leC1hcGktbm9kZScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd2Mic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L3tzZWN0aW9ufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuZGxlcy90cmFkZTp7dGltZWZyYW1lfTp7c3ltYm9sfS9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdib29rL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdjYW5kbGVzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kYm9vay97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kcy97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwdWJ0aWNrZXIve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2xzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2xzX2RldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RvZGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRfZmVlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudF9pbmZvcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jhc2tldF9tYW5hZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWRpdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5nL2Nsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L21vdmVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2V5X2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbl9pbmZvcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215dHJhZGVzX2Z1bmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29mZmVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2ZmZXIvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvZmZlci9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29mZmVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2ZmZXJzL2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsL211bHRpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwvcmVwbGFjZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9uZXcvbXVsdGknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vY2xhaW0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2Nsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VuX2Z1bmRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0b3RhbF90YWtlbl9mdW5kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VudXNlZF90YWtlbl9mdW5kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGllcnMnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAndGFrZXInOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMCwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMCwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMCwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwMCwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNzUwMDAwMCwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAsIDAuMTggLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxNTAwMDAwMCwgMC4xNiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAwLCAwLjE0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMDAsIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFszMDAwMDAwMCwgMC4xIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDAuMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMCwgMC4wOCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAsIDAuMDYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAwLCAwLjA0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwMCwgMC4wMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzc1MDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzE1MDAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzMwMDAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLCAvLyB0cnVlIGZvciB0aWVyLWJhc2VkL3Byb2dyZXNzaXZlXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsIC8vIGZpeGVkIGNvbW1pc3Npb25cbiAgICAgICAgICAgICAgICAgICAgLy8gQWN0dWFsbHkgZGVwb3NpdCBmZWVzIGFyZSBmcmVlIGZvciBsYXJnZXIgZGVwb3NpdHMgKD4gJDEwMDAgVVNEIGVxdWl2YWxlbnQpXG4gICAgICAgICAgICAgICAgICAgIC8vIHRoZXNlIHZhbHVlcyBiZWxvdyBhcmUgZGVwcmVjYXRlZCwgd2Ugc2hvdWxkIG5vdCBoYXJkY29kZSBmZWVzIGFuZCBsaW1pdHMgYW55bW9yZVxuICAgICAgICAgICAgICAgICAgICAvLyB0byBiZSByZWltcGxlbWVudGVkIHdpdGggYml0ZmluZXggZnVuZGluZyBmZWVzIGZyb20gdGhlaXIgQVBJIG9yIHdlYiBlbmRwb2ludHNcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lPVEEnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDI3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjI0Mjc5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMC45OTI2OSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWVlXJzogMTYuOTE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLjE0MDI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBVEEnOiAyMC43NzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFTSCc6IDEuOTg1OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDAuOTUwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMS4zMDQ1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDI4LjE4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAxLjk5NDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkNOJzogMTAuNzkzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ROQic6IDMxLjkxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAxNC45NzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkxDJzogMS40MTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05UJzogNS44OTUyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NQSyc6IDEwLjg5MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRVAnOiAwLjA0MTE2OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQVQnOiA2LjE1NDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxGJzogMS44NzUzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDMyLjMzNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkcnOiAxOC42MjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUlEJzogOC4wOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNTkEnOiAxNi42MTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVDJzogMS42NTA0LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lPVEEnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDI3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjI0Mjc5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMC45OTI2OSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWVlXJzogMTYuOTE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLjE0MDI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBVEEnOiAyMC43NzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFTSCc6IDEuOTg1OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDAuOTUwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMS4zMDQ1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAyMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAyOC4xODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlJYJzogMS45OTQ3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JDTic6IDEwLjc5MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTkInOiAzMS45MTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMTQuOTc2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JMQyc6IDEuNDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOVCc6IDUuODk1MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTUEsnOiAxMC44OTMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMC4wNDExNjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFUJzogNi4xNTQ2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMRic6IDEuODc1MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAzMi4zMzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05HJzogMTguNjIyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FJRCc6IDguMDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU5BJzogMTYuNjE3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FQyc6IDEuNjUwNCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdCQ0MnOiAnQ1NUX0JDQycsXG4gICAgICAgICAgICAgICAgJ0JDVSc6ICdDU1RfQkNVJyxcbiAgICAgICAgICAgICAgICAnREFUJzogJ0RBVEEnLFxuICAgICAgICAgICAgICAgICdEU0gnOiAnREFTSCcsIC8vIEJpdGZpbmV4IG5hbWVzIERhc2ggYXMgRFNILCBpbnN0ZWFkIG9mIERBU0hcbiAgICAgICAgICAgICAgICAnSU9TJzogJ0lPU1QnLFxuICAgICAgICAgICAgICAgICdJT1QnOiAnSU9UQScsXG4gICAgICAgICAgICAgICAgJ01OQSc6ICdNQU5BJyxcbiAgICAgICAgICAgICAgICAnUVNIJzogJ1FBU0gnLFxuICAgICAgICAgICAgICAgICdRVE0nOiAnUVRVTScsXG4gICAgICAgICAgICAgICAgJ1NORyc6ICdTTkdMUycsXG4gICAgICAgICAgICAgICAgJ1NQSyc6ICdTUEFOSycsXG4gICAgICAgICAgICAgICAgJ1lZVyc6ICdZT1lPVycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ2V4YWN0Jzoge1xuICAgICAgICAgICAgICAgICAgICAndGVtcG9yYXJpbHlfdW5hdmFpbGFibGUnOiBFeGNoYW5nZU5vdEF2YWlsYWJsZSwgLy8gU29ycnksIHRoZSBzZXJ2aWNlIGlzIHRlbXBvcmFyaWx5IHVuYXZhaWxhYmxlLiBTZWUgaHR0cHM6Ly93d3cuYml0ZmluZXguY29tLyBmb3IgbW9yZSBpbmZvLlxuICAgICAgICAgICAgICAgICAgICAnT3JkZXIgY291bGQgbm90IGJlIGNhbmNlbGxlZC4nOiBPcmRlck5vdEZvdW5kLCAvLyBub24tZXhpc3RlbnQgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgJ05vIHN1Y2ggb3JkZXIgZm91bmQuJzogT3JkZXJOb3RGb3VuZCwgLy8gP1xuICAgICAgICAgICAgICAgICAgICAnT3JkZXIgcHJpY2UgbXVzdCBiZSBwb3NpdGl2ZS4nOiBJbnZhbGlkT3JkZXIsIC8vIG9uIHByaWNlIDw9IDBcbiAgICAgICAgICAgICAgICAgICAgJ0NvdWxkIG5vdCBmaW5kIGEga2V5IG1hdGNoaW5nIHRoZSBnaXZlbiBYLUJGWC1BUElLRVkuJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAgICAgJ1RoaXMgQVBJIGtleSBkb2VzIG5vdCBoYXZlIHBlcm1pc3Npb24gZm9yIHRoaXMgYWN0aW9uJzogQXV0aGVudGljYXRpb25FcnJvciwgLy8gYXV0aGVudGljYXRlZCBidXQgbm90IGF1dGhvcml6ZWRcbiAgICAgICAgICAgICAgICAgICAgJ0tleSBwcmljZSBzaG91bGQgYmUgYSBkZWNpbWFsIG51bWJlciwgZS5nLiBcIjEyMy40NTZcIic6IEludmFsaWRPcmRlciwgLy8gb24gaXNOYU4gKHByaWNlKVxuICAgICAgICAgICAgICAgICAgICAnS2V5IGFtb3VudCBzaG91bGQgYmUgYSBkZWNpbWFsIG51bWJlciwgZS5nLiBcIjEyMy40NTZcIic6IEludmFsaWRPcmRlciwgLy8gb24gaXNOYU4gKGFtb3VudClcbiAgICAgICAgICAgICAgICAgICAgJ0VSUl9SQVRFX0xJTUlUJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgICAgICdOb25jZSBpcyB0b28gc21hbGwuJzogSW52YWxpZE5vbmNlLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Jyb2FkJzoge1xuICAgICAgICAgICAgICAgICAgICAnSW52YWxpZCBvcmRlcjogbm90IGVub3VnaCBleGNoYW5nZSBiYWxhbmNlIGZvciAnOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gd2hlbiBidXlpbmcgY29zdCBpcyBncmVhdGVyIHRoYW4gdGhlIGF2YWlsYWJsZSBxdW90ZSBjdXJyZW5jeVxuICAgICAgICAgICAgICAgICAgICAnSW52YWxpZCBvcmRlcjogbWluaW11bSBzaXplIGZvciAnOiBJbnZhbGlkT3JkZXIsIC8vIHdoZW4gYW1vdW50IGJlbG93IGxpbWl0cy5hbW91bnQubWluXG4gICAgICAgICAgICAgICAgICAgICdJbnZhbGlkIG9yZGVyJzogSW52YWxpZE9yZGVyLCAvLyA/XG4gICAgICAgICAgICAgICAgICAgICdUaGUgYXZhaWxhYmxlIGJhbGFuY2UgaXMgb25seSc6IEluc3VmZmljaWVudEZ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0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0U3ltYm9sc0RldGFpbHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsncGFpciddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsncHJpY2VfcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsncHJpY2VfcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbmltdW1fb3JkZXJfc2l6ZScpLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heGltdW1fb3JkZXJfc2l6ZScpLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxpbWl0c1snY29zdCddID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBsaW1pdHNbJ2Ftb3VudCddWydtaW4nXSAqIGxpbWl0c1sncHJpY2UnXVsnbWluJ10sXG4gICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgY29zdFRvUHJlY2lzaW9uIChzeW1ib2wsIGNvc3QpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVjaW1hbFRvUHJlY2lzaW9uIChjb3N0LCBST1VORCwgdGhpcy5tYXJrZXRzW3N5b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YgKHNpZGUgPT09ICdzZWxsJykge1xuICAgICAgICAgICAgY29zdCAqPSBwcmljZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGtleSA9ICdiYXNlJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3R5cGUnOiB0YWtlck9yTWFrZXIsXG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRba2V5XSxcbiAgICAgICAgICAgICdyYXRlJzogcmF0ZSxcbiAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAodGhpcy5mZWVUb1ByZWNpc2lvbiAobWFya2V0W2tleV0sIGNvc3QpKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlVHlwZSA9IHRoaXMuc2FmZVN0cmluZyAocGFyYW1zLCAndHlwZScsICdleGNoYW5nZScpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYWxhbmNlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tpXTtcbiAgICAgICAgICAgIGlmIChiYWxhbmNlWyd0eXBlJ10gPT09IGJhbGFuY2VUeXBlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gY3VycmVuY3kudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgdXBwZXJjYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHVwcGVyY2FzZSk7XG4gICAgICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlJ10pO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnQnXSk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZW9mIGxpbWl0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgcmVxdWVzdFsnbGltaXRfYmlkcyddID0gbGltaXQ7XG4gICAgICAgICAgICByZXF1ZXN0WydsaW1pdF9hc2tzJ10gPSBsaW1pdDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRCb29rU3ltYm9sICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAg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AgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3RpbWVzdGFtcCcpICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB9IGVsc2UgaWYgKCdwYWlyJyBpbiB0aWNrZXIpIHtcbiAgICAgICAgICAgIGxldCBpZCA9IHRpY2tlclsncGFpciddO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGVJZCA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4g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ICAgICAgICAgICAgICAgJ2Nvc3QnOiBmZWVDb3N0LFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IGZlZUN1cnJlbmN5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXJJZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gNTAsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ2xpbWl0X3RyYWRlcyc6IGxpbWl0LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZW9mIHNpbmNlICE9PSAndW5kZWZpbmVkJyl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IGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtleGNoYW5nZV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBvcmRlclR5cGUgPSBvcmRlclsndHlwZSddO1xuICAgICAgICBsZXQgZXhjaGFuZ2UgPSBvcmRlclR5cGUuaW5kZXhPZiAoJ2V4Y2hhbmdlICcpID49IDA7XG4gICAgICAgIGlmIChleGNoYW5nZSkge1xuICAgICAgICAgICAgbGV0IHBhcnRzID0gb3JkZXJbJ3R5cGUnXS5zcGxpdCAoJyAnKTtcbiAgICAgICAgICAgIG9yZGVyVHlwZSA9IHBhcnRzWzFdO1xuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAocGFyc2VGbG9hdCAob3JkZXJbJ3RpbWVzdGFtcCddKSAqIDEwMDApO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpLFxuICAgICAgICAgICAgJ2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nRVRDJzogJ2V0aGVyZXVtYycsXG4gICAgICAgICAgICAnRVRIJzogJ2V0aGVyZXVtJyxcbiAgICAgICAgICAgICdFVFAnOiAnbWV0YXZlcnNlJyxcbiAgICAgICAgICAgICdGVU4nOiAnZnVuJyxcbiAgICAgICAgICAgICdHTlQnOiAnZ29sZW0nLFxuICAgICAgICAgICAgJ0lPU1QnOiAnaW9zJyxcbiAgICAgICAgICAgICdJT1RBJzogJ2lvdGEnLFxuICAgICAgICAgICAgJ0xSQyc6ICdscmMnLFxuICAgICAgICAgICAgJ0xUQyc6ICdsaXRlY29pbicsXG4gICAgICAgICAgICAnTUFOQSc6ICdtbmEnLFxuICAgICAgICAgICAgJ01JVCc6ICdtaXQnLFxuICAgICAgICAgICAgJ01UTic6ICdtdG4nLFxuICAgICAgICAgICAgJ05FTyc6ICduZW8nLFxuICAgICAgICAgICAgJ09ERSc6ICdvZGUnLFxuICAgICAgICAgICAgJ09NRyc6ICdvbWlzZWdvJyxcbiAgICAgICAgICAgICdPTU5JJzogJ21hc3RlcmNvaW4nLFxuICAgICAgICAgICAgJ1FBU0gnOiAncWFzaCcsXG4gICAgICAgICAgICAnUVRVTSc6ICdxdHVtJywgLy8gIzE4MTFcbiAgICAgICAgICAgICdSQ04nOiAncmNuJyxcbiAgICAgICAgICAgICdSRE4nOiAncmRuJyxcbiAgICAgICAgICAgICdSRVAnOiAncmVwJyxcbiAgICAgICAgICAgICdSRVEnOiAncmVxJyxcbiAgICAgICAgICAgICdSTEMnOiAncmxjJyxcbiAgICAgICAgICAgICdTQU4nOiAnc2FudGltZW50JyxcbiAgICAgICAgICAgICdTTkdMUyc6ICdzbmcnLFxuICAgICAgICAgICAgJ1NOVCc6ICdzdGF0dXMnLFxuICAgICAgICAgICAgJ1NQQU5LJzogJ3NwaycsXG4gICAgICAgICAgICAnU1RKJzogJ3N0aicsXG4gICAgICAgICAgICAnVE5CJzogJ3RuYicsXG4gICAgICAgICAgICAnVFJYJzogJ3RyeCcsXG4gICAgICAgICAgICAnVVNEJzogJ3dpcmUnLFxuICAgICAgICAgICAgJ1VTRFQnOiAndGV0aGVydXNvJywgLy8gdW5kb2N1bWVudGVkXG4gICAgICAgICAgICAnV0FYJzogJ3dheCcsXG4gICAgICAgICAgICAnWExNJzogJ3hsbScsXG4gICAgICAgICAgICAnWE1SJzogJ21vbmVybycsXG4gICAgICAgICAgICAnWFJQJzogJ3JpcHBsZScsXG4gICAgICAgICAgICAnWFZHJzogJ3h2ZycsXG4gICAgICAgICAgICAnWU9ZT1cnOiAneW95b3cnLFxuICAgICAgICAgICAgJ1pFQyc6ICd6Y2FzaCcsXG4gICAgICAgICAgICAnWlJYJzogJ3pyeCcsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChjdXJyZW5jeSBpbiBuYW1lcylcbiAgICAgICAgICAgIHJldHVybiBuYW1lc1tjdXJyZW5jeV07XG4gICAgICAgIHRocm93IG5ldyBOb3RTdXBwb3J0ZWQgKHRoaXMuaWQgKyAnICcgKyBjdXJyZW5jeSArICcgbm90IHN1cHBvcnRlZCBmb3Igd2l0aGRyYXdhbCcpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZURlcG9zaXRBZGRyZXNzIChjdXJyZW5jeSwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaERlcG9zaXRBZGRyZXNzIChjdXJyZW5jeSwgdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdyZW5ldyc6IDEsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgYWRkcmVzcyA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdhZGRyZXNzJyk7XG4gICAgICAgIHRoaXMuY2hlY2tBZGRyZXNzIChhZGRyZXNzKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgJ2FkZHJlc3M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G4gICAgICAgICAgICBpZiAodHlwZW9mIGVycm9yTWVzc2FnZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBsZXQgRXhjZXB0aW9uID0gdGhpcy5leGNlcHRpb25zWydicm9hZCddW2Vycm9yTWVzc2FnZV07XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2VwdGlvbiAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIHdpdGhkcmF3IHJldHVybmVkIGFuIGlkIG9mIHplcm86ICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXF1ZXN0ID0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBpZiAoYXBpID09PSAndjInKSB7XG4gICAgICAgICAgICByZXF1ZXN0ID0gJy8nICsgYXBpICsgcmVxdWVzdDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlcXVlc3QgPSAnLycgKyB0aGlzLnZlcnNpb24gKyByZXF1ZXN0O1xuICAgICAgICB9XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1z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5bG9hZCwgc2VjcmV0LCAnc2hhMzg0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdYLUJGWC1BUElLRVknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnWC1CRlgtUEFZTE9BRCc6IHRoaXMuZGVjb2RlIChwYXlsb2FkKSxcbiAgICAgICAgICAgICAgICAnWC1CRlgtU0lHTkFUVVJFJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGZpbmRCcm9hZGx5TWF0Y2hlZEtleSAobWFwLCBicm9hZFN0cmluZykge1xuICAgICAgICBjb25zdCBwYXJ0aWFsS2V5cyA9IE9iamVjdC5rZXlzIChtYXApO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHBhcnRpYWxLZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBjb25zdCBwYXJ0aWFsS2V5ID0gcGFydGlhbEtleXNbaV07XG4gICAgICAgICAgICBpZiAoYnJvYWRTdHJpbmcuaW5kZXhPZiAocGFydGlhbEtleSkgPj0gMClcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFydGlhbEtleTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoYm9keS5sZW5ndGggPCAyKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBpZiAoY29kZSA+PSA0MDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdID09PSAneycpIHtcbiAgICAgICAgICAgICAgICBjb25zdCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGNvbnN0IGZlZWRiYWNrID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2UpXG4gICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgPSByZXNwb25zZVsnbWVzc2FnZSddO1xuICAgICAgICAgICAgICAgIGVsc2UgaWYgKCdlcnJvcicgaW4gcmVzcG9uc2UpXG4gICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgPSByZXNwb25zZVsnZXJyb3InXTtcbiAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yIChmZWVkYmFjayk7IC8vIG1hbGZvcm1lZCAodG8gb3VyIGtub3dsZWRnZSkgcmVzcG9uc2VcbiAgICAgICAgICAgICAgICBjb25zdCBleGFjdCA9IHRoaXMuZXhjZXB0aW9uc1snZXhhY3QnXTtcbiAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSBpbiBleGFjdClcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IGV4YWN0W21lc3NhZ2VdIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgY29uc3QgYnJvYWQgPSB0aGlzLmV4Y2VwdGlvbnNbJ2Jyb2FkJ107XG4gICAgICAgICAgICAgICAgY29uc3QgYnJvYWRLZXkgPSB0aGlzLmZpbmRCcm9hZGx5TWF0Y2hlZEtleSAoYnJvYWQsIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgYnJvYWRLZXkgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgYnJvYWRbYnJvYWRLZXldIChmZWVkYmFjayk7XG4gIC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gICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZWRpdE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hGdW5kaW5nRmVlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVHJhZGluZ0ZlZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG0nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaCcsXG4gICAgICAgICAgICAgICAgJzNoJzogJzNoJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMUQnLFxuICAgICAgICAgICAgICAgICcxdyc6ICc3RCcsXG4gICAgICAgICAgICAgICAgJzJ3JzogJzE0RCcsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFNJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYyNDQtZTMyOGE1MGMtNWVkMi0xMWU3LTk0N2ItMDQxNDE2NTc5YmIzLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5iaXRmaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0ZmluZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRmaW5leC5yZWFkbWUuaW8vdjIvZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYml0ZmluZXhjb20vYml0ZmluZXgtYXBpLW5vZGUnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cuYml0ZmluZXguY29tL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3YxJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHNfZGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYXRmb3JtL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS97cHJlY2lzaW9ufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9SMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS97c2lkZX0ve3NlY3Rpb259JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L2xvbmcvbGFzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS9sb25nL2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzMS97a2V5fTp7c2l6ZX06e3N5bWJvbH0vc2hvcnQvbGFzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS9zaG9ydC9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L3tzZWN0aW9ufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuZGxlcy90cmFkZTp7dGltZWZyYW1lfTp7c3ltYm9sfS9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYWxjL3RyYWRlL2F2ZycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL3dhbGxldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlcnMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlcnMve3N5bWJvbH0vbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3Ivb3JkZXJzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlci97c3ltYm9sfTp7aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL3RyYWRlcy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9vZmZlcnMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL29mZmVycy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9sb2Fucy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvbG9hbnMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvY3JlZGl0cy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvY3JlZGl0cy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy90cmFkZXMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2luZm8vbWFyZ2luL3trZXl9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvaW5mby9mdW5kaW5nL3trZXl9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvbW92ZW1lbnRzL3tjdXJyZW5jeX0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL3N0YXRzL3BlcmY6e3RpbWVmcmFtZX0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2FsZXJ0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC93L2FsZXJ0L3NldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC93L2FsZXJ0L3t0eXBlfTp7c3ltYm9sfTp7cHJpY2V9L2RlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9jYWxjL29yZGVyL2F2YWlsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvbGVkZ2Vycy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU9UJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FTyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVE0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVQnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NBTic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NQSyc6IDkuMjc4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQVQnOiA5LjA4ODMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05UJzogOC4yODgxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOVCc6IDE0LjMwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVNIJzogMy4yNDI4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lZVyc6IDE4LjA1NSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgaXNGaWF0IChjb2RlKSB7XG4gICAgICAgIGxldCBmaWF0ID0ge1xuICAgICAgICAgICAgJ1VTRCc6ICdVU0QnLFxuICAgICAgICAgICAgJ0VVUic6ICdFVVInLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gKGNvZGUgaW4gZmlhdCk7XG4gICAgfVxuXG4gICAgZ2V0Q3VycmVuY3lJZCAoY29kZSkge1xuICAgICAgICBsZXQgaXNGaWF0ID0gdGhpcy5pc0ZpYXQgKGNvZGUpO1xuICAgICAgICBsZXQgcHJlZml4ID0gaXNGaWF0ID8gJ2YnIDogJ3QnO1xuICAgICAgICByZXR1cm4gcHJlZml4ICsgY29kZTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMudjFHZXRTeW1ib2xzRGV0YWlscyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydwYWlyJ10udG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGlkID0gJ3QnICsgaWQ7XG4gICAgICAgICAgICBiYXNlSWQgPSB0aGlzLmdldEN1cnJlbmN5SWQgKGJhc2VJZCk7XG4gICAgICAgICAgICBxdW90ZUlkID0gdGhpcy5nZXRDdXJyZW5jeUlkIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwcmljZV9wcmVjaXNpb24nXSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0WydwcmljZV9wcmVjaXNpb24nXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluaW11bV9vcmRlcl9zaXplJyksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4aW11bV9vcmRlcl9zaXplJyksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGltaXRzWydjb3N0J10gPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IGxpbWl0c1snYW1vdW50J11bJ21pbiddICogbGltaXRzWydwcmljZSddWydtaW4nXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzogbGltaXRzLFxuICAgICAgICAgICAgICAgICdsb3QnOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QXV0aFJXYWxsZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZVR5cGUgPSB0aGlzLnNhZmVTdHJpbmcgKHBhcmFtcywgJ3R5cGUnLCAnZXhjaGFuZ2UnKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IHJlc3BvbnNlLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IHJlc3BvbnNlW2JdO1xuICAgICAgICAgICAgbGV0IGFjY291bnRUeXBlID0gYmFsYW5jZVswXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbMV07XG4gICAgICAgICAgICBsZXQgdG90YWwgPSBiYWxhbmNlWzJdO1xuICAgICAgICAgICAgbGV0IGF2YWlsYWJsZSA9IGJhbGFuY2VbNF07XG4gICAgICAgICAgICBpZiAoYWNjb3VudFR5cGUgPT09IGJhbGFuY2VUeXBlKSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5WzBdID09PSAndCcpXG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbmN5ID0gY3VycmVuY3kuc2xpY2UgKDEpO1xuICAgICAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICB1cHBlcmNhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAodXBwZXJjYXNlKTtcbiAgICAgICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBhdmFpbGFibGU7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRvdGFsO1xuICAgICAgICAgICAgICAgIGlmIChhY2NvdW50WydmcmVlJ10pXG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICAgICAgcmVzdWx0W3VwcGVyY2FzZV0gPSBhY2NvdW50O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0Qm9va1N5bWJvbFByZWNpc2lvbiAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6ICdSMCcsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnYmlkcyc6IFtdLFxuICAgICAgICAgICAgJ2Fza3MnOiBbXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbm9uY2UnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb3JkZXJib29rLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSBvcmRlcmJvb2tbaV07XG4gICAgICAgICAgICBsZXQgcHJpY2UgPSBvcmRlclsxXTtcbiAgICAgICAgICAgIGxldCBhbW91bnQgPSBvcmRlclsyXTtcbiAgICAgICAgICAgIGxldCBzaWRlID0gKGFtb3VudCA+IDApID8gJ2JpZHMnIDogJ2Fza3MnO1xuICAgICAgICAgICAgYW1vdW50ID0gTWF0aC5hYnMgKGFtb3VudCk7XG4gICAgICAgICAgICByZXN1bHRbc2lkZV0ucHVzaCAoWyBwcmljZSwgYW1vdW50IF0pO1xuICAgICAgICB9XG4gICAgICAgIHJlc3VsdFsnYmlkcyddID0gdGhpcy5zb3J0QnkgKHJlc3VsdFsnYmlkcyddLCAwLCB0cnVlKTtcbiAgICAgICAgcmVzdWx0Wydhc2tzJ10gPSB0aGlzLnNvcnRCeSAocmVzdWx0Wydhc2tzJ10sIDApO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgbGVuZ3RoID0gdGlja2VyLmxlbmd0aDtcbiAgICAgICAgbGV0IGxhc3QgPSB0aWNrZXJbbGVuZ3RoIC0gNF07XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGlja2VyW2xlbmd0aCAtIDJdLFxuICAgICAgICAgICAgJ2xvdyc6IHRpY2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Jlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRpY2tlcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gdGlja2VyWzBdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCBbIGlkLCB0aW1lc3RhbXAsIGFtb3VudCwgcHJpY2UgXSA9IHRyYWRlO1xuICAgICAgICBsZXQgc2lkZSA9IChhbW91bnQgPCAwKSA/ICdzZWxsJyA6ICdidXknO1xuICAgICAgICBpZiAoYW1vdW50IDwgMCkge1xuICAgICAgICAgICAgYW1vdW50ID0gL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WZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXF1ZXN0ID0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT09ICd2MScpXG4gICAgICAgICAgICByZXF1ZXN0ID0gYXBpICsgcmVxdWVzdDtcbiAgICAgICAgZWxzZVxuICAgICAgICAgICAgcmVxdWVzdCA9IHRoaXMudmVyc2lvbiArIHJlcXVlc3Q7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgcmVxdWVzdDtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSAnL2FwaScgKyAnLycgKyByZXF1ZXN0ICsgbm9uY2UgKyBib2R5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMzg0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdiZngtbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYmZ4LWFwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdiZngtc2lnbmF0dXJlJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmIChyZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnbWVzc2FnZSddLmluZGV4T2YgKCdub3QgZW5vdWdoIGV4Y2hhbmdlIGJhbGFuY2UnKSA+PSAwKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICB9XG4gICAgICAg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uLlxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODA1MTY0Mi01NjE1NDE4Mi02NjBlLTExZTctOWIwZC02MDQyZDFlNmVkZDguanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJpdGZseWVyLmpwJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYml0Zmx5ZXIuanAnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9iaXRmbHllci5qcC9BUEknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRtYXJrZXRzL3VzYScsIC8vIG5ldyAod2lwKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG1hcmtldHMvZXUnLCAgLy8gbmV3ICh3aXApXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0bWFya2V0cycsICAgICAvLyBvciAnbWFya2V0cydcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRib2FyZCcsICAgICAgIC8vIC4uLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHRpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZXhlY3V0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0aGVhbHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRib2FyZHN0YXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjaGF0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRwZXJtaXNzaW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29sbGF0ZXJhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29sbGF0ZXJhbGFjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRhZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGNvaW5pbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGNvaW5vdXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYW5rYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGRlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y2hpbGRvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBhcmVudG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0cGFyZW50b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGV4ZWN1dGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBvc2l0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0dHJhZGluZ2NvbW1pc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kY29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbmRjaGlsZG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxjaGlsZG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kcGFyZW50b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbHBhcmVudG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxhbGxjaGlsZG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IGpwX21hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEdldG1hcmtldHMgKCk7XG4gICAgICAgIGxldCB1c19tYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRHZXRtYXJrZXRzVXNhICgpO1xuICAgICAgICBsZXQgZXVfbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0R2V0bWFya2V0c0V1ICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHRoaXMuYXJyYXlDb25jYXQgKGpwX21hcmtldHMsIHVzX21hcmtldHMpO1xuICAgICAgICBtYXJrZXRzID0gdGhpcy5hcnJheUNvbmNhdCAobWFya2V0cywgZXVfbWFya2V0cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsncHJvZHVjdF9jb2RlJ107XG4gICAgICAgICAgICBsZXQgY3VycmVuY2llcyA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgbnVtQ3VycmVuY2llcyA9IGN1cnJlbmNpZXMubGVuZ3RoO1xuICAgICAgICAgICAgaWYgKG51bUN1cnJlbmNpZXMgPT09IDEpIHtcbiAgICAgICAgICAgICAgICBiYXNlID0gc3ltYm9sLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IHN5bWJvbC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG51bUN1cnJlbmNpZXMgPT09IDIpIHtcbiAgICAgICAgICAgICAgICBiYXNlID0gY3VycmVuY2llc1swXTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IGN1cnJlbmNpZXNbMV07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBiYXNlID0gY3VycmVuY2llc1sxXTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IGN1cnJlbmNpZXNbMl07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEdldGJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHt9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IHJlc3BvbnNlLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHJlc3BvbnNlW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYWNjb3VudFsnY3VycmVuY3lfY29kZSddO1xuICAgICAgICAgICAgYmFsYW5jZXNbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VzKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IGJhbGFuY2VzW2N1cnJlbmN5XVsnYW1vdW50J107XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYmFsYW5jZXNbY3VycmVuY3ldWydhdmFpbGFibGUnXTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRHZXRib2FyZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwcm9kdWN0X2NvZGUnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYmlkcycsICdhc2tzJywgJ3ByaWNlJywgJ3NpemUnKTtcbiAgICB9XG5cbiAgICBhc3luY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gbGV0IGZlZUNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICd0b3RhbF9jb21taXNzaW9uJyk7XG4gICAgICAgIGlmICh0eXBlb2YgZmVlQ29zdCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdyYXRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2NoaWxkX29yZGVyX2FjY2VwdGFuY2VfaWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJzIChzeW1ib2wgPSB1bmRlZmluZW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gdXJsID0gdGhpcy51cmxzWydhcGknXSArIHJlcXVlc3Q7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBbIG5vbmNlLCBtZXRob2QsIHJlcXVlc3QgXS5qb2luICgnJyk7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgaWYgKG1ldGhvZCAhPT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocGFyYW1zKTtcbiAgICAgICAgICAgICAgICAgICAgYXV0aCArPSBib2R5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0FDQ0VTUy1LRVknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnQUNDRVNTLVRJTUVTVEFNUCc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdBQ0NFU1MtU0lHTic6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS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knOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkuYml0aHVtYi5jb20vcHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkuYml0aHVtYi5jb20nLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRodW1iLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5iaXRodW1iLmNvbS91MS9VUzEyNycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2sve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVjZW50X3RyYW5zYWN0aW9ucy97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWNlbnRfdHJhbnNhY3Rpb25zL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9hY2NvdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vd2FsbGV0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby91c2VyX3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvcGxhY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vb3JkZXJfZGV0YWlsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2J0Y193aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9rcndfZGVwb3NpdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUva3J3X3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL21hcmtldF9idXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL21hcmtldF9zZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjE1IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjE1IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyQWxsICgpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChtYXJrZXRzWydkYXRhJ10pO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGlmIChpZCAhPT0gJ2RhdGUnKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ2RhdGEnXVtpZF07XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBpZDtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSAnS1JXJztcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgICAgICdsb3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEluZm9CYWxhbmNlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogJ0FMTCcsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3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Wl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyQWxsIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSByZXNwb25zZVsnZGF0YSddWydkYXRlJ107XG4gICAgICAgIGxldCB0aWNrZXJzID0gdGhpcy5vbWl0IChyZXNwb25zZVsnZGF0YSddLCAnZGF0ZScpO1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICB0aWNrZXJbJ2RhdGUnXSA9IHRpbWVzdGFtcDtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0I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c3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3ByaXZhdGVQb3N0VHJhZGUnO1xuICAgICAgICBpZiAodHlwZSA9PT0gJ2xpbWl0Jykge1xuICAgICAgICAgICAgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICAgICAnb3JkZXJfY3VycmVuY3knOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAgICAgJ1BheW1lbnRfY3VycmVuY3knOiBtYXJrZXRbJ3F1b3RlJ10sXG4gICAgICAgICAgICAgICAgJ3VuaXRzJzogYW1vdW50LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgICAgICd0eXBlJzogKHNpZGUgPT09ICdidXknKSA/ICdiaWQnIDogJ2FzaycsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbWV0aG9kICs9ICdQbGFjZSc7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgICAgICd1bml0cyc6IGFtb3VudCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBtZXRob2QgKz0gJ01hcmtldCcgKyB0aGlzLmNhcGl0YWxpemUgKHNpZGUpO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKH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lcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxaCc6IDM2MDAsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjI3NS1kY2ZjNmMzMC01ZWQzLTExZTctODM5ZC0wMGE4NDYzODVkMGIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYml0bGlzaC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYml0bGlzaC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9iaXRsaXNoLmNvbS9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMyAvIDEwMCwgLy8gYW5vbnltb3VzIDAuMyUsIHZlcmlmaWVkIDAuMiVcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDUwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2hsY3YnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNfZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29obGN2JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzX2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHNfb3BlcmF0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfdHJhZGVzX2J5X2lkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX2FsbF90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZV9iY29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX3RlbXBsYXRlX3dhbGxldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X2FjY291bnRzX29wZXJhdGlvbnNfZnJvbV90cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9hY3RpdmVfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X2Jjb2RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9teV9tYXRjaGVzX2Zyb21fdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfbXlfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X215X3RyYWRzX2Zyb21fdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfcGF5bWVudF9tZXRob2RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X3BheW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWRlZW1fY29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVzaWduJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzaWduaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NpZ25vdXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2RldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX29wdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19ieV9pZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnRFNIJzogJ0RBU0gnLFxuICAgICAgICAgICAgICAgICdYREcnOiAnRE9HRScsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0UGFpcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNba2V5c1twXV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0Jyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21heCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdtaW4nKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYmlkJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2ZpcnN0JyksXG4gICAgICAgICAgICAnY2xvc2UnOiBsYXN0LFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ3ByZXZpb3VzQ2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhbmdlJ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0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChyZXNwb25zZSk7XG4gICAgICAgIGxldCBiYWxhbmNlID0ge307XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gcmVzcG9uc2VbY3VycmVuY3ldO1xuICAgICAgICAgICAgY3VycmVuY3kgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIC8vIGlzc3VlICM0IGJpdGxpc2ggbmFtZXMgRGFzaCBhcyBEU0gsIGluc3RlYWQgb2YgREFTSFxuICAgICAgICAgICAgaWYgKGN1cnJlbmN5ID09PSAnRFNIJylcbiAgICAgICAgICAgICAgICBjdXJyZW5jeSA9ICdEQVNIJztcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSA9PT0gJ1hERycpXG4gICAgICAgICAgICAgICAgY3VycmVuY3kgPSAnRE9HRSc7XG4gICAgICAgICAgICBiYWxhbmNlW2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ2Z1bmRzJ10pO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbY3VycmVuY3ldWydob2xkZWQnXSk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgc2lnbkluICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMucHJpdmF0ZVBvc3RTaWduaW4gKHtcbiAgICAgICAgICAgICdsb2dpbic6IHRoaXMubG9naW4sXG4gICAgICAgICAgICAncGFzc3dkJzogdGhpcy5wYXNzd29yZCxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ3BhaXJfaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ2Rpcic6IChzaWRlID09PSAnYnV5JykgPyAnYmlkJyA6ICdhc2snLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHR5cGUgPT09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICBsZXQgcmVzdWx0ID0gYXdhaXQg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udG9Mb3dlckNhc2UgKCksXG4gICAgICAgICAgICAnYW1vdW50JzogcGFyc2VGbG9hdCAoYW1vdW50KSxcbiAgICAgICAgICAgICdhY2NvdW50JzogYWRkcmVzcyxcbiAgICAgICAgICAgICdwYXltZW50X21ldGhvZCc6ICdiaXRjb2luJywgLy8gdGhleSBkaWQgbm90IGRvY3VtZW50IG90aGVyIHR5cGVzLi4uXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydtZXNzYWdlX2lkJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocGFyYW1zKTtcbiAgICAgICAgICAgICAgICBoZWFkZXJzID0geyAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWF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AgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnOTBtJzogJzkwbScsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgICAgICcxdyc6ICc3ZCcsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnM00nOiAnM20nLFxuICAgICAgICAgICAgICAgICc2TSc6ICc2bScsXG4gICAgICAgICAgICAgICAgJzF5JzogJzF5JyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY3MjU2LWE4NTU1MjAwLTVlZjktMTFlNy05NmZkLTQ2OWE2NWUyYjBiZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3LmJpdG1hcmtldC5wbC9hcGkyLycsIC8vIGxhc3Qgc2xhc2ggaXMgY3JpdGljYWxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQucGwnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldC9kb2NzLnBocD9maWxlPWFwaV9wdWJsaWMuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQubmV0L2RvY3MucGhwP2ZpbGU9YXBpX3ByaXZhdGUuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYml0bWFya2V0LW5ldC9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2pzb24ve21hcmtldH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdqc29uL3ttYXJrZXR9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnanNvbi97bWFya2V0fS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2pzb24vY3RyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vOTBtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vNmgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8xZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzdkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vMW0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8zbScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzZtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vMXknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ2Rlc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmdkZXNrU3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nZGVza0NvbmZpcm0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyeXB0b3RyYWRpbmdkZXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcnlwdG90cmFkaW5nZGVza1N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3J5cHRvdHJhZGluZ2Rlc2tDb25maXJtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdGaWF0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd1BMTlBQJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd0ZpYXRGYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5MaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5PcGVuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5DbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luQ2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5Nb2RpZnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkJhbGFuY2VBZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkJhbGFuY2VSZW1vdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N3YXBMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzd2FwT3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3dhcENsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCQ0gvUExOJzogeyAnaWQnOiAnQkNDUExOJywgJ3N5bWJvbCc6ICdCQ0gvUExOJywgJ2Jhc2UnOiAnQkNIJywgJ3F1b3RlJzogJ1BMTicgfSxcbiAgICAgICAgICAgICAgICAnQlRHL1BMTic6IHsgJ2lkJzogJ0JUR1BMTicsICdzeW1ib2wnOiAnQlRHL1BMTicsICdiYXNlJzogJ0JURycsICdxdW90ZSc6ICdQTE4nIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9QTE4nOiB7ICdpZCc6ICdCVENQTE4nLCAnc3ltYm9sJzogJ0JUQy9QTE4nLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnUExOJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnQlRDRVVSJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgICAgICAnTFRDL1BMTic6IHsgJ2lkJzogJ0xUQ1BMTicsICdzeW1ib2wnOiAnTFRDL1BMTicsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdQTE4nIH0sXG4gICAgICAgICAgICAgICAgJ0xUQy9CVEMnOiB7ICdpZCc6ICdMVENCVEMnLCAnc3ltYm9sJzogJ0xUQy9CVEMnLCAnYmFzZSc6ICdMVEMnLCAncXVvdGUnOiAnQlRDJyB9LFxuICAgICAgICAgICAgICAgICdMaXRlTWluZVgvQlRDJzogeyAnaWQnOiAnTGl0ZU1pbmVYQlRDJywgJ3N5bWJvbCc6ICdMaXRlTWluZVgvQlRDJywgJ2Jhc2UnOiAnTGl0ZU1pbmVYJywgJ3F1b3RlJzogJ0JUQycgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC40NSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjQ1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTkuOTksIDAuNDQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTkuOTksIDAuNDMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTkuOTksIDAuNDIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTkuOTksIDAuNDEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5Ljk5LCAwLjQwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OS45OSwgMC4zOSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQ5OTkuOTksIDAuMzggLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTk5Ljk5LCAwLjM3IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTk5OTkuOTksIDAuMzYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTk5OS45OSwgMC4zNSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQ5OTk5Ljk5LCAwLjM0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OTkuOTksIDAuMzMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5OTkuOTksIDAuMzIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTk5OTkuOTksIDAuMzEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OTkuOTksIDAuMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjE1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTkuOTksIDAuMTQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTkuOTksIDAuMTMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTkuOTksIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTkuOTksIDAuMTEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5Ljk5LCAwLjEwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OS45OSwgMC45IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDk5OS45OSwgMC44IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OS45OSwgMC43IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTk5OTkuOTksIDAuNiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI5OTk5Ljk5LCAwLjUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OS45OSwgMC40IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OTkuOTksIDAuMyAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzE5OTk5OS45OSwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OTk5Ljk5LCAwLjEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OTkuOTksIDAuMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDA4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExOJzogMixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMiwgLy8gU0VQQS4gVHJhbnNmZXIgSU5UIChTSEEpOiA1IEVVUlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMTic6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEluZm8gKCk7XG4gICAgICAgIGxldCBkYXRhID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBkYXRhWydiYWxhbmNlcyddO1xuICA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LCAnYmlkJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gKHRyYWRlWyd0eXBlJ10gPT09ICdiaWQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYw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LVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIGJpdG1leCBleHRlbmRzIEV4Y2hhbmdlIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnYml0bWV4JyxcbiAgICAgICAgICAgICduYW1lJzogJ0JpdE1FWCcsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1NDJywgLy8gU2V5Y2hlbGxlc1xuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ3VzZXJBZ2VudCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAyMDAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdlZGl0T3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFkJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAndGVzdCc6ICdodHRwczovL3Rlc3RuZXQuYml0bWV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjMxOS1mNjUzYzZlNi01ZWQ0LTExZTctOTMzZC1mMGJjMzY5OWFlOGYuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmJpdG1leC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0bWV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmJpdG1leC5jb20vYXBwL2FwaU92ZXJ2aWV3JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9CaXRNRVgvYXBpLWNvbm5lY3RvcnMvdHJlZS9tYXN0ZXIvb2ZmaWNpYWwtaHR0cCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5iaXRtZXguY29tL2FwcC9mZWVzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYW5ub3VuY2VtZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbm5vdW5jZW1lbnQvdXJnZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2FjdGl2ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudC9hY3RpdmVBbmRJbmRpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2FjdGl2ZUludGVydmFscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudC9jb21wb3NpdGVJbmRleCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudC9pbmRpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN1cmFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlYWRlcmJvYXJkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXF1aWRhdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJCb29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckJvb2svTDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZS9idWNrZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2NoZW1hJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzY2hlbWEvd2Vic29ja2V0SGVscCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2V0dGxlbWVudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzL2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9idWNrZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcGlLZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYXQvY2hhbm5lbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYXQvY29ubmVjdGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGVjdXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4ZWN1dGlvbi90cmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ25vdGlmaWNhdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2FmZmlsaWF0ZVN0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jaGVja1JlZmVycmFsQ29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jb21taXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2RlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21hcmdpbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9taW5XaXRoZHJhd2FsRmVlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXRIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldFN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcGlLZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleS9kaXNhYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcGlLZXkvZW5hYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjaGF0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvYnVsaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsQWxsQWZ0ZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2Nsb3NlUG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2lzb2xhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2xldmVyYWdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9yaXNrTGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL3RyYW5zZmVyTWFyZ2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NhbmNlbFdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY29uZmlybUVtYWlsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NvbmZpcm1FbmFibGVURkEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY29uZmlybVdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZGlzYWJsZVRGQScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9sb2dvdXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbG9nb3V0QWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3ByZWZlcmVuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3JlcXVlc3RFbmFibGVURkEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcmVxdWVzdFdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9idWxrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcGlLZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9hbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0SW5zdHJ1bWVudEFjdGl2ZUFuZEluZGljZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAobWFya2V0WydzdGF0ZSddICE9PSAnVW5saXN0ZWQnKTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsndW5kZXJseWluZyddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydxdW90ZUN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgdHlwZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBmdXR1cmUgPSBmYWxzZTtcbiAgICAgICAgICAgIGxldCBwcmVkaWN0aW9uID0gZmFsc2U7XG4gICAgICAgICAgICBsZXQgYmFzZXF1b3RlID0gYmFzZSArIHF1b3RlO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzd2FwID0gKGlkID09PSBiYXNlcXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgaWYgKHN3YXApIHtcbiAgICAgICAgICAgICAgICB0eXBlID0gJ3N3YXAnO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaWQuaW5kZXhPZiAoJ0JfJykgPj0gMCkge1xuICAgICAgICAgICAgICAgIHByZWRpY3Rpb24gPSB0cnVlO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAncHJlZGljdGlvbic7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGZ1dHVyZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgdHlwZSA9ICdmdXR1cmUnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAobWFya2V0Wydsb3RTaXplJ10pXG4gICAgICAgICAgICAgICAgcHJlY2lzaW9uWydhbW91bnQnXSA9IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAodGhpcy50cnVuY2F0ZV90b19zdHJpbmcgKG1hcmtldFsnbG90U2l6ZSddLCAxNikpO1xuICAgICAgICAgICAgaWYgKG1hcmtldFsndGlja1NpemUnXSlcbiAgICAgICAgICAgICAgICBwcmVjaXNpb25bJ3ByaWNlJ10gPSB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKHRoaXMudHJ1bmNhdGVfdG9fc3RyaW5nIChtYXJrZXRbJ3RpY2tTaXplJ10sIDE2KSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbG90U2l6ZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IG1hcmtldFsnbWF4T3JkZXJRdHknXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsndGlja1NpemUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBtYXJrZXRbJ21heFByaWNlJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBtYXJrZXRbJ3Rha2VyRmVlJ10sXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogbWFya2V0WydtYWtlckZlZSddLFxuICAgICAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICAgICAnc3BvdCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdzd2FwJzogc3dhcCxcbiAgICAgICAgICAgICAgICAnZnV0dXJlJzogZnV0dXJlLFxuICAgICAgICAgICAgICAgICdwcmVkaWN0aW9uJzogcHJlZGljdGlvbixcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRVc2VyTWFyZ2luICh7ICdjdXJyZW5jeSc6ICdhbGwnIH0pO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgcmVzcG9uc2UubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydhdmFpbGFibGVNYXJnaW4nXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWydtYXJnaW5CYWxhbmNlJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5ID09PSAnQlRDJykge1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGFjY291bnRbJ2ZyZWUnXSAqIDAuMDAwMDAwMDE7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IGFjY291bnRbJ3RvdGFsJ10gKiAwLjAwMDAwMDAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlb2YgbGltaXQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgcmVxdWVzdFsnZGVwdGgnXSA9IGxpbWl0O1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRPcmRlckJvb2tMMiAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2JpZHMnOiBbXSxcbiAgICAgICAgICAgICdhc2tzJzogW10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ25vbmNlJzogdW5kZ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WZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodHJhZGVbJ3RpbWVzdGFtcCddKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGlmICgnc3ltYm9sJyBpbiB0cmFkZSlcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbdHJhZGVbJ3N5bWJvbCddXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0cmRNYXRjaElEJ10sXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3NpZGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydzaXplJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlclN0YXR1cyAoc3RhdHVzKSB7XG4gICAgICAgIGxldCBzdGF0dXNlcyA9IHtcbiAgICAgICAgICAgICduZXcnOiAnb3BlbicsXG4gICAgICAgICAgICAncGFydGlhbGx5ZmlsbGVkJzogJ29wZW4nLFxuICAgICAg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VyWydvcmRlcklEJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogaXNvODYwMSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclsnb3JkVHlwZSddLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsnc2lkZSddLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZW9mIHNpbmNlICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHJlcXVlc3RbJ3N0Y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TtcbiAgICAgICAgaWYgKGNvZGUgPj0gNDAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keSkge1xuICAgICAgICAgICAgICAgIGlmIChib2R5WzBdID09PSAneycpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJ21lc3NhZ2UnIGluIHJlc3BvbnNlWydlcnJvciddKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2VbJ2Vycm9yJ10sICdtZXNzYWdlJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBtZXNzYWdlICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSA9PT0gJ0ludmFsaWQgQVBJIEtleS4nKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEF1dGhlbnRpY2F0aW9uRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN0dWIgY29kZSwgbmVlZCBwcm9wZXIgaGFuZGxpbmdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gJy9hcGknICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKG1ldGhvZCAhPT0gJ1BVVCcpXG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHF1ZXJ5ICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHF1ZXJ5O1xuICAgICAgICBpZiAoYXBpID09PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbWV0aG9kICsgcXVlcnkgKyBub25jZTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdQT1NUJyB8fCBtZXRob2QgPT09ICdQVVQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChwYXJhbXMpO1xuICAgICAgICAgICAgICAgICAgICBhdXRoICs9IGJvZHk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAg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dCaXRzbycsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ01YJywgLy8gTWV4aWNvXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwMCwgLy8gMzAgcmVxdWVzdHMgcGVyIG1pbnV0ZVxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjMnLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYzMzUtNzE1Y2U3YWEtNWVkNS0xMWU3LTg4YTgtMTczYTI3YmIzMGZlLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5iaXRzby5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9iaXRzby5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9iaXRzby5jb20vYXBpX2luZm8nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYml0c28uY29tL2ZlZXM/bD1lcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2F2YWlsYWJsZV9ib29rcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudF9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZlZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmdzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5ncy97ZmlkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19kZXN0aW5hdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAna3ljX2RvY3VtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVkZ2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvZmVlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVkZ2VyL2Z1bmRpbmdzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvd2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ214X2JhbmtfY29kZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl90cmFkZXMve29pZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97b2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhZGVzL3t0aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL3t3aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZWJpdF9jYXJkX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aGVyX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGhvbmVfbnVtYmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwaG9uZV92ZXJpZmljYXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bob25lX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NwZWlfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tvaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcwMjAxJzogQXV0aGVudGljYXRpb25FcnJvciwgLy8gSW52YWxpZCBOb25jZSBvciBJbnZhbGlkIENyZWRlbnRpYWxzXG4gICAgICAgICAgICAgICAgJzEwNCc6IEludmFsaWROb25jZSwgLy8gQ2Fubm90IHBlcmZvcm0gcmVxdWVzdCAtIG5vbmNlIG11c3QgYmUgaGlnaGVyIHRoYW4gMTUyMDMwNzIwMzcyNDIzN1xuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEF2YWlsYWJsZUJvb2tzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0c1sncGF5bG9hZCddLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sncGF5bG9hZCddW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0Wydib29rJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQudG9VcHBlckNhc2UgKCkucmVwbGFjZSAoJ18nLCAnLycpO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5pbXVtX2Ftb3VudCcpLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heGltdW1fYW1vdW50JyksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluaW11bV9wcmljZScpLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heGltdW1fcHJpY2UnKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbmltdW1fdmFsdWUnKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYXhpbXVtX3ZhbHVlJyksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsnbWluaW11bV9hbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ21pbmltdW1fcHJpY2UnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IGxpbWl0c1snYW1vdW50J11bJ21pbiddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRCYWxhbmNlICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncGF5bG9hZCddWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhdmFpbGFibGUnXSksXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydsb2NrZWQnXSksXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsndG90YWwnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE9yZGVyQm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdib29rJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gIC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gZmVlQ29zdCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGxldCBmZWVDdXJyZW5jeSA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdmZWVzX2N1cnJlbmN5Jyk7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGZlZUN1cnJlbmN5ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGlmIChmZWVDdXJyZW5jeSBpbiB0aGlzLmN1cnJlbmNpZXNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgIGZlZUN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jaWVzX2J5X2lkW2ZlZUN1cnJlbmN5XVsnY29kZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICdjb3N0JzogZmVlQ29zdCxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBmZWVDdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGNvc3QgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdtaW5vcicpO1xuICAgICAgICBpZiAodHlwZW9mIGNvc3QgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgY29zdCA9IE1hdGguYWJzIChjb3N0KTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IG9yZGVySWQgPSB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAnb2lkJyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcklkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdib29rJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlWydwYXlsb2FkJ10sIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE15VHJhZGVzIChzeW1ib2wgPSB1bmRlZmluZWQsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IDI1LCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIC8vIHRoZSBkb24ndCBzdXBwb3J0IGZldGNoaW5nIHRy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ICAgICAgJ21hcmtlcic6IHBhcnNlSW50IChwYXJhbXNbJ21hcmtlciddKSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdib29rJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ2xpbWl0JzogbGltaXQsIC8vIGRlZmF1bHQgPSAyNSwgbWF4ID0gMTAwXG4gICAgICAgICAgICAvLyAnc29ydCc6ICdkZXNjJywgLy8gZGVmYXVsdCA9IGRlc2NcbiAgICAgICAgICAgIC8vICdtYXJrZXInOiBpZCwgLy8gaW50ZWdlciBpZCB0byBzdGFydCBmcm9tXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldFVzZXJUcmFkZXMgKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlWydwYXlsb2FkJ10sIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnYm9vayc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnbWFqb3InOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09PSAnbGltaXQnKVxuICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ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N5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0SWQgPSBvcmRlclsnYm9vayddO1xuICAgICAgICAgICAgaWYgKG1hcmtldElkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbbWFya2V0SWRdO1xuICAgICAgICB9XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgb3JkZXJUeXBlID0gb3JkZXJbJ3R5cGUnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxIChvcmRlclsnY3JlYXRlZF9hdCddKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ29yaWdpbmFsX2Ftb3VudCcpO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAndW5maWxsZWRfYW1vdW50Jyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29pZCddLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclR5cGUsXG4g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VuZHBvaW50IF0uam9pbiAoJycpO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCAhPT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgICAgICByZXF1ZXN0ICs9IGJvZHk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHJlcXVlc3QpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gdGhpcy5hcGlLZXkgKyAnOicgKyBub25jZSArICc6JyArIHNpZ25hdHVyZTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0F1dGhvcml6YXRpb24nOiAnQml0c28gJyArIGF1dGgsXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGh0dHBDb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmICh0eXBlb2YgYm9keSAhPT0gJ3N0cmluZycpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoYm9keS5sZW5ndGggPCAyKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKChib2R5WzBdID09PSAneycpIHx8IChib2R5WzBdID09PSAnWycpKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmICgnc3VjY2VzcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIC8vICAgICB7XCJzdWNjZXNzXCI6ZmFsc2UsXCJlcnJvclwiOntcImNvZGVcIjoxMDQsXCJtZXNzYWdlXCI6XCJDYW5ub3QgcGVyZm9ybSByZXF1ZXN0IC0gbm9uY2UgbXVzdCBiZSBoaWdoZXIgdGhhbiAxNTIwMzA3MjAzNzI0MjM3XCJ9fVxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgbGV0IHN1Y2Nlc3MgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2UsICdzdWNjZXNzJywgZmFsc2UpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygc3VjY2VzcyA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChzdWNjZXNzID09PSAndHJ1ZScpIHx8IChzdWNjZXNzID09PSAnMScpKVxuICAgICAgICAgICAgICAgICAgICAgICAgc3VjY2VzcyA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Y2Nlc3MgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFzdWNjZXNzKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGZlZWRiYWNrID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBlcnJvciA9IHRoaXMuc2FmZVZhbHVlIChyZXNwb25zZSwgJ2Vycm9yJyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZXJyb3IgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY29kZSA9IHRoaXMuc2FmZVN0cmluZyAoZXJyb3IsICdjb2RlJyk7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGV4Y2VwdGlvbnMgPSB0aGlzLmV4Y2VwdGlvbnM7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb2RlIGluIGV4Y2VwdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBleGNlcHRpb25zW2NvZGVdIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgnc3VjY2VzcycgaW4gcmVzcG9uc2UpXG4gICAgICAgICAgICBpZiAocmVzcG9uc2VbJ3N1Y2Nlc3MnXSlcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgICA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1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3Nzg2Mzc3LThjOGFiNTdlLTVmZTktMTFlNy04ZWE0LTJiMDViNmJjY2VlYy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuYml0c3RhbXAubmV0L2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuYml0c3RhbXAubmV0L2FwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2sve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyX2hvdXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nLXBhaXJzLWluZm8vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiY2hfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JjaF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFuc2FjdGlvbnMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYW5zYWN0aW9ucy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycy9hbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9zdGF0dXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXkve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5L21hcmtldC97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwvbWFya2V0L3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2x0Y193aXRoZHJhd2FsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbHRjX2FkZHJlc3MvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldGhfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAneHJwX3dpdGhkcmF3YWwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd4cnBfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyLXRvLW1haW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2Zlci1mcm9tLW1haW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsLXJlcXVlc3RzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbC9vcGVuLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbC9zdGF0dXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsL2NhbmNlbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpcXVpZGF0aW9uX2FkZHJlc3MvbmV3LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlxdWlkYXRpb25fYWRkcmVzcy9pbmZvLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndjEnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fZGVwb3NpdF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndW5jb25maXJtZWRfYnRjLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl93aXRoZHJhd2FsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmlwcGxlX3dpdGhkcmF3YWwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyaXBwbGVfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMjUgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMjUgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0aWVycyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0YWtlcic6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMCwgMC4yNSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwLCAwLjI0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwLCAwLjIyIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDAwMDAwLCAwLjIwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNjAwMDAwLCAwLjE1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMCwgMC4xNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAsIDAuMTMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0MDAwMDAwLCAwLjEyIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMDAsIDAuMTEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwMSwgMC4xMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjI1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAsIDAuMjQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAsIDAuMjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0MDAwMDAsIDAuMjAgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs2MDAwMDAsIDAuMTUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwLCAwLjE0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMCwgMC4xMyAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQwMDAwMDAsIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwMCwgMC4xMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAxLCAwLjEwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRCc6IDI1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAuOTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiAyNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGluZ1BhaXJzSW5mbyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBiYXNlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBxdW90ZS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2xJZCA9IGJhc2VJZCArICdfJyArIHF1b3RlSWQ7XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3VybF9zeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYmFzZV9kZWNpbWFscyddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsnY291bnRlcl9kZWNpbWFscyddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwYXJ0cyA9IG1hcmtldFsnbWluaW11bV9vcmRlciddLnNwbGl0ICgnICcpO1xuICAgICAgICAgICAgbGV0IGNvc3QgPSBwYXJ0c1swXTtcbiAgICAgICAgICAgIC8vIGxldCBbIGNvc3QsIGN1cnJlbmN5IF0gPSBtYXJrZXRbJ21pbmltdW1fb3JkZXInXS5zcGxpdCAoJyAnKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAobWFya2V0Wyd0cmFkaW5nJ10gPT09ICdFbmFibGVkJyk7XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2xJZCc6IHN5bWJvbElkLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChjb3N0KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE9yZGVyQm9va1BhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc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odGlja2VyLCAnbG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2JpZCcpLFxuICAgICAgICAgICAgJ2JpZFZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYXNrJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB2d2FwLFxuICAgICAgICAgICAgJ29wZW4nOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnb3BlbicpLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGdldE1hcmtldEZyb21UcmFkZSAodHJhZGUpIHtcbiAgICAgICAgdHJhZGUgPSB0aGlzLm9taXQgKHRyYWRlLCBbXG4gICAgICAgICAgICAnZmVlJyxcbiAgICAgICAgICAgICdwcmljZScsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnLFxuICAgICAgICAgICAgJ3RpZCcsXG4gICAgICAgICAgICAndHlwZScsXG4gICAgICAgICAgICAnb3JkZXJfaWQnLFxuICAgICAgICAgICAgJ3NpZGUnLFxuICAgICAgICBdKTtcbiAgICAgICAgbGV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ZXQgbnVtU3ltYm9scyA9IHN5bWJvbHMubGVuZ3RoO1xuICAgICAgICBpZiAobnVtU3ltYm9scyA9PT0gMSlcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm1hcmtldHNbc3ltYm9sc1swXV07XG4gICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2RhdGUnIGluIHRyYWRlKSB7XG4gICAgICAgICAgICB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGUnXSkgKiAxMDAwO1xuICAgICAgICB9IGVsc2UgaWYgKCdkYXRldGltZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnZGF0ZXRpbWUnXSk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gb25seSBpZiBvdmVycmlkZWQgZXh0ZXJuYWxseVxuICAgICAgICBsZXQgc2lkZSA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdzaWRlJyk7XG4gICAgICAgIGxldCBvcmRlcklkID0gdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ29yZGVyX2lkJyk7XG4gICAgICAgIGlmICh0eXBlb2Ygb3JkZXJJZCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBpZiAodHlwZW9mIHNpZGUgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgc2lkZSA9IHRoaXMuc2FmZUludGVnZXIgKHRyYWRlLCAndHlwZScpO1xuICAgICAgICAgICAgICAgIGlmIChzaWRlID09PSAwKVxuICAgICAgICAgICAgICAgICAgICBzaWRlID0gJ2J1eSc7XG4gICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICBzaWRlID0gJ3NlbGwnO1xuICAgICAgICAgICAgfVxuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdwcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnYW1vdW50Jyk7XG4gICAgICAgIGxldCBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0aWQnKTtcbiAgICAgICAgaWQgPSB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAnaWQnLCBpZCk7XG4gICAgICAgIGlmICh0eXBlb2YgbWFya2V0ID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAodHJhZGUpO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKGtleXNbaV0uaW5kZXhPZiAoJ18nKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IGtleXNbaV0ucmVwbGFjZSAoJ18nLCAnJyk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChtYXJrZXRJZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbbWFya2V0SWRdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGlmIHRoZSBtYXJrZXQgaXMgc3RpbGwgbm90IGRlZmluZWRcbiAgICAgICAgICAgIC8vIHRyeSB0byBkZWR1Y2UgaXQgZnJvbSB1c2VkIGtleXNcbiAgICAgICAgICAgIGlmICh0eXBlb2YgbWFya2V0ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLmdldE1hcmtldEZyb21UcmFkZSAodHJhZGUpO1xuICAgICAgICB9XG4gICAgICAgIGxldCBmZWVDb3N0ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnZmVlJyk7XG4gICAgICAgIGxldCBmZWVDdXJyZW5jeSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBwcmljZSA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgbWFya2V0WydzeW1ib2xJZCddLCBwcmljZSk7XG4gICAgICAgICAgICBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsIG1hcmtldFsnYmFzZUlkJ10sIGFtb3VudCk7XG4gICAgICAgICAgICBmZWVDdXJyZW5jeSA9IG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgcHJpY2UgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGFtb3VudDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXJJZCxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgIC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9mIHRyYW5zYWN0aW9ucyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5ICh0cmFuc2FjdGlvbnMpKSB7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0cmFuc2FjdGlvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRyYWRlID0gdGhpcy5wYXJzZVRyYWRlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAgICAgICAgIH0sIHRyYW5zYWN0aW9uc1tpXSksIG1hcmtldCk7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCArPSB0cmFkZVsnYW1vdW50J107XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZmVlQ29zdCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgICAgICBmZWVDb3N0ID0gMC4wO1xuICAgICAgICAgICAgICAgICAgICBmZWVDb3N0ICs9IHRyYWRlWydmZWUnXVsnY29zdCddO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgY29zdCA9IDAuMDtcbiAgICAgICAgICAgICAgICAgICAgY29zdCArPSB0cmFkZVsnY29zdCddO1xuICAgICAgICAgICAgICAgICAgICB0cmFkZXMucHVzaCAodHJhZGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ3N0YXR1cycpO1xuICAgICAgICBpZiAoKHN0YXR1cyA9PT0gJ0luIFF1ZXVlJykgfHwgKHN0YXR1cy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lZCcpIHtcbiAgICAgICAgICAgIGlmIChmaWxsZWQgPiAwKVxuICAgICAgICAgICAgICAgIHByaWNlID0gY29zdCAvIGZpbGxlZDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgZmVlID0ge1xuICAgICAgICAgICAgJ2Nvc3QnOiBmZWVDb3N0LFxuICAgICAgICAgICAgJ2N1cnJlbmN5JzogZmVlQ3VycmVuY3ksXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGlzbzg2MDEsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9wZW5PcmRlcnMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1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xdWVyeSkpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLyc7XG4gICAgICAgIGlmIChhcGkgIT09ICd2MScpXG4gICAgICAgICAgICB1cmwgKz0gdGhpcy52ZXJzaW9uICsgJy8nO1xuICAgICAgICB1cmwgKz0gdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG5vbmNlICsgdGhpcy51aWQgKyB0aGlzLmFwaUtleTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmVuY29kZSAodGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpKTtcbiAgICAgICAgICAgIHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAna2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ3NpZ25hdHVyZSc6IHNpZ25hdHVyZS50b1VwcGVyQ2FzZSAoKSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHF1ZXJ5KTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChodHRwQ29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAodHlwZW9mIGJvZHkgIT09ICdzdHJpbmcnKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKGJvZHkubGVuZ3RoIDwgMilcbiAgICAgICAgICAgIHJldHVybjsgLy8gZmFsbGJhY2sgdG8gZGVmYXVsdCBlcnJvciBoYW5kbGVyXG4gICAgICAgIGlmICgoYm9keVswXSA9PT0gJ3snKSB8fCAoYm9keVswXSA9PT0gJ1snKSkge1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5zYWZlU3RyaW5nIChyZ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RhbXAxIGV4dGVuZHMgRXhjaGFuZ2Uge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdiaXRzdGFtcDEnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQml0c3RhbXAgdjEnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdHQicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3ODYzNzctOGM4YWI1N2UtNWZlOS0xMWU3LThlYTQtMmIwNWI2YmNjZWVjLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdHN0YW1wLm5ldCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfaG91cicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldXJfdXNkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfYWxsX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndW5jb25maXJtZWRfYnRjJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyaXBwbGVfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmlwcGxlX2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxfcmVxdWVzdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fd2l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tcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZSArIHRoaXMudWlkICsgdGhpcy5hcGlLZXk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5lbmNvZGUgKHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKSk7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBxdWVyeSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1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ydHMgPSBjbGFzcyBiaXR0cmV4IGV4dGVuZHMgRXhjaGFuZ2Uge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdiaXR0cmV4JyxcbiAgICAgICAgICAgICduYW1lJzogJ0JpdHRyZXgnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdVUycsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MS4xJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgLy8gbmV3IG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJ29uZU1pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJ2ZpdmVNaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAndGhpcnR5TWluJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnaG91cicsXG4gICAgICAgICAgICAgICAgJzFkJzogJ2RheScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjM1Mi1jZjBiM2MyNi01ZWQ1LTExZTctODJiNy1mMzgyNmI3YTk3ZDguanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYml0dHJleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnbWFya2V0JzogJ2h0dHBzOi8vYml0dHJleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3YyJzogJ2h0dHBzOi8vYml0dHJleC5jb20vYXBpL3YyLjAvcHViJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0dHJleC5jb20vSG9tZS9BcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubnBtanMub3JnL3BhY2thZ2Uvbm9kZS5iaXR0cmV4LmFwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0dHJleC5jb20vRmVlcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3N1cHBvcnQuYml0dHJleC5jb20vaGMvZW4tdXMvYXJ0aWNsZXMvMTE1MDAwMTk5NjUxLVdoYXQtZmVlcy1kb2VzLUJpdHRyZXgtY2hhcmdlLScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd2Mic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jaWVzL0dldEJUQ1ByaWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvR2V0VGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9HZXRMYXRlc3RUaWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNYXJrZXRzL0dldE1hcmtldFN1bW1hcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L0dldExhdGVzdFRpY2snLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzdW1tYXJpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdhY2NvdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0YWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdtYXJrZXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5bGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eW1hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVub3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxtYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVEMnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkREJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWFQnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1QnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JERCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgLy8gJ0NhbGwgdG8gQ2FuY2VsIHdhcyB0aHJvdHRsZWQuIFRyeSBhZ2FpbiBpbiA2MCBzZWNvbmRzLic6IEREb1NQcm90ZWN0aW9uLFxuICAgICAgICAgICAgICAgIC8vICdDYWxsIHRvIEdldEJhbGFuY2VzIHdhcyB0aHJvdHRsZWQuIFRyeSBhZ2FpbiBpbiA2MCBzZWNvbmRzLic6IEREb1NQcm90ZWN0aW9uLFxuICAgICAgICAgICAgICAgICdBUElTSUdOX05PVF9QUk9WSURFRCc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJ0lOVkFMSURfU0lHTkFUVVJFJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnSU5WQUxJRF9DVVJSRU5DWSc6IEV4Y2hhbmdlRXJyb3IsXG4gICAgICAgICAgICAgICAgJ0lOVkFMSURfUEVSTUlTU0lPTic6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJ0lOU1VGRklDSUVOVF9GVU5EUyc6IEluc3VmZmljaWVudEZ1bmRzLFxuICAgICAgICAgICAgICAgICdRVUFOVElUWV9OT1RfUFJPVklERUQnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJ01JTl9UUkFERV9SRVFVSVJFTUVOVF9OT1RfTUVUJzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICdPUkRFUl9OT1RfT1BFTic6IEludmFsaWRPcmRlcixcbi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uICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHJlc3BvbnNlWydyZXN1bHQnXS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHJlc3BvbnNlWydyZXN1bHQnXVtpXVsnTWFya2V0J107XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ01hcmtldE5hbWUnXTtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBtYXJrZXRbJ01hcmtldEN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsnQmFzZUN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gbWFya2V0WydJc0FjdGl2ZSddIHx8IG1hcmtldFsnSXNBY3RpdmUnXSA9PT0gJ3RydWUnO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ01pblRyYWRlU2l6ZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5hY2NvdW50R2V0QmFsYW5jZXMgKHBhcmFtcyk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgaW5kZXhlZCA9IHRoaXMuaW5kZXhCeSAoYmFsYW5jZXMsICdDdXJyZW5jeScpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChpbmRleGVkKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW2ldO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBpbmRleGVkW2lkXTtcbiAgICAgICAgICAgIGxldCBmcmVlID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnQXZhaWxhYmxlJ10pO1xuICAgICAgICAgICAgbGV0IHRvdGFsID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnQmFsYW5jZSddKTtcbiAgICAgICAgICAgIGxldCB1c2VkID0gdG90YWwgLSBmcmVlO1xuICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gZnJlZTtcbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHVzZWQ7XG4gICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdG90YWw7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAndHlwZSc6ICdib3RoJyxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGlmICgndHlwZScgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICBpZiAocGFyYW1zWyd0eXBlJ10gPT09ICdidXknKSB7XG4gICAgICAgICAgICAgICAgb3JkZXJib29rID0ge1xuICAgICAgICAgICAgICAgICAgICAnYnV5JzogcmVzcG9uc2VbJ3Jlc3VsdCddLFxuICAgICAgICAgICAgICAgICAgICAnc2VsbCc6IFtdLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHBhcmFtc1sndHlwZSddID09PSAnc2VsbCcpIHtcbiAgICAgICAgICAgICAgICBvcmRlcmJvb2sgPSB7XG4gICAgICAgICAgICAgICAgICAgICdidXknOiBbXSxcbiAgICAgICAgICAgICAgICAgICAgJ3NlbGwnOiByZXNwb25zZVsncmVzdWx0J10sXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdidXknLCAnc2VsbCcsICdSYXRlJywgJ1F1YW50aXR5Jyk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnNhZmVTdHJpbmcgKHRpY2tlciwgJ1RpbWVTdGFtcCcpO1xuICAgICAgICBsZXQgaXNvODYwMSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiB0aW1lc3RhbXAgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICBpZiAodGltZXN0YW1wLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodGltZXN0YW1wKTtcbiAgICAgICAgICAgICAgICBpc284NjAxID0gdGhpcy5pc284NjAxICh0aW1lc3RhbXApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgcHJldmlvdXMgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnUHJldkRheScpO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdMYXN0Jyk7XG4gICAgICAgIGxldCBjaGFuZ2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBwZXJjZW50YWdlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIGxhc3QgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmV2aW91cyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBjaGFuZ2UgPSBsYXN0IC0gcHJldmlvdXM7XG4gICAgICAgICAgICAgICAgaWYgKHByZXZpb3VzID4gMClcbiAgICAgICAgICAgICAgICAgICAgcGVyY2VudGFnZSA9IChjaGFuZ2UgLyBwcmV2aW91cykgKiAxMDA7XG4gICAgICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGlzbzg2MDEsXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdIaWdoJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0xvdycpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2Fm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gICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY3lbJ0N1cnJlbmN5J107XG4gICAgICAgICAgICAvLyB0b2RvOiB3aWxsIG5lZWQgdG8gcmV0aGluayB0aGUgZmVlc1xuICAgICAgICAgICAgLy8gdG8gYWRkIHN1cHBvcnQgZm9yIG11bHRpcGxlIHdpdGhkcmF3YWwvZGVwb3NpdCBtZXRob2RzIGFuZFxuICAgICAgICAgICAgLy8gZGlmZmVyZW50aWF0ZWQgZmVlcyBmb3IgZWFjaCBwYXJ0aWN1bGFyIG1ldGhvZFxuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQpO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IDg7IC8vIGRlZmF1bHQgcHJlY2lzaW9uLCB0b2RvOiBmaXggXCJtYWdpYyBjb25zdGFudHNcIlxuICAgICAgICAgICAgbGV0IGFkZHJlc3MgPSB0aGlzLnNhZmVWYWx1ZSAoY3VycmVuY3ksICdCYXNlQWRkcmVzcycpO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAndHlwZSc6IGN1cnJlbmN5WydDb2luVHlwZSddLFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ0N1cnJlbmN5TG9uZyddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBjdXJyZW5jeVsnSXNBY3RpdmUnXSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAnZmVlJzogdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAnVHhGZWUnKSwgLy8gdG9kbzogcmVkZXNpZ25cbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydUeEZlZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVma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AgICAgdGltZXN0YW1wID0gbGFzdFRyYWRlVGltZXN0YW1wO1xuICAgICAgICBsZXQgaXNvODYwMSA9ICh0eXBlb2YgdGltZXN0YW1wICE9PSAndW5kZWZpbmVkJykgPyB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCkgOiB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBjb21taXNzaW9uID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ0NvbW1pc3Npb24nIGluIG9yZGVyKSB7XG4gICAgICAgICAgICBjb21taXNzaW9uID0gJ0NvbW1pc3Npb24nO1xuICAgICAgICB9IGVsc2UgaWYgKCdDb21taXNzaW9uUGFpZCcgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGNvbW1pc3Npb24gPSAnQ29tbWlzc2lvblBhaWQnO1xuICAgICAgICB9XG4gICAgICAgIGlmIChjb21taXNzaW9uKSB7XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0IChvcmRlcltjb21taXNzaW9uXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgICAgICBmZWVbJ2N1cnJlbmN5J10gPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnTGltaXQnKTtcbiAgICAgICAgbGV0IGNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdQcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnUXVhbnRpdHknKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ1F1YW50aXR5UmVtYWluaW5nJywgMC4wKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgaWYgKCFjb3N0KSB7XG4gICAgICAgICAgICBpZiAocHJpY2UgJiYgYW1vdW50KVxuICAgICAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGFtb3VudDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIXByaWNlKSB7XG4gICAgICAgICAgICBpZiAoY29zdCAmJiBmaWxsZWQpXG4gICAgICAgICAgICAgICAgcHJpY2UgPSBjb3N0IC8gZmlsbGVkO1xuICAgICAgICB9XG4gICAgICAgIGxldCBhdmVyYWdlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnUHJpY2VQZXJVbml0Jyk7XG4gICAgICAgIGxldCBpZCA9IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdPcmRlclV1aWQnKTtcbiAgICAgICAgaWYgKHR5cGVvZiBpZCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBpZCA9IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdPcmRlcklkJyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogaXNvODYwMSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiBsYXN0VHJhZGVUaW1lc3RhbXAsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IGF2ZXJhZ2UsXG4gICAgICAgICAgICAnYW1vdW50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7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyAnLyc7XG4gICAgICAgIGlmIChhcGkgIT09ICd2MicpXG4gICAgICAgICAgICB1cmwgKz0gdGhpcy52ZXJzaW9uICsgJy8nO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IGFwaSArICcvJyArIG1ldGhvZC50b0xvd2VyQ2FzZSAoKSArIHBhdGg7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT09ICd2MicpIHtcbiAgICAgICAgICAgIHVybCArPSBwYXRoO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICB1cmwgKz0gYXBpICsgJy8nO1xuICAgICAgICAgICAgaWYgKCgoYXBpID09PSAnYWNjb3VudCcpICYmIChwYXRoICE9PSAnd2l0aGRyYXcnKSkgfHwgKHBhdGggPT09ICdvcGVub3JkZXJzJykpXG4gICAgICAgICAgICAgICAgdXJsICs9IG1ldGhvZC50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIHVybCArPSBwYXRoICsgJz8nICsgdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAodXJsKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ2FwaXNpZ24nOiBzaWduYXR1cmUgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIC8vIHsgc3VjY2VzczogZmFsc2UsIG1lc3NhZ2U6IFwibWVzc2FnZVwiIH1cbiAgICAgICAgICAgIGxldCBzdWNjZXNzID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAnc3VjY2VzcycpO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBzdWNjZXNzID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICc6IG1hbGZvcm1lZCByZXNwb25zZTogJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgIGlmICh0eXBlb2Ygc3VjY2VzcyA9PT0gJ3N0cmluZycpXG4gICAgICAgICAgICAgICAgLy8gYmxldXRyYWRlIHVzZXMgc3RyaW5nIGluc3RlYWQgb2YgYm9vbGVhblxuICAgICAgICAgICAgICAgIHN1Y2Nlc3MgPSA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zFtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzU4NjI2MDYtNGY1NTRmMTQtMGI1ZC0xMWU4LTk1N2QtMzUwNThjNTA0YjZmLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5iaXQtei5jb20vYXBpX3YxJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdC16LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5iaXQtei5jb20vYXBpLmh0bWwnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vd3d3LmJpdC16LmNvbS9hYm91dC9mZWUnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcmFsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZUFkZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVDYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RLS1QnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGQ1QnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFNLJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hYSSc6ICcwLjglJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNWkMnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dYUyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUE0nOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JMSyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVMnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFNSJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05VTFMnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVk9JU0UnOiAzNTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVknOiAxLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMC42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lCQ1QnOiAzNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPVE4nOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRYJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQU1FJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTlQnOiA5LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1NTJzogMTUwMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSSyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVJUJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xFTyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0InOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlNDJzogMTMwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklVJzogMzUwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSTic6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVlRDJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDRCc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAyMDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIV0MnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVU5JVCc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPWFknOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNPJzogMC4zNTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NCVEMnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNYJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VURic6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQWUxOVCc6IDAuNDAwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUkInOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdvcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdsYXN0Tm9uY2VUaW1lc3RhbXAnOiAwLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdQWEMnOiAnUGl4aWVjb2luJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyYWxsICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGJhc2VJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHF1b3RlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2VzIChwYXJhbXMpO1xuICAgICAgICBsZXQgZGF0YSA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHRoaXMub21pdCAoZGF0YSwgJ3VpZCcpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW2ldO1xuICAgICAgICAgICAgbGV0IGlkSGFzVW5kZXJzY29yZSA9IChpZC5pbmRleE9mICgnXycpID49IDApO1xuICAgICAgICAgICAgaWYgKCFpZEhhc1VuZGVyc2NvcmUpIHtcbiAgICAgICAgICAgICAgICBsZXQgY29kZSA9IGlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGlmIChpZCBpbi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lwZScpO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBzaWRlICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBzaWRlID0gKHNpZGUgPT09ICdpbicpID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHNpZGUgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIHNpZGUgPSB0aGlzLnNhZmVTdHJpbmcgKG9yZGVyLCAnZmxhZycpO1xuICAgICAgICB9XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdudW1iZXInKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ251bWJlcm92ZXInKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBmaWxsZWQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIHJlbWFpbmluZyA9IGFtb3VudCAtIGZpbGxlZDtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGlzbzg2MDEgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnZGF0ZXRpbWUnIGluIG9yZGVyKSB7XG4gICAgICAgICAgICB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAob3JkZXJbJ2RhdGV0aW1lJ10pO1xuICAgICAgICAgICAgaXNvODYwMSA9IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiBpc284NjAxLFxuICAgICAgICAgICAgJ3RpbWVzdGF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AgICByZXR1cm4gdGhpcy5vcHRpb25zWydsYXN0Tm9uY2UnXTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgcGF0aDtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChxdWVyeS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHF1ZXJ5O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMua2V5c29ydCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYXBpX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aGlzLnNlY29uZHMgKCksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogdGhpcy5ub25jZSAoKSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpKTtcbiAgICAgICAgICAgIGJvZHkgKz0gJyZzaWduPScgKyB0aGlzLmhhc2ggKHRoaXMuZW5jb2RlIChib2R5ICsgdGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdDb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGxldCBjb2RlID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ2NvZGUnKTtcbiAgICAgICAgaWYgKGNvZGUgIT09ICcwJykge1xuICAgICAgICAgICAgbGV0IEVycm9yQ2xhc3MgPSB0aGlzLnNhZmVWYWx1ZSAoe1xuICAgICAgICAgICAgICAgICcxMDMnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDQnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcyMDAnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcyMDInOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICc0MDEnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICc0MDYnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcyMDMnOiBJbnZhbGlkTm9uY2UsXG4gICAgICAgICAgICAgICAgJzIwMSc6IE9yZGVyTm90Rm91bmQsXG4gICAgICAgICAgICAgICAgJzQwOCc6IEluc3VmZmljaWVudEZ1bmRzLFxuICAgICAgICAgICAgICAgICcxMDYnOiBERG9TUHJvdGVjdGlvbixcbiAgICAgICAgICAgIH0sIGNvZG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1JTJzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODUwMTc1Mi02MGMyMWI4Mi02ZmViLTExZTctODE4Yi0wNTVlZTZkMGU3NTQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJsM3AuZXUnLFxuICAgICAgICAgICAgICAgICd3d3cnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JsM3AuZXUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRvbmljLm5sJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vQml0b25pY05ML2JsM3AtYXBpL3RyZWUvbWFzdGVyL2RvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9ibDNwLmV1L2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpdG9uaWMubmwvZW4vYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9kZXB0aC9mdWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9vcmRlci9hZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L21vbmV5L29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvb3JkZXIvcmVzdWx0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L21vbmV5L29yZGVycy9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS90cmFkZXMvZmV0Y2gnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dFTk1LVC9tb25leS9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRU5NS1QvbW9uZXkvZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRU5NS1QvbW9uZXkvbmV3X2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VOTUtUL21vbmV5L3dhbGxldC9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRU5NS1QvbW9uZXkvd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdCVENFVVInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJywgJ21ha2VyJzogMC4wMDI1LCAndGFrZXInOiAwLjAwMjUg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jdXJyZW5jeSBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCdiYWxhbmNlJyBpbiBiYWxhbmNlW2N1cnJlbmN5XSkge1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ2JhbGFuY2UnXVsndmFsdWUnXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGFjY291bnRbJ3RvdGFsJ10pIHtcbiAgICAgICAgICAgICAgICBpZiAoYWNjb3VudFsnZnJlZSddKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIHBhcnNlQmlkQXNrIChiaWRhc2ssIHByaWNlS2V5ID0gMCwgYW1vdW50S2V5ID0gMCkge1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgYmlkYXNrW3ByaWNlS2V5XSAvIDEwMDAwMC4wLFxuICAgICAgICAgICAgYmlkYXNrW2Ftb3VudEtleV0gLyAxMDAwMDAwMDAuMCxcbiAgICAgICAgXTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldE9yZGVyY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9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sdW1lJ11bJzI0aCddKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0cmFkZV9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRyYWRlWydkYXRlJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRyYWRlWydkYXRlJ10pLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ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FjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoeyAnbm9uY2UnOiBub25jZSB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuYmFzZTY0VG9CaW5hcnkgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBxdW90ZXNcbiAgICAgICAgICAgIGxldCBhdXRoID0gcmVxdWVzdCArIFwiXFwwXCIgKyBib2R5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCBzZWNyZXQsICdzaGE1MTInLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnUmVzdC1LZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnUmVzdC1TaWduJzogdGhpcy5kZWNvZGUgKHNpZ25hdHVyZSksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwg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2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzAzMDMwMDAtYjYwMmRiZTYtOTc2ZC0xMWU3LTk1NmQtMzZjNTA0OWMwMWU3LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2JsZXV0cmFkZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQnOiAnaHR0cHM6Ly9ibGV1dHJhZGUuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdtYXJrZXQnOiAnaHR0cHM6Ly9ibGV1dHJhZGUuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYmxldXRyYWRlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JsZXV0cmFkZS5jb20vaGVscC9BUEknLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYmxldXRyYWRlLmNvbS9oZWxwL2ZlZXNfYW5kX2RlYWRsaW5lcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBREMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRBJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JJVEInOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDRCc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JMSyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRE4nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0xBTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDUic6IDAuMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RQJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RQQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRkwnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWFAnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRkpDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JTVFknOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOTEcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFRNTCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNT05BJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNT09OJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05NQyc6IDAuMDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FT1MnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlZDJzogMC4wNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPSyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9UJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hQTSc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkREJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NMUic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVEFSVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTEcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJPTEwnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVU5PJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWUkMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVlRDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hWUCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXREMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRVQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZXhjZXB0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAnSW5zdWZmaWNpZW50IGZ1bmRzISc6IEluc3VmZmljaWVudEZ1bmRzLFxuICAgICAgICAgICAgICAgICdJbnZhbGlkIE9yZGVyIElEJzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICdJbnZhbGlkIGFwaWtleSBvciBhcGlzZWNyZXQnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdvcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdwYXJzZU9yZGVyU3RhdHVzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1sncmVzdWx0J10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydyZXN1bHQnXVtwXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnTWFya2V0TmFtZSddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ01hcmtldEN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ0Jhc2VDdXJyZW5jeSddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IG1hcmtldFsnSXNBY3RpdmUnXTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnTWluVHJhZGVTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlclN0YXR1cyAoc3RhdHVzKSB7XG4gICAgICAgIGxldCBzdGF0dXNlcyA9IHtcbiAgICAgICAgICAgICdPSyc6ICdj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gICAnY291bnRyaWVzJzogJ0JSJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzQ3MDM1OTMtYzQ0OTg2NzQtZjUwNC0xMWU3LThkMTQtZmY4ZTQ0ZmI3OGMxLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2JyYXppbGlleC5jb20vYXBpL3YxJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYnJhemlsaWV4LmNvbS8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9icmF6aWxpZXguY29tL2V4Y2hhbmdlL2FwaS5waHAnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYnJhemlsaWV4LmNvbS9leGNoYW5nZS9mZWVzLnBocCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2sve21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlaGlzdG9yeS97bWFya2V0fScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tcGxldGVfYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDA1LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1x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5zYWZlSW50ZWdlciAoY3VycmVuY3ksICdpc193aXRoZHJhd2FsX2FjdGl2ZScpID09PSAxO1xuICAgICAgICAgICAgbGV0IGNhbkRlcG9zaXQgPSB0aGlzLnNhZmVJbnRlZ2VyIChjdXJyZW5jeSwgJ2lzX2RlcG9zaXRfYWN0aXZlJykgPT09IDE7XG4gICAgICAgICAgICBpZiAoIWNhbldpdGhkcmF3IHx8ICFjYW5EZXBvc2l0KVxuICAgICAgICAgICAgICAgIGFjdGl2ZSA9IGZhbHNlO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WyduYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY3RpdmUnOiBjYW5XaXRoZHJhdyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmZWUnOiBjdXJyZW5jeVsndHhXaXRoZHJhd2FsRmVlJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGNhbkRlcG9zaXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlJzogY3VycmVuY3lbJ3R4RGVwb3NpdEZlZSddLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnbWluQW1vdW50VHJhZGUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydNaW5XaXRoZHJhd2FsJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnbWluRGVwb3NpdCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlciAoKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaWRdO1xuICAgICAgICAgICAgbGV0IFsgYmFzZUlkLCBxdW90ZUlkIF0gPSBpZC5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gYmFzZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IHRoaXMuc2FmZUludGVnZXIgKG1hcmtldCwgJ2FjdGl2ZScpID09PSAxO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbC50b1VwcGVyQ2FzZSAoKSxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgI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V0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgdGlja2VyID0ge1xuICAgICAgICAgICAgICAgICdkYXRlJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgICAgICd0aWNrZXInOiB0aWNrZXJzW2lkXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRPcmRlcmJvb2tNYXJrZXQgKHRoaXMuZXh0ZW5kICh7XG4gIC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zKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaWRdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlJ10pLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ3RvdGFsJ10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgbGV0IG1hcmtldElkID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ21hcmtldCcpO1xuICAgICAgICAgICAgaWYgKG1hcmtldElkKVxuICAgICAgICAgICA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VlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdjb21tYW5kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiB0aGlzLm5vbmNlICgpLFxuICAgICAgICAgICAgfSwgcXVlcnkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHRoaXMuZGVjb2RlIChzaWduYXR1cmUpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQg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JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmJ0Y2JveC5jby5qcC9oZWxwL2FzbScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWxsdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9hZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfdmlldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvSlBZJzogeyAnaWQnOiAnQlRDL0pQWScsICdzeW1ib2wnOiAnQlRDL0pQWScsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdKUFknIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzEwNCc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzEwNSc6IFBlcm1pc3Npb25EZW5pZWQsXG4gICAgICAgICAgICAgICAgJzEwNic6IEludmFsaWROb25jZSxcbiAgICAgICAgICAgICAgICAnMTA3JzogSW52YWxpZE9yZGVyLCAvLyBwcmljZSBzaG91bGQgYmUgYW4gaW50ZWdlclxuICAgICAgICAgICAgICAgICcyMDAnOiBJbnN1ZmZpY2llbnRGdW5kcyxcbiAgICAgICAgICAgICAgICAnMjAxJzogSW52YWxpZE9yZGVyLCAvLyBhbW91bnQgdG9vIHNtYWxsXG4gICAgICAgICAgICAgICAgJzIwMic6IEludmFsaWRPcmRlciwgLy8gcHJpY2Ugc2hvdWxkIGJlIFswIDogMTAwMDAwMF1cbiAgICAgICAgICAgICAgICAnMjAzJzogT3JkZXJOb3RGb3VuZCxcbiAgICAgICAgICAgICAgICAnNDAxJzogT3JkZXJOb3RGb3VuZCwgLy8gY2FuY2VsIGNhbmNlbGVkLCBjbG9zZWQgb3Igbm9uLWV4aXN0ZW50IG9yZGVyXG4gICAgICAgICAgICAgICAgJzQwMic6IEREb1NQcm90ZWN0aW9uLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5je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4gICAgICAgIGxldCBudW1TeW1ib2xzID0gdGhpcy5zeW1ib2xzLmxlbmd0aDtcbiAgICAgICAgaWYgKG51bVN5bWJvbHMgPiAxKVxuICAgICAgICAgICAgcmVxdWVzdFsnY29pbiddID0gbWFya2V0WydpZCddO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXREZXB0aCAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdCcpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdoaWdoJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvdycpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdidXknKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICA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tldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHt9O1xuICAgICAgICBsZXQgbnVtU3ltYm9scyA9IHRoaXMuc3ltYm9scy5sZW5ndGg7XG4gICAgICAgIGlmIChudW1TeW1ib2xzID4gMSlcbiAgICAgICAgICAgIHJlcXVlc3RbJ2NvaW4nXSA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDsgLy8gR01UIHRpbWVcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10sXG4gICAgICAgICAgICAnb3JkZXInOiB1bmR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3N0YXR1cyddID0gJ29wZW4nO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBvcmRlcnM7XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKTtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGxldCBzZWNyZXQgPSB0aGlzLmhhc2ggKHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgcXVlcnlbJ3NpZ25hdHVyZSddID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocmVxdWVzdCksIHRoaXMuZW5jb2RlIChzZWNyZXQpKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChodHRwQ29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICAvLyB0eXBpY2FsIGVycm9yIHJlc3BvbnNlOiB7XCJyZXN1bHRcIjpmYWxzZSxcImNvZGVcIjpcIjQwMVwifVxuICAgICAgICBpZiAoaHR0cENvZGUgPj0gNDAwKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyByZXNvcnQgdG8gZGVmYXVsdEVycm9ySGFuZGxlclxuICAgICAgICBpZiAoYm9keVswXSAhPT0gJ3snKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBub3QganNvbiwgcmVzb3J0IHRvIGRlZmF1bHRFcnJvckhhbmRsZXJcbiAgICAgICAgY29uc3QgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgY29uc3QgcmVzdWx0ID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAncmVzdWx0Jyk7XG4gICAgICAgIGlmICh0eXBlb2YgcmVzdWx0ID09PSAndW5kZWZpbmVkJyB8fCByZXN1bHQgPT09IHRydWUpXG4gICAgICAgICAgICByZXR1cm47IC8vIGVpdGhlciBwdWJsaWMgQVBJIChubyBlcnJvciBjb2RlcyBleHBl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AncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYzNjgtNDY1YjMyODYtNWVkNi0xMWU3LTlhMTEtMGY2NDY3ZTFkODJiLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3BsdXMnOiAnaHR0cHM6Ly9wbHVzLWFwaS5idGNjaGluYS5jb20vbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2RhdGEuYnRjY2hpbmEuY29tL2RhdGEnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5idGNjaGluYS5jb20vYXBpX3RyYWRlX3YxLnBocCcsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJ0Y2NoaW5hLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5idGNjaGluYS5jb20vYXBpZG9jcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncGx1cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5ZGF0YScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQnV5SWNlYmVyZ09yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCdXlPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQnV5T3JkZXIyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCdXlTdG9wT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbEljZWJlcmdPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbFN0b3BPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QWNjb3VudEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEFyY2hpdmVkT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEFyY2hpdmVkT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREZXBvc2l0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0SWNlYmVyZ09yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRJY2ViZXJnT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXREZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0RGVwdGgyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRTdG9wT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFN0b3BPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0V2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0V2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlcXVlc3RXaXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZWxsSWNlYmVyZ09yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZWxsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlbGxPcmRlcjInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlbGxTdG9wT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9DTlknOiB7ICdpZCc6ICdidGNjbnknLCAnc3ltYm9sJzogJ0JUQy9DTlknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ05ZJywgJ2FwaSc6ICdwdWJsaWMnLCAncGx1cyc6IGZhbHNlIH0sXG4gICAgICAgICAgICAgICAgJ0xUQy9DTlknOiB7ICdpZCc6ICdsdGNjbnknLCAnc3ltYm9sJzogJ0xUQy9DTlknLCAnYmFzZSc6ICdMVEMnLCAncXVvdGUnOiAnQ05ZJywgJ2FwaSc6ICd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BhcnRzWzFdO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBiYXNlID0gYmFzZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIHF1b3RlID0gcXVvdGUudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0QWNjb3VudEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNba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y5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgbWV0aG9kID0gbWFya2V0WydhcGknXSArICdHZXRPcmRlcmJvb2snO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMuY3JlYXRlTWFya2V0UmVxdWVzdCAobWFya2V0KTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gb3JkZXJib29rWydkYXRlJ10gKiAxMDAwO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB0aW1lc3RhbXApO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWydkYXRlJ10gKiAxMDAwO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0Jyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICd2d2FwJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3Z3YXAnKSxcbiAgICAgICAgICAgICdvcGVuJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ29wZW4nKSxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlclBsdXMgKHRpY2tlciwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ1RpbWVzdGFtcCddO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnSGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXI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XG4gICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzWyd0aWNrZXInXTtcbiAgICAgICAgaWYgKG1hcmtldFsncGx1cyddKVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXJQbHVzICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGVQbHVzICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodHJhZGVbJ3RpbWVzdGFtcCddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3NpZGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydzaXplJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZXNQbHVzICh0cmFkZXMsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdHJhZGVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5wYXJzZVRyYWRlUGx1cyAodHJhZGVzW2ldLCBtYXJrZXQpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgbWV0aG9kID0gbWFya2V0WydhcGknXSArICdHZXRUcmFkZSc7XG4gICAgICAgIGxldCByZXF1ZXN0ID0gdGhpcy5jcmVhdGVNYXJrZXRSZXF1ZXN0IChtYXJrZXQpO1xuICAgICAgICBpZiAobWFya2V0WydwbHVzJ10pIHtcbiAgICAgICAgICAgIGxldCBub3c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biAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IHAgPSBbXTtcbiAgICAgICAgICAgIGlmICgncGFyYW1zJyBpbiBwYXJhbXMpXG4gICAgICAgICAgICAgICAgcCA9IHBhcmFtc1sncGFyYW1zJ107XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ2lkJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ3BhcmFtcyc6IHAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcCA9IHAuam9pbiAoJywnKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHJlcXVlc3QpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gKFxuICAgICAgICAgICAgICAgICd0b25jZT0nICsgbm9uY2UgK1xuICAgICAgICAgICAgICAgICcmYWNjZXNza2V5PScgKyB0aGlzLmFwaUtleSArXG4gICAgICAgICAgICAgICAgJyZyZXF1ZXN0bWV0aG9kPScgKyBtZXRob2QudG9Mb3dlckNhc2UgKCkgK1xuICAgICAgICAgICAgICAgICcmaWQ9JyArIG5vbmNlICtcbiAgICAgICAgICAgICAgICAnJm1ldGhvZD0nICsgcGF0aCArXG4gICAgICAgICAgICAgICAgJyZwYXJhbXM9JyArIHBcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMScpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLmVuY29kZSAodGhpcy5hcGlLZXkgKyAnOicgKyBzaWduYXR1cmUpO1xuICAgICAgICAgICAgaG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XJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI5MTQyOTExLTBlMWFjZmMyLTdkNWMtMTFlNy05OGM0LTA3ZDk1MzJiMjlkNy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkuYnRjbWFya2V0cy5uZXQnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5idGNtYXJrZXRzLm5ldCcsXG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly9idGNtYXJrZXRzLm5ldC9kYXRhJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9idGNtYXJrZXRzLm5ldC8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL0JUQ01hcmtldHMvQVBJJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3tpZH0vdGljaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3tpZH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tpZH0vdHJhZGluZ2ZlZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmR0cmFuc2Zlci93aXRoZHJhd0NyeXB0bycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHRyYW5zZmVyL3dpdGhkcmF3RUZUJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jcmVhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvdHJhZGUvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY3JlYXRlQmF0Y2gnLCAvLyB0aGV5IHByb21pc2UgaXQncyBjb21pbmcgc29vbi4uLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2RldGFpbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd2ViJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9CVENNYXJrZXRzL3tpZH0vdGlja0J5VGltZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0FVRCc6IHsgJ2lkJzogJ0JUQy9BVUQnLCAnc3ltYm9sJzogJ0JUQy9BVUQnLCAnYmFzZ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ixcbiAgICAgICAgICAgICAgICAnNic6IEREb1NQcm90ZWN0aW9uLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRBY2NvdW50QmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBtdWx0aXBsaWVyID0gMTAwMDAwMDAwO1xuICAgICAgICAgICAgbGV0IHRvdGFsID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnYmFsYW5jZSddIC8gbXVsdGlwbGllcik7XG4gICAgICAgICAgICBsZXQgdXNlZCA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ3BlbmRpbmdGdW5kcyddIC8gbXVsdGlwbGllcik7XG4gICAgICAgICAgICBsZXQgZnJlZSA9IHRvdGFsIC0gdXNlZDtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogZnJlZSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHVzZWQsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogdG90YWwsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2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tYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0UHJpY2UnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiZXN0QmlkJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiZXN0QXNrJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sdW1lMjRoJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldElkVGljayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydhbW91bnQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICB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dG9yeSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU15VHJhZGVzIChyZXNwb25zZVsndHJhZGVzJ10sIG1hcmtldCk7XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJpID0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldICsgdXJpO1xuICAgICAgICBpZiAoYXBpID09PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBxdW90ZXNcbiAgICAgICAgICAgIGxldCBhdXRoID0gdXJpICsgXCJcXG5cIiArIG5vbmNlICsgXCJcXG5cIjtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgICAgICAnYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IG5vbmNlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdQT1NUJykge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHBhcmFtcyk7XG4gICAgICAgICAgICAgICAgYXV0aCArPSBib2R5O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuYmFzZTY0VG9CaW5hcnkgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgc2VjcmV0LCAnc2hhNTEyJywgJ2Jhc2U2NCcpO1xuICAgICAgICAgICAgaGVhZGVyc1snc2lnbmF0dXJlJ10gPSB0aGlzLmRlY29kZSAoc2lnbmF0dXJlKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChib2R5Lmxlbmd0aCA8IDIpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmICgnc3VjY2VzcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXJlc3BvbnNlWydzdWNjZXNzJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGV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ICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cuYnRjdHJhZGUuaW0vc3BlbmQucHJpY2UuaHRtbCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmIChhcGkgPT09ICd3ZWInKSB7XG4gICAgICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGRhdGEgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2UsICdkYXRhJyk7XG4gICAgICAgIGlmIChkYXRhKSB7XG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdjb2RlJyk7XG4gICAgICAgICAgICBpZiAoY29kZSAhPT0gJzAnKSB7XG4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Q09SUyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk0MTQ4My03OWZjNzM1MC02MmQ5LTExZTctOWY2MS1hYzQ3ZjI4ZmNkOTYuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYnRjLXRyYWRlLmNvbS51YS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9idGMtdHJhZGUuY29tLnVhJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZG9jcy5nb29nbGUuY29tL2RvY3VtZW50L2QvMW9jWUEweU15X1JYZDU2MXNmRzNxRVBaODBreWxsMzZIVXh2Q1JlNUdiaEUvZWRpdCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlYWxzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvc2VsbC97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL2J1eS97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnamFwYW5fc3RhdC9oaWdoL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhc2sve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpZC97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5L3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteV9vcmRlcnMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3N0YXR1cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZW1vdmUvb3JkZXIve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbC97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQkNIL1VBSCc6IHsgJ2lkJzogJ2JjaF91YWgnLCAnc3ltYm9sJzogJ0JDSC9VQUgnLCAnYmFzZSc6ICdCQ0gnLCAncXVvdGUnOiAnVUFIJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvVUFIJzogeyAnaWQnOiAnYnRjX3VhaCcsICdzeW1ib2wnOiAnQlRDL1VBSCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVQUgnLCAncHJlY2lzaW9uJzogeyAncHJpY2UnOiAxIH0sICdsaW1pdHMnOiB7ICdhbW91bnQnOiB7ICdtaW4nOiAwLjAwMDAwMDAwMDEgfX19LFxuICAgICAgICAgICAgICAgICdEQVNIL0JUQyc6IHsgJ2lkJzogJ2Rhc2hfYnRjJywgJ3N5bWJvbCc6ICdEQVNIL0JUQycsICdiYXNlJzogJ0RBU0gnLCAncXVvdGUnOiAnQlRDJyB9LFxuICAgICAgICAgICAgICAgICdE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AgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05WQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDEwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBzaWduSW4gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5wcml2YXRlUG9zdEF1dGggKCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBpZiAoJ2FjY291bnRzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgbGV0IGFjY291bnRzID0gcmVzcG9uc2VbJ2FjY291bnRzJ107XG4gICAgICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGFjY291bnRzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGFjY291bnQgPSBhY2NvdW50c1tiXTtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBhY2NvdW50WydjdXJyZW5jeSddO1xuICAgICAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcGFyc2VGbG9hdCAoYWNjb3VudFsnYmFsYW5jZSddKTtcbiAgICAgICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0ge1xuICAgICAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2UsXG4gICAgICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBiaWRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkZXNCdXlTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGFza3MgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlc1NlbGxTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IHtcbiAgICAgICAgICAgICdiaWRzJzogW10sXG4gICAgICAgICAgICAnYXNrcyc6IFtdLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoYmlkcykge1xuICAgICAgICAgICAgaWYgKCdsaXN0JyBpbiBiaWRzKVxuICAgICAgICAgICAgICAgIG9yZGVyYm9va1snYmlkcyddID0gYmlkc1snbGlzdCddO1xuICAgICAgICB9XG4gICAgICAgIGlmIChhc2tzKSB7XG4gICAgICAgICAgICBpZiAoJ2xpc3QnIGluIGFza3MpXG4gICAgICAgICAgICAgICAgb3JkZXJib29rWydhc2tzJ10gPSBhc2tzWydsaXN0J107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW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ZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHRpY2tlckxlbmd0aCA9IHRpY2tlci5sZW5ndGg7XG4gICAgICAgIGlmICh0aWNrZXJMZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBsZXQgc3RhcnQgPSBNYXRoLm1heCAodGlja2VyTGVuZ3RoIC0gNDgsIDApO1xuICAgICAgICAgICAgZm9yIChsZXQgdCA9IHN0YXJ0OyB0IDwgdGlja2VyLmxlbmd0aDsgdCsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGNhbmRsZSA9IHRpY2tlclt0XTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJlc3VsdFsnb3BlbiddID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0WydvcGVuJ10gPSBjYW5kbGVbMV07XG4gICAgICAgICAgICAgICAgaWYgKCh0eXBlb2YgcmVzdWx0WydoaWdoJ10gPT09ICd1bmRlZmluZWQnKSB8fCAocmVzdWx0WydoaWdoJ10gPCBjYW5kbGVbMl0pKVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ2hpZ2gnXSA9IGNhbmRsZVsyXTtcbiAgICAgICAgICAgICAgICBpZiAoKHR5cGVvZiByZXN1bHRbJ2xvdyddID09PSAndW5kZWZpbmVkJykgfHwgKHJlc3VsdFsnbG93J10gPiBjYW5kbGVbM10pKVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ2xvdyddID0gY2FuZGxlWzNdO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVzdWx0WydiYXNlVm9sdW1lJ10gPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ2Jhc2VWb2x1bWUnXSA9IC1jYW5kbGVbNV07XG4gICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ2Jhc2VWb2x1bWUnXSAtPSBjYW5kbGVbNV07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgbGFzdCA9IHRpY2tlckxlbmd0aCAtIDE7XG4gICAgICAgICAgICByZXN1bHRbJ2xhc3QnXSA9IHRpY2tlcltsYXN0XVs0XTtcbiAgICAgICAgICAgIHJlc3VsdFsnY2xvc2UnXSA9IHJlc3VsdFsnbGFzdCddO1xuICAgICAgICAgICAgcmVzdWx0WydiYXNlVm9sdW1lJ10gPSAtMSAqIHJlc3VsdFsnYmFzZVZvbHVtZSddO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgY29udmVydEN5cmlsbGljTW9udGhOYW1lVG9TdHJpbmcgKGN5cmlsbGljKSB7XG4gICAgICAgIGxldCBtb250aHMgPSB7XG4gICAgICAgICAgICAn0Y/QvdCy0LDRgNGPJzogJzAxJyxcbiAgICAgICAgICAgICfRhNC10LLRgNCw0LvRjyc6ICcwMicsXG4gICAgICAgICAgICAn0LzQsNGA0YLQsCc6ICcwMycsXG4gICAgICAgICAgICAn0LDQv9GA0LXQu9GPJzogJzA0JyxcbiAgICAgICAgICAgICfQvNCw0Y8nOiAnMDUnLFxuICAgICAgICAgICAgJ9C40Y7QvdGPJzogJzA2JyxcbiAgICAgICAgICAgICfQuNGO0LvRjyc6ICcwNycsXG4gICAgICAgICAgICAn0LDQstCz0YPRgdGC0LAnOiAnMDgnLFxuICAgICAgICAgICAgJ9GB0LXQvdGC0Y/QsdGA0Y8nOiAnMDknLFxuICAgICAgICAgICAgJ9C+0LrRgtGP0LHRgNGPJzogJzEwJyxcbiAgICAgICAgICAgICfQvdC+0Y/QsdGA0Y8nOiAnMTEnLFxuICAgICAgICAgICAgJ9C00LXQutCw0LHRgNGPJzogJzEyJyxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IG1vbnRoID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoY3lyaWxsaWMgaW4gbW9udGhzKVxuICAgICAgICAgICAgbW9udGggPSBtb250aHNbY3lyaWxsaWNdO1xuICAgICAgICByZXR1cm4gbW9udGg7XG4gICAgfVxuXG4gICAgcGFyc2VDeXJpbGxpY0RhdGV0aW1lIChjeXJpbGxpYykge1xuICAgICAgICBsZXQgcGFydHMgPSBjeXJpbGxpYy5zcGxpdCAoJyAnKTtcbiAgICAgICAgbGV0IGRheSA9IHBhcnRzWzBdO1xuICAgICAgICBsZXQgbW9udGggPSB0aGlzLmNvbnZlcnRDeXJpbGxpY01vbnRoTmFtZVRvU3RyaW5nIChwYXJ0c1sxXSk7XG4gICAgICAgIGlmICghbW9udGgpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcGFyc2VUcmFkZSgpIHVuZGVmaW5lZCBtb250aCBuYW1lOiAnICsgY3lyaWxsaWMpO1xuICAgICAgICBsZXQgeWVhciA9IHBhcnRzWzJdO1xuICAgICAgICBsZXQgaG1zID0gcGFydHNbNF07XG4gICAgICAgIGxldCBobXNMZW5ndGggPSBobXMubGVuZ3RoO1xuICAgICAgICBpZiAoaG1zTGVuZ3RoID09PSA3KSB7XG4gICAgICAgICAgICBobXMgPSAnMCcgKyBobXM7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGRheS5sZW5ndGggPT09IDEpIHtcbiAgICAgICAgICAgIGRheSA9ICcwJyArIGRheTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgeW1kID0gWyB5ZWFyLCBtb250aCwgZGF5IF0uam9pbiAoJy0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XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnYnRjdHVyaycsXG4gICAgICAgICAgICAnbmFtZSc6ICdCVENUdXJrJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnVFInLCAvLyBUdXJrZXlcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxZCc6ICcxZCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk5MjcwOS0xOGUxNTY0Ni02NGEzLTExZTctOWZhMi1iMDk1MGVjNzcxMmYuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmJ0Y3R1cmsuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5idGN0dXJrLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vQlRDVHJhZGVyL2Jyb2tlci1hcGktZG9jcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29obGNkYXRhJywgLy8gP2xhc3Q9Q09VTlRcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJywgICAvLyA/bGFzdD1DT1VOVCAobWF4IDUwKVxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlclRyYW5zYWN0aW9ucycsIC8vID9vZmZzZXQ9MCZsaW1pdD0yNSZzb3J0PWFzY1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9UUlknOiB7ICdpZCc6ICdCVENUUlknLCAnc3ltYm9sJzogJ0JUQy9UUlknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVFJZJywgJ21ha2VyJzogMC4wMDIgKiAxLjE4LCAndGFrZXInOiAwLjAwMzUgKiAxLjE4IH0sXG4gICAgICAgICAgICAgICAgJ0VUSC9UUlknOiB7ICdpZCc6ICdFVEhUUlknLCAnc3ltYm9sJzogJ0VUSC9UUlknLCAnYmFzZSc6ICdFVEgnLCAncXVvdGUnOiAnVFJZJywgJ21ha2VyJzogMC4wMDIgKi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V4Y2hhbmdlICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh7ICdpZCc6IGlkIH0pO1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKHRoaXMuaWQgPT09ICdidGN0cmFkZXInKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGlzIGFuIGFic3RyYWN0IGJhc2UgQVBJIGZvciBCVENFeGNoYW5nZSwgQlRDVHVyaycpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgIC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ICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97aWR9L3tsaW1pdH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS97aWR9L3tsaW1pdH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlZGVlbScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvVVNEJzogeyAnaWQnOiAnYnRjL3VzZCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdidGMvZXVyJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAoYmFsYW5jZXMpO1xuICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGN1cnJlbmNpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gY3VycmVuY3kudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VzW2N1cnJlbmN5XSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlc1tjdXJyZW5jeV0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W3VwcGVyY2FzZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZW9mIGxpbWl0ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHJlcXVlc3RbJ2xpbWl0J10gPSBsaW1pdDsgLy8gMTAwMFxuICAgICAgICBsZXQgb3J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iAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWwgKHsgJ29yZGVyJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICB1cmwgKz0gYXBpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdNZXRob2QnOiBwYXRoLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgICAgICdOb25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ25hdHVyZSc6IHRoaXMuaG1hYyAod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1vZHVsZS5leHBvcnRzID0gY2xhc3MgYnhpbnRoIGV4dGVuZHMgRXhjaGFuZ2Uge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdieGludGgnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQlguaW4udGgnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdUSCcsIC8vIFRoYWlsYW5kXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NDEyLTU2N2IxZWI0LTVlZDctMTFlNy05NGE4LWZmNmEzODg0ZjZjNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9ieC5pbi50aC9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9ieC5pbi50aCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2J4LmluLnRoL2luZm8vYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnJywgLy8gdGlja2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYWlyaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaWxsZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpbGxncm91cCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlsbHBheScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1pc3N1ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWJpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLXNlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1teWlzc3VlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tbXliaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1teW9wdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1leGVyY2lzZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWNhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsLWhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMjUgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMjUgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnREFTJzogJ0RBU0gnLFxuICAgICAgICAgICAgICAgICdET0cnOiAnRE9HRScsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0UGFpcmluZyAoKTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBrZXlzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1trZXlzW3BdXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsncGFpcmluZ19pZCddLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ3NlY29uZGFyeV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydwcmltYXJ5X2N1cnJlbmN5J107XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2UpO1xuICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGN1cnJlbmNpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgIC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biAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyaW5nJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddLnRvU3RyaW5nICgpO1xuICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWyd0cmFkZV9kYXRlJ10pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RyYWRlX2lkJ10sXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ29yZGVyJzogdHJhZGVbJ29yZGVyX2lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3RyYWRlX3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3JhdGUnKSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdhbW91bnQnKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBz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5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgb3JkZXJzID0gdGhpcy5wYXJzZU9yZGVycyAocmVzcG9uc2VbJ29yZGVycyddLCBtYXJrZXQsIHNpbmNlLCBsaW1pdCk7XG4gICAgICAgIHJldHVybiB0aGlzLmZpbHRlckJ5U3ltYm9sIChvcmRlcnMsIHN5bWJvbCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJztcbiAgICAgICAgaWYgKHBhdGgpXG4gICAgICAgICAgICB1cmwgKz0gcGF0aCArICcvJztcbiAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IHRoaXMuYXBpS2V5ICsgbm9uY2UudG9TdHJpbmcgKCkgKyB0aGlzLnNlY3JldDtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhhc2ggKHRoaXMuZW5jb2RlIChhdXRoKSwgJ3NoYTI1NicpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZ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J3dlYic6ICdodHRwczovL2MtY2V4LmNvbS90JyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2MtY2V4LmNvbS90L2FwaV9wdWIuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYy1jZXguY29tL3QvYXBpLmh0bWwnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2MtY2V4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2MtY2V4LmNvbS8/aWQ9YXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3ZWInOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29pbm5hbWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndm9sdW1lX3tjb2lufScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VkaXN0cmlidXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHN1bW1hcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdWxsb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eWxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRvcGVub3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0b3JkZXJoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteXRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbGxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdJT1QnOiAnSW9UY29pbicsXG4gICAgICAgICAgICAgICAgJ0JMQyc6ICdDcnlwdG9idWxsY29pbicsXG4gICAgICAgICAgICAgICAgJ1hJRCc6ICdJbnRlcm5hdGlvbmFsRGlhbW9uZCcsXG4gICAgICAgICAgICAgICAgJ0xVWCc6ICdMdXhtaScsXG4gICAgICAgICAgICAgICAgJ0NSQyc6ICdDb3JlQ29pbicsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMud2ViR2V0UGFpcnMgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3BhaXJzJ107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCctJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGJhc2VJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHF1b3RlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdpbmZvJzogaWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIC8vIGFuIGFsdGVybmF0aXZlIGRvY3VtZW50ZWQgcGFyc2VyXG4gICAgICAgIC8vICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgLy8gICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1sncmVzdWx0J10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgLy8gICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sncmVzdWx0J11bcF07XG4gICAgICAgIC8vICAgICAgICAgbGV0IGlkID0gbWFya2V0WydNYXJrZXROYW1lJ107XG4gICAgICAgIC8vICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ01hcmtldEN1cnJlbmN5J107XG4gICAgICAgIC8vICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydCYXNlQ3VycmVuY3knXTtcbiAgICAgICAgLy8gICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAvLyAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgLy8gICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAvLyAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgIC8vICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAvLyAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAvLyAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgIC8vICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAvLyAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgLy8gICAgICAgICB9KTtcbiAgICAgICAgLy8gICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB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uZ3JvdXBCeSAoYmlkYXNrcywgJ01hcmtldCcpO1xuICAgICAgICAgICAgbGV0IG1hcmtldElkcyA9IE9iamVjdC5rZXlzIChiaWRhc2tzQnlNYXJrZXRJZCk7XG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IG1hcmtldElkcy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IG1hcmtldElkc1tqXTtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0SWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgbGV0IHNpZGUgPSB0eXBlO1xuICAgICAgICAgICAgICAgIGlmIChzeW1ib2wgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbc3ltYm9sXTtcbiAgICAgICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLScpO1xuICAgICAgICAgICAgICAgICAgICBsZXQgaW52ZXJ0ZWRJZCA9IHF1b3RlICsgJy0nICsgYmFzZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGludmVydGVkSWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2ludmVydGVkSWRdO1xuICAgICAgICAgICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIShzeW1ib2wgaW4gb3JkZXJib29rcykpXG4gICAgICAgICAgICAgICAgICAgIG9yZGVyYm9va3Nbc3ltYm9sXSA9IHt9O1xuICAgICAgICAgICAgICAgIG9yZGVyYm9va3Nbc3ltYm9sXVtzaWRlXSA9IGJpZGFza3NCeU1hcmtldElkW21hcmtldElkXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG9yZGVyYm9va3MpO1xuICAgICAgICBmb3IgKGxldCBrID0gMDsgayA8IGtleXMubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgIGxldCBrZXkgPSBrZXlzW2tdO1xuICAgICAgICAgICAgcmVzdWx0W2tleV0gPSB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2tzW2tleV0sIHVuZGVmaW5lZCwgJ2J1eScsICdzZWxsJywgJ1JhdGUnLCAnUXVhbnRpdHknKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd1cGRhdGVkJ10gKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0cHJpY2UnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1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AgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMud2ViR2V0UHJpY2VzIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAodGlja2Vycyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBpZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gdXBwZXJjYXNlLnNwbGl0ICgnLScpO1xuICAgICAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHV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dxdWFudGl0eSc6IGFtb3VudCxcbiAgICAgICAgICAgICdyYXRlJzogcHJpY2UsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydyZXN1bHQnXVsndXVpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlR2V0Q2FuY2VsICh7ICd1dWlkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBpZiAoYXBpID09PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMua2V5c29ydCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYSc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdhcGlzaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAodXJsKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpIH07XG4gICAgICAgIH0gZWxzZSBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhJzogJ2dldCcgKyBwYXRoLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB1cmwgKz0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpICsgJy5qc29uJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoYXBpID09PSAnd2ViJylcbiAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSlcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnc3VjY2VzcyddKVxuICAgICAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgdGhyb3cgbmV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lLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQ0Mi04ZGRjMzNiMC01ZWQ4LTExZTctOGI5OC1mNzg2YWVmMGYzYzkuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vY2V4LmlvL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2NleC5pbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2NleC5pby9jZXgtYXBpJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vY2V4LmlvL2ZlZS1zY2hlZHVsZScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2NleC5pby9saW1pdHMtY29tbWlzc2lvbnMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5X2xpbWl0cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhc3RfcHJpY2Uve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdF9wcmljZXMve2N1cnJlbmNpZXN9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2hsY3YvaGQve3l5eXltbWRkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2sve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMve2N1cnJlbmNpZXN9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfaGlzdG9yeS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29udmVydC97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlX3N0YXRzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWN0aXZlX29yZGVyc19zdGF0dXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcmNoaXZlZF9vcmRlcnMve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcnMve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3JlcGxhY2Vfb3JkZXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2xvc2VfcG9zaXRpb24ve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2FkZHJlc3MvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfbXlmZWUvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfb3JkZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfb3JkZXJfdHgvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fcG9zaXRpb24ve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9wb3NpdGlvbnMve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGxhY2Vfb3JkZXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnVVNEJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ0VVUic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdSVUInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnR0JQJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnVVNEJzogYW1vdW50ID0+IGFtb3VudCAqIDAuMDM1ICsgMC4yNSxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdFVVInOiBhbW91bnQgPT4gYW1vdW50ICogMC4wMzUgKyAwLjI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ1JVQic6IGFtb3VudCA9PiBhbW91bnQgKiAwLjA1ICsgMTUuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnR0JQJzogYW1vdW50ID0+IGFtb3VudCAqIDAuMDM1ICsgMC4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWExNJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY3lMaW1pdHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWydkYXRhJ11bJ3BhaXJzJ10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydkYXRhJ11bJ3BhaXJzJ11bcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbDEnXSArICcvJyArIG1hcmtldFsnc3ltYm9sMiddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IG1hcmtldFsnbWluTG90U2l6ZSddLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0WydtaW5QcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IC0xICogTWF0aC5sb2cxMCAobWFya2V0WydtaW5Mb3RTaXplJ10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ21pbkxvdFNpemUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBtYXJrZXRbJ21heExvdFNpemUnXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5QcmljZScpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYXhQcmljZScpLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ21pbkxvdFNpemVTMiddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RCYWxhbmNlICgp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UgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sdW1lJyk7XG4gICAgICAgIGxldCBoaWdoID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKTtcbiAgICAgICAgbGV0IGxvdyA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKTtcbiAgICAgICAgbGV0IGJpZCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiaWQnKTtcbiAgICAgICAgbGV0IGFzayA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKTtcbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdCcpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogaXNvODYwMSxcbiAgICAgICAgICAgICdoaWdoJzogaGlnaCxcbiAgICAgICAgICAgICdsb3cnOiBsb3csXG4gICAgICAgICAgICAnYmlkJzogYmlkLFxuICAgICAgICAgICAgJ2JpZFZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiBhc2ssXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxc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cmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIC8vIERlcGVuZGluZyBvbiB0aGUgY2FsbCwgJ3RpbWUnIGNhbiBiZSBhIHVuaXggaW50LCB1bml4IHN0cmluZyBvciBJU08gc3RyaW5nXG4gICAgICAgIC8vIFllcywgcmVhbGx5XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBvcmRlclsndGltZSddO1xuICAgICAgICBpZiAodHlwZW9mIG9yZGVyWyd0aW1lJ10gPT09ICdzdHJpbmcnICYmIG9yZGVyWyd0aW1lJ10uaW5kZXhPZiAoJ1QnKSA+PSAwKSB7XG4gICAgICAgICAgICAvLyBJU084NjAxIHN0cmluZ1xuICAgICAgICAgICAgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRpbWVzdGFtcCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBlaXRoZXIgaW50ZWdlciBvciBzdHJpbmcgaW50ZWdlclxuICAgICAgICAgICAgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRpbWVzdGFtcCk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBvcmRlclsnc3ltYm9sMSddICsgJy8nICsgb3JkZXJbJ3N5bWJvbDInXTtcbiAgICAgICAgICAgIGlmIChzeW1ib2wgaW4gdGhpcy5tYXJrZXRzKVxuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICB9XG4gICAgICAgIGxldCBzdGF0dXMgPSBvcmRlclsnc3RhdHVzJ107XG4gICAgICAgIGlmIChzdGF0dXMgPT09ICdhJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nOyAvLyB0aGUgdW5pZmllZCBzdGF0dXNcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0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2UnXSxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUnOiBmZWVSYXRlLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IGJhc2VGZWVDb3N0LFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9IGVsc2UgaWYgKChxdW90ZUZlZSBpbiBvcmRlcikgfHwgKHF1b3RlVGFrZXJGZWUgaW4gb3JkZXIpKSB7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlRmVlQ29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgcXVvdGVGZWUpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcXVvdGVGZWVDb3N0ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgcXVvdGVGZWVDb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCBxdW90ZVRha2VyRmVlKTtcbiAgICAgICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUnOiBmZWVSYXRlLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHF1b3RlRmVlQ29zdCxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICghY29zdClcbiAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGZpbGxlZDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgIC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J0YyBleHRlbmRzIHpiIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnY2hidGMnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQ0hCVEMnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDTicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODU1NTY1OS1mMDA0MGRjMi03MTA5LTExZTctOWQ5OS02ODhhNDM4YmY5ZjQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHA6Ly9hcGkuY2hidGMuY29tL2RhdGEnLCAvLyBubyBodHRwcyBmb3IgcHVibGljIEFQSVxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3RyYWRlLmNoYnRjLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3RyYWRlLmNoYnRjLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuY2hidGMuY29tL2kvZGV2ZWxvcGVyJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAg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XG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgIC8vIHRoZSBmaXJzdCB0d28gZG9uJ3Qgc2VlbSB0byB3b3JrIGF0IGFsbFxuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG0nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaCcsXG4gICAgICAgICAgICAgICAgJzNoJzogJzNoJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMUQnLFxuICAgICAgICAgICAgICAgICc3ZCc6ICc3RCcsXG4gICAgICAgICAgICAgICAgJzE0ZCc6ICcxNEQnLFxuICAgICAgICAgICAgICAgICcxTSc6ICcxTScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zNTc1NTU3Ni1kZWUwMmU1Yy0wODc4LTExZTgtOTg5Zi0xNTk1ZDgwYmE0N2YuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vYXBpLmNvYmluaG9vZC5jb20vdjEnLFxuICAgICAgICAgICAgICAgICAgICAnd3MnOiAnd3NzOi8vZmVlZC5jb2Jpbmhvb2QuY29tJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2Jpbmhvb2QuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vY29iaW5ob29kLmdpdGh1Yi5pby9hcGktcHVibGljJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdzeXN0ZW0nOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGltZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWVzc2FnZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21lc3NhZ2VzL3ttZXNzYWdlX2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnYWRtaW4nOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3lzdGVtL21lc3NhZ2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeXN0ZW0vbWVzc2FnZXMve21lc3NhZ2VfaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3lzdGVtL21lc3NhZ2VzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3BhdGNoJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5c3RlbS9tZXNzYWdlcy97bWVzc2FnZV9pZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5c3RlbS9tZXNzYWdlcy97bWVzc2FnZV9pZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvdGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC90cmFkaW5nX3BhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3JkZXJib29rcy97dHJhZGluZ19wYWlyX2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3N0YXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvdGlja2Vycy97dHJhZGluZ19wYWlyX2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3RyYWRlcy97dHJhZGluZ19wYWlyX2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhcnQvY2FuZGxlcy97dHJhZGluZ19wYWlyX2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nL29yZGVycy97b3JkZXJfaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nL29yZGVycy97b3JkZXJfaWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZy9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmcvb3JkZXJfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZy90cmFkZXMve3RyYWRlX2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvbGVkZ2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvZGVwb3NpdF9hZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC93aXRoZHJhd2FsX2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L3dpdGhkcmF3YWxzL3t3aXRoZHJhd2FsX2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvZGVwb3NpdHMve2RlcG9zaXRfaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvZGVwb3NpdHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2RlcG9zaXRfYWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvd2l0aGRyYXdhbF9hZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC93aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZy9vcmRlcnMve29yZGVyX2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ2luc3VmZmljaWVudF9iYWxhbmNlJzogSW5zdWZmaWNpZW50RnVuZHMsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0Q3VycmVuY2llcyAocGFyYW1zKTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSByZXNwb25zZVsncmVzdWx0J11bJ2N1cnJlbmNpZXMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jeVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBtaW5Vbml0ID0gdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAnbWluX3VuaXQnKTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmaWF0JzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAoY3VycmVuY3lbJ21pbl91bml0J10pLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWluVW5pdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtaW5Vbml0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWluVW5pdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtaW5Vbml0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlJzogdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAnd2l0aGRyYXdhbF9mZWUnKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlJzogdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAnZGVwb3NpdF9mZWUnKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRUcmFkaW5nUGFpcnMgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3Jlc3VsdCddWyd0cmFkaW5nX3BhaXJzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCctJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ3F1b3RlX2luY3JlbWVudCddKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gdGhpcy5zYWZlVmFsdWUgKG1hcmtldCwgJ2lzX2FjdGl2ZScsIHRydWUpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnYmFzZV9taW5fc2l6ZScpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdiYXNlX21heF9zaXplJyksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IHRoaXMuc2FmZVN0cmluZyAodGlja2VyLCAndHJhZGluZ19wYWlyX2lkJyk7XG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLmZpbmRNYXJrZXQgKG1hcmtldElkKTtcbiA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ICdvcGVuJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgc2lkZSA9IChvcmRlclsnc2lkZSddID09PSAnYmlkJykgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ3R5cGUnXSwgLy8gbWFya2V0LCBsaW1pdCwgc3RvcCwgc3RvcF9saW1pdCwgdHJhaWxpbmdfc3RvcCwgZmlsbF9vcl9raWxsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAndHJhZGVzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2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jcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2NvaW5jaGVjaycsXG4gICAgICAgICAgICAnbmFtZSc6ICdjb2luY2hlY2snLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ0pQJywgJ0lEJyBdLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQ2NC0zYjVjM2M3NC01ZWQ5LTExZTctODQwZS0zMWIzMjk2OGUxZGEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vY29pbmNoZWNrLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2luY2hlY2suY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vY29pbmNoZWNrLmNvbS9kb2N1bWVudHMvZXhjaGFuZ2UvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3JhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyYXRlL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL2xldmVyYWdlX2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbmtfYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRfbW9uZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVycy9vcGVucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3RyYW5zYWN0aW9uc19wYWdpbmF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9sZXZlcmFnZS9wb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRpbmcvYm9ycm93cy9tYXRjaGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kX21vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYW5rX2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X21vbmV5L3tpZH0vZmFzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90cmFuc2ZlcnMvdG9fbGV2ZXJhZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RyYW5zZmVycy9mcm9tX2xldmVyYWdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kaW5nL2JvcnJvd3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRpbmcvYm9ycm93cy97aWR9L3JlcGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kX21vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbmtfYWNjb3VudHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvSlBZJzogeyAnaWQnOiAnYnRjX2pweScsICdzeW1ib2wnOiAnQlRDL0pQWScsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdKUFknIH0sIC8vIHRoZSBvbmx5IHJlYWwgcGFpclxuICAgICAgICAgICAgICAgIC8vICdFVEgvSlBZJzogeyAnaWQnOiAnZXRoX2pweScsICdzeW1ib2wnOiAnRVRIL0pQWScsICdiYXNlJzogJ0VUSCcsICdxdW90ZSc6ICdKUFknIH0sXG4gICAgICAgICAgICAgICAgLy8gJ0VUQy9KUFknOiB7ICdpZCc6ICdldGNfanB5JywgJ3N5bWJvbCc6ICdFVEMvSlBZJywgJ2Jhc2UnOiAnRVRDJywgJ3F1b3RlJzogJ0pQWScgfSxcbiAgICAgICAg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5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIGxldCBvcmRlcl90eXBlID0gdHlwZSArICdfJyArIHNpZGU7XG4gICAgICAgICAgICBvcmRlclsnb3JkZXJfdHlwZSddID0gb3JkZXJfdHlwZTtcbiAgICAgICAgICAgIGxldCBwcmVmaXggPSAoc2lkZSA9PT0gJ2J1eScpID8gKG9yZGVyX3R5cGUgKyAnXycpIDogJyc7XG4gICAgICAgICAgICBvcmRlcltwcmVmaXggKyAnYW1vdW50J10gPSBhbW91bnQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvcmRlclsnb3JkZXJfdHlwZSddID0gc2lkZTtcbiAgICAgICAgICAgIG9yZGVyWydyYXRlJ10gPSBwcmljZTtcbiAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0RXhjaGFuZ2VPcmRlcnMgKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLnByaXZhdGVEZWxldGVF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YXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzY3NzAzMTAtYWRmYTc2NGUtMWM1YS0xMWU4LThlMDktNDQ5ZGFhYzNkMmZiLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL3d3dy5jb2luZWdnLmNvbS9jb2luJyxcbiAgICAgICAgICAgICAgICAgICAgJ3Jlc3QnOiAnaHR0cHM6Ly9hcGkuY29pbmVnZy5jb20vYXBpL3YxJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuY29pbmVnZy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuY29pbmVnZy5jb20vZXhwbGFpbi5hcGkuaHRtbCcsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cuY29pbmVnZy5jb20vZmVlLmh0bWwnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cXVvdGV9L2FsbGNvaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3txdW90ZX0vdHJlbmRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cXVvdGV9L3tiYXNlfS9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3F1b3RlfS97YmFzZX0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cXVvdGV9L3tiYXNlfS9kZXB0aC5qcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cXVvdGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97cXVvdGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve3F1b3RlfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfYWRkL3txdW90ZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2NhbmNlbC97cXVvdGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV92aWV3L3txdW90ZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2xpc3Qve3F1b3RlfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDA4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFNLJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUUyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0FNRSc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR09PQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJRkMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkxLJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWUkMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hQTSc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVlRDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdURkMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUFDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZaJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRVQnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JTUyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEdDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS1QnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0pCQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUklPJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMS0MnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pDQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRRUMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01FVCc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWVRDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdITEInOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01SWUMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01UQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS1RDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcxMDMnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDQnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDUnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDYnOiBJbnZhbGlkTm9uY2UsXG4gICAgICAgICAgICAgICAgJzIwMCc6IEluc3VmZmljaWVudEZ1bmRzLFxuICAgICAgICAgICAgICAgICcyMDEnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJzIwMic6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAnMjAzJzogT3JkZXJOb3RGb3VuZCxcbiAgICAgICAgICAgICAgICAnNDAyJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2Vycm9yTWVzc2FnZXMnOiB7XG4gICAgICAgICAgICAgICAgJzEwMCc6ICdSZXF1aXJlZCBwYXJhbWV0ZXJzIGNhbiBub3QgYmUgZW1wdHknLFxuICAgICAgICAgICAgICAgICcxMDEnOiAnSWxsZWdhbCBwYXJhbWV0ZXInLFxuICAgICAgICAgICAgICAgICcxMDInOiAnY29pbiBkb2VzIG5vdCBleGlzdCcsXG4gICAgICAgICAgICAgICAgJzEwMyc6ICdLZXkgZG9lcyBub3QgZXhpc3QnLFxuICAgICAgICAgICAgICAgICcxMDQnOiAnU2lnbmF0dXJlIGRvZXMgbm90IG1hdGNoJyxcbiAgICAgICAgICAgICAgICAnMTA1JzogJ0luc3VmZmljaWVudCBwZXJtaXNzaW9ucycsXG4gICAgICAgICAgICAgICAgJzEwNic6ICdSZXF1ZXN0IGV4cGlyZWQobm9uY2UgZXJyb3IpJyxcbiAgICAgICAgICAgICAgICAnMjAwJzogJ0xhY2sgb2YgYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgJzIwMSc6ICdUb28gc21hbGwgZm9yIHRoZSBudW1iZXIgb2YgdHJhZGluZycsXG4gICAgICAgICAg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AgICAgICBsZXQgcXVvdGVJZCA9IHF1b3RlSWRzW2JdO1xuICAgICAgICAgICAgbGV0IGJhc2VzID0gYXdhaXQgdGhpcy53ZWJHZXRRdW90ZUFsbGNvaW4gKHtcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZUlkLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGJhc2VzID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VOb3RBdmFpbGFibGUgKHRoaXMuaWQgKyAnIGZldGNoTWFya2V0cygpIGZvciBcIicgKyBxdW90ZUlkICsgJ1wiIHJldHVybmVkOiBcIicgKyB0aGlzLmpzb24gKGJhc2VzKSArICdcIicpO1xuICAgICAgICAgICAgbGV0IGJhc2VJZHMgPSBPYmplY3Qua2V5cyAoYmFzZXMpO1xuICAgICAgICAgICAgbGV0IG51bUJhc2VJZHMgPSBiYXNlSWRzLmxlbmd0aDtcbiAgICAgICAgICAgIGlmIChudW1CYXNlSWRzIDwgMSlcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VOb3RBdmFpbGFibGUgKHRoaXMuaWQgKyAnIGZldGNoTWFya2V0cygpIGZvciBcIicgKyBxdW90ZUlkICsgJ1wiIHJldHVybmVkOiBcIicgKyB0aGlzLmpzb24gKGJhc2VzKSArICdcIicpO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYXNlSWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGJhc2VJZHNbaV07XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IGJhc2VzW2Jhc2VJZF07XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBiYXNlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBiYXNlSWQgKyBxdW90ZUlkO1xuICAgICAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdCcpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICA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1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYXNlSWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGJhc2VJZHNbaV07XG4gICAgICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbYmFzZUlkXTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBiYXNlSWQgKyBxdW90ZUlkO1xuICAgICAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c0J5SWRbaWRdO1xuICAgICAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh7XG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlnaCc6IHRpY2tlcls0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb3cnOiB0aWNrZXJbNV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JzogdGlja2VyWzJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwnOiB0aWNrZXJbM10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdCc6IHRpY2tlclsxXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjaGFuZ2UnOiB0aWNrZXJbOF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAndm9sJzogdGlja2VyWzZdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlVm9sJzogdGlja2VyWzddLFxuICAgICAgICAgICAgICAgICAgICB9LCBtYXJrZXQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1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0IHRoaXMucHJpdmF0ZVBvc3RCYWxhbmNlIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHRoaXMub21pdCAocmVzcG9uc2VbJ2RhdGEnXSwgJ3VpZCcpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGtleSA9IGtleXNbaV07XG4gICAgICAgICAgICBsZXQgWyBjdXJyZW5jeUlkLCBhY2NvdW50VHlwZSBdID0ga2V5LnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSBjdXJyZW5jeUlkO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5SWQgaW4gdGhpcy5jdXJyZW5jaWVzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgY29kZSA9IHRoaXMuY3VycmVuY2llc19ieV9pZFtjdXJyZW5jeUlkXVsnY29kZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCEoY29kZSBpbiByZXN1bHQpKSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICAgICAnZnJlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgJ3VzZWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICd0b3RhbCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYWNjb3VudFR5cGUgPSAoYWNjb3VudFR5cGUgPT09ICdsb2NrJykgPyAndXNlZCcgOiAnZnJlZSc7XG4gICAgICAgICAgICByZXN1bHRbY29kZV1bYWNjb3VudFR5cGVdID0gcGFyc2VGbG9hdCAoYmFsYW5jZXNba2V5XSk7XG4gICA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NlbGxlZCcpIHtcbiAgICAgICAgICAgIHN0YXR1cyA9ICdjYW5jZWxlZCc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBzdGF0dXMgPSByZW1haW5pbmcgPyAnb3BlbicgOiAnY2xvc2VkJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgaW5mbyA9IHRoaXMuc2FmZVZhbHVlIChvcmRlciwgJ2luZm8nLCBvcmRlcik7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKG9yZGVyLCAnaWQnKSxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IGluZm8sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VHJhZGVBZGRRdW90ZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjb2luJzogbWFya2V0WydiYXNlSWQnXSxcbiAgICAgICAgICAgICdxdW90ZSc6IG1hcmtldFsncXVvdGVJZCddLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGlkID0gcmVzcG9uc2VbJ2lkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHRoaXMucGFyc2VPcmRlciAoe1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLnltZGhtcyAodGhpcy5taWxsaXNlY29uZHMgKCkpLFxuICAgICAgICAgICAgJ2Ftb3VudF9vcmlnaW5hbCc6IGFtb3VudCxcbiAgICAgICAgICAgICdhbW91bnRfb3V0c3RhbmRpbmcnOiBhbW91bnQsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgIH0sIG1hcmtldCk7XG4gICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IG9yZGVyO1xuICAgICAgICByZXR1cm4gb3JkZXI7XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFt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cmV0KSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAoc2VjcmV0KSk7XG4gICAgICAgICAgICBxdWVyeSArPSAnJicgKyAnc2lnbmF0dXJlPScgKyBzaWduYXR1cmU7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyBxdWVyeTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgYm9keSA9IHF1ZXJ5O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIC8vIGNoZWNrcyBhZ2FpbnN0IGVycm9yIGNvZGVzXG4gICAgICAgIGlmICh0eXBlb2YgYm9keSAhPT0gJ3N0cmluZycpXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIGlmIChib2R5Lmxlbmd0aCA9PT0gMClcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgaWYgKGJvZHlbMF0gIT09ICd7JylcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgIC8vIHByaXZhdGUgZW5kcG9pbnRzIHJldHVybiB0aGU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KSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnY29pbmV4JyxcbiAgICAgICAgICAgICduYW1lJzogJ0NvaW5FeCcsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0NOJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbWluJyxcbiAgICAgICAgICAgICAgICAnM20nOiAnM21pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtaW4nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaG91cicsXG4gICAgICAgICAgICAgICAgJzJoJzogJzJob3VyJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnNGhvdXInLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aG91cicsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnM2QnOiAnM2RheScsXG4gICAgICAgICAgICAgICAgJzF3JzogJzF3ZWVrJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM4MDQ2MzEyLTBiNDUwYWFjLTMyYzgtMTFlOC05OWFiLWJjNmIxMzZiNmNjNy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkuY29pbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmNvaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd3d3LmNvaW5leC5jb20nLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5jb2luZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2l0aHViLmNvbS9jb2luZXhjb20vY29pbmV4X2V4Y2hhbmdlX2FwaS93aWtpJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5jb2luZXguY29tL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXMvbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2xpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC90aWNrZXIvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9kZWFscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2tsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9wZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9maW5pc2hlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvZmluaXNoZWQve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvdXNlci9kZWFscycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2xpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9tYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy53ZWJHZXRSZXNNYXJrZXQgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ2RhdGEnXVsnbWFya2V0X2luZm8nXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQga2V5ID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2tleV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ21hcmtldCddO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBtYXJrZXRbJ2J1eV9hc3NldF90eXBlJ107XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydzZWxsX2Fzc2V0X3R5cGUnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0WydzZWxsX2Fzc2V0X3R5cGVfcGxhY2VzJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydidXlfYXNzZXRfdHlwZV9wbGFjZXMnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbnVtTWVyZ2VMZXZlbHMgPSBtYXJrZXRbJ21lcmdlJ10ubGVuZ3RoO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndGFrZXInOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAndGFrZXJfZmVlX3JhdGUnKSxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWFrZXJfZmVlX3JhdGUnKSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ2xlYXN0X2Ftb3VudCcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWVyZ2UnXVtudW1NZXJnZUxldmVscyAtIDFdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ2RhdGUnXTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHRpY2tlciA9IHRpY2tlclsndGlja2VyJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VW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29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2RlYWxfbW9uZXknKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2Ftb3VudCcpO1xuICAgICAgICBsZXQgZmlsbGVkID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZGVhbF9hbW91bnQnKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCAtIGZpbGxlZCk7XG4gICAgICAgIGxldCBzdGF0dXMgPSBvcmRlclsnc3RhdHVzJ107XG4gICAgICAgIGlmIChzdGF0dXMgPT09ICdkb25lJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBub3RfZGVhbFxuICAgICAgICAgICAgLy8gcGFydF9kZWFsXG4gICAgICAgICAgICBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdpZCcpLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ29yZGVyX3R5cGUnXSxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB7XG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgICAgICdjb3N0JzogdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZGVhbF9mZWUnKSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3RPcmRlcicgKyB0aGlzLmNhcGl0YWxpemUgKHR5cGUpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGFtb3VudCA9IHBhcnNlRmxvYXQgKGFtb3VudCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAndHlwZSc6IHNpZGUsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09PSAnbGltaXQnKSB7XG4gICAgICAgICA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GVuZCAoe1xuICAgICAgICAgICAgICAgICdhY2Nlc3NfaWQnOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAndG9uY2UnOiBub25jZS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgIH0sIHF1ZXJ5KTtcbiAgICAgICAgICAgIHF1ZXJ5ID0gdGhpcy5rZXlzb3J0IChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgdXJsZW5jb2RlZCA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5oYXNoICh0aGlzLmVuY29kZSAodXJsZW5jb2RlZCArICcmc2VjcmV0X2tleT0nICsgdGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0F1dGhvcml6YXRpb24nOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoKG1ldGhvZCA9PT0gJ0dFVCcpIHx8IChtZXRob2QgPT09ICdERUxFVEUnKSkge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB1cmxlbmNvZGVkO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgbGV0IGNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnY29kZScpO1xuICAgICAgICBsZXQgZGF0YSA9IHRoaXMuc2FmZVZhbHVlIChyZXNwb25zZSwgJ2RhdGEnKTtcbiAgICAgICAgaWYgKGNvZGUgIT09ICcwJyB8fCAhZGF0YSkge1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlQ29kZXMgPSB7XG4gICAgICAgICAgICAgICAgJzI0JzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMjUnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDcnOiBJbnN1ZmZpY2llbnRGdW5kcyxcbiAgICAgICAgICAgICAgICAnNjAwJzogT3JkZXJOb3RGb3VuZCxcbiAgICAgICAgICAgICAgICAnNjAxJzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICc2MDInOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJzYwNic6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgRXJyb3JDbGFzcyA9IHRoaXMuc2FmZVZhbHVlIChyZXNwb25zZUNvZGVzLCBjb2RlLCBFeGNoYW5nZUVycm9yKTtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvckNsYXNzIChyZXNwb25zZVsnbWVzc2FnZSddKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgfVxufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuLy8gIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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AgICAgICAnZmV0Y2hUcmFkZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzQ4NDIzMDMtMjljOTlmY2EtZjcxYy0xMWU3LTgzYzEtMDlkOTAwY2IyMzM0LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5jb2luZXhjaGFuZ2UuaW8vYXBpL3YxJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmNvaW5leGNoYW5nZS5pbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2NvaW5leGNoYW5nZWlvLmdpdGh1Yi5pby9zbGF0ZS8nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vd3d3LmNvaW5leGNoYW5nZS5pby9mZWVzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y3VycmVuY3knLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGN1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG1hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG1hcmtldHN1bW1hcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0bWFya2V0c3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0b3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMTUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnMTMzNyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnNDIwRyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnNjExJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FDQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUNFUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUNPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBQ1AnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEQ04nOiA1MDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRFNUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEWic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBR1JJJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBS1knOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FMSVMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUxMJzogMC4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTU1PJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTVMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FOVFgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FOWSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUkcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJHVVMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSR1VTT0xEJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBU04nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUT00nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0IyQic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCMyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFLRUQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCREwnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFRVInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFTEEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFTkpJJzogMC4wNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCRVQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JGSSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCSUdVUCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCSVJEUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQklUQic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCSVhDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCSVonOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JMQVMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkxBWlInOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkxLJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTE4nOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkxVRSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCT0FUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JPTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk9OUEFZJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JPUFMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JQT0snOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlEnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlJBVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlJDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JSSVQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JTTic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCU1InOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQmMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQ1JFRCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVENSRic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlREWCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEUnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRQTCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVMTFMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JVWlonOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JYVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQzQ3JzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NBQ0gnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0FMQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0FOTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0JBTksnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NIRUFQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDSEVTUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0hJTEknOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NISVBTJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NKJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NMVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTVBDTyc6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTVgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NOTkMnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NOVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ08yJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPT0MnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPVVBFJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDUVNUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NSQUNLRVJTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDUkROQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1JFQSc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1JFQUsnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NSRVZBMic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1JNU04nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NSTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1JXJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVElDMic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1VCRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1hUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDWUNMT05FJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDWURFUic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFHJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQUxDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBUkknOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBVic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREJJQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ04nOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdERlMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHQic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0MnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRElNRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE1CJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETUMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE5DVjInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RORSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRUonOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSR04nOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJTJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RTRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFNSJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEVENUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RVVENIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQkMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUNDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VDTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURSQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUVDTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUdDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMQ08nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxJWCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTFMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNSVJHJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTlRSQyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTlpPJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VRTCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFUVQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJTTyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VSWSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVNQJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQlMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VURyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSEQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSE9TJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUTic6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVJPUCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWENMJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VYVE4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZBSVInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZBUCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGQVpaJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGQ0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZHWic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGTEFTSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRkxJSyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGUlQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlNYJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlhFJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dBSU4nOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0InOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0JYJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHREMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VFUlQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dFVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0ZDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dMUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0xUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTFRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTUInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dNWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR09LVU9MRCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHT0xEJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHT0xGJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dPT0QnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1AnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dSRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1JFRU5GJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHUk1EJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dSUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1JYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1dDJzogMC4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hBTExPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIQkMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIRUFMVEhZJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdISUdIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdITUMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hOQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSE9DJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIT0RMJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIT0xMWSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIT05FWSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSE9QRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFBDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIVUInOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFlQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIWVBFUic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUJDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDRSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ09UJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lGVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lNWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5ESUEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lORk8nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lOU04nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lOWFQnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU9FJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJUVQnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVhDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdKQVBBTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSkVESSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSkVUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0pJTic6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdLQVlJJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLQjMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tHQic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0xDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tNRCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS09CTyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLT0knOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tPUlVOQSc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLUkEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tVQk8nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tVUlQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBTUJPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQ1QnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTERDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMRVZPJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xJRkUnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElOREEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xJTlgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xJWic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTE1DJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xOSyc6IDAuMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFJDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRHJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xVQ0snOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xVTkEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xWUFMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BQyc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQUcnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BTEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BUlMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BUlMyJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQVhJJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQVknOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01CQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUJJVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNCJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01FQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNRU5UQUwnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUVSJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01FVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUdNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNR1QnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01JTE8nOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlORVgnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlOVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNSVBTJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01OWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU9JTic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNT09OJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01TQ04nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01TUCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNU1QnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRIJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01VRSc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVVgnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVhDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNWFQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVlCJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05CSVQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkJYJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU9HJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FT04nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05MQzInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05MRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOUk4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05STyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlRDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05UTyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVUEnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlVNVVMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09DJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPR04nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09STyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFSSVMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BBWVUnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUENOJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BDUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUERHJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQRUMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BHTCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQSE4nOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUElDTyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQSUUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJR0dZJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJVlgnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUElYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BLVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTEFDTyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPTCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9MT0InOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9TJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPU1QnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9TVyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9UJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUklNVSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJMJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSTic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUlgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BUUyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQVVJBJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BVUkUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BVVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQV0MnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BXUic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVUFOVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkFJTic6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSQkwnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JEQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRUdBJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFWCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSSE8nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUklZQSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSTUMnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUk5TJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdST0MnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUk9PRlMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JVQic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlVORSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlVOTkVSUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlVQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQklUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQ0wnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0NPUkUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NDT1JFT0xEJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTREFTSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0ZDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTRkUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NHUic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSElUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NITSc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSE5EJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NIT1QnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0lDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NJTEsyJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSU1QJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0lTQSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS09JTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0tVTEwnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NMRVZJTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0xSJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTUFSVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01TJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05PVyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU09MQVInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NQUlRTJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NSQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1NUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUQVJTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVE4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUTyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVUEVSJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVVBFUk1BTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VSR0UnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NXQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTWU5RJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTWU5YJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUQUFTJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RCUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVENPSU4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RFTEwnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEVSJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEdUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RJR0VSJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSVBTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTEUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RPUEFaJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUT1InOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RQQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFBHJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUEknOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJBTkNFJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUkMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSVVgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RTRSc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUU1RSJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUVVJCTyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUZPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVSyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUxBJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVTklGWSc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVTklUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VOTyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVUUMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNBJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkdTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSURaJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSVNJTyc6IDAuMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkxUQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT0lTRSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT05FJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT1gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZTWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVlVMQ0FOTyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0FTSCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXQ0wnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOSyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV09NRU4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dPUk0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dPVyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXUlAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dZVic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEJDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQkwnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEJVJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hDSEUnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWENTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQ1QnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hDWFQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hERTInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hFVic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYR09YJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYR1RDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTFInOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1DQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFAnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFBBU0MnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hRTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFNBJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hTVEMnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFREJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYVlMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hYWCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYWU9DJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hZWic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFpDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1haQ0QnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lIQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkNDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaQ0cnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkNMJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVJVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRU5JJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRVJPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaTUMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWk9JJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaU0UnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pVUk1PJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1paQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ0JPTic6ICdCb25QZUthTycsXG4gICAgICAgICAgICAgICAgJ0VUTic6ICdFdGhlcm5leCcsXG4gICAgICAgICAgICAgICAgJ0dEQyc6ICdHb2xkZW5DcnlwdG9Db2luJyxcbiAgICAgICAgICAgICAgICAnR1RDJzogJ0dsb2JhbFRvdXJDb2luJyxcbiAgICAgICAgICAgICAgICAnSE5DJzogJ0h1bmNvaW4nLFxuICAgICAgICAgICAgICAgICdNQVJTJzogJ01hcnNCdXgnLFxuICAgICAgICAgICAgICAgICdNRVInOiAnVGhlTWVybWFpZENvaW4nLFxuICAgICAgICAgICAgICAgICdSVUInOiAnUnViYmxlQ29pbicsXG4gICAgICAgICAgICAgICAgJ1VQJzogJ1Vwc2NhbGVUb2tlbicsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0R2V0Y3VycmVuY2llcyAocGFyYW1zKTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCBwcmVjaXNpb24gPSB0aGlzLnByZWNpc2lvblsnYW1vdW50J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY3lbJ0N1cnJlbmN5SUQnXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5WydUaWNrZXJDb2RlJ10pO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IGN1cnJlbmN5WydXYWxsZXRTdGF0dXMnXSA9PT0gJ29ubGluZSc7XG4gICAgICAgICAgICBsZXQgc3RhdHVzID0gJ29rJztcbiAgICAgICAgICAgIGlmICghYWN0aXZlKVxuICAgICAgICAgICAgICAgIHN0YXR1cyA9ICdkaXNhYmxlZCc7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ05hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0R2V0bWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnTWFya2V0SUQnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKG1hcmtldFsnTWFya2V0QXNzZXRDb2RlJ10pO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKG1hcmtldFsnQmFzZUN1cnJlbmN5Q29kZSddKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBtYXJrZXRbJ01hcmtldEFzc2V0SUQnXSxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IG1hcmtldFsnQmFzZUN1cnJlbmN5SUQnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogbWFya2V0WydBY3RpdmUnXSxcbiAgICAgICAgICAgICAgICAnbG90JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IHRpY2tlclsnTWFya2V0SUQnXTtcbiAgICAgICAgICAgIGlmIChtYXJrZXRJZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW21hcmtldElkXTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRJZDtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdMYXN0UHJpY2UnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnSGlnaFByaWNlJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0xvd1ByaWNlJyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0JpZFByaWNlJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdBc2tQcmljZScpLFxuICAgICAgICAgICAgJ2Fza1ZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbm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5jb2luZmxvb3IuY28udWs6ODA5MC9iaXN0JyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmNvaW5mbG9vci5jby51aycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9jb2luZmxvb3IvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmNvaW5mbG9vci5jby51ay9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdwYXNzd29yZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vdGlja2VyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9vcmRlcl9ib29rLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS90cmFuc2FjdGlvbnMvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2JhbGFuY2UvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3VzZXJfdHJhbnNhY3Rpb25zLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9vcGVuX29yZGVycy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vY2FuY2VsX29yZGVyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9idXkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3NlbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2J1eV9tYXJrZXQvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3NlbGxfbWFya2V0LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9lc3RpbWF0ZV9zZWxsX21hcmtldC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vZXN0aW1hdGVfYnV5X21hcmtldC8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9HQlAnOiB7ICdpZCc6ICdYQlQvR0JQJywgJ3N5bWJvbCc6ICdCVEMvR0JQJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0dCUCcgfSxcbiAgICAgICAgICAgICAgICAnQlRDL0VVUic6IHsgJ2lkJzogJ1hCVC9FVVInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvVVNEJzogeyAnaWQnOiAnWEJUL1VTRCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9QTE4nOiB7ICdpZCc6ICdYQlQvUExOJywgJ3N5bWJvbCc6ICdCVEMvUExOJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1BMTicgfSxcbiAgICAgICAgICAgICAgICAnQkNIL0dCUCc6IHsgJ2lkJzogJ0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kJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldElkVGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc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HRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2Ftb3VudCcpO1xuICAgICAgICBsZXQgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICBsZXQgc2lkZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHN0YXR1cyA9IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdzdGF0dXMnKTtcbiAgICAgICAgaWYgKG9yZGVyWyd0eXBlJ10gPT09IDApXG4gICAgICAgICAgICBzaWRlID0gJ2J1eSc7XG4gICAgICAgIGVsc2UgaWYgKG9yZGVyWyd0eXBlJ10gPT09IDEpXG4gICAgICAgICAgICBzaWRlID0gJ3NlbGwnO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgaWQgPSBvcmRlclsnaWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGRhdGV0aW1lLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiB1bmRlZmluZWQsXG4g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YXJpYSwgQ2hpbmEsIFVTXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODYxOTcwNy01YzkyMzJhOC03MjEyLTExZTctODZkNi05OGZlNWQxNWNjNmUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vY29pbmdpLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW50JzogJ2h0dHBzOi8vYXBpLmNvaW5naS5jb20nLFxuICAgICAgICAgICAgICAgICAgICAndXNlcic6ICdodHRwczovL2FwaS5jb2luZ2kuY29tJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2luZ2kuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHA6Ly9kb2NzLmNvaW5naS5hcGlhcnkuaW8vJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3d3cnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdjdXJyZW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyLWJvb2sve3BhaXJ9L3thc2tDb3VudH0ve2JpZENvdW50fS97ZGVwdGh9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMve3BhaXJ9L3ttYXhDb3VudH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJzI0aG91ci1yb2xsaW5nLWFnZ3JlZ2F0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd1c2VyJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhZGQtb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbC1vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZS1jcnlwdG8td2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdWVEMnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTk1DJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogMTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTk1DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHRoaXMucGFyc2VKc29uUmVzcG9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gJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogaWQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0s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HtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNbc3ltYm9sXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLmZldGNoVGlja2VycyAodW5kZWZpbmVkLCBwYXJhbXMpO1xuICAgICAgICBpZiAoc3ltYm9sIGluIHRpY2tlcnMpXG4gICAgICAgICAgICByZXR1cm4gdGlja2Vyc1tzeW1ib2xdO1xuICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcmV0dXJuIGRpZCBub3QgY29udGFpbiAnICsgc3ltYm9sKTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGlmICghbWFya2V0KVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydjdXJyZW5jeVBhaXInXV07XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdHJhZGVbJ3RpbWVzdGFtcCddLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0cmFkZVsndGltZXN0YW1wJ10pLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gIC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wLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdVUycsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZUFQSSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVMaW1pdE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2VkaXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaEJhbGFuY2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlckJvb2snOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRyYWRlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjgyNDQyNDQtOWJlNjMxMmEtNjllZC0xMWU3LTk5YzEtN2MxNzk3Mjc1MjY1LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2FwaS5jb2lubWFya2V0Y2FwLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICdmaWxlcyc6ICdodHRwczovL2ZpbGVzLmNvaW5tYXJrZXRjYXAuY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ2NoYXJ0cyc6ICdodHRwczovL2dyYXBoLmNvaW5tYXJrZXRjYXAuY29tJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2lubWFya2V0Y2FwLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2NvaW5tYXJrZXRjYXAuY29tL2FwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdmaWxlcyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZW5lcmF0ZWQvc3RhdHMvZ2xvYmFsLmpzb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2dyYXBocyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jaWVzL3tuYW1lfS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2lkfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dsb2JhbC8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2N1cnJlbmN5Q29kZXMnOiBbXG4gICAgICAgICAgICAgICAgJ0FVRCcsXG4gICAgICAgICAgICAgICAgJ0JSTCcsXG4gICAgICAgICAgICAgICAgJ0NBRCcsXG4gICAgICAgICAgICAgICAgJ0NIRicsXG4gICAgICAgICAgICAgICAgJ0NOWScsXG4gICAgICAgICAgICAgICAgJ0VVUicsXG4gICAgICAgICAgICAgICAgJ0dCUCcsXG4gICAgICAgICAgICAgICAgJ0hLRCcsXG4gICAgICAgICAgICAgICAgJ0lEUicsXG4gICAgICAgICAgICAgICAgJ0lOUicsXG4gICAgICAgICAgICAgICAgJ0pQWScsXG4gICAgICAgICAgICAgICAgJ0tSVycsXG4gICAgICAgICAgICAgICAgJ01YTicsXG4gICAgICAgICAgICAgICAgJ1JVQicsXG4gICAgICAgICAgICAgICAgJ1VTRCcsXG4gICAgICAgICAgICBdLFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKCdGZXRjaGluZyBvcmRlciBib29rcyBpcyBub3Qgc3VwcG9ydGVkIGJ5IHRoZSBBUEkgb2YgJyArIHRoaXMuaWQpO1xuICAgIH1cblxuICAgIGN1cnJlbmN5Q29kZSAoYmFzZSwgbmFtZSkge1xuICAgICAgICBjb25zdCBjdXJyZW5jaWVzID0ge1xuICAgICAgICAgICAgJ0FDQ2hhaW4nOiAnQUNDaGFpbicsXG4gICAgICAgICAgICAnQWRDb2luJzogJ0FkQ29pbicsXG4gICAgICAgICAgICAnQmF0Q29pbic6ICdCYXRDb2luJyxcbiAgICAgICAgICAgICdCaXRnZW0nOiAnQml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mN1cnJlbmN5Q29kZXM7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZUlkID0gcXVvdGUudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY3VycmVuY3lDb2RlIChtYXJrZXRbJ3N5bWJvbCddLCBtYXJrZXRbJ25hbWUnXSk7XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBiYXNlSWQgKyAnLycgKyBxdW90ZUlkO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hHbG9iYWwgKGN1cnJlbmN5ID0gJ1VTRCcpIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJ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iAgICAgICAgICAgICAgICAgICAgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsIHByaWNlS2V5KTtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgdm9sdW1lS2V5ID0gJzI0aF92b2x1bWVfJyArIG1hcmtldFsncXVvdGVJZCddO1xuICAgICAgICAgICAgaWYgKHZvbHVtZUtleSBpbiB0aWNrZXIpXG4gICAgICAgICAgICAgICAgaWYgKHRpY2tlclt2b2x1bWVLZXldKVxuICAgICAgICAgICAgICAgICAgICB2b2x1bWUgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCB2b2x1bWVLZXkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xvdyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IGNoYW5nZSxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoY3VycmVuY3kgPSAnVVNEJywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnbGltaXQnOiAxMDAwMCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKGN1cnJlbmN5KVxuICAgICAgICAgICAgcmVxdWVzdFsnY29udmVydCddID0gY3VycmVuY3k7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXJzID0ge307XG4gICAgICAgIGZvciAobGV0IHQgPSAwOyB0IDwgcmVzcG9uc2UubGVuZ3RoOyB0KyspIHtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVt0XTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeUlkID0gKGN1cnJlbmN5IGluIHRoaXMuY3VycmVuY2llcykgPyB0aGlzLmN1cnJlbmNpZXNbY3VycmVuY3ldWydpZCddIDogY3VycmVuY3kudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgaWQgPSB0aWNrZXJbJ2lkJ10gKyAnLycgKyBjdXJyZW5jeUlkO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aWNrZXJzW3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRpY2tlcnM7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY29udmVydCc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnYmFzZUlkJ10sXG4gICAgICAgIH0sIHBhcmFtcyk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VySWQgKHJlcXVlc3QpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbMF07XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hDdXJyZW5jaWVzIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2xpbWl0JzogMCxcbiAgICAgICAgfSwgcGFyY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JzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNb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AgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHA6Ly9kb2NzLmNvaW5tYXRlLmFwaWFyeS5pbycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2NvaW5tYXRlLmlvL2RldmVsb3BlcnMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyQm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luV2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbkRlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eUluc3RhbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eUxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXJXaXRoSW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlVm91Y2hlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVkZWVtVm91Y2hlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbEluc3RhbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxMaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25IaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1bmNvbmZpcm1lZEJpdGNvaW5EZXBvc2l0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0VVUic6IHsgJ2lkJzogJ0JUQ19FVVInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJywgJ3ByZWNpc2lvbic6IHsgJ2Ftb3VudCc6IDQsICdwcmljZSc6IDIgfX0sXG4gICAgICAgICAgICAgICAgJ0JUQy9DWksnOiB7ICdpZCc6ICdCVENfQ1pLJywgJ3N5bWJvbCc6ICdCVEMvQ1pLJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0NaSycsICdwcmVjaXNpb24nOiB7ICdhbW91bnQnOiA0LCAncHJpY2UnOiAyIH19LFxuICAgICAgICAgICAgICAgICdMVEMvQlRDJzogeyAnaWQnOiAnTFRDX0JUQycsICdzeW1ib2wnOiAnTFRDL0JUQycsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdCVEMnLCAncHJlY2lzaW9uJzogeyAnYW1vdW50JzogNCwgJ3ByaWNlJzogNSB9fSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMzUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VzKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYmFsYW5jZXNbY3VycmVuY3ldWydhdmFpbGFibGUnXTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBiYWxhbmNlc1tjdXJyZW5jeV1bJ3Jlc2VydmVkJ107XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IGJhbGFuY2VzW2N1cnJlbmN5XVsnYmFsYW5jZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAg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4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAoIW1hcmtldClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFt0cmFkZVsnY3VycmVuY3lQYWlyJ11dO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RyYW5zYWN0aW9uSWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdHJhZGVbJ3RpbWVzdGFtcCddLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0cmFkZVsndGltZXN0YW1wJ10pLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYW5zYWN0aW9ucyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeVBhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnbWludXRlc0ludG9IaXN0b3J5JzogMTAsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2VbJ2RhdGEnXSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3QnICsgdGhpcy5jYXBpdGFsaXplIChzaWRlKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2N1cnJlbmN5UGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09PSAnbWFya2V0Jykge1xuICAgICAgICAgICAgaWYgKHNpZGUgPT09ICdidXknKVxuICAgICAgICAgICAgICAgIG9yZGVyWyd0b3RhbCddID0gYW1vdW50OyAvLyBhbW91bnQgaW4gZmlhdFxuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudDsgLy8gYW1vdW50IGluIGZpYXRcbiAgICAgICAgICAgIG1ldGhvZCArPSAnSW5zdGFudCc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvcmRlclsnYW1vdW50J10gPSBhbW91bnQ7IC8vIGFtb3VudCBpbiBjcnlwdG9cbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gcHJpY2U7XG4gICAgICAgICAgICBtZXRob2QgKz0gdGhpcy5jYXBpdGFsaXplICh0eXBlKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlL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cGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5jb2lubmVzdC5jby5rci9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd3d3LmNvaW5uZXN0LmNvLmtyJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuY29pbm5lc3QuY28ua3InLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuY29pbm5lc3QuY28ua3IvZG9jL2ludHJvLmh0bWwnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9jb2lubmVzdGhlbHAuemVuZGVzay5jb20vaGMva28vYXJ0aWNsZXMvMTE1MDAyMTEwMjUyLSVFQSVCMSVCMCVFQiU5RSU5OC0lRUMlODglOTglRUMlODglOTglRUIlQTMlOEMlRUIlOEElOTQtJUVDJTk2JUJDJUVCJUE3JTg4JUVDJTlEJUI4JUVBJUIwJTgwJUVDJTlBJTk0LScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2NvaW5uZXN0aGVscC56ZW5kZXNrLmNvbS9oYy9rby9hcnRpY2xlcy8xMTUwMDIxMTAyNzItJUVCJUI5JTg0JUVEJThBJUI4JUVDJUJEJTk0JUVDJTlEJUI4LSVFQyU4OCU5OCVFQyU4OCU5OCVFQiVBMyU4QyVFQiVBNSVCQy0lRUMlODQlQTAlRUQlODMlOUQlRUQlOTUlOTglRUIlOEElOTQtJUVDJTlEJUI0JUVDJTlDJUEwJUVBJUIwJTgwLSVFQiVBQyVCNCVFQyU5NyU4NyVFQyU5RCVCOCVFQSVCMCU4MCVFQyU5QSU5NC0nLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnd2ViJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvaW4vYWxsY29pbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3B1Yi90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3B1Yi9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHViL3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9hZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvZmV0Y2h0cnVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvdHJ1c3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAnMC4wMDInLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHF1b3RlID0gJ0tSVyc7XG4gICAgICAgIGxldCBxdW90ZUlkID0gcXVvdGUudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgIC8vIHRvZG86IHJld3JpdGUgdGhpcyBmb3Igd2ViIGVuZHBvaW50XG4gICAgICAgIGxldCBjb2lucyA9IFtcbiAgICAgICAgICAgICdidGMnLFxuICAgICAgICAgICAgJ2JjaCcsXG4gICAgICAgICAgICAnYnRnJyxcbiAgICAgICAgICAgICdiY2QnLFxuICAgICAgICAgICAgJ3VidGMnLFxuICAgICAgICAgICAgJ2J0bicsXG4gICAgICAgICAgICAna3N0JyxcbiAgICAgICAgICAgICdsdGMnLFxuICAgICAgICAgICAgJ2FjdCcsXG4gICAgICAgICAgICAnZXRoJyxcbiAgICAgICAgICAgICdldGMnLFxuICAgICAgICAgICAgJ2FkYScsXG4gICAgICAgICAgICAncXR1bScsXG4gICAgICAgICAgICAneGxtJyxcbiAgICAgICAgICAgICduZW8nLFxuICAgICAgICAgICAgJ2dhcycsXG4gICAgICAgICAgICAncnB4JyxcbiAgICAgICAgICAgICdoc3InLFxuICAgICAgICAgICAgJ2tuYycsXG4gICAgICAgICAgICAndHNsJyxcbiAgICAgICAgICAgICd0cm9uJyxcbiAgICAgICAgICAgICdvbWcnLFxuICAgICAgICAgICAgJ3d0YycsXG4gICAgICAgICAgICAnbWNvJyxcbiAgICAgICAgICAgICdzdG9ybScsXG4gICAgICAgICAgICAnZ3RvJyxcbiAgICAgICAgICAgICdweHMnLFxuICAgICAgICAgICAgJ2NoYXQnLFxuICAgICAgICAgICAgJ2luaycsXG4gICAgICAgICAgICAnb2MnLFxuICAgICAgICAgICAgJ2hsYycsXG4gICAgICAgICAgICAnZW50JyxcbiAgICAgICAgICAgICdxYnQnLFxuICAgICAgICAgICAgJ3NwYycsXG4gICAgICAgICAgICAncHV0JyxcbiAgICAgICAgXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNvaW5zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gY29pbnNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBiYXNlSWQgKyAnLycgKyBxdW90ZUlkO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkLnRvVXBwZXJDYXNlICgpKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndGltZSddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc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ldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGUnXSkgKiAxMDAwO1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdwcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnYW1vdW50Jyk7XG4gICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQgKiBwcmljZSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0aWQnKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAoY29zdCksXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcm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4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zODAwMzMwMC1hZGMxMmZiYS0zMjNmLTExZTgtODUyNS03MjVmNTNjNGE2NTkuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmNvaW5vbmUuY28ua3InLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2lub25lLmNvLmtyJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZG9jLmNvaW5vbmUuY28ua3InLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2svJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2J0Y19kZXBvc2l0X2FkZHJlc3MvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2JhbGFuY2UvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2RhaWx5X2JhbGFuY2UvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3VzZXJfaW5mby8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvdmlydHVhbF9hY2NvdW50LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsX2FsbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2xpbWl0X2J1eS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2xpbWl0X3NlbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jb21wbGV0ZV9vcmRlcnMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9saW1pdF9vcmRlcnMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcl9pbmZvLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb24vYXV0aF9udW1iZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbi9oaXN0b3J5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb24va3J3L2hpc3RvcnkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbi9idGMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbi9jb2luLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgIC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LCAwLjAwMV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAwMCwgMC4wMDA5XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAwMCwgMC4wMDA4XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwMDAwMCwgMC4wMDA3XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAwMDAsIDAuMDAwNl0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAwMDAwLCAwLjAwMDVdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFszMDAwMDAwMDAwMCwgMC4wMDA0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDAwMDAwMDAwMDAsIDAuMDAwM10sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMDAwMDAwLCAwLjAwMDJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYWtlcic6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMCwgMC4wMDFdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwMDAsIDAuMDAwOF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAwMDAsIDAuMDAwNl0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMDAwMDAsIDAuMDAwNF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAwMDAwLCAwLjAwMDJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzMwMDAwMDAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDAwMDAwMDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzQwNSc6IEV4Y2hhbmdlTm90QXZhaWxhYmxlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QWNjb3VudEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChyZXNwb25zZSk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IHJlc3BvbnNlW2lkXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gaWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5jdXJyZW5jaWVzX2J5X2lkKVxuICAgICAgICAgICAgICAgIGNvZGUgPSB0aGlzLmN1cnJlbmNpZXNfYnlfaWRbaWRdWydjb2RlJ107XG4gICAgICAgICAgICBsZXQgZnJlZSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2F2YWlsJ10pO1xuICAgICAgICAgICAgbGV0IHRvdGFsID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnYmFsYW5jZSddKTtcbiAgICAgICAgICAgIGxldCB1c2VkID0gdG90YWwgLSBmcmVlO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBmcmVlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdXNlZCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiB0b3RhbCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE9yZGVyYm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdmb3JtYXQnOiAnanNvbicsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAocmVzcG9uc2UsIHVuZGVmaW5lZCwgJ2JpZCcsICdhc2snLCAncHJpY2UnLCAncXR5Jyk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6ICdhbGwnLFxuICAgICAgICAgICAgJ2Zvcm1hdCc6ICdqc29uJyxcbiAgICAgICAgfSwgcGFyYW1z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BpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSByZXF1ZXN0O1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLnZlcnNpb24gKyAnLycgKyByZXF1ZXN0O1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBqc29uID0gdGhpcy5qc29uICh7XG4gICAgICAgICAgICAgICAgJ2FjY2Vzc190b2tlbic6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IHRoaXMuc3RyaW5nVG9CYXNlNjQgKHRoaXMuZW5jb2RlIChqc29uKSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5kZWNvZGUgKHBheWxvYWQpO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuc2VjcmV0LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAocGF5bG9hZCwgdGhpcy5lbmNvZGUgKHNlY3JldCksICdzaGE1MTInKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgICAgICAnWC1DT0lOT05FLVBBWUxPQUQnOiBwYXlsb2FkLFxuICAgICAgICAgICAgICAgICdYLUNPSU5PTkUtU0lHTkFUVVJFJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoKGJvZHlbMF0gPT09ICd7JykgfHwgKGJvZHlbMF0gPT09ICdbJykpIHtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgaWYgKCdyZXN1bHQnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgICAgICAgICBpZiAocmVzdWx0ICE9PSAnc3VjY2VzcycpIHtcbiAgICAgICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICAgICAgLy8gICAgeyAgXCJlcnJvckNvZGVcIjogXCI0MDVcIiwgIFwic3RhdHVzXCI6IFwibWFpbnRlbmFuY2VcIiwgIFwicmVzdWx0XCI6IFwiZXJyb3JcIn1cbiAgICAgICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY29kZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdlcnJvckNvZGUnKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZmVlZGJhY2sgPSB0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGV4Y2VwdGlvbnMgPSB0aGlzLmV4Y2VwdGlvbnM7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb2RlIGluIGV4Y2VwdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBleGNlcHRpb25zW2NvZGVdIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuLy8gIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5jb25zdCBFeGNoYW5nZSA9IHJlcXVpcmUgKCcuL2Jhc2UvRXhjaGFuZ2UnKTtcbmNvbnN0IHsgRXhjaGFuZ2VFcnJvciwgTm90U3VwcG9ydGVkIH0gPSByZXF1aXJlICgnLi9iYXNlL2Vycm9ycycpO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgY29pbnNlY3VyZSBleHRlbmRzIEV4Y2hhbmdlIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnY29pbnNlY3VyZScsXG4gICAgICAgICAgICAnbmFtZSc6ICdDb2luc2VjdXJlJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnSU4nLCAvLyBJbmRpYVxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NDcyLTljYmQyMDBhLTVlZDktMTFlNy05NTUxLTIyNjdhZDdiYWMwOC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuY29pbnNlY3VyZS5pbicsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2NvaW5zZWN1cmUuaW4nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS5jb2luc2VjdXJlLmluJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9jb2luc2VjdXJlL3BsdWdpbnMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luL3NlYXJjaC9jb25maXJtYXRpb24ve3R4aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9hc2svbG93JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9hc2svb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9iaWQvaGlnaCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYmlkL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvbGFzdFRyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9tYXgyNEhyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9taW4yNEhyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZmEvYXV0aHkvY2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWZhL2F1dGh5L3NtcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbmV0a2kvc2VhcmNoL3tuZXRraU5hbWV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2Jhbmsvb3RwL3tudW1iZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2t5Yy9vdHAve251bWJlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJvZmlsZS9waG9uZS9vdHAve251bWJlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vYWRkcmVzcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2RlcG9zaXQvY29uZmlybWVkL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9kZXBvc2l0L2NvbmZpcm1lZC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2RlcG9zaXQvdW5jb25maXJtZWQvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2RlcG9zaXQvdW5jb25maXJtZWQve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi93YWxsZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvYmFsYW5jZS9hdmFpbGFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2JhbGFuY2UvcGVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvYmFsYW5jZS90b3RhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvZGVwb3NpdC9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2RlcG9zaXQvdW52ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvZGVwb3NpdC92ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L3ZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Fzay9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYXNrL2NvbXBsZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9hc2svcGVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iaWQvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmlkL3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vYmFsYW5jZS9hdmFpbGFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2JhbGFuY2UvcGVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vYmFsYW5jZS90b3RhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vZGVwb3NpdC9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2RlcG9zaXQvdW52ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vZGVwb3NpdC92ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L3ZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Jhbmsvc3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9jb2luL2ZlZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9maWF0L2ZlZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9reWNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL3JlZmVycmFsL2NvaW4vcGFpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9yZWZlcnJhbC9jb2luL3N1Y2Nlc3NmdWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvcmVmZXJyYWwvZmlhdC9wYWlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL3JlZmVycmFscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS90cmFkZS9zdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2xvZ2luL3Rva2VuL3t0b2tlbn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvc3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvc3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2NvaW4vd2l0aGRyYXcvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvY29pbi93aXRoZHJhdy9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC9jb2luL3dpdGhkcmF3L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC9jb2luL3dpdGhkcmF3L3ZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9naW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvZ2luL2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2dpbi9wYXNzd29yZC9mb3Jnb3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21mYS9hdXRoeS9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWZhL2dhL2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzaWdudXAnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbmV0a2kvdXBkYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Byb2ZpbGUvaW1hZ2UvdXBkYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvbmV3VmVyaWZ5Y29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvaW5pdGlhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L25ld1ZlcmlmeWNvZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcGFzc3dvcmQvY2hhbmdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Bhc3N3b3JkL3Jlc2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL3dpdGhkcmF3L2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvY29pbi93aXRoZHJhdy9uZXdWZXJpZnljb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzaWdudXAvdmVyaWZ5L3t0b2tlbn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2Uva3ljJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9kZXBvc2l0L25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9hc2svbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvaW5zdGFudC9idXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvaW5zdGFudC9zZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy92ZXJpZnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2FjY291bnQvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy92ZXJpZnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWZhL2F1dGh5L2luaXRpYXRlL2VuYWJsZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9tZmEvZ2EvaW5pdGlhdGUvZW5hYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL25ldGtpL2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL3Bob25lL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9hZGRyZXNzL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vd2l0aGRyYXcvc2VuZFRvRXhjaGFuZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vd2l0aGRyYXcvdmVyaWZ5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2djbS97Y29kZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbG9nb3V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy91bnZlcmlmaWVkL2NhbmNlbC97d2l0aGRyYXdJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2RlcG9zaXQvY2FuY2VsL3tkZXBvc2l0SUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Fzay9jYW5jZWwve29yZGVySUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9jYW5jZWwve29yZGVySUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy91bnZlcmlmaWVkL2NhbmNlbC97d2l0aGRyYXdJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWZhL2F1dGh5L2Rpc2FibGUve2NvZGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21mYS9nYS9kaXNhYmxlL3tjb2RlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL3Bob25lL2RlbGV0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL2ltYWdlL2RlbGV0ZS97bmV0a2lOYW1lfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi93aXRoZHJhdy91bnZlcmlmaWVkL2NhbmNlbC97d2l0aGRyYXdJRH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9JTlInOiB7ICdpZCc6ICdCVEMvSU5SJywgJ3N5bWJvbCc6ICdCVEMvSU5SJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0lOUicgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC40IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjQgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0VXNlckV4Y2hhbmdlQmFua1N1bW1hcnkgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ21lc3NhZ2UnXTtcbiAgICAgICAgbGV0IGNvaW4gPSB7XG4gICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ2F2YWlsYWJsZUNvaW5CYWxhbmNlJ10sXG4gICAgICAgICAgICAndXNlZCc6IGJhbGFuY2VbJ3BlbmRpbmdDb2luQmFsYW5jZSddLFxuICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZVsndG90YWxDb2luQmFsYW5jZSddLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgZmlhdCA9IHtcbiAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZV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HBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVB1dFVzZXJFeGNoYW5nZSc7XG4gICAgICAgIGxldCBvcmRlciA9IHt9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnSW5zdGFudCcgKyB0aGlzLmNhcGl0YWxpemUgKHNpZGUpO1xuICAgICAgICAgICAgaWYgKHNpZGUgPT09ICdidXknKVxuICAgICAgICAgICAgICAgIG9yZGVyWydtYXhGaWF0J10gPSBhbW91bnQ7XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgb3JkZXJbJ21heFZvbCddID0gYW1vdW50O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IGRpcmVjdGlvbiA9IChzaWRlID09PSAnYnV5JykgPyAnQmlkJyA6ICdBc2snO1xuICAgICAgICAgICAgbWV0aG9kICs9IGRpcmVjdGlvbiArICdOZXcnO1xuICAgICAgICAgICAgb3JkZXJbJ3JhdGUnXSA9IHByaWNlO1xuICAgICAgICAgICAgb3JkZXJbJ3ZvbCddID0gYW1vdW50O1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnbWVzc2FnZSddWydvcmRlcklEJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk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saWNhdGlvbi9qc29uJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoY29kZSA9PT0gMjAwKSB7XG4gICAgICAgICAgICBpZiAoKGJvZHlbMF0gPT09ICd7JykgfHwgKGJvZHlbMF0gPT09ICdbJykpIHtcbiAgICAgICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBzdWNjZXNzID0gcmVzcG9uc2VbJ3N1Y2Nlc3MnXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzdWNjZXNzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZXJyb3IgcmV0dXJuZWQ6ICcgKyBib2R5KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoISgnbWVzc2FnZScgaW4gcmVzcG9uc2UpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgbWFsZm9ybWVkIHJlc3BvbnNlOiBubyBcIm1lc3NhZ2VcIiBpbiByZXNwb25zZTogJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoa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AvLyBBdXN0cmFsaWFcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjgyMDg0MjktM2NhY2RmOWEtNjg5Ni0xMWU3LTg1NGUtNGM3OWE3NzJhMzBmLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3d3dy5jb2luc3BvdC5jb20uYXUvcHViYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cuY29pbnNwb3QuY29tLmF1L2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmNvaW5zcG90LmNvbS5hdScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5jb2luc3BvdC5jb20uYXUvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGF0ZXN0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9jb2luL2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L2NvaW4vc2VuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGUvYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZS9zZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9iYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9idXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L2J1eS9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L3NlbGwvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvQVVEJzogeyAnaWQnOiAnQlRDJywgJ3N5bWJvbCc6ICdCVEMvQVVEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0FVRCcgfSxcbiAgICAgICAgICAgICAgICAnTFRDL0FVRCc6IHsgJ2lkJzogJ0xUQycsICdzeW1ib2wnOiAnTFRDL0FVRCcsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdBVUQnIH0sXG4gICAgICAgICAgICAgICAgJ0RPR0UvQVVEJzogeyAnaWQnOiAnRE9HRScsICdzeW1ib2wnOiAnRE9HRS9BVUQnLCAnYmFzZSc6ICdET0dFJywgJ3F1b3RlJzogJ0FVRCcgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE15QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgaWYgKCdiYWxhbmNlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzKTtcbiAgICAgICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VzW2N1cnJlbmN5XSxcbiAgICAgICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VzW2N1cnJlbmN5XSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGlmICh1cHBlcmNhc2UgPT09ICdEUksnKVxuICAgICAgICAgICAgICAgICAgICB1cHBlcmNhc2UgPSAnREFTSCc7XG4gICAgICAgICAgICAgICAgcmVzdWx0W3VwcGVyY2FzZV0gPSBhY2NvdW50O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCB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kpXG4gICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgcmVxdWlyZXMgYXBpS2V5IGZvciBhbGwgcmVxdWVzdHMnKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXSArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAodGhpcy5leHRlbmQgKHsgJ25vbmNlJzogbm9uY2UgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG59O1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG4vLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuY29uc3QgaHVvYmlwcm8gPSByZXF1aXJlICgnLi9odW9iaXByby5qcycpO1xuY29uc3QgeyBFeGNoYW5nZUVycm9yLCBFeG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c4ZWM1YmQyNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkuY29pbnRpZ2VyLmNvbS9leGNoYW5nZS90cmFkaW5nL2FwaS9tYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5jb2ludGlnZXIuY29tL2V4Y2hhbmdlL3RyYWRpbmcvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlJzogJ2h0dHBzOi8vd3d3LmNvaW50aWdlci5jb20vZXhjaGFuZ2UnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5jb2ludGlnZXIuY29tL2V4Y2hhbmdlL3JlZ2lzdGVyLmh0bWw/cmVmQ29kZT1GZnZEdHQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2NvaW50aWdlci9hcGktZG9jcy1lbi93aWtpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS9rbGluZScsIC8vIOiOt+WPlkvnur/mlbDmja5cbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXRhaWwvbWVyZ2VkJywgLy8g6I635Y+W6IGa5ZCI6KGM5oOFKFRpY2tlcilcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsIC8vIOiOt+WPliBNYXJrZXQgRGVwdGgg5pWw5o2uXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLCAvLyDojrflj5YgVHJhZGUgRGV0YWlsIOaVsOaNrlxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnkvdHJhZGUnLCAvLyDmibnph4/ojrflj5bmnIDov5HnmoTkuqTmmJPorrDlvZVcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXRhaWwnLCAvLyDojrflj5YgTWFya2V0IERldGFpbCAyNOWwj+aXtuaIkOS6pOmHj+aVsOaNrlxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2V4Y2hhbmdlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Zvb3Rlci90cmFkaW5ncnVsZS5odG1sJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcGkvcHVibGljL21hcmtldC9kZXRhaWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcxJzogSW5zdWZmaWNpZW50RnVuZHMsXG4gICAgICAgICAgICAgICAgJzInOiBFeGNoYW5nZUVycm9yLFxuICAgICAgICAgICAgICAgICc1JzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICcxNic6IEF1dGhlbnRpY2F0aW9uRXJyb3IsIC8vIGZ1bmRpbmcgcGFzc3dvcmQgbm90IHNldFxuICAgICAgICAgICAgICAgICcxMDAwMDEnOiBFeGNoYW5nZUVycm9yLFxuICAgICAgICAgICAgICAgICcxMDAwMDInOiBFeGNoYW5nZU5vdEF2YWlsYWJsZSxcbiAgICAgICAgICAgICAgICAnMTAwMDAzJzogRXhjaGFuZ2VFcnJvcixcbiAgICAgICAgICAgICAgICAnMTAwMDA1JzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIHRoaXMucGFyc2VKc29uUmVzcG9uc2UgPSBmYWxzZTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5leGNoYW5nZUdldEZvb3RlclRyYWRpbmdydWxlSHRtbCAoKTtcbiAgICAgICAgdGhpcy5wYXJzZUpzb25SZXNwb25zZSA9IHRydWU7XG4gICAgICAgIGxldCByb3dzID0gcmVzcG9uc2Uuc3BsaXQgKCc8dHI+Jyk7XG4gICAgICAgIGxldCBudW1Sb3dzID0gcm93cy5sZW5ndGg7XG4gICAgICAgIGxldCBsaW1pdCA9IG51bVJvd3MgLSAxO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAxOyBpIDwgbGltaXQ7IGkrKykge1xuICAgICAgICAgICAgbGV0IHJvdyA9IHJvd3NbaV07XG4gICAgICAgICAgICBsZXQgcGFydHMgPSByb3cuc3BsaXQgKCc8c3BhbiBzdHlsZT1cImNvbG9yOiNmZmZmZmZcIj4nKTtcbiAgICAgICAgICAgIGxldCBudW1QYXJ0cyA9IHBhcnRzLmxlbmd0aDtcbiAgICAgICAgICAgIGlmICgobnVtUGFydHMgPCA2KSB8fCAocGFydHNbMV0uaW5kZXhPZiAoJ0tpbmQmbmJzcCcpID49IDApKVxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgbGV0IGlkID0gcGFydHNbMV0uc3BsaXQgKCc8L3NwYW4+JylbMF07XG4gICAgICAgICAgICBsZXQgbWluQW1vdW50ID0gcGFydHNbMl0uc3BsaXQgKCc8L3NwYW4+JylbMF07XG4gICAgICAgICAgICBsZXQgbWluUHJpY2UgPSBwYXJ0c1s0XS5zcGxpdCAoJzwvc3Bhbj4nKVswXTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWluQW1vdW50KSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1pblByaWNlKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZCA9IGlkLnNwbGl0ICgnJm5ic3AnKVswXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgYmFzZUlkID0gYmFzZUlkLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgcXVvdGVJZCA9IHF1b3RlSWQudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBpZCA9IGJhc2VJZCArIHF1b3RlSWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAndXBwZXJjYXNlSWQnOiBpZC50b1VwcGVyQ2FzZSAoKSxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogcGFyc2VGbG9hdCAobWluQW1vdW50KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChtaW5QcmljZSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5vcHRpb25zWydtYXJrZXRzQnlVcHBlcmNhc2VJZCddID0gdGhpcy5pbmRleEJ5IChyZXN1bHQsICd1cHBlcmNhc2VJZCcpO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMuc2FmZUludGVnZXIgKHRpY2tlciwgJ2lkJyk7XG4gICAgICAgIGxldCBjbG9zZSA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0Jyk7XG4gICAgICAgIGxldCBwZXJjZW50YWdlID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3BlcmNlbnRDaGFuZ2UnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaDI0aHInKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbG93MjRocicpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdoaWdoZXN0QmlkJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzog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cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAocmVzcG9uc2VbaWRdLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICAvL1xuICAgICAgICAvLyAgICAge1xuICAgICAgICAvLyAgICAgICAgIFwidm9sdW1lXCI6IHtcbiAgICAgICAgLy8gICAgICAgICAgICAgXCJhbW91bnRcIjogXCIxLjAwMFwiLFxuICAgICAgICAvLyAgICAgICAgICAgICBcImljb25cIjogXCJcIixcbiAgICAgICAgLy8gICAgICAgICAgICAgXCJ0aXRsZVwiOiBcIuaIkOS6pOmHj1wiXG4gICAgICAgIC8vICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgIC8vICAgICAgICAgXCJwcmljZVwiOiB7XG4gICAgICAgIC8vICAgICAgICAgICAgIFwiYW1vdW50XCI6IFwiMC4wNDk3ODg4M1wiLFxuICAgICAgICAvLyAgICAgICAgICAgICBcImljb25cIjogXCJcIixcbiAgICAgICAgLy8gICAgICAgICAgICAgXCJ0aXRsZVwiOiBcIuWnlOaJmOS7t+agvFwiXG4gICAgICAgIC8vICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgLy8gICAgICAgICBcImNyZWF0ZWRfYXRcIjogMTUxMzI0NTEzNDAwMCxcbiAgICAgICAgLy8gICAgICAgICBcImRlYWxfcHJpY2VcIjoge1xuICAgICAgICAvLyAgICAgICAgICAgICBcImFtb3VudFwiOiAwLjA0OTc4ODgzMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwLFxuICAgICAgICAvLyAgICAgICAgICAgICBcImljb25cIjogXCJcIixcbiAgICAgICAgLy8gICAgICAgICAgICAgXCJ0aXRsZVwiOiBcIuaIkOS6pOS7t+agvFwiXG4gICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAvLyAgICAgICAgIFwiaWRcIjogMTM4XG4gICAgICAgIC8vICAgICB9XG4gICAgICAgIC8vXG4gICAgICAgIGxldCBzaWRlID0gdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ3NpZGUnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHByaWNlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBzaWRlICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgc2lkZSA9IHNpZGUudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBwcmljZSA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3ByaWNlJyk7XG4gICAgICAgICAgICBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdhbW91bnQnKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlWydwcmljZSddLCAnYW1vdW50Jyk7XG4gICAgICAgICAgICBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGVbJ3ZvbHVtZSddLCAnYW1vdW50Jyk7XG4gICAgICAgICAgICBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlWydkZWFsX3ByaWNlJ10sICdhbW91bnQnKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGFtb3VudCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBpZiAodHlwZW9mIHByaWNlICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBjb3N0ID0gYW1vdW50ICogcHJpY2U7XG4gICAgIC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yZXNwb25zZVsnZGF0YSddWydrbGluZV9kYXRhJ10sIG1hcmtldCwgdGltZWZyYW1lLCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0VXNlckJhbGFuY2UgKHBhcmFtcyk7XG4gICAgICAgIC8vXG4gICAgICAgIC8vICAgICB7XG4gICAgICAgIC8vICAgICAgICAgXCJjb2RlXCI6IFwiMFwiLFxuICAgICAgICAvLyAgICAgICAgIFwibXNnXCI6IFwic3VjXCIsXG4gICAgICAgIC8vICAgICAgICAgXCJkYXRhXCI6IFt7XG4gICAgICAgIC8vICAgICAgICAgICAgIFwibm9ybWFsXCI6IFwiMTgxMy4wMTE0NDE3OVwiLFxuICAgICAgICAvLyAgICAgICAgICAgICBcImxvY2tcIjogXCIxMzI1LjQyMDM2Nzg1XCIsXG4gICAgICAgIC8vICAgICAgICAgICAgIFwiY29pblwiOiBcImJ0Y1wiXG4gICAgICAgIC8vICAgICAgICAgfSwge1xuICAgICAgICAvLyAgICAgICAgICAgICBcIm5vcm1hbFwiOiBcIjk1NTEuOTY2OTIyNDRcIixcbiAgICAgICAgLy8gICAgICAgICAgICAgXCJsb2NrXCI6IFwiNTQ3LjA2NTA2NzE3XCIsXG4gICAgICAgIC8vICAgICAgICAgICAgIFwiY29pblwiOiBcImV0aFwiXG4gICAgICAgIC8vICAgICAgICAgfV1cbiAgICAgICAgLy8gICAgIH1cbiAgICAgICAgLy9cbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY2V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nb3Blbic7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGlmICghdGhpcy5wYXNzd29yZClcbiAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yICh0aGlzLmlkICsgJyBjcmVhdGVPcmRlciByZXF1aXJlcyBleGNoYW5nZS5wYXNzd29yZCB0byBiZSBzZXQgdG8gdXNlciB0cmFkaW5nIHBhc3N3b3JkIChub3QgbG9naW4gcGFzc3dvcmQhKScpO1xuICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXJUeXBlID0gKHR5cGUgPT09ICdsaW1pdCcpID8gMSA6IDI7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyVHlwZSxcbiAgICAgICAgICAgICd2b2x1bWUnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAnY2FwaXRhbF9wYXNzd29yZCc6IHRoaXMucGFzc3dvcmQsXG4gICAgICAgIH07XG4gICAgICAgIGlmICgodHlwZSA9PT0gJ21hcmtldCcpICYmIChzaWRlID09PSAnYnV5JykpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgcHJpY2UgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgY3JlYXRlT3JkZXIgcmVxdWlyZXMgcHJpY2UgYXJndW1lbnQgZm9yIG1hcmtldCBidXkgb3JkZXJzIHRvIGNhbGN1bGF0ZSB0b3RhbCBjb3N0IGFjY29yZGluZyB0byBleGNoYW5nZSBydWxlcycpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgb3JkZXJbJ3ZvbHVtZSddID0gdGhpcy5hbW91bnRUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQgKiBwcmljZSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGUgPT09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlciAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgLy9cbiAgICAgICAgLy8gICAgIHtcIm9yZGVyX2lkXCI6MzQzNDN9XG4gICAgICAgIC8vXG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnb3JkZXJfaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjb3N0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdm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mtleXNvcnQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3RpbWUnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gJyc7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGtleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBhdXRoICs9IGtleXNbaV0gKyBxdWVyeVtrZXlzW2ldXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGF1dGggKz0gdGhpcy5zZWNyZXQ7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKTtcbiAgICAgICAgICAgIGxldCBpc0NyZWF0ZU9yZGVyTWV0aG9kID0gKHBhdGggPT09ICdvcmRlcicpICYmIChtZXRob2QgPT09ICdQT1NUJyk7XG4gICAgICAgICAgICBsZXQgdXJsUGFyYW1zID0gaXNDcmVhdGVPcmRlck1ldGhvZCA/IHt9IDogcXVlcnk7XG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHRoaXMua2V5c29ydCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYXBpX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICd0aW1lJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgfSwgdXJsUGFyYW1zKSkpO1xuICAgICAgICAgICAgdXJsICs9ICcmc2lnbj0nICsgdGhpcy5kZWNvZGUgKHNpZ25hdHVyZSk7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2FwaV9rZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGh0dHBDb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmICh0eXBlb2YgYm9keSAhPT0gJ3N0cmluZycpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoYm9keS5sZW5ndGggPCAyKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKChib2R5WzBdID09PSAneycpIHx8IChib2R5WzBdID09PSAnWycpKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmICgnY29kZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIC8vICAgICB7XCJjb2RlXCI6XCIxMDAwMDVcIixcIm1zZ1wiOlwicmVxdWVzdCBzaWduIGlsbGVnYWxcIixcImRhdGFcIjpudWxsfVxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnY29kZScpO1xuICAgICAgICAgICAgICAgIGlmICgodHlwZW9mIGNvZGUgIT09ICd1bmRlZmluZWQnKSAmJiAoY29kZSAhPT0gJzAnKSkge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBtZXNzYWdlID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ21zZycpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBmZWVkYmFjayA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZXhjZXB0aW9ucyA9IHRoaXMuZXhjZXB0aW9ucztcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGUgaW4gZXhjZXB0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGUgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSA9PT0gJ29mZnNldE5vdCBOdWxsJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ1BhcmFtZXRlciBlcnJvcicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgZXhjZXB0aW9uc1tjb2RlXSAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIHVua25vd24gXCJlcnJvclwiIHZhbHVlOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufTtcblxuIiwiJ3VzZSBzdHJpY3QnO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbmNvbnN0IGNvaW5lZ2cgPSByZXF1aXJlICgnLi9jb2luZWdnLmpzJyk7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBjb29sY29pbiBleHRlbmRzIGNvaW5lZ2cge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdjb29sY29pbicsXG4gICAgICAgICAgICAnbmFtZSc6ICdDb29sQ29pbicsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0hLJyxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzY3NzA1MjktYmU3YjFhMDQtMWM1Yi0xMWU4LTk2MDAtZDExZjE5OTZiNTM5LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL3d3dy5jb29sY29pbi5jb20vY29pbicsXG4gICAgICAgICAgICAgICAgICAgICdyZXN0JzogJ2h0dHBzOi8vd3d3LmNvb2xjb2luLmNvbS9hcGkvdjEnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5jb29sY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuY29vbGNvaW4uY29tL2hlbHAuYXBpLmh0bWwnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vd3d3LmNvb2xjb2luLmNvbS9zcGVuZC5wcmljZS5odG1sJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUQkMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTREMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRNJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FDVCc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FLJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQ1MnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hDQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lGQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFZJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQR0MnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tUQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5UJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMU0snOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0tUJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTU1MnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgIC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93d3cuY3J5cHRvcGlhLmNvLm56L0ZvcnVtL0NhdGVnb3J5LzQ1JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmNyeXB0b3BpYS5jby5uei9Gb3J1bS9UaHJlYWQvMjU1JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmNyeXB0b3BpYS5jby5uei9Gb3J1bS9UaHJlYWQvMjU2JyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRDdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZVBhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldHMve2hvdXJzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0cy97aWR9L3tob3Vyc30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXQve2lkfS97aG91cnN9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRIaXN0b3J5L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldEhpc3Rvcnkve2lkfS97aG91cnN9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRPcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0T3JkZXJzL3tpZH0ve2NvdW50fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0T3JkZXJHcm91cHMve2lkc30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldE9yZGVyR3JvdXBzL3tpZHN9L3tjb3VudH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbFRyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRCYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1N1Ym1pdFRpcCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3VibWl0VHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1N1Ym1pdFRyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTdWJtaXRXaXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnQUNDJzogJ0FkQ29pbicsXG4gICAgICAgICAgICAgICAgJ0JBVCc6ICdCYXRDb2luJyxcbiAgICAgICAgICAgICAgICAnQkxaJzogJ0JsYXplQ29pbicsXG4gICAgICAgICAgICAgICAgJ0JURyc6ICdCaXRnZW0nLFxuICAgICAgICAgICAgICAgICdDQyc6ICdDQ1gnLFxuICAgICAgICAgICAgICAgICdDTVQnOiAnQ29tZXQnLFxuICAgICAgICAgICAgICAgICdGQ04nOiAnRmFjaWxlY29pbicsXG4gICAgICAgICAgICAgICAgJ0ZVRUwnOiAnRkMyJywgLy8gRnVlbENvaW4gIT0gRlVFTFxuICAgICAgICAgICAgICAgICdIQVYnOiAnSGF2ZWNvaW4nLFxuICAgICAgICAgICAgICAgICdMREMnOiAnTEFEQUNvaW4nLFxuICAgICAgICAgICAgICAgICdNQVJLUyc6ICdCaXRtYXJrJyxcbiAgICAgICAgICAgICAgICAnTkVUJzogJ05ldENvaW4nLFxuICAgICAgICAgICAgICAgICdRQlQnOiAnQ3ViaXRzJyxcbiAgICAgICAgICAgICAgICAnV1JDJzogJ1dhckNvaW4nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdvcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnNFcnJvcnMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRHZXRUcmFkZVBhaXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ0RhdGEnXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnSWQnXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ0xhYmVsJ107XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydTeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gbWFya2V0WydCYXNlU3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBtYXJrZXRbJ01pbmltdW1UcmFkZSddO1xuICAgICAgICAgICAgbGV0IHByaWNlTGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ01pbmltdW1QcmljZSddLFxuICAgICAgICAgICAgICAgICdtYXgnOiBtYXJrZXRbJ01heGltdW1QcmljZSddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhbW91bnRMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydNYXhpbXVtVHJhZGUnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnRMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ01pbmltdW1CYXNlVHJhZGUnXSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSBtYXJrZXRbJ1N0YXR1cyddID09PSAnT0snO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdsYWJlbCc6IG1hcmtldFsnTGFiZWwnXSxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogbWFya2V0WydUcmFkZUZlZSddIC8gMTAwLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IG1hcmtldFsnVHJhZGVGZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAnbG90JzogbGltaXRzWydhbW91bnQnXVsnbWluJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLm9wdGlvbnNbJ21hcmtldHNCeUxhYmVsJ10gPSB0aGlzLmluZGV4QnkgKHJlc3VsdCwgJ2xhYmVsJyk7XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxld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gICAgaWYgKGJhc2VWb2x1bWUgPiAwKVxuICAgICAgICAgICAgICAgICAgICB2d2FwID0gcXVvdGVWb2x1bWUgLyBiYXNlVm9sdW1lO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnTG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0JpZFByaWNlJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdBc2tQcmljZScpLFxuICAgICAgICAgICAgJ2Fza1ZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdndhcCxcbiAgICAgICAgICAgICdvcGVuJzogb3BlbixcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiBjaGFuZ2UsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdDaGFuZ2UnKSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdGhpcy5zdW0gKGxhc3QsIG9wZW4pIC8gMixcbiAgICAgICAgICAgICdiYXNlV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mVGbG9hdCAodHJhZGUsICdQcmljZScpO1xuICAgICAgICBpZiAoIXByaWNlKVxuICAgICAgICAgICAgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdSYXRlJyk7XG4gICAgICAgIGxldCBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnVG90YWwnKTtcbiAgICAgICAgbGV0IGlkID0gdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ1RyYWRlSWQnKTtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGlmICgnVHJhZGVQYWlySWQnIGluIHRyYWRlKVxuICAgICAgICAgICAgICAgIGlmICh0cmFkZVsnVHJhZGVQYWlySWQnXSBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFt0cmFkZVsnVHJhZGVQYWlySWQnXV07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGZlZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGlmICgnRmVlJyBpbiB0cmFkZSkge1xuICAgICAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHRyYWRlWydGZWUnXSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0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bHNlO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ05hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5WydXaXRoZHJhd0ZlZSddLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnTWluQmFzZVRyYWRlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ01pbldpdGhkcmF3J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogY3VycmVuY3lbJ01heFdpdGhkcmF3J10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRCYWxhbmNlIChwYXJhbXMpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnRGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmFsYW5jZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaV07XG4gICAgICAgICAgICBsZXQgY29kZSA9IGJhbGFuY2VbJ1N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGNvZGUpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydBdmFpbGFibGUnXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWydUb3RhbCddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gL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1Ym1pdFRyYWRlICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGlmICghcmVzcG9uc2UpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgY3JlYXRlT3JkZXIgcmV0dXJuZWQgdW5rbm93biBlcnJvcjogJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgbGV0IGlkID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgZmlsbGVkID0gMC4wO1xuICAgICAgICBsZXQgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICBpZiAoJ0RhdGEnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBpZiAoJ09yZGVySWQnIGluIHJlc3BvbnNlWydEYXRhJ10pIHtcbiAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2VbJ0RhdGEnXVsnT3JkZXJJZCddKSB7XG4gICAgICAgICAgICAgICAgICAgIGlkID0gcmVzcG9uc2VbJ0RhdGEnXVsnT3JkZXJJZCddLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IGFtb3VudDtcbiAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IHByaWNlICogYW1vdW50LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiBhbW91bnQgLSBmaWxsZWQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIC8vICd0cmFkZXMnOiB0aGlzLnBhcnNlVHJhZGVzIChvcmRlclsndHJhZGVzJ10sIG1hcmtldCksXG4gICAgICAgIH07XG4gICAgICAgIGlmIChpZClcbiAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IG9yZGVyO1xuICAgICAgICByZXR1cm4gdGhpcy5leHRlbmQgKHsgJ2luZm8nOiByZXNwb25zZSB9LCBvcmRlcik7XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbFRyYWRlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdUeXBlJzogJ1RyYWRlJyxcbiAgICAgICAgICAgICAgICAnT3JkZXJJZCc6IGlkLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5vcmRlcnMpXG4gICAgICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdWydzdGF0dXMnXSA9ICdjYW5jZWxlZCc7XG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLmxhc3RfanNvbl9yZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gdGhpcy5zYWZlU3RyaW5nICh0aGlzLmxhc3RfanNvbl9yZXNwb25zZSwgJ0Vycm9yJyk7XG4gICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ2RvZXMgbm90IGV4aXN0JykgPj0gMClcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyBjYW5jZWxPcmRlcigpIGVycm9yOiAnICsgdGhpcy5sYXN0X2h0dHBfcmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IGU7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgfSBlbHNlIGlmICgnTWFya2V0JyBpbiBvcmRlcikge1xuICAgICAgICAgICAgbGV0IGlkID0gb3JkZXJbJ01hcmtldCddO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMub3B0aW9uc1snbWFya2V0c0J5TGFiZWwnXSkge1xuICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm9wdGlvbnNbJ21hcmtldHNCeUxhYmVsJ11baWRdO1xuICAgICAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKG9yZGVyWydUaW1lU3RhbXAnXSk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdBbW91bnQnKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ1JlbWFpbmluZycpO1xuICAgICAgICBsZXQgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ09yZGVySWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdGhpcy5vbWl0IChvcmRlciwgJ3N0YXR1cycpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogb3JkZXJbJ3N0YXR1cyddLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ1R5cGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ1JhdGUnKSxcbiAgICAgICAgICAgICdjb3N0JzogdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnVG90YWwnKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAvLyAndHJhZGVzJzogdGhpcy5wYXJzZVRyYWRlcyAob3JkZXJbJ3RyYWRlcyddLCBtYXJrZXQpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJzIChzeW1ib2wgPSB1bmRlZmluZWQsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAvLyAnTWFya2V0JzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgLy8gJ1RyYWRlUGFpcklkJzogbWFya2V0WydpZCddLCAvLyBDcnlwdG9waWEgaWRlbnRpZmllciAobm90IHJlcXVpcmVkIGlmICdNYXJrZXQnIHN1cHBsaWVkKVxuICAgICAgICAgICAgLy8gJ0NvdW50JzogMTAwLCAvLyBkZWZhdWx0ID0gMTAwXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlb2Ygc3ltYm9sICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgbWFya2V0ID0gdG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NJbmRleGVkQnlJZCkge1xuICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHRoaXMuZXh0ZW5kICh0aGlzLm9yZGVyc1tpZF0sIG9wZW5PcmRlcnNJbmRleGVkQnlJZFtpZF0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgb3JkZXIgPSB0aGlzLm9yZGVyc1tpZF07XG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydzdGF0dXMnXSA9PT0gJ29wZW4nKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgodHlwZW9mIHN5bWJvbCA9PT0gJ3VuZGVmaW5lZCcpIHx8IChvcmRlclsnc3ltYm9sJ10gPT09IHN5bWJvbCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnY2xvc2VkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnY29zdCc6IG9yZGVyWydhbW91bnQnXSAqIG9yZGVyWydwcmljZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdmaWxsZWQnOiBvcmRlclsnYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3JlbWFpbmluZyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRlcnNbaWRdO1xuICAgICAgICAgICAgaWYgKCh0eXBlb2Ygc3ltYm9sID09PSAndW5kZWZpbmVkJykgfHwgKG9yZGVyWydzeW1ib2wnXSA9PT0gc3ltYm9sKSlcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAob3JkZXIpO1xuICAgICAgICB9XG4gICAgICA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LS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgZHN4IGV4dGVuZHMgbGlxdWkge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdkc3gnLFxuICAgICAgICAgICAgJ25hbWUnOiAnRFNYJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnVUsnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk5MDI3NS0xNDEzMTU4YS02NDVhLTExZTctOTMxYy05NDcxN2Y3NTEwZTMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vZHN4LnVrL21hcGknLCAvLyBtYXJrZXQgZGF0YVxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2RzeC51ay90YXBpJywgLy8gdHJhZGluZ1xuICAgICAgICAgICAgICAgICAgICAnZHdhcGknOiAnaHR0cHM6Ly9kc3gudWsvZHdhcGknLCAvLyBkZXBvc2l0L3dpdGhkcmF3XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vZHN4LnVrJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkuZHN4LnVrJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZHN4LnVrL2FwaV9kb2NzL3B1YmxpYycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2RzeC51ay9hcGlfZG9jcy9wcml2YXRlJyxcbiAgICAgICAgICAgICAgICAgICAgJycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgIC8vIG1hcmtldCBkYXRhIChwdWJsaWMpXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYXJzRnJvbU1vbWVudC97aWR9L3twZXJpb2R9L3tzdGFydH0nLCAvLyBlbXB0eSByZXBseSA6XFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhc3RCYXJzL3tpZH0ve3BlcmlvZH0ve2Ftb3VudH0nLCAvLyBwZXJpb2QgaXMgKG0sIGggb3IgZClcbiAgICAgICAgICAgICAgICAgICAgICAgICdwZXJpb2RCYXJzL3tpZH0ve3BlcmlvZH0ve3N0YXJ0fS97ZW5kfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAvLyB0cmFkaW5nIChwcml2YXRlKVxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFuc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY3RpdmVPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAvLyBkZXBvc2l0IC8gd2l0aGRyYXcgKHByaXZhdGUpXG4gICAgICAgICAgICAgICAgJ2R3YXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRDcnlwdG9EZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3J5cHRvV2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpYXRXaXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VHJhbnNhY3Rpb25TdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1x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ZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbCcpLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbF9jdXInKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGdldE9yZGVySWRLZXkgKCkge1xuICAgICAgICByZXR1cm4gJ29yZGVySWQnO1xuIC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C8vIG5ldyBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdkZXBvc2l0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hGZWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hGdW5kaW5nRmVlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVHJhZGluZ0ZlZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnM2gnOiAnM2gnLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aCcsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmgnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxRCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzdEJyxcbiAgICAgICAgICAgICAgICAnMncnOiAnMTREJyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzc1NTU1MjYtNzAxOGE3N2MtMjlmOS0xMWU4LTg4MzUtOGU0MTVjMDM4YTE4LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5ldGhmaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuZXRoZmluZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRmaW5leC5yZWFkbWUuaW8vdjEvZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYml0ZmluZXhjb20vYml0ZmluZXgtYXBpLW5vZGUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuZXRoZmluZXguY29tL2FwaV9kb2NzJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuLy8gIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5jb25zdCBFeGNoYW5nZSA9IHJlcXVpcmUgKCcuL2Jhc2UvRXhjaGFuZ2UnKTtcbmNvbnN0IHsgRXh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zJzogJ2VtdWxhdGVkJyxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlclRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJCb29rcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQ5MS0xYjBlYTk1Ni01ZWRhLTExZTctOTIyNS00MGQ2N2I0ODFiOGQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmV4bW8uY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vZXhtby5tZS8/cmVmPTEzMTY4NScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZXhtby5tZS9lbi9hcGlfZG9jP3JlZj0xMzE2ODUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL2V4bW8tZGV2L2V4bW9fYXBpX2xpYi90cmVlL21hc3Rlci9ub2RlanMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9leG1vLmNvbS9lbi9kb2NzL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcl9zZXR0aW5ncycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfY3JlYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX2NhbmNlbGxlZF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVxdWlyZWRfYW1vdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2NyeXB0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19nZXRfdHhpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjb2RlX2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjb2RlX2xvYWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldF9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dBVkVTJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDI1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogMzUwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogNTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICA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zc2libGUgbWluaW11bSBmb3IgdGhpcyBwYWlyXG4gICAgICAgICAgICAgICAgJzUwMzIxJzogSW52YWxpZE9yZGVyLCAvLyBQcmljZSBieSBvcmRlciBpcyBtb3JlIHRoYW4gcGVybWlzc2libGUgbWF4aW11bSBmb3IgdGhpcyBwYWlyXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0UGFpclNldHRpbmdzICgpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNbcF07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQucmVwbGFjZSAoJ18nLCAnLycpO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluX3F1YW50aXR5JyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heF9xdWFudGl0eScpLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbl9wcmljZScpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYXhfcHJpY2UnKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbl9hbW91bnQnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4X2Ftb3VudCcpLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VXNlckluZm8gKCk7XG4gICAgICAgIGxldC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RmxvYXQgKHRpY2tlciwgJ3ZvbCcpLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbF9jdXJyJyksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlcnMgKHN5bWJvbHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAocmVzcG9uc2UpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVtpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyIChwYXJhbXMpO1xuICAgICAgICBsZXQgbWFya2V0ID0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4nKSB7XG4gICAgICAgICAgICAgICAgICAgIG9yZGVyID0gdGhpcy5leHRlbmQgKG9yZGVyLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ2Nsb3NlZCcsIC8vIGxpa2V3aXNlIGl0IG1pZ2h0IGhhdmUgYmVlbiBjYW5jZWxlZCBleHRlcm5hbGx5ICh1bm5vdGljZWQgYnkgXCJ1c1wiKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlsbGVkJzogb3JkZXJbJ2Ftb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlbWFpbmluZyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3JkZXJbJ2Nvc3QnXSA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3JkZXJbJ2ZpbGxlZCddICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcmRlclsnY29zdCddID0gb3JkZXJbJ2ZpbGxlZCddICogb3JkZXJbJ3ByaWNlJ107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gb3JkZXI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnRvQXJyYXkgKHRoaXMub3JkZXJzKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVycyAoc3ltYm9sID0gdW5kZWZpbmVkLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG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Q7XG4gICAgICAgIGxldCBzaWRlID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ3R5cGUnKTtcbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0SWQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoJ3BhaXInIGluIG9yZGVyKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0SWQgPSBvcmRlclsncGFpciddO1xuICAgICAgICAgICAgfSBlbHNlIGlmICgoJ2luX2N1cnJlbmN5JyBpbiBvcmRlcikgJiYgKCdvdXRfY3VycmVuY3knIGluIG9yZGVyKSkge1xuICAgICAgICAgICAgICAgIGlmIChzaWRlID09PSAnYnV5JylcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0SWQgPSBvcmRlclsnaW5fY3VycmVuY3knXSArICdfJyArIG9yZGVyWydvdXRfY3VycmVuY3knXTtcbiAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgIG1hcmtldElkID0gb3JkZXJbJ291dF9jdXJyZW5jeSddICsgJ18nICsgb3JkZXJbJ2luX2N1cnJlbmN5J107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoKHR5cGVvZiBtYXJrZXRJZCAhPT0gJ3VuZGVmaW5lZCcpICYmIChtYXJrZXRJZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpKVxuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFttYXJrZXRJZF07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3F1YW50aXR5Jyk7XG4gICAgICAgIGlmICh0eXBlb2YgYW1vdW50ID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgbGV0IGFtb3VudEZpZWxkID0gKHNpZGUgPT09ICdidXknKSA/ICdpbl9hbW91bnQnIDogJ291dF9hbW91bnQnO1xuICAgICAgICAgICAgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCBhbW91bnRGaWVsZCk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IGNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdhbW91bnQnKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IDAuMDtcbiAgICAgICAgbGV0IHRyYWRlcyA9IFtdO1xuICAgICAgICBsZXQgdHJhbnNhY3Rpb25zID0gdGhpcy5zYWZlVmFsdWUgKG9yZGVyLCAndHJhZGVzJyk7XG4gICAgICAgIGxldCBmZWVDb3N0ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIHRyYW5zYWN0aW9ucyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5ICh0cmFuc2FjdGlvbnMpKSB7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0cmFuc2FjdGlvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRyYWRlID0gdGhpcy5wYXJzZVRyYWRlICh0cmFuc2FjdGlvbnNbaV0sIG1hcmtldCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgaWQgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgaWQgPSB0cmFkZVsnb3JkZXInXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB0aW1lc3RhbXAgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgdGltZXN0YW1wID0gdHJhZGVbJ3RpbWVzdGFtcCddO1xuICAgICAgICAgICAgICAgICAgICBpZiAodGltZXN0YW1wID4gdHJhZGVbJ3RpbWVzdGFtcCddKVxuICAgICAgICAgICAgICAgICAgICAgICAgdGltZXN0YW1wID0gdHJhZGVbJ3RpbWVzdGFtcCddO1xuICAgICAgICAgICAgICAgICAgICBmaWxsZWQgKz0gdHJhZGVbJ2Ftb3VudCddO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGZlZUNvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgZmVlQ29zdCA9IDAuMDtcbiAgICAgICAgICAgICAgICAgICAgLy8gZmVlQ29zdCArPSB0cmFkZVsnZmVlJ11bJ2Nvc3QnXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBjb3N0ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvc3QgPSAwLjA7XG4gICAgICAgICAgICAgICAgICAgIGNvc3QgKz0gdHJhZGVbJ2Nvc3QnXTtcbiAgICAgICAgICAgICAgICAgICAgdHJhZGVzLnB1c2ggKHRyYWRlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiB0aW1lc3RhbXAgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgaXNvODYwMSA9IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ3N0YXR1cycpOyAvLyBpbiBjYXNlIHdlIG5lZWQgdG8gcmVkZWZpbmUgaXQgZm9yIGNhbmNlbGVkIG9yZGVyc1xuICAgICAgICBpZiAoZmlsbGVkID49IGFtb3VudClcbiAgICAgICAgICAgIHN0YXR1cyA9ICdjbG9zZWQnO1xuICAgICAgICBlbHNlXG4gICAgICAgICAgICBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgIGlmICh0eXBlb2YgbWFya2V0ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMuZ2V0TWFya2V0RnJvbVRyYWRlcyAodHJhZGVzKTtcbiAgICAgICAgbGV0IGZlZUN1cnJlbmN5ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBmZWVDdXJyZW5jeSA9IG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGNvc3QgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHByaWNlICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBjb3N0ID0gcHJpY2UgKiBmaWxsZWQ7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIHByaWNlID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKGZpbGxlZCA+IDApXG4gICAgICAgICAgICAgICAgcHJpY2UgPSBjb3N0IC8gZmlsbGVkO1xuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB7XG4gICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAnY3VycmVuY3knOiBmZWVDdXJyZW5jeSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogaXNvODYwMSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBnZXRNYXJrZXRGcm9tVHJhZGVzICh0cmFkZXMpIHtcbiAgICAgICAgbGV0IHRyYWRlc0J5U3ltYm9sID0gdGhpcy5pbmRleEJ5ICh0cmFkZXMsICdwYWlyJyk7XG4gICAgICAgIGxldCBzeW1ib2xzID0gT2JqZWN0LmtleXMgKHRyYWRlc0J5U3ltYm9sKTtcbiAgICAgICAgbGV0IG51bVN5bWJvbHMgPSBzeW1ib2xzLmxlbmd0aDtcbiAgICAgICAgaWYgKG51bVN5bWJvbHMgPT09IDEpXG4gICAgICAgICAgICByZXR1cm4gdGhpcy5tYXJrZXRzW3N5bWJvbHNbMF1dO1xuICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgIH1cblxuICAgIGNhbGN1bGF0ZUZlZSAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlLCB0YWtlck9yTWFrZXIgPSAndGFrZXInLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgIGxldCByYXRlID0gbWFya2V0W3Rha2VyT3JNYWtlcl07XG4gICAgICAgIGxldCBjb3N0ID0gcGFyc2VGbG9hdCAodGhpcy5jb3N0VG9QcmVjaXNpb24gKHN5bWJvbCwgYW1vdW50ICogcmF0ZSkpO1xuICAgICAgICBsZXQga2V5ID0gJ3F1b3RlJztcbiAgICAgICAgaWYgKHNpZGUgPT09ICdzZWxsJykge1xuICAgICAgICAgICAgY29zdCAqPSBwcmljZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGtleSA9ICdiYXNlJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3R5cGUnOiB0YWtlck9yTWFrZXIsXG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRba2V5XSxcbiAgICAgICAgICAgICdyYXRlJzogcmF0ZSxcbiAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAodGhpcy5mZWVUb1ByZWNpc2lvbiAoc3ltYm9sLCBjb3N0KSksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgd2l0aGRyYXcgKGN1cnJlbmN5LCBhbW91bnQsIGFkZHJlc3MsIHRhZyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlb2YgdGFnICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHJlcXVlc3RbJ2ludm9pY2UnXSA9IHRhZztcbiAgICAgICAgbGV0IHJlc3VsdCA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RXaXRoZHJhd0NyeXB0ICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3VsdCxcbiAgICAgICAgICAgICdpZCc6IHJlc3VsdFsndGFza19pZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7ICdub25jZSc6IG5vbmNlIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdTaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGh0dHBDb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmICh0eXBlb2YgYm9keSAhPT0gJ3N0cmluZycpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoYm9keS5sZW5ndGggPCAyKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKChib2R5WzBdID09PSAneycpIHx8IChib2R5WzBdID09PSAnWycpKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmICgncmVzdWx0JyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgLy8gICAgIHtcInJlc3VsdFwiOmZhbHNlLFwiZXJyb3JcIjpcIkVycm9yIDUwMDUyOiBJbnN1ZmZpY2llbnQgZnVuZHNcIn1cbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIGxldCBzdWNjZXNzID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAncmVzdWx0JywgZmFsc2UpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygc3VjY2VzcyA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChzdWNjZXNzID09PSAndHJ1ZScpIHx8IChzdWNjZXNzID09PSAnMScpKVxuICAgICAgICAgICAgICAgICAgICAgICAgc3VjY2VzcyA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Y2Nlc3MgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFzdWNjZXNzKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBjb2RlID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBtZXNzYWdlID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ2Vycm9yJyk7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGVycm9yUGFydHMgPSBtZXNzYWdlLnNwbGl0ICgnOicpO1xuICAgICAgICAgICAgICAgICAgICBsZXQgbnVtUGFydHMgPSBlcnJvclBhcnRzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG51bVBhcnRzID4gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZXJyb3JTdWJQYXJ0cyA9IGVycm9yUGFydHNbMF0uc3BsaXQgKCcgJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbnVtU3ViUGFydHMgPSBlcnJvclN1YlBhcnRzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUgPSAobnVtU3ViUGFydHMgPiAxKSA/IGVycm9yU3ViUGFydHNbMV0gOiBlcnJvclN1YlBhcnRzWzBdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGZlZWRiYWNrID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBleGNlcHRpb25zID0gdGhpcy5leGNlcHRpb25zO1xuICAgICA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ICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zNzc3MDI5Mi1mYmY2MTNkMC0yZGU0LTExZTgtOWY3OS1mMmRjNDUxYjhjY2IuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmV4eC5jb20vZGF0YS92MScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vdHJhZGUuZXh4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5leHguY29tLycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5leHguY29tL2hlbHAvcmVzdEFwaScsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cuZXh4LmNvbS9oZWxwL3JhdGUnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEJhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0MnOiAwLjAwMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNEJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JPVCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDI1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRTJzogMy4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMC4wMTIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFBZJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lOSyc6IDIwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNPJzogMC42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01PTkEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FBU0gnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUNBU0gnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgdXBwZXIgPSBpZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSB1cHBlci5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IG1hcmtldFsnaXNPcGVuJ10gPT09IHRydWU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUludCAobWFya2V0WydhbW91bnRTY2FsZSddKSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwYXJzZUludCAobWFya2V0WydwcmljZVNjYWxlJ10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0aWNrZXJbJ2RhdGUnXSk7XG4gICAgICAgIHRpY2tlciA9IHRpY2tlclsndGlja2VyJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAncmlzZVJhdGUnKSxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2wnKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2V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vbiAoc3ltYm9sLCBwcmljZSAqIGFtb3VudCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0aWQnKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdHJhZGVzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkZXMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAodHJhZGVzLCBtYXJrZXQsIHNpbmNlLCBsaW1pdCk7XG4gICAgfVxuXG4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sncXVvdGUnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdpZCcpLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0T3JkZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAndHlwZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgaWQgPSByZXNwb25zZVsnaWQnXTtcbiAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5wYXJzZU9yZGVyICh7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICd0cmFkZV9kYXRlJzogdGhpcy5taWxsaXNlY29uZHMgKCksXG4gICAgICAgICAgICAndG90YWxfYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAndHlwZSc6IHNpZGUsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9LCBtYXJrZXQpO1xuICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSBvcmRlcjtcbiAgICAgICAgcmV0dXJuIG9yZGVyO1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRDYW5jZWwgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4g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cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBmbG93YnRjIGV4dGVuZHMgRXhjaGFuZ2Uge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdmbG93YnRjJyxcbiAgICAgICAgICAgICduYW1lJzogJ2Zsb3dCVEMnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdCUicsIC8vIEJyYXppbFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4MTYyNDY1LWNkODE1ZDRjLTY3Y2YtMTFlNy04ZTU3LTQzOGJlYTA1MjNhMi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuZmxvd2J0Yy5jb206ODQwNS9hamF4JyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vdHJhZGVyLmZsb3didGMuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHA6Ly93d3cuZmxvd2J0Yy5jb20uYnIvYXBpLycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVzQnlEYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFByb2R1Y3RQYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0UHJvZHVjdHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0NyZWF0ZUFjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFVzZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZXRVc2VySW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QWNjb3VudEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEFjY291bnRUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDcmVhdGVPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTW9kaWZ5T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxBbGxPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEFjY291bnRPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlckZlZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAzNSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDM1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY1Bvc3RHZXRQcm9kdWN0UGFpcnMgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3Byb2R1Y3RQYWlycyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ25hbWUnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0Wydwcm9kdWN0MUxhYmVsJ107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ3Byb2R1Y3QyTGFiZWwnXTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMuc2FmZUludGVnZXIgKG1hcmtldCwgJ3Byb2R1Y3QxRGVjaW1hbFBsYWNlcycpLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHRoaXMuc2FmZUludGVnZXIgKG1hcmtldCwgJ3Byb2R1Y3QyRGVjaW1hbFBsYWNlcycpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH07XG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clNpZGUnXSA9PT0gMCkgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydweCddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydxdHknXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNQb3N0R2V0VHJhZGVzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lucyc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdzdGFydEluZGV4JzogLTEsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2VbJ3RyYWRlcyddLCBtYXJrZXQsIHNpbmNlLCBsaW1pdCk7XG4gICAgfVxuX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02NDdmLTExZTctOTFlZS03OGNlZDg3NGRkMDkuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2ZveGJpdC5leGNoYW5nZScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JsaW5rdHJhZGUuY29tL2RvY3MnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tZW50JzogJ0JsaW5rdHJhZGUgQVBJJyxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3l9L3RpY2tlcicsICAgIC8vID9jcnlwdG9fY3VycmVuY3k9QlRDXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5fS9vcmRlcmJvb2snLCAvLyA/Y3J5cHRvX2N1cnJlbmN5PUJUQ1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeX0vdHJhZGVzJywgICAgLy8gP2NyeXB0b19jdXJyZW5jeT1CVEMmc2luY2U9PFRJTUVTVEFNUD4mbGltaXQ9PE5VTUJFUj5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdEJywgICAvLyBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0YnLCAgIC8vIGNhbmNlbCBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ1UyJywgIC8vIGJhbGFuY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICdVNCcsICAvLyBteSBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdVNicsICAvLyB3aXRoZHJhd1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1UxOCcsIC8vIGRlcG9zaXRcbiAgICAgICAgICAgICAgICAgICAgICAgICdVMjQnLCAvLyBjb25maXJtIHdpdGhkcmF3YWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVMjYnLCAvLyBsaXN0IHdpdGhkcmF3YWxzXG4gICAgICAgICAgICAgICAgICAgICAgICAnVTMwJywgLy8gbGlzdCBkZXBvc2l0c1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1UzNCcsIC8vIGxlZGdlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ1U3MCcsIC8vIGNhbmNlbCB3aXRoZHJhd2FsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1ZFRic6IHsgJ2lkJzogJ0JUQ1ZFRicsICdzeW1ib2wnOiAnQlRDL1ZFRicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdWRUYnLCAnYnJva2VySWQnOiAxLCAnYnJva2VyJzogJ1N1ckJpdGNvaW4nIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9WTkQnOiB7ICdpZCc6ICdCVENWTkQnLCAnc3ltYm9sJzogJ0JUQy9WTkQnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVk5EJywgJ2Jyb2tlcklkJzogMywgJ2Jyb2tlcic6ICdWQlRDJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvQlJMJzogeyAnaWQnOiAnQlRDQlJMJywgJ3N5bWJvbCc6ICd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NHZXRDdXJyZW5jeVRyYWRlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICdjcnlwdG9fY3VycmVuY3knOiBtYXJrZXRbJ2Jhc2UnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICh0eXBlID09PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXJTaWRlID0gKHNpZGUgPT09ICdidXknKSA/ICcxJyA6ICcyJztcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ0NsT3JkSUQnOiB0aGlzLm5vbmNlICgpLFxuICAgICAgICAgICAgJ1N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdTaWRlJzogb3JkZXJTaWRlLFxuICAgICAgICAgICAgJ09yZFR5cGUnOiAnMicsXG4gICAgICAgICAgICAnUHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdPcmRlclF0eSc6IGFtb3VudCxcbiAgICAgICAgICAgICdCcm9rZXJJRCc6IG1hcmtldFsnYnJva2VySWQnXSxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEQgKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBpbmRleGVkID0gdGhpcy5pbmRleEJ5IChyZXNwb25zZVsnUmVzcG9uc2VzJ10sICdNc2dUeXBlJyk7XG4gICAgICAgIGxldCBleGVjdXRpb24gPSBpbmRleGVkWyc4J107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogZXhlY3V0aW9uWydPcmRlcklEJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLnByaXZhdGVQb3N0RiAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdDbE9yZElEJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9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LmNvbS8xMjk0NDU0LzI3NzY2NTEyLTMxMDE5NzcyLTVlZGItMTFlNy04MjQxLTJlNjc1ZTY3OTdmMS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuZnlic2Uuc2UvYXBpL1NFSycsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5meWJzZS5zZScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwOi8vZG9jcy5meWIuYXBpYXJ5LmlvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJkZXRhaWxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rlc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGFjY2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBlbmRpbmdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG9yZGVyaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VscGVuZGluZ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZW9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1NFSyc6IHsgJ2lkJzogJ1NFSycsICdzeW1ib2wnOiAnQlRDL1NFSycsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdTRUsnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBiYWxhbmNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldGFjY2luZm8gKCk7XG4gICAgICAgIGxldCBidGMgPSBwYXJzZUZsb2F0IChiYWxhbmNlWydidGNCYWwnXSk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB0aGlzLnN5bWJvbHNbMF07XG4gICAgICAgIGxldCBxdW90ZSA9IHRoaXMubWFya2V0c1tzeW1ib2xdWydxdW90ZSddO1xuICAgICAgICBsZXQgbG93ZXJjYXNlID0gcXVvdGUudG9Mb3dlckNhc2UgKCkgKyAnQmFsJztcbiAgICAgICAgbGV0IGZpYXQgPSBwYXJzZUZsb2F0IChiYWxhbmNlW2xvd2VyY2FzZV0pO1xuICAgICAgICBsZXQgY3J5cHRvID0ge1xuICAgICAgICAgICAgJ2ZyZWUnOiBidGMsXG4gICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICd0b3RhbCc6IGJ0YyxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ0JUQyc6IGNyeXB0byB9O1xuICAgICAgICByZXN1bHRbcXVvdGVdID0ge1xuICAgICAgICAgICAgJ2ZyZWUnOiBmaWF0LFxuICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAndG90YWwnOiBmaWF0LFxuICAgICAgICB9O1xuICAgICAgICByZXN1bHRbJ2luZm8nXSA9IGJhbGFuY2U7XG4gICA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ICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiaWQnKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2FzaycpLFxuICAgICAgICAgICAgJ2Fza1ZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiBsYXN0LFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ3ByZXZpb3VzQ2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc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LFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmgnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcyNGgnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjg2NDY4MTctNTA4NDU3ZjItNzI2Yy0xMWU3LTllZWItMzUyOGQyNDEzYTU4LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5nYXRlY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9nYXRlY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dhdGVjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0dhdGVjb2luL1JFU1RmdWwtQVBJLUltcGxlbWVudGF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYXBpLmdhdGVjb2luLmNvbS9zd2FnZ2VyLXVpL2luZGV4Lmh0bWwnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xu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ZSBpbmNvbWUgc291cmNlIGxpc3QuXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlbmNlL1ZlcmlmaWNhdGlvbkxldmVsTGlzdCcsIC8vIEdldCB0aGUgdmVyaWYgbGV2ZWwgbGlzdC5cbiAgICAgICAgICAgICAgICAgICAgICAgICdTdHJlYW0vUHVibGljQ2hhbm5lbCcsIC8vIEdldCB0aGUgcHVibGljIHB1Ym51YiBjaGFubmVsIGxpc3RcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnRXhwb3J0L1RyYW5zYWN0aW9ucycsIC8vIFJlcXVlc3QgYSBleHBvcnQgb2YgYWxsIHRyYWRlcyBmcm9tIGJhc2VkIG9uIGN1cnJlbmN5cGFpciwgc3RhcnQgZGF0ZSBhbmQgZW5kIGRhdGVcbiAgICAgICAgICAgICAgICAgICAgICAgICdQaW5nJywgLy8gUG9zdCBhIHN0cmluZywgdGhlbiBnZXQgaXQgYmFjay5cbiAgICAgICAgICAgICAgICAgICAgICAgICdQdWJsaWMvVW5zdWJzY3JpYmUve0VtYWlsQ29kZX0nLCAvLyBMZXRzIHRoZSB1c2VyIHVuc3Vic2NyaWJlIGZyb20gZW1haWxzXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVnaXN0ZXJVc2VyJywgLy8gSW5pdGlhbCB0cmFkZXIgcmVnaXN0cmF0aW9uLlxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Db3Jwb3JhdGVEYXRhJywgLy8gR2V0IGNvcnBvcmF0ZSBhY2NvdW50IGRhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50QWRkcmVzcycsIC8vIENoZWNrIGlmIHJlc2lkZW5jZSBwcm9vZiB1cGxvYWRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRDb3Jwb3JhdGlvbicsIC8vIENoZWNrIGlmIHJlZ2lzdGVyZWQgZG9jdW1lbnQgdXBsb2FkZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50SUQnLCAvLyBDaGVjayBpZiBJRCBkb2N1bWVudCBjb3B5IHVwbG9hZGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudEluZm9ybWF0aW9uJywgLy8gR2V0IFN0ZXAzIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0VtYWlsJywgLy8gR2V0IHVzZXIgZW1haWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0ZlZVJhdGUnLCAvLyBHZXQgZmVlIHJhdGUgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0xldmVsJywgLy8gR2V0IHZlcmlmIGxldmVsIG9mIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9QZXJzb25hbEluZm9ybWF0aW9uJywgLy8gR2V0IFN0ZXAxIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1Bob25lJywgLy8gR2V0IHVzZXIgcGhvbmUgbnVtYmVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Qcm9maWxlJywgLy8gR2V0IHRyYWRlciBwcm9maWxlXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9RdWVzdGlvbm5haXJlJywgLy8gRmlsbCB0aGUgcXVlc3Rpb25uYWlyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyYWwnLCAvLyBHZXQgcmVmZXJyYWwgaW5mb3JtYXRpb25cbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1JlZmVycmFsQ29kZScsIC8vIEdldCB0aGUgcmVmZXJyYWwgY29kZSBvZiB0aGUgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1JlZmVycmFsTmFtZXMnLCAvLyBHZXQgbmFtZXMgb2YgcmVmZXJyZWQgdHJhZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyYWxSZXdhcmQnLCAvLyBHZXQgcmVmZXJyYWwgcmV3YXJkIGluZm9ybWF0aW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJlZENvZGUnLCAvLyBHZXQgcmVmZXJyYWwgY29kZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVzaWRlbnRJbmZvcm1hdGlvbicsIC8vIEdldCBTdGVwMiBEYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9TZWN1cml0eVNldHRpbmdzJywgLy8gR2V0IHZlcmlmIGRldGFpbHMgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1VzZXInLCAvLyBHZXQgYWxsIHVzZXIgaW5mb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FQSUtleS9BUElLZXknLCAvLyBHZXQgQVBJIEtleSBmb3IgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBdXRoL0Nvbm5lY3Rpb25IaXN0b3J5JywgLy8gR2V0cyBjb25uZWN0aW9uIGhpc3Rvcnkgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdCYWxhbmNlL0JhbGFuY2VzJywgLy8gR2V0cyB0aGUgYXZhaWxhYmxlIGJhbGFuY2UgZm9yIGVhY2ggY3VycmVuY3kgZm9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WN0aW9ucyBvZiBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlL1VzZXJUcmFkZXMnLCAvLyBHZXRzIGFsbCB0cmFuc2FjdGlvbnMgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudEFkZHJlc3MnLCAvLyBVcGxvYWQgYWRkcmVzcyBwcm9vZiBkb2N1bWVudFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRDb3Jwb3JhdGlvbicsIC8vIFVwbG9hZCByZWdpc3RlcmVkIGRvY3VtZW50IGRvY3VtZW50XG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudElEJywgLy8gVXBsb2FkIElEIGRvY3VtZW50IGNvcHlcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0VtYWlsL1JlcXVlc3RWZXJpZnknLCAvLyBSZXF1ZXN0IGZvciB2ZXJpZmljYXRpb24gZW1haWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0VtYWlsL1ZlcmlmeScsIC8vIFZlcmlmaWNhdGlvbiBlbWFpbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvR29vZ2xlQXV0aCcsIC8vIEVuYWJsZSBnb29nbGUgYXV0aFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvTGV2ZWwnLCAvLyBSZXF1ZXN0IHZlcmlmIGxldmVsIG9mIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9RdWVzdGlvbm5haXJlJywgLy8gRmlsbCB0aGUgcXVlc3Rpb25uYWlyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyYWwnLCAvLyBQb3N0IGEgcmVmZXJyYWwgZW1haWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUElLZXkvQVBJS2V5JywgLy8gQ3JlYXRlIGEgbmV3IEFQSSBrZXkgZm9yIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXV0aC9DaGFuZ2VQYXNzd29yZCcsIC8vIENoYW5nZSBwYXNzd29yZC5cbiAgICAgICAgICAgICAgICAgICAgICAgICdBdXRoL0ZvcmdvdFBhc3N3b3JkJywgLy8gUmVxdWVzdCByZXNldCBwYXNzd29yZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0F1dGgvRm9yZ290VXNlcklEJywgLy8gUmVxdWVzdCB1c2VyIGlkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXV0aC9Mb2dpbicsIC8vIFRyYWRlciBzZXNzaW9uIGxvZyBpbi5cbiAgICAgICAgICAgICAgICAgICAgICAgICdBdXRoL0xvZ291dCcsIC8vIExvZ291dCBmcm9tIHRoZSBjdXJyZW50IHNlc3Npb24uXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXV0aC9Mb2dvdXRPdGhlclNlc3Npb25zJywgLy8gTG9nb3V0IG90aGVyIHNlc3Npb25zLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ0F1dGgvUmVzZXRQYXNzd29yZCcsIC8vIFJlc2V0IHBhc3N3b3JkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQmFuay9UcmFuc2FjdGlvbnMnLCAvLyBSZXF1ZXN0IGEgdHJhbnNmZXIgZnJvbSB0aGUgdHJhZGVycyBhY2NvdW50IG9mIHRoZSBsb2dnZWQgaW4gdXNlci4gVGhpcyBpcyBvbmx5IGF2YWlsYWJsZSBmb3IgYmFuayBhY2NvdW50XG4gICAgICAgICAgICAgICAgICAgICAgICAnQmFuay9Vc2VyQWNjb3VudHMnLCAvLyBBZGQgYW4gYWNjb3VudCB0aGUgbG9nZ2VkIGluIHVzZXJcb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9NZXNzYWdlcycsIC8vIE1hcmsgYWxsIGFzIHJlYWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdOb3RpZmljYXRpb24vTWVzc2FnZXMve0lEfScsIC8vIE1hcmsgYXMgcmVhZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlL09yZGVycycsIC8vIFBsYWNlIGFuIG9yZGVyIGF0IHRoZSBleGNoYW5nZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZS9TdG9wT3JkZXJzJywgLy8gUGxhY2UgYSBzdG9wIG9yZGVyIGF0IHRoZSBleGNoYW5nZS5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0NvcnBvcmF0ZURhdGEnLCAvLyBVcGRhdGUgdXNlciBjb21wYW55IGRhdGEgZm9yIGNvcnBvcmF0ZSBhY2NvdW50XG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudElEJywgLy8gVXBkYXRlIElEIGRvY3VtZW50IG1ldGEgZGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRJbmZvcm1hdGlvbicsIC8vIFVwZGF0ZSBTdGVwMyBEYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9FbWFpbCcsIC8vIFVwZGF0ZSB1c2VyIGVtYWlsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9QZXJzb25hbEluZm9ybWF0aW9uJywgLy8gVXBkYXRlIFN0ZXAxIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1Bob25lJywgLy8gVXBkYXRlIHVzZXIgcGhvbmUgbnVtYmVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9RdWVzdGlvbm5haXJlJywgLy8gdXBkYXRlIHRoZSBxdWVzdGlvbm5haXJl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cnMnLCAvLyBDYW5jZWxzIGFsbCBleGlzdGluZyBzdG9wIG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlL1N0b3BPcmRlcnMve0lEfScsIC8vIENhbmNlbHMgYW4gZXhpc3Rpbmcgc3RvcCBvcmRlclxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDM1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ0JDUCc6ICdCQ1BUJyxcbiAgICAgICAgICAgICAgICAnRkxJJzogJ0ZMSVhYJyxcbiAgICAgICAgICAgICAgICAnTUFOJzogJ01BTkEnLFxuICAgICAgICAgICAgICAgICdTTFQnOiAnU0FMVCcsXG4gICAgICAgICAgICAgICAgJ1RSQSc6ICdUUkFDJyxcbiAgICAgICAgICAgICAgICAnV0dTJzogJ1dJTkdTJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0UmVmZXJlbmNlQ3VycmVuY3lQYWlycyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnY3VycmVuY3lQYWlycyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3RyYWRpbmdDb2RlJ107XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydiYXNlQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gbWFya2V0WydxdW90ZUN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwcmljZURlY2ltYWxQbGFjZXMnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRCYWxhbmNlQmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3lJZCA9IGJhbGFuY2VbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgY29kZSA9IGN1cnJlbmN5SWQ7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3lJZCBpbiB0aGlzLmN1cnJlbmNpZXNfYnlfaWQpXG4gICAgICAgICAgICAgICAgY29kZSA9IHRoaXMuY3VycmVuY2llc19ieV9pZFtjdXJyZW5jeUlkXVsnY29kZSddO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydhdmFpbGFibGVCYWxhbmNlJ10sXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiB0aGlzLnN1bSAoXG4gICAgICAgICAgICAgICAgICAgIGJhbGFuY2VbJ3BlbmRpbmdJbmNvbWluZyddLFxuICAgICAgICAgICAgICAgICAgICBiYWxhbmNlWydwZW5kaW5nT3V0Z29pbmcnXSxcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVsnb3Blbk9yZGVyJ11cbiAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VbJ2JhbGFuY2UnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQdWJsaWNNYXJrZXREZXB0aEN1cnJlbmN5UGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAg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bmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQdWJsaWNMaXZlVGlja2VycyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSByZXNwb25zZVsndGlja2VycyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IHQgPSAwOyB0IDwgdGlja2Vycy5sZW5ndGg7IHQrKykge1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbdF07XG4gICAgICAgICAgICBsZXQgaWQgPSB0aWNrZXJbJ2N1cnJlbmN5UGFpciddO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFB1YmxpY0xpdmVUaWNrZXJDdXJyZW5jeVBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnQ3V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aXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2ZlZUFtb3VudCcpO1xuICAgICAgICBsZXQgcHJpY2UgPSB0cmFkZVsncHJpY2UnXTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRyYWRlWydxdWFudGl0eSddO1xuICAgICAgICBsZXQgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICBsZXQgZmVlQ3VycmVuY3kgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgbWFya2V0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGZlZUN1cnJlbmN5ID0gbWFya2V0WydxdW90ZSddO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2YgZmVlQ29zdCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogZmVlQ3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ3JhdGUnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdmZWVSYXRlJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ3RyYW5zYWN0aW9uSWQnKSxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVySWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgIC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UsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdDb2RlJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICdXYXknOiAoc2lkZSA9PT0gJ2J1eScpID8gJ0JpZCcgOiAnQXNrJyxcbiAgICAgICAgICAgICdBbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09PSAnbGltaXQnKVxuICAgICAgICAgICAgb3JkZXJbJ1ByaWNlJ10gPSBwcmljZTtcbiAgICAgICAgaWYgKHRoaXMudHdvZmEpIHtcbiAgICAgICAgICAgIGlmICgnVmFsaWRhdGlvbkNvZGUnIGluIHBhcmFtcylcbiAgICAgICAgICAgICAgICBvcmRlclsnVmFsaWRhdGlvbkNvZGUnXSA9IHBhcmFtc1snVmFsaWRhdGlvbkNvZGUnXTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgdHdvLWZhY3RvciBhdXRoZW50aWNhdGlvbiByZXF1aXJlcyBhIG1pc3NpbmcgVmFsaWRhdGlvbkNvZGUgcGFyYW1ldGVyJyk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlT3JkZXJzICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydjbE9yZGVySWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIH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AgICAgIGlmICh0eXBlb2YgdHJhbnNhY3Rpb25zICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5ICh0cmFuc2FjdGlvbnMpKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdHJhbnNhY3Rpb25zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdHJhZGUgPSB0aGlzLnBhcnNlVHJhZGUgKHRyYW5zYWN0aW9uc1tpXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHRyYWRlc0ZpbGxlZCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhZGVzRmlsbGVkID0gMC4wO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB0cmFkZXNDb3N0ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFkZXNDb3N0ID0gMC4wO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhZGVzRmlsbGVkICs9IHRyYWRlWydhbW91bnQnXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyYWRlc0Nvc3QgKz0gdHJhZGVbJ2Ftb3VudCddICogdHJhZGVbJ3ByaWNlJ107XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJ2ZlZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHRyYWRlWydmZWUnXVsnY29zdCddICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGZlZUNvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmVlQ29zdCA9IDAuMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmVlQ29zdCArPSB0cmFkZVsnZmVlJ11bJ2Nvc3QnXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmVlQ3VycmVuY3kgPSB0cmFkZVsnZmVlJ11bJ2N1cnJlbmN5J107XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB0cmFkZVsnZmVlJ11bJ3JhdGUnXSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBmZWVSYXRlID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZlZVJhdGUgPSAwLjA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZlZVJhdGUgKz0gdHJhZGVbJ2ZlZSddWydyYXRlJ107XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdHJhZGVzLnB1c2ggKHRyYWRlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKHR5cGVvZiB0cmFkZXNGaWxsZWQgIT09ICd1bmRlZmluZWQnKSAmJiAodHJhZGVzRmlsbGVkID4gMCkpXG4gICAgICAgICAgICAgICAgICAgICAgICBwcmljZSA9IHRyYWRlc0Nvc3QgLyB0cmFkZXNGaWxsZWQ7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZmVlUmF0ZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBudW1UcmFkZXMgPSB0cmFkZXMubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG51bVRyYWRlcyA+IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmVlUmF0ZSA9IGZlZVJhdGUgLyBudW1UcmFkZXM7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBmZWVDb3N0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjb3N0JzogZmVlQ29zdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBmZWVDdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAncmF0ZSc6IGZlZVJhdGUsXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICA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1hcmtldE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMxNzg0MDI5LTAzMTNjNzAyLWI1MDktMTFlNy05Y2NjLWJjMGRhNmEwZTQzNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9kYXRhLmdhdGUuaW8vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9kYXRhLmdhdGUuaW8vYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9nYXRlLmlvLycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dhdGUuaW8vYXBpMicsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dhdGUuaW8vZmVlJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5nYXRlLmlvL2hjL2VuLXVzL2FydGljbGVzLzExNTAwMzU3NzY3MycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGxpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckJvb2sve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVIaXN0b3J5L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlSGlzdG9yeS97aWR9L3t0aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ25ld0FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzV2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbEFsbE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMixcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRpbmZvICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHRoaXMuc2FmZVZhbHVlIChyZXNwb25zZSwgJ3BhaXJzJyk7XG4gICAgICAgIGlmICghbWFya2V0cylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaE1hcmtldHMgZ290IGFuIHVucmVjb2duaXplZCByZXNwb25zZScpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXQpO1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1swXTtcbiAgICAgICAgICAgIGxldCBkZXRhaWxzID0gbWFya2V0W2lkXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBpZC5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGJhc2UgPSBiYXNlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgcXVvdGUgPSBxdW90ZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBkZXRhaWxzWydkZWNpbWFsX3BsYWNlcyddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhbW91bnRMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IGRldGFpbHNbJ21pbl9hbW91bnQnXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtZGV0YWlsc1snZGVjaW1hbF9wbGFjZXMnXSksXG4gICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgY29zdExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogYW1vdW50TGltaXRzWydtaW4nXSAqIHByaWNlTGltaXRzWydtaW4nXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudExpbWl0cyxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZUxpbWl0cyxcbiAgICAgICAgICAgICAgICAnY29zdCc6IGNvc3RMaW1pdHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBkZXRhaWxzWydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBkZXRhaWxzWydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZSB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmICgnYXZhaWxhYmxlJyBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VbJ2F2YWlsYWJsZSddKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2F2YWlsYWJsZSddW2N1cnJlbmN5XSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdsb2NrZWQnIGluIGJhbGFuY2UpIHtcbiAgICAgICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZVsnbG9ja2VkJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnbG9ja2VkJ11bY3VycmVuY3ldKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZ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ICAgICAgICdjb3VudHJpZXMnOiAnVVMnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndXNlckFnZW50JzogdGhpcy51c2VyQWdlbnRzWydjaHJvbWUnXSxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiA2MCxcbiAgICAgICAgICAgICAgICAnNW0nOiAzMDAsXG4gICAgICAgICAgICAgICAgJzE1bSc6IDkwMCxcbiAgICAgICAgICAgICAgICAnMWgnOiAzNjAwLFxuICAgICAgICAgICAgICAgICc2aCc6IDIxNjAwLFxuICAgICAgICAgICAgICAgICcxZCc6IDg2NDAwLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICd0ZXN0JzogJ2h0dHBzOi8vYXBpLXB1YmxpYy5zYW5kYm94LmdkYXguY29tJyxcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTI3LWIxYmU0MWM2LTVlZGItMTFlNy05NWY2LTViNDk2YzQ2OWUyYy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuZ2RheC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuZ2RheC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9kb2NzLmdkYXguY29tJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmdkYXguY29tL2ZlZXMnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9zdXBwb3J0LmdkYXguY29tL2N1c3RvbWVyL2VuL3BvcnRhbC90b3BpY3MvOTM5NDAyLWRlcG9zaXRpbmctYW5kLXdpdGhkcmF3aW5nLWZ1bmRzL2FydGljbGVzJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwYXNzd29yZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9L2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0vY2FuZGxlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS9zdGF0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aW1lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L2hvbGRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L2xlZGdlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMve2lkfS90cmFuc2ZlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvaW5iYXNlLWFjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWxscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC1tZXRob2RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVwb3J0cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2Vycy9zZWxmL3RyYWlsaW5nLXZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzL2NvaW5iYXNlLWFjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzL3BheW1lbnQtbWV0aG9kJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb2luYmFzZS1hY2NvdW50cy97aWR9L2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZy9yZXBheScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9jbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZmlsZXMvbWFyZ2luLXRyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXBvcnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9jb2luYmFzZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMvY3J5cHRvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9wYXltZW50LW1ldGhvZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsIC8vIGNvbXBsaWNhdGVkIHRpZXIgc3lzdGVtIHBlciBjb2luXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjMgLyAxMDAsIC8vIHRpZXJlZCBmZWUgc3RhcnRzIGF0IDAuMyVcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAuMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogMjUsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMC4xNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiAxMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFByb2R1Y3RzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnYmFzZV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydxdW90ZV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ3F1b3RlX2luY3JlbWVudCcpLFxuICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKHRoaXMuc2FmZVN0cmluZyAobWFya2V0LCAncXVvdGVfaW5jcmVtZW50JykpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCB0YWtlciA9IHRoaXMuZmVlc1sndHJhZGluZyddWyd0YWtlciddOyAgLy8gZG9lcyBub3Qgc2VlbSByaWdodFxuICAgICAgICAgICAgaWYgKChiYXNlID09PSAnRVRIJykgfHwgKGJhc2UgPT09ICdMVEMnKSkge1xuICAgICAgICAgICAgICAgIHRha2VyID0gMC4wMDM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gbWFya2V0WydzdGF0dXMnXSA9PT0gJ29ubGluZSc7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdiYXNlX21pbl9zaXplJyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ2Jhc2VfbWF4X3NpemUnKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5fbWFya2V0X2Z1bmRzJyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heF9tYXJrZXRfZnVuZHMnKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cb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AgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IGJpZCxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogYXNrLFxuICAgICAgICAgICAgJ2Fza1ZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiBsYXN0LFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ3ByZXZpb3VzQ2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbHVtZScpLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ3RpbWUnIGluIHRyYWRlKSB7XG4gICAgICAgICAgICB0aW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ldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVySWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGlzbzg2MDEsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAncHJpY2UnKSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdzaXplJyksXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTXlUcmFkZXMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHt9O1xuICAgICAgICBpZiAodHlwZW9mIHN5bWJvbCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICAgICAgcmVxdWVzdFsncHJvZHVjdF9pZCddID0gbWFya2V0WydpZCddO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2YgbGltaXQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgcmVxdWVzdFsnbGltaXQnXSA9IGxpbWl0O1xuICAgICAgICBsZXQgcmVzcG9uc2Ug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biAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0T3JkZXJzSWQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXIgKHJlc3BvbnNlKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVycyAoc3ltYm9sID0gd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wgYW1vdW50LCBwcmljZSwgdGFrZXJPck1ha2VyID0gJ3Rha2VyJywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICBsZXQgcmF0ZSA9IG1hcmtldFt0YWtlck9yTWFrZXJdO1xuICAgICAgICBsZXQgY29zdCA9IGFtb3VudCAqIHByaWNlO1xuICAgICAgICBsZXQgY3VycmVuY3kgPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndHlwZSc6IHRha2VyT3JNYWtlcixcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgJ3JhdGUnOiByYXRlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0ICh0aGlzLmZlZVRvUHJlY2lzaW9uIChjdXJyZW5jeSwgcmF0ZSAqIGNvc3QpKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBnZXRQYXltZW50TWV0aG9kcyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldFBheW1lbnRNZXRob2RzICgpO1xuICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgfVxuXG4gICAgYXN5bmMgZGVwb3NpdCAoY3VycmVuY3ksIGFtb3VudCwgYWRkcmVzcywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3REZXBvc2l0cyc7XG4gICAgICAgIGlmICgncGF5bWVudF9tZXRob2RfaWQnIG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AgICAgICAgaWYgKChjb2RlID09PSA0MDApIHx8IChjb2RlID09PSA0MDQpKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSByZXNwb25zZVsnbWVzc2FnZSddO1xuICAgICAgICAgICAgICAgIGxldCBlcnJvciA9IHRoaXMuaWQgKyAnICcgKyBtZXNzYWdlO1xuICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlLmluZGV4T2YgKCdwcmljZSB0b28gc21hbGwnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGVycm9yKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ3ByaWNlIHRvbyBwcmVjaXNlJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyIChlcnJvcik7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnSW5zdWZmaWNpZW50IGZ1bmRzJykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKGVycm9yKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UgPT09ICdOb3RGb3VuZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKGVycm9yKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UgPT09ICdJbnZhbGlkIEFQSSBLZXknKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yIChlcnJvcik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICA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yY29udGVudC5jb20vMTI5NDQ1NC8yNzgxNjg1Ny1jZTdiZTY0NC02MDk2LTExZTctODJkNi0zYzI1NzI2MzIyOWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmdlbWluaS5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9nZW1pbmkuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9kb2NzLmdlbWluaS5jb20vcmVzdC1hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9kb2NzLnNhbmRib3guZ2VtaW5pLmNvbScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAndGVzdCc6ICdodHRwczovL2FwaS5zYW5kYm94LmdlbWluaS5jb20nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9nZW1pbmkuY29tL2ZlZS1zY2hlZHVsZS8nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9nZW1pbmkuY29tL3RyYW5zZmVyLWZlZXMvJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2xzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwdWJ0aWNrZXIve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXVjdGlvbi97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXVjdGlvbi97c3ltYm9sfS9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsL3Nlc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteXRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGV2b2x1bWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0L3tjdXJyZW5jeX0vbmV3QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGVhcnRiZWF0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFN5bWJvbHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IGlkO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IG1hcmtldC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdXBwZXJjYXNlLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHVwcGVyY2FzZS5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEJvb2tTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzog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biAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2F2YWlsYWJsZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnQnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgYWxsb3dzIGxpbWl0IG9yZGVycyBvbmx5Jyk7XG4gICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdjbGllbnRfb3JkZXJfaWQnOiBub25jZS50b1N0cmluZyAoKSxcbiA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Sk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ3R4SGFzaCcpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9ICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdyZXF1ZXN0JzogdXJsLFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcXVlcnkpO1xuICAgICAgICAgICAgbGV0IHBheWxvYWQgPSB0aGlzLmpzb24gKHJlcXVlc3QpO1xuICAgICAgICAgICAgcGF5bG9hZCA9IHRoaXMuc3RyaW5nVG9CYXNlNjQgKHRoaXMuZW5jb2RlIChwYXlsb2FkKSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjIChwYXlsb2FkLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMzg0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAndGV4dC9wbGFpbicsXG4gICAgICAgICAgICAgICAgJ1gtR0VNSU5JLUFQSUtFWSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdYLUdFTUlOSS1QQVlMT0FEJzogdGhpcy5kZWNvZGUgKHBheWxvYWQpLFxuICAgICAgICAgICAgICAgICdYLUdFTUlOSS1TSUdOQVRVUkUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyB1cmw7XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgncmVzdWx0JyBpbiByZXNwb25zZSlcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsncmVzdWx0J10gPT09ICdlcnJvcicpXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gK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aGFkYXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2l0aHViLmNvbS9odW9iaWFwaS9BUElfRG9jcy93aWtpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGFkYXgvY29tbW9uL3N5bWJvbHMnLCAvLyDmn6Xor6Lns7vnu5/mlK/mjIHnmoTmiYDmnInkuqTmmJPlr7lcbiAgICAgICAgICAgICAgICAgICAgICAgICdoYWRheC9jb21tb24vY3VycmVuY3lzJywgLy8g5p+l6K+i57O757uf5pSv5oyB55qE5omA5pyJ5biB56eNXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL3RpbWVzdGFtcCcsIC8vIOafpeivouezu+e7n+W9k+WJjeaXtumXtFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hhZGF4L3NldHRpbmdzL2N1cnJlbmN5cycsIC8vID9sYW5ndWFnZT1lbi1VU1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ29wdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoTWFya2V0c01ldGhvZCc6ICdwdWJsaWNHZXRIYWRheENvbW1vblN5bWJvbHMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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OiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjU1NS04ZWFlYzIwZS01ZWRjLTExZTctOWM1Yi02ZGM2OWZjNDJmNWUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHA6Ly9hcGkuaGl0YnRjLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2hpdGJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2hpdGJ0Yy1jb20vaGl0YnRjLWFwaS9ibG9iL21hc3Rlci9BUEl2MS5tZCcsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2hpdGJ0Yy5jb20vZmVlcy1hbmQtbGltaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5oaXRidGMuY29tL2hjL2VuLXVzL2FydGljbGVzLzExNTAwNTE0ODYwNS1GZWVzLWFuZC1saW1pdHMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tzeW1ib2x9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3N5bWJvbH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7c3ltYm9sfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tzeW1ib2x9L3RyYWRlcy9yZWNlbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGltZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvYWN0aXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvcmVjZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL2J5L29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICduZXdfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncGF5bWVudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhZGRyZXNzL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zL3t0cmFuc2FjdGlvbn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2Zlcl90b190cmFkaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2Zlcl90b19tYWluJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhZGRyZXNzL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW91dCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBoYXJkY29kZWQgZmVlcyBhcmUgZGVwcmVjYXRlZCBhbmQgc2hvdWxkIG9ubHkgYmUgdXNlZCB3aGVuIHRoZXJlJ3Mgbm8gb3RoZXIgd2F5IHRvIGdldCBmZWUgaW5mb1xuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAtMC4wMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDQyc6IDAuMDAxOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMjE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAxOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICcxU1QnOiAwLjg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEWCc6IDUuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRSc6IDYuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRU9OJzogMC4wMTAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSVInOiA1NjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU1QJzogOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTlQnOiA2LjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJEUic6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJOJzogMTguNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUlQnOiAyNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEInOiAwLjAwMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRMJzogMjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRNJzogNTA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUUyc6IDg2MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAxLjksXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFTJzogMTEzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDTic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCRVQnOiAxMjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQktCJzogNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1DJzogMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1UJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDIuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlFYJzogNC43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUWCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVTJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0NUJzogMTE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEVCc6IDEwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRFgnOiAzMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRkknOiA2MSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTEQnOiAwLjg4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NORCc6IDU3NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTlgnOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPU1MnOiA2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDU05PJzogMTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RSJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RYJzogMTQ2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NWQyc6IDguNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREJJWCc6IDAuMDE2OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ04nOiAxMjAwMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENUJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEREYnOiAzNDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREVOVCc6IDYyNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdCJzogMC40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHRCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRElDRSc6IDAuMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRExUJzogMC4yNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlQnOiAwLjIxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPVic6IDM0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSUFUnOiAyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlQnOiAyNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFNIJzogMC4wMTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJFVCc6IDg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVEMnOiAyMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQlRDT0xEJzogNi42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VDQVQnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFREcnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDIuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTEUnOiAwLjAwMTcyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMTSc6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNQyc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1HTyc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOSic6IDE2MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAxLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRCUyc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDUuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWE4nOiA0NTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlJEJzogNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVFTCc6IDEyMy4wMDEwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAyMDIuOTU5ODMwOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWU4nOiAxLjg0OSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWVAnOiA2Ni4xMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLjAwMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1VQJzogNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVlQnOiAxLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEFDJzogMTQ0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hERyc6IDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEdUJzogMTA4MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdIUEMnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFZOJzogMTIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAuNTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPUyc6IDAuMzUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5EJzogNzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5ESSc6IDU5MTMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVRTJzogMTUuMDAxMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdJWFQnOiAxMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLQlInOiAxNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0lDSyc6IDExMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQSc6IDQxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBVCc6IDEuNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElGRSc6IDEzMDAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDI3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xTSyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVU4nOiAwLjM0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BSUQnOiA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BTkEnOiAxNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNBUCc6IDUuNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlQUyc6IDQzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ORSc6IDEuMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVNQJzogMTIxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDkyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ZQic6IDMuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOREMnOiAxNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVCTCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVUJzogMy45NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVE8nOiA5OTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhDJzogMTMuMzksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPQVgnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPRE4nOiAwLjAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09QVCc6IDMzNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUk1FJzogMi44LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09UTic6IDAuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFZJzogMy4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJWCc6IDk2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMQlQnOiAwLjMzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMUic6IDExNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFUnOiAwLjg3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPRSc6IDc4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0xMJzogMy41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQVCc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJFJzogMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJHJzogMzksXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJPJzogNDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJTJzogNjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFRPWSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVUnOiA2MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQ04nOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FWVCc6IDY0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUCc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUktDJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlZUJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMi4yNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQkQnOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NDTCc6IDIuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSVNBJzogMTY0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS0lOJzogNDA3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNQVJUJzogMC40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNUyc6IDAuMDM3NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkMnOiAzNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogNDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMjMzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NURUVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RVJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RYJzogMTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VCJzogMTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VSJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTV1QnOiAwLjUxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RBQVMnOiAwLjkxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RCVCc6IDIuMzcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEZMJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElNRSc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElYJzogNy4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RLTic6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtSJzogODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5UJzogOTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJTVCc6IDEuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAxMzk1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VFVCc6IDQ4MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVR1QnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRVJJJzogMC4wMzcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCJzogNTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCRSc6IDE0NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT0lTRSc6IDYxOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXRUFMVEgnOiAwLjAxNjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOR1MnOiAyLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMC43NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVVSJzogMy4yMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRE4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hFTSc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hVQyc6IDAuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdZT1lPVyc6IDE0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaQVAnOiAyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAyMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaU0MnOiAxOTEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnMVNUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRU9OJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUkRSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUk4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JBUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCRVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JLQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlFYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVE0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQ1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRkknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NMRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05EJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPU1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NTTk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RCSVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEREYnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RFTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdESUNFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9WJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlBVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RTSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJFVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQ09MRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUNBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRE8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNR08nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOSic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFUk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQlMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VYTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlJEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVUVMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRllQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dVUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1ZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIQUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hERyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEdUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIUEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hWTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ08nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDT1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lORCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5ESSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVRTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJWFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tCUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0lDSyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEEnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElGRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFJDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMU0snOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xVTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFJRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFOQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNBUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlQUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU5FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNU1AnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVlCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOREMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FQkwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlRPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05YVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0FYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPRE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1BUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUk1FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPVE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BBWSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUElYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTEJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0xMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFRPWSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSS0MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NDTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0lTQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0tJTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01BUlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NURUVNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTV1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RBQVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RCVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEZMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSU1FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RLTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSU1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVR1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVSSSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUJFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT0lTRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0VBTFRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXSU5HUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVVSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hFTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFVDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdZT1lPVyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkFQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pTQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnQkNDJzogJ0JDQycsXG4gICAgICAgICAgICAgICAgJ1hCVCc6ICdCVEMnLFxuICAgICAgICAgICAgICAgICdEUksnOiAnREFTSCcsXG4gICAgICAgICAgICAgICAgJ0NBVCc6ICdCaXRDbGF2ZScsXG4gICAgICAgICAgICAgICAgJ1VTRCc6ICdVU0RUJyxcbiAgICAgICAgICAgICAgICAnRU1HTyc6ICdNR08nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFN5bWJvbHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWydzeW1ib2xzJ10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydzeW1ib2xzJ11bcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnY29tbW9kaXR5J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBsb3QgPSB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbG90Jyk7XG4gICAgICAgICAgICBsZXQgc3RlcCA9IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdzdGVwJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnc3RlcCc6IHN0ZXAsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ3Byb3ZpZGVMaXF1aWRpdHlSYXRlJyksXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ3Rha2VMaXF1aWRpdHlSYXRlJyksXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0Wydsb3QnXSksXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0WydzdGVwJ10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogc3RlcCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWV0aG9kID0gdGhpcy5zYWZlU3RyaW5nIChwYXJhbXMsICd0eXBlJywgJ3RyYWRpbmcnKTtcbiAgICAgICAgbWV0aG9kICs9ICdHZXRCYWxhbmNlJztcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsICd0eXBlJyk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSA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AodHJhZGUsICdleGVjUHJpY2UnKTtcbiAgICAgICAgbGV0IGNvc3QgPSBwcmljZSAqIGFtb3VudDtcbiAgICAgICAgbGV0IGZlZSA9IHtcbiAgICAgICAgICAgICdjb3N0JzogdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnZmVlJyksXG4gICAgICAgICAgICAnY3VycmVuY3knOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncmF0ZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRyYWRlWyd0aW1lc3RhbXAnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndHJhZGVJZCddLFxuICAgICAgICAgICAgJ29yZGVyJzogdHJhZGVbJ2NsaWVudE9yZGVySWQnXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRo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3JkZXIsICdvcmRlclF1YW50aXR5Jyk7XG4gICAgICAgIGlmICh0eXBlb2YgYW1vdW50ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3F1YW50aXR5Jyk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdxdWFudGl0eUxlYXZlcycpO1xuICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZyA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdsZWF2ZXNRdWFudGl0eScpO1xuICAgICAgICBsZXQgZmlsbGVkID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGFtb3VudERlZmluZWQgPSAodHlwZW9mIGFtb3VudCAhPT0gJ3VuZGVmaW5lZCcpO1xuICAgICAgICBsZXQgcmVtYWluaW5nRGVmaW5lZCA9ICh0eXBlb2YgcmVtYWluaW5nICE9PSAndW5kZWZpbmVkJyk7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBpZiAoYW1vdW50RGVmaW5lZClcbiAgICAgICAgICAgICAgICBhbW91bnQgKj0gbWFya2V0Wydsb3QnXTtcbiAgICAgICAgICAgIGlmIChyZW1haW5pbmdEZWZpbmVkKVxuICAgICAgICAgICAgICAgIHJlbWFpbmluZyAqPSBtYXJrZXRbJ2xvdCddO1xuICAgICAgICB9XG4gICAgICAgIGlmIChhbW91bnREZWZpbmVkKSB7XG4gICAgICAgICAgICBpZiAocmVtYWluaW5nRGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgICAgICAgICBjb3N0ID0gYXZlcmFnZVByaWNlICogZmlsbGVkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnY2xpZW50T3JkZXJJZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy50cmFkaW5nR2V0T3JkZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY2xpZW50T3JkZXJJZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXM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XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnR0VUJylcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBheWxvYWQpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB1cmw7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgICAgIGF1dGggKz0gYm9keTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnWC1TaWduYXR1cmUnOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgdXJsO1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmlu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gICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnTTEnLFxuICAgICAgICAgICAgICAgICczbSc6ICdNMycsXG4gICAgICAgICAgICAgICAgJzVtJzogJ001JyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJ00xNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICdNMzAnLCAvLyBkZWZhdWx0XG4gICAgICAgICAgICAgICAgJzFoJzogJ0gxJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnSDQnLFxuICAgICAgICAgICAgICAgICcxZCc6ICdEMScsXG4gICAgICAgICAgICAgICAgJzF3JzogJ0Q3JyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1NTUtOGVhZWMyMGUtNWVkYy0xMWU3LTljNWItNmRjNjlmYzQyZjVlLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5oaXRidGMuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vaGl0YnRjLmNvbS8/cmVmX2lkPTVhNWQzOWE2NWQ0NjYnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9hcGkuaGl0YnRjLmNvbScsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2hpdGJ0Yy5jb20vZmVlcy1hbmQtbGltaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5oaXRidGMuY29tL2hjL2VuLXVzL2FydGljbGVzLzExNTAwNTE0ODYwNS1GZWVzLWFuZC1saW1pdHMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCcsIC8vIEF2YWlsYWJsZSBDdXJyZW5jeSBTeW1ib2xzXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sL3tzeW1ib2x9JywgLy8gR2V0IHN5bWJvbCBpbmZvXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knLCAvLyBBdmFpbGFibGUgQ3VycmVuY2llc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L3tjdXJyZW5jeX0nLCAvLyBHZXQgY3VycmVuY3kgaW5mb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsIC8vIFRpY2tlciBsaXN0IGZvciBhbGwgc3ltYm9sc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97c3ltYm9sfScsIC8vIFRpY2tlciBmb3Igc3ltYm9sXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3tzeW1ib2x9JywgLy8gVHJhZGVzXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rL3tzeW1ib2x9JywgLy8gT3JkZXJib29rXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuZGxlcy97c3ltYm9sfScsIC8vIENhbmRsZXNcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJywgLy8gTGlzdCB5b3VyIGN1cnJlbnQgb3BlbiBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci97Y2xpZW50T3JkZXJJZH0nLCAvLyBHZXQgYSBzaW5nbGUgb3JkZXIgYnkgY2xpZW50T3JkZXJJZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmcvYmFsYW5jZScsIC8vIEdldCB0cmFkaW5nIGJhbGFuY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nL2ZlZS97c3ltYm9sfScsIC8vIEdldCB0cmFkaW5nIGZlZSByYXRlXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS90cmFkZXMnLCAvLyBHZXQgaGlzdG9yaWNhbCB0cmFkZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L29yZGVyJywgLy8gR2V0IGhpc3RvcmljYWwgb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS9vcmRlci97aWR9L3RyYWRlcycsIC8vIEdldCBoaXN0b3JpY2FsIHRyYWRlcyBieSBzcGVjaWZpZWQgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2JhbGFuY2UnLCAvLyBHZXQgbWFpbiBhY2Njb3VudCBiYWxhbmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC90cmFuc2FjdGlvbnMnLCAvLyBHZXQgYWNjb3VudCB0cmFuc2FjdGlvbnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3RyYW5zYWN0aW9ucy97aWR9JywgLy8gR2V0IGFjY291bnQgdHJhbnNhY3Rpb24gYnkgaWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by9hZGRyZXNzL3tjdXJyZW5jeX0nLCAvLyBHZXQgZGVwb3NpdCBjcnlwcm8gYWRkcmVzc1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsIC8vIENyZWF0ZSBuZXcgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by93aXRoZHJhdycsIC8vIFdpdGhkcmF3IGNyeXByb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvY3J5cHRvL2FkZHJlc3Mve2N1cnJlbmN5fScsIC8vIENyZWF0ZSBuZXcgZGVwb3NpdCBjcnlwcm8gYWRkcmVzc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvdHJhbnNmZXInLCAvLyBUcmFuc2ZlciBhbW91bnQgdG8gdHJhZGluZ1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIENyZWF0ZSBuZXcgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by93aXRoZHJhdy97aWR9JywgLy8gQ29tbWl0IHdpdGhkcmF3IGNyeXByb1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJywgLy8gQ2FuY2VsIGFsbCBvcGVuIG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIENhbmNlbCBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvY3J5cHRvL3dpdGhkcmF3L3tpZH0nLCAvLyBSb2xsYmFjayB3aXRoZHJhdyBjcnlwcm9cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3BhdGNoJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIENhbmNlbCBSZXBsYWNlIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IC0wLjAxIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNDJzogMC4wMDE4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDA5NTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDE4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAxMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAuNTA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLjA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJzFTVCc6IDAuODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQURYJzogNS43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFJzogNi43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFT04nOiAwLjAxMDA2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FJUic6IDU2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTU0nOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTVAnOiAzNDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU5UJzogNi43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSRFInOiAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSTic6IDE4LjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJUJzogMjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRCJzogMC4wMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUTCc6IDI3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUTSc6IDUwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVFMnOiA4NjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMS45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JBUyc6IDExMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ04nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkVUJzogMTI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JLQic6IDQ2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JNQyc6IDMyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JNVCc6IDEwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTlQnOiAyLjU3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JRWCc6IDQuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVENBJzogMzUxLjIxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUWCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVTJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0FQUCc6IDk3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NDVCc6IDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RUJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEWCc6IDMwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NGSSc6IDYxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NMJzogMTMuODUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0xEJzogMC44OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTkQnOiA1NzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05YJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDT1NTJzogNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1BBWSc6IDUuNDg3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NTTk8nOiAxNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFInOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFgnOiAxNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1ZDJzogOC40NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVRBJzogMTIuOTQ5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RCSVgnOiAwLjAxNjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENOJzogMTI4MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ1QnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RERic6IDM0MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdERU5UJzogMTAwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0InOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdEJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdESUNFJzogMC4zMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdETFQnOiAwLjI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROVCc6IDAuMjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9WJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJQVSc6IDI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSVCc6IDI0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEU0gnOiAwLjAxNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQkVUJzogODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQyc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVENPTEQnOiA2LjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUNBVCc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VERyc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMi45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VLTyc6IDExMzYuMzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxFJzogMC4wMDE3MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTE0nOiAwLjAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUMnOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01HTyc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOSic6IDE2MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAxLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRCUyc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDUuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWE4nOiA0NTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRkNOJzogMC4wMDAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlJEJzogNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVFTCc6IDEyMy4wMDEwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAyMDIuOTU5ODMwOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWU4nOiAxLjg0OSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWVAnOiA2Ni4xMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQU1FJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05PJzogMC4wMDM0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dVUCc6IDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1ZUJzogMS4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEFDJzogMTQ0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hERyc6IDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEdUJzogMTA4MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdIUEMnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFZOJzogMTIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAuNTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPUyc6IDAuMzUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5EJzogNzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5ESSc6IDc5MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJVFMnOiAxNS4wMDEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lYVCc6IDExLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tCUic6IDE0MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogMTEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tNRCc6IDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEEnOiA0MSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMRU5EJzogMzg4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBVCc6IDEuNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElGRSc6IDEzMDAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDI3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xTSyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMT0MnOiAxMS4wNzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFVOJzogMC4zNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQUlEJzogNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQU5BJzogMTQzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DQVAnOiA1LjQ0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01JUFMnOiA0MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNTkUnOiAxLjMzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01TUCc6IDEyMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQ08nOiAwLjM1NyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEgnOiA5MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdNWUInOiAzLjksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkRDJzogMTY1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FQkwnOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FVCc6IDMuOTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlRPJzogOTk4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05HQyc6IDIuMzY4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05YQyc6IDEzLjM5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05YVCc6IDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0FYJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0ROJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUFQnOiAzMzUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1JNRSc6IDIuOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPVE4nOiAwLjU3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BBWSc6IDMuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQSVgnOiA5NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTEJUJzogMC4zMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFInOiAxMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExVJzogMC44NyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0UnOiA3ODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9MTCc6IDMuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUFQnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRSc6IDMyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRyc6IDM5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSTyc6IDQxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSUyc6IDYwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BUT1knOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFVJzogNjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUNOJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVlQnOiA2NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRVAnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JLQyc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JMQyc6IDEuMjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlZUJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0MnOiAzMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAyLjI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NCRCc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0NMJzogMi42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NJU0EnOiAxNjQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NLSU4nOiA0MDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1dGVEMnOiAzNTIuOTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01BUlQnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01TJzogMC4wMzc1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOQyc6IDM2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOR0xTJzogNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTk0nOiA0OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAyMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RBUic6IDAuMTQ0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUT1JNJzogMTUzLjE5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NURUVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1BGJzogMTQuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFUnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFgnOiAxMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiAxNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVVInOiAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NXVCc6IDAuNTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEFBUyc6IDAuOTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEJUJzogMi4zNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdURkwnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSU1FJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSVgnOiA3LjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtOJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUR1QnOiAxNzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtSJzogODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5UJzogOTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJTVCc6IDEuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAyNzAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUVUJzogNDgwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VHVCc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VUVCc6IDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVOJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVSSSc6IDAuMDM3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQic6IDUwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQkUnOiAxNDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVk9JU0UnOiA2MTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0VBTFRIJzogMC4wMTY4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dJTkdTJzogMi40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dUQyc6IDAuNzUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1JDJzogNDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEFVUic6IDMuMjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEROJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRU0nOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYVUMnOiAwLjksXG4gICAgICAgICAgICAgICAgICAgICAgICAnWU9ZT1cnOiAxNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkFQJzogMjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlJYJzogMjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlNDJzogMTkxLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJzFTVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQURYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUVPTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUlSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJEUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVE0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCS0InOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JNQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JRWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JVUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0NUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0ZJJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTEQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NORCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05YJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDT1NTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDU05PJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1ZDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQklYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRERGJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdERU5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0InOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRElDRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRExUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPVic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJQVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEU0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCRVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVENPTEQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VDQVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VERyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTEUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUdPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTkonOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEJTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVZYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZSRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVFTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05PJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEFDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIREcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hHVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFBDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIVk4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ09TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lOREknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lUUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVhUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLQlInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tJQ0snOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xJRkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFNLJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BSUQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BTkEnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DQVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01JUFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ORSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVNQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ZQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORUJMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05UTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09BWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0ROJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09QVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1JNRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1ROJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExCVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9MTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUlMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BUT1knOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FBVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUktDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NBTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0JEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQ0wnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NJU0EnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NLSU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNQVJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05HTFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVEVFTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RSQVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1dUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUQUFTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUQlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RGTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElNRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUS04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RLUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlNUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VFVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUdUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFUkknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVk9JU0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dFQUxUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOR1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEFVUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEROJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRU0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hVQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWU9ZT1cnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pBUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlJYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaU0MnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBmZWVU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HRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0WydxdWFudGl0eUluY3JlbWVudCddKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgdGFrZXIgPSB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAndGFrZUxpcXVpZGl0eVJhdGUnKTtcbiAgICAgICAgICAgIGxldCBtYWtlciA9IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdwcm92aWRlTGlxdWlkaXR5UmF0ZScpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ3N0ZXAnOiBzdGVwLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogc3RlcCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCAqIHN0ZXAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDdXJyZW5jeSAocGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jeVsnaWQnXTtcbiAgICAgICAgICAgIC8vIHRvZG86IHdpbGwgbmVlZCB0byByZXRoaW5rIHRoZSBmZWVzXG4gICAgICAgICAgICAvLyB0byBhZGQgc3VwcG9ydCBmb3IgbXVsdGlwbGUgd2l0aGRyYXdhbC9kZXBvc2l0IG1ldGhvZHMgYW5kXG4gICAgICAgICAgICAvLyBkaWZmZXJlbnRpYXRlZCBmZWVzIGZvciBlYWNoIHBhcnRpY3VsYXIgbWV0aG9kXG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0gODsgLy8gZGV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ICAgICAgICAgICAgICAgJ3RyYW5zZmVyJzogdHJhbnNmZXIsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WydmdWxsTmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAnZmVlJzogdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAncGF5b3V0RmVlJyksIC8vIHRvZG86IHJlZGVzaWduXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdHlwZSA9IHRoaXMuc2FmZVN0cmluZyAocGFyYW1zLCAndHlwZScsICd0cmFkaW5nJyk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZUdldCcgKyB0aGlzLmNhcGl0YWxpemUgKHR5cGUpICsgJ0JhbGFuY2UnO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzW21ldGhvZF0gKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjb2RlKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlJ10pLFxuICAgICAgICAgICAgICAgICd1c2VkJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsncmVzZXJ2ZWQnXSksXG4gICAgICAgICAgICAgICAgJ3RvdGFsJz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AgICAgICBsZXQgdndhcCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBxdW90ZVZvbHVtZSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBpZiAodHlwZW9mIGJhc2VWb2x1bWUgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIGlmIChiYXNlVm9sdW1lID4gMClcbiAgICAgICAgICAgICAgICAgICAgdndhcCA9IHF1b3RlVm9sdW1lIC8gYmFzZVZvbHVtZTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYmlkJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IG9wZW4sXG4gICAgICAgICAgICAnY2xvc2UnOiBsYXN0LFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ3ByZXZpb3VzQ2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhbmdlJzogY2hhbmdlLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2U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IGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlclN5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBpZiAoJ21lc3NhZ2UnIGluIHRpY2tlcilcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGlja2VyWydtZXNzYWdlJ10pO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsndGltZXN0YW1wJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IGlkID0gdHJhZGVbJ3N5bWJvbCddO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZlZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdmZWUnIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBtYXJrZXQgPyBtYXJrZXRbJ3F1b3RlJ10gOiB1bmRlZmluZWQ7XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdmZWUnKSxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG9yZGVySWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnY2xpZW50T3JkZXJJZCcgaW4gdHJhZGUpXG4gICAgICAgICAgICBvcmRlcklkID0gdHJhZGVbJ2NsaWVudE9yZGVySWQnXTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3F1YW50aXR5Jyk7XG4gICAgICAgIGxldCBjb3N0ID0gcHJpY2UgKiBhbW91bnQ7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcklkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxc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ldycpIHtcbiAgICAgICAgICAgIHN0YXR1cyA9ICdvcGVuJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT09ICdzdXNwZW5kZWQnKSB7XG4gICAgICAgICAgICBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09PSAncGFydGlhbGx5RmlsbGVkJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICB9IGVsc2UgaWYgKHN0YXR1cyA9PT0gJ2ZpbGxlZCcpIHtcbiAgICAgICAgICAgIHN0YXR1cyA9ICdjbG9zZWQnO1xuICAgICAgICB9XG4gICAgICAgIGxldCBpZCA9IG9yZGVyWydjbGllbnRPcmRlcklkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlJyk7XG4gICAgICAgIGlmICh0eXBlb2YgcHJpY2UgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5vcmRlcnMpXG4gICAgICAgICAgICAgICAgcHJpY2UgPSB0aGlzLm9yZGVyc1tpZF1bJ3ByaWNlJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgYW1vdW50ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBmaWxsZWQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcHJpY2UgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvc3QgPSBmaWxsZWQgKiBwcmljZTtcbiAgICAgICAgIC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b3VudCwgYWRkcmVzcywgdGFnID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICB0aGlzLmNoZWNrQWRkcmVzcyAoYWRkcmVzcyk7XG4gICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY3VycmVuY3kgKGNvZGUpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5WydpZCddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHBhcnNlRmxvYXQgKGFtb3VudCksXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0YWcpXG4gICAgICAgICAgICByZXF1ZXN0WydwYXltZW50SWQnXSA9IHRhZztcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEFjY291bnRDcnlwdG9XaXRoZHJhdyAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9ICcvYXBpJyArICcvJyArIHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IGFwaSArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgdXJsICs9IHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdHRVQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IHRoaXMuZW5jb2RlICh0aGlzLmFwaUtleSArICc6JyArIHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gdGhpcy5zdHJpbmdUb0Jhc2U2NCAocGF5bG9hZCk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBdXRob3JpemF0aW9uJzogJ0Jhc2ljICcgKyB0aGlzLmRlY29kZSAoYXV0aCksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHVybDtcbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBib2R5ICE9PSAnc3RyaW5nJylcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgaWYgKGNvZGUgPj0gNDAwKSB7XG4gICAgICAgICAgICBjb25zdCBmZWVkYmFjayA9IHRoaXMuaWQgKyAnICcgKyBib2R5O1xuICAgICAgICAgICAgLy8ge1wiY29kZVwiOjUwNCxcIm1lc3NhZ2VcIjpcIkdhdGV3YXkgVGltZW91dFwiLFwiZGVzY3JpcHRpb25cIjpcIlwifVxuICAgICAgICAgICAgaWYgKChjb2RlID09PSA1MDMpIHx8IChjb2RlID09PSA1MDQpKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZU5vdEF2YWlsYWJsZSAoZmVlZGJhY2spO1xuICAgICAgICAgICAgaWYgKGJvZHlbMF0gPT09ICd7Jykge1xuICAgICAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2VbJ2Vycm9yJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gcmVzcG9uc2VbJ2Vycm9yJ11bJ21lc3NhZ2UnXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlID09PSAnT3JkZXIgbm90IGZvdW5kJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyBvcmRlciBub3QgZm91bmQgaW4gYWN0aXZlIG9yZGVycycpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnUXVhbnRpdHkgbm90IGEgdmFsaWQgbnVtYmVyJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ0luc3VmZmljaWVudCBmdW5kcycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ0R1cGxpY2F0ZSBjbGllbnRPcmRlcklkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yIChmZWVkYmFjayk7XG4gICAgICAgIH1cbiAgICB9XG59O1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbmNvbnN0IEV4Y2hhbmdlID0gcmVxdWlyZSAoJy4vYmFzZS9FeGNoYW5nZScpO1xuY29uc3QgeyBFeGNoYW5nZUVycm9yIH0gPSByZXF1aXJlICgnLi9iYXNlL2Vycm9ycycpO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgaHVvYmkgZXh0ZW5kcyBFeGNoYW5nZSB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2h1b2JpJyxcbiAgICAgICAgICAgICduYW1lJzogJ0h1b2JpJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQ04nLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDIwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MycsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcwMDEnLFxuICAgICAgICAgICAgICAgICc1bSc6ICcwMDUnLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMDE1JyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzAzMCcsXG4gICAgICAgICAgICAgICAgJzFoJzogJzA2MCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzEwMCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzIwMCcsXG4gICAgICAgICAgICAgICAgJzFNJzogJzMwMCcsXG4gICAgICAgICAgICAgICAgJzF5JzogJzQwMCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjU2OS0xNWFhN2I5YS01ZWRkLTExZTctOWU3Zi00NDc5MWY0ZWU0OWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHA6Ly9hcGkuaHVvYmkuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lmh1b2JpLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vaHVvYmlhcGkvQVBJX0RvY3NfZW4vd2lraScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnc3RhdGljbWFya2V0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH1fa2xpbmVfe3BlcmlvZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcl97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aF97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aF97aWR9X3tsZW5ndGh9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXRhaWxfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndXNkbWFya2V0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH1fa2xpbmVfe3BlcmlvZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcl97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aF97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aF97aWR9X3tsZW5ndGh9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXRhaWxfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndHJhZGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9hY2NvdW50X2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5X21hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbF9tYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X25ld19kZWFsX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X29yZGVyX2lkX2J5X3RyYWRlX2lkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19jb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfd2l0aGRyYXdfY29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X3dpdGhkcmF3X2NvaW5fcmVzdWx0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVwYXltZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfbG9hbl9hdmFpbGFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9sb2FucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0c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9sKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9IG1hcmtldFsndHlwZSddICsgJ0dldERlcHRoSWQnO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAoeyAnaWQnOiBtYXJrZXRbJ2lkJ10gfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2spO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9IG1hcmtldFsndHlwZSddICsgJ0dldFRpY2tlcklkJztcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IHJlc3BvbnNlWyd0aWNrZXInXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChyZXNwb25zZVsndGltZSddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2J1eScpLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ29wZW4nKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndHMnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0Wydz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gICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVHJhZGluZ0xpbWl0cyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW1pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtaW4nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICc2MG1pbicsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFkYXknLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxd2VlaycsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFtb24nLFxuICAgICAgICAgICAgICAgICcxeSc6ICcxeWVhcicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjU2OS0xNWFhN2I5YS01ZWRkLTExZTctOWU3Zi00NDc5MWY0ZWU0OWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmh1b2JpcHJvLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5odW9iaXByby5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2h1b2JpYXBpL0FQSV9Eb2NzL3dpa2kvUkVTVF9hcGlfcmVmZXJlbmNlJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5odW9iaXByby5jb20vYWJvdXQvZmVlLycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnbWFya2V0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3Rvcnkva2xpbmUnLCAvLyDojrflj5ZL57q/5pWw5o2uXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsL21lcmdlZCcsIC8vIOiOt+WPluiBmuWQiOihjOaDhShUaWNrZXIpXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLCAvLyDojrflj5YgTWFya2V0IERlcHRoIOaVsOaNrlxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJywgLy8g6I635Y+WIFRyYWRlIERldGFpbCDmlbDmja5cbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L3RyYWRlJywgLy8g5om56YeP6I635Y+W5pyA6L+R55qE5Lqk5piT6K6w5b2VXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsJywgLy8g6I635Y+WIE1hcmtldCBEZXRhaWwgMjTlsI/ml7bmiJDkuqTph4/mlbDmja5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL3N5bWJvbHMnLCAvLyDmn6Xor6Lns7vnu5/mlK/mjIHnmoTmiYDmnInkuqTmmJPlr7lcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb21tb24vY3VycmVuY3lzJywgLy8g5p+l6K+i57O757uf5pSv5oyB55qE5omA5pyJ5biB56eNXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL3RpbWVzdGFtcCcsIC8vIOafpeivouezu+e7n+W9k+WJjeaXtumXtFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbW1vbi9leGNoYW5nZScsIC8vIG9yZGVyIGxpbWl0c1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3NldHRpbmdzL2N1cnJlbmN5cycsIC8vID9sYW5ndWFnZT1lbi1VU1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9hY2NvdW50cycsIC8vIOafpeivouW9k+WJjeeUqOaIt+eahOaJgOaciei0puaItyjljbNhY2NvdW50LWlkKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvYWNjb3VudHMve2lkfS9iYWxhbmNlJywgLy8g5p+l6K+i5oyH5a6a6LSm5oi355qE5L2Z6aKdXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL3tpZH0nLCAvLyDmn6Xor6Lmn5DkuKrorqLljZXor6bmg4VcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMve2lkfS9tYXRjaHJlc3VsdHMnLCAvLyDmn6Xor6Lmn5DkuKrorqLljZXnmoTmiJDkuqTmmI7nu4ZcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMnLCAvLyDmn6Xor6LlvZPliY3lp5TmiZjjgIHljoblj7Llp5TmiZhcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9tYXRjaHJlc3VsdHMnLCAvLyDmn6Xor6LlvZPliY3miJDkuqTjgIHljoblj7LmiJDkuqRcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy93aXRoZHJhdy12aXJ0dWFsL2FkZHJlc3NlcycsIC8vIOafpeivouiZmuaLn+W4geaPkOeOsOWcsOWdgFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L2RlcG9zaXQtdmlydHVhbC9hZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1ZXJ5L2RlcG9zaXQtd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbi9sb2FuLW9yZGVycycsIC8vIOWAn+i0t+iuouWNlVxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbi9hY2NvdW50cy9iYWxhbmNlJywgLy8g5YCf6LS36LSm5oi36K+m5oOFXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy9wbGFjZScsIC8vIOWIm+W7uuW5tuaJp+ihjOS4gOS4quaWsOiuouWNlSAo5LiA5q2l5LiL5Y2V77yMIOaOqOiNkOS9v+eUqClcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMnLCAvLyDliJvlu7rkuIDkuKrmlrDnmoTorqLljZXor7fmsYIg77yI5LuF5Yib5bu66K6i5Y2V77yM5LiN5omn6KGM5LiL5Y2V77yJXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL3tpZH0vcGxhY2UnLCAvLyDmiafooYzkuIDkuKrorqLljZUg77yI5LuF5omn6KGM5bey5Yib5bu655qE6K6i5Y2V77yJXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL3tpZH0vc3VibWl0Y2FuY2VsJywgLy8g55Sz6K+35pKk6ZSA5LiA5Liq6K6i5Y2V6K+35rGCXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL2JhdGNoY2FuY2VsJywgLy8g5om56YeP5pKk6ZSA6K6i5Y2VXG4gICAgICAgICAgICAgICAgICAgICAgICAnZHcvYmFsYW5jZS90cmFuc2ZlcicsIC8vIOi1hOS6p+WIkui9rFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3L2FwaS9jcmVhdGUnLCAvLyDnlLPor7fmj5DnjrDomZrmi5/luIFcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy93aXRoZHJhdy12aXJ0dWFsL2NyZWF0ZScsIC8vIOeUs+ivt+aPkOeOsOiZmuaLn+W4gVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwve2lkfS9wbGFjZScsIC8vIOehruiupOeUs+ivt+iZmuaLn+W4geaPkOeOsFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwve2lkfS9jYW5jZWwnLCAvLyDnlLPor7flj5bmtojmj5DnjrDomZrmi5/luIFcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy90cmFuc2Zlci1pbi9tYXJnaW4nLCAvLyDnjrDotKfotKbmiLfliJLlhaXoh7PlgJ/otLfotKbmiLdcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy90cmFuc2Zlci1vdXQvbWFyZ2luJywgLy8g5YCf6LS36LSm5oi35YiS5Ye66Iez546w6LSn6LSm5oi3XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luL29yZGVycycsIC8vIOeUs+ivt+WAn+i0t1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbi9vcmRlcnMve2lkfS9yZXBheScsIC8vIOW9kui/mOWAn+i0t1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZXhjZXB0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAnYWNjb3VudC1mcm96ZW4tYmFsYW5jZS1pbnN1ZmZpY2llbnQtZXJyb3InOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8ge1wic3RhdHVzXCI6XCJlcnJvclwiLFwiZXJyLWNvZGVcIjpcImFjY291bnQtZnJvemVuLWJhbGFuY2UtaW5zdWZmaWNpZW50LWVycm9yXCIsXCJlcnItbXNnXCI6XCJ0cmFkZSBhY2NvdW50IGJhbGFuY2UgaXMgbm90IGVub3VnaCwgbGVmdDogYDAuMDAyN2BcIixcImRhdGFcIjpudWxsfVxuICAgICAgICAgICAgICAgICdvcmRlci1saW1pdG9yZGVyLWFtb3VudC1taW4tZXJyb3InOiBJbnZhbGlkT3JkZXIsIC8vIGxpbWl0IG9yZGVyIGFtb3VudCBlcnJvciwgbWluOiBgMC4wMDFgXG4gICAgICAgICAgICAgICAgJ29yZGVyLW9yZGVyc3RhdGUtZXJyb3InOiBPcmRlck5vdEZvdW5kLCAvLyBjYW5jZWxpbmcgYW4gYWxyZWFkeSBjYW5jZWxlZCBvcmRlclxuICAgICAgICAgICAgICAgICdvcmRlci1xdWVyeW9yZGVyLWludmFsaWQnOiBPcmRlck5vdEZvdW5kLCAvLyBxdWVyeWluZyBhIG5vbi1leGlzdGVudCBvcmRlclxuICAgICAgICAgICAgICAgICdvcmRlci11cGRhdGUtZXJyb3InOiBFeGNoYW5nZU5vdEF2YWlsYWJsZSwgLy8gdW5kb2N1bWVudGVkIGVycm9yXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ29wdGlvbnMnOiB7XG4gICAgICAgICAgIC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biAgICB9XG5cbiAgICBwYXJzZVRyYWRpbmdMaW1pdHMgKHJlc3BvbnNlLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBkYXRhID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgaWYgKHR5cGVvZiBkYXRhID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAnbWluJzogZGF0YVsnbGltaXQtb3JkZXItbXVzdC1ncmVhdGVyLXRoYW4nXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogZGF0YVsnbGltaXQtb3JkZXItbXVzdC1sZXNzLXRoYW4nXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1ldGhvZCA9IHRoaXMub3B0aW9uc1snZmV0Y2hNYXJrZXRzTWV0aG9kJ107XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgbnVtTWFya2V0cyA9IG1hcmtldHMubGVuZ3RoO1xuICAgICAgICBpZiAobnVtTWFya2V0cyA8IDEpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcHVibGljR2V0Q29tbW9uU3ltYm9scyByZXR1cm5lZCBlbXB0eSByZXNwb25zZTogJyArIHRoaXMuanNvbiAobWFya2V0cykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydiYXNlLWN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsncXVvdGUtY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gYmFzZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBpZCA9IGJhc2VJZCArIHF1b3RlSWQ7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYW1vdW50LXByZWNpc2lvbiddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsncHJpY2UtcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gKGJhc2UgPT09ICdPTUcnKSA/IDAgOiAwLjIgLyAxMDA7XG4gICAgICAgICAgICBsZXQgdGFrZXIgPSAoYmFzZSA9PT0gJ09NRycpID8gMCA6IDAuMiAvIDEwMDtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGlmICgndHMnIGluIHRpY2tlcilcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRpY2tlclsndHMnXTtcbiAgICAgICAgbGV0IGJpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGFzayA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGJpZFZvbHVtZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGFza1ZvbHVtZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdiaWQnIGluIHRpY2tlcikge1xuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkgKHRpY2tlclsnYmlkJ10pKSB7XG4gICAgICAgICAgICAgICAgYmlkID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlclsnYmlkJ10sIDApO1xuICAgICAgICAgICAgICAgIGJpZFZvbHVtZSA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXJbJ2JpZCddLCAxKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoJ2FzaycgaW4gdGlja2VyKSB7XG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheSAodGlja2VyWydhc2snXSkpIHtcbiAgICAgICAgICAgICAgICBhc2sgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyWydhc2snXSwgMCk7XG4gICAgICAgICAgICAgICAgYXNrVm9sdW1lID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlclsnYXNrJ10sIDEpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBvcGVuID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ29wZW4nKTtcb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cHRoICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0eXBlJzogJ3N0ZXAwJyxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGlmICgndGljaycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmICghcmVzcG9uc2VbJ3RpY2snXSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaE9yZGVyQm9vaygpIHJldHVybmVkIGVtcHR5IHJlc3BvbnNlOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG9yZGVyYm9vayA9IHJlc3BvbnNlWyd0aWNrJ107XG4gICAgICAgICAgICBsZXQgdGltZXN0YW1wID0gb3JkZXJib29rWyd0cyddO1xuICAgICAgICAgICAgb3JkZXJib29rWydub25jZSddID0gb3JkZXJib29rWyd2ZXJzaW9uJ107XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB0aW1lc3RhbXApO1xuICAgICAgICB9XG4gICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaE9yZGVyQm9vaygpIHJldHVybmVkIHVucmVjb2duaXplZCByZXNwb25zZTogJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMubWFya2V0R2V0RGV0YWlsTWVyZ2VkICh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4gICAgICAgICAgICBvaGxjdlsnb3BlbiddLFxuICAgICAgICAgICAgb2hsY3ZbJ2hpZ2gnXSxcbiAgICAgICAgICAgIG9obGN2Wydsb3cnXSxcbiAgICAgICAgICAgIG9obGN2WydjbG9zZSddLFxuICAgICAgICAgICAgb2hsY3ZbJ2Ftb3VudCddLFxuICAgICAgICBdO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT0hMQ1YgKHN5bWJvbCwgdGltZWZyYW1lID0gJzFtJywgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gMTAwMCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAncGVyaW9kJzogdGhpcy50aW1lZnJhbWVzW3RpbWVmcmFtZV0sXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlb2YgbGltaXQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICByZXF1ZXN0WydzaXplJ10gPSBsaW1pdDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLm1hcmtldEdldEhpc3RvcnlLbGluZSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9ITENWcyAocmVzcG9uc2VbJ2RhdGEnXSwgbWFya2V0LCB0aW1lZnJhbWUsIHNpbmNlLCBsaW1pdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgbG9hZEFjY291bnRzIChyZWxvYWQgPSBmYWxzZSkge1xuICAgICAgICBpZiAocmVsb2FkKSB7XG4gICAgICAgICAgICB0aGlzLmFjY291bnRzID0gYXdhaXQgdGhpcy5mZXRjaEFjY291bnRzICgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKHRoaXMuYWNjb3VudHMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5hY2NvdW50cztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5hY2NvdW50cyA9IGF3YWl0IHRoaXMuZmV0Y2hBY2NvdW50cyAoKTtcbiAgICAgICAgICAgICAgICB0aGlzLmFjY291bnRzQnlJZCA9IHRoaXMuaW5kZXhCeSAodGhpcy5hY2NvdW50cywgJ2lkJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMuYWNjb3VudHM7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hBY2NvdW50cyAoKSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRBY2NvdW50cyAoKTtcbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlWydkYXRhJ107XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hDdXJyZW5jaWVzIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFNldHRpbmdzQ3VycmVuY3lzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2xhbmd1YWdlJzogdGhpcy5vcHRpb25zWydsYW5ndWFnZSddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAvLyAgeyAgICAgICAgICAgICAgICAgICAgIG5hbWU6IFwiY3R4Y1wiLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgICdkaXNwbGF5LW5hbWUnOiBcIkNUWENcIixcbiAgICAgICAgICAgIC8vICAgICAgICAnd2l0aGRyYXctcHJlY2lzaW9uJzogIDgsXG4gICAgICAgICAgICAvLyAgICAgICAgICAgICAnY3VycmVuY3ktdHlwZSc6IFwiZXRoXCIsXG4gICAgICAgICAgICAvLyAgICAgICAgJ2N1cnJlbmN5LXBhcnRpdGlvbic6IFwicHJvXCIsXG4gICAgICAgICAgICAvLyAgICAgICAgICAgICAnc3VwcG9ydC1zaXRlcyc6ICBudWxsLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgJ290Yy1lbmFibGUnOiAgMCxcbiAgICAgICAgICAgIC8vICAgICAgICAnZGVwb3NpdC1taW4tYW1vdW50JzogXCIyXCIsXG4gICAgICAgICAgICAvLyAgICAgICAnd2l0aGRyYXctbWluLWFtb3VudCc6IFwiNFwiLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAnc2hvdy1wcmVjaXNpb24nOiBcIjhcIixcbiAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgIHdlaWdodDogXCIyOTg4XCIsXG4gICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgIHZpc2libGU6ICB0cnVlLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgICdkZXBvc2l0LWRlc2MnOiBcIlBsZWFzZSBkb27igJl0IGRlcG9zaXQgYW55IG90aGVyIGRpZ2l0YWwgYXNzZXRzIGV4Y2VwdCBDVFhDIHTigKZcIixcbiAgICAgICAgICAgIC8vICAgICAgICAgICAgICd3aXRoZHJhdy1kZXNjJzogXCJNaW5pbXVtIHdpdGhkcmF3YWwgYW1vdW50OiA0IENUWEMuICE+XzwhRm9yIHNlY3VyaXR5IHJlYXNvbuKAplwiLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICdkZXBvc2l0LWVuYWJsZWQnOiAgdHJ1ZSxcbiAgICAgICAgICAgIC8vICAgICAgICAgICd3aXRoZHJhdy1lbmFibGVkJzogIHRydWUsXG4gICAgICAgICAgICAvLyAgICAnY3VycmVuY3ktYWRkci13aXRoLXRhZyc6ICBmYWxzZSxcbiAgICAgICAgICAgIC8vICAgICAgICAgICAgICdmYXN0LWNvbmZpcm1zJzogIDE1LFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgJ3NhZmUtY29uZmlybXMnOiAgMzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy9cbiAgICAgICAgICAgIGxldCBpZCA9IHRoaXMuc2FmZVZhbHVlIChjdXJyZW5jeSwgJ25hbWUnKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB0aGlzLnNhZmVJbnRlZ2VyIChjdXJyZW5jeSwgJ3dpdGhkcmF3LXByZWNpc2lvbicpO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQudG9VcHBlckNhc2UgKCkpO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IGN1cnJlbmN5Wyd2aXNpYmxlJ10gJiYgY3VycmVuY3lbJ2RlcG9zaXQtZW5hYmxlZCddICYmIGN1cnJlbmN5Wyd3aXRoZHJhdy1lbmFibGVkJ107XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICd0eXBlJzogJ2NyeXB0bycsXG4gICAgICAgICAgICAgICAgLy8gJ3BheWluJzogY3VycmVuY3lbJ2RlcG9zaXQtZW5hYmxlZCddLFxuICAgICAgICAgICAgICAgIC8vICdwYXlvdXQnOiBjdXJyZW5jeVsnd2l0aGRyYXctZW5hYmxlZCddLFxuICAgICAgICAgICAgICAgIC8vICd0cmFuc2Zlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WydkaXNwbGF5LW5hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiBhY3RpdmUgPyAnb2snIDogJ2Rpc2FibGVkJyxcbiAgICAgICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLCAvLyB0b2RvIG5lZWQgdG8gZmV0Y2ggZnJvbSBmZWUgZW5kcG9pbnRcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAnZGVwb3NpdC1taW4tYW1vdW50JyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAnd2l0aGRyYXctbWluLWFtb3VudCcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRBY2NvdW50cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudEFjY291bnRzSWRCYWxhbmNlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogdGhpcy5hY2NvdW50c1swXVsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydkYXRhJ11bJ2xpc3QnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuIC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yZGVyWydzeW1ib2wnXSBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IG1hcmtldElkID0gb3JkZXJbJ3N5bWJvbCddO1xuICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbbWFya2V0SWRdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IG9yZGVyWydjcmVhdGVkLWF0J107XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdhbW91bnQnKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHBhcnNlRmxvYXQgKG9yZGVyWydmaWVsZC1hbW91bnQnXSk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSBhbW91bnQgLSBmaWxsZWQ7XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlJyk7XG4gICAgICAgIGxldCBjb3N0ID0gcGFyc2VGbG9hdCAob3JkZXJbJ2ZpZWxkLWNhc2gtYW1vdW50J10pO1xuICAgICAgICBsZXQgYXZlcmFnZSA9IDA7XG4gICAgICAgIGlmIChmaWxsZWQpXG4gICAgICAgICAgICBhdmVyYWdlID0gcGFyc2VGbG9hdCAoY29zdCAvIGZpbGxlZCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZEFjY291bnRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdhY2NvdW50LWlkJzogdGhpcy5hY2NvdW50c1swXVsnaWQnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlICsgJy0nICsgdHlwZSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHR5cGUgPT09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlck9yZGVyc1BsYWNlICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ2RhdGEnXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjb3N0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2V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ICdiYXNlNjQnKTtcbiAgICAgICAgICAgIGF1dGggKz0gJyYnICsgdGhpcy51cmxlbmNvZGUgKHsgJ1NpZ25hdHVyZSc6IHNpZ25hdHVyZSB9KTtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyBhdXRoO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ1BPU1QnKSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgdXJsO1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoaHR0cENvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBib2R5ICE9PSAnc3RyaW5nJylcbiAgICAgICAgICAgIHJldHVybjsgLy8gZmFsbGJhY2sgdG8gZGVmYXVsdCBlcnJvciBoYW5kbGVyXG4gICAgICAgIGlmIChib2R5Lmxlbmd0aCA8IDIpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoKGJvZHlbMF0gPT09ICd7JykgfHwgKGJvZHlbMF0gPT09ICdbJykpIHtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgaWYgKCdzdGF0dXMnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICAvLyAgICAge1wic3RhdHVzXCI6XCJlcnJvclwiLFwiZXJyLWNvZGVcIjpcIm9yZGVyLWxpbWl0b3JkZXItYW1vdW50LW1pbi1lcnJvclwiLFwiZXJyLW1zZ1wiOlwibGltaXQgb3JkZXIgYW1vdW50IGVycm9yLCBtaW46IGAwLjAwMWBcIixcImRhdGFcIjpudWxsfVxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgbGV0IHN0YXR1cyA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdzdGF0dXMnKTtcbiAgICAgICAgICAgICAgICBpZiAoc3RhdHVzID09PSAnZXJyb3InKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnZXJyLWNvZGUnKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZmVlZGJhY2sgPSB0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGV4Y2VwdGlvbnMgPSB0aGlzLmV4Y2VwdGlvbnM7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb2RlIGluIGV4Y2VwdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgIC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ICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM4MDEyMTc2LTExNjE2YzMyLTMyNjktMTFlOC05ZjA1LWU2NWNmODg1YmIxNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9pY2UzeC5jb20vYXBpL3YxJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9pY2UzeC5jb20nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9pY2UzeC5jby56YScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vaWNlM3guY28uemEvaWNlLWN1YmVkLWJpdGNvaW4tZXhjaGFuZ2UtYXBpLWRvY3VtZW50YXRpb24tMS1qdW5lLTIwMTcnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9oZWxwLmljZTMuY29tL3N1cHBvcnQvc29sdXRpb25zL2FydGljbGVzLzExMDAwMDMzMjkzLXRyYWRpbmctZmVlcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2hlbHAuaWNlMy5jb20vc3VwcG9ydC9zb2x1dGlvbnMvYXJ0aWNsZXMvMTEwMDAwMzMyODgtZmVlcy1leHBsYWluZWQnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9oZWxwLmljZTMuY29tL3N1cHBvcnQvc29sdXRpb25zL2FydGljbGVzLzExMDAwMDA4MTMxLXdoYXQtYXJlLXlvdXItZmlhdC1kZXBvc2l0LWFuZC13aXRoZHJhd2FsLWZlZXMtJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vaGVscC5pY2UzLmNvbS9zdXBwb3J0L3NvbHV0aW9ucy9hcnRpY2xlcy8xMTAwMDAzMzI4OS1kZXBvc2l0LWZlZXMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L2xpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXIvbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpci9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0cy9tYXJrZXRkZXB0aGZ1bGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzL21hcmtldGRlcHRoYnRjYXYnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzL21hcmtldGRlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2svaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZS9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbi9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbi9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnZvaWNlL2xpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ludm9pY2UvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW52b2ljZS9wZGYnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDEsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY3lMaXN0IChwYXJhbXMpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IHJlc3BvbnNlWydyZXNwb25zZSddWydlbnRpdGllcyddO1xuICAgICAgICBsZXQgcHJlY2lzaW9uID0gdGhpcy5wcmVjaXNpb25bJ2Ftb3VudCddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmN5WydjdXJyZW5jeV9pZCddO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3lbJ2lzbyddLnRvVXBwZXJDYXNlICgpKTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGlmICghT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcykubGVuZ3RoKSB7XG4gICAgICAgICAgICB0aGlzLmN1cnJlbmNpZXMgPSBhd2FpdCB0aGlzLmZldGNoQ3VycmVuY2llcyAoKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmN1cnJlbmNpZXNfYnlfaWQgPSB0aGlzLmluZGV4QnkgKHRoaXMuY3VycmVuY2llcywgJ2lkJyk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0UGFpckxpc3QgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3Jlc3BvbnNlJ11bJ2VudGl0aWVzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQ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MTAwMDtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3ZvbHVtZScpO1xuICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGNvc3QgPSBwYXJzZUZsb2F0ICh0aGlzLmNvc3RUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSAqIGFtb3VudCkpO1xuICAgICAgICBsZXQgZmVlID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnZmVlJyk7XG4gICAgICAgIGlmIChmZWUpIHtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IGZlZSxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ3F1b3RlJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0cmFkZV9pZCcpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsndHlwZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbiAgICAgICAgICAgICdpb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vcmRlciwgJ3ByaWNlJyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICd2b2x1bWUnKTtcbiAgICAgICAgbGV0IHN0YXR1cyA9IHRoaXMuc2FmZUludGVnZXIgKG9yZGVyLCAnYWN0aXZlJyk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdyZW1haW5pbmcnKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHN0YXR1cyA9PT0gMSkge1xuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgICAgICByZW1haW5pbmcgPSAwO1xuICAgICAgICAgICAgZmlsbGVkID0gYW1vdW50O1xuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdmZWUnKTtcbiAgICAgICAgaWYgKGZlZSkge1xuICAgICAgICAgICAgZmVlID0geyAnY29zdCc6IGZlZSB9O1xuICAgICAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgICAgICBmZWVbJ2N1cnJlbmN5J10gPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdvcmRlcl9pZCcpLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAndHJhZGVzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0T3JkZXJOZXcgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcl9pZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlciA9IHRoaXMucGFyc2VPcmRlciAoe1xuICAgICAgICAgICAgJ29yZGVyX2lkJzogcmVzcG9uc2VbJ3Jlc3BvbnNlJ11bJ2VudGl0eSddWydvcmRlcl9pZCddLFxuICA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Ht9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHBhcmFtcyA9IHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICAgICAgaWYgKHBhcmFtcy5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHBhcmFtcztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdub25jZSc6IHRoaXMubm9uY2UgKCksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGJvZHkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGxldCBlcnJvcnMgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2UsICdlcnJvcnMnKTtcbiAgICAgICAgbGV0IGRhdGEgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2UsICdyZXNwb25zZScpO1xuICAgICAgICBpZiAoZXJyb3JzIHx8ICFkYXRhKSB7XG4gICAgICAgICAgICBsZXQgYXV0aEVycm9yS2V5cyA9IFsgJ0tleScsICd1c2VyX2lkJywgJ1NpZ24nIF07XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGF1dGhFcnJvcktleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgZXJyb3JLZXkgPSBhdXRoRXJyb3JLZXlzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBlcnJvck1lc3NhZ2UgPSB0aGlzLnNhZmVTdHJpbmcgKGVycm9ycywgZXJyb3JLZXkpO1xuICAgICAgICAgICAgICAgIGlmICghZXJyb3JNZXNzYWdlKVxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICBpZiAoZXJyb3JLZXkgPT09ICd1c2VyX2lkJyAmJiBlcnJvck1lc3NhZ2UuaW5kZXhPZiAoJ2F1dGhvcml6YXRpb24nKSA8IDApXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yIChlcnJvck1lc3NhZ2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuanNvbiAoZXJyb3JzK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biAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmluZGVwZW5kZW50cmVzZXJ2ZS5jb20vUHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkuaW5kZXBlbmRlbnRyZXNlcnZlLmNvbS9Qcml2YXRlJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaW5kZXBlbmRlbnRyZXNlcnZlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5pbmRlcGVuZGVudHJlc2VydmUuY29tL0FQSScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkUHJpbWFyeUN1cnJlbmN5Q29kZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkU2Vjb25kYXJ5Q3VycmVuY3lDb2RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRMaW1pdE9yZGVyVHlwZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkTWFya2V0T3JkZXJUeXBlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRPcmRlclR5cGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRWYWxpZFRyYW5zYWN0aW9uVHlwZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldFN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9yZGVyQm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVIaXN0b3J5U3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0UmVjZW50VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRGeFJhdGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdQbGFjZUxpbWl0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BsYWNlTWFya2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRDbG9zZWRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldENsb3NlZEZpbGxlZE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3JkZXJEZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRBY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREaWdpdGFsQ3VycmVuY3lEZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0RGlnaXRhbEN1cnJlbmN5RGVwb3NpdEFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3luY2hEaWdpdGFsQ3VycmVuY3lEZXBvc2l0QWRkcmVzc1dpdGhCbG9ja2NoYWluJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0RpZ2l0YWxDdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVxdWVzdEZpYXRXaXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC41IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IGJhc2VDdXJyZW5jaWVzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRHZXRWYWxpZFByaW1hcnlDdXJyZW5jeUNvZGVzICgpO1xuICAgICAgICBsZXQgcXVvdGVDdXJyZW5jaWVzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRHZXRWYWxpZFNlY29uZGFyeUN1cnJlbmN5Q29kZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYXNlQ3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGJhc2VDdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGJhc2VJZFVwcGVyY2FzZSA9IGJhc2VJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZFVwcGVyY2FzZSk7XG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IHF1b3RlQ3VycmVuY2llcy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZUlkID0gcXVvdGVDdXJyZW5jaWVzW2pdO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZUlkVXBwZXJjYXNlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZFVwcGVyY2FzZSk7XG4gICAgICAgICAgICAgICAgbGV0IGlkID0gYmFzZUlkICsgJy8nICsgcXVvdGVJZDtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogaWQsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRBY2NvdW50cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcy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0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGZlZUN1cnJlbmN5ID0gbWFya2V0WydiYXNlJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZlZSA9IHtcbiAgICAgICAgICAgICdyYXRlJzogZmVlUmF0ZSxcbiAgICAgICAgICAgICdjb3N0JzogZmVlQ29zdCxcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGZlZUN1cnJlbmN5LFxuICAgICAgICB9O1xuICAgICAgICBsZXQgaWQgPSBvcmRlclsnT3JkZXJHdWlkJ107XG4gICAgICAgIGxldCBzdGF0dXMgPSB0aGlzLnBhcnNlT3JkZXJTdGF0dXMgKG9yZGVyWydTdGF0dXMnXSk7XG4gICAgICAgIGxldCBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnVmFsdWUnKTtcbiAgICAgICAgbGV0IGF2ZXJhZ2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdBdmdQcmljZScpO1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdQcmljZScsIGF2ZXJhZ2UpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhdmVyYW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Ygc2lkZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmIChzaWRlLmluZGV4T2YgKCdCaWQnKSA+PSAwKVxuICAgICAgICAgICAgICAgIHNpZGUgPSAnYnV5JztcbiAgICAgICAgICAgIGVsc2UgaWYgKHNpZGUuaW5kZXhPZiAoJ09mZmVyJykgPj0gMClcbiAgICAgICAgICAgICAgICBzaWRlID0gJ3NlbGwnO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVySWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0R2V0UmVjZW50VHJhZGVzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3ByaW1hcnlDdXJyZW5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WlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IFtcbiAgICAgICAgICAgICAgICB1cmwsXG4gICAgICAgICAgICAgICAgJ2FwaUtleT0nICsgdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlPScgKyBub25jZS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgIF07XG4gICAgICAgICAgICAvLyByZW1vdmUgdGhpcyBjcmFwXG4gICAgICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChwYXJhbXMpO1xuICAgICAgICAgICAgbGV0IHBheWxvYWQgPSBbXTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBrZXkgPSBrZXlzW2ldO1xuICAgICAgICAgICAgICAgIHBheWxvYWQucHVzaCAoa2V5ICsgJz0nICsgcGFyYW1zW2tleV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYXV0aCA9IHRoaXMuYXJyYXlDb25jYXQgKGF1dGgsIHBheWxvYWQpO1xuICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSBhdXRoLmpvaW4gKCcsJyk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAobWVzc2FnZSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAoe1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnc2lnbmF0dXJlJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBoZWFkZXJzID0geyAnQ29udGVudC1UeXBl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WxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndmVyc2lvbic6ICcxLjcnLCAvLyBhcyBvZiA2IE5vdmVtYmVyIDIwMTdcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzc0NDMyODMtMmZkZGQwZTQtMjgxYy0xMWU4LTk3NDEtYjRmMTQxOTAwMWI1LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3ZpcC5iaXRjb2luLmNvLmlkL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vdmlwLmJpdGNvaW4uY28uaWQvdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmluZG9kYXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vaW5kb2RheC5jb20vZG93bmxvYWRzL0JJVENPSU5DT0lELUFQSS1ET0NVTUVOVEFUSU9OLnBkZicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVySGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdDb2luJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvSURSJzogeyAnaWQnOiAnYnRjX2lkcicsICdzeW1ib2wnOiAnQlRDL0lEUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdJRFInLCAnYmFzZUlkJzogJ2J0YycsICdxdW90ZUlkJzogJ2lkcicsIC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Cc6ICdidGMnLCAncHJlY2lzaW9uJzogeyAnYW1vdW50JzogOCwgJ3ByaWNlJzogOCB9LCAnbGltaXRzJzogeyAnYW1vdW50JzogeyAnbWluJzogMSwgJ21heCc6IHVuZGVmaW5lZCB9fX0sXG4gICAgICAgICAgICAgICAgJ1hSUC9CVEMnOiB7ICdpZCc6ICd4cnBfYnRjJywgJ3N5bWJvbCc6ICdYUlAvQlRDJywgJ2Jhc2UnOiAnWFJQJywgJ3F1b3RlJzogJ0JUQycsICdiYXNlSWQnOiAneHJwJywgJ3F1b3RlSWQnOiAnYnRjJywgJ3ByZWNpc2lvbic6IHsgJ2Ftb3VudCc6IDgsICdwcmljZSc6IDggfSwgJ2xpbWl0cyc6IHsgJ2Ftb3VudCc6IHsgJ21pbic6IDAuMDEsICdtYXgnOiB1bmRlZmluZWQgfX19LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDMsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ3JldHVybiddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2UgfTtcbiAgICAg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ICAgICBzaWRlID0gb3JkZXJbJ3R5cGUnXTtcbiAgICAgICAgbGV0IHN0YXR1cyA9IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdzdGF0dXMnLCAnb3BlbicpO1xuICAgICAgICBpZiAoc3RhdHVzID09PSAnZmlsbGVkJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09PSAnY2FsY2VsbGVkJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2NhbmNlbGVkJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gbWFya2V0WydxdW90ZUlkJ107XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydiYXNlSWQnXTtcbiAgICAgICAgICAgIGlmICgobWFya2V0WydxdW90ZUlkJ10gPT09ICdpZHInKSAmJiAoJ29yZGVyX3JwJyBpbiBvcmRlcikpXG4gICAgICAgICAgICAgICAgcXVvdGVJZCA9ICdycCc7XG4gICAgICAgICAgICBpZiAoKG1hcmtldFsnYmFzZUlkJ10gPT09ICdpZHInKSAmJiAoJ3JlbWFpbl9ycCcgaW4gb3JkZXIpKVxuICAgICAgICAgICAgICAgIGJhc2VJZCA9ICdycCc7XG4gICAgICAgICAgICBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnb3JkZXJfJyArIHF1b3RlSWQpO1xuICAgICAgICAgICAgaWYgKGNvc3QpIHtcbiAgICAgICAgICAgICAgICBhbW91bnQgPSBjb3N0IC8gcHJpY2U7XG4gICAgICAgICAgICAgICAgbGV0IHJlbWFpbmluZ0Nvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdyZW1haW5fJyArIHF1b3RlSWQpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVtYWluaW5nQ29zdCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVtYWluaW5nID0gcmVtYWluaW5nQ29zdCAvIHByaWNlO1xuICAgICAgICAgICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdvcmRlcl8nICsgYmFzZUlkKTtcbiAgICAgICAgICAgICAgICBjb3N0ID0gcHJpY2UgKiBhbW91bnQ7XG4gICAgICAgICAgICAgICAgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncmVtYWluXycgKyBiYXNlSWQpO1xuICAgICAgICAgICAgICAgIGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgYXZlcmFnZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKGZpbGxlZClcbiAgICAgICAgICAgIGF2ZXJhZ2UgPSBjb3N0IC8gZmlsbGVkO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKG9yZGVyWydzdWJtaXRfdGltZSddKTtcbiAgICAgICAgbGV0IGZlZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0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AgcmV0dXJuIG9yZGVycztcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBpZiAodHlwZSAhPT0gJ2xpbWl0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgY3VycmVuY3kgPSBtYXJrZXRbJ2Jhc2VJZCddO1xuICAgICAgICBpZiAoc2lkZSA9PT0gJ2J1eScpIHtcbiAgICAgICAgICAgIG9yZGVyW21hcmtldFsncXVvdGVJZCddXSA9IGFtb3VudCAqIHByaWNlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb3JkZXJbbWFya2V0WydiYXNlSWQnXV0gPSBhbW91bnQ7XG4gICAgICAgIH1cbiAgICAgICAgb3JkZXJbY3VycmVuY3ldID0gYW1vdW50O1xuICAgICAgICBsZXQgcmVzdWx0ID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXN1bHQsXG4gICAgICAgICAgICAnaWQnOiByZXN1bHRbJ3JldHVybiddWydvcmRlcl9pZCddLnRvU3RyaW5nICgp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ICAgICAgLy9cbiAgICAgICAgLy8gICAgIHtcbiAgICAgICAgLy8gICAgICAgICBcInN1Y2Nlc3NcIjogMSxcbiAgICAgICAgLy8gICAgICAgICBcInN0YXR1c1wiOiBcImFwcHJvdmVkXCIsXG4gICAgICAgIC8vICAgICAgICAgXCJ3aXRoZHJhd19jdXJyZW5jeVwiOiBcInhycFwiLFxuICAgICAgICAvLyAgICAgICAgIFwid2l0aGRyYXdfYWRkcmVzc1wiOiBcInJ3V3I3S1VaM1pGd3pnYURHaktCeXNBREJ5enh2b2hRM0NcIixcbiAgICAgICAgLy8gICAgICAgICBcIndpdGhkcmF3X2Ftb3VudFwiOiBcIjEwMDAwLjAwMDAwMDAwXCIsXG4gICAgICAgIC8vICAgICAgICAgXCJmZWVcIjogXCIyLjAwMDAwMDAwXCIsXG4gICAgICAgIC8vICAgICAgICAgXCJhbW91bnRfYWZ0ZXJfZmVlXCI6IFwiOTk5OC4wMDAwMDAwMFwiLFxuICAgICAgICAvLyAgICAgICAgIFwic3VibWl0X3RpbWVcIjogXCIxNTA5NDY5MjAwXCIsXG4gICAgICAgIC8vICAgICAgICAgXCJ3aXRoZHJhd19pZFwiOiBcInhycC0xMjM0NVwiLFxuICAgICAgICAvLyAgICAgICAgIFwidHhpZFwiOiBcIlwiLFxuICAgICAgICAvLyAgICAgICAgIFwid2l0aGRyYXdfbWVtb1wiOiBcIjEyMzEyM1wiXG4gICAgICAgIC8vICAgICB9XG4gICAgICAgIC8vXG4gICAgICAgIGxldCBpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCgndHhpZCcgaW4gcmVzcG9uc2UpICYmIChyZXNwb25zZVsndHhpZCddLmxlbmd0aCA+IDApKVxuICAgICAgICAgICAgaWQgPSByZXNwb25zZVsndHhpZCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiB0aGlzLm5vbmNlICgpLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChib2R5KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSwgcmVzcG9uc2UgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBib2R5ICE9PSAnc3RyaW5nJylcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgLy8geyBzdWNjZXNzOiAwLCBlcnJvcjogXCJpbnZhbGlkIG9yZGVyLlwiIH1cbiAgICAgICAgLy8gb3JcbiAgICAgICAgLy8gW3sgZGF0YSwgLi4uIH0sIHsgLi4uIH0sIC4uLiBdXG4gICAgICAgIGlmICh0eXBlb2YgcmVzcG9uc2UgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgaWYgKGJvZHlbMF0gPT09ICd7JyB8fCBib2R5WzBdID09PSAnWycpXG4gICAgICAgICAgICAgICAgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkgKHJlc3BvbnNlKSlcbiAgICAgICAgICAgIHJldHVybjsgLy8gcHVibGljIGVuZHBvaW50cyBtYXkgcmV0dXJuIFtdLWFycmF5c1xuICAgICAgICBpZiAoISgnc3VjY2VzcycgaW4gcmVzcG9uc2UpKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBubyAnc3VjY2VzcycgcHJvcGVydHkgb24gcHVibGljIHJlc3BvbnNlc1xuICAgICAgICBpZiAocmVzcG9uc2VbJ3N1Y2Nlc3MnXSA9PT0gMSkge1xuICAgICAgICAgICAgLy8geyBzdWNjZXNzOiAxLCByZXR1cm46IHsgb3JkZXJzOiBbXSB9fVxuICAgICAgICAgICAgaWYgKCEoJ3JldHVybicgaW4gcmVzcG9uc2UpKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJzogbWFsZm9ybWVkIHJlc3BvbnNlOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVx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AgICAgICAgJ2NvdW50cmllcyc6ICdVUycsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc4MjIxNTktNjYxNTM2MjAtNjBhZC0xMWU3LTg5ZTctMDA1ZjZkN2YzZGUwLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5pdGJpdC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaXRiaXQuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkuaXRiaXQuY29tL2RvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuaXRiaXQuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy97c3ltYm9sfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMve3N5bWJvbH0vb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy97c3ltYm9sfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0vYmFsYW5jZXMve2N1cnJlbmN5Q29kZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9mdW5kaW5nX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9vcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldF90cmFuc2ZlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9jcnlwdG9jdXJyZW5jeV9kZXBvc2l0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L2NyeXB0b2N1cnJlbmN5X3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0vb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXJlX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9vcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ1hCVFVTRCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9TR0QnOiB7ICdpZCc6ICdYQlRTR0QnLCAnc3ltYm9sJzogJ0JUQy9TR0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnU0dEJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnWEJURVVSJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0c1N5bWJvbE9yZGVyQm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAg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JvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZVsncmVjZW50VHJhZGVzJ10sIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2hXYWxsZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVswXVsnYmFsYW5jZXMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlQmFsYW5jZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlWyd0b3RhbEJhbGFuY2UnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3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XRzQnlBbHRuYW1lJzoge30sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzUnLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTUnLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzAnLFxuICAgICAgICAgICAgICAgICcxaCc6ICc2MCcsXG4gICAgICAgICAgICAgICAgJzRoJzogJzI0MCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzE0NDAnLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxMDA4MCcsXG4gICAgICAgICAgICAgICAgJzJ3JzogJzIxNjAwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTk5LTIyNzA5MzA0LTVlZGUtMTFlNy05ZGUxLTlmMzM3MzJlMTUwOS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkua3Jha2VuLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmtyYWtlbi5jb20nLFxuICAgICAgICAgICAgICAgICAgICAnemVuZGVzayc6ICdodHRwczovL3N1cHBvcnQua3Jha2VuLmNvbS9oYy9lbi11cy9hcnRpY2xlcycsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmtyYWtlbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5rcmFrZW4uY29tL2VuLXVzL2hlbHAvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9ub3RoaW5naXNkZWFkL25wbS1rcmFrZW4tYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vd3d3LmtyYWtlbi5jb20vZW4tdXMvaGVscC9mZWVzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjAwMjZdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMCwgMC4wMDI0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwLCAwLjAwMjJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAsIDAuMDAyMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMCwgMC4wMDE4XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMCwgMC4wMDE2XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMCwgMC4wMDE0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwMCwgMC4wMDEyXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAsIDAuMDAwMV0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjAwMTZdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMCwgMC4wMDE0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwLCAwLjAwMTJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAsIDAuMDAxMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMCwgMC4wMDA4XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMCwgMC4wMDA2XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMCwgMC4wMDA0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwMCwgMC4wMDAyXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAsIDAuMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgLy8gdGhpcyBpcyBhIGJhZCB3YXkgb2YgaGFyZGNvZGluZyBmZWVzIHRoYXQgY2hhbmdlIG9uIGRhaWx5IGJhc2lzXG4gICAgICAgICAgICAgICAgLy8gaGFyZGNvZGluZyBpcyBub3cgY29uc2lkZXJlZCBvYnNvbGV0ZSwgd2Ugd2lsbCByZW1vdmUgYWxsIG9mIGl0IGV2ZW50dWFsbHlcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTE0nOiAwLjAwMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDAxMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUxOJzogMC4wMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05PJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogNSwgLy8gaWYgZG9tZXN0aWMgd2lyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDUsIC8vIGlmIGRvbWVzdGljIHdpcmVcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQUQnOiAxMCwgLy8gQ0FEIEVGVCBXaXRoZHJhd2FsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSlBZJzogMzAwLCAvLyBpZiBkb21lc3RpYyB3aXJlXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hMTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01MTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiA1LCAvLyBpZiBkb21lc3RpYyB3aXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMCwgLy8gZnJlZSBkZXBvc2l0IGlmIEVVUiBTRVBBIERlcG9zaXRcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQUQnOiA1LCAvLyBpZiBkb21lc3RpYyB3aXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnSlBZJzogMCwgLy8gRG9tZXN0aWMgRGVwb3NpdCAoRnJlZSwgwqU1LDAwMCBkZXBvc2l0IG1pbmltdW0pXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd6ZW5kZXNrJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2Ugc2hvdWxkIHJlYWxseSByZWZyYWluIGZyb20gcHV0dGluZyBmaXhlZCBmZWUgbnVtYmVycyBhbmQgc3RvcCBoYXJkY29kaW5nXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB3ZSB3aWxsIGJlIHVzaW5nIHRoZWlyIHdlYiBBUElzIHRvIHNjcmFwZSBhbGwgbnVtYmVycyBmcm9tIHRoZXNlIGFydGljbGVzXG4gICAgICAgICAgICAgICAgICAgICAgICAnMjA1ODkzNzA4LVdoYXQtaXMtdGhlLW1pbmltdW0tb3JkZXItc2l6ZS0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJzIwMTM5Njc3Ny1XaGF0LWFyZS10aGUtZGVwb3NpdC1mZWVzLScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnMjAxODkzNjA4LVdoYXQtYXJlLXRoZS13aXRoZHJhd2FsLWZlZXMtJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXNzZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBc3NldFBhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0hMQycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3ByZWFkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RpbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWRkT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDbG9zZWRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RlcG9zaXRNZXRob2RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEZXBvc2l0U3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMZWRnZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcGVuUG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRdWVyeUxlZGdlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1F1ZXJ5T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRdWVyeVRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVCYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZXNIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZVZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3Q2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3U3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdvcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdjYWNoZURlcG9zaXRNZXRob2RzT25GZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSwgLy8gd2lsbCBpc3N1ZSB1cCB0byB0d28gY2FsbHMgaW4gZmV0Y2hEZXBvc2l0QWRkcmVzc1xuICAgICAgICAgICAgICAgICdkZXBvc2l0TWV0aG9kcyc6IHt9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdFRnVuZGluZzpVbmtub3duIHdpdGhkcmF3IGtleSc6IEV4Y2hhbmdlRXJyb3IsXG4gICAgICAgICAgICAgICAgJ0VGdW5kaW5nOkludmFsaWQgYW1vdW50JzogSW5zdWZmaWNpZW50RnVuZHMsXG4gICAgICAgICAgICAgICAgJ0VTZXJ2aWNlOlVuYXZhaWxhYmxlJzogRXhjaGFuZ2VOb3RBdmFpbGFibGUsXG4gICAgICAgICAgICAgICAgJ0VEYXRhYmFzZTpJbnRlcm5hbCBlcnJvcic6IEV4Y2hhbmdlTm90QXZhaWxhYmxlLFxuICAgICAgICAgICAgICAgICdFU2VydmljZTpCdXN5JzogRXhjaGFuZ2VOb3RBdmFpbGFibGUsXG4gICAgICAgICAgICAgICAgJ0VBUEk6UmF0ZSBsaW1pdCBleGNlZWRlZCc6IEREb1NQcm90ZWN0aW9uLFxuICAgICAgICAgICAgICAgICdFUXVlcnk6VW5rbm93biBhc3NldCc6IEV4Y2hhbmdlRXJyb3IsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjb3N0VG9QcmVjaXNpb24gKHN5bWJvbCwgY29zdCkge1xuICAgICAgICByZXR1cm4gdGhpcy50cnVuY2F0ZSAocGFyc2VGbG9hdCAoY29zdCksIHRoaXMubWFya2V0c1tzeW1ib2xdWydwcmVjaXNpb24nXVsncHJpY2UnXSk7XG4gICAgfVxuXG4gICAgZmV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ICAgbGV0IGNodW5rcyA9IGxpc3RJdGVtLnNwbGl0IChzZXBhcmF0b3IpO1xuICAgICAgICAgICAgbGV0IG51bUNodW5rcyA9IGNodW5rcy5sZW5ndGg7XG4gICAgICAgICAgICBpZiAobnVtQ2h1bmtzID4gMSkge1xuICAgICAgICAgICAgICAgIGxldCBsaW1pdCA9IHBhcnNlRmxvYXQgKGNodW5rc1sxXSk7XG4gICAgICAgICAgICAgICAgbGV0IG5hbWUgPSBjaHVua3NbMF07XG4gICAgICAgICAgICAgICAgY2h1bmtzID0gbmFtZS5zcGxpdCAoJygnKTtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjaHVua3NbMV07XG4gICAgICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGxpbWl0O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEFzc2V0UGFpcnMgKCk7XG4gICAgICAgIGxldCBsaW1pdHMgPSBhd2FpdCB0aGlzLmZldGNoTWluT3JkZXJTaXplcyAoKTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0c1sncmVzdWx0J10pO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydyZXN1bHQnXVtpZF07XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgaWYgKChiYXNlWzBdID09PSAnWCcpIHx8IChiYXNlWzBdID09PSAnWicpKVxuICAgICAgICAgICAgICAgIGJhc2UgPSBiYXNlLnNsaWNlICgxKTtcbiAgICAgICAgICAgIGlmICgocXVvdGVbMF0gPT09ICdYJykgfHwgKHF1b3RlWzBdID09PSAnWicpKVxuICAgICAgICAgICAgICAgIHF1b3RlID0gcXVvdGUuc2xpY2UgKDEpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBkYXJrcG9vbCA9IGlkLmluZGV4T2YgKCcuZCcpID49IDA7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gZGFya3Bvb2wgPyBtYXJrZXRbJ2FsdG5hbWUnXSA6IChiYXNlICsgJy8nICsgcXVvdGUpO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKCdmZWVzX21ha2VyJyBpbiBtYXJrZXQpIHtcbiAgICAgICAgICAgICAgICBtYWtlciA9IHBhcnNlRmxvYXQgKG1hcmtldFsnZmVlc19tYWtlciddWzBdWzFdKSAvIDEwMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnbG90X2RlY2ltYWxzJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwYWlyX2RlY2ltYWxzJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IG1pbkFtb3VudCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgaWYgKGJhc2UgaW4gbGltaXRzKVxuICAgICAgICAgICAgICAgIG1pbkFtb3VudCA9IGxpbWl0c1tiYXNlXTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Rhcmtwb29sJzogZGFya3Bvb2wsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2FsdG5hbWUnOiBtYXJrZXRbJ2FsdG5hbWUnXSxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBtYWtlcixcbiAgICAgICAgICAgICAgICAndGFrZXInOiBwYXJzZUZsb2F0IChtYXJrZXRbJ2ZlZXMnXVswXVsxXSkgLyAxMDAsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1pbkFtb3VudCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXN1bHQgPSB0aGlzLmFwcGVuZEluYWN0aXZlTWFya2V0cyAocmVzdWx0KTtcbiAgICAgICAgdGhpcy5tYXJrZXRzQnlBbHRuYW1lID0gdGhpcy5pbmRleEJ5IChyZXN1bHQsICdhbHRuYW1lJyk7XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXBwZW5kSW5hY3RpdmVNYXJrZXRzIChyZXN1bHQgPSBbXSkge1xuICAgICAgICBsZXQgcHJlY2lzaW9uID0geyAnYW1vdW50JzogOCwgJ3ByaWNlJzogOCB9O1xuICAgICAgICBsZXQgY29zdExpbWl0cyA9IHsgJ21pbic6IDAsICdtYXgnOiB1bmRlZmluZWQgfTtcbiAgICAgICAgbGV0IHByaWNlTGltaXRzID0geyAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSwgJ21heCc6IHVuZGVmaW5lZCB9O1xuICAgICAgICBsZXQgYW1vdW50TGltaXRzID0geyAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pIH07XG4gICAgICAgIGxldCBsaW1pdHMgPSB7ICdhbW91bnQnOiBhbW91bnRMaW1pdHMsICdwcmljZSc6IHByaWNlTGltaXRzLCAnY29zdCc6IGNvc3RMaW1pdHMgfTtcbiAgICAgICAgbGV0IGRlZmF1bHRzID0ge1xuICAgICAgICAgICAgJ2Rhcmtwb29sJzogZmFsc2UsXG4gICAgICAgICAgICAnaW5mbyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdtYWtlcic6IHVuZGVmaW5lZCxcbiAgICAg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ICAgICAgICAgLy8gdG8gYWRkIHN1cHBvcnQgZm9yIG11bHRpcGxlIHdpdGhkcmF3YWwvZGVwb3NpdCBtZXRob2RzIGFuZFxuICAgICAgICAgICAgLy8gZGlmZmVyZW50aWF0ZWQgZmVlcyBmb3IgZWFjaCBwYXJ0aWN1bGFyIG1ldGhvZFxuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3lbJ2FsdG5hbWUnXSk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0gY3VycmVuY3lbJ2RlY2ltYWxzJ107XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkaW5nRmVlcyAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RUcmFkZVZvbHVtZSAocGFyYW1zKTtcbiAgICAgICAgbGV0IHRyYWRlZFZvbHVtZSA9IHRoaXMuc2FmZUZsb2F0IChyZXNwb25zZVsncmVzdWx0J10sICd2b2x1bWUnKTtcbiAgICAgICAgbGV0IHRpZXJzID0gdGhpcy5mZWVzWyd0cmFkaW5nJ11bJ3RpZXJzJ107XG4gICAgICAgIGxldCB0YWtlciA9IHRpZXJzWyd0YWtlciddWzFdO1xuICAgICAgICBsZXQgbWFrZXIgPSB0aWVyc1snbWFrZXInXVsxXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aWVy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ICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICAgICAgaWYgKG1hcmtldFsnYWN0aXZlJ10pXG4gICAgICAgICAgICAgICAgaWYgKCFtYXJrZXRbJ2Rhcmtwb29sJ10pXG4gICAgICAgICAgICAgICAgICAgIHBhaXJzLnB1c2ggKG1hcmtldFsnaWQnXSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZpbHRlciA9IHBhaXJzLmpvaW4gKCcsJyk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiBmaWx0ZXIsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VycyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0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ICBsZXQgaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBvcmRlciA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGZlZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCFtYXJrZXQpXG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLmZpbmRNYXJrZXRCeUFsdG5hbWVPcklkICh0cmFkZVsncGFpciddKTtcbiAgICAgICAgaWYgKCdvcmRlcnR4aWQnIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBvcmRlciA9IHRyYWRlWydvcmRlcnR4aWQnXTtcbiAgICAgICAgICAgIGlkID0gdHJhZGVbJ2lkJ107XG4gICAgICAgICAgICB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ3RpbWUnXSAqIDEwMDApO1xuICAgICAgICAgICAgc2lkZSA9IHRyYWRlWyd0eXBlJ107XG4gICAgICAgICAgICB0eXBlID0gdHJhZGVbJ29yZGVydHlwZSddO1xuICAgICAgICAgICAgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdwcmljZScpO1xuICAgICAgICAgICAgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAndm9sJyk7XG4gICAgICAgICAgICBpZiAoJ2ZlZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgICAgICAgICAgY3VycmVuY3kgPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2ZlZScpLFxuICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWzJdICogMTAwMCk7XG4gICAgICAgICAgICBzaWRlID0gKHRyYWRlWzNdID09PSAncycpID8gJ3NlbGwnIDogJ2J1eSc7XG4gICAgICAgICAgICB0eXBlID0gKHRyYWRlWzRdID09PSAnbCcpID8gJ2xpbWl0JyA6ICdtYXJrZXQnO1xuICAgICAgICAgICAgcHJpY2UgPSBwYXJzZUZsb2F0ICh0cmFkZVswXSk7XG4gICAgICAgICAgICBhbW91bnQgPSBwYXJzZUZsb2F0ICh0cmFkZVsxXSk7XG4gICAgICAgICAgICBsZXQgdHJhZGVMZW5ndGggPSB0cmFkZS5sZW5ndGg7XG4gICAgICAgICAgICBpZiAodHJhZGVMZW5ndGggPiA2KVxuICAgICAgICAgICAgICAgIGlkID0gdHJhZGVbNl07IC8vIGFydGlmaWNpYWxseSBhZGRlZCBhcyBwZXIgIzE3OTRcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gKG1hcmtldCkgPyBtYXJrZXRbJ3N5bWJvbCddIDogdW5kZWZpbmVkO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcixcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnZmV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Bjb2RlLnNsaWNlICgxKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY29kZSk7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VzW2N1cnJlbmN5XSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2UsXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlLFxuICAgICAgICAgICAgJ29yZGVydHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAndm9sdW1lJzogdGhpcy5hbW91bnRUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQpLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ2xpbWl0JylcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gdGhpcy5wcmljZVRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEFkZE9yZGVyICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICBsZXQgaWQgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2VbJ3Jlc3VsdCddLCAndHhpZCcpO1xuICAgICAgICBpZiAodHlwZW9mIGlkICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkgKGlkKSkge1xuICAgICAgICAgICAgICAgIGxldCBsZW5ndGggPSBpZC5sZW5ndGg7XG4gICAgICAgICAgICAgICAgaWQgPSAobGVuZ3RoID4gMSkgPyBpZCA6IGlkWzBdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZmluZE1hcmtldEJ5QWx0bmFtZU9ySWQgKGlkKSB7XG4gICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNCeUFsdG5hbWUpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm1hcmtldHNCeUFsdG5hbWVbaWRdO1xuICAgICAgICB9IGVsc2UgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBkZXNjcmlwdGlvbiA9IG9yZGVyWydkZXNjciddO1xuICAgICAgICBsZXQgc2lkZSA9IGRlc2NyaXB0aW9uWyd0eXBlJ107XG4gICAgICAgIGxldCB0eXBlID0g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1xuICAgICAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiBmZWVDb3N0LFxuICAgICAgICAgICAgICAgICAgICAncmF0ZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGlmIChmbGFncy5pbmRleE9mICgnZmNpcScpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZmVlWydjdXJyZW5jeSddID0gbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZmxhZ3MuaW5kZXhPZiAoJ2ZjaWInKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGZlZVsnY3VycmVuY3knXSA9IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogb3JkZXJbJ3N0YXR1cyddLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJz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gICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIHdpdGhkcmF3IChjdXJyZW5jeSwgYW1vdW50LCBhZGRyZXNzLCB0YWcgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHRoaXMuY2hlY2tBZGRyZXNzIChhZGRyZXNzKTtcbiAgICAgICAgaWYgKCdrZXknIGluIHBhcmFtcykge1xuICAgICAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RXaXRoZHJhdyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYXNzZXQnOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgICAgIC8vICdhZGRyZXNzJzogYWRkcmVzcywgLy8gdGhleSBkb24ndCBhbGxvdyB3aXRoZHJhd2FscyB0byBkaXJlY3QgYWRkcmVzc2VzXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICAgICAnaWQnOiByZXNwb25zZVsncmVzdWx0J10sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgXCIgd2l0aGRyYXcgcmVxdWlyZXMgYSAna2V5JyBwYXJhbWV0ZXIgKHdpdGhkcmF3YWwga2V5IG5hbWUsIGFzIHNldCB1cCBvbiB5b3VyIGFjY291bnQpXCIpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFy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jQnKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0FQSS1LZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnQVBJLVNpZ24nOiB0aGlzLmRlY29kZSAoc2lnbmF0dXJlKSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdXJsID0gJy8nICsgcGF0aDtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyB1cmw7XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChib2R5LmluZGV4T2YgKCdJbnZhbGlkIG9yZGVyJykgPj0gMClcbiAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgaWYgKGJvZHkuaW5kZXhPZiAoJ0ludmFsaWQgbm9uY2UnKSA+PSAwKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWROb25jZSAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnSW5zdWZmaWNpZW50IGZ1bmRzJykgPj0gMClcbiAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnQ2FuY2VsIHBlbmRpbmcnKSA+PSAwKVxuICAgICAgICAgICAgdGhyb3cgbmV3IENhbmNlbFBlbmRpbmcgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgaWYgKGJvZHkuaW5kZXhPZiAoJ0ludmFsaWQgYXJndW1lbnRzOnZvbHVtZScpID49IDApXG4gICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgIGlmIChib2R5WzBdID09PSAneycpIHtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiByZXNwb25zZSAhPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICBpZiAoJ2Vycm9yJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbnVtRXJyb3JzID0gcmVzcG9uc2VbJ2Vycm9yJ10ubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICBpZiAobnVtRXJyb3JzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcmVzcG9uc2VbJ2Vycm9yJ10ubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2VbJ2Vycm9yJ11baV0gaW4gdGhpcy5leGNlcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyB0aGlzLmV4Y2VwdGlvbnNbcmVzcG9uc2VbJ2Vycm9yJ11baV1dIChtZXNzYWdlKTtcbiA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gICAgJ3JhdGVMaW1pdCc6IDIwMDAsXG4gICAgICAgICAgICAndXNlckFnZW50JzogdGhpcy51c2VyQWdlbnRzWydjaHJvbWUnXSxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlTWFya2V0T3JkZXInOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hEZXBvc2l0QWRkcmVzcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLCAvLyBzZWUgdGhlIG1ldGhvZCBpbXBsZW1lbnRhdGlvbiBiZWxvd1xuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogJ2VtdWxhdGVkJywgLy8gdGhpcyBtZXRob2QgaXMgdG8gYmUgZGVsZXRlZCwgc2VlIGltcGxlbWVudGF0aW9uIGFuZCBjb21tZW50cyBiZWxvd1xuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogMSxcbiAgICAgICAgICAgICAgICAnNW0nOiA1LFxuICAgICAgICAgICAgICAgICcxNW0nOiAxNSxcbiAgICAgICAgICAgICAgICAnMzBtJzogMzAsXG4gICAgICAgICAgICAgICAgJzFoJzogNjAsXG4gICAgICAgICAgICAgICAgJzhoJzogNDgwLFxuICAgICAgICAgICAgICAgICcxZCc6ICdEJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnVycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMzc5NTY1NS1iM2M0NmU0OC1kY2Y2LTExZTctOGFiZS1kYzQ1ODhiYTc5MDEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmt1Y29pbi5jb20nLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5rdWNvaW4uY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ2tpdGNoZW4nOiAnaHR0cHM6Ly9raXRjaGVuLmt1Y29pbi5jb20nLFxuICAgICAgICAgICAgICAgICAgICAna2l0Y2hlbi0yJzogJ2h0dHBzOi8va2l0Y2hlbi0yLmt1Y29pbi5jb20nLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5rdWNvaW4uY29tLz9yPUU1d2txZScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2t1Y29pbmFwaWRvY3MuZG9jcy5hcGlhcnkuaW8nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vbmV3cy5rdWNvaW4uY29tL2VuL2ZlZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAna2l0Y2hlbic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2NoYXJ0L2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2NoYXJ0L2NvbmZpZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9jaGFydC9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2NoYXJ0L3N5bWJvbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9jdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2RlYWwtb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2tsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2xhbmctbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vb3JkZXJzLWJ1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9vcmRlcnMtc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi90aWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbi9jb2luLWluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVuL2NvaW5zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbi9jb2lucy10cmVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW4vc3ltYm9scycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQve2NvaW59L3dhbGxldC9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tjb2lufS93YWxsZXQvcmVjb3JkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC97Y29pbn0vYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9wcm9tb3Rpb24vaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9wcm9tb3Rpb24vc3VtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZWFsLW9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvYWN0aXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9hY3RpdmUtbWFwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9kZWFsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvZGV0YWlsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWZlcnJlci9kZXNjZW5kYW50L2NvdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tjb2lufS93aXRoZHJhdy9hcHBseScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC97Y29pbn0vd2l0aGRyYXcvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3Byb21vdGlvbi9kcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwtb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwtYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NoYW5nZS1sYW5nJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnS0NTJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FTyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQVMnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS05DJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVkMnOiAzLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BBWSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAyMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JIQyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIU1InOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dUQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRIJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSUFgnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVRJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVlgnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU9EJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FQkwnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdCJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NBRyc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRkQnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkROJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VLRyc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ1BUJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RYJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05VTFMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1ZUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTVCc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQVVJBJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVQic6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRU1AnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9XUic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGTElYWCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEVORCc6IDIwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU1CJzogMy4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JIT0MnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUic6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdERU5UJzogNTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUkdOJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FDVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7fSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIGV4Y2hhbmdlLXNwZWNpZmljIG9wdGlvbnNcbiAgICAgICAgICAgICdvcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICd0aW1lRGlmZmVyZW5jZSc6IDAsIC8vIHRoZSBkaWZmZXJlbmNlIGJldHdlZW4gc3lzdGVtIGNsb2NrIGFuZCBLdWNvaW4gY2xvY2tcbiAgICAgICAgICAgICAgICAnYWRqdXN0Rm9yVGltZURpZmZlcmVuY2UnOiBmYWxzZSwgLy8gY29udHJvbHMgdGhlIGFkanVzdG1lbnQgbG9naWMgdXBvbiBpbnN0YW50aWF0aW9uXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBub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29pblR5cGVQYWlyJ107XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gbWFya2V0Wyd0cmFkaW5nJ107XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ2ZlZVJhdGUnKSxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnZmVlUmF0ZScpLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaERlcG9zaXRBZGRyZXNzIChjb2RlLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmN1cnJlbmN5IChjb2RlKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudENvaW5XYWxsZXRBZGRyZXNzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2NvaW4nOiBjdXJyZW5jeVsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBkYXRhID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IGFkZHJlc3MgPSB0aGlzLnNhZmVTdHJpbmcgKGRhdGEsICdhZGRyZXNzJyk7XG4gICAgICAgIHRoaXMuY2hlY2tBZGRyZXNzIChhZGRyZXNzKTtcbiAgICAgICAgbGV0IHRhZyA9IHRoaXMuc2FmZVN0cmluZyAoZGF0YSwgJ3VzZXJPaWQnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGNvZGUsXG4gICAgICAgICAgICAnYWRkc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mFibGVXaXRoZHJhdyddO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChkZXBvc2l0ICYmIHdpdGhkcmF3KTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WyduYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAnZmVlJzogY3VycmVuY3lbJ3dpdGhkcmF3TWluRmVlJ10sIC8vIHRvZG86IHJlZGVzaWduXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnd2l0aGRyYXdNaW5BbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRCYWxhbmNlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2xpbWl0JzogMjAsIC8vIGRlZmF1bHQgMTIsIG1heCAyMFxuICAgICAgICAgICAgJ3BhZ2UnOiAxLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgaW5kZXhlZCA9IHRoaXMuaW5kZXhCeSAoYmFsYW5jZXMsICdjb2luVHlwZScpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChpbmRleGVkKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW2ldO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpc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kJykge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiByZW1haW5pbmcgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIGlmIChyZW1haW5pbmcgPiAwKVxuICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSAnY2xvc2VkJztcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGZpbGxlZCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2Ygc3RhdHVzICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBpZiAoc3RhdHVzID09PSAnY2xvc2VkJylcbiAgICAgICAgICAgICAgICAgICAgZmlsbGVkID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnYW1vdW50Jyk7XG4gICAgICAgIH0gZWxzZSBpZiAoZmlsbGVkID09PSAwLjApIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgdHJhZGVzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGNvc3QgPSAwO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdHJhZGVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCArPSB0cmFkZXNbaV1bJ2Ftb3VudCddO1xuICAgICAgICAgICAgICAgICAgICBjb3N0ICs9IHRyYWRlc1tpXVsnY29zdCddO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvLyBrdWNvaW4gcHJpY2UgYW5kIGFtb3VudCBmaWVsZHMgaGF2ZSB2YXJ5aW5nIG5hbWVzXG4gICAgICAgIC8vIHRodXMgdGhlIGNvbnZvbHV0ZWQgc3BhZ2hldHRpIGNvZGUgYmVsb3dcbiAgICAgICAgbGV0IHByaWNlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIGZpbGxlZCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIC8vIGlmIHRoZSBvcmRlciB3YXMgZmlsbGVkIGF0IGxlYXN0IGZvciBzb21lIHBhcnRcbiAgICAgICAgICAgIGlmIChmaWxsZWQgPiAwLjApIHtcbiAgICAgICAgICAgICAgICBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlJyk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZGVhbFByaWNlJyk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZGVhbFByaWNlQXZlcmFnZScpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBpdCdzIGFuIG9wZW4gb3JkZXIsIG5vdCBmaWxsZWQgeWV0LCB1c2UgdGhlIGluaXRpYWwgcHJpY2VcbiAgICAgICAgICAgICAgICBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ29yZGVyUHJpY2UnKTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHByaWNlID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBjb3N0ID0gcHJpY2UgKiBmaWxsZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodHlwZW9mIGFtb3VudCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZyAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIGFtb3VudCA9IHRoaXMuc3VtIChmaWxsZWQsIHJlbWFpbmluZyk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiByZW1haW5pbmcgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChzdGF0dXMgPT09ICdvcGVuJykge1xuICAgICAgICAgICAgaWYgKCh0eXBlb2YgY29zdCA9PT0gJ3VuZGVmaW5lZCcpIHx8IChjb3N0ID09PSAwLjApKVxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcHJpY2UgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGFtb3VudCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgICAgICBjb3N0ID0gYW1vdW50ICogcHJpY2U7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZlZUN1cnJlbmN5ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGZlZUN1cnJlbmN5ID0gKHNpZGUgPT09ICdzZWxsJykgPyBtYXJrZXRbJ3F1b3RlJ10gOiBtYXJrZXRbJ2Jhc2UnXTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGxldCBmZWVDdXJyZW5jeUZpZWxkID0gKHNpZGUgPT09ICdzZWxsJ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AgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJUeXBlLFxuICAgICAgICAgICAgJ29yZGVyT2lkJzogaWQsXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldE9yZGVyRGV0YWlsICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGlmICghcmVzcG9uc2VbJ2RhdGEnXSlcbiAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAvL1xuICAgICAgICAvLyB0aGUgY2FjaGluZyBwYXJ0IHRvIGJlIHJlbW92ZWRcbiAgICAgICAgLy9cbiAgICAgICAgLy8gICAgIGxldCBvcmRlciA9IHRoaXMucGFyc2VPcmRlciAocmVzcG9uc2VbJ2RhdGEnXSwgbWFya2V0KTtcbiAgICAgICAgLy8gICAgIGxldCBvcmRlcklkID0gb3JkZXJbJ2lkJ107XG4gICAgICAgIC8vICAgICBpZiAob3JkZXJJZCBpbiB0aGlzLm9yZGVycylcbiAgICAgICAgLy8gICAgICAgICBvcmRlclsnc3RhdHVzJ10gPSB0aGlzLm9yZGVyc1tvcmRlcklkXVsnc3RhdHVzJ107XG4gICAgICAgIC8vICAgICB0aGlzLm9yZGVyc1tvcmRlcklkXSA9IG9yZGVyO1xuICAgICAgICAvL1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyIChyZXNwb25zZVsnZGF0YSddLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJzQnlTdGF0dXMgKG9yZGVycywgbWFya2V0LCBzaW5jZSwgbGltaXQsIHN0YXR1cykge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDw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ICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRPcmRlckRlYWx0ICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcnMgPSByZXNwb25zZVsnZGF0YSddWydkYXRhcyddO1xuICAgICAgICAvL1xuICAgICAgICAvLyB0aGUgY2FjaGluZyBwYXJ0IHRvIGJlIHJlbW92ZWRcbiAgICAgICAgLy9cbiAgICAgICAgLy8gICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb3JkZXJzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgIC8vICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5wYXJzZU9yZGVyICh0aGlzLmV4dGVuZCAob3JkZXJzW2ldLCB7XG4gICAgICAgIC8vICAgICAgICAgICAgICdzdGF0dXMnOiAnY2xvc2VkJyxcbiAgICAgICAgLy8gICAgICAgICB9KSwgbWFya2V0KTtcbiAgICAgICAgLy8gICAgICAgICBsZXQgb3JkZXJJZCA9IG9yZGVyWydpZCddO1xuICAgICAgICAvLyAgICAgICAgIGlmIChvcmRlcklkIGluIHRoaXMub3JkZXJzKVxuICAgICAgICAvLyAgICAgICAgICAgICBpZiAodGhpcy5vcmRlcnNbb3JkZXJJZF1bJ3N0YXR1cyddID09PSAnY2FuY2VsZWQnKVxuICAgICAgICAvLyAgICAgICAgICAgICAgICAgb3JkZXJbJ3N0YXR1cyddID0gdGhpcy5vcmRlcnNbb3JkZXJJZF1bJ3N0YXR1cyddO1xuICAgICAgICAvLyAgICAgICAgIHRoaXMub3JkZXJzW29yZGVyWydpZCddXSA9IG9yZGVyO1xuICAgICAgICAvLyAgICAgfVxuICAgICAgICAvLyAgICAgbGV0IGNsb3NlZE9yZGVycyA9IHRoaXMuZmlsdGVyQnkgKHRoaXMub3JkZXJzLCAnc3RhdHVzJywgJ2Nsb3NlZCcpO1xuICAgICAgICAvLyAgICAgcmV0dXJuIHRoaXMuZmls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Y2VzXG4gICAgICAgIC8vICAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICAvLyAgICAgICAgIGxldCBzaWRlID0gcmVxdWVzdFsndHlwZSddLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAvLyAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHtcbiAgICAgICAgLy8gICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIC8vICAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgIC8vICAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgLy8gICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgIC8vICAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgLy8gICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgLy8gICAgICAgICAgICAgJ3N0YXR1cyc6ICdjYW5jZWxlZCcsXG4gICAgICAgIC8vICAgICAgICAgfTtcbiAgICAgICAgLy8gICAgIH1cbiAgICAgICAgLy8gICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgLy9cbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxPcmRlciAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWydkYXRldGltZSddO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB9IGVsc2Uge1xu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oQXJyYXkuaXNBcnJheSAodHJhZGUpKSB7XG4gICAgICAgICAgICB0aW1lc3RhbXAgPSB0cmFkZVswXTtcbiAgICAgICAgICAgIHR5cGUgPSAnbGltaXQnO1xuICAgICAgICAgICAgaWYgKHRyYWRlWzFdID09PSAnQlVZJykge1xuICAgICAgICAgICAgICAgIHNpZGUgPSAnYnV5JztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodHJhZGVbMV0gPT09ICdTRUxMJykge1xuICAgICAgICAgICAgICAgIHNpZGUgPSAnc2VsbCc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBwcmljZSA9IHRyYWRlWzJdO1xuICAgICAgICAgICAgYW1vdW50ID0gdHJhZGVbM107XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aW1lc3RhbXAgPSB0aGlzLnNhZmVWYWx1ZSAodHJhZGUsICdjcmVhdGVkQXQnKTtcbiAgICAgICAgICAgIG9yZGVyID0gdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ29yZGVyT2lkJyk7XG4gICAgICAgICAgICBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdvaWQnKTtcbiAgICAgICAgICAgIHNpZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAnZGlyZWN0aW9uJyk7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHNpZGUgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIHNpZGUgPSBzaWRlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdkZWFsUHJpY2UnKTtcbiAgICAgICAgICAgIGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2Ftb3VudCcpO1xuICAgICAgICAgICAgY29zdCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2RlYWxWYWx1ZScpO1xuICAgICAgICAgICAgbGV0IGZlZUN1cnJlbmN5ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgZmVlQ3VycmVuY3kgPSAoc2lkZSA9PT0gJ3NlbGwnKSA/IG1hcmtldFsncXVvdGUnXSA6IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgZmVlQ3VycmVuY3lGaWVsZCA9IChzaWRlID09PSAnc2VsbCcpID8gJ2NvaW5UeXBlUGFpcicgOiAnY29pblR5cGUnO1xuICAgICAgICAgICAgICAgIGxldCBmZWVDdXJyZW5jeSA9IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsIGZlZUN1cnJlbmN5RmllbGQpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZmVlQ3VycmVuY3kgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChmZWVDdXJyZW5jeSBpbiB0aGlzLmN1cnJlbmNpZXNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgICAgICBmZWVDdXJyZW5jeSA9IHRoaXMuY3VycmVuY2llc19ieV9pZFtmZWVDdXJyZW5jeV1bJ2NvZGUnXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdmZWUnKSxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBmZWVDdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXIsXG4gICAgICAgICAgICAnaW5mbyc6IGluZm8sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3BlbkRlYWxPcmRlcnMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlWydkYXRhJ10sIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE15VHJhZGVzIChzeW1ib2wgPSB1bmRlZmluZWQsIHNpbmNlID0gdW5kZWZpbmVkLCB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eVN0cmluZztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYXV0aCA9IGVuZHBvaW50ICsgJy8nICsgbm9uY2UgKyAnLycgKyBxdWVyeVN0cmluZztcbiAgICAgICAgICAgIGxldCBwYXlsb2FkID0gdGhpcy5zdHJpbmdUb0Jhc2U2NCAodGhpcy5lbmNvZGUgKGF1dGgpKTtcbiAgICAgICAgICAgIC8vIHBheWxvYWQgc2hvdWxkIGJlIFwiZW5jb2RlZFwiIGFzIHJldHVybmVkIGZyb20gc3RyaW5nVG9CYXNlNjRcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHBheWxvYWQsIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGEyNTYnKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0tDLUFQSS1LRVknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnS0MtQVBJLU5PTkNFJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ0tDLUFQSS1TSUdOQVRVUkUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgdGhyb3dFeGNlcHRpb25PbkVycm9yIChyZXNwb25zZSkge1xuICAgICAgICAvL1xuICAgICAgICAvLyBBUEkgZW5kcG9pbnRzIHJldHVybiB0aGUgZm9sbG93aW5nIGZvcm1hdHNcbiAgICAgICAgLy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Jlc3BvbnNlKTtcbiAgICAgICAgaWYgKGNvZGUgPT09ICdVTkFVVEgnKSB7XG4gICAgICAgICAgICBpZiAobWVzc2FnZSA9PT0gJ0ludmFsaWQgbm9uY2UnKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkTm9uY2UgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yIChmZWVkYmFjayk7XG4gICAgICAgIH0gZWxzZSBpZiAoY29kZSA9PT0gJ0VSUk9SJykge1xuICAgICAgICAgICAgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ1RoZSBwcmVjaXNpb24gb2YgYW1vdW50JykgPj0gMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyIChmZWVkYmFjayk7IC8vIGFtb3VudCB2aW9sYXRlcyBwcmVjaXNpb24uYW1vdW50XG4gICAgICAgICAgICBpZiAobWVzc2FnZS5pbmRleE9mICgnTWluIGFtb3VudCBlYWNoIG9yZGVyJykgPj0gMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyIChmZWVkYmFjayk7IC8vIGFtb3VudCA8IGxpbWl0cy5hbW91bnQubWluXG4gICAgICAgICAgICBpZiAobWVzc2FnZS5pbmRleE9mICgnTWluIHByaWNlOicpID49IDApXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAoZmVlZGJhY2spOyAvLyBwcmljZSA8IGxpbWl0cy5wcmljZS5taW5cbiAgICAgICAgICAgIGlmIChtZXNzYWdlLmluZGV4T2YgKCdNYXggcHJpY2U6JykgPj0gMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyIChmZWVkYmFjayk7IC8vIHByaWNlID4gbGltaXRzLnByaWNlLm1heFxuICAgICAgICAgICAgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ1RoZSBwcmVjaXNpb24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ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMTY5NzYzOC05MTI4MjRmYS1iM2MxLTExZTctOGMzNi1jZjk2MDZlYjk0YWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8va3VuYS5pbycsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2t1bmEuaW8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9rdW5hLmlvL2RvY3VtZW50cy9hcGknLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8va3VuYS5pby9kb2N1bWVudHMvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnVUFIJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dBVkVTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHT0wnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0JHJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ1JNQyc6IDAuMDAxIEJUQ1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ0FSTic6IDAuMD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yk7XG4gICAgICAgICAgICAgICAgaWYgKGJhc2VJZC5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBiYXNlSWRMZW5ndGggPSBiYXNlSWQubGVuZ3RoIC0gMDsgLy8gYSB0cmFuc3BpbGVyIHdvcmthcm91bmRcbiAgICAgICAgICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBpZC5zbGljZSAoYmFzZUlkTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBiYXNlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IHF1b3RlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0cy5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbWFya2V0cztcbiAgICB9XG5cbiAgICBhc3luY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dpZCc6ICdsYWtlYnRjJyxcbiAgICAgICAgICAgICduYW1lJzogJ0xha2VCVEMnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdVUycsXG4gICAgICAgICAgICAndmVyc2lvbic6ICdhcGlfdjInLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODA3NDEyMC03MmI3YzM4YS02NjYwLTExZTctOTJkOS1kOTAyNzUwMjI4MWQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmxha2VidGMuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lmxha2VidGMuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubGFrZWJ0Yy5jb20vcy9hcGlfdjInLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubGFrZWJ0Yy5jb20vcy9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jjb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiY3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXlPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRBY2NvdW50SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0RXh0ZXJuYWxBY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBmb3IgKGxldCBrID0gMDsgayA8IGtleXMubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNba107XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpZF07XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGJhc2VJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHF1b3RlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0QWNjb3VudEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydiYWxhbmNlJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgY29kZSA9IGlkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMuY3VycmVuY2llc19ieV9pZCkge1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY3VycmVuY2llc19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgY29kZSA9IGN1cnJlbmN5Wydjb2RlJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VzW2lkXSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2UsXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0QmNvcmRlcmJvb2sgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2spO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgbWFya2V0ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYmlkJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgIC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aGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICBwYXJhbXMgPSBwYXJhbXMuam9pbiAoJywnKTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBwYXJhbXMgPSAnJztcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMudXJsZW5jb2RlICh7XG4gICAgICAgICAgICAgICAgJ3RvbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ2FjY2Vzc2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdyZXF1ZXN0bWV0aG9kJzogbWV0aG9kLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgICAgICdpZCc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdwYXJhbXMnOiBwYXJhbXMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAncGFyYW1zJzogcGFyYW1zLFxuICAgICAgICAgICAgICAgICdpZCc6IG5vbmNlLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMScpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLmVuY29kZSAodGhpcy5hcGlLZXkgKyAnOicgKyBzaWduYXR1cmUpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnSnNvbi1ScGMtVG9u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AgICAgICAgICAnMWgnOiAnaG91cjEnLFxuICAgICAgICAgICAgICAgICcyaCc6ICdob3VyMicsXG4gICAgICAgICAgICAgICAgJzRoJzogJ2hvdXI0JyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnaG91cjYnLFxuICAgICAgICAgICAgICAgICc4aCc6ICdob3VyOCcsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICdob3VyMTInLFxuICAgICAgICAgICAgICAgICcxZCc6ICdkYXkxJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnd2VlazEnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzgwNjM2MDItOTYwNWUyOGEtMzMwMi0xMWU4LTgxYmUtNjRiMWU1M2M0Y2ZiLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5sYmFuay5pbmZvJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmxiYW5rLmluZm8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cubGJhbmsuaW5mby9hcGkvYXBpLW92ZXJ2aWV3JyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL2xiYW5raW5mby56ZW5kZXNrLmNvbS9oYy96aC1jbi9hcnRpY2xlcy8xMTUwMDIyOTUxMTQtLSVFOCVCNCVCOSVFNyU4RSU4NyVFOCVBRiVCNCVFNiU5OCU4RScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5UGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyc19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnNfaW5mb19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ1FUVU0nOiBhbW91bnQgPT4gTWF0aC5tYXggKDAuMDEsIGFtb3VudCAqICgwLjEgLyAxMDApKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAxMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQyc6IDUwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRNJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOQVMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hXQyc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVFMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5LJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCT1QnOiAzLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWU9ZT1cnOiAxNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RHQyc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NNVCc6IDIwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0VFUic6IDIwMDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGSUwnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY3lQYWlycyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgWyBiYXNlSWQsIHF1b3RlSWQgXSA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkLnRvVXBwZXJDYXNlICgpKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkLnRvVXBwZXJDYXNlICgpKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBbYmFzZSwgcXVvdGVdLmpvaW4gKCcvJyk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGlkLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3RpbWVzdGFtcCddO1xuICAgICAgICBsZXQgaW5mbyA9IHRpY2tlcjtcbiAgICAgICAgdGlja2VyID0gaW5mb1sndGlja2VyJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhdGVzdCcpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0a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AgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAoY29zdCksXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aGlzLnNhZmVWYWx1ZSAodHJhZGUsICdpbmZvJywgdHJhZGUpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnc2l6ZSc6IDEwMCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHNpbmNlKVxuICAgICAgICAgICAgcmVxdWVzdFsndGltZSddID0gcGFyc2VJbnQgKHNpbmNlIC8gMTAwMCk7XG4gICAgICAgIGlmIChsaW1pdClcbiAgICAgICAgICAgIHJlcXVlc3RbJ3NpemUnXSA9IGxpbWl0O1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlcyAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2UsIG1hcmtldCwgc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ICdvcmRlcl9pZCcpLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ29yZGVyX3R5cGUnKSxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRoaXMuc2FmZVZhbHVlIChvcmRlciwgJ2luZm8nLCBvcmRlciksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ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5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgLy8gRXZlcnkgZW5kcG9pbnQgZW5kcyB3aXRoIFwiLmRvXCJcbiAgICAgICAgdXJsICs9ICcuZG8nO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmtleXNvcnQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2FwaV9rZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5U3RyaW5nID0gdGhpcy5yYXdlbmNvZGUgKHF1ZXJ5KSArICcmc2VjcmV0X2tleT0nICsgdGhpcy5zZWNyZXQ7XG4gICAgICAgICAgICBxdWVyeVsnc2lnbiddID0gdGhpcy5oYXNoICh0aGlzLmVuY29kZSAocXVlcnlTdHJpbmcpKS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0d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B0aGFuIG9uZScsXG4gICAgICAgICAgICAgICAgJzEwMDE5JzogJ3dpdGhkcmF3YWwgb3JkZXJzIGNhbiBub3QgYmUgbW9yZSB0aGFuIDMgbGVzcyB0aGFuIG9uZScsXG4gICAgICAgICAgICAgICAgJzEwMDIwJzogJ2xlc3MgdGhhbiB0aGUgbWluaW11bSBhbW91bnQgb2YgdGhlIHRyYW5zYWN0aW9uIGxpbWl0IG9mIDAuMDAxJyxcbiAgICAgICAgICAgIH0sIGVycm9yQ29kZSwgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgbGV0IEVycm9yQ2xhc3MgPSB0aGlzLnNhZmVWYWx1ZSAoe1xuICAgICAgICAgICAgICAgICcxMDAwMic6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzEwMDA0JzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgJzEwMDA1JzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMTAwMDYnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDAwNyc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzEwMDA5JzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICcxMDAxMCc6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAnMTAwMTEnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJzEwMDEyJzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICcxMDAxMyc6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAnMTAwMTQnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJzEwMDE1JzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICcxMDAxNic6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgIH0sIGVycm9yQ29kZSwg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yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk4MjAyMi03NWFlYTgyOC02M2EwLTExZTctOTUxMS1jYTU4NGE4ZWRkNzQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmxpcXVpLmlvL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmxpcXVpLmlvL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2xpcXVpLmlvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vbGlxdWkuaW8vYXBpJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL2xpcXVpLmlvL2ZlZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDb2luRGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3Q29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ3JlYXRlQ291cG9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWRlZW1Db3Vwb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7fSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7fSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdEU0gnOiAnREFTSCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzgwMyc6IEludmFsaWRPcmRlciwgLy8gXCJDb3VudCBjb3VsZCBub3QgYmUgbGVzcyB0aGFuIDAuMDAxLlwiIChzZWxsaW5nIGJlbG93IG1pbkFtb3VudClcbiAgICAgICAgICAgICAgICAnODA0JzogSW52YWxpZE9yZGVyLCAvLyBcIkNvdW50IGNvdWxkIG5vdCBiZSBtb3JlIHRoYW4gMTAwMDAuXCIgKGJ1eWluZyBhYm92ZSBtYXhBbW91bnQpXG4gICAgICAgICAgICAgICAgJzgwNSc6IEludmFsaWRPcmRlciwgLy8gXCJwcmljZSBjb3VsZCBub3QgYmUgbGVzcyB0aGFuIFguXCIgKG1pblByaWNlIHZpb2xhdGlvbiBvbiBidXkgJiBzZWxsKVxuICAgICAgICAgICAgICAgICc4MDYnOiBJbnZhbGlkT3JkZXIsIC8vIFwicHJpY2UgY291bGQgbm90IGJlIG1vcmUgdGhhbiBYLlwiIChtYXhQcmljZSB2aW9sYXRpb24gb24gYnV5ICYgc2VsbClcbiAgICAgICAgICAgICAgICAnODA3JzogSW52YWxpZE9yZGVyLCAvLyBcImNvc3QgY291bGQgbm90IGJlIGxlc3MgdGhhbiBYLlwiIChtaW5Db3N0IHZpb2xhdGlvbiBvbiBidXkgJiBzZWxsKVxuICAgICAgICAgICAgICAgICc4MzEnOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gXCJOb3QgZW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PSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMuc2FmZUludGVnZXIgKG1hcmtldCwgJ2RlY2ltYWxfcGxhY2VzJyksXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5zYWZlSW50ZWdlciAobWFya2V0LCAnZGVjaW1hbF9wbGFjZXMnKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgYW1vdW50TGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluX2Ftb3VudCcpLFxuICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4X2Ftb3VudCcpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbl9wcmljZScpLFxuICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4X3ByaWNlJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGNvc3RMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5fdG90YWwnKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnRMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0TGltaXRzLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBoaWRkZW4gPSB0aGlzLnNhZmVJbnRlZ2VyIChtYXJrZXQsICdoaWRkZW4nKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAoaGlkZGVuID09PSAwKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBtYXJrZXRbJ2ZlZSddIC8gMTAwLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3JldHVybiddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBmdW5kcyA9IGJhbGFuY2VzWydmdW5kcyddO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChmdW5kcyk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGx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MubGVuZ3RoO1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBoYXMgJyArIG51bUlkcy50b1N0cmluZyAoKSArICcgc3ltYm9scyBleGNlZWRpbmcgbWF4IFVSTCBsZW5ndGgsIHlvdSBhcmUgcmVxdWlyZWQgdG8gc3BlY2lmeSBhIGxpc3Qgb2Ygc3ltYm9scyBpbiB0aGUgZmlyc3QgYXJndW1lbnQgdG8gZmV0Y2hPcmRlckJvb2tzJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZHMgPSB0aGlzLm1hcmtldElkcyAoc3ltYm9scyk7XG4gICAgICAgICAgICBpZHMgPSBpZHMuam9pbiAoJy0nKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldERlcHRoUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogaWRzLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBpZHMgPSBPYmplY3Qua2V5cyAocmVzcG9uc2UpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VPcmRlckJvb2sgKHJlc3BvbnNlW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xdWlyZWQgdG8gc3BlY2lmeSBhIGxpc3Qgb2Ygc3ltYm9scyBpbiB0aGUgZmlyc3QgYXJndW1lbnQgdG8gZmV0Y2hUaWNrZXJzJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZHMgPSB0aGlzLm1hcmtldElkcyAoc3ltYm9scyk7XG4gICAgICAgICAgICBpZHMgPSBpZHMuam9pbiAoJy0nKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogaWRzLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgZm9yIChsZXQgayA9IDA7IGsgPCBrZXlzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW2tdO1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbaWRdO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZld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1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFttYXJrZXRJZF07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBhbW91bnQgPSB0cmFkZVsnYW1vdW50J107XG4gICAgICAgIGxldCB0eXBlID0gJ2xpbWl0JzsgLy8gYWxsIHRyYWRlcyBhcmUgc3RpbGwgbGltaXQgdHJhZGVzXG4gICAgICAgIGxldCBpc1lvdXJPcmRlciA9IHRoaXMuc2FmZVZhbHVlICh0cmFkZSwgJ2lzX3lvdXJfb3JkZXInKTtcbiAgICAgICAgbGV0IHRha2VyT3JNYWtlciA9ICd0YWtlcic7XG4gICAgICAgIGlmICh0eXBlb2YgaXNZb3VyT3JkZXIgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgaWYgKGlzWW91ck9yZGVyKVxuICAgICAgICAgICAgICAgIHRha2VyT3JNYWtlciA9ICdtYWtlcic7XG4gICAgICAgIGxldCBmZWUgPSB0aGlzLmNhbGN1bGF0ZUZlZSAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlLCB0YWtlck9yTWFrZXIpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcixcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgIC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gIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAncmF0ZSc6IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSksXG4gICAgICAgIH07XG4gICAgICAgIHByaWNlID0gcGFyc2VGbG9hdCAocHJpY2UpO1xuICAgICAgICBhbW91bnQgPSBwYXJzZUZsb2F0IChhbW91bnQpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VHJhZGUgKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGlkID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICBsZXQgZmlsbGVkID0gMC4wO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gYW1vdW50O1xuICAgICAgICBpZiAoJ3JldHVybicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlkID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZVsncmV0dXJuJ10sIHRoaXMuZ2V0T3JkZXJJZEtleSAoKSk7XG4gICAgICAgICAgICBpZiAoaWQgPT09ICcwJykge1xuICAgICAgICAgICAgICAgIGlkID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZVsncmV0dXJuJ10sICdpbml0X29yZGVyX2lkJyk7XG4gICAgICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmaWxsZWQgPSB0aGlzLnNhZmVGbG9hdCAocmVzcG9uc2VbJ3JldHVybiddLCAncmVjZWl2ZWQnLCAwLjApO1xuICAgICAgICAgICAgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKHJlc3BvbnNlWydyZXR1cm4nXSwgJ3JlbWFpbnMnLCBhbW91bnQpO1xuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IHByaWNlICogZmlsbGVkLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIC8vICd0cmFkZXMnOiB0aGlzLnBhcnNlVHJhZGVzIChvcmRlclsndHJhZGVzJ10sIG1hcmtldCksXG4gICAgICAgIH07XG4gICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IG9yZGVyO1xuICAgICAgICByZXR1cm4gdGhpcy5leHRlbmQgKHsgJ2luZm8nOiByZXNwb25zZSB9LCBvcmRlcik7XG4gICAg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nNhZmVGbG9hdCAob3JkZXIsICdhbW91bnQnKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2Ftb3VudCcpO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMub3JkZXJzKVxuICAgICAgICAgICAgICAgIGFtb3VudCA9IHRoaXMub3JkZXJzW2lkXVsnYW1vdW50J107XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogZmlsbGVkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcm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ZW50IGZyb20gdGhlIGxpc3Qgb2Ygb3BlbiBvcmRlcnMgLT4gbWFyayB0aGUgY2FjaGVkIG9yZGVyIGFzIGNsb3NlZFxuICAgICAgICAgICAgICAgIGlmIChjYWNoZWRPcmRlclsnc3RhdHVzJ10gPT09ICdvcGVuJykge1xuICAgICAgICAgICAgICAgICAgICBjYWNoZWRPcmRlciA9IHRoaXMuZXh0ZW5kIChjYWNoZWRPcmRlciwge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdjbG9zZWQnLCAvLyBsaWtld2lzZSBpdCBtaWdodCBoYXZlIGJlZW4gY2FuY2VsZWQgZXh0ZXJuYWxseSAodW5ub3RpY2VkIGJ5IFwidXNcIilcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb3N0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpbGxlZCc6IGNhY2hlZE9yZGVyWydhbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZW1haW5pbmcnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNhY2hlZE9yZGVyWydjb3N0J10gPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNhY2hlZE9yZGVyWydmaWxsZWQnXSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVkT3JkZXJbJ2Nvc3QnXSA9IGNhY2hlZE9yZGVyWydmaWxsZWQnXSAqIGNhY2hlZE9yZGVyWydwcmljZSddO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2NhY2hlZE9yZGVySWRdID0gY2FjaGVkT3JkZXI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHV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GFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuc2lnbkJvZHlXaXRoU2VjcmV0IChib2R5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHNpZ25hdHVyZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IHRoaXMuZ2V0VmVyc2lvblN0cmluZyAoKSArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdXJsICs9ICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdHRVQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChodHRwQ29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAodHlwZW9mIGJvZHkgIT09ICdzdHJpbmcnKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKGJvZHkubGVuZ3RoIDwgMilcbiAgICAgICAgICAgIHJldHVybjsgLy8gZmFsbGJhY2sgdG8gZGVmYXVsdCBlcnJvciBoYW5kbGVyXG4gICAgICAgIGlmICgoYm9keVswXSA9PT0gJ3snKSB8fCAoYm9keVswXSA9PT0gJ1snKSkge1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICAvLyAxIC0gTGlxdWkgb25seSByZXR1cm5zIHRoZSBpbnRlZ2VyICdzdWNjZXNzJyBrZXkgZnJvbSB0aGVpciBwcml2YXRlIEFQSVxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgLy8gICAgIHsgXCJzdWNjZXNzXCI6IDEsIC4uLiB9IGh0dHBDb2RlID09PSAyMDBcbiAgICAgICAgICAgICAgICAvLyAgICAgeyBcInN1Y2Nlc3NcIjogMCwgLi4uIH0gaHR0cENvZGUgPT09IDIwMFxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgLy8gMiAtIEhvd2V2ZXIsIGV4Y2hhbmdlcyBkZXJpdmVkIGZyb20gTGlxdWksIGNhbiByZXR1cm4gbm9uLWludGVnZXJzXG4gICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICAvLyAgICAgSXQgY2FuIGJlIGEgbnVtZXJpYyBzdHJpbmdcbiAgICAgICAgICAgICAgICAvLyAgICAgeyBcInN1Y2Vzc3NcIjogXCIxXCIsIC4uLiB9XG4gICAgICAgICAgICAgICAgLy8gICAgIHsgXCJzdWNlc3NzXCI6IFwiMFwiLCAuLi4gfSwgaHR0cENvZGUgPj0gMjAwIChjYW4gYmUgNDAzLCA1MDIsIGV0YylcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIC8vICAgICBPciBqdXN0IGEgc3RyaW5nXG4gICAgICAgICAgICAgICAgLy8gICAgIHsgXCJzdWNjZXNzXCI6IFwidHJ1ZVwiLCAuLi4gfVxuICAgICAgICAgICAgICAgIC8vICAgICB7IFwic3VjY2Vzc1wiOiBcImZhbHNlXCIsIC4uLiB9LCBodHRwQ29kZSA+PSAyMDBcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIC8vICAgICBPciBhIGJvb2xlYW5cbiAgICAgICAgICAgICAgICAvLyAgICAgeyBcInN1Y2Nlc3NcIjogdHJ1ZSwgLi4uIH1cbiAgICAgICAgICAgICAgICAvLyAgICAgeyBcInN1Y2Nlc3NcIjogZmFsc2UsIC4uLiB9LCBodHRwQ29kZSA+PSAyMDBcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIC8vIDMgLSBPdmVyc2ltcGxpZmllZCwgUHl0aG9uIFBFUDggZm9yYmlkcyBjb21wYXJpc29uIG9wZXJhdG9yICg9PT0pIG9mIGRpZmZlcmVudCB0eXBlc1xuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgLy8gNCAtIFdlIGRvIG5vdCB3YW50IHRvIGNvcHktcGFzdGUgYW5kIGR1cGxpY2F0ZSB0aGUgY29kZSBvZiB0aGlzIGhhbmRsZXIgdG8gb3RoZXIgZXhjaGFuZ2VzIGRlcml2ZWQgZnJvbSBMaXF1aVxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgLy8gVG8gY292ZXIgcG9pbnRzIDEsIDIsIDMgYW5kIDQgY29tYmluZWQgdGhpcyBoYW5kbGVyIHNob3VsZCB3b3JrIGxpa2UgdGhpczpcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIGxldCBzdWNjZXNzID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAnc3VjY2VzcycsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHN1Y2Nlc3MgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoc3VjY2VzcyA9PT0gJ3RydWUnKSB8fCAoc3VjY2VzcyA9PT0gJzEnKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Y2Nlc3MgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWNjZXNzID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghc3VjY2Vzcykge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBjb2RlID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ2NvZGUnKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdlcnJvcicpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBmZWVkYmFjayA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZXhjZXB0aW9ucyA9IHRoaXMuZXhjZXB0aW9ucztcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGUgaW4gZXhjZXB0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IGV4Y2VwdGlvbnNbY29kZV0gKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBuZWVkIGEgc2Vjb25kIGVycm9yIG1hcCBmb3IgdGhlc2UgbWVzc2FnZXMsIGFwcGFyZW50bHkuLi5cbiAgICAgICAgICAgICAgICAgICAgLy8gaW4gZmFjdCwgd2UgY2FuIHVzZSB0aGUgc2FtZSAuZXhjZXB0aW9ucyB3aXRoIHN0cmluZy1rZXlzIHRvIHNhdmUgc29tZSBsb2MgaGVyZVxuICAgICAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSA9PT0gJ2ludmFsaWQgYXBpIGtleScpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ2ludmFsaWQgc2lnbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ2FwaSBrZXkgZG9udCBoYXZlIHRyYWRlIHBlcm1pc3Npb24nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ2ludmFsaWQgcGFyYW1ldGVyJykgPj0gMCkgeyAvLyBlcnJvckNvZGUgMCwgcmV0dXJuZWQgb24gYnV5KHN5bWJvbCwgMCwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnaW52YWxpZCBvcmRlcicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnUmVxdWVzdHMgdG9vIG9mdGVuJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ25vdCBhdmFpbGFibGUnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VOb3RBdmFpbGFibGUgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnZGF0YSB1bmF2YWls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udC5jb20vMTI5NDQ1NC8yNzk4MDc2OC1mMjJmYzQyNC02MzhhLTExZTctODljOS02MDEwYTU0ZmY5YmUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmxpdmVjb2luLm5ldCcsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5saXZlY29pbi5uZXQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cubGl2ZWNvaW4ubmV0L2FwaT9sYW5nPWVuJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYWxsL29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2xhc3RfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9tYXhiaWRfbWluYXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9vcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9yZXN0cmljdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RpY2tlcicsIC8vIG9taXQgcGFyYW1zIHRvIGdldCBhbGwgdGlja2VycyBhdCBvbmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9jb2luSW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9jbGllbnRfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9jb21taXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9jb21taXNzaW9uQ29tbW9uSW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9iYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2dldC9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2hpc3Rvcnkvc2l6ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9oaXN0b3J5L3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2J1eWxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9idXltYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2NhbmNlbGxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9zZWxsbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3NlbGxtYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L2NhcGl0YWxpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L2NhcmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L2NvaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L29rcGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L291dC9wYXllZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L3BlcmZlY3Rtb25leScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC92b3VjaGVyL2Ftb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC92b3VjaGVyL21ha2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvdm91Y2hlci9yZWRlZW0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjE4IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjE4IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NQQyc6ICdDYXByaWNvaW4nLFxuICAgICAgICAgICAgICAgICdDUkMnOiAnQ3J5Q2FzaCcsXG4gICAgICAgICAgICAgICAgJ09SRSc6ICdPcmVjdGljJyxcbiAgICAgICAgICAgICAgICAnUlVSJzogJ1JVQicsXG4gICAgICAgICAgICAgICAgJ1hCVCc6ICdCcmlja3RveCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzEnOiBFeGNoYW5nZUVycm9yLFxuICAgICAgICAgICAgICAgICcxMCc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzEwMCc6IEV4Y2hhbmdlRXJyb3IsIC8vIGludmFsaWQgcGFyYW1ldGVyc1xuICAgICAgICAgICAgICAgICcxMDEnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDInOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDMnOiBJbnZhbGlkT3JkZXIsIC8vIGludmFsaWQgY3VycmVuY3lcbiAgICAgICAgICAgICAgICAnMTA0JzogSW52YWxpZE9yZGVyLCAvLyBpbnZhbGlkIGFtb3VudFxuICAgICAgICAgICAgICAgICcxMDUnOiBJbnZhbGlkT3JkZXIsIC8vIHVuYWJsZSB0byBibG9jayBmdW5kc1xuICAgICAgICAgICAgICAgICcxMSc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzEyJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMic6IEF1dGhlbnRpY2F0aW9uRXJyb3IsIC8vIFwiVXNlciBub3QgZm91bmRcIlxuICAgICAgICAgICAgICAgICcyMCc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzMwJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMzEnOiBOb3RTdXBwb3J0ZWQsXG4gICAgICAgICAgICAgICAgJzMyJzogRXhjaGFuZ2VFcnJvcixcbiAgICAgICAgICAgICAgICAnNDI5JzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgJzUwMyc6IEV4Y2hhbmdlTm90QXZhaWxhYmxlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEV4Y2hhbmdlVG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gucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmIChjb2luUmVzdHJpY3Rpb25zKSB7XG4gICAgICAgICAgICAgICAgcHJlY2lzaW9uWydwcmljZSddID0gdGhpcy5zYWZlSW50ZWdlciAoY29pblJlc3RyaWN0aW9ucywgJ3ByaWNlU2NhbGUnLCA1KTtcbiAgICAgICAgICAgICAgICBsaW1pdHNbJ2Ftb3VudCddWydtaW4nXSA9IHRoaXMuc2FmZUZsb2F0IChjb2luUmVzdHJpY3Rpb25zLCAnbWluTGltaXRRdWFudGl0eScsIGxpbWl0c1snYW1vdW50J11bJ21pbiddKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxpbWl0c1sncHJpY2UnXSA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzogbGltaXRzLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0SW5mb0NvaW5JbmZvIChwYXJhbXMpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IHJlc3BvbnNlWydpbmZvJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY3lbJ3N5bWJvbCddO1xuICAgICAgICAgICAgLy8gdG9kbzogd2lsbCBuZWVkIHRvIHJldGhpbmsgdGhlIGZlZXNcbiAgICAgICAgICAgIC8vIHRvIGFkZCBzdXBwb3J0IGZvciBtdWx0aXBsZSB3aXRoZHJhd2FsL2RlcG9zaXQgbWV0aG9kcyBhbmRcbiAgICAgICAgICAgIC8vIGRpZmZlcmVudGlhdGVkIGZlZXMgZm9yIGVhY2ggcGFydGljdWxhciBtZXRob2RcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSA4OyAvLyBkZWZhdWx0IHByZWNpc2lvbiwgdG9kbzogZml4IFwibWFnaWMgY29uc3RhbnRzXCJcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAoY3VycmVuY3lbJ3dhbGxldFN0YXR1cyddID09PSAnbm9ybWFsJyk7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5Wyd3aXRoZHJhd0ZlZSddLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnbWluT3JkZXJBbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ21pbk9yZGVyQW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ21pbldpdGhkcmF3QW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnbWluRGVwb3NpdEFtb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXN1bHQgPSB0aGlzLmFwcGVuZEZpYXRDdXJyZW5jaWVzIChyZXN1bHQpO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFwcGVuZEZpYXRDdXJyZW5jaWVzIChyZXN1bHQgPSBbXSkge1xuICAgICAgICBsZXQgcHJlY2lzaW9uID0gODtcbiAgICAgICAgbGV0IGRlZmF1bHRzID0ge1xuICAgICAgICAgICAgJ2luZm8nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHsgJ21pbic6IHVuZGVmaW5lZCwgJ21heCc6IHVuZGVmaW5lZCB9LFxuICAgICAgICAgICAgICAgICdkZXBvc2l0JzogeyAnbWluJzogdW5kZWZpbmVkLCAnbWF4JzogdW5kZWZpbmVkIH0sXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHsgJ21pbic6IHVuZGVmaW5lZCwgJ21heCc6IHVuZGVmaW5lZCB9LFxuICAgICAgICAgICAgICAgICdjb3N0JzogeyAnbWluJzogdW5kZWZpbmVkLCAnbWF4JzogdW5kZWZpbmVkIH0sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBbXG4gICAgICAgICAgICB7ICdpZCc6ICdVU0QnLCAnY29kZSc6ICdVU0QnLCAnbmFtZSc6ICdVUyBEb2xsYXInIH0sXG4gICAgICAgICAgICB7ICdpZCc6ICdFVVInLCAnY29kZSc6ICdFVVInLCAnbmFtZSc6ICdFdXJvJyB9LFxuICAgICAgICAgICAgLy8geyAnaWQnOiAnUlVSJywgJ2NvZGUnOiAnUlVCJywgJ25hbWUnOiAnUnVzc2lhbiBydWJsZScgfSxcbiAgICAgICAgXTtcbiAgICAgICAgY3VycmVuY2llcy5wdXNoICh7XG4gICAgICAgICAgICAnaWQnOiAnUlVSJyxcbiAgICAgICAgICAgICdjb2RlJzogdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKCdSVVInKSxcbiAgICAgICAgICAgICduYW1lJzogJ1J1c3NpYW4gcnVibGUnLFxuICAgICAgICB9KTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSBjdXJyZ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pbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnaWQnXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgICAgICAnZmVlJzoge1xuICAgICAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBxdW90ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlcnMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgcmVxdWVzdCA9I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AgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyBwYXRoO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5rZXlzb3J0IChwYXJhbXMpKTtcbiAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdQT1NUJylcbiAgICAgICAgICAgICAgICBib2R5ID0gcXVlcnk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMjU2Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBcGktS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAodHlwZW9mIGJvZHkgIT09ICdzdHJpbmcnKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmIChjb2RlID49IDMwMCkge1xuICAgICAgICAgICAgICAgIGxldCBlcnJvckNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnZXJyb3JDb2RlJyk7XG4gICAgICAgICAgICAgICAgaWYgKGVycm9yQ29kZSBpbiB0aGlzLmV4Y2VwdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IEV4Y2VwdGlvbkNsYXNzID0gdGhpcy5leGNlcHRpb25zW2Vycm9yQ29kZV07XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNlcHRpb25DbGFzcyAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gcmV0dXJucyBzdGF0dXMgY29kZSAyMDAgZXZlbiBpZiBzdWNjZXNzID09PSBmYWxzZVxuICAgICAgICAgICAgbGV0IHN1Y2Nlc3MgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2UsICdzdWNjZXNzJywgdHJ1ZSk7XG4gICAgICAgICAgICBpZiAoIXN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufTtcbiIsIid1c2Ugc3Ry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jlkOC01ZWRlLTExZTctOTMwYy01NDBiNWViOWJlMjQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLm15Yml0eC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lmx1bm8uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubHVuby5jb20vZW4vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vbnBtanMub3JnL3BhY2thZ2UvYml0eCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYmF1c21laWVyL25vZGUtYml0eCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL3tpZH0vdHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmZWVfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0b3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc3RvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0b3BvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvYXV0aDIvZ3JhbnQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3Rlcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1sndGlja2VycyddLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sndGlja2VycyddW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydwYWlyJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0a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ZScpO1xuICAgICAgICBsZXQgcXVvdGVGZWUgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdmZWVfY291bnRlcicpO1xuICAgICAgICBsZXQgYmFzZUZlZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2ZlZV9iYXNlJyk7XG4gICAgICAgIGxldCBmZWUgPSB7ICdjdXJyZW5jeSc6IHVuZGVmaW5lZCB9O1xuICAgICAgICBpZiAocXVvdGVGZWUpIHtcbiAgICAgICAgICAgIGZlZVsnc2lkZSddID0gJ3F1b3RlJztcbiAgICAgICAgICAgIGZlZVsnY29zdCddID0gcXVvdGVGZWU7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBmZWVbJ3NpZGUnXSA9ICdiYXNlJztcbiAgICAgICAgICAgIGZlZVsnY29zdCddID0gYmFzZUZlZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyX2lkJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0cmFkZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRPcmRlcnNJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlciAocmVzcG9uc2UpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd0aW1lc3RhbXAnXTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3RfdHJhZGUnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiaWQnKSxcbiAgICAgICAgICA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dCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgc2lkZSA9ICh0cmFkZVsnaXNfYnV5J10pID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ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ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3QnO1xuICAgICAgICBsZXQgb3JkZXIgPSB7ICdwYWlyJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSB9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnTWFya2V0b3JkZXInO1xuICAgICAgICAgICAgb3JkZXJbJ3R5cGUnXSA9IHNpZGUudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBpZiAoc2lkZSA9PT0gJ2J1eScpXG4gICAgICAgICAgICAgICAgb3JkZXJbJ2NvdW50ZXJfdm9sdW1lJ10gPSBhbW91bnQ7XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgb3JkZXJbJ2Jhc2Vfdm9sdW1lJ10gPSBhbW91bnQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ1Bvc3RvcmRlcic7XG4gICAgICAgICAgICBvcmRlclsndm9sdW1lJ10gPSBhbW91bnQ7XG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICAgICAgaWYgKHNpZGUgPT09ICdidXknKVxuICAgICAgICAgICAgICAgIG9yZGVyWyd0eXBlJ10gPSAnQklEJztcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBvcmRlclsndHlwZSddID0gJ0FTSyc7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIC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ICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnbHlra2UnLFxuICAgICAgICAgICAgJ25hbWUnOiAnTHlra2UnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDSCcsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zNDQ4NzYyMC0zMTM5YTdiMC1lZmU2LTExZTctOTBmNS1lNTIwY2VmNzQ0NTEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnbW9iaWxlJzogJ2h0dHBzOi8vYXBpLmx5a2tleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2hmdC1hcGkubHlra2UuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vaGZ0LWFwaS5seWtrZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3Rlc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9iaWxlJzogJ2h0dHBzOi8vYXBpLmx5a2tleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9oZnQtc2VydmljZS1kZXYubHlra2V4Lm5ldC9hcGknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9oZnQtc2VydmljZS1kZXYubHlra2V4Lm5ldC9hcGknLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5seWtrZS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2hmdC1hcGkubHlra2UuY29tL3N3YWdnZXIvdWkvJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lmx5a2tlLmNvbS9seWtrZV9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cubHlra2UuY29tL3RyYWRpbmctY29uZGl0aW9ucycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnbW9iaWxlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FsbEFzc2V0UGFpclJhdGVzL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXNzZXRQYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXNzZXRQYWlycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJc0FsaXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlckJvb2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlckJvb2tzL3tBc3NldFBhaXJJZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVycy9saW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJzL21hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJzL3tpZH0vQ2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wLCAvLyBhcyBvZiA3IEZlYiAyMDE4LCBzZWUgaHR0cHM6Ly9naXRodWIuY29tL2NjeHQvY2N4dC9pc3N1ZXMvMTg2M1xuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAsIC8vIGh0dHBzOi8vd3d3Lmx5a2tlLmNvbS9jcC93YWxsZXQtZmVlcy1hbmQtbGltaXRzXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0V2FsbGV0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2ldO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnQXNzZXRJZCddO1xuICAgICAgICAgICAgbGV0IHRvdGFsID0gYmFsYW5jZVsnQmFsYW5jZSddO1xuICAgICAgICAgICAgbGV0IHVzZWQgPSBiYWxhbmNlWydSZXNlcnZlZCddO1xuICAgICAgICAgICAgbGV0IGZyZWUgPSB0b3RhbCAtIHVzZWQ7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogZnJlZSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHVzZWQsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogdG90YWwsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlcnNJZENhbmNlbCAoeyAnaWQnOiBpZCB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBxdWVyeSA9IHtcbiAgICAgICAgICAgICdBc3NldFBhaXJJZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdPcmRlckFjdGlvbic6IHRoaXMuY2FwaXRhbGl6ZSAoc2lkZSksXG4gICAgICAgICAgICAnVm9sdW1lJzogYW1vdW50LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIHF1ZXJ5WydBc3NldCddID0gKHNpZGUgPT09ICdidXknKSA/IG1hcmtldFsnYmFzZSddIDogbWFya2V0WydxdW90ZSddO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT09ICdsaW1pdCcpIHtcbiAgICAgICAgICAgIHF1ZXJ5WydQcmljZSddID0gcHJpY2U7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG1ldGhvZCA9ICdwcml2YXRlUG9zdE9yZGVycycgKyB0aGlzLmNhcGl0YWxpemUgKHR5cGUpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAocXVlcnksIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiByZXN1bHQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEFzc2V0UGFpcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnSWQnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydCYXNlQXNzZXRJZCddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydRdW90aW5nQXNzZXRJZCddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ05hbWUnXTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnQWNjdXJhY3knXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ0ludmVydGVkQWNjdXJhY3knXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB0aWNrZXIgPSB0aWNrZXJbJ1Jlc3VsdCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsb3cnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydSYXRlJ11bJ0JpZCddKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydSYXRlJ11bJ0FzayddKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLm1vYmlsZUdldEFsbEFzc2V0UGFpclJhdGVzTWFya2V0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlclN0YXR1cyAoc3RhdHVzKSB7XG4gICAgICAgIGlmIChzdGF0dXMgPT09ICdQZW5kaW5nJykge1xuICAgICAgICAgICAgcmV0dXJuICdvcGVuJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT09ICdJbk9yZGVyQm9vaycpIHtcbiAgICAgICAgICAgIHJldHVybiAnb3Blbic7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09PSAnUHJvY2Vzc2luZycpIHtcbiAgICAgICAgICAgIHJldHVybiAnb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Bjb3N0ID0gZmlsbGVkICogcHJpY2U7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ0lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldE9yZGVyc0lkICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBy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bXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpXG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnYXBpLWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdBY2NlcHQnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnUE9TVCcpXG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycy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sb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc4MzcwNjAtZTdjNTg3MTQtNjBlYS0xMWU3LTkxOTItZjA1ZTg2YWRiODNmLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cubWVyY2Fkb2JpdGNvaW4ubmV0L3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5jb20uYnInLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5jb20uYnIvYXBpLWRvYycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5jb20uYnIvdHJhZGUtYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y29pbn0vb3JkZXJib29rLycsIC8vIGxhc3Qgc2xhc2ggY3JpdGljYWxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y29pbn0vdGlja2VyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L3RyYWRlcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjb2lufS90cmFkZXMve2Zyb219LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L3RyYWRlcy97ZnJvbX0ve3RvfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L2RheS1zdW1tYXJ5L3t5ZWFyfS97bW9udGh9L3tkYXl9LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfYWNjb3VudF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X3N5c3RlbV9tZXNzYWdlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3Rfb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZV9idXlfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlX3NlbGxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2NvaW4nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9CUkwnOiB7ICdpZCc6ICdCUkxCVEMnLCAnc3ltYm9sJzogJ0JUQy9CUkwnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQlJMJywgJ3N1ZmZpeCc6ICdCaXRjb2luJyB9LFxuICAgICAgICAgICAgICAgICdMVEMvQlJMJzogeyAnaWQnOiAnQlJMTFRDJywgJ3N5bWJvbCc6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hpcy5jYXBpdGFsaXplIChzaWRlKSArICdPcmRlcic7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdjb2luX3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ3F1YW50aXR5JzogYW1vdW50LFxuICAgICAgICAgICAgJ2xpbWl0X3ByaWNlJzogcHJpY2UsXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsncmVzcG9uc2VfZGF0YSddWydvcmRlciddWydvcmRlcl9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBpZiAoIXN5bWJvbClcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBjYW5jZWxPcmRlcigpIHJlcXVpcmVzIGEgc3ltYm9sIGFyZ3VtZW50Jyk7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjb2luX3BhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnb3JkZXJfaWQnOiBpZCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc2lkZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdvcmRlcl90eXBlJyBpbiBvcmRlcilcbiAgICAgICAgICAgIHNpZGUgPSAob3JkZXJbJ29yZGVyX3R5cGUnXSA9PT0gMSkgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgbGV0IHN0YXR1cyA9IG9yZGVyWydzdGF0dXMnXTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGlmICgnY29pbl9wYWlyJyBpbiBvcmRlcilcbiAgICAgICAgICAgICAgICBpZiAob3JkZXJbJ2NvaW5fcGFpciddIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW29yZGVyWydjb2luX3BhaXInXV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnY3JlYXRlZF90aW1lc3RhbXAnIGluIG9yZGVyKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gcGFyc2VJbnQgKG9yZGVyWydjcmVhdGVkX3RpbWVzdGFtcCddKSAqIDEwMDA7XG4gICAgICAgIGlmICgndXBkYXRlZF90aW1lc3RhbXAnIGluIG9yZGVyKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gcGFyc2VJbnQgKG9yZGVyWyd1cGRhdGVkX3RpbWVzdGFtcCddKSAqIDEwMDA7XG4gICAgICAgIGxldCBmZWUgPSB7XG4gICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2ZlZScpLFxuICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdsaW1pdF9wcmljZScpO1xuICAgICAgICAvLyBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2V4ZWN1dGVkX3ByaWNlX2F2ZycsIHByaWNlKTtcbiAgICAgICAgbGV0IGF2ZXJhZ2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdleGVjdXRlZF9wcmljZV9hdmcnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3F1YW50aXR5Jyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdleGVjdXRlZF9xdWFudGl0eScpO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICBsZXQgY29zdCA9IGFtb3VudCAqIGF2ZXJhZ2U7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyX2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgIC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8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ2J0Y191c2QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJywgJ21ha2VyJzogMC4wMDE1LCAndGFrZXInOiAwLjAwMjUgfSxcbiAgICAgICAgICAgICAgICAnRVRIL0JUQyc6IHsgJ2lkJzogJ2V0aF9idGMnLCAnc3ltYm9sJzogJ0VUSC9CVEMnLCAnYmFzZSc6ICdFVEgnLCAncXVvdGUnOiAnQlRDJywgJ21ha2VyJzogMC4wMDEsICd0YWtlcic6IDAuMDAxNSB9LFxuICAgICAgICAgICAg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gICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2wnKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0cmFkZVsnZGF0ZSddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAncHJpY2UnKSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdhbW91bnQnKSxcbiAgICAgICAgfTtcbi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ZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydyZXN1bHQnXVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWwgKHsgJ2lkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBuZWdvY2llY29pbnMgZXh0ZW5kcyBFeGNoYW5nZSB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ25lZ29jaWVjb2lucycsXG4gICAgICAgICAgICAnbmFtZSc6ICdOZWdvY2llQ29pbnMnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdCUicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YzJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM4MDA4NTcxLTI1YTYyNDZlLTMyNTgtMTFlOC05NjliLWFlYjY5MTA0OTI0NS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9icm9rZXIubmVnb2NpZWNvaW5zLmNvbS5ici9hcGkvdjMnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2Jyb2tlci5uZWdvY2llY29pbnMuY29tLmJyL3RyYWRlYXBpL3YxJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cubmVnb2NpZWNvaW5zLmNvbS5icicsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5lZ29jaWVjb2lucy5jb20uYnIvZG9jdW1lbnRhY2FvLXRyYWRlYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5lZ29jaWVjb2lucy5jb20uYnIvZG9jdW1lbnRhY2FvLWFwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5uZWdvY2llY29pbnMuY29tLmJyL2NvbWlzc29lcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tQQVJ9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAne1BBUn0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7UEFSfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tQQVJ9L3RyYWRlcy97dGltZXN0YW1wX2luaWNpYWx9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7UEFSfS90cmFkZXMve3RpbWVzdGFtcF9pbmljaWFsfS97dGltZXN0YW1wX2ZpbmFsfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXIve29yZGVySWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXIve29yZGVySWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCMlgvQlJMJzogeyAnaWQnOiAnYjJ4YnJsJywgJ3N5bWJvbCc6ICdCMlgvQlJMJywgJ2Jhc2UnOiAnQjJYJywgJ3F1b3RlJzogJ0JSTCcgfSxcbiAgICAgICAgICAgICAgICAnQkNIL0JSTCc6IHsgJ2lkJzogJ2JjaGJybCcsICdzeW1ib2wnOiAnQkNIL0JSTCcsICdiYXNlJzogJ0JDSCcsICdxdW90ZSc6ICdCUkwnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9CUkwnOiB7ICdpZCc6ICdidGNicmwnLCAnc3ltYm9sJzogJ0JUQy9CUkwnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQlJMJyB9LFxuICAgICAgICAgICAgICAgICdCVEcvQlJMJzogeyAnaWQnOiAnYnRnYnJsJywgJ3N5bWJvbCc6ICdCVEcvQlJMJywgJ2Jhc2UnOiAnQlRHJywgJ3F1b3RlJzogJ0JSTCcgfSxcbiAgICAgICAgICAgICAgICAnREFTSC9CUkwnOiB7ICdpZCc6ICdkYXNoYnJsJywgJ3N5bWJvbCc6ICdEQVNIL0JSTCcsICdiYXNlJzogJ0RBU0gnLCAncXVvdGUnOiAnQlJMJyB9LFxuICAgICAgICAgICAgICAgICdMVEMvQlJMJzogeyAnaWQnOiAnbHRjYnJsJywgJ3N5bWJvbCc6ICdMVEMvQlJMJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ0JSTCcgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDMsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDA0LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMDAwMDksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWydkYXRlJ10gKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKSA/IG1hcmtldFsnc3ltYm9sJ10gOiB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudG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JyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tpZF07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBwYXJzZUZsb2F0IChiYWxhbmNlWyd0b3RhbCddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhdmFpbGFibGUnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICghbWFya2V0KSB7XG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLnNhZmVWYWx1ZSAodGhpcy5tYXJrZXRzQnlJZCwgb3JkZXJbJ3BhaXInXSk7XG4gICAgICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxIChvcmRlclsnY3JlYXRlZCddKTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICA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N0YW1wLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAndHJhZGVzJzogdHJhZGVzLFxuICAgICAgICAgICAgJ2ZlZSc6IHtcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ3F1b3RlJ10sXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdmZWUnKSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFVzZXJPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3ByaWNlJ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0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBsZXQgcXVlcnlTdHJpbmcgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKHF1ZXJ5U3RyaW5nLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnlTdHJpbmc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnNlY29uZHMgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGNvbnRlbnQgPSAnJztcbiAgICAgICAgICAgIGlmIChxdWVyeVN0cmluZy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgY29udGVudCA9IHRoaXMuaGFzaCAodGhpcy5lbmNvZGUgKGJvZHkpLCAnbWQ1JywgJ2Jhc2U2NCcpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gJyc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdXJpID0gdGhpcy5lbmNvZGVVUklDb21wb25lbnQgKHVybCkudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IFsgdGhpcy5hcGlLZXksIG1ldGhvZCwgdXJpLCB0aW1lc3RhbXAsIG5vbmNlLCBjb250ZW50IF0uam9pbiAoJycpO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuYmFzZTY0VG9CaW5hcnkgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChwYXlsb2FkKSwgdGhpcy5lbmNvZGUgKHNlY3JldCksICdzaGEyNTYnLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBzaWduYXR1cmUgPSB0aGlzLmJpbmFyeVRvU3RyaW5nIChzaWduYXR1cmUpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBbIHRoaXMuYXBpS2V5LCBzaWduYXR1cmUsIG5vbmNlLCB0aW1lc3RhbXAgXS5qb2luICgnOicpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQXV0aG9yaXphdGlvbic6ICdhbXggJyArIGF1dGgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ1BPU1QnKSB7XG4gICAgICAgICAgICAgICAgaGVhZGVyc1snQ29udGVudC1UeXBlJ10gPSAnYXBwbGljYXRpb24vanNvbjsgY2hhcnNldD1VVEYtOCc7XG4gICAgICAgICAgICAgICAgaGVhZGVyc1snQ29udGVudC1MZW5ndGgnXSA9IGJvZHkubGVuZ3RoO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChxdWVyeVN0cmluZy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnlTdHJpbmc7XG4gICAgICAgICAgICAgICAgYm9keSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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Vtb3RlJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vbm92YWV4Y2hhbmdlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL25vdmFleGNoYW5nZS5jb20vcmVtb3RlL2ZhcScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3tiYXNlY3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2luZm8ve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29yZGVyaGlzdG9yeS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbm9yZGVycy97cGFpcn0vYnV5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW5vcmRlcnMve3BhaXJ9L3NlbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbm9yZGVycy97cGFpcn0vYm90aC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVub3JkZXJzL3twYWlyfS97b3JkZXJ0eXBlfS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbGFuY2VzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YmFsYW5jZS97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdHMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR3aXRoZHJhd2Fscy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG5ld2RlcG9zaXRhZGRyZXNzL3tjdXJyZW5jeX0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRkZXBvc2l0YWRkcmVzcy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXlvcGVub3JkZXJzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXlvcGVub3JkZXJzX21hcmtldC97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxvcmRlci97b3JkZXJpZH0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVoaXN0b3J5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdGhpc3RvcnkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR3aXRoZHJhd2FsaGlzdG9yeS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHN0YXR1cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHN0YXR1cy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnbWFya2V0cyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ21hcmtldG5hbWUnXTtcbiAgICAgICAgICAgIGxldCBbIHF1b3RlLCBiYXNlIF0gPSBpZC5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmIChtYXJrZXRbJ2Rpc2FibGVkJ10pXG4gICAgICAgICAgICAgICAgYWN0aXZlID0gZmFsc2U7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRPcGVub3JkZXJzUGFpckJvdGggKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAg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ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGxvY2tib3ggPSBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnRfbG9ja2JveCddKTtcbiAgICAgICAgICAgIGxldCB0cmFkZXMgPSBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnRfdHJhZGVzJ10pO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiB0aGlzLnN1bSAobG9ja2JveCwgdHJhZGVzKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnRfdG90YWwnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICh0eXBlID09PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0c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cy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKVxuICAgICAgICAgICAgdXJsICs9IGFwaSArICcvJztcbiAgICAgICAgdXJsICs9IHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlICh7ICdub25jZSc6IG5vbmNlIH0pO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHVybCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2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4dGVuZHMgb2tjb2ludXNkIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnb2tjb2luY255JyxcbiAgICAgICAgICAgICduYW1lJzogJ09LQ29pbiBDTlknLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDTicsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2Njc5Mi04YmU5MTU3YS01ZWU1LTExZTctOTI2Yy02ZDY5YjhkMzM3OGQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd3d3Lm9rY29pbi5jbicsXG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cub2tjb2luLmNuL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3Lm9rY29pbi5jbi9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5va2NvaW4uY24nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cub2tjb2luLmNuL3Jlc3RfZ2V0U3RhcnRlZC5odG1sJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0NOWSc6IHsgJ2lkJzogJ2J0Y19jbnknLCAnc3ltYm9sJzogJ0JUQy9DTlknLCAnYm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ZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmdXR1cmVzJzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4dGVuc2lvbic6ICcuZG8nLCAvLyBhcHBlbmRlZCB0byBlbmRwb2ludCBVUkxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbWluJyxcbiAgICAgICAgICAgICAgICAnM20nOiAnM21pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtaW4nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaG91cicsXG4gICAgICAgICAgICAgICAgJzJoJzogJzJob3VyJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnNGhvdXInLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aG91cicsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnM2QnOiAnM2RheScsXG4gICAgICAgICAgICAgICAgJzF3JzogJzF3ZWVrJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3ZWInOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy9jdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3Byb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlX3JhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2VzdGltYXRlZF9wcmljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2hvbGRfYW1vdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfaW5kZXgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9rbGluZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3ByaWNlX2xpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrbGluZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3RjcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRfcmVjb3JkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmF0Y2hfdHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JvcnJvd19tb25leScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9ycm93X29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JvcnJvd3NfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX2JvcnJvdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3RjX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9iYXRjaF90cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2Rldm9sdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9leHBsb3NpdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9vcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfb3JkZXJzX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9wb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3Bvc2l0aW9uXzRmaXgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV90cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3RyYWRlc19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdXNlcmluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV91c2VyaW5mb180Zml4JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kX2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9mZWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyc19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvdGNfb3JkZXJfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3RjX29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcGF5bWVudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3VibWl0X290Y19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX290Y19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VucmVwYXltZW50c19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyaW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NzkxLTg5ZmZiNTAyLTVlZTUtMTFlNy04YTViLWM1OTUwYjY4YWM2NS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly93d3cub2tjb2luLmNvbS92MicsXG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cub2tjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3d3dy5va2NvaW4uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lm9rY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5va2NvaW4uY29tL3Jlc3RfZ2V0U3RhcnRlZC5odG1sJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5wbWpzLmNvbS9wYWNrYWdlL29rY29pbi5jb20nLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMixcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcxMDA5JzogT3JkZXJOb3RGb3VuZCwgLy8gZm9yIHNwb3QgbWFya2V0cywgY2FuY2VsbGluZyBjbG9zZWQgb3JkZXJcbiAgICAgICAgICAgICAgICAnMTA1MSc6IE9yZGVyTm90Rm91bmQsIC8vIGZvciBzcG90IG1hcmtldHMsIGNhbmNlbGxpbmcgXCJqdXN0IGNsb3NlZFwiIG9yZGVyXG4gICAgICAgICAgICAgICAgJzEwMTknOiBPcmRlck5vdEZvdW5kLCAvLyBvcmRlciBjbG9zZWQ/XG4gICAgICAgICAgICAgICAgJzIwMDE1JzogT3JkZXJOb3RGb3VuZCwgLy8gZm9yIGZ1dHVyZSBtYXJrZXRzXG4gICAgICAgICAgICAgICAgJzEwMTMnOiBJbnZhbGlkT3J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gICAgICAgICAgICdhbW91bnQnOiBtYXJrZXRzW2ldWydtYXhTaXplRGlnaXQnXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRzW2ldWydtYXhQcmljZURpZ2l0J10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgbGV0IG1pbkFtb3VudCA9IG1hcmtldHNbaV1bJ21pblRyYWRlU2l6ZSddO1xuICAgICAgICAgICAgbGV0IG1pblByaWNlID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAobWFya2V0c1tpXVsnb25saW5lJ10gIT09IDApO1xuICAgICAgICAgICAgbGV0IGJhc2VOdW1lcmljSWQgPSBtYXJrZXRzW2ldWydiYXNlQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZU51bWVyaWNJZCA9IG1hcmtldHNbaV1bJ3F1b3RlQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYmFzZU51bWVyaWNJZCc6IGJhc2VOdW1lcmljSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlTnVtZXJpY0lkJzogcXVvdGVOdW1lcmljSWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXRzW2ldLFxuICAgICAgICAgICAgICAgICd0eXBlJzogJ3Nwb3QnLFxuICAgICAgICAgICAgICAgICdzcG90JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZnV0dXJlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtaW5BbW91bnQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWluUHJpY2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtaW5BbW91bnQgKiBtaW5QcmljZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKG1hcmtldCk7XG4gICAgICAgICAgICBsZXQgZnV0dXJlUXVvdGUgPSAobWFya2V0WydxdW90ZSddID09PSAnVVNEVCcpID8gJ1VTRCcgOiBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgICAgICBsZXQgZnV0dXJlU3ltYm9sID0gbWFya2V0WydiYXNlJ10gKyAnLycgK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lb2YgbGltaXQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgcmVxdWVzdFsnc2l6ZSddID0gbGltaXQ7XG4gICAgICAgIGlmIChtYXJrZXRbJ2Z1dHVyZSddKSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ0Z1dHVyZSc7XG4gICAgICAgICAgICByZXF1ZXN0Wydjb250cmFjdF90eXBlJ10gPSAndGhpc193ZWVrJzsgLy8gbmV4dF93ZWVrLCBxdWFydGVyXG4gICAgICAgIH1cbiAgICAgICAgbWV0aG9kICs9ICdEZXB0aCc7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vayk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3RpbWVzdGFtcCddO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdzeW1ib2wnIGluIHRpY2tlcikge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IHRpY2tlclsnc3ltYm9sJ107XG4gICAgICAgICAgICAgICAgaWYgKG1hcmtldElkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW21hcmtldElkXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdCcpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdoaWdoJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvdycpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdidXknKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2wnKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgIC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SB2YWx1ZTogMTAgb3IgMjAgKDEwIGJ5IGRlZmF1bHQpXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKHR5cGUgPT09ICdsaW1pdCcpIHtcbiAgICAgICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgb3JkZXJbJ3R5cGUnXSArPSAnX21hcmtldCc7XG4gICAgICAgICAgICAgICAgaWYgKHNpZGUgPT09ICdidXknKSB7XG4gICAgICAgICAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gdGhpcy5zYWZlRmxvYXQgKHBhcmFtcywgJ2Nvc3QnKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFvcmRlclsncHJpY2UnXSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBtYXJrZXQgYnV5IG9yZGVycyByZXF1aXJlIGFuIGFkZGl0aW9uYWwgY29zdCBwYXJhbWV0ZXIsIGNvc3QgPSBwcmljZSAqIGFtb3VudCcpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcGFyYW1zID0gdGhpcy5vbWl0IChwYXJhbXMsICdjb3N0Jyk7XG4gICAgICAgIG1ldGhvZCArPSAnVHJhZGUnO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMu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09IDMpXG4gICAgICAgICAgICByZXR1cm4gJ29wZW4nO1xuICAgICAgICBpZiAoc3RhdHVzID09PSA0KVxuICAgICAgICAgICAgcmV0dXJuICdjYW5jZWxlZCc7XG4gICAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlclNpZGUgKHNpZGUpIHtcbiAgICAgICAgaWYgKHNpZGUgPT09IDEpXG4gICAgICAgICAgICByZXR1cm4gJ2J1eSc7IC8vIG9wZW4gbG9uZyBwb3NpdGlvblxuICAgICAgICBpZiAoc2lkZSA9PT0gMilcbiAgICAgICAgICAgIHJldHVybiAnc2VsbCc7IC8vIG9wZW4gc2hvcnQgcG9zaXRpb25cbiAgICAgICAgaWYgKHNpZGUgPT09IDMpXG4gICAgICAgICAgICByZXR1cm4gJ3NlbGwnOyAvLyBsaXF1aWRhdGUgbG9uZyBwb3NpdGlvblxuICAgICAgICBpZiAoc2lkZSA9PT0gNClcbiAgICAgICAgICAgIHJldHVybiAnYnV5JzsgLy8gbGlxdWlkYXRlIHNob3J0IHBvc2l0aW9uXG4gICAgICAgIHJldHVybiBzaWRlO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHNpZGUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCB0eXBlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ3R5cGUnIGluIG9yZGVyKSB7XG4gICAgICAgICAgICBpZiAoKG9yZGVyWyd0eXBlJ10gPT09ICdidXknKSB8fCAob3JkZXJbJ3R5cGUnXSA9PT0gJ3NlbGwnKSkge1xuICAgICAgICAgICAgICAgIHNpZGUgPSBvcmRlclsndHlwZSddO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAnbGltaXQnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChvcmRlclsndHlwZSddID09PSAnYnV5X21hcmtldCcpIHtcbiAgICAgICAgICAgICAgICBzaWRlID0gJ2J1eSc7XG4gICAgICAgICAgICAgICAgdHlwZSA9ICdtYXJrZXQnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChvcmRlclsndHlwZSddID09PSAnc2VsbF9tYXJrZXQnKSB7XG4gICAgICAgICAgICAgICAgc2lkZSA9ICdzZWxsJztcbiAgICAgICAgICAgICAgICB0eXBlID0gJ21hcmtldCc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHNpZGUgPSB0aGlzLnBhcnNlT3JkZXJTaWRlIChvcmRlclsndHlwZSddKTtcbiAgICAgICAgICAgICAgICBpZiAoKCdjb250cmFjdF9uYW1lJyBpbiBvcmRlcikgfHwgKCdsZXZlcl9yYXRlJyBpbiBvcmRlcikpXG4gICAgICAgICAgICAgICAgICAgIHR5cGUgPSAnbWFyZ2luJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5wYXJzZU9yZGVyU3RhdHVzIChvcmRlclsnc3RhdHVzJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdzeW1ib2wnIGluIG9yZGVyKVxuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3ltYm9sJ10gaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbb3JkZXJbJ3N5bWJvbCddXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGNyZWF0ZURhdGVGaWVsZCA9IHRoaXMuZ2V0Q3JlYXRlRGF0ZUZpZWxkICgpO1xuIC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XG4gICAgICAgIGxldCB1cmwgPSAnLyc7XG4gICAgICAgIGlmIChhcGkgIT09ICd3ZWInKVxuICAgICAgICAgICAgdXJsICs9IHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgdXJsICs9IHBhdGggKyB0aGlzLmV4dGVuc2lvbjtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMua2V5c29ydCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYXBpX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICAvLyBzZWNyZXQga2V5IG11c3QgYmUgYXQgdGhlIGVuZCBvZiBxdWVyeVxuICAgICAgICAgICAgbGV0IHF1ZXJ5U3RyaW5nID0gdGhpcy5yYXdlbmNvZGUgKHF1ZXJ5KSArICcmc2VjcmV0X2tleT0nICsgdGhpcy5zZWNyZXQ7XG4gICAgICAgICAgICBxdWVyeVsnc2lnbiddID0gdGhpcy5oYXNoICh0aGlzLmVuY29kZSAocXVlcnlTdHJpbmcpKS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnIH07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyB1cmw7XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChib2R5Lmxlbmd0aCA8IDIpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmICgnZXJyb3JfY29kZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgZXJyb3IgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnZXJyb3JfY29kZScpO1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgIGlmIChlcnJvciBpbiB0aGlzLmV4Y2VwdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IEV4Y2VwdGlvbkNsYXNzID0gdGhpcy5leGNlcHRpb25zW2Vycm9yXTtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2VwdGlvbkNsYXNzIChtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAobWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdyZXN1bHQnIGluIHJlc3BvbnNlKVxuICAgICAgIC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I3NjgtMGQ2ZGQzYzYtYzRhNi0xMWU3LTkwZjgtYzA0M2I2NDc1NmE3LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL3d3dy5va2V4LmNvbS92MicsXG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cub2tleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cub2tleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cub2tleC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL29rY29pbi1va2V4L0FQSS1kb2NzLU9LRXguY29tJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5va2V4LmNvbS9mZWVzLmh0bWwnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdGQUlSJzogJ0ZhaXJHYW1lJyxcbiAgICAgICAgICAgICAgICAnSE1DJzogJ0hpIE11dHVhbCBTb2NpZXR5JyxcbiAgICAgICAgICAgICAgICAnTUFHJzogJ01hZ2dpZScsXG4gICAgICAgICAgICAgICAgJ05BTk8nOiAnWFJCJyxcbiAgICAgICAgICAgICAgICAnWU9ZTyc6ICdZT1lPVycsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjYWxjdWxhdGVGZWUgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSwgdGFrZXJPck1ha2VyID0gJ3Rha2VyJywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICA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gICAgIG1hcmtldHNbaV1bJ21ha2VyJ10gPSAwLjAwMTU7XG4gICAgICAgICAgICAgICAgbWFya2V0c1tpXVsndGFrZXInXSA9IDAuMDAyMDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbWFya2V0c1tpXVsnbWFrZXInXSA9IDAuMDAwMztcbiAgICAgICAgICAgICAgICBtYXJrZXRzW2ldWyd0YWtlciddID0gMC4wMDA1O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBtYXJrZXRzO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7fTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJzICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gcmVzcG9uc2VbJ3RpY2tlcnMnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChyZXNwb25zZVsnZGF0ZSddKSAqIDEwMDA7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aWNrZXJzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoJ3N5bWJvbCcgaW4gdGlja2VyKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldElkID0gdGlja2VyWydzeW1ib2wnXTtcbiAgICAgICAgICAgICAgICBpZiAobWFya2V0SWQgaW4g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3VudHJpZXMnOiBbICdGUicsICdFVScgXSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAyMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc5MDU2NC1hOTQ1YTlkNC01ZmY5LTExZTctOWQyZC1iNjM1NzYzZjJmMjQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vcGF5bWl1bS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LnBheW1pdW0uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL1BheW1pdW0vYXBpLWRvY3VtZW50YXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cucGF5bWl1bS5jb20vcGFnZS9kZXZlbG9wZXJzJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb3VudHJpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RhdGEve2lkfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RhdGEve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RhdGEve2lkfS9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl9jaGFydHMve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fY2hhcnRzL3tpZH0vZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWVyY2hhbnQvZ2V0X3BheW1lbnQve1VVSUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9hZGRyZXNzZXMve2J0Y19hZGRyZXNzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXJzL3tVVUlEfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcmljZV9hbGVydHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9hZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcGF5bWVudF9yZXF1ZXN0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcmljZV9hbGVydHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21lcmNoYW50L2NyZWF0ZV9wYXltZW50JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL29yZGVycy97VVVJRH0vY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3ByaWNlX2FsZXJ0cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnZXVyJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDU5LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwNTksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0VXNlciAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgbG93ZXJjYXNlID0gY3VycmVuY3kudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gJ2JhbGFuY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sXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVt2b2x1bWVdLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldERhdGFJZFRyYWRlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICd0eXBlJzogdGhpcy5jYXBpdGFsaXplICh0eXBlKSArICdPcmRlcicsXG4gICAgICAgICAgICAnY3VycmVuY3knOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ2RpcmVjdGlvbic6IHNpZGUsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VXNlck9yZGVycyAodGhpcy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luZyAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2UgKyB1cmw7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgICAgICBhdXRoICs9IGJvZHk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQXBpLUtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdBcGktU2lnbmF0dXJlJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpLFxuICAgICAgICAgICAgICAgICdBcGktTm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoJ2Vycm9ycycgaW4gcmVzcG9uc2UpXG4gICAgICA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MCwgLy8gdXAgdG8gNiBjYWxscyBwZXIgc2Vjb25kXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdjcmVhdGVEZXBvc2l0QWRkcmVzcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2VkaXRPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogJ2VtdWxhdGVkJyxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzVtJzogMzAwLFxuICAgICAgICAgICAgICAgICcxNW0nOiA5MDAsXG4gICAgICAgICAgICAgICAgJzMwbSc6IDE4MDAsXG4gICAgICAgICAgICAgICAgJzJoJzogNzIwMCxcbiAgICAgICAgICAgICAgICAnNGgnOiAxNDQwMCxcbiAgICAgICAgICAgICAgICAnMWQnOiA4NjQwMCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2ODE3LWU5NDU2MzEyLTVlZTYtMTFlNy05YjNjLWI2MjhjYTU2MjZhNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vcHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vdHJhZGluZ0FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vcG9sb25pZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9wb2xvbmlleC5jb20vc3VwcG9ydC9hcGkvJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHA6Ly9wYXN0ZWJpbi5jb20vZE1YN21aRTAnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybjI0aFZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuQ2hhcnREYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5DdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5Mb2FuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVyblRpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbExvYW5PZmZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nsb3NlTWFyZ2luUG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZUxvYW5PZmZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2VuZXJhdGVOZXdBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRNYXJnaW5Qb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luQnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5TZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb3ZlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkFjdGl2ZUxvYW5zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5BdmFpbGFibGVBY2NvdW50QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5Db21wbGV0ZUJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5EZXBvc2l0QWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5EZXBvc2l0c1dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5GZWVJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5MZW5kaW5nSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuTWFyZ2luQWNjb3VudFN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybk9wZW5Mb2FuT2ZmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcmRlclRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGFibGVCYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0b2dnbGVBdXRvUmVuZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxNSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDI1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7fSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMDAwMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogMTAwMDAwMDAwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAuMDAwMDAwMDEsXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiAxMDAwMDAwMDAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMDAwMDAwLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogMTAwMDAwMDAwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnQlRNJzogJ0JpdG1hcmsnLFxuICAgICAgICAgICAgICAgICdTVFInOiAnWExNJyxcbiAgICAgICAgICAgICAgICAnQkNDJzogJ0JUQ3RhbGtjb2luJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNhbGN1bGF0ZUZlZSAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlLCB0YWtlck9yTWFrZXIgPSAndGFrZXInLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgIGxldCBrZXkgPSAncXVvdGUnO1xuICAgICAgICBsZXQgcmF0ZSA9IG1hcmtldFt0YWtlck9yTWFrZXJdO1xuICAgICAgICBsZXQgY29zdCA9IHBhcnNlRmxvYXQgKHRoaXMuY29zdFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCAqIHJhdGUpKTtcbiAgICAgICAgaWYgKHNpZGUgPT09ICdzZWxsJykge1xuICAgICAgICAgICAgY29zdCAqPSBwcmljZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGtleSA9ICdiYXNlJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3R5cGUnOiB0YWtlck9yTWFrZXIsXG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRba2V5XSxcbiAgICAgICAgICAgICdyYXRlJzogcmF0ZSxcbiAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAodGhpcy5mZWVUb1ByZWNpc2lvbiAoc3ltYm9sLCBjb3N0KSksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VPSExDViAob2hsY3YsIG1hcmtldCA9IHVuZGVmaW5lZCwgdGltZWZyYW1lID0gJzVtJywgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICBvaGxjdlsnZGF0ZSddICogMTAwMCxcbiAgICAgICAgICAgIG9obGN2WydvcGVuJ10sXG4gICAgICAgICAgICBvaGxjdlsnaGlnaCddLFxuICAgICAgICAgICAgb2hsY3ZbJ2xvdyddLFxuICAgICAgICAgICAgb2hsY3ZbJ2Nsb3NlJ10sXG4gICAgICAgICAgICBvaGxjdlsncXVvdGVWb2x1bWUnXSxcbiAgICAgICAgXTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9ITENWIChzeW1ib2wsIHRpbWVmcmFtZSA9ICc1bScsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0c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ICBsZXQgbWFya2V0ID0gbWFya2V0c1tpZF07XG4gICAgICAgICAgICBsZXQgWyBxdW90ZSwgYmFzZSBdID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMC4wMDAwMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiAxMDAwMDAwMDAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMC4wMDAwMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiAxMDAwMDAwMDAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMDAwMDAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IDEwMDAwMDAwMDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFJldHVybkNvbXBsZXRlQmFsYW5jZXMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnYWNjb3VudCc6ICdhbGwnLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaWRdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlJ10pLFxuICAgICAgICAgICAg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5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WyduYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgICAgICdmZWUnOiB0aGlzLnNhZmVGbG9hdCAoY3VycmVuY3ksICd0eEZlZScpLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ3R4RmVlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVja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gICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IHBhcnRzID0gY3VycmVuY3lQYWlyLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gcGFydHNbMF07XG4gICAgICAgICAgICAgICAgYmFzZSA9IHBhcnRzWzFdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgYmFzZSA9IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgcXVvdGUgPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHNpZGUgPSB0cmFkZVsndHlwZSddO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3RvdGFsJyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdhbW91bnQnKTtcbiAgICAgICAgaWYgKCdmZWUnIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBsZXQgcmF0ZSA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2ZlZScpO1xuICAgICAgICAgICAgbGV0IGZlZUNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoc2lkZSA9PT0gJ2J1eScpIHtcbiAgICAgICAgICAgICAgICBjdXJyZW5jeSA9IGJhc2U7XG4gICAgICAgICAgICAgICAgZmVlQ29zdCA9IGFtb3VudCAqIHJhdGU7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGN1cnJlbmN5ID0gcXVvdGU7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBjb3N0ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgZmVlQ29zdCA9IGNvc3QgKiByYXRlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdyYXRlJzogcmF0ZSxcbiAgICAgICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAndHJhZGVJRCcpLFxuICAgICAgICAgICAgJ29yZGVyJzogdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ29yZGVyTnVtYmVyJyksXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdyYXRlJyksXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaX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c7XG4gICAgICAgIGxldCByZXF1ZXN0ID0geyAnY3VycmVuY3lQYWlyJzogcGFpciB9O1xuICAgICAgICBpZiAodHlwZW9mIHNpbmNlICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgcmVxdWVzdFsnc3RhcnQnXSA9IHBhcnNlSW50IChzaW5jZSAvIDEwMDApO1xuICAgICAgICAgICAgcmVxdWVzdFsnZW5kJ10gPSB0aGlzLnNlY29uZHMgKCk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gbGltaXQgaXMgZGlzYWJsZWQgKGRvZXMgbm90IHJlYWxseSB3b3JrIGFzIGV4cGVjdGVkKVxuICAgICAgICBpZiAobGltaXQpXG4gICAgICAgICAgICByZXF1ZXN0WydsaW1pdCddID0gcGFyc2VJbnQgKGxpbWl0KTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFJldHVyblRyYWRlSGlzdG9yeSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlLCBtYXJrZXQpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRyYWRlcyA9IHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlW2lkXSwgbWFya2V0KTtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCB0cmFkZXMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0cmFkZXNbal0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLmZpbHRlckJ5U2luY2VMaW1pdCAocmVzdWx0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMuc2FmZUludGVnZXIgKG9yZGVyLCAndGltZXN0YW1wJyk7XG4gICAgICAgIGlmICghdGltZXN0YW1wKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKG9yZGVyWydkYXRlJ10pO1xuICAgICAgICBsZXQgdHJhZGVzID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ3Jlc3VsdGluZ1RyYWRlcycgaW4gb3JkZXIpXG4gICAgICAgICAgICB0cmFkZXMgPSB0aGlzLnBhcnNlVHJhZGVzIChvcmRlclsncmVzdWx0aW5nVHJhZGVzJ10sIG1hcmtldCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnYW1vdW50Jyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdzdGFydGluZ0Ftb3VudCcsIHJlbWFpbmluZyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBjb3N0ID0gMDtcbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIGNvc3QgPSBmaWxsZWQgKiBwcmljZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGZpbGxlZCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgdHJhZGVzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGZpbGxlZCA9IDA7XG4gICAgICAgICAgICAgICAgY29zdCA9IDA7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0cmFkZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRyYWRlID0gdHJhZGVzW2ldO1xuICAgICAgICAgICAgICAgICAgICBsZXQgdHJhZGVBbW91bnQgPSB0cmFkZVsnYW1vdW50J107XG4gICAgICAgICAgICAgICAgICAgIGxldCB0cmFkZVByaWNlID0gdHJhZGVbJ3ByaWNlJ107XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IHRoaXMuc3VtIChmaWxsZWQsIHRyYWRlQW1vdW50KTtcbiAgICAgICAgICAgICAgICAgICAgY29zdCArPSB0cmFkZVByaWNlICogdHJhZGVBbW91bnQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyTnVtYmVyJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBvcmRlclsnc3RhdHVzJ10sXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsnc2lkZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAndHJhZGVzJzogdHJhZGVzLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZU9wZW5PcmRlcnMgKG9yZGVycywgbWFya2V0LCByZXN1bHQgPSBbXSkge1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG9yZGVycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG9yZGVyID0gb3JkZXJzW2ldO1xuICAgICAgICAgICAgbGV0IGV4dGVuZGVkID0gdGhpcy5leHRlbmQgKG9yZGVyLCB7XG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvcGVuJyxcbiAgICAgICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG9yZGVyWydyYXRlJ10sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLnBhcnNlT3JkZXIgKGV4dGVuZGVkLCBtYXJrZXQpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJzIChzeW1ib2wgPSB1bmRlZmluZWQsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHN5bWJvbClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcGFpciA9IG1hcmtldCA/IG1hcmtldFsnaWQnXSA6ICdhbGwnO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0UmV0dXJuT3Blbk9yZGVycyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeVBhaXInOiBwYWlyLFxuICAgICAgICB9KSk7XG4gICAgICAgIGxldCBvcGVuT3JkZXJzID0gW107XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIG9wZW5PcmRlcnMgPSB0aGlzLnBhcnNlT3Blbk9yZG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pIHtcbiAgICAgICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSB0aGlzLmV4dGVuZCAodGhpcy5vcmRlcnNbaWRdLCBvcGVuT3JkZXJzSW5kZXhlZEJ5SWRbaWRdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRlcnNbaWRdO1xuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3RhdHVzJ10gPT09ICdvcGVuJykge1xuICAgICAgICAgICAgICAgICAgICBvcmRlciA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlsbGVkJzogb3JkZXJbJ2Ftb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlbWFpbmluZyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3JkZXJbJ2Nvc3QnXSA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3JkZXJbJ2ZpbGxlZCddICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcmRlclsnY29zdCddID0gb3JkZXJbJ2ZpbGxlZCddICogb3JkZXJbJ3ByaWNlJ107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gb3JkZXI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRlcnNbaWRdO1xuICAgICAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICA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gICAgICB0aGlzLm9yZGVyc1tpZF1bJ3N0YXR1cyddID0gJ2NhbmNlbGVkJztcbiAgICAgICAgICAgIGxldCBuZXdpZCA9IHJlc3BvbnNlWydvcmRlck51bWJlciddO1xuICAgICAgICAgICAgdGhpcy5vcmRlcnNbbmV3aWRdID0gdGhpcy5leHRlbmQgKHRoaXMub3JkZXJzW2lkXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IG5ld2lkLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb3BlbicsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgYW1vdW50ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICB0aGlzLm9yZGVyc1tuZXdpZF1bJ2Ftb3VudCddID0gYW1vdW50O1xuICAgICAgICAgICAgcmVzdWx0ID0gdGhpcy5leHRlbmQgKHRoaXMub3JkZXJzW25ld2lkXSwgeyAnaW5mbyc6IHJlc3BvbnNlIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChzeW1ib2wpXG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgICAgICByZXN1bHQgPSB0aGlzLnBhcnNlT3JkZXIgKHJlc3BvbnNlLCBtYXJrZXQpO1xuICAgICAgICAgICAgdGhpcy5vcmRlcnNbcmVzdWx0WydpZCddXSA9IHJlc3VsdDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzc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Ghpcy5wcml2YXRlUG9zdFdpdGhkcmF3ICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3VsdCxcbiAgICAgICAgICAgICdpZCc6IHJlc3VsdFsncmVzcG9uc2UnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV07XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7ICdjb21tYW5kJzogcGF0aCB9LCBwYXJhbXMpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIHF1ZXJ5Wydub25jZSddID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdTaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29k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B0b3MgZXh0ZW5kcyBFeGNoYW5nZSB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3FyeXB0b3MnLFxuICAgICAgICAgICAgJ25hbWUnOiAnUVJZUFRPUycsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnQ04nLCAnVFcnIF0sXG4gICAgICAgICAgICAndmVyc2lvbic6ICcyJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzA5NTM5MTUtYjE2MTFkYzAtYTQzNi0xMWU3LTg5NDctYzk1YmQ1YTQyMDg2LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5xcnlwdG9zLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5xcnlwdG9zLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZGV2ZWxvcGVycy5xdW9pbmUuY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZGV2ZWxvcGVycy5xdW9pbmUuY29tL3YyJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vcXJ5cHRvcy56ZW5kZXNrLmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDc4NTgxNjctRmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9L3ByaWNlX2xldmVscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhlY3V0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaXJfbGFkZGVycy97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL21haW5fYXNzZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyeXB0b19hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhlY3V0aW9ucy9tZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlhdF9hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbl9iaWRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2FucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfS9leGVjdXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97aWR9L2xvYW5zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nX2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nX2FjY291bnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWF0X2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2FuX2JpZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbl9iaWRzL3tpZH0vY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW5zL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfS9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve2lkfS9jbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL2Nsb3NlX2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ19hY2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdza2lwSnNvbk9uU3RhdHVzQ29kZXMnOiBbNDAxXSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdtZXNzYWdlcyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ0FQSSBBdXRoZW50aWNhdGlvbiBmYWlsZWQnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICAgICAnTm9uY2UgaXMgdG9vIHNtYWxsJzogSW52YWxpZE5vbmNlLFxuICAgICAgICAgICAgICAgICAgICAnT3JkZXIgbm90IGZvdW5kJzogT3JkZXJOb3RGb3VuZCxcbiAgICAgICAgICAgICAgICAgICAgJ3VzZXInOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbm90X2Vub3VnaF9mcmVlX2JhbGFuY2UnOiBJbnN1ZmZpY2llbnRGdW5kcyxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ211c3RfYmVfcG9zaXRpdmUnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdxdWFudGl0eSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZXNzX3RoYW5fb3JkZXJfc2l6ZSc6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFByb2R1Y3RzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2lkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnYmFzZV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydxdW90ZWRfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgbWFrZXIgPSB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWFrZXJfZmVlJyk7XG4gICAgICAgICAgICBsZXQgdGFrZXIgPSB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAndGFrZXJfZmVlJyk7XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gIW1hcmtldFsnZGlzYWJsZWQnXTtcbiAgICAgICAgICAgIGxldCBtaW5BbW91bnQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgbWluUHJpY2UgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoYmFzZSA9PT0gJ0JUQycpIHtcbiAgICAgICAgICAgICAgICBtaW5BbW91bnQgPSAwLjAwMTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoYmFzZSA9PT0gJ0VUSCcpIHtcbiAgICAgICAgICAgICAgICBtaW5BbW91bnQgPSAwLjAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHF1b3RlID09PSAnQlRDJykge1xuICAgICAgICAgICAgICAgIG1pblByaWNlID0gMC4wMDAwMDAwMTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocXVvdGUgPT09ICdFVEgnIHx8IHF1b3RlID09PSAnVVNEJyB8fCBxdW90ZSA9PT0gJ0pQWScpIHtcbiAgICAgICAgICAgICAgICBtaW5QcmljZSA9IDAuMDAwMDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7ICdtaW4nOiBtaW5BbW91bnQgfSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB7ICdtaW4nOiBtaW5QcmljZSB9LFxuICAgICAgICAgICAgICAgICdjb3N0JzogeyAnbWluJzogdW5kZWZpbmVkIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBtaW5QcmljZSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBtaW5BbW91bnQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBsaW1pdHNbJ2Nvc3QnXVsnbWluJ10gPSBtaW5QcmljZSAqIG1pbkFtb3VudDtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBtaW5BbW91bnQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIHByZWNpc2lvblsnYW1vdW50J10gPSAtTWF0aC5sb2cxMCAobWluQW1vdW50KTtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgbWluUHJpY2UgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIHByZWNpc2lvblsncHJpY2UnXSA9IC1NYXRoLmxvZzEwIChtaW5QcmljZSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRzQmFsYW5jZSAocGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2JhbGFuY2UnXSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHRvdGFsLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICA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AgICAgIGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdF90cmFkZWRfcHJpY2UnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaF9tYXJrZXRfYXNrJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvd19tYXJrZXRfYmlkJyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21hcmtldF9iaWQnKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21hcmtldF9hc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzog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bCcgaW50ZW5kZWRcbiAgICAgICAgICAgICAgICBzdGF0dXMgPSAnY2FuY2VsZWQnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdxdWFudGl0eScpO1xuICAgICAgICBsZXQgZmlsbGVkID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZmlsbGVkX3F1YW50aXR5Jyk7XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlJyk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWydvcmRlcl90eXBlJ10sXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogYW1vdW50IC0gZmlsbGVkLFxuICAgICAgICAgICAgJ3RyYWRlcyc6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ICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICAgICAncGF0aCc6IHVybCxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAndG9rZW5faWQnOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnaWF0JzogTWF0aC5mbG9vciAobm9uY2UgLyAxMDAwKSwgLy8gaXNzdWVkIGF0XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaGVhZGVyc1snWC1RdW9pbmUtQXV0aCddID0gdGhpcy5qd3QgKHJlcXVlc3QsIHRoaXMuc2VjcmV0KTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgdXJsO1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSwgcmVzcG9uc2UgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKGNvZGUgPj0gMjAwICYmIGNvZGUgPD0gMjk5KVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBjb25zdCBtZXNzYWdlcyA9IHRoaXMuZXhjZXB0aW9uc1snbWVzc2FnZXMnXTtcbiAgICAgICAgaWYgKGNvZGUgPT09IDQwMSkge1xuICAgICAgICAgICAgLy8gZXhwZWN0ZWQgbm9uLWpzb24gcmVzcG9uc2VcbiAgICAgICAgICAgIGlmIChib2R5IGluIG1lc3NhZ2VzKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBtZXNzYWdlc1tib2R5XSAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIHJlc3BvbnNlID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGlmICgoYm9keVswXSA9PT0gJ3snKSB8fCAoYm9keVswXSA9PT0gJ1snKSlcbiAgICAgICAgICAgICAgICByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgY29uc3QgZmVlZGJhY2sgPSB0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSk7XG4gICAgICAgIGlmIChjb2RlID09PSA0MDQpIHtcbiAgICAgICAgICAgIC8vIHsgXCJtZXNzYWdlXCI6IFwiT3JkZXIgbm90IGZvdW5kXCIgfVxuICAgICAgICAgICAgY29uc3QgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdtZXNzYWdlJyk7XG4gICAgICAgICAgICBpZiAobWVzc2FnZSBpbiBtZXNzYWdlcylcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgbWVzc2FnZXNbbWVzc2FnZV0gKGZlZWRiYWNrKTtcbiAgICAgICAgfSBlbHNlIGlmIChjb2RlID09PSA0MjIpIHtcbiAgICAgICAgICAgIC8vIGFycmF5IG9mIGVycm9yIG1lc3NhZ2VzIGlzIHJldHVybmVkIGluICd1c2VyJyBvciAncXVhbnRpdHknIHByb3BlcnR5IG9mICdlcnJvcnMnIG9iamVjdCwgZS5nLjpcbiAgICAgICAgICAgIC8vIHsgXCJlcnJvcnNcIjogeyBcInVzZXJcIjogW1wibm90X2Vub3VnaF9mcmVlX2JhbGFuY2VcIl0gfX1cbiAgICAgICAgICAgIC8vIHsgXCJlcnJvcnNcIjogeyBcInF1YW50aXR5XCI6IFtcImxlc3NfdGhhbl9vcmRlcl9zaXplXCJdIH19XG4gICAgICAgICAgICBpZiAoJ2Vycm9ycycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBlcnJvcnMgPSByZXNwb25zZVsnZXJyb3JzJ107XG4gICAgICAgICAgICAgICAgY29uc3QgZXJyb3JUeXBlcyA9IFsndXNlcicsICdxdWFudGl0eScsICdwcmljZSddO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZXJyb3JUeXBlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBlcnJvclR5cGUgPSBlcnJvclR5cGVzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3JUeXBlIGluIGVycm9ycykge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZXJyb3JNZXNzYWdlcyA9IGVycm9yc1tlcnJvclR5cGVdO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBlcnJvck1lc3NhZ2VzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgbWVzc2FnZSA9IGVycm9yTWVzc2FnZXNbal07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UgaW4gbWVzc2FnZXNbZXJyb3JUeXBlX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gICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY4MjUtOThhNmQwZGUtNWVlNy0xMWU3LTlmYTQtMzhlMTFhMmM2ZjUyLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5xdWFkcmlnYWN4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5xdWFkcmlnYWN4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5xdWFkcmlnYWN4LmNvbS9hcGlfaW5mbycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luY2FzaF9kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5jYXNoX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5nb2xkX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbmdvbGRfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aGVyX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXRoZXJfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGl0ZWNvaW5fZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXRlY29pbl93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb29rdXBfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiA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AgICAgICAgICAgICd2d2FwJzogdndhcCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0cmFkZVsnZGF0ZSddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICd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7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSBbIG5vbmNlLnRvU3RyaW5nICgpLCB0aGlzLnVpZCwgdGhpcy5hcGlLZXkgXS5qb2luICgnJyk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocmVxdWVzdCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAna2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ3NpZ25hdHVyZSc6IHNpZ25hdHVyZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcyk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICBoZWFk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G4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5zb3V0aHhjaGFuZ2UuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LnNvdXRoeGNoYW5nZS5jb20vSG9tZS9BcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZS97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib29rL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE1hcmtldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dlbmVyYXRlbmV3YWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdEJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ1NNVCc6ICdTbWFydE5vZGUnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBtYXJrZXRbMF07XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsxXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IGlkID0gc3ltYm9sO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICA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IGN1cnJlbmN5Wydjb2RlJ107XG4gICAgICAgICAgICBsZXQgZnJlZSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ0F2YWlsYWJsZSddKTtcbiAgICAgICAgICAgIGxldCBkZXBvc2l0ZWQgPSBwYXJzZUZsb2F0IChiYWxhbmNlWydEZXBvc2l0ZWQnXSk7XG4gICAgICAgICAgICBsZXQgdW5jb25maXJtZWQgPSBwYXJzZUZsb2F0IChiYWxhbmNlWydVbmNvbmZpcm1lZCddKTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IHRoaXMuc3VtIChkZXBvc2l0ZWQsIHVuY29uZmlybWVkKTtcbiAgICAgICAgICAgIGxldCB1c2VkID0gdG90YWwgLSBmcmVlO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBmcmVlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdXNlZCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiB0b3RhbCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0Qm9va1N5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5k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IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0UHJpY2VTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsnQXQnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bm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ICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnQW1vdW50Jyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBjb3N0ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIGFtb3VudCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGFtb3VudDtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgcmVtYWluaW5nICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG9yZGVyVHlwZSA9IG9yZGVyWydUeXBlJ10udG9Mb3dlckNhc2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ0NvZGUnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJUeXBlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmc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G4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcXVlcnkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgICAgICdIYXNoJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIH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lJzogJ1RoZVJvY2tUcmFkaW5nJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnTVQnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2Njg2OS03NTA1N2ZhMi01ZWU5LTExZTctOWE2Zi0xM2U2NDFmYTQ3MDcuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLnRoZXJvY2t0cmFkaW5nLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3RoZXJvY2t0cmFkaW5nLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYXBpLnRoZXJvY2t0cmFkaW5nLmNvbS9kb2MvdjEvaW5kZXguaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS50aGVyb2NrdHJhZGluZy5jb20vZG9jLycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2lkfS9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMvdGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGlzY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkaXNjb3VudHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9wb3NpdGlvbl9iYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L3Bvc2l0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L3Bvc2l0aW9ucy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19saW1pdHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfbGltaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXRtcy93aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzL3JlbW92ZV9hbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAyLjUsICAvLyB3b3JzdC1jYXNlIHNjZW5hcmlvOiBodHRwczovL3RoZXJvY2t0cmFkaW5nLmNvbS9lbi9wYWdlcy9mZWVzXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRGdW5kc1RpY2tlcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWyd0aWNrZXJzJ10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWyd0aWNrZXJzJ11bcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2Z1bmRfaWQnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGZyZWUgPSBiYWxhbmNlWyd0cmFkaW5nX2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IGJhbGFuY2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCB1c2VkID0gdG90YWwgLSBmcmVlO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAg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9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0RnVuZHNJZFRpY2tlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAoIW1hcmtldClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFt0cmFkZVsnZnVuZF9pZCddXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnZGF0ZSddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsnc2lkZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1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2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlRGVsZXRlRnVuZHNGdW5kSWRPcmRlcnNJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZSArIHVybDtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ1gtVFJULUtFWSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdYLVRSV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bSc6ICcxNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMCcsXG4gICAgICAgICAgICAgICAgJzFoJzogJzYwJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMTIwJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnMjQwJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzcyMCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzE0NDAnLFxuICAgICAgICAgICAgICAgICczZCc6ICc0MzIwJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMTAwODAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzkwMzQ5MjEtZTNhY2YwMTYtNDQ4MC0xMWU4LTk5NDUtYTYwODZhMTA4MmZlLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy50aWRlYml0LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cudGlkZWJpdC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cudGlkZWJpdC5jb20vZG9jdW1lbnRzL2FwaV92MicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL21hcmtldHMnLCAvLyBWMk1hcmtldHNKc29uXG4gICAgICAgICAgICAgICAgICAgICAgICAndjIvdGlja2VycycsIC8vIFYyVGlja2Vyc0pzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi90aWNrZXJzL3ttYXJrZXR9JywgLy8gVjJUaWNrZXJzTWFya2V0SnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL3RyYWRlcycsIC8vIFYyVHJhZGVzSnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL3RyYWRlcy97bWFya2V0fScsIC8vIFYyVHJhZGVzTWFya2V0SnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL29yZGVyX2Jvb2snLCAvLyBWMk9yZGVyQm9va0pzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9vcmRlcicsIC8vIFYyT3JkZXJKc29uXG4gICAgICAgICAgICAgICAgICAgICAgICAndjIva193aXRoX3BlbmRpbmdfdHJhZGVzJywgLy8gVjJLV2l0aFBlbmRpbmdUcmFkZXNKc29uXG4gICAgICAgICAgICAgICAgICAgICAgICAndjIvaycsIC8vIFYyS0pzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9kZXB0aCcsIC8vIFYyRGVwdGhKc29uXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW10sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9kZXBvc2l0cycsIC8vIFYyRGVwb3NpdHNKc29uXG4gICAgICAgICAgICAgICAgICAgICAgICAndjIvZGVwb3NpdF9hZGRyZXNzJywgLy8gVjJEZXBvc2l0QWRkcmVzc0pzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9kZXBvc2l0JywgLy8gVjJEZXBvc2l0SnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL21lbWJlcnMvbWUnLCAvLyBWMk1lbWJlcnNNZUpzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9hZGRyZXNzZXMve2FkZHJlc3N9JywgLy8gVjJBZGRyZXNzZXNBZGRyZXNzSnNvblxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9vcmRlci9kZWxldGUnLCAvLyBWMk9yZGVyRGVsZXRlSnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL29yZGVyJywgLy8gVjJPcmRlckpzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9vcmRlci9tdWx0aScsIC8vIFYyT3JkZXJNdWx0aUpzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9vcmRlci9jbGVhcicsIC8vIFYyT3JkZXJDbGVhckpzb25cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHt9LCAvLyBUaGVyZSBpcyBvbmx5IDElIGZlZSBvbiB3aXRoZHJhd2FscyB0byB5b3VyIGJhbmsgYWNjb3VudC5cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcyMDAyJzogSW5zdWZmaWNpZW50RnVuZHMsXG4gICAgICAgICAgICAgICAgJzIwMDMnOiBPcmRlck5vdEZvdW5kLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hEZXBvc2l0QWRkcmVzcyAoY29kZSwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jeSAoY29kZSk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldFYyRGVwb3NpdEFkZHJlc3MgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeVsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGlmICgnc3VjY2VzcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnc3VjY2VzcyddKSB7XG4gICAgICAgICAgICAgICAgbGV0IGFkZHJlc3MgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnYWRkcmVzcycpO1xuICAgICAgICAgICAgICAgIGxldCB0YWcgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnYWRkcmVzc1RhZycpO1xuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgICAgICdhZGRyZXNzJzogdGhpcy5jaGVja0FkZHJlc3MgKGFkZHJlc3MpLFxuICAgICAgICAgICAgICAgICAgICAndGFnJzogdGFnLFxuICAgICAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFYyTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZUlkLCBxdW90ZUlkIF0gPSBzeW1ib2wuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1x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y5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcb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ICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYWNjZXNzX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICd0b25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IG1ldGhvZCArICd8JyArIHJlcXVlc3QgKyAnfCcgKyBxdWVyeTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChwYXlsb2FkKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBsZXQgc3VmZml4ID0gcXVlcnkgKyAnJnNpZ25hdHVyZT0nICsgc2lnbmF0dXJlO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgc3VmZml4O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gc3VmZml4O1xuICAgICAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwg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blxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyB0aWRleCBleHRlbmRzIGxpcXVpIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAndGlkZXgnLFxuICAgICAgICAgICAgJ25hbWUnOiAnVGlkZXgnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdVSycsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJzMnLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAvLyAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgIC8vICdmZXRjaFRpY2tlcnMnOiB0cnVlXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMDc4MTc4MC0wMzE0OWRjNC1hMTJlLTExZTctODJiYi0zMTNiMjY5ZDI0ZDQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd2ViLnRpZGV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLnRpZGV4LmNvbS9hcGkvMycsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLnRpZGV4LmNvbS90YXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly90aWRleC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly90aWRleC5jb20vZXhjaGFuZ2UvcHVibGljLWFwaScsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3RpZGV4LmNvbS9leGNoYW5nZS9hc3NldHMtc3BlYycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3RpZGV4LmNvbS9leGNoYW5nZS9wYWlycy1zcGVjJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUtZGF0YScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUtZGF0YS97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICA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TtcbiAgICAgICAgICAgIGlmICghY2FuV2l0aGRyYXcgfHwgIWNhbkRlcG9zaXQpIHtcbiAgICAgICAgICAgICAgICBhY3RpdmUgPSBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnYWN0aXZlJzogY2FuV2l0aGRyYXcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlJzogY3VycmVuY3lbJ3dpdGhkcmF3RmVlJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGNhbkRlcG9zaXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnd2l0aGRyYXdNaW5BbW91dCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ2RlcG9zaXRNaW5BbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGdldFZlcnNpb25TdHJpbmcgKCkge1xuICAgICAgICByZXR1cm4gJyc7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgfSwgcXVlcnkpKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLnNpZ25Cb2R5V2l0aFNlY3JldCAoYm9keSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2UgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLmdldFZlcnNpb25TdHJpbmcgKCkgKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHVybCArPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG59O1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG4vLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuY29uc3QgZm94Yml0ID0gcmVxdWlyZSAoJy4vZm94Yml0LmpzJyk7XG5cbi8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIHVyZHViaXQgZXh0ZW5kcyBmb3hiaXQge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICd1cmR1Yml0JyxcbiAgICAgICAgICAgICduYW1lJzogJ1VyZHVCaXQnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdQSycsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk5MTQ1My0xNTZiZjNhZS02NDgwLTExZTctODJlYi03Mjk1ZmUxYjViYjQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3VyZHViaXQuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYmxpbmt0cmFkZS5jb20vZG9jcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ29wdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ2Jyb2tlcklkJzogJzgnLCAvLyBodHRwczovL2JsaW5rdHJhZ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ICdodHRwczovL2FwaS52YXVsdG9yby5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cudmF1bHRvcm8uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYXBpLnZhdWx0b3JvLmNvbScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ0dMRCc6ICdHb2xkJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlkYW5kYXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXlvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhdGVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGF0ZXN0dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy9kYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy9ob3VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMvbW9udGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eS97c3ltYm9sfS97dHlwZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL3tzeW1ib2x9L3t0eXBlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1snZGF0YSddO1xuICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydCYXNlQ3VycmVuY3knXTtcbiAgICAgICAgbGV0IHF1b3RlSWQgPSBtYXJrZXRbJ01hcmtldEN1cnJlbmN5J107XG4gICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgbGV0IGlkID0gbWFya2V0WydNYXJrZXROYW1lJ107XG4gICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnYmFzZSc6IGJ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Muc3VtIChmcmVlLCB1c2VkKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogZnJlZSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHVzZWQsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogdG90YWwsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rIChwYXJhbXMpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0ge1xuICAgICAgICAgICAgJ2JpZHMnOiByZXNwb25zZVsnZGF0YSddWzBdWydiJ10sXG4gICAgICAgICAgICAnYXNrcyc6IHJlc3BvbnNlWydkYXRhJ11bMV1bJ3MnXSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYmlkcycsICdhc2tzJywgJ0dvbGRfUHJpY2UnLCAnR29sZF9BbW91bnQnKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcXVvdGUgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEJpZGFuZGFzayAocGFyYW1zKTtcbiAgICAgICAgbGV0IGJpZHNMZW5ndGggPSBx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JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICcyNGhWb2x1bWUnKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnVGltZSddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ0dvbGRfUHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnR29sZF9BbW91bnQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQ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B9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IHBhdGg7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICB1cmwgKz0gdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICB9LCB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSkpO1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBoZW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xlLmV4cG9ydHMgPSBjbGFzcyB2aXJ3b3ggZXh0ZW5kcyBFeGNoYW5nZSB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3ZpcndveCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdWaXJXb1gnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ0FUJywgJ0VVJyBdLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2ODk0LTZkYTlkMzYwLTVlZWEtMTFlNy05MGFhLTQxZjI3MTFiNzQwNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cDovL2FwaS52aXJ3b3guY29tL2FwaS9qc29uLnBocCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3LnZpcndveC5jb20vYXBpL3RyYWRpbmcucGhwJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cudmlyd294LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy52aXJ3b3guY29tL2RldmVsb3BlcnMucGhwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2xvZ2luJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncGFzc3dvcmQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbnN0cnVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmVzdFByaWNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0TWFya2V0RGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2VzdGltYXRlTWFya2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRyYWRlZFByaWNlVm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRSYXdUcmFkZURhdGEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFN0YXRpc3RpY3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRlcm1pbmFsTGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0R3JpZExpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEdyaWRTdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5zdHJ1bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEJlc3RQcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE1hcmtldERlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdlc3RpbWF0ZU1hcmtldE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFkZWRQcmljZVZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0UmF3VHJhZGVEYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRTdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUZXJtaW5hbExpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEdyaWRMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRHcmlkU3RhdGlzdGljcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENvbW1pc3Npb25EaXNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENvbW1pc3Npb25EaXNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0R2V0SW5zdHJ1bWVudHMgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHNbJ3Jlc3VsdCddKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydyZXN1bHQnXVtrZXlzW3BdXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnaW5zdHJ1bWVudElEJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0Wydsb25nQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnc2hvcnRDdXJyZW5jeSddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xu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aGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ29wZW4nKSxcbiAgICAgICAgICAgICdjbG9zZSc6IGNsb3NlLFxuICAgICAgICAgICAgJ2xhc3QnOiBjbG9zZSxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb25nVm9sdW1lJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnc2hvcnRWb2x1bWUnKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBzeW1ib2wgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHNlYyA9IHRoaXMuc2FmZUludGVnZXIgKHRyYWRlLCAndGltZScpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gc2VjICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRy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XJhbXMpKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV07XG4gICAgICAgIGxldCBhdXRoID0ge307XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBhdXRoWydrZXknXSA9IHRoaXMuYXBpS2V5O1xuICAgICAgICAgICAgYXV0aFsndXNlciddID0gdGhpcy5sb2dpbjtcbiAgICAgICAgICAgIGF1dGhbJ3Bhc3MnXSA9IHRoaXMucGFzc3dvcmQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnaWQnOiBub25jZSxcbiAgICAgICAgICAgIH0sIGF1dGgsIHBhcmFtcykpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyB9O1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAoe1xuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdwYXJhbXMnOiB0aGlzLmV4dGVuZCAoYXV0aCwgcGFyYW1zKSxcbiAgICAgICAgICAgICAgICAnaWQnOiBub25jZSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09PSAyMDApIHtcbiAgICAgICAgICAgIGlmICgoYm9keVswXSA9PT0gJ3snKSB8fCAoYm9keVswXSA9PT0gJ1snKSkge1xuICAgICAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGlmICgncmVzdWx0JyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICAgICAgICAgICAgICBpZiAoJ2Vycm9yQ29kZScgaW4gcmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZXJyb3JDb2RlID0gcmVzdWx0WydlcnJvckNvZGUnXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlcnJvckNvZGUgIT09ICdPSycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZXJyb3IgcmV0dXJuZWQ6ICcgKyBib2R5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBtYWxmb3JtZWQgcmVzcG9uc2U6IG5vIHJlc3VsdCBpbiByZXNwb25zZTogJyArIGJvZHkpO1xuICAgICAgIC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bHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMwNjUyNzUxLWQ3NGVjOGY4LTllMzEtMTFlNy05OGM1LTcxNDY5ZmNlZjAzZS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93ZXgubnovYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93ZXgubnovdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd2V4Lm56JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93ZXgubnovYXBpLzMvZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3dleC5uei90YXBpL2RvY3MnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93ZXgubnovZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFuc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NvaW5EZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdDb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDcmVhdGVDb3Vwb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZGVlbUNvdXBvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05NQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVkMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdtZXNzYWdlcyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2JhZCBzdGF0dXMnOiBPcmRlck5vdEZvdW5kLFxuICAgICAgICAgICAgICAgICAgICAnUmVxdWVzdHMgdG9vIG9mdGVuJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgICAgICdub3QgYXZhaWxhYmxlJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgICAgICdleHRlcm5hbCBzZXJ2aWNlIHVuYXZhaWxhYmxlJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnUlVSJzogJ1JVQicsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndXBkYXRlZCddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bW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AgICAgfVxuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFyZXNwb25zZVsnc3VjY2VzcyddKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGVycm9yID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ2Vycm9yJyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghZXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm5lZCBhIG1hbGZvcm1lZCBlcnJvcjogJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChlcnJvciA9PT0gJ25vIG9yZGVycycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJldHVybmVkIGJ5IGZldGNoT3Blbk9yZGVycyBpZiBubyBvcGVuIG9yZGVycyAoZml4IGZvciAjNDg5KSAtPiBub3QgYW4gZXJyb3JcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjb25zdCBmZWVkYmFjayA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgbWVzc2FnZXMgPSB0aGlzLmV4Y2VwdGlvbnNbJ21lc3NhZ2VzJ107XG4gICAgICAgICAgICAgICAgICAgIGlmIChlcnJvciBpbiBtZXNzYWdlcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IG1lc3NhZ2VzW2Vycm9yXSAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAg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ICAncmF0ZUxpbWl0JzogMjAwMCwgLy8gcmVzcG9uc2VzIGFyZSBjYWNoZWQgZXZlcnkgMiBzZWNvbmRzXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWNBUEknOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjgwNTk0MTQtZTIzNTk3MGMtNjYyYy0xMWU3LThjM2EtMDhlMzFmNzg2ODRiLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2NyeXB0b3R0bGl2ZXdlYmFwaS54YnRjZS5uZXQ6ODQ0My9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cueGJ0Y2UuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cueGJ0Y2UuY29tL3RyYWRlYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC54YnRjZS5pbmZvL0tub3dsZWRnZWJhc2UvQXJ0aWNsZS9WaWV3LzUyLzI1L3hidGNlLWV4Y2hhbmdlLWFwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZXZlbDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xldmVsMi97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vdGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzZXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc2VydmVyaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzZXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3kve2ZpbHRlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xldmVsMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGV2ZWwyL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2wnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbC97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGljaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGljay97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXNzZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Fzc2V0L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYXNrL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2JpZC9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS9wZXJpb2RpY2l0aWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vdGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS90aWNrcy9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3RvcnkvY2FjaGUve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2FzaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L2NhY2hlL3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9iaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS9jYWNoZS97c3ltYm9sfS9sZXZlbDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS9jYWNoZS97c3ltYm9sfS90aWNrcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS92ZXJzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRTeW1ib2wgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnU3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnTWFyZ2luQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnUHJvZml0Q3VycmVuY3knXTtcbiAgICAgICAgICAgIGlmIChiYXNlID09PSAnRFNIJylcbiAgICAgICAgICAgICAgICBiYXNlID0gJ0RBU0gnO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnSXNUcmFkZUFsbG93ZWQnXSA/IHN5bWJvbCA6IGlkO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRBc3NldCAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIC8vIHhidGNlIG5hbWVzIERBU0ggaW5jb3JyZWN0bHkgYXMgRFNIXG4gICAgICAgICAgICBpZiAodXBwZXJjYXNlID09PSAnRFNIJylcbiAgICAgICAgICAgICAgICB1cHBlcmNhc2UgPSAnREFTSCc7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ0ZyZWVBbW91bnQnXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IGJhbGFuY2VbJ0xvY2tlZEFtb3VudCddLFxuICAgICAg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gICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgICAgIGlmIChiYXNlID09PSAnRFNIJylcbiAgICAgICAgICAgICAgICAgICAgYmFzZSA9ICdEQVNIJztcbiAgICAgICAgICAgICAgICBpZiAocXVvdGUgPT09ICdEU0gnKVxuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9ICdEQVNIJztcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlckZpbHRlciAodGhpc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B0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0FjY2VwdC1FbmNvZGluZyc6ICdnemlwLCBkZWZsYXRlJyB9O1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdQT1NUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzWydDb250ZW50LVR5cGUnXSA9ICdhcHBsaWNhdGlvbi9qc29uJztcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2UgKyB0aGlzLnVpZCArIHRoaXMuYXBpS2V5ICsgbWV0aG9kICsgdXJsO1xuICAgICAgICAgICAgaWYgKGJvZHkpXG4gICAgICAgICAgICAgICAgYXV0aCArPSBib2R5O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jcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3lvYml0JyxcbiAgICAgICAgICAgICduYW1lJzogJ1lvQml0JyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnUlUnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDMwMDAsIC8vIHJlc3BvbnNlcyBhcmUgY2FjaGVkIGV2ZXJ5IDIgc2Vjb25kc1xuICAgICAgICAgICAgJ3ZlcnNpb24nOiAnMycsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdjcmVhdGVEZXBvc2l0QWRkcmVzcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2OTEwLWNkY2JmZGFlLTVlZWEtMTFlNy05ODU5LTAzZmVhODczMjcyZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly95b2JpdC5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly95b2JpdC5uZXQvdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LnlvYml0Lm5ldCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy55b2JpdC5uZXQvZW4vYXBpLycsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cueW9iaXQubmV0L2VuL2ZlZXMvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY3RpdmVPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0NvaW5zVG9BZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge30sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnQUlSJzogJ0FpckNvaW4nLFxuICAgICAgICAgICAgICAgICdBTkknOiAnQU5JQ29pbicsXG4gICAgICAgICAgICAgICAgJ0FOVCc6ICdBbnRzQ29pbicsXG4gICAgICAgICAgICAgICAgJ0FTVCc6ICdBc3RyYWwnLFxuICAgICAgICAgICAgICAgICdBVE0nOiAnQXV0dW1uY29pbicsXG4gICAgICAgICAgICAgICAgJ0JDQyc6ICdCQ0gnLFxuICAgICAgICAgICAgICAgICdCQ1MnOiAnQml0Y29pblN0YWtlJyxcbiAgICAgICAgICAgICAgICAnQkxOJzogJ0J1bGxlb24nLFxuICAgICAgICAgICAgICAgICdCVFMnOiAnQml0c2hhcmVzMicsXG4gICAgICAgICAgICAgICAgJ0NBVCc6ICdCaXRDbGF2ZScsXG4gICAgICAgICAgICAgICAgJ0NPVic6ICdDb3ZlbiBDb2luJyxcbiAgICAgICAgICAgICAgICAnQ1BDJzogJ0NhcHJpY29pbicsXG4gICAgICAgICAgICAgICAgJ0NTJzogJ0NyeXB0b1Nwb3RzJyxcbiAgICAgICAgICAgICAgICAnRENUJzogJ0Rpc2NvdW50JyxcbiAgICAgICAgICAgICAgICAnREdEJzogJ0RhcmtHb2xkQ29pbicsXG4gICAgICAgICAgICAgICAgJ0RST1AnOiAnRmF1Y2V0Q29pbicsXG4gICAgICAgICAgICAgICAgJ0VSVCc6ICdFcmlzdGljYSBUb2tlbicsXG4gICAgICAgICAgICAgICAgJ0lDTic6ICdpQ29pbicsXG4gICAgICAgICAgICAgICAgJ0tOQyc6ICdLaW5nTiBDb2luJyxcbiAgICAgICAgICAgICAgICAnTElaSSc6ICdMaVppJyxcbiAgICAgICAgICAgICAgICAnTE9DJzogJ0xvY29Db2luJyxcbiAgICAgICAgICAgICAgICAnTE9DWCc6ICdMT0MnLFxuICAgICAgICAgICAgICAgICdMVU4nOiAnTHVuYXJDb2luJyxcbiAgICAgICAgICAgICAgICAnTURUJzogJ01pZG5pZ2h0JyxcbiAgICAgICAgICAgICAgICAnTkFWJzogJ05hdmFqb0NvaW4nLFxuICAgICAgICAgICAgICAgICdPTUcnOiAnT01HYW1lJyxcbiAgICAgICAgICAgICAgICAnU1RLJzogJ1N0YWtlQ29pbicsXG4gICAgICAgICAgICAgICAgJ1BBWSc6ICdFUEFZJyxcbiAgICAgICAgICAgICAgICAnUExDJzogJ1BsYXRpbiBDb2luJyxcbiAgICAgICAgICAgICAgICAnUkVQJzogJ1JlcHVibGljb2luJyxcbiAgICAgICAgICAgICAgICAnUlVSJzogJ1JVQicsXG4gICAgICAgICAgICAgICAgJ1hJTic6ICdYSU5Db2luJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnb3B0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnNSZXF1aXJlc1N5bWJvbCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyU3RhdHVzIChzdGF0dXMpIHtcbiAgICAgICAgbGV0IHN0YXR1c2VzID0ge1xuICAgICAgICAgICAgJzAnOiAnb3BlbicsXG4gICAgICAgICAgICAnMSc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgJzInOiAnY2FuY2VsZWQnLFxuICAgICAgICAgICAgJzMnOiAnb3BlbicsIC8vIG9yIHBhcnRpYWxseS1maWxsZWQgYW5kIGNsb3NlZD8gaHR0cHM6Ly9naXRodWIuY29tL2NjeHQvY2N4dC9pc3N1ZXMvMTU5NFxuICAgICAgICB9O1xuICAgICAgICBpZiAoc3RhdHVzIGluIHN0YXR1c2VzKVxuICAgICAgICAgICAgcmV0dXJ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GUgKHVwcGVyY2FzZSk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gcmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY2NvdW50ID0gcmVzdWx0W2N1cnJlbmN5XTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFtrZXldID0gYmFsYW5jZXNbc2lkZV1bbG93ZXJjYXNlXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCh0eXBlb2YgYWNjb3VudFsndG90YWwnXSAhPT0gJ3VuZGVmaW5lZCcpICYmICh0eXBlb2YgYWNjb3VudFsnZnJlZSddICE9PSAndW5kZWZpbmVkJykpXG4gICAgICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZURlcG9zaXRBZGRyZXNzIChjb2RlLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoRGVwb3NpdEFkZHJlc3MgKGNvZGUsIHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbmVlZF9uZXcnOiAxLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGFk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Zm8nOiByZXNwb25zZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyB3aXRoZHJhdyAoY29kZSwgYW1vdW50LCBhZGRyZXNzLCB0YWcgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHRoaXMuY2hlY2tBZGRyZXNzIChhZGRyZXNzKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jeSAoY29kZSk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RXaXRoZHJhd0NvaW5zVG9BZGRyZXNzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2NvaW5OYW1lJzogY3VycmVuY3lbJ2lkJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChib2R5WzBdID09PSAneycpIHtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIGlmICghcmVzcG9uc2VbJ3N1Y2Nlc3MnXSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoJ2Vycm9yX2xvZycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnZXJyb3JfbG9nJ10uaW5kZXhPZiAoJ0luc3VmZmljaWVudCBmdW5kcycpID49IDApIHsgLy8gbm90IGVub3VnVGggaXMgYSB0eXBvIGluc2lkZSBMaXF1aSdzIG93biBBUEkuLi5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJlc3BvbnNlWydlcnJvcl9sb2cnXSA9PT0gJ1JlcXVlc3RzIHRvbyBvZnRlbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRERvU1Byb3RlY3Rpb24gKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChyZXNwb25zZVsnZXJyb3JfbG9nJ10gPT09ICdub3QgYXZhaWxhYmxlJykgfHwgKHJlc3BvbnNlWydlcnJvcl9sb2cnXSA9PT0gJ2V4dGVybmFsIHNlcnZpY2UgdW5hdmFpbGFibGUnKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBERG9TUHJvdGVjdGlvbiAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG59O1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG4vLyAtLS0tLS0t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AgICAgICAgICAgICcxMmgnOiAnNzIwJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMTQ0MCcsXG4gICAgICAgICAgICAgICAgJzNkJzogJzQzMjAnLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxMDA4MCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODU3MDU0OC00ZDY0NmM0MC03MTQ3LTExZTctOWNmNi04MzliOTNlNmQ2MjIuanBnJyxcbiAgICAgICAgICAgICAgICAnZXh0ZW5zaW9uJzogJy5qc29uJywgLy8gZGVmYXVsdCBleHRlbnNpb24gYXBwZW5kZWQgdG8gZW5kcG9pbnQgVVJMc1xuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly95dW5iaS5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly95dW5iaS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3l1bmJpLmNvbS9kb2N1bWVudHMvYXBpL2d1aWRlJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8veXVuYmkuY29tL3N3YWdnZXIvJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrX3dpdGhfcGVuZGluZ190cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpbWVzdGFtcCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWRkcmVzc2VzL3thZGRyZXNzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFydG5lcnMvb3JkZXJzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZW1iZXJzL21lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9teScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2RlbGV0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvbXVsdGknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9jbGVhcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgI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ICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2OTI3LTM5Y2EyYWRhLTVlZWItMTFlNy05NzJmLTFiNDE5OTUxOGNhNi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuemFpZi5qcCcsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3phaWYuanAnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwOi8vdGVjaGJ1cmVhdS1hcGktZG9jdW1lbnQucmVhZHRoZWRvY3MuaW8vamEvbGF0ZXN0L2luZGV4Lmh0bWwnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9jb3JwLnphaWYuanAvYXBpLWRvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9jb3JwLnphaWYuanAvYXBpLWRvY3MvYXBpX2xpbmtzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5wbWpzLmNvbS9wYWNrYWdlL3phaWYuanAnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL3lvdTIxOTc5L25vZGUtemFpZicsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3phaWYuanAvZmVlP2xhbmc9ZW4nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IC0wLjAwMDEsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IC0wLjAwMDUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jaWVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY2llcy9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5X3BhaXJzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3lfcGFpcnMvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWN0aXZlX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9pZF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2luZm8yJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfcGVyc29uYWxfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdlY2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlSW52b2ljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW52b2ljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW52b2ljZUlkc0J5T3JkZXJOdW1iZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbEludm9pY2UnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3RsYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbl9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY3RpdmVfcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGVfcG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYW5nZV9wb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyb3Vwcy97Z3JvdXBfaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlL3tncm91cF9pZH0ve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2dyb3VwX2lkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97Z3JvdXBfaWR9L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve2dyb3VwX2lkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY3lQYWlyc0FsbCAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydjdXJyZW5jeV9wYWlyJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogLU1hdGgubG9nMTAgKG1hcmtldFsnaXRlbV91bml0X3N0ZXAnXSksXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydhdXhfdW5pdF9wb2ludCddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsIC8vIGNhbiB0cmFkZSBvciBub3RcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ2l0ZW1fdW5pdF9taW4nKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnYXV4X3VuaXRfbWluJyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXR1cm4nXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlc1snZnVuZHMnXSk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbJ2Z1bmRzJ11bY3VycmVuY3ldO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2UsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKCdkZXBvc2l0JyBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlc1snZGVwb3NpdCddKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBiYWxhbmNlc1snZGVwb3NpdCddW2N1cnJlbmN5XTtcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXREZXB0aFBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJQYWlyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgdndhcCA9IHRpY2tlclsndndhcCddO1xuICAgICAgICBsZXQgYmFzZVZvbHVtZSA9IHRpY2tlclsndm9sdW1lJ107XG4gICAgICAgIGxldCBxdW90ZVZvbHVtZSA9IGJhc2VWb2x1bWUgKiB2d2FwO1xuICAgICAgICBsZXQgbGFzdCA9IHRpY2tlclsnbGFzdCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRpY2tlclsnaGlnaCddLFxuICAgICAgICAgICAgJ2xvdyc6IHRpY2tlclsnbG93J10sXG4gICAgICAgICAgICAnYmlkJzogdGlja2VyWydiaWQnXSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGlja2VyWydhc2snXSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gKHRyYWRlWyd0cmFkZV90eXBlJ10gPT09ICdiaWQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIGxldCBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdpZCcpO1xuICAgICAgICBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0aWQnLCBpZCk7XG4gICAgICAgIGlmICghbWFya2V0KVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydjdXJyZW5jeV9wYWlyJ11dO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQudG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnYW1vdW50J10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVzUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwY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mQgKHtcbiAgICAgICAgICAgICdvcmRlcl9pZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gKG9yZGVyWydhY3Rpb24nXSA9PT0gJ2JpZCcpID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAob3JkZXJbJ3RpbWVzdGFtcCddKSAqIDEwMDA7XG4gICAgICAgIGlmICghbWFya2V0KVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW29yZGVyWydjdXJyZW5jeV9wYWlyJ11dO1xuICAgICAgICBsZXQgcHJpY2UgPSBvcmRlclsncHJpY2UnXTtcbiAgICAgICAgbGV0IGFtb3VudCA9IG9yZGVyWydhbW91bnQnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IHV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gICAgICAgICAgIHVybCArPSAnZWNhcGknO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChhcGkgPT09ICd0bGFwaScpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJ3RsYXBpJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICd0YXBpJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGJvZHkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ2FwaScsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0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gICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnemInLFxuICAgICAgICAgICAgJ25hbWUnOiAnWkInLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDTicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlTWFya2V0T3JkZXInOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbWluJyxcbiAgICAgICAgICAgICAgICAnM20nOiAnM21pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtaW4nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaG91cicsXG4gICAgICAgICAgICAgICAgJzJoJzogJzJob3VyJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnNGhvdXInLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aG91cicsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnM2QnOiAnM2RheScsXG4gICAgICAgIC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1ZmZpY2llbnRGdW5kcywgLy8gJ0luc3VmZmljaWVudCBCVEMgQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgJzIwMDMnOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gJ0luc3VmZmljaWVudCBMVEMgQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgJzIwMDUnOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gJ0luc3VmZmljaWVudCBFVEggQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgJzIwMDYnOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gJ0luc3VmZmljaWVudCBFVEMgQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgJzIwMDcnOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gJ0luc3VmZmljaWVudCBCVFMgQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgJzIwMDknOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gJ0FjY291bnQgYmFsYW5jZSBpcyBub3QgZW5vdWdoJyxcbiAgICAgICAgICAgICAgICAnMzAwMSc6IE9yZGVyTm90Rm91bmQsIC8vICdQZW5kaW5nIG9yZGVycyBub3QgZm91bmQnLFxuICAgICAgICAgICAgICAgICczMDAyJzogSW52YWxpZE9yZGVyLCAvLyAnSW52YWxpZCBwcmljZScsXG4gICAgICAgICAgICAgICAgJzMwMDMnOiBJbnZhbGlkT3JkZXIsIC8vICdJbnZhbGlkIGFtb3VudCcsXG4gICAgICAgICAgICAgICAgJzMwMDQnOiBBdXRoZW50aWNhdGlvbkVycm9yLCAvLyAnVXNlciBkb2VzIG5vdCBleGlzdCcsXG4gICAgICAgICAgICAgICAgJzMwMDUnOiBFeGNoYW5nZUVycm9yLCAvLyAnSW52YWxpZCBwYXJhbWV0ZXInLFxuICAgICAgICAgICAgICAgICczMDA2JzogQXV0aGVudGljYXRpb25FcnJvciwgLy8gJ0ludmFsaWQgSVAgb3IgaW5jb25zaXN0ZW50IHdpdGggdGhlIGJvdW5kIElQJyxcb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gICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzcG90IEFQSVxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzTmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcnNJZ25vcmVUcmFkZVR5cGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFVuZmluaXNoZWRPcmRlcnNJZ25vcmVUcmFkZVR5cGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEFjY291bnRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRVc2VyQWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0V2l0aGRyYXdBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRXaXRoZHJhd1JlY29yZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Q2hhcmdlUmVjb3JkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRDbnlXaXRoZHJhd1JlY29yZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Q255Q2hhcmdlUmVjb3JkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBsZXZlcmFnZSBBUElcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRMZXZlckFzc2V0c0luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldExldmVyQmlsbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVySW5MZXZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXJPdXRMZXZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsTG9hbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0TG9hbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldExvYW5SZWNvcmRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib3Jyb3cnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRSZXBheW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRTJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogJzAuMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FDQVNIJzogNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTksnOiAyMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUVic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEJUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0hBVCc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdENOWSc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hMQyc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNXJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQudG9VcHBlckNhc2UgKCkpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQudG9VcHBlckNhc2UgKCkpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYW1vdW50U2NhbGUnXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ3ByaWNlU2NhbGUnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRHZXRBY2NvdW50SW5mbyAocGFyYW1zKTtcbiAgICAgICAgLy8gdG9kbzogdXNlIHRoaXMgc29tZWhvd1xuICAgICAgICAvLyBsZXQgcGVybWlzc2lvbnMgPSByZXNwb25zZVsncmVzdWx0J11bJ2Jhc2UnXTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3Jlc3VsdCddWydjb2lucyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmFsYW5jZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaV07XG4gICAgICAgICAgICAvLyAgICAgeyAgICAgICAgZW5OYW1lOiBcIkJUQ1wiLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgICBmcmVlejogXCIwLjAwMDAwMDAwXCIsXG4gICAgICAgICAgICAvLyAgICAgICAgIHVuaXREZWNpbWFsOiAgOCwgLy8gYWx3YXlzIDhcbiAgICAgICAgICAgIC8vICAgICAgICAgICAgICBjbk5hbWU6IFwiQlRDXCIsXG4gICAgICAgICAgICAvLyAgICAgICBpc0NhblJlY2hhcmdlOiAgdHJ1ZSwgLy8gVE9ETzogc2hvdWxkIHVzZSB0aGlzXG4gICAgICAgICAgICAvLyAgICAgICAgICAgICB1bml0VGFnOiBcIuC4v1wiLFxuICAgICAgICAgICAgLy8gICAgICAgaXNDYW5XaXRoZHJhdzogIHRydWUsICAvLyBUT0RPOiBzaG91bGQgdXNlIHRoaXNcbiAgICAgICAgICAgIC8vICAgICA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iAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRj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pO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICh0eXBlICE9PSAnbGltaXQnKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgYWxsb3dzIGxpbWl0IG9yZGVycyBvbmx5Jyk7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdwcmljZSc6IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSksXG4gICAgICAgICAgICAnYW1vdW50JzogdGhpcy5hbW91bnRUb1N0cmluZyAoc3ltYm9sLCBhbW91bnQpLFxuICAgICAgICAgICAgJ3RyYWRlVHlwZSc6IChzaWRlID09PSAnYnV5JykgPyAnMScgOiAnMCcsXG4gICAgICAgICAgICAnY3VycmVuY3knOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRPcmRlciAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnaWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2lkJzogaWQudG9TdHJpbmcgKCks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nXTtcbiAgICAgICAgbGV0IHByaWNlID0gb3JkZXJbJ3ByaWNlJ107XG4gICAgICAgIGxldCBhdmVyYWdlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgZmlsbGVkID0gb3JkZXJbJ3RyYWRlX2Ftb3VudCddO1xuICAgICAgICBsZXQgYW1vdW50ID0gb3JkZXJbJ3RvdGFsX2Ftb3VudCddO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICBsZXQgY29zdCA9IG9yZGVyWyd0cmFkZV9tb25leSddO1xuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ3N0YXR1cycpO1xuICAgICAgICBpZiAodHlwZW9mIHN0YXR1cyAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBzdGF0dXMgPSB0aGlzLnBhcnNlT3JkZXJTdGF0dXMgKHN0YXR1cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJTdGF0dXMgKHN0YXR1cykge1xuICAgICAgICBjb25zdCBzdGF0dXNlcyA9IHtcbiAgICAgICAgICAgICcwJzogJ29wZW4nLFxuICAgICAgICAgICAgJzEnOiAnY2FuY2VsZWQnLFxuICAgICAgICAgICAgJzInOiAnY2xvc2VkJyxcbiAgICAgICAgICAgICczJzogJ29wZW4nLCAvLyBwYXJ0aWFsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChzdGF0dXMgaW4gc3RhdHVzZXMpXG4gICAgICAgICAgICByZXR1cm4gc3RhdHVzZXNbc3RhdHVzXTtcbiAgICAgICAgcmV0dXJuIHN0YXR1cztcbiAgICB9XG5cbiAgICBnZXRDcmVhdGVEYXRlRmllbGQgKCkge1xuICAgICAgICByZXR1cm4gJ3RyYWRlX2RhdGUnO1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxl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R5KSB7XG4gICAgICAgIGlmICh0eXBlb2YgYm9keSAhPT0gJ3N0cmluZycpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoYm9keS5sZW5ndGggPCAyKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKGJvZHlbMF0gPT09ICd7Jykge1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBpZiAoJ2NvZGUnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnY29kZScpO1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgIGlmIChjb2RlIGluIHRoaXMuZXhjZXB0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgRXhjZXB0aW9uQ2xhc3MgPSB0aGlzLmV4Y2VwdGlvbnNbY29kZV07XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNlcHRpb25DbGFzcyAobWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjb2RlICE9PSAnMTAwMCcpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn07XG4iLCI7KGZ1bmN0aW9uIChyb290LCBmYWN0b3J5LCB1bmRlZikge1xuXHRpZiAodHlwZW9mIGV4cG9ydHMgPT09IFwib2JqZWN0XCIpIHtcblx0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ICAgICAgICAgIHZhciBuUm91bmRzID0gdGhpcy5fblJvdW5kcyA9IGtleVNpemUgKyA2O1xuXG5cdCAgICAgICAgICAgIC8vIENvbXB1dGUgbnVtYmVyIG9mIGtleSBzY2hlZHVsZSByb3dzXG5cdCAgICAgICAgICAgIHZhciBrc1Jvd3MgPSAoblJvdW5kcyArIDEpICogNDtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIGtleSBzY2hlZHVsZVxuXHQgICAgICAgICAgICB2YXIga2V5U2NoZWR1bGUgPSB0aGlzLl9rZXlTY2hlZHVsZSA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBrc1JvdyA9IDA7IGtzUm93IDwga3NSb3dzOyBrc1JvdysrKSB7XG5cdCAgICAgICAgICAgICAgICBpZiAoa3NSb3cgPCBrZXlTaXplKSB7XG5cdCAgICAgICAgICAgICAgICAgICAga2V5U2NoZWR1bGVba3NSb3ddID0ga2V5V29yZHNba3NSb3ddO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGtleVNjaGVkdWxlW2tzUm93IC0gMV07XG5cblx0ICAgICAgICAgICAgICAgICAgICBpZiAoIShrc1JvdyAlIGtleVNpemUpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJvdCB3b3JkXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAodCA8PCA4KSB8ICh0ID4+PiAyNCk7XG5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgLy8gU3ViIHdvcmRcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdCA9IChTQk9YW3QgPj4+IDI0XSA8PCAyNCkgfCAoU0JPWFsodCA+Pj4gMTYpICYgMHhmZl0gPDwgMTYpIHwgKFNCT1hbKHQgPj4+IDgpICYgMHhmZl0gPDwgOCkgfCBTQk9YW3QgJiAweGZmXTtcblxuXHQgICAgICAgICAgICAgICAgICAgICAgICAvLyBNaXggUmNvblxuXHQgICAgICAgICAgICAgICAgICAgICAgICB0IF49IFJDT05bKGtzUm93IC8ga2V5U2l6ZSkgfCAwXSA8PCAyNDtcblx0ICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtleVNpemUgPiA2ICYmIGtzUm93ICUga2V5U2l6ZSA9PSA0KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN1YiB3b3JkXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAoU0JPWFt0ID4+PiAyNF0gPDwgMjQpIHwgKFNCT1hbKHQgPj4+IDE2KSAmIDB4ZmZdIDw8IDE2KSB8IChTQk9YWyh0ID4+PiA4KSAmIDB4ZmZdIDw8IDgpIHwgU0JPWFt0ICYgMHhmZl07XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAgICAga2V5U2NoZWR1bGVba3NSb3ddID0ga2V5U2NoZWR1bGVba3NSb3cgLSBrZXlTaXplXSBeIHQ7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIGludiBrZXkgc2NoZWR1bGVcblx0ICAgICAgICAgICAgdmFyIGludktleVNjaGVkdWxlID0gdGhpcy5faW52S2V5U2NoZWR1bGUgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaW52S3NSb3cgPSAwOyBpbnZLc1JvdyA8IGtzUm93czsgaW52S3NSb3crKykge1xuXHQgICAgICAgICAgICAgICAgdmFyIGtzUm93ID0ga3NSb3dzIC0gaW52S3NSb3c7XG5cblx0ICAgICAgICAgICAgICAgIGlmIChpbnZLc1JvdyAlIDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGtleVNjaGVkdWxlW2tzUm93XTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHQgPSBrZXlTY2hlZHVsZVtrc1JvdyAt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5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBjaXBoZXIgPSBDcnlwdG9KUy5hbGdvLkFFUy5jcmVhdGVFbmNyeXB0b3Ioa2V5V29yZEFycmF5LCB7IGl2OiBpdldvcmRBcnJheSB9KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBjcmVhdGVFbmNyeXB0b3I6IGZ1bmN0aW9uIChrZXksIGNmZykge1xuXHQgICAgICAgICAgICByZXR1cm4gdGhpcy5jcmVhdGUodGhpcy5fRU5DX1hGT1JNX01PREUsIGtleSwgY2ZnKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ3JlYXRlcyB0aGlzIGNpcGhlciBpbiBkZWNyeXB0aW9uIG1vZGUuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0ga2V5IFRoZSBrZXkuXG5cdCAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IGNmZyAoT3B0aW9uYWwpIFRoZSBjb25maWd1cmF0aW9uIG9wdGlvbnMgdG8gdXNlIGZvciB0aGlzIG9wZXJhdGlvbi5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge0NpcGhlcn0gQSBjaXBoZXIgaW5zdGFuY2UuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBjaXBoZXIgPSBDcnlwdG9KUy5hbGdvLkFFUy5jcmVhdGVEZWNyeXB0b3Ioa2V5V29yZEFycmF5LCB7IGl2OiBpdldvcmRBcnJheSB9KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBjcmVhdG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lvbnMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBBRVMgPSBDcnlwdG9KUy5saWIuQ2lwaGVyLl9jcmVhdGVIZWxwZXIoQ3J5cHRvSlMuYWxnby5BRVMpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIF9jcmVhdGVIZWxwZXI6IChmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIGZ1bmN0aW9uIHNlbGVjdENpcGhlclN0cmF0ZWd5KGtleSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBrZXkgPT0gJ3N0cmluZycpIHtcblx0ICAgICAgICAgICAgICAgICAgICByZXR1cm4gUGFzc3dvcmRCYXNlZENpcGhlcjtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNlcmlhbGl6YWJsZUNpcGhlcjtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAoY2lwaGVyKSB7XG5cdCAgICAgICAgICAgICAgICByZXR1cm4ge1xuXHQgICAgICAgICAgICAgICAgICAgIGVuY3J5cHQ6IGZ1bmN0aW9uIChtZXNzYWdlLCBrZXksIGNmZykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2VsZWN0Q2lwaGVyU3RyYXRlZ3koa2V5KS5lbmNyeXB0KGNpcGhlciwgbWVzc2FnZSwga2V5LCBjZmcpO1xuXHQgICAgICAgICAgICAgICAgICAgIH0sXG5cblx0ICAgICAgICAgICAgICAgICAgICBkZWNyeXB0OiBmdW5jdGlvbiAoY2lwaGVydGV4dCwga2V5LCBjZmcpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIH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dCAgICAgICAgICovXG5cdCAgICAgICAgdmFyIENCQyA9IEJsb2NrQ2lwaGVyTW9kZS5leHRlbmQoKTtcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENCQyBlbmNyeXB0b3IuXG5cdCAgICAgICAgICovXG5cdCAgICAgICAgQ0JDLkVuY3J5cHRvciA9IENCQy5leHRlbmQoe1xuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogUHJvY2Vzc2VzIHRoZSBkYXRhIGJsb2NrIGF0IG9mZnNldC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtBcnJheX0gd29yZHMgVGhlIGRhdGEgd29yZHMgdG8gb3BlcmF0ZSBvbi5cblx0ICAgICAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IG9mZnNldCBUaGUgb2Zmc2V0IHdoZXJlIHRoZSBibG9jayBzdGFydHMuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBtb2RlLnByb2Nlc3NCbG9jayhkYXRhLndvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgcHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAod29yZHMsIG9mZnNldCkge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgY2lwaGVyID0gdGhpcy5fY2lwaGVyO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrU2l6ZSA9IGNpcGhlci5ibG9ja1NpemU7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFhPUiBhbmQgZW5jcnlwdFxuXHQgICAgICAgICAgICAgICAgeG9yQmxvY2suY2FsbCh0aGlzLCB3b3Jkcywgb2Zmc2V0LCBibG9ja1NpemUpO1xuXHQgICAgICAgICAgICAgICAgY2lwaGVyLmVuY3J5cHRCbG9jayh3b3Jkcywgb2Zmc2V0KTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVtZW1iZXIgdGhpcyBibG9jayB0byB1c2Ugd2l0aCBuZXh0IGJsb2NrXG5cdCAgICAgICAgICAgICAgICB0aGlzLl9wcmV2QmxvY2sgPSB3b3Jkcy5zbGljZShvZmZzZXQsIG9mZnNldCArIGJsb2NrU2l6ZSk7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9KTtcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENCQyBkZWNyeXB0b3IuXG5cdCAgICAgICAgICovXG5cdCAgICAgICAgQ0JDLkRlY3J5cHRvciA9IENCQy5leHRlbmQoe1xuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogUHJvY2Vzc2VzIHRoZSBkYXRhIGJsb2NrIGF0IG9mZnNldC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtBcnJheX0gd29yZHMgVGhlIGRhdGEgd29yZHMgdG8gb3BlcmF0ZSBvbi5cblx0ICAgICAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IG9mZnNldCBUaGUgb2Zmc2V0IHdoZXJlIHRoZSBibG9jayBzdGFydHMuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBtb2RlLnByb2Nlc3NCbG9jayhkYXRhLndvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgcHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAod29yZHMsIG9mZnNldCkge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgY2lwaGVyID0gdGhpcy5fY2lwaGVyO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrU2l6ZSA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GNpcGhlclBhcmFtcyA9IENyeXB0b0pTLmxpYi5DaXBoZXJQYXJhbXMuY3JlYXRlKHtcblx0ICAgICAgICAgKiAgICAgICAgIGNpcGhlcnRleHQ6IGNpcGhlcnRleHRXb3JkQXJyYXksXG5cdCAgICAgICAgICogICAgICAgICBrZXk6IGtleVdvcmRBcnJheSxcblx0ICAgICAgICAgKiAgICAgICAgIGl2OiBpdldvcmRBcnJheSxcblx0ICAgICAgICAgKiAgICAgICAgIHNhbHQ6IHNhbHRXb3JkQXJyYXksXG5cdCAgICAgICAgICogICAgICAgICBhbGdvcml0aG06IENyeXB0b0pTLmFsZ28uQUVTLFxuXHQgICAgICAgICAqICAgICAgICAgbW9kZTogQ3J5cHRvSlMubW9kZS5DQkMsXG5cdCAgICAgICAgICogICAgICAgICBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUEtDUzcsXG5cdCAgICAgICAgICogICAgICAgICBibG9ja1NpemU6IDQsXG5cdCAgICAgICAgICogICAgICAgICBmb3JtYXR0ZXI6IENyeXB0b0pTLmZvcm1hdC5PcGVuU1NMXG5cdCAgICAgICAgICogICAgIH0pO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGluaXQ6IGZ1bmN0aW9uIChjaXBoZXJQYXJhbXMpIHtcblx0ICAgICAgICAgICAgdGhpcy5taXhJbihjaXBoZXJQYXJhbXMpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyB0aGlzIGNpcGhlciBwYXJhbXMgb2JqZWN0IHRvIGEgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtGb3JtYXR9IGZvcm1hdHRlciAoT3B0aW9uYWwpIFRoZSBmb3JtYXR0aW5nIHN0cmF0ZWd5IHRvIHVzZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIHN0cmluZ2lmaWVkIGNpcGhlciBwY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uXG5cdCAgICAgICAgICAgIEYucHJvdG90eXBlID0gb2JqO1xuXG5cdCAgICAgICAgICAgIHN1YnR5cGUgPSBuZXcgRigpO1xuXG5cdCAgICAgICAgICAgIEYucHJvdG90eXBlID0gbnVsbDtcblxuXHQgICAgICAgICAgICByZXR1cm4gc3VidHlwZTtcblx0ICAgICAgICB9O1xuXHQgICAgfSgpKVxuXG5cdCAgICAvKipcblx0ICAgICAqIENyeXB0b0pTIG5hbWVzcGFjZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIEMgPSB7fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBMaWJyYXJ5IG5hbWVzcGFjZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIENfbGliID0gQy5saWIgPSB7fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBCYXNlIG9iamVjdCBmb3IgcHJvdG90eXBhbCBpbmhlcml0YW5jZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIEJhc2UgPSBDX2xpYi5CYXNlID0gKGZ1bmN0aW9uICgpIHtcblxuXG5cdCAgICAgICAgcmV0dXJuIHtcblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIENyZWF0ZXMgYSBuZXcgb2JqZWN0IHRoYXQgaW5oZXJpdHMgZnJvbSB0aGlzIG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IG92ZXJyaWRlcyBQcm9wZXJ0aWVzIHRvIGNvcHkgaW50byB0aGUgbmV3IG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHJldHVybiB7T2JqZWN0fSBUaGUgbmV3IG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiAgICAgdmFyIE15VHlwZSA9IENyeXB0b0pTLmxpYi5CYXNlLmV4dGVuZCh7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgZmllbGQ6ICd2YWx1ZScsXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICAgICAgbWV0aG9kOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgfVxuXHQgICAgICAgICAgICAgKiAgICAgfSk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBleHRlbmQ6IGZ1bmN0aW9uIChvdmVycmlkZXMpIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNwYXduXG5cdCAgICAgICAgICAgICAgICB2YXIgc3VidHlwZSA9IGNyZWF0ZSh0aGlzKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gQXVnbWVudFxuXHQgICAgICAgICAgICAgICAgaWYgKG92ZXJyaWRlcykge1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YnR5cGUubWl4SW4ob3ZlcnJpZGVzKTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIGRlZmF1bHQgaW5pdGlhbGl6ZXJcblx0ICAgICAgICAgICAgICAgIGlmICghc3VidHlwZS5oYXNPd25Qcm9wZXJ0eSgnaW5pdCcpIHx8IHRoaXMuaW5pdCA9PT0gc3VidHlwZS5pbml0KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgc3VidHlwZS5pbml0ID0gZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0eXBlLiRzdXBlci5pbml0LmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG5cdCAgICAgICAgICAgICAgICAgICAgfTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gSW5pdGlhbGl6ZXIncyBwcm90b3R5cGUgaXMgdGhlIHN1YnR5cGUgb2JqZWN0XG5cdCAgICAgICAgICAgICAgICBzdWJ0eXBlLmluaXQucHJvdG90eXBlID0gc3VidHlwZTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVmZXJlbmNlIHN1cGVydHlwZVxuXHQgICAgICAgICAgICAgICAgc3VidHlwZS4kc3VwZXIgPSB0aGlzO1xuXG5cdCAgICAgICAgICAgICAgICByZXR1cm4gc3VidHlwZTtcblx0ICAgICAgICAgICAgfSxcblxuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogRXh0ZW5kcyB0aGlzIG9iamVjdCBhbmQgcnVucyB0aGUgaW5pdCBtZXRob2QuXG5cdCAgICAgICAgICAgICAqIEFyZ3VtZW50cyB0byBjcmVhdGUoKSB3aWxsIGJlIHBhc3NlZCB0byBpbml0KCkuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEByZXR1cm4ge09iamVjdH0gVGhlIG5ldyBvYmplY3QuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIHZhciBpbnN0YW5jZSA9IE15VHlwZS5jcmVhdGUoKTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIGNyZWF0ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgdmFyIGluc3RhbmNlID0gdGhpcy5leHRlbmQoKTtcblx0ICAgICAgICAgICAgICAgIGluc3RhbmNlLmluaXQuYXBwbHkoaW5zdGFuY2UsIGFyZ3VtZW50cyk7XG5cblx0ICAgICAgICAgICAgICAgIHJldHVybiBpbnN0YW5jZTtcblx0ICAgICAgICAgICAgfSxcblxuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogSW5pdGlhbGl6ZXMgYSBuZXdseSBjcmVhdGVkIG9iamVjdC5cblx0ICAgICAgICAgICAgICogT3ZlcnJpZGUgdGhpcyBtZXRob2QgdG8gYWRkIHNvbWUgbG9naWMgd2hlbiB5b3VyIG9iamVjdHMgYXJlIGNyZWF0ZWQuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICB2YXIgTXlUeXBlID0gQ3J5cHRvSlMubGliLkJhc2UuZXh0ZW5kKHtcblx0ICAgICAgICAgICAgICogICAgICAgICBpbml0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgICAgIC8vIC4uLlxuXHQgICAgICAgICAgICAgKiAgICAgICAgIH1cblx0ICAgICAgICAgICAgICogICAgIH0pO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgaW5pdDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICB9LFxuXG5cdCAgICAgICAgICAgIC8qKlxuXHQgICAgICAgICAgICAgKiBDb3BpZXMgcHJvcGVydGllcyBpbnRvIHRoaXMgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gcHJvcGVydGllcyBUaGUgcHJvcGVydGllcyB0byBtaXggaW4uXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBNeVR5cGUubWl4SW4oe1xuXHQgICAgICAgICAgICAgKiAgICAgICAgIGZpZWxkOiAndmFsdWUnXG5cdCAgICAgICAgICAgICAqICAgICB9KTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIG1peEluOiBmdW5jdGlvbiAocHJvcGVydGllcykge1xuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgcHJvcGVydHlOYW1lIGluIHByb3BlcnRpZXMpIHtcblx0ICAgICAgICAgICAgICAgICAgICBpZiAocHJvcGVydGllcy5oYXNPd25Qcm9wZXJ0eShwcm9wZXJ0eU5hbWUpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNbcHJvcGVydHlOYW1lXSA9IHByb3BlcnRpZXNbcHJvcGVydHlOYW1lXTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIElFIHdvbid0IGNvcHkgdG9TdHJpbmcgdXNpbmcgdGhlIGxvb3AgYWJvdmVcblx0ICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0aWVzLmhhc093blByb3BlcnR5KCd0b1N0cmluZycpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdGhpcy50b1N0cmluZyA9IHByb3BlcnRpZXMudG9TdHJpbmc7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH0sXG5cblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIENyZWF0ZXMgYSBjb3B5IG9mIHRoaXMgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAcmV0dXJuIHtPYmplY3R9IFRoZSBjbG9uZS5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIHZhciBjbG9uZSA9IGluc3RhbmNlLmNsb25lKCk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBjbG9uZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuaW5pdC5wcm90b3R5cGUuZXh0ZW5kKHRoaXMpO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfTtcblx0ICAgIH0oKSk7XG5cblx0ICAgIC8qKlxuXHQgICAgICogQW4gYXJyYXkgb2YgMzItYml0IHdvcmRzLlxuXHQgICAgICpcblx0ICA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7XG5cdCAgICAgICAgICAgIHdvcmRzID0gdGhpcy53b3JkcyA9IHdvcmRzIHx8IFtdO1xuXG5cdCAgICAgICAgICAgIGlmIChzaWdCeXRlcyAhPSB1bmRlZmluZWQpIHtcblx0ICAgICAgICAgICAgICAgIHRoaXMuc2lnQnl0ZXMgPSBzaWdCeXRlcztcblx0ICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgIHRoaXMuc2lnQnl0ZXMgPSB3b3Jkcy5sZW5ndGggKiA0O1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIHRoaXMgd29yZCBhcnJheSB0byBhIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7RW5jb2Rlcn0gZW5jb2RlciAoT3B0aW9uYWwpIFRoZSBlbmNvZGluZyBzdHJhdGVneSB0byB1c2UuIERlZmF1bHQ6IENyeXB0b0pTLmVuYy5IZXhcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIHN0cmluZ2lmaWVkIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBzdHJpbmcgPSB3b3JkQXJyYXkgKyAnJztcblx0ICAgICAgICAgKiAgICAgdmFyIHN0cmluZyA9IHdvcmRBcnJheS50b1N0cmluZygpO1xuXHQgICAgICAgICAqICAgICB2YXIgc3RyaW5nID0gd29yZEFycmF5LnRvU3RyaW5nKENyeXB0b0pTLmVuYy5VdGY4KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICB0b1N0cmluZzogZnVuY3Rpb24gKGVuY29kZXIpIHtcblx0ICAgICAgICAgICAgcmV0dXJuIChlbmNvZGVyIHx8IEhleCkuc3RyaW5naWZ5KHRoaXMpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb25jYXRlbmF0ZXMgYSB3b3JkIGFycmF5IHRvIHRoaXMgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fSB3b3JkQXJyYXkgVGhlIHdvcmQgYXJyYXkgdG8gYXBwZW5kLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGlzIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHdvcmRBcnJheTEuY29uY2F0KHdvcmRBcnJheTIpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGNvbmNhdDogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHRoaXNXb3JkcyA9IHRoaXMud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB0aGF0V29yZHMgPSB3b3JkQXJyYXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB0aGlzU2lnQnl0ZXMgPSB0aGlzLnNpZ0J5dGVzO1xuXHQgICAgICAgICAgICB2YXIgdGhhdFNpZ0J5dGVzID0gd29yZEFycmF5LnNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIENsYW1wIGV4Y2VzcyBiaXRzXG5cdCAgICAgICAgICAgIHRoaXMuY2xhbXAoKTtcblxuXHQgICAgICAgICAgICAvLyBDb25jYXRcblx0ICAgICAgICAgICAgaWYgKHRoaXNTaWdCeXRlcyAlIDQpIHtcblx0ICAgICAgICAgICAgICAgIC8vIENvcHkgb25lIGJ5dGUgYXQgYSB0aW1lXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHRoYXRTaWdCeXRlczsgaSsr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ICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgcmFuZG9tIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5saWIuV29yZEFycmF5LnJhbmRvbSgxNik7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcmFuZG9tOiBmdW5jdGlvbiAobkJ5dGVzKSB7XG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IFtdO1xuXG5cdCAgICAgICAgICAgIHZhciByID0gKGZ1bmN0aW9uIChtX3cpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBtX3cgPSBtX3c7XG5cdCAgICAgICAgICAgICAgICB2YXIgbV96ID0gMHgzYWRlNjhiMTtcblx0ICAgICAgICAgICAgICAgIHZhciBtYXNrID0gMHhmZmZmZmZmZjtcblxuXHQgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgICAgICAgICBtX3ogPSAoMHg5MDY5ICogKG1feiAmIDB4RkZGRikgKyAobV96ID4+IDB4MTApKSAmIG1hc2s7XG5cdCAgICAgICAgICAgICAgICAgICAgbV93ID0gKDB4NDY1MCAqIChtX3cgJiAweEZGRkYpICsgKG1fdyA+PiAweDEwKSkgJiBtYXNrO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciByZXN1bHQgPSAoKG1feiA8PCAweDEwKSArIG1fdykgJiBtYXNrO1xuXHQgICAgICAgICAgICAgICAgICAgIHJlc3VsdCAvPSAweDEwMDAwMDAwMDtcblx0ICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gMC41O1xuXHQgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKiAoTWF0aC5yYW5kb20oKSA+IC41ID8gMSA6IC0xKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfSk7XG5cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDAsIHJjYWNoZTsgaSA8IG5CeXRlczsgaSArPSA0KSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgX3IgPSByKChyY2FjaGUgfHwgTWF0aC5yYW5kb20oKSkgKiAweDEwMDAwMDAwMCk7XG5cblx0ICAgICAgICAgICAgICAgIHJjYWNoZSA9IF9yKCkgKiAweDNhZGU2N2I3O1xuXHQgICAgICAgICAgICAgICAgd29yZHMucHVzaCgoX3IoKSAqIDB4MTAwMDAwMDAwKSB8IDApO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIG5ldyBXb3JkQXJyYXkuaW5pdCh3b3JkcywgbkJ5dGVzKTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBFbmNvZGVyIG5hbWVzcGFjZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIENfZW5jID0gQy5lbmMgPSB7fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBIZXggZW5jb2Rpbmcgc3RyYXRlZ3kuXG5cdCAgICAgKi9cblx0ICAgIHZhciBIZXggPSBDX2VuYy5IZXggPSB7XG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSB3b3JkIGFycmF5IHRvIGEgaGV4IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fSB3b3JkQXJyYXkgVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtzdHJpbmd9IFRoZSBoZXggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgaGV4U3RyaW5nID0gQ3J5cHRvSlMuZW5jLkhleC5zdHJpbmdpZnkod29yZEFycmF5KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBzdHJpbmdpZnk6IGZ1bmN0aW9uICh3b3JkQXJyYXkpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IHdvcmRBcnJheS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNpZ0J5dGVzID0gd29yZEFycmF5LnNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIENvbnZlcnRcblx0ICAgICAgICAgICAgdmFyIGhleENoYXJzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2lnQnl0ZXM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJpdGUgPSAod29yZHNbaSA+Pj4gMl0gPj4+ICgyNCAtIChpICUgNCkgKiA4KSkgJiAweGZmO1xuXHQgICAgICAgICAgICAgICAgaGV4Q2hhcnMucHVzaCgoYml0ZSA+Pj4gNCkudG9TdHJpbmcoMTYpKTtcblx0ICAgICAgICAgICAgICAgIGhleENoYXJzLnB1c2goKGJpdGUgJiAweDBmKS50b1N0cmluZygxNikpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGhleENoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIGhleCBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IGhleFN0ciBUaGUgaGV4IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1dvcmRBcnJheX0gVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5lbmMuSGV4LnBhcnNlKGhleFN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChoZXhTdHIpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgdmFyIGhleFN0ckxlbmd0aCA9IGhleFN0ci5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBoZXhTdHJMZW5ndGg7IGkgKz0gMikge1xuXHQgICAgICAgICAgICAgICAgd29yZHNbaSA+Pj4gM10gfD0gcGFyc2VJbnQoaGV4U3RyLnN1YnN0cihpLCAyKSwgMTYpIDw8ICgyNCAtIChpICUgOCkgKiA0KTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBuZXcgV29yZEFycmF5LmluaXQod29yZHMsIGhleFN0ckxlbmd0aCAvIDIpO1xuXHQgICAgICAgIH1cblx0ICAgIH07XG5cblx0ICAgIC8qKlxuXHQgICAgICogTGF0aW4xIGVuY29kaW5nIHN0cmF0ZWd5LlxuXHQgICAgICovXG5cdCAgICB2YXIgTGF0aW4xID0gQ19lbmMuTGF0aW4xID0ge1xuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgd29yZCBhcnJheSB0byBhIExhdGluMSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgTGF0aW4xIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGxhdGluMVN0cmluZyA9IENyeXB0b0pTLmVuYy5MYXRpbjEuc3RyaW5naWZ5KHdvcmRBcnJheSk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgc3RyaW5naWZ5OiBmdW5jdGlvbiAod29yZEFycmF5KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSB3b3JkQXJyYXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBzaWdCeXRlcyA9IHdvcmRBcnJheS5zaWdCeXRlcztcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciBsYXRpbjFDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciBiaXRlID0gKHdvcmRzW2kgPj4+IDJdID4+PiAoMjQgLSAoaSAlIDQpICogOCkpICYgMHhmZjtcblx0ICAgICAgICAgICAgICAgIGxhdGluMUNoYXJzLnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShiaXRlKSk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gbGF0aW4xQ2hhcnMuam9pbignJyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgTGF0aW4xIHN0cmluZyB0byBhIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbGF0aW4xU3RyIFRoZSBMYXRpbjEgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5MYXRpbjEucGFyc2UobGF0aW4xU3RyaW5nKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBwYXJzZTogZnVuY3Rpb24gKGxhdGluMVN0cikge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgbGF0aW4xU3RyTGVuZ3RoID0gbGF0aW4xU3RyLmxlbmd0aDtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxhdGluMVN0ckxlbmd0aDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tpID4+PiAyXSB8PSAobGF0aW4xU3RyLmNoYXJDb2RlQXQoaSkgJiAweGZmKSA8PCAoMjQgLSAoaSAlIDQpICogOCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gbmV3IFdvcmRBcnJheS5pbml0KHdvcmRzLCBsYXRpbjFTdHJMZW5ndGgpO1xuXHQgICAgICAgIH1cblx0ICAgIH07XG5cblx0ICAgIC8qKlxuXHQgICAgICogVVRGLTggZW5jb2Rpbmcgc3RyYXRlZ3kuXG5cdCAgICAgKi9cblx0ICAgIHZhciBVdGY4ID0gQ19lbmMuVXRmOCA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBVVEYtOCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgVVRGLTggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgdXRmOFN0cmluZyA9IENyeXB0b0pTLmVuYy5VdGY4LnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICB0cnkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIGRlY29kZVVSSUNvbXBvbmVudChlc2NhcGUoTGF0aW4xLnN0cmluZ2lmeSh3b3JkQXJyYXkpKSk7XG5cdCAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcblx0ICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignTWFsZm9ybWVkIFVURi04IGRhdGEnKTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi04IHN0cmluZyB0byBhIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gdXRmOFN0ciBUaGUgVVRGLTggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGx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Ki9cblx0ICAgICAgICByZXNldDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBJbml0aWFsIHZhbHVlc1xuXHQgICAgICAgICAgICB0aGlzLl9kYXRhID0gbmV3IFdvcmRBcnJheS5pbml0KCk7XG5cdCAgICAgICAgICAgIHRoaXMuX25EYXRhQnl0ZXMgPSAwO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBBZGRzIG5ldyBkYXRhIHRvIHRoaXMgYmxvY2sgYWxnb3JpdGhtJ3MgYnVmZmVyLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl8c3RyaW5nfSBkYXRhIFRoZSBkYXRhIHRvIGFwcGVuZC4gU3RyaW5ncyBhcmUgY29udmVydGVkIHRvIGEgV29yZEFycmF5IHVzaW5nIFVURi04LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICBidWZmZXJlZEJsb2NrQWxnb3JpdGhtLl9hcHBlbmQoJ2RhdGEnKTtcblx0ICAgICAgICAgKiAgICAgYnVmZmVyZWRCbG9ja0FsZ29yaXRobS5fYXBwZW5kKHdvcmRBcnJheSk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgX2FwcGVuZDogZnVuY3Rpb24gKGRhdGEpIHtcblx0ICAgICAgICAgICAgLy8gQ29udmVydCBzdHJpbmcgdG8gV29yZEFycmF5LCBlbHNlIGFzc3VtZSBXb3JkQXJyYXkgYWxyZWFkeVxuXHQgICAgICAgICAgICBpZiAodHlwZW9mIGRhdGEgPT0gJ3N0cmluZycpIHtcblx0ICAgICAgICAgICAgICAgIGRhdGEgPSBVdGY4LnBhcnNlKGRhdGEpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQXBwZW5kXG5cdCAgICAgICAgICAgIHRoaXMuX2RhdGEuY29uY2F0KGR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Ttcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzaWdCeXRlczsgaSArPSAzKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgYnl0ZTEgPSAod29yZHNbaSA+Pj4gMl0gICAgICAgPj4+ICgyNCAtIChpICUgNCkgKiA4KSkgICAgICAgJiAweGZmO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJ5dGUyID0gKHdvcmRzWyhpICsgMSkgPj4+IDJdID4+PiAoMjQgLSAoKGkgKyAxKSAlIDQpICogOCkpICYgMHhmZjtcblx0ICAgICAgICAgICAgICAgIHZhciBieXRlMyA9ICh3b3Jkc1soaSArIDIpID4+PiAyXSA+Pj4gKDI0IC0gKChpICsgMikgJSA0KSAqIDgpKSAmIDB4ZmY7XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0cmlwbGV0ID0gKGJ5dGUxIDw8IDE2KSB8IChieXRlMiA8PCA4KSB8IGJ5dGUzO1xuXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgKGogPCA0KSAmJiAoaSArIGogKiAwLjc1IDwgc2lnQnl0ZXMpOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICBiYXNlNjRDaGFycy5wdXNoKG1hcC5jaGFyQXQoKHRyaXBsZXQgPj4+ICg2ICogKDMgLSBqKSkpICYgMHgzZikpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQWRkIHBhZGRpbmdcblx0ICAgICAgICAgICAgdmFyIHBhZGRpbmdDaGFyID0gbWFwLmNoYXJBdCg2NCk7XG5cdCAgICAgICAgICAgIGlmIChwYWRkaW5nQ2hhcikge1xuXHQgICAgICAgICAgICAgICAgd2hpbGUgKGJhc2U2NENoYXJzLmxlbmd0aCAlIDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICBiYXNlNjRDaGFycy5wdXNoKHBhZGRpbmdDaGFyKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBiYXNlNjRDaGFycy5qb2luKCcnKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSBCYXNlNjQgc3RyaW5nIHRvIGEgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBiYXNlNjRTdHIgVGhlIEJhc2U2NCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMuZW5jLkJhc2U2NC5wYXJzZShiYXNlNjRTdHJpbmcpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoYmFzZTY0U3RyKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgYmFzZTY0U3RyTGVuZ3RoID0gYmFzZTY0U3RyLmxlbmd0aDtcblx0ICAgICAgICAgICAgdmFyIG1hcCA9IHRoaXMuX21hcDtcblx0ICAgICAgICAgICAgdmFyIHJldmVyc2VNYXAgPSB0aGlzLl9yZXZlcnNlTWFwO1xuXG5cdCAgICAgICAgICAgIGlmICghcmV2ZXJzZU1hcCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHJldmVyc2VNYXAgPSB0aGlzLl9yZXZlcnNlTWFwID0gW107XG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBtYXAubGVuZ3RoOyBqKyspIHtcblx0ICAgICAgICAgICAg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QgICAgICAgICAgICB2YXIgdXRmMTZDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpICs9IDIpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBjb2RlUG9pbnQgPSAod29yZHNbaSA+Pj4gMl0gPj4+ICgxNiAtIChpICUgNCkgKiA4KSkgJiAweGZmZmY7XG5cdCAgICAgICAgICAgICAgICB1dGYxNkNoYXJzLnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShjb2RlUG9pbnQpKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiB1dGYxNkNoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi0xNiBCRSBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IHV0ZjE2U3RyIFRoZSBVVEYtMTYgQkUgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5VdGYxNi5wYXJzZSh1dGYxNlN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uICh1dGYxNlN0cikge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgdXRmMTZTdHJMZW5ndGggPSB1dGYxNlN0ci5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB1dGYxNlN0ckxlbmd0aDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tpID4+PiAxXSB8PSB1dGYxNlN0ci5jaGFyQ29kZUF0KGkpIDw8ICgxNiAtIChpICUgMikgKiAxNik7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gV29yZEFycmF5LmNyZWF0ZSh3b3JkcywgdXRmMTZTdHJMZW5ndGggKiAyKTtcblx0ICAgICAgICB9XG5cdCAgICB9O1xuXG5cdCAgICAvKipcblx0ICAgICAqIFVURi0xNiBMRSBlbmNvZGluZyBzdHJhdGVneS5cblx0ICAgICAqL1xuXHQgICAgQ19lbmMuVXRmMTZMRSA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBVVEYtMTYgTEUgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl9IHdvcmRBcnJheSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIFVURi0xNiBMRSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB1dGYxNlN0ciA9IENyeXB0b0pTLmVuYy5VdGYxNkxFLnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gd29yZEFycmF5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB3b3JkQXJyYXkuc2lnQnl0ZXM7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgdXRmMTZDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpICs9IDIpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBjb2RlUG9pbnQgPSBzd2FwRW5kaWFuKCh3b3Jkc1tpID4+PiAyXSA+Pj4gKDE2IC0gKGkgJSA0KSAqIDgpKSAmIDB4ZmZmZik7XG5cdCAgICAgICAgICAgICAgICB1dGYxNkNoYXJzLnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShjb2RlUG9pbnQpKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiB1dGYxNkNoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi0xNiBMRSBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IHV0ZjE2U3RyIFRoZSBVVEYtMTYgTEUgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5VdGYxNkxFLnBhcnNlKHV0ZjE2U3RyKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBwYXJzZT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dGhpcy5jZmcgPSB0aGlzLmNmZy5leHRlbmQoY2ZnKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogRGVyaXZlcyBhIGtleSBmcm9tIGEgcGFzc3dvcmQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHBhc3N3b3JkIFRoZSBwYXNzd29yZC5cblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHNhbHQgQSBzYWx0LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgZGVyaXZlZCBrZXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBrZXkgPSBrZGYuY29tcHV0ZShwYXNzd29yZCwgc2FsdCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY29tcHV0ZTogZnVuY3Rpb24gKHBhc3N3b3JkLCBzYWx0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBjZmcgPSB0aGlzLmNmZztcblxuXHQgICAgICAgICAgICAvLyBJbml0IGhhc2hlclxuXHQgICAgICAgICAgICB2YXIgaGFzaGVyID0gY2ZnLmhhc2hlci5jcmVhdGUoKTtcblxuXHQgICAgICAgICAgICAvLyBJbml0aWFsIHZhbHVlc1xuXHQgICAgICAgICAgICB2YXIgZGVyaXZlZEtleSA9IFdvcmRBcnJheS5jcmVhdGUoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGRlcml2ZWRLZXlXb3JkcyA9IGRlcml2ZWRLZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaXplID0gY2ZnLmtleVNpemU7XG5cdCAgICAgICAgICAgIHZhciBpdGVyYXRpb25zID0gY2ZnLml0ZXJhdGlvbnM7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5XG5cdCAgICAgICAgICAgIHdoaWxlIChkZXJpdmVkS2V5V29yZHMubGVuZ3RoIDwga2V5U2l6ZSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKGJsb2NrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgaGFzaGVyLnVwZGF0ZShibG9jayk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB2YXIgYmxvY2sgPSBoYXNoZXIudXBkYXRlKHBhc3N3b3JkKS5maW5hbGl6ZShzYWx0KTtcblx0ICAgICAgICAgICAgICAgIGhhc2hlci5yZXNldCgpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBJdGVyYXRpb25zXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IGl0ZXJhdGlvbnM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGJsb2NrID0gaGFzaGVyLmZpbmFsaXplKGJsb2NrKTtcblx0ICAgICAgICAgICAgICAgICAgICBoYXNoZXIucmVzZXQoKTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgZGVyaXZlZEtleS5jb25jYXQoYmxvY2spO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIGRlcml2ZWRLZXkuc2lnQnl0ZXMgPSBrZXlTaXplICogNDtcblxuXHQgICAgICAgICAgICByZXR1cm4gZGVyaXZlZEtleTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBEZXJpdmVzIGEga2V5IGZyb20gYSBwYXNzd29yZC5cblx0ICAgICAqXG5cdCAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHBhc3N3b3JkIFRoZSBwYXNzd29yZC5cblx0ICAgICAqIEBwYXJhbSB7V29yZEFycmF5fHN0cm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xuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGhleFN0cmluZyA9IENyeXB0b0pTLmZvcm1hdC5IZXguc3RyaW5naWZ5KGNpcGhlclBhcmFtcyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgc3RyaW5naWZ5OiBmdW5jdGlvbiAoY2lwaGVyUGFyYW1zKSB7XG5cdCAgICAgICAgICAgIHJldHVybiBjaXBoZXJQYXJhbXMuY2lwaGVydGV4dC50b1N0cmluZyhIZXgpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIGhleGFkZWNpbWFsbHkgZW5jb2RlZCBjaXBoZXJ0ZXh0IHN0cmluZyB0byBhIGNpcGhlciBwYXJhbXMgb2JqZWN0LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IGlucHV0IFRoZSBoZXhhZGVjaW1hbGx5IGVuY29kZWQgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7Q2lwaGVyUGFyYW1zfSBUaGUgY2lwaGVyIHBhcmFtcyBvYmplY3QuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBjaXBoZXJQYXJhbXMgPSBDcnlwdG9KUy5mb3JtYXQuSGV4LnBhcnNlKGhleFN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChpbnB1dCkge1xuXHQgICAgICAgICAgICB2YXIgY2lwaGVydGV4dCA9IEhleC5wYXJzZShpbnB1dCk7XG5cdCAgICAgICAgICAgIHJldHVybiBDaX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bmd0aCBrZXlzXG5cdCAgICAgICAgICAgIGlmIChrZXkuc2lnQnl0ZXMgPiBoYXNoZXJCbG9ja1NpemVCeXRlcykge1xuXHQgICAgICAgICAgICAgICAga2V5ID0gaGFzaGVyLmZpbmFsaXplKGtleSk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBDbGFtcCBleGNlc3MgYml0c1xuXHQgICAgICAgICAgICBrZXkuY2xhbXAoKTtcblxuXHQgICAgICAgICAgICAvLyBDbG9uZSBrZXkgZm9yIGlubmVyIGFuZCBvdXRlciBwYWRzXG5cdCAgICAgICAgICAgIHZhciBvS2V5ID0gdGhpcy5fb0tleSA9IGtleS5jbG9uZSgpO1xuXHQgICAgICAgICAgICB2YXIgaUtleSA9IHRoaXMuX2lLZXkgPSBrZXkuY2xvbmUoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIG9LZXlXb3JkcyA9IG9LZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBpS2V5V29yZHMgPSBpS2V5LndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFhPUiBrZXlzIHdpdGggcGFkIGNvbnN0YW50c1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGhhc2hlckJsb2NrU2l6ZTsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBvS2V5V29yZHNbaV0gXj0gMHg1YzVjNWM1Yztcblx0ICAgICAgICAgICAgICAgIGlLZXlXb3Jkc1tpXSBePSAweDM2MzYzNjM2O1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIG9LZXkuc2lnQnl0ZXMgPSBpS2V5LnNpZ0J5dGVzID0gaGFzaGVyQmxvY2tTaXplQnl0ZXM7XG5cblx0ICAgICAgICAgICAgLy8gU2V0IGluaXRpYWwgdmFsdWVzXG5cdCAgICAgICAgICAgIHRoaXMucmVzZXQoKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogUmVzZXRzIHRoaXMgSE1BQyB0byBpdHMgaW5pdGlhbCBzdGF0ZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgaG1hY0hhc2hlci5yZXNldCgpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHJlc2V0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBoYXNoZXIgPSB0aGlzLl9oYXNoZXI7XG5cblx0ICAgICAgICAgICAgLy8gUmVzZXRcblx0ICAgICAgICAgICAgaGFzaGVyLnJlc2V0KCk7XG5cdCAgICAgICAgICAgIGhhc2hlci51cGRhdGUodGhpcy5faUtleSk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIFVwZGF0ZXMgdGhpcyBITUFDIHdpdGggYSBtZXNzYWdlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl8c3RyaW5nfSBtZXNzYWdlVXBkYXRlIFRoZSBtZXNzYWdlIHRvIGFwcGVuZC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge0hNQUN9IFRoaXMgSE1BQyBpbnN0YW5jZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgaG1hY0hhc2hlci51cGRhdGUoJ21lc3NhZ2UnKTtcblx0ICAgICAgICAgKiAgICAgaG1hY0hhc2hlci51cGRhdGUod29yZEFycmF5KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICB1cGRhdGU6IGZ1bmN0aW9uIChtZXNzYWdlVXBkYXRlKSB7XG5cdCAgICAgICAgICAgIHRoaXMuX2hhc2hlci51cGRhdGUobWVzc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TtcblxuXHQgICAgICAgICAgICAgICAgTVtvZmZzZXRfaV0gPSAoXG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTV9vZmZzZXRfaSA8PCA4KSAgfCAoTV9vZmZzZXRfaSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAoKChNX29mZnNldF9pIDw8IDI0KSB8IChNX29mZnNldF9pID4+PiA4KSkgICYgMHhmZjAwZmYwMClcblx0ICAgICAgICAgICAgICAgICk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIEggPSB0aGlzLl9oYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8wICA9IE1bb2Zmc2V0ICsgMF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xICA9IE1bb2Zmc2V0ICsgMV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8yICA9IE1bb2Zmc2V0ICsgMl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8zICA9IE1bb2Zmc2V0ICsgM107XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF80ICA9IE1bb2Zmc2V0ICsgNF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF81ICA9IE1bb2Zmc2V0ICsgNV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF82ICA9IE1bb2Zmc2V0ICsgNl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF83ICA9IE1bb2Zmc2V0ICsgN107XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF84ICA9IE1bb2Zmc2V0ICsgOF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF85ICA9IE1bb2Zmc2V0ICsgOV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xMCA9IE1bb2Zmc2V0ICsgMTBdO1xuXHQgICAgICAgICAgICB2YXIgT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IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAoKChuQml0c1RvdGFsSCA8PCAyNCkgfCAobkJpdHNUb3RhbEggPj4+IDgpKSAgJiAweGZmMDBmZjAwKVxuXHQgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICBkYXRhV29yZHNbKCgobkJpdHNMZWZ0ICsgNjQpID4+PiA5KSA8PCA0KSArIDE0XSA9IChcblx0ICAgICAgICAgICAgICAgICgoKG5CaXRzVG90YWxMIDw8IDgpICB8IChuQml0c1RvdGFsTCA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICgoKG5CaXRzVG90YWxMIDw8IDI0KSB8IChuQml0c1RvdGFsTCA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICk7XG5cblx0ICAgICAgICAgICAgZGF0YS5zaWdCeXRlcyA9IChkYXRhV29yZHMubGVuZ3RoICsgMSkgKiA0O1xuXG5cdCAgICAgICAgICAgIC8vIEhhc2ggZmluYWwgYmxvY2tzXG5cdCAgICAgICAgICAgIHRoaXMuX3Byb2Nlc3MoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGhhc2ggPSB0aGlzLl9oYXNoO1xuXHQgICAgICAgICAgICB2YXIgSCA9IGhhc2gud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gU3dhcCBlbmRpYW5cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICB2YXIgSF9pID0gSFtpXTtcblxuXHQgICAgICAgICAgICAgICAgSFtpXSA9ICgoKEhfaSA8PCA4KSAgfCAoSF9pID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICAgICgoKEhfaSA8PCAyNCkgfCAoSF9pID4+PiA4KSkgICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBSZXR1cm4gZmluYWwgY29tcHV0ZWQgaGFzaFxuXHQgICAgICAgICAgICByZXR1cm4gaGFzaDtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIGNsb25lID0gSGFzaGVyLmNsb25lLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIGNsb25lLl9oYXNoID0gdGhpcy5faGFzaC5jbG9uZSgpO1xuXG5cdCAgICAgICAgICAgIHJldHVybiBjbG9uZTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgZnVuY3Rpb24gRkYoYSwgYiwgYywgZCwgeCwgcywgdCkge1xuXHQgICAgICAgIHZhciBuID0gYSArICgoYiAmIGMpIHwgKH5iICYgZCkpICsgeCArIHQ7XG5cdCAgICAgICAgcmV0dXJuICgobiA8PCBzKSB8IChuID4+PiAoMzIgLSBzKSkpICsgYjtcblx0ICAgIH1cblxuXHQgICAgZnVuY3Rpb24gR0coYSwgYiwgYywgZCwgeCwgcywgdCkge1xuXHQgICAgICAgIHZhciBuID0gYSArICgoYiAmIGQpIHwgKGMgJiB+ZCkpICsgeCArIHQ7XG5cdCAgICAgICAgcmV0dXJuICgobiA8PCBzKSB8IChuID4+PiAoMzIgLSBzKSkpICsgYjtcblx0ICAgIH1cblxuXHQgICAgZnVuY3Rpb24gSEgoYSwgYiwgYywgZCwgeCwgcywgdCkge1xuXHQgICAgICAgIHZhciBuID0gYSArIChiIF4gYyBeIGQpICsgeCArIHQ7XG5cdCAgICAgICAgcmV0dXJuICgobiA8PCBzKSB8IChuID4+PiAoMzIgLSBzKSkpICsgYjtcblx0ICAgIH1cblxuXHQgICAgZnVuY3Rpb24gSUkoYSwgYiwgYywgZCwgeCwgcywgdCkge1xuXHQgICAgICAg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3J5cHRvciA9IENUUi5leHRlbmQoe1xuXHQgICAgICAgIHByb2Nlc3NCbG9jazogZnVuY3Rpb24gKHdvcmRzLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciBjaXBoZXIgPSB0aGlzLl9jaXBoZXJcblx0ICAgICAgICAgICAgdmFyIGJsb2NrU2l6ZSA9IGNpcGhlci5ibG9ja1NpemU7XG5cdCAgICAgICAgICAgIHZhciBpdiA9IHRoaXMuX2l2O1xuXHQgICAgICAgICAgICB2YXIgY291bnRlciA9IHRoaXMuX2NvdW50ZXI7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5c3RyZWFtXG5cdCAgICAgICAgICAgIGlmIChpdikge1xuXHQgICAgICAgICAgICAgICAgY291bnRlciA9IHRoaXMuX2NvdW50ZXIgPSBpdi5zbGljZSgwKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVtb3ZlIElWIGZvciBzdWJzZXF1ZW50IGJsb2Nrc1xuXHQgICAgICAgICAgICAgICAgdGhpcy5faXYgPSB1bmRlZmluZWQ7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgdmFyIGtleXN0cmVhbSA9IGNvdW50ZXIuc2xpY2UoMCk7XG5cdCAgICAgICAgICAgIGNpcGhlci5lbmNyeXB0QmxvY2soa2V5c3RyZWFtLCAwKTtcblxuXHQgICAgICAgICAgICAvLyBJbmNyZW1lbnQgY291bnRlclxuXHQgICAgICAgICAgICBjb3VudGVyW2Jsb2NrU2l6ZSAtIDFdID0gKGNvdW50ZXJbYmxvY2tTaXplIC0gMV0gKyAxKSB8IDBcblxuXHQgICAgICAgICAgICAvLyBFbmNyeXB0XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYmxvY2tTaXplOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHdvcmRzW29mZnNldCArIGldIF49IGtleXN0cmVhbVtpXTtcbl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Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGVyaXZlZEtleVdvcmRzID0gZGVyaXZlZEtleS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGJsb2NrSW5kZXhXb3JkcyA9IGJsb2NrSW5kZXgud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaXplID0gY2ZnLmtleVNpemU7XG5cdCAgICAgICAgICAgIHZhciBpdGVyYXRpb25zID0gY2ZnLml0ZXJhdGlvbnM7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5XG5cdCAgICAgICAgICAgIHdoaWxlIChkZXJpdmVkS2V5V29yZHMubGVuZ3RoIDwga2V5U2l6ZSkge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gaG1hYy51cGRhdGUoc2FsdCkuZmluYWxpemUoYmxvY2tJbmRleCk7XG5cdCAgICAgICAgICAgICAgICBobWFjLnJlc2V0KCk7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrV29yZHMgPSBibG9jay53b3Jkcztcblx0ICAgICAgICAgICAgICAgIHZhciBibG9ja1dvcmRzTGVuZ3RoID0gYmxvY2tXb3Jkcy5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgICAgIC8vIEl0ZXJhdGlvbnNcblx0ICAgICAgICAgICAgICAgIHZhciBpbnRlcm1lZGlhdGUgPSBibG9jaztcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAxOyBpIDwgaXRlcmF0aW9uczsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgaW50ZXJtZWRpYXRlID0gaG1hYy5maW5hbGl6ZShpbnRlcm1lZGlhdGUpO1xuXHQgICAgICAgICAgICAgICAgICAgIGhtYWMucmVzZXQoKTtcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGludGVybWVkaWF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A+Pj4gMTYpLCAoS1szXSAmIDB4ZmZmZjAwMDApIHwgKEtbMF0gJiAweDAwMDBmZmZmKVxuXHQgICAgICAgICAgICBdO1xuXG5cdCAgICAgICAgICAgIC8vIENhcnJ5IGJpdFxuXHQgICAgICAgICAgICB0aGlzLl9iID0gMDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW0gZm91ciB0aW1lc1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDQ7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBNb2RpZnkgdGhlIGNvdW50ZXJzXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBDW2ldIF49IFhbKGkgKyA0KSAmIDddO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSVYgc2V0dXBcblx0ICAgICAgICAgICAgaWYgKGl2KSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBJViA9IGl2LndvcmRzO1xuXHQgICAgICAgICAgICAgICAgdmFyIElWXzAgPSBJVlswXTtcblx0ICAgICAgICAgICAgICAgIHZhciBJVl8xID0gSVZbMV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIEdlbmVyYXRlIGZvdXIgc3VidmVjdG9yc1xuXHQgICAgICAgICAgICAgICAgdmFyIGkwID0gKCgoSVZfMCA8PCA4KSB8IChJVl8wID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfCAoKChJVl8wIDw8IDI0KSB8IChJVl8wID4+PiA4KSkgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMiA9ICgoKElWXzEgPDwgOCkgfCAoSVZfMSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHwgKCgoSVZfMSA8PCAyNCkgfCAoSVZfMSA+Pj4gOCkpICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTEgPSAoaTAgPj4+IDE2KSB8IChpMiAmIDB4ZmZmZjAwMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkzID0gKGkyIDw8IDE2KSAgfCAoaTAgJiAweDAwMDBmZmZmKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gTW9kaWZ5IGNvdW50ZXIgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICBDWzBdIF49IGkwO1xuXHQgICAgICAgICAgICAgICAgQ1sxXSBePSBpMTtcblx0ICAgICAgICAgICAgICAgIENbMl0gXj0gaTI7XG5cdCAgICAgICAgICAgICAgICBDWzNdIF49IGkzO1xuXHQgICAgICAgICAgICAgICAgQ1s0XSBePSBpMDtcblx0ICAgICAgICAgICAgICAgIENbNV0gXj0gaTE7XG5cdCAgICAgICAgICAgICAgICBDWzZdIF49IGkyO1xuXHQgICAgICAgICAgICAgICAgQ1s3XSBePSBpMztcblxuXHQgICAgICAgICAgICAgICAgLy8gSXRlcmF0ZSB0aGUgc3lzdGVtIGZvdXIgdGltZXNcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBYID0gdGhpcy5fWDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW1cblx0ICAgICAgICAgICAgbmV4dFN0YXRlLm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G5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUgaW5pdGlhbCBjb3VudGVyIHZhbHVlc1xuXHQgICAgICAgICAgICB2YXIgQyA9IHRoaXMuX0MgPSBbXG5cdCAgICAgICAgICAgICAgICAoS1syXSA8PCAxNikgfCAoS1syXSA+Pj4gMTYpLCAoS1swXSAmIDB4ZmZmZjAwMDApIHwgKEtbMV0gJiAweDAwMDBmZmZmKSxcblx0ICAgICAgICAgICAgICAgIChLWzNdIDw8IDE2KSB8IChLWzNdID4+PiAxNiksIChLWzFdICYgMHhmZmZmMDAwMCkgfCAoS1syXSAmIDB4MDAwMGZmZmYpLFxuXHQgICAgICAgICAgICAgICAgKEtbMF0gPDwgMTYpIHwgKEtbMF0gPj4+IDE2KSwgKEtbMl0gJiAweGZmZmYwMDAwKSB8IChLWzNdICYgMHgwMDAwZmZmZiksXG5cdCAgICAgICAgICAgICAgICAoS1sxXSA8PCAxNikgfCAoS1sxXSA+Pj4gMTYpLCAoS1szXSAmIDB4ZmZmZjAwMDApIHwgKEtbMF0gJiAweDAwMDBmZmZmKVxuXHQgICAgICAgICAgICBdO1xuXG5cdCAgICAgICAgICAgIC8vIENhcnJ5IGJpdFxuXHQgICAgICAgICAgICB0aGlzLl9iID0gMDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW0gZm91ciB0aW1lc1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDQ7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBNb2RpZnkgdGhlIGNvdW50ZXJzXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBDW2ldIF49IFhbKGkgKyA0KSAmIDddO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSVYgc2V0dXBcblx0ICAgICAgICAgICAgaWYgKGl2KSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBJViA9IGl2LndvcmRzO1xuXHQgICAgICAgICAgICAgICAgdmFyIElWXzAgPSBJVlswXTtcblx0ICAgICAgICAgICAgICAgIHZhciBJVl8xID0gSVZbMV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIEdlbmVyYXRlIGZvdXIgc3VidmVjdG9yc1xuXHQgICAgICAgICAgICAgICAgdmFyIGkwID0gKCgoSVZfMCA8PCA4KSB8IChJVl8wID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfCAoKChJVl8wIDw8IDI0KSB8IChJVl8wID4+PiA4KSkgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMiA9ICgoKElWXzEgPDwgOCkgfCAoSVZfMSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHwgKCgoSVZfMSA8PCAyNCkgfCAoSVZfMSA+Pj4gOCkpICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTEgPSAoaTAgPj4+IDE2KSB8IChpMiAmIDB4ZmZmZjAwMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkzID0gKGkyIDw8IDE2KSAgfCAoaTAgJiAweDAwMDBmZmZmKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gTW9kaWZ5IGNvdW50ZXIgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICBDWzBdIF49IGkwO1xuXHQgICAgICAgICAgICAgICAgQ1sxXSBePSBpMTtcblx0ICAgICAgICAgICAgICAgIENbMl0gXj0gaTI7XG5cdCAgICAgICAgICAgICAgICBDWzNdIF49IGkzO1xuXHQgICAgICAgICAgICAgICAgQ1s0XSBePSBpMDtcblx0ICAgICAgICAgICAgICAgIENbNV0gXj0gaTE7XG5cdCAgICAgICAgICAgICAgICBDWzZdIF49IGkyO1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FRkNEQUI4OSwgMHg5OEJBRENGRSwgMHgxMDMyNTQ3NiwgMHhDM0QyRTFGMF0pO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9Qcm9jZXNzQmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblxuXHQgICAgICAgICAgICAvLyBTd2FwIGVuZGlhblxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDE2OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIG9mZnNldF9pID0gb2Zmc2V0ICsgaTtcblx0ICAgICAgICAgICAgICAgIHZhciBNX29mZnNldF9pID0gTVtvZmZzZXRfaV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXBcblx0ICAgICAgICAgICAgICAgIE1bb2Zmc2V0X2ldID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE1fb2Zmc2V0X2kgPDwgOCkgIHwgKE1fb2Zmc2V0X2kgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTV9vZmZzZXRfaSA8PCAyNCkgfCAoTV9vZmZzZXRfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBIICA9IHRoaXMuX2hhc2gud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBobCA9IF9obC53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGhyID0gX2hyLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgemwgPSBfemwud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB6ciA9IF96ci53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNsID0gX3NsLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc3IgPSBfc3Iud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gV29ya2luZyB2YXJpYWJsZXNcblx0ICAgICAgICAgICAgdmFyIGFsLCBibCwgY2wsIGRsLCBlbDtcblx0ICAgICAgICAgICAgdmFyIGFyLCBiciwgY3IsIGRyLCBlcjtcblxuXHQgICAgICAgICAgICBhciA9IGFsID0gSFswXTtcblx0ICAgICAgICAgICAgYnIgPSBibCA9IEhbMV07XG5cdCAgICAgICAgICAgIGNyID0gY2wgPSBIWzJdO1xuXHQgICAgICAgICAgICBkciA9IGRsID0gSFszXTtcblx0ICAgICAgICAgICAgZXIgPSBlbCA9IEhbNF07XG5cdCAgICAgICAgICAgIC8vIENvbXB1dGF0aW9uXG5cdCAgICAgICAgICAgIHZhciB0O1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDgwOyBpICs9IDEpIHtcblx0ICAgICAgICAgICAgICAgIHQgPSAoYWwgKyAgTVtvZmZzZXQremxbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJsLGNsLGRsKSArIGhsWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjIoYmwsY2wsZGwpICsgaGxbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhibCxjbCxkbCkgKyBobFsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY0KGJsLGNsLGRsKSArIGhsWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJsLGNsLGRsKSArIGhsWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNsW2ldKTtcblx0ICAgICAgICAgICAgICAgIHQgPSAodCtlbCl8MDtcblx0ICAgICAgICAgICAgICAgIGFsID0gZWw7XG5cdCAgICAgICAgICAgICAgICBlbCA9IGRsO1xuXHQgICAgICAgICAgICAgICAgZGwgPSByb3RsKGNsLCAxMCk7XG5cdCAgICAgICAgICAgICAgICBjbCA9IGJsO1xuXHQgICAgICAgICAgICAgICAgYmwgPSB0O1xuXG5cdCAgICAgICAgICAgICAgICB0ID0gKGFyICsgTVtvZmZzZXQrenJbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJyLGNyLGRyKSArIGhyWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjQoYnIsY3IsZHIpICsgaHJbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhicixjcixkcikgKyBoclsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYyKGJyLGNyLGRyKSArIGhyWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJyLGNyLGRyKSArIGhyWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNyW2ldKSA7XG5cdCAgICAgICAgICAgICAgICB0ID0gKHQrZXIpfDA7XG5cdCAgICAgICAgICAgICAgICBhciA9IGVyO1xuXHQgICAgICAgICAgICAgICAgZXIgPSBkcjtcblx0ICAgICAgICAgICAgICAgIGRyID0gcm90bChjciwgMTApO1xuXHQgICAgICAgICAgICAgICAgY3IgPSBicjtcblx0ICAgICAgICAgICAgICAgIGJyID0gdDtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZGlhdGUgaGFzaCB2YWx1ZVxuXHQgICAgICAgICAgICB0ICAgID0gKEhbMV0gKyBjbCArIGRyKXwwO1xuXHQgICAgICAgICAgICBIWzFdID0gKEhbMl0gKyBkbCArIGVyKXwwO1xuXHQgICAgICAgICAgICBIWzJdID0gKEhbM10gKyBlbCArIGFyKXwwO1xuXHQgICAgICAgICAgICBIWzNdID0gKEhbNF0gKyBhbCArIGJyKXwwO1xuXHQgICAgICAgICAgICBIWzRdID0gKEhbMF0gKyBibCArIGNyKXwwO1xuXHQgICAgICAgICAgICBIWzBdID0gIHQ7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb0ZpbmFsaXplOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGF0YSA9IHRoaXMuX2RhdGE7XG5cdCAgICAgICAgICAgIHZhciBkYXRhV29yZHMgPSBkYXRhLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBuQml0c1RvdGFsID0gdGhpcy5fbkRhdGFCeXRlcyAqIDg7XG5cdCAgICAgICAgICAgIHZhciBuQml0c0xlZnQgPSBkYXRhLnNpZ0J5dGVzICogODtcblxuXHQgICAgICAgICAgICAvLyBBZGQgcGFkZGluZ1xuXHQgICAgICAgICAgICBkYXRhV29yZHNbbkJpdHNMZWZ0ID4+PiA1XSB8PSAweDgwIDw8ICgyNCAtIG5CaXRzTGVmdCAlIDMyKTtcblx0ICAgICAgICAgICAgZGF0YVdvcmRzWygoKG5CaXRzTGVmdCArIDY0KSA+Pj4gOSkgPDwgNCkgKyAxNF0gPSAoXG5cdCAgICAgICAgICAgICAgICAoKChuQml0c1RvdGFsIDw8IDgpICB8IChuQml0c1RvdGFsID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgKCgobkJpdHNUb3RhbCA8PCAyNCkgfCAobkJpdHNUb3RhbCA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICk7XG5cdCAgICAgICAgICAgIGRhdGEuc2lnQnl0ZXMgPSAoZGF0YVdvcmRzLmxlbmd0aCArIDEpICogNDtcblxuXHQgICAgICAgICAgICAvLyBIYXNoIGZpbmFsIGJsb2Nrc1xuXHQgICAgICAgICAgICB0aGlzLl9wcm9jZXNzKCk7XG5cblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciBoYXNoID0gdGhpcy5faGFzaDtcblx0ICAgICAgICAgICAgdmFyIEggPSBoYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNTsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgdmFyIEhfaSA9IEhbaV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXBcblx0ICAgICAgICAgICAgICAgIEhbaV0gPSAoKChIX2kgPDwgOCkgIHwgKEhfaSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAgICAoKChIX2kgPDwgMjQpIHwgKEhfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUmV0dXJuIGZpbmFsIGNvbXB1dGVkIGhhc2hcblx0ICAgICAgICAgICAgcmV0dXJuIGhhc2g7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIGNsb25lOiBmdW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AgICAgIDB4OThiYWRjZmUsIDB4MTAzMjU0NzYsXG5cdCAgICAgICAgICAgICAgICAweGMzZDJlMWYwXG5cdCAgICAgICAgICAgIF0pO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9Qcm9jZXNzQmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgdmFyIEggPSB0aGlzLl9oYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFdvcmtpbmcgdmFyaWFibGVzXG5cdCAgICAgICAgICAgIHZhciBhID0gSFswXTtcblx0ICAgICAgICAgICAgdmFyIGIgPSBIWzFdO1xuXHQgICAgICAgICAgICB2YXIgYyA9IEhbMl07XG5cdCAgICAgICAgICAgIHZhciBkID0gSFszXTtcblx0ICAgICAgICAgICAgdmFyIGUgPSBIWzRdO1xuXG5cdCAgICAgICAgICAgIC8vIENvbXB1dGF0aW9uXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODA7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKGkgPCAxNikge1xuXHQgICAgICAgICAgICAgICAgICAgIFdbaV0gPSBNW29mZnNldCArIGldIHwgMDtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIG4gPSBXW2kgLSAzXSBeIFdbaSAtIDhdIF4gV1tpIC0gMTRdIF4gV1tpIC0gMTZdO1xuXHQgICAgICAgICAgICAgICAgICAgIFdbaV0gPSAobiA8PCAxKSB8IChuID4+PiAzMSk7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0ID0gKChhIDw8IDUpIHwgKGEgPj4+IDI3KSkgKyBlICsgV1tpXTtcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMjApIHtcblx0ICAgICAgICAgICAgICAgICAgICB0ICs9ICgoYiAmIGMpIHwgKH5iICYgZCkpICsgMHg1YTgyNzk5OTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaSA8IDQwKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdCArPSAoYiBeIGMgXiBkKSArIDB4NmVkOWViYTE7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGkgPCA2MCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHQgKz0gKChiICYgYykgfCAoYiAmIGQpIHwgKGMgJiBkKSkgLSAweDcwZTQ0MzI0O1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIC8qIGlmIChpIDwgODApICovIHtcblx0ICAgICAgICAgICAgICAgICAgICB0ICs9IChiIF4gYyBeIGQpIC0gMHgzNTlkM2UyYTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgZSA9IGQ7XG5cdCAgICAgICAgICAgICAgICBkID0gYztcblx0ICAgICAgICAgICAgICAgIGMgPSAoYiA8PCAzMCkgfCAoYiA+Pj4gMik7XG5cdCAgICAgICAgICAgICAgICBiID0gYTtcblx0ICAgICAgICAgICAgICAgIGEgPSB0O1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSW50ZXJtZWRpYXRlIGhhc2ggdmFsdWVcblx0ICAgICAgICAgICAgSFswXSA9IChIWzBdICsgYSkgfCAwO1xuXHQgICAgICAgICAgICBIWzFdID0gKEhbMV0gKyBiKSB8IDA7XG5cdCAgICAgICAgICAgIEhbMl0gPSAoSFsyXSArIGMpIHwgMDtcblx0ICAgICAgICAgICAgSFszXSA9IChIWzNdICsgZCkgfCAwO1xuXHQgICAgICAgICAgICBIWzRdID0gKEhbNF0gKyBlKSB8IDA7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb0ZpbmFsaXplOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGF0YS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AgICAgICAgfVxuXG5cdCAgICAgICAgdmFyIG4gPSAyO1xuXHQgICAgICAgIHZhciBuUHJpbWUgPSAwO1xuXHQgICAgICAgIHdoaWxlIChuUHJpbWUgPCA2NCkge1xuXHQgICAgICAgICAgICBpZiAoaXNQcmltZShuKSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKG5QcmltZSA8IDgpIHtcblx0ICAgICAgICAgICAgICAgICAgICBIW25QcmltZV0gPSBnZXRGcmFjdGlvbmFsQml0cyhNYXRoLnBvdyhuLCAxIC8gMikpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgS1tuUHJpbWVdID0gZ2V0RnJhY3Rpb25hbEJpdHMoTWF0aC5wb3cobiwgMSAvIDMpKTtcblxuXHQgICAgICAgICAgICAgICAgblByaW1lKys7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICBuKys7XG5cdCAgICAgICAgfVxuXHQgICAgfSgpKTtcblxuXHQgICAgLy8gUmV1c2FibGUgb2JqZWN0XG5cdCAgICB2YXIgVyA9IFtdO1xuXG5cdCAgICAvKipcblx0ICAgICAqIFNIQS0yNTYgaGFzaCBhbGdvcml0aG0uXG5cdCAgICAgKi9cblx0ICAgIHZhciBTSEEyNTYgPSBDX2FsZ28uU0hBMjU2ID0gSGFzaGVyLmV4dGVuZCh7XG5cdCAgICAgICAgX2RvUmVzZXQ6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdGhpcy5faGFzaCA9IG5ldyBXb3JkQXJyYXkuaW5pdChILnNsaWNlKDApKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBIID0gdGhpcy5faGFzaC53b3JkcztcblxuXHQgICAgICAgICAgICAvLyBXb3JraW5nIHZhcmlhYmxlc1xuXHQgICAgICAgICAgICB2YXIgYSA9IEhbMF07XG5cdCAgICAgICAgICAgIHZhciBiID0gSFsxXTtcblx0ICAgICAgICAgICAgdmFyIGMgPSBIWzJdO1xuXHQgICAgICAgICAgICB2YXIgZCA9IEhbM107XG5cdCAgICAgICAgICAgIHZhciBlID0gSFs0XTtcblx0ICAgICAgICAgICAgdmFyIGYgPSBIWzVdO1xuXHQgICAgICAgICAgICB2YXIgZyA9IEhbNl07XG5cdCAgICAgICAgICAgIHZhciBoID0gSFs3XTtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRhdGlvblxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDY0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMTYpIHtcblx0ICAgICAgICAgICAgICAgICAgICBXW2ldID0gTVtvZmZzZXQgKyBpXSB8IDA7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTB4ID0gV1tpIC0gMTVdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTAgID0gKChnYW1tYTB4IDw8IDI1KSB8IChnYW1tYTB4ID4+PiA3KSkgIF5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZ2FtbWEweCA8PCAxNCkgfCAoZ2FtbWEweCA+Pj4gMTgpKSBeXG5cdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdhbW1hMHggPj4+IDMpO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMXggPSBXW2kgLSAyXTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExICA9ICgoZ2FtbWExeCA8PCAxNSkgfCAoZ2FtbWExeCA+Pj4gMTcpKSBeXG5cdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGdhbW1hMXggPDwgMTMpIHwgKGdhbW1hMXggPj4+IDE5KSkgXlxuXHQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChnYW1tYTF4ID4+PiAxMCk7XG5cblx0ICAgICAgICAgICAgICAgICAgICBXW2ldID0gZ2FtbWEwICsgV1tpIC0gN10gKyBnYW1tYTEgKyBXW2kgLSAxNl07XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIHZhciBjaCAgPSAoZSAmIGYpIF4gKH5lICYgZyk7XG5cdCAgICAgICAgICAgICAgICB2YXIgbWFqID0gKGEgJiBiKSBeIChhICYgYykgXiAoYiAmIGMpO1xuXG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWEwID0gKChhIDw8IDMwKSB8IChhID4+PiAyKSkgXiAoKGEgPDwgMTkpIHwgKGEgPj4+IDEzKSkgXiAoKGEgPDwgMTApIHwgKGEgPj4+IDIyKSk7XG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWExID0gKChlIDw8IDI2KSB8IChlID4+PiA2KSkgXiAoKGUgPDwgMjEpIHwgKGUgPj4+IDExKSkgXiAoKGUgPDwgNykgIHwgKGUgPj4+IDI1KSk7XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0MSA9IGggKyBzaWdtYTEgKyBjaCArIEtbaV0gKyBXW2ldO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQyID0gc2lnbWEwICsgbWFqO1xuXG5cdCAgICAgICAgICAgICAgICBoID0gZztcblx0ICAgICAgICAgICAgICAgIGcgPSBmO1xuXHQgICAgICAgICAgICAgICAgZiA9IGU7XG5cdCAgICAgICAgICAgICAgICBlID0gKGQgKyB0MSkgfCAwO1xuXHQgICAgICAgICAgICAgICAgZCA9IGM7XG5cdCAgICAgICAgICAgICAgICBjID0gYjtcblx0ICAgICAgICAgICAgICAgIGIgPSBhO1xuXHQgICAgICAgICAgICAgICAgYSA9ICh0MSArIHQyKSB8IDA7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZ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ArIDMgKiB5KSAlIDU7XG5cdCAgICAgICAgICAgIHggPSBuZXdYO1xuXHQgICAgICAgICAgICB5ID0gbmV3WTtcblx0ICAgICAgICB9XG5cblx0ICAgICAgICAvLyBDb21wdXRlIHBpIGluZGV4IGNvbnN0YW50c1xuXHQgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgNTsgeSsrKSB7XG5cdCAgICAgICAgICAgICAgICBQSV9JTkRFWEVTW3ggKyA1ICogeV0gPSB5ICsgKCgyICogeCArIDMgKiB5KSAlIDUpICogNTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblxuXHQgICAgICAgIC8vIENvbXB1dGUgcm91bmQgY29uc3RhbnRzXG5cdCAgICAgICAgdmFyIExGU1IgPSAweDAxO1xuXHQgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjQ7IGkrKykge1xuXHQgICAgICAgICAgICB2YXIgcm91bmRDb25zdGFudE1zdyA9IDA7XG5cdCAgICAgICAgICAgIHZhciByb3VuZENvbnN0YW50THN3ID0gMDtcblxuXHQgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IDc7IGorKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKExGU1IgJiAweDAxKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGJpdFBvc2l0aW9uID0gKDEgPDwgaikgLSAxO1xuXHQgICAgICAgICAgICAgICAgICAgIGlmIChiaXRQb3NpdGlvbiA8IDMyKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHJvdW5kQ29uc3RhbnRMc3cgXj0gMSA8PCBiaXRQb3NpdGlvbjtcblx0ICAgICAgICAgICAgICAgICAgICB9IGVsc2UgLyogaWYgKGJpdFBvc2l0aW9uID49IDMyKSAqLyB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHJvdW5kQ29uc3RhbnRNc3cgXj0gMSA8PCAoYml0UG9zaXRpb24gLSAzMik7XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAvLyBDb21wdXRlIG5leHQgTEZTUlxuXHQgICAgICAgICAgICAgICAgaWYgKExGU1IgJiAweDgwKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gUHJpbWl0aXZlIHBvbHlub21pYWwgb3ZlciBHRigyKTogeF44ICsgeF42ICsgeF41ICsgeF40ICsgMVxuXHQgICAgICAgICAgICAgICAgICAgIExGU1IgPSAoTEZTUiA8PCAxKSBeIDB4NzE7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgICAgIExGU1IgPDw9IDE7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICBST1VORF9DT05TVEFOVFNbaV0gPSBYNjRXb3JkLmNyZWF0ZShyb3VuZENvbnN0YW50TXN3LCByb3VuZENvbnN0YW50THN3KTtcblx0ICAgICAgICB9XG5cdCAgICB9KCkpO1xuXG5cdCAgICAvLyBSZXVzYWJsZSBvYmplY3RzIGZvciB0ZW1wb3JhcnkgdmFsdWVzXG5cdCAgICB2YXIgVCA9IFtdO1xuXHQgICAgKGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI1OyBpKyspIHtcblx0ICAgICAgICAgICAgVFtpXSA9IFg2NFdvcmQuY3JlYXRlKCk7XG5cdCAgICAgICAgfVxuXHQgICAgfSgpKTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBTSEEtMyBoYXNoIGFsZ29yaXRobS5cblx0ICAgICAqL1xuXHQgICAgdmFyIFNIQTMgPSBDX2FsZ28uU0hBMyA9IEhhc2hlci5leHRlbmQoe1xuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbmZpZ3VyYXRpb24gb3B0aW9ucy5cblx0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kJsb2NrU2l6ZUxhbmVzOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIE0yaSAgPSBNW29mZnNldCArIDIgKiBpXTtcblx0ICAgICAgICAgICAgICAgIHZhciBNMmkxID0gTVtvZmZzZXQgKyAyICogaSArIDFdO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwIGVuZGlhblxuXHQgICAgICAgICAgICAgICAgTTJpID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaSA8PCA4KSAgfCAoTTJpID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaSA8PCAyNCkgfCAoTTJpID4+PiA4KSkgICYgMHhmZjAwZmYwMClcblx0ICAgICAgICAgICAgICAgICk7XG5cdCAgICAgICAgICAgICAgICBNMmkxID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaTEgPDwgOCkgIHwgKE0yaTEgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTTJpMSA8PCAyNCkgfCAoTTJpMSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBBYnNvcmIgbWVzc2FnZSBpbnRvIHN0YXRlXG5cdCAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW2ldO1xuXHQgICAgICAgICAgICAgICAgbGFuZS5oaWdoIF49IE0yaTE7XG5cdCAgICAgICAgICAgICAgICBsYW5lLmxvdyAgXj0gTTJpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUm91bmRzXG5cdCAgICAgICAgICAgIGZvciAodmFyIHJvdW5kID0gMDsgcm91bmQgPCAyNDsgcm91bmQrKykge1xuXHQgICAgICAgICAgICAgICAgLy8gVGhldGFcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gTWl4IGNvbHVtbiBsYW5lc1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0TXN3ID0gMCwgdExzdyA9IDA7XG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgeSA9IDA7IHkgPCA1OyB5KyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVt4ICsgNSAqIHldO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB0TXN3IF49IGxhbmUuaGlnaDtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdExzdyBePSBsYW5lLmxvdztcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBUZW1wb3JhcnkgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4ID0gVFt4XTtcblx0ICAgICAgICAgICAgICAgICAgICBUeC5oaWdoID0gdE1zdztcblx0ICAgICAgICAgICAgICAgICAgICBUeC5sb3cgID0gdExzdztcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4NCA9IFRbKHggKyA0KSAlIDVdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBUeDEgPSBUWyh4ICsgMSkgJSA1XTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVHgxTXN3ID0gVHgxLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4MUxzdyA9IFR4MS5sb3c7XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBNaXggc3Vycm91bmRpbmcgY29sdW1uc1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0TXN3ID0gVHg0LmhpZ2ggXiAoKFR4MU1zdyA8PCAxKSB8IChUeDFMc3cgPj4+IDMxKSk7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHRMc3cgPSBUeDQubG93ICBeICgoVHgxTHN3IDw8IDEpIHwgKFR4MU1zdyA+Pj4gMzEpKTtcblx0ICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciB5ID0gMDsgeSA8IDU7IHkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW3ggKyA1ICogeV07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUuaGlnaCBePSB0TXN3O1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBsYW5lLmxvdyAgXj0gdExzdztcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJobyBQaVxuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgbGFuZUluZGV4ID0gMTsgbGFuZUluZGV4IDwgMjU7IGxhbmVJbmRleCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVtsYW5lSW5kZXhdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lTXN3ID0gbGFuZS5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lTHN3ID0gbGFuZS5sb3c7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHJob09mZnNldCA9IFJIT19PRkZTRVRTW2xhbmVJbmRleF07XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBSb3RhdGUgbGFuZXNcblx0ICAgICAgICAgICAgICAgICAgICBpZiAocmhvT2Zmc2V0IDwgMzIpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRNc3cgPSAobGFuZU1zdyA8PCByaG9PZmZzZXQpIHwgKGxhbmVMc3cgPj4+ICgzMiAtIHJob09mZnNldCkpO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdExzdyA9IChsYW5lTHN3IDw8IHJob09mZnNldCkgfCAobGFuZU1zdyA+Pj4gKDMyIC0gcmhvT2Zmc2V0KSk7XG5cdCAgICAgICAgICAgICAgICAgICAgfSBlbHNlIC8qIGlmIChyaG9PZmZzZXQgPj0gMzIpICovIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRNc3cgPSAobGFuZUxzdyA8PCAocmhvT2Zmc2V0IC0gMzIpKSB8IChsYW5lTXN3ID4+PiAoNjQgLSByaG9PZmZzZXQpKTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRMc3cgPSAobGFuZU1zdyA8PCAocmhvT2Zmc2V0IC0gMzIpKSB8IChsYW5lTHN3ID4+PiAoNjQgLSByaG9PZmZzZXQpKTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBUcmFuc3Bvc2UgbGFuZXNcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVFBpTGFuZSA9IFRbUElfSU5ERVhFU1tsYW5lSW5kZXhdXTtcblx0ICAgICAgICAgICAgICAgICAgICBUUGlMYW5lLmhpZ2ggPSB0TXN3O1xuXHQgICAgICAgICAgICAgICAgICAgIFRQaUxhbmUubG93ICA9IHRMc3c7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJobyBwaSBhdCB4ID0geSA9IDBcblx0ICAgICAgICAgICAgICAgIHZhciBUMCA9IFRbMF07XG5cdCAgICAgICAgICAgICAgICB2YXIgc3RhdGUwID0gc3RhdGVbMF07XG5cdCAgICAgICAgICAgICAgICBUMC5oaWdoID0gc3RhdGUwLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICBUMC5sb3cgID0gc3RhdGUwLmxvdztcblxuXHQgICAgICAgICAgICAgICAgLy8gQ2hpXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciB4ID0gMDsgeCA8IDU7IHgrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgNTsgeSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZUluZGV4ID0geCArIDUgKiB5O1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW2xhbmVJbmRleF07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBUTGFuZSA9IFRbbGFuZUluZGV4XTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIFR4MUxhbmUgPSBUWygoeCArIDEpICUgNSkgKyA1ICogeV07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBUeDJMYW5lID0gVFsoKHggKyAyKSAlIDUpICsgNSAqIHldO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIE1peCByb3dzXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUuaGlnaCA9IFRMYW5lLmhpZ2ggXiAoflR4MUxhbmUuaGlnaCAmIFR4MkxhbmUuaGlnaCk7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUubG93ICA9IFRMYW5lLmxvdyAgXiAoflR4MUxhbmUubG93ICAmIFR4MkxhbmUubG93KTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIElvdGFcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lID0gc3RhdGVbMF07XG5cdCAgICAgICAgICAgICAgICB2YXIgcm91bmRDb25zdGFudCA9IFJPVU5EX0NPTlNUQU5UU1tyb3VuZF07XG5cdCAgICAgICAgICAgICAgICBsYW5lLmhpZ2ggXj0gcm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wdXRMZW5ndGhCeXRlcyA9IHRoaXMuY2ZnLm91dHB1dExlbmd0aCAvIDg7XG5cdCAgICAgICAgICAgIHZhciBvdXRwdXRMZW5ndGhMYW5lcyA9IG91dHB1dExlbmd0aEJ5dGVzIC8gODtcblxuXHQgICAgICAgICAgICAvLyBTcXVlZXplXG5cdCAgICAgICAgICAgIHZhciBoYXNoV29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBvdXRwdXRMZW5ndGhMYW5lczsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lID0gc3RhdGVbaV07XG5cdCAgICAgICAgICAgICAgICB2YXIgbGFuZU1zdyA9IGxhbmUuaGlnaDtcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lTHN3ID0gbGFuZS5sb3c7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgICAgICBsYW5lTXN3ID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKGxhbmVNc3cgPDwgOCkgIHwgKGxhbmVNc3cgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgobGFuZU1zdyA8PCAyNCkgfCAobGFuZU1zdyA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICAgICAgbGFuZUxzdyA9IChcblx0ICAgICAgICAgICAgICAgICAgICAoKChsYW5lTHN3IDw8IDgpICB8IChsYW5lTHN3ID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKGxhbmVMc3cgPDwgMjQpIHwgKGxhbmVMc3cgPj4+IDgpKSAgJiAweGZmMDBmZjAwKVxuXHQgICAgICAgICAgICAgICAgKTtcblxuXHQgICAgICAgICAgICAgICAg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gICBuZXcgWDY0V29yZC5pbml0KDB4M2M2ZWYzNzIsIDB4ZmU5NGY4MmIpLCBuZXcgWDY0V29yZC5pbml0KDB4YTU0ZmY1M2EsIDB4NWYxZDM2ZjEpLFxuXHQgICAgICAgICAgICAgICAgbmV3IFg2NFdvcmQuaW5pdCgweDUxMGU1MjdmLCAweGFkZTY4MmQxKSwgbmV3IFg2NFdvcmQuaW5pdCgweDliMDU2ODhjLCAweDJiM2U2YzFmKSxcblx0ICAgICAgICAgICAgICAgIG5ldyBYNjRXb3JkLmluaXQoMHgxZjgzZDlhYiwgMHhmYjQxYmQ2YiksIG5ldyBYNjRXb3JkLmluaXQoMHg1YmUwY2QxOSwgMHgxMzdlMjE3OSlcblx0ICAgICAgICAgICAgXSk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb1Byb2Nlc3NCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIEggPSB0aGlzLl9oYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBIMCA9IEhbMF07XG5cdCAgICAgICAgICAgIHZhciBIMSA9IEhbMV07XG5cdCAgICAgICAgICAgIHZhciBIMiA9IEhbMl07XG5cdCAgICAgICAgICAgIHZhciBIMyA9IEhbM107XG5cdCAgICAgICAgICAgIHZhciBINCA9IEhbNF07XG5cdCAgICAgICAgICAgIHZhciBINSA9IEhbNV07XG5cdCAgICAgICAgICAgIHZhciBINiA9IEhbNl07XG5cdCAgICAgICAgICAgIHZhciBINyA9IEhbN107XG5cblx0ICAgICAgICAgICAgdmFyIEgwaCA9IEgwLmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBIMGwgPSBIMC5sb3c7XG5cdCAgICAgICAgICAgIHZhciBIMWggPSBIMS5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDFsID0gSDEubG93O1xuXHQgICAgICAgICAgICB2YXIgSDJoID0gSDIuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEgybCA9IEgyLmxvdztcblx0ICAgICAgICAgICAgdmFyIEgzaCA9IEgzLmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBIM2wgPSBIMy5sb3c7XG5cdCAgICAgICAgICAgIHZhciBINGggPSBINC5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDRsID0gSDQubG93O1xuXHQgICAgICAgICAgICB2YXIgSDVoID0gSDUuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEg1bCA9IEg1Lmxvdztcblx0ICAgICAgICAgICAgdmFyIEg2aCA9IEg2LmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBINmwgPSBINi5sb3c7XG5cdCAgICAgICAgICAgIHZhciBIN2ggPSBINy5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDdsID0gSDcubG93O1xuXG5cdCAgICAgICAgICAgIC8vIFdvcmtpbmcgdmFyaWFibGVzXG5cdCAgICAgICAgICAgIHZhciBhaCA9IEgwaDtcblx0ICAgICAgICAgICAgdmFyIGFsID0gSDBsO1xuXHQgICAgICAgICAgICB2YXIgYmggPSBIMWg7XG5cdCAgICAgICAgICAgIHZhciBibCA9IEgxbDtcblx0ICAgICAgICAgICAgdmFyIGNoID0gSDJoO1xuXHQgICAgICAgICAgICB2YXIgY2wgPSBIMmw7XG5cdCAgICAgICAgICAgIHZhciBkaCA9IEgzaDtcblx0ICAgICAgICAgICAgdmFyIGRsID0gSDNsO1xuXHQgICAgICAgICAgICB2YXIgZWggPSBINGg7XG5cdCAgICAgICAgICAgIHZhciBlbCA9IEg0bDtcblx0ICAgICAgICAgICAgdmFyIGZoID0gSDVoO1xuXHQgICAgICAgICAgICB2YXIgZmwgPSBINWw7XG5cdCAgICAgICAgICAgIHZhciBnaCA9IEg2aDtcblx0ICAgICAgICAgICAgdmFyIGdsID0gSDZsO1xuXHQgICAgICAgICAgICB2YXIgaGggPSBIN2g7XG5cdCAgICAgICAgICAgIHZhciBobCA9IEg3bDtcblxuXHQgICAgICAgICAgICAvLyBSb3VuZHNcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA4MDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgdmFyIFdpID0gV1tpXTtcblxuXHQgICAgICAgICAgICAgICAgLy8gRXh0ZW5kIG1lc3NhZ2Vcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMTYpIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2loID0gV2kuaGlnaCA9IE1bb2Zmc2V0ICsgaSAqIDJdICAgICB8IDA7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpbCA9IFdpLmxvdyAgPSBNW29mZnNldCArIGkgKiAyICsgMV0gfCAwO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICAvLyBHYW1tYTBcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWEweCAgPSBXW2kgLSAxNV07XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMHhoID0gZ2FtbWEweC5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTB4bCA9IGdhbW1hMHgubG93O1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTBoICA9ICgoZ2FtbWEweGggPj4+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+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBINmwgPSBINi5sb3cgID0g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ogMHg4MDAyMDIsXG5cdCAgICAgICAgICAgIDB4NzAwMDAwMDA6IDB4ODAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDAwOiAweDIwMixcblx0ICAgICAgICAgICAgMHg5MDAwMDAwMDogMHg4MDAyMDAsXG5cdCAgICAgICAgICAgIDB4YTAwMDAwMDA6IDB4ODIwMCxcblx0ICAgICAgICAgICAgMHhiMDAwMDAwMDogMHg4MDgwMDAsXG5cdCAgICAgICAgICAgIDB4YzAwMDAwMDA6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhkMDAwMDAwMDogMHg4MDAwMDIsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhmMDAwMDAwMDogMHg4MjAyLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxODAwMDAwMDogMHg4MDgyMDIsXG5cdCAgICAgICAgICAgIDB4MjgwMDAwMDA6IDB4ODIwMixcblx0ICAgICAgICAgICAgMHgzODAwMDAwMDogMHg4MDAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDAwOiAweDgwODIwMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDAwMDogMHgyMDAsXG5cdCAgICAgICAgICAgIDB4NjgwMDAwMDA6IDB4ODA4MDAyLFxuXHQgICAgICAgICAgICAweDc4MDAwMDAwOiAweDIsXG5cdCAgICAgICAgICAgIDB4ODgwMDAwMDA6IDB4ODAwMjAwLFxuXHQgICAgICAgICAgICAweDk4MDAwMDAwOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDAwMDA6IDB4ODA4MDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwMDAwOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHhjODAwMDAwMDogMHg4MDAwMDIsXG5cdCAgICAgICAgICAgIDB4ZDgwMDAwMDA6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhlODAwMDAwMDogMHgyMDIsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwMDA6IDB4ODAwMDAwLFxuXHQgICAgICAgICAgICAweDE6IDB4ODAwMCxcblx0ICAgICAgICAgICAgMHgxMDAwMDAwMTogMHgyLFxuXHQgICAgICAgICAgICAweDIwMDAwMDAxOiAweDgwODIwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDAwMTogMHg4MDAwMDAsXG5cdCAgICAgICAgICAgIDB4NDAwMDAwMDE6IDB4ODA4MDAyLFxuXHQgICAgICAgICAgICAweDUwMDAwMDAxOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4NjAwMDAwMDE6IDB4MjAwLFxuXHQgICAgICAgICAgICAweDcwMDAwMDAxOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMTogMHg4MDgyMDIsXG5cdCAgICAgICAgICAgIDB4OTAwMDAwMDE6IDB4ODA4MDAwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDAxOiAweDgwMDAwMixcblx0ICAgICAgICAgICAgMHhiMDAwMDAwMTogMHg4MjAyLFxuXHQgICAgICAgICAgICAweGMwMDAwMDAxOiAweDIwMixcblx0ICAgICAgICAgICAgMHhkMDAwMDAwMTogMHg4MDAyMDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwMDE6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhmMDAwMDAwMTogMHgwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE6IDB4ODA4MjAyLFxuXHQgICAgICAgICAgICAweDE4MDAwMDAxOiAweDgwODAwMCxcblx0ICAgICAgICAgICAgMHgyODAwMDAwMTogMHg4MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MzgwMDAwMDE6IDB4MjAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDAxOiAweDgwMDAsXG5cdCAgICAgICAgICAgIDB4NTgwMDAwMDE6IDB4ODAwMDAyLFxuXHQgICAgICAgICAgICAweDY4MDAwMDAxOiAweDIsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwMDE6IDB4ODIwMixcblx0ICAgICAgICAgICAgMHg4ODAwMDAwMTogMHg4MDAyLFxuXHQgICAgICAgICAgICAweDk4MDAwMDAxOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHhhODAwMDAwMTogMHgyMDIsXG5cdCAgICAgICAgICAgIDB4YjgwMDAwMDE6IDB4ODA4MjAwLFxuXHQgICAgICAgICAgICAweGM4MDAwMDAxOiAweDgwMDIwMCxcblx0ICAgICAgICAgICAgMHhkODAwMDAwMTogMHgwLFxuXHQgICAgICAgICAgICAweGU4MDAwMDAxOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwMDE6IDB4ODA4MDAyXG5cdCAgICAgICAgfSxcblx0ICAgICAgICB7XG5cdCAgICAgICAgICAgIDB4MDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHgxMDAwMDAwOiAweDQwMDAsXG5cdCAgICAgICAgICAgIDB4MjAwMDAwMDogMHg4MDAwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDAwOiAweDQwMDgwMDEwLFxuXHQgICAgICAgICAgICAweDQwMDAwMDA6IDB4NDAwMDAwMTAsXG5cdCAgICAgICAgICAgIDB4NTAwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHg2MDAwMDAwOiAweDQwMDA0MDAwLFxuXHQgICAgICAgICAgICAweDcwMDAwMDA6IDB4MTAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDogMHg4NDAwMCxcblx0ICAgICAgICAgICAgMHg5MDAwMDAwOiAweDQwMDA0MDEwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDA6IDB4NDAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4YjAwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHhjMDAwMDAwOiAweDgwMDEwLFxuXHQgICAgICAgICAgICAweGQwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhlMDAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4ZjAwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDA6IDB4NDAwMDQwMDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHgyODAwMDAwOiAweDEwLFxuXHQgICAgICAgICAgICAweDM4MDAwMDA6IDB4NDAwMDQwMTAsXG5cdCAgICAgICAgICAgIDB4NDgwMDAwMDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDAwOiAweDQwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDY4MDAwMDA6IDB4ODAwMDAsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwMDogMHg0MDA4MDAxMCxcblx0ICAgICAgICAgICAgMHg4ODAwMDAwOiAweDgwMDEwLFxuXHQgICAgICAgICAgICAweDk4MDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhhODAwMDAwOiAweDQwMDAsXG5cdCAgICAgICAgICAgIDB4YjgwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHhjODAwMDAwOiAweDQwMDAwMDEwLFxuXHQgICAgICAgICAgICAweGQ4MDAwMDA6IDB4ODQwMDAsXG5cdCAgICAgICAgICAgIDB4ZTgwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHhmODAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4MTAwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxMTAwMDAwMDogMHg0MDA4MDAxMCxcblx0ICAgICAgICAgICAgMHgxMjAwMDAwMDogMHg0MDAwNDAxMCxcblx0ICAgICAgICAgICAgMHgxMzAwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHgxNDAwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHgxNTAwMDAwMDogMHgxMCxcblx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AwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFkODAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4MWU4MDAwMDA6IDB4NDAwODAwMTAsXG5cdCAgICAgICAgICAgIDB4MWY4MDAwMDA6IDB4ODQwMDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDEwNCxcblx0ICAgICAgICAgICAgMHgxMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgyMDAwMDA6IDB4NDAwMDEwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDA6IDB4MTAxMDQsXG5cdCAgICAgICAgICAgIDB4NDAwMDAwOiAweDEwMDA0LFxuXHQgICAgICAgICAgICAweDUwMDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDYwMDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDcwMDAwMDogMHg0MDEwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDogMHg0MDAwMDAwLFxuXHQgICAgICAgICAgICAweDkwMDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDogMHgxMDEwMCxcblx0ICAgICAgICAgICAgMHhiMDAwMDA6IDB4NDAxMDAwNCxcblx0ICAgICAgICAgICAgMHhjMDAwMDA6IDB4NDAwMDEwNCxcblx0ICAgICAgICAgICAgMHhkMDAwMDA6IDB4MTAwMDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwOiAweDQsXG5cdCAgICAgICAgICAgIDB4ZjAwMDAwOiAweDEwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDogMHg0MDEwMDA0LFxuXHQgICAgICAgICAgICAweDI4MDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDM4MDAwMDogMHg0MDAwMTAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDU4MDAwMDogMHgxMDAwMCxcblx0ICAgICAgICAgICAgMHg2ODAwMDA6IDB4MTAwMDQsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwOiAweDEwNCxcblx0ICAgICAgICAgICAgMHg4ODAwMDA6IDB4NCxcblx0ICAgICAgICAgICAgMHg5ODAwMDA6IDB4MTAwLFxuXHQgICAgICAgICAgICAweGE4MDAwMDogMHg0MDEwMDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwMDogMHgxMDEwNCxcblx0ICAgICAgICAgICAgMHhjODAwMDA6IDB4MTAxMDAsXG5cdCAgICAgICAgICAgIDB4ZDgwMDAwOiAweDQwMDAxMDQsXG5cdCAgICAgICAgICAgIDB4ZTgwMDAwOiAweDQwMTAxMDQsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwOiAweDQwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTAwMDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweDExMDAwMDA6IDB4MTAwMDQsXG5cdCAgICAgICAgICAgIDB4MTIwMDAwMDogMHgxMDAwMCxcblx0ICAgICAgICAgICAgMHgxMzAwMDAwOiAweDQwMDAxMDAsXG5cdCAgICAgICAgICAgIDB4MTQwMDAwMDogMHgxMDAsXG5cdCAgICAgICAgICAgIDB4MTUwMDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDE2MDAwMDA6IDB4NDAwMDAwNCxcblx0ICAgICAgICAgICAgMHgxNzAwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwMDogMHg0MDAwMTA0LFxuXHQgICAgICAgICAgICAweDE5MDAwMDA6IDB4NDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYTAwMDAwOiAweDQsXG5cdCAgICAgICAgICAgIDB4MWIwMDAwMDogMHgxMDEwMCxcblx0ICAgICAgICAgICAgMHgxYzAwMDAwOiAweDQwMTAwMDAsXG5cdCAgICAgICAgICAgIDB4MWQwMDAwMDogMHgxMDQsXG5cdCAgICAgICAgICAgIDB4MWUwMDAwMDogMHgxMDEwNCxcblx0ICAgICAgICAgICAgMHgxZjAwMDAwOiAweDQwMTAwMDQsXG5cdCAgICAgICAgICAgIDB4MTA4MDAwMDogMHg0MDAwMDAwLFxuXHQgICAgICAgICAgICAweDExODAwMDA6IDB4MTA0LFxuXHQgICAgICAgICAgICAweDEyODAwMDA6IDB4NDAxMDEwMCxcblx0ICAgICAgICAgICAgMHgxMzgwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTQ4MDAwMDogMHgxMDAwNCxcblx0ICAgICAgICAgICAgMHgxNTgwMDAwOiAweDQwMDAxMDAsXG5cdCAgICAgICAgICAgIDB4MTY4MDAwMDogMHgxMDAsXG5cdCAgICAgICAgICAgIDB4MTc4MDAwMDogMHg0MDEwMDA0LFxuXHQgICAgICAgICAgICAweDE4ODAwMDA6IDB4MTAwMDAsXG5cdCAgICAgICAgICAgIDB4MTk4MDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDFhODAwMDA6IDB4MTAxMDQsXG5cdCAgICAgICAgICAgIDB4MWI4MDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDFjODAwMDA6IDB4NDAwMDEwNCxcblx0ICAgICAgICAgICAgMHgxZDgwMDAwOiAweDQwMTAwMDAsXG5cdCAgICAgICAgICAgIDB4MWU4MDAwMDogMHg0LFxuXHQgICAgICAgICAgICAweDFmODAwMDA6IDB4MTAxMDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwNDAxMDAwLFxuXHQgICAgICAgICAgICAweDEwMDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDIwMDAwOiAweDQwMTA0MCxcblx0ICAgICAgICAgICAgMHgzMDAwMDogMHg4MDQwMDAwMCxcblx0ICAgICAgICAgICAgMHg0MDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDUwMDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHg2MDAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHg3MDAwMDogMHg0MDAwNDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4OTAwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweGEwMDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweGIwMDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweGMwMDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweGQwMDAwOiAweDEwNDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDA6IDB4MTAwMCxcblx0ICAgICAgICAgICAgMHhmMDAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHg4MDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDE4MDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDI4MDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweDM4MDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHg2ODAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDc4MDAwOiAweDgwNDAwMDAwLFxuXHQgICAgICAgICAgICAweDg4MDAwOiAweDEwMDAsXG5cdCAgICAgICAgICAgIDB4OTgwMDA6IDB4ODA0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwOiAweDEwNDAsXG5cdCAgICAgICAgICAgIDB4YzgwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ZDgwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweGU4MDAwOiAweDQwMTA0MCxcblx0ICAgICAgICAgICAgMHhmODAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHgxMDAwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweDExMDAwMDogMHg0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4MTIwMDAwOiAweDgwMDAwMDQwLFxuXHQgICAgICAgICAgICAweDEzMDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDE0MDAwMDogMHgxMDQwLFxuXHQgICAgICAgICAgICAweDE1MDAwMDogMHg4MDQwMDA0MCxcblx0ICAgICAgICAgICAgMHgxNjAwMDA6IDB4ODA0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4MTcwMDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHgxOTAwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWEwMDAwOiAweDgwNDAwMDAwLFxuXHQgICAgICAgICAgICAweDFiMDAwMDogMHg0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4MWMwMDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweDFkMDAwMDogMHg0MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWUwMDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDFmMDAwMDogMHgxMDAwLFxuXHQgICAgICAgICAgICAweDEwODAwMDogMHg4MDQwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMTgwMDA6IDB4ODA0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTI4MDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHgxNDgwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweDE1ODAwMDogMHg4MDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNjgwMDA6IDB4ODAwMDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTc4MDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDE4ODAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHgxOTgwMDA6IDB4MTAwMCxcblx0ICAgICAgICAgICAgMHgxYTgwMDA6IDB4ODAwMDEwMDAsXG5cdCAgICAgICAgICAgIDB4MWI4MDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweDFjODAwMDogMHgxMDQwLFxuXHQgICAgICAgICAgICAweDFkODAwMDogMHg4MDQwMTAwMCxcblx0ICAgICAgICAgICAgMHgxZTgwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweDFmODAwMDogMHg0MDEwNDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwLFxuXHQgICAgICAgICAgICAweDEwMDA6IDB4MTA0MDAwMCxcblx0ICAgICAgICAgICAgMHgyMDAwOiAweDQwMDAwLFxuXHQgICAgICAgICAgICAweDMwMDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4NDAwMDogMHgyMDA0MDA4MCxcblx0ICAgICAgICAgICAgMHg1MDAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4NjAwMDogMHgyMTAwMDA4MCxcblx0ICAgICAgICAgICAgMHg3MDAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDgwMDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHg5MDAwOiAweDIwMDQwMDAwLFxuXHQgICAgICAgICAgICAweGEwMDA6IDB4MjAwMDAwODAsXG5cdCAgICAgICAgICAgIDB4YjAwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHhjMDAwOiAweDIxMDQwMDAwLFxuXHQgICAgICAgICAgICAweGQwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhlMDAwOiAweDEwNDAwODAsXG5cdCAgICAgICAgICAgIDB4ZjAwMDogMHgyMTAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxODAwOiAweDIxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDI4MDA6IDB4ODAsXG5cdCAgICAgICAgICAgIDB4MzgwMDogMHgxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDA6IDB4NDAwMDAsXG5cdCAgICAgICAgICAgIDB4NTgwMDogMHgyMDA0MDA4MCxcblx0ICAgICAgICAgICAgMHg2ODAwOiAweDIxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDc4MDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODgwMDogMHgyMDA0MDAwMCxcblx0ICAgICAgICAgICAgMHg5ODAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHhiODAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4YzgwMDogMHgyMDAwMDA4MCxcblx0ICAgICAgICAgICAgMHhkODAwOiAweDIxMDAwMDAwLFxuXHQgICAgICAgICAgICAweGU4MDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHhmODAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDEwMDAwOiAweDQwMDAwLFxuXHQgICAgICAgICAgICAweDExMDAwOiAweDgwLFxuXHQgICAgICAgICAgICAweDEyMDAwOiAweDIwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEzMDAwOiAweDIxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDE0MDAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MTUwMDA6IDB4MjEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTYwMDA6IDB4MjAwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTcwMDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxODAwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxOTAwMDogMHgyMTAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYTAwMDogMHgxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDFiMDAwOiAweDIwMDQwMDAwLFxuXHQgICAgICAgICAgICAweDFjMDAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDFkMDAwOiAweDIwMDAwMDgwLFxuXHQgICAgICAgICAgICAweDFlMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MWYwMDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxMDgwMDogMHgyMTAwMDA4MCxcblx0ICAgICAgICAgICAgMHgxMTgwMDogMHgxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEyODAwOiAweDEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDA6IDB4MjAwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTQ4MDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTU4MDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxNjgwMDogMHg4MCxcblx0ICAgICAgICAgICAgMHgxNzgwMDogMHgyMTA0MDAwMCxcblx0ICAgICAgICAgICAgMHgxODgwMDogMHg0MDA4MCxcblx0ICAgICAgICAgICAgMHgxOTgwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxYTgwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFiODAwOiAweDIxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDFjODAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MWQ4MDA6IDB4NDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWU4MDA6IDB4MjAwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWY4MDA6IDB4MjAwMDAwODBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDEwMDAwMDA4LFxuXHQgICAgICAgICAgICAweDEwMDogMHgyMDAwLFxuXHQgICAgICAgICAgICAweDIwMDogMHgxMDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgzMDA6IDB4MTAyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4NDAwOiAweDEwMDAyMDAwLFxuXHQgICAgICAgICAgICAweDUwMDogMHgyMDAwMDAsXG5cdCAgICAgICAgICAgIDB4NjAwOiAweDIwMDAwOCxcblx0ICAgICAgICAgICAgMHg3MDA6IDB4MTAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4OTAwOiAweDEwMDAyMDA4LFxuXHQgICAgICAgICAgICAweGEwMDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4YjAwOiAweDgsXG5cdCAgICAgICAgICAgIDB4YzAwOiAweDEwMjAwMDA4LFxuXHQgICAgICAgICAgICAweGQwMDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4ZTAwOiAweDIwMDgsXG5cdCAgICAgICAgICAgIDB4ZjAwOiAweDEwMjAyMDAwLFxuXHQgICAgICAgICAgICAweDgwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDE4MDogMHgxMDIwMjAwOCxcblx0ICAgICAgICAgICAgMHgyODA6IDB4OCxcblx0ICAgICAgICAgICAgMHgzODA6IDB4MjAwMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4NTgwOiAweDEwMDAwMDA4LFxuXHQgICAgICAgICAgICAweDY4MDogMHgxMDAwMjAwMCxcblx0ICAgICAgICAgICAgMHg3ODA6IDB4MjAwOCxcblx0ICAgICAgICAgICAgMHg4ODA6IDB4MjAwMDA4LFxuXHQgICAgICAgICAgICAweDk4MDogMHgyMDAwLFxuXHQgICAgICAgICAgICAweGE4MDogMHgxMDAwMjAwOCxcblx0ICAgICAgICAgICAgMHhiODA6IDB4MTAyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4YzgwOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZDgwOiAweDEwMjAyMDAwLFxuXHQgICAgICAgICAgICAweGU4MDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4ZjgwOiAweDEwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEwMDA6IDB4MTAwMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTEwMDogMHgxMDIwMDAwOCxcblx0ICAgICAgICAgICAgMHgxMjAwOiAweDEwMjAyMDA4LFxuXHQgICAgICAgICAgICAweDEzMDA6IDB4MjAwOCxcblx0ICAgICAgICAgICAgMHgxNDAwOiAweDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNTAwOiAweDEwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDE2MDA6IDB4MTAwMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTcwMDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MTkwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFhMDA6IDB4OCxcblx0ICAgICAgICAgICAgMHgxYjAwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDFjMDA6IDB4MjAwMCxcblx0ICAgICAgICAgICAgMHgxZDAwOiAweDEwMDAyMDA4LFxuXHQgICAgICAgICAgICAweDFlMDA6IDB4MTAyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MWYwMDogMHgyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTA4MDogMHg4LFxuXHQgICAgICAgICAgICAweDExODA6IDB4MjAyMDAwLFxuXHQgICAgICAgICAgICAweDEyODA6IDB4MjAwMDAwLFxuXHQgICAgICAgICAgICAweDEzODA6IDB4MTAwMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTQ4MDogMHgxMDAwMjAwMCxcblx0ICAgICAgICAgICAgMHgxNTgwOiAweDIwMDgsXG5cdCAgICAgICAgICAgIDB4MTY4MDogMHgxMDIwMjAwOCxcblx0ICAgICAgICAgICAgMHgxNzgwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDE4ODA6IDB4MTAyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTk4MDogMHgxMDIwMDAwOCxcblx0ICAgICAgICAgICAgMHgxYTgwOiAweDIwMDAsXG5cdCAgICAgICAgICAgIDB4MWI4MDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MWM4MDogMHgyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MWQ4MDogMHgwLFxuXHQgICAgICAgICAgICAweDFlODA6IDB4MTAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWY4MDogMHgxMDAwMjAwOFxuXHQgICAgICAgIH0sXG5cdCAgICAgICAge1xuXHQgICAgICAgICAgICAweDA6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDEwOiAweDIwMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MjA6IDB4NDAwLFxuXHQgICAgICAgICAgICAweDMwOiAweDEwMDQwMSxcblx0ICAgICAgICAgICAgMHg0MDogMHgyMTAwNDAxLFxuXHQgICAgICAgICAgICAweDUwOiAweDAsXG5cdCAgICAgICAgICAgIDB4NjA6IDB4MSxcblx0ICAgICAgICAgICAgMHg3MDogMHgyMTAwMDAxLFxuXHQgICAgICAgICAgICAweDgwOiAweDIwMDA0MDAsXG5cdCAgICAgICAgICAgIDB4OTA6IDB4MTAwMDAxLFxuXHQgICAgICAgICAgICAweGEwOiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4YjA6IDB4MjEwMDQwMCxcblx0ICAgICAgICAgICAgMHhjMDogMHgyMTAwMDAwLFxuXHQgICAgICAgICAgICAweGQwOiAweDQwMSxcblx0ICAgICAgICAgICAgMHhlMDogMHgxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4ZjA6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4OiAweDIxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MTg6IDB4MCxcblx0ICAgICAgICAgICAgMHgyODogMHgyMDAwNDAxLFxuXHQgICAgICAgICAgICAweDM4OiAweDIxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4NDg6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDU4OiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4Njg6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHg3ODogMHg0MDEsXG5cdCAgICAgICAgICAgIDB4ODg6IDB4MTAwNDAxLFxuXHQgICAgICAgICAgICAweDk4OiAweDIwMDA0MDAsXG5cdCAgICAgICAgICAgIDB4YTg6IDB4MjEwMDAwMCxcblx0ICAgICAgICAgICAgMHhiODogMHgxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4Yzg6IDB4NDAwLFxuXHQgICAgICAgICAgICAweGQ4OiAweDIxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4ZTg6IDB4MSxcblx0ICAgICAgICAgICAgMHhmODogMHgxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MTAwOiAweDIwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTEwOiAweDEwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMjA6IDB4MjAwMDQwMSxcblx0ICAgICAgICAgICAgMHgxMzA6IDB4MjEwMDAwMSxcblx0ICAgICAgICAgICAgMHgxNDA6IDB4MTAwMDAxLFxuXHQgICAgICAgICAgICAweDE1MDogMHgyMDAwNDAwLFxuXHQgICAgICAgICAgICAweDE2MDogMHgyMTAwNDAwLFxuXHQgICAgICAgICAgICAweDE3MDogMHgxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MTgwOiAweDQwMSxcblx0ICAgICAgICAgICAgMHgxOTA6IDB4MjEwMDQwMSxcblx0ICAgICAgICAgICAgMHgxYTA6IDB4MTAwNDAwLFxuXHQgICAgICAgICAgICAweDFiMDogMHgxLFxuXHQgICAgICAgICAgICAweDFjMDogMHgwLFxuXHQgICAgICAgICAgICAweDFkMDogMHgyMTAwMDAwLFxuXHQgICAgICAgICAgICAweDFlMDogMHgyMDAwMDAxLFxuXHQgICAgICAgICAgICAweDFmMDogMHg0MDAsXG5cdCAgICAgICAgICAgIDB4MTA4OiAweDEwMDQwMCxcblx0ICAgICAgICAgICAgMHgxMTg6IDB4MjAwMDQwMSxcblx0ICAgICAgICAgICAgMHgxMjg6IDB4MjEwMDAwMSxcblx0ICAgICAgICAgICAgMHgxMzg6IDB4MSxcblx0ICAgICAgICAgICAgMHgxNDg6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNTg6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDE2ODogMHg0MDEsXG5cdCAgICAgICAgICAgIDB4MTc4OiAweDIxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MTg4OiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MTk4OiAweDIxMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWE4OiAweDAsXG5cdCAgICAgICAgICAgIDB4MWI4OiAweDIxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MWM4OiAweDEwMDQwMSxcblx0ICAgICAgICAgICAgMHgxZDg6IDB4NDAwLFxuXHQgICAgICAgICAgICAweDFlODogMHgyMDAwNDAwLFxuXHQgICAgICAgICAgICAweDFmODogMHgxMDAwMDFcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwMDA4MjAsXG5cdCAgICAgICAgICAgIDB4MTogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgyOiAweDgwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MzogMHgyMCxcblx0ICAgICAgICAgICAgMHg0OiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDU6IDB4ODAyMDgyMCxcblx0ICAgICAgICAgICAgMHg2OiAweDgwMjA4MDAsXG5cdCAgICAgICAgICAgIDB4NzogMHg4MDAsXG5cdCAgICAgICAgICAgIDB4ODogMHg4MDIwMDAwLFxuXHQgICAgICAgICAgICAweDk6IDB4ODAwMDgwMCxcblx0ICAgICAgICAgICAgMHhhOiAweDIwODAwLFxuXHQgICAgICAgICAgICAweGI6IDB4ODAyMDAyMCxcblx0ICAgICAgICAgICAgMHhjOiAweDgyMCxcblx0ICAgICAgICAgICAgMHhkOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZTogMHg4MDAwMDIwLFxuXHQgICAgICAgICAgICAweGY6IDB4MjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDA6IDB4ODAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDAxOiAweDgwMjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDI6IDB4ODAwMDgyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMzogMHg4MDAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA0OiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDU6IDB4MjA4MDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDY6IDB4MjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDc6IDB4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDg6IDB4ODAwMDAyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwOTogMHg4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGE6IDB4MjAwMjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGI6IDB4ODAyMDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwYzogMHgwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDBkOiAweDgwMjAwMjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGU6IDB4ODAwMDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwZjogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgxMDogMHgyMDgyMCxcblx0ICAgICAgICAgICAgMHgxMTogMHg4MDIwODAwLFxuXHQgICAgICAgICAgICAweDEyOiAweDIwLFxuXHQgICAgICAgICAgICAweDEzOiAweDgwMCxcblx0ICAgICAgICAgICAgMHgxNDogMHg4MDAwODAwLFxuXHQgICAgICAgICAgICAweDE1OiAweDgwMDAwMjAsXG5cdCAgICAgICAgICAgIDB4MTY6IDB4ODAyMDAyMCxcblx0ICAgICAgICAgICAgMHgxNzogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgxODogMHgwLFxuXHQgICAgICAgICAgICAweDE5OiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDFhOiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4MWI6IDB4ODAwMDgyMCxcblx0ICAgICAgICAgICAgMHgxYzogMHg4MDIwODIwLFxuXHQgICAgICAgICAgICAweDFkOiAweDIwODAwLFxuXHQgICAgICAgICAgICAweDFlOiAweDgyMCxcblx0ICAgICAgICAgICAgMHgxZjogMHg4MDAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDEwOiAweDIwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDExOiAweDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxMjogMHg4MDIwMDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDEzOiAweDIwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE0OiAweDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE1OiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMTY6IDB4ODAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxNzogMHg4MDAwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE4OiAweDgwMjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMTk6IDB4ODAwMDAyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxYTogMHg4MDAwODAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFiOiAweDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMWM6IDB4MjA4MDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMWQ6IDB4ODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFlOiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFmOiAweDgwMjA4MDBcblx0ICAgICAgICB9XG5cdCAgICBdO1xuXG5cdCAgICAvLyBNYXNrcyB0aGF0IHNlbGVjdCB0aGUgU0JPWCBpbnB1dFxuXHQgICAgdmFyIFNCT1hfTUFTSyA9IFtcblx0ICAgICAgICAweGY4MDAwMDAxLCAweDFmODAwMDAwLCAweDAxZjgwMDAwLCAweDAwMWY4MDAwLFxuXHQgICAgICAgIDB4MDAwMWY4MDAsIDB4MDAwMDFmODAsIDB4MDAwMDAxZjgsIDB4ODAwMDAwMWZcblx0ICAgIF07XG5cblx0ICAgIC8qKlxuXHQgICAgICogREVTIGJsb2NrIGNpcGhlciBhbGdvcml0aG0uXG5cdCAgICAgKi9cblx0ICAgIHZhciBERVMgPSBDX2FsZ28uREVTID0gQmxvY2tDaXBoZXIuZXh0ZW5kKHtcblx0ICAgICAgICBfZG9SZXNldDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGtleSA9IHRoaXMuX2tleTtcblx0ICAgICAgICAgICAgdmFyIGtleVdvcmRzID0ga2V5LndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFNlbGVjdCA1NiBiaXRzIGFjY29yZGluZyB0byBQQzFcblx0ICAgICAgICAgICAgdmFyIGtleUJpdHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA1NjsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIga2V5Qml0UG9zID0gUEMxW2ldIC0gMTtcblx0ICAgICAgICAgICAgICAgIGtleUJpdHNbaV0gPSAoa2V5V29yZHNba2V5Qml0UG9zID4+PiA1XSA+Pj4gKDMxIC0ga2V5Qml0UG9zICUgMzIpKSAmIDE7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBBc3NlbWJsZSAxNiBzdWJrZXlzXG5cdCAgICAgICAgICAgIHZhciBzdWJLZXlzID0gdGhpcy5fc3ViS2V5cyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBuU3ViS2V5ID0gMDsgblN1YktleSA8IDE2OyBuU3ViS2V5KyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIENyZWF0ZSBzdWJrZXlcblx0ICAgICAgICAgICAgICAgIHZhciBzdWJLZXkgPSBzdWJLZXlzW25TdWJLZXldID0gW107XG5cblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICB2YXIgYml0U2hpZnQgPSBCSVRfU0hJRlRTW25TdWJLZXldO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTZWxlY3QgNDggYml0cyBhY2NvcmRpbmcgdG8gUEMyXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAvLyBTZWxlY3QgZnJvbSB0aGUgbGVmdCAyOCBrZXkgYml0c1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVsoaSAvIDYpIHwgMF0gfD0ga2V5Qml0c1soKFBDMltpXSAtIDEpICsgYml0U2hpZnQpICUgMjhdIDw8ICgzMSAtIGkgJSA2KTtcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFNlbGVjdCBmcm9tIHRoZSByaWdodCAyOCBrZXkgYml0c1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVs0ICsgKChpIC8gNikgfCAwKV0gfD0ga2V5Qml0c1syOCArICgoKFBDMltpICsgMjRdIC0gMSkgKyBiaXRTaGlmdCkgJSAyOCldIDw8ICgzMSAtIGkgJSA2KTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gU2luY2UgZWFjaCBzdWJrZXkgaXMgYXBwbGllZCB0byBhbiBleHBhbmRlZCAzMi1iaXQgaW5wdXQsXG5cdCAgICAgICAgICAgICAgICAvLyB0aGUgc3Via2V5IGNhbiBiZSBicm9rZW4gaW50byA4IHZhbHVlcyBzY2FsZWQgdG8gMzItYml0cyxcblx0ICAgICAgICAgICAgICAgIC8vIHdoaWNoIGFsbG93cyB0aGUga2V5IHRvIGJlIHVzZWQgd2l0aG91dCBleHBhbnNpb25cblx0ICAgICAgICAgICAgICAgIHN1YktleVswXSA9IChzdWJLZXlbMF0gPDwgMSkgfCAoc3ViS2V5WzBdID4+PiAzMSk7XG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IDc7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVtpXSA9IHN1YktleVtpXSA+Pj4gKChpIC0gMSkgKiA0ICsgMyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICBzdWJLZXlbN10gPSAoc3ViS2V5WzddIDw8IDUpIHwgKHN1YktleVs3XSA+Pj4gMjcpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBpbnZlcnNlIHN1YmtleXNcblx0ICAgICAgICAgICAgdmFyIGludlN1YktleXMgPSB0aGlzLl9pbnZTdWJLZXlzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMTY7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgaW52U3ViS2V5c1tpXSA9IHN1YktleXNbMTUgLSBpXTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBlbmNyeXB0QmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgdGhpcy5fZG9DcnlwdEJsb2NrKE0sIG9mZnNldCwgdGhpcy5fc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vY2s7XG5cdCAgICAgICAgICAgICAgICB2YXIgckJsb2NrID0gdGhpcy5fckJsb2NrO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBGZWlzdGVsIGZ1bmN0aW9uXG5cdCAgICAgICAgICAgICAgICB2YXIgZiA9IDA7XG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDg7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGYgfD0gU0JPWF9QW2ldWygockJsb2NrIF4gc3ViS2V5W2ldKSAmIFNCT1hfTUFTS1tpXSkgPj4+IDBdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdGhpcy5fbEJsb2NrID0gckJsb2NrO1xuXHQgICAgICAgICAgICAgICAgdGhpcy5fckJsb2NrID0gbEJsb2NrIF4gZjtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIFVuZG8gc3dhcCBmcm9tIGxhc3Qgcm91bmRcblx0ICAgICAgICAgICAgdmFyIHQgPSB0aGlzLl9sQmxvY2s7XG5cdCAgICAgICAgICAgIHRoaXMuX2xCbG9jayA9IHRoaXMuX3JCbG9jaztcblx0ICAgICAgICAgICAgdGhpcy5fckJsb2NrID0gdDtcblxuXHQgICAgICAgICAgICAvLyBGaW5hbCBwZXJtdXRhdGlvblxuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgMSwgIDB4NTU1NTU1NTUpO1xuXHQgICAgICAgICAgICBleGNoYW5nZVJMLmNhbGwodGhpcywgOCwgIDB4MDBmZjAwZmYpO1xuXHQgICAgICAgICAgICBleGNoYW5nZVJMLmNhbGwodGhpcywgMiwgIDB4MzMzMzMzMzMpO1xuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgMTYsIDB4MDAwMGZmZmYpO1xuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgNCwgIDB4MGYwZjBmMGYpO1xuXG5cdCAg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vcmQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gaGlnaCBUaGUgaGlnaCAzMiBiaXRzLlxuXHQgICAgICAgICAqIEBwYXJhbSB7bnVtYmVyfSBsb3cgVGhlIGxvdyAzMiBiaXRzLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgeDY0V29yZCA9IENyeXB0b0pTLng2NC5Xb3JkLmNyZWF0ZSgweDAwMDEwMjAzLCAweDA0MDUwNjA3KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBpbml0OiBmdW5jdGlvbiAoaGlnaCwgbG93KSB7XG5cdCAgICAgICAgICAgIHRoaXMuaGlnaCA9IGhpZ2g7XG5cdCAgICAgICAgICAgIHRoaXMubG93ID0gbG93O1xuXHQgICAgICAgIH1cblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIEJpdHdpc2UgTk9UcyB0aGlzIHdvcmQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtYNjRXb3JkfSBBIG5ldyB4NjQtV29yZCBvYmplY3QgYWZ0ZXIgbmVnYXRpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBuZWdhdGVkID0geDY0V29yZC5ub3QoKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICAvLyBub3Q6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgLy8gdmFyIGhpZ2ggPSB+dGhpcy5oaWdoO1xuXHQgICAgICAgICAgICAvLyB2YXIgbG93ID0gfnRoaXMubG93O1xuXG5cdCAgICAgICAgICAgIC8vIHJldHVybiBYNjRXb3JkLmNyZWF0ZShoaWdoLCBsb3cpO1xuXHQgICAgICAgIC8vIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAg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QgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBvcmVkID0geDY0V29yZC5vcihhbm90aGVyWDY0V29yZCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgLy8gb3I6IGZ1bmN0aW9uICh3b3JkKSB7XG5cdCAgICAgICAgICAgIC8vIHZhciBoaWdoID0gdGhpcy5oaWdoIHwgd29yZC5oaWdoO1xuXHQgICAgICAgICAgICAvLyB2YXIgbG93ID0gdGhpcy5sb3cgfCB3b3JkLmxvdztcblxuXHQgICAgICAgICAgICAvLyByZXR1cm4gWDY0V29yZC5jcmVhdGUoaGlnaCwgbG93KTtcblx0ICAgICAgICAvLyB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQml0d2lzZSBYT1JzIHRoaXMgd29yZCB3aXRoIHRoZSBwYXNzZWQgd29yZC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7WDY0V29yZH0gd29yZCBUaGUgeDY0LVdvcmQgdG8gWE9SIHdpdGggdGhpcyB3b3JkLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZH0gQSBuZXcgeDY0LVdvcmQgb2JqZWN0IGFmdGVyIFhPUmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHhvcmVkID0geDY0V29yZC54b3IoYW5vdGhlclg2NFdvcmQpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIC8vIHhvcjogZnVuY3Rpb24gKHdvcmQpIHtcblx0ICAgICAgICAgICAgLy8gdmFyIGhpZ2ggPSB0aGlzLmhpZ2ggXiB3b3JkLmhpZ2g7XG5cdCAgICAgICAgICAgIC8vIHZhciBsb3cgPSB0aGlzLmxvdyBeIHdvcmQubG93O1xuXG5cdCAgICAgICAgICAgIC8vIHJldHVybiBYNjRXb3JkLmNyZWF0ZShoaWdoLCBsb3cp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gICAgICAgKiBAcmV0dXJuIHtYNjRXb3JkfSBBIG5ldyB4NjQtV29yZCBvYmplY3QgYWZ0ZXIgcm90YXRpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciByb3RhdGVkID0geDY0V29yZC5yb3RMKDI1KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICAvLyByb3RMOiBmdW5jdGlvbiAobikge1xuXHQgICAgICAgICAgICAvLyByZXR1cm4gdGhpcy5zaGlmdEwobikub3IodGhpcy5zaGlmdFIoNjQgLSBuKSk7XG5cdCAgICAgICAgLy8gfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIFJvdGF0ZXMgdGhpcyB3b3JkIG4gYml0cyB0byB0aGUgcmlnaHQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbiBUaGUgbnVtYmVyIG9mIGJpdHMgdG8gcm90YXRlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZH0gQSBuZXcgeDY0LVdvcmQgb2JqZWN0IGFmdGVyIHJvdGF0aW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgcm90YXRlZCA9IHg2NFdvcmQucm90Uig3KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICAvLyByb3RSOiBmdW5jdGlvbiAobikge1xuXHQgICAgICAgICAgICAvLyByZXR1cm4gdGhpcy5zaGlmdFIobikub3IodGhpcy5zaGlmdEwoNjQgLSBuKSk7XG5cdCAgICAgICAgLy8gfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIEFkZHMgdGhpcyB3b3JkIHdpdGggdGhlIHBhc3NlZCB3b3JkLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhc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0gQ194NjQuV29yZEFycmF5ID0gQmFzZS5leHRlbmQoe1xuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIEluaXRpYWxpemVzIGEgbmV3bHkgY3JlYXRlZCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtBcnJheX0gd29yZHMgKE9wdGlvbmFsKSBBbiBhcnJheSBvZiBDcnlwdG9KUy54NjQuV29yZCBvYmplY3RzLlxuXHQgICAgICAgICAqIEBwYXJhbSB7bnVtYmVyfSBzaWdCeXRlcyAoT3B0aW9uYWwpIFRoZSBudW1iZXIgb2Ygc2lnbmlmaWNhbnQgYnl0ZXMgaW4gdGhlIHdvcmRzLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMueDY0LldvcmRBcnJheS5jcmVhdGUoKTtcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMueDY0LldvcmRBcnJheS5jcmVhdGUoW1xuXHQgICAgICAgICAqICAgICAgICAgQ3J5cHRvSlMueDY0LldvcmQuY3JlYXRlKDB4MDAwMTAyMDMsIDB4MDQwNTA2MDcpLFxuXHQgICAgICAgICAqICAgICAgICAgQ3J5cHRvSlMueDY0LldvcmQuY3JlYXRlKDB4MTgxOTFhMWIsIDB4MWMxZDFlMWYpXG5cdCAgICAgICAgICogICAgIF0pO1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy54NjQuV29yZEFycmF5LmNyZWF0ZShbXG5cdCAgICAgICAgICogICAgICAgICBDcnlwdG9KUy54NjQuV29yZC5jcmVhdGUoMHgwMDAxMDIwMywgMHgwNDA1MDYwNyksXG5cdCAgICAgICAgICogICAgICAgICBDcnlwdG9KUy54NjQuV29yZC5jcmVhdGUoMHgxODE5MWExYiwgMHgxYzFkMWUxZilcblx0ICAgICAgICAgKiAgICAgXSwgMTApO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGluaXQ6IGZ1bmN0aW9uICh3b3Jkcywgc2lnQnl0ZXMpIHtcblx0ICAgICAgICAgICAgd29yZHMgPSB0aGlzLndvcmRzID0gd29yZHMgfHwgW107XG5cblx0ICAgICAgICAgICAgaWYgKHNpZ0J5dGVzICE9IHVuZGVmaW5lZCkge1xuXHQgICAgICAgICAgICAgICAgdGhpcy5zaWdCeXRlcyA9IHNpZ0J5dGVzO1xuXHQgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgdGhpcy5zaWdCeXRlcyA9IHdvcmRzLmxlbmd0aCAqIDg7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgdGhpcyA2NC1iaXQgd29yZCBhcnJheSB0byBhIDMyLWJpdCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7Q3J5cHRvSlMubGliLldvcmRBcnJheX0gVGhpcyB3b3JkIGFycmF5J3MgZGF0YSBhcyBhIDMyLWJpdCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgeDMyV29yZEFycmF5ID0geDY0V29yZEFycmF5LnRvWDMyKCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgdG9YMzI6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB4NjRXb3JkcyA9IHRoaXMud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB4NjRXb3Jkc0xlbmd0aCA9IHg2NFdvcmRzLmxlbmd0aDtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciB4MzJXb3JkcyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHg2NFdvcmRzTGVuZ3RoOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciB4NjRXb3JkID0geDY0V29yZHNbaV07XG5cdCAgICAgICAgICAgICAgICB4MzJXb3Jkcy5wdXNoKHg2NFdvcmQuaGlnaCk7XG5cdCAgICAgICAgICAgICAgICB4MzJXb3Jkcy5wdXNoKHg2NFdvcmQubG93KTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBYMzJXb3JkQXJyYXkuY3JlYXRlKHgzMldvcmRzLCB0aGlzLnNpZ0J5dGVzKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ3JlYXRlcyBhIGNvcHkgb2YgdGhpcyB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZEFycmF5fSBUaGUgY2xvbmUuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBjbG9uZSA9IHg2NFdvcmRBcnJheS5jbG9uZSgpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGNsb25lOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIHZhciBjbG9uZSA9IEJhc2UuY2xvbmUuY2FsbCh0aGlzKTtcblxuXHQgICAgICAgICAgICAvLyBDbG9uZSBcIndvcmRzXCIgYXJyYXlcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gY2xvbmUud29yZHMgPSB0aGlzLndvcmRzLnNsaWNlKDApO1xuXG5cdCAgICAgICAgICAgIC8vIENsb25lIGVhY2ggWDY0V29yZCBvYmplY3Rcblx0ICAgICAgICAgICAgdmFyIHdvc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W4gc2VsZixcbiAgICAgICAgICBpdGVyYWJsZTogJ1N5bWJvbCcgaW4gc2VsZiAmJiAnaXRlcmF0b3InIGluIFN5bWJvbCxcbiAgICAgICAgICBibG9iOiAnRmlsZVJlYWRlcicgaW4gc2VsZiAmJiAnQmxvYicgaW4gc2VsZiAmJiAoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICBuZXcgQmxvYigpXG4gICAgICAgICAgICAgIHJldHVybiB0cnVlXG4gICAgICAgICAgICB9IGNhdGNoKGUpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSkoKSxcbiAgICAgICAgICBmb3JtRGF0YTogJ0Zvcm1EYXRhJyBpbiBzZWxmLFxuICAgICAgICAgIGFycmF5QnVmZmVyOiAnQXJyYXlCdWZmZXInIGluIHNlbGZcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChzdXBwb3J0LmFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgdmFyIHZpZXdDbGFzc2VzID0gW1xuICAgICAgICAgICAgJ1tvYmplY3QgSW50OEFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBVaW50OEFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBVaW50OENsYW1wZWRBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgSW50MTZBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgVWludDE2QXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IEludDMyQXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IFVpbnQzMkFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBGbG9hdDMyQXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IEZsb2F0NjRBcnJheV0nXG4gICAgICAgICAgXVxuXG4gICAgICAgICAgdmFyIGlzRGF0YVZpZXcgPSBmdW5jdGlvbihvYmopIHtcbiAgICA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AgICAgdGhpcy5mb3JFYWNoKGZ1bmN0aW9uKHZhbHVlLCBuYW1lKSB7IGl0ZW1zLnB1c2goW25hbWUsIHZhbHVlXSkgfSlcbiAgICAgICAgICByZXR1cm4gaXRlcmF0b3JGb3IoaXRlbXMpXG4gICAgICAgIH1cblxuICAgICAgICBpZiAoc3VwcG9ydC5pdGVyYWJsZSkge1xuICAgICAgICAgIEhlYWRlcnMucHJvdG90eXBlW1N5bWJvbC5pdGVyYXRvcl0gPSBIZWFkZXJzLnByb3RvdHlwZS5lbnRyaWVzXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBjb25zdW1lZChib2R5KSB7XG4gICAgICAgICAgaWYgKGJvZHkuYm9keVVzZWQpIHtcbiAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlamVjdChuZXcgVHlwZUVycm9yKCdBbHJlYWR5IHJlYWQnKSlcbiAgICAgICAgICB9XG4gICAgICAgICAgYm9keS5ib2R5VXNlZCA9IHRydWVcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGZpbGVSZWFkZXJSZWFkeShyZWFkZXIpIHtcbiAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICByZWFkZXIub25sb2FkID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJlc29sdmUocmVhZGVyLnJlc3VsdClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlYWRlci5vbmVycm9yID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJlamVjdChyZWFkZXIuZXJyb3IpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlYWRCbG9iQXNBcnJheUJ1ZmZlcihibG9iKSB7XG4gICAgICAgICAgdmFyIHJlYWRlciA9IG5ldyBGaWxlUmVhZGVyKClcbiAgICAgICAgICB2YXIgcHJvbWlzZSA9IGZpbGVSZWFkZXJSZWFkeShyZWFkZXIpXG4gICAgICAgICAgcmVhZGVyLnJlYWRBc0FycmF5QnVmZmVyKGJsb2IpXG4gICAgICAgICAgcmV0dXJuIHByb21pc2VcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlYWRCbG9iQXNUZXh0KGJsb2IpIHtcbiAgICAgICAgICB2YXIgcmVhZGVyID0gbmV3IEZpbGVSZWFkZXIoKVxuICAgICAgICAgIHZhciBwcm9taXNlID0gZmlsZVJlYWRlclJlYWR5KHJlYWRlcilcbiAgICAgICAgICByZWFkZXIucmVhZEFzVGV4dChibG9iKVxuICAgICAgICAgIHJldHVybiBwcm9taXNlXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiByZWFkQXJyYXlCdWZmZXJBc1RleHQoYnVmKSB7XG4gICAgICAgICAgdmFyIHZpZXcgPSBuZXcgVWludDhBcnJheShidWYpXG4gICAgICAgICAgdmFyIGNoYXJzID0gbmV3IEFycmF5KHZpZXcubGVuZ3RoKVxuXG4gICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB2aWV3Lmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBjaGFyc1tpXSA9IFN0cmluZy5mcm9tQ2hhckNvZGUodmlld1tpXSlcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIGNoYXJzLmpvaW4oJycpXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBidWZmZXJDbG9uZShidWYpIHtcbiAgICAgICAgICBpZiAoYnVmLnNsaWNlKSB7XG4gICAgICAgICAgICByZXR1cm4gYnVmLnNsaWNlKDApXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciB2aWV3ID0gbmV3IFVpbnQ4QXJyYXkoYnVmLmJ5dGVMZW5ndGgpXG4gICAgICAgICAgICB2aWV3LnNldChuZXcgVWludDhBcnJheShidWYpKVxuICAgICAgICAgIC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lwZU9mKGJvZHkpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5oZWFkZXJzLnNldCgnY29udGVudC10eXBlJywgJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZDtjaGFyc2V0PVVURi04JylcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChzdXBwb3J0LmJsb2IpIHtcbiAgICAgICAgICAgIHRoaXMuYmxvYiA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICB2YXIgcmVqZWN0ZWQgPSBjb25zdW1lZCh0aGlzKVxuICAgICAgICAgICAgICBpZiAocmVqZWN0ZWQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0ZWRcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGlmICh0aGlzLl9ib2R5QmxvYikge1xuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keUJsb2IpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShuZXcgQmxvYihbdGhpcy5fYm9keUFycmF5QnVmZmVyXSkpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUZvcm1EYXRhKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdjb3VsZCBub3QgcmVhZCBGb3JtRGF0YSBib2R5IGFzIGJsb2InKVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUobmV3IEJsb2IoW3RoaXMuX2JvZHlUZXh0XSkpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5hcnJheUJ1ZmZlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBpZiAodGhpcy5fYm9keUFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbnN1bWVkKHRoaXMpIHx8IFByb21pc2UucmVzb2x2ZSh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpXG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuYmxvYigpLnRoZW4ocmVhZEJsb2JBc0FycmF5QnVmZmVyKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGhpcy50ZXh0ID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgcmVqZWN0ZWQgPSBjb25zdW1lZCh0aGlzKVxuICAgICAgICAgICAgaWYgKHJlamVjdGVkKSB7XG4gICAgICAgICAgICAgIHJldHVybiByZWplY3RlZFxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy5fYm9keUJsb2IpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHJlYWRCbG9iQXNUZXh0KHRoaXMuX2JvZHlCbG9iKVxuICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShyZWFkQXJyYXlCdWZmZXJBc1RleHQodGhpcy5fYm9keUFycmF5QnVmZmVyKSlcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUZvcm1EYXRhKSB7XG4gICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignY291bGQgbm90IHJlYWQgRm9ybURhdGEgYm9keSBhcyB0ZXh0JylcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keVRleHQpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfV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keSByZWFkJylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMudXJsID0gaW5wdXQudXJsXG4gICAgICAgICAgICB0aGlzLmNyZWRlbnRpYWxzID0gaW5wdXQuY3JlZGVudGlhbHNcbiAgICAgICAgICAgIGlmICghb3B0aW9ucy5oZWFkZXJzKSB7XG4gICAgICAgICAgICAgIHRoaXMuaGVhZGVycyA9IG5ldyBIZWFkZXJzKGlucHV0LmhlYWRlcnMpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLm1ldGhvZCA9IGlucHV0Lm1ldGhvZFxuICAgICAgICAgICAgdGhpcy5tb2RlID0gaW5wdXQubW9kZVxuICAgICAgICAgICAgaWYgKCFib2R5ICYmIGlucHV0Ll9ib2R5SW5pdCAhPSBudWxsKSB7XG4gICAgICAgICAgICAgIGJvZHkgPSBpbnB1dC5fYm9keUluaXRcbiAgICAgICAgICAgICAgaW5wdXQuYm9keVVzZWQgPSB0cnVlXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMudXJsID0gU3RyaW5nKGlucHV0KVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHRoaXMuY3JlZGVudGlhbHMgPSBvcHRpb25zLmNyZWRlbnRpYWxzIHx8IHRoaXMuY3JlZGVudGlhbHMgfHwgJ29taXQnXG4gICAgICAgICAgaWYgKG9wdGlvbnMuaGVhZGVycyB8fCAhdGhpcy5oZWFkZXJzKSB7XG4gICAgICAgICAgICB0aGlzLmhlYWRlcnMgPSBuZXcgSGVhZGVycyhvcHRpb25zLmhlYWRlcnMpXG4gICAgICAgICAgfVxuICAgICAgICAgIHRoaXMubWV0aG9kID0gbm9ybWFsaXplTWV0aG9kKG9wdGlvbnMubWV0aG9kIHx8IHRoaXMubWV0aG9kIHx8ICdHRVQnKVxuICAgICAgICAgIHRoaXMubW9kZSA9IG9wdGlvbnMubW9kZSB8fCB0aGlzLm1vZGUgfHwgbnVsbFxuICAgICAgICAgIHRoaXMucmVmZXJyZXIgPSBudWxsXG5cbiAgICAgICAgICBpZiAoKHRoaXMubWV0aG9kID09PSAnR0VUJyB8fCB0aGlzLm1ldGhvZCA9PT0gJ0hFQUQnKSAmJiBib2R5KSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdCb2R5IG5vdCBhbGxvd2VkIGZvciBHRVQgb3IgSEVBRCByZXF1ZXN0cycpXG4gICAgICAgICAgfVxuICAgICAgICAgIHRoaXMuX2luaXRCb2R5KGJvZHkpXG4gICAgICAgIH1cblxuICAgICAgICBSZXF1ZXN0LnByb3RvdHlwZS5jbG9uZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiBuZXcgUmVxdWVzdCh0aGlzLCB7IGJvZHk6IHRoaXMuX2JvZHlJbml0IH0pXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBkZWNvZGUoYm9keSkge1xuICAgICAgICAgIHZhciBmb3JtID0gbmV3IEZvcm1EYXRhKClcbiAgICAgICAgICBib2R5LnRyaW0oKS5zcGxpdCgnJicpLmZvckVhY2goZnVuY3Rpb24oYnl0ZXMpIHtcbiAgICAgICAgICAgIGlmIChieXRlcykge1xuICAgICAgICAgICAgICB2YXIgc3BsaXQgPSBieXRlcy5zcGxpdCgnPScpXG4gICAgICAgICAgICAgIHZhciBuYW1lID0gc3BsaXQuc2hpZnQoKS5yZXBsYWNlKC9cXCsvZywgJyAnKVxuICAgICAgICAgICAgICB2YXIgdmFsdWUgPSBzcGxpdC5qb2luKCc9JykucmVwbGFjZSgvXFwrL2csICcgJylcbiAgICAgICAgICAgICAgZm9ybS5hcHBlbmQoZGVjb2RlVVJJQ29tcG9uZW50KG5hbWUpLCBkZWNvZGVVUklDb21wb25lbnQodmFsdWUpKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmV0dXJuIGZvcm1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHBhcnNlSGVhZGVycyhyYXdIZWFkZXJzKSB7XG4gICAgICAgICAgdmFyIGhlYWRlcnMgPSBuZXcgSGVhZGVycygpXG4gICAgICAgICAgcmF3SGVhZGVycy5zcGxpdCgvXFxyP1xcbi8pLmZvckVhY2goZnVuY3Rpb24obGluZSkge1xuICAgICAgICAgICAgdmFyIHBhcnRzID0gbGluZS5zcGxpdCgnOicpXG4gICAgICAgICAgICB2YXIga2V5ID0gcGFydHMuc2hpZnQoKS50cmltKClcbiAgICAgICAgICAgIGlmIChrZXkpIHtcbiAgICAgICAgICAgICAgdmFyIHZhbHVlID0gcGFydHMuam9pbignOicpLnRyaW0oKVxuICAgICAgICAgICAgICBoZWFkZXJzLmFwcGVuZChrZXksIHZhbHVlKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmV0dXJuIGhlYWRlcnNcbiAgICAgICAgfVxuXG4gICAgICAgIEJvZHkuY2FsbChSZXF1ZXN0LnByb3RvdHlwZSlcblxuICAgICAgICBmdW5jdGlvbiBSZXNwb25zZShib2R5SW5pdCwgb3B0aW9ucykge1xuICAgICAgICAgIGlmICghb3B0aW9ucykge1xuICAgICAgICAgICAgb3B0aW9ucyA9IHt9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGhpcy50eXBlID0gJ2RlZmF1bHQnXG4gICAgICAgICAgdGhpcy5zdGF0dXMgPSAnc3RhdHVzJyBpbiBvcHRpb25zID8gb3B0aW9ucy5zdGF0dXMgOiAyMDBcbiAgICAgICAgICB0aGlzLm9rID0gdGhpcy5zdGF0dXMgPj0gMjAwICYmIHRoaXMuc3RhdHVzIDwgMzAwXG4gICAgICAgICAgdGhpcy5zdGF0dXNUZXh0ID0gJ3N0YXR1c1RleHQnIGluIG9wdGlvbnMgPyBvcHRpb25zLnN0YXR1c1RleHQgOiAnT0snXG4gICAgICAgICAgdGhpcy5oZWFkZXJzID0gbmV3IEhlYWRlcnMob3B0aW9ucy5oZWFkZXJ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KG5ldyBSZXNwb25zZShib2R5LCBvcHRpb25zKSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgeGhyLm9uZXJyb3IgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmVqZWN0KG5ldyBUeXBlRXJyb3IoJ05ldHdvcmsgcmVxdWVzdCBmYWlsZWQnKSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgeGhyLm9udGltZW91dCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICByZWplY3QobmV3IFR5cGVFcnJvcignTmV0d29yayByZXF1ZXN0IGZhaWxlZCcpKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB4aHIub3BlbihyZXF1ZXN0Lm1ldGhvZCwgcmVxdWVzdC51cmwsIHRydWUpXG5cbiAgICAgICAgICAgIGlmIChyZXF1ZXN0LmNyZWRlbnRpYWxzID09PSAnaW5jbHVkZScpIHtcbiAgICAgICAgICAgICAgeGhyLndpdGhDcmVkZW50aWFscyA9IHRydWVcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCdyZXNwb25zZVR5cGUnIGluIHhociAmJiBzdXBwb3J0LmJsb2IpIHtcbiAgICAgICAgICAgICAgeGhyLnJlc3BvbnNlVHlwZSA9ICdibG9iJ1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXF1ZXN0LmhlYWRlcnMuZm9yRWFjaChmdW5jdGlvbih2YWx1ZSwgbmFtZSkge1xuICAgICAgICAgICAgICB4aHIuc2V0UmVxdWVzdEhlYWRlcihuYW1lLCB2YWx1ZSlcbiAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgIHhoci5zZW5kKHR5cGVvZiByZXF1ZXN0Ll9ib2R5SW5pdCA9PT0gJ3VuZGVmaW5lZCcgPyBudWxsIDogcmVxdWVzdC5fYm9keUluaXQpXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuICAgICAgICBzZWxmLmZldGNoLnBvbHlmaWxsID0gdH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o7XG59O1xuXG52YXIgcGFyc2VPYmplY3QgPSBmdW5jdGlvbiAoY2hhaW4sIHZhbCwgb3B0aW9ucykge1xuICAgIHZhciBsZWFmID0gdmFsO1xuXG4gICAgZm9yICh2YXIgaSA9IGNoYWluLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBvYmo7XG4gICAgICAgIHZhciByb290ID0gY2hhaW5baV07XG5cbiAgICAgICAgaWYgKHJvb3QgPT09ICdbXScpIHtcbiAgICAgICAgICAgIG9iaiA9IFtdO1xuICAgICAgICAgICAgb2JqID0gb2JqLmNvbmNhdChsZWFmKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9iaiA9IG9wdGlvbnMucGxhaW5PYmplY3RzID8gT2JqZWN0LmNyZWF0ZShudWxsKSA6IHt9O1xuICAgICAgICAgICAgdmFyIGNsZWFuUm9vdCA9IHJvb3QuY2hhckF0KDApID09PSAnWycgJiYgcm9vdC5jaGFyQXQocm9vdC5sZW5ndGggLSAxKSA9PT0gJ10nID8gcm9vdC5zbGljZSgxLCAtMSkgOiByb290O1xuICAgICAgICAgICAgdmFyIGluZGV4ID0gcGFyc2VJbnQoY2xlYW5Sb290LCAxMCk7XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgIWlzTmFOKGluZGV4KVxuICAgICAgICAgICAgICAgICYmIHJvb3QgIT09IGNsZWFuUm9vdFxuICAgICAgICAgICAgICAgICYmIFN0cmluZyhpbmRleCkgPT09IGNsZWFuUm9vdFxuICAgICAgICAgICAgICAgICYmIGluZGV4ID49IDBcbiAgICAgICAgICAgICAgICAmJiAob3B0aW9ucy5wYXJzZUFycmF5cyAmJiBpbmRleCA8PSBvcHRpb25zLmFycmF5TGltaXQpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBvYmogPSBbXTtcbiAgICAgICAgICAgICAgICBvYmpbaW5kZXhdID0gbGVhZjtcbiAgICAgICAgICAgIH0gZ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aWVzXG4gICAgICAgIGlmICghb3B0aW9ucy5wbGFpbk9iamVjdHMgJiYgaGFzLmNhbGwoT2JqZWN0LnByb3RvdHlwZSwgcGFyZW50KSkge1xuICAgICAgICAgICAgaWYgKCFvcHRpb25zLmFsbG93UHJvdG90eXBlcykge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGtleXMucHVzaChwYXJlbnQpO1xuICAgIH1cblxuICAgIC8vIExvb3AgdGhyb3VnaCBjaGlsZHJlbiBhcHBlbmRpbmcgdG8gdGhlIGFycmF5IHVudGlsIHdlIGhpdCBkZXB0aFxuXG4gICAgdmFyIGkgPSAwO1xuICAgIHdoaWxlICgoc2VnbWVudCA9IGNoaWxkLmV4ZWMoa2V5KSkgIT09IG51bGwgJiYgaSA8IG9wdGlvbnMuZGVwdGgpIHtcbiAgICAgICAgaSArPSAxO1xuICAgICAgICBpZiAoIW9wdGlvbnMucGxhaW5PYmplY3RzICYmIGhhcy5jYWxsKE9iamVjdC5wcm90b3R5cGUsIHNlZ21lbnRbMV0uc2xpY2UoMSwgLTEpKSkge1xuICAgICAgICAgICAgaWYgKCFvcHRpb25zLmFsbG93UHJvdG90eXBlcykge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBrZXlzLnB1c2goc2VnbWVudFsxXSk7XG4gICAgfVxuXG4gICAgLy8gSWYgdGhlcmUncyBhIHJlbWFpbmRlciwganVzdCBhZGQgd2hhdGV2ZXIgaXMgbGVmdFxuXG4gICAgaWYgKHNlZ21lbnQpIHtcbiAgICAgICAga2V5cy5wdXNoKCdbJyArIGtleS5zbGljZShzZWdtZW50LmluZGV4KSArICddJyk7XG4gICAgfVxuXG4gICAgcmV0dXJuIHBhcnNlT2JqZWN0KGtleXMsIHZhbCwgb3B0aW9ucyk7XG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0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leXM7XG4gICAgaWYgKEFycmF5LmlzQXJyYXkoZmlsdGVyKSkge1xuICAgICAgICBvYmpLZXlzID0gZmlsdGVyO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHZhciBrZXlzID0gT2JqZWN0LmtleXMob2JqKTtcbiAgICAgICAgb2JqS2V5cyA9IHNvcnQgPyBrZXlzLnNvcnQoc29ydCkgOiBrZXlzO1xuICAgIH1cblxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb2JqS2V5cy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIga2V5ID0gb2JqS2V5c1tpXTtcblxuICAgICAgICBpZiAoc2tpcE51bGxzICYmIG9ialtrZXldID09PSBudWxsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9iaikpIHtcbiAgICAgICAgICAgIHZhbHVlcyA9IHZhbHVlcy5jb25jYXQoc3RyaW5naWZ5KFxuICAgICAgICAgICAgICAgIG9ialtrZXldLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgocHJlZml4LCBrZXkpLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICAgICAgc3RyaWN0TnVsbEhhbmRsaW5nLFxuICAgICAgICAgICAgICAgIHNraXBOdWxscyxcbiAgICAgICAgICAgICAgICBlbmNvZGVyLFxuICAgICAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgICAgICBzb3J0LFxuICAgICAgICAgICAgICAgIGFsbG93RG90cyxcbiAgICAgICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgICAgIGZvcm1hdHRlcixcbiAgICAgICAgICAgICAgICBlbmNvZGVWYWx1ZXNPbmx5XG4gICAgICAgICAgICApKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhbHVlcyA9IHZhbHVlcy5jb25jYXQoc3RyaW5naWZ5KFxuICAgICAgICAgICAgICAgIG9ialtrZXldLFxuICAgICAgICAgICAgICAgIHByZWZpeCArIChhbGxvd0RvdHMgPyAnLicgKyBrZXkgOiAnWycgKyBrZXkgKyAnXScpLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICAgICAgc3RyaWN0TnVsbEhhbmRsaW5nLFxuICAgICAgICAgICAgICAgIHNraXBOdWxscyxcbiAgICAgICAgICAgICAgICBlbmNvZGVyLFxuICAgICAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgICAgICBzb3J0LFxuICAgICAgICAgICAgICAgIGFsbG93RG90cyxcbiAgICAgICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgICAgIGZvcm1hdHRlcixcbiAgICAgICAgICAgICAgICBlbmNvZGVWYWx1ZXNPbmx5XG4gICAgICAgICAgICApKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiB2YWx1ZXM7XG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChvYmplY3QsIG9wdHMpIHtcbiAgICB2YXIgb2JqID0gb2JqZWN0O1xuICAgIHZhciBvcHRpb25zID0gb3B0cyA/IHV0aWxzLmFzc2lnbih7fSwgb3B0cykgOiB7fTtcblxuICAgIGlmIChvcHRpb25zLmVuY29kZXIgIT09IG51bGwgJiYgb3B0aW9ucy5lbmNvZGVyICE9PSB1bmRlZmluZWQgJiYgdHlwZW9mIG9wdGlvbnMuZW5jb2RlciAhPT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdFbmNvZGVyIGhhcyB0byBiZSBhIGZ1bmN0aW9uLicpO1xuICAgIH1cblxuICAgIHZhciBkZWxpbWl0ZXIgPSB0eXBlb2Ygb3B0aW9ucy5kZWxpbWl0ZXIgPT09ICd1bmRlZmluZWQnID8gZGVmYXVsdHMuZGVsaW1p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YXRvcnMpIHtcbiAgICAgICAgYXJyYXlGb3JtYXQgPSBvcHRpb25zLmFycmF5Rm9ybWF0O1xuICAgIH0gZWxzZSBpZiAoJ2luZGljZXMnIGluIG9wdGlvbnMpIHtcbiAgICAgICAgYXJyYXlGb3JtYXQgPSBvcHRpb25zLmluZGljZXMgPyAnaW5kaWNlcycgOiAncmVwZWF0JztcbiAgICB9IGVsc2Uge1xuICAgICAgICBhcnJheUZvcm1hdCA9ICdpbmRpY2VzJztcbiAgICB9XG5cbiAgICB2YXIgZ2VuZXJhdGVBcnJheVByZWZpeCA9IGFycmF5UHJlZml4R2VuZXJhdG9yc1thcnJheUZvcm1hdF07XG5cbiAgICBpZiAoIW9iaktleXMpIHtcbiAgICAgICAgb2JqS2V5cyA9IE9iamVjdC5rZXlzKG9iaik7XG4gICAgfVxuXG4gICAgaWYgKHNvcnQpIHtcbiAgICAgICAgb2JqS2V5cy5zb3J0KHNvcnQpO1xuICAgIH1cblxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb2JqS2V5cy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIga2V5ID0gb2JqS2V5c1tpXTtcblxuICAgICAgICBpZiAoc2tpcE51bGxzICYmIG9ialtrZXldID09PSBudWxsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGtleXMgPSBrZXlzLmNvbmNhdChzdHJpbmdpZnkoXG4gICAgICAgICAgICBvYmpba2V5XSxcbiAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICBzdHJpY3ROdWxsSGFuZGxpbmcsXG4gICAgICAgICAgICBza2lwTnVsbHMsXG4gICAgICAgICAgICBlbmNvZGUgPyBlbmNvZGVyIDogbnVsbCxcbiAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgIHNvcnQsXG4gICAgICAgICAgICBhbGxvd0RvdHMsXG4gICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgZm9ybWF0dGVyLFxuICAgICAgICAgICAgZW5jb2RlVmFsdWVzT25seVxuICAgICAgICApKTtcbiAgICB9XG5cbiAgICB2YXIgam9pbmVkID0ga2V5cy5qb2luKGRlbGltaXRlcik7XG4gICAgdmFyIHByZWZpeCA9IG9wdGlvbnMuYWRkUXVlcnlQcmVmaXggPT09IHRydWUgPyAnPycgOiAnJztcblxuICAgIHJldHVybiBqb2luZWQubGVuZ3RoID4gMCA/IHByZWZpeCArIGpvaW5lZCA6ICcnO1xufTtcbiIsIid1c2Ugc3RyaWN0JztcblxudmFyIGhhcyA9IE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHk7XG5cbnZhciBoZXhUYWJsZSA9IChmdW5jdGlvbiAoKSB7XG4gICAgdmFyIGFycmF5ID0gW107XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCAyNTY7ICsraSkge1xuICAgICAgICBhcnJheS5wdXNoKCclJyArICgoaSA8IDE2ID8gJzAnIDogJycpICsgaS50b1N0cmluZygxNikpLnRvVXBwZXJDYXNlKCkpO1xuICAgIH1cblxuICAgIHJldHVybiBhcnJheTtcbn0oKSk7XG5cbnZhciBjb21wYWN0UXVldWUgPSBmdW5jdGlvbiBjb21wYWN0UXVldWUocXVldWUpIHtcbiAgICB2YXIgb2JqO1xuXG4gICAgd2hpbGUgKHF1ZXVlLmxlbmd0aCkge1xuICAgICAgICB2YXIgaXRlbSA9IHF1ZXVlLnBvcCgpO1xuICAgICAgICBvYmogPSBpdGVtLm9ialtpdGVtLnByb3BdO1xuXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9iaikpIHtcbiAgICAgICAgICAgIHZhciBjb21wYWN0ZWQgPSBbXTtcblxuICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBvYmoubGVuZ3RoOyArK2opIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9ialtqXSAhPT0gJ3V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3cml0dGVuIGJ5IEJyaWFuIFdoaXRlIChtc2NkZXgpIGZvciB0aGUgaW8uanMgY29yZSBxdWVyeXN0cmluZyBsaWJyYXJ5LlxuICAgIC8vIEl0IGhhcyBiZWVuIGFkYXB0ZWQgaGVyZSBmb3Igc3RyaWN0ZXIgYWRoZXJlbmNlIHRvIFJGQyAzOTg2XG4gICAgaWYgKHN0ci5sZW5ndGggPT09IDApIHtcbiAgICAgICAgcmV0dXJuIHN0cjtcbiAgICB9XG5cbiAgICB2YXIgc3RyaW5nID0gdHlwZW9mIHN0ciA9PT0gJ3N0cmluZycgPyBzdHIgOiBTdHJpbmcoc3RyKTtcblxuICAgIHZhciBvdXQgPSAnJztcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0cmluZy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIgYyA9IHN0cmluZy5jaGFyQ29kZUF0KGkpO1xuXG4gICAgICAgIGlmIChcbiAgICAgICAgICAgIGMgPT09IDB4MkQgLy8gLVxuICAgICAgICAgICAgfHwgYyA9PT0gMHgyRSAvLyAuXG4gICAgICAgICAgICB8fCBjID09PSAweDVGIC8vIF9cbiAgICAgICAgICAgIHx8IGMgPT09IDB4N0UgLy8gflxuICAgICAgICAgICAgfHwgKGMgPj0gMHgzMCAmJiBjIDw9IDB4MzkpIC8vIDAtOVxuICAgICAgICAgICAgfHwgKGMgPj0gMHg0MSAmJiBjIDw9IDB4NUEpIC8vIGEtelxuICAgICAgICAgICAgfHwgKGMgPj0gMHg2MSAmJiBjIDw9IDB4N0EpIC8vIEEtWlxuICAgICAgICApIHtcbiAgICAgICAgICAgIG91dCArPSBzdHJpbmcuY2hhckF0KGkpO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4ODApIHtcbiAgICAgICAgICAgIG91dCA9IG91dCArIGhleFRhYmxlW2NdO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4ODAwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyAoaGV4VGFibGVbMHhDMCB8IChjID4+IDYpXSArIGhleFRhYmxlWzB4ODAgfCAoYyAmIDB4M0YpXSk7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjIDwgMHhEODAwIHx8IGMgPj0gMHhFMDAwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyAoaGV4VGFibGVbMHhFMCB8IChjID4+IDEyKV0gKyBoZXhUYWJsZVsweDgwIHwgKChjID4+IDYpICYgMHgzRildICsgaGV4VGFibGVbMHg4MCB8IChjICYgMHgzRildKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaSArPSAxO1xuICAgICAgICBjID0gMHgxMDAwMCArICgoKGMgJiAweDNGRikgPDwgMTApIHwgKHN0cmluZy5jaGFyQ29kZUF0KGkpICYgMHgzRkYpKTtcbiAgICAgICAgb3V0ICs9IGhleFRhYmxlWzB4RjAgfCAoYyA+PiAxOCldXG4gICAgICAgICAgICArIGhleFRhYmxlWzB4ODAgfCAoKGMgPj4gMTIpICYgMHgzRildXG4gICAgICAgICAgICArIGhleFRhYmxlWzB4ODAgfCAoKGMgPj4gNikgJiAweDNGKV1cbiAgICAgICAgICAgICsgaGV4VGFibGVbMHg4MCB8IChjICYgMHgzRildO1xuICAgIH1cblxuICAgIHJldHVybiBvdXQ7XG59O1xuXG5leHBvcnRzLmNvbXBhY3QgPSBmdW5jdGlvbiBjb21wYWN0KHZhbHVlKSB7XG4gICAgdmFyIHF1ZXVlID0gW3sgb2JqOiB7IG86IHZhbHVlIH0sIHByb3A6ICdvJyB9XTtcbiAgICB2YXIgcmVmcyA9IFtdO1xuXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBxdWV1ZS5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIgaXRlbSA9IHF1ZXVlW2ldO1xuICAgICAgICB2YXIgb2JqID0gaXRlbS5vYmpbaXRlbS5wcm9wXTtcblxuICAgICAgICB2YXIga2V5cyA9IE9iamVjdC5rZXlzKG9iaik7XG4gICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwga2V5cy5sZW5ndGg7ICsraikge1xuICAgICAgICAgICAgdmFyIGtleSA9IGtleXNbal07XG4gICAgICAgICAgICB2YXIgdmFsID0gb2JqW2tleV07XG4gICAgICAgICAgICBpZiAodHlwZW9mIHZhbCA9PT0gJ29iamVjdCcgJiYgdmFsICE9PSBudWxsICYmIHJlZnMuaW5kZXhPZih2YWwpID09PSAtMSkge1xuICAgICAgICAgICAgICAgIHF1ZXVlLnB1c2goeyBvYmo6IG9iaiwgcHJvcDoga2V5IH0pO1xuICAgICAgICAgICAgICAgIHJlZnMucHVzaCh2YWwpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGNvbXBhY3RRdWV1ZShxdWV1ZSk7XG59O1xuXG5leHBvcnRzLmlzUmVnRXhwID0gZnVuY3Rpb24gaXNSZWdFeHAob2JqKSB7XG4gICAgcmV0dXJuIE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChvYmopID09PSAnW29iamVjdCBSZWdFeHBdJztcbn07XG5cbmV4cG9ydHMuaXNCdWZmZXIgPSBmdW5jdGlvbiBpc0J1ZmZlcihvYmopIHtcbiAgICBpZiAob2JqID09PSBudWxsIHx8IHR5cGVvZiBvYmogPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG5cbiAgICByZXR1cm4gISEob2JqLmNvbnN0cnVjdG9yICYmIG9iai5jb25zdHJ1Y3Rvci5pc0J1ZmZlciAmJiBvYmouY29uc3RydWN0b3IuaXNCdWZmZXIob2JqKSk7XG59O1xuIl19 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5v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cmUgKCcuL2pzL2FueHByby5qcycpLFxuICAgICdiaWJveCc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpYm94LmpzJyksXG4gICAgJ2JpbmFuY2UnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYmluYW5jZS5qcycpLFxuICAgICdiaXQyYyc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdDJjLmpzJyksXG4gICAgJ2JpdGJhbmsnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0YmFuay5qcycpLFxuICAgICdiaXRiYXknOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGJheS5qcycpLFxuICAgICdiaXRmaW5leCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGZpbmV4LmpzJyksXG4gICAgJ2JpdGZpbmV4Mic6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0ZmluZXgyLmpzJyksXG4gICAgJ2JpdGZseWVyJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0Zmx5ZXIuanMnKSxcbiAgICAnYml0aHVtYic6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRodW1iLmpzJyksXG4gICAgJ2JpdGtrJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0a2suanMnKSxcbiAgICAnYml0bGlzaCc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRsaXNoLmpzJyksXG4gICAgJ2JpdG1hcmtldCc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0bWFya2V0LmpzJyksXG4gICAgJ2JpdG1leCc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0bWV4LmpzJyksXG4gICAgJ2JpdHNvJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0c28uanMnKSxcbiAgICAnYml0c3RhbXAnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRzdGFtcC5qcycpLFxuICAgICdiaXRzdGFtcDEnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdHN0YW1wMS5qcycpLFxuICAgICdiaXR0cmV4JzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdHRyZXguanMnKSxcbiAgICAnYml0eic6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXR6LmpzJyksXG4gICAgJ2JsM3AnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYmwzcC5qcycpLFxuICAgICdibGV1dHJhZGUnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JsZXV0cmFkZS5qcycpLFxuICAgICdicmF6aWxpZXgnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JyYXppbGlleC5qcycpLFxuICAgICdidGNib3gnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y2JveC5qcycpLFxuICAgICdidGNjaGluYSc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y2NoaW5hLmpzJyksXG4gICAgJ2J0Y2V4Y2hhbmdlJzogICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjZXhjaGFuZ2UuanMnKSxcbiAgICAnYnRjbWFya2V0cyc6ICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGNtYXJrZXRzLmpzJyksXG4gICAgJ2J0Y3RyYWRlaW0nOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjdHJhZGVpbS5qcycpLFxuICAgICdidGN0cmFkZXVhJzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y3RyYWRldWEuanMnKSxcbiAgICAnYnRjdHVyayc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGN0dXJrLmpzJyksXG4gICAgJ2J0Y3gnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjeC5qcycpLFxuICAgICdieGludGgnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J4aW50aC5qcycpLFxuICAgICdjY2V4JzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NjZXguanMnKSxcbiAgICAnY2V4JzogICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jZXguanMnKSxcbiAgICAnY2hidGMnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jaGJ0Yy5qcycpLFxuICAgICdjaGlsZWJpdCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NoaWxlYml0LmpzJyksXG4gICAgJ2NvYmluaG9vZCc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29iaW5ob29kLmpzJyksXG4gICAgJ2NvaW5jaGVjayc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbmNoZWNrLmpzJyksXG4gICAgJ2NvaW5lZ2cnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbmVnZy5qcycpLFxuICAgICdjb2luZXgnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5leC5qcycpLFxuICAgICdjb2luZXhjaGFuZ2UnOiAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5leGNoYW5nZS5qcycpLFxuICAgICdjb2luZmxvb3InOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5mbG9vci5qcycpLFxuICAgICdjb2luZ2knOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5naS5qcycpLFxuICAgICdjb2lubWFya2V0Y2FwJzogICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5tYXJrZXRjYXAuanMnKSxcbiAgICAnY29pbm1hdGUnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jb2lubWF0ZS5qcycpLFxuICAgICdjb2lubmVzdCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5uZXN0LmpzJyksXG4gICAgJ2NvaW5vbmUnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbm9uZS5qcycpLFxuICAgICdjb2luc2VjdXJlJzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5zZWN1cmUuanMnKSxcbiAgICAnY29pbnNwb3QnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jb2luc3BvdC5qcycpLFxuICAgICdjb2ludGlnZXInOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW50aWdlci5qcycpLFxuICAgICdjb29sY29pbic6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2Nvb2xjb2luLmpzJyksXG4gICAgJ2NyeXB0b3BpYSc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY3J5cHRvcGlhLmpzJyksXG4gICAgJ2RzeCc6ICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZHN4LmpzJyksXG4gICAgJ2V0aGZpbmV4JzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZXRoZmluZXguanMnKSxcbiAgICAnZXhtbyc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9leG1vLmpzJyksXG4gICAgJ2V4eCc6ICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZXh4LmpzJyksXG4gICAgJ2Zsb3didGMnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZmxvd2J0Yy5qcycpLFxuICAgICdmb3hiaXQnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2ZveGJpdC5qcycpLFxuICAgICdmeWJzZSc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2Z5YnNlLmpzJyksXG4gICAgJ2Z5YnNnJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZnlic2cuanMnKSxcbiAgICAnZ2F0ZWNvaW4nOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9nYXRlY29pbi5qcycpLFxuICAgICdnYXRlaW8nOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dhdGVpby5qcycpLFxuICAgICdnZGF4JzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dkYXguanMnKSxcbiAgICAnZ2VtaW5pJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9nZW1pbmkuanMnKSxcbiAgICAnZ2V0YnRjJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9nZXRidGMuanMnKSxcbiAgICAnaGFkYXgnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9oYWRheC5qcycpLFxuICAgICdoaXRidGMnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2hpdGJ0Yy5qcycpLFxuICAgICdoaXRidGMyJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2hpdGJ0YzIuanMnKSxcbiAgICAnaHVvYmknOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9odW9iaS5qcycpLFxuICAgICdodW9iaWNueSc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2h1b2JpY255LmpzJyksXG4gICAgJ2h1b2JpcHJvJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvaHVvYmlwcm8uanMnKSxcbiAgICAnaWNlM3gnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9pY2UzeC5qcycpLFxuICAgICdpbmRlcGVuZGVudHJlc2VydmUnOiAgICAgIHJlcXVpcmUgKCcuL2pzL2luZGVwZW5kZW50cmVzZXJ2ZS5qcycpLFxuICAgICdpbmRvZGF4JzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2luZG9kYXguanMnKSxcbiAgICAnaXRiaXQnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9pdGJpdC5qcycpLFxuICAgICdqdWJpJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2p1YmkuanMnKSxcbiAgICAna3Jha2VuJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rcmFrZW4uanMnKSxcbiAgICAna3Vjb2luJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rdWNvaW4uanMnKSxcbiAgICAna3VuYSc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rdW5hLmpzJyksXG4gICAgJ2xha2VidGMnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbGFrZWJ0Yy5qcycpLFxuICAgICdsYmFuayc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2xiYW5rLmpzJyksXG4gICAgJ2xpcXVpJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbGlxdWkuanMnKSxcbiAgICAnbGl2ZWNvaW4nOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9saXZlY29pbi5qcycpLFxuICAgICdsdW5vJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2x1bm8uanMnKSxcbiAgICAnbHlra2UnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9seWtrZS5qcycpLFxuICAgICdtZXJjYWRvJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL21lcmNhZG8uanMnKSxcbiAgICAnbWl4Y29pbnMnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9taXhjb2lucy5qcycpLFxuICAgICduZWdvY2llY29pbnMnOiAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL25lZ29jaWVjb2lucy5qcycpLFxuICAgICdub3ZhJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL25vdmEuanMnKSxcbiAgICAnb2tjb2luY255JzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9va2NvaW5jbnkuanMnKSxcbiAgICAnb2tjb2ludXNkJzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9va2NvaW51c2QuanMnKSxcbiAgICAnb2tleCc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9va2V4LmpzJyksXG4gICAgJ3BheW1pdW0nOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvcGF5bWl1bS5qcycpLFxuICAgICdwb2xvbmlleCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3BvbG9uaWV4LmpzJyksXG4gICAgJ3FyeXB0b3MnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvcXJ5cHRvcy5qcycpLFxuICAgICdxdWFkcmlnYWN4JzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3F1YWRyaWdhY3guanMnKSxcbiAgICAncXVvaW5leCc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9xdW9pbmV4LmpzJyksXG4gICAgJ3NvdXRoeGNoYW5nZSc6ICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvc291dGh4Y2hhbmdlLmpzJyksXG4gICAgJ3N1cmJpdGNvaW4nOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvc3VyYml0Y29pbi5qcycpLFxuICAgICd0aGVyb2NrJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3RoZXJvY2suanMnKSxcbiAgICAndGlkZWJpdCc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy90aWRlYml0LmpzJyksXG4gICAgJ3RpZGV4JzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvdGlkZXguanMnKSxcbiAgICAndXJkdWJpdCc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy91cmR1Yml0LmpzJyksXG4gICAgJ3ZhdWx0b3JvJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvdmF1bHRvcm8uanMnKSxcbiAgICAndmJ0Yyc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy92YnRjLmpzJyksXG4gICAgJ3ZpcndveCc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvdmlyd294LmpzJyksXG4gICAgJ3dleCc6ICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvd2V4LmpzJyksXG4gICAgJ3hidGNlJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMveGJ0Y2UuanMnKSxcbiAgICAneW9iaXQnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy95b2JpdC5qcycpLFxuICAgICd5dW5iaSc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3l1bmJpLmpzJyksXG4gICAgJ3phaWYnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvemFpZi5qcycpLFxuICAgICd6Yic6ICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3piLmpzJyksICAgIFxufVxuXG4vLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gT2JqZWN0LmFzc2lnbiAoeyB2ZXJzaW9uLCBFeGNoYW5nZSwgZXhjaGFuZ2VzOiBPYmplY3Qua2V5cyAoZXhjaGFuZ2VzKSB9LCBleGNoYW5nZXMsIGZ1bmN0aW9ucywg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dmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnNjAnLCAvLyBub3Qgd29ya2luZyBmb3Igc29tZSByZWFzb24sIHJldHVybnMge1wic2VydmVyX3RpbWVcIjpcIjIwMTgtMDMtMjZUMDM6NTI6MjcuOTEyWlwiLFwiZXJyb3JcIjp0cnVlLFwid2FybmluZ1wiOmZhbHNlLFwicmVzcG9uc2VcIjpudWxsLFwiZXJyb3JfY29kZVwiOi0xLFwiZXJyb3JfbWVzc2FnZVwiOlwiRXJyb3Igd2hpbGUgdHJ5aW5nIHRvIGZldGNoIGhpc3RvcmljYWwgbWFya2V0IGRhdGEuIEFuIGludmFsaWQgcmVzb2x1dGlvbiB3YXMgcHJvYmFibHkgdXNlZC5cIn1cbiAgICAgICAgICAgICAgICAnMTVtJzogJzkwMCcsXG4gICAgICAgICAgICAgICAgJzFoJzogJzM2MDAnLFxuICAgICAgICAgICAgICAgICcxZCc6ICc4NjQwMCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjAyMS00MjBiZDlmYy01ZWNiLTExZTctOGVkNi01NmQwMDgxZWZlZDIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vMWJyb2tlci5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vMWJyb2tlci5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly8xYnJva2VyLmNvbS8/Yz1lbi9jb250ZW50L2FwaS1kb2N1bWVudGF0aW9uJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvYmFycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2NhdGVnb3JpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9kZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3F1b3RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3RpY2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2Nsb3NlX2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vZWRpdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vb3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vc2hhcmVkL2dldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc29jaWFsL3Byb2ZpbGVfc3RhdGlzdGljcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc29jaWFsL3Byb2ZpbGVfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2JpdGNvaW5fZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2RldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3ZlcnZpZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcXVvdGFfc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3RyYW5zYWN0aW9uX2xvZycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQ2F0ZWdvcmllcyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldE1hcmtldENhdGVnb3JpZXMgKCk7XG4gICAgICAgIC8vIHRoZXkgcmV0dXJuIGFuIGVtcHR5IHN0cmluZyBhbW9uZyB0aGVpciBjYXRlZ29yaWVzLCB3dGY/XG4gICAgICAgIGxldCBjYXRlZ29yaWVzID0gcmVzcG9uc2VbJ3Jlc3BvbnNlJ107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjYXRlZ29yaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBpZiAoY2F0ZWdvcmllc1tpXSlcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAoY2F0ZWdvcmllc1tpXSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgdGhpc18gPSB0aGlzOyAvLyB3b3JrYXJvdW5kIGZvciBCYWJlbCBidWcgKG5vdCBwYXNzaW5nIGB0aGlzYCB0byBfcmVjdXJzaXZlKCkgY2FsbClcbiAgICAgICAgbGV0IGNhdGVnb3JpZXMgPSBhd2FpdCB0aGlzLmZldGNoQ2F0ZWdvcmllcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGNhdGVnb3JpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgIGxldCBjYXRlZ29yeSA9IGNhdGVnb3JpZXNbY107XG4gICAgICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXNfLnByaXZhdGVHZXRNYXJrZXRMaXN0ICh7XG4gICAgICAgICAgICAgICAgJ2NhdGVnb3J5JzogY2F0ZWdvcnkudG9Mb3dlckNhc2UgKCksXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1sncmVzcG9uc2UnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydyZXNwb25zZSddW3BdO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgaWYgKChjYXRlZ29yeSA9PT0gJ0ZPUkVYJykgfHwgKGNhdGVnb3J5ID09PSAnQ1JZUFRPJykpIHtcbiAgICAgICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICAgICAgICAgIGxldCBwYXJ0cyA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgICAgICAgICAgYmFzZSA9IHBhcnRzWzBdO1xuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9IHBhcnRzWzFdO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGJhc2UgPSBpZDtcbiAgICAgICAgICAgICAgICAgICAgcXVvdGUgPSAnVVNEJztcbiAgICAgICAgICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBiYXNlID0gdGhpc18uY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IHRoaXNfLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRVc2VyT3ZlcnZpZXcgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGJhbGFuY2VbJ3Jlc3BvbnNlJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA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uc2FmZUZsb2F0IChvcmRlcmJvb2ssICdhc2snKTtcbiAgICAgICAgbGV0IGJpZCA9IFsgYmlkUHJpY2UsIHVuZGVmaW5lZCBdO1xuICAgICAgICBsZXQgYXNrID0gWyBhc2tQcmljZSwgdW5kZWZpbmVkIF07XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2JpZHMnOiBbIGJpZCBdLFxuICAgICAgICAgICAgJ2Fza3MnOiBbIGFzayBdLFxuICAgICAgICAgICAgJ25vbmNlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wpIHtcbiAgICAgICAgdGhyb3cgbmV3IE5vdFN1cHBvcnRlZCAodGhpcy5pZCArICcgZmV0Y2hUcmFkZXMgKCkgbWV0aG9kIG5vdCBpbXBsZW1lbnRlZCB5ZXQnKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0TWFya2V0QmFycyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ3Jlc29sdXRpb24nOiA2MCxcbiAgICAgICAgICAgICdsaW1pdCc6IDEsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzdWx0WydyZXNwb25zZSddWzBdO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRpY2tlclsnZGF0ZSddKTtcbiAgICAgICAgbGV0IG9wZW4gPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbycpO1xuICAgICAgICBsZXQgY2xvc2UgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYycpO1xuICAgICAgICBsZXQgY2hhbmdlID0gY2xvc2UgLSBvcGVuO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdoJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2wnKSxcbiAgICAgICAgICAgICdiaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogb3BlbixcbiAgICAgICAgICAgICdjbG9zZSc6IGNsb3NlLFxuICAgICAgICAgICAgJ2xhc3QnOiBjbG9zZSxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IGNoYW5nZSxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogY2hhbmdlIC8gb3BlbiAqIDEwMCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVW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Rlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdfMWJ0Y3hlJyxcbiAgICAgICAgICAgICduYW1lJzogJzFCVENYRScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1BBJywgLy8gUGFuYW1hXG4gICAgICAgICAgICAnY29tbWVudCc6ICdDcnlwdG8gQ2FwaXRhbCBBUEknLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMWQnOiAnMXllYXInLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYwNDktMmIyOTQ0MDgtNWVjYy0xMWU3LTg1Y2MtYWRhZmYwMTNkYzFhLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovLzFidGN4ZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vMWJ0Y3hlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovLzFidGN4ZS5jb20vYXBpLWRvY3MucGhwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcmljYWwtcHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci1ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzLWFuZC1pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuLW9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci10cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J0Yy1kZXBvc2l0LWFkZHJlc3MvZ2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidGMtZGVwb3NpdC1hZGRyZXNzL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMvZ2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9nZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9lZGl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9uZXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgeyAnaWQnOiAnVVNEJywgJ3N5bWJvbCc6ICdCVE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AgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsncmVzdWx0J11bJ3V1aWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGlmICh0aGlzLmlkID09PSAnY3J5cHRvY2FwaXRhbCcpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgaXMgYW4gYWJzdHJhY3QgYmFzZSBBUEkgZm9yIF8xYnRjeGUnKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2FwaV9rZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiB0aGlzLm5vbmNlICgpLFxuICAgICAgICAgICAgfSwgcGFyYW1zKTtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICBxdWVyeVsnc2lnbmF0dXJlJ10gPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChyZXF1ZXN0KSwgdGhpcy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VzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMCcsXG4gICAgICAgICAgICAgICAgJzFoJzogJzYwJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMTIwJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnMjQwJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzcyMCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzE0NDAnLFxuICAgICAgICAgICAgICAgICczZCc6ICc0MzIwJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMTAwODAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzAyNDc2MTQtMWZlNjFjNzQtOTYyMS0xMWU3LTllOGMtZjFhNjI3YWZhMjc5LmpwZycsXG4gICAgICAgICAgICAgICAgJ2V4dGVuc2lvbic6ICcuanNvbicsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FjeC5pby9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9hY3guaW8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9hY3guaW8vZG9jdW1lbnRzL2FwaV92MicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJywgLy8gR2V0IGRlcHRoIG9yIHNwZWNpZmllZCBtYXJrZXQgQm90aCBhc2tzIGFuZCBiaWRzIGFyZSBzb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BvbmNlIFRyYWRlcyBhcmUgc29ydGVkIGluIHJldmVyc2UgY3JlYXRpb24gb3JkZXIuXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21lbWJlcnMvbWUnLCAvLyBHZXQgeW91ciBwcm9maWxlIGFuZCBhY2NvdW50cyBpbmZvXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMnLCAvLyBHZXQgeW91ciBkZXBvc2l0cyBoaXN0b3J5XG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCcsIC8vIEdldCBkZXRhaWxzIG9mIHNwZWNpZmljIGRlcG9zaXRcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2FkZHJlc3MnLCAvLyBXaGVyZSB0byBkZXBvc2l0IFRoZSBhZGRyZXNzIGZpZWxkIGNvdWxkIGJlIGVtcHR5IHdoZW4gYSBuZXcgYWRkcmVzcyBpcyBnZW5lcmF0aW5nIChlLmcuIGZvciBiaXRjb2luKSwgeW91IHNob3VsZCB0cnkgYWdhaW4gbGF0ZXIgaW4gdGhhdCBjYXNlLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsIC8vIEdldCB5b3VyIG9yZGVycywgcmVzdWx0cyBpcyBwYWdpbmF0ZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsIC8vIEdldCBpbmZvcm1hdGlvbiBvZiBzcGVjaWZpZWQgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvbXknLCAvLyBHZXQgeW91ciBleGVjdXRlZCB0cmFkZXMgVHJhZGVzIGFyZSBzb3J0ZWQgaW4gcmV2ZXJzZSBjcmVhdGlvbiBvcmRlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd3MnLCAvLyBHZXQgeW91ciBjcnlwdG9jdXJyZW5jeSB3aXRoZHJhd3NcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsIC8vIEdldCB5b3VyIGNyeXB0b2N1cnJlbmN5IHdpdGhkcmF3XG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsIC8vIENyZWF0ZSBhIFNlbGwvQnV5IG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL211bHRpJywgLy8gQ3JlYXRlIG11bHRpcGxlIHNlbGwvYnV5IG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9jbGVhcicsIC8vIENhbmNlbCBhbGwgbXkgb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvZGVsZXRlJywgLy8gQ2FuY2VsIGFuIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLCAvLyBDcmVhdGUgYSB3aXRoZHJhd1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge30sIC8vIFRoZXJlIGlzIG9ubHkgMSUgZmVlIG9uIHdpdGhkcmF3YWxzIHRvIHlvdXIgYmFuayBhY2NvdW50LlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzIwMDInOiBJbnN1ZmZpY2llbnRGdW5kcyxcbiAgICAgICAgICAgICAgICAnMjAwMyc6IE9yZGVyTm90Rm91bmQsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAg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XMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2wnKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlcnMgKHBhcmFtcyk7XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAodGlja2Vycyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICAgICAgYmFzZSA9IGJhc2UudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgcXVvdGUgPSBxdW90ZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAg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W5jZWxlZCcpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChvcmRlcikpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBvcmRlcjtcbiAgICB9XG5cbiAgICBhc3luYyB3aXRoZHJhdyAoY3VycmVuY3ksIGFtb3VudCwgYWRkcmVzcywgdGFnID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICB0aGlzLmNoZWNrQWRkcmVzcyAoYWRkcmVzcyk7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0V2l0aGRyYXcgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdzdW0nOiBhbW91bnQsXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXN1bHQsXG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgZW5jb2RlUGFyYW1zIChwYXJhbXMpIHtcbiAgICAgICAgaWYgKCdvcmRlcnMnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgbGV0IG9yZGVycyA9IHBhcmFtc1snb3JkZXJzJ107XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5rZXlzb3J0ICh0aGlzLm9taXQgKHBhcmFtcywgJ29yZGVycycpKSk7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG9yZGVycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBvcmRlciA9IG9yZGVyc1tpXTtcbiAgICAgICAgICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChvcmRlcik7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgayA9IDA7IGsgPCBrZXlzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBrZXkgPSBrZXlzW2tdO1xuICAgICAgICAgICAgICAgICAgICBsZXQgdmFsdWUgPSBvcmRlcltrZXldO1xuICAgICAgICAgICAgICAgICAgICBxdWVyeSArPSAnJm9yZGVycyU1QiU1RCU1QicgKyBrZXkgKyAnJTVEPScgKyB2YWx1ZS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcXVlcnk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMudXJsZW5jb2RlICh0aGlzLmtleXNvcnQgKHBhcmFtcykpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSAnL2FwaScgKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGlmICgnZXh0ZW5zaW9uJyBpbiB0aGlzLnVybHMpXG4gICAgICAgICAgICByZXF1ZXN0ICs9IHRoaXMudXJsc1snZXh0ZW5zaW9uJ107XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyByZXF1ZXN0O1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmVuY29kZVBhcmFtcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYWNjZXNzX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICd0b25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG1ldGhvZCArICd8JyArIHJlcXVlc3QgKyAnfCcgKyBxdWVyeTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBsZXQgc3VmZml4ID0gcXVlcnkgKyAnJnNpZ25hdHVyZT0nICsgc2lnbmF0dXJlO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgc3VmZml4O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gc3VmZml4O1xuICAgICAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdDb250ZW50LVR5cGUnOiAnY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9rY29pbnVzZCA9IHJlcXVpcmUgKCcuL29rY29pbnVzZC5qcycpO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgYWxsY29pbiBleHRlbmRzIG9rY29pbnVzZCB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2FsbGNvaW4nLFxuICAgICAgICAgICAgJ25hbWUnOiAnQWxsY29pbicsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0NBJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZXh0ZW5zaW9uJzogJycsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMxNTYxODA5LWMzMTZiMzdjLWIwNjEtMTFlNy04ZDVhLWI1NDdiNGQ3MzBlYi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly93d3cuYWxsY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmFsbGNvaW4uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmFsbGNvaW4uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmFsbGNvaW4uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmFsbGNvaW4uY29tL0Fib3V0L0FQSVJlZmVyZW5jZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnd2ViJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0hvbWUvTWFya2V0T3ZlclZpZXdEZXRhaWwvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2tsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmF0Y2hfdHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcGF5bWVudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzogdW5kZWZpbmVkLFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMud2ViR2V0SG9tZU1hcmtldE92ZXJWaWV3RGV0YWlsICgpO1xuICAgICAgICBsZXQgY29pbnMgPSByZXNwb25zZVsnbWFya2V0Q29pbnMnXTtcbiAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBjb2lucy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldHMgPSBjb2luc1tqXVsnTWFya2V0cyddO1xuICAgICAgICAgICAgZm9yIChsZXQgayA9IDA7IGsgPCBtYXJrZXRzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNba11bJ01hcmtldCddO1xuICAgICAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydQcmltYXJ5J107XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydTZWNvbmRhcnknXTtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZUlkID0gYmFzZS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGVJZCA9IHF1b3RlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IGJhc2VJZCArICdfJyArIHF1b3RlSWQ7XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICBsZXQgYWN0aXZlID0gbWFya2V0WydUcmFkZUVuYWJsZWQnXSAmJiBtYXJrZXRbJ0J1eUVuYWJsZWQnXSAmJiBtYXJrZXRbJ1NlbGxFbmFibGVkJ107XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3R5cGUnOiAnc3BvdCcsXG4gICAgICAgICAgICAgICAgICAgICdzcG90JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiBtYXJrZXRbJ0Fza0ZlZVJhdGUnXSwgLy8gQmlkRmVlUmF0ZSAwLCBBc2tGZWVSYXRlIDAuMDAyLCB3ZSB1c2UganVzdCB0aGUgQXNrRmVlUmF0ZSBoZXJlXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IG1hcmtldFsnQXNrRmVlUmF0ZSddLCAvLyBCaWRGZWVSYXRlIDAsIEFza0ZlZVJhdGUgMC4wMDIsIHdlIHVzZSBqdXN0IHRoZSBBc2tGZWVSYXRlIGhlcmVcbiAgICAgICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiBtYXJrZXRbJ1ByaW1hcnlEaWdpdHMnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsnU2Vjb25kYXJ5RGlnaXRzJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ01pblRyYWRlQW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IG1hcmtldFsnTWF4VHJhZGVBbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnTWluT3JkZXJQcmljZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBtYXJrZXRbJ01heE9yZGVyUHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJTdGF0dXMgKHN0YXR1cykge1xuICAgICAgICBpZiAoc3RhdHVzID09PSAtMSlcbiAgICAgICAgICAgIHJldHVybiAnY2FuY2VsZWQnO1xuICAgICAgICBpZiAoc3RhdHVzID09PSAwKVxuICAgICAgICAgICAgcmV0dXJuICdvcGVuJztcbiAgICAgICAgaWYgKHN0YXR1cyA9PT0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5nZSB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2FueHBybycsXG4gICAgICAgICAgICAnbmFtZSc6ICdBTlhQcm8nLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ0pQJywgJ1NHJywgJ0hLJywgJ05aJyBdLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAnMicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRyYWRlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NTk4My1mZDg1OTVkYS01ZWM5LTExZTctODJlMy1hZGIzYWI4YzI2MTIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYW54cHJvLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9hbnhwcm8uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cDovL2RvY3MuYW54djIuYXBpYXJ5LmlvJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYW54cHJvLmNvbS9wYWdlcy9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9kZXB0aC9mdWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvdHJhZGUvZmV0Y2gnLCAvLyBkaXNhYmxlZCBieSBBTlhQcm9cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvb3JkZXIvYWRkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvb3JkZXIvcXVvdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9yZXN1bHQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21vbmV5L3tjdXJyZW5jeX0vYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkve2N1cnJlbmN5fS9zZW5kX3NpbXBsZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkvdHJhZGUvbGlzdCcsXG4gICAgICAgICAg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gICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICduYW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdlbmFibGVSYXRlTGltaXQnOiBmYWxzZSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAyMDAwLCAvLyBtaWxsaXNlY29uZHMgPSBzZWNvbmRzICogMTAwMFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdwdWJsaWNBUEknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwcml2YXRlQVBJJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlRGVwb3NpdEFkZHJlc3MnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZUxpbWl0T3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdkZXBvc2l0JzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2VkaXRPcmRlcic6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQmFsYW5jZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQmlkc0Fza3MnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hGdW5kaW5nRmVlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaEwyT3JkZXJCb29rJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNYXJrZXRzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogJ2VtdWxhdGVkJyxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlckJvb2snOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyQm9va3MnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRyYWRpbmdGZWVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAnd3d3JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdkb2MnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiAgIHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6ICAgdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogICAgICBmYWxzZSxcbiAgICAgICAgICAgICAgICAnbG9naW4nOiAgICBmYWxzZSxcbiAgICAgICAgICAgICAgICAncGFzc3dvcmQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAndHdvZmEnOiAgICBmYWxzZSwgLy8gMi1mYWN0b3IgYXV0aGVudGljYXRpb24gKG9uZS10aW1lIHBhc3N3b3JkIGtleSlcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHVuZGVmaW5lZCwgLy8gdG8gYmUgZmlsbGVkIG1hbnVhbGx5IG9yIGJ5IGZldGNoTWFya2V0c1xuICAgICAgICAgICAgJ2N1cnJlbmNpZXMnOiB7fSwgLy8gdG8gYmUgZmlsbGVkIG1hbnVhbGx5IG9yIGJ5IGZldGNoTWFya2V0c1xuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB1bmRlZmluZWQsIC8vIHJlZGVmaW5lIGlmIHRoZSBleGNoYW5nZSBoYXMuZmV0Y2hPSExDVlxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgIC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SA9PiB7XG4gICAgICAgICAgICBpZiAob2JqICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgZm9yIChjb25zdCBrIG9mIE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzIChvYmopKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXNbdW5DYW1lbENhc2UgKGspXSA9IHRoaXNba11cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdW5DYW1lbENhc2VQcm9wZXJ0aWVzIChPYmplY3QuZ2V0UHJvdG90eXBlT2YgKG9iaikpXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdW5DYW1lbENhc2VQcm9wZXJ0aWVzICgpXG5cbiAgICAgICAgLy8gbWVyZ2UgY29uZmlnc1xuICAgICAgICBjb25zdCBjb25maWcgPSBkZWVwRXh0ZW5kICh0aGlzLmRlc2NyaWJlICgpLCB1c2VyQ29uZmlnKVxuXG4gICAgICAgIC8vIG1lcmdlIHRvIHRoaXNcbiAgICAgICAgZm9yIChjb25zdCBbcHJvcGVydHksIHZhbHVlXSBvZiBPYmplY3QuZW50cmllcyAoY29uZmlnKSlcbiAgICAgICAgICAgIHRoaXNbcHJvcGVydHldID0gZGVlcEV4dGVuZCAodGhpc1twcm9wZXJ0eV0sIHZhbHVlKVxuXG4gICAgICAgIC8vIGdlbmVyYXRlIG9sZCBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgZm9yIChjb25zdCBrIGluIHRoaXMuaGFzKSB7XG4gICAgICAgICAgICB0aGlzWydoYXMnICsgY2FwaXRhbGl6ZSAoayldID0gISF0aGlzLmhhc1trXSAvLyBjb252ZXJ0cyAnZW11bGF0ZWQnIHRvIHRydWVcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmFwaSlcbiAgICAgICAgICAgIHRoaXMuZGVmaW5lUmVzdEFwaSAodGhpcy5hcGksICdyZXF1ZXN0JylcblxuICAgICAgICB0aGlzLmluaXRSZXN0UmF0ZUxpbWl0ZXIgKClcblxuICAgICAgICBpZiAodGhpcy5tYXJrZXRzKVxuICAgICAgICAgICAgdGhpcy5zZXRNYXJrZXRzICh0aGlzLm1hcmtldHMpXG5cbiAgICAgICAgaWYgKHRoaXMuZGVidWcgJiYgam91cm5hbCkge1xuICAgICAgICAgICAgam91cm5hbCAoKCkgPT4gdGhpcy5qb3VybmFsLCB0aGlzLCBPYmplY3Qua2V5cyAodGhpcy5oYXMpKVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZGVmYXVsdHMgKCkge1xuICAgICAgICByZXR1cm4geyAvKiBvdmVycmlkZSBtZSAqLyB9XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5zZWNvbmRzICgpXG4gICAgfVxuXG4gICAgbWlsbGlzZWNvbmRzICgpIHtcbiAgICAgICAgcmV0dXJuIG5vdyAoKVxuICAgIH1cblxuICAgIGVuY29kZVVSSUNvbXBvbmVudCAoLi4uYXJncykge1xuICAgICAgICByZXR1cm4gZW5jb2RlVVJJQ29tcG9uZW50ICguLi5hcmdzKVxuICAgIH1cblxuICAgIGNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKSB7XG4gICAgICAgIE9iamVjdC5rZXlzICh0aGlzLnJlcXVpcmVkQ3JlZGVudGlhbHMpLmZvckVhY2ggKChrZXkpID0+IHtcbiAgICAgICAgICAgIGlmICh0aGlzLnJlcXVpcmVkQ3JlZGVudGlhbHNba2V5XSAmJiAhdGhpc1trZXldKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yICh0aGlzLmlkICsgJyByZXF1aXJlcyBgJyArIGtleSArICdgJylcbiAgICAgICAgfSlcbiAgICB9XG5cbiAgICBjaGVja0FkZHJlc3MgKGFkZHJlc3MpIHtcblxuICAgICAgICBpZiAodHlwZW9mIGFkZHJlc3MgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgdGhyb3cgbmV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cbiAgICAgICAgICAgIGNhcGFjaXR5OiAgICAxLFxuICAgICAgICAgICAgZGVmYXVsdENvc3Q6IDEsXG4gICAgICAgICAgICBtYXhDYXBhY2l0eTogMTAwMCxcbiAgICAgICAgfSwgdGhpcy50b2tlbkJ1Y2tldClcblxuICAgICAgICB0aGlzLnRocm90dGxlID0gdGhyb3R0bGUgKHRoaXMudG9rZW5CdWNrZXQpXG5cbiAgICAgICAgdGhpcy5leGVjdXRlUmVzdFJlcXVlc3QgPSBmdW5jdGlvbiAodXJsLCBtZXRob2QgPSAnR0VUJywgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuXG4gICAgICAgICAgICBsZXQgcHJvbWlzZSA9XG4gICAgICAgICAgICAgICAgZmV0Y2hJbXBsZW1lbnRhdGlvbiAodXJsLCB7IG1ldGhvZCwgaGVhZGVycywgYm9keSwgJ2FnZW50JzogdGhpcy5hZ2VudCB8fCBudWxsLCB0aW1lb3V0OiB0aGlzLnRpbWVvdXQgfSlcbiAgICAgICAgICAgICAgICAgICAgLmNhdGNoIChlID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc05vZGUpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlTm90QXZhaWxhYmxlIChbIHRoaXMuaWQsIG1ldGhvZCwgdXJsLCBlLnR5cGUsIGUubWVzc2FnZSBdLmpvaW4gKCcgJykpXG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBlIC8vIHJldGhyb3cgYWxsIHVua25vd24gZXJyb3JzXG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC50aGVuIChyZXNwb25zZSA9PiB0aGlzLmhhbmRsZVJlc3RSZXNwb25zZSAocmVzcG9uc2UsIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSlcblxuICAgICAgICAgICAgcmV0dXJuIHRpbWVvdXQgKHRoaXMudGltZW91dCwgcHJvbWlzZSkuY2F0Y2ggKGUgPT4ge1xuICAgICAgICAgICAgICAgIGlmIChlIGluc3RhbmNlb2YgVGltZWRPdXQpXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBSZXF1ZXN0VGltZW91dCAodGhpcy5pZCArICcgJyArIG1ldGhvZCArICcgJyArIHVybCArICcgcmVxdWVzdCB0aW1lZCBvdXQgKCcgKyB0aGlzLnRpbWVvdXQgKyAnIG1zKScpXG4gICAgICAgICAgICAgICAgdGhyb3cgZVxuICAgICAgICAgICAgfSlcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGRlZmluZVJlc3RBcGkgKGFwaSwgbWV0aG9kTmFtZSwgb3B0aW9ucyA9IHt9KSB7XG5cbiAgICAgICAgZm9yIChjb25zdCB0eXBlIG9mIE9iamVjdC5rZXlzIChhcGkpKSB7XG4gICAgICAgICAgICBmb3IgKGNvbnN0IGh0dHBNZXRob2Qgb2YgT2JqZWN0LmtleXMgKGFwaVt0eXBlXSkpIHtcblxuICAgICAgICAgICAgICAgIGxldCBwYXRocyA9IGFwaVt0eXBlXVtodHRwTWV0aG9kXVxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcGF0aHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBhdGggPSBwYXRoc1tpXS50cmltICgpXG4gICAgICAgICAgICAgICAgICAgIGxldCBzcGxpdFBhdGggPSBwYXRoLnNwbGl0ICgvW15hLXpBLVowLTldLylcblxuICAgICAgICAgICAgICAgICAgICBsZXQgdXBwZXJjYXNlTWV0aG9kICA9IGh0dHBNZXRob2QudG9VcHBlckNhc2UgKClcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxvd2VyY2FzZU1ldGhvZCAgPSBodHRwTWV0aG9kLnRvTG93ZXJDYXNlICgpXG4gICAgICAgICAgICAgICAgICAgIGxldCBjYW1lbGNhc2VNZXRob2QgID0gdGhpcy5jYXBpdGFsaXplIChsb3dlcmNhc2VNZXRob2QpXG4gICAgICAgICAgICAgICAgICAgIGxldCBjYW1lbGNhc2VTdWZmaXggID0gc3BsaXRQYXRoLm1hcCAodGhpcy5jYXBpdGFsaXplKS5qb2luICgnJylcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVuZGVyc2NvcmVTdWZmaXggPSBzcGxpdFBhdGgubWFwICh4ID0+IHgudHJpbSAoKS50b0xvd2VyQ2FzZSAoKSkuZmlsdGVyICh4ID0+IHgubGVuZ3RoID4gMCkuam9pbiAoJ18nKVxuXG4gICAgICAgICAgICAgICAgICAgIGxldCBjYW1lbGNhc2UgID0gdHlwZSArIGNhbWVsY2FzZU1ldGhvZCArIHRoaXMuY2FwaXRhbGl6ZSAoY2FtZWxjYXNlU3VmZml4KVxuICAgICAgICAgICAgICAgICAgICBsZXQgdW5kZXJzY29yZSA9IHR5cGUgKyAnXycgKyBsb3dlcmNhc2VNZXRob2QgKyAnXycgKyB1bmRlcnNjb3JlU3VmZml4XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCdzdWZmaXhlcycgaW4gb3B0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCdjYW1lbGNhc2UnIGluIG9wdGlvbnNbJ3N1ZmZpeGVzJ10pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FtZWxjYXNlICs9IG9wdGlvbnNbJ3N1ZmZpeGVzJ11bJ2NhbWVsY2FzZSddXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJ3VuZGVyc2NvcmUnIGluIG9wdGlvbnMuc3VmZml4ZXMpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5kZXJzY29yZSArPSBvcHRpb25zWydzdWZmaXhlcyddWyd1bmRlcnNjb3JlJ11cbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmICgndW5kZXJzY29yZV9zdWZmaXgnIGluIG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgICAgICAgICB1bmRlcnNjb3JlICs9IG9wdGlvbnMudW5kZXJzY29yZVN1ZmZpeDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCdjYW1lbGNhc2Vfc3VmZml4JyBpbiBvcHRpb25zKVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FtZWxjYXNlICs9IG9wdGlvbnMuY2FtZWxjYXNlU3VmZml4O1xuXG4gICAgICAgICAgICAgICAgICAgIGxldCBwYXJ0aWFsID0gYXN5bmMgcGFyYW1zID0+IHRoaXNbbWV0aG9kTmFtZV0gKHBhdGgsIHR5cGUsIHVwcGVyY2FzZU1ldGhvZCwgcGFyYW1zIHx8IHt9KVxuXG4gICAgICAgICAgICAgICAgICAgIHRoaXNbY2FtZWxjYXNlXSAgPSBwYXJ0aWFsXG4gICAgICAgICAgICAgICAgICAgIHRoaXNbdW5kZXJzY29yZV0gPSBwYXJ0aWFsXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZmV0Y2ggKHVybCwgbWV0aG9kID0gJ0dFVCcsIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcblxuICAgICAgICBpZiAoaXNOb2RlICYmIHRoaXMudXNlckFnZW50KSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHRoaXMudXNlckFnZW50ID09PSAnc3RyaW5nJylcbiAgICAgICAgICAgICAgICBoZWFkZXJzID0gZXh0ZW5kICh7ICdVc2VyLUFnZW50JzogdGhpcy51c2VyQWdlbnQgfSwgaGVhZGVycylcbiAgICAgICAgICAgIGVsc2UgaWYgKCh0eXBlb2YgdGhpcy51c2VyQWdlbnQgPT09ICdvYmplY3QnKSAmJiAoJ1VzZXItQWdlbnQnIGluIHRoaXMudXNlckFnZW50KSlcbiAgICAgICAgICAgICAgICBoZWFkZXJzID0gZXh0ZW5kICh0aGlzLnVzZXJBZ2VudCwgaGVhZGVycylcbiAgICAgICAgf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dEF2YWlsYWJsZVxuICAgICAgICB9IGVsc2UgaWYgKFsgNDAwLCA0MDMsIDQwNSwgNTAzLCA1MzAgXS5pbmNsdWRlcyAoY29kZSkpIHtcbiAgICAgICAgICAgIGxldCBkZG9zUHJvdGVjdGlvbiA9IHJlc3BvbnNlQm9keS5tYXRjaCAoL2Nsb3VkZmxhcmV8aW5jYXBzdWxhL2kpXG4gICAgICAgICAgICBpZiAoZGRvc1Byb3RlY3Rpb24pIHtcbiAgICAgICAgICAgICAgICBlcnJvciA9IEREb1NQcm90ZWN0aW9uXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGVycm9yID0gRXhjaGFuZ2VOb3RBdmFpbGFibGVcbiAgICAgICAgICAgICAgICBkZXRhaWxzICs9ICcgKHBvc3NpYmxlIHJlYXNvbnM6ICcgKyBbXG4gICAgICAgICAgICAgICAgICAgICdpbnZhbGlkIEFQSSBrZXlzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2JhZCBvciBvbGQgbm9uY2UnLFxuICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UgaXMgZG93biBvciBvZmZsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgJ29uIG1haW50ZW5hbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgJ0REb1MgcHJvdGVjdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICdyYXRlLWxpbWl0aW5nJyxcbiAgICAgICAgICAgICAgICBdLmpvaW4gKCcsICcpICsgJyknXG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAoWyA0MDgsIDUwNCBdLmluY2x1ZGVzIChjb2RlKSkge1xuICAgICAgICAgICAgZXJyb3IgPSBSZXF1ZXN0VGltZW91dFxuICAgICAgICB9IGVsc2UgaWYgKFsgNDAxLCA1MTEgXS5pbmNsdWRlcyAoY29kZSkpIHtcbiAgICAgICAgICAgIGVycm9yID0gQXV0aGVudGljYXRpb25FcnJvclxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZXJyb3IgPSBFeGNoYW5nZUVycm9yXG4gICAgICAgIH1cbiAgICAgICAgdGhyb3cgbmV3IGVycm9yIChbIHRoaXMuaWQsIG1ldGhvZCwgdXJsLCBjb2RlLCByZWFzb24sIGRldGFpbHMgXS5qb2luICgnICcpKVxuICAgIH1cblxuICAgIGhhbmRsZVJlc3RSZXNwb25zZSAocmVzcG9uc2UsIHVybCwgbWV0aG9kID0gJ0dFVCcsIHJlcXVlc3RIZWFkZXJzID0gdW5kZWZpbmVkLCByZXF1ZXN0Qm9keSA9IHVuZGVmaW5lZCkge1xuXG4gICAgICAgIHJldHVybiByZXNwb25zZS50ZXh0ICgpLnRoZW4gKChyZXNwb25zZUJvZHkpID0+IHtcblxuICAgICAgICAgICAgbGV0IGpzb25SZXF1aXJlZCA9IHRoaXMucGFyc2VKc29uUmVzcG9uc2UgJiYgIXRoaXMuc2tpcEpzb25PblN0YXR1c0NvZGVzLmluY2x1ZGVzIChyZXNwb25zZS5zdGF0dXMpXG4gICAgICAgICAgICBsZXQganNvbiA9IGpzb25SZXF1aXJlZCA/IHRoaXMucGFyc2VKc29uIChyZXNwb25zZSwgcmVzcG9uc2VCb2R5LCB1cmwsIG1ldGhvZCkgOiB1bmRlZmluZWRcblxuICAgICAgICAgICAgbGV0IHJlc3BvbnNlSGVhZGVycyA9IHt9XG4gICAgICAgICAgICByZXNwb25zZS5oZWFkZXJzLmZvckVhY2ggKCh2YWx1ZSwga2V5KSA9PiB7XG4gICAgICAgICAgICAgICAga2V5ID0ga2V5LnNwbGl0ICgnLScpLm1hcCAod29yZCA9PiBjYXBpdGFsaXplICh3b3JkKSkuam9pbiAoJy0nKVxuICAgICAgICAgICAgICAgIHJlc3BvbnNlSGVhZGVyc1trZXldID0gdmFsdWU7XG4gICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICB0aGlzLmxhc3RfcmVzcG9uc2VfaGVhZGVycyA9IHJlc3BvbnNlSGVhZGVyc1xuICAgICAgICA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XQuYmFzZU51bWVyaWNJZCAhPT0gJ3VuZGVmaW5lZCcpID8gbWFya2V0LmJhc2VOdW1lcmljSWQgOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2RlOiBtYXJrZXQuYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHByZWNpc2lvbjogbWFya2V0LnByZWNpc2lvbiA/IChtYXJrZXQucHJlY2lzaW9uLmJhc2UgfHwgbWFya2V0LnByZWNpc2lvbi5hbW91bnQpIDogOCxcbiAgICAgICAgICAgICAgICAgICAgfSkpXG4gICAgICAgICAgICBjb25zdCBxdW90ZUN1cnJlbmNpZXMgPVxuICAgICAgICAgICAgICAgIHZhbHVlcy5maWx0ZXIgKG1hcmtldCA9PiAncXVvdGUnIGluIG1hcmtldClcbiAgICAgICAgICAgICAgICAgICAgLm1hcCAobWFya2V0ID0+ICh7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogbWFya2V0LnF1b3RlSWQgfHwgbWFya2V0LnF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVtZXJpY0lkOiAodHlwZW9mIG1hcmtldC5xdW90ZU51bWVyaWNJZCAhPT0gJ3VuZGVmaW5lZCcpID8gbWFya2V0LnF1b3RlTnVtZXJpY0lkIDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29kZTogbWFya2V0LnF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uOiBtYXJrZXQucHJlY2lzaW9uID8gKG1hcmtldC5wcmVjaXNpb24ucXVvdGUgfHwgbWFya2V0LnByZWNpc2lvbi5wcmljZSkgOiA4LFxuICAgICAgICAgICAgICAgICAgICB9KSlcbiAgICAgICAgICAgIGNvbnN0IGFsbEN1cnJlbmNpZXMgPSBiYXNlQ3VycmVuY2llcy5jb25jYXQgKHF1b3RlQ3VycmVuY2llcylcbiAgICAgICAgICAgIGNvbnN0IGdyb3VwZWRDdXJyZW5jaWVzID0gZ3JvdXBCeSAoYWxsQ3VycmVuY2llcywgJ2NvZGUnKVxuICAgICAgICAgICAgY29uc3QgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChncm91cGVkQ3VycmVuY2llcykubWFwIChjb2RlID0+XG4gICAgICAgICAgICAgICAgZ3JvdXBlZEN1cnJlbmNpZXNbY29kZV0ucmVkdWNlICgocHJldmlvdXMsIGN1cnJlbnQpID0+XG4gICAgICAgICAgICAgICAgICAgICgocHJldmlvdXMucHJlY2lzaW9uID4gY3VycmVudC5wcmVjaXNpb24pID8gcHJldmlvdXMgOiBjdXJyZW50KSwgZ3JvdXBlZEN1cnJlbmNpZXNbY29kZV1bMF0pKVxuICAgICAgICAgICAgY29uc3Qgc29ydGVkQ3VycmVuY2llcyA9IHNvcnRCeSAoZmxhdHRlbiAoY3VycmVuY2llcyksICdjb2RlJylcbiAgICAgICAgICAgIHRoaXMuY3VycmVuY2llcyA9IGRlZXBFeHRlbmQgKGluZGV4QnkgKHNvcnRlZEN1cnJlbmNpZXMsICdjb2RlJyksIHRoaXMuY3VycmVuY2llcylcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmN1cnJlbmNpZXNfYnlfaWQgPSBpbmRleEJ5ICh0aGlzLmN1cnJlbmNpZXMsICdpZCcpXG4gICAgICAgIHJldHVybiB0aGlzLm1hcmtldHNcbiAgICB9XG5cbiAgICBhc3luYyBsb2FkTWFya2V0cyAocmVsb2FkID0gZmFsc2UpIHtcbiAgICAgICAgaWYgKCFyZWxvYWQgJiYgdGhpcy5tYXJrZXRzKSB7XG4gICAgICAgICAgICBpZiAoIXRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLnNldE1hcmtldHMgKHRoaXMubWFya2V0cylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzLm1hcmtldHNcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBtYXJrZXRzID0gYXdhaXQgdGhpcy5mZX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ib2wsIHRpbWVmcmFtZSA9ICcxbScsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICghdGhpcy5oYXNbJ2ZldGNoVHJhZGVzJ10pXG4gICAgICAgICAgICB0aHJvdyBuZXcgTm90U3VwcG9ydGVkICh0aGlzLmlkICsgJyBmZXRjaE9ITENWKCkgbm90IHN1cHBvcnRlZCB5ZXQnKVxuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpXG4gICAgICAgIGxldCB0cmFkZXMgPSBhd2FpdCB0aGlzLmZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlLCBsaW1pdHMsIHBhcmFtcylcbiAgICAgICAgbGV0IG9obGN2YyA9IGJ1aWxkT0hMQ1ZDICh0cmFkZXMsIHRpbWVmcmFtZSwgc2luY2UsIGxpbWl0cylcbiAgICAgICAgcmV0dXJuIG9obGN2Yy5tYXAgKGMgPT4gYy5zbGljZSAoMCwgLTEpKVxuICAgIH1cblxuICAgIGNvbnZlcnRUcmFkaW5nVmlld1RvT0hMQ1YgKG9obGN2cykge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb2hsY3ZzWyd0J10ubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoIChbXG4gICAgICAgICAgICAgICAgb2hsY3ZzWyd0J11baV0gKiAxMDAwLFxuICAgICAgICAgICAgICAgIG9obGN2c1snbyddW2ldLFxuICAgICAgICAgICAgICAgIG9obGN2c1snaCddW2ldLFxuICAgICAgICAgICAgICAgIG9obGN2c1snbCddW2ldLFxuICAgICAgICAgICAgICAgIG9obGN2c1snYyddW2ldLFxuICAgICAgICAgICAgICAgIG9obGN2c1sndiddW2ldLFxuICAgICAgICAgICAgXSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDt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VzdGFtcCAhPT0gJ3VuZGVmaW5lZCcpID8gdGhpcy5pc284NjAxICh0aW1lc3RhbXApIDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ25vbmNlJzogdW5kZWZpbmVkLFxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZ2V0Q3VycmVuY3lVc2VkT25PcGVuT3JkZXJzIChjdXJyZW5jeSkge1xuICAgICAgICByZXR1cm4gT2JqZWN0LnZhbHVlcyAodGhpcy5vcmRlcnMpLmZpbHRlciAob3JkZXIgPT4gKG9yZGVyWydzdGF0dXMnXSA9PT0gJ29wZW4nKSkucmVkdWNlICgodG90YWwsIG9yZGVyKSA9PiB7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gb3JkZXJbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICAgICAgbGV0IHJlbWFpbmluZyA9IG9yZGVyWydyZW1haW5pbmcnXVxuICAgICAgICAgICAgaWYgKGN1cnJlbmN5ID09PSBtYXJrZXRbJ2Jhc2UnXSAmJiBvcmRlclsnc2lkZSddID09PSAnc2VsbCcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdG90YWwgKyByZW1haW5pbmdcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY3VycmVuY3kgPT09IG1hcmtldFsncXVvdGUnXSAmJiBvcmRlclsnc2lkZSddID09PSAnYnV5Jykge1xuICAgICAgICAgICAgICAgIHJldHVybiB0b3RhbCArIChvcmRlclsncHJpY2UnXSAqIHJlbWFpbmluZylcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRvdGFsXG4gICAgICAgICAgICB9XG4gICAgICAgIH0sIDApXG4gICAgfVxuXG4gICAgcGFyc2VCYWxhbmNlIChiYWxhbmNlKSB7XG5cbiAgICAgICAgY29uc3QgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLm9ta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jeVVzZWRPbk9wZW5PcmRlcnMgKGN1cnJlbmN5KVxuICAgICAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVtjdXJyZW5jeV0udG90YWwgPSBiYWxhbmNlW2N1cnJlbmN5XS51c2VkICsgYmFsYW5jZVtjdXJyZW5jeV0uZnJlZVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVtjdXJyZW5jeV0udXNlZCA9IHRoaXMuZ2V0Q3VycmVuY3lVc2VkT25PcGVuT3JkZXJzIChjdXJyZW5jeSlcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVtjdXJyZW5jeV0udG90YWwgPSBiYWxhbmNlW2N1cnJlbmN5XS51c2VkICsgYmFsYW5jZVtjdXJyZW5jeV0uZnJlZVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgWyAnZnJlZScsICd1c2VkJywgJ3RvdGFsJyBdLmZvckVhY2ggKChhY2NvdW50KSA9PiB7XG4gICAgICAgICAgICAgICAgYmFsYW5jZVthY2NvdW50XSA9IGJhbGFuY2VbYWNjb3VudF0gfHwge31cbiAgICAgICAgICAgICAgICBiYWxhbmNlW2FjY291bnRdW2N1cnJlbmN5XSA9IGJhbGFuY2VbY3VycmVuY3ldW2FjY291bnRdXG4gICAgICAgICAgICB9KVxuICAgICAgICB9KVxuXG4gICAgICAgIHJldHVybiBiYWxhbmNlXG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hQYXJ0aWFsQmFsYW5jZSAocGFydCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBhd2FpdCB0aGlzLmZldGNoQmFsYW5jZSAocGFyYW1zKVxuICAgICAgICByZXR1cm4gYmFsYW5jZVtwYXJ0XVxuICAgIH1cblxuICAgIGZldGNoRnJlZUJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gIC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ICAgICAgICAgICAsICdPcmRlck5vdENhY2hlZCc6ICAgICAgICAge31cbiAgICAgICAgICAgICAgICAsICdDYW5jZWxQZW5kaW5nJzogICAgICAgICAge31cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICwgJ05ldHdvcmtFcnJvcic6XG4gICAgICAgICAgICB7ICdERG9TUHJvdGVjdGlvbic6ICAgICAgICAge31cbiAgICAgICAgICAgICwgJ1JlcXVlc3RUaW1lb3V0JzogICAgICAgICB7fVxuICAgICAgICAgICAgLCAnRXhjaGFuZ2VOb3RBdmFpbGFibGUnOiAgIHt9XG4gICAgICAgICAgICAsICdJbnZhbGlkTm9uY2UnOiAgICAgICAgICAge31cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbilcblxuLyogIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqL1xuXG5mdW5jdGlvbiBzdWJjbGFzcyAoQmFzZUNsYXNzLCBjbGFzc2VzLCBuYW1lc3BhY2UgPSB7fSkge1xuXG4gICAgZm9yIChjb25zdCBbJGNsYXNzLCBzdWJjbGFzc2VzXSBvZiBPYmplY3QuZW50cmllcyAoY2xhc3NlcykpIHtcblxuICAgICAgICBjb25zdCBDbGFzcyA9IE9iamVjdC5hc3NpZ24gKG5hbWVzcGFjZSwge1xuXG4gICAgICAgIC8qICBCeSBjcmVhdGluZyBhIG5hbWVkIHByb3BlcnR5LCB3ZSB0cmljayBjb21waWxlciB0byBhc3NpZ24gb3VyIGNsYXNzIGNvbnN0cnVjdG9yIGZ1bmN0aW9uIGEgbmFtZS5cbiAgICAgICAgICAgIE90aGVyd2lzZSwgYWxsIG91ciBlcnJvciBjb25zdHJ1Y3RvcnMgd291bGQgYmUgc2hvd24gYXMgW0Z1bmN0aW9uOiBFcnJvcl0gaW4gdGhlIGRlYnVnZ2VyISBBbmRcbiAgICAgICAgICAgIHRoZSBzdXBlci11c2VmdWwgYGUuY29uc3RydWN0b3IubmFtZWAgbWFnaWMgd291bGRuJ3Qgd29yayDigJQgd2UgdGhlbiB3b3VsZCBoYXZlIG5vIGNoYW5jZSB0b1xuICAgICAgICAgICAgb2J0YWluIGEgZXJyb3IgdHlwZSBzdHJpbmcgZnJvbSBhbiBlcnJvciBpbnN0YW5jZSBwcm9ncmFtbWF0aWNhbGx5ISAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqL1xuXG4gICAgICAgICAgICBbJGNsYXNzXTogY2xhc3MgZXh0ZW5kcyBCYXNlQ2xhc3Mge1xuXG4gICAgICAgICAgICAgICAgY29uc3RydWN0b3IgKG1lc3NhZ2UpIHtcblxuICAgICAgICAgICAgICAgICAgICBzdXBlciAobWVzc2FnZSlcblxuICAgICAgICAgICAgICAgIC8qICBBIHdvcmthcm91bmQgdG8gbWFrZSBgaW5zdGFuY2VvZmAgd29yayBvbiBjdXN0b20gRXJyb3IgY2xhc3NlcyBpbiB0cmFuc3BpbGVkIEVTNS5cbiAgICAgICAgICAgICAgICAgICAgU2VlIG15IGJsb2cgcG9zdCBmb3IgdGhlIGV4cGxhbmF0aW9uIG9mIHRoaXMgaGFjazpcblxuICAgICAgICAgICAgICAgICAgICBodHRwczovL21lZGl1bS5jb20vQHhwbC9qYXZhc2NyaXB0LWRlcml2aW5nLWZyb20tZXJyb3ItcHJvcGVybHktOGQyZjhmMzE1ODAxICAgICAgICAqL1xuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY29uc3RydWN0b3IgPSBDbGFzc1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9fcHJvdG9fXyAgID0gQ2xhc3MucHJvdG90eXBlXG4gICAgICAgICAgICAgICAgICAgIHRoaXMubWVzc2FnZSAgICAgPSBtZXNzYWdlXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgIH0pWyRjbGFzc11cblxuICAgICAgICBzdW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yB9LFxuICAgICAgfVxuICAgICovXG5cbiAgICAsIGluZGV4QnkgKHgsIGssIG91dCA9IHt9KSB7XG5cbiAgICAgICAgZm9yIChjb25zdCB2IG9mIHZhbHVlcyAoeCkpXG4gICAgICAgICAgICBpZiAoayBpbiB2KVxuICAgICAgICAgICAgICAgIG91dFt2W2tdXSA9IHZcblxuICAgICAgICByZXR1cm4gb3V0XG4gICAgfVxuXG4vKiAgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgKi9cblxuICAgIC8qXG4gICAgICAgQWNjZXB0cyBhIG1hcC9hcnJheSBvZiBvYmplY3RzIGFuZCBhIGtleSBuYW1lIHRvIGJlIHVzZWQgYXMgYSBncm91cGluZyBwYXJhbWV0ZXI6XG4gICAgICAgYXJyYXkgPSBbXG4gICAgICAgICAgeyBzb21lS2V5OiAndmFsdWUxJywgYW5vdGhlcktleTogJ2Fub3RoZXJWYWx1ZTEnIH0sXG4gICAgICAgICAgeyBzb21lS2V5OiAndmFsdWUxJywgYW5vdGhlcktleTogJ2Fub3RoZXJWYWx1ZTInIH0sXG4gICAgICAgICAgeyBzb21lS2V5OiAndmFsdWUzJywgYW5vdGhlcktleTogJ2Fub3RoZXJWYWx1ZTMnIH0sXG4gICAgICAgXVxuICAgICAgIGtleSA9ICdzb21lS2V5J1xuXG4gICAgICAgUmV0dXJucyBhIG1hcDpcbiAgICAgIHtcbiAgICAgICAgICB2YWx1ZTE6IFtcbiAgICAgICAgICAgIHsgc29tZUtleTogJ3ZhbHVlMScsIGFub3RoZXJLZXk6ICdhbm90aGVyVmFsdWUxJyB9LFxuICAgICAgICAgICAgeyBzb21lS2V5OiAndmFsdWUxJywgYW5vdGhlcktleTogJ2Fub3RoZXJWYWx1ZTInIH0sXG4gICAgICAgICAgXVxuICAgICAgICAgIHZhbHVlMzogW1xuICAgICAgICAgICAgeyBzb21lS2V5OiAndmFsdWUzJywgYW5vdGhlcktleTogJ2Fub3RoZXJWYWx1ZTMnIH1cbiAgICAgICAgICBdLFxuICAgICAgfVxuICAgICovXG5cbiAgICAsIGdyb3VwQnkgKHgsIGssIG91dCA9IHt9KSB7XG5cbiAgICAgICAgZm9yIChjb25zdCB2IG9mIHZhbHVlcyAoeCkpIHtcbiAgICAgICAgICAgIGlmIChrIGluIHYpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBwID0gdltrXVxuICAgICAgICAgICAgICAgIG91dFtwXSA9IG91dFtwXSB8fCBbXVxuICAgICAgICAgICAgICAgIG91dFtwXS5wdXNoICh2KVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBvdXRcbiAgICB9XG5cbi8qICAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4gICAqL1xuXG4gICAgLypcbiAgICAgICBBY2NlcHRzIGEgbWFwL2FycmF5IG9mIG9iamVjdHMsIGEga2V5IG5hbWUgYW5kIGEga2V5IHZhbHVlIHRvIGJlIHVzZWQgYXMgYSBmaWx0ZXI6XG4gICAgICAgYXJyYXkgPSBbXG4gICAgICAgICAgeyBzb21lS2V5OiAndmFsdWUxJywgYW5vdGhlcktleTogJ2Fub3RoZXJWYWx1ZTEnIH0sXG4gICAgICAgICAgeyBzb21lS2V5OiAndmFsdWUyJywgYW5vdGhlcktleTogJ2Fub3RoZXJWYWx1ZTInIH0sXG4gICAgICAgICAgeyBzb21lS2V5OiAndmFsdWUzJywgYW5vdGhlcktleTogJ2Fub3RoZXJWYWx1ZTMnIH0sXG4gICAgICAgXVxuICAgICAgIGtleSA9ICdzb21lS2V5J1xuICAgICAgIHZhbHVlID0gJ3ZhbHVlMSdcblxuICAgICAgIFJldHVybnMgYW4gYXJyYXk6XG4gICAgICBbXG4gICAgICAgICAgdmFsdWUxOiB7IHNvbWVLZXk6ICd2YWx1ZTEnLCBhbm90aGVyS2V5OiAnYW5vdGhlclZhbHVlMScgfSxcbiAgICAgIF1cbiAgICAqL1xuXG4gICAgLCBmaWx0ZXJCeSAoeCwgaywgdmFsdWUgPSB1bmRlZmluZWQsIG91dCA9IFtdKSB7XG5cbiAgICAgICAgZm9yIChjb25zdCB2IG9mIHZhbHVlcyAoeCkpXG4gICAgICAgICAgICBpZiAodltrXSA9PT0gdmFsdWUpXG4gICAgICAgICAgICAgICAgb3V0LnB1c2ggKHYpXG5cbiAgICAgICAgcmV0dXJuIG91dFxuICAgIH1cblxuLyogIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLiAgICovXG5cbiAgICAsIHNvcnRCeTogKGFycmF5LCAvLyBOQjogTVVUQVRFUyBBUlJBWSFcbiAgICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgIGRlc2NlbmRpbmcgPSBmYWxzZSxcbiAgICAgICAgICAgICAgIGRpcmVjdGlvbiAgPSBkZXNjZW5kaW5nID8gLTEgOiAxKSA9PiBhcnJheS5zb3J0ICgoYSwgYikgPT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGFba2V5XSA8IGJba2V5XSkgPyAtZGlyZWN0aW9uIDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGFba2V5XSA+IGJba2V5XSkgPyAgZGlyZWN0aW9uIDogMCkpKVxuXG4vKiAgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgKi9cblxuICAgICwgZmxhdHRlbjogZnVuY3Rpb24gZmxhdHRlbiAoeCwgb3V0ID0gW10pIHtcblxuICAgICAgICBmb3IgKGNvbnN0IHYgb2YgeCkge1xuICAgICAgICAgICAgaWYgKGlzQXJyYXkgKHYpKSBmbGF0dGVuICh2LCBvdXQpXG4gICAgICAgICAgICBlbHNlIG91dC5wdXNoICh2KVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIG91dFxuICAgIH1cblxuLyogIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLiAgICovXG5cbiAgICAsIHBsdWNrOiAoeCwgaykgPT4gdmFsdWVzICh4KVxuICAgICAgICAgICAgICAgICAgICAgICAgLmZpbHRlciAodiA9PiBrIGluIHYpXG4gICAgICAgICAgICAgICAgICAgICAgICAubWFwICh2ID0+IHZba10pXG5cbi8qICAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4gICAqL1xuXG4gICAgLCBvbWl0ICh4LCAuLi5hcmdzKSB7XG5cbiAgICAgICAgY29uc3Qgb3V0ID0gY2xvbmUgKHgpXG5cbiAgICAgICAgZm9yIChjb25zdCBrIG9mIGFyZ3MpIHtcblxuICAgICAgICAgICAgaWYgKGlzQXJyYXkgKGspKSAvLyBvbWl0ICh4LCBbJ2EnLCAnYiddKVxuICAgICAgICAgICAgICAgIGZvciAoY29uc3Qga2sgb2YgaylcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIG91dFtra11cblxuICAgICAgICAgICAgZWxzZSBkZWxldGUgb3V0W2tdIC8vIG9taXQgKHgsICdhJywgJ2InKVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIG91dFxuICAgIH1cblxuLyogIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLiAgICovXG5cbiAgICAsIHN1bSAoLi4ueHMpIHtcblxuICAgICAgICBjb25zdCBucyA9IHhzLmZpbHRlciAoaXNOdW1iZXIpIC8vIGxlYXZlIG9ubHkgbnVtYmVyc1xuXG4gICAgICAgIHJldHVybiAobnMubGVuZ3RoID4gMClcbiAgICAgICAgICAgICAgICAgICAgPyBucy5yZWR1Y2UgKChhLCBiKSA9PiBhICsgYiwgMClcbiAgICAgICAgICAgICAgICAg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gPSAwOyBpID49IDA7IGktLSkge1xuXG4gICAgICAgIGxldCBjID0gY2hhcnNbaV1cblxuICAgICAgICBpZiAoaSAhPT0gMCkge1xuICAgICAgICAgICAgYyArPSBtZW1vXG5cbiAgICAgICAgICAgIGlmIChpID49IChwcmVjaXNpb25TdGFydCArIG51bVByZWNpc2lvbkRpZ2l0cykpIHtcblxuICAgICAgICAgICAgICAgIGNvbnN0IGNlaWwgPSAocm91bmRpbmdNb2RlID09PSBST1VORCkgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGMgPj0gRklWRSkgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAhKChjID09PSBGSVZFKSAmJiBtZW1vKSAvLyBwcmV2ZW50cyByb3VuZGluZyBvZiAxLjQ1IHRvIDJcblxuICAgICAgICAgICAgICAgIGMgPSBjZWlsID8gKE5JTkUgKyAxKSA6IFpFUk9cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjID4gTklORSkgeyBjID0gWkVSTzsgbWVtbyA9IDE7IH1cbiAgICAgICAgICAgIGVsc2UgbWVtbyA9IDBcblxuICAgICAgICB9IGVsc2UgaWYgKG1lbW8pIGMgPSBPTkUgLy8gbGVhZGluZyBleHRyYSBkaWdpdCAoMDkwMCDihpIgMTAwMClcblxuICAgICAgICBjaGFyc1tpXSA9IGNcblxuICAgICAgICBpZiAoYyAhPT0gWkVSTykge1xuICAgICAgICAgICAgZGlnaXRzU3RhcnQgPSBpXG4gICAgICAgICAgICBkaWdpdHNFbmQgICA9IChkaWdpdHNFbmQgPCAwKSA/IChpICsgMSkgOiBkaWdpdHNFbmRcbiAgICAgICAgfVxuICAgIH1cblxuLyogIFVwZGF0ZSB0aGUgcHJlY2lzaW9uIHJhbmdlLCBhcyBgZGlnaXRzU3RhcnRgIG1heSBoYXZlIGNoYW5nZWQuLi4gICAgICovXG5cbiAgICBpZiAoY291bnRpbmdNb2RlID09PSBTSUdOSUZJQ0FOVF9ESUdJVFMpIHt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AgICAgICAgICAgICAgICAgICAgICAgID8gKGFjdHVhbExlbmd0aCkgICAgICAgICAgICAgIC8vIC0oMTIzLjQ1NilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHByZWNpc2lvbkVuZCAtIHJlYWRTdGFydCkgIC8vIC0oMTIzLjQ1NiAgICApXG5cbiAgICAgICAgLCBwYWQgICAgICAgICAgID0gbWF4IChkZXNpcmVkTGVuZ3RoIC0gYWN0dWFsTGVuZ3RoLCAwKSAgIC8vICAtMTIzLjQ1NiggICAgKVxuICAgICAgICAsIHBhZFN0YXJ0ICAgICAgPSAgICAgKG5CZWZvcmVEb3QgKyAxICsgbkFmdGVyRG90KSAgICAgICAgLy8gIC0xMjMuNDU2KCApXG4gICAgICAgICwgcGFkRW5kICAgICAgICA9ICAgICAocGFkU3RhcnQgKyBwYWQpICAgICAgICAgICAgICAgICAgICAvLyAgLTEyMy40NTYgICAgICggKVxuICAgICAgICAsIGlzSW50ZWdlciAgICAgPSAgICAgKG5BZnRlckRvdCArIHBhZCkgPT09IDAgICAgICAgICAgICAgLy8gIC0xMjNcblxuLyogIEZpbGwgdGhlIG91dHB1dCBidWZmZXIgd2l0aCBjaGFyYWN0ZXJzICAgICovXG5cbiAgICBjb25zdCBvdXQgPSBuZXcgVWludDhBcnJheSAobkJlZm9yZURvdCArIChpc0ludGVnZXIgPyAwIDogMSkgKyBuQWZ0ZXJEb3QgKyBwYWQpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuICAgIGlmICAoaXNOZWdhdGl2ZSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dFswXSAgICAgICAgICA9IE1JTlVTICAgICAvLyAtICAgICBtaW51cyBzaWduXG4gICAgZm9yIChpID0g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tLSAqL1xuXG5tb2R1bGUuZXhwb3J0cyA9IHtcbiAgICBcbiAgICB0aHJvdHRsZTogZnVuY3Rpb24gdGhyb3R0bGUgKGNmZykge1xuXG4gICAgICAgIGxldCAgIGxhc3RUaW1lc3RhbXAgPSBub3cgKClcbiAgICAgICAgICAgICwgbnVtVG9rZW5zICAgICA9ICh0eXBlb2YgY2ZnLm51bVRva2VucyAhPT0gJ3VuZGVmaW5lZCcpID8gY2ZnLm51bVRva2VucyA6IGNmZy5jYXBhY2l0eVxuICAgICAgICAgICAgLCBydW5uaW5nICAgICAgID0gZmFsc2VcbiAgICAgICAgICAgICwgY291bnRlciAgICAgICA9IDBcblxuICAgICAgICBjb25zdCBxdWV1ZSA9IFtdXG5cbiAgICAgICAgcmV0dXJuIE9iamVjdC5hc3NpZ24gKGNvc3QgPT4ge1xuXG4gICAgICAgICAgICBpZiAocXVldWUubGVuZ3RoID4gY2ZnLm1heENhcGFjaXR5KVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvciAoJ0JhY2tsb2cgaXMgb3ZlciBtYXggY2FwYWNpdHkgb2YgJyArIGNmZy5tYXhDYXBhY2l0eSlcblxuICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlIChhc3luYyAocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG5cbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBxdWV1ZS5wdXNoICh7IGNvc3QsIHJlc29sdmUsIHJlamVjdCB9KVxuXG4gICAgICAgICAgICAgICAgICAgIGlmICghcnVubmluZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcnVubmluZyA9IHRydWVcbiAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChxdWV1ZS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgaGFzRW5vdWdoVG9rZW5zID0gY2ZnLmNhcGFjaXR5ID8gKG51bVRva2VucyA+IDApIDogKG51bVRva2VucyA+PSAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoYXNFbm91Z2hUb2tlbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHF1ZXVlLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB7IGNvc3QsIHJlc29sdmUsIHJlamVjdCB9ID0gcXVldWVbMF1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvc3QgPSAoY29zdCB8fCBjZmcuZGVmYXVsdENvc3QpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobnVtVG9rZW5zID49IE1hdGgubWluIChjb3N0LCBjZmcuY2FwYWNpdHkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtVG9rZW5zIC09IGNvc3RcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWV1ZS5zaGlmdCAoKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUgKClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0ID0gbm93ICgpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICwgZWxhcHNlZCA9IHQgLSBsYXN0VGltZXN0YW1wXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFzdFRpbWVzdGFtcCA9IHRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1Ub2tlbnMgPSBNYXRoLm1pbiAoY2ZnLmNhcGFjaXR5LCBudW1Ub2tlbnMgKyBlbGFwc2VkICogY2ZnLnJlZmlsbFJhdGUpXG4gICAgICAgICAgICAgICAgICAg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lsbCByZXR1cm4gaHR0cHM6Ly9naXRodWIuY29tL2NjeHQvY2N4dC9pc3N1ZXMvMjMzOFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtaW4nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bWluJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bWluJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbWluJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMWhvdXInLFxuICAgICAgICAgICAgICAgICc4aCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICdkYXknLFxuICAgICAgICAgICAgICAgICcxdyc6ICd3ZWVrJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM0OTAyNjExLTJiZThiZjFhLWY4MzAtMTFlNy05MWEyLTExYjJmMjkyZTc1MC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuYmlib3guY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpYm94LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9CaWJveGNvbS9hcGlfcmVmZXJlbmNlL3dpa2kvaG9tZV9lbicsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vQmlib3hjb20vYXBpX3JlZmVyZW5jZS93aWtpL2FwaV9yZWZlcmVuY2UnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9iaWJveC56ZW5kZXNrLmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDQ0MTcwMTMtRmVlLVN0cnVjdHVyZS1vbi1CaWJveCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IHJld29yayBmb3IgZnVsbCBlbmRwb2ludC9jbWQgcGF0aHMgaGVyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ21kYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZGF0YScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJwZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7fSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7fSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcyMDIxJzogSW5zdWZmaWNpZW50RnVuZHMsIC8vIEluc3VmZmljaWVudCBiYWxhbmNlIGF2YWlsYWJsZSBmb3Igd2l0aGRyYXdhbFxuICAgICAgICAgICAgICAgICcyMDE1JzogQXV0aGVudGljYXRpb25FcnJvciwgLy8gR29vZ2xlIGF1dGhlbnRpY2F0b3IgaXMgd3JvbmdcbiAgICAgICAgICAgICAgICAnMjAzMyc6IE9yZGVyTm90Rm91bmQsIC8vIG9wZXJhdGlvbiBmYWlsZWQhIE9yZGVycyBoYXZlIGJlZW4gY29tcGxldGVkIG9yIHJldm9rZWRcbiAgICAgICAgICAgICAgICAnMjA2Nyc6IEludmFsaWRPcmRlciwgLy8gRG9lcyBub3Qgc3VwcG9ydCBtYXJrZXQgb3JkZXJzXG4gICAgICAgICAgICAgICAgJzIwNjgnOiBJbnZhbGlkT3JkZXIsIC8vIFRoZSBudW1iZXIgb2Ygb3JkZXJzIGNhbiBub3QgYmUgbGVzcyB0aGFuXG4gICAgICAgICAgICAgICAgJzMwMTInOiBBdXRoZW50aWNhdGlvbkVycm9yLCAvLyBpbnZhbGlkIGFwaUtleVxuICAgICAgICAgICAgICAgICczMDI0JzogUGVybWlzc2lvbkRlbmllZCwgLy8gd3JvbmcgYXBpa2V5IHBlcm1pc3Npb25zXG4gICAgICAgICAgICAgICAgJzMwMjUnOiBBdXRoZW50aWNhdGlvbkVycm9yLCAvLyBzaWduYXR1cmUgZmFpbGVkXG4gICAgICAgICAgICAgICAgJzQwMDAnOiBFeGNoYW5nZU5vdEF2YWlsYWJsZSwgLy8gY3VycmVudCBuZXR3b3JrIGlzIHVuc3RhYmxlXG4gICAgICAgICAgICAgICAgJzQwMDMnOiBERG9TUHJvdGVjdGlvbiwgLy8gc2VydmVyIGJ1c3kgcGxlYXNlIHRyeSBhZ2FpbiBsYXRlclxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdLRVknOiAnQmlodScsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWRhdGEgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY21kJzogJ21hcmtldEFsbCcsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnY29pbl9zeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gbWFya2V0WydjdXJyZW5jeV9zeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IGlkID0gYmFzZSArICdfJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4g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AgICAgICAgICAgIGlmIChtYXJrZXRJZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFttYXJrZXRJZF07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHN5bWJvbCA9ICh0eXBlb2YgbWFya2V0ICE9PSAndW5kZWZpbmVkJykgPyBtYXJrZXRbJ3N5bWJvbCddIDogdW5kZWZpbmVkO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2ZlZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2ZlZScpLFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdpZCcpLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAncHJpY2UnKSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdhbW91bnQnKSxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5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gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WyduYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYW5zZmVyICh7XG4gICAgICAgICAgICAnY21kJzogJ3RyYW5zZmVyL2Fzc2V0cycsXG4gICAgICAgICAgICAnYm9keSc6IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3NlbGVjdCc6IDEsXG4gICAgICAgICAgICB9LCBwYXJhbXMpLFxuICAgICAgICB9KTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBpbmRleGVkID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2Fzc2V0c19saXN0JyBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgaW5kZXhlZCA9IHRoaXMuaW5kZXhCeSAoYmFsYW5jZXNbJ2Fzc2V0c19saXN0J10sICdjb2luX3N5bWJvbCcpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaW5kZXhlZCA9IGJhbGFuY2VzO1xuICAgICAgICB9XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKGluZGV4ZWQpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGtleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNbaV07XG4gICAgICAgICAgICBsZXQgY29kZSA9IGlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgaWYgKGNvZGUuaW5kZXhPZiAoJ1RPVEFMXycpID49IDApIHtcbiAgICAgICAgICAgICAgICBjb2RlID0gY29kZS5zbGljZSAoNik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoY29kZSBpbiB0aGlzLmN1cnJlbmNpZXNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBjb2RlID0gdGhpcy5jdXJyZW5jaWVzX2J5X2lkW2NvZGVdWydjb2RlJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gaW5kZXhlZFtpZF07XG4gICAgICAgICAgICBpZiAodHlwZW9mIGJhbGFuY2UgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgYmFsYW5jZSA9IHBhcnNlRmxvYXQgKGJhbGFuY2UpO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGJhbGFuY2U7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gMC4wO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBiYWxhbmNlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlWydiYWxhbmNlJ10pO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2ZyZWV6ZSddKTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG9yZGVyVHlwZSA9ICh0eXBlID09PSAnbGltaXQnKSA/IDIgOiAxO1xuICAgICAgICBsZXQgb3JkZXJTaWRlID0gKHNpZGUgPT09ICdidXknKSA/IDEgOiAyO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0T3JkZXJwZW5kaW5nICh7XG4gICAgICAgICAgICAnY21kJzogJ29yZGVycGVuZGluZy90cmFkZScsXG4gICAgICAgICAgICAnYm9keSc6IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3BhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAgICAgJ2FjY291bnRfdHlwZSc6IDAsXG4gICAgICAgICAgICAgICAgJ29yZGVyX3R5cGUnOiBvcmRlclR5cGUsXG4gICAgICAgICAgICAgICAgJ29yZGVyX3NpZGUnOiBvcmRlclNpZGUsXG4gICAgICAgICAgICAgICAgJ3BheV9iaXgnOiAwLFxuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICB9LCBwYXJhbXMpLFxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVT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kLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCA/IGNvc3QgOiBwYXJzZUZsb2F0IChwcmljZSkgKiBmaWxsZWQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZmVlJyksXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlclN0YXR1cyAoc3RhdHVzKSB7XG4gICAgICAgIGxldCBzdGF0dXNlcyA9IHtcbiAgICAgICAgICAgIC8vIG9yaWdpbmFsIGNvbW1lbnRzIGZyb20gYmlib3g6XG4gICAgICAgICAgICAnMSc6ICdwZW5kaW5nJywgLy8gcGVuZGluZ1xuICAgICAgICAgICAgJzInOiAnb3BlbicsIC8vIHBhcnQgY29tcGxldGVkXG4gICAgICAgICAgICAnMyc6ICdjbG9zZWQnLCAvLyBjb21wbGV0ZWRcbiAgICAgICAgICAgICc0JzogJ2NhbmNlbGVkJywgLy8gcGFydCBjYW5jZWxlZFxuICAgICAgICAgICAgJzUnOiAnY2FuY2VsZWQnLCAvLyBjYW5jZWxlZFxuICAgICAgICAgICAgJzYnOiAnY2FuY2VsZWQnLCAvLyBjYW5jZWxpbmdcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHRoaXMuc2FmZVN0cmluZyAoc3RhdHVzZXMsIHN0YXR1cywgc3RhdHVzLnRvTG93ZXJDYXNlICgpKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9wZW5PcmRlcnMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgcGFpciA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBzeW1ib2wgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgICAgICBwYWlyID0gbWFya2V0WydpZCddO1xuICAgICAgICB9XG4gICAgICAgIGxldCBzaXplID0gKGxpbWl0KSA/IGxpbWl0IDogMjAwO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0T3JkZXJwZW5kaW5nICh7XG4gICAgICAgICAgICAnY21kJzogJ29yZGVycGVuZGluZy9vcmRlclBlbmRpbmdMaXN0JyxcbiAgICAgICAgICAgICdib2R5JzogdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAncGFpcic6IHBhaXIsXG4gICAgICAgICAgICAgICAgJ2FjY291bnRfdHlwZSc6IDAsIC8vIDAgLSByZWd1bGFyLCAxIC0gbWFyZ2luXG4gICAgICAgICAgICAgICAgJ3BhZ2UnOiAxLFxuICAgICAgICAgICAgICAgICdzaXplJzogc2l6ZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcyksXG4gICAgICAgIH0pO1xuICAgICAgICBsZXQgb3JkZXJzID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlWydyZXN1bHQnXSwgJ2l0ZW1zJywgW10pO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVycyAob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xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBpbmZvW2NvZGVdID0gcmVzcG9uc2U7XG4gICAgICAgICAgICB3aXRoZHJhd0ZlZXNbY29kZV0gPSByZXNwb25zZVsncmVzdWx0J11bJ3dpdGhkcmF3X2ZlZSddO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IGluZm8sXG4gICAgICAgICAgICAnd2l0aGRyYXcnOiB3aXRoZHJhd0ZlZXMsXG4gICAgICAgICAgICAnZGVwb3NpdCc6IHt9LFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBsZXQgY21kcyA9IHRoaXMuanNvbiAoWyBwYXJhbXMgXSk7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAobWV0aG9kICE9PSAnR0VUJylcbiAgICAgICAgICAgICAgICBib2R5ID0geyAnY21kcyc6IGNtZHMgfTtcbiAgICAgICAgICAgIGVsc2UgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB7XG4gICAgICAgICAgICAgICAgJ2NtZHMnOiBjbWRzLFxuICAgICAgICAgICAgICAgICdhcGlrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnc2lnbic6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGNtZHMpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnbWQ1JyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2YgYm9keSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChib2R5LCB7ICdjb252ZXJ0QXJyYXlzVG9PYmplY3RzJzogdHJ1ZSB9KTtcbiAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyB9O1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoYm9keS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgaWYgKCdlcnJvcicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCdjb2RlJyBpbiByZXNwb25zZVsnZXJyb3InXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlWydlcnJvciddLCAnY29kZScpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGZlZWRiYWNrID0gdGhpcy5pZCArICcgJyArIGJvZHk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBleGNlcHRpb25zID0gdGhpcy5leGNlcHRpb25zO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGUgaW4gZXhjZXB0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBleGNlcHRpb25zW2NvZGVdIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnOiBcImVycm9yXCIgaW4gcmVzcG9uc2U6ICcgKyBib2R5KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCEoJ3Jlc3VsdCcgaW4gcmVzcG9uc2UpKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmIChtZXRob2QgPT09ICdHRVQnKSB7XG4gICAgICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gcmVzcG9uc2VbJ3Jlc3VsdCddWzB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gICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hCaWRzQXNrcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRnVuZGluZ0ZlZXMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzNtJzogJzNtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMmgnLFxuICAgICAgICAgICAgICAgICc0aCc6ICc0aCcsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnOGgnOiAnOGgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgICAgICczZCc6ICczZCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzF3JyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjk2MDQwMjAtZDU0ODNjZGMtODdlZS0xMWU3LTk0YzctZDFhOGQ5MTY5MjkzLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL3d3dy5iaW5hbmNlLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICd3YXBpJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL3dhcGkvdjMnLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL2FwaS92MScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL2FwaS92MycsXG4gICAgICAgICAgICAgICAgICAgICd2Myc6ICdodHRwczovL2FwaS5iaW5hbmNlLmNvbS9hcGkvdjMnLFxuICAgICAgICAgICAgICAgICAgICAndjEnOiAnaHR0cHM6Ly9hcGkuYmluYW5jZS5jb20vYXBpL3YxJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYmluYW5jZS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2JpbmFuY2UtZXhjaGFuZ2UvYmluYW5jZS1vZmZpY2lhbC1hcGktZG9jcy9ibG9iL21hc3Rlci9yZXN0LWFwaS5tZCcsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpbmFuY2UuemVuZGVzay5jb20vaGMvZW4tdXMvYXJ0aWNsZXMvMTE1MDAwNDI5MzMyJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5iaW5hbmNlLmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDA1ODMzMTEnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnd2ViJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3B1YmxpYy9wcm9kdWN0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3YXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdEhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3SGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRTdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5c3RlbVN0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdGZWUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3YzJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci9wcmljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL2Jvb2tUaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZUluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhZ2dUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2tsaW5lcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyLzI0aHInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci9hbGxQcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci9hbGxCb29rVGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3ByaWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvYm9va1RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2VJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFsgJ3VzZXJEYXRhU3RyZWFtJyBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFsgJ3VzZXJEYXRhU3RyZWFtJyBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogWyAndXNlckRhdGFTdHJlYW0nIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWxsT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteVRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci90ZXN0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIC8vIHNob3VsZCBiZSBkZWxldGVkLCB0aGVzZSBhcmUgb3V0ZGF0ZWQgYW5kIGluYWNjdXJhdGVcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQURBJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEWCc6IDQuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSU9OJzogMS45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNQic6IDExLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVBQQyc6IDYuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUksnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJOJzogMy4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FTVCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFUJzogMTguMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0QnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNQVCc6IDEwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOQic6IDAuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTlQnOiAxLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlFYJzogMS42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JSRCc6IDYuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVE0nOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRTJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEVCc6IDY3LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ01UJzogMzcuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTkQnOiA0Ny4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUUic6IDUuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdEJzogMC4wNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdETFQnOiAxMS43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROVCc6IDUxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMi41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMRic6IDYuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTkcnOiAyLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5KJzogNDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEYnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVlgnOiAyLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVFTCc6IDQ1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVOJzogODUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dUTyc6IDIwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1ZUJzogMC41MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHWFMnOiAwLjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSENDJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAzLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNYJzogMS4zLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lOUyc6IDEuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJT1RBJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tNRCc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tOQyc6IDIuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMRU5EJzogNTQuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSU5LJzogMTIuOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMTFQnOiA1NC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDkuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMU0snOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVU4nOiAwLjI5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BTkEnOiA3NC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DTyc6IDAuODYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTURBJzogNC43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01PRCc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEgnOiAzNC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01UTCc6IDEuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOQVYnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVCTCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05VTFMnOiAyLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0FYJzogOC4zLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1NUJzogMTcuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0UnOiA4OC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPV1InOiA4LjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBUJzogMC4yNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRU1AnOiAyMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JDTic6IDM1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkROJzogMi4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUSc6IDE4LjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkxDJzogNC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NBTFQnOiAxLjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0JUQyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDQyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOTSc6IDI5LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMzIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVE9SSic6IDUuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiA3LjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5CJzogODIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTlQnOiA0Ny4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSSUcnOiA2LjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJYJzogMTI5LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDIzLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVOJzogMS44LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQic6IDI4LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCRSc6IDcuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdXQUJJJzogMy41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dBVkVTJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOR1MnOiA5LjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hMTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLjI1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hWRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYWkMnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lPWU9XJzogMzkuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiA1LjcsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge30sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnWU9ZTyc6ICdZT1lPVycsXG4gICAgICAgICAgICAgICAgJ0JDQyc6ICdCQ0gnLFxuICAgICAgICAgICAgICAgICdOQU5PJzogJ1hSQicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gZXhjaGFuZ2Utc3BlY2lmaWMgb3B0aW9uc1xuICAgICAgICAgICAgJ29wdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ2RlZmF1bHRMaW1pdE9yZGVyVHlwZSc6ICdsaW1pdCcsIC8vIG9yICdsaW1pdF9tYWtlcidcbiAgICAgICAgICAgICAgICAnaGFzQWxyZWFkeUF1dGhlbnRpY2F0ZWRTdWNjZXNzZnVsbHknOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnd2Fybk9uRmV0Y2hPcGVuT3JkZXJzV2l0aG91dFN5bWJvbCc6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ZvICgpO1xuICAgICAgICBpZiAodGhpcy5vcHRpb25zWydhZGp1c3RGb3JUaW1lRGlmZmVyZW5jZSddKVxuICAgICAgICAgICAgYXdhaXQgdGhpcy5sb2FkVGltZURpZmZlcmVuY2UgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3N5bWJvbHMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIC8vIFwiMTIzNDU2XCIgaXMgYSBcInRlc3Qgc3ltYm9sL21hcmtldFwiXG4gICAgICAgICAgICBpZiAoaWQgPT09ICcxMjM0NTYnKVxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnYmFzZUFzc2V0J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsncXVvdGVBc3NldCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgZmlsdGVycyA9IHRoaXMuaW5kZXhCeSAobWFya2V0WydmaWx0ZXJzJ10sICdmaWx0ZXJUeXBlJyk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdiYXNlJzogbWFya2V0WydiYXNlQXNzZXRQcmVjaXNpb24nXSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBtYXJrZXRbJ3F1b3RlUHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYmFzZUFzc2V0UHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydxdW90ZVByZWNpc2lvbiddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAobWFya2V0WydzdGF0dXMnXSA9PT0gJ1RSQURJTkcnKTtcbiAgICAgICAgICAgIC8vIGxvdCBzaXplIGlzIGRlcHJlY2F0ZWQgYXMgb2YgMjAxOC4wMi4wNlxuICAgICAgICAgICAgbGV0IGxvdCA9IC0xICogTWF0aC5sb2cxMCAocHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICBsZXQgZW50cnkgPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCwgLy8gbG90IHNpemUgaXMgZGVwcmVjYXRlZCBhcyBvZiAyMDE4LjAyLjA2XG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoJ1BSSUNFX0ZJTFRFUicgaW4gZmlsdGVycykge1xuICAgICAgICAgICAgICAgIGxldCBmaWx0ZXIgPSBmaWx0ZXJzWydQUklDRV9GSUxURVInXTtcbiAgICAgICAgICAgICAgICBlbnRyeVsncHJlY2lzaW9uJ11bJ3ByaWNlJ10gPSB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKGZpbHRlclsndGlja1NpemUnXSk7XG4gICAgICAgICAgICAgICAgZW50cnlbJ2xpbWl0cyddWydwcmljZSddID0ge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKGZpbHRlciwgJ21pblByaWNlJyksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAoZmlsdGVyLCAnbWF4UHJpY2UnKSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdMT1RfU0laRScgaW4gZmlsdGVycykge1xuICAgICAgICAgICAgICAgIGxldCBmaWx0ZXIgPSBmaWx0ZXJzWydMT1RfU0laRSddO1xuICAgICAgICAgICAgICAgIGVudHJ5WydwcmVjaXNpb24nXVsnYW1vdW50J10gPSB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKGZpbHRlclsnc3RlcFNpemUnXSk7XG4gICAgICAgICAgICAgICAgZW50cnlbJ2xvdCddID0gdGhpcy5zYWZlRmxvYXQgKGZpbHRlciwgJ3N0ZXBTaXplJyk7IC8vIGxvdCBzaXplIGlzIGRlcHJlY2F0ZWQgYXMgb2YgMjAxOC4wMi4wNlxuICAgICAgICAgICAgICAgIGVudHJ5WydsaW1pdHMnXVsnYW1vdW50J10gPSB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAoZmlsdGVyLCAnbWluUXR5JyksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAoZmlsdGVyLCAnbWF4UXR5JyksXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICgnTUlOX05PVElPTkFMJyBpbiBmaWx0ZXJzKSB7XG4gICAgICAgICAgICAgICAgZW50cnlbJ2xpbWl0cyddWydjb3N0J11bJ21pbiddID0gcGFyc2VGbG9hdCAoZmlsdGVyc1snTUlOX05PVElPTkFMJ11bJ21pbk5vdGlvbmFsJ10pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKGVudHJ5KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGNhbGN1bGF0ZUZlZSAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlLCB0YWtlck9yTWFrZXIgPSAndGFrZXInLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgIGxldC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AgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVyLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGFrZXJPck1ha2VyJzogdGFrZXJPck1ha2VyLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IHByaWNlICogYW1vdW50LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHR5cGVvZiBzaW5jZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIHJlcXVlc3RbJ3N0YXJ0VGltZSddID0gc2luY2U7XG4gICAgICAgICAgICByZXF1ZXN0WydlbmRUaW1lJ10gPSBzaW5jZSArIDM2MDAwMDA7XG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gMC4wKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgZmlsbGVkICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIHJlbWFpbmluZyA9IE1hdGgubWF4IChhbW91bnQgLSBmaWxsZWQsIDAuMCk7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHByaWNlICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBjb3N0ID0gcHJpY2UgKiBmaWxsZWQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGlkID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ29yZGVySWQnKTtcbiAgICAgICAgbGV0IHR5cGUgPSB0aGlzLnNhZmVTdHJpbmcgKG9yZGVyLCAndHlwZScpO1xuICAgICAgICBpZiAodHlwZW9mIHR5cGUgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgdHlwZSA9IHR5cGUudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgIGxldCBzaWRlID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ3NpZGUnKTtcbiAgICAgICAgaWYgKHR5cGVvZiBzaWRlICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHNpZGUgPSBzaWRlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGlzbzg2MDEsXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICAvLyB0aGUgbmV4dCA1IGxpbmVzIGFyZSBhZGRlZCB0byBzdXBwb3J0IGZvciB0ZXN0aW5nIG9yZGVyc1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3ByaXZhdGVQb3N0T3JkZXInO1xuICAgICAgICBsZXQgdGVzdCA9IHRoaXMuc2FmZVZhbHVlIChwYXJhbXMsICd0ZXN0JywgZmFsc2UpO1xuICAgICAgICBpZiAodGVzdCkge1xuICAgICAgICAgICAgbWV0aG9kICs9ICdUZXN0JztcbiAgICAgICAgICAgIHBhcmFtcyA9IHRoaXMub21pdCAocGFyYW1zLCAndGVzdCcpO1xuICAgICAgICB9XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAncXVhbnRpdHknOiB0aGlzLmFtb3VudFRvU3RyaW5nIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUudG9VcHBlckNhc2UgKCksXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09PSAnbGltaXQnKSB7XG4gICAgICAgICAgICBvcmRlclsndHlwZSddID0gdGhpcy5vcHRpb25zWydkZWZhdWx0TGltaXRPcmRlclR5cGUnXS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIG9yZGVyID0gdGhpcy5leHRlbmQgKG9yZGVyLCB7XG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmljZVRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlKSxcbiAgICAgICAgICAgICAgICAndGltZUluRm9yY2UnOiAnR1RDJywgLy8gJ0dUQycgPSBHb29kIFRvIENhbmNlbCAoZGVmYXVsdCksICdJT0MnID0gSW1tZWRpYXRlIE9yIENhbmNlbFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PT0gJ2xpbWl0X21ha2VyJykge1xuICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSB0aGlzLnByaWNlVG9QcmVjaXNpb24gKHN5bWJvbCwgcHJpY2UpO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlciAocmVzcG9uc2UpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICghc3ltYm9sKVxuICAgICAgICA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VtZW50Jyk7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9O1xuICAgICAgICBpZiAobGltaXQpXG4gICAgICAgICAgICByZXF1ZXN0WydsaW1pdCddID0gbGltaXQ7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldE15VHJhZGVzICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoRGVwb3NpdEFkZHJlc3MgKGNvZGUsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY3VycmVuY3kgKGNvZGUpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLndhcGlHZXREZXBvc2l0QWRkcmVzcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdhc3NldCc6IGN1cnJlbmN5WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydzdWNjZXNzJ10pIHtcbiAgICAgICAgICAgICAgICBsZXQgYWRkcmVzcyA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdhZGRyZXNzJyk7XG4gICAgICAgICAgICAgICAgbGV0IHRhZyA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdhZGRyZXNzVGFnJyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY29kZSxcbiAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3MnOiB0aGlzLmNoZWNrQWRkcmVzcyAoYWRkcmVzcyksXG4gICAgICAgICAgICAgICAgICAgICd0YWcnOiB0YWcsXG4gICAgICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEZ1bmRpbmdGZWVzIChjb2RlcyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgLy8gIGJ5IGRlZmF1bHQgaXQgd2lsbCB0cnkgbG9hZCB3aXRoZHJhd2FsIGZlZXMgb2YgYWxsIGN1cnJlbmNpZXMgKHdpdGggc2VwYXJhdGUgcmVxdWVzdHMpXG4gICAgICAgIC8vICBob3dldmVyIGlmIHlvdSBkZWZpbmUgY29kZXMgPSBbICdFVEgnLCAnQlRDJyBdIGluIGFyZ3MgaXQgd2lsbCBvbmx5IGxvYWQgdGhvc2VcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHdpdGhkcmF3RmVlcyA9IHt9O1xuICAgICAgICBsZXQgaW5mbyA9IHt9O1xuICAgICAgICBpZiAodHlwZW9mIGNvZGVzID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGNvZGVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY29kZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjb2RlID0gY29kZXNbaV07XG4gICAgICA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ICAgICBpZiAodGFnKVxuICAgICAgICAgICAgcmVxdWVzdFsnYWRkcmVzc1RhZyddID0gdGFnO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLndhcGlQb3N0V2l0aGRyYXcgKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnaWQnKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV07XG4gICAgICAgIHVybCArPSAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09PSAnd2FwaScpXG4gICAgICAgICAgICB1cmwgKz0gJy5odG1sJztcbiAgICAgICAgLy8gdjEgc3BlY2lhbCBjYXNlIGZvciB1c2VyRGF0YVN0cmVhbVxuICAgICAgICBpZiAocGF0aCA9PT0gJ3VzZXJEYXRhU3RyZWFtJykge1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnWC1NQlgtQVBJS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIGlmICgoYXBpID09PSAncHJpdmF0ZScpIHx8IChhcGkgPT09ICd3YXBpJykpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRoaXMubm9uY2UgKCksXG4gICAgICAgICAgICAgICAgJ3JlY3ZXaW5kb3cnOiB0aGlzLm9wdGlvbnNbJ3JlY3ZXaW5kb3cnXSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHF1ZXJ5KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBxdWVyeSArPSAnJicgKyAnc2lnbmF0dXJlPScgKyBzaWduYXR1cmU7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdYLU1CWC1BUElLRVknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoKG1ldGhvZCA9PT0gJ0dFVCcpIHx8IChhcGkgPT09ICd3YXBpJykpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGJvZHkgPSBxdWVyeTtcbiAgICAgICAgICAgICAgICBoZWFkZXJzWydDb250ZW50LVR5cGUnXSA9ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH1cbiAgICAg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AgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyBvcmRlciBhbW91bnQgc2hvdWxkIGJlIGV2ZW5seSBkaXZpc2libGUgYnkgbG90IHNpemUsIHVzZSB0aGlzLmFtb3VudFRvTG90cyAoc3ltYm9sLCBhbW91bnQpICcgKyBib2R5KTtcbiAgICAgICAgICAgIGlmIChib2R5LmluZGV4T2YgKCdQUklDRV9GSUxURVInKSA+PSAwKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKHRoaXMuaWQgKyAnIG9yZGVyIHByaWNlIGV4Y2VlZHMgYWxsb3dlZCBwcmljZSBwcmVjaXNpb24gb3IgaW52YWxpZCwgdXNlIHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQpICcgKyBib2R5KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYm9keS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgLy8gY2hlY2sgc3VjY2VzcyB2YWx1ZSBmb3Igd2FwaSBlbmRwb2ludHNcbiAgICAgICAgICAgICAgICAvLyByZXNwb25zZSBpbiBmb3JtYXQgeydtc2cnOiAnVGhlIGNvaW4gZG9lcyBub3QgZXhpc3QuJywgJ3N1Y2Nlc3MnOiB0cnVlL2ZhbHNlfVxuICAgICAgICAgICAgICAgIGxldCBzdWNjZXNzID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAnc3VjY2VzcycsIHRydWUpO1xuICAgICAgICAgICAgICAgIGlmICghc3VjY2Vzcykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoJ21zZycgaW4gcmVzcG9uc2UpXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlID0gSlNPTi5wYXJzZSAocmVzcG9uc2VbJ21zZyddKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNwb25zZSA9IHt9O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBjaGVja3MgYWdhaW5zdCBlcnJvciBjb2Rlc1xuICAgICAgICAgICAgICAgIGxldCBlcnJvciA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdjb2RlJyk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBlcnJvciAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZXhjZXB0aW9ucyA9IHRoaXMuZXhjZXB0aW9ucztcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycm9yIGluIGV4Y2VwdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGEgd29ya2Fyb3VuZCBmb3Ige1wiY29kZVwiOi0yMDE1LFwibXNnXCI6XCJJbnZhbGlkIEFQSS1rZXksIElQLCBvciBwZXJtaXNzaW9ucyBmb3IgYWN0aW9uLlwifVxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZGVzcGl0ZSB0aGF0IHRoZWlyIG1lc3NhZ2UgaXMgdmVyeSBjb25mdXNpbmcsIGl0IGlzIHJhaXNlZCBieSBCaW5hbmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBvbiBhIHRlbXBvcmFyeSBiYW4gKHRoZSBBUEkga2V5IGlzIHZhbGlkLCBidXQgZGlzYWJsZWQgZm9yIGEgd2hpbGUpXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGVycm9yID09PSAnLTIwMTUnKSAmJiB0aGlzLm9wdGlvbnNbJ2hhc0FscmVhZHlBdXRoZW50aWNhdGVkU3VjY2Vzc2Z1bGx5J10pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRERvU1Byb3RlY3Rpb24gKHRoaXMuaWQgKyAnIHRlbXBvcmFyeSBiYW5uZWQ6ICcgKyBib2R5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBleGNlcHRpb25zW2Vycm9yXSAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnOiB1bmtub3duIGVycm9yIGNvZGU6ICcgKyBib2R5ICsgJyAnICsgZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghc3VjY2Vzcykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICc6IHN1Y2Nlc3MgdmFsdWUgZmFsc2U6ICcgKyBib2R5KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgLy8gYSB3b3JrYXJvdW5kIGZvciB7XCJjb2RlXCI6LTIwMTUsXCJtc2dcIjpcIkludmFsaWQgQVBJLWtleSwgSVAsIG9y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cGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MTE5LTM1OTMyMjBlLTVlY2UtMTFlNy04YjNhLTVhMDQxZjZiY2MzZi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9iaXQyYy5jby5pbCcsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXQyYy5jby5pbCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmJpdDJjLmNvLmlsL2hvbWUvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9PZmVyRS9iaXQyYycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnRXhjaGFuZ2VzL3twYWlyfS9UaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0V4Y2hhbmdlcy97cGFpcn0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFeGNoYW5nZXMve3BhaXJ9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRXhjaGFuZ2VzL3twYWlyfS9sYXN0dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdNZXJjaGFudC9DcmVhdGVDaGVja291dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkQ29pbkZ1bmRzUmVxdWVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkRnVuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZE9yZGVyTWFya2V0UHJpY2VCdXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZE9yZGVyTWFya2V0UHJpY2VTZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9DYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkQ29pbkZ1bmRzUmVxdWVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkU3RvcE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQYXltZW50L0dldE15SWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BheW1lbnQvU2VuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUGF5bWVudC9QYXknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9CYWxhbmNlL3YyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9NeU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvR2V0QnlJZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWNjb3VudEhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL09yZGVySGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL05JUyc6IHsgJ2lkJzogJ0J0Y05pcycsICdzeW1ib2wnOiAnQlRDL05JUycsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdOSVMnIH0sXG4gICAgICAgICAgICAgICAgJ0JDSC9OSVMnOiB7ICdpZCc6ICdCY2hOaXMnLCAnc3ltYm9sJzogJ0JDSC9OSVMnLCAnYmFzZSc6ICdCQ0gnLCAncXVvdGUnOiAnTklTJyB9LFxuICAgICAgICAgICAgICAgICdMVEMvTklTJzogeyAnaWQnOiAnTHRjTmlzJywgJ3N5bWJvbCc6ICdMVEMvTklTJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ05JUycgfSxcbiAgICAgICAgICAgICAgICAnQlRHL05JUyc6IHsgJ2lkJzogJ0J0Z05pcycsICdzeW1ib2wnOiAnQlRHL05JUycsICdiYXNlJzogJ0JURycsICdxdW90ZSc6ICdOSVMnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC41IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBiYWxhbmNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudEJhbGFuY2VWMiAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgYXZhaWxhYmxlID0gJ0FWQUlMQUJMRV8nICsgY3VycmVuY3k7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYmFsYW5jZVthdmFpbGFibGVdO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBiYWxhbmNlW2N1cnJlbmN5XTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRFeGNoYW5nZXNQYWlyT3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vayk7XG4gIC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uZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiBsYXN0LFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ3ByZXZpb3VzQ2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IGF2ZXJhZ2VQcmljZSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQ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hbGl6ZSAoc2lkZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvcmRlclsnUHJpY2UnXSA9IHByaWNlO1xuICAgICAgICAgICAgb3JkZXJbJ1RvdGFsJ10gPSBhbW91bnQgKiBwcmljZTtcbiAgICAgICAgICAgIG9yZGVyWydJc0JpZCddID0gKHNpZGUgPT09ICdidXknKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzdWx0ID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXN1bHQsXG4gICAgICAgICAgICAnaWQnOiByZXN1bHRbJ05ld09yZGVyJ11bJ2lkJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLnByaXZhdGVQb3N0T3JkZXJDYW5jZWxPcmRlciAoeyAnaWQnOiBpZCB9KTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICcuanNvbic7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2Ug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iAnNW1pbicsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNW1pbicsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG1pbicsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFob3VyJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnNGhvdXInLFxuICAgICAgICAgICAgICAgICc4aCc6ICc4aG91cicsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMXdlZWsnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzc4MDgwODEtYjg3ZjJkOWMtMmU1OS0xMWU4LTg5NGQtYzE5MDBiNzU4NGZlLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3B1YmxpYy5iaXRiYW5rLmNjJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkuYml0YmFuay5jYycsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYml0YmFuay5jYy8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9kb2NzLmJpdGJhbmsuY2MvJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL2JpdGJhbmsuY2MvZG9jcy9mZWVzLycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3BhaXJ9L3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3BhaXJ9L3RyYW5zYWN0aW9ucy97WVlZWU1NRER9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cGFpcn0vY2FuZGxlc3RpY2sve2NhbmRsZS10eXBlfS97WVlZWU1NRER9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYXNzZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Nwb3Qvb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvc3BvdC9hY3RpdmVfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Nwb3QvdHJhZGVfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93aXRoZHJhd2FsX2FjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Nwb3Qvb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvc3BvdC9jYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvc3BvdC9jYW5jZWxfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Nwb3Qvb3JkZXJzX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcmVxdWVzdF93aXRoZHJhd2FsJyxcbiA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iAnTFRDL0JUQycsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdCVEMnLCAnYmFzZUlkJzogJ2x0YycsICdxdW90ZUlkJzogJ2J0YycgfSxcbiAgICAgICAgICAgICAgICAnWFJQL0pQWSc6IHsgJ2lkJzogJ3hycF9qcHknLCAnc3ltYm9sJzogJ1hSUC9KUFknLCAnYmFzZSc6ICdYUlAnLCAncXVvdGUnOiAnSlBZJywgJ2Jhc2VJZCc6ICd4cnAnLCAncXVvdGVJZCc6ICdqcHknIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9KUFknOiB7ICdpZCc6ICdidGNfanB5JywgJ3N5bWJvbCc6ICdCVEMvSlBZJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0pQWScsICdiYXNlSWQnOiAnYnRjJywgJ3F1b3RlSWQnOiAnanB5JyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAvLyBvbmx5IHRlbXBvcmFyaWx5XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdKUFknOiBhbW91bnQgPT4gYW1vdW50ID4gMzAwMDAgPyA3NTYgOiA1NDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4xNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU9OQSc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcyMDAwMSc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzIwMDAyJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMjAwMDMnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcyMDAwNSc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzIwMDA0JzogSW52YWxpZE5vbmNlLFxuICAgICAgICAgICAgICAgICc0MDAyMCc6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAnNDAwMjEnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJzQwMDI1JzogRXhjaGFuZ2VFcnJvcixcbiAgICAgICAgICAgICAgICAnNDAwMTMnOiBPcmRlck5vdEZvdW5kLFxuICAgICAgICAgICAgICAgICc0MDAxNCc6IE9yZGVyTm90Rm91bmQsXG4gICAgICAgICAgICAgICAgJzUwMDA4JzogUGVybWlzc2lvbkRlbmllZCxcbiAgICAgICAgICAgICAgICAnNTAwMDknOiBPcmRlck5vdEZvdW5kLFxuICAgICAgICAgICAgICAgICc1MDAxMCc6IE9yZGVyTm90Rm91bmQsXG4gICAgICAgICAgICAgICAgJzYwMDAxJzogSW5zdWZmaWNpZW50RnVuZHMsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAg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gICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGlmICh0eXBlb2YgcHJpY2UgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgY3JlYXRlT3JkZXIgcmVxdWlyZXMgYSBwcmljZSBhcmd1bWVudCBmb3IgYm90aCBtYXJrZXQgYW5kIGxpbWl0IG9yZGVycycpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMuYW1vdW50VG9TdHJpbmcgKHN5bWJvbCwgYW1vdW50KSxcbiAgICAgICAgICAgICdwcmljZSc6IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSksXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZX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S50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2U7XG4gICAgICAgICAgICB1cmwgKz0gdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ1BPU1QnKSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgIGF1dGggKz0gYm9keTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYXV0aCArPSAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBxdWVyeSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyBxdWVyeTtcbiAgICAgICAgICAgICAgICAgICAgYXV0aCArPSAnPycgKyBxdWVyeTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgJ0FDQ0VTUy1LRVknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnQUNDRVNTLU5PTkNFJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ0FDQ0VTUy1TSUdOQVRVUkUnOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2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gICAgICAgICAgJzMwMDE5JzogJ1BsZWFzZSBzcGVjaWZ5IHV1aWQnLFxuICAgICAgICAgICAgICAgICczMDAzOSc6ICdQbGVhc2Ugc3BlY2lmeSB0aGUgYW1vdW50IHRvIGJlIHdpdGhkcmF3bicsXG4gICAgICAgICAgICAgICAgJzQwMDAxJzogJ1RoZSBvcmRlciBxdWFudGl0eSBpcyBpbnZhbGlkJyxcbiAgICAgICAgICAgICAgICAnNDAwMDYnOiAnQ291bnQgdmFsdWUgaXMgaW52YWxpZCcsXG4gICAgICAgICAgICAgICAgJzQwMDA3JzogJ0VuZCB0aW1lIGlzIGludmFsaWQnLFxuICAgICAgICAgICAgICAgICc0MDAwOCc6ICdlbmRfaWQgVmFsdWUgaXMgaW52YWxpZCcsXG4gICAgICAgICAgICAgICAgJzQwMDA5JzogJ1RoZSBmcm9tX2lkIHZhbHVlIGlzIGludmFsaWQnLFxuICAgICAgICAgICAgICAgICc0MDAxMyc6ICdUaGUgb3JkZXIgSUQgaXMgaW52YWxpZCcsXG4gICAgICAgICAgICAgICAgJzQwMDE0JzogJ1RoZSBvcmRlciBJRCBhcnJheSBpcyBpbnZhbGlkJyxcbiAgICAgICAgICAgICAgICAnNDAwMTUnOiAnVG9vIG1hbnkgc3BlY2lmaWVkIG9yZGVycycsXG4gICAgICAgICAgICAgICAgJzQwMDE3JzogJ0luY29ycmVjdCBpc3N1ZSBuYW1lJyxcbiAgICAgICAgICAgICAgICAnNDAwMjAnOiAnVGhlIG9yZGVyIHByaWNlIGlzIGludmFsaWQnLFxuICAgICAgICAgICAgICAgICc0MDAyMSc6ICdUaGUgdHJhZGluZyBjbGFzc2lmaWNhdGlvbiBpcyBpbnZhbGlkJyxcbiAgICAgICAgICAgICAgICAnNDAwMjInOiAnU3RhcnQgZGF0ZSBpcyBpbnZhbGlkJyxcbiAgICAgICAgICAgICAgICAnNDAwMjQnOiAnVGhlIG9yZGVyIHR5cGUgaXMgaW52YWxpZCcsXG4gICAgICAgICAgICAgIC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mV0L0FQSS9QdWJsaWMnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2JpdGJheS5uZXQvQVBJL1RyYWRpbmcvdHJhZGluZ0FwaS5waHAnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0YmF5Lm5ldC9wdWJsaWMtYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0YmF5Lm5ldC9hY2NvdW50L3RhYi1hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0JpdEJheU5ldC9BUEknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9iaXRiYXkubmV0L2VuL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9tYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ0JUQ1VTRCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnLCAnYmFzZUlkJzogJ0JUQycsICdxdW90ZUlkJzogJ1VTRCcgfSxcbiAgICAgICAgICAgICAgICAnQlRDL0VVUic6IHsgJ2lkJzogJ0JUQ0VVUicsICdzeW1ib2wnOiAnQlRDL0VVUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdFVVInLCAnYmFzZUlkJzogJ0JUQycsICdxdW90ZUlkJzogJ0VVUicgfSxcbiAgICAgICAgICAgICAgICAnQlRDL1BMTic6IHsgJ2lkJzogJ0JUQ1BMTicsICdzeW1ib2wnOiAnQlRDL1BMTicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdQTE4nLCAnYmFzZUlkJzogJ0JUQycsICdxdW90ZUlkJzogJ1BMTicgfSxcbiAgICAgICAgICAgICAgICAnTFRDL1VTRCc6IHsgJ2lkJzogJ0xUQ1VTRCcsICdzeW1ib2wnOiAnTFRDL1VTRCcsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdVU0QnLCAnYmFzZUlkJzogJ0xUQycsICdxdW90ZUlkJzogJ1VTRCcgfSxc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AgICAgJ3Rha2VyJzogMC4wMDQzLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMDksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDEyNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMU0snOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDA2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dBTUUnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDA4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMTic6IDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMS41LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzQwMCc6IEV4Y2hhbmdlRXJyb3IsIC8vIEF0IGxlYXN0IG9uZSBwYXJhbWV0ZXIgd2Fzbid0IHNldFxuICAgICAgICAgICAgICAgICc0MDEnOiBJbnZhbGlkT3JkZXIsIC8vIEludmFsaWQgb3JkZXIgdHlwZVxuICAgICAgICAgICAgICAgICc0MDInOiBJbnZhbGlkT3JkZXIsIC8vIE5vIG9yZGVycyB3aXRoIHNwZWNpZmllZCBjdXJyZW5jaWVzXG4gICAgICAgICAgICAgICAgJzQwMyc6IEludmFsaWRPcmRlciwgLy8gSW52YWxpZCBwYXltZW50IGN1cnJlbmN5IG5hbWVcbiAgICAgICAgICAgICAgICAnNDA0JzogSW52YWxpZE9yZGVyLCAvLyBFcnJvci4gV3JvbmcgdHJhbnNhY3Rpb24gdHlwZVxuICAgICAgICAgICAgICAgICc0MDUnOiBJbnZhbGlkT3JkZXIsIC8vIE9yZGVyIHdpdGggdGhpcyBpZCBkb2Vzbid0IGV4aXN0XG4gICAgICAgICAgICAgICAgJzQwNic6IEluc3VmZmljaWVudEZ1bmRzLCAvLyBObyBlbm91Z2ggbW9uZXkgb3IgY3J5cHRvXG4gICAgICAgICAgICAgICAgLy8gY29kZSA0MDcgbm90IHNwZWNpZmllZCBhcmUgbm90IHNwZWNpZmllZCBpbiB0aGVpciBkb2NzXG4gICAgICAgICAgICAgICAgJzQwOCc6IEludmFsaWRPcmRlciwgLy8gSW52YWxpZCBjdXJyZW5jeSBuYW1lXG4gICAgICAgICAgICAgICAgJzUwMSc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsIC8vIEludmFsaWQgcHVibGljIGtleVxuICAgICAgICAgICAgICAgICc1MDInOiBBdXRoZW50aWNhdGlvbkVycm9yLCAvLyBJbnZhbGlkIHNpZ25cbiAgICAgICAgICAgICAgICAnNTAzJzogSW52YWxpZE5vbmNlLCAvLyBJbnZhbGlkIG1vbWVudCBwYXJhbWV0ZXIuIFJlcXVlc3QgdGltZSBkb2Vzbid0IG1hdGNoIGN1cnJlbnQgc2VydmVyIHRpbWVcbiAgICAgICAgICAgICAgICAnNTA0JzogRXhjaGFuZ2VFcnJvciwgLy8gSW52YWxpZCBtZXRob2RcbiAgICAgICAgICAgICAgICAnNTA1JzogQXV0aGVudGljYXRpb25FcnJvciwgLy8gS2V5IGhhcyBubyBwZXJtaXNzaW9uIGZvciB0aGlzIGFjdGlvblxuICAgICAgICAgICAgICAgICc1MDYnOiBBdXRoZW50aWNhdGlvbkVycm9yLCAvLyBBY2NvdW50IGxvY2tlZC4gUGxlYXNlIGNvbnRhY3Qgd2l0aCBjdXN0b21lciBzZXJ2aWNlXG4gICAgICAgICAgICAgICAgLy8gY29kZXMgNTA3IGFuZCA1MDggYXJlIG5vdCBzcGVjaWZpZWQgaW4gdGhlaXIgZG9jc1xuICAgICAgICAgICAgICAgICc1MDknOiBFeGNoYW5nZUVycm9yLCAvLyBUaGUgQklDL1NXSUZUIGlzIHJlcXVpcmVkIGZvciB0aGlzIGN1cnJlbmN5XG4gICAgICAgICAgICAgICAgJzUxMCc6IEV4Y2hhbmdlRXJyb3IsIC8vIEludmFsaWQgbWFya2V0IG5hbWVcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEluZm8gKCk7XG4gICAgICAgIGlmICgnYmFsYW5jZXMnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IHJlc3BvbnNlWydiYWxhbmNlcyddO1xuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlIH07XG4gICAgICAgICAgICBsZXQgY29kZXMgPSBPYmplY3Qua2V5cyAodGhpcy5jdXJyZW5jaWVzKTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY29kZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgY29kZSA9IGNvZGVzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY3VycmVuY2llc1tjb2RlXTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jeVsnaWQnXTtcbiAgICAgICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgICAgICBpZiAoaWQgaW4gYmFsYW5jZSkge1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlW2lkXVsnYXZhaWxhYmxlJ10pO1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlW2lkXVsnbG9ja2VkJ10pO1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0gYWNjb3VudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICAgICAgfVxuICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZW1wdHkgYmFsYW5jZSByZXNwb25zZSAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRJZE9yZGVyYm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRJZFRpY2tlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgIC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ZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnbW9tZW50JzogdGhpcy5ub25jZSAoKSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0FQSS1LZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnQVBJLUhhc2gnOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChib2R5KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoaHR0cENvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBib2R5ICE9PSAnc3RyaW5nJylcbiAgICAgICAgICAgIHJldHVybjsgLy8gZmFsbGJhY2sgdG8gZGVmYXVsdCBlcnJvciBoYW5kbGVyXG4gICAgICAgIGlmIChib2R5Lmxlbmd0aCA8IDIpXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIGlmICgoYm9keVswXSA9PT0gJ3snKSB8fCAoYm9keVswXSA9PT0gJ1snKSkge1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNl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ZXhpc3RcbiAgICAgICAgICAgICAgICAvLyAgICAgIDQwNiBObyBlbm91Z2ggbW9uZXkgb3IgY3J5cHRvXG4gICAgICAgICAgICAgICAgLy8gICAgICA0MDggSW52YWxpZCBjdXJyZW5jeSBuYW1lXG4gICAgICAgICAgICAgICAgLy8gICAgICA1MDEgSW52YWxpZCBwdWJsaWMga2V5XG4gICAgICAgICAgICAgICAgLy8gICAgICA1MDIgSW52YWxpZCBzaWduXG4gICAgICAgICAgICAgICAgLy8gICAgICA1MDMgSW52YWxpZCBtb21lbnQgcGFyYW1ldGVyLiBSZXF1ZXN0IHRpbWUgZG9lc24ndCBtYXRjaCBjdXJyZW50IHNlcnZlciB0aW1lXG4gICAgICAgICAgICAgICAgLy8gICAgICA1MDQgSW52YWxpZCBtZXRob2RcbiAgICAgICAgICAgICAgICAvLyAgICAgIDUwNSBLZXkgaGFzIG5vIHBlcm1pc3Npb24gZm9yIHRoaXMgYWN0aW9uXG4gICAgICAgICAgICAgICAgLy8gICAgICA1MDYgQWNjb3VudCBsb2NrZWQuIFBsZWFzZSBjb250YWN0IHdpdGggY3VzdG9tZXIgc2VydmljZVxuICAgICAgICAgICAgICAgIC8vICAgICAgNTA5IFRoZSBCSUMvU1dJRlQgaXMgcmVxdWlyZWQgZm9yIHRoaXMgY3VycmVuY3lcbiAgICAgICAgICAgICAgICAvLyAgICAgIDUxMCBJbnZhbGlkIG1hcmtldCBuYW1lXG4gICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICBsZXQgY29kZSA9IHJlc3BvbnNlWydjb2RlJ107IC8vIGFsd2F5cyBhbiBpbnRlZ2VyXG4gICAgICAgICAgICAgICAgY29uc3QgZmVlZGJhY2sgPSB0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgY29uc3QgZXhjZXB0aW9ucyA9IHRoaXMuZXhjZXB0aW9ucztcbiAgICAgICAgICAgICAgICBpZiAoY29kZSBpbiB0a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ICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdiaXRmaW5leCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdCaXRmaW5leCcsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1ZHJyxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgLy8gbmV3IG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVEZXBvc2l0QWRkcmVzcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRyYWRpbmdGZWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hGdW5kaW5nRmVlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW0nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNW0nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMWgnLFxuICAgICAgICAgICAgICAgICczaCc6ICczaCcsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzEyaCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFEJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnN0QnLFxuICAgICAgICAgICAgICAgICcydyc6ICcxNEQnLFxuICAgICAgICAgICAgICAgICcxTSc6ICcxTScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjI0NC1lMzI4YTUwYy01ZWQyLTExZTctOTQ3Yi0wNDE0MTY1NzliYjMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJpdGZpbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRmaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpdGZpbmV4LnJlYWRtZS5pby92MS9kb2NzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9iaXRmaW5leGNvbS9iaXRmaW5leC1hcGktbm9kZScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd2Mic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L3tzZWN0aW9ufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuZGxlcy90cmFkZTp7dGltZWZyYW1lfTp7c3ltYm9sfS9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdib29rL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdjYW5kbGVzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kYm9vay97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kcy97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwdWJ0aWNrZXIve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2xzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2xzX2RldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RvZGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRfZmVlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudF9pbmZvcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jhc2tldF9tYW5hZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWRpdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5nL2Nsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L21vdmVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2V5X2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbl9pbmZvcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215dHJhZGVzX2Z1bmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29mZmVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2ZmZXIvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvZmZlci9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29mZmVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2ZmZXJzL2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsL211bHRpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwvcmVwbGFjZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9uZXcvbXVsdGknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vY2xhaW0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2Nsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VuX2Z1bmRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0b3RhbF90YWtlbl9mdW5kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VudXNlZF90YWtlbl9mdW5kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGllcnMnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAndGFrZXInOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMCwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMCwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMCwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwMCwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNzUwMDAwMCwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAsIDAuMTggLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxNTAwMDAwMCwgMC4xNiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAwLCAwLjE0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMDAsIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFszMDAwMDAwMCwgMC4xIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDAuMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMCwgMC4wOCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAsIDAuMDYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAwLCAwLjA0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwMCwgMC4wMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzc1MDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzE1MDAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzMwMDAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLCAvLyB0cnVlIGZvciB0aWVyLWJhc2VkL3Byb2dyZXNzaXZlXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsIC8vIGZpeGVkIGNvbW1pc3Npb25cbiAgICAgICAgICAgICAgICAgICAgLy8gQWN0dWFsbHkgZGVwb3NpdCBmZWVzIGFyZSBmcmVlIGZvciBsYXJnZXIgZGVwb3NpdHMgKD4gJDEwMDAgVVNEIGVxdWl2YWxlbnQpXG4gICAgICAgICAgICAgICAgICAgIC8vIHRoZXNlIHZhbHVlcyBiZWxvdyBhcmUgZGVwcmVjYXRlZCwgd2Ugc2hvdWxkIG5vdCBoYXJkY29kZSBmZWVzIGFuZCBsaW1pdHMgYW55bW9yZVxuICAgICAgICAgICAgICAgICAgICAvLyB0byBiZSByZWltcGxlbWVudGVkIHdpdGggYml0ZmluZXggZnVuZGluZyBmZWVzIGZyb20gdGhlaXIgQVBJIG9yIHdlYiBlbmRwb2ludHNcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lPVEEnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDI3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjI0Mjc5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMC45OTI2OSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWVlXJzogMTYuOTE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLjE0MDI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBVEEnOiAyMC43NzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFTSCc6IDEuOTg1OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDAuOTUwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMS4zMDQ1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDI4LjE4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAxLjk5NDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkNOJzogMTAuNzkzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ROQic6IDMxLjkxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAxNC45NzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkxDJzogMS40MTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05UJzogNS44OTUyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NQSyc6IDEwLjg5MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRVAnOiAwLjA0MTE2OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQVQnOiA2LjE1NDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxGJzogMS44NzUzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDMyLjMzNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkcnOiAxOC42MjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUlEJzogOC4wOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNTkEnOiAxNi42MTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVDJzogMS42NTA0LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lPVEEnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDI3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjI0Mjc5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMC45OTI2OSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWVlXJzogMTYuOTE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLjE0MDI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBVEEnOiAyMC43NzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFTSCc6IDEuOTg1OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDAuOTUwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMS4zMDQ1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAyMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAyOC4xODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlJYJzogMS45OTQ3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JDTic6IDEwLjc5MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTkInOiAzMS45MTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMTQuOTc2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JMQyc6IDEuNDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOVCc6IDUuODk1MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTUEsnOiAxMC44OTMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMC4wNDExNjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFUJzogNi4xNTQ2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMRic6IDEuODc1MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAzMi4zMzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05HJzogMTguNjIyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FJRCc6IDguMDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU5BJzogMTYuNjE3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FQyc6IDEuNjUwNCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdCQ0MnOiAnQ1NUX0JDQycsXG4gICAgICAgICAgICAgICAgJ0JDVSc6ICdDU1RfQkNVJyxcbiAgICAgICAgICAgICAgICAnREFUJzogJ0RBVEEnLFxuICAgICAgICAgICAgICAgICdEU0gnOiAnREFTSCcsIC8vIEJpdGZpbmV4IG5hbWVzIERhc2ggYXMgRFNILCBpbnN0ZWFkIG9mIERBU0hcbiAgICAgICAgICAgICAgICAnSU9TJzogJ0lPU1QnLFxuICAgICAgICAgICAgICAgICdJT1QnOiAnSU9UQScsXG4gICAgICAgICAgICAgICAgJ01OQSc6ICdNQU5BJyxcbiAgICAgICAgICAgICAgICAnUVNIJzogJ1FBU0gnLFxuICAgICAgICAgICAgICAgICdRVE0nOiAnUVRVTScsXG4gICAgICAgICAgICAgICAgJ1NORyc6ICdTTkdMUycsXG4gICAgICAgICAgICAgICAgJ1NQSyc6ICdTUEFOSycsXG4gICAgICAgICAgICAgICAgJ1lZVyc6ICdZT1lPVycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdG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ICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsncHJpY2VfcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsncHJpY2VfcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbmltdW1fb3JkZXJfc2l6ZScpLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heGltdW1fb3JkZXJfc2l6ZScpLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxpbWl0c1snY29zdCddID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBsaW1pdHNbJ2Ftb3VudCddWydtaW4nXSAqIGxpbWl0c1sncHJpY2UnXVsnbWluJ10sXG4gICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgY29zdFRvUHJlY2lzaW9uIChzeW1ib2wsIGNvc3QpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVjaW1hbFRvUHJlY2lzaW9uIChjb3N0LCBST1VORCwgdGhpcy5tYXJrZXRzW3N5bWJvbF1bJ3ByZWNpc2lvbiddWydwcmljZSddLCB0aGlzLnByZWNpc2lvbk1vZGUpO1xuICAgIH1cblxuICAgIHByaWNlVG9QcmVjaXNpb24gKHN5bWJvbCwgcHJpY2UpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVjaW1hbFRvUHJlY2lzaW9uIChwcmljZSwgUk9VTkQsIHRoaXMubWFya2V0c1tzeW1ib2xdWydwcmVjaXNpb24nXVsncHJpY2UnXSwgdGhpcy5wcmVjaXNpb25Nb2RlKTtcbiAgICB9XG5cbiAgICBhbW91bnRU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ZmluZWQnKSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB9IGVsc2UgaWYgKCdwYWlyJyBpbiB0aWNrZXIpIHtcbiAgICAgICAgICAgIGxldCBpZCA9IHRpY2tlclsncGFpciddO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGVJZCA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdF9wcmljZScpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc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WUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXJJZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gNTAsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ2xpbWl0X3RyYWRlcyc6IGxpbWl0LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZW9mIHNpbmNlICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHJlcXVlc3RbJ3RpbWVzdGFtcCddID0gcGFyc2VJbnQgKHNpbmNlIC8gMTAwMCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVzU3ltYm9sICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGN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V4Y2hhbmdlICcpID49IDA7XG4gICAgICAgIGlmIChleGNoYW5nZSkge1xuICAgICAgICAgICAgbGV0IHBhcnRzID0gb3JkZXJbJ3R5cGUnXS5zcGxpdCAoJyAnKTtcbiAgICAgICAgICAgIG9yZGVyVHlwZSA9IHBhcnRzWzFdO1xuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAocGFyc2VGbG9hdCAob3JkZXJbJ3RpbWVzdGFtcCddKSAqIDEwMDApO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdhdmdfZXhlY3V0aW9uX3ByaWNlJyksXG4gICAgICAgICAgICAnYW1vdW50JzogdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnb3JpZ2luYWxfYW1vdW50JyksXG4gICAgICAgICAgICAncmVtYWluaW5nJzogdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncmVtYWluaW5nX2Ftb3VudCcpLFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ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4gICAgICAgIGNvbnN0IG5hbWVzID0ge1xuICAgICAgICAgICAgJ0FHSSc6ICdhZ2knLFxuICAgICAgICAgICAgJ0FJRCc6ICdhaWQnLFxuICAgICAgICAgICAgJ0FJTyc6ICdhaW8nLFxuICAgICAgICAgICAgJ0FOVCc6ICdhbnQnLFxuICAgICAgICAgICAgJ0FWVCc6ICdhdmVudHVzJywgLy8gIzE4MTFcbiAgICAgICAgICAgICdCQVQnOiAnYmF0JyxcbiAgICAgICAgICAgICdCQ0gnOiAnYmNhc2gnLCAvLyB1bmRvY3VtZW50ZWRcbiAgICAgICAgICAgICdCQ0knOiAnYmNpJyxcbiAgICAgICAgICAgICdCRlQnOiAnYmZ0JyxcbiAgICAgICAgICAgICdCVEMnOiAnYml0Y29pbicsXG4gICAgICAgICAgICAnQlRHJzogJ2Jnb2xkJyxcbiAgICAgICAgICAgICdDRkknOiAnY2ZpJyxcbiAgICAgICAgICAgICdEQUknOiAnZGFpJyxcbiAgICAgICAgICAgICdEQVNIJzogJ2Rhc2gnLFxuICAgICAgICAgICAgJ0RBVEEnOiAnZGF0YWNvaW4nLFxuICAgICAgICAgICAgJ0RUSCc6ICdkdGgnLFxuICAgICAgICAgICAgJ0VETyc6ICdlaWRvbycsIC8vICMxODExXG4gICAgICAgICAgICAnRUxGJzogJ2VsZicsXG4gICAgICAgICAgICAnRU9TJzogJ2VvcycsXG4gICAgICAgICAgICAnRVRDJzogJ2V0aGVyZXVtYycsXG4gICAgICAgICAgICAnRVRIJzogJ2V0aGVyZXVtJyxcbiAgICAgICAgICAgICdFVFAnOiAnbWV0YXZlcnNlJyxcbiAgICAgICAgICAgICdGVU4nOiAnZnVuJyxcbiAgICAgICAgICAgICdHTlQnOiAnZ29sZW0nLFxuICAgICAgICAgICAgJ0lPU1QnOiAnaW9zJyxcbiAgICAgICAgICAgICdJT1RBJzogJ2lvdGEnLFxuICAgICAgICAgICAgJ0xSQyc6ICdscmMnLFxuICAgICAgICAgICAgJ0xUQyc6ICdsaXRlY29pbicsXG4gICAgICAgICAgICAnTUFOQSc6ICdtbmEnLFxuICAgICAgICAgICAgJ01JVCc6ICdtaXQnLFxuICAgICAgICAgICAgJ01UTic6ICdtdG4nLFxuICAgICAgICAgICAgJ05FTyc6ICduZW8nLFxuICAgICAgICAgICAgJ09ERSc6ICdvZGUnLFxuICAgICAgICAgICAgJ09NRyc6ICdvbWlzZWdvJyxcbiAgICAgICAgICAgICdPTU5JJzogJ21hc3RlcmNvaW4nLFxuICAgICAgICAgICAgJ1FBU0gnOiAncWFzaCcsXG4gICAgICAgICAgICAnUVRVTSc6ICdxdHVtJywgLy8gIzE4MTFcbiAgICAgICAgICAgICdSQ04nOiAncmNuJyxcbiAgICAgICAgICAgICdSRE4nOiAncmRuJyxcbiAgICAgICAgICAgICdSRVAnOiAncmVwJyxcbiAgICAgICAgICAgICdSRVEnOiAncmVxJyxcbiAgICAgICAgICAgICdSTEMnOiAncmxjJyxcbiAgICAgICAgICAgICdTQU4nOiAnc2FudGltZW50JyxcbiAgICAgICAgICAgICdTTkdMUyc6ICdzbmcnLFxuICAgICAgICAgICAgJ1NOVCc6ICdzdGF0dXMnLFxuICAgICAgICAgICAgJ1NQQU5LJzogJ3NwaycsXG4gICAgICAgICAgICAnU1RKJzogJ3N0aicsXG4gICAgICAgICAgICAnVE5CJzogJ3RuYicsXG4gICAgICAgICAgICAnVFJYJzogJ3RyeCcsXG4gICAgICAgICAgICAnVVNEJzogJ3dpcmUnLFxuICAgICAgICAgICAgJ1VTRFQnOiAndGV0aGVydXNvJywgLy8gdW5kb2N1bWVudGVkXG4gICAgICAgICAgICAnV0FYJzogJ3dheCcsXG4gICAgICAgICAgICAnWExNJzogJ3hsbScsXG4gICAgICAgICAgICAnWE1SJzogJ21vbmVybycsXG4gICAgICAgICAgICAnWFJQJzogJ3JpcHBsZScsXG4gICAgICAgICAgICAnWFZHJzogJ3h2ZycsXG4gICAgICAgICAgICAnWU9ZT1cnOiAneW95b3cnLFxuICAgICAgICAgIC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UgKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICB1cmwgKz0gc3VmZml4O1xuICAgICAgICAgICAgICAgIHJlcXVlc3QgKz0gc3VmZml4O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgICAgICdyZXF1ZXN0JzogcmVxdWVzdCxcbiAgICAgICAgICAgIH0sIHF1ZXJ5KTtcbiAgICAgICAgICAgIHF1ZXJ5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IHRoaXMuc3RyaW5nVG9CYXNlNjQgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGxldCBzZWNyZXQgPSB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAocGF5bG9hZCwgc2VjcmV0LCAnc2hhMzg0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdYLUJGWC1BUElLRVknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnWC1CRlgtUEFZTE9BRCc6IHRoaXMuZGVjb2RlIChwYXlsb2FkKSxcbiAgICAgICAgICAgICAgICAnWC1CRlgtU0lHTkFUVVJFJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGZpbmRCcm9hZGx5TWF0Y2hlZEtleSAobWFwLCBicm9hZFN0cmluZykge1xuICAgICAgICBjb25zdCBwYXJ0aWFsS2V5cyA9IE9iamVjdC5rZXlzIChtYXApO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHBhcnRpYWxLZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBjb25zdCBwYXJ0aWFsS2V5ID0gcGFydGlhbEtleXNbaV07XG4gICAgICAgICAgICBpZiAoYnJvYWRTdHJpbmcuaW5kZXhPZiAocGFydGlhbEtleSkgPj0gMClcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFydGlhbEtleTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoYm9keS5sZW5ndGggPCAyKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBpZiAoY29kZSA+PSA0MDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdID09PSAneycpIHtcbiAgICAgICAgICAgICAgICBjb25zdCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGNvbnN0IGZlZWRiYWNrID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2UpXG4gICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgPSByZXNwb25zZVsnbWVzc2FnZSddO1xuICAgICAgICAgICAgICAgIGVsc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AgICAgICAgICAgICAnZmV0Y2hGdW5kaW5nRmVlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVHJhZGluZ0ZlZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG0nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaCcsXG4gICAgICAgICAgICAgICAgJzNoJzogJzNoJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMUQnLFxuICAgICAgICAgICAgICAgICcxdyc6ICc3RCcsXG4gICAgICAgICAgICAgICAgJzJ3JzogJzE0RCcsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFNJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYyNDQtZTMyOGE1MGMtNWVkMi0xMWU3LTk0N2ItMDQxNDE2NTc5YmIzLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5iaXRmaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0ZmluZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRmaW5leC5yZWFkbWUuaW8vdjIvZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYml0ZmluZXhjb20vYml0ZmluZXgtYXBpLW5vZGUnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cuYml0ZmluZXguY29tL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3YxJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHNfZGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYXRmb3JtL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS97cHJlY2lzaW9ufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9SMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS97c2lkZX0ve3NlY3Rpb259JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L2xvbmcvbGFzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS9sb25nL2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzMS97a2V5fTp7c2l6ZX06e3N5bWJvbH0vc2hvcnQvbGFzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS9zaG9ydC9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L3tzZWN0aW9ufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuZGxlcy90cmFkZTp7dGltZWZyYW1lfTp7c3ltYm9sfS9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYWxjL3RyYWRlL2F2ZycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL3dhbGxldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlcnMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlcnMve3N5bWJvbH0vbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3Ivb3JkZXJzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlci97c3ltYm9sfTp7aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL3RyYWRlcy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9vZmZlcnMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL29mZmVycy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9sb2Fucy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvbG9hbnMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvY3JlZGl0cy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvY3JlZGl0cy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy90cmFkZXMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2luZm8vbWFyZ2luL3trZXl9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvaW5mby9mdW5kaW5nL3trZXl9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvbW92ZW1lbnRzL3tjdXJyZW5jeX0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL3N0YXRzL3BlcmY6e3RpbWVmcmFtZX0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2FsZXJ0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC93L2FsZXJ0L3NldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC93L2FsZXJ0L3t0eXBlfTp7c3ltYm9sfTp7cHJpY2V9L2RlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9jYWxjL29yZGVyL2F2YWlsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvbGVkZ2Vycy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU9UJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FTyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVE0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVQnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NBTic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NQSyc6IDkuMjc4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQVQnOiA5LjA4ODMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05UJzogOC4yODgxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOVCc6IDE0LjMwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVNIJzogMy4yNDI4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lZVyc6IDE4LjA1NSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgaXNGaWF0IChjb2RlKSB7XG4gICAgICAgIGxldCBmaWF0ID0ge1xuICAgICAgICAgICAgJ1VTRCc6ICdVU0QnLFxuICAgICAgICAgICAgJ0VVUic6ICdFVVInLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gKGNvZGUgaW4gZmlhdCk7XG4gICAgfVxuXG4gICAgZ2V0Q3VycmVuY3lJZCAoY29kZSkge1xuICAgICAgICBsZXQgaXNGaWF0ID0gdGhpcy5pc0ZpYXQgKGNvZGUpO1xuICAgICAgICBsZXQgcHJlZml4ID0gaXNGaWF0ID8gJ2YnIDogJ3QnO1xuICAgICAgICByZXR1cm4gcHJlZml4ICsgY29kZTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMudjFHZXRTeW1ib2xzRGV0YWlscyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydwYWlyJ10udG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGlkID0gJ3QnICsgaWQ7XG4gICAgICAgICAgICBiYXNlSWQgPSB0aGlzLmdldEN1cnJlbmN5SWQgKGJhc2VJZCk7XG4gICAgICAgICAgICBxdW90ZUlkID0gdGhpcy5nZXRDdXJyZW5jeUlkIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwcmljZV9wcmVjaXNpb24nXSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0WydwcmljZV9wcmVjaXNpb24nXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluaW11bV9vcmRlcl9zaXplJyksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4aW11bV9vcmRlcl9zaXplJyksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGltaXRzWydjb3N0J10gPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IGxpbWl0c1snYW1vdW50J11bJ21pbiddICogbGltaXRzWydwcmljZSddWydtaW4nXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzogbGltaXRzLFxuICAgICAgICAgICAgICAgICdsb3QnOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QXV0aFJXYWxsZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZVR5cGUgPSB0aGlzLnNhZmVTdHJpbmcgKHBhcmFtcywgJ3R5cGUnLCAnZXhjaGFuZ2UnKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IHJlc3BvbnNlLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IHJlc3BvbnNlW2JdO1xuICAgICAgICAgICAgbGV0IGFjY291bnRUeXBlID0gYmFsYW5jZVswXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbMV07XG4gICAgICAgICAgICBsZXQgdG90YWwgPSBiYWxhbmNlWzJdO1xuICAgICAgICAgICAgbGV0IGF2YWlsYWJsZSA9IGJhbGFuY2VbNF07XG4gICAgICAgICAgICBpZiAoYWNjb3VudFR5cGUgPT09IGJhbGFuY2VUeXBlKSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5WzBdID09PSAndCcpXG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbmN5ID0gY3VycmVuY3kuc2xpY2UgKDEpO1xuICAgICAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICB1cHBlcmNhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAodXBwZXJjYXNlKTtcbiAgICAgICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBhdmFpbGFibGU7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRvdGFsO1xuICAgICAgICAgICAgICAgIGlmIChhY2NvdW50WydmcmVlJ10pXG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICAgICAgcmVzdWx0W3VwcGVyY2FzZV0gPSBhY2NvdW50O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0Qm9va1N5bWJvbFByZWNpc2lvbiAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6ICdSMCcsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnYmlkcyc6IFtdLFxuICAgICAgICAgICAgJ2Fza3MnOiBbXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbm9uY2UnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb3JkZXJib29rLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSBvcmRlcmJvb2tbaV07XG4gICAgICAgICAgICBsZXQgcHJpY2UgPSBvcmRlclsxXTtcbiAgICAgICAgICAgIGxldCBhbW91bnQgPSBvcmRlclsyXTtcbiAgICAgICAgICAgIGxldCBzaWRlID0gKGFtb3VudCA+IDApID8gJ2JpZHMnIDogJ2Fza3MnO1xuICAgICAgICAgICAgYW1vdW50ID0gTWF0aC5hYnMgKGFtb3VudCk7XG4gICAgICAgICAgICByZXN1bHRbc2lkZV0ucHVzaCAoWyBwcmljZSwgYW1vdW50IF0pO1xuICAgICAgICB9XG4gICAgICAgIHJlc3VsdFsnYmlkcyddID0gdGh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zeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCBbIGlkLCB0aW1lc3RhbXAsIGFtb3VudCwgcHJpY2UgXSA9IHRyYWRlO1xuICAgICAgICBsZXQgc2lkZSA9IChhbW91bnQgPCAwKSA/ICdzZWxsJyA6ICdidXknO1xuICAgICAgICBpZiAoYW1vdW50IDwgMCkge1xuICAgICAgICAgICAgYW1vdW50ID0gLWFtb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQudG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB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AgICAgICAgcmVxdWVzdCA9IHRoaXMudmVyc2lvbiArIHJlcXVlc3Q7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgcmVxdWVzdDtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSAnL2FwaScgKyAnLycgKyByZXF1ZXN0ICsgbm9uY2UgKyBib2R5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMzg0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdiZngtbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYmZ4LWFwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdiZngtc2lnbmF0dXJlJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2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nLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODA1MTY0Mi01NjE1NDE4Mi02NjBlLTExZTctOWIwZC02MDQyZDFlNmVkZDguanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJpdGZseWVyLmpwJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYml0Zmx5ZXIuanAnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9iaXRmbHllci5qcC9BUEknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRtYXJrZXRzL3VzYScsIC8vIG5ldyAod2lwKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG1hcmtldHMvZXUnLCAgLy8gbmV3ICh3aXApXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0bWFya2V0cycsICAgICAvLyBvciAnbWFya2V0cydcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRib2FyZCcsICAgICAgIC8vIC4uLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHRpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZXhlY3V0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0aGVhbHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRib2FyZHN0YXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjaGF0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRwZXJtaXNzaW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29sbGF0ZXJhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29sbGF0ZXJhbGFjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRhZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGNvaW5pbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGNvaW5vdXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYW5rYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGRlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y2hpbGRvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBhcmVudG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0cGFyZW50b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGV4ZWN1dGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBvc2l0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0dHJhZGluZ2NvbW1pc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kY29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbmRjaGlsZG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxjaGlsZG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kcGFyZW50b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbHBhcmVudG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxhbGxjaGlsZG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IGpwX21hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEdldG1hcmtldHMgKCk7XG4gICAgICAgIGxldCB1c19tYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRHZXRtYXJrZXRzVXNhICgpO1xuICAgICAgICBsZXQgZXVfbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0R2V0bWFya2V0c0V1ICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHRoaXMuYXJyYXlDb25jYXQgKGpwX21hcmtldHMsIHVzX21hcmtldHMpO1xuICAgICAgICBtYXJrZXRzID0gdGhpcy5hcnJheUNvbmNhdCAobWFya2V0cywgZXVfbWFya2V0cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsncHJvZHVjdF9jb2RlJ107XG4gICAgICAgICAgICBsZXQgY3VycmVuY2llcyA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgbnVtQ3VycmVuY2llcyA9IGN1cnJlbmNpZXMubGVuZ3RoO1xuICAgICAgICAgICAgaWYgKG51bUN1cnJlbmNpZXMgPT09IDEpIHtcbiAgICAgICAgICAgICAgICBiYXNlID0gc3ltYm9sLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IHN5bWJvbC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG51bUN1cnJlbmNpZXMgPT09IDIpIHtcbiAgICAgICAgICAgICAgICBiYXNlID0gY3VycmVuY2llc1swXTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IGN1cnJlbmNpZXNbMV07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBiYXNlID0gY3VycmVuY2llc1sxXTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IGN1cnJlbmNpZXNbMl07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEdldGJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHt9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IHJlc3BvbnNlLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHJlc3BvbnNlW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYWNjb3VudFsnY3VycmVuY3lfY29kZSddO1xuICAgICAgICAgICAgYmFsYW5jZXNbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VzKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IGJhbGFuY2VzW2N1cnJlbmN5XVsnYW1vdW50J107XG4gICAgICAgICAgICAgICAgYWNjb3VudF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VvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgb3JkZXIgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnc2lkZScgaW4gdHJhZGUpXG4gICAgICAgICAgICBpZiAodHJhZGVbJ3NpZGUnXSkge1xuICAgICAgICAgICAgICAgIHNpZGUgPSB0cmFkZVsnc2lkZSddLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IHNpZGUgKyAnX2NoaWxkX29yZGVyX2FjY2VwdGFuY2VfaWQnO1xuICAgICAgICAgICAgICAgIGlmIChpZCBpbiB0cmFkZSlcbiAgICAgICAgICAgICAgICAgICAgb3JkZXIgPSB0cmFkZVtpZF07XG4gICAgICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2Ygb3JkZXIgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgb3JkZXIgPSB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAnY2hpbGRfb3JkZXJfYWNjZXB0YW5jZV9pZCcpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydleGVjX2RhdGUnXSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10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gICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2NoaWxkX29yZGVyX2FjY2VwdGFuY2VfaWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJzIChzeW1ib2wgPSB1bmRlZmluZWQsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IDEwMCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgaWYgKHR5cGVvZiBzeW1ib2wgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGZldGNoT3JkZXJzKCkgcmVxdWlyZXMgYSBzeW1ib2wgYXJndW1lbnQnKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0I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ICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgIC8vICdiYW5rX2FjY291bnRfaWQnOiAxMjM0LFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnbWVzc2FnZV9pZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSAnLycgKyB0aGlzLnZlcnNpb24gKyAnLyc7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJylcbiAgICAgICAgICAgIHJlcXVlc3QgKz0gJ21lLyc7XG4gICAgICAgIHJlcXVlc3QgKz0gcGF0aDtcbiAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgcmVxdWVzdCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHJlcXVlc3Q7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBbIG5vbmNlLCBtZXRob2QsIHJlcXVlc3QgXS5qb2luICgnJyk7XG4gICAgICAgICAgICBpZiAoT2J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0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBiaXRodW1iIGV4dGVuZHMgRXhjaGFuZ2Uge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdiaXRodW1iJyxcbiAgICAgICAgICAgICduYW1lJzogJ0JpdGh1bWInLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdLUicsIC8vIFNvdXRoIEtvcmVhXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogNTAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMwNTk3MTc3LWVhODAwMTcyLTlkNWUtMTFlNy04MDRjLWI5ZDRmYTliNTZiMC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkuYml0aHVtYi5jb20vcHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkuYml0aHVtYi5jb20nLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRodW1iLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5iaXRodW1iLmNvbS91MS9VUzEyNycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2sve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVjZW50X3RyYW5zYWN0aW9ucy97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWNlbnRfdHJhbnNhY3Rpb25zL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9hY2NvdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vd2FsbGV0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby91c2VyX3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvcGxhY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vb3JkZXJfZGV0YWlsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2J0Y193aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9rcndfZGVwb3NpdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUva3J3X3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL21hcmtldF9idXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL21hcmtldF9zZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjE1IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjE1IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyQWxsICgpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChtYXJrZXRzWydkYXRhJ10pO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGlmIChpZCAhPT0gJ2RhdGUnKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ2RhdGEnXVtpZF07XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBpZDtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSAnS1JXJztcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgICAgICdsb3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEluZm9CYWxhbmNlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogJ0FMTCcsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgbGV0IGxvd2VyY2FzZSA9IGN1cnJlbmN5LnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlcywgJ3RvdGFsXycgKyBsb3dlcmNhc2UpO1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gdGhpcy5zYWZlRmxvYXQgKGJhbGFuY2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ZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGxfcHJpY2UnKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IG9wZW4sXG4gICAgICAgICAgICAnY2xvc2UnOiBjbG9zZSxcbiAgICAgICAgICAgICdsYXN0JzogY2xvc2UsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiBjaGFuZ2UsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IGNoYW5nZSAvIG9wZW4gKiAxMDAsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHRoaXMuc3VtIChvcGVuLCBjbG9zZSkgLyAyLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogYmFzZVZvbHVtZSAqIHZ3YXAsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlcnMgKHN5bWJvbHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyQWxsIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSByZXNwb25zZVsnZGF0YSddWydkYXRlJ107XG4gICAgICAgIGxldCB0aWNrZXJzID0gdGhpcy5vbWl0IChyZXNwb25zZVsnZGF0YSddLCAnZGF0ZScpO1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN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gICAgICBpZiAodHlwZSA9PT0gJ2xpbWl0Jykge1xuICAgICAgICAgICAgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICAgICAnb3JkZXJfY3VycmVuY3knOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAgICAgJ1BheW1lbnRfY3VycmVuY3knOiBtYXJrZXRbJ3F1b3RlJ10sXG4gICAgICAgICAgICAgICAgJ3VuaXRzJzogYW1vdW50LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgICAgICd0eXBlJzogKHNpZGUgPT09ICdidXknKSA/ICdiaWQnIDogJ2FzaycsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbWV0aG9kICs9ICdQbGFjZSc7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgICAgICd1bml0cyc6IGFtb3VudCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBtZXRob2QgKz0gJ01hcmtldCcgKyB0aGlzLmNhcGl0YWxpemUgKHNpZGUpO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnb3JkZXJfaWQnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBpZiAocmVzcG9uc2VbJ29yZGVyX2lkJ10pXG4gICAgICAgICAgICAgICAgaWQgPSByZXNwb25zZVsnb3JkZXJfaWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAg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tLVxuXG5jb25zdCB6YiA9IHJlcXVpcmUgKCcuL3piLmpzJyk7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBiaXRrayBleHRlbmRzIHpiIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnYml0a2snLFxuICAgICAgICAgICAgJ25hbWUnOiAnYml0a2snLFxuICAgICAgICAgICAgJ2NvbW1lbnQnOiAnYSBDaGluZXNlIFpCIGNsb25lJyxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cDovL2FwaS5iaXRray5jb20vZGF0YScsIC8vIG5vIGh0dHBzIGZvciBwdWJsaWMgQVBJXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vdHJhZGUuYml0a2suY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdGtrLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5iaXRray5jb20vaS9kZXZlbG9wZXInLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vd3d3LmJpdGtrLmNvbS9pL3JhdGUnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuLy8gIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjI3NS1kY2ZjNmMzMC01ZWQzLTExZTctODM5ZC0wMGE4NDYzODVkMGIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYml0bGlzaC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYml0bGlzaC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9iaXRsaXNoLmNvbS9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMyAvIDEwMCwgLy8gYW5vbnltb3VzIDAuMyUsIHZlcmlmaWVkIDAuMiVcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDUwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2hsY3YnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNfZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29obGN2JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzX2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHNfb3BlcmF0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfdHJhZGVzX2J5X2lkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX2FsbF90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZV9iY29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX3RlbXBsYXRlX3dhbGxldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X2FjY291bnRzX29wZXJhdGlvbnNfZnJvbV90cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9hY3RpdmVfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X2Jjb2RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9teV9tYXRjaGVzX2Zyb21fdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfbXlfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X215X3RyYWRzX2Zyb21fdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfcGF5bWVudF9tZXRob2RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X3BheW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWRlZW1fY29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVzaWduJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzaWduaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NpZ25vdXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2RldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX29wdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19ieV9pZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnRFNIJzogJ0RBU0gnLFxuICAgICAgICAgICAgICAgICdYREcnOiAnRE9HRScsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0UGFpcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNba2V5c1twXV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0Jyk7XG4gICAgICAgIHJldHVybiB7XG4gICA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ICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VycyAocGFyYW1zKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VycyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbbWFya2V0WydpZCddXTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtc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3ldO1xuICAgICAgICAgICAgY3VycmVuY3kgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIC8vIGlzc3VlICM0IGJpdGxpc2ggbmFtZXMgRGFzaCBhcyBEU0gsIGluc3RlYWQgb2YgREFTSFxuICAgICAgICAgICAgaWYgKGN1cnJlbmN5ID09PSAnRFNIJylcbiAgICAgICAgICAgICAgICBjdXJyZW5jeSA9ICdEQVNIJztcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSA9PT0gJ1hERycpXG4gICAgICAgICAgICAgICAgY3VycmVuY3kgPSAnRE9HRSc7XG4gICAgICAgICAgICBiYWxhbmNlW2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ2Z1bmRzJ10pO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbY3VycmVuY3ldWydob2xkZWQnXSk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAg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ICAgICdpZCc6IHJlc3BvbnNlWydtZXNzYWdlX2lkJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocGFyYW1zKTtcbiAgICAgICAgICAgICAgICBoZWFkZXJzID0geyAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHRoaXMuZXh0ZW5kICh7ICd0b2tlbic6IHRoaXMuYXBpS2V5IH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH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ICAgICAgICAgICAgICAgICcxdyc6ICc3ZCcsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnM00nOiAnM20nLFxuICAgICAgICAgICAgICAgICc2TSc6ICc2bScsXG4gICAgICAgICAgICAgICAgJzF5JzogJzF5JyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY3MjU2LWE4NTU1MjAwLTVlZjktMTFlNy05NmZkLTQ2OWE2NWUyYjBiZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3LmJpdG1hcmtldC5wbC9hcGkyLycsIC8vIGxhc3Qgc2xhc2ggaXMgY3JpdGljYWxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQucGwnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldC9kb2NzLnBocD9maWxlPWFwaV9wdWJsaWMuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQubmV0L2RvY3MucGhwP2ZpbGU9YXBpX3ByaXZhdGUuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYml0bWFya2V0LW5ldC9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2pzb24ve21hcmtldH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdqc29uL3ttYXJrZXR9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnanNvbi97bWFya2V0fS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2pzb24vY3RyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vOTBtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vNmgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8xZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzdkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vMW0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8zbScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzZtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vMXknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ2Rlc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmdkZXNrU3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nZGVza0NvbmZpcm0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyeXB0b3RyYWRpbmdkZXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcnlwdG90cmFkaW5nZGVza1N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3J5cHRvdHJhZGluZ2Rlc2tDb25maXJtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdGaWF0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd1BMTlBQJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd0ZpYXRGYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5MaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5PcGVuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5DbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luQ2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5Nb2RpZnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkJhbGFuY2VBZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkJhbGFuY2VSZW1vdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N3YXBMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzd2FwT3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3dhcENsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCQ0gvUExOJzogeyAnaWQnOiAnQkNDUExOJywgJ3N5bWJvbCc6ICdCQ0gvUExOJywgJ2Jhc2UnOiAnQkNIJywgJ3F1b3RlJzogJ1BMTicgfSxcbiAgICAgICAgICAgICAgICAnQlRHL1BMTic6IHsgJ2lkJzogJ0JUR1BMTicsICdzeW1ib2wnOiAnQlRHL1BMTicsICdiYXNlJzogJ0JURycsICdxdW90ZSc6ICdQTE4nIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9QTE4nOiB7ICdpZCc6ICdCVENQTE4nLCAnc3ltYm9sJzogJ0JUQy9QTE4nLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnUExOJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnQlRDRVVSJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgICAgICAnTFRDL1BMTic6IHsgJ2lkJzogJ0xUQ1BMTicsICdzeW1ib2wnOiAnTFRDL1BMTicsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdQTE4nIH0sXG4gICAgICAgICAgICAgICAgJ0xUQy9CVEMnOiB7ICdpZCc6ICdMVENCVEMnLCAnc3ltYm9sJzogJ0xUQy9CVEMnLCAnYmFzZSc6ICdMVEMnLCAncXVvdGUnOiAnQlRDJyB9LFxuICAgICAgICAgICAgICAgICdMaXRlTWluZVgvQlRDJzogeyAnaWQnOiAnTGl0ZU1pbmVYQlRDJywgJ3N5bWJvbCc6ICdMaXRlTWluZVgvQlRDJywgJ2Jhc2UnOiAnTGl0ZU1pbmVYJywgJ3F1b3RlJzogJ0JUQycgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC40NSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjQ1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTkuOTksIDAuNDQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTkuOTksIDAuNDMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTkuOTksIDAuNDIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTkuOTksIDAuNDEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5Ljk5LCAwLjQwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OS45OSwgMC4zOSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQ5OTkuOTksIDAuMzggLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTk5Ljk5LCAwLjM3IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTk5OTkuOTksIDAuMzYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTk5OS45OSwgMC4zNSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQ5OTk5Ljk5LCAwLjM0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OTkuOTksIDAuMzMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5OTkuOTksIDAuMzIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTk5OTkuOTksIDAuMzEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OTkuOTksIDAuMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjE1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTkuOTksIDAuMTQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTkuOTksIDAuMTMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTkuOTksIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTkuOTksIDAuMTEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5Ljk5LCAwLjEwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OS45OSwgMC45IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDk5OS45OSwgMC44IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OS45OSwgMC43IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTk5OTkuOTksIDAuNiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI5OTk5Ljk5LCAwLjUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OS45OSwgMC40IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OTkuOTksIDAuMyAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzE5OTk5OS45OSwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OTk5Ljk5LCAwLjEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OTkuOTksIDAuMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDA4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExOJzogMixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMiwgLy8gU0VQQS4gVHJhbnNmZXIgSU5UIChTSEEpOiA1IEVVUlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMTic6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEluZm8gKCk7XG4gICAgICAgIGxldCBkYXRhID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBkYXRhWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGRhdGEgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAodGhpcy5jdXJyZW5jaWVzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgIC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XG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gKHRyYWRlWyd0eXBlJ10gPT09ICdiaWQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnYW1vdW50J10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICA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ICAgICAgICAgbWV0aG9kID0gJ3ByaXZhdGVQb3N0V2l0aGRyYXcnO1xuICAgICAgICAgICAgcmVxdWVzdFsnYWRkcmVzcyddID0gYWRkcmVzcztcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV07XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICB1cmwgKz0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoICsgJy5qc29uJywgcGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3RvbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICB9LCBwYXJhbXMpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBUEktS2V5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AgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ3VzZXJBZ2VudCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAyMDAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdlZGl0T3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFkJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAndGVzdCc6ICdodHRwczovL3Rlc3RuZXQuYml0bWV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjMxOS1mNjUzYzZlNi01ZWQ0LTExZTctOTMzZC1mMGJjMzY5OWFlOGYuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmJpdG1leC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0bWV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmJpdG1leC5jb20vYXBwL2FwaU92ZXJ2aWV3JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9CaXRNRVgvYXBpLWNvbm5lY3RvcnMvdHJlZS9tYXN0ZXIvb2ZmaWNpYWwtaHR0cCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5iaXRtZXguY29tL2FwcC9mZWVzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYW5ub3VuY2VtZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbm5vdW5jZW1lbnQvdXJnZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2FjdGl2ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudC9hY3RpdmVBbmRJbmRpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2FjdGl2ZUludGVydmFscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudC9jb21wb3NpdGVJbmRleCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudC9pbmRpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN1cmFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlYWRlcmJvYXJkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXF1aWRhdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJCb29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckJvb2svTDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZS9idWNrZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2NoZW1hJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzY2hlbWEvd2Vic29ja2V0SGVscCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2V0dGxlbWVudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzL2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9idWNrZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcGlLZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYXQvY2hhbm5lbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYXQvY29ubmVjdGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGVjdXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4ZWN1dGlvbi90cmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ25vdGlmaWNhdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2FmZmlsaWF0ZVN0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jaGVja1JlZmVycmFsQ29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jb21taXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2RlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21hcmdpbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9taW5XaXRoZHJhd2FsRmVlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXRIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldFN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcGlLZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleS9kaXNhYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcGlLZXkvZW5hYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjaGF0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvYnVsaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsQWxsQWZ0ZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2Nsb3NlUG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2lzb2xhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2xldmVyYWdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9yaXNrTGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL3RyYW5zZmVyTWFyZ2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NhbmNlbFdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY29uZmlybUVtYWlsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NvbmZpcm1FbmFibGVURkEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY29uZmlybVdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZGlzYWJsZVRGQScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9sb2dvdXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbG9nb3V0QWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3ByZWZlcmVuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3JlcXVlc3RFbmFibGVURkEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcmVxdWVzdFdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9idWxrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcGlLZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9hbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0SW5zdHJ1bWVudEFjdGl2ZUFuZEluZGljZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAobWFya2V0WydzdGF0ZSddICE9PSAnVW5saXN0ZWQnKTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsndW5kZXJseWluZyddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydxdW90ZUN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgdHlwZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBmdXR1cmUgPSBmYWxzZTtcbiAgICAgICAgICAgIGxldCBwcmVkaWN0aW9uID0gZmFsc2U7XG4gICAgICAgICAgICBsZXQgYmFzZXF1b3RlID0gYmFzZSArIHF1b3RlO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzd2FwID0gKGlkID09PSBiYXNlcXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgaWYgKHN3YXApIHtcbiAgICAgICAgICAgICAgICB0eXBlID0gJ3N3YXAnO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaWQuaW5kZXhPZiAoJ0JfJykgPj0gMCkge1xuICAgICAgICAgICAgICAgIHByZWRpY3Rpb24gPSB0cnVlO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAncHJlZGljdGlvbic7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGZ1dHVyZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgdHlwZSA9ICdmdXR1cmUnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAobWFya2V0Wydsb3RTaXplJ10pXG4gICAgICAgICAgICAgICAgcHJlY2lzaW9uWydhbW91bnQnXSA9IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAodGhpcy50cnVuY2F0ZV90b19zdHJpbmcgKG1hcmtldFsnbG90U2l6ZSddLCAxNikpO1xuICAgICAgICAgICAgaWYgKG1hcmtldFsndGlja1NpemUnXSlcbiAgICAgICAgICAgICAgICBwcmVjaXNpb25bJ3ByaWNlJ10gPSB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKHRoaXMudHJ1bmNhdGVfdG9fc3RyaW5nIChtYXJrZXRbJ3RpY2tTaXplJ10sIDE2KSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbG90U2l6ZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IG1hcmtldFsnbWF4T3JkZXJRdHknXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsndGlja1NpemUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBtYXJrZXRbJ21heFByaWNlJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBtYXJrZXRbJ3Rha2VyRmVlJ10sXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogbWFya2V0WydtYWtlckZlZSddLFxuICAgICAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICAgICAnc3BvdCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdzd2FwJzogc3dhcCxcbiAgICAgICAgICAgICAgICAnZnV0dXJlJzogZnV0dXJlLFxuICAgICAgICAgICAgICAgICdwcmVkaWN0aW9uJzogcHJlZGljdGlvbixcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRVc2VyTWFyZ2luICh7ICdjdXJyZW5jeSc6ICdhbGwnIH0pO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgcmVzcG9uc2UubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydhdmFpbGFibGVNYXJnaW4nXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWydtYXJnaW5CYWxhbmNlJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5ID09PSAnQlRDJykge1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGFjY291bnRbJ2ZyZWUnXSAqIDAuMDAwMDAwMDE7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IGFjY291bnRbJ3RvdGFsJ10gKiAwLjAwMDAwMDAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlb2YgbGltaXQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgcmVxdWVzdFsnZGVwdGgnXSA9IGxpbWl0O1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRPcmRlckJvb2tMMiAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2JpZHMnOiBbXSxcbiAgICAgICAgICAgICdhc2tzJzogW10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ25vbmNlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG9yZGVyYm9vay5sZW5ndGg7IG8rKykge1xuICAgICAgICAgICAgbGV0IG9yZGVyID0gb3JkZXJib29rW29dO1xuICAgICAgICAgICAgbGV0IHNpZGUgPSAob3JkZXJbJ3NpZGUnXSA9PT0gJ1NlbGwnKSA/ICdhc2tzJyA6ICdiaWRzJztcbiAgICAgICAgICAgIGxldCBhbW91bnQgPSBvcmRlclsnc2l6ZSddO1xuICAgICAgICAgICAgbGV0IHByaWNlID0gb3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ICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0cmRNYXRjaElEJ10sXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3NpZGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydzaXplJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlclN0YXR1cyAoc3RhdHVzKSB7XG4gICAgICAgIGxldCBzdGF0dXNlcyA9IHtcbiAgICAgICAgICAgICduZXcnOiAnb3BlbicsXG4gICAgICAgICAgICAncGFydGlhbGx5ZmlsbGVkJzogJ29wZW4nLFxuICAgICAgICAgICAgJ2ZpbGxlZCc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgJ2NhbmNlbGVkJzogJ2NhbmNlbGVkJyxcbiAgICAgICAgICAgICdyZWplY3RlZCc6ICdyZWplY3RlZCcsXG4gICAgICAgICAgICAnZXhwaXJlZCc6ICdleHBpcmVkJyxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHRoaXMuc2FmZVN0cmluZyAoc3RhdHVzZXMsIHN0YXR1cy50b0xvd2VyQ2FzZSAoKSk7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob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RlZmluZWQnKSB7XG4gICAgICAgICAgICB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAoZGF0ZXRpbWVfdmFsdWUpO1xuICAgICAgICAgICAgaXNvODYwMSA9IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnb3JkZXJRdHknKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2N1bVF0eScsIDAuMCk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSBNYXRoLm1heCAoYW1vdW50IC0gZmlsbGVkLCAwLjApO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBwcmljZSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBpZiAodHlwZW9mIGZpbGxlZCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogZmlsbGVkO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydvcmRlcklEJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogaXNvODYwMSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclsnb3JkVHlwZSddLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3NpZGUnOiBv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dCcsIC8vIHRlbXBvcmFyaWx5XG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICAgICAgLy8gJ290cFRva2VuJzogJzEyMzQ1NicsIC8vIHJlcXVpcmVzIGlmIHR3by1mYWN0b3IgYXV0aCAoT1RQKSBpcyBlbmFibGVkXG4gICAgICAgICAgICAvLyAnZmVlJzogMC4wMDEsIC8vIGJpdGNvaW4gbmV0d29yayBmZWVcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFVzZXJSZXF1ZXN0V2l0aGRyYXdhbCAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWyd0cmFuc2FjdElEJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09PSA0MjkpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRERvU1Byb3RlY3Rpb24gKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgaWYgKGNvZGUgPj0gNDAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keSkge1xuICAgICAgICAgICAgICAgIGlmIChib2R5WzBdID09PSAneycpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJ21lc3NhZ2UnIGluIHJlc3BvbnNlWydlcnJvciddKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2VbJ2Vycm9yJ10sICdtZXNzYWdlJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBtZXNzYWdlICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSA9PT0gJ0ludmFsaWQgQVBJIEtleS4nKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEF1dGhlbnRpY2F0aW9uRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN0dWIgY29kZSwgbmVlZCBwcm9wZXIgaGFuZGxpbmdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gJy9hcGknICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKG1ldGhvZCAhPT0gJ1BVVCcpXG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHF1ZXJ5ICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHF1ZXJ5O1xuICAgICAgICBpZiAoYXBpID09PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbWV0aG9kICsgcXVlcnkgKyBub25jZTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdQT1NUJyB8fCBtZXRob2QgPT09ICdQVVQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChwYXJhbXMpO1xuICAgICAgICAgICAgICAgICAgICBhdXRoICs9IGJvZHk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgICAgICdhcGktbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYXBpLWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdhcGktc2lnbmF0dXJlJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyA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ZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYzMzUtNzE1Y2U3YWEtNWVkNS0xMWU3LTg4YTgtMTczYTI3YmIzMGZlLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5iaXRzby5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9iaXRzby5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9iaXRzby5jb20vYXBpX2luZm8nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYml0c28uY29tL2ZlZXM/bD1lcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2F2YWlsYWJsZV9ib29rcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudF9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZlZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmdzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5ncy97ZmlkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19kZXN0aW5hdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAna3ljX2RvY3VtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVkZ2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvZmVlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVkZ2VyL2Z1bmRpbmdzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvd2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ214X2JhbmtfY29kZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl90cmFkZXMve29pZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97b2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhZGVzL3t0aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL3t3aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZWJpdF9jYXJkX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aGVyX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGhvbmVfbnVtYmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwaG9uZV92ZXJpZmljYXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bob25lX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NwZWlfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tvaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcwMjAxJzogQXV0aGVudGljYXRpb25FcnJvciwgLy8gSW52YWxpZCBOb25jZSBvciBJbnZhbGlkIENyZWRlbnRpYWxzXG4gICAgICAgICAgICAgICAgJzEwNCc6IEludmFsaWROb25jZSwgLy8gQ2Fubm90IHBlcmZvcm0gcmVxdWVzdCAtIG5vbmNlIG11c3QgYmUgaGlnaGVyIHRoYW4gMTUyMDMwNzIwMzcyNDIzN1xuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEF2YWlsYWJsZUJvb2tzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0c1sncGF5bG9hZCddLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sncGF5bG9hZCddW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0Wydib29rJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQudG9VcHBlckNhc2UgKCkucmVwbGFjZSAoJ18nLCAnLycpO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5pbXVtX2Ftb3VudCcpLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heGltdW1fYW1vdW50JyksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluaW11bV9wcmljZScpLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heGltdW1fcHJpY2UnKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbmltdW1fdmFsdWUnKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYXhpbXVtX3ZhbHVlJyksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsnbWluaW11bV9hbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ21pbmltdW1fcHJpY2UnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IGxpbWl0c1snYW1vdW50J11bJ21pbiddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRCYWxhbmNlICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncGF5bG9hZCddWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbm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XG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2FzaycpLFxuICAgICAgICAgICAgJ2Fza1ZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdndhcCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnY3JlYXRlZF9hdCddKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0SWQgPSB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAnYm9vaycpO1xuICAgICAgICAgICAgaWYgKG1hcmtldElkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbbWFya2V0SWRdO1xuICAgICAgICB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JlbmN5ID0gdGhpcy5jdXJyZW5jaWVzX2J5X2lkW2ZlZUN1cnJlbmN5XVsnY29kZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICdjb3N0JzogZmVlQ29zdCxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBmZWVDdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGNvc3QgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdtaW5vcicpO1xuICAgICAgICBpZiAodHlwZW9mIGNvc3QgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgY29zdCA9IE1hdGguYWJzIChjb3N0KTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IG9yZGVySWQgPSB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAnb2lkJyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcklkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cbl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AgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgb3JkZXJUeXBlID0gb3JkZXJbJ3R5cGUnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxIChvcmRlclsnY3JlYXRlZF9hdCddKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ29yaWdpbmFsX2Ftb3VudCcpO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAndW5maWxsZWRfYW1vdW50Jyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29pZCddLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgIC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vZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgZW5kcG9pbnQgPSAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICBlbmRwb2ludCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgZW5kcG9pbnQ7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSBbIG5vbmNlLCBtZXRob2QsIGVuZHBvaW50IF0uam9pbiAoJycpO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCAhPT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgICAgICByZXF1ZXN0ICs9IGJvZHk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHJlcXVlc3QpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gdGhpcy5hcGlLZXkgKyAnOicgKyBub25jZSArICc6JyArIHNpZ25hdHVyZTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0F1dGhvcml6YXRpb24nOiAnQml0c28gJyArIGF1dGgsXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGh0dHBDb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmICh0eXBlb2YgYm9keSAhPT0gJ3N0cmluZycpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoYm9keS5sZW5ndGggPCAyKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKChib2R5WzBdID09PSAneycpIHx8IChib2R5WzBdID09PSAnWycpKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmICgnc3VjY2VzcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIC8vICAgICB7XCJzdWNjZXNzXCI6ZmFsc2UsXCJlcnJvclwiOntcImNvZGVcIjoxMDQsXCJtZXNzYWdlXCI6XCJDYW5ub3QgcGVyZm9ybSByZXF1ZXN0IC0gbm9uY2UgbXVzdCBiZSBoaWdoZXIgdGhhbiAxNTIwMzA3MjAzNzI0MjM3XCJ9fVxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgbGV0IHN1Y2Nlc3MgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2UsICdzdWNjZXNzJywgZmFsc2UpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygc3VjY2VzcyA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChzdWNjZXNzID09PSAndHJ1ZScpIHx8IChzdWNjZXNzID09PSAnMScpKVxuICAgICAgICAgICAgICAgICAgICAgICAgc3VjY2VzcyA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Y2Nlc3MgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFzdWNjZXNzKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGZlZWRiYWNrID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBlcnJvciA9IHRoaXMuc2FmZVZhbHVlIChyZXNwb25zZSwgJ2Vycm9yJyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZXJyb3IgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY29kZSA9IHRoaXMuc2FmZVN0cmluZyAoZXJyb3IsICdjb2RlJyk7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGV4Y2VwdGlvbnMgPSB0a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LThjOGFiNTdlLTVmZTktMTFlNy04ZWE0LTJiMDViNmJjY2VlYy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuYml0c3RhbXAubmV0L2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuYml0c3RhbXAubmV0L2FwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2sve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyX2hvdXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nLXBhaXJzLWluZm8vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiY2hfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JjaF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFuc2FjdGlvbnMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYW5zYWN0aW9ucy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycy9hbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9zdGF0dXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXkve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5L21hcmtldC97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwvbWFya2V0L3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2x0Y193aXRoZHJhd2FsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbHRjX2FkZHJlc3MvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldGhfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAneHJwX3dpdGhkcmF3YWwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd4cnBfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyLXRvLW1haW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2Zlci1mcm9tLW1haW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsLXJlcXVlc3RzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbC9vcGVuLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbC9zdGF0dXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsL2NhbmNlbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpcXVpZGF0aW9uX2FkZHJlc3MvbmV3LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlxdWlkYXRpb25fYWRkcmVzcy9pbmZvLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndjEnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fZGVwb3NpdF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndW5jb25maXJtZWRfYnRjLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl93aXRoZHJhd2FsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmlwcGxlX3dpdGhkcmF3YWwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyaXBwbGVfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMjUgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMjUgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0aWVycyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0YWtlcic6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMCwgMC4yNSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwLCAwLjI0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwLCAwLjIyIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDAwMDAwLCAwLjIwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNjAwMDAwLCAwLjE1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMCwgMC4xNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAsIDAuMTMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0MDAwMDAwLCAwLjEyIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMDAsIDAuMTEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwMSwgMC4xMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjI1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAsIDAuMjQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAsIDAuMjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0MDAwMDAsIDAuMjAgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs2MDAwMDAsIDAuMTUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwLCAwLjE0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMCwgMC4xMyAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQwMDAwMDAsIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwMCwgMC4xMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAxLCAwLjEwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRCc6IDI1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAuOTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiAyNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGluZ1BhaXJzSW5mbyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBiYXNlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBxdW90ZS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2xJZCA9IGJhc2VJZCArICdfJyArIHF1b3RlSWQ7XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3VybF9zeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYmFzZV9kZWNpbWFscyddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsnY291bnRlcl9kZWNpbWFscyddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwYXJ0cyA9IG1hcmtldFsnbWluaW11bV9vcmRlciddLnNwbGl0ICgnICcpO1xuICAgICAgICAgICAgbGV0IGNvc3QgPSBwYXJ0c1swXTtcbiAgICAgICAgICAgIC8vIGxldCBbIGNvc3QsIGN1cnJlbmN5IF0gPSBtYXJrZXRbJ21pbmltdW1fb3JkZXInXS5zcGxpdCAoJyAnKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAobWFya2V0Wyd0cmFkaW5nJ10gPT09ICdFbmFibGVkJyk7XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2xJZCc6IHN5bWJvbElkLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChjb3N0KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE9yZGVyQm9va1BhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKG9yZGVyYm9va1sndGltZXN0YW1wJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdGltZXN0YW1wKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJQYWly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LnNhZmVGbG9hdCAodGlja2VyLCAnb3BlbicpLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGdldE1hcmtldEZyb21UcmFkZSAodHJhZGUpIHtcbiAgICAgICAgdHJhZGUgPSB0aGlzLm9taXQgKHRyYWRlLCBbXG4gICAgICAgICAgICAnZmVlJyxcbiAgICAgICAgICAgICdwcmljZScsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnLFxuICAgICAgICAgICAgJ3RpZCcsXG4gICAgICAgICAgICAndHlwZScsXG4gICAgICAgICAgICAnb3JkZXJfaWQnLFxuICAgICAgICAgICAgJ3NpZGUnLFxuICAgICAgICBdKTtcbiAgICAgICAgbGV0IGN1cnJlbmN5SWRzID0gT2JqZWN0LmtleXMgKHRyYWRlKTtcbiAgICAgICAgbGV0IG51bUN1cnJlbmN5SWRzID0gY3VycmVuY3lJZHMubGVuZ3RoO1xuICAgICAgICBpZiAobnVtQ3VycmVuY3lJZHMgPiAyKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGdldE1hcmtldEZyb21UcmFkZSB0b28gbWFueSBrZXlzOiAnICsgdGhpcy5qc29uIChjdXJyZW5jeUlkcykgKyAnIGluIHRoZSB0cmFkZTogJyArIHRoaXMuanNvbiAodHJhZGUpKTtcbiAgICAgICAgaWYgKG51bUN1cnJlbmN5SWRzID09PSAyKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0SWQgPSBjdXJyZW5jeUlkc1swXSArIGN1cnJlbmN5SWRzWzFdO1xuICAgICAgICAgICAgaWYgKG1hcmtldElkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5tYXJrZXRzX2J5X2lkW21hcmtldElkXTtcbiAgICAgICAgICAgIG1hcmtldElkID0gY3VycmVuY3lJZHNbMV0gKyBjdXJyZW5jeUlkc1swXTtcbiAgICAgICAgICAgIGlmIChtYXJrZXRJZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMubWFya2V0c19ieV9pZFttYXJrZXRJZF07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICB9XG5cbiAgICBnZXRNYXJrZXRGcm9tVHJhZGVzICh0cmFkZXMpIHtcbiAgICAgICAgbGV0IHRyYWRlc0J5U3ltYm9sID0gdGhpcy5pbmRleEJ5ICh0cmFkZXMsICdzeW1ib2wnKTtcbiAgICAgICAgbGV0IHN5bWJvbHMgPSBPYmplY3Qua2V5cyAodHJhZGVzQnlTeW1ib2wpO1xuICAgICAgICBsZXQgbnVtU3ltYm9scyA9IHN5bWJvbHMubGVuZ3RoO1xuICAgICAgICBpZiAobnVtU3ltYm9scyA9PT0gMSlcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm1hcmtldHNbc3ltYm9sc1swXV07XG4gICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2RhdGUnIGluIHRyYWRlKSB7XG4gICAgICAgICAgICB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGUnXSkgKiAxMDAwO1xuICAgICAgICB9IGVsc2UgaWYgKCdkYXRldGltZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnZGF0ZXRpbWUnXSk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gb25seSBpZiBvdmVycmlkZWQgZXh0ZXJuYWxseVxuICAgICAgICBsZXQgc2lkZSA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdzaWRlJyk7XG4gICAgICAgIGxldCBvcmRlcklkID0gdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ29yZGVyX2lkJyk7XG4gICAgICAgIGlmICh0eXBlb2Ygb3JkZXJJZCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBpZiAodHlwZW9mIHNpZGUgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgc2lkZSA9IHRoaXMuc2FmZUludGVnZXIgKHRyYWRlLCAndHlwZScpO1xuICAgICAgICAgICAgICAgIGlmIChzaWRlID09PSAwKVxuICAgICAgICAgICAgICAgICAgICBzaWRlID0gJ2J1eSc7XG4gICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICBzaWRlID0gJ3NlbGwnO1xuICAgICAgICAgICAgfVxuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdwcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnYW1vdW50Jyk7XG4gICAgICAgIGxldCBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0aWQnKTtcbiAgICAgICAgaWQgPSB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAnaWQnLCBpZCk7XG4gICAgICAgIGlmICh0eXBlb2YgbWFya2V0ID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAodHJhZGUpO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKGtleXNbaV0uaW5kZXhPZiAoJ18nKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IGtleXNbaV0ucmVwbGFjZSAoJ18nLCAnJyk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChtYXJrZXRJZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbbWFya2V0SWRdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGlmIHRoZSBtYXJrZXQgaXMgc3RpbGwgbm90IGRlZmluZWRcbiAgICAgICAgICAgIC8vIHRyeSB0byBkZWR1Y2UgaXQgZnJvbSB1c2VkIGtleXNcbiAgICAgICAgICAgIGlmICh0eXBlb2YgbWFya2V0ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLmdldE1hcmtldEZyb21UcmFkZSAodHJhZGUpO1xuICAgICAgICB9XG4gICAgICAgIGxldCBmZWVDb3N0ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnZmVlJyk7XG4gICAgICAgIGxldCBmZWVDdXJyZW5jeSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBwcmljZSA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgbWFya2V0WydzeW1ib2xJZCddLCBwcmljZSk7XG4gICAgICAgICAgICBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsIG1hcmtldFsnYmFzZUlkJ10sIGFtb3VudCk7XG4gICAgICAgICAgICBmZWVDdXJyZW5jeSA9IG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgcHJpY2UgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGFtb3VudDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXJJZCxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2ZlZSc6IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogZmVlQ3VycmVuY3ksXG4gICAgICAgICAgICB9LFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFze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MSAodGltZXN0YW1wKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmICgnY3VycmVuY3lfcGFpcicgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgICAgICBsZXQgbWFya2V0SWQgPSBvcmRlclsnY3VycmVuY3lfcGFpciddO1xuICAgICAgICAgICAgICAgIGlmIChtYXJrZXRJZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFttYXJrZXRJZF07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2Ftb3VudCcpO1xuICAgICAgICBsZXQgZmlsbGVkID0gMC4wO1xuICAgICAgICBsZXQgdHJhZGVzID0gW107XG4gICAgICAgIGxldCB0cmFuc2FjdGlvbnMgPSB0aGlzLnNhZmVWYWx1ZSAob3JkZXIsICd0cmFuc2FjdGlvbnMnKTtcbiAgICAgICAgbGV0IGZlZUNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBjb3N0ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIHRyYW5zYWN0aW9ucyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5ICh0cmFuc2FjdGlvbnMpKSB7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0cmFuc2FjdGlvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRyYWRlID0gdGhpcy5wYXJzZVRyYWRlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAgICAgICAgIH0sIHRyYW5zYWN0aW9uc1tpXSksIG1hcmtldCk7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCArPSB0cmFkZVsnYW1vdW50J107XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZmVlQ29zdCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgICAgICBmZWVDb3N0ID0gMC4wO1xuICAgICAgICAgICAgICAgICAgICBmZWVDb3N0ICs9IHRyYWRlWydmZWUnXVsnY29zdCddO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgY29zdCA9IDAuMDtcbiAgICAgICAgICAgICAgICAgICAgY29zdCArPSB0cmFkZVsnY29zdCddO1xuICAgICAgICAgICAgICAgICAgICB0cmFkZXMucHVzaCAodHJhZGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ3N0YXR1cycpO1xuICAgICAgICBpZiAoKHN0YXR1cyA9PT0gJ0luIFF1ZXVlJykgfHwgKHN0YXR1cyA9PT0gJ09wZW4nKSlcbiAgICAgICAgICAgIHN0YXR1cyA9ICdvcGVuJztcbiAgICAgICAgZWxzZSBpZiAoc3RhdHVzID09PSAnRmluaXNoZWQnKSB7XG4gICAgICAgICAgICBzdGF0dXMgPSAnY2xvc2VkJztcbiAgICAgICAgICAgIGlmICh0eXBlb2YgYW1vdW50ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBhbW91bnQgPSBmaWxsZWQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLmdldE1hcmtldEZyb21UcmFkZXMgKHRyYWRlcyk7XG4gICAgICAgIGxldCBmZWVDdXJyZW5jeSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgZmVlQ3VycmVuY3kgPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiBjb3N0ID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogZmlsbGVkO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBwcmljZSA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmIChmaWxsZWQgPiAwKVxuICAgICAgICAgICAgICAgIHByaWNlID0gY29zdCAvIGZpbGxlZDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgZmVlID0ge1xuICAgICAgICAgICAgJ2Nvc3QnOiBmZWVDb3N0LFxuICAgICAgICAgICAgJ2N1cnJlbmN5JzogZmVlQ3VycmVuY3ksXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGlzbzg2MDEsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9wZW5PcmRlcnMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIHN5bWJvbCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgb3JkZXJzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE9wZW5PcmRlcnNBbGwgKCk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJzIChvcmRlc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BpJ10gKyAnLyc7XG4gICAgICAgIGlmIChhcGkgIT09ICd2MScpXG4gICAgICAgICAgICB1cmwgKz0gdGhpcy52ZXJzaW9uICsgJy8nO1xuICAgICAgICB1cmwgKz0gdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG5vbmNlICsgdGhpcy51aWQgKyB0aGlzLmFwaUtleTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmVuY29kZSAodGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpKTtcbiAgICAgICAgICAgIHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAna2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ3NpZ25hdHVyZSc6IHNpZ25hdHVyZS50b1VwcGVyQ2FzZSAoKSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHF1ZXJ5KTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChodHRwQ29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAodHlwZW9mIGJvZHkgIT09ICdzdHJpbmcnKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKGJvZHkubGVuZ3RoIDwgMilcbiAgICAgICAgICAgIHJldHVybjsgLy8gZmFsbGJhY2sgdG8gZGVmYXVsdCBlcnJvciBoYW5kbGVyXG4gICAgICAgIGlmICgoYm9keVswXSA9PT0gJ3snKSB8fCAoYm9keVswXSA9PT0gJ1snKSkge1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ3N0YXR1cycpO1xuICAgICAgICAgICAgaWYgKHN0YXR1cyA9PT0gJ2Vycm9yJykge1xuICAgICAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ2NvZGUnKTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvZGUgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb2RlID09PSAnQVBJMDAwNScpXG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXc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ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3ODYzNzctOGM4YWI1N2UtNWZlOS0xMWU3LThlYTQtMmIwNWI2YmNjZWVjLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdHN0YW1wLm5ldCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfaG91cicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldXJfdXNkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfYWxsX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndW5jb25maXJtZWRfYnRjJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyaXBwbGVfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmlwcGxlX2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxfcmVxdWVzdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ2J0Y3VzZCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnLCAnbWFrZXInOiAwLjAwMjUsICd0YWtlcic6IDAuMDAyNSB9LFxuICAgICAgICAgICAgICAgICdC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ICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgLy8gbmV3IG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJ29uZU1pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJ2ZpdmVNaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAndGhpcnR5TWluJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnaG91cicsXG4gICAgICAgICAgICAgICAgJzFkJzogJ2RheScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjM1Mi1jZjBiM2MyNi01ZWQ1LTExZTctODJiNy1mMzgyNmI3YTk3ZDguanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYml0dHJleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnbWFya2V0JzogJ2h0dHBzOi8vYml0dHJleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3YyJzogJ2h0dHBzOi8vYml0dHJleC5jb20vYXBpL3YyLjAvcHViJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0dHJleC5jb20vSG9tZS9BcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubnBtanMub3JnL3BhY2thZ2Uvbm9kZS5iaXR0cmV4LmFwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0dHJleC5jb20vRmVlcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3N1cHBvcnQuYml0dHJleC5jb20vaGMvZW4tdXMvYXJ0aWNsZXMvMTE1MDAwMTk5NjUxLVdoYXQtZmVlcy1kb2VzLUJpdHRyZXgtY2hhcmdlLScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd2Mic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jaWVzL0dldEJUQ1ByaWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvR2V0VGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9HZXRMYXRlc3RUaWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNYXJrZXRzL0dldE1hcmtldFN1bW1hcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L0dldExhdGVzdFRpY2snLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzdW1tYXJpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdhY2NvdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0YWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdtYXJrZXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5bGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eW1hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVub3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxtYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVEMnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkREJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWFQnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1QnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JERCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgLy8gJ0NhbGwgdG8gQ2FuY2VsIHdhcyB0aHJvdHRsZWQuIFRyeSBhZ2FpbiBpbiA2MCBzZWNvbmRzLic6IEREb1NQcm90ZWN0aW9uLFxuICAgICAgICAgICAgICAgIC8vICdDYWxsIHRvIEdldEJhbGFuY2VzIHdhcyB0aHJvdHRsZWQuIFRyeSBhZ2FpbiBpbiA2MCBzZWNvbmRzLic6IEREb1NQcm90ZWN0aW9uLFxuICAgICAgICAgICAgICAgICdBUElTSUdOX05PVF9QUk9WSURFRCc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJ0lOVkFMSURfU0lHTkFUVVJFJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnSU5WQUxJRF9DVVJSRU5DWSc6IEV4Y2hhbmdlRXJyb3IsXG4gICAgICAgICAgICAgICAgJ0lOVkFMSURfUEVSTUlTU0lPTic6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJ0lOU1VGRklDSUVOVF9GVU5EUyc6IEluc3VmZmljaWVudEZ1bmRzLFxuICAgICAgICAgICAgICAgICdRVUFOVElUWV9OT1RfUFJPVklERUQnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJ01JTl9UUkFERV9SRVFVSVJFTUVOVF9OT1RfTUVUJzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICdPUkRFUl9OT1RfT1BFTic6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAnVVVJRF9JTlZBTElEJzogT3JkZXJOb3RGb3VuZCxcbiAgICAgICAgICAgICAgICAnUkFURV9OT1RfUFJPVklERUQnOiBJbnZhbGlkT3JkZXIsIC8vIGNyZWF0ZUxpbWl0QnV5T3JkZXIgKCdFVEgvQlRDJywgMSwgMClcbiAgICAgICAgICAgICAgICAnV0hJVEVMSVNUX1ZJT0xBVElPTl9JUCc6IFBlcm1pc3Npb25EZW5pZWQsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ29wdGlvbnMnOiB7XG4gICA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tldFsnQmFzZUN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gbWFya2V0WydJc0FjdGl2ZSddIHx8IG1hcmtldFsnSXNBY3RpdmUnXSA9PT0gJ3RydWUnO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ01pblRyYWRlU2l6ZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5hY2NvdW50R2V0QmFsYW5jZXMgKHBhcmFtcyk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgaW5kZXhlZCA9IHRoaXMuaW5kZXhCeSAoYmFsYW5jZXMsICdDdXJyZW5jeScpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChpbmRleGVkKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW2ldO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBpbmRleGVkW2lkXTtcbiAgICAgICAgICAgIGxldCBmcmVlID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnQXZhaWxhYmxlJ10pO1xuICAgICAgICAgICAgbGV0IHRvdGFsID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnQmFsYW5jZSddKTtcbiAgICAgICAgICAgIGxldCB1c2VkID0gdG90YWwgLSBmcmVlO1xuICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gZnJlZTtcbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHVzZWQ7XG4gICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdG90YWw7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAndHlwZSc6ICdib3RoJyxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGlmICgndHlwZScgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICBpZiAocGFyYW1zWyd0eXBlJ10gPT09ICdidXknKSB7XG4gICAgICAgICAgICAgICAgb3JkZXJib29rID0ge1xuICAgICAgICAgICAgICAgICAgICAnYnV5JzogcmVzcG9uc2VbJ3Jlc3VsdCddLFxuICAgICAgICAgICAgICAgICAgICAnc2VsbCc6IFtdLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHBhcmFtc1sndHlwZSddID09PSAnc2VsbCcpIHtcbiAgICAgICAgICAgICAgICBvcmRlcmJvb2sgPSB7XG4gICAgICAgICAgICAgICAgICAgICdidXknOiBbXSxcbiAgICAgICAgICAgICAgICAgICAgJ3NlbGwnOiByZXNwb25zZVsncmVzdWx0J10sXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdidXknLCAnc2VsbCcsICdSYXRlJywgJ1F1YW50aXR5Jyk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnNhZmVTdHJpbmcgKHRpY2tlciwgJ1RpbWVTdGFtcCcpO1xuICAgICAgICBsZXQgaXNvODYwMSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiB0aW1lc3RhbXAgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICBpZiAodGltZXN0YW1wLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodGltZXN0YW1wKTtcbiAgICAgICAgICAgICAgICBpc284NjAxID0gdGhpcy5pc284NjAxICh0aW1lc3RhbXApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgcHJldmlvdXMgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnUHJldkRheScpO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdMYXN0Jyk7XG4gICAgICAgIGxldCBjaGFuZ2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBwZXJjZW50YWdlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIGxhc3QgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmV2aW91cyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBjaGFuZ2UgPSBsYXN0IC0gcHJldmlvdXM7XG4gICAgICAgICAgICAgICAgaWYgKHByZXZpb3VzID4gMClcbiAgICAgICAgICAgICAgICAgICAgcGVyY2VudGFnZSA9IChjaGFuZ2UgLyBwcmV2aW91cykgKiAxMDA7XG4gICAgICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGlzbzg2MDEsXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdIaWdoJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0xvdycpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdCaWQnKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0FzaycpLFxuICAgICAgICAgICAgJ2Fza1ZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiBsYXN0LFxuICA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mb3IgZWFjaCBwYXJ0aWN1bGFyIG1ldGhvZFxuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQpO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IDg7IC8vIGRlZmF1bHQgcHJlY2lzaW9uLCB0b2RvOiBmaXggXCJtYWdpYyBjb25zdGFudHNcIlxuICAgICAgICAgICAgbGV0IGFkZHJlc3MgPSB0aGlzLnNhZmVWYWx1ZSAoY3VycmVuY3ksICdCYXNlQWRkcmVzcycpO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAndHlwZSc6IGN1cnJlbmN5WydDb2luVHlwZSddLFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ0N1cnJlbmN5TG9uZyddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBjdXJyZW5jeVsnSXNBY3RpdmUnXSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAnZmVlJzogdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAnVHhGZWUnKSwgLy8gdG9kbzogcmVkZXNpZ25cbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydUeEZlZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzdW1tYXJpZXMgKHBhcmFtcyk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IHQgPSAwOyB0IDwgdGlja2Vycy5sZW5ndGg7IHQrKykge1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbdF07XG4gICAgICAgICAgICBsZXQgaWQgPSB0aWNrZXJbJ01hcmtldE5hbWUnXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSB0aGlzLnBhcnNlU3ltYm9sIChpZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzdW1tYXJ5ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVsncmVzdWx0J11bMF07XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydUaW1lU3RhbXAnXSArICcrMDA6MDAnKTtcbiAgICAgICAgbGV0IHNpZGUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0cmFkZVsnT3JkZXJUeXBlJ10gPT09ICdCVVknKSB7XG4gICAgICAgICAgICBzaWRlID0gJ2J1eSc7XG4gICAgICAgIH0gZWxzZSBpZiAodHJhZGVbJ09yZGVyVHlwZSddID09PSAnU0VMTCcpIHtcbiAgICAgICAgICAgIHNpZGUgPSAnc2VsbCc7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGlkID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ0lkJyBpbiB0cmFkZSlcbiAgICAgICAgICAgIGlkID0gdHJhZGVbJ0lkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdQcmljZScpLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ1F1YW50aXR5JyksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbC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QnICsgdGhpcy5jYXBpdGFsaXplIChzaWRlKSArIHR5cGU7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdtYXJrZXQnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAncXVhbnRpdHknOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAncmF0ZSc6IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSksXG4gICAgICAgIH07XG4gICAgICAgIC8vIGlmICh0eXBlID09ICdsaW1pdCcpXG4gICAgICAgIC8vICAgICBvcmRlclsncmF0ZSddID0gdGhpcy5wcmljZVRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICBsZXQgb3JkZXJJZEZpZWxkID0gdGhpcy5nZXRPcmRlcklkRmllbGQgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ3Jlc3VsdCddW29yZGVySWRGaWVsZF0sXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3N0YXR1cyc6ICdvcGVuJyxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBnZXRPcmRlcklkRmllbGQgKCkge1xuICAgICAgICByZXR1cm4gJ3V1aWQnO1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhb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AgICAgICAgICBjb21taXNzaW9uID0gJ0NvbW1pc3Npb24nO1xuICAgICAgICB9IGVsc2UgaWYgKCdDb21taXNzaW9uUGFpZCcgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGNvbW1pc3Npb24gPSAnQ29tbWlzc2lvblBhaWQnO1xuICAgICAgICB9XG4gICAgICAgIGlmIChjb21taXNzaW9uKSB7XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0IChvcmRlcltjb21taXNzaW9uXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgICAgICBmZWVbJ2N1cnJlbmN5J10gPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnTGltaXQnKTtcbiAgICAgICAgbGV0IGNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdQcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnUXVhbnRpdHknKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ1F1YW50aXR5UmVtYWluaW5nJywgMC4wKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgaWYgKCFjb3N0KSB7XG4gICAgICAgICAgICBpZiAocHJpY2UgJiYgYW1vdW50KVxuICAgICAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGFtb3VudDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIXByaWNlKSB7XG4gICAgICAgICAgICBpZiAoY29zdCAmJiBmaWxsZWQpXG4gICAgICAgICAgICAgICAgcHJpY2UgPSBjb3N0IC8gZmlsbGVkO1xuICAgICAgICB9XG4gICAgICAgIGxldCBhdmVyYWdlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnUHJpY2VQZXJVbml0Jyk7XG4gICAgICAgIGxldCBpZCA9IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdPcmRlclV1aWQnKTtcbiAgICAgICAgaWYgKHR5cGVvZiBpZCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBpZCA9IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdPcmRlcklkJyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogaXNvODYwMSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiBsYXN0VHJhZGVUaW1lc3RhbXAsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IGF2ZXJhZ2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICA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10sXG4gICAgICAgICAgICAncXVhbnRpdHknOiBhbW91bnQsXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0YWcpXG4gICAgICAgICAgICByZXF1ZXN0WydwYXltZW50aWQnXSA9IHRhZztcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5hY2NvdW50R2V0V2l0aGRyYXcgKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGlkID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ3Jlc3VsdCcgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmICgndXVpZCcgaW4gcmVzcG9uc2VbJ3Jlc3VsdCddKVxuICAgICAgICAgICAgICAgIGlkID0gcmVzcG9uc2VbJ3Jlc3VsdCddWyd1dWlkJ107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyAnLyc7XG4gICAgICAgIGlmIChhcGkgIT09ICd2MicpXG4gICAgICAgICAgICB1cmwgKz0gdGhpcy52ZXJzaW9uICsgJy8nO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IGFwaSArICcvJyArIG1ldGhvZC50b0xvd2VyQ2FzZSAoKSArIHBhdGg7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT09ICd2MicpIHtcbiAgICAgICAgICAgIHVybCArPSBwYXRoO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICB1cmwgKz0gYXBpICsgJy8nO1xuICAgICAgICAgICAgaWYgKCgoYXBpID09PSAnYWNjb3VudCcpICYmIChwYXRoICE9PSAnd2l0aGRyYXcnKSkgfHwgKHBhdGggPT09ICdvcGVub3JkZXJzJykpXG4gICAgICAgICAgICAgICAgdXJsICs9IG1ldGhvZC50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIHVybCArPSBwYXRoICsgJz8nICsgdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAodXJsKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ2FwaXNpZ24nOiBzaWduYXR1cmUgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbW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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIGJpdHogZXh0ZW5kcyBFeGNoYW5nZSB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2JpdHonLFxuICAgICAgICAgICAgJ25hbWUnOiAnQml0LVonLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdISycsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICd1c2VyQWdlbnQnOiB0aGlzLnVzZXJBZ2VudHNbJ2Nocm9tZSddLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzU4NjI2MDYtNGY1NTRmMTQtMGI1ZC0xMWU4LTk1N2QtMzUwNThjNTA0YjZmLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5iaXQtei5jb20vYXBpX3YxJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdC16LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5iaXQtei5jb20vYXBpLmh0bWwnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vd3d3LmJpdC16LmNvbS9hYm91dC9mZWUnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcmFsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZUFkZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVDYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RLS1QnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGQ1QnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFNLJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hYSSc6ICcwLjglJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNWkMnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dYUyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUE0nOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JMSyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVMnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFNSJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05VTFMnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVk9JU0UnOiAzNTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVknOiAxLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMC42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lCQ1QnOiAzNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPVE4nOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRYJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQU1FJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTlQnOiA5LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1NTJzogMTUwMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSSyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVJUJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xFTyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0InOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlNDJzogMTMwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklVJzogMzUwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSTic6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVlRDJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDRCc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAyMDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIV0MnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVU5JVCc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPWFknOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNPJzogMC4zNTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NCVEMnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNYJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VURic6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQWUxOVCc6IDAuNDAwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUkInOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdvcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdsYXN0Tm9uY2VUaW1lc3RhbXAnOiAwLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdQWEMnOiAnUGl4aWVjb2luJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyYWxsICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGJhc2VJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHF1b3RlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2VzIChwYXJhbXMpO1xuICAgICAgICBsZXQgZGF0YSA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHRoaXMub21pdCAoZGF0YSwgJ3VpZCcpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW2ldO1xuICAgICAgICAgICAgbGV0IGlkSGFzVW5kZXJzY29yZSA9IChpZC5pbmRleE9mICgnXycpID49IDApO1xuICAgICAgICAgICAgaWYgKCFpZEhhc1VuZGVyc2NvcmUpIHtcbiAgICAgICAgICAgICAgICBsZXQgY29kZSA9IGlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLmN1cnJlbmNpZXNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29kZSA9IHRoaXMuY3VycmVuY2llc19ieV9pZFtpZF1bJ2NvZGUnXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICAgICAgbGV0IHVzZWRGaWVsZCA9IGlkICsgJ19sb2NrJztcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSB0aGlzLnNhZmVGbG9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biAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgcGF0aDtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChxdWVyeS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHF1ZXJ5O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMua2V5c29ydCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYXBpX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aGlzLnNlY29uZHMgKCksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogdGhpcy5ub25jZSAoKSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpKTtcbiAgICAgICAgICAgIGJvZHkgKz0gJyZzaWduPScgKyB0aGlzLmhhc2ggKHRoaXMuZW5jb2RlIChib2R5ICsgdGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdDb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGxldCBjb2RlID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ2NvZGUnKTtcbiAgICAgICAgaWYgKGNvZGUgIT09ICcwJykge1xuICAgICAgICAgICAgbGV0IEVycm9yQ2xhc3MgPSB0aGlzLnNhZmVWYWx1ZSAoe1xuICAgICAgICAgICAgICAgICcxMDMnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDQnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcyMDAnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcyMDInOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICc0MDEnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICc0MDYnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcyMDMnOiBJbnZhbGlkTm9uY2UsXG4gICAgICAgICAgICAgICAgJzIwMSc6IE9yZGVyTm90Rm91bmQsXG4gICAgICAgICAgICAgICAgJzQwOCc6IEluc3VmZmljaWVudEZ1bmRzLFxuICAgICAgICAgICAgICAgICcxMDYnOiBERG9TUHJvdGVjdGlvbixcbiAgICAgICAgICAgIH0sIGNvZGUsIEV4Y2hhbmdlRXJyb3IpO1xuICAgICAgICAgICAgbGV0IG1lc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3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODUwMTc1Mi02MGMyMWI4Mi02ZmViLTExZTctODE4Yi0wNTVlZTZkMGU3NTQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJsM3AuZXUnLFxuICAgICAgICAgICAgICAgICd3d3cnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JsM3AuZXUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRvbmljLm5sJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vQml0b25pY05ML2JsM3AtYXBpL3RyZWUvbWFzdGVyL2RvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9ibDNwLmV1L2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpdG9uaWMubmwvZW4vYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9kZXB0aC9mdWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9vcmRlci9hZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L21vbmV5L29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvb3JkZXIvcmVzdWx0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L21vbmV5L29yZGVycy9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS90cmFkZXMvZmV0Y2gnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dFTk1LVC9tb25leS9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRU5NS1QvbW9uZXkvZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRU5NS1QvbW9uZXkvbmV3X2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VOTUtUL21vbmV5L3dhbGxldC9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRU5NS1QvbW9uZXkvd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdCVENFVVInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJywgJ21ha2VyJzogMC4wMDI1LCAndGFrZXInOiAwLjAwMjUgfSxcbiAgICAgICAgICAgICAgICAnTFRDL0VVUic6IHsgJ2lkJzogJ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aWYgKCdiYWxhbmNlJyBpbiBiYWxhbmNlW2N1cnJlbmN5XSkge1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ2JhbGFuY2UnXVsndmFsdWUnXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGFjY291bnRbJ3RvdGFsJ10pIHtcbiAgICAgICAgICAgICAgICBpZiAoYWNjb3VudFsnZnJlZSddKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIHBhcnNlQmlkQXNrIChiaWRhc2ssIHByaWNlS2V5ID0gMCwgYW1vdW50S2V5ID0gMCkge1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgYmlkYXNrW3ByaWNlS2V5XSAvIDEwMDAwMC4wLFxuICAgICAgICAgICAgYmlkYXNrW2Ftb3VudEtleV0gLyAxMDAwMDAwMDAuMCxcbiAgICAgICAgXTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldE9yZGVyYm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdtYXJrZXQn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HVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoeyAnbm9uY2UnOiBub25jZSB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuYmFzZTY0VG9CaW5hcnkgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBxdW90ZXNcbiAgICAgICAgICAgIGxldCBhdXRoID0gcmVxdWVzdCArIFwiXFwwXCIgKyBib2R5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCBzZWNyZXQsICdzaGE1MTInLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnUmVzdC1LZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnUmVzdC1TaWduJzogdGhpcy5kZWNvZGUgKHNpZ25hdHVyZSksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxufTtcbiIsIid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iAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzAzMDMwMDAtYjYwMmRiZTYtOTc2ZC0xMWU3LTk1NmQtMzZjNTA0OWMwMWU3LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2JsZXV0cmFkZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQnOiAnaHR0cHM6Ly9ibGV1dHJhZGUuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdtYXJrZXQnOiAnaHR0cHM6Ly9ibGV1dHJhZGUuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYmxldXRyYWRlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JsZXV0cmFkZS5jb20vaGVscC9BUEknLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYmxldXRyYWRlLmNvbS9oZWxwL2ZlZXNfYW5kX2RlYWRsaW5lcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBREMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRBJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JJVEInOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDRCc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JMSyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRE4nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0xBTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDUic6IDAuMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RQJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RQQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRkwnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWFAnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRkpDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JTVFknOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOTEcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFRNTCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNT05BJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNT09OJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05NQyc6IDAuMDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FT1MnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlZDJzogMC4wNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPSyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9UJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hQTSc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkREJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NMUic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVEFSVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTEcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJPTEwnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVU5PJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWUkMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVlRDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hWUCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXREMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRVQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZXhjZXB0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAnSW5zdWZmaWNpZW50IGZ1bmRzISc6IEluc3VmZmljaWVudEZ1bmRzLFxuICAgICAgICAgICAgICAgICdJbnZhbGlkIE9yZGVyIElEJzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICdJbnZhbGlkIGFwaWtleSBvciBhcGlzZWNyZXQnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdvcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdwYXJzZU9yZGVyU3RhdHVzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1sncmVzdWx0J10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydyZXN1bHQnXVtwXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnTWFya2V0TmFtZSddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ01hcmtldEN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ0Jhc2VDdXJyZW5jeSddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IG1hcmtldFsnSXNBY3RpdmUnXTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnTWluVHJhZGVTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlclN0YXR1cyAoc3RhdHVzKSB7XG4gICAgICAgIGxldCBzdGF0dXNlcyA9IHtcbiAgICAgICAgICAgICdPSyc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgJ09QRU4nOiAnb3BlbicsXG4gIC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ltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzQ3MDM1OTMtYzQ0OTg2NzQtZjUwNC0xMWU3LThkMTQtZmY4ZTQ0ZmI3OGMxLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2JyYXppbGlleC5jb20vYXBpL3YxJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYnJhemlsaWV4LmNvbS8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9icmF6aWxpZXguY29tL2V4Y2hhbmdlL2FwaS5waHAnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYnJhemlsaWV4LmNvbS9leGNoYW5nZS9mZWVzLnBocCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2sve21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlaGlzdG9yeS97bWFya2V0fScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tcGxldGVfYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDA1LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQ3VycmVuY2llcyAocGFyY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jdGl2ZScpID09PSAxO1xuICAgICAgICAgICAgbGV0IGNhbkRlcG9zaXQgPSB0aGlzLnNhZmVJbnRlZ2VyIChjdXJyZW5jeSwgJ2lzX2RlcG9zaXRfYWN0aXZlJykgPT09IDE7XG4gICAgICAgICAgICBpZiAoIWNhbldpdGhkcmF3IHx8ICFjYW5EZXBvc2l0KVxuICAgICAgICAgICAgICAgIGFjdGl2ZSA9IGZhbHNlO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WyduYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY3RpdmUnOiBjYW5XaXRoZHJhdyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmZWUnOiBjdXJyZW5jeVsndHhXaXRoZHJhd2FsRmVlJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGNhbkRlcG9zaXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlJzogY3VycmVuY3lbJ3R4RGVwb3NpdEZlZSddLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnbWluQW1vdW50VHJhZGUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydNaW5XaXRoZHJhd2FsJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnbWluRGVwb3NpdCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlciAoKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaWRdO1xuICAgICAgICAgICAgbGV0IFsgYmFzZUlkLCBxdW90ZUlkIF0gPSBpZC5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gYmFzZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IHRoaXMuc2FmZUludGVnZXIgKG1hcmtldCwgJ2FjdGl2ZScpID09PSAxO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbC50b1VwcGVyQ2FzZSAoKSxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICA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hbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgdGlja2VyID0ge1xuICAgICAgICAgICAgICAgICdkYXRlJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgICAgICd0aWNrZXInOiB0aWNrZXJzW2lkXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRPcmRlcmJvb2tNYXJrZXQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogdGhpcy5tYXJrZXRJZCAoc3ltYm9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WxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaWRdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlJ10pLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ3RvdGFsJ10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgbGV0IG1hcmtldElkID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ21hcmtldCcpO1xuICAgICAgICAgICAgaWYgKG1hcmtldElkKVxuICAgICAgICAgICAgICAgIGlmIChtYXJrZXRJZCBpbiB0aGlzLm1hcmtldHNfYnlfaW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ICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdjb21tYW5kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiB0aGlzLm5vbmNlICgpLFxuICAgICAgICAgICAgfSwgcXVlcnkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHRoaXMuZGVjb2RlIChzaWduYXR1cmUpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJh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mJ0Y2JveC5jby5qcC9oZWxwL2FzbScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWxsdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9hZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfdmlldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvSlBZJzogeyAnaWQnOiAnQlRDL0pQWScsICdzeW1ib2wnOiAnQlRDL0pQWScsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdKUFknIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzEwNCc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzEwNSc6IFBlcm1pc3Npb25EZW5pZWQsXG4gICAgICAgICAgICAgICAgJzEwNic6IEludmFsaWROb25jZSxcbiAgICAgICAgICAgICAgICAnMTA3JzogSW52YWxpZE9yZGVyLCAvLyBwcmljZSBzaG91bGQgYmUgYW4gaW50ZWdlclxuICAgICAgICAgICAgICAgICcyMDAnOiBJbnN1ZmZpY2llbnRGdW5kcyxcbiAgICAgICAgICAgICAgICAnMjAxJzogSW52YWxpZE9yZGVyLCAvLyBhbW91bnQgdG9vIHNtYWxsXG4gICAgICAgICAgICAgICAgJzIwMic6IEludmFsaWRPcmRlciwgLy8gcHJpY2Ugc2hvdWxkIGJlIFswIDogMTAwMDAwMF1cbiAgICAgICAgICAgICAgICAnMjAzJzogT3JkZXJOb3RGb3VuZCxcbiAgICAgICAgICAgICAgICAnNDAxJzogT3JkZXJOb3RGb3VuZCwgLy8gY2FuY2VsIGNhbmNlbGVkLCBjbG9zZWQgb3Igbm9uLWV4aXN0ZW50IG9yZGVyXG4gICAgICAgICAgICAgICAgJzQwMic6IEREb1NQcm90ZWN0aW9uLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgbG93ZX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lbmd0aDtcbiAgICAgICAgaWYgKG51bVN5bWJvbHMgPiAxKVxuICAgICAgICAgICAgcmVxdWVzdFsnY29pbiddID0gbWFya2V0WydpZCddO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXREZXB0aCAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdCcpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdoaWdoJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvdycpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdidXknKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2wnKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2x1bWUnKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEFsbHRpY2tlciAocGFyYW1zKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHt9O1xuICAgICAgICBsZXQgbnVtU3ltYm9scyA9IHRoaXMuc3ltYm9scy5sZW5ndGg7XG4gICAgICAgIGlmIChudW1TeW1ib2xzID4gMSlcbiAgICAgICAgICAgIHJlcXVlc3RbJ2NvaW4nXSA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDsgLy8gR01UIHRpbWVcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10sXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1w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HVybiBvcmRlcnM7XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKTtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGxldCBzZWNyZXQgPSB0aGlzLmhhc2ggKHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgcXVlcnlbJ3NpZ25hdHVyZSddID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocmVxdWVzdCksIHRoaXMuZW5jb2RlIChzZWNyZXQpKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChodHRwQ29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICAvLyB0eXBpY2FsIGVycm9yIHJlc3BvbnNlOiB7XCJyZXN1bHRcIjpmYWxzZSxcImNvZGVcIjpcIjQwMVwifVxuICAgICAgICBpZiAoaHR0cENvZGUgPj0gNDAwKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyByZXNvcnQgdG8gZGVmYXVsdEVycm9ySGFuZGxlclxuICAgICAgICBpZiAoYm9keVswXSAhPT0gJ3snKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBub3QganNvbiwgcmVzb3J0IHRvIGRlZmF1bHRFcnJvckhhbmRsZXJcbiAgICAgICAgY29uc3QgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgY29uc3QgcmVzdWx0ID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAncmVzdWx0Jyk7XG4gICAgICAgIGlmICh0eXBlb2YgcmVzdWx0ID09PSAndW5kZWZpbmVkJyB8fCByZXN1bHQgPT09IHRydWUpXG4gICAgICAgICAgICByZXR1cm47IC8vIGVpdGhlciBwdWJsaWMgQVBJIChubyBlcnJvciBjb2RlcyBleHBlY3RlZCkgb3Igc3VjY2Vzc1xuICAgICAgICBjb25zdCBlcnJvckNv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9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYzNjgtNDY1YjMyODYtNWVkNi0xMWU3LTlhMTEtMGY2NDY3ZTFkODJiLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3BsdXMnOiAnaHR0cHM6Ly9wbHVzLWFwaS5idGNjaGluYS5jb20vbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2RhdGEuYnRjY2hpbmEuY29tL2RhdGEnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5idGNjaGluYS5jb20vYXBpX3RyYWRlX3YxLnBocCcsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJ0Y2NoaW5hLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5idGNjaGluYS5jb20vYXBpZG9jcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncGx1cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5ZGF0YScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQnV5SWNlYmVyZ09yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCdXlPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQnV5T3JkZXIyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCdXlTdG9wT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbEljZWJlcmdPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbFN0b3BPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QWNjb3VudEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEFyY2hpdmVkT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEFyY2hpdmVkT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREZXBvc2l0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0SWNlYmVyZ09yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRJY2ViZXJnT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXREZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0RGVwdGgyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRTdG9wT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFN0b3BPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0V2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0V2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlcXVlc3RXaXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZWxsSWNlYmVyZ09yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZWxsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlbGxPcmRlcjInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlbGxTdG9wT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9DTlknOiB7ICdpZCc6ICdidGNjbnknLCAnc3ltYm9sJzogJ0JUQy9DTlknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ05ZJywgJ2FwaSc6ICdwdWJsaWMnLCAncGx1cyc6IGZhbHNlIH0sXG4gICAgICAgICAgICAgICAgJ0xUQy9DTlknOiB7ICdpZCc6ICdsdGNjbnknLCAnc3ltYm9sJzogJ0xUQy9DTlknLCAnYmFzZSc6ICdMVEMnLCAncXVvdGUnOiAnQ05ZJywgJ2FwaSc6ICdwdWJsaWMnLCAncGx1cyc6IGZhbHNlIH0sXG4gICAgICAgICAgICAg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ljZSAoMCwgMyk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBiYXNlID0gYmFzZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIHF1b3RlID0gcXVvdGUudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0QWNjb3VudEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgbG93ZXJjYXNlID0gY3VycmVuY3kud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HRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgbWV0aG9kID0gbWFya2V0WydhcGknXSArICdHZXRPcmRlcmJvb2snO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMuY3JlYXRlTWFya2V0UmVxdWVzdCAobWFya2V0KTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gb3JkZXJib29rWydkYXRlJ10gKiAxMDAwO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB0aW1lc3RhbXApO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWydkYXRlJ10gKiAxMDAwO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0Jyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICd2d2FwJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3Z3YXAnKSxcbiAgICAgICAgICAgICdvcGVuJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ29wZW4nKSxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlclBsdXMgKHRpY2tlciwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ1RpbWVzdGFtcCddO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnSGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdMb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVG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XTtcbiAgICAgICAgaWYgKG1hcmtldFsncGx1cyddKVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXJQbHVzICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGVQbHVzICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodHJhZGVbJ3RpbWVzdGFtcCddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3NpZGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydzaXplJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZXNQbHVzICh0cmFkZXMsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdHJhZGVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5wYXJzZVRyYWRlUGx1cyAodHJhZGVzW2ldLCBtYXJrZXQpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgbWV0aG9kID0gbWFya2V0WydhcGknXSArICdHZXRUcmFkZSc7XG4gICAgICAgIGxldCByZXF1ZXN0ID0gdGhpcy5jcmVhdGVNYXJrZXRSZXF1ZXN0IChtYXJrZXQpO1xuICAgICAgICBpZiAobWFya2V0WydwbHVzJ10pIHtcbiAgICAgICAgICAgIGxldCBub3cgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgICAgIH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YWxzICgpO1xuICAgICAgICAgICAgbGV0IHAgPSBbXTtcbiAgICAgICAgICAgIGlmICgncGFyYW1zJyBpbiBwYXJhbXMpXG4gICAgICAgICAgICAgICAgcCA9IHBhcmFtc1sncGFyYW1zJ107XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ2lkJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ3BhcmFtcyc6IHAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcCA9IHAuam9pbiAoJywnKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHJlcXVlc3QpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gKFxuICAgICAgICAgICAgICAgICd0b25jZT0nICsgbm9uY2UgK1xuICAgICAgICAgICAgICAgICcmYWNjZXNza2V5PScgKyB0aGlzLmFwaUtleSArXG4gICAgICAgICAgICAgICAgJyZyZXF1ZXN0bWV0aG9kPScgKyBtZXRob2QudG9Mb3dlckNhc2UgKCkgK1xuICAgICAgICAgICAgICAgICcmaWQ9JyArIG5vbmNlICtcbiAgICAgICAgICAgICAgICAnJm1ldGhvZD0nICsgcGF0aCArXG4gICAgICAgICAgICAgICAgJyZwYXJhbXM9JyArIHBcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMScpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLmVuY29kZSAodGhpcy5hcGlLZXkgKyAnOicgKyBzaWduYXR1cmUpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQXV0aG9yaXphdGlvb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ndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI5MTQyOTExLTBlMWFjZmMyLTdkNWMtMTFlNy05OGM0LTA3ZDk1MzJiMjlkNy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkuYnRjbWFya2V0cy5uZXQnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5idGNtYXJrZXRzLm5ldCcsXG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly9idGNtYXJrZXRzLm5ldC9kYXRhJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9idGNtYXJrZXRzLm5ldC8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL0JUQ01hcmtldHMvQVBJJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3tpZH0vdGljaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3tpZH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tpZH0vdHJhZGluZ2ZlZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmR0cmFuc2Zlci93aXRoZHJhd0NyeXB0bycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHRyYW5zZmVyL3dpdGhkcmF3RUZUJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jcmVhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvdHJhZGUvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY3JlYXRlQmF0Y2gnLCAvLyB0aGV5IHByb21pc2UgaXQncyBjb21pbmcgc29vbi4uLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2RldGFpbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd2ViJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9CVENNYXJrZXRzL3tpZH0vdGlja0J5VGltZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0FVRCc6IHsgJ2lkJzogJ0JUQy9BVUQnLCAnc3ltYm9sJzogJ0JUQy9BVUQnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQVVEJywgJ21ha2VyJzogMC4w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RoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0UHJpY2UnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiZXN0QmlkJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiZXN0QXNrJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sdW1lMjRoJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldElkVGljayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydhbW91bnQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVu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uICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU15VHJhZGVzIChyZXNwb25zZVsndHJhZGVzJ10sIG1hcmtldCk7XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJpID0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldICsgdXJpO1xuICAgICAgICBpZiAoYXBpID09PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBxdW90ZXNcbiAgICAgICAgICAgIGxldCBhdXRoID0gdXJpICsgXCJcXG5cIiArIG5vbmNlICsgXCJcXG5cIjtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgICAgICAnYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IG5vbmNlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdQT1NUJykge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHBhcmFtcyk7XG4gICAgICAgICAgICAgICAg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vc3BlbmQucHJpY2UuaHRtbCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmIChhcGkgPT09ICd3ZWInKSB7XG4gICAgICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGRhdGEgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2UsICdkYXRhJyk7XG4gICAgICAgIGlmIChkYXRhKSB7XG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdjb2RlJyk7XG4gICAgICAgICAgICBpZiAoY29kZSAhPT0gJzAnKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSB0aGlzLnNhZmV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cmtldE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk0MTQ4My03OWZjNzM1MC02MmQ5LTExZTctOWY2MS1hYzQ3ZjI4ZmNkOTYuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYnRjLXRyYWRlLmNvbS51YS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9idGMtdHJhZGUuY29tLnVhJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZG9jcy5nb29nbGUuY29tL2RvY3VtZW50L2QvMW9jWUEweU15X1JYZDU2MXNmRzNxRVBaODBreWxsMzZIVXh2Q1JlNUdiaEUvZWRpdCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlYWxzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvc2VsbC97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL2J1eS97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnamFwYW5fc3RhdC9oaWdoL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhc2sve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpZC97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5L3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteV9vcmRlcnMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3N0YXR1cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZW1vdmUvb3JkZXIve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbC97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQkNIL1VBSCc6IHsgJ2lkJzogJ2JjaF91YWgnLCAnc3ltYm9sJzogJ0JDSC9VQUgnLCAnYmFzZSc6ICdCQ0gnLCAncXVvdGUnOiAnVUFIJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvVUFIJzogeyAnaWQnOiAnYnRjX3VhaCcsICdzeW1ib2wnOiAnQlRDL1VBSCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVQUgnLCAncHJlY2lzaW9uJzogeyAncHJpY2UnOiAxIH0sICdsaW1pdHMnOiB7ICdhbW91bnQnOiB7ICdtaW4nOiAwLjAwMDAwMDAwMDEgfX19LFxuICAgICAgICAgICAgICAgICdEQVNIL0JUQyc6IHsgJ2lkJzogJ2Rhc2hfYnRjJywgJ3N5bWJvbCc6ICdEQVNIL0JUQycsICdiYXNlJzogJ0RBU0gnLCAncXVvdGUnOiAnQlRDJyB9LFxuICAgICAgICAgICAgICAgICdEQVNIL1VBSCc6IHsgJ2lkJzogJ2Rhc2hfdWFoJywgJ3N5bW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AgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05WQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDEwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBzaWduSW4gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5wcml2YXRlUG9zdEF1dGggKCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBpZiAoJ2FjY291bnRzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgbGV0IGFjY291bnRzID0gcmVzcG9uc2VbJ2FjY291bnRzJ107XG4gICAgICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGFjY291bnRzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGFjY291bnQgPSBhY2NvdW50c1tiXTtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBhY2NvdW50WydjdXJyZW5jeSddO1xuICAgICAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcGFyc2VGbG9hdCAoYWNjb3VudFsnYmFsYW5jZSddKTtcbiAgICAgICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0ge1xuICAgICAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2UsXG4gICAgICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBiaWRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkZXNCdXlTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGFza3MgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlc1NlbGxTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IHtcbiAgICAgICAgICAgICdiaWRzJzogW10sXG4gICAgICAgICAgICAnYXNrcyc6IFtdLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoYmlkcykge1xuICAgICAgICAgICAgaWYgKCdsaXN0JyBpbiBiaWRzKVxuICAgICAgICAgICAgICAgIG9yZGVyYm9va1snYmlkcyddID0gYmlkc1snbGlzdCddO1xuICAgICAgICB9XG4gICAgICAgIGlmIChhc2tzKSB7XG4gICAgICAgICAgICBpZiAoJ2xpc3QnIGluIGFza3MpXG4gICAgICAgICAgICAgICAgb3JkZXJib29rWydhc2tzJ10gPSBhc2tzWydsaXN0J107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYmlkcycsICdhc2tzJywgJ3ByaWNlJywgJ2N1cnJlbmN5X3RyYWRlJyk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRKYXBhblN0YXRIaWdoU3ltYm9sICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3RyYWRlcyddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xvdyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHRpY2tlckxlbmd0aCA9IHRpY2tlci5sZW5ndGg7XG4gICAgICAgIGlmICh0aWNrZXJMZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBsZXQgc3RhcnQgPSBNYXRoLm1heCAodGlja2VyTGVuZ3RoIC0gNDgsIDApO1xuICAgICAgICAgICAgZm9yIChsZXQgdCA9IHN0YXJ0OyB0IDwgdGlja2VyLmxlbmd0aDsgdCsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGNhbmRsZSA9IHRpY2tlclt0XTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJlc3VsdFsnb3BlbiddID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0WydvcGVuJ10gPSBjYW5kbGVbMV07XG4gICAgICAgICAgICAgICAgaWYgKCh0eXBlb2YgcmVzdWx0WydoaWdoJ10gPT09ICd1bmRlZmluZWQnKSB8fCAocmVzdWx0WydoaWdoJ10gPCBjYW5kbGVbMl0pKVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ2hpZ2gnXSA9IGNhbmRsZVsyXTtcbiAgICAgICAgICAgICAgICBpZiAoKHR5cGVvZiByZXN1bHRbJ2xvdyddID09PSAndW5kZWZpbmVkJykgfHwgKHJlc3VsdFsnbG93J10gPiBjYW5kbGVbM10pKVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ2xvdyddID0gY2FuZGxlWzNdO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVzdWx0WydiYXNlVm9sdW1lJ10gPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ2Jhc2VWb2x1bWUnXSA9IC1jYW5kbGVbNV07XG4gICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ2Jhc2VWb2x1bWUnXSAtPSBjYW5kbGVbNV07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgbGFzdCA9IHRpY2tlckxlbmd0aCAtIDE7XG4gICAgICAgICAgICByZXN1bHRbJ2xhc3QnXSA9IHRpY2tlcltsYXN0XVs0XTtcbiAgICAgICAgICAgIHJlc3VsdFsnY2xvc2UnXSA9IHJlc3VsdFsnbGFzdCddO1xuICAgICAgICAgICAgcmVzdWx0WydiYXNlVm9sdW1lJ10gPSAtMSAqIHJlc3VsdFsnYmFzZVZvbHVtZSddO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgY29udmVydEN5cmlsbGljTW9udGhOYW1lVG9TdHJpbmcgKGN5cmlsbGljKSB7XG4gICAgICAgIGxldCBtb250aHMgPSB7XG4gICAgICAgICAgICAn0Y/QvdCy0LDRgNGPJzogJzAxJyxcbiAgICAgICAgICAgICfRhNC10LLRgNCw0LvRjyc6ICcwMicsXG4gICAgICAgICAgICAn0LzQsNGA0YLQsCc6ICcwMycsXG4gICAgICAgICAgICAn0LDQv9GA0LXQu9GPJzogJzA0JyxcbiAgICAgICAgICAgICfQvNCw0Y8nOiAnMDUnLFxuICAgICAgICAgICAgJ9C40Y7QvdGPJzogJzA2JyxcbiAgICAgICAgICAgICfQuNGO0LvRjyc6ICcwNycsXG4gICAgICAgICAgICAn0LDQstCz0YPRgdGC0LAnOiAnMDgnLFxuICAgICAgICAgICAgJ9GB0LXQvdGC0Y/QsdGA0Y8nOiAnMDknLFxuICAgICAgICAgICAgJ9C+0LrRgtGP0LHRgNGPJzogJzEwJyxcbiAgICAgICAgICAgICfQvdC+0Y/QsdGA0Y8nOiAnMTEnLFxuICAgICAgICAgICAgJ9C00LXQutCw0LHRgNGPJzogJzEyJyxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IG1vbnRoID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoY3lyaWxsaWMgaW4gbW9udGhzKVxuICAgICAgICAgICAgbW9udGggPSBtb250aHNbY3lyaWxsaWNdO1xuICAgICAgICByZXR1cm4gbW9udGg7XG4gICAgfVxuXG4gICAgcGFyc2VDeXJpbGxpY0RhdGV0aW1lIChjeXJpbGxpYykge1xuICAgICAgICBsZXQgcGFydHMgPSBjeXJpbGxpYy5zcGxpdCAoJyAnKTtcbiAgICAgICAgbGV0IGRheSA9IHBhcnRzWzBdO1xuICAgICAgICBsZXQgbW9udGggPSB0aGlzLmNvbnZlcnRDeXJpbGxpY01vbnRoTmFtZVRvU3RyaW5nIChwYXJ0c1sxXSk7XG4gICAgICAgIGlmICghbW9udGgpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcGFyc2VUcmFkZSgpIHVuZGVmaW5lZCBtb250aCBuYW1lOiAnICsgY3lyaWxsaWMpO1xuICAgICAgICBsZXQgeWVhciA9IHBhcnRzWzJdO1xuICAgICAgICBsZXQgaG1zID0gcGFydHNbNF07XG4gICAgICAgIGxldCBobXNMZW5ndGggPSBobXMubGVuZ3RoO1xuICAgICAgICBpZiAoaG1zTGVuZ3RoID09PSA3KSB7XG4gICAgICAgICAgICBobXMgPSAnMCcgKyBobXM7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGRheS5sZW5ndGggPT09IDEpIHtcbiAgICAgICAgICAgIGRheSA9ICcwJyArIGRheTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgeW1kID0gWyB5ZWFyLCBtb250aCwgZGF5IF0uam9pbiAoJy0nKTtcbiAgICAgICAgbGV0IHltZGhtcyA9IHltZCArICdUJyArIGhtczt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LmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnYnRjdHVyaycsXG4gICAgICAgICAgICAnbmFtZSc6ICdCVENUdXJrJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnVFInLCAvLyBUdXJrZXlcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxZCc6ICcxZCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk5MjcwOS0xOGUxNTY0Ni02NGEzLTExZTctOWZhMi1iMDk1MGVjNzcxMmYuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmJ0Y3R1cmsuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5idGN0dXJrLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vQlRDVHJhZGVyL2Jyb2tlci1hcGktZG9jcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29obGNkYXRhJywgLy8gP2xhc3Q9Q09VTlRcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJywgICAvLyA/bGFzdD1DT1VOVCAobWF4IDUwKVxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlclRyYW5zYWN0aW9ucycsIC8vID9vZmZzZXQ9MCZsaW1pdD0yNSZzb3J0PWFzY1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9UUlknOiB7ICdpZCc6ICdCVENUUlknLCAnc3ltYm9sJzogJ0JUQy9UUlknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVFJZJywgJ21ha2VyJzogMC4wMDIgKiAxLjE4LCAndGFrZXInOiAwLjAwMzUgKiAxLjE4IH0sXG4gICAgICAgICAgICAgICAgJ0VUSC9UUlknOiB7ICdpZCc6ICdFVEhUUlknLCAnc3ltYm9sJzogJ0VUSC9UUlknLCAnYmFzZSc6ICdFVEgnLCAncXVvdGUnOiAnVFJZJywgJ21ha2VyJzogMC4wMDIgKiAxLjE4LCAndGFrZXInOiAwLjAwMzUgKiAxLjE4IH0sXG4gICAgIC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O1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh7ICdpZCc6IGlkIH0pO1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKHRoaXMuaWQgPT09ICdidGN0cmFkZXInKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGlzIGFuIGFic3RyYWN0IGJhc2UgQVBJIGZvciBCVENFeGNoYW5nZSwgQlRDVHVyaycpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyA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ICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97aWR9L3tsaW1pdH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS97aWR9L3tsaW1pdH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlZGVlbScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvVVNEJzogeyAnaWQnOiAnYnRjL3VzZCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdidGMvZXVyJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAoYmFsYW5jZXMpO1xuICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGN1cnJlbmNpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gY3VycmVuY3kudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VzW2N1cnJlbmN5XSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlc1tjdXJyZW5jeV0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W3VwcGVyY2FzZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZW9mIGxpbWl0ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHJlcXVlc3RbJ2xpbWl0J10gPSBsaW1pdDsgLy8gMTAwMFxuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXREZXB0aElkTGlta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ZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWwgKHsgJ29yZGVyJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICB1cmwgKz0gYXBpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdNZXRob2QnOiBwYXRoLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgICAgICdOb25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ25hdHVyZSc6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGJvZHkpLCB0aGlzLmVuY29kZSAodGhpcy5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RXhjaGFuZ2Uge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdieGludGgnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQlguaW4udGgnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdUSCcsIC8vIFRoYWlsYW5kXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NDEyLTU2N2IxZWI0LTVlZDctMTFlNy05NGE4LWZmNmEzODg0ZjZjNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9ieC5pbi50aC9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9ieC5pbi50aCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2J4LmluLnRoL2luZm8vYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnJywgLy8gdGlja2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYWlyaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaWxsZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpbGxncm91cCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlsbHBheScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1pc3N1ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWJpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLXNlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1teWlzc3VlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tbXliaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1teW9wdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1leGVyY2lzZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWNhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsLWhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMjUgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMjUgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnREFTJzogJ0RBU0gnLFxuICAgICAgICAgICAgICAgICdET0cnOiAnRE9HRScsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0UGFpcmluZyAoKTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBrZXlzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1trZXlzW3BdXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsncGFpcmluZ19pZCddLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ3NlY29uZGFyeV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydwcmltYXJ5X2N1cnJlbmN5J107XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2UpO1xuICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGN1cnJlbmNpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjd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mtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3RfcHJpY2UnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnb3JkZXJib29rJ11bJ2JpZHMnXVsnaGlnaGJpZCddKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydvcmRlcmJvb2snXVsnYXNrcyddWydoaWdoYmlkJ10pLFxuICAgICAgICAgICAgJ2Fza1ZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiBsYXN0LFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ3ByZXZpb3VzQ2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhbmdlJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2NoYW5nZScpLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGhp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xpY0dldCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyaW5nJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddLnRvU3RyaW5nICgpO1xuICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWyd0cmFkZV9kYXRlJ10pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RyYWRlX2lkJ10sXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ29yZGVyJzogdHJhZGVbJ29yZGVyX2lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3RyYWRlX3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3JhdGUnKSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdhbW91bnQnKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIH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YXRlJyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdhbW91bnQnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnb3JkZXJfaWQnXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3Blbk9yZGVycyAoc3ltYm9sID0gdW5kZWZpbmVkLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge307XG4gICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2Ygc3ltYm9sICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgICAgICByZXF1ZXN0WydwYWlyaW5nJ10gPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gdGhpcy5wcml2YXRlUG9zdEdldG9yZGVycyAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgb3JkZXJzID0gdGhpcy5wYXJzZU9yZGVycyAocmVzcG9uc2VbJ29yZGVycyddLCBtYXJrZXQsIHNpbmNlLCBsaW1pdCk7XG4gICAgICAgIHJldHVybiB0aGlzLmZpbHRlckJ5U3ltYm9sIChvcmRlcnMsIHN5bWJvbCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJztcbiAgICAgICAgaWYgKHBhdGgpXG4gICAgICAgICAgICB1cmwgKz0gcGF0aCArICcvJztcbiAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IHRoaXMuYXBpS2V5ICsgbm9uY2UudG9TdHJpbmcgKCkgKyB0aGlzLnNlY3JldDtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhhc2ggKHRoaXMuZW5jb2RlIChhdXRoKSwgJ3NoYTI1NicpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnc2lnbmF0dXJlJzogc2lnbmF0dXJ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gICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2MtY2V4LmNvbS90L2FwaV9wdWIuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYy1jZXguY29tL3QvYXBpLmh0bWwnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2MtY2V4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2MtY2V4LmNvbS8/aWQ9YXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3ZWInOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29pbm5hbWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndm9sdW1lX3tjb2lufScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VkaXN0cmlidXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHN1bW1hcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdWxsb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eWxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRvcGVub3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0b3JkZXJoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteXRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbGxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdJT1QnOiAnSW9UY29pbicsXG4gICAgICAgICAgICAgICAgJ0JMQyc6ICdDcnlwdG9idWxsY29pbicsXG4gICAgICAgICAgICAgICAgJ1hJRCc6ICdJbnRlcm5hdGlvbmFsRGlhbW9uZCcsXG4gICAgICAgICAgICAgICAgJ0xVWCc6ICdMdXhtaScsXG4gICAgICAgICAgICAgICAgJ0NSQyc6ICdDb3JlQ29pbicsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMud2ViR2V0UGFpcnMgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3BhaXJzJ107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCctJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGJhc2VJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHF1b3RlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdpbmZvJzogaWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIC8vIGFuIGFsdGVybmF0aXZlIGRvY3VtZW50ZWQgcGFyc2VyXG4gICAgICAgIC8vICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgLy8gICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1sncmVzdWx0J10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgLy8gICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sncmVzdWx0J11bcF07XG4gICAgICAgIC8vICAgICAgICAgbGV0IGlkID0gbWFya2V0WydNYXJrZXROYW1lJ107XG4gICAgICAgIC8vICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ01hcmtldEN1cnJlbmN5J107XG4gICAgICAgIC8vICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydCYXNlQ3VycmVuY3knXTtcbiAgICAgICAgLy8gICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAvLyAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgLy8gICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAvLyAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgIC8vICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAvLyAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAvLyAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgIC8vICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAvLyAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgLy8gICAgICAgICB9KTtcbiAgICAgICAgLy8gICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9I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gICAgbGV0IG1hcmtldElkcyA9IE9iamVjdC5rZXlzIChiaWRhc2tzQnlNYXJrZXRJZCk7XG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IG1hcmtldElkcy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IG1hcmtldElkc1tqXTtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0SWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgbGV0IHNpZGUgPSB0eXBlO1xuICAgICAgICAgICAgICAgIGlmIChzeW1ib2wgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbc3ltYm9sXTtcbiAgICAgICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLScpO1xuICAgICAgICAgICAgICAgICAgICBsZXQgaW52ZXJ0ZWRJZCA9IHF1b3RlICsgJy0nICsgYmFzZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGludmVydGVkSWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2ludmVydGVkSWRdO1xuICAgICAgICAgICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIShzeW1ib2wgaW4gb3JkZXJib29rcykpXG4gICAgICAgICAgICAgICAgICAgIG9yZGVyYm9va3Nbc3ltYm9sXSA9IHt9O1xuICAgICAgICAgICAgICAgIG9yZGVyYm9va3Nbc3ltYm9sXVtzaWRlXSA9IGJpZGFza3NCeU1hcmtldElkW21hcmtldElkXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG9yZGVyYm9va3MpO1xuICAgICAgICBmb3IgKGxldCBrID0gMDsgayA8IGtleXMubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgIGxldCBrZXkgPSBrZXlzW2tdO1xuICAgICAgICAgICAgcmVzdWx0W2tleV0gPSB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2tzW2tleV0sIHVuZGVmaW5lZCwgJ2J1eScsICdzZWxsJywgJ1JhdGUnLCAnUXVhbnRpdHknKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd1cGRhdGVkJ10gKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0cHJpY2UnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZm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VzIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAodGlja2Vycyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBpZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gdXBwZXJjYXNlLnNwbGl0ICgnLScpO1xuICAgICAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLndlYkdldE1hcmtldCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdtYXJrZXQnOiBtYXJrZXRbJ2lkJ10udG9Mb3dlckNhc2UgKCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3RpY2tlciddO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnVGltZVN0YW1wJ10pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ0lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydPcmRlclR5cGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydQcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6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HJpY2UsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydyZXN1bHQnXVsndXVpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlR2V0Q2FuY2VsICh7ICd1dWlkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBpZiAoYXBpID09PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMua2V5c29ydCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYSc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdhcGlzaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAodXJsKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpIH07XG4gICAgICAgIH0gZWxzZSBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhJzogJ2dldCcgKyBwYXRoLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB1cmwgKz0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpICsgJy5qc29uJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoYXBpID09PSAnd2ViJylcbiAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSlcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnc3VjY2VzcyddKVxuICAgICAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGl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nVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQ0Mi04ZGRjMzNiMC01ZWQ4LTExZTctOGI5OC1mNzg2YWVmMGYzYzkuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vY2V4LmlvL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2NleC5pbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2NleC5pby9jZXgtYXBpJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vY2V4LmlvL2ZlZS1zY2hlZHVsZScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2NleC5pby9saW1pdHMtY29tbWlzc2lvbnMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5X2xpbWl0cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhc3RfcHJpY2Uve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdF9wcmljZXMve2N1cnJlbmNpZXN9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2hsY3YvaGQve3l5eXltbWRkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2sve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMve2N1cnJlbmNpZXN9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfaGlzdG9yeS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29udmVydC97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlX3N0YXRzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWN0aXZlX29yZGVyc19zdGF0dXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcmNoaXZlZF9vcmRlcnMve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcnMve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3JlcGxhY2Vfb3JkZXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2xvc2VfcG9zaXRpb24ve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2FkZHJlc3MvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfbXlmZWUvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfb3JkZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfb3JkZXJfdHgvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fcG9zaXRpb24ve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9wb3NpdGlvbnMve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGxhY2Vfb3JkZXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnVVNEJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ0VVUic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdSVUInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnR0JQJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnVVNEJzogYW1vdW50ID0+IGFtb3VudCAqIDAuMDM1ICsgMC4yNSxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdFVVInOiBhbW91bnQgPT4gYW1vdW50ICogMC4wMzUgKyAwLjI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ1JVQic6IGFtb3VudCA9PiBhbW91bnQgKiAwLjA1ICsgMTUuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnR0JQJzogYW1vdW50ID0+IGFtb3VudCAqIDAuMDM1ICsgMC4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWExNJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY3lMaW1pdHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWydkYXRhJ11bJ3BhaXJzJ10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydkYXRhJ11bJ3BhaXJzJ11bcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbDEnXSArICcvJyArIG1hcmtldFsnc3ltYm9sMiddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IG1hcmtldFsnbWluTG90U2l6ZSddLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0WydtaW5QcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IC0xICogTWF0aC5sb2cxMCAobWFya2V0WydtaW5Mb3RTaXplJ10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ21pbkxvdFNpemUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBtYXJrZXRbJ21heExvdFNpemUnXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5QcmljZScpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYXhQcmljZScpLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ21pbkxvdFNpemVTMiddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RCYWxhbmNlICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3Bv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G4gICAgICAgIGxldCBoaWdoID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKTtcbiAgICAgICAgbGV0IGxvdyA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKTtcbiAgICAgICAgbGV0IGJpZCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiaWQnKTtcbiAgICAgICAgbGV0IGFzayA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKTtcbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdCcpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogaXNvODYwMSxcbiAgICAgICAgICAgICdoaWdoJzogaGlnaCxcbiAgICAgICAgICAgICdsb3cnOiBsb3csXG4gICAgICAgICAgICAnYmlkJzogYmlkLFxuICAgICAgICAgICAgJ2JpZFZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiBhc2ssXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgIC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IERlcGVuZGluZyBvbiB0aGUgY2FsbCwgJ3RpbWUnIGNhbiBiZSBhIHVuaXggaW50LCB1bml4IHN0cmluZyBvciBJU08gc3RyaW5nXG4gICAgICAgIC8vIFllcywgcmVhbGx5XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBvcmRlclsndGltZSddO1xuICAgICAgICBpZiAodHlwZW9mIG9yZGVyWyd0aW1lJ10gPT09ICdzdHJpbmcnICYmIG9yZGVyWyd0aW1lJ10uaW5kZXhPZiAoJ1QnKSA+PSAwKSB7XG4gICAgICAgICAgICAvLyBJU084NjAxIHN0cmluZ1xuICAgICAgICAgICAgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRpbWVzdGFtcCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBlaXRoZXIgaW50ZWdlciBvciBzdHJpbmcgaW50ZWdlclxuICAgICAgICAgICAgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRpbWVzdGFtcCk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBvcmRlclsnc3ltYm9sMSddICsgJy8nICsgb3JkZXJbJ3N5bWJvbDInXTtcbiAgICAgICAgICAgIGlmIChzeW1ib2wgaW4gdGhpcy5tYXJrZXRzKVxuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICB9XG4gICAgICAgIGxldCBzdGF0dXMgPSBvcmRlclsnc3RhdHVzJ107XG4gICAgICAgIGlmIChzdGF0dXMgPT09ICdhJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nOyAvLyB0aGUgdW5pZmllZCBzdGF0dXNcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT09ICdjZCcpIHtcbiAgICAgICAgICAgIHN0YXR1cyA9ICdj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RlLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IGJhc2VGZWVDb3N0LFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9IGVsc2UgaWYgKChxdW90ZUZlZSBpbiBvcmRlcikgfHwgKHF1b3RlVGFrZXJGZWUgaW4gb3JkZXIpKSB7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlRmVlQ29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgcXVvdGVGZWUpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcXVvdGVGZWVDb3N0ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgcXVvdGVGZWVDb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCBxdW90ZVRha2VyRmVlKTtcbiAgICAgICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUnOiBmZWVSYXRlLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHF1b3RlRmVlQ29zdCxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICghY29zdClcbiAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGZpbGxlZDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eX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ICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnY2hidGMnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQ0hCVEMnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDTicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODU1NTY1OS1mMDA0MGRjMi03MTA5LTExZTctOWQ5OS02ODhhNDM4YmY5ZjQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHA6Ly9hcGkuY2hidGMuY29tL2RhdGEnLCAvLyBubyBodHRwcyBmb3IgcHVibGljIEFQSVxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3RyYWRlLmNoYnRjLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3RyYWRlLmNoYnRjLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuY2hidGMuY29tL2kvZGV2ZWxvcGVyJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0NOWSc6IHsgJ2lkJzogJ2J0Y19jbnknLCA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4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgIC8vIHRoZSBmaXJzdCB0d28gZG9uJ3Qgc2VlbSB0byB3b3JrIGF0IGFsbFxuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG0nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaCcsXG4gICAgICAgICAgICAgICAgJzNoJzogJzNoJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMUQnLFxuICAgICAgICAgICAgICAgICc3ZCc6ICc3RCcsXG4gICAgICAgICAgICAgICAgJzE0ZCc6ICcxNEQnLFxuICAgICAgICAgICAgICAgICcxTSc6ICcxTScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zNTc1NTU3Ni1kZWUwMmU1Yy0wODc4LTExZTgtOTg5Zi0xNTk1ZDgwYmE0N2YuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vYXBpLmNvYmluaG9vZC5jb20vdjEnLFxuICAgICAgICAgICAgICAgICAgICAnd3MnOiAnd3NzOi8vZmVlZC5jb2Jpbmhvb2QuY29tJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2Jpbmhvb2QuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vY29iaW5ob29kLmdpdGh1Yi5pby9hcGktcHVibGljJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdzeXN0ZW0nOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGltZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWVzc2FnZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21lc3NhZ2VzL3ttZXNzYWdlX2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnYWRtaW4nOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3lzdGVtL21lc3NhZ2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeXN0ZW0vbWVzc2FnZXMve21lc3NhZ2VfaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3lzdGVtL21lc3NhZ2VzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3BhdGNoJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5c3RlbS9tZXNzYWdlcy97bWVzc2FnZV9pZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5c3RlbS9tZXNzYWdlcy97bWVzc2FnZV9pZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvdGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC90cmFkaW5nX3BhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3JkZXJib29rcy97dHJhZGluZ19wYWlyX2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3N0YXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvdGlja2Vycy97dHJhZGluZ19wYWlyX2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3RyYWRlcy97dHJhZGluZ19wYWlyX2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhcnQvY2FuZGxlcy97dHJhZGluZ19wYWlyX2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nL29yZGVycy97b3JkZXJfaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nL29yZGVycy97b3JkZXJfaWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZy9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmcvb3JkZXJfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZy90cmFkZXMve3RyYWRlX2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvbGVkZ2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvZGVwb3NpdF9hZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC93aXRoZHJhd2FsX2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L3dpdGhkcmF3YWxzL3t3aXRoZHJhd2FsX2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvZGVwb3NpdHMve2RlcG9zaXRfaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvZGVwb3NpdHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2RlcG9zaXRfYWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvd2l0aGRyYXdhbF9hZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC93aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZy9vcmRlcnMve29yZGVyX2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ2luc3VmZmljaWVudF9iYWxhbmNlJzogSW5zdWZmaWNpZW50RnVuZHMsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0Q3VycmVuY2llcyAocGFyYW1zKTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSByZXNwb25zZVsncmVzdWx0J11bJ2N1cnJlbmNpZXMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jeVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBtaW5Vbml0ID0gdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAnbWluX3VuaXQnKTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmaWF0JzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAoY3VycmVuY3lbJ21pbl91bml0J10pLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWluVW5pdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtaW5Vbml0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWluVW5pdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtaW5Vbml0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlJzogdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAnd2l0aGRyYXdhbF9mZWUnKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlJzogdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAnZGVwb3NpdF9mZWUnKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRUcmFkaW5nUGFpcnMgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3Jlc3VsdCddWyd0cmFkaW5nX3BhaXJzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCctJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ3F1b3RlX2luY3JlbWVudCddKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gdGhpcy5zYWZlVmFsdWUgKG1hcmtldCwgJ2lzX2FjdGl2ZScsIHRydWUpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnYmFzZV9taW5fc2l6ZScpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdiYXNlX21heF9zaXplJyksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IHRoaXMuc2FmZVN0cmluZyAodGlja2VyLCAndHJhZGluZ19wYWlyX2lkJyk7XG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLmZpbmRNYXJrZXQgKG1hcmtldElkKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO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cmRlclsnc2lkZSddID09PSAnYmlkJykgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ3R5cGUnXSwgLy8gbWFya2V0LCBsaW1pdCwgc3RvcCwgc3RvcF9saW1pdCwgdHJhaWxpbmdfc3RvcCwgZmlsbF9vcl9raWxsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAndHJhZGVzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V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aycsXG4gICAgICAgICAgICAnbmFtZSc6ICdjb2luY2hlY2snLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ0pQJywgJ0lEJyBdLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQ2NC0zYjVjM2M3NC01ZWQ5LTExZTctODQwZS0zMWIzMjk2OGUxZGEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vY29pbmNoZWNrLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2luY2hlY2suY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vY29pbmNoZWNrLmNvbS9kb2N1bWVudHMvZXhjaGFuZ2UvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3JhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyYXRlL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL2xldmVyYWdlX2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbmtfYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRfbW9uZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVycy9vcGVucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3RyYW5zYWN0aW9uc19wYWdpbmF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9sZXZlcmFnZS9wb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRpbmcvYm9ycm93cy9tYXRjaGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kX21vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYW5rX2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X21vbmV5L3tpZH0vZmFzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90cmFuc2ZlcnMvdG9fbGV2ZXJhZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RyYW5zZmVycy9mcm9tX2xldmVyYWdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kaW5nL2JvcnJvd3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRpbmcvYm9ycm93cy97aWR9L3JlcGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kX21vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbmtfYWNjb3VudHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvSlBZJzogeyAnaWQnOiAnYnRjX2pweScsICdzeW1ib2wnOiAnQlRDL0pQWScsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdKUFknIH0sIC8vIHRoZSBvbmx5IHJlYWwgcGFpclxuICAgICAgICAgICAgICAgIC8vICdFVEgvSlBZJzogeyAnaWQnOiAnZXRoX2pweScsICdzeW1ib2wnOiAnRVRIL0pQWScsICdiYXNlJzogJ0VUSCcsICdxdW90ZSc6ICdKUFknIH0sXG4gICAgICAgICAgICAgICAgLy8gJ0VUQy9KUFknOiB7ICdpZCc6ICdldGNfanB5JywgJ3N5bWJvbCc6ICdFVEMvSlBZJywgJ2Jhc2UnOiAnRVRDJywgJ3F1b3RlJzogJ0pQWScgfSxcbiAgICAgICAgICAgICAgICAvLyAnREFPL0pQWSc6IHsgJ2lkJzogJ2Rhb19qcHkn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GVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIGxldCBvcmRlcl90eXBlID0gdHlwZSArICdfJyArIHNpZGU7XG4gICAgICAgICAgICBvcmRlclsnb3JkZXJfdHlwZSddID0gb3JkZXJfdHlwZTtcbiAgICAgICAgICAgIGxldCBwcmVmaXggPSAoc2lkZSA9PT0gJ2J1eScpID8gKG9yZGVyX3R5cGUgKyAnXycpIDogJyc7XG4gICAgICAgICAgICBvcmRlcltwcmVmaXggKyAnYW1vdW50J10gPSBhbW91bnQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvcmRlclsnb3JkZXJfdHlwZSddID0gc2lkZTtcbiAgICAgICAgICAgIG9yZGVyWydyYXRlJ10gPSBwcmljZTtcbiAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0RXhjaGFuZ2VPcmRlcnMgKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLnByaXZhdGVEZWxldGVFeGNoYW5nZU9yZGVyc0lkICh7ICdpZCc6IGlkIH0pO1xuICAgIH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nVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzY3NzAzMTAtYWRmYTc2NGUtMWM1YS0xMWU4LThlMDktNDQ5ZGFhYzNkMmZiLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL3d3dy5jb2luZWdnLmNvbS9jb2luJyxcbiAgICAgICAgICAgICAgICAgICAgJ3Jlc3QnOiAnaHR0cHM6Ly9hcGkuY29pbmVnZy5jb20vYXBpL3YxJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuY29pbmVnZy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuY29pbmVnZy5jb20vZXhwbGFpbi5hcGkuaHRtbCcsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cuY29pbmVnZy5jb20vZmVlLmh0bWwnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cXVvdGV9L2FsbGNvaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3txdW90ZX0vdHJlbmRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cXVvdGV9L3tiYXNlfS9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3F1b3RlfS97YmFzZX0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cXVvdGV9L3tiYXNlfS9kZXB0aC5qcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cXVvdGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97cXVvdGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve3F1b3RlfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfYWRkL3txdW90ZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2NhbmNlbC97cXVvdGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV92aWV3L3txdW90ZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2xpc3Qve3F1b3RlfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDA4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFNLJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUUyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0FNRSc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR09PQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJRkMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkxLJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWUkMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hQTSc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVlRDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdURkMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUFDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZaJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRVQnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JTUyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEdDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS1QnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0pCQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUklPJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMS0MnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pDQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRRUMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01FVCc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWVRDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdITEInOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01SWUMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01UQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS1RDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcxMDMnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDQnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDUnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDYnOiBJbnZhbGlkTm9uY2UsXG4gICAgICAgICAgICAgICAgJzIwMCc6IEluc3VmZmljaWVudEZ1bmRzLFxuICAgICAgICAgICAgICAgICcyMDEnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJzIwMic6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAnMjAzJzogT3JkZXJOb3RGb3VuZCxcbiAgICAgICAgICAgICAgICAnNDAyJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2Vycm9yTWVzc2FnZXMnOiB7XG4gICAgICAgICAgICAgICAgJzEwMCc6ICdSZXF1aXJlZCBwYXJhbWV0ZXJzIGNhbiBub3QgYmUgZW1wdHknLFxuICAgICAgICAgICAgICAgICcxMDEnOiAnSWxsZWdhbCBwYXJhbWV0ZXInLFxuICAgICAgICAgICAgICAgICcxMDInOiAnY29pbiBkb2VzIG5vdCBleGlzdCcsXG4gICAgICAgICAgICAgICAgJzEwMyc6ICdLZXkgZG9lcyBub3QgZXhpc3QnLFxuICAgICAgICAgICAgICAgICcxMDQnOiAnU2lnbmF0dXJlIGRvZXMgbm90IG1hdGNoJyxcbiAgICAgICAgICAgICAgICAnMTA1JzogJ0luc3VmZmljaWVudCBwZXJtaXNzaW9ucycsXG4gICAgICAgICAgICAgICAgJzEwNic6ICdSZXF1ZXN0IGV4cGlyZWQobm9uY2UgZXJyb3IpJyxcbiAgICAgICAgICAgICAgICAnMjAwJzogJ0xhY2sgb2YgYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgJzIwMSc6ICdUb28gc21hbGwgZm9yIHRoZSBudW1iZXIgb2YgdHJhZGluZycsXG4gICAgICAgICAgICAgICAgJzIwMic6ICdQcmljZSBtdXN0IGJlIGluIDAgLSAxMDAwM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AgICAgICAgbGV0IGJhc2VzID0gYXdhaXQgdGhpcy53ZWJHZXRRdW90ZUFsbGNvaW4gKHtcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZUlkLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGJhc2VzID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VOb3RBdmFpbGFibGUgKHRoaXMuaWQgKyAnIGZldGNoTWFya2V0cygpIGZvciBcIicgKyBxdW90ZUlkICsgJ1wiIHJldHVybmVkOiBcIicgKyB0aGlzLmpzb24gKGJhc2VzKSArICdcIicpO1xuICAgICAgICAgICAgbGV0IGJhc2VJZHMgPSBPYmplY3Qua2V5cyAoYmFzZXMpO1xuICAgICAgICAgICAgbGV0IG51bUJhc2VJZHMgPSBiYXNlSWRzLmxlbmd0aDtcbiAgICAgICAgICAgIGlmIChudW1CYXNlSWRzIDwgMSlcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VOb3RBdmFpbGFibGUgKHRoaXMuaWQgKyAnIGZldGNoTWFya2V0cygpIGZvciBcIicgKyBxdW90ZUlkICsgJ1wiIHJldHVybmVkOiBcIicgKyB0aGlzLmpzb24gKGJhc2VzKSArICdcIicpO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYXNlSWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGJhc2VJZHNbaV07XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IGJhc2VzW2Jhc2VJZF07XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBiYXNlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBiYXNlSWQgKyBxdW90ZUlkO1xuICAgICAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdCcpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGF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biAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJRdW90ZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjb2luJzogbWFya2V0WydiYXNlSWQnXSxcbiAgICAgICAgICAgICdxdW90ZSc6IG1hcmtldFsncXVvdGVJZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlcnMgKHN5bWJvbHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBxdW90ZUlkcyA9IHRoaXMub3B0aW9uc1sncXVvdGVJZHMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IHF1b3RlSWRzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IHF1b3RlSWRzW2JdO1xuICAgICAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLndlYkdldFF1b3RlQWxsY29pbiAoe1xuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlSWQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGxldCBiYXNlSWRzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICAgICAgaWYgKCFiYXNlSWRzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICgnZmV0Y2hUaWNrZXJzIGZhaWxlZCcpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYXNlSWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGJhc2VJZHNbaV07XG4gICAgICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbYmFzZUlkXTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBiYXNlSWQgKyBxdW90ZUlkO1xuICAgICAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c0J5SWRbaWRdO1xuICAgICAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh7XG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlnaCc6IHRpY2tlcls0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb3cnOiB0aWNrZXJbNV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JzogdGlja2VyWzJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwnOiB0aWNrZXJbM10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdCc6IHRpY2tlclsxXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjaGFuZ2UnOiB0aWNrZXJbOF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAndm9sJzogdGlja2VyWzZdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlVm9sJzogdGlja2VyWzddLFxuICAgICAgICAgICAgICAgICAgICB9LCBtYXJrZXQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxp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ICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHRoaXMub21pdCAocmVzcG9uc2VbJ2RhdGEnXSwgJ3VpZCcpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGtleSA9IGtleXNbaV07XG4gICAgICAgICAgICBsZXQgWyBjdXJyZW5jeUlkLCBhY2NvdW50VHlwZSBdID0ga2V5LnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSBjdXJyZW5jeUlkO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5SWQgaW4gdGhpcy5jdXJyZW5jaWVzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgY29kZSA9IHRoaXMuY3VycmVuY2llc19ieV9pZFtjdXJyZW5jeUlkXVsnY29kZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCEoY29kZSBpbiByZXN1bHQpKSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICAgICAnZnJlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgJ3VzZWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICd0b3RhbCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYWNjb3VudFR5cGUgPSAoYWNjb3VudFR5cGUgPT09ICdsb2NrJykgPyAndXNlZCcgOiAnZnJlZSc7XG4gICAgICAgICAgICByZXN1bHRbY29kZV1bYWNjb3VudFR5cGVdID0gcGFyc2VGbG9hdCAoYmFsYW5jZXNba2V5XSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3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WxlZCc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBzdGF0dXMgPSByZW1haW5pbmcgPyAnb3BlbicgOiAnY2xvc2VkJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgaW5mbyA9IHRoaXMuc2FmZVZhbHVlIChvcmRlciwgJ2luZm8nLCBvcmRlcik7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKG9yZGVyLCAnaWQnKSxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IGluZm8sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VHJhZGVBZGRRdW90ZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjb2luJzogbWFya2V0WydiYXNlSWQnXSxcbiAgICAgICAgICAgICdxdW90ZSc6IG1hcmtldFsncXVvdGVJZCddLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGlkID0gcmVzcG9uc2VbJ2lkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHRoaXMucGFyc2VPcmRlciAoe1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLnltZGhtcyAodGhpcy5taWxsaXNlY29uZHMgKCkpLFxuICAgICAgICAgICAgJ2Ftb3VudF9vcmlnaW5hbCc6IGFtb3VudCxcbiAgICAgICAgICAgICdhbW91bnRfb3V0c3RhbmRpbmcnOiBhbW91bnQsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgIH0sIG1hcmtldCk7XG4gICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IG9yZGVyO1xuICAgICAgICByZXR1cm4gb3JkZXI7XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmt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y5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAoc2VjcmV0KSk7XG4gICAgICAgICAgICBxdWVyeSArPSAnJicgKyAnc2lnbmF0dXJlPScgKyBzaWduYXR1cmU7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyBxdWVyeTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgYm9keSA9IHF1ZXJ5O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIC8vIGNoZWNrcyBhZ2FpbnN0IGVycm9yIGNvZGVzXG4gICAgICAgIGlmICh0eXBlb2YgYm9keSAhPT0gJ3N0cmluZycpXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIGlmIChib2R5Lmxlbmd0aCA9PT0gMClcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgaWYgKGJvZHlbMF0gIT09ICd7JylcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgIC8vIHByaXZhdGUgZW5kcG9pbnRzIHJldHVybiB0aGUgZm9sbG93aW5nIHN0cnVjdHVyZTpcbiAgICAgICAgLy8ge1wicmV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cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnY29pbmV4JyxcbiAgICAgICAgICAgICduYW1lJzogJ0NvaW5FeCcsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0NOJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbWluJyxcbiAgICAgICAgICAgICAgICAnM20nOiAnM21pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtaW4nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaG91cicsXG4gICAgICAgICAgICAgICAgJzJoJzogJzJob3VyJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnNGhvdXInLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aG91cicsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnM2QnOiAnM2RheScsXG4gICAgICAgICAgICAgICAgJzF3JzogJzF3ZWVrJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM4MDQ2MzEyLTBiNDUwYWFjLTMyYzgtMTFlOC05OWFiLWJjNmIxMzZiNmNjNy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkuY29pbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmNvaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd3d3LmNvaW5leC5jb20nLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5jb2luZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2l0aHViLmNvbS9jb2luZXhjb20vY29pbmV4X2V4Y2hhbmdlX2FwaS93aWtpJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5jb2luZXguY29tL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXMvbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2xpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC90aWNrZXIvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9kZWFscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2tsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9wZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9maW5pc2hlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvZmluaXNoZWQve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvdXNlci9kZWFscycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2xpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9tYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy53ZWJHZXRSZXNNYXJrZXQgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ2RhdGEnXVsnbWFya2V0X2luZm8nXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQga2V5ID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2tleV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ21hcmtldCddO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBtYXJrZXRbJ2J1eV9hc3NldF90eXBlJ107XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydzZWxsX2Fzc2V0X3R5cGUnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0WydzZWxsX2Fzc2V0X3R5cGVfcGxhY2VzJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydidXlfYXNzZXRfdHlwZV9wbGFjZXMnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbnVtTWVyZ2VMZXZlbHMgPSBtYXJrZXRbJ21lcmdlJ10ubGVuZ3RoO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndGFrZXInOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAndGFrZXJfZmVlX3JhdGUnKSxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWFrZXJfZmVlX3JhdGUnKSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ2xlYXN0X2Ftb3VudCcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWVyZ2UnXVtudW1NZXJnZUxldmVscyAtIDFdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ2RhdGUnXTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHRpY2tlciA9IHRpY2tlclsndGlja2VyJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyks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uZXknKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2Ftb3VudCcpO1xuICAgICAgICBsZXQgZmlsbGVkID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZGVhbF9hbW91bnQnKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCAtIGZpbGxlZCk7XG4gICAgICAgIGxldCBzdGF0dXMgPSBvcmRlclsnc3RhdHVzJ107XG4gICAgICAgIGlmIChzdGF0dXMgPT09ICdkb25lJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBub3RfZGVhbFxuICAgICAgICAgICAgLy8gcGFydF9kZWFsXG4gICAgICAgICAgICBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdpZCcpLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ29yZGVyX3R5cGUnXSxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB7XG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgICAgICdjb3N0JzogdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZGVhbF9mZWUnKSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3RPcmRlcicgKyB0aGlzLmNhcGl0YWxpemUgKHR5cGUpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGFtb3VudCA9IHBhcnNlRmxvYXQgKGFtb3VudCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAndHlwZSc6IHNpZGUsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09PSAnbGltaXQnKSB7XG4gICAgICAgICAgICBwcmljZSA9IHBhcnNlRmxvYXQgKHByaWNlKTtcbiAgICAgICAg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lzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAndG9uY2UnOiBub25jZS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgIH0sIHF1ZXJ5KTtcbiAgICAgICAgICAgIHF1ZXJ5ID0gdGhpcy5rZXlzb3J0IChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgdXJsZW5jb2RlZCA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5oYXNoICh0aGlzLmVuY29kZSAodXJsZW5jb2RlZCArICcmc2VjcmV0X2tleT0nICsgdGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0F1dGhvcml6YXRpb24nOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoKG1ldGhvZCA9PT0gJ0dFVCcpIHx8IChtZXRob2QgPT09ICdERUxFVEUnKSkge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB1cmxlbmNvZGVkO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb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AgICAgICAnZmV0Y2hPSExDVic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzQ4NDIzMDMtMjljOTlmY2EtZjcxYy0xMWU3LTgzYzEtMDlkOTAwY2IyMzM0LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5jb2luZXhjaGFuZ2UuaW8vYXBpL3YxJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmNvaW5leGNoYW5nZS5pbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2NvaW5leGNoYW5nZWlvLmdpdGh1Yi5pby9zbGF0ZS8nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vd3d3LmNvaW5leGNoYW5nZS5pby9mZWVzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y3VycmVuY3knLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGN1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG1hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG1hcmtldHN1bW1hcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0bWFya2V0c3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0b3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMTUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnMTMzNyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnNDIwRyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnNjExJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FDQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUNFUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUNPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBQ1AnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEQ04nOiA1MDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRFNUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEWic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBR1JJJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBS1knOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FMSVMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUxMJzogMC4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTU1PJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTVMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FOVFgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FOWSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUkcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJHVVMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSR1VTT0xEJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBU04nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUT00nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0IyQic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCMyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFLRUQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCREwnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFRVInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFTEEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFTkpJJzogMC4wNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCRVQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JGSSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCSUdVUCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCSVJEUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQklUQic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCSVhDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCSVonOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JMQVMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkxBWlInOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkxLJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTE4nOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkxVRSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCT0FUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JPTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk9OUEFZJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JPUFMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JQT0snOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlEnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlJBVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlJDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JSSVQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JTTic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCU1InOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQmMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQ1JFRCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVENSRic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlREWCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEUnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRQTCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVMTFMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JVWlonOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JYVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQzQ3JzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NBQ0gnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0FMQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0FOTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0JBTksnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NIRUFQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDSEVTUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0hJTEknOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NISVBTJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NKJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NMVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTVBDTyc6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTVgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NOTkMnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NOVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ08yJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPT0MnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPVVBFJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDUVNUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NSQUNLRVJTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDUkROQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1JFQSc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1JFQUsnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NSRVZBMic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1JNU04nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NSTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1JXJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVElDMic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1VCRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1hUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDWUNMT05FJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDWURFUic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFHJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQUxDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBUkknOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBVic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREJJQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ04nOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdERlMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHQic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0MnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRElNRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE1CJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETUMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE5DVjInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RORSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRUonOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSR04nOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJTJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RTRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFNSJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEVENUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RVVENIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQkMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUNDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VDTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURSQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUVDTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUdDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMQ08nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxJWCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTFMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNSVJHJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTlRSQyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTlpPJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VRTCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFUVQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJTTyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VSWSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVNQJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQlMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VURyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSEQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSE9TJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUTic6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVJPUCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWENMJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VYVE4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZBSVInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZBUCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGQVpaJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGQ0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZHWic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGTEFTSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRkxJSyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGUlQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlNYJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlhFJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dBSU4nOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0InOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0JYJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHREMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VFUlQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dFVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0ZDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dMUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0xUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTFRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTUInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dNWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR09LVU9MRCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHT0xEJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHT0xGJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dPT0QnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1AnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dSRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1JFRU5GJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHUk1EJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dSUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1JYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1dDJzogMC4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hBTExPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIQkMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIRUFMVEhZJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdISUdIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdITUMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hOQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSE9DJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIT0RMJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIT0xMWSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIT05FWSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSE9QRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFBDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIVUInOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFlQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIWVBFUic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUJDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDRSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ09UJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lGVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lNWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5ESUEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lORk8nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lOU04nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lOWFQnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU9FJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJUVQnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVhDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdKQVBBTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSkVESSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSkVUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0pJTic6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdLQVlJJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLQjMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tHQic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0xDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tNRCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS09CTyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLT0knOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tPUlVOQSc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLUkEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tVQk8nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tVUlQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBTUJPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQ1QnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTERDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMRVZPJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xJRkUnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElOREEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xJTlgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xJWic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTE1DJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xOSyc6IDAuMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFJDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRHJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xVQ0snOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xVTkEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xWUFMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BQyc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQUcnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BTEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BUlMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BUlMyJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQVhJJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQVknOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01CQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUJJVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNCJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01FQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNRU5UQUwnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUVSJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01FVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUdNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNR1QnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01JTE8nOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlORVgnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlOVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNSVBTJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01OWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU9JTic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNT09OJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01TQ04nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01TUCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNU1QnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRIJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01VRSc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVVgnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVhDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNWFQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVlCJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05CSVQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkJYJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU9HJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FT04nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05MQzInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05MRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOUk4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05STyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlRDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05UTyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVUEnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlVNVVMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09DJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPR04nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09STyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFSSVMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BBWVUnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUENOJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BDUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUERHJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQRUMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BHTCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQSE4nOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUElDTyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQSUUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJR0dZJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJVlgnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUElYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BLVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTEFDTyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPTCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9MT0InOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9TJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPU1QnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9TVyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9UJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUklNVSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJMJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSTic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUlgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BUUyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQVVJBJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BVUkUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BVVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQV0MnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BXUic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVUFOVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkFJTic6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSQkwnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JEQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRUdBJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFWCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSSE8nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUklZQSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSTUMnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUk5TJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdST0MnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUk9PRlMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JVQic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlVORSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlVOTkVSUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlVQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQklUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQ0wnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0NPUkUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NDT1JFT0xEJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTREFTSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0ZDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTRkUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NHUic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSElUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NITSc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSE5EJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NIT1QnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0lDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NJTEsyJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSU1QJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0lTQSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS09JTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0tVTEwnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NMRVZJTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0xSJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTUFSVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01TJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05PVyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU09MQVInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NQUlRTJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NSQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1NUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUQVJTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVE4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUTyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVUEVSJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVVBFUk1BTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VSR0UnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NXQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTWU5RJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTWU5YJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUQUFTJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RCUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVENPSU4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RFTEwnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEVSJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEdUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RJR0VSJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSVBTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTEUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RPUEFaJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUT1InOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RQQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFBHJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUEknOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJBTkNFJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUkMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSVVgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RTRSc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUU1RSJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUVVJCTyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUZPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVSyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUxBJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVTklGWSc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVTklUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VOTyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVUUMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNBJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkdTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSURaJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSVNJTyc6IDAuMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkxUQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT0lTRSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT05FJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT1gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZTWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVlVMQ0FOTyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0FTSCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXQ0wnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOSyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV09NRU4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dPUk0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dPVyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXUlAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dZVic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEJDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQkwnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEJVJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hDSEUnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWENTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQ1QnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hDWFQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hERTInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hFVic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYR09YJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYR1RDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTFInOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1DQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFAnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFBBU0MnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hRTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFNBJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hTVEMnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFREJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYVlMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hYWCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYWU9DJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hZWic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFpDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1haQ0QnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lIQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkNDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaQ0cnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkNMJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVJVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRU5JJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRVJPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaTUMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWk9JJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaU0UnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pVUk1PJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1paQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ0JPTic6ICdCb25QZUthTycsXG4gICAgICAgICAgICAgICAgJ0VUTic6ICdFdGhlcm5leCcsXG4gICAgICAgICAgICAgICAgJ0dEQyc6ICdHb2xkZW5DcnlwdG9Db2luJyxcbiAgICAgICAgICAgICAgICAnR1RDJzogJ0dsb2JhbFRvdXJDb2luJyxcbiAgICAgICAgICAgICAgICAnSE5DJzogJ0h1bmNvaW4nLFxuICAgICAgICAgICAgICAgICdNQVJTJzogJ01hcnNCdXgnLFxuICAgICAgICAgICAgICAgICdNRVInOiAnVGhlTWVybWFpZENvaW4nLFxuICAgICAgICAgICAgICAgICdSVUInOiAnUnViYmxlQ29pbicsXG4gICAgICAgICAgICAgICAgJ1VQJzogJ1Vwc2NhbGVUb2tlbicsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0R2V0Y3VycmVuY2llcyAocGFyYW1zKTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCBwcmVjaXNpb24gPSB0aGlzLnByZWNpc2lvblsnYW1vdW50J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY3lbJ0N1cnJlbmN5SUQnXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5WydUaWNrZXJDb2RlJ10pO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IGN1cnJlbmN5WydXYWxsZXRTdGF0dXMnXSA9PT0gJ29ubGluZSc7XG4gICAgICAgICAgICBsZXQgc3RhdHVzID0gJ29rJztcbiAgICAgICAgICAgIGlmICghYWN0aXZlKVxuICAgICAgICAgICAgICAgIHN0YXR1cyA9ICdkaXNhYmxlZCc7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ05hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0R2V0bWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnTWFya2V0SUQnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKG1hcmtldFsnTWFya2V0QXNzZXRDb2RlJ10pO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKG1hcmtldFsnQmFzZUN1cnJlbmN5Q29kZSddKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBtYXJrZXRbJ01hcmtldEFzc2V0SUQnXSxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IG1hcmtldFsnQmFzZUN1cnJlbmN5SUQnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogbWFya2V0WydBY3RpdmUnXSxcbiAgICAgICAgICAgICAgICAnbG90JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IHRpY2tlclsnTWFya2V0SUQnXTtcbiAgICAgICAgICAgIGlmIChtYXJrZXRJZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW21hcmtldElkXTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRJZDtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdMYXN0UHJpY2UnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnSGlnaFByaWNlJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0xvd1ByaWNlJyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0JpZFByaWNlJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdBc2tQcmljZScpLFxuICAgICAgICAgICAgJ2Fza1ZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAg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ICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmNvaW5mbG9vci5jby51aycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9jb2luZmxvb3IvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmNvaW5mbG9vci5jby51ay9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdwYXNzd29yZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vdGlja2VyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9vcmRlcl9ib29rLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS90cmFuc2FjdGlvbnMvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2JhbGFuY2UvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3VzZXJfdHJhbnNhY3Rpb25zLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9vcGVuX29yZGVycy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vY2FuY2VsX29yZGVyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9idXkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3NlbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2J1eV9tYXJrZXQvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3NlbGxfbWFya2V0LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9lc3RpbWF0ZV9zZWxsX21hcmtldC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vZXN0aW1hdGVfYnV5X21hcmtldC8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9HQlAnOiB7ICdpZCc6ICdYQlQvR0JQJywgJ3N5bWJvbCc6ICdCVEMvR0JQJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0dCUCcgfSxcbiAgICAgICAgICAgICAgICAnQlRDL0VVUic6IHsgJ2lkJzogJ1hCVC9FVVInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvVVNEJzogeyAnaWQnOiAnWEJUL1VTRCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9QTE4nOiB7ICdpZCc6ICdYQlQvUExOJywgJ3N5bWJvbCc6ICdCVEMvUExOJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1BMTicgfSxcbiAgICAgICAgICAgICAgICAnQkNIL0dCUCc6IHsgJ2lkJzogJ0JDSC9HQlAnLCAnc3ltYm9sJzogJ0JDSC9HQlAnLCAnYmFzZS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FxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldElkVGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsnZGF0ZSddICogMTAwMDtcbiAgICAgICAgc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gICAgICBsZXQgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICBsZXQgc2lkZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHN0YXR1cyA9IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdzdGF0dXMnKTtcbiAgICAgICAgaWYgKG9yZGVyWyd0eXBlJ10gPT09IDApXG4gICAgICAgICAgICBzaWRlID0gJ2J1eSc7XG4gICAgICAgIGVsc2UgaWYgKG9yZGVyWyd0eXBlJ10gPT09IDEpXG4gICAgICAgICAgICBzaWRlID0gJ3NlbGwnO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgaWQgPSBvcmRlclsnaWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGRhdGV0aW1lLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogdW5kZWZpbmVkLFxuICAgICAgIC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ICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODYxOTcwNy01YzkyMzJhOC03MjEyLTExZTctODZkNi05OGZlNWQxNWNjNmUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vY29pbmdpLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW50JzogJ2h0dHBzOi8vYXBpLmNvaW5naS5jb20nLFxuICAgICAgICAgICAgICAgICAgICAndXNlcic6ICdodHRwczovL2FwaS5jb2luZ2kuY29tJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2luZ2kuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHA6Ly9kb2NzLmNvaW5naS5hcGlhcnkuaW8vJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3d3cnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdjdXJyZW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyLWJvb2sve3BhaXJ9L3thc2tDb3VudH0ve2JpZENvdW50fS97ZGVwdGh9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMve3BhaXJ9L3ttYXhDb3VudH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJzI0aG91ci1yb2xsaW5nLWFnZ3JlZ2F0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd1c2VyJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhZGQtb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbC1vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZS1jcnlwdG8td2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdWVEMnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTk1DJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogMTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTk1DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHRoaXMucGFyc2VKc29uUmVzcG9uc2UgPSBmYWxzZTtcbiAgICAgICAgICAgIHJlc3BvbnNlID0gYXd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ogOCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogaWQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgIC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bc3ltYm9sXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLmZldGNoVGlja2VycyAodW5kZWZpbmVkLCBwYXJhbXMpO1xuICAgICAgICBpZiAoc3ltYm9sIGluIHRpY2tlcnMpXG4gICAgICAgICAgICByZXR1cm4gdGlja2Vyc1tzeW1ib2xdO1xuICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcmV0dXJuIGRpZCBub3QgY29udGFpbiAnICsgc3ltYm9sKTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGlmICghbWFya2V0KVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydjdXJyZW5jeVBhaXInXV07XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdHJhZGVbJ3RpbWVzdGFtcCddLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0cmFkZVsndGltZXN0YW1wJ10pLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIC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AgICAgJ2NvdW50cmllcyc6ICdVUycsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZUFQSSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVMaW1pdE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2VkaXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaEJhbGFuY2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlckJvb2snOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRyYWRlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjgyNDQyNDQtOWJlNjMxMmEtNjllZC0xMWU3LTk5YzEtN2MxNzk3Mjc1MjY1LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2FwaS5jb2lubWFya2V0Y2FwLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICdmaWxlcyc6ICdodHRwczovL2ZpbGVzLmNvaW5tYXJrZXRjYXAuY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ2NoYXJ0cyc6ICdodHRwczovL2dyYXBoLmNvaW5tYXJrZXRjYXAuY29tJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2lubWFya2V0Y2FwLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2NvaW5tYXJrZXRjYXAuY29tL2FwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdmaWxlcyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZW5lcmF0ZWQvc3RhdHMvZ2xvYmFsLmpzb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2dyYXBocyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jaWVzL3tuYW1lfS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2lkfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dsb2JhbC8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2N1cnJlbmN5Q29kZXMnOiBbXG4gICAgICAgICAgICAgICAgJ0FVRCcsXG4gICAgICAgICAgICAgICAgJ0JSTCcsXG4gICAgICAgICAgICAgICAgJ0NBRCcsXG4gICAgICAgICAgICAgICAgJ0NIRicsXG4gICAgICAgICAgICAgICAgJ0NOWScsXG4gICAgICAgICAgICAgICAgJ0VVUicsXG4gICAgICAgICAgICAgICAgJ0dCUCcsXG4gICAgICAgICAgICAgICAgJ0hLRCcsXG4gICAgICAgICAgICAgICAgJ0lEUicsXG4gICAgICAgICAgICAgICAgJ0lOUicsXG4gICAgICAgICAgICAgICAgJ0pQWScsXG4gICAgICAgICAgICAgICAgJ0tSVycsXG4gICAgICAgICAgICAgICAgJ01YTicsXG4gICAgICAgICAgICAgICAgJ1JVQicsXG4gICAgICAgICAgICAgICAgJ1VTRCcsXG4gICAgICAgICAgICBdLFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKCdGZXRjaGluZyBvcmRlciBib29rcyBpcyBub3Qgc3VwcG9ydGVkIGJ5IHRoZSBBUEkgb2YgJyArIHRoaXMuaWQpO1xuICAgIH1cblxuICAgIGN1cnJlbmN5Q29kZSAoYmFzZSwgbmFtZSkge1xuICAgICAgICBjb25zdCBjdXJyZW5jaWVzID0ge1xuICAgICAgICAgICAgJ0FDQ2hhaW4nOiAnQUNDaGFpbicsXG4gICAgICAgICAgICAnQWRDb2luJzogJ0FkQ29pbicsXG4gICAgICAgICAgICAnQmF0Q29pbic6ICdCYXRDb2luJyxcbiAgICAgICAgICAgICdCaXRnZW0nOiAnQml0Z2VtJyxcbiAgICAgICAgICAgICdCbGF6ZUNvaW4nOiAnQmxhemVDb2luJyxcbiAgICAgICAgICAgICdCbG9ja0NBVCc6ICdCbG9ja0NBVCcsXG4gICAgICAgICAgICAnQ2F0Y29pbic6ICdDYXRjb2luJyxcbiAgICAgICAgICAgICdIaSBNdXR1YWwgU29jaWV0eSc6ICdIaSBNdXR1YWwgU29jaWV0eScsXG4gICAgICAgICAgICAnaUNvaW4nOiAnaUNvaW4nLFxuICAgICAgICAgICAgJ01hZ2dpZSc6ICdNYWdnaWUnLFxuICAgICAgICAgICAgJ01JT1RBJzogJ0lPVEEnLCAvLyBhIHNwZWNpYWwgY2FzZSwgbW9zdCBleGNoYW5nZXMgbGlzdCBpdCBhcyBJT1RBLCB0aGVyZWZvcmUgd2UgY2hhbmdlIGp1c3QgdGhlIENvaW5tYXJrZXRjYXAgaW5zdGVhZCBvZiBjaGFuZ2luZyB0aGVtIGFsbFxuICAgICAgICAgICAgJ05ldENvaW4nOiAnTmV0Q29pbicsXG4gICAgICAgICAgICAnUG9sY29pbic6ICdQb2xjb2luJyxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKG5hbWUgaW4gY3VycmVuY2llcylcbiAgICAgICAgICAgIHJldHVybiBjdXJyZW5jaWVzW25hbWVdO1xuICAgICAgICByZXR1cm4gYmFzZTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh7XG4gICAgICAgICAgICAnbGltaXQnOiAwLFxuICAgICAgICB9KTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSB0aGlzLmN1cnJlbmN5Q29kZXM7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZUlkID0gcXVvdGUudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY3VycmVuY3lDb2RlIChtYXJrZXRbJ3N5bWJvbCddLCBtYXJrZXRbJ25hbWUnXSk7XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBiYXNlSWQgKyAnLycgKyBxdW90ZUlkO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hHbG9iYWwgKGN1cnJlbmN5ID0gJ1VTRCcpIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7fTtcbiAgICAgICAgaWYgKGN1cnJlbmN5KVxuIC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0ICh0aWNrZXIsIHByaWNlS2V5KTtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgdm9sdW1lS2V5ID0gJzI0aF92b2x1bWVfJyArIG1hcmtldFsncXVvdGVJZCddO1xuICAgICAgICAgICAgaWYgKHZvbHVtZUtleSBpbiB0aWNrZXIpXG4gICAgICAgICAgICAgICAgaWYgKHRpY2tlclt2b2x1bWVLZXldKVxuICAgICAgICAgICAgICAgICAgICB2b2x1bWUgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCB2b2x1bWVLZXkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xvdyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IGNoYW5nZSxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoY3VycmVuY3kgPSAnVVNEJywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnbGltaXQnOiAxMDAwMCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKGN1cnJlbmN5KVxuICAgICAgICAgICAgcmVxdWVzdFsnY29udmVydCddID0gY3VycmVuY3k7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXJzID0ge307XG4gICAgICAgIGZvciAobGV0IHQgPSAwOyB0IDwgcmVzcG9uc2UubGVuZ3RoOyB0KyspIHtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVt0XTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeUlkID0gKGN1cnJlbmN5IGluIHRoaXMuY3VycmVuY2llcykgPyB0aGlzLmN1cnJlbmNpZXNbY3VycmVuY3ldWydpZCddIDogY3VycmVuY3kudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgaWQgPSB0aWNrZXJbJ2lkJ10gKyAnLycgKyBjdXJyZW5jeUlkO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aWNrZXJzW3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRpY2tlcnM7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY29udmVydCc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnYmFzZUlkJ10sXG4gICAgICAgIH0sIHBhcmFtcyk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VySWQgKHJlcXVlc3QpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbMF07XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hDdXJyZW5jaWVzIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2xpbWl0JzogMCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICA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7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLyc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6Ly9kb2NzLmNvaW5tYXRlLmFwaWFyeS5pbycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2NvaW5tYXRlLmlvL2RldmVsb3BlcnMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyQm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luV2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbkRlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eUluc3RhbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eUxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXJXaXRoSW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlVm91Y2hlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVkZWVtVm91Y2hlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbEluc3RhbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxMaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25IaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1bmNvbmZpcm1lZEJpdGNvaW5EZXBvc2l0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0VVUic6IHsgJ2lkJzogJ0JUQ19FVVInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJywgJ3ByZWNpc2lvbic6IHsgJ2Ftb3VudCc6IDQsICdwcmljZSc6IDIgfX0sXG4gICAgICAgICAgICAgICAgJ0JUQy9DWksnOiB7ICdpZCc6ICdCVENfQ1pLJywgJ3N5bWJvbCc6ICdCVEMvQ1pLJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0NaSycsICdwcmVjaXNpb24nOiB7ICdhbW91bnQnOiA0LCAncHJpY2UnOiAyIH19LFxuICAgICAgICAgICAgICAgICdMVEMvQlRDJzogeyAnaWQnOiAnTFRDX0JUQycsICdzeW1ib2wnOiAnTFRDL0JUQycsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdCVEMnLCAncHJlY2lzaW9uJzogeyAnYW1vdW50JzogNCwgJ3ByaWNlJzogNSB9fSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMzUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VzKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYmFsYW5jZXNbY3VycmVuY3ldWydhdmFpbGFibGUnXTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBiYWxhbmNlc1tjdXJyZW5jeV1bJ3Jlc2VydmVkJ107XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IGJhbGFuY2VzW2N1cnJlbmN5XVsnYmFsYW5jZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQp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A9IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAoIW1hcmtldClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFt0cmFkZVsnY3VycmVuY3lQYWlyJ11dO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RyYW5zYWN0aW9uSWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdHJhZGVbJ3RpbWVzdGFtcCddLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0cmFkZVsndGltZXN0YW1wJ10pLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYW5zYWN0aW9ucyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeVBhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnbWludXRlc0ludG9IaXN0b3J5JzogMTAsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2VbJ2RhdGEnXSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3QnICsgdGhpcy5jYXBpdGFsaXplIChzaWRlKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2N1cnJlbmN5UGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09PSAnbWFya2V0Jykge1xuICAgICAgICAgICAgaWYgKHNpZGUgPT09ICdidXknKVxuICAgICAgICAgICAgICAgIG9yZGVyWyd0b3RhbCddID0gYW1vdW50OyAvLyBhbW91bnQgaW4gZmlhdFxuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudDsgLy8gYW1vdW50IGluIGZpYXRcbiAgICAgICAgICAgIG1ldGhvZCArPSAnSW5zdGFudCc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvcmRlclsnYW1vdW50J10gPSBhbW91bnQ7IC8vIGFtb3VudCBpbiBjcnlwdG9cbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gcHJpY2U7XG4gICAgICAgICAgICBtZXRob2QgKz0gdGhpcy5jYXBpdGFsaXplICh0eXBlKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ2RhdGEnXS50b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ovL2FwaS5jb2lubmVzdC5jby5rci9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd3d3LmNvaW5uZXN0LmNvLmtyJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuY29pbm5lc3QuY28ua3InLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuY29pbm5lc3QuY28ua3IvZG9jL2ludHJvLmh0bWwnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9jb2lubmVzdGhlbHAuemVuZGVzay5jb20vaGMva28vYXJ0aWNsZXMvMTE1MDAyMTEwMjUyLSVFQSVCMSVCMCVFQiU5RSU5OC0lRUMlODglOTglRUMlODglOTglRUIlQTMlOEMlRUIlOEElOTQtJUVDJTk2JUJDJUVCJUE3JTg4JUVDJTlEJUI4JUVBJUIwJTgwJUVDJTlBJTk0LScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2NvaW5uZXN0aGVscC56ZW5kZXNrLmNvbS9oYy9rby9hcnRpY2xlcy8xMTUwMDIxMTAyNzItJUVCJUI5JTg0JUVEJThBJUI4JUVDJUJEJTk0JUVDJTlEJUI4LSVFQyU4OCU5OCVFQyU4OCU5OCVFQiVBMyU4QyVFQiVBNSVCQy0lRUMlODQlQTAlRUQlODMlOUQlRUQlOTUlOTglRUIlOEElOTQtJUVDJTlEJUI0JUVDJTlDJUEwJUVBJUIwJTgwLSVFQiVBQyVCNCVFQyU5NyU4NyVFQyU5RCVCOCVFQSVCMCU4MCVFQyU5QSU5NC0nLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnd2ViJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvaW4vYWxsY29pbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3B1Yi90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3B1Yi9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHViL3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9hZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvZmV0Y2h0cnVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvdHJ1c3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAnMC4wMDInLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHF1b3RlID0gJ0tSVyc7XG4gICAgICAgIGxldCBxdW90ZUlkID0gcXVvdGUudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgIC8vIHRvZG86IHJld3JpdGUgdGhpcyBmb3Igd2ViIGVuZHBvaW50XG4gICAgICAgIGxldCBjb2lucyA9IFtcbiAgICAgICAgICAgICdidGMnLFxuICAgICAgICAgICAgJ2JjaCcsXG4gICAgICAgICAgICAnYnRnJyxcbiAgICAgICAgICAgICdiY2QnLFxuICAgICAgICAgICAgJ3VidGMnLFxuICAgICAgICAgICAgJ2J0bicsXG4gICAgICAgICAgICAna3N0JyxcbiAgICAgICAgICAgICdsdGMnLFxuICAgICAgICAgICAgJ2FjdCcsXG4gICAgICAgICAgICAnZXRoJyxcbiAgICAgICAgICAgICdldGMnLFxuICAgICAgICAgICAgJ2FkYScsXG4gICAgICAgICAgICAncXR1bScsXG4gICAgICAgICAgICAneGxtJyxcbiAgICAgICAgICAgICduZW8nLFxuICAgICAgICAgICAgJ2dhcycsXG4gICAgICAgICAgICAncnB4JyxcbiAgICAgICAgICAgICdoc3InLFxuICAgICAgICAgICAgJ2tuYycsXG4gICAgICAgICAgICAndHNsJyxcbiAgICAgICAgICAgICd0cm9uJyxcbiAgICAgICAgICAgICdvbWcnLFxuICAgICAgICAgICAgJ3d0YycsXG4gICAgICAgICAgICAnbWNvJyxcbiAgICAgICAgICAgICdzdG9ybScsXG4gICAgICAgICAgICAnZ3RvJyxcbiAgICAgICAgICAgICdweHMnLFxuICAgICAgICAgICAgJ2NoYXQnLFxuICAgICAgICAgICAgJ2luaycsXG4gICAgICAgICAgICAnb2MnLFxuICAgICAgICAgICAgJ2hsYycsXG4gICAgICAgICAgICAnZW50JyxcbiAgICAgICAgICAgICdxYnQnLFxuICAgICAgICAgICAgJ3NwYycsXG4gICAgICAgICAgICAncHV0JyxcbiAgICAgICAgXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNvaW5zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gY29pbnNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBiYXNlSWQgKyAnLycgKyBxdW90ZUlkO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkLnRvVXBwZXJDYXNlICgpKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndGltZSddIC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kgKiAxMDAwO1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdwcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnYW1vdW50Jyk7XG4gICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQgKiBwcmljZSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0aWQnKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAoY29zdCksXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcm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zogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zODAwMzMwMC1hZGMxMmZiYS0zMjNmLTExZTgtODUyNS03MjVmNTNjNGE2NTkuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmNvaW5vbmUuY28ua3InLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2lub25lLmNvLmtyJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZG9jLmNvaW5vbmUuY28ua3InLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2svJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2J0Y19kZXBvc2l0X2FkZHJlc3MvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2JhbGFuY2UvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2RhaWx5X2JhbGFuY2UvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3VzZXJfaW5mby8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvdmlydHVhbF9hY2NvdW50LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsX2FsbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2xpbWl0X2J1eS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2xpbWl0X3NlbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jb21wbGV0ZV9vcmRlcnMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9saW1pdF9vcmRlcnMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcl9pbmZvLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb24vYXV0aF9udW1iZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbi9oaXN0b3J5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb24va3J3L2hpc3RvcnkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbi9idGMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbi9jb2luLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQkNIL0tSVyc6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ICdMVEMvS1JXJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ0tSVycsICdiYXNlSWQnOiAnbHRjJywgJ3F1b3RlSWQnOiAna3J3JyB9LFxuICAgICAgICAgICAgICAgICdPTUcvS1JXJzogeyAnaWQnOiAnb21nJywgJ3N5bWJvbCc6ICdPTUcvS1JXJywgJ2Jhc2UnOiAnT01HJywgJ3F1b3RlJzogJ0tSVycsICdiYXNlSWQnOiAnb21nJywgJ3F1b3RlSWQnOiAna3J3JyB9LFxuICAgICAgICAgICAgICAgICdRVFVNL0tSVyc6IHsgJ2lkJzogJ3F0dW0nLCAnc3ltYm9sJzogJ1FUVU0vS1JXJywgJ2Jhc2UnOiAnUVRVTScsICdxdW90ZSc6ICdLUlcnLCAnYmFzZUlkJzogJ3F0dW0nLCAncXVvdGVJZCc6ICdrcncnIH0sXG4gICAgICAgICAgICAgICAgJ1hSUC9LUlcnOiB7ICdpZCc6ICd4cnAnLCAnc3ltYm9sJzogJ1hSUC9LUlcnLCAnYmFzZSc6ICdYUlAnLCAncXVvdGUnOiAnS1JXJywgJ2Jhc2VJZCc6ICd4cnAnLCAncXVvdGVJZCc6ICdrcncnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjAwMV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAwMCwgMC4wMDA5XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAwMCwgMC4wMDA4XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwMDAwMCwgMC4wMDA3XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAwMDAsIDAuMDAwNl0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAwMDAwLCAwLjAwMDVdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFszMDAwMDAwMDAwMCwgMC4wMDA0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDAwMDAwMDAwMDAsIDAuMDAwM10sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMDAwMDAwLCAwLjAwMDJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYWtlcic6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMCwgMC4wMDFdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwMDAsIDAuMDAwOF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAwMDAsIDAuMDAwNl0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMDAwMDAsIDAuMDAwNF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAwMDAwLCAwLjAwMDJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzMwMDAwMDAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDAwMDAwMDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzQwNSc6IEV4Y2hhbmdlTm90QXZhaWxhYmxlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QWNjb3VudEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChyZXNwb25zZSk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IHJlc3BvbnNlW2lkXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gaWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5jdXJyZW5jaWVzX2J5X2lkKVxuICAgICAgICAgICAgICAgIGNvZGUgPSB0aGlzLmN1cnJlbmNpZXNfYnlfaWRbaWRdWydjb2RlJ107XG4gICAgICAgICAgICBsZXQgZnJlZSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2F2YWlsJ10pO1xuICAgICAgICAgICAgbGV0IHRvdGFsID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnYmFsYW5jZSddKTtcbiAgICAgICAgICAgIGxldCB1c2VkID0gdG90YWwgLSBmcmVlO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBmcmVlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdXNlZCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiB0b3RhbCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE9yZGVyYm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdmb3JtYXQnOiAnanNvbicsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAocmVzcG9uc2UsIHVuZGVmaW5lZCwgJ2JpZCcsICdhc2snLCAncHJpY2UnLCAncXR5Jyk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6ICdhbGwnLFxuICAgICAgICAgICAgJ2Zvcm1hdCc6ICdqc29uJyxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgbG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6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnZmlyc3QnKSxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHByZXZpb3VzQ2xvc2UsXG4gICAgICAgICAgICAnY2hhbmdlJzogY2hhbmdlLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbHVtZScpLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWyd0aW1lc3RhbXAnXSkgKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKSA/IG1hcmtldFsnc3ltYm9sJ10gOiB1bmRlZmluZWQ7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bW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gPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSByZXF1ZXN0O1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLnZlcnNpb24gKyAnLycgKyByZXF1ZXN0O1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBqc29uID0gdGhpcy5qc29uICh7XG4gICAgICAgICAgICAgICAgJ2FjY2Vzc190b2tlbic6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IHRoaXMuc3RyaW5nVG9CYXNlNjQgKHRoaXMuZW5jb2RlIChqc29uKSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5kZWNvZGUgKHBheWxvYWQpO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuc2VjcmV0LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAocGF5bG9hZCwgdGhpcy5lbmNvZGUgKHNlY3JldCksICdzaGE1MTInKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgICAgICAnWC1DT0lOT05FLVBBWUxPQUQnOiBwYXlsb2FkLFxuICAgICAgICAgICAgICAgICdYLUNPSU5PTkUtU0lHTkFUVVJFJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoKGJvZHlbMF0gPT09ICd7JykgfHwgKGJvZHlbMF0gPT09ICdbJykpIHtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgaWYgKCdyZXN1bHQnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgICAgICAgICBpZiAocmVzdWx0ICE9PSAnc3VjY2VzcycpIHtcbiAgICAgICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICAgICAgLy8gICAgeyAgXCJlcnJvckNvZGVcIjogXCI0MDVcIiwgIFwic3RhdHVzXCI6IFwibWFpbnRlbmFuY2VcIiwgIFwicmVzdWx0XCI6IFwiZXJyb3JcIn1cbiAgICAgICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgIC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LS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgY29pbnNlY3VyZSBleHRlbmRzIEV4Y2hhbmdlIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnY29pbnNlY3VyZScsXG4gICAgICAgICAgICAnbmFtZSc6ICdDb2luc2VjdXJlJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnSU4nLCAvLyBJbmRpYVxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NDcyLTljYmQyMDBhLTVlZDktMTFlNy05NTUxLTIyNjdhZDdiYWMwOC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuY29pbnNlY3VyZS5pbicsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2NvaW5zZWN1cmUuaW4nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS5jb2luc2VjdXJlLmluJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9jb2luc2VjdXJlL3BsdWdpbnMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luL3NlYXJjaC9jb25maXJtYXRpb24ve3R4aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9hc2svbG93JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9hc2svb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9iaWQvaGlnaCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYmlkL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvbGFzdFRyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9tYXgyNEhyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9taW4yNEhyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZmEvYXV0aHkvY2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWZhL2F1dGh5L3NtcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbmV0a2kvc2VhcmNoL3tuZXRraU5hbWV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2Jhbmsvb3RwL3tudW1iZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2t5Yy9vdHAve251bWJlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJvZmlsZS9waG9uZS9vdHAve251bWJlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vYWRkcmVzcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2RlcG9zaXQvY29uZmlybWVkL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9kZXBvc2l0L2NvbmZpcm1lZC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2RlcG9zaXQvdW5jb25maXJtZWQvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2RlcG9zaXQvdW5jb25maXJtZWQve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi93YWxsZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvYmFsYW5jZS9hdmFpbGFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2JhbGFuY2UvcGVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvYmFsYW5jZS90b3RhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvZGVwb3NpdC9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2RlcG9zaXQvdW52ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvZGVwb3NpdC92ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L3ZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Fzay9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYXNrL2NvbXBsZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9hc2svcGVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iaWQvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmlkL3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vYmFsYW5jZS9hdmFpbGFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2JhbGFuY2UvcGVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vYmFsYW5jZS90b3RhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vZGVwb3NpdC9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2RlcG9zaXQvdW52ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vZGVwb3NpdC92ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L3ZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Jhbmsvc3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9jb2luL2ZlZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9maWF0L2ZlZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9reWNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL3JlZmVycmFsL2NvaW4vcGFpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9yZWZlcnJhbC9jb2luL3N1Y2Nlc3NmdWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvcmVmZXJyYWwvZmlhdC9wYWlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL3JlZmVycmFscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS90cmFkZS9zdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2xvZ2luL3Rva2VuL3t0b2tlbn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvc3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvc3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2NvaW4vd2l0aGRyYXcvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvY29pbi93aXRoZHJhdy9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC9jb2luL3dpdGhkcmF3L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC9jb2luL3dpdGhkcmF3L3ZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9naW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvZ2luL2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2dpbi9wYXNzd29yZC9mb3Jnb3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21mYS9hdXRoeS9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWZhL2dhL2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzaWdudXAnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbmV0a2kvdXBkYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Byb2ZpbGUvaW1hZ2UvdXBkYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvbmV3VmVyaWZ5Y29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvaW5pdGlhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L25ld1ZlcmlmeWNvZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcGFzc3dvcmQvY2hhbmdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Bhc3N3b3JkL3Jlc2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL3dpdGhkcmF3L2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvY29pbi93aXRoZHJhdy9uZXdWZXJpZnljb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzaWdudXAvdmVyaWZ5L3t0b2tlbn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2Uva3ljJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9kZXBvc2l0L25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9hc2svbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvaW5zdGFudC9idXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvaW5zdGFudC9zZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy92ZXJpZnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2FjY291bnQvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy92ZXJpZnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWZhL2F1dGh5L2luaXRpYXRlL2VuYWJsZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9tZmEvZ2EvaW5pdGlhdGUvZW5hYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL25ldGtpL2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL3Bob25lL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9hZGRyZXNzL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vd2l0aGRyYXcvc2VuZFRvRXhjaGFuZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vd2l0aGRyYXcvdmVyaWZ5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2djbS97Y29kZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbG9nb3V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy91bnZlcmlmaWVkL2NhbmNlbC97d2l0aGRyYXdJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2RlcG9zaXQvY2FuY2VsL3tkZXBvc2l0SUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Fzay9jYW5jZWwve29yZGVySUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9jYW5jZWwve29yZGVySUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy91bnZlcmlmaWVkL2NhbmNlbC97d2l0aGRyYXdJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWZhL2F1dGh5L2Rpc2FibGUve2NvZGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21mYS9nYS9kaXNhYmxlL3tjb2RlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL3Bob25lL2RlbGV0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL2ltYWdlL2RlbGV0ZS97bmV0a2lOYW1lfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi93aXRoZHJhdy91bnZlcmlmaWVkL2NhbmNlbC97d2l0aGRyYXdJRH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9JTlInOiB7ICdpZCc6ICdCVEMvSU5SJywgJ3N5bWJvbCc6ICdCVEMvSU5SJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0lOUicgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC40IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjQgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0VXNlckV4Y2hhbmdlQmFua1N1bW1hcnkgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ21lc3NhZ2UnXTtcbiAgICAgICAgbGV0IGNvaW4gPSB7XG4gICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ2F2YWlsYWJsZUNvaW5CYWxhbmNlJ10sXG4gICAgICAgICAgICAndXNlZCc6IGJhbGFuY2VbJ3BlbmRpbmdDb2luQmFsYW5jZSddLFxuICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZVsndG90YWxDb2luQmFsYW5jZSddLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgZmlhdCA9IHtcbiAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZVsnYXZhaWxhYmxlRmlhdEJhbGFuY2UnXSxcbiAgICAgICAgICAgIC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ZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVB1dFVzZXJFeGNoYW5nZSc7XG4gICAgICAgIGxldCBvcmRlciA9IHt9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnSW5zdGFudCcgKyB0aGlzLmNhcGl0YWxpemUgKHNpZGUpO1xuICAgICAgICAgICAgaWYgKHNpZGUgPT09ICdidXknKVxuICAgICAgICAgICAgICAgIG9yZGVyWydtYXhGaWF0J10gPSBhbW91bnQ7XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgb3JkZXJbJ21heFZvbCddID0gYW1vdW50O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IGRpcmVjdGlvbiA9IChzaWRlID09PSAnYnV5JykgPyAnQmlkJyA6ICdBc2snO1xuICAgICAgICAgICAgbWV0aG9kICs9IGRpcmVjdGlvbiArICdOZXcnO1xuICAgICAgICAgICAgb3JkZXJbJ3JhdGUnXSA9IHByaWNlO1xuICAgICAgICAgICAgb3JkZXJbJ3ZvbCddID0gYW1vdW50O1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnbWVzc2FnZSddWydvcmRlcklEJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIC8vIGxldCBtZXRob2QgPSAncHJpdmF0ZURlbGV0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xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoY29kZSA9PT0gMjAwKSB7XG4gICAgICAgICAgICBpZiAoKGJvZHlbMF0gPT09ICd7JykgfHwgKGJvZHlbMF0gPT09ICdbJykpIHtcbiAgICAgICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBzdWNjZXNzID0gcmVzcG9uc2VbJ3N1Y2Nlc3MnXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzdWNjZXNzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZXJyb3IgcmV0dXJuZWQ6ICcgKyBib2R5KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoISgnbWVzc2FnZScgaW4gcmVzcG9uc2UpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgbWFsZm9ybWVkIHJlc3BvbnNlOiBubyBcIm1lc3NhZ2VcIiBpbiByZXNwb25zZTogJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIG1hbGZvcm1lZCByZXNwb25zZTogbm8gXCJzdWNj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xMDAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjgyMDg0MjktM2NhY2RmOWEtNjg5Ni0xMWU3LTg1NGUtNGM3OWE3NzJhMzBmLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3d3dy5jb2luc3BvdC5jb20uYXUvcHViYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cuY29pbnNwb3QuY29tLmF1L2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmNvaW5zcG90LmNvbS5hdScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5jb2luc3BvdC5jb20uYXUvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGF0ZXN0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9jb2luL2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L2NvaW4vc2VuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGUvYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZS9zZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9iYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9idXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L2J1eS9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L3NlbGwvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvQVVEJzogeyAnaWQnOiAnQlRDJywgJ3N5bWJvbCc6ICdCVEMvQVVEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0FVRCcgfSxcbiAgICAgICAgICAgICAgICAnTFRDL0FVRCc6IHsgJ2lkJzogJ0xUQycsICdzeW1ib2wnOiAnTFRDL0FVRCcsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdBVUQnIH0sXG4gICAgICAgICAgICAgICAgJ0RPR0UvQVVEJzogeyAnaWQnOiAnRE9HRScsICdzeW1ib2wnOiAnRE9HRS9BVUQnLCAnYmFzZSc6ICdET0dFJywgJ3F1b3RlJzogJ0FVRCcgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE15QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgaWYgKCdiYWxhbmNlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzKTtcbiAgICAgICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VzW2N1cnJlbmN5XSxcbiAgICAgICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VzW2N1cnJlbmN5XSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGlmICh1cHBlcmNhc2UgPT09ICdEUksnKVxuICAgICAgICAgICAgICAgICAgICB1cHBlcmNhc2UgPSAnREFTSCc7XG4gICAgICAgICAgICAgICAgcmVzdWx0W3VwcGVyY2FzZV0gPSBhY2NvdW50O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgIC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nJvciAodGhpcy5pZCArICcgcmVxdWlyZXMgYXBpS2V5IGZvciBhbGwgcmVxdWVzdHMnKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXSArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAodGhpcy5leHRlbmQgKHsgJ25vbmNlJzogbm9uY2UgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG59O1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG4vLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuY29uc3QgaHVvYmlwcm8gPSByZXF1aXJlICgnLi9odW9iaXByby5qcycpO1xuY29uc3QgeyBFeGNoYW5nZUVycm9yLCBFeGNoYW5nZU5vdEF2YWlsYWJsZSwgQXV0aGVudGljYXRpb25FcnJvci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XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkuY29pbnRpZ2VyLmNvbS9leGNoYW5nZS90cmFkaW5nL2FwaS9tYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5jb2ludGlnZXIuY29tL2V4Y2hhbmdlL3RyYWRpbmcvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlJzogJ2h0dHBzOi8vd3d3LmNvaW50aWdlci5jb20vZXhjaGFuZ2UnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5jb2ludGlnZXIuY29tL2V4Y2hhbmdlL3JlZ2lzdGVyLmh0bWw/cmVmQ29kZT1GZnZEdHQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2NvaW50aWdlci9hcGktZG9jcy1lbi93aWtpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS9rbGluZScsIC8vIOiOt+WPlkvnur/mlbDmja5cbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXRhaWwvbWVyZ2VkJywgLy8g6I635Y+W6IGa5ZCI6KGM5oOFKFRpY2tlcilcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsIC8vIOiOt+WPliBNYXJrZXQgRGVwdGgg5pWw5o2uXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLCAvLyDojrflj5YgVHJhZGUgRGV0YWlsIOaVsOaNrlxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnkvdHJhZGUnLCAvLyDmibnph4/ojrflj5bmnIDov5HnmoTkuqTmmJPorrDlvZVcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXRhaWwnLCAvLyDojrflj5YgTWFya2V0IERldGFpbCAyNOWwj+aXtuaIkOS6pOmHj+aVsOaNrlxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2V4Y2hhbmdlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Zvb3Rlci90cmFkaW5ncnVsZS5odG1sJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcGkvcHVibGljL21hcmtldC9kZXRhaWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcxJzogSW5zdWZmaWNpZW50RnVuZHMsXG4gICAgICAgICAgICAgICAgJzInOiBFeGNoYW5nZUVycm9yLFxuICAgICAgICAgICAgICAgICc1JzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICcxNic6IEF1dGhlbnRpY2F0aW9uRXJyb3IsIC8vIGZ1bmRpbmcgcGFzc3dvcmQgbm90IHNldFxuICAgICAgICAgICAgICAgICcxMDAwMDEnOiBFeGNoYW5nZUVycm9yLFxuICAgICAgICAgICAgICAgICcxMDAwMDInOiBFeGNoYW5nZU5vdEF2YWlsYWJsZSxcbiAgICAgICAgICAgICAgICAnMTAwMDAzJzogRXhjaGFuZ2VFcnJvcixcbiAgICAgICAgICAgICAgICAnMTAwMDA1JzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIHRoaXMucGFyc2VKc29uUmVzcG9uc2UgPSBmYWxzZTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5leGNoYW5nZUdldEZvb3RlclRyYWRpbmdydWxlSHRtbCAoKTtcbiAgICAgICAgdGhpcy5wYXJzZUpzb25SZXNwb25zZSA9IHRydWU7XG4gICAgICAgIGxldCByb3dzID0gcmVzcG9uc2Uuc3BsaXQgKCc8dHI+Jyk7XG4gICAgICAgIGxldCBudW1Sb3dzID0gcm93cy5sZW5ndGg7XG4gICAgICAgIGxldCBsaW1pdCA9IG51bVJvd3MgLSAxO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAxOyBpIDwgbGltaXQ7IGkrKykge1xuICAgICAgICAgICAgbGV0IHJvdyA9IHJvd3NbaV07XG4gICAgICAgICAgICBsZXQgcGFydHMgPSByb3cuc3BsaXQgKCc8c3BhbiBzdHlsZT1cImNvbG9yOiNmZmZmZmZcIj4nKTtcbiAgICAgICAgICAgIGxldCBudW1QYXJ0cyA9IHBhcnRzLmxlbmd0aDtcbiAgICAgICAgICAgIGlmICgobnVtUGFydHMgPCA2KSB8fCAocGFydHNbMV0uaW5kZXhPZiAoJ0tpbmQmbmJzcCcpID49IDApKVxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgbGV0IGlkID0gcGFydHNbMV0uc3BsaXQgKCc8L3NwYW4+JylbMF07XG4gICAgICAgICAgICBsZXQgbWluQW1vdW50ID0gcGFydHNbMl0uc3BsaXQgKCc8L3NwYW4+JylbMF07XG4gICAgICAgICAgICBsZXQgbWluUHJpY2UgPSBwYXJ0c1s0XS5zcGxpdCAoJzwvc3Bhbj4nKVswXTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWluQW1vdW50KSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1pblByaWNlKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZCA9IGlkLnNwbGl0ICgnJm5ic3AnKVswXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgYmFzZUlkID0gYmFzZUlkLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgcXVvdGVJZCA9IHF1b3RlSWQudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBpZCA9IGJhc2VJZCArIHF1b3RlSWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAndXBwZXJjYXNlSWQnOiBpZC50b1VwcGVyQ2FzZSAoKSxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogcGFyc2VGbG9hdCAobWluQW1vdW50KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChtaW5QcmljZSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogdW5kZWZpbmVkLF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2xdID0gdGhpcy5wYXJzZVRpY2tlciAocmVzcG9uc2VbaWRdLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICAvL1xuICAgICAgICAvLyAgICAge1xuICAgICAgICAvLyAgICAgICAgIFwidm9sdW1lXCI6IHtcbiAgICAgICAgLy8gICAgICAgICAgICAgXCJhbW91bnRcIjogXCIxLjAwMFwiLFxuICAgICAgICAvLyAgICAgICAgICAgICBcImljb25cIjogXCJcIixcbiAgICAgICAgLy8gICAgICAgICAgICAgXCJ0aXRsZVwiOiBcIuaIkOS6pOmHj1wiXG4gICAgICAgIC8vICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgIC8vICAgICAgICAgXCJwcmljZVwiOiB7XG4gICAgICAgIC8vICAgICAgICAgICAgIFwiYW1vdW50XCI6IFwiMC4wNDk3ODg4M1wiLFxuICAgICAgICAvLyAgICAgICAgICAgICBcImljb25cIjogXCJcIixcbiAgICAgICAgLy8gICAgICAgICAgICAgXCJ0aXRsZVwiOiBcIuWnlOaJmOS7t+agvFwiXG4gICAgICAgIC8vICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgLy8gICAgICAgICBcImNyZWF0ZWRfYXRcIjogMTUxMzI0NTEzNDAwMCxcbiAgICAgICAgLy8gICAgICAgICBcImRlYWxfcHJpY2VcIjoge1xuICAgICAgICAvLyAgICAgICAgICAgICBcImFtb3VudFwiOiAwLjA0OTc4ODgzMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwLFxuICAgICAgICAvLyAgICAgICAgICAgICBcImljb25cIjogXCJcIixcbiAgICAgICAgLy8gICAgICAgICAgICAgXCJ0aXRsZVwiOiBcIuaIkOS6pOS7t+agvFwiXG4gICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAvLyAgICAgICAgIFwiaWRcIjogMTM4XG4gICAgICAgIC8vICAgICB9XG4gICAgICAgIC8vXG4gICAgICAgIGxldCBzaWRlID0gdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ3NpZGUnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHByaWNlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBzaWRlICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgc2lkZSA9IHNpZGUudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBwcmljZSA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3ByaWNlJyk7XG4gICAgICAgICAgICBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdhbW91bnQnKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlWydwcmljZSddLCAnYW1vdW50Jyk7XG4gICAgICAgICAgICBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGVbJ3ZvbHVtZSddLCAnYW1vdW50Jyk7XG4gICAgICAgICAgICBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlWydkZWFsX3ByaWNlJ10sICdhbW91bnQnKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGFtb3VudCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBpZiAodHlwZW9mIHByaWNlICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBjb3N0ID0gYW1vdW50ICogcHJpY2U7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnNhZmVWYWx1ZSAodHJ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dGltZWZyYW1lLCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0VXNlckJhbGFuY2UgKHBhcmFtcyk7XG4gICAgICAgIC8vXG4gICAgICAgIC8vICAgICB7XG4gICAgICAgIC8vICAgICAgICAgXCJjb2RlXCI6IFwiMFwiLFxuICAgICAgICAvLyAgICAgICAgIFwibXNnXCI6IFwic3VjXCIsXG4gICAgICAgIC8vICAgICAgICAgXCJkYXRhXCI6IFt7XG4gICAgICAgIC8vICAgICAgICAgICAgIFwibm9ybWFsXCI6IFwiMTgxMy4wMTE0NDE3OVwiLFxuICAgICAgICAvLyAgICAgICAgICAgICBcImxvY2tcIjogXCIxMzI1LjQyMDM2Nzg1XCIsXG4gICAgICAgIC8vICAgICAgICAgICAgIFwiY29pblwiOiBcImJ0Y1wiXG4gICAgICAgIC8vICAgICAgICAgfSwge1xuICAgICAgICAvLyAgICAgICAgICAgICBcIm5vcm1hbFwiOiBcIjk1NTEuOTY2OTIyNDRcIixcbiAgICAgICAgLy8gICAgICAgICAgICAgXCJsb2NrXCI6IFwiNTQ3LjA2NTA2NzE3XCIsXG4gICAgICAgIC8vICAgICAgICAgICAgIFwiY29pblwiOiBcImV0aFwiXG4gICAgICAgIC8vICAgICAgICAgfV1cbiAgICAgICAgLy8gICAgIH1cbiAgICAgICAgLy9cbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5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lJ10sICdhbW91bnQnKSA6IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBwcmljZSA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBwcmljZSA9ICgncHJpY2UnIGluIG9yZGVyKSA/IHRoaXMuc2FmZUZsb2F0IChvcmRlclsncHJpY2UnXSwgJ2Ftb3VudCcpIDogdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGF2ZXJhZ2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgYW1vdW50ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiByZW1haW5pbmcgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBmaWxsZWQgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBmaWxsZWQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgY29zdCA9IGZpbGxlZCAqIHByaWNlO1xuICAgICAgICAgICAgICAgIGF2ZXJhZ2UgPSBwYXJzZUZsb2F0IChjb3N0IC8gZmlsbGVkKTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZyA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIHJlbWFpbmluZyA9IGFtb3VudCAtIGZpbGxlZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoKHR5cGVvZiByZW1haW5pbmcgIT09ICd1bmRlZmluZWQnKSAmJiAocmVtYWluaW5nID4gMCkpXG4gICAgICAgICAgICBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGlmICghdGhpcy5wYXNzd29yZClcbiAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yICh0aGlzLmlkICsgJyBjcmVhdGVPcmRlciByZXF1aXJlcyBleGNoYW5nZS5wYXNzd29yZCB0byBiZSBzZXQgdG8gdXNlciB0cmFkaW5nIHBhc3N3b3JkIChub3QgbG9naW4gcGFzc3dvcmQhKScpO1xuICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXJUeXBlID0gKHR5cGUgPT09ICdsaW1pdCcpID8gMSA6IDI7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyVHlwZSxcbiAgICAgICAgICAgICd2b2x1bWUnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAnY2FwaXRhbF9wYXNzd29yZCc6IHRoaXMucGFzc3dvcmQsXG4gICAgICAgIH07XG4gICAgICAgIGlmICgodHlwZSA9PT0gJ21hcmtldCcpICYmIChzaWRlID09PSAnYnV5JykpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgcHJpY2UgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgY3JlYXRlT3JkZXIgcmVxdWlyZXMgcHJpY2UgYXJndW1lbnQgZm9yIG1hcmtldCBidXkgb3JkZXJzIHRvIGNhbGN1bGF0ZSB0b3RhbCBjb3N0IGFjY29yZGluZyB0byBleGNoYW5nZSBydWxlcycpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgb3JkZXJbJ3ZvbHVtZSddID0gdGhpcy5hbW91bnRUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQgKiBwcmljZSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGUgPT09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlciAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgLy9cbiAgICAgICAgLy8gICAgIHtcIm9yZGVyX2lkXCI6MzQzNDN9XG4gICAgICAgIC8vXG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnb3JkZXJfaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjb3N0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gIC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gJ3RpbWUnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gJyc7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGtleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBhdXRoICs9IGtleXNbaV0gKyBxdWVyeVtrZXlzW2ldXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGF1dGggKz0gdGhpcy5zZWNyZXQ7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKTtcbiAgICAgICAgICAgIGxldCBpc0NyZWF0ZU9yZGVyTWV0aG9kID0gKHBhdGggPT09ICdvcmRlcicpICYmIChtZXRob2QgPT09ICdQT1NUJyk7XG4gICAgICAgICAgICBsZXQgdXJsUGFyYW1zID0gaXNDcmVhdGVPcmRlck1ldGhvZCA/IHt9IDogcXVlcnk7XG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHRoaXMua2V5c29ydCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYXBpX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICd0aW1lJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgfSwgdXJsUGFyYW1zKSkpO1xuICAgICAgICAgICAgdXJsICs9ICcmc2lnbj0nICsgdGhpcy5kZWNvZGUgKHNpZ25hdHVyZSk7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2FwaV9rZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGh0dHBDb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmICh0eXBlb2YgYm9keSAhPT0gJ3N0cmluZycpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoYm9keS5sZW5ndGggPCAyKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKChib2R5WzBdID09PSAneycpIHx8IChib2R5WzBdID09PSAnWycpKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmICgnY29kZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIC8vICAgICB7XCJjb2RlXCI6XCIxMDAwMDVcIixcIm1zZ1wiOlwicmVxdWVzdCBzaWduIGlsbGVnYWxcIixcImRhdGFcIjpudWxsfVxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnY29kZScpO1xuICAgICAgICAgICAgICAgIGlmICgodHlwZW9mIGNvZGUgIT09ICd1bmRlZmluZWQnKSAmJiAoY29kZSAhPT0gJzAnKSkge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBtZXNzYWdlID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ21zZycpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBmZWVkYmFjayA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZXhjZXB0aW9ucyA9IHRoaXMuZXhjZXB0aW9ucztcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGUgaW4gZXhjZXB0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGUgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSA9PT0gJ29mZnNldE5vdCBOdWxsJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ1BhcmFtZXRlciBlcnJvcicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgZXhjZXB0aW9uc1tjb2RlXSAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIHVua25vd24gXCJlcnJvclwiIHZhbHVlOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufTtcblxuIiwiJ3VzZSBzdHJpY3QnO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbmNvbnN0IGNvaW5lZ2cgPSByZXF1aXJlICgnLi9jb2luZWdnLmpzJyk7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBjb29sY29pbiBleHRlbmRzIGNvaW5lZ2cge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdjb29sY29pbicsXG4gICAgICAgICAgICAnbmFtZSc6ICdDb29sQ29pbicsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0hLJyxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzY3NzA1MjktYmU3YjFhMDQtMWM1Yi0xMWU4LTk2MDAtZDExZjE5OTZiNTM5LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL3d3dy5jb29sY29pbi5jb20vY29pbicsXG4gICAgICAgICAgICAgICAgICAgICdyZXN0JzogJ2h0dHBzOi8vd3d3LmNvb2xjb2luLmNvbS9hcGkvdjEnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5jb29sY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuY29vbGNvaW4uY29tL2hlbHAuYXBpLmh0bWwnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vd3d3LmNvb2xjb2luLmNvbS9zcGVuZC5wcmljZS5odG1sJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUQkMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTREMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRNJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FDVCc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FLJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQ1MnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hDQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lGQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFZJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQR0MnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tUQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5UJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMU0snOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0tUJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTU1MnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUMSc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQl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1JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmNyeXB0b3BpYS5jby5uei9Gb3J1bS9UaHJlYWQvMjU1JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmNyeXB0b3BpYS5jby5uei9Gb3J1bS9UaHJlYWQvMjU2JyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRDdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZVBhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldHMve2hvdXJzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0cy97aWR9L3tob3Vyc30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXQve2lkfS97aG91cnN9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRIaXN0b3J5L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldEhpc3Rvcnkve2lkfS97aG91cnN9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRPcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0T3JkZXJzL3tpZH0ve2NvdW50fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0T3JkZXJHcm91cHMve2lkc30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldE9yZGVyR3JvdXBzL3tpZHN9L3tjb3VudH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbFRyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRCYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1N1Ym1pdFRpcCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3VibWl0VHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1N1Ym1pdFRyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTdWJtaXRXaXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnQUNDJzogJ0FkQ29pbicsXG4gICAgICAgICAgICAgICAgJ0JBVCc6ICdCYXRDb2luJyxcbiAgICAgICAgICAgICAgICAnQkxaJzogJ0JsYXplQ29pbicsXG4gICAgICAgICAgICAgICAgJ0JURyc6ICdCaXRnZW0nLFxuICAgICAgICAgICAgICAgICdDQyc6ICdDQ1gnLFxuICAgICAgICAgICAgICAgICdDTVQnOiAnQ29tZXQnLFxuICAgICAgICAgICAgICAgICdGQ04nOiAnRmFjaWxlY29pbicsXG4gICAgICAgICAgICAgICAgJ0ZVRUwnOiAnRkMyJywgLy8gRnVlbENvaW4gIT0gRlVFTFxuICAgICAgICAgICAgICAgICdIQVYnOiAnSGF2ZWNvaW4nLFxuICAgICAgICAgICAgICAgICdMREMnOiAnTEFEQUNvaW4nLFxuICAgICAgICAgICAgICAgICdNQVJLUyc6ICdCaXRtYXJrJyxcbiAgICAgICAgICAgICAgICAnTkVUJzogJ05ldENvaW4nLFxuICAgICAgICAgICAgICAgICdRQlQnOiAnQ3ViaXRzJyxcbiAgICAgICAgICAgICAgICAnV1JDJzogJ1dhckNvaW4nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdvcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnNFcnJvcnMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRHZXRUcmFkZVBhaXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ0RhdGEnXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnSWQnXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ0xhYmVsJ107XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydTeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gbWFya2V0WydCYXNlU3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBtYXJrZXRbJ01pbmltdW1UcmFkZSddO1xuICAgICAgICAgICAgbGV0IHByaWNlTGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ01pbmltdW1QcmljZSddLFxuICAgICAgICAgICAgICAgICdtYXgnOiBtYXJrZXRbJ01heGltdW1QcmljZSddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhbW91bnRMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydNYXhpbXVtVHJhZGUnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnRMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ01pbmltdW1CYXNlVHJhZGUnXSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSBtYXJrZXRbJ1N0YXR1cyddID09PSAnT0snO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdsYWJlbCc6IG1hcmtldFsnTGFiZWwnXSxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogbWFya2V0WydUcmFkZUZlZSddIC8gMTAwLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IG1hcmtldFsnVHJhZGVGZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAnbG90JzogbGltaXRzWydhbW91bnQnXVsnbWluJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLm9wdGlvbnNbJ21hcmtldHNCeUxhYmVsJ10gPSB0aGlzLmluZGV4QnkgKHJlc3VsdCwgJ2xhYmVsJyk7XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0R2V0TWFya2V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AgICB2d2FwID0gcXVvdGVWb2x1bWUgLyBiYXNlVm9sdW1lO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnTG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0JpZFByaWNlJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdBc2tQcmljZScpLFxuICAgICAgICAgICAgJ2Fza1ZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdndhcCxcbiAgICAgICAgICAgICdvcGVuJzogb3BlbixcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiBjaGFuZ2UsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdDaGFuZ2UnKSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdGhpcy5zdW0gKGxhc3QsIG9wZW4pIC8gMixcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZV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WNlKVxuICAgICAgICAgICAgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdSYXRlJyk7XG4gICAgICAgIGxldCBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnVG90YWwnKTtcbiAgICAgICAgbGV0IGlkID0gdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ1RyYWRlSWQnKTtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGlmICgnVHJhZGVQYWlySWQnIGluIHRyYWRlKVxuICAgICAgICAgICAgICAgIGlmICh0cmFkZVsnVHJhZGVQYWlySWQnXSBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFt0cmFkZVsnVHJhZGVQYWlySWQnXV07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGZlZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGlmICgnRmVlJyBpbiB0cmFkZSkge1xuICAgICAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHRyYWRlWydGZWUnXSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJ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gICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ05hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5WydXaXRoZHJhd0ZlZSddLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnTWluQmFzZVRyYWRlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ01pbldpdGhkcmF3J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogY3VycmVuY3lbJ01heFdpdGhkcmF3J10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRCYWxhbmNlIChwYXJhbXMpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnRGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmFsYW5jZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaV07XG4gICAgICAgICAgICBsZXQgY29kZSA9IGJhbGFuY2VbJ1N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGNvZGUpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydBdmFpbGFibGUnXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWydUb3RhbCddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICByZXN1bHRbY3Vycm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YW1zKSk7XG4gICAgICAgIGlmICghcmVzcG9uc2UpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgY3JlYXRlT3JkZXIgcmV0dXJuZWQgdW5rbm93biBlcnJvcjogJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgbGV0IGlkID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgZmlsbGVkID0gMC4wO1xuICAgICAgICBsZXQgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICBpZiAoJ0RhdGEnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBpZiAoJ09yZGVySWQnIGluIHJlc3BvbnNlWydEYXRhJ10pIHtcbiAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2VbJ0RhdGEnXVsnT3JkZXJJZCddKSB7XG4gICAgICAgICAgICAgICAgICAgIGlkID0gcmVzcG9uc2VbJ0RhdGEnXVsnT3JkZXJJZCddLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IGFtb3VudDtcbiAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IHByaWNlICogYW1vdW50LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiBhbW91bnQgLSBmaWxsZWQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIC8vICd0cmFkZXMnOiB0aGlzLnBhcnNlVHJhZGVzIChvcmRlclsndHJhZGVzJ10sIG1hcmtldCksXG4gICAgICAgIH07XG4gICAgICAgIGlmIChpZClcbiAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IG9yZGVyO1xuICAgICAgICByZXR1cm4gdGhpcy5leHRlbmQgKHsgJ2luZm8nOiByZXNwb25zZSB9LCBvcmRlcik7XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbFRyYWRlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdUeXBlJzogJ1RyYWRlJyxcbiAgICAgICAgICAgICAgICAnT3JkZXJJZCc6IGlkLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5vcmRlcnMpXG4gICAgICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdWydzdGF0dXMnXSA9ICdjYW5jZWxlZCc7XG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLmxhc3RfanNvbl9yZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gdGhpcy5zYWZlU3RyaW5nICh0aGlzLmxhc3RfanNvbl9yZXNwb25zZSwgJ0Vycm9yJyk7XG4gICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ2RvZXMgbm90IGV4aXN0JykgPj0gMClcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyBjYW5jZWxPcmRlcigpIGVycm9yOiAnICsgdGhpcy5sYXN0X2h0dHBfcmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IGU7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgfSBlbHNlIGlmICgnTWFya2V0JyBpbiBvcmRlcikge1xuICAgICAgICAgICAgbGV0IGlkID0gb3JkZXJbJ01hcmtldCddO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMub3B0aW9uc1snbWFya2V0c0J5TGFiZWwnXSkge1xuICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm9wdGlvbnNbJ21hcmtldHNCeUxhYmVsJ11baWRdO1xuICAgICAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKG9yZGVyWydUaW1lU3RhbXAnXSk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdBbW91bnQnKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ1JlbWFpbmluZycpO1xuICAgICAgICBsZXQgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ09yZGVySWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdGhpcy5vbWl0IChvcmRlciwgJ3N0YXR1cycpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogb3JkZXJbJ3N0YXR1cyddLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ1R5cGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ1JhdGUnKSxcbiAgICAgICAgICAgICdjb3N0JzogdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnVG90YWwnKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAvLyAndHJhZGVzJzogdGhpcy5wYXJzZVRyYWRlcyAob3JkZXJbJ3RyYWRlcyddLCBtYXJrZXQpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJzIChzeW1ib2wgPSB1bmRlZmluZWQsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAvLyAnTWFya2V0JzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgLy8gJ1RyYWRlUGFpcklkJzogbWFya2V0WydpZCddLCAvLyBDcnlwdG9waWEgaWRlbnRpZmllciAobm90IHJlcXVpcmVkIGlmICdNYXJrZXQnIHN1cHBsaWVkKVxuICAgICAgICAgICAgLy8gJ0NvdW50JzogMTAwLCAvLyBkZWZhdWx0ID0gMTAwXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlb2Ygc3ltYm9sICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgICAgICByZXF1ZX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JzW2lkXSA9IHRoaXMuZXh0ZW5kICh0aGlzLm9yZGVyc1tpZF0sIG9wZW5PcmRlcnNJbmRleGVkQnlJZFtpZF0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgb3JkZXIgPSB0aGlzLm9yZGVyc1tpZF07XG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydzdGF0dXMnXSA9PT0gJ29wZW4nKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgodHlwZW9mIHN5bWJvbCA9PT0gJ3VuZGVmaW5lZCcpIHx8IChvcmRlclsnc3ltYm9sJ10gPT09IHN5bWJvbCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnY2xvc2VkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnY29zdCc6IG9yZGVyWydhbW91bnQnXSAqIG9yZGVyWydwcmljZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdmaWxsZWQnOiBvcmRlclsnYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3JlbWFpbmluZyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRlcnNbaWRdO1xuICAgICAgICAgICAgaWYgKCh0eXBlb2Ygc3ltYm9sID09PSAndW5kZWZpbmVkJykgfHwgKG9yZGVyWydzeW1ib2wnXSA9PT0gc3ltYm9sKSlcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAob3JkZXIpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLmZpbHRlckJ5U2luY2VMaW1pdCAocmVzdWx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pO1xuICAgICAgICAgICAgbGV0IGxvd2VyY2FzZSA9IHVyaS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIGhhc2ggPSB0aGlzLmJpbmFyeVRvU3RyaW5nIChoYXNoKTtcbiAgICAgICAgICAgIGxldCBwYXlsb2FkID0gdGhpcy5hcGlLZXkgKyBtZXRob2QgKyBsb3dlcmNhc2UgKyBub25jZSArIGhhc2g7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocGF5bG9hZCksIHNlY3JldCwgJ3NoYTI1NicsICdiYXNlNjQnKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gJ2FteCAnICsgdGhpcy5hcGlLZXkgKyAnOicgKyB0aGlzLmJpbmFyeVRvU3RyaW5nIChzaWduYXR1cmUpICsgJzonICsgbm9uY2U7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgJ0F1dGhvcml6YXRpb24nOiBhdXRoLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAocmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmIC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0gY2xhc3MgZHN4IGV4dGVuZHMgbGlxdWkge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdkc3gnLFxuICAgICAgICAgICAgJ25hbWUnOiAnRFNYJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnVUsnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk5MDI3NS0xNDEzMTU4YS02NDVhLTExZTctOTMxYy05NDcxN2Y3NTEwZTMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vZHN4LnVrL21hcGknLCAvLyBtYXJrZXQgZGF0YVxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2RzeC51ay90YXBpJywgLy8gdHJhZGluZ1xuICAgICAgICAgICAgICAgICAgICAnZHdhcGknOiAnaHR0cHM6Ly9kc3gudWsvZHdhcGknLCAvLyBkZXBvc2l0L3dpdGhkcmF3XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vZHN4LnVrJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkuZHN4LnVrJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZHN4LnVrL2FwaV9kb2NzL3B1YmxpYycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2RzeC51ay9hcGlfZG9jcy9wcml2YXRlJyxcbiAgICAgICAgICAgICAgICAgICAgJycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgIC8vIG1hcmtldCBkYXRhIChwdWJsaWMpXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYXJzRnJvbU1vbWVudC97aWR9L3twZXJpb2R9L3tzdGFydH0nLCAvLyBlbXB0eSByZXBseSA6XFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhc3RCYXJzL3tpZH0ve3BlcmlvZH0ve2Ftb3VudH0nLCAvLyBwZXJpb2QgaXMgKG0sIGggb3IgZClcbiAgICAgICAgICAgICAgICAgICAgICAgICdwZXJpb2RCYXJzL3tpZH0ve3BlcmlvZH0ve3N0YXJ0fS97ZW5kfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAvLyB0cmFkaW5nIChwcml2YXRlKVxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFuc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY3RpdmVPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAvLyBkZXBvc2l0IC8gd2l0aGRyYXcgKHByaXZhdGUpXG4gICAgICAgICAgICAgICAgJ2R3YXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRDcnlwdG9EZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3J5cHRvV2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpYXRXaXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VHJhbnNhY3Rpb25TdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGdldEJhc2VRdW90ZUZyb21NYXJrZXRJZCAo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W1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbCcpLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbF9jdXInKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGdldE9yZGVySWRLZXkgKCkge1xuICAgICAgICByZXR1cm4gJ29yZGVySWQnO1xuICAgIH1cblxuICAgIHNpZ25Cb2R5V2l0aFNlY3JldCAoYm9keSkge1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ICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdkZXBvc2l0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hGZWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hGdW5kaW5nRmVlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVHJhZGluZ0ZlZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnM2gnOiAnM2gnLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aCcsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmgnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxRCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzdEJyxcbiAgICAgICAgICAgICAgICAnMncnOiAnMTREJyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzc1NTU1MjYtNzAxOGE3N2MtMjlmOS0xMWU4LTg4MzUtOGU0MTVjMDM4YTE4LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5ldGhmaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuZXRoZmluZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRmaW5leC5yZWFkbWUuaW8vdjEvZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYml0ZmluZXhjb20vYml0ZmluZXgtYXBpLW5vZGUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuZXRoZmluZXguY29tL2FwaV9kb2NzJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuLy8gIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5jb25zdCBFeGNoYW5nZSA9IHJlcXVpcmUgKCcuL2Jhc2UvRXhjaGFuZ2UnKTtcbmNvbnN0IHsgRXhjaGFuZ2VFcnJvciwgRXhjaGFuZ2VOb3RBdmFpbGFibGUsIE9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PcmRlclRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJCb29rcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQ5MS0xYjBlYTk1Ni01ZWRhLTExZTctOTIyNS00MGQ2N2I0ODFiOGQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmV4bW8uY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vZXhtby5tZS8/cmVmPTEzMTY4NScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZXhtby5tZS9lbi9hcGlfZG9jP3JlZj0xMzE2ODUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL2V4bW8tZGV2L2V4bW9fYXBpX2xpYi90cmVlL21hc3Rlci9ub2RlanMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9leG1vLmNvbS9lbi9kb2NzL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcl9zZXR0aW5ncycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfY3JlYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX2NhbmNlbGxlZF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVxdWlyZWRfYW1vdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2NyeXB0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19nZXRfdHhpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjb2RlX2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjb2RlX2xvYWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldF9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dBVkVTJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDI1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogMzUwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogNTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZXhjZXB0aW9ucyc6IHtcbiAg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gICAgJzUwMzIxJzogSW52YWxpZE9yZGVyLCAvLyBQcmljZSBieSBvcmRlciBpcyBtb3JlIHRoYW4gcGVybWlzc2libGUgbWF4aW11bSBmb3IgdGhpcyBwYWlyXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0UGFpclNldHRpbmdzICgpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNbcF07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQucmVwbGFjZSAoJ18nLCAnLycpO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluX3F1YW50aXR5JyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heF9xdWFudGl0eScpLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbl9wcmljZScpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYXhfcHJpY2UnKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbl9hbW91bnQnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4X2Ftb3VudCcpLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VXNlckluZm8gKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgIC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3BlY2lmeSBhIGxpc3Qgb2Ygc3ltYm9scyBpbiB0aGUgZmlyc3QgYXJndW1lbnQgdG8gZmV0Y2hPcmRlckJvb2tzJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZHMgPSB0aGlzLm1hcmtldElkcyAoc3ltYm9scyk7XG4gICAgICAgICAgICBpZHMgPSBpZHMuam9pbiAoJywnKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE9yZGVyQm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogaWRzLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBpZHMgPSBPYmplY3Qua2V5cyAocmVzcG9uc2UpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IHRoaXMuZmluZFN5bWJvbCAoaWQpO1xuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlT3JkZXJCb29rIChyZXNwb25zZVtpZF0sIHVuZGVmaW5lZCwgJ2JpZCcsICdhc2snKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd1cGRhdGVkJ10gKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgY29uc3QgbGF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F1b3RlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbF9jdXJyJyksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlcnMgKHN5bWJvbHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAocmVzcG9uc2UpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVtpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyIChwYXJhbXMpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIHJldHVybiB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Y3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHByZWZpeCA9ICh0eXBlID09PSAnbWFya2V0JykgPyAodHlwZSArICdfJykgOiAnJztcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBpZiAoKHR5cGUgPT09ICdtYXJrZXQnKSAmJiAodHlwZW9mIHByaWNlID09PSAndW5kZWZpbmVkJykpIHtcbiAgICAgICAgICAgIHByaWNlID0gMDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3F1YW50aXR5JzogdGhpcy5hbW91bnRUb1N0cmluZyAoc3ltYm9sLCBhbW91bnQpLFxuICAgICAgICAgICAgJ3R5cGUnOiBwcmVmaXggKyBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmljZVRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlKSxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE9yZGVyQ3JlYXRlICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBpZCA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdvcmRlcl9pZCcpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGFtb3VudCA9IHBhcnNlRmxvYXQgKGFtb3VudCk7XG4gICAgICAgIHByaWNlID0gcGFyc2VGbG9hdCAocHJpY2UpO1xuICAgICAgICBsZXQgc3RhdHVz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RlbmQgKG9yZGVyLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ2Nsb3NlZCcsIC8vIGxpa2V3aXNlIGl0IG1pZ2h0IGhhdmUgYmVlbiBjYW5jZWxlZCBleHRlcm5hbGx5ICh1bm5vdGljZWQgYnkgXCJ1c1wiKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlsbGVkJzogb3JkZXJbJ2Ftb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlbWFpbmluZyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3JkZXJbJ2Nvc3QnXSA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3JkZXJbJ2ZpbGxlZCddICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcmRlclsnY29zdCddID0gb3JkZXJbJ2ZpbGxlZCddICogb3JkZXJbJ3ByaWNlJ107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gb3JkZXI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnRvQXJyYXkgKHRoaXMub3JkZXJzKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVycyAoc3ltYm9sID0gdW5kZWZpbmVkLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0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ChvcmRlciwgJ3R5cGUnKTtcbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0SWQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoJ3BhaXInIGluIG9yZGVyKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0SWQgPSBvcmRlclsncGFpciddO1xuICAgICAgICAgICAgfSBlbHNlIGlmICgoJ2luX2N1cnJlbmN5JyBpbiBvcmRlcikgJiYgKCdvdXRfY3VycmVuY3knIGluIG9yZGVyKSkge1xuICAgICAgICAgICAgICAgIGlmIChzaWRlID09PSAnYnV5JylcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0SWQgPSBvcmRlclsnaW5fY3VycmVuY3knXSArICdfJyArIG9yZGVyWydvdXRfY3VycmVuY3knXTtcbiAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgIG1hcmtldElkID0gb3JkZXJbJ291dF9jdXJyZW5jeSddICsgJ18nICsgb3JkZXJbJ2luX2N1cnJlbmN5J107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoKHR5cGVvZiBtYXJrZXRJZCAhPT0gJ3VuZGVmaW5lZCcpICYmIChtYXJrZXRJZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpKVxuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFttYXJrZXRJZF07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3F1YW50aXR5Jyk7XG4gICAgICAgIGlmICh0eXBlb2YgYW1vdW50ID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgbGV0IGFtb3VudEZpZWxkID0gKHNpZGUgPT09ICdidXknKSA/ICdpbl9hbW91bnQnIDogJ291dF9hbW91bnQnO1xuICAgICAgICAgICAgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCBhbW91bnRGaWVsZCk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IGNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdhbW91bnQnKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IDAuMDtcbiAgICAgICAgbGV0IHRyYWRlcyA9IFtdO1xuICAgICAgICBsZXQgdHJhbnNhY3Rpb25zID0gdGhpcy5zYWZlVmFsdWUgKG9yZGVyLCAndHJhZGVzJyk7XG4gICAgICAgIGxldCBmZWVDb3N0ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIHRyYW5zYWN0aW9ucyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5ICh0cmFuc2FjdGlvbnMpKSB7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0cmFuc2FjdGlvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRyYWRlID0gdGhpcy5wYXJzZVRyYWRlICh0cmFuc2FjdGlvbnNbaV0sIG1hcmtldCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgaWQgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgaWQgPSB0cmFkZVsnb3JkZXInXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB0aW1lc3RhbXAgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgdGltZXN0YW1wID0gdHJhZGVbJ3RpbWVzdGFtcCddO1xuICAgICAgICAgICAgICAgICAgICBpZiAodGltZXN0YW1wID4gdHJhZGVbJ3RpbWVzdGFtcCddKVxuICAgICAgICAgICAgICAgICAgICAgICAgdGltZXN0YW1wID0gdHJhZGVbJ3RpbWVzdGFtcCddO1xuICAgICAgICAgICAgICAgICAgICBmaWxsZWQgKz0gdHJhZGVbJ2Ftb3VudCddO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGZlZUNvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgZmVlQ29zdCA9IDAuMDtcbiAgICAgICAgICAgICAgICAgICAgLy8gZmVlQ29zdCArPSB0cmFkZVsnZmVlJ11bJ2Nvc3QnXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBjb3N0ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvc3QgPSAwLjA7XG4gICAgICAgICAgICAgICAgICAgIGNvc3QgKz0gdHJhZGVbJ2Nvc3QnXTtcbiAgICAgICAgICAgICAgICAgICAgdHJhZGVzLnB1c2ggKHRyYWRlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiB0aW1lc3RhbXAgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgaXNvODYwMSA9IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ3N0YXR1cycpOyAvLyBpbiBjYXNlIHdlIG5lZWQgdG8gcmVkZWZpbmUgaXQgZm9yIGNhbmNlbGVkIG9yZGVyc1xuICAgICAgICBpZiAoZmlsbGVkID49IGFtb3VudClcbiAgICAgICAgICAgIHN0YXR1cyA9ICdjbG9zZWQnO1xuICAgICAgICBlbHNlXG4gICAgICAgICAgICBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgIGlmICh0eXBlb2YgbWFya2V0ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMuZ2V0TWFya2V0RnJvbVRyYWRlcyAodHJhZGVzKTtcbiAgICAgICAgbGV0IGZlZUN1cnJlbmN5ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBmZWVDdXJyZW5jeSA9IG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGNvc3QgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHByaWNlICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBjb3N0ID0gcHJpY2UgKiBmaWxsZWQ7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIHByaWNlID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKGZpbGxlZCA+IDApXG4gICAgICAgICAgICAgICAgcHJpY2UgPSBjb3N0IC8gZmlsbGVkO1xuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB7XG4gICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAnY3VycmVuY3knOiBmZWVDdXJyZW5jeSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogaXNvODYwMSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBnZXRNYXJrZXRGcm9tVHJhZGVzICh0cmFkZXMpIHtcbiAgICAgICAgbGV0IHRyYWRlc0J5U3ltYm9sID0gdGhpcy5pbmRleEJ5ICh0cmFkZXMsICdwYWlyJyk7XG4gICAgICAgIGxldCBzeW1ib2xzID0gT2JqZWN0LmtleXMgKHRyYWRlc0J5U3ltYm9sKTtcbiAgICAgICAgbGV0IG51bVN5bWJvbHMgPSBzeW1ib2xzLmxlbmd0aDtcbiAgICAgICAgaWYgKG51bVN5bWJvbHMgPT09IDEpXG4gICAgICAgICAgICByZXR1cm4gdGhpcy5tYXJrZXRzW3N5bWJvbHNbMF1dO1xuICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgIH1cblxuICAgIGNhbGN1bGF0ZUZlZSAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlLCB0YWtlck9yTWFrZXIgPSAndGFrZXInLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgIGxldCByYXRlID0gbWFya2V0W3Rha2VyT3JNYWtlcl07XG4gICAgICAgI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KSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3VsdCxcbiAgICAgICAgICAgICdpZCc6IHJlc3VsdFsndGFza19pZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7ICdub25jZSc6IG5vbmNlIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdTaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGh0dHBDb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmICh0eXBlb2YgYm9keSAhPT0gJ3N0cmluZycpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoYm9keS5sZW5ndGggPCAyKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKChib2R5WzBdID09PSAneycpIHx8IChib2R5WzBdID09PSAnWycpKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmICgncmVzdWx0JyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgLy8gICAgIHtcInJlc3VsdFwiOmZhbHNlLFwiZXJyb3JcIjpcIkVycm9yIDUwMDUyOiBJbnN1ZmZpY2llbnQgZnVuZHNcIn1cbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIGxldCBzdWNjZXNzID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAncmVzdWx0JywgZmFsc2UpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygc3VjY2VzcyA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChzdWNjZXNzID09PSAndHJ1ZScpIHx8IChzdWNjZXNzID09PSAnMScpKVxuICAgICAgICAgICAgICAgICAgICAgICAgc3VjY2VzcyA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Y2Nlc3MgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFzdWNjZXNzKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBjb2RlID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBtZXNzYWdlID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ2Vycm9yJyk7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGVycm9yUGFydHMgPSBtZXNzYWdlLnNwbGl0ICgnOicpO1xuICAgICAgICAgICAgICAgICAgICBsZXQgbnVtUGFydHMgPSBlcnJvclBhcnRzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG51bVBhcnRzID4gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZXJyb3JTdWJQYXJ0cyA9IGVycm9yUGFydHNbMF0uc3BsaXQgKCcgJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbnVtU3ViUGFydHMgPSBlcnJvclN1YlBhcnRzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUgPSAobnVtU3ViUGFydHMgPiAxKSA/IGVycm9yU3ViUGFydHNbMV0gOiBlcnJvclN1YlBhcnRzWzBdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGZlZWRiYWNrID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBleGNlcHRpb25zID0gdGhpcy5leGNlcHRpb25zO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY29kZSBpbiBleGNlcHRpb25zKSB7XG4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hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zNzc3MDI5Mi1mYmY2MTNkMC0yZGU0LTExZTgtOWY3OS1mMmRjNDUxYjhjY2IuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmV4eC5jb20vZGF0YS92MScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vdHJhZGUuZXh4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5leHguY29tLycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5leHguY29tL2hlbHAvcmVzdEFwaScsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cuZXh4LmNvbS9oZWxwL3JhdGUnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEJhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0MnOiAwLjAwMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNEJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JPVCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDI1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRTJzogMy4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMC4wMTIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFBZJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lOSyc6IDIwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNPJzogMC42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01PTkEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FBU0gnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUNBU0gnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgdXBwZXIgPSBpZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSB1cHBlci5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IG1hcmtldFsnaXNPcGVuJ10gPT09IHRydWU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUludCAobWFya2V0WydhbW91bnRTY2FsZSddKSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwYXJzZUludCAobWFya2V0WydwcmljZVNjYWxlJ10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0aWNrZXJbJ2RhdGUnXSk7XG4gICAgICAgIHRpY2tlciA9IHRpY2tlclsndGlja2VyJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAncmlzZVJhdGUnKSxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2wnKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVG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ldHVybiB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0aWQnKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdHJhZGVzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkZXMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAodHJhZGVzLCBtYXJrZXQsIHNpbmNlLCBsaW1pdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge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knOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAndHlwZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgaWQgPSByZXNwb25zZVsnaWQnXTtcbiAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5wYXJzZU9yZGVyICh7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICd0cmFkZV9kYXRlJzogdGhpcy5taWxsaXNlY29uZHMgKCksXG4gICAgICAgICAgICAndG90YWxfYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAndHlwZSc6IHNpZGUsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9LCBtYXJrZXQpO1xuICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSBvcmRlcjtcbiAgICAgICAgcmV0dXJuIG9yZGVyO1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRDYW5jZWwgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZ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WZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmtleXNvcnQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2FjY2Vzc2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IHRoaXMubm9uY2UgKCksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyk7XG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnkgKyAnJnNpZ25hdHVyZT0nICsgc2lnbmF0dXJlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAg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VuZHMgRXhjaGFuZ2Uge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdmbG93YnRjJyxcbiAgICAgICAgICAgICduYW1lJzogJ2Zsb3dCVEMnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdCUicsIC8vIEJyYXppbFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4MTYyNDY1LWNkODE1ZDRjLTY3Y2YtMTFlNy04ZTU3LTQzOGJlYTA1MjNhMi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuZmxvd2J0Yy5jb206ODQwNS9hamF4JyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vdHJhZGVyLmZsb3didGMuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHA6Ly93d3cuZmxvd2J0Yy5jb20uYnIvYXBpLycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVzQnlEYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFByb2R1Y3RQYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0UHJvZHVjdHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0NyZWF0ZUFjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFVzZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZXRVc2VySW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QWNjb3VudEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEFjY291bnRUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDcmVhdGVPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTW9kaWZ5T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxBbGxPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEFjY291bnRPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlckZlZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAzNSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDM1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY1Bvc3RHZXRQcm9kdWN0UGFpcnMgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3Byb2R1Y3RQYWlycyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ25hbWUnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0Wydwcm9kdWN0MUxhYmVsJ107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ3Byb2R1Y3QyTGFiZWwnXTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMuc2FmZUludGVnZXIgKG1hcmtldCwgJ3Byb2R1Y3QxRGVjaW1hbFBsYWNlcycpLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHRoaXMuc2FmZUludGVnZXIgKG1hcmtldCwgJ3Byb2R1Y3QyRGVjaW1hbFBsYWNlcycpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB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gICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydweCddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydxdHknXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNQb3N0R2V0VHJhZGVzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lucyc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdzdGFydEluZGV4JzogLTEsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2VbJ3RyYWRlcyddLCBtYXJrZXQsIHNpbmNlLCBsaW1pdCk7XG4gICAgfVxuXG4gICAgcHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSk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ICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2ZveGJpdC5leGNoYW5nZScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JsaW5rdHJhZGUuY29tL2RvY3MnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tZW50JzogJ0JsaW5rdHJhZGUgQVBJJyxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3l9L3RpY2tlcicsICAgIC8vID9jcnlwdG9fY3VycmVuY3k9QlRDXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5fS9vcmRlcmJvb2snLCAvLyA/Y3J5cHRvX2N1cnJlbmN5PUJUQ1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeX0vdHJhZGVzJywgICAgLy8gP2NyeXB0b19jdXJyZW5jeT1CVEMmc2luY2U9PFRJTUVTVEFNUD4mbGltaXQ9PE5VTUJFUj5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdEJywgICAvLyBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0YnLCAgIC8vIGNhbmNlbCBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ1UyJywgIC8vIGJhbGFuY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICdVNCcsICAvLyBteSBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdVNicsICAvLyB3aXRoZHJhd1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1UxOCcsIC8vIGRlcG9zaXRcbiAgICAgICAgICAgICAgICAgICAgICAgICdVMjQnLCAvLyBjb25maXJtIHdpdGhkcmF3YWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVMjYnLCAvLyBsaXN0IHdpdGhkcmF3YWxzXG4gICAgICAgICAgICAgICAgICAgICAgICAnVTMwJywgLy8gbGlzdCBkZXBvc2l0c1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1UzNCcsIC8vIGxlZGdlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ1U3MCcsIC8vIGNhbmNlbCB3aXRoZHJhd2FsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1ZFRic6IHsgJ2lkJzogJ0JUQ1ZFRicsICdzeW1ib2wnOiAnQlRDL1ZFRicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdWRUYnLCAnYnJva2VySWQnOiAxLCAnYnJva2VyJzogJ1N1ckJpdGNvaW4nIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9WTkQnOiB7ICdpZCc6ICdCVENWTkQnLCAnc3ltYm9sJzogJ0JUQy9WTkQnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVk5EJywgJ2Jyb2tlcklkJzogMywgJ2Jyb2tlcic6ICdWQlRDJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvQlJMJzogeyAnaWQnOiAnQlRDQlJMJywgJ3N5bWJvbCc6ICdCVEMvQlJMJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0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ICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICdjcnlwdG9fY3VycmVuY3knOiBtYXJrZXRbJ2Jhc2UnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICh0eXBlID09PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXJTaWRlID0gKHNpZGUgPT09ICdidXknKSA/ICcxJyA6ICcyJztcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ0NsT3JkSUQnOiB0aGlzLm5vbmNlICgpLFxuICAgICAgICAgICAgJ1N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdTaWRlJzogb3JkZXJTaWRlLFxuICAgICAgICAgICAgJ09yZFR5cGUnOiAnMicsXG4gICAgICAgICAgICAnUHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdPcmRlclF0eSc6IGFtb3VudCxcbiAgICAgICAgICAgICdCcm9rZXJJRCc6IG1hcmtldFsnYnJva2VySWQnXSxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEQgKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBpbmRleGVkID0gdGhpcy5pbmRleEJ5IChyZXNwb25zZVsnUmVzcG9uc2VzJ10sICdNc2dUeXBlJyk7XG4gICAgICAgIGxldCBleGVjdXRpb24gPSBpbmRleGVkWyc4J107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogZXhlY3V0aW9uWydPcmRlcklEJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLnByaXZhdGVQb3N0RiAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdDbE9yZElEJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSB0aGlzLmV4dGVuZCAoeyAnTXNnVHlwZSc6IHBhdGggfSwgcXVlcnkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocmVxdWVzdCk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBUElLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnTm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnU2lnbmF0dXJlJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAobm9uY2UpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoJ1N0YXR1cycgaW4gcmVzcG9uc2UpXG4gICAgICAgICAgICBpZiAocmVzcG9uc2VbJ1N0YXR1cyddICE9PSAyMDApXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y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TFlNy04MjQxLTJlNjc1ZTY3OTdmMS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuZnlic2Uuc2UvYXBpL1NFSycsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5meWJzZS5zZScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwOi8vZG9jcy5meWIuYXBpYXJ5LmlvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJkZXRhaWxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rlc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGFjY2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBlbmRpbmdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG9yZGVyaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VscGVuZGluZ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZW9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cy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IsICdiaWQnKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2FzaycpLFxuICAgICAgICAgICAgJ2Fza1ZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiBsYXN0LFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ3ByZXZpb3VzQ2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6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xuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmgnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcyNGgnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjg2NDY4MTctNTA4NDU3ZjItNzI2Yy0xMWU3LTllZWItMzUyOGQyNDEzYTU4LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5nYXRlY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9nYXRlY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dhdGVjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0dhdGVjb2luL1JFU1RmdWwtQVBJLUltcGxlbWVudGF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYXBpLmdhdGVjb2luLmNvbS9zd2FnZ2VyLXVpL2luZGV4Lmh0bWwnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1B1YmxpYy9FeGNoYW5nZVJ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ICAgICAnUmVmZXJlbmNlL1ZlcmlmaWNhdGlvbkxldmVsTGlzdCcsIC8vIEdldCB0aGUgdmVyaWYgbGV2ZWwgbGlzdC5cbiAgICAgICAgICAgICAgICAgICAgICAgICdTdHJlYW0vUHVibGljQ2hhbm5lbCcsIC8vIEdldCB0aGUgcHVibGljIHB1Ym51YiBjaGFubmVsIGxpc3RcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnRXhwb3J0L1RyYW5zYWN0aW9ucycsIC8vIFJlcXVlc3QgYSBleHBvcnQgb2YgYWxsIHRyYWRlcyBmcm9tIGJhc2VkIG9uIGN1cnJlbmN5cGFpciwgc3RhcnQgZGF0ZSBhbmQgZW5kIGRhdGVcbiAgICAgICAgICAgICAgICAgICAgICAgICdQaW5nJywgLy8gUG9zdCBhIHN0cmluZywgdGhlbiBnZXQgaXQgYmFjay5cbiAgICAgICAgICAgICAgICAgICAgICAgICdQdWJsaWMvVW5zdWJzY3JpYmUve0VtYWlsQ29kZX0nLCAvLyBMZXRzIHRoZSB1c2VyIHVuc3Vic2NyaWJlIGZyb20gZW1haWxzXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVnaXN0ZXJVc2VyJywgLy8gSW5pdGlhbCB0cmFkZXIgcmVnaXN0cmF0aW9uLlxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Db3Jwb3JhdGVEYXRhJywgLy8gR2V0IGNvcnBvcmF0ZSBhY2NvdW50IGRhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50QWRkcmVzcycsIC8vIENoZWNrIGlmIHJlc2lkZW5jZSBwcm9vZiB1cGxvYWRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRDb3Jwb3JhdGlvbicsIC8vIENoZWNrIGlmIHJlZ2lzdGVyZWQgZG9jdW1lbnQgdXBsb2FkZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50SUQnLCAvLyBDaGVjayBpZiBJRCBkb2N1bWVudCBjb3B5IHVwbG9hZGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudEluZm9ybWF0aW9uJywgLy8gR2V0IFN0ZXAzIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0VtYWlsJywgLy8gR2V0IHVzZXIgZW1haWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0ZlZVJhdGUnLCAvLyBHZXQgZmVlIHJhdGUgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0xldmVsJywgLy8gR2V0IHZlcmlmIGxldmVsIG9mIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9QZXJzb25hbEluZm9ybWF0aW9uJywgLy8gR2V0IFN0ZXAxIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1Bob25lJywgLy8gR2V0IHVzZXIgcGhvbmUgbnVtYmVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Qcm9maWxlJywgLy8gR2V0IHRyYWRlciBwcm9maWxlXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9RdWVzdGlvbm5haXJlJywgLy8gRmlsbCB0aGUgcXVlc3Rpb25uYWlyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyYWwnLCAvLyBHZXQgcmVmZXJyYWwgaW5mb3JtYXRpb25cbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1JlZmVycmFsQ29kZScsIC8vIEdldCB0aGUgcmVmZXJyYWwgY29kZSBvZiB0aGUgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1JlZmVycmFsTmFtZXMnLCAvLyBHZXQgbmFtZXMgb2YgcmVmZXJyZWQgdHJhZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyYWxSZXdhcmQnLCAvLyBHZXQgcmVmZXJyYWwgcmV3YXJkIGluZm9ybWF0aW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJlZENvZGUnLCAvLyBHZXQgcmVmZXJyYWwgY29kZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVzaWRlbnRJbmZvcm1hdGlvbicsIC8vIEdldCBTdGVwMiBEYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9TZWN1cml0eVNldHRpbmdzJywgLy8gR2V0IHZlcmlmIGRldGFpbHMgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1VzZXInLCAvLyBHZXQgYWxsIHVzZXIgaW5mb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FQSUtleS9BUElLZXknLCAvLyBHZXQgQVBJIEtleSBmb3IgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBdXRoL0Nvbm5lY3Rpb25IaXN0b3J5JywgLy8gR2V0cyBjb25uZWN0aW9uIGhpc3Rvcnkgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdCYWxhbmNlL0JhbGFuY2VzJywgLy8gR2V0cyB0aGUgYXZhaWxhYmxlIGJhbGFuY2UgZm9yIGVhY2ggY3VycmVuY3kgZm9yIHRoZSBsb2dnZWQgaW4gYWNjb3VudC5cbiAgICAgICAgICAgICAg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gICAgICAgICAgJ1RyYWRlL1VzZXJUcmFkZXMnLCAvLyBHZXRzIGFsbCB0cmFuc2FjdGlvbnMgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudEFkZHJlc3MnLCAvLyBVcGxvYWQgYWRkcmVzcyBwcm9vZiBkb2N1bWVudFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRDb3Jwb3JhdGlvbicsIC8vIFVwbG9hZCByZWdpc3RlcmVkIGRvY3VtZW50IGRvY3VtZW50XG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudElEJywgLy8gVXBsb2FkIElEIGRvY3VtZW50IGNvcHlcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0VtYWlsL1JlcXVlc3RWZXJpZnknLCAvLyBSZXF1ZXN0IGZvciB2ZXJpZmljYXRpb24gZW1haWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0VtYWlsL1ZlcmlmeScsIC8vIFZlcmlmaWNhdGlvbiBlbWFpbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvR29vZ2xlQXV0aCcsIC8vIEVuYWJsZSBnb29nbGUgYXV0aFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvTGV2ZWwnLCAvLyBSZXF1ZXN0IHZlcmlmIGxldmVsIG9mIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9RdWVzdGlvbm5haXJlJywgLy8gRmlsbCB0aGUgcXVlc3Rpb25uYWlyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyYWwnLCAvLyBQb3N0IGEgcmVmZXJyYWwgZW1haWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUElLZXkvQVBJS2V5JywgLy8gQ3JlYXRlIGEgbmV3IEFQSSBrZXkgZm9yIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXV0aC9DaGFuZ2VQYXNzd29yZCcsIC8vIENoYW5nZSBwYXNzd29yZC5cbiAgICAgICAgICAgICAgICAgICAgICAgICdBdXRoL0ZvcmdvdFBhc3N3b3JkJywgLy8gUmVxdWVzdCByZXNldCBwYXNzd29yZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0F1dGgvRm9yZ290VXNlcklEJywgLy8gUmVxdWVzdCB1c2VyIGlkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXV0aC9Mb2dpbicsIC8vIFRyYWRlciBzZXNzaW9uIGxvZyBpbi5cbiAgICAgICAgICAgICAgICAgICAgICAgICdBdXRoL0xvZ291dCcsIC8vIExvZ291dCBmcm9tIHRoZSBjdXJyZW50IHNlc3Npb24uXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXV0aC9Mb2dvdXRPdGhlclNlc3Npb25zJywgLy8gTG9nb3V0IG90aGVyIHNlc3Npb25zLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ0F1dGgvUmVzZXRQYXNzd29yZCcsIC8vIFJlc2V0IHBhc3N3b3JkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQmFuay9UcmFuc2FjdGlvbnMnLCAvLyBSZXF1ZXN0IGEgdHJhbnNmZXIgZnJvbSB0aGUgdHJhZGVycyBhY2NvdW50IG9mIHRoZSBsb2dnZWQgaW4gdXNlci4gVGhpcyBpcyBvbmx5IGF2YWlsYWJsZSBmb3IgYmFuayBhY2NvdW50XG4gICAgICAgICAgICAgICAgICAgICAgICAnQmFuay9Vc2VyQWNjb3VudHMnLCAvLyBBZGQgYW4gYWNjb3VudCB0aGUgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdFbGVjdHJvbmljV2FsbGV0L0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ICAgICAgICAgICAgICAgICAgICdOb3RpZmljYXRpb24vTWVzc2FnZXMve0lEfScsIC8vIE1hcmsgYXMgcmVhZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlL09yZGVycycsIC8vIFBsYWNlIGFuIG9yZGVyIGF0IHRoZSBleGNoYW5nZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZS9TdG9wT3JkZXJzJywgLy8gUGxhY2UgYSBzdG9wIG9yZGVyIGF0IHRoZSBleGNoYW5nZS5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0NvcnBvcmF0ZURhdGEnLCAvLyBVcGRhdGUgdXNlciBjb21wYW55IGRhdGEgZm9yIGNvcnBvcmF0ZSBhY2NvdW50XG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudElEJywgLy8gVXBkYXRlIElEIGRvY3VtZW50IG1ldGEgZGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRJbmZvcm1hdGlvbicsIC8vIFVwZGF0ZSBTdGVwMyBEYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9FbWFpbCcsIC8vIFVwZGF0ZSB1c2VyIGVtYWlsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9QZXJzb25hbEluZm9ybWF0aW9uJywgLy8gVXBkYXRlIFN0ZXAxIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1Bob25lJywgLy8gVXBkYXRlIHVzZXIgcGhvbmUgbnVtYmVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9RdWVzdGlvbm5haXJlJywgLy8gdXBkYXRlIHRoZSBxdWVzdGlvbm5haXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJlZ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Vyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlL1N0b3BPcmRlcnMve0lEfScsIC8vIENhbmNlbHMgYW4gZXhpc3Rpbmcgc3RvcCBvcmRlclxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDM1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ0JDUCc6ICdCQ1BUJyxcbiAgICAgICAgICAgICAgICAnRkxJJzogJ0ZMSVhYJyxcbiAgICAgICAgICAgICAgICAnTUFOJzogJ01BTkEnLFxuICAgICAgICAgICAgICAgICdTTFQnOiAnU0FMVCcsXG4gICAgICAgICAgICAgICAgJ1RSQSc6ICdUUkFDJyxcbiAgICAgICAgICAgICAgICAnV0dTJzogJ1dJTkdTJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0UmVmZXJlbmNlQ3VycmVuY3lQYWlycyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnY3VycmVuY3lQYWlycyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3RyYWRpbmdDb2RlJ107XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydiYXNlQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gbWFya2V0WydxdW90ZUN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwcmljZURlY2ltYWxQbGFjZXMnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRCYWxhbmNlQmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3lJZCA9IGJhbGFuY2VbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgY29kZSA9IGN1cnJlbmN5SWQ7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3lJZCBpbiB0aGlzLmN1cnJlbmNpZXNfYnlfaWQpXG4gICAgICAgICAgICAgICAgY29kZSA9IHRoaXMuY3VycmVuY2llc19ieV9pZFtjdXJyZW5jeUlkXVsnY29kZSddO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydhdmFpbGFibGVCYWxhbmNlJ10sXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiB0aGlzLnN1bSAoXG4gICAgICAgICAgICAgICAgICAgIGJhbGFuY2VbJ3BlbmRpbmdJbmNvbWluZyddLFxuICAgICAgICAgICAgICAgICAgICBiYWxhbmNlWydwZW5kaW5nT3V0Z29pbmcnXSxcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVsnb3Blbk9yZGVyJ11cbiAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VbJ2JhbGFuY2UnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQdWJsaWNNYXJrZXREZXB0aEN1cnJlbmN5UGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdDdXJyZW5jeVBhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICA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XN0Jyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2JpZCcpLFxuICAgICAgICAgICAgJ2JpZFZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYXNrJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB2d2FwLFxuICAgICAgICAgICAgJ29wZW4nOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnb3BlbicpLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQdWJsaWNMaXZlVGlja2VycyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSByZXNwb25zZVsndGlja2VycyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IHQgPSAwOyB0IDwgdGlja2Vycy5sZW5ndGg7IHQrKykge1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbdF07XG4gICAgICAgICAgICBsZXQgaWQgPSB0aWNrZXJbJ2N1cnJlbmN5UGFpciddO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFB1YmxpY0xpdmVUaWNrZXJDdXJyZW5jeVBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnQ3VycmVuY3lQYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJ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uICAgICAgICBsZXQgcHJpY2UgPSB0cmFkZVsncHJpY2UnXTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRyYWRlWydxdWFudGl0eSddO1xuICAgICAgICBsZXQgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICBsZXQgZmVlQ3VycmVuY3kgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgbWFya2V0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGZlZUN1cnJlbmN5ID0gbWFya2V0WydxdW90ZSddO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2YgZmVlQ29zdCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogZmVlQ3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ3JhdGUnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdmZWVSYXRlJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ3RyYW5zYWN0aW9uSWQnKSxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVySWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ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IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdDb2RlJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICdXYXknOiAoc2lkZSA9PT0gJ2J1eScpID8gJ0JpZCcgOiAnQXNrJyxcbiAgICAgICAgICAgICdBbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09PSAnbGltaXQnKVxuICAgICAgICAgICAgb3JkZXJbJ1ByaWNlJ10gPSBwcmljZTtcbiAgICAgICAgaWYgKHRoaXMudHdvZmEpIHtcbiAgICAgICAgICAgIGlmICgnVmFsaWRhdGlvbkNvZGUnIGluIHBhcmFtcylcbiAgICAgICAgICAgICAgICBvcmRlclsnVmFsaWRhdGlvbkNvZGUnXSA9IHBhcmFtc1snVmFsaWRhdGlvbkNvZGUnXTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgdHdvLWZhY3RvciBhdXRoZW50aWNhdGlvbiByZXF1aXJlcyBhIG1pc3NpbmcgVmFsaWRhdGlvbkNvZGUgcGFyYW1ldGVyJyk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlT3JkZXJzICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydjbE9yZGVySWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAg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ZpbmVkJykge1xuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5ICh0cmFuc2FjdGlvbnMpKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdHJhbnNhY3Rpb25zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdHJhZGUgPSB0aGlzLnBhcnNlVHJhZGUgKHRyYW5zYWN0aW9uc1tpXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHRyYWRlc0ZpbGxlZCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhZGVzRmlsbGVkID0gMC4wO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB0cmFkZXNDb3N0ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFkZXNDb3N0ID0gMC4wO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhZGVzRmlsbGVkICs9IHRyYWRlWydhbW91bnQnXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyYWRlc0Nvc3QgKz0gdHJhZGVbJ2Ftb3VudCddICogdHJhZGVbJ3ByaWNlJ107XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJ2ZlZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHRyYWRlWydmZWUnXVsnY29zdCddICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGZlZUNvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmVlQ29zdCA9IDAuMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmVlQ29zdCArPSB0cmFkZVsnZmVlJ11bJ2Nvc3QnXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmVlQ3VycmVuY3kgPSB0cmFkZVsnZmVlJ11bJ2N1cnJlbmN5J107XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB0cmFkZVsnZmVlJ11bJ3JhdGUnXSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBmZWVSYXRlID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZlZVJhdGUgPSAwLjA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZlZVJhdGUgKz0gdHJhZGVbJ2ZlZSddWydyYXRlJ107XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdHJhZGVzLnB1c2ggKHRyYWRlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKHR5cGVvZiB0cmFkZXNGaWxsZWQgIT09ICd1bmRlZmluZWQnKSAmJiAodHJhZGVzRmlsbGVkID4gMCkpXG4gICAgICAgICAgICAgICAgICAgICAgICBwcmljZSA9IHRyYWRlc0Nvc3QgLyB0cmFkZXNGaWxsZWQ7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZmVlUmF0ZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBudW1UcmFkZXMgPSB0cmFkZXMubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG51bVRyYWRlcyA+IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmVlUmF0ZSA9IGZlZVJhdGUgLyBudW1UcmFkZXM7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBmZWVDb3N0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjb3N0JzogZmVlQ29zdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBmZWVDdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAncmF0ZSc6IGZlZVJhdGUsXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICAgIC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ldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMxNzg0MDI5LTAzMTNjNzAyLWI1MDktMTFlNy05Y2NjLWJjMGRhNmEwZTQzNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9kYXRhLmdhdGUuaW8vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9kYXRhLmdhdGUuaW8vYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9nYXRlLmlvLycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dhdGUuaW8vYXBpMicsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dhdGUuaW8vZmVlJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5nYXRlLmlvL2hjL2VuLXVzL2FydGljbGVzLzExNTAwMzU3NzY3MycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGxpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckJvb2sve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVIaXN0b3J5L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlSGlzdG9yeS97aWR9L3t0aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ25ld0FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzV2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbEFsbE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMixcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRpbmZvICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHRoaXMuc2FmZVZhbHVlIChyZXNwb25zZSwgJ3BhaXJzJyk7XG4gICAgICAgIGlmICghbWFya2V0cylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaE1hcmtldHMgZ290IGFuIHVucmVjb2duaXplZCByZXNwb25zZScpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXQpO1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1swXTtcbiAgICAgICAgICAgIGxldCBkZXRhaWxzID0gbWFya2V0W2lkXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBpZC5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGJhc2UgPSBiYXNlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgcXVvdGUgPSBxdW90ZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBkZXRhaWxzWydkZWNpbWFsX3BsYWNlcyddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhbW91bnRMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IGRldGFpbHNbJ21pbl9hbW91bnQnXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtZGV0YWlsc1snZGVjaW1hbF9wbGFjZXMnXSksXG4gICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgY29zdExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogYW1vdW50TGltaXRzWydtaW4nXSAqIHByaWNlTGltaXRzWydtaW4nXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudExpbWl0cyxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZUxpbWl0cyxcbiAgICAgICAgICAgICAgICAnY29zdCc6IGNvc3RMaW1pdHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBkZXRhaWxzWydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBkZXRhaWxzWydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZSB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgY29kZSA9IHRo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hdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndXNlckFnZW50JzogdGhpcy51c2VyQWdlbnRzWydjaHJvbWUnXSxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiA2MCxcbiAgICAgICAgICAgICAgICAnNW0nOiAzMDAsXG4gICAgICAgICAgICAgICAgJzE1bSc6IDkwMCxcbiAgICAgICAgICAgICAgICAnMWgnOiAzNjAwLFxuICAgICAgICAgICAgICAgICc2aCc6IDIxNjAwLFxuICAgICAgICAgICAgICAgICcxZCc6IDg2NDAwLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICd0ZXN0JzogJ2h0dHBzOi8vYXBpLXB1YmxpYy5zYW5kYm94LmdkYXguY29tJyxcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTI3LWIxYmU0MWM2LTVlZGItMTFlNy05NWY2LTViNDk2YzQ2OWUyYy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuZ2RheC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuZ2RheC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9kb2NzLmdkYXguY29tJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmdkYXguY29tL2ZlZXMnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9zdXBwb3J0LmdkYXguY29tL2N1c3RvbWVyL2VuL3BvcnRhbC90b3BpY3MvOTM5NDAyLWRlcG9zaXRpbmctYW5kLXdpdGhkcmF3aW5nLWZ1bmRzL2FydGljbGVzJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwYXNzd29yZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9L2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0vY2FuZGxlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS9zdGF0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aW1lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L2hvbGRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L2xlZGdlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMve2lkfS90cmFuc2ZlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvaW5iYXNlLWFjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWxscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC1tZXRob2RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVwb3J0cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2Vycy9zZWxmL3RyYWlsaW5nLXZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzL2NvaW5iYXNlLWFjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzL3BheW1lbnQtbWV0aG9kJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb2luYmFzZS1hY2NvdW50cy97aWR9L2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZy9yZXBheScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9jbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZmlsZXMvbWFyZ2luLXRyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXBvcnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9jb2luYmFzZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMvY3J5cHRvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9wYXltZW50LW1ldGhvZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsIC8vIGNvbXBsaWNhdGVkIHRpZXIgc3lzdGVtIHBlciBjb2luXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjMgLyAxMDAsIC8vIHRpZXJlZCBmZWUgc3RhcnRzIGF0IDAuMyVcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAuMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogMjUsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMC4xNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiAxMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFByb2R1Y3RzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnYmFzZV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydxdW90ZV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ3F1b3RlX2luY3JlbWVudCcpLFxuICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKHRoaXMuc2FmZVN0cmluZyAobWFya2V0LCAncXVvdGVfaW5jcmVtZW50JykpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCB0YWtlciA9IHRoaXMuZmVlc1sndHJhZGluZyddWyd0YWtlciddOyAgLy8gZG9lcyBub3Qgc2VlbSByaWdodFxuICAgICAgICAgICAgaWYgKChiYXNlID09PSAnRVRIJykgfHwgKGJhc2UgPT09ICdMVEMnKSkge1xuICAgICAgICAgICAgICAgIHRha2VyID0gMC4wMDM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gbWFya2V0WydzdGF0dXMnXSA9PT0gJ29ubGluZSc7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdiYXNlX21pbl9zaXplJyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ2Jhc2VfbWF4X3NpemUnKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5fbWFya2V0X2Z1bmRzJyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heF9tYXJrZXRfZnVuZHMnKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiB0aGlzLnNhZmVGbG9hdCAoYmFsYW5jZSwgJ2F2YWlsYWJsZScpLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdGhpcy5zYWZlRmxvYXQgKGJhbGFuY2UsICdob2xkJyksXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogdGhpcy5zYWZlRmxvYXQgKGJhbGFuY2UsICdiYWxhbmNlJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQcm9kdWN0c0lkQm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gIC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ICdvcmRlcic6IG9yZGVySWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGlzbzg2MDEsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAncHJpY2UnKSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdzaXplJyksXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTXlUcmFkZXMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHt9O1xuICAgICAgICBpZiAodHlwZW9mIHN5bWJvbCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICAgICAgcmVxdWVzdFsncHJvZHVjdF9pZCddID0gbWFya2V0WydpZCddO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2YgbGltaXQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgcmVxdWVzdFsnbGltaXQnXSA9IGxpbWl0O1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRGaWxscyAodGhpcy5leHRl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ywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICBsZXQgcmF0ZSA9IG1hcmtldFt0YWtlck9yTWFrZXJdO1xuICAgICAgICBsZXQgY29zdCA9IGFtb3VudCAqIHByaWNlO1xuICAgICAgICBsZXQgY3VycmVuY3kgPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndHlwZSc6IHRha2VyT3JNYWtlcixcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgJ3JhdGUnOiByYXRlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0ICh0aGlzLmZlZVRvUHJlY2lzaW9uIChjdXJyZW5jeSwgcmF0ZSAqIGNvc3QpKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBnZXRQYXltZW50TWV0aG9kcyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldFBheW1lbnRNZXRob2RzICgpO1xuICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgfVxuXG4gICAgYXN5bmMgZGVwb3NpdCAoY3VycmVuY3ksIGFtb3VudCwgYWRkcmVzcywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3REZXBvc2l0cyc7XG4gICAgICAgIGlmICgncGF5bWVudF9tZXRob2RfaWQnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgLy8gZGVwb3NpdCBmcm9tI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pKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSByZXNwb25zZVsnbWVzc2FnZSddO1xuICAgICAgICAgICAgICAgIGxldCBlcnJvciA9IHRoaXMuaWQgKyAnICcgKyBtZXNzYWdlO1xuICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlLmluZGV4T2YgKCdwcmljZSB0b28gc21hbGwnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGVycm9yKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ3ByaWNlIHRvbyBwcmVjaXNlJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyIChlcnJvcik7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnSW5zdWZmaWNpZW50IGZ1bmRzJykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKGVycm9yKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UgPT09ICdOb3RGb3VuZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKGVycm9yKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UgPT09ICdJbnZhbGlkIEFQSSBLZXknKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yIChlcnJvcik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkIC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IGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdnZW1pbmknLFxuICAgICAgICAgICAgJ25hbWUnOiAnR2VtaW5pJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnVVMnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsIC8vIDIwMCBmb3IgcHJpdmF0ZSBBUElcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQmlkc0Fza3MnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzgxNjg1Ny1jZTdiZTY0NC02MDk2LTExZTctODJkNi0zYzI1NzI2MzIyOWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmdlbWluaS5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9nZW1pbmkuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9kb2NzLmdlbWluaS5jb20vcmVzdC1hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9kb2NzLnNhbmRib3guZ2VtaW5pLmNvbScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAndGVzdCc6ICdodHRwczovL2FwaS5zYW5kYm94LmdlbWluaS5jb20nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9nZW1pbmkuY29tL2ZlZS1zY2hlZHVsZS8nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9nZW1pbmkuY29tL3RyYW5zZmVyLWZlZXMvJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2xzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwdWJ0aWNrZXIve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXVjdGlvbi97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXVjdGlvbi97c3ltYm9sfS9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsL3Nlc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteXRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGV2b2x1bWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0L3tjdXJyZW5jeX0vbmV3QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGVhcnRiZWF0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFN5bWJvbHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IGlkO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IG1hcmtldC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdXBwZXJjYXNlLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHVwcGVyY2FzZS5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEJvb2tTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcG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sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2F2YWlsYWJsZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnQnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgYWxsb3dzIGxpbWl0IG9yZGVycyBvbmx5Jyk7XG4gICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdjbGllbnRfb3JkZXJfaWQnOiBub25jZS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2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HJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ3R4SGFzaCcpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9ICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdyZXF1ZXN0JzogdXJsLFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcXVlcnkpO1xuICAgICAgICAgICAgbGV0IHBheWxvYWQgPSB0aGlzLmpzb24gKHJlcXVlc3QpO1xuICAgICAgICAgICAgcGF5bG9hZCA9IHRoaXMuc3RyaW5nVG9CYXNlNjQgKHRoaXMuZW5jb2RlIChwYXlsb2FkKSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjIChwYXlsb2FkLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMzg0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAndGV4dC9wbGFpbicsXG4gICAgICAgICAgICAgICAgJ1gtR0VNSU5JLUFQSUtFWSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdYLUdFTUlOSS1QQVlMT0FEJzogdGhpcy5kZWNvZGUgKHBheWxvYWQpLFxuICAgICAgICAgICAgICAgICdYLUdFTUlOSS1TSUdOQVRVUkUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyB1cmw7XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgncmVzdWx0JyBpbiByZXNwb25zZSlcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsncmVzdWx0J10gPT09ICdlcnJvcicpXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiA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J0YyBleHRlbmRzIF8xYnRjeGUge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdnZXRidGMnLFxuICAgICAgICAgICAgJ25hbWUnOiAnR2V0QlRDJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdWQycsICdSVScgXSwgLy8gU2FpbnQgVmluY2VudCBhbmQgdGhlIEdyZW5hZGluZXMsIFJ1c3NpYSwgQ0lTXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzM4MDE5MDItMDNjNDM0NjItZGQ3Yi0xMWU3LTk5MmUtMDc3ZTRjZDAxNWI5LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2dldGJ0Yy5vcmcvYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vZ2V0YnRjLm9yZycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dldGJ0Yy5vcmcvYXBpLWRvY3MucGhwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaFRyYWRlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMjAgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMjAgLyAxMD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zOi8vZ2l0aHViLmNvbS9odW9iaWFwaS9BUElfRG9jcy93aWtpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGFkYXgvY29tbW9uL3N5bWJvbHMnLCAvLyDmn6Xor6Lns7vnu5/mlK/mjIHnmoTmiYDmnInkuqTmmJPlr7lcbiAgICAgICAgICAgICAgICAgICAgICAgICdoYWRheC9jb21tb24vY3VycmVuY3lzJywgLy8g5p+l6K+i57O757uf5pSv5oyB55qE5omA5pyJ5biB56eNXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL3RpbWVzdGFtcCcsIC8vIOafpeivouezu+e7n+W9k+WJjeaXtumXtFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hhZGF4L3NldHRpbmdzL2N1cnJlbmN5cycsIC8vID9sYW5ndWFnZT1lbi1VU1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ29wdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoTWFya2V0c01ldGhvZCc6ICdwdWJsaWNHZXRIYWRheENvbW1vblN5bWJvbHMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbmNvbnN0IEV4Y2hhbmdlID0gcmVxdWlyZSAoJ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c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjU1NS04ZWFlYzIwZS01ZWRjLTExZTctOWM1Yi02ZGM2OWZjNDJmNWUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHA6Ly9hcGkuaGl0YnRjLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2hpdGJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2hpdGJ0Yy1jb20vaGl0YnRjLWFwaS9ibG9iL21hc3Rlci9BUEl2MS5tZCcsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2hpdGJ0Yy5jb20vZmVlcy1hbmQtbGltaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5oaXRidGMuY29tL2hjL2VuLXVzL2FydGljbGVzLzExNTAwNTE0ODYwNS1GZWVzLWFuZC1saW1pdHMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tzeW1ib2x9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3N5bWJvbH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7c3ltYm9sfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tzeW1ib2x9L3RyYWRlcy9yZWNlbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGltZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvYWN0aXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvcmVjZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL2J5L29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICduZXdfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncGF5bWVudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhZGRyZXNzL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zL3t0cmFuc2FjdGlvbn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2Zlcl90b190cmFkaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2Zlcl90b19tYWluJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhZGRyZXNzL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW91dCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBoYXJkY29kZWQgZmVlcyBhcmUgZGVwcmVjYXRlZCBhbmQgc2hvdWxkIG9ubHkgYmUgdXNlZCB3aGVuIHRoZXJlJ3Mgbm8gb3RoZXIgd2F5IHRvIGdldCBmZWUgaW5mb1xuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAtMC4wMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDQyc6IDAuMDAxOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMjE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAxOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICcxU1QnOiAwLjg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEWCc6IDUuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRSc6IDYuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRU9OJzogMC4wMTAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSVInOiA1NjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU1QJzogOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTlQnOiA2LjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJEUic6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJOJzogMTguNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUlQnOiAyNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEInOiAwLjAwMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRMJzogMjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRNJzogNTA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUUyc6IDg2MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAxLjksXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFTJzogMTEzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDTic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCRVQnOiAxMjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQktCJzogNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1DJzogMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1UJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDIuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlFYJzogNC43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUWCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVTJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0NUJzogMTE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEVCc6IDEwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRFgnOiAzMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRkknOiA2MSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTEQnOiAwLjg4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NORCc6IDU3NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTlgnOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPU1MnOiA2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDU05PJzogMTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RSJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RYJzogMTQ2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NWQyc6IDguNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREJJWCc6IDAuMDE2OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ04nOiAxMjAwMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENUJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEREYnOiAzNDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREVOVCc6IDYyNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdCJzogMC40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHRCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRElDRSc6IDAuMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRExUJzogMC4yNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlQnOiAwLjIxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPVic6IDM0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSUFUnOiAyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlQnOiAyNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFNIJzogMC4wMTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJFVCc6IDg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVEMnOiAyMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQlRDT0xEJzogNi42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VDQVQnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFREcnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDIuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTEUnOiAwLjAwMTcyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMTSc6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNQyc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1HTyc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOSic6IDE2MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAxLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRCUyc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDUuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWE4nOiA0NTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlJEJzogNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVFTCc6IDEyMy4wMDEwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAyMDIuOTU5ODMwOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWU4nOiAxLjg0OSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWVAnOiA2Ni4xMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLjAwMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1VQJzogNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVlQnOiAxLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEFDJzogMTQ0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hERyc6IDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEdUJzogMTA4MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdIUEMnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFZOJzogMTIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAuNTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPUyc6IDAuMzUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5EJzogNzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5ESSc6IDU5MTMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVRTJzogMTUuMDAxMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdJWFQnOiAxMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLQlInOiAxNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0lDSyc6IDExMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQSc6IDQxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBVCc6IDEuNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElGRSc6IDEzMDAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDI3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xTSyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVU4nOiAwLjM0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BSUQnOiA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BTkEnOiAxNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNBUCc6IDUuNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlQUyc6IDQzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ORSc6IDEuMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVNQJzogMTIxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDkyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ZQic6IDMuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOREMnOiAxNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVCTCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVUJzogMy45NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVE8nOiA5OTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhDJzogMTMuMzksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPQVgnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPRE4nOiAwLjAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09QVCc6IDMzNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUk1FJzogMi44LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09UTic6IDAuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFZJzogMy4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJWCc6IDk2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMQlQnOiAwLjMzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMUic6IDExNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFUnOiAwLjg3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPRSc6IDc4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0xMJzogMy41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQVCc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJFJzogMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJHJzogMzksXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJPJzogNDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJTJzogNjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFRPWSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVUnOiA2MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQ04nOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FWVCc6IDY0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUCc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUktDJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlZUJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMi4yNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQkQnOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NDTCc6IDIuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSVNBJzogMTY0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS0lOJzogNDA3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNQVJUJzogMC40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNUyc6IDAuMDM3NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkMnOiAzNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogNDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMjMzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NURUVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RVJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RYJzogMTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VCJzogMTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VSJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTV1QnOiAwLjUxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RBQVMnOiAwLjkxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RCVCc6IDIuMzcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEZMJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElNRSc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElYJzogNy4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RLTic6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtSJzogODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5UJzogOTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJTVCc6IDEuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAxMzk1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VFVCc6IDQ4MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVR1QnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRVJJJzogMC4wMzcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCJzogNTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCRSc6IDE0NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT0lTRSc6IDYxOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXRUFMVEgnOiAwLjAxNjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOR1MnOiAyLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMC43NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVVSJzogMy4yMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRE4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hFTSc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hVQyc6IDAuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdZT1lPVyc6IDE0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaQVAnOiAyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAyMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaU0MnOiAxOTEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnMVNUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRU9OJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUkRSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUk4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JBUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCRVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JLQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlFYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVE0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQ1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRkknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NMRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05EJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPU1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NTTk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RCSVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEREYnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RFTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdESUNFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9WJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlBVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RTSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJFVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQ09MRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUNBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRE8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNR08nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOSic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFUk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQlMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VYTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlJEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVUVMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRllQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dVUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1ZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIQUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hERyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEdUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIUEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hWTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ08nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDT1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lORCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5ESSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVRTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJWFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tCUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0lDSyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEEnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElGRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFJDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMU0snOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xVTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFJRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFOQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNBUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlQUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU5FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNU1AnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVlCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOREMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FQkwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlRPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05YVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0FYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPRE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1BUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUk1FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPVE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BBWSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUElYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTEJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0xMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFRPWSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSS0MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NDTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0lTQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0tJTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01BUlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NURUVNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTV1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RBQVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RCVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEZMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSU1FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RLTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSU1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVR1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVSSSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUJFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT0lTRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0VBTFRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXSU5HUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVVSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hFTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFVDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdZT1lPVyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkFQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pTQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnQkNDJzogJ0JDQycsXG4gICAgICAgICAgICAgICAgJ1hCVCc6ICdCVEMnLFxuICAgICAgICAgICAgICAgICdEUksnOiAnREFTSCcsXG4gICAgICAgICAgICAgICAgJ0NBVCc6ICdCaXRDbGF2ZScsXG4gICAgICAgICAgICAgICAgJ1VTRCc6ICdVU0RUJyxcbiAgICAgICAgICAgICAgICAnRU1HTyc6ICdNR08nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFN5bWJvbHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWydzeW1ib2xzJ10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydzeW1ib2xzJ11bcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnY29tbW9kaXR5J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBsb3QgPSB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbG90Jyk7XG4gICAgICAgICAgICBsZXQgc3RlcCA9IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdzdGVwJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnc3RlcCc6IHN0ZXAsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ3Byb3ZpZGVMaXF1aWRpdHlSYXRlJyksXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ3Rha2VMaXF1aWRpdHlSYXRlJyksXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0Wydsb3QnXSksXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0WydzdGVwJ10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogc3RlcCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWV0aG9kID0gdGhpcy5zYWZlU3RyaW5nIChwYXJhbXMsICd0eXBlJywgJ3RyYWRpbmcnKTtcbiAgICAgICAgbWV0aG9kICs9ICdHZXRCYWxhbmNlJztcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsICd0eXBlJyk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAocXVlcnkpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZ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gPSBwcmljZSAqIGFtb3VudDtcbiAgICAgICAgbGV0IGZlZSA9IHtcbiAgICAgICAgICAgICdjb3N0JzogdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnZmVlJyksXG4gICAgICAgICAgICAnY3VycmVuY3knOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncmF0ZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRyYWRlWyd0aW1lc3RhbXAnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndHJhZGVJZCddLFxuICAgICAgICAgICAgJ29yZGVyJzogdHJhZGVbJ2NsaWVudE9yZGVySWQnXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2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Blb2YgYW1vdW50ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3F1YW50aXR5Jyk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdxdWFudGl0eUxlYXZlcycpO1xuICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZyA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdsZWF2ZXNRdWFudGl0eScpO1xuICAgICAgICBsZXQgZmlsbGVkID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGFtb3VudERlZmluZWQgPSAodHlwZW9mIGFtb3VudCAhPT0gJ3VuZGVmaW5lZCcpO1xuICAgICAgICBsZXQgcmVtYWluaW5nRGVmaW5lZCA9ICh0eXBlb2YgcmVtYWluaW5nICE9PSAndW5kZWZpbmVkJyk7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBpZiAoYW1vdW50RGVmaW5lZClcbiAgICAgICAgICAgICAgICBhbW91bnQgKj0gbWFya2V0Wydsb3QnXTtcbiAgICAgICAgICAgIGlmIChyZW1haW5pbmdEZWZpbmVkKVxuICAgICAgICAgICAgICAgIHJlbWFpbmluZyAqPSBtYXJrZXRbJ2xvdCddO1xuICAgICAgICB9XG4gICAgICAgIGlmIChhbW91bnREZWZpbmVkKSB7XG4gICAgICAgICAgICBpZiAocmVtYWluaW5nRGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgICAgICAgICBjb3N0ID0gYXZlcmFnZVByaWNlICogZmlsbGVkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnY2xpZW50T3JkZXJJZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy50cmFkaW5nR2V0T3JkZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY2xpZW50T3JkZXJJZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgaWYgKHJlc3BvbnNlWydvcmRlcnMnXVswXSk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AgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBheWxvYWQpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB1cmw7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgICAgIGF1dGggKz0gYm9keTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnWC1TaWduYXR1cmUnOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgdXJsO1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJ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gIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnTTEnLFxuICAgICAgICAgICAgICAgICczbSc6ICdNMycsXG4gICAgICAgICAgICAgICAgJzVtJzogJ001JyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJ00xNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICdNMzAnLCAvLyBkZWZhdWx0XG4gICAgICAgICAgICAgICAgJzFoJzogJ0gxJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnSDQnLFxuICAgICAgICAgICAgICAgICcxZCc6ICdEMScsXG4gICAgICAgICAgICAgICAgJzF3JzogJ0Q3JyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1NTUtOGVhZWMyMGUtNWVkYy0xMWU3LTljNWItNmRjNjlmYzQyZjVlLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5oaXRidGMuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vaGl0YnRjLmNvbS8/cmVmX2lkPTVhNWQzOWE2NWQ0NjYnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9hcGkuaGl0YnRjLmNvbScsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2hpdGJ0Yy5jb20vZmVlcy1hbmQtbGltaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5oaXRidGMuY29tL2hjL2VuLXVzL2FydGljbGVzLzExNTAwNTE0ODYwNS1GZWVzLWFuZC1saW1pdHMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCcsIC8vIEF2YWlsYWJsZSBDdXJyZW5jeSBTeW1ib2xzXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sL3tzeW1ib2x9JywgLy8gR2V0IHN5bWJvbCBpbmZvXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knLCAvLyBBdmFpbGFibGUgQ3VycmVuY2llc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L3tjdXJyZW5jeX0nLCAvLyBHZXQgY3VycmVuY3kgaW5mb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsIC8vIFRpY2tlciBsaXN0IGZvciBhbGwgc3ltYm9sc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97c3ltYm9sfScsIC8vIFRpY2tlciBmb3Igc3ltYm9sXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3tzeW1ib2x9JywgLy8gVHJhZGVzXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rL3tzeW1ib2x9JywgLy8gT3JkZXJib29rXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuZGxlcy97c3ltYm9sfScsIC8vIENhbmRsZXNcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJywgLy8gTGlzdCB5b3VyIGN1cnJlbnQgb3BlbiBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci97Y2xpZW50T3JkZXJJZH0nLCAvLyBHZXQgYSBzaW5nbGUgb3JkZXIgYnkgY2xpZW50T3JkZXJJZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmcvYmFsYW5jZScsIC8vIEdldCB0cmFkaW5nIGJhbGFuY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nL2ZlZS97c3ltYm9sfScsIC8vIEdldCB0cmFkaW5nIGZlZSByYXRlXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS90cmFkZXMnLCAvLyBHZXQgaGlzdG9yaWNhbCB0cmFkZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L29yZGVyJywgLy8gR2V0IGhpc3RvcmljYWwgb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS9vcmRlci97aWR9L3RyYWRlcycsIC8vIEdldCBoaXN0b3JpY2FsIHRyYWRlcyBieSBzcGVjaWZpZWQgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2JhbGFuY2UnLCAvLyBHZXQgbWFpbiBhY2Njb3VudCBiYWxhbmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC90cmFuc2FjdGlvbnMnLCAvLyBHZXQgYWNjb3VudCB0cmFuc2FjdGlvbnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3RyYW5zYWN0aW9ucy97aWR9JywgLy8gR2V0IGFjY291bnQgdHJhbnNhY3Rpb24gYnkgaWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by9hZGRyZXNzL3tjdXJyZW5jeX0nLCAvLyBHZXQgZGVwb3NpdCBjcnlwcm8gYWRkcmVzc1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsIC8vIENyZWF0ZSBuZXcgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by93aXRoZHJhdycsIC8vIFdpdGhkcmF3IGNyeXByb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvY3J5cHRvL2FkZHJlc3Mve2N1cnJlbmN5fScsIC8vIENyZWF0ZSBuZXcgZGVwb3NpdCBjcnlwcm8gYWRkcmVzc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvdHJhbnNmZXInLCAvLyBUcmFuc2ZlciBhbW91bnQgdG8gdHJhZGluZ1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIENyZWF0ZSBuZXcgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by93aXRoZHJhdy97aWR9JywgLy8gQ29tbWl0IHdpdGhkcmF3IGNyeXByb1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJywgLy8gQ2FuY2VsIGFsbCBvcGVuIG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIENhbmNlbCBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvY3J5cHRvL3dpdGhkcmF3L3tpZH0nLCAvLyBSb2xsYmFjayB3aXRoZHJhdyBjcnlwcm9cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3BhdGNoJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIENhbmNlbCBSZXBsYWNlIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IC0wLjAxIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNDJzogMC4wMDE4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDA5NTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDE4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAxMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAuNTA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLjA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJzFTVCc6IDAuODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQURYJzogNS43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFJzogNi43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFT04nOiAwLjAxMDA2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FJUic6IDU2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTU0nOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTVAnOiAzNDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU5UJzogNi43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSRFInOiAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSTic6IDE4LjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJUJzogMjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRCJzogMC4wMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUTCc6IDI3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUTSc6IDUwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVFMnOiA4NjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMS45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JBUyc6IDExMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ04nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkVUJzogMTI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JLQic6IDQ2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JNQyc6IDMyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JNVCc6IDEwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTlQnOiAyLjU3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JRWCc6IDQuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVENBJzogMzUxLjIxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUWCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVTJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0FQUCc6IDk3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NDVCc6IDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RUJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEWCc6IDMwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NGSSc6IDYxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NMJzogMTMuODUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0xEJzogMC44OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTkQnOiA1NzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05YJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDT1NTJzogNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1BBWSc6IDUuNDg3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NTTk8nOiAxNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFInOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFgnOiAxNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1ZDJzogOC40NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVRBJzogMTIuOTQ5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RCSVgnOiAwLjAxNjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENOJzogMTI4MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ1QnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RERic6IDM0MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdERU5UJzogMTAwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0InOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdEJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdESUNFJzogMC4zMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdETFQnOiAwLjI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROVCc6IDAuMjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9WJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJQVSc6IDI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSVCc6IDI0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEU0gnOiAwLjAxNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQkVUJzogODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQyc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVENPTEQnOiA2LjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUNBVCc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VERyc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMi45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VLTyc6IDExMzYuMzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxFJzogMC4wMDE3MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTE0nOiAwLjAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUMnOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01HTyc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOSic6IDE2MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAxLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRCUyc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDUuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWE4nOiA0NTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRkNOJzogMC4wMDAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlJEJzogNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVFTCc6IDEyMy4wMDEwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAyMDIuOTU5ODMwOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWU4nOiAxLjg0OSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWVAnOiA2Ni4xMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQU1FJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05PJzogMC4wMDM0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dVUCc6IDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1ZUJzogMS4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEFDJzogMTQ0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hERyc6IDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEdUJzogMTA4MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdIUEMnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFZOJzogMTIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAuNTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPUyc6IDAuMzUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5EJzogNzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5ESSc6IDc5MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJVFMnOiAxNS4wMDEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lYVCc6IDExLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tCUic6IDE0MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogMTEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tNRCc6IDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEEnOiA0MSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMRU5EJzogMzg4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBVCc6IDEuNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElGRSc6IDEzMDAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDI3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xTSyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMT0MnOiAxMS4wNzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFVOJzogMC4zNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQUlEJzogNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQU5BJzogMTQzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DQVAnOiA1LjQ0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01JUFMnOiA0MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNTkUnOiAxLjMzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01TUCc6IDEyMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQ08nOiAwLjM1NyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEgnOiA5MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdNWUInOiAzLjksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkRDJzogMTY1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FQkwnOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FVCc6IDMuOTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlRPJzogOTk4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05HQyc6IDIuMzY4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05YQyc6IDEzLjM5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05YVCc6IDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0FYJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0ROJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUFQnOiAzMzUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1JNRSc6IDIuOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPVE4nOiAwLjU3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BBWSc6IDMuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQSVgnOiA5NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTEJUJzogMC4zMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFInOiAxMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExVJzogMC44NyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0UnOiA3ODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9MTCc6IDMuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUFQnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRSc6IDMyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRyc6IDM5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSTyc6IDQxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSUyc6IDYwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BUT1knOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFVJzogNjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUNOJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVlQnOiA2NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRVAnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JLQyc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JMQyc6IDEuMjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlZUJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0MnOiAzMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAyLjI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NCRCc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0NMJzogMi42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NJU0EnOiAxNjQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NLSU4nOiA0MDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1dGVEMnOiAzNTIuOTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01BUlQnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01TJzogMC4wMzc1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOQyc6IDM2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOR0xTJzogNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTk0nOiA0OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAyMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RBUic6IDAuMTQ0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUT1JNJzogMTUzLjE5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NURUVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1BGJzogMTQuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFUnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFgnOiAxMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiAxNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVVInOiAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NXVCc6IDAuNTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEFBUyc6IDAuOTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEJUJzogMi4zNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdURkwnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSU1FJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSVgnOiA3LjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtOJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUR1QnOiAxNzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtSJzogODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5UJzogOTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJTVCc6IDEuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAyNzAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUVUJzogNDgwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VHVCc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VUVCc6IDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVOJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVSSSc6IDAuMDM3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQic6IDUwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQkUnOiAxNDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVk9JU0UnOiA2MTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0VBTFRIJzogMC4wMTY4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dJTkdTJzogMi40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dUQyc6IDAuNzUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1JDJzogNDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEFVUic6IDMuMjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEROJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRU0nOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYVUMnOiAwLjksXG4gICAgICAgICAgICAgICAgICAgICAgICAnWU9ZT1cnOiAxNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkFQJzogMjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlJYJzogMjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlNDJzogMTkxLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJzFTVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQURYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUVPTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUlSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJEUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVE0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCS0InOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JNQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JRWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JVUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0NUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0ZJJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTEQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NORCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05YJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDT1NTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDU05PJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1ZDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQklYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRERGJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdERU5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0InOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRElDRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRExUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPVic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJQVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEU0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCRVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVENPTEQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VDQVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VERyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTEUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUdPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTkonOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEJTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVZYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZSRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVFTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05PJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEFDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIREcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hHVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFBDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIVk4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ09TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lOREknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lUUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVhUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLQlInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tJQ0snOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xJRkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFNLJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BSUQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BTkEnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DQVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01JUFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ORSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVNQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ZQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORUJMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05UTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09BWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0ROJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09QVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1JNRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1ROJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExCVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9MTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUlMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BUT1knOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FBVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUktDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NBTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0JEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQ0wnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NJU0EnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NLSU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNQVJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05HTFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVEVFTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RSQVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1dUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUQUFTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUQlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RGTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElNRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUS04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RLUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlNUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VFVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUdUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFUkknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVk9JU0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dFQUxUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOR1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEFVUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEROJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRU0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hVQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWU9ZT1cnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pBUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlJYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaU0MnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBmZWVUb1ByZWNpc2lvbiAoc3ltYm9sLCBmZWUpIHtcbiAgICAgICAgcm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0eUluY3JlbWVudCddKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgdGFrZXIgPSB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAndGFrZUxpcXVpZGl0eVJhdGUnKTtcbiAgICAgICAgICAgIGxldCBtYWtlciA9IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdwcm92aWRlTGlxdWlkaXR5UmF0ZScpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ3N0ZXAnOiBzdGVwLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogc3RlcCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCAqIHN0ZXAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDdXJyZW5jeSAocGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jeVsnaWQnXTtcbiAgICAgICAgICAgIC8vIHRvZG86IHdpbGwgbmVlZCB0byByZXRoaW5rIHRoZSBmZWVzXG4gICAgICAgICAgICAvLyB0byBhZGQgc3VwcG9ydCBmb3IgbXVsdGlwbGUgd2l0aGRyYXdhbC9kZXBvc2l0IG1ldGhvZHMgYW5kXG4gICAgICAgICAgICAvLyBkaWZmZXJlbnRpYXRlZCBmZWVzIGZvciBlYWNoIHBhcnRpY3VsYXIgbWV0aG9kXG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0gODsgLy8gZGVmYXVsdCBwcmVjaXNpb24sIHRvZG86IGZpeCBcIm1hZ2ljIGNvbnN0YW50c1wiXG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChpZCk7XG4gICAgICAgICAgICBsZXQgcGF5aW4gPSB0aGlzLnNhZmVWYWx1ZSAoY3VycmVuY3ksICdwYXlpbkVuYWJsZWQnKTtcbiAgICAgICAgICAgIGxldCBwYXlvdXQgPSB0aGlzLnNhZmVWYWx1ZSAoY3VycmVuY3ksICdwYXlvdXRFbmFibGVkJyk7XG4gICAgICAgICAgICBsZXQgdHJhbnNmZXIgPSB0aGlzLnNhZmVWYWx1ZSAoY3VycmVuY3ksICd0cmFuc2ZlckVuYWJsZWQnKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSBwYXlpbiAmJiBwYXlvdXQgJiYgdHJhbnNmZXI7XG4gICAgICAgICAgICBsZXQgc3RhdHVzID0gJ29rJztcbiAgICAgICAgICAgIGlmICgnZGlzYWJsZWQnIGluIGN1cnJlbmN5KVxuICAgICAgICAgICAgICAgIGlmIChjdXJyZW5jeVsnZGlzYWJsZWQnXSlcbiAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gJ2Rpc2FibGVkJztcbiAgICAgICAgICAgIGxldCB0eXBlID0gJ2ZpYXQnO1xuICAgICAgICAgICAgaWYgKCgnY3J5cHRvJyBpbiBjdXJyZW5jeSkgJiYgY3VycmVuY3lbJ2NyeXB0byddKVxuICAgICAgICAgICAgICAgIHR5cGUgPSAnY3J5cHRvJztcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgICAgICdwYXlpbic6IHBheWluLFxuICAgICAgICAgICAgICAgICdwYXlvdXQnOiBwYXlvdXQsXG4gICAgICAgICAgICAgICAgJ3RyYW5zZmVyJzogdHJhbnNmZXIsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WydmdWxsTmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAnZmVlJzogdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAncGF5b3V0RmVlJyksIC8vIHRvZG86IHJlZGVzaWduXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdHlwZSA9IHRoaXMuc2FmZVN0cmluZyAocGFyYW1zLCAndHlwZScsICd0cmFkaW5nJyk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZUdldCcgKyB0aGlzLmNhcGl0YWxpemUgKHR5cGUpICsgJ0JhbGFuY2UnO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzW21ldGhvZF0gKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjb2RlKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlJ10pLFxuICAgICAgICAgICAgICAgICd1c2VkJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsncmVzZXJ2ZWQnXSksXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogMC4wLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGFjY291bnRb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tlclN5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBpZiAoJ21lc3NhZ2UnIGluIHRpY2tlcilcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGlja2VyWydtZXNzYWdlJ10pO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsndGltZXN0YW1wJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IGlkID0gdHJhZGVbJ3N5bWJvbCddO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZlZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdmZWUnIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBtYXJrZXQgPyBtYXJrZXRbJ3F1b3RlJ10gOiB1bmRlZmluZWQ7XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdmZWUnKSxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG9yZGVySWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnY2xpZW50T3JkZXJJZCcgaW4gdHJhZGUpXG4gICAgICAgICAgICBvcmRlcklkID0gdHJhZGVbJ2NsaWVudE9yZGVySWQnXTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3F1YW50aXR5Jyk7XG4gICAgICAgIGxldCBjb3N0ID0gcHJpY2UgKiBhbW91bnQ7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcklkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAg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AgICAgfSBlbHNlIGlmIChzdGF0dXMgPT09ICdzdXNwZW5kZWQnKSB7XG4gICAgICAgICAgICBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09PSAncGFydGlhbGx5RmlsbGVkJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICB9IGVsc2UgaWYgKHN0YXR1cyA9PT0gJ2ZpbGxlZCcpIHtcbiAgICAgICAgICAgIHN0YXR1cyA9ICdjbG9zZWQnO1xuICAgICAgICB9XG4gICAgICAgIGxldCBpZCA9IG9yZGVyWydjbGllbnRPcmRlcklkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlJyk7XG4gICAgICAgIGlmICh0eXBlb2YgcHJpY2UgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5vcmRlcnMpXG4gICAgICAgICAgICAgICAgcHJpY2UgPSB0aGlzLm9yZGVyc1tpZF1bJ3ByaWNlJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgYW1vdW50ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBmaWxsZWQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcHJpY2UgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvc3QgPSBmaWxsZWQgKiBwcmljZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAg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gPSB7fSkge1xuICAgICAgICB0aGlzLmNoZWNrQWRkcmVzcyAoYWRkcmVzcyk7XG4gICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY3VycmVuY3kgKGNvZGUpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5WydpZCddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHBhcnNlRmxvYXQgKGFtb3VudCksXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0YWcpXG4gICAgICAgICAgICByZXF1ZXN0WydwYXltZW50SWQnXSA9IHRhZztcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEFjY291bnRDcnlwdG9XaXRoZHJhdyAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9ICcvYXBpJyArICcvJyArIHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IGFwaSArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgdXJsICs9IHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdHRVQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IHRoaXMuZW5jb2RlICh0aGlzLmFwaUtleSArICc6JyArIHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gdGhpcy5zdHJpbmdUb0Jhc2U2NCAocGF5bG9hZCk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBdXRob3JpemF0aW9uJzogJ0Jhc2ljICcgKyB0aGlzLmRlY29kZSAoYXV0aCksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHVybDtcbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBib2R5ICE9PSAnc3RyaW5nJylcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgaWYgKGNvZGUgPj0gNDAwKSB7XG4gICAgICAgICAgICBjb25zdCBmZWVkYmFjayA9IHRoaXMuaWQgKyAnICcgKyBib2R5O1xuICAgICAgICAgICAgLy8ge1wiY29kZVwiOjUwNCxcIm1lc3NhZ2VcIjpcIkdhdGV3YXkgVGltZW91dFwiLFwiZGVzY3JpcHRpb25cIjpcIlwifVxuICAgICAgICAgICAgaWYgKChjb2RlID09PSA1MDMpIHx8IChjb2RlID09PSA1MDQpKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZU5vdEF2YWlsYWJsZSAoZmVlZGJhY2spO1xuICAgICAgICAgICAgaWYgKGJvZHlbMF0gPT09ICd7Jykge1xuICAgICAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2VbJ2Vycm9yJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gcmVzcG9uc2VbJ2Vycm9yJ11bJ21lc3NhZ2UnXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlID09PSAnT3JkZXIgbm90IGZvdW5kJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyBvcmRlciBub3QgZm91bmQgaW4gYWN0aXZlIG9yZGVycycpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnUXVhbnRpdHkgbm90IGEgdmFsaWQgbnVtYmVyJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ0luc3VmZmljaWVudCBmdW5kcycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ0R1cGxpY2F0ZSBjbGllbnRPcmRlcklkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yIChmZWVkYmFjayk7XG4gICAgICAgIH1cbiAgICB9XG59O1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbmNvbnN0IEV4Y2hhbmdlID0gcmVxdWlyZSAoJy4vYmFzZS9FeGNoYW5nZScpO1xuY29uc3QgeyBFeGNoYW5nZUVycm9yIH0gPSByZXF1aXJlICgnLi9iYXNlL2Vycm9ycycpO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgaHVvYmkgZXh0ZW5kcyBFeGNoYW5nZSB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2h1b2JpJyxcbiAgICAgICAgICAgICduYW1lJzogJ0h1b2JpJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQ04nLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDIwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MycsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcwMDEnLFxuICAgICAgICAgICAgICAgICc1bSc6ICcwMDUnLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMDE1JyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzAzMCcsXG4gICAgICAgICAgICAgICAgJzFoJzogJzA2MCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzEwMCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzIwMCcsXG4gICAgICAgICAgICAgICAgJzFNJzogJzMwMCcsXG4gICAgICAgICAgICAgICAgJzF5JzogJzQwMCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjU2OS0xNWFhN2I5YS01ZWRkLTExZTctOWU3Zi00NDc5MWY0ZWU0OWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHA6Ly9hcGkuaHVvYmkuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lmh1b2JpLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vaHVvYmlhcGkvQVBJX0RvY3NfZW4vd2lraScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnc3RhdGljbWFya2V0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH1fa2xpbmVfe3BlcmlvZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcl97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aF97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aF97aWR9X3tsZW5ndGh9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXRhaWxfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndXNkbWFya2V0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH1fa2xpbmVfe3BlcmlvZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcl97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aF97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aF97aWR9X3tsZW5ndGh9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXRhaWxfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndHJhZGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9hY2NvdW50X2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5X21hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbF9tYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X25ld19kZWFsX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X29yZGVyX2lkX2J5X3RyYWRlX2lkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19jb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfd2l0aGRyYXdfY29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X3dpdGhkcmF3X2NvaW5fcmVzdWx0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVwYXltZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfbG9hbl9hdmFpbGFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9sb2FucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0NOWSc6IHsgJ2lkJ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ddICsgJ0dldERlcHRoSWQnO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAoeyAnaWQnOiBtYXJrZXRbJ2lkJ10gfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2spO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9IG1hcmtldFsndHlwZSddICsgJ0dldFRpY2tlcklkJztcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IHJlc3BvbnNlWyd0aWNrZXInXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChyZXNwb25zZVsndGltZSddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2J1eScpLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ29wZW4nKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndHMnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsnZGlyZWN0aW9uJ10sXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnYW1vdW50J10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBtZXRob2QgPSBtYXJrZXRbJ3R5cGUnXSArICdHZXREZXRhaWxJZCc7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZVsndHJhZGVzJ10sIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBwYXJzZU9ITENWIChvaGxjdiwgbWFya2V0ID0gdW5kZWZpbmVkLCB0aW1lZnJhbWUgPSAnMW0nLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgLy8gbm90IGltcGxlbWVudGVkIHlldFxuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgb2hsY3ZbMF0sXG4gICAgICAgICAgICBvaGxjdlsxXSxcbiAgICAgICAgICAgIG9obGN2WzJdLFxuICAgICAgICAgICAgb2hsY3ZbM10sXG4gICAgICAgICAgICBvaGxjdls0XSxcbiAgICAgICAgICAgIG9obGN2WzZdLFxuICAgICAgICBdO1xuICAgIH1cblxuICAgIGFzeW5j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AgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVHJhZGluZ0xpbWl0cyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW1pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtaW4nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICc2MG1pbicsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFkYXknLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxd2VlaycsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFtb24nLFxuICAgICAgICAgICAgICAgICcxeSc6ICcxeWVhcicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjU2OS0xNWFhN2I5YS01ZWRkLTExZTctOWU3Zi00NDc5MWY0ZWU0OWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmh1b2JpcHJvLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5odW9iaXByby5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2h1b2JpYXBpL0FQSV9Eb2NzL3dpa2kvUkVTVF9hcGlfcmVmZXJlbmNlJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5odW9iaXByby5jb20vYWJvdXQvZmVlLycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnbWFya2V0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3Rvcnkva2xpbmUnLCAvLyDojrflj5ZL57q/5pWw5o2uXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsL21lcmdlZCcsIC8vIOiOt+WPluiBmuWQiOihjOaDhShUaWNrZXIpXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLCAvLyDojrflj5YgTWFya2V0IERlcHRoIOaVsOaNrlxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJywgLy8g6I635Y+WIFRyYWRlIERldGFpbCDmlbDmja5cbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L3RyYWRlJywgLy8g5om56YeP6I635Y+W5pyA6L+R55qE5Lqk5piT6K6w5b2VXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsJywgLy8g6I635Y+WIE1hcmtldCBEZXRhaWwgMjTlsI/ml7bmiJDkuqTph4/mlbDmja5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL3N5bWJvbHMnLCAvLyDmn6Xor6Lns7vnu5/mlK/mjIHnmoTmiYDmnInkuqTmmJPlr7lcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb21tb24vY3VycmVuY3lzJywgLy8g5p+l6K+i57O757uf5pSv5oyB55qE5omA5pyJ5biB56eNXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL3RpbWVzdGFtcCcsIC8vIOafpeivouezu+e7n+W9k+WJjeaXtumXtFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbW1vbi9leGNoYW5nZScsIC8vIG9yZGVyIGxpbWl0c1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3NldHRpbmdzL2N1cnJlbmN5cycsIC8vID9sYW5ndWFnZT1lbi1VU1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9hY2NvdW50cycsIC8vIOafpeivouW9k+WJjeeUqOaIt+eahOaJgOaciei0puaItyjljbNhY2NvdW50LWlkKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvYWNjb3VudHMve2lkfS9iYWxhbmNlJywgLy8g5p+l6K+i5oyH5a6a6LSm5oi355qE5L2Z6aKdXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL3tpZH0nLCAvLyDmn6Xor6Lmn5DkuKrorqLljZXor6bmg4VcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMve2lkfS9tYXRjaHJlc3VsdHMnLCAvLyDmn6Xor6Lmn5DkuKrorqLljZXnmoTmiJDkuqTmmI7nu4ZcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMnLCAvLyDmn6Xor6LlvZPliY3lp5TmiZjjgIHljoblj7Llp5TmiZhcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9tYXRjaHJlc3VsdHMnLCAvLyDmn6Xor6LlvZPliY3miJDkuqTjgIHljoblj7LmiJDkuqRcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy93aXRoZHJhdy12aXJ0dWFsL2FkZHJlc3NlcycsIC8vIOafpeivouiZmuaLn+W4geaPkOeOsOWcsOWdgFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L2RlcG9zaXQtdmlydHVhbC9hZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1ZXJ5L2RlcG9zaXQtd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbi9sb2FuLW9yZGVycycsIC8vIOWAn+i0t+iuouWNlVxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbi9hY2NvdW50cy9iYWxhbmNlJywgLy8g5YCf6LS36LSm5oi36K+m5oOFXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy9wbGFjZScsIC8vIOWIm+W7uuW5tuaJp+ihjOS4gOS4quaWsOiuouWNlSAo5LiA5q2l5LiL5Y2V77yMIOaOqOiNkOS9v+eUqClcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMnLCAvLyDliJvlu7rkuIDkuKrmlrDnmoTorqLljZXor7fmsYIg77yI5LuF5Yib5bu66K6i5Y2V77yM5LiN5omn6KGM5LiL5Y2V77yJXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL3tpZH0vcGxhY2UnLCAvLyDmiafooYzkuIDkuKrorqLljZUg77yI5LuF5omn6KGM5bey5Yib5bu655qE6K6i5Y2V77yJXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL3tpZH0vc3VibWl0Y2FuY2VsJywgLy8g55Sz6K+35pKk6ZSA5LiA5Liq6K6i5Y2V6K+35rGCXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL2JhdGNoY2FuY2VsJywgLy8g5om56YeP5pKk6ZSA6K6i5Y2VXG4gICAgICAgICAgICAgICAgICAgICAgICAnZHcvYmFsYW5jZS90cmFuc2ZlcicsIC8vIOi1hOS6p+WIkui9rFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3L2FwaS9jcmVhdGUnLCAvLyDnlLPor7fmj5DnjrDomZrmi5/luIFcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy93aXRoZHJhdy12aXJ0dWFsL2NyZWF0ZScsIC8vIOeUs+ivt+aPkOeOsOiZmuaLn+W4gVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwve2lkfS9wbGFjZScsIC8vIOehruiupOeUs+ivt+iZmuaLn+W4geaPkOeOsFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwve2lkfS9jYW5jZWwnLCAvLyDnlLPor7flj5bmtojmj5DnjrDomZrmi5/luIFcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy90cmFuc2Zlci1pbi9tYXJnaW4nLCAvLyDnjrDotKfotKbmiLfliJLlhaXoh7PlgJ/otLfotKbmiLdcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy90cmFuc2Zlci1vdXQvbWFyZ2luJywgLy8g5YCf6LS36LSm5oi35YiS5Ye66Iez546w6LSn6LSm5oi3XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luL29yZGVycycsIC8vIOeUs+ivt+WAn+i0t1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbi9vcmRlcnMve2lkfS9yZXBheScsIC8vIOW9kui/mOWAn+i0t1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZXhjZXB0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAnYWNjb3VudC1mcm96ZW4tYmFsYW5jZS1pbnN1ZmZpY2llbnQtZXJyb3InOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8ge1wic3RhdHVzXCI6XCJlcnJvclwiLFwiZXJyLWNvZGVcIjpcImFjY291bnQtZnJvemVuLWJhbGFuY2UtaW5zdWZmaWNpZW50LWVycm9yXCIsXCJlcnItbXNnXCI6XCJ0cmFkZSBhY2NvdW50IGJhbGFuY2UgaXMgbm90IGVub3VnaCwgbGVmdDogYDAuMDAyN2BcIixcImRhdGFcIjpudWxsfVxuICAgICAgICAgICAgICAgICdvcmRlci1saW1pdG9yZGVyLWFtb3VudC1taW4tZXJyb3InOiBJbnZhbGlkT3JkZXIsIC8vIGxpbWl0IG9yZGVyIGFtb3VudCBlcnJvciwgbWluOiBgMC4wMDFgXG4gICAgICAgICAgICAgICAgJ29yZGVyLW9yZGVyc3RhdGUtZXJyb3InOiBPcmRlck5vdEZvdW5kLCAvLyBjYW5jZWxpbmcgYW4gYWxyZWFkeSBjYW5jZWxlZCBvcmRlclxuICAgICAgICAgICAgICAgICdvcmRlci1xdWVyeW9yZGVyLWludmFsaWQnOiBPcmRlck5vdEZvdW5kLCAvLyBxdWVyeWluZyBhIG5vbi1leGlzdGVudCBvcmRlclxuICAgICAgICAgICAgICAgICdvcmRlci11cGRhdGUtZXJyb3InOiBFeGNoYW5nZU5vdEF2YWlsYWJsZSwgLy8gdW5kb2N1bWVudGVkIGVycm9yXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ29wdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoTWFya2V0c01ldGhvZCc6ICdwdWJsaWNHZXRD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BvbnNlLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBkYXRhID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgaWYgKHR5cGVvZiBkYXRhID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAnbWluJzogZGF0YVsnbGltaXQtb3JkZXItbXVzdC1ncmVhdGVyLXRoYW4nXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogZGF0YVsnbGltaXQtb3JkZXItbXVzdC1sZXNzLXRoYW4nXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1ldGhvZCA9IHRoaXMub3B0aW9uc1snZmV0Y2hNYXJrZXRzTWV0aG9kJ107XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgbnVtTWFya2V0cyA9IG1hcmtldHMubGVuZ3RoO1xuICAgICAgICBpZiAobnVtTWFya2V0cyA8IDEpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcHVibGljR2V0Q29tbW9uU3ltYm9scyByZXR1cm5lZCBlbXB0eSByZXNwb25zZTogJyArIHRoaXMuanNvbiAobWFya2V0cykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydiYXNlLWN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsncXVvdGUtY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gYmFzZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBpZCA9IGJhc2VJZCArIHF1b3RlSWQ7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYW1vdW50LXByZWNpc2lvbiddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsncHJpY2UtcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gKGJhc2UgPT09ICdPTUcnKSA/IDAgOiAwLjIgLyAxMDA7XG4gICAgICAgICAgICBsZXQgdGFrZXIgPSAoYmFzZSA9PT0gJ09NRycpID8gMCA6IDAuMiAvIDEwMDtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGlmICgndHMnIGluIHRpY2tlcilcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRpY2tlclsndHMnXTtcbiAgICAgICAgbGV0IGJpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGFzayA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGJpZFZvbHVtZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGFza1ZvbHVtZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdiaWQnIGluIHRpY2tlcikge1xuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkgKHRpY2tlclsnYmlkJ10pKSB7XG4gICAgICAgICAgICAgICAgYmlkID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlclsnYmlkJ10sIDApO1xuICAgICAgICAgICAgICAgIGJpZFZvbHVtZSA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXJbJ2JpZCddLCAxKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoJ2FzaycgaW4gdGlja2VyKSB7XG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheSAodGlja2VyWydhc2snXSkpIHtcbiAgICAgICAgICAgICAgICBhc2sgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyWydhc2snXSwgMCk7XG4gICAgICAgICAgICAgICAgYXNrVm9sdW1lID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlclsnYXNrJ10sIDEpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBvcGVuID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ29wZW4nKTtcbiAgICAgICAgbGV0IGNsb3NlID0gdGhpcy5zYWZlRmxvYXQgKHRp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bCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0eXBlJzogJ3N0ZXAwJyxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGlmICgndGljaycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmICghcmVzcG9uc2VbJ3RpY2snXSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaE9yZGVyQm9vaygpIHJldHVybmVkIGVtcHR5IHJlc3BvbnNlOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG9yZGVyYm9vayA9IHJlc3BvbnNlWyd0aWNrJ107XG4gICAgICAgICAgICBsZXQgdGltZXN0YW1wID0gb3JkZXJib29rWyd0cyddO1xuICAgICAgICAgICAgb3JkZXJib29rWydub25jZSddID0gb3JkZXJib29rWyd2ZXJzaW9uJ107XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB0aW1lc3RhbXApO1xuICAgICAgICB9XG4gICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaE9yZGVyQm9vaygpIHJldHVybmVkIHVucmVjb2duaXplZCByZXNwb25zZTogJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMubWFya2V0R2V0RGV0YWlsTWVyZ2VkICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyIChyZXNwb25zZVsndGljayddLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRyYWRlWyd0cyddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydkaXJlY3Rpb24nXSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydhbW91bnQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSAxMDAwLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfTtcbiAgICAgICAgaW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uICAgICAgICAgICAgaWYgKHRoaXMuYWNjb3VudHMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5hY2NvdW50cztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5hY2NvdW50cyA9IGF3YWl0IHRoaXMuZmV0Y2hBY2NvdW50cyAoKTtcbiAgICAgICAgICAgICAgICB0aGlzLmFjY291bnRzQnlJZCA9IHRoaXMuaW5kZXhCeSAodGhpcy5hY2NvdW50cywgJ2lkJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMuYWNjb3VudHM7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hBY2NvdW50cyAoKSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRBY2NvdW50cyAoKTtcbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlWydkYXRhJ107XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hDdXJyZW5jaWVzIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFNldHRpbmdzQ3VycmVuY3lzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2xhbmd1YWdlJzogdGhpcy5vcHRpb25zWydsYW5ndWFnZSddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAvLyAgeyAgICAgICAgICAgICAgICAgICAgIG5hbWU6IFwiY3R4Y1wiLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgICdkaXNwbGF5LW5hbWUnOiBcIkNUWENcIixcbiAgICAgICAgICAgIC8vICAgICAgICAnd2l0aGRyYXctcHJlY2lzaW9uJzogIDgsXG4gICAgICAgICAgICAvLyAgICAgICAgICAgICAnY3VycmVuY3ktdHlwZSc6IFwiZXRoXCIsXG4gICAgICAgICAgICAvLyAgICAgICAgJ2N1cnJlbmN5LXBhcnRpdGlvbic6IFwicHJvXCIsXG4gICAgICAgICAgICAvLyAgICAgICAgICAgICAnc3VwcG9ydC1zaXRlcyc6ICBudWxsLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgJ290Yy1lbmFibGUnOiAgMCxcbiAgICAgICAgICAgIC8vICAgICAgICAnZGVwb3NpdC1taW4tYW1vdW50JzogXCIyXCIsXG4gICAgICAgICAgICAvLyAgICAgICAnd2l0aGRyYXctbWluLWFtb3VudCc6IFwiNFwiLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAnc2hvdy1wcmVjaXNpb24nOiBcIjhcIixcbiAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgIHdlaWdodDogXCIyOTg4XCIsXG4gICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgIHZpc2libGU6ICB0cnVlLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgICdkZXBvc2l0LWRlc2MnOiBcIlBsZWFzZSBkb27igJl0IGRlcG9zaXQgYW55IG90aGVyIGRpZ2l0YWwgYXNzZXRzIGV4Y2VwdCBDVFhDIHTigKZcIixcbiAgICAgICAgICAgIC8vICAgICAgICAgICAgICd3aXRoZHJhdy1kZXNjJzogXCJNaW5pbXVtIHdpdGhkcmF3YWwgYW1vdW50OiA0IENUWEMuICE+XzwhRm9yIHNlY3VyaXR5IHJlYXNvbuKAplwiLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICdkZXBvc2l0LWVuYWJsZWQnOiAgdHJ1ZSxcbiAgICAgICAgICAgIC8vICAgICAgICAgICd3aXRoZHJhdy1lbmFibGVkJzogIHRydWUsXG4gICAgICAgICAgICAvLyAgICAnY3VycmVuY3ktYWRkci13aXRoLXRhZyc6ICBmYWxzZSxcbiAgICAgICAgICAgIC8vICAgICAgICAgICAgICdmYXN0LWNvbmZpcm1zJzogIDE1LFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgJ3NhZmUtY29uZmlybXMnOiAgMzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy9cbiAgICAgICAgICAgIGxldCBpZCA9IHRoaXMuc2FmZVZhbHVlIChjdXJyZW5jeSwgJ25hbWUnKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB0aGlzLnNhZmVJbnRlZ2VyIChjdXJyZW5jeSwgJ3dpdGhkcmF3LXByZWNpc2lvbicpO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQudG9VcHBlckNhc2UgKCkpO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IGN1cnJlbmN5Wyd2aXNpYmxlJ10gJiYgY3VycmVuY3lbJ2RlcG9zaXQtZW5hYmxlZCddICYmIGN1cnJlbmN5Wyd3aXRoZHJhdy1lbmFibGVkJ107XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICd0eXBlJzogJ2NyeXB0bycsXG4gICAgICAgICAgICAgICAgLy8gJ3BheWluJzogY3VycmVuY3lbJ2RlcG9zaXQtZW5hYmxlZCddLFxuICAgICAgICAgICAgICAgIC8vICdwYXlvdXQnOiBjdXJyZW5jeVsnd2l0aGRyYXctZW5hYmxlZCddLFxuICAgICAgICAgICAgICAgIC8vICd0cmFuc2Zlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WydkaXNwbGF5LW5hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiBhY3RpdmUgPyAnb2snIDogJ2Rpc2FibGVkJyxcbiAgICAgICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLCAvLyB0b2RvIG5lZWQgdG8gZmV0Y2ggZnJvbSBmZWUgZW5kcG9pbnRcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAnZGVwb3NpdC1taW4tYW1vdW50JyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAnd2l0aGRyYXctbWluLWFtb3VudCcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRBY2NvdW50cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudEFjY291bnRzSWRCYWxhbmNlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogdGhpcy5hY2NvdW50c1swXVsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydkYXRhJ11bJ2xpc3QnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY2VzLmxlbm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HtcbiAgICAgICAgICAgICAgICAgICAgbGV0IG1hcmtldElkID0gb3JkZXJbJ3N5bWJvbCddO1xuICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbbWFya2V0SWRdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IG9yZGVyWydjcmVhdGVkLWF0J107XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdhbW91bnQnKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHBhcnNlRmxvYXQgKG9yZGVyWydmaWVsZC1hbW91bnQnXSk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSBhbW91bnQgLSBmaWxsZWQ7XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlJyk7XG4gICAgICAgIGxldCBjb3N0ID0gcGFyc2VGbG9hdCAob3JkZXJbJ2ZpZWxkLWNhc2gtYW1vdW50J10pO1xuICAgICAgICBsZXQgYXZlcmFnZSA9IDA7XG4gICAgICAgIGlmIChmaWxsZWQpXG4gICAgICAgICAgICBhdmVyYWdlID0gcGFyc2VGbG9hdCAoY29zdCAvIGZpbGxlZCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZEFjY291bnRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdhY2NvdW50LWlkJzogdGhpcy5hY2NvdW50c1swXVsnaWQnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlICsgJy0nICsgdHlwZSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHR5cGUgPT09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlck9yZGVyc1BsYWNlICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ2RhdGEnXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjb3N0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFt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hpcy51cmxlbmNvZGUgKHsgJ1NpZ25hdHVyZSc6IHNpZ25hdHVyZSB9KTtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyBhdXRoO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ1BPU1QnKSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgdXJsO1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoaHR0cENvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBib2R5ICE9PSAnc3RyaW5nJylcbiAgICAgICAgICAgIHJldHVybjsgLy8gZmFsbGJhY2sgdG8gZGVmYXVsdCBlcnJvciBoYW5kbGVyXG4gICAgICAgIGlmIChib2R5Lmxlbmd0aCA8IDIpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoKGJvZHlbMF0gPT09ICd7JykgfHwgKGJvZHlbMF0gPT09ICdbJykpIHtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgaWYgKCdzdGF0dXMnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICAvLyAgICAge1wic3RhdHVzXCI6XCJlcnJvclwiLFwiZXJyLWNvZGVcIjpcIm9yZGVyLWxpbWl0b3JkZXItYW1vdW50LW1pbi1lcnJvclwiLFwiZXJyLW1zZ1wiOlwibGltaXQgb3JkZXIgYW1vdW50IGVycm9yLCBtaW46IGAwLjAwMWBcIixcImRhdGFcIjpudWxsfVxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgbGV0IHN0YXR1cyA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdzdGF0dXMnKTtcbiAgICAgICAgICAgICAgICBpZiAoc3RhdHVzID09PSAnZXJyb3InKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnZXJyLWNvZGUnKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZmVlZGJhY2sgPSB0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGV4Y2VwdGlvbnMgPSB0aGlzLmV4Y2VwdGlvbnM7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb2RlIGluIGV4Y2VwdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBleGNlcHRpb25zW2NvZGVdIChmZWVkYmFjayk7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gICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM4MDEyMTc2LTExNjE2YzMyLTMyNjktMTFlOC05ZjA1LWU2NWNmODg1YmIxNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9pY2UzeC5jb20vYXBpL3YxJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9pY2UzeC5jb20nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9pY2UzeC5jby56YScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vaWNlM3guY28uemEvaWNlLWN1YmVkLWJpdGNvaW4tZXhjaGFuZ2UtYXBpLWRvY3VtZW50YXRpb24tMS1qdW5lLTIwMTcnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9oZWxwLmljZTMuY29tL3N1cHBvcnQvc29sdXRpb25zL2FydGljbGVzLzExMDAwMDMzMjkzLXRyYWRpbmctZmVlcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2hlbHAuaWNlMy5jb20vc3VwcG9ydC9zb2x1dGlvbnMvYXJ0aWNsZXMvMTEwMDAwMzMyODgtZmVlcy1leHBsYWluZWQnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9oZWxwLmljZTMuY29tL3N1cHBvcnQvc29sdXRpb25zL2FydGljbGVzLzExMDAwMDA4MTMxLXdoYXQtYXJlLXlvdXItZmlhdC1kZXBvc2l0LWFuZC13aXRoZHJhd2FsLWZlZXMtJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vaGVscC5pY2UzLmNvbS9zdXBwb3J0L3NvbHV0aW9ucy9hcnRpY2xlcy8xMTAwMDAzMzI4OS1kZXBvc2l0LWZlZXMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L2xpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXIvbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpci9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0cy9tYXJrZXRkZXB0aGZ1bGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzL21hcmtldGRlcHRoYnRjYXYnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzL21hcmtldGRlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2svaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZS9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbi9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbi9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnZvaWNlL2xpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ludm9pY2UvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW52b2ljZS9wZGYnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDEsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY3lMaXN0IChwYXJhbXMpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IHJlc3BvbnNlWydyZXNwb25zZSddWydlbnRpdGllcyddO1xuICAgICAgICBsZXQgcHJlY2lzaW9uID0gdGhpcy5wcmVjaXNpb25bJ2Ftb3VudCddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmN5WydjdXJyZW5jeV9pZCddO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3lbJ2lzbyddLnRvVXBwZXJDYXNlICgpKTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGlmICghT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcykubGVuZ3RoKSB7XG4gICAgICAgICAgICB0aGlzLmN1cnJlbmNpZXMgPSBhd2FpdCB0aGlzLmZldGNoQ3VycmVuY2llcyAoKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmN1cnJlbmNpZXNfYnlfaWQgPSB0aGlzLmluZGV4QnkgKHRoaXMuY3VycmVuY2llcywgJ2lkJyk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0UGFpckxpc3QgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3Jlc3BvbnNlJ11bJ2VudGl0aWVzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsncGFpcl9pZCddO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnY3VycmVuY3lfaWRfZnJvbSddLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBtYXJrZXRbJ2N1cnJlbmN5X2lkX3RvJ10udG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYmFzZUN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jaWVzX2J5X2lkW2Jhc2VJZF07XG4gICAgICAgICAgICBsZXQgcXVvdGVDdXJyZW5jeSA9IHRoaXMuY3VycmVuY2llc19ieV9pZFtxdW90ZUlkXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VDdXJyZW5jeVsnY29kZSddKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUN1cnJlbmN5Wydjb2RlJ10pO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBy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YXQgKHRyYWRlLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3ZvbHVtZScpO1xuICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGNvc3QgPSBwYXJzZUZsb2F0ICh0aGlzLmNvc3RUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSAqIGFtb3VudCkpO1xuICAgICAgICBsZXQgZmVlID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnZmVlJyk7XG4gICAgICAgIGlmIChmZWUpIHtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IGZlZSxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ3F1b3RlJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0cmFkZV9pZCcpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsndHlwZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN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0aGlzLnNhZmVGbG9hdCAob3JkZXIsICd2b2x1bWUnKTtcbiAgICAgICAgbGV0IHN0YXR1cyA9IHRoaXMuc2FmZUludGVnZXIgKG9yZGVyLCAnYWN0aXZlJyk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdyZW1haW5pbmcnKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHN0YXR1cyA9PT0gMSkge1xuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgICAgICByZW1haW5pbmcgPSAwO1xuICAgICAgICAgICAgZmlsbGVkID0gYW1vdW50O1xuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdmZWUnKTtcbiAgICAgICAgaWYgKGZlZSkge1xuICAgICAgICAgICAgZmVlID0geyAnY29zdCc6IGZlZSB9O1xuICAgICAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgICAgICBmZWVbJ2N1cnJlbmN5J10gPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdvcmRlcl9pZCcpLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAndHJhZGVzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0T3JkZXJOZXcgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcl9pZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlciA9IHRoaXMucGFyc2VPcmRlciAoe1xuICAgICAgICAgICAgJ29yZGVyX2lkJzogcmVzcG9uc2VbJ3Jlc3BvbnNlJ11bJ2VudGl0eSddWydvcmRlcl9pZCddLFxuICAgICAgICAgICAgJ2NyZWF0ZWQnOiB0aGlzLnNlY29uZHMgKCksXG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pbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHBhcmFtcyA9IHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICAgICAgaWYgKHBhcmFtcy5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHBhcmFtcztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdub25jZSc6IHRoaXMubm9uY2UgKCksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGJvZHkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGxldCBlcnJvcnMgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2UsICdlcnJvcnMnKTtcbiAgICAgICAgbGV0IGRhdGEgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2UsICdyZXNwb25zZScpO1xuICAgICAgICBpZiAoZXJyb3JzIHx8ICFkYXRhKSB7XG4gICAgICAgICAgICBsZXQgYXV0aEVycm9yS2V5cyA9IFsgJ0tleScsICd1c2VyX2lkJywgJ1NpZ24nIF07XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGF1dGhFcnJvcktleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgZXJyb3JLZXkgPSBhdXRoRXJyb3JLZXlzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBlcnJvck1lc3NhZ2UgPSB0aGlzLnNhZmVTdHJpbmcgKGVycm9ycywgZXJyb3JLZXkpO1xuICAgICAgICAgICAgICAgIGlmICghZXJyb3JNZXNzYWdlKVxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICBpZiAoZXJyb3JLZXkgPT09ICd1c2VyX2lkJyAmJiBlcnJvck1lc3NhZ2UuaW5kZXhPZiAoJ2F1dGhvcml6YXRpb24nKSA8IDApXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yIChlcnJvck1lc3NhZ2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuanNvbiAoZXJyb3JzKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO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ICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmluZGVwZW5kZW50cmVzZXJ2ZS5jb20vUHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkuaW5kZXBlbmRlbnRyZXNlcnZlLmNvbS9Qcml2YXRlJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaW5kZXBlbmRlbnRyZXNlcnZlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5pbmRlcGVuZGVudHJlc2VydmUuY29tL0FQSScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkUHJpbWFyeUN1cnJlbmN5Q29kZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkU2Vjb25kYXJ5Q3VycmVuY3lDb2RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRMaW1pdE9yZGVyVHlwZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkTWFya2V0T3JkZXJUeXBlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRPcmRlclR5cGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRWYWxpZFRyYW5zYWN0aW9uVHlwZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldFN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9yZGVyQm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVIaXN0b3J5U3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0UmVjZW50VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRGeFJhdGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdQbGFjZUxpbWl0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BsYWNlTWFya2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRDbG9zZWRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldENsb3NlZEZpbGxlZE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3JkZXJEZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRBY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREaWdpdGFsQ3VycmVuY3lEZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0RGlnaXRhbEN1cnJlbmN5RGVwb3NpdEFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3luY2hEaWdpdGFsQ3VycmVuY3lEZXBvc2l0QWRkcmVzc1dpdGhCbG9ja2NoYWluJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0RpZ2l0YWxDdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVxdWVzdEZpYXRXaXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC41IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IGJhc2VDdXJyZW5jaWVzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRHZXRWYWxpZFByaW1hcnlDdXJyZW5jeUNvZGVzICgpO1xuICAgICAgICBsZXQgcXVvdGVDdXJyZW5jaWVzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRHZXRWYWxpZFNlY29uZGFyeUN1cnJlbmN5Q29kZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYXNlQ3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGJhc2VDdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGJhc2VJZFVwcGVyY2FzZSA9IGJhc2VJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZFVwcGVyY2FzZSk7XG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IHF1b3RlQ3VycmVuY2llcy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZUlkID0gcXVvdGVDdXJyZW5jaWVzW2pdO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZUlkVXBwZXJjYXNlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZFVwcGVyY2FzZSk7XG4gICAgICAgICAgICAgICAgbGV0IGlkID0gYmFzZUlkICsgJy8nICsgcXVvdGVJZDtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogaWQsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRBY2NvdW50cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY2V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lbmN5ID0gbWFya2V0WydiYXNlJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZlZSA9IHtcbiAgICAgICAgICAgICdyYXRlJzogZmVlUmF0ZSxcbiAgICAgICAgICAgICdjb3N0JzogZmVlQ29zdCxcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGZlZUN1cnJlbmN5LFxuICAgICAgICB9O1xuICAgICAgICBsZXQgaWQgPSBvcmRlclsnT3JkZXJHdWlkJ107XG4gICAgICAgIGxldCBzdGF0dXMgPSB0aGlzLnBhcnNlT3JkZXJTdGF0dXMgKG9yZGVyWydTdGF0dXMnXSk7XG4gICAgICAgIGxldCBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnVmFsdWUnKTtcbiAgICAgICAgbGV0IGF2ZXJhZ2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdBdmdQcmljZScpO1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdQcmljZScsIGF2ZXJhZ2UpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91b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gIGlmIChzaWRlLmluZGV4T2YgKCdCaWQnKSA+PSAwKVxuICAgICAgICAgICAgICAgIHNpZGUgPSAnYnV5JztcbiAgICAgICAgICAgIGVsc2UgaWYgKHNpZGUuaW5kZXhPZiAoJ09mZmVyJykgPj0gMClcbiAgICAgICAgICAgICAgICBzaWRlID0gJ3NlbGwnO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVySWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0R2V0UmVjZW50VHJhZGVzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3ByaW1hcnlDdXJyZW5jeUNvZGUnOiBtYXJrZXRbJ2Jhc2VJZCddLFxuICAgICAgICAgIC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ICAgICAgIGlmICh0eXBlID09PSAnbGltaXQnKVxuICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSBwcmljZTtcbiAgICAgICAgb3JkZXJbJ3ZvbHVtZSddID0gYW1vdW50O1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ09yZGVyR3VpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh7ICdvcmRlckd1aWQnOiBpZCB9KTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IFtcbiAgICAgICAgICAgICAgICB1cmwsXG4gICAgICAgICAgICAgICAgJ2FwaUtleT0nICsgdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlPScgKyBub25jZS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgIF07XG4gICAgICAgICAgICAvLyByZW1vdmUgdGhpcyBjcmFwXG4gICAgICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChwYXJhbXMpO1xuICAgICAgICAgICAgbGV0IHBheWxvYWQgPSBbXTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBrZXkgPSBrZXlzW2ldO1xuICAgICAgICAgICAgICAgIHBheWxvYWQucHVzaCAoa2V5ICsgJz0nICsgcGFyYW1zW2tleV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYXV0aCA9IHRoaXMuYXJyYXlDb25jYXQgKGF1dGgsIHBheWxvYWQpO1xuICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSBhdXRoLmpvaW4gKCcsJyk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAobWVzc2FnZSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAoe1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnc2lnbmF0dXJlJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBoZWFkZXJzID0geyAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nIH07XG4gICAgICAgIH1cbiAg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Fsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndmVyc2lvbic6ICcxLjcnLCAvLyBhcyBvZiA2IE5vdmVtYmVyIDIwMTdcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzc0NDMyODMtMmZkZGQwZTQtMjgxYy0xMWU4LTk3NDEtYjRmMTQxOTAwMWI1LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3ZpcC5iaXRjb2luLmNvLmlkL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vdmlwLmJpdGNvaW4uY28uaWQvdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmluZG9kYXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vaW5kb2RheC5jb20vZG93bmxvYWRzL0JJVENPSU5DT0lELUFQSS1ET0NVTUVOVEFUSU9OLnBkZicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVySGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdDb2luJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvSURSJzogeyAnaWQnOiAnYnRjX2lkcicsICdzeW1ib2wnOiAnQlRDL0lEUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdJRFInLCAnYmFzZUlkJzogJ2J0YycsICdxdW90ZUlkJzogJ2lkcicsICdwcmVjaXNpb24nOiB7ICdhbW91bnQnOiA4LCAncHJpY2UnOiAwI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3ByaWNlJzogOCB9LCAnbGltaXRzJzogeyAnYW1vdW50JzogeyAnbWluJzogMSwgJ21heCc6IHVuZGVmaW5lZCB9fX0sXG4gICAgICAgICAgICAgICAgJ1hSUC9CVEMnOiB7ICdpZCc6ICd4cnBfYnRjJywgJ3N5bWJvbCc6ICdYUlAvQlRDJywgJ2Jhc2UnOiAnWFJQJywgJ3F1b3RlJzogJ0JUQycsICdiYXNlSWQnOiAneHJwJywgJ3F1b3RlSWQnOiAnYnRjJywgJ3ByZWNpc2lvbic6IHsgJ2Ftb3VudCc6IDgsICdwcmljZSc6IDggfSwgJ2xpbWl0cyc6IHsgJ2Ftb3VudCc6IHsgJ21pbic6IDAuMDEsICdtYXgnOiB1bmRlZmluZWQgfX19LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDMsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ3JldHVybiddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2UgfTtcbiAgICAgICAgbGV0IGNvZGVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVu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IHN0YXR1cyA9IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdzdGF0dXMnLCAnb3BlbicpO1xuICAgICAgICBpZiAoc3RhdHVzID09PSAnZmlsbGVkJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09PSAnY2FsY2VsbGVkJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2NhbmNlbGVkJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gbWFya2V0WydxdW90ZUlkJ107XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydiYXNlSWQnXTtcbiAgICAgICAgICAgIGlmICgobWFya2V0WydxdW90ZUlkJ10gPT09ICdpZHInKSAmJiAoJ29yZGVyX3JwJyBpbiBvcmRlcikpXG4gICAgICAgICAgICAgICAgcXVvdGVJZCA9ICdycCc7XG4gICAgICAgICAgICBpZiAoKG1hcmtldFsnYmFzZUlkJ10gPT09ICdpZHInKSAmJiAoJ3JlbWFpbl9ycCcgaW4gb3JkZXIpKVxuICAgICAgICAgICAgICAgIGJhc2VJZCA9ICdycCc7XG4gICAgICAgICAgICBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnb3JkZXJfJyArIHF1b3RlSWQpO1xuICAgICAgICAgICAgaWYgKGNvc3QpIHtcbiAgICAgICAgICAgICAgICBhbW91bnQgPSBjb3N0IC8gcHJpY2U7XG4gICAgICAgICAgICAgICAgbGV0IHJlbWFpbmluZ0Nvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdyZW1haW5fJyArIHF1b3RlSWQpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVtYWluaW5nQ29zdCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVtYWluaW5nID0gcmVtYWluaW5nQ29zdCAvIHByaWNlO1xuICAgICAgICAgICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdvcmRlcl8nICsgYmFzZUlkKTtcbiAgICAgICAgICAgICAgICBjb3N0ID0gcHJpY2UgKiBhbW91bnQ7XG4gICAgICAgICAgICAgICAgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncmVtYWluXycgKyBiYXNlSWQpO1xuICAgICAgICAgICAgICAgIGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgYXZlcmFnZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKGZpbGxlZClcbiAgICAgICAgICAgIGF2ZXJhZ2UgPSBjb3N0IC8gZmlsbGVkO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKG9yZGVyWydzdWJtaXRfdGltZSddKTtcbiAgICAgICAgbGV0IGZlZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsX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hdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBpZiAodHlwZSAhPT0gJ2xpbWl0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgY3VycmVuY3kgPSBtYXJrZXRbJ2Jhc2VJZCddO1xuICAgICAgICBpZiAoc2lkZSA9PT0gJ2J1eScpIHtcbiAgICAgICAgICAgIG9yZGVyW21hcmtldFsncXVvdGVJZCddXSA9IGFtb3VudCAqIHByaWNlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb3JkZXJbbWFya2V0WydiYXNlSWQnXV0gPSBhbW91bnQ7XG4gICAgICAgIH1cbiAgICAgICAgb3JkZXJbY3VycmVuY3ldID0gYW1vdW50O1xuICAgICAgICBsZXQgcmVzdWx0ID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXN1bHQsXG4gICAgICAgICAgICAnaWQnOiByZXN1bHRbJ3JldHVybiddWydvcmRlcl9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE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ICAgICBcInN1Y2Nlc3NcIjogMSxcbiAgICAgICAgLy8gICAgICAgICBcInN0YXR1c1wiOiBcImFwcHJvdmVkXCIsXG4gICAgICAgIC8vICAgICAgICAgXCJ3aXRoZHJhd19jdXJyZW5jeVwiOiBcInhycFwiLFxuICAgICAgICAvLyAgICAgICAgIFwid2l0aGRyYXdfYWRkcmVzc1wiOiBcInJ3V3I3S1VaM1pGd3pnYURHaktCeXNBREJ5enh2b2hRM0NcIixcbiAgICAgICAgLy8gICAgICAgICBcIndpdGhkcmF3X2Ftb3VudFwiOiBcIjEwMDAwLjAwMDAwMDAwXCIsXG4gICAgICAgIC8vICAgICAgICAgXCJmZWVcIjogXCIyLjAwMDAwMDAwXCIsXG4gICAgICAgIC8vICAgICAgICAgXCJhbW91bnRfYWZ0ZXJfZmVlXCI6IFwiOTk5OC4wMDAwMDAwMFwiLFxuICAgICAgICAvLyAgICAgICAgIFwic3VibWl0X3RpbWVcIjogXCIxNTA5NDY5MjAwXCIsXG4gICAgICAgIC8vICAgICAgICAgXCJ3aXRoZHJhd19pZFwiOiBcInhycC0xMjM0NVwiLFxuICAgICAgICAvLyAgICAgICAgIFwidHhpZFwiOiBcIlwiLFxuICAgICAgICAvLyAgICAgICAgIFwid2l0aGRyYXdfbWVtb1wiOiBcIjEyMzEyM1wiXG4gICAgICAgIC8vICAgICB9XG4gICAgICAgIC8vXG4gICAgICAgIGxldCBpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCgndHhpZCcgaW4gcmVzcG9uc2UpICYmIChyZXNwb25zZVsndHhpZCddLmxlbmd0aCA+IDApKVxuICAgICAgICAgICAgaWQgPSByZXNwb25zZVsndHhpZCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiB0aGlzLm5vbmNlICgpLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChib2R5KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSwgcmVzcG9uc2UgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBib2R5ICE9PSAnc3RyaW5nJylcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgLy8geyBzdWNjZXNzOiAwLCBlcnJvcjogXCJpbnZhbGlkIG9yZGVyLlwiIH1cbiAgICAgICAgLy8gb3JcbiAgICAgICAgLy8gW3sgZGF0YSwgLi4uIH0sIHsgLi4uIH0sIC4uLiBdXG4gICAgICAgIGlmICh0eXBlb2YgcmVzcG9uc2UgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgaWYgKGJvZHlbMF0gPT09ICd7JyB8fCBib2R5WzBdID09PSAnWycpXG4gICAgICAgICAgICAgICAgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkgKHJlc3BvbnNlKSlcbiAgICAgICAgICAgIHJldHVybjsgLy8gcHVibGljIGVuZHBvaW50cyBtYXkgcmV0dXJuIFtdLWFycmF5c1xuICAgICAgICBpZiAoISgnc3VjY2VzcycgaW4gcmVzcG9uc2UpKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBubyAnc3VjY2VzcycgcHJvcGVydHkgb24gcHVibGljIHJlc3BvbnNlc1xuICAgICAgICBpZiAocmVzcG9uc2VbJ3N1Y2Nlc3MnXSA9PT0gMSkge1xuICAgICAgICAgICAgLy8geyBzdWNjZXNzOiAxLCByZXR1cm46IHsgb3JkZXJzOiBbXSB9fVxuICAgICAgICAgICAgaWYgKCEoJ3JldHVybicgaW4gcmVzcG9uc2UpKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJzogbWFsZm9ybWVkIHJlc3BvbnNlOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBsZXQgbWVzc2FnZSA9IHJlc3BvbnNlWydlcnJvciddO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0ZUxpbWl0JzogMjAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc4MjIxNTktNjYxNTM2MjAtNjBhZC0xMWU3LTg5ZTctMDA1ZjZkN2YzZGUwLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5pdGJpdC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaXRiaXQuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkuaXRiaXQuY29tL2RvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuaXRiaXQuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy97c3ltYm9sfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMve3N5bWJvbH0vb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy97c3ltYm9sfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0vYmFsYW5jZXMve2N1cnJlbmN5Q29kZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9mdW5kaW5nX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9vcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldF90cmFuc2ZlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9jcnlwdG9jdXJyZW5jeV9kZXBvc2l0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L2NyeXB0b2N1cnJlbmN5X3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0vb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXJlX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9vcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ1hCVFVTRCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9TR0QnOiB7ICdpZCc6ICdYQlRTR0QnLCAnc3ltYm9sJzogJ0JUQy9TR0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnU0dEJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnWEJURVVSJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0c1N5bWJvbE9yZGVyQm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFy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yk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gyNGgnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbG93MjRoJyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2JpZCcpLFxuICAgICAgICAgICAgJ2JpZFZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYXNrJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB2d2FwLFxuICAgICAgICAgICAgJ29wZW4nOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnb3BlblRvZGF5JyksXG4gICAgICAgICAgICAnY2xvc2UnOiBsYXN0LFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ3ByZXZpb3VzQ2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAg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Sk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZVsncmVjZW50VHJhZGVzJ10sIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2hXYWxsZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVswXVsnYmFsYW5jZXMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlQmFsYW5jZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlWyd0b3RhbEJhbGFuY2UnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFdhbGxldHMgKCkge1xuICAgICAgICBpZiAoIXRoaXMud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yc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzUnLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTUnLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzAnLFxuICAgICAgICAgICAgICAgICcxaCc6ICc2MCcsXG4gICAgICAgICAgICAgICAgJzRoJzogJzI0MCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzE0NDAnLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxMDA4MCcsXG4gICAgICAgICAgICAgICAgJzJ3JzogJzIxNjAwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTk5LTIyNzA5MzA0LTVlZGUtMTFlNy05ZGUxLTlmMzM3MzJlMTUwOS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkua3Jha2VuLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmtyYWtlbi5jb20nLFxuICAgICAgICAgICAgICAgICAgICAnemVuZGVzayc6ICdodHRwczovL3N1cHBvcnQua3Jha2VuLmNvbS9oYy9lbi11cy9hcnRpY2xlcycsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmtyYWtlbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5rcmFrZW4uY29tL2VuLXVzL2hlbHAvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9ub3RoaW5naXNkZWFkL25wbS1rcmFrZW4tYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vd3d3LmtyYWtlbi5jb20vZW4tdXMvaGVscC9mZWVzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjAwMjZdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMCwgMC4wMDI0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwLCAwLjAwMjJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAsIDAuMDAyMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMCwgMC4wMDE4XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMCwgMC4wMDE2XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMCwgMC4wMDE0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwMCwgMC4wMDEyXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAsIDAuMDAwMV0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjAwMTZdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMCwgMC4wMDE0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwLCAwLjAwMTJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAsIDAuMDAxMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMCwgMC4wMDA4XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMCwgMC4wMDA2XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMCwgMC4wMDA0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwMCwgMC4wMDAyXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAsIDAuMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgLy8gdGhpcyBpcyBhIGJhZCB3YXkgb2YgaGFyZGNvZGluZyBmZWVzIHRoYXQgY2hhbmdlIG9uIGRhaWx5IGJhc2lzXG4gICAgICAgICAgICAgICAgLy8gaGFyZGNvZGluZyBpcyBub3cgY29uc2lkZXJlZCBvYnNvbGV0ZSwgd2Ugd2lsbCByZW1vdmUgYWxsIG9mIGl0IGV2ZW50dWFsbHlcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTE0nOiAwLjAwMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDAxMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUxOJzogMC4wMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05PJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogNSwgLy8gaWYgZG9tZXN0aWMgd2lyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDUsIC8vIGlmIGRvbWVzdGljIHdpcmVcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQUQnOiAxMCwgLy8gQ0FEIEVGVCBXaXRoZHJhd2FsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSlBZJzogMzAwLCAvLyBpZiBkb21lc3RpYyB3aXJlXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hMTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01MTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiA1LCAvLyBpZiBkb21lc3RpYyB3aXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMCwgLy8gZnJlZSBkZXBvc2l0IGlmIEVVUiBTRVBBIERlcG9zaXRcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQUQnOiA1LCAvLyBpZiBkb21lc3RpYyB3aXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnSlBZJzogMCwgLy8gRG9tZXN0aWMgRGVwb3NpdCAoRnJlZSwgwqU1LDAwMCBkZXBvc2l0IG1pbmltdW0pXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd6ZW5kZXNrJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2Ugc2hvdWxkIHJlYWxseSByZWZyYWluIGZyb20gcHV0dGluZyBmaXhlZCBmZWUgbnVtYmVycyBhbmQgc3RvcCBoYXJkY29kaW5nXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB3ZSB3aWxsIGJlIHVzaW5nIHRoZWlyIHdlYiBBUElzIHRvIHNjcmFwZSBhbGwgbnVtYmVycyBmcm9tIHRoZXNlIGFydGljbGVzXG4gICAgICAgICAgICAgICAgICAgICAgICAnMjA1ODkzNzA4LVdoYXQtaXMtdGhlLW1pbmltdW0tb3JkZXItc2l6ZS0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJzIwMTM5Njc3Ny1XaGF0LWFyZS10aGUtZGVwb3NpdC1mZWVzLScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnMjAxODkzNjA4LVdoYXQtYXJlLXRoZS13aXRoZHJhd2FsLWZlZXMtJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXNzZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBc3NldFBhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0hMQycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3ByZWFkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RpbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWRkT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDbG9zZWRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RlcG9zaXRNZXRob2RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEZXBvc2l0U3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMZWRnZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcGVuUG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRdWVyeUxlZGdlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1F1ZXJ5T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRdWVyeVRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVCYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZXNIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZVZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3Q2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3U3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdvcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdj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0b3IpO1xuICAgICAgICAgICAgbGV0IG51bUNodW5rcyA9IGNodW5rcy5sZW5ndGg7XG4gICAgICAgICAgICBpZiAobnVtQ2h1bmtzID4gMSkge1xuICAgICAgICAgICAgICAgIGxldCBsaW1pdCA9IHBhcnNlRmxvYXQgKGNodW5rc1sxXSk7XG4gICAgICAgICAgICAgICAgbGV0IG5hbWUgPSBjaHVua3NbMF07XG4gICAgICAgICAgICAgICAgY2h1bmtzID0gbmFtZS5zcGxpdCAoJygnKTtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjaHVua3NbMV07XG4gICAgICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGxpbWl0O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEFzc2V0UGFpcnMgKCk7XG4gICAgICAgIGxldCBsaW1pdHMgPSBhd2FpdCB0aGlzLmZldGNoTWluT3JkZXJTaXplcyAoKTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0c1sncmVzdWx0J10pO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydyZXN1bHQnXVtpZF07XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgaWYgKChiYXNlWzBdID09PSAnWCcpIHx8IChiYXNlWzBdID09PSAnWicpKVxuICAgICAgICAgICAgICAgIGJhc2UgPSBiYXNlLnNsaWNlICgxKTtcbiAgICAgICAgICAgIGlmICgocXVvdGVbMF0gPT09ICdYJykgfHwgKHF1b3RlWzBdID09PSAnWicpKVxuICAgICAgICAgICAgICAgIHF1b3RlID0gcXVvdGUuc2xpY2UgKDEpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBkYXJrcG9vbCA9IGlkLmluZGV4T2YgKCcuZCcpID49IDA7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gZGFya3Bvb2wgPyBtYXJrZXRbJ2FsdG5hbWUnXSA6IChiYXNlICsgJy8nICsgcXVvdGUpO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKCdmZWVzX21ha2VyJyBpbiBtYXJrZXQpIHtcbiAgICAgICAgICAgICAgICBtYWtlciA9IHBhcnNlRmxvYXQgKG1hcmtldFsnZmVlc19tYWtlciddWzBdWzFdKSAvIDEwMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnbG90X2RlY2ltYWxzJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwYWlyX2RlY2ltYWxzJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IG1pbkFtb3VudCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgaWYgKGJhc2UgaW4gbGltaXRzKVxuICAgICAgICAgICAgICAgIG1pbkFtb3VudCA9IGxpbWl0c1tiYXNlXTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Rhcmtwb29sJzogZGFya3Bvb2wsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2FsdG5hbWUnOiBtYXJrZXRbJ2FsdG5hbWUnXSxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBtYWtlcixcbiAgICAgICAgICAgICAgICAndGFrZXInOiBwYXJzZUZsb2F0IChtYXJrZXRbJ2ZlZXMnXVswXVsxXSkgLyAxMDAsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1pbkFtb3VudCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXN1bHQgPSB0aGlzLmFwcGVuZEluYWN0aXZlTWFya2V0cyAocmVzdWx0KTtcbiAgICAgICAgdGhpcy5tYXJrZXRzQnlBbHRuYW1lID0gdGhpcy5pbmRleEJ5IChyZXN1bHQsICdhbHRuYW1lJyk7XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXBwZW5kSW5hY3RpdmVNYXJrZXRzIChyZXN1bHQgPSBbXSkge1xuICAgICAgICBsZXQgcHJlY2lzaW9uID0geyAnYW1vdW50JzogOCwgJ3ByaWNlJzogOCB9O1xuICAgICAgICBsZXQgY29zdExpbWl0cyA9IHsgJ21pbic6IDAsICdtYXgnOiB1bmRlZmluZWQgfTtcbiAgICAgICAgbGV0IHByaWNlTGltaXRzID0geyAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSwgJ21heCc6IHVuZGVmaW5lZCB9O1xuICAgICAgICBsZXQgYW1vdW50TGltaXRzID0geyAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pIH07XG4gICAgICAgIGxldCBsaW1pdHMgPSB7ICdhbW91bnQnOiBhbW91bnRMaW1pdHMsICdwcmljZSc6IHByaWNlTGltaXRzLCAnY29zdCc6IGNvc3RMaW1pdHMgfTtcbiAgICAgICAgbGV0IGRlZmF1bHRzID0ge1xuICAgICAgICAgICAgJ2Rhcmtwb29sJzogZmFsc2UsXG4gICAgICAgICAgICAnaW5mbyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdtYWtlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0YWtlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdh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IHdpdGhkcmF3YWwvZGVwb3NpdCBtZXRob2RzIGFuZFxuICAgICAgICAgICAgLy8gZGlmZmVyZW50aWF0ZWQgZmVlcyBmb3IgZWFjaCBwYXJ0aWN1bGFyIG1ldGhvZFxuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3lbJ2FsdG5hbWUnXSk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0gY3VycmVuY3lbJ2RlY2ltYWxzJ107XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkaW5nRmVlcyAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RUcmFkZVZvbHVtZSAocGFyYW1zKTtcbiAgICAgICAgbGV0IHRyYWRlZFZvbHVtZSA9IHRoaXMuc2FmZUZsb2F0IChyZXNwb25zZVsncmVzdWx0J10sICd2b2x1bWUnKTtcbiAgICAgICAgbGV0IHRpZXJzID0gdGhpcy5mZWVzWyd0cmFkaW5nJ11bJ3RpZXJzJ107XG4gICAgICAgIGxldCB0YWtlciA9IHRpZXJzWyd0YWtlciddWzFdO1xuICAgICAgICBsZXQgbWFrZXIgPSB0aWVyc1snbWFrZXInXVsxXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aWVyc1sndGFrZXInXS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYg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XG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiJ11bMF0pLFxuICAgICAgICAgICAgJ2JpZFZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2EnXVswXSksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB2d2FwLFxuICAgICAgICAgICAgJ29wZW4nOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbycpLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHBhaXJzID0gW107XG4gICAgICAgIGZvciAobGV0IHMgPSAwOyBzIDwgdGhpcy5zeW1ib2xzLmxlbmd0aDsgcysrKSB7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gdGhpcy5zeW1ib2xzW3NdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICAgICAgaWYgKG1hcmtldFsnYWN0aXZlJ10pXG4gICAgICAgICAgICAgICAgaWYgKCFtYXJrZXRbJ2Rhcmtwb29sJ10pXG4gICAgICAgICAgICAgICAgICAgIHBhaXJzLnB1c2ggKG1hcmtldFsnaWQnXSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZpbHRlciA9IHBhaXJzLmpvaW4gKCcsJyk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiBmaWx0ZXIsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VycyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGRhcmtwb29sID0gc3ltYm9sLmluZ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ciA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGZlZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCFtYXJrZXQpXG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLmZpbmRNYXJrZXRCeUFsdG5hbWVPcklkICh0cmFkZVsncGFpciddKTtcbiAgICAgICAgaWYgKCdvcmRlcnR4aWQnIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBvcmRlciA9IHRyYWRlWydvcmRlcnR4aWQnXTtcbiAgICAgICAgICAgIGlkID0gdHJhZGVbJ2lkJ107XG4gICAgICAgICAgICB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ3RpbWUnXSAqIDEwMDApO1xuICAgICAgICAgICAgc2lkZSA9IHRyYWRlWyd0eXBlJ107XG4gICAgICAgICAgICB0eXBlID0gdHJhZGVbJ29yZGVydHlwZSddO1xuICAgICAgICAgICAgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdwcmljZScpO1xuICAgICAgICAgICAgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAndm9sJyk7XG4gICAgICAgICAgICBpZiAoJ2ZlZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgICAgICAgICAgY3VycmVuY3kgPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2ZlZScpLFxuICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWzJdICogMTAwMCk7XG4gICAgICAgICAgICBzaWRlID0gKHRyYWRlWzNdID09PSAncycpID8gJ3NlbGwnIDogJ2J1eSc7XG4gICAgICAgICAgICB0eXBlID0gKHRyYWRlWzRdID09PSAnbCcpID8gJ2xpbWl0JyA6ICdtYXJrZXQnO1xuICAgICAgICAgICAgcHJpY2UgPSBwYXJzZUZsb2F0ICh0cmFkZVswXSk7XG4gICAgICAgICAgICBhbW91bnQgPSBwYXJzZUZsb2F0ICh0cmFkZVsxXSk7XG4gICAgICAgICAgICBsZXQgdHJhZGVMZW5ndGggPSB0cmFkZS5sZW5ndGg7XG4gICAgICAgICAgICBpZiAodHJhZGVMZW5ndGggPiA2KVxuICAgICAgICAgICAgICAgIGlkID0gdHJhZGVbNl07IC8vIGFydGlmaWNpYWxseSBhZGRlZCBhcyBwZXIgIzE3OTRcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gKG1hcmtldCkgPyBtYXJrZXRbJ3N5bWJvbCddIDogdW5kZWZpbmVkO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcixcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIG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1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHRoaXMuc2FmZVZhbHVlIChyZXNwb25zZSwgJ3Jlc3VsdCcpO1xuICAgICAgICBpZiAodHlwZW9mIGJhbGFuY2VzID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZU5vdEF2YWlsYWJsZSAodGhpcy5pZCArICcgZmV0Y2hCYWxhbmNlIGZhaWxlZCBkdWUgdG8gYSBtYWxmb3JtZWQgcmVzcG9uc2UgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gY3VycmVuY3k7XG4gICAgICAgICAgICAvLyBYLUlTTzQyMTctQTMgc3RhbmRhcmQgY3VycmVuY3kgY29kZXNcbiAgICAgICAgICAgIGlmIChjb2RlWzBdID09PSAnWCcpIHtcbiAgICAgICAgICAgICAgICBjb2RlID0gY29kZS5zbGljZSAoMSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNvZGVbMF0gPT09ICdaJykge1xuICAgICAgICAgICAgICAgIGNvZGUgPSBjb2RlLnNsaWNlICgxKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY29kZSk7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VzW2N1cnJlbmN5XSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2UsXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlLFxuICAgICAgICAgICAgJ29yZGVydHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAndm9sdW1lJzogdGhpcy5hbW91bnRUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQpLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ2xpbWl0JylcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gdGhpcy5wcmljZVRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEFkZE9yZGVyICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICBsZXQgaWQgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2VbJ3Jlc3VsdCddLCAndHhpZCcpO1xuICAgICAgICBpZiAodHlwZW9mIGlkICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkgKGlkKSkge1xuICAgICAgICAgICAgICAgIGxldCBsZW5ndGggPSBpZC5sZW5ndGg7XG4gICAgICAgICAgICAgICAgaWQgPSAobGVuZ3RoID4gMSkgPyBpZCA6IGlkWzBdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZmluZE1hcmtldEJ5QWx0bmFtZU9ySWQgKGlkKSB7XG4gICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNCeUFsdG5hbWUpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm1hcmtldHNCeUFsdG5hbWVbaWRdO1xuICAgICAgICB9IGVsc2UgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBkZXNjcmlwdGlvbiA9IG9yZGVyWydkZXNjciddO1xuICAgICAgICBsZXQgc2lkZSA9IGRlc2NyaXB0aW9uWyd0eXBlJ107XG4gICAgICAgIGxldCB0eXBlID0gZGVzY3JpcHRpb25bJ29yZGVydHlwZSddO1xuICAgICAgICBsZXQgc3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gICAgJ2Nvc3QnOiBmZWVDb3N0LFxuICAgICAgICAgICAgICAgICAgICAncmF0ZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGlmIChmbGFncy5pbmRleE9mICgnZmNpcScpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZmVlWydjdXJyZW5jeSddID0gbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZmxhZ3MuaW5kZXhPZiAoJ2ZjaWInKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGZlZVsnY3VycmVuY3knXSA9IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogb3JkZXJbJ3N0YXR1cyddLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbi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IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIHdpdGhkcmF3IChjdXJyZW5jeSwgYW1vdW50LCBhZGRyZXNzLCB0YWcgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHRoaXMuY2hlY2tBZGRyZXNzIChhZGRyZXNzKTtcbiAgICAgICAgaWYgKCdrZXknIGluIHBhcmFtcykge1xuICAgICAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RXaXRoZHJhdyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYXNzZXQnOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgICAgIC8vICdhZGRyZXNzJzogYWRkcmVzcywgLy8gdGhleSBkb24ndCBhbGxvdyB3aXRoZHJhd2FscyB0byBkaXJlY3QgYWRkcmVzc2VzXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICAgICAnaWQnOiByZXNwb25zZVsncmVzdWx0J10sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgXCIgd2l0aGRyYXcgcmVxdWlyZXMgYSAna2V5JyBwYXJhbWV0ZXIgKHdpdGhkcmF3YWwga2V5IG5hbWUsIGFzIHNldCB1cCBvbiB5b3VyIGFjY291bnQpXCIpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9ICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIGFwaSArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoeyAnbm9uY2UnOiBub25jZSB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gdGhpcy5lbmNvZGUgKG5vbmNlICsgYm9keSk7XG4gICAgICAgICAgICBsZXQgaGFzaCA9IHRoaXMuaGFzaCAoYXV0aCwgJ3NoYTI1NicsICdiaW5hcnknKTtcbiAgICAgICAgICAgIGxldCBiaW5hcnkgPSB0aGlzLnN0cmluZ1RvQmluYXJ5ICh0aGlzLmVuY29kZSAodXJsKSk7XG4gICAgICAgICAgICBsZXQgYmluaGFzaCA9IHRoaXMuYmluYXJ5Q29uY2F0IChiaW5hcnksIGhhc2gpO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuYmFzZTY0VG9CaW5hcnkgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKGJpbmhhc2gsIHNlY3JldCwgJ3NoYTUxMicsICdiYXNlNjQnKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0FQSS1LZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnQVBJLVNpZ24nOiB0aGlzLmRlY29kZSAoc2lnbmF0dXJlKSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdXJsID0gJy8nICsgcGF0aDtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyB1cmw7XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChib2R5LmluZGV4T2YgKCdJbnZhbGlkIG9yZGVyJykgPj0gMClcbiAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgaWYgKGJvZHkuaW5kZXhPZiAoJ0ludmFsaWQgbm9uY2UnKSA+PSAwKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWROb25jZSAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnSW5zdWZmaWNpZW50IGZ1bmRzJykgPj0gMClcbiAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnQ2FuY2VsIHBlbmRpbmcnKSA+PSAwKVxuICAgICAgICAgICAgdGhyb3cgbmV3IENhbmNlbFBlbmRpbmcgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgaWYgKGJvZHkuaW5kZXhPZiAoJ0ludmFsaWQgYXJndW1lbnRzOnZvbHVtZScpID49IDApXG4gICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgIGlmIChib2R5WzBdID09PSAneycpIHtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiByZXNwb25zZSAhPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICBpZiAoJ2Vycm9yJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbnVtRXJyb3JzID0gcmVzcG9uc2VbJ2Vycm9yJ10ubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICBpZiAobnVtRXJyb3JzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcmVzcG9uc2VbJ2Vycm9yJ10ubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2VbJ2Vycm9yJ11baV0gaW4gdGhpcy5leGNlcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyB0aGlzLmV4Y2VwdGlvbnNbcmVzcG9uc2VbJ2Vycm9yJ11baV1dIChtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgIC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ckFnZW50JzogdGhpcy51c2VyQWdlbnRzWydjaHJvbWUnXSxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlTWFya2V0T3JkZXInOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hEZXBvc2l0QWRkcmVzcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLCAvLyBzZWUgdGhlIG1ldGhvZCBpbXBsZW1lbnRhdGlvbiBiZWxvd1xuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogJ2VtdWxhdGVkJywgLy8gdGhpcyBtZXRob2QgaXMgdG8gYmUgZGVsZXRlZCwgc2VlIGltcGxlbWVudGF0aW9uIGFuZCBjb21tZW50cyBiZWxvd1xuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogMSxcbiAgICAgICAgICAgICAgICAnNW0nOiA1LFxuICAgICAgICAgICAgICAgICcxNW0nOiAxNSxcbiAgICAgICAgICAgICAgICAnMzBtJzogMzAsXG4gICAgICAgICAgICAgICAgJzFoJzogNjAsXG4gICAgICAgICAgICAgICAgJzhoJzogNDgwLFxuICAgICAgICAgICAgICAgICcxZCc6ICdEJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnVycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMzc5NTY1NS1iM2M0NmU0OC1kY2Y2LTExZTctOGFiZS1kYzQ1ODhiYTc5MDEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmt1Y29pbi5jb20nLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5rdWNvaW4uY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ2tpdGNoZW4nOiAnaHR0cHM6Ly9raXRjaGVuLmt1Y29pbi5jb20nLFxuICAgICAgICAgICAgICAgICAgICAna2l0Y2hlbi0yJzogJ2h0dHBzOi8va2l0Y2hlbi0yLmt1Y29pbi5jb20nLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5rdWNvaW4uY29tLz9yPUU1d2txZScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2t1Y29pbmFwaWRvY3MuZG9jcy5hcGlhcnkuaW8nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vbmV3cy5rdWNvaW4uY29tL2VuL2ZlZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAna2l0Y2hlbic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2NoYXJ0L2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2NoYXJ0L2NvbmZpZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9jaGFydC9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2NoYXJ0L3N5bWJvbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9jdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2RlYWwtb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2tsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2xhbmctbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vb3JkZXJzLWJ1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9vcmRlcnMtc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi90aWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbi9jb2luLWluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVuL2NvaW5zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbi9jb2lucy10cmVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW4vc3ltYm9scycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQve2NvaW59L3dhbGxldC9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tjb2lufS93YWxsZXQvcmVjb3JkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC97Y29pbn0vYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9wcm9tb3Rpb24vaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9wcm9tb3Rpb24vc3VtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZWFsLW9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvYWN0aXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9hY3RpdmUtbWFwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9kZWFsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvZGV0YWlsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWZlcnJlci9kZXNjZW5kYW50L2NvdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tjb2lufS93aXRoZHJhdy9hcHBseScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC97Y29pbn0vd2l0aGRyYXcvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3Byb21vdGlvbi9kcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwtb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwtYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NoYW5nZS1sYW5nJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnS0NTJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FTyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQVMnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS05DJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVkMnOiAzLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BBWSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAyMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JIQyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIU1InOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dUQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRIJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSUFgnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVRJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVlgnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU9EJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FQkwnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdCJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NBRyc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRkQnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkROJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VLRyc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ1BUJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RYJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05VTFMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1ZUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTVCc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQVVJBJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVQic6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRU1AnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9XUic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGTElYWCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEVORCc6IDIwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU1CJzogMy4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JIT0MnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUic6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdERU5UJzogNTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUkdOJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FDVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7fSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIGV4Y2hhbmdlLXNwZWNpZmljIG9wdGlvbnNcbiAgICAgICAgICAgICdvcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICd0aW1lRGlmZmVyZW5jZSc6IDAsIC8vIHRoZSBkaWZmZXJlbmNlIGJldHdlZW4gc3lzdGVtIGNsb2NrIGFuZCBLdWNvaW4gY2xvY2tcbiAgICAgICAgICAgICAgICAnYWRqdXN0Rm9yVGltZURpZmZlcmVuY2UnOiBmYWxzZSwgLy8gY29udHJvbHMgdGhlIGFkanVzdG1lbnQgbG9naWMgdXBvbiBpbnN0YW50aWF0aW9uXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb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21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gbWFya2V0Wyd0cmFkaW5nJ107XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ2ZlZVJhdGUnKSxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnZmVlUmF0ZScpLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaERlcG9zaXRBZGRyZXNzIChjb2RlLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmN1cnJlbmN5IChjb2RlKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudENvaW5XYWxsZXRBZGRyZXNzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2NvaW4nOiBjdXJyZW5jeVsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBkYXRhID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IGFkZHJlc3MgPSB0aGlzLnNhZmVTdHJpbmcgKGRhdGEsICdhZGRyZXNzJyk7XG4gICAgICAgIHRoaXMuY2hlY2tBZGRyZXNzIChhZGRyZXNzKTtcbiAgICAgICAgbGV0IHRhZyA9IHRoaXMuc2FmZVN0cmluZyAoZGF0YSwgJ3VzZXJPaWQnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGNvZGUsXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgICAgICAndGFnJzogdGFnLFx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A9IChkZXBvc2l0ICYmIHdpdGhkcmF3KTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WyduYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAnZmVlJzogY3VycmVuY3lbJ3dpdGhkcmF3TWluRmVlJ10sIC8vIHRvZG86IHJlZGVzaWduXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnd2l0aGRyYXdNaW5BbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRCYWxhbmNlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2xpbWl0JzogMjAsIC8vIGRlZmF1bHQgMTIsIG1heCAyMFxuICAgICAgICAgICAgJ3BhZ2UnOiAxLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgaW5kZXhlZCA9IHRoaXMuaW5kZXhCeSAoYmFsYW5jZXMsICdjb2luVHlwZScpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChpbmRleGVkKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW2ldO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIG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ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIGlmIChyZW1haW5pbmcgPiAwKVxuICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSAnY2xvc2VkJztcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGZpbGxlZCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2Ygc3RhdHVzICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBpZiAoc3RhdHVzID09PSAnY2xvc2VkJylcbiAgICAgICAgICAgICAgICAgICAgZmlsbGVkID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnYW1vdW50Jyk7XG4gICAgICAgIH0gZWxzZSBpZiAoZmlsbGVkID09PSAwLjApIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgdHJhZGVzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGNvc3QgPSAwO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdHJhZGVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCArPSB0cmFkZXNbaV1bJ2Ftb3VudCddO1xuICAgICAgICAgICAgICAgICAgICBjb3N0ICs9IHRyYWRlc1tpXVsnY29zdCddO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvLyBrdWNvaW4gcHJpY2UgYW5kIGFtb3VudCBmaWVsZHMgaGF2ZSB2YXJ5aW5nIG5hbWVzXG4gICAgICAgIC8vIHRodXMgdGhlIGNvbnZvbHV0ZWQgc3BhZ2hldHRpIGNvZGUgYmVsb3dcbiAgICAgICAgbGV0IHByaWNlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIGZpbGxlZCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIC8vIGlmIHRoZSBvcmRlciB3YXMgZmlsbGVkIGF0IGxlYXN0IGZvciBzb21lIHBhcnRcbiAgICAgICAgICAgIGlmIChmaWxsZWQgPiAwLjApIHtcbiAgICAgICAgICAgICAgICBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlJyk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZGVhbFByaWNlJyk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZGVhbFByaWNlQXZlcmFnZScpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBpdCdzIGFuIG9wZW4gb3JkZXIsIG5vdCBmaWxsZWQgeWV0LCB1c2UgdGhlIGluaXRpYWwgcHJpY2VcbiAgICAgICAgICAgICAgICBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ29yZGVyUHJpY2UnKTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHByaWNlID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBjb3N0ID0gcHJpY2UgKiBmaWxsZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodHlwZW9mIGFtb3VudCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZyAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIGFtb3VudCA9IHRoaXMuc3VtIChmaWxsZWQsIHJlbWFpbmluZyk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiByZW1haW5pbmcgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChzdGF0dXMgPT09ICdvcGVuJykge1xuICAgICAgICAgICAgaWYgKCh0eXBlb2YgY29zdCA9PT0gJ3VuZGVmaW5lZCcpIHx8IChjb3N0ID09PSAwLjApKVxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcHJpY2UgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGFtb3VudCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgICAgICBjb3N0ID0gYW1vdW50ICogcHJpY2U7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZlZUN1cnJlbmN5ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGZlZUN1cnJlbmN5ID0gKHNpZGUgPT09ICdzZWxsJykgPyBtYXJrZXRbJ3F1b3RlJ10gOiBtYXJrZXRbJ2Jhc2UnXTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGxldCBmZWVDdXJyZW5jeUZpZWxkID0gKHNpZGUgPT09ICdzZWxsJykgPyAnY29pblR5cGVQYWlyJyA6ICdjb2luVHlwZSc7XG4gICAgICA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AgICAgICAgICd0eXBlJzogb3JkZXJUeXBlLFxuICAgICAgICAgICAgJ29yZGVyT2lkJzogaWQsXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldE9yZGVyRGV0YWlsICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGlmICghcmVzcG9uc2VbJ2RhdGEnXSlcbiAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAvL1xuICAgICAgICAvLyB0aGUgY2FjaGluZyBwYXJ0IHRvIGJlIHJlbW92ZWRcbiAgICAgICAgLy9cbiAgICAgICAgLy8gICAgIGxldCBvcmRlciA9IHRoaXMucGFyc2VPcmRlciAocmVzcG9uc2VbJ2RhdGEnXSwgbWFya2V0KTtcbiAgICAgICAgLy8gICAgIGxldCBvcmRlcklkID0gb3JkZXJbJ2lkJ107XG4gICAgICAgIC8vICAgICBpZiAob3JkZXJJZCBpbiB0aGlzLm9yZGVycylcbiAgICAgICAgLy8gICAgICAgICBvcmRlclsnc3RhdHVzJ10gPSB0aGlzLm9yZGVyc1tvcmRlcklkXVsnc3RhdHVzJ107XG4gICAgICAgIC8vICAgICB0aGlzLm9yZGVyc1tvcmRlcklkXSA9IG9yZGVyO1xuICAgICAgICAvL1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyIChyZXNwb25zZVsnZGF0YSddLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJzQnlTdGF0dXMgKG9yZGVycywgbWFya2V0LCBzaW5jZSwgbGltaXQsIHN0YXR1cykge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb3JkZXJzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQ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dW50KTtcbiAgICAgICAgbGV0IGNvc3QgPSBwcmljZSAqIGFtb3VudDtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE9yZGVyICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcklkID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZVsnZGF0YSddLCAnb3JkZXJPaWQnKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMuc2FmZUludGVnZXIgKHJlc3BvbnNlLCAndGltZXN0YW1wJyk7XG4gICAgICAgIGxldCBpc284NjAxID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIHRpbWVzdGFtcCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBpc284NjAxID0gdGhpcy5pc284NjAxICh0aW1lc3RhbXApO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJJZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiBpc284NjAxLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3Q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HRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICAvLyAgICAgICAgIGxldCBzaWRlID0gcmVxdWVzdFsndHlwZSddLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAvLyAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHtcbiAgICAgICAgLy8gICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIC8vICAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgIC8vICAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgLy8gICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgIC8vICAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgLy8gICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgLy8gICAgICAgICAgICAgJ3N0YXR1cyc6ICdjYW5jZWxlZCcsXG4gICAgICAgIC8vICAgICAgICAgfTtcbiAgICAgICAgLy8gICAgIH1cbiAgICAgICAgLy8gICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgLy9cbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxPcmRlciAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWydkYXRldGltZSddO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgc3ltYm9sID0gdGlja2VyWydjb2luVHlwZSddICsgJy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W1lc3RhbXAgPSB0cmFkZVswXTtcbiAgICAgICAgICAgIHR5cGUgPSAnbGltaXQnO1xuICAgICAgICAgICAgaWYgKHRyYWRlWzFdID09PSAnQlVZJykge1xuICAgICAgICAgICAgICAgIHNpZGUgPSAnYnV5JztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodHJhZGVbMV0gPT09ICdTRUxMJykge1xuICAgICAgICAgICAgICAgIHNpZGUgPSAnc2VsbCc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBwcmljZSA9IHRyYWRlWzJdO1xuICAgICAgICAgICAgYW1vdW50ID0gdHJhZGVbM107XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aW1lc3RhbXAgPSB0aGlzLnNhZmVWYWx1ZSAodHJhZGUsICdjcmVhdGVkQXQnKTtcbiAgICAgICAgICAgIG9yZGVyID0gdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ29yZGVyT2lkJyk7XG4gICAgICAgICAgICBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdvaWQnKTtcbiAgICAgICAgICAgIHNpZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAnZGlyZWN0aW9uJyk7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHNpZGUgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIHNpZGUgPSBzaWRlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdkZWFsUHJpY2UnKTtcbiAgICAgICAgICAgIGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2Ftb3VudCcpO1xuICAgICAgICAgICAgY29zdCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2RlYWxWYWx1ZScpO1xuICAgICAgICAgICAgbGV0IGZlZUN1cnJlbmN5ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgZmVlQ3VycmVuY3kgPSAoc2lkZSA9PT0gJ3NlbGwnKSA/IG1hcmtldFsncXVvdGUnXSA6IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgZmVlQ3VycmVuY3lGaWVsZCA9IChzaWRlID09PSAnc2VsbCcpID8gJ2NvaW5UeXBlUGFpcicgOiAnY29pblR5cGUnO1xuICAgICAgICAgICAgICAgIGxldCBmZWVDdXJyZW5jeSA9IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsIGZlZUN1cnJlbmN5RmllbGQpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZmVlQ3VycmVuY3kgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChmZWVDdXJyZW5jeSBpbiB0aGlzLmN1cnJlbmNpZXNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgICAgICBmZWVDdXJyZW5jeSA9IHRoaXMuY3VycmVuY2llc19ieV9pZFtmZWVDdXJyZW5jeV1bJ2NvZGUnXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdmZWUnKSxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBmZWVDdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXIsXG4gICAgICAgICAgICAnaW5mbyc6IGluZm8sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3BlbkRlYWxPcmRlcnMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlWydkYXRhJ10sIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE15VHJhZGVzIChzeW1ib2wgPSB1bmRlZmluZWQsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgIC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gICAgICAgICAgICBsZXQgYXV0aCA9IGVuZHBvaW50ICsgJy8nICsgbm9uY2UgKyAnLycgKyBxdWVyeVN0cmluZztcbiAgICAgICAgICAgIGxldCBwYXlsb2FkID0gdGhpcy5zdHJpbmdUb0Jhc2U2NCAodGhpcy5lbmNvZGUgKGF1dGgpKTtcbiAgICAgICAgICAgIC8vIHBheWxvYWQgc2hvdWxkIGJlIFwiZW5jb2RlZFwiIGFzIHJldHVybmVkIGZyb20gc3RyaW5nVG9CYXNlNjRcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHBheWxvYWQsIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGEyNTYnKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0tDLUFQSS1LRVknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnS0MtQVBJLU5PTkNFJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ0tDLUFQSS1TSUdOQVRVUkUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgdGhyb3dFeGNlcHRpb25PbkVycm9yIChyZXNwb25zZSkge1xuICAgICAgICAvL1xuICAgICAgICAvLyBBUEkgZW5kcG9pbnRzIHJldHVybiB0aGUgZm9sbG93aW5nIGZvcm1hdHNcbiAgICAgICAgLy8gICAgIHsgc3VjY2VzczogZmFsc2UsIGNvZGU6IFwiRVJST1JcIi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EgnKSB7XG4gICAgICAgICAgICBpZiAobWVzc2FnZSA9PT0gJ0ludmFsaWQgbm9uY2UnKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkTm9uY2UgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yIChmZWVkYmFjayk7XG4gICAgICAgIH0gZWxzZSBpZiAoY29kZSA9PT0gJ0VSUk9SJykge1xuICAgICAgICAgICAgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ1RoZSBwcmVjaXNpb24gb2YgYW1vdW50JykgPj0gMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyIChmZWVkYmFjayk7IC8vIGFtb3VudCB2aW9sYXRlcyBwcmVjaXNpb24uYW1vdW50XG4gICAgICAgICAgICBpZiAobWVzc2FnZS5pbmRleE9mICgnTWluIGFtb3VudCBlYWNoIG9yZGVyJykgPj0gMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyIChmZWVkYmFjayk7IC8vIGFtb3VudCA8IGxpbWl0cy5hbW91bnQubWluXG4gICAgICAgICAgICBpZiAobWVzc2FnZS5pbmRleE9mICgnTWluIHByaWNlOicpID49IDApXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAoZmVlZGJhY2spOyAvLyBwcmljZSA8IGxpbWl0cy5wcmljZS5taW5cbiAgICAgICAgICAgIGlmIChtZXNzYWdlLmluZGV4T2YgKCdNYXggcHJpY2U6JykgPj0gMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyIChmZWVkYmFjayk7IC8vIHByaWNlID4gbGltaXRzLnByaWNlLm1heFxuICAgICAgICAgICAgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ1RoZSBwcmVjaXNpb24gb2YgcHJpY2UnKSA+PSAwKVxuICAgICAgICAgICAgICAgIHRocm93IG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1NC8zMTY5NzYzOC05MTI4MjRmYS1iM2MxLTExZTctOGMzNi1jZjk2MDZlYjk0YWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8va3VuYS5pbycsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2t1bmEuaW8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9rdW5hLmlvL2RvY3VtZW50cy9hcGknLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8va3VuYS5pby9kb2N1bWVudHMvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnVUFIJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dBVkVTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHT0wnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0JHJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ1JNQyc6IDAuMDAxIEJUQ1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ0FSTic6IDAuMDEgRVRIXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnUic6IDAuMDE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WQnOiAnYnRjJyB9LFxuICAgICAgICAgICAgeyAnaWQnOiAncm1jYnRjJywgJ3N5bWJvbCc6ICdSTUMvQlRDJywgJ2Jhc2UnOiAnUk1DJywgJ3F1b3RlJzogJ0JUQycsICdiYXNlSWQnOiAncm1jJywgJ3F1b3RlSWQnOiAnYnRjJyB9LFxuICAgICAgICBdO1xuICAgICAgICBsZXQgbWFya2V0cyA9IFtdO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VycyAoKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBwcmVkZWZpbmVkTWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHByZWRlZmluZWRNYXJrZXRzW2ldO1xuICAgICAgICAgICAgaWYgKG1hcmtldFsnaWQnXSBpbiB0aWNrZXJzKVxuICAgICAgICAgICAgICAgIG1hcmtldHMucHVzaCAobWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgbWFya2V0c0J5SWQgPSB0aGlzLmluZGV4QnkgKG1hcmtldHMsICdpZCcpO1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgaWYgKCEoaWQgaW4gbWFya2V0c0J5SWQpKSB7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGlkLnJlcGxhY2UgKCdidGMnLCAnJyk7XG4gICAgICAgICAgICAgICAgYmFzZUlkID0gYmFzZUlkLnJlcGxhY2UgKCd1YWgnLCAnJyk7XG4gICAgICAgICAgICAgICAgYmFzZUlkID0gYmFzZUlkLnJlcGxhY2UgKCdnYmcnLCAnJyk7XG4gICAgICAgICAgICAgICAgaWYgKGJhc2VJZC5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBiYXNlSWRMZW5ndGggPSBiYXNlSWQubGVuZ3RoIC0gMDsgLy8gYSB0cmFuc3BpbGVyIHdvcmthcm91bmRcbiAgICAgICAgICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBpZC5zbGljZSAoYmFzZUlkTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBiYXNlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IHF1b3RlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0cy5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbWFya2V0cztcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZG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ha2VCVEMnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdVUycsXG4gICAgICAgICAgICAndmVyc2lvbic6ICdhcGlfdjInLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODA3NDEyMC03MmI3YzM4YS02NjYwLTExZTctOTJkOS1kOTAyNzUwMjI4MWQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmxha2VidGMuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lmxha2VidGMuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubGFrZWJ0Yy5jb20vcy9hcGlfdjInLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubGFrZWJ0Yy5jb20vcy9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jjb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiY3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXlPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRBY2NvdW50SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0RXh0ZXJuYWxBY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBmb3IgKGxldCBrID0gMDsgayA8IGtleXMubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNba107XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpZF07XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGJhc2VJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHF1b3RlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0QWNjb3VudEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydiYWxhbmNlJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgY29kZSA9IGlkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMuY3VycmVuY2llc19ieV9pZCkge1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY3VycmVuY2llc19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgY29kZSA9IGN1cnJlbmN5Wydjb2RlJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VzW2lkXSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2UsXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0QmNvcmRlcmJvb2sgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2spO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgbWFya2V0ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYmlkJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICA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ICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICBwYXJhbXMgPSBwYXJhbXMuam9pbiAoJywnKTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBwYXJhbXMgPSAnJztcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMudXJsZW5jb2RlICh7XG4gICAgICAgICAgICAgICAgJ3RvbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ2FjY2Vzc2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdyZXF1ZXN0bWV0aG9kJzogbWV0aG9kLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgICAgICdpZCc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdwYXJhbXMnOiBwYXJhbXMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAncGFyYW1zJzogcGFyYW1zLFxuICAgICAgICAgICAgICAgICdpZCc6IG5vbmNlLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMScpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLmVuY29kZSAodGhpcy5hcGlLZXkgKyAnOicgKyBzaWduYXR1cmUpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnSnNvbi1ScGMtVG9uY2UnOiBub25jZS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICAgICAnQ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aCc6ICdob3VyMicsXG4gICAgICAgICAgICAgICAgJzRoJzogJ2hvdXI0JyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnaG91cjYnLFxuICAgICAgICAgICAgICAgICc4aCc6ICdob3VyOCcsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICdob3VyMTInLFxuICAgICAgICAgICAgICAgICcxZCc6ICdkYXkxJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnd2VlazEnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzgwNjM2MDItOTYwNWUyOGEtMzMwMi0xMWU4LTgxYmUtNjRiMWU1M2M0Y2ZiLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5sYmFuay5pbmZvJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmxiYW5rLmluZm8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cubGJhbmsuaW5mby9hcGkvYXBpLW92ZXJ2aWV3JyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL2xiYW5raW5mby56ZW5kZXNrLmNvbS9oYy96aC1jbi9hcnRpY2xlcy8xMTUwMDIyOTUxMTQtLSVFOCVCNCVCOSVFNyU4RSU4NyVFOCVBRiVCNCVFNiU5OCU4RScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5UGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyc19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnNfaW5mb19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ1FUVU0nOiBhbW91bnQgPT4gTWF0aC5tYXggKDAuMDEsIGFtb3VudCAqICgwLjEgLyAxMDApKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAxMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQyc6IDUwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRNJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOQVMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hXQyc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVFMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5LJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCT1QnOiAzLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWU9ZT1cnOiAxNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RHQyc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NNVCc6IDIwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0VFUic6IDIwMDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGSUwnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY3lQYWlycyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgWyBiYXNlSWQsIHF1b3RlSWQgXSA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkLnRvVXBwZXJDYXNlICgpKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkLnRvVXBwZXJDYXNlICgpKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBbYmFzZSwgcXVvdGVdLmpvaW4gKCcvJyk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGlkLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3RpbWVzdGFtcCddO1xuICAgICAgICBsZXQgaW5mbyA9IHRpY2tlcjtcbiAgICAgICAgdGlja2VyID0gaW5mb1sndGlja2VyJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhdGVzdCcpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0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Ghpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ29yZGVyX3R5cGUnKSxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRoaXMuc2FmZVZhbHVlIChvcmRlciwgJ2luZm8nLCBvcmRlciksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGF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dGhkcmF3YWwgb3JkZXJzIGNhbiBub3QgYmUgbW9yZSB0aGFuIDMgbGVzcyB0aGFuIG9uZScsXG4gICAgICAgICAgICAgICAgJzEwMDIwJzogJ2xlc3MgdGhhbiB0aGUgbWluaW11bSBhbW91bnQgb2YgdGhlIHRyYW5zYWN0aW9uIGxpbWl0IG9mIDAuMDAxJyxcbiAgICAgICAgICAgIH0sIGVycm9yQ29kZSwgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgbGV0IEVycm9yQ2xhc3MgPSB0aGlzLnNhZmVWYWx1ZSAoe1xuICAgICAgICAgICAgICAgICcxMDAwMic6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzEwMDA0JzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgJzEwMDA1JzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMTAwMDYnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDAwNyc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzEwMDA5JzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICcxMDAxMCc6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAnMTAwMTEnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJzEwMDEyJzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICcxMDAxMyc6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAnMTAwMTQnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJzEwMDE1JzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICcxMDAxNic6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgIH0sIGVycm9yQ29kZSwgRXhjaGFuZ2VFcnJvcik7XG4gICAgICAgICAgICB0aHJvdyBuZXcg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RlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk4MjAyMi03NWFlYTgyOC02M2EwLTExZTctOTUxMS1jYTU4NGE4ZWRkNzQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmxpcXVpLmlvL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmxpcXVpLmlvL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2xpcXVpLmlvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vbGlxdWkuaW8vYXBpJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL2xpcXVpLmlvL2ZlZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDb2luRGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3Q29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ3JlYXRlQ291cG9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWRlZW1Db3Vwb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7fSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7fSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdEU0gnOiAnREFTSCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzgwMyc6IEludmFsaWRPcmRlciwgLy8gXCJDb3VudCBjb3VsZCBub3QgYmUgbGVzcyB0aGFuIDAuMDAxLlwiIChzZWxsaW5nIGJlbG93IG1pbkFtb3VudClcbiAgICAgICAgICAgICAgICAnODA0JzogSW52YWxpZE9yZGVyLCAvLyBcIkNvdW50IGNvdWxkIG5vdCBiZSBtb3JlIHRoYW4gMTAwMDAuXCIgKGJ1eWluZyBhYm92ZSBtYXhBbW91bnQpXG4gICAgICAgICAgICAgICAgJzgwNSc6IEludmFsaWRPcmRlciwgLy8gXCJwcmljZSBjb3VsZCBub3QgYmUgbGVzcyB0aGFuIFguXCIgKG1pblByaWNlIHZpb2xhdGlvbiBvbiBidXkgJiBzZWxsKVxuICAgICAgICAgICAgICAgICc4MDYnOiBJbnZhbGlkT3JkZXIsIC8vIFwicHJpY2UgY291bGQgbm90IGJlIG1vcmUgdGhhbiBYLlwiIChtYXhQcmljZSB2aW9sYXRpb24gb24gYnV5ICYgc2VsbClcbiAgICAgICAgICAgICAgICAnODA3JzogSW52YWxpZE9yZGVyLCAvLyBcImNvc3QgY291bGQgbm90IGJlIGxlc3MgdGhhbiBYLlwiIChtaW5Db3N0IHZpb2xhdGlvbiBvbiBidXkgJiBzZWxsKVxuICAgICAgICAgICAgICAgICc4MzEnOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gXCJOb3QgZW5vdWd0aCBYIHRvIGNyZWF0ZSBidXkgb3JkZXIuXCIgKGJ1e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ZUludGVnZXIgKG1hcmtldCwgJ2RlY2ltYWxfcGxhY2VzJyksXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5zYWZlSW50ZWdlciAobWFya2V0LCAnZGVjaW1hbF9wbGFjZXMnKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgYW1vdW50TGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluX2Ftb3VudCcpLFxuICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4X2Ftb3VudCcpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbl9wcmljZScpLFxuICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4X3ByaWNlJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGNvc3RMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5fdG90YWwnKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnRMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0TGltaXRzLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBoaWRkZW4gPSB0aGlzLnNhZmVJbnRlZ2VyIChtYXJrZXQsICdoaWRkZW4nKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAoaGlkZGVuID09PSAwKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBtYXJrZXRbJ2ZlZSddIC8gMTAwLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3JldHVybiddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBmdW5kcyA9IGJhbGFuY2VzWydmdW5kcyddO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChmdW5kcyk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAo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W5nZUVycm9yICh0aGlzLmlkICsgJyBoYXMgJyArIG51bUlkcy50b1N0cmluZyAoKSArICcgc3ltYm9scyBleGNlZWRpbmcgbWF4IFVSTCBsZW5ndGgsIHlvdSBhcmUgcmVxdWlyZWQgdG8gc3BlY2lmeSBhIGxpc3Qgb2Ygc3ltYm9scyBpbiB0aGUgZmlyc3QgYXJndW1lbnQgdG8gZmV0Y2hPcmRlckJvb2tzJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZHMgPSB0aGlzLm1hcmtldElkcyAoc3ltYm9scyk7XG4gICAgICAgICAgICBpZHMgPSBpZHMuam9pbiAoJy0nKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldERlcHRoUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogaWRzLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBpZHMgPSBPYmplY3Qua2V5cyAocmVzcG9uc2UpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VPcmRlckJvb2sgKHJlc3BvbnNlW2lkXSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3Vsd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BpbiB0aGUgZmlyc3QgYXJndW1lbnQgdG8gZmV0Y2hUaWNrZXJzJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZHMgPSB0aGlzLm1hcmtldElkcyAoc3ltYm9scyk7XG4gICAgICAgICAgICBpZHMgPSBpZHMuam9pbiAoJy0nKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogaWRzLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgZm9yIChsZXQgayA9IDA7IGsgPCBrZXlzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW2tdO1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbaWRdO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAg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ICAgICAgIH1cbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBhbW91bnQgPSB0cmFkZVsnYW1vdW50J107XG4gICAgICAgIGxldCB0eXBlID0gJ2xpbWl0JzsgLy8gYWxsIHRyYWRlcyBhcmUgc3RpbGwgbGltaXQgdHJhZGVzXG4gICAgICAgIGxldCBpc1lvdXJPcmRlciA9IHRoaXMuc2FmZVZhbHVlICh0cmFkZSwgJ2lzX3lvdXJfb3JkZXInKTtcbiAgICAgICAgbGV0IHRha2VyT3JNYWtlciA9ICd0YWtlcic7XG4gICAgICAgIGlmICh0eXBlb2YgaXNZb3VyT3JkZXIgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgaWYgKGlzWW91ck9yZGVyKVxuICAgICAgICAgICAgICAgIHRha2VyT3JNYWtlciA9ICdtYWtlcic7XG4gICAgICAgIGxldCBmZWUgPSB0aGlzLmNhbGN1bGF0ZUZlZSAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlLCB0YWtlck9yTWFrZXIpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcixcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZlZSc6IGZ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iAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAncmF0ZSc6IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSksXG4gICAgICAgIH07XG4gICAgICAgIHByaWNlID0gcGFyc2VGbG9hdCAocHJpY2UpO1xuICAgICAgICBhbW91bnQgPSBwYXJzZUZsb2F0IChhbW91bnQpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VHJhZGUgKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGlkID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICBsZXQgZmlsbGVkID0gMC4wO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gYW1vdW50O1xuICAgICAgICBpZiAoJ3JldHVybicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlkID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZVsncmV0dXJuJ10sIHRoaXMuZ2V0T3JkZXJJZEtleSAoKSk7XG4gICAgICAgICAgICBpZiAoaWQgPT09ICcwJykge1xuICAgICAgICAgICAgICAgIGlkID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZVsncmV0dXJuJ10sICdpbml0X29yZGVyX2lkJyk7XG4gICAgICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmaWxsZWQgPSB0aGlzLnNhZmVGbG9hdCAocmVzcG9uc2VbJ3JldHVybiddLCAncmVjZWl2ZWQnLCAwLjApO1xuICAgICAgICAgICAgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKHJlc3BvbnNlWydyZXR1cm4nXSwgJ3JlbWFpbnMnLCBhbW91bnQpO1xuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IHByaWNlICogZmlsbGVkLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIC8vICd0cmFkZXMnOiB0aGlzLnBhcnNlVHJhZGVzIChvcmRlclsndHJhZGVzJ10sIG1hcmtldCksXG4gICAgICAgIH07XG4gICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IG9yZGVyO1xuICAgICAgICByZXR1cm4gdGhpcy5leHRlbmQgKHsgJ2luZm8nOiByZXNwb25zZSB9LCBvcmRlcik7XG4gICAgfVxuXG4gICAgZ2V0T3JkZXJJZEtleSAoKSB7XG4gICAgICAgIHJ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gICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBpZCA9IG9yZGVyWydpZCddLnRvU3RyaW5nICgpO1xuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ3N0YXR1cycpO1xuICAgICAgICBpZiAoc3RhdHVzICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHN0YXR1cyA9IHRoaXMucGFyc2VPcmRlclN0YXR1cyAoc3RhdHVzKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChvcmRlclsndGltZXN0YW1wX2NyZWF0ZWQnXSkgKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtvcmRlclsncGFpciddXTtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBhbW91bnQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3JhdGUnKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnc3RhcnRfYW1vdW50JyBpbiBvcmRlcikge1xuICAgICAgICAgICAgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnc3RhcnRfYW1vdW50Jyk7XG4gICAgICAgICAgICByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdhbW91bnQnKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2Ftb3VudCcpO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMub3JkZXJzKVxuICAgICAgICAgICAgICAgIGFtb3VudCA9IHRoaXMub3JkZXJzW2lkXVsnYW1vdW50J107XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogZmlsbGVkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZ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bWFyayB0aGUgY2FjaGVkIG9yZGVyIGFzIGNsb3NlZFxuICAgICAgICAgICAgICAgIGlmIChjYWNoZWRPcmRlclsnc3RhdHVzJ10gPT09ICdvcGVuJykge1xuICAgICAgICAgICAgICAgICAgICBjYWNoZWRPcmRlciA9IHRoaXMuZXh0ZW5kIChjYWNoZWRPcmRlciwge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdjbG9zZWQnLCAvLyBsaWtld2lzZSBpdCBtaWdodCBoYXZlIGJlZW4gY2FuY2VsZWQgZXh0ZXJuYWxseSAodW5ub3RpY2VkIGJ5IFwidXNcIilcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb3N0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpbGxlZCc6IGNhY2hlZE9yZGVyWydhbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZW1haW5pbmcnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNhY2hlZE9yZGVyWydjb3N0J10gPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNhY2hlZE9yZGVyWydmaWxsZWQnXSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVkT3JkZXJbJ2Nvc3QnXSA9IGNhY2hlZE9yZGVyWydmaWxsZWQnXSAqIGNhY2hlZE9yZGVyWydwcmljZSddO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2NhY2hlZE9yZGVySWRdID0gY2FjaGVkT3JkZXI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnRvQXJyYXkgKHRoaXMub3JkZXJzKTtcbiAgICB9XG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iAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuc2lnbkJvZHlXaXRoU2VjcmV0IChib2R5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHNpZ25hdHVyZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IHRoaXMuZ2V0VmVyc2lvblN0cmluZyAoKSArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdXJsICs9ICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdHRVQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChodHRwQ29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAodHlwZW9mIGJvZHkgIT09ICdzdHJpbmcnKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKGJvZHkubGVuZ3RoIDwgMilcbiAgICAgICAgICAgIHJldHVybjsgLy8gZmFsbGJhY2sgdG8gZGVmYXVsdCBlcnJvciBoYW5kbGVyXG4gICAgICAgIGlmICgoYm9keVswXSA9PT0gJ3snKSB8fCAoYm9keVswXSA9PT0gJ1snKSkge1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICAvLyAxIC0gTGlxdWkgb25seSByZXR1cm5zIHRoZSBpbnRlZ2VyICdzdWNjZXNzJyBrZXkgZnJvbSB0aGVpciBwcml2YXRlIEFQSVxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgLy8gICAgIHsgXCJzdWNjZXNzXCI6IDEsIC4uLiB9IGh0dHBDb2RlID09PSAyMDBcbiAgICAgICAgICAgICAgICAvLyAgICAgeyBcInN1Y2Nlc3NcIjogMCwgLi4uIH0gaHR0cENvZGUgPT09IDIwMFxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgLy8gMiAtIEhvd2V2ZXIsIGV4Y2hhbmdlcyBkZXJpdmVkIGZyb20gTGlxdWksIGNhbiByZXR1cm4gbm9uLWludGVnZXJzXG4gICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICAvLyAgICAgSXQgY2FuIGJlIGEgbnVtZXJpYyBzdHJpbmdcbiAgICAgICAgICAgICAgICAvLyAgICAgeyBcInN1Y2Vzc3NcIjogXCIxXCIsIC4uLiB9XG4gICAgICAgICAgICAgICAgLy8gICAgIHsgXCJzdWNlc3NzXCI6IFwiMFwiLCAuLi4gfSwgaHR0cENvZGUgPj0gMjAwIChjYW4gYmUgNDAzLCA1MDIsIGV0YylcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIC8vICAgICBPciBqdXN0IGEgc3RyaW5nXG4gICAgICAgICAgICAgICAgLy8gICAgIHsgXCJzdWNjZXNzXCI6IFwidHJ1ZVwiLCAuLi4gfVxuICAgICAgICAgICAgICAgIC8vICAgICB7IFwic3VjY2Vzc1wiOiBcImZhbHNlXCIsIC4uLiB9LCBodHRwQ29kZSA+PSAyMDBcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIC8vICAgICBPci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2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghc3VjY2Vzcykge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBjb2RlID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ2NvZGUnKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdlcnJvcicpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBmZWVkYmFjayA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZXhjZXB0aW9ucyA9IHRoaXMuZXhjZXB0aW9ucztcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGUgaW4gZXhjZXB0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IGV4Y2VwdGlvbnNbY29kZV0gKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBuZWVkIGEgc2Vjb25kIGVycm9yIG1hcCBmb3IgdGhlc2UgbWVzc2FnZXMsIGFwcGFyZW50bHkuLi5cbiAgICAgICAgICAgICAgICAgICAgLy8gaW4gZmFjdCwgd2UgY2FuIHVzZSB0aGUgc2FtZSAuZXhjZXB0aW9ucyB3aXRoIHN0cmluZy1rZXlzIHRvIHNhdmUgc29tZSBsb2MgaGVyZVxuICAgICAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSA9PT0gJ2ludmFsaWQgYXBpIGtleScpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ2ludmFsaWQgc2lnbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ2FwaSBrZXkgZG9udCBoYXZlIHRyYWRlIHBlcm1pc3Npb24nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ2ludmFsaWQgcGFyYW1ldGVyJykgPj0gMCkgeyAvLyBlcnJvckNvZGUgMCwgcmV0dXJuZWQgb24gYnV5KHN5bWJvbCwgMCwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnaW52YWxpZCBvcmRlcicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnUmVxdWVzdHMgdG9vIG9mdGVuJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ25vdCBhdmFpbGFibGUnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VOb3RBdmFpbGFibGUgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnZGF0YSB1bmF2YWlsYWJsZScpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldy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TExZTctODljOS02MDEwYTU0ZmY5YmUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmxpdmVjb2luLm5ldCcsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5saXZlY29pbi5uZXQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cubGl2ZWNvaW4ubmV0L2FwaT9sYW5nPWVuJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYWxsL29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2xhc3RfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9tYXhiaWRfbWluYXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9vcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9yZXN0cmljdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RpY2tlcicsIC8vIG9taXQgcGFyYW1zIHRvIGdldCBhbGwgdGlja2VycyBhdCBvbmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9jb2luSW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9jbGllbnRfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9jb21taXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9jb21taXNzaW9uQ29tbW9uSW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9iYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2dldC9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2hpc3Rvcnkvc2l6ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9oaXN0b3J5L3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2J1eWxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9idXltYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2NhbmNlbGxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9zZWxsbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3NlbGxtYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L2NhcGl0YWxpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L2NhcmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L2NvaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L29rcGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L291dC9wYXllZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L3BlcmZlY3Rtb25leScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC92b3VjaGVyL2Ftb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC92b3VjaGVyL21ha2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvdm91Y2hlci9yZWRlZW0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjE4IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjE4IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NQQyc6ICdDYXByaWNvaW4nLFxuICAgICAgICAgICAgICAgICdDUkMnOiAnQ3J5Q2FzaCcsXG4gICAgICAgICAgICAgICAgJ09SRSc6ICdPcmVjdGljJyxcbiAgICAgICAgICAgICAgICAnUlVSJzogJ1JVQicsXG4gICAgICAgICAgICAgICAgJ1hCVCc6ICdCcmlja3RveCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzEnOiBFeGNoYW5nZUVycm9yLFxuICAgICAgICAgICAgICAgICcxMCc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzEwMCc6IEV4Y2hhbmdlRXJyb3IsIC8vIGludmFsaWQgcGFyYW1ldGVyc1xuICAgICAgICAgICAgICAgICcxMDEnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDInOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDMnOiBJbnZhbGlkT3JkZXIsIC8vIGludmFsaWQgY3VycmVuY3lcbiAgICAgICAgICAgICAgICAnMTA0JzogSW52YWxpZE9yZGVyLCAvLyBpbnZhbGlkIGFtb3VudFxuICAgICAgICAgICAgICAgICcxMDUnOiBJbnZhbGlkT3JkZXIsIC8vIHVuYWJsZSB0byBibG9jayBmdW5kc1xuICAgICAgICAgICAgICAgICcxMSc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzEyJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMic6IEF1dGhlbnRpY2F0aW9uRXJyb3IsIC8vIFwiVXNlciBub3QgZm91bmRcIlxuICAgICAgICAgICAgICAgICcyMCc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzMwJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMzEnOiBOb3RTdXBwb3J0ZWQsXG4gICAgICAgICAgICAgICAgJzMyJzogRXhjaGFuZ2VFcnJvcixcbiAgICAgICAgICAgICAgICAnNDI5JzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgJzUwMyc6IEV4Y2hhbmdlTm90QXZhaWxhYmxlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEV4Y2hhbmdlVGlja2VyICgpO1xuICAgICAgICBsZXQgcmVzdHJpY3Rpb25zID0gYXdh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gICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmIChjb2luUmVzdHJpY3Rpb25zKSB7XG4gICAgICAgICAgICAgICAgcHJlY2lzaW9uWydwcmljZSddID0gdGhpcy5zYWZlSW50ZWdlciAoY29pblJlc3RyaWN0aW9ucywgJ3ByaWNlU2NhbGUnLCA1KTtcbiAgICAgICAgICAgICAgICBsaW1pdHNbJ2Ftb3VudCddWydtaW4nXSA9IHRoaXMuc2FmZUZsb2F0IChjb2luUmVzdHJpY3Rpb25zLCAnbWluTGltaXRRdWFudGl0eScsIGxpbWl0c1snYW1vdW50J11bJ21pbiddKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxpbWl0c1sncHJpY2UnXSA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzogbGltaXRzLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0SW5mb0NvaW5JbmZvIChwYXJhbXMpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IHJlc3BvbnNlWydpbmZvJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY3lbJ3N5bWJvbCddO1xuICAgICAgICAgICAgLy8gdG9kbzogd2lsbCBuZWVkIHRvIHJldGhpbmsgdGhlIGZlZXNcbiAgICAgICAgICAgIC8vIHRvIGFkZCBzdXBwb3J0IGZvciBtdWx0aXBsZSB3aXRoZHJhd2FsL2RlcG9zaXQgbWV0aG9kcyBhbmRcbiAgICAgICAgICAgIC8vIGRpZmZlcmVudGlhdGVkIGZlZXMgZm9yIGVhY2ggcGFydGljdWxhciBtZXRob2RcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSA4OyAvLyBkZWZhdWx0IHByZWNpc2lvbiwgdG9kbzogZml4IFwibWFnaWMgY29uc3RhbnRzXCJcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAoY3VycmVuY3lbJ3dhbGxldFN0YXR1cyddID09PSAnbm9ybWFsJyk7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5Wyd3aXRoZHJhd0ZlZSddLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnbWluT3JkZXJBbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ21pbk9yZGVyQW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ21pbldpdGhkcmF3QW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnbWluRGVwb3NpdEFtb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXN1bHQgPSB0aGlzLmFwcGVuZEZpYXRDdXJyZW5jaWVzIChyZXN1bHQpO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFwcGVuZEZpYXRDdXJyZW5jaWVzIChyZXN1bHQgPSBbXSkge1xuICAgICAgICBsZXQgcHJlY2lzaW9uID0gODtcbiAgICAgICAgbGV0IGRlZmF1bHRzID0ge1xuICAgICAgICAgICAgJ2luZm8nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHsgJ21pbic6IHVuZGVmaW5lZCwgJ21heCc6IHVuZGVmaW5lZCB9LFxuICAgICAgICAgICAgICAgICdkZXBvc2l0JzogeyAnbWluJzogdW5kZWZpbmVkLCAnbWF4JzogdW5kZWZpbmVkIH0sXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHsgJ21pbic6IHVuZGVmaW5lZCwgJ21heCc6IHVuZGVmaW5lZCB9LFxuICAgICAgICAgICAgICAgICdjb3N0JzogeyAnbWluJzogdW5kZWZpbmVkLCAnbWF4JzogdW5kZWZpbmVkIH0sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBbXG4gICAgICAgICAgICB7ICdpZCc6ICdVU0QnLCAnY29kZSc6ICdVU0QnLCAnbmFtZSc6ICdVUyBEb2xsYXInIH0sXG4gICAgICAgICAgICB7ICdpZCc6ICdFVVInLCAnY29kZSc6ICdFVVInLCAnbmFtZSc6ICdFdXJvJyB9LFxuICAgICAgICAgICAgLy8geyAnaWQnOiAnUlVSJywgJ2NvZGUnOiAnUlVCJywgJ25hbWUnOiAnUnVzc2lhbiBydWJsZScgfSxcbiAgICAgICAgXTtcbiAgICAgICAgY3VycmVuY2llcy5wdXNoICh7XG4gICAgICAgICAgICAnaWQnOiAnUlVSJyxcbiAgICAgICAgICAgICdjb2RlJzogdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKCdSVVInKSxcbiAgICAgICAgICAgICduYW1lJzogJ1J1c3NpYW4gcnVibGUnLFxuICAgICAgICB9KTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSBjdXJyZW5jeVsnY29kZSddO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0g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dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnaWQnXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgICAgICAnZmVlJzoge1xuICAgICAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBxdW90ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlcnMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHt9O1xuICAgICAgICBpZiAodHlwZW9mIHN5bWJvbCAhPT0gJ3Vu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wYXRoO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5rZXlzb3J0IChwYXJhbXMpKTtcbiAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdQT1NUJylcbiAgICAgICAgICAgICAgICBib2R5ID0gcXVlcnk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMjU2Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBcGktS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAodHlwZW9mIGJvZHkgIT09ICdzdHJpbmcnKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmIChjb2RlID49IDMwMCkge1xuICAgICAgICAgICAgICAgIGxldCBlcnJvckNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnZXJyb3JDb2RlJyk7XG4gICAgICAgICAgICAgICAgaWYgKGVycm9yQ29kZSBpbiB0aGlzLmV4Y2VwdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IEV4Y2VwdGlvbkNsYXNzID0gdGhpcy5leGNlcHRpb25zW2Vycm9yQ29kZV07XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNlcHRpb25DbGFzcyAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gcmV0dXJucyBzdGF0dXMgY29kZSAyMDAgZXZlbiBpZiBzdWNjZXNzID09PSBmYWxzZVxuICAgICAgICAgICAgbGV0IHN1Y2Nlc3MgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2UsICdzdWNjZXNzJywgdHJ1ZSk7XG4gICAgICAgICAgICBpZiAoIXN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuLy8gIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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AgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLm15Yml0eC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lmx1bm8uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubHVuby5jb20vZW4vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vbnBtanMub3JnL3BhY2thZ2UvYml0eCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYmF1c21laWVyL25vZGUtYml0eCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL3tpZH0vdHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmZWVfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0b3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc3RvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0b3BvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvYXV0aDIvZ3JhbnQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3Rlcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1sndGlja2VycyddLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sndGlja2VycyddW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydwYWlyJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc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bG9hdCAob3JkZXIsICdmZWVfY291bnRlcicpO1xuICAgICAgICBsZXQgYmFzZUZlZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2ZlZV9iYXNlJyk7XG4gICAgICAgIGxldCBmZWUgPSB7ICdjdXJyZW5jeSc6IHVuZGVmaW5lZCB9O1xuICAgICAgICBpZiAocXVvdGVGZWUpIHtcbiAgICAgICAgICAgIGZlZVsnc2lkZSddID0gJ3F1b3RlJztcbiAgICAgICAgICAgIGZlZVsnY29zdCddID0gcXVvdGVGZWU7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBmZWVbJ3NpZGUnXSA9ICdiYXNlJztcbiAgICAgICAgICAgIGZlZVsnY29zdCddID0gYmFzZUZlZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyX2lkJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0cmFkZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICAgICAgJ2luZm8nOiB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y5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgc2lkZSA9ICh0cmFkZVsnaXNfYnV5J10pID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRyYWRlWyd0aW1lc3RhbXAnXSxcbiAgIC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JpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3QnO1xuICAgICAgICBsZXQgb3JkZXIgPSB7ICdwYWlyJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSB9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnTWFya2V0b3JkZXInO1xuICAgICAgICAgICAgb3JkZXJbJ3R5cGUnXSA9IHNpZGUudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBpZiAoc2lkZSA9PT0gJ2J1eScpXG4gICAgICAgICAgICAgICAgb3JkZXJbJ2NvdW50ZXJfdm9sdW1lJ10gPSBhbW91bnQ7XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgb3JkZXJbJ2Jhc2Vfdm9sdW1lJ10gPSBhbW91bnQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ1Bvc3RvcmRlcic7XG4gICAgICAgICAgICBvcmRlclsndm9sdW1lJ10gPSBhbW91bnQ7XG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICAgICAgaWYgKHNpZGUgPT09ICdidXknKVxuICAgICAgICAgICAgICAgIG9yZGVyWyd0eXBlJ10gPSAnQklEJztcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBvcmRlclsndHlwZSddID0gJ0FTSyc7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJl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c2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnbHlra2UnLFxuICAgICAgICAgICAgJ25hbWUnOiAnTHlra2UnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDSCcsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zNDQ4NzYyMC0zMTM5YTdiMC1lZmU2LTExZTctOTBmNS1lNTIwY2VmNzQ0NTEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnbW9iaWxlJzogJ2h0dHBzOi8vYXBpLmx5a2tleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2hmdC1hcGkubHlra2UuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vaGZ0LWFwaS5seWtrZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3Rlc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9iaWxlJzogJ2h0dHBzOi8vYXBpLmx5a2tleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9oZnQtc2VydmljZS1kZXYubHlra2V4Lm5ldC9hcGknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9oZnQtc2VydmljZS1kZXYubHlra2V4Lm5ldC9hcGknLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5seWtrZS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2hmdC1hcGkubHlra2UuY29tL3N3YWdnZXIvdWkvJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lmx5a2tlLmNvbS9seWtrZV9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cubHlra2UuY29tL3RyYWRpbmctY29uZGl0aW9ucycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnbW9iaWxlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FsbEFzc2V0UGFpclJhdGVzL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXNzZXRQYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXNzZXRQYWlycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJc0FsaXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlckJvb2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlckJvb2tzL3tBc3NldFBhaXJJZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVycy9saW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJzL21hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJzL3tpZH0vQ2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wLCAvLyBhcyBvZiA3IEZlYiAyMDE4LCBzZWUgaHR0cHM6Ly9naXRodWIuY29tL2NjeHQvY2N4dC9pc3N1ZXMvMTg2M1xuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAsIC8vIGh0dHBzOi8vd3d3Lmx5a2tlLmNvbS9jcC93YWxsZXQtZmVlcy1hbmQtbGltaXRzXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0V2FsbGV0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2ldO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnQXNzZXRJZCddO1xuICAgICAgICAgICAgbGV0IHRvdGFsID0gYmFsYW5jZVsnQmFsYW5jZSddO1xuICAgICAgICAgICAgbGV0IHVzZWQgPSBiYWxhbmNlWydSZXNlcnZlZCddO1xuICAgICAgICAgICAgbGV0IGZyZWUgPSB0b3RhbCAtIHVzZWQ7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogZnJlZSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHVzZWQsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogdG90YWwsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlcnNJZENhbmNlbCAoeyAnaWQnOiBpZCB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBxdWVyeSA9IHtcbiAgICAgICAgICAgICdBc3NldFBhaXJJZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdPcmRlckFjdGlvbic6IHRoaXMuY2FwaXRhbGl6ZSAoc2lkZSksXG4gICAgICAgICAgICAnVm9sdW1lJzogYW1vdW50LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIHF1ZXJ5WydBc3NldCddID0gKHNpZGUgPT09ICdidXknKSA/IG1hcmtldFsnYmFzZSddIDogbWFya2V0WydxdW90ZSddO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT09ICdsaW1pdCcpIHtcbiAgICAgICAgICAgIHF1ZXJ5WydQcmljZSddID0gcHJpY2U7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG1ldGhvZCA9ICdwcml2YXRlUG9zdE9yZGVycycgKyB0aGlzLmNhcGl0YWxpemUgKHR5cGUpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAocXVlcnksIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiByZXN1bHQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEFzc2V0UGFpcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnSWQnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydCYXNlQXNzZXRJZCddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydRdW90aW5nQXNzZXRJZCddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ05hbWUnXTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnQWNjdXJhY3knXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ0ludmVydGVkQWNjdXJhY3knXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB0aWNrZXIgPSB0aWNrZXJbJ1Jlc3VsdCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsb3cnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydSYXRlJ11bJ0JpZCddKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydSYXRlJ11bJ0FzayddKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLm1vYmlsZUdldEFsbEFzc2V0UGFpclJhdGVzTWFya2V0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlclN0YXR1cyAoc3RhdHVzKSB7XG4gICAgICAgIGlmIChzdGF0dXMgPT09ICdQZW5kaW5nJykge1xuICAgICAgICAgICAgcmV0dXJuICdvcGVuJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT09ICdJbk9yZGVyQm9vaycpIHtcbiAgICAgICAgICAgIHJldHVybiAnb3Blbic7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09PSAnUHJvY2Vzc2luZycpIHtcbiAgICAgICAgICAgIHJldHVybiAnb3Blbic7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09PSAnTW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bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ0lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldE9yZGVyc0lkICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyIChyZXNwb25zZSk7XG4gICA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0ZW5kICh7XG4gICAgICAgICAgICAnc3RhdHVzJzogJ01hdGNoZWQnLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlcnMgKHJlc3BvbnNlLCB1bmRlZmluZWQsIHNpbmNlLCBsaW1pdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJCb29rc0Fzc2V0UGFpcklkICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ0Fzc2V0UGFpcklkJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZHMnOiBbXSxcbiAgICAgICAgICAgICdhc2tzJzogW10sXG4gICAgICAgIH07XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB1bmRlZmluZWQ7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcmVzcG9uc2UubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBzaWRlID0gcmVzcG9uc2VbaV07XG4gICAgICAgICAgICBpZiAoc2lkZVsnSXNCdXknXSkge1xuICAgICAgICAgICAgICAgIG9yZGVyYm9va1snYmlkcyddID0gdGhpcy5hcnJheUNvbmNhdCAob3JkZXJib29rWydiaWRzJ10sIHNpZGVbJ1ByaWNlcyddKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgb3JkZXJib29rWydhc2tzJ10gPSB0aGlzLm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9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpXG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnYXBpLWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdBY2NlcHQnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnUE9TVCcpXG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vICA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cmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc4MzcwNjAtZTdjNTg3MTQtNjBlYS0xMWU3LTkxOTItZjA1ZTg2YWRiODNmLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cubWVyY2Fkb2JpdGNvaW4ubmV0L3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5jb20uYnInLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5jb20uYnIvYXBpLWRvYycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5jb20uYnIvdHJhZGUtYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y29pbn0vb3JkZXJib29rLycsIC8vIGxhc3Qgc2xhc2ggY3JpdGljYWxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y29pbn0vdGlja2VyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L3RyYWRlcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjb2lufS90cmFkZXMve2Zyb219LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L3RyYWRlcy97ZnJvbX0ve3RvfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L2RheS1zdW1tYXJ5L3t5ZWFyfS97bW9udGh9L3tkYXl9LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfYWNjb3VudF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X3N5c3RlbV9tZXNzYWdlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3Rfb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZV9idXlfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlX3NlbGxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2NvaW4nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9CUkwnOiB7ICdpZCc6ICdCUkxCVEMnLCAnc3ltYm9sJzogJ0JUQy9CUkwnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQlJMJywgJ3N1ZmZpeCc6ICdCaXRjb2luJyB9LFxuICAgICAgICAgICAgICAgICdMVEMvQlJMJzogeyAnaWQnOiAnQlJMTFRDJywgJ3N5bWJvbCc6ICdMVEMvQlJMJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzog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GxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdjb2luX3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ3F1YW50aXR5JzogYW1vdW50LFxuICAgICAgICAgICAgJ2xpbWl0X3ByaWNlJzogcHJpY2UsXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsncmVzcG9uc2VfZGF0YSddWydvcmRlciddWydvcmRlcl9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBpZiAoIXN5bWJvbClcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBjYW5jZWxPcmRlcigpIHJlcXVpcmVzIGEgc3ltYm9sIGFyZ3VtZW50Jyk7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjb2luX3BhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnb3JkZXJfaWQnOiBpZCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc2lkZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdvcmRlcl90eXBlJyBpbiBvcmRlcilcbiAgICAgICAgICAgIHNpZGUgPSAob3JkZXJbJ29yZGVyX3R5cGUnXSA9PT0gMSkgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgbGV0IHN0YXR1cyA9IG9yZGVyWydzdGF0dXMnXTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGlmICgnY29pbl9wYWlyJyBpbiBvcmRlcilcbiAgICAgICAgICAgICAgICBpZiAob3JkZXJbJ2NvaW5fcGFpciddIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW29yZGVyWydjb2luX3BhaXInXV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnY3JlYXRlZF90aW1lc3RhbXAnIGluIG9yZGVyKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gcGFyc2VJbnQgKG9yZGVyWydjcmVhdGVkX3RpbWVzdGFtcCddKSAqIDEwMDA7XG4gICAgICAgIGlmICgndXBkYXRlZF90aW1lc3RhbXAnIGluIG9yZGVyKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gcGFyc2VJbnQgKG9yZGVyWyd1cGRhdGVkX3RpbWVzdGFtcCddKSAqIDEwMDA7XG4gICAgICAgIGxldCBmZWUgPSB7XG4gICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2ZlZScpLFxuICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdsaW1pdF9wcmljZScpO1xuICAgICAgICAvLyBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2V4ZWN1dGVkX3ByaWNlX2F2ZycsIHByaWNlKTtcbiAgICAgICAgbGV0IGF2ZXJhZ2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdleGVjdXRlZF9wcmljZV9hdmcnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3F1YW50aXR5Jyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdleGVjdXRlZF9xdWFudGl0eScpO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICBsZXQgY29zdCA9IGFtb3VudCAqIGF2ZXJhZ2U7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyX2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdhbW91b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dpdGhkcmF3YWwnXVsnaWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyAnLyc7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLnZlcnNpb24gKyAnLyc7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICd0YXBpX21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ3RhcGlfbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSAnL3RhcGkvJyArIHRoaXMudmVyc2lvbiArICcvJyArICc/JyArIGJvZHk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICA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gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ2J0Y191c2QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJywgJ21ha2VyJzogMC4wMDE1LCAndGFrZXInOiAwLjAwMjUgfSxcbiAgICAgICAgICAgICAgICAnRVRIL0JUQyc6IHsgJ2lkJzogJ2V0aF9idGMnLCAnc3ltYm9sJzogJ0VUSC9CVEMnLCAnYmFzZSc6ICdFVEgnLCAncXVvdGUnOiAnQlRDJywgJ21ha2VyJzogMC4wMDEsICd0YWtlcic6IDAuMDAxNSB9LFxuICAgICAgICAgICAgICAgICdCQ0gvQlRDJzogeyAnaWQnOiAnYmNoX2J0YycsICdzeW1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XN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2wnKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0cmFkZVsnZGF0ZSddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAncHJpY2UnKSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdhbW91bnQnKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sL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AgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydyZXN1bHQnXVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWwgKHsgJ2lkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tle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tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBuZWdvY2llY29pbnMgZXh0ZW5kcyBFeGNoYW5nZSB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ25lZ29jaWVjb2lucycsXG4gICAgICAgICAgICAnbmFtZSc6ICdOZWdvY2llQ29pbnMnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdCUicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YzJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM4MDA4NTcxLTI1YTYyNDZlLTMyNTgtMTFlOC05NjliLWFlYjY5MTA0OTI0NS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9icm9rZXIubmVnb2NpZWNvaW5zLmNvbS5ici9hcGkvdjMnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2Jyb2tlci5uZWdvY2llY29pbnMuY29tLmJyL3RyYWRlYXBpL3YxJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cubmVnb2NpZWNvaW5zLmNvbS5icicsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5lZ29jaWVjb2lucy5jb20uYnIvZG9jdW1lbnRhY2FvLXRyYWRlYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5lZ29jaWVjb2lucy5jb20uYnIvZG9jdW1lbnRhY2FvLWFwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5uZWdvY2llY29pbnMuY29tLmJyL2NvbWlzc29lcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tQQVJ9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAne1BBUn0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7UEFSfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tQQVJ9L3RyYWRlcy97dGltZXN0YW1wX2luaWNpYWx9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7UEFSfS90cmFkZXMve3RpbWVzdGFtcF9pbmljaWFsfS97dGltZXN0YW1wX2ZpbmFsfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXIve29yZGVySWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXIve29yZGVySWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCMlgvQlJMJzogeyAnaWQnOiAnYjJ4YnJsJywgJ3N5bWJvbCc6ICdCMlgvQlJMJywgJ2Jhc2UnOiAnQjJYJywgJ3F1b3RlJzogJ0JSTCcgfSxcbiAgICAgICAgICAgICAgICAnQkNIL0JSTCc6IHsgJ2lkJzogJ2JjaGJybCcsICdzeW1ib2wnOiAnQkNIL0JSTCcsICdiYXNlJzogJ0JDSCcsICdxdW90ZSc6ICdCUkwnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9CUkwnOiB7ICdpZCc6ICdidGNicmwnLCAnc3ltYm9sJzogJ0JUQy9CUkwnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQlJMJyB9LFxuICAgICAgICAgICAgICAgICdCVEcvQlJMJzogeyAnaWQnOiAnYnRnYnJsJywgJ3N5bWJvbCc6ICdCVEcvQlJMJywgJ2Jhc2UnOiAnQlRHJywgJ3F1b3RlJzogJ0JSTCcgfSxcbiAgICAgICAgICAgICAgICAnREFTSC9CUkwnOiB7ICdpZCc6ICdkYXNoYnJsJywgJ3N5bWJvbCc6ICdEQVNIL0JSTCcsICdiYXNlJzogJ0RBU0gnLCAncXVvdGUnOiAnQlJMJyB9LFxuICAgICAgICAgICAgICAgICdMVEMvQlJMJzogeyAnaWQnOiAnbHRjYnJsJywgJ3N5bWJvbCc6ICdMVEMvQlJMJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ0JSTCcgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDMsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDA0LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMDAwMDksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0Y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BiYWxhbmNlc1tpZF07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBwYXJzZUZsb2F0IChiYWxhbmNlWyd0b3RhbCddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhdmFpbGFibGUnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICghbWFya2V0KSB7XG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLnNhZmVWYWx1ZSAodGhpcy5tYXJrZXRzQnlJZCwgb3JkZXJbJ3BhaXInXSk7XG4gICAgICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxIChvcmRlclsnY3JlYXRlZCddKTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciw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Cc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAndHJhZGVzJzogdHJhZGVzLFxuICAgICAgICAgICAgJ2ZlZSc6IHtcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ3F1b3RlJ10sXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdmZWUnKSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFVzZXJPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmljZVRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlK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h0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBsZXQgcXVlcnlTdHJpbmcgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKHF1ZXJ5U3RyaW5nLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnlTdHJpbmc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnNlY29uZHMgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGNvbnRlbnQgPSAnJztcbiAgICAgICAgICAgIGlmIChxdWVyeVN0cmluZy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgY29udGVudCA9IHRoaXMuaGFzaCAodGhpcy5lbmNvZGUgKGJvZHkpLCAnbWQ1JywgJ2Jhc2U2NCcpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gJyc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdXJpID0gdGhpcy5lbmNvZGVVUklDb21wb25lbnQgKHVybCkudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IFsgdGhpcy5hcGlLZXksIG1ldGhvZCwgdXJpLCB0aW1lc3RhbXAsIG5vbmNlLCBjb250ZW50IF0uam9pbiAoJycpO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuYmFzZTY0VG9CaW5hcnkgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChwYXlsb2FkKSwgdGhpcy5lbmNvZGUgKHNlY3JldCksICdzaGEyNTYnLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBzaWduYXR1cmUgPSB0aGlzLmJpbmFyeVRvU3RyaW5nIChzaWduYXR1cmUpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBbIHRoaXMuYXBpS2V5LCBzaWduYXR1cmUsIG5vbmNlLCB0aW1lc3RhbXAgXS5qb2luICgnOicpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQXV0aG9yaXphdGlvbic6ICdhbXggJyArIGF1dGgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ1BPU1QnKSB7XG4gICAgICAgICAgICAgICAgaGVhZGVyc1snQ29udGVudC1UeXBlJ10gPSAnYXBwbGljYXRpb24vanNvbjsgY2hhcnNldD1VVEYtOCc7XG4gICAgICAgICAgICAgICAgaGVhZGVyc1snQ29udGVudC1MZW5ndGgnXSA9IGJvZHkubGVuZ3RoO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChxdWVyeVN0cmluZy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnlTdHJpbmc7XG4gICAgICAgICAgICAgICAgYm9keSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuY29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vbm92YWV4Y2hhbmdlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL25vdmFleGNoYW5nZS5jb20vcmVtb3RlL2ZhcScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3tiYXNlY3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2luZm8ve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29yZGVyaGlzdG9yeS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbm9yZGVycy97cGFpcn0vYnV5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW5vcmRlcnMve3BhaXJ9L3NlbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbm9yZGVycy97cGFpcn0vYm90aC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVub3JkZXJzL3twYWlyfS97b3JkZXJ0eXBlfS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbGFuY2VzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YmFsYW5jZS97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdHMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR3aXRoZHJhd2Fscy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG5ld2RlcG9zaXRhZGRyZXNzL3tjdXJyZW5jeX0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRkZXBvc2l0YWRkcmVzcy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXlvcGVub3JkZXJzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXlvcGVub3JkZXJzX21hcmtldC97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxvcmRlci97b3JkZXJpZH0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVoaXN0b3J5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdGhpc3RvcnkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR3aXRoZHJhd2FsaGlzdG9yeS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHN0YXR1cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHN0YXR1cy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnbWFya2V0cyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ21hcmtldG5hbWUnXTtcbiAgICAgICAgICAgIGxldCBbIHF1b3RlLCBiYXNlIF0gPSBpZC5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmIChtYXJrZXRbJ2Rpc2FibGVkJ10pXG4gICAgICAgICAgICAgICAgYWN0aXZlID0gZmFsc2U7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRPcGVub3JkZXJzUGFpckJvdGggKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29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0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGxvY2tib3ggPSBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnRfbG9ja2JveCddKTtcbiAgICAgICAgICAgIGxldCB0cmFkZXMgPSBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnRfdHJhZGVzJ10pO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiB0aGlzLnN1bSAobG9ja2JveCwgdHJhZGVzKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnRfdG90YWwnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICh0eXBlID09PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgYW1vdW50ID0gYW1vdW50LnRvU3RyaW5nIC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AgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKVxuICAgICAgICAgICAgdXJsICs9IGFwaSArICcvJztcbiAgICAgICAgdXJsICs9IHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlICh7ICdub25jZSc6IG5vbmNlIH0pO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHVybCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG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4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnb2tjb2luY255JyxcbiAgICAgICAgICAgICduYW1lJzogJ09LQ29pbiBDTlknLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDTicsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2Njc5Mi04YmU5MTU3YS01ZWU1LTExZTctOTI2Yy02ZDY5YjhkMzM3OGQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd3d3Lm9rY29pbi5jbicsXG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cub2tjb2luLmNuL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3Lm9rY29pbi5jbi9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5va2NvaW4uY24nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cub2tjb2luLmNuL3Jlc3RfZ2V0U3RhcnRlZC5odG1sJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0NOWSc6IHsgJ2lkJzogJ2J0Y19jbnknLCAnc3ltYm9sJzogJ0JUQy9DTlknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ05ZJywgJ3R5cGUnOi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k9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmdXR1cmVzJzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4dGVuc2lvbic6ICcuZG8nLCAvLyBhcHBlbmRlZCB0byBlbmRwb2ludCBVUkxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbWluJyxcbiAgICAgICAgICAgICAgICAnM20nOiAnM21pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtaW4nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaG91cicsXG4gICAgICAgICAgICAgICAgJzJoJzogJzJob3VyJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnNGhvdXInLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aG91cicsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnM2QnOiAnM2RheScsXG4gICAgICAgICAgICAgICAgJzF3JzogJzF3ZWVrJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3ZWInOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy9jdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3Byb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlX3JhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2VzdGltYXRlZF9wcmljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2hvbGRfYW1vdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfaW5kZXgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9rbGluZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3ByaWNlX2xpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrbGluZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3RjcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRfcmVjb3JkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmF0Y2hfdHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JvcnJvd19tb25leScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9ycm93X29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JvcnJvd3NfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX2JvcnJvdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3RjX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9iYXRjaF90cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2Rldm9sdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9leHBsb3NpdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9vcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfb3JkZXJzX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9wb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3Bvc2l0aW9uXzRmaXgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV90cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3RyYWRlc19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdXNlcmluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV91c2VyaW5mb180Zml4JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kX2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9mZWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyc19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvdGNfb3JkZXJfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3RjX29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcGF5bWVudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3VibWl0X290Y19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX290Y19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VucmVwYXltZW50c19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyaW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NzkxLTg5ZmZiNTAyLTVlZTUtMTFlNy04YTViLWM1OTUwYjY4YWM2NS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly93d3cub2tjb2luLmNvbS92MicsXG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cub2tjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3d3dy5va2NvaW4uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lm9rY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5va2NvaW4uY29tL3Jlc3RfZ2V0U3RhcnRlZC5odG1sJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5wbWpzLmNvbS9wYWNrYWdlL29rY29pbi5jb20nLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMixcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcxMDA5JzogT3JkZXJOb3RGb3VuZCwgLy8gZm9yIHNwb3QgbWFya2V0cywgY2FuY2VsbGluZyBjbG9zZWQgb3JkZXJcbiAgICAgICAgICAgICAgICAnMTA1MSc6IE9yZGVyTm90Rm91bmQsIC8vIGZvciBzcG90IG1hcmtldHMsIGNhbmNlbGxpbmcgXCJqdXN0IGNsb3NlZFwiIG9yZGVyXG4gICAgICAgICAgICAgICAgJzEwMTknOiBPcmRlck5vdEZvdW5kLCAvLyBvcmRlciBjbG9zZWQ/XG4gICAgICAgICAgICAgICAgJzIwMDE1JzogT3JkZXJOb3RGb3VuZCwgLy8gZm9yIGZ1dHVyZSBtYXJrZXRzXG4gICAgICAgICAgICAgICAgJzEwMTMnOiBJbnZhbGlkT3JkZXIsIC8vIG5vIGNvbnRyYWN0IHR5cGUgKFBSLTExMDEpXG4g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lnaXQnXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRzW2ldWydtYXhQcmljZURpZ2l0J10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgbGV0IG1pbkFtb3VudCA9IG1hcmtldHNbaV1bJ21pblRyYWRlU2l6ZSddO1xuICAgICAgICAgICAgbGV0IG1pblByaWNlID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAobWFya2V0c1tpXVsnb25saW5lJ10gIT09IDApO1xuICAgICAgICAgICAgbGV0IGJhc2VOdW1lcmljSWQgPSBtYXJrZXRzW2ldWydiYXNlQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZU51bWVyaWNJZCA9IG1hcmtldHNbaV1bJ3F1b3RlQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYmFzZU51bWVyaWNJZCc6IGJhc2VOdW1lcmljSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlTnVtZXJpY0lkJzogcXVvdGVOdW1lcmljSWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXRzW2ldLFxuICAgICAgICAgICAgICAgICd0eXBlJzogJ3Nwb3QnLFxuICAgICAgICAgICAgICAgICdzcG90JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZnV0dXJlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtaW5BbW91bnQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWluUHJpY2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtaW5BbW91bnQgKiBtaW5QcmljZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKG1hcmtldCk7XG4gICAgICAgICAgICBsZXQgZnV0dXJlUXVvdGUgPSAobWFya2V0WydxdW90ZSddID09PSAnVVNEVCcpID8gJ1VTRCcgOiBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgICAgICBsZXQgZnV0dXJlU3ltYm9sID0gbWFya2V0WydiYXNlJ10gKyAnLycgKyBmdXR1cmVRdW90ZTtcbiAgICAgICAgICAgIGlmICgodGhpcy5oYXNbJ2Z1dHVyZXMnXSkgJiYgKGZ1dHVyZVN5bWJvbCBpbiBmdXR1cmVNYXJrZXRzKSkge1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAobWFya2V0LCB7XG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6ICdVU0QnLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydiYXNlJ10gKyAnL1VTRCcsXG4gICAgICAgICAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXS5yZXBsYWNlICgndXNkdCcsICd1c2QnKSxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBtYXJrZXRbJ3F1b3RlSWQnXS5yZXBsYWNlICgndXNkdCcsICd1c2QnKSxcbiAgICAgICAgICAgICAgICAgICAgJ3R5cGUnOiAnZnV0dXJlJyxcbiAgICAgICAgICAgICAgICAgICAgJ3Nwb3QnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9ICdwdWJsaWNHZXQnO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlb2YgbGltaXQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgcmVxdWVzdFsnc2l6ZSddID0gbGltaXQ7XG4gICAgICAgIGlmIChtYXJrZXRbJ2Z1dHVyZSddKSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ0Z1dHVyZSc7XG4gICAgICAgICAgICByZXF1ZXN0Wydjb250cmFjdF90eXBlJ10gPSAndGhpc193ZWVrJzsgLy8gbmV4dF93ZWVrLCBxdWFydGVyXG4gICAgICAgIH1cbiAgICAgICAgbWV0aG9kICs9ICdEZXB0aCc7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vayk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3RpbWVzdGFtcCddO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdzeW1ib2wnIGluIHRpY2tlcikge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IHRpY2tlclsnc3ltYm9sJ107XG4gICAgICAgICAgICAgICAgaWYgKG1hcmtldElkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW21hcmtldElkXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdCcpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdoaWdoJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvdycpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdidXknKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2wnKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChze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ICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKHR5cGUgPT09ICdsaW1pdCcpIHtcbiAgICAgICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgb3JkZXJbJ3R5cGUnXSArPSAnX21hcmtldCc7XG4gICAgICAgICAgICAgICAgaWYgKHNpZGUgPT09ICdidXknKSB7XG4gICAgICAgICAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gdGhpcy5zYWZlRmxvYXQgKHBhcmFtcywgJ2Nvc3QnKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFvcmRlclsncHJpY2UnXSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBtYXJrZXQgYnV5IG9yZGVycyByZXF1aXJlIGFuIGFkZGl0aW9uYWwgY29zdCBwYXJhbWV0ZXIsIGNvc3QgPSBwcmljZSAqIGFtb3VudCcpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcGFyYW1zID0gdGhpcy5vbWl0IChwYXJhbXMsICdjb3N0Jyk7XG4gICAgICAgIG1ldGhvZCArPSAnVHJhZGUnO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0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kTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnb3JkZXJfaWQnOiBpZCxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IG1ldGhvZCA9ICdwcml2YXRlUG9zdCc7XG4gICAgICAgIGlmIChtYXJrZXRbJ2Z1dHVyZSddKSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ0Z1dHVyZUNhbmNlbCc7XG4gICAgICAgICAgICByZXF1ZXN0Wydjb250cmFjdF90eXBlJ10gPSAndGhpc193ZWVrJzsgLy8gbmV4dF93ZWVrLCBxdWFydGVyXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ0NhbmNlbE9yZGVyJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJTdGF0dXMgKHN0YXR1cykge1xuICAgICAgICBpZiAoc3RhdHVzID09PSAtMSlcbiAgICAgICAgICAgIHJldHVybiAnY2FuY2VsZWQnO1xuICAgICAgICBpZiAoc3RhdHVzID09PSAwKVxuICAgICAgICAgICAgcmV0dXJuICdvcGVuJztcbiAgICAgICAgaWYgKHN0YXR1cyA9PT0gMSlcbiAgICAgICAgICAgIHJldHVybiAnb3Blbic7XG4gICAgICAgIGlmIChzdGF0dXMgPT09IDIpXG4gICAgICAgICAgICByZXR1cm4gJ2Nsb3NlZCc7XG4gICAgICAgIGlmIChzdGF0dXMgPT09IDMpXG4gICAgICAgICAgICByZXR1cm4gJ29wZW4nO1xuICAgICAgICBpZiAoc3RhdHVzID09PSA0KVxuICAgICAgICAgICAgcmV0dXJuICdjYW5jZWxlZCc7XG4gICAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlclNpZGUgKHNpZGUpIHtcbiAgICAgICAgaWYgKHNpZGUgPT09IDEpXG4gICAgICAgICAgICByZXR1cm4gJ2J1eSc7IC8vIG9wZW4gbG9uZyBwb3NpdGlvblxuICAgICAgICBpZiAoc2lkZSA9PT0gMilcbiAgICAgICAgICAgIHJldHVybiAnc2VsbCc7IC8vIG9wZW4gc2hvcnQgcG9zaXRpb25cbiAgICAgICAgaWYgKHNpZGUgPT09IDMpXG4gICAgICAgICAgICByZXR1cm4gJ3NlbGwnOyAvLyBsaXF1aWRhdGUgbG9uZyBwb3NpdGlvblxuICAgICAgICBpZiAoc2lkZSA9PT0gNClcbiAgICAgICAgICAgIHJldHVybiAnYnV5JzsgLy8gbGlxdWlkYXRlIHNob3J0IHBvc2l0aW9uXG4gICAgICAgIHJldHVybiBzaWRlO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHNpZGUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCB0eXBlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ3R5cGUnIGluIG9yZGVyKSB7XG4gICAgICAgICAgICBpZiAoKG9yZGVyWyd0eXBlJ10gPT09ICdidXknKSB8fCAob3JkZXJbJ3R5cGUnXSA9PT0gJ3NlbGwnKSkge1xuICAgICAgICAgICAgICAgIHNpZGUgPSBvcmRlclsndHlwZSddO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAnbGltaXQnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChvcmRlclsndHlwZSddID09PSAnYnV5X21hcmtldCcpIHtcbiAgICAgICAgICAgICAgICBzaWRlID0gJ2J1eSc7XG4gICAgICAgICAgICAgICAgdHlwZSA9ICdtYXJrZXQnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChvcmRlclsndHlwZSddID09PSAnc2VsbF9tYXJrZXQnKSB7XG4gICAgICAgICAgICAgICAgc2lkZSA9ICdzZWxsJztcbiAgICAgICAgICAgICAgICB0eXBlID0gJ21hcmtldCc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHNpZGUgPSB0aGlzLnBhcnNlT3JkZXJTaWRlIChvcmRlclsndHlwZSddKTtcbiAgICAgICAgICAgICAgICBpZiAoKCdjb250cmFjdF9uYW1lJyBpbiBvcmRlcikgfHwgKCdsZXZlcl9yYXRlJyBpbiBvcmRlcikpXG4gICAgICAgICAgICAgICAgICAgIHR5cGUgPSAnbWFyZ2luJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5wYXJzZU9yZGVyU3RhdHVzIChvcmRlclsnc3RhdHVzJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdzeW1ib2wnIGluIG9yZGVyKVxuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3ltYm9sJ10gaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbb3JkZXJbJ3N5bWJvbCddXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGNyZWF0ZURhdGVGaWVsZCA9IHRoaXMuZ2V0Q3JlYXRlRGF0ZUZpZWxkICgpO1xuICAgICAgICBpZiAoY3JlYXRlRGF0ZUZpZWxkIGluIG9yZGVyKVxu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ZCArICcgZmV0Y2hPcmRlcnMoKSByZXF1aXJlcyBvcmRlcl9pZCBwYXJhbSBmb3IgZnV0dXJlcyBtYXJrZXQgJyArIHN5bWJvbCArICcgKGEgc3RyaW5nIG9mIG9uZSBvciBtb3JlIG9yZGVyIGlkcywgY29tbWEtc2VwYXJhdGVkKScpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IHN0YXR1cyA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmICgndHlwZScgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICAgICAgc3RhdHVzID0gcGFyYW1zWyd0eXBlJ107XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCdzdGF0dXMnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgICAgIHN0YXR1cyA9IHBhcmFtc1snc3RhdHVzJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBuYW1lID0gb3JkZXJfaWRfaW5fcGFyYW1zID8gJ3R5cGUnIDogJ3N0YXR1cyc7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGZldGNoT3JkZXJzKCkgcmVxdWlyZXMgJyArIG5hbWUgKyAnIHBhcmFtIGZvciBzcG90IG1hcmtldCAnICsgc3ltYm9sICsgJyAoMCAtIGZvciB1bmZpbGxlZCBvcmRlcnMsIDEgLSBmb3IgZmlsbGVkL2NhbmNlbGVkIG9yZGVycyknKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChvcmRlcl9pZF9pbl9wYXJhbXMpIHtcbiAgICAgICAgICAgICAgICBtZXRob2QgKz0gJ09yZGVyc0luZm8nO1xuICAgICAgICAgICAgICAgIHJlcXVlc3QgPSB0aGlzLmV4dGVuZCAocmVxdWVzdCwge1xuICAgICAgICAgICAgICAgICAgICAndHlwZSc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAgICAgJ29yZGV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sICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChib2R5Lmxlbmd0aCA8IDIpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmICgnZXJyb3JfY29kZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgZXJyb3IgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnZXJyb3JfY29kZScpO1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgIGlmIChlcnJvciBpbiB0aGlzLmV4Y2VwdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IEV4Y2VwdGlvbkNsYXNzID0gdGhpcy5leGNlcHRpb25zW2Vycm9yXTtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2VwdGlvbkNsYXNzIChtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAobWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdyZXN1bHQnIGluIHJlc3BvbnNlKVxuICAgICAgICAgICAgICAgIGlmICghcmVzcG9uc2VbJ3Jlc3VsdCddKVxuICAgICA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NDc1NmE3LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL3d3dy5va2V4LmNvbS92MicsXG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cub2tleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cub2tleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cub2tleC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL29rY29pbi1va2V4L0FQSS1kb2NzLU9LRXguY29tJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5va2V4LmNvbS9mZWVzLmh0bWwnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdGQUlSJzogJ0ZhaXJHYW1lJyxcbiAgICAgICAgICAgICAgICAnSE1DJzogJ0hpIE11dHVhbCBTb2NpZXR5JyxcbiAgICAgICAgICAgICAgICAnTUFHJzogJ01hZ2dpZScsXG4gICAgICAgICAgICAgICAgJ05BTk8nOiAnWFJCJyxcbiAgICAgICAgICAgICAgICAnWU9ZTyc6ICdZT1lPVycsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjYWxjdWxhdGVGZWUgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSwgdGFrZXJPck1ha2VyID0gJ3Rha2VyJywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICBsZXQga2V5ID0gJ3F1b3RlJztcbiAgICAgICAgbGV0IHJhdGU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AgICAgICAgICAgICAgbWFya2V0c1tpXVsndGFrZXInXSA9IDAuMDAyMDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbWFya2V0c1tpXVsnbWFrZXInXSA9IDAuMDAwMztcbiAgICAgICAgICAgICAgICBtYXJrZXRzW2ldWyd0YWtlciddID0gMC4wMDA1O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBtYXJrZXRzO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7fTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJzICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gcmVzcG9uc2VbJ3RpY2tlcnMnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChyZXNwb25zZVsnZGF0ZSddKSAqIDEwMDA7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aWNrZXJzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoJ3N5bWJvbCcgaW4gdGlja2VyKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldElkID0gdGlja2VyWydzeW1ib2wnXTtcbiAgICAgICAgICAgICAgICBpZiAobWFya2V0SWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgICAgICB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RlTGltaXQnOiAyMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc5MDU2NC1hOTQ1YTlkNC01ZmY5LTExZTctOWQyZC1iNjM1NzYzZjJmMjQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vcGF5bWl1bS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LnBheW1pdW0uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL1BheW1pdW0vYXBpLWRvY3VtZW50YXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cucGF5bWl1bS5jb20vcGFnZS9kZXZlbG9wZXJzJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb3VudHJpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RhdGEve2lkfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RhdGEve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RhdGEve2lkfS9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl9jaGFydHMve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fY2hhcnRzL3tpZH0vZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWVyY2hhbnQvZ2V0X3BheW1lbnQve1VVSUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9hZGRyZXNzZXMve2J0Y19hZGRyZXNzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXJzL3tVVUlEfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcmljZV9hbGVydHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9hZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcGF5bWVudF9yZXF1ZXN0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcmljZV9hbGVydHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21lcmNoYW50L2NyZWF0ZV9wYXltZW50JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL29yZGVycy97VVVJRH0vY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3ByaWNlX2FsZXJ0cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnZXVyJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDU5LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwNTksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0VXNlciAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgbG93ZXJjYXNlID0gY3VycmVuY3kudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gJ2JhbGFuY2VfJyArIGxvd2VyY2FzZTtcbiAgICAgICAgICAgIGxldCBsb2NrZW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iAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVt2b2x1bWVdLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldERhdGFJZFRyYWRlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICd0eXBlJzogdGhpcy5jYXBpdGFsaXplICh0eXBlKSArICdPcmRlcicsXG4gICAgICAgICAgICAnY3VycmVuY3knOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ2RpcmVjdGlvbic6IHNpZGUsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VXNlck9yZGVycyAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0d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cmw7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgICAgICBhdXRoICs9IGJvZHk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQXBpLUtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdBcGktU2lnbmF0dXJlJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpLFxuICAgICAgICAgICAgICAgICdBcGktTm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoJ2Vycm9ycycgaW4gcmVzcG9uc2UpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZC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gICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdjcmVhdGVEZXBvc2l0QWRkcmVzcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2VkaXRPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogJ2VtdWxhdGVkJyxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzVtJzogMzAwLFxuICAgICAgICAgICAgICAgICcxNW0nOiA5MDAsXG4gICAgICAgICAgICAgICAgJzMwbSc6IDE4MDAsXG4gICAgICAgICAgICAgICAgJzJoJzogNzIwMCxcbiAgICAgICAgICAgICAgICAnNGgnOiAxNDQwMCxcbiAgICAgICAgICAgICAgICAnMWQnOiA4NjQwMCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2ODE3LWU5NDU2MzEyLTVlZTYtMTFlNy05YjNjLWI2MjhjYTU2MjZhNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vcHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vdHJhZGluZ0FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vcG9sb25pZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9wb2xvbmlleC5jb20vc3VwcG9ydC9hcGkvJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHA6Ly9wYXN0ZWJpbi5jb20vZE1YN21aRTAnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybjI0aFZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuQ2hhcnREYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5DdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5Mb2FuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVyblRpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbExvYW5PZmZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nsb3NlTWFyZ2luUG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZUxvYW5PZmZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2VuZXJhdGVOZXdBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRNYXJnaW5Qb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luQnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5TZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb3ZlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkFjdGl2ZUxvYW5zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5BdmFpbGFibGVBY2NvdW50QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5Db21wbGV0ZUJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5EZXBvc2l0QWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5EZXBvc2l0c1dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5GZWVJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5MZW5kaW5nSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuTWFyZ2luQWNjb3VudFN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybk9wZW5Mb2FuT2ZmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcmRlclRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGFibGVCYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0b2dnbGVBdXRvUmVuZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxNSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDI1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7fSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMDAwMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogMTAwMDAwMDAwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAuMDAwMDAwMDEsXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiAxMDAwMDAwMDAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMDAwMDAwLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogMTAwMDAwMDAwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnQlRNJzogJ0JpdG1hcmsnLFxuICAgICAgICAgICAgICAgICdTVFInOiAnWExNJyxcbiAgICAgICAgICAgICAgICAnQkNDJzogJ0JUQ3RhbGtjb2luJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNhbGN1bGF0ZUZlZSAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlLCB0YWtlck9yTWFrZXIgPSAndGFrZXInLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgIGxldCBrZXkgPSAncXVvdGUnO1xuICAgICAgICBsZXQgcmF0ZSA9IG1hcmtldFt0YWtlck9yTWFrZXJdO1xuICAgICAgICBsZXQgY29zdCA9IHBhcnNlRmxvYXQgKHRoaXMuY29zdFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCAqIHJhdGUpKTtcbiAgICAgICAgaWYgKHNpZGUgPT09ICdzZWxsJykge1xuICAgICAgICAgICAgY29zdCAqPSBwcmljZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGtleSA9ICdiYXNlJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3R5cGUnOiB0YWtlck9yTWFrZXIsXG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRba2V5XSxcbiAgICAgICAgICAgICdyYXRlJzogcmF0ZSxcbiAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAodGhpcy5mZWVUb1ByZWNpc2lvbiAoc3ltYm9sLCBjb3N0KSksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VPSExDViAob2hsY3YsIG1hcmtldCA9IHVuZGVmaW5lZCwgdGltZWZyYW1lID0gJzVtJywgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICBvaGxjdlsnZGF0ZSddICogMTAwMCxcbiAgICAgICAgICAgIG9obGN2WydvcGVuJ10sXG4gICAgICAgICAgICBvaGxjdlsnaGlnaCddLFxuICAgICAgICAgICAgb2hsY3ZbJ2xvdyddLFxuICAgICAgICAgICAgb2hsY3ZbJ2Nsb3NlJ10sXG4gICAgICAgICAgICBvaGxjdlsncXVvdGVWb2x1bWUnXSxcbiAgICAgICAgXTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9ITENWIChzeW1ib2wsIHRpbWVmcmFtZSA9ICc1bScsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0ICh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ZXQgWyBxdW90ZSwgYmFzZSBdID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMC4wMDAwMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiAxMDAwMDAwMDAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMC4wMDAwMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiAxMDAwMDAwMDAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMDAwMDAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IDEwMDAwMDAwMDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFJldHVybkNvbXBsZXRlQmFsYW5jZXMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnYWNjb3VudCc6ICdhbGwnLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaWRdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlJ10pLFxuICAgICAgICAgICAgICAgICd1c2VkJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnb25PcmRl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YW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgICAgICdmZWUnOiB0aGlzLnNhZmVGbG9hdCAoY3VycmVuY3ksICd0eEZlZScpLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ3R4RmVlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgIC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0gY3VycmVuY3lQYWlyLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gcGFydHNbMF07XG4gICAgICAgICAgICAgICAgYmFzZSA9IHBhcnRzWzFdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgYmFzZSA9IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgcXVvdGUgPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHNpZGUgPSB0cmFkZVsndHlwZSddO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3RvdGFsJyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdhbW91bnQnKTtcbiAgICAgICAgaWYgKCdmZWUnIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBsZXQgcmF0ZSA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2ZlZScpO1xuICAgICAgICAgICAgbGV0IGZlZUNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoc2lkZSA9PT0gJ2J1eScpIHtcbiAgICAgICAgICAgICAgICBjdXJyZW5jeSA9IGJhc2U7XG4gICAgICAgICAgICAgICAgZmVlQ29zdCA9IGFtb3VudCAqIHJhdGU7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGN1cnJlbmN5ID0gcXVvdGU7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBjb3N0ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgZmVlQ29zdCA9IGNvc3QgKiByYXRlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdyYXRlJzogcmF0ZSxcbiAgICAgICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAndHJhZGVJRCcpLFxuICAgICAgICAgICAgJ29yZGVyJzogdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ29yZGVyTnVtYmVyJyksXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdyYXRlJyksXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgI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yJzogcGFpciB9O1xuICAgICAgICBpZiAodHlwZW9mIHNpbmNlICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgcmVxdWVzdFsnc3RhcnQnXSA9IHBhcnNlSW50IChzaW5jZSAvIDEwMDApO1xuICAgICAgICAgICAgcmVxdWVzdFsnZW5kJ10gPSB0aGlzLnNlY29uZHMgKCk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gbGltaXQgaXMgZGlzYWJsZWQgKGRvZXMgbm90IHJlYWxseSB3b3JrIGFzIGV4cGVjdGVkKVxuICAgICAgICBpZiAobGltaXQpXG4gICAgICAgICAgICByZXF1ZXN0WydsaW1pdCddID0gcGFyc2VJbnQgKGxpbWl0KTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFJldHVyblRyYWRlSGlzdG9yeSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlLCBtYXJrZXQpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRyYWRlcyA9IHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlW2lkXSwgbWFya2V0KTtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCB0cmFkZXMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0cmFkZXNbal0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLmZpbHRlckJ5U2luY2VMaW1pdCAocmVzdWx0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMuc2FmZUludGVnZXIgKG9yZGVyLCAndGltZXN0YW1wJyk7XG4gICAgICAgIGlmICghdGltZXN0YW1wKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKG9yZGVyWydkYXRlJ10pO1xuICAgICAgICBsZXQgdHJhZGVzID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ3Jlc3VsdGluZ1RyYWRlcycgaW4gb3JkZXIpXG4gICAgICAgICAgICB0cmFkZXMgPSB0aGlzLnBhcnNlVHJhZGVzIChvcmRlclsncmVzdWx0aW5nVHJhZGVzJ10sIG1hcmtldCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnYW1vdW50Jyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdzdGFydGluZ0Ftb3VudCcsIHJlbWFpbmluZyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBjb3N0ID0gMDtcbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIGNvc3QgPSBmaWxsZWQgKiBwcmljZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGZpbGxlZCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgdHJhZGVzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGZpbGxlZCA9IDA7XG4gICAgICAgICAgICAgICAgY29zdCA9IDA7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0cmFkZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRyYWRlID0gdHJhZGVzW2ldO1xuICAgICAgICAgICAgICAgICAgICBsZXQgdHJhZGVBbW91bnQgPSB0cmFkZVsnYW1vdW50J107XG4gICAgICAgICAgICAgICAgICAgIGxldCB0cmFkZVByaWNlID0gdHJhZGVbJ3ByaWNlJ107XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IHRoaXMuc3VtIChmaWxsZWQsIHRyYWRlQW1vdW50KTtcbiAgICAgICAgICAgICAgICAgICAgY29zdCArPSB0cmFkZVByaWNlICogdHJhZGVBbW91bnQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyTnVtYmVyJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBvcmRlclsnc3RhdHVzJ10sXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsnc2lkZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAndHJhZGVzJzogdHJhZGVzLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZU9wZW5PcmRlcnMgKG9yZGVycywgbWFya2V0LCByZXN1bHQgPSBbXSkge1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG9yZGVycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG9yZGVyID0gb3JkZXJzW2ldO1xuICAgICAgICAgICAgbGV0IGV4dGVuZGVkID0gdGhpcy5leHRlbmQgKG9yZGVyLCB7XG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvcGVuJyxcbiAgICAgICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG9yZGVyWydyYXRlJ10sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLnBhcnNlT3JkZXIgKGV4dGVuZGVkLCBtYXJrZXQpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJzIChzeW1ib2wgPSB1bmRlZmluZWQsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHN5bWJvbClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcGFpciA9IG1hcmtldCA/IG1hcmtldFsnaWQnXSA6ICdhbGwnO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0UmV0dXJuT3Blbk9yZGVycyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeVBhaXInOiBwYWlyLFxuICAgICAgICB9KSk7XG4gICAgICAgIGxldCBvcGVuT3JkZXJzID0gW107XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIG9wZW5PcmRlcnMgPSB0aGlzLnBhcnNlT3Blbk9yZGVycyAocmVzcG9uc2UsIG1hcmtldCwgb3Blbk9yZGVycyk7XG4gICA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aGlzLmV4dGVuZCAodGhpcy5vcmRlcnNbaWRdLCBvcGVuT3JkZXJzSW5kZXhlZEJ5SWRbaWRdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRlcnNbaWRdO1xuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3RhdHVzJ10gPT09ICdvcGVuJykge1xuICAgICAgICAgICAgICAgICAgICBvcmRlciA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlsbGVkJzogb3JkZXJbJ2Ftb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlbWFpbmluZyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3JkZXJbJ2Nvc3QnXSA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3JkZXJbJ2ZpbGxlZCddICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcmRlclsnY29zdCddID0gb3JkZXJbJ2ZpbGxlZCddICogb3JkZXJbJ3ByaWNlJ107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gb3JkZXI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRlcnNbaWRdO1xuICAgICAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3ltYm9sJ10gPT09IHN5bWJvb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ICBpZiAodHlwZSA9PT0gJ21hcmtldCcpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgYWxsb3dzIGxpbWl0IG9yZGVycyBvbmx5Jyk7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3QnICsgdGhpcy5jYXBpdGFsaXplIChzaWRlKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBwcmljZSA9IHBhcnNlRmxvYXQgKHByaWNlKTtcbiAgICAgICAgYW1vdW50ID0gcGFyc2VGbG9hdCAoYW1vdW50KTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5UGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdyYXRlJzogdGhpcy5wcmljZVRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlKSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHRoaXMucGFyc2VPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW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mNlbGVkJztcbiAgICAgICAgICAgIGxldCBuZXdpZCA9IHJlc3BvbnNlWydvcmRlck51bWJlciddO1xuICAgICAgICAgICAgdGhpcy5vcmRlcnNbbmV3aWRdID0gdGhpcy5leHRlbmQgKHRoaXMub3JkZXJzW2lkXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IG5ld2lkLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb3BlbicsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgYW1vdW50ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICB0aGlzLm9yZGVyc1tuZXdpZF1bJ2Ftb3VudCddID0gYW1vdW50O1xuICAgICAgICAgICAgcmVzdWx0ID0gdGhpcy5leHRlbmQgKHRoaXMub3JkZXJzW25ld2lkXSwgeyAnaW5mbyc6IHJlc3BvbnNlIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChzeW1ib2wpXG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgICAgICByZXN1bHQgPSB0aGlzLnBhcnNlT3JkZXIgKHJlc3BvbnNlLCBtYXJrZXQpO1xuICAgICAgICAgICAgdGhpcy5vcmRlcnNbcmVzdWx0WydpZCddXSA9IHJlc3VsdDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIHRyeSB7XG4gICAg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AocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3VsdCxcbiAgICAgICAgICAgICdpZCc6IHJlc3VsdFsncmVzcG9uc2UnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV07XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7ICdjb21tYW5kJzogcGF0aCB9LCBwYXJhbXMpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIHF1ZXJ5Wydub25jZSddID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdTaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaG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KTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT09ICdJbnRlcm5hbCBlcnJvci4gUGxlYXNlIHRyeSBhZ2Fpbi4nKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlTm90QXZhaWxhYmxlIChmZWVkYmFjayk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09PSAnT3JkZXIgbm90IGZvdW5kLCBvciB5b3UgYXJlIG5vdCB0aGUgcGVyc29uIHdobyBwbGFjZWQgaXQuJykge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kIChmZWVkYmFjayk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09PSAnSW52YWxpZCBBUEkga2V5L3NlY3JldCBwYWlyLicpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAoZmVlZGJhY2spO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PT0gJ1BsZWFzZSBkbyBub3QgbWFrZSBtb3JlIHRoYW4gOCBBUEkgY2FsbHMgcGVyIHNlY29uZC4nKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uIChmZWVkYmFjayk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yLmluZGV4T2YgKCdUb3RhbCBtdXN0IGJlIGF0IGxlYXN0JykgPj0gMCkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IuaW5kZXhPZiAoJ05vdCBlbm91Z2gnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEluc3VmZmljaWVudEZ1bmRzIChmZWVkYmFjayk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yLmluZGV4T2YgKCdOb25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UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3FyeXB0b3MnLFxuICAgICAgICAgICAgJ25hbWUnOiAnUVJZUFRPUycsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnQ04nLCAnVFcnIF0sXG4gICAgICAgICAgICAndmVyc2lvbic6ICcyJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzA5NTM5MTUtYjE2MTFkYzAtYTQzNi0xMWU3LTg5NDctYzk1YmQ1YTQyMDg2LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5xcnlwdG9zLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5xcnlwdG9zLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZGV2ZWxvcGVycy5xdW9pbmUuY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZGV2ZWxvcGVycy5xdW9pbmUuY29tL3YyJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vcXJ5cHRvcy56ZW5kZXNrLmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDc4NTgxNjctRmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9L3ByaWNlX2xldmVscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhlY3V0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaXJfbGFkZGVycy97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL21haW5fYXNzZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyeXB0b19hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhlY3V0aW9ucy9tZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlhdF9hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbl9iaWRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2FucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfS9leGVjdXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97aWR9L2xvYW5zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nX2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nX2FjY291bnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWF0X2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2FuX2JpZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbl9iaWRzL3tpZH0vY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW5zL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfS9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve2lkfS9jbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL2Nsb3NlX2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ19hY2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdza2lwSnNvbk9uU3RhdHVzQ29kZXMnOiBbNDAxXSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdtZXNzYWdlcyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ0FQSSBBdXRoZW50aWNhdGlvbiBmYWlsZWQnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICAgICAnTm9uY2UgaXMgdG9vIHNtYWxsJzogSW52YWxpZE5vbmNlLFxuICAgICAgICAgICAgICAgICAgICAnT3JkZXIgbm90IGZvdW5kJzogT3JkZXJOb3RGb3VuZCxcbiAgICAgICAgICAgICAgICAgICAgJ3VzZXInOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbm90X2Vub3VnaF9mcmVlX2JhbGFuY2UnOiBJbnN1ZmZpY2llbnRGdW5kcyxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ211c3RfYmVfcG9zaXRpdmUnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdxdWFudGl0eSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZXNzX3RoYW5fb3JkZXJfc2l6ZSc6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFByb2R1Y3RzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2lkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnYmFzZV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydxdW90ZWRfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgbWFrZXIgPSB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWFrZXJfZmVlJyk7XG4gICAgICAgICAgICBsZXQgdGFrZXIgPSB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAndGFrZXJfZmVlJyk7XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gIW1hcmtldFsnZGlzYWJsZWQnXTtcbiAgICAgICAgICAgIGxldCBtaW5BbW91bnQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgbWluUHJpY2UgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoYmFzZSA9PT0gJ0JUQycpIHtcbiAgICAgICAgICAgICAgICBtaW5BbW91bnQgPSAwLjAwMTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoYmFzZSA9PT0gJ0VUSCcpIHtcbiAgICAgICAgICAgICAgICBtaW5BbW91bnQgPSAwLjAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHF1b3RlID09PSAnQlRDJykge1xuICAgICAgICAgICAgICAgIG1pblByaWNlID0gMC4wMDAwMDAwMTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocXVvdGUgPT09ICdFVEgnIHx8IHF1b3RlID09PSAnVVNEJyB8fCBxdW90ZSA9PT0gJ0pQWScpIHtcbiAgICAgICAgICAgICAgICBtaW5QcmljZSA9IDAuMDAwMDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7ICdtaW4nOiBtaW5BbW91bnQgfSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB7ICdtaW4nOiBtaW5QcmljZSB9LFxuICAgICAgICAgICAgICAgICdjb3N0JzogeyAnbWluJzogdW5kZWZpbmVkIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBtaW5QcmljZSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBtaW5BbW91bnQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBsaW1pdHNbJ2Nvc3QnXVsnbWluJ10gPSBtaW5QcmljZSAqIG1pbkFtb3VudDtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBtaW5BbW91bnQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIHByZWNpc2lvblsnYW1vdW50J10gPSAtTWF0aC5sb2cxMCAobWluQW1vdW50KTtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgbWluUHJpY2UgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIHByZWNpc2lvblsncHJpY2UnXSA9IC1NYXRoLmxvZzEwIChtaW5QcmljZSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRzQmFsYW5jZSAocGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2JhbGFuY2UnXSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHRvdGFsLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IHRvdGFsLFxuICAgICAgICAgICAgfTtcbiAgICAgIC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GFzdF90cmFkZWRfcHJpY2UnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaF9tYXJrZXRfYXNrJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvd19tYXJrZXRfYmlkJyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21hcmtldF9iaWQnKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21hcmtldF9hc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1b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2FuY2VsZWQnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdxdWFudGl0eScpO1xuICAgICAgICBsZXQgZmlsbGVkID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZmlsbGVkX3F1YW50aXR5Jyk7XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlJyk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWydvcmRlcl90eXBlJ10sXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogYW1vdW50IC0gZmlsbGVkLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB7XG4gICAgIC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O1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICAgICAncGF0aCc6IHVybCxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAndG9rZW5faWQnOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnaWF0JzogTWF0aC5mbG9vciAobm9uY2UgLyAxMDAwKSwgLy8gaXNzdWVkIGF0XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaGVhZGVyc1snWC1RdW9pbmUtQXV0aCddID0gdGhpcy5qd3QgKHJlcXVlc3QsIHRoaXMuc2VjcmV0KTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgdXJsO1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSwgcmVzcG9uc2UgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKGNvZGUgPj0gMjAwICYmIGNvZGUgPD0gMjk5KVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBjb25zdCBtZXNzYWdlcyA9IHRoaXMuZXhjZXB0aW9uc1snbWVzc2FnZXMnXTtcbiAgICAgICAgaWYgKGNvZGUgPT09IDQwMSkge1xuICAgICAgICAgICAgLy8gZXhwZWN0ZWQgbm9uLWpzb24gcmVzcG9uc2VcbiAgICAgICAgICAgIGlmIChib2R5IGluIG1lc3NhZ2VzKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBtZXNzYWdlc1tib2R5XSAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIHJlc3BvbnNlID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGlmICgoYm9keVswXSA9PT0gJ3snKSB8fCAoYm9keVswXSA9PT0gJ1snKSlcbiAgICAgICAgICAgICAgICByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgY29uc3QgZmVlZGJhY2sgPSB0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSk7XG4gICAgICAgIGlmIChjb2RlID09PSA0MDQpIHtcbiAgICAgICAgICAgIC8vIHsgXCJtZXNzYWdlXCI6IFwiT3JkZXIgbm90IGZvdW5kXCIgfVxuICAgICAgICAgICAgY29uc3QgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdtZXNzYWdlJyk7XG4gICAgICAgICAgICBpZiAobWVzc2FnZSBpbiBtZXNzYWdlcylcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgbWVzc2FnZXNbbWVzc2FnZV0gKGZlZWRiYWNrKTtcbiAgICAgICAgfSBlbHNlIGlmIChjb2RlID09PSA0MjIpIHtcbiAgICAgICAgICAgIC8vIGFycmF5IG9mIGVycm9yIG1lc3NhZ2VzIGlzIHJldHVybmVkIGluICd1c2VyJyBvciAncXVhbnRpdHknIHByb3BlcnR5IG9mICdlcnJvcnMnIG9iamVjdCwgZS5nLjpcbiAgICAgICAgICAgIC8vIHsgXCJlcnJvcnNcIjogeyBcInVzZXJcIjogW1wibm90X2Vub3VnaF9mcmVlX2JhbGFuY2VcIl0gfX1cbiAgICAgICAgICAgIC8vIHsgXCJlcnJvcnNcIjogeyBcInF1YW50aXR5XCI6IFtcImxlc3NfdGhhbl9vcmRlcl9zaXplXCJdIH19XG4gICAgICAgICAgICBpZiAoJ2Vycm9ycycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBlcnJvcnMgPSByZXNwb25zZVsnZXJyb3JzJ107XG4gICAgICAgICAgICAgICAgY29uc3QgZXJyb3JUeXBlcyA9IFsndXNlcicsICdxdWFudGl0eScsICdwcmljZSddO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZXJyb3JUeXBlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBlcnJvclR5cGUgPSBlcnJvclR5cGVzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3JUeXBlIGluIGVycm9ycykge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZXJyb3JNZXNzYWdlcyA9IGVycm9yc1tlcnJvclR5cGVdO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBlcnJvck1lc3NhZ2VzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgbWVzc2FnZSA9IGVycm9yTWVzc2FnZXNbal07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UgaW4gbWVzc2FnZXNbZXJyb3JUeXBlXSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV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ICAgICAgICAgICAgICAgICdDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY4MjUtOThhNmQwZGUtNWVlNy0xMWU3LTlmYTQtMzhlMTFhMmM2ZjUyLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5xdWFkcmlnYWN4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5xdWFkcmlnYWN4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5xdWFkcmlnYWN4LmNvbS9hcGlfaW5mbycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luY2FzaF9kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5jYXNoX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5nb2xkX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbmdvbGRfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aGVyX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXRoZXJfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGl0ZWNvaW5fZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXRlY29pbl93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb29rdXBfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0NBRCc6IHsgJ2lkJzogJ2J0Y19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JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0cmFkZVsnZGF0ZSddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdwcmljZScpLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMuc2Fm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AgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSBbIG5vbmNlLnRvU3RyaW5nICgpLCB0aGlzLnVpZCwgdGhpcy5hcGlLZXkgXS5qb2luICgnJyk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocmVxdWVzdCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAna2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ3NpZ25hdHVyZSc6IHNpZ25hdHVyZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcyk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnY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aHhjaGFuZ2UuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LnNvdXRoeGNoYW5nZS5jb20vSG9tZS9BcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZS97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib29rL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE1hcmtldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dlbmVyYXRlbmV3YWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdEJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ1NNVCc6ICdTbWFydE5vZGUnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBtYXJrZXRbMF07XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsxXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IGlkID0gc3ltYm9sO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAg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B9XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0UHJpY2VTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsnQXQnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydUeXBl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G9yZGVyLCAnQW1vdW50Jyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBjb3N0ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIGFtb3VudCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGFtb3VudDtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgcmVtYWluaW5nICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG9yZGVyVHlwZSA9IG9yZGVyWydUeXBlJ10udG9Mb3dlckNhc2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ0NvZGUnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJUeXBlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICA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3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcXVlcnkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgICAgICdIYXNoJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZH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udHJpZXMnOiAnTVQnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2Njg2OS03NTA1N2ZhMi01ZWU5LTExZTctOWE2Zi0xM2U2NDFmYTQ3MDcuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLnRoZXJvY2t0cmFkaW5nLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3RoZXJvY2t0cmFkaW5nLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYXBpLnRoZXJvY2t0cmFkaW5nLmNvbS9kb2MvdjEvaW5kZXguaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS50aGVyb2NrdHJhZGluZy5jb20vZG9jLycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2lkfS9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMvdGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGlzY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkaXNjb3VudHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9wb3NpdGlvbl9iYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L3Bvc2l0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L3Bvc2l0aW9ucy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19saW1pdHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfbGltaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXRtcy93aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzL3JlbW92ZV9hbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAyLjUsICAvLyB3b3JzdC1jYXNlIHNjZW5hcmlvOiBodHRwczovL3RoZXJvY2t0cmFkaW5nLmNvbS9lbi9wYWdlcy9mZWVzXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRGdW5kc1RpY2tlcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWyd0aWNrZXJzJ10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWyd0aWNrZXJzJ11bcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2Z1bmRfaWQnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGZyZWUgPSBiYWxhbmNlWyd0cmFkaW5nX2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IGJhbGFuY2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCB1c2VkID0gdG90YWwgLSBmcmVlO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBmcmVlLFxuICAgICAgICAgICAgICAgICd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lzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0RnVuZHNJZFRpY2tlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAoIW1hcmtldClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFt0cmFkZVsnZnVuZF9pZCddXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnZGF0ZSddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsnc2lkZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmN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bnNlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlRGVsZXRlRnVuZHNGdW5kSWRPcmRlcnNJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZSArIHVybDtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ1gtVFJULUtFWSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdYLVRSVC1OT05DRSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdYLVRSVC1T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gICAgICAgICAgICAgICAgJzFoJzogJzYwJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMTIwJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnMjQwJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzcyMCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzE0NDAnLFxuICAgICAgICAgICAgICAgICczZCc6ICc0MzIwJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMTAwODAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzkwMzQ5MjEtZTNhY2YwMTYtNDQ4MC0xMWU4LTk5NDUtYTYwODZhMTA4MmZlLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy50aWRlYml0LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cudGlkZWJpdC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cudGlkZWJpdC5jb20vZG9jdW1lbnRzL2FwaV92MicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL21hcmtldHMnLCAvLyBWMk1hcmtldHNKc29uXG4gICAgICAgICAgICAgICAgICAgICAgICAndjIvdGlja2VycycsIC8vIFYyVGlja2Vyc0pzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi90aWNrZXJzL3ttYXJrZXR9JywgLy8gVjJUaWNrZXJzTWFya2V0SnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL3RyYWRlcycsIC8vIFYyVHJhZGVzSnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL3RyYWRlcy97bWFya2V0fScsIC8vIFYyVHJhZGVzTWFya2V0SnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL29yZGVyX2Jvb2snLCAvLyBWMk9yZGVyQm9va0pzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9vcmRlcicsIC8vIFYyT3JkZXJKc29uXG4gICAgICAgICAgICAgICAgICAgICAgICAndjIva193aXRoX3BlbmRpbmdfdHJhZGVzJywgLy8gVjJLV2l0aFBlbmRpbmdUcmFkZXNKc29uXG4gICAgICAgICAgICAgICAgICAgICAgICAndjIvaycsIC8vIFYyS0pzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9kZXB0aCcsIC8vIFYyRGVwdGhKc29uXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW10sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9kZXBvc2l0cycsIC8vIFYyRGVwb3NpdHNKc29uXG4gICAgICAgICAgICAgICAgICAgICAgICAndjIvZGVwb3NpdF9hZGRyZXNzJywgLy8gVjJEZXBvc2l0QWRkcmVzc0pzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9kZXBvc2l0JywgLy8gVjJEZXBvc2l0SnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL21lbWJlcnMvbWUnLCAvLyBWMk1lbWJlcnNNZUpzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9hZGRyZXNzZXMve2FkZHJlc3N9JywgLy8gVjJBZGRyZXNzZXNBZGRyZXNzSnNvblxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9vcmRlci9kZWxldGUnLCAvLyBWMk9yZGVyRGVsZXRlSnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL29yZGVyJywgLy8gVjJPcmRlckpzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9vcmRlci9tdWx0aScsIC8vIFYyT3JkZXJNdWx0aUpzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9vcmRlci9jbGVhcicsIC8vIFYyT3JkZXJDbGVhckpzb25cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHt9LCAvLyBUaGVyZSBpcyBvbmx5IDElIGZlZSBvbiB3aXRoZHJhd2FscyB0byB5b3VyIGJhbmsgYWNjb3VudC5cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcyMDAyJzogSW5zdWZmaWNpZW50RnVuZHMsXG4gICAgICAgICAgICAgICAgJzIwMDMnOiBPcmRlck5vdEZvdW5kLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hEZXBvc2l0QWRkcmVzcyAoY29kZSwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jeSAoY29kZSk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldFYyRGVwb3NpdEFkZHJlc3MgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeVsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGlmICgnc3VjY2VzcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnc3VjY2VzcyddKSB7XG4gICAgICAgICAgICAgICAgbGV0IGFkZHJlc3MgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnYWRkcmVzcycpO1xuICAgICAgICAgICAgICAgIGxldCB0YWcgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnYWRkcmVzc1RhZycpO1xuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgICAgICdhZGRyZXNzJzogdGhpcy5jaGVja0FkZHJlc3MgKGFkZHJlc3MpLFxuICAgICAgICAgICAgICAgICAgICAndGFnJzogdGFnLFxuICAgICAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFYyTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZUlkLCBxdW90ZUlkIF0gPSBzeW1ib2wuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZ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gcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2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JvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ29yZF90eXBlJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ZvbHVtZScpLFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2V4ZWN1dGVkX3ZvbHVtZScpLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3JlbWFpbmluZ192b2x1bWUnKSxcbiAgICAgICAgICAgICd0cmFkZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnbWFya2V0JzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICd2b2x1bWUnOiBhbW91bnQudG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkX3R5cGUnOiB0eXBlLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ2xpbWl0Jykge1xuICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSBwcmljZS50b1N0cmluZyAoKTtcbiAgICAgICAgfVxuICAgIC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HRoaXMucHJpdmF0ZVBvc3RXaXRoZHJhdyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5LnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3N1bSc6IGFtb3VudCxcbiAgICAgICAgICAgICdhZGRyZXNzJzogYWRkcmVzcyxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3VsdCxcbiAgICAgICAgICAgICdpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBlbmNvZGVQYXJhbXMgKHBhcmFtcykge1xuICAgICAgICByZXR1cm4gdGhpcy51cmxlbmNvZGUgKHRoaXMua2V5c29ydCAocGFyYW1zKSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKSArICcuanNvbic7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyByZXF1ZXN0O1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYWNjZXNzX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICd0b25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IG1ldGhvZCArICd8JyArIHJlcXVlc3QgKyAnfCcgKyBxdWVyeTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChwYXlsb2FkKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBsZXQgc3VmZml4ID0gcXVlcnkgKyAnJnNpZ25hdHVyZT0nICsgc2lnbmF0dXJlO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgc3VmZml4O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gc3VmZml4O1xuICAgICAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaG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IGxpcXVpIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAndGlkZXgnLFxuICAgICAgICAgICAgJ25hbWUnOiAnVGlkZXgnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdVSycsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJzMnLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAvLyAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgIC8vICdmZXRjaFRpY2tlcnMnOiB0cnVlXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMDc4MTc4MC0wMzE0OWRjNC1hMTJlLTExZTctODJiYi0zMTNiMjY5ZDI0ZDQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd2ViLnRpZGV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLnRpZGV4LmNvbS9hcGkvMycsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLnRpZGV4LmNvbS90YXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly90aWRleC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly90aWRleC5jb20vZXhjaGFuZ2UvcHVibGljLWFwaScsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3RpZGV4LmNvbS9leGNoYW5nZS9hc3NldHMtc3BlYycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3RpZGV4LmNvbS9leGNoYW5nZS9wYWlycy1zcGVjJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUtZGF0YScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUtZGF0YS97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnTU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RlcG9zaXQpIHtcbiAgICAgICAgICAgICAgICBhY3RpdmUgPSBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnYWN0aXZlJzogY2FuV2l0aGRyYXcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlJzogY3VycmVuY3lbJ3dpdGhkcmF3RmVlJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGNhbkRlcG9zaXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnd2l0aGRyYXdNaW5BbW91dCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ2RlcG9zaXRNaW5BbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGdldFZlcnNpb25TdHJpbmcgKCkge1xuICAgICAgICByZXR1cm4gJyc7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgfSwgcXVlcnkpKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLnNpZ25Cb2R5V2l0aFNlY3JldCAoYm9keSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2UgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLmdldFZlcnNpb25TdHJpbmcgKCkgKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHVybCArPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG59O1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG4vLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuY29uc3QgZm94Yml0ID0gcmVxdWlyZSAoJy4vZm94Yml0LmpzJyk7XG5cbi8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIHVyZHViaXQgZXh0ZW5kcyBmb3hiaXQge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICd1cmR1Yml0JyxcbiAgICAgICAgICAgICduYW1lJzogJ1VyZHVCaXQnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdQSycsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk5MTQ1My0xNTZiZjNhZS02NDgwLTExZTctODJlYi03Mjk1ZmUxYjViYjQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3VyZHViaXQuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYmxpbmt0cmFkZS5jb20vZG9jcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ29wdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ2Jyb2tlcklkJzogJzgnLCAvLyBodHRwczovL2JsaW5rdHJhZGUuY29tL2RvY3MvI2Jyb2tlcnNcbiAgICAgICAgICAgIH0sXG4g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ICd3d3cnOiAnaHR0cHM6Ly93d3cudmF1bHRvcm8uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYXBpLnZhdWx0b3JvLmNvbScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ0dMRCc6ICdHb2xkJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlkYW5kYXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXlvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhdGVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGF0ZXN0dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy9kYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy9ob3VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMvbW9udGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eS97c3ltYm9sfS97dHlwZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL3tzeW1ib2x9L3t0eXBlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1snZGF0YSddO1xuICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydCYXNlQ3VycmVuY3knXTtcbiAgICAgICAgbGV0IHF1b3RlSWQgPSBtYXJrZXRbJ01hcmtldEN1cnJlbmN5J107XG4gICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgbGV0IGlkID0gbWFya2V0WydNYXJrZXROYW1lJ107XG4gICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgIC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vdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogZnJlZSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHVzZWQsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogdG90YWwsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rIChwYXJhbXMpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0ge1xuICAgICAgICAgICAgJ2JpZHMnOiByZXNwb25zZVsnZGF0YSddWzBdWydiJ10sXG4gICAgICAgICAgICAnYXNrcyc6IHJlc3BvbnNlWydkYXRhJ11bMV1bJ3MnXSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYmlkcycsICdhc2tzJywgJ0dvbGRfUHJpY2UnLCAnR29sZF9BbW91bnQnKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcXVvdGUgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEJpZGFuZGFzayAocGFyYW1zKTtcbiAgICAgICAgbGV0IGJpZHNMZW5ndGggPSBxdW90ZVsnYmlkcyddLmxlbmd0aDtcbiAgICAgICAgbGV0IGJpZCA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CA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IHBhdGg7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICB1cmwgKz0gdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICB9LCB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSkpO1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiA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eGNoYW5nZSB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3ZpcndveCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdWaXJXb1gnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ0FUJywgJ0VVJyBdLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2ODk0LTZkYTlkMzYwLTVlZWEtMTFlNy05MGFhLTQxZjI3MTFiNzQwNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cDovL2FwaS52aXJ3b3guY29tL2FwaS9qc29uLnBocCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3LnZpcndveC5jb20vYXBpL3RyYWRpbmcucGhwJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cudmlyd294LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy52aXJ3b3guY29tL2RldmVsb3BlcnMucGhwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2xvZ2luJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncGFzc3dvcmQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbnN0cnVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmVzdFByaWNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0TWFya2V0RGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2VzdGltYXRlTWFya2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRyYWRlZFByaWNlVm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRSYXdUcmFkZURhdGEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFN0YXRpc3RpY3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRlcm1pbmFsTGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0R3JpZExpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEdyaWRTdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5zdHJ1bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEJlc3RQcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE1hcmtldERlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdlc3RpbWF0ZU1hcmtldE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFkZWRQcmljZVZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0UmF3VHJhZGVEYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRTdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUZXJtaW5hbExpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEdyaWRMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRHcmlkU3RhdGlzdGljcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENvbW1pc3Npb25EaXNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENvbW1pc3Npb25EaXNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0R2V0SW5zdHJ1bWVudHMgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHNbJ3Jlc3VsdCddKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydyZXN1bHQnXVtrZXlzW3BdXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnaW5zdHJ1bWVudElEJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0Wydsb25nQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnc2hvcnRDdXJyZW5jeSddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXN1bHQnXVsnYWNjb3VudExpc3QnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IGJhbGFuY2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogdG90YWwsXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogdG90YWwsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0UHJpY2UgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNQb3N0R2V0QmVzdFByaWNlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2xzJzogWyBzeW1ib2wgXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCByZXN1bHQgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIHJldHVybiB7XG4gICAgICA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sb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ29wZW4nKSxcbiAgICAgICAgICAgICdjbG9zZSc6IGNsb3NlLFxuICAgICAgICAgICAgJ2xhc3QnOiBjbG9zZSxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb25nVm9sdW1lJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnc2hvcnRWb2x1bWUnKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBzeW1ib2wgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHNlYyA9IHRoaXMuc2FmZUludGVnZXIgKHRyYWRlLCAndGltZScpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gc2VjICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0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SAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV07XG4gICAgICAgIGxldCBhdXRoID0ge307XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBhdXRoWydrZXknXSA9IHRoaXMuYXBpS2V5O1xuICAgICAgICAgICAgYXV0aFsndXNlciddID0gdGhpcy5sb2dpbjtcbiAgICAgICAgICAgIGF1dGhbJ3Bhc3MnXSA9IHRoaXMucGFzc3dvcmQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnaWQnOiBub25jZSxcbiAgICAgICAgICAgIH0sIGF1dGgsIHBhcmFtcykpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyB9O1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAoe1xuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdwYXJhbXMnOiB0aGlzLmV4dGVuZCAoYXV0aCwgcGFyYW1zKSxcbiAgICAgICAgICAgICAgICAnaWQnOiBub25jZSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09PSAyMDApIHtcbiAgICAgICAgICAgIGlmICgoYm9keVswXSA9PT0gJ3snKSB8fCAoYm9keVswXSA9PT0gJ1snKSkge1xuICAgICAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGlmICgncmVzdWx0JyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICAgICAgICAgICAgICBpZiAoJ2Vycm9yQ29kZScgaW4gcmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZXJyb3JDb2RlID0gcmVzdWx0WydlcnJvckNvZGUnXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlcnJvckNvZGUgIT09ICdPSycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZXJyb3IgcmV0dXJuZWQ6ICcgKyBib2R5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBtYWxmb3JtZWQgcmVzcG9uc2U6IG5vIHJlc3VsdCBpbiByZXNwb25zZTogJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgIC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VlLFxuICAgICAgICAgICAgICAgICdmZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMwNjUyNzUxLWQ3NGVjOGY4LTllMzEtMTFlNy05OGM1LTcxNDY5ZmNlZjAzZS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93ZXgubnovYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93ZXgubnovdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd2V4Lm56JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93ZXgubnovYXBpLzMvZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3dleC5uei90YXBpL2RvY3MnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93ZXgubnovZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFuc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NvaW5EZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdDb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDcmVhdGVDb3Vwb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZGVlbUNvdXBvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05NQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVkMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdtZXNzYWdlcyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2JhZCBzdGF0dXMnOiBPcmRlck5vdEZvdW5kLFxuICAgICAgICAgICAgICAgICAgICAnUmVxdWVzdHMgdG9vIG9mdGVuJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgICAgICdub3QgYXZhaWxhYmxlJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgICAgICdleHRlcm5hbCBzZXJ2aWNlIHVuYXZhaWxhYmxlJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnUlVSJzogJ1JVQicsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndXBkYXRlZCddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbi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CAodGlja2VyLCAndm9sX2N1cicpLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbCcpLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hEZXBvc2l0QWRkcmVzcyAoY29kZSwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7ICdjb2luTmFtZSc6IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjb2RlKSB9O1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0Q29pbkRlcG9zaXRBZGRyZXNzICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjb2RlLFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiByZXNwb25zZVsncmV0dXJuJ11bJ2FkZHJlc3MnXSxcbiAgICAgICAgICAgICd0YWcnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09PSAyMDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdICE9PSAneycpIHtcbiAgICAgICAgICAgICAgICAvLyByZXNwb25zZSBpcyBub3QgSlNPTiAtPiByZXNvcnQgdG8gZGVmYXVsdCBlcnJvciBoYW5kbGVyXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFyZXNwb25zZVsnc3VjY2VzcyddKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGVycm9yID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ2Vycm9yJyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghZXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm5lZCBhIG1hbGZvcm1lZCBlcnJvcjogJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChlcnJvciA9PT0gJ25vIG9yZGVycycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJldHVybmVkIGJ5IGZldGNoT3Blbk9yZGVycyBpZiBubyBvcGVuIG9yZGVycyAoZml4IGZvciAjNDg5KSAtPiBub3QgYW4gZXJyb3JcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjb25zdCBmZWVkYmFjayA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgbWVzc2FnZXMgPSB0aGlzLmV4Y2VwdGlvbnNbJ21lc3NhZ2VzJ107XG4gICAgICAgICAgICAgICAgICAgIGlmIChlcnJvciBpbiBtZXNzYWdlcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IG1lc3NhZ2VzW2Vycm9yXSAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChlcnJvci5pbmRleE9mICgnSXQgaXMgbm90IGVub3VnaCc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BjYWNoZWQgZXZlcnkgMiBzZWNvbmRzXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWNBUEknOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjgwNTk0MTQtZTIzNTk3MGMtNjYyYy0xMWU3LThjM2EtMDhlMzFmNzg2ODRiLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2NyeXB0b3R0bGl2ZXdlYmFwaS54YnRjZS5uZXQ6ODQ0My9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cueGJ0Y2UuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cueGJ0Y2UuY29tL3RyYWRlYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC54YnRjZS5pbmZvL0tub3dsZWRnZWJhc2UvQXJ0aWNsZS9WaWV3LzUyLzI1L3hidGNlLWV4Y2hhbmdlLWFwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZXZlbDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xldmVsMi97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vdGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzZXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc2VydmVyaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzZXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3kve2ZpbHRlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xldmVsMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGV2ZWwyL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2wnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbC97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGljaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGljay97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXNzZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Fzc2V0L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYXNrL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2JpZC9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS9wZXJpb2RpY2l0aWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vdGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS90aWNrcy9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3RvcnkvY2FjaGUve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2FzaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L2NhY2hlL3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9iaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS9jYWNoZS97c3ltYm9sfS9sZXZlbDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS9jYWNoZS97c3ltYm9sfS90aWNrcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS92ZXJzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRTeW1ib2wgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnU3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnTWFyZ2luQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnUHJvZml0Q3VycmVuY3knXTtcbiAgICAgICAgICAgIGlmIChiYXNlID09PSAnRFNIJylcbiAgICAgICAgICAgICAgICBiYXNlID0gJ0RBU0gnO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnSXNUcmFkZUFsbG93ZWQnXSA/IHN5bWJvbCA6IGlkO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRBc3NldCAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIC8vIHhidGNlIG5hbWVzIERBU0ggaW5jb3JyZWN0bHkgYXMgRFNIXG4gICAgICAgICAgICBpZiAodXBwZXJjYXNlID09PSAnRFNIJylcbiAgICAgICAgICAgICAgICB1cHBlcmNhc2UgPSAnREFTSCc7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ0ZyZWVBbW91bnQnXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IGJhbGFuY2VbJ0xvY2tlZEFtb3VudCddLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VbJ0Ftb3VudCddLFxu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ICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgICAgIGlmIChiYXNlID09PSAnRFNIJylcbiAgICAgICAgICAgICAgICAgICAgYmFzZSA9ICdEQVNIJztcbiAgICAgICAgICAgICAgICBpZiAocXVvdGUgPT09ICdEU0gnKVxuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9ICdEQVNIJztcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlckZpbHRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdmaWx0ZXInOiBtYXJrZX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gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0FjY2VwdC1FbmNvZGluZyc6ICdnemlwLCBkZWZsYXRlJyB9O1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdQT1NUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzWydDb250ZW50LVR5cGUnXSA9ICdhcHBsaWNhdGlvbi9qc29uJztcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2UgKyB0aGlzLnVpZCArIHRoaXMuYXBpS2V5ICsgbWV0aG9kICsgdXJsO1xuICAgICAgICAgICAgaWYgKGJvZHkpXG4gICAgICAgICAgICAgICAgYXV0aCArPSBib2R5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hY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iAgICAgICAgICAgICduYW1lJzogJ1lvQml0JyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnUlUnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDMwMDAsIC8vIHJlc3BvbnNlcyBhcmUgY2FjaGVkIGV2ZXJ5IDIgc2Vjb25kc1xuICAgICAgICAgICAgJ3ZlcnNpb24nOiAnMycsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdjcmVhdGVEZXBvc2l0QWRkcmVzcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2OTEwLWNkY2JmZGFlLTVlZWEtMTFlNy05ODU5LTAzZmVhODczMjcyZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly95b2JpdC5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly95b2JpdC5uZXQvdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LnlvYml0Lm5ldCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy55b2JpdC5uZXQvZW4vYXBpLycsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cueW9iaXQubmV0L2VuL2ZlZXMvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY3RpdmVPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0NvaW5zVG9BZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge30sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnQUlSJzogJ0FpckNvaW4nLFxuICAgICAgICAgICAgICAgICdBTkknOiAnQU5JQ29pbicsXG4gICAgICAgICAgICAgICAgJ0FOVCc6ICdBbnRzQ29pbicsXG4gICAgICAgICAgICAgICAgJ0FTVCc6ICdBc3RyYWwnLFxuICAgICAgICAgICAgICAgICdBVE0nOiAnQXV0dW1uY29pbicsXG4gICAgICAgICAgICAgICAgJ0JDQyc6ICdCQ0gnLFxuICAgICAgICAgICAgICAgICdCQ1MnOiAnQml0Y29pblN0YWtlJyxcbiAgICAgICAgICAgICAgICAnQkxOJzogJ0J1bGxlb24nLFxuICAgICAgICAgICAgICAgICdCVFMnOiAnQml0c2hhcmVzMicsXG4gICAgICAgICAgICAgICAgJ0NBVCc6ICdCaXRDbGF2ZScsXG4gICAgICAgICAgICAgICAgJ0NPVic6ICdDb3ZlbiBDb2luJyxcbiAgICAgICAgICAgICAgICAnQ1BDJzogJ0NhcHJpY29pbicsXG4gICAgICAgICAgICAgICAgJ0NTJzogJ0NyeXB0b1Nwb3RzJyxcbiAgICAgICAgICAgICAgICAnRENUJzogJ0Rpc2NvdW50JyxcbiAgICAgICAgICAgICAgICAnREdEJzogJ0RhcmtHb2xkQ29pbicsXG4gICAgICAgICAgICAgICAgJ0RST1AnOiAnRmF1Y2V0Q29pbicsXG4gICAgICAgICAgICAgICAgJ0VSVCc6ICdFcmlzdGljYSBUb2tlbicsXG4gICAgICAgICAgICAgICAgJ0lDTic6ICdpQ29pbicsXG4gICAgICAgICAgICAgICAgJ0tOQyc6ICdLaW5nTiBDb2luJyxcbiAgICAgICAgICAgICAgICAnTElaSSc6ICdMaVppJyxcbiAgICAgICAgICAgICAgICAnTE9DJzogJ0xvY29Db2luJyxcbiAgICAgICAgICAgICAgICAnTE9DWCc6ICdMT0MnLFxuICAgICAgICAgICAgICAgICdMVU4nOiAnTHVuYXJDb2luJyxcbiAgICAgICAgICAgICAgICAnTURUJzogJ01pZG5pZ2h0JyxcbiAgICAgICAgICAgICAgICAnTkFWJzogJ05hdmFqb0NvaW4nLFxuICAgICAgICAgICAgICAgICdPTUcnOiAnT01HYW1lJyxcbiAgICAgICAgICAgICAgICAnU1RLJzogJ1N0YWtlQ29pbicsXG4gICAgICAgICAgICAgICAgJ1BBWSc6ICdFUEFZJyxcbiAgICAgICAgICAgICAgICAnUExDJzogJ1BsYXRpbiBDb2luJyxcbiAgICAgICAgICAgICAgICAnUkVQJzogJ1JlcHVibGljb2luJyxcbiAgICAgICAgICAgICAgICAnUlVSJzogJ1JVQicsXG4gICAgICAgICAgICAgICAgJ1hJTic6ICdYSU5Db2luJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnb3B0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnNSZXF1aXJlc1N5bWJvbCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyU3RhdHVzIChzdGF0dXMpIHtcbiAgICAgICAgbGV0IHN0YXR1c2VzID0ge1xuICAgICAgICAgICAgJzAnOiAnb3BlbicsXG4gICAgICAgICAgICAnMSc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgJzInOiAnY2FuY2VsZWQnLFxuICAgICAgICAgICAgJzMnOiAnb3BlbicsIC8vIG9yIHBhcnRpYWxseS1maWxsZWQgYW5kIGNsb3NlZD8gaHR0cHM6Ly9naXRodWIuY29tL2NjeHQvY2N4dC9pc3N1ZXMvMTU5NFxuICAgICAgICB9O1xuICAgICAgICBpZiAoc3RhdHVzIGluIHN0YXR1c2VzKVxuICAgICAgICAgICAgcmV0dXJuIHN0YXR1c2VzW3N0YXR1c107XG4gICAgICAgIHJldHVybiBzdGF0d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Y2NvdW50ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gcmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY2NvdW50ID0gcmVzdWx0W2N1cnJlbmN5XTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFtrZXldID0gYmFsYW5jZXNbc2lkZV1bbG93ZXJjYXNlXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCh0eXBlb2YgYWNjb3VudFsndG90YWwnXSAhPT0gJ3VuZGVmaW5lZCcpICYmICh0eXBlb2YgYWNjb3VudFsnZnJlZSddICE9PSAndW5kZWZpbmVkJykpXG4gICAgICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZURlcG9zaXRBZGRyZXNzIChjb2RlLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoRGVwb3NpdEFkZHJlc3MgKGNvZGUsIHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbmVlZF9uZXcnOiAxLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGFkZHJlc3MgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAn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oJ0luc3VmZmljaWVudCBmdW5kcycpID49IDApIHsgLy8gbm90IGVub3VnVGggaXMgYSB0eXBvIGluc2lkZSBMaXF1aSdzIG93biBBUEkuLi5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJlc3BvbnNlWydlcnJvcl9sb2cnXSA9PT0gJ1JlcXVlc3RzIHRvbyBvZnRlbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRERvU1Byb3RlY3Rpb24gKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChyZXNwb25zZVsnZXJyb3JfbG9nJ10gPT09ICdub3QgYXZhaWxhYmxlJykgfHwgKHJlc3BvbnNlWydlcnJvcl9sb2cnXSA9PT0gJ2V4dGVybmFsIHNlcnZpY2UgdW5hdmFpbGFibGUnKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBERG9TUHJvdGVjdGlvbiAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG59O1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG4vLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuY29uc3QgYWN4ID0gcmVxdWlyZSAoJy4vYWN4LmpzJyk7XG5cbi8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIHl1bmJpIGV4dGVuZHMgYWN4IHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAneXVuYmknLFxuICAgICAgICAgICAgJ25hbWUnOiAnWVVOQkknLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDTicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YyJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzEnLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1JyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1JyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnNjAnLFxuICAgICAgICAgICAgICAgICcyaCc6ICcxMjAnLFxuICAgICAgICAgICAgICAgICc0aCc6ICcyNDAnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnNzIwJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMTQ0MCcsXG4gICAgICAgICAgICAgICAgJzNkJzogJzQzMjAnLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxMDA4MCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODU3MDU0OC00ZDY0NmM0MC03MTQ3LTExZTctOWNmNi04MzliOTNlNmQ2MjIuanBnJyxcbiAgICAgICAgICAgICAgICAnZXh0ZW5zaW9uJzogJy5qc29uJywgLy8gZGVmYXVsdCBleHRlbnNpb24gYXBwZW5kZWQgdG8gZW5kcG9pbnQgVVJMc1xuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly95dW5iaS5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly95dW5iaS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3l1bmJpLmNvbS9kb2N1bWVudHMvYXBpL2d1aWRlJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8veXVuYmkuY29tL3N3YWdnZXIvJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrX3dpdGhfcGVuZGluZ190cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpbWVzdGFtcCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWRkcmVzc2VzL3thZGRyZXNzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFydG5lcnMvb3JkZXJzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZW1iZXJzL21lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9teScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2RlbGV0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvbXVsdGknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9jbGVhcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cbn07XG4iLCIndXNlIHN0cm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6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2OTI3LTM5Y2EyYWRhLTVlZWItMTFlNy05NzJmLTFiNDE5OTUxOGNhNi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuemFpZi5qcCcsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3phaWYuanAnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwOi8vdGVjaGJ1cmVhdS1hcGktZG9jdW1lbnQucmVhZHRoZWRvY3MuaW8vamEvbGF0ZXN0L2luZGV4Lmh0bWwnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9jb3JwLnphaWYuanAvYXBpLWRvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9jb3JwLnphaWYuanAvYXBpLWRvY3MvYXBpX2xpbmtzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5wbWpzLmNvbS9wYWNrYWdlL3phaWYuanAnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL3lvdTIxOTc5L25vZGUtemFpZicsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3phaWYuanAvZmVlP2xhbmc9ZW4nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IC0wLjAwMDEsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IC0wLjAwMDUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jaWVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY2llcy9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5X3BhaXJzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3lfcGFpcnMvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWN0aXZlX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9pZF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2luZm8yJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfcGVyc29uYWxfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdlY2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlSW52b2ljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW52b2ljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW52b2ljZUlkc0J5T3JkZXJOdW1iZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbEludm9pY2UnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3RsYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbl9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY3RpdmVfcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGVfcG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYW5nZV9wb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyb3Vwcy97Z3JvdXBfaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlL3tncm91cF9pZH0ve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2dyb3VwX2lkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97Z3JvdXBfaWR9L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve2dyb3VwX2lkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY3lQYWlyc0FsbCAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydjdXJyZW5jeV9wYWlyJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogLU1hdGgubG9nMTAgKG1hcmtldFsnaXRlbV91bml0X3N0ZXAnXSksXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydhdXhfdW5pdF9wb2ludCddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsIC8vIGNhbiB0cmFkZSBvciBub3RcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ2l0ZW1fdW5pdF9taW4nKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnYXV4X3VuaXRfbWluJyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXR1cm4nXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlc1snZnVuZHMnXSk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbJ2Z1bmRzJ11bY3VycmVuY3ldO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2UsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKCdkZXBvc2l0JyBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlc1snZGVwb3NpdCddKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBiYWxhbmNlc1snZGVwb3NpdCddW2N1cnJlbmN5XTtcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXM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XAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRpY2tlclsnaGlnaCddLFxuICAgICAgICAgICAgJ2xvdyc6IHRpY2tlclsnbG93J10sXG4gICAgICAgICAgICAnYmlkJzogdGlja2VyWydiaWQnXSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGlja2VyWydhc2snXSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gKHRyYWRlWyd0cmFkZV90eXBlJ10gPT09ICdiaWQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIGxldCBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdpZCcpO1xuICAgICAgICBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0aWQnLCBpZCk7XG4gICAgICAgIGlmICghbWFya2V0KVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydjdXJyZW5jeV9wYWlyJ11dO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQudG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnYW1vdW50J10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVzUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFk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gICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gKG9yZGVyWydhY3Rpb24nXSA9PT0gJ2JpZCcpID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAob3JkZXJbJ3RpbWVzdGFtcCddKSAqIDEwMDA7XG4gICAgICAgIGlmICghbWFya2V0KVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW29yZGVyWydjdXJyZW5jeV9wYWlyJ11dO1xuICAgICAgICBsZXQgcHJpY2UgPSBvcmRlclsncHJpY2UnXTtcbiAgICAgICAgbGV0IGFtb3VudCA9IG9yZGVyWydhbW91bnQnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiB1bmRl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HNlIGlmIChhcGkgPT09ICd0bGFwaScpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJ3RsYXBpJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICd0YXBpJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGJvZHkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ2FwaScsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7X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NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnemInLFxuICAgICAgICAgICAgJ25hbWUnOiAnWkInLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDTicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlTWFya2V0T3JkZXInOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbWluJyxcbiAgICAgICAgICAgICAgICAnM20nOiAnM21pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtaW4nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaG91cicsXG4gICAgICAgICAgICAgICAgJzJoJzogJzJob3VyJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnNGhvdXInLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aG91cicsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnM2QnOiAnM2RheScsXG4gICAgICAgICAgICAgICAgJzF3JzogJzF3ZWVrJyxcbiAgICAgICAgICAgIH0sXG4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FsYW5jZScsXG4gICAgICAgICAgICAgICAgJzIwMDMnOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gJ0luc3VmZmljaWVudCBMVEMgQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgJzIwMDUnOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gJ0luc3VmZmljaWVudCBFVEggQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgJzIwMDYnOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gJ0luc3VmZmljaWVudCBFVEMgQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgJzIwMDcnOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gJ0luc3VmZmljaWVudCBCVFMgQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgJzIwMDknOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gJ0FjY291bnQgYmFsYW5jZSBpcyBub3QgZW5vdWdoJyxcbiAgICAgICAgICAgICAgICAnMzAwMSc6IE9yZGVyTm90Rm91bmQsIC8vICdQZW5kaW5nIG9yZGVycyBub3QgZm91bmQnLFxuICAgICAgICAgICAgICAgICczMDAyJzogSW52YWxpZE9yZGVyLCAvLyAnSW52YWxpZCBwcmljZScsXG4gICAgICAgICAgICAgICAgJzMwMDMnOiBJbnZhbGlkT3JkZXIsIC8vICdJbnZhbGlkIGFtb3VudCcsXG4gICAgICAgICAgICAgICAgJzMwMDQnOiBBdXRoZW50aWNhdGlvbkVycm9yLCAvLyAnVXNlciBkb2VzIG5vdCBleGlzdCcsXG4gICAgICAgICAgICAgICAgJzMwMDUnOiBFeGNoYW5nZUVycm9yLCAvLyAnSW52YWxpZCBwYXJhbWV0ZXInLFxuICAgICAgICAgICAgICAgICczMDA2JzogQXV0aGVudGljYXRpb25FcnJvciwgLy8gJ0ludmFsaWQgSVAgb3IgaW5jb25zaXN0ZW50IHdpdGggdGhlIGJvdW5kIElQJyxcbiAgICAgICAgICAgICAgICAnMzAwNyc6IEF1dGhlbnRpY2F0aW9uRX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gICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzcG90IEFQSVxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzTmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcnNJZ25vcmVUcmFkZVR5cGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFVuZmluaXNoZWRPcmRlcnNJZ25vcmVUcmFkZVR5cGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEFjY291bnRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRVc2VyQWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0V2l0aGRyYXdBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRXaXRoZHJhd1JlY29yZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Q2hhcmdlUmVjb3JkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRDbnlXaXRoZHJhd1JlY29yZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Q255Q2hhcmdlUmVjb3JkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBsZXZlcmFnZSBBUElcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRMZXZlckFzc2V0c0luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldExldmVyQmlsbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVySW5MZXZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXJPdXRMZXZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsTG9hbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0TG9hbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldExvYW5SZWNvcmRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib3Jyb3cnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRSZXBheW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRTJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogJzAuMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FDQVNIJzogNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTksnOiAyMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUVic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEJUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0hBVCc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdENOWSc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hMQyc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNXJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQudG9VcHBlckNhc2UgKCkpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQudG9VcHBlckNhc2UgKCkpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYW1vdW50U2NhbGUnXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ3ByaWNlU2NhbGUnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRHZXRBY2NvdW50SW5mbyAocGFyYW1zKTtcbiAgICAgICAgLy8gdG9kbzogdXNlIHRoaXMgc29tZWhvd1xuICAgICAgICAvLyBsZXQgcGVybWlzc2lvbnMgPSByZXNwb25zZVsncmVzdWx0J11bJ2Jhc2UnXTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3Jlc3VsdCddWydjb2lucyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmFsYW5jZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaV07XG4gICAgICAgICAgICAvLyAgICAgeyAgICAgICAgZW5OYW1lOiBcIkJUQ1wiLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgICBmcmVlejogXCIwLjAwMDAwMDAwXCIsXG4gICAgICAgICAgICAvLyAgICAgICAgIHVuaXREZWNpbWFsOiAgOCwgLy8gYWx3YXlzIDhcbiAgICAgICAgICAgIC8vICAgICAgICAgICAgICBjbk5hbWU6IFwiQlRDXCIsXG4gICAgICAgICAgICAvLyAgICAgICBpc0NhblJlY2hhcmdlOiAgdHJ1ZSwgLy8gVE9ETzogc2hvdWxkIHVzZSB0aGlzXG4gICAgICAgICAgICAvLyAgICAgICAgICAgICB1bml0VGFnOiBcIuC4v1wiLFxuICAgICAgICAgICAgLy8gICAgICAgaXNDYW5XaXRoZHJhdzogIHRydWUsICAvLyBUT0RPOiBzaG91bGQgdXNlIHRoaXNcbiAgICAgICAgICAgIC8vICAgICAgICAgICBhdmFpbGFibGU6IFwiMC4wMDAwMDAwMFwiLFxuICAgICAg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zeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9ITENWIChzeW1ib2wsIHRpbWVmcmFtZSA9ICcxbScsIHNpbmN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1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICh0eXBlICE9PSAnbGltaXQnKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgYWxsb3dzIGxpbWl0IG9yZGVycyBvbmx5Jyk7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdwcmljZSc6IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSksXG4gICAgICAgICAgICAnYW1vdW50JzogdGhpcy5hbW91bnRUb1N0cmluZyAoc3ltYm9sLCBhbW91bnQpLFxuICAgICAgICAgICAgJ3RyYWRlVHlwZSc6IChzaWRlID09PSAnYnV5JykgPyAnMScgOiAnMCcsXG4gICAgICAgICAgICAnY3VycmVuY3knOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRPcmRlciAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnaWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2lkJzogaWQudG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnY3VycmVuY3knOiB0aGlzLm1hcmtldElkIChze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107XG4gICAgICAgIGxldCBhdmVyYWdlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgZmlsbGVkID0gb3JkZXJbJ3RyYWRlX2Ftb3VudCddO1xuICAgICAgICBsZXQgYW1vdW50ID0gb3JkZXJbJ3RvdGFsX2Ftb3VudCddO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICBsZXQgY29zdCA9IG9yZGVyWyd0cmFkZV9tb25leSddO1xuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ3N0YXR1cycpO1xuICAgICAgICBpZiAodHlwZW9mIHN0YXR1cyAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBzdGF0dXMgPSB0aGlzLnBhcnNlT3JkZXJTdGF0dXMgKHN0YXR1cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJTdGF0dXMgKHN0YXR1cykge1xuICAgICAgICBjb25zdCBzdGF0dXNlcyA9IHtcbiAgICAgICAgICAgICcwJzogJ29wZW4nLFxuICAgICAgICAgICAgJzEnOiAnY2FuY2VsZWQnLFxuICAgICAgICAgICAgJzInOiAnY2xvc2VkJyxcbiAgICAgICAgICAgICczJzogJ29wZW4nLCAvLyBwYXJ0aWFsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChzdGF0dXMgaW4gc3RhdHVzZXMpXG4gICAgICAgICAgICByZXR1cm4gc3RhdHVzZXNbc3RhdHVzXTtcbiAgICAgICAgcmV0dXJuIHN0YXR1cztcbiAgICB9XG5cbiAgICBnZXRDcmVhdGVEYXRlRmllbGQgKCkge1xuICAgICAgICByZXR1cm4gJ3RyYWRlX2RhdGUnO1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51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mluZycpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoYm9keS5sZW5ndGggPCAyKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKGJvZHlbMF0gPT09ICd7Jykge1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBpZiAoJ2NvZGUnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnY29kZScpO1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgIGlmIChjb2RlIGluIHRoaXMuZXhjZXB0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgRXhjZXB0aW9uQ2xhc3MgPSB0aGlzLmV4Y2VwdGlvbnNbY29kZV07XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNlcHRpb25DbGFzcyAobWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjb2RlICE9PSAnMTAwMCcpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn07XG4iLCI7KGZ1bmN0aW9uIChyb290LCBmYWN0b3J5LCB1bmRlZikge1xuXHRpZiAodHlwZW9mIGV4cG9ydHMgPT09IFwib2JqZWN0XCIpIHtcblx0XHQvLyBDb21tb25KU1xuXHRcdG1vZHVsZS5leHBvcnRzID0gZXhw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BbXTtcblx0ICAgIHZhciBJTlZfU1VCX01JWF8yID0gW107XG5cdCAgICB2YXIgSU5WX1NVQl9NSVhfMyA9IFtdO1xuXG5cdCAgICAvLyBDb21wdXRlIGxvb2t1cCB0YWJsZXNcblx0ICAgIChmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgLy8gQ29tcHV0ZSBkb3VibGUgdGFibGVcblx0ICAgICAgICB2YXIgZCA9IFtdO1xuXHQgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjU2OyBpKyspIHtcblx0ICAgICAgICAgICAgaWYgKGkgPCAxMjgpIHtcblx0ICAgICAgICAgICAgICAgIGRbaV0gPSBpIDw8IDE7XG5cdCAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICBkW2ldID0gKGkgPDwgMSkgXiAweDExYjtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblxuXHQgICAgICAgIC8vIFdhbGsgR0YoMl44KVxuXHQgICAgICAgIHZhciB4ID0gMDtcblx0ICAgICAgICB2YXIgeGkgPSAwO1xuXHQgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjU2OyBpKyspIHtcblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBzYm94XG5cdCAgICAgICAgICAgIHZhciBzeCA9IHhpIF4gKHhpIDw8IDEpIF4gKHhpIDw8IDIpIF4gKHhpIDw8IDMpIF4gKHhpIDw8IDQpO1xuXHQgICAgICAgICAgICBzeCA9IChzeCA+Pj4gOCkgXiAoc3ggJiAweGZmKSBeIDB4NjM7XG5cdCAgICAgICAgICAgIFNCT1hbeF0gPSBzeDtcblx0ICAgICAgICAgICAgSU5WX1NCT1hbc3hdID0geDtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIG11bHRpcGxpY2F0aW9uXG5cdCAgICAgICAgICAgIHZhciB4MiA9IGRbeF07XG5cdCAgICAgICAgICAgIHZhciB4NCA9IGRbeDJdO1xuXHQgICAgICAgICAgICB2YXI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leVNpemUgKyA2O1xuXG5cdCAgICAgICAgICAgIC8vIENvbXB1dGUgbnVtYmVyIG9mIGtleSBzY2hlZHVsZSByb3dzXG5cdCAgICAgICAgICAgIHZhciBrc1Jvd3MgPSAoblJvdW5kcyArIDEpICogNDtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIGtleSBzY2hlZHVsZVxuXHQgICAgICAgICAgICB2YXIga2V5U2NoZWR1bGUgPSB0aGlzLl9rZXlTY2hlZHVsZSA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBrc1JvdyA9IDA7IGtzUm93IDwga3NSb3dzOyBrc1JvdysrKSB7XG5cdCAgICAgICAgICAgICAgICBpZiAoa3NSb3cgPCBrZXlTaXplKSB7XG5cdCAgICAgICAgICAgICAgICAgICAga2V5U2NoZWR1bGVba3NSb3ddID0ga2V5V29yZHNba3NSb3ddO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGtleVNjaGVkdWxlW2tzUm93IC0gMV07XG5cblx0ICAgICAgICAgICAgICAgICAgICBpZiAoIShrc1JvdyAlIGtleVNpemUpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJvdCB3b3JkXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAodCA8PCA4KSB8ICh0ID4+PiAyNCk7XG5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgLy8gU3ViIHdvcmRcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdCA9IChTQk9YW3QgPj4+IDI0XSA8PCAyNCkgfCAoU0JPWFsodCA+Pj4gMTYpICYgMHhmZl0gPDwgMTYpIHwgKFNCT1hbKHQgPj4+IDgpICYgMHhmZl0gPDwgOCkgfCBTQk9YW3QgJiAweGZmXTtcblxuXHQgICAgICAgICAgICAgICAgICAgICAgICAvLyBNaXggUmNvblxuXHQgICAgICAgICAgICAgICAgICAgICAgICB0IF49IFJDT05bKGtzUm93IC8ga2V5U2l6ZSkgfCAwXSA8PCAyNDtcblx0ICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtleVNpemUgPiA2ICYmIGtzUm93ICUga2V5U2l6ZSA9PSA0KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN1YiB3b3JkXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAoU0JPWFt0ID4+PiAyNF0gPDwgMjQpIHwgKFNCT1hbKHQgPj4+IDE2KSAmIDB4ZmZdIDw8IDE2KSB8IChTQk9YWyh0ID4+PiA4KSAmIDB4ZmZdIDw8IDgpIHwgU0JPWFt0ICYgMHhmZl07XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAgICAga2V5U2NoZWR1bGVba3NSb3ddID0ga2V5U2NoZWR1bGVba3NSb3cgLSBrZXlTaXplXSBeIHQ7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIGludiBrZXkgc2NoZWR1bGVcblx0ICAgICAgICAgICAgdmFyIGludktleVNjaGVkdWxlID0gdGhpcy5faW52S2V5U2NoZWR1bGUgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaW52S3NSb3cgPSAwOyBpbnZLc1JvdyA8IGtzUm93czsgaW52S3NSb3crKykge1xuXHQgICAgICAgICAgICAgICAgdmFyIGtzUm93ID0ga3NSb3dzIC0gaW52S3NSb3c7XG5cblx0ICAgICAgICAgICAgICAgIGlmIChpbnZLc1JvdyAlIDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGtleVNjaGVkdWxlW2tzUm93XTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHQgPSBrZXlTY2hlZHVsZVtrc1JvdyAtIDRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAg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G5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBBRVMgPSBDcnlwdG9KUy5saWIuQ2lwaGVyLl9jcmVhdGVIZWxwZXIoQ3J5cHRvSlMuYWxnby5BRVMpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIF9jcmVhdGVIZWxwZXI6IChmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIGZ1bmN0aW9uIHNlbGVjdENpcGhlclN0cmF0ZWd5KGtleSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBrZXkgPT0gJ3N0cmluZycpIHtcblx0ICAgICAgICAgICAgICAgICAgICByZXR1cm4gUGFzc3dvcmRCYXNlZENpcGhlcjtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNlcmlhbGl6YWJsZUNpcGhlcjtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAoY2lwaGVyKSB7XG5cdCAgICAgICAgICAgICAgICByZXR1cm4ge1xuXHQgICAgICAgICAgICAgICAgICAgIGVuY3J5cHQ6IGZ1bmN0aW9uIChtZXNzYWdlLCBrZXksIGNmZykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2VsZWN0Q2lwaGVyU3RyYXRlZ3koa2V5KS5lbmNyeXB0KGNpcGhlciwgbWVzc2FnZSwga2V5LCBjZmcpO1xuXHQgICAgICAgICAgICAgICAgICAgIH0sXG5cblx0ICAgICAgICAgICAgICAgICAgICBkZWNyeXB0OiBmdW5jdGlvbiAoY2lwaGVydGV4dCwga2V5LCBjZmcpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNlbGVjdENpcGhlclN0cmF0ZWd5KGtleSkuZGVjcnlwdChjaXBoZ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lwaGVyTW9kZS5leHRlbmQoKTtcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENCQyBlbmNyeXB0b3IuXG5cdCAgICAgICAgICovXG5cdCAgICAgICAgQ0JDLkVuY3J5cHRvciA9IENCQy5leHRlbmQoe1xuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogUHJvY2Vzc2VzIHRoZSBkYXRhIGJsb2NrIGF0IG9mZnNldC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtBcnJheX0gd29yZHMgVGhlIGRhdGEgd29yZHMgdG8gb3BlcmF0ZSBvbi5cblx0ICAgICAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IG9mZnNldCBUaGUgb2Zmc2V0IHdoZXJlIHRoZSBibG9jayBzdGFydHMuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBtb2RlLnByb2Nlc3NCbG9jayhkYXRhLndvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgcHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAod29yZHMsIG9mZnNldCkge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgY2lwaGVyID0gdGhpcy5fY2lwaGVyO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrU2l6ZSA9IGNpcGhlci5ibG9ja1NpemU7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFhPUiBhbmQgZW5jcnlwdFxuXHQgICAgICAgICAgICAgICAgeG9yQmxvY2suY2FsbCh0aGlzLCB3b3Jkcywgb2Zmc2V0LCBibG9ja1NpemUpO1xuXHQgICAgICAgICAgICAgICAgY2lwaGVyLmVuY3J5cHRCbG9jayh3b3Jkcywgb2Zmc2V0KTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVtZW1iZXIgdGhpcyBibG9jayB0byB1c2Ugd2l0aCBuZXh0IGJsb2NrXG5cdCAgICAgICAgICAgICAgICB0aGlzLl9wcmV2QmxvY2sgPSB3b3Jkcy5zbGljZShvZmZzZXQsIG9mZnNldCArIGJsb2NrU2l6ZSk7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9KTtcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENCQyBkZWNyeXB0b3IuXG5cdCAgICAgICAgICovXG5cdCAgICAgICAgQ0JDLkRlY3J5cHRvciA9IENCQy5leHRlbmQoe1xuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogUHJvY2Vzc2VzIHRoZSBkYXRhIGJsb2NrIGF0IG9mZnNldC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtBcnJheX0gd29yZHMgVGhlIGRhdGEgd29yZHMgdG8gb3BlcmF0ZSBvbi5cblx0ICAgICAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IG9mZnNldCBUaGUgb2Zmc2V0IHdoZXJlIHRoZSBibG9jayBzdGFydHMuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBtb2RlLnByb2Nlc3NCbG9jayhkYXRhLndvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgcHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAod29yZHMsIG9mZnNldCkge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgY2lwaGVyID0gdGhpcy5fY2lwaGVyO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrU2l6ZSA9IGNpcGhlci5ibG9ja1NpemU7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJlbWVtYmVyIHRoaXMgYmxvY2sgdG8gdXNlIHdpdGggbmV4dCBibG9ja1xuXHQgICAgICAgICAgICAgICAgdmFyIHRoaXNCbG9jayA9IHdvcmRzLnNsaWNlKG9mZnNldCwgb2Zmc2V0ICsgYmxvY2tTaXplKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gRGVjcnlwdCBhbmQgWE9SXG5cdCAgICAgICAgICAgICAgICBjaXBoZXIuZGVjcnlwdEJsb2NrKHdvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgICAgeG9yQmxvY2suY2FsbCh0aGlzLCB3b3Jkcywgb2Zmc2V0LCBibG9ja1NpemUpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBUaGlzIGJsb2NrIGJlY29tZXMgdGhlIHByZXZpb3VzIGJsb2NrXG5cdCAgICAgICAgICAgICAgICB0aGlzLl9wcmV2QmxvY2sgPSB0aGlzQmxvY2s7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9KTtcblxuXHQgICAgICAgIGZ1bmN0aW9uIHhvckJsb2NrKHdvcmRzLCBvZmZzZXQsIGJsb2NrU2l6ZSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgaXYgPSB0aGlzLl9pdjtcblxuXHQgICAgICAgICAgICAvLyBDaG9vc2UgbWl4aW5nIGJsb2NrXG5cdCAgICAgICAgICAgIGlmIChpdikge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gaXY7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJlbW92ZSBJViBmb3Igc3Vic2VxdWVudCBibG9ja3Ncblx0ICAgICAgICAgICAgICAgIHRoaXMuX2l2ID0gdW5kZWZpbmVkO1xuXHQgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gdGhpcy5fcHJldkJsb2NrO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgIC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hbXMuY3JlYXRlKHtcblx0ICAgICAgICAgKiAgICAgICAgIGNpcGhlcnRleHQ6IGNpcGhlcnRleHRXb3JkQXJyYXksXG5cdCAgICAgICAgICogICAgICAgICBrZXk6IGtleVdvcmRBcnJheSxcblx0ICAgICAgICAgKiAgICAgICAgIGl2OiBpdldvcmRBcnJheSxcblx0ICAgICAgICAgKiAgICAgICAgIHNhbHQ6IHNhbHRXb3JkQXJyYXksXG5cdCAgICAgICAgICogICAgICAgICBhbGdvcml0aG06IENyeXB0b0pTLmFsZ28uQUVTLFxuXHQgICAgICAgICAqICAgICAgICAgbW9kZTogQ3J5cHRvSlMubW9kZS5DQkMsXG5cdCAgICAgICAgICogICAgICAgICBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUEtDUzcsXG5cdCAgICAgICAgICogICAgICAgICBibG9ja1NpemU6IDQsXG5cdCAgICAgICAgICogICAgICAgICBmb3JtYXR0ZXI6IENyeXB0b0pTLmZvcm1hdC5PcGVuU1NMXG5cdCAgICAgICAgICogICAgIH0pO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGluaXQ6IGZ1bmN0aW9uIChjaXBoZXJQYXJhbXMpIHtcblx0ICAgICAgICAgICAgdGhpcy5taXhJbihjaXBoZXJQYXJhbXMpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyB0aGlzIGNpcGhlciBwYXJhbXMgb2JqZWN0IHRvIGEgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtGb3JtYXR9IGZvcm1hdHRlciAoT3B0aW9uYWwpIFRoZSBmb3JtYXR0aW5nIHN0cmF0ZWd5IHRvIHVzZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIHN0cmluZ2lmaWVkIGNpcGhlciBwYXJhbXMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAdGhyb3d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CAgICAgICAgICAgIHN1YnR5cGUgPSBuZXcgRigpO1xuXG5cdCAgICAgICAgICAgIEYucHJvdG90eXBlID0gbnVsbDtcblxuXHQgICAgICAgICAgICByZXR1cm4gc3VidHlwZTtcblx0ICAgICAgICB9O1xuXHQgICAgfSgpKVxuXG5cdCAgICAvKipcblx0ICAgICAqIENyeXB0b0pTIG5hbWVzcGFjZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIEMgPSB7fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBMaWJyYXJ5IG5hbWVzcGFjZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIENfbGliID0gQy5saWIgPSB7fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBCYXNlIG9iamVjdCBmb3IgcHJvdG90eXBhbCBpbmhlcml0YW5jZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIEJhc2UgPSBDX2xpYi5CYXNlID0gKGZ1bmN0aW9uICgpIHtcblxuXG5cdCAgICAgICAgcmV0dXJuIHtcblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIENyZWF0ZXMgYSBuZXcgb2JqZWN0IHRoYXQgaW5oZXJpdHMgZnJvbSB0aGlzIG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IG92ZXJyaWRlcyBQcm9wZXJ0aWVzIHRvIGNvcHkgaW50byB0aGUgbmV3IG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHJldHVybiB7T2JqZWN0fSBUaGUgbmV3IG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiAgICAgdmFyIE15VHlwZSA9IENyeXB0b0pTLmxpYi5CYXNlLmV4dGVuZCh7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgZmllbGQ6ICd2YWx1ZScsXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICAgICAgbWV0aG9kOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgfVxuXHQgICAgICAgICAgICAgKiAgICAgfSk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBleHRlbmQ6IGZ1bmN0aW9uIChvdmVycmlkZXMpIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNwYXduXG5cdCAgICAgICAgICAgICAgICB2YXIgc3VidHlwZSA9IGNyZWF0ZSh0aGlzKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gQXVnbWVudFxuXHQgICAgICAgICAgICAgICAgaWYgKG92ZXJyaWRlcykge1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YnR5cGUubWl4SW4ob3ZlcnJpZGVzKTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIGRlZmF1bHQgaW5pdGlhbGl6ZXJcblx0ICAgICAgICAgICAgICAgIGlmICghc3VidHlwZS5oYXNPd25Qcm9wZXJ0eSgnaW5pdCcpIHx8IHRoaXMuaW5pdCA9PT0gc3VidHlwZS5pbml0KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgc3VidHlwZS5pbml0ID0gZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0eXBlLiRzdXBlci5pbml0LmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG5cdCAgICAgICAgICAgICAgICAgICAgfTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gSW5pdGlhbGl6ZXIncyBwcm90b3R5cGUgaXMgdGhlIHN1YnR5cGUgb2JqZWN0XG5cdCAgICAgICAgICAgICAgICBzdWJ0eXBlLmluaXQucHJvdG90eXBlID0gc3VidHlwZTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVmZXJlbmNlIHN1cGVydHlwZVxuXHQgICAgICAgICAgICAgICAgc3VidHlwZS4kc3VwZXIgPSB0aGlzO1xuXG5cdCAgICAgICAgICAgICAgICByZXR1cm4gc3VidHlwZTtcblx0ICAgICAgICAgICAgfSxcblxuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogRXh0ZW5kcyB0aGlzIG9iamVjdCBhbmQgcnVucyB0aGUgaW5pdCBtZXRob2QuXG5cdCAgICAgICAgICAgICAqIEFyZ3VtZW50cyB0byBjcmVhdGUoKSB3aWxsIGJlIHBhc3NlZCB0byBpbml0KCkuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEByZXR1cm4ge09iamVjdH0gVGhlIG5ldyBvYmplY3QuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIHZhciBpbnN0YW5jZSA9IE15VHlwZS5jcmVhdGUoKTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIGNyZWF0ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgdmFyIGluc3RhbmNlID0gdGhpcy5leHRlbmQoKTtcblx0ICAgICAgICAgICAgICAgIGluc3RhbmNlLmluaXQuYXBwbHkoaW5zdGFuY2UsIGFyZ3VtZW50cyk7XG5cblx0ICAgICAgICAgICAgICAgIHJldHVybiBpbnN0YW5jZTtcblx0ICAgICAgICAgICAgfSxcblxuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogSW5pdGlhbGl6ZXMgYSBuZXdseSBjcmVhdGVkIG9iamVjdC5cblx0ICAgICAgICAgICAgICogT3ZlcnJpZGUgdGhpcyBtZXRob2QgdG8gYWRkIHNvbWUgbG9naWMgd2hlbiB5b3VyIG9iamVjdHMgYXJlIGNyZWF0ZWQuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICB2YXIgTXlUeXBlID0gQ3J5cHRvSlMubGliLkJhc2UuZXh0ZW5kKHtcblx0ICAgICAgICAgICAgICogICAgICAgICBpbml0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgICAgIC8vIC4uLlxuXHQgICAgICAgICAgICAgKiAgICAgICAgIH1cblx0ICAgICAgICAgICAgICogICAgIH0pO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgaW5pdDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICB9LFxuXG5cdCAgICAgICAgICAgIC8qKlxuXHQgICAgICAgICAgICAgKiBDb3BpZXMgcHJvcGVydGllcyBpbnRvIHRoaXMgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gcHJvcGVydGllcyBUaGUgcHJvcGVydGllcyB0byBtaXggaW4uXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBNeVR5cGUubWl4SW4oe1xuXHQgICAgICAgICAgICAgKiAgICAgICAgIGZpZWxkOiAndmFsdWUnXG5cdCAgICAgICAgICAgICAqICAgICB9KTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIG1peEluOiBmdW5jdGlvbiAocHJvcGVydGllcykge1xuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgcHJvcGVydHlOYW1lIGluIHByb3BlcnRpZXMpIHtcblx0ICAgICAgICAgICAgICAgICAgICBpZiAocHJvcGVydGllcy5oYXNPd25Qcm9wZXJ0eShwcm9wZXJ0eU5hbWUpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNbcHJvcGVydHlOYW1lXSA9IHByb3BlcnRpZXNbcHJvcGVydHlOYW1lXTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIElFIHdvbid0IGNvcHkgdG9TdHJpbmcgdXNpbmcgdGhlIGxvb3AgYWJvdmVcblx0ICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0aWVzLmhhc093blByb3BlcnR5KCd0b1N0cmluZycpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdGhpcy50b1N0cmluZyA9IHByb3BlcnRpZXMudG9TdHJpbmc7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH0sXG5cblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIENyZWF0ZXMgYSBjb3B5IG9mIHRoaXMgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAcmV0dXJuIHtPYmplY3R9IFRoZSBjbG9uZS5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIHZhciBjbG9uZSA9IGluc3RhbmNlLmNsb25lKCk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBjbG9uZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuaW5pdC5wcm90b3R5cGUuZXh0ZW5kKHRoaXMpO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfTtcblx0ICAgIH0oKSk7XG5cblx0ICAgIC8qKlxuXHQgICAgICogQW4gYXJyYXkgb2YgMzItYml0IHdvcmRzLlxuXHQgICAgICpcblx0ICAgICAqIEBwcm9wZXJ0eSB7QXJyYXl9IHdvcmRzIFRoZSBhcnJ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cmRzIHx8IFtdO1xuXG5cdCAgICAgICAgICAgIGlmIChzaWdCeXRlcyAhPSB1bmRlZmluZWQpIHtcblx0ICAgICAgICAgICAgICAgIHRoaXMuc2lnQnl0ZXMgPSBzaWdCeXRlcztcblx0ICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgIHRoaXMuc2lnQnl0ZXMgPSB3b3Jkcy5sZW5ndGggKiA0O1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIHRoaXMgd29yZCBhcnJheSB0byBhIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7RW5jb2Rlcn0gZW5jb2RlciAoT3B0aW9uYWwpIFRoZSBlbmNvZGluZyBzdHJhdGVneSB0byB1c2UuIERlZmF1bHQ6IENyeXB0b0pTLmVuYy5IZXhcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIHN0cmluZ2lmaWVkIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBzdHJpbmcgPSB3b3JkQXJyYXkgKyAnJztcblx0ICAgICAgICAgKiAgICAgdmFyIHN0cmluZyA9IHdvcmRBcnJheS50b1N0cmluZygpO1xuXHQgICAgICAgICAqICAgICB2YXIgc3RyaW5nID0gd29yZEFycmF5LnRvU3RyaW5nKENyeXB0b0pTLmVuYy5VdGY4KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICB0b1N0cmluZzogZnVuY3Rpb24gKGVuY29kZXIpIHtcblx0ICAgICAgICAgICAgcmV0dXJuIChlbmNvZGVyIHx8IEhleCkuc3RyaW5naWZ5KHRoaXMpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb25jYXRlbmF0ZXMgYSB3b3JkIGFycmF5IHRvIHRoaXMgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fSB3b3JkQXJyYXkgVGhlIHdvcmQgYXJyYXkgdG8gYXBwZW5kLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGlzIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHdvcmRBcnJheTEuY29uY2F0KHdvcmRBcnJheTIpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGNvbmNhdDogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHRoaXNXb3JkcyA9IHRoaXMud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB0aGF0V29yZHMgPSB3b3JkQXJyYXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB0aGlzU2lnQnl0ZXMgPSB0aGlzLnNpZ0J5dGVzO1xuXHQgICAgICAgICAgICB2YXIgdGhhdFNpZ0J5dGVzID0gd29yZEFycmF5LnNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIENsYW1wIGV4Y2VzcyBiaXRzXG5cdCAgICAgICAgICAgIHRoaXMuY2xhbXAoKTtcblxuXHQgICAgICAgICAgICAvLyBDb25jYXRcblx0ICAgICAgICAgICAgaWYgKHRoaXNTaWdCeXRlcyAlIDQpIHtcblx0ICAgICAgICAgICAgICAgIC8vIENvcHkgb25lIGJ5dGUgYXQgYSB0aW1lXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHRoYXRTaWdCeXRlczsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHRoYXRCeXRlID0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Qnl0ZXMgPSB0aGlzLnNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIENsYW1wXG5cdCAgICAgICAgICAgIHdvcmRzW3NpZ0J5dGVzID4+PiAyXSAmPSAweGZmZmZmZmZmIDw8ICgzMiAtIChzaWdCeXRlcyAlIDQpICogOCk7XG5cdCAgICAgICAgICAgIHdvcmRzLmxlbmd0aCA9IE1hdGguY2VpbChzaWdCeXRlcyAvIDQpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDcmVhdGVzIGEgY29weSBvZiB0aGlzIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSBjbG9uZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGNsb25lID0gd29yZEFycmF5LmNsb25lKCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIGNsb25lID0gQmFzZS5jbG9uZS5jYWxsKHRoaXMpO1xuXHQgICAgICAgICAgICBjbG9uZS53b3JkcyA9IHRoaXMud29yZHMuc2xpY2UoMCk7XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGNsb25lO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDcmVhdGVzIGEgd29yZCBhcnJheSBmaWxsZWQgd2l0aCByYW5kb20gYnl0ZXMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbkJ5dGVzIFRoZSBudW1iZXIgb2YgcmFuZG9tIGJ5dGVzIHRvIGdlbmVyYXRlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgcmFuZG9tIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5saWIuV29yZEFycmF5LnJhbmRvbSgxNik7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcmFuZG9tOiBmdW5jdGlvbiAobkJ5dGVzKSB7XG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IFtdO1xuXG5cdCAgICAgICAgICAgIHZhciByID0gKGZ1bmN0aW9uIChtX3cpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBtX3cgPSBtX3c7XG5cdCAgICAgICAgICAgICAgICB2YXIgbV96ID0gMHgzYWRlNjhiMTtcblx0ICAgICAgICAgICAgICAgIHZhciBtYXNrID0gMHhmZmZmZmZmZjtcblxuXHQgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgICAgICAgICBtX3ogPSAoMHg5MDY5ICogKG1feiAmIDB4RkZGRikgKyAobV96ID4+IDB4MTApKSAmIG1hc2s7XG5cdCAgICAgICAgICAgICAgICAgICAgbV93ID0gKDB4NDY1MCAqIChtX3cgJiAweEZGRkYpICsgKG1fdyA+PiAweDEwKSkgJiBtYXNrO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciByZXN1bHQgPSAoKG1feiA8PCAweDEwKSArIG1fdykgJiBtYXNrO1xuXHQgICAgICAgICAgICAgICAgICAgIHJlc3VsdCAvPSAweDEwMDAwMDAwMDtcblx0ICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gMC41O1xuXHQgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKiAoTWF0aC5yYW5kb20oKSA+IC41ID8gMSA6IC0xKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfSk7XG5cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDAsIHJjYWNoZTsgaSA8IG5CeXRlczsgaSArPSA0KSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgX3IgPSByKChyY2FjaGUgfHwgTWF0aC5yYW5kb20oKSkgKiAweDEwMDAwMDAwMCk7XG5cblx0ICAgICAgICAgICAgICAgIHJjYWNoZSA9IF9yKCkgKiAweDNhZGU2N2I3O1xuXHQgICAgICAgICAgICAgICAgd29yZHMucHVzaCgoX3IoKSAqIDB4MTAwMDAwMDAwKSB8IDApO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIG5ldyBXb3JkQXJyYXkuaW5pdCh3b3JkcywgbkJ5dGVzKTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBFbmNvZGVyIG5hbWVzcGFjZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIENfZW5jID0gQy5lbmMgPSB7fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBIZXggZW5jb2Rpbmcgc3RyYXRlZ3kuXG5cdCAgICAgKi9cblx0ICAgIHZhciBIZXggPSBDX2VuYy5IZXggPSB7XG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSB3b3JkIGFycmF5IHRvIGEgaGV4IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fSB3b3JkQXJyYXkgVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtzdHJpbmd9IFRoZSBoZXggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgaGV4U3RyaW5nID0gQ3J5cHRvSlMuZW5jLkhleC5zdHJpbmdpZnkod29yZEFycmF5KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBzdHJpbmdpZnk6IGZ1bmN0aW9uICh3b3JkQXJyYXkpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IHdvcmRBcnJheS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNpZ0J5dGVzID0gd29yZEFycmF5LnNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIENvbnZlcnRcblx0ICAgICAgICAgICAgdmFyIGhleENoYXJzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2lnQnl0ZXM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJpdGUgPSAod29yZHNbaSA+Pj4gMl0gPj4+ICgyNCAtIChpICUgNCkgKiA4KSkgJiAweGZmO1xuXHQgICAgICAgICAgICAgICAgaGV4Q2hhcnMucHVzaCgoYml0ZSA+Pj4gNCkudG9TdHJpbmcoMTYpKTtcblx0ICAgICAgICAgICAgICAgIGhleENoYXJzLnB1c2goKGJpdGUgJiAweDBmKS50b1N0cmluZygxNikpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGhleENoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIGhleCBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IGhleFN0ciBUaGUgaGV4IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1dvcmRBcnJheX0gVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5lbmMuSGV4LnBhcnNlKGhleFN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChoZXhTdHIpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgdmFyIGhleFN0ckxlbmd0aCA9IGhleFN0ci5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBoZXhTdHJMZW5ndGg7IGkgKz0gMikge1xuXHQgICAgICAgICAgICAgICAgd29yZHNbaSA+Pj4gM10gfD0gcGFyc2VJbnQoaGV4U3RyLnN1YnN0cihpLCAyKSwgMTYpIDw8ICgyNCAtIChpICUgOCkgKiA0KTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBuZXcgV29yZEFycmF5LmluaXQod29yZHMsIGhleFN0ckxlbmd0aCAvIDIpO1xuXHQgICAgICAgIH1cblx0ICAgIH07XG5cblx0ICAgIC8qKlxuXHQgICAgICogTGF0aW4xIGVuY29kaW5nIHN0cmF0ZWd5LlxuXHQgICAgICovXG5cdCAgICB2YXIgTGF0aW4xID0gQ19lbmMuTGF0aW4xID0ge1xuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgd29yZCBhcnJheSB0byBhIExhdGluMSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgTGF0aW4xIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGxhdGluMVN0cmluZyA9IENyeXB0b0pTLmVuYy5MYXRpbjEuc3RyaW5naWZ5KHdvcmRBcnJheSk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgc3RyaW5naWZ5OiBmdW5jdGlvbiAod29yZEFycmF5KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSB3b3JkQXJyYXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBzaWdCeXRlcyA9IHdvcmRBcnJheS5zaWdCeXRlcztcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciBsYXRpbjFDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciBiaXRlID0gKHdvcmRzW2kgPj4+IDJdID4+PiAoMjQgLSAoaSAlIDQpICogOCkpICYgMHhmZjtcblx0ICAgICAgICAgICAgICAgIGxhdGluMUNoYXJzLnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShiaXRlKSk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gbGF0aW4xQ2hhcnMuam9pbignJyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgTGF0aW4xIHN0cmluZyB0byBhIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbGF0aW4xU3RyIFRoZSBMYXRpbjEgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5MYXRpbjEucGFyc2UobGF0aW4xU3RyaW5nKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBwYXJzZTogZnVuY3Rpb24gKGxhdGluMVN0cikge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgbGF0aW4xU3RyTGVuZ3RoID0gbGF0aW4xU3RyLmxlbmd0aDtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxhdGluMVN0ckxlbmd0aDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tpID4+PiAyXSB8PSAobGF0aW4xU3RyLmNoYXJDb2RlQXQoaSkgJiAweGZmKSA8PCAoMjQgLSAoaSAlIDQpICogOCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gbmV3IFdvcmRBcnJheS5pbml0KHdvcmRzLCBsYXRpbjFTdHJMZW5ndGgpO1xuXHQgICAgICAgIH1cblx0ICAgIH07XG5cblx0ICAgIC8qKlxuXHQgICAgICogVVRGLTggZW5jb2Rpbmcgc3RyYXRlZ3kuXG5cdCAgICAgKi9cblx0ICAgIHZhciBVdGY4ID0gQ19lbmMuVXRmOCA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBVVEYtOCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgVVRGLTggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgdXRmOFN0cmluZyA9IENyeXB0b0pTLmVuYy5VdGY4LnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICB0cnkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIGRlY29kZVVSSUNvbXBvbmVudChlc2NhcGUoTGF0aW4xLnN0cmluZ2lmeSh3b3JkQXJyYXkpKSk7XG5cdCAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcblx0ICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignTWFsZm9ybWVkIFVURi04IGRhdGEnKTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi04IHN0cmluZyB0byBhIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gdXRmOFN0ciBUaGUgVVRGLTggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcm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gICAqIEJhc2U2NCBlbmNvZGluZyBzdHJhdGVneS5cblx0ICAgICAqL1xuXHQgICAgdmFyIEJhc2U2NCA9IENfZW5jLkJhc2U2NCA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBCYXNlNjQgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl9IHdvcmRBcnJheSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIEJhc2U2NCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBiYXNlNjRTdHJpbmcgPSBDcnlwdG9KUy5lbmMuQmFzZTY0LnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gd29yZEFycmF5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB3b3JkQXJyYXkuc2lnQnl0ZXM7XG5cdCAgICAgICAgICAgIHZhciBtYXAgPSB0aGlzLl9tYXA7XG5cblx0ICAgICAgICAgICAgLy8gQ2xhbXAgZXhjZXNzIGJpdHNcblx0ICAgICAgICAgICAgd29yZEFycmF5LmNsYW1wKCk7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgYmFzZTY0Q2hhcnMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzaWdCeXRlczsgaSArPSAzKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgYnl0ZTEgPSAod29yZHNbaSA+Pj4gMl0gICAgICAgPj4+ICgyNCAtIChpICUgNCkgKiA4KSkgICAgICAgJiAweGZmO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJ5dGUyID0gKHdvcmRzWyhpICsgMSkgPj4+IDJdID4+PiAoMjQgLSAoKGkgKyAxKSAlIDQpICogOCkpICYgMHhmZjtcblx0ICAgICAgICAgICAgICAgIHZhciBieXRlMyA9ICh3b3Jkc1soaSArIDIpID4+PiAyXSA+Pj4gKDI0IC0gKChpICsgMikgJSA0KSAqIDgpKSAmIDB4ZmY7XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0cmlwbGV0ID0gKGJ5dGUxIDw8IDE2KSB8IChieXRlMiA8PCA4KSB8IGJ5dGUzO1xuXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgKGogPCA0KSAmJiAoaSArIGogKiAwLjc1IDwgc2lnQnl0ZXMpOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICBiYXNlNjRDaGFycy5wdXNoKG1hcC5jaGFyQXQoKHRyaXBsZXQgPj4+ICg2ICogKDMgLSBqKSkpICYgMHgzZikpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQWRkIHBhZGRpbmdcblx0ICAgICAgICAgICAgdmFyIHBhZGRpbmdDaGFyID0gbWFwLmNoYXJBdCg2NCk7XG5cdCAgICAgICAgICAgIGlmIChwYWRkaW5nQ2hhcikge1xuXHQgICAgICAgICAgICAgICAgd2hpbGUgKGJhc2U2NENoYXJzLmxlbmd0aCAlIDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICBiYXNlNjRDaGFycy5wdXNoKHBhZGRpbmdDaGFyKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBiYXNlNjRDaGFycy5qb2luKCcnKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSBCYXNlNjQgc3RyaW5nIHRvIGEgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBiYXNlNjRTdHIgVGhlIEJhc2U2NCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMuZW5jLkJhc2U2NC5wYXJzZShiYXNlNjRTdHJpbmcpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoYmFzZTY0U3RyKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgYmFzZTY0U3RyTGVuZ3RoID0gYmFzZTY0U3RyLmxlbmd0aDtcblx0ICAgICAgICAgICAgdmFyIG1hcCA9IHRoaXMuX21hcDtcblx0ICAgICAgICAgICAgdmFyIHJldmVyc2VNYXAgPSB0aGlzLl9yZXZlcnNlTWFwO1xuXG5cdCAgICAgICAgICAgIGlmICghcmV2ZXJzZU1hcCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHJldmVyc2VNYXAgPSB0aGlzLl9yZXZlcnNlTWFwID0gW107XG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBtYXAubGVuZ3RoOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgcmV2ZXJzZU1hcFttYXAuY2hhckNvZGVBdChqKV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ICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpICs9IDIpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBjb2RlUG9pbnQgPSAod29yZHNbaSA+Pj4gMl0gPj4+ICgxNiAtIChpICUgNCkgKiA4KSkgJiAweGZmZmY7XG5cdCAgICAgICAgICAgICAgICB1dGYxNkNoYXJzLnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShjb2RlUG9pbnQpKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiB1dGYxNkNoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi0xNiBCRSBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IHV0ZjE2U3RyIFRoZSBVVEYtMTYgQkUgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5VdGYxNi5wYXJzZSh1dGYxNlN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uICh1dGYxNlN0cikge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgdXRmMTZTdHJMZW5ndGggPSB1dGYxNlN0ci5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB1dGYxNlN0ckxlbmd0aDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tpID4+PiAxXSB8PSB1dGYxNlN0ci5jaGFyQ29kZUF0KGkpIDw8ICgxNiAtIChpICUgMikgKiAxNik7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gV29yZEFycmF5LmNyZWF0ZSh3b3JkcywgdXRmMTZTdHJMZW5ndGggKiAyKTtcblx0ICAgICAgICB9XG5cdCAgICB9O1xuXG5cdCAgICAvKipcblx0ICAgICAqIFVURi0xNiBMRSBlbmNvZGluZyBzdHJhdGVneS5cblx0ICAgICAqL1xuXHQgICAgQ19lbmMuVXRmMTZMRSA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBVVEYtMTYgTEUgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl9IHdvcmRBcnJheSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIFVURi0xNiBMRSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB1dGYxNlN0ciA9IENyeXB0b0pTLmVuYy5VdGYxNkxFLnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gd29yZEFycmF5LndvcmRzO1xuXHQgICAgICAgIC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ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogRGVyaXZlcyBhIGtleSBmcm9tIGEgcGFzc3dvcmQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHBhc3N3b3JkIFRoZSBwYXNzd29yZC5cblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHNhbHQgQSBzYWx0LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgZGVyaXZlZCBrZXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBrZXkgPSBrZGYuY29tcHV0ZShwYXNzd29yZCwgc2FsdCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY29tcHV0ZTogZnVuY3Rpb24gKHBhc3N3b3JkLCBzYWx0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBjZmcgPSB0aGlzLmNmZztcblxuXHQgICAgICAgICAgICAvLyBJbml0IGhhc2hlclxuXHQgICAgICAgICAgICB2YXIgaGFzaGVyID0gY2ZnLmhhc2hlci5jcmVhdGUoKTtcblxuXHQgICAgICAgICAgICAvLyBJbml0aWFsIHZhbHVlc1xuXHQgICAgICAgICAgICB2YXIgZGVyaXZlZEtleSA9IFdvcmRBcnJheS5jcmVhdGUoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGRlcml2ZWRLZXlXb3JkcyA9IGRlcml2ZWRLZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaXplID0gY2ZnLmtleVNpemU7XG5cdCAgICAgICAgICAgIHZhciBpdGVyYXRpb25zID0gY2ZnLml0ZXJhdGlvbnM7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5XG5cdCAgICAgICAgICAgIHdoaWxlIChkZXJpdmVkS2V5V29yZHMubGVuZ3RoIDwga2V5U2l6ZSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKGJsb2NrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgaGFzaGVyLnVwZGF0ZShibG9jayk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB2YXIgYmxvY2sgPSBoYXNoZXIudXBkYXRlKHBhc3N3b3JkKS5maW5hbGl6ZShzYWx0KTtcblx0ICAgICAgICAgICAgICAgIGhhc2hlci5yZXNldCgpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBJdGVyYXRpb25zXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IGl0ZXJhdGlvbnM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGJsb2NrID0gaGFzaGVyLmZpbmFsaXplKGJsb2NrKTtcblx0ICAgICAgICAgICAgICAgICAgICBoYXNoZXIucmVzZXQoKTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgZGVyaXZlZEtleS5jb25jYXQoYmxvY2spO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIGRlcml2ZWRLZXkuc2lnQnl0ZXMgPSBrZXlTaXplICogNDtcblxuXHQgICAgICAgICAgICByZXR1cm4gZGVyaXZlZEtleTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBEZXJpdmVzIGEga2V5IGZyb20gYSBwYXNzd29yZC5cblx0ICAgICAqXG5cdCAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHBhc3N3b3JkIFRoZSBwYXNzd29yZC5cblx0ICAgICAqIEBwYXJhbSB7V29yZEFycmF5fHN0cmluZ30gc2FsdCBBIHNhbHQuXG5cdCAgICAgKiBAcGFyYW0ge09iam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ICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGhleFN0cmluZyA9IENyeXB0b0pTLmZvcm1hdC5IZXguc3RyaW5naWZ5KGNpcGhlclBhcmFtcyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgc3RyaW5naWZ5OiBmdW5jdGlvbiAoY2lwaGVyUGFyYW1zKSB7XG5cdCAgICAgICAgICAgIHJldHVybiBjaXBoZXJQYXJhbXMuY2lwaGVydGV4dC50b1N0cmluZyhIZXgpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIGhleGFkZWNpbWFsbHkgZW5jb2RlZCBjaXBoZXJ0ZXh0IHN0cmluZyB0byBhIGNpcGhlciBwYXJhbXMgb2JqZWN0LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IGlucHV0IFRoZSBoZXhhZGVjaW1hbGx5IGVuY29kZWQgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7Q2lwaGVyUGFyYW1zfSBUaGUgY2lwaGVyIHBhcmFtcyBvYmplY3QuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBjaXBoZXJQYXJhbXMgPSBDcnlwdG9KUy5mb3JtYXQuSGV4LnBhcnNlKGhleFN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChpbnB1dCkge1xuXHQgICAgICAgICAgICB2YXIgY2lwaGVydGV4dCA9IEhleC5wYXJzZShpbnB1dCk7XG5cdCAgICAgICAgICAgIHJldHVybiBDaXBoZXJQYXJhbXMuY3JlYXRlKHsgY2lwaGVydGV4dDogY2lwaGVyd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ZXMgPiBoYXNoZXJCbG9ja1NpemVCeXRlcykge1xuXHQgICAgICAgICAgICAgICAga2V5ID0gaGFzaGVyLmZpbmFsaXplKGtleSk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBDbGFtcCBleGNlc3MgYml0c1xuXHQgICAgICAgICAgICBrZXkuY2xhbXAoKTtcblxuXHQgICAgICAgICAgICAvLyBDbG9uZSBrZXkgZm9yIGlubmVyIGFuZCBvdXRlciBwYWRzXG5cdCAgICAgICAgICAgIHZhciBvS2V5ID0gdGhpcy5fb0tleSA9IGtleS5jbG9uZSgpO1xuXHQgICAgICAgICAgICB2YXIgaUtleSA9IHRoaXMuX2lLZXkgPSBrZXkuY2xvbmUoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIG9LZXlXb3JkcyA9IG9LZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBpS2V5V29yZHMgPSBpS2V5LndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFhPUiBrZXlzIHdpdGggcGFkIGNvbnN0YW50c1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGhhc2hlckJsb2NrU2l6ZTsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBvS2V5V29yZHNbaV0gXj0gMHg1YzVjNWM1Yztcblx0ICAgICAgICAgICAgICAgIGlLZXlXb3Jkc1tpXSBePSAweDM2MzYzNjM2O1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIG9LZXkuc2lnQnl0ZXMgPSBpS2V5LnNpZ0J5dGVzID0gaGFzaGVyQmxvY2tTaXplQnl0ZXM7XG5cblx0ICAgICAgICAgICAgLy8gU2V0IGluaXRpYWwgdmFsdWVzXG5cdCAgICAgICAgICAgIHRoaXMucmVzZXQoKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogUmVzZXRzIHRoaXMgSE1BQyB0byBpdHMgaW5pdGlhbCBzdGF0ZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgaG1hY0hhc2hlci5yZXNldCgpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHJlc2V0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBoYXNoZXIgPSB0aGlzLl9oYXNoZXI7XG5cblx0ICAgICAgICAgICAgLy8gUmVzZXRcblx0ICAgICAgICAgICAgaGFzaGVyLnJlc2V0KCk7XG5cdCAgICAgICAgICAgIGhhc2hlci51cGRhdGUodGhpcy5faUtleSk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIFVwZGF0ZXMgdGhpcyBITUFDIHdpdGggYSBtZXNzYWdlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl8c3RyaW5nfSBtZXNzYWdlVXBkYXRlIFRoZSBtZXNzYWdlIHRvIGFwcGVuZC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge0hNQUN9IFRoaXMgSE1BQyBpbnN0YW5jZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgaG1hY0hhc2hlci51cGRhdGUoJ21lc3NhZ2UnKTtcblx0ICAgICAgICAgKiAgICAgaG1hY0hhc2hlci51cGRhdGUod29yZEFycmF5KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICB1cGRhdGU6IGZ1bmN0aW9uIChtZXNzYWdlVXBkYXRlKSB7XG5cdCAgICAgICAgICAgIHRoaXMuX2hhc2hlci51cGRhdGUobWVzc2FnZVVwZGF0ZSk7XG5cblx0ICAgICAgICAgICAgLy8gQ2hhaW5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cdCAgICAgICAgICAgICAgICAgICAgKCgoTV9vZmZzZXRfaSA8PCA4KSAgfCAoTV9vZmZzZXRfaSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAoKChNX29mZnNldF9pIDw8IDI0KSB8IChNX29mZnNldF9pID4+PiA4KSkgICYgMHhmZjAwZmYwMClcblx0ICAgICAgICAgICAgICAgICk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIEggPSB0aGlzLl9oYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8wICA9IE1bb2Zmc2V0ICsgMF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xICA9IE1bb2Zmc2V0ICsgMV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8yICA9IE1bb2Zmc2V0ICsgMl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8zICA9IE1bb2Zmc2V0ICsgM107XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF80ICA9IE1bb2Zmc2V0ICsgNF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF81ICA9IE1bb2Zmc2V0ICsgNV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF82ICA9IE1bb2Zmc2V0ICsgNl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF83ICA9IE1bb2Zmc2V0ICsgN107XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF84ICA9IE1bb2Zmc2V0ICsgOF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF85ICA9IE1bb2Zmc2V0ICsgOV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xMCA9IE1bb2Zmc2V0ICsgMTBdO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfMTEgPSBNW29mZnNldCArIDExXTtcblx0ICAgICAgICAg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AoKChuQml0c1RvdGFsSCA8PCAyNCkgfCAobkJpdHNUb3RhbEggPj4+IDgpKSAgJiAweGZmMDBmZjAwKVxuXHQgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICBkYXRhV29yZHNbKCgobkJpdHNMZWZ0ICsgNjQpID4+PiA5KSA8PCA0KSArIDE0XSA9IChcblx0ICAgICAgICAgICAgICAgICgoKG5CaXRzVG90YWxMIDw8IDgpICB8IChuQml0c1RvdGFsTCA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICgoKG5CaXRzVG90YWxMIDw8IDI0KSB8IChuQml0c1RvdGFsTCA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICk7XG5cblx0ICAgICAgICAgICAgZGF0YS5zaWdCeXRlcyA9IChkYXRhV29yZHMubGVuZ3RoICsgMSkgKiA0O1xuXG5cdCAgICAgICAgICAgIC8vIEhhc2ggZmluYWwgYmxvY2tzXG5cdCAgICAgICAgICAgIHRoaXMuX3Byb2Nlc3MoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGhhc2ggPSB0aGlzLl9oYXNoO1xuXHQgICAgICAgICAgICB2YXIgSCA9IGhhc2gud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gU3dhcCBlbmRpYW5cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICB2YXIgSF9pID0gSFtpXTtcblxuXHQgICAgICAgICAgICAgICAgSFtpXSA9ICgoKEhfaSA8PCA4KSAgfCAoSF9pID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICAgICgoKEhfaSA8PCAyNCkgfCAoSF9pID4+PiA4KSkgICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBSZXR1cm4gZmluYWwgY29tcHV0ZWQgaGFzaFxuXHQgICAgICAgICAgICByZXR1cm4gaGFzaDtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIGNsb25lID0gSGFzaGVyLmNsb25lLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIGNsb25lLl9oYXNoID0gdGhpcy5faGFzaC5jbG9uZSgpO1xuXG5cdCAgICAgICAgICAgIHJldHVybiBjbG9uZTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgZnVuY3Rpb24gRkYoYSwgYiwgYywgZCwgeCwgcywgdCkge1xuXHQgICAgICAgIHZhciBuID0gYSArICgoYiAmIGMpIHwgKH5iICYgZCkpICsgeCArIHQ7XG5cdCAgICAgICAgcmV0dXJuICgobiA8PCBzKSB8IChuID4+PiAoMzIgLSBzKSkpICsgYjtcblx0ICAgIH1cblxuXHQgICAgZnVuY3Rpb24gR0coYSwgYiwgYywgZCwgeCwgcywgdCkge1xuXHQgICAgICAgIHZhciBuID0gYSArICgoYiAmIGQpIHwgKGMgJiB+ZCkpICsgeCArIHQ7XG5cdCAgICAgICAgcmV0dXJuICgobiA8PCBzKSB8IChuID4+PiAoMzIgLSBzKSkpICsgYjtcblx0ICAgIH1cblxuXHQgICAgZnVuY3Rpb24gSEgoYSwgYiwgYywgZCwgeCwgcywgdCkge1xuXHQgICAgICAgIHZhciBuID0gYSArIChiIF4gYyBeIGQpICsgeCArIHQ7XG5cdCAgICAgICAgcmV0dXJuICgobiA8PCBzKSB8IChuID4+PiAoMzIgLSBzKSkpICsgYjtcblx0ICAgIH1cblxuXHQgICAgZnVuY3Rpb24gSUkoYSwgYiwgYywgZCwgeCwgcywgdCkge1xuXHQgICAgICAgIHZhciBuID0gYSArIChjIF4gKGIgfCB+ZCkpICsgeCArIHQ7XG5c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NCbG9jazogZnVuY3Rpb24gKHdvcmRzLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciBjaXBoZXIgPSB0aGlzLl9jaXBoZXJcblx0ICAgICAgICAgICAgdmFyIGJsb2NrU2l6ZSA9IGNpcGhlci5ibG9ja1NpemU7XG5cdCAgICAgICAgICAgIHZhciBpdiA9IHRoaXMuX2l2O1xuXHQgICAgICAgICAgICB2YXIgY291bnRlciA9IHRoaXMuX2NvdW50ZXI7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5c3RyZWFtXG5cdCAgICAgICAgICAgIGlmIChpdikge1xuXHQgICAgICAgICAgICAgICAgY291bnRlciA9IHRoaXMuX2NvdW50ZXIgPSBpdi5zbGljZSgwKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVtb3ZlIElWIGZvciBzdWJzZXF1ZW50IGJsb2Nrc1xuXHQgICAgICAgICAgICAgICAgdGhpcy5faXYgPSB1bmRlZmluZWQ7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgdmFyIGtleXN0cmVhbSA9IGNvdW50ZXIuc2xpY2UoMCk7XG5cdCAgICAgICAgICAgIGNpcGhlci5lbmNyeXB0QmxvY2soa2V5c3RyZWFtLCAwKTtcblxuXHQgICAgICAgICAgICAvLyBJbmNyZW1lbnQgY291bnRlclxuXHQgICAgICAgICAgICBjb3VudGVyW2Jsb2NrU2l6ZSAtIDFdID0gKGNvdW50ZXJbYmxvY2tTaXplIC0gMV0gKyAxKSB8IDBcblxuXHQgICAgICAgICAgICAvLyBFbmNyeXB0XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYmxvY2tTaXplOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHdvcmRzW29mZnNldCArIGldIF49IGtleXN0cmVhbVtpXTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblx0ICAgIH0pO1xu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ID0gZGVyaXZlZEtleS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGJsb2NrSW5kZXhXb3JkcyA9IGJsb2NrSW5kZXgud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaXplID0gY2ZnLmtleVNpemU7XG5cdCAgICAgICAgICAgIHZhciBpdGVyYXRpb25zID0gY2ZnLml0ZXJhdGlvbnM7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5XG5cdCAgICAgICAgICAgIHdoaWxlIChkZXJpdmVkS2V5V29yZHMubGVuZ3RoIDwga2V5U2l6ZSkge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gaG1hYy51cGRhdGUoc2FsdCkuZmluYWxpemUoYmxvY2tJbmRleCk7XG5cdCAgICAgICAgICAgICAgICBobWFjLnJlc2V0KCk7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrV29yZHMgPSBibG9jay53b3Jkcztcblx0ICAgICAgICAgICAgICAgIHZhciBibG9ja1dvcmRzTGVuZ3RoID0gYmxvY2tXb3Jkcy5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgICAgIC8vIEl0ZXJhdGlvbnNcblx0ICAgICAgICAgICAgICAgIHZhciBpbnRlcm1lZGlhdGUgPSBibG9jaztcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAxOyBpIDwgaXRlcmF0aW9uczsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgaW50ZXJtZWRpYXRlID0gaG1hYy5maW5hbGl6ZShpbnRlcm1lZGlhdGUpO1xuXHQgICAgICAgICAgICAgICAgICAgIGhtYWMucmVzZXQoKTtcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGludGVybWVkaWF0ZVdvcmRzID0gaW50ZXJtZWRpYXRlLndvcmRzO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgLy8gWE9SIGludGVybWVkaWF0ZSB3aXRoIGJsb2NrXG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBibG9ja1dvcmRzTGVuZ3RoOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgYmxvY2tXb3Jkc1tqXSBePSBpbnRlcm1lZGlhdGVXb3Jkc1tqXTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIGRlcml2ZWRLZXkuY29uY2F0KGJsb2NrKTtcblx0ICAgICAgICAgICAgICAgIGJsb2NrSW5kZXhXb3Jkc1swXSsrO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIGRlcml2ZWRLZXkuc2lnQnl0ZXMgPSBrZXlTaXplICogNDtcblxuXHQgICAgICAgICAgICByZXR1cm4gZGVyaXZlZEtleTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBDb21wdXRlcyB0aGUgUGFzc3dvcmQtQmFzZWQgS2V5IERlcml2YXRpb24gRnVuY3Rpb24gMi5cblx0ICAgICAqXG5cdCAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHBhc3N3b3JkIFRoZSBwYXNzd29yZC5cblx0ICAgICAqIEBwYXJhbSB7V29yZEFycmF5fHN0cmluZ30gc2FsdCBBIHNhbHQuXG5cdCAgICAgKiBAcGFyYW0ge09iamVjdH0gY2ZnIChPcHRpb25hbCkgVGhlIGNvbmZpZ3VyYXRpb24gb3B0aW9ucyB0byB1c2UgZm9yIHRoaXMgY29tcHV0YXRpb24uXG5cdCAgICAgKlxuXHQgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgZGVyaXZlZCBrZXkuXG5cdCAgICAgKlxuXHQgICAgICogQHN0YXRpY1xuXHQgICAgICpcblx0ICAgICAqIEBleGFtcGxl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0gJiAweDAwMDBmZmZmKVxuXHQgICAgICAgICAgICBdO1xuXG5cdCAgICAgICAgICAgIC8vIENhcnJ5IGJpdFxuXHQgICAgICAgICAgICB0aGlzLl9iID0gMDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW0gZm91ciB0aW1lc1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDQ7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBNb2RpZnkgdGhlIGNvdW50ZXJzXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBDW2ldIF49IFhbKGkgKyA0KSAmIDddO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSVYgc2V0dXBcblx0ICAgICAgICAgICAgaWYgKGl2KSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBJViA9IGl2LndvcmRzO1xuXHQgICAgICAgICAgICAgICAgdmFyIElWXzAgPSBJVlswXTtcblx0ICAgICAgICAgICAgICAgIHZhciBJVl8xID0gSVZbMV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIEdlbmVyYXRlIGZvdXIgc3VidmVjdG9yc1xuXHQgICAgICAgICAgICAgICAgdmFyIGkwID0gKCgoSVZfMCA8PCA4KSB8IChJVl8wID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfCAoKChJVl8wIDw8IDI0KSB8IChJVl8wID4+PiA4KSkgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMiA9ICgoKElWXzEgPDwgOCkgfCAoSVZfMSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHwgKCgoSVZfMSA8PCAyNCkgfCAoSVZfMSA+Pj4gOCkpICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTEgPSAoaTAgPj4+IDE2KSB8IChpMiAmIDB4ZmZmZjAwMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkzID0gKGkyIDw8IDE2KSAgfCAoaTAgJiAweDAwMDBmZmZmKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gTW9kaWZ5IGNvdW50ZXIgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICBDWzBdIF49IGkwO1xuXHQgICAgICAgICAgICAgICAgQ1sxXSBePSBpMTtcblx0ICAgICAgICAgICAgICAgIENbMl0gXj0gaTI7XG5cdCAgICAgICAgICAgICAgICBDWzNdIF49IGkzO1xuXHQgICAgICAgICAgICAgICAgQ1s0XSBePSBpMDtcblx0ICAgICAgICAgICAgICAgIENbNV0gXj0gaTE7XG5cdCAgICAgICAgICAgICAgICBDWzZdIF49IGkyO1xuXHQgICAgICAgICAgICAgICAgQ1s3XSBePSBpMztcblxuXHQgICAgICAgICAgICAgICAgLy8gSXRlcmF0ZSB0aGUgc3lzdGVtIGZvdXIgdGltZXNcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBYID0gdGhpcy5fWDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW1cblx0ICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGU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3VudGVyIHZhbHVlc1xuXHQgICAgICAgICAgICB2YXIgQyA9IHRoaXMuX0MgPSBbXG5cdCAgICAgICAgICAgICAgICAoS1syXSA8PCAxNikgfCAoS1syXSA+Pj4gMTYpLCAoS1swXSAmIDB4ZmZmZjAwMDApIHwgKEtbMV0gJiAweDAwMDBmZmZmKSxcblx0ICAgICAgICAgICAgICAgIChLWzNdIDw8IDE2KSB8IChLWzNdID4+PiAxNiksIChLWzFdICYgMHhmZmZmMDAwMCkgfCAoS1syXSAmIDB4MDAwMGZmZmYpLFxuXHQgICAgICAgICAgICAgICAgKEtbMF0gPDwgMTYpIHwgKEtbMF0gPj4+IDE2KSwgKEtbMl0gJiAweGZmZmYwMDAwKSB8IChLWzNdICYgMHgwMDAwZmZmZiksXG5cdCAgICAgICAgICAgICAgICAoS1sxXSA8PCAxNikgfCAoS1sxXSA+Pj4gMTYpLCAoS1szXSAmIDB4ZmZmZjAwMDApIHwgKEtbMF0gJiAweDAwMDBmZmZmKVxuXHQgICAgICAgICAgICBdO1xuXG5cdCAgICAgICAgICAgIC8vIENhcnJ5IGJpdFxuXHQgICAgICAgICAgICB0aGlzLl9iID0gMDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW0gZm91ciB0aW1lc1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDQ7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBNb2RpZnkgdGhlIGNvdW50ZXJzXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBDW2ldIF49IFhbKGkgKyA0KSAmIDddO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSVYgc2V0dXBcblx0ICAgICAgICAgICAgaWYgKGl2KSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBJViA9IGl2LndvcmRzO1xuXHQgICAgICAgICAgICAgICAgdmFyIElWXzAgPSBJVlswXTtcblx0ICAgICAgICAgICAgICAgIHZhciBJVl8xID0gSVZbMV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIEdlbmVyYXRlIGZvdXIgc3VidmVjdG9yc1xuXHQgICAgICAgICAgICAgICAgdmFyIGkwID0gKCgoSVZfMCA8PCA4KSB8IChJVl8wID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfCAoKChJVl8wIDw8IDI0KSB8IChJVl8wID4+PiA4KSkgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMiA9ICgoKElWXzEgPDwgOCkgfCAoSVZfMSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHwgKCgoSVZfMSA8PCAyNCkgfCAoSVZfMSA+Pj4gOCkpICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTEgPSAoaTAgPj4+IDE2KSB8IChpMiAmIDB4ZmZmZjAwMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkzID0gKGkyIDw8IDE2KSAgfCAoaTAgJiAweDAwMDBmZmZmKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gTW9kaWZ5IGNvdW50ZXIgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICBDWzBdIF49IGkwO1xuXHQgICAgICAgICAgICAgICAgQ1sxXSBePSBpMTtcblx0ICAgICAgICAgICAgICAgIENbMl0gXj0gaTI7XG5cdCAgICAgICAgICAgICAgICBDWzNdIF49IGkzO1xuXHQgICAgICAgICAgICAgICAgQ1s0XSBePSBpMDtcblx0ICAgICAgICAgICAgICAgIENbNV0gXj0gaTE7XG5cdCAgICAgICAgICAgICAgICBDWzZdIF49IGkyO1xuXHQgICAgICAgICAgICAgICAgQ1s3XSBePSBpMztcblxuXHQgICAgICA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DM0QyRTFGMF0pO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9Qcm9jZXNzQmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblxuXHQgICAgICAgICAgICAvLyBTd2FwIGVuZGlhblxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDE2OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIG9mZnNldF9pID0gb2Zmc2V0ICsgaTtcblx0ICAgICAgICAgICAgICAgIHZhciBNX29mZnNldF9pID0gTVtvZmZzZXRfaV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXBcblx0ICAgICAgICAgICAgICAgIE1bb2Zmc2V0X2ldID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE1fb2Zmc2V0X2kgPDwgOCkgIHwgKE1fb2Zmc2V0X2kgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTV9vZmZzZXRfaSA8PCAyNCkgfCAoTV9vZmZzZXRfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBIICA9IHRoaXMuX2hhc2gud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBobCA9IF9obC53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGhyID0gX2hyLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgemwgPSBfemwud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB6ciA9IF96ci53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNsID0gX3NsLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc3IgPSBfc3Iud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gV29ya2luZyB2YXJpYWJsZXNcblx0ICAgICAgICAgICAgdmFyIGFsLCBibCwgY2wsIGRsLCBlbDtcblx0ICAgICAgICAgICAgdmFyIGFyLCBiciwgY3IsIGRyLCBlcjtcblxuXHQgICAgICAgICAgICBhciA9IGFsID0gSFswXTtcblx0ICAgICAgICAgICAgYnIgPSBibCA9IEhbMV07XG5cdCAgICAgICAgICAgIGNyID0gY2wgPSBIWzJdO1xuXHQgICAgICAgICAgICBkciA9IGRsID0gSFszXTtcblx0ICAgICAgICAgICAgZXIgPSBlbCA9IEhbNF07XG5cdCAgICAgICAgICAgIC8vIENvbXB1dGF0aW9uXG5cdCAgICAgICAgICAgIHZhciB0O1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDgwOyBpICs9IDEpIHtcblx0ICAgICAgICAgICAgICAgIHQgPSAoYWwgKyAgTVtvZmZzZXQremxbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJsLGNsLGRsKSArIGhsWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjIoYmwsY2wsZGwpICsgaGxbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhibCxjbCxkbCkgKyBobFsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY0KGJsLGNsLGRsKSArIGhsWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJsLGNsLGRsKSArIGhsWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNsW2ldKTtcblx0ICAgICAgICAgICAgICAgIHQgPSAodCtlbCl8MDtcblx0ICAgICAgICAgICAgICAgIGFsID0gZWw7XG5cdCAgICAgICAgICAgICAgICBlbCA9IGRsO1xuXHQgICAgICAgICAgICAgICAgZGwgPSByb3RsKGNsLCAxMCk7XG5cdCAgICAgICAgICAgICAgICBjbCA9IGJsO1xuXHQgICAgICAgICAgICAgICAgYmwgPSB0O1xuXG5cdCAgICAgICAgICAgICAgICB0ID0gKGFyICsgTVtvZmZzZXQrenJbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJyLGNyLGRyKSArIGhyWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjQoYnIsY3IsZHIpICsgaHJbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhicixjcixkcikgKyBoclsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYyKGJyLGNyLGRyKSArIGhyWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJyLGNyLGRyKSArIGhyWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNyW2ldKSA7XG5cdCAgICAgICAgICAgICAgICB0ID0gKHQrZXIpfDA7XG5cdCAgICAgICAgICAgICAgICBhciA9IGVyO1xuXHQgICAgICAgICAgICAgICAgZXIgPSBkcjtcblx0ICAgICAgICAgICAgICAgIGRyID0gcm90bChjciwgMTApO1xuXHQgICAgICAgICAgICAgICAgY3IgPSBicjtcblx0ICAgICAgICAgICAgICAgIGJyID0gdDtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZGlhdGUgaGFzaCB2YWx1ZVxuXHQgICAgICAgICAgICB0ICAgID0gKEhbMV0gKyBjbCArIGRyKXwwO1xuXHQgICAgICAgICAgICBIWzFdID0gKEhbMl0gKyBkbCArIGVyKXwwO1xuXHQgICAgICAgICAgICBIWzJdID0gKEhbM10gKyBlbCArIGFyKXwwO1xuXHQgICAgICAgICAgICBIWzNdID0gKEhbNF0gKyBhbCArIGJyKXwwO1xuXHQgICAgICAgICAgICBIWzRdID0gKEhbMF0gKyBibCArIGNyKXwwO1xuXHQgICAgICAgICAgICBIWzBdID0gIHQ7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb0ZpbmFsaXplOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGF0YSA9IHRoaXMuX2RhdGE7XG5cdCAgICAgICAgICAgIHZhciBkYXRhV29yZHMgPSBkYXRhLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBuQml0c1RvdGFsID0gdGhpcy5fbkRhdGFCeXRlcyAqIDg7XG5cdCAgICAgICAgICAgIHZhciBuQml0c0xlZnQgPSBkYXRhLnNpZ0J5dGVzICogODtcblxuXHQgICAgICAgICAgICAvLyBBZGQgcGFkZGluZ1xuXHQgICAgICAgICAgICBkYXRhV29yZHNbbkJpdHNMZWZ0ID4+PiA1XSB8PSAweDgwIDw8ICgyNCAtIG5CaXRzTGVmdCAlIDMyKTtcblx0ICAgICAgICAgICAgZGF0YVdvcmRzWygoKG5CaXRzTGVmdCArIDY0KSA+Pj4gOSkgPDwgNCkgKyAxNF0gPSAoXG5cdCAgICAgICAgICAgICAgICAoKChuQml0c1RvdGFsIDw8IDgpICB8IChuQml0c1RvdGFsID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgKCgobkJpdHNUb3RhbCA8PCAyNCkgfCAobkJpdHNUb3RhbCA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICk7XG5cdCAgICAgICAgICAgIGRhdGEuc2lnQnl0ZXMgPSAoZGF0YVdvcmRzLmxlbmd0aCArIDEpICogNDtcblxuXHQgICAgICAgICAgICAvLyBIYXNoIGZpbmFsIGJsb2Nrc1xuXHQgICAgICAgICAgICB0aGlzLl9wcm9jZXNzKCk7XG5cblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciBoYXNoID0gdGhpcy5faGFzaDtcblx0ICAgICAgICAgICAgdmFyIEggPSBoYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNTsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgdmFyIEhfaSA9IEhbaV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXBcblx0ICAgICAgICAgICAgICAgIEhbaV0gPSAoKChIX2kgPDwgOCkgIHwgKEhfaSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAgICAoKChIX2kgPDwgMjQpIHwgKEhfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUmV0dXJuIGZpbmFsIGNvbXB1dGVkIGhhc2hcblx0ICAgICAgICAgICAgcmV0dXJuIGhhc2g7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIGNsb25lOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIHZhciBjbG9uZSA9IE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AgICAgICAgICAweGMzZDJlMWYwXG5cdCAgICAgICAgICAgIF0pO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9Qcm9jZXNzQmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgdmFyIEggPSB0aGlzLl9oYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFdvcmtpbmcgdmFyaWFibGVzXG5cdCAgICAgICAgICAgIHZhciBhID0gSFswXTtcblx0ICAgICAgICAgICAgdmFyIGIgPSBIWzFdO1xuXHQgICAgICAgICAgICB2YXIgYyA9IEhbMl07XG5cdCAgICAgICAgICAgIHZhciBkID0gSFszXTtcblx0ICAgICAgICAgICAgdmFyIGUgPSBIWzRdO1xuXG5cdCAgICAgICAgICAgIC8vIENvbXB1dGF0aW9uXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODA7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKGkgPCAxNikge1xuXHQgICAgICAgICAgICAgICAgICAgIFdbaV0gPSBNW29mZnNldCArIGldIHwgMDtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIG4gPSBXW2kgLSAzXSBeIFdbaSAtIDhdIF4gV1tpIC0gMTRdIF4gV1tpIC0gMTZdO1xuXHQgICAgICAgICAgICAgICAgICAgIFdbaV0gPSAobiA8PCAxKSB8IChuID4+PiAzMSk7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0ID0gKChhIDw8IDUpIHwgKGEgPj4+IDI3KSkgKyBlICsgV1tpXTtcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMjApIHtcblx0ICAgICAgICAgICAgICAgICAgICB0ICs9ICgoYiAmIGMpIHwgKH5iICYgZCkpICsgMHg1YTgyNzk5OTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaSA8IDQwKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdCArPSAoYiBeIGMgXiBkKSArIDB4NmVkOWViYTE7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGkgPCA2MCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHQgKz0gKChiICYgYykgfCAoYiAmIGQpIHwgKGMgJiBkKSkgLSAweDcwZTQ0MzI0O1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIC8qIGlmIChpIDwgODApICovIHtcblx0ICAgICAgICAgICAgICAgICAgICB0ICs9IChiIF4gYyBeIGQpIC0gMHgzNTlkM2UyYTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgZSA9IGQ7XG5cdCAgICAgICAgICAgICAgICBkID0gYztcblx0ICAgICAgICAgICAgICAgIGMgPSAoYiA8PCAzMCkgfCAoYiA+Pj4gMik7XG5cdCAgICAgICAgICAgICAgICBiID0gYTtcblx0ICAgICAgICAgICAgICAgIGEgPSB0O1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSW50ZXJtZWRpYXRlIGhhc2ggdmFsdWVcblx0ICAgICAgICAgICAgSFswXSA9IChIWzBdICsgYSkgfCAwO1xuXHQgICAgICAgICAgICBIWzFdID0gKEhbMV0gKyBiKSB8IDA7XG5cdCAgICAgICAgICAgIEhbMl0gPSAoSFsyXSArIGMpIHwgMDtcblx0ICAgICAgICAgICAgSFszXSA9IChIWzNdICsgZCkgfCAwO1xuXHQgICAgICAgICAgICBIWzRdID0gKEhbNF0gKyBlKSB8IDA7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb0ZpbmFsaXplOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGF0YSA9IHRoaXMuX2RhdGE7XG5cdCAgICAgICAgICAgIHZhciBkYXRhV29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0XHRmYWN0b3J5KHJvb3QuQ3J5cHRvSlMpO1xuXHR9XG59KHRoaXMsIGZ1bmN0aW9uIChDcnlwdG9KUykge1xuXG5cdChmdW5jdGlvbiAoTWF0aCkge1xuXHQgICAgLy8gU2hvcnRjdXRzXG5cdCAgICB2YXIgQyA9IENyeXB0b0pTO1xuXHQgICAgdmFyIENfbGliID0gQy5saWI7XG5cdCAgICB2YXIgV29yZEFycmF5ID0gQ19saWIuV29yZEFycmF5O1xuXHQgICAgdmFyIEhhc2hlciA9IENfbGliLkhhc2hlcjtcblx0ICAgIHZhciBDX2FsZ28gPSBDLmFsZ287XG5cblx0ICAgIC8vIEluaXRpYWxpemF0aW9uIGFuZCByb3VuZCBjb25zdGFudHMgdGFibGVzXG5cdCAgICB2YXIgSCA9IFtdO1xuXHQgICAgdmFyIEsgPSBbXTtcblxuXHQgICAgLy8gQ29tcHV0ZSBjb25zdGFudHNcblx0ICAgIChmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgZnVuY3Rpb24gaXNQcmltZShuKSB7XG5cdCAgICAgICAgICAgIHZhciBzcXJ0TiA9IE1hdGguc3FydChuKTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgZmFjdG9yID0gMjsgZmFjdG9yIDw9IHNxcnROOyBmYWN0b3IrKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKCEobiAlIGZhY3RvcikpIHtcblx0ICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcblx0ICAgICAgICB9XG5cblx0ICAgICAgICBmdW5jdGlvbiBnZXRGcmFjdGlvbmFsQml0cyhuKSB7XG5cdCAgICAgICAgICAgIHJldHVybiAoKG4gLSAobiB8IDApKSAqIDB4MTAwMDAwMDAwKSB8IDA7XG5cdCAgICAgICAgfVxuXG5cdCAgICAgICAgdmFyIG4gPSAyO1xuXHQgICAgICAgIHZhciBuUHJpbWUgPSAwO1xuXHQgICAgICAgIHdoaWxlIChuUHJpbWUgPCA2NCkge1xuXHQgICAgICAgICAgICBpZiAoaXNQcmltZShuKSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKG5QcmltZSA8IDgpIHtcblx0ICAgICAgICAgICAgICAgICAgICBIW25QcmltZV0gPSBnZXRGcmFjdGlvbmFsQml0cyhNYXRoLnBvdyhuLCAxIC8gMikpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgS1tuUHJpbWVdID0gZ2V0RnJhY3Rpb25hbEJpdHMoTWF0aC5wb3cobiwgMSAvIDMpKTtcblxuXHQgICAgICAgICAgICAgICAgblByaW1lKys7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICBuKys7XG5cdCAgICAgICAgfVxuXHQgICAgfSgpKTtcblxuXHQgICAgLy8gUmV1c2FibGUgb2JqZWN0XG5cdCAgICB2YXIgVyA9IFtdO1xuXG5cdCAgICAvKipcblx0ICAgICAqIFNIQS0yNTYgaGFzaCBhbGdvcml0aG0uXG5cdCAgICAgKi9cblx0ICAgIHZhciBTSEEyNTYgPSBDX2FsZ28uU0hBMjU2ID0gSGFzaGVyLmV4dGVuZCh7XG5cdCAgICAgICAgX2RvUmVzZXQ6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdGhpcy5faGFzaCA9IG5ldyBXb3JkQXJyYXkuaW5pdChILnNsaWNlKDApKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBIID0gdGhpcy5faGFzaC53b3JkcztcblxuXHQgICAgICAgICAgICAvLyBXb3JraW5nIHZhcmlhYmxlc1xuXHQgICAgICAgICAgICB2YXIgYSA9IEhbMF07XG5cdCAgICAgICAgICAgIHZhciBiID0gSFsxXTtcblx0ICAgICAgICAgICAgdmFyIGMgPSBIWzJdO1xuXHQgICAgICAgICAgICB2YXIgZCA9IEhbM107XG5cdCAgICAgICAgICAgIHZhciBlID0gSFs0XTtcblx0ICAgICAgICAgICAgdmFyIGYgPSBIWzVdO1xuXHQgICAgICAgICAgICB2YXIgZyA9IEhbNl07XG5cdCAgICAgICAgICAgIHZhciBoID0gSFs3XTtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRhdGlvblxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDY0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMTYpIHtcblx0ICAgICAgICAgICAgICAgICAgICBXW2ldID0gTVtvZmZzZXQgKyBpXSB8IDA7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTB4ID0gV1tpIC0gMTVdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTAgID0gKChnYW1tYTB4IDw8IDI1KSB8IChnYW1tYTB4ID4+PiA3KSkgIF5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZ2FtbWEweCA8PCAxNCkgfCAoZ2FtbWEweCA+Pj4gMTgpKSBeXG5cdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdhbW1hMHggPj4+IDMpO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMXggPSBXW2kgLSAyXTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExICA9ICgoZ2FtbWExeCA8PCAxNSkgfCAoZ2FtbWExeCA+Pj4gMTcpKSBeXG5cdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGdhbW1hMXggPDwgMTMpIHwgKGdhbW1hMXggPj4+IDE5KSkgXlxuXHQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChnYW1tYTF4ID4+PiAxMCk7XG5cblx0ICAgICAgICAgICAgICAgICAgICBXW2ldID0gZ2FtbWEwICsgV1tpIC0gN10gKyBnYW1tYTEgKyBXW2kgLSAxNl07XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIHZhciBjaCAgPSAoZSAmIGYpIF4gKH5lICYgZyk7XG5cdCAgICAgICAgICAgICAgICB2YXIgbWFqID0gKGEgJiBiKSBeIChhICYgYykgXiAoYiAmIGMpO1xuXG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWEwID0gKChhIDw8IDMwKSB8IChhID4+PiAyKSkgXiAoKGEgPDwgMTkpIHwgKGEgPj4+IDEzKSkgXiAoKGEgPDwgMTApIHwgKGEgPj4+IDIyKSk7XG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWExID0gKChlIDw8IDI2KSB8IChlID4+PiA2KSkgXiAoKGUgPDwgMjEpIHwgKGUgPj4+IDExKSkgXiAoKGUgPDwgNykgIHwgKGUgPj4+IDI1KSk7XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0MSA9IGggKyBzaWdtYTEgKyBjaCArIEtbaV0gKyBXW2ldO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQyID0gc2lnbWEwICsgbWFqO1xuXG5cdCAgICAgICAgICAgICAgICBoID0gZztcblx0ICAgICAgICAgICAgICAgIGcgPSBmO1xuXHQgICAgICAgICAgICAgICAgZiA9IGU7XG5cdCAgICAgICAgICAgICAgICBlID0gKGQgKyB0MSkgfCAwO1xuXHQgICAgICAgICAgICAgICAgZCA9IGM7XG5cdCAgICAgICAgICAgICAgICBjID0gYjtcblx0ICAgICAgICAgICAgICAgIGIgPSBhO1xuXHQgICAgICAgICAgICAgICAgYSA9ICh0MSArIHQyKSB8IDA7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZGlhdGUgaGFzaCB2YWx1ZVxuXHQgICAgICAgICAgICBIWzBdID0gK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uXHQgICAgICAgICAgICB5ID0gbmV3WTtcblx0ICAgICAgICB9XG5cblx0ICAgICAgICAvLyBDb21wdXRlIHBpIGluZGV4IGNvbnN0YW50c1xuXHQgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgNTsgeSsrKSB7XG5cdCAgICAgICAgICAgICAgICBQSV9JTkRFWEVTW3ggKyA1ICogeV0gPSB5ICsgKCgyICogeCArIDMgKiB5KSAlIDUpICogNTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblxuXHQgICAgICAgIC8vIENvbXB1dGUgcm91bmQgY29uc3RhbnRzXG5cdCAgICAgICAgdmFyIExGU1IgPSAweDAxO1xuXHQgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjQ7IGkrKykge1xuXHQgICAgICAgICAgICB2YXIgcm91bmRDb25zdGFudE1zdyA9IDA7XG5cdCAgICAgICAgICAgIHZhciByb3VuZENvbnN0YW50THN3ID0gMDtcblxuXHQgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IDc7IGorKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKExGU1IgJiAweDAxKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGJpdFBvc2l0aW9uID0gKDEgPDwgaikgLSAxO1xuXHQgICAgICAgICAgICAgICAgICAgIGlmIChiaXRQb3NpdGlvbiA8IDMyKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHJvdW5kQ29uc3RhbnRMc3cgXj0gMSA8PCBiaXRQb3NpdGlvbjtcblx0ICAgICAgICAgICAgICAgICAgICB9IGVsc2UgLyogaWYgKGJpdFBvc2l0aW9uID49IDMyKSAqLyB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHJvdW5kQ29uc3RhbnRNc3cgXj0gMSA8PCAoYml0UG9zaXRpb24gLSAzMik7XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAvLyBDb21wdXRlIG5leHQgTEZTUlxuXHQgICAgICAgICAgICAgICAgaWYgKExGU1IgJiAweDgwKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gUHJpbWl0aXZlIHBvbHlub21pYWwgb3ZlciBHRigyKTogeF44ICsgeF42ICsgeF41ICsgeF40ICsgMVxuXHQgICAgICAgICAgICAgICAgICAgIExGU1IgPSAoTEZTUiA8PCAxKSBeIDB4NzE7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgICAgIExGU1IgPDw9IDE7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICBST1VORF9DT05TVEFOVFNbaV0gPSBYNjRXb3JkLmNyZWF0ZShyb3VuZENvbnN0YW50TXN3LCByb3VuZENvbnN0YW50THN3KTtcblx0ICAgICAgICB9XG5cdCAgICB9KCkpO1xuXG5cdCAgICAvLyBSZXVzYWJsZSBvYmplY3RzIGZvciB0ZW1wb3JhcnkgdmFsdWVzXG5cdCAgICB2YXIgVCA9IFtdO1xuXHQgICAgKGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI1OyBpKyspIHtcblx0ICAgICAgICAgICAgVFtpXSA9IFg2NFdvcmQuY3JlYXRlKCk7XG5cdCAgICAgICAgfVxuXHQgICAgfSgpKTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBTSEEtMyBoYXNoIGFsZ29yaXRobS5cblx0ICAgICAqL1xuXHQgICAgdmFyIFNIQTMgPSBDX2FsZ28uU0hBMyA9IEhhc2hlci5leHRlbmQoe1xuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbmZpZ3VyYXRpb24gb3B0aW9ucy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwcm9wZXJ0eSB7bnVtY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AgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIE0yaSAgPSBNW29mZnNldCArIDIgKiBpXTtcblx0ICAgICAgICAgICAgICAgIHZhciBNMmkxID0gTVtvZmZzZXQgKyAyICogaSArIDFdO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwIGVuZGlhblxuXHQgICAgICAgICAgICAgICAgTTJpID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaSA8PCA4KSAgfCAoTTJpID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaSA8PCAyNCkgfCAoTTJpID4+PiA4KSkgICYgMHhmZjAwZmYwMClcblx0ICAgICAgICAgICAgICAgICk7XG5cdCAgICAgICAgICAgICAgICBNMmkxID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaTEgPDwgOCkgIHwgKE0yaTEgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTTJpMSA8PCAyNCkgfCAoTTJpMSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBBYnNvcmIgbWVzc2FnZSBpbnRvIHN0YXRlXG5cdCAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW2ldO1xuXHQgICAgICAgICAgICAgICAgbGFuZS5oaWdoIF49IE0yaTE7XG5cdCAgICAgICAgICAgICAgICBsYW5lLmxvdyAgXj0gTTJpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUm91bmRzXG5cdCAgICAgICAgICAgIGZvciAodmFyIHJvdW5kID0gMDsgcm91bmQgPCAyNDsgcm91bmQrKykge1xuXHQgICAgICAgICAgICAgICAgLy8gVGhldGFcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gTWl4IGNvbHVtbiBsYW5lc1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0TXN3ID0gMCwgdExzdyA9IDA7XG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgeSA9IDA7IHkgPCA1OyB5KyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVt4ICsgNSAqIHldO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB0TXN3IF49IGxhbmUuaGlnaDtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdExzdyBePSBsYW5lLmxvdztcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBUZW1wb3JhcnkgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4ID0gVFt4XTtcblx0ICAgICAgICAgICAgICAgICAgICBUeC5oaWdoID0gdE1zdztcblx0ICAgICAgICAgICAgICAgICAgICBUeC5sb3cgID0gdExzdztcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4NCA9IFRbKHggKyA0KSAlIDVdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBUeDEgPSBUWyh4ICsgMSkgJSA1XTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVHgxTXN3ID0gVHgxLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4MUxzdyA9IFR4MS5sb3c7XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBNaXggc3Vycm91bmRpbmcgY29sdW1uc1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0TXN3ID0gVHg0LmhpZ2ggXiAoKFR4MU1zdyA8PCAxKSB8IChUeDFMc3cgPj4+IDMxKSk7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHRMc3cgPSBUeDQubG93ICBeICgoVHgxTHN3IDw8IDEpIHwgKFR4MU1zdyA+Pj4gMzEpKTtcblx0ICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciB5ID0gMDsgeSA8IDU7IHkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW3ggKyA1ICogeV07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUuaGlnaCBePSB0TXN3O1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBsYW5lLmxvdyAgXj0gdExzdztcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJobyBQaVxuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgbGFuZUluZGV4ID0gMTsgbGFuZUluZGV4IDwgMjU7IGxhbmVJbmRleCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVtsYW5lSW5kZXhdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lTXN3ID0gbGFuZS5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lTHN3ID0gbGFuZS5sb3c7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHJob09mZnNldCA9IFJIT19PRkZTRVRTW2xhbmVJbmRleF07XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBSb3RhdGUgbGFuZXNcblx0ICAgICAgICAgICAgICAgICAgICBpZiAocmhvT2Zmc2V0IDwgMzIpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRNc3cgPSAobGFuZU1zdyA8PCByaG9PZmZzZXQpIHwgKGxhbmVMc3cgPj4+ICgzMiAtIHJob09mZnNldCkpO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdExzdyA9IChsYW5lTHN3IDw8IHJob09mZnNldCkgfCAobGFuZU1zdyA+Pj4gKDMyIC0gcmhvT2Zmc2V0KSk7XG5cdCAgICAgICAgICAgICAgICAgICAgfSBlbHNlIC8qIGlmIChyaG9PZmZzZXQgPj0gMzIpICovIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRNc3cgPSAobGFuZUxzdyA8PCAocmhvT2Zmc2V0IC0gMzIpKSB8IChsYW5lTXN3ID4+PiAoNjQgLSByaG9PZmZzZXQpKTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRMc3cgPSAobGFuZU1zdyA8PCAocmhvT2Zmc2V0IC0gMzIpKSB8IChsYW5lTHN3ID4+PiAoNjQgLSByaG9PZmZzZXQpKTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBUcmFuc3Bvc2UgbGFuZXNcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVFBpTGFuZSA9IFRbUElfSU5ERVhFU1tsYW5lSW5kZXhdXTtcblx0ICAgICAgICAgICAgICAgICAgICBUUGlMYW5lLmhpZ2ggPSB0TXN3O1xuXHQgICAgICAgICAgICAgICAgICAgIFRQaUxhbmUubG93ICA9IHRMc3c7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJobyBwaSBhdCB4ID0geSA9IDBcblx0ICAgICAgICAgICAgICAgIHZhciBUMCA9IFRbMF07XG5cdCAgICAgICAgICAgICAgICB2YXIgc3RhdGUwID0gc3RhdGVbMF07XG5cdCAgICAgICAgICAgICAgICBUMC5oaWdoID0gc3RhdGUwLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICBUMC5sb3cgID0gc3RhdGUwLmxvdztcblxuXHQgICAgICAgICAgICAgICAgLy8gQ2hpXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciB4ID0gMDsgeCA8IDU7IHgrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgNTsgeSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZUluZGV4ID0geCArIDUgKiB5O1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW2xhbmVJbmRleF07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBUTGFuZSA9IFRbbGFuZUluZGV4XTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIFR4MUxhbmUgPSBUWygoeCArIDEpICUgNSkgKyA1ICogeV07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBUeDJMYW5lID0gVFsoKHggKyAyKSAlIDUpICsgNSAqIHldO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIE1peCByb3dzXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUuaGlnaCA9IFRMYW5lLmhpZ2ggXiAoflR4MUxhbmUuaGlnaCAmIFR4MkxhbmUuaGlnaCk7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUubG93ICA9IFRMYW5lLmxvdyAgXiAoflR4MUxhbmUubG93ICAmIFR4MkxhbmUubG93KTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIElvdGFcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lID0gc3RhdGVbMF07XG5cdCAgICAgICAgICAgICAgICB2YXIgcm91bmRDb25zdGFudCA9IFJPVU5EX0NPTlNUQU5UU1tyb3VuZF07XG5cdCAgICAgICAgICAgICAgICBsYW5lLmhpZ2ggXj0gcm91bmRDb25zdGFudC5oaWdoO1xuXHQgICAgICAgICAgICAgICAgbGFuZS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aCAvIDg7XG5cdCAgICAgICAgICAgIHZhciBvdXRwdXRMZW5ndGhMYW5lcyA9IG91dHB1dExlbmd0aEJ5dGVzIC8gODtcblxuXHQgICAgICAgICAgICAvLyBTcXVlZXplXG5cdCAgICAgICAgICAgIHZhciBoYXNoV29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBvdXRwdXRMZW5ndGhMYW5lczsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lID0gc3RhdGVbaV07XG5cdCAgICAgICAgICAgICAgICB2YXIgbGFuZU1zdyA9IGxhbmUuaGlnaDtcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lTHN3ID0gbGFuZS5sb3c7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgICAgICBsYW5lTXN3ID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKGxhbmVNc3cgPDwgOCkgIHwgKGxhbmVNc3cgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgobGFuZU1zdyA8PCAyNCkgfCAobGFuZU1zdyA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICAgICAgbGFuZUxzdyA9IChcblx0ICAgICAgICAgICAgICAgICAgICAoKChsYW5lTHN3IDw8IDgpICB8IChsYW5lTHN3ID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKGxhbmVMc3cgPDwgMjQpIHwgKGxhbmVMc3cgPj4+IDgpKSAgJiAweGZmMDBmZjAwKVxuXHQgICAgICAgICAgICAgICAgKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gU3F1ZWV6ZSBzdGF0ZSB0byByZXRyaWV2ZSBoYXNoXG5cdCAgICAgICAgICAgICAgICBoYXNoV29yZHMucHVzaChsYW5lTHN3KTtcblx0ICAgICAgICAgICAgICAgIGhhc2hXb3Jkcy5wdXNoKGxhbmVNc3cpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUmV0dXJuIGZpbmFsIGNvbXB1dGVkIGhhc2hcblx0ICAgICAgICAgICAgcmV0dXJuIG5ldyBXb3JkQXJyYXkuaW5pdChoYXNoV29yZHMsIG91dHB1dExlbmd0aEJ5dGVzKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIGNsb25lID0gSGFzaGVyLmNsb25lLmNhbGwodGhpcyk7XG5cblx0ICAgICAgICAgICAgdmFyIHN0YXRlID0gY2xvbmUuX3N0YXRlID0gdGhpcy5fc3RhdGUuc2xpY2UoMCk7XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjU7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgc3RhdGVbaV0gPSBzdGF0ZVtpXS5jbG9uZSgpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGNsb25lO1xuXHQgICAgICAgIH1cblx0ICAgIH0pO1xuXG5cdCAgICAvKipcblx0ICAgICAqIFNob3J0Y3V0IGZ1bmN0aW9uIHRvIHRoZSBoYXNoZXIncyBvYmplY3QgaW50ZXJmYWNlLlxuXHQgICAgICpcblx0ICAgICAqIEBwYXJhbSB7V29yZEFycmF5fHN0cmluZ30gbWVzc2FnZSBUaGUgbWVzc2FnZSB0byBoYXNoLlxuXHQgICAgICpcblx0ICAgICAqIEByZXR1cm4ge1dvcmRBcnJheX0gVGhlIGhhc2guXG5cdCAgICAgKlxuXHQgICAgICogQHN0YXRpY1xuXHQgICAgICpcblx0ICAgICAqIEBleGFtcGxlXG5cdCAgICAgKlxuXHQgICAgICogICAgIHZhciBoYXNoID0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NGY4MmIpLCBuZXcgWDY0V29yZC5pbml0KDB4YTU0ZmY1M2EsIDB4NWYxZDM2ZjEpLFxuXHQgICAgICAgICAgICAgICAgbmV3IFg2NFdvcmQuaW5pdCgweDUxMGU1MjdmLCAweGFkZTY4MmQxKSwgbmV3IFg2NFdvcmQuaW5pdCgweDliMDU2ODhjLCAweDJiM2U2YzFmKSxcblx0ICAgICAgICAgICAgICAgIG5ldyBYNjRXb3JkLmluaXQoMHgxZjgzZDlhYiwgMHhmYjQxYmQ2YiksIG5ldyBYNjRXb3JkLmluaXQoMHg1YmUwY2QxOSwgMHgxMzdlMjE3OSlcblx0ICAgICAgICAgICAgXSk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb1Byb2Nlc3NCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIEggPSB0aGlzLl9oYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBIMCA9IEhbMF07XG5cdCAgICAgICAgICAgIHZhciBIMSA9IEhbMV07XG5cdCAgICAgICAgICAgIHZhciBIMiA9IEhbMl07XG5cdCAgICAgICAgICAgIHZhciBIMyA9IEhbM107XG5cdCAgICAgICAgICAgIHZhciBINCA9IEhbNF07XG5cdCAgICAgICAgICAgIHZhciBINSA9IEhbNV07XG5cdCAgICAgICAgICAgIHZhciBINiA9IEhbNl07XG5cdCAgICAgICAgICAgIHZhciBINyA9IEhbN107XG5cblx0ICAgICAgICAgICAgdmFyIEgwaCA9IEgwLmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBIMGwgPSBIMC5sb3c7XG5cdCAgICAgICAgICAgIHZhciBIMWggPSBIMS5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDFsID0gSDEubG93O1xuXHQgICAgICAgICAgICB2YXIgSDJoID0gSDIuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEgybCA9IEgyLmxvdztcblx0ICAgICAgICAgICAgdmFyIEgzaCA9IEgzLmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBIM2wgPSBIMy5sb3c7XG5cdCAgICAgICAgICAgIHZhciBINGggPSBINC5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDRsID0gSDQubG93O1xuXHQgICAgICAgICAgICB2YXIgSDVoID0gSDUuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEg1bCA9IEg1Lmxvdztcblx0ICAgICAgICAgICAgdmFyIEg2aCA9IEg2LmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBINmwgPSBINi5sb3c7XG5cdCAgICAgICAgICAgIHZhciBIN2ggPSBINy5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDdsID0gSDcubG93O1xuXG5cdCAgICAgICAgICAgIC8vIFdvcmtpbmcgdmFyaWFibGVzXG5cdCAgICAgICAgICAgIHZhciBhaCA9IEgwaDtcblx0ICAgICAgICAgICAgdmFyIGFsID0gSDBsO1xuXHQgICAgICAgICAgICB2YXIgYmggPSBIMWg7XG5cdCAgICAgICAgICAgIHZhciBibCA9IEgxbDtcblx0ICAgICAgICAgICAgdmFyIGNoID0gSDJoO1xuXHQgICAgICAgICAgICB2YXIgY2wgPSBIMmw7XG5cdCAgICAgICAgICAgIHZhciBkaCA9IEgzaDtcblx0ICAgICAgICAgICAgdmFyIGRsID0gSDNsO1xuXHQgICAgICAgICAgICB2YXIgZWggPSBINGg7XG5cdCAgICAgICAgICAgIHZhciBlbCA9IEg0bDtcblx0ICAgICAgICAgICAgdmFyIGZoID0gSDVoO1xuXHQgICAgICAgICAgICB2YXIgZmwgPSBINWw7XG5cdCAgICAgICAgICAgIHZhciBnaCA9IEg2aDtcblx0ICAgICAgICAgICAgdmFyIGdsID0gSDZsO1xuXHQgICAgICAgICAgICB2YXIgaGggPSBIN2g7XG5cdCAgICAgICAgICAgIHZhciBobCA9IEg3bDtcblxuXHQgICAgICAgICAgICAvLyBSb3VuZHNcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA4MDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgdmFyIFdpID0gV1tpXTtcblxuXHQgICAgICAgICAgICAgICAgLy8gRXh0ZW5kIG1lc3NhZ2Vcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMTYpIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2loID0gV2kuaGlnaCA9IE1bb2Zmc2V0ICsgaSAqIDJdICAgICB8IDA7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpbCA9IFdpLmxvdyAgPSBNW29mZnNldCArIGkgKiAyICsgMV0gfCAwO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICAvLyBHYW1tYTBcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWEweCAgPSBXW2kgLSAxNV07XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMHhoID0gZ2FtbWEweC5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTB4bCA9IGdhbW1hMHgubG93O1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTBoICA9ICgoZ2FtbWEweGggPj4+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+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBINmwgPSBINi5sb3cgID0gKEg2bCArIGdsKTtcblx0ICAgICAgICAgICAgSDYuaGlnaCA9IChINmgg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B4ODAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDAwOiAweDIwMixcblx0ICAgICAgICAgICAgMHg5MDAwMDAwMDogMHg4MDAyMDAsXG5cdCAgICAgICAgICAgIDB4YTAwMDAwMDA6IDB4ODIwMCxcblx0ICAgICAgICAgICAgMHhiMDAwMDAwMDogMHg4MDgwMDAsXG5cdCAgICAgICAgICAgIDB4YzAwMDAwMDA6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhkMDAwMDAwMDogMHg4MDAwMDIsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhmMDAwMDAwMDogMHg4MjAyLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxODAwMDAwMDogMHg4MDgyMDIsXG5cdCAgICAgICAgICAgIDB4MjgwMDAwMDA6IDB4ODIwMixcblx0ICAgICAgICAgICAgMHgzODAwMDAwMDogMHg4MDAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDAwOiAweDgwODIwMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDAwMDogMHgyMDAsXG5cdCAgICAgICAgICAgIDB4NjgwMDAwMDA6IDB4ODA4MDAyLFxuXHQgICAgICAgICAgICAweDc4MDAwMDAwOiAweDIsXG5cdCAgICAgICAgICAgIDB4ODgwMDAwMDA6IDB4ODAwMjAwLFxuXHQgICAgICAgICAgICAweDk4MDAwMDAwOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDAwMDA6IDB4ODA4MDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwMDAwOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHhjODAwMDAwMDogMHg4MDAwMDIsXG5cdCAgICAgICAgICAgIDB4ZDgwMDAwMDA6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhlODAwMDAwMDogMHgyMDIsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwMDA6IDB4ODAwMDAwLFxuXHQgICAgICAgICAgICAweDE6IDB4ODAwMCxcblx0ICAgICAgICAgICAgMHgxMDAwMDAwMTogMHgyLFxuXHQgICAgICAgICAgICAweDIwMDAwMDAxOiAweDgwODIwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDAwMTogMHg4MDAwMDAsXG5cdCAgICAgICAgICAgIDB4NDAwMDAwMDE6IDB4ODA4MDAyLFxuXHQgICAgICAgICAgICAweDUwMDAwMDAxOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4NjAwMDAwMDE6IDB4MjAwLFxuXHQgICAgICAgICAgICAweDcwMDAwMDAxOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMTogMHg4MDgyMDIsXG5cdCAgICAgICAgICAgIDB4OTAwMDAwMDE6IDB4ODA4MDAwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDAxOiAweDgwMDAwMixcblx0ICAgICAgICAgICAgMHhiMDAwMDAwMTogMHg4MjAyLFxuXHQgICAgICAgICAgICAweGMwMDAwMDAxOiAweDIwMixcblx0ICAgICAgICAgICAgMHhkMDAwMDAwMTogMHg4MDAyMDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwMDE6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhmMDAwMDAwMTogMHgwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE6IDB4ODA4MjAyLFxuXHQgICAgICAgICAgICAweDE4MDAwMDAxOiAweDgwODAwMCxcblx0ICAgICAgICAgICAgMHgyODAwMDAwMTogMHg4MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MzgwMDAwMDE6IDB4MjAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDAxOiAweDgwMDAsXG5cdCAgICAgICAgICAgIDB4NTgwMDAwMDE6IDB4ODAwMDAyLFxuXHQgICAgICAgICAgICAweDY4MDAwMDAxOiAweDIsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwMDE6IDB4ODIwMixcblx0ICAgICAgICAgICAgMHg4ODAwMDAwMTogMHg4MDAyLFxuXHQgICAgICAgICAgICAweDk4MDAwMDAxOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHhhODAwMDAwMTogMHgyMDIsXG5cdCAgICAgICAgICAgIDB4YjgwMDAwMDE6IDB4ODA4MjAwLFxuXHQgICAgICAgICAgICAweGM4MDAwMDAxOiAweDgwMDIwMCxcblx0ICAgICAgICAgICAgMHhkODAwMDAwMTogMHgwLFxuXHQgICAgICAgICAgICAweGU4MDAwMDAxOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwMDE6IDB4ODA4MDAyXG5cdCAgICAgICAgfSxcblx0ICAgICAgICB7XG5cdCAgICAgICAgICAgIDB4MDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHgxMDAwMDAwOiAweDQwMDAsXG5cdCAgICAgICAgICAgIDB4MjAwMDAwMDogMHg4MDAwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDAwOiAweDQwMDgwMDEwLFxuXHQgICAgICAgICAgICAweDQwMDAwMDA6IDB4NDAwMDAwMTAsXG5cdCAgICAgICAgICAgIDB4NTAwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHg2MDAwMDAwOiAweDQwMDA0MDAwLFxuXHQgICAgICAgICAgICAweDcwMDAwMDA6IDB4MTAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDogMHg4NDAwMCxcblx0ICAgICAgICAgICAgMHg5MDAwMDAwOiAweDQwMDA0MDEwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDA6IDB4NDAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4YjAwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHhjMDAwMDAwOiAweDgwMDEwLFxuXHQgICAgICAgICAgICAweGQwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhlMDAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4ZjAwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDA6IDB4NDAwMDQwMDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHgyODAwMDAwOiAweDEwLFxuXHQgICAgICAgICAgICAweDM4MDAwMDA6IDB4NDAwMDQwMTAsXG5cdCAgICAgICAgICAgIDB4NDgwMDAwMDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDAwOiAweDQwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDY4MDAwMDA6IDB4ODAwMDAsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwMDogMHg0MDA4MDAxMCxcblx0ICAgICAgICAgICAgMHg4ODAwMDAwOiAweDgwMDEwLFxuXHQgICAgICAgICAgICAweDk4MDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhhODAwMDAwOiAweDQwMDAsXG5cdCAgICAgICAgICAgIDB4YjgwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHhjODAwMDAwOiAweDQwMDAwMDEwLFxuXHQgICAgICAgICAgICAweGQ4MDAwMDA6IDB4ODQwMDAsXG5cdCAgICAgICAgICAgIDB4ZTgwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHhmODAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4MTAwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxMTAwMDAwMDogMHg0MDA4MDAxMCxcblx0ICAgICAgICAgICAgMHgxMjAwMDAwMDogMHg0MDAwNDAxMCxcblx0ICAgICAgICAgICAgMHgxMzAwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHgxNDAwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHgxNTAwMDAwMDogMHgxMCxcblx0ICAgICAgICAgICAgMHgxNjAwMDAwMDogMHg4NDAxMCxcblx0ICAg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AsXG5cdCAgICAgICAgICAgIDB4MWU4MDAwMDA6IDB4NDAwODAwMTAsXG5cdCAgICAgICAgICAgIDB4MWY4MDAwMDA6IDB4ODQwMDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDEwNCxcblx0ICAgICAgICAgICAgMHgxMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgyMDAwMDA6IDB4NDAwMDEwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDA6IDB4MTAxMDQsXG5cdCAgICAgICAgICAgIDB4NDAwMDAwOiAweDEwMDA0LFxuXHQgICAgICAgICAgICAweDUwMDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDYwMDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDcwMDAwMDogMHg0MDEwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDogMHg0MDAwMDAwLFxuXHQgICAgICAgICAgICAweDkwMDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDogMHgxMDEwMCxcblx0ICAgICAgICAgICAgMHhiMDAwMDA6IDB4NDAxMDAwNCxcblx0ICAgICAgICAgICAgMHhjMDAwMDA6IDB4NDAwMDEwNCxcblx0ICAgICAgICAgICAgMHhkMDAwMDA6IDB4MTAwMDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwOiAweDQsXG5cdCAgICAgICAgICAgIDB4ZjAwMDAwOiAweDEwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDogMHg0MDEwMDA0LFxuXHQgICAgICAgICAgICAweDI4MDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDM4MDAwMDogMHg0MDAwMTAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDU4MDAwMDogMHgxMDAwMCxcblx0ICAgICAgICAgICAgMHg2ODAwMDA6IDB4MTAwMDQsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwOiAweDEwNCxcblx0ICAgICAgICAgICAgMHg4ODAwMDA6IDB4NCxcblx0ICAgICAgICAgICAgMHg5ODAwMDA6IDB4MTAwLFxuXHQgICAgICAgICAgICAweGE4MDAwMDogMHg0MDEwMDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwMDogMHgxMDEwNCxcblx0ICAgICAgICAgICAgMHhjODAwMDA6IDB4MTAxMDAsXG5cdCAgICAgICAgICAgIDB4ZDgwMDAwOiAweDQwMDAxMDQsXG5cdCAgICAgICAgICAgIDB4ZTgwMDAwOiAweDQwMTAxMDQsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwOiAweDQwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTAwMDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweDExMDAwMDA6IDB4MTAwMDQsXG5cdCAgICAgICAgICAgIDB4MTIwMDAwMDogMHgxMDAwMCxcblx0ICAgICAgICAgICAgMHgxMzAwMDAwOiAweDQwMDAxMDAsXG5cdCAgICAgICAgICAgIDB4MTQwMDAwMDogMHgxMDAsXG5cdCAgICAgICAgICAgIDB4MTUwMDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDE2MDAwMDA6IDB4NDAwMDAwNCxcblx0ICAgICAgICAgICAgMHgxNzAwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwMDogMHg0MDAwMTA0LFxuXHQgICAgICAgICAgICAweDE5MDAwMDA6IDB4NDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYTAwMDAwOiAweDQsXG5cdCAgICAgICAgICAgIDB4MWIwMDAwMDogMHgxMDEwMCxcblx0ICAgICAgICAgICAgMHgxYzAwMDAwOiAweDQwMTAwMDAsXG5cdCAgICAgICAgICAgIDB4MWQwMDAwMDogMHgxMDQsXG5cdCAgICAgICAgICAgIDB4MWUwMDAwMDogMHgxMDEwNCxcblx0ICAgICAgICAgICAgMHgxZjAwMDAwOiAweDQwMTAwMDQsXG5cdCAgICAgICAgICAgIDB4MTA4MDAwMDogMHg0MDAwMDAwLFxuXHQgICAgICAgICAgICAweDExODAwMDA6IDB4MTA0LFxuXHQgICAgICAgICAgICAweDEyODAwMDA6IDB4NDAxMDEwMCxcblx0ICAgICAgICAgICAgMHgxMzgwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTQ4MDAwMDogMHgxMDAwNCxcblx0ICAgICAgICAgICAgMHgxNTgwMDAwOiAweDQwMDAxMDAsXG5cdCAgICAgICAgICAgIDB4MTY4MDAwMDogMHgxMDAsXG5cdCAgICAgICAgICAgIDB4MTc4MDAwMDogMHg0MDEwMDA0LFxuXHQgICAgICAgICAgICAweDE4ODAwMDA6IDB4MTAwMDAsXG5cdCAgICAgICAgICAgIDB4MTk4MDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDFhODAwMDA6IDB4MTAxMDQsXG5cdCAgICAgICAgICAgIDB4MWI4MDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDFjODAwMDA6IDB4NDAwMDEwNCxcblx0ICAgICAgICAgICAgMHgxZDgwMDAwOiAweDQwMTAwMDAsXG5cdCAgICAgICAgICAgIDB4MWU4MDAwMDogMHg0LFxuXHQgICAgICAgICAgICAweDFmODAwMDA6IDB4MTAxMDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwNDAxMDAwLFxuXHQgICAgICAgICAgICAweDEwMDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDIwMDAwOiAweDQwMTA0MCxcblx0ICAgICAgICAgICAgMHgzMDAwMDogMHg4MDQwMDAwMCxcblx0ICAgICAgICAgICAgMHg0MDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDUwMDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHg2MDAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHg3MDAwMDogMHg0MDAwNDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4OTAwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweGEwMDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweGIwMDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweGMwMDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweGQwMDAwOiAweDEwNDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDA6IDB4MTAwMCxcblx0ICAgICAgICAgICAgMHhmMDAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHg4MDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDE4MDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDI4MDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweDM4MDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHg2ODAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDc4MDAwOiAweDgwNDAwMDAwLFxuXHQgICAgICAgICAgICAweDg4MDAwOiAweDEwMDAsXG5cdCAgICAgICAgICAgIDB4OTgwMDA6IDB4ODA0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwOiAweDEwNDAsXG5cdCAgICAgICAgICAgIDB4YzgwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ZDgwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweGU4MDAwOiAweDQwMTA0MCxcblx0ICAgICAgICAgICAgMHhmODAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHgxMDAwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweDExMDAwMDogMHg0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4MTIwMDAwOiAweDgwMDAwMDQwLFxuXHQgICAgICAgICAgICAweDEzMDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDE0MDAwMDogMHgxMDQwLFxuXHQgICAgICAgICAgICAweDE1MDAwMDogMHg4MDQwMDA0MCxcblx0ICAgICAgICAgICAgMHgxNjAwMDA6IDB4ODA0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4MTcwMDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHgxOTAwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWEwMDAwOiAweDgwNDAwMDAwLFxuXHQgICAgICAgICAgICAweDFiMDAwMDogMHg0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4MWMwMDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweDFkMDAwMDogMHg0MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWUwMDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDFmMDAwMDogMHgxMDAwLFxuXHQgICAgICAgICAgICAweDEwODAwMDogMHg4MDQwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMTgwMDA6IDB4ODA0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTI4MDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHgxNDgwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweDE1ODAwMDogMHg4MDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNjgwMDA6IDB4ODAwMDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTc4MDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDE4ODAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHgxOTgwMDA6IDB4MTAwMCxcblx0ICAgICAgICAgICAgMHgxYTgwMDA6IDB4ODAwMDEwMDAsXG5cdCAgICAgICAgICAgIDB4MWI4MDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweDFjODAwMDogMHgxMDQwLFxuXHQgICAgICAgICAgICAweDFkODAwMDogMHg4MDQwMTAwMCxcblx0ICAgICAgICAgICAgMHgxZTgwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweDFmODAwMDogMHg0MDEwNDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwLFxuXHQgICAgICAgICAgICAweDEwMDA6IDB4MTA0MDAwMCxcblx0ICAgICAgICAgICAgMHgyMDAwOiAweDQwMDAwLFxuXHQgICAgICAgICAgICAweDMwMDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4NDAwMDogMHgyMDA0MDA4MCxcblx0ICAgICAgICAgICAgMHg1MDAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4NjAwMDogMHgyMTAwMDA4MCxcblx0ICAgICAgICAgICAgMHg3MDAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDgwMDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHg5MDAwOiAweDIwMDQwMDAwLFxuXHQgICAgICAgICAgICAweGEwMDA6IDB4MjAwMDAwODAsXG5cdCAgICAgICAgICAgIDB4YjAwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHhjMDAwOiAweDIxMDQwMDAwLFxuXHQgICAgICAgICAgICAweGQwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhlMDAwOiAweDEwNDAwODAsXG5cdCAgICAgICAgICAgIDB4ZjAwMDogMHgyMTAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxODAwOiAweDIxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDI4MDA6IDB4ODAsXG5cdCAgICAgICAgICAgIDB4MzgwMDogMHgxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDA6IDB4NDAwMDAsXG5cdCAgICAgICAgICAgIDB4NTgwMDogMHgyMDA0MDA4MCxcblx0ICAgICAgICAgICAgMHg2ODAwOiAweDIxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDc4MDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODgwMDogMHgyMDA0MDAwMCxcblx0ICAgICAgICAgICAgMHg5ODAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHhiODAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4YzgwMDogMHgyMDAwMDA4MCxcblx0ICAgICAgICAgICAgMHhkODAwOiAweDIxMDAwMDAwLFxuXHQgICAgICAgICAgICAweGU4MDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHhmODAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDEwMDAwOiAweDQwMDAwLFxuXHQgICAgICAgICAgICAweDExMDAwOiAweDgwLFxuXHQgICAgICAgICAgICAweDEyMDAwOiAweDIwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEzMDAwOiAweDIxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDE0MDAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MTUwMDA6IDB4MjEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTYwMDA6IDB4MjAwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTcwMDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxODAwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxOTAwMDogMHgyMTAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYTAwMDogMHgxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDFiMDAwOiAweDIwMDQwMDAwLFxuXHQgICAgICAgICAgICAweDFjMDAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDFkMDAwOiAweDIwMDAwMDgwLFxuXHQgICAgICAgICAgICAweDFlMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MWYwMDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxMDgwMDogMHgyMTAwMDA4MCxcblx0ICAgICAgICAgICAgMHgxMTgwMDogMHgxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEyODAwOiAweDEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDA6IDB4MjAwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTQ4MDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTU4MDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxNjgwMDogMHg4MCxcblx0ICAgICAgICAgICAgMHgxNzgwMDogMHgyMTA0MDAwMCxcblx0ICAgICAgICAgICAgMHgxODgwMDogMHg0MDA4MCxcblx0ICAgICAgICAgICAgMHgxOTgwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxYTgwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFiODAwOiAweDIxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDFjODAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MWQ4MDA6IDB4NDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWU4MDA6IDB4MjAwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWY4MDA6IDB4MjAwMDAwODBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDEwMDAwMDA4LFxuXHQgICAgICAgICAgICAweDEwMDogMHgyMDAwLFxuXHQgICAgICAgICAgICAweDIwMDogMHgxMDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgzMDA6IDB4MTAyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4NDAwOiAweDEwMDAyMDAwLFxuXHQgICAgICAgICAgICAweDUwMDogMHgyMDAwMDAsXG5cdCAgICAgICAgICAgIDB4NjAwOiAweDIwMDAwOCxcblx0ICAgICAgICAgICAgMHg3MDA6IDB4MTAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4OTAwOiAweDEwMDAyMDA4LFxuXHQgICAgICAgICAgICAweGEwMDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4YjAwOiAweDgsXG5cdCAgICAgICAgICAgIDB4YzAwOiAweDEwMjAwMDA4LFxuXHQgICAgICAgICAgICAweGQwMDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4ZTAwOiAweDIwMDgsXG5cdCAgICAgICAgICAgIDB4ZjAwOiAweDEwMjAyMDAwLFxuXHQgICAgICAgICAgICAweDgwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDE4MDogMHgxMDIwMjAwOCxcblx0ICAgICAgICAgICAgMHgyODA6IDB4OCxcblx0ICAgICAgICAgICAgMHgzODA6IDB4MjAwMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4NTgwOiAweDEwMDAwMDA4LFxuXHQgICAgICAgICAgICAweDY4MDogMHgxMDAwMjAwMCxcblx0ICAgICAgICAgICAgMHg3ODA6IDB4MjAwOCxcblx0ICAgICAgICAgICAgMHg4ODA6IDB4MjAwMDA4LFxuXHQgICAgICAgICAgICAweDk4MDogMHgyMDAwLFxuXHQgICAgICAgICAgICAweGE4MDogMHgxMDAwMjAwOCxcblx0ICAgICAgICAgICAgMHhiODA6IDB4MTAyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4YzgwOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZDgwOiAweDEwMjAyMDAwLFxuXHQgICAgICAgICAgICAweGU4MDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4ZjgwOiAweDEwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEwMDA6IDB4MTAwMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTEwMDogMHgxMDIwMDAwOCxcblx0ICAgICAgICAgICAgMHgxMjAwOiAweDEwMjAyMDA4LFxuXHQgICAgICAgICAgICAweDEzMDA6IDB4MjAwOCxcblx0ICAgICAgICAgICAgMHgxNDAwOiAweDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNTAwOiAweDEwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDE2MDA6IDB4MTAwMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTcwMDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MTkwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFhMDA6IDB4OCxcblx0ICAgICAgICAgICAgMHgxYjAwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDFjMDA6IDB4MjAwMCxcblx0ICAgICAgICAgICAgMHgxZDAwOiAweDEwMDAyMDA4LFxuXHQgICAgICAgICAgICAweDFlMDA6IDB4MTAyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MWYwMDogMHgyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTA4MDogMHg4LFxuXHQgICAgICAgICAgICAweDExODA6IDB4MjAyMDAwLFxuXHQgICAgICAgICAgICAweDEyODA6IDB4MjAwMDAwLFxuXHQgICAgICAgICAgICAweDEzODA6IDB4MTAwMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTQ4MDogMHgxMDAwMjAwMCxcblx0ICAgICAgICAgICAgMHgxNTgwOiAweDIwMDgsXG5cdCAgICAgICAgICAgIDB4MTY4MDogMHgxMDIwMjAwOCxcblx0ICAgICAgICAgICAgMHgxNzgwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDE4ODA6IDB4MTAyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTk4MDogMHgxMDIwMDAwOCxcblx0ICAgICAgICAgICAgMHgxYTgwOiAweDIwMDAsXG5cdCAgICAgICAgICAgIDB4MWI4MDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MWM4MDogMHgyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MWQ4MDogMHgwLFxuXHQgICAgICAgICAgICAweDFlODA6IDB4MTAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWY4MDogMHgxMDAwMjAwOFxuXHQgICAgICAgIH0sXG5cdCAgICAgICAge1xuXHQgICAgICAgICAgICAweDA6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDEwOiAweDIwMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MjA6IDB4NDAwLFxuXHQgICAgICAgICAgICAweDMwOiAweDEwMDQwMSxcblx0ICAgICAgICAgICAgMHg0MDogMHgyMTAwNDAxLFxuXHQgICAgICAgICAgICAweDUwOiAweDAsXG5cdCAgICAgICAgICAgIDB4NjA6IDB4MSxcblx0ICAgICAgICAgICAgMHg3MDogMHgyMTAwMDAxLFxuXHQgICAgICAgICAgICAweDgwOiAweDIwMDA0MDAsXG5cdCAgICAgICAgICAgIDB4OTA6IDB4MTAwMDAxLFxuXHQgICAgICAgICAgICAweGEwOiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4YjA6IDB4MjEwMDQwMCxcblx0ICAgICAgICAgICAgMHhjMDogMHgyMTAwMDAwLFxuXHQgICAgICAgICAgICAweGQwOiAweDQwMSxcblx0ICAgICAgICAgICAgMHhlMDogMHgxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4ZjA6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4OiAweDIxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MTg6IDB4MCxcblx0ICAgICAgICAgICAgMHgyODogMHgyMDAwNDAxLFxuXHQgICAgICAgICAgICAweDM4OiAweDIxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4NDg6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDU4OiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4Njg6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHg3ODogMHg0MDEsXG5cdCAgICAgICAgICAgIDB4ODg6IDB4MTAwNDAxLFxuXHQgICAgICAgICAgICAweDk4OiAweDIwMDA0MDAsXG5cdCAgICAgICAgICAgIDB4YTg6IDB4MjEwMDAwMCxcblx0ICAgICAgICAgICAgMHhiODogMHgxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4Yzg6IDB4NDAwLFxuXHQgICAgICAgICAgICAweGQ4OiAweDIxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4ZTg6IDB4MSxcblx0ICAgICAgICAgICAgMHhmODogMHgxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MTAwOiAweDIwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTEwOiAweDEwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMjA6IDB4MjAwMDQwMSxcblx0ICAgICAgICAgICAgMHgxMzA6IDB4MjEwMDAwMSxcblx0ICAgICAgICAgICAgMHgxNDA6IDB4MTAwMDAxLFxuXHQgICAgICAgICAgICAweDE1MDogMHgyMDAwNDAwLFxuXHQgICAgICAgICAgICAweDE2MDogMHgyMTAwNDAwLFxuXHQgICAgICAgICAgICAweDE3MDogMHgxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MTgwOiAweDQwMSxcblx0ICAgICAgICAgICAgMHgxOTA6IDB4MjEwMDQwMSxcblx0ICAgICAgICAgICAgMHgxYTA6IDB4MTAwNDAwLFxuXHQgICAgICAgICAgICAweDFiMDogMHgxLFxuXHQgICAgICAgICAgICAweDFjMDogMHgwLFxuXHQgICAgICAgICAgICAweDFkMDogMHgyMTAwMDAwLFxuXHQgICAgICAgICAgICAweDFlMDogMHgyMDAwMDAxLFxuXHQgICAgICAgICAgICAweDFmMDogMHg0MDAsXG5cdCAgICAgICAgICAgIDB4MTA4OiAweDEwMDQwMCxcblx0ICAgICAgICAgICAgMHgxMTg6IDB4MjAwMDQwMSxcblx0ICAgICAgICAgICAgMHgxMjg6IDB4MjEwMDAwMSxcblx0ICAgICAgICAgICAgMHgxMzg6IDB4MSxcblx0ICAgICAgICAgICAgMHgxNDg6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNTg6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDE2ODogMHg0MDEsXG5cdCAgICAgICAgICAgIDB4MTc4OiAweDIxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MTg4OiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MTk4OiAweDIxMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWE4OiAweDAsXG5cdCAgICAgICAgICAgIDB4MWI4OiAweDIxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MWM4OiAweDEwMDQwMSxcblx0ICAgICAgICAgICAgMHgxZDg6IDB4NDAwLFxuXHQgICAgICAgICAgICAweDFlODogMHgyMDAwNDAwLFxuXHQgICAgICAgICAgICAweDFmODogMHgxMDAwMDFcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwMDA4MjAsXG5cdCAgICAgICAgICAgIDB4MTogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgyOiAweDgwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MzogMHgyMCxcblx0ICAgICAgICAgICAgMHg0OiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDU6IDB4ODAyMDgyMCxcblx0ICAgICAgICAgICAgMHg2OiAweDgwMjA4MDAsXG5cdCAgICAgICAgICAgIDB4NzogMHg4MDAsXG5cdCAgICAgICAgICAgIDB4ODogMHg4MDIwMDAwLFxuXHQgICAgICAgICAgICAweDk6IDB4ODAwMDgwMCxcblx0ICAgICAgICAgICAgMHhhOiAweDIwODAwLFxuXHQgICAgICAgICAgICAweGI6IDB4ODAyMDAyMCxcblx0ICAgICAgICAgICAgMHhjOiAweDgyMCxcblx0ICAgICAgICAgICAgMHhkOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZTogMHg4MDAwMDIwLFxuXHQgICAgICAgICAgICAweGY6IDB4MjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDA6IDB4ODAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDAxOiAweDgwMjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDI6IDB4ODAwMDgyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMzogMHg4MDAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA0OiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDU6IDB4MjA4MDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDY6IDB4MjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDc6IDB4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDg6IDB4ODAwMDAyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwOTogMHg4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGE6IDB4MjAwMjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGI6IDB4ODAyMDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwYzogMHgwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDBkOiAweDgwMjAwMjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGU6IDB4ODAwMDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwZjogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgxMDogMHgyMDgyMCxcblx0ICAgICAgICAgICAgMHgxMTogMHg4MDIwODAwLFxuXHQgICAgICAgICAgICAweDEyOiAweDIwLFxuXHQgICAgICAgICAgICAweDEzOiAweDgwMCxcblx0ICAgICAgICAgICAgMHgxNDogMHg4MDAwODAwLFxuXHQgICAgICAgICAgICAweDE1OiAweDgwMDAwMjAsXG5cdCAgICAgICAgICAgIDB4MTY6IDB4ODAyMDAyMCxcblx0ICAgICAgICAgICAgMHgxNzogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgxODogMHgwLFxuXHQgICAgICAgICAgICAweDE5OiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDFhOiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4MWI6IDB4ODAwMDgyMCxcblx0ICAgICAgICAgICAgMHgxYzogMHg4MDIwODIwLFxuXHQgICAgICAgICAgICAweDFkOiAweDIwODAwLFxuXHQgICAgICAgICAgICAweDFlOiAweDgyMCxcblx0ICAgICAgICAgICAgMHgxZjogMHg4MDAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDEwOiAweDIwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDExOiAweDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxMjogMHg4MDIwMDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDEzOiAweDIwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE0OiAweDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE1OiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMTY6IDB4ODAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxNzogMHg4MDAwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE4OiAweDgwMjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMTk6IDB4ODAwMDAyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxYTogMHg4MDAwODAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFiOiAweDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMWM6IDB4MjA4MDAsXG5cdCAgICA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5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBBc3NlbWJsZSAxNiBzdWJrZXlzXG5cdCAgICAgICAgICAgIHZhciBzdWJLZXlzID0gdGhpcy5fc3ViS2V5cyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBuU3ViS2V5ID0gMDsgblN1YktleSA8IDE2OyBuU3ViS2V5KyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIENyZWF0ZSBzdWJrZXlcblx0ICAgICAgICAgICAgICAgIHZhciBzdWJLZXkgPSBzdWJLZXlzW25TdWJLZXldID0gW107XG5cblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICB2YXIgYml0U2hpZnQgPSBCSVRfU0hJRlRTW25TdWJLZXldO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTZWxlY3QgNDggYml0cyBhY2NvcmRpbmcgdG8gUEMyXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAvLyBTZWxlY3QgZnJvbSB0aGUgbGVmdCAyOCBrZXkgYml0c1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVsoaSAvIDYpIHwgMF0gfD0ga2V5Qml0c1soKFBDMltpXSAtIDEpICsgYml0U2hpZnQpICUgMjhdIDw8ICgzMSAtIGkgJSA2KTtcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFNlbGVjdCBmcm9tIHRoZSByaWdodCAyOCBrZXkgYml0c1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVs0ICsgKChpIC8gNikgfCAwKV0gfD0ga2V5Qml0c1syOCArICgoKFBDMltpICsgMjRdIC0gMSkgKyBiaXRTaGlmdCkgJSAyOCldIDw8ICgzMSAtIGkgJSA2KTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gU2luY2UgZWFjaCBzdWJrZXkgaXMgYXBwbGllZCB0byBhbiBleHBhbmRlZCAzMi1iaXQgaW5wdXQsXG5cdCAgICAgICAgICAgICAgICAvLyB0aGUgc3Via2V5IGNhbiBiZSBicm9rZW4gaW50byA4IHZhbHVlcyBzY2FsZWQgdG8gMzItYml0cyxcblx0ICAgICAgICAgICAgICAgIC8vIHdoaWNoIGFsbG93cyB0aGUga2V5IHRvIGJlIHVzZWQgd2l0aG91dCBleHBhbnNpb25cblx0ICAgICAgICAgICAgICAgIHN1YktleVswXSA9IChzdWJLZXlbMF0gPDwgMSkgfCAoc3ViS2V5WzBdID4+PiAzMSk7XG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IDc7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVtpXSA9IHN1YktleVtpXSA+Pj4gKChpIC0gMSkgKiA0ICsgMyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICBzdWJLZXlbN10gPSAoc3ViS2V5WzddIDw8IDUpIHwgKHN1YktleVs3XSA+Pj4gMjcpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBpbnZlcnNlIHN1YmtleXNcblx0ICAgICAgICAgICAgdmFyIGludlN1YktleXMgPSB0aGlzLl9pbnZTdWJLZXlzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMTY7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgaW52U3ViS2V5c1tpXSA9IHN1YktleXNbMTUgLSBpXTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBlbmNyeXB0QmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgdGhpcy5fZG9DcnlwdEJsb2NrKE0sIG9mZnNldCwgdGhpcy5fc3ViS2V5cyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIGRlY3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5fckJsb2NrO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBGZWlzdGVsIGZ1bmN0aW9uXG5cdCAgICAgICAgICAgICAgICB2YXIgZiA9IDA7XG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDg7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGYgfD0gU0JPWF9QW2ldWygockJsb2NrIF4gc3ViS2V5W2ldKSAmIFNCT1hfTUFTS1tpXSkgPj4+IDBdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdGhpcy5fbEJsb2NrID0gckJsb2NrO1xuXHQgICAgICAgICAgICAgICAgdGhpcy5fckJsb2NrID0gbEJsb2NrIF4gZjtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIFVuZG8gc3dhcCBmcm9tIGxhc3Qgcm91bmRcblx0ICAgICAgICAgICAgdmFyIHQgPSB0aGlzLl9sQmxvY2s7XG5cdCAgICAgICAgICAgIHRoaXMuX2xCbG9jayA9IHRoaXMuX3JCbG9jaztcblx0ICAgICAgICAgICAgdGhpcy5fckJsb2NrID0gdDtcblxuXHQgICAgICAgICAgICAvLyBGaW5hbCBwZXJtdXRhdGlvblxuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgMSwgIDB4NTU1NTU1NTUpO1xuXHQgICAgICAgICAgICBleGNoYW5nZVJMLmNhbGwodGhpcywgOCwgIDB4MDBmZjAwZmYpO1xuXHQgICAgICAgICAgICBleGNoYW5nZVJMLmNhbGwodGhpcywgMiwgIDB4MzMzMzMzMzMpO1xuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgMTYsIDB4MDAwMGZmZmYpO1xuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgNCwgIDB4MGYwZjBmMGYpO1xuXG5cdCAgICAgICAgICAgIC8vIFNldCBvdXRwdXRcblx0ICAgICAgICAgICAgTVtv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251bWJlcn0gaGlnaCBUaGUgaGlnaCAzMiBiaXRzLlxuXHQgICAgICAgICAqIEBwYXJhbSB7bnVtYmVyfSBsb3cgVGhlIGxvdyAzMiBiaXRzLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgeDY0V29yZCA9IENyeXB0b0pTLng2NC5Xb3JkLmNyZWF0ZSgweDAwMDEwMjAzLCAweDA0MDUwNjA3KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBpbml0OiBmdW5jdGlvbiAoaGlnaCwgbG93KSB7XG5cdCAgICAgICAgICAgIHRoaXMuaGlnaCA9IGhpZ2g7XG5cdCAgICAgICAgICAgIHRoaXMubG93ID0gbG93O1xuXHQgICAgICAgIH1cblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIEJpdHdpc2UgTk9UcyB0aGlzIHdvcmQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtYNjRXb3JkfSBBIG5ldyB4NjQtV29yZCBvYmplY3QgYWZ0ZXIgbmVnYXRpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBuZWdhdGVkID0geDY0V29yZC5ub3QoKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICAvLyBub3Q6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgLy8gdmFyIGhpZ2ggPSB+dGhpcy5oaWdoO1xuXHQgICAgICAgICAgICAvLyB2YXIgbG93ID0gfnRoaXMubG93O1xuXG5cdCAgICAgICAgICAgIC8vIHJldHVybiBYNjRXb3JkLmNyZWF0ZShoaWdoLCBsb3cpO1xuXHQgICAgICAgIC8vIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBCaXR3aXNlIEFORHMgdGhpcyB3b3JkIHdpdGggdGhl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29yZC5vcihhbm90aGVyWDY0V29yZCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgLy8gb3I6IGZ1bmN0aW9uICh3b3JkKSB7XG5cdCAgICAgICAgICAgIC8vIHZhciBoaWdoID0gdGhpcy5oaWdoIHwgd29yZC5oaWdoO1xuXHQgICAgICAgICAgICAvLyB2YXIgbG93ID0gdGhpcy5sb3cgfCB3b3JkLmxvdztcblxuXHQgICAgICAgICAgICAvLyByZXR1cm4gWDY0V29yZC5jcmVhdGUoaGlnaCwgbG93KTtcblx0ICAgICAgICAvLyB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQml0d2lzZSBYT1JzIHRoaXMgd29yZCB3aXRoIHRoZSBwYXNzZWQgd29yZC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7WDY0V29yZH0gd29yZCBUaGUgeDY0LVdvcmQgdG8gWE9SIHdpdGggdGhpcyB3b3JkLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZH0gQSBuZXcgeDY0LVdvcmQgb2JqZWN0IGFmdGVyIFhPUmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHhvcmVkID0geDY0V29yZC54b3IoYW5vdGhlclg2NFdvcmQpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIC8vIHhvcjogZnVuY3Rpb24gKHdvcmQpIHtcblx0ICAgICAgICAgICAgLy8gdmFyIGhpZ2ggPSB0aGlzLmhpZ2ggXiB3b3JkLmhpZ2g7XG5cdCAgICAgICAgICAgIC8vIHZhciBsb3cgPSB0aGlzLmxvdyBeIHdvcmQubG93O1xuXG5cdCAgICAgICAgICAgIC8vIHJldHVybiBYNjRXb3JkLmNyZWF0ZShoaWdoLCBsb3cpO1xuXHQgICAgICAgIC8vIH0sXG5cblx0ICAgICAgICAvKipcblx0ICA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29yZCBvYmplY3QgYWZ0ZXIgcm90YXRpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciByb3RhdGVkID0geDY0V29yZC5yb3RMKDI1KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICAvLyByb3RMOiBmdW5jdGlvbiAobikge1xuXHQgICAgICAgICAgICAvLyByZXR1cm4gdGhpcy5zaGlmdEwobikub3IodGhpcy5zaGlmdFIoNjQgLSBuKSk7XG5cdCAgICAgICAgLy8gfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIFJvdGF0ZXMgdGhpcyB3b3JkIG4gYml0cyB0byB0aGUgcmlnaHQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbiBUaGUgbnVtYmVyIG9mIGJpdHMgdG8gcm90YXRlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZH0gQSBuZXcgeDY0LVdvcmQgb2JqZWN0IGFmdGVyIHJvdGF0aW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgcm90YXRlZCA9IHg2NFdvcmQucm90Uig3KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICAvLyByb3RSOiBmdW5jdGlvbiAobikge1xuXHQgICAgICAgICAgICAvLyByZXR1cm4gdGhpcy5zaGlmdFIobikub3IodGhpcy5zaGlmdEwoNjQgLSBuKSk7XG5cdCAgICAgICAgLy8gfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIEFkZHMgdGhpcyB3b3JkIHdpdGggdGhlIHBhc3NlZCB3b3JkLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtYNjRXb3JkfSB3b3JkIFRoZSB4NjQtV29yZCB0byBhZGQ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gICAgIC8qKlxuXHQgICAgICAgICAqIEluaXRpYWxpemVzIGEgbmV3bHkgY3JlYXRlZCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtBcnJheX0gd29yZHMgKE9wdGlvbmFsKSBBbiBhcnJheSBvZiBDcnlwdG9KUy54NjQuV29yZCBvYmplY3RzLlxuXHQgICAgICAgICAqIEBwYXJhbSB7bnVtYmVyfSBzaWdCeXRlcyAoT3B0aW9uYWwpIFRoZSBudW1iZXIgb2Ygc2lnbmlmaWNhbnQgYnl0ZXMgaW4gdGhlIHdvcmRzLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMueDY0LldvcmRBcnJheS5jcmVhdGUoKTtcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMueDY0LldvcmRBcnJheS5jcmVhdGUoW1xuXHQgICAgICAgICAqICAgICAgICAgQ3J5cHRvSlMueDY0LldvcmQuY3JlYXRlKDB4MDAwMTAyMDMsIDB4MDQwNTA2MDcpLFxuXHQgICAgICAgICAqICAgICAgICAgQ3J5cHRvSlMueDY0LldvcmQuY3JlYXRlKDB4MTgxOTFhMWIsIDB4MWMxZDFlMWYpXG5cdCAgICAgICAgICogICAgIF0pO1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy54NjQuV29yZEFycmF5LmNyZWF0ZShbXG5cdCAgICAgICAgICogICAgICAgICBDcnlwdG9KUy54NjQuV29yZC5jcmVhdGUoMHgwMDAxMDIwMywgMHgwNDA1MDYwNyksXG5cdCAgICAgICAgICogICAgICAgICBDcnlwdG9KUy54NjQuV29yZC5jcmVhdGUoMHgxODE5MWExYiwgMHgxYzFkMWUxZilcblx0ICAgICAgICAgKiAgICAgXSwgMTApO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGluaXQ6IGZ1bmN0aW9uICh3b3Jkcywgc2lnQnl0ZXMpIHtcblx0ICAgICAgICAgICAgd29yZHMgPSB0aGlzLndvcmRzID0gd29yZHMgfHwgW107XG5cblx0ICAgICAgICAgICAgaWYgKHNpZ0J5dGVzICE9IHVuZGVmaW5lZCkge1xuXHQgICAgICAgICAgICAgICAgdGhpcy5zaWdCeXRlcyA9IHNpZ0J5dGVzO1xuXHQgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgdGhpcy5zaWdCeXRlcyA9IHdvcmRzLmxlbmd0aCAqIDg7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgdGhpcyA2NC1iaXQgd29yZCBhcnJheSB0byBhIDMyLWJpdCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7Q3J5cHRvSlMubGliLldvcmRBcnJheX0gVGhpcyB3b3JkIGFycmF5J3MgZGF0YSBhcyBhIDMyLWJpdCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgeDMyV29yZEFycmF5ID0geDY0V29yZEFycmF5LnRvWDMyKCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgdG9YMzI6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB4NjRXb3JkcyA9IHRoaXMud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB4NjRXb3Jkc0xlbmd0aCA9IHg2NFdvcmRzLmxlbmd0aDtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciB4MzJXb3JkcyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHg2NFdvcmRzTGVuZ3RoOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciB4NjRXb3JkID0geDY0V29yZHNbaV07XG5cdCAgICAgICAgICAgICAgICB4MzJXb3Jkcy5wdXNoKHg2NFdvcmQuaGlnaCk7XG5cdCAgICAgICAgICAgICAgICB4MzJXb3Jkcy5wdXNoKHg2NFdvcmQubG93KTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBYMzJXb3JkQXJyYXkuY3JlYXRlKHgzMldvcmRzLCB0aGlzLnNpZ0J5dGVzKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ3JlYXRlcyBhIGNvcHkgb2YgdGhpcyB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZEFycmF5fSBUaGUgY2xvbmUuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBjbG9uZSA9IHg2NFdvcmRBcnJheS5jbG9uZSgpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGNsb25lOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIHZhciBjbG9uZSA9IEJhc2UuY2xvbmUuY2FsbCh0aGlzKTtcblxuXHQgICAgICAgICAgICAvLyBDbG9uZSBcIndvcmRzXCIgYXJyYXlcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gY2xvbmUud29yZHMgPSB0aGlzLndvcmRzLnNsaWNlKDApO1xuXG5cdCAgICAgICAgICAgIC8vIENsb25lIGVhY2ggWDY0V29yZCBvYmplY3Rcblx0ICAgICAgICAgICAgdmFyIHdvcmRzTGVuZ3RoID0gd29yZHMubGVuZ3RoO1xuXHQgICAgICAgICAgIC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W4gc2VsZiAmJiAnaXRlcmF0b3InIGluIFN5bWJvbCxcbiAgICAgICAgICBibG9iOiAnRmlsZVJlYWRlcicgaW4gc2VsZiAmJiAnQmxvYicgaW4gc2VsZiAmJiAoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICBuZXcgQmxvYigpXG4gICAgICAgICAgICAgIHJldHVybiB0cnVlXG4gICAgICAgICAgICB9IGNhdGNoKGUpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSkoKSxcbiAgICAgICAgICBmb3JtRGF0YTogJ0Zvcm1EYXRhJyBpbiBzZWxmLFxuICAgICAgICAgIGFycmF5QnVmZmVyOiAnQXJyYXlCdWZmZXInIGluIHNlbGZcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChzdXBwb3J0LmFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgdmFyIHZpZXdDbGFzc2VzID0gW1xuICAgICAgICAgICAgJ1tvYmplY3QgSW50OEFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBVaW50OEFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBVaW50OENsYW1wZWRBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgSW50MTZBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgVWludDE2QXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IEludDMyQXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IFVpbnQzMkFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBGbG9hdDMyQXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IEZsb2F0NjRBcnJheV0nXG4gICAgICAgICAgXVxuXG4gICAgICAgICAgdmFyIGlzRGF0YVZpZXcgPSBmdW5jdGlvbihvYmopIHtcbiAgICAgICAgICAgIHJldHVybiBvYmogJiYgRGF0YVZpZXcucHJvdG90eXBlLm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1lKSB7IGl0ZW1zLnB1c2goW25hbWUsIHZhbHVlXSkgfSlcbiAgICAgICAgICByZXR1cm4gaXRlcmF0b3JGb3IoaXRlbXMpXG4gICAgICAgIH1cblxuICAgICAgICBpZiAoc3VwcG9ydC5pdGVyYWJsZSkge1xuICAgICAgICAgIEhlYWRlcnMucHJvdG90eXBlW1N5bWJvbC5pdGVyYXRvcl0gPSBIZWFkZXJzLnByb3RvdHlwZS5lbnRyaWVzXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBjb25zdW1lZChib2R5KSB7XG4gICAgICAgICAgaWYgKGJvZHkuYm9keVVzZWQpIHtcbiAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlamVjdChuZXcgVHlwZUVycm9yKCdBbHJlYWR5IHJlYWQnKSlcbiAgICAgICAgICB9XG4gICAgICAgICAgYm9keS5ib2R5VXNlZCA9IHRydWVcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGZpbGVSZWFkZXJSZWFkeShyZWFkZXIpIHtcbiAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICByZWFkZXIub25sb2FkID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJlc29sdmUocmVhZGVyLnJlc3VsdClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlYWRlci5vbmVycm9yID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJlamVjdChyZWFkZXIuZXJyb3IpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlYWRCbG9iQXNBcnJheUJ1ZmZlcihibG9iKSB7XG4gICAgICAgICAgdmFyIHJlYWRlciA9IG5ldyBGaWxlUmVhZGVyKClcbiAgICAgICAgICB2YXIgcHJvbWlzZSA9IGZpbGVSZWFkZXJSZWFkeShyZWFkZXIpXG4gICAgICAgICAgcmVhZGVyLnJlYWRBc0FycmF5QnVmZmVyKGJsb2IpXG4gICAgICAgICAgcmV0dXJuIHByb21pc2VcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlYWRCbG9iQXNUZXh0KGJsb2IpIHtcbiAgICAgICAgICB2YXIgcmVhZGVyID0gbmV3IEZpbGVSZWFkZXIoKVxuICAgICAgICAgIHZhciBwcm9taXNlID0gZmlsZVJlYWRlclJlYWR5KHJlYWRlcilcbiAgICAgICAgICByZWFkZXIucmVhZEFzVGV4dChibG9iKVxuICAgICAgICAgIHJldHVybiBwcm9taXNlXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiByZWFkQXJyYXlCdWZmZXJBc1RleHQoYnVmKSB7XG4gICAgICAgICAgdmFyIHZpZXcgPSBuZXcgVWludDhBcnJheShidWYpXG4gICAgICAgICAgdmFyIGNoYXJzID0gbmV3IEFycmF5KHZpZXcubGVuZ3RoKVxuXG4gICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB2aWV3Lmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBjaGFyc1tpXSA9IFN0cmluZy5mcm9tQ2hhckNvZGUodmlld1tpXSlcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIGNoYXJzLmpvaW4oJycpXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBidWZmZXJDbG9uZShidWYpIHtcbiAgICAgICAgICBpZiAoYnVmLnNsaWNlKSB7XG4gICAgICAgICAgICByZXR1cm4gYnVmLnNsaWNlKDApXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciB2aWV3ID0gbmV3IFVpbnQ4QXJyYXkoYnVmLmJ5dGVMZW5ndGgpXG4gICAgICAgICAgICB2aWV3LnNldChuZXcgVWludDhBcnJheShidWYpKVxuICAgICAgICAgICAgcmV0dXJuIHZpZXcuYnVmZmVyXG4gICAgICAgICAgfVxuICAgICA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kZXJzLnNldCgnY29udGVudC10eXBlJywgJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZDtjaGFyc2V0PVVURi04JylcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChzdXBwb3J0LmJsb2IpIHtcbiAgICAgICAgICAgIHRoaXMuYmxvYiA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICB2YXIgcmVqZWN0ZWQgPSBjb25zdW1lZCh0aGlzKVxuICAgICAgICAgICAgICBpZiAocmVqZWN0ZWQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0ZWRcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGlmICh0aGlzLl9ib2R5QmxvYikge1xuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keUJsb2IpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShuZXcgQmxvYihbdGhpcy5fYm9keUFycmF5QnVmZmVyXSkpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUZvcm1EYXRhKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdjb3VsZCBub3QgcmVhZCBGb3JtRGF0YSBib2R5IGFzIGJsb2InKVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUobmV3IEJsb2IoW3RoaXMuX2JvZHlUZXh0XSkpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5hcnJheUJ1ZmZlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBpZiAodGhpcy5fYm9keUFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbnN1bWVkKHRoaXMpIHx8IFByb21pc2UucmVzb2x2ZSh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpXG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuYmxvYigpLnRoZW4ocmVhZEJsb2JBc0FycmF5QnVmZmVyKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGhpcy50ZXh0ID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgcmVqZWN0ZWQgPSBjb25zdW1lZCh0aGlzKVxuICAgICAgICAgICAgaWYgKHJlamVjdGVkKSB7XG4gICAgICAgICAgICAgIHJldHVybiByZWplY3RlZFxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy5fYm9keUJsb2IpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHJlYWRCbG9iQXNUZXh0KHRoaXMuX2JvZHlCbG9iKVxuICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShyZWFkQXJyYXlCdWZmZXJBc1RleHQodGhpcy5fYm9keUFycmF5QnVmZmVyKSlcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUZvcm1EYXRhKSB7XG4gICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignY291bGQgbm90IHJlYWQgRm9ybURhdGEgYm9keSBhcyB0ZXh0JylcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keVRleHQpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHN1cHBvcnQuZm9ybURhdGEpIHtcbiAgICAgICAgICAgIHRoaXMuZm9ybURhdGEgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHRoaXMudGV4dCgpLnRoZW4oZGVjb2RlKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHRoaXMuanNvbiA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMudGV4dCgpLnRoZW4oSlNPTi5wYXJzZSlcbiAgICAgICAgICB9XG5cbiAgICAgICAgICByZXR1cm4gdGhpc1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gSFRUUCBtZXRob2RzIHdob3NlIGNhcGl0YWxpemF0aW9uIHNob3VsZCBiZSBub3JtYWxpemVkXG4gICAgICAgIHZhciBtZXRob2RzID0gWydERUxFVEUnLCAnR0VUJywgJ0hFQUQnLCAnT1BUSU9OUycsICdQT1NUJywgJ1BVVCddXG5cbiAgICAgICAgZnVuY3Rpb24gbm9ybWFsaXplTWV0aG9kKG1ldGhvZCkge1xuICAgICAgICAgIHZhciB1cGNhc2VkID0gbWV0aG9kLnRvVXBwZXJDYXNlKClcbiAgICAgICAgICByZXR1cm4gKG1ldGhvZHMuaW5kZXhPZih1cGNhc2VkKSA+IC0xKSA/IHVwY2FzZWQgOiBtZXRob2RcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIFJlcXVlc3QoaW5wdXQsIG9wdGlvbnMpIHtcbiAgICAgICAgICBvcHRpb25zID0gb3B0aW9ucyB8fCB7fVxuICAgICAgICAgIHZhciBib2R5ID0gb3B0aW9ucy5ib2R5XG5cbiAgICAgICAgICBpZiAoaW5wdXQgaW5zdGFuY2VvZiBSZXF1ZXN0KSB7XG4gICAgICAgICAgICBpZiAoaW5wdXQuYm9keVVzZWQpIHtcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignQWxyZWFkeSByZWFkJylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMudXJsID0gaW5wdXQudXJsXG4gICAgICAgICAgICB0aGlzLmNyZWRlbnRpYWxzID0gaW5wdXQuY3JlZGVudGlhbHNcbiAgICAgICAgICAgIGlmICghb3B0aW9ucy5oZWFkZXJzKSB7XG4gICAgICAgICAgICAgIHRoaXMuaGVhZGVycyA9IG5ldyBIZWFkZXJzKGlucHV0LmhlYWRlcnMpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLm1ldGhvZCA9IGlucHV0Lm1ldGhvZFxuICAgICAgICAgICAgdGhpcy5tb2RlID0gaW5wdXQubW9kZVxuICAgICAgICAgICAgaWYgKCFib2R5ICYmIGlucHV0Ll9ib2R5SW5pdCAhPSBudWxsKSB7XG4gICAgICAgICAgICAgIGJvZHkgPSBpbnB1dC5fYm9keUluaXRcbiAgICAgICAgICAgICAgaW5wdXQuYm9keVVzZWQgPSB0cnVlXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMudXJsID0gU3RyaW5nKGlucHV0KVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHRoaXMuY3JlZGVudGlhbHMgPSBvcHRpb25zLmNyZWRlbnRpYWxzIHx8IHRoaXMuY3JlZGVudGlhbHMgfHwgJ29taXQnXG4gICAgICAgICAgaWYgKG9wdGlvbnMuaGVhZGVycyB8fCAhdGhpcy5oZWFkZXJzKSB7XG4gICAgICAgICAgICB0aGlzLmhlYWRlcnMgPSBuZXcgSGVhZGVycyhvcHRpb25zLmhlYWRlcnMpXG4gICAgICAgICAgfVxuICAgICAgICAgIHRoaXMubWV0aG9kID0gbm9ybWFsaXplTWV0aG9kKG9wdGlvbnMubWV0aG9kIHx8IHRoaXMubWV0aG9kIHx8ICdHRVQnKVxuICAgICAgICAgIHRoaXMubW9kZSA9IG9wdGlvbnMubW9kZSB8fCB0aGlzLm1vZGUgfHwgbnVsbFxuICAgICAgICAgIHRoaXMucmVmZXJyZXIgPSBudWxsXG5cbiAgICAgICAgICBpZiAoKHRoaXMubWV0aG9kID09PSAnR0VUJyB8fCB0aGlzLm1ldGhvZCA9PT0gJ0hFQUQnKSAmJiBib2R5KSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdCb2R5IG5vdCBhbGxvd2VkIGZvciBHRVQgb3IgSEVBRCByZXF1ZXN0cycpXG4gICAgICAgICAgfVxuICAgICAgICAgIHRoaXMuX2luaXRCb2R5KGJvZHkpXG4gICAgICAgIH1cblxuICAgICAgICBSZXF1ZXN0LnByb3RvdHlwZS5jbG9uZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiBuZXcgUmVxdWVzdCh0aGlzLCB7IGJvZHk6IHRoaXMuX2JvZHlJbml0IH0pXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBkZWNvZGUoYm9keSkge1xuICAgICAgICAgIHZhciBmb3JtID0gbmV3IEZvcm1EYXRhKClcbiAgICAgICAgICBib2R5LnRyaW0oKS5zcGxpdCgnJicpLmZvckVhY2goZnVuY3Rpb24oYnl0ZXMpIHtcbiAgICAgICAgICAgIGlmIChieXRlcykge1xuICAgICAgICAgICAgICB2YXIgc3BsaXQgPSBieXRlcy5zcGxpdCgnPScpXG4gICAgICAgICAgICAgIHZhciBuYW1lID0gc3BsaXQuc2hpZnQoKS5yZXBsYWNlKC9cXCsvZywgJyAnKVxuICAgICAgICAgICAgICB2YXIgdmFsdWUgPSBzcGxpdC5qb2luKCc9JykucmVwbGFjZSgvXFwrL2csICcgJylcbiAgICAgICAgICAgICAgZm9ybS5hcHBlbmQoZGVjb2RlVVJJQ29tcG9uZW50KG5hbWUpLCBkZWNvZGVVUklDb21wb25lbnQodmFsdWUpKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmV0dXJuIGZvcm1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHBhcnNlSGVhZGVycyhyYXdIZWFkZXJzKSB7XG4gICAgICAgICAgdmFyIGhlYWRlcnMgPSBuZXcgSGVhZGVycygpXG4gICAgICAgICAgcmF3SGVhZGVycy5zcGxpdCgvXFxyP1xcbi8pLmZvckVhY2goZnVuY3Rpb24obGluZSkge1xuICAgICAgICAgICAgdmFyIHBhcnRzID0gbGluZS5zcGxpdCgnOicpXG4gICAgICAgICAgICB2YXIga2V5ID0gcGFydHMuc2hpZnQoKS50cmltKClcbiAgICAgICAgICAgIGlmIChrZXkpIHtcbiAgICAgICAgICAgICAgdmFyIHZhbHVlID0gcGFydHMuam9pbignOicpLnRyaW0oKVxuICAgICAgICAgICAgICBoZWFkZXJzLmFwcGVuZChrZXksIHZhbHVlKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmV0dXJuIGhlYWRlcnNcbiAgICAgICAgfVxuXG4gICAgICAgIEJvZHkuY2FsbChSZXF1ZXN0LnByb3RvdHlwZSlcblxuICAgICAgICBmdW5jdGlvbiBSZXNwb25zZShib2R5SW5pdCwgb3B0aW9ucykge1xuICAgICAgICAgIGlmICghb3B0aW9ucykge1xuICAgICAgICAgICAgb3B0aW9ucyA9IHt9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGhpcy50eXBlID0gJ2RlZmF1bHQnXG4gICAgICAgICAgdGhpcy5zdGF0dXMgPSAnc3RhdHVzJyBpbiBvcHRpb25zID8gb3B0aW9ucy5zdGF0dXMgOiAyMDBcbiAgICAgICAgICB0aGlzLm9rID0gdGhpcy5zdGF0dXMgPj0gMjAwICYmIHRoaXMuc3RhdHVzIDwgMzAwXG4gICAgICAgICAgdGhpcy5zdGF0dXNUZXh0ID0gJ3N0YXR1c1RleHQnIGluIG9wdGlvbnMgPyBvcHRpb25zLnN0YXR1c1RleHQgOiAnT0snXG4gICAgICAgICAgdGhpcy5oZWFkZXJzID0gbmV3IEhlYWRlcnMob3B0aW9ucy5oZWFkZXJzKVxuICAgICAgICAgIHRoaXMudXJsID0gb3B0aW9ucy51cmwgfHwgJ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gIH1cblxuICAgICAgICAgICAgeGhyLm9uZXJyb3IgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmVqZWN0KG5ldyBUeXBlRXJyb3IoJ05ldHdvcmsgcmVxdWVzdCBmYWlsZWQnKSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgeGhyLm9udGltZW91dCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICByZWplY3QobmV3IFR5cGVFcnJvcignTmV0d29yayByZXF1ZXN0IGZhaWxlZCcpKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB4aHIub3BlbihyZXF1ZXN0Lm1ldGhvZCwgcmVxdWVzdC51cmwsIHRydWUpXG5cbiAgICAgICAgICAgIGlmIChyZXF1ZXN0LmNyZWRlbnRpYWxzID09PSAnaW5jbHVkZScpIHtcbiAgICAgICAgICAgICAgeGhyLndpdGhDcmVkZW50aWFscyA9IHRydWVcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCdyZXNwb25zZVR5cGUnIGluIHhociAmJiBzdXBwb3J0LmJsb2IpIHtcbiAgICAgICAgICAgICAgeGhyLnJlc3BvbnNlVHlwZSA9ICdibG9iJ1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXF1ZXN0LmhlYWRlcnMuZm9yRWFjaChmdW5jdGlvbih2YWx1ZSwgbmFtZSkge1xuICAgICAgICAgICAgICB4aHIuc2V0UmVxdWVzdEhlYWRlcihuYW1lLCB2YWx1ZSlcbiAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgIHhoci5zZW5kKHR5cGVvZiByZXF1ZXN0Ll9ib2R5SW5pdCA9PT0gJ3VuZGVmaW5lZCcgPyBudWxsIDogcmVxdWVzdC5fYm9keUluaXQpXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuICAgICAgICBzZWxmLmZldGNoLnBvbHlmaWxsID0gdHJ1ZVxuICAgICAgfSkodHlwZW9mIHNlbGYgIT09ICd1bmRlZmluZ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2hhaW4sIHZhbCwgb3B0aW9ucykge1xuICAgIHZhciBsZWFmID0gdmFsO1xuXG4gICAgZm9yICh2YXIgaSA9IGNoYWluLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBvYmo7XG4gICAgICAgIHZhciByb290ID0gY2hhaW5baV07XG5cbiAgICAgICAgaWYgKHJvb3QgPT09ICdbXScpIHtcbiAgICAgICAgICAgIG9iaiA9IFtdO1xuICAgICAgICAgICAgb2JqID0gb2JqLmNvbmNhdChsZWFmKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9iaiA9IG9wdGlvbnMucGxhaW5PYmplY3RzID8gT2JqZWN0LmNyZWF0ZShudWxsKSA6IHt9O1xuICAgICAgICAgICAgdmFyIGNsZWFuUm9vdCA9IHJvb3QuY2hhckF0KDApID09PSAnWycgJiYgcm9vdC5jaGFyQXQocm9vdC5sZW5ndGggLSAxKSA9PT0gJ10nID8gcm9vdC5zbGljZSgxLCAtMSkgOiByb290O1xuICAgICAgICAgICAgdmFyIGluZGV4ID0gcGFyc2VJbnQoY2xlYW5Sb290LCAxMCk7XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgIWlzTmFOKGluZGV4KVxuICAgICAgICAgICAgICAgICYmIHJvb3QgIT09IGNsZWFuUm9vdFxuICAgICAgICAgICAgICAgICYmIFN0cmluZyhpbmRleCkgPT09IGNsZWFuUm9vdFxuICAgICAgICAgICAgICAgICYmIGluZGV4ID49IDBcbiAgICAgICAgICAgICAgICAmJiAob3B0aW9ucy5wYXJzZUFycmF5cyAmJiBpbmRleCA8PSBvcHRpb25zLmFycmF5TGltaXQpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBvYmogPSBbXTtcbiAgICAgICAgICAgICAgICBvYmpbaW5kZXhdID0gbGVhZjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgb2JqW2NsZWFuUm9vdF0gPS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uICAgICAgICBvYmpLZXlzID0gZmlsdGVyO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHZhciBrZXlzID0gT2JqZWN0LmtleXMob2JqKTtcbiAgICAgICAgb2JqS2V5cyA9IHNvcnQgPyBrZXlzLnNvcnQoc29ydCkgOiBrZXlzO1xuICAgIH1cblxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb2JqS2V5cy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIga2V5ID0gb2JqS2V5c1tpXTtcblxuICAgICAgICBpZiAoc2tpcE51bGxzICYmIG9ialtrZXldID09PSBudWxsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9iaikpIHtcbiAgICAgICAgICAgIHZhbHVlcyA9IHZhbHVlcy5jb25jYXQoc3RyaW5naWZ5KFxuICAgICAgICAgICAgICAgIG9ialtrZXldLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgocHJlZml4LCBrZXkpLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICAgICAgc3RyaWN0TnVsbEhhbmRsaW5nLFxuICAgICAgICAgICAgICAgIHNraXBOdWxscyxcbiAgICAgICAgICAgICAgICBlbmNvZGVyLFxuICAgICAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgICAgICBzb3J0LFxuICAgICAgICAgICAgICAgIGFsbG93RG90cyxcbiAgICAgICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgICAgIGZvcm1hdHRlcixcbiAgICAgICAgICAgICAgICBlbmNvZGVWYWx1ZXNPbmx5XG4gICAgICAgICAgICApKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhbHVlcyA9IHZhbHVlcy5jb25jYXQoc3RyaW5naWZ5KFxuICAgICAgICAgICAgICAgIG9ialtrZXldLFxuICAgICAgICAgICAgICAgIHByZWZpeCArIChhbGxvd0RvdHMgPyAnLicgKyBrZXkgOiAnWycgKyBrZXkgKyAnXScpLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICAgICAgc3RyaWN0TnVsbEhhbmRsaW5nLFxuICAgICAgICAgICAgICAgIHNraXBOdWxscyxcbiAgICAgICAgICAgICAgICBlbmNvZGVyLFxuICAgICAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgICAgICBzb3J0LFxuICAgICAgICAgICAgICAgIGFsbG93RG90cyxcbiAgICAgICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgICAgIGZvcm1hdHRlcixcbiAgICAgICAgICAgICAgICBlbmNvZGVWYWx1ZXNPbmx5XG4gICAgICAgICAgICApKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiB2YWx1ZXM7XG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChvYmplY3QsIG9wdHMpIHtcbiAgICB2YXIgb2JqID0gb2JqZWN0O1xuICAgIHZhciBvcHRpb25zID0gb3B0cyA/IHV0aWxzLmFzc2lnbih7fSwgb3B0cykgOiB7fTtcblxuICAgIGlmIChvcHRpb25zLmVuY29kZXIgIT09IG51bGwgJiYgb3B0aW9ucy5lbmNvZGVyICE9PSB1bmRlZmluZWQgJiYgdHlwZW9mIG9wdGlvbnMuZW5jb2RlciAhPT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdFbmNvZGVyIGhhcyB0byBiZSBhIGZ1bmN0aW9uLicpO1xuICAgIH1cblxuICAgIHZhciBkZWxpbWl0ZXIgPSB0eXBlb2Ygb3B0aW9ucy5kZWxpbWl0ZXIgPT09ICd1bmRlZmluZWQnID8gZGVmYXVsdHMuZGVsaW1pdGVyIDogb3B0aW9ucy5kZWxpbWl0ZXI7XG4gICAgdmFyIHN0c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zLmFycmF5Rm9ybWF0O1xuICAgIH0gZWxzZSBpZiAoJ2luZGljZXMnIGluIG9wdGlvbnMpIHtcbiAgICAgICAgYXJyYXlGb3JtYXQgPSBvcHRpb25zLmluZGljZXMgPyAnaW5kaWNlcycgOiAncmVwZWF0JztcbiAgICB9IGVsc2Uge1xuICAgICAgICBhcnJheUZvcm1hdCA9ICdpbmRpY2VzJztcbiAgICB9XG5cbiAgICB2YXIgZ2VuZXJhdGVBcnJheVByZWZpeCA9IGFycmF5UHJlZml4R2VuZXJhdG9yc1thcnJheUZvcm1hdF07XG5cbiAgICBpZiAoIW9iaktleXMpIHtcbiAgICAgICAgb2JqS2V5cyA9IE9iamVjdC5rZXlzKG9iaik7XG4gICAgfVxuXG4gICAgaWYgKHNvcnQpIHtcbiAgICAgICAgb2JqS2V5cy5zb3J0KHNvcnQpO1xuICAgIH1cblxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb2JqS2V5cy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIga2V5ID0gb2JqS2V5c1tpXTtcblxuICAgICAgICBpZiAoc2tpcE51bGxzICYmIG9ialtrZXldID09PSBudWxsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGtleXMgPSBrZXlzLmNvbmNhdChzdHJpbmdpZnkoXG4gICAgICAgICAgICBvYmpba2V5XSxcbiAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICBzdHJpY3ROdWxsSGFuZGxpbmcsXG4gICAgICAgICAgICBza2lwTnVsbHMsXG4gICAgICAgICAgICBlbmNvZGUgPyBlbmNvZGVyIDogbnVsbCxcbiAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgIHNvcnQsXG4gICAgICAgICAgICBhbGxvd0RvdHMsXG4gICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgZm9ybWF0dGVyLFxuICAgICAgICAgICAgZW5jb2RlVmFsdWVzT25seVxuICAgICAgICApKTtcbiAgICB9XG5cbiAgICB2YXIgam9pbmVkID0ga2V5cy5qb2luKGRlbGltaXRlcik7XG4gICAgdmFyIHByZWZpeCA9IG9wdGlvbnMuYWRkUXVlcnlQcmVmaXggPT09IHRydWUgPyAnPycgOiAnJztcblxuICAgIHJldHVybiBqb2luZWQubGVuZ3RoID4gMCA/IHByZWZpeCArIGpvaW5lZCA6ICcnO1xufTtcbiIsIid1c2Ugc3RyaWN0JztcblxudmFyIGhhcyA9IE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHk7XG5cbnZhciBoZXhUYWJsZSA9IChmdW5jdGlvbiAoKSB7XG4gICAgdmFyIGFycmF5ID0gW107XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCAyNTY7ICsraSkge1xuICAgICAgICBhcnJheS5wdXNoKCclJyArICgoaSA8IDE2ID8gJzAnIDogJycpICsgaS50b1N0cmluZygxNikpLnRvVXBwZXJDYXNlKCkpO1xuICAgIH1cblxuICAgIHJldHVybiBhcnJheTtcbn0oKSk7XG5cbnZhciBjb21wYWN0UXVldWUgPSBmdW5jdGlvbiBjb21wYWN0UXVldWUocXVldWUpIHtcbiAgICB2YXIgb2JqO1xuXG4gICAgd2hpbGUgKHF1ZXVlLmxlbmd0aCkge1xuICAgICAgICB2YXIgaXRlbSA9IHF1ZXVlLnBvcCgpO1xuICAgICAgICBvYmogPSBpdGVtLm9ialtpdGVtLnByb3BdO1xuXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9iaikpIHtcbiAgICAgICAgICAgIHZhciBjb21wYWN0ZWQgPSBbXTtcblxuICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBvYmoubGVuZ3RoOyArK2opIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9ialtqXSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgY29tcGFjdG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GUgaW8uanMgY29yZSBxdWVyeXN0cmluZyBsaWJyYXJ5LlxuICAgIC8vIEl0IGhhcyBiZWVuIGFkYXB0ZWQgaGVyZSBmb3Igc3RyaWN0ZXIgYWRoZXJlbmNlIHRvIFJGQyAzOTg2XG4gICAgaWYgKHN0ci5sZW5ndGggPT09IDApIHtcbiAgICAgICAgcmV0dXJuIHN0cjtcbiAgICB9XG5cbiAgICB2YXIgc3RyaW5nID0gdHlwZW9mIHN0ciA9PT0gJ3N0cmluZycgPyBzdHIgOiBTdHJpbmcoc3RyKTtcblxuICAgIHZhciBvdXQgPSAnJztcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0cmluZy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIgYyA9IHN0cmluZy5jaGFyQ29kZUF0KGkpO1xuXG4gICAgICAgIGlmIChcbiAgICAgICAgICAgIGMgPT09IDB4MkQgLy8gLVxuICAgICAgICAgICAgfHwgYyA9PT0gMHgyRSAvLyAuXG4gICAgICAgICAgICB8fCBjID09PSAweDVGIC8vIF9cbiAgICAgICAgICAgIHx8IGMgPT09IDB4N0UgLy8gflxuICAgICAgICAgICAgfHwgKGMgPj0gMHgzMCAmJiBjIDw9IDB4MzkpIC8vIDAtOVxuICAgICAgICAgICAgfHwgKGMgPj0gMHg0MSAmJiBjIDw9IDB4NUEpIC8vIGEtelxuICAgICAgICAgICAgfHwgKGMgPj0gMHg2MSAmJiBjIDw9IDB4N0EpIC8vIEEtWlxuICAgICAgICApIHtcbiAgICAgICAgICAgIG91dCArPSBzdHJpbmcuY2hhckF0KGkpO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4ODApIHtcbiAgICAgICAgICAgIG91dCA9IG91dCArIGhleFRhYmxlW2NdO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4ODAwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyAoaGV4VGFibGVbMHhDMCB8IChjID4+IDYpXSArIGhleFRhYmxlWzB4ODAgfCAoYyAmIDB4M0YpXSk7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjIDwgMHhEODAwIHx8IGMgPj0gMHhFMDAwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyAoaGV4VGFibGVbMHhFMCB8IChjID4+IDEyKV0gKyBoZXhUYWJsZVsweDgwIHwgKChjID4+IDYpICYgMHgzRildICsgaGV4VGFibGVbMHg4MCB8IChjICYgMHgzRildKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaSArPSAxO1xuICAgICAgICBjID0gMHgxMDAwMCArICgoKGMgJiAweDNGRikgPDwgMTApIHwgKHN0cmluZy5jaGFyQ29kZUF0KGkpICYgMHgzRkYpKTtcbiAgICAgICAgb3V0ICs9IGhleFRhYmxlWzB4RjAgfCAoYyA+PiAxOCldXG4gICAgICAgICAgICArIGhleFRhYmxlWzB4ODAgfCAoKGMgPj4gMTIpICYgMHgzRildXG4gICAgICAgICAgICArIGhleFRhYmxlWzB4ODAgfCAoKGMgPj4gNikgJiAweDNGKV1cbiAgICAgICAgICAgICsgaGV4VGFibGVbMHg4MCB8IChjICYgMHgzRildO1xuICAgIH1cblxuICAgIHJldHVybiBvdXQ7XG59O1xuXG5leHBvcnRzLmNvbXBhY3QgPSBmdW5jdGlvbiBjb21wYWN0KHZhbHVlKSB7XG4gICAgdmFyIHF1ZXVlID0gW3sgb2JqOiB7IG86IHZhbHVlIH0sIHByb3A6ICdvJyB9XTtcbiAgICB2YXIgcmVmcyA9IFtdO1xuXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBxdWV1ZS5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIgaXRlbSA9IHF1ZXVlW2ldO1xuICAgICAgICB2YXIgb2JqID0gaXRlbS5vYmpbaXRlbS5wcm9wXTtcblxuICAgICAgICB2YXIga2V5cyA9IE9iamVjdC5rZXlzKG9iaik7XG4gICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwga2V5cy5sZW5ndGg7ICsraikge1xuICAgICAgICAgICAgdmFyIGtleSA9IGtleXNbal07XG4gICAgICAgICAgICB2YXIgdmFsID0gb2JqW2tleV07XG4gICAgICAgICAgICBpZiAodHlwZW9mIHZhbCA9PT0gJ29iamVjdCcgJiYgdmFsICE9PSBudWxsICYmIHJlZnMuaW5kZXhPZih2YWwpID09PSAtMSkge1xuICAgICAgICAgICAgICAgIHF1ZXVlLnB1c2goeyBvYmo6IG9iaiwgcHJvcDoga2V5IH0pO1xuICAgICAgICAgICAgICAgIHJlZnMucHVzaCh2YWwpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGNvbXBhY3RRdWV1ZShxdWV1ZSk7XG59O1xuXG5leHBvcnRzLmlzUmVnRXhwID0gZnVuY3Rpb24gaXNSZWdFeHAob2JqKSB7XG4gICAgcmV0dXJuIE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChvYmopID09PSAnW29iamVjdCBSZWdFeHBdJztcbn07XG5cbmV4cG9ydHMuaXNCdWZmZXIgPSBmdW5jdGlvbiBpc0J1ZmZlcihvYmopIHtcbiAgICBpZiAob2JqID09PSBudWxsIHx8IHR5cGVvZiBvYmogPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG5cbiAgICByZXR1cm4gISEob2JqLmNvbnN0cnVjdG9yICYmIG9iai5jb25zdHJ1Y3Rvci5pc0J1ZmZlciAmJiBvYmouY29uc3RydWN0b3IuaXNCdWZmZXIob2JqKSk7XG59O1xuIl19 diff --git a/ccxt.js b/ccxt.js index 833efaefe73d..b3a75205012a 100644 --- a/ccxt.js +++ b/ccxt.js @@ -37,7 +37,7 @@ const Exchange = require ('./js/base/Exchange') //----------------------------------------------------------------------------- // this is updated by vss.js when building -const version = '1.13.143' +const version = '1.13.144' Exchange.ccxtVersion = version diff --git a/doc/manual.rst b/doc/manual.rst index 120b298d2417..1cb5ad3447f4 100644 --- a/doc/manual.rst +++ b/doc/manual.rst @@ -2816,7 +2816,7 @@ For example, if you want to print recent trades for all symbols one by one seque var_dump ($exchange->fetch_trades ($symbol)); } -The fetchTrades method shown above returns an ordered list of trades (a flat array, sorted by timestamp in ascending order, most recent trade last) represented by the following structure: +The fetchTrades method shown above returns an ordered list of trades (a flat array, sorted by timestamp in ascending order, oldest trade first, most recent trade last). A list of trades is represented by the following structure: .. code:: javascript @@ -2840,6 +2840,8 @@ Most exchanges return most of the above fields for each trade, though there are The second optional argument ``since`` reduces the array by timestamp, the third ``limit`` argument reduces by number (count) of returned items. +If the user does not specify ``since``, the ``fetchTrades`` method will return the default range of public trades from the exchange. The default set is exchange-specific, some exchanges will return trades starting from the date of listing a pair on the exchange, other exchanges will return a reduced set of trades (like, last 24 hours, last 100 trades, etc). If the user wants precise control over the timeframe, the user is responsible for specifying the ``since`` argument. + The ``fetchTrades ()`` / ``fetch_trades()`` method also accepts an optional ``params`` (assoc-key array/dict, empty by default) as its fourth argument. You can use it to pass extra params to method calls or to override a particular default value (where supported by the exchange). See the API docs for your exchange for more details. :: @@ -3176,6 +3178,21 @@ Below are examples of using the fetchOrder method to get order info from an auth var_dump ($order); } +Querying Multiple Orders +^^^^^^^^^^^^^^^^^^^^^^^^ + +All methods returning lists of trades and lists of orders, accept the second ``since`` argument and the third ``limit`` argument: + +- ``fetchTrades`` (public) +- ``fetchMyTrades`` (private) +- ``fetchOrders`` +- ``fetchOpenOrders`` +- ``fetchClosedOrders`` + +The second argument ``since`` reduces the array by timestamp, the third ``limit`` argument reduces by number (count) of returned items. + +If the user does not specify ``since``, the ``fetchTrades/fetchOrders`` method will return the default set from the exchange. The default set is exchange-specific, some exchanges will return trades or recent orders starting from the date of listing a pair on the exchange, other exchanges will return a reduced set of trades or orders (like, last 24 hours, last 100 trades, first 100 orders, etc). If the user wants precise control over the timeframe, the user is responsible for specifying the ``since`` argument. + All Orders ^^^^^^^^^^ diff --git a/package.json b/package.json index 7a31ed35c9c0..01486f48094d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ccxt", - "version": "1.13.143", + "version": "1.13.144", "description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 100+ exchanges", "main": "./ccxt.js", "unpkg": "build/ccxt.browser.js", diff --git a/php/Exchange.php b/php/Exchange.php index 67470415f963..2cf246a716b2 100644 --- a/php/Exchange.php +++ b/php/Exchange.php @@ -30,7 +30,7 @@ namespace ccxt; -$version = '1.13.143'; +$version = '1.13.144'; // rounding mode const TRUNCATE = 0; diff --git a/python/ccxt/__init__.py b/python/ccxt/__init__.py index 1d607b75c19a..071c226e0b6b 100644 --- a/python/ccxt/__init__.py +++ b/python/ccxt/__init__.py @@ -22,7 +22,7 @@ # ---------------------------------------------------------------------------- -__version__ = '1.13.143' +__version__ = '1.13.144' # ---------------------------------------------------------------------------- diff --git a/python/ccxt/async/__init__.py b/python/ccxt/async/__init__.py index 3910ee4d2417..f1b368b854cf 100644 --- a/python/ccxt/async/__init__.py +++ b/python/ccxt/async/__init__.py @@ -4,7 +4,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.13.143' +__version__ = '1.13.144' # ----------------------------------------------------------------------------- diff --git a/python/ccxt/async/base/exchange.py b/python/ccxt/async/base/exchange.py index 94fb3346dbd8..7c5de189b213 100644 --- a/python/ccxt/async/base/exchange.py +++ b/python/ccxt/async/base/exchange.py @@ -2,7 +2,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.13.143' +__version__ = '1.13.144' # ----------------------------------------------------------------------------- diff --git a/python/ccxt/base/exchange.py b/python/ccxt/base/exchange.py index 1845d85cb117..ad4c36117d33 100644 --- a/python/ccxt/base/exchange.py +++ b/python/ccxt/base/exchange.py @@ -4,7 +4,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.13.143' +__version__ = '1.13.144' # -----------------------------------------------------------------------------