Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥ikuuu签到@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcImxvbmdfdGV4dFwiLFwibmFtZVwiOlwi5rWL6K+V5omn6KGM5LqR5Ye95pWwXCIsXCJwYXRoXCI6XCJ0ZXN0X3J1blwiLFwicnVsZVwiOlwianM6XFxubGV0IHt0YXNrLGhvc3R9ID0gTVlfUEFSQU1TO1xcbmNvbnN0IHtjb2xvciwgc21hbGx9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdXRpbGl5P3J1bGU96YGT6ZW/5LuT5bqTUHJvXFxcIik7XFxuY29uc3Qge3Rhc2tDYWxsLCB0YXNrUnVuLHRhc2tSZXF9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdXRpbHM/cnVsZT1cXFwiK01ZX1JVTEUudGl0bGUpO1xcbi8vIGxvZygn6KeE5YiZ5ZCNOicrTVlfUlVMRS50aXRsZSk7XFxuU3RyaW5nLnByb3RvdHlwZS5zdHJpcCA9IGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXMucmVwbGFjZSgvKF5cXFxccyopfChcXFxccyokKS9nLCBcXFwiXFxcIik7IH1cXG5zZXRQYWdlVGl0bGUoXFxcIuaJp+ihjOOAjFxcXC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N0cmluZ2lmeSh7XFxuICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgXFxcImRhdGFcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwidHlwZVxcXCI6IHRhc2subW9kZXx8J3J1bicsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiZnVuY1xcXCI6IHRhc2suZnVuY3x8JycsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjogdGFzay5wYXJhbXN8fFtdXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIFxcXCJhdXRoXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBob3VzZV9kYXRhLnVzZXJuYW1lfHxcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGhvdXNlX2RhdGEucGFzc3dvcmR8fFxcXCJcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSxcXG4gICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgIH0pO1xcbiAgICByZXR1cm4gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG59XFxuXFxuZnVuY3Rpb24gdGFza191cGxvYWQodGFzayl7IC8vIOmAmueUqOS7u+WKoeWPkeW4g+aWsOWinuWPiuS/ruaUueWKn+iDvVxcbiAgICBjb25zdCB7YXBpLGdldEZpbGV9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdXRpbGl5P3J1bGU96YGT6ZW/5LuT5bqTUHJvXFxcIik7XFxuICAgIGxldCBob3VzZUZpbGUgPSBnZXRGaWxlfHxmYWxzZTtcXG4gICAgaWYoIWhvdXNlRmlsZSl7XFxuICAgICAgICBzZXRJdGVtKCdpc19ob3VzZV92aXAnLCAnZmFsc2UnKTtcXG4gICAgfVxcbiAgICBsZXQgYXBpX3VybCA9IGFwaS5ob3N0KycvaGlrZXJ1bGUvdGFzay9hZGQnO1xcbiAgICBsZXQgaG91c2VfZGF0YSA9IGhvdXNlRmlsZSgpO1xcbiAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChhcGlfdXJsLCB7XFxuICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgfSxcXG4gICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICBcXFwiZGF0YVxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogdGFzay5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInB5Y29kZVxcXCI6IHRhc2sucHljb2RlLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIm5vdGVcXFwiOiB0YXNrLm5vdGUsXFxuICAgICAgICAgICAgICAgICAgICBcXFwidGVzdF9jb2RlXFxcIjogdGFzay50ZXN0X2NvZGUsXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIFxcXCJhdXRoXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBob3VzZV9kYXRhLnVzZXJuYW1lfHxcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGhvdXNlX2RhdGEucGFzc3dvcmR8fFxcXCJcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSxcXG4gICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgIH0pO1xcbiAgICByZXR1cm4gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG59XFxuXFxuZnVuY3Rpb24gdGFza19jYWxsKGlkLGZ1bmMscGFyY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gaXRlbXMgPSBbXTtcXG5sZXQgYmFja19jb2RlID0gZmV0Y2godXJsLHt9KTtcXG5iYWNrX2NvZGUgPSBKU09OLnBhcnNlKGJhY2tfY29kZSk7XFxuaWYoYmFja19jb2RlLnN0YXR1cz09PTApe1xcbiAgICBsZXQgdGFzayA9IGJhY2tfY29kZS5yZXN1bHQ7XFxuICAgIGxldCB0aXBzID0gY2FuX2RlbGV0ZT8nICjngrnlh7vliKDpmaQpJzonJztcXG4gICAgaXRlbXMucHVzaChcXG4gICAgICAgIHtcXG4gICAgICAgICAgICB0aXRsZTp0YXNrLm5hbWUrdGlwcyxcXG4gICAgICAgICAgICBkZXNjOidpZDonK3Rhc2suaWQrJyAg5Y+v6KeG54q25oCBOicrdGFzay52aXNpYmxlKydcXFxcbuS9nOiAhTonK3Rhc2suZGV2X25hbWUrJyDliIbkuqvnirbmgIE6Jyt0YXNrLnN0YXRlKydcXFxcbuabtOaWsOaXtumXtCcrdGFzay5wdWJsaXNoX3RpbWUsXFxuICAgICAgICAgICAgY29sX3R5cGU6J21vdmllXzFfdmVydGljYWxfcGljJyxcXG4gICAgICAgICAgICBwaWNfdXJsOidodHRwczovL2FwaS5tdHlxeC5jbi9hcGkvcmFuZG9tLnBocD90PScrTWF0aC5yYW5kb20oKSxcXG4gICAgICAgICAgICB1cmw6IWNhbl9kZWxldGU/J2hpa2VyOi8vZW1wdHknOiQoXFxcIuehruiupOWIoOmZpD9cXFwiKS5jb25maXJtKCh0YXNrLGhvc3QsaG91c2VfZGF0YSk9PntcXG4gICAgICAgICAgICAgICAgbGV0IGRlbF91cmwgPSBob3N0KycvaGlrZXJ1bGUvdGFzay9kZWxldGUvJyt0YXNrLmlkKyc/bmFtZT0nK2hvdXNlX2RhdGEudXNlcm5hbWUrJyZwYXNzd29yZD0nK2hvdXNlX2RhdGEucGFzc3dvcmQ7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gSlNPTi5wYXJzZShmZXRjaChkZWxfdXJsLHt9KSk7XFxuICAgICAgICAgICAgICAgICAgICBpZihyZXN1bHQuc3RhdHVzPT09MCl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYmFjayh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIityZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lh7rplJnkuoY6XFxcXG5cXFwiK2UubWVzc2FnZTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIH0sdGFzayxhcGkuaG9zdCxob3VzZV9kYXRhKSxcXG4gICAgICAgIH1cXG4gICAgKTtcXG4gICAgbGV0IHJ1bGVDb2RlID0gXFxcIua1t+mYlOinhueVjOacrOWcsOaWh+S7tuWIhuS6q++/pWZpbGVfdXJs77+laGlrZXI6Ly9maWxlcy9ydWxlcy9kekhvdXNlL3B5dGhvbi9cXFwiK3Rhc2submFtZStcXFwiLnB5QFxcXCIrTVlfVVJMK1xcXCImZGVidWc9MVxcXCI7XFxuICAgIGxldCBpbXBvcnRVcmwgPSAncnVsZTovLycgKyBiYXNlNjRFbmNvZGUocnVsZUNvZGUpO1xcblxcbiAgICBpdGVtcy5wdXNoKFxcbiAgICAgICAge1xcbiAgICAgICAgICAgIHRpdGxlOifwn5Ol5a+85YWlJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgICAgICB1cmw6aW1wb3J0VXJsXFxuICAgICAgICB9XFxuICAgICk7XFxuXFxuICAgIGl0ZW1zLnB1c2goXFxuICAgICAgICB7XFxuICAgICAgICAgICAgdGl0bGU6J/Cfk53mnKzlnLDnvJbovpEnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgICAgIHVybDokKCkubGF6eVJ1bGUoKHRhc2spID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdlZGl0RmlsZTovL2hpa2VyOi8vZmlsZXMvcnVsZXMvZHpIb3VzZS9weXRob24vJyt0YXNrLm5hbWUrJy5weSc7XFxuICAgICAgICAgICAgfSx0YXNrKVxcbiAgICAgICAgfVxcbiAgICApO1xcblxcbiAgICBpdGVtcy5wdXNoKFxcbiAgICAgICAge1xcbiAgICAgICAgICAgIHRpdGxlOifilrbvuI/mtYvor5XmiafooYwnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgICAgIHVybDpcXFwiaGlrZXI6Ly9wYWdlL3Rlc3RfcnVuI25vSGlzdG9yeSNcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIHRhc2s6dGFzayxcXG4gICAgICAgICAgICAgICAgaG9zdDphcGkuaG9zdCxcXG4gICAgICAgICAgICAgICAgaG91c2VfZGF0YTpob3VzZV9kYXRhXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICApO1xcblxcbiAgICBpZihjYW5fdXBkYXRlKXtcXG4gICAgICAgIGl0ZW1zLnB1c2goXFxuICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICB0aXRsZTon4pa26YeN5Y+R5biDJyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxuICAgICAgICAgICAgICAgIHVybDonaGlrZXI6Ly9wYWdlL25ld190YXNrI25vSGlzdG9yeSMnLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgdGFzazp0YXNrLFxcbiAgICAgICAgICAgICAgICAgICAgLy8gaG9zdDphcGkuaG9zdCxcXG4gICAgICAgICAgICAgICAgICAgIC8vIGhvdXNlX2RhdGE6aG91c2VfZGF0YVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgKTtcXG4gICAgICAgIGl0ZW1zLnB1c2goXFxuICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICB0aXRsZTon8J+Nh+S7u+WKoeaUueWQjScsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgICAgICAgICB1cmw6JCh0YXNrLm5hbWUsIFxcXCLovpPlhaXmlrDnmoTku7vliqHlkI3np7BcXFwiKS5pbnB1dCgodGFzaykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuehruiupOWwhlxcXCIrdGFzay5uYW1lK1xcXCLkv67mlLnkuLo6XFxcIitpbnB1dCsnID8nKS5jb25maXJtKChpbnB1dCx0YXNrKT0+e1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxvZyh0YXNrLmlkKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB7dGFza1JlbmFtZX0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS91dGlscz9ydWxlPVxcXCIrTVlfUlVMRS50aXRsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHRhc2tSZW5hbWUodGFzay5pZCxpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYmFjayh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIityZXN1bHQ7XFxuICAgICAgICAgICAgICAgICAgICB9LGlucHV0LHRhc2spO1xcbiAgICAgICAgICAgICAgICB9LHRhc2spLFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICk7XFxuXFxuICAgICAgICBpdGVtcy5wdXNoKFxcbiAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6J/CfjbDmm7TmlLnliIbkuqvnirbmgIEnLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgdXJsOiQoKS5sYXp5UnVsZSgodGFzaykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qge3Rhc2tDaGFuZ2VTdGF0ZX0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS91dGlscz9ydWxlPVxcXCIrTVlfUlVMRS50aXRsZSk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gdGFza0NoYW5nZVN0YXRlKHRhc2suaWQpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJytyZXN1bHQ7XFxuICAgICAgICAgICAgICAgIH0sdGFzayksXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgKTtcXG5cXG4gICAgICAgIGl0ZW1zLnB1c2goXFxuICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICB0aXRsZTp0YXNrLnZpc2libGU/J/CfkYDlj6/op4YnOifwn5GA5LiN5Y+v6KeGJyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxuICAgICAgICAgICAgICAgIHVybDokKCkubGF6eVJ1bGUoKHRhc2spID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHt0YXNrQ2hhbmdlVmlzaWJsZX0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS91dGlscz9ydWxlPVxcXCIrTVlfUlVMRS50aXRsZSk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gdGFza0NoYW5nZVZpc2libGUodGFzay5pZCk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVl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XG4gICAgfSlcXG59KTtcXG5kLnB1c2goe1xcbiAgICB0aXRsZTon8J+UhOWIt+aWsOS7o+eggeahhicsXFxuICAgIGNvbF90eXBlOidmbGV4X2J1dHRvbicsXFxuICAgIHVybDokKCkubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgaWYoIWdldFZhcigndGFza19ib3gubmV3X3Rhc2tfbmFtZScsICcnKSl7XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIt+aWsOW/hemhu+WFiOWhq+WGmeS7u+WKoeWQjeensCdcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBmaWxlX3BhdGggPSAnaGlrZXI6Ly9maWxlcy9ydWxlcy9kekhvdXNlL3B5dGhvbi8nK2dldFZhcigndGFza19ib3gubmV3X3Rhc2tfbmFtZScsICcnKSsnLnB5JztcXG4gICAgICAgIHB1dFZhcigndGFza19ib3gubmV3X3Rhc2tfcHljb2RlJyxmZXRjaChmaWxlX3BhdGgpKTtcXG4gICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgcmV0dXJuICd0b2FzdDovL+W3suWIt+aWsCc7XFxuICAgIH0pXFxufSk7XFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6J/Cfk7Llj5HluIMnLFxcbiAgICBjb2xfdHlwZTonZmxleF9idXR0b24nLFxcbiAgICB1cmw6JCgpLmxhenlSdWxlKCh0YXNrVXBsb2FkKSA9PiB7XFxuICAgICAgICBpZighZ2V0VmFyKCd0YXNrX2JveC5uZXdfdGFza19uYW1lJywgJycpfHwhZ2V0VmFyKCd0YXNrX2JveC5uZXdfdGFza19weWNvZGUnLCAnJykpe1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lj5HluIPku7vliqHlv4Xpobvkv53or4Hku7vliqHlkI3np7Dlj4rku6PnoIHloavlhpknXFxuICAgICAgICB9XFxuICAgICAgICBsZXQgdGFzayA9IHtcXG4gICAgICAgICAgICBuYW1lOmdldFZhcigndGF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maGRxLm5ldCcrcGRmaChjYXRlLCdhJiZocmVmJyk7XFxuICAgICAgICAgICAgICAgIGxldCB0aXBzID0gZ2V0VmFyKCdub3dfZW1vamlfdXJsJyk9PT11cmw/J+KcjCc6Jyc7XFxuICAgICAgICAgICAgICAgIHRpdGxlID0gdGl0bGUucmVwbGFjZSgnZW1vamknLCcnKSt0aXBzO1xcbiAgICAgICAgICAgICAgICBkLnB1c2goXFxuICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6dGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiQoKS5sYXp5UnVsZSgodXJsLHRpdGxlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcignbm93X2Vtb2ppX3VybCcsdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lvZPliY1lbW9qaeWIhuexuzonK3RpdGxlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sdXJsLHRpdGxlKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBjYXRjaCAoZSkge1xcblxcbiAgICAgICAgfVxcbiAgICB9XFxufVxcblxcbmxldCBodG1sPWZldGNoKGdldFZhcignbm93X2Vtb2ppX3VybCcpKTtcXG5sZXQgZW1vamlfbGlzdCA9IHBkZmEoaHRtbCwnLmVtb2ppbGlzdHBjJiZsaScpO1xcbmZvcih2YXIgZW1vamkgb2YgZW1vamlfbGlzdCl7XFxuICAgIGxldCB0aXRsZSA9IHBkZmgoZW1vamksJ2xpJiZUZXh0Jyk7XFx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VyOi8vZW1wdHknOiQoXFxcIuehruiupOWIoOmZpD9cXFwiKS5jb25maXJtKCh0YXNrLGhvc3QsaG91c2VfZGF0YSk9PntcXG4gICAgICAgICAgICAgICAgbGV0IGRlbF91cmwgPSBob3N0KycvaGlrZXJ1bGUvdGFzay9kZWxldGUvJyt0YXNrLmlkKyc/bmFtZT0nK2hvdXNlX2RhdGEudXNlcm5hbWUrJyZwYXNzd29yZD0nK2hvdXNlX2RhdGEucGFzc3dvcmQ7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gSlNPTi5wYXJzZShmZXRjaChkZWxfdXJsLHt9KSk7XFxuICAgICAgICAgICAgICAgICAgICBpZihyZXN1bHQuc3RhdHVzPT09MCl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYmFjayh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIityZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lh7rplJnkuoY6XFxcXG5cXFwiK2UubWVzc2FnZTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIH0sdGFzayxhcGkuaG9zdCxob3VzZV9kYXRhKSxcXG4gICAgICAgIH1cXG4gICAgKTtcXG4gICAgbGV0IHJ1bGVDb2RlID0gXFxcIua1t+mYlOinhueVjOacrOWcsOaWh+S7tuWIhuS6q++/pWZpbGVfdXJs77+laGlrZXI6Ly9maWxlcy9ydWxlcy9kekhvdXNlL3B5dGhvbi9cXFwiK3Rhc2submFtZStcXFwiLnB5QFxcXCIrTVlfVVJMK1xcXCImZGVidWc9MVxcXCI7XFxuICAgIGxldCBpbXBvcnRVcmwgPSAncnVsZTovLycgKyBiYXNlNjRFbmNvZGUocnVsZUNvZGUpO1xcblxcbiAgICBpdGVtcy5wdXNoKFxcbiAgICAgICAge1xcbiAgICAgICAgICAgIHRpdGxlOifwn5Ol5a+85YWlJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgICAgICB1cmw6aW1wb3J0VXJsXFxuICAgICAgICB9XFxuICAgICk7XFxuXFxuICAgIGl0ZW1zLnB1c2goXFxuICAgICAgICB7XFxuICAgICAgICAgICAgdGl0bGU6J/Cfk53mnKzlnLDnvJbovpEnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgICAgIHVybDokKCkubGF6eVJ1bGUoKHRhc2spID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdlZGl0RmlsZTovL2hpa2VyOi8vZmlsZXMvcnVsZXMvZHpIb3VzZS9weXRob24vJyt0YXNrLm5hbWUrJy5weSc7XFxuICAgICAgICAgICAgfSx0YXNrKVxcbiAgICAgICAgfVxcbiAgICApO1xcblxcbiAgICBpdGVtcy5wdXNoKFxcbiAgICAgICAge1xcbiAgICAgICAgICAgIHRpdGxlOifilrbvuI/mtYvor5XmiafooYwnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgICAgIHVybDpcXFwiaGlrZXI6Ly9wYWdlL3Rlc3RfcnVuI25vSGlzdG9yeSNcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIHRhc2s6dGFzayxcXG4gICAgICAgICAgICAgICAgaG9zdDphcGkuaG9zdCxcXG4gICAgICAgICAgICAgICAgaG91c2VfZGF0YTpob3VzZV9kYXRhXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICApO1xcblxcbiAgICBpZihjYW5fdXBkYXRlKXtcXG4gICAgICAgIGl0ZW1zLnB1c2goXFxuICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICB0aXRsZTon4pa26YeN5Y+R5biDJyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxuICAgICAgICAgICAgICAgIHVybDonaGlrZXI6Ly9wYWdlL25ld190YXNrI25vSGlzdG9yeSMnLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgdGFzazp0YXNrLFxcbiAgICAgICAgICAgICAgICAgICAgLy8gaG9zdDphcGkuaG9zdCxcXG4gICAgICAgICAgICAgICAgICAgIC8vIGhvdXNlX2RhdGE6aG91c2VfZGF0YVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgKTtcXG4gICAgICAgIGl0ZW1zLnB1c2goXFxuICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICB0aXRsZTon8J+Nh+S7u+WKoeaUueWQjScsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgICAgICAgICB1cmw6JCh0YXNrLm5hbWUsIFxcXCLovpPlhaXmlrDnmoTku7vliqHlkI3np7BcXFwiKS5pbnB1dCgodGFzaykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuehruiupOWwhlxcXCIrdGFzay5uYW1lK1xcXCLkv67mlLnkuLo6XFxcIitpbnB1dCsnID8nKS5jb25maXJtKChpbnB1dCx0YXNrKT0+e1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxvZyh0YXNrLmlkKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB7dGFza1JlbmFtZX0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS91dGlscz9ydWxlPVxcXCIrTVlfUlVMRS50aXRsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHRhc2tSZW5hbWUodGFzay5pZCxpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYmFjayh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIityZXN1bHQ7XFxuICAgICAgICAgICAgICAgICAgICB9LGlucHV0LHRhc2spO1xcbiAgICAgICAgICAgICAgICB9LHRhc2spLFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICk7XFxuXFxuICAgICAgICBpdGVtcy5wdXNoKFxcbiAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6J/CfjbDmm7TmlLnliIbkuqvnirbmgIEnLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgdXJsOiQoKS5sYXp5UnVsZSgodGFzaykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qge3Rhc2tDaGFuZ2VTdGF0ZX0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS91dGlscz9ydWxlPVxcXCIrTVlfUlVMRS50aXRsZSk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gdGFza0NoYW5nZVN0YXRlKHRhc2suaWQpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJytyZXN1bHQ7XFxuICAgICAgICAgICAgICAgIH0sdGFzayksXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgKTtcXG5cXG4gICAgICAgIGl0ZW1zLnB1c2goXFxuICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICB0aXRsZTp0YXNrLnZpc2libGU/J/CfkYDlj6/op4YnOifwn5GA5LiN5Y+v6KeGJyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxuICAgICAgICAgICAgICAgIHVybDokKCkubGF6eVJ1bGUoKHRhc2spID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHt0YXNrQ2hhbmdlVmlzaWJsZX0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS91dGlscz9ydWxlPVxcXCIrTVlfUlVMRS50aXRsZSk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gdGFza0NoYW5nZVZpc2libGUodGFzay5pZCk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK3Jlc3VsdDtcXG4gICAgICAgICAgICAgICAgfSx0YXNrKSxcXG4gICAgICAgICAgICB9XFxuICAgICAgICApO1xcbiAgICB9XFxuXFxuICAgIGl0ZW1zLnB1c2goXFxuICAgICAgICB7XFxuICAgICAgICAgICAgdGl0bGU6J+Wkh+azqCcsXFxuICAgICAgICAgICAgZGVzYzpzbWFsbCh0YXNrLm5vdGUpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcXG4gICAgICAgICAgICB1cmw6J3RvYXN0Oi8vJyt0YXNrLm5vdGVcXG4gICAgICAgIH1cXG4gICAgKTtcXG5cXG4gICAgaXRlbXMucHVzaCh7XFxuICAgICAgICB0aXRsZTon4pyNcHl0aG9u5Luj56CBOicsXFxuICAgICAgICBjb2xfdHlwZTondGV4dF8xJyxcXG4gICAgICAgIHVybDonaGlrZXI6Ly9lbXB0eSdcXG4gICAgfSlcXG5cXG4gICAgaXRlbXMucHVzaChcXG4gICAgICAgIHtcXG4gICAgICAgICAgICB0aXRsZTp0YXNrLnB5Y29kZSxcXG4gICAgICAgICAgICBjb2xfdHlwZTonbG9uZ190ZXh0J1xcbiAgICAgICAgfVxcbiAgICApO1xcbn1cXG5yZXMuZGF0YSA9IGl0ZW1zO1xcbnN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F90eXBlOidtb3ZpZV8xX3ZlcnRpY2FsX3BpYycsXFxcXG4gICAgICAgICAgICBwaWNfdXJsOidodHRwczovL2FwaS5tdHlxeC5jbi9hcGkvcmFuZG9tLnBocD90PScrTWF0aC5yYW5kb20oKSxcXFxcbiAgICAgICAgICAgIHVybDohY2FuX2RlbGV0ZT8naGlrZXI6Ly9lbXB0eSc6JChcXFxcXFxcIuehruiupOWIoOmZpD9cXFxcXFxcIikuY29uZmlybSgodGFzayxob3N0LGhvdXNlX2RhdGEpPT57XFxcXG4gICAgICAgICAgICAgICAgbGV0IGRlbF91cmwgPSBob3N0KycvaGlrZXJ1bGUvdGFzay9kZWxldGUvJyt0YXNrLmlkKyc/bmFtZT0nK2hvdXNlX2RhdGEudXNlcm5hbWUrJyZwYXNzd29yZD0nK2hvdXNlX2RhdGEucGFzc3dvcmQ7XFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3VsdCA9IEpTT04ucGFyc2UoZmV0Y2goZGVsX3VybCx7fSkpO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZihyZXN1bHQuc3RhdHVzPT09MCl7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBiYWNrKHRydWUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly9cXFxcXFxcIityZXN1bHQuZGV0YWlsO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Ye66ZSZ5LqGOlxcXFxcXFxcblxcXFxcXFwiK2UubWVzc2FnZTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgIH0sdGFzayxhcGkuaG9zdCxob3VzZV9kYXRhKSxcXFxcbiAgICAgICAgfVxcXFxu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ZmxleF9idXR0b24nLFxcXFxuICAgICAgICAgICAgdXJsOlxcXFxcXFwiaGlrZXI6Ly9wYWdlL3Rlc3RfcnVuI25vSGlzdG9yeSNcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgdGFzazp0YXNrLFxcXFxuICAgICAgICAgICAgICAgIGhvc3Q6YXBpLmhvc3QsXFxcXG4gICAgICAgICAgICAgICAgaG91c2VfZGF0YTpob3VzZV9kYXRhXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1cXFxcbiAgICApO1xcXFxuXFxcXG4gICAgaWYoY2FuX3VwZGF0ZSl7XFxcXG4gICAgICAgIGl0ZW1zLnB1c2goXFxcXG4gICAgICAgICAgICB7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6J+KWtumHjeWPkeW4gycsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxcXG4gICAgICAgICAgICAgICAgdXJsOidoaWtlcjovL3BhZ2UvbmV3X3Rhc2sjbm9IaXN0b3J5IycsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGFzazp0YXNrLFxcXFxuICAgICAgICAgICAgICAgICAgICAvLyBob3N0OmFwaS5ob3N0LFxcXFxuICAgICAgICAgICAgICAgICAgICAvLyBob3VzZV9kYXRhOmhvdXNlX2RhdGFcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICk7XFxcXG4gICAgICAgIGl0ZW1zLnB1c2goXFxcXG4gICAgICAgICAgICB7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6J/CfjYfku7vliqHmlLnlkI0nLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcXFxuICAgICAgICAgICAgICAgIHVybDokKHRhc2submFtZSwgXFxcXFxcXCLovpPlhaXmlrDnmoTku7vliqHlkI3np7BcXFxcXFxcIikuaW5wdXQoKHRhc2spID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcXFxcXCLnoa7orqTlsIZcXFxcXFxcIit0YXNrLm5hbWUrXFxcXFxcXCLkv67mlLnkuLo6XFxcXFxcXCIraW5wdXQrJyA/JykuY29uZmlybSgoaW5wdXQsdGFzayk9PntcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxvZyh0YXNrLmlkKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHt0YXNrUmVuYW1lfSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS91dGlscz9ydWxlPVxcXFxcXFwiK01ZX1JVTEUudGl0bGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHRhc2tSZW5hbWUodGFzay5pZCxpbnB1dCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGJhY2sodHJ1ZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL1xcXFxcXFwiK3Jlc3VsdDtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSxpbnB1dCx0YXNrKTtcXFxcbiAgICAgICAgICAgICAgICB9LHRhc2spLFxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICApO1xcXFxuXFxcXG4gICAgICAgIGl0ZW1zLnB1c2goXFxcXG4gICAgICAgICAgICB7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6J/CfjbDmm7TmlLnliIbkuqvnirbmgIEnLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcXFxuICAgICAgICAgICAgICAgIHVybDokKCkubGF6eVJ1bGUoKHRhc2spID0+IHtc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ly93d3cuZmhkcS5uZXQvZW1vamkvbGlzdF8nK2NhdGUrJy5odG1sJyxcXFxcbiAgICAgICAgb3B0aW9uczoge1xcXFxuICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgIFxcXFxcXFwiVXNlci1BZ2VudFxcXFxcXFwiOiBcXFxcXFxcIkRhcnQvMi4xMyAoZGFydDppbylcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgIHRpbWVvdXQ6IDUwMDBcXFxcbiAgICAgICAgfVxcXFxuICAgIH0pO1xcXFxufVxcXFxudmFyIGJodG1sID0gYmF0Y2hGZXRjaChEYXRhKTtcXFxcbmZvcih2YXIgYnRoIG9mIGJodG1sKXtcXFxcbiAgICBsZXQgZW1vamlfY2F0ZSA9IHBkZmEoYnRoLCcubGlzdGJveCYmbGknKTtcXFxcbiAgICAvLyBsb2coZW1vamlfY2F0ZSk7XFxcXG4gICAgZm9yKGxldCBjYXRlIG9mIGVtb2ppX2NhdGUpe1xcXFxuICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgbGV0IHRpdGxlID0gcGRmaChjYXRlLCdsaSYmVGV4dCcpO1xcXFxuICAgICAgICAgICAgaWYodGl0bGUucmVwbGFjZSgvW1xcXFxcXFxcc10vZywnJykubGVuZ3RoPjApe1xcXFxuICAgICAgICAgICAgICAgIGxldCB1cmwgPSAnaHR0cDovL3d3dy5maGRxLm5ldCcrcGRmaChjYXRlLCdhJiZocmVmJyk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHRpcHMgPSBnZXRWYXIoJ25vd19lbW9qaV91cmwnKT09PXVybD8n4pyMJzonJztcXFxcbiAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UoJ2Vtb2ppJywnJykrdGlwcztcXFxcbiAgICAgICAgICAgICAgICBkLnB1c2goXFxcXG4gICAgICAgICAgICAgICAgICAgIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOnRpdGxlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiQoKS5sYXp5UnVsZSgodXJsLHRpdGxlKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKCdub3dfZW1vamlfdXJsJyx1cmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lvZPliY1lbW9qaeWIhuexuzonK3RpdGxlO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSx1cmwsdGl0bGUpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICApO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGNhdGNoIChlKSB7XFxcXG5cXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbn1cXFxcblxcXFxubGV0IGh0bWw9ZmV0Y2goZ2V0VmFyKCdub3dfZW1vamlfdXJsJykpO1xcXFxubGV0IGVtb2ppX2xpc3QgPSBwZGZhKGh0bWwsJy5lbW9qaWxpc3RwYyYmbGknKTtcXFxcbmZvcih2YXIgZW1vamkgb2YgZW1vamlfbGlzdCl7XFxcXG4gICAgbGV0IHRpdGxlID0gcGRmaChlbW9qaSwnbGkmJlRleHQnKTtcXFxcbiAgICBkLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTp0aXRsZSxcXFxcbiAgICAgICAgY29sX3R5cGU6J2ZsZXhfYnV0dG9uJyxcXFxcbiAgICAgICAgdXJsOidjb3B5Oi8vJyt0aXRsZVxcXFxuICAgIH0pO1xcXFxufVxcXFxuc2V0UmVzdWx0KGQpO1xcXCJ9XVwifSIsInBpY1VybCI6Imh0dHBzOi8vYXBpLm10eXF4LmNuL2FwaS9yYW5kb20ucGhwP3Q9MC4yNTYyMTYzNDMyNDUxNTU4NSIsInRpdGxlIjoiaWt1dXXnrb7liLAifQ==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement