xiaomianao666

小程序:道长仓库Pro

Aug 23rd, 2022
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@道长仓库Pro@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi6YGT6ZW/5LuT5bqTUHJvIiwiYXV0aG9yIjoiQExveURnSWsiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IiwidmVyc2lvbiI6MTQyLCJjb2xfdHlwZSI6Imljb25fMl9yb3VuZCIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoidG9vbCIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxuICAgIGNvbnN0IHtcbiAgICAgICAgZ2V0QXBpLFxuICAgICAgICBjb2xvcixcbiAgICAgICAgc21hbGwsXG4gICAgICAgIGdldEZpbGUsXG4gICAgICAgIGh0bWxUYWcsXG4gICAgICAgIGFwaSxcbiAgICAgICAgbWRcbiAgICB9ID0gJC5yZXF1aXJlKFwiaGlrZXI6Ly9wYWdlL3V0aWxpeVwiKTtcblxuY29uc3QgbHNnPSQucmVxdWlyZShcImhpa2VyOi8vcGFnZS9sb2NhbFN0b3JhZ2U/cnVsZT3pgZPplb/ku5PlupNQcm9cIik7XG5sZXQgY2xhc3NBID0gZ2V0VmFyKFwiV2FyZWhvdXNlLmNsYXNzXCIsIFwiMFwiKTtcbmxldCBsaXN0VXJsID0gZ2V0QXBpKFwidXNlcnNVcmxcIikgKyBjbGFzc0EsXG4gICAgbXlVcmwgPSBnZXRBcGkoXCJkZXZTZWxmXCIpO1xuICAgIC8vIG15VXJsID0gZ2V0QXBpKFwicnVsZXNBbGxVcmxcIik7XG5wdXRWYXIoXCJXYXJlaG91c2UuZ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AgICBsZXQgc2VwZXJhdG9yMiA9IFxcXCI6XFxcIjtcXG4gICAgICAgICAgICBsZXQgbW9udGggPSBkYXRlLmdldE1vbnRoKCkgKyAxO1xcbiAgICAgICAgICAgIGxldCBzdHJEYXRlID0gZGF0ZS5nZXREYXRlKCk7XFxuICAgICAgICAgICAgbGV0IHN0ckhvdXJzID0gZGF0ZS5nZXRIb3VycygpO1xcbiAgICAgICAgICAgIGxldCBzdHJNaW51dGVzID0gZGF0ZS5nZXRNaW51dGVzKCk7XFxuICAgICAgICAgICAgbGV0IHN0clNlY29uZHMgPSBkYXRlLmdldFNlY29uZHMoKSsxO1xcbiAgICAgICAgICAgIGlmIChtb250aCA+PSAxICYmIG1vbnRoIDw9IDkpIHtcXG4gICAgICAgICAgICAgICAgbW9udGggPSBcXFwiMFxcXCIgKyBtb250aFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoc3RyRGF0ZSA+PSAwICYmIHN0ckRhdGUgPD0gOSkge1xcbiAgICAgICAgICAgICAgICBzdHJEYXRlID0gXFxcIjBcXFwiICsgc3RyRGF0ZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoc3RySG91cnMgPj0gMCAmJiBzdHJIb3VycyA8PSA5KSB7XFxuICAgICAgICAgICAgICAgIHN0ckhvdXJzID0gXFxcIjBcXFwiICsgc3RySG91cnNcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHN0ck1pbnV0ZXMgPj0gMCAmJiBzdHJNaW51dGVzIDw9IDkpIHtcXG4gICAgICAgICAgICAgICAgc3RyTWludXRlcyA9IFxcXCIwXFxcIiArIHN0ck1pbnV0ZXNcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHN0clNlY29uZHMgPj0gMCAmJiBzdHJTZWNvbmRzIDw9IDkpIHtcXG4gICAgICAgICAgICAgICAgc3RyU2Vjb25kcyA9IFxcXCIwXFxcIiArIHN0clNlY29uZHNcXG4gICAgICAgICAg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W3sumHjee9ruW8gOWPkeiAheWIhuS6qyznroDku4vmn6XnnIss566A5LuL57yW6L6R562J6Z2Z5oCB5paH5Lu2XFxcIjtcXG4gICAgfSxhcGkuaG9zdCksXFxuICAgIGNvbF90eXBlOiAndGV4dF8zJ1xcbn0pO1xcbmxldCBkZXZTZXRCYWNrO1xcbnRyeSB7XFxuICAgIGRldlNldEJhY2sgPSBKU09OLnBhcnNlKHJlcXVlc3Qoc2V0dGluZ3NHZXRVcmwpKTtcXG59IGNhdGNoIChlKSB7XFxuICAgIGRldlNldEJhY2sgPSB7fTtcXG59XFxuXFxuZnVuY3Rpb24gc2V0U2V0dGluZ0l0ZW0oYmFzaWMpIHtcXG4gICAgbGV0IHRlbXAgPSB7XFxuICAgICAgICB0aXRsZTogYmFzaWMudGl0bGUsXFxuICAgICAgICBjb2xfdHlwZTogYmFzaWMuY29sX3R5cGUsXFxuICAgICAgICB1cmw6ICQoYmFzaWMuY29uZmlybSkuY29uZmlybSgodXJsLCBtc2cpID0+IHtcXG4gICAgICAgICAgICBsZXQgYmFjayA9IHJlcXVlc3QodXJsKTtcXG4gICAgICAgICAgICBsZXQgcmV0ID0gSlNPTi5wYXJzZShiYWNrKTtcXG4gICAgICAgICAgICBpZiAocmV0LnN0YXR1cyA9PSAwKSB7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIG1zZ1swXTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgbXNnWzFdICsgXFxcIlxcXFxuXFxcIiArIHJldC5kZXRhaWw7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwgYmFzaWMudXJsLCBiYXNpYy5tc2cpXFxuICAgIH07XFxuICAgIHJldHVybiB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gfSk7XFxufVxcbmlmIChydWxlQ29kZSkge1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLliIbkuqvop4TliJlcXFwiLFxcbiAgICAgICAgdXJsOiBcXFwiY29weTovL1xcXCIgKyBydWxlQ29kZSxcXG4gICAgICAgIGNvbF90eXBlOiBteV9jb2xfdHlwZVxcbiAgICB9KTtcXG59XFxuXFxuZnVuY3Rpb24gc2V0U2V0dGluZ0l0ZW0oYmFzaWMsIHBhdHRlcm4pIHtcXG4gICAgbGV0IHRlbXAgPSB7XFxuICAgICAgICB0aXRsZTogYmFzaWMudGl0bGUsXFxuICAgICAgICBjb2xfdHlwZTogYmFzaWMuY29sX3R5cGUsXFxuICAgICAgICB1cmw6ICQoYmFzaWMuY29uZmlybSkuY29uZmlybSgodXJsLCBtc2csIHBhdHRlcm4pID0+IHtcXG4gICAgICAgICAgICBsZXQgYmFja0EgPSByZXF1ZXN0KHVybCk7XFxuICAgICAgICAgICAgbGV0IHJldCA9IEpTT04ucGFyc2UoYmFja0EpO1xcbiAgICAgICAgICAgIGlmIChyZXQuc3RhdHVzID09IDApIHtcXG4gICAgICAgICAgICAgICAgcGF0dGVybiA/IGJhY2soKSA6IHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyBtc2dbMF07XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcGF0dGVybiA/IGJhY2soKSA6IHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyBtc2dbMV0gKyBcXFwiXFxcXG5cXFwiICsgcmV0LmRldGFpbDtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCBiYXNpYy51cmwsIGJhc2ljLm1zZywgcGF0dGVybilcXG4gICAgfTtcXG4gICAgcmV0dXJuIHRlbXA7XF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cXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+maj+acuuWvhueggeeUn+aIkOWksei0pVxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9KTtcXG4gICAgbGV0IHRpbWVPdmVyID0ge1xcbiAgICAgICAgY29sX3R5cGU6IG15X2NvbF90eXBlXFxuICAgIH07XFxuICAgIGlmIChkYXRhSXRlbS50aW1lX292ZXIpIHtcXG4gICAgICAgIHRpbWVPdmVyLnRpdGxlID0gc21hbGwoY29sb3IoXFxcIuefreaXtuWvhumSpVxcXCIsIFxcXCJncmVlblxcXCIpICsgY29sb3IoXFxcIijihpLmsLjkuYUpXFxcIiwgXFxcInJlZFxcXCIpKTtcXG4gICAgICAgIHRpbWVPdmVyLnVybCA9IGdldEFwaShcXFwidGltZW92ZXJcXFwiKSArIHJlcUJ5R2V0ICsgXFxcIiZmbGFnPTFcXFwiO1xcbiAgICAgICAgdGltZU92ZXIuY29uZmlybSA9IFxcXCLmmK/lkKbnoa7orqTku6XlkI7nmoTnp4Hol4/op4TliJnliIbkuqvkuI3ov4fmnJ8/XFxcIjtcXG4gICAgICAgIHRpbWVPdmVyLm1zZyA9IFtcXFwi5bey6K6+5Li65rC45LmFXFxcIiwgXFxcIuiuvuS4uuawuOS5heWksei0pVxcXCJdO1xcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgdGltZU92ZXIudGl0bGUgPSBzbWFsbChjb2xvcihcXFwi5rC45LmF5a+G6ZKlXFxcIiwgXFxcInJlZFxcXCIpICsgY29sb3IoXFxcIijihpLnn63ml7YpXFxcIiwgXFxcImdyZWVuXFxcIikpO1xcbiAgICAgICAgdGltZU92ZXIudXJsID0gZ2V0QXBpKFxcXCJ0aW1lb3ZlclxcXCIpICsgcmVxQnlHZXQ7XFxuICAgICAgICB0aW1lT3Zlci5jb25maXJtID0gXFxcIuehruiupOimgeS7peWQjuWIhuS6q+eahOengeiXj+inhOWImeiHquWKqOWIsOacnz9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TogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL1JlcGx5XFxcIixcXG4gICAgICAgICAgICBleHRyYTp7XFxuICAgICAgICAgICAgICAgIHJ1bGVJZDogZGF0YUl0ZW0uaWQsXFxuICAgICAgICAgICAgICAgIG5hbWU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgcGFzc3dvcmQ6IHBhc3N3b3JkLFxcbiAgICAgICAgICAgICAgICB1c2VybmFtZTogdXNlcm5hbWUsXFxuICAgICAgICAgICAgICAgIHJlcGx5SWQ6aXRlbS5pZFxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgcGljX3VybDogaXRlbS5hdmF0YXJfdXJsXFxuICAgICAgICB9KTtcXG4gICAgICAgIGRhdGEucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGl0ZW0uZGlzY3Vzc190ZXh0LFxcbiAgICAgICAgICAgIGRlc2M6IFJlcGx5K2l0ZW0uY3JlYXRlX2RhdGUgKyBcXFwiwrdcXFwiICsgaWNvbltpdGVtLmRpc2N1c3NfdHlwZV0sXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9pbmZvXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBuYW1lOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgIHR5cGU6IFxcXCJsb25nX3RleHRcXFwiLFxcbiAgICAgICAgICAgICAgICB0ZXh0OiBpdGVtLmRpc2N1c3NfdGV4dFxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgcGljX3VybDogaXRlbS5hdmF0YXJfdXJsXFxuICAgICAgICB9KTtcXG4gICAgfVxcbn1cXG5kYXRhLnB1c2goe1xcbiAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxufSk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AgXFxcInVzZXJuYW1lXFxcIjogZ2V0VmFyKCdob3VzZS51c2VybmFtZScpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBnZXRWYXIoJ2hvdXNlLnBhc3N3b3JkJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjYW5fdXBsb2FkXFxcIjogISFmbGFnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgY29kZSA9IEpTT04ucGFyc2UoY29kZSkucmVzdWx0O1xcbiAgICAgICAgICAgIGlmIChjb2RlLnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGUubWVzc2FnZVxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon8J+aq+emgeatouS4iuS8oCcsXFxuICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICB1cmw6JCgn56aB5q2i6K+l5byA5Y+R6ICF5LiK5Lyg6KeE5YiZP+S9oOeahOaTjeS9nOWwhuiiq+ezu+e7n+iusOW9lScpLmNvbmZpcm0oKGlkLGNhbl91cGxvYWRfYXBpLHNldFVwbG9hZCk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0VXBsb2FkKGZhbHNlLGNhbl91cGxvYWRfYXBpKTtcXG4gICAgICAgICAgICBpZighL+aTjeS9nOWksei0pS8udGVzdChyZXQpKXtcXG4g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bWFuYWdlcicpKXtcXG4gICAgZnVuY3Rpb24gc2V0SXNTYWZlKGZsYWcsbWFuX3J1bGVfc2FmZSkge1xcbiAgICAgICAgZmxhZyA9IGZsYWcgfHwgJyc7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxldCBjb2RlID0gZmV0Y2gobWFuX3J1bGVfc2FmZSwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUF9LFxcbiAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1c2VybmFtZVxcXCI6IGdldFZhcignaG91c2UudXNlcm5hbWUnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogZ2V0VmFyKCdob3VzZS5wYXNzd29yZCcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiaXNfc2FmZVxcXCI6ICEhZmxhZ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGNvZGUgPSBKU09OLnBhcnNlKGNvZGUpLnJlc3VsdDtcXG4gICAgICAgICAgICBpZiAoY29kZS5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBlLm1lc3NhZ2VcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBmdW5jdGlvbiBzZXRJc0dvb2QoZmxhZyxtYW5fcnVsZV9nb29kKSB7XFxuICAgICAgICBmbGFnID0gZmxhZyB8fCAnJztcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgbGV0IGNvZGUgPSBmZXRjaChtYW5fcnVsZV9nb29kLCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQX0sXFxuICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVzZXJuYW1lXFxcIjogZ2V0VmFyKCdob3VzZS51c2VybmFtZScpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBnZXRWYXIoJ2hvdXNlLnBhc3N3b3JkJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJpc19nb29kXFxcIjogISFmbGFnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgY29kZSA9IEpTT04ucGFyc2UoY29kZSkucmVzdWx0O1xcbiAgICAgICAgICAgIGlmIChjb2RlLnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGUubWVzc2FnZVxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon8J+aq+mjjumZqScsXFxuICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICB1cmw6JCgn5qCH6K6w6K+l6KeE5YiZ5Li66aOO6ZmpP+mjjumZqeinhOWImeaXoOazleiiq+WvvOWFpScpLmNvbmZpcm0oKGlkLG1hbl9ydWxlX3NhZmUsc2V0SXNTYWZlKT0+e1xcbiAgICAgICAgICAgIGxldCByZXQgPSBzZXRJc1NhZmUoZmFsc2UsbWFuX3J1bGVfc2FmZSk7XFxuICAgICAgICAgICAgaWYoIS/mk43kvZzlpLHotKUvLnRlc3QocmV0KSl7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrcmV0XFxuICAgICAgICB9LGRhdGFJdGVtLmlkLG1hbl9ydWxlX3NhZmUsc2V0SXNTYWZlKVxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOifinIXmraPluLgnLFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uuato+W4uD8nKS5jb25maXJtKChpZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0SXNTYWZlKHRydWUsbWFuX3J1bGVfc2FmZSk7XFxuICAgICAgICAgICAgaWYoIS/mk43kvZzlpLHotKUvLnRlc3QocmV0KSl7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrcmV0XFxuICAgICAgICB9LGRhdGFJdGVtLmlkLG1hbl9ydWxlX3NhZmUsc2V0SXNTYW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k55Sz6K+36KGoXFxcIik7XFxuICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChpbnB1dCwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInJlYXNvblxcXCI6IGRlc2NyaXB0aW9uLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogcGFzc3dvcmQsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicXFcXFwiOiB1c2VybmFtZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgbWV0aG9kOiAncG9zdCdcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG4gICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyAhPT0gMCkge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0LmRldGFpbDtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBpZHJlc3VsdCA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRJZCArIFxcXCI/cXE9XFxcIiArIHVzZXJuYW1lKSk7XFxuICAgICAgICBpZiAoaWRyZXN1bHQuc3RhdHVzICE9PSAwKSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyBpZHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICB9XFxuICAgICAgICBcXG4gICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6L6T5YWl6YKu566x6aqM6K+B56CBXFxcXG5cXFwiICsgcmVzdWx0LmRldGFpbCkuaW5wdXQoKGNvbmZpcm0sIGlkLCBhY2NvdW50KSA9PiB7XFxuICAgICAgICAgICAgc2hvd0xvYWRpbmcoXFxcIuivt+iAkOW/g+etieW+hVxcXCIpO1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGNvbmZpcm0sIHtcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJyZWdpc3RfaWRcXFwiOiBpZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInl6bVxcXCI6IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG4gICAgICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgIT09IDApIHtcXG4gICAgICAgICAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRWYXIoXFxcIldhcmVob3VzZVVzZXJuYW1lXFxcIiwgYWNjb3VudFswXSk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRWYXIoXFxcIldhcmVob3VzZVBhc3N3b3JkXFxcIiwgYWNjb3VudFsxXSk7XFxuICAgICAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+aIkOWKn+aPkOS6pOazqOWGjOazqOWGjFxcXFxuXFxcIityZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Ye66ZSZ5LqG5ZGQXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCBjb25maXJtLCBpZHJlc3VsdC5yZXN1bHQsIFt1c2VybmFtZSwgcGFzc3dvcmRdKTtcXG4gICAgfSwgZ2V0QXBpKFxcXCJuZXdfZ2V0SWRcXFwiKSwgZ2V0QXBpKFxcXCJuZXdfY29uZmlybVxcXCIpKSxcXG4gICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJ1xcbn0pO1xcbnNldFJlc3VsdChkYXRhKTtcIn0se1wiY29sX3R5cGVcIjpcInRleHRfMVwiLFwibmFtZVwiOlwi5Liq5Lq66LWE5paZXCIsXCJwYXRoXCI6XCJQZXJzb25hbERhdGFcIixcInJ1bGVcIjpcImpzOlxcbnNldFBhZ2VUaXRsZShcXFwi5Liq5Lq66LWE5paZXFxcIik7XFxudmFyIGRhdGE9W107XFxuY29uc3Qge1xcbiAgICBnZXRBcGksXFxuICAgIGdldEZpbGUsXFxuICAgIGFwa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ICAgICAgICAgICBpZiAobmV3UGV0TmFtZSA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L2g6L+Y5LuA5LmI6YO95rKh5aGr5ZWKIVxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGlucHV0ICsgXFxcIiZuYW1lPVxcXCIgKyBlbmNvZGVVUklDb21wb25lbnQobmV3UGV0TmFtZSkpO1xcbiAgICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KTtcXG4gICAgICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kv67mlLnmiJDlip9cXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0LmRldGFpbDtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcXG4gICAgfSk7XFxufVxcblxcbmZ1bmN0aW9uIG1fYXZhdGFyKCkge1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpeaWsOeahOWktOWDj+mTvuaOpVxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHRpdGxlVmlzaWJsZTogZmFsc2UsXFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRWYXIoJ1dhcmVob3VzZS5tLmF2YXRhc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hc3Q6Ly/ljp/lr4bnoIHplJnor69cXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZihuZXdfcGFzc3dvcmQ9PT1cXFwiXFxcIil7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/or7fovpPlhaXmlrDlr4bnoIFcXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZihuZXdfcGFzc3dvcmQhPT1uZXdfcGFzc3dvcmRfYWdhaW4pe1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Lik5qyh5a+G56CB5LiN5ZCMXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChpbnB1dCArIFxcXCImbmV3X3Bhc3N3b3JkPVxcXCIgKyBuZXdfcGFzc3dvcmQrXFxcIiZuZXdfcGFzc3dvcmRfcmU9XFxcIituZXdfcGFzc3dvcmRfYWdhaW4pO1xcbiAgICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KTtcXG4gICAgICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvV2FyZWhvdXNlVVNFUi5qc29uXFxcIixKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1c2VybmFtZTp1c2VybmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIHBhc3N3b3JkOm5ld19wYXNzd29yZFxcbiAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZ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gICAgICAgICAgcnVsZUlkOiBpZCxcXG4gICAgICAgICAgICAgICAgbmFtZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICBwYXNzd29yZDogcGFzc3dvcmQsXFxuICAgICAgICAgICAgICAgIHVzZXJuYW1lOiB1c2VybmFtZSxcXG4gICAgICAgICAgICAgICAgcmVwbHlJZDppdGVtLmlkXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwaWNfdXJsOiBpdGVtLmF2YXRhcl91cmxcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZGF0YS5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogaXRlbS5kaXNjdXNzX3RleHQsXFxuICAgICAgICAgICAgZGVzYzogUmVwbHkraXRlbS5jcmVhdGVfZGF0ZSArIFxcXCLCt1xcXCIgKyBpY29uW2l0ZW0uZGlzY3Vzc190eXBlXSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2luZm9cXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOntcXG4gICAgICAgICAgICAgICAgbmFtZTppdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgIHR5cGU6XFxcImxvbmdfdGV4dFxcXCIsXFxuICAgICAgICAgICAgICAgIHRleHQ6aXRlbS5kaXNjdXNzX3RleHRcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIHBpY191cmw6IGl0ZW0uYXZhdGFyX3VybFxcbiAgICAgICAgfSk7XFxuICAgICAgICBjb250cm9sKGl0ZW0uaWQsaXRlbS5hY3RpdmUpO1xcbiAgICB9XFxuICAgIGlmIChjb21tZW50TGlzdC5sZW5ndGggPT09IDApIHtcXG4gICAgICAgIGRhdGEucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbiAgICAgICAgfSk7XFxuICAgIH1cXG59XFxuXFxuc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oOi/mOS7gOS5iOmDveayoeWhq+WViiFcXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgc2hvd0xvYWRpbmcoXFxcIuiOt+WPluS4rS4uLlxcXCIpXFxuICAgICAgICByZXR1cm4gJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocXEsIGEsIGIpID0+IHtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoYSwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogcXFcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG4gICAgICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgbGV0IHJlc3VsdDIgPSBKU09OLnBhcnNlKHJlcXVlc3QoYiArIFxcXCI/cXE9XFxcIiArIHFxKSk7XFxuICAgICAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybi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uYnNwOyZuYnNwOzIuPHM+6aqM6K+B56CB5pyJ5pWI5pyf5oyB57ut5LiA5ZGo5bem5Y+zPC9zPijmmoLml7bkuI3kvJrvvIzlv5jorrDpqozor4HnoIHlj6/pgJrov4dRUeWPt+iOt+WPlik8L3NtYWxsPlxcXCJcXG59KTtcXG5cXG5sZXQgdXNlckxpc3QgPSBnZXRVc2VyRGF0ZSgpO1xcbmRhdGEucHVzaCh7XFxuICAgIHRpdGxlOiBcXFwi6aqM6K+BL+eZu+W9lVxcXCIsXFxuICAgIHVybDogJChcXFwi56Gu5a6a5L+d5a2Y77yM6aqM6K+B56CB5aGr6ZSZ77yM5peg5rOV6K+E6K665ZOmXFxcIikuY29uZmlybSgoZiwgbCwgbG9naW4pID0+IHtcXG4gICAgICAgIGxldCBxcSA9IGdldFZhcignV2FyZWhvdXNlLm0ucXEnLCAnJyk7XFxuICAgICAgICBsZXQgeXptID0gZ2V0VmFyKCdXYXJlaG91c2UubS55em0nLCAnJyk7XFxuICAgICAgICBpZiAocXEgPT0gXFxcIlxcXCIgfHwgeXptID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL3Fx5oiW6aqM6K+B56CB5Li656m6XFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGxvZ2luLCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicXFcXFwiOiBxcSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJhdXRoX2NvZGVcXFwiOiB5em1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgIGYudXNlciA9IFtxcSwgeXptXTtcXG4gICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvV2FyZWhvdXNlVVNFUi5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoZikpO1xcbiAgICAgICAgICAgIGxldCBpbmRleCA9IGwuZmluZEluZGV4KGl0ZW0gPT4gaXRlbVswXSA9PT0gcXEpO1xcbiAgICAgICAgICAgIGlmIChpbmRleCA+IC0xKSB7XFxuICAgICAgICAgICAgICAgIGwuc3BsaWNlKGluZGV4LCAxLCBbcXEsIHl6bV0pO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobC5sZW5ndGggPCA2KSB7XFxuICAgICAgICAgICAgICAgIGwucHVzaChbcXEsIHl6bV0pO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGwuc3BsaWNlKDAsIDEpO1xcbiAgICAgICAgICAgICAgICBsLnB1c2goW3FxLCB5em1dKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL1dhcmVob3VzZVVTRVJBLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShsKSk7XFxuICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pqozor4HmiJDlip9cXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQuZGV0YWlsO1xcbiAgICB9LCB1c2VyLCB1c2VyTGlzdCwgYXBpLmRpc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2JztcXG4gICAgICAgICAgICBsZXQgd2ViX3VybF9hcnIgPSBpbnB1dC5zcGxpdCgnOycpO1xcbiAgICAgICAgICAgIGxldCB3ZWJfdXJsID0gd2ViX3VybF9hcnJbMF07XFxuICAgICAgICAgICAgbGV0IGhlYWRlcnMgPSB7XFxuICAgICAgICAgICAgICAgICdSZWZlcmVyJzonaHR0cHM6Ly9ibG9nLmNzZG4ubmV0JyxcXG4gICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOnVhLFxcbiAgICAgICAgICAgICAgICAnQWNjZXB0JzonYXBwbGljYXRpb24vanNvbiwgdGV4dC9qYXZhc2NyaXB0LCAqLyo7IHE9MC4wMScsXFxuICAgICAgICAgICAgICAgICdBY2NlcHQtTGFuZ3VhZ2UnOid6aC1DTicsXFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBpZih3ZWJfdXJsX2Fyci5sZW5ndGg+PTMmJndlYl91cmxfYXJyWzJdLmxlbmd0aD4yKXsgLy/orr7nva7nvJbnoIFcXG4gICAgICAgICAgICAgICAgaGVhZGVyc1snY29udGVudC10eXBlJ10gPSAnY2hhcnNldD0nK3dlYl91cmxfYXJyWzJdLnRvVXBwZXJDYXNlKCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7aGVhZGVyczpoZWFkZXJzLHdpdGhIZWFkZXJzOmZhbHNlLHJlZGlyZWN0OmZhbHNlfTtcXG4gICAgICAgICAgICBpZih3ZWJfdXJsX2Fyci5sZW5ndGg+PTImJndlYl91cmxfYXJyWzFdLmxlbmd0aD4yKXsgLy8g6K6+572u6K+35rGC5pa55rOVXFxuICAgICAgICAgICAgICAgIHBhcmFtc1snbWV0aG9kJ10gPSB3ZWJfdXJsX2FyclsxXS50b1VwcGVyQ2FzZSgpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsb2coJ+W8gOWni+iOt+WPlua6kOeggScpO1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIC8qXFxuICAgICAgICAgICAgICAgIHJlcXVlc3RBc3luYyh3ZWJfdXJsLHBhcmFtcyxmdW5jdGlvbiAoa2V5LGNvZGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBiYWNrX2NvZGUgPSBjb2RlO1xcbiAgICAgICAgICAgICAgICAgICAgaWYoYmFja19jb2RlLmxlbmd0aD4yMCl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKCdob3VzZS51cGxvYWRfY29kZScsYmFja19jb2RlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5rqQ56CB5bey6I635Y+WLOW5tumDqOWIhuaPkuWFpeWIsOaWh+acrOWMuuWfnydcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/plJnor6/vvIzmnKzmrKHojrflj5bliLDnqbrmlofmnKzvvIznlpHkvLzkvaDmsqHmnInmraTmlofku7YhJztcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICovXFxuICAgICAgICAgICAgICAgIGxldCBiYWNrX2NvZGUgPSBnZXRJdGVtKCdob3VzZS5maWxlX3VhJyk9PT0n55S16ISRJz9mZXRjaCh3ZWJfdXJsLHBhcmFtcyk6cmVxdWVzdCh3ZWJfdXJsLHBhcmFtcyk7XFxuICAgICAgICAgICAgICAgIGlmKGJhY2tfY29kZS5sZW5ndGg+MjApe1xcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKCdob3VzZS51cGxvYWRfY29kZScsYmFja19jb2RlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+a6kOeggeW3suiOt+WPlizlubbpg6jliIbmj5LlhaXliLDmlofmnKzljLrln58nXFxuICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mUmeivr++8jOacrOasoeiOt+WPluWIsOepuuaWh+acrO+8jOeWkeS8vOS9oOayoeacieatpOaWh+S7tiEnO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIGxvZyhlLm1lc3NhZ2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5Y+R55Sf5LqG6ZSZ6K+vOlxcXFxuJytlLm1lc3NhZ2U7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfWVsc2UgaWYoL+S4u+mimO+/pXzlhYPntKDvv6UvLnRlc3QoaW5wdXQpKXtcXG4gICAgICAgICAgICBsb2coJ+S4u+mimOmTvuaOpScpO1xcbiAgICAgICAgICAgIGxldCB3ZWJfdXJsX2FyciA9IGlucHV0LnNwbGl0KCfvv6UnKTtcXG4gICAgICAgICAgICBsZXQgd2ViX3VybCA9IHdlYl91cmxfYXJyW3dlYl91cmxfYXJyLmxlbmd0aC0xXTtcXG4gICAgICAgICAgICBsZXQgYmFja19jb2RlID0gcGFyc2VQYXN0ZSh3ZWJfdXJsKTtcXG4gICAgICAgICAgICBpZihiYWNrX2NvZGUubGVuZ3RoPjIwKSB7XFxuICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2UudXBsb2FkX2NvZGUnLGJhY2tfY29kZSk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5rqQ56CB5bey6I635Y+WLOW5tumDqOWIhuaPkuWFpeWIsOaWh+acrOWMuuWfnydcXG4gICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mUmeivr++8jOacrOasoeiOt+WPlui/lOWbnuS4ujpcXFxcbicrYmFja19jb2RlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/pnZ7ms5Xpk77mjqU6XFxcXG4nK2dldFZhcignaG91c2Uud2ViX3VybCcpO1xcbiAgICAgICAgfVxcbiAgICB9KSxcXG4gICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCJcXG59KTtcXG5kLnB1c2goe1xcbiAgICB0aXRsZTogXFxcIumAieaLqeaWh+S7tui3r+W+hFxcXCIsXFxuICAgIHVybDokKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCgpPT57XFxuICAgICAgICBsZXQgZiA9IHJlcXVpcmUoXFxcImh0dHBzOi8vaGpkaG54LmNvZGluZy5uZXQvcC9oaWtlci9kL2RyL2dpdC9yYXcvbWFzdGVyL2pzL2ZpbGVTZWxlY3QuanNcXFwiKTtcXG4gICAgICAgIHJldHVybiBmLmZpbGVTZWxlY3Rpb25Vcmkoe1xcbiAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHRhcmdldCA9IGZpbmRJdGVtKFxcXCJmaWxlUGF0aFxcXCIpLmV4dHJhO1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKFxcXCJmaWxlUGF0aFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHRhcmdldCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogUEFUSFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2Uud2ViX3VybCcsUEFUSCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xcbiA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c2UudXBsb2FkX2NvZGUnLCcnKTtcXG4gICAgICAgICAgICBsZXQgZnR5cGUgPSAgZmlsZV90eXBlLmZpbHRlcihjb21wYXJlKGdldEl0ZW0oJ2hvdXNlLmZpbGVfdHlwZScsJ+mdmeaAgeaWh+S7ticpKSlbMF0udmFsdWU7XFxuICAgICAgICAgICAgbGV0IHJlZGlyZWN0ID0gZ2V0SXRlbSgnaG91c2UuZmlsZV9yZWRpcmVjdCcsJ+acrOWcsCcpIT09J+acrOWcsCc7XFxuICAgICAgICAgICAgbGV0IGNvZGUgPSAhcmVkaXJlY3Q/dXBfY29kZTppbnB1dDtcXG4gICAgICAgICAgICBsZXQgZW52ID0ge1xcbiAgICAgICAgICAgICAgICB3ZWJfdXJsOmdldFZhcignaG91c2Uud2ViX3VybCcsJycpLFxcbiAgICAgICAgICAgICAgICBkZXZpY2U6Z2V0SXRlbSgnaG91c2UuZmlsZV91YScsJ+eUteiEkScpLFxcbiAgICAgICAgICAgICAgICBmdHlwZTpmdHlwZXx8XFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgIHJlZGlyZWN0OnJlZGlyZWN0LFxcbiAgICAgICAgICAgICAgICBjb2RlOmNvZGUuc3Vic3RyaW5nKDAsNDApfHxcXFwiXFxcIixcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbG9nKGVudik7XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrSlNPTi5zdHJpbmdpZnkoZW52KTtcXG4gICAgICAgICAgICAvLyBhbGVydChKU09OLnN0cmluZ2lmeShlbnYpKTtcXG4gICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK2UubWVzc2FnZTtcXG4gICAgICAgICAgICAvLyBhbGVydChlLm1lc3NhZ2UpO1xcbiAgICAgICAgfVxcbiAgICB9LGZpbGVfdHlwZSxjb21wYXJlKVxcbn0pO1xcblxcbmQucHVzaCh7XFxuICAgIHRpdGxlOifwn5OD5pW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V0IHVwX2NvZGUgPSBnZXRWYXIoJ2hvdXNlLnVwbG9hZF9jb2RlJywnJyk7XFxuICAgICAgICBpZih1cF9jb2RlLmxlbmd0aCA8IDIpe1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mupDnoIHljLrml6DlhoXlrrnvvIzor7flhYjorr/pl67kuIDkuKrpnZnmgIHpobXpnaInXFxuICAgICAgICB9XFxuICAgICAgICBpZighY2FudXApe1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kvaDkuI3mmK/lvIDlj5HogIXvvIzmsqHmnInmj5DkuqTliLDku5PlupPnmoTmnYPliKkhJ1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IGlucHV0ID0gZ2V0VmFyKCdob3VzZS53ZWJfdXJsJywnJyk7XFxuICAgICAgICBsZXQgd2ViX3VybCA9IGlucHV0LnNwbGl0KCc7JylbMF07XFxuICAgICAgICBsZXQgZmlsZU5hbWUgPSAnJztcXG4gICAgICAgIGlmKC9eaGlrZXI6fF5maWxlOnxeaHR0cDp8Xmh0dHBzOnxeXFxcXC9zdG9yYWdlXFxcXC98XlxcXFwvc2RjYXJkXFxcXC8vLnRlc3Qod2ViX3VybCkpe1xcbiAgICAgICAgICAgIGZpbGVOYW1lID0gd2ViX3VybC5zcGxpdCgnLycpW3dlYl91cmwuc3BsaXQoJy8nKS5sZW5ndGgtMV07XFxuICAgICAgICB9ZWxzZSBpZigv5Li76aKY77+lfOWFg+e0oO+/pS8udGVzdChpbnB1dCkpe1xcbiAgICAgICAgICAgIGxldCBia2FyciA9IHVwX2NvZGUuc3BsaXQoJ++/pScpO1xcbiAgICAgICAgICAgIGlmKGJrYXJyLmxlbmd0aDwzKXtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S6keWJqui0tOadv+WGheWuueacieivrydcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgc3dpdGNoIChia2FyclsxXSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICdteV9ob21lX3RoZW1lJzpcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVOYW1lID0gdXBfY29kZS5zcGxpdCgn44CMJylbMV0uc3BsaXQoJ+OAjScpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ215X2hvbWVfc2luZ2xlJzpcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVOYW1lID0gdXBfY29kZS5zcGxpdCgn44CMJylbMV0uc3BsaXQoJ+OAjScpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ2pzX3VybCc6XFxuICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZSA9IHVwX2NvZGUuc3BsaXQoJ++/pScpWzJdLnNwbGl0KCdAJylbMF07XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6ZSZ6K+v77yM572R6aG16ZO+5o6l5peg5YaF5a65ISc7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgdWEgPSBnZXRJdGVtKCdob3VzZS5maWxlX3VhJyk9PT0n55S16ISRJz8nTW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzg4LjAuNDMyNC4xNDYgU2FmYXJpLzUzNy4zNic6J01vemlsbGEvNS4wIChMaW51eDsgQW5kcm9pZCA5OyBNSSA2KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvODkuMC40Mzg5LjkwIE1vYmlsZSBTYWZhcmkvNTM3LjM2JztcXG4gICAgICAgIGxldCBoZWFkZXJzID0ge1xcbiAgICAgICAgICAgICdSZWZlc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pO1xcbiAgICAgICAgICAgIHJldHVybiBsYXp5UGFyc2UoaW5wdXQpXFxuICAgICAgICB9KTtcXG4gICAgICAgIGZvcihsZXQgaSBpbiBsaXN0KXtcXG4gICAgICAgICAgICBsZXQgX3BpYyA9IHRbMl0/cGQobGlzdFtpXSx0WzJdKTonJztcXG4gICAgICAgICAgICBpZihpc1BpYyhfcGljKSYmIS9AUmVmZXJlcj0vLnRlc3QoX3BpYykpe1xcbiAgICAgICAgICAgICAgICBfcGljKz0nQFJlZmVyZXI9J1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgaXQ9e1xcbiAgICAgICAgICAgICAgICB0aXRsZTpwZGZoKGxpc3RbaV0sdFsxXSksXFxuICAgICAgICAgICAgICAgIHBpY191cmw6X3BpYyxcXG4gICAgICAgICAgICAgICAgZGVzYzpwZGZoKGxpc3RbaV0sdFszXSksXFxuICAgICAgICAgICAgICAgIHVybDplaj9wZChsaXN0W2ldLHRbNF0pOnBkKGxpc3RbaV0sdFs0XSkrbGF6eVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgaWYodC5sZW5ndGg+NSl7Ly/lhoXlrrnvvIznlKjkuo7mkJzntKJcXG4gICAgICAgICAgICAgICAgaXQuY29udGVudD1wZGZoKGxpc3RbaV0sdFs1XSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgZC5wdXNoKGl0KTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmKG9ubHliYWNrKXtcXG4gICAgICAgICAgICByZXR1cm4gZFxcbiAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgc2V0UmVzdWx0KGQpXFxuICAgICAgICB9XFxuICAgIH0scGFyU3RyLGVqLG9ubHliYWNrLGh0bWwsaXNQaWMpXFxufVxcblxcbmZ1bmN0aW9uIGlzQmFkVmlkZW8odmlkZW9VcmwpIHsvL+aYr+Wdj+eahOinhumikVxcbiAgICBsZXQgZG1QYXRoID0gJ2hpa2VyOi8vZmlsZXMvY2FjaGUvZGlhb21hby50eHQnOy8v5ZCK5q+b5qih5byP6L+H5ruk5paH5Lu26Lev5b6EXFxuICAgIGxldCBkbVVybHM7XFxuICAgIHRyeSB7XFxuICAgICAgICBkbVVybHMgPSByZXF1ZXN0KGRtUGF0aCkudHJpbSgpLnNwbGl0KCdcXFxcbicpLmZpbHRlcihpdCA9PiBpdCAmJiAhaXQuc3RhcnRzV2l0aCgnLy8nKSk7XFxuICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIGRtVXJscyA9IFtdO1xcbiAgICB9XFxuXFxuICAgIGZ1bmN0aW9uIGhhc0RtKHZpZGVvVXJsLCBkbVVybHMpIHsvL+aSreaUvuWcsOWdgOaYr+WQpuS4uuWQiuavm+inhumikVxcbiAgICAgICAgaWYgKGRtVXJscy5sZW5ndGggPCAxKSB7XFxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlXFxuICAgICAgICB9XFxuICAgICAgICBmdW5jdGlvbiBwcmludChzdHIpe1xcbiAgICAgICAgICAgIGlmKHR5cGVvZihsb2cpIT09J3VuZGVmaW5lZCcpe1xcbiAgICAgICAgICAgICAgICBsb2coc3RyKTtcXG4gICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgZmJhLmxvZyhzdHIpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAobGV0IGRtVXJsIG9mIGRtVXJscykge1xcbiAgICAgICAgICAgIGlmICgobmV3IFJlZ0V4cChkbVVybCkpLnRlc3QodmlkZW9VcmwpKSB7Ly/mkq3mlL7lnLDlnYDljIXlkKvlkIrmr5vmoIflv5fnmoTlnLDlnYBcXG4gICAgICAgICAgICAgICAgcHJpbnQoJ+WQiuavm+inhumikSzoh6rliqjov4fmu6Q6Jyt2aWRlb1VybCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcHJpbnQoJ+mdnuW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YWRpbmcoJ+WXheaOouS4re+8jOiLpeWksei0peWwseWIh+aNondlYuWXheaOoi4uLicpO1xcbiAgICAgICAgbGV0IF94NSA9ICQudG9TdHJpbmcoKGlzVmlkZW8scmVjaGFuZ2UscGxheVVybCxtYXhfY291bnQsUENfVUEsaXNCYWRWaWRlbyk9PntcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBpZih0eXBlb2YoZmJhKT09J3VuZGVmaW5lZCd8fCFmYmEpe1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZiYSA9IGZ5X2JyaWRnZV9hcHA7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmKHR5cGVvZihyZXF1ZXN0KT09J3VuZGVmaW5lZCd8fCFyZXF1ZXN0KXtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKGZiYS5nZXRJbnRlcm5hbEpzKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBmYmEucHV0VmFyKFxcXCJfeDVqeFVybFxcXCIscGxheVVybCk7XFxuICAgICAgICAgICAgICAgIGlmKHdpbmRvdy5jb3VudCA9PSBudWxsKXtcXG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jb3VudD0xO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCB0ZXh0PScnO1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgdGV4dD1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKFxcXCJib2R5XFxcIikuaW5uZXJUZXh0O1xcbiAgICAgICAgICAgICAgICB9Y2F0Y2ggKGUpIHtmYmEubG9nKGUubWVzc2FnZSl9XFxuICAgICAgICAgICAgICAgIGlmKC/op6blj5HkuobpmLLnm5fpk7585pyq5o6I5p2DfOaOpeWPo+mYsuebly8udGVzdCh0ZXh0KSYmd2luZG93LmNvdW50PT09MSl7XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLmo4DmtYvliLDmnInmjojmnYPvvIzlvIDlp4vov4fmjojmnYNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9jYXRpb24ucmVsb2FkKCk7XFxuICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbi5ocmVmPWZiYS5nZXRWYXIoXFxcIl94NWp4VXJsXFxcIik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgd2luZG93LmNvdW50Kys7XFxuICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coJ2NvdW50Oicrd2luZG93LmNvdW50KycsbWF4X2NvdW50OicrbWF4X2NvdW50KTtcXG4gICAgICAgICAgICAgICAgaWYoIHdpbmRvdy5jb3VudCA+PSBtYXhfY291bnQpe1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi6LaF6L+HXFxcIittYXhfY291bnQqMjUwK1xcXCLmr6vnp5LmnKrojrflj5bliLDotYTmupDlnLDlnYDvvIzot7PliLDmupDnvZHpobUs5Lul5LiL5piv5Yqg6L296L+H55qE5Zyw5Z2AXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ZXh0PWRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoXFxcImJvZHlcXFwiKS5pbm5lclRleHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyh0ZXh0KTtcXG4gICAgICAgICAgICAgICAgICAgIH1jYXRjaCAoZSkge2ZiYS5sb2coZS5tZXNzYWdlKX1cXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coSlNPTi5zdHJpbmdpZnkoX2dldFVybHMoKSkpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZiYS5nZXRWYXIoXFxcIl94NWp4VXJsXFxcIik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gbXV0ZU1lKGVsZW0pIHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5wYXVzZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB2YXIgdmlkZW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwidmlkZW9cXFwiKSwgYXVkaW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiYXVkaW9cXFwiKSwgdjIgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCJlbWJlZFxcXCIpLCB2MyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcIiNwbGF5ZXJcXFwiKTtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2aWRlb3MsIGZ1bmN0aW9uICh2aWRlbykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG11dGVNZSh2aWRlbyk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbChhdWRpb3MsIGZ1bmN0aW9uIChhdWRpbykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG11dGVNZShhdWRpbyk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MiwgZnVuY3Rpb24gKHYpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MywgZnVuY3Rpb24gKHYpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdmFyIHVybHMgPSBfZ2V0VXJscygpO1xcbiAgICAgICAgICAgICAgICAvLyBmYmEubG9nKEpTT04uc3RyaW5naWZ5KHVybHMpKTtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGZvcihsZXQgaSBpbiB1cmxzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHU9dXJsc1tpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnl7dT1kZWNvZGVVUklDb21wb25lbnQodSk7fWNhdGNoKGUpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1PXVuZXNjYXBlKHUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAvL1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmKC91cmw9aHR0cC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXCJ1cmw9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKFxcXCJ1cmzliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdXJsPVxcXFwvLy50ZXN0KHUpJiYvXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QgPSB1Lm1hdGNoKC8oLiopXFxcXC9cXFxcLyguKj8pXFxcXC8vKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGhvc3QrdS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhcXFwidXJs5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL3ZpZD1odHRwLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IHUuc3BsaXQoXFxcInZpZD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcInZpZOWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC92aWQ9XFxcXC8vLnRlc3QodSkmJi9cXFxcLm0zdTgvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaG9zdCA9IHUubWF0Y2goLyguKilcXFxcL1xcXFwvKC4qPylcXFxcLy8pWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gaG9zdCt1LnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCJ2aWTliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvXFxcXD8oLiopPWh0dHAvLnRlc3QodSkmJi9cXFxcLm0zdTgvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHBcXFwiK3Uuc3BsaXQoL1xcXFw/KC4qKT1odHRwLykuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLlhbbku5bliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy98aW5kZXhcXFxcLm0zdTgkXFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvXFxcXC8xXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHU9dS5yZXBsYWNlKC8mZnJvbT0uKnwmbmV4dD0uKnwmanVtcD0uKi8sJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZWFsVXJsID0gaXNWaWRlbyh1LHJlY2hhbmdlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZih0eXBlb2YocmVhbFVybCk9PSdzdHJpbmcnJiYhaXNCYWRWaWRlbyh1KSl7Ly/ov4fmu6TlkIrmr5vop4bpopFcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9meV9icmlkZ2VfYXBwLnNldFdlYlVhKFBDX1VBKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodHlwZW9mKGZiYS5nZXRIZWFkZXJVcmwpIT09J3VuZGVmaW5lZCcmJnR5cGVvZihyZWNoYW5nZSkhPT0nZnVuY3Rpb24nKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxldCBiYWNrVXJsID0gZmJhLmdldEhlYWRlclVybCh1LnJlcGxhY2UoXFxcIjt7XFxcIixcXFwiI2lzVmlkZW89dHJ1ZSM7e1xcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBiYWNrVXJsID0gZmJhLmdldEhlYWRlclVybCh1cmxzW2ldKS5yZXBsYWNlKCc7eycsJyNpZ25vcmVJbWc9dHJ1ZSMjaXNWaWRlbz10cnVlIzt7Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdTEgPSBiYWNrVXJsLnNwbGl0KCcjaWdub3JlSW1nJylbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdTIgPSAnI2lnbm9yZUltZycrYmFja1VybC5zcGxpdCgnI2lnbm9yZUltZycpWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSB1MS5yZXBsYWNlKC8mZnJvbT0uKnwmbmV4dD0uKnwmanVtcD0uKi8sJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoL3VybD1odHRwLy50ZXN0KHUxKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSB1MS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC91cmw9XFxcXC8vLnRlc3QodTEpJiYvXFxcXC5tM3U4Ly50ZXN0KHUxKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QxID0gdTEubWF0Y2goLyguKilcXFxcL1xcXFwvKC4qPylcXFxcLy8pWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gaG9zdDErdTEuc3BsaXQoXFxcInVybD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhcXFwidXJs5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC92aWQ9aHR0cC8udGVzdCh1MSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gdTEuc3BsaXQoXFxcInZpZD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdmlkPVxcXFwvLy50ZXN0KHUxKSYmL1xcXFwubTN1OC8udGVzdCh1MSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3N0MSA9IHUxLm1hdGNoKC8oLiopXFxcXC9cXFxcLyguKj8pXFxcXC8vKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IGhvc3QxK3UxLnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvXFxcXD8oLiopPWh0dHAvLnRlc3QodTEpJiYvXFxcXC5tM3U4Ly50ZXN0KHUxKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSBcXFwiaHR0cFxcXCIrdTEuc3BsaXQoL1xcXFw/KC4qKT1odHRwLykuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja1VybCA9IHUxICsgdTI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKCfov5Tlm57oh6rliqjliqBjb29raWXpk77mjqU6JytiYWNrVXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coJ+i/lOWbnumTvuaOpTonK3UrJ+W5tuiHquWKqOWKoOS6hmNvb2tpZSzlhbfkvZNjb29raWXlnKjop4bpopHmkq3mlL7lpITmn6XnnIsnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBiYWNrVXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLov5Tlm57ku5PlupN4NeWFjeWXhee7k+aenDpcXFwiK3JlYWxVcmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlYWxVcmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKGUubWVzc2FnZSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAvLyBmeV9icmlkZ2VfYXBwLmxvZygneDXlpKfojIPlm7TplJnor686JytlLm1lc3NhZ2UpO1xcbiAgICAgICAgICAgICAgICBhbGVydCgneDXlpKfojIPlm7TplJnor686JytlLm1lc3NhZ2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5oql6ZSZ57uT5p2feDUnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSxpc1ZpZGVvLHJlY2hhbmdlLHBsYXlVcmwsbWF4X2NvdW50LFBDX1VBLGlzQmFkVmlkZW8pO1xcbiAgICAgICAgbGV0IHVzZVdlYj1sc2cuZ2V0SXRlbShcXFwi6YC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AgICAgICAgICBpZiAod2luZG93LmNvdW50ID09IG51bGwpIHtcXG4gICAgICAgICAgICAgICAgd2luZG93LmNvdW50ID0gMTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHRleHQ9Jyc7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgdGV4dD1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKFxcXCJib2R5XFxcIikuaW5uZXJUZXh0O1xcbiAgICAgICAgICAgIH1jYXRjaCAoZSkge2ZiYS5sb2coZS5tZXNzYWdlKX1cXG4gICAgICAgICAgICBpZigv6Kem5Y+R5LqG6Ziy55uX6ZO+fOacquaOiOadg3zmjqXlj6PpmLLnm5cvLnRlc3QodGV4dCkmJndpbmRvdy5jb3VudD09MSl7XFxuICAgICAgICAgICAgICAgIGxvY2F0aW9uLnJlbG9hZCgpO1xcbiAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLmo4DmtYvliLDmnInmjojmnYPvvIzlvIDlp4vov4fmjojmnYNcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgd2luZG93LmNvdW50Kys7XFxuICAgICAgICAgICAgLy8gZmJhLmxvZygnY291bnQ6JyArIHdpbmRvdy5jb3VudCArICcsbWF4X2NvdW50OicgKyBtYXhfY291bnQpO1xcbiAgICAgICAgICAgIGlmICh3aW5kb3cuY291bnQgPj0gbWF4X2NvdW50KSB7XFxuICAgICAgICAgICAgICAgIGZiYS5jbGVhclZhcigneDVMaXN0Jyk7XFxuICAgICAgICAgICAgICAgIGZiYS5oaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICBsZXQgZm1zZyA9ICfpgZPplb/ku5PlupPpgJrlhY3op6PmnpDlpLHotKUs5Y6f5ZugOui2heaXticreDVUaW1lb3V0Kyfmr6vnp5InO1xcbiAgICAgICAgICAgICAgICBmYmEubG9nKGZtc2cpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJytmbXNnO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKTtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGZ1bmN0aW9uIG11dGVNZShlbGVtKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgZWxlbS5wYXVzZSgpO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuXFxuICAgICAgICB2YXIgdmlkZW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwidmlkZW9cXFwiKSwgYXVkaW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiYXVkaW9cXFwiKSxcXG4gICAgICAgICAgICB2MiA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcImVtYmVkXFxcIiksIHYzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiI3BsYXllclxcXCIpO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodmlkZW9zLCBmdW5jdGlvbiAodmlkZW8pIHtcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKHZpZGVvKTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIH1cXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKGF1ZGlvcywgZnVuY3Rpb24gKGF1ZGlvKSB7XFxuICAgICAgICAgICAgICAgIG11dGVNZShhdWRpbyk7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICB9XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MiwgZnVuY3Rpb24gKHYpIHtcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKHYpO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgfVxcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodjMsIGZ1bmN0aW9uICh2KSB7XFxuICAgICAgICAgICAgICAgIG11dGVNZSh2KTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIH1cXG4gICAgICAgIHZhciB1cmxzID0gX2dldFVybHMoKTtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgZm9yIChsZXQgaSBpbiB1cmxzKSB7XFxuICAgICAgICAgICAgICAgIGxldCB1PXVybHNbaV07XFxuICAgICAgICAgICAgICAgIC8vdT1kZWNvZGVVUklDb21wb25lbnQodSk7XFxuICAgICAgICAgICAgICAgIHRyeXt1PWRlY29kZVVSSUNvbXBvbmVudCh1KTt9Y2F0Y2goZSl7XFxuICAgICAgICAgICAgICAgICAgICB1PXVuZXNjYXBlKHUpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmKC91cmw9aHR0cC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICB1ID0gdS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYoL3ZpZD1odHRwLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICB9ZWxzZSBpZigvXFxcXD8oLiopPWh0dHAvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwXFxcIit1LnNwbGl0KC9cXFxcPyguKik9aHR0cC8pLnNsaWNlKC0xKVswXTtcXG4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W1lK1xcXCIubTN1OFxcXCI7XFxuICAgICAgICAgICAgLy93cml0ZUZpbGUobGNhY2hlLGJhY2tjb2RlKTtcXG4gICAgICAgICAgICAvL3ZpZGVvcy5wdXNoKGxjYWNoZSk7XFxuICAgICAgICAgICAgbGV0IHBVcmw9Y2FjaGVNM3U4KHR1cmwpO1xcbiAgICAgICAgICAgIHZpZGVvcy5wdXNoKHBVcmwpO1xcbiAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgfVxcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgdXJsID0gSlNPTi5wYXJzZShiYWNrY29kZSkudXJsO1xcbiAgICAgICAgICAgIGlmKC9eaHR0cC8udGVzdCh1cmwpKXtcXG4gICAgICAgICAgICAgICAgbGV0IHJlYWxWaWRlbyA9IGlzVmlkZW8odXJsKTtcXG4gICAgICAgICAgICAgICAgaWYodHlwZW9mKHJlYWxWaWRlbyk9PSdzdHJpbmcnKXtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh0bmFtZSsn5bey6Kej5p6Q5Ye66KeG6aKROicrcmVhbFZpZGVvKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmKGpuYW1lKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWFsVmlkZW8rPVxcXCLimIVcXFwiK2puYW1lXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB2aWRlb3MucHVzaChyZWFsVmlkZW8pO1xcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh0bmFtZSsn6Kej5p6Q5Ye65LiN55+l6YGT5LuA5LmI5Lic6KW/OicrdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIHVybCs9XFxcIiNpc1ZpZGVvPXRydWUjXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGlmKGpuYW1lKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwrPVxcXCLimIVcXFwiK2puYW1lXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB2aWRlb3MucHVzaCh1cmwpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgIGxvZyh0bmFtZSsn5Li6anNvbuaOpeWPo+S4lOaXoOi/lOWbnuinhumikeWcsOWdgOaVsOaNrjonK3BsYXlVcmxMaXN0W2ldKydcXFxcbicrYmFja2NvZGUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyh0bmFtZSsn5Li6eDXmjqXlj6Ms5Yqg5YWleDXll4XmjqLliJfooagnKTtcXG4gICAgICAgICAgICB4NWxpc3QucHVzaChwbGF5VXJsTGlzdFtpXSk7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgLy8gbG9nKHZpZGVvcyk7XFxuICAgIGlmKHZpZGVvcy5sZW5ndGg+MCl7XFxuICAgICAgICBpZihnZXRWYXIoJ2RwLmNhY2hlVmlkZW8nLCd0cnVlJyk9PT0ndHJ1ZScmJnBhcnNlSW50KGdldEFwcFZlcnNpb24oKSk+PTIyNTUpXFxuICAgICAgICB7XFxuICAgICAgICAgICAgbG9nKFxcXCLlsIrmlaznmoTprZTmlq3nlKjmiLfvvIzop4bpopHnvJPlrZjlt7LlkK/nlKjvvIzor7flsL3mg4Xkuqvlj5fnnIvliafml7blhYlcXFwiKTtcXG4gICAgICAgICAgICBsZXQgdmlkZW9zQ2FjaGU9dmlkZW9zLm1hcCgoaXQpPT57XFxuICAgICAgICAgICAgICAgIGxldCBoZWFkZXJzPXt9O1xcbiAgICAgICAgICAgICAgICBpZihpdC5zcGxpdChcXFwiO1xcXCIpLmxlbmd0aD4xKXtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBoZWFkID0gaXQuc3BsaXQoJzsnKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmKC9ALy50ZXN0KGhlYWQpJiYve3x9Ly50ZXN0KGhlYWQpKXtcXG4vL2hlYWQgPSBoZWFkLnJlcGxhY2UoL3t8fS9nLCcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkID0gaGVhZC5zcGxpdChcXFwie1xcXCIpWzFdLnNwbGl0KFxcXCJ9XFxcIilbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZCA9IGhlYWQuc3BsaXQoJyYmJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yKGxldCBpIGluIGhlYWQpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQga2V5ID0gaGVhZFtpXS5zcGxpdCgnQCcpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmFsdWUgPWhlYWRbaV0uc3BsaXQoJ0AnKVsxXS5yZXBsYWNlKC87Lywn77yb77ybJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnNba2V5XSA9IHZhbHVlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgdXJsOml0LnNwbGl0KFxcXCI7XFxcIilbMF0uc3BsaXQoXFxcIuKYhVxcXCIpWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uczp7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczpoZWFkZXJzXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB2YXIgZGF0YT1iYXRjaENhY2hlTTN1OCh2aWRlb3NDYWNoZSk7XFxuICAgICAgICAgICAgZGF0YT1kYXRhLm1hcCgoaXQsaWQpPT57XFxuICAgICAgICAgICAgICAgIGxldCBleHRyYT1cXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgaWYodmlkZW9zW2lkXS5zcGxpdChcXFwiO1xcXCIpLmxlbmd0aD4xKXtcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhPVxcXCI7XFxcIit2aWRlb3NbaWRdLnNwbGl0KFxcXCI7XFxcIilbMV07XFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKHZpZGVvc1tpZF0uc3BsaXQoXFxcIuKYhVxcXCIpLmxlbmd0aD4xKXtcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhPVxcXCLimIVcXFwiK3ZpZGVvc1tpZF0uc3BsaXQoXFxcIuKYhVxcXCIpWzFdO1xcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIGlmKGl0K1xcXCJcXFwiIT1cXFwibnVsbFxcXCIpe1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGl0K2V4dHJhXFxuICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZpZGVvc1tpZF1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIC8vbG9nKGRhdGEpO1xcbiAgICAgICAgICAgIHJldHVybiBkYXRhXFxuICAgICAgICAgICAgLy9yZXR1cm4gdmlkZW9zXFxuICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICByZXR1cm4gdmlkZW9zXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgbG9nKCflhbHmnIknK3g1bGlzdC5sZW5ndGgrJ+S4qng15Zyw5Z2A6L+b6KGM6L2u5rWB5ZeF5o6iJyk7XFxuICAgIC8v5rKh5pyJ55qE6K+d5bCx5byA5aeL5L6d5qyheDXll4XmjqJcXG4gICAgc2hvd0xvYWRpbmcoJ+WXheaOouS4re+8jOiLpeWksei0peWwseWIh+aNondlYuWXheaOoi4uLicpO1xcbiAgICByZXR1cm4geDVQYXJzZVBybyh4NWxpc3QseDVUaW1lb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4gdGhpcy5yZXBsYWNlKC8oXlxcXFxzKil8KFxcXFxzKiQpL2csIFxcXCJcXFwiKTsgfTtcXG5mdW5jdGlvbiB0YXNrX3JlcSh0YXNrX2FwaSx0YXNrKSB7IC8vIOmAmueUqOWPkemAgeS7k+W6k3Bvc3TosIPnlKjku7vliqHor7fmsYJcXG4gICAgY29uc3Qge2dldEZpbGV9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdXRpbGl5P3J1bGU96YGT6ZW/5LuT5bqTUHJvXFxcIik7XFxuICAgIGxldCBob3VzZUZpbGUgPSBnZXRGaWxlfHxmYWxzZTtcXG4gICAgaWYoIWhvdXNlRmlsZSl7XFxuICAgICAgICBzZXRJdGVtKCdpc19ob3VzZV92aXAnLCAnZmFsc2UnKTtcXG4gICAgfVxcbiAgICBsZXQgaG91c2VfZGF0YSA9IGhvdXNlRmlsZSgpO1xcbiAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdCh0YXNrX2FwaSwge1xcbiAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgIH0sXFxuICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgXFxcImRhdGFcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwidHlwZVxcXCI6IHRhc2subW9kZXx8J3J1bicsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiZnVuY1xcXCI6IHRhc2suZnVuY3x8JycsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjogdGFzay5wYXJhbXN8fFtdXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIFxcXCJhdXRoXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBob3VzZV9kYXR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OWFrOWRilxcXCIsXFxuICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgIHVybDokKCfnoa7orqTkv53lrZjlhazlkYrlkJfvvJ/lsIbkvJrkuI7pgZPplb/ku5PlupPmnI3liqHlmajpgJrorq8nKS5jb25maXJtKCgpPT57XFxuICAgICAgICBsZXQgZGV2X3NldF9pbmZvID0gZ2V0TXlWYXIoXFxcImRldl9zZXRfaW5mb1xcXCIpLnNwbGl0KCckJCcpO1xcbiAgICAgICAgbGV0IGlucHV0X3RleHQgPSBnZXRNeVZhcignZGV2SW5mbycsICcnKTtcXG4gICAgICAgIGlmKGlucHV0X3RleHQubGVuZ3RoID49IDQpe1xcbiAgICAgICAgICAgIGxldCBpbmZvX3NldF91cmw9IGRldl9zZXRfaW5mb1syXTtcXG4gICAgICAgICAgICBsZXQgc2VuZF9kYXRhID0ge1xcXCJwYXJhbXNcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAge1xcXCJkYXRhXFxcIjoge1xcXCJpbmZvXFxcIjogaW5wdXRfdGV4dH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBkZXZfc2V0X2luZm9bMF0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogZGV2X3NldF9pbmZvWzFdfVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgLy8gbG9nKHNlbmRfZGF0YSk7XFxuICAgICAgICAgICAgbGV0IHBhcjIgPSB7aGVhZGVyczp7J2NvbnRlbnQtdHlwZSc6J2FwcGxpY2F0aW9uL2pzb247Y2hhcnNldD1VVEYtOCcsJ1VzZXItQWdlbnQnOmRldl9zZXRfaW5mb1szXX0sYm9keTpKU09OLnN0cmluZ2lmeShzZW5kX2RhdGEpLG1ldGhvZDonUE9TVCd9O1xcbiAgICAgICAgICAgIC8vIHBhcjIgPSBKU09OLnN0cmluZ2lmeShwYXIyKTsgLy94NemHjOmdouivt+axguaJjemcgOimgee8lueggVxcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGxldCBiYWNrX3JldCA9IHJlcXVlc3QoaW5mb19zZXRfdXJsLCBwYXIyKTtcXG4gICAgICAgICAgICAgICAgYmFja19yZXQgPSBKU09OLnBhcnNlKGJhY2tfcmV0KS5yZXN1bHQ7XFxuICAgICAgICAgICAgICAgIGlmKGJhY2tfcmV0LnN0YXR1cz09PTApe1xcbiAgICAgICAgICAgICAgICAgICAgLy8gcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv53lrZjmiJDlip9cXFxcbicrYmFja19yZXQuZGV0YWlsO1xcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv53lrZjlpLHotKVcXFxcbicrYmFja19yZXQuZGV0YWlsO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/plJnor69cXFxcbicrZS5tZXNzYWdlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIGNvbmZpcm0oe3RpdGxlOifpgZPplb/mj5DnpLonLGNvbnRlbnQ6J+iZveeEtuS9oOW+iOaHku+8jOS9huaYr+WFrOWRiuiHs+WwkeWGmTTkuKrlrZflkKfvvIEnfSk7XFxuICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgfVxcbiAgICB9KVxcbn0pO1xcblxcbnNldFJlc3VsdChkKTtcIn1dIiwiaWNvbiI6Imh0dHBzOi8vbGFubWVpZ3VvamlhbmcuY29tL3R1Ymlhby9vdGhlci8zMC5zdmciLCJwcm94eSI6Imh0dHBzOi8vaGpkaG54LmNvZGluZy5uZXQvcC9oaWtlci9kL2RyL2dpdC9yYXcvbWFzdGVyL2pzLz0+aHR0cHM6Ly9naXRjb2RlLm5ldC9xcV8zMjM5NDM1MS9kci8tL3Jhdy9tYXN0ZXIvanMvIn0=
Add Comment
Please, Sign In to add comment