Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥分类@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJqczpcXG5ldmFsKEpTT04ucGFyc2UocmVxdWVzdChcXFwiaGlrZXI6Ly9wYWdlL21haW5cXFwiKSkucnVsZSk7XFxubGV0IHR5cGUgPSBnZXRQYXJhbSgndHlwZScsICcnKSxcXG4gICAgaWQgPSBnZXRQYXJhbSgnaWQnLCAnJyksXFxuICAgIHRpdGxlID0gZ2V0UGFyYW0oJ3RpdGxlJywgJycpO1xcbmxldCByZXMgPSBnZXREb3ViYW5SZXMoXFxcImh0dHBzOi8vZnJvZG8uZG91YmFuLmNvbS9hcGkvdjIvXFxcIiArIHR5cGUgKyBcXFwiL1xcXCIgKyBpZCk7XFxubGV0IHVwZGF0ZSA9IFxcXCJcXFwiO1xcbmlmICh0aXRsZSA9PSAnJykge1xcbiAgICBsZXQgbGVuZ3RoID0gcmVzLnZlbmRvcnMubGVuZ3RoO1xcbiAgICB1cGRhdGUgKz0gbGVuZ3RoID4gMCA/ICflhbEnICsgbGVuZ3RoICsgJ+S4queJh+a6kCcgOiAn5pqC5peg54mH5rqQJztcXG4gICAgaWYgKGxlbmd0aCA+IDApIHtcXG4gICAgICAgIGxldCBlID0gcmVzLnZlbmRvcnNbMF07XFxuICAgICAgICB1cGRhdGUgKz0gZS5lcGlzb2Rlc19pbmZvID8gXFxcInxcXFwiICsgZS5lcGlzb2Rlc19pbmZvIDogXFxcIlxcXCI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hdGE6IHtcXG4gICAgICAgICAgICBjb25maWc6IHtcXG4gICAgICAgICAgICAgICAga2V5OiBcXFwiaW5wdXRfY29kZVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXovpPlhaXphY3nva5cXFwiLFxcbiAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgIH1cXG4gICAgfVxcbiAqL1xcbmZ1bmN0aW9uIG1vZGVFZGl0UGFnZShkLCBjb25maWdLZXksIHBhcmFtcykge1xcbiAgICBhZGRMaXN0ZW5lcignb25DbG9zZScsICQudG9TdHJpbmcoKHBhcmFtcykgPT4ge1xcbiAgICAgICAgY2xlYXJNeVZhcihwYXJhbXMua2V5KVxcbiAgICAgICAgbGV0IGRhdGFzID0gcGFyYW1zLmRhdGE7XFxuICAgICAgICBsZXQgZGF0YUtleXMgPSBPYmplY3Qua2V5cyhkYXRhcyk7XFxuICAgICAgICBmb3IgKGxldCBpIGluIGRhdGFLZXlzKSB7XFxuICAgICAgICAgICAgbGV0IGRhdGFLZXkgPSBkYXRhS2V5c1tpXVxcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoZGF0YXNbZGF0YUtleV0ua2V5KVxcbiAgICAgICAgfVxcbiAgICB9LCBwYXJhbXMpKVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLkv53lrZhcXFwiLFxcbiAgICAgICAgZGVzYzogcGFyYW1zLmRlc2MsXFxuICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgdGl0bGVWaXNpYmxlOiBmYWxzZSxcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKHBhcmFtcy5rZXksIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICB0eXBlOiBwYXJhbXMudHlwZSA/IHBhcmFtcy50eXBlIDogJycsXFxuICAgIC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pZ0tleSwgcGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSlcXG4gICAgICAgICAgICBsZXQgbmFtZSA9IGdldE15VmFyKHBhcmFtcy5rZXksIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICBpZihuYW1lID09ICfpu5jorqQnKSByZXR1cm4gJ3RvYXN0Oi8v6buY6K6k6YWN572u5peg5rOV57yW6L6RJ1xcbiAgICAgICAgICAgIGNvbmZpZ1tjb25maWdLZXldLnVzZSA9IG5hbWVcXG4gICAgICAgICAgICBpZiAoIWNvbmZpZ1tjb25maWdLZXldW25hbWVdKSBjb25maWdbY29uZmlnS2V5XVtuYW1lXSA9IHt9XFxuICAgICAgICAgICAgbGV0IGRhdGFzID0gcGFyYW1zLmRhdGE7XFxuICAgICAgICAgICAgbGV0IGRhdGFLZXlzID0gT2JqZWN0LmtleXMoZGF0YXMpO1xcbiAgICAgICAgICAgIGZvciAobGV0IGkgaW4gZGF0YUtleXMpIHtcXG4gICAgICAgICAgICAgICAgbGV0IGRhdGFLZXkgPSBkYXRhS2V5c1tpXVxcbiAgICAgICAgICAgICAgICBsZXQgZGF0YSA9IGRhdGFzW2RhdGFLZXldXFxuICAgICAgICAgICAgICAgIGNvbmZpZ1tjb25maWdLZXldW25hbWVdW2RhdGFLZXldID0gZ2V0TXlWYXIoZGF0YS5rZXksIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpXFxuICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv53lrZjmiJDlip8nXFxuICAgICAgICB9LCBjb25maWdLZXksIHBhcmFtcylcXG4gICAgfSlcXG59XFxuXFxuLy/oh6rlrprkuYn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FxuICAgICAgICB0aXRsZTogJzxmb250IGNvbG9yPVxcXCIjODA4MDgwXFxcIj4nICsgJ+OAkOWGhee9ruWPmOmHj+OAkScgKyAnPGJyPiZuYnNwOyZuYnNwOyZuYnNwO2lkOiDniYfljZVpZCcgKyAnPGJyPiZuYnNwOyZuYnNwOyZuYnNwO3R5cGU6IOeJh+WNleexu+WeiycgKyAnPGJyPiZuYnNwOyZuYnNwOyZuYnNwO3RpdGxlOiDniYfljZXmoIfpopgnICsgJzwvZm9udD4nLFxcbiAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnXFxuICAgIH0pXFxuICAgIG1vZGVFZGl0UGFnZShkLCBcXFwiZGV0YWlsc1ZpZXdDb25maWdzXFxcIiwge1xcbiAgICAgICAga2V5OiBcXFwiaW5wdXRfbmFtZVxcXCIsXFxuICAgICAgICBkZXNjOiBcXFwi6K+36L6T5YWl5ZCN56ewXFxcIixcXG4gICAgICAgIC8vIHR5cGU6ICdpbnB1dCdcXG4gICAgICAgIGRhdGE6IHtcXG4gICAgICAgICAgICBjb25maWc6IHtcXG4gICAgICAgICAgICAgICAga2V5OiBcXFwiaW5wdXRfY29kZVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXphY3nva7ku6PnoIFcXFwiLFxcbiAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBzZXR0aW5nOiB7XFxuICAgICAgICAgICAgICAgIGtleTogXFxcImlucHV0X3NldHRpbmdfY29kZVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXorr7nva7pobXpnaLku6PnoIFcXFwiLFxcbiAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICB9KVxcbn1cXG5cXG4vL+iHquWumuS5ieino+aekC3nvJbovpHpobXpnaJcXG5mdW5jdGlvbiBhbmFseXNpc01vZGVFZGl0UGFnZShkKSB7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJzxmb250IGNvbG9yPVxcXCIjODA4MDgwXFxcIj4nICsgJ+OAkOino+aekOS7o+eggeWGhee9ruWPmOmHj+OAkScgKyAnPGJyPiZuYnNwOyZuYnNwOyZuYnNwO2lucHV0OiDop4bpopHpk77mjqUnICsgJzwvZm9udD4nLFxcbiAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnXFxuICAgIH0pXFxuICAgIG1vZGVFZGl0UGFnZShkLCBcXFwiYW5hbHlzaXNDb25maWdzXFxcIiwge1xcbiAgICAgICAga2V5OiBcXFwiaW5wdXRfbmFtZVxcXCIsXFxuICAgICAgICBkZXNjOiBcXFwi6K+36L6T5YWl5ZCN56ewXFxcIixcXG4gICAgICAgIC8vIHR5cGU6ICdpbnB1dCdcXG4gICAgICAgIGRhdGE6IHtcXG4gICAgICAgICAgICBjb25maWc6IHtcXG4gICAgICAgICAgICAgICAga2V5OiBcXFwiaW5wdXRfY29kZVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXop6PmnpDku6PnoIFcXFwiLFxcbiAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBrZXk6ICdpbnB1dF9leHRyYScsXFxuICAgICAgICAgICAgICAgIGRlc2M6ICfor7fovpPlhaVleHRyYeWxnuaAp+WAvCcsXFxuICAgICAgICAgICAgICAgIHR5cGU6ICd0ZXh0YXJlYSdcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIHNldHRpbmc6IHtcXG4gICAgICAgICAgICAgICAga2V5OiBcXFwiaW5wdXRfc2V0dGluZ19jb2RlXFxcIixcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpeiuvue9rumhtemdouS7o+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RhaWxzVmlld0NvbmZpZ3MnKTtcXHJcXG5cXHJcXG4gICAgbGV0IGl0ZW1zID0gW107XFxyXFxuICAgIGxpc3QuZm9yRWFjaChkYXRhID0+IHtcXHJcXG4gICAgICAgIGlmIChkYXRhLnRhcmdldF90eXBlID09ICdkb3VsaXN0X2NhcmRzJykge1xcclxcbiAgICAgICAgICAgIGRhdGEudGFyZ2V0LmRvdWxpc3RzLmZvckVhY2goZSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGUudGl0bGUsXFxyXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkvJHBhZ2V7ZnlwYWdlfSNub0hpc3RvcnkjJylcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAucnVsZSgodHlwZSwgaWQpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gXFxcImNvbGxlY3Rpb25cXFwiIHx8IHR5cGUgPT0gXFxcImNoYXJ0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ViamVjdENvbGxlY3Rpb25MaXN0KE1ZX1BBR0UsIDUwLCBpZCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBlLnRhcmdldF90eXBlLCBlLmlkKSxcXHJcXG4gICAgICAgICAgICAgICAgICAgIGltZzogZS5jb3Zlcl91cmwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGUuY292ZXJfdXJsXFxyXFxuICAgICAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH0gZWxzZSBpZiAoZGF0YS50YXJnZXRfdHlwZSA9PSAnY2hhcnQnKSB7XFxyXFxuICAgICAgICAgICAgbGV0IGUgPSBkYXRhLnRhcmdldDtcXHJcXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGUudGl0bGUsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eS8kcGFnZXtmeXBhZ2V9I25vSGlzdG9yeSMnKVxcclxcbiAgICAgICAgICAgICAgICAgICAgLnJ1bGUoKHR5cGUsIGlkKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvdUxpc3QoaWQsIE1ZX1BBR0UsIDUwKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gXFxcImNvbGxlY3Rpb25cXFwiIHx8IHR5cGUgPT0gXFxcImNoYXJ0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJqZWN0Q29sbGVjdGlvbkxpc3QoTVlfUEFHRSwgNTAsIGlkKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgICAgICB9LCBkYXRhLnRhcmdldF90eXBlLCBlLmlkKSxcXHJcXG4gICAgICAgICAgICAgICAgaW1nOiBlLmNvdmVyX3VybCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZS5jb3Zlcl91cmxcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICBsZXQgdHlwZSA9IGRhdGEudGFyZ2V0X3R5cGUsXFxyXFxuICAgICAgICAgICAgICAgIGlkID0gZGF0YS50YXJnZXQuaWQsXFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlID0gZGF0YS50YXJnZXQudGl0bGUsXFxuICAgICAgICAgICAgICAgIHllYXIgPSBkYXRhLnRhcmdldC55ZWFyO1xcclxcbiAgICAgICAgICAgIGxldCB1c2VDb25maWcgPSBkZXRhaWxzVmlld0NvbmZpZ3NbZGV0YWlsc1ZpZXdDb25maWdzLnVzZV0uY29uZmlnO1xcclxcbiAgICAgICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXHJcXG4gICAgICAgICAgICBpZiAodXNlQ29uZmlnLnN0YXJ0c1dpdGgoJ3snKSkge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKCd1cmxQYXJhbXMgPSAnICsgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICB1cmxQYXJhbXMudXJsID0gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI2ltbWVyc2l2ZVRoZW1lI1xcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZClcXHJcXG4gICAgICAgICAgICAgICAgICAgIC5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgICAgIH0sIHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSArICh5ZWFyID8gJygnK3llYXIrJyknIDogJycpLFxcclxcbiAgICAgICAgICAgICAgICBpbWc6IGRhdGEudGFyZ2V0LmNvdmVyX3VybCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZGF0YS50YXJnZXQuY292ZXJfdXJsLFxcclxcbiAgICAgICAgICAgICAgICBkZXNjOiBkYXRhLnR5cGVfbmFtZSxcXHJcXG4gICAgICAgICAgICAgICAgY29udGVudDogZGF0YS50YXJnZXQuY2FyZF9zdWJ0aXRsZSxcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmxQYXJhbXMudXJsLFxcclxcbiAgICAgICAgICAgICAgICBleHRyYTogdXJsUGFyYW1zLmV4dHJhXFxyXFxuICAgICAgICAgICAgfSk7XFxyXFxuICAgICAgICB9XFxyXFxuXFxyXFxuICAgIH0pO1xcclxcblxcclxcbiAgICBzZXRTZWFyY2hSZXN1bHQoe1xcclxcbiAgICAgICAgZGF0YTogaXRlbXNcXHJcXG4gICAgfSk7XFxyXFxufVxcclxcblxcclxcbi8v5LqM57qn6aG16Z2iXFxyXFxuZnVuY3Rpb24gZXJqaSgpIHtcXHJcXG4gICAgYWRkTGlzdGVuZXIoXFxcIm9uQ2xvc2V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piF4piGXFxcIiwgXFxcIuKYheKYheKYheKYhuKYhlxcXCIsIFxcXCLimIXimIXimIbimIbimIZcXFwiLCBcXFwi4piF4piG4piG4piG4piGXFxcIl1baW5kZXhdICsgXFxcIjwvZm9udD4mbmJzcDtcXFwiO1xcclxcblxcclxcbiAgICAgICAgciArPSBmdW5jdGlvbihlKSB7XFxyXFxuICAgICAgICAgICAgbGV0IHQxID0gJyc7XFxyXFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBlOyBpKyspIHQxICs9IFxcXCLilodcXFwiO1xcclxcbiAgICAgICAgICAgIGxldCB0MiA9ICcnO1xcclxcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMTAgLSBlOyBpKyspIHQyICs9IFxcXCLilodcXFwiO1xcclxcbiAgICAgICAgICAgIHJldHVybiB0MS5mb250Y29sb3IoJyNmZmFjMmQnKSArIHQyLmZvbnRjb2xvcignI2U1ZTFlNCcpO1xcclxcbiAgICAgICAgfSgoMTAgKiB2YWx1ZSkudG9GaXhlZCgwKSk7XFxyXFxuXFxyXFxuICAgICAgICByICs9ICcmbmJzcDs8c21hbGw+PGZvbnQgY29sb3I9XFxcImdyZXlcXFwiPicgKyAoMTAwICogdmFsdWUpXFxyXFxuICAgICAgICAgICAgLnRvRml4ZWQoMSkgKyBcXFwiJTwvZm9udD48L3NtYWxsPjxici8+XFxcIjtcXHJcXG4gICAgfSkpO1xcclxcblxcclxcbiAgICByICs9IFtpLmRvbmVfY291bnQgPyBpLmRvbmVfY291bnQgKyBcXFwi5Lq655yL6L+HXFxcIiA6IFxcXCJcXFwiLCBpLmRvaW5nX2NvdW50ID8gaS5kb2luZ19jb3VudCArIFxcXCLkurrlnKjnnItcXFwiIDogXFxcIlxcXCIsIGkud2lzaF9jb3VudCA/IGkud2lzaF9jb3VudCArIFxcXCLkurrmg7PnnItcXFwiIDogXFxcIlxcXCJdLmpvaW4oXFxcIiZuYnNwOyZuYnNwO1xcXCIpXFx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cnkudGl0bGUgKyAoaXRlbS5pc193b24gPyAnJyA6ICco5o+Q5ZCNKScpICsgJyZuYnNwOycpLmZvbnRjb2xvcihcXFwiZ3JleVxcXCIpO1xcclxcbiAgICAgICAgICAgIHIyICs9IGl0ZW0uY2VsZWJyaXRpZXMubWFwKGNlbGVicml0eSA9PiBjZWxlYnJpdHkubmFtZSkuam9pbignJm5ic3A7LyZuYnNwOycpO1xcclxcbiAgICAgICAgICAgIHIyICs9ICc8YnIvPic7XFxyXFxuICAgICAgICB9KVxcclxcbiAgICAgICAgcjIgKz0gJzxici8+JztcXHJcXG4gICAgfSlcXHJcXG5cXHJcXG4gICAgaWYgKHBhZ2UgPT0gMSkge1xcclxcbiAgICAgICAgc2V0SG9tZVJlc3VsdCh7XFxyXFxuICAgICAgICAgICAgZGF0YTogW3tcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHIgKyByMixcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxyXFxuICAgICAgICAgICAgfV1cXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH0gZWxzZSBpZihzLmF3YXJkcy5sZW5ndGggPT0gMCl7XFxyXFxuICAgICAgICBzZXRSZXN1bHQoW10pO1xcclxcbiAgICB9IGVsc2V7XFxyXFxuICAgICAgICBzZXRIb21lUmVzdWx0KHtcXHJcXG4gICAgICAgICAgICBkYXRhOiBbe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogcjIsXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcclxcbiAgICAgICAgICAgIH1dXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxufVxcclxcblxcclxcbi8v5aWW6aG56K+m5oOF6aG16Z2iXFxyXFxuZnVuY3Rpb24gYXdhcmRWaWV3KGlkLCBuYW1lKSB7XFxyXFxuICAgIHNldFBhZ2VUaXRsZShuYW1lKTtcXHJcXG4g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pwZ0BSZWZlcmVyPVxcXCIgKyBlLmltYWdlLmxhcmdlLnVybCArIFxcXCI/dHlwZT0uanBnXFxcIixcXHJcXG4gICAgICAgIGNvbF90eXBlOiBcXFwicGljXzJcXFwiXFxyXFxuICAgIH0pKSk7XFxyXFxuXFxyXFxuICAgIGlmIChwYWdlID09IDEpIHtcXHJcXG4gICAgICAgIGwudW5zaGlmdCh7XFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXHJcXG4gICAgICAgIH0pO1xcclxcbiAgICAgICAgaWYgKHRlbXAgPT0gJ3Bob3RvcycpIHtcXHJcXG4gICAgICAgICAgICBsLnVuc2hpZnQoe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIjxiaWc+5YWxPHN0cm9uZz4gXFxcIiArIHIudG90YWwgKyAnIDwvc3Ryb25nPuW8oOWJp+eFpzwvYmlnPjxici8+PHNtYWxsPjxmb250IGNvbG9yPVxcXCJncmV5XFxcIj7lrpjmlrnliafnhafvvJonICsgci5vICsgXFxcIuW8oCZuYnNwO+aIquWbvu+8mlxcXCIgKyByLmMgKyBcXFwi5bygJm5ic3A75bel5L2c54Wn77yaXFxcIiArIHIudyArIFxcXCLlvKAmbmJzcDvmlrDpl7vlm77niYfvvJpcXFwiICsgci5uICsgXFxcIuW8oCZuYnNwO+eyieS4neWbvueJh++8mlxcXCIgKyByLmYgKyBcXFwi5bygPC9mb250Pjwvc21hbGw+XFxcIixcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgbC51bnNoaWZ0KHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCI8YmlnPuWFsTxzdHJvbmc+IFxcXCIgKyByLnRvdGFsICsgXFxcIjwvc3Ryb25nPuW8oOa1t+aKpTwvYmlnPlxcXCIsXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICBsID0gYS5jb25jYXQobCk7XFxyXFxuICAgIH1cXHJcXG4gICAgc2V0SG9tZVJlc3VsdCh7XFxyXFxuICAgICAgICBkYXRhOiBsXFxyXFxuICAgIH0pXFxyXFxufVxcclxcblxcclxcbi8v5ryU6IGM5Lq65ZGY6aG16Z2iXFxyXFxuZnVuY3Rpb24gY3JlZGl0cyh0eXBlLCBpZCkge1xcclxcbiAgICBsZXQgaSA9IGdldERvdWJhblJlcyhcXFwiaHR0cHM6Ly9mcm9kby5kb3ViYW4uY29tL2FwaS92Mi9cXFwiICsgdHlwZSArIFxcXCIvXFxcIiArIGlkICsgXFxcIi9jcmVkaXRzXFxcIik7XFxyXFxuICAgIGxldCByID0gW107XFxyXFxuICAgIGkuY3JlZGl0cy5mb3JFYWNoKChlID0+IHtcXHJcXG4gICAgICAgIHIucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IGUudGl0bGUsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxyXFxuICAgICAgICB9KTtcXHJcXG4gICAgICAgIGUuY2VsZWJyaXRpZXMuZm9yRWFjaCgoZSA9PiB7XFxyXFxuICAgICAgICAgICAgci5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGUubmFtZSArIFxcXCJcXFxcblxcXCIgKyBlLmxhdGluX25hbWUsXFxyXFxuICAgICAgICAgICAgICAgIGRlc2M6IGUuY2hhcmFjdGVyLFxcclxcbiAgICAgICAgICAgICAgICBpbWc6IGUuYXZhdGFyLm5vcm1hbCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZS5hdmF0YXIubm9ybWFsLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ21vdmll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heCwgZS5yYXRpbmcudmFsdWUpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgbC5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogZS51c2VyLm5hbWUsXFxyXFxuICAgICAgICAgICAgaW1nOiBlLnVzZXIuYXZhdGFyLFxcclxcbiAgICAgICAgICAgIHVybDogZS51c2VyLnVybCxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCJcXHJcXG4gICAgICAgIH0pO1xcclxcbiAgICAgICAgbC5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogZS5jb21tZW50ICsgKHQgPyAnPGJyLz48c21hbGw+55yL6L+HIDxmb250IGNvbG9yPScgKyBzdGFyQ29sb3IgKyAnPicgKyB0ICsgXFxcIjwvZm9udD48L3NtYWxsPlxcXCIgOiBcXFwiXFxcIikgKyAnPGJyLz48c21hbGw+PGZvbnQgY29sb3I9XFxcImdyZXlcXFwiPicgKyBlLnZvdGVfY291bnQgKyBcXFwi6LWe4oCiXFxcIiArIC9cXFxcZHs0fS1cXFxcZHsxLDJ9LVxcXFxkezEsMn0vZy5leGVjKGUuY3JlYXRlX3RpbWUpICsgXFxcIjwvZm9udD48L3NtYWxsPlxcXCIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxyXFxuICAgICAgICB9KTtcXHJcXG4gICAgICAgIGwucHVzaCh7XFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lXFxcIlxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfSkpO1xcclxcblxcclxcbiAgICBpZiAocGFnZSA9PSAxKSB7XFxyXFxuICAgICAgICBsLnVuc2hpZnQoe1xcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxyXFxuICAgICAgICB9KTtcXHJcXG4gICAgICAgIGwudW5zaGlmdCh7XFxyXFxuICAgICAg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m57lpI1cXFwiIDogXFxcIlxcXCIsXFxyXFxuICAgICAgICAgICAgciA9IGUudXNlZnVsX2NvdW50ID8gZS51c2VmdWxfY291bnQgKyBcXFwi5pyJ55SoXFxcIiA6IFxcXCJcXFwiLFxcclxcbiAgICAgICAgICAgIG8gPSBlLnJlc2hhcmVzX2NvdW50ID8gZS5yZXNoYXJlc19jb3VudCArIFxcXCLovazlj5FcXFwiIDogXFxcIlxcXCI7XFxyXFxuXFxyXFxuICAgICAgICByID0gaSAmJiByID8gXFxcIuKAolxcXCIgKyByIDogcjtcXHJcXG4gICAgICAgIG8gPSAoaSB8fCByKSAmJiBvID8gXFxcIuKAolxcXCIgKyBvIDogbztcXHJcXG4gICAgICAgIGwucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IGUudXNlci5uYW1lLFxcclxcbiAgICAgICAgICAgIGltZzogZS51c2VyLmF2YXRhcixcXHJcXG4gICAgICAgICAgICB1cmw6IGUudXNlci51cmwsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiXFxyXFxuICAgICAgICB9KVxcclxcbiAgICAgICAgbC5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogXFxcIjxzdHJvbmc+XFxcIiArIGUudGl0bGUgKyBcXFwiPC9zdHJvbmc+PGJyLz5cXFwiICsgZS5hYnN0cmFjdCArICcgICA8c21hbGw+KDxhIGhyZWY9XFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5I0BydWxlPWpzOmV2YWwoSlNPTi5wYXJzZShmZXRjaChgaGlrZXI6Ly9wYWdlL21haW5gKSkucnVsZSk7ZHJhbWFSZXZpZXdWaWV3KCcgKyBlLmlkICsgJylcXFwiPuabtOWkmjwvYT4pPC9zbWFsbD4nICsgKHQgPyAnPGJyLz48c21hbGw+55yL6L+HIDxmb250IGNvbG9yPScgKyBzdGFyQ29sb3IgKyAnPicgKyB0ICsgXFxcIjwvZm9udD48L3NtYWxsPlxcXCIgOiBcXFwiXFxcIikgKyAnPGJyLz48c21hbGw+PGZvbnQgY29sb3I9XFxcImdyZXlcXFwiPicgKyBpICsgciArIG8gKyBcXFwiPC9mb250Pjwvc21hbGw+XFxcIixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCJcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgICAgICBsLnB1c2goe1xcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZVxcXCJcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH0pKTtcXHJcXG5cXHJcXG4gICAgaWYgKHBhZ2UgPT0gMSkge1xcclxcbiAgICAgICAgbC51bnNoaWZ0KHtcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcclxcbiAgICAgICAgfSk7XFxyXFxuICAgICAgICBsLnVuc2hpZnQoe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiBcXFwiPGJpZz7lhbE8c3Ryb25nPiBcXFwiICsgci50b3RhbCArIFxcXCIgPC9zdHJvbmc+5p2h5Ymn6K+EPC9iaWc+XFxcIixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCJcXHJcXG4gICAgICAgIH0pO1xcclxcblxcclxcbiAgICAgICAgc2V0SG9tZVJlc3VsdCh7XFxyXFxuICAgICAgICAgICAgZGF0YTogYS5jb25jYXQobClcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICBzZXRIb21lUmVzdWx0KHtcXHJcXG4gICAgICAgICAgICBkYXRhOiBsXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxufVxcclxcblxcclxcbi8v6aKE5ZGK54mH6aG16Z2iXFxyXFxuZnVuY3Rpb24gdHJhaWxlcnModHlwZSwgaWQpIHtcXHJcXG4gICAgc2V0UGFnZVRpdGxlKCfpooTlkYot54mH5q61Le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mIChvLmxlbmd0aCA+IDApIHtcXHJcXG4gICAgICAgIG8udW5zaGlmdCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLoirHnta5cXFwiLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBzZXRIb21lUmVzdWx0KHtcXHJcXG4gICAgICAgIGRhdGE6IHIuY29uY2F0KGwpXFxyXFxuICAgICAgICAgICAgLmNvbmNhdChvKVxcclxcbiAgICB9KVxcclxcbn1cXHJcXG5cXHJcXG4vL+inhumikeivhOiuuumhtemdolxcclxcbmZ1bmN0aW9uIHZpZGVvQ29tbWVudCh0eXBlLCBpZCkge1xcclxcbiAgICBsZXQgaSA9IGdldERvdWJhblJlcyhcXFwiaHR0cHM6Ly9mcm9kby5kb3ViYW4uY29tL2FwaS92Mi9cXFwiICsgdHlwZSArIFxcXCIvXFxcIiArIGlkICsgXFxcIi92aWRlb3NcXFwiKS52aWRlb3M7XFxyXFxuICAgIGkuZm9yRWFjaCgoZSA9PiB7XFxyXFxuICAgICAgICBlLmNvbF90eXBlID0gXFxcIm1vdmllXzJcXFwiLCBlLmRlc2MgPSBlLmF1dGhvci5uYW1lICsgXFxcIuKAolxcXCIgKyBlLmNyZWF0ZV90aW1lLCBlLmltZyA9IGUuY292ZXJfdXJsICsgXFxcIkBSZWZlcmVyPVxcXCIgKyBlLmNvdmVyX3VybCwgZS51cmwgPSBlLnZpZGVvX3VybFxcclxcbiAgICB9KSlcXHJcXG4gICAgaWYgKGkubGVuZ3RoID4gMCkge1xcclxcbiAgICAgICAgaS51bnNoaWZ0KHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuinhumikeivhOiuulxcXCIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFx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zc2FyV29ya3MoaWQsIHR5cGUpO1xcclxcbiAgICAgICAgICAgIH0sIGUyLmlkLCBlMi5jb2xsZWN0aW9uc1swXS50aXRsZSksXFxyXFxuICAgICAgICAgICAgZXh0cmE6IHtcXHJcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgfSlcXHJcXG5cXHJcXG4gICAgICAgIGxldCBkZXRhaWxzVmlld0NvbmZpZ3MgPSBnZXRDb25maWcoJ2RldGFpbHNWaWV3Q29uZmlncycpO1xcclxcbiAgICAgICAgbGV0IHdvcmtzID0gZTIuY29sbGVjdGlvbnNbMF0ud29ya3M7XFxyXFxuICAgICAgICBsZXQgbGVuZ3RoID0gd29ya3MubGVuZ3RoIDw9IDMgPyB3b3Jrcy5sZW5ndGggOiAzO1xcclxcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykge1xcclxcbiAgICAgICAgICAgIGxldCBlID0gd29ya3NbaV07XFxyXFxuICAgICAgICAgICAgbGV0IHJhdGluZyA9IFxcXCJcXFwiO1xcclxcbiAgICAgICAgICAgIGlmIChlLnN1YmplY3QuZXh0cmEucmF0aW5nX2dyb3VwLnJhdGluZykge1xcclxcbiAgICAgICAgICAgICAgICByYXRpbmcgPSBjb21wdXRlUmF0aW5nKGUuc3ViamVjdC5leHRyYS5yYXRpbmdfZ3JvdXAucmF0aW5nLm1heCwgZS5zdWJqZWN0LmV4dHJhLnJhdGluZ19ncm91cC5yYXRpbmcudmFsdWUpICsgXFxcIiBcXFwiICsgZS5zdWJqZWN0LmV4dHJhLnJhdGluZ19ncm91cC5yYXRpbmcudmFsdWUgKyBcXFwi5YiGXFxcIjtcXHJcXG4gICAgICAgICAgICB9XFxyXFxuXFxyXFxuICAgICAgICAgICAgbGV0IHR5cGUgPSBlLnN1YmplY3Quc3VidHlwZSxcXHJcXG4gICAgICAgICAgICAgICAgaWQgPSBlLnN1YmplY3QuaWQsXFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlID0gZS5zdWJqZWN0LnRpdGxlO1xcclxcbiAgICAgICAgICAgIGxldCB1c2VDb25maWcgPSBkZXRhaWxzVmlld0NvbmZpZ3NbZGV0YWlsc1ZpZXdDb25maWdzLnVzZV0uY29uZmlnO1xcclxcbiAgICAgICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXHJcXG4gICAgICAgICAgICBpZiAodXNlQ29uZmlnLnN0YXJ0c1dpdGgoJ3snKSkge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKCd1cmxQYXJhbXMgPSAnICsgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICB1cmxQYXJhbXMudXJsID0gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI2ltbWVyc2l2ZVRoZW1lI1xcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZCkucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIH0sIHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcclxcbiAgICAgICAgICAgICAgICBpbWc6IGUuc3ViamVjdC5jb3Zlci5ub3JtYWwudXJsICsgXFxcIkBSZWZlcmVyPVxcXCIgKyBlLnN1YmplY3QuY292ZXIubm9ybWFsLnVybCxcXHJcXG4gICAgICAgICAgICAgICAgZGVzYzogcmF0aW5nLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzMnLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6IHVybFBhcmFtcy51cmwsXFxyXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB1cmxQYXJhbXMuZXh0cmFcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgLyphLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiAn5p+l55yL5pu05aSaJyxcXHJcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2pva2VyLXR4LmNvZGluZy5uZXQvcC9oaWtlcmltZy9kL2hpa2VyL2dpdC9yYXcvbWFzdGVyL2ltZy9tb3JlX3Zlci5wbmc/ZG93bmxvYWQ9ZmFsc2UnLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbW92aWVfMycsXFxyXFxuICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5LyMvJHBhZ2V7ZnlwYWdlfSNub0hpc3RvcnkjJylcXHJcXG4gICAgICAgICAgICAgICAgLnJ1bGUoKGlkLCB0eXBlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgZWxlc3NhcldvcmtzKGlkLCB0eXBlKTtcXHJcXG4gICAgICAgICAgICB9LCBlMi5pZCwgZTIuY29sbGVjdGlvbnNbMF0udGl0bGUpXFxyXFxuICAgICAgICB9KSovXFxyXFxuICAgIH1cXHJcXG4gICAgXFxyXFxuICAgIGluZGV4ID0gaS5tb2R1bGVzLmZpbmRJbmRleChjdXIgPT4gY3VyLnR5cGUgPT0gXFxcInBob3Rvc1xcXCIpO1xcclxcbiAgICBpZiAoaW5kZXggPiAtMSkge1xcclxcbiAgICAgICAgbGV0IGUzID0gaS5tb2R1bGVzW2luZGV4XS5wYXlsb2FkO1xcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxyXFxuICAgICAgICB9KVxcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnScgKyAn5ryU5ZGY54Wn54mHJy5iaWcoKS5ib2xkKCkgKyAoJyjlhbEnICsgZTMudG90YWwgKyAn5bygKScpLnNtYWxsKCksXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXHJcXG4gICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkvIy8kcGFnZXtmeXBhZ2V9I25vSGlzdG9yeSMnKS5ydWxlKChwaWQpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICBlbGVzc2FyUGhvdG9zKHBpZCk7XFxyXFxuICAgICAgICAgICAgfSwgcGlkKSxcXHJcXG4gICAgICAgICAgICBleHRyYToge1xcclxcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9KVxcclxcblxcclxcbiAgICAgICAgbGV0IHBsZW5ndGggPSBlMy5waG90b3MubGVuZ3RoIDw9IDIgPyBlMy5waG90b3MubGVuZ3RoIDogMjtcXHJcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcGxlbmd0aDsgaSsrKSB7XFxyXFxuICAgICAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgLy90aXRsZTogZTMucGhvdG9zWzBdLmRlc2NyaXB0aW9uLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2NhcmRfcGljXzInLFxcclxcbiAgICAgICAgICAgICAgICBkZXNjOiAnMCcsXFxyXFxuICAgICAgICAgICAgICAgIGltZzogZTMucGhvdG9zW2ldLmltYWdlLm5vcm1hbC51cmwgKyAnQFJlZmVyZXI9JyArIGUzLnBob3Rvc1tpXS5pbWFnZS5ub3JtYWwudXJsLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6IGUzLnBob3Rvc1tpXS5pbWFnZS5ub3JtYWwudXJsICsgJ0BSZWZlcmVyPScgKyBlMy5waG90b3NbaV0uaW1hZ2Uubm9ybWFsLnVybFxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9XFxyXFxuXFxyXFxuICAgICAgICAvKmEucHVzaCh7XFxyXFxuICAgICAgICAgICAgLy90aXRsZTogJ+afpeeci+abtOWkmicsXFxyXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9qb2tlci10eC5jb2RpbmcubmV0L3AvaGlrZXJpbWcvZC9oaWtlci9naXQvcmF3L21hc3Rlci9pbWcvbW9yZS5wbmc/ZG93bmxvYWQ9ZmFsc2UnLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnY2FyZF9waWNfMicsXFxyXFxuICAgICAgICAgICAgZGVzYzogJzAnLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eS8jLyRwYWdle2Z5cGFnZX0jbm9IaXN0b3J5IycpXFxyXFxuICAgICAgICAgICAgICAgIC5ydWxlKChwaWQpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2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uICAgICAgICAgICAgICAgIGxldCByYXRpbmcgPSBcXFwiXFxcIjtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKGUuZXh0cmEucmF0aW5nX2dyb3VwLnJhdGluZykge1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmF0aW5nID0gY29tcHV0ZVJhdGluZyhlLmV4dHJhLnJhdGluZ19ncm91cC5yYXRpbmcubWF4LCBlLmV4dHJhLnJhdGluZ19ncm91cC5yYXRpbmcudmFsdWUpICsgXFxcIiBcXFwiICsgZS5leHRyYS5yYXRpbmdfZ3JvdXAucmF0aW5nLnZhbHVlICsgXFxcIuWIhlxcXCI7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgbGV0IHR5cGUgPSBlLnN1YnR5cGUsXFxyXFxuICAgICAgICAgICAgICAgICAgICBpZCA9IGUuaWQsXFxyXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IGUudGl0bGU7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB1c2VDb25maWcgPSBkZXRhaWxzVmlld0NvbmZpZ3NbZGV0YWlsc1ZpZXdDb25maWdzLnVzZV0uY29uZmlnO1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdXJsUGFyYW1zID0ge307XFxyXFxuICAgICAgICAgICAgICAgIGlmICh1c2VDb25maWcuc3RhcnRzV2l0aCgneycpKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKCd1cmxQYXJhbXMgPSAnICsgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcIiArICc/dHlwZT0nICsgdHlwZSArICcmaWQ9JyArIGlkKS5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgICAgIH0sIHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICBsLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcclxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBlLmNvdmVyLm5vcm1hbC51cmwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGUuY292ZXIubm9ybWFsLnVybCxcXHJcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IHJhdGluZyArICdcXFxcbicgKyBlLmV4dHJhLnNob3J0X2luZm8sXFxyXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHVybFBhcmFtcy51cmwsXFxyXFxuICAgICAgICAgICAgICAgICAgICBleHRyYTogdXJsUGFyYW1zLmV4dHJhXFxyXFxuICAgICAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgbC5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBlLmNlcmVtb255LnRpdGxlLmJvbGQoKSArICc8c21hbGw+KDxhIGhyZWY9XFxc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xlO1xcclxcbiAgICAgICAgbGV0IHVzZUNvbmZpZyA9IGRldGFpbHNWaWV3Q29uZmlnc1tkZXRhaWxzVmlld0NvbmZpZ3MudXNlXS5jb25maWc7XFxyXFxuICAgICAgICBsZXQgdXJsUGFyYW1zID0ge307XFxyXFxuICAgICAgICBpZiAodXNlQ29uZmlnLnN0YXJ0c1dpdGgoJ3snKSkge1xcclxcbiAgICAgICAgICAgIGV2YWwoJ3VybFBhcmFtcyA9ICcgKyB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICB1cmxQYXJhbXMudXJsID0gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI2ltbWVyc2l2ZVRoZW1lI1xcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZCkucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgbC5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUgKyB5ZWFyLFxcclxcbiAgICAgICAgICAgIGltZzogZS5zdWJqZWN0LmNvdmVyLm5vcm1hbC51cmwgKyBcXFwiQFJlZmVy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XQgdXNlQ29uZmlnID0gZGV0YWlsc1ZpZXdDb25maWdzW2RldGFpbHNWaWV3Q29uZmlncy51c2VdLmNvbmZpZztcXHJcXG4gICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXHJcXG4gICAgICAgIGlmICh1c2VDb25maWcuc3RhcnRzV2l0aCgneycpKSB7XFxyXFxuICAgICAgICAgICAgZXZhbCgndXJsUGFyYW1zID0gJyArIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcIiArICc/dHlwZT0nICsgdHlwZSArICcmaWQ9JyArIGlkKS5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICByZXR1cm4ge1xcclxcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXHJcXG4gICAgICAgICAgICB1cmw6IHVybFBhcmFtcy51cmwsXFxyXFxuICAgICAgICAgICAgZXh0cmE6IHVybFBhcmFtcy5leHRyYSxcXHJcXG4gICAgICAg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oCc4oCc4oCd4oCdPGJpZz48c3Ryb25nPuinhumikeivhOiuujwvc3Ryb25nPjwvYmlnPlxcXCIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXHJcXG4gICAgICAgICAgICBleHRyYToge1xcclxcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXHJcXG4gICAgICAgICAgICB9LFxcclxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICB9KTtcXHJcXG4gICAgICAgIHZpZGVvUmVsYXRlZEl0ZW1zLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiBpLnZpZGVvLnRpdGxlLFxcclxcbiAgICAgICAgICAgIGltZzogaS52aWRlby5jb3Zlcl91cmwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGkudmlkZW8uY292ZXJfdXJsLFxcclxcbiAgICAgICAgICAgIHVybDogaS52aWRlby52aWRlb191cmwsXFxyXFxuICAgICAgICAgICAgZGVzYzogaS52aWRlby5hdXRob3IubmFtZSArIFxcXCLigKJcXFwiICsgaS52aWRlby5jcmVhdGVfdGltZSxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcIm1vdmllXzJcXFwiXFxyXFxuICAgICAgICB9KTtcXHJcXG4gICAgICAgIHZpZGVvUmVsYXRlZEl0ZW1zLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiAn5p+l55yL5pu05aSaJyxcXHJcXG4gICAgICAgICAgICBpbWc6IFxcXCJodHRwczovL2kwLndwLmNvbS9pMC5pbWcyaXBmcy5jb20vaXBmcy9RbVphYTFMUU5ub2RUMVQxU0MzbVJFRDZZeDZETEt2RUxLNkZ4aUtma3Y4NW5EP2ZpbGVuYW1lPW1vcmUucG5nXFxcIixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcIm1vdmllXzJcXFwiLFxcclxcbiAgICAgIC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nQoe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdPGJpZz48c3Ryb25nPuWcqOe6v+inguecizwvc3Ryb25nPjwvYmlnPlxcXCIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXHJcXG4gICAgICAgICAgICBleHRyYToge1xcclxcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXHJcXG4gICAgICAgICAgICB9LFxcclxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgdmlkZW9JdGVtcy51bnNoaWZ0KHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxiaWc+PHN0cm9uZz7lsJrml6DniYfmupA8L3N0cm9uZz48L2JpZz5cXFwiLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxyXFxuICAgICAgICAgICAgZXh0cmE6IHtcXHJcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxyXFxuICAgICAgICAgICAgfSxcXHJcXG4gICAgICAgICAgICB1cmw6ICd0b2FzdDovL+ecn+eahOayoeeJh+a6kCdcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH1cXHJcXG5cXHJcXG4gICAgbGV0IHF1aWNrU2VhcmNoQ29uZmlncyA9IGdldENvbmZpZygncXVpY2tTZWFyY2hDb25maWdzJywgY29uZmlnKTtcXHJcXG4gICAgbGV0IHF1aWNrU2VhcmNoSXRlbXMgPSBbXTtcXHJcXG4gICAgcXVpY2tTZWFyY2hDb25maWdzLm9yZGVyLmZvckVhY2gocXVpY2tTZWFyY2hJdGVtID0+IHtcXHJcXG4gICAgICAgIGlmIChxdWlja1NlYXJjaENvbmZpZ3NbcXVpY2tTZWFyY2hJdGVtXSkge1xcclxcbiAgICAgICAgICAgIHF1aWNrU2VhcmNoSXRlbXMucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBxdWlja1NlYXJjaEl0ZW0sXFxyXFxuICAgICAgICAgICAgICAgIGltZzogcXVpY2tTZWFyY2hDb25maWdzW3F1aWNrU2VhcmNoSXRlbV0ucGljLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogcXVpY2tTZWFyY2hDb25maWdzLm1vZGUgfHwgJ2ljb25fc21hbGxfNCcsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vc2VhcmNoP3M9JyArIGkudGl0bGUgKyAnJnJ1bGU9JyArIHF1aWNrU2VhcmNoQ29uZmlnc1txdWlja1NlYXJjaEl0ZW1dLm5hbWVcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcbiAgICB9KVxcclxcbiAgICBpZiAocXVpY2tTZWFyY2hJdGVtcy5sZW5ndGggPiAwKSB7XFxyXFxuICAgICAgICBxdWlja1NlYXJjaEl0ZW1zLnVuc2hpZnQoe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxzdHJvbmc+PGJpZz7lv6vpgJ/mkJzntKI8L2JpZz48L3N0cm9uZz4nLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcclxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxyXFxuICAgICAgICAgICAgICAgIH0sXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgICAgICAvKnF1aWNrU2VhcmNoSXRlbXMudW5zaGlmdCh7XFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXHJcXG4gICAgICAgICAgICB9KSovXFxyXFxuICAgIH1cXHJcXG5cXHJcXG4gICAgc2V0SG9tZVJlc3VsdCh7XFxyXFxuICAgICAgICBkYXRhOiBpbmZvSXRlbXMuY29uY2F0KHJhdGluZ0l0ZW1zKVxcclxcbiAgICAgICAgICAgIC5jb25jYXQocmVsYXRlZEl0ZW1zKVxcclxcbiAgICAgICAgICAgIC5jb25jYXQoe1xcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgICAgICAuY29uY2F0KHF1aWNrU2VhcmNoSXRlbXMpXFxyXFxuICAgICAgICAgICAgLmNvbmNhdCh7XFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgICAgIC5jb25jYXQodmlkZW9JdGVtcylcXHJcXG4gICAgICAgICAgICAuY29uY2F0KHtcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgLmNvbmNhdCh2aWRlb1JlbGF0ZWRJdGVtcylcXHJcXG4gICAgICAgICAgICAuY29uY2F0KHtcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgLmNvbmNhdChpbnRyb0l0ZW1zKVxcclxcbiAgICAgICAgICAgIC5jb25jYXQoe1xcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnLFxcclxcbiAgICAgICAgICAgICAgICBleHRyYTp7XFxyXFxuICAgICAgICAgICAgICAgICAgaWQ6ICdyZWNvbW1lbmRhdGlvbnMnXFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgICAgIC5jb25jYXQoe1xcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxzbWFsbD48Zm9udCBjb2xvcj0jODcxZjc4PuS7peS4iuaVsOaNruadpea6kOS6juixhueTo++8jOWmguaCqOWWnOasou+8jOivt+S4i+i9veWumOaWuWFwcDwvZm9udD48L3NtYWxsPicsXFxyXFxuICAgICAgICAgICAgICAgIGRlc2M6ICfigJzigJzigJ3igJ08c21hbGw+PGZvbnQgY29sb3I9I2YyMGMwMD7mraTop4TliJnku4XpmZDlrabkuaDkuqTmtYHkvb/nlKjvvIzor7fkuo7lr7zlhaXlkI4yNOWwj+aXtuWGheWIoOmZpO+8jOS7u+S9lee7hOe7h+aIluS4quS6uuS4jeW+l+S7peS7u+S9leaWueW8j+aWueazleS8oOaSreatpOinhOWImeeahOaVtOS9k+aIlumDqOWIhu+8gTwvZm9udD48L3NtYWxsPicsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJ2h0dHBzOi8vbW92aWUuZG91YmFuLmNvbS9zdWJqZWN0LycgKyBpZCArICcvJyxcXHJcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgfSlcXHJcXG4gICAgYmUoW3tcXHJcXG4gICAgICAgIGZ1bmM6IGZ1bmN0aW9uKG9iail7XFxyXFxuICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgIGxldCByZXMgPSBnZXREb3ViYW5SZXMob2JqLnVybCk7XFxyXFxuICAgICAgICAgICAgXFxyXFxuICAgICAgICAgICAgbGV0IGRldGFpbHNWaWV3Q29uZmlncyA9IGdldENvbmZpZygnZGV0YWlsc1ZpZXdDb25maWdzJyk7XFxyXFxuICAgICAgICAgICAgbGV0IGwgPSBbcmVzWzBdLHJlc1sxXSxyZXNbMl1dO1xcclxcbiAgICAgICAgICAgIGxldCBpID0gbC5tYXAoKGUgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdHlwZSA9IGUudHlwZSxcXHJcXG4gICAgICAgICAgICAgICAgICAgIGlkID0gZS5pZCxcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gZS50aXRsZTtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IHVzZUNvbmZpZyA9IGRldGFpbHNWaWV3Q29uZmlnc1tkZXRhaWxzVmlld0NvbmZpZ3MudXNlXS5jb25maWc7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKHVzZUNvbmZpZy5zdGFydHNXaXRoKCd7JykpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoJ3VybFBhcmFtcyA9ICcgKyB1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgdXJsUGFyYW1zLnVybCA9ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNpbW1lcnNpdmVUaGVtZSNcXFwiICsgJz90eXBlPScgKyB0eXBlICsgJyZpZD0nICsgaWQpLnJ1bGUoKHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvdUxpc3QoaWQsIE1ZX1BBR0UsIDUwKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxyXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHVybFBhcmFtcy51cmwsXFxyXFxuICAgICAgICAgICAgICAgICAgICBleHRyYTogdXJsUGFyYW1zLmV4dHJhLFxcclxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBlLnBpYyA/IGUucGljLm5vcm1hbCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZS5waWMubm9ybWFsIDogZS5jb3Zlci51cmwgKyAnQFJlZmVyZXI9JyArIGUuY292ZXIudXJsLFxcclxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogZS5udWxsX3JhdGluZ19yZWFzb24gfHwgZS5yYXRpbmcudmFsdWVcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIH0pKTtcXHJcXG4gICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ3JlY29tbWVuZGF0aW9ucycsIGlbMl0pO1xcclxcbiAgICAgICAgICAgIGFkZEl0ZW1BZnRlcigncmVjb21tZW5kYXRpb25zJywgaVsxXSk7XFxyXFxuICAgICAgICAgICAgYWRkSXRlbUFmdGVyKCdyZWNvbW1lbmRhdGlvbnMnLCBpWzBdKTtcXHJcXG4gICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ3JlY29tbWVuZGF0aW9ucycsIHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ08YmlnPjxzdHJvbmc+55u45YWz5o6o6I2QPC9zdHJvbmc+PC9iaWc+XFxcIixcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5LyNub0hpc3RvcnkjJykucnVsZSgodCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmVjb21tZW5kYXRpb25zKHRbMF0sIHRbMV0pO1xcclxcbiAgICAgICAgICAgICAgICB9LCBbb2JqLnR5cGUsIG9iai5pZF0pLFxcclxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ3JlY29tbWVuZGF0aW9ucycse2NvbF90eXBlOiAnbGluZScsZXh0cmE6e2lkOidub29vcCd9fSlcXHJcXG4gICAgICAgIH0sXFxyXFxuICAgICAgICBwYXJhbToge1xcclxcbiAgICAgICAgICAgIHVybDogXFxcImh0dHBzOi8vZnJvZG8uZG91YmFuLmNvbS9hcGkvdjIvXFxcIiArIHR5cGUgKyBcXFwiL1xcXCIgKyBpZCArIFxcXCIvcmVjb21tZW5kYXRpb25zXFxcIixcXHJcXG4gICAgICAgICAgICB0eXBlOiB0eXBlLFxcclxcbiAgICAgICAgICAgIGlkOiBpZFxcclxcbiAgICAgICAgfVxcclxcbiAgICB9XSlcXHJcXG59XFxyXFxuXFxyXFxuLy/mjqjojZBcXHJcXG5mdW5jdGlvbiBmaW5kTGlz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G4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgIH0sIGl0ZW1zW2ldKVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBhLnB1c2goe1xcclxcbiAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXHJcXG4gICAgfSlcXHJcXG5cXHJcXG4gICAgbGV0IHBsYXlhYmxlID0ge1xcclxcbiAgICAgICAg5YWo6YOo5b2x54mHOiAnMCcsXFxyXFxuICAgICAgICDku4XmnInniYfmupA6ICcxJ1xcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IHIgaW4gcGxheWFibGUpIHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IHRlbXAucGxheWFibGUgPT0gcGxheWFibGVbcl0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIHIgKyAnIDwvZm9udD48L2I+JyA6IHIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOiAvL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2ZpbmRMaXN0JykpO1xcclxcbiAgICAgICAgICAgICAgICB0ZW1wLnBsYXlhYmxlID0gZTtcXHJcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImZpbmRMaXN0XFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2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pbHNWaWV3Q29uZmlnc1tkZXRhaWxzVmlld0NvbmZpZ3MudXNlXS5jb25maWc7XFxyXFxuICAgICAgICBsZXQgdXJsUGFyYW1zID0ge307XFxyXFxuICAgICAgICBpZiAodXNlQ29uZmlnLnN0YXJ0c1dpdGgoJ3snKSkge1xcclxcbiAgICAgICAgICAgIGV2YWwoJ3VybFBhcmFtcyA9ICcgKyB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICB1cmxQYXJhbXMudXJsID0gJChiYXNlVXJsICsgXFxcIiNub0hpc3RvcnkjXFxcIiArICc/dHlwZT0nICsgdHlwZSArICcmaWQ9JyArIGlkKS5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICByZXR1cm4ge1xcclxcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSArICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiID8gXFxcIlxcXCIgOiBcXFwi77yIXFxcIiArIGUueWVhciArIFxcXCLvvIlcXFwiKSxcXHJcXG4gICAgICAgICAgICB1cmw6IHVybFBhcmFtcy51cmwsXFxyXFxuICAgICAgICAgICA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wxMFxcXCJ9Jyk7XFxyXFxuICAgIGxldCBhID0gW107XFxyXFxuICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignaG90TGlzdCcpKTtcXHJcXG4gICAgbGV0IGNvbG9yID0gZ2V0Q29uZmlnKCdjaG9vc2VDb2xvcicpO1xcclxcblxcclxcbiAgICBsZXQgaXRlbXMgPSB7XFxyXFxuICAgICAgICDnlLXlvbE6IHtcXHJcXG4gICAgICAgICAgICDlvbHpmaLng63mmKDnlLXlvbE6ICdtb3ZpZV9zaG93aW5nP2FyZWE95YWo6YOoJyxcXHJcXG4gICAgICAgICAgICDosYbnk6Png63pl6jnlLXlvbE6ICdob3RfZ2FpYT9hcmVhPeWFqOmDqCcsXFxyXFxuICAgICAgICAgICAg54Ot6Zeo5Y2O6K+t55S15b2xOiAnaG90X2dhaWE/YXJlYT3ljY7or60nLFxcclxcbiAgICAgICAgICAgIOeDremXqOasp+e+jueUteW9sTogJ2hvdF9nYWlhP2FyZWE95qyn576OJyxcXHJcXG4gICAgICAgICAgICDng63pl6jpn6nlm73nlLXlvbE6ICdob3RfZ2FpYT9hcmVhPemfqeWbvScsXFxyXFxuICAgICAgICAgICAg54Ot6Zeo5pel5pys55S15b2xOiAnaG90X2dhaWE/YXJlYT3ml6XmnKwnXFxyXFxuICAgICAgICB9LFxcclxcbiAgICAgICAg55S16KeG5YmnOiB7XFxyXFxuICAgICAgICAgICAg54Ot5pKt55S16KeG5YmnOiAndHZfaG90JyxcXHJcXG4gICAgICAgICAgICDng63mkq3lm73kuqfliac6ICd0dl9kb21lc3RpYycsXFxyXFxuICAgICAgICAgICAg54Ot5pKt5qyn576O5YmnOiAndHZfYW1lcmljYW4nLFxcclxcbiAgICAgICAgICAgIOeDreaSreaXpeWJpzogJ3R2X2phcGFuZXNlJyxcXHJcXG4gICAgICAgICAgICDng63mkq3pn6nliac6ICd0dl9rb3JlYW4nLFxcclxcbiAgICAgICAgICAgIOeDreaSreWKqOeUuzogJ3R2X2FuaW1hdGlvbidcXHJcXG4gICAgICAgIH0sXFxyXFxuICAgICAgICDnu7zoibo6IHtcXHJcXG4gICAgICAgICAgICDng63mkq3nu7zoibo6ICdzaG93X2hvdCcsXFxyXFxuICAgICAgICAgICAg5Zu95YaF57u86Im6OiAnc2hvd19kb21lc3RpYycsXFxyXFxuICAgICAgICAgICAg5Zu95aSW57u86Im6OiAnc2hvd19mb3JlaWduJ1xcclxcbiAgICAgICAgfVxcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IGkgaW4gaXRlbXMpIHtcXHJcXG4gICAgICAgIGZvciAobGV0IGogaW4gaXRlbXNbaV0pIHtcXHJcXG4gICAgICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGVtcC5pdGVtID09IGl0ZW1zW2ldW2pdID8gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPicgKyBqICsgJyA8L2ZvbnQ+PC9iPicgOiBqLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2hvdExpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0ZW1wLml0ZW0gPSBlO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2hvdExpc3QnLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgICAgICB9LCBpdGVtc1tpXVtqXSlcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBsZXQgc29ydCA9IHtcXHJcXG4gICAgICAgIOeDreW6puaOkuW6jzogJ3JlY29tbWVuZCcsXFxyXFxuICAgICAgICDml7bpl7TmjpLluo86ICd0aW1lJyxcXHJcXG4gICAgICAgIOivhOWIhuaOkuW6jzogJ3JhbmsnXFxyXFxuICAgIH1cXHJcXG4gICAgZm9yIChsZXQgciBpbiBzb3J0KSB7XFxyXFxuICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiB0ZW1wLnNvcnQgPT0gc29ydFtyXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgciArICcgPC9mb250PjwvYj4nIDogcixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6IC8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignaG90TGlzdCcpKTtcXHJcXG4gICAgICAgICAgICAgICAgdGVtcC5zb3J0ID0gZTtcXHJcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImhvdExpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICB9LCBzb3J0W3JdKVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBhLnB1c2goe1xcclxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXHJcXG4gICAgfSlcXHJcXG5cXHJcXG4gICAgbGV0IHBsYXlhYmxlID0ge1xcclxcbiAgICAgICAg5YWo6YOo5b2x54mHOiAnMCcsXFxyXFxuICAgICAgICDku4XmnInniYfmupA6ICcxJ1xcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IHIgaW4gcGxheWFibGUpIHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IHRlbXAucGxheWFibGUgPT0gcGxheWFibGVbcl0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIHIgKyAnIDwvZm9udD48L2I+JyA6IHIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOiAvL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2hvdExpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgIHRlbXAucGxheWFibGUgPSBlO1xcclxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaG90TGlzdFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgIH0sIHBsYXlhYmxlW3JdKVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBhLnB1c2goe1xcclxcbiAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz7or4TliIbljLrpl7Q6JyArIHRlbXAuc2NvcmUucmVwbGFjZSgnLCcsICctJykgKyAnIDwvZm9udD48L2I+JyxcXHJcXG4gICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxyXFxuICAgICAgICB1cmw6ICQodGVtcC5zY29yZS5yZXBsYWNlKCcsJywgJy0nKSwgJ+ivhOWIhuW6lOWcqDAtMTDkuYvpl7QnKS5pbnB1dCgoKSA9PiB7XFxyXFxuICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdob3RMaXN0JykpO1xcclxcbiAgICAgICAgICAgIGxldCBpbnB1dHMgPSBpbnB1dC5zcGxpdCgnLScpO1xcclxcbiAgICAgICAgICAgIGlmIChpbnB1dHMubGVuZ3RoID09IDIgJiYgaW5wdXRzLmV2ZXJ5KGUgPT4gZSA+PSAwICYmIGUgPD0gMTApICYmIHBhcnNlRmxvYXQoaW5wdXRzWzBdKSA8IGlucHV0c1sxXSkge1xcclxcbiAgICAgICAgICAgICAgICB0ZW1wLnNjb3JlID0gaW5wdXQucmVwbGFjZSgnLScsICcsJyk7XFxyXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJob3RMaXN0XFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+ato+ehrui+k+WFpSdcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9KVxcclxcblxcclxcbiAgICBsZXQgbCA9IFtdO1xcclxcbiAgICB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A9IGwubWFwKChlID0+IHtcXHJcXG4gICAgICAgIGxldCB0eXBlID0gZS50eXBlLFxcclxcbiAgICAgICAgICAgIGlkID0gZS5pZCxcXHJcXG4gICAgICAgICAgICB0aXRsZSA9IGUudGl0bGU7XFxyXFxuICAgICAgICBsZXQgdXNlQ29uZmlnID0gZGV0YWlsc1ZpZXdDb25maWdzW2RldGFpbHNWaWV3Q29uZmlncy51c2VdLmNvbmZpZztcXHJcXG4gICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXHJcXG4gICAgICAgIGlmICh1c2VDb25maWcuc3RhcnRzV2l0aCgneycpKSB7XFxyXFxuICAgICAgICAgICAgZXZhbCgndXJsUGFyYW1zID0gJyArIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcIiArICc/dHlwZT0nICsgdHlwZSArICcmaWQ9JyArIGlkKS5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICByZXR1cm4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biAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJjbGFzc2xpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgICAgICAgICB9LCBpdGVtc1tpdGVtXVtpXSwgaXRlbSk7XFxyXFxuICAgICAgICAgICAgXFxyXFxuICAgICAgICAgICAgaWYoaXRlbXNbaXRlbV1baV0gPT0gXFxcIuiHquWumuS5ieW5tOS7vVxcXCIpe1xcclxcbiAgICAgICAgICAgICAgICBpZih0ZW1wLnllYXIgPT0gXFxcIuiHquWumuS5ieW5tOS7vVxcXCIpe1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+6Ieq5a6a5LmJ5bm05Lu9OicgKyB0ZW1wLmN1c3RvbVllYXIgKyAnIDwvZm9udD48L2I+JztcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICBcXHJcXG4gICAgICAgICAgICAgICAgdXJsID0gJCh0ZW1wLmN1c3RvbVllYXIsICfnm7TmjqXovpPlhaXlhbfkvZPlubTku70s5L6L5aaCMjAwMCcpLmlucHV0KCgpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY2xhc3NsaXN0JykpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgaWYoaW5wdXQubGVuZ3RoID09IDQpe1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAuY3VzdG9tWWVhciA9IGlucHV0O1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAueWVhciA9IFxcXCLoh6rlrprkuYnlubTku71cXFwiO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJjbGFzc2xpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6K+35q2j56Gu6L6T5YWlJ1xcclxcbiAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICB9KTtcXHJcXG4gICAgICAgICAgICB9ZWxzZSBpZihpdGVtc1tpdGVtXVtpXSA9PSBcXFwi6Ieq5a6a5LmJ5Zyw5Yy6XFxcIil7XFxyXFxuICAgICAgICAgICAgICAgIGlmKHRlbXAubG9jYWwgPT0gXFxcIuiHquWumuS5ieWcsOWMulxcXCIpe1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+6Ieq5a6a5LmJ5Zyw5Yy6OicgKyB0ZW1wLmN1c3RvbUxvY2FsICsgJyA8L2ZvbnQ+PC9iPic7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgXFxyXFxuICAgICAgICAgICAgICAgIHVybCA9ICQodGVtcC5jdXN0b21Mb2NhbCwgJ+ebtOaOpei+k+WFpeWFt+S9k+WcsOWMuizkvovlpoLkuK3lm73lpKfpmYYnKS5pbnB1dCgoKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NsYXNzbGlzdCcpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGlmKGlucHV0Lmxlbmd0aCA+IDApe1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAuY3VzdG9tTG9jYWwgPSBpbnB1dDtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLmxvY2FsID0gXFxcIuiHquWumuS5ieWcsOWMulxcXCI7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImNsYXNzbGlzdFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/or7fmraPnoa7ovpPlhaUnXFxyXFxuICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIH0pO1xcclxcbiAgICAgICAgICAgIH1lbHNlIGlmKGl0ZW1zW2l0ZW1dW2ldID09IFxcXCLoh6rlrprkuYnnsbvlnotcXFwiKXtcXHJcXG4gICAgICAgICAgICAgICAgaWYodGVtcC50eXBlID09IFxcXCLoh6rlrprkuYnnsbvlnotcXFwiKXtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPuiHquWumuS5ieexu+WeizonICsgdGVtcC5jdXN0b21UeXBlICsgJyA8L2ZvbnQ+PC9iPic7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgXFxyXFxuICAgICAgICAgICAgICAgIHVybCA9ICQodGVtcC5jdXN0b21UeXBlLCAn55u05o6l6L6T5YWl5YW35L2T57G75Z6LLOS+i+WmguWJp+aDhScpLmlucHV0KCgpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY2xhc3NsaXN0JykpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgaWYoaW5wdXQubGVuZ3RoID4gMCl7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC5jdXN0b21UeXBlID0gaW5wdXQ7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC50eXBlID0gXFxcIuiHquWumuS5ieexu+Wei1xcXCI7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImNsYXNzbGlzdFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/or7fmraPnoa7ovpPlhaUnXFxyXFxuICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIH0pO1xcclxcbiAgICAgICAgICAgIH1lbHNlIGlmKGl0ZW1zW2l0ZW1dW2ldID09IFxcXCLoh6rlrprkuYnmoIfnrb5cXFwiKXtcXHJcXG4gICAgICAgICAgICAgICAgaWYodGVtcC5jbGFzcyA9PSBcXFwi6Ieq5a6a5LmJ5qCH562+XFxcIil7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz7oh6rlrprkuYnmoIfnrb46JyArIHRlbXAuY3VzdG9tQ2xhc3MgKyAnIDwvZm9udD48L2I+JztcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICBcXHJcXG4gICAgICAgICAgICAgICAgdXJsID0gJCh0ZW1wLmN1c3RvbUNsYXNzLCAn55u05o6l6L6T5YWl5YW35L2T5qCH562+LOS+i+Wmgue7j+WFuFxcXFxu5Y+v5YaZ5aSa5Liq5qCH562+LOS9v+eUqFxcXCLoi7HmlofpgJflj7dcXFwi5YiG6ZqUJykuaW5wdXQoKCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdjbGFzc2xpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICBpZihpbnB1dC5sZW5ndGggPiAwKXtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLmN1c3RvbUNsYXNzID0gaW5wdXQ7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC5jbGFzcyA9IFxcXCLoh6rlrprkuYnmoIfnrb5cXFwiO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJjbGFzc2xpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6K+35q2j56Gu6L6T5YWlJ1xcclxcbiAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICB9KTtcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6IHVybFxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxuXFxyXFxuICAgIGxldCByYW5rID0ge1xcclxcbiAgICAgICAg6buY6K6k5o6S5bqPOiBcXFwiVVxcXCIsXFxyXFxuICAgICAgICDng63luqY6IFxcXCJUXFxcIixcXHJcXG4gICAgICAgIOivhOWIhjogXFxcIlNcXFwiLFxcclxcbiAgICAgICAg5pe26Ze0OiBcXFwiUlxcXCJcXHJcXG4gICAgfVxcclxcbiAgICBmb3IgKGxldCByIGluIHJhbmspIHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IHRlbXAucmFuayA9PT0gcmFua1tyXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgciArICcgPC9mb250PjwvYj4nIDogcixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6IC8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY2xhc3NsaXN0JykpO1xcclxcbiAgICAgICAgICAgICAgICB0ZW1wLnJhbmsgPSBlO1xcclxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiY2xhc3NsaXN0XFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyX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7XFxyXFxuXFxyXFxuICAgIGxldCBkZXRhaWxzVmlld0NvbmZpZ3MgPSBnZXRDb25maWcoJ2RldGFpbHNWaWV3Q29uZmlncycpO1xcclxcbiAgICBsZXQgaSA9IGwubWFwKChlID0+IHtcXHJcXG4gICAgICAgIGxldCB0eXBlID0gZS50eXBlLFxcclxcbiAgICAgICAgICAgIGlkID0gZS5pZCxcXHJcXG4gICAgICAgICAgICB0aXRsZSA9IGUudGl0bGU7XFxyXFxuICAgICAgICBsZXQgdXNlQ29uZmlnID0gZGV0YWlsc1ZpZXdDb25maWdzW2RldGFpbHNWaWV3Q29uZmlncy51c2VdLmNvbmZpZztcXHJcXG4gICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXHJcXG4gICAgICAgIGlmICh1c2VDb25maWcuc3RhcnRzV2l0aCgneycpKSB7XFxyXFxuICAgICAgICAgICAgZXZhbCgndXJsUGFyYW1zID0gJyArIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcIiArICc/dHlwZT0nICsgdHlwZSArICcmaWQ9JyArIGlkKS5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAg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IGl0ZW1zID0ge1xcclxcbiAgICAgICAgdHlwZToge1xcclxcbiAgICAgICAgICAgIOWFqOmDqDogXFxcImFsbFxcXCIsXFxyXFxuICAgICAgICAgICAg6LGG55Oj54mH5Y2VOiBcXFwib2ZmaWNpYWxcXFwiLFxcclxcbiAgICAgICAgICAgIOeyvumAiTogXFxcInNlbGVjdGVkXFxcIixcXHJcXG4gICAgICAgICAgICDnu4/lhbg6IFxcXCJjbGFzc2ljYWxcXFwiLFxcclxcbiAgICAgICAgICAgIOiOt+WlljogXFxcInByaXplXFxcIixcXHJcXG4gICAgICAgICAgICDpq5jliIY6IFxcXCJoaWdoX3Njb3JlXFxcIixcXHJcXG4gICAgICAgICAgICDmppzljZU6IFxcXCJtb3ZpZV9saXN0XFxcIixcXHJcXG4gICAgICAgICAgICDlhrfpl6jkvbPniYc6IFxcXCJkYXJrX2hvcnNlXFxcIixcXHJcXG4gICAgICAgICAgICDkuLvpopg6IFxcXCJ0b3BpY1xcXCIsXFxyXFxuICAgICAgICAgICAg5a+85ryUOiBcXFwiZGlyZWN0b3JcXFwiLFxcclxcbiAgICAgICAgICAgIOa8lOWRmDogXFxcImFjdG9yXFxcIixcXHJcXG4gICAgICAgICAgICDns7vliJc6IFxcXCJzZXJpZXNcXFwiLFxcclxcbiAgICAgICAgICAgIOWNjuivrTogXFxcImNoaW5lc2VcXFwiLFxcclxcbiAgICAgICAgICAgIOasp+e+jjogXFxcIndlc3Rlcm5cXFwiLFxcclxcbiAgICAgICAgICAgIOaXpeacrDogXFxcImphcGFuZXNlXFxcIixcXHJcXG4gICAgICAgICAgICDpn6nlm706IFxcXCJrb3JlYVxcXCIsXFxyXFxuICAgICAgICAgICAg5Zac5YmnOiBcXFwiY29tZWR5XFxcIixcXHJcXG4gICAgICAgICAgICDliqjkvZw6IFxcXCJhY3Rpb25cXFwiLFxcclxcbiAgICAgICAgICAgIOeIseaDhTogXFxcImxvdmVcXFwiLFxcclxcbiAgICAgICAgICAgIOenkeW5uzogXFxcInNjaWVuY2VfZmljdGlvblxcXCIsXFxyXFxuICAgICAgICAgICAg5Yqo55S7OiBcXFwiY2FydG9vblxcXCIsXFxyXFxuICAgICAgICAgICAg5oKs55aROiBcXFwibXlzdGVyeVxcXCIsXFxyXFxuICAgICAgICAgICAg5oOK5oKaOiBcXFwicGFuaWNcXFwiLFxcclxcbiAgICAgICAgICAgIOaBkOaAljogXFxcImhvcnJpYmxlXFxcIixcXHJcXG4gICAgICAgICAgICDniq/nvao6IFxcXCJjcmltaW5hbFxcXCIsXFxyXFxuICAgICAgICAgICAg5ZCM5oCnOiBcXFwibGdidFxcXCIsXFxyXFxuICAgICAgICAgICAg5oiY5LqJOiBcXFwid2FyXFxcIixcXHJcXG4gICAgICAgICAgICDlpYflubs6IFxcXCJmYW50YXN5XFxcIixcXHJcXG4gICAgICAgICAgICBcXFwiXFxcXHU2MGM1XFxcXHU4MjcyXFxcIjogXFxcImVyb3RpY2FcXFwiLFxcclxcbiAgICAgICAgICAgIOmfs+S5kDogXFxcIm11c2ljXFxcIixcXHJcXG4gICAgICAgICAgICDnuqrlvZXniYc6IFxcXCJkb2N1bWVudGFyeVxcXCIsXFxyXFxuICAgICAgICAgICAg5rK75oSIOiBcXFwiY3VyZVxcXCIsXFxyXFxuICAgICAgICAgICAg6Im65pyvOiBcXFwiYXJ0XFxcIixcXHJcXG4gICAgICAgICAgICDpu5HoibLlub3pu5g6IFxcXCJkYXJrX2h1bW9yXFxcIixcXHJcXG4gICAgICAgICAgICDpnZLmmKU6IFxcXCJ5b3V0aFxcXCIsXFxyXFxuICAgICAgICAgICAg5aWz5oCnOiBcXFwiZmVtYWxlXFxcIixcXHJcXG4gICAgICAgICAgICDnnJ/lrp7kuovku7bmlLnnvJY6IFxcXCJyZWFsX2V2ZW50XFxcIixcXHJcXG4gICAgICAgICAgICDmmrTlips6IFxcXCJ2aW9sZW5jZVxcXCIsXFxyXFxuICAgICAgICAgICAg6buR55m9OiBcXFwiYmxhY2tfd2hpdGVcXFwiLFxcclxcbiAgICAgICAgICAgIOe+jumjnzogXFxcImZvb2RcXFwiLFxcclxcbiAgICAgICAgICAgIOaXheihjDogXFxcInRyYXZlbFxcXCIsXFxyXFxuICAgICAgICAgICAg5YS/56ulOiBcXFwiY2hpbGRcXFwiLFxcclxcbiAgICAgICAgICAgIOS6uuaApzogXFxcImh1bWFuaXR5XFxcIixcXHJcXG4gICAgICAgICAgICDlrrbluq06IFxcXCJmYW1pbHlcXFwiLFxcclxcbiAgICAgICAgICAgIOaWh+iJujogXFxcImxpdGVyYXJ5X2FydFxcXCIsXFxyXFxuICAgICAgICAgICAg5bCP6K+05pS557yWOiBcXFwibm92ZWxcXFwiLFxcclxcbiAgICAgICAgICAgIOaEn+S6ujogXFxcIm1vdmluZ1xcXCIsXFxyXFxuICAgICAgICAgICAg5Yqx5b+XOiBcXFwiaW5zcGlyYXRpb25cXFwiXFxyXFxuICAgICAgICB9LFxcclxcbiAgICAgICAgc3VidHlwZToge1xcclxcbiAgICAgICAgICAgIOWFqOmDqDogXFxcIlxcXCIsXFxyXFxuICAgICAgICAgICAg55S15b2xOiBcXFwibW92aWVcXFwiLFxcclxcbiAgICAgICAgICAgIOeUteinhuWJpzogXFxcInR2XFxcIlxcclxcbiAgICAgICAgfVxcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IGkgaW4gaXRlbXMpIHtcXHJcXG4gICAgICAgIGZvciAobGV0IGogaW4gaXRlbXNbaV0pIHtcXHJcXG4gICAgICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGVtcFtpXSA9PT0gaXRlbXNbaV1bal0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIGogKyAnIDwvZm9udD48L2I+JyA6IGosXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHQpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcigncGxheWxpc3QnLCAne1xcXCJzdWJ0eXBlXFxcIjpcXFwiXFxcIixcXFwidHlwZVxcXCI6XFxcImFsbFxcXCJ9JykpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGVtcFt0WzBdXSA9IHRbMV07XFxyXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwicGxheWxpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgICAgICB9LCBbaSwgaXRlbXNbaV1bal1dKVxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxuXFxyXFxuICAgIGxldCBzID0gZ2V0RG91YmFuUmVzKFxcXCJodHRwczovL2Zyb2RvLmRvdWJhbi5jb20vYXBpL3YyL3NreW5ldC9uZXdfcGxheWxpc3RzXFxcIiArIFxcXCI/Y2F0ZWdvcnk9XFxcIiArIHRlbXAudHlwZSArIFxcXCImc3ViamVjdF90eXBlPVxcXCIgKyB0ZW1wLnN1YnR5cGUgKyAocGFnZSA/IFxcXCImc3RhcnQ9XFxcIiArIChwYWdlIC0gMSkgKiBjb3VudCArIFxcXCImY291bnQ9XFxcIiArIGNvdW50IDogXFxcIiZzdGFydD0wJmNvdW50PTEwXFxcIikpO1xcclxcbiAgICBsZXQgbCA9IHMuZGF0YVswXS5pdGV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uICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgIH0sIGl0ZW1zW2ldKVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBhLnB1c2goe1xcclxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXHJcXG4gICAgfSlcXHJcXG5cXHJcXG4gICAgbGV0IGxpc3QgPSB7XFxyXFxuICAgICAgICDlj6PnopHmppzljZU6ICdyYW5rX2xpc3QnLFxcclxcbiAgICAgICAg5bm05bqm5qac5Y2VOiAneWVhcl9yYW5rcycsXFxyXFxuICAgICAgICDnsbvlnovmppzljZU6ICdjYXRlZ29yeV9yYW5rcydcXHJcXG4gICAgfVxcclxcbiAgICBmb3IgKGxldCBpIGluIGxpc3QpIHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IHRlbXAubGlzdCA9PSBsaXN0W2ldID8gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPicgKyBpICsgJyA8L2ZvbnQ+PC9iPicgOiBpLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxyXFxuICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ3JhbmtMaXN0JykpO1xcclxcbiAgICAgICAgICAgICAgICB0ZW1wLmxpc3QgPSBlO1xcclxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwicmFua0xpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZX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CF0ZW1wLnllYXIpIHRlbXAueWVhciA9IHRlbXAueWVhcl9saXN0c1swXS5rZXk7XFxyXFxuICAgICAgICBmb3IgKGxldCB0IG9mIHRlbXAueWVhcl9saXN0cykge1xcclxcbiAgICAgICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0ZW1wLnllYXIgPT0gdC5rZXkgPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIHQudGl0bGUgKyAnIDwvZm9udD48L2I+JyA6IHQudGl0bGUsXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGUpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcigncmFua0xpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0ZW1wLnllYXIgPSBlO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInJhbmtMaXN0XFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICAgICAgfSwgdC5rZXkpXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgfSBlbHNlIGlmICh0ZW1wLmxpc3QgPT0gJ2NhdGVnb3J5X3JhbmtzJykge1xcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgICAgIGlmICghdGVtcC5jYXRlZ29yeSkgdGVtcC5jYXRlZ29yeSA9IHRlbXAuY2F0ZWdvcnlfbGlzdHNbMF0ua2V5O1xcclxcbiAgICAgICAgZm9yIChsZXQgdCBvZiB0ZW1wLmNhdGVnb3J5X2xpc3RzKSB7XFxyXFxuICAgICAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRlbXAuY2F0ZWdvcnkgPT0gdC5rZXkgPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIHQudGl0bGUgKyAnIDwvZm9udD48L2I+JyA6IHQudGl0bGUsXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGUpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcigncmFua0xpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0ZW1wLmNhdGVnb3J5ID0gZTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJyYW5rTGlzdFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgICAgIH0sIHQua2V5KVxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9XFxyXFxuICAgIH1cXHJcXG5cXHJcXG4gICAgbGV0IGwgPSBbXTtcXHJcXG4gICAgaWYgKHRlbXAubGlzdCA9PSAncmFua19saXN0JyAmJiBNWV9QQUdFID09IDEpI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HJcXG4gICAgICAgIH0pKSk7XFxyXFxuICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICBpID0gbC5tYXAoKGUgPT4gKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogJycgLyon4oCc4oCc4oCd4oCdJyArIGUubWVkaXVtX25hbWUgKyAnXFxcXG4nICsgZ2V0U3Ryb25nVGV4dChlLnRpdGxlKSovICxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2NhcmRfcGljXzInLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eS8kcGFnZXtmeXBhZ2V9I25vSGlzdG9yeSMnKS5ydWxlKCh0eXBlLCBpZCwgc3RpdGxlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZShzdGl0bGUpO1xcclxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBzdWJqZWN0Q29sbGVjdGlvbkxpc3QoTVlfUEFHRSwgNTAsIGlkKTtcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIH0sIGUudHlwZSwgZS5pZCwgZS50aXRsZSksXFxyXFxuICAgICAgICAgICAgaW1nOiBlLmNvdmVyX3VybCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZS5jb3Zlcl91cmwsXFxyXFxuICAgICAgICAgICAgZGVzYzogXFxcIjBcXFwiXFxyXFxuICAgICAgICB9KSkpO1xcclxcbiAgICB9XFxyXFxuXFxyXFxuICAgIHJldHVybiBwYWdlID4gMSA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pTT04ucGFyc2UoZ2V0TXlWYXIoJ2NvbWluZycpKTtcXHJcXG4gICAgICAgICAgICAgICAgdGVtcC50eXBlID0gZTtcXHJcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImNvbWluZ1xcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgIH0sIGl0ZW1zW2ldKVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcbiAgICBsZXQgcmFuayA9IHtcXHJcXG4gICAgICAgIOeDreW6pjogJyZzb3J0Ynk9aG90JyxcXHJcXG4gICAgICAgIOaXtumXtDogJydcXHJcXG4gICAgfVxcclxcbiAgICBhLnB1c2goe1xcclxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXHJcXG4gICAgfSlcXHJcXG4gICAgZm9yIChsZXQgaSBpbiByYW5rKSB7XFxyXFxuICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiB0ZW1wLnJhbmsgPT09IHJhbmtbaV0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIGkgKyAnIDwvZm9udD48L2I+JyA6IGksXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY29taW5nJykpO1xcclxcbiAgICAgICAgICAgICAgICB0ZW1wLnJhbmsgPSBlO1xcclxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiY29taW5nXFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgfSwgcmFua1tpXSlcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH1cXHJcXG4gICAgbGV0IGxvY2FsID0ge1xcclxcbiAgICAgICAg5Zu95YaFOiAnZG9tZXN0aWMnLFxcclxcbiAgICAgICAg5YWo55CDOiAnaW50ZXJuYXRpb25hbCdcXHJcXG4gICAgfVxcclxcbiAgICBpZiAodGVtcC50eXBlID09ICdtb3ZpZScpIHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgICAgICBmb3IgKGxldCBpIGluIGxvY2FsKSB7XFxyXFxuICAgICAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRlbXAubG9jYWwgPT09IGxvY2FsW2ldID8gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPicgKyBpICsgJyA8L2ZvbnQ+PC9iPicgOiBpLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NvbWluZycpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRlbXAubG9jYWwgPSBlO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXl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gICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdjb21pbmcnKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0ZW1wLmFyZWEgPSBlO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImNvbWluZ1xcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgICAgIH0sIGFyZWFbaV0pXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgfVxcclxcbiAgICBsZXQgZmlsdGVyID0ge1xcclxcbiAgICAgICAg5YWo6YOoOiAnJyxcXHJcXG4gICAgICAgIOWbveS6p+WJpzogJyZ0eXBlX2ZpbHRlcj10dl9kb21lc3RpYycsXFxyXFxuICAgICAgICDmrKfnvo7liac6ICcmdHlwZV9maWx0ZXI9dHZfYW1lcmljYW4nLFxcclxcbiAgICAgICAg5pel5YmnOiAnJnR5cGVfZmlsdGVyPXR2X2phcGFuZXNlJyxcXHJcXG4gICAgICAgIOmfqeWJpzogJyZ0eXBlX2ZpbHRlcj10dl9rb3JlYW4nLFxcclxcbiAgICAgICAg5Yqo55S7OiAnJnR5cGVfZmlsdGVyPXR2X2FuaW1hdGlvbicsXFxyXFxuICAgICAgICDlm73lhoXnu7zoibo6ICcmdHlwZV9maWx0ZXI9c2hvd19kb21lc3RpYycsXFxyXFxuICAgICAgICDlm73lpJbnu7zoibo6ICcmdHlwZV9maWx0ZXI9c2hvd19mb3JlaWduJ1xcclxcbiAgICB9XFxyXFxuICAgIGlmICh0ZW1wLnR5cGUgPT0gJ3R2Jykge1xcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgICAgIGZvciAobGV0IGkgaW4gZmlsdGVyKSB7XFxyXFxuICAgICAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRlbXAuZmlsdGVyID09PSBmaWx0ZXJbaV0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIGkgKyAnIDwvZm9udD48L2I+JyA6IGksXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGUpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY29taW5nJykpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGVtcC5maWx0ZXIgPSBlO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImNvbWluZ1xcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgICAgIH0sIGZpbHRlcltpXSlcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcbiAgICB9XFxyXFxuXFxyXFxuICAgIGxldCBzID0gZ2V0RG91YmFuUmVzKFxcXCJodHRwczovL2Zyb2RvLmRvdWJhbi5jb20vYXBpL3YyL1xcXCIgKyB0ZW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gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmV0dXJuIHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUgKyBcXFwi77yIXFxcIiArIGUueWVhciArIFxcXCLvvIlcXFwiLFxcclxcbiAgICAgICAgICAgIHVybDogdXJsUGFyYW1zLnVybCxcXHJcXG4gICAgICAgICAgICBleHRyYTogdXJsUGFyYW1zLmV4dHJhLFxcclxcbiAgICAgICAgICAgIGltZzogZS5jb3Zlcl91cmwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGUuY292ZXJfdXJsLFxcclxcbiAgICAgICAgICAgIGRlc2M6IFxcXCLkuIrmmKDml6XmnJ86XFxcIiArIGUucHViZGF0ZSArIFxcXCJcXFxcblxcXCIgKyBlLndpc2hfY291bnQgKyBcXFwi5Lq65oOz55yLXFxcIiArIFxcXCJcXFxcblxcXCIgKyBlLm51bGxfcmF0aW5nX3JlYXNvblxcclxcbiAgICAgICAgfVxcclxcbiAgICB9KSk7XFxyXFxuXFxyXFxuICAgIHJldHVybiBwYWdlID4gMSA/IGkgOiBhLmNvbmNhdChpKTtcXHJcXG59XFxyXFxuXFxyXFxuLy/niYfljZXor6bmg4VcXHJcXG5mdW5jdGlvbiBzdWJqZWN0Q29sbGVjdGlvb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5lc2VfYmVzdF93ZWVrbHknLFxcclxcbiAgICAgICAgICAgIOWbveWkluWPo+eikee7vOiJujogJ3Nob3dfZ2xvYmFsX2Jlc3Rfd2Vla2x5J1xcclxcbiAgICAgICAgfVxcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IGkgaW4gaXRlbXMpIHtcXHJcXG4gICAgICAgIGZvciAobGV0IGogaW4gaXRlbXNbaV0pIHtcXHJcXG4gICAgICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGVtcC5pdGVtID09IGl0ZW1zW2ldW2pdID8gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPicgKyBqICsgJyA8L2ZvbnQ+PC9iPicgOiBqLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ3JhbmtpbmcnKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0ZW1wLml0ZW0gPSBlO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInJhbmtpbmdcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgICAgICB9LCBpdGVtc1tpXVtqXSlcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBhLnB1c2goe1xcclxcbiAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXHJcXG4gICAgfSlcXHJcXG5cXHJcXG4gICAgbGV0IGkgPSBbXTtcXHJcXG4gICAgbGV0IHBsYXlhYmxlID0ge1xcclxcbiAgICAgICAg5YWo6YOo5b2x54mHOiAnMCcsXFxyXFxuICAgICAgICDku4XmnInniYfmupA6ICcxJ1xcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IHIgaW4gcGxheWFibGUpIHtcXHJcXG4gICAgICAgIGkucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IHRlbXAucGxheWFibGUgPT0gcGxheWFibGVbcl0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIHIgKyAnIDwvZm9udD48L2I+JyA6IHIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOiAvL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ3JhbmtpbmcnKSk7XFxyXFxuICAgICAgICAgICAgICAgIHRlbXAucGxheWFibGUgPSBlO1xcclxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwicmFua2luZ1xcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgIH0sIHBsYXlhYmxlW3JdKVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBpLnB1c2goe1xcclxcbiAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz7or4TliIbljLrpl7Q6JyArIHRlbXAuc2NvcmUgKyAnIDwvZm9udD48L2I+JyxcXHJcXG4gICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxyXFxuICAgICAgICB1cmw6ICQodGVtcC5zY29yZSwgJ+ivhOWIhuW6lOWcqDAtMTDkuYvpl7QnKS5pbnB1dCgoKSA9PiB7XFxyXFxuICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdyYW5raW5nJykpO1xcclxcbiAgICAgICAgICAgIGxldCBpbnB1dHMgPSBpbnB1dC5zcGxpdCgnLScpO1xcclxcbiAgICAgICAgICAgIGlmIChpbnB1dHMubGVuZ3RoID09IDIgJiYgaW5wdXRzLmV2ZXJ5KGUgPT4gZSA+PSAwICYmIGUgPD0gMTApICYmIHBhcnNlRmxvYXQoaW5wdXRzWzBdKSA8IGlucHV0c1sxXSkge1xcclxcbiAgICAgICAgICAgICAgICB0ZW1wLnNjb3JlID0gaW5wdXQ7XFxyXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJyYW5raW5nXFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+ato+ehrui+k+WFpSdcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9KVxcclxcblxcclxcbiAgICBsZXQgdCA9IGdldERvdWJhblJlcyhcXFwiaHR0cHM6Ly9mcm9kby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09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmV0dXJuIHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYycsXFxyXFxuICAgICAgICAgICAgdXJsOiB1cmxQYXJhbXMudXJsLFxcclxcbiAgICAgICAgICAgIGV4dHJhOiB1cmxQYXJhbXMuZXh0cmEsXFxyXFxuICAgICAgICAgICAgaW1nOiBlLnBpYy5ub3JtYWwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGUucGljLm5vcm1hbCxcXHJcXG4gICAgICAgICAgICBkZXNjOiBlLmNhcmRfc3VidGl0bGUuc3BsaXQoXFxcIi9cXFwiKS5maWx0ZXIoKChlLCB0KSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh0IDwgMykgcmV0dXJuIGVcXHJcXG4gICAgICAgICAgICB9KSkuam9pbihcXFwiLFxcXCIpICsgXFxcIlxcXFxuXFxcIiArIChlLnJhdGluZyA/IGNvbXB1dGVSYXRpbmcoZS5yYXRpbmcubWF4LCBlLnJhdGluZy52YWx1ZSkgKyBcXFwiIFxcXCIgKyBlLnJhdGluZy52YWx1ZS50b0ZpeGVkKDEpICsgXFxcIuWIhlxcXCIgOiB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RsZSA9IGUuY29udGVudC5zdWJqZWN0LnRpdGxlO1xcclxcbiAgICAgICAgbGV0IHVzZUNvbmZpZyA9IGRldGFpbHNWaWV3Q29uZmlnc1tkZXRhaWxzVmlld0NvbmZpZ3MudXNlXS5jb25maWc7XFxyXFxuICAgICAgICBsZXQgdXJsUGFyYW1zID0ge307XFxyXFxuICAgICAgICBpZiAodXNlQ29uZmlnLnN0YXJ0c1dpdGgoJ3snKSkge1xcclxcbiAgICAgICAgICAgIGV2YWwoJ3VybFBhcmFtcyA9ICcgKyB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICB1cmxQYXJhbXMudXJsID0gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI2ltbWVyc2l2ZVRoZW1lI1xcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZCkucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmV0dXJuIHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxyXFxuICAgICAgICAgICAgdXJsOiB1cmxQYXJhbXMudXJsLFxcclxcbiA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L+h5oGvdGl0bGXkvJrlvojplb8pXFxyXFxuICAgIGlmICghY29sKSBjb2wgPSBbJ2ljb25fMicsICdpY29uX3NtYWxsXzQnXTtcXHJcXG4gICAgaWYgKCFsYXp5KSBsYXp5ID0gJ3JldHVybiBpbnB1dCc7XFxyXFxuICAgIGxldCByZXMgPSBfcmVzIHx8IGdldERvdWJhblJlcyhcXFwiaHR0cHM6Ly9mcm9kby5kb3ViYW4uY29tL2FwaS92Mi9cXFwiICsgdHlwZSArIFxcXCIvXFxcIiArIGlkKTtcXHJcXG4gICAgZm9yIChsZXQgaXRlbSBpbiByZXMudmVuZG9ycykge1xcclxcbiAgICAgICAgbGV0IGUgPSByZXMudmVuZG9yc1tpdGVtXTtcXHJcXG4gICAgICAgIGlmICh0eXBlID09PSBcXFwidHZcXFwiKSB7XFxyXFxuICAgICAgICAgICAgZC5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGUudGl0bGUgKyAoZS5lcGlzb2Rlc19pbmZvID8gXFxcIuKAolxcXCIgKyBlLmVwaXNvZGVzX2luZm8gOiBcXFwiXFxcIiksXFxyXFxuICAgICAgICAgICAgICAgIGltZzogZS5pY29uLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogY29sWzBdIHx8IFxcXCJpY29uXzJcXFwiLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHk/aWQ9JyArIGlkICsgJyZ0eXBlPScgKyB0eXBlICsgJyZ0aXRsZT0nICsgZS50aXRsZSkucnVsZSgocmVzLCBpZCwgZSwgbGF6eSwgZXh0cmEpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHJlcy50aXRsZSxcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBwaWMgPSByZXMucGljLm5vcm1hbCArIFxcXCJAUmVmZXJlcj1cXFwiICsgcmVzLnBpYy5ub3JtYWw7XFxyXFxuICAgICAgICAgICAgICAgICAgICBzZXRQYWdlVGl0bGUoZS50aXRsZSArICctJyArIHRpdGxlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0UGFnZVBpY1VybChwaWMpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB1cmxzID0gZ2V0VHZVcmxzKGlkLCBlLmlkKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxhenkgPSAkKFxcXCJcXFwiKS5sYXp5UnVsZShsYXp5ID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVzdWx0VXJsID0gXFxcInRvYXN0Oi8v6Kej5p6Q5aSx6LSlXFxcIjtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobGF6eS5zdGFydHNXaXRoKFxcXCIoXFxcIikpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoJ3Jlc3VsdFVybCA9ICcgKyBsYXp5KVxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCgncmVzdWx0VXJsID0gJyArICcoKCkgPT4geycgKyBsYXp5ICsgJ30pKCknKVxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coZS5tZXNzYWdlKVxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0VXJsXFxyXFxuICAgICAgICAgICAgICAgICAgICB9LCBsYXp5KVxcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YodXJscykgPT0gXFxcIm9iamVjdFxcXCIpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZCA9IFtdO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdXJscy5sZW5ndGg7IGkrKykge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfnrKwnICsgKGkgKyAxKSArICfpm4YnLFxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzQnLFxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBsYXp5ID8gdXJsc1tpXSArIGxhenkgOiB1cmxzW2ldLFxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IGV4dHJhXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZW9mKHVybHMpID09IFxcXCJzdHJpbmdcXFwiICYmIHVybHMgPT0gJ+iiq+WwgWlwJykge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBydWxlID0gSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL3BhZ2UvcmVsZWFzZUlQP3J1bGU95Yqo5ryrXFxcIikpXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ydWxlO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwocnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZih1cmxzKSA9PSAnc3RyaW5nJyAmJiB1cmxzID09ICfmsqHmnInmlLblvZUnKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+ixhueTo+ayoeacieaUtuW9leatpOinhumikea6kOeahOivpue7huS/oeaBrycsXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6ICfngrnmiJHlj6/ku6Xljrvop4bpopHmupDnvZHnq5nnnIvnnIsnLFxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGUudXJsXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIH0sIHJlcywgaWQsIGUsIGxhenksIGV4dHJhKVxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT09ICdtb3ZpZScpIHtcXHJcXG4gICAgICAgICAgICBsZXQgbUxhenkgPSAkKFxcXCJcXFwiKS5sYXp5UnVsZShsYXp5ID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IHJlc3VsdFVybCA9IFxcXCJ0b2FzdDovL+ino+aekOWksei0pVxcXCI7XFxyXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBpZiAobGF6eS5zdGFydHNXaXRoKFxcXCIoXFxcIikpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKCdyZXN1bHRVcmwgPSAnICsgbGF6eSlcXHJcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCgncmVzdWx0VXJsID0gJyArICcoKCkgPT4geycgKyBsYXp5ICsgJ30pKCknKVxcclxcbiAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsb2coZS5tZXNzYWdlKVxcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHRVcmxcXHJcXG4gICAgICAgICAgICB9LCBsYXp5KVxcclxcbiAgICAgICAgICAgIGQucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBlLnRpdGxlICsgKGUuZXBpc29kZXNfaW5mbyA/IFxcXCLigKJcXFwiICsgZS5lcGlzb2Rlc19pbmZvIDogXFxcIlxcXCIpLFxcclxcbiAgICAgICAgICAgICAgICBpbWc6IGUuaWNvbixcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IGNvbFsxXSB8fCBcXFwiaWNvbl9zbWFsbF80XFxcIixcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiBtTGF6eSA/IGUudXJsICsgbUxhenkgOiBlLnVybCxcXHJcXG4gICAgICAgICAgICAgICAgZXh0cmE6IGV4dHJhXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgfVxcclxcbn1cXHJcXG5cXHJcXG4vL+iOt+WPlueUteinhuWJp+WIhumbhumTvuaOpSxpZOaYr+eJh+WtkOe8luWPtyx1aWTmmK/op4bpopHmupDnvJblj7dcXHJcXG5mdW5jdGlvbiB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FxuICAgICAgICAgICAgY250djogMTIsXFxyXFxuICAgICAgICAgICAgY2N0djY6IDEzLFxcclxcbiAgICAgICAgICAgIG1pZ3V2aWRlbzogMTUsXFxyXFxuICAgICAgICAgICAgeGlndWE6IDE3LFxcclxcbiAgICAgICAgICAgIGFjZnVuOiAxOCxcXHJcXG4gICAgICAgICAgICBtYWlkdWlkdWk6IDE5XFxyXFxuICAgICAgICB9O1xcclxcbiAgICAgICAgbGV0IG51bSA9IHNbdWlkXTtcXHJcXG5cXHJcXG4gICAgICAgIHZhciBzb3VyY2VzID0ge307XFxyXFxuICAgICAgICBsZXQgc2wgPSBodG1sLm1hdGNoKC9zb3VyY2VzXFxcXFtbMS05XXsxLDJ9XFxcXF1bXFxcXHNcXFxcU10qP1xcXFxdL2cpO1xcclxcbiAgICAgICAgaWYgKHNsKSB7XFxyXFxuICAgICAgICAgICAgZm9yICh2YXIgaSBpbiBzbCkge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKHNsW2ldKTtcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgIGxldCBzY3JpcHRfbGlzdCA9IHBhcnNlRG9tRm9yQXJyYXkoaHRtbCwgJ2JvZHkmJnNjcmlwdFtzcmNdJyk7XFxyXFxuICAgICAgICAgICAgbGV0IHNvdXJjZXNfdXJsID0gXFxcIlxcXCI7XFxyXFxuICAgICAgICAgICAgZm9yIChsZXQgaSBpbiBzY3JpcHRfbGlzdCkge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdXJsID0gcGFyc2VEb21Gb3JIdG1sKHNjcmlwdF9saXN0W2ldLCAnc2NyaXB0JiZzcmMnKTtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKHVybC5pbmRleE9mKCdtaXhlZF9zdGF0aWMnKSAhPT0gLTEpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHNvdXJjZXNfdXJsID0gdXJsO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIGxldCBzb3VyY2VzX2xpc3QgPSByZXF1ZXN0KHNvdXJjZXNfdXJsKS5tYXRjaCgvc291cmNlc1xcXFxbWzEtOV17MSwyfVxcXFxdW1xcXFxzXFxcXFNdKj9cXFxcXS9nKTtcXHJcXG4gICAgICAgICAgICBmb3IgKHZhciBpIGluIHNvdXJjZXNfbGlzdCkge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKHNvdXJjZXNfbGlzdFtpXSk7XFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgfVxcclxcblxcclxcbiAgICAgICAgbGV0IHJlbiA9IHNvdXJjZXNbbnVtXTtcXHJcXG4gICAgICAgIGlmIChyZW4gJiYgcmVuLmxlbmd0aCA+IDApIHtcXHJcXG4gICAgICAgICAgICAvKnZhciByID0gcmVuLm1hcChlID0+IHVuZXNjYXBlKGUucGxheV9saW5rLnJlcGxhY2UoLyhodHRwc3xodHRwKTpcXFxcL1xcXFwvd3d3LmRvdWJhbi5jb21cXFxcL2xpbmsyXFxcXC9cXFxcP3VybD0vLCAnJylcXHJcXG4gICAgICAgICAgICAgICAgLnNwbGl0KCc7JylbMF0uc3BsaXQoJy5odG1sJylbMF0gKyAnLmh0bWwnKSkqL1xcclxcbiAgICAgICAgICAgIHZhciByID0gcmVuLm1hcChlID0+IHVuZXNjYXBlKGUucGxheV9saW5rLnNwbGl0KCc/dXJsPScpWzFdLnNwbGl0KCcmJylbMF0pKVxcclxcblxcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmV0dXJuIHIgfHwgJ+ayoeacieaUtuW9lSc7XFxyXFxuICAgIH1cXHJcXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLorr7nva7pobVcIixcInBhdGhcIjpcInNldHRpbmdQYWdlXCIsXCJydWxlXCI6XCJqczpcXG5ldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaG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6bmg4XpobXpnaLphY3nva4nKVxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImlucHV0X25hbWVcXFwiLCBjb25maWdLZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImlucHV0X2NvZGVcXFwiLCBjb25maWcuZGV0YWlsc1ZpZXdDb25maWdzW2NvbmZpZ0tleV0uY29uZmlnKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJpbnB1dF9zZXR0aW5nX2NvZGVcXFwiLCBjb25maWcuZGV0YWlsc1ZpZXdDb25maWdzW2NvbmZpZ0tleV0uc2V0dGluZyB8fCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9zZXR0aW5nLWVkaXRvcj9ydWxlPeWKqOa8qyZ2aWV3PWRldGFpbFZpZXdNb2RlRWRpdFBhZ2UnO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGNvbmZpZy5kZXRhaWxzVmlld0NvbmZpZ3MudXNlID0gY29uZmlnS2V5XFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liIfmjaLmiJDlip8nXFxuICAgICAgICAgICAgfSwgY29uZmlnS2V5KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJ1xcbiAgICAgICAgfSlcXG4gICAgfVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXG4gICAgfSlcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn4p6VJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAnaGlrZXI6Ly9wYWdlL3NldHRpbmctZWRpdG9yP3J1bGU95Yqo5ryrJnZpZXc9ZGV0YWlsVmlld01vZGVFZGl0UGFnZSdcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+KelicsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJChPYmplY3Qua2V5cyhkZXRhaWxzVmlld0NvbmZpZ3MpLmZpbHRlcihjb25maWdLZXkgPT4gY29uZmlnS2V5ICE9PSAndXNlJyAmJiBjb25maWdLZXkgIT09ICfpu5jorqQnKSwgMilcXG4gICAgICAgICAgICAuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSAn6buY6K6kJykgcmV0dXJuICd0b2FzdDovL+m7mOiupOmFjee9ruaXoOazleWIoOmZpO+8gSdcXG4gICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSlcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBjb25maWcuZGV0YWlsc1ZpZXdDb25maWdzLnVzZSkgcmV0dXJuICd0b2FzdDovL+ivpemFjee9ruato+WcqOS9v+eUqO+8jOaXoOazleWIoOmZpO+8gSdcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoJ+ehruiupOWIoOmZpFxcXCInICsgaW5wdXQgKyAnXFxcIu+8nycpLmNvbmZpcm0oKGNvbmZpZywgY29uZmlnS2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgY29uZmlnLmRldGFpbHNWaWV3Q29uZmlnc1tjb25maWdLZXldXFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSl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sZTogJ+iHquWumuS5ieino+aekOaPkuS7ticuYm9sZCgpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxuICAgIH0pXFxuICAgIGZvciAobGV0IGNvbmZpZ0tleSBvZiBPYmplY3Qua2V5cyhhbmFseXNpc0NvbmZpZ3MpKSB7XFxuICAgICAgICBpZiAoY29uZmlnS2V5ID09PSAndXNlJykgY29udGludWU7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBjb25maWdLZXkgPT09IGFuYWx5c2lzQ29uZmlncy51c2UgPyBcXFwi4oCc4oCcXFxcIiArIGNvbmZpZ0tleSArIFxcXCLigJ3igJ1cXFwiIDogY29uZmlnS2V5LFxcbiAgICAgICAgICAgIHVybDogJChcXFwiaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoY29uZmlnS2V5ID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSlcXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5hbmFseXNpc0NvbmZpZ3MudXNlID09PSBjb25maWdLZXkpIHtcXG4gICAgICAgICAgICAgICAgICAgIC8vcHV0TXlWYXIoXFxcImlucHV0X2NvbmZpZ190eXBlXFxcIiwgJ+ino+aekOaPkuS7tumFjee9ricpXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaW5wdXRfbmFtZVxcXCIsIGNvbmZpZ0tleSk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaW5wdXRfY29kZVxcXCIsIGNvbmZpZy5hbmFseXNpc0NvbmZpZ3NbY29uZmlnS2V5XS5jb25maWcpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImlucHV0X2V4dHJhXFxcIiwgY29uZmlnLmFuYWx5c2lzQ29uZmln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An4p6WJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAkKE9iamVjdC5rZXlzKGFuYWx5c2lzQ29uZmlncykuZmlsdGVyKGNvbmZpZ0tleSA9PiBjb25maWdLZXkgIT09ICd1c2UnICYmIGNvbmZpZ0tleSAhPT0gJ+S4jeino+aekCcgJiYgY29uZmlnS2V5ICE9PSAn5pat5o+SJyksIDIpXFxuICAgICAgICAgICAgLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gJ+S4jeino+aekCcgJiYgaW5wdXQgPT09ICfmlq3mj5InKSByZXR1cm4gJ3RvYXN0Oi8v6buY6K6k6Kej5p6Q5peg5rOV5Yig6Zmk77yBJ1xcbiAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKVxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT09IGNvbmZpZy5hbmFseXNpc0NvbmZpZ3MudXNlKSByZXR1cm4gJ3RvYXN0Oi8v6K+l6Kej5p6Q5q2j5Zyo5L2/55So77yM5peg5rOV5Yig6Zmk77yBJ1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJCgn56Gu6K6k5Yig6ZmkXFxcIicgKyBpbnB1dCArICdcXFwi77yfJykuY29uZmlybSgoY29uZmlnLCBjb25maWdLZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBjb25maWcuYW5hbHlzaXNDb25maWdzW2NvbmZpZ0tleV1cXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIoOmZpCcgKyBjb25maWdLZXkgKyAn5oiQ5YqfJ1xcbiAgICAgICAgICAgICAgICB9LCBjb25maWcsIGlucHV0KVxcbiAgICAgICAgICAgIH0pXFxuICAgIH0pXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ/Cfk50nLFxcbiAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxuICAgICAgICB1cmw6ICQoT2JqZWN0LmtleXMoYW5hbHlzaXNDb25maWdzKS5maWx0ZXIoY29uZmlnS2V5ID0+IGNvbmZpZ0tleSAhPT0gJ3VzZScpLCAyKVxcbiAgICAgICAgICAgIC5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAvLyBpZiAoaW5wdXQgPT09ICfkuI3op6PmnpAnICYmIGlucHV0ID09PSAn5pat5o+SJykgcmV0dXJuICd0b2FzdDovL+m7mOiupOino+aekOaXoOazlee8lui+ke+8gSdcXG4gICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgICAgIGxldCBjb25maWdLZXkgPSBpbnB1dDtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImlucHV0X25hbWVcXFwiLCBjb25maWdLZXkpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaW5wdXRfY29kZVxcXCIsIGNvbmZpZy5hbmFseXNpc0NvbmZpZ3NbY29uZmlnS2V5XS5jb25maWcpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaW5wdXRfZXh0cmFcXFwiLCBjb25maWcuYW5hbHlzaXNDb25maWdzW2NvbmZpZ0tleV0uZXh0cmEgfHwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaW5wdXRfc2V0dGluZ19jb2RlXFxcIiwgY29uZmlnLmFuYWx5c2lzQ29uZmlnc1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AgICB9KVxcbiAgICBmb3IgKGxldCBjb25maWdLZXkgb2YgcXVpY2tTZWFyY2hDb25maWdzLm9yZGVyKSB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBjb25maWdLZXksXFxuICAgICAgICAgICAgdXJsOiAkKCfinpXmmK/mt7vliqBcXFxcbuKeluaYr+WIoOmZpFxcXFxu8J+TneaYr+S/ruaUuVxcXFxu8J+UgeaYr+aOkuW6j1xcXFxu4pqZ77iP5piv6K6+572u5qC35byPJykuY29uZmlybSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kuIvmrKHkuI3opoHlho3ngrnmiJHkuoYnXFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbidcXG4gICAgICAgIH0pXFxuICAgIH1cXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxuICAgIH0pXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+Kele+4jycsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJCgn5pi+56S65ZCNQEDlsI/nqIvluo/lkI1AQOWbvueJh+mTvuaOpScsICfmoLnmja7mj5DnpLrovpPlhaXlsLHlpb3kuoZcXFxcbuWwj+eoi+W6j+WQjeS4uuepuuWImeS4uua1t+mYlOaQnOe0oicpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgaW5wdXQgPSBpbnB1dC5zcGxpdCgnQEAnKTtcXG4gICAgICAgICAgICBpZihpbnB1dC5sZW5ndGggIT0gMyB8fCBpbnB1dFswXSA9PT0gXFxcIlxcXCIpIHJldHVybiBcXFwidG9hc3Q6Ly/moLzlvI/kuI3lr7nvvIzmjInmoLzlvI/ovpPlhaUhXFxcIjtcXG4gICAgICAgICAgICBpZiAoY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlci5pbmRleE9mKGlucHV0WzBdKSA9PSAtMSkgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlci5wdXNoKGlucHV0WzBdKTtcXG4gICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzW2lucHV0WzBdXSA9IHtcXG4gICAgICAgICAgICAgICAgbmFtZTogaW5wdXRbMV0sXFxuICAgICAgICAgICAgICAgIHBpYzogaW5wdXRbMl1cXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+a3u+WKoOaIkOWKnyc7XFxuICAgICAgICB9KVxcbiAgICB9KTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn4p6WJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAkKHF1aWNrU2VhcmNoQ29uZmlncy5vcmRlciwgMikuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKVxcbiAgICAgICAgICAgIHJldHVybiAkKCfnoa7orqTliKDpmaRcXFwiJyArIGlucHV0ICsgJ1xcXCLvvJ8nKS5jb25maXJtKChjb25maWcsIGNvbmZpZ0tleSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgaW5kZXggPSBjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm9yZGVyLmluZGV4T2YoY29uZmlnS2V5KTtcXG4gICAgICAgICAgICAgICAgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlci5zcGxpY2UoaW5kZXgsIDEpO1xcbiAgICAgICAgICAgICAgICBkZWxldGUgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlnc1tjb25maWdLZXldXFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liKDpmaQnICsgY29uZmlnS2V5ICsgJ+aIkOWKnydcXG4gICAgICAgICAgICB9LCBjb25maWcsIGlucHV0KVxcbiAgICAgICAgfSlcXG4gICAgfSlcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn8J+TnScsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJChxdWlja1NlYXJjaENvbmZpZ3Mub3JkZXIsIDIpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgbGV0IHF1aWNrU2VhcmNoQ29uZmlncyA9IGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3M7XFxuICAgICAgICAgICAgbGV0IGR0ZXh0ID0gaW5wdXQgKyAnQEAnICsgcXVpY2tTZWFyY2hDb25maWdzW2lucHV0XS5uYW1lICsgJ0BAJyArIHF1aWNrU2VhcmNoQ29uZmlnc1tpbnB1dF0ucGljO1xcbiAgICAgICAgICAgIHJldHVybiAkKGR0ZXh0LCAn6K+35L+u5pS5JykuaW5wdXQoKGNvbmZpZywgcmF3KSA9PiB7XFxuICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXQuc3BsaXQoJ0BAJyk7XFxuICAgICAgICAgICAgICAgIGlmIChyYXcgIT0gaW5wdXRbMF0pIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpbmRleCA9IGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3Mub3JkZXIuaW5kZXhPZihyYXcpO1xcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlcltpbmRleF0gPSBpbnB1dFswXTtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBjb25maWcucXVpY2tTZWFyY2hDb25maWdzW3Jhd107XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3Mub3JkZXIuaW5kZXhPZihpbnB1dFswXSkgPT0gLTEpIGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3Mub3JkZXIucHVzaChpbnB1dFswXSk7XFxuICAgICAgICAgICAgICAgIGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3NbaW5wdXRbMF1dID0ge1xcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogaW5wdXRbMV0sXFxuICAgICAgICAgICAgICAgICAgICBwaWM6IGlucHV0WzJdXFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55oiQ5YqfJztcXG4gICAgICAgICAgICB9LCBjb25maWcsIGlucHV0KVxcbiAgICAgICAgfSlcXG4gICAgfSlcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn8J+UgScsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjJykucnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgYWRkTGlzdGVuZXIoJ29uQ2xvc2UnLCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignanNvbicpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdvcCcpO1xcbiAgICAgICAgICAgIH0pKVxcbiAgICAgICAgICAgIGlmIChnZXRNeVZhcignanNvbicpID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpO1xcbiAgICAgICAgICAgICAgICBsZXQgcXVpY2tTZWFyY2hDb25maWdzID0gY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncztcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2pzb24nLCBKU09OLnN0cmluZ2lmeShxdWlja1NlYXJjaENvbmZpZ3MpKTtcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgbGV0IG9sZCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2pzb24nKSk7XFxuICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+WIhuWIq+eCueWHu+S4pOmhueS7peS6pOaNoumhuuW6j1xcXFxu4oCY4oCY5o6S5bqP5a6M5q+V5ZCO54K55oiR5L+d5a2Y5o6S5bqPLOWQpuWImeaOkuW6j+S4jeeUn+aViOKAmeKAmScsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzID0gSlNPTi5wYXJzZShnZXRNeVZhcignanNvbicpKTtcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICAgICAgICAgIGJhY2sodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55oiQ5YqfJ1xcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgb2xkLm9yZGVyLmZvckVhY2goKHZhbHVlLCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGdldE15VmFyKCdvcCcpID09IHZhbHVlID8gdmFsdWUgKyAn4oCY4oCYKOW9k+WJjemAieS4rSnigJnigJknIDogdmFsdWUsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoa2V5LCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvcCA9IGdldE15VmFyKCdvcCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcCA9PSAnJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignb3AnLCBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChvcCA9PSBrZXkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignb3AnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvbGQgPSBKU09OLnBhcnNlKGdldE15VmFyKCdqc29uJykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV3YSA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGU6IG9sZC5tb2RlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3JkZXI6IG9sZC5vcmRlclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgb3BpbmRleCA9IG5ld2Eub3JkZXIuaW5kZXhPZihvcCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChNYXRoLmFicyhvcGluZGV4IC0gaW5kZXgpID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld2Eub3JkZXJbb3BpbmRleF0gPSBrZXk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyW2luZGV4XSA9IG9wO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9waW5kZXggPiBpbmRleCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlci5zcGxpY2Uob3BpbmRleCwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyLnNwbGljZShpbmRleCwgMCwgb3ApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlci5zcGxpY2Uob3BpbmRleCwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyLnNwbGljZShpbmRleCAtIDEsIDAsIG9wKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyLmZvckVhY2godmFsdWUgPT4gbmV3YVt2YWx1ZV0gPSBvbGRbdmFsdWVdKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanNvbicsIEpTT04uc3RyaW5naWZ5KG5ld2EpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignb3AnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0sIHZhbHVlLCBpbmRleClcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgICAgIH0pXFxuICAgIH0pXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+Kame+4jycsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJChxdWlja1NlYXJjaENvbmZpZ3NbJ21vZGUnXSB8fCBcXFwiXFxcIiwgJ+ivt+ato+ehrui+k+WFpee7hOS7tuagt+W8j1xcXFxu5bu66K6u5YC8OmZsZXhfYnV0dG9uIHNjcm9sbF9idXR0b24gaWNvbl9yb3VuZF9zbWFsbF80IGljb25fc21hbGxfNCcpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKTtcXG4gICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm1vZGUgPSBpbnB1dDtcXG4gICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/moLflvI/kv67mlLnmiJDlip8nXFxuICAgICAgICB9KVxcbiAgICB9KVxcbn1cXG5cXG4vL+iuvue9rumhtemdolxcbmZ1bmN0aW9uIHNldHRpbmdQYWdlKCkge1xcbiAgICBsZXQgY29uZiA9IGdldENvbmZpZygpO1xcbiAgICBsZXQgZCA9IFtdO1xcblxcbiAgICBsZXQgc3RhckNvbG9yID0gY29uZi5zdGFyQ29sb3IgfHwgJyNmZmFjMmQnO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ0nICsgJ+iHquWumuS5ieaYn+aYn+minOiJsicuYm9sZCgpLFxcbiAgICAgICAgZGVzYzogJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPScgKyBzdGFyQ29sb3IgKyAnPicgKyAn4piF4piF4piF4piF4piFPC9mb250PicsXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxuICAgICAgICB1cmw6ICQoc3RhckNvbG9yLCAn5Yir5b+Y5LqGIycpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgY29uZmlnLnN0YXJDb2xvciA9IGlucHV0O1xcbiAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/orr7nva7mm7TmlLnlt7Lkv53lrZhcXFwiO1xcbiAgICAgICAgfSlcXG4gICAgfSlcXG4gICAgbGV0IGNob29zZUNvbG9yID0gY29uZi5jaG9vc2VDb2xvciB8fCAnI0ZBNzI5OCc7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnScgKyAn6Ieq5a6a5LmJ6YCJ5Lit5qCH562+6aKc6ImyJy5ib2xkKCksXFxuICAgICAgICBkZXNjOiAn4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9JyArIGNob29zZUNvbG9yICsgJz4nICsgJ+aIkeaYr+mihOiniOaViOaenDwvZm9udD4nLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcbiAgICAgICAgdXJsOiAkKGNob29zZUNvbG9yLCAn5Yir5b+Y5LqGIycpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgY29uZmlnLmNob29zZUNvbG9yID0gaW5wdXQ7XFxuICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iuvue9ruabtOaUueW3suS/neWtmFxcXCI7XFxuICAgICAgICB9KVxcbiAgICB9KVxcblxcbiAgICBob21lUGFnZVNldHRpbmdNb2R1bGUoZCk7XFxuICAgIGQucHVzaCh7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AgICAgICAgICAgICAgICAgY2FzZSAn6YeN572u5pif5pif6aKc6ImyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpdGVtID0gJ3N0YXJDb2xvcic7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfph43nva7pgInkuK3moIfnrb7popzoibInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAnY2hvb3NlQ29sb3InO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn6YeN572u5b+r6YCf5pCc57SiJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpdGVtID0gJ3F1aWNrU2VhcmNoQ29uZmlncyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfph43nva7pppbpobXkuLrpu5jorqQnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAnaG9tZVBhZ2VDb25maWdzJztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+mHjee9ruivpuaDhemhtSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbSA9ICdkZXRhaWxWaWV3Q29uZmlncyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfmuIXpmaTlhajpg6jorr7nva4nOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAnYWxsJztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAvLyBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL3NldHRpbmdQYWdlJykpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICBsZXQgZGVmYXVsdENvbmZpZ3MgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9kZWZhdWx0Q29uZmlnc1xcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAoaXRlbSA9PSAnYWxsJykge1xcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGRlZmF1bHRDb25maWdzKSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3slxcXCIgKyBzZWw7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZihpdGVtID09IFxcXCJob21lUGFnZUNvbmZpZ3NcXFwiKXtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKGZldGNoKGdldE15VmFyKCdxZGJfY29uZmlnJykpKTtcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZ1tpdGVtXVtcXFwi6buY6K6kXFxcIl0gPSBkZWZhdWx0Q29uZmlnc1tpdGVtXVtcXFwi6buY6K6kXFxcIl07XFxuICAgICAgICAgICAgICAgICAgICBjb25maWdbaXRlbV0udXNlID0gXFxcIum7mOiupFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3slxcXCIgKyBzZWw7XFxuICAgICAgICAgICAgICAgIH1lbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKGZldGNoKGdldE15VmFyKCdxZGJfY29uZmlnJykpKTtcXG4gICAgIC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j5JcXFwiOiB7XFxyXFxuICAgICAgICAgICAgY29uZmlnOiAkLnRvU3RyaW5nKCgpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IGZpbGUgPSBcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9EdWFuTmlhbi9NeVBhcnNlLmpzb25cXFwiO1xcclxcbiAgICAgICAgICAgICAgICBsZXQgb2xkZmlsZSA9IFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL015UGFyc2VTZXQuanNvblxcXCI7XFxyXFxuICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoZmlsZSkpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoJ2pzb249JyArIGZldGNoKGZpbGUpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCBqc1VybCA9IGpzb24uc2V0dGluZ3MuY2o7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKGZldGNoKGpzVXJsKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXl0bVBhcnNlKGlucHV0KTtcXHJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChmaWxlRXhpc3Qob2xkZmlsZSkpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCBqc1VybCA9IEpTT04ucGFyc2UoZmV0Y2gob2xkZmlsZSkpLmNqO1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChqc1VybCkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF5dG1QYXJzZShpbnB1dCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5rKh5om+5Yiw5pat5o+S6YWN572u5paH5Lu2JztcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIH0pLFxcclxcbiAgICAgICAgICAgIHNldHRpbmc6ICQudG9TdHJpbmcoKCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgZmlsZSA9IFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL0R1YW5OaWFuL015UGFyc2UuanNvblxcXCI7XFxyXFxuICAgICAgICAgICAgICAgIGxldCBvbGRmaWxlID0gXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcIjtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChmaWxlKSkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCgnanNvbj0nICsgZmV0Y2goZmlsZSkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGpzVXJsID0ganNvbi5zZXR0aW5ncy5jajtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goanNVcmwpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzZXRVcmw7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZmlsZUV4aXN0KG9sZGZpbGUpKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQganNVcmwgPSBKU09OLnBhcnNlKGZldGNoKG9sZGZpbGUpKS5jajtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goanNVcmwpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzZXRVcmw7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9Sb3V0ZT9ydWxlPU15RmllbGThtLDigb8mdHlwZT3orr7nva5cXFwiO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgfVxcclxcbn1cXHJcXG4kLmV4cG9ydHMgPSBkZWZhdWx0Q29uZmlncztcIn0se1wiY29sX3R5cGVcIjpc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wgY29uZmlnKTtcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgICAgIHJldHVybiBjb25maWdbbmFtZV07XFxyXFxuICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICByZXR1cm4gY29uZmlnO1xcclxcbiAgICB9XFxyXFxufVxcclxcblxcclxcbi8v57yW56CB5bel5YW357G7XFxyXFxubGV0IFppcFRvb2wgPSB7XFxyXFxuICAgIGRlcGVuZGVuY2U6ICdodHRwczovL3VucGtnLmNvbS9sei1zdHJpbmdAMS40LjQvbGlicy9sei1zdHJpbmcubWluLmpzJyxcXHJcXG4gICAgY29tcHJlc3M6IHtcXHJcXG4gICAgICAgIHNpemU6IHtcXHJcXG4gICAgICAgICAgICBrZXk6IFxcXCJ0ZXh0LWNvbXByZXNzLXNpemVcXFwiLFxcclxcbiAgICAgICAgICAgIHNldDogKG5ld1ZhbHVlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKHRoaXMua2V5LCBuZXdWYWx1ZS50b1N0cmluZygpKVxcclxcbiAgICAgICAgICAgIH0sXFxyXFxuICAgICAgICAgICAgZ2V0OiAoKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZUludChnZXRNeVZhcih0aGlzLmtleSwgXFxcIjBcXFwiKSlcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9LFxcclxcbiAgICAgICAgZXhlYzogKGlucHV0KSA9PiB7XFxyXFxuICAgICAgICAgICAgZXZhbChyZXF1ZXN0KFppcFRvb2wuZGVwZW5kZW5jZSkpXFxyXFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IExaU3RyaW5nLmNvbXByZXNzVG9FbmNvZGVkVVJJQ29tcG9uZW50KGlucHV0KVxcclxcbiAgICAgICAgICAgICAgICAvLyBaaXBUb29sLmNvbXByZXNzLnNpemUuc2V0KHJlc3VsdC5sZW5ndGggKiAyKVxcclxcbiAgICAgICAgICAgIHJldHVybiByZXN1bHRcXHJcXG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9IGJhc2U2NEVuY29kZShyZXN1bHQpO1xcclxcbiAgICAgICAgICAgICAgICBicmVhaztcXHJcXG4gICAgICAgICAgICBjYXNlICdaaXBwZXInOlxcclxcbiAgICAgICAgICAgICAgICByZXN1bHQgPSBaaXBUb29sLmNvbXByZXNzLmV4ZWMocmVzdWx0KVxcclxcbiAgICAgICAgICAgICAgICBicmVhaztcXHJcXG4gICAgICAgICAgICBkZWZhdWx0IDpcXHJcXG4gICAgICAgICAgICAgICAgaWYgKGdldEFwcFZlcnNpb24oKSA+IDIwNzApIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHN5bWJvbCA9IFxcXCLliqjmvKvlj6Pku6Tvv6VcXFwiICsgcmVtYXJrICsgXFxcIu+/pVxcXCIgKyBuYW1lXFxyXFxuICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBzaGFyZVBhc3RlKENvbmZpZ1Rvb2wuZXhwb3J0KG5hbWUsIGNvbmZpZywgcmVtYXJrLCAnWmlwcGVyJyksZW5jVHlwZSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgJ1xcXFxuXFxcXG4nICsgc3ltYm9sXFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6K+35pu05paw6KeG55WM54mI5pys6IezIEMyMDcwIOS7peS4iidcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICBicmVhaztcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgICAgIHJlc3VsdCA9IHN5bWJvbCArIHJlc3VsdFxcclxcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcXHJcXG4gICAgfSxcXHJcXG4gICAgaW1wb3J0OiAoY29uZmlnQ29tbWFuZCkgPT4ge1xcclxcbiAgICAgICAgbGV0IHJlc3VsdCA9ICcnXFxyXFxuICAgICAgICBpZiAoY29uZmlnQ29tbWFuZC5zdGFydHNXaXRoKCfkupEnKSkge1xcclxcbiAgICAgICAgICAgIGlmIChnZXRBcHBWZXJzaW9uKCkgPiAyMDcwKSB7XFxyXFxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGNvbmZpZ0NvbW1hbmQuc3BsaXQoJ+WKqOa8qycpWzBdLnJlcGxhY2UoL1xcXFxcXFxcbi8sICcnKVxcclxcbiAgICAgICAgICAgICAgICBjb25maWdDb21tYW5kID0gcGFyc2VQYXN0ZShyZXN1bHQpXFxyXFxuICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+abtOaWsOinhueVjOeJiOacrOiHsyBDMjA3MCDku6XkuIonXFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgdHJ5IHtcXHJcXG4gICAgICAgICAgICBsZXQgcmVzdWx0U3BsaXRzID0gY29uZmlnQ29tbWFuZC5zcGxpdChcXFwi77+lXFxcIilcXHJcXG4gICAgICAgICAgICBsZXQgZW5jVHlwZSA9IHJlc3VsdFNwbGl0c1szXVxcclxcbiAgICAgICAgICAgIHJlc3VsdCA9IHJlc3VsdFNwbGl0c1s0XVxcclxcbiAgICAgICAgICAgIHN3aXRjaCAoZW5jVHlwZSkge1xcclxcbiAgICAgICAgICAgICAgICBjYXNlICdCYXNlNjQnOlxcclxcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gYmFzZTY0RGVjb2RlKHJlc3VsdCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXHJcXG4gICAgICAgICAgICAgICAgY2FzZSAnWmlwcGVyJzpcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IFppcFRvb2wuZGVjb21wcmVzcy5leGVjKHJlc3VsdClcXHJcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcclxcbiAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICByZXN1bHQgP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gICAgIGNvbmZpZzoge1xcXFxuICAgICAgICAgICAgICAgIGtleTogXFxcXFxcXCJpbnB1dF9jb2RlXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcXFxcXCLor7fovpPlhaXovpPlhaXphY3nva5cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnXFxcXG4gICAgICAgICAgICB9LFxcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxuICovXFxcXG5mdW5jdGlvbiBtb2RlRWRpdFBhZ2UoZCwgY29uZmlnS2V5LCBwYXJhbXMpIHtcXFxcbiAgICBhZGRMaXN0ZW5lcignb25DbG9zZScsICQudG9TdHJpbmcoKHBhcmFtcykgPT4ge1xcXFxuICAgICAgICBjbGVhck15VmFyKHBhcmFtcy5rZXkpXFxcXG4gICAgICAgIGxldCBkYXRhcyA9IHBhcmFtcy5kYXRhO1xcXFxuICAgICAgICBsZXQgZGF0YUtleXMgPSBPYmplY3Qua2V5cyhkYXRhcyk7XFxcXG4gICAgICAgIGZvciAobGV0IGkgaW4gZGF0YUtleXMpIHtcXFxcbiAgICAgICAgICAgIGxldCBkYXRhS2V5ID0gZGF0YUtleXNbaV1cXFxcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoZGF0YXNbZGF0YUtleV0ua2V5KVxcXFxuICAgICAgICB9XFxcXG4gICAgfSwgcGFyYW1zKSlcXFxcbiAgICBkLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTogXFxcXFxcXCLkv53lrZhcXFxcXFxcIixcXFxcbiAgICAgICAgZGVzYzogcGFyYW1zLmRlc2MsXFxcXG4gICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcXFxuICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgdGl0bGVWaXNpYmxlOiBmYWxzZSxcXFxcbiAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIocGFyYW1zLmtleSwgXFxcXFxcXC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cXFxcbiAgICB9XFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6ICfkv53lrZgnLFxcXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcXFxuICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChjb25maWdLZXksIHBhcmFtcykgPT4ge1xcXFxuICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSlcXFxcbiAgICAgICAgICAgIGxldCBuYW1lID0gZ2V0TXlWYXIocGFyYW1zLmtleSwgXFxcXFxcXCJcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICBpZihuYW1lID09ICfpu5jorqQnKSByZXR1cm4gJ3RvYXN0Oi8v6buY6K6k6YWN572u5peg5rOV57yW6L6RJ1xcXFxuICAgICAgICAgICAgY29uZmlnW2NvbmZpZ0tleV0udXNlID0gbmFtZVxcXFxuICAgICAgICAgICAgaWYgKCFjb25maWdbY29uZmlnS2V5XVtuYW1lXSkgY29uZmlnW2NvbmZpZ0tleV1bbmFtZV0gPSB7fVxcXFxuICAgICAgICAgICAgbGV0IGRhdGFzID0gcGFyYW1zLmRhdGE7XFxcXG4gICAgICAgICAgICBsZXQgZGF0YUtleXMgPSBPYmplY3Qua2V5cyhkYXRhcyk7XFxcXG4gICAgICAgICAgICBmb3IgKGxldCBpIGluIGRhdGFLZXlzKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGRhdGFLZXkgPSBkYXRhS2V5c1tpXVxcXFxuICAgICAgICAgICAgICAgIGxldCBkYXRhID0gZGF0YXNbZGF0YUtleV1cXFxcbiAgICAgICAgICAgICAgICBjb25maWdbY29uZmlnS2V5XVtuYW1lXVtkYXRhS2V5XSA9IGdldE15VmFyKGRhdGEua2V5LCBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICAgICA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ICAgICAgICAgICAgICBrZXk6IFxcXFxcXFwiaW5wdXRfY29kZVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi6K+36L6T5YWl6YWN572u5Luj56CBXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdHlwZTogJ3RleHRhcmVhJ1xcXFxuICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgIHNldHRpbmc6IHtcXFxcbiAgICAgICAgICAgICAgICBrZXk6IFxcXFxcXFwiaW5wdXRfc2V0dGluZ19jb2RlXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcXFxcXCLor7fovpPlhaXorr7nva7pobXpnaLku6PnoIFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1cXFxcbiAgICB9KVxcXFxufVxcXFxuXFxcXG4vL+iHquWumuS5ieino+aekC3nvJbovpHpobXpnaJcXFxcbmZ1bmN0aW9uIGFuYWx5c2lzTW9kZUVkaXRQYWdlKGQpIHtcXFxcbiAgICBkLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTogJzxmb250IGNvbG9yPVxcXFxcXFwiIzgwODA4MFxcXFxcXFwiPicgKyAn44CQ6Kej5p6Q5Luj56CB5YaF572u5Y+Y6YeP44CRJyArICc8YnI+Jm5ic3A7Jm5ic3A7Jm5ic3A7aW5wdXQ6IOinhumikemTvuaOpScgKyAnPC9mb250PicsXFxcXG4gICAgICAgIGNvbF90eXBlOiAncmljaF90ZXh0J1xcXFxuICAgIH0pXFxcXG4gICAgbW9kZUVkaXRQYWdlKGQsIFxcXFxcXFwiYW5hbHlzaXNDb25maWdzXFxcXFxcXCIsIHtcXFxcbiAgICAgICAga2V5OiBcXFxcXFxcImlucHV0X25hbWVcXFxcXFxcIixcXFxcbiAgICAgICAgZGVzYzogXFxcXFxcXCLor7fovpPlhaXlkI3np7BcXFxcXFxcIixcXFxcbiAgICAgICAgLy8gdHlwZTogJ2lucHV0J1xcXFxuICAgICAgICBkYXRhOiB7XFxcXG4gICAgICAgICAgICBjb25maWc6IHtcXFxcbiAgICAgICAgICAgICAgICBrZXk6IFxcXFxcXFwiaW5wdXRfY29kZVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi6K+36L6T5YWl6Kej5p6Q5Luj56CBXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdHlwZTogJ3RleHRhcmVhJ1xcXFxuICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAga2V5OiAnaW5wdXRfZXh0cmEnLFxcXFxuICAgICAgICAgICAgICAgIGRlc2M6ICfor7fovpPlhaVleHRyYeWxnuaAp+WAvCcsXFxcXG4gICAgICAgICAgICAgICAgdHlwZTogJ3RleHRhcmVhJ1xcXFxuICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgIHNldHRpbmc6IHtcXFxcbiAgICAgICAgICAgICAgICBrZXk6IFxcXFxcXFwiaW5wdXRfc2V0dGluZ19jb2RlXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcXFxcXCLor7fovpPlhaXorr7nva7pobXpnaLku6PnoIFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1cXFxcbiAgICB9KVxcXFxufVxcXFxuXFxcXG5sZXQgZCA9IFtdO1xcXFxubGV0IHZpZXcgPSBnZXRQYXJhbShcXFxcXFxcInZpZXdcXFxcXFxcIixcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbmlmKHZpZXc9PVxcXFxcXFwiYW5hbHlzaXNNb2RlRWRpdFBhZ2VcXFxcXFxcIil7XFxcXG4gICAgc2V0UGFnZVRpdGxlKFxcXFxc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ICAgIHRpdGxlOiBlLnRpdGxlLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eS8kcGFnZXtmeXBhZ2V9I25vSGlzdG9yeSMnKVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAucnVsZSgodHlwZSwgaWQpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFxcXFxcInBsYXlsaXN0XFxcXFxcXCIpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gXFxcXFxcXCJjb2xsZWN0aW9uXFxcXFxcXCIgfHwgdHlwZSA9PSBcXFxcXFxcImNoYXJ0XFxcXFxcXCIpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJqZWN0Q29sbGVjdGlvbkxpc3QoTVlfUEFHRSwgNTAsIGlkKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgZS50YXJnZXRfdHlwZSwgZS5pZCksXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBlLmNvdmVyX3VybCArIFxcXFxcXFwiQFJlZmVyZXI9XFxcXFxcXCIgKyBlLmNvdmVyX3VybFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICB9IGVsc2UgaWYgKGRhdGEudG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IGUuY292ZXJfdXJsXFxcXHJcXFxcbiAgICAgICAgICAgIH0pXFxcXHJcXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcclxcXFxuICAgICAgICAgICAgbGV0IHR5cGUgPSBkYXRhLnRhcmdldF90eXBlLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgaWQgPSBkYXRhLnRhcmdldC5pZCxcXFxcclxcXFxuICAgICAgICAgICAgICAgIHRpdGxlID0gZGF0YS50YXJnZXQudGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgeWVhciA9IGRhdGEudGFyZ2V0LnllYXI7XFxcXHJcXFxcbiAgICAgICAgICAgIGxldCB1c2VDb25maWcgPSBkZXRhaWxzVmlld0NvbmZpZ3NbZGV0YWlsc1ZpZXdDb25maWdzLnVzZV0uY29uZmlnO1xcXFxyXFxcXG4gICAgICAgICAgICBsZXQgdXJsUGFyYW1zID0ge307XFxcXHJcXFxcbiAgICAgICAgICAgIGlmICh1c2VDb25maWcuc3RhcnRzV2l0aCgneycpKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBldmFsKCd1cmxQYXJhbXMgPSAnICsgdXNlQ29uZmlnKTtcXFxcclxcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXFxcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI2ltbWVyc2l2ZVRoZW1lI1xcXFxcXFwiICsgJz90eXBlPScgKyB0eXBlICsgJyZpZD0nICsgaWQpXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgLnJ1bGUoKHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGUgPT09IFxcXFxcXFwicGxheWxpc3RcXFxcXFxcIikge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcXFxyXFxcXG4gICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlICsgKHllYXIgPyAnKCcreWVhcisnKScgOiAnJyksXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBpbWc6IGRhdGEudGFyZ2V0LmNvdmVyX3VybCArIFxcXFxcXFwiQFJlZmVyZXI9XFxcXFxcXCIgKyBkYXRhLnRhcmdldC5jb3Zlcl91cmwsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkYXRhLnR5cGVfbmFtZSxcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6IGRhdGEudGFyZ2V0LmNhcmRfc3VidGl0bGUsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybFBhcmFtcy51cmwsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBleHRyYTogdXJsUGFyYW1zLmV4dHJhXFxcXHJcXFxcbiAgICAgICAgICAgIH0pO1xcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuXFxcXHJcXFxcbiAgICB9KTtcXFxcclxcXFxuXFxcXHJcXFxcbiAgICBzZXRTZWFyY2hSZXN1bHQoe1xcXFxyXFxcXG4g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cXFwiICsgdHlwZSArIFxcXFxcXFwiL1xcXFxcXFwiICsgaWQgKyBcXFxcXFxcIi9jcmVkaXRzXFxcXFxcXCIpO1xcXFxyXFxcXG4gICAgbGV0IHIgPSBbXTtcXFxcclxcXFxuICAgIGkuY3JlZGl0cy5mb3JFYWNoKChlID0+IHtcXFxcclxcXFxuICAgICAgICByLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICB0aXRsZTogZS50aXRsZSxcXFxcclxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwicmljaF90ZXh0XFxcXFxcXCJcXFxcclxcXFxuICAgICAgICB9KTtcXFxcclxcXFxuICAgICAgICBlLmNlbGVicml0aWVzLmZvckVhY2goKGUgPT4ge1xcXFxyXFxcXG4gICAgICAgICAgICByLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGUubmFtZSArIFxcXFxcXFwiXFxcXFxcXFxuXFxcXFxcXCIgKyBlLmxhdGluX25hbWUsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBkZXNjOiBlLmNoYXJhY3RlcixcXFxcclxcXFxuICAgICAgICAgICAgICAgIGltZzogZS5hdmF0YXIubm9ybWFsICsgXFxcXFxcXCJAUmVmZXJlcj1cXFxcXFxcIiArIGUuYXZhdGFyLm5vcm1hbCxcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbW92aWVfMV92ZXJ0aWNhbF9waWMnLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjJykucnVsZSgoZSkgPT4ge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBlbGVzc2FyVmlldyhlLnVyaS5z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cXG4gICAgICAgICAgICAgICAgdGl0bGUgPSBlLnN1YmplY3QudGl0bGU7XFxcXHJcXFxcbiAgICAgICAgICAgIGxldCB1c2VDb25maWcgPSBkZXRhaWxzVmlld0NvbmZpZ3NbZGV0YWlsc1ZpZXdDb25maWdzLnVzZV0uY29uZmlnO1xcXFxyXFxcXG4gICAgICAgICAgICBsZXQgdXJsUGFyYW1zID0ge307XFxcXHJcXFxcbiAgICAgICAgICAgIGlmICh1c2VDb25maWcuc3RhcnRzV2l0aCgneycpKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBldmFsKCd1cmxQYXJhbXMgPSAnICsgdXNlQ29uZmlnKTtcXFxcclxcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXFxcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI2ltbWVyc2l2ZVRoZW1lI1xcXFxcXFwiICsgJz90eXBlPScgKyB0eXBlICsgJyZpZD0nICsgaWQpLnJ1bGUoKHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFxcXFxcInBsYXlsaXN0XFxcXFxcXCIpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwodXNlQ29uZmlnKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxcXHJcXFxcbiAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgYS5wdXNoKHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXFxcclxcXFxuICAgICAgICAgICAgICAgIGltZzogZS5zdWJqZWN0LmNvdmVyLm5vcm1hbC51cmwgKyBcXFxcXFxcIkBSZWZlcmVyPVxcXFxcXFwiICsgZS5zdWJqZWN0LmNvdmVyLm5vcm1hbC51cmwsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBkZXNjOiByYXRpbmcsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzMnLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmxQYXJhbXMudXJsLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHVybFBhcmFtcy5leHRyYVxcXFxyXFxcXG4gICAgICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuICAgICAgICAvKmEucHVzaCh7XFxcXHJcXFxcbiAgICAgICAgICAgIHRpdGxlOiAn5p+l55yL5pu05aSaJyxcXFxcclxcXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9qb2tlci10eC5jb2RpbmcubmV0L3AvaGlrZXJpbWcvZC9oaWtlci9naXQvcmF3L21hc3Rlci9pbWcvbW9yZV92ZXIucG5nP2Rvd25sb2FkPWZhbHNlJyxcXFxcclxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8zJyxcXFxcclxcXFxuICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5LyMvJHBhZ2V7ZnlwYWdlfSNub0hpc3RvcnkjJylcXFxcclxcXFxuICAgICAgICAgICAgICAgIC5ydWxlKChpZCwgdHlwZSkgPT4ge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBh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HR5cGUgPSBlLnN1YnR5cGUsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgaWQgPSBlLmlkLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gZS50aXRsZTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGxldCB1c2VDb25maWcgPSBkZXRhaWxzVmlld0NvbmZpZ3NbZGV0YWlsc1ZpZXdDb25maWdzLnVzZV0uY29uZmlnO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgbGV0IHVybFBhcmFtcyA9IHt9O1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgaWYgKHVzZUNvbmZpZy5zdGFydHNXaXRoKCd7JykpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBldmFsKCd1cmxQYXJhbXMgPSAnICsgdXNlQ29uZmlnKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsUGFyYW1zLnVybCA9ICQoXFxcXFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcXFxcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZCkucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcXFxcXCJwbGF5bGlzdFxcXFxcXFwiKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBsLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGUuY292ZXIubm9ybWFsLnVybCArIFxcXFxcXFwiQFJlZmVyZXI9XFxcXFxcXCIgKyBlLmNvdmVyLm5vcm1hbC51cmwsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogcmF0aW5nICsgJ1xcXFxcXFxcbicgKyBlLmV4dHJhLnNob3J0X2luZm8sXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmxQYXJhbXMudXJsLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB1cmxQYXJhbXMuZXh0cmFcXFxcclxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXHJcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBsLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBlLmNlcmVtb255LnRpdGxlLmJvbGQoKSArICc8c21hbGw+KDxhIGhyZWY9XFxcXFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSNAcnVsZT1qczpldmFsKEpTT04ucGFyc2UoZmV0Y2goYGhpa2VyOi8vcGFnZS9tYWluYCkpLnJ1bGUpO2F3YXJkVmlldyhgJyArIGUuY2VyZW1vbnkuaWQgKyAnYCxgJyArIGUuY2VyZW1vbnkudGl0bGUgKyAnYCk7XFxc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MjaW1tZXJzaXZlVGhlbWUjXFxcXFxcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZCkucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFxcXFxcInBsYXlsaXN0XFxcXFxcXCIpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwodXNlQ29uZmlnKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuICAgICAgICByZXR1cm4ge1xcXFxyXFxcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXHJcXFxcbiAgICAgICAgICAgIHVybDogdXJsUGFyYW1zLnVybCxcXFxcclxcXFxuICAgICAgICAgICAgZXh0cmE6IHVybFBhcmFtcy5leHRyYSxcXFxcclxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8zJyxcXFxcclxcXFxuICAgICAgICAgICAgaW1nOiBlLnBpYyA/IGUucGljLm5vcm1hbCArIFxcXFxcXFwiQFJlZmVyZXI9XFxcXFxcXCIgKyBlLnBpYy5ub3JtYWwgOiBlLmNvdmVyLnVybCArICdAUmVmZXJlcj0nICsgZS5jb3Zlci51cmwsXFxcXHJcXFxcbiAgICAgICAgICAgIGRlc2M6IGUubnVsbF9yYXRpbmdfcmVhc29uIHx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cclxcXFxuICAgICAgICBxdWlja1NlYXJjaEl0ZW1zLnVuc2hpZnQoe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08c3Ryb25nPjxiaWc+5b+r6YCf5pCc57SiPC9iaWc+PC9zdHJvbmc+JyxcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSxcXFxcclxcXFxuICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknXFxcXHJcXFxcbiAgICAgICAgICAgIH0pXFxcXHJcXFxcbiAgICAgICAgICAgIC8qcXVpY2tTZWFyY2hJdGVtcy51bnNoaWZ0KHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXFxcclxcXFxuICAgICAgICAgICAgfSkqL1xcXFxyXFxcXG4gICAgfVxcXFxyXFxcXG5cXFxcclxcXFxuICAgIHNldEhvbWVSZXN1bHQoe1xcXFxyXFxcXG4gICAgICAgIGRhdGE6IGluZm9JdGVtcy5jb25jYXQocmF0aW5nSXRlbXMpXFxcXHJcXFxcbiAgICAgICAgICAgIC5jb25jYXQocmVsYXRlZEl0ZW1zKVxcXFxyXFxcXG4gICAgICAgICAgICAuY29uY2F0KHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXFxcclxcXFxuICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICAgICAgLmNvbmNhdChxdWlja1NlYXJjaEl0ZW1zKVxcXFxyXFxcXG4gICAgICAgICAgICAuY29uY2F0KHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXFxcclxcXFxuICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICAgICAgLmNvbmNhdCh2aWRlb0l0ZW1zKVxcXFxyXFxcXG4gICAgICAgICAgICAuY29uY2F0KHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXFxcclxcXFxuICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICAgICAgLmNvbmNhdCh2aWRlb1JlbGF0ZWRJdGVtcylcXFxcclxcXFxuICAgICAgICAgICAgLmNvbmNhdCh7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxcXHJcXFxcbiAgICAgICAgICAgIH0pXFxcXHJcXFxcbiAgICAgICAgICAgIC5jb25jYXQoaW50cm9JdGVtcylcXFxcclxcXFxuICAgICAgICAgICAgLmNvbmNhdCh7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6e1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICBpZDogJ3JlY29tbWVuZGF0aW9ucydcXFxcclxcXFxuICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICAgICAgLmNvbmNhdCh7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08c21hbGw+PGZvbnQgY29sb3I9Izg3MWY3OD7ku6XkuIrmlbDmja7mnaXmupDkuo7osYbnk6PvvIzlpoLmgqjllpzmrKLvvIzor7fkuIvovb3lrpjmlrlhcHA8L2ZvbnQ+PC9zbWFsbD4nLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgZGVzYzogJ+KAnOKAnOKAneKAnTxzbWFsbD48Zm9udCBjb2xvcj0jZjIwYzAwPuatpOinhOWImeS7hemZkOWtpuS5oOS6pOa1geS9v+eUqO+8jOivt+S6juWvvOWFpeWQjjI05bCP5pe25YaF5Yig6Zmk77yM5Lu75L2V57uE57uH5oiW5Liq5Lq65LiN5b6X5Lul5Lu75L2V5pa55byP5pa55rOV5Lyg5pKt5q2k6KeE5YiZ55qE5pW05L2T5oiW6YOo5YiG77yBPC9mb250Pjwvc21hbGw+JyxcXFxcclxcXFxuICAgICAgICAgICAgICAgIHVybDogJ2h0dHBzOi8vbW92aWUuZG91YmFuLmNvbS9zdWJqZWN0LycgKyBpZCArICcvJyxcXFxcclxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgIH0pXFxcXHJcXFxcbiAgICB9KVxcXFxyXFxcXG4gICAgYmUoW3tcXFxcclxcXFxuICAgICAgICBmdW5jOiBmdW5jdGlvbihvYmope1xcXFxyXFxcXG4gICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxcXHJcXFxcbiAgICAgICAgICAgIGxldCByZXMgPSBnZXREb3ViYW5SZXMob2JqLnVybCk7XFxcXHJcXFxcbiAgICAgICAgICAgIFxcXFxyXFxcXG4gICAgICAgICAgICBsZXQgZGV0YWlsc1ZpZXdDb25maWdzID0gZ2V0Q29uZmlnKCdkZXRhaWxzVmlld0NvbmZpZ3MnKTtcXFxcclxcXFxuICAgICAgICAgICAgbGV0IGwgPSBbcmVzWzBdLHJlc1sxXSxyZXNbMl1dO1xcXFxyXFxcXG4gICAgICAgICAgICBsZXQgaSA9IGwubWFwKChlID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGxldCB0eXBlID0gZS50eXBlLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGlkID0gZS5pZCxcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IGUudGl0bGU7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBsZXQgdXNlQ29uZmlnID0gZGV0YWlsc1ZpZXdDb25maWdzW2RldGFpbHNWaWV3Q29uZmlncy51c2VdLmNvbmZpZztcXFxcclxcXFxuICAgICAgICAgICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGlmICh1c2VDb25maWcuc3RhcnRzV2l0aCgneycpKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCgndXJsUGFyYW1zID0gJyArIHVzZUNvbmZpZyk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXFxcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI2ltbWVyc2l2ZVRoZW1lI1xcXFxcXFwiICsgJz90eXBlPScgKyB0eXBlICsgJyZpZD0nICsgaWQpLnJ1bGUoKHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGUgPT09IFxcXFxcXFwicGxheWxpc3RcXFxcXFxcIikge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcXFxyXFxcXG4gICAgICA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aWc+PHN0cm9uZz7nm7jlhbPmjqjojZA8L3N0cm9uZz48L2JpZz5cXFxcXFxcIixcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcclxcXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eS8jbm9IaXN0b3J5IycpLnJ1bGUoKHQpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVjb21tZW5kYXRpb25zKHRbMF0sIHRbMV0pO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSwgW29iai50eXBlLCBvYmouaWRdKSxcXFxcclxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgIH0pXFxcXHJcXFxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ3JlY29tbWVuZGF0aW9ucycse2NvbF90eXBlOiAnbGluZScsZXh0cmE6e2lkOidub29vcCd9fSlcXFxcclxcXFxuICAgICAgICB9LFxcXFxyXFxcXG4gICAgICAgIHBhcmFtOiB7XFxcXHJcXFxcbiAgICAgICAgICAgIHVybDogXFxcXFxcXCJodHRwczovL2Zyb2RvLmRvdWJhbi5jb20vYXBpL3YyL1xcXFxcXFwiICsgdHlwZSArIFxcXFxcXFwiL1xcXFxcXFwiICsgaWQgKyBcXFxcXFxcIi9yZWNvbW1lbmRhdGlvbnNcXFxcXFxcIixcXFxcclxcXFxuICAgICAgICAgICAgdHlwZTogdHlwZSxcXFxcclxcXFxuICAgICAgICAgICAgaWQ6IGlkXFxc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t5Zu95Lqn5YmnOiAndHZfZG9tZXN0aWMnLFxcXFxyXFxcXG4gICAgICAgICAgICDng63mkq3mrKfnvo7liac6ICd0dl9hbWVyaWNhbicsXFxcXHJcXFxcbiAgICAgICAgICAgIOeDreaSreaXpeWJpzogJ3R2X2phcGFuZXNlJyxcXFxcclxcXFxuICAgICAgICAgICAg54Ot5pKt6Z+p5YmnOiAndHZfa29yZWFuJyxcXFxcclxcXFxuICAgICAgICAgICAg54Ot5pKt5Yqo55S7OiAndHZfYW5pbWF0aW9uJ1xcXFxyXFxcXG4gICAgICAgIH0sXFxcXHJcXFxcbiAgICAgICAg57u86Im6OiB7XFxcXHJcXFxcbiAgICAgICAgICAgIOeDreaSree7vOiJujogJ3Nob3dfaG90JyxcXFxcclxcXFxuICAgICAgICAgICAg5Zu95YaF57u86Im6OiAnc2hvd19kb21lc3RpYycsXFxcXHJcXFxcbiAgICAgICAgICAgIOWbveWklue7vOiJujogJ3Nob3dfZm9yZWlnbidcXFxcclxcXFxuICAgICAgICB9XFxcXHJcXFxcbiAgICB9XFxcXHJcXFxcbiAgICBmb3IgKGxldCBpIGluIGl0ZW1zKSB7XFxcXHJcXFxcbiAgICAgICAgZm9yIChsZXQgaiBpbiBpdGVtc1tpXSkge1xcXFxyXFxcXG4gICAgICAgICAgICBhLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRlbXAuaXRlbSA9PSBpdGVtc1tpXVtqXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgaiArICcgPC9mb250PjwvYj4nIDogaixcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICA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gICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBcXFxcclxcXFxuICAgICAgICAgICAgICAgIHVybCA9ICQodGVtcC5jdXN0b21ZZWFyLCAn55u05o6l6L6T5YWl5YW35L2T5bm05Lu9LOS+i+WmgjIwMDAnKS5pbnB1dCgoKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdjbGFzc2xpc3QnKSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYoaW5wdXQubGVuZ3RoID09IDQpe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLmN1c3RvbVllYXIgPSBpbnB1dDtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC55ZWFyID0gXFxcXFxcXCLoh6rlrprkuYnlubTku71cXFxcXFxcIjtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCJjbGFzc2xpc3RcXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/or7fmraPnoa7ovpPlhaUnXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXHJcXFxcbiAgICAgICAgICAgIH1lbHNlIGlmKGl0ZW1zW2l0ZW1dW2ldID09IFxcXFxcXFwi6Ieq5a6a5LmJ5Zyw5Yy6XFxcXFxcXCIpe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgaWYodGVtcC5sb2NhbCA9PSBcXFxcXFxcIuiHquWumuS5ieWcsOWMulxcXFxcXFwiKXtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz7oh6rlrprkuYnlnLDljLo6JyArIHRlbXAuY3VzdG9tTG9jYWwgKyAnIDwvZm9udD48L2I+JztcXFxcclxcXFxuICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgIFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgdXJsID0gJCh0ZW1wLmN1c3RvbUxvY2FsLCAn55u05o6l6L6T5YWl5YW35L2T5Zyw5Yy6LOS+i+WmguS4reWbveWkp+mZhicpLmlucHV0KCgpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NsYXNzbGlzdCcpKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBpZihpbnB1dC5sZW5ndGggPiAwKXtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC5jdXN0b21Mb2NhbCA9IGlucHV0O1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLmxvY2FsID0gXFxcXFxcXCLoh6rlrprkuYnlnLDljLpcXFxcXFxcIjtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCJjbGFzc2xpc3RcXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/or7fmraPnoa7ovpPlhaUnXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXHJcXFxcbiAgICAgICAgICAgIH1lbHNlIGlmKGl0ZW1zW2l0ZW1dW2ldID09IFxcXFxcXFwi6Ieq5a6a5LmJ57G75Z6LXFxcXFxcXCIpe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgaWYodGVtcC50eXBlID09IFxcXFxcXFwi6Ieq5a6a5LmJ57G75Z6LXFxcXFxcXCIpe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPuiHquWumuS5ieexu+WeizonICsgdGVtcC5jdXN0b21UeXBlICsgJyA8L2ZvbnQ+PC9iPic7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBcXFxcclxcXFxuICAgICAgICAgICAgICAgIHVybCA9ICQodGVtcC5jdXN0b21UeXBlLCAn55u05o6l6L6T5YWl5YW35L2T57G75Z6LLOS+i+WmguWJp+aDhScpLmlucHV0KCgpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NsYXNzbGlzdCcpKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBpZihpbnB1dC5sZW5ndGggPiAwKXtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC5jdXN0b21UeXBlID0gaW5wdXQ7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAudHlwZSA9IFxcXFxcXFwi6Ieq5a6a5LmJ57G75Z6LXFxcXFxcXCI7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiY2xhc3NsaXN0XFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6K+35q2j56Gu6L6T5YWlJ1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxyXFxcXG4gICAgICAgICAgICB9ZWxzZSBpZihpdGVtc1tpdGVtXVtpXSA9PSBcXFxcXFxcIuiHquWumuS5ieagh+etvlxcXFxcXFwiKXtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGlmKHRlbXAuY2xhc3MgPT0gXFxcXFxcXCLoh6rlrprkuYnmoIfnrb5cXFxcXFxcIil7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+6Ieq5a6a5LmJ5qCH562+OicgKyB0ZW1wLmN1c3RvbUNsYXNzICsgJyA8L2ZvbnQ+PC9iPic7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBcXFxcclxcXFxuICAgICAgICAgICAgICAgIHVybCA9ICQodGVtcC5jdXN0b21DbGFzcywgJ+ebtOaOpei+k+WFpeWFt+S9k+agh+etvizkvovlpoLnu4/lhbhcXFxcXFxcXG7lj6/lhpnlpJrkuKrmoIfnrb4s5L2/55SoXFxcXFxcXCLoi7HmlofpgJflj7dcXFxcXFxcIuWIhumalCcpLmlucHV0KCgpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NsYXNzbGlzdCcpKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBpZihpbnB1dC5sZW5ndGggPiAwKXtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC5jdXN0b21DbGFzcyA9IGlucHV0O1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLmNsYXNzID0gXFxcXFxcXCLoh6rlrprkuYnmoIfnrb5cXFxcXFxcIjtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCJjbGFzc2xpc3RcXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/or7fmraPnoa7ovpPlhaUnXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXHJcXFxcbiAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgYS5wdXNoKHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybFxcXFxyXFxcXG4gICAgICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgIH1cXFxccl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oSIOiBcXFxcXFxcImN1cmVcXFxcXFxcIixcXFxcclxcXFxuICAgICAgICAgICAg6Im65pyvOiBcXFxcXFxcImFydFxcXFxcXFwiLFxcXFxyXFxcXG4gICAgICAgICAgICDpu5HoibLlub3pu5g6IFxcXFxcXFwiZGFya19odW1vclxcXFxcXFwiLFxcXFxyXFxcXG4gICAgICAgICAgICDpnZLmmKU6IFxcXFxcXFwieW91dGhcXFxcXFxcIixcXFxcclxcXFxuICAgICAgICAgICAg5aWz5oCnOiBcXFxcXFxcImZlbWFsZVxcXFxcXFwiLFxcXFxyXFxcXG4gICAgICAgICAgICDnnJ/lrp7kuovku7bmlLnnvJY6IFxcXFxcXFwicmVhbF9ldmVudFxcXFxcXFwiLFxcXFxyXFxcXG4gICAgICAgICAgICDmmrTlips6IFxcXFxcXFwidmlvbGVuY2VcXFxcXFxcIixcXFxcclxcXFxuICAgICAgICAgICAg6buR55m9OiBcXFxcXFxcImJsYWNrX3doaXRlXFxcXFxcXCIsXFxcXHJcXFxcbiAgICAgICAgICAgIOe+jumjnzogXFxcXFxcXCJmb29kXFxcXFxcXCIsXFxcXHJcXFxcbiAgICAgICAgICAgIOaXheihjDogXFxcXFxcXCJ0cmF2ZWxcXFxcXFxcIixcXFxcclxcXFxuICAgICAgICAgICAg5YS/56ulOiBcXFxcXFxcImNoaWxkXFxcXFxcXCIsXFxcXHJcXFxcbiAgICAgICAgICAgIOS6uuaApzogXFxcXFxcXCJodW1hbml0eVxcXFxcXFwiLFxcXFxyXFxcXG4gICAgICAgICAgICDlrrbluq06IFxcXFxcXFwiZmFtaWx5XFxcXFxcXCIsXFxcXHJcXFxcbiAgICAgICAgICAgIOaWh+iJujogXFxcXFxcXCJsaXRlcmFyeV9hcnRcXFxcXFxcIixcXFxcclxcXFxuICAgICAgICAgICAg5bCP6K+05pS557yWOiBcXFxcXFxcIm5vdmVsXFxcXFxcXCIsXFxcXHJcXFxcbiAgICAgICAgICAgIOaEn+S6ujogXFxcXFxcXCJtb3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uICAgICAgICAgICAgdGl0bGUgPSBlLmNvbnRlbnQuc3ViamVjdC50aXRsZTtcXFxcclxcXFxuICAgICAgICBsZXQgdXNlQ29uZmlnID0gZGV0YWlsc1ZpZXdDb25maWdzW2RldGFpbHNWaWV3Q29uZmlncy51c2VdLmNvbmZpZztcXFxcclxcXFxuICAgICAgICBsZXQgdXJsUGFyYW1zID0ge307XFxcXHJcXFxcbiAgICAgICAgaWYgKHVzZUNvbmZpZy5zdGFydHNXaXRoKCd7JykpIHtcXFxcclxcXFxuICAgICAgICAgICAgZXZhbCgndXJsUGFyYW1zID0gJyArIHVzZUNvbmZpZyk7XFxcXHJcXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcclxcXFxuICAgICAgICAgICAgdXJsUGFyYW1zLnVybCA9ICQoXFxcXFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcXFxcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZCkucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFxcXFxcInBsYXlsaXN0XFxcXFxcXCIpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwodXNlQ29uZmlnKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcXFxyXFxcXG4gICAgICAgIH1cXFx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HJcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogY29sWzBdIHx8IFxcXFxcXFwiaWNvbl8yXFxcXFxcXCIsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHk/aWQ9JyArIGlkICsgJyZ0eXBlPScgKyB0eXBlICsgJyZ0aXRsZT0nICsgZS50aXRsZSkucnVsZSgocmVzLCBpZCwgZSwgbGF6eSwgZXh0cmEpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSByZXMudGl0bGUsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBpYyA9IHJlcy5waWMubm9ybWFsICsgXFxcXFxcXCJAUmVmZXJlcj1cXFxcXFxcIiArIHJlcy5waWMubm9ybWFsO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZShlLnRpdGxlICsgJy0nICsgdGl0bGUpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldFBhZ2VQaWNVcmwocGljKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdXJscyA9IGdldFR2VXJscyhpZCwgZS5pZCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgbGF6eSA9ICQoXFxcXFxcXCJcXFxcXFxcIikubGF6eVJ1bGUobGF6eSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZXN1bHRVcmwgPSBcXFxcXFxcInRvYXN0Oi8v6Kej5p6Q5aSx6LSlXFxcXFxcXCI7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobGF6eS5zdGFydHNXaXRoKFxcXFxcXFwiKFxcXFxcXFwiKSkge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoJ3Jlc3VsdFVybCA9ICcgKyBsYXp5KVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKCdyZXN1bHRVcmwgPSAnICsgJygoKSA9PiB7JyArIGxhenkgKyAnfSkoKScpXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZyhlLm1lc3NhZ2UpXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdFVybFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIGxhenkpXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mKHVybHMpID09IFxcXFxcXFwib2JqZWN0XFxcXFxcXCIpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB1cmxzLmxlbmd0aDsgaSsrKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn56ysJyArIChpICsgMSkgKyAn6ZuGJyxcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfNCcsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBsYXp5ID8gdXJsc1tpXSArIGxhenkgOiB1cmxzW2ldLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBleHRyYVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YodXJscykgPT0gXFxcXFxcXCJzdHJpbmdcXFxcXFxcIiAmJiB1cmxzID09ICfooqvlsIFpcCcpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJ1bGUgPSBKU09OLnBhcnNlKHJlcXVlc3QoXFxcXFxcXCJoaWtlcjovL3BhZ2UvcmVsZWFzZUlQP3J1bGU95Yqo5ryrXFxcXFxcXCIpKVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnJ1bGU7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwocnVsZSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YodXJscykgPT0gJ3N0cmluZycgJiYgdXJscyA9PSAn5rKh5pyJ5pS25b2VJykge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZCA9IFtdO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfosYbnk6PmsqHmnInmlLblvZXmraTop4bpopHmupDnmoTor6bnu4bkv6Hmga8nLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogJ+eCueaIkeWPr+S7peWOu+inhumikea6kOe9keermeeci+eciycsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBlLnVybFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSwgcmVzLCBpZCwgZSwgbGF6eSwgZXh0cmEpXFxcXHJcXFxcbiAgICAgICAgICAgIH0pXFxcXHJcXFxcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlID09PSAnbW92aWUnKSB7XFxcXHJcXFxcbiAgICAgICAgICAgIGxldCBtTGF6eSA9ICQoXFxcXFxcXCJcXFxcXFxcIikubGF6eVJ1bGUobGF6eSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBsZXQgcmVzdWx0VXJsID0gXFxcXFxcXCJ0b2FzdDovL+ino+aekOWksei0pVxcXFxcXFwiO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAobGF6eS5zdGFydHNXaXRoKFxcXFxcXFwiKFxcXFxcXFwiKSkge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKCdyZXN1bHRVcmwgPSAnICsgbGF6eSlcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKCdyZXN1bHRVcmwgPSAnICsgJygoKSA9PiB7JyArIGxhenkgKyAnfSkoKScpXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhlLm1lc3NhZ2UpXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0VXJsXFxcXHJcXFxcbiAgICAgICAgICAgIH0sIGxhenkpXFxcXHJcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogZS50aXRsZSArIChlLmVwaXNvZGVzX2luZm8gPyBcXFxcXFxcIuKAolxcXFxcXFwiICsgZS5lcGlzb2Rlc19pbmZvIDogXFxcXFxcXCJcXFxcXFxcIiksXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBpbWc6IGUuaWNvbixcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBjb2xbMV0gfHwgXFxcXFxcXCJpY29uX3NtYWxsXzRcXFxcXFxcIixcXFxcclxcXFxuICAgICAgICAgICAgICAgIHVybDogbUxhenkgPyBlLnVybCArIG1MYXp5IDogZS51cmwsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBleHRyYTogZXh0cmFcXFxcclxcXFxuICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICB9XFxcXHJcXFxcbiAgICB9XFxcXHJcXFxcbn1cXFxcclxcXFxuXFxcXHJcXFxcbi8v6I635Y+W55S16KeG5Ymn5YiG6ZuG6ZO+5o6lLGlk5piv54mH5a2Q57yW5Y+3LHVpZOaYr+inhumikea6kOe8luWPt1xcXFxyXFxcXG5mdW5jdGlvbiBnZXRUdlVybHMoaWQsIHVpZCkge1xcXFxyX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ICAgICBsZXR2OiA2LFxcXFxyXFxcXG4gICAgICAgICAgICBtZ3R2OiA3LFxcXFxyXFxcXG4gICAgICAgICAgICBiaWxpYmlsaTogOCxcXFxcclxcXFxuICAgICAgICAgICAgaXFpeWk6IDksXFxcXHJcXFxcbiAgICAgICAgICAgIGNudHY6IDEyLFxcXFxyXFxcXG4gICAgICAgICAgICBjY3R2NjogMTMsXFxcXHJcXFxcbiAgICAgICAgICAgIG1pZ3V2aWRlbzogMTUsXFxcXHJcXFxcbiAgICAgICAgICAgIHhpZ3VhOiAxNyxcXFxcclxcXFxuICAgICAgICAgICAgYWNmdW46IDE4LFxcXFxyXFxcXG4gICAgICAgICAgICBtYWlkdWlkdWk6IDE5XFxcXHJcXFxcbiAgICAgICAgfTtcXFxcclxcXFxuICAgICAgICBsZXQgbnVtID0gc1t1aWRdO1xcXFxyXFxcXG5cXFxcclxcXFxuICAgICAgICB2YXIgc291cmNlcyA9IHt9O1xcXFxyXFxcXG4gICAgICAgIGxldCBzbCA9IGh0bWwubWF0Y2goL3NvdXJjZXNcXFxcXFxcXFtbMS05XXsxLDJ9XFxcXFxcXFxdW1xcXFxcXFxcc1xcXFxcXFxcU10qP1xcXFxcXFxcXS9nKTtcXFxcclxcXFxuICAgICAgICBpZiAoc2wpIHtcXFxcclxcXFxuICAgICAgICAgICAgZm9yICh2YXIgaSBpbiBzbCkge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgZXZhbChzbFtpXSk7XFxcXHJcXFxcbiAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICBsZXQgc2NyaXB0X2xpc3QgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsICdib2R5JiZzY3JpcHRbc3JjXScpO1xcXFxyXFxcXG4gICAgICAgICAgICBsZXQgc291cmNlc191cmwgPSBcXFxcXFxcIlxcXFxcXFwiO1xcXFxyXFxcXG4gICAgICAgICAgICBmb3IgKGxldCBpIGluIHNjcmlwdF9saXN0KSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBsZXQgdXJsID0gcGFyc2VEb21Gb3JIdG1sKHNjcmlwdF9saXN0W2ldLCAnc2NyaXB0JiZzcmMnKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGlmICh1cmwuaW5kZXhPZignbWl4ZWRfc3RhdGljJykgIT09IC0xKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgc291cmNlc191cmwgPSB1cmw7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgbGV0IHNvdXJjZXNfbGlzdCA9IHJlcXVlc3Qoc291cmNlc191cmwpLm1hdGNoKC9zb3VyY2VzXFxcXFxcXFxbWzEtOV17MSwyfVxcXFxcXFxcXVtcXFxcXFxcXHNcXFxcXFxcXFNdKj9cXFxcXFxcXF0vZyk7XFxcXHJcXFxcbiAgICAgICAgICAgIGZvciAodmFyIGkgaW4gc291cmNlc19saXN0KSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBldmFsKHNvdXJjZXNfbGlzdFtpXSk7XFxcXHJcXFxcbiAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICB9XFxcXHJcXFxcblxcXFxyXFxcXG4gICAgICAgIGxldCByZW4gPSBzb3VyY2VzW251bV07XFxcXHJcXFxcbiAgICAgICAgaWYgKHJlbiAmJiByZW4ubGVuZ3RoID4gMCkge1xcXFxyXFxcXG4gICAgICAgICAgICAvKnZhciByID0gcmVuLm1hcChlID0+IHVuZXNjYXBlKGUucGxheV9saW5rLnJlcGxhY2UoLyhodHRwc3xodHRwKTpcXFxcXFxcXC9cXFxcXFxcXC93d3cuZG91YmFuLmNvbVxcXFxcXFxcL2xpbmsyXFxcXFxcXFwvXFxcXFxcXFw/dXJsPS8sICcnKVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgLnNwbGl0KCc7JylbMF0uc3Bsa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iupCcpLCAyKVxcXFxuICAgICAgICAgICAgLnNlbGVjdCgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSAn6buY6K6kJykgcmV0dXJuICd0b2FzdDovL+m7mOiupOmFjee9ruaXoOazleWIoOmZpO+8gSdcXFxcbiAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKVxcXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gY29uZmlnLmRldGFpbHNWaWV3Q29uZmlncy51c2UpIHJldHVybiAndG9hc3Q6Ly/or6XphY3nva7mraPlnKjkvb/nlKjvvIzml6Dms5XliKDpmaTvvIEnXFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoJ+ehruiupOWIoOmZpFxcXFxcXFwiJyArIGlucHV0ICsgJ1xcXFxcXFwi77yfJykuY29uZmlybSgoY29uZmlnLCBjb25maWdLZXkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGNvbmZpZy5kZXRhaWxzVmlld0NvbmZpZ3NbY29uZmlnS2V5XVxcXFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSlcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5Yig6ZmkJyArIGNvbmZpZ0tleSArICfmiJDlip8nXFxcXG4gICAgICAgICAgICAgICAgfSwgY29uZmlnLCBpbnB1dClcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgfSlcXFxcbiAgICBkLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTogJ/Cfk50nLFxcXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJ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yOi8vZW1wdHkjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZShjb25maWdLZXkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpXFxcXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5ob21lUGFnZUNvbmZpZ3MudXNlID09PSBjb25maWdLZXkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgLy9wdXRNeVZhcihcXFxcXFxcImlucHV0X2NvbmZpZ190eXBlXFxcXFxcXCIsICfpppbpobXphY3nva4nKVxcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcImlucHV0X25hbWVcXFxcXFxcIiwgY29uZmlnS2V5KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCJpbnB1dF9jb2RlXFxcXFxcXCIsIGNvbmZpZy5ob21lUGFnZUNvbmZpZ3NbY29uZmlnS2V5XS5jb25maWcpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9zZXR0aW5nLWVkaXRvcj9ydWxlPeWKqOa8qyZ2aWV3PWhvbWVQYWdlTW9kZUVkaXRQYWdlJztcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgY29uZmlnLmhvbWVQYWdlQ29uZmlncy51c2UgPSBjb25maWdLZXlcXFxcbiAgICAgICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSlcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIh+aNouaIkOWKnydcXFxcbiAgICAgICAgICAgIH0sIGNvbmZpZ0tleSksXFxcXG4g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gPT09ICfmlq3mj5InKSByZXR1cm4gJ3RvYXN0Oi8v6buY6K6k6Kej5p6Q5peg5rOV5Yig6Zmk77yBJ1xcXFxuICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpXFxcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBjb25maWcuYW5hbHlzaXNDb25maWdzLnVzZSkgcmV0dXJuICd0b2FzdDovL+ivpeino+aekOato+WcqOS9v+eUqO+8jOaXoOazleWIoOmZpO+8gSdcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJCgn56Gu6K6k5Yig6ZmkXFxcXFxcXCInICsgaW5wdXQgKyAnXFxcXFxcXCLvvJ8nKS5jb25maXJtKChjb25maWcsIGNvbmZpZ0tleSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgY29uZmlnLmFuYWx5c2lzQ29uZmlnc1tjb25maWdLZXldXFxcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKVxcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liKDpmaQnICsgY29uZmlnS2V5ICsgJ+aIkOWKnydcXFxcbiAgICAgICAgICAgICAgICB9LCBjb25maWcsIGlucHV0KVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICB9KVxcXFxuICAgIGQucHVzaCh7XFxcXG4gICAgICAgIHRpdGxlOiAn8J+TnScsXFxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcXFxuICAgICAgICB1cmw6ICQoT2JqZWN0LmtleXMoYW5hbHlzaXNDb25maWdzKS5maWx0ZXIoY29uZmlnS2V5ID0+IGNvbmZpZ0tleSAh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VzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxcXG4gICAgICAgICAgICBsZXQgcXVpY2tTZWFyY2hDb25maWdzID0gY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncztcXFxcbiAgICAgICAgICAgIGxldCBkdGV4dCA9IGlucHV0ICsgJ0BAJyArIHF1aWNrU2VhcmNoQ29uZmlnc1tpbnB1dF0ubmFtZSArICdAQCcgKyBxdWlja1NlYXJjaENvbmZpZ3NbaW5wdXRdLnBpYztcXFxcbiAgICAgICAgICAgIHJldHVybiAkKGR0ZXh0LCAn6K+35L+u5pS5JykuaW5wdXQoKGNvbmZpZywgcmF3KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgaW5wdXQgPSBpbnB1dC5zcGxpdCgnQEAnKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAocmF3ICE9IGlucHV0WzBdKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpbmRleCA9IGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3Mub3JkZXIuaW5kZXhPZihyYXcpO1xcXFxuICAgICAgICAgICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm9yZGVyW2luZGV4XSA9IGlucHV0WzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlnc1tyYXddO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlci5pbmRleE9mKGlucHV0WzBdKSA9PSAtMSkgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlci5wdXNoKGlucHV0WzBdKTtcXFxcbiAgICAgICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzW2lucHV0WzBdXSA9IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogaW5wdXRbMV0sXFxcXG4gICAgICAgICAgICAgICAgICAgIHBpYzogaW5wdXRbMl1cXFxcbiAgICAgICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/ruaUueaIkOWKnyc7XFxcXG4gICAgICAgICAgICB9LCBjb25maWcsIGlucHV0KVxcXFxuICAgICAgICB9KVxcXFxuICAgIH0pXFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6ICfwn5SBJyxcXFxcbiAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxcXG4gICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjJykucnVsZSgoKSA9PiB7XFxcXG4gICAgICAgICAgICBhZGRMaXN0ZW5lcignb25DbG9zZScsICQudG9TdHJpbmcoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2pzb24nKTtcXFxcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdvcCcpO1xcXFxuICAgICAgICAgICAgfSkpXFxcXG4gICAgICAgICAgICBpZiAoZ2V0TXlWYXIoJ2pzb24nKSA9PSBcXFxcXFxcIlxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHF1aWNrU2VhcmNoQ29uZmlncyA9IGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3M7XFxcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2pzb24nLCBKU09OLnN0cmluZ2lmeShxdWlja1NlYXJjaENvbmZpZ3MpKTtcXFxcbiAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgbGV0IG9sZCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2pzb24nKSk7XFxcXG4gICAgICAgICAgICBsZXQgZCA9IFtdO1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+WIhuWIq+eCueWHu+S4pOmhueS7peS6pOaNoumhuuW6j1xcXFxcXFxcbuKAmOKAmOaOkuW6j+WujOavleWQjueCueaIkeS/neWtmOaOkuW6jyzlkKbliJnmjpLluo/kuI3nlJ/mlYjigJnigJknLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UoZmV0Y2goZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpO1xcXFxuICAgICAgICAgICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzID0gSlNPTi5wYXJzZShnZXRNeVZhcignanNvbicpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcXFxuICAgICAgICAgICAgICAgICAgICBiYWNrKHRydWUpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55oiQ5YqfJ1xcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgb2xkLm9yZGVyLmZvckVhY2goKHZhbHVlLCBpbmRleCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBnZXRNeVZhcignb3AnKSA9PSB2YWx1ZSA/IHZhbHVlICsgJ+KAmOKAmCjlvZPliY3pgInkuK0p4oCZ4oCZJyA6IHZhbHVlLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChrZXksIGluZGV4KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgb3AgPSBnZXRNeVZhcignb3AnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcCA9PSAnJykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdvcCcsIGtleSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9wID09IGtleSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ29wJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvbGQgPSBKU09OLnBhcnNlKGdldE15VmFyKCdqc29uJykpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdhID0ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlOiBvbGQubW9kZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3JkZXI6IG9sZC5vcmRlclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG9waW5kZXggPSBuZXdhLm9yZGVyLmluZGV4T2Yob3ApO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChNYXRoLmFicyhvcGluZGV4IC0gaW5kZXgpID09IDEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlcltvcGluZGV4XSA9IGtleTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlcltpbmRleF0gPSBvcDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9waW5kZXggPiBpbmRleCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyLnNwbGljZShvcGluZGV4LCAxKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlci5zcGxpY2UoaW5kZXgsIDAsIG9wKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyLnNwbGljZShvcGluZGV4LCAxKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlci5zcGxpY2UoaW5kZXggLSAxLCAwLCBvcCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld2Eub3JkZXIuZm9yRWFjaCh2YWx1ZSA9PiBuZXdhW3ZhbHVlXSA9IG9sZFt2YWx1ZV0pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2pzb24nLCBKU09OLnN0cmluZ2lmeShuZXdhKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignb3AnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgdmFsdWUsIGluZGV4KVxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcXFxuICAgICAgICB9KVxcXFxuICAgIH0pXFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6ICfimpnvuI8nLFxcXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXFxcbiAgICAgICAgdXJsOiAkKHF1aWNrU2VhcmNoQ29uZmlnc1snbW9kZSddIHx8IFxcXFxcXFwiXFxcXFxcXCIsICfor7fmraPnoa7ovpPlhaXnu4Tku7bmoLflvI9cXFxcXFxcXG7lu7rorq7lgLw6ZmxleF9idXR0b24gc2Nyb2xsX2J1dHRvbiBpY29uX3JvdW5kX3NtYWxsXzQgaWNvbl9zbWFsbF80JykuaW5wdXQoKCkgPT4ge1xcXFxuICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxcXG4gICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm1vZGUgPSBpbnB1dDtcXFxcbiAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXFxcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/moLflv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ZBNzI5OCc7XFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ0nICsgJ+iHquWumuS5iemAieS4reagh+etvuminOiJsicuYm9sZCgpLFxcXFxuICAgICAgICBkZXNjOiAn4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9JyArIGNob29zZUNvbG9yICsgJz4nICsgJ+aIkeaYr+mihOiniOaViOaenDwvZm9udD4nLFxcXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxcXG4gICAgICAgIHVybDogJChjaG9vc2VDb2xvciwgJ+WIq+W/mOS6hiMnKS5pbnB1dCgoKSA9PiB7XFxcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxcXG4gICAgICAgICAgICBjb25maWcuY2hvb3NlQ29sb3IgPSBpbnB1dDtcXFxcbiAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXFxcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+iuvue9ruabtOaUueW3suS/neWtmFxcXFxcXFwiO1xcXFxuICAgICAgICB9KVxcXFxuICAgIH0pXFxcXG5cXFxcbiAgICBob21lUGFnZVNldHRpbmdNb2R1bGUoZCk7XFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcXFxuICAgIH0pXFxcXG5cXFxcbiAgICBxdWlja1NlYXJjaERJWU1vZHVsZShkLCBjb25mKTtcXFxcbiAgICBkLnB1c2goe1xcXFxuICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxcXG4gICAgfSlcXFxcblxcXFxuICAgIGRldGFpbFZpZXdTZXR0aW5nTW9kdWxlKGQpO1xcXFxuICAgIGQucHVzaCh7XFxcXG4gICAgICAgIGNvbF90eXBlOiAnbGluZSdcXFxcbiAgICB9KVxcXFxuXFxcXG4gICAgaWYgKHRydWUvKmdldEl0ZW0oJ3Bhc3N3b3JkJykgPT0gJ3RydWUnKi8pIHtcXFxcbiAgICAgICAgYW5hbHlzaXNTZXR0aW5nTW9kdWxlKGQpO1xcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcXFxuICAgICAgICB9KVxcXFxuICAgIH1cXFxcblxcXFxuICAgIGQucHVzaCh7XFxcXG4gICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArICfmgaLlpI3pu5jorqTorr7nva4nLmJvbGQoKSxcXFxcbiAgICAgICAgZGVzYzogJ+mHjeeUnycsXFxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcXFxcbiAgICAgICAgdXJsOiAkKFsn6YeN572u5pif5pif6aKc6ImyJywgJ+mHjee9rumAieS4reagh+etvuminOiJsicsICfph43nva7lv6vpgJ/mkJzntKInLCAn6YeN572u6aaW6aG15Li66buY6K6kJywgJ+mHjee9ruivpuaDhemhtScgLCAn5riF6Zmk5YWo6YOo6K6+572uJ10sIDEpLnNlbGVjdCgoKSA9PiB7XFxcXG4gICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIuehruWumuimgVxcXFxcXFwiICsgaW5wdXQgKyBcXFxcXFxcIu+8n1xcXFxcXFwiKS5jb25maXJtKChzZWwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgaXRlbSA9ICcnO1xcXFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoc2VsKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+mHjee9ruaYn+aYn+minOiJsic6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpdGVtID0gJ3N0YXJDb2xvcic7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn6YeN572u6YCJ5Lit5qCH562+6aKc6ImyJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAnY2hvb3NlQ29sb3InO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+mHjee9ruW/q+mAn+aQnOe0oic6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpdGVtID0gJ3F1aWNrU2VhcmNoQ29uZmlncyc7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn6YeN572u6aaW6aG15Li66buY6K6kJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAnaG9tZVBhZ2VDb25maWdzJztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfph43nva7or6bmg4XpobUnOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbSA9ICdkZXRhaWxWaWV3Q29uZmlncyc7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5riF6Zmk5YWo6YOo6K6+572uJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAnYWxsJztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAvLyBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL3NldHRpbmdQYWdlJykpLnJ1bGUpO1xcXFxuICAgICAgICAgICAgICAgIGxldCBkZWZhdWx0Q29uZmlncyA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9kZWZhdWx0Q29uZml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1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgbGV0IG9sZGZpbGUgPSBcXFxcXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcXFxcXCI7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KGZpbGUpKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCgnanNvbj0nICsgZmV0Y2goZmlsZSkpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBqc1VybCA9IGpzb24uc2V0dGluZ3MuY2o7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChqc1VybCkpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBheXRtUGFyc2UoaW5wdXQpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChmaWxlRXhpc3Qob2xkZmlsZSkpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQganNVcmwgPSBKU09OLnBhcnNlKGZldGNoKG9sZGZpbGUpKS5jajtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBldmFsKGZldGNoKGpzVXJsKSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF5dG1QYXJzZShpbnB1dCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/msqHmib7liLDmlq3mj5LphY3nva7mlofku7YnO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICB9KSxcXFxcclxcXFxuICAgICAgICAgICAgc2V0dGluZzogJC50b1N0cmluZygoKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBsZXQgZmlsZSA9IFxcXFxcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9EdWFuTmlhbi9NeVBhcnNlLmpzb25cXFxcXFxcIjtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGxldCBvbGRmaWxlID0gXFxcXFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL015UGFyc2VTZXQuanNvblxcXFxcXFwiO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChmaWxlKSkge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoJ2pzb249JyArIGZldGNoKGZpbGUpKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQganNVcmwgPSBqc29uLnNldHRpbmdzLmNqO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goanNVcmwpKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2V0VXJsO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChmaWxlRXhpc3Qob2xkZmlsZSkpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQganNVcmwgPSBKU09OLnBhcnNlKGZldGNoKG9sZGZpbGUpKS5jajtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBldmFsKGZldGNoKGpzVXJsKSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNldFVybDtcXFxcclxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9wYWdlL1JvdXRlP3J1bGU9TXlGaWVsZOG0sOKBvyZ0eXBlPeiuvue9rlxcXFxcXFwiO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuICAgIH1cXFxcclxcXFxufVxcXFxyXFxcXG4kLmV4cG9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maWcgPyByb290Q29uZmlnIDogSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxcXHJcXFxcbiAgICBpZiAobmFtZSkge1xcXFxyXFxcXG4gICAgICAgIGlmIChjb25maWdbbmFtZV0gPT0gbnVsbCkge1xcXFxyXFxcXG4gICAgICAgICAgICBjb25maWcgPSBpbml0Q29uZmlncyhuYW1lLCBjb25maWcpO1xcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuICAgICAgICByZXR1cm4gY29uZmlnW25hbWVdO1xcXFxyXFxcXG4gICAgfSBlbHNlIHtcXFxcclxcXFxuICAgICAgICByZXR1cm4gY29uZmlnO1xcXFxyXFxcXG4gICAgfVxcXFxyXFxcXG59XFxcXHJcXFxcblxcXFxyXFxcXG4vL+e8lueggeW3peWFt+exu1xcXFxyXFxcXG5sZXQgWmlwVG9vbCA9IHtcXFxcclxcXFxuICAgIGRlcGVuZGVuY2U6ICdodHRwczovL3VucGtnLmNvbS9sei1zdHJpbmdAMS40LjQvbGlicy9sei1zdHJpbmcubWluLmpzJyxcXFxcclxcXFxuICAgIGNvbXByZXNzOiB7XFxcXHJcXFxcbiAgICAgICAgc2l6ZToge1xcXFxyXFxcXG4gICAgICAgICAgICBrZXk6IFxcXFxcXFwidGV4dC1jb21wcmVzcy1zaXplXFxcXFxcXCIsXFxcXHJcXFxcbiAgICAgICAgICAgIHNldDogKG5ld1ZhbHVlKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcih0aGlzLmtleSwgbmV3VmFsdWUudG9TdHJpbmcoKSlcXFxcclxcXFxuICAgICAgICAgICAgfSxcXFxcclxcXFxuICAgICAgICAgICAgZ2V0OiAoKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VJbnQoZ2V0TXlWYXIodGhpcy5rZXksIFxcXFxcXFwiMFxcXFxcXFwiKSlcXFxcclxcXFxuICAgICAgICAgICAgf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9IGNvbmZpZ0NvbW1hbmQuc3BsaXQoJ+WKqOa8qycpWzBdLnJlcGxhY2UoL1xcXFxcXFxcXFxcXFxcXFxuLywgJycpXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBjb25maWdDb21tYW5kID0gcGFyc2VQYXN0ZShyZXN1bHQpXFxcXHJcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6K+35pu05paw6KeG55WM54mI5pys6IezIEMyMDcwIOS7peS4iidcXFxcclxcXFxuICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuICAgICAgICB0cnkge1xcXFxyXFxcXG4gICAgICAgICAgICBsZXQgcmVzdWx0U3BsaXRzID0gY29uZmlnQ29tbWFuZC5zcGxpdChcXFxcXFxcIu+/pVxcXFxcXFwiKVxcXFxyXFxcXG4gICAgICAgICAgICBsZXQgZW5jVHlwZSA9IHJlc3VsdFNwbGl0c1szXVxcXFxyXFxcXG4gICAgICAgICAgICByZXN1bHQgPSByZXN1bHRTcGxpdHNbNF1cXFxcclxcXFxuICAgICAgICAgICAgc3dpdGNoIChlbmNUeXBlKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBjYXNlICdCYXNlNjQnOlxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IGJhc2U2NERlY29kZShyZXN1bHQpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgY2FzZSAnWmlwcGVyJzpcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBaaXBUb29sLmRlY29tcHJlc3MuZXhlYyhyZXN1bHQpXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXHJcXFxcbiAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpO1xcXFxyXFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcclxcXFxuICAgICAgICAgICAgbG9nKGUubWVzc2FnZSlcXFxcclxcXFxuICAgICAgICAgICAgdGhyb3cgXFxcXFxcXCLlr7zlhaXmlbDmja7kuI3lkIjms5VcXFxcXFxcIlxcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuICAgICAgICByZXR1cm4gcmVzdWx0O1xcXFxyXFxcXG4gICAgfVxcXFxyXFxcXG59XFxcIn1dXCJ9IiwicGljVXJsIjoiaHR0cHM6Ly9pMC53cC5jb20vaTAuaW1nMmlwZnMuY29tL2lwZnMvUW1kMlo3VnBVVXU5TlR5NUQzQ2NKRnhid01Sb0RmdVVtaG1nUEptTktKTThnbj9maWxlbmFtZT0lRTUlODglODYlRTclQjElQkIuanBnIiwidGl0bGUiOiLliIbnsbsifQ==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement