Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@tvbox云盘推送@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoidHZib3jkupHnm5jmjqjpgIEiLCJhdXRob3IiOiJ0ZWUmTXJGbHkm5bCP5qOJ6KKE8J+Mnibpppnpm4Xmg4UiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IyNmeWNsYXNzIiwidmVyc2lvbiI6OCwiY29sX3R5cGUiOiJ0ZXh0XzEiLCJjbGFzc19uYW1lIjoi5YWo6YOoJuWWteaQnCblsI/nurjmnaEm5om+6LWE5rqQJuWwj+ermSZVUOS6keaQnCbnm5jln7rlnLDnmbvpmYYm5LqR55uY6LWE5rqQJue9keebmOi1hOa6kCZKSUtFJuabtOWkmibkupHnm5jnm5hURybmh5Lni5dURybkupHnm5jlj5HluINURyZtZW93IiwidHlwZSI6InZpZGVvIiwiY2xhc3NfdXJsIjoiYWxsJmh0dHBzOi8vd3d3LmFsaXBhbnNvdS5jb20maHR0cHM6Ly91LmdpdGNhZmUubmV0LyZodHRwczovL3poYW96aXl1YW4ubWUvc28maHR0cHM6Ly93d3cucGFuNjY2LmNuLyZodHRwczovL3d3dy51cHl1bnNvLmNvbSZodHRwczovL3d3dy5wYW5qZC5jb20vJmh0dHBzOi8veXVucGFuMS5jb20vJmh0dHBzOi8vYWxpd3AuY24vJmh0dHBzOi8vamlrZS5pbmZvL2NhdGVnb3J5LzIv6K6o6K665Yy6P2xhbmc9ZW4tVVMmaHR0cHM6Ly9kYWxhby5ydS93LyZodHRwczovL3R4Lm1lL3MvWXVuUGFuUGFuJmh0dHBzOi8vdHgubWUvcy92aXAxMTVob3QmaHR0cHM6Ly90eC5tZS9zL3NoYXJlQWxpeXVuJmh0dHBzOi8vbWVvdy50ZyIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1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YnZpZXdfc2luZ2xlXCIsXG4gICAgICAgIHVybDogdSxcbiAgICAgICAgZGVzYzogZGVzYyxcbiAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgIGNhbkJhY2s6IHRydWUsXG4gICAgICAgICAgICB1cmxJbnRlcmNlcHRvcjogJC50b1N0cmluZygobXlydWxlKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKGlucHV0LnN0YXJ0c1dpdGgoJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS9zLycpIHx8IGlucHV0LnN0YXJ0c1dpdGgoJ21hZ25ldDonKSkge1xuICAgICAgICAgICAgICAgICAgICAvL2ZiYS5mZXRjaChpbnB1dCwge30pO1xuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCduYW1lJyk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnRvU3RyaW5nKCh1cmwsIG15cnVsZSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgZmJhLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGU6IG15cnVsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL3BhZ2UvcHVzaD9ydWxlPScgKyBteXJ1bGUgKyAnJnVybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KHVybCkrJz8/P2Z5cGFnZSdcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgfSwgaW5wdXQsIG15cnVsZSlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LCBNWV9SVUxFLnRpdGxlKSxcbiAgICAgICAgICAgIHVhOiBNT0JJTEVfVUFcbiAgICAgICAgfVxuICAgIH1dKVxufVxuaWYgKHUgPT0gXCJhbGxcIikge1xuICAgIGxldCBjbHMgPSBnZXRNeVZhcihcImNsc1wiLCBcIlwiKTtcb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AgICAgICB9IGVsc2UgaWYgKC9cXC50b3JyZW50fGVkMmtcXDovLnRlc3QoaW5wdXQpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kuI3mlK/mjIHmjqjpgIHov5nnp43pk77mjqXjgIInXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+i+k+WFpeato+ehrueahOmTvuaOpeOAgidcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICAgICAgdGl0bGVWaXNpYmxlOiB0cnVlXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY29sX3R5cGU6ICdpbnB1dCdcbiAgICAgICAgfSk7XG4gICAgICAgIGFyci5wdXNoKHtcbiAgICAgICAgICAgIHRpdGxlOiBcIlRWQuaQnOe0olwiLFxuICAgICAgICAgICAgdXJsOiAkLnRvU3RyaW5nKCgpID0+IHtcbiAgICAgICAgICAgICAgICBsZXQgdHZpcCA9IGdldEl0ZW0oJ2hpa2VydHZib3hzZXQnLCAnJyk7XG4gICAgICAgICAgICAgICAgbGV0IHN0YXRlID0gJ2ZhbHNlJztcbiAgICAgICAgICAgICAgICBpZiAodHZpcCAhPSAnJyAmJiB0dmlwLmluY2x1ZGVzKCc6OTk3JykpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHN0YXRlID0gcmVxdWVzdCh0dmlwICsgJy9hY3Rpb24nLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vJ1gtUmVxdWVzdGVkLVdpdGgnOiAnWE1MSHR0cFJlcXVlc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogdHZpcFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVvdXQ6IDIwMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiAnZG89c2VhcmNoJndvcmQ9JyArIGlucHV0LFxuICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGxvZyhzdGF0ZSk7XG4gICAgICAgICAgICAgICAgaWYgKHN0YXRlID09ICdvaycpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+aQnOe0ouaOqOmAgeaIkOWKn++8jOivt+azqOaEj+ingueci+eUteinhuerr3R2Ym9455WM6Z2iJztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5pCc57Si5o6o6YCB5aSx6LSlJ1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICB0aXRsZVZpc2libGU6IHRydWVcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2lucHV0J1xuICAgICAgICB9KTtcbiAgICAgICAgYXJyLnVuc2hpZnQoe1xuICAgICAgICAgICAgdGl0bGU6IGdldEl0ZW0oJ2hpa2VydHZib3hzZXQnLCAnJyksXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcbiAgICAgICAgfSk7XG4gICAgICAgIGFyci51bnNoaWZ0KHtcbiAgICAgICAgICAgIHRpdGxlOiAn6K6+572uSVDlnLDlnYAnLFxuICAgICAgICAgICAgdXJsOiBcImlucHV0Oi8vXCIgKyBnZXRJdGVtKCdoaWtlcnR2Ym94c2V0JywgJ2h0dHA6Ly8nICsgZ2V0SVAoKSArICc6OTk3OCcpICsgXCIvLy8v6K+36L6T5YWldHZib3jmjqjpgIFJUOWcsOWdgO+8jOWmgmh0dHA6Ly9cIiArIGdldElQKCkgKyBcIjo5OTc4LmpzOnNldEl0ZW0oJ2hpa2VydHZib3hzZXQnLGlucHV0KTtyZWZyZXNoUGFnZSgpXCIsXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXG4gICAgICAgIH0pO1xuICAgICAgICBcbiAgICAgICAgZm9yIChsZXQgaSA9IDE7IGkgPCBjbi5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgYXJyLnB1c2goe1xuICAgICAgICAgICAgICAgIHRpdGxlOiBjbltpXSxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgodSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcImNsc1wiLCB1KTtcbiAgICAgICAgICAgICAgICAgICAgLy9yZWZyZXNoWDVEZXNjKFwidG9wJiZmbG9hdFwiKTtcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFwiaGlrZXI6Ly9lbXB0eVwiO1xuICAgICAgICAgICAgICAgIH0sIGN1W2ldKSxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXCJ0ZXh0XzJcIixcbiAgICAgICAgICAgICAgICBkZXNjOiBcIlwiLFxuICAgICAgICAgICAgICAgIHBpY191cmw6IFwiXCJcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJlZnJlc2hYNURlc2MoXCIwJiZmbG9hdFwiKTtcbiAgICAgICAgc2V0UmVzdWx0KGFycik7XG4gICAgfVxufSBlbHNlIHtcbiAgICBsb2FkVXJsKHUpO1xufSIsInNlY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AgICAgICAgICAgbGV0IHZhbCA9IGhlYWRbaV0uc3BsaXQoXFxcIkBcXFwiKVsxXS5yZXBsYWNlKC9cXFxc77ybXFxcXO+8my9nLCAnOycpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHZ2diA9IGtleSArIFxcXCI9XFxcIiArIGVuY29kZVVSSUNvbXBvbmVudCh2YWwpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgPCAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYWFhID0gdnZ2O1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBhYWEgKz0gXFxcIiZcXFwiICsgdnZ2XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcHVybCA9IHB1cmwgKyBcXFwifFxcXCIgKyBhYWE7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcHVybCA9IHB1cmwucmVwbGFjZSgvXFxcXCYvZywgJ++8hu+8hicpXFxuXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC8vbG9nKHB1cmwpO1xcbiAgICAgICAgICAgIC8vbG9nKHR2aXApO1xcbiAgICAgICAgICAgIGlmIChpbnB1dC5zdGFydHNXaXRoKCdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vcy8nKSkge1xcbiAgICAgICAgICAgICAgICBsZXQgcmVmdG9rZW4gPSBKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL2ZpbGVzL3J1bGVzL2ljeS9pY3ktYWxpLXRva2VuLmpzb24nLCB7fSkpWzBdLnJlZnJlc2hfdG9rZW47XFxuICAgICAgICAgICAgICAgIHB1cmwgPSBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICBcXFwidXJsXFxcIjogaW5wdXQsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicmVmcmVzaF90b2tlblxcXCI6IHJlZnRva2VuXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIHZhciBzdGF0ZSA9IHJlcXVlc3QodHZpcCArICcvYWN0aW9uJywge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXFxuICAgICAgICAgICAgICAgICAgICAvLydYLVJlcXVlc3RlZC1XaXRoJzogJ1hNTEh0dHBSZXF1ZXN0JyxcXG4gICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogdHZpcFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICB0aW1lb3V0OiAyMDAwLFxcbiAgICAgICAgICAgICAgICBib2R5OiAnZG89cHVzaCZ1cmw9JyArIHB1cmwsXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgbG9nKHN0YXRlKTtcXG4gICAgICAgICAgICBpZiAoc3RhdGUgPT0gJ29rJykge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5o6o6YCB5oiQ5Yqf77yM5aaC5p6cdHZib3jmmL7npLrigJzmsqHmib7liLDmlbDmja7igJ3lj6/og73mmK/or6Xpk77mjqXpnIDopoHlr4bnoIHmiJbogIXlvZPliY3nmoRqYXLkuI3mlK/mjIHjgIInO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mjqjpgIHlpLHotKUnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwgdHZpcCksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgZGVzYzogXFxcIlxcXCIsXFxuICAgICAgICBwa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WYgKG1hcmtlci5sZW5ndGggPiAxMCkge1xcbiAgICAgICAgICAgIHB1dE15VmFyKCduZXh0cGFnZScsIG1hcmtlcik7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoJ25leHRwYWdlJyk7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgdmFyIGNvbnRzID0gSlNPTi5wYXJzZShyZXNjb2QpLml0ZW1zO1xcbiAgICB2YXIgZG9uZ3RhaSA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9sYXp5dXJsJywge30pKS5ydWxlLnRvU3RyaW5nKCk7XFxuICAgIHZhciB0dWlzb25nID0gW107XFxuICAgIGZvciAodmFyIGkgaW4gY29udHMpIHtcXG4gICAgICAgIHZhciBsaXN0eXAgPSBjb250c1tpXS50eXBlO1xcbiAgICAgICAgaWYgKGxpc3R5cCAhPSAnZm9sZGVyJykge1xcbiAgICAgICAgICAgIHZhciBjYXRlID0gY29udHNbaV0uY2F0ZWdvcnk7XFxuICAgICAgICAgICAgdmFyIGZuYW1lID0gY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICBpZiAoY2F0ZSA9PSAndmlkZW8nKSB7XFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9ICfwn5O6JyArIGNvbnRzW2ldLm5hbWU7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICdkb2MnKSB7XFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9ICfwn5OWJyArIGNvbnRzW2ldLm5hbWU7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICdpbWFnZScpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/CflrwnICsgY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNhdGUgPT0gJ3ppcCcpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/Cfk6YnICsgY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBjb250c1tpXS5uYW1lXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgIHVybDogJChjb250c1tpXS5maWxlX2lkKS5sYXp5UnVsZSgoc2hhcmVJZCwgc2hhcmV0b2tlbiwgZG9uZ3RhaSwgY2F0ZSwgZm5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoZG9uZ3RhaSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGxheVxcbiAgICAgICAgICAgICAgICB9LCBzaGFyZUlkLCBzaGFyZXRva2VuLCBkb25ndGFpLCBjYXRlLCBmbmFtZSksXFxuICAgICAgICAgICAgICAgIGRlc2M6IGZvcm1hdERhdGUoY29udHNbaV0udXBkYXRlZF9hdCkgKyAnICAnICsgZm9ybWF0U2l6ZShjb250c1tpXS5zaXplKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnXFxuXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgaWYgKGNhdGUgPT0gJ3ZpZGVvJyB8fCBjYXRlID09ICdhdWRpbycpIHtcXG4gICAgICAgICAgICAgICAgdHVpc29uZy5wdXNoKFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUucmVwbGFjZSgvXFxcXCMvZywgJ18nKS5yZXBsYWNlKC9cXFxcJC9nLCAnXycpICsgJyQnICsgY2F0ZSArICd8JyArIGNvbnRzW2ldLmZpbGVfaWRcXG4gICAgICAgICAgICAgICAgKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ/Cfk4InICsgY29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CkpO1xcbiAgICB9XFxuICAgIGZvciAobGV0IGsgaW4gbykge1xcbiAgICAgICAgaWYgKG5ldyBSZWdFeHAoXFxcIihcXFwiICsgayArIFxcXCIpXFxcIikudGVzdChmbXQpKSB7XFxuICAgICAgICAgICAgZm10ID0gZm10LnJlcGxhY2UoUmVnRXhwLiQxLCAoUmVnRXhwLiQxLmxlbmd0aCA9PSAxKSA/IChvW2tdKSA6ICgoXFxcIjAwXFxcIiArIG9ba10pLnN1YnN0cigoXFxcIlxcXCIgKyBvW2tdKS5sZW5ndGgpKSk7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgcmV0dXJuIGZtdDtcXG59O1xcblxcbmZ1bmN0aW9uIGZvcm1hdFNpemUoc2l6ZSkge1xcbiAgICBpZiAoIXNpemUpIHtcXG4gICAgICAgIHJldHVybiAnJztcXG4gICAgfVxcbiAgICBjb25zdCB1bml0cyA9IFsnQicsICdLQicsICdNQicsICdHQicsICdUQicsICdQQicsICdFQicsICdaQicsICdZQiddO1xcbiAgICBsZXQgaSA9IDA7XFxuICAgIHdoaWxlIChzaXplID49IDEwMjQpIHtcXG4gICAgICAgIHNpemUgLz0gMTAyNDtcXG4gICAgICAgIGkrKztcXG4gICAgfVxcbiAgICBzaXplID0gaSA/IE51bWJlcihzaXplLnRvRml4ZWQoMikpIDogc2l6ZTtcXG4gICAgcmV0dXJuIGAke3NpemV9ICR7dW5pdHNbaV19YDtcXG59XFxubGV0IHR2aXAgPSBnZXRJdGVtKCdoaWtlcnR2Ym94c2V0JywgJycpO1xcblxcbmxldCByZWZ0b2tlbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMvaWN5L2ljeS1hbGktdG9rZW4uanNvbicsIHt9KSlbMF0ucmVmcmVzaF90b2tlbjtcXG4gICAgICAgICAgICBcXG4vL2xvZyhnZXRSZXNDb2RlKCkpO1xcbmlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgY2xlYXJNeVZhcignb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AgICAgICAgICAgICAgICdSZWZlcmVyJzogdHZpcFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICB0aW1lb3V0OiAyMDAwLFxcbiAgICAgICAgICAgICAgICBib2R5OiAnZG89cHVzaCZ1cmw9JyArIHB1cmwsXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgbG9nKHN0YXRlKTtcXG4gICAgICAgICAgICBpZiAoc3RhdGUgPT0gJ29rJykge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5o6o6YCB5oiQ5Yqf77yM5aaC5p6cdHZib3jmmL7npLrigJzmsqHmib7liLDmlbDmja7igJ3lj6/og73mmK/lvZPliY3nmoRqYXLkuI3mlK/mjIHjgIInO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mjqjpgIHlpLHotKUnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwgdHZpcCksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiXFxuICAgIH0pO1xcbn1cXG5sZXQgbmV4dCA9IGdldE15VmFyKCduZXh0cGFnZScsICcnKSAhPSAnJyA/ICcsXFxcIm1hcmtlclxcXCI6XFxcIicgKyBnZXRNeVZhcignbmV4dHBhZ2UnKSArICdcXFwiJyA6ICcnO1xcblxcbnZhciByZXNjb2QgPSBmZXRjaCgnaHR0cHM6Ly9hcGkuYWxpeXVuZHJpdmUuY29tL2Fkcml2ZS92My9maWxlL2xpc3QnLCB7XFxuICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXFxuICAgICAgICAnWC1TaGFyZS1Ub2tlbic6IHNoYXJldG9rZW5cXG4gICAgfSxcXG4gICAgYm9keTogJ3tcXFwic2hhcmVfaWRcXFw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pO1xcbn1cXG4vL1wifV0iLCJpY29uIjoiaHR0cHM6Ly93d3cuYWxpcGFuc291LmNvbS9mYXZpY29uLmljbyIsInByb3h5IjoiIn0=
Add Comment
Please, Sign In to add comment