xiaomianao666

插件名:global_海角社区

Jan 14th, 2024
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:网页插件¥js_url¥global_海角社区@base64://Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICDmtbfop5LnpL7ljLoKLy8gQG5hbWVzcGFjZSAgICBodHRwOi8vdGFtcGVybW9ua2V5Lm5ldC8KLy8gQHZlcnNpb24gICAgICA1LjEKLy8gQGRlc2NyaXB0aW9uICDnm67liY3lj6/ku6XnlKjvvIzlj6/ku6Xmn6XnnIvph5HluIHpkrvnn7Pop4bpopEs6ZyA6KaB5omL5Yqo5rOo5YaM55m75b2VCi8vIEBhdXRob3IgICAgICAgeGlndWEwMDEyCi8vIEBsaWNlbnNlICAgICAgTUlUCi8vIEBtYXRjaCAgICAgICBodHRwczovL3Rvb2xzLnRoYXR3aW5kLmNvbS90b29sKgovLyBAbWF0Y2ggICAgICAgIGh0dHBzOi8vKi9wb3N0L2RldGFpbHMqCi8vIEBpY29uICAgICAgICAgaHR0cHM6Ly9oamJjMzAudG9wL2ltYWdlcy9jb21tb24vcHJvamVjdC9mYXZpY29uLmljbwovLyBAcnVuLWF0ICAgICAgZG9jdW1lbnQtc3RhcnQKLy8gQGdyYW50ICAgICAgIHVuc2FmZVdpbmRvdwovLyBAZ3JhbnQgICAgICAgIEdNX2Rvd25sb2FkCi8vIEBncmFudCAgICAgICAgR01fb3BlbkluVGFiCi8vIEBncmFudCAgICAgICAgR01feG1saHR0cFJlcXVlc3QKLy8gQGNvbm5lY3QgICAgICAqCi8vIEByZXF1aXJlICAgICAgaHR0cHM6Ly9jZG4uc3RhdGljZmlsZS5vcmcvanF1ZXJ5LzEuMTAuMi9qcXVlcnkubWluLmpzCi8vIEBkb3dubG9hZFVSTCBodHRwczovL3VwZGF0ZS5zbGVhenlmb3JrLm9yZy9zY3JpcHRzLzQ4Mzk3Mi8lRTYlQjUlQjclRTglQTclOTIlRT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iAgICAgICAgY3JhY2tCdG4ub25lKCJjbGljayIsIGNyYWNrKTsKICAgICAgICAkKCJib2R5IikuYXBwZW5kKGNvbnRhaW5lcik7CiAgICAgIH0sIGNyYWNrID0gZnVuY3Rpb24oKSB7CiAgICAgICAgY3JhY2tCdG4uaHRtbCgi6Kej5p6Q5oiQ5YqfIik7CiAgICAgICAgY29uc3QgZW5jb2RlVXJsMiA9IGBodHRwczovL20zdThwbGF5LmNvbS8/cGxheT0ke2VuY29kZVVSSUNvbXBvbmVudCgKICAgICAgICB1cmwKICAgICAgKX1gOwogICAgICAgIGNvbnN0IGVuY29kZVVybDEgPSBgaHR0cHM6Ly9tLmF1b2sucnVuL3BsYXllci8jJHt1cmx9YDsKICAgICAgICBjb25zdCBzZWxsQ29udGFpbmVyMiA9IGdldFNlbGxlckNvbnRhaW5lcigpOwogICAgICAgIGp1bXBMaW5rMS5hdHRyKCJocmVmIiwgZW5jb2RlVXJsMSk7CiAgICAgICAganVtcExpbmsyLmF0dHIoImhyZWYiLCBlbmNvZGVVcmwyKTsKICAgICAgICBpZiAoc2VsbENvbnRhaW5lcjIpIHsKICAgICAgICAgIHNlbGxDb250YWluZXIyLmlubmVySFRNTCA9ICIiOwogICAgICAgICAgaWYgKGlzTW9iaWxlKCkpIHsKICAgICAgICAgICAgY29uc3QgJGlmcmFtZSA9ICQoCiAgICAgICAgICAgICAgYDxpZnJhbWUgc3JjPSIke2VuY29kZVVybDF9IiBhbGxvd2Z1bGxzY3JlZW49J3RydWUnPjwvaWZyYW1lPmAKICAgICAgICAgICAgKS5jc3MoewogICAgICAgICAgICAgIHdpZHRoOiAiMTAwJSIKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICQoc2VsbENvbnRhaW5lcjIpLmFwcGVuZCgkaWZyYW1lKTsKICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIG5ldyBEUGxheWVyKHsKICAgICAgICAgICAgICBjb250YWluZXI6IHNlbGxDb250YWluZXIyLAogICAgICAgICAgICAgIGF1dG9wbGF5OiBmYWxzZSwKICAgICAgICAgICAgICB0aGVtZTogIiNGQURGQTMiLAogICAgICAgICAgICAgIGxvb3A6IHRydWUsCiAgICAgICAgICAgICAgbGFuZzogInpoIiwKICAgICAgICAgICAgICBzY3JlZW5zaG90OiB0cnVlLAogICAgICAgICAgICAgIGhvdGtleTogdHJ1ZSwKICAgICAgICAgICAgICBwcmVsb2FkOiAiYXV0byIsCiAgICAgICAgICAgICAgdmlkZW86IHsKICAgICAgICAgICAgICAgIHVybCwKICAgICAgICAgICAgICAgIHR5cGU6ICJobHMiCiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgY29weUJ0bi5vbigiY2xpY2siLCAoKSA9PiB7CiAgICAgICAgICBfR01fc2V0Q2xpcGJvYXJkKHVybCwgInRleHQvcGxhaW4iKTsKICAgICAgICB9KTsKICAgICAgICBqdW1wTGluazEuc2hvdygpOwogICAgICAgIGp1bXBMaW5rMi5zaG93KCk7CiAgICAgICAgY29weUJ0bi5zaG93KCkuZmluZCgiaW1nIikuYXR0cigic3JjIiwgc3JjKTsKICAgICAgICByZXR1cm47CiAgICAgIH0sIHRyYWNrID0gZnVuY3Rpb24oKSB7CiAgICAgICAgaW5pdCgpOwogICAgICAgIGNyYWNrKCk7CiAgICAgIH07CiAgICAgIGxldCBjcmFja0J0bjsKICAgICAgbGV0IGp1bXBMaW5rMTsKICAgICAgbGV0IGp1bXBMaW5rMjsKICAgICAgbGV0IGNvcHlCdG47CiAgICAgIGxldCBjb250YWluZXI7CiAgICAgIGNvbnN0IHNlbGxDb250YWluZXIgPSBnZXRTZWxsZXJDb250YWluZXIoKTsKICAgICAgaWYgKHNlbGxDb250YWluZXIpIHsKICAgICAgICB0cmFjaygpOwogICAgICAgIHJldHVybjsKICAgICAgfQogICAgICBzZXRUaW1lb3V0KCgpID0+IHsKICAgICAgICB0cmFjaygpOwogICAgICB9LCAyZTMpOwogICAgfSBjYXRjaCAoZXJyb3IpIHsKICAgIH0KICB9CmZ1bmN0aW9uIHB3ZCgpIHsKICAgIGxldCB3b3JkID0gJycKICAgIGxldCBhID0gJzQ4LzQ2LzExNi8xMTUnCiAgICBsZXQgYiA9IGEuc3BsaXQoJy8nKQogICAgZm9yIChsZXQgYyBpbiBiKSB7CiAgICAgICAgbGV0IGQgPSBwYXJzZUludChiW2NdKQogICAgICAgIGxldCBlID0gU3RyaW5nLmZyb21DaGFyQ29kZShkKQogICAgICAgIHdvcmQgPSB3b3JkICsgZQogICAgfQogICAgcmV0dXJuIHdvcmQKfQoKZnVuY3Rpb24gY2xlYXJDb250YWluZXIoY29udGFpbmVyKSB7CiAgICBpZiAoY29udGFpbmVyLmhhc0NoaWxkTm9kZXMoKSkgewogICAgICAgIGNvbnRhaW5lci5pbm5lckhUTUwgPSAiIjsKICAgICAgICBjb250YWluZXIuc3R5bGUuYm9yZGVyID0gIiI7CiAgICB9Cn0KZnVuY3Rpb24gZ2V0Q29udGFpbmVyKCkgewogICAgY29uc3QgZXhpc3RDb250YWluZXIgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIuYmlnLWltZy1jb250YWluZXItYyIpOwogICAgaWYgKCFleGlzdENvbnRhaW5lcikgewogICAgICAgIGNvbnN0IGNvbnRhaW5lciA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoImRpdiIpOwogICAgICAgIGNvbnRhaW5lci5jbGFzc05hbWUgPSAiYmlnLWltZy1jb250YWluZXItYyI7CiAgICAgICAgY29udGFpbmVyLnN0eWxlLnBvc2l0aW9uID0gImZpeGVkIjsKICAgICAgICBjb250YWluZXIuc3R5bGUudG9wID0gMDsKICAgICAgICBjb250YWluZXIuc3R5bGUubGVmdCA9IDA7CiAgICAgICAgY29udGFpbmVyLnN0eWxlLnpJbmRleCA9IDk5OTk5OTsKICAgICAgICBjb250YWluZXIub25jbGljayA9IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgY2xlYXJDb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sKICAgICAgICAvL2FsZXJ0KCLkvaDngrnlh7vkuoZESVbvvIEiKTsgLy8g5b2T54K55Ye76K+lZGl25pe25Lya6Kem5Y+R5q2k5Ye95pWw5bm25pi+56S65o+Q56S65L+h5oGvCiAgICAgICAgdmFyIGN1cnJlbnRVcmwgPSB3aW5kb3cubG9jYXRpb24uaHJlZjsKICAgICAgICAvLyDovpPlh7rlvZPliY3nvZHlnYAKCiAgICAgICAgbGV0IHVybCA9ICJodHRwczovL3Rvb2xzLnRoYXR3aW5kLmNvbS90b29sL20zdThkb3dubG9hZGVyI20zdTg9IgogICAgICAgIGxldCB1cmwyID0gIiZyZWZlcmVyPSIgKyBjdXJyZW50VXJsICsgIiZmaWxlbmFtZT0lRTYlQjUlQjclRTglQTclOTIlRTclQTQlQkUlRTUlOEMlQkEiCiAgICAgICAgbGV0IHVybDMgPSB1cmwgKyBuZXd1cmwgKyB1cmwyCiAgICAgICAgR01fb3BlbkluVGFiKHVybDMsIHsgYWN0aXZlOiB0cnVlIH0pOwogICAgICAgIGNvbnNvbGUubG9nKHVybDMpOwogICAgICAgIC8vd2luZG93LmxvY2F0aW9uLmhyZWYgPSB1cmw7CiAgICAgICAgLy93aW5kb3cub3Blbih1cmwsICJfYmxhbmsiKTsKCgogICAgfSk7CgoKCgogICAgdmFyIG15RGl2ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoIm15RGl2Iik7IC8vIOiOt+WPluWIsGlk5Li6Im15RGl2IueahGRpduWFg+e0oAogICAgbXlEaXYuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLCBmdW5jdGlvbiAoZSkgewogICAgICAgIC8vYWxlcnQoIuS9oOeCueWHu+S6hkRJVu+8gSIpOyAvLyDlvZPngrnlh7vor6VkaXbml7bkvJrop6blj5HmraTlh73mlbDlubbmmL7npLrmj5DnpLrkv6Hmga8KICAgICAgICBjb25zdCBjb250YWluZXIgPSBnZXRDb250YWluZXIoKTsKICAgICAgICBjb25zdCBoYWxmV2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2V0RWxlbWVudHNCeUNsYXNzTmFtZSgnYmlnLWltZy1jb250YWluZXItYycpWzBdOwogICAgICAgIGJvZHlFbGVtZW50LmFwcGVuZENoaWxkKGltZyk7CgoKICAgIH0pOwogICAgZnVuY3Rpb24gZGVjb2RlKHMpIHsKICAgICAgICByZXR1cm4gYXRvYihhdG9iKGF0b2IocykpKTsKICAgIH0KCiAgICBmdW5jdGlvbiBlbmNvZGUocykgewogICAgICAgIHJldHVybiBidG9hKGJ0b2EoYnRvYShzKSkpOwogICAgfQoKICAgIGZ1bmN0aW9uIGplbmNvZGUocykgewogICAgICAgIHJldHVybiBlbmNvZGUoSlNPTi5zdHJpbmdpZnkocywgYHV0Zi04YCkpOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldF9yZWFsX20zdThfcGF0aCh1cmwpIHsKICAgICAgICB2YXIgcmVxdWVzdCA9IG5ldyBYTUxIdHRwUmVxdWVzdCgpOwogICAgICAgIHJlcXVlc3Qub3BlbignR0VUJywgdXJsLCBmYWxzZSk7CiAgICAgICAgcmVxdWVzdC5zZW5kKG51bGwpOwogICAgICAgIGlmIChyZXF1ZXN0LnN0YXR1cyAhPT0gMjAwKSB7CiAgICAgICAgICAgIGNvbnNvbGUubG9nKGDop6PmnpDlpLHotKUhYCk7CiAgICAgICAgICAgIHJldHVybiB1cmw7CiAgICAgICAgfQogICAgICAgIGxldCB0c19wYXRoID0gcmVxdWVzdC5yZXNwb25zZVRleHQuc3BsaXQoJ1xuJylbNl07CiAgICAgICAgbGV0IGlkID0gdHNfcGF0aC5tYXRjaCgvKFtcd19dK18/KVtcZF0rLnRzLylbMV07CiAgICAgICAgbGV0IHJ1cmwgPSB1cmwucmVwbGFjZSgvKFtcd19dKykubTN1OC8sIGAke2lkfS5tM3U4YCk7CiAgICAgICAgcmV0dXJuIHJ1cmw7CiAgICB9CiAgICBmdW5jdGlvbiBydW5Bc3luYyh1cmwsIHNlbmRfdHlwZSwgZGF0YV9yeSkgewogICAgICAgIGNvbnNvbGUubG9nKCLor7fmsYLlvIDlp4siKTsKICAgICAgICB2YXIgcCA9IG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHsKICAgICAgICAgICAgR01feG1saHR0cFJlcXVlc3QoewogICAgICAgICAgICAgICAgbWV0aG9kOiBzZW5kX3R5cGUsCiAgICAgICAgICAgICAgICB1cmw6IHVybCwKICAgICAgICAgICAgICAgIGhlYWRlcnM6IHsKICAgICAgICAgICAgICAgICAgICAiQ29udGVudC1UeXBlIjogImFwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZDtjaGFyc2V0PXV0Zi04IgogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgIGRhdGE6IGRhdGFfcnksCiAgICAgICAgICAgICAgICBvbmxvYWQ6IGZ1bmN0aW9uIChyZXNwb25zZSkgewogICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCLor7fmsYLmiJDlip8iKTsKICAgICAgICAgICAgICAgICAgICAvL2NvbnNvbGUubG9nKHJlc3BvbnNlLnJlc3BvbnNlVGV4dCk7CiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShyZXNwb25zZS5yZXNwb25zZVRleHQpOwogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgIG9uZXJyb3I6IGZ1bmN0aW9uIChyZXNwb25zZSkgewogICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCLor7fmsYLlpLHotKUiKTsKICAgICAgICAgICAgICAgICAgICByZWplY3QoIuivt+axguWksei0pSIpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKICAgICAgICB9KQogICAgICAgIHJldHVybiBwOwogICAgfQogICAgZnVuY3Rpb24gZ2V0X3VzZXJfZGljdChob3N0LCBpZCkgewogICAgICAgIHZhciB1cmwgPSBgaHR0cHM6Ly8ke2hvc3R9LmNvbS9hcGkvdG9waWMvbm9kZS90b3BpY3M/cGFnZT0xJnVzZXJJZD0ke2lkfSZ0eXBlPTBgOwogICAgICAgIHZhciByZXF1ZXN0ID0gbmV3IFhNTEh0dHBSZXF1ZXN0KCk7CiAgICAgICAgcmVxdWVzdC5vcGVuKCdHRVQnLCB1cmwsIGZhbHNlKTsKICAgICAgICByZXF1ZXN0LnNlbmQobnVsbCk7CiAgICAgICAgaWYgKHJlcXVlc3Quc3RhdHVzICE9PSAyMDApIHsKICAgICAgICAgICAgY29uc29sZS5sb2coYOeUqOaIt+S/oeaBr+ino+aekOWksei0pSFgKTsKICAgICAgICAgICAgcmV0dXJuIHt9OwogICAgICAgIH0KICAgICAgICBsZXQgcCA9IEpTT04ucGFyc2UocmVxdWVzdC5yZXNwb25zZVRleHQsIGB1dGYtOGApLmRhdGE7CiAgICAgICAgcCA9IEpTT04ucGFyc2UoZGVjb2RlKHApLCBgdXRmLThgKTsKICAgICAgICBsZXQgdG90YWwgPSBwLnBhZ2UudG90YWw7CiAgICAgICAgbGV0IHVpZCA9IGBbYmFubmVkXWA7CiAgICAgICAgaWYgKGByZXN1bHRzYCBpbiBwKSB7CiAgICAgICAgICAgIHVpZCA9IHAucmVzdWx0c1swXS51c2VyLm5pY2tuYW1lICsgYCBgICsgdWlkOwogICAgICAgIH0KICAgICAgICByZXR1cm4gewogICAgICAgICAgICAnaXNGYXZvcml0ZSc6IGZhbHNlLAogICAgICAgICAgICAnbGlrZUNvdW50JzogMTIsCiAgICAgICAgICAgICd1c2VyJzogewogICAgICAgICAgICAgICAgJ2lkJzogcGFyc2VJbnQoaWQpLAogICAgICAgICAgICAgICAgJ25pY2tuYW1lJzogdWlkLAogICAgICAgICAgICAgICAgJ2F2YXRhcic6ICcyOScsCiAgICAgICAgICAgICAgICAnZGVzY3JpcHRpb24nOiBgaGogY29tbXVuaXR5YCwKICAgICAgICAgICAgICAgICd0b3BpY0NvdW50JzogdG90YWwsCiAgICAgICAgICAgICAgICAndmlkZW9Db3VudCc6IDAsCiAgICAgICAgICAgICAgICAnY29tbWVudENvdW50JzogMzAzLAogICAgICAgICAgICAgICAgJ2ZhbnNDb3VudCc6IDU3LAogICAgICAgICAgICAgICAgJ2Zhdm9yaXRlQ291bnQnOiAzOSwKICAgICAgICAgICAgICAgICdzdGF0dXMnOiAwLAogICAgICAgICAgICAgICAgJ3NleCc6IDEsCiAgICAgICAgICAgICAgICAndmlwJzogMCwKICAgICAgICAgICAgICAgICd2aXBFeHBpcmVzVGltZSc6ICcwMDAxLTAxLTAxIDAwOjAwOjAwJywKICAgICAgICAgICAgICAgICdjZXJ0aWZpZWQnOiBmYWxzZSwKICAgICAgICAgICAgICAgICdjZXJ0VmlkZW8nOiBmYWxzZSwKICAgICAgICAgICAgICAgICdjZXJ0UHJvZmVzc29yJzogZmFsc2UsCiAgICAgICAgICAgICAgICAnZmFtb3VzJzogZmFsc2UsCiAgICAgICAgICAgICAgICAnZm9yYmlkZGVuJzogZmFsc2UsCiAgICAgICAgICAgICAgICAndGFncyc6IG51bGwsCiAgICAgICAgICAgICAgICAncm9sZSc6IDAsCiAgICAgICAgICAgICAgICAncG9wdWxhcml0eSc6IDEwLAogICAgICAgICAgICAgICAgJ2RpYW1vbmRDb25zdW1lJzogMCwKICAgICAgICAgICAgICAgICd0aXRsZSc6IHsgJ2lkJzogMCwgJ25hbWUnOiAnJywgJ2NvbnN1bWUnOiAwLCAnY29uc3VtZUVuZCc6IDAsICdpY29uJzogJycgfSwKICAgICAgICAgICAgICAgICdmcmllbmRTdGF0dXMnOiBmYWxzZSwKICAgICAgICAgICAgICAgICd2b2ljZVN0YXR1cyc6IGZhbHNlLAogICAgICAgICAgICAgICAgJ3ZpZGVvU3RhdHVzJzogZmFsc2UsCiAgICAgICAgICAgICAgICAndm9pY2VNb25leVR5cGUnOiAwLAogICAgICAgICAgICAgICAgJ3ZvaWNlQW1vdW50JzogMCwKICAgICAgICAgICAgICAgICd2aWRlb01vbmV5VHlwZSc6IDAsCiAgICAgICAgICAgICAgICAndmlkZW9BbW91bnQnOiAwLAogICAgICAgICAgICAgICAgJ2RlcG9zaXRNb25leSc6IDAKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KCgogICAgZnVuY3Rpb24gbWFpbjEodXJsKSB7CiAgICAgICAgdHJ5IHsKICAgICAgICAgIGxldCBpbml0ID0gZnVuY3Rpb24oKSB7CiAgICAgICAgICAgIGNyYWNrQnRuID0gJCgnPGRpdiBjbGFzcz0iY3JhY2tfdGl0bGUiIGlkPSJjcmFja19hbmFsIj7op6PmnpA8L2Rpdj4nKTsKICAgICAgICAgICAganVtcExpbmsxID0gJCgKICAgICAgICAgICAgICAnPGEgY2xhc3M9ImNyYWNrX3RpdGxlIiB0YXJnZXQ9Il9ibGFuayIgaWQ9ImNyYWNrX2p1bXAiPui3s+i9rOaSreaUvjE8L2E+JwogICAgICAgICAgICApLmhpZGUoKTsKICAgICAgICAgICAganVtcExpbmsyID0gJCgKICAgICAgICAgICAgICAnPGEgY2xhc3M9ImNyYWNrX3RpdGxlIiB0YXJnZXQ9Il9ibGFuayIgaWQ9ImNyYWNrX2p1bXAiPui3s+i9rOaSreaUvjI8L2E+JwogICAgICAgICAgICApLmhpZGUoKTsKICAgICAgICAgICAgY29weUJ0biA9ICQoCiAgICAgICAgICAgICAgJzxkaXYgY2xhc3M9ImNyYWNrX3RpdGxlIiBpZD0iY3JhY2tfY29weSI+PGltZyBzcmM9IiIgd2lkdGg9Ijk0Ii8+PC9kaXY+JwogICAgICAgICAgICApLmhpZGUoKTsKICAgICAgICAgICAgY29udGFpbmVyID0gJChgPGRpdiBjbGFzcz0iY3JhY2tfY29udGFpbmVyIiBpZD0iY3JhY2tfY29udGFpbmVyIj48L2Rpdj5gKS5hcHBlbmQoY3JhY2tCdG4pLmFwcGVuZChqdW1wTGluazEpLmFwcGVuZChqdW1wTGluazIpLmFwcGVuZChjb3B5QnRuKTsKICAgICAgICAgICAgY3JhY2tCdG4ub25lKCJjbGljayIsIGNyYWNrKTsKICAgICAgICAgICAgJCgiYm9keSIpLmFwcGVuZChjb250YWluZXIpOwogICAgICAgICAgfSwgY3JhY2sgPSBmdW5jdGlvbigpIHsKICAgICAgICAgICAgY3JhY2tCdG4uaHRtbCgi6Kej5p6Q5oiQ5YqfIik7CiAgICAgICAgICAgIGNvbnN0IGVuY29kZVVybDIgPSBgaHR0cHM6Ly9tM3U4cGxheS5jb20vP3BsYXk9JHtlbmNvZGVVUklDb21wb25lbnQoCiAgICAgICAgICAgIHVybAogICAgICAgICAgKX1gOwogICAgICAgICAgICBjb25zdCBlbmNvZGVVcmwxID0gYGh0dHBzOi8vbS5hdW9rLnJ1bi9wbGF5ZXIvIyR7dXJsfWA7CiAgICAgICAgICAgIGNvbnN0IHNlbGxDb250YWluZXIyID0gZ2V0U2VsbGVyQ29udGFpbmVyKCk7CiAgICAgICAgICAgIGp1bXBMaW5rMS5hdHRyKCJocmVmIiwgZW5jb2RlVXJsMSk7CiAgICAgICAgICAgIGp1bXBMaW5rMi5hdHRyKCJocmVmIiwgZW5jb2RlVXJsMik7CiAgICAgICAgICAgIGlmIChzZWxsQ29udGFpbmVyMikgewogICAgICAgICAgICAgIHNlbGxDb250YWluZXIyLmlubmVySFRNTCA9ICIiOwogICAgICAgICAgICAgIGlmIChpc01vYmlsZSgpKSB7CiAgICAgICAgICAgICAgICBjb25zdCAkaWZyYW1lID0gJCgKICAgICAgICAgICAgICAgICAgYDxpZnJhbWUgc3JjPSIke2VuY29kZVVybDF9IiBhbGxvd2Z1bGxzY3JlZW49J3RydWUnPjwvaWZyYW1lPmAKICAgICAgICAgICAgICAgICkuY3NzKHsKICAgICAgICAgICAgICAgICAgd2lkdGg6ICIxMDAlIgogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICAkKHNlbGxDb250YWluZXIyKS5hcHBlbmQoJGlmcmFtZSk7CiAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIG5ldyBEUGxheWVyKHsKICAgICAgICAgICAgICAgICAgY29udGFpbmVyOiBzZWxsQ29udGFpbmVyMiwKICAgICAgICAgICAgICAgICAgYXV0b3BsYXk6IGZhbHNlLAogICAgICAgICAgICAgICAgICB0aGVtZTogIiNGQURGQTMiLAogICAgICAgICAgICAgICAgICBsb29wOiB0cnVlLAogICAgICAgICAgICAgICAgICBsYW5nOiAiemgiLAogICAgICAgICAgICAgICAgICBzY3JlZW5zaG90OiB0cnVlLAogICAgICAgICAgICAgICAgICBob3RrZXk6IHRydWUsCiAgICAgICAgICAgICAgICAgIHByZWxvYWQ6ICJhdXRvIiwKICAgICAgICAgICAgICAgICAgdmlkZW86IHsKICAgICAgICAgICAgICAgICAgICB1cmwsCiAgICAgICAgICAgICAgICAgICAgdHlwZTogImhscyIKICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGNvcHlCdG4ub24oImNsaWNrIiwgKCkgPT4gewogICAgICAgICAgICAgIF9HTV9zZXRDbGlwYm9hcmQodXJsLCAidGV4dC9wbGFpbiIpOwogICAgICAgICAgICB9KTsKICAgICAgICAgICAganVtcExpbmsxLnNob3coKTsKICAgICAgICAgICAganVtcExpbmsyLnNob3coKTsKICAgICAgICAgICAgY29weUJ0bi5zaG93KCkuZmluZCgiaW1nIikuYXR0cigic3JjIiwgc3JjKTsKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgfSwgdHJhY2sgPSBmdW5jdGlvbigpIHsKICAgICAgICAgICAgaW5pdCgpOwogICAgICAgICAgICBjcmFjaygpOwogICAgICAgICAgfTsKICAgICAgICAgIGxldCBjcmFja0J0bjsKICAgICAgICAgIGxldCBqdW1wTGluazE7CiAgICAgICAgICBsZXQganVtcExpbmsyOwogICAgICAgICAgbGV0IGNvcHlCdG47CiAgICAgICAgICBsZXQgY29udGFpbmVyOwogICAgICAgICAgY29uc3Qgc2VsbENvbnRhaW5lciA9IGdldFNlbGxlckNvbnRhaW5lcigpOwogICAgICAgICAgaWYgKHNlbGxDb250YWluZXIpIHsKICAgICAgICAgICAgdHJhY2soKTsKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgfQogICAgICAgICAgc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgIHRyYWNrKCk7CiAgICAgICAgICB9LCAyZTMpOwogICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7CiAgICAgICAgfQogICAgICB9CiAgICBmdW5jdGlvbiBkZXN0b3J5KCkgewogICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRzQnlDbGFzc05hbWUoJ3ByZXZpZXctdGl0bGUnKVswXS5yZW1vdmUoKQogICAgfQogICAgCgoKICAgIGZ1bmN0aW9uIHJlbW92ZV92aXAoYm9keSkgewogICAgICAgIGJvZHkubm9kZS52aXBMaW1pdCA9IDA7CiAgICAgICAgbGV0IGF0dGFjaG1lbnRzID0gYm9keS5hdHRhY2htZW50czsKICAgICAgICBsZXQgaW1hZ2VfdXJscyA9IFtdOwogICAgICAgIGxldCB2aWRlb191cmxzID0gYGA7CiAgICAgICAgbGV0IGhhc192aWRlbyA9IC0xOwogICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXR0YWNobWVudHMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgdmFyIGF0dGEgPSBhdHRhY2htZW50c1tpXTsKICAgICAgICAgICAgaWYgKGF0dGEuY2F0ZWdvcnkgPT09ICdpbWFnZXMnKSB7CiAgICAgICAgICAgICAgICBpbWFnZV91cmxzLnB1c2goYDxpbWcgc3JjPSIke2F0dGEucmVtb3RlVXJsfSIgZGF0YS1pZD0iJHthdHRhLmlkfSIvPmApCiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGF0dGEuY2F0ZWdvcnkgPT09ICd2aWRlbycpIHsKICAgICAgICAgICAgICAgIGhhc192aWRlbyA9IGk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgbGV0IGltYWdlcyA9IGltYWdlX3VybHMuam9pbigpOwogICAgICAgIGlmIChoYXNfdmlkZW8gPj0gMCkgewogICAgICAgICAgICBsZXQgW25ib2R5LCB2XSA9IHJlcGxhY2VfbTN1OChib2R5LCBoYXNfdmlkZW8pOwogICAgICAgICAgICBib2R5ID0gbmJvZHk7CiAgICAgICAgICAgIHZpZGVvX3VybHMgPSBgPHZpZGVvIHNyYz0iJHt2LnJlbW90ZVVybH0iIGRhdGEtaWQ9IiR7di5pZH0iLz48L3ZpZGVvPmAKICAgICAgICB9CiAgICAgICAgbGV0IGNvbnRlbnQgPSBib2R5LmNvbnRlbnQucmVwbGFjZSgvXFtb5Zu+54mH6KeG6aKRXStcXT8vLCBgYCk7CiAgICAgICAgY29udGVudCA9IGJvZHkuY29udGVudC5yZXBsYWNlKC/mraTlpITlhoXlrrnllK7ku7cuKj/mgqjov5jmsqHmnInotK3kubDvvIzor7fotK3kubDlkI7mn6XnnIvvvIEvLCBgYCk7CiAgICAgICAgY29udGVudCA9ICc8aHRtbD48aGVhZD48L2hlYWQ+PGJvZHk+JyArIGNvbnRlbnQgKyAnPGJyLz4nICsgaW1hZ2VzICsgJzxici8+JyArIHZpZGVvX3VybHMgKyAnPGJyLz48L2JvZHk+PC9odG1sPic7CiAgICAgICAgYm9keS5jb250ZW50ID0gY29udGVudDsKICAgICAgICByZXR1cm4gYm9keTsKICAgIH0KICAgIGFzeW5jIGZ1bmN0aW9uIHBsYXkodXJsKSB7CiAgICAgICAgbGV0IGlzcGhvbmUgPSBJc1Bob25lKCkKICAgICAgICBsZXQgcGxheXBvcyA9ICcnCiAgICAgICAgaWYgKGlzcGhvbmUpIHsKICAgICAgICAgICAgLy9kb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuc2VsbC1idG4nKS5yZW1vdmUoKQogICAgICAgICAgICBwbGF5cG9zID0gJy5zZWxsLWJ0bicKICAgICAgICAgICAgbGV0IHZpZGVvSW5mbyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IocGxheXBvcykKICAgICAgICAgICAgdmlkZW9JbmZvLmlubmVySFRNTCA9ICc8dmlkZW8gaWQ9InZpZGVvIiBjb250cm9scyBhdXRvcGxheSB3aWR0aD0iMTAwJSI+PC92aWRlbz4nCiAgICAgICAgICAgIHZhciB2aWRlbyA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCd2aWRlbycpOwogICAgICAgICAgICB2YXIgaGxzID0gbmV3IEhscygpOwogICAgICAgICAgICAvLyBiaW5kIHRoZW0gdG9nZXRoZXIKICAgICAgICAgICAgaGxzLmF0dGFjaE1lZGlhKHZpZGVvKTsKICAgICAgICAgICAgaGxzLm9uKEhscy5FdmVudHMuTUVESUFfQVRUQUNIRUQsIGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCJ2aWRlbyBhbmQgaGxzLmpzIGFyZSBub3cgYm91bmQgdG9nZXRoZXIgISIpOwogICAgICAgICAgICAgICAgaGxzLmxvYWRTb3VyY2UodXJsKTsKICAgICAgICAgICAgICAgIGhscy5vbihIbHMuRXZlbnRzLk1BTklGRVNUX1BBUlNFRCwgZnVuY3Rpb24gKGV2ZW50LCBkYXRhKSB7CiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coIm1hbmlmZXN0IGxvYWRlZCwgZm91bmQgIiArIGRhdGEubGV2ZWxzLmxlbmd0aCArICIgcXVhbGl0eSBsZXZlbCIpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIH0pOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcGxheXBvcyA9ICcuc2VsbC1idG4nCiAgICAgICAgICAgIHdpbmRvdy5kcCA9IG5ldyBEUGxheWVyKHsKICAgICAgICAgICAgICAgIGVsZW1lbnQ6IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IocGxheXBvcyksCiAgICAgICAgICAgICAgICBhdXRvcGxheTogZmFsc2UsCiAgICAgICAgICAgICAgICB0aGVtZTogJyNGQURGQTMnLAogICAgICAgICAgICAgICAgbG9vcDogdHJ1ZSwKICAgICAgICAgICAgICAgIGxhbmc6ICd6aCcsCiAgICAgICAgICAgICAgICBzY3JlZW5zaG90OiB0cnVlLAogICAgICAgICAgICAgICAgaG90a2V5OiB0cnVlLAogICAgICAgICAgICAgICAgcHJlbG9hZDogJ2F1dG8nLAogICAgICAgICAgICAgICAgdmlkZW86IHsKICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCwKICAgICAgICAgICAgICAgICAgICB0eXBlOiAnaGxzJwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KQogICAgICAgIH0KICAgIH0KCgogICAgZnVuY3Rpb24gaGFzQ2xhc3MoZWxlbWVudCwgY2xhc3NOYW1lKSB7CiAgICAgICAgcmV0dXJuIGVsZW1lbnQuY2xhc3NMaXN0LmNvbnRhaW5zKGNsYXNzTmFtZSk7CiAgICB9CiAgICBhc3luYyBmdW5jdGlvbiByZXBsYWNlX20zdTgoYm9keSwgaGFzX3ZpZGVvKSB7CiAgICAgICAgbGV0IGF0dGFjaG1lbnRzID0gYm9keS5hdHRhY2htZW50czsKICAgICAgICBsZXQgdmlkeCA9IGhhc192aWRlbzsKICAgICAgICBpZiAodmlkeCA8IDApIHsKICAgICAgICAgICAgcmV0dXJuIFtib2R5LCB1bmRlZmluZWRdOwogICAgICAgIH0KICAgICAgICBpZiAoYm9keS5zYWxlID09PSBudWxsIHx8IGJvZHkuc2FsZS5tb25leV90eXBlID09IDApIHsKICAgICAgICAgICAgcmV0dXJuIFtib2R5LCBhdHRhY2htZW50c1t2aWR4XV07CiAgICAgICAgfQogICAgICAgIGxldCB1cmwgPSBhdHRhY2htZW50c1t2aWR4XS5yZW1vdGVVcmw7CiAgICAgICAgY29uc29sZS5sb2coInVybCIsIHVybCkKCgogICAgICAgIGxldCByZXMgPSBhd2FpdCBmZXRjaCgiaHR0cHM6Ly9oamJkYzgudG9wIiArIHVybCwgewogICAgICAgICAgICBtZXRob2Q6ICdnZXQnLAogICAgICAgIH0pCiAgICAgICAgbGV0IG0zdThUZXh0ID0gYXdhaXQgcmVzLnR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mICh0eXBlb2YgZGl2ID09PSAndW5kZWZpbmVkJykgewogICAgICAgICAgICAgICAgLy8gZG8gc29tZXRoaW5nCiAgICAgICAgICAgIAogICAgICAgICAgICB9ZWxzZXsgICAgCiAgICAgICAgICAgICAgICBhbGVydCgi6K+35YWI55m75b2VLW0iKQogICAgICAgICAgICAgICAgcmV0dXJuCiAgICAgICAgICAgIH0KICAgICAgICAgICAgCiAgICAgICAgICAgIHNldFRpbWVvdXQoKCkgPT4gewogIC8vIOW7tuaXtjHnp5LlkI7miafooYznmoTku6PnoIEKfSwgMTAwMCk7CiAgICAgICAgICAgIGxldCBpbmZvbGlzdCA9IGRvY3VtZW50LmdldEVsZW1lbnRzQnlDbGFzc05hbWUoJ2h0bWwtYm94IGlzaGlkZScpWzBdCiAgICAgICAgICAgIGluZm9saXN0LmNsYXNzTmFtZSA9ICdodG1sLWJveCc7CiAgICAgICAgICAgIGxldCBpbmZvcGhvbmUgPSBkb2N1bWVudC5nZXRFbGVtZW50c0J5Q2xhc3NOYW1lKCdwcmV2aWV3LWJ0bicpWzBdCiAgICAgICAgICAgIHRleHRzZW50ID0gaW5mb3Bob25lLmlubmVyVGV4dCArICIqKioiICsgdGV4dHNlbnQKCiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAKICAgICAgICAgICAgdmFyIGRpdiA9IGRvY3VtZW50LmdldEVsZW1lbnRzQnlDbGFzc05hbWUoIm5hdmlnYXRpb25fYnV0dG9uIilbMF07IC8vIOiOt+WPluesrOS4gOS4quespuWQiOadoeS7tueahOWFg+e0oAoKICAgICAgICAgICAgaWYoZGl2ICE9IG51bGwpewogICAgICAgICAgICAgICAgLy8g5YWD57Sg5a2Y5ZyoCiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBhbGVydCgi6K+35YWI55m75b2VLXAiKQogICAgICAgICAgICAgICAgcmV0dXJuCiAgICAgICAgICAgIH0KICAgICAgICAgICAgCiAgICAgICAgICAgIAogICAgICAgIC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gICAgICAgICAgIGNvbnNvbGUubG9nKCJuZXd1cmwiLCBuZXd1cmwpCiAgICAgICAgICAgIC8vcGxheShuZXd1cmwpCgogICAgICAgICAgICBzZXRUaW1lb3V0KGFzeW5jICgpID0+IHsKICAgICAgICAgICAgICAgIGF3YWl0IHBsYXkobmV3dXJsKQogICAgICAgICAgICB9LCAxMDAwKQoKICAgICAgICB9KTsKCiAgICAgICAgLyoKICAgICAgICAgICAgICAgIGxldCBtM3U4X3BhdGggPSBnZXRfcmVhbF9tM3U4X3BhdGgodXJsKTsKICAgICAgICAgICAgICAgIGlmIChtM3U4X3BhdGggPT09IHVuZGVmaW5lZCkgewogICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCfop4bpopHpk77mjqXojrflj5blpLHotKUhJyk7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtib2R5LCBib2R5LmF0dGFjaG1lbnRzW3ZpZHhdXTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGJvZHkuYXR0YWNobWVudHNbdmlkeF0ucmVtb3RlVXJsID0gbTN1OF9wYXRoOwogICAgICAgICAgICAgICAgcmV0dXJuIFtib2R5LCBib2R5LmF0dGFjaG1lbnRzW3ZpZHhdXTsKICAgICAgICAgICAgICAgICovCiAgICB9CgogICAgZnVuY3Rpb24gcmVwbGFjZV9leGlzdF9pbWcoYm9keSkgewogICAgICAgIGxldCBjb250ZW50ID0gYm9keS5jb250ZW50OwogICAgICAgIGxldCBhdHRhY2htZW50cyA9IGJvZHkuYXR0YWNobWVudHM7CiAgICAgICAgbGV0IGFsbF9pbWcgPSB7fTsKICAgICAgICBsZXQgaGFzX3ZpZGVvID0gLTE7CiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhdHRhY2htZW50cy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICB2YXIgYXR0YSA9IGF0dGFjaG1lbnRzW2ldOwogICAgICAgICAgICBpZiAoYXR0YS5jYXRlZ29yeSA9PT0gJ2ltYWdlcycpIHsKICAgICAgICAgICAgICAgIGFsbF9pbWdbYXR0YS5pZF0gPSBhdHRhLnJlbW90ZVVybDsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoYXR0YS5jYXRlZ29yeSA9PT0gJ3ZpZGVvJykgewogICAgICAgICAgICAgICAgaGFzX3ZpZGVvID0gaTsKICAgICAgICAgICAgICAgIHJldHVybiBbYm9keSwgdW5kZWZpbmVkLCBoYXNfdmlkZW9dOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGxldCByZV9pbWcgPSAvPGltZyBzcmM9XCJodHRwczpcL1wvW1x3XC5cL10rP1wvaW1hZ2VzXC8uKj9cIiBkYXRhLWlkPVwiKFxkKylcIi4qP1wvPi9nOwogICAgICAgIGZvciAobGV0IGUgb2YgY29udGVudC5tYXRjaEFsbChyZV9pbWcpKSB7CiAgICAgICAgICAgIGxldCBpZCA9IHBhcnNlSW50KGVbMV0pOwogICAgICAgICAgICBpZiAoaWQgaW4gYWxsX2ltZykgewogICAgICAgICAgICAgICAgLy8gbGV0IG5zcmMgPSBhbGxfaW1nW2lkXTsKICAgICAgICAgICAgICAgIC8vIGxldCBzcmMgPSBuZXcgUmVnRXhwKGAoPGltZyBzcmM9XCIpaHR0cHM6XC9cL1tcXHdcLlwvXSs/XC9pbWFnZXNcLy4qP1woIiBkYXRhLWlkPVwiJHtpZH1cIi4qP1wvPilgLCAnZycpOwogICAgICAgICAgICAgICAgLy8gY29udGVudCA9IGNvbnRlbnQucmVwbGFjZShzcmMsIGAkMSR7bnNyY30kMmApOwogICAgICAgICAgICAgICAgZGVsZXRlIGFsbF9pbWdbaWRdOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGJvZHkuY29udGVudCA9IGNvbnRlbnQ7CiAgICAgICAgcmV0dXJuIFtib2R5LCBhbGxfaW1nLCBoYXNfdmlkZW9dOwogICAgfQoKICAgIGZ1bmN0aW9uIG1vZGlmeV9kYXRhKGRhdGEpIHsKCiAgICAgICAgbGV0IGJvZHkgPSBKU09OLnBhcnNlKGRlY29kZShkYXRhKSk7CiAgICAgICAgY29uc29sZS5sb2coYm9keSkKICAgICAgICBpZiAoYm9keS5ub2RlLnZpcExpbWl0ICE9IDApIHsKICAgICAgICAgICAgYm9keSA9IHJlbW92ZV92aXAoYm9keSk7CiAgICAgICAgICAgIHJldHVybiBqZW5jb2RlKGJvZHkpOwogICAgICAgIH0KICAgICAgICBsZXQgW25ib2R5LCByZXN0X2ltZywgaGFzX3ZpZGVvXSA9IHJlcGxhY2VfZXhpc3RfaW1nKGJvZHkpOwogICAgICAgIGJvZHkgPSBuYm9keTsKICAgICAgICAvLyDlt7LotK3kubDnmoTluJblrZAKICAgICAgICBpZiAoYm9keS5jb250ZW50LmluY2x1ZGVzKGBbL3NlbGxdYCkpIHsKICAgICAgICAgICAgcmV0dXJuIGplbmNvZGUoYm9keSk7CiAgICAgICAgfQogICAgICAgIGlmICgnc2FsZScgaW4gYm9keSAmJiBib2R5LnNhbGUgIT09IG51bGwpIHsKICAgICAgICAgICAgYm9keS5zYWxlLmlzX2J1eSA9IHRydWU7CiAgICAgICAgICAgIGJvZHkuc2FsZS5idXlfaW5kZXggPSBwYXJzZUludChNYXRoLnJhbmRvbSgpICogKDUwMDAgLSAxMDAwICsgMSkgKyAxMDAwLCAxMCk7CiAgICAgICAgfQogICAgICAgIGlmIChoYXNfdmlkZW8gPj0gMCkgewogICAgICAgICAgICBsZXQgW25ib2R5LCB2XSA9IHJlcGxhY2VfbTN1OChib2R5LCBoYXNfdmlkZW8pOwogICAgICAgICAgICByZXR1cm4gamVuY29kZShuYm9keSk7CiAgICAgICAgfQogICAgICAgIGxldCBpbWdfZWxlbWVudHMgPSBbXQogICAgICAgIGZvciAoY29uc3QgW2lkLCBzcmNdIG9mIE9iamVjdC5lbnRyaWVzKHJlc3RfaW1nKSkgewogICAgICAgICAgICBpbWdfZWxlbWVudHMucHVzaChgPGltZyBzcmM9IiR7c3JjfSIgZGF0YS1pZD0iJHtpZH0iLz5gKTsKICAgICAgICB9CiAgICAgICAgbGV0IHNlbGxlZF9pbWcgPSBgW3NlbGxdYCArIGltZ19lbGVtZW50cy5qb2luKCkgKyBgWy9zZWxsXWA7CiAgICAgICAgbGV0IG5jb250ZW50ID0gYm9keS5jb250ZW50LnJlcGxhY2UoLzxzcGFuIGNsYXNzPVwic2VsbC1idG5cIi4qPFwvc3Bhbj4vLCBzZWxsZWRfaW1nKTsKICAgICAgICBib2R5LmNvbnRlbnQgPSBuY29udGVudDsKICAgICAgICByZXR1cm4gamVuY29kZShib2R5KTsKICAgIH0KCiAgICBmdW5jdGlvbiBtb2RpZnlfdXNlcihkYXRhLCBob3N0LCBpZCkgewogICAgICAgIGlmIChkYXRhLmVycm9yQ29kZSA9PT0gMCkgewogICAgICAgICAgICByZXR1cm4gZGF0YTsKICAgICAgICB9CiAgICAgICAgZGF0YS5pc0VuY3J5cHRlZCA9IHRydWU7CiAgICAgICAgZGF0YS5lcnJvckNvZGUgPSAwOwogICAgICAgIGRhdGEuc3VjY2VzcyA9IHRydWU7CiAgICAgICAgZGF0YS5tZXNzYWdlID0gIiI7CiAgICAgICAgbGV0IHVkaWN0ID0gZ2V0X3VzZXJfZGljdChob3N0LCBpZCk7CiAgICAgICAgZGF0YS5kYXRhID0gamVuY29kZSh1ZGljdCkKICAgICAgICByZXR1cm4gZGF0YQogICAgfQoKCiAgICBmdW5jdGlvbiBJc1Bob25lKCkgewogICAgICAgIHZhciBpbmZvID0gbmF2aWdhdG9yLnVzZXJBZ2VudDsKCiAgICAgICAgaWYgKC9BbmRyb2lkfHdlYk9TfGlQaG9uZXxpUGFkfGlQb2R8QmxhY2tCZXJyeXxJRU1vYmlsZXxPcGVyYSBNaW5pL2kudGVzdChuYXZpZ2F0b3IudXNlckFnZW50KSkgewogICAgICAgICAgICAvLyDmiYvmnLrnq6/ku6PnoIEKICAgICAgICAgICAgY29uc29sZS5sb2coImlzUGhvbmU9IiArIHRydWUpCiAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIC8vIOeUteiEkeerr+S7o+eggQogICAgICAgICAgICBjb25zb2xlLmxvZygiaXNQaG9uZT0iICsgZmFsc2UpCiAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICB9CgogICAgICAgIC8vdmFyIGlzUGhvbmUgPSAvQW5kcm9pZHx3ZWJPU3xpUGhvbmV8aVBhZHxpUG9kfEJsYWNrQmVycnl8SUVNb2JpbGV8T3BlcmEgTWluaS9tb2JpbGUvaS50ZXN0KGluZm8pOwoKICAgIH0KICAgIGNvbnN0IG9yaWdpbk9wZW4gPSBYTUxIdHRwUmVxdWVzdC5wcm90b3R5cGUub3BlbjsKICAgIGNvbnN0IHJlX3RvcGljID0gL1wvYXBpXC90b3BpY1wvXGQrLzsKICAgIGNvbnN0IHJlX3VzZXIgPSAvXC9hcGlcL3VzZXJcL2luZm9cL1xkKy87CgogICAgWE1MSHR0cFJlcXVlc3QucHJvdG90eXBlLm9wZW4gPSBmdW5jdGlvbiAoXywgdXJsKSB7CiAgICAgICAgLy8g5oum5oiqdG9waWMKICAgICAgICBpZiAocmVfdG9waWMudGVzdCh1cmwpKSB7CiAgICAgICAgICAgIGNvbnN0IHhociA9IHRoaXM7CiAgICAgICAgICAgIGNvbnN0IGdldHRlciA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoCiAgICAgICAgICAgICAgICBYTUxIdHRwUmVxdWVzdC5wcm90b3R5cGUsCiAgICAgICAgICAgICAgICAicmVzcG9uc2UiCiAgICAgICAgICAgICkuZ2V0OwogICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoeGhyLCAicmVzcG9uc2VUZXh0IiwgewogICAgICAgICAgICAgICAgZ2V0OiAoKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3VsdCA9IGdldHRlci5jYWxsKHhocik7CiAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlcyA9IEpTT04ucGFyc2UocmVzdWx0LCBgdXRmLThgKTsKICAgICAgICAgICAgICAgICAgICAgICAgLy8g6L+Z6YeM5L+u5pS5ZGF0YQogICAgICAgICAgICAgICAgICAgICAgICByZXMuZGF0YSA9IG1vZGlmeV9kYXRhKHJlcy5kYXRhKQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkocmVzLCBgdXRmLThgKTsKICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCflj5HnlJ/lvILluLghIOino+aekOWksei0pSEnKTsKICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coZSk7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgfSk7CiAgICAgICAgfSBlbHNlIGlmIChyZV91c2VyLnRlc3QodXJsKSkgewogICAgICAgICAgICBjb25zdCB4aHIgPSB0aGlzOwogICAgICAgICAgICBjb25zdCBnZXR0ZXIgPSBPYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKAogICAgICAgICAgICAgICAgWE1MSHR0cFJlcXVlc3QucHJvdG90eXBlLAogICAgICAgICAgICAgICAgInJlc3BvbnNlIgogICAgICAgICAgICApLmdldDsKICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHhociwgInJlc3BvbnNlVGV4dCIsIHsKICAgICAgICAgICAgICAgIGdldDogKCkgPT4gewogICAgICAgICAgICAgICAgICAgIGxldCByZXN1bHQgPSBnZXR0ZXIuY2FsbCh4aHIpOwogICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZXMgPSBKU09OLnBhcnNlKHJlc3VsdCwgYHV0Zi04YCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBmdXJsID0geGhyLnJlc3BvbnNlVVJMOwogICAgICAgICAgICAgICAgICAgICAgICBsZXQgciA9IGZ1cmwubWF0Y2goL1xXKihcdyspXC5jb21cL2FwaVwvdXNlclwvaW5mb1wvKFxkKykvKTsKICAgICAgICAgICAgICAgICAgICAgICAgLy8g6L+Z6YeM5L+u5pS5ZGF0YQogICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YSA9IG1vZGlmeV91c2VyKHJlcywgclsxXSwgclsyXSk7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShkYXRhLCBgdXRmLThgKTsKICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCflj5HnlJ/lvILluLghIOino+aekOWksei0pSEnKTsKICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coZSk7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICAgIG9yaWdpbk9wZW4uYXBwbHkodGhpcywgYXJndW1lbnRzKTsKICAgIH07CgogICAgbGV0IGNsaWNrZWRfZmxhZyA9IGZhbHNlOwoKICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoIkRPTU5vZGVJbnNlcnRlZCIsIGZ1bmN0aW9uIChldmVudCkgewogICAgICAgIGlmICghY2xpY2tlZF9mbGFnKSB7CiAgICAgICAgICAgIGZvciAoY29uc3QgZWxlbWVudCBvZiBkb2N1bWVudC5nZXRFbGVtZW50c0J5Q2xhc3NOYW1lKCdlbC1tZXNzYWdlLWJveCcpKSB7CiAgICAgICAgICAgICAgICBpZiAoZWxlbWVudC5pbm5lclRleHQuaW5kZXhPZign5Luk54mM5bey6L+H5pyfJykgPiAtMSkgewogICAgICAgICAgICAgICAgICAgIGNsaWNrZWRfZmxhZyA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgbGV0IGUgPSBlbGVtZW50LnF1ZXJ5U2VsZWN0b3IoImRpdi5lbC1tZXNzYWdlLWJveF9faGVhZGVyID4gYnV0dG9uIik7CiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dCgoZSkgPT4geyBlLmNsaWNrKCk7IH0sIDEwMCwgZSk7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgaWYgKGV2ZW50LnJlbGF0ZWROb2RlLmdldEF0dHJpYnV0ZSgnaWQnKSA9PT0gJ3RpZGlvLWNoYXQnKSB7CiAgICAgICAgICAgIHZhciBlbGVzID0gZG9jdW1lbnQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJyonKTsKICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBlbGVzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICBlbGVzW2ldLnN0eWxlLnVzZXJTZWxlY3QgPSAndGV4dCc7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9LCBmYWxzZSk7Cgp9KSgpOwoKCmNsYXNzIEJhc2VDbGFzc3sKCiAgICBjb25zdHJ1Y3RvcigpewoKICAgICAgICBpZihHTV9nZXRWYWx1ZSgnaWNvblBvc2l0aW9uU2V0UGFnZScpICE9IDApewogICAgICAgICAgICAvKmNvb2tpZeWtmOWCqAogICAgICAgICAgICBpY29uVmlwVG9wID0gdGhpcy5nZXRDb29raWUoJ2ljb25Ub3AnKT90aGlzLmdldENvb2tpZSgnaWNvblRvcCcpOmljb25WaXBUb3A7CgogICAgICAgICAgICBpY29uVmlwUG9zaXRpb24gPSB0aGlzLmdldENvb2tpZSgnaWNvblBvc2l0aW9uJyk/dGhpcy5nZXRDb29raWUoJ2ljb25Qb3Np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AgICBpY29uVmlwT3BhY2l0eSA9IEdNX2dldFZhbHVlKCdpY29uT3BhY2l0eScpIHx8IEdNX2dldFZhbHVlKCdpY29uT3BhY2l0eScpID09IDA/R01fZ2V0VmFsdWUoJ2ljb25PcGFjaXR5Jyk6aWNvblZpcE9wYWNpdHk7CgogICAgICAgIH0KCiAgICAgICAgR01fcmVnaXN0ZXJNZW51Q29tbWFuZCgi6K6+572uIiwgKCkgPT4gdGhpcy5tZW51U2V0KCkpOwoKICAgICAgICB0aGlzLnNldFN0eWxlKCk7CiAgICB9CgogICAgc2V0U3R5bGUoKXsKICAgICAgICBsZXQgbWVudVNldFN0eWxlID0gYAogICAgICAgICAgICAgICAgLnpobU1hc2t7CiAgICAgICAgICAgICAgICAgICAgei1pbmRleDo5OTk5OTk5OTk7CiAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjojMDAwOwogICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBmaXhlZDt0b3A6IDA7cmlnaHQ6IDA7Ym90dG9tOiAwO2xlZnQ6IDA7CiAgICAgICAgICAgICAgICAgICAgb3BhY2l0eTowLjg7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAud3JhcC1ib3h7CiAgICAgICAgICAgICAgICAgICAgei1pbmRleDoxMDAwMDAwMDAwOwogICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOmZpeGVkOzt0b3A6IDUwJTtsZWZ0OiA1MCU7dHJhbnNmb3JtOiB0cmFuc2xhdGUoLTUwJSwgLTIwMHB4KTsKICAgICAgICAgICAgICAgICAgICB3aWR0aDogMzAwcHg7CiAgICAgICAgICAgICAgICAgICAgY29sb3I6ICM1NTU7CiAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogI2ZmZjsKICAgICAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzOiA1cHg7CiAgICAgICAgICAgICAgICAgICAgb3ZlcmZsb3c6aGlkZGVuOwogICAgICAgICAgICAgICAgICAgIGZvbnQ6MTZweCBudW1Gb250LFBpbmdGYW5nU0MtUmVndWxhcixUYWhvbWEsTWljcm9zb2Z0IFlhaGVpLHNhbnMtc2VyaWYgIWltcG9ydGFudDsKICAgICAgICAgICAgICAgICAgICBmb250LXdlaWdodDo0MDAgIWltcG9ydGFudDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC5zZXRXcmFwSGVhZHsKICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiNmMjQ0NDM7aGVpZ2h0OjQwcHg7Y29sb3I6I2ZmZjt0ZXh0LWFsaWduOmNlbnRlcjtsaW5lLWhlaWdodDo0MHB4OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnNldFdyYXBMaXsKICAgICAgICAgICAgICAgICAgICBtYXJnaW46MHB4O3BhZGRpbmc6MHB4OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnNldFdyYXBMaSBsaXsKICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjZmZmOwogICAgICAgICAgICAgICAgICAgIGJvcmRlci1ib3R0b206MXB4IHNvbGlkICNlZWU7CiAgICAgICAgICAgICAgICAgICAgbWFyZ2luOjBweCAhaW1wb3J0YW50OwogICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6MTJweCAyMHB4OwogICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXg7CiAgICAgICAgICAgICAgICAgICAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuO2FsaWduLWl0ZW1zOiBjZW50ZXI7CiAgICAgICAgICAgICAgICAgICAgbGlzdC1zdHlsZTogbm9uZTsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAuc2V0V3JhcExpQ29udGVudHsKICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBmbGV4O2p1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjthbGlnbi1pdGVtczogY2VudGVyOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnNldFdyYXBTYXZlewogICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOmFic29sdXRlO3RvcDotMnB4O3JpZ2h0OjEwcHg7Zm9udC1zaXplOjI0cHg7Y3Vyc29yOnBvaW50ZXIKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC5pY29uU2V0Rm9vdHsKICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjphYnNvbHV0ZTtib3R0b206MHB4O3BhZGRpbmc6MTBweCAyMHB4O3dpZHRoOjEwMCU7CiAgICAgICAgICAgICAgICB6LWluZGV4OjEwMDAwMDAwMDk7YmFja2dyb3VuZDojZmVmOWVmOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLmljb25TZXRGb290TGl7CiAgICAgICAgICAgICAgICAgICAgbWFyZ2luOjBweDtwYWRkaW5nOjBweDsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAuaWNvblNldEZvb3RMaSBsaXsKICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBpbmxpbmUtZmxleDsKICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOjBweCAycHg7CiAgICAgICAgICAgICAgICAgICAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuO2FsaWduLWl0ZW1zOiBjZW50ZXI7CiAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOiAxMnB4OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLmljb25TZXRGb290TGkgbGkgYXsKICAgICAgICAgICAgICAgICAgICBjb2xvcjojNTU1OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLmljb25TZXRGb290TGkgYTpob3ZlciB7CiAgICAgICAgICAgICAgICAgICAgY29sb3I6I2ZlNmQ3MzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC5pY29uU2V0UGFnZXsKICAgICAgICAgICAgICAgICAgICB6LWluZGV4OjEwMDAwMDAwMDE7CiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246YWJzb2x1dGU7dG9wOjBweDtsZWZ0OjMwMHB4OwogICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQ6I2ZmZjsKICAgICAgICAgICAgICAgICAgICB3aWR0aDozMDBweDsKICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6MTAwJTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC5pY29uU2V0VWxIZWFkewogICAgICAgICAgICAgICAgcGFkZGluZzowcHg7CiAgICAgICAgICAgICAgICBtYXJnaW46MHB4OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLmljb25TZXRQYWdlSGVhZHsKICAgICAgICAgICAgICAgICAgICBib3JkZXItYm90dG9tOjFweCBzb2xpZCAjY2NjOwogICAgICAgICAgICAgICAgICAgIGhlaWdodDo0MHB4OwogICAgICAgICAgICAgICAgICAgIGxpbmUtaGVpZ2h0OjQwcHg7CiAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogZmxleDsKICAgICAgICAgICAgICAgICAgICBqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47CiAgICAgICAgICAgICAgICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjsKICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiNmZTZkNzM7CiAgICAgICAgICAgICAgICAgICAgY29sb3I6I2ZmZjsKICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6IDE1cHg7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuaWNvblNldFBhZ2VMaXsKICAgICAgICAgICAgICAgICAgICBtYXJnaW46MHB4O3BhZGRpbmc6MHB4OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLmljb25TZXRQYWdlTGkgbGl7CiAgICAgICAgICAgICAgICAgICAgbGlzdC1zdHlsZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOjhweCAyMHB4OwogICAgICAgICAgICAgICAgICAgIGJvcmRlci1ib3R0b206MXB4IHNvbGlkICNlZWU7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuemhpaHVTZXRQYWdlewogICAgICAgICAgICAgICAgICAgIHotaW5kZXg6MTAwMDAwMDAwMjtwb3NpdGlvbjphYnNvbHV0ZTt0b3A6MHB4O2xlZnQ6MzAwcHg7YmFja2dyb3VuZDojZmZmO3dpZHRoOjMwMHB4O2hlaWdodDoxMDAlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLmljb25TZXRQYWdlSW5wdXR7CiAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogZmxleCAhaW1wb3J0YW50O2p1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjthbGlnbi1pdGVtczogY2VudGVyOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpoaWh1U2V0UGFnZUxpewogICAgICAgICAgICAgICAgICAgIG1hcmdpbjowcHg7cGFkZGluZzowcHg7CiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OjI1OHB4OwogICAgICAgICAgICAgICAgICAgIG92ZXJmbG93LXk6IHNjcm9sbDsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAuemhpaHVTZXRQYWdlQ29udGVudHsKICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBmbGV4ICFpbXBvcnRhbnQ7anVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuO2FsaWduLWl0ZW1zOiBjZW50ZXI7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgLnpobV9jaXJjdWxhcnsKICAgICAgICAgICAgICAgICAgICB3aWR0aDogNDBweDtoZWlnaHQ6IDIwcHg7Ym9yZGVyLXJhZGl1czogMTZweDt0cmFuc2l0aW9uOiAuM3M7Y3Vyc29yOiBwb2ludGVyO2JveC1zaGFkb3c6IDAgMCAzcHggIzk5OSBpbnNldDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC5yb3VuZC1idXR0b257CiAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDIwcHg7aGVpZ2h0OiAyMHB4Oztib3JkZXItcmFkaXVzOiA1MCU7Ym94LXNoYWRvdzogMCAxcHggNXB4IHJnYmEoMCwwLDAsLjUpO3RyYW5zaXRpb246IC4zcztwb3NpdGlvbjogcmVsYXRpdmU7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuemhtX2JhY2t7CiAgICAgICAgICAgICAgICAgICAgYm9yZGVyOiBzb2xpZCAjRkZGOyBib3JkZXItd2lkdGg6IDAgM3B4IDNweCAwOyBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7IHBhZGRpbmc6IDNweDt0cmFuc2Zvcm06IHJvdGF0ZSgxMzVkZWcpOyAgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgxMzVkZWcpO21hcmdpbi1sZWZ0OjEwcHg7Y3Vyc29yOnBvaW50ZXI7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAudG8tcmlnaHR7CiAgICAgICAgICAgICAgICAgICAgbWFyZ2luLWxlZnQ6MjBweDsgZGlzcGxheTogaW5saW5lLWJsb2NrOyBwYWRkaW5nOiAzcHg7dHJhbnNmb3JtOiByb3RhdGUoLTQ1ZGVnKTsgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgtNDVkZWcpO2N1cnNvcjpwb2ludGVyOwoKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC5pY29uU2V0U2F2ZXsKICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6MjRweDtjdXJzb3I6cG9pbnRlcjttYXJnaW4tcmlnaHQ6NXB4O21hcmdpbi1ib3R0b206NHB4O2NvbG9yOiNGRkY7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuemhtX3NldF9wYWdlewogICAgICAgICAgICAgICAgICAgIHotaW5kZXg6MTAwMDAwMDAwMzsKICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjphYnNvbHV0ZTsKICAgICAgICAgICAgICAgICAgICB0b3A6MHB4O2xlZnQ6MzAwcHg7CiAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZDojZmZmOwogICAgICAgICAgICAgICAgICAgIHdpZHRoOjMwMHB4OwogICAgICAgICAgICAgICAgICAgIGhlaWdodDoxMDAlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9zZXRfcGFnZV9oZWFkZXJ7CiAgICAgICAgICAgICAgICAgICAgYm9yZGVyLWJvdHRvbToxcHggc29saWQgI2NjYzsKICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6NDBweDsKICAgICAgICAgICAgICAgICAgICBsaW5lLWhlaWdodDo0MHB4OwogICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXg7CiAgICAgICAgICAgICAgICAgICAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuOwogICAgICAgICAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7CiAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjojZmU2ZDczOwogICAgICAgICAgICAgICAgICAgIGNvbG9yOiNmZmY7CiAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOiAxNXB4OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9zZXRfcGFnZV9jb250ZW50ewogICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXggIWltcG9ydGFudDtqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47YWxpZ24taXRlbXM6IGNlbnRlcjsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fc2V0X3BhZ2VfbGlzdHsKICAgICAgICAgICAgICAgICAgICBtYXJnaW46MHB4O3BhZGRpbmc6MHB4OwogICAgICAgICAgICAgICAgICAgIGhlaWdodDogMjIwcHg7CiAgICAgICAgICAgICAgICAgICAgb3ZlcmZsb3cteTogc2Nyb2xsOwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIC56aG1fc2V0X3BhZ2VfbGlzdDo6LXdlYmtpdC1zY3JvbGxiYXIgewogICAgICAgICAgICAgICAgICAgIC8q5rua5Yqo5p2h5pW05L2T5qC35byPKi8KICAgICAgICAgICAgICAgICAgICB3aWR0aCA6IDBweDsgIC8q6auY5a695YiG5Yir5a+55bqU5qiq56uW5rua5Yqo5p2h55qE5bC65a+4Ki8KICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDFweDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fc2V0X3BhZ2VfbGlzdDo6LXdlYmtpdC1zY3JvbGxiYXItdGh1bWIgewogICAgICAgICAgICAgICAgICAgIC8q5rua5Yqo5p2h6YeM6Z2i5bCP5pa55Z2XKi8KICAgICAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzICAgOiAycHg7CiAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogI2ZlNmQ3MzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fc2V0X3BhZ2VfbGlzdDo6LXdlYmtpdC1zY3JvbGxiYXItdHJhY2sgewogICAgICAgICAgICAgICAgICAgIC8q5rua5Yqo5p2h6YeM6Z2i6L2o6YGTKi8KICAgICAgICAgICAgICAgICAgICBib3gtc2hhZG93ICAgOiBpbnNldCAwIDAgNXB4IHJnYmEoMCwgMCwgMCwgMC4yKTsKICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kICAgOiAjZWRlZGVkOwogICAgICAgICAgICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDEwcHg7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuemhtX3NldF9wYWdlX2xpc3QgbGl7CiAgICAgICAgICAgICAgICAgICAgLypib3JkZXItYm90dG9tOjFweCBzb2xpZCAjY2NjOyovCiAgICAgICAgICAgICAgICAgICAgcGFkZGluZzoxMnB4IDIwcHg7CiAgICAgICAgICAgICAgICAgICAgZGlzcGxheTpibG9jazsKICAgICAgICAgICAgICAgICAgICBib3JkZXItYm90dG9tOjFweCBzb2xpZCAjZWVlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgbGk6bGFzdC1jaGlsZHsKICAgICAgICAgICAgICAgICAgICBib3JkZXItYm90dG9tOm5vbmU7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuemhtX3Njcm9sbHsKICAgICAgICAgICAgICAgIG92ZXJmbG93LXk6IHNjcm9sbCAhaW1wb3J0YW50OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9zY3JvbGw6Oi13ZWJraXQtc2Nyb2xsYmFyIHsKICAgICAgICAgICAgICAgICAgICAvKua7muWKqOadoeaVtOS9k+agt+W8jyovCiAgICAgICAgICAgICAgICAgICAgd2lkdGggOiAwcHg7ICAvKumrmOWuveWIhuWIq+WvueW6lOaoquerlua7muWKqOadoeeahOWwuuWvuCovCiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAxcHg7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuemhtX3Njcm9sbDo6LXdlYmtpdC1zY3JvbGxiYXItdGh1bWIgewogICAgICAgICAgICAgICAgICAgIC8q5rua5Yqo5p2h6YeM6Z2i5bCP5pa55Z2XKi8KICAgICAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzICAgOiAycHg7CiAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogI2ZlNmQ3MzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fc2Nyb2xsOjotd2Via2l0LXNjcm9sbGJhci10cmFjayB7CiAgICAgICAgICAgICAgICAgICAgLyrmu5rliqjmnaHph4zpnaLovajpgZMqLwogICAgICAgICAgICAgICAgICAgIGJveC1zaGFkb3cgICA6IGluc2V0IDAgMCA1cHggcmdiYSgwLCAwLCAwLCAwLjIpOwogICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQgICA6ICNlZGVkZWQ7CiAgICAgICAgICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogMTBweDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC8qLWZvcm0tKi8KICAgICAgICAgICAgICAgIDpyb290IHsKICAgICAgICAgICAgICAgICAgICAtLWJhc2UtY29sb3I6ICM0MzRhNTY7CiAgICAgICAgICAgICAgICAgICAgLS13aGl0ZS1jb2xvci1wcmltYXJ5OiAjZjdmOGY4OwogICAgICAgICAgICAgICAgICAgIC0td2hpdGUtY29sb3Itc2Vjb25kYXJ5OiAjZmVmZWZlOwogICAgICAgICAgICAgICAgICAgIC0tZ3JheS1jb2xvci1wcmltYXJ5OiAjYzJjMmMyOwogICAgICAgICAgICAgICAgICAgIC0tZ3JheS1jb2xvci1zZWNvbmRhcnk6ICNjMmMyYzI7CiAgICAgICAgICAgICAgICAgICAgLS1ncmF5LWNvbG9yLXRlcnRpYXJ5OiAjNjc2Zjc5OwogICAgICAgICAgICAgICAgICAgIC0tYWN0aXZlLWNvbG9yOiAjMjI3YzlkOwogICAgICAgICAgICAgICAgICAgIC0tdmFsaWQtY29sb3I6ICNjMmMyYzI7CiAgICAgICAgICAgICAgICAgICAgLS1pbnZhbGlkLWNvbG9yOiAjZjcyZjQ3OwogICAgICAgICAgICAgICAgICAgIC0taW52YWxpZC1pY29uOiB1cmwoImRhdGE6aW1hZ2Uvc3ZnK3htbDtjaGFyc2V0PXV0ZjgsJTNDc3ZnJTIweG1sbnMlM0QlMjJodHRwJTNBJTJGJTJGd3d3LnczLm9yZyUyRjIwMDAlMkZzdmclMjIlMjB3aWR0aCUzRCUyMjI0JTIyJTIwaGVpZ2h0JTNEJTIyMjQlMjIlMjB2aWV3Qm94JTNEJTIyMCUyMDAlMjAyNCUyMDI0JTIyJTNFJTIwJTNDcGF0aCUyMGQlM0QlMjJNMTMuNDElMjAxMmw0LjMtNC4yOWExJTIwMSUyMDAlMjAxJTIwMC0xLjQyLTEuNDJMMTIlMjAxMC41OWwtNC4yOS00LjNhMSUyMDElMjAwJTIwMCUyMDAtMS40MiUyMDEuNDJsNC4zJTIwNC4yOS00LjMlMjA0LjI5YTElMjAxJTIwMCUyMDAlMjAwJTIwMCUyMDEuNDIlMjAxJTIwMSUyMDAlMjAwJTIwMCUyMDEuNDIlMjAwbDQuMjktNC4zJTIwNC4yOSUyMDQuM2ExJTIwMSUyMDAlMjAwJTIwMCUyMDEuNDIlMjAwJTIwMSUyMDElMjAwJTIwMCUyMDAlMjAwLTEuNDJ6JTIyJTIwZmlsbCUzRCUyMiUyM2Y3MmY0NyUyMiUyMCUyRiUzRSUzQyUyRnN2ZyUzRSIpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnRleHQtaW5wdXQgewogICAgICAgICAgICAgICAgICAgIGZvbnQtc2l6ZTogMTZweDsKICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogcmVsYXRpdmU7CiAgICAgICAgICAgICAgICAgICAgcmlnaHQ6MHB4OwogICAgICAgICAgICAgICAgICAgIHotaW5kZXg6IDA7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAudGV4dC1pbnB1dF9fYm9keSB7CiAgICAgICAgICAgICAgICAgICAgLXdlYmtpdC1hcHBlYXJhbmNlOiBub25lOwogICAgICAgICAgICAgICAgICAgIC1tb3otYXBwZWFyYW5jZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICBhcHBlYXJhbmNlOiBub25lOwogICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50OwogICAgICAgICAgICAgICAgICAgIGJvcmRlcjogMXB4IHNvbGlkIHZhcigtLWdyYXktY29sb3ItcHJpbWFyeSk7CiAgICAgICAgICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogM3B4OwogICAgICAgICAgICAgICAgICAgIGhlaWdodDogMS43ZW07CiAgICAgICAgICAgICAgICAgICAgbGluZS1oZWlnaHQ6IDEuNzsKICAgICAgICAgICAgICAgICAgICBvdmVyZmxvdzogaGlkZGVuOwogICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6IDJweCAxZW07CiAgICAgICAgICAgICAgICAgICAgdGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7CiAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbjogYmFja2dyb3VuZC1jb2xvciAwLjNzOwogICAgICAgICAgICAgICAgICAgIHdpZHRoOjU1JTsKICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6MTRweDsKICAgICAgICAgICAgICAgICAgICBib3gtc2l6aW5nOiBpbml0aWFsOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnRleHQtaW5wdXRfX2JvZHk6LW1zLWlucHV0LXBsYWNlaG9sZGVyIHsKICAgICAgICAgICAgICAgICAgICBjb2xvcjogdmFyKC0tZ3JheS1jb2xvci1zZWNvbmRhcnkpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnRleHQtaW5wdXRfX2JvZHk6Oi1tb3otcGxhY2Vob2xkZXIgewogICAgICAgICAgICAgICAgICAgIGNvbG9yOiB2YXIoLS1ncmF5LWNvbG9yLXNlY29uZGFyeSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAudGV4dC1pbnB1dF9fYm9keTo6cGxhY2Vob2xkZXIgewogICAgICAgICAgICAgICAgICAgIGNvbG9yOiB2YXIoLS1ncmF5LWNvbG9yLXNlY29uZGFyeSk7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgLnRleHQtaW5wdXRfX2JvZHlbZGF0YS1pcy12YWxpZF0gewogICAgICAgICAgICAgICAgICAgIHBhZGRpbmctcmlnaHQ6IDFlbTsKCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAudGV4dC1pbnB1dF9fYm9keVtkYXRhLWlzLXZhbGlkPXRydWVdIHsKICAgICAgICAgICAgICAgICAgICBib3JkZXItY29sb3I6IHZhcigtLXZhbGlkLWNvbG9yKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X19ib2R5W2RhdGEtaXMtdmFsaWQ9ZmFsc2VdIHsKICAgICAgICAgICAgICAgICAgICBib3JkZXItY29sb3I6IHZhcigtLWludmFsaWQtY29sb3IpOwogICAgICAgICAgICAgICAgICAgIGJveC1zaGFkb3c6IGluc2V0IDAgMCAwIDFweCB2YXIoLS1pbnZhbGlkLWNvbG9yKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X19ib2R5OmZvY3VzIHsKICAgICAgICAgICAgICAgICAgICBib3JkZXItY29sb3I6IHZhcigtLWFjdGl2ZS1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgYm94LXNoYWRvdzogaW5zZXQgMCAwIDAgMXB4IHZhcigtLWFjdGl2ZS1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgb3V0bGluZTogbm9uZTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X19ib2R5Oi13ZWJraXQtYXV0b2ZpbGwgewogICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb24tZGVsYXk6IDk5OTlzOwogICAgICAgICAgICAgICAgICAgIC13ZWJraXQtdHJhbnNpdGlvbi1wcm9wZXJ0eTogYmFja2dyb3VuZC1jb2xvcjsKICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uLXByb3BlcnR5OiBiYWNrZ3JvdW5kLWNvbG9yOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnRleHQtaW5wdXRfX3ZhbGlkYXRvciB7CiAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1wb3NpdGlvbjogcmlnaHQgMC41ZW0gY2VudGVyOwogICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtcmVwZWF0OiBuby1yZXBlYXQ7CiAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1zaXplOiAxLjVlbTsKICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7CiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAxMDAlOwogICAgICAgICAgICAgICAgICAgIGxlZnQ6IDA7CiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IGFic29sdXRlOwogICAgICAgICAgICAgICAgICAgIHRvcDogMDsKICAgICAgICAgICAgICAgICAgICB3aWR0aDogMTAwJTsKICAgICAgICAgICAgICAgICAgICB6LWluZGV4OiAtMTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X19ib2R5W2RhdGEtaXMtdmFsaWQ9ZmFsc2VdICsgLnRleHQtaW5wdXRfX3ZhbGlkYXRvciB7CiAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1pbWFnZTogdmFyKC0taW52YWxpZC1pY29uKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC5zZWxlY3QtYm94IHsKICAgICAgICAgICAgICAgICAgICBib3gtc2l6aW5nOiBpbmhlcml0OwogICAgICAgICAgICAgICAgICAgIGZvbnQtc2l6ZTogMTZweDsKICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogcmVsYXRpdmU7CiAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbjogYmFja2dyb3VuZC1jb2xvciAwLjVzIGVhc2Utb3V0OwogICAgICAgICAgICAgICAgICAgIHdpZHRoOjkwcHg7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuc2VsZWN0LWJveDo6YWZ0ZXIgewogICAgICAgICAgICAgICAgICAgIGJvcmRlci1jb2xvcjogdmFyKC0tZ3JheS1jb2xvci1zZWNvbmRhcnkpIHRyYW5zcGFyZW50IHRyYW5zcGFyZW50IHRyYW5zcGFyZW50OwogICAgICAgICAgICAgICAgICAgIGJvcmRlci1zdHlsZTogc29saWQ7CiAgICAgICAgICAgICAgICAgICAgYm9yZGVyLXdpZHRoOiA2cHggNHB4IDA7CiAgICAgICAgICAgICAgICAgICAgYm90dG9tOiAwOwogICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICIiOwogICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jazsKICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDA7CiAgICAgICAgICAgICAgICAgICAgbWFyZ2luOiBhdXRvIDA7CiAgICAgICAgICAgICAgICAgICAgcG9pbnRlci1ldmVudHM6IG5vbmU7CiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IGFic29sdXRlOwogICAgICAgICAgICAgICAgICAgIHJpZ2h0OiAtNzJweDsKICAgICAgICAgICAgICAgICAgICB0b3A6IDA7CiAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDA7CiAgICAgICAgICAgICAgICAgICAgei1pbmRleDogMTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC5zZWxlY3QtYm94X19ib2R5IHsKICAgICAgICAgICAgICAgICAgICBib3gtc2l6aW5nOiBpbml0aWFsOwogICAgICAgICAgICAgICAgICAgIC13ZWJraXQtYXBwZWFyYW5jZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAtbW96LWFwcGVhcmFuY2U6IG5vbmU7CiAgICAgICAgICAgICAgICAgICAgYXBwZWFyYW5jZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiB0cmFuc3BhcmVudDsKICAgICAgICAgICAgICAgICAgICBib3JkZXI6IDFweCBzb2xpZCB2YXIoLS1ncmF5LWNvbG9yLXByaW1hcnkpOwogICAgICAgICAgICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDNweDsKICAgICAgICAgICAgICAgICAgICBjdXJzb3I6IHBvaW50ZXI7CiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAxLjdlbTsKICAgICAgICAgICAgICAgICAgICBsaW5lLWhlaWdodDogMS43OwogICAgICAgICAgICAgICAgICAgIHBhZGRpbmctbGVmdDogMWVtOwogICAgICAgICAgICAgICAgICAgIHBhZGRpbmctcmlnaHQ6IGNhbGMoMWVtICsgMTZweCk7CiAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDE0MCU7CiAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOjE0cHg7CiAgICAgICAgICAgICAgICAgICAgcGFkZGluZy10b3A6MnB4OwogICAgICAgICAgICAgICAgICAgIHBhZGRpbmctYm90dG9tOjJweDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC5zZWxlY3QtYm94X19ib2R5W2RhdGEtaXMtdmFsaWQ9dHJ1ZV0gewogICAgICAgICAgICAgICAgICAgIGJvcmRlci1jb2xvcjogdmFyKC0tdmFsaWQtY29sb3IpOwogICAgICAgICAgICAgICAgICAgIGJveC1zaGFkb3c6IGluc2V0IDAgMCAwIDFweCB2YXIoLS12YWxpZC1jb2xvcik7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuc2VsZWN0LWJveF9fYm9keVtkYXRhLWlzLXZhbGlkPWZhbHNlXSB7CiAgICAgICAgICAgICAgICAgICAgYm9yZGVyLWNvbG9yOiB2YXIoLS1pbnZhbGlkLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICBib3gtc2hhZG93OiBpbnNldCAwIDAgMCAxcHggdmFyKC0taW52YWxpZC1jb2xvcik7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuc2VsZWN0LWJveF9fYm9keS5mb2N1cy12aXNpYmxlIHsKICAgICAgICAgICAgICAgICAgICBib3JkZXItY29sb3I6IHZhcigtLWFjdGl2ZS1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgYm94LXNoYWRvdzogaW5zZXQgMCAwIDAgMXB4IHZhcigtLWFjdGl2ZS1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgb3V0bGluZTogbm9uZTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC5zZWxlY3QtYm94X19ib2R5Oi13ZWJraXQtYXV0b2ZpbGwgewogICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb24tZGVsYXk6IDk5OTlzOwogICAgICAgICAgICAgICAgICAgIC13ZWJraXQtdHJhbnNpdGlvbi1wcm9wZXJ0eTogYmFja2dyb3VuZC1jb2xvcjsKICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uLXByb3BlcnR5OiBiYWNrZ3JvdW5kLWNvbG9yOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnRleHRhcmVhX19ib2R5IHsKICAgICAgICAgICAgICAgICAgICAtd2Via2l0LWFwcGVhcmFuY2U6IG5vbmU7CiAgICAgICAgICAgICAgICAgICAgLW1vei1hcHBlYXJhbmNlOiBub25lOwogICAgICAgICAgICAgICAgICAgIGFwcGVhcmFuY2U6IG5vbmU7CiAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogdHJhbnNwYXJlbnQ7CiAgICAgICAgICAgICAgICAgICAgYm9yZGVyOiAxcHggc29saWQgdmFyKC0tZ3JheS1jb2xvci1wcmltYXJ5KTsKICAgICAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzOiAwOwogICAgICAgICAgICAgICAgICAgIGJveC1zaXppbmc6IGluaXRpYWw7CiAgICAgICAgICAgICAgICAgICAgZm9udDogaW5oZXJpdDsKICAgICAgICAgICAgICAgICAgICBsZWZ0OiAwOwogICAgICAgICAgICAgICAgICAgIGxldHRlci1zcGFjaW5nOiBpbmhlcml0OwogICAgICAgICAgICAgICAgICAgIG92ZXJmbG93OiBoaWRkZW47CiAgICAgICAgICAgICAgICAgICAgcGFkZGluZzogMWVtOwogICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICAgICAgICAgICAgICAgICAgICByZXNpemU6IG5vbmU7CiAgICAgICAgICAgICAgICAgICAgdG9wOiAwOwogICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb246IGJhY2tncm91bmQtY29sb3IgMC41cyBlYXNlLW91dDsKICAgICAgICAgICAgICAgICAgICB3aWR0aDogMTAwJTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAudGV4dGFyZWFfX2JvZHk6b25seS1jaGlsZCB7CiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IHJlbGF0aXZlOwogICAgICAgICAgICAgICAgICAgIHJlc2l6ZTogdmVydGljYWw7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAudGV4dGFyZWFfX2JvZHk6Zm9jdXMgewogICAgICAgICAgICAgICAgICAgIGJvcmRlci1jb2xvcjogdmFyKC0tYWN0aXZlLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICBib3gtc2hhZG93OiBpbnNldCAwIDAgMCAxcHggdmFyKC0tYWN0aXZlLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICBvdXRsaW5lOiBub25lOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnRleHRhcmVhX19ib2R5W2RhdGEtaXMtdmFsaWQ9dHJ1ZV0gewogICAgICAgICAgICAgICAgICAgIGJvcmRlci1jb2xvcjogdmFyKC0tdmFsaWQtY29sb3IpOwogICAgICAgICAgICAgICAgICAgIGJveC1zaGFkb3c6IGluc2V0IDAgMCAwIDFweCB2YXIoLS12YWxpZC1jb2xvcik7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAudGV4dGFyZWFfX2JvZHlbZGF0YS1pcy12YWxpZD1mYWxzZV0gewogICAgICAgICAgICAgICAgICAgIGJvcmRlci1jb2xvcjogdmFyKC0taW52YWxpZC1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgYm94LXNoYWRvdzogaW5zZXQgMCAwIDAgMXB4IHZhcigtLWludmFsaWQtY29sb3IpOwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIC50ZXh0YXJlYSAuX2R1bW15LWJveCB7CiAgICAgICAgICAgICAgICAgICAgYm9yZGVyOiAxcHggc29saWQ7CiAgICAgICAgICAgICAgICAgICAgYm94LXNpemluZzogYm9yZGVyLWJveDsKICAgICAgICAgICAgICAgICAgICBtaW4taGVpZ2h0OiAyNDBweDsKICAgICAgICAgICAgICAgICAgICBvdmVyZmxvdzogaGlkZGVuOwogICAgICAgICAgICAgICAgICAgIG92ZXJmbG93LXdyYXA6IGJyZWFrLXdvcmQ7CiAgICAgICAgICAgICAgICAgICAgcGFkZGluZzogMWVtOwogICAgICAgICAgICAgICAgICAgIHZpc2liaWxpdHk6IGhpZGRlbjsKICAgICAgICAgICAgICAgICAgICB3aGl0ZS1zcGFjZTogcHJlLXdyYXA7CiAgICAgICAgICAgICAgICAgICAgd29yZC13cmFwOiBicmVhay13b3JkOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnRvTGVmdE1vdmV7CiAgICAgICAgICAgICAgICAgICAgbmltYXRpb246bW92ZVRvTGVmdCAwLjVzIGluZmluaXRlOwogICAgICAgICAgICAgICAgICAgIC13ZWJraXQtYW5pbWF0aW9uOm1vdmVUb0xlZnQgMC41cyBpbmZpbml0ZTsgLypTYWZhcmkgYW5kIENocm9tZSovCiAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLWl0ZXJhdGlvbi1jb3VudDoxOwogICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi1maWxsLW1vZGU6IGZvcndhcmRzOwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIEBrZXlmcmFtZXMgbW92ZVRvTGVmdHsKICAgICAgICAgICAgICAgICAgICBmcm9tIHtsZWZ0OjIwMHB4O30KICAgICAgICAgICAgICAgICAgICB0byB7bGVmdDowcHg7fQogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBtb3ZlVG9MZWZ0IC8qU2FmYXJpIGFuZCBDaHJvbWUqL3sKICAgICAgICAgICAgICAgICAgICBmcm9tIHtsZWZ0OjIwMHB4O30KICAgICAgICAgICAgICAgICAgICB0byB7bGVmdDowcHg7fQogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIC50b1JpZ2h0TW92ZXsKICAgICAgICAgICAgICAgICAgICBuaW1hdGlvbjptb3ZlVG9SaWdodCAycyBpbmZpbml0ZTsKICAgICAgICAgICAgICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjptb3ZlVG9SaWdodCAycyBpbmZpbml0ZTsgLypTYWZhcmkgYW5kIENocm9tZSovCiAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLWl0ZXJhdGlvbi1jb3VudDoxOwogICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi1maWxsLW1vZGU6IGZvcndhcmRzOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgQGtleWZyYW1lcyBtb3ZlVG9SaWdodHsKICAgICAgICAgICAgICAgICAgICBmcm9tIHtsZWZ0OjBweDt9CiAgICAgICAgICAgICAgICAgICAgdG8ge2xlZnQ6MjAwMHB4O30KICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBALXdlYmtpdC1rZXlmcmFtZXMgbW92ZVRvUmlnaHQgLypTYWZhcmkgYW5kIENocm9tZSovewogICAgICAgICAgICAgICAgICAgIGZyb20ge2xlZnQ6MHB4O30KICAgICAgICAgICAgICAgICAgICB0byB7bGVmdDoyMDBweDt9CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICBgOwoKICAgICAgICBkb21TdHlsZSAuYXBwZW5kQ2hpbGQoZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUobWVudVNldFN0eWxlKSk7CgogICAgICAgIGRvbUhlYWQuYXBwZW5kQ2hpbGQoZG9tU3R5bGUpOwogICAgfQoKICAgIG1lbnVTZXQoKXsKCiAgICAgICAgdmFyIF90aGlzID0gdGhpczsKCiAgICAgICAgdmFyIHN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z0nPC9kaXY+JzsKCiAgICAgICAgc2V0SHRtbCArPSAiPC9kaXY+IjsKCiAgICAgICAgaWYoZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3NldE1hc2snKSkgcmV0dXJuOwoKICAgICAgICB0aGlzLmNyZWF0ZUVsZW1lbnQoJ2RpdicsJ3pobU1lbnUnKTsKCiAgICAgICAgbGV0IHpobU1lbnUgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnemhtTWVudScpOwoKICAgICAgICB6aG1NZW51LmlubmVySFRNTCA9IHNldEh0bWw7CgogICAgICAgIGxldCB0aW1lclpobUljb24gPSBzZXRJbnRlcnZhbChmdW5jdGlvbigpewoKICAgICAgICAgICAgaWYgKGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN6aG1NZW51JykpewoKICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwodGltZXJaaG1JY29uKTsgLy8g5Y+W5raI5a6a5pe25ZmoCgogICAgICAgICAgICAgICAgbGV0IGNpcmN1bGFyID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLnpobV9jaXJjdWxhcicpOwoKICAgICAgICAgICAgICAgIGNpcmN1bGFyLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgIGl0ZW0uYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLCBmdW5jdGlvbihfZSl7CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgYnV0dG9uU3R5bGUgPSBpdGVtLmNoaWxkcmVuWzBdLnN0eWxlOwoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGxlZnQgPSBidXR0b25TdHlsZS5sZWZ0OwoKICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCA9IHBhcnNlSW50KGxlZnQpOwoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGxpc3RMZWZ0VmFsdWU7CgogICAgICAgICAgICAgICAgICAgICAgICBpZihsZWZ0PT0wKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBidXR0b25TdHlsZS5sZWZ0ID0gJzIycHgnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1dHRvblN0eWxlLmJhY2tncm91bmQgPSAnI2ZlNmQ3Myc7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5zdHlsZS5iYWNrZ3JvdW5kPScjZmZFNUU1JzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpdGVtLm5leHRTaWJsaW5nICYmIGl0ZW0ubmV4dFNpYmxpbmcuZ2V0QXR0cmlidXRlKCdkYXRhJykpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtLm5leHRTaWJsaW5nLnNldEF0dHJpYnV0ZSgnc3R5bGUnLCdib3JkZXI6IHNvbGlkICNjY2M7Ym9yZGVyLXdpZHRoOiAwIDNweCAzcHggMDsnKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RMZWZ0VmFsdWUgPSAyMjsKCiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1dHRvblN0eWxlLmxlZnQgPSAnMHB4JzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBidXR0b25TdHlsZS5iYWNrZ3JvdW5kID0gJyNmZmYnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uc3R5bGUuYmFja2dyb3VuZD0nI2ZmZic7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaXRlbS5uZXh0U2libGluZyl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0ubmV4dFNpYmxpbmcuc2V0QXR0cmlidXRlKCdzdHlsZScsJ2JvcmRlcjogc29saWQgI0VFRTtib3JkZXItd2lkdGg6IDAgM3B4IDNweCAwOycpCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RMZWZ0VmFsdWUgPSAwOwogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgc2V0TGlzdElEID0gaXRlbS5pZDsKCiAgICAgICAgICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKHNldExpc3RJRCxsaXN0TGVmdFZhbHVlKTsKCiAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICB9KTsKCiAgICAgICAgICAgICAgICBsZXQgdG9SaWdodCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy50by1yaWdodCcpOwoKICAgICAgICAgICAgICAgIHRvUmlnaHQuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKCiAgICAgICAgICAgICAgICAgICAgaXRlbS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsIGZ1bmN0aW9uKGUpewoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGxlZnQgPSBpdGVtLnByZXZpb3VzU2libGluZy5jaGlsZHJlblswXS5zdHlsZS5sZWZ0OwoKICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCA9IHBhcnNlSW50KGxlZnQpOwoKICAgICAgICAgICAgICAgICAgICAgICAgaWYobGVmdCAhPSAyMikgcmV0dXJuOwoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNldFBhZ2VJRCA9IGl0ZW0uZ2V0QXR0cmlidXRlKCdkYXRhJyk7CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGFnZUlkID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoc2V0UGFnZUlEKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VJZC5jbGFzc05hbWU9J2ljb25TZXRQYWdlIHRvTGVmdE1vdmUnOwoKICAgICAgICAgICAgICAgICAgICAgICAgLy/lrp7ml7blm77moIfpq5jluqYKICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2V0UGFnZUlEID09ICdtb3ZpZUljb25TZXRQYWdlJyl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI2ljb25Ub3AnKS52YWx1ZT1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIjemhtbG9nbyIpLm9mZnNldFRvcDsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjemhtVGFrZVBsYWNlJykuc3R5bGU9ImhlaWdodDoyMDBweCI7CgoKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2V0UGFnZUlEID09ICdtb3ZpZVZpZGVvU2V0UGFnZScpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN6aG1UYWtlUGxhY2UnKS5zdHlsZT0iaGVpZ2h0OjIwMHB4IjsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coc2V0UGFnZUlEKTsKCiAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgIGxldCB0b0JhY2sgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuemhtX2JhY2snKTsKCiAgICAgICAgICAgICAgICB0b0JhY2suZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKCiAgICAgICAgICAgICAgICAgICAgaXRlbS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsIGZ1bmN0aW9uKGUpewoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBhcmVudERvbSA9IGl0ZW0ucGFyZW50Tm9kZS5wYXJlbnROb2RlLnBhcmVudE5vZGU7CgogICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnREb20uY2xhc3NOYW1lPSdpY29uU2V0UGFnZSB0b1JpZ2h0TW92ZSc7CgogICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjemhtVGFrZVBsYWNlJykuc3R5bGU9J2hlaWdodDo0MHB4OycKCiAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgIGxldCBzZXRTYXZlID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLmljb25TZXRTYXZlJyk7CgogICAgICAgICAgICAgICAgc2V0U2F2ZS5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewoKICAgICAgICAgICAgICAgICAgICBpdGVtLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJywoKT0+ewoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGljb25Ub3AgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnaWNvblRvcCcpLnZhbHVlOwoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGljb25PcGFjaXR5PWRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdpY29uT3BhY2l0eScpLnZhbHVlOwoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGljb25Qb3NpdGlvbiA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdpY29uUG9zaXRpb24nKS52YWx1ZTsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpY29uV2lkdGggPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnaWNvbldpZHRoJykudmFsdWU7CgogICAgICAgICAgICAgICAgICAgICAgICBsZXQgaWNvbldhaXRUaW1lID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2ljb25XYWl0VGltZScpLnZhbHVlOwoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXlWaWRlb0xpbmVUZXh0ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3BsYXlWaWRlb0xpbmVUZXh0YXJlYScpLnZhbHVlOwoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXlWaWRlb0xpbmVMZWZ0ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3ZpZGVvUGxheUxpbmVBZGQnKS5jaGlsZHJlblswXS5zdHlsZS5sZWZ0OwoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoaWNvblRvcCAhPSAnJyl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoISgvKF5bMC05XVswLTldezAsMn0kKS8udGVzdChpY29uVG9wKSkpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGVydChsYW5nLnRpcEVycm9ySWNvbkhlaWdodCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL190aGlzLnNldENvb2tpZSgnaWNvblRvcCcsaWNvblRvcCwzMCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoJ2ljb25Ub3AnLGljb25Ub3ApOwogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICBpZihpY29uT3BhY2l0eSAhPSAnJyl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoISgvXig/OjB8WzEtOV1bMC05XT98MTAwKSQvLnRlc3QoaWNvbk9wYWNpdHkpKSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsZXJ0KGxhbmcudGlwRXJyb3JJY29uT3BhY2l0eSk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL190aGlzLnNldENvb2tpZSgnaWNvblRvcCcsaWNvblRvcCwzMCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2FsZXJ0KGljb25PcGFjaXR5KTtyZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgnaWNvbk9wYWNpdHknLGljb25PcGFjaXR5KTsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoaWNvblBvc2l0aW9uICE9ICcnKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL190aGlzLnNldENvb2tpZSgnaWNvblBvc2l0aW9uJyxpY29uUG9zaXRpb24sMzApOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCdpY29uUG9zaXRpb24nLGljb25Qb3NpdGlvbik7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGljb25XYWl0VGltZSAhPSAnJyl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoJ2ljb25XYWl0VGltZScsaWNvbldhaXRUaW1lKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoaWNvbldpZHRoICE9JycpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCEoLyheKFsxLTldWzAtOV0/KSQpLy50ZXN0KGljb25XaWR0aCkpKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxlcnQobGFuZy50aXBFcnJvckljb25XaWR0aCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL190aGlzLnNldENvb2tpZSgnaWNvbldpZHRoJyxpY29uV2lkdGgsMzApOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCdpY29uV2lkdGgnLGljb25XaWR0aCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKEdNX2dldFZhbHVlKCd2aWRlb1BsYXlMaW5lQWRkJykgPT0gMjIpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBsYXlWaWRlb0xpbmVUZXh0KXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGxpbmVPYmogPSBfdGhpcy5nZXRMaW5lKHBsYXlWaWRlb0xpbmVUZXh0KTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYobGluZU9iai5sZW5ndGg+MCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgncGxheVZpZGVvTGluZVRleHQnLHBsYXlWaWRlb0xpbmVUZXh0KTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsZXJ0KCfnur/ot6/ovpPlhaXkuI3mraPnoa4nKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoJ3BsYXlWaWRlb0xpbmVUZXh0JywnJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgncGxheVZpZGVvTGluZVRleHQnLHBsYXlWaWRlb0xpbmVUZXh0KTsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgaGlzdG9yeS5nbygwKTsKICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnaWNvblRvcCcpLmFkZEV2ZW50TGlzdGVuZXIoJ2NoYW5nZScsZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgbGV0IGljb25Ub3AgPSB0aGlzLnZhbHVlOwoKICAgICAgICAgICAgICAgICAgICBpZighKC8oXlsxLTldXGQqJCkvLnRlc3QoaWNvblRvcCkpKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0QXR0cmlidXRlKCdkYXRhLWlzLXZhbGlkJywnZmFsc2UnKQoKCiAgICAgICAgICAgICAgICAgICAgfWVsc2V7CgogICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEF0dHJpYnV0ZSgnZGF0YS1pcy12YWxpZCcsJ3RydWUnKQogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwoKICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2ljb25XaWR0aCcpLmFkZEV2ZW50TGlzdGVuZXIoJ2NoYW5nZScsZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICAgICAgbGV0IGljb25XaWR0aCA9IHRoaXMudmFsdWU7CgogICAgICAgICAgICAgICAgICAgIGlmKCEoLyheWzEtOV1cZCokKS8udGVzdChpY29uV2lkdGgpKSl7CgogICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEF0dHJpYnV0ZSgnZGF0YS1pcy12YWxpZCcsJ2ZhbHNlJykKCgogICAgICAgICAgICAgICAgICAgIH1lbHNlewoKICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRBdHRyaWJ1dGUoJ2RhdGEtaXMtdmFsaWQnLCd0cnVlJykKICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKCiAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgLy/ohb7orq/op4bpopHlv6vmjbfplK7lhrLnqoEKICAgICAgICAgICAgICAgIGlmKGNvdXBvblVybC5tYXRjaCgvdlwucXFcLmNvbVwveFwvY292ZXIvKSl7CgogICAgICAgICAgICAgICAgICAgIGxldCBhZGRMaW5lVGV4dCA9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3BsYXlWaWRlb0xpbmVUZXh0YXJlYScpOwoKICAgICAgICAgICAgICAgICAgICBhZGRMaW5lVGV4dC5hZGRFdmVudExpc3RlbmVyKCdrZXlkb3duJyxmdW5jdGlvbihlKXsKCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdGFydFBvcyA9IGFkZExpbmVUZXh0LnNlbGVjdGlvblN0YXJ0OwoKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGVuZFBvcyA9IGFkZExpbmVUZXh0LnNlbGVjdGlvbkVuZDsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdGFydFBvcyA9PT0gdW5kZWZpbmVkIHx8IGVuZFBvcyA9PT0gdW5kZWZpbmVkKSByZXR1cm47CgogICAgICAgICAgICAgICAgICAgICAgICBrZXlDb2RlLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZS5rZXlDb2RlID09IGl0ZW0uY29kZSAmJiBlLnNoaWZ0S2V5PT1pdGVtLmlzU2hpZnQpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGV4dFZhbHVlID0gYWRkTGluZVRleHQudmFsdWU7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdGFydFZhbHVlID0gdGV4dFZhbHVlLnN1YnN0cmluZygwLHN0YXJ0UG9zKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGVuZFZhbHVlID0gdGV4dFZhbHVlLnN1YnN0cmluZyhzdGFydFBvcyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhbGxWYWx1ZSA9IHN0YXJ0VmFsdWUraXRlbS52YWx1ZStlbmRWYWx1ZTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkTGluZVRleHQudmFsdWU9YWxsVmFsdWU7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZExpbmVUZXh0LnNlbGVjdGlvblN0YXJ0ID0gc3RhcnRQb3MrMTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkTGluZVRleHQuc2VsZWN0aW9uRW5kID0gZW5kUG9zKzE7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CgogICAgICAgIH0pCgogICAgICAgIH0KCiAgICBjcmVhdGVFbGVtZW50KGRvbSxkb21JZCl7CgogICAgICAgIHZhciByb290RWxlbWVudCA9IGRvY3VtZW50LmJvZHk7CgogICAgICAgIHZhciBuZXdFbGVtZW50ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChkb20pOwoKICAgICAgICBuZXdFbGVtZW50LmlkID0gZG9tSWQ7CgogICAgICAgIHZhciBuZXdFbGVtZW50SHRtbENvbnRlbnQgPSBkb2N1bWVudC5jcmVhdGVUZXh0Tm9kZSgnJyk7CgogICAgICAgIHJvb3RFbGVtZW50LmFwcGVuZENoaWxkKG5ld0VsZW1lbnQpOwoKICAgICAgICBuZXdFbGVtZW50LmFwcGVuZENoaWxkKG5ld0VsZW1lbnRIdG1sQ29udGVudCk7CgogICAgfQoKICAgIHJlcXVlc3QobWV0aG9kLHVybCxkYXRhLGlzQ29va2llPScnKXsKCiAgICAgICAgbGV0IHJlcXVlc3QgPSBuZXcgWE1MSHR0cFJlcXVlc3QoKTsKCiAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLHJlamVjdCk9PnsKCiAgICAgICAgICAgIHJlcXVlc3Qub25yZWFkeXN0YXRlY2hhbmdlPWZ1bmN0aW9uKCl7CgogICAgICAgICAgICAgICAgaWYocmVxdWVzdC5yZWFkeVN0YXRlPT00KXsKCiAgICAgICAgICAgICAgICAgICAgaWYocmVxdWVzdC5zdGF0dXM9PTIwMCl7CgogICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHJlcXVlc3QucmVzcG9uc2VUZXh0KTsKCiAgICAgICAgICAgICAgICAgICAgfWVsc2V7CgogICAgICAgICAgICAgICAgICAgICAgICByZWplY3QocmVxdWVzdC5zdGF0dXMpOwogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIHJlcXVlc3Qub3BlbihtZXRob2QsdXJsKTsKICAgICAgICAgICAgLy9yZXF1ZXN0LndpdGhDcmVkZW50aWFscyA9IHRydWU7CiAgICAgICAgICAgIGlmKGlzQ29va2llKXsKICAgICAgICAgICAgICAgIHJlcXVlc3Qud2l0aENyZWRlbnRpYWxzID0gdHJ1ZTsKICAgICAgICAgICAgfQogICAgICAgICAgICByZXF1ZXN0LnNldFJlcXVlc3RIZWFkZXIoJ0NvbnRlbnQtVHlwZScsICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnKTsKICAgICAgICAgICAgcmVxdWVzdC5zZW5kKGRhdGEpOwoKICAgICAgICB9KQoKICAgIH0KCiAgICBzZXRDb29raWUoY25hbWUsY3ZhbHVlLGV4ZGF5cyl7CgogICAgICAgIHZhciBkID0gbmV3IERhdGUoKTsKCiAgICAgICAgZC5zZXRUaW1lKGQuZ2V0VGltZSgpKyhleGRheXMqMjQqNjAqNjAqMTAwMCkpOwoKICAgICAgICB2YXIgZXhwaXJlcyA9ICJleHBpcmVzPSIrZC50b0dNVFN0cmluZygpOwoKICAgICAgICBkb2N1bWVudC5jb29raWUgPSBjbmFtZSsiPSIrY3ZhbHVlKyI7ICIrZXhwaXJlczsKICAgIH0KCiAgICBnZXRDb29raWUoY25hbWUpewogICAgICAgIHZhciBuYW1lID0gY25hbWUgKyAiPSI7CiAgICAgICAgdmFyIGNhID0gZG9jdW1lbnQuY29va2llLnNwbGl0KCc7Jyk7CiAgICAgICAgZm9yKHZhciBpPTA7IGk8Y2EubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgdmFyIGMgPSBjYVtpXS50cmltKCk7CiAgICAgICAgICAgIGlmIChjLmluZGV4T2YobmFtZSk9PTApIHsgcmV0dXJuIGMuc3Vic3RyaW5nKG5hbWUubGVuZ3RoLGMubGVuZ3RoKTsgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gIiI7CiAgICB9CgogICAgZ2V0UXVlcnlTdHJpbmcoZSkgewogICAgICAgIHZhciB0ID0gbmV3IFJlZ0V4cCgiKF58JikiICsgZSArICI9KFteJl0qKSgmfCQpIik7CiAgICAgICAgdmFyIGEgPSB3aW5kb3cubG9jYXRpb24uc2VhcmNoLnN1YnN0cigxKS5tYXRjaCh0KTsKICAgICAgICBpZiAoYSAhPSBudWxsKSByZXR1cm4gYVsyXTsKICAgICAgICByZXR1cm4gIiI7CiAgICB9CgogICAgZ2V0VXJsUGFyYW1zKHVybCl7CiAgICAgICAgbGV0IHJlZyA9IC8oW14/JisjXSspPShbXj8mKyNdKykvZzsKICAgICAgICBsZXQgb2JqPXt9OwogICAgICAgIHVybC5yZXBsYWNlKHJlZywocmVzLCQxLCQyKT0+e29ialskMV09JDJ9KTsKICAgICAgICByZXR1cm4gb2JqOwogICAgfQoKICAgIGdldExpbmUodGV4dCl7CgogICAgICAgIGxldCB0ZXh0QXJyID0gdGV4dC5zcGxpdCgnXG4nKTsKCiAgICAgICAgaWYodGV4dEFyci5sZW5ndGggPiAwKXsKCiAgICAgICAgICAgIGxldCBsaW5lT2JqID0gW107CgogICAgICAgICAgICBsZXQgbWF0Y2ggPSAvXiguKykoaHR0cHM/OlwvXC8uKykkLzsKCiAgICAgICAgICAgIHRleHRBcnIuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKCiAgICAgICAgICAgICAgICBpdGVtID0gaXRlbS5yZXBsYWNlKC9ccyosKi9nLCcnKTsKCiAgICAgICAgICAgICAgICBpZighaXRlbSkgcmV0dXJuIHRydWU7CgogICAgICAgICAgICAgICAgbGV0IGxpbmVNYXRjaCA9IGl0ZW0ubWF0Y2gobWF0Y2gpOwoKICAgICAgICAgICAgICAgIGlmKGxpbmVNYXRjaCl7CgogICAgICAgICAgICAgICAgICAgIGxpbmVPYmoucHVzaCh7J25hbWUnOmxpbmVNYXRjaFsxXS5zdWJzdHJpbmcoMCw0KSwndXJsJzpsaW5lTWF0Y2hbMl19KTsKCiAgICAgICAgICAgICAgICB9ZWxzZXsKCiAgICAgICAgICAgICAgICAgICAgbGluZU9iaj1bXTsKCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgfSkKICAgICAgICAgICAgcmV0dXJuIGxpbmVPYmo7CgogICAgICAgIH0KICAgIH0KICAgIC8vYWxs5Y+C5pWw6buY6K6k56m677yM5piv55yf5pe26L+U5Zue5Li65pWw57uECiAgICBzdGF0aWMgZ2V0RWxlbWVudChjc3MsYWxsPScnKXsKCiAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLHJlamVjdCk9PnsKCiAgICAgICAgICAgIGxldCBudW0gPSAwOwoKICAgICAgICAgICAgbGV0IHRpbWVyID0gc2V0SW50ZXJ2YWwoZnVuY3Rpb24oKXsKCiAgICAgICAgICAgICAgICBudW0rKwoKICAgICAgICAgICAgICAgIGxldCBkb207CgogICAgICAgICAgICAgICAgaWYoYWxsID09IGZhbHNlKXsKCiAgICAgICAgICAgICAgICAgICAgZG9tID0gZG9jdW1lbnQucXVlcnlTZWxlY3Rvcihjc3MpOwoKICAgICAgICAgICAgICAgICAgICBpZihkb20pewoKICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcik7CgogICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKGRvbSk7CgogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICB9ZWxzZXsKCiAgICAgICAgICAgICAgICAgICAgZG9tID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChjc3MpOwoKICAgICAgICAgICAgICAgICAgICBpZihkb20ubGVuZ3RoPjApewoKICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcik7CgogICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKGRvbSk7CgogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBpZihudW09PTIwKXsKICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHRpbWVyKTsKICAgICAgICAgICAgICAgICAgICByZXNvbHZlKGZhbHNlKTsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgIH0sMzAwKQoKICAgICAgICAgICAgfSkKCgogICAgfQoKICAgIHN0YXRpYyB0b2FzdChtc2csZHVyYXRpb24pewoKICAgICAgICBkdXJhdGlvbj1pc05hTihkdXJhdGlvbik/MzAwMDpkdXJhdGlvbjsKCiAgICAgICAgbGV0IHRvYXN0RG9tID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnZGl2Jyk7CgogICAgICAgIHRvYXN0RG9tLmlubmVySFRNTCA9IG1zZzsKCiAgICAgICAgLy90b2FzdERvbS5zdHlsZS5jc3NUZXh0PSJ3aWR0aDogNjAlO21pbi13aWR0aDogMTUwcHg7b3BhY2l0eTogMC43O2hlaWdodDogMzBweDtjb2xvcjogcmdiKDI1NSwgMjU1LCAyNTUpO2xpbmUtaGVpZ2h0OiAzMHB4O3RleHQtYWxpZ246IGNlbnRlcjtib3JkZXItcmFkaXVzOiA1cHg7cG9zaXRpb246IGZpeGVkO3RvcDogNDAlO2xlZnQ6IDIwJTt6LWluZGV4OiA5OTk5OTk7YmFja2dyb3VuZDogcmdiKDAsIDAsI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A9IGAKICAgICAgIC56aG1fcGxheV92aWRvZV9pY29uewogICAgICAgICAgcGFkZGluZy10b3A6MnB4OwogICAgICAgICAgY3Vyc29yOnBvaW50ZXI7CiAgICAgICAgICB6LWluZGV4Ojk5OTk5OTsKICAgICAgICAgIHBvc2l0aW9uOmZpeGVkOyR7aWNvblZpcFBvc2l0aW9ufTo1cHg7dG9wOiR7aWNvblZpcFRvcH1weDsKICAgICAgICAgIHRleHQtYWxpZ246Y2VudGVyOwogICAgICAgICAgb3ZlcmZsb3c6dmlzaWJsZTsKICAgICAgICAgIGRpc3BsYXk6ZmxleDsKICAgICAgICAgIGZsZXgtZGlyZWN0aW9uOiR7c29ydERpdn07CiAgICAgICAgICB3aWR0aDphdXRvOwogICAgICAgfQogICAgICAgLnpobV9wbGF5X3ZpZGVvX3dyYXB7CiAgICAgICAgICB6LWluZGV4Ojk5OTk5OTk7CiAgICAgICAgICBvdmVyZmxvdzogaGlkZGVuOwogICAgICAgICAgd2lkdGg6MzAwcHg7CiAgICAgICB9CiAgICAgICAuaWNvbkxvZ297CiAgICAgICBvcGFjaXR5OiR7aWNvblZpcE9wYWNpdHkvMTAwfTsKICAgICAgIH0KICAgICAgIC56aG1fcGxheV92aWRlb19saW5lewogICAgICAgICAgd2lkdGg6MzIwcHg7CiAgICAgICAgICBoZWlnaHQ6MzE2cHg7CiAgICAgICAgICBvdmVyZmxvdy15OnNjcm9sbDsKICAgICAgICAgIG92ZXJmbG93LXg6aGlkZGVuOwogICAgICAgfQogICAgICAgLnpobV9wbGF5X3ZpZGVfbGluZV91bHsKICAgICAgICAgIHdpZHRoOjMwMHB4OwogICAgICAgICAgZGlzcGxheTogZmxleDsKICAgICAgICAgIGp1c3RpZnktY29udGVudDogZmxleC1zdGFydDsKICAgICAgICAgIGZsZXgtZmxvdzogcm93IHdyYXA7CiAgICAgICAgICBsaXN0LXN0eWxlOiBub25lOwogICAgICAgICAgcGFkZGluZzowcHg7CiAgICAgICAgICBtYXJnaW46MHB4OwoKICAgICAgIH0KICAgICAgIC56aG1fcGxheV92aWRlb19saW5lX3VsX2xpewogICAgICAgICAgcGFkZGluZzo0cHggMHB4OwogICAgICAgICAgbWFyZ2luOjJweDsKICAgICAgICAgIHdpZHRoOjMwJTsKICAgICAgICAgIGNvbG9yOiNGRkY7CiAgICAgICAgICB0ZXh0LWFsaWduOmNlbnRlcjsKICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6I2YyNDQ0MzsKICAgICAgICAgIGJveC1zaGFkb3c6MHB4IDBweCAxMHB4ICNmZmY7CiAgICAgICAgICBmb250LXNpemU6MTRweDsKICAgICAgIH0KICAgICAgIC56aG1fcGxheV92aWRlb19saW5lX3VsX2xpOmhvdmVyewogICAgICAgICAgY29sb3I6IzI2MDAzMzsKICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6I2ZjYzBjMAogICAgICAgfQogICAgICAgLnpobV9saW5lX3NlbGVjdGVkewogICAgICAgICAgY29sb3I6IzI2MDAzMzsKICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6I2ZjYzBjMAogICAgICAgfQoKICAgICAgIC56aG1fcGxheV92aWRlb19qeHsKICAgICAgICAgIHdpZHRoOjEwMCU7CiAgICAgICAgICBoZWlnaHQ6MTAwJTsKICAgICAgICAgIHotaW5kZXg6OTk5OTk5OwogICAgICAgICAgcG9zaXRpb246IGFic29sdXRlO3RvcDowcHg7cGFkZGluZzowcHg7CiAgICAgICB9CiAgICAgICBgOwoKICAgICAgICBkb21TdHlsZSAuYXBwZW5kQ2hpbGQoZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUocGxheVZpZGVvU3R5bGUpKTsKCiAgICAgICAgZG9tSGVhZC5hcHBlbmRDaGlsZChkb21TdHlsZSk7CgogICAgICAgIGxldCBwbGF5V3JhcEh0bWwgPSAiPGRpdiBocmVmPSdqYXZhc2NyaXB0OnZvaWQoMCknIHRhcmdldD0nX2JsYW5rJyBzdHlsZT0nJyBjbGFzcz0ncGxheUJ1dHRvbiB6a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emhtTG9nb0ljb25IZWlnaHQtYm90dG9tU3BhY2U7CgogICAgICAgICAgICAgICAgbGV0IHkgPSBldmVudC5wYWdlWS1zaGlmdFk7CgogICAgICAgICAgICAgICAgeSA9IE1hdGgubWluKE1hdGgubWF4KDAsIHkpLCBoZWlnaHQpOwoKICAgICAgICAgICAgICAgIHpobUxvZ29EcmFnLnN0eWxlLnRvcCA9IHkrJ3B4JzsKCiAgICAgICAgICAgIH0KICAgICAgICAgICAgLy/lnKhtb3VzZW1vdmXkuovku7bkuIrnp7vliqjlm77moIcKICAgICAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignbW91c2Vtb3ZlJyxvbk1vdXNlTW92ZSk7CiAgICAgICAgICAgIC8v5p2+5byA5LqL5Lu2CiAgICAgICAgICAgIGRvY3VtZW50Lm9ubW91c2V1cCA9IGZ1bmN0aW9uKGUpewoKICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCdpY29uVG9wJyx6aG1Mb2dvRHJhZy5vZmZzZXRUb3ApOwoKICAgICAgICAgICAgICAgIGRvY3VtZW50LnJlbW92ZUV2ZW50TGlzdGVuZXIoJ21vdXNlbW92ZScswqBvbk1vdXNlTW92ZSk7CgogICAgICAgICAgICAgICAgemhtTG9nb0RyYWcub25tb3VzZXVwwqA9wqBudWxsOwoKICAgICAgICAgICAgICAgIGxldCBoZWlnaHQgPSB6aG1Mb2dvRHJhZy5vZmZzZXRUb3AremhtTG9nb0ljb25IZWlnaHQrYm90dG9tU3BhY2U7CgogICAgICAgICAgICAgICAgaWYoemhtTG9nb0RyYWcub2Zmc2V0VG9wIDwgMCl7CgogICAgICAgICAgICAgICAgICAgIHpobUxvZ29EcmFnLnN0eWxlLnRvcCA9JzBweCc7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgaWYod2luZG93LmlubmVySGVpZ2h0IDwgaGVpZ2h0KXsKCiAgICAgICAgICAgICAgICAgICAgemhtTG9nb0RyYWcuc3R5bGUudG9wID13aW5kb3cuaW5uZXJIZWlnaHQtemhtTG9nb0ljb25IZWlnaHQtYm90dG9tU3BhY2UrJ3B4JzsKCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAvL2NsaWNr5LqL5Lu25aSE55CGCiAgICAgICAgICAgICAgICBzd2l0Y2godHlwZSl7CgogICAgICAgICAgICAgICAgICAgIGNhc2UgJ3ZpZGVvJzoKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKHpobUxvZ29EcmFnLm9mZnNldFRvcD09c2Vkb3duVG9wICYmIHdlYi5sZW5ndGggPT0gMCAmJiB6aG1Mb2dvRHJhZy5vZmZzZXRUb3A+MCAmJiB3aW5kb3cuaW5uZXJIZWlnaHQgPiBoZWlnaHQpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCgn6K+35Zyo6KeG6aKR5pKt5pS+6aG154K55Ye75Zu+5qCHJyk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgIGNhc2UgJ211c2ljJzoKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKHpobUxvZ29EcmFnLm9mZnNldFRvcD09c2Vkb3duVG9wICYmIGUudGFyZ2V0LmNsYXNzTmFtZSA9PSAnaWNvbkxvZ28nKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2RvY3VtZW50LnJlbW92ZUV2ZW50TGlzdGVuZXIoJ21vdXNlbW92ZScswqBvbk1vdXNlTW92ZSk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy96aG1Mb2dvRHJhZy5vbm1vdXNldXDCoD3CoG51bGw7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG11c2ljVXJsRGF0YSA9IFsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7bWF0Y2g6L15odHRwcz86XC9cL211c2ljXC4xNjNcLmNvbVwvI1wvKD86c29uZ3xkailcP2lkL30sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge21hdGNoOi9eaHR0cHM/OlwvXC95XC5tdXNpY1wuMTYzXC5jb21cL21cLyg/OnNvbmd8ZGopXD9pZC99LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHttYXRjaDovXmh0dHBzPzpcL1wvbXVzaWNcLjE2M1wuY29tXC8oPzpzb25nfGRqKVw/aWQvfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7bWF0Y2g6L15odHRwcz86XC9cL3lcLnFxXC5jb21cL25cL3J5cXFcL3BsYXllci99LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHttYXRjaDova3Vnb3VcLmNvbS99LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHttYXRjaDova3V3b1wuY24vfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7bWF0Y2g6L15odHRwcz86XC9cL3d3d1wueGltYWxheWFcLmNvbS99LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgXQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtdXNpY1VybCA9IG11c2ljVXJsRGF0YS5maWx0ZXIoZnVuY3Rpb24oaXRlbSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBsb2NhdGlvbi5ocmVmLm1hdGNoKGl0ZW0ubWF0Y2gpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYobXVzaWNVcmwubGVuZ3RoPT0wKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLnRvYXN0KHdlYlswXS50aXApOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoKHdlYlswXS5uYW1lKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICduZXRlYXNlJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV0ZWFzZUZ1bigpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdxcSc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHFxRnVuKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2t1Z291JzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga3Vnb3VGdW4oKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAna3V3byc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGt1d29GdW4oKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAneGltYWxheWEnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4aW1hbGF5YUZ1bigpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBuZXRlYXNlRnVuKCl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmxQYXJhbXMgPSBfdGhpcy5nZXRVcmxQYXJhbXMobG9jYXRpb24uaHJlZik7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHVybFBhcmFtcy5pZCA9PSB1bmRlZmluZWQpIHJldHVybjsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5ldGVhc2VVcmxFbmNvZGUgPSBlbmNvZGVVUklDb21wb25lbnQoJ2h0dHBzOi8vbXVzaWMuMTYzLmNvbS9zb25nP2lkPScrdXJsUGFyYW1zLmlkKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sZXQgb3BlblVybCA9IHdlYlVybCsnP3VybD0nK25ldGVhc2VVcmxFbmNvZGU7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvcGVuVXJsID0gd2ViVXJsKyI/aWQ9Iit1cmxQYXJhbXMuaWQrIiZ0eXBlPW5ldGVhc2UiCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vcGVuKG9wZW5VcmwpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBxcUZ1bigpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcXFTb25nTWF0Y2g7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIi5wbGF5ZXJfbXVzaWNfX2luZm8iKSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxcVNvbmdNYXRjaCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIi5wbGF5ZXJfbXVzaWNfX2luZm8iKS5jaGlsZE5vZGVzWzBdLmhyZWYubWF0Y2goL3NvbmdEZXRhaWxcLyhcUyopXD8vKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiI3NpbV9zb25nX2luZm8iKSl7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxcVNvbmdNYXRjaCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIiNzaW1fc29uZ19pbmZvIikuY2hpbGROb2Rlc1swXS5ocmVmLm1hdGNoKC9zb25nXC8oXFMqKS5odG1sLyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXFTb25nTWF0Y2ggPSAnJzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFxcVNvbmdNYXRjaFsxXSl7Y29uc29sZS5sb2coJ+ayoeacieiOt+WPluWIsOatjOabsklEJyk7IHJldHVybn07CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhdWRpb0xpbmsgPSBlbmNvZGVVUklDb21wb25lbnQoZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiYXVkaW8iKS5zcmMpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgb3BlblVybCA9IHdlYlVybCsnP2lkPScrcXFTb25nTWF0Y2hbMV0rJyZ0eXBlPXFxJnBsYXlVcmw9JythdWRpb0xpbms7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vcGVuKG9wZW5VcmwpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBrdWdvdUZ1bigpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXVkaW9Nb2R1bGUgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjYXVkaW9Nb2R1bGUnKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoYXVkaW9Nb2R1bGUpewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI2F1ZGlvTW9kdWxlJykuc3R5bGU9J2JvdHRvbTowcHg7JzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNzaG93SGlkZV9wbGF5YmFyJykuY2xhc3NOYW1lID0gJ2ljb24gc2hvdy1wbGF5YmFyLWJ0bic7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MudG9hc3QoJ+ivt+eCueWHu+aSreaUvumcgOimgeS4i+i9veeahOatjOabsu+8jOeEtuWQjuWcqOe9kemhteS4i+aWueaSreaUvuWZqOWGheeCueWHuyLkuIvovb0iJywyMDAwKQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2FsZXJ0KCfor7fngrnlh7vmkq3mlL7pnIDopoHkuIvovb3nmoTmrYzmm7LvvIznhLblkI7lnKjnvZHpobXkuIvmlrnmkq3mlL7lmajlhoXngrnlh7si5LiL6L29IuOAgicpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKgoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc29uZ0t1Z291TWF0Y2ggPSBuZXdVcmwubWF0Y2goanhNdXNpY1dlYlswXS5tYXRjaCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhdWRpb1NyYyA9IGVuY29kZVVSSUNvbXBvbmVudChkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCJhdWRpbyIpLnNyYyk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvcGVuVXJsID0gd2ViVXJsKyc/aWQ9Jytzb25nS3Vnb3VNYXRjaFsxXSsnJnR5cGU9a3Vnb3UmcGxheVVybD0nK2F1ZGlvU3JjOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cub3BlbihvcGVuVXJsKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGt1d29GdW4oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnBsYXlDb250cm9sJykuc3R5bGU9J2JvdHRvbTowcHgnOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MudG9hc3QoJ+ivt+eCueWHu+aSreaUvumcgOimgeS4i+i9veeahOatjOabsu+8jOeEtuWQjuWcqOe9kemhteS4i+aWueaSreaUvuWZqOWGheeCueWHuyLkuIvovb0iJywyMDAwKQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2FsZXJ0KCfor7fngrnlh7vmkq3mlL7pnIDopoHkuIvovb3nmoTmrYzmm7LvvIznhLblkI7lnKjnvZHpobXkuIvmlrnmkq3mlL7lmajlhoXngrnlh7si5LiL6L29IuOAgicpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzb25nS3V3b01hdGNoID0gbmV3VXJsLm1hdGNoKGp4TXVzaWNXZWJbMF0ubWF0Y2gpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXVkaW9TcmMgPSBlbmNvZGVVUklDb21wb25lbnQoZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiYXVkaW8iKS5zcmMpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgb3BlblVybCA9IHdlYlVybCsnP2lkPScrc29uZ0t1d29NYXRjaFsxXSsnJnR5cGU9a3V3byZwbGF5VXJsPScrYXVkaW9TcmM7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vcGVuKG9wZW5VcmwpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24geGltYWxheWFGdW4oKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnhtLXBsYXllcicpLnN0eWxlPSdib3R0b206MHB4JzsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLnRvYXN0KCfor7fngrnlh7vmkq3mlL7pnIDopoHkuIvovb3nmoTmrYzmm7LvvIznhLblkI7lnKjnvZHpobXkuIvmlrnmkq3mlL7lmajlhoXngrnlh7si5LiL6L29IicsMjAwMCkKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9hbGVydCgn6K+354K55Ye75pKt5pS+6ZyA6KaB5LiL6L2955qE5q2M5puy77yM54S25ZCO5Zyo572R6aG15LiL5pa55pKt5pS+5Zmo5YaF54K55Ye7IuS4i+i9vSLjgIInKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsSW5mbyA9IG5ld1VybC5tYXRjaChqeE11c2ljV2ViWzBdLm1hdGNoKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2cod2ViVXJsKyc/aWQ9Jyt1cmxJbmZvWzFdKycmdHlwZT14aW1hbGF5YSZwbGF5VXJsPScrZW5jb2RlVVJJQ29tcG9uZW50KG5ld1VybCkpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih1cmxJbmZvWzFdKXsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vcGVuKHdlYlVybCsnP2lkPScrdXJsSW5mb1sxXSsnJnR5cGU9eGltYWxheWEmcGxheVVybD0nK2VuY29kZVVSSUNvbXBvbmVudChuZXdVcmwpKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5rKh5pyJ6I635Y+WdXJs5Y+C5pWwJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgY2FzZSAneW91dHViZSc6CgoKCiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwoKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfTsKCiAgICAgICAgfTsKCiAgICAgICAgemhtTG9nb0RyYWcub25kcmFnc3RhcnTCoD3CoGZ1bmN0aW9uKCl7CiAgICAgICAgICAgIHJldHVybsKgZmFsc2U7CiAgICAgICAgfTsKICAgIH0KICAgIC8v5LiL6L29CiAgICBzdGF0aWMgTFJfZG93bmxvYWQodXJsLGZpbGVuYW1lKXsKCiAgICAgICAgbGV0IHVhID0gbmF2aWdhdG9yLnVzZXJBZ2VudC50b0xvd2VyQ2FzZSgpOwoKICAgICAgICBjb25zb2xlLmxvZyh1YS5tYXRjaCgvdmVyc2lvblwvKFtcZC5dKykuKnNhZmFyaS8pKTsKCiAgICAgICAgaWYodWEubWF0Y2goL3ZlcnNpb25cLyhbXGQuXSspLipzYWZhcmkvKSl7CgogICAgICAgICAgICB3aW5kb3cub3Blbih1cmwpOwoKICAgICAgICB9ZWxzZXsKY29uc29sZS5sb2codXJsKTsKICAgICAgICAgICAgR01fZG93bmxvYWQodXJsLGZpbGVuYW1lKTsKICAgICAgICB9CgoKICAgIH0KCn0KCgooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIGNvbnN0IG1nbWFwaSA9IHsKCiAgICAgICAgYWRkU3R5bGUocykgewogICAgICAgICAgICBsZXQgc3R5bGUgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCJzdHlsZSIpOwogICAgICAgICAgICBzdH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ICAgICAgICAgICAgIC8vIOWksei0peivt+axguS9v+eUqOS7o+eQhgogICAgICAgICAgICAgICAgaWYgKGFyZ3MubGVuZ3RoID09IDEpIHsKICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhg6K+35rGC5Luj55CG77yaJHthcmdzWzBdfWApOwogICAgICAgICAgICAgICAgICAgIHJldHVybiBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZWZlcmVyID0gbmV3IFVSTFNlYXJjaFBhcmFtcyhsb2NhdGlvbi5oYXNoLnNsaWNlKDEpKS5nZXQoInJlZmVyZXIiKTsKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhlYWRlcnMgPSB7fTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlZmVyZXIpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZmVyZXIgPSBuZXcgVVJMKHJlZmVyZXIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVycyA9IHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib3JpZ2luIjogcmVmZXJlci5vcmlnaW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInJlZmVyZXIiOiByZWZlcmVyLmhyZWYKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgbWdtYXBpLnhtbEh0dHBSZXF1ZXN0KHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogIkdFVCIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGFyZ3NbMF0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNwb25zZVR5cGU6ICdhcnJheWJ1ZmZlcicsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgb25sb2FkKHIpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzOiByLnN0YXR1cywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogbmV3IEhlYWRlcnMoci5yZXNwb25zZUhlYWRlcnMuc3BsaXQoIlxuIikuZmlsdGVyKG4gPT4gbikubWFwKHMgPT4gcy5zcGxpdCgvOlxzKi8pKS5yZWR1Y2UoKGFsbCwgW2EsIGJdKSA9PiB7IGFsbFthXSA9IGI7IHJldHVybiBhbGw7IH0sIHt9KSksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFzeW5jIHRleHQoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gci5yZXNwb25zZVRleHQ7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFzeW5jIGFycmF5QnVmZmVyKCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHIucmVzcG9uc2U7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbmVycm9yKCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChuZXcgRXJyb3IoKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICB0aHJvdyBlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICByZXR1cm47CiAgICB9Cgp9CikoKTsK
Add Comment
Please, Sign In to add comment