Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@MY阿里云盘@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoiTVnpmL/ph4zkupHnm5giLCJhdXRob3IiOiLpppnpm4Xmg4UiLCJ1cmwiOiJoaWtlcjovL2VtcHR5Pz8/ZnlwYWdlIiwidmVyc2lvbiI6MSwiY29sX3R5cGUiOiJtb3ZpZV8zIiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJ0b29sIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG52YXIgZCA9IFtdO1xuXG5mdW5jdGlvbiBmb3JtYXREYXRlKF9kYXRlLCBfZm10KSB7XG4gICAgbGV0IGZtdCA9IF9mbXQgfHwgXCJ5eXl5LU1NLWRkIEhIOm1tOnNzXCI7XG4gICAgY29uc3QgZGF0ZSA9ICFpc05hTihfZGF0ZSkgPyBuZXcgRGF0ZShfZGF0ZSAqIDEwMDApIDogbmV3IERhdGUoX2RhdGUpO1xuICAgIGNvbnN0IG8gPSB7XG4gICAgICAgIFwiTStcIjogZGF0ZS5nZXRNb250aCgpICsgMSwgLy/mnIjku70gXG4gICAgICAgIFwiZCtcIjogZGF0ZS5nZXREYXRlKCksIC8v5pelIFxuICAgICAgICBcImgrXCI6IGRhdGUuZ2V0SG91cnMoKSAlIDEyID09IDAgPyAxMiA6IGRhdGUuZ2V0SG91cnMoKSAlIDEyLFxuICAgICAgICBcIkgrXCI6IGRhdGUuZ2V0SG91cnMoKSwgLy/lsI/ml7YgXG4gICAgICAgIFwibStcIjogZGF0ZS5nZXRNaW51dGVzKCksIC8v5YiGIFxuICAgICAgICBcInMrXCI6IGRhdGUuZ2V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q6ICdQT1NUJ1xuICAgIH0pO1xuICAgIGlmIChKU09OLnBhcnNlKHNlbGZyb290KS5uZXh0X21hcmtlcikge1xuICAgICAgICBsZXQgbWFya2VyID0gSlNPTi5wYXJzZShzZWxmcm9vdCkubmV4dF9tYXJrZXI7XG4gICAgICAgIGlmIChtYXJrZXIubGVuZ3RoID4gMTApIHtcbiAgICAgICAgICAgIHB1dE15VmFyKCduZXh0cGFnZScsIG1hcmtlcik7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjbGVhck15VmFyKCduZXh0cGFnZScpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgdmFyIGNvbnRzID0gSlNPTi5wYXJzZShzZWxmcm9vdCkuaXRlbXM7XG4gICAgdmFyIGRvbmd0YWkgPSBKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2Uvc2VsZmxhenl1cmwnLCB7fSkpLnJ1bGUudG9TdHJpbmcoKTtcbiAgICB2YXIgdHVpc29uZyA9IFtdO1xuICAgIGZvciAodmFyIGkgaW4gY29udHMpIHtcbiAgICAgICAgdmFyIGxpc3R5cCA9IGNvbnRzW2ldLnR5cGU7XG4gICAgICAgIGlmIChsaXN0eXAgIT0gJ2ZvbGRlcicpIHtcbiAgICAgICAgICAgIHZhciBjYXRlID0gY29udHNbaV0uY2F0ZWdvcnk7XG4gICAgICAgICAgICB2YXIgZm5hbWUgPSBjb250c1tpXS5uYW1lO1xuICAgICAgICAgICAgaWYgKGNhdGUgPT0gJ3ZpZGVvJykge1xuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9ICfwn5O6JyArIGNvbnRzW2ldLm5hbWU7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNhdGUgPT0gJ2RvYycpIHtcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSAn8J+TlicgKyBjb250c1tpXS5uYW1lO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICdpbWFnZScpIHtcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSAn8J+WvCcgKyBjb250c1tpXS5uYW1lO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICd6aXAnKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/Cfk6YnICsgY29udHNbaV0ubmFtZTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gY29udHNbaV0ubmFtZVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXG4gICAgICAgICAgICAgICAgdXJsOiAkKGNvbnRzW2ldLmRvd25sb2FkX3VybCA/IGNvbnRzW2ldLmRvd25sb2FkX3VybCA6IGNvbnRzW2ldLmZpbGVfaWQpLmxhenlSdWxlKCh4ZHJpdmlkLCBkcml2aWQsIGRvbmd0YWksIGNhdGUsIGZuYW1lKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGV2YWwoZG9uZ3RhaSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwbGF5XG4gICAgICAgICAgICAgICAgfSwgeGRyaXZpZCwgZHJpdmlkLCBkb25ndGFpLCBjYXRlLCBmbmFtZSksXG4gICAgICAgICAgICAgICAgZGVzYzogZm9ybWF0RGF0ZShjb250c1tpXS51cGRhdGVkX2F0KSArICcgICcgKyBmb3JtYXRTaXplKGNvbnRzW2ldLnNpemUpLFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5o6o6YCB5YiwVFZCb3gnLFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGRyaXZpZCwgZmlsZWlkLCBjYXRlLCBmbmFtZSwgcmVmdG9rZW4pID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3J1bGU9WFlR5o6o6YCBJnB1c2h1cmw9JyArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwibmFtZVwiOiBmbmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJyZWZyZXNoX3Rva2VuXCI6IHJlZnRva2VuLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcInVybFwiOiBmbmFtZS5yZXBsYWNlKC9cXCMvZywgJ18nKS5yZXBsYWNlKC9cXCQvZywgJ18nKSArICckJyArIGNhdGUgKyAnfCcgKyBmaWxlaWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiZGVmYXVsdF9kcml2ZV9pZFwiOiBkcml2aWRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBkcml2aWQsIGNvbnRzW2ldLmZpbGVfaWQsIGNhdGUsIGZuYW1lLCByZWZ0b2tlbilcbiAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfliKDpmaTlvZPliY3mlofku7YnLFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGRyaXZpZCwgZmlsZWlkLCByZWFjY2Vzc1RrKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFwiY29uZmlybTovL+ehruiupOWIoOmZpOatpOaWh+S7tu+8n+aXoOazleaBouWkjeeahOWTn+OAgi5qczpcIiArICQudG9TdHJpbmcoKGRyaXZpZCwgZmlsZWlkLCByZWFjY2Vzc1RrKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZXAgPSBKU09OLnBhcnNlKGZldGNoKCdodHRwczovL2FwaS5hbGl5dW5kcml2ZS5jb20vYWRyaXZlL3YyL2JhdGNoJywge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGhvcml6YXRpb24nOiByZWFjY2Vzc1RrLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICd4LWNhbmFyeSc6ICdjbGllbnQ9d2ViLGFwcD1zaGFyZSx2ZXJzaW9uPXYyLjMuMSdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyd4LXNoYXJlLXRva2VuJzogc2hhcmV0b2tlblxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwicmVxdWVzdHNcIjogW3tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJib2R5XCI6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiZHJpdmVfaWRcIjogZHJpdmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJmaWxlX2lkXCI6IGZpbGVpZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcImhlYWRlcnNcIjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJDb250ZW50LVR5cGVcIjogXCJhcHBsaWNhdGlvbi9qc29uXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJpZFwiOiBmaWxlaWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwibWV0aG9kXCI6IFwiUE9TVFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcInVybFwiOiBcIi9maWxlL2RlbGV0ZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJyZXNvdXJjZVwiOiBcImZpbGVcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcC5yZXNwb25zZXNbMF0uc3RhdHVzID09IDIwNCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liKDpmaTmiJDlip8nXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2cocmVwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGRyaXZpZCwgZmlsZWlkLCByZWFjY2Vzc1RrKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGRyaXZpZCwgY29udHNbaV0uZmlsZV9pZCwgcmVhY2Nlc3NUaylcblxuICAgICAgICAgICAgICAgICAgICB9XSxcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGNvbnRzW2ldLmZpbGVfaWRcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJ1xuXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlmIChjYXRlID09ICd2aWRlbycgfHwgY2F0ZSA9PSAnYXVkaW8nKSB7XG4gICAgICAgICAgICAgICAgdHVpc29uZy5wdXNoKFxuICAgICAgICAgICAgICAgICAgICB0aXRsZS5yZXBsYWNlKC9cXCMvZywgJ18nKS5yZXBsYWNlKC9cXCQvZywgJ18nKSArICckJyArIGNhdGUgKyAnfCcgKyBjb250c1tpXS5maWxlX2lkXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICAgICAgdGl0bGU6ICfwn5OCJyArIGNvbnRzW2ldLm5hbWUsXG4gICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5JyArIGNvbnRzW2ldLmZpbGVfaWQgKyAnPz8/ZnlwYWdlJykucnVsZSgoeGRyaXZpZCwgZHJpdmlkLCBwdXNobmFtZSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9zZWxmcnVsZWxvb3AnLCB7fSkpLnJ1bGUpO1xuICAgICAgICAgICAgICAgIH0sIHhkcml2aWQsIGRyaXZpZCwgY29udHNbaV0ubmFtZSksXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbidcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgIH0gLy9lbmQgaWZcbiAgICB9XG4gICAg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vc2VsZmxhenl1cmwnLCB7fSkpLnJ1bGUudG9TdHJpbmcoKTtcXG4gICAgZm9yICh2YXIgaSBpbiBjb250cykge1xcblxcbiAgICAgICAgdmFyIGxpc3R5cCA9IGNvbnRzW2ldLnR5cGU7XFxuICAgICAgICBpZiAobGlzdHlwICE9ICdmb2xkZXInKSB7XFxuICAgICAgICAgICAgdmFyIGNhdGUgPSBjb250c1tpXS5jYXRlZ29yeTtcXG4gICAgICAgICAgICB2YXIgZm5hbWUgPSBjb250c1tpXS5uYW1lO1xcbiAgICAgICAgICAgIGlmIChjYXRlID09ICd2aWRlbycpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/Cfk7onICsgY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNhdGUgPT0gJ2RvYycpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/Cfk5YnICsgY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNhdGUgPT0gJ2ltYWdlJykge1xcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSAn8J+WvCcgKyBjb250c1tpXS5uYW1lO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY2F0ZSA9PSAnemlwJykge1xcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSAn8J+TpicgKyBjb250c1tpXS5uYW1lO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGNvbnRzW2ldLm5hbWVcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoY29udHNbaV0uZG93bmxvYWRfdXJsID8gY29udHNbaV0uZG93bmxvYWRfdXJsIDogY29udHNbaV0uZmlsZV9pZCkubGF6eVJ1bGUoKHhkcml2aWQsIGRyaXZpZCwgZG9uZ3RhaSwgY2F0ZSwgZm5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoZG9uZ3RhaSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGxheVxcbiAgICAgICAgICAgICAgICB9LCB4ZHJpdmlkLCBkcml2aWQsIGRvbmd0YWksIGNhdGUsIGZuYW1lKSxcXG4gICAgICAgICAgICAgICAgZGVzYzogZm9ybWF0RGF0ZShjb250c1tpXS51cGRhdGVkX2F0KSArICcgICcgKyBmb3JtYXRTaXplKGNvbnRzW2ldLnNpemUpLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5o6o6YCB5YiwVFZCb3gnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChkcml2aWQsIGZpbGVpZCwgY2F0ZSwgZm5hbWUsIHJlZnRva2VuKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3B1c2g/cnVsZT1YWVHmjqjpgIEmcHVzaHVybD0nICsgZW5jb2RlVVJJQ29tcG9uZW50KEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogZm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicmVmcmVzaF90b2tlblxcXCI6IHJlZnRva2VuLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IGZuYW1lLnJlcGxhY2UoL1xcXFwjL2csICdfJykucmVwbGFjZSgvXFxcXCQvZywgJ18nKSArICckJyArIGNhdGUgKyAnfCcgKyBmaWxlaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiZGVmYXVsdF9kcml2ZV9pZFxcXCI6IGRyaXZpZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgZHJpdmlkLCBjb250c1tpXS5maWxlX2lkLCBjYXRlLCBmbmFtZSwgcmVmdG9rZW4pXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfliKDpmaTlvZPliY3mlofku7YnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChkcml2aWQsIGZpbGVpZCwgcmVhY2Nlc3NUaykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImNvbmZpcm06Ly/noa7orqTliKDpmaTmraTmlofku7bvvJ/ml6Dms5XmgaLlpI3nmoTlk5/jgIIuanM6XFxcIiArICQudG9TdHJpbmcoKGRyaXZpZCwgZmlsZWlkLCByZWFjY2Vzc1RrKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVwID0gSlNPTi5wYXJzZShmZXRjaCgnaHR0cHM6Ly9hcGkuYWxpeXVuZHJpdmUuY29tL2Fkcml2ZS92Mi9iYXRjaCcsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnYXV0aG9yaXphdGlvbic6IHJlYWNjZXNzVGssXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICd4LWNhbmFyeSc6ICdjbGllbnQ9d2ViLGFwcD1zaGFyZSx2ZXJzaW9uPXYyLjMuMSdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8neC1zaGFyZS10b2tlbic6IHNoYXJldG9rZW5cXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInJlcXVlc3RzXFxcIjogW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJib2R5XFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJkcml2ZV9pZFxcXCI6IGRyaXZpZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiZmlsZV9pZFxcXCI6IGZpbGVpZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJoZWFkZXJzXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJDb250ZW50LVR5cGVcXFwiOiBcXFwiYXBwbGljYXRpb24vanNvblxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiaWRcXFwiOiBmaWxlaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwibWV0aG9kXFxcIjogXFxcIlBPU1RcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IFxcXCIvZmlsZS9kZWxldGVcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicmVzb3VyY2VcXFwiOiBcXFwiZmlsZVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVwLnJlc3BvbnNlc1swXS5zdGF0dXMgPT0gMjA0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5Yig6Zmk5oiQ5YqfJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2cocmVwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgZHJpdmlkLCBmaWxlaWQsIHJlYWNjZXNzVGspO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGRyaXZpZCwgY29udHNbaV0uZmlsZV9pZCwgcmVhY2Nlc3NUaylcXG5cXG4gICAgICAgICAgICAgICAgICAgIH1dLFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGNvbnRzW2ldLmZpbGVfaWRcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnXFxuXFxuICAgICAgICAgICAgfSk7XFxuICA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tlblxcbiAgICAgICAgICAgICAgICAgICAgJ3gtY2FuYXJ5JzogJ2NsaWVudD13ZWIsYXBwPWFkcml2ZSx2ZXJzaW9uPXY0LjEuMSdcXG5cXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcImF1dGhvcml6ZVxcXCI6IDEsXFxuICAgICAgICAgICAgICAgICAgICBcXFwic2NvcGVcXFwiOiBcXFwidXNlcjpiYXNlLGZpbGU6YWxsOnJlYWQsZmlsZTphbGw6d3JpdGVcXFwiXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgLy9sb2coJ29hdXRocmVxXFxcXG4nICsganNvbik7XFxuICAgICAgICAgICAgbGV0IGNvZGUgPSBKU09OLnBhcnNlKGpzb24pLnJlZGlyZWN0VXJpLnNwbGl0KFxcXCJjb2RlPVxcXCIpWzFdO1xcbiAgICAgICAgICAgIG9hdXRoUmVkaXJlY3QoY29kZSk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmVhY2Nlc3NUayA9ICcnO1xcbiAgICAgICAgfVxcbiAgICB9O1xcblxcbiAgICBmdW5jdGlvbiBvYXV0aFJlZGlyZWN0KGNvZGUpIHtcXG4gICAgICAgIGlmIChnZXRNeVZhcignb3JlZCcsICcxJykgIT0gJzAnKSB7XFxuICAgICAgICAgICAgbGV0IGpzb24gPSBmZXRjaCgnaHR0cHM6Ly9hcGkubm4uY2kvYWxpc3QvYWxpX29wZW4vY29kZScsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBQQ19VQSxcXG4gICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nXFxuXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJjb2RlXFxcIjogY29kZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJncmFudF90eXBlXFxcIjogXFxcImF1dGhvcml6YXRpb25fY29kZVxcXCJcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICBsb2coJ+iOt+WPllJlZnJlc2hUb2tlbk9wZW4nKTtcXG4gICAgICAgICAgICBpZiAoanNvbi5pbmNsdWRlcygnVG9vIE1hbnkgUmVxdWVzdHMnKSkge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignb3JlZCcsICcwJyk7XFxuICAgICAgICAgICAgICAgIGxvZygn6K+35rGC5aSq6aKR57mB77yM6KKr5bCBSVDkuoYnKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICcnO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdvcmVkJywgJzEnKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IGdldFJlZnJlc2hUb2tlbk9wZW4gPSBKU09OLnBhcnNlKGpzb24pLnJlZnJlc2hfdG9rZW47XFxuICAgICAgICAgICAgc2V0SXRlbSgnZ2V0UmVmcmVzaFRva2VuT3BlbicsIGdldFJlZnJlc2hUb2tlbk9wZW4pO1xcbiAgICAgICAgICAgIGxldCBnZXRBY2Nlc3NUb2tlbk9wZW4gPSBKU09OLnBhcnNlKGpzb24pLnRva2VuX3R5cGUgKyAnICcgKyBKU09OLnBhcnNlKGpzb24pLmFjY2Vzc190b2tlbjtcXG4gICAgICAgICAgICBzZXRJdGVtKCdnZXRBY2Nlc3NUb2tlbk9wZW4nLCBnZXRBY2Nlc3NUb2tlbk9wZW4pO1xcblxcbiAgICAgICAgICAgIHB1dE15VmFyKCdyZWRpcmVjdCcsICcxJyk7XFxuICAgICAgICB9XFxuICAgIH07XFxuXFxuICAgIGZ1bmN0aW9uIG9wZW4oZmlsZUlkLCBkZWZkcml2ZWlkKSB7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxldCBqc29uID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgbGV0IG51bWJlciA9IDA7XFxuICAgICAgICAgICAgZG8ge1xcbiAgICAgICAgICAgICAgICBqc29uID0gZmV0Y2goJ2h0dHBzOi8vb3Blbi5hbGl5dW5kcml2ZS5jb20vYWRyaXZlL3YxLjAvb3BlbkZpbGUvZ2V0RG93bmxvYWRVcmwnLCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBQQ19VQSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aG9yaXphdGlvbic6IGdldEl0ZW0oJ2dldEFjY2Vzc1Rva2VuT3BlbicsICcnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZ2V0QWNjZXNzVG9rZW5PcGVuXFxuXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWxlX2lkJzogZmlsZUlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkcml2ZV9pZCc6IGRlZmRyaXZlaWRcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgLy9sb2coJ29wZW5cXFxcbicgKyBqc29uKTtcXG4gICAgICAgICAgICAgICAgaWYgKCFqc29uLmluY2x1ZGVzKFxcXCJBY2Nlc3NUb2tlbkludmFsaWRcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdyZWRpcmVjdCcsICcwJykgPT0gJzAnKSB7XFxuICAgICAgICAgICAgICAgICAgICBvYXV0aFJlcXVlc3QoKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBudW1iZXIrK1xcbiAgICAgICAgICAgIH0gd2hpbGUgKG51bWJlciA8IDIpO1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnBhcnNlKGpzb24pLnVybDtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgIH07XFxuXFxuICAgIGZ1bmN0aW9uIGdldFF1YWxpdHkodGFza0xpc3QpIHtcXG4gICAgICAgIGxldCBvcmRlcnMgPSBbXFxcIlVIRFxcXCIsIFxcXCJRSERcXFwiLCBcXFwiRkhEXFxcIiwgXFxcIkhEXFxcIiwgXFxcIlNEXFxcIiwgXFxcIkxEXFxcIl07XFxuICAgICAgICBmb3IgKGxldCBvciBvZiBvcmRlcnMpIHtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRhc2tMaXN0Lmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgIGxldCB0YXNrID0gdGFza0xpc3RbaV07XFxuICAgICAgICAgICAgICAgIGlmICh0YXNrLnRlbXBsYXRlX2lkID09IG9yKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGFzay51cmw7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gdGFza0xpc3RbMF0udXJsO1xcbiAgICB9O1xcblxcbiAgICBmdW5jdGlvbiBvcGVuUHJlKGZpbGVJZCwgZGVmZHJpdmVpZCkge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQganNvbiA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgIGxldCBudW1iZXIgPSAwO1xcbiAgICAgICAgICAgIGRvIHtcXG4gICAgICAgICAgICAgICAganNvbiA9IGZldGNoKCdodHRwczovL29wZW4uYWxpeXVuZHJpdmUuY29tL2Fkcml2ZS92MS4wL29wZW5GaWxlL2dldFZpZGVvUHJldmlld1BsYXlJbmZvJywge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGhvcml6YXRpb24nOiBnZXRJdGVtKCdnZXRBY2Nlc3NUb2tlbk9wZW4nLCAnJylcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2dldEFjY2Vzc1Rva2VuT3BlblxcblxcbiAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlsZV9pZCc6IGZpbGVJZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnZHJpdmVfaWQnOiBkZWZkcml2ZWlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYXRlZ29yeSc6ICdsaXZlX3RyYW5zY29kaW5nJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAndXJsX2V4cGlyZV9zZWMnOiAnMTQ0MDAnXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIC8vbG9nKCdvcGVucHJlXFxcXG4nICsganNvbik7XFxuICAgICAgICAg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