Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@樱花动漫(88dm)@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi5qix6Iqx5Yqo5ryrKDg4ZG0pIiwiYXV0aG9yIjoi54uX5rWp5ZWKIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSMjaHR0cHM6Ly93d3cuODU3ZmFuLmNvbS90eXBlL3JpYmVuZG9uZ21hbi1meXBhZ2UuaHRtbCIsInZlcnNpb24iOjQsImNvbF90eXBlIjoibW92aWVfMyIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoidmlkZW8iLCJjbGFzc191cmwiOiIiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbnZhciBkID0gW107XG52YXIgZ2V0UmFuZ2VDb2xvcnMgPSBmdW5jdGlvbigpIHvCoMKgwqDCoMKgwqDCoFxuICAgIHJldHVybiAnIycgKyAoJzAwMDAwJyArIChNYXRoLnJhbmRvbSgpICogMHgxMDAwMDAwIDw8IDApLnRvU3RyaW5nKDE2KSkuc3Vic3RyKC02KTvCoMKgwqDCoMKgXG59XG5cbmNvbnN0IOWIhuexu+minOiJsiA9IGdldFJhbmdlQ29sb3JzKClcbmNvbnN0IOWkp+exu+WumuS9jSA9ICdib2R5JiYubmF2LWxpc3QnXG5jb25zdCDmi7zmjqXliIbnsbsgPSAnYm9keSYmLm15dWktc2NyZWVuX19saXN0Om5vdCg6Y29udGFpbnMo5bey6YCJKSknXG5jb25zdCDlsI/nsbvlrprkvY0gPSAnYm9keS0tYSYmYTpub3QoOmNvbnRhaW5zKOi1hOiurykpJ1xuY29uc3Qg5YiG57G75qCH6aKYID0gJ2EmJlRleHQnXG5jb25zdCDliIbnsbvpk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AgY2Flc2FyQ2lwaGVyOiBmdW5jdGlvbihzdHJpbmdWYWx1ZSwgaykge1xcbiAgICAgICAgdmFyIG5ld1N0cmluZyA9IFxcXCJcXFwiO1xcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzdHJpbmdWYWx1ZS5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgIG5ld1N0cmluZyArPSB0aGlzLm5leHRDaGFyYWN0ZXIoc3RyaW5nVmFsdWVbaV0uY2hhckNvZGVBdCgpLCBrKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBuZXdTdHJpbmc7XFxuICAgIH0sXFxuICAgIGhhbmRsZVVybDogZnVuY3Rpb24odXJsLCB2aXBVcmwsIG5hbWUpIHtcXG4gICAgICAgIGlmICh1cmwgPT0gXFxcIlxcXCIgfHwgdXJsID09IHZpcFVybCkge1xcbiAgICAgICAgICAgIGxvZyhuYW1lICsgXFxcIuino+aekOWksei0pVxcXCIpO1xcbiAgICAgICAgICAgIHJldHVybiB2aXBVcmw7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAodXJsWzBdID09ICcvJykge1xcbiAgICAgICAgICAgIHVybCA9ICdodHRwczonICsgdXJsO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHVybC5pbmRleE9mKCc9aHR0cCcpICE9IC0xKSB7XFxuICAgICAgICAgICAgdXJsID0gdXJsLmluZGV4T2YoJyZ1cmw9JykgPiAtMSA/IHVybCA6ICdodHRwJyArIGRlY29kZVVSSUNvbXBvbmVudCh1cmwuc3BsaXQoJz1odHRwJylbMV0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHZpcFVybC5pbmRleE9mKCdtZ3R2LmNvbScpICE9IC0xICYmIHVybC5pbmRleE9mKCdVc2VyLUFnZW50JykgPT0gLTEpIHtcXG4gICAgICAgICAgICB1cmwgPSB1cmwgKyAnO3tVc2VyLUFnZW50QGFwcH0nO1xcbiAgICAgICAgfSBlbHNlIGlmICh1cmwuaW5kZXhPZignLmZsdicpICE9IC0xKSB7XFxuICAgICAgICAgICAgdXJsID0gdXJsICsgJzt7VXNlci1BZ2VudEBhcHAmJlJlZmVyZXJAJyArIHZpcFVybCArICd9JztcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiB1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnO1xcbiAgICB9XFxufTtcXG5cXG52YXIgUGFyc2VTID0ge307XFxudmFyIG9yaWdpbmFsUGFyc2VTID0ge1xcbiAgICBDaXR5SVA6ICdodHRwOi8vcHYuc29odS5jb20vY2l0eWpzb24nLFxcbiAgICBwY1VBOiAnVXNlci1BZ2VudEBNb3ppbGxhLzUuMCAoV2luZG93cyBOVCAxMC4wXFxcXO+8m1xcXFzvvJsgV09XNjQpIEFwcGxlV2ViS2l0LzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIENocm9tZS80OS4wLjI2MjMuODcgU2FmYXJpLzUzNy4zNicsXFxuICAgIGRlZmF1bHRQYXJzZTogZnVuY3Rpb24odXJsKSB7XFxuICAgICAgICBzaG93TG9hZGluZyhcXFwi5q2j5Zyo6LCD55So572R6aG16Kej5p6QLi4uXFxcIik7XFxuICAgICAgICByZXR1cm4gJCh1cmwpLndlYkxhenkoKCkgPT4ge1xcbiAgICAgICAgICAgIHZhciBVcmxzID0gX2dldFVybHMoKTtcXG4gICAgICAgICAgICB2YXIgUmVnMSA9IC9cXFxcLm1wNHxcXFxcLm0zdThcXFxcP3wubTN1OCR8XFxcXC5mbHZ8XFxcXC5hdml8XFxcXC5ybXZiLztcXG4gICAgICAgICAgICB2YXIgUmVnMiA9IC9wbGF5bTN1OHwuY3NzJHwuanMkfC5pY28kfGNuenpcXFxcLi87XFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBVcmxzLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgIGxldCBpc1VybCA9IFVybHNbaV07XFxuICAgICAgICAgICAgICAgIGlmIChSZWcxLnRlc3QoaXNVcmwpICYmICFSZWcyLnRlc3QoaXNVcmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICBmYmEuaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpc1VybCArIFxcXCIjaXNWaWRlbz10cnVlI1xcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfSxcXG4gICAgbWFvc3M6IGZ1bmN0aW9uKGp4dXJsLCByZWYsIGtleSkge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICB2YXIgZ2V0VmlkZW9JbmZvID0gZnVuY3Rpb24odGV4dCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdG9vbHMuQUVTKHRleHQsIGtleSwgaXYpO1xcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAga2V5ID0ga2V5ID09IHVuZGVmaW5lZCA/ICdkdnlZUlFsblBSQ01kUVNlJyA6IGtleTtcXG4gICAgICAgICAgICBpZiAocmVmKSB7XFxuICAgICAgICAgICAgICAgIHZhciBodG1sID0gcmVxdWVzdChqeHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogcmVmXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHZhciBodG1sID0gcmVxdWVzdChqeHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChodG1sLmluZGV4T2YoJyZidHdhZj0nKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICBodG1sID0gcmVxdWVzdChqeHVybCArICcmYnR3YWYnICsgaHRtbC5tYXRjaCgvJmJ0d2FmKC4qPylcXFwiLylbMV0sIHtcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6IHJlZlxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB2YXIgaXYgPSBodG1sLm1hdGNoKC9bX3Rva2VufF9pdl0gPSBcXFwiKC4qPylcXFwiLylbMV07XFxuICAgICAgICAgICAgZXZhbChodG1sLm1hdGNoKC92YXIgY29uZmlnID0ge1tcXFxcc1xcXFxTXSo/fS8pWzBdICsgJycpO1xcbiAgICAgICAgICAgIGlmIChjb25maWcudXJsLnNsaWNlKDAsIDQpICE9ICdodHRwJykge1xcbiAgICAgICAgICAgICAgICBjb25maWcudXJsID0gZGVjb2RlVVJJQ29tcG9uZW50KHRvb2xzLkFFUyhjb25maWcudXJsLCBrZXksIGl2KSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBjb25maWcudXJsO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJldHVybiAnJztcXG4gICAgICAgIH1cXG4gICAgfSxcXG4gICAgTExROiBmdW5jdGlvbihqeHVybCkge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICB2YXIgYXBpID0ganh1cmwuc3BsaXQoJz91cmw9JylbMF0gKyBcXFwiYXBpLnBocFxcXCI7XFxuICAgICAgICAgICAgdmFyIGI2NGlkID0gYmFzZTY0RW5jb2RlKGp4dXJsLnNwbGl0KCd1cmw9JylbMV0pO1xcbiAgICAgICAgICAgIHZhciBwYXJzZWlkID0gdG9vbHMuY2Flc2FyQ2lwaGVyKGI2NGlkLCAtMSk7XFxuICAgICAgICAgICAgdmFyIGpzb24gPSBKU09OLnBhcnNlKHJlcXVlc3QoYXBpLCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzoganh1cmxcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCcsXFxuICAgICAgICAgICAgICAgIGJvZHk6ICd1cmw9JyArIHBhcnNlaWRcXG4gICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgdXJsID0gKGpzb24uY29kZSA9PSAyMDAgPyBiYXNlNjREZWNvZGUodG9vbHMuY2Flc2FyQ2lwaGVyKGpzb24udXJsLCAtMSkpIDogJycpO1xcbiAgICAgICAgICAgIHJldHVybiB1cmw7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuICcnO1xcbiAgICAgICAgfVxcbiAgICB9LFxcbiAgICBQYW5HdTogZnVuY3Rpb24odmlwVXJsLCBkYXRhKSB7XFxuICAgICAgICAvKnZhciByZWYgPSAnaHR0cHM6Ly93d3cucGFuZ3VqaWV4aS5jb20vJztcXG4gICAgICAgIHZhciBwYXJzZSA9ICdodHRwczovL3Bhbmd1YXBpLm50cnlqZC5uZXQvamlleGkvP3VybD0nICsgdmlwVXJsO1xcbiAgICAgICAgdmFyIGFwaSA9ICdodHRwczovL3Bhbmd1YXBpLm50cnlqZC5uZXQvamlleGkvYXBpLnBocCc7XFxuICAgICAgICAqL1xcbiAgICAgICAgLy92YXIgcmVmID0gJ2h0dHBzOi8veG15c3R2LmNvbS8nO1xcbiAgICAgICAgLy92YXIgcGFyc2UgPSAnaHR0cHM6Ly93d3cuOTlrcHcuY29tL3Bhbmd1L2luZGV4LnBocD91cmw9JyArIHRhaWxVcmw7XFxuICAgICAgICAvL3ZhciBhcGkgPSAnaHR0cHM6Ly93d3cuOTlrcHcuY29tL3Bhbmd1L2FwaS5waHAnO1xcbiAgICAgICAgdmFyIHBhcnNlID0gXFxcImh0dHBzOi8vd3d3LnBhbmd1amlleGkuY29tL3Bhbmd1Lz91cmw9XFxcIiArIHZpcFVybDtcXG4gICAgICAgIHZhciBhcGkgPSBcXFwiaHR0cHM6Ly9wYW5ndWFwaS5udHJ5amQubmV0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JuICcnO1xcbiAgICAgICAgfVxcbiAgICB9LFxcbiAgICBcXFwi8J+lmlxcXCI6IGZ1bmN0aW9uKHZpcFVybCkge1xcbiAgICAgICAgbGV0IOS9nOiAhV/op4bnlYznn6XlkI3lpKfkvaw7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIHZhciBwbGF5ID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cDovL3d3dy56cnVpcnkuY29tL3l1bi9hcGkucGhwXFxcIiwge1xcbiAgICAgICAgICAgICAgICBib2R5OiBcXFwidXJsPVxcXCIgKyBpbnB1dCxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiBcXFwiUE9TVFxcXCJcXG4gICAgICAgICAgICB9KSkudXJsO1xcbiAgICAgICAgICAgIGlmIChwbGF5LnN0YXJ0c1dpdGgoXFxcIi9cXFwiKSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImh0dHBzOlxcXCIgKyBwbGF5O1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBwbGF5O1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcIlxcXCI7XFxuICAgICAgICB9XFxuICAgIH1cXG59O1xcblxcbnZhciBmcm9tcyA9IFsnZHVvZHVvenknLCAncngnLCAncmVucmVubWknLCAnbHRuYicsICd4Znl1biddO1xcbmZvciAobGV0IGkgaW4gZnJvbXMpIHtcXG4gICAgbGV0IG5hbWUgPSBmcm9tc1tpXSArIFxcXCIo6YCa55So5Ye95pWwKVxcXCI7XFxuICAgIFBhcnNlU1tuYW1lXSA9IGZ1bmN0aW9uKFVybCwgcmVmZXJlcikge1xcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVmYXVsdFBhcnNlKHJlZmVyZXIpO1xcbiAgICB9O1xcbn1cXG5PYmplY3QuYXNzaWduKFBhcnNlUywgb3JpZ2luYWxQYXJz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AgICAgICAgcGFyYW0yID0gTVlfUlVMRTtcXG4gICAgICAgIHZhciByZXRTdHIgPSBtZXRob2RfZmV0Y2guaW52b2tlKGphdmFDb250ZXh0LCBwYXJhbTAsIHBhcmFtMSwgcGFyYW0yKTtcXG4gICAgICAgIHJldHVybiByZXRTdHIgPT0gbnVsbCA/IHJldFN0ciA6IHJldFN0ciArIFxcXCJcXFwiO1xcbiAgICB9O1xcbiAgICB2YXIgaG9zdCA9IHZpcFVybC5tYXRjaCgvXFxcXC4oLio/KVxcXFwvLyk7XFxuICAgIGhvc3QgPSBob3N0ID09IG51bGwgPyBudWxsIDogaG9zdFsxXTtcXG4gICAgdmFyIG5vVXJsID0gXFxcInRvYXN0Oi8v5o6l5pS25Yiw55qE6ZO+5o6l5Li6OiBcXFwiO1xcbiAgICBzd2l0Y2ggKG15U2V0LnFqdSkge1xcbiAgICAgICAgY2FzZSBcXFwi6buY6K6kXFxcIjpcXG4gICAgICAgICAgICBzd2l0Y2ggKGhvc3QpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSBcXFwicXEuY29tXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgIHN0ciA9IG15U2V0LnR4O1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgXFxcImlxaXlpLmNvbVxcXCI6XFxuICAgICAgICAgICAgICAgICAgICBzdHIgPSBteVNldC5xeTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlIFxcXCJ5b3VrdS5jb21cXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgc3RyID0gbXlTZXQueWs7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSBcXFwibWd0di5jb21cXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgc3RyID0gbXlTZXQubWc7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSBcXFwiYmlsaWJpbGkuY29tXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgIHN0ciA9IG15U2V0LmJsO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICBzdHIgPSBob3N0ID09IG51bGwgPyBub1VybCA6IG15U2V0Lm90aDtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgc3RyID0gaG9zdCA9PSBudWxsID8gbm9VcmwgOiBteVNldC5xanU7XFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgIH1cXG4gICAgaWYgKHBhcnNlTmFtZSkge1xcbiAgICAgICAgc3RyID0gcGFyc2VOYW1lO1xcbiAgICB9XFxuICAgIGxldCBteUNob2ljZSA9IHN0ci5zcGxpdCgnLCcpO1xcbiAgICBsZXQgbGVuID0gbXlDaG9pY2UubGVuZ3RoO1xcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IGxlbjsgaSsrKSB7XFxuICAgICAgICBsZXQgbmFtZSA9IG15Q2hvaWNlW2ldO1xcbiAgICAgICAgaWYgKHR5cGVvZiBQYXJzZVNbbmFtZV0gPT0gJ2Z1bmN0aW9uJykge1xcbiAgICAgICAgICAgIGxldCB1cmwgPSBQYXJzZVNbbmFtZV0odmlwVXJsKTtcXG4gICAgICAgICAgICBsZXQgUmVnID0gbmV3IFJlZ0V4cChcXFwibTN1OHxtcDR8XFxcIiArIHZpcFVybCArIFxcXCJ8aHR0cFxcXCIpO1xcbiAgICAgICAgICAgIGlmIChpICE9IGxlbiAtIDEgJiYgIVJlZy50ZXN0KHVybCkpIHtcXG4gICAgICAgICAgICAgICAgbG9nKG5hbWUgKyAn6Kej5p6Q5aSx6LSlJyk7XFxuICAgICAgICAgICAgICAgIGNvbnRp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vbTtcXG4gICAgICAgIH0gZWxzZSBpZiAoZHBVcmwgIT0gJycpIHtcXG4gICAgICAgICAgICBVcmwgPSBkcFVybC5zdGFydHNXaXRoKFxcXCJodHRwXFxcIikgPyBkZHBVcmwgOiBkcFVybC5zbGljZSgzKTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgY29kZTIgPSBodG1sLm1hdGNoKC92YXIgbm93W1xcXFxzXFxcXFNdKj92YXIgcG5bXFxcXHNcXFxcU10qPzsvKTtcXG4gICAgICAgICAgICBpZiAoY29kZTIgIT0gbnVsbCkge1xcbiAgICAgICAgICAgICAgICBldmFsKGNvZGUyWzBdKTtcXG4gICAgICAgICAgICAgICAgVXJsID0gbm93O1xcbiAgICAgICAgICAgICAgICBmcm9tID0gcG47XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKFVybC5zdWJzdHIoMCwgOCkubWF0Y2goL0pULi5KVC4uLykgfHwgVXJsLnN0YXJ0c1dpdGgoXFxcImFIUjBcXFwiKSkge1xcbiAgICAgICAgICAgIFVybCA9IGJhc2U2NERlY29kZShVcmwpO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKFVybC5zdWJzdHIoMCwgOCkubWF0Y2goLyUuLiUuLi8pKSB7XFxuICAgICAgICAgICAgVXJsID0gdW5lc2NhcGUoVXJsKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChmcm9tcy5pbmNsdWRlcyhmcm9tKSkge1xcbiAgICAgICAgICAgIHZhciBuYW1lID0gZnJvbSArICco6YCa55So5Ye95pWwKSc7XFxuICAgICAgICAgICAgcmV0dXJuIFBhcnNlU1tuYW1lXShVcmwsIGp1cmwpO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKC9odG1sfGJpbGliaWxpLy50ZXN0KFVybCkpIHtcXG4gICAgICAgICAgICByZXR1cm4gYXl0bVBhcnNlKFVybCk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiBVcmwuc3RhcnRzV2l0aCgnaHR0cCcpID8gVXJsICsgJyNpc1ZpZGVvPXRydWUjJyA6IFBhcnNlUy5kZWZhdWx0UGFyc2UoanVybCk7XFxuICAgICAgICB9XFxuICAgIH0sXFxuICAgIHBsYXllcl94eDogZnVuY3Rpb24oanVybCkge1xcbiAgICAgICAgcmV0dXJuICQoanVybCkubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgIGV2YWwoZmV0Y2goSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb24nKSkuY2opKTtcXG4gICAgICAgICAgICByZXR1cm4gcGxheVBhcnNlLnBsYXllclMoaW5wdXQpO1xcbiAgICAgICAgfSlcXG4gICAgfVxcbn07XFxuXFxuZnVuY3Rpb24gc2V0UGFyc2UoKSB7XFxuICAgIHRoaXMuZCA9IFtdO1xcbiAgICByZXF1aXJlKCdodHRwczovL2hpa2VyZmFucy5jb20vRHVhbk5pYW4vUm91dGUuanMnKTtcXG4gICAgUm91dGUuc2V0UGFyc2UoKTtcXG4gICAgc2V0UmVzdWx0KGQpO1xcbn1cIn1dIiwiaWNvbiI6IiIsInByb3h5IjoiIn0=
Add Comment
Please, Sign In to add comment