Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@青豆@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6ImpzOlxuZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXCJoaWtlcjovL3BhZ2UvbWFpblwiKSkucnVsZSk7XG5sZXQgdHlwZSA9IGdldFBhcmFtKCd0eXBlJywgJycpLFxuICAgIGlkID0gZ2V0UGFyYW0oJ2lkJywgJycpLFxuICAgIHRpdGxlID0gZ2V0UGFyYW0oJ3RpdGxlJywgJycpO1xubGV0IHJlcyA9IGdldERvdWJhblJlcyhcImh0dHBzOi8vZnJvZG8uZG91YmFuLmNvbS9hcGkvdjIvXCIgKyB0eXBlICsgXCIvXCIgKyBpZCk7XG5sZXQgdXBkYXRlID0gXCJcIjtcbmlmICh0aXRsZSA9PSAnJykge1xuICAgIGxldCBsZW5ndGggPSByZXMudmVuZG9ycy5sZW5ndGg7XG4gICAgdXBkYXRlICs9IGxlbmd0aCA+IDAgPyAn5YWxJyArIGxlbmd0aCArICfkuKrniYfmupAnIDogJ+aaguaXoOeJh+a6kCc7XG4gICAgaWYgKGxlbmd0aCA+IDApIHtcbiAgICAgICAgbGV0IGUgPSByZXMudmVuZG9yc1swXTtcbiAgICAgICAgdXBkYXRlICs9IGUuZXBpc29kZXNfaW5mbyA/IFwifFwiICsgZS5lcGlzb2Rlc19pbmZvIDogXCJcIjtcbiAgICB9XG59IGVsc2Uge1xuICAgIGZvciAobGV0IGUgb2YgcmVzLnZlbmRvcnMpIHtcbiAgICAgICAgaWYgKGUudGl0bGUgPT0gdGl0bGUpIHtcbiAgICAgICAgICAgIHVwZGF0ZSArPSBlLmVwaXNvZGVzX2luZm8gPyBlLmVwaXNvZGVzX2luZm8gOiBcIlwiO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICB9XG59XG5zZXRSZXN1bHQodXBkYXRlKTsiLCJ0aXRsZSI6Iumdk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FxuICAgICAgICB9XFxuICAgIH0sIHBhcmFtcykpXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuS/neWtmFxcXCIsXFxuICAgICAgICBkZXNjOiBwYXJhbXMuZGVzYyxcXG4gICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICB0aXRsZVZpc2libGU6IGZhbHNlLFxcbiAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIocGFyYW1zLmtleSwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgIHR5cGU6IHBhcmFtcy50eXBlID8gcGFyYW1zLnR5cGUgOiAnJyxcXG4gICAgICAgICAgICBvbkNoYW5nZTogJ3B1dE15VmFyKFxcXCInICsgcGFyYW1zLmtleSArICdcXFwiLCBpbnB1dCknXFxuICAgICAgICB9XFxuICAgIH0pXFxuICAgIGxldCBkYXRhcyA9IHBhcmFtcy5kYXRhO1xcbiAgICBsZXQgZGF0YUtleXMgPSBPYmplY3Qua2V5cyhkYXRhcyk7XFxuICAgIGZvciAobGV0IGRhdGFLZXkgb2YgZGF0YUtleXMpIHtcXG4gICAgICAgIGxldCBkYXRhID0gZGF0YXNbZGF0YUtleV1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLkv53lrZhcXFwiLFxcbiAgICAgICAgICAgIGRlc2M6IGRhdGEuZGVzYyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICB0aXRsZVZpc2libGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKGRhdGEua2V5LCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgIHR5cGU6IGRhdGEudHlwZSA/IGRhdGEudHlwZSA6ICcnLFxcbiAgICAgICAgICAgICAgICBoZWlnaHQ6IDUsXFxuICAgICAgICAgICAgICAgIGhpZ2hsaWdodDogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgb25DaGFuZ2U6ICdwdXRNeVZhcihcXFwiJyArIGRhdGEua2V5ICsgJ1xcXCIsIGlucHV0KSdcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+S/neWtmCcsXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoY29uZmlnS2V5LCBwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKVxcbiAgICAgICAgICAgIGxldCBuYW1lID0gZ2V0TXlWYXIocGFyYW1zLmtleSwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgIGlmKG5hbWUgPT0gJ+m7mOiupCcpIHJldHVybiAndG9hc3Q6Ly/pu5jorqTphY3nva7ml6Dms5XnvJbovpEnXFxuICAgICAgICAgICAgY29uZmlnW2NvbmZpZ0tleV0udXNlID0gbmFtZVxcbiAgICAgICAgICAgIGlmICghY29uZmlnW2NvbmZpZ0tleV1bbmFtZV0pIGNvbmZpZ1tjb25maWdLZXldW25hbWVdID0ge31cXG4gICAgICAgICAgICBsZXQgZGF0YXMgPSBwYXJhbXMuZGF0YTtcXG4gICAgICAgICAgICBsZXQgZGF0YUtleXMgPSBPYmplY3Qua2V5cyhkYXRhcyk7XFxuICAgICAgICAgICAgZm9yIChsZXQgaSBpbiBkYXRhS2V5cykge1xcbiAgICAgICAgICAgICAgICBsZXQgZGF0YUtleSA9IGRhdGFLZXlzW2ldXFxuICAgICAgICAgICAgICAgIGxldCBkYXRhID0gZGF0YXNbZGF0YUtleV1cXG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S7o+eggVxcXCIsXFxuICAgICAgICAgICAgICAgIHR5cGU6ICd0ZXh0YXJlYSdcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIHNldHRpbmc6IHtcXG4gICAgICAgICAgICAgICAga2V5OiBcXFwiaW5wdXRfc2V0dGluZ19jb2RlXFxcIixcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpeiuvue9rumhtemdouS7o+eggVxcXCIsXFxuICAgICAgICAgICAgICAgIHR5cGU6ICd0ZXh0YXJlYSdcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0pXFxufVxcblxcbi8v6Ieq5a6a5LmJ6Kej5p6QLee8lui+kemhtemdolxcbmZ1bmN0aW9uIGFuYWx5c2lzTW9kZUVkaXRQYWdlKGQpIHtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAnPGZvbnQgY29sb3I9XFxcIiM4MDgwODBcXFwiPicgKyAn44CQ6Kej5p6Q5Luj56CB5YaF572u5Y+Y6YeP44CRJyArICc8YnI+Jm5ic3A7Jm5ic3A7Jm5ic3A7aW5wdXQ6IOinhumikemTvuaOpScgKyAnPC9mb250PicsXFxuICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCdcXG4gICAgfSlcXG4gICAgbW9kZUVkaXRQYWdlKGQsIFxcXCJhbmFseXNpc0NvbmZpZ3NcXFwiLCB7XFxuICAgICAgICBrZXk6IFxcXCJpbnB1dF9uYW1lXFxcIixcXG4gICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXlkI3np7BcXFwiLFxcbiAgICAgICAgLy8gdHlwZTogJ2lucHV0J1xcbiAgICAgICAgZGF0YToge1xcbiAgICAgICAgICAgIGNvbmZpZzoge1xcbiAgICAgICAgICAgICAgICBrZXk6IFxcXCJpbnB1dF9jb2RlXFxcIixcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpeino+aekOS7o+eggVxcXCIsXFxuICAgICAg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lmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PSBcXFwiY29sbGVjdGlvblxcXCIgfHwgdHlwZSA9PSBcXFwiY2hhcnRcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJqZWN0Q29sbGVjdGlvbkxpc3QoTVlfUEFHRSwgNTAsIGlkKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGUudGFyZ2V0X3R5cGUsIGUuaWQpLFxcclxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBlLmNvdmVyX3VybCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZS5jb3Zlcl91cmxcXHJcXG4gICAgICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfSBlbHNlIGlmIChkYXRhLnRhcmdldF90eXBlID09ICdjaGFydCcpIHtcXHJcXG4gICAgICAgICAgICBsZXQgZSA9IGRhdGEudGFyZ2V0O1xcclxcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogZS50aXRsZSxcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5LyRwYWdle2Z5cGFnZX0jbm9IaXN0b3J5IycpXFxyXFxuICAgICAgICAgICAgICAgICAgICAucnVsZSgodHlwZSwgaWQpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGUgPT09IFxcXCJwbGF5bGlzdFxcXCIpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PSBcXFwiY29sbGVjdGlvblxcXCIgfHwgdHlwZSA9PSBcXFwiY2hhcnRcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YmplY3RDb2xsZWN0aW9uTGlzdChNWV9QQUdFLCA1MCwgaWQpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgICAgIH0sIGRhdGEudGFyZ2V0X3R5cGUsIGUuaWQpLFxcclxcbiAgICAgICAgICAgICAgICBpbWc6IGUuY292ZXJfdXJsICsgXFxcIkBSZWZlcmVyPVxcXCIgKyBlLmNvdmVyX3VybFxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgIGxldCB0eXBlID0gZGF0YS50YXJnZXRfdHlwZSxcXHJcXG4gICAgICAgICAgICAgICAgaWQgPSBkYXRhLnRhcmdldC5pZCxcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGUgPSBkYXRhLnRhcmdldC50aXRsZSxcXG4gICAgICAgICAgICAgICAgeWVhciA9IGRhdGEudGFyZ2V0LnllYXI7XFxyXFxuICAgICAgICAgICAgbGV0IHVzZUNvbmZpZyA9IGRldGFpbHNWaWV3Q29uZmlnc1tkZXRhaWxzVmlld0NvbmZpZ3MudXNlXS5jb25maWc7XFxyXFxuICAgICAgICAgICAgbGV0IHVybFBhcmFtcyA9IHt9O1xcclxcbiAgICAgICAgICAgIGlmICh1c2VDb25maWcuc3RhcnRzV2l0aCgneycpKSB7XFxyXFxuICAgICAgICAgICAgICAgIGV2YWwoJ3VybFBhcmFtcyA9ICcgKyB1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcIiArICc/dHlwZT0nICsgdHlwZSArICcmaWQ9JyArIGlkKVxcclxcbiAgICAgICAgICAgICAgICAgICAgLnJ1bGUoKHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvdUxpc3QoaWQsIE1ZX1BBR0UsIDUwKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlICsgKHllYXIgPyAnKCcreWVhcisnKScgOiAnJyksXFxyXFxuICAgICAgICAgICAgICAgIGltZzogZGF0YS50YXJnZXQuY292ZXJfdXJsICsgXFxcIkBSZWZlcmVyPVxcXCIgKyBkYXRhLnRhcmdldC5jb3Zlcl91cmwsXFxyXFxuICAgICAgICAgICAgICAgIGRlc2M6IGRhdGEudHlwZV9uYW1lLFxcclxcbiAgICAgICAgICAgICAgICBjb250ZW50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gICAgICAgIHIyICs9IChlLmNlcmVtb255LnRpdGxlICsgJygnICsgZS5jZXJlbW9ueS55ZWFyICsgJyknKS5iaWcoKS5ib2xkKCkgKyAnPHNtYWxsPig8YSBocmVmPVxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSNAcnVsZT1qczpldmFsKEpTT04ucGFyc2UoZmV0Y2goYGhpa2VyOi8vcGFnZS9tYWluYCkpLnJ1bGUpO2F3YXJkVmlldyhgJyArIGUuY2VyZW1vbnkuaWQgKyAnYCxgJyArIGUuY2VyZW1vbnkudGl0bGUgKyAnYCk7XFxcIj7mn6XnnIvor6bmg4U8L2E+KTwvc21hbGw+JyArICc8YnIvPic7XFxyXFxuICAgICAgICBlLmNhdGVnb3JpZXMuZm9yRWFjaChpdGVtID0+IHtcXHJcXG4gICAgICAgICAgICByMiArPSAoaXRlbS5jYXRlZ29yeS50aXRsZSArIChpdGVtLmlzX3dvbiA/ICcnIDogJyjmj5DlkI0pJykgKyAnJm5ic3A7JykuZm9udGNvbG9yKFxcXCJncmV5XFxcIik7XFxyXFxuICAgICAgICAgICAgcjIgKz0gaXRlbS5jZWxlYnJpdGllcy5tYXAoY2VsZWJyaXR5ID0+IGNlbGVicml0eS5uYW1lKS5qb2luKCcmbmJzcDsvJm5ic3A7Jyk7XFxyXFxuICAgICAgICAgICAgcjIgKz0gJzxici8+JztcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgICAgICByMiArPSAnPGJyLz4nO1xcclxcbiAgICB9KVxcclxcblxcclxcbiAgICBpZiAocGFnZSA9PSAxKSB7XFxyXFxuICAgICAgICBzZXRIb21lUmVzdWx0KHtcXHJcXG4gICAgICAgICAgICBkYXRhOiBbe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogciArIHIyLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCJcXHJcXG4gICAgICAgICAgICB9XVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfSBlbHNlIGlmKHMuYXdhcmRzLmxlbmd0aCA9PSAwKXtcXHJcXG4gICAgICAgIHNldFJlc3VsdChbXSk7XFxyXFxuICAgIH0gZWxzZXtcXHJcXG4gICAgICAgIHNldEhvbWVSZXN1bHQoe1xcclxcbiAgICAgICAgICAgIGRhdGE6IFt7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiByMixcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxyXFxuICAgICAgICAgICAgfV1cXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH1cXHJcXG59XFxyXFxuXFxyXFxuLy/lpZbpobnor6bmg4XpobXpnaJcXHJcXG5mdW5jdGlvbiBhd2FyZFZpZXcoaWQsIG5hbWUpIHtcXHJcXG4gICAgc2V0UGFnZVRpdGxlKG5hbWUpO1xcclxcbiAgICBsZXQgcyA9IGdldERvdWJhblJlcyhcXFwiaHR0cHM6Ly9mcm9kby5kb3ViYW4uY29tL2FwaS92Mi9jZXJlbW9ueS9cXFwiICsgaWQpO1xcclxcbiAgICBsZXQgYSA9IFtdO1xcclxcbiAgICBhLnB1c2goe1xcclxcbiAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ0nICsgKHMudGl0bGUgKyAnKCcgKyBzLnllYXIgKyAnKScpLmJpZygpLmJvbGQoKSxcXHJcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcXHJcXG4gICAgICAgIGV4dHJhOiB7XFxyXFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxyXFxuICAgICAgICB9XFxyXFxuICAgIH0pXFxyXFxuICAgIHMucGxheWxpc3RzLmZvckVhY2goZSA9PiB7XFxyXFxuICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiBlLnRpdGxlLFxcclxcbiAgICAgICAgICAgIGRlc2M6ICflhbEnICsgZS5pdGVtc19jb3VudCArICfpg6gnLFxcclxcbiAgICAgIC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vbF90eXBlOiAncmljaF90ZXh0J1xcclxcbiAgICB9KVxcclxcblxcclxcbiAgICBsZXQgaSA9IFtdO1xcclxcbiAgICBzLmNlcmVtb25pZXMuZm9yRWFjaChlID0+IHtcXHJcXG4gICAgICAgIGkucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IGUudGl0bGUsXFxyXFxuICAgICAgICAgICAgZGVzYzogZS55ZWFyICsgJ+W5tCcsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8zJyxcXHJcXG4gICAgICAgICAgICBpbWc6IGUucGljLm5vcm1hbCArICdAUmVmZXJlcj0nICsgZS5waWMubm9ybWFsLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjJykucnVsZSgoaWQsIG5hbWUpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICBhd2FyZFZpZXcoaWQsIG5hbWUpO1xcclxcbiAgICAgICAgICAgIH0sIGUuaWQsIGUudGl0bGUpXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9KVxcclxcbiAgICBpZiAoaS5sZW5ndGggPiAwKSB7XFxyXFxuICAgICAgICBpLnVuc2hpZnQoe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArICfljoblsYrlm57pob4nLmJpZygpLmJvbGQoKSxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxyXFxuICAgICAgICAgICAgZXh0cmE6IHtcXHJcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBzZXRSZXN1bHQoYS5jb25jYXQoaSkpO1xccl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ogZS50aXRsZSxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCJcXHJcXG4gICAgICAgIH0pO1xcclxcbiAgICAgICAgZS5jZWxlYnJpdGllcy5mb3JFYWNoKChlID0+IHtcXHJcXG4gICAgICAgICAgICByLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogZS5uYW1lICsgXFxcIlxcXFxuXFxcIiArIGUubGF0aW5fbmFtZSxcXHJcXG4gICAgICAgICAgICAgICAgZGVzYzogZS5jaGFyYWN0ZXIsXFxyXFxuICAgICAgICAgICAgICAgIGltZzogZS5hdmF0YXIubm9ybWFsICsgXFxcIkBSZWZlcmVyPVxcXCIgKyBlLmF2YXRhci5ub3JtYWwsXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbW92aWVfMV92ZXJ0aWNhbF9waWMnLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNpbW1lcnNpdmVUaGVtZSMnKS5ydWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICBlbGVzc2FyVmlldyhlLnVyaS5zcGxpdChcXFwic3ViamVjdF9pZD1cXFwiKVsxXSwgZS5pZCwgZS5uYW1lKTtcXHJcXG4gICAgICAgICAgICAgICAgfSwgZSlcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfSkpXFxyXFxuICAgIH0pKTtcXHJcXG4gICAgc2V0SG9tZVJlc3VsdCh7XFxyXFxuICAgICAgICBkYXRhOiByXFxyXFxuICAgIH0pXFxyXFxufVxcclxcblxcclxcbi8v55+t6K+E6aG16Z2iXFxyXFxuZnVuY3Rpb24gc2hvcnRDb21tZW50TGlzdCh0eXBlLCBpZCkge1xc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R7MSwyfS9nLmV4ZWMoZS5jcmVhdGVfdGltZSkgKyBcXFwiPC9mb250Pjwvc21hbGw+XFxcIixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCJcXHJcXG4gICAgICAgIH0pO1xcclxcbiAgICAgICAgbC5wdXNoKHtcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVcXFwiXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9KSk7XFxyXFxuXFxyXFxuICAgIGlmIChwYWdlID09IDEpIHtcXHJcXG4gICAgICAgIGwudW5zaGlmdCh7XFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXHJcXG4gICAgICAgIH0pO1xcclxcbiAgICAgICAgbC51bnNoaWZ0KHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogXFxcIjxiaWc+5YWxPHN0cm9uZz4gXFxcIiArIHIudG90YWwgKyBcXFwiIDwvc3Ryb25nPuadoeefreivhDwvYmlnPlxcXCIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxyXFxuICAgICAgICB9KTtcXHJcXG4gICAgICAgIHNldEhvbWVSZXN1bHQoe1xcclxcbiAgICAgICAgICAgIGRhdGE6IGEuY29uY2F0KGwpXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgc2V0SG9tZVJlc3VsdCh7XFxyXFxuICAgICAgICAgICAgZGF0YTogbFxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcbn1cXHJcXG5cXHJcXG4vL+WJp+ivhOmhtemdolxcclxcbmZ1bmN0aW9uIGRyYW1hUmV2aWV3TGlzdCh0eXBlLCBpZCkge1xcclxcbiAgICBhZGRMaXN0ZW5lcignb25DbG9zZScsIFxcXCJjbGVhck15VmFyKCdkcmFtYXJldmlldycpXFxcIik7XFxyXFxuICAgIGxldC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FxcIiZjb3VudD0xNSZvcmRlcl9ieT1cXFwiICsgdSk7XFxyXFxuICAgIGxldCBsID0gW107XFxyXFxuICAgIGxldCBzdGFyQ29sb3IgPSBnZXRDb25maWcoJ3N0YXJDb2xvcicpO1xcclxcbiAgICByLnJldmlld3MuZm9yRWFjaCgoZSA9PiB7XFxyXFxuICAgICAgICBsZXQgdCA9IFxcXCJcXFwiO1xcclxcbiAgICAgICAgaWYgKGUucmF0aW5nKSB7XFxyXFxuICAgICAgICAgICAgdCA9IGNvbXB1dGVSYXRpbmcoZS5yYXRpbmcubWF4LCBlLnJhdGluZy52YWx1ZSk7XFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICBsZXQgaSA9IGUuY29tbWVudHNfY291bnQgPyBlLmNvbW1lbnRzX2NvdW50ICsgXFxcIuWbnuWkjVxcXCIgOiBcXFwiXFxcIixcXHJcXG4gICAgICAgICAgICByID0gZS51c2VmdWxfY291bnQgPyBlLnVzZWZ1bF9jb3VudCArIFxcXCLmnInnlKhcXFwiIDogXFxcIlxcXCIsXFxyXFxuICAgICAgICAgICAgbyA9IGUucmVzaGFyZXNfY291bnQgPyBlLnJlc2hhcmVzX2NvdW50ICsgXFxcIui9rOWPkVxcXCIgOiBcXFwiXFxcIjtcXHJcXG5cXHJcXG4gICAgICAgIHIgPSBpICYmIHIgPyBcXFwi4oCiXFxcIiArIHIgOiByO1xcclxcbiAgICAgICAgbyA9IChpIHx8IHIpICYmIG8gPyBcXFwi4oCiXFxcIiArIG8gOiBvO1xcclxcbiAgICAgICAgbC5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogZS51c2VyLm5hbWUsXFxyXFxuICAgICAgICAgICAgaW1nOiBlLnVzZXIuYXZhdGFyLFxcclxcbiAgICAgICAgICAgIHVybDogZS51c2VyLnVybCxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCJcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgICAgICBsLnB1c2go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cIiA9PT0gZS50eXBlKSk7XFxyXFxuXFxyXFxuICAgIGlmIChyLmxlbmd0aCA+IDApIHtcXHJcXG4gICAgICAgIHIudW5zaGlmdCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLpooTlkYpcXFwiLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcbiAgICBpZiAobC5sZW5ndGggPiAwKSB7XFxyXFxuICAgICAgICBsLnVuc2hpZnQoe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi54mH5q61XFxcIixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCJcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH1cXHJcXG4gICAgaWYgKG8ubGVuZ3RoID4gMCkge1xcclxcbiAgICAgICAgby51bnNoaWZ0KHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuiKsee1rlxcXCIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxuXFxyXFxuICAgIHNldEhvbWVSZXN1bHQoe1xcclxcbiAgICAgICAgZGF0YTogci5jb25jYXQobClcXHJcXG4gICAgICAgICAgICAuY29uY2F0KG8pXFxyXFxuICAgIH0pXFxyXFxufVxcclxcblxcclxcbi8v6KeG6aKR6K+E6K666aG16Z2iXFxyXFxuZnVuY3Rpb24gdmlkZW9Db21tZW50KHR5cGUsIGlkKSB7XFxyXFxuICAgIGxldCBpID0gZ2V0RG91YmFuUmVzKFxcXCJodHRwczovL2Zyb2RvLmRvdWJhbi5jb20vYXBpL3YyL1xcXCIgKyB0eXBlICsgXFxcIi9cXFwiICsgaWQgKyBcXFwiL3ZpZGVvc1xcXCIpLnZpZGVvcztcXHJcXG4gICAgaS5mb3JFYWNoKChlID0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Fw8XFxcXC9wXFxcXD4vKVswXSxcXHJcXG4gICAgICAgIGltZzogaS5jb3Zlci5ub3JtYWwudXJsICsgJ0BSZWZlcmVyPScgKyBpLmNvdmVyLm5vcm1hbC51cmwsXFxyXFxuICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljX2JsdXInLFxcclxcbiAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5JykucnVsZSgoZGVzYywgZXh0cmEsIG5hbWUpID0+IHtcXHJcXG4gICAgICAgICAgICBsZXQgaW5mbyA9IGV4dHJhLmluZm8ubWFwKGUgPT4gZS5qb2luKCc6Jm5ic3A7JykpO1xcclxcbiAgICAgICAgICAgIHNldFJlc3VsdChbe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogJzxoMj4nICsgbmFtZSArICc8L2gyPicgKyBpbmZvLmpvaW4oJzxici8+JykgKyBkZXNjLm1hdGNoKC9cXFxcPHBcXFxcPi4qXFxcXDxcXFxcL3BcXFxcPi8pWzBdLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCdcXHJcXG4gICAgICAgICAgICB9XSlcXHJcXG4gICAgICAgIH0sIGkuZGVzYywgaS5leHRyYSwgaS50aXRsZSlcXHJcXG4gICAgfSlcXHJcXG4gICAgXFxyXFxuICAgIGxldCBpbmRleCA9IGkubW9kdWxlcy5maW5kSW5kZXgoY3VyID0+IGN1ci50eXBlID09IFxcXCJhd2FyZF9yZXN1bHRfY29sbGVjdGlvblxcXCIpO1xcclxcbiAgICBpZiAoaW5kZXggPiAtMSkge1xcclxcbiAgICAgICAgbGV0IGUgPSBpLm1vZHVsZXNbaW5kZXhdLnBheWxvYWQ7XFxyXFxuICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArICfojrflpZborrDlvZUnLmJpZygpLmJvbGQoKSArICc8c21hbGw+KOWFsScgKyBlLnRvdGFsICs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ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGUgPT09IFxcXCJwbGF5bGlzdFxcXCIpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwodXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxyXFxuICAgICAgICAgICAgICAgIGltZzogZS5zdWJqZWN0LmNvdmVyLm5vcm1hbC51cmwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGUuc3ViamVjdC5jb3Zlci5ub3JtYWwudXJsLFxcclxcbiAgICAgICAgICAgICAgICBkZXNjOiByYXRpbmcsXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbW92aWVfMycsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogdXJsUGFyYW1zLnVybCxcXHJcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHVybFBhcmFtcy5leHRyYVxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICAvKmEucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6ICfmn6XnnIvmm7TlpJonLFxcclxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vam9rZXItdHguY29kaW5nLm5ldC9wL2hpa2VyaW1nL2QvaGlrZXIvZ2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RwYWdle2Z5cGFnZX0jbm9IaXN0b3J5IycpLnJ1bGUoKHBpZCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgIGVsZXNzYXJQaG90b3MocGlkKTtcXHJcXG4gICAgICAgICAgICB9LCBwaWQpLFxcclxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxyXFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcclxcbiAgICAgICAgICAgIH1cXHJcXG4gICAgICAgIH0pXFxyXFxuXFxyXFxuICAgICAgICBsZXQgcGxlbmd0aCA9IGUzLnBob3Rvcy5sZW5ndGggPD0gMiA/IGUzLnBob3Rvcy5sZW5ndGggOiAyO1xcclxcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBwbGVuZ3RoOyBpKyspIHtcXHJcXG4gICAgICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICAvL3RpdGxlOiBlMy5waG90b3NbMF0uZGVzY3JpcHRpb24sXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnY2FyZF9waWNfMicsXFxyXFxuICAgICAgICAgICAgICAgIGRlc2M6ICcwJyxcXHJcXG4gICAgICAgICAgICAgICAgaW1nOiBlMy5waG90b3NbaV0uaW1hZ2Uubm9ybWFsLnVybCArICdAUmVmZXJlcj0nICsgZTMucGhvdG9zW2ldLmltYWdlLm5vcm1hbC51cmwsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogZTMucGhvdG9zW2ldLmltYWdlLm5vcm1hbC51cmwgKyAnQFJlZmVyZXI9JyArIGUzLnBob3Rvc1tpXS5pbWFnZS5ub3JtYWwudXJsXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH1cXHJcXG5cXHJcXG4gICAgICAgIC8qYS5wdXNoKHtcXHJcXG4g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WaWV3Q29uZmlncyA9IGdldENvbmZpZygnZGV0YWlsc1ZpZXdDb25maWdzJyk7XFxyXFxuICAgIGkuYXdhcmRzLmZvckVhY2godCA9PiB7XFxyXFxuICAgICAgICBsLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiAodC55ZWFyK1xcXCJcXFwiKS5ib2xkKCkuYmlnKCksXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnXFxyXFxuICAgICAgICB9KVxcclxcblxcclxcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0Lm1vZHVsZXMubGVuZ3RoOyBpKyspIHtcXHJcXG4gICAgICAgICAgICBsZXQgZSA9IHQubW9kdWxlc1tpXTtcXHJcXG4gICAgICAgICAgICBpZiAoIWUuY2VyZW1vbnkgfHwgIWUuY2F0ZWdvcnkpIHtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IHJhdGluZyA9IFxcXCJcXFwiO1xcclxcbiAgICAgICAgICAgICAgICBpZiAoZS5leHRyYS5yYXRpbmdfZ3JvdXAucmF0aW5nKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICByYXRpbmcgPSBjb21wdXRlUmF0aW5nKGUuZXh0cmEucmF0aW5nX2dyb3VwLnJhdGluZy5tYXgsIGUuZXh0cmEucmF0aW5nX2dyb3VwLnJhdGluZy52YWx1ZSkgKyBcXFwiIFxcXCIgKyBlLmV4dHJhLnJhdGluZ19ncm91cC5yYXRpbmcudmFsdWUgKyBcXFwi5YiGXFxcIjtcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICBsZXQgdHlwZSA9IGUuc3VidHlwZSxcXHJcXG4gICAgICAgICAgICAgICAgICAgIGlkID0gZS5pZCxcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gZS50aXRsZTtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IHVzZUNvbmZpZyA9IGRldGFpbHNWaWV3Q29uZmlnc1tkZXRhaWxzVmlld0NvbmZpZ3MudXNlXS5jb25maWc7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKHVzZUNvbmZpZy5zdGFydHNXaXRoKCd7JykpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoJ3VybFBhcmFtcyA9ICcgKyB1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgdXJsUGFyYW1zLnVybCA9ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNpbW1lcnNpdmVUaGVtZSNcXFwiICsgJz90eXBlPScgKyB0eXBlICsgJyZpZD0nICsgaWQpLnJ1bGUoKHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvdUxpc3QoaWQsIE1ZX1BBR0UsIDUwKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIGwucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxyXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGUuY292ZXIubm9ybWFsLnVybCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZS5jb3Zlci5ub3JtYWwudXJsLFxcclxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogcmF0aW5nICsgJ1xcXFxuJyArIGUuZXh0cmEuc2hvcnRfaW5mbyxcXHJcXG4gICAgICAgICAgICAgICAgICAgIHVybDogdXJsUGFyYW1zLnVybCxcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB1cmxQYXJhbXMuZXh0cmFcXHJcXG4gICAgICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICBsLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGUuY2VyZW1vbnkudGl0bGUuYm9sZCgpICsgJzxzbWFsbD4oPGEgaHJlZj1cXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjQHJ1bGU9anM6ZXZhbChKU09OLnBhcnNlKGZldGNoKGBoaWtlcjovL3BhZ2UvbWFpbmApKS5ydWxlKTthd2FyZFZpZXcoYCcgKyBlLmNlcmVtb255LmlkICsgJ2AsYCcgKyBlLmNlcmVtb255LnRpdGxlICsgJ2ApO1xcXCI+5p+l55yL6K+m5oOFPC9hPik8L3NtYWxsPicgKyAnPGJyLz4nICsgKGUuY2F0ZWdvcnkudGl0bGUgKyAoZS5pc193b24gPyAnJyA6ICco5o+Q5ZCNKScpKS5zbWFsbCgpLFxcclxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnXFxyXFxuICAgICAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgfVxcclxcbiAgICB9KVxcclxcblxcclxcbiAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxyXFxuICAgICAgICBsLnVuc2hpZnQoe1xcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcX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Sk7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICBsLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSArIHllYXIsXFxyXFxuICAgICAgICAgICAgaW1nOiBlLnN1YmplY3QuY292ZXIubm9ybWFsLnVybCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZS5zdWJqZWN0LmNvdmVyLm5vcm1hbC51cmwsXFxyXFxuICAgICAgICAgICAgZGVzYzogZS5yb2xlcy5qb2luKFxcXCLigKJcXFwiKSArIFxcXCJcXFxcblxcXCIgKyByYXRpbmcgKyAnXFxcXG4nICsgZS5zdWJqZWN0LmV4dHJhLnNob3J0X2luZm8sXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYycsXFxyXFxuICAgICAgICAgICAgdXJsOiB1cmxQYXJhbXMudXJsLFxcclxcbiAgICAgICAgICAgIGV4dHJhOiB1cmxQYXJhbXMuZXh0cmFcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH0pKVxcclxcblxcclxcbiAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxyXFxuICAgICAgICBsLnVuc2hpZnQoe1xcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxyXFxuICAgICAgICB9KVxcclxcbiAgICAgICAgbC51bnNoaWZ0KHtcXHJcXG4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tdO1xcclxcbiAgICBpZiAoaS50cmFpbGVyKSB7XFxyXFxuICAgICAgICB2aWRlb1JlbGF0ZWRJdGVtcy5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxiaWc+PHN0cm9uZz7pooTlkYo8L3N0cm9uZz48L2JpZz5cXFwiLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxyXFxuICAgICAgICAgICAgZXh0cmE6IHtcXHJcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxyXFxuICAgICAgICAgICAgfSxcXHJcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgfSk7XFxyXFxuICAgICAgICB2aWRlb1JlbGF0ZWRJdGVtcy5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogaS50cmFpbGVyLnRpdGxlLFxcclxcbiAgICAgICAgICAgIGltZzogaS50cmFpbGVyLmNvdmVyX3VybCxcXHJcXG4gICAgICAgICAgICB1cmw6IGkudHJhaWxlci52aWRlb191cmwsXFxyXFxuICAgICAgICAgICAgZGVzYzogaS50cmFpbGVyLnN1YmplY3RfdGl0bGUgKyBcXFwi4oCiXFxcIiArIGkudHJhaWxlci5jcmVhdGVfdGltZSxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcIm1vdmllXzJcXFwiXFxyXFxuICAgICAgICB9KTtcXHJcXG4gICAgICAgIHZpZGVvUmVsYXRlZEl0ZW1zLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiAn5p+l55yL5pu05aSaJyxcXHJcXG4gICAgICAgICAgICBpbWc6IFxcXCJodHRwczovL2kwLndwLmNvbS9pMC5pbWcyaXBmcy5jb20vaXBmcy9RbVphYTFMUU5ub2RUMVQxU0MzbVJFRDZZeDZETEt2RUxLNkZ4aUtma3Y4NW5EP2ZpbGVuYW1lPW1vcmUucG5nXFxcIixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcIm1vdmllXzJcXFwiLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eS8jLyRwYWdle2Z5cGFnZX0jbm9IaXN0b3J5IycpLnJ1bGUoKHQpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICB0cmFpbGVycyh0WzBdLCB0WzFdKTtcXHJcXG4gICAgICAgICAgICB9LCBbaS5zdWJ0eXBlLCBpLmlkXSksXFxyXFxuICAgICAgICB9KTtcXHJcXG4gICAgfVxcclxcbiAgICBpZiAoaS52aWRlbykge1xcclxcbiAgICAgICAgdmlkZW9SZWxhdGVkSXRlbXMucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ08YmlnPjxzdHJvbmc+6KeG6aKR6K+E6K66PC9zdHJvbmc+PC9iaWc+XFxcIixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcclxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxyXFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcclxcbiAgICAgICAgICAgIH0sXFxyXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgIH0pO1xcclxcbiAgICAgICAgdmlkZW9SZWxhdGVkSXRlbXMucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IGkudmlkZW8udGl0bGUsXFxyXFxuICAgICAgICAgICAgaW1nOiBpLnZpZGVvLmNvdmVyX3VybCArIFxcXCJAUmVmZXJlcj1cXFwiICsgaS52aWRlby5jb3Zlcl91cmwsXFxyXFxuICAgICAgICAgICAgdXJsOi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AgIH0pXFxyXFxuICAgIGlmIChxdWlja1NlYXJjaEl0ZW1zLmxlbmd0aCA+IDApIHtcXHJcXG4gICAgICAgIHF1aWNrU2VhcmNoSXRlbXMudW5zaGlmdCh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPHN0cm9uZz48YmlnPuW/q+mAn+aQnOe0ojwvYmlnPjwvc3Ryb25nPicsXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxyXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXHJcXG4gICAgICAgICAgICAgICAgfSxcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgICAgIC8qcXVpY2tTZWFyY2hJdGVtcy51bnNoaWZ0KHtcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcclxcbiAgICAgICAgICAgIH0pKi9cXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBzZXRIb21lUmVzdWx0KHtcXHJcXG4gICAgICAgIGRhdGE6IGluZm9JdGVtcy5jb25jYXQocmF0aW5nSXRlbXMpXFxyXFxuICAgICAgICAgICAgLmNvbmNhdChyZWxhdGVkSXRlbXMpXFxyXFxuICAgICAgICAgICAgLmNvbmNhdCh7XFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgICAgIC5jb25jYXQocXVpY2tTZWFyY2hJdGVtcylcXHJcXG4gICAgICAgICAgICAuY29uY2F0KHtcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgLmNvbmNhdCh2aWRlb0l0ZW1zKVxcclxcbiAgICAgICAgICAgIC5jb25jYXQoe1xcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgICAgICAuY29uY2F0KHZpZGVvUmVsYXRlZEl0ZW1zKVxcclxcbiAgICAgICAgICAgIC5jb25jYXQoe1xcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgICAgICAuY29uY2F0KGludHJvSXRlbXMpXFxyXFxuICAgICAgICAgICAgLmNvbmNhdCh7XFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZScsXFxyXFxuICAgICAgICAgICAgICAgIGV4dHJhOntcXHJcXG4gICAgICAgICAgICAgICAgICBpZDogJ3JlY29tbWVuZGF0aW9ucydcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgLmNvbmNhdCh7XFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPHNtYWxsPjxmb250IGNvbG9yPSM4NzFmNzg+5Lul5LiK5pWw5o2u5p2l5rqQ5LqO6LGG55Oj77yM5aaC5oKo5Zac5qyi77yM6K+35LiL6L295a6Y5pa5YXBwPC9mb250Pjwvc21hbGw+JyxcXHJcXG4gICAgICAgICAgICAgICAgZGVzYzogJ+KAnOKAnOKAneKAnTxzbWFsbD48Zm9udCBjb2xvcj0jZjIwYzAwPuatpOinhOWImeS7hemZkOWtpuS5oOS6pOa1geS9v+eUqO+8jOivt+S6juWvvOWFpeWQjjI05bCP5pe25YaF5Yig6Zmk77yM5Lu75L2V57uE57uH5oiW5Liq5Lq65LiN5b6X5Lul5Lu75L2V5pa55byP5pa55rOV5Lyg5pKt5q2k6KeE5YiZ55qE5pW05L2T5oiW6YOo5YiG77yBPC9mb250Pjwvc21hbGw+JyxcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiAnaHR0cHM6Ly9tb3ZpZS5kb3ViYW4uY29tL3N1YmplY3QvJyArIGlkICsgJy8nLFxcclxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICB9KVxcclxcbiAgICBiZShbe1xcclxcbiAgICAgICAgZnVuYzogZnVuY3Rpb24ob2JqKXtcXHJcXG4gICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgbGV0IHJlcyA9IGdldERvdWJhblJlcyhvYmoudXJsKTtcXHJcXG4gICAgICAgICAgICBcXHJcXG4gICAgICAgICAgICBsZXQgZGV0YWlsc1ZpZXdDb25maWdzID0gZ2V0Q29uZmlnKCdkZXRhaWxzVmlld0NvbmZpZ3MnKTtcXHJcXG4gICAgICAgICAgICBsZXQgbCA9IFtyZXNbMF0scmVzWzFdLHJlc1syXV07XFxyXFxuICAgICAgICAgICAgbGV0IGkgPSBsLm1hcCgoZSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB0eXBlID0gZS50eXBlLFxcclxcbiAgICAgICAgICAgICAgICAgICAgaWQgPSBlLmlkLFxcclxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSBlLnRpdGxlO1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdXNlQ29uZmlnID0gZGV0YWlsc1ZpZXdDb25maWdzW2RldGFpbHNWaWV3Q29uZmlncy51c2VdLmNvbmZpZztcXHJcXG4gICAgICAgICAgICAgICAgbGV0IHVybFBhcmFtcyA9IHt9O1xcclxcbiAgICAgICAgICAgICAgICBpZiAodXNlQ29uZmlnLnN0YXJ0c1dpdGgoJ3snKSkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCgndXJsUGFyYW1zID0gJyArIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICB1cmxQYXJhbXMudXJsID0gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI2ltbWVyc2l2ZVRoZW1lI1xcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZCkucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGUgPT09IFxcXCJwbGF5bGlzdFxcXCIpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwodXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXHJcXG4gICAgICAgICAgICAgICAgICAgIHVybDogdXJsUGFyYW1zLnVybCxcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB1cmxQYXJhbXMuZXh0cmEsXFxyXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGUucGljID8gZS5waWMubm9ybWFsICsgXFxcIkBSZWZlcmVyPVxcXCIgKyBlLnBpYy5ub3JtYWwgOiBlLmNvdmVyLnVybCArICdAUmVmZXJlcj0nICsgZS5jb3Zlci51cmwsXFxyXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBlLm51bGxfcmF0aW5nX3JlYXNvbiB8fCBlLnJhdGluZy52YWx1ZVxcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSkpO1xcclxcbiAgICAgICAgICAgIGFkZEl0ZW1BZnRlcigncmVjb21tZW5kYXRpb25zJywgaVsyXSk7XFxyXFxuICAgICAgICAgICAgYWRkSXRlbUFmdGVyKCdyZWNvbW1lbmRhdGlvbnMnLCBpWzFdKTtcXHJcXG4gICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ3JlY29tbWVuZGF0aW9ucycsIGlbMF0pO1xcclxcbiAgICAgICAgICAgIGFkZEl0ZW1BZnRlcigncmVjb21tZW5kYXRpb25zJywge1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxiaWc+PHN0cm9uZz7nm7jlhbPmjqjojZA8L3N0cm9uZz48L2JpZz5cXFwiLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkvI25vSGlzdG9yeSMnKS5ydWxlKCh0KSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZWNvbW1lbmRhdGlvbnModFswXSwgdFsxXSk7XFxyXFxuICAgICAgICAgICAgICAgIH0sIFtvYmoudHlwZSwgb2JqLmlkXSksXFxyXFxuICAg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YS5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGVtcC5wbGF5YWJsZSA9PSBwbGF5YWJsZVtyXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgciArICcgPC9mb250PjwvYj4nIDogcixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6IC8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignZmluZExpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgIHRlbXAucGxheWFibGUgPSBlO1xcclxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiZmluZExpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICB9LCBwbGF5YWJsZVtyXSlcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH1cXHJcXG5cXHJcXG4gICAgYS5wdXNoKHtcXHJcXG4gICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+6K+E5YiG5Yy66Ze0OicgKyB0ZW1wLnNjb3JlLnJlcGxhY2UoJywnLCAnLScpICsgJyA8L2ZvbnQ+PC9iPicsXFxyXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgdXJsOiAkKHRlbXAuc2NvcmUucmVwbGFjZSgnLCcsICctJyksICfor4TliIblupTlnKgwLTEw5LmL6Ze0JykuaW5wdXQoKCkgPT4ge1xcclxcbiAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignZmluZExpc3QnKSk7XFxyXFxuICAgICAgICAgICAgbGV0IGlucHV0cyA9IGlucHV0LnNwbGl0KCctJyk7XFxyXFxuICAgICAgICAgICAgaWYgKGlucHV0cy5sZW5ndGggPT0gMiAmJiBpbnB1dHMuZXZlcnkoZSA9PiBlID49IDAgJiYgZSA8PSAxMCkgJiYgcGFyc2VGbG9hdChpbnB1dHNbMF0pIDwgaW5wdXRzWzFdKSB7XFxyXFxuICAgICAgICAgICAgICAgIHRlbXAuc2NvcmUgPSBpbnB1dC5yZXBsYWNlKCctJywgJywnKTtcXHJcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImZpbmRMaXN0XFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+ato+ehrui+k+WFpSdcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9KVxcclxcblxcclxcbiAgICBsZXQgcyA9IGdldERvdWJhblJlcyhcXFwiaHR0cHM6Ly9mcm9kby5kb3ViYW4uY29tL2FwaS92Mi9cXFwiICsgdGVtcC5pdGVtICsgXFxcIi9yZWNvbW1lbmRcXFwiICsgJz9wbGF5YWJsZT0nICsgdGVtcC5wbGF5YWJsZSArICcmc2NvcmVfcmFuZ2U9JyArIHRlbXAuc2NvcmUgKyAocGFnZSA/IFxcXCImc3RhcnQ9XFxcIiArIChwYWdlIC0gMSkgKiBjb3VudCArIFxcXCImY291bnQ9XFxcIiArIGNvdW50IDogXFxcIiZzdGFydD0wJmNvdW50PThcXFwiKSk7XFxyX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vbE6ICdob3RfZ2FpYT9hcmVhPeWNjuivrScsXFxyXFxuICAgICAgICAgICAg54Ot6Zeo5qyn576O55S15b2xOiAnaG90X2dhaWE/YXJlYT3mrKfnvo4nLFxcclxcbiAgICAgICAgICAgIOeDremXqOmfqeWbveeUteW9sTogJ2hvdF9nYWlhP2FyZWE96Z+p5Zu9JyxcXHJcXG4gICAgICAgICAgICDng63pl6jml6XmnKznlLXlvbE6ICdob3RfZ2FpYT9hcmVhPeaXpeacrCdcXHJcXG4gICAgICAgIH0sXFxyXFxuICAgICAgICDnlLXop4bliac6IHtcXHJcXG4gICAgICAgICAgICDng63mkq3nlLXop4bliac6ICd0dl9ob3QnLFxcclxcbiAgICAgICAgICAgIOeDreaSreWbveS6p+WJpzogJ3R2X2RvbWVzdGljJyxcXHJcXG4gICAgICAgICAgICDng63mkq3mrKfnvo7liac6ICd0dl9hbWVyaWNhbicsXFxyXFxuICAgICAgICAgICAg54Ot5pKt5pel5YmnOiAndHZfamFwYW5lc2UnLFxcclxcbiAgICAgICAgICAgIOeDreaSremfqeWJpzogJ3R2X2tvcmVhbicsXFxyXFxuICAgICAgICAgICAg54Ot5pKt5Yqo55S7OiAndHZfYW5pbWF0aW9uJ1xcclxcbiAgICAgICAgfSxcXHJcXG4gICAgICAgIOe7vOiJujoge1xcclxcbiAgICAgICAgICAgIOeDreaSree7vOiJujogJ3Nob3dfaG90JyxcXHJcXG4gICAgICAgICAgICDlm73lhoXnu7zoibo6ICdzaG93X2RvbWVzdGljJyxcXHJcXG4gICAgICAgICAgICDlm73lpJbnu7zoibo6ICdzaG93X2ZvcmVpZ24nXFxyXFxuICAgICAgICB9XFxyXFxuICAgIH1cXHJcXG4gICAgZm9yIChsZXQgaSBpbiBpdGVtcykge1xcclxcbiAgICAgICAgZm9yIChsZXQgaiBpbiBpdGVtc1tpXSkge1xcclxcbiAgICAgICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0ZW1wLml0ZW0gPT0gaXRlbXNbaV1bal0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIGogKyAnIDwvZm9udD48L2I+JyA6IGosXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGUpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignaG90TGlzdCcpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRlbXAuaXRlbSA9IGU7XFxyXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignaG90TGlzdCcsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgICAgIH0sIGl0ZW1zW2ldW2pdKVxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxuXFxyXFxuICAgIGxldCBzb3J0ID0ge1xcclxcbiAgICAgICAg54Ot5bqm5o6S5bqPOiAncmVjb21tZW5kJyxcXHJcXG4gICAgICAgIOaXtumXtOaOkuW6jzogJ3RpbWUnLFxcclxcbiAgICAgICAg6K+E5YiG5o6S5bqPOiAncmFuaydcXHJcXG4gICAgfVxcclxcbiAgICBmb3IgKGxldCByIGluIHNvcnQpIHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IHRlbXAuc29ydCA9PSBzb3J0W3JdID8gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPicgKyByICsgJyA8L2ZvbnQ+PC9iPicgOiByLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxyXFxuICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjogLy9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGUpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdob3RMaXN0JykpO1xcclxcbiAgICAgICAgICAgICAgICB0ZW1wLnNvcnQgPSBlO1xcclxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaG90TGlzdFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgIH0sIHNvcnRbcl0pXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxuXFxyXFxuICAgIGEucHVzaCh7XFxyXFxuICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcclxcbiAgICB9KVxcclxcblxcclxcbiAgICBsZXQgcGxheWFibGUgPSB7XFxyXFxuICAgICAgICDlhajpg6jlvbHniYc6ICcwJyxcXHJcXG4gICAgICAgIOS7heacieeJh+a6kDogJzEnXFxyXFxuICAgIH1cXHJcXG4gICAgZm9yIChsZXQgciBpbiBwbGF5YWJsZSkge1xcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGVtcC5wbGF5YWJsZSA9PSBwbGF5YWJsZVtyXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgciArICcgPC9mb250PjwvYj4nIDogcixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6IC8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignaG90TGlzdCcpKTtcXHJcXG4gICAgICAgICAgICAgICAgdGVtcC5wbGF5YWJsZSA9IGU7XFxyXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJob3RMaXN0XFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgfSwgcGxheWFibGVbcl0pXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxuXFxyXFxuICAgIGEucHVzaCh7XFxyXFxuICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPuivhOWIhuWMuumXtDonICsgdGVtcC5zY29yZS5yZXBsYWNlKCcsJywgJy0nKSArICcgPC9mb250PjwvYj4nLFxcclxcbiAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgIHVybDogJCh0ZW1wLnNjb3JlLnJlcGxhY2UoJywnLCAnLScpLCAn6K+E5YiG5bqU5ZyoMC0xMOS5i+mXtCcpLmlucHV0KCgpID0+IHtcXHJcXG4gICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2hvdExpc3QnKSk7XFxyXFxuICAgICAgICAgICAgbGV0IGlucHV0cyA9IGlucH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gICAgICAgaWYodGVtcFtpdGVtXSA9PSBpdGVtc1tpdGVtXVtpXSB8fCAodGVtcFtpdGVtXSA9PSBcXFwiXFxcIiAmJiBpID09IDApKXtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGUgPSAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIGl0ZW1zW2l0ZW1dW2ldICsgJyA8L2ZvbnQ+PC9iPic7XFxyXFxuICAgICAgICAgICAgfWVsc2V7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlID0gaXRlbXNbaXRlbV1baV07XFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIGxldCB1cmwgPSAkKCdoaWtlcjovL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgodGV4dCxpdGVtKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdjbGFzc2xpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcFtpdGVtXSA9IHRleHQuaW5kZXhPZihcXFwi5YWo6YOoXFxcIikgIT0gLTEgPyBcXFwiXFxcIiA6IHRleHQ7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImNsYXNzbGlzdFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICAgICAgICAgIH0sIGl0ZW1zW2l0ZW1dW2ldLCBpdGVtKTtcXHJcXG4gICAgICAgICAgICBcXHJcXG4gICAgICAgICAgICBpZihpdGVtc1tpdGVtXVtpXSA9PSBcXFwi6Ieq5a6a5LmJ5bm05Lu9XFxcIil7XFxyXFxuICAgICAgICAgICAgICAgIGlmKHRlbXAueWVhciA9PSBcXFwi6Ieq5a6a5LmJ5bm05Lu9XFxcIil7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz7oh6rlrprkuYnlubTku706JyArIHRlbXAuY3VzdG9tWWVhciArICcgPC9mb250PjwvYj4nO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIFxcclxcbiAgICAgICAgICAgICAgICB1cmwgPSAkKHRlbXAuY3VzdG9tWWVhciwgJ+ebtOaOpei+k+WFpeWFt+S9k+W5tOS7vSzkvovlpoIyMDAwJykuaW5wdXQoKCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdjbGFzc2xpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICBpZihpbnB1dC5sZW5ndGggPT0gNCl7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC5jdXN0b21ZZWFyID0gaW5wdXQ7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC55ZWFyID0gXFxcIuiHquWumuS5ieW5tOS7vVxcXCI7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImNsYXNzbGlzdFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/or7fmraPnoa7ovpPlhaUnXFxyXFxuICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIH0pO1xcclxcbiAgICAgICAgICAgIH1lbHNlIGlmKGl0ZW1zW2l0ZW1dW2ldID09IFxcXCLoh6rlrprkuYnlnLDljLpcXFwiKXtcXHJcXG4gICAgICAgICAgICAgICAgaWYodGVtcC5sb2NhbCA9PSBcXFwi6Ieq5a6a5LmJ5Zyw5Yy6XFxcIil7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz7oh6rlrprkuYnlnLDljLo6JyArIHRlbXAuY3VzdG9tTG9jYWwgKyAnIDwvZm9udD48L2I+JztcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICBcXHJcXG4gICAgICAgICAgICAgICAgdXJsID0gJCh0ZW1wLmN1c3RvbUxvY2FsLCAn55u05o6l6L6T5YWl5YW35L2T5Zyw5Yy6LOS+i+WmguS4reWbveWkp+mZhicpLmlucHV0KCgpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY2xhc3NsaXN0JykpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgaWYoaW5wdXQubGVuZ3RoID4gMCl7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC5jdXN0b21Mb2NhbCA9IGlucHV0O1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAubG9jYWwgPSBcXFwi6Ieq5a6a5LmJ5Zyw5Yy6XFxcIjtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiY2xhc3NsaXN0XFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+ato+ehrui+k+WFpSdcXHJcXG4gICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgfSk7XFxyXFxuICAgICAgICAgICAgfWVsc2UgaWYoaXRlbXNbaXRlbV1baV0gPT0gXFxcIuiHquWumuS5ieexu+Wei1xcXCIpe1xcclxcbiAgICAgICAgICAgICAgICBpZih0ZW1wLnR5cGUgPT0gXFxcIuiHquWumuS5ieexu+Wei1xcXCIpe1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+6Ieq5a6a5LmJ57G75Z6LOicgKyB0ZW1wLmN1c3RvbVR5cGUgKyAnIDwvZm9udD48L2I+JztcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICBcXHJcXG4gICAgICAgICAgICAgICAgdXJsID0gJCh0ZW1wLmN1c3RvbVR5cGUsICfnm7TmjqXovpPlhaXlhbfkvZPnsbvlnoss5L6L5aaC5Ymn5oOFJykuaW5wdXQoKCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdjbGFzc2xpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICBpZihpbnB1dC5sZW5ndGggPiAwKXtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLmN1c3RvbVR5cGUgPSBpbnB1dDtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLnR5cGUgPSBcXFwi6Ieq5a6a5LmJ57G75Z6LXFxcIjtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiY2xhc3NsaXN0XFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+ato+ehrui+k+WFpSdcXHJcXG4gICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgfSk7XFxyXFxuICAgICAgICAgICAgfWVsc2UgaWYoaXRlbXNbaXRlbV1baV0gPT0gXFxcIuiHquWumuS5ieagh+etvlxcXCIpe1xcclxcbiAgICAgICAgICAgICAgICBpZih0ZW1wLmNsYXNzID09IFxcXCLoh6rlrprkuYnmoIfnrb5cXFwiKXtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPuiHquWumuS5ieagh+etvjonICsgdGVtcC5jdXN0b21DbGFzcyArICcgPC9mb250PjwvYj4nO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIFxcclxcbiAgICAgICAgICAgICAgICB1cmwgPSAkKHRlbXAuY3VzdG9tQ2xhc3MsICfnm7TmjqXovpPlhaXlhbfkvZPmoIfnrb4s5L6L5aaC57uP5YW4XFxcXG7lj6/lhpnlpJrkuKrmoIfnrb4s5L2/55SoXFxcIuiLseaWh+mAl+WPt1xcXCLliIbpmpQnKS5pbnB1dCgoKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NsYXNzbGlzdCcpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGlmKGlucHV0Lmxlbmd0aCA+IDApe1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAuY3VzdG9tQ2xhc3MgPSBpbnB1dDtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLmNsYXNzID0gXFxcIuiHquWumuS5ieagh+etvlxcXCI7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImNsYXNzbGlzdFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/or7fmraPnoa7ovpPlhaUnXFxyXFxuICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIH0pO1xcclxcbiAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogdXJsXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH1cXHJcXG5cXHJcXG4gICAgbGV0IHJhbmsgPSB7XFxyXFxuICAgICAgICDpu5jorqTmjpLluo86IFxcXCJVXFxcIixcXHJcXG4gICAgICAgIOeDreW6pjogXFxcIlRcXFwiLFxcclxcbiAgICAgICAg6K+E5YiGOiBcXFwiU1xcXCIsXFxyXFxuICAgICAgICDml7bpl7Q6IFxcXCJSXFxcIlxcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IHIgaW4gcmFuaykge1xcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGVtcC5yYW5rID09PSByYW5rW3JdID8gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPicgKyByICsgJyA8L2ZvbnQ+PC9iPicgOiByLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxyXFxuICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjogLy9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGUpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdjbGFzc2xpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgIHRlbXAucmFuayA9IGU7XFxyXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJjbGFzc2xpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICB9LCByYW5rW3JdKVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBhLnB1c2goe1xcclxcbiAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXHJcXG4gICAgfSlcXHJcXG5cXHJcXG4gICAgbGV0IGZpbHRlciA9IHtcXHJcXG4gICAgICAgIOWFqOmDqOW9seeJhzogJycsXFxyXFxuICAgICAgICDku4XmnInniYfmupA6ICdwbGF5YWJsZSdcXHJcXG4gICAgfVxcclxcbiAgICBmb3IgKGxldCByIGluIGZpbHRlcikge1xcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGVtcC5maWx0ZXIgPT09IGZpbHRlcltyXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgciArICcgPC9mb250PjwvYj4nIDogcixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6IC8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY2xhc3NsaXN0JykpO1xcclxcbiAgICAgICAgICAgICAgICB0ZW1wLmZpbHRlciA9IGU7XFxyXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJjbGFzc2xpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICB9LCBmaWx0ZXJbcl0pXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxuXFxyXFxuICAgIGEucHVzaCh7XFxyXFxuICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPuivhOWIhuWMuumXtDonICsgdGVtcC5zY29yZS5yZXBsYWNlKCcsJywgJy0nKSArICcgPC9mb250PjwvYj4nLFxcclxcbiAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgIHVybDogJCh0ZW1wLnNjb3JlLnJlcGxhY2UoJywnLCAnLScpLCAn6K+E5YiG5bqU5ZyoMC0xMOS5i+mXtCcpLmlucHV0KCgpID0+IHtcXHJcXG4gICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NsYXNzbGlzdCcpKTtcXHJcXG4gICAgICAgICAgICBsZXQgaW5wdXRzID0gaW5wdXQuc3BsaXQoJy0nKTtcXHJcXG4gICAgICAgICAgICBpZiAoaW5wdXRzLmxlbmd0aCA9PSAyICYmIGlucHV0cy5ldmVyeShlID0+IGUgPj0gMCAmJiBlIDw9IDEwKSAmJiBwYXJzZUZsb2F0KGlucHV0c1swXSkgPCBpbnB1dHNbMV0pIHtcXHJcXG4gICAgICAgICAgICAgICAgdGVtcC5zY29yZSA9IGlucHV0LnJlcGxhY2UoJy0nLCAnLCcpO1xcclxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiY2xhc3NsaXN0XFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+ato+ehrui+k+WFpSdcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9KVxcclxcblxcclxcbiAgICBsZXQgcyA9IGdldERvdWJhblJlcyhcXFwiaHR0cHM6Ly9mcm9kby5kb3ViYW4uY29tL2FwaS92Mi9tb3ZpZS90YWc/XFxcIlxcclxcbiAgICAgICAgICAgICsgKHBhZ2UgPyBcXFwic3RhcnQ9XFxcIiArIChwYWdlIC0gMSkgKiBjb3VudFxcclxcbiAgICAgICAgICAgICsgXFxcIiZjb3VudD1cXFwiICsgY291bnQgOiBcXFwic3RhcnQ9MCZjb3VudD0zMFxcXCIpXFxyXFxuICAgICAgICAgICAgKyBcXFwiJnE9XFxcIiArIHRlbXAuc3VidHlwZVxcclxcbiAgICAgICAgICAgICsgXFxcIixcXFwiICsgKHRlbXAubG9jYWw9PVx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cbiAgICAgICAgICAgIOWGt+mXqOS9s+eJhzogXFxcImRhcmtfaG9yc2VcXFwiLFxcclxcbiAgICAgICAgICAgIOS4u+mimDogXFxcInRvcGljXFxcIixcXHJcXG4gICAgICAgICAgICDlr7zmvJQ6IFxcXCJkaXJlY3RvclxcXCIsXFxyXFxuICAgICAgICAgICAg5ryU5ZGYOiBcXFwiYWN0b3JcXFwiLFxcclxcbiAgICAgICAgICAgIOezu+WIlzogXFxcInNlcmllc1xcXCIsXFxyXFxuICAgICAgICAgICAg5Y2O6K+tOiBcXFwiY2hpbmVzZVxcXCIsXFxyXFxuICAgICAgICAgICAg5qyn576OOiBcXFwid2VzdGVyblxcXCIsXFxyXFxuICAgICAgICAgICAg5pel5pysOiBcXFwiamFwYW5lc2VcXFwiLFxcclxcbiAgICAgICAgICAgIOmfqeWbvTogXFxcImtvcmVhXFxcIixcXHJcXG4gICAgICAgICAgICDllpzliac6IFxcXCJjb21lZHlcXFwiLFxcclxcbiAgICAgICAgICAgIOWKqOS9nDogXFxcImFjdGlvblxcXCIsXFxyXFxuICAgICAgICAgICAg54ix5oOFOiBcXFwibG92ZVxcXCIsXFxyXFxuICAgICAgICAgICAg56eR5bm7OiBcXFwic2NpZW5jZV9maWN0aW9uXFxcIixcXHJcXG4gICAgICAgICAgICDliqjnlLs6IFxcXCJjYXJ0b29uXFxcIixcXHJcXG4gICAgICAgICAgICDmgqznlpE6IFxcXCJteXN0ZXJ5XFxcIixcXHJcXG4gICAgICAgICAgICDmg4rmgpo6IFxcXCJwYW5pY1xcXCIsXFxyXFxuICAgICAgICAgICAg5oGQ5oCWOiBcXFwiaG9ycmlibGVcXFwiLFxcclxcbiAgICAgICAgICAgIOeKr+e9qjogXFxcImNyaW1pbmFsXFxcIixcXHJcXG4gICAgICAgICAgICDlkIzmgKc6IFxcXCJsZ2J0XFxcIixcXHJcXG4gICAgICAgICAgICDmiJjkuok6IFxcXCJ3YXJcXFwiLFxcclxcbiAgICAgICAgICAgIOWlh+W5uzogXFxcImZhbnRhc3lcXFwiLFxcclxcbiAgICAgICAgICAgIFxcXCJcXFxcdTYwYzVcXFxcdTgyNzJcXFwiOiBcXFwiZXJvdGljYVxcXCIsXFxyXFxuICAgICAgICAgICAg6Z+z5LmQOiBcXFwibXVzaWNcXFwiLFxcclxcbiAgICAgICAgICAgIOe6quW9leeJhzogXFxcImRvY3VtZW50YXJ5XFxcIixcXHJcXG4gICAgICAgICAgICDmsrvmhIg6IFxcXCJjdXJlXFxcIixcXHJcXG4gICAgICAgICAgICDoibrmnK86IFxcXCJhcnRcXFwiLFxcclxcbiAgICAgICAgICAgIOm7keiJsuW5vem7mDogXFxcImRhcmtfaHVtb3JcXFwiLFxcclxcbiAgICAgICAgICAgIOmdkuaYpTogXFxcInlvdXRoXFxcIixcXHJcXG4gICAgICAgICAgICDlpbPmgKc6IFxcXCJmZW1hbGVcXFwiLFxcclxcbiAgICAgICAgICAgIOecn+WunuS6i+S7tuaUuee8ljogXFxcInJlYWxfZXZlbnRcXFwiLFxcclxcbiAgICAgICAgICAgIOaatOWKmzogXFxcInZpb2xlbmNlXFxcIixcXHJcXG4gICAgICAgICAgICDpu5Hnmb06IFxcXCJibGFja193aGl0ZVxcXCIsXFxyXFxuICAgICAgICAgICAg576O6aOfOiBcXFwiZm9vZFxcXCIsXFxyXFxuICAgICAgICAgICAg5peF6KGMOiBcXFwidHJhdmVsXFxcIixcXHJcXG4gICAgICAgICAgICDlhL/nq6U6IFxcXCJjaGlsZFxcXCIsXFxyXFxuICAgICAgICAgICAg5Lq65oCnOiBcXFwiaHVtYW5pdHlcXFwiLFxcclxcbiAgICAgICAgICAgIOWutuW6rTogXFxcImZhbWlseVxcXCIsXFxyXFxuICAgICAgICAgICAg5paH6Im6OiBcXFwibGl0ZXJhcnlfYXJ0XFxcIixcXHJcXG4gICAgICAgICAgICDlsI/or7TmlLnnvJY6IFxcXCJub3ZlbFxcXCIsXFxyXFxuICAgICAgICAgICAg5oSf5Lq6OiBcXFwibW92aW5nXFxcIixcXHJcXG4gICAgICAgICAgICDlirHlv5c6IFxcXCJpbnNwaXJhdGlvblxcXCJcXHJcXG4gICAgICAgIH0sXFxyXFxuICAgICAgICBzdWJ0eXBlOiB7XFxyXFxuICAgICAgICAgICAg5YWo6YOoOiBcXFwiXFxcIixcXHJcXG4gICAgICAgICAgICDnlLXlvbE6IFxcXCJtb3ZpZVxcXCIsXFxyXFxuICAgICAgICAgICAg55S16KeG5YmnOiBcXFwidHZcXFwiXFxyXFxuICAgICAgICB9XFxyXFxuICAgIH1cXHJcXG4gICAgZm9yIChsZXQgaSBpbiBpdGVtcykge1xcclxcbiAgICAgICAgZm9yIChsZXQgaiBpbiBpdGVtc1tpXSkge1xcclxcbiAgICAgICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0ZW1wW2ldID09PSBpdGVtc1tpXVtqXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgaiArICcgPC9mb250PjwvYj4nIDogaixcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgodCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdwbGF5bGlzdCcsICd7XFxcInN1YnR5cGVcXFwiOlxcXCJcXFwiLFxcXCJ0eXBlXFxcIjpcXFwiYWxsXFxcIn0nKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0ZW1wW3RbMF1dID0gdFsxXTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJwbGF5bGlzdFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJl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yxcXHJcXG4gICAgICAgIOeUteinhuWJpzogJ3R2J1xcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IGkgaW4gaXRlbXMpIHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IHRlbXAudHlwZSA9PSBpdGVtc1tpXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgaSArICcgPC9mb250PjwvYj4nIDogaSxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGUpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdyYW5rTGlzdCcpKTtcXHJcXG4gICAgICAgICAgICAgICAgdGVtcC50eXBlID0gZTtcXHJcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInJhbmtMaXN0XFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgfSwgaXRlbXNbaV0pXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxuXFxyXFxuICAgIGEucHVzaCh7XFxyXFxuICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcclxcbiAgICB9KVxcclxcblxcclxcbiAgICBsZXQgbGlzdCA9IHtcXHJcXG4gICAgICAgIOWPo+eikeamnOWNlTogJ3JhbmtfbGlzdCcsXFxyXFxuICAgICAgICDlubTluqbmppzljZU6ICd5ZWFyX3JhbmtzJyxcXHJcXG4gICAgICAgIOexu+Wei+amnOWNlT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xcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdyYW5rTGlzdCcpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRlbXAueWVhciA9IGU7XFxyXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwicmFua0xpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgICAgICB9LCB0LmtleSlcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcbiAgICB9IGVsc2UgaWYgKHRlbXAubGlzdCA9PSAnY2F0ZWdvcnlfcmFua3MnKSB7XFxyXFxuICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxyXFxuICAgICAgICB9KVxcclxcbiAgICAgICAgaWYgKCF0ZW1wLmNhdGVnb3J5KSB0ZW1wLmNhdGVnb3J5ID0gdGVtcC5jYXRlZ29yeV9saXN0c1swXS5rZXk7XFxyXFxuICAgICAgICBmb3IgKGxldCB0IG9mIHRlbXAuY2F0ZWdvcnlfbGlzdHMpIHtcXHJcXG4gICAgICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGVtcC5jYXRlZ29yeSA9PSB0LmtleSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgdC50aXRsZSArICcgPC9mb250PjwvYj4nIDogdC50aXRsZSxcXHJcXG4gICAgICAgICA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XCI6XFxcIlxcXCJ9Jyk7XFxyXFxuICAgIGxldCBhID0gW107XFxyXFxuICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY29taW5nJykpO1xcclxcbiAgICBsZXQgY29sb3IgPSBnZXRDb25maWcoJ2Nob29zZUNvbG9yJyk7XFxyXFxuXFxyXFxuICAgIGxldCBpdGVtcyA9IHtcXHJcXG4gICAgICAgIOeUteW9sTogJ21vdmllJyxcXHJcXG4gICAgICAgIOeUteinhuWJpzogJ3R2J1xcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IGkgaW4gaXRlbXMpIHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IHRlbXAudHlwZSA9PT0gaXRlbXNbaV0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIGkgKyAnIDwvZm9udD48L2I+JyA6IGksXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY29taW5nJykpO1xcclxcbiAgICAgICAgICAgICAgICB0ZW1wLnR5cGUgPSBlO1xcclxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiY29taW5nXFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgfSwgaXRlbXNbaV0pXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxuICAgIGxldCByYW5rID0ge1xcclxcbiAgICAgICAg54Ot5bqmOiAnJnNvcnRieT1ob3QnLFxcclxcbiAgICAgICAg5pe26Ze0OiAnJ1xcclxcbiAgICB9XFxyXFxuICAgIGEucHVzaCh7XFxyXFxuICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcclxcbiAgICB9KVxcclxcbiAgICBmb3IgKGxldCBpIGluIHJhbmspIHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IHRlbXAucmFuayA9PT0gcmFua1tpXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgaSArICcgPC9mb250PjwvYj4nIDogaSxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGUpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdjb21pbmcnKSk7XFxyXFxuICAgICAgICAgICAgICAgIHRlbXAucmFuayA9IGU7XFxyXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJjb21pbmdcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICB9LCByYW5rW2ldKVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcbiAgICBsZXQgbG9jYWwgPSB7XFxyXFxuICAgICAgICDlm73lhoU6ICdkb21lc3RpYycsXFxyXFxuICAgICAgICDlhajnkIM6ICdpbnRlcm5hdGlvbmFsJ1xcclxcbiAgICB9XFxyXFxuICAgIGlmICh0ZW1wLnR5cGUgPT0gJ21vdmllJykge1xcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgICAgIGZvciAobGV0IGkgaW4gbG9jYWwpIHtcXHJcXG4gICAgICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGVtcC5sb2NhbCA9PT0gbG9jYWxbaV0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIGkgKyAnIDwvZm9udD48L2I+JyA6IGksXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGUpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY29taW5nJykpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGVtcC5sb2NhbCA9IGU7XFxyXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiY29taW5nXFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICAgICAgfSwgbG9jYWxbaV0pXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgfVxcclxcbiAgICBsZXQgYXJlYSA9IHtcXHJcXG4gICAgICAgIOWFqOmDqDogJycsXFxyXFxuICAgICAgICDnvo7lm706ICcmYXJlYV9maWx0ZXI9YW1lcmljYW4nLFxcclxcbiAgICAgICAg5qyn5rSyOiAnJmFyZWFfZmlsdGVyPWV1cm9wZScsXFxyXFxuICAgICAgICDml6XmnKw6ICcmYXJlYV9maWx0ZXI9amFwYW5lc2UnLFxcclxcbiAgICAgICAg6Z+p5Zu9OiAnJmFyZWFfZmlsdGVyPWtvcmVhbidcXHJcXG4gICAgfVxcclxcbiAgICBpZiAodGVtcC50eXBlID09ICdtb3ZpZScgJiYgdGVtcC5sb2NhbCA9PSAnaW50ZXJuYXRpb25hbCcpIHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgICAgICBmb3IgKGxldCBpIGluIGFyZWEpIHtcXHJcXG4gICAgICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGVtcC5hcmVhID09PSBhcmVhW2ldID8gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPicgKyBpICsgJyA8L2ZvbnQ+PC9iPicgOiBpLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NvbWluZycpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRlbXAuYXJlYSA9IGU7XFxyXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiY29taW5nXFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgI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O1xcclxcblxcclxcbiAgICBsZXQgaSA9IGwubWFwKChlID0+IHtcXHJcXG4gICAgICAgIGxldCB0eXBlID0gZS50eXBlLFxcclxcbiAgICAgICAgICAgIGlkID0gZS5pZCxcXHJcXG4gICAgICAgICAgICB0aXRsZSA9IGUudGl0bGU7XFxyXFxuICAgICAgICBsZXQgdXNlQ29uZmlnID0gZGV0YWlsc1ZpZXdDb25maWdzW2RldGFpbHNWaWV3Q29uZmlncy51c2VdLmNvbmZpZztcXHJcXG4gICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXHJcXG4gICAgICAgIGlmICh1c2VDb25maWcuc3RhcnRzV2l0aCgneycpKSB7XFxyXFxuICAgICAgICAgICAgZXZhbCgndXJsUGFyYW1zID0gJyArIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcIiArICc/dHlwZT0nICsgdHlwZSArICcmaWQ9JyArIGlkKS5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgIC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XFxyXFxuXFxyXFxuICAgIGxldCBpdGVtcyA9IHtcXHJcXG4gICAgICAgIOeUteW9sToge1xcclxcbiAgICAgICAgICAgIOWunuaXtueDremXqOeUteW9sTogJ21vdmllX3JlYWxfdGltZV9ob3Rlc3QnLFxcclxcbiAgICAgICAgICAgIOS4gOWRqOWPo+eikeeUteW9sTogJ21vdmllX3dlZWtseV9iZXN0JyxcXHJcXG4gICAgICAgICAgICB0b3AyNTDnlLXlvbE6ICdtb3ZpZV90b3AyNTAnXFxyXFxuICAgICAgICB9LFxcclxcbiAgICAgICAg55S16KeG5YmnOiB7XFxyXFxuICAgICAgICAgICAg5a6e5pe254Ot6Zeo5Ymn6ZuGOiAndHZfcmVhbF90aW1lX2hvdGVzdCcsXFxyXFxuICAgICAgICAgICAg5Y2O6K+t5Y+j56KR5Ymn6ZuGOiAndHZfY2hpbmVzZV9iZXN0X3dlZWtseScsXFxyXFxuICAgICAgICAgICAg5YWo55CD5Y+j56KR5Ymn6ZuGOiAndHZfZ2xvYmFsX2Jlc3Rfd2Vla2x5J1xcclxcbiAgICAgICAgfSxcXHJcXG4gICAgICAgIOe7vOiJujoge1xcclxcbiAgICAgICAgICAgIOWbveWGheWPo+eikee7vOiJujogJ3Nob3dfY2hpbmVzZV9iZXN0X3dlZWtseScsXFxyXFxuICAgICAgICAgICAg5Zu95aSW5Y+j56KR57u86Im6OiAnc2hvd19nbG9iYWxfYmVzdF93ZWVrbHknXFxyXFxuICAgICAgICB9XFxyXFxuICAgIH1cXHJcXG4gICAgZm9yIChsZXQgaSBpbiBpdGVtcykge1xcclxcbiAgICAgICAgZm9yIChsZXQgaiBpbiBpdGVtc1tpXSkge1xcclxcbiAgICAgICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0ZW1wLml0ZW0gPT0gaXRlbXNbaV1bal0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIGogKyAnIDwvZm9udD48L2I+JyA6IGosXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGUpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcigncmFua2luZycpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRlbXAuaXRlbSA9IGU7XFxyXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwicmFua2luZ1xcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgICAgIH0sIGl0ZW1zW2ldW2pdKVxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxuXFxyXFxuICAgIGEucHVzaCh7XFxyXFxuICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcclxcbiAgICB9KVxcclxcblxcclxcbiAgICBsZXQgaSA9IFtdO1xcclxcbiAgICBsZXQgcGxheWFibGUgPSB7XFxyXFxuICAgICAgICDlhajpg6jlvbHniYc6ICcwJyxcXHJcXG4gICAgICAgIOS7heacieeJh+a6kDogJzEnXFxyXFxuICAgIH1cXHJcXG4gICAgZm9yIChsZXQgciBpbiBwbGF5YWJsZSkge1xcclxcbiAgICAgICAgaS5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGVtcC5wbGF5YWJsZSA9PSBwbGF5YWJsZVtyXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgciArICcgPC9mb250PjwvYj4nIDogcixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6IC8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcigncmFua2luZycpKTtcXHJcXG4gICAgICAgICAgICAgICAgdGVtcC5wbGF5YWJsZSA9IGU7XFxyXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJyYW5raW5nXFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgfSwgcGxheWFibGVbcl0pXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxuXFxyXFxuICAgIGkucHVzaCh7XFxyXFxuICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPuivhOWIhuWMuumXtDonICsgdGVtcC5zY29yZSArICcgPC9mb250PjwvYj4nLFxcclxcbiAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgIHVybDogJCh0ZW1wLnNjb3JlLCAn6K+E5YiG5bqU5ZyoMC0xMOS5i+mXtCcpLmlucHV0KCgpID0+IHtcXHJcXG4gICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ3JhbmtpbmcnKSk7XFxyXFxuICAgICAgICAgICA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WFwKChlID0+IHtcXHJcXG4gICAgICAgIGxldCB0eXBlID0gZS50eXBlLFxcclxcbiAgICAgICAgICAgIGlkID0gZS5pZCxcXHJcXG4gICAgICAgICAgICB0aXRsZSA9IGUudGl0bGU7XFxyXFxuICAgICAgICBsZXQgdXNlQ29uZmlnID0gZGV0YWlsc1ZpZXdDb25maWdzW2RldGFpbHNWaWV3Q29uZmlncy51c2VdLmNvbmZpZztcXHJcXG4gICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXHJcXG4gICAgICAgIGlmICh1c2VDb25maWcuc3RhcnRzV2l0aCgneycpKSB7XFxyXFxuICAgICAgICAgICAgZXZhbCgndXJsUGFyYW1zID0gJyArIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcIiArICc/dHlwZT0nICsgdHlwZSArICcmaWQ9JyArIGlkKS5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICByZXR1cm4ge1xcclx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G4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgIH0sIHBsYXlhYmxlW3JdKVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBpLnB1c2goe1xcclxcbiAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz7or4TliIbljLrpl7Q6JyArIHRlbXAuc2NvcmUgKyAnIDwvZm9udD48L2I+JyxcXHJcXG4gICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxyXFxuICAgICAgICB1cmw6ICQodGVtcC5zY29yZSwgJ+ivhOWIhuW6lOWcqDAtMTDkuYvpl7QnKS5pbnB1dCgoKSA9PiB7XFxyXFxuICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdkb3VMaXN0JykpO1xcclxcbiAgICAgICAgICAgIGxldCBpbnB1dHMgPSBpbnB1dC5zcGxpdCgnLScpO1xcclxcbiAgICAgICAgICAgIGlmIChpbnB1dHMubGVuZ3RoID09IDIgJiYgaW5wdXRzLmV2ZXJ5KGUgPT4gZSA+PSAwICYmIGUgPD0gMTApICYmIHBhcnNlRmxvYXQoaW5wdXRzWzBdKSA8IGlucHV0c1sxXSkge1xcclxcbiAgICAgICAgICAgICAgICB0ZW1wLnNjb3JlID0gaW5wdXQ7XFxyXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJkb3VMaXN0XFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+ato+ehrui+k+WFpSdc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iAodGVtcC5zY29yZSAhPSAnMC0xMCcpIHtcXHJcXG4gICAgICAgIGwgPSBsLmZpbHRlcihlID0+IHtcXHJcXG4gICAgICAgICAgICBsZXQgciA9IHRlbXAuc2NvcmUuc3BsaXQoJy0nKTtcXHJcXG4gICAgICAgICAgICByZXR1cm4gZS5jb250ZW50LnN1YmplY3QucmF0aW5nICYmIGUuY29udGVudC5zdWJqZWN0LnJhdGluZy52YWx1ZSA8IHJbMV0gJiYgZS5jb250ZW50LnN1YmplY3QucmF0aW5nLnZhbHVlID4gclswXTtcXHJcXG4gICAgICAgIH0pO1xcclxcbiAgICB9XFxyXFxuXFxyXFxuICAgIGxldCBkZXRhaWxzVmlld0NvbmZpZ3MgPSBnZXRDb25maWcoJ2RldGFpbHNWaWV3Q29uZmlncycpO1xcclxcbiAgICBsZXQgciA9IGwubWFwKChlID0+IHtcXHJcXG4gICAgICAgIGxldCB0eXBlID0gZS5jb250ZW50LnN1YmplY3QudHlwZSxcXHJcXG4gICAgICAgICAgICBpZCA9IGUuY29udGVudC5zdWJqZWN0LmlkLFxcclxcbiAgICAgICAgICAgIHRpdGxlID0gZS5jb250ZW50LnN1YmplY3QudGl0bGU7XFxyXFxuICAgICAgICBsZXQgdXNlQ29uZmlnID0gZGV0YWlsc1ZpZXdDb25maWdzW2RldGFpbHNWaWV3Q29uZmlncy51c2VdLmNvbmZpZztcXHJcXG4gICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXHJcXG4gICAgICAgIGlmICh1c2VDb25maWcuc3RhcnRzV2l0aCgneycpKSB7XFxyXFxuICAgICAgICAgICAgZXZhbCgndXJsUGFyYW1zID0gJyArIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcIiArICc/dHlwZT0nICsgdHlwZSArICcmaWQ9JyArIGlkKS5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICByZXR1cm4ge1xcclxcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXHJcXG4gICAgICAgICAgICB1cmw6IHVybFBhcmFtcy51cmwsXFxyXFxuICAgICAgICAgICAgZXh0cmE6IHVybFBhcmFtcy5leHRyYSxcXHJcXG4gICAgICAgICAgICBpbWc6IGUuY29udGVudC5zdWJqZWN0LnBpYy5ub3JtYWwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGUuY29udGVudC5zdWJqZWN0LnBpYy5ub3JtYWwsXFxyXFxuICAgICAgICAgICAgZGVzYzogZS5jb250ZW50LnN1YmplY3QuY2FyZF9zdWJ0aXRsZS5zcGxpdChcXFwiL1xcXCIpLmZpbHRlcigoKGUsIHQpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKHQgPCAzKSByZXR1cm4gZVxcclxcbiAgICAgICAgICAgIH0pKS5qb2luKFxcXCIsXFxcIikgKyBcXFwiXFxcXG5cXFwiICsgKGUuY29udGVudC5zdWJqZWN0LnJhdGluZyA/IGNvbXB1dGVSYXRpbmcoZS5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c2goe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogZS50aXRsZSArIChlLmVwaXNvZGVzX2luZm8gPyBcXFwi4oCiXFxcIiArIGUuZXBpc29kZXNfaW5mbyA6IFxcXCJcXFwiKSxcXHJcXG4gICAgICAgICAgICAgICAgaW1nOiBlLmljb24sXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBjb2xbMF0gfHwgXFxcImljb25fMlxcXCIsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eT9pZD0nICsgaWQgKyAnJnR5cGU9JyArIHR5cGUgKyAnJnRpdGxlPScgKyBlLnRpdGxlKS5ydWxlKChyZXMsIGlkLCBlLCBsYXp5LCBleHRyYSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gcmVzLnRpdGxlLFxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBpYyA9IHJlcy5waWMubm9ybWFsICsgXFxcIkBSZWZlcmVyPVxcXCIgKyByZXMucGljLm5vcm1hbDtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZShlLnRpdGxlICsgJy0nICsgdGl0bGUpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRQYWdlUGljVXJsKHBpYyk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVybHMgPSBnZXRUdlVybHMoaWQsIGUuaWQpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGF6eSA9ICQoXFxcIlxcXCIpLmxhenlSdWxlKGxhenkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZXN1bHRVcmwgPSBcXFwidG9hc3Q6Ly/op6PmnpDlpLHotKVcXFwiO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsYXp5LnN0YXJ0c1dpdGgoXFxcIihcXFwiKSkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCgncmVzdWx0VXJsID0gJyArIGxhenkpXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKCdyZXN1bHRVcmwgPSAnICsgJygoKSA9PiB7JyArIGxhenkgKyAnfSkoKScpXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZyhlLm1lc3NhZ2UpXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHRVcmxcXHJcXG4gICAgICAgICAgICAgICAgICAgIH0sIGxhenkpXFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQgZCA9IFtdO1xcclxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZih1cmxzKSA9PSBcXFwib2JqZWN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkID0gW107XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB1cmxzLmxlbmd0aDsgaSsrKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+esrCcgKyAoaSArIDEpICsgJ+mbhicsXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfNCcsXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGxhenkgPyB1cmxzW2ldICsgbGF6eSA6IHVybHNbaV0sXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogZXh0cmFcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YodXJscykgPT0gXFxcInN0cmluZ1xcXCIgJiYgdXJscyA9PSAn6KKr5bCBaXAnKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJ1bGUgPSBKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9yZWxlYXNlSVA/cnVsZT3pnZLosYZcXFwiKSlcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnJ1bGU7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZW9mKHVybHMpID09ICdzdHJpbmcnICYmIHVybHMgPT0gJ+ayoeacieaUtuW9lScpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZCA9IFtdO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn6LGG55Oj5rKh5pyJ5pS25b2V5q2k6KeG6aKR5rqQ55qE6K+m57uG5L+h5oGvJyxcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogJ+eCueaIkeWPr+S7peWOu+inhumikea6kOe9keermeeci+eciycsXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogZS51cmxcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgfSwgcmVzLCBpZCwgZSwgbGF6eSwgZXh0cmEpXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PT0gJ21vdmllJykge1xcclxcbiAgICAgICAgICAgIGxldCBtTGF6eSA9ICQoXFxcIlxcXCIpLmxhenlSdWxlKGxhenkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgcmVzdWx0VXJsID0gXFxcInRvYXN0Oi8v6Kej5p6Q5aSx6LSlXFxcIjtcXHJcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGlmIChsYXp5LnN0YXJ0c1dpdGgoXFxcIihcXFwiKSkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoJ3Jlc3VsdFVybCA9ICcgKyBsYXp5KVxcclxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKCdyZXN1bHRVcmwgPSAnICsgJygoKSA9PiB7JyArIGxhenkgKyAnfSkoKScpXFxyXFxuICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhlLm1lc3NhZ2UpXFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdFVybFxcclxcbiAgICAgICAgICAgIH0sIGxhenkpXFxyXFxuICAgICAgICAgICAgZC5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGUudGl0bGUgKyAoZS5lcGlzb2Rlc19pbmZvID8gXFxcIuKAolxcXCIgKyBlLmVwaXNvZGVzX2luZm8gOiBcXFwiXFxcIiksXFxyXFxuICAgICAgICAgICAgICAgIGltZzogZS5pY29uLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogY29sWzFdIHx8IFxcXCJpY29uX3NtYWxsXzRcXFwiLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6IG1MYXp5ID8gZS51cmwgKyBtTGF6eSA6IGUudXJsLFxcclxcbiAgICAgICAgICAgICAgICBleHRyYTogZXh0cmFcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcbiAgICB9XFxyXFxufVxcclxcblxcclxcbi8v6I635Y+W55S16KeG5Ymn5YiG6ZuG6ZO+5o6lLGlk5piv54mH5a2Q57yW5Y+3LHVpZOaYr+inhumikea6kOe8luWPt1xcclxcbmZ1bmN0aW9uIGdldFR2VXJscyhpZCwgdWlkKSB7XFxyXFxuICAgIGxldCBjb29raWVDYWNoZSA9ICdoaWtlcjovL2ZpbGVzL2NhY2hlL2RvdWJhbmNvb2tpZS50eHQnO1xcclxcbiAgICBsZXQgbVVybCA9ICdodHRwczovL21vdmllLmRvdWJhbi5jb20vc3ViamVjdC8nICsgaWQgKyAnLyc7XFxyXFxuICAgIGxldCBoZWFkZXJzID0ge1xcclxcbiAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBQQ19VQSxcXHJcXG4gICAgfVxcclxcbiAgICBpZiAoZmlsZUV4aXN0KGNvb2tpZUNhY2hlKSkge1xcclxcbiAgICAgICAgaGVhZGVyc1tcXFwiQ29va2llXFxcIl0gPSBmZXRjaChjb29raWVDYWNoZSlcXHJcXG4gICAgfVxcclxcbiAgICBsZXQgaHRtbCA9IHJlcXVlc3QobVVybCwge1xcclxcbiAgICAgICAgaGVhZGVyczogaGVhZGVyc1xcclxcbiAgICB9KVxcclxcbiAgICBpZiAoKGh0bWwuaW5jbHVkZXMoXFxcIueZu+W9lei3s+i9rFxcXCIpICYmIGh0bWwuaW5jbHVkZXMoXFxcIuW8guW4uOivt+axglxcXCIpKSB8fCAoaHRtbC5pbmNsdWRlcyhcXFwid2luZG93LmxvY2F0aW9uLmhyZWZcXFwiKSAmJiBodG1sLmluY2x1ZGVzKFxcXCJzZWMuZG91YmFuXFxcIikpKSB7XFxyXFxuICAgICAgICByZXR1cm4gJ+iiq+WwgWlwJztcXHJcXG4gICAgfSBlbHNlIHtcXHJcXG4gICAgICAgIGxldCBzID0ge1xcclxcbiAgICAgICAgICAgIHFxOiAxLFxcclxcbiAgICAgICAgICAgIHlvdWt1OiAzLFxcclxcbiAgICAgICAgICAgIGxldHY6IDYsXFxyXFxuICAgICAgICAgICAgbWd0djogNyxcXHJcXG4gICAgICAgICAgICBiaWxpYmlsaTogOCxcXHJcXG4gICAgICAgICAgICBpcWl5aTogOSxcXHJcXG4gICAgICAgICAgICBjbnR2OiAxMixcXHJcXG4gICAgICAgICAgICBjY3R2NjogMTMsXFxyXFxuICAgICAgICAgICAgbWlndXZpZGVvOiAxNSxcXHJcXG4gICAgICAgICAgICB4aWd1YTogMTcsXFxyXFxuICAgICAgICAgICAgYWNmdW46IDE4LFxcclxcbiAgICAgICAgICAgIG1haWR1aWR1aTogMTlcXHJcXG4gICAgICAgIH07XFxyXFxuICAgICAgICBsZXQgbnVtID0gc1t1aWRdO1xcclxcblxcclxcbiAgICAgICAgdmFyIHNvdXJjZXMgPSB7fTtcXHJcXG4gICAgICAgIGxldCBzbCA9IGh0bWwubWF0Y2goL3NvdXJjZXNcXFxcW1sxLTldezEsMn1cXFxcXVtcXFxcc1xcXFxTXSo/XFxcXF0vZyk7XFxyXFxuICAgICAgICBpZiAoc2wpIHtcXHJcXG4gICAgICAgICAgICBmb3IgKHZhciBpIGluIHNsKSB7XFxyXFxuICAgICAgICAgICAgICAgIGV2YWwoc2xbaV0pO1xcclxcbiAgICAgICAgICAgIH1cXHJcXG4gICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgbGV0IHNjcmlwdF9saXN0ID0gcGFyc2VEb21Gb3JBcnJheShodG1sLCAnYm9keSYmc2NyaXB0W3NyY10nKTtcXHJcXG4gICAgICAgICAgICBsZXQgc291cmNlc191cmwgPSBcXFwiXFxcIjtcXHJcXG4gICAgICAgICAgICBmb3IgKGxldCBpIGluIHNjcmlwdF9saXN0KSB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB1cmwgPSBwYXJzZURvbUZvckh0bWwoc2NyaXB0X2xpc3RbaV0sICdzY3JpcHQmJnNyYycpO1xcclxcbiAgICAgICAgICAgICAgICBpZiAodXJsLmluZGV4T2YoJ21peGVkX3N0YXRpYycpICE9PSAtMSkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgc291cmNlc191cmwgPSB1cmw7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgbGV0IHNvdXJjZXNfbGlzdCA9IHJlcXVlc3Qoc291cmNlc191cmwpLm1hdGNoKC9zb3VyY2VzXFxcXFtbMS05XXsxLDJ9XFxcXF1bXFxcXHNcXFxcU10qP1xcXFxdL2cpO1xcclxcbiAgICAgICAgICAgIGZvciAodmFyIGkgaW4gc291cmNlc19saXN0KSB7XFxyXFxuICAgICAgICAgICAgICAgIGV2YWwoc291cmNlc19saXN0W2ldKTtcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9XFxyXFxuXFxyXFxuICAgICAgICBsZXQgcmVuID0gc291cmNlc1tudW1dO1xcclxcbiAgICAgICAgaWYgKHJlbiAmJiByZW4ubGVuZ3RoID4gMCkge1xcclxcbiAgICAgICAgICAgIC8qdmFyIHIgPSByZW4ubWFwKGUgPT4gdW5lc2NhcGU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lnS2V5ID09PSAndXNlJykgY29udGludWU7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBjb25maWdLZXkgPT09IGRldGFpbHNWaWV3Q29uZmlncy51c2UgPyBcXFwi4oCc4oCcXFxcIiArIGNvbmZpZ0tleSArIFxcXCLigJ3igJ1cXFwiIDogY29uZmlnS2V5LFxcbiAgICAgICAgICAgIHVybDogJChcXFwiaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoY29uZmlnS2V5ID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSlcXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5kZXRhaWxzVmlld0NvbmZpZ3MudXNlID09PSBjb25maWdLZXkpIHtcXG4gICAgICAgICAgICAgICAgICAgIC8vcHV0TXlWYXIoXFxcImlucHV0X2NvbmZpZ190eXBlXFxcIiwgJ+W9seeJh+ivpuaDhemhtemdoumFjee9ricpXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaW5wdXRfbmFtZVxcXCIsIGNvbmZpZ0tleSk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaW5wdXRfY29kZVxcXCIsIGNvbmZpZy5kZXRhaWxzVmlld0NvbmZpZ3NbY29uZmlnS2V5XS5jb25maWcpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImlucHV0X3NldHRpbmdfY29kZVxcXCIsIGNvbmZpZy5kZXRhaWxzVmlld0NvbmZpZ3NbY29uZmlnS2V5XS5zZXR0aW5nIHx8IFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3NldHRpbmctZWRpdG9yP3J1bGU96Z2S6LGGJnZpZXc9ZGV0YWlsVmlld01vZGVFZGl0UGFnZSc7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgY29uZmlnLmRldGFpbHNWaWV3Q29uZmlncy51c2UgPSBjb25maWdLZXlcXG4gICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIh+aNouaIkOWKnydcXG4gICAgICAgICAgICB9LCBjb25maWdLZXkpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nXFxuICAgICAgICB9KVxcbiAgICB9XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbiAgICB9KVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfinpUnLFxcbiAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxuICAgICAgICB1cmw6ICdoaWtlcjovL3BhZ2Uvc2V0dGluZy1lZGl0b3I/cnVsZT3pnZLosYYmdmlldz1kZXRhaWxWaWV3TW9kZUVkaXRQYWdlJ1xcbiAgICB9KTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn4p6WJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAkKE9iamVjdC5rZXlzKGRldGFpbHNWaWV3Q29uZmlncykuZmlsdGVyKGNvbmZpZ0tleSA9PiBjb25maWdLZXkgIT09ICd1c2UnICYmIGNvbmZpZ0tleSAhPT0gJ+m7mOiupCcpLCAyKVxcbiAgICAgICAgICAgIC5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT09ICfpu5jorqQnKSByZXR1cm4gJ3RvYXN0Oi8v6buY6K6k6YWN572u5peg5rOV5Yig6Zmk77yBJ1xcbiAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKVxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT09IGNvbmZpZy5kZXRhaWxzVmlld0NvbmZpZ3MudXNlKSByZXR1cm4gJ3RvYXN0Oi8v6K+l6YWN572u5q2j5Zyo5L2/55So77yM5peg5rOV5Yig6Zmk77yBJ1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJCgn56Gu6K6k5Yig6ZmkXFxcIicgKyBpbnB1dCArICdcXFwi77yfJykuY29uZmlybSgoY29uZmlnLCBjb25maWdLZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBjb25maWcuZGV0YWlsc1ZpZXdDb25maWdzW2NvbmZpZ0tleV1cXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIoOmZpCcgKyBjb25maWdLZXkgKyAn5oiQ5YqfJ1xcbiAgICAgICAgICAgICAgICB9LCBjb25maWcsIGlucHV0KVxcbiAgICAgICAgICAgIH0pXFxuICAgIH0pXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ/Cfk50nLFxcbiAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxuICAgICAgICB1cmw6ICQoT2JqZWN0LmtleXMoZGV0YWlsc1ZpZXdDb25maWdzKS5maWx0ZXIoY29uZmlnS2V5ID0+IGNvbmZpZ0tleSAhPT0gJ3VzZScpLCAyKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgIC8vIGlmIChpbnB1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VyOi8vcGFnZS91dGlscycpKS5ydWxlKVxcbiAgICAgICAgICAgIGxldCBjb25maWcgPSBnZXRDb25maWcoKTtcXG4gICAgICAgICAgICBsZXQgc2VsZWN0Q29uZmlnID0ge1xcbiAgICAgICAgICAgICAgICBuYW1lOiBpbnB1dCxcXG4gICAgICAgICAgICAgICAgZGF0YTogY29uZmlnLmRldGFpbHNWaWV3Q29uZmlnc1tpbnB1dF1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICQoQ29uZmlnVG9vbC5lbmNUeXBlTGlzdCwgMikuc2VsZWN0KChzZWxlY3RDb25maWcpID0+IHtcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS91dGlscycpKS5ydWxlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gQ29uZmlnVG9vbC50b0NsaXBib2FyZChDb25maWdUb29sLmV4cG9ydChzZWxlY3RDb25maWcubmFtZSwgc2VsZWN0Q29uZmlnLCBcXFwi5b2x54mH6K+m5oOF6aG16Z2i6YWN572uXFxcIiwgaW5wdXQpKVxcbiAgICAgICAgICAgIH0sIHNlbGVjdENvbmZpZylcXG4gICAgICAgIH0pXFxuICAgIH0pXFxufVxcbi8vIOivpuaDhemhteiuvue9ruaooeWdl1xcbmZ1bmN0aW9uIGRldGFpbFZpZXdTZXR0aW5nTW9kdWxlKGQpIHtcXG4gICAgbGV0IGRldGFpbHNWaWV3Q29uZmlncyA9IGdldENvbmZpZygnZGV0YWlsc1ZpZXdDb25maWdzJyk7XFxuICAgIGRldGFpbFZpZXdNb2RlTW9kdWxlKGQsIGRldGFpbHNWaWV3Q29uZmlncylcXG4gICAgbGV0IGRldGFpbFZpZXdTZXR0aW5nID0gZGV0YWlsc1ZpZXdDb25maWdzW2RldGFpbHNWaWV3Q29uZmlncy51c2VdLnNldHRpbmdcXG4gICAgbGV0IHJlc3VsdCA9IFxcXCJ0b2FzdDovL+ivpeivpuaDhemhteaXoOiuvue9rumhtemdolxcXCI7XFxuICAgIGlmIChkZXRhaWxWaWV3U2V0dGluZykge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBpZiAoZGV0YWlsVmlld1NldHRpbmcuaW5kZXhPZigncmV0dXJuJykgPT0gLTEpIHRocm93IG5ldyBFcnJvcign5b+F6aG7IHJldHVybiBAcnVsZT1qczog5oiWICQoKS5ydWxlJyk7XFxuICAgICAgICAgICAgaWYgKGRldGFpbFZpZXdTZXR0aW5nLnN0YXJ0c1dpdGgoXFxcIihcXFwiKSkge1xcbiAgICAgICAgICAgICAgICBldmFsKCdyZXN1bHQgPSAnICsgZGV0YWlsVmlld1NldHRpbmcpXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgZXZhbCgncmVzdWx0ID0gJyArICcoKCkgPT4geycgKyBkZXRhaWxWaWV3U2V0dGluZyArICd9KSgpJylcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgbG9nKGUubWVzc2FnZSk7XFxuICAgICAgICAgICAgcmVzdWx0ID0gXFxcInRvYXN0Oi8v6ZSZ6K+v55qE6K6+572u6aG16Z2i5Luj56CBLOivt+WJjeW+gCDml6Xlv5cg5p+l55yL6ZSZ6K+v5Y6f5ZugXFxcIlxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+Kame+4jycsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogcmVzdWx0XFxuICAgIH0pXFxufVxcblxcbi8vIOmmlumhteiuvue9ruaooeWdl1xcbmZ1bmN0aW9uIGhvbWVQYWdlU2V0dGluZ01vZHVsZShkKSB7XFxuICAgIGxldCBob21lUGFnZUNvbmZpZ3MgPSBnZXRDb25maWcoJ2hvbWVQYWdlQ29uZmlncycpO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfoh6rlrprkuYnpppbpobUnLmJvbGQoKSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcbiAgICB9KVxcbiAgICBmb3IgKGxldCBjb25maWdLZXkgb2YgT2JqZWN0LmtleXMoaG9tZVBhZ2VDb25maWdzKSkge1xcbiAgICAgICAgaWYgKGNvbmZpZ0tleSA9PT0gJ3VzZScpIGNvbnRpbnVlO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogY29uZmlnS2V5ID09PSBob21lUGFnZUNvbmZpZ3MudXNlID8gXFxcIuKAnOKAnFxcXCIgKyBjb25maWdLZXkgKyBcXFwi4oCd4oCdXFxcIiA6IGNvbmZpZ0tleSxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKGNvbmZpZ0tleSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpXFxuICAgICAgICAgICAgICAgIGlmIChjb25maWcuaG9tZVBhZ2VDb25maWdzLnVzZSA9PT0gY29uZmlnS2V5KSB7XFxuICAgICAgICAgICAgICAgICAgICAvL3B1dE15VmFyKFxcXCJpbnB1dF9jb25maWdfdHlwZVxcXCIsICfpppbpobXphY3nva4nKVxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImlucHV0X25hbWVcXFwiLCBjb25maWdLZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImlucHV0X2NvZGVcXFwiLCBjb25maWcuaG9tZVBhZ2VDb25maWdzW2NvbmZpZ0tleV0uY29uZmlnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3NldHRpbmctZWRpdG9yP3J1bGU96Z2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AndG9hc3Q6Ly/pu5jorqTphY3nva7ml6Dms5XliKDpmaTvvIEnXFxuICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gY29uZmlnLmhvbWVQYWdlQ29uZmlncy51c2UpIHJldHVybiAndG9hc3Q6Ly/or6XphY3nva7mraPlnKjkvb/nlKjvvIzml6Dms5XliKDpmaTvvIEnXFxuICAgICAgICAgICAgICAgIHJldHVybiAkKCfnoa7orqTliKDpmaRcXFwiJyArIGlucHV0ICsgJ1xcXCLvvJ8nKS5jb25maXJtKChjb25maWcsIGNvbmZpZ0tleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGNvbmZpZy5ob21lUGFnZUNvbmZpZ3NbY29uZmlnS2V5XVxcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5Yig6ZmkJyArIGNvbmZpZ0tleSArICfmiJDlip8nXFxuICAgICAgICAgICAgICAgIH0sIGNvbmZpZywgaW5wdXQpXFxuICAgICAgICAgICAgfSlcXG4gICAgfSlcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn8J+TnScsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJChPYmplY3Qua2V5cyhob21lUGFnZUNvbmZpZ3MpLmZpbHRlcihjb25maWdLZXkgPT4gY29uZmlnS2V5ICE9PSAndXNlJyksIDIpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgLy8gaWYgKGlucHV0ID09PSAn6buY6K6kJykgcmV0dXJuICd0b2FzdDovL+m7mOiupOmFjee9ruaXoOazlee8lui+ke+8gSdcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKTtcXG4gICAgICAgICAgICBsZXQgY29uZmlnS2V5ID0gaW5wdXQ7XFxuICAgICAgICAgICAgcHV0TXlWYXIoXFxcImlucHV0X25hbWVcXFwiLCBjb25maWdLZXkpO1xcbiAgICAgICAgICAgIHB1dE15VmFyKFxcXCJpbnB1dF9jb2RlXFxcIiwgY29uZmlnLmhvbWVQYWdlQ29uZmlnc1tjb25maWdLZXldLmNvbmZpZyk7XFxuICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2Uvc2V0dGluZy1lZGl0b3I/cnVsZT3pnZLosYYmdmlldz1ob21lUGFnZU1vZGVFZGl0UGFnZSc7XFxuICAgICAgICB9KVxcbiAgICB9KVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfwn5OlJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5Y+j5LukXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgIGlmICghaW5wdXQuaW5jbHVkZXMoXFxcIummlumhtemFjee9rlxcXCIpKSByZXR1cm4gXFxcInRvYXN0Oi8v6K+l5Y+j5Luk5LiN5piv6aaW6aG16YWN572uXFxcIjtcXG4gICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL3V0aWxzJykpLnJ1bGUpXFxuICAgICAgICAgICAgbGV0IGltcG9ydENvbmZpZ3MgPSBDb25maWdUb29sLmltcG9ydChpbnB1dCk7XFxuICAgICAgICAgICAgaWYgKCFpbXBvcnRDb25maWdzKSByZXR1cm4gXFxcInRvY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0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKVxcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmFuYWx5c2lzQ29uZmlncy51c2UgPT09IGNvbmZpZ0tleSkge1xcbiAgICAgICAgICAgICAgICAgICAgLy9wdXRNeVZhcihcXFwiaW5wdXRfY29uZmlnX3R5cGVcXFwiLCAn6Kej5p6Q5o+S5Lu26YWN572uJylcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJpbnB1dF9uYW1lXFxcIiwgY29uZmlnS2V5KTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJpbnB1dF9jb2RlXFxcIiwgY29uZmlnLmFuYWx5c2lzQ29uZmlnc1tjb25maWdLZXldLmNvbmZpZyk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaW5wdXRfZXh0cmFcXFwiLCBjb25maWcuYW5hbHlzaXNDb25maWdzW2NvbmZpZ0tleV0uZXh0cmEgfHwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImlucHV0X3NldHRpbmdfY29kZVxcXCIsIGNvbmZpZy5hbmFseXNpc0NvbmZpZ3NbY29uZmlnS2V5XS5zZXR0aW5nIHx8IFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3NldHRpbmctZWRpdG9yP3J1bGU96Z2S6LGGJnZpZXc9YW5hbHlzaXNNb2RlRWRpdFBhZ2UnO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGNvbmZpZy5hbmFseXNpc0NvbmZpZ3MudXNlID0gY29uZmlnS2V5XFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKVxcbiAgICAgICAgICAgICAgICByZWZyZXNo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PT0gY29uZmlnLmFuYWx5c2lzQ29uZmlncy51c2UpIHJldHVybiAndG9hc3Q6Ly/or6Xop6PmnpDmraPlnKjkvb/nlKjvvIzml6Dms5XliKDpmaTvvIEnXFxuICAgICAgICAgICAgICAgIHJldHVybiAkKCfnoa7orqTliKDpmaRcXFwiJyArIGlucHV0ICsgJ1xcXCLvvJ8nKS5jb25maXJtKChjb25maWcsIGNvbmZpZ0tleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGNvbmZpZy5hbmFseXNpc0NvbmZpZ3NbY29uZmlnS2V5XVxcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5Yig6ZmkJyArIGNvbmZpZ0tleSArICfmiJDlip8nXFxuICAgICAgICAgICAgICAgIH0sIGNvbmZpZywgaW5wdXQpXFxuICAgICAgICAgICAgfSlcXG4gICAgfSlcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn8J+TnScsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJChPYmplY3Qua2V5cyhhbmFseXNpc0NvbmZpZ3MpLmZpbHRlcihjb25maWdLZXkgPT4gY29uZmlnS2V5ICE9PSAndXNlJyksIDIpXFxuICAgICAgICAgICAgLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgIC8vIGlmIChpbnB1dCA9PT0gJ+S4jeino+aekCcgJiYgaW5wdXQgPT09ICfmlq3mj5InKSByZXR1cm4gJ3RvYXN0Oi8v6buY6K6k6Kej5p6Q5peg5rOV57yW6L6R77yBJ1xcbiAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi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T4ge1xcbiAgICAgICAgICAgIC8vIGlmIChpbnB1dCA9PT0gJ+m7mOiupCcpIHJldHVybiAndG9hc3Q6Ly/pu5jorqTphY3nva7ml6Dms5XnvJbovpHvvIEnXFxuICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS91dGlscycpKS5ydWxlKVxcbiAgICAgICAgICAgIGxldCBjb25maWcgPSBnZXRDb25maWcoKTtcXG4gICAgICAgICAgICBsZXQgc2VsZWN0Q29uZmlnID0ge1xcbiAgICAgICAgICAgICAgICBuYW1lOiBpbnB1dCxcXG4gICAgICAgICAgICAgICAgZGF0YTogY29uZmlnLmFuYWx5c2lzQ29uZmlnc1tpbnB1dF1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICQoQ29uZmlnVG9vbC5lbmNUeXBlTGlzdCwgMikuc2VsZWN0KChzZWxlY3RDb25maWcpID0+IHtcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS91dGlscycpKS5ydWxlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gQ29uZmlnVG9vbC50b0NsaXBib2FyZChDb25maWdUb29sLmV4cG9ydChzZWxlY3RDb25maWcubmFtZSwgc2VsZWN0Q29uZmlnLCBcXFwi6Kej5p6Q5o+S5Lu26YWN572uXFxcIiwgaW5wdXQpKVxcbiAgICAgICAgICAgIH0sIHNlbGVjdENvbmZpZylcXG4gICAgICAgIH0pXFxuICAgIH0pXFxufVxcblxcbi8vIOino+aekOiuvue9ruaooeWdl1xcbmZ1bmN0aW9uIGFuYWx5c2lzU2V0dGluZ01vZHVsZShkKSB7XFxuICAgIGxldCBhbmFseXNpc0NvbmZpZ3MgPSBnZXRDb25maWcoJ2FuYWx5c2lzQ29uZmlncycpO1xcbiAgICBhbmFseXNpc01vZGVNb2R1bGUoZCwgYW5hbHlzaXNDb25maWdzKTtcXG4gICAgLy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ydcXG4gICAgfSlcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn4p6V77iPJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAkKCfmmL7npLrlkI1AQOWwj+eoi+W6j+WQjUBA5Zu+54mH6ZO+5o6lJywgJ+agueaNruaPkOekuui+k+WFpeWwseWlveS6hlxcXFxu5bCP56iL5bqP5ZCN5Li656m65YiZ5Li65rW36ZiU5pCc57SiJykuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKGZldGNoKGdldE15VmFyKCdxZGJfY29uZmlnJykpKTtcXG4gICAgICAgICAgICBpbnB1dCA9IGlucHV0LnNwbGl0KCdAQCcpO1xcbiAgICAgICAgICAgIGlmKGlucHV0Lmxlbmd0aCAhPSAzIHx8IGlucHV0WzBdID09PSBcXFwiXFxcIikgcmV0dXJuIFxcXCJ0b2FzdDovL+agvOW8j+S4jeWvue+8jOaMieagvOW8j+i+k+WFpSFcXFwiO1xcbiAgICAgICAgICAgIGlmIChjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm9yZGVyLmluZGV4T2YoaW5wdXRbMF0pID09IC0xKSBjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm9yZGVyLnB1c2goaW5wdXRbMF0pO1xcbiAgICAgICAgICAgIGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3NbaW5wdXRbMF1dID0ge1xcbiAgICAgICAgICAgICAgICBuYW1lOiBpbnB1dFsxXSxcXG4gICAgICAgICAgICAgICAgcGljOiBpbnB1dFsyXVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5re75Yqg5oiQ5YqfJztcXG4gICAgICAgIH0pXFxuICAgIH0pO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfinpYnLFxcbiAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxuICAgICAgICB1cmw6ICQocXVpY2tTZWFyY2hDb25maWdzLm9yZGVyLCAyKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpXFxuICAgICAgICAgICAgcmV0dXJuICQoJ+ehruiupOWIoOmZpFxcXCInICsgaW5wdXQgKyAnXFxcIu+8nycpLmNvbmZpcm0oKGNvbmZpZywgY29uZmlnS2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBpbmRleCA9IGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3Mub3JkZXIuaW5kZXhPZihjb25maWdLZXkpO1xcbiAgICAgICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm9yZGVyLnNwbGljZShpbmRleCwgMSk7XFxuICAgICAgICAgICAgICAgIGRlbGV0ZSBjb25maWcucXVpY2tTZWFyY2hDb25maWdzW2NvbmZpZ0tleV1cXG4gICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIoOmZpCcgKyBjb25maWdLZXkgKyAn5oiQ5YqfJ1xcbiAgICAgICAgICAgIH0sIGNvbmZpZywgaW5wdXQpXFxuICAgICAgICB9KVxcbiAgICB9KVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfwn5OdJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAkKHF1aWNrU2VhcmNoQ29uZmlncy5vcmRlciwgMikuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKTtcXG4gICAgICAgICAgICBsZXQgcXVpY2tTZWFyY2hDb25maWdzID0gY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncztcXG4gICAgICAgICAgICBsZXQgZHRleHQgPSBpbnB1dCArICdAQCcgKyBxdWlja1NlYXJjaENvbmZpZ3NbaW5wdXRdLm5hbWUgKyAnQEAnICsgcXVpY2tTZWFyY2hDb25maWdzW2lucHV0XS5waWM7XFxuICAgICAgICAgICAgcmV0dXJuICQoZHRleHQsICfor7fkv67mlLknKS5pbnB1dCgoY29uZmlnLCByYXcpID0+IHtcXG4gICAgICAgICAgICAgICAgaW5wdXQgPSBpbnB1dC5zcGxpdCgnQEAnKTtcXG4gICAgICAgICAgICAgICAgaWYgKHJhdyAhPSBpbnB1dFswXSkge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGluZGV4ID0gY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlci5pbmRleE9mKHJhdyk7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm9yZGVyW2luZGV4XSA9IGlucHV0WzBdO1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3NbcmF3XTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlci5pbmRleE9mKGlucHV0WzBdKSA9PSAtMSkgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlci5wdXNoKGlucHV0WzBdKTtcXG4gICAgICAgICAgICAgICAgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlnc1tpbnB1dFswXV0gPSB7XFxuICAgICAgICAgICAgICAgICAgICBuYW1lOiBpbnB1dFsxXSxcXG4gICAgICAgICAgICAgICAgICAgIHBpYzogaW5wdXRbMl1cXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv67mlLnmiJDlip8nO1xcbiAgICAgICAgICAgIH0sIGNvbmZpZywgaW5wdXQpXFxuICAgICAgICB9KVxcbiAgICB9KVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfwn5SBJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMnKS5ydWxlKCgpID0+IHtcXG4gICAgICAgICAgICBhZGRMaXN0ZW5lcignb25DbG9zZScsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdqc29uJyk7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ29wJyk7XFxuICAgICAgICAgICAgfSkpXFxuICAgICAgICAgICAgaWYgKGdldE15VmFyKCdqc29uJykgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgICAgIGxldCBxdWlja1NlYXJjaENvbmZpZ3MgPSBjb25maWcucXVpY2tTZWFyY2hDb25maWdzO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignanNvbicsIEpTT04uc3RyaW5naWZ5KHF1aWNrU2VhcmNoQ29uZmlncykpO1xcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBsZXQgb2xkID0gSlNPTi5wYXJzZShnZXRNeVZhcignanNvbicpKTtcXG4gICAgICAgICAgICBsZXQgZCA9IFtdO1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn5YiG5Yir54K55Ye75Lik6aG55Lul5Lqk5o2i6aG65bqPXFxcXG7igJjigJjmjpLluo/lrozmr5XlkI7ngrnmiJHkv53lrZjmjpLluo8s5ZCm5YiZ5o6S5bqP5LiN55Sf5pWI4oCZ4oCZJyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKGZldGNoKGdldE15VmFyKCdxZGJfY29uZmlnJykpKTtcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3MgPSBKU09OLnBhcnNlKGdldE15VmFyKCdqc29uJykpO1xcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICAgICAgYmFjayh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv67mlLnmiJDlip8nXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBvbGQub3JkZXIuZm9yRWFjaCgodmFsdWUsIGluZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogZ2V0TXlWYXIoJ29wJykgPT0gdmFsdWUgPyB2YWx1ZSArICfigJjigJgo5b2T5YmN6YCJ5LitKeKAmeKAmScgOiB2YWx1ZSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChrZXksIGluZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG9wID0gZ2V0TXlWYXIoJ29wJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wID09ICcnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdvcCcsIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9wID09IGtleSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdvcCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG9sZCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2pzb24nKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdhID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZTogb2xkLm1vZGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcmRlcjogb2xkLm9yZGVyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvcGluZGV4ID0gbmV3YS5vcmRlci5pbmRleE9mKG9wKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKE1hdGguYWJzKG9waW5kZXggLSBpbmRleCkgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlcltvcGluZGV4XSA9IGtleTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld2Eub3JkZXJbaW5kZXhdID0gb3A7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAob3BpbmRleCA+IGluZGV4KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyLnNwbGljZShvcGluZGV4LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld2Eub3JkZXIuc3BsaWNlKGluZGV4LCAwLCBvcCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyLnNwbGljZShvcGluZGV4LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld2Eub3JkZXIuc3BsaWNlKGluZGV4IC0gMSwgMCwgb3ApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld2Eub3JkZXIuZm9yRWFjaCh2YWx1ZSA9PiBuZXdhW3ZhbHVlXSA9IG9sZFt2YWx1ZV0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqc29uJywgSlNPTi5zdHJpbmdpZnkobmV3YSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdvcCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSwgdmFsdWUsIGluZGV4KVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICAgICAgfSlcXG4gICAgfSlcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn4pqZ77iPJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAkKHF1aWNrU2VhcmNoQ29uZmlnc1snbW9kZSddIHx8IFxcXCJcXFwiLCAn6K+35q2j56Gu6L6T5YWl57uE5Lu25qC35byPXFxcXG7lu7rorq7lgLw6ZmxleF9idXR0b24gc2Nyb2xsX2J1dHRvbiBpY29uX3JvdW5kX3NtYWxsXzQgaWNvbl9zbWFsbF80JykuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpO1xcbiAgICAgICAgICAgIGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3MubW9kZSA9IGlucHV0O1xcbiAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+agt+W8j+S/ruaUueaIkOWKnydcXG4gICAgICAgIH0pXFxuICAgIH0pXFxufVxcblxcbi8v6K6+572u6aG16Z2iXFxuZnVuY3Rpb24gc2V0dGluZ1BhZ2UoKSB7XFxuICAgIGxldCBjb25mID0gZ2V0Q29uZmlnKCk7XFxuICAgIGxldCBkID0gW107XFxuXFxuICAgIGxldCBzdGFyQ29sb3IgPSBjb25mLnN0YXJDb2xvciB8fCAnI2ZmYWMyZCc7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnScgKyAn6Ieq5a6a5LmJ5pif5pif6aKc6ImyJy5ib2xkKCksXFxuICAgICAgICBkZXNjOiAn4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9JyArIHN0YXJDb2xvciArICc+JyArICfimIXimIXimIXimIXimIU8L2ZvbnQ+JyxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcXG4gICAgICAgIHVybDogJChzdGFyQ29sb3IsICfliKvlv5jkuoYjJykuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKGZldGNoKGdldE15VmFyKCdxZGJfY29uZmlnJykpKTtcXG4gICAgICAgICAgICBjb25maWcuc3RhckNvbG9yID0gaW5wdXQ7XFxuICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iuvue9ruabtOaUueW3suS/neWtmFxcXCI7XFxuICAgICAgICB9KVxcbiAgICB9KVxcbiAgICBsZXQgY2hvb3NlQ29sb3IgPSBjb25mLmNob29zZUNvbG9yIHx8ICcjRkE3Mjk4JztcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArICfoh6rlrprkuYnpgInkuK3moIfnrb7popzoibInLmJvbGQoKSxcXG4gICAgICAgIGRlc2M6ICfigJzigJzigJ3igJ08Zm9udCBjb2xvcj0nICsgY2hvb3NlQ29sb3IgKyAnPicgKyAn5oiR5piv6aKE6KeI5pWI5p6cPC9mb250PicsXFxuICAgICA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+KAnOKAnOKAneKAnScgKyAn5oGi5aSN6buY6K6k6K6+572uJy5ib2xkKCksXFxuICAgICAgICBkZXNjOiAn6YeN55SfJyxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcXG4gICAgICAgIHVybDogJChbJ+mHjee9ruaYn+aYn+minOiJsicsICfph43nva7pgInkuK3moIfnrb7popzoibInLCAn6YeN572u5b+r6YCf5pCc57SiJywgJ+mHjee9rummlumhteS4uum7mOiupCcsICfph43nva7or6bmg4XpobUnICwgJ+a4hemZpOWFqOmDqOiuvue9riddLCAxKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgIHJldHVybiAkKFxcXCLnoa7lrpropoFcXFwiICsgaW5wdXQgKyBcXFwi77yfXFxcIikuY29uZmlybSgoc2VsKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBpdGVtID0gJyc7XFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoc2VsKSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfph43nva7mmJ/mmJ/popzoibInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAnc3RhckNvbG9yJztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+mHjee9rumAieS4reagh+etvuminOiJsic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbSA9ICdjaG9vc2VDb2xvcic7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfph43nva7lv6vpgJ/mkJzntKInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAncXVpY2tTZWFyY2hDb25maWdzJztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+mHjee9rummlumhteS4uum7mOiupCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbSA9ICdob21lUGFnZUNvbmZpZ3MnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn6YeN572u6K+m5oOF6aG1JzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpdGVtID0gJ2RldGFpbFZpZXdDb25maWdzJztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+a4hemZpOWFqOmDqOiuvue9ric6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbSA9ICdhbGwnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIC8vIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2Uvc2V0dGluZ1BhZ2UnKSkucnVsZSk7XFxuICAgICAgICAgICAgICAgIGxldCBkZWZhdWx0Q29uZmlncyA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2RlZmF1bHRDb25maWdzXFxcIik7XFxuICAgICAgICAgICAgICAgIGlmIChpdGVtID09ICdhbGwnKSB7XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoZGVmYXVsdENvbmZpZ3MpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5beyXFxcIiArIHNlbDtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmKGl0ZW0gPT0gXFxcImhvbWVQYWdlQ29uZmlnc1xcXCIpe1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UoZmV0Y2goZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpO1xcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnW2l0ZW1dW1xcXCLpu5jorqRcXFwiXSA9IGRlZmF1bHRDb25maWdzW2l0ZW1dW1xcXCLpu5jorqRcXFwiXTtcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZ1tpdGVtXS51c2UgPSBcXFwi6buY6K6kXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5beyXFxcIiArIHNlbDtcXG4gICAgICAgICAgICAgICAgfWVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UoZmV0Y2goZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpO1xcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnW2l0ZW1dID0gZGVmYXVsdENvbmZpZ3NbaXRlbV07XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3slxcXCIgKyBzZWw7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBpbnB1dClcXG4gICAgICAgIH0pXFxuICAgIH0pXFxuICAgIHNldFJlc3VsdChkKTtcXG59XFxuXFxubGV0IHZpZXcgPSBnZXRQYXJhbShcXFwidmlld1xcXCIsXFxcIlxcXCIpO1xcbmlmKHZpZXc9PVxcXCJcXFwiKXtcXG4gICAgc2V0UGFnZVRpdGxlKFxcXCLorr7nva5cXFwiKVxc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lzdG9yeSNcXFwiXFxyXFxuICAgIH0pXFxyXFxufVxcclxcbnJldHVybiBkO2BcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgfSxcXHJcXG4gICAgYW5hbHlzaXNDb25maWdzOiB7XFxyXFxuICAgICAgICB1c2U6IFxcXCLkuI3op6PmnpBcXFwiLFxcclxcbiAgICAgICAgXFxcIuS4jeino+aekFxcXCI6IHtcXHJcXG4gICAgICAgICAgICBjb25maWc6ICQudG9TdHJpbmcoKCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gaW5wdXQ7XFxyXFxuICAgICAgICAgICAgfSksXFxyXFxuICAgICAgICAgICAgc2V0dGluZzogJC50b1N0cmluZygoKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/or6Xmj5Lku7bml6Dorr7nva7pobXpnaJcXFwiO1xcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9LFxcclxcbiAgICAgICAgXFxcIuaWreaPklxcXCI6IHtcXHJcXG4gICAgICAgICAgICBjb25maWc6ICQudG9TdHJpbmcoKCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgZmlsZSA9IFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL0R1YW5OaWFuL015UGFyc2UuanNvblxcXCI7XFxyXFxuICAgICAgICAgICAgICAgIGxldCBvbGRmaWxlID0gXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcIjtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChmaWxlKSkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCgnanNvbj0nICsgZmV0Y2goZmlsZSkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGpzVXJsID0ganNvbi5zZXR0aW5ncy5jajtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goanNVcmwpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBheXRtUGFyc2UoaW5wdXQpO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGZpbGVFeGlzdChvbGRmaWxlKSkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGpzVXJsID0gSlNPTi5wYXJzZShmZXRjaChvbGRmaWxlKSkuY2o7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKGZldGNoKGpzVXJsKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXl0bVBhcnNlKGlucHV0KTtcXHJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/msqHmib7liLDmlq3mj5LphY3nva7mlofku7YnO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSksXFxyXFxuICAgICAgICAgICAgc2V0dGluZzogJC50b1N0cmluZygoKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCBmaWxlID0gXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvRHVhbk5pYW4vTXlQYXJzZS5qc29uXFxcIjtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IG9sZGZpbGUgPSBcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb25cXFwiO1xcclxcbiAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KGZpbGUpKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKCdqc29uPScgKyBmZXRjaChmaWxlKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQganNVcmwgPSBqc29uLnNldHRpbmdzLmNqO1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChqc1VybCkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNldFVybDtcXHJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChmaWxlRXhpc3Qob2xkZmlsZSkpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCBqc1VybCA9IEpTT04ucGFyc2UoZmV0Y2gob2xkZmlsZSkpLmNqO1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChqc1VybCkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNldFVybDtcXHJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL1JvdXRlP3J1bGU9TXlGaWVsZOG0sOKBvyZ0eXBlPeiuvue9rlxcXCI7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcbiAgICB9XFxyXFxufVxcclxcbiQuZXhwb3J0cyA9IGRlZmF1bHRDb25maWdzO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5bel5YW36ZuGXCIsXCJwYXRoXCI6XCJ1dGlsc1wiLFwicnVsZVwiOlwianM6XFxyXFxuLy/liJ3lp4vljJbphY3nva4sbmFtZeS4uumFjee9rumhueWQjeensFxcclxcbmZ1bmN0aW9uIGluaXRDb25maWdzKG5hbWUsIGNvbmZpZykge1xcclxcbiAgICBpZiAoIWNvbmZpZykge1xcclxcbiAgICAgICAgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxyXFxuICAgIH1cXHJcXG4gICAgaWYgKGNvbmZpZ1tuYW1lXSA9PSBudWxsKSB7XFxyXFxuICAgICAgICBsZXQgZGVmYXVsdENvbmZpZ3MgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9kZWZhdWx0Q29uZmlnc1xcXCIpO1xcclxcbiAgICAgICAgY29uZmlnW25hbWVdID0gZGVmYXVsdENvbmZpZ3NbbmFtZV0gPyBkZWZhdWx0Q29uZmlnc1tuYW1lXSA6IHt9O1xcclxcbiAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcclxcbiAgICB9XFxyXFxuICAgIHJldHVybiBjb25maWc7XFxyXFxufVxcclxcblxcclxcbi8v6I635Y+W6YWN572u6aG5XFxyXFxuZnVuY3Rpb24gZ2V0Q29uZmlnKG5hbWUsIHJvb3RDb25maWcpIHtcXHJcXG4gICAgbGV0IGNvbmZpZyA9IHJvb3RDb25maWcgPyByb290Q29uZmlnIDogSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxyXFxuICAgIGlmIChuYW1lKSB7XFxyXFxuICAgICAgICBpZiAoY29uZmlnW25hbWVdID09IG51bGwpIHtcXHJcXG4gICAgICAgICAgICBjb25maWcgPSBpbml0Q29uZmlncyhuYW1lLCBjb25maWcpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmV0dXJuIGNvbmZpZ1tuYW1lXTtcXHJcXG4gICAgfSBlbHNlIHtcXHJcXG4gICAgICAgIHJldHVybiBjb25maWc7XFxyXFxuICAgIH1cXHJcXG59XFxyXFxuXFxyXFxuLy/nvJbnoIHlt6XlhbfnsbtcXHJcXG5sZXQgWmlwVG9vbCA9IHtcXHJcXG4gICAgZGVwZW5kZW5jZTogJ2h0dHBzOi8vdW5wa2cuY29tL2x6LXN0cmluZ0AxLjQuNC9saWJzL2x6LXN0cmluZy5taW4uanMnLFxcclxcbiAgICBjb21wcmVzczoge1xcclxcbiAgICAgICAgc2l6ZToge1xcclxcbiAgICAgICAgICAgIGtleTogXFxcInRleHQtY29tcHJlc3Mtc2l6ZVxcXCIsXFxyXFxuICAgICAgICAgICAgc2V0OiAobmV3VmFsdWUpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIodGhpcy5rZXksIG5ld1ZhbHVlLnRvU3RyaW5nKCkpXFxyXFxuICAgICAgICAgICAgfSxcXHJcXG4gICAgICAgICAgICBnZXQ6ICgpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlSW50KGdldE15VmFyKHRoaXMua2V5LCBcXFwiMFxcXCIpKVxcclxcbiAgICAgICAgICAgIH1cXHJcXG4gICAgICAgIH0sXFxyXFxuICAgICAgICBleGVjOiAoaW5wdXQpID0+IHtcXHJcXG4gICAgICAgICAgICBldmFsKHJlcXVlc3QoWmlwVG9vbC5kZXBlbmRlbmNlKSlcXHJcXG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0gTFpTdHJpbmcuY29tcHJlc3NUb0VuY29kZWRVUklDb21wb25lbnQoaW5wdXQpXFxyXFxuICAgICAgICAgICAgICAgIC8vIFppcFRvb2wuY29tcHJlc3Muc2l6ZS5zZXQocmVzdWx0Lmxlbmd0aCAqIDIpXFxyXFxuICAgICAgICAgICAgcmV0dXJuIHJlc3VsdFxcclxcbiAgICAgICAgfVxcclxcbiAgICB9LFxcclxcbiAgICBkZWNvbXByZXNzOiB7XFxyXFxuICAgICAgICBzaXplOiB7XFxyXFxuICAgICAgICAgICAgZ2V0OiAoKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiBnZXRNeVZhcihcXFwidGV4dC1kZWNvbXByZXNzXFxcIiwgXFxcIjBcXFwiKVxcclxcbiAgICAgICAgICAgICAgICAgICAgLmxlbmd0aFxcclxcbiAgICAgICAgICAgIH1cXHJcXG4gICAgICAgIH0sXFxyXFxuICAgICAgICBleGVjOiAoaW5wdXQpID0+IHtcXHJcXG4gICAgICAgICAgICBldmFsKHJlcXVlc3QoWmlwVG9vbC5kZXBlbmRlbmNlKSlcXHJcXG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0gTFpTdHJpbmcuZGVjb21wcmVzc0Zyb21FbmNvZGVkVVJJQ29tcG9uZW50KGlucHV0KVxcclxcbiAgICAgICAgICAgIHJldHV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cGUgKyBcXFwi77+lXFxcIjtcXHJcXG4gICAgICAgIGxldCByZXN1bHQgPSBjb25maWdcXHJcXG4gICAgICAgIGlmICh0eXBlb2YgcmVzdWx0ID09PSBcXFwib2JqZWN0XFxcIikge1xcclxcbiAgICAgICAgICAgIHJlc3VsdCA9IEpTT04uc3RyaW5naWZ5KGNvbmZpZyk7XFxyXFxuICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiByZXN1bHQgPT09IFxcXCJzdHJpbmdcXFwiKSB7XFxyXFxuICAgICAgICAgICAgcmVzdWx0ID0gY29uZmlnO1xcclxcbiAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICB0aHJvdyBcXFwi5a+85Ye65pWw5o2u5LiN5ZCI5rOVXFxcIlxcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgc3dpdGNoIChlbmNUeXBlKSB7XFxyXFxuICAgICAgICAgICAgY2FzZSAnQmFzZTY0JzpcXHJcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gYmFzZTY0RW5jb2RlKHJlc3VsdCk7XFxyXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcclxcbiAgICAgICAgICAgIGNhc2UgJ1ppcHBlcic6XFxyXFxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IFppcFRvb2wuY29tcHJlc3MuZXhlYyhyZXN1bHQpXFxyXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcclxcbiAgICAgICAgICAgIGRlZmF1bHQgOlxcclxcbiAgICAgICAgICAgICAgICBpZiAoZ2V0QXBwVmVyc2lvbigpID4gMjA3MCkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgc3ltYm9sID0gXFxcIumdkuixhuWPo+S7pO+/pVxcXCIgKyByZW1hcmsgKyBcXFwi77+lXFxcIiArIG5hbWVcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IHNoYXJlUGFzdGUoQ29uZmlnVG9vbC5leHBvcnQobmFtZSwgY29uZmlnLCByZW1hcmssICdaaXBwZXInKSxlbmNUeXBlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAnXFxcXG5cXFxcbicgKyBzeW1ib2xcXHJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/or7fmm7TmlrDop4bnlYzniYjmnKzoh7MgQzIwNzAg5Lul5LiKJ1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmVzdWx0ID0gc3ltYm9sICsgcmVzdWx0XFxyXFxuICAgICAgICByZXR1cm4gcmVzdWx0O1xcclxcbiAgICB9LFxcclxcbiAgICBpbXBvcnQ6IChjb25maWdDb21tYW5kKSA9PiB7XFxyXFxuICAgICAgICBsZXQgcmVzdWx0ID0gJydcXHJcXG4gICAgICAgIGlmIChjb25maWdDb21tYW5kLnN0YXJ0c1dpdGgoJ+S6kScpKSB7XFxyXFxuICAgICAgICAgICAgaWYgKGdldEFwcFZlcnNpb24oKSA+IDIwNzApIHtcXHJcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gY29uZmlnQ29tbWFuZC5zcGxpdCgn6Z2S6LGGJylbMF0ucmVwbGFjZSgvXFxcXFxcXFxuLywgJycpXFxyXFxuICAgICAgICAgICAgICAgIGNvbmZpZ0NvbW1hbmQgPSBwYXJzZVBhc3RlKHJlc3VsdClcXHJcXG4gICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6K+35pu05paw6KeG55WM54mI5pys6IezIEMyMDcwIOS7peS4iidcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICB0cnkge1xcclxcbiAgICAgICAgICAgIGxldCByZXN1bHRTcGxpdHMgPSBjb25maWdDb21tYW5kLnNwbGl0KFxcXCLvv6VcXFwiKVxcclxcbiAgICAgICAgICAgIGxldCBlbmNUeXBlID0gcmVzdWx0U3BsaXRzWzNdXFxyXFxuICAgICAgICAgICAgcmVzdWx0ID0gcmVzdWx0U3BsaXRzWzRdXFxyXFxuICAgICAgICAgICAgc3dpdGNoIChlbmNUeXBlKSB7XFxyXFxuICAgICAgICAgICAgICAgIGNhc2UgJ0Jhc2U2NCc6XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBiYXNlNjREZWNvZGUocmVzdWx0KTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcclxcbiAgICAgICAgICAgICAgICBjYXNlICdaaXBwZXInOlxcclxcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gWmlwVG9vbC5kZWNvbXByZXNzLmV4ZWMocmVzdWx0KVxcclxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KTtcXHJcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXHJcXG4gICAgICAgICAgICBsb2coZS5tZXNzYWdlKVxcclxcbiAgICAgICAgICAgIHRocm93IFxcXCLlr7zlhaXmlbDmja7kuI3lkIjms5VcXFwiXFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICByZXR1cm4gcmVzdWx0O1xcclxcbiAgICB9XFxyXFxufVwifV0iLCJpY29uIjoiaHR0cHM6Ly9pMC53cC5jb20vaTAuaW1nMmlwZnMuY29tL2lwZnMvUW1aRXNBNmh3WXlqQWFpS3VvNFVjd2tRMzZpaVVtS3FBWmlMcVJKMTFwWkIyUD9maWxlbmFtZT0lRTklOUQlOTIlRTglQjElODYucG5nIiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment