xiaomianao666

小程序:新片场

Oct 4th, 2023
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@新片场@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi5paw54mH5Zy6IiwiYXV0aG9yIjoi6aG6IiwidXJsIjoiaGlrZXI6Ly9lbXB0eSMjbm9SZWZyZXNoIyIsInZlcnNpb24iOjIwMjMwOTI1LCJjb2xfdHlwZSI6Im1vdmllXzMiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6InZpZGVvIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG52YXIgZCA9IFtdO1xuaWYgKE1ZX1BBR0UgPT0gMSkge1xuICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcImhpa2VyOi8vcGFnZS/pppbpobXlm7rlrppKU09OXCIpKS5ydWxlKVxuICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcImhpa2VyOi8vcGFnZS/pppbpobXliJfooahcIikpLnJ1bGUpXG4gICAgZCA9IGQuY29uY2F0KEQpXG59XG5zZXRSZXN1bHQoZCk7Iiwic2VhcmNoX3VybCI6IiIsImdyb3VwIjoi4pGg5bi455SoIiwic2VhcmNoRmluZCI6IiIsImRldGFpbF9jb2xfdHlwZSI6Im1vdmllXzEiLCJkZXRhaWxfZmluZF9ydWxlIjoiIiwic2RldGFpbF9jb2xfdHlwZSI6Im1vdmllXzEiLCJzZGV0YWlsX2ZpbmRfcnVsZSI6ImluZGV4T2YiLCJ1YSI6Im1vYmlsZSIsInByZVJ1bGUiOiIiLCJwYWdlcyI6Ilt7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlw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0gJ+acrOWcsOWRqOi+uScpIHtcXG4gICAgICAgIHZtanNvbiA9IHZtanNvbi5jaGlsZHJlbjtcXG4gICAgfVxcbiAgICBELnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6ICdsaW5lJyxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6ICfpppbpobVf56m65qC8JyxcXG4gICAgICAgICAgICBjbHM6ICfpppbpobUnXFxuICAgICAgICB9XFxuICAgIH0pXFxuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdm1qc29uLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICBpZiAodGlwc190aXRsZSA9PSAn54Ot6ZeoJykge1xcbiAgICAgICAgICAgIHZhciB2bSA9IHZtanNvbltpXS5kYXRhLnJlc291cmNlO1xcbiAgICAgICAgfSBlbHNlIGlmIChbJ+S7iuaXpeeyvumAiScsICfmnKzlnLDlkajovrknXS5pbmNsdWRlcyh0aXBzX3RpdGxlKSkge1xcbiAgICAgICAgICAgIHZhciB2bSA9IHZtanNvbltpXS5jaGlsZHJlblswXS5tb2RlbC5yZXNvdXJjZTtcXG4gICAgICAgIH1cXG4gICAgICAgIHZhciBQTEFZX0xJTktTID0gdm0udXJsLnJlcGxhY2UoL25ld3N0dWRpb3MvLCAnaHR0cHMnKTtcXG4gICAgICAgIHZhciBVU0VSX0hPTUUgPSAnaHR0cHM6Ly9hcHAueGlucGlhbmNoYW5nLmNvbS91c2VyLycgKyB2bS51c2VyX2lkO1xcbiAgICAgICAgRC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdm0uYXV0aG9yLnVzZXJpbmZvLnVzZXJuYW1lLFxcbiAgICAgICAgICAgIHBpY191cmw6IHZtLmF1dGhvci51c2VyaW5mby5hdmF0YXIsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycrVVNFUl9IT01FKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBldmFsKEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vcGFnZS/liJvkvZzkurrpppbpobVcXFwiKSkucnVsZSk7XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGNsczogJ+mmlumhtSdcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICAgICAgRC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdm0udGl0bGUsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycrUExBWV9MSU5LUykubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcign6K+m57uG57G75YirJywgJ+eugOS7iycpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL3BhZ2Uv6KeG6aKR6K+m5oOF6aG1XFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBjbHM6ICfpppbpobUnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgICAgIEQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHZtLnRpdGxlLFxcbiAgICAgICAgICAgIGltZzogdm0uY292ZXIsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycrUExBWV9MSU5LUykubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL3BhZ2UvYXBw5pKt5pS+6ZO+5o6lXFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAncGljXzFfZnVsbCcsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6IHZtLnRpdGxlLFxcbiAgICAgICAgICAgICAgICBjbHM6ICfpppbpobUnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgICAgIEQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHZtLmNvdW50LmNvdW50X2NvbGxlY3QsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3dlaXN5ci9pY29uL2Jic+aUtuiXjy5zdmcnLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnaWNvbl9zbWFsbF8zJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBjbHM6ICfpppbpobUnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgICAgIEQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHZtLmNvdW50LmNvdW50X2NvbW1lbnQsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3dlaXN5ci9pY29uL2Jic+WbnuWkjS5zdmcnLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnK1BMQVlfTElOS1MpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+ivpue7huexu+WIqycsICfor4TorronKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL+inhumikeivpuaDhemhtVxcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfMycsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2xzOiAn6aaW6aG1J1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgICAgICBELnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiB2bS5jb3VudC5jb3VudF9saWtlLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS93ZWlzeXIvaWNvbi9iYnPngrnotZ4uc3ZnJyxcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfMycsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2xzOiAn6aaW6aG1J1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgICAgICBELnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaycsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2xzOiAn6aaW6aG1J1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH1cXG4gICAgaWYgKHRpcHNfdGl0bGUgPT0gJ+S7iuaXpeeyvumAiScpIHB1dE15VmFyKCfpppbpobVf57K+6YCJJywgSlNPTi5zdHJpbmdpZnkoRCkpO1xcbiAgICBpZiAodGlwc190aXRsZSA9PSAn54Ot6ZeoJykgcHV0TXlWYXIoJ+mmlumhtV/ng63pl6gnLCBKU09OLnN0cmluZ2lmeShEKSk7XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwiYXBw5YiG57G75LiO5pCc57Si5YiX6KGoXCIsXCJwYXRoXCI6XCJhcHDliIbnsbvkuI7mkJzntKLliJfooahcIixcInJ1bGVcIjpcInZhciBEID0gW107XFxuaWYgKGFwcF9saXN0cy5sZW5ndGggPjApIHtcXG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcHBfbGlzdHMubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgIHZhciBQTEFZX0xJTktTID0gYXBwX2xpc3RzW2ldLnVybC5yZXBsYWNlKC9uZXdzdHVkaW9zLywgJ2h0dHBzJyk7XFxuICAgICAgICB2YXIgbGlrZSA9IGFwcF9saXN0c1tpXS5jb3VudC5jb3VudF9saWtlO1xcbiAgICAgICAgdmFyIHZpZXcgPSBhcHBfbGlzdHNbaV0uY291bnQuY291bnRfdmlldztcXG4gICAgICAgIGlmIChsaWtlID4gMTAwMCkgbGlrZSA9IChsaWtlIC8gMTAwMCkudG9GaXhlZCgxKSArICdrJztcXG4gICAgICAgIGlmICh2aWV3ID4gMTAwMDApIHZpZXcgPSAodmlldyAvIDEwMDAwKS50b0ZpeGVkKDEpICsgJ3cnO1xcbiAgICAgICAgRC5wdXNoKHtcXG4gICAgICAgICAgICBpbWc6IGFwcF9saXN0c1tpXS5jb3ZlcixcXG4gICAgICAgICAgICB0aXRsZTogYXBwX2xpc3RzW2ldLnRpdGxlLFxcbiAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ0gPHNtYWxsPjxmb250IGNvbG9yPSdncmV5Jz5cXFwiICsgJ+aSreaUvumHjyAnICsgdmlldyArICcgwrcgJyArICfllpzmrKIgJyArIGxpa2UgKyAnXFxcXG4nICsgYXBwX2xpc3RzW2ldXFxuICAgICAgICAgICAgICAgIC5hdXRob3IudXNlcmluZm8udXNlcm5hbWUgKyBcXFwiPC9mb250PiA8L3NtYWxsPlxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycrUExBWV9MSU5LUykubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcign6K+m57uG57G75YirJywgJ+eugOS7iycpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL3BhZ2Uv6KeG6aKR6K+m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kJzlhbPplK7lrZcnLGlucHV0KVxcXCJcXG4gICAgICAgIH0sXFxuICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2xpbmUnLFxcbiAgICB9KVxcblxcbiAgICBpZiAoIXRpcHNfdGl0bGUpIHtcXG4gICAgICAgIGlmIChyZXF1ZXN0KCdoaWtlcjovL2ZpbGVzL2NhY2hlL+aWsOeJh+WcuuWOhuWPsuaQnOe0oi5qc29uJykpIHtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDEwOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPGI+PGZvbnQgY29sb3I9Z3JheT4nICsgJ/Cfl5HvuI8g5Y6G5Y+y5pCc57SiJyArICc8L2ZvbnQ+PC9iPicsXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZSgnaGlrZXI6Ly9maWxlcy9jYWNoZS/mlrDniYflnLrljoblj7LmkJzntKIuanNvbicsICcnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHZhciBsb2NhbERhdGEgPSByZXF1ZXN0KCdoaWtlcjovL2ZpbGVzL2NhY2hlL+aWsOeJh+WcuuWOhuWPsuaQnOe0oi5qc29uJyk7XFxuICAgICAgICAgICAgaWYgKCFsb2NhbERhdGEpIGxvY2FsRGF0YSA9IFxcXCJbXVxcXCI7XFxuICAgICAgICAgICAgdmFyIGxpc2hpID0gSlNPTi5wYXJzZShsb2NhbERhdGEpLnNsaWNlKC0yOCk7XFxuICAgICAgICAgICAgdmFyIEhpc3RvcnkgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gbGlzaGkubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHtcXG4gICAgICAgICAgICAgICAgdmFyIGNjbGlzaGkgPSBsaXNoaVtpXTtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBjY2xpc2hpLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJmbGV4X2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGNjbGlzaGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcign5pCc5YWz6ZSu5a2XJywgY2NsaXNoaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgY2NsaXNoaSksXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMjA7IGkrKykge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08Yj48Zm9udCBjb2xvcj1ncmF5PicgKyAn8J+UpSDng63pl6jlhoXlrrknICsgJzwvZm9udD48L2I+JyxcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBsZXQgUm11cmwgPSAnaHR0cHM6Ly9hcHAueGlucGlhbmNoYW5nLmNvbS92Mi9zZWFyY2gvaG90Q29udGVudHMnO1xcbiAgICAgICAgUm1qc29uID0gSlNPTi5wYXJzZShyZXF1ZXN0KFJtdXJsKSkuZGF0YS5saXN0O1xcbiAgICAgICAgZm9yIChsZXQgaSBpbiBSbWpzb24pIHtcXG4gICAgICAgICAgICB2YXIgdGlwcyA9IChwYXJzZUludChpKSArIDEpICsgJyAnICsgUm1qc29uW2ldLnRpdGxlO1xcbiAgICAgICAgICAgIHZhciBQTEFZX0xJTktTID0gUm1qc29uW2ldLmxpbmsucmVwbGFjZSgvbmV3c3R1ZGlvcy8sICdodHRwcycpO1xcbiAgICAgICAgICAgIHZhciB1cmwgPSBSbWpzb25baV0ubGluaztcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGlwcyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJytQTEFZX0xJTktTKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcign6K+m57uG57G75YirJywgJ+eugOS7iycpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL+inhumikeivpuaDhemhtVxcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08Yj48Zm9udCBjb2xvcj1ncmF5PicgKyAn8J+UpSDng63pl6jmkJzntKInICsgJzwvZm9udD48L2I+JyxcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICB2YXIgdXJsID0gJ2h0dHBzOi8vYXBwLnhpbnBpYW5jaGFuZy5jb20vc2VhcmNoX3JlY29tbWVuZF9rd3MnO1xcbiAgICAgICAgdmFyIEhvdGpzb24gPSBKU09OLnBhcnNlKGZldGNoKHVybCkpLmRhdGEubGlzdDtcXG4gICAgICAgIGZvciAobGV0IGkgaW4gSG90anNvbikge1xcbiAgICAgICAgICAgIHZhciB0aXBzID0gSG90anNvbltpXS5uYW1lO1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXBzLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImZsZXhfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHRpcHMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCfmkJzlhbPplK7lrZcnLCB0aXBzKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCB0aXBzKSxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICB2YXIgQ29sb3IgPSBcXFwiI0ZBNzI5OFxcXCI7XFxuXFxuICAgIGZ1bmN0aW9uIGdldEhlYWQodGl0bGVzKSB7XFxuICAgICAgICByZXR1cm4gJ+KAmOKAmOKAmeKAmTxzdHJvbmc+PGZvbnQgY29sb3I9XFxcIicgKyBDb2xvciArICdcXFwiPicgKyB0aXRsZXMgKyAnPC9mcm9udD48L3N0cm9uZz4nO1xcbiAgICB9XFxuICAgIGlmICh0aXBzX3RpdGxlKSB7XFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDU7IGkrKykge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHRpcHNfc2VsZWN0ID09ICdhcnRpY2xlJyA/IGdldEhlYWQoJ+S9nOWTgScpIDogJ+S9nOWTgScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzInLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoQ29sb3IsIFBBR0UpID0+IHtcXG5cXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+mhteeggScsICcxJyk7XFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcihcXFwi5L2cL+WImy/mlodcXFwiKSAhPSAnYXJ0aWNsZScpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCfkvZwv5YibL+aWhycsICdhcnRpY2xlJyk7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoJ+aQnOe0oicpXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKCdlbmQnKVxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSgn5pCc57SiX+S9nOWTgScsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+KAmOKAmOKAmeKAmTxzdHJvbmc+PGZvbnQgY29sb3I9XFxcIicgKyBDb2xvciArICdcXFwiPicgKyAn5L2c5ZOBJyArICc8L2Zyb250Pjwvc3Ryb25nPidcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKCfmkJzntKJf5Yib5L2c5Lq6Jywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5Yib5L2c5Lq6J1xcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHZhciBBUFBfVVJMID0gXFxcImh0dHBzOi8vYXBwLnhpbnBpYW5jaGFuZy5jb20vdjIvc2VhcmNoP3R5cGU9YXJ0aWNsZVxcXCIgKyBcXFwiJmt3PVxcXCIgKyBnZXRNeVZhcihcXFwi5pCc5YWz6ZSu5a2XXFxcIikgKyAnJnBhZ2U9JyArIFBBR0U7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgYXBwX2xpc3RzID0gSlNPTi5wYXJzZShyZXF1ZXN0KEFQUF9VUkwpKS5kYXRhLmxpc3Q7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vcGFnZS9hcHDliIbnsbvkuI7mkJzntKLliJfooahcXFwiKSkucnVsZSlcXG4gICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcign5pCc57SiX+WIm+S9nOS6uicsIEQpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgLy9yZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgIH0sIENvbG9yLCBQQUdFKSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogJ+aQnOe0ol/kvZzlk4EnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHRpcHNfc2VsZWN0ID09ICdjcmVhdG9yJyA/IGdldEhlYWQoJ+WIm+S9nOS6uicpIDogJ+WIm+S9nOS6uicsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzInLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoQ29sb3IsIFBBR0UpID0+IHtcXG4gICAgICAgICAgICAgICAgLy9wdXRNeVZhcign5L2cL+WImy/mlocnLCAnY3JlYXRvcicpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcign6aG156CBJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKFxcXCLkvZwv5YibL+aWh1xcXCIpICE9ICdjcmVhdG9yJykge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+S9nC/liJsv5paHJywgJ2NyZWF0b3InKTtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscygn5pCc57SiJylcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oJ2VuZCcpXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKCfmkJzntKJf5Yib5L2c5Lq6Jywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCY4oCY4oCZ4oCZPHN0cm9uZz48Zm9udCBjb2xvcj1cXFwiJyArIENvbG9yICsgJ1xcXCI+JyArICfliJvkvZzkuronICsgJzwvZnJvbnQ+PC9zdHJvbmc+J1xcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ+aQnOe0ol/kvZzlk4EnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfkvZzlk4EnXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL3BhZ2UvYXBw5Yib5L2c5Lq65pCc57Si5YiX6KGoXFxcIikpLnJ1bGUpXFxuICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ+aQnOe0ol/liJvkvZzkuronLCBEKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgfSwgQ29sb3IsIFBBR0UpLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiAn5pCc57SiX+WIm+S9nOS6uidcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9XFxufVwifSx7XCJjb2xfdHlwZVwiOlwidGV4dF9pY29uXCIsXCJuYW1lXCI6XCLpppbpobXlm5vlpK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U6ICc8YmlnPjxiPjxmb250IGNvbG9yPSMwMDA+5YiG57G75L2c5ZOB5bqTPC9mb250PjwvYj48L2JpZz4nXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgYWRkSXRlbUFmdGVyKCflm5vlpKfph5HliJonLCBKU09OLnBhcnNlKGdldE15VmFyKCfpppbpobVf5YiG57G7JykpKVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgfSxYUEMpXFxufSlcXG5cXG5kLnB1c2goe1xcbiAgICB0aXRsZTogXFxcIueyvumAiVxcXCIsXFxuICAgIHBpY191cmw6ICdodHRwczovL29zcy14cGMwLnhwY2Nkbi5jb20vVXBsb2FkL2VkdS8yMDIzLzAzLzI0NjQxZDczM2I5MzViMy5wbmcnLFxcbiAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfNCcsXFxuICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICBpZiAoZ2V0TXlWYXIoJ+S4u+agh+mimCcpICE9ICfku4rml6Xnsr7pgIknKSB7XFxuICAgICAgICAgICAgcHV0TXlWYXIoJ+S4u+agh+mimCcsICfku4rml6Xnsr7pgIknKTtcXG4gICAgICAgICAgICBpZiAoIWdldE15VmFyKCfpppbpobVf57K+6YCJJykpIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL+mmlumhteWIl+ihqFxcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoJ+mmlumhtScpO1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oXFxcIuWbm+Wkp+mHkeWImlxcXCIsIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICc8YmlnPjxiPjxmb250IGNvbG9yPSMwMDA+5LuK5pel57K+6YCJPC9mb250PjwvYj48L2JpZz4nXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgYWRkSXRlbUFmdGVyKCflm5vlpKfph5HliJonLCBKU09OLnBhcnNlKGdldE15VmFyKCfpppbpobVf57K+6YCJJykpKVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgfSksXFxufSlcXG5cXG5kLnB1c2goe1xcbiAgICB0aXRsZTogJ+eDremXqCcsXFxuICAgIHBpY191cmw6ICdodHRwczovL29zcy14cGMwLnhwY2Nkbi5jb20vVXBsb2FkL2VkdS8yMDIzLzAzLzI0NjQxZDczM2I2MmNiOS5wbmcnLFxcbiAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfNCcsXFxuICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICBpZiAoZ2V0TXlWYXIoJ+S4u+agh+mimCcpICE9ICfng63pl6gnKSB7XFxuICAgICAgICAgICAgcHV0TXlWYXIoJ+S4u+agh+mimCcsICfng63pl6gnKTtcXG4gICAgICAgICAgICBpZiAoIWdldE15VmFyKCfpppbpobVf54Ot6ZeoJykpIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL+mmlumhteWIl+ihqFxcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoJ+mmlumhtScpO1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oXFxcIuWbm+Wkp+mHkeWImlxcXCIsIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICc8YmlnPjxiPjxmb250IGNvbG9yPSMwMDA+54Ot6ZeoPC9mb250PjwvYj48L2JpZz4nXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgYWRkSXRlbUFmdGVyKCflm5vlpKfph5HliJonLCBKU09OLnBhcnNlKGdldE15VmFyKCfpppbpobVf54Ot6ZeoJykpKVxcbiAgICAgICAgf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tYWt1ID0gcGxheV91cmxfanNvbi52aWQ7XFxuICAgICAgICB2YXIgZGFubXUgPSAnaHR0cHM6Ly9vc3MtZGFubWFrdTEyLnhwY2Nkbi5jb20vJyArIGRhbm1ha3UgKyAnLnR4dCc7XFxuICAgICAgICB2YXIgY29kZSA9IHJlcXVlc3QoZGFubXUpXFxuICAgICAgICB2YXIgYXJyID0gY29kZS5zcGxpdChcXFwiXFxcXG5cXFwiKVxcbiAgICAgICAgdmFyIHIgPSBbXVxcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICB2YXIgbGluZSA9IEpTT04ucGFyc2UoYXJyW2ldKVxcbiAgICAgICAgICAgICAgICBpZiAobGluZS5jb250ZW50KSB7XFxuICAgICAgICAgICAgICAgICAgICByLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQ6IGxpbmUuY29udGVudCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aW1lOiBsaW5lLm9mZnNldFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICB9XFxuICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvZGFubXUuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KHIpKVxcbiAgICAgICAgLy8g57uT5p2f5by55bmV6I635Y+WXFxuICAgICAgICBsZXQgdXJscyA9IFtdO1xcbiAgICAgICAgbGV0IG5hbWVzID0gW107XFxuICAgICAgICBmb3IgKGxldCBqIGluIHBsYXlfdXJscykge1xcbiAgICAgICAgICAgIHVybHMucHVzaChwbGF5X3VybHNbal0udXJsKVxcbiAgICAgICAgICAgIG5hbWVzLnB1c2gocGxheV91cmxzW2pdLnByb2ZpbGUpXFxuICAgICAgICB9XFxuICA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4gICAgICAgIHNldFBhZ2VUaXRsZShhcHBfbGlzdHNbaV0udXNlcm5hbWUpXFxuICAgICAgICB2YXIgVVNFUl9IT01FID0gYXBwX2xpc3RzW2ldLnVybC5yZXBsYWNlKC9uZXdzdHVkaW9zLywgJ2h0dHBzJylcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMTA7IGkrKykge1xcbiAgICAgICAgICAgIEQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgY2xzOiAn5pCc57SiJ1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIHZhciB1cmwgPSAkKCcjbm9Mb2FkaW5nIycgKyBVU0VSX0hPTUUpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICByZXR1cm4gZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL3BhZ2Uv5Yib5L2c5Lq66aaW6aG1XFxcIikpLnJ1bGUpO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBELnB1c2goe1xcbiAgICAgICAgICAgIGltZzogYXBwX2xpc3RzW2ldLmF2YXRhciArICdAUmVmZXJlcj0nICsgYXBwX2xpc3RzW2ldLmF2YXRhcixcXG4gICAgICAgICAgICB0aXRsZTogYXBwX2xpc3RzW2ldLnVzZXJuYW1lLFxcbiAgICAgICAgICAgIGRlc2M6ICcnLFxcbiAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBjbHM6ICfmkJzntKInXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG5cXG4gICAgICAgIHZhciBvY2N1cGF0aW9uID0gYXBwX2xpc3RzW2ld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bGFyaXR5ID0gKGNvdW50X3BvcHVsYXJpdHkgLyAxMDAwMCkudG9GaXhlZCgxKSArICd3JztcXG4gICAgICAgIC8v57KJ5LidXFxuICAgICAgICB2YXIgY291bnRfZm9sbG93ZXIgPSBVU0VSX0pTT04uY291bnQuY291bnRfZm9sbG93ZXI7XFxuICAgICAgICBpZiAoY291bnRfZm9sbG93ZXIgPiAxMDAwKSBjb3VudF9mb2xsb3dlciA9IChjb3VudF9mb2xsb3dlciAvIDEwMDApLnRvRml4ZWQoMSkgKyAnayc7XFxuICAgICAgICBpZiAoUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdwaWNfMV9mdWxsJyxcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICcwJyxcXG4gICAgICAgICAgICAgICAgaW1nOiBhcHBfYmFja2dyb3VuZCxcXG4gICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdXNlcl9uYW1lICsgJ1xcXFx0XFxcXHRcXFxcdFxcXFx0JyArIFxcXCI8Zm9udCBjb2xvcj1ncmV5PlxcXCIgKyAn5Lq65rCUICcgKyBjb3VudF9wb3B1bGFyaXR5ICsgJyDCtyAnICsgJ+eyieS4nSAnICsgY291bnRfZm9sbG93ZXIgKyBcXFwiPC9mb250PlxcXCIsXFxuICAgICAgICAgICAgICAgIGltZzogdXNlcl9hdmF0YXIsXFxuICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZScsXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCA1OyBpKyspIHtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiLFxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB2YXIgQ29sb3IgPSBcXFwiI0ZBNzI5OFxcXCI7XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gZ2V0SGVhZCh0aXRsZXMpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICfigJjigJjigJnigJk8c3Ryb25nPjxmb250IGNvbG9yPVxcXCInICsgQ29sb3IgKyAnXFxcIj4nICsgdGl0bGVzICsgJzwvZnJvbnQ+PC9zdHJvbmc+JztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzMnLFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGlwc19zZWxlY3QgPT0gJ25ldycgPyBnZXRIZWFkKFxcXCLmnIDmlrBcXFwiKSA6ICfmnIDmlrAnLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJyArIGlucHV0KS5sYXp5UnVsZSgoUEFHRSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCfkuLvpobXnsbvliKsnKSAhPSAnbmV3Jykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCfkuLvpobXnsbvliKsnLCAnbmV3Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSgn5Li76aG154Ot6ZeoJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIueDremXqFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ+S4u+mhteS4k+i+kScsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLkuJPovpFcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSgn5Li76aG15pyA5pawJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+KAmOKAmOKAmeKAmTxzdHJvbmc+PGZvbnQgY29sb3I9XFxcIiNGQTcyOThcXFwiPuacgOaWsDwvZnJvbnQ+PC9zdHJvbmc+J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNob3dMb2FkaW5nKCdMb2FkaW5nJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKCdlbmQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2V2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL+WIm+S9nOS6uuS9nOWTgeWIl+ihqFxcXCIpKS5ydWxlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscygn5Li76aG1Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2FkZEl0ZW1BZnRlcign5Li76aG15LiT6L6RJywgRCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKCfkuLvpobXkuJPovpEnLCBKU09OLnBhcnNlKGdldE15VmFyKCfkvZzlk4FuZXcnICsgaW5wdXQpKSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCBQQUdFKSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiAn5Li76aG15pyA5pawJ1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzMnLFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGlwc19zZWxlY3QgPT0gJ3ZpZXcnID8gZ2V0SGVhZChcXFwi54Ot6ZeoXFxcIikgOiAn54Ot6ZeoJyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycgKyBpbnB1dCkubGF6eVJ1bGUoKFBBR0UpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcign5Li76aG157G75YirJykgIT0gJ3ZpZXcnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+S4u+mhteexu+WIqycsICd2aWV3Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSgn5Li76aG15pyA5pawJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuacgOaWsFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKCfkuLvpobXkuJPovpEnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5LiT6L6RXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ+S4u+mhteeDremXqCcsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfigJjigJjigJnigJk8c3Ryb25nPjxmb250IGNvbG9yPVxcXCIjRkE3Mjk4XFxcIj7ng63pl6g8L2Zyb250Pjwvc3Ryb25nPidcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoJ2VuZCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZ2V0TXlWYXIoJ+S9nOWTgXZpZXcnICsgaW5wdXQpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNob3dMb2FkaW5nKCdMb2FkaW5nJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL+WIm+S9nOS6uuS9nOWTgeWIl+ihqFxcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKCfkuLvpobUnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKCfkuLvpobXkuJPovpEnLCBEKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoJ+S4u+mhtScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ+S4u+mhteS4k+i+kScsIEpTT04ucGFyc2UoZ2V0TXlWYXIoJ+S9nOWTgXZpZXcnICsgaW5wdXQpKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgUEFHRSksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogJ+S4u+mhteeDremXqCdcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8zJyxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpcHNfc2VsZWN0ID09ICdjb2xsZWN0aW9ucycgPyBnZXRIZWFkKFxcXCLkuJPovpFcXFwiKSA6ICfkuJPovpEnLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJyArIGlucHV0KS5sYXp5UnVsZSgoUEFHRSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCfkuLvpobXnsbvliKsnKSAhPSAnY29sbGVjdGlvbnMnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+S4u+mhteexu+WIqycsICdjb2xsZWN0aW9ucycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ+S4u+mhteeDremXqCcsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLng63pl6hcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSgn5Li76aG15pyA5pawJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuacgOaWsFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKCfkuLvpobXkuJPovpEnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCY4oCY4oCZ4oCZPHN0cm9uZz48Zm9udCBjb2xvcj1cXFwiI0ZBNzI5OFxcXCI+5LiT6L6RPC9mcm9udD48L3N0cm9uZz4nXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKCdlbmQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWdldE15VmFyKCfkuJPovpEnICsgaW5wdXQpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNob3dMb2FkaW5nKCdMb2FkaW5nJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL+WIm+S9nOS6uuS4k+i+keWIl+ihqFxcXCIpKS5ydWxlKVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoJ+S4u+mhtScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ+S4u+mhteS4k+i+kScsIEQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscygn5Li76aG1Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcign5Li76aG15LiT6L6RJywgSlNPTi5wYXJzZShnZXRNeVZhcign5LiT6L6RJyArIGlucHV0KSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIFBBR0UpLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6ICfkuLvpobXkuJPovpEnXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3BpY18xX2Z1bGwnLFxcbiAgICAgICAgICAgICAgICB0aXRsZTogJzAnLFxcbiAgICAgICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vd2Vpc3lyL2ltZy9Mb2FkaW5nMi5naWYnLFxcbiAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiAnbG9hZGluZydcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgLy8g5YiX6KGo6YOo5YiGXFxuICAgICAgICBpZiAoWyduZXcnLCAndmlldyddLmluY2x1ZGVzKHRpcHNfc2VsZWN0KSAmJiBQQUdFID4gMSkge1xcbiAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL+WIm+S9nOS6uuS9nOWTgeWIl+ihqFxcXCIpKS5ydWxlKVxcbiAgICAgICAgICAgIGQgPSBkLmNvbmNhdChEKVxcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHRpcHNfc2VsZWN0ID09ICdjb2xsZWN0aW9ucycgJiYgUEFHRSA+IDEpIHtcXG4gICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vcGFnZS/liJvkvZzkurrkuJPovpHliJfooahcXFwiKSkucnVsZSlcXG4gICAgICAgICAgICBkID0gZC5jb25jYXQoRClcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgICAgIGlmIChbJ25ldycsICd2aWV3J10uaW5jbHVkZXModGlwc19zZWxlY3QpICYmIFBBR0UgPT0gMSkge1xcbiAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9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BsaWtlID0gKGxpa2UgLyAxMDAwKS50b0ZpeGVkKDEpICsgJ2snO1xcbiAgICAgICAgaWYgKHZpZXcgPiAxMDAwMCkgdmlldyA9ICh2aWV3IC8gMTAwMDApLnRvRml4ZWQoMSkgKyAndyc7XFxuICAgICAgICAvL3ZhciBpbWcgPSBhcHBfY2FjaGUuY292ZXI7XFxuICAgICAgICB2YXIgaW1nID0gJChhcHBfY2FjaGUuY292ZXIpLmltYWdlKCgpID0+ICQucmVxdWlyZShcXFwiSW1nP3J1bGU9XFxcIiArIE1ZX1RJVExFKS5jb21wcmVzcygpKTtcXG4gICAgICAgIHZhciB0aXRsZSA9IGFwcF9jYWNoZS50aXRsZTtcXG4gICAgICAgIHZhciBwdWJsaXNoX3RpbWUgPSBhcHBfY2FjaGUucHVibGlzaF90aW1lO1xcbiAgICAgICAgLy8g5pe26Ze05oiz6L2s5bm05pyI5pelXFxuICAgICAgICBwdWJsaXNoX3RpbWUgPSB0aW1lc3RhbXBUb1RpbWUodG0gPSBwdWJsaXNoX3RpbWUsIHRzID0gMClcXG4gICAgICAgIEQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX2xlZnRfcGljJyxcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnSA8c21hbGw+PGZvbnQgY29sb3I9J2dyZXknPlxcXCIgKyBwdWJsaXNoX3RpbWUgKyAnXFxcXG4nICsgbGlrZSArICcg5Zac5qyiJyArICcgwrcgJyArIHZpZXcgKyAnIOingueciycgKyBcXFwiPC9mb250PiA8L3NtYWxsPlxcXCIsXFxuICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgdXJsOiAkKFBMQVlfTElOS1MpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+ivpue7huexu+WIqycsICfnroDku4snKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL+inhumikeivpuaDhemhtVxcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBjbHM6ICfkuLvpobUnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG59IGVsc2Uge1xcbiAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vcGFnZS9FTkRcXFwiKSkucnVsZSkoRClcXG59XFxuaWYoUEFHRSA9PSAxKSBwdXRNeVZhcign5L2c5ZOBJytnZXRNeVZhcihcXFwi5Li76aG157G75YirXFxcIiwgJ25ldycpK2lucHV0LCBKU09OLnN0cmluZ2lmeShEKSk7XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLliJvkvZzkurrkuJPovpHliJfooahcIixcInBhdGhcIjpcIuWIm+S9nOS6uuS4k+i+keWIl+ihqFwiLFwicnVsZVwiOlwidmFyIEQgPSBbXTtcXG52YXIgbGlzdF91cmwgPSBpbnB1dCArICcvY29sbGVjdGlvbnM/cGFnZT0nICsgUEFHRTtcXG52YXIgQVBQX0pTT04gPSBKU09OLnBhcnNlKHJlcXVlc3QobGlzdF91cmwpKS5kYXRhO1xcbnZhciB0b3RhbCA9IEFQUF9KU09OLnRvdGFsO1xcbkFQUF9KU09OID0gQVBQX0pTT04ubGlzdFxcbmlmICh0b3RhbCA9PSAnMCcgJiYgIFBBR0UgPT0gMSkge1xcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IDMwOyBpKyspIHtcXG4gICAgICAgIEQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2xzOiAn5Li76aG1JyxcXG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iAgICAgICAgICAgICAgICB2YXIgdXJsID0gQWxidW1fdXJsICsgUEFHRTtcXG4gICAgICAgICAgICAgICAgdmFyIEFQUF9KU09OID0gSlNPTi5wYXJzZShyZXF1ZXN0KHVybCkpLmRhdGEubGlzdDtcXG4gICAgICAgICAgICAgICAgaWYgKFBBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3BpY18xX2Z1bGwnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogYmdfaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcHV0X3RpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCI8c21hbGw+PGZvbnQgY29sb3I9J2dyZXknPlxcXCIgKyBkZXNjICsgXFxcIjwvZm9udD4gPC9zbWFsbD5cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKEFQUF9KU09OLmxlbmd0aCAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSBpbiBBUFBfSlNPTikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBQTEFZX0xJTktTID0gQVBQX0pTT05baV0udXJsLnJlcGxhY2UoL25ld3N0dWRpb3MvLCAnaHR0cHMnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBBUFBfSlNPTltpXS50aXRsZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgaW1nID0gQVBQX0pTT05baV0uY292ZXI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNhdCA9IEFQUF9KU09OW2ldLmNhdGVnb3JpZXM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNhdF9hbGwgPSBbXVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgaW4gY2F0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjYXRfMSA9IGNhdFtpXS5jYXRlZ29yeV9uYW1lO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2F0XzIgPSBjYXRbaV0uc3ViLmNhdGVnb3J5X25hbWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdF9hbGwucHVzaChcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdF8xICsgJy0nICsgY2F0XzIgKyAnIFxcdCdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXRfYWxsID0gY2F0X2FsbC5qb2luKFxcXCJcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjYXRfdGl0bGUgPSAn4oCc4oCc4oCd4oCdPHNtYWxsPjxmb250IGNvbG9yPWdyZXk+JyArIGNhdF9hbGwgKyAnPC9mb250Pjwvc21hbGw+JztcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfbGVmdF9waWMnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IGNhdF90aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChQTEFZX0xJTktTKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcign6K+m57uG57G75YirJywgJ+eugOS7iycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL+inhumikeivpuaDhemhtVxcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICAgICAgICAgIH0sIGJnX2ltZywgcHV0X3RpdGxlLCBkZXNjLCBBbGJ1bV91cmwpLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGNsczogJ+S4u+mhtScsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG59IGVsc2UgaWYgKHRvdGFsIT0gJzAnKXtcXG4gICAgZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcj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lO1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogQ0FURV9MRVZFTF8yID09IHRpdGxlID8gXFxcIuKAnOKAnFxcXCIgKyB0aXRsZSArIFxcXCLigJ3igJ1cXFwiIDogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgodGl0bGUsIGxpbmspID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKCdjYXRlXzInLCB0aXRsZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKCdjdXJyZW50X3VybCcsIFxcXCJodHRwczovL2FwcC54aW5waWFuY2hhbmcuY29tL2FydGljbGVzP2NhdGVnb3J5X2lkPVxcXCIgKyBsaW5rKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdGl0bGUsIGxpbmspXFxuICAgICAgICAgICAgICAgICAgICB9KVxcblxcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgfSlcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXG4gICAgICAgIH0pXFxuICAgIH1cXG4gICAgLy8gdmFyIEFQUF9VUkwgPScnO1xcbiAgICB2YXIgYXBwX2xpc3RzID0gQXBwX0pzb24ubGlzdDtcXG4gICAgZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL3BhZ2UvYXBw5YiG57G75LiO5pCc57Si5YiX6KGoXF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eGVkKDEpICsgJ2snO1xcbiAgICAgICAgLy8g5pS26JePXFxuICAgICAgICB2YXIgY29sbGVjdCA9IERBVEFfSlNPTi5jb3VudC5jb3VudF9jb2xsZWN0O1xcbiAgICAgICAgaWYgKGNvbGxlY3QgPiAxMDAwKSBjb2xsZWN0ID0gKGNvbGxlY3QgLyAxMDAwKS50b0ZpeGVkKDEpICsgJ2snO1xcbiAgICAgICAgLy8g5YiG5LqrXFxuICAgICAgICB2YXIgc2hhcmUgPSBEQVRBX0pTT04uY291bnQuY291bnRfc2hhcmU7XFxuICAgICAgICBpZiAoc2hhcmUgPiAxMDAwKSBzaGFyZSA9IChzaGFyZSAvIDEwMDApLnRvRml4ZWQoMSkgKyAnayc7XFxuICAgICAgICAvLyDmoIfnrb5baV0ubmFtZVxcbiAgICAgICAgdmFyIHRhZ3MgPSBEQVRBX0pTT04udGFncztcXG4gICAgICAgIC8vIOWIm+S9nOS6ui51cmwo5Li76aG1KS51c2VybmFtZSjlkI3lrZcpLmF2YXRhcijlkI3lrZcpXFxuICAgICAgICB2YXIgdXNlciA9IERBVEFfSlNPTi5hdXRob3IudXNlcmluZm87XFxuICAgICAgICBwdXRNeVZhcign5L2c6ICFJywgdXNlci51c2VybmFtZSk7XFxuICAgICAgICB2YXIgQ29sb3IgPSBcXFwiI0ZBNzI5OFxcXCI7XFxuXFxuICAgICAgICBmdW5jdGlvbiBnZXRIZWFkKHRpdGxlcykge1xcbiAgICAgICAgICAgIHJldHVybiAn4oCY4oCY4oCZ4oCZPHN0cm9uZz48Zm9udCBjb2xvcj1cXFwiJyArIENvbG9yICsgJ1xcXCI+JyArIHRpdGxlcyArICc8L2Zyb250Pjwvc3Ryb25nPic7XFxuICAgICAgICB9XFxuXFxuICAgICAgICBpZiAoUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdwaWNfMV9mdWxsJyxcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICcwJyxcXG4gICAgICAgICAgICAgICAgaW1nOiBiZ19pbWcsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnICsgaW5wdXQpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBldmFsKEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vcGFnZS9hcHDmkq3mlL7pk77mjqVcXFwiKSkucnVsZSk7XFxuICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IHRpdGxlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDEwOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiLFxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB2YXIg6K+E6K66dGlwcyA9ICfor4TorrogJyArICfigJjigJgnICsgdG90YWwgKyAn4oCZ4oCZJztcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMicsXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXBzX3NlbGVjdCA9PSAn566A5LuLJyA/IGdldEhlYWQoXFxcIueugOS7i1xcXCIpIDogJ+eugOS7iycsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnICsgaW5wdXQpLmxhenlSdWxlKChDb2xvciwg6K+E6K66dGlwcykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+mhteeggScsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoXFxcIuivpue7huexu+WIq1xcXCIpICE9ICfnroDku4snKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+ivpue7huexu+WIqycsICfnroDku4snKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKCfnroDku4snLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCY4oCY4oCZ4oCZPHN0cm9uZz48Zm9udCBjb2xvcj1cXFwiJyArIENvbG9yICsgJ1xcXCI+JyArICfnroDku4snICsgJzwvZnJvbnQ+PC9zdHJvbmc+J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ+ivhOiuuicraW5wdXQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IOivhOiuunRpcHNcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoJ+ivpuaDhemhtScraW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscygnZW5kJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKCfor4TorronK2lucHV0LCBKU09OLnBhcnNlKGdldE15VmFyKCfor6bmg4UnICsgZ2V0TXlWYXIoJ2NhY2hlJyArIGlucHV0KSkpKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIENvbG9yLCDor4Torrp0aXBzKSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiAn566A5LuLJ1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzInLFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGlwc19zZWxlY3QgPT0gJ+ivhOiuuicgPyBnZXRIZWFkKOivhOiuunRpcHMpIDog6K+E6K66dGlwcyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycgKyBpbnB1dCkubGF6eVJ1bGUoKENvbG9yLCDor4Torrp0aXBzLCBJRCwgUEFHRSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+ebuOS8vOinhumikScraW5wdXQsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoXFxcIuivpue7huexu+WIq1xcXCIpICE9ICfor4TorronKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+ivpue7huexu+WIqycsICfor4TorronKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoJ+ivpuaDhemhtScraW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKCdlbmQnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscygn55u45Ly85YiX6KGoJytpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWdldE15VmFyKCfor4TorronICsgZ2V0TXlWYXIoJ2NhY2hlJyArIGlucHV0KSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL3BhZ2Uv6KeG6aKR6K+E6K66XFxcIikpLnJ1bGUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcign6K+E6K66JytpbnB1dCwgRCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKCfor4TorronK2lucHV0LCBKU09OLnBhcnNlKGdldE15VmFyKCfor4TorronICsgZ2V0TXlWYXIoJ2NhY2hlJyArIGlucHV0KSkpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSgn566A5LuLJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIueugOS7i1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKCfor4TorronK2lucHV0LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCY4oCY4oCZ4oCZPHN0cm9uZz48Zm9udCBjb2xvcj1cXFwiJyArIENvbG9yICsgJ1xcXCI+JyArIOivhOiuunRpcHMgKyAnPC9mcm9udD48L3N0cm9uZz4nXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCBDb2xvciwg6K+E6K66dGlwcywgSUQsIFBBR0UpLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6ICfor4TorronK2lucHV0XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vcGFnZS/op4bpopHkv6Hmga9cXFwiKSkucnVsZSlcXG4gICAgICAgICAgICBpZiAodGlwc19zZWxlY3QgPT0gJ+eugOS7iycpIGQgPSBkLmNvbmNhdChEKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICh0aXBzX3NlbGVjdCA9PSAn6K+E6K66Jykge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OS8vCcgKyBnZXRNeVZhcignY2FjaGUnK2lucHV0KSkpKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcHV0TXlWYXIoJ+ebuOS8vOinhumikScraW5wdXQsICcxJyk7XFxuICAgICAgICAgICAgLy9wdXRNeVZhcign6K+m57uG57G75YirJywgJ+ebuOS8vOinhumikScpO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoJ+ebuOS8vOWIl+ihqCcraW5wdXQpO1xcbiAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscygnZW5kJyk7XFxuICAgICAgICAgICAgcHV0TXlWYXIoJ+ebuOS8vOinhumikScraW5wdXQsICcwJyk7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgIH0sUEFHRSksXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2UsXFxuICAgICAgICBjbHM6ICfor6bmg4XpobUnK2lucHV0LFxcbiAgICAgICAgaWQ6ICfnm7jkvLzop4bpopEnK2lucHV0XFxuICAgIH1cXG59KTtcXG5wdXRNeVZhcign6K+m5oOFJytnZXRNeVZhcignY2FjaGUnK2lucHV0KSwgSlNPTi5zdHJpbmdpZnkoRCkpXCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLop4bpopHor4TorrpcIixcInBhdGhcIjpcIuinhumikeivhOiuulwiLFwicnVsZVwiOlwidmFyIEQgPSBbXTtcXG52YXIgbXlQYWdlID1KU09OLnBhcnNlKGdldE15VmFyKCfpobXnoIEnLCcxJykpO1xcbmlmKFBBR0UgPiBteVBhZ2UgJiYgZ2V0TXlWYXIoXFxcIuivpue7huexu+WIq1xcXCIpID09ICfor4TorronKSB7XFxuICAgIG15UGFnZSsrO1xcbiAgICBwdXRNeVZhcign6aG156CBJyxKU09OLnN0cmluZ2lmeShteV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W50ZXJfMVxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZSxcXG4gICAgICAgICAgICBjbHM6ICfor6bmg4XpobUnK2lucHV0XFxuICAgICAgICB9XFxuICAgIH0pXFxufVxcbmlmIChjYWNoZV9qc29uLmxlbmd0aCA+IDApIHtcXG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjYWNoZV9qc29uLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICB2YXIgVVNFUl9IT01FID0gJ2h0dHBzOi8vYXBwLnhpbnBpYW5jaGFuZy5jb20vdXNlci8nICsgY2FjaGVfanNvbltpXS51c2VyaWQ7XFxuICAgICAgICB2YXIgdXNlcl9hdmF0YXIgPSBjYWNoZV9qc29uW2ldLnVzZXJJbmZvLmF2YXRhcjtcXG4gICAgICAgIHZhciB1c2VyX3VzZXJuYW1lID0gY2FjaGVfanNvbltpXS51c2VySW5mby51c2VybmFtZTtcXG4gICAgICAgIGlmIChnZXRNeVZhcign5L2c6ICFJykgPT0gdXNlcl91c2VybmFtZSkgdXNlcl91c2VybmFtZSA9ICc8Zm9udCBjb2xvcj0jZWQ5YTQxPicgKyB1c2VyX3VzZXJuYW1lICtcXG4gICAgICAgICAgICAnPC9mb250Pic7XFxuICAgICAgICAvLyDor4TorrrlhoXlrrlcXG4gICAgICAgIHZhciBjb250ZW50ID0gY2FjaGVfanNvbltpXS5jb250ZW50O1xcbiAgICAgICAgLy8g6K+E6K665pe26Ze0XFxuICAgICAgICB2YXIgYWRkdGltZSA9IGNhY2hlX2pzb25baV0uYWRkdGltZTtcXG4gICAgICAgIGFkZHRpbWUgPSB0aW1lc3RhbXBUb1RpbWUodG0gPSBhZGR0aW1lLCB0cyA9IDEpXFxuICAgICAgICAvLyDlm57lpI1cXG4gICAgICAgIGlmIChjYWNoZV9qc29uW2ldLnJlZmVyZXIpIHtcXG4gICAgICAgICAgICB2YXIgcmVfbmFtZSA9IGNhY2hlX2pzb25baV0ucmVmZXJlci51c2VySW5mby51c2VybmFtZTtcXG4gICAgICAgICAgICB2YXIgcmVfY29udGVudCA9IGNhY2hlX2pzb25baV0ucmVmZXJlci5jb250ZW50O1xcbiAgICAgICAgICAgIHZhciByZWZlcmVyID0gXFxcIjxibG9ja3F1b3RlPjxmb250IGNvbG9yPSdncmV5Jz5cXFwiICsgJzxjb2RlPicgKyByZV9uYW1lICsgJzwvY29kZT4nICsgJzxicj4nICtcXG4gICAgICAgICAgICAgICAgcmVfY29udGVudCArIFxcXCI8L2ZvbnQ+PC9ibG9ja3F1b3RlPlxcXCI7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHZhciByZWZlcmVyID0gXFxcIlxcXCJcXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMTA7IGkrKykge1xcbiAgICAgICAgICAgIEQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgY2xzOiAn6K+m5oOF6aG1JytpbnB1dFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIEQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHVzZXJfdXNlcm5hbWUgKyBcXFwiPHNtYWxsPjxmb250IGNvbG9yPSdncmV5Jz5cXFwiICsgJ1xcXFx0XFxcXHQnICsgYWRkdGltZSArXFxuICAgICAgICAgICAgICAgIFxcXCI8L2ZvbnQ+PC9zbWFsbD5cXFwiLFxcbiAgICAgICAgICAgIGltZzogdXNlcl9hdmF0YXIgKyAnQFJlZmVyZXI9JyArIHVzZXJfYXZhdGFyLFxcbiAgICAgICAgICAgIHVybDogJChVU0VSX0hPTUUpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL+WIm+S9nOS6uummlumhtVxcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2xzOiAn6K+m5oOF6aG1JytpbnB1dFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgRC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogcmVmZXJlciArIFxcXCI8Zm9udCBjb2xvcj0nMDAwJz5cXFwiICsgJ1xcXFx0XFxcXHRcXFxcdFxcXFx0XFxcXHQnICsgY29udGVudCArIFxcXCI8L2ZvbnQ+XFxcIixcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCcsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2xzOiAn6K+m5oOF6aG1JytpbnB1dFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgICAgICBELnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZScsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2xzOiAn6K+m5oOF6aG1JytpbnB1dFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIEQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJyxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgY2xzOiAn6K+m5oOF6aG1JytpbnB1dCxcXG4gICAgICAgICAgICBpZDogJ+e7k+adn+ivhOiuuidcXG4gICAgICAgIH1cXG4gICAgfSk7XFxufSBlbHNlIGlmKHRvdGFsIT0gM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tcXG4gICAgICAgIGlmIChuZXh0X2xpa2UgPiAxMDAwKSBuZXh0X2xpa2UgPSAobmV4dF9saWtlIC8gMTAwMClcXG4gICAgICAgICAgICAudG9GaXhlZCgxKSArICdrJztcXG4gICAgICAgIHZhciBuZXh0X3VzZXIgPSBORVhUX0pTT05baV0uZGF0YS5hdXRob3IudXNlcmluZm8udXNlcm5hbWU7XFxuICAgICAgICBsZXQgY2FjaGVfbGluayA9IGlucHV0O1xcbiAgICAgICAgRC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfbGVmdF9waWMnLFxcbiAgICAgICAgICAgIHRpdGxlOiBuZXh0X3RpdGxlLFxcbiAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ0gPHNtYWxsPjxmb250IGNvbG9yPSdncmV5Jz5cXFwiICsgJ+aSreaUvumHjyAnICsgbmV4dF92aWV3ICsgJyDCtyDllpzmrKIgJyArIG5leHRfbGlrZSArICdcXFxcbicgKyBuZXh0X3VzZXIgKyBcXFwiPC9mb250PiA8L3NtYWxsPlxcXCIsXFxuICAgICAgICAgICAgaW1nOiBuZXh0X2NvdmVyLFxcbiAgICAgICAgICAgIHVybDogJChQTEFZX0xJTktTKS5sYXp5UnVsZSgoY2FjaGVfbGluaykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcign6K+E6K66JyArIGdldE15VmFyKCdjYWNoZScrY2FjaGVfbGluaykpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+ivpue7huexu+WIqycsICfnroDku4snKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vcHV0TXlWYXIoJ+ebuOS8vOinhumikScsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL3BhZ2Uv6KeG6aKR6K+m5oOF6aG1XFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgICAg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dGl0bGUgPSBhcHBfY2FjaGUudGl0bGU7XFxuICAgICAgICAgICAgdmFyIHB1Ymxpc2hfdGltZSA9IGFwcF9jYWNoZS5wdWJsaXNoX3RpbWU7XFxuICAgICAgICAgICAgLy8g5pe26Ze05oiz6L2s5bm05pyI5pelXFxuICAgICAgICAgICAgcHVibGlzaF90aW1lID0gdGltZXN0YW1wVG9UaW1lKHRtID0gcHVibGlzaF90aW1lLCB0cyA9IDApXFxuICAgICAgICAgICAgQXJyID0ge1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfbGVmdF9waWMnLFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ0gPHNtYWxsPjxmb250IGNvbG9yPSdncmV5Jz5cXFwiICsgcHVibGlzaF90aW1lICsgJ1xcXFxuJyArIGxpa2UgKyAnIOWWnOasoicgKyAnIMK3ICcgKyB2aWV3ICsgJyDop4LnnIsnICsgXFxcIjwvZm9udD4gPC9zbWFsbD5cXFwiLFxcbiAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFBMQVlfTElOS1MpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCfor6bnu4bnsbvliKsnLCAn566A5LuLJyk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL3BhZ2Uv6KeG6aKR6K+m5oOF6aG1XFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsczogJ+S4u+mhtSdcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgRC5wdXNoKEFycik7XFxuICAgICAgICB9XFx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