xiaomianao666

小程序:APP影视(P)

Jun 2nd, 2023
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@APP影视(P)@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6ImpzOlxuZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvY2hhcHRlcicsIHt9KSkucnVsZSk7IiwidGl0bGUiOiJBUFDlvbHop4YoUCkiLCJhdXRob3IiOiLpppnpm4Xmg4UiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IiwidmVyc2lvbiI6MTgsImNvbF90eXBlIjoibW92aWVfMyIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoiYWxsIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG52YXIgaXRlbXMgPSBbXTtcbnZhciBzZWxmID0gSlNPTi5wYXJzZShnZXRSdWxlKCkpLnRpdGxlO1xudmFyIHNldGpzb24gPSBKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL2ZpbGVzL3J1bGVzL3h5cS9hcHBtc2V0Lmpzb24nLCB7fSkpO1xudmFyIHNzbWQgPSBzZXRqc29uLnNzbW9kZTtcbnZhciBzc3hjID0gc2V0anNvbi5zc2NvdW50O1xudmFyIGxvY3ZlciA9IE1ZX1JVTEUudmVyc2lvbjtcblxuaXRlbXMucHVzaCh7XG4gICAgdGl0bGU6ICfwn5SN6K6+572uJyArICcoJyArIChzc21kID09IDEgPyAn6IGaJyArIHNzeGMgOiAn5YiXJykgKyAnKScsXG4gICAgLy90aXRsZSA6ICfwn5SN6K6+572uJysnKCcrc3N4YysnKScsXG4gICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vUmVjb3JkS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biAgICAgICAgICAgIHZhciB1cmxvID0gSlNPTi5wYXJzZShyZXF1ZXN0KGxpbnQsIHt9KSk7XG4gICAgICAgICAgICB2YXIgdXJsdCA9IEpTT04ucGFyc2UoZmV0Y2gobGludC5yZXBsYWNlKCd0eXBlPTAnLCAndHlwZT0xJyksIHt9KSk7XG4gICAgICAgIH1cbiAgICAgICAgLy9sb2codXJsbyk7XG4gICAgICAgIGlmICh1cmxvLnJlc291cmNlcy5sZW5ndGggPCAxICYmIHVybHQucmVzb3VyY2VzLmxlbmd0aCA8IDEpIHtcbiAgICAgICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICAgICAgdGl0bGU6ICflvZPliY3lhbPplK7lrZcgICcgKyBnZXRWYXIoJ3h5cWFwcHlzdGV4dCcpICsgJyAg5peg5pCc57Si57uT5p6cJyxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodXJsby5yZXNvdXJjZXMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KZpeW9k+WJjeesrCcgKyBwbiArICfpobUnLFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHVybG8ucmVzb3VyY2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gdXJsby5yZXNvdXJjZXNbaV0udGV4dC5yZXBsYWNlKC9cXDwuKj9cXD4vZywgJycpO1xuICAgICAgICAgICAgICAgIHZhciB1cmwgPSB1cmxvLnJlc291cmNlc1tpXS51cmw7XG4gICAgICAgICAgICAgICAgdmFyIGRlc2MgPSB1cmxvLnJlc291cmNlc1tpXS53ZWJzaXRlO1xuICAgICAgICAgICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZS5yZXBsYWNlKGdldFZhcigneHlxYXBweXN0ZXh0JyksICfigJzigJwnICsgZ2V0VmFyKCd4eXFhcHB5c3RleHQnKSArICfigJ3igJ0nKSArICcgICcgKyBkZXNjICsgJyAg5Zyo57q/JyxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmwsXG4gICAgICAgICAgICAgICAgICAgIC8vZGVzYzogJ+WcqOe6v+aQnOe0oue7k+aenCcsXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJ1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHVybHQucmVzb3VyY2VzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgdXJsdC5yZXNvdXJjZXMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSB1cmx0LnJlc291cmNlc1tqXS50ZXh0LnJlcGxhY2UoL1xcPC4qP1xcPi9nLCAnJyk7XG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IHVybHQucmVzb3VyY2VzW2pdLnVybDtcbiAgICAgICAgICAgICAgICB2YXIgZGVzYyA9IHVybHQucmVzb3VyY2VzW2pdLndlYnNpdGU7XG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLnJlcGxhY2UoZ2V0VmFyKCd4eXFhcHB5c3RleHQnKSwgJ+KAnOKAnCcgKyBnZXRWYXIoJ3h5cWFwcHlzdGV4dCcpICsgJ+KAneKAnScpICsgJyAgJyArIGRlc2MgKyAnICDkuIvovb0nLFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCxcbiAgICAgICAgICAgICAgICAgICAgLy9kZXNjOiAn5LiL6L295pCc57Si57uT5p6cJ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zdCh0dXJsKSkge1xuICAgIHZhciBwZyA9IE1ZX1VSTC5tYXRjaCgvcGFnZVxcPShbXFxkXSopLylbMV07XG4gICAgaWYgKHBnID09IDEpIHtcbiAgICAgICAgLy92YXIgdHlwdCA9ICgn55S15b2xJui/nue7reWJpybnu7zoibom5Yqo5ryrJykuc3BsaXQoJyYnKTtcbiAgICAgICAgLy92YXIgdHlwbCA9ICgnbW92aWUmdHZwbGF5JnR2c2hvdyZjb21pYycpLnNwbGl0KCcmJyk7XG4gICAgICAgIHZhciB0eXBsID0gT2JqZWN0LmtleXMoSlNPTi5wYXJzZShmZXRjaChtdXJsICsgJz9hYz1mbGl0dGVyJywge30pKSk7XG5cbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0eXBsLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICB2YXIgdHl1cmwgPSBtdXJsICsgJz9hYz1saXN0JmNsYXNzPScgKyB0eXBsW2ldICsgJyZwYWdlPWZ5cGFnZSZhcmVhPSZ0eXBlPSZzdGFydD0nO1xuICAgICAgICAgICAgaXRlbXMucHVzaCh7XG4gICAgICAgICAgICAgICAgdGl0bGU6IHR5cGxbaV0sXG4gICAgICAgICAgICAgICAgdXJsOiAkKHR5dXJsKS5ydWxlKChtdXJsKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSB7fTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGl0ZW1zID0gW107XG4gICAgICAgICAgICAgICAgICAgIHZhciBtdXJsID0gbXVybDtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBKU09OLnBhcnNlKGdldFJlc0NvZGUoKSk7XG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL3R2bGlzdGRhdGEnLCB7fSkpLnJ1bGUpO1xuICAgICAgICAgICAgICAgICAgICByZXMuZGF0YSA9IGl0ZW1zO1xuICAgICAgICAgICAgICAgICAgICBzZXRIb21lUmVzdWx0KHJlcyk7XG4gICAgICAgICAgICAgICAgfSwgbXVybCksXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbidcbiAgICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICAgICAgaXRlbXMucHVzaCh7XG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHRyeSB7XG4gICAgICAgIHZhciBodG1sID0gSlNPTi5wYXJzZShmZXRjaCh0dXJsKSk7XG4gICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL3R2bGlzdGRhdGEnLCB7fSkpLnJ1bGUpO1xuICAgIH0gY2F0Y2ggKGUpIHt9XG59IGVsc2Uge1xuICAgIGlmICgvZGlqaWF4aWEvLnRlc3QobXVybCkpIHtcbiAgICAgICAgbXVybCA9ICdodHRwOi8vd3d3LmRpamlheGlhLmNvbS9hcGkucGhwL2FwcC8nXG4gICAgfVxuICAgIHRyeSB7XG4gICAgICAgIGlmIChtdXJsLnNlYXJjaCgvYXBpLnBocFxcL2FwcC8pICE9IC0xKSB7XG5cbiAgICAgICAgICAgIHZhciB0eXBjb2RlID0gcmVxdWVzdChtdXJsICsgXCJuYXY/dG9rZW49XCIsIHtcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XG4gICAgICAgICAgICAgICAgICAgIFwiVXNlci1BZ2VudFwiOiBcIkRhcnQvMi4xNCAoZGFydDppbylcIlxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgaWYgKHR5cGNvZGUuaW5kZXhPZign5qOA5rWL5LitJykgIT0gLTEpIHtcbiAgICAgICAgICAgICAgICB0eXBjb2RlID0gZmV0Y2gobXVybCArIFwibmF2P3Rva2VuPVwiICsgJyZidHdhZicgKyB0eXBjb2RlLm1hdGNoKC9idHdhZiguKj8pXFxcIi8pWzFdLCB7fSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgdHlwZWMgPSBKU09OLnBhcnNlKHR5cGNvZGUpLmxpc3Q7XG5cbiAgICAgICAgfSBlbHNlIGlmIChtdXJsLnNlYXJjaCgveGdhcHAucGhwXFwvdjEvKSAhPSAtMSkge1xuXG4gICAgICAgICAgICB2YXIgdHlwY29kZSA9IHJlcXVlc3QobXVybCArIFwibmF2P3Rva2VuPVwiLCB7XG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgICAgICBcIlVzZXItQWdlbnRcIjogXCJEYXJ0LzIuMTQgKGRhcnQ6aW8pXCJcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlmICh0eXBjb2RlLmluZGV4T2YoJ+ajgOa1i+S4rScpICE9IC0xKSB7XG4gICAgICAgICAgICAgICAgdHlwY29kZSA9IGZldGNoKG11cmwgKyBcIm5hdj90b2tlbj1cIiArICcmYnR3YWYnICsgdHlwY29kZS5tYXRjaCgvYnR3YWYoLio/KVxcXCIvKVsxXSwge30pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHR5cGVjID0gSlNPTi5wYXJzZSh0eXBjb2RlKS5kYXRhO1xuXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAobXVybC5zZWFyY2goL21vZ2FpX2FwaS8pICE9IC0xKSB7XG4gICAgICAgICAgICAgICAgdmFyIHR5cGNvZGUgPSByZXF1ZXN0KG11cmwgKyBcIi90eXBlc1wiLCB7XG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIFwiVXNlci1BZ2VudFwiOiBcIkRhcnQvMi4xNCAoZGFydDppbylcIlxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhciB0eXBjb2RlID0gcmVxdWVzdChtdXJsICsgXCIvdHlwZXNcIiwge1xuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBcIlVzZXItQWdlbnRcIjogXCJva2h0dHAvNC4xLjBcIlxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodHlwY29kZS5pbmRleE9mKCfmo4DmtYvkuK0nKSAhPSAtMSkge1xuICAgICAgICAgICAgICAgIHR5cGNvZGUgPSBmZXRjaChtdXJsICsgXCIvdHlwZXNcIiArICc/YnR3YWYnICsgdHlwY29kZS5tYXRjaCgvYnR3YWYoLio/KVxcXCIvKVsxXSwge30pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHR5cGVjID0gSlNPTi5wYXJzZSh0eXBjb2RlKS5kYXRhLmxpc3Q7XG5cbiAgICAgICAgfVxuICAgICAgICB2YXIgdHlwZXQgPSBcIlwiLFxuICAgICAgICAgICAgdHlwZWwgPSBcIlwiO1xuICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IHR5cGVjLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICB0eXBldCArPSB0eXBlY1tqXS50eXBlX25hbWU7XG4gICAgICAgICAgICB0eXBlbCArPSB0eXBlY1tqXS50eXBlX2lkO1xuICAgICAgICAgICAgaWYgKGogPCB0eXBlYy5sZW5ndGggLSAxKSB7XG4gICAgICAgICAgICAgICAgdHlwZXQgKz0gXCImXCI7XG4gICAgICAgICAgICAgICAgdHlwZWwgKz0gXCImXCI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdmFyIHR5cHQgPSB0eXBldC5zcGxpdCgnJicpO1xuICAgICAgICB2YXIgdHlwbCA9IHR5cGVsLnNwbGl0KCcmJyk7XG5cbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0eXB0Lmxlbmd0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gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc2NvZGUgPSBmZXRjaChNWV9VUkwgKyAnJmJ0d2FmJyArIHJlc2NvZGUubWF0Y2goL2J0d2FmKC4qPylcXFwiLylbMV0sIHt9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB2YXIgaHRtbCA9IEpTT04ucGFyc2UocmVzY29kZSk7XG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2FwcGxpc3RkYXRhJywge30pKS5ydWxlKTtcblxuICAgICAgICAgICAgICAgICAgICByZXMuZGF0YSA9IGl0ZW1zO1xuICAgICAgICAgICAgICAgICAgICBzZXRIb21lUmVzdWx0KHJlcyk7XG4gICAgICAgICAgICAgICAgfSwgbXVybCksXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbidcbiAgICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICAgICAgaXRlbXMucHVzaCh7XG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXG4gICAgICAgIH0pO1xuICAgIH0gY2F0Y2ggKGUpIHt9XG5cblxuICAgIHRyeSB7XG4gICAgICAgIGlmIChtdXJsLnNlYXJjaCgvbW9nYWlfYXBpLykgIT0gLTEpIHtcbiAgICAgICAgICAgIHZhciBodG1sID0gcmVxdWVzdCh0dXJsLCB7XG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgICAgICBcIlVzZXItQWdlbnRcIjogXCJEYXJ0LzIuMTQgKGRhcnQ6aW8pXCJcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciBodG1sID0gcmVxdWVzdCh0dXJsLCB7XG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgICAgICBcIlVzZXItQ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xpdGl0ID0gbGlzdFtqXS5tdXJsO1xcbiAgICAgICAgICAgIGlmICgvXFxcXC92b2RcXFxcLy8udGVzdChsaW5rKSkge1xcbiAgICAgICAgICAgICAgICBpZiAoLzM3XFxcXC4xNjF8MjE2XFxcXC45OHxwaG9lYmV8aGZ5czh8ZmVpZmFuMTJ8dHZ6eXxoZHlhbmd0dnx0a3lzfHRlZ291eXMvLnRlc3QobGluaykpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnP2FjPWxpc3Qmem09JyArIGtleSArICcmcGFnZT1meXBhZ2UnO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGhtdXJsID0gbGluayArICc/YWM9bGlzdCZ3ZD0nICsga2V5ICsgJyZwYWdlPWZ5cGFnZSc7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBpZiAoL2RpamlheGlhLy50ZXN0KGxpbmspKSB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5rID0gJ2h0dHA6Ly93d3cuZGlqaWF4aWEuY29tL2FwaS5waHAvYXBwLydcXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgaWYgKGxpbmsuaW5kZXhPZignYXBpLnBocC9hcHAvJykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnc2VhcmNoP3BnPWZ5cGFnZSZ0ZXh0PScgKyBrZXkgKyAnJnRva2VuPSc7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobGluay5pbmRleE9mKCd4Z2FwcC5waHAvdjEvJykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnc2VhcmNoP3BnPWZ5cGFnZSZ0ZXh0PScgKyBrZXk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoL2lvcGVueXVuLy50ZXN0KGxpbmspKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhtdXJsID0gbGluayArICcvbGlzdD9wYWdlPWZ5cGFnZSZsaW1pdD0xMCZ3ZD0nICsga2V5O1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJz9wYWdlPWZ5cGFnZSZsaW1pdD0xMCZ3ZD0nICsga2V5O1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogbGlzdFtqXS50aXRsZSxcXG4gICAgICAgICAgICAgICAgaW1nOiBsaXN0W2pdLmltZyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I3gjJyArIGhtdXJsICsgJyN4IycgKyBsaW5rICsgJyN4IycgKyBsaXRpdCArICcjeCMnICsga2V5ICsgJyN4IycpLnJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2Uvc2VhcmVyaicpO1xcbiAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdpY29uX3JvdW5kX3NtYWxsXzQnXFxuICAgICAgICAgICAgICAgIC8vY29sX3R5cGU6ICd0ZXh0XzMnXFxuICAgICAgICAgICAgICAgIC8vbGluazpsaW5rLFxcbiAgICAgICAgICAgICAgICAvL3R5cGU6IGlcXG4gICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgIH0gLy9mb3IgalxcblxcblxcbiAgICB9IC8vZm9yIGlcXG5cXG59IC8vZW5kIG1vZGUgMFxcblxcblxcbnJlcy5kYXRhID0gaXRlbXM7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i53a2ZpbGUuY29tL2FwaS5waHAvYXBwL3ZpZGVvX2RldGFpbD9pZD0nICsgdXJsICsgJyZ0b2tlbj07Z2V0O3V0Zi04O3tVc2VyLUFnZW50QERhcnQvMi4xNCAoZGFydDppbyl9JztcXG4gICAgfSBlbHNlIGlmICgvaW9wZW55dW4vLnRlc3QobXVybCkpIHtcXG4gICAgICAgIHZhciBsaW5rID0gbXVybCArICcvZGV0YWlsSUQ/dm9kX2lkPScgKyB1cmwgKyAnJnJlbF9saW1pdD0xMDtnZXQ7dXRmLTg7e1VzZXItQWdlbnRARGFydC8yLjE0IChkYXJ0OmlvKX0nO1xcbiAgICB9IGVsc2UgaWYgKC9kaWppYXhpYS8udGVzdChtdXJsKSkge1xcbiAgICAgICAgdmFyIGxpbmsgPSAnaHR0cDovL3d3dy5kaWppYXhpYS5jb20vYXBpLnBocC9hcHAvdmlkZW9fZGV0YWlsP2lkPScgKyB1cmw7XFxuICAgIH1cXG4gICAgaXRlbXMucHVzaCh7XFxuICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICBwaWNfdXJsOiBpbWcgKyAnQFJlZmVyZXI9JyxcXG4gICAgICAgIHVybDogJChsaW5rKS5ydWxlKCgpID0+IHtcXG4gICAgICAgICAgICB2YXIgcmVzID0ge307XFxuICAgICAgICAgICAgdmFyIGl0ZW1zID0gW107XFxuICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAnJyxcXG4gICAgICAgICAgICAgICAgZGVzYzogJzI1NSYmZmxvYXQnLFxcbiAgICAgICAgICAgICAgICB1cmw6ICcnLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3g1X3dlYnZpZXdfc2luZ2xlJ1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJlZnJlc2hYNVdlYlZpZXcoJycpO1xcbiAgICAgICAgICAgIHZhciBodG1sID0gSlNPTi5wYXJzZShnZXRSZXNDb2RlKCkpO1xc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UoKCkgPT4ge1xcbiAgICAgICAgICAgIHZhciByZXMgPSB7fTtcXG4gICAgICAgICAgICB2YXIgaXRlbXMgPSBbXTtcXG4gICAgICAgICAgICB2YXIgaHRtbCA9IEpTT04ucGFyc2UoZ2V0UmVzQ29kZSgpKTtcXG4gICAgICAgICAgICB2YXIgbXl1cmwgPSBNWV9VUkwubWF0Y2goLyhbXFxcXFNdKj86XFxcXC9cXFxcL1tcXFxcU10qPylcXFxcLy8pWzFdO1xcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJycsXFxuICAgICAgICAgICAgICAgIGRlc2M6ICcyNTUmJmZsb2F0JyxcXG4gICAgICAgICAgICAgICAgdXJsOiAnJyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd4NV93ZWJ2aWV3X3NpbmdsZSdcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZWZyZXNoWDVXZWJWaWV3KCcnKTtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL3R2bW92bGlzdCcsIHt9KSkucnVsZSk7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICByZXMuZGF0YSA9IGl0ZW1zO1xcbiAgICAgICAgICAgIHNldEhvbWVSZXN1bHQocmVzKTtcXG4gICAgICAgIH0pLFxcbiAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgIGNvbF90eXBlOiAnbW92aWVfM19tYXJxdWVlJ1xcbiAgICB9KTtcXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCJBUFDnroDku4vkuI7pgInpm4ZcIixcInBhdGhcIjpcImFwcG1vdmxpc3RcIixcInJ1bGVcIjpcImlmIChodG1sLmRhdGEudm9kX3VybF93aXRoX3BsYXllcikge1xcbiAgICB2YXIgY29udHM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cpXS5wbGF5ZXJfaW5mby5wYXJzZSAmJiAoY29udHNbZ2V0TXlWYXIodGl0bGUsICcwJyldLnBsYXllcl9pbmZvLnBhcnNlKS5pbmRleE9mKFxcXCI9XFxcIikgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGppZWsgPSAoY29udHNbZ2V0TXlWYXIodGl0bGUsICcwJyldLnBsYXllcl9pbmZvLnBhcnNlKS5yZXBsYWNlKC9cXFxcLlxcXFwuL2csIFxcXCIuXFxcIikuc3BsaXQoJywnKVswXTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB2YXIgamllayA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAvL3NldEVycm9yKGppZWspOyAgICAgICAgICAgICAgICBcXG4gICAgICAgIH1cXG4gICAgfSBjYXRjaCAoZSkge31cXG4gICAgLy9qaWVr5ou85o6lXFxuICAgIGlmIChqaWVrICE9ICcnICYmIGppZWsgIT0gbnVsbCkge1xcbiAgICAgICAgaWYgKGppZWsuc3Vic3RyaW5nKDAsIDQpID09ICdodHRwJykge1xcbiAgICAgICAgICAgIGppZWsgPSBqaWVrO1xcbiAgICAgICAgfSBlbHNlIGlmIChqaWVrLnN1YnN0cmluZygwLCAyKSA9PSAnXFxcXC9cXFxcLycpIHtcXG4gICAgICAgICAgICBqaWVrID0gJ2h0dHBzOicgKyBqaWVrO1xcbiAgICAgICAgfVxcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgamllayA9IFxcXCJcXFwiO1xcbiAgICB9XFxuICAgIC8v5a+55aSx5pWI5o6l5Y+j6L+b6KGM5pu/5o2iXFxuICAgIGlmICgvY29rZW12Ly50ZXN0KG15dXJsKSAmJiAvY29rZXFpZXx4aW58OTBtbS8udGVzdChwdGFiKSkge1xcbiAgICAgICAgamllayA9ICdodHRwczovL3BsYXllci45MG1tLm1lL3BsYXkucGhwP3VybD0nO1xcbiAgICB9IGVsc2UgaWYgK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ICAgamllayA9ICdodHRwczovL3d3dy5mdW40ay5jb20vYXBsYXllci8/dXJsPSc7XFxuICAgIH0gZWxzZSBpZiAoL2poeXVuXFxcXC5waHAvLnRlc3QoamllaykpIHtcXG4gICAgICAgIGppZWsgPSBqaWVrLnJlcGxhY2UoJ2h0dHA6Ly9zdmlwLmpoeXVuLmp4LmNuOjEyMzQvamh5dW4ucGhwP3VybD0nLCAnaHR0cHM6Ly9hcGkuamhkeXcudmlwLz91cmw9Jyk7XFxuICAgIH0gZWxzZSBpZiAoL3d3d1xcXFwuYWlsZW1vXFxcXC5tZS8udGVzdChqaWVrKSkge1xcbiAgICAgICAgamllayA9IGppZWsucmVwbGFjZSgnYWlsZW1vJywgJ2FpbGVtb28nKTtcXG4gICAgfTtcXG4gICAgLy/miZPljbDmjqXlj6NcXG4gICAgdHJ5IHtcXG4gICAgICAgIGlmIChqID09ICcwJykge1xcbiAgICAgICAgICAgIGlmIChodG1sLmRhdGEudm9kX3VybF93aXRoX3BsYXllcikge1xcbiAgICAgICAgICAgICAgICBsb2coJ1xcXFxu57q/6Lev77yaJyArIHB0YWIgKyAnXFxcXG7op4bpopHvvJonICsgdmxpbmsgKyAnXFxcXG4nICsgJ+ino+aekOaOpeWPo++8mlxcXFxuJyArIGppZWspO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaHRtbC5kYXRhLnZvZF9pbmZvICYmIGh0bWwuZGF0YS52b2RfaW5mby52b2RfdXJsX3dpdGhfcGxheWVyKSB7XFxuICAgICAgICAgICAgICAgIGxvZygnXFxcXG7nur/ot6/vvJonICsgcHRhYiArICdcXFxcbuinhumike+8micgKyB2bGluayArICdcXFxcbicgKyAn6Kej5p6Q5o6l5Y+j77yaXFxcXG4nICsgamllayk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKGNvbnRzW2dldE15VmFyKHRpdGxlLCAnMCcpXS5wbGF5ZXJfaW5mby5wYXJzZTIgJiYgKGNvbnRzW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ICAgICAgIGlmIChyZXN1cmwubWF0Y2goL3lvdWt1fG1ndHZ8aXhpZ3VhfHFxLmNvbXxxaXlpfG1pZ3V8YmlsaWJpbGl8c29odXxwcHR2fGxlfDE5MDUuY29tLykgJiYgcmVzdXJsLnNlYXJjaCgvaHRtbHxiaWxpYmlsaXxpeGlndWEvKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vaHRtbOe9kemhteiwg+eUqOaWreaPkuino+aekFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbkRuID0gSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9maWxlcy9ydWxlcy94eXEvYXBwbXNldC5qc29uJywge30pKS5lbkRuO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbkRuID09ICcxJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coJ+iwg+eUqOaWreaPkuino+aekGh0bWwnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChcXFwidmFyIGNvbmZpZyA9XFxcIiArIGZldGNoKFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL015UGFyc2VTZXQuanNvblxcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChjb25maWcuY2opKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF5dG1QYXJzZShyZXN1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvXFxcXC5tM3U4fFxcXFwubXA0fG9ialxcXFwvdG9zfG5ldGVhc2VcXFxcLmNvbS8udGVzdChyZXN1cmwpICYmIC9odHRwLy50ZXN0KHJlc3VybCkgJiYgIS9cXFxcLmh0bWx8XFxcXC5tM3U4XFxcXC50di8udGVzdChyZXN1cmwpICYmICEvXFxcXD1odHRwLy50ZXN0KHJlc3VybCkgJiYgcHRhYiAhPSAnZHVvZHVvenknKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKC93a2ZpbGUvLnRlc3QocmVzdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdXJsICsgJzt7UmVmZXJlckBodHRwczovL2ZhbnR1YW4ud2tmaWxlLmNvbS99J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAvXFxcXD1odC8udGVzdChyZXN1cmwpID8gcmVzdXJsLnN1YnN0cmluZyhyZXN1cmwuaW5kZXhPZignPWh0JykgKyAxKSA6IHJlc3VybCArICcjaXNWaWRlbz10cnVlIyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL+iwg+eUqOaWreaPkumAmueUqOWHveaVsOino+aekFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbkRuID0gSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9maWxlcy9ydWxlcy94eXEvYXBwbXNldC5qc29uJywge30pKS5lbkRuO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbkRuID09ICcxJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coJ+iwg+eUqOaWreaPkumAmueUqOWHveaVsOino+aekFxcXFxuJyArIHB0YWIgKyAnKOmAmueUqOWHveaVsCknKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChcXFwidmFyIGNvbmZpZyA9XFxcIiArIGZldGNoKFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL015UGFyc2VTZXQuanNvblxcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChjb25maWcuY2opKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG5hbWUgPSBwdGFiICsgJyjpgJrnlKjlh73mlbApJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBhcnNlU1tuYW1lXShyZXN1cmwsIG15dXJsKTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHB0YWIgPT0gJ2RkenknKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGdldHJhbmRvbSh1cmxzdHIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJhbmRTdHIgPSB1cmxzdHIuc3Vic3RyaW5nKDAsIDgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyaW5nID0gdXJsc3RyLnN1YnN0cmluZyg4LCB1cmxzdHIubGVuZ3RoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YnN0ciA9IGJhc2U2NERlY29kZShzdHJpbmcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN1YnN0ci5zdWJzdHJpbmcoOCwgc3Vic3RyLmxlbmd0aCAtIDgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIganhodG1sID0gcmVxdWVzdChcXFwiaHR0cHM6Ly9wbGF5LnN1b3lvdS5jYy94cGxheS8/dXJsPVxcXCIgKyB2bGluaywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJSZWZlcmVyXFxcIjogXFxcImh0dHBzOi8vd3d3Lmp1YmFpYmFpLmNjL1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoanhodG1sLm1hdGNoKC92YXIgY29uZmlnW1xcXFxzXFxcXFNdKj99LylbMF0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGR3eSA9IHBvc3QoXFxcImh0dHBzOi8vcGxheS5zdW95b3UuY2MveHBsYXkvaGQwTDNUakg0bTh6U0sxTi5qcGdcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUFcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IGNvbmZpZy51cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInZrZXlcXFwiOiBjb25maWcudmtleSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidG9rZW5cXFwiOiBjb25maWcudG9rZW5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBnZXRyYW5kb20oSlNPTi5wYXJzZShkZHd5KS51cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL21pYW9wYXJ0eS8udGVzdChwdGFiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXF1aXJlQ2FjaGUoJ2h0dHBzOi8vYWdpdC5haS9semsyMzU1OS9QdWJsaWNSdWxlL3Jhdy9icmFuY2gvbWFzdGVyL3g1cnVsZS5qcycsIDI0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHg1cnVsZSgnaHR0cHM6Ly93d3cuZnVuNGsuY29tL2FwbGF5ZXIvP3VybD0nICsgcmVzdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfTtcXG5cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIC8qXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbkRuID0gSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9maWxlcy9ydWxlcy94eXEvYXBwbXNldC5qc29uJywge30pKS5lbkRuO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZW5EbiA9PSAnMScgJiYgdmxpbmsubWF0Y2goL3lvdWt1fG1ndHZ8aXhpZ3VhfHFxLmNvbXxxaXlpfG1pZ3V8YmlsaWJpbGl8c29odXxwcHR2fGxlfDE5MDUuY29tLykgJiYgdmxpbmsuc2VhcmNoKC9odG1sfGJpbGliaWxpfGl4aWd1YS8pICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coJ+W3suW8gOWQr+aWreaPku+8jOWwhuiwg+eUqOaWreaPkuino+aekGh0bWwnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoXFxcInZhciBjb25maWcgPVxcXCIgKyBmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb25cXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKGZldGNoKGNvbmZpZy5jaikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF5dG1QYXJzZSh2bGluayk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07Ki9cXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG5cXG4gICAgICAgICAgICAgICAgdmFyIHNyY3VybCA9IGxpbms7XFxuICAgICAgICAgICAgICAgIC8vbG9nKHNyY3VybCk7XFxuICAgICAgICAgICAgICAgIC8v5Yqo5oCB6Kej5p6Q5Luj56CB5byA5aeLXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAvL+WkhOeQhuaMh+WumuinhumikeS4jue6v+i3r1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9cXFxcLm0zdTh8XFxcXC5tcDR8b2JqXFxcXC90b3N8bmV0ZWFzZVxcXFwuY29tLy50ZXN0KHNyY3VybCkgJiYgL2h0dHAvLnRlc3Qoc3JjdXJsKSAmJiAhL1xcXFwuaHRtbHxcXFxcLm0zdThcXFxcLi8udGVzdChzcmN1cmwpICYmICEvXFxcXD1odHRwLy50ZXN0KHNyY3VybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoL3drZmlsZS8udGVzdChzcmN1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzcmN1cmwgKyAnO3tSZWZlcmVyQGh0dHBzOi8vZmFudHVhbi53a2ZpbGUuY29tL30nXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC9cXFxcPWh0Ly50ZXN0KHNyY3VybCkgPyBzcmN1cmwuc3Vic3RyaW5nKHNyY3VybC5pbmRleE9mKCc9aHQnKSArIDEpIDogc3JjdXJsICsgJyNpc1ZpZGVvPXRydWUjJztcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9oZDhcXFxcLnB3Ly50ZXN0KHZsaW5rKSAmJiAvXFxcXC5tM3U4fFxcXFwubXA0Ly50ZXN0KHZsaW5rKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB2bGluaztcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3JjdXJsLmluZGV4T2YoXFxcIi9zaGFyZS9cXFwiKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5rID0gc3JjdXJsLnNwbGl0KFxcXCIvc2hhcmVcXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZjID0gZmV0Y2goc3JjdXJsLCB7fSkucmVwbGFjZShcXFwidmFyIHB1cmxcXFwiLCBcXFwidmFyIG1haW5cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZjLmluZGV4T2YoXFxcIm1haW5cXFwiKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1hdCA9IGZjLm1hdGNoKC92YXIgbWFpbi4qPzsvKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwobWF0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwbGF5ID0gKG1haW4uaW5kZXhPZihcXFwiaHR0cFxcXCIpICE9IC0xID8gbWFpbiA6IGxpbmsgKyBtYWluKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtYWluID0gZmMubWF0Y2goL3VybDouKj9bXFxcXCdcXFxcXFxcIl0oLio/KVtcXFxcJ1xcXFxcXFwiXS8pWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBsYXkgPSAobWFpbi5pbmRleE9mKFxcXCJodHRwXFxcIikgIT0gLTEgPyBtYWluIDogbGluayArIG1haW4pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwbGF5O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd4NVdlYlZpZXc6Ly8nICsgKHNyY3VybClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC85ODN2aXAvLnRlc3Qoc3JjdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnBhcnNlKGZldGNoKHNyY3VybCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWRpcmVjdDogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmhlYWRlcnMubG9jYXRpb25bMF07XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC94XFxcXC1uXFxcXC5jY3xuaGR6NjY2Ly50ZXN0KHNyY3VybCkgJiYgL1xcXFwuaHRtbHxiaWxpYmlsaS8udGVzdChzcmN1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwodmxpbmspO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgLy/lpITnkIbmjIflrprop4bpopHlkoznur/ot6/nu5PmnZ9cXG4gICAgICAgICAgICAgICAgICAgIC8vLS0tLeWIhuWJsue6vy0tLS0vL1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNjb2RlID0gSlNPTi5wYXJzZShmZXRjaChzcmN1cmwsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcIm9raHR0cC80LjEuMFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB3aXRoU3RhdHVzQ29kZTogdHJ1ZVxcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coc2NvZGUpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNjb2RlLnN0YXR1c0NvZGUgPT0gJzMwMicgfHwgc2NvZGUuc3RhdHVzQ29kZSA9PSAnMzAxJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8v5omT5byA6Kej5p6Q5pyJMzAy6YeN5a6a5ZCR55qE6ZO+5o6lXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlZHVybCA9IHNjb2RlLmhlYWRlcnMubG9jYXRpb25bMF0ucmVwbGFjZSgvXFxcXFxcXFwvZywgJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvXFxcXD1odHRwLy50ZXN0KHJlZHVybCkgJiYgL2h0bWx8YmlsaWJpbGl8a2V5XFxcXD0vLnRlc3QocmVkdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShmZXRjaChyZWR1cmwsIHt9KSkudXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFw9aHR0cC8udGVzdChyZWR1cmwpICYmIC9cXFxcLm0zdTh8XFxcXC5tcDR8XFxcXC5mbHYvLnRlc3QocmVkdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVkdXJsLnN1YnN0cmluZyhyZWR1cmwuaW5kZXhPZignPWh0dHAnKSArIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL2h0dHAvLnRlc3QocmVkdXJsKSAmJiAva2V5XFxcXD18dWlkXFxcXD18dmlkXFxcXD0vLnRlc3QocmVkdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShmZXRjaChyZWR1cmwsIHt9KSkudXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL2h0dHAvLnRlc3QocmVkdXJsKSAmJiAvaHRtbHxiaWxpYmlsaS8udGVzdChyZWR1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBvcGVudXJsKHZsaW5rKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVkdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3ZhciBodG1sID0gcmVxdWVzdChzcmN1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBodG1sID0gc2NvZGUuYm9keTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyhodG1sKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoLzQwNCBOb3QgRm91bmR85aSH5qGI5ZCO5Y+v57un57ut6K6/6ZeuLy50ZXN0KGh0bWwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBvcGVudXJsKHZsaW5rKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9cXFxcPGJvZHkvLnRlc3QoaHRtbCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCflsJ3or5XpnZ5KU09O5o6l5Y+j572R6aG16Kej5p6QJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVDYWNoZSgnaHR0cHM6Ly9hZ2l0LmFpL2x6azIzNTU5L1B1YmxpY1J1bGUvcmF3L2JyYW5jaC9tYXN0ZXIveDVydWxlLmpzJywgMjQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geDVydWxlKHNyY3VybCwgc3JjdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gb3BlbnVybChzcmN1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vanNvbuino+aekOeahOWPlumTvuaOpVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHVybCA9IGh0bWwubWF0Y2goL1tcXFxcJ1xcXFxcXFwiXXVybFtcXFxcJ1xcXFxcXFwiXTouKj9bXFxcXCdcXFxcXFxcIl0oLio/KVtcXFxcJ1xcXFxcXFwiXS8pWzFdLnJlcGxhY2UoL1xcXFxcXFxcL2csICcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2cocHVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvaHR0cC8udGVzdChwdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHB0YWIgPT0gJ2JpbGliaWxpJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJzt7UmVmZXJlckBodHRwczovL3d3dy5iaWxpYmlsaS5jb20vJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHB0YWIgPT0gJ21ndHYnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnICsgJzt7UmVmZXJlckB3d3cubWd0di5jb20mJlVzZXItQWdlbnRATW96aWxsYS81LjB9JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL29qYmsvLnRlc3QocHVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybCArICc7e1JlZmVyZXJAaHR0cHM6Ly9iYWsub2pia2p4LmNvbS99JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL3ZpZGVvX21wNHx0eXBlXFxcXD1tM3U4fHB0XFxcXD1tM3U4fFxcXFwvdmlkZW9cXFxcL3Rvc1xcXFwvLy50ZXN0KHB1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8v6Z2eaHR0cOW8gOWktOeahOaJk+W8gOWOn+mTvuaOpSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBvcGVudXJsKHZsaW5rKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAvL+aKpemUmeWIpOaWreWkhOeQhlxcbiAgICAgICAgICAgICAgICAgICAgbG9nKCfmiafooYzmiqXplJnot7PovazlpITnkIYnKTtcXG4gICAgICAgICAgICAgICAgICAgIC8qaWYgKHNyY3VybC5zdWJzdHJpbmcoMCwgMikgPT0gJ1xcXFwvXFxcXC8nKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwoJ2h0dHBzOicgKyBzcmN1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvXFxcXD1odHRwLy50ZXN0KHNyY3VybCkgJiYgL1xcXFwuaHRtbHxiaWxpYmlsaS8udGVzdChzcmN1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gc3JjdXJsLnNwbGl0KCc9JylbMV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwoc3JjdXJsLnN1YnN0cmluZyhzcmN1cmwuaW5kZXhPZignPWh0dHAnKSArIDEpKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ki9cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBvcGVudXJsKHZsaW5rKVxcbiAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gJ3g1V2ViVmlldzovLycrc3JjdXJsXFxuICAgICAgICAgICAgICAgICAgICAvL31cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAvL+WKqOaAgeino+aekOS7o+eggee7k+adn1xcbiAgICAgICAgICAgIH0s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pTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMveHlxL2FwcG1zZXQuanNvbicsIHt9KSkuZW5EbjtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChlbkRuID09ICcxJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvZygn6LCD55So5pat5o+S6Kej5p6QJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChcXFwidmFyIGNvbmZpZyA9XFxcIiArIGZldGNoKFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL015UGFyc2VTZXQuanNvblxcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKGZldGNoKGNvbmZpZy5jaikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBheXRtUGFyc2UocmVzdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VybFxcbiAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvXFxcXD1MVFxcXFwtLy50ZXN0KHJlc3VybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZygn6LCD55So5pat5o+SbHRuYumAmueUqOino+aekCcpO1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChcXFwidmFyIGNvbmZpZyA9XFxcIiArIGZldGNoKFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL015UGFyc2VTZXQuanNvblxcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goY29uZmlnLmNqKSk7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgbmFtZSA9ICdsdG5iKOmAmueUqOWHveaVsCknO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBhcnNlU1tuYW1lXShyZXN1cmwuc3Vic3RyaW5nKHJlc3VybC5pbmRleE9mKCc9TFQtJykgKyAxKSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdXJsXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9O1xcblxcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIHZhciBlbkRuID0gSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9maWxlcy9ydWxlcy94eXEvYXBwbXNldC5qc29uJywge30pKS5lbkRuO1xcbiAgICAgICAgICAgICAgICBpZiAoZW5EbiA9PSAnMScgJiYgc3JjdXJsLm1hdGNoKC95b3VrdXxtZ3R2fGl4aWd1YXxxcS5jb218cWl5aXxtaWd1fGJpbGliaWxpfHNvaHV8cHB0dnxsZXwxOTA1LmNvbS8pICYmIHNyY3VybC5zZWFyY2goL2h0bWx8YmlsaWJpbGl8aXhpZ3VhLykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZygn5bey5byA5ZCv5pat5o+S77yM5bCG6LCD55So5pat5o+S6Kej5p6QaHRtbCcpO1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChcXFwidmFyIGNvbmZpZyA9XFxcIiArIGZldGNoKFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL015UGFyc2VTZXQuanNvblxcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goY29uZmlnLmNqKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXl0bVBhcnNlKHNyY3VybC5zdWJzdHJpbmcoc3JjdXJsLmluZGV4T2YoJz1odHRwJykgKyAxKSk7XFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG5cXG4gICAgICAgICAgICAvL2xvZyhzcmN1cmwpO1xcbiAgICAgICAgICAgIC8v5Yqo5oCB6Kej5p6Q5Luj56CB5byA5aeLXFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgaWYgKC9cXFxcLm0zdTh8XFxcXC5tcDR8b2JqXFxcXC90b3MvLnRlc3Qoc3JjdXJsKSAmJiAvaHR0cC8udGVzdChzcmN1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gL1xcXFw9aHQvLnRlc3Qoc3JjdXJsKSA/IHNyY3VybC5zdWJzdHJpbmcoc3JjdXJsLmluZGV4T2YoJz1odCcpICsgMSkgOiBzcmN1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHNyY3VybC5pbmRleE9mKFxcXCIvc2hhcmUvXFxcIikgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpbmsgPSBzcmN1cmwuc3BsaXQoXFxcIi9zaGFyZVxcXCIpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmYyA9IGZldGNoKHNyY3VybCwge30pLnJlcGxhY2UoXFxcInZhciBwdXJsXFxcIiwgXFxcInZhciBtYWluXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZjLmluZGV4T2YoXFxcIm1haW5cXFwiKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWF0ID0gZmMubWF0Y2goL3ZhciBtYWluLio/Oy8pWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKG1hdCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwbGF5ID0gKG1haW4uaW5kZXhPZihcXFwiaHR0cFxcXCIpICE9IC0xID8gbWFpbiA6IGxpbmsgKyBtYWluKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWFpbiA9IGZjLm1hdGNoKC91cmw6Lio/W1xcXFwnXFxcXFxcXCJdKC4qPylbXFxcXCdcXFxcXFxcIl0vKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBsYXkgPSAobWFpbi5pbmRleE9mKFxcXCJodHRwXFxcIikgIT0gLTEgPyBtYWluIDogbGluayArIG1haW4pXFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGxheTtcXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3g1V2ViVmlldzovLycgKyAoc3JjdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHB0YWIgPT0gJ2FsaXp5Jykge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHB1cmwgPSBmZXRjaCgnaHR0cHM6Ly9mb3ViaW4uY29tL2ppZXhpLnBocD91cmw9JyArIHNyY3VybCwge30pLm1hdGNoKC9cXFxcXFxcInVybFxcXFxcXFwiOlxcXFxcXFwiKC4qPylcXFxcXFxcIi8pWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmw7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoLzE5anhcXFxcLnZpcHxuZnlpbmdzaGkvLnRlc3Qoc3JjdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHB1cmwgPSBKU09OLnBhcnNlKGZldGNoKHNyY3VybC5yZXBsYWNlKCdodHRwOi8vJywgJ2h0dHBzOi8vJyksIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWRpcmVjdDogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgd2l0aEhlYWRlcnM6IHRydWVcXG4gICAgICAgICAgICAgICAgICAgIH0pKS5oZWFkZXJzLmxvY2F0aW9uWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKC90aXRhbi5tZ3R2Ly50ZXN0KHB1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnICsgJzt7UmVmZXJlckB3d3cubWd0di5jb20mJlVzZXItQWdlbnRATW96aWxsYS81LjB9JztcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL29ialxcXFwvdG9zLy50ZXN0KHB1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybFxcbiAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAvKmVsc2UgaWYgKC96aGFpa2FueXMvLnRlc3Qoc3JjdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwdXJsID0gSlNPTi5wYXJzZShmZXRjaChzcmN1cmwgKyAnJmFwcD0xMDAwMyZhY2NvdW50PTI3Mjc3NTAyOCZwYXNzd29yZD1xcTI3Mjc3NTAyOCcsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUFcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoSGVhZGVyczogdHJ1ZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5oZWFkZXJzLmxvY2F0aW9uWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvdGl0YW4ubWd0di8udGVzdChwdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybCArICcjaXNWaWRlbz10cnVlIycgKyAnO3tSZWZlcmVyQHd3dy5tZ3R2LmNvbSYmVXNlci1BZ2VudEBNb3ppbGxhLzUuMH0nO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL29ialxcXFwvdG9zLy50ZXN0KHB1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJyNpc1ZpZGVvPXRydWUjJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ki9cXG5cXG4gICAgICAgICAgICAgICAgLy8tLS0t5YiG5Ymy57q/LS0tLS8vXFxuICAgICAgICAgICAgICAgIHZhciBzY29kZSA9IEpTT04ucGFyc2UoZmV0Y2goc3JjdXJsLCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUFcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICByZWRpcmVjdDogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICB3aXRoU3RhdHVzQ29kZTogdHJ1ZVxcbiAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgIC8vbG9nKHNjb2RlKTtcXG4gICAgICAgICAgICAgICAgaWYgKHNjb2RlLnN0YXR1c0NvZGUgPT0gJzMwMicgfHwgc2NvZGUuc3RhdHVzQ29kZSA9PSAnMzAxJykge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHB1cmwgPSBzY29kZS5oZWFkZXJzLmxvY2F0aW9uWzBdLnJlcGxhY2UoL1xcXFxcXFxcL2csICcnKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIC8vdmFyIGh0bWwgPSByZXF1ZXN0KHNyY3VybCk7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaHRtbCA9IHNjb2RlLmJvZHk7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhodG1sKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmICgvNDA0IE5vdCBGb3VuZHzlpIfmoYjlkI7lj6/nu6fnu63orr/pl6585LiN5a2Y5ZyoLy50ZXN0KGh0bWwpIHx8IGh0bWwgPT0gJycpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3BlbnVybChzcmN1cmwuc3Vic3RyaW5nKHNyY3VybC5pbmRleE9mKCc9aHR0cCcpICsgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvXFxcXFxcXCJ1cmxcXFxcXFxcIlxcXFw6XFxcXFxcXCJodHRwLy50ZXN0KGh0bWwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHB1cmwgPSBodG1sLm1hdGNoKC9cXFxcXFxcInVybFxcXFxcXFwiOlxcXFxcXFwiKC4qPylcXFxcXFxcIi8pWzFdLnJlcGxhY2UoL1xcXFxcXFxcL2csICcnKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaHRtbC5zdGFydHNXaXRoKCd7JykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHVybCA9IHNyY3VybC5zdWJzdHJpbmcoc3JjdXJsLmluZGV4T2YoJz1odHRwJykgKyAxKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy92YXIgcHVybCA9IHNyY3VybFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVDYWNoZSgnaHR0cHM6Ly9hZ2l0LmFpL2x6azIzNTU5L1B1YmxpY1J1bGUvcmF3L2JyYW5jaC9tYXN0ZXIveDVydWxlLmpzJywgMjQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB4NXJ1bGUoc3JjdXJsLCBzcmN1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuICd4NVdlYlZpZXc6Ly8nKyhzcmN1cmwpIFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAvL2xvZyhwdXJsKTtcXG4gICAgICAgICAgICAgICAgaWYgKC90aXRhbi5tZ3R2Ly50ZXN0KHB1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybCArICcjaXNWaWRlbz10cnVlIycgKyAnO3tSZWZlcmVyQHd3dy5tZ3R2LmNvbSYmVXNlci1BZ2VudEBNb3ppbGxhLzUuMH0nO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9vYmpcXFxcL3Rvcy8udGVzdChwdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmxcXG4gICAgICAgICAgICAgICAgfTtcXG5cXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIGlmIChzcmN1cmwuc3Vic3RyaW5nKDAsIDIpID09ICdcXFxcL1xcXFwvJykge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwoJ2h0dHBzOicgKyBzcmN1cmwpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9cXFxcPWh0dHAvLnRlc3Qoc3JjdXJsKSAmJiAvXFxcXC5odG1sfGJpbGliaWxpLy50ZXN0KHNyY3VybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuIHNyY3VybC5zcGxpdCgnPScpWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwoc3JjdXJsLnN1YnN0cmluZyhzcmN1cmwuaW5kZXhPZignPWh0dHAnKSArIDEpKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBvcGVudXJsKHNyY3VybClcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAvL+WKqOaAgeino+aekOS7o+eggee7k+adn1xcbiAgICAgICAgfSwgcHRhYiwgc3JjdXJsLCBteXVybCksXFxuICAgICAgICBjb2xfdHlwZTogY2x0XFxuICAgIH0pO1xcbn1cXG4vL31cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuWIl+ihqOaooeW8j+aQnOe0ouS6jOe6p1wiLFwicGF0aFwiOlwic2VhcmVyalwiLFwicnVsZVwiOlwidmFyIHJlcyA9IHt9O1xcbnZhciBpdGVtcyA9IFtdO1xcbnZhciBub3dEYXRlID0gbmV3IERhdGUoKTtcXG52YXIgbW9udGggPSBub3dEYXRlLmdldE1vbnRoKCkgKyAxIDwgMTAgPyBcXFwiMFxcXCIg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uICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKHRkb21pbi5pbmRleE9mKCdhcGkucGhwL2FwcC8nKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS52b2RfbmFtZTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBsaXN0W2ldLnZvZF9waWM7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoL2ZhbnR1YW4vLnRlc3QodGRvbWluKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWQgPSAnaHR0cHM6Ly9mYW50dWFuLndrZmlsZS5jb20vYXBpLnBocC9hcHAvdmlkZW9fZGV0YWlsP2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICd2aWRlb19kZXRhaWw/aWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0udm9kX3JlbWFya3M7XFxuICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRkb21pbi5pbmRleE9mKCd4Z2FwcC5waHAvdjEvJykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGxpc3RbaV0udm9kX25hbWU7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcGljID0gbGlzdFtpXS52b2RfcGljO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICd2aWRlb19kZXRhaWw/aWQ9JyArIGxpc3RbaV0udm9kX2lkO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0udm9kX3JlbWFya3M7XFxuICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS52b2RfbmFtZTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBsaXN0W2ldLnZvZF9waWM7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoL2lvcGVueXVuLy50ZXN0KHRkb21pbikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJy9kZXRhaWxJRD92b2RfaWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmKC9ncmVsaWdodGluZy8udGVzdCh0ZG9taW4pKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJy8/aWRzPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICcvZGV0YWlsP2tleT0nICsgZGF0ZVN0ciArICcmdm9kX2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHZhciByZW0gPSBsaXN0W2ldLnZvZF9yZW1hcmtzO1xcbiAgICAgICAgICAgICAgICAgICAgLy92YXIgY29uPWxpc3RbaV0udHlwZS50eXBlX2RlcztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLnJlcGxhY2Uoa2V5LCAn4oCc4oCcJyArIGtleSArICfigJ3igJ0nKSxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogcGljICsgJ0BSZWZlcmVyPScsXFxuICAgICAgICAgICAgICAgIHVybDogJCh0ZG9taW4uaW5kZXhPZihcXFwibW9nYWlfYXBpXFxcIikgIT0gLTEgPyB2aWQgKyAnO2dldDt1dGYtODt7VXNlci1BZ2VudEBEYXJ0LzIuMTQgKGRhcnQ6aW8pfScgOiB2aWQgKyAnO2dldDt1dGYtODt7VXNlci1BZ2VudEBva2h0dHAvNC4xLjB9JykucnVsZSgodGRvbWluKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0ge307XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaXRlbXMgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBodG1sID0gSlNPTi5wYXJzZShnZXRSZXNDb2RlKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6ICcyNTUmJmZsb2F0JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAneDVfd2Vidmlld19zaW5nbGUnXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hYNVdlYlZpZXcoJycpO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIG15dXJsID0gTVlfVVJMLm1hdGNoKC8oW1xcXFxTXSo/OlxcXFwvXFxcXC9bXFxcXFNdKj8pXFxcXC8vKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmICgvXFxcXC92b2RcXFxcLy8udGVzdCh0ZG9taW4pKSB7XFxuICAgICAgICAgICAgICAgICAgICAg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gICB9O1xcbiAgICAgICAgaWYgKC9mYW50dWFuLy50ZXN0KG11cmwpKSB7XFxuICAgICAgICAgICAgdmFyIGxpbmsgPSAnaHR0cHM6Ly9mYW50dWFuLndrZmlsZS5jb20vYXBpLnBocC9hcHAvdmlkZW9fZGV0YWlsP2lkPScgKyB1cmwgKyAnJnRva2VuPTtnZXQ7dXRmLTg7e1VzZXItQWdlbnRARGFydC8yLjE0IChkYXJ0OmlvKX0nO1xcbiAgICAgICAgfSBlbHNlIGlmICgvaW9wZW55dW4vLnRlc3QobXVybCkpIHtcXG4gICAgICAgICAgICB2YXIgbGluayA9IG11cmwgKyAnL2RldGFpbElEP3ZvZF9pZD0nICsgdXJsICsgJyZyZWxfbGltaXQ9MTA7Z2V0O3V0Zi04O3tVc2VyLUFnZW50QERhcnQvMi4xNCAoZGFydDppbyl9JztcXG4gICAgICAgIH0gZWxzZSBpZiAoL2RpamlheGlhLy50ZXN0KG11cmwpKSB7XFxuICAgICAgICAgICAgdmFyIGxpbmsgPSAnaHR0cDovL3d3dy5kaWppYXhpYS5jb20vYXBpLnBocC9hcHAvdmlkZW9fZGV0YWlsP2lkPScgKyB1cmw7XFxuICAgICAgICB9XFxuICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgcGljX3VybDogaW1nICsgJ0BSZWZlcmVyPScsXFxuICAgICAgICAgICAgdXJsOiAkKGxpbmspLnJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICB2YXIgcmVzID0ge307XFxuICAgICAgICAgICAgICAgIHZhciBpdGVtcyA9IFtdO1xcbiAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnJyxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6ICcyNTUmJmZsb2F0JyxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJycsXFxuICAgICAgICAgICAgICAgICAgICB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oJ++/pWhvbWVfcnVsZe+/pScpWzFdKS52ZXJzaW9uO1xcbiAgICAgICAgfTtcXG4gICAgICAgIGlmICgv77+laG9tZV9ydWxlLy50ZXN0KHJlbWYpKSB7XFxuICAgICAgICAgICAgbG9nKCfov5znqIvniYjmnKzvvJonICsgcmVtdik7XFxuICAgICAgICAgICAgbG9nKCfmnKzlnLDniYjmnKzvvJonICsgbG9jdmVyKTtcXG4gICAgICAgICAgICBpZiAobG9jdmVyICE9IHJlbXYpIHtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKCdhcHBudmVyJywgcmVtZik7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mnInmlrDniYjmnKzvvIzngrnlr7zlhaXmm7TmlrDlj6/mm7TmlrDop4TliJnjgIInO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mmoLml6DmlrDniYjmnKzvvIwyNOWwj+aXtuWGheajgOa1i+aXoOaViOOAgidcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5qOA5rWL5pu05paw5aSx6LSl77yM5Y+v6IO95LqR56uv5oq96aOO5LqG44CCJ1xcbiAgICAgICAgfVxcbiAgICB9LCBsb2N2ZXIpLFxcbiAgICBjb2xfdHlwZTogJ3RleHRfMidcXG59KTtcXG5pZiAoZ2V0VmFyKCdhcHBudmVyJykpIHtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn5a+85YWl5pu05pawJyxcXG4gICAgICAgIHVybDogJCgnJykubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgIHJldHVybiBnZXRWYXIoJ2FwcG52ZXInKTtcXG4gICAgICAgIH0pLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzInXFxu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cjtcXG4gICAgICAgIGlmIChjb250cy5sZW5ndGggPCAxKSB7XFxuICAgICAgICAgICAgY29udHMgPSBodG1sLmRhdGEudm9kX3BsYXlfdXJsLnNwbGl0KCckJCQnKTtcXG4gICAgICAgIH1cXG4gICAgfSBlbHNlIGlmIChodG1sLmRhdGEudm9kX2luZm8gJiYgaHRtbC5kYXRhLnZvZF9pbmZvLnZvZF91cmxfd2l0aF9wbGF5ZXIpIHtcXG4gICAgICAgIHZhciBjb250cyA9IGh0bWwuZGF0YS52b2RfaW5mby52b2RfdXJsX3dpdGhfcGxheWVyO1xcbiAgICAgICAgaWYgKGNvbnRzLmxlbmd0aCA8IDEpIHtcXG4gICAgICAgICAgICBjb250cyA9IGh0bWwuZGF0YS52b2RfaW5mby52b2RfcGxheV91cmwuc3BsaXQoJyQkJCcpO1xcbiAgICAgICAgfVxcbiAgICB9IGVsc2UgaWYgKGh0bWwuZGF0YS5sZW5ndGggPT0gMSkge1xcbiAgICAgICAgdmFyIGNvbnRzID0gaHRtbC5kYXRhWzBdLnZvZF9wbGF5X2xpc3Q7XFxuICAgICAgICAvL2xvZyhjb250cyk7XFxuICAgICAgICBpZiAoY29udHMubGVuZ3RoIDwgMSkge1xcbiAgICAgICAgICAgIGNvbnRzID0gaHRtbC5kYXRhWzBdLnZvZF9wbGF5X3VybC5zcGxpdCgnJCQkJyk7XFxuICAgICAgICB9XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICB2YXIgY29udHMgPSBodG1sLmRhdGEudm9kX3BsYXlfbGlzdDtcXG4gICAgICAgIGlmIChjb250cy5sZW5ndGggPCAxKSB7XFxuICAgICAgICAgICAgY29udHMgPSBodG1sLmRhdGEudm9kX3BsYXlfdXJsLnNwbGl0KCckJCQnKTtcXG4gICAgICAgIH1cXG4gICAgfVxcblxcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IGNvbnRzLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICBpZiAoaHRtbC52aWRlb2xpc3QpIHtc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gfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnP2FjPWxpc3Qmd2Q9JyArIGtleSArICcmcGFnZT0xJztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGlmICgvZGlqaWF4aWEvLnRlc3QobGluaykpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxpbmsgPSAnaHR0cDovL3d3dy5kaWppYXhpYS5jb20vYXBpLnBocC9hcHAvJ1xcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICBpZiAobGluay5pbmRleE9mKCdhcGkucGhwL2FwcC8nKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGhtdXJsID0gbGluayArICdzZWFyY2g/cGc9MSZ0ZXh0PScgKyBrZXkgKyAnJnRva2VuPSc7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobGluay5pbmRleE9mKCd4Z2FwcC5waHAvdjEvJykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnc2VhcmNoP3BnPTEmdGV4dD0nICsga2V5O1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9pb3Blbnl1bi8udGVzdChsaW5rKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnL2xpc3Q/cGFnZT1meXBhZ2UmbGltaXQ9MTAmd2Q9JyArIGtleTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhtdXJsID0gbGluayArICc/cGFnZT0xJmxpbWl0PTEwJndkPScgKyBrZXk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgLy9EYXRhLnB1c2goe3VybDogaG11cmwsb3B0aW9uczoge2hlYWRlcnM6IHtcXFwiVXNlci1BZ2VudFxcXCI6IFxcXCJEYXJ0LzIuMTQgKGRhcnQ6aW8pXFxcIn0sdGltZW91dDogdGltZW91fX0pO1xcbiAgICAgICAgICAgIERhdGEucHVzaCh7XFxuICAgICAgICAgICAgICAgIHVybDogaG11cmwsXFxuICAgICAgICAgICAgICAgIG9wdGlvbnM6IHtcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IGxpbmsuaW5kZXhPZihcXFwibW9nYWlfYXBpXFxcIikgIT0gLTEgPyBcXFwiRGFydC8yLjE0IChkYXJ0OmlvKVxcXCIgOiBcXFwib2todHRwLzQuMS4wXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIHRpbWVvdXQ6IHRpbWVvdVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgVGl0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXQ6IGxpc3Rbal0udGl0bGUsXFxuICAgICAgICAgICAgICAgIGxpbms6IGxpbmssXFxuICAgICAgICAgICAgICAgIHR5cG5tOiBsaXRpdFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSAvL2lmXFxuICAgIH0gLy9mb3Igalxcbn0gY2F0Y2ggKGUpIHt9XFxuaWYgKERhdGEubGVuZ3RoIDw9IDApIHtcXG4gICAgc2V0UmVzdWx0KFtdKTtcXG59IGVsc2Uge1xcbiAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi5q2j5Zyo5Yqg6L295Lit56ysXFxcIiArIE1ZX1BBR0UgKyBcXFwi6aG177yM6L+b5bqm77yaMS9cXFwiICsgRGF0YS5sZW5ndGgsXFxuICAgICAgICB1cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgIGRlc2M6IFxcXCJcXFwiLFxcbiAgICAgICAgcGljX3VybDogXFxcIlxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGlkOiBwYWdlaWRcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIHNldFJlc3VsdChpdGVtcyk7XFxuICAgIGxldCB0YXNrcyA9IFtdO1xcblxcbiAgICBmb3IgKGxldCBrIGluIERhdGEpIHtcXG4gICAgICAgIGxldCBpdCA9IERhdGFba107XFxuICAgICAgICB0YXNrcy5wdXNoKHtcXG4gICAgICAgICAgICBmdW5jOiBmdW5jdGlvbihwYXJhbSkge1xcbiAgICAgICAgICAgICAgICBsZXQgZCA9IFtdO1xcbiAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IGZldGNoKHBhcmFtLml0LnVybCwgcGFyYW0uaXQub3B0aW9ucyk7XFxuICAgICAgICAgICAgICAgIC8vbG9nKGh0bWwpO1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgaHRtbCA9IGh0bWwuc3Vic3RyaW5nKDAsIDIpID09ICdcXFxcclxcXFxuJyA/IGh0bWwucmVwbGFjZSgnXFxcXHJcXFxcbicsICcnKSA6IGh0bWw7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgICAgIGlmICgvYnR3YWYvLnRlc3QoaHRtbCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGh0bWwgPSBmZXRjaChwYXJhbS5pdC51cmwgKyAnJmJ0d2FmJyArIGh0bWwubWF0Y2goL2J0d2FmKC4qPylcXFxcXFxcIi8pWzFdLCB7fSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKGh0bWwgPT0gXFxcIlxcXCIgfHwgaHRtbCA9PSBudWxsIHx8IGh0bWwuc3Vic3RyaW5nKDAsIDUpID09ICdlcnJvcicgfHwgIWh0bWwuZW5kc1dpdGgoJ30nKSkge1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGFyYW0udGl0LnRpdCArICcgJyArICfmnKrmkJzntKLliLDvvIzngrnlh7vorr/pl67ljp/nvZHpobUnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogcGFyYW0uaXQudXJsICsgYEBsYXp5UnVsZT0uanM6aW5wdXQuc3BsaXQoJzsnKVswXWAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJ1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaHRtbC5sZW5ndGggPCA4MCkge1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGFyYW0udGl0LnRpdCArICcgJyArICfov5Tlm57mlbDmja7kuI3lrozmlbTvvIzngrnlh7vorr/pl67ljp/nvZHpobUnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogcGFyYW0uaXQudXJsICsgYEBsYXp5UnVsZT0uanM6aW5wdXQuc3BsaXQoJzsnKVswXWAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJ1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBodG1sID0gSlNPTi5wYXJzZShodG1sKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKGh0bWwpO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHR5cGV0ID0gcGFyYW0udGl0LnR5cG5tO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRkb21pbiA9IHBhcmFtLnRpdC5saW5rO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGh0bWwubGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gaHRtbC5saXN0O1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChodG1sLmRhdGEubGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gaHRtbC5kYXRhLmxpc3Q7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGh0bWwuZGF0YSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gaHRtbC5kYXRhO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxpc3QubGVuZ3RoIDwgMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwYXJhbS50aXQudGl0ICsgJyAnICsgJ+WIl+ihqOWwj+S6jjHvvIzml6Dms5XlsZXnpLrvvIzngrnlh7vorr/pl67ljp/nvZHpobUnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHBhcmFtLml0LnVybCArIGBAbGF6eVJ1bGU9LmpzOmlucHV0LnNwbGl0KCc7JylbMF1gLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsaXN0Lmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvXFxcXC92b2RcXFxcLy8udGVzdCh0ZG9taW4pKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBsaXN0W2ldLnRpdGxlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBpYyA9IGxpc3RbaV0ucGljO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IGxpc3RbaV0ubmV4dGxpbms7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVtID0gbGlzdFtpXS5zdGF0ZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0ZG9taW4uaW5kZXhPZignYXBpLnBocC9hcHAvJykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBsaXN0W2ldLnZvZF9uYW1lO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBsaXN0W2ldLnZvZF9waWM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKC9mYW50dWFuLy50ZXN0KHRkb21pbikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9ICdodHRwczovL2ZhbnR1YW4ud2tmaWxlLmNvbS9hcGkucGhwL2FwcC92aWRlb19kZXRhaWw/aWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWQgPSB0ZG9taW4gKyAndmlkZW9fZGV0YWlsP2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0udm9kX3JlbWFya3M7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy92YXIgY29uPWxpc3RbaV0udHlwZS50eXBlX2RlcztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGRvbWluLmluZGV4T2YoJ3hnYXBwLnBocC92MS8nKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGxpc3RbaV0udm9kX25hbWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBpYyA9IGxpc3RbaV0udm9kX3BpYztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJ3ZpZGVvX2RldGFpbD9pZD0nICsgbGlzdFtpXS52b2RfaWQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0udm9kX3JlbWFya3M7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy92YXIgY29uPWxpc3RbaV0udHlwZS50eXBlX2RlcztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS52b2RfbmFtZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGljID0gbGlzdFtpXS52b2RfcGljO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvaW9wZW55dW4vLnRlc3QodGRvbWluKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJy9kZXRhaWxJRD92b2RfaWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL2dyZWxpZ2h0aW5nLy50ZXN0KHRkb21pbikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICcvP2lkcz0nICsgbGlzdFtpXS52b2RfaWQgKyAnJnRva2VuPSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICcvZGV0YWlsP2tleT0nICsgZGF0ZVN0ciArICcmdm9kX2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0udm9kX3JlbWFya3M7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy92YXIgY29uPWxpc3RbaV0udHlwZS50eXBlX2RlcztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS5zdGF0ZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2codmlkKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBNWV9UWVBFID09IFxcXCJob21lXFxcIiA/IHRpdGxlLnJlcGxhY2Uoa2V5LCAn4oCc4oCcJyArIGtleSArICfigJ3igJ0nKSArICdcXFxcbicgKyByZW0gOiB0aXRsZSArIHJlbSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IHBpYyArICdAUmVmZXJlcj0nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHRkb21pbi5pbmRleE9mKFxcXCJtb2dhaV9hcGlcXFwiKSAhPSAtMSA/IHZpZCArICc7Z2V0O3V0Zi04O3tVc2VyLUFnZW50QERhcnQvMi4xNCAoZGFydDppbyl9JyA6IHZpZCArICc7Z2V0O3V0Zi04O3tVc2VyLUFnZW50QG9raHR0cC80LjEuMH0nKS5ydWxlKCh0ZG9taW4sIHRrdCwgcGF0dCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaXRlbXMgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGt0ICE9ICcnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZSh0a3QgKyAnLScgKyBwYXR0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBKU09OLnBhcnNlKGdldFJlc0NvZGUoKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogJzI1NSYmZmxvYXQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3g1X3dlYnZpZXdfc2luZ2xlJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBteXVybCA9IE1ZX1VSTC5tYXRjaCgvKFtcXFxcU10qPzpcXFxcL1xcXFwvW1xcXFxTXSo/KVxcXFwvLylbMV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKC9cXFxcL3ZvZFxcXFwvLy50ZXN0KHRkb21pbikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvdHZtb3ZsaXN0Jywge30pKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9hcHBtb3ZsaXN0Jywge30pKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzLmRhdGEgPSBpdGVtcztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRIb21lUmVzdWx0KHJlcyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB0ZG9taW4sIHBhcmFtLnRpdC50aXQsIHRpdGxlKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vY29udGVudDogcmVtLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogdHl0aXQgKyAnID0+ICcgKyBwYXJhbS50aXQudGl0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYydcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSAvL2ZvciBpXFxuICAgICAgICAgICAgICAgICAgICB9IC8vaWYgbGlzdC5sZW5ndGhcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gZDtcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIHBhcmFtOiB7XFxuICAgICAgICAgICAgICAgIGl0OiBpdCxcXG4gICAgICAgICAgICAgICAgdGl0OiBUaXRba11cXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIGlkOiBcXFwidGFza1xcXCJcXG4gICAgICAgIH0pXFxuICAgIH1cXG5cXG4gICAgYmF0Y2hFeGVjdXRlKHRhc2tzLCB7XFxuICAgICAgICBmdW5jOiBmdW5jdGlvbihwYXJhbSwgaWQsIGVycm9yLCByZXN1bHQpIHtcXG4gICAgICAgICAgICAvL2xvZyhcXFwibGlzdGVuZXI6IFxcXCIgKyAocmVzdWx0IHx8IFtdKS5sZW5ndGgpXFxuICAgICAgICAgICAgcGFyYW0uaSA9IHBhcmFtLmkgKyAxO1xcbiAgICAgICAgICAgIGlmIChyZXN1bHQpIHtcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaXQgb2YgcmVzdWx0KSB7XFxuICAgICAgICAgICAgICAgICAgICBwYXJhbS5qID0gcGFyYW0uaiArIDE7XFxuICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQmVmb3JlKHBhZ2VpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdC50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBpdC5kZXNjLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogaXQudXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGl0LnBpY191cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGl0LmNvbF90eXBlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBcXFwiX19hcHBcXFwiICsgTVlfUEFHRSArIFxcXCJAXFxcIiArIHBhcmFtLmpcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChwYXJhbS5pID49IHBhcmFtLmFsbCkge1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhZ2VpZClcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5q2j5Zyo5Yqg6L2956ysXFxcIiArIE1ZX1BBR0UgKyBcXFwi6aG177yM6L+b5bqm77yaXFxcIiArIChwYXJhbS5pICsgMSkgKyBcXFwiL1xcXCIgKyBwYXJhbS5hbGwsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgcGljX3VybDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBwYWdlaWRcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LFxcbiAgICAgICAgcGFyYW06IHtcXG4gICAgICAgICAgICBhbGw6IERhdGEubGVuZ3RoLFxcbiAgICAgICAgICAgIGk6IDAsXFxuICAgICAgICAgICAgajogLTFcXG4gICAgICAgIH1cXG4gICAgfSlcXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLmlbDmja7ovazmjaJcIixcInBhdGhcIjpcImNvbnZlclwiLFwicnVsZVwiOlwiLy9qczpcXG4vL3JlbShyZXMpO1xcbnZhciDorrDlvZUgPSBbXTtcXG52YXIg6L6T5YWl5p2h55uuID0gcmVtZmlsZS5tYXRjaCgvLis9aHR0cC4rL2cpO1xcbmZvciAodmFyIGogaW4g6L6T5YWl5p2h55uuKSB7XFxuICAgIHZhciB0aXRsZSA9IOi+k+WFpeadoeebrltqXS5zcGxpdCgnQCcpWzFdLnNwbGl0KCc9JylbMF07XFxuICAgIHZhciB1cmwgPSDovpPlhaXmnaHnm65bal0uc3BsaXQoJz0nKVsxXS5zcGxpdCgnIycpWzBdO1xcbiAgICB2YXIgaW1nID0g6L6T5YWl5p2h55uuW2pdLnNwbGl0KCcjJylbMV07XFxuICAgIGlmIChpbWcuaW5kZXhPZihcXFwiaHR0cFxcXCIpICE9IC0xKSB7XFxuICAgICAgICB2YXIgaW1nID0gaW1nO1xcbiAgICB9IGVsc2UgaWYgKGltZyA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgdmFyIGltZyA9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56We6amsXFxcIjtcXG4gICAgfVxcbiAgICDorrDlvZUucHVzaCh7XFxuICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgbXVybDogbXVybCxcXG4gICAgICAgIHR5cGU6IHR5cGVcXG4gICAgfSk7XFxufVxcbnZhciDmlrDorrDlvZUgPSBbXTtcXG5cXG5mb3IgKHZhciBpIGluIOiusOW9lSkge1xcbiAgICB2YXIg5b2T5YmN5p2h55uuID0gW107XFxuICAgIOW9k+WJjeadoeebri5wdXNoKOiusOW9lVtpXSk7XFxuICAgIGlmICjmlrDorrDlvZUubGVuZ3RoID09IDApIHtcXG4gICAgICAgIOaWsOiusOW9lS5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTog6K6w5b2VW2ldLnR5cGUsXFxuICAgICAgICAgICAgbGlzdDog5b2T5YmN5p2h55uuXFxuICAgICAgICB9KTtcXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIGxldCByZXMgPSDmlrDorrDlvZUuc29tZShpdGVtID0+IHtcXG4gICAgICAgICAgICAvL+WIpOaWreexu+Wei++8jOacieWwsea3u+WKoOWIsOW9k+WJjemhuVxcbiAgICAgICAgICAgIGlmIChpdGVtLnRpdGxlID09IOiusOW9lVtpXS50eXBlKSB7XFxuICAgICAgICAgICAgICAgIGl0ZW0ubGlzdCA9IOW9k+WJjeadoeebri5jb25jYXQoaXRlbS5saXN0LmZpbHRlcihkID0+IGQudXJsICE9IOiusOW9lVtpXS51cmwpKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWVcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGlmICghcmVzKSB7XFxuICAgICAgICAgICAgLy/lpoLmnpzmsqHmib7nm7jlkIznsbvlnovmt7vliqDkuIDkuKrnsbvlnotcXG4gICAgICAgICAgICDmlrDorrDlvZUucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiDorrDlvZVbaV0udHlwZSxcXG4gICAgICAgICAgICAgICAgbGlzdDog5b2T5YmN5p2h55uuXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgIH1cXG59XFxudmFyIG5ld2ZpbGUgPSB7fTtcXG5uZXdmaWxlLmRhdGEgPSDmlrDorrDlvZU7XFxuLy9sb2cocmVtZmlsZSk7XCJ9XSIsImljb24iOiJodHRwczovL2NvZGViZXJnLm9yZy9semsyMzU1OS9QdWJsaWNSdWxlL3Jhdy9icmFuY2gvbWFzdGVyL2FwcG1vdi5wbmciLCJwcm94eSI6IiJ9
Add Comment
Please, Sign In to add comment