Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@聚直播@eyJmaXJzdEhlYWRlciI6ImNsYXNzIiwibGFzdF9jaGFwdGVyX3J1bGUiOiIiLCJ0aXRsZSI6IuiBmuebtOaSrSIsImF1dGhvciI6IuWwj+ajieiihPCfjJ4mSm9rZXIiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IiwidmVyc2lvbiI6NywiY29sX3R5cGUiOiJpY29uXzJfcm91bmQiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6ImxpdmUiLCJjbGFzc191cmwiOiIiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbmV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFwiaGlrZXI6Ly9wYWdlL2NvbmZpZ1wiKSkucnVsZSk7IC8vZ2V0Q29uZmlnXG5cbmxldCBkYXRhID0gW10sXG4gICAgY29uZmlnID0gZ2V0Q29uZmlnKCk7XG5jb25maWcuZGF0YSA9IGNvbmZpZy5kYXRhLmZpbHRlcih2ID0+ICF2LmluVmlzaWJsZSk7XG5pZiAoY29uZmlnLmRhdGEubGVuZ3RoIDw9IDApIHtcbiAgICBkYXRhID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvcmVuZGVyU2V0dGluZycpLnJlbmRlclNldHRpbmcoKTtcbn0gZWxzZSB7XG4gICAgbGV0IHNlbGVjdCA9IGdldEl0ZW0oXCJsaXZlLXNlbGVjdFwiLCBjb25maWcuZGF0YVswXS5uYW1lKSxcbiAgICAgICAgaGFzID0gY29uZmlnLmRhdGEubWFwKGkgPT4gaS5uYW1lKS5pbmNsdWRlcyhzZWxlY3QpO1xuICAgIGlmICghaGFzKSB7XG4gICAgICAgIHNlbGVjdCA9IGNvbm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5kZXhPZigwKSwgMSlbMF0pO1xuICAgICAgICAgICAgICAgIGxldCBzZWxlY3RHcm91cCA9IGdldEl0ZW0oJ3NlbGVjdEdyb3VwJywgZ3JvdXBzWzBdKTtcbiAgICAgICAgICAgICAgICBpZiAoc2VsZWN0R3JvdXAgPT0gXCJcIiB8fCAhZ3JvdXBzLmluY2x1ZGVzKHNlbGVjdEdyb3VwKSkgc2VsZWN0R3JvdXAgPSBncm91cHNbMF07XG4gICAgICAgICAgICAgICAgZ3JvdXBzLmZvckVhY2goKGdyb3VwKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChncm91cCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogZ3JvdXAgPT0gc2VsZWN0R3JvdXAgPyBcIuKAnOKAnOKAneKAnTxzcGFuIHN0eWxlPSdjb2xvcjogIzE5Qjg5RCc+XCIgKyBncm91cCArIFwiPC9zcGFuPlwiIDogZ3JvdXAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChncm91cCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKCdzZWxlY3RHcm91cCcsIGdyb3VwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGdyb3VwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIGZvciAobGV0IHRpdGxlIGluIGl0ZW1zW3NlbGVjdEdyb3VwXSkge1xuICAgICAgICAgICAgICAgICAgICBkYXRhLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogaXRlbXNbc2VsZWN0R3JvdXBdW3RpdGxlXS51cmwsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaXRlbXNbc2VsZWN0R3JvdXBdW3RpdGxlXS5oZWFkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnaWNvbl8yX3JvdW5kJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXCJodHRwczovL2xhbm1laWd1b2ppYW5nLmNvbS90dWJpYW8vbW9yZS8yMjgucG5nXCJcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFwi5pWw5o2u5Yqg6L295aSx6LSlXFxuXCIgKyBKU09OLnN0cmluZ2lmeShlKSxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFwibG9uZ190ZXh0XCJcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICB9XG5cblxufVxuc2V0UmVzdWx0KGRhdGEpOyIsInNlYXJjaF91cmwiOiJoaWtlcjovL2VtcHR5P2tleT0qKiIsImdyb3VwIjoi4pGl55u05pKtIiwic2VhcmNoRmluZCI6ImpzOlxuZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXCJoaWtlcjovL3BhZ2UvY29uZmlnXCIpKS5ydWxlKTtcbmxldCBjb25maWcgPSBnZXRDb25maWcoKTtcbmxldCBydWxlcyA9IGNvbmZpZy5kYXRhLm1hcCgoc291cmNlKSA9PiB7XG4gICAgcmV0dXJuIHtcbiAgICAgICAgdGl0bGU6IHNvdXJjZS5uYW1lLFxuICAgICAgICBzZWFyY2hfdXJsOiAnaGlrZXI6Ly9lbXB0eT9rZXk9KionLFxuICAgICAgICBzZWFyY2hGaW5kOiAnanM6JyArICQudG9TdHJpbmcoKHVybCwgcnVsZV90aXRsZSkgPT4ge1xuICAgICAgICAgICAgbGV0IGQgPSBbXSxcbiAgICAgICAgICAgICAgICBrZXkgPSBnZXRQYXJhbSgna2V5Jyk7XG4gICAgICAgICAgICBsZXQgaXRlbXMgPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9yZW5kZXJEYXRhP3J1bGU9JyArIHJ1bGVfdGl0bGUpLnJlbmRlckxpdmVEYXRhKHVybCk7XG4gICAgICAgICAgICBmb3IgKGxldCBncm91cCBpbiBpdGVtcykge1xuICAgICAgICAgICAgICAgIGZvciAobGV0IHRpdGxlIGluIGl0ZW1zW2dyb3VwXSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGl0bGUuaW5kZXhPZihrZXkpID49IDAgfHwgdGl0bGUudG9Mb3dlckNhc2UoKS5pbmRleE9mKGtleSkgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAg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bmZpZyA9IGZldGNoKFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL2xpdmUvY29uZmlnLmpzb25cXFwiKTtcXG4gICAgICAgIGlmICghY29uZmlnIHx8IGNvbmZpZyA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgIGRhdGE6IFtdLFxcbiAgICAgICAgICAgICAgICB2ZXJzaW9uOiAwXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShjb25maWcpXFxuICAgICAgICB9XFxuICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgdG9hc3QoXFxcIumFjee9ruaWh+S7tuagvOW8j+acieivr1xcXCIpXFxuICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICBkYXRhOiBbXSxcXG4gICAgICAgICAgICB2ZXJzaW9uOiAwXFxuICAgICAgICB9XFxuICAgIH1cXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLmibnph4/lr7zlhaVcIixcInBhdGhcIjpcImJhdGNoSW1cIixcInJ1bGVcIjpcImZ1bmN0aW9uIGJhdGNoSW1wb3J0KGlucHV0LCBydWxlKSB7XFxuICAgIGlucHV0ID0gaW5wdXQudHJpbSgpO1xcbiAgICBpZiAoaW5wdXQubGVuZ3RoIDwgMyB8fCBpbnB1dFswXSAhPSBcXFwie1xcXCIpIHtcXG4gICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/or7fovpPlhaXmraPnoa7nmoTmoLzlvI9cXFwiXFxuICAgIH1cXG4gICAgbGV0IGltID0gSlNPTi5wYXJzZShpbnB1dCk7XFxuICAgIGlmIChpbS5kYXRhID09IG51bGwgfHwgaW0uZGF0YS5sZW5ndGggPCAxKSB7XFxuICAgICAg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cXFxceyguKilcXFxcfS8pWzFdLFxcbiAgICAgICAgICAgICAgICAgICAgIGFyciA9IGNvbi5zcGxpdCgnJiYnKTtcXG4gICAgICAgICAgICAgICAgYXJyLmZvckVhY2goKGkpPT57XFxuICAgICAgICAgICAgICAgICAgICBsZXQgW2tleSx2YWx1ZV0gPSBpLnNwbGl0KCdAJyk7XFxuICAgICAgICAgICAgICAgICAgICBvYmpba2V5XSA9IHZhbHVlLnJlcGxhY2UoLzsvZywn77yb77ybJyk7XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIGFycmF5W2luZGV4XSA9IHYubWF0Y2goL14oW147XSopO1xcXFx7LylbMV1cXG4gICAgICAgICAgICAgICAgaGVhZGVycy5wdXNoKG9iaik7XFxuICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnMucHVzaCh7J1VzZXItQWdlbnQnIDogTU9CSUxFX1VBLnJlcGxhY2UoLzsvZywn77yb77ybJyl9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgYXJyYXlbaW5kZXhdID0gYXJyYXlbaW5kZXhdLnJlcGxhY2UoLzsvZywn77yb77ybJykrJyNpc1ZpZGVvPXRydWUjJztcXG4gICAgICAgIH0pO1xcbiAgICAgICAgaWYgKGl0ZW1zW2dyb3VwXSkge1xcbiAgICAgICAgICAgIGlmIChpdGVtc1tncm91cF1bdGl0bGVdKSB7XFxuICAgICAgICAgICAgICAgIGl0ZW1zW2dyb3VwXVt0aXRsZV0udXJsID0gaXRlbXNbZ3JvdXBdW3RpdGxlXS51cmwuY29uY2F0KHVybCk7XFxuICAgICAgICAgICAgICAgIGl0ZW1zW2dyb3VwXVt0aXRsZV0uaGVhZGVycyA9IGl0ZW1zW2dyb3VwXVt0aXRsZV0uaGVhZGVycy5jb25jYXQoaGVhZGVycyk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaXRlbXNbZ3JvdXBdW3RpdG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5a+85YWl6K6i6ZiFXFxcIiksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpeebtOaSrea6kOiuoumYheWcsOWdgFxcXCIsXFxuICAgICAgICB1cmw6ICQoJycsICfor7fovpPlhaXorqLpmIXlnLDlnYAnKS5pbnB1dCgocnVsZSkgPT4ge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5LiN6IO95Li656m6XFxcIlxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQuaW5kZXhPZihcXFwiaHR0cFxcXCIpICE9IDAgJiYgaW5wdXQuaW5kZXhPZihcXFwiZmlsZVxcXCIpICE9IDAgJiYgaW5wdXQuaW5kZXhPZihcXFwiaGlrZXJcXFwiKSAhPSAwKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pk77mjqXmoLzlvI/mnInor69cXFwiXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoJycsXFxcIuivt+i+k+WFpeiuoumYheagh+mimFxcXCIpLmlucHV0KCh1cmwsIHJ1bGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL3BhZ2UvY29uZmlnP3J1bGU9XFxcIiArIHJ1bGUpKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBnZXRDb25maWcoKTtcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IGlucHV0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdXJsXFxuICAgICAgICAgICAgICAgICAgICB9KTtc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dldENvbG9yZWRUZXh0KFxcXCLlr7zlh7rlhajpg6hcXFwiKSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICB1cmw6ICQoW1xcXCLljp/lp4vmlbDmja5cXFwiLCBcXFwi5LqR5Ymq6LS05p2/XFxcIl0sIDEpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgcmV0dXJuICQoJ+ehruWumuWvvOWHuu+8n1xcXFxuKOemgeeUqOiuoumYheS4jeS8muWvvOWHuiknKS5jb25maXJtKCh0eXBlKSA9PiB7XFxuICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL3BhZ2UvY29uZmlnXFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICBjb25maWcgPSBnZXRDb25maWcoKTtcXG4gICAgICAgICAgICAgICAgY29uZmlnLmRhdGEgPSBjb25maWcuZGF0YS5maWx0ZXIodiA9PiAhdi5pblZpc2libGUpO1xcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PSBcXFwi5LqR5Ymq6LS05p2/XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRhdGEgPSAn6IGa55u05pKt5YiG5LqrIyNcXFxcbicgKyBzaGFyZVBhc3RlKEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRhdGEgPSBKU09OLnN0cmluZ2lmeShjb25maWcpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyBkYXRhO1xcbiAgICAgICAgICAgIH0sIGlucHV0KVxcbiAgICAgICAgfSlcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogZ2V0Q29sb3JlZFRleHQoXFxcIue8lui+keWFqOm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1dHRvbidcXG4gICAgICAgIH0pXFxuICAgIH0pO1xcbiAgICBjb25maWcuZGF0YS5mb3JFYWNoKCh2LCBpKSA9PiB7XFxuICAgICAgICBsZXQgZWwgPSB7XFxuICAgICAgICAgICAgdGl0bGU6IHYubmFtZSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfM1xcXCJcXG4gICAgICAgIH1cXG4gICAgICAgIHN3aXRjaCAoZWRpdE1vZGUpIHtcXG4gICAgICAgICAgICBjYXNlICflkK/nlKjnpoHnlKgnOlxcbiAgICAgICAgICAgICAgICBlbC50aXRsZSA9ICh2LmluVmlzaWJsZSA/ICfwn5S0ICcgOiAn8J+foiAnKSArIGVsLnRpdGxlXFxuICAgICAgICAgICAgICAgIGVsLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL3BhZ2UvY29uZmlnXFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnID0gZ2V0Q29uZmlnKCk7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YVtpXS5pblZpc2libGUgPSAhY29uZmlnLmRhdGFbaV0uaW5WaXNpYmxlO1xcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL2xpdmUvY29uZmlnLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICBjYXNlICfliKDpmaTorqLpmIUnOlxcbiAgICAgICAgICAgICAgICBlbC51cmwgPSBcXFwiY29uZmlybTovL+ehruiupOWIoOmZpOKAnFxcXCIgKyB2Lm5hbWUgKyBcXFwi4oCd6K6i6ZiF77yfLmpzOlxcXCIgKyAkLnRvU3RyaW5nKChuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdChcXFwiaGlrZXI6Ly9wYWdlL2NvbmZpZ1xcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZyA9IGdldENvbmZpZygpO1xcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGEgPSBjb25maWcuZGF0YS5maWx0ZXIoaSA9PiBpLm5hbWUgIT0gbmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3suWIoOmZpFxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIHYubmFtZSlcXG4gICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICBjYXNlICfph43mlrDmjpLluo8nOlxcbiAgICAgICAgICAgICAgICBsZXQgc29ydEZsYWcgPSBwYXJzZUludChnZXRNeVZhcignc29ydEZsYWcnLCAnLTEnKSlcXG4gICAgICAgICAgICAgICAgZWwudGl0bGUgPSAoc29ydEZsYWcgPT0gaSA/ICfwn5SDICAnIDogJycpICsgZWwudGl0bGVcXG4gICAgICAgICAgICAgICAgaWYgKHNvcnRGbGFnID09IC0xKVxcbiAgICAgICAgICAgICAgICAgICAgZWwudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzb3J0RmxhZycsIGkudG9TdHJpbmcoKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6YCJ5oup6KaB56e75Yqo5Yiw55qE5L2N572uJ1xcbiAgICAgICAgICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgZWwudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgob2xkSW5kZXgsIG5ld0luZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFwiKSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnID0gZ2V0Q29uZmlnKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGEuc3BsaWNlKG5ld0luZGV4LCAwLCBjb25maWcuZGF0YS5zcGxpY2Uob2xkSW5kZXgsIDEpWzBdKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9saXZlL2NvbmZpZy5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NvcnRGbGFnJywgJy0xJylcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgICAgICB9LCBzb3J0RmxhZywgaSlcXG4gICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICBjYXNlICfnvJbovpHorqLpmIUnOlxcbiAgICAgICAgICAgICAgICBsZXQgYXJyID0gWyfnvJbovpHlkI3np7AnLCAn57yW6L6R5Zyw5Z2AJywgJ+e8lui+keWGheWuuSddO1xcbiAgICAgICAgICAgICAgICBlbC51cmwgPSAkKGFyciwgMykuc2VsZWN0KCh2LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gJ+e8lui+keWQjeensCcpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCh2Lm5hbWUsICfovpPlhaXmlrDlkI3np7AnKS5pbnB1dCgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdChcXFwiaGlrZXI6Ly9wYWdlL2NvbmZpZ1xcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnID0gZ2V0Q29uZmlnKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGFbaV0ubmFtZSA9IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55oiQ5YqfJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S4jeiDveS4uuepuidcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGkpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PSAn57yW6L6R5Zyw5Z2AJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHYudXJsLCAn6L6T5YWl5paw5Zyw5Z2AJykuaW5wdXQoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFwiKSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZyA9IGdldENvbmZpZygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kuI3og73kuLrnqbpcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQuaW5kZXhPZihcXFwiaHR0cFxcXCIpICE9IDAgJiYgaW5wdXQuaW5kZXhPZihcXFwiZmlsZVxcXCIpICE9IDAgJiYgaW5wdXQuaW5kZXhPZihcXFwiaGlrZXJcXFwiKSAhPSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6ZO+5o6l5qC85byP5pyJ6K+vXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGFbaV0udXJsID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9saXZlL2NvbmZpZy5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv67mlLnmiJDlip8nXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT0gJ+e8lui+keWGheWuuScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodi51cmwuc3RhcnRzV2l0aCgnZmlsZTovLycpIHx8IHYudXJsLnN0YXJ0c1dpdGgoJ2hpa2VyOi8vZmlsZXMnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2VkaXRGaWxlOi8vJyArIHYudXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2VkaXRGaWxlOi8vaGlrZXI6Ly9maWxlcy9saWJzLycgKyBtZDUodi51cmwpICsgJy5qcydcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgdiwgaSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJ+a4hemZpOe8k+WtmCc6XFxuICAgICAgICAgICAgICAgIGVsLnVybCA9ICQoJ+ehruWumua4hemZpOKAnCcgKyB2Lm5hbWUgKyAn4oCd6K6i6ZiF57yT5a2Y77yfXFxcXG4o5Y+v56uL5Y2z5pu05pawKScpLmNvbmZpcm0oKHVybCk9PntcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUNhY2hlKHVybCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5riF6Zmk5oiQ5YqfJ1xcbiAgICAgICAgICAgICAgICB9LHYudXJsKVxcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaChlbClcXG4gICAgfSk7XFxuICAgIHJldHVybiBkO1xcbn1cXG5cXG4kLmV4cG9ydHMgPSB7XFxuICAgIHJlbmRlclNldHRpbmc6IHJlbmRlclNldHRpbmdcXG59XCJ9XSIsImljb24iOiJodHRwczovL2dpbWcyLmJhaWR1LmNvbS9pbWFnZV9zZWFyY2gvc3JjPWh0dHAlM0ElMkYlMkZpczQubXpzdGF0aWMuY29tJTJGaW1hZ2UlMkZ0aHVtYiUyRlB1cnBsZTMlMkZ2NCUyRmRmJTJGZjYlMkZkYSUyRmRmZjZkYTgzLTQ3ZDctOWNiNi0yMzk4LTE5MTljMTM4MzdiNCUyRm16bC5rZ21ud29kby5wbmclMkYweDBzcy04NS5qcGcmcmVmZXI9aHR0cCUzQSUyRiUyRmlzNC5tenN0YXRpYy5jb20mYXBwPTIwMDImc2l6ZT1mOTk5OSwxMDAwMCZxPWE4MCZuPTAmZz0wbiZmbXQ9anBlZz9zZWM9MTYzODYyOTM0OSZ0PTJmNmQ5NjcxODVmZTJiOWM1NGU4YjIzMGViODNlNjZjIiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment