Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:网页插件¥js_url¥global_🌈大学摆烂神器🌛支持全网课平台,支持答题|刷资源|视频加速|快速背题|AI搜题|AI问答|@base64://Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICDwn4yI5aSn5a2m5pGG54OC56We5Zmo8J+Mm+aUr+aMgeWFqOe9keivvuW5s+WPsO+8jOaUr+aMgeetlOmimO+9nOWIt+i1hOa6kO+9nOinhumikeWKoOmAn++9nOW/q+mAn+iDjOmimO+9nEFJ5pCc6aKY772cQUnpl67nrZTvvZwKLy8gQHZlcnNpb24gICAgICA1LjQuNQovLyBAZGVzY3JpcHRpb24gIOOAkPCfkK/lhajnvZHlhY3otLnku4XlgZrkuIDmrL7ohJrmnKzwn5Cv44CR44CB44CQ8J+agOW3suWujOe+juWFvOWuueOAgeaZuuaFp+agkeOAgeS4reWbveWkp+Wtpm1vb2PjgIHmhZXor77jgIHpm6jor77loILjgIHmlrDlm73lvIDjgIHotoXmmJ/jgIHlrabkuaDpgJrjgIHnn6XliLDjgIHlm73lrrblvIDmlL7lpKflrabjgIHok53loqjkupHjgIHogYzmlZnkupHjgIHmmbrmhafogYzmlZnjgIHkupHnj63or77nsr7lk4Hor77jgIHlsbHkuJzkuJPmioDjgIHopb/otKLlnKjnur/jgIHliankvZnnvZHnq5nku4XmlK/mjIHpg6jliIblip/og73wn5qA44CR44CQ5Y2K5YW85a6544CB57uO6YCa5LqR44CBVeagoeWbreOAgeWtpuWgguWcqOe6v+OAkeOAgeOAkPCfmI7lroznvo7lupTku5jmtYvor5XvvIzlhajoh6rliqjnrZTpopjvvIzkuIDplK7lrozmiJDmiYDmnInotYTmupDlrabkuaDvvIjop4bpopHmjKjkuKrliLfml7bplb/kuI3lrZjlnKjmu7TvvInjgIHop4bpopHlgI3pgJ/wn5iO44CR44CB44CQ8J+SquaWsOWinkFJ5pCc6aKY44CBQUnpl67nrZTvvIzlr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MID0gc3RyOwogICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCd6aGV6aGFvJykuc3R5bGUuZGlzcGxheT0iIjsKICAgICAgICAKICAgIH0KICAgIAogICAgaWYoR01fZ2V0VmFsdWUoIndpbmRvdy5hbF95dW5feHgiKSAmJiBHTV9nZXRWYWx1ZSgid2luZG93LmFsX3l1bl94eCIpLmxlbmd0aD4xMDApewogICAgICAgIHdpbmRvdy5hbF95dW5feHggPSBHTV9nZXRWYWx1ZSgid2luZG93LmFsX3l1bl94eCIpCiAgICB9ZWxzZXsKICAgICAgICBpZihHTV9nZXRWYWx1ZSgid2luZG93LmFsX3l1bl94eCIpICE9ICJyZXNldCIpewogICAgICAgICAgICBkaWFud28oIuiEmuacrOato+WcqOWKoOi9veS4re+8jOivt+eojeetiTxicj7ml6Dms5XliqDovb3or7fliqBRUee+pDxicj7np7vliqjlpLTlg4/lj6/mlLnlj5jkvY3nva4iKTsKICAgICAgICB9CiAgICAgICAgR01feG1saHR0cFJlcXVlc3QoewogICAgICAgICAgICBtZXRob2Q6ICJHRVQiLAogICAgICAgICAgICB1cmw6IEdNX2dldFZhbHVlKCJjaG9pY2Vfc2VydmVyIik/Imh0dHBzOi8vZC5tZXRvc3QuY29tL3VwbG9hZHMvanMvYWxsLmpzIjoiaHR0cHM6Ly9kLm1ldDAuY24vdXBsb2Fkcy9qcy9hbGwuanMiLAogICAgICAgICAgICBvbmxvYWQ6IHJlcz0+IHsKICAgICAgICAgICAgICAgIHdpbmRvdy5hbF95dW5feHggPSByZXMucmVzcG9uc2U7CiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhyZXMuc3RhdHVzICkKICAgICAgICAgICAgICAgIGlmKHJlcy5zdGF0dXMgPT0gMjAwfHxyZXMuc3RhdHVzID09ICIyMDAiKXsKICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgid2luZG93LmFsX3l1bl94eCIscmVzLnJlc3BvbnNlKTsKICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnemhlemhhbycpLnN0eWxlLmRpc3BsYXk9Im5vbmUiOy8v5Yqg6L295oiQ5Yqf5L6/5Yig5o6J5o+Q56S6CiAgICAgICAgICAgICAgICB9ZWxzZXsKICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgiY2hvaWNlX3NlcnZlciIsIUdNX2dldFZhbHVlKCJjaG9pY2Vfc2VydmVyIikpOwogICAgICAgICAgICAgICAgICAgIGRpYW53bygi6ISa5pys5Yqg6L295aSx6LSlLOivt+WwneivleabtOaNoue9kee7nOOAgumcgOimgeWPr+S7peiuv+mXriBodHRwczovL3YubWV0b3N0LmNvbSDoi6Xlh7rnjrDpqozor4Hkv6Hmga/vvIzor7flrozmiJDpqozor4HljbPlj6/mraPluLjkvb/nlKjohJrmnKwiKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSwKICAgICAgICAgICAgb25lcnJvcjplcnI9PnsKICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCJjaG9pY2Vfc2VydmVyIiwhR01fZ2V0VmFsdWUoImNob2ljZV9zZXJ2ZXIiKSk7CiAgICAgICAgICAgICAgICBkaWFud28oIuiEmuacrOWKoOi9veWksei0pSzor7flsJ3or5Xmm7TmjaLnvZHnu5zjgILpnIDopoHlj6/ku6Xorr/pl64gaHR0cHM6Ly92Lm1ldG9zdC5jb20g6Iul5Ye6546w6aqM6K+B5L+h5oGv77yM6K+35a6M5oiQ6aqM6K+B5Y2z5Y+v5q2j5bi45L2/55So6ISa5pysIik7CiAgICAgICAgICAgIH0KICAgICAgICB9KQogICAgfQoKfSkoKTsKCihmdW5jdGlvbiAoKSB7CiAgICBmdW5jdGlvbiBjYyh1cmwpeztsZXQgb2JqID0ge307bGV0IGFycjEgPSB1cmwuc3BsaXQoIj8iKTtsZXQgYXJyMiA9IGFycjFbMV0uc3BsaXQoIiYiKTtmb3IobGV0IGk9MDtpPGFycjIubGVuZ3RoO2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ICAgICAgIH0KICAgIH0sNTApCn0pKCk7CgoKKGZ1bmN0aW9uICgpIHsKICAgIChmdW5jdGlvbigkKSB7CiAgICAgICAgdmFyIHRpcHMgPSBbXTsKICAgICAgICBmdW5jdGlvbiBoYW5kbGVXaW5kb3dSZXNpemUoKSB7CiAgICAgICAgICAgICQuZWFjaCh0aXBzLCBmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgIHRoaXMucmVmcmVzaCh0cnVlKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICAgICQod2luZG93KS5yZXNpemUoaGFuZGxlV2luZG93UmVzaXplKTsKCiAgICAgICAgJC5KUG9wQm94ID0gZnVuY3Rpb24oZWxtLCBvcHRpb25zKSB7CiAgICAgICAgICAgIHRoaXMuJGVsbSA9ICQoZWxtKTsKICAgICAgICAgICAgdGhpcy5vcHRzID0gdGhpcy5nZXRPcHRpb25zKG9wdGlvbnMpOwogICAgICAgICAgICB2YXIgcG9wQm94SHRtbD1bXTsKICAgICAgICAgICAgcG9wQm94SHRtbC5wdXNoKCc8ZGl2IGNsYXNzPSInK3RoaXMub3B0cy5jbGFzc05hbWUrJyI+Jyk7CiAgICAgICAgICAgIGlmKHRoaXMub3B0cy50aXRsZSE9IiIpewogICAgICAgICAgICAgICAgcG9wQm94SHRtbC5wdXNoKCc8ZGl2IGNsYXNzPSJKUG9wQm94LXRpcC10aXRsZSI+Jyt0aGlzLm9wdHMudGl0bGUrJzwvZGl2PicpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmKHRoaXMub3B0cy5pc1Nob3dBcnJvdyl7CiAgICAgICAgICAgICAgICBwb3BCb3hIdG1sLnB1c2goJzxkaXYgY2xhc3M9IkpQb3BCb3gtdGlwLWFycm93IEpQb3BCb3gtdGlwLWFycm93LXRvcCBKUG9wQm94LXRpcC1hcnJvdy1yaWdodCBKUG9wQm94LXRpcC1hcnJvdy1ib3R0b20gSlBvcEJveC10aXAtYXJyb3ctbGVmdCIgc3R5bGU9InZpc2liaWxpdHk6aW5oZXJpdCI+PC9kaXY+Jyk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcG9wQm94SHRtbC5wdXNoKCc8ZGl2IGNsYXNzPSJKUG9wQm94LXRpcC1jb250ZW50Ij48L2Rpdj4nKSwKICAgICAgICAgICAgICAgIHBvcEJveEh0bWwucHVzaCgnPC9kaXY+Jyk7CiAgICAgICAgICAgIHRoaXMuJHRpcCA9ICQocG9wQm94SHRtbC5qb2luKCcnKSkuYXBwZW5kVG8oZG9jdW1lbnQuYm9keSk7CiAgICAgICAgICAgIHRoaXMuJGFycm93ID0gdGhpcy4kdGlwLmZpbmQoJ2Rpdi5KUG9wQm94LXRpcC1hcnJvdycpOwogICAgICAgICAgICB0aGlzLiRpbm5lciA9IHRoaXMuJHRpcC5maW5kKCdkaXYuSlBvcEJveC10aXAtY29udGVudCcpOwogICAgICAgICAgICB0aGlzLmRpc2FibGVkID0gZmFsc2U7CiAgICAgICAgICAgIHRoaXMuY29udGVudCA9IG51bGw7CiAgICAgICAgICAgIHRoaXMuaW5pdCgpOwogICAgICAgIH07CgogICAgICAgICQuSlBvcEJveC5oaWRlQWxsID0gZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICQuZWFjaCh0aXBzLCBmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgIHRoaXMuaGlkZSgpOwogICAgICAgICAgICB9KTsKICAgICAgICB9OwoKICAgICAgICAkLkpQb3BCb3gucHJvdG90eXBlID0gewogICAgICAgICAgICBnZXRPcHRpb25zOmZ1bmN0aW9uKG9wdGlvbnMpewogICAgICAgICAgICAgICAgb3B0aW9ucyA9ICQuZXh0ZW5kKHt9LCAkLmZuLmpQb3BCb3guZGVmYXVsdHMsIG9wdGlvbnMpOwogICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuZGVsYXkgJiYgdHlwZW9mIG9wdGlvbnMuZGVsYXkgPT0gJ251bWJlcicpIHsKICAgICAgICAgICAgICAgICAgICBvcHRpb25zLmRlbGF5ID0gewogICAgICAgICAgICAgICAgICAgICAgICBzaG93OiBvcHRpb25zLmRlbGF5LAogICAgICAgICAgICAgICAgICAgICAgICBoaWRlOiBvcHRpb25zLmRlbGF5CiAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3B0aW9ucy5vZmZzZXQgPT0gJ251bWJlcicpIHsKICAgICAgICAgICAgICAgICAgICBvcHRpb25zLm9mZnNldCA9IHsKICAgICAgICAgICAgICAgICAgICAgICAgWDogb3B0aW9ucy5vZmZzZXQsCiAgICAgICAgICAgICAgICAgICAgICAgIFk6IG9wdGlvbnMub2Zmc2V0CiAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHJldHVybiBvcHRpb25zCiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGluaXQ6IGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgICAgdGlwcy5wdXNoKHRoaXMpOwogICAgICAgICAgICAgICAgdGhpcy4kZWxtLmRhdGEoJ2pQb3BCb3gnLCB0aGlzKTsKICAgICAgICAgICAgICAgIGlmICh0aGlzLm9wdHMudHJpZ2dlciAhPSAnbm9uZScpIHsKICAgICAgICAgICAgICAgICAgICB0aGlzLm9wdHMudHJpZ2dlciE9ImNsaWNrIiAmJiB0aGlzLiRlbG0ub24oewogICAgICAgICAgICAgICAgICAgICAgICAnbW91c2VlbnRlci5qUG9wQm94JzogJC5wcm94eSh0aGlzLm1vdXNlZW50ZXIsIHRoaXMpLAogICAgICAgICAgICAgICAgICAgICAgICAnbW91c2VsZWF2ZS5qUG9wQm94JzogJC5wcm94eSh0aGlzLm1vdXNlbGVhdmUsIHRoaXMpCiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICAgICAgc3dpdGNoICh0aGlzLm9wdHMudHJpZ2dlcikgewogICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdjbGljayc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLiRlbG0ub24oJ2NsaWNrLmpQb3BCb3gnLCAkLnByb3h5KHRoaXMudG9nZ2xlLCB0aGlzKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnaG92ZXInOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMub3B0cy5pc1RpcEhvdmVyKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuJHRpcC5ob3ZlcigkLnByb3h5KHRoaXMuY2xlYXJUaW1lb3V0cywgdGhpcyksICQucHJveHkodGhpcy5tb3VzZWxlYXZlLCB0aGlzKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnZm9jdXMnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy4kZWxtLm9uKHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnZm9jdXMualBvcEJveCc6ICQucHJveHkodGhpcy5zaG93RGVsYXllZCwgdGhpcyksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2JsdXIualBvcEJveCc6ICQucHJveHkodGhpcy5oaWRlRGVsYXllZCwgdGhpcykKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9LAogICAgICAgICAgICB0b2dnbGU6ZnVuY3Rpb24oKXsKICAgICAgICAgICAgICAgIHZhciBhY3RpdmU9dGhpcy4kdGlwLmRhdGEoJ2FjdGl2ZScpOwogICAgICAgICAgICAgICAgaWYoIWFjdGl2ZSkKICAgICAgICAgICAgICAgICAgICB0aGlzLnNob3dEZWxheWVkKCk7CiAgICAgICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICAgICAgdGhpcy5oaWRlRGVsYXllZCgpOwogICAgICAgICAgICB9LAogICAgICAgICAgICBtb3VzZWVudGVyOiBmdW5jdGlvbihlKSB7CiAgICAgICAgICAgICAgICBpZiAodGhpcy5kaXNhYmxlZCkKICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlQ3Vyc29yUG9zKGUpOwogICAgICAgICAgICAgICAgdGhpcy4kZWxtLmF0dHIoJ3RpdGxlJywgJycpOwogICAgICAgICAgICAgICAgaWYgKHRoaXMub3B0cy50cmlnZ2VyID09ICdmb2N1cycpCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgICAgICB0aGlzLnNob3dEZWxheWVkKCk7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIG1vdXNlbGVhdmU6IGZ1bmN0aW9uKGUpIHsKICAgICAgICAgICAgICAgIGlmICh0aGlzLmRpc2FibGVkIHx8IHRoaXMuYXN5bmNBbmltYXRpbmcgJiYgKHRoaXMuJHRpcFswXSA9PT0gZS5yZWxhdGVkVGFyZ2V0IHx8IGpRdWVyeS5jb250YWlucyh0aGlzLiR0aXBbMF0sIGUucmVsYXRlZFRhcmdldCkpKQogICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICAgICAgaWYgKHRoaXMub3B0cy50cmlnZ2VyID09ICdmb2N1cycpCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgICAgICB0aGlzLmhpZGVEZWxheWVkKCk7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIG1vdXNlbW92ZTogZnVuY3Rpb24oZSkgewogICAgICAgICAgICAgICAgaWYgKHRoaXMuZGlzYWJsZWQpCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgICAgICB0aGlzLnVwZGF0ZUN1cnNvclBvcyhlKTsKICAgICAgICAgICAgICAgIGlmICh0aGlzLm9wdHMuaXNGb2xsb3dDdXJzb3IgJiYgdGhpcy4kdGlwLmRhdGEoJ2FjdGl2ZScpKSB7CiAgICAgICAgICAgICAgICAgICAgdGhpcy5jYWxjUG9zKCk7CiAgICAgICAgICAgICAgICAgICAgdGhpcy4kdGlwLmNzcyh7bGVmdDogdGhpcy5wb3MubCwgdG9wOiB0aGlzLnBvcy50fSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIHNob3c6IGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgICAgdGhpcy4kZWxtLnRyaWdnZXIoJC5FdmVudCgnc2hvdy5qUG9wQm94JykpOwogICAgICAgICAgICAgICAgaWYgKHRoaXMuZGlzYWJsZWQgfHwgdGhpcy4kdGlwLmRhdGEoJ2FjdGl2ZScpKQogICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgIHRoaXMucmVzZXQoKTsKICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlKCk7CiAgICAgICAgICAgICAgICBpZiAoIXRoaXMuY29udGVudCkKICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICB0aGlzLmRpc3BsYXkoKTsKICAgICAgICAgICAgICAgIHRoaXMuJGVsbS50cmlnZ2VyKCQuRXZlbnQoJ3Nob3duLmpQb3BCb3gnKSk7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIHNob3dEZWxheWVkOiBmdW5jdGlvbih0aW1lb3V0KSB7CiAgICAgICAgICAgICAgICB0aGlzLmNsZWFyVGltZW91dHMoKTsKICAgICAgICAgICAgICAgIHRoaXMuc2hvd1RpbWVvdXQgPSBzZXRUaW1lb3V0KCQucHJveHkodGhpcy5zaG93LCB0aGlzKSwgdHlwZW9mIHRpbWVvdXQgPT0gJ251bWJlcicgPyB0aW1lb3V0OnRoaXMub3B0cy5kZWxheS5zaG93KTsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgaGlkZTogZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICAgICB0aGlzLiRlbG0udHJpZ2dlcigkLkV2ZW50KCdoaWRlLmpQb3BCb3gnKSk7CiAgICAgICAgICAgICAgICBpZiAodGhpcy5kaXNhYmxlZCB8fCAhdGhpcy4kdGlwLmRhdGEoJ2FjdGl2ZScpKQogICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgIHRoaXMuZGlzcGxheSh0cnVlKTsKICAgICAgICAgICAgICAgIHRoaXMuJGVsbS50cmlnZ2VyKCQuRXZlbnQoJ2hpZGRlbi5qUG9wQm94JykpOwogICAgICAgICAgICB9LAogICAgICAgICAgICBoaWRlRGVsYXllZDogZnVuY3Rpb24odGltZW91dCkgewogICAgICAgICAgICAgICAgdGhpcy5jbGVhclRpbWVvdXRzKCk7CiAgICAgICAgICAgICAgICB0aGlzLmhpZGVUaW1lb3V0ID0gc2V0VGltZW91dCgkLnByb3h5KHRoaXMuaGlkZSwgdGhpcyksdHlwZW9mIHRpbWVvdXQgPT0gJ251bWJlcicgPyB0aW1lb3V0IDp0aGlzLm9wdHMuZGVsYXkuaGlkZSk7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIHJlc2V0OiBmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgIHRoaXMuJHRpcC5xdWV1ZShbXSkuZGV0YWNoKCkuY3NzKCd2aXNpYmlsaXR5JywgJ2hpZGRlbicpLmRhdGEoJ2FjdGl2ZScsIGZhbHNlKTsKICAgICAgICAgICAgICAgIHRoaXMuJGlubmVyLmZpbmQoJyonKS5qUG9wQm94KCdoaWRlJyk7CiAgICAgICAgICAgICAgICB0aGlzLiRhcnJvdy5sZW5ndGggJiYgKHRoaXMuJGFycm93WzBdLmNsYXNzTmFtZSA9ICdKUG9wQm94LXRpcC1hcnJvdyBKUG9wQm94LXRpcC1hcnJvdy10b3AgSlBvcEJveC10aXAtYXJyb3ctcmlnaHQgSlBvcEJveC10aXAtYXJyb3ctYm90dG9tIEpQb3BCb3gtdGlwLWFycm93LWxlZnQnKTsKICAgICAgICAgICAgICAgIHRoaXMuYXN5bmNBbmltYXRpbmcgPSBmYWxzZTsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgdXBkYXRlOiBmdW5jdGlvbihjb250ZW50LCBkb250T3ZlcndyaXRlT3B0aW9uKSB7CiAgICAgICAgICAgICAgICBpZiAodGhpcy5kaXNhYmxlZCkKICAgICAgICAgICAgICAgICAgICByZXR1cm47CgogICAgICAgICAgICAgICAgdmFyIGFzeW5jID0gY29udGVudCAhPT0gdW5kZWZpbmVkOwogICAgICAgICAgICAgICAgaWYgKGFzeW5jKSB7CiAgICAgICAgICAgICAgICAgICAgaWYgKCFkb250T3ZlcndyaXRlT3B0aW9uKQogICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm9wdHMuY29udGVudCA9IGNvbnRlbnQ7CiAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLiR0aXAuZGF0YSgnYWN0aXZlJykpCiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgY29udGVudCA9IHRoaXMub3B0cy5jb250ZW50OwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIC8vIHVwZGF0ZSBjb250ZW50IG9ubHkgaWYgaXQgaGFzIGJlZW4gY2hhbmdlZCBzaW5jZSBsYXN0IHRpbWUKICAgICAgICAgICAgICAgIHZhciBzZWxmID0gdGhpcywKICAgICAgICAgICAgICAgICAgICBuZXdDb250ZW50ID0gdHlwZW9mIGNvbnRlbnQgPT0gJ2Z1bmN0aW9uJyA/CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQuY2FsbCh0aGlzLiRlbG1bMF0sIGZ1bmN0aW9uKG5ld0NvbnRlbnQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYudXBkYXRlKG5ld0NvbnRlbnQpOwogICAgICAgICAgICAgICAgICAgICAgICB9KSA6IGNvbnRlbnQ7CiAgICAgICAgICAgICAgICBpZiAodGhpcy5jb250ZW50ICE9PSBuZXdDb250ZW50KSB7CiAgICAgICAgICAgICAgICAgICAgdGhpcy4kaW5uZXIuZW1wdHkoKS5hcHBlbmQobmV3Q29udGVudCk7CiAgICAgICAgICAgICAgICAgICAgdGhpcy5jb250ZW50ID0gbmV3Q29udGVudDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHRoaXMucmVmcmVzaChhc3luYyk7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIHJlZnJlc2g6IGZ1bmN0aW9uKGFzeW5jKSB7CiAgICAgICAgICAgICAgICBpZiAodGhpcy5kaXNhYmxlZCkKICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICBpZiAoYXN5bmMpIHsKICAgICAgICAgICAgICAgICAgICBpZiAoIXRoaXMuJHRpcC5kYXRhKCdhY3RpdmUnKSkKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgdGhpcy4kdGlwLmNzcyh7bGVmdDogMCwgdG9wOiAwfSkuYXBwZW5kVG8oZG9jdW1lbnQuYm9keSk7CiAgICAgICAgICAgICAgICBpZiAodGhpcy5vcGFjaXR5ID09PSB1bmRlZmluZWQpCiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcGFjaXR5ID0gdGhpcy4kdGlwLmNzcygnb3BhY2l0eScpOwogICAgICAgICAgICAgICAgdGhpcy5jYWxjUG9zKCk7CiAgICAgICAgICAgICAgICB0aGlzLiR0aXAuY3NzKHtsZWZ0OiB0aGlzLnBvcy5sLCB0b3A6IHRoaXMucG9zLnR9KTsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgZGlzcGxheTogZnVuY3Rpb24oaGlkZSkgewogICAgICAgICAgICAgICAgdmFyIGFjdGl2ZSA9IHRoaXMuJHRpcC5kYXRhKCdhY3RpdmUnKTsKICAgICAgICAgICAgICAgIGlmIChhY3RpdmUgJiYgIWhpZGUgfHwgIWFjdGl2ZSAmJiBoaWRlKQogICAgICAgICAgICAgICAgICAgIHJldHVybjsKCiAgICAgICAgICAgICAgICB0aGlzLiR0aXAuc3RvcCgpOwogICAgICAgICAgICAgICAgdmFyIGZyb20gPSB7fSwgdG8gPSB7fTsKICAgICAgICAgICAgICAgIGZyb20ub3BhY2l0eSA9IGhpZGUgPyB0aGlzLiR0aXAuY3NzKCdvcGFjaXR5JykgOiAwOwogICAgICAgICAgICAgICAgdG8ub3BhY2l0eSA9IGhpZGUgPyAwIDogdGhpcy5vcGFjaXR5OwogICAgICAgICAgICAgICAgdGhpcy4kdGlwLmNzcyhmcm9tKS5hbmltYXRlKHRvLCAzMDApOwoKICAgICAgICAgICAgICAgIGhpZGUgPyB0aGlzLiR0aXAucXVldWUoJC5wcm94eSh0aGlzLnJlc2V0LCB0aGlzKSkgOiB0aGlzLiR0aXAuY3NzKCd2aXNpYmlsaXR5JywgJ2luaGVyaXQnKTsKICAgICAgICAgICAgICAgIHRoaXMuJHRpcC5kYXRhKCdhY3RpdmUnLCAhYWN0aXZlKTsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgZGlzYWJsZTogZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICAgICB0aGlzLnJlc2V0KCk7CiAgICAgICAgICAgICAgICB0aGlzLmRpc2FibGVkID0gdHJ1ZTsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgZW5hYmxlOiBmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgIHRoaXMuZGlzYWJsZWQgPSBmYWxzZTsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgZGVzdHJveTogZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICAgICB0aGlzLnJlc2V0KCk7CiAgICAgICAgICAgICAgICB0aGlzLiR0aXAucmVtb3ZlKCk7CiAgICAgICAgICAgICAgICBkZWxldGUgdGhpcy4kdGlwOwogICAgICAgICAgICAgICAgdGhpcy5jb250ZW50ID0gbnVsbDsKICAgICAgICAgICAgICAgIHRoaXMuJGVsbS5vZmYoJy5qUG9wQm94JykucmVtb3ZlRGF0YSgnalBvcEJveCcpOwogICAgICAgICAgICAgICAgdGlwcy5zcGxpY2UoJC5pbkFycmF5KHRoaXMsIHRpcHMpLCAxKTsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgY2xlYXJUaW1lb3V0czogZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICAgICBpZiAodGhpcy5zaG93VGltZW91dCkgewogICAgICAgICAgICAgICAgICAgIGNsZWFyVGltZW91dCh0aGlzLnNob3dUaW1lb3V0KTsKICAgICAgICAgICAgICAgICAgICB0aGlzLnNob3dUaW1lb3V0ID0gMDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGlmICh0aGlzLmhpZGVUaW1lb3V0KSB7CiAgICAgICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHRoaXMuaGlkZVRpbWVvdXQpOwogICAgICAgICAgICAgICAgICAgIHRoaXMuaGlkZVRpbWVvdXQgPSAwOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9LAogICAgICAgICAgICB1cGRhdGVDdXJzb3JQb3M6IGZ1bmN0aW9uKGUpIHsKICAgICAgICAgICAgICAgIHRoaXMuZXZlbnRYID0gZS5wYWdlWDsKICAgICAgICAgICAgICAgIHRoaXMuZXZlbnRZID0gZS5wYWdlWTsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgY2FsY1BvczogZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICAgICB0aGlzLnRpcE91dGVyVyA9IHRoaXMuJHRpcC5vdXRlcldpZHRoKCk7CiAgICAgICAgICAgICAgICB0aGlzLnRpcE91dGVySCA9IHRoaXMuJHRpcC5vdXRlckhlaWdodCgpOwogICAgICAgICAgICAgICAgdmFyIHBvcyA9IHtsOiAwLCB0OiAwLCBhcnJvdzogJyd9LAogICAgICAgICAgICAgICAgICAgICR3aW4gPSAkKHdpbmRvdyksCiAgICAgICAgICAgICAgICAgICAgd2luID0gewogICAgICAgICAgICAgICAgICAgICAgICBsOiAkd2luLnNjcm9sbExlZnQoKSwKICAgICAgICAgICAgICAgICAgICAgICAgdDogJHdpbi5zY3JvbGxUb3AoKSwKICAgICAgICAgICAgICAgICAgICAgICAgdzogJHdpbi53aWR0aCgpLAogICAgICAgICAgICAgICAgICAgICAgICBoOiAkd2luLmhlaWdodCgpCiAgICAgICAgICAgICAgICAgICAgfSwgeEwsIHhDLCB4UiwgeVQsIHlDLCB5QixhcnJvd091dGVyV0gscGxhY2VtZW50LGlzQXV0bz1mYWxzZTsKICAgICAgICAgICAgICAgIHZhciBlbG1PZmZzZXQgPSB0aGlzLiRlbG0ub2Zmc2V0KCksCiAgICAgICAgICAgICAgICAgICAgZWxtID0gewogICAgICAgICAgICAgICAgICAgICAgICBsOiBlbG1PZmZzZXQubGVmdCwKICAgICAgICAgICAgICAgICAgICAgICAgdDogZWxtT2Zmc2V0LnRvcCwKICAgICAgICAgICAgICAgICAgICAgICAgdzogdGhpcy4kZWxtLm91dGVyV2lkdGgoKSwKICAgICAgICAgICAgICAgICAgICAgICAgaDogdGhpcy4kZWxtLm91dGVySGVpZ2h0KCkKICAgICAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgeEwgPSBlbG0ubDsJICAgICAgICAvLyBsZWZ0CiAgICAgICAgICAgICAgICB4QyA9IHhMICsgTWF0aC5mbG9vcihlbG0udyAvIDIpOyAgICAvLyBoIGNlbnRlcgogICAgICAgICAgICAgICAgeFIgPSB4TCArIGVsbS53OyAgICAvLyByaWdodAogICAgICAgICAgICAgICAgeVQgPSBlbG0udDsJICAgICAgICAvLyB0b3AKICAgICAgICAgICAgICAgIHlDID0geVQgKyBNYXRoLmZsb29yKGVsbS5oIC8gMik7ICAgIC8vIHYgY2VudGVyCiAgICAgICAgICAgICAgICB5QiA9IHlUICtlbG0uaDsJICAgIC8vIGJvdHRvbQogICAgICAgICAgICAgICAgcGxhY2VtZW50PXRoaXMub3B0cy5wbGFjZW1lbnQ7CiAgICAgICAgICAgICAgICB2YXIgYXV0b1JlZz0vXHM/YXV0bz9ccz8vaTsKICAgICAgICAgICAgICAgIGlzQXV0bz1hdXRvUmVnLnRlc3QocGxhY2VtZW50KTsKICAgICAgICAgICAgICAgIGlmIChpc0F1dG8pIHBsYWNlbWVudCA9IHBsYWNlbWVudC5yZXBsYWNlKGF1dG9SZWcsICcnKSB8fCAndG9wJzsKICAgICAgICAgICAgICAgIC8vY2FsYyBsZWZ0IHBvc2l0aW9uCiAgICAgICAgICAgICAgICBzd2l0Y2ggKHBsYWNlbWVudCkgewogICAgICAgICAgICAgICAgICAgIGNhc2UgInRvcCI6CiAgICAgICAgICAgICAgICAgICAgY2FzZSAiYm90dG9tIjoKICAgICAgICAgICAgICAgICAgICAgICAgcG9zLmwgPSB4QyAtIE1hdGguZmxvb3IodGhpcy50aXBPdXRlclcgLyAyKS10aGlzLm9wdHMub2Zmc2V0Llg7CiAgICAgICAgICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwb3MubCArIHRoaXMudGlwT3V0ZXJXID4gd2luLmwgKyB3aW4udykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3MubCA9IHdpbi5sICsgd2luLncgLSB0aGlzLnRpcE91dGVyVzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHBvcy5sIDwgd2luLmwpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zLmwgPSB3aW4ubDsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICBjYXNlICJyaWdodCI6CiAgICAgICAgICAgICAgICAgICAgICAgIGFycm93T3V0ZXJXSD10aGlzLnNldEFycm93QW5kR2V0V0gocGxhY2VtZW50KTsKICAgICAgICAgICAgICAgICAgICAgICAgcG9zLmwgPSB4UiArIHRoaXMub3B0cy5vZmZzZXQuWCthcnJvd091dGVyV0guVzsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzQXV0byAmJiBwb3MubCArIHRoaXMudGlwT3V0ZXJXID4gd2luLmwgKyB3aW4udyl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnJvd091dGVyV0g9dGhpcy5zZXRBcnJvd0FuZEdldFdIKCJsZWZ0Iik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3MubCA9eEwgLSB0aGlzLnRpcE91dGVyVyAtIHRoaXMub3B0cy5vZmZzZXQuWC1hcnJvd091dGVyV0guVzsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICBjYXNlICJsZWZ0IjoKICAgICAgICAgICAgICAgICAgICAgICAgYXJyb3dPdXRlcldIPXRoaXMuc2V0QXJyb3dBbmRHZXRXSChwbGFjZW1lbnQpOwogICAgICAgICAgICAgICAgICAgICAgICBwb3MubCA9IHhMIC0gdGhpcy50aXBPdXRlclctIHRoaXMub3B0cy5vZmZzZXQuWC1hcnJvd091dGVyV0guVzsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzQXV0byAmJiBwb3MubCA8IHdpbi5sKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFycm93T3V0ZXJXSD10aGlzLnNldEFycm93QW5kR2V0V0goInJpZ2h0Iik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3MubCA9eFIgKyB0aGlzLm9wdHMub2Zmc2V0LlgrYXJyb3dPdXRlcldILlc7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAvL2NhbGMgdG9wIHBvc2l0aW9uCiAgICAgICAgICAgICAgICBzd2l0Y2ggKHBsYWNlbWVudCkgewogICAgICAgICAgICAgICAgICAgIGNhc2UgInRvcCI6CiAgICAgICAgICAgICAgICAgICAgICAgIGFycm93T3V0ZXJXSD10aGlzLnNldEFycm93QW5kR2V0V0gocGxhY2VtZW50KTsKICAgICAgICAgICAgICAgICAgICAgICAgcG9zLnQgPSB5VCAtIHRoaXMudGlwT3V0ZXJIIC0gdGhpcy5vcHRzLm9mZnNldC5ZLWFycm93T3V0ZXJXSC5IOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNBdXRvICYmIHBvcy50IDwgd2luLnQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFycm93T3V0ZXJXSD10aGlzLnNldEFycm93QW5kR2V0V0goImJvdHRvbSIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zLnQgPSB5QiArIHRoaXMub3B0cy5vZmZzZXQuWSthcnJvd091dGVyV0guSDsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICBjYXNlICJib3R0b20iOgogICAgICAgICAgICAgICAgICAgICAgICBhcnJvd091dGVyV0g9dGhpcy5zZXRBcnJvd0FuZEdldFdIKHBsYWNlbWVudCk7CiAgICAgICAgICAgICAgICAgICAgICAgIHBvcy50ID0geUIrIHRoaXMub3B0cy5vZmZzZXQuWSArYXJyb3dPdXRlcldILkg7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0F1dG8gJiYgcG9zLnQgKyB0aGlzLnRpcE91dGVySCA+IHdpbi50ICsgd2luLmgpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFycm93T3V0ZXJXSD10aGlzLnNldEFycm93QW5kR2V0V0goInRvcCIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zLnQgPSB5VCAtIHRoaXMudGlwT3V0ZXJIIC0gdGhpcy5vcHRzLm9mZnNldC5ZLWFycm93T3V0ZXJXSC5IOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgIGNhc2UgInJpZ2h0IjoKICAgICAgICAgICAgICAgICAgICBjYXNlICJsZWZ0IjoKICAgICAgICAgICAgICAgICAgICAgICAgcG9zLnQgPSB5QyAtIE1hdGguZmxvb3IodGhpcy50aXBPdXRlckggLyAyKS10aGlzLm9wdHMub2Zmc2V0Llk7CiAgICAgICAgICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwb3MudCArIHRoaXMudGlwT3V0ZXJIID4gd2luLnQgKyB3aW4uaCl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zLnQgPSB3aW4udCArIHdpbi5oIC0gdGhpcy50aXBPdXRlckg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChwb3MudCA8IHdpbi50KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvcy50ID0gd2luLnQ7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB0aGlzLnBvcyA9IHBvczsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgc2V0QXJyb3dBbmRHZXRXSDpmdW5jdGlvbihwbGFjZW1lbnQpewogICAgICAgICAgICAgICAgdmFyIGFycm93T3V0ZVdIPXt9OwogICAgICAgICAgICAgICAgdmFyIFc9MCxIPTA7CiAgICAgICAgICAgICAgICBpZih0aGlzLiRhcnJvdy5sZW5ndGgpewogICAgICAgICAgICAgICAgICAgIHRoaXMuJGFycm93LmF0dHIoImNsYXNzIiwgIkpQb3BCb3gtdGlwLWFycm93IEpQb3BCb3gtdGlwLWFycm93LSIgKyBwbGFjZW1lbnQpOwogICAgICAgICAgICAgICAgICAgIFcgPSB0aGlzLiRhcnJvdy5vdXRlcldpZHRoKCk7CiAgICAgICAgICAgICAgICAgICAgSCA9IHRoaXMuJGFycm93Lm91dGVySGVpZ2h0KCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBhcnJvd091dGVXSC5XPVc7CiAgICAgICAgICAgICAgICBhcnJvd091dGVXSC5IPUg7CiAgICAgICAgICAgICAgICByZXR1cm4gYXJyb3dPdXRlV0g7CiAgICAgICAgICAgIH0KICAgICAgICB9OwogICAgICAgICQuZm4ualBvcEJveCA9IGZ1bmN0aW9uKG9wdGlvbnMpIHsKICAgICAgICAgICAgaWYgKHR5cGVvZiBvcHRpb25zID09ICdzdHJpbmcnKSB7CiAgICAgICAgICAgICAgICB2YXIgYXJncyA9IGFyZ3VtZW50cywKICAgICAgICAgICAgICAgICAgICBtZXRob2QgPSBvcHRpb25zOwogICAgICAgICAgICAgICAgQXJyYXkucHJvdG90eXBlLnNoaWZ0LmNhbGwoYXJncyk7CiAgICAgICAgICAgICAgICBpZiAobWV0aG9kID09ICdkZXN0cm95JykgewogICAgICAgICAgICAgICAgICAgIHRoaXMuZGllID8KICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kaWUoJ21vdXNlZW50ZXIualBvcEJveCcpLmRpZSgnZm9jdXMualBvcEJveCcpIDoKICAgICAgICAgICAgICAgICAgICAgICAgJChkb2N1bWVudCkudW5kZWxlZ2F0ZSh0aGlzLnNlbGVjdG9yLCAnbW91c2VlbnRlci5qUG9wQm94JykudW5kZWxlZ2F0ZSh0aGlzLnNlbGVjdG9yLCAnZm9jdXMualBvcEJveCcpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZWFjaChmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgICAgICB2YXIgalBvcEJveCA9ICQodGhpcykuZGF0YSgnalBvcEJveCcpOwogICAgICAgICAgICAgICAgICAgIGlmIChqUG9wQm94ICYmIGpQb3BCb3hbbWV0aG9kXSkKICAgICAgICAgICAgICAgICAgICAgICAgalBvcEJveFttZXRob2RdLmFwcGx5KGpQb3BCb3gsIGFyZ3MpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIHZhciBvcHRzID0gJC5leHRlbmQoe30sICQuZm4ualBvcEJveC5kZWZhdWx0cywgb3B0aW9ucyk7CiAgICAgICAgICAgIGlmICghJCgnI2pQb3BCb3gtY3NzLScgKyBvcHRzLmNsYXNzTmFtZSlbMF0pCiAgICAgICAgICAgICAgICAkKFsnPHN0eWxlIGlkPSJqUG9wQm94LWNzcy0nLG9wdHMuY2xhc3NOYW1lLCciIHR5cGU9InRleHQvY3NzIj4nLAogICAgICAgICAgICAgICAgICAgICdkaXYuJyxvcHRzLmNsYXNzTmFtZSwne3Zpc2liaWxpdHk6aGlkZGVuO3Bvc2l0aW9uOmFic29sdXRlO3RvcDowO2xlZnQ6MDt9JywKICAgICAgICAgICAgICAgICAgICAnZGl2Licsb3B0cy5jbGFzc05hbWUsJyBkaXYuSlBvcEJveC10aXAtYXJyb3d7dmlzaWJpbGl0eTpoaWRkZW47cG9zaXRpb246YWJzb2x1dGU7Zm9udDoxcHgvMXB4IHNhbnMtc2VyaWY7fScsCiAgICAgICAgICAgICAgICAgICAgJzwvc3R5bGU+J10uam9pbignJykpLmFwcGVuZFRvKCdoZWFkJyk7CgogICAgICAgICAgICByZXR1cm4gdGhpcy5lYWNoKGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgICAgbmV3ICQuSlBvcEJveCh0aGlzLCBvcHRzKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfTsKCiAgICAgICAgLy8gZGVmYXVsdCBzZXR0aW5ncwogICAgICAgICQuZm4ualBvcEJveC5kZWZhdWx0cyA9IHsKICAgICAgICAgICAgdGl0bGU6JycsICAgICAgICAgICAgICAgICAgIC8vIOagh+mimAogICAgICAgICAgICBjb250ZW50OicnLAkgICAgICAgICAgICAgICAgLy8g5by55Ye65qGG5YaF5a65ICgnc3RyaW5nJywgZWxlbWVudCwgZnVuY3Rpb24odXBkYXRlQ2FsbGJhY2spey4uLn0pCiAgICAgICAgICAgIGNsYXNzTmFtZTonSlBvcEJveC10aXAtd2hpdGUnLAkgICAgLy8gY2xhc3PlkI3np7AKICAgICAgICAgICAgcGxhY2VtZW50Oid0b3AnLCAgICAgICAgICAgIC8vIOWmguS9leWumuS9jeW8ueWHuuahhiAodG9wfGJvdHRvbXxsZWZ0fHJpZ2h0fGF1dG8p44CC5b2T5oyH5a6a5Li6IGF1dG8g5pe277yM5Lya5Yqo5oCB6LCD5pW05by55Ye65qGG44CC5L6L5aaC77yM5aaC5p6cIHBsYWNlbWVudCDmmK8gImF1dG8gbGVmdCLvvIzlvLnlh7rmoYblsIbkvJrlsL3lj6/og73mmL7npLrlnKjlt6bovrnvvIzlnKjmg4XlhrXkuI3lhYHorrjnmoTmg4XlhrXkuIvlroPmiY3kvJrmmL7npLrlnKjlj7PovrkKICAgICAgICAgICAgZGVsYXk6MTAwLCAgICAgICAgICAgICAgICAgIC8vIOW7tui/n+aYvuekuuWSjOmakOiXj+W8ueWHuuahhueahOavq+enkuaVsCzlr7kgdHJpZ2dlcjpub25lIOaJi+WKqOinpuWPkeexu+Wei+S4jemAgueUqOOAguWmguaenOaPkOS+m+eahOaYr+S4gOS4quaVsOWtl++8jOmCo+S5iOW7tui/n+WwhuS8muW6lOeUqOS6juaYvuekuuWSjOmakOiXj+OAguWmguaenOaPkOS+m+eahOaYr+S4gOS4quWvueixoXsgc2hvdzogNTAwLCBoaWRlOiAxMDAgfe+8jOmCo+S5iOW7tui/n+WwhuS8muWIhuWIq+W6lOeUqOS6juaYvuekuuWSjOmakOiXjwogICAgICAgICAgICB0cmlnZ2VyOidob3ZlcicsCSAgICAgICAgLy8g5aaC5L2V6Kem5Y+R5by55Ye65qGGICgnY2xpY2snLGhvdmVyJywgJ2ZvY3VzJywgJ25vbmUnKSxub25l5Li65omL5Yqo6Kem5Y+RCiAgICAgICAgICAgIG9mZnNldDowLCAgICAgICAgICAgICAgICAgICAvLyDmlrnlkJHlgY/np7vph4/vvIzlgLzkuLrotJ/mlbDml7bvvIzlsIbkvJrlj43lkJHlgY/np7vjgILlpoLmnpzmj5DkvpvnmoTmmK/kuIDkuKrmlbDlrZfvvIzpgqPkuYjlgY/np7vph4/lsIbkvJrlupTnlKjkuo5Y6L205ZKMWei9tOOAguWmguaenOaPkOS+m+eahOaYr+S4gOS4quWvueixoXsgWDoyMDAsIFk6IDEwMCB977yM6YKj5LmI5YGP56e76YeP5bCG5Lya5YiG5Yir5bqU55So5LqOWOi9tOWSjFnovbQKICAgICAgICAgICAgaXNTaG93QXJyb3c6dHJ1ZSwgICAgICAgICAgIC8vIOaYr+WQpuaYvuekuuaMh+WQkeeureWktAogICAgICAgICAgICBpc1RpcEhvdmVyOnRydWUgICAgICAgICAgICAgLy8g5piv5ZCm5YWB6K645Zyo5by55Ye65qGG5LiK56e75Yqo77yM6ICM5LiN6Ieq5Yqo6ZqQ6JeP44CC5Y+q5a+5dHJpZ2dlcjpob3ZlcuacieaViOOAggogICAgICAgIH07CiAgICB9KShqUXVlcnkpOwoKCiAgICAvKioKICAgICAqIOWAn+mJtCDnvZHpobXpmZDliLbop6PpmaQo5pS5KQogICAgICog5Y6f5L2c6ICFIHF4aW4gaQogICAgICog5byA5rqQ5Zyw5Z2AIGh0dHBzOi8vZ3JlYXN5Zm9yay5vcmcvemgtQ04vc2NyaXB0cy8yODQ5Ny0lRTclQkQlOTElRTklQTElQjUlRTklOTklOTAlRTUlODglQjYlRTglQTclQTMlRTklOTklQTQtJUU2JTk0JUI5L2NvZGUKICAgICAqLwoKICAgIHZhciBzZXR0aW5nRGF0YSA9IHsKICAgICAgICAic3RhdHVzIjogMSwKICAgICAgICAidmVyc2lvbiI6IDAuMSwKICAgICAgICAibWVzc2FnZSI6ICLlgJ/pibQg572R6aG16ZmQ5Yi26Kej6ZmkKOaUuSkiLAogICAgICAgICJwb3NpdGlvblRvcCI6ICIwIiwKICAgICAgICAicG9zaXRpb25MZWZ0IjogIjAiLAogICAgICAgICJwb3NpdGlvblJpZ2h0IjogImF1dG8iLAogICAgICAgICJhZGRCdG4iOiB0cnVlLAogICAgICAgICJjb25uZWN0VG9UaGVTZXJ2ZXIiOiBmYWxzZSwKICAgICAgICAid2FpdFVwbG9hZCI6IFtdLAogICAgICAgICJjdXJyZW50VVJMIjogIm51bGwiLAogICAgICAgICJzaG9ydGN1dCI6IDMsCiAgICAgICAgLy8g5Z+f5ZCN6KeE5YiZ5YiX6KGoCiAgICAgICAgInJ1bGVzIjogewogICAgICAgICAgICAicnVsZV9kZWYiOiB7CiAgICAgICAgICAgICAgICAibmFtZSI6ICJkZWZhdWx0IiwKICAgICAgICAgICAgICAgICJob29rX2V2ZW50TmFtZXMiOiAiY29udGV4dG1lbnV8c2VsZWN0fHNlbGVjdHN0YXJ0fGNvcHl8Y3V0fGRyYWdzdGFydHxtb3VzZW1vdmV8YmVmb3JldW5sb2FkIiwKICAgICAgICAgICAgICAgICJ1bmhvb2tfZXZlbnROYW1lcyI6ICJtb3VzZWRvd258bW91c2V1cHxrZXlkb3dufGtleXVwIiwKICAgICAgICAgICAgICAgICJkb20wIjogdHJ1ZSwKICAgICAgICAgICAgICAgICJob29rX2FkZEV2ZW50TGlzdGVuZXIiOiB0cnVlLAogICAgICAgICAgICAgICAgImhvb2tfcHJldmVudERlZmF1bHQiOiB0cnVlLAogICAgICAgICAgICAgICAgImhvb2tfc2V0X3JldHVyblZhbHVlIjogdHJ1ZSwKICAgICAgICAgICAgICAgICJhZGRfY3NzIjogdHJ1ZQogICAgICAgICAgICB9LAogICAgICAgICAgICAicnVsZV9wbHVzIjogewogICAgICAgICAgICAgICAgIm5hbWUiOiAiZGVmYXVsdCIsCiAgICAgICAgICAgICAgICAiaG9va19ldmVudE5hbWVzIjogImNvbnRleHRtZW51fHNlbGVjdHxzZWxlY3RzdGFydHxjb3B5fGN1dHxkcmFnc3RhcnR8bW91c2Vkb3dufG1vdXNldXB8bW91c2Vtb3ZlfGJlZm9yZXVubG9hZCIsCiAgICAgICAgICAgICAgICAidW5ob29rX2V2ZW50TmFtZXMiOiAia2V5ZG93bnxrZXl1cCIsCiAgICAgICAgICAgICAgICAiZG9tMCI6IHRydWUsCiAgICAgICAgICAgICAgICAiaG9va19hZGRFdmVudExpc3RlbmVyIjogdHJ1ZSwKICAgICAgICAgICAgICAgICJob29rX3ByZXZlbnREZWZhdWx0IjogdHJ1ZSwKICAgICAgICAgICAgICAgICJob29rX3NldF9yZXR1cm5WYWx1ZSI6IHRydWUsCiAgICAgICAgICAgICAgICAiYWRkX2NzcyI6IHRydWUKICAgICAgICAgICAgfSwKICAgICAgICAgICAgInJ1bGVfemhpaHUiOiB7CiAgICAgICAgICAgICAgICAibmFtZSI6ICJkZWZhdWx0IiwKICAgICAgICAgICAgICAgICJob29rX2V2ZW50TmFtZXMiOiAiY29udGV4dG1lbnV8c2VsZWN0fHNlbGVjdHN0YXJ0fGNvcHl8Y3V0fGRyYWdzdGFydHxtb3VzZW1vdmUiLAogICAgICAgICAgICAgICAgInVuaG9va19ldmVudE5hbWVzIjogImtleWRvd258a2V5dXAiLAogICAgICAgICAgICAgICAgImRvbTAiOiB0cnVlLAogICAgICAgICAgICAgICAgImhvb2tfYWRkRXZlbnRMaXN0ZW5lciI6IHRydWUsCiAgICAgICAgICAgICAgICAiaG9va19wcmV2ZW50RGVmYXVsdCI6IHRydWUsCiAgICAgICAgICAgICAgICAiaG9va19zZXRfcmV0dXJuVmFsdWUiOiB0cnVlLAogICAgICAgICAgICAgICAgImFkZF9jc3MiOiB0cnVlCiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgICJkYXRhIjogWwogICAgICAgICAgICAiYi5mYWxvby5jb20iLAogICAgICAgICAgICAiYmJzLmNvb2NhYS5jb20iLAogICAgICAgICAgICAiYm9vay5oanNtLnRvbS5jb20iLAogICAgICAgICAgICAiYm9vay56aHVsYW5nLmNvbSIsCiAgICAgICAgICAgICJib29rLnpvbmdoZW5nLmNvbSIsCiAgICAgICAgICAgICJjaG9rc3RpY2suY29tIiwKICAgICAgICAgICAgImNodWFuZ3NoaS5xcS5jb20iLAogICAgICAgICAgICAiY2l0eS51ZG4uY29tIiwKICAgICAgICAgICAgImN1dGVsaXNhNTUucGl4bmV0Lm5ldCIsCiAgICAgICAgICAgICJodWF5dS5iYWlkdS5jb20iLAogICAgICAgICAgICAiaW1hYy5oayIsCiAgICAgICAgICAgICJsaWZlLnR3IiwKICAgICAgICAgICAgImx1eG11c2NsZXMuY29tIiwKICAgICAgICAgICAgIm5ld3MubWlzc2V2YW4uY29tIiwKICAgICAgICAgICAgInJlYWQucWlkaWFuLmNvbSIsCiAgICAgICAgICAgICJ3d3cuMTV5YW4uY29tIiwKICAgICAgICAgICAgInd3dy4xN2suY29tIiwKICAgICAgICAgICAgInd3dy4xODE4My5jb20iLAogICAgICAgICAgICAid3d3LjM2MGRvYy5jb20iLAogICAgICAgICAgICAid3d3LmNvY28wMS5uZXQiLAogICAgICAgICAgICAid3d3LmV5dS5jb20iLAogICAgICAgICAgICAid3d3LmhvbmdzaHUuY29tIiwKICAgICAgICAgICAgInd3dy5ob25neGl1LmNvbSIsCiAgICAgICAgICAgICJ3d3cuaW1vb2MuY29tIiwKICAgICAgICAgICAgInd3dy5qand4Yy5uZXQiLAogICAgICAgICAgICAid3d3LnJlYWRub3ZlbC5jb20iLAogICAgICAgICAgICAid3d3LnRhZHUuY29tIiwKICAgICAgICAgICAgInd3dy54eHN5Lm5ldCIsCiAgICAgICAgICAgICJ3d3cuejN6NC5jb20iLAogICAgICAgICAgICAid3d3LnpoaWh1LmNvbSIsCiAgICAgICAgICAgICJ5dWVkdS4xNjMuY29tIiwKICAgICAgICAgICAgInd3dy5wcGthby5jb20iLAogICAgICAgICAgICAibW92aWUuZG91YmFuLmNvbSIsCiAgICAgICAgICAgICJ3d3cucnVpd2VuLmNvbSIsCiAgICAgICAgICAgICJ2aXByZWFkZXIucWlkaWFuLmNvbSIsCiAgICAgICAgICAgICJ3d3cucGlnYWkub3JnIiwKICAgICAgICAgICAgInd3dy5zaGFuZ2MubmV0IiwKICAgICAgICAgICAgInd3dy5teWh0bG1lYm9vay5jb20iLAogICAgICAgICAgICAid3d3Lnl1cXVlLmNvbSIsCiAgICAgICAgICAgICJ3d3cubG9uZ21hYm9va2NuLmNvbSIsCiAgICAgICAgICAgICJ3d3cuYWxwaGFwb2xpcy5jby5qcCIsCiAgICAgICAgICAgICJ3d3cuc2RpZmVuLmNvbSIsCiAgICAgICAgICAgICJ2b3RldHcuY29tIiwKICAgICAgICAgICAgImJva2UxMTIuY29tIiwKICAgICAgICAgICAgInd3dy5teWh0ZWJvb2tzLmNvbSIsCiAgICAgICAgICAgICJ3d3cueGllZ3cuY24iLAogICAgICAgICAgICAiY2h1YW5nc2hpLnFxLmNvbSIsCiAgICAgICAgICAgICJ3d3cudXRhLW5ldC5jb20iLAogICAgICAgICAgICAid3d3LmJpbWlhY2cubmV0IgogICAgICAgIF0KICAgIH07CgogICAgdmFyIHJ3bF91c2VyRGF0YSA9IG51bGw7CiAgICB2YXIgaG9zdG5hbWUgPSB3aW5kb3cubG9jYXRpb24uaG9zdG5hbWU7CiAgICB2YXIgYnRuX25vZGUgPSBudWxsOwogICAgdmFyIHJ1bGUgPSBudWxsOwogICAgdmFyIGxpc3QgPSBudWxsOwogICAgdmFyIGhhc0ZyYW1lID0gZmFsc2U7CgogICAgLy8g5YKo5a2Y5ZCN56ewCiAgICB2YXIgc3RvcmFnZU5hbWUgPSAiU3RvcmFnZU5hbWUiOwogICAgLy8g6KaB5aSE55CG55qEIGV2ZW50IOWIl+ihqAogICAgdmFyIGhvb2tfZXZlbnROYW1lcywgdW5ob29rX2V2ZW50TmFtZXMsIGV2ZW50TmFtZXM7CiAgICAvLyDlgqjlrZjooqsgSG9vayDnmoTlh73mlbAKICAgIHZhciBFdmVudFRhcmdldF9hZGRFdmVudExpc3RlbmVyID0gRXZlbnRUYXJnZXQucHJvdG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W5jdGlvbiAoKSB7CiAgICAgICAgcXhpblN0YXJ0KCk7CiAgICB9LCA1MDApOwoKICAgIC8vIH0KCiAgICAvLyBHTV9yZWdpc3Rlck1lbnVDb21tYW5kKCLlpI3liLbpmZDliLbop6PpmaQg6K6+572uIiwgc2V0TWVudSkKICAgIHZhciB1c2VyU2V0dGluZyA9IEdNX2dldFZhbHVlKCJyd2xfdXNlckRhdGEiKTsKCiAgICAvLyAvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS3lh73mlbAgZnVuYwoKICAgIGZ1bmN0aW9uIHF4aW5TdGFydCgpIHsKICAgICAgICAvLyBhZGREcmFnRXZlbigpOwogICAgICAgIC8vIHNldEJ0bkNsaWNrKCk7CgogICAgICAgIC8vIOajgOafpeaYr+WQpuWcqOm7keWQjeWNleS4rQogICAgICAgIGlmIChjaGVja19ibGFja19saXN0KGxpc3QpKSB7CiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICBpZiAocndsX3VzZXJEYXRhLmFkZEJ0bikgewogICAgICAgICAgICAgICAgICAgIGJ0bl9ub2RlLmNoZWNrZWQgPSB0cnVlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgIH0gZmluYWxseSB7CiAgICAgICAgICAgICAgICBpbml0KCk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CgogICAgLy8g5Yid5aeL5YyWIGluaXQgZnVuYyAg6L+Z6YeM5omN5piv5qC45b+DCiAgICBmdW5jdGlvbiBpbml0KCkgewogICAgICAgIC8vIOmSiOWvueS4quWIq+e9keermemHh+WPluS4jeWQjOeahOetlueVpQogICAgICAgIHJ1bGUgPSBjbGVhcigpOwogICAgICAgIC8vIOiuvue9riBldmVudCDliJfooagKICAgICAgICBob29rX2V2ZW50TmFtZXMgPSBydWxlLmhvb2tfZXZlbnROYW1lcy5zcGxpdCgifCIpOwogICAgICAgIC8vIFRPRE8gQWxsb3dlZCB0byByZXR1cm4gdmFsdWUKICAgICAgICB1bmhvb2tfZXZlbnROYW1lcyA9IHJ1bGUudW5ob29rX2V2ZW50TmFtZXMuc3BsaXQoInwiKTsKICAgICAgICBldmVudE5hbWVzID0gaG9va19ldmVudE5hbWVzLmNvbmNhdCh1bmhvb2tfZXZlbnROYW1lcyk7CgogICAgICAgIC8vIOiwg+eUqOa4heeQhiBET00wIGV2ZW50IOaWueazleeahOW+queOrwogICAgICAgIGlmIChydWxlLmRvbTApIHsKICAgICAgICAgICAgc2V0SW50ZXJ2YWwoY2xlYXJMb29wLCAxMCAqIDEwMDApOwogICAgICAgICAgICBzZXRUaW1lb3V0KGNsZWFyTG9vcCwgMTUwMCk7CiAgICAgICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCdsb2FkJywgY2xlYXJMb29wLCB0cnVlKTsKICAgICAgICAgICAgY2xlYXJMb29wKCk7CiAgICAgICAgfQoKICAgICAgICAvLyBob29rIGFkZEV2ZW50TGlzdGVuZXIgLy/lr7zoh7TmkJzntKLot7PovazlpLHmlYjnmoTljp/lm6AKICAgICAgICBpZiAocnVsZS5ob29rX2FkZEV2ZW50TGlzdGVuZXIpIHsKICAgICAgICAgICAgRXZlbnRUYXJnZXQucHJvdG90eXBlLmFkZEV2ZW50TGlzdGVuZXIgPSBhZGRFdmVudExpc3RlbmVyOwogICAgICAgICAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyID0gYWRkRXZlbnRMaXN0ZW5lcjsKCiAgICAgICAgICAgIGlmIChoYXNGcmFtZSkgewogICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBoYXNGcmFtZS5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgICAgIGhhc0ZyYW1lW2ldLmNvbnRlbnRXaW5kb3cuZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lciA9IGFkZEV2ZW50TGlzdGVuZXI7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KCiAgICAgICAgfQoKICAgICAgICAvLyBob29rIHByZXZlbnREZWZhdWx0CiAgICAgICAgaWYgKHJ1bGUuaG9va19wcmV2ZW50RGVmYXVsdCkgewogICAgICAgICAgICBFdmVudC5wcm90b3R5cGUucHJldmVudERlZmF1bHQgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICBpZiAoaG9va19ldmVudE5hbWVzLmluZGV4T2YodGhpcy50eXBlKSA8IDApIHsKICAgICAgICAgICAgICAgICAgICBFdmVudF9wcmV2ZW50RGVmYXVsdC5hcHBseSh0aGlzLCBhcmd1bWVudHMpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9OwoKICAgICAgICAgICAgaWYgKGhhc0ZyYW1lKSB7CiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGhhc0ZyYW1lLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgaGFzRnJhbWVbaV0uY29udGVudFdpbmRvdy5FdmVudC5wcm90b3R5cGUucHJldmVudERlZmF1bHQgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChob29rX2V2ZW50TmFtZXMuaW5kZXhPZih0aGlzLnR5cGUpIDwgMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgRXZlbnRfcHJldmVudERlZmF1bHQuYXBwbHkodGhpcywgYXJndW1lbnRzKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIC8vIEhvb2sgc2V0IHJldHVyblZhbHVlCiAgICAgICAgaWYgKHJ1bGUuaG9va19zZXRfcmV0dXJuVmFsdWUpIHsKICAgICAgICAgICAgRXZlbnQucHJvdG90eXBlLl9fZGVmaW5lU2V0dGVyX18oJ3JldHVyblZhbHVlJywgZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAga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ICAgICAgICAgICAgZm9yICh2YXIgaiBpbiBldmVudE5hbWVzKSB7CiAgICAgICAgICAgICAgICB2YXIgbmFtZSA9ICdvbicgKyBldmVudE5hbWVzW2pdOwoKICAgICAgICAgICAgICAgIC8vIDs/5pyq6Kej5YazCiAgICAgICAgICAgICAgICAvLyAyMDE4LTA0LTAyIGVsZW1lbnRz5Lit5Lya5pyJ5a2X56ym5Liy5Ye6546wLOWOn+eJiOS4jeS8mizpl67popjkuI3mmI4s5qC55pys5Y6f5Zug5bCa5pyq6Kej5YazCiAgICAgICAgICAgICAgICAvLyDnm7jlhbPlj43ppoggIGh0dHBzOi8vZ3JlYXN5Zm9yay5vcmcvemgtQ04vZm9ydW0vZGlzY3Vzc2lvbi8zNjAxNAogICAgICAgICAgICAgICAgLy8g6Zeu6aKY54mI5pys5Y+3ICB2My4wLjcKICAgICAgICAgICAgICAgIC8vIOmXrumimOihpeWFhSAgIOS5i+WJjeWPr+S7peS9v+eUqCzlhbfkvZPniYjmnKzmnKrmtYvvvIgyMDE4LTA0LTAyIDIxOjI3OjUz77yJLOWOn+eJiOWPr+S7peS9v+eUqAogICAgICAgICAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChlbGVtZW50c1tpXSkgPT0gIltvYmplY3QgU3RyaW5nXSIpIHsKICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAvLyBjb25zb2xlLmxvZyhlbGVtZW50c1tpXSkKICAgICAgICAgICAgICAgIC8vIGlmKHR5cGVvZiBlbGVtZW50c1tpXVtuYW1lXSA9PT0gIm9iamVjdCIpewogICAgICAgICAgICAgICAgLy8gICAgIGNvbnNvbGUubG9nKHR5cGVvZiBlbGVtZW50c1tpXVtuYW1lXSkKICAgICAgICAgICAgICAgIC8vIH0KICAgICAgICAgICAgICAgIGlmIChlbGVtZW50c1tpXVtuYW1lXSAhPT0gbnVsbCAmJiBlbGVtZW50c1tpXVtuYW1lXSAhPT0gb254eHgpIHsKICAgICAgICAgICAgICAgICAgICBpZiAodW5ob29rX2V2ZW50TmFtZXMuaW5kZXhPZihldmVudE5hbWVzW2pdKSA+PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnRzW2ldW3N0b3JhZ2VOYW1lICsgbmFtZV0gPSBlbGVtZW50c1tpXVtuYW1lXTsKICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudHNbaV1bbmFtZV0gPSBvbnh4eDsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50c1tpXVtuYW1lXSA9IG51bGw7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICBkb2N1bWVudC5vbm1vdXNlZG93biA9IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgfTsKICAgIH0KCiAgICAvLyDov5Tlm550cnVl55qE5Ye95pWwCiAgICBmdW5jdGlvbiByZXR1cm5UcnVlKGUpIHsKICAgICAgICByZXR1cm4gdHJ1ZTsKICAgIH0KCiAgICBmdW5jdGlvbiB1bmhvb2tfdChlKSB7CiAgICAgICAgcmV0dXJuIHVuaG9vayhlLCB0aGlzLCBzdG9yYWdlTmFtZSArIGUudHlwZSArICd0Jyk7CiAgICB9CgogICAgZnVuY3Rpb24gdW5ob29rX2YoZSkgewogICAgICAgIHJldHVybiB1bmhvb2soZSwgdGhpcywgc3RvcmFnZU5hbWUgKyBlLnR5cGUgKyAnZicpOwogICAgfQoKICAgIGZ1bmN0aW9uIHVuaG9vayhlLCBzZWxmLCBmdW5jc05hbWUpIHsKICAgICAgICB2YXIgbGlzdCA9IHNlbGZbZnVuY3NOYW1lXTsKICAgICAgICBmb3IgKHZhciBpIGluIGxpc3QpIHsKICAgICAgICAgICAgbGlzdFtpXShlKTsKICAgICAgICB9CgogICAgICAgIGUucmV0dXJuVmFsdWUgPSB0cnVlOwogICAgICAgIHJldHVybiB0cnVlOwogICAgfQoKICAgIGZ1bmN0aW9uIG9ueHh4KGUpIHsKICAgICAgICB2YXIgbmFtZSA9IHN0b3JhZ2VOYW1lICsgJ29uJyArIGUudHlwZTsKICAgICAgICB0aGlzW25hbWVdKGUpOwoKICAgICAgICBlLnJldHVyblZhbHVlID0gdHJ1ZTsKICAgICAgICByZXR1cm4gdHJ1ZTsKICAgIH0KCiAgICAvLyDojrflj5bmiYDmnInlhYPntKAg5YyF5ousZG9jdW1lbnQKICAgIGZ1bmN0aW9uIGdldEVsZW1lbnRzKCkgewogICAgICAgIHZhciBlbGVtZW50cyA9IEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKGRvY3VtZW50LmdldEVsZW1lbnRzQnlUYWdOYW1lKCcqJykpOwogICAgICAgIGVsZW1lbnRzLnB1c2goZG9jdW1lbnQpOwoKICAgICAgICAvLyDlvqrnjq/miYDmnIkgZnJhbWUg56qX5Y+jCiAgICAgICAgdmFyIGZyYW1lcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoImZyYW1lIik7CiAgICAgICAgaWYgKGZyYW1lcykgewogICAgICAgICAgICBoYXNGcmFtZSA9IGZyYW1lczsKICAgICAgICAgICAgdmFyIGZyYW1lc19lbGVtZW50OwogICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGZyYW1lcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgZnJhbWVzX2VsZW1lbnQgPSBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChmcmFtZXNbaV0uY29udGVudFdpbmRvdy5kb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCIqIikpOwogICAgICAgICAgICAgICAgZWxlbWVudHMucHVzaChmcmFtZXNbaV0uY29udGVudFdpbmRvdy5kb2N1bWVudCk7CiAgICAgICAgICAgICAgICBlbGVtZW50cyA9IGVsZW1lbnRzLmNvbmNhdChmcmFtZXNfZWxlbWVudCk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGVsZW1lbnRzOwogICAgfQogICAgLy8g6I635Y+W6buR5ZCN5Y2V572R56uZIEZ1bmMKICAgIGZ1bmN0aW9uIGdldF9ibGFja19saXN0KCkgewogICAgICAgIC8vIOS5i+WJjeeJiOacrOWPr+iDveWvvOiHtOWtmOWCqOepuueahOWtl+espuS4sgogICAgICAgIC8vIDIwMTgtMDYtMTEgMTU6MTE6NDQg5L+d55WZLOW9k+WuuemUmeWkhOeQhgogICAgICAgIHZhciBkYXRhX3RlbXAgPSByd2xfdXNlckRhdGEuZGF0YTsKICAgICAgICBkYXRhX3RlbXAgPSBkYXRhX3RlbXAuZmlsdGVyKGZ1bmN0aW9uIChpdGVtKSB7CiAgICAgICAgICAgIHJldHVybiBpdGVtLmxlbmd0aCA+IDE7CiAgICAgICAgfSk7CiAgICAgICAgcmV0dXJuIGRhdGFfdGVtcDsKICAgIH0KCiAgICAvLyDmo4Dmn6XmmK/lkKblrZjlnKjkuo7pu5HlkI3ljZXkuK0g6L+U5Zue5L2N572uIGZ1bmMKICAgIGZ1bmN0aW9uIGNoZWNrX2JsYWNrX2xpc3QobGlzdCwgaG9zdCkgewogICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbGlzdC5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBpZiAofmhvc3RuYW1lLmluZGV4T2YobGlzdFtpXSkpIHsKICAgICAgICAgICAgICAgIHJldHVybiBpICsgMTsgIC8v5LiH5LiA5Yy56YWN5Yiw56ys5LiA5LiqLOi/lOWbnjAKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gZmFsc2U7CiAgICB9CgogICAgLy8g5pWw57uE5Y676YeNCiAgICBmdW5jdGlvbiB1bmlxdWUoYXJyKSB7CiAgICAgICAgdmFyIHJldCA9IFtdOwogICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIHZhciBpdGVtID0gYXJyW2ldOwogICAgICAgICAgICBpZiAocmV0LmluZGV4T2YoaXRlbSkgPT09IC0xKSB7CiAgICAgICAgICAgICAgICByZXQucHVzaChpdGVtKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gcmV0OwogICAgfQoKICAgIC8vIOWkjeWItuWIsOWJqui0tOadvwogICAgZnVuY3Rpb24gc2V0Q2xpcGJvYXJkKCkgewogICAgICAgIHZhciB0ZXh0X29iaiA9IHdpbmRvdy5nZXRTZWxlY3Rpb24oKTsKICAgICAgICB2YXIgdGV4dCA9IHRleHRfb2JqLnRvU3RyaW5nKCk7CiAgICAgICAgR01fc2V0Q2xpcGJvYXJkKHRleHQpOwoKICAgIH0KCiAgICAvLyDlv6vmjbfplK4gRjHvvIhjdHJsK2Yx77yJIOWkjeWItgogICAgZnVuY3Rpb24gaG90a2V5KCkgewogICAgICAgIHZhciBhID0gd2luZG93LmV2ZW50LmtleUNvZGU7CiAgICAgICAgLy8gaWYgKChhID09IDExMikgJiYgKGV2ZW50LmN0cmxLZXkpKSB7CiAgICAgICAgaWYgKGEgPT0gMTEyICYmIHVzZXJTZXR0aW5nLnNob3J0Y3V0ID09IDEpIHsKICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTsKICAgICAgICAgICAgc2V0Q2xpcGJvYXJkKCk7CiAgICAgICAgICAgIGV2ZW50LmtleUNvZGUgPSAwOwogICAgICAgICAgICBldmVudC5yZXR1cm5WYWx1ZSA9IGZhbHNlOwogICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgfSBlbHNlIGlmIChhID09IDExMiAmJiAoZXZlbnQuY3RybEtleSkgJiYgdXNlclNldHRpbmcuc2hvcnRjdXQgPT0gMikgewogICAgICAgICAgICBzZXRDbGlwYm9hcmQoKTsKICAgICAgICB9IGVsc2UgaWYgKChhID09IDY3KSAmJiAoZXZlbnQuY3RybEtleSkgJiYgdXNlclNldHRpbmcuc2hvcnRjdXQgPT0gMykgewogICAgICAgICAgICBzZXRDbGlwYm9hcmQoKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBjb25zb2xlLmxvZygi5YWz6Zet5LqG5b+r5o236ZSuIik7CiAgICAgICAgfQogICAgfQoKICAgIGRvY3VtZW50Lm9ua2V5ZG93biA9IGhvdGtleTsgLy/lvZNvbmtleWRvd24g5LqL5Lu25Y+R55Sf5pe26LCD55SoaG90a2V55Ye95pWwCgogICAgLy8g6YOo5YiG572R56uZ6YeH55So5LqG5YW25LuW55qE6Ziy5aSN5Yi25omL5q61CiAgICBmdW5jdGlvbiBjbGVhcigpIHsKICAgICAgICAvLyBjb25zb2xlLmxvZygi6L+b5YWlY2xlYXIiLGhvc3RuYW1lLHJ3bF91c2VyRGF0YS5ydWxlcyk7CiAgICAgICAgc3dpdGNoIChob3N0bmFtZSkgewogICAgICAgICAgICBjYXNlICJjaHVhbmdzaGkucXEuY29tIjoKICAgICAgICAgICAgICAgIGNsZWFyX2NodWFuZ3NoaSgpOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgInZvdGV0dy5jb20iOgogICAgICAgICAgICAgICAgY2xlYXJfdm90ZXR3KCk7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAid3d3Lm15aHRlYm9va3MuY29tIjoKICAgICAgICAgICAgICAgIGNsZWFyX2NvdmVycygiLmZ1bGxpbWciKTsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBjYXNlICJ3d3cuejN6NC5jb20iOgogICAgICAgICAgICAgICAgY2xlYXJfY292ZXJzKCIubW92aWVkb3duYWRkaXYiKTsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBjYXNlICJodWF5dS5iYWlkdS5jb20iOgogICAgICAgICAgICAgICAgY2xlYXJfY292ZXJzKCIjanFDb250ZXh0TWVudSIpOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgInd3dy5teWh0bG1lYm9vay5jb20iOgogICAgICAgICAgICAgICAgY2xlYXJfY292ZXJzKCJpbWcuZnVsbGltZyIpOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgInpoaWh1LmNvbSI6CiAgICAgICAgICAgIGNhc2UgInd3dy56aGlodS5jb20iOgogICAgICAgICAgICAgICAgcmV0dXJuIHJ3bF91c2VyRGF0YS5ydWxlcy5ydWxlX3poaWh1OwogICAgICAgICAgICBjYXNlICJ0LmJpbGliaWxpLmNvbSI6CiAgICAgICAgICAgICAgICBjbGVhcl9saW5rX2JpbGliaWxpKCk7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAid3d3LnVzbHNvZnR3YXJlLmNvbSI6CiAgICAgICAgICAgICAgICBjbGVhcl9jb3ZlcnMoIi5wcm90ZWN0X2NvbnRlbnRzLW92ZXJsYXkiKTsKICAgICAgICAgICAgICAgIGNsZWFyX2NvdmVycygiLnByb3RlY3RfYWxlcnQiKTsKICAgICAgICAgICAgICAgIHJldHVybiByd2xfdXNlckRhdGEucnVsZXMucnVsZV9wbHVzOwogICAgICAgICAgICBjYXNlICJ3d3cubG9uZ21hYm9va2NuLmNvbSI6CiAgICAgICAgICAgICAgICBjbGVhcl9jb3ZlcnMoIi5mdWxsaW1nIik7CiAgICAgICAgICAgICAgICByZXR1cm4gcndsX3VzZXJEYXRhLnJ1bGVzLnJ1bGVfcGx1czsKICAgICAgICAgICAgY2FzZSAiYm9rZTExMi5jb20iOgogICAgICAgICAgICAgICAgcmV0dXJuIHJ3bF91c2VyRGF0YS5ydWxlcy5ydWxlX3BsdXM7CiAgICAgICAgICAgIGNhc2UgInd3dy5zaGFuZ2MubmV0IjoKICAgICAgICAgICAgICAgIHJldHVybiByd2xfdXNlckRhdGEucnVsZXMucnVsZV9wbHVzOwogICAgICAgIH0KICAgICAgIC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VjcmV0KScpOwogICAgICAgIGlmICghJHRpcC5sZW5ndGgpIHJldHVybjsKCiAgICAvLyDop6PmnpBmb250LWN4c2VjcmV05a2X5L2TCiAgICAgICAgdmFyIGZvbnQgPSAkdGlwLnRleHQoKS5tYXRjaCgvYmFzZTY0LChbXHdcV10rPyknLylbMV07CiAgICAgICAgZm9udCA9IFR5cHIucGFyc2UoYmFzZTY0VG9VaW50OEFycmF5KGZvbnQpKVswXTsKCiAgICAvLyDljLnphY3op6Plr4blrZfkvZMKICAgICAgICB2YXIgdGFibGUgPSBKU09OLnBhcnNlKEdNX2dldFJlc291cmNlVGV4dCgnVGFibGUnKSk7CiAgICAgICAgdmFyIG1hdGNoID0ge307CiAgICAgICAgZm9yICh2YXIgaSA9IDE5OTY4OyBpIDwgNDA4NzA7IGkrKykgeyAvLyDkuK3mlodbMTk5NjgsIDQwODY5XQogICAgICAgICAgICAkdGlwID0gVHlwci5VLmNvZGVUb0dseXBoKGZvbnQsIGkpOwogICAgICAgICAgICBpZiAoISR0aXApIGNvbnRpbnVlOwogICAgICAgICAgICAkdGlwID0gVHlwci5VLmdseXBoVG9QYXRoKGZvbnQsICR0aXApOwogICAgICAgICAgICAkdGlwID0gTUQ1KEpTT04uc3RyaW5naWZ5KCR0aXApKS5zbGljZSgyNCk7IC8vIDjkvY3ljbPlj6/ljLrliIYKICAgICAgICAgICAgbWF0Y2hbaV0gPSB0YWJsZVskdGlwXTsKICAgICAgICB9CgogICAgLy8g5pu/5o2i5Yqg5a+G5a2X5L2TCiAgICAgICAgJCgnLmZvbnQtY3hzZWNyZXQnKS5odG1sKGZ1bmN0aW9uIChpbmRleCwgaHRtbCkgewogICAgICAgICAgICAkLmVhY2gobWF0Y2gsIGZ1bmN0aW9uIChrZXksIHZhbHVlKSB7CiAgICAgICAgICAgICAgICBrZXkgPSBTdHJpbmcuZnJvbUNoYXJDb2RlKGtleSk7CiAgICAgICAgICAgICAgICBrZXkgPSBuZXcgUmVnRXhwKGtleSwgJ2c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KSB7CiAgICAgICAgICAgICAgICAgICAgaWYgKGFyZ3NbMF0gPT09ICcjaGNTZWFyY2hlTW9kYWwnKSByZXR1cm4gZmFsc2UKICAgICAgICAgICAgICAgICAgICByZXR1cm4gcXVlcnlTZWxlY3Rvci5jYWxsKHRoaXMsIC4uLmFyZ3MpCiAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbChpbnR2KTsKICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICB9CiAgICAgICAgfSwgMTAwKTsKICAgIH0KCgogICAgZnVuY3Rpb24gc3RhcnQoKSB7CiAgICAgICAgdHJ5IHtyZW1vdmVZdWtldGFuZ0xpc3QoKTt9Y2F0Y2ggKGUpe30KICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgdHJ5IHtyZW1vdmVGKCk7fSBjYXRjaCAoZSkge30KICAgICAgICAgICAgdHJ5IHtpbml0KCk7fSBjYXRjaCAoZSkge30KCgogICAgICAgIH0sIDEwMDApOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldERlZmF1bHRDb25maWcoKSB7CiAgICAgICAgY29uc3QgZGVmYXVsdENvbmZpZyA9IHsKICAgICAgICAgICAgYXV0b19zZWFyY2g6IGZhbHNlLC8v6Ieq5Yqo5pCc57SiCiAgICAgICAgICAgIGF1dG9fY2xvc2U6IHRydWUsLy/oh6rliqjlhbPpl60KICAgICAgICAgICAgcmVtb3ZlX2xpbWl0OiBmYWxzZSwvL+ino+mZpOWkjeWItumZkOWItgogICAgICAgICAgICBmaXhlZF9tb2RhbDogdHJ1ZSwvL+WfuuS6jua1j+iniOWZqOW4g+WxgAogICAgICAgICAgICBjdXN0b21fc3R5bGVfb246IHRydWUsCiAgICAgICAgICAgIGluX3NldHRpbmc6IGZhbHNlLC8v5piv5ZCm5Zyo6K6+572u6aG16Z2iCiAgICAgICAgICAgIGN1c3RvbV9zdHlsZTogIiIsCiAgICAgICAgICAgIG91dF9pZnJhbWU6IHRydWUsCiAgICAgICAgICAgIG1vZGVsOnsKICAgICAgICAgICAgICAgIHNlbGVjdDoi6buY6K6kIiwKICAgICAgICAgICAgICAgICLnrZTpopgiOmDmiJHmg7PorqnkvaDmia7mvJTkuIDlkI3lgZrpopjlrrbvvIzmiJHlsIbkvJrlr7nkvaDlj5Hotbfmj5Dpl67vvIzkvaDnmoTku7vliqHmmK/nu5nlh7rlhbfkvZPnmoTnrZTmoYjlubbor7TmmI7nkIbnlLHjgILmiJHnmoTpopjnm67mmK/igJx7bXNnfeKAnWAsCiAgICAgICAgICAgICAgICAi57+76K+RIjpg5LiL6Z2i5oiR6K6p5L2g5p2l5YWF5b2T57+76K+R5a6277yM5L2g55qE55uu5qCH5piv5oqK5Lu75L2V6K+t6KiA57+76K+R5oiQ5Lit5paH77yM6K+357+76K+R5pe25LiN6KaB5bim57+76K+R6IWU77yM6ICM5piv6KaB57+76K+R5b6X6Ieq54S244CB5rWB55WF5ZKM5Zyw6YGT77yM5L2/55So5LyY576O5ZKM6auY6ZuF55qE6KGo6L6+5pa55byP44CC6K+357+76K+R5LiL6Z2i6L+Z5Y+l6K+d77ya4oCce21zZ33igJ1gLAogICAgICAgICAgICAgICAgIum7mOiupCI6YHttc2d9YCwKICAgICAgICAgICAgICAgICLoh6rlrprkuYkxIjpgYCwKICAgICAgICAgICAgICAgICLoh6rlrprkuYkyIjpgYCwKICAgICAgICAgICAgfQogICAgICAgIH07CiAgICAgICAgLy/ljrvmn6Xmib7mjqXlj6Porr7nva4g6buY6K6kCiAgICAgICAgaWYgKEdNX2dldFZhbHVlKCJkZWZhdWx0Q29uZmlnIikgPT09IHVuZGVmaW5lZCkgewogICAgICAgICAgICBHTV9zZXRWYWx1ZSgiZGVmYXVsdENvbmZpZyIsIEpTT04uc3RyaW5naWZ5KGRlZmF1bHRDb25maWcpKTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIEpTT04ucGFyc2UoR01fZ2V0VmFsdWUoImRlZmF1bHRDb25maWciKSkKICAgIH0KCiAgICBsZXQgb3B0aW9ucyA9IGdldERlZmF1bHRDb25maWcoKTsKCiAgICBmdW5jdGlvbiBnZXRUb2tlbigpIHsKICAgICAgICBpZiAodHlwZW9mIEdNX2dldFZhbHVlKCJ0b2tlbiIpID09PSAnc3RyaW5nJykgewogICAgICAgICAgICByZXR1cm4gR01fZ2V0VmFsdWUoInRva2VuIikKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICByZXR1cm4gJycKICAgICAgICB9CiAgICB9CgoKICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIiwgZnVuY3Rpb24gKGV2ZW50KSB7CiAgICAgICAgaWYgKGV2ZW50LmRhdGEudHlwZSA9PT0gJ3NlYXJjaCcpIHsKICAgICAgICAgICAgYWRkTW9kYWwyKGNyZWF0ZUZyYW1lTG9hZGluZygpLCBmYWxzZSk7CiAgICAgICAgICAgIHNlYXJjaFdvcmQoZXZlbnQuZGF0YS53ZCkudGhlbihyZXMgPT4gewogICAgICAgICAgICAgICAgYWRkTW9kYWwyKHJlcywgZmFsc2UsIGZhbHNlKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgaWYgKGV2ZW50LmRhdGEudHlwZSA9PT0gJ2F1dG9fY2xvc2UnKSB7CiAgICAgICAgICAgICAgICBvcHRpb25zLmF1dG9fY2xvc2UgPSBldmVudC5kYXRhLmF1dG9fY2xvc2U7CiAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgiZGVmYXVsdENvbmZpZyIsIEpTT04uc3RyaW5naWZ5KG9wdGlvbnMpKTsKICAgICAgICAgICAgfSBlbHNlIGlmIChldmVudC5kYXRhLnR5cGUgPT09ICdhdXRvX3NlYXJjaCcpIHsKICAgICAgICAgICAgICAgIG9wdGlvbnMuYXV0b19zZWFyY2ggPSBldmVudC5kYXRhLmF1dG9fc2VhcmNoOwogICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoImRlZmF1bHRDb25maWciLCBKU09OLnN0cmluZ2lmeShvcHRpb25zKSk7CiAgICAgICAgICAgIH0gZWxzZSBpZiAoZXZlbnQuZGF0YS50eXBlID09PSAncmVtb3ZlX2xpbWl0JykgewogICAgICAgICAgICAgICAgbGV0IGNvcHkgPSBPYmplY3QuYXNzaWduKG9wdGlvbnMpOwogICAgICAgICAgICAgICAgY29weS5yZW1vdmVfbGltaXQgPSBldmVudC5kYXRhLnJlbW92ZV9saW1pdDsKICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCJkZWZhdWx0Q29uZmlnIiwgSlNPTi5zdHJpbmdpZnkoY29weSkpOwogICAgICAgICAgICB9IGVsc2UgaWYgKGV2ZW50LmRhdGEudHlwZSA9PT0gJ2ZpeGVkX21vZGFsJykgewogICAgICAgICAgICAgICAgb3B0aW9ucy5maXhlZF9tb2RhbCA9IGV2ZW50LmRhdGEuZml4ZWRfbW9kYWw7CiAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgiZGVmYXVsdENvbmZpZyIsIEpTT04uc3RyaW5naWZ5KG9wdGlvbnMpKTsKICAgICAgICAgICAgfSBlbHNlIGlmIChldmVudC5kYXRhLnR5cGUgPT09ICdvdXRfaWZyYW1lJykgewogICAgICAgICAgICAgICAgb3B0aW9ucy5vdXRfaWZyYW1lID0gZXZlbnQuZGF0YS5vdXRfaWZyYW1lOwogICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoImRlZmF1bHRDb25maWciLCBKU09OLnN0cmluZ2lmeShvcHRpb25zKSk7CiAgICAgICAgICAgIH0gZWxzZSBpZiAoZXZlbnQuZGF0YS50eXBlID09PSAnc2VsZWN0X21zZ19tb2RlbCcpIHsKICAgICAgICAgICAgICAgIG9wdGlvbnMubW9kZWwuc2VsZWN0ID0gZXZlbnQuZGF0YS5zZWxlY3RfbXNnX21vZGVsOwogICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoImRlZmF1bHRDb25maWciLCBKU09OLnN0cmluZ2lmeShvcHRpb25zKSk7CiAgICAgICAgICAgIH0gZWxzZSBpZiAoZXZlbnQuZGF0YS50eXBlID09PSAndXBkYXRlX21zZ19tb2RlbCcpIHsKICAgICAgICAgICAgICAgIG9wdGlvbnMubW9kZWxbZXZlbnQuZGF0YS5zZWxlY3RfbXNnX21vZGVsXSA9IGV2ZW50LmRhdGEudXBkYXRlX21zZ19tb2RlbDsKICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCJkZWZhdWx0Q29uZmlnIiwgSlNPTi5zdHJpbmdpZnkob3B0aW9ucykpOwogICAgICAgICAgICB9IGVsc2UgaWYgKGV2ZW50LmRhdGEudHlwZSA9PT0gJ2xvZ2luJykgewogICAgICAgICAgICAgICAgCiAgICAgICAgICAgIH0gZWxzZSBpZiAoZXZlbnQuZGF0YS50eXBlID09PSAnY2FwdGNoYScpIHsKCiAgICAgICAgICAgIH0gZWxzZSBpZiAoZXZlbnQuZGF0YS50eXBlID09PSAnY2hlY2tWZXJzaW9uJykgewogICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoInZlcnNpb24iLCBKU09OLnN0cmluZ2lmeShldmVudC5kYXRhLnZlcnNpb24pKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0sIGZhbHNlKTsKCgogICAgbGV0IFBPUE9WRVJfSUQgPSAnaGNTZWFyY2hlUG9wb3Zlcic7CiAgICBsZXQgTU9EQUxfSUQgPSAnaGNTZWFyY2hlTW9kYWwnOwoKCiAgICBsZXQgbW91c2VYID0gMDsKICAgIGxldCBtb3VzZVkgPSAwOwoKICAgIGxldCBfc2VsZiA9IHVuc2FmZVdpbmRvdywgdG9wJDEgPSBfc2VsZiwgVUUgPSBfc2VsZi5VRTsKCiAgICB2YXIgU2VhcmNoUGFuZWwgPSB7CiAgICAgICAgZ2V0T3B0aW9uczogZnVuY3Rpb24gKCkgewogICAgICAgICAgICByZXR1cm4gb3B0aW9ucwogICAgICAgIH0sCiAgICAgICAgc2hvdzogZnVuY3Rpb24gKHdvcmQpIHsKICAgICAgICAgICAgb3B0aW9ucy5pbl9zZXR0aW5nID0gZmFsc2U7CiAgICAgICAgICAgIGFkZE1vZGFsMihjcmVhdGVGcmFtZUxvYWRpbmcoKSwgb3B0aW9ucy5hdXRvX2Nsb3NlID09PSB0cnVlKTsKICAgICAgICAgICAgc2VhcmNoV29yZCh3b3JkKS50aGVuKHJlcyA9PiB7CiAgICAgICAgICAgICAgICAKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwKICAgICAgICBzaG93V29yZFNlYXJjaCgpIHsKICAgICAgICAgICAgb3B0aW9ucy5hdXRvX2Nsb3NlID0gZmFsc2U7CiAgICAgICAgICAgIEdNX3NldFZhbHVlKCJkZWZhdWx0Q29uZmlnIiwgSlNPTi5zdHJpbmdpZnkob3B0aW9ucykpOwogICAgICAgICAgICAvLyBhZGRNb2RhbDIoImh0dHBzOi8vdi5tZXRvc3QuY29tLyIsIGZhbHNlLCBmYWxzZSk7CiAgICAgICAgICAgIHNlYXJjaFdvcmQoIiIpLnRoZW4ocmVzID0+IHsKICAgICAgICAgICAgICAgIC8vYWRkTW9kYWwyKHJlcywgZmFsc2UsIGZhbHNlKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwKICAgICAgICBzZXR0aW5nOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgIG9wdGlvbnMuaW5fc2V0dGluZyA9IHRydWU7CiAgICAgICAgICAgIGFkZE1vZGFsMihjcmVhdGVGcmFtZVNldHRpbmcoKSwgZmFsc2UpOwogICAgICAgIH0sCiAgICAgICAgaW5pdDogZnVuY3Rpb24gKCkgewogICAgICAgICAgICAvKioKICAgICAgICAgICAgICog6Kej6Zmk572R56uZ5aSN5Yi257KY6LS06ZmQ5Yi2CiAgICAgICAgICAgICAqLwogICAgICAgICAgICBpZiAob3B0aW9ucy5yZW1vdmVfbGltaXQpIHJlbGlldmVMaW1pdCgpOwoKICAgICAgICAgICAgLy/pobXpnaLlp4vnu4j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WYgKGVsZW0pIHsKICAgICAgICAgICAgZWxlbS5pbm5lckhUTUwgPSAnJzsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBlbGVtID0gZG9jLmNyZWF0ZUVsZW1lbnQodGFnTmFtZSk7CiAgICAgICAgICAgIGVsZW0uaWQgPSBlbGVtSWQ7CiAgICAgICAgICAgIGRvYy5ib2R5LmFwcGVuZENoaWxkKGVsZW0pOwogICAgICAgIH0KICAgICAgICBsZXQgY29udGVudE5vZGUgPSBjcmVhdGVDb250YWluZXIodGFnTmFtZSArICctY29udGFpbmVyJywgY2hpbGRFbGVtKTsKICAgICAgICBlbGVtLmFwcGVuZENoaWxkKGNvbnRlbnROb2RlKTsKICAgICAgICAvLyBjbGFzcyBJRCBzYW1lCiAgICAgICAgZWxlbS5jbGFzc0xpc3QuYWRkKGVsZW1JZCk7CiAgICAgICAgbGV0IFggPSBmYWxzZTsKICAgICAgICBsZXQgWSA9IGZhbHNlOwogICAgICAgIGlmICghbmV3UG9zKSB7CiAgICAgICAgICAgIFggPSBlbGVtLnN0eWxlLmxlZnQucmVwbGFjZSgncHgnLCAnJyk7CiAgICAgICAgICAgIGNvbnNvbGUubG9nKFgsICJYIik7CiAgICAgICAgICAgIFkgPSBlbGVtLnN0eWxlLnRvcC5yZXBsYWNlKCdweCcsICcnKTsKICAgICAgICB9CiAgICAgICAgaWYgKCFYKSB7CiAgICAgICAgICAgIGxldCBwb3MgPSBnZXRYWShlbGVtLm9mZnNldFdpZHRoLCBlbGVtLm9mZnNldEhlaWdodCk7CiAgICAgICAgICAgIFggPSBwb3MuWDsKICAgICAgICAgICAgWSA9IHBvcy5ZOwogICAgICAgICAgICAvLyDnm7jlr7nmlofmoaPlrprkvY3ml7bpnIDopoHlsIbmlofmoaPmu5rliqjot53nprvliqDkuIoKICAgICAgICAgICAgaWYgKCFpc0ZpeGVkKSB7CiAgICAgICAgICAgICAgICBZICs9IHdpbmRvdy5wYWdlWU9mZnNldDsKICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgZWxlbS5zdHlsZS5wb3NpdGlvbiA9IGlzRml4ZWQgPyAnZml4ZWQnIDogJ2Fic29sdXRlJzsKICAgICAgICBlbGVtLnN0eWxlLmxlZnQgPSBYICsgJ3B4JzsKICAgICAgICBlbGVtLnN0eWxlLnRvcCA9IFkgKyAncHgnOwogICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24gKCkgewogICAgICAgICAgICBlbGVtLmNsYXNzTGlzdC5hZGQoZWxlbUlkICsgJy1zaG93Jyk7CiAgICAgICAgfSwgMTApOwogICAgICAgIHJldHVybiBlbGVtOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldFhZKGVsZW1XaWR0aCwgZWxlbUhlaWdodCwgb2Zmc2V0WCA9IDMwLCBvZmZzZXRZID0gMzApIHsKICAgICAgICBsZXQgcG9zWSA9IG1vdXNlWSAtIGVsZW1IZWlnaHQgLSBvZmZzZXRZOwogICAgICAgIGlmIChwb3NZIDwgMCkgewogICAgICAgICAgICBwb3NZID0gbW91c2VZICsgb2Zmc2V0WTsKICAgICAgICB9CiAgICAgICAgbGV0IHBvc1ggPSBtb3VzZVggKyBvZmZzZXRYOwoKICAgICAgICBpZiAocG9zWCArIGVsZW1XaWR0aCA+IHdpbmRvdy5pbm5lcldpZHRoKSB7CiAgICAgICAgICAgIHBvc1ggPSBtb3VzZVggLSBlbGVtV2lkdGggLSBvZmZzZXRYOwogICAgICAgIH0KCiAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgWDogcG9zWCwKICAgICAgICAgICAgWTogcG9zWQogICAgICAgIH07CiAgICB9CgogICAgZnVuY3Rpb24gbW91c2VVcChlKSB7CiAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgIG1vdXNlVXBDYWxsYmFjayhlKTsKICAgICAgICB9LCAxKTsKICAgIH0KCgogICAgZnVuY3Rpb24gbW91c2VVcENhbGxiYWNrKGUpIHsKICAgICAgICBpZiAob3B0a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XBob25lPW5vIj4KICAgIDx0aXRsZT5NZVRvPC90aXRsZT4KICAgIDxzdHlsZT5gICsgR01fZ2V0UmVzb3VyY2VUZXh0KCd3ZXVpQ3NzJykgKyBgPC9zdHlsZT4KICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+CiAgICAgICAgYm9keSwgaHRtbCB7CiAgICAgICAgICAgIGhlaWdodDogMTAwJTsKICAgICAgICAgICAgcGFkZGluZzogMTBweDsKICAgICAgICAgICAgLXdlYmtpdC10YXAtaGlnaGxpZ2h0LWNvbG9yOiB0cmFuc3BhcmVudDsKICAgICAgICB9CiAgICAgICAgYm9keTo6LXdlYmtpdC1zY3JvbGxiYXIgewogICAgICAgICAgICBkaXNwbGF5OiBub25lOwogICAgICAgIH0KICAgICAgICAudGl0bGUgewogICAgICAgICAgICB0ZXh0LWFsaWduOiBjZW50ZXI7CiAgICAgICAgICAgIGZvbnQtc2l6ZTogMzJweDsKICAgICAgICAgICAgY29sb3I6ICMzY2M1MWY7CiAgICAgICAgICAgIGZvbnQtd2VpZ2h0OiA0MDA7CiAgICAgICAgICAgIG1hcmdpbjogMCAxNSU7CiAgICAgICAgfQogICAgICAgIC5oZWFkZXIgewogICAgICAgICAgICBwYWRkaW5nOiAzNXB4IDA7CiAgICAgICAgfQogICAgICAgIGVtIHsKICAgICAgICAgICAgZm9udC1zdHlsZTogbm9ybWFsOwogICAgICAgICAgICBjb2xvcjogIzNjYzUxZjsKICAgICAgICB9CiAgICA8L3N0eWxlPgo8L2hlYWQ+Cjxib2R5IG9udG91Y2hzdGFydD5gOwogICAgICAgIGh0bWwgKz0gYDwvYm9keT4KPHNjcmlwdD4gYCArIEdNX2dldFJlc291cmNlVGV4dCgnSlEzNjFKUycpICsgYCA8L3NjcmlwdD4KPHNjcmlwdD5gICsgR01fZ2V0UmVzb3VyY2VUZXh0KCdqcXVlcnl3ZXVpJykgKyBgPC9zY3JpcHQ+Cgo8c2NyaXB0IHR5cGU9InRleHQvamF2YXNj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ogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIC8vIG90aGVyd2lzZSwgbW92ZSB0aGUgRElWIGZyb20gYW55d2hlcmUgaW5zaWRlIHRoZSBESVY6CiAgICAgICAgICAgIGVsbW50Lm9ubW91c2Vkb3duID0gZHJhZ01vdXNlRG93bjsKICAgICAgICB9CgogICAgICAgIGZ1bmN0aW9uIGRyYWdNb3VzZURvd24oZSkgewogICAgICAgICAgICBlID0gZSB8fCB3aW5kb3cuZXZlbnQ7CiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTsKICAgICAgICAgICAgcGFyZW50Tm9kZSA9IHRvcCQxLmRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJoY1NlYXJjaGVNb2RhbCIpCiAgICAgICAgICAgIGxldCBlbEwgPXBhcmVudE5vZGUub2Zmc2V0TGVmdAogICAgICAgICAgICBsZXQgZWxUID1wYXJlbnROb2RlLm9mZnNldFRvcAogICAgICAgICAgICBtb3ZlWCA9IGUuY2xpZW50WCAtIGVsTAogICAgICAgICAgICBtb3ZlWSA9IGUuY2xpZW50WSAtIGVsVAogICAgICAgICAgICAvLyBnZXQgdGhlIG1vdXNlIGN1cnNvciBwb3NpdGlvbiBhdCBzdGFydHVwOgoKICAgICAgICAgICAgdG9wJDEuZG9jdW1lbnQub25tb3VzZXVwID0gY2xvc2VEcmFnRWxlbWVudDsKICAgICAgICAgICAgLy8gY2FsbCBhIGZ1bmN0aW9uIHdoZW5ldmVyIHRoZSBjdXJzb3IgbW92ZXM6CiAgICAgICAgICAgIHRvcCQxLmRvY3VtZW50Lm9ubW91c2Vtb3ZlID0gZWxlbWVudERyYWc7CiAgICAgICAgfQoKICAgICAgICBmdW5jdGlvbiBlbGVtZW50RHJhZyhlKSB7CiAgICAgICAgICAgIGUgPSBlIHx8IHdpbmRvdy5ldmVudDsKICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpOwogICAgICAgICAgICAvLyBjYWxjdWxhdGUgdGhlIG5ldy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cucGFyZW50LnBvc3RNZXNzYWdlKHsidHlwZSI6ICdhdXRvX2Nsb3NlJywiYXV0b19jbG9zZSI6dmFsfSwgJyonKTsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgYXV0b19zZWFyY2g6IGZ1bmN0aW9uICh2YWwpewogICAgICAgICAgICAgICAgY29uc29sZS5sb2codmFsKQogICAgICAgICAgICAgICAgd2luZG93LnBhcmVudC5wb3N0TWVzc2FnZSh7InR5cGUiOiAnYXV0b19zZWFyY2gnLCJhdXRvX3NlYXJjaCI6dmFsfSwgJyonKTsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgZml4ZWRfbW9kYWw6ZnVuY3Rpb24gKHZhbCl7CiAgICAgICAgICAgICAgICB3aW5kb3cucGFyZW50LnBvc3RNZXNzYWdlKHsidHlwZSI6ICdmaXhlZF9tb2RhbCcsImZpeGVkX21vZGFsIjp2YWx9LCAnKicpOwogICAgICAgICAgICB9LAogICAgICAgICAgICByZW1vdmVfbGltaXQ6ZnVuY3Rpb24gKHZhbCl7CiAgICAgICAgICAgICAgICB3aW5kb3cucGFyZW50LnBvc3RNZXNzYWdlKHsidHlwZSI6ICdyZW1vdmVfbGltaXQnLCJyZW1vdmVfbGltaXQiOnZhbH0sICcqJyk7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIG91dF9pZnJhbWU6ZnVuY3Rpb24gKHZhbCl7CiAgICAgICAgICAgICAgICB3aW5kb3cucGFyZW50LnBvc3RNZXNzYWdlKHsidHlwZSI6ICdvdXRfaWZyYW1lJywib3V0X2lmcmFtZSI6dmFsfSwgJyonKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgIH0pCjwvc2NyaXB0Pgo8L2h0bWw+CmA7CiAgICAgICAgcmV0dXJuIGh0bWw7CiAgICB9CgoKICAgIC8qKgogICAgICog6Kej6Zmk6ZmQ5Yi2CiAgICAgKi8KICAgIGZ1bmN0aW9uIHJlbGlldmVMaW1pdCgpIHsKICAgICAgICAKICAgICAgICBzdGFydCgpOwogICAgICAgIGlmIChsb2NhdGlvbi5ob3N0LmluZGV4T2YoJ2NoYW94aW5nJykgIT09IC0xKSB7CiAgICAgICAgICAgIHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICBfc2VsZi5VRURJVE9SX0NPTkZJRy5zY2FsZUVuYWJsZWQgPSBmYWxzZTsKICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICQuZWFjaChVRS5pbnN0YW50cywgZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICAgIHZhciBrZXkgPSB0aGlzLmtleTsKICAgICAgICAgICAgICAgICAgICB0aGlzLnJlYWR5KGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kZXN0cm95KCk7CiAgICAgICAgICAgICAgICAgICAgICAgIFVFLmdldEVkaXRvcihrZXkpOwogICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIH0sIDIwMDApOwogICAgICAgIH0KCiAgICAgICAgaWYgKCh3aW5kb3cubG9jYXRpb24uaHJlZi5pbmNsdWRlcygibmV3TW9vYz10cnVlIikgJiYgbG9jYXRpb24uaG9zdC5pbmRleE9mKCdjaGFveGluZycpICE9PSAtMSkgfHwgbG9jYXRpb24ucGF0aG5hbWUuaW5kZXhPZignZXhhbS90ZXN0L3JlVmVyc2lvblBhcGVyTWFya0NvbnRlbnROZXcnKSAhPT0gLTEpIHsKICAgICAgICAgICAgc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgJCgiYm9keSIpLnJlbW92ZUF0dHIoIm9uc2VsZWN0c3RhcnQiKTsKICAgICAgICAgICAgICAgICAgICAkKCJodG1sIikuY3NzKCJ1c2VyLXNlbGVjdCIsICJ1bnNldCIpOwogICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgIFVFLkV2ZW50QmFzZS5wcm90b3R5cGUuZmlyZUV2ZW50ID0gZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGwKICAgICAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7CgogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgMjAwMCk7CiAgICAgICAgfQogICAgfQogICAgYXN5bmMgZnVuY3Rpb24gc2VhcmNoV29yZChzZWxlY3Rpb25UZXh0KSB7CiAgICAgICAgLy9hZGRNb2RhbDIoci5yZXNwb25zZVRleHQsIGZhbHNlLCBmYWxzZSkKICAgICAgICBpZighc2VsZWN0aW9uVGV4dCl7CiAgICAgICAgICAgIHJldHVybiBhZGRNb2RhbDIoImh0dHBzOi8vdi5tZXRvc3QuY29tLyMvY2hhdCIsIGZhbHNlLCBmYWxzZSk7CiAgICAgICAgfQogICAgICAgIGxldCBtc2cgPSBvcHRpb25zLm1vZGVsW29wdGlvbnMubW9kZWwuc2VsZWN0XS5yZXBsYWNlKCJ7bXNnfSIsc2VsZWN0aW9uVGV4dCkKICAgICAgICBjb25zb2xlLmxvZyhtc2cpCiAgICAgICAgbGV0IG9iaiA9ewogICAgICAgICAgICAibWVzc2FnZXMiOiBbCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgInJvbGUiOiAidXNlciIsCiAgICAgICAgICAgICAgICAgICAgImNvbnRlbnQiOiBtc2csCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIF0sCiAgICAgICAgICAgICJzdHJlYW0iOiB0cnVlLAogICAgICAgICAgICAibW9kZWwiOiAiZ3B0LTMuNS10dXJibyIsCiAgICAgICAgICAgICJ0ZW1wZXJhdHVyZSI6IDAuNSwKICAgICAgICAgICAgInByZXNlbmNlX3BlbmFsdHkiOiAwLAogICAgICAgICAgICAiZnJlcXVlbmN5X3BlbmFsdHkiOiAwLAogICAgICAgICAgICAidG9wX3AiOiAxCiAgICAgICAgfTsKICAgICAgICByZXR1cm4gbmV3IFByb21pc2UocmVzb2x2ZSA9PiB7CiAgICAgICAgICAgIEdNX3htbGh0dHBSZXF1ZXN0KHsKICAgICAgICAgICAgICAgIHJlc3BvbnNlVHlwZToic3RyZWFtIiwKICAgICAgICAgICAgICAgIHRpbWVvdXQ6IDEwMDAwLAogICAgICAgICAgICAgICAgbWV0aG9kOiAicG9zdCIsCiAgICAgICAgICAgICAgICB1cmw6ICJodHRwczovL3YubWV0b3N0LmNvbS9hcGkvb3BlbmFpL3YxL2NoYXQvY29tcGxldGlvbnMiLAogICAgICAgICAgICAgICAgaGVhZGVyczp7CiAgICAgICAgICAgICAgICAgICAgLy8gQXV0aG9yaXphdGlvbjonQmVhcmVyIGFrLScrd2luZG93Lm15LmNvbmZpZy50a191aWQrIiwiK3dpbmRvdy5teS5jb25maWcucG9vbElkLAogICAgICAgICAgICAgICAgICAgIEF1dGhvcml6YXRpb246J0JlYXJlciBuay13YW5nemVxaW5nJywKICAgICAgICAgICAgICAgICAgICAvLyBDb29raWU6Im5leHQtYXV0aC5jc3JmLXRva2VuPWU4YjU1NTlmYWRiNWNlMzY4NGU5YTA2MTE1OTE2ODRmZmZmYzIyMjRkOTEyNWE0OWU3MDgxYTkyNDI1YzMwMjYlN0M0N2Q1NzU2MzhlM2ExNGY3ODc0NjJjMjdjMWZlODg5NWQ3NDAyMTAzNzA4NDgxODJhNzQwZmE3MWRmYjU1MjExOyBuZXh0LWF1dGguY2FsbGJhY2stdXJsPWh0dHAlM0ElMkYlMkZsb2NhbGhvc3QlM0EzMDAwOyBuZXh0LWF1dGguc2Vzc2lvbi10b2tlbj1leUpoYkdjaU9pSmthWElpTENKbGJtTWlPaUpCTWpVMlIwTk5JbjAuLndORmtFUDFYSXRjRENwWTIubkpCYzRydnU4X2NBR3gwbXREZG0ycHZJalBBV0dNR291MjRMMlp6b3lJbXJDSXFMRGlBTVM1dzZXek42ZG1fOEd1STMzMXRmcXhIY19WNExSb0FtbUZUMEE4WDVsbjlDMWlDNHA0N0lRTV80UkYyQi04aUxHRWxDa1ZPWUppZUNrdlYxbFZyRkhWVDMxbnpJMTJuOFhwd3R0cnc1eUdoeXdDUjNzV1oxSjdzcjRRQ1hlQ0EtbHBPZElURHlXOEFkTlBqSDRRUTd2aHRDSXpqekZvZXBtSktrNW1FMmxQbWtzRGlHclFYM2QxUE9Qd2ZRcWRIYWZiOHJnWkpsX0JDNF93RFhsb0l0Nm10VGZRNC5fTlBTTkhRSWhzV1M1ZVFwckNJZUNRIiwKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICBkYXRhOiBKU09OLnN0cmluZ2lmeShvYmopLAogICAgICAgICAgICAgICAgb25sb2Fkc3RhcnQ6IGZ1bmN0aW9uKHJlc3BvbnNlKSB7CiAgICAgICAgICAgICAgICAgICAgbGV0IGFuZXIgPSBhZGRNb2RhbDIoIuasoui/jlxuIiwgZmFsc2UsIGZhbHNlLHRydWUpOwogICAgICAgICAgICAgICAgICAgIC8vIGFucy5hcHBlbmQoIjEyMyIpCiAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVhZGVyID0gcmVzcG9uc2UucmVzcG9uc2UuZ2V0UmVhZGVyKCk7CiAgICAgICAgICAgICAgICAgICAgdmFyIGVycm9yX2QgPSAiIjsKICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiByZWFkKCkgewogICAgICAgICAgICAgICAgICAgICAgICByZWFkZXIucmVhZCgpLnRoZW4oKHsgZG9uZSwgdmFsdWUgfSkgPT4gewogICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkb25lKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn6K+75Y+W5a6M5q+VJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRhID0gbmV3IFRleHREZWNvZGVyKCkuZGVjb2RlKHZhbHVlKQogICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEuc3BsaXQoImRhdGE6IikuZm9yRWFjaChkPT57CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihkIT0iIiYmZC5pbmRleE9mKCJbRE9ORV0iKSA9PSAtMSl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IEpzb25fbXNnPW51bGwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGVycm9yX2QpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IGVycm9yX2QgK2Q7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcnJvcl9kPSIiOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEpzb25fbXNnID0gJC5wYXJzZUpTT04oZCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoSnNvbl9tc2cubXNnPT0iZW1wdHkgYWNjZXNzIGNvZGUifHxKc29uX21zZy5tc2c9PSJ3cm9uZyBhY2Nlc3MgY29kZSIpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5lci5hcHBlbmQoIuiLpemcgOimgeS9v+eUqEFJ5Yqf6IO96K+35YWIIik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbmV3RGl2ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnYnV0dG9uJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdEaXYuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLCBmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cub3BlbignaHR0cHM6Ly92Lm1ldG9zdC5jb20vIy9hY3RpdmF0ZScsICdNZXRv55m76ZmGJywgJ3dpZHRoPTQwMCxoZWlnaHQ9NjAwJykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3RGl2LnRleHRDb250ZW50ID0gIueZu+mZhiIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZXIuYXBwZW5kQ2hpbGQobmV3RGl2KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoSnNvbl9tc2cubXNnPT0i5Ymp5L2ZdG9rZW7kuI3otrPor7db5YWF5YC8XShodHRwczovL2QubWV0b3N0LmNvbS8pIil7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmVyLmFwcGVuZCgi5oKo55qEQUnliankvZlUT0tFTuW3suS4jei2s+ivtyIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG5ld0RpdiA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2J1dHRvbicpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3RGl2LmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJywgZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93Lm9wZW4oJ2h0dHBzOi8vZC5tZXRvc3QuY29tLycsICdNZXRv55m76ZmGJykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3RGl2LnRleHRDb250ZW50ID0gIuWFheWAvFRva2VuIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5lci5hcHBlbmRDaGlsZChuZXdEaXYpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZXIuYXBwZW5kKEpzb25fbXNnLmNob2ljZXNbMF0uZGVsdGEuY29udGVudHx8IiIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhbmVyLnNjcm9sbFRvcChhbmVyLnByb3AoInNjcm9sbEhlaWdodCIpKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Y2F0Y2ggKGUpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihKc29uX21zZyl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmVyLmFwcGVuZCgi5Y+R55Sf5byC5bi4OiIgKyBkKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygi5Y+R55Sf5byC5bi4OiIgKyBkKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yX2Q9ZDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICAgICAgICAgLy8gICBjb25zb2xlLmxvZygkLnBhcnNlSlNPTihkYXRhKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgLy8g57un57ut6K+75Y+W5LiL5LiA5Liq5pWw5o2u5Z2XCiAgICAgICAgICAgICAgICAgICAgICAgICAgcmVhZCgpOwogICAgICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAvLyDlvIDlp4vor7vlj5bmlbDmja4KICAgICAgICAgICAgICAgICAgICAgIHJlYWQoKTsKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICBvbmVycm9yIDogZnVuY3Rpb24oZXJyKXsKICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygnZXJyb3InKQogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgIG9udGltZW91dCA6IGZ1bmN0aW9uKGluZil7CiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+ivt+axgui2heaXticpCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pCiAgICAgICAgICAgIAogICAgICAgICAgICAvLyBHTV94bWxodHRwUmVxdWVzdCh7CiAgICAgICAgICAgIC8vICAgICBtZXRob2Q6ICJHRVQiLAogICAgICAgICAgICAvLyAgICAgLy91cmw6ICJodHRwczovL2FwcC5pdGloZXkuY29tL3BjU2VydmljZS9hcGkvcXVlcnlBbnN3ZXI/d29yZD0iICsgZW5jb2RlVVJJQ29tcG9uZW50KHNlbGVjdGlvblRleHQgfHwgd2luZG93LmdldFNlbGVjdGlvbigpLnRvU3RyaW5nKCkudHJpbSgpKSwKICAgICAgICAgICAgLy8gICAgIHVybDoiaHR0cHM6Ly92Lm1ldG9zdC5jb20vIy9hY3RpdmF0ZSIsCiAgICAgICAgICAgIC8vICAgICBoZWFkZXJzOiB7CiAgICAgICAgICAgIC8vICAgICAgICAgImFjY2Vzcy10b2tlbiI6IGdldFRva2VuKCksCiAgICAgICAgICAgIC8vICAgICAgICAgIlZlcnNpb24iOiBHTV9pbmZvLnNjcmlwdC52ZXJzaW9uCiAgICAgICAgICAgIC8vICAgICB9LAogICAgICAgICAgICAvLyAgICAgb25sb2FkOiBmdW5jdGlvbiAocikgewogICAgICAgICAgICAvLyAgICAgICAgIGNvbnNvbGUubG9nKHIucmVzcG9uc2VUZXh0KTsKICAgICAgICAgICAgLy8gICAgICAgICByZXNvbHZlKCByLnJlc3BvbnNlVGV4dCk7CiAgICAgICAgICAgIC8vICAgICB9CiAgICAgICAgICAgIC8vIH0pOwogICAgICAgIH0pCiAgICB9CgogICAgLyoqCiAgICAgKiDlrZfnrKbkuLLmqKHmnb/moLzlvI/ljJYKICAgICAqIEBwYXJhbSB7c3RyaW5nfSBmb3JtYXRTdHIgLSDlrZfnrKbkuLLmqKHmnb8KICAgICAqIEByZXR1cm5zIHtzdHJpbmd9IOagvOW8j+WMluWQjueahOWtl+espuS4sgogICAgICogQGV4YW1wbGUKICAgICAqIFN0cmluZ0Zvcm1hdCgiYWJ7MH1jezF9ZWQiLDEsInEiKSAgb3V0cHV0ICJhYjFjcWVkIgogICAgICovCgoKICAgIGZ1bmN0aW9uIFN0cmluZ0Zvcm1hdChmb3JtYXRTdHIpIHsKICAgICAgICB2YXIgYXJncyA9IGFyZ3VtZW50czsKICAgICAgICByZXR1cm4gZm9ybWF0U3RyLnJlcGxhY2UoL1x7KFxkKylcfS9nLCBmdW5jdGlvbiAobSwgaSkgewogICAgICAgICAgICBpID0gcGFyc2VJbnQoaSk7CiAgICAgICAgICAgIHJldHVybiBhcmdzW2kgKyAxXTsKICAgICAgICB9KTsKICAgIH0KCiAgICAvKioKICAgICAqIOaXpeacn+agvOW8j+WMlgogICAgICogQHBhcmFtIHtEYXRlfSBkYXRlIC0g5pel5pyfCiAgICAgKiBAcGFyYW0ge3N0cmluZ30gZm9ybWF0U3RyIC0g5qC85byP5YyW5qih5p2/CiAgICAgKiBAcmV0dXJucyB7c3RyaW5nfSDmoLzlvI/ljJbml6XmnJ/lkI7nmoTlrZfnrKbkuLIKICAgICAqIEBleGFtcGxlCiAgICAgKiBEYXRlRm9ybWF0KG5ldyBEYXRlKCksInl5eXktTU0tZGQiKSAgb3V0cHV0ICIyMDIwLTAzLTIzIgogICAgICogQGV4YW1wbGUKICAgICAqIERhdGVGb3JtYXQobmV3IERhdGUoKSwieXl5eS9NTS9kZCBoaDptbTpzcyIpICBvdXRwdXQgIjIwMjAvMDMvMjMgMTA6MzA6MDUiCiAgICAgKi8KICAgIGZ1bmN0aW9uIERhdGVGb3JtYXQoZGF0ZSwgZm9ybWF0U3RyKSB7CiAgICAgICAgdmFyIG8gPSB7CiAgICAgICAgICAgICJNKyI6IGRhdGUuZ2V0TW9udGgoKSArIDEsIC8v5pyI5Lu9CiAgICAgICAgICAgICJkKyI6IGRhdGUuZ2V0RGF0ZSgpLCAvL+aXpQogICAgICAgICAgICAiaCsiOiBkYXRlLmdldEhvdXJzKCksIC8v5bCP5pe2CiAgICAgICAgICAgICJtKyI6IGRhdGUuZ2V0TWludXRlcygpLCAvL+WIhgogICAgICAgICAgICAicysiOiBkYXRlLmdldFNlY29uZHMoKSwgLy/np5IKICAgICAgICAgICAgInErIjogTWF0aC5mbG9vcigoZGF0ZS5nZXRNb250aCgpICsgMykgLyAzKSwgLy/lraPluqYKICAgICAgICAgICAgIlMiOiBkYXRlLmdldE1pbGxpc2Vjb25kcygpIC8v5q+r56eSCiAgICAgICAgfTsKICAgICAgICBpZiAoLyh5KykvLnRlc3QoZm9ybWF0U3RyKSkgewogICAgICAgICAgICBmb3JtYXRTdHIgPSBmb3JtYXRTdHIucmVwbGFjZShSZWdFeHAuJDEsIChkYXRlLmdldEZ1bGxZZWFyKCkgKyAiIikuc3Vic3RyKDQgLSBSZWdFeHAuJDEubGVuZ3RoKSk7CiAgICAgICAgfQogICAgICAgIGZvciAodmFyIGsgaW4gbykgewogICAgICAgICAgICBpZiAobmV3IFJlZ0V4cCgiKCIgKyBrICsgIikiKS50ZXN0KGZvcm1hdFN0cikpIHsKICAgICAgICAgICAgICAgIGZvcm1hdFN0ciA9IGZvcm1hdFN0ci5yZXBsYWNlKAogICAgICAgICAgICAgICAgICAgIFJlZ0V4cC4kMSwgKFJlZ0V4cC4kMS5sZW5ndGggPT0gMSkgPyAob1trXSkgOiAoKCIwMCIgKyBvW2tdKS5zdWJzdHIoKCIiICsgb1trXSkubGVuZ3RoKSkpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHJldHVybiBmb3JtYXRTdHI7CiAgICB9CgogICAgLyoqCiAgICAgKiDmuIXpmaRkb23lhYPntKDpu5jorqTkuovku7YKICAgICAqIEBwYXJhbSB7b2JqZWN0fSBlIC0gZG9t5YWD57SgCiAgICAgKi8KICAgIGZ1bmN0aW9uIENsZWFyQnViYmxlKGUpIHsKICAgICAgICBpZiAoZS5zdG9wUHJvcGFnYXRpb24pIHsKICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBlLmNhbmNlbEJ1YmJsZSA9IHRydWU7CiAgICAgICAgfQogICAgICAgIGlmIChlLnByZXZlbnREZWZhdWx0KSB7CiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBlLnJldHVyblZhbHVlID0gZmFsc2U7CiAgICAgICAgfQogICAgfQoKICAgIC8qKgogICAgICog5a+75om+5pyA5aSW5bGCZG9jCiAgICAgKiBAcGFyYW0gX3NlbGYKICAgICAqIEBwYXJhbSB0b3AKICAgICAqIEByZXR1cm5zIHsqfHN0cmluZ3xib29sZWFufG51bWJlcnxzdHJpbmd8V2luZG93fQogICAgICovCiAgICBmdW5jdGlvbiBzZWFyY2hPdXREb2N1bWVudChfc2VsZiwgdG9wKSB7CiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgd2hpbGUgKHRvcCAhPT0gX3NlbGYudG9wKSB7CiAgICAgICAgICAgICAgICB0b3AgPSB0b3AucGFyZW50LmRvY3VtZW50ID8gdG9wLnBhcmVudCA6IF9zZWxmLnRvcDsKICAgICAgICAgICAgICAgIGlmICh0b3AubG9jYXRpb24ucGF0aG5hbWUgPT09ICcvbXljb3Vyc2Uvc3R1ZGVudHN0dWR5JykgYnJlYWs7CiAgICAgICAgICAgIH0KICAgICAgICB9IGNhdGNoIChlcnIpIHsKICAgICAgICAgICAgdG9wID0gX3NlbGY7CiAgICAgICAgfQogICAgICAgIHJldHVybiB0b3A7CiAgICB9CgogICAgLy/pnaLmnb8KICAgIHZhciBQYW5lbD17CiAgICAgICAgcG9wQm94RWw6e30sCiAgICAgICAgcmFuZG9tQ29kZToiIiwKICAgICAgICBDcmVhdGU6ZnVuY3Rpb24odGl0bGUscGxhY2VtZW50LGlzU2hvd0Fycm93LGNvbnRlbnQsc2hvd25Gbil7CiAgICAgICAgICAgIHZhciBzZWxmPXRoaXM7CiAgICAgICAgICAgICQoc2VsZi5wb3BCb3hFbCkualBvcEJveCh7CiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsCiAgICAgICAgICAgICAgICBjbGFzc05hbWU6ICdKUG9wQm94LXRpcC13aGl0ZScsCiAgICAgICAgICAgICAgICBwbGFjZW1lbnQ6IHBsYWNlbWVudCwKICAgICAgICAgICAgICAgIHRyaWdnZXI6ICdub25lJywKICAgICAgICAgICAgICAgIGlzVGlwSG92ZXI6IHRydWUsCiAgICAgICAgICAgICAgICBpc1Nob3dBcnJvdzogaXNTaG93QXJyb3csCiAgICAgICAgICAgICAgICBjb250ZW50OiBmdW5jdGlvbigpewogICAgICAgICAgICAgICAgICAgIHJldHVybiBTdHJpbmdGb3JtYXQoJzxkaXYgaWQ9InBhbmVsQm9keXswfSI+ezF9PC9kaXY+JyxzZWxmLnJhbmRvbUNvZGUsY29udGVudCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pOwogICAgICAgICAgICAkKHNlbGYucG9wQm94RWwpLm9uKCJzaG93bi5qUG9wQm94IixmdW5jdGlvbigpewogICAgICAgICA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GNTZWFyY2hlTW9kYWwuaGNTZWFyY2hlTW9kYWwgewogICAgICAgICAgICAgICAgYWxsOiBpbml0aWFsOwogICAgICAgICAgICAgICAgcG9zaXRpb246IGFic29sdXRlOwogICAgICAgICAgICAgICAgei1pbmRleDogMjE0NzQ4MzY0NzsKICAgICAgICAgICAgICAgIGRpc3BsYXk6IGJsb2NrOwogICAgICAgICAgICAgICAgZm9udC1zaXplOiAxNHB4OwogICAgICAgICAgICAgICAgY29sb3I6ICMzMzMzMzM7CiAgICAgICAgICAgICAgICBsaW5lLWhlaWdodDogMjZweDsKICAgICAgICAgICAgICAgIHRyYW5zZm9ybTogc2NhbGUoMC45KTsKICAgICAgICAgICAgICAgIG9wYWNpdHk6IDA7CiAgICAgICAgICAgICAgICB0cmFuc2l0aW9uOiB0cmFuc2Zvcm0gMC4xcyBlYXNlLW91dCwgb3BhY2l0eSAwLjFzIGVhc2Utb3V0OwogICAgICAgICAgICB9CgogICAgICAgICAgICAjaGNTZWFyY2hlUG9wb3Zlci5oY1NlYXJjaGVQb3BvdmVyLXNob3csCiAgICAgICAgICAgICNoY1NlYXJjaGVNb2RhbC5oY1NlYXJjaGVNb2RhbC1zaG93IHsKICAgICAgICAgICAgICAgIHRyYW5zZm9ybTogc2NhbGUoMSk7CiAgICAgICAgICAgICAgICBvcGFjaXR5OiAxOwogICAgICAgICAgICB9CgogICAgICAgICAgICAjaGNTZWFyY2hlTW9kYWwgI2hjU2VhcmNoZU1vZGFsQ29udGVudCB7CiAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kOiAjZjZmOGZhOwogICAgICAgICAgICAgICAgYm9yZGVyOiAxcHggc29saWQgI2QxZDVkYTsKICAgICAgICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDEwcHg7CiAgICAgICAgICAgICAgICBjb2xvcjogIzU4NjA2OTsKICAgICAgICAgICAgICAgIGRpc3BsYXk6IGJsb2NrOwogICAgICAgICAgICAgICAgYm94LXNoYWRvdzogMCAxNnB4IDEwMHB4IDAgcmdiYSgwLCAwLCAwLCAwLjIpOwogICAgICAgICAgICB9CgogICAgICAgICAgICAjaGNTZWFyY2hlTW9kYWwgI2hjU2VhcmNoZU1vZGFsQm9keSB7CiAgICAgICAgICAgICAgICBtYXJnaW4tbGVmdDogYXV0bzsKICAgICAgICAgICAgICAgIG1hcmdpbi1yaWdodDogYXV0bzsKICAgICAgICAgICAgICAgIHBvc2l0aW9uOiByZWxhdGl2ZTsKICAgICAgICAgICAgICAgIHdpZHRoOiAzOTBweDsKICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICNmZmY7CiAgICAgICAgICAgICAgICBib3JkZXI6IDFweCBzb2xpZCAjZDFkNWRhOwogICAgICAgICAgICAgICAgYm9yZGVyLXdpZHRoOiAxcHggMDsKICAgICAgICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDNweDsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgI2hjU2VhcmNoZU1vZGFsICNoY1NlYXJjaGVJZnJhbWUgewogICAgICAgICAgICAgICAgb3ZlcmZsb3c6IGhpZGRlbjsKICAgICAgICAgICAgICAgIG1hcmdpbjogMDsKICAgICAgICAgICAgICAgIHBhZGRpbmc6IDA7CiAgICAgICAgICAgICAgICBoZWlnaHQgOjU1MHB4OwogICAgICAgICAgICAgICAgbWF4LWhlaWdodDogNTUwcHg7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgI2hjU2VhcmNoZU1vZGFsICNoY0NoYXR7CiAgICAgICAgICAgICAgICBvdmVyZmxvdzphdXRvOwogICAgICAgICAgICAgICAgbWFyZ2luOiA1cHg7CiAgICAgICAgICAgICAgICBwYWRkaW5nOiAwOwogICAgICAgICAgICAgICAgbWF4LWhlaWdodDogMzUwcHg7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgICNoY1NlYXJjaGVNb2RhbCAjaGNTZWFyY2hlTW9kYWxIZWFkZXIgewogICAgICAgICAgICAgICAgY3Vyc29yOiBtb3ZlOwogICAgICAgICAgICAgICAgZm9udC1zaXplOiAxM3B4OwogICAgICAgICAgICAgICAgbGluZS1oZWlnaHQ6IDI0cHg7CiAgICAgICAgICAgICAgICBwYWRkaW5nOiAxcHggNHB4OwogICAgICAgICAgICAgICAgY29sb3I6ICM1ODYwNjk7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgICNoY1NlYXJjaGVNb2RhbCAjaGNTZWFyY2hlTW9kYWxIZWFkZXI6OmFmdGVyIHsKICAgICAgICAgICAgICAgIGRpc3BsYXk6IGJsb2NrOwogICAgICAgICAgICAgICAgY2xlYXI6IGJvdGg7CiAgICAgICAgICAgICAgICBjb250ZW50OiAiIjsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgI2hjU2VhcmNoZU1vZGFsICNoY1NlYXJjaGVNb2RhbEZvb3RlciB7CiAgICAgICAgICAgICAgICBtaW4taGVpZ2h0OiAxMHB4OwogICAgICAgICAgICAgICAgY3Vyc29yOiBtb3ZlOwogICAgICAgICAgICAgICAgcG9zaXRpb246IHJlbGF0aXZlOwogICAgICAgICAgICAgICAgZGlzcGxheTogZmxleDsKICAgICAgICAgICAgICAgIGp1c3RpZnktY29udGVudDogY2VudGVyOwogICAgICAgICAgICB9CgogICAgICAgICAgICAjaGNTZWFyY2hlTW9kYWwgI2hjU2VhcmNoZU1vZGFsTGlua3MgewogICAgICAgICAgICAgICAgZmxvYXQ6IHJpZ2h0CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgICNoY1NlYXJjaGVNb2RhbCAjaGNTZWFyY2hlTW9kYWxMaW5rcyBoY3NlYXJjaGUtbGluayB7CiAgICAgICAgICAgICAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7CiAgICAgICAgICAgICAgICBjb2xvcjogIzI0MjkyZTsKICAgICAgICAgICAgICAgIG1hcmdpbjogMCAwIDAgNnB4OwogICAgICAgICAgICAgICAgZm9udC1zaXplOiAxM3B4OwogICAgICAgICAgICAgICAgZm9udC13ZWlnaHQ6IG5vcm1hbDsKICAgICAgICAgICAgICAgIHRleHQtZGVjb3JhdGlvbjogbm9uZTsKICAgICAgICAgICAgICAgIGN1cnNvcjogcG9pbnRlcjsKICAgICAgICAgICAgICAgIHBhZGRpbmc6IDAgMC41ZW07CiAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzOiAwOwogICAgICAgICAgICB9CgogICAgICAgICAgICAjaGNTZWFyY2hlTW9kYWwgI2hjU2VhcmNoZU1vZGFsTGlua3MgaGNzZWFyY2hlLWxpbmtbZGF0YS1zZWN1cnJlbnQ9dHJ1ZV0sCiAgICAgICAgICAgICNoY1NlYXJjaGVNb2RhbCAjaGNTZWFyY2hlTW9kYWxMaW5rcyBoY3NlYXJjaGUtbGluazpob3ZlciB7CiAgICAgICAgICAgICAgICAvLyBiYWNrZ3JvdW5kOiByZ2JhKDI3LCAzMSwgMzUsIC4wNCk7CiAgICAgICAgICAgICAgICBjb2xvcjogIzQ0NGQ1NjsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgI2hjU2VhcmNoZU1vZGFsICNoY1NlYXJjaGVNb2RhbExpbmtzIGhjc2VhcmNoZS1saW5rPnN2ZyB7CiAgICAgICAgICAgICAgICB2ZXJ0aWNhbC1hbGlnbjogc3ViOwogICAgICAgICAgICAgICAgcGFkZGluZy1sZWZ0OiA0cHg7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgICNoY1NlYXJjaGVNb2RhbCAjaGNTZWFyY2hlTW9kYWxMaW5rcyAjaGNTZWFyY2hlQ2xvc2U6aG92ZXIgewogICAgICAgICAgICAgICAgYmFja2dyb3VuZDogcmdiYSgwLCAwLCAwLCAwLjA1KTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgI2hjU2VhcmNoZU1vZGFsICNoY1NlYXJjaGVNb2RhbExvY2sgewogICAgICAgICAgICAgICAgY3Vyc29yOiBwb2ludGVyOwogICAgICAgICAgICAgICAgZmxvYXQ6IGxlZnQ7CiAgICAgICAgICAgICAgICBkaXNwbGF5OiBibG9jazsKICAgICAgICA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d09pOHZkM2QzTG5jekxtOXlaeTh5TURBd0wzTjJaeUlnWm1sc2JDMXlkV3hsUFNKbGRtVnViMlJrSWlCamJHbHdMWEoxYkdVOUltVjJaVzV2WkdRaVBqeHdZWFJvSUdROUlrMDJJRFpqTUMwekxqTXhNU0F5TGpZNE9TMDJJRFl0Tm5NMklESXVOamc0SURZZ05uWTBhRE4yTVRSb0xURTRkaTB4TkdnemRpMDBlbTB4TkNBMWFDMHhObll4TW1neE5uWXRNVEo2YlMweE15MDFkalJvTVRCMkxUUmpNQzB5TGpjMkxUSXVNalF0TlMwMUxUVnpMVFVnTWk0eU5DMDFJRFY2SWk4K1BDOXpkbWMrKQogICAgICAgICAgICB9CgogICAgICAgICAgICAjaGNTZWFyY2hlTW9kYWwgI2hjU2VhcmNoZU5leHRMaW5rIHsKICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICAgICAgICAgICAgICAgIHRvcDogLTQwcHg7CiAgICAgICAgICAgICAgICByaWdodDogMjhweDsKICAgICAgICAgICAgICAgIGRpc3BsYXk6IGJsb2NrOwogICAgICAgICAgICAgICAgd2lkdGg6IDMycHg7CiAgICAgICAgICAgICAgICBoZWlnaHQ6IDMycHg7CiAgICAgICAgICAgICAgICBjb2xvcjogIzZjNzU3ZDsKICAgICAgICAgICAgICAgIGN1cnNvcjogcG9pbnRlcjsKICAgICAgICAgICAgICAgIGJhY2tncm91bmQtc2l6ZTogMTZweDsKICAgICAgICAgICAgICAgIGJhY2tncm91bmQtcG9zaXRpb246IGNlbnRlcjsKICAgICAgICAgICAgICAgIGJhY2tncm91bmQtcmVwZWF0OiBuby1yZXBlYXQ7CiAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjZjZmOGZhOwogICAgICAgICAgICAgICAgYmFja2dyb3VuZC1pbWFnZTogdXJsKGRhdGE6aW1hZ2UvcG5nO2Jhc2U2NCxpVkJPUncwS0dnb0FBQUFOU1VoRVVnQUFBQkFBQUFBU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R0RBMEF4U2p6VWxRZzNaOHYvLy8yME1EQXhNakl5TUZ1ZzI0M1FCVENJL1A5K0dnWUZoQndNRHcrZmZ2MzhiSWpzYk9Wbmp6UXZGeGNVMlRFeE16N3U3dSsrU2xSZndaVFM0Ri9MejgvY3hNakk2RXFNWWk1cDFBSmJ0Z3c3Zmp5b01BQUFBQUVsRlRrU3VRbUNDKTsKICAgICAgICAgICAgICAgIGNvbG9yOiAjNDQ0ZDU2OwogICAgICAgICAgICB9CgogICAgICAgICAgICAjaGNTZWFyY2hlTW9kYWwgI2hjU2VhcmNoZU5leHRMaW5rLmhjU2VhcmNoZU5leHRMaW5rTG9hZGluZyB7CiAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjZTllY2VmOwogICAgICAgICAgICAgICAgYmFja2dyb3VuZC1pbWFnZTogbm9uZTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgI2hjU2VhcmNoZU1vZGFsICNoY1NlYXJjaGVOZXh0TGluay5oY1NlYXJjaGVOZXh0TGlua0xvYWRpbmc6YWZ0ZXIgewogICAgICAgICAgICAgICAgY29udGVudDogIiAiOwogICAgICAgICAgICAgICAgZGlzcGxheTogYmxvY2s7CiAgICAgICAgICAgICAgICB3aWR0aDogMTJweDsKICAgICAgICAgICAgICAgIGhlaWdodDogMTJweDsKICAgICAgICAgICAgICAgIG1hcmdpbjogOXB4IDAgMCA5cHg7CiAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzOiA1MCU7CiAgICAgICAgICAgICAgICBib3JkZXI6IDFweCBzb2xpZCAjMjQyOTJlOwogICAgICAgICAgICAgICAgYm9yZGVyLWNvbG9yOiAjMjQyOTJlIHRyYW5zcGFyZW50ICMyNDI5MmUgdHJhbnNwYXJlbnQ7CiAgICAgICAgICAgICAgICBhbmltYXRpb246IGhjU2VhcmNoZU5leHRMaW5rTG9hZGluZyAxLjJzIGxpbmVhciBpbmZpbml0ZTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgQGtleWZyYW1lcyBoY1NlYXJjaGVOZXh0TGlua0xvYWRpbmcgewogICAgICAgICAgICAgICAgMCUgewogICAgICAgICAgICAgICAgICAgIHRyYW5zZm9ybTogcm90YXRlKDBkZWcpOwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIDUwJSB7CiAgICAgICAgICAgICAgICAgICAgdHJhbnNmb3JtOiByb3RhdGUoMTgwZGVnKTsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAxMDAlIHsKICAgICAgICAgICAgICAgICAgICB0cmFuc2Zvcm06IHJvdGF0ZSg3MjBkZWcpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CgogICAgICAgICAgICAuSlBvcEJveC10aXAtd2hpdGUgewogICAgICAgICAgICAgICAgei1pbmRleDogMTA2MDsKICAgICAgICAgICAgICAgIG1pbi13aWR0aDogNTBweDsKICAgICAgICAgICAgICAgIG1heC13aWR0aDogMzAwcHg7CiAgICAgICAgICAgICAgICBwYWRkaW5nOiAxcHg7CiAgICAgICAgICAgICAgICBmb250LWZhbWlseTogIkhlbHZldGljYSBOZXVlIiwgSGVsdmV0aWNhLCBBcmlhbCwgc2Fucy1zZXJpZjsKICAgICAgICAgICAgICAgIGZvbnQtc2l6ZTogMTRweDsKICAgICAgICAgICAgICAgIGZvbnQtc3R5bGU6IG5vcm1hbDsKICAgICAgICAgICAgICAgIGZvbnQtd2VpZ2h0OiA0MDA7CiAgICAgICAgICAgICAgICBjb2xvcjogIzMzMzsKICAgICAgICAgICAgICAgIGxpbmUtaGVpZ2h0OiAxLjQyODU3MTQzOwogICAgICAgICAgICAgICAgdGV4dC1hbGlnbjogbGVmdDsKICAgICAgICAgICAgICAgIHRleHQtYWxpZ246IHN0YXJ0OwogICAgICAgICAgICAgICAgdGV4dC1kZWNvcmF0aW9uOiBub25lOwogICAgICAgICAgICAgICAgdGV4dC1zaGFkb3c6IG5vbmU7CiAgICAgICAgICAgICAgICB0ZXh0LXRyYW5zZm9ybTogbm9uZTsKICAgICAgICAgICAgICAgIGxldHRlci1zcGFjaW5nOiBub3JtYWw7CiAgICAgICAgICAgICAgICB3b3JkLWJyZWFrOiBub3JtYWw7CiAgICAgICAgICAgICAgICB3b3JkLXNwYWNpbmc6IG5vcm1hbDsKICAgICAgICAgICAgICAgIHdvcmQtd3JhcDogbm9ybWFsOwogICAgICAgICAgICAgICAgd2hpdGUtc3BhY2U6IG5vcm1hbDsKICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICNmZmY7CiAgICAgICAgICAgICAgICAtd2Via2l0LWJhY2tncm91bmQtY2xpcDogcGFkZGluZy1ib3g7CiAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNsaXA6IHBhZGRpbmctYm94OwogICAgICAgICAgICAgICAgYm9yZGVyOiAxcHggc29saWQgI2NjYzsKICAgICAgICAgICAgICAgIGJvcmRlcjogMXB4IHNvbGlkIHJnYmEoMCwgMCwgMCwgLjIpOwogICAgICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogNnB4OwogICAgICAgICAgICAgICAgLXdlYmtpdC1ib3gtc2hhZG93OiAwIDVweCAxMHB4IHJnYmEoMCwgMCwgMCwgLjIpOwogICAgICAgICAgICAgICAgYm94LXNoYWRvdzogMCA1cHggMTBweCByZ2JhKDAsIDAsIDAsIC4yKTsKICAgICAgICAgICAgICAgIGxpbmUtYnJlYWs6IGF1dG8KICAgICAgICAgICAgfQoKICAgICAgICAgICAgLkpQb3BCb3gtdGlwLXdoaXRlIC5KUG9wQm94LXRpcC10aXRsZSB7CiAgICAgICAgICAgICAgICBwYWRkaW5nOiA4cHggMTRweDsKICAgICAgICAgICAgICAgIG1hcmdpbjogMDsKICAgICAgICAgICAgICAgIGZvbnQtc2l6ZTogMTRweDsKICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICNmN2Y3Zjc7CiAgICAgICAgICAgICAgICBib3JkZXItYm90dG9tOiAxcHggc29saWQgI2ViZWJlYjsKICAgICAgICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDVweCA1cHggMCAwOwogICAgICAgICAgICAgICAgZm9udC13ZWlnaHQ6IDUwMDsKICAgICAgICAgICAgICAgIGxpbmUtaGVpZ2h0OiAxLjE7CiAgICAgICAgICAgICAgICBjb2xvcjogaW5oZXJpdAogICAgICAgICAgICB9CgogICAgICAgICAgICAuSlBvcEJveC10aXAtd2hpdGUgLkpQb3BCb3gtdGlwLWNvbnRlbnQgewogICAgICAgICAgICAgICAgcGFkZGluZzogOXB4IDE0cHgKICAgICAgICAgICAgfQoKICAgICAgICAgICAgLkpQb3BCb3gtdGlwLXdoaXRlIC5KUG9wQm94LXRpcC1hcnJvdywKICAgICAgICAgICAgLkpQb3BCb3gtdGlwLXdoaXRlIC5KUG9wQm94LXRpcC1hcnJvdzphZnRlciB7CiAgICAgICAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgICAgICAgICAgICAgICBkaXNwbGF5OiBibG9jazsKICAgICAgICAgICAgICAgIHdpZHRoOiAwOwogICAgICAgICAgICAgICAgaGVpZ2h0OiAwOwogICAgICAgICAgICAgICAgYm9yZGVyLWNvbG9yOiB0cmFuc3BhcmVudDsKICAgICAgICAgICAgICAgIGJvcmRlci1zdHlsZTogc29saWQ7CiAgICAgICAgICAgICAgICBib3JkZXItd2lkdGg6IDEwcHg7CiAgICAgICAgICAgICAgICBjb250ZW50OiAiIgogICAgICAgICAgICB9CgogICAgICAgICAgICAuSlBvcEJveC10aXAtd2hpdGUgLkpQb3BCb3gtdGlwLWFycm93LkpQb3BCb3gtdGlwLWFycm93LXRvcCB7CiAgICAgICAgICAgICAgICBsZWZ0OiA1MCU7CiAgICAgICAgICAgICAgICBtYXJnaW4tbGVmdDogLTExcHg7CiAgICAgICAgICAgICAgICBib3JkZXItYm90dG9tLXdpZHRoOiAwOwogICAgICAgICAgICAgICAgYm9yZGVyLXRvcC1jb2xvcjogcmdiYSgwLCAwLCAwLCAuMjUpOwogICAgICAgICAgICAgICAgYm90dG9tOiAtMTFweAogICAgICAgICAgICB9CgogICAgICAgICAgICAuSlBvcEJveC10aXAtd2hpdGUgLkpQb3BCb3gtdGlwLWFycm93LkpQb3BCb3gtdGlwLWFycm93LXRvcDphZnRlciB7CiAgICAgICAgICAgICAgICBjb250ZW50OiAiICI7CiAgICAgICAgICAgICAgICBib3R0b206IDFweDsKICAgICAgICAgICAgICAgIG1hcmdpbi1sZWZ0OiAtMTBweDsKICAgICAgICAgICAgICAgIGJvcmRlci1ib3R0b20td2lkdGg6IDA7CiAgICAgICAgICAgICAgICBib3JkZXItdG9wLWNvbG9yOiAjZmZmCiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIC5KUG9wQm94LXRpcC13aGl0ZSAuSlBvcEJveC10aXAtYXJyb3cuSlBvcEJveC10aXAtYXJyb3ctcmlnaHQgewogICAgICAgICAgICAgICAgdG9wOiA1MCU7CiAgICAgICAgICAgICAgICBsZWZ0OiAtMTFweDsKICAgICAgICAgICAgICAgIG1hcmdpbi10b3A6IC0xMXB4OwogICAgICAgICAgICAgICAgYm9yZGVyLWxlZnQtd2lkdGg6IDA7CiAgICAgICAgICAgICAgICBib3JkZXItcmlnaHQtY29sb3I6IHJnYmEoMCwgMCwgMCwgLjI1KQogICAgICAgICAgICB9CgogICAgICAgICAgICAuSlBvcEJveC10aXAtd2hpdGUgLkpQb3BCb3gtdGlwLWFycm93LkpQb3BCb3gtdGlwLWFycm93LXJpZ2h0OmFmdGVyIHsKICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICIgIjsKICAgICAgICAgICAgICAgIGxlZnQ6IDFweDsKICAgICAgICAgICAgICAgIGJvdHRvbTogLTEwcHg7CiAgICAgICAgICAgICAgICBib3JkZXItbGVmdC13aWR0aDogMDsKICAgICAgICAgICAgICAgIGJvcmRlci1yaWdodC1jb2xvcjogI2ZmZgogICAgICAgICAgICB9CgogICAgICAgICAgICAuSlBvcEJveC10aXAtd2hpdGUgLkpQb3BCb3gtdGlwLWFycm93LkpQb3BCb3gtdGlwLWFycm93LWJvdHRvbSB7CiAgICAgICAgICAgICAgICBsZWZ0OiA1MCU7CiAgICAgICAgICAgICAgICBtYXJnaW4tbGVmdDogLTExcHg7CiAgICAgICAgICAgICAgICBib3JkZXItdG9wLXdpZHRoOiAwOwogICAgICAgICAgICAgICAgYm9yZGVyLWJvdHRvbS1jb2xvcjogcmdiYSgwLCAwLCAwLCAuMjUpOwogICAgICAgICAgICAgICAgdG9wOiAtMTFweAogICAgICAgICAgICB9CgogICAgICAgICAgICAuSlBvcEJveC10aXAtd2hpdGUgLkpQb3BCb3gtdGlwLWFycm93LkpQb3BCb3gtdGlwLWFycm93LWJvdHRvbTphZnRlciB7CiAgICAgICAgICAgICAgICBjb250ZW50OiAiICI7CiAgICAgICAgICAgICAgICB0b3A6IDFweDsKICAgICAgICAgICAgICAgIG1hcmdpbi1sZWZ0OiAtMTBweDsKICAgICAgICAgICAgICAgIGJvcmRlci10b3Atd2lkdGg6IDA7CiAgICAgICAgICAgICAgICBib3JkZXItYm90dG9tLWNvbG9yOiAjZmZmCiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIC5KUG9wQm94LXRpcC13aGl0ZSAuSlBvcEJveC10aXAtYXJyb3cuSlBvcEJveC10aXAtYXJyb3ctbGVmdCB7CiAgICAgICAgICAgICAgICB0b3A6IDUwJTsKICAgICAgICAgICAgICAgIHJpZ2h0OiAtMTFweDsKICAgICAgICAgICAgICAgIG1hcmdpbi10b3A6IC0xMXB4OwogICAgICAgICAgICAgICAgYm9yZGVyLXJpZ2h0LXdpZHRoOiAwOwogICAgICAgICAgICAgICAgYm9yZGVyLWxlZnQtY29sb3I6IHJnYmEoMCwgMCwgMCwgLjI1KQogICAgICAgICAgICB9CgogICAgICAgICAgICAuSlBvcEJveC10aXAtd2hpdGUgLkpQb3BCb3gtdGlwLWFycm93LkpQb3BCb3gtdGlwLWFycm93LWxlZnQ6YWZ0ZXIgewogICAgICAgICAgICAgICAgY29udGVudDogIiAiOwogICAgICAgICAgICAgICAgcmlnaHQ6IDFweDsKICAgICAgICAgICAgICAgIGJvcmRlci1yaWdodC13aWR0aDogMDsKICAgICAgICAgICAgICAgIGJvcmRlci1sZWZ0LWNvbG9yOiAjZmZmOwogICAgICAgICAgICAgICAgYm90dG9tOiAtMTBweAogICAgICAgICAgICB9CgogICAgICAgICAgICAuSlBvcEJveC10aXAtd2hpdGUgewogICAgICAgICAgICAgICAgd2lkdGg6IDQ4MnB4OwogICAgICAgICAgICAgICAgbWF4LXdpZHRoOiA1NTBweDsKICAgICAgICAgICAgICAgIG1pbi13aWR0aDogNDUwcHg7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYAogICAgICAgICAgICBHTV9hZGRTdHlsZShjc3MpOwoKICAgICAgICAgICAgdmFyIHM9IiI7CiAgICAgICAgICAgIHMrPVN0cmluZ0Zvcm1hdCgiLndvcmRUcmFuc3swfXtib3gtc2l6aW5nOiBjb250ZW50LWJveDtjdXJzb3I6IHBvaW50ZXI7ei1pbmRleDogMjE0NzQ4MzY0Nztib3JkZXItd2lkdGg6IDBweDtib3JkZXItc3R5bGU6IHNvbGlkO2JvcmRlci1pbWFnZTogaW5pdGlhbDtib3JkZXItcmFkaXVzOiA1cHg7cGFkZGluZzogMC41cHg7cG9zaXRpb246IGFic29sdXRlO2Rpc3BsYXk6IG5vbmV9IixyYW5kb21Db2RlKTsKICAgICAgICAgICAgcys9U3RyaW5nRm9ybWF0KCIud29yZFRyYW5zSWNvbnswfXtiYWNrZ3JvdW5kLWltYWdlOiB1cmwoezF9KTtiYWNrZ3JvdW5kLXNpemU6IDQwcHg7aGVpZ2h0OiA0MHB4O3dpZHRoOiA0MHB4O30iLHJhbmRvbUNvZGUsdHJhbnNJY29uQmFzZTY0KTsKICAgICAgICAgICAgcys9UGFuZWwuQ3JlYXRlU3R5bGUoKTsKICAgICAgICAgICAgR01fYWRkU3R5bGUocyk7CiAgICAgICAgfTsKICAgICAgICB2YXIgU2hvd1dvcmRUcmFuc0ljb249ZnVuY3Rpb24oKXsKICAgICAgICAgICAgdmFyICR3b3JkVHJhbnNJY29uPSQoImRpdiMiK3JhbmRvbVN0cmluZytyYW5kb21Db2RlKTsKICAgICAgICAgICAgdmFyIGlzU2VsZWN0PWZhbHNlOwogICAgICAgICAgICB2YXIgaXNQYW5lbD1mYWxzZTsKICAgICAgICAgICAgdmFyIGlzV29yZFRyYW5zSWNvbj1mYWxzZTsKICAgICAgICAgICAgJGRvYy5vbih7CiAgICAgICAgICAgICAgICAic2VsZWN0aW9uY2hhbmdlIjpmdW5jdGlvbihlKXsKICAgICAgICAgICAgICAgICAgICBpc1NlbGVjdD10cnVlOwogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICJtb3VzZWRvd24iOmZ1bmN0aW9uKGUpewogICAgICAgICAgICAgICAgICAgIHZhciAkdGFyZ2V0RWw9JChlLnRhcmdldCk7CiAgICAgICAgICAgICAgICAgICAgaXNQYW5lbD0kdGFyZ2V0RWwucGFyZW50cygpLmlzKCJkaXYuSlBvcEJveC10aXAtd2hpdGUiKTsKICAgICAgICAgICAgICAgICAgICBpc1dvcmRUcmFuc0ljb249JHRhcmdldEVsLnBhcmVudHMoKS5pcyhTdHJpbmdGb3JtYXQoImRpdiMiK3JhbmRvbVN0cmluZysiezB9IixyYW5kb21Db2RlKSk7CiAgICAgICAgICAgICAgICAgICAgLy/ngrnlh7vliJLor43lm77moIflpJbln5/lkozliJLor43pnaLmnb/lpJbln5/ml7bvvIzpmpDol4/lm77moIflkozliJLor43pnaLmnb8KICAgICAgICAgICAgICAgICAgICBpZighaXNXb3JkVHJhbnNJY29uICYmICFpc1BhbmVsKXsKICAgICAgICAgICAgICAgICAgICAgICAgJHdvcmRUcmFuc0ljb24uaGlkZSgpOwogICAgICAgICAgICAgICAgICAgICAgICBQYW5lbC5EZXN0cm95KCk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAvL+eCueWHu+WIkuivjeWbvuagh++8jOWPlua2iOm8oOagh+m7mOiupOS6i+S7tu+8jOmYsuatoumAieS4reeahOaWh+acrOa2iOWksQogICAgICAgICAgICAgICAgICAgICAgICBpZihpc1dvcmRUcmFuc0ljb24pewogICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2xlYXJCdWJibGUoZSk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgIm1vdXNldXAiOmZ1bmN0aW9uKGUpewogICAgICAgICAgICAgICAgICAgIHZhciBzZWxlY3RUZXh0ID0gd2luZG93LmdldFNlbGVjdGlvbigpLnRvU3RyaW5nKCkudHJpbSgpOwogICAgICAgICAgICAgICAgICAgIGlmKCFpc1BhbmVsJiZpc1NlbGVjdCYmc2VsZWN0VGV4dCl7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghU2VhcmNoUGFuZWwuZ2V0T3B0aW9ucygpLmF1dG9fc2VhcmNoKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICR3b3JkVHJhbnNJY29uLnNob3coKS5jc3MoewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQ6IGUucGFnZVggKyAncHgnLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvcCA6IGUucGFnZVkgKyAxMiArICdweCcKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL+mAieS4reeahOaWh+acrOWGheWuuQogICAgICAgICAgICAgICAgICAgICAgICAgICAgU2VhcmNoUGFuZWwuc2hvdyhzZWxlY3RUZXh0KTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBpc1NlbGVjdD1mYWxzZTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pOwogICAgICAgICAgICAkd29yZFRyYW5zSWNvbi5jbGljayhmdW5jdGlvbihlKXsvLyBHZXRTZXR0aW5nT3B0aW9ucygpOwogICAgICAgICAgICAgICAgLy/lpoLmnpzkuI3mmK/oh6rliqjmkJzntKLnmoQg6K+d77yM5bCx5pi+56S65Ye65p2l5pCc57Si5oyJ6ZKu77yM54S25ZCO6K6p55So5oi354K55Ye7CiAgICAgICAgICAgICAgICBpZiAoIVNlYXJjaFBhbmVsLmdldE9wdGlvbnMoKS5hdXRvX3NlYXJjaCl7CiAgICAgICAgICAgICAgICAgICAgdmFyIHNlbGVjdFRleHQgPSB3aW5kb3cuZ2V0U2VsZWN0aW9uKCkudG9TdHJpbmcoKS50cmltKCk7CiAgICAgICAgICAgICAgICAgICAgUGFuZWwuRGVzdHJveSgpOwogICAgICAgICAgICAgICAgICAgIFNlYXJjaFBhbmVsLnNob3coc2VsZWN0VGV4dCk7CiAgICAgICAgICAgICAgICAgICAgJHdvcmRUcmFuc0ljb24uaGlkZSgpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKICAgICAgICB9OwogICAgICAgIC8vIHZhciBndWlkPSIiOwogICAgICAgIHZhciBSZWdNZW51PWZ1bmN0aW9uKCl7CiAgICAgICAgICAgIEdNX3JlZ2lzdGVyTWVudUNvbW1hbmQoIuaWh+acrOaQnOmimCIsZnVuY3Rpb24oKXsKICAgICAgICAgICAgICAgU2VhcmNoUGFuZWwuc2hvd1dvcmRTZWFyY2goKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIEdNX3JlZ2lzdGVyTWVudUNvbW1hbmQoIuiuvue9riIsZnVuY3Rpb24oKXsKICAgICAgICAgICAgICAgIFNlYXJjaFBhbmVsLnNldHRpbmcoKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfTsKICAgICAgICB0aGlzLmluaXQ9ZnVuY3Rpb24oKXsKICAgICAgICAgICAgcmFuZG9tQ29kZT1EYXRlRm9ybWF0KG5ldyBEYXRlKCksInl5TU0iKS50b1N0cmluZygpKyhNYXRoLmZsb29yKE1hdGgucmFuZG9tKCkgKiAoOTk5OTk5IC0gMTAwMDAwICsgMSkgKSArIDEwMDAwMCkudG9TdHJpbmcoKTsKICAgICAgICAgICAgY3JlYXRlU3R5bGUoKTsKICAgICAgICAgICAgY3JlYXRlSHRtbCgpOwogICAgICAgICAgICBTaG93V29yZFRyYW5zSWNvbigpOwogICAgICAgICAgICBTZWFyY2hQYW5lbC5pbml0KCk7CiAgICAgICAgICAgIFJlZ01lbnUoKTsKICAgICAgICB9OwogICAgfTsKCiAgICB2YXIgaGNTZWFyY2g9bmV3IEhjU2VhcmNoKCk7CiAgICBoY1NlYXJjaC5pbml0KCk7CgogICAgCn0pKCk=
Add Comment
Please, Sign In to add comment