Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥梦魇幻景录@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZGlzcGxheU5hbWVcIjpcIuW9seinhuWkp+WFqFwiLFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJqczooXFxuZnVuY3Rpb24gKGFwcHR5cGUsIGFwcFVybCkge1xcbiAgICBsZXQgY2hwID0gW107XFxuICAgIHRyeSB7XFxuICAgICAgICBsZXQgY29udHMgPSBbXSwgaHRtbCA9IEpTT04ucGFyc2UoZmV0Y2goTVlfVVJMLnNwbGl0KFxcXCIjI1xcXCIpWzFdLCB7aGVhZGVyczoge1xcXCJVc2VyLUFnZW50XFxcIjogXFxcIkRhcnQvMi4xMyAoZGFydDppbylcXFwifX0pKTtcXG4gICAgICAgIGlmIChhcHB0eXBlLmluY2x1ZGVzKFxcXCJUVlxcXCIpKSB7XFxuICAgICAgICAgICAgY29udHMgPSBPYmplY3Qua2V5cyhodG1sLnZpZGVvbGlzdCk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGlmIChhcHBVcmwuaW5jbHVkZXMoXFxcImFwaS5waHAvYXBwL1xcXCIpKSB7XFxuICAgICAgICAgICAgICAgIGNvbnRzID0gaHRtbC5kYXRhLnZvZF91cmxfd2l0aF9wbGF5ZXI7XFxuICAgICAgICAgICAgICAgIGlmIChjb250cy5sZW5ndGggPCAxKSB7XFxuICAgICAgICAgICAgICAgICAgICBjb250cyA9IGh0bWwuZGF0YS52b2RfcGxheV91cmwuc3BsaXQoXFxcIiQkJFxcXCIpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKGFwcFVybC5pbmNsdWRlcyhcXFwieGdhcHAucGhwL3YxL1xcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICBjb250cyA9IGh0bWwuZGF0YS52b2RfaW5mby52b2RfdXJsX3dpdGhfcGxheWVyO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnRzLmxlbmd0aCA8IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250cyA9IGh0bWwuZGF0YS52b2RfaW5mby52b2RfcGxheV91cmwuc3BsaXQoXFxcIiQkJFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgY29udHMgPSBodG1sLmRhdGEudm9kX3BsYXlfbGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChjb250cy5sZW5ndGggPCAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udHMgPSBodG1sLmRhdGEudm9kX3BsYXlfdXJsLnNwbGl0KFxcXCIkJCRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBsaXN0ID0gW107XFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNvbnRzLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgaWYgKGFwcHR5cGUuaW5jbHVkZXMoXFxcIlRWXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IGh0bWwudmlkZW9saXN0W2NvbnRzW2ldXTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBpZiAoY29udHNbaV0udXJscykge1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IGNvb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XCIpXCJ9LHtcIm5hbWVcIjpcIuinhumikeino+aekFwiLFwicGF0aFwiOlwibGF6eVBhcnNlXCIsXCJydWxlXCI6XCIoXFxuZnVuY3Rpb24gKCkge1xcbiAgICByZXR1cm4gJChcXFwiXFxcIikubGF6eVJ1bGUoKHB0YWIsIHZsaW5rLCBqeFVybCwgYXBwVXJsKSA9PiB7XFxuICAgICAgICBsb2coXFxcIlxcXFx1ODljNlxcXFx1OTg5MVxcXFx1OTRmZVxcXFx1NjNhNTpcXFwiICsgdmxpbmspO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBmdW5jdGlvbiBjaGFuZ2VWaWRlb1VybCh1cmwpIHtcXG4gICAgICAgICAgICAgICAgaWYgKHVybC5pbmNsdWRlcyhcXFwid2tmaWxlXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9IHVybCArIFxcXCI7e1JlZmVyZXJAaHR0cHM6Ly9mYW50dWFuLndrZmlsZS5jb20vfVxcXCI7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAocHRhYiA9PSBcXFwiYmlsaWJpbGlcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gdXJsICsgXFxcIjt7UmVmZXJlckBodHRwczovL3d3dy5iaWxpYmlsaS5jb20vJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwdGFiID09IFxcXCJtZ3R2XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSB1cmwgKyBcXFwiO3tSZWZlcmVyQHd3dy5tZ3R2LmNvbSYmVXNlci1BZ2VudEBNb3ppbGxhLzUuMH1cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwuaW5jbHVkZXMoXFxcIm9qYmtcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gdXJsICsgXFxcIjt7UmVmZXJlckBodHRwczovL2Jhay5vamJranguY29tL31cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmICghdXJsLmluY2x1ZGVzKFxcXCJodHRwXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwiXFxcXHU5NGZlXFxcXHU2M2E1XFxcXHU0ZTBkXFxcXHU2NjJmXFxcXHU0ZWU1aHR0cFxcXFx1NWYwMFxcXFx1NTkzNFxcXCIpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9cXFxcLm0zdTgvLnRlc3QodXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWNoZU0zdTgodXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybCArIFxcXCIjaXNWaWRlbz10cnVlI1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKC9cXFxcLm0zdTh8XFxcXC5tcDR8b2JqXFxcXC90b3N8bmV0ZWFzZVxcXFwuY29tLy50ZXN0KHZsaW5rKSAmJiAvaHR0cC8udGVzdCh2bGluaykgJiYgIS9cXFxcLmh0bWwvLnRlc3QodmxpbmspKSB7XFxuICAgICAgICAgICAgICAgIGxldCBwdXJsID0gdmxpbms7XFxuICAgICAgICAgICAgICAgIGlmIChwdGFiLmluY2x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G9rZW4gPSBodG1sLm1hdGNoKC9sZV90b2tlbi4qPS4qXFxcIiguKilcXFwiLylbMV0sIHVybCA9IGh0bWwubWF0Y2goL1xcXCJ1cmxcXFwiLio6LipcXFwiKC4qKVxcXCIvKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKGdldENyeXB0b0pTKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIERlKHdvcmQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGtleSA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKFxcXCJBNDJFQUMwQzJCNDA4NDcyXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpdiA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKHRva2VuKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIENyeXB0b0pTLkFFUy5kZWNyeXB0KHdvcmQsIGtleSwge2l2OiBpdiwgbW9kZTogQ3J5cHRvSlMubW9kZS5DQkMsIHBhZGRpbmc6IENyeXB0b0pTLnBhZC5Qa2NzN30pLnRvU3RyaW5nKENyeXB0b0pTLmVuYy5VdGY4KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHVybCA9IERlKHVybCk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNoYW5nZVZpZGVvVXJsKHB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAocHRhYi5pbmNsdWRlcyhcXFwibmV0ZmxpeG1vbVxcXCIpIHx8IC9ebmV0ZmxpeG1vbS8udGVzdCh2bGluaykpIHtcXG4gICAgICAgICAgICAgICAganhVcmwgPSBcXFwiaHR0cHM6Ly9kcC5rb25nYnV5YS5jb20vanNvbi5waHA/dXJsPVxcXCI7XFxuICA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AgICAgICAgICAgICBwdXJsID0gcmVkdXJsLnN1YnN0cmluZyhyZWR1cmwuaW5kZXhPZihcXFwiPWh0dHBcXFwiKSArIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBjaGFuZ2VWaWRlb1VybChwdXJsKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IGh0bWwgPSBzY29kZS5ib2R5O1xcbiAgICAgICAgICAgIGlmICgvNDA0IE5vdCBGb3VuZHzlpIfmoYjlkI7lj6/nu6fnu63orr/pl64vLnRlc3QoaHRtbCkpIHtcXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCI0MDRcXFxcdTRlODZcXFwiKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBpZiAoL1xcXFw8Ym9keS8udGVzdChodG1sKSkge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKFxcXCJcXFxcdTVjMWRcXFxcdThiZDVcXFxcdTRlY2VcXFxcdTdmNTFcXFxcdTk4NzVcXFxcdTU1YzVcXFxcdTYzYTJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlcXVpcmVDYWNoZShcXFwiaHR0cHM6Ly9jb2RlLmFsaXl1bi5jb20vbHprMjM1NTkvUHVibGljUnVsZS9yYXcvbWFzdGVyL3g1cnVsZS5qc1xcXCIsIDI0KTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB4NXJ1bGUobGluaywgbGluayk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsb2coXFxcIlxcXFx1NWMxZFxcXFx1OGJkNVxcXFx1NGVjZVxcXFx1OTc1ZVxcXFx1N2Y1MVxcXFx1OTg3NVxcXFx1NTVjNVxcXFx1NjNhMlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICA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lZmVyZXJAd3d3Lm1ndHYuY29tJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsLmluY2x1ZGVzKFxcXFxcXFwib2pia1xcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSB1cmwgKyBcXFxcXFxcIjt7UmVmZXJlckBodHRwczovL2Jhay5vamJranguY29tL31cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgaWYgKCF1cmwuaW5jbHVkZXMoXFxcXFxcXCJodHRwXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFxcXFxcIlxcXFxcXFxcdTk0ZmVcXFxcXFxcXHU2M2E1XFxcXFxcXFx1NGUwZFxcXFxcXFxcdTY2MmZcXFxcXFxcXHU0ZWU1aHR0cFxcXFxcXFxcdTVmMDBcXFxcXFxcXHU1OTM0XFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICgvXFxcXFxcXFwubTN1OC8udGVzdCh1cmwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2FjaGVNM3U4KHVybCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgXFxcXFxcXCIjaXNWaWRlbz10cnVlI1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4g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gXFxcXFxcXCIzMDFcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgIGxldCByZWR1cmwgPSBzY29kZS5oZWFkZXJzLmxvY2F0aW9uWzBdLnJlcGxhY2UoL1xcXFxcXFxcXFxcXFxcXFwvZywgXFxcXFxcXCJcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgbG9nKFxcXFxcXFwiXFxcXFxcXFx1OTFjZFxcXFxcXFxcdTViOWFcXFxcXFxcXHU1NDExOlxcXFxcXFwiICsgcmVkdXJsKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcHVybCA9IHJlZHVybDtcXFxcbiAgICAgICAgICAgICAgICBpZiAoL1xcXFxcXFxcPWh0dHAvLnRlc3QocmVkdXJsKSAmJiAvaHRtbHxiaWxpYmlsaS8udGVzdChyZWR1cmwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1cmwgPSBKU09OLnBhcnNlKGZldGNoKHJlZHVybCwge30pKS51cmw7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9cXFxcXFxcXD1odHRwLy50ZXN0KHJlZHVybCkgJiYgL1xcXFxcXFxcLm0zdTh8XFxcXFxcXFwubXA0fFxcXFxcXFxcLmZsdi8udGVzdChyZWR1cmwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXJsID0gcmVkdXJsLnN1YnN0cmluZyhyZWR1cmwuaW5kZXhPZihcXFxcXFxcIj1odHRwXFxcXFxcXCIpICsgMSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNoYW5nZVZpZGVvVXJsKHB1cmwpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgbGV0IGh0bWwgPSBzY29kZS5ib2R5O1xcXFxuICAgICAgICAgICAgaWYgKC80MDQgTm90IEZvdW5kfO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Sign In to add comment
Advertisement