Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:网页插件¥js_url¥global_大人的Greasyfork@base64://Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICBHcmVhc3lmb3JrIFNlYXJjaCB3aXRoIFNsZWF6eWZvcmsgUmVzdWx0cyBpbmNsdWRlCi8vIEBuYW1lOnpoLUNOICAg5aSn5Lq655qER3JlYXN5Zm9yawovLyBAbmFtZTp6aC1UVyAgIOWkp+S6uueahEdyZWFzeWZvcmsKLy8gQG5hbWU6amEgICAgICDlpKfkurrjga5HcmVhc3lmb3JrCi8vIEBuYW1lc3BhY2UgICAgaG9vdGhpbgovLyBAdmVyc2lvbiAgICAgIDEuNi4zCi8vIEBkZXNjcmlwdGlvbiAgTWVyZ2UgYWR1bHQgcmVzdWx0cyBvZiBzbGVhenlmb3JrIGludG8gZ3JlYXN5Zm9yayB3aGVuIHRoZSBzY3JpcHQgaXMgbm8gbG9uZ2VyIGFub255bW91c2x5IGF2YWlsYWJsZSwgYWRkIHJhdGluZyBzY29yZSBhbmQgdmVyc2lvbiBmb3Igc2NyaXB0cyB0aGVuCi8vIEBkZXNjcmlwdGlvbjp6aC1DTiDlnKhHcmVhc3lmb3Jr55qE5pCc57Si57uT5p6c5Lit5re75YqgU2xlYXp5Zm9ya+S4iueahOaIkOS6uuiEmuacrO+8jOWinuWKoOivhOWIhuS4jueJiOacrOWPt++8jOW5tuWcqOiuv+mXruWMv+WQjeS4jeWPr+eUqOiEmuacrOaXtui3s+i9rOiHs1NsZWF6eWZvcmsKLy8gQGRlc2NyaXB0aW9uOnpoLVRXIOWcqEdyZWFzeWZvcmvnmoTmkJzntKLntZDmnpzkuK3mt7vliqBTbGVhenlmb3Jr5LiK55qE5oiQ5Lq66IWz5pys77yM5aKe5Yqg6KmV5YiG6IiH54mI5pys6Jmf77yM5Lim5Zyo6Kiq5ZWP5Yy/5ZCN5LiN5Y+v55So6IWz5pys5pmC6Lez6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J5ewogICAgICAgICAgICAgICAgcmV0dXJuIHdpbmRvdy5vcGVyYS5zY3JpcHRTdG9yYWdlOwogICAgICAgICAgICB9Y2F0Y2goZSl7CiAgICAgICAgICAgIH07CiAgICAgICAgfSkoKSwKICAgICAgICBzZXRJdGVtOmZ1bmN0aW9uKGtleSx2YWx1ZSl7CiAgICAgICAgICAgIGlmKHRoaXMub3BlcmFVSlNTdG9yYWdlKXsKICAgICAgICAgICAgICAgIHRoaXMub3BlcmFVSlNTdG9yYWdlLnNldEl0ZW0oa2V5LHZhbHVlKTsKICAgICAgICAgICAgfWVsc2UgaWYodGhpcy5teEFwcFN0b3JhZ2UpewogICAgICAgICAgICAgICAgdGhpcy5teEFwcFN0b3JhZ2Uuc2V0Q29uZmlnKGtleSx2YWx1ZSk7CiAgICAgICAgICAgIH1lbHNlIGlmKHRoaXMuc3VwcG9ydEdNKXsKICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKGtleSx2YWx1ZSk7CiAgICAgICAgICAgIH1lbHNlIGlmKHRoaXMuc3VwcG9ydEdNUHJvbWlzZSl7CiAgICAgICAgICAgICAgICBHTS5zZXRWYWx1ZShrZXksdmFsdWUpOwogICAgICAgICAgICB9ZWxzZSBpZih3aW5kb3cubG9jYWxTdG9yYWdlKXsKICAgICAgICAgICAgICAgIHdpbmRvdy5sb2NhbFN0b3JhZ2Uuc2V0SXRlbShrZXksdmFsdWUpOwogICAgICAgICAgICB9OwogICAgICAgIH0sCiAgICAgICAgZ2V0SXRlbTpmdW5jdGlvbihrZXksY2IpewogICAgICAgICAgICB2YXIgdmFsdWU7CiAgICAgICAgICAgIGlmKHRoaXMub3BlcmFVSlNTdG9yYWdlKXsKICAgICAgICAgICAgICAgIHZhbHVlPXRoaXMub3BlcmFVSlNTdG9yYWdlLmdldEl0ZW0oa2V5KTsKICAgICAgICAgICAgfWVsc2UgaWYodGhpcy5teEFwcFN0b3JhZ2UpewogICAgICAgICAgICAgICAgdmFsdWU9dGhpcy5teEFwc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8c2xlYXp5Zm9yaylcLm9yZy8sIi8vJDEiK290aGVyU2l0ZSsiXC5vcmciKTsKICAgICAgICAgICAgfQogICAgICAgIH1lbHNlIGlmKC9cLyhzY3JpcHRzfHVzZXJzKShcL3wuKihcP3wmKXE9fC4qXD9zZXQ9KS8udGVzdChsb2NhdGlvbi5ocmVmKSl7CiAgICAgICAgICAgIF9HTV94bWxodHRwUmVxdWVzdCh7CiAgICAgICAgICAgICAgICBtZXRob2Q6ICdHRVQnLAogICAgICAgICAgICAgICAgdXJsOiBsb2NhdGlvbi5ocmVmLnJlcGxhY2UoL1wvXC8oW15cLl0rXC4pPyhncmVhc3lmb3JrfHNsZWF6eWZvcmspXC5vcmcvLCIvLyQxIitvdGhlclNpdGUrIlwub3JnIiksCiAgICAgICAgICAgICAgICBvbmxvYWQ6IGZ1bmN0aW9uKHJlc3VsdCkgewogICAgICAgICAgICAgICAgICAgIHZhciBkb2MgPSBudWxsOwogICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGRvYyA9IGRvY3VtZW50LmltcGxlbWVudGF0aW9uLmNyZWF0ZUhUTUxEb2N1bWVudCgnJyk7CiAgICAgICAgICAgICAgICAgICAgICAgIGRvYy5kb2N1bWVudEVsZW1lbnQuaW5uZXJIVE1MID0gcmVzdWx0LnJlc3BvbnNlVGV4dDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgY2F0Y2ggKGUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ3BhcnNlIGVycm9yJyk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGlmICghZG9jKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgdmFyIGwgPSBkb2MucXVlcnlTZWxlY3Rvcignb2wuc2NyaXB0LWxpc3QnKTsKICAgICAgICAgICAgICAgICAgICBpZiAobCkgewogICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWwgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCdvbC5zY3JpcHQtbGlzdCcpOwogICAgICAgICAgICAgICAgICAgICAgICBpZighbWwpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgbWw9ZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgib2wiKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1sLnNldEF0dHJpYnV0ZSgiY2xhc3MiLCJzY3JpcHQtbGlzdCIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3Q9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnNpZGViYXJyZWQtbWFpbi1jb250ZW50Jyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHM9bGlzdC5xdWVyeVNlbGVjdG9yQWxsKCJwIik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IobGV0IGk9MDtpPHBzLmxlbmd0aDtpKyspewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwPXBzW2ldOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QucmVtb3ZlQ2hpbGQocCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0LmFwcGVuZENoaWxkKG1sKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2NzPWwucXVlcnlTZWxlY3RvckFsbCgibGkiKTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2NzKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcihsZXQgaT0wO2k8c2NzLmxlbmd0aDtpKyspewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzYz1zY3NbaV07CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIW1sLnF1ZXJ5U2VsZWN0b3IoImxpW2RhdGEtc2NyaXB0LWlkPSciK3NjLmRhdGFzZXQuc2NyaXB0SWQrIiddIikpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2FkZFNjb3JlKHNjKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWwuYXBwZW5kQ2hpbGQoc2MpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICBvbmVycm9yOiBmdW5jdGlvbihlKSB7CiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coZSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pOwogICAgICAgIH0KICAgIH0KCiAgICB2YXIgYnVsbHNoaXQsYnVsbHNoaXRfbz1gdmlwLioo6KeG6aKRfOimlumguyl8572R6K++fOWIt+ivvnwobW9vY3zogIPor5V85a2m5LmgKS4qKOetlOmimHzmjILmnLopfCjnvZHnm5h857ay55ukfOS6keebmCkuKih2aXB855u06ZO+KXzkvJjmg6DlirV85YSq5oOg5Yi4fEFudGlHYW1lfHNwbGl0fEFnYXJ8XFwuaW8oXFxifDp8XFwvfFxcLnwkKXxFeHRlbmNpb25SaXBYQ2hldG9NYWxvfEFwb3NCb3R8REZ4TGl0ZXxaVHgtTGl0ZXxBcG9zRmVlZGluZ0JvdHxBcG9zTG9hZGVyfEJsYWggQmxhaHxPcmMgQ2xhbiBTY3JpcHR8QXN0cm9cXHMqRW1waXJlc3xeXFxzKkF0dGFja3xeXFxzKkJhdHRsZXxCaXRlRmlnaHR8Qmxvb2RcXHMqV2Fyc3xCb3RzfEJvdHM0fEJyYXdsZXJ8XFxiQnZTXFxifEJ1c2luZXNzXFxzKlR5Y29vbnxDYXN0bGVcXHMqQWdlfENpdHl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sKICAgICAgICAgICAgcmVzZXRCdG4ub25jbGljaz0oKT0+ewogICAgICAgICAgICAgICAgc3RvcmFnZS5zZXRJdGVtKCJHZWFzeWZvcmtCdWxsc2hpdCIsIGJ1bGxzaGl0X28pOwogICAgICAgICAgICAgICAgYWxlcnQoIlJlc2V0IG92ZXIiKTsKICAgICAgICAgICAgICAgIGxvY2F0aW9uLnJlbG9hZCgpOwogICAgICAgICAgICAgICAgLy9fR01fbm90aWZpY2F0aW9uKCJSZXNldCBvdmVyIik7CiAgICAgICAgICAgIH07CiAgICAgICAgfQogICAgICAgIGluaXRGaWx0ZXIoKTsKICAgIH0pOwoKICAgIGZ1bmN0aW9uIGFkZFNjb3JlKHNjcmlwdCl7CiAgICAgICAgdmFyIHNlcGFyYXRvcj1zY3JpcHQucXVlcnlTZWxlY3RvcignaDI+c3Bhbi5uYW1lLWRlc2NyaXB0aW9uLXNlcGFyYXRvcicpOwogICAgICAgIHZhciBkZXNjcmlwdGlvbj1zY3JpcHQucXVlcnlTZWxlY3RvcignaDI+c3Bhbi5kZXNjcmlwdGlvbicpOwogICAgICAgIGlmKHNlcGFyYXRvcil7CiAgICAgICAgICAgIHZhciBzY29yZT1kb2N1bWVudC5jcmVhdGVFbGVtZW50KCJzdHJvbmciKTsKICAgICAgICAgICAgc2NvcmUuc3R5bGUuY29sb3I9IiNlMDkwMTUiOwogICAgICAgICAgICBzY29yZS5pbm5lckhUTUw9c2NyaXB0LmRhdGFzZXQuc2NyaXB0UmF0aW5nU2NvcmU7CiAgICAgICAgICAgIHNlcGFyYXRvci5wYXJlbnROb2RlLmluc2VydEJlZm9yZShzY29yZSxzZXBhcmF0b3IpOwogICAgICAgIH0KICAgICAgICBpZihkZXNjcmlwdGlvbil7CiAgICAgICAgICAgIGNvdW50KHNjcmlwdCk7CiAgICAgICAgICAgIHZhciBzY3JpcHRIcmVmPXNjcmlwdC5xdWVyeVNlbGVjdG9yKCdoMj5hJykuaHJlZjsKICAgICAgICAgICAgbGV0IHZ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BfR01feG1saHR0cFJlcXVlc3QoewogICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ0dFVCcsCiAgICAgICAgICAgICAgICAgICAgdXJsOiBzY3JpcHRIcmVmLnJlcGxhY2UoLyguKiktLiovLCIkMS5qc29uIiksCiAgICAgICAgICAgICAgICAgICAgb25sb2FkOiBmdW5jdGlvbihyZXN1bHQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRhdGEgPSBudWxsOwogICAgICAgICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSA9IEpTT04ucGFyc2UocmVzdWx0LnJlc3BvbnNlVGV4dCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgY2F0Y2ggKGUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCdwYXJzZSBlcnJvcicpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGRhdGEpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNldEluZm89aW5mbz0+ewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGluZm8uaW5zdGFsbGVkKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocGFyc2VGbG9hdChpbmZvLnZlcnNpb24pIDwgcGFyc2VGbG9hdCh2ZXJzaW9uKSl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnN0YWxsTGluay5pbm5lckhUTUw9IlVwZGF0ZSB0byB2ZXJzaW9uICIrdmVyc2lvbjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYocGFyc2VGbG9hdChpbmZvLnZlcnNpb24pID4gcGFyc2VGbG9hdCh2ZXJzaW9uKSl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnN0YWxsTGluay5pbm5lckhUTUw9IkRvd25ncmFkZSB0byB2ZXJzaW9uICIrdmVyc2lvbjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnN0YWxsTGluay5pbm5lckhUTUw9IlJlaW5zdGFsbCB2ZXJzaW9uICIrdmVyc2lvbjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWluZm8uZW5hYmxlZCl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnN0YWxsTGluay5zdHlsZS5iYWNrZ3JvdW5kQ29sb3I9IiM2YTZhNmEiOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluc3RhbGxMaW5rLnN0eWxlLmJhY2tncm91bmRDb2xvcj0iIjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnN0YWxsTGluay5pbm5lckhUTUw9Ikluc3RhbGwgdmVyc2lvbiAiK3ZlcnNpb247CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHdpbmRvdy5leHRlcm5hbC5UYW1wZXJtb25rZXkpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5leHRlcm5hbC5UYW1wZXJtb25rZXkuaXNJbnN0YWxsZWQoZGF0YS5uYW1lLCBkYXRhLm5hbWVzcGFjZSwgZT0+ewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRJbmZvKGUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYod2luZG93LmV4dGVybmFsLlZpb2xlbnRtb25rZXkpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5leHRlcm5hbC5WaW9sZW50bW9ua2V5LmlzSW5zdGFsbGVkKGRhdGEubmFtZSwgZGF0YS5uYW1lc3BhY2UpLnRoZW4oZT0+ewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRJbmZvKGUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIH07CiAgICAgICAgICAgIGlmKCF3aW5kb3cuZXh0ZXJuYWwuVGFtcGVybW9ua2V5ICYmICF3aW5kb3cuZXh0ZXJuYWwuVmlvbGVudG1vbmtleSl7CiAgICAgICAgICAgICAgICBjaGVja0luZm8uc3R5bGUuZGlzcGxheT0ibm9uZSI7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gY291bnQoc2NyaXB0KXsKICAgICAgICBpZighaW5Vc2VyUGFnZSlyZXR1cm47CiAgICAgICAgdmFyIGRhaWx5U3Bhbj1zY3JpcHQucXVlcnlTZWxlY3RvcigiZGQuc2NyaXB0LWxpc3QtZGFpbHktaW5zdGFsbHM+c3BhbiIpOwogICAgICAgIGlmKCFkYWlseVNwYW4pcmV0dXJuOwogICAgICAgIHZhciBkYWlseUNvdW50PXBhcnNlSW50KGRhaWx5U3Bhbi5pbm5lckhUTUwucmVwbGFjZSgvW15cZFwuXC1dL2csIiIpKTsKICAgICAgICB2YXIgdG90YWxDb3VudD1wYXJzZUludChzY3JpcHQucXVlcnlTZWxlY3Rvcigi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IHN3aXRjaEZpbHRlcj1kb2N1bWVudC5jcmVhdGVFbGVtZW50KCJkaXYiKTsKICAgICAgICAgICAgICAgIHZhciBNdXRhdGlvbk9ic2VydmVyID0gd2luZG93Lk11dGF0aW9uT2JzZXJ2ZXIgfHwgd2luZG93LldlYktpdE11dGF0aW9uT2JzZXJ2ZXIgfHwgd2luZG93Lk1vek11dGF0aW9uT2JzZXJ2ZXI7CiAgICAgICAgICAgICAgICB2YXIgb2JzZXJ2ZXIgPSBuZXcgTXV0YXRpb25PYnNlcnZlcihmdW5jdGlvbihyZWNvcmRzKXsKICAgICAgICAgICAgICAgICAgICByZWNvcmRzLm1hcChmdW5jdGlvbihyZWNvcmQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgZm9yKHZhciBpPTA7aTxyZWNvcmQuYWRkZWROb2Rlcy5sZW5ndGg7aSsrKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjdXJOb2RlPXJlY29yZC5hZGRlZE5vZGVzW2ldOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoY3VyTm9kZS5jbGFzc05hbWU9PSJzY3JpcHQtbGlzdCIpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzY3JpcHRzPWN1ck5vZGUucXVlcnlTZWxlY3RvckFsbCgnbGknKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IobGV0IGk9MDtpPHNjcmlwdHMubGVuZ3RoO2krKyl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzY3JpcHQ9c2NyaXB0c1tpXTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkU2NvcmUoc2NyaXB0KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZW5hYmxlRmlsdGVyKWZpbHRlcihjdXJOb2RlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKGN1ck5vZGUudGFnTmFtZT09IkxJIil7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkU2NvcmUoY3VyTm9kZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZW5hYmxlRmlsdGVyKWZpbHRlcihjdXJOb2RlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICB2YXIgb3B0aW9uID0gewogICAgICAgICAgICAgICAgICAgICdjaGlsZExpc3QnOiB0cnVlCiAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgb2JzZXJ2ZXIub2JzZXJ2ZShkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCJib2R5Pi53aWR0aC1jb25zdHJhaW50IC5zaWRlYmFycmVkLW1haW4tY29udGVudCIpLCBvcHRpb24pOwogICAgICAgICAgICAgICAgdmFyIHNjcmlwdExpc3Q9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiI2Jyb3dzZS1zY3JpcHQtbGlzdCwjdXNlci1zY3JpcHQtbGlzdCxvbC5zY3JpcHQtbGlzdCIpOwogICAgICAgICAgICAgICAgaWYoc2NyaXB0TGlzdClvYnNlcnZlci5vYnNlcnZlKHNjcmlwdExpc3QsIG9wdGlvbik7CiAgICAgICAgICAgICAgICB2YXIgc2NyaXB0cz1kb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCdvbC5zY3JpcHQtbGlzdD5saScpOwogICAgICAgICAgICAgICAgZm9yKGxldCBpPTA7aTxzY3JpcHRzLmxlbmd0aDtpKyspewogICAgICAgICAgICAgICAgICAgIGxldCBzY3JpcHQ9c2NyaXB0c1tpXTsKICAgICAgICAgICAgICAgICAgICBhZGRTY29yZShzY3JpcHQpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLy9Nb2RpZnkgZnJvbSBHcmVhc3lGb3JrIEJ1bGxzaGl0IEZpbHRlcixUaGFua3MgdG8gZGFya3JlZAogICAgICAgICAgICAgICAgdmFyIHN0eWxlID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnc3R5bGUnKTsKICAgICAgICAgICAgICAgIHN0eWxlLnRleHRDb250ZW50ID0gYAogICAgICAgICAgICAgICAgbGkuZmlsdGVyZWQgewogICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBub25lICFpbXBvcnRhbnQ7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAubGlzdC1vcHRpb257CiAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiByZWxhdGl2ZTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICNzY3JpcHQtbGlzdC1zb3J0IGxpPnNwYW57CiAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICAgICAgICAgICAgICAgICAgICAgdG9wOiA0cHg7CiAgICAgICAgICAgICAgICAgICAgIHJpZ2h0OiAycHg7CiAgICAgICAgICAgICAgICAgICAgIHBvaW50ZXItZXZlbnRzOiBub25lOwogICAgICAgICAgICAgICAgICAgICBmb250LXdlaWdodDogNTAwOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgI3NjcmlwdC1saXN0LXNvcnQgbGk+c3BhbjpsYW5nKGFyKSwgI3NjcmlwdC1saXN0LXNvcnQgbGk+c3BhbjpsYW5nKGhlKSwgI3NjcmlwdC1saXN0LXNvcnQgbGk+c3BhbjpsYW5nKHVnKXsKICAgICAgICAgICAgICAgICAgICAgcmlnaHQ6IHVuc2V0OwogICAgICAgICAgICAgICAgICAgICBsZWZ0OiAycHg7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAjc2NyaXB0LWxpc3Qtc29ydCBsaT5zcGFuPnNwYW57CiAgICAgICAgICAgICAgICAgICAgIG1hcmdpbjogMCAwIDAgMnB4OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnNjcmlwdC1saXN0PmxpIC5saXN0LWluc3RhbGwtYXJlYXsKICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgZmxvYXQ6IHJpZ2h0OwogICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogcmVsYXRpdmU7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuc2NyaXB0LWxpc3Q+bGk6aG92ZXIgLmxpc3QtaW5zdGFsbC1hcmVhIHsKICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogYmxvY2s7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBALXdlYmtpdC1rZXlmcmFtZXMgc3BpbiB7CiAgICAgICAgICAgICAgICAgZnJvbSB7CiAgICAgICAgICAgICAgICAgICAgIC13ZWJraXQtdHJhbnNmb3JtOiByb3RhdGUoMGRlZyk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIHRvIHsKICAgICAgICAgICAgICAgICAgICAgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIEBrZXlmcmFtZXMgc3BpbiB7CiAgICAgICAgICAgICAgICAgZnJvbSB7CiAgICAgICAgICAgICAgICAgICAgIHRyYW5zZm9ybTogcm90YXRlKDBkZWcpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB0byB7CiAgICAgICAgICAgICAgICAgICAgIHRyYW5zZm9ybTogcm90YXRlKDM2MGRlZyk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnJlZnJlc2gtaW5mbzpob3Zlcj5zcGFuIHsKICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogYmxvY2s7CiAgICAgICAgICAgICAgICAgICAgIC13ZWJraXQtYW5pbWF0aW9uOiBzcGluIDFzIGxpbmVhciAxcyA1IGFsdGVybmF0ZTsKICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uOiBzcGluIDFzIGxpbmVhciBpbmZpbml0ZTsKICAgICAgICAgICAgICAgIH1gOwogICAgICAgICAgICAgICAgc3R5bGUudHlwZSA9ICd0ZXh0L2Nzcyc7CiAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCdoZWFkJykuYXBwZW5kQ2hpbGQoc3R5bGUpOwogICAgICAgICAgICAgICAgdmFyIGJ1bGxzaGl0UmVnPW5ldyBSZWdFeHAoYnVsbHNoaXQsImkiKTsKICAgICAgICAgICAgICAgIHZhciBmaWx0ZXJOYW1lPSJFbmFibGUgRmlsdGVyIixmaWx0ZXJlZE51bT0wOwogICAgICAgICAgICAgICAgdmFyIGZpbHRlcj1mdW5jdGlvbih0KXsKICAgICAgICAgICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodC5xdWVyeVNlbGVjdG9yQWxsKCdhcnRpY2xlPmgyJyksIGZ1bmN0aW9uKGl0ZW0pIHsKICAgICAgICAgICAgICAgICAgICAgICAgaWYoYnVsbHNoaXRSZWcudGVzdChpdGVtLmlubmVyVGV4dC5yZXBsYWNlKCJcbiIsIiAiKSkpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5wYXJlbnROb2RlLnBhcmVudE5vZGUuY2xhc3NMaXN0LmFkZCgnZmlsdGVyZWQnKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbHRlcmVkTnVtKys7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgICAgICBpZihlbmFibGVGaWx0ZXIpZmlsdGVyKGRvY3VtZW50KTsKICAgICAgICAgICAgICAgIHN3aXRjaEZpbHRlci5pbm5lckhUTUw9JzxpbnB1dCB0eXBlPSJjaGVja0JveCIgbmFtZT0ic3dpdGNoRmlsdGVyIiBpZD0ic3dpdGNoRmlsdGVyIi8+PGxhYmVsIGZvcj0ic3dpdGNoRmlsdGVyIj4nK2ZpbHRlck5hbWUrKGZpbHRlcmVkTnVtPycgKCcrZmlsdGVyZWROdW0rJyBmaWx0ZXJlZCknOicnKSsnPC9sYWJlbD4nOwogICAgICAgICAgICAgICAgdmFyIHN3aXRjaEZpbHRlckNoZWNrYm94PXN3aXRjaEZpbHRlci5xdWVyeVNlbGVjdG9yKCcjc3dpdGNoRmlsdGVyJyk7CiAgICAgICAgICAgICAgICB2YXIgc3dpdGNoRmlsdGVyTGFiZWw9c3dpdGNoRmlsdGVyQ2hlY2tib3gubmV4dFNpYmxpbmc7CiAgICAgICAgICAgICAgICBzd2l0Y2hGaWx0ZXJDaGVja2JveC5jaGVja2VkPWVuYWJsZUZpbHRlcjsKICAgICAgICAgICAgICAgIHN3aXRjaEZpbHRlckNoZWNrYm94Lm9uY2xpY2s9ZnVuY3Rpb24oKXsKICAgICAgICAgICAgICAgICAgICBpZihlbmFibGVGaWx0ZXIpewogICAgICAgICAgICAgICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwoZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnbGkuZmlsdGVyZWQnKSwgZnVuY3Rpb24oaXRlbSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5jbGFzc0xpc3QucmVtb3ZlKCdmaWx0ZXJlZCcpOwogICAgICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoRmlsdGVyTGFiZWwuaW5uZXJIVE1MPWZpbHRlck5hbWU7CiAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICAgICAgICAgIGZpbHRlcmVkTnVtPTA7CiAgICAgICAgICAgICAgICAgICAgICAgIGZpbHRlcihkb2N1bWVudCk7CiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaEZpbHRlckxhYmVsLmlubmVySFRNTD1maWx0ZXJOYW1lKycgKCcrZmlsdGVyZWROdW0rJyBmaWx0ZXJlZCknOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBzdG9yYWdlLnNldEl0ZW0oImRpc2FibGVGaWx0ZXIiLGVuYWJsZUZpbHRlcik7CiAgICAgICAgICAgICAgICAgICAgZW5hYmxlRmlsdGVyPSFlbmFibGVGaWx0ZXI7CiAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgc29ydERpdi5pbnNlcnRCZWZvcmUoc3dpdGNoRmlsdGVyLHNvcnREaXYuZmlyc3RDaGlsZCk7CiAgICAgICAgICAgIH0pOwogICAgICAgIH0KICAgIH0KfSkoKTs=
Add Comment
Please, Sign In to add comment