Advertisement
xiaomianao666

邀您一起看:「都市奇门医圣」的搜索结果

Apr 1st, 2023
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥「都市奇门医圣」的搜索结果@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIiNmLkZpbGXlt6XlhbdcIixcInBhdGhcIjpcIkZpbGUuanNcIixcInJ1bGVcIjpcImNvbnN0IEZpbGUgPSBqYXZhLmlvLkZpbGU7XFxuY29uc3Qge1xcbiAgICBGaWxlcyxcXG4gICAgUGF0aHMsXFxuICAgIFN0YW5kYXJkQ29weU9wdGlvbixcXG4gICAgU3RhbmRhcmRPcGVuT3B0aW9uXFxufSA9IGphdmEubmlvLmZpbGU7XFxuY29uc3QgamF2YVN0cmluZyA9IGphdmEubGFuZy5TdHJpbmc7XFxubGV0IGphdmFTY29wZSA9IG5ldyBKYXZhSW1wb3J0ZXIoamF2YS5pbywgamF2YS5sYW5nLCBqYXZhLmxhbmcucmVmbGVjdCwgamF2YS51dGlsLlZlY3Rvcik7XFxuXFxuZnVuY3Rpb24gZGVsZXRlRmlsZXMoZmlsZU5hbWUpIHtcXG4gICAgbGV0IGZpbGUgPSBuZXcgRmlsZShmaWxlTmFtZSk7XFxuIC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ICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChNWV9JRCkgPT4ge1xcbiAgICAgICAgICAgIGxldCBzdGF0dXMgPSBnZXRNeVZhcihNWV9JRCArIFxcXCI6c3RhdHVzXFxcIiwgXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICBpZiAoc3RhdHVzID09PSBcXFwiMFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfSUQgKyBcXFwiOnN0YXR1c1xcXCIsIFxcXCIxXFxcIik7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCJb5q2j5Zyo5YGc5q2iLi4uXVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9veaOp+WItlxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mraPlnKjlj5bmtojkuIvovb3ku7vliqFcXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09PSBcXFwiMVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+ato+WcqOaaguWBnC4uLlxcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT09IFxcXCIyXFxcIikge1xcbiAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7LpgIDlh7rkuIvovb3lmahcXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoW1xcXCIzXFxcIiwgXFxcIjRcXFwiXS5pbmNsdWRlcyhzdGF0dXMpKSB7XFxuICAgICAgICAgICAg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cXFwiIFxcXCIgKyBTdHJpbmcoKHJhdGlvICogMTAwKSkuc2xpY2UoMCwgNSkgKyBcXFwiJVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFwifHzkuIvovb3ov5vluqZcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIltsaXN0ZW5lcl3lt7LlrozmiJDkuIvovb3vvJpcXFwiICsgaWQpO1xcbiAgICAgICAgfSBlbHNlIGlmIChDSUQgPT09IC0xKSB7XFxuICAgICAgICAgICAgZmFpbE5hbWUucHVzaChpZCk7XFxuICAgICAgICAgICAgcHV0TG9nKFxcXCJbbGlzdGVuZXJd5bey5YGc5q2i77yaXFxcIiArIGlkKTtcXG4gICAgICAgICAgICBjb3VudCA9IHRhc2tDb3VudDtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGlmICh0YXNrQ291bnQgIT09IGNvdW50KSByZXR1cm47XFxuICAgICAgICBpZiAoc3VjY2Vzc0NJRC5sZW5ndGggPT09IHRhc2tDb3VudCkge1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCLilodcXFwiLnJlcGVhdCgxMCkuZm9udGNvbG9yKFxcXCIjMDBmZjAwXFxcIikgKyBcXFwiIDEwMCVcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX0lEICsgXFxcInx85LiL6L296L+b5bqmXFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgYmF0Y2hUZWFtID0gSlNPTi5wYXJzZShnZXRNeVZhcihNWV9JRCArIFxcXCI6YmF0Y2hUZWFtXF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yJ5Lu75Yqh77yM5L2G5bey5pyJ6L+b5bqm5LiN5Lya5raI5aSxI1xcXCIpO1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIlvph43mlrDlvIDlp4tdXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9veaOp+WItlxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiYnJlYWtcXFwiO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBwdXRNeVZhcihNWV9JRCArIFxcXCI6c3RhdHVzXFxcIiwgXFxcIjJcXFwiKTtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIuS4i+i9veS7u+WKoVtcXFwiICsgaW5mby5ib29rTmFtZSArIFxcXCJd5bey5YWo6YOo5oiQ5Yqf5a6M5oiQXFxcIik7XFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiW+i/lOWbnl1cXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX0lEICsgXFxcInx85LiL6L295o6n5Yi2XFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICB0b2FzdChcXFwi5LiL6L295Lu75YqhW1xcXCIgKyBpbmZvLmJvb2tOYW1lICsgXFxcIl3lt7LlrozmiJBcXFwiKTtcXG4gICAgfVxcbiAgICBsZXQgdGFza1RlYW1DaHVuayA9IFtdO1xcbiAgICBpZiAoQ29uZmlnLnRocmVhZE51bSA+IDApIHtcXG4gICAgICAgIHRhc2tUZWFtQ2h1bmsgPSBUb29sLmNodW5rKHRhc2tUZWFt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ICAgdGl0bGU6IFxcXCIkPlxcXCIgKyB0ZXh0LFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCIjbG9nI1xcXCIgKyBsb2dDb3VudFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgbG9nQ291bnQrKztcXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiB0YXNrKHRhc2tQYXJhbSkge1xcbiAgICAgICAgY29uc3QgVG9vbCA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL1Rvb2wuanNcXFwiKTtcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMTA7IGkrKykge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGxldCBwaWMgPSBUb29sLmhpa2VyUGljKHRhc2tQYXJhbS51cmwpO1xcbiAgICAgICAgICAgICAgICBUb29sLnBpY0Rvd25sb2FkKHBpY1swXSwgdGFza1BhcmFtLmNoYXB0ZXJQYXRoICsgKHRhc2tQYXJhbS5pICsgMSkgKyBcXFwiLmpwZ1xcXCIsIHBpY1sxXSwgdGFza1BhcmFtLmRlY29kZSk7XFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcih0YXNrUGFyYW0uTVlfSUQgKyBcXFwiOnN0YXR1c1xcXCIsIFxcXCJcXFwiKSA9PT0gXFxcIjFcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTE7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZXJyb3JOdW0gPSAwO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIGlmIChpID09PSA5KSB7XFxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIHRhc2tQYXJhbS5DSUQ7XFxuICAgIH1cXG4gICAgbGV0IGNvdW50ID0gMDtcXG4gICAgbGV0IHRvdGFsQ291bnQgPSAwO1xcbiAgICBsZXQgc3VjY2Vzc0NJRCA9IFtdO1xcblxcbiAgICBmdW5jdGlvbiBsaXN0ZW5lcihwYXJhbSwgaWQsIGVycm9yLCByZXN1bHQpIHtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgdG90YWxDb3VudCsrO1xcblxcbiAgICAgICAgICAgIGlmIChlcnJvciAhPSBudWxsKSB7XFxuICAgICAgICAgICAgICAgIHB1dExvZyhcXFwiW2xpc3RlbmVyXeS4i+i9veWksei0pe+8mlxcXCIgKyBpZCArIFxcXCI8RVJST1JAIFxcXCIgKyBlcnJvciArIFxcXCI+XFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChyZXN1bHQgPT09IC0xKSB7XFxuICAgICAgICAgICAgICAgIHB1dExvZyhcXFwiW2xpc3RlbmVyXeW3suWBnOatou+8mlxcXCIgKyBpZCk7XFxuICAgICAgICAgICAgICAgIHRvdGFsQ291bnQgPSBwYXJhbS5waXZDb3VudDtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBjb3VudCsrO1xcbiAgICAgICAgICAgICAgICBsZXQgcmF0aW8gPSAoKGNvdW50IC8gcGFyYW0ucGl2Q291bnQpKS50b0ZpeGVkKDQpO1xcbiAgICAgICAgICAgICAgICBsZXQgc3RyaXBDb3VudCA9IE1hdGguY2VpbChyYXRpbyAqIDEwKTtcXG4gICAgICAgICAgICAgICAgaWYgKHBhcmFtLnBpdkNvdW50ID09PSB0b3RhbENvdW50ICYmIHRvdGFsQ291bnQgPT09IGNvdW50KSB7XFxuICAgICAgICAgICAgICAgICAgICBzdWNjZXNzQ0lELnB1c2gocGFyYW0uQ0lEKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5LiL6L296L+b5bqm77yaXFxcIiArIChzdWNjZXNzQ0lELmxlbmd0aCkgKyBcXFwiL1xcXCIgKyBwYXJhbS50b3RhbCxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIuKWh1xcXCIucmVwZWF0KHN0cmlwQ291bnQpLmZvbnRjb2xvcihcXFwiI2ZmYWMyZFxcXCIpICsgXFxcIuKWh1xcXCIucmVwZWF0KDEwIC0gc3RyaXBDb3VudCkuZm9udGNvbG9yKFxcXCIjZTVlMWU0XFxcIikgKyBcXFwiIFxcXCIgKyBTdHJpbmcoKHJhdGlvICogMTAwKSkuc2xpY2UoMCwgNSkgKyBcXFwiJVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9vei/m+W6plxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIC8vcHV0TG9nKFxcXCJbbGlzdGVuZXJd5bey5a6M5oiQ5LiL6L2977yaXFxcIiArIGlkKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHRvdGFsQ291bnQgIT09IHBhcmFtLnBpdkNvdW50KSByZXR1cm47XFxuICAgICAgICAgICAgaWYgKHRvdGFsQ291bnQgPT09IGNvdW50KSB7XFxuICAgICAgICAgICAgICAgIEZpbGUucmVuYW1lRmlsZShwYXJhbS5jaGFwdGVyUGF0aCwgcGFyYW0uQ0lEICsgXFxcIiRBJFxcXCIgKyBUb29sLnRleHRTaGllbGQocGFyYW0udGl0bG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xcbiAgICAgICAgICAgIGZ1bmM6IHRhc2ssXFxuICAgICAgICAgICAgaWQ6IGksXFxuICAgICAgICAgICAgcGFyYW06IHtcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgIGk6IGksXFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJQYXRoOiBjaGFwdGVyUGF0aCxcXG4gICAgICAgICAgICAgICAgTVlfSUQ6IE1ZX0lELFxcbiAgICAgICAgICAgICAgICBkZWNvZGU6IGluZm8uZGVjb2RlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSkpO1xcbiAgICAgICAgYmUodGFza1RlYW0sIHtcXG4gICAgICAgICAgICBmdW5jOiBsaXN0ZW5lcixcXG4gICAgICAgICAgICBwYXJhbToge1xcbiAgICAgICAgICAgICAgICBwaXZDb3VudDogcGljTGlzdC5sZW5ndGgsXFxuICAgICAgICAgICAgICAgIHRvdGFsOiBjaGFwdGVyVGVhbS5sZW5ndGgsXFxuICAgICAgICAgICAgICAgIG9yZGVyOiBvcmRlcixcXG4gICAgICAgICAgICAgICAgQ0lEOiBpdGVtLkNJRCxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0udGl0bGUsXFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJQYXRoOiBjaGFwdGVyUGF0aFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgaWYgKGdldE15VmFyKE1ZX0lEICsgXFxcIjpzdGF0dXNcXFwiLCBcXFwiXFxcIikgPT09IFxcXCIxXFxcIikge1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcbiAgICB9XFxuXFxuICAgIGxldCBzdGF0dXMgPSBnZXRNeVZhcihNWV9JRCArIFxcXCI6c3RhdHVzXFxcIiwgXFxcIjBcXFwiKTtcXG4gICAgamF2YS5sYW5nLlRocmVhZC5zbGVlcCg0MCk7XFxuICAgIC8vbGV0IGJhdGNoVGVhbSA9IEpTT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yBpIDwgY291bnQ7IGkrKykge1xcbiAgICAgICAgICAgIHRleHQgPSBhcnJheVtpXTtcXG4gICAgICAgICAgICBsZXQgaW5kZXggPSB0ZXh0LmluZGV4T2YodGFyZ2V0KTtcXG4gICAgICAgICAgICBpZiAoaW5kZXggPT09IC0xKSB7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBhcnJheVtpXSA9IHRleHQuc2xpY2UoMCwgaW5kZXgpO1xcbiAgICAgICAgICAgIGFycmF5W2kgKyAxXSA9IHRleHQuc2xpY2UoaW5kZXggKyB0YXJnZXQubGVuZ3RoKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBhcnJheTtcXG4gICAgfSxcXG4gICAgY2h1bmsoYXJyLCBzaXplKSB7XFxuICAgICAgICB2YXIgcmVzdWx0ID0gW107XFxuICAgICAgICBmb3IgKHZhciBpID0gMCwgbGVuID0gYXJyLmxlbmd0aDsgaSA8IGxlbjsgaSArPSBzaXplKSB7XFxuICAgICAgICAgICAgcmVzdWx0LnB1c2goYXJyLnNsaWNlKGksIGkgKyBzaXplKSk7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gcmVzdWx0O1xcbiAgICB9LFxcbiAgICBoaWtlclBpYyh1cmwpIHtcXG4gICAgICAgIHZhciBoZWFkZXJzID0ge307XFxuICAgICAgICBsZXQgdXJscyA9IHVybC5zcGxpdChcXFwiQFxcXCIpO1xcbiAgICAgICAgbGV0IHBpY1VybCA9IHVybHMuc2hpZnQoKTtcXG4gICAgICAgIGxldCBsZW5ndGggPSB1cmxzLmxlbmd0aDtcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICBsZXQgW2tleSwgdmFsdWVdID0gdi5zcGxpdCh1cmxzW2ldLCBcXFwiPVxcXCIpO1xcbiAgICAgICAgICAgIGlmIChrZXkgPT09IFxcXCJoZWFkZXJzXFxcIikge1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmFzc2lnbihoZWFkZXJzLCBKU09OLnBhcnNlKHZhbHVlKSk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChrZXkuaW5jbHVkZXMoXFxcIi5cXFwiKSB8fCBrZXkuaW5jbHVkZXMoXFxcIj9cXFwiKSkge1xcbiAgICAgICAgICAgICAgICBwaWNVcmwgKz0gXFxcIkBcXFwiICsga2V5ICsgKHZhbHVlID8gXFxcIj1cXFwiICsgdmFsdWUgOiBcXFwiXFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChrZXkgIT09IFxcXCJqc1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyc1trZXldID0gdmFsdWU7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIFtwaWNVcmwsIGhlYWRlcnNdO1xcbiAgICB9LFxcbiAgICByYW5nZShzdGFydCwgZW5kKSB7XFxuICAgICAgICByZXR1cm4gQXJyYXkoZW5kIC0gc3RhcnQpLmZpbGwoMCkubWFwKChlbCwgaSkgPT4gc3RhcnQgKyBpKTtcXG4gICAgfSxcXG4gICAgcGljRG93bmxvYWQodXJsLCBwYXRoLCBoZWFkZXJzLCBkZWNpcGhlKSB7XFxuICAgICAgICBpZiAodHlwZW9mIGRlY2lwaGUgPT09IFxcXCJzdHJpbmdcXFwiICYmIGRlY2lwaGUubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgIGxldCBpbnN0cmVhbTtcXG4gICAgICAgICAgICBsZXQgb3V0c3RyZWFtO1xcbiAgICAgICAgICAgIGxldCBmaWxlO1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGZpbGUgPSBuZXcgamF2YS5pby5GaWxlKHBhdGgpO1xcbiAgICAgICAgICAgICAgICBpZiAoZmlsZS5leGlzdHMoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCBkaXIgPSBmaWxlLmdldFBhcmVudEZpbGUoKTtcXG4gICAgICAgICAgICAgICAgaWYgKGRpciAhPSBudWxsICYmICFkaXIuZXhpc3RzKCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGRpci5ta2RpcnMoKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpbnN0cmVhbSA9IGZldGNoKHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgIGlucHV0U3RyZWFtOiB0cnVlXFxuICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgICAgICBvdXRzdHJlYW0gPSBuZXcgamF2YS5pby5GaWxlT3V0cHV0U3RyZWFtKHBhdGgpO1xcbiAgICAgICAgICAgICAgICBsZXQgdCA9ICQuaGlrZXIuaW5wdXQsXFxuICAgICAgICAgICAgICAgICAgICBjID0gJC5oaWtlci51cmw7XFxuICAgICAgICAgICAgICAgICQuaGlrZXIuaW5wdXQgPSBpbnN0cmVhbTtcXG4gICAgICAgICAgICAgICAgJC5oaWtlci51cmwgPSB1cmw7XFxuICAgICAgICAgICAgICAgIGxldCBwaWNpbiA9IChuZXcgRnVuY3Rpb24oXFxcInJldHVybiBcXFwiICsgZGVjaXBoZSkpKCk7XFxuICAgICAgICAgICAgICAgICQuaGlrZXIuaW5wdXQgPSB0O1xcbiAgICAgICAgICAgICAgICAkLmhpa2VyLnVybCA9IGM7XFxuICAgICAgICAgICAgICAgIGxldCBidWYgPSBqYXZhLmxhbmcucmVmbGVjdC5BcnJheS5uZXdJbnN0YW5jZShqYXZhLmxhbmcuQnl0ZS5UWVBFLCAxMDI0KTtcXG4gICAgICAgICAgICAgICAgbGV0IGxlbjtcXG4gICAgICAgICAgICAgICAgd2hpbGUgKChsZW4gPSBwaWNpbi5yZWFkKGJ1ZikpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICBvdXRzdHJlYW0ud3JpdGUoYnVmLCAwLCBsZW4pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGNsb3NlTWUoaW5zdHJlYW0pO1xcbiAgICAgICAgICAgICAgICBjbG9zZU1lKG91dHN0cmVhbSk7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICBjbG9zZU1lKGluc3RyZWFtKTtcXG4gICAgICAgICAgICAgICAgY2xvc2VNZShvdXRzdHJlYW0pO1xcbiAgICAgICAgICAgICAgICBpZiAoZmlsZSBpbnN0YW5jZW9mIGphdmEuaW8uRmlsZSAmJiBmaWxlLmV4aXN0cygpKSB7XFxuICAgICAgICAgICAgICAgICAgICBmaWxlLmRlbGV0ZSgpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxvZyhcXFwiPOino+WvhuS4i+i9vUVycm9yPlxcXCIgKyBlLnRvU3RyaW5nKCkpXFxuICAgICAgICAgICAgICAgIHRocm93IGU7XFxuICAgICAgICAgICAgfSBmaW5hbGx5IHtcXG4gICAgICAgICAgICAgICAgY2xvc2VNZShpbnN0cmVhbSk7XFxuICAgICAgICAgICAgICAgIGNsb3NlTWUob3V0c3RyZWFtKTtcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJlcXVpcmVEb3dubG9hZCh1cmwsIHBhdGgsIGhlYWRlcnMpO1xcbiAgICAgICAgfVxcbiAgICB9LFxcbiAgICB0ZXh0U2hpZWxkKHRleHQpIHtcXG4gICAgICAgIGxldCBlID0gLyN8OnwmfFxcXFx8fFxcXFxefEB8XF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G4gICAgICAgICAgICAgICAgdmVyc2lvbjogTVlfUlVMRS52ZXJzaW9uXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzluK7liqnigJ3igJ1cXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9oZWxwLnZpZXcjbm9SZWZyZXNoIyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSM/a2V5d29yZD1ub3ZlbENvbWljXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGgxIHN0eWxlPVxcXCJ0ZXh0LWFsaWduOiBjZW50ZXI7XFxcIj7llaXpg73msqHmnInogLY8L2gxPicsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJldHVybiBzZXRSZXN1bHQobGF5b3V0KTtcXG4gICAgfVxcbiAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICB1cmw6ICdcXFwiaGlrZXI6Ly9zZWFyY2g/cz1cXFwiK2lucHV0JyxcXG4gICAgICAgIGRlc2M6IFxcXCLmkJzkvaDmg7PopoHnmoQjXFxcIiArIHR5cGUgKyBcXFwiIy4uLi4uLlxcXCIsXFxuICAgICAgICB0aXRsZTogXFxcIvCflI1cXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHJ1bGVzOiAkLnRvU3RyaW5nKCh0YWcsIHR5cGUpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGFycjEgPSBbXTtcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0YWcubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgICAgIGFycjEucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInRpdGxlXFxcIjogdGFnW2ldLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNlYXJjaF91cmxcXFwiOiBcXFwiaGlrZXI6Ly9lbXB0eT9pc0FsbD0xJnNlYXJjaFRlcm1zPSoqJnR5cGU9XFxcIiArIHR5cGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNlYXJjaEZpbmRcXFwiOiBcXFwianM6JC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvU2VhcmNoLnZpZXc/cnVsZT0nK01ZX1JVTEUuX3RpdGxlKTtcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoYXJyMSk7XFxuICAgICAgICAgICAgfSwgdGFnLCB0eXBlKSxcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKCdzZWFyY2hLZXknLCAnJyksXFxuICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcignc2VhcmNoS2V5JyxpbnB1dClcXFwiXFxuICAgICAgICB9XFxuICAgIH0pO1xcblxcbiAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuKAmOKAmOKameiuvue9ruKAmeKAmVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL1NldHRpbmcudmlldyNub1JlZnJlc2gjI25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5I1xcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHZlcnNpb246IE1ZX1JVTEUudmVyc2lvblxcbiAgICAgICAgfVxcbiAgICB9KTtcXG5cXG5cXG4gICAgZm9yIChsZXQgaSBpbiB0YWcpIHtcXG4gICAgICAgIGxldCBpdCA9IHRhZ1tpXTtcXG4gICAgICAgIGlmICh0Z251bSA9PT0gaSkge1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJxcXFwiICsgaXQubmFtZSArIFxcXCLigJ3igJ1cXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoW1xcXCLliKDpmaTor6Xnm67lvZVcXFwiLCBcXFwi6Lez6L2s5bCP56iL5bqPXFxcIiwgXFxcIuaJk+W8gOS5puaetlxcXCJdLCAxLCBcXFwi6YCJ5oup5pON5L2cXFxcIikuc2VsZWN0KChpdCwgdHlwZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKFxcXCLot7PovazlsI/nqIvluo9cXFwiID09PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9ob21lQFxcXCIgKyBpdC5uYW1lO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmKFxcXCLliKDpmaTor6Xnm67lvZVcXFwiPT09aW5wdXQpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuIHRoZW4oW1xcXCLor6Xmk43kvZzkuI3kvJrliKDpmaTlsI/nqIvluo/vvIzkvYbor6XlsI/nqIvluo/kuIvovb3nmoTmiYDmnInmvKvnlLvlsIbooqvliKDpmaRcXFwiXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuivpeaTjeS9nOS4jeS8muWIoOmZpOWwj+eoi+W6j++8jOS9huivpeWwj+eoi+W6j+S4i+i9veeahOaJgOaciSDmvKvnlLsv5bCP6K+0IOWwhuiiq+WIoOmZpFxcXCIpLmNvbmZpcm0oKHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEZpbGUuZGVsZXRlRmlsZXMocGF0aCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcIi50Z251bVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoOmZpOWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdC5wYXRoKTtcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL0Jvb2tyYWNrLnZpZXc/cnVsZT3mnKzlnLDotYTmupDnrqHnkIYmcnVsZU5hbWU9XFxcIitpdC5uYW1lK1xcXCImdHlwZT1cXFwiK3R5cGU7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIGl0LCB0eXBlKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdC5uYW1lLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoaSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiLnRnbnVtXFxcIiwgaSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgaSksXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgbGV0IHBhdGggPSB0YWdbdGdudW1dLnBhdGg7XFxuICAgIGxldCBtaGxpc3QgPSBGaWxlLmdldEZpbGVQYXRoKHBhdGgsIFxcXCJkaXJcXFwiKTtcXG5cXG4gICAgaWYgKG1obGlzdC5sZW5ndGggPT09IDApIHtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBcXFwi5ZWl6YO95rKh5pyJ6IC2XFxcIi5iaWcoKSxcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmV0dXJuIHNldFJlc3VsdChsYXlvdXQpO1xcbiAgICB9XFxuICAgIGxldCBwYWdlVXJsID0gdHlwZSA9PT0gXFxcIm5vdmVsXFxcIiA/IFxcXCJoaWtlcjovL3BhZ2UvTm92ZWxCcm93c2VyLnZpZXdcXFwiIDogXFxcImhpa2VyOi8vcGFnZS9Db21pY0Jyb3dzZXIudmlld1xcXCI7XFxuICAgIGZvciAobGV0IGl0ZW0gb2YgbWhsaXN0KSB7XFxuICAgICAgICBsZXQgcGljID0gZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIGl0ZW0ucGF0aCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZSArIFxcXCIuanBnXFxcIikgPyBpdGVtLnBhdGggKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWUgKyBcXFwiLmpwZ1xcXCIgOiBDb25maWcuZGVmX1BpYztcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgIHBpY191cmw6IHBpYyxcXG4gICAgICAgICAgICB1cmw6IHBhZ2VVcmwgKyBcXFwiP3J1bGU9XFxcIiArIE1ZX1JVTEUudGl0bGUsXFxuICAgICAgICAgICAgZXh0cmE6IE9iamVjdC5hc3NpZ24oaXRlbSwge1xcbiAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygocGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxvbmdQcmVzcy5qc1xcXCIpLmRlbGV0ZUZpbGVGb3JCb29rKHBhdGgpXFxuICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLnBhdGgpXFxuICAgICAgICAgICAgICAgIH1dLFxcbiAgICAgICAgICAgICAgICBpZDogaXRlbS5wYXRoXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIHNldFJlc3VsdChsYXlvdXQpO1xcbn1cXG5cXG5tYWluKCk7XCJ9LHtcImNvbF90eXBlXCI6XCJ0ZXh0XzFcIixcIm5hbWVcIjpcIiN2Lua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AgICAgICAgYXJyYXkucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgdXJsOiBpdGVtLnBhdGggKyBsYXp5LFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogQ29uZmlnLmRlZl9WaWV3X1N0eWxlLFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgZm9yIChsZXQgaXRlbSBvZiBtaGxpc3QpIHtcXG4gICAgICAgICAgICBsZXQgdGl0bGUgPSBnZXRUaXRsZShpdGVtLm5hbWUpO1xcbiAgICAgICAgICAgIGFycmF5LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9jb21pY0NvbXBhdGlibGUudmlldyNhdXRvUGFnZSMjcmVhZFRoZW1lIz9wYXRoPVxcXCIraXRlbS5wYXRoLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogQ29uZmlnLmRlZl9WaWV3X1N0eWxlLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgcGF0aDogaXRlbS5wYXRoLFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGdldFRpdGxlMihpdGVtLm5hbWUpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgfVxcblxcbn0gZWxzZSB7XFxuICAgIGZvciAobGV0IGl0ZW0gb2YgbWhsaXN0KSB7XFxuICAgICAgICBsZXQgbmFtZSA9IGdldFRpdGxlMihpdGVtLm5hbWUpO1xcbiAgICAgICAgYXJyYXkucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCLnoa7orqTliKDpmaRbXFxcIiArIG5hbWUgKyBcXFwiXe+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G4gICAgICAgIGxldCBuYW1lID0gZ2V0VGl0bGUoaXRlbS5uYW1lKTtcXG4gICAgICAgIGFycmF5LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9Ob3ZlbE1haW5Cb2R5I2F1dG9QYWdlIyNyZWFkVGhlbWUjXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLnBhdGgsXFxuICAgICAgICAgICAgICAgIGRpclBhdGg6IHBhdGgsXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgY29sX3R5cGU6IENvbmZpZy5kZWZfVmlld19TdHlsZVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG59IGVsc2Uge1xcbiAgICBmb3IgKGxldCBpdGVtIG9mIGNoYXB0ZXJMaXN0KSB7XFxuICAgICAgICBsZXQgbmFtZSA9IGdldFRpdGxlKGl0ZW0ubmFtZSk7XFxuICAgICAgICBhcnJheS5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIuehruiupOWIoOmZpFtcXFwiICsgbmFtZSArIFxcXCJd77yfXFxcIikuY29uZmlybSgocGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAoRmlsZS5kZWxldGVGaWxlcyhwYXRoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG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AgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+a4hemZpOWujOaIkFxcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+a4hemZpOWksei0pVxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgZm9yIChsZXQgY2FjaGUgb2YgY2FjaGVEaXIpIHtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBjYWNoZS5uYW1lLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBcXFwi5aSn5bCP77yaXFxcIiArIEZpbGUuZ2V0RmlsZVNpemUoY2FjaGUucGF0aCkgKyBcXFwiXFxcXG7mj4/ov7DvvJpcXFwiICsgKGtub3duTGlzdC5nZXQoY2FjaGUubmFtZSkgfHwgXFxcIuacquefpeebruW9lVvpo47pmanmnKrnn6VdXFxcIiksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCLnoa7orqTmuIXpmaQgXFxcIiArIGNhY2hlLm5hbWUgKyBcXFwiID9cXFwiKS5jb25maXJtKGNsZWFuQ2FjaGUsIGNhY2hlLnBhdGgpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLlhajpg6jmuIXpmaQoXFxcIiArIEZpbGUuZ2V0RmlsZVNpemUoQ29uZmlnLmhvbWVQYXRoKSArIFxcXCIpXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgIHVybDogJChcXFwi56Gu6K6k5riF6Zmk5YWo6YOo57yT5a2Y5pWw5o2uP1xcXCIpLmNvbmZpcm0oY2xlYW5DYWNoZSwgQ29uZmlnLmhvbWVQYXRoKVxcbiAgICAgICAgfSk7XFxuICAgICAgICBicmVhaztcXG4gICAgY2FzZSBcXFwiZGVmYXVsdFBpY1xcXCI6XFxuICAgICAgICBzZXRQYWdlVGl0bGUoXFxcIum7mOiupOWwgemdonzorr7nva5cXFwiKTtcXG4gICAgICAgIGlmIChnZXRNeVZhcihcXFwiOmRlZmF1bHRQaWNCYWNrXFxcIikpIHtcXG4gICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwiOmRlZmF1bHRQaWNCYWNrXFxcIik7XFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuXFxuICAgICAgICBmdW5jdGlvbiBzZXREZWZhdWx0UGljKHVybCkge1xcbiAgICAgICAgICAgIGxldCBDb25maWcgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXCJjb25maWcuanNvblxcXCIsIDApIHx8IFxcXCJ7fVxcXCIpO1xcbiAgICAgICAgICAgIENvbmZpZy5kZWZfUGljID0gdXJsO1xcbiAgICAgICAgICAgIHNhdmVGaWxlKFxcXCJjb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KENvbmZpZyksIDApO1xcbiAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L+u5pS55oiQ5YqfXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBzdGFydCA9IDE7XFxuICAgICAgICBpZiAodHlwZW9mKE1ZX05BTUUpICE9PSBcXFwidW5kZWZpbmVkXFxcIiAmJiBNWV9OQU1FID09PSBcXFwi5ZeF6KeJ5rWP6KeI5ZmoXFxcIikge1xcbiAgICAgICAgICAgIHN0YXJ0ID0gNDtcXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAobGV0IGkgPSBzdGFydDsgaSA8PSA0OyBpKyspIHtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Zu+54mHXFxcIiArIGksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibW92aWVfM1xcXCIsXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXCJoaWtlcjovL2ltYWdlcy9ob21lX3BpY1xcXCIgKyBpLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoc2V0RGVmYXVsdFBpYywgXFxcImhpa2VyOi8vaW1hZ2VzL2hvbWVfcGljXFxcIiArIGkpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLoh6rlrprkuYninpVcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIixcXG4gICAgICAgICAgICB1cmw6ICQoW1xcXCLoh6rlrprkuYl1cmxcXFwiLCBcXFwi6YCJ5oup5paH5Lu26Lev5b6EXFxcIl0pLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gXFxcIuiHquWumuS5iXVybFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6L6T5YWl5Zu+54mH55qE6Lev5b6E5oiW6ICF6ZO+5o6lXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBDb25maWcgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXCJjb25maWcuanNvblxcXCIsIDApIHx8IFxcXCJ7fVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIENvbmZpZy5kZWZfUGljID0gaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcImNvbmZpZy5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoQ29uZmlnKSwgMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kv67mlLnmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcmVxdWlyZVVybCA9IFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBmaWxlU2VsZWN0ID0gcmVxdWlyZShyZXF1aXJlVXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmaWxlU2VsZWN0LmZpbGVTZWxlY3Rpb25Vcmkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IENvbmZpZyA9IEpTT04ucGFyc2UocmVhZEZpbGUoXFxcImNvbmZpZy5qc29uXFxcIiwgMCkgfHwgXFxcInt9XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIENvbmZpZy5kZWZfUGljID0gXFxcImZpbGU6Ly9cXFwiICsgUEFUSDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcImNvbmZpZy5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoQ29uZmlnKSwgMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCI6ZGVmYXVsdFBpY0JhY2tcXFwiLCBcXFwidHJ1ZVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kv67mlLnmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVVcmw6IHJlcXVpcmVVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZmlsZVR5cGU6IFxcXCIuanBnfC5qcGVnfC5naWZ8LnBuZ3wuc3ZnfC5ibXBcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2tUeXBlOiBcXFwiY29uZmlybVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWVtb3J5OiBcXFwic2VsZWN0UGF0aENhY2hlMlxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pO1xcbiAgICAgICAgYnJlYWs7XFxuICAgIGNhc2UgXFxcInJlcGxhY2VSdWxlXFxcIjpcXG4gICAgICAgIGlmIChNWV9QQVJBTVMuaXNSZWZyZXNoKSB7XFxuICAgICAgICAgICAgYWRkTGlzdGVuZXIoXFxcIm9uQ2xvc2VcXFwiLCAkLnRvU3RyaW5nKCgpID0+IHJlZnJlc2hQYWdlKCkpKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHNldFBhZ2VUaXRsZShcXFwi5pu/5o2i6KeE5YiZfOiuvue9rlxcXCIpO1xcbiAgICAgICAgbGV0IHJ1bGVMaXN0ID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFwicmVwbGFjZVJ1bGUuanNvblxcXCIpIHx8IFxcXCJbXVxcXCIpO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpd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G4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfM1xcXCJcXG4gICAgICAgIH0pO1xcblxcbiAgICAgICAgZnVuY3Rpb24gaW1wb3J0UnVsZShpc2JhY2spIHtcXG4gICAgICAgICAgICBpbnB1dCA9IHR5cGVvZiBQQVRIID09PSBcXFwidW5kZWZpbmVkXFxcIiA/IGlucHV0IDogUEFUSDtcXG4gICAgICAgICAgICBpbnB1dCA9IGlucHV0LnN0YXJ0c1dpdGgoXFxcImZpbGU6Ly9cXFwiKSA/IGlucHV0IDogXFxcImZpbGU6Ly9cXFwiICsgaW5wdXRcXG4gICAgICAgICAgICBsZXQgcnVsZVRleHQgPSByZXF1ZXN0KGlucHV0KTtcXG4gICAgICAgICAgICBpZiAoIXJ1bGVUZXh0KSByZXR1cm4gXFxcInRvYXN0Oi8v6I635Y+W5paH5Lu25Li656m6XFxcIjtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBsZXQgbmV3UnVsZUxpc3QgPSBKU09OLnBhcnNlKHJ1bGVUZXh0KTtcXG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVMaXN0ID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFwicmVwbGFjZVJ1bGUuanNvblxcXCIpIHx8IFxcXCJbXVxcXCIpO1xcbiAgICAgICAgICAgICAgICBsZXQgbmV3Q291bnQgPSAwLFxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlQ291bnQgPSAwO1xcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpIGluIG5ld1J1bGVMaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbmV3UnVsZSA9IG5ld1J1bGVMaXN0W2ldO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFuZXdSdWxlLmhhc093blByb3BlcnR5KFxcXCJyZXBsYWNlbWVudFxcXCIpIHx8ICFuZXdSdWxlLmhhc093blByb3BlcnR5KFxcXCJwYXR0ZXJuXFxcIikgfHwgIW5ld1J1bGUuaGFzT3duUHJvcGVydHkoXFxcIm5hbWVcXFwiKSB8fCAobmV3UnVsZS5zY29wZUNvbnRlbnQgPT09IHVuZGVmaW5lZCA/IGZhbHNlIDogIW5ld1J1bGUuc2NvcGVDb250ZW50KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkID0gbmV3UnVsZS5pZDtcXG4gICAgICAgICAgICAgICAgICAgIG5ld1J1bGUuaWQgPSBpZCB8fCBuZXcgRGF0ZSgpLmdldFRpbWUoKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpZEluZGV4ID0gcnVsZUxpc3QuZmluZEluZGV4KHJ1bGUgPT4gcnVsZS5pZCA9PT0gaWQpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlkSW5kZXggPiAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUNvdW50Kys7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcnVsZUxpc3Quc3BsaWNlKGlkSW5kZXgsIDEsIG5ld1J1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBuZXdDb3VudCsrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVMaXN0LnB1c2gobmV3UnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcInJlcGxhY2VSdWxlLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShydWxlTGlzdCkpO1xcbiAgICAgICAgICAgICAgICBpZiAoaXNiYWNrKSB7XFxuICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxvZyhcXFwiXFxcXG7ot6/lvoTvvJpcXFwiICsgaW5wdXQgKyBcXFwiXFxcXG7mgLvop4TliJnmlbDvvJpcXFwiICsgbmV3UnVsZUxpc3QubGVuZ3RoICsgXFxcIlxcXFxu5pu05paw6KeE5YiZIFxcXCIgKyB1cGRhdGVDb3VudCArIFxcXCIg5p2hXFxcXHTmlrDlop7op4TliJkgXFxcIiArIG5ld0NvdW50ICsgXFxcIiDmnaFcXFwiKTtcXG4gICAgICAgICAgICAgICAgdG9hc3QoXFxcIuWvvOWFpeaIkOWKn1xcXCIpO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgbG9nKGUudG9TdHJpbmcoKSk7XFxuICAgICAgICAgICAgICAgIGlmIChpc2JhY2spIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgdG9hc3QoXFxcIuWvvOWFpeWksei0pVxcXCIpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuWvvOWFpeinhOWImVxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKFtcXFwi5aSW6YOo5paH5Lu2XFxcIiwgXFxcIuWGhemDqOaWh+S7tlxcXCJdLCAxLCBcXFwi6KeE5YiZ5a+85YWlXFxcIikuc2VsZWN0KChpbXBvcnRSdWxlKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gXFxcIuWklumDqOaWh+S7tlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiZmlsZVNlbGVjdDovL1xcXCIgKyAkLnRvU3RyaW5nKGltcG9ydFJ1bGUpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlcXVpcmVVcmwgPSBcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZmlsZVNlbGVjdCA9IHJlcXVpcmUocmVxdWlyZVVybCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmlsZVNlbGVjdC5maWxlU2VsZWN0aW9uVXJpKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZyhpbXBvcnRSdWxlLCB0cnVlKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXF1aXJlVXJsOiByZXF1aXJlVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVUeXBlOiBcXFwiLmpzb25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2tUeXBlOiBcXFwiY29uZmlybVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWVtb3J5OiBcXFwic2VsZWN0UGF0aENhY2hlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBpbXBvcnRSdWxlKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfM1xcXCJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDAsIGxlbiA9IHJ1bGVMaXN0Lmxlbmd0aDsgaSA8IGxlbjsgaSsrKSB7XFxuICAgICAgICAgICAgbGV0IHJlcGxhY2VSdWxlID0gcnVsZUxpc3RbaV07XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogcmVwbGFjZVJ1bGUubmFtZSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFwiLlxcXCIgKyBpLFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6ZmkXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChpZCwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBydWxlTGlzdCA9IEpTT04ucGFyc2UocmVhZEZpbGUoXFxcInJlcGxhY2VSdWxlLmpzb25cXFwiKSB8fCBcXFwiW11cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBnID0gcnVsZUxpc3Quc3BsaWNlKGluZGV4LCAxKTtcXG5cXG4gICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkocnVsZUxpc3QpKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vZGVsZXRlSXRlbUJ5Q2xzKGlkICsgXFxcIi5cXFwiICsgaW5kZXgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIuWIoOmZpOaIkOWKn1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgaWQsIGkpLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXCIuXFxcIiArIGlcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzJcXFwiXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIue8lui+kVxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9lZGl0UmVwbGFjZVJ1bGUudmlldyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSMjbm9SZWZyZXNoIz9pbmRleD1cXFwiICsgaSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzJcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXCIuXFxcIiArIGlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFwiLlxcXCIgKyBpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlIFxcXCJjb250ZW50c1xcXCI6XFxuICAgICAgICBsZXQgZiA9IHJlcXVpcmUoXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFwiKTtcXG4gICAgICAgIHNldFBhZ2VUaXRsZShcXFwi55uu5b2V6K6+572ufOiuvue9rlxcXCIpO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi6YCJ5oup5paH5Lu25aS5XFxcIixcXG4gICAgICAgICAgICB1cmw6IEpTT04uc3RyaW5naWZ5KGYuZmlsZVNlbGVjdGlvblVyaSh7XFxuICAgICAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKChpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRhcmdldCA9IGZpbmRJdGVtKGlkKS5leHRyYTtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogT2JqZWN0LmFzc2lnbih0YXJnZXQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBQQVRIXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxuICAgICAgICAgICAgICAgIH0sIGlkKSxcXG4gICAgICAgICAgICAgICAgaW5pdGlhbFBhdGg6IENvbmZpZy5ob21lUGF0aCxcXG4gICAgICAgICAgICAgICAgcmVxdWlyZVVybDogXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFwiLFxcbiAgICAgICAgICAgICAgICBwYXR0ZXJuOiAxXFxuICAgICAgICAgICAgfSkpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiLFxcbiAgICAgICAgICAgIGRlc2M6IFxcXCLmlK/mjIFoaWtlcjovL2ZpbGVz6Lev5b6EKOivpeaTjeS9nOS4jeS8muWIneWni+WMluebruW9lSlcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogQ29uZmlnLmhvbWVQYXRoLFxcbiAgICAgICAgICAgICAgICBvbkNoYW5nZTogJC50b1N0cmluZygoaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKGlkLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgIH0sIGlkKSxcXG4gICAgICAgICAgICAgICAgaWQ6IGlkXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLnoa7orqRcXFwiLFxcbiAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGlucHV0ID0gZ2V0TXlWYXIoaWQsIGZpbmRJdGVtKGlkKS5leHRyYS5kZWZhdWx0VmFsdWUgfHwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICBjb25zdCBDb25maWcgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9Db25maWcuanNvblxcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQuc3RhcnRzV2l0aChcXFwiaGlrZXI6Ly9maWxlcy9cXFwiKSkgaW5wdXQgPSBnZXRQYXRoKGlucHV0KS5zbGljZSg3KTtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0LmVuZHNXaXRoKFxcXCIvXFxcIikpIGlucHV0PWlucHV0LnJlcGxhY2UoL1xcXFwvJC8sXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAoQ29uZmlnLmhvbWVQYXRoID09IGlucHV0KSByZXR1cm4gXFxcInRvYXN0Oi8v5bey57uP5piv5b2T5YmN55uu5b2VXFxcIjt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iO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBjb25zdCBib29rSW5mbyA9IE9iamVjdC5hc3NpZ24oe1xcbiAgICAgICAgICAgICAgICBzZWxlY3RlZDogW11cXG4gICAgICAgICAgICB9LCBKU09OLnBhcnNlKHJlcXVlc3QoXFxcImZpbGU6Ly9cXFwiICsgcGF0aCArIFxcXCIvYm9va0luZm8uanNvblxcXCIpIHx8IFxcXCJ7fVxcXCIpKTtcXG4gICAgICAgICAgICBib29rSW5mby5zZWxlY3RlZC5wdXNoKHJlcGxhY2VSdWxlLmlkKTtcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKCRpZCwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKXj1xcXCIgKyByZXBsYWNlUnVsZS5uYW1lLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaXNUcnVlOiB0cnVlLFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6ICRpZCxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJmaWxlOi8vXFxcIiArIHBhdGggKyBcXFwiL2Jvb2tJbmZvLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShib29rSW5mbykpO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICB9LCBpZCArIGksIHJlcGxhY2VSdWxlLCBNWV9QQVJBTVMucGF0aCksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCJcXG4gICAgfSk7XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi5YWz6ZetXFxcIixcXG4gICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoJGlkLCByZXBsYWNlUnVsZSwgcGF0aCkgPT4ge1xcbiAgICAgICAgICAgIGlmICghZmluZEl0ZW0oJGlkKS5leHRyYS5pc1RydWUpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3suWFs+mXrVxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGNvbnN0IGJvb2tJbmZvID0gT2JqZWN0LmFzc2lnbih7XFxuICAgICAgICAgICAgICAgIHNlbGVjdGVkOiBbXVxcbiAgICAgICAgICAgIH0sIEpTT04ucGFyc2UocmVxdWVzdChcXFwiZmlsZTovL1xcXCIgKyBwYXRoICsgXFxcIi9ib29rSW5mby5qc29uXFxcIikgfHwgXFxcInt9XFxcIikpO1xcbiAgICAgICAgICAgIGJvb2tJbmZvLnNlbGVjdGVkLnNwbGljZShib29rSW5mby5zZWxlY3RlZC5pbmRleE9mKHJlcGxhY2VSdWxlLmlkKSwgMSk7XFxuICAgICAgICAgICAgdXBkYXRlSXRlbSgkaWQsIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLil4tcXFwiICsgcmVwbGFjZVJ1bGUubmFtZSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlzVHJ1ZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBpZDogJGlkLFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB3cml0ZUZpbGUoXFxcImZpbGU6Ly9cXFwiICsgcGF0aCArIFxcXCIvYm9va0luZm8uanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGJvb2tJbmZvKSk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgIH0sIGlkICsgaSwgcmVwbGFjZVJ1bGUsIE1ZX1BBU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57SiXFxcIixcXG4gICAgICAgIHRpdGxlOiBcXFwi8J+UjVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcihcXFwic2VhcmNoS2V5QnlUeHRcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcignc2VhcmNoS2V5QnlUeHQnLGlucHV0KVxcXCJcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi5a+85YWl5bCP6K+0XFxcIixcXG4gICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIixcXG4gICAgICAgIHVybDogJChbXFxcIuezu+e7n+mAieaLqeWZqFxcXCIsIFxcXCLmtbfpmJTpgInmi6nlmahcXFwiXSwgMSwgXFxcIumAieaLqeWZqOexu+Wei1xcXCIpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgaWYgKGlucHV0ID09PSBcXFwi57O757uf6YCJ5oup5ZmoXFxcIikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImZpbGVTZWxlY3Q6Ly9cXFwiICsgJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoIS8oXFxcXC50eHR8LmVwdWIpJC9pLnRlc3QoaW5wdXQpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIumAieaLqeS6humUmeivr+eahOaWh+S7tuexu+Wei1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IENvbmZpZyA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0NvbmZpZy5qc29uXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZmlsZU1hdGNoID0gaW5wdXQubWF0Y2goL1xcXFwvKFteXFxcXC9dKj8pKFxcXFwudHh0fFxcXFwuZXB1YikkL2kpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IG5vdmVsTmFtZSA9IGZpbGVNYXRjaFsxXS5yZXBsYWNlKFxcXCJfZmlsZVNlbGVjdF9cXFwiLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdG9wYXRoID0gQ29uZmlnLmV4dGVybmFsSW1wb3J0UGF0aCArIG5vdmVsTmFtZSArIGZpbGVNYXRjaFsyXTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0b3BhdGhDYWNoZSA9IENvbmZpZy5jb250ZW50c0NhY2hlICsgbm92ZWxOYW1lICsgZmlsZU1hdGNoWzJdO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBhdGggPSBpbnB1dC5yZXBsYWNlKFxcXCJmaWxlOi8vXFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFwiZmlsZTovL1xcXCIgKyB0b3BhdGgpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlybSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5a+85YWl5o+Q56S6XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXFxcIuW3suWtmOWcqFtcXFwiICsgbm92ZWxOYW1lICsgXFxcIl3mmK/lkKbopobnm5Y/XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygocGF0aCwgdG9wYXRoLCB0b3BhdGhDYWNoZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoLCB0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgdG9wYXRoQ2FjaGUpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGhDYWNoZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcGF0aCwgdG9wYXRoLCB0b3BhdGhDYWNoZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5jb3B5RmlsZShwYXRoLCB0b3BhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgdG9wYXRoQ2FjaGUpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXModG9wYXRoQ2FjaGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIuWvvOWFpeaIkOWKn1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgbGV0IHJlcXVpcmVVcmwgPSBcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXCI7XFxuICAgICAgICAgICAgICAgIGxldCBmaWxlU2VsZWN0ID0gcmVxdWlyZShyZXF1aXJlVXJsKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZpbGVTZWxlY3QuZmlsZVNlbGVjdGlvblVyaSh7XFxuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgQ29uZmlnID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvQ29uZmlnLmpzb25cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZmlsZU1hdGNoID0gUEFUSC5tYXRjaCgvXFxcXC8oW15cXFxcL10qPykoXFxcXC50eHR8XFxcXC5lcHViKSQvaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5vdmVsTmFtZSA9IGZpbGVNYXRjaFsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdG9wYXRoID0gQ29uZmlnLmV4dGVybmFsSW1wb3J0UGF0aCArIG5vdmVsTmFtZSArIGZpbGVNYXRjaFsyXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdG9wYXRoQ2FjaGUgPSBDb25maWcuY29udGVudHNDYWNoZSArIG5vdmVsTmFtZSArIGZpbGVNYXRjaFsyXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGF0aCA9IFBBVEg7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFwiZmlsZTovL1xcXCIgKyB0b3BhdGgpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLlt7LlrZjlnKhbXFxcIiArIG5vdmVsTmFtZSArIFxcXCJd5piv5ZCm6KaG55uWP1xcXCIpLmNvbmZpcm0oKHBhdGgsIHRvcGF0aCwgdG9wYXRoQ2FjaGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCwgdHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIHRvcGF0aENhY2hlKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXModG9wYXRoQ2FjaGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHBhdGgsIHRvcGF0aCwgdG9wYXRoQ2FjaGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFwiZmlsZTovL1xcXCIgKyB0b3BhdGhDYWNoZSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXModG9wYXRoQ2FjaGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlVXJsOiByZXF1aXJlVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgZmlsZVR5cGU6IFxcXCIudHh0fC5lcHViXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIG9uQ2xpY2tUeXBlOiBcXFwiY29uZmlybVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBtZW1vcnk6IFxcXCJzZWxlY3RQYXRoQ2FjaGUxXFxcIlxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBsZXQgb3B0aW9ucyA9IFtcXFwi6ZiF6K+7XFxcIiwgXFxcIuWIhuS6q1xcXCIsIFxcXCLliKDpmaRcXFwiLCBcXFwi5omT5byA5pa55byPXFxcIl07XFxuXFxuICAgIGxldCBwYXR0ZXJuID0gZ2V0TXlWYXIoXFxcIjp0eHRQYXR0ZXJuXFxcIiwgb3B0aW9u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Iik7XFxuICAgICAgICBzd2l0Y2ggKHBhdHRlcm4pIHtcXG4gICAgICAgICAgICBjYXNlIFxcXCLliIbkuqtcXFwiOlxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInNoYXJlOi8vXFxcIiArIHBhdGg7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgXFxcIuWIoOmZpFxcXCI6XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLnoa7orqTliKDpmaRbXFxcIiArIG5hbWUgKyBcXFwiXVxcXCIpLmNvbmZpcm0oKHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoRmlsZS5kZWxldGVGaWxlcyhwYXRoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgcGF0aCArIFxcXCIuanNvblxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXMocGF0aCArIFxcXCIuanNvblxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3JlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShwYXRoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgcGF0aCk7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GNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBwYXRoOiBub3ZlbC5wYXRoLFxcbiAgICAgICAgICAgICAgICBpc0NhY2hlOiB0cnVlLFxcbiAgICAgICAgICAgICAgICB0aXRsZTogbm92ZWwubmFtZSxcXG4gICAgICAgICAgICAgICAgaWQ6IG5vdmVsLnBhdGgsXFxuICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5YiG5LqrXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiBKU09OLnN0cmluZ2lmeShcXFwic2hhcmU6Ly9cXFwiICsgbm92ZWwucGF0aClcXG4gICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLpmIXor7tcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAganM6IEpTT04uc3RyaW5naWZ5KCh0eXBlPT09XFxcIi50eHRcXFwiP1xcXCJoaWtlcjovL3BhZ2UvdHh0UGFyc2VyLnZpZXdcXFwiOlxcXCJoaWtlcjovL3BhZ2UvZXB1YlBhcnNlci52aWV3I2F1dG9DYWNoZSNcXFwiKStcXFwiP3J1bGU9XFxcIiArIE1ZX1JVTEUudGl0bGUpXFxuICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5omT5byA5pa55byPXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiBKU09OLnN0cmluZ2lmeShcXFwib3BlbkZpbGU6Ly9maWxlOi8vXFxcIiArIG5vdmVsLnBhdGgpXFxuICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6ZmkXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibG9uZ1ByZXNzLmpzXFxcIikuZGVsZXRlRmlsZUZvclR4dChwYXRoKVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbm92ZWwucGF0aClcXG4gICAgICAgICAgICAgICAgfV1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBpZiAoZmlsZXMubGVuZ3RoID09PSAwKSB7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLorr7nva5cXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9TZXR0aW5nLnZpZXcjbm9SZWZyZXNoIyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSNcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICB2ZXJzaW9uOiBNWV9SVUxFLnZlcnNpb25cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOW4ruWKqeKAneKAnVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2hlbHAudmlldyNub1JlZnJlc2gjI25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5Iz9rZXl3b3JkPXR4dFxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzJcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxoMSBzdHlsZT1cXFwidGV4dC1hbGlnbjogY2VudGVyO1xcXCI+5ZWl6YO95rKh5pyJ6IC2PC9oMT4nLFxcbiAgICAgICAgICAgIGNvbF90e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XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUocGF0aCk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgcGF0aCtcXFwiLmpzb25cXFwiKSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOmZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOlxcXCJsaW5lX2JsYW5rXFxcIlxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgIHNldFJlc3VsdChbe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxzdHJvbmc+55uu5b2V6Kej5p6Q5aSx6LSlKOmHjeaWsOino+aekCk8L3N0cm9uZz5cXFwiLmJpZygpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUocGF0aCk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgcGF0aCtcXFwiLmpzb25cXFwiKSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfV0pO1xcbiAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgIH1cXG5cXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIHNob3dMb2FkaW5nKFxcXCLmraPlnKjop6PmnpDnm67lvZVcXFwiKTtcXG4gICAgICAgIGxldCB0eHQgPSByZXF1ZXN0KHBhdGgsIHtcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgIC8vXFxcImNvbnRlbnQtdHlwZVxcXCI6IFxcXCJ0ZXh0L3BsYWluOyBjaGFyc3Q9XFxcIiArIGNoYXJzdFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGV0IHBhdHRlcm4gPSByZWdzLmdldFRvY1J1bGUodHh0KTtcXG4gICAgICAgIGlmICghcGF0dGVybikge1xcbiAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgc2V0UmVzdWx0KFt7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdPHN0cm9uZz7nm67lvZXop6PmnpDlpLHotKU8L3N0cm9uZz5cXFwiLmJpZygpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgYmFjayhmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfV0pO1xcbiAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBtYXRjaGVyID0gcGF0dGVybi5tYXRjaGVyKHR4dCk7XFxuICAgICAgICBsZXQgcG9pbnRlciA9IDA7XFxuICAgICAgICB3aGlsZSAobWF0Y2hlci5maW5kKCkpIHtcXG4gICAgICAgICAgICBsZXQgc3RhcnQgPSBtYXRjaGVyLnN0YXJ0KCk7XFxuICAgICAgICAgICAgbGV0IGVuZCA9IG1hdGNoZXIuZW5kKCk7XFxuICAgICAgICAgICAgbGV0IHQgPSBtYXRjaGVyLmdyb3VwKCk7XFxuICAgICAgICAgICAgaWYgKHBvaW50ZXIgPT09IDAgJiYgc3RhcnQgPiAzMCkge1xcbiAgICAgICAgICAgICAgICBoYXNQcmVmYWNlID0gdHJ1ZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgY2hhcHRlck5hbWVzLnB1c2godCk7XFxuICAgICAgICAgICAgaW50ZXJ2YWxzLnB1c2goW3BvaW50ZXIsIHN0YXJ0XSk7XFxuICAgICAgICAgICAgcG9pbnRlciA9IGVuZDtcXG4gICAgICAgIH1cXG4gICAgICAgIGludGVydmFscy5wdXNoKFtwb2ludGVyLCB0eHQubGVuZ3RoXSk7XFxuICAgICAgICBpZiAoaXNDYWNoZSkge1xcbiAgICAgICAgICAgIHdyaXRlRmlsZShjYWNoZVBhdGgsIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgY2hhcHRlck5hbWVzOiBjaGFwdGVyTmFtZXMsXFxuICAgICAgICAgICAgICAgIGludGVydmFsczogaW50ZXJ2YWxzLFxcbiAgICAgICAgICAgICAgICBoYXNQcmVmYWNlOiBoYXNQcmVmYWNlXFxuICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgfVxcbiAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgfVxcblxcblxcbiAgICBpZiAoaGFzUHJlZmFjZSkge1xcbiAgICAgICAgbGV0IGludGVydmFsID0gaW50ZXJ2YWxzWzBdO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi5bqP6KiAXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL1RYVFZpZXdlci52aWV3I2F1dG9QYWdlIyNyZWFkVGhlbWUjXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBjaGFwdGVyTmFtZTogXFxcIuW6j+iogFxcXCIsXFxuICAgICAgICAgICAgICAgIHN0YXJ0OiBpbnRlcnZhbFswXSxcXG4gICAgICAgICAgICAgICAgZW5kOiBpbnRlcnZhbFsxXSxcXG4gICAgICAgICAgICAgICAgcGF0aDogcGF0aCxcXG4gICAgICAgICAgICAgICAgY2hhcnN0OiBjaGFyc3RcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNoYXB0ZXJOYW1lcy5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgbGV0IG5hbWUgPSBjaGFwdGVyTmFtZXNbaV07XFxuICAgICAgICBsZXQgaW50ZXJ2YWwgPSBpbnRlcnZhbHNbaSArIDFdO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvVFhUVmlld2VyLnZpZXcjYXV0b1BhZ2UjI3JlYWRUaGVtZSNcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIHN0YXJ0OiBpbnRlcnZhbFswX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pLFxcbn0pO1xcblxcbmxheW91dC5wdXNoKHtcXG4gICAgdGl0bGU6IGNvbnRlbnQsXFxuICAgIGNvbF90eXBlOiAncmljaF90ZXh0JyxcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgIHRleHRTaXplOiAxOCxcXG4gICAgICAgIGNsaWNrOiB0cnVlXFxuICAgIH1cXG59KTtcXG5zZXRSZXN1bHQobGF5b3V0KTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIiNqLueroOiKguato+WImVwiLFwicGF0aFwiOlwicmVndWxhckNoYXB0ZXIuZlwiLFwicnVsZVwiOlwianM6XFxubGV0IHJ1bGVzID0gW3tcXG4gICAgICAgIFxcXCJpZFxcXCI6IC0xLFxcbiAgICAgICAgXFxcImVuYWJsZVxcXCI6IHRydWUsXFxuICAgICAgICBcXFwibmFtZVxcXCI6IFxcXCLnm67lvZUo5Y6756m655m9KVxcXCIsXFxuICAgICAgICBcXFwicnVsZVxcXCI6IFxcXCIoPzw9W+OAgFxcXFxcXFxcc10pKD865bqP56ugfOallOWtkHzmraPmlocoPyHlrox857uTKXznu4jnq6B85ZCO6K6wfOWwvuWjsHznlarlpJZ856ysP1xcXFxcXFxcc3swLDR9W1xcXFxcXFxcZOOAh+mbtuS4gOS6jOS4pOS4ieWbm+S6lOWFreS4g+WFq+S5neWNgeeZvuWNg+S4h+Wjuei0sOWPgeiChuS8jemZhuafkuaNjOeOluaLvuS9sOS7n10rP1xcXFxcXFxcc3swLDR9KD8656ugfOiKgig/Ieivvil85Y23fOmbhig/IVvlkIjlkoxdKSkpLnswLDMwfSRcXFwiLFxcbiAgICAgICAgXFxcImV4YW1wbGVcXFwiOiBcXFwi56ys5LiA56ugIOWBh+ijheesrOS4gOeroOWJjemdouacieepuueZveS9huaIkeS4jeimgVxcXCIsXFxuICAgICAgICBcXFwic2VyaWFsTnVtYmVyXFxcIjogMFxcbiAgICB9LFxcbiAgICB7XFxuICAgICAgICBcXFwiaW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IC0xMyxcXG4gICAgICAgIFxcXCJlbmFibGVcXFwiOiBmYWxzZSxcXG4gICAgICAgIFxcXCJuYW1lXFxcIjogXFxcIueJueauiuespuWPtyDmoIfpopgo5oiQ5a+5KVxcXCIsXFxuICAgICAgICBcXFwicnVsZVxcXCI6IFxcXCIoPzw9W1xcXFxcXFxcc+OAgF17MCw0fSkoPzpbXFxcXFxcXFxb44CI44CM44CO44CW44CU44CK77yI44CQXFxcXFxcXFwoXS57MSwzMH1bXFxcXFxcXFwp44CR77yJ44CL44CV44CX44CP44CN44CJXFxcXFxcXFxdXT98KD865YaF5a65fOaWh+eroCk/566A5LuLfOaWh+ahiHzliY3oqIB85bqP56ugfOallOWtkHzmraPmlocoPyHlrox857uTKXznu4jnq6B85ZCO6K6wfOWwvuWjsHznlarlpJYpWyDjgIBdezAsNH0kXFxcIixcXG4gICAgICAgIFxcXCJleGFtcGxlXFxcIjogXFxcIuOAjuWKoOS4quebtOinkuW8leWPt+abtOS4k+S4muOAj1xcXCIsXFxuICAgICAgICBcXFwic2VyaWFsTnVtYmVyXFxcIjogMTFcXG4gICAgfSxcXG4gICAge1xcbiAgICAgICAgXFxcImlkXFxcIjogLTE0LFxcbiAgICAgICAgXFxcImVuYWJsZVxcXCI6IHRydWUsXFxuICAgICAgICBcXFwibmFtZVxcXCI6IFxcXCLnibnmrornrKblj7cg5qCH6aKYKOWNleS4qilcXFwiLFxcbiAgICAgICAgXFxcInJ1bGVcXFwiOiBcXFwiKD88PVtcXFxcXFxcXHPjgIBdezAsNH0pKD86W+KYhuKYheKcpuKcp10uezEsMzB9fCg/OuWGheWuuXzmlofnq6ApP+eugOS7i3zmlofmoYh85YmN6KiAfOW6j+eroHzmpZTlrZB85q2j5paHKD8h5a6MfOe7kyl857uI56ugfOWQjuiusHzlsL7lo7B855Wq5aSWKVsg44CAXXswLDR9JFxcXCIsXFxuICAgICAgICBcXFwiZXhhbXBsZVxcXCI6IFxcXCLimIbjgIHmmYvmsZ/kvZzogIXmn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1xcbiAgICB9XFxuICAgIHBpY0xpc3QgPSBwaWNMaXN0LmZpbHRlcihwID0+IHApO1xcbiAgICBjb25zdCBMID0gcGljTGlzdC5sZW5ndGg7XFxuICAgIGlmIChMID09PSAwKSB7XFxuICAgICAgICB0b2FzdChcXFwi5Zu+54mH6ZO+5o6l5Li656m6XFxcIik7XFxuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIjzmvKvnlLvlm77niYfop6PmnpDplJnor6/vvJrlm77niYfpk77mjqXov5Tlm57kuLrnqbo+XFxcIik7XFxuICAgIH1cXG4gICAgaWYgKGluZm8uYm9va1RvcFBpYykge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgYm9va1RvcFBpYyA9IFRvb2wuaGlrZXJQaWMoaW5mby5ib29rVG9wUGljKTtcXG4gICAgICAgICAgICBUb29sLnBpY0Rvd25sb2FkKGJvb2tUb3BQaWNbMF0sIG1haW5QYXRoICsgaW5mby5ib29rTmFtZSArIFxcXCIuanBnXFxcIiwgYm9va1RvcFBpY1sxXSwgaW5mby5kZWNvZGUpO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyhcXFwiPOWwgemdouS4i+i9vemUmeivrz4gXFxcIiArIGUubWVzc2FnZSk7XFxuICAgICAgICB9XFxuICAgIH1cXG5cXG4gICAgbGV0IGVycm9yTnVtID0gMDtcXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBMOyBpKyspIHtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgbGV0IHBpYyA9IFRvb2wuaGlrZXJQaWMocGljTGlzdFtpXSk7XFxuICAgICAgICAgICAgVG9vbC5waWNEb3dubG9hZChwaWNbMF0sIGNoYXB0ZXJQYXRoICsgKGkgKyAxKSArIFxcXCIuanBnXFxcIiwgcGljWzFdLCBpbmZvLmRlY29kZSk7XFxuICAgICAgICAgICAgaWYgKGludGVycnVwdCAmJiBnZXRNeVZhcihNWV9JRC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ICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHJ1bGVzOiAkLnRvU3RyaW5nKChydWxlTmFtZSwgdHlwZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgYXJyMSA9IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInRpdGxlXFxcIjogcnVsZU5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNlYXJjaF91cmxcXFwiOiBcXFwiaGlrZXI6Ly9lbXB0eT9pc0FsbD0xJnNlYXJjaFRlcm1zPSoqJnR5cGU9XFxcIiArIHR5cGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNlYXJjaEZpbmRcXFwiOiBcXFwianM6JC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvU2VhcmNoLnZpZXc/cnVsZT0nK01ZX1JVTEUuX3RpdGxlKTtcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9XTtcXG4gICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShhcnIxKTtcXG4gICAgICAgICAgICB9LCBydWxlTmFtZSwgdHlwZSksXFxuICAgICAgICAgICAgLypkZWZhdWx0VmFsdWU6IGdldE15VmFyKCdzZWFyY2hLZXknLCAnJyksXFxuICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcignc2VhcmNoS2V5JyxpbnB1dClcXFwiKi9cXG4gICAgICAgIH1cXG4gICAgfSk7XFxuXFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi8J+nqVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImZsZXhfYnV0dG9uXFxcIixcXG4gICAgICAgIHVybDogJChjb2xUeXBlcy5tYXAodj0+dj09PWNvbF90eXBlP1xcXCLigJzigJxcXFwiK3YrXFxcIuKAneKAnVxcXCI6dikpLnNlbGVjdCgobmFtZSkgPT4ge1xcbiAgICAgICAgICAgIGlmKC/igJzigJwuKj/igJ3igJ0vLnRlc3QoaW5wdXQpKSByZXR1cm47XFxuICAgICAgICAgICAgc2V0SXRlbShcXFwiYm9va3JhY2s6Y29sX3R5cGVcXFwiLCBpbnB1dCk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgIH0pXFxuICAgIH0pO1xcbiAgICBmb3IgKGxldCBuYW1lIG9mIHJhbmtNZXRob2RzKSB7XFxuICAgICAgICBsZXQgYSA9IHJhbmtNZXRob2QgPT09IG5hbWU7XFxuICAgICAgICBsZXQgdGl0bGVhID0gYSA/IFxcXCLigJjigJhcXFwiICsgbmFtZSArIFxcXCLigJnigJlcXFwiIDogbmFtZTtcXG4gICAgICAgIGxldCB0aXRsZWIgPSBcXFwiXFxcIjtcXG4gICAgICAgIGlmIChhKSB7XFxuICAgICAgICAgICAgdGl0bGViID0gIXJhbmtJc1JldmVyc2UgPyBcXFwi4oaTXFxcIiA6IFxcXCLihpFcXFwiO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB0aXRsZWIgPSBcXFwi4oaVXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGVhICsgdGl0bGViLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiZmxleF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgobmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgcmFua01ldGhvZCA9IGdldEl0ZW0oXFxcImJvb2tyYWNrOnJhbmtNZXRob2RcXFwiLCBcXFwi57O757ufXFxcIik7XFxuICAgICAgICAgICAgICAgIGxldCByYW5rSXNSZXZlcnNlID0gZ2V0SXRlbShcXFwiYm9va3JhY2s6cmFua0lzUmV2ZXJzZVxcXCIsIFxcXCJcXFwiKTtcXG5cXG4gICAgICAgICAgICAgICAgaWYgKHJhbmtNZXRob2QgPT09IG5hbWUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChyYW5rSXNSZXZlcnNlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmFua0lzUmV2ZXJzZSA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByYW5rSXNSZXZlcnNlID0gXFxcIjFcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFwiYm9va3JhY2s6cmFua0lzUmV2ZXJzZVxcXCIsIHJhbmtJc1JldmVyc2UpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFwiYm9va3JhY2s6cmFua0lzUmV2ZXJzZVxcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcImJvb2tyYWNrOnJhbmtNZXRob2RcXFwiLCBuYW1lKTtcXG5cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgfSwgbmFtZSlcXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIGxldCByYW5rTWV0aG9kTWFwID0ge1xcbiAgICAgICAgXFxcIuezu+e7n1xcXCI6IFxcXCJcXFwiLFxcbiAgICAgICAgXFxcIuWkp+Wwj1xcXCI6IFxcXCJzaXplXFxcIixcXG4gICAgICAgIFxcXCLlkI3np7BcXFwiOiBcXFwibmFtZVxcXCIsXFxuICAgICAgICBcXFwi5pe26Ze0XFxcIjogXFxcInRpbWVcXFwiXFxuICAgIH07XFxu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tZSgpLFxcbiAgICAgICAgICAgIHBpY191cmw6IHBpYyxcXG4gICAgICAgICAgICB1cmw6IHBhZ2VVcmwgKyBcXFwiP3J1bGU9XFxcIiArIE1ZX1JVTEUudGl0bGUsXFxuICAgICAgICAgICAgY29sX3R5cGU6Y29sX3R5cGUsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsb25nUHJlc3MuanNcXFwiKS5kZWxldGVGaWxlRm9yQm9vayhwYXRoKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0uZ2V0UGF0aCgpKVxcbiAgICAgICAgICAgICAgICB9XSxcXG4gICAgICAgICAgICAgICAgaWQ6IGl0ZW0uZ2V0UGF0aCgpLFxcbiAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLmdldFBhdGgoKSxcXG4gICAgICAgICAgICAgICAgbmFtZTogaXRlbS5nZXROYW1lKClcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBpZiAocmFua0lzUmV2ZXJzZSkge1xcbiAgICAgICAgYm9va0xpc3QucmV2ZXJzZSgpO1xcbiAgICB9XFxuXFxuICAgIHNldFJlc3VsdChsYXlvdXQuY29uY2F0KGJvb2tMaXN0KSk7XFxufSkoKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIiNmLuaWh+S7tuaOkuW6j1wiLFwicGF0aFwiOlwiZmlsZVJhbmsuanNcIixcInJ1bGVcIjpcImpzOlxcbmNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcIkZpbGUuanNcXFwiKTtcXG5sZ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bmVkJykge1xcbiAgICAgICAgICAgIG51bWJlciA9IG51bTtcXG4gICAgICAgICAgICBpZiAoaSA9PT0gc3RyLmxlbmd0aCAtIDEpIHtcXG4gICAgICAgICAgICAgICAgc2VjdGlvbiArPSBudW1iZXI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBsZXQgdW5pdCA9IGNobk5hbWVWYWx1ZVtzdHJbaV1dLnZhbHVlO1xcbiAgICAgICAgICAgIHNlY1VuaXQgPSBjaG5OYW1lVmFsdWVbc3RyW2ldXS5zZWNVbml0O1xcbiAgICAgICAgICAgIGlmIChzZWNVbml0KSB7XFxuICAgICAgICAgICAgICAgIHNlY3Rpb24gPSAoc2VjdGlvbiArIG51bWJlcikgKiB1bml0O1xcbiAgICAgICAgICAgICAgICBydG4gKz0gc2VjdGlvbjtcXG4gICAgICAgICAgICAgICAgc2VjdGlvbiA9IDA7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgc2VjdGlvbiArPSAobnVtYmVyICogdW5pdCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIG51bWJlciA9IDA7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgcmV0dXJuIHJ0biArIHNlY3Rpb247XFxufVxcblxcbmZ1bmN0aW9uIG5hbWVDb21wYXJlKGEsIGIpIHtcXG4gICAgaWYgKGEgPT0gbnVsbCB8fCBiID09IG51bGwpXFxuICAgICAgICByZXR1cm4gYSA9PSBudWxsID8gYiA9PSBudWxsID8gMCA6IC0xIDogMTtcXG5cXG4gICAgYSA9IGEucmVwbGFjZSgvKFvpm7bkuIDkuozkuInlm5vkupTlha3kuIPlhavkuZ3ljYHnmb7ljYPkuIfkur9dKS9nLCBmdW5jdGlvbihtYXRjaCwgcDEsIHAyLCBwMywgb2Zmc2V0LCBzdHJpbmcpIHtcXG4gICAgICAgIC8vIHAxIGlzIG5vbmRpZ2l0cywgcDIgZGlnaXRz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9ICc5Jy5jaGFyQ29kZUF0KDApO1xcblxcbiAgICAgICAgaWYgKGMxID49IHplcm9DaGFyQ29kZSAmJiBjMSA8PSBuaW5lQ2hhckNvZGUgJiYgYzIgPj0gemVyb0NoYXJDb2RlICYmIGMyIDw9IG5pbmVDaGFyQ29kZSkge1xcbiAgICAgICAgICAgIGNtcCA9IG5ldyBqYXZhLm1hdGguQmlnSW50ZWdlcihzcGxpdDFbaV0pLmNvbXBhcmVUbyhuZXcgamF2YS5tYXRoLkJpZ0ludGVnZXIoc3BsaXQyW2ldKSk7XFxuICAgICAgICB9XFxuXFxuICAgICAgICBpZiAoY21wID09PSAwKSB7XFxuICAgICAgICAgICAgbGV0IHJlZ2V4ID0gL1thLXpBLVowLTldL1xcbiAgICAgICAgICAgIGxldCBzMSA9IFN0cmluZyhzcGxpdDFbaV0pXFxuICAgICAgICAgICAgbGV0IHMyID0gU3RyaW5nKHNwbGl0MltpXSlcXG4gICAgICAgICAgICBpZiAocmVnZXgudGVzdChzMSkgfHwgcmVnZXgudGVzdChzMikpIHtcXG4gICAgICAgICAgICAgICAgY21wID0gbmV3IGphdmEubGFuZy5TdHJpbmcoc3BsaXQxW2ldKS5jb21wYXJlVG8obmV3IGphdmEubGFuZy5TdHJpbmcoc3BsaXQyW2ldKSk7XFxuICAgICAgICAgICAgICAgIC8vIGNtcCA9IHMxLmxvY2FsZUNvbXBhcmUoczIsICdlbicpXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgY21wID0gczEubG9jYWxlQ29tcGFyZShzMiwgJ3poJylcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuXFxuICAgICAgICBpZiAoY21wICE9PSAwKSB7XFxuICAgICAgICAgICAgcmV0dXJuIGNtcDtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBsZXQgbGVuZ3RoQ21wID0gc3BsaXQxLmxlbmd0aCAtIHNwbGl0Mi5sZW5ndGg7XFxuICAgIC8vIGlmIChsZW5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gICAgICB0aXRsZTogXFxcIueugOS7i++8mjxicj7jgIDjgIBcXFwiICsgTVlfUEFSQU1TLnRleHQsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIixcXG5cXG4gICAgICAgICAgICB9XSk7XFxuICAgICAgICB9KSk7XFxuICAgIH1cXG4gICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLwn5Od566A5LuL77yaPGJyPuOAgOOAgFxcXCIrZGVzY3JpcHRpb24sXFxuICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHRleHQ6IHRkZXNjcmlwdGlvblxcbiAgICAgICAgfVxcbiAgICB9KTtcXG59XFxuLy9zZXRQYWdlVGl0bGUobWV0YS5maXJzdFRpdGxlKTtcXG5sYXlvdXQucHVzaCh7XFxuICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCIsXFxuICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxufSk7XFxubGV0IGNoYXB0ZXJzID0gZ2V0RXB1YkNoYXB0ZXJzKHBhdGgpO1xcbmZvciAobGV0IGl0IG9mIGNoYXB0ZXJzKSB7XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBpdC50aXRsZSxcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9lcHViVmlld2VyLnZpZXcjcmVhZFRoZW1lIyNhdXRvUGFnZSNcXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBocmVmOiBpdC51cmwsXFxuICAgICAgICAgICAgcGF0aDogcGF0aCxcXG4gICAgICAgICAgICB0aXRsZTogaXQudGl0bGVcXG4gICAgICAgIH1cXG4gICAgfSk7XFxufVxcbnNldFJlc3VsdChsYXlv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mua2iOWksSNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCJb6YeN5paw5byA5aeLXVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXFxcXFwifHzkuIvovb3mjqfliLZcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiYnJlYWtcXFxcXFxcIjtcXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIHB1dE15VmFyKE1ZX0lEICsgXFxcXFxcXCI6c3RhdHVzXFxcXFxcXCIsIFxcXFxcXFwiMlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgIHB1dExvZyhcXFxcXFxcIuS4i+i9veS7u+WKoVtcXFxcXFxcIiArIGluZm8uYm9va05hbWUgKyBcXFxcXFxcIl3lt7Llhajpg6jmiJDlip/lrozmiJBcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCJb6L+U5ZueXVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXFxcXFwifHzkuIvovb3mjqfliLZcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHRvYXN0KFxcXFxcXFwi5LiL6L295Lu75YqhW1xcXFxcXFwiICsgaW5mby5ib29rTmFtZSArIFxcXFxcXFwiXeW3suWujOaIkFxcXFxcXFwiKTtcXFxcbiAgICB9XFxcXG4gICAgb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5IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcGljID0gVG9vbC5oaWtlclBpYyh0YXNrUGFyYW0udXJsKTtcXFxcbiAgICAgICAgICAgICAgICBUb29sLnBpY0Rvd25sb2FkKHBpY1swXSwgdGFza1BhcmFtLmNoYXB0ZXJQYXRoICsgKHRhc2tQYXJhbS5pICsgMSkgKyBcXFxcXFxcIi5qcGdcXFxcXFxcIiwgcGljWzFdLCB0YXNrUGFyYW0uZGVjb2RlKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIodGFza1BhcmFtLk1ZX0lEICsgXFxcXFxcXCI6c3RhdHVzXFxcXFxcXCIsIFxcXFxcXFwiXFxcXFxcXCIpID09PSBcXFxcXFxcIjFcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTE7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGVycm9yTnVtID0gMDtcXFxcbiAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgICAgICBpZiAoaSA9PT0gOSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBlO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfVxcXFxuICAgICAgICByZXR1cm4gdGFza1BhcmFtLkNJRDtcXFxcbiAgICB9XFxcXG4gICAgbGV0IGNvdW50ID0gMDtcXFxcbiAgICBsZXQgdG90YWxDb3VudCA9IDA7XFxcXG4gICAgbGV0IHN1Y2Nlc3NDSUQgPSBbXTtcXFxcblxcXFxuICAgIGZ1bmN0aW9uIGxpc3RlbmVyKHBhcmFtLCBpZCwgZXJyb3IsIHJlc3VsdCkge1xcXFxuICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgdG90YWxDb3VudCsrO1xcXFxuXFxcXG4gICAgICAgICAgICBpZiAoZXJyb3IgIT0gbnVsbCkge1xcXFxuICAgICAgICAgICAgICAgIHB1dExvZyhcXFxcXFxcIltsaXN0ZW5lcl3kuIvovb3lpLHotKXvvJpcXFxcXFxcIiArIGlkICsgXFxcXFxcXCI8RVJST1JAIFxcXFxcXFwiICsgZXJyb3IgKyBcXFxcXFxcIj5cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHJlc3VsdCA9PT0gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICBwdXRMb2coXFxcXFxcXCJbbGlzdGVuZXJd5bey5YGc5q2i77yaXFxcXFxcXCIgKyBpZCk7XFxcXG4gICAgICAgICAgICAgICAgdG90YWxDb3VudCA9IHBhcmFtLnBpdkNvdW50O1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICBjb3VudCsrO1xcXFxuICAgICAgICAgICAgICAgIGxldCByYXRpbyA9ICgoY291bnQgLyBwYXJhbS5waXZDb3VudCkpLnRvRml4ZWQoNCk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHN0cmlwQ291bnQgPSBNYXRoLmNlaWwocmF0aW8gKiAxMCk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKHBhcmFtLnBpdkNvdW50ID09PSB0b3RhbENvdW50ICYmIHRvdGFsQ291bnQgPT09IGNvdW50KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHN1Y2Nlc3NDSUQucHVzaChwYXJhbS5DSUQpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5LiL6L296L+b5bqm77yaXFxcXFxcXCIgKyAoc3VjY2Vzc0NJRC5sZW5ndGgpICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBwYXJhbS50b3RhbCxcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcXFxcXCLigJzigJz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ICAgICAgIGNvbnRpbnVlO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHBpY0xpc3QgPSBwaWNMaXN0LmZpbHRlcihwID0+IHApO1xcXFxuICAgICAgICB2YXIgdGFza1RlYW0gPSBwaWNMaXN0Lm1hcCgodXJsLCBpKSA9PiAoe1xcXFxuICAgICAgICAgICAgZnVuYzogdGFzayxcXFxcbiAgICAgICAgICAgIGlkOiBpLFxcXFxuICAgICAgICAgICAgcGFyYW06IHtcXFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXFxcbiAgICAgICAgICAgICAgICBpOiBpLFxcXFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJQYXRoOiBjaGFwdGVyUGF0aCxcXFxcbiAgICAgICAgICAgICAgICBNWV9JRDogTVlfSUQsXFxcXG4gICAgICAgICAgICAgICAgZGVjb2RlOiBpbmZvLmRlY29kZVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KSk7XFxcXG4gICAgICAgIGJlKHRhc2tUZWFtLCB7XFxcXG4gICAgICAgICAgICBmdW5jOiBsaXN0ZW5lcixcXFxcbiAgICAgICAgICAgIHBhcmFtOiB7XFxcXG4gICAgICAgICAgICAgICAgcGl2Q291bnQ6IHBpY0xpc3QubGVuZ3RoLFxcXFxuICAgICAgICAgICAgICAgIHRvdGFsOiBjaGFwdGVyVGVhbS5sZW5ndGgsXFxcXG4gICAgICAgICAgICAgICAgb3JkZXI6IG9yZGVyLFxcXFxuICAgICAgICAgICAgICAgIENJRDogaXRlbS5DSUQsXFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0udGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgY2hhcHRlclBhdGg6IGNoYXB0ZXJQYXRoXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBpZiAoZ2V0TXlWYXIoTVlfSUQgKyBcXFxcXFxcIjpzdGF0dXNcXFxcXFxcIiwgXFxcXFxcXCJcXFx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dGV4dCA9IGFycmF5W2ldO1xcXFxuICAgICAgICAgICAgbGV0IGluZGV4ID0gdGV4dC5pbmRleE9mKHRhcmdldCk7XFxcXG4gICAgICAgICAgICBpZiAoaW5kZXggPT09IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBhcnJheVtpXSA9IHRleHQuc2xpY2UoMCwgaW5kZXgpO1xcXFxuICAgICAgICAgICAgYXJyYXlbaSArIDFdID0gdGV4dC5zbGljZShpbmRleCArIHRhcmdldC5sZW5ndGgpO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHJldHVybiBhcnJheTtcXFxcbiAgICB9LFxcXFxuICAgIGNodW5rKGFyciwgc2l6ZSkge1xcXFxuICAgICAgICB2YXIgcmVzdWx0ID0gW107XFxcXG4gICAgICAgIGZvciAodmFyIGkgPSAwLCBsZW4gPSBhcnIubGVuZ3RoOyBpIDwgbGVuOyBpICs9IHNpemUpIHtcXFxcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoKGFyci5zbGljZShpLCBpICsgc2l6ZSkpO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHJldHVybiByZXN1bHQ7XFxcXG4gICAgfSxcXFxcbiAgICBoaWtlclBpYyh1cmwpIHtcXFxcbiAgICAgICAgdmFyIGhlYWRlcnMgPSB7fTtcXFxcbiAgICAgICAgbGV0IHVybHMgPSB1cmwuc3BsaXQoXFxcXFxcXCJAXFxcXFxcXCIpO1xcXFxuICAgICAgICBsZXQgcGljVXJsID0gdXJscy5zaGlmdCgpO1xcXFxuICAgICAgICBsZXQgbGVuZ3RoID0gdXJscy5sZW5ndGg7XFxcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHtcXFxcbiAgICAgICAgICAgIGxldCBba2V5LCB2YWx1ZV0gPSB2LnNwbGl0KHVybHNbaV0sIFxcXFxcXFwiPVxcXFxcXFwiKTt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dHJpbmdcXFxcXFxcIiAmJiBkZWNpcGhlLmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgICAgIGxldCBpbnN0cmVhbTtcXFxcbiAgICAgICAgICAgIGxldCBvdXRzdHJlYW07XFxcXG4gICAgICAgICAgICBsZXQgZmlsZTtcXFxcbiAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgZmlsZSA9IG5ldyBqYXZhLmlvLkZpbGUocGF0aCk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGZpbGUuZXhpc3RzKCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBsZXQgZGlyID0gZmlsZS5nZXRQYXJlbnRGaWxlKCk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGRpciAhPSBudWxsICYmICFkaXIuZXhpc3RzKCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZGlyLm1rZGlycygpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpbnN0cmVhbSA9IGZldGNoKHVybCwge1xcXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcXFxuICAgICAgICAgICAgICAgICAgICBpbnB1dFN0cmVhbTogdHJ1ZVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgb3V0c3RyZWFtID0gbmV3IGphdmEuaW8uRmlsZU91dHB1dFN0cmVhbShwYXRoKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdCA9ICQuaGlrZXIuaW5wdXQsXFxcXG4gICAgICAgICAgICAgICAgICAgIGMgPSAkLmhpa2VyLnVybDtcXFxcbiAgICAgICAgICAgICAgICAkLmhpa2VyLmlucHV0ID0gaW5zdHJlYW07XFxcXG4gICAgICAgICAgICAgICAgJC5oaWtlci51cmwgPSB1cmw7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHBpY2luID0gKG5ldyBGdW5jdGlvbihcXFxcXFxcInJldHVybiBcXFxcXFxcIiArIGRlY2lwaGUpKSgpO1xcXFxuICAgICAgICAgICAgICAgICQuaGlrZXIuaW5wdXQgPSB0O1xcXFxuICAgICAgICAgICAgICAgICQuaGlrZXIudXJsID0gYztcXFxcbiAgICAgICAgICAgICAgICBsZXQgYnVmID0gamF2YS5sYW5nLnJlZmxlY3QuQXJyYXkubmV3SW5zdGFuY2UoamF2YS5sYW5nLkJ5dGUuVFlQRSwgMTAyNCk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGxlbjtcXFxcbiAgICAgICAgICAgICAgICB3aGlsZSAoKGxlbiA9IHBpY2luLnJlYWQoYnVmKSkgIT0gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgb3V0c3RyZWFtLndyaXRlKGJ1ZiwgMCwgbGVuKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgY2xvc2VNZShpbnN0cmVhbSk7XFxcXG4gICAgICAgICAgICAgICAgY2xvc2VNZShvdXRzdHJlYW0pO1xcXFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgIGNsb3NlTWUoaW5zdHJlYW0pO1xcXFxuICAgICAgICAgICAgICAgIGNsb3NlTWUob3V0c3RyZWFtKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoZmlsZSBpbnN0YW5jZW9mIGphdmEuaW8uRmlsZSAmJiBmaWxlLmV4aXN0cygpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZpbGUuZGVsZXRlKCk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGxvZyhcXFxcXFxcIjzop6Plr4bkuIvovb1FcnJvcj5cXFxcXFxcIiArIGUudG9TdHJpbmcoKSlcXFxcbiAgICAgICAgICAgICAgICB0aHJvdyBlO1xcXFxuICAgICAgICAgICAgfSBm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FxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEZpbGUuZGVsZXRlRmlsZXMocGF0aCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFxcXFxcIi50Z251bVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WIoOmZpOWksei0pVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0LnBhdGgpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vcGFnZS9Cb29rcmFjay52aWV3P3J1bGU95pys5Zyw6LWE5rqQ566h55CGJnJ1bGVOYW1lPVxcXFxcXFwiK2l0Lm5hbWUrXFxcXFxcXCImdHlwZT1cXFxcXFxcIit0eXBlO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSwgaXQsIHR5cGUpXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogaXQubmFtZSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJzY3JvbGxfYnV0dG9uXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoaSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiLnRnbnVtXFxcXFxcXCIsIGkpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSwgaSksXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbiAgICBsZXQgcGF0aCA9IHRhZ1t0Z251bV0ucGF0aDtcXFxcbiAgICBsZXQgbWhsaXN0ID0gRmlsZS5nZXRGaWxlUGF0aChwYXRoLCBcXFxcXFxcImRpclxcXFxcXFwiKTtcXFxcblxcXFxuICAgIGlmIChtaGxpc3QubGVuZ3RoID09PSAwKSB7XFxcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuKAnOKAnOKAneKAnVxcXFxcXFwiICsgXFxcXFxcXCLllaXpg73msqHmnInogLZcXFxcXFxcIi5iaWcoKSxcXFxcbiAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0X2NlbnRlcl8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgf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XFxcXCIuanBnXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwicGljczovL1xcXFxcXFwiICsgcGljbGlzdC5qb2luKFxcXFxcXFwiJiZcXFxcXFxcIik7XFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBmb3IgKGxldCBpdGVtIG9mIG1obGlzdCkge1xcXFxuICAgICAgICAgICAgbGV0IHRpdGxlID0gZ2V0VGl0bGUoaXRlbS5uYW1lKTtcXFxcbiAgICAgICAgICAgIGFycmF5LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6IGl0ZW0ucGF0aCArIGxhenksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IENvbmZpZy5kZWZfVmlld19TdHlsZSxcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9XFxcXG4gICAgfSBlbHNlIHtcXFxcbiAgICAgICAgZm9yIChsZXQgaXRlbSBvZiBtaGxpc3QpIHtcXFxcbiAgICAgICAgICAgIGxldCB0aXRsZSA9IGdldFRpdGxlKGl0ZW0ubmFtZSk7XFxcXG4gICAgICAgICAgICBhcnJheS5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vcGFnZS9jb21pY0NvbXBhdGlibGUudmlldyNhdXRvUGFnZSMjcmVhZFRoZW1lIz9wYXRoPVxcXFxcXFwiK2l0ZW0ucGF0aCxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogQ29uZmlnLmRlZl9WaWV3X1N0eWxlLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHBhdGg6IGl0ZW0ucGF0aCxcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGdldFRpdGxlMihpdGVtL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ICAgICAgICAgICAgICAgIGRpclBhdGg6IHBhdGgsXFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxcXG4gICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IENvbmZpZy5kZWZfVmlld19TdHlsZVxcXFxuICAgICAgICB9KTtcXFxcbiAgICB9XFxcXG59IGVsc2Uge1xcXFxuICAgIGZvciAobGV0IGl0ZW0gb2YgY2hhcHRlckxpc3QpIHtcXFxcbiAgICAgICAgbGV0IG5hbWUgPSBnZXRUaXRsZShpdGVtLm5hbWUpO1xcXFxuICAgICAgICBhcnJheS5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcXFxuICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwi56Gu6K6k5Yig6ZmkW1xcXFxcXFwiICsgbmFtZSArIFxcXFxcXFwiXe+8n1xcXFxcXFwiKS5jb25maXJtKChwYXRoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChGaWxlLmRlbGV0ZUZpbGVzKHBhdGgpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WIoOmZpOaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSwgaXRlbS5wYXRoKSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBDb25maWcuZGVmX1Zp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WumuS5iXVybFxcXFxcXFwiLCBcXFxcXFxcIumAieaLqeaWh+S7tui3r+W+hFxcXFxcXFwiXSkuc2VsZWN0KCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT09IFxcXFxcXFwi6Ieq5a6a5LmJdXJsXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcXFxcXCJcXFxcXFxcIiwgXFxcXFxcXCLovpPlhaXlm77niYfnmoTot6/lvoTmiJbogIXpk77mjqVcXFxcXFxcIikuaW5wdXQoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IENvbmZpZyA9IEpTT04ucGFyc2UocmVhZEZpbGUoXFxcXFxcXCJjb25maWcuanNvblxcXFxcXFwiLCAwKSB8fCBcXFxcXFxcInt9XFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgQ29uZmlnLmRlZl9QaWMgPSBpbnB1dDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXFxcXFwiY29uZmlnLmpzb25cXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkoQ29uZmlnKSwgMCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgcmVxdWlyZVVybCA9IFxcXFxcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgZmlsZVNlbGVjdCA9IHJlcXVpcmUocmVxdWlyZVVybCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmaWxlU2VsZWN0LmZpbGVTZWxlY3Rpb25Vcmkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBDb25maWcgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXFxcXFwiY29uZmlnLmpzb25cXFxcXFxcIiwgMCkgfHwgXFxcXFxcXCJ7fVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDb25maWcuZGVmX1BpYyA9IFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgUEFUSDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFxcXFxcImNvbmZpZy5qc29uXFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KENvbmZpZyksIDApO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiOmRlZmF1bHRQaWNCYWNrXFxcXFxcXCIsIFxcXFxcXFwidHJ1ZVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/kv67mlLnmiJDlip9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZVVybDogcmVxdWlyZVVybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVUeXBlOiBcXFxcXFxcIi5qcGd8LmpwZWd8LmdpZnwucG5nfC5zdmd8LmJtcFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DbGlja1R5cGU6IFxcXFxcXFwiY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XFxcXFwiKSB8fCAhbmV3UnVsZS5oYXNPd25Qcm9wZXJ0eShcXFxcXFxcIm5hbWVcXFxcXFxcIikgfHwgKG5ld1J1bGUuc2NvcGVDb250ZW50ID09PSB1bmRlZmluZWQgPyBmYWxzZSA6ICFuZXdSdWxlLnNjb3BlQ29udGVudCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpZCA9IG5ld1J1bGUuaWQ7XFxcXG4gICAgICAgICAgICAgICAgICAgIG5ld1J1bGUuaWQgPSBpZCB8fCBuZXcgRGF0ZSgpLmdldFRpbWUoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkSW5kZXggPSBydWxlTGlzdC5maW5kSW5kZXgocnVsZSA9PiBydWxlLmlkID09PSBpZCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpZEluZGV4ID4gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUNvdW50Kys7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBydWxlTGlzdC5zcGxpY2UoaWRJbmRleCwgMSwgbmV3UnVsZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBuZXdDb3VudCsrO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcnVsZUxpc3QucHVzaChuZXdSdWxlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFxcXFxcInJlcGxhY2VSdWxlLmpzb25cXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkocnVsZUxpc3QpKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoaXNiYWNrKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGJ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ID0+IHtcXFxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT09IFxcXFxcXFwi5aSW6YOo5paH5Lu2XFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiZmlsZVNlbGVjdDovL1xcXFxcXFwiICsgJC50b1N0cmluZyhpbXBvcnRSdWxlKTtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgcmVxdWlyZVVybCA9IFxcXFxcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgZmlsZVNlbGVjdCA9IHJlcXVpcmUocmVxdWlyZVVybCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmaWxlU2VsZWN0LmZpbGVTZWxlY3Rpb25Vcmkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoaW1wb3J0UnVsZSwgdHJ1ZSksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXF1aXJlVXJsOiByZXF1aXJlVXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZmlsZVR5cGU6IFxcXFxcXFwiLmpzb25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2tUeXBlOiBcXFxcXFxcImNvbmZpcm1cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lbW9yeTogXFxcXFxcXCJzZWxlY3RQYXRoQ2FjaGVcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9LCBpbXBvcnRSdWxlKSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfM1xcXFxcXFwiXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJsaW5lX2JsYW5rXFxcXFxcXCJcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGZvciAobGV0IGkgPSAwLCBsZW4gPSBydWxlTGlzdC5sZW5ndGg7IGkgPCBsZW47IGkrKykge1xcXFxuICAgICAgICAgICAgbGV0IHJlcGxhY2VSdWxlID0gcnVsZUxpc3RbaV07XFxcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHJlcGxhY2VSdWxlLm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcXFxcXCIuXFxcXFxcXCIgKyBpLFxcXFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLliKDpmaRcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZSgoaWQsIGluZGV4KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBydWxlTGlzdCA9IEpTT04ucGFyc2UocmVhZEZpbGUoXFxcXFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcXFxcXCIpIHx8IFxcXFxcXFwiW11cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBnID0gcnVsZUxpc3Quc3BsaWNlKGluZGV4LCAxKTtcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFxcXFxcInJlcGxhY2VSdWxlLmpzb25cXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkocnVsZUxpc3QpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgLy9kZWxldGVJdGVtQnlDbHMoaWQgKyBcXFxcXFxcIi5cXFxcXFxcIiArIGluZGV4KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcXFxuICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFxcXFxcIuWIoOmZpOaIkOWKn1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIH0sIGlkLCBpKSxcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcXFxcXCIuXFxcXFxcXCIgKyBpXFxcXG4gICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0XzJcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi57yW6L6RXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vcGFnZS9lZGl0UmVwbGFjZVJ1bGUudmlldyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSMjbm9SZWZyZXNoIz9pbmRleD1cXFxcXFxcIiArIGksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8yXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXFxcXFwiLlxcXFxcXFwiICsgaVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImxpbmVfYmxhbmtcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcXFxcXCIuXFxcXFxcXCIgKyBpXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgYnJlYWs7XFxcXG4gICAgY2FzZSBcXFxcXFxcImNvbnRlbnRzXFxcXFxcXCI6XFxcXG4gICAgICAgIGxldCBmID0gcmVxdWlyZShcXFxcXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFxcXFxcIik7XFxcXG4gICAgICAgIHNldFBhZ2VUaXRsZShcXFxcXFxcIuebruW9leiuvue9rnzorr7nva5cXFxcXFxcIik7XFxcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIumAieaLqeaWh+S7tuWkuVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgdXJsOiBKU09OLnN0cmluZ2lmeShmLmZpbGVTZWxlY3Rpb25Vcmkoe1xcXFxuICAgICAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKChpZCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGFyZ2V0ID0gZmluZEl0ZW0oaWQpLmV4dHJhO1xcXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKGlkLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogT2JqZWN0LmFzc2lnbih0YXJnZXQsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IFBBVEhcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcXFxcbiAgICAgICAgICAgICAgICB9LCBpZCksXFxcXG4gICAgICAgICAgICAgICAgaW5pdGlhbFBhdGg6IENvbmZpZy5ob21lUGF0aCxcXFxcbiAgICAgICAgICAgICAgICByZXF1aXJlVXJsOiBcXFxcXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBwYXR0ZXJuOiAxXFxcXG4gICAgICAgICAgICB9KSksXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJpbnB1dFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgZGVzYzogXFxcXFxcXCLmlK/mjIFoaWtlcjovL2ZpbGVz6Lev5b6EKOivpeaTjeS9nOS4jeS8muWIneWni+WMluebruW9lSlcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBDb25maWcuaG9tZVBhdGgsXFxcXG4gICAgICAgICAgICAgICAgb25DaGFuZ2U6ICQudG9TdHJpbmcoKGlkKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKGlkLCBpbnB1dCk7XFxcXG4gICAgICAgICAgICAgICAgfSwgaWQpLFxcXFxuICAgICAgICAgICAgICAgIGlkOiBpZFxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwibGluZV9ibGFua1xcXFxcXFwiXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLnoa7orqRcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogJChcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKChpZCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCBpbnB1dCA9IGdldE15VmFyKGlkLCBmaW5kSXRlbShpZCkuZXh0cmEuZGVmYXVsdFZhbHVlIHx8IFxcXFxcXFwiXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIGNvbnN0IENvbmZpZyA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9Db25maWcuanNvblxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQuc3RhcnRzV2l0aChcXFxcXFxcImhpa2VyOi8vZmlsZXMvXFxcXFxcXCIpKSBpbnB1dCA9IGdldFBhdGgoaW5wdXQpLnNsaWNlKDcpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dC5lbmRzV2l0aChcXFxcXFxcIi9cXFxcXFxcIikpIGlucHV0PWlucHV0LnJlcGxhY2UoL1xcXFxcXFxcLyQvLFxcXFxcXFwiXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChDb25maWcuaG9tZVBhdGggPT0gaW5wdXQpIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5bey57uP5piv5b2T5YmN55uu5b2VXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgQ29uZmlnID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXF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0+IHtcXFxcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gXFxcXFxcXCLns7vnu5/pgInmi6nlmahcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImZpbGVTZWxlY3Q6Ly9cXFxcXFxcIiArICQudG9TdHJpbmcoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoIS8oXFxcXFxcXFwudHh0fC5lcHViKSQvaS50ZXN0KGlucHV0KSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcXFxcXCLpgInmi6nkuobplJnor6/nmoTmlofku7bnsbvlnotcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgQ29uZmlnID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0NvbmZpZy5qc29uXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgZmlsZU1hdGNoID0gaW5wdXQubWF0Y2goL1xcXFxcXFxcLyhbXlxcXFxcXFxcL10qPykoXFxcXFxcXFwudHh0fFxcXFxcXFxcLmVwdWIpJC9pKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IG5vdmVsTmFtZSA9IGZpbGVNYXRjaFsxXS5yZXBsYWNlKFxcXFxcXFwiX2ZpbGVTZWxlY3RfXFxcXFxcXCIsIFxcXFxcXFwiXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdG9wYXRoID0gQ29uZmlnLmV4dGVybmFsSW1wb3J0UGF0aCArIG5vdmVsTmFtZSArIGZpbGVNYXRjaFsyXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRvcGF0aENhY2hlID0gQ29uZmlnLmNvbnRlbnRzQ2FjaGUgKyBub3ZlbE5hbWUgKyBmaWxlTWF0Y2hbMl07XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBwYXRoID0gaW5wdXQucmVwbGFjZShcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiwgXFxcXFxcXCJcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIgKyB0b3BhdGgpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25maXJtKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLlr7zlhaXmj5DnpLpcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBcXFxcXFxcIuW3suWtmOWcqFtcXFxcXFxcIiArIG5vdmVsTmFtZSArIFxcXFxcXFwiXeaYr+WQpuimhueblj9cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKChwYXRoLCB0b3BhdGgsIHRvcGF0aENhY2hlKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5jb3B5RmlsZShwYXRoLCB0b3BhdGgsIHRydWUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgdG9wYXRoQ2FjaGUpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aENhY2hlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcGF0aCwgdG9wYXRoLCB0b3BhdGhDYWNoZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5jb3B5RmlsZShwYXRoLCB0b3BhdGgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiArIHRvcGF0aENhY2hlKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXModG9wYXRoQ2FjaGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcXFxcXCLlr7zlhaXmiJDlip9cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHJlcXVpcmVVcmwgPSBcXFxcXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICBsZXQgZmlsZVNlbGVjdCA9IHJlcXVpcmUocmVxdWlyZVVybCk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZpbGVTZWxlY3QuZmlsZVNlbGVjdGlvblVyaSh7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IENvbmZpZyA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9Db25maWcuanNvblxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBmaWxlTWF0Y2ggPSBQQVRILm1hdGNoKC9cXFxcXFxcXC8oW15cXFxcXFxcXC9dKj8pKFxcXFxcXFxcLnR4dHxcXFxcXFxcXC5lcHViKSQvaSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbm92ZWxOYW1lID0gZmlsZU1hdGNoWzFdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRvcGF0aCA9IENvbmZpZy5leHRlcm5hbEltcG9ydFBhdGggKyBub3ZlbE5hbWUgKyBmaWxlTWF0Y2hbMl07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdG9wYXRoQ2FjaGUgPSBDb25maWcuY29udGVudHNDYWNoZSArIG5vdmVsTmFtZSArIGZpbGVNYXRjaFsyXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYXRoID0gUEFUSDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIgKyB0b3BhdGgpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcXFxcXCLlt7LlrZjlnKhbXFxcXFxcXCIgKyBub3ZlbE5hbWUgKyBcXFxcXFxcIl3mmK/lkKbopobnm5Y/XFxcXFxcXCIpLmNvbmZpcm0oKHBhdGgsIHRvcGF0aCwgdG9wYXRoQ2FjaGUpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCwgdHJ1ZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIgKyB0b3BhdGhDYWNoZSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXModG9wYXRoQ2FjaGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/lr7zlhaXmiJDlip9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBwYXRoLCB0b3BhdGgsIHRvcGF0aENhY2hlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgdG9wYXRoQ2FjaGUpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXModG9wYXRoQ2FjaGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/lr7zlhaXmiJDlip9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlcXVpcmVVcmw6IHJlcXVpcmVVcmwsXFxcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVUeXBlOiBcXFxcXFxcIi50eHR8LmVwdWJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgb25DbGlja1R5cGU6IFxcXFxcXFwiY29uZmlybVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBtZW1vcnk6IFxcXFxcXFwic2VsZWN0UGF0aENhY2hlMVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pLFxcXFxuICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgIH1cXFxcbiAgICB9KTtcXFxcbiAgICBsZXQgb3B0aW9ucyA9IFtcXFxcXFxcIumYheivu1xcXFxcXFwiLCBcXFxcXFxcIuWIhuS6q1xcXFxcXFwiLCBcXFxcXFxcIuWIoOmZpFxcXFxcXFwiLCBcXFxcXFxcIuaJk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iLmpzb25cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3JlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhdGgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WIoOmZpOaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liKDpmaTlpLHotKVcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0sIHBhdGgpO1xcXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgY2FzZSBcXFxcXFxcIumYheivu1xcXFxcXFwiOlxcXFxuICAgICAgICAgICAgICAgIHJldHVybiAodHlwZT09PVxcXFxcXFwiLnR4dFxcXFxcXFwiP1xcXFxcXFwiaGlrZXI6Ly9wYWdlL3R4dFBhcnNlci52aWV3XFxcXFxcXCI6XFxcXFxcXCJoaWtlcjovL3BhZ2UvZXB1YlBhcnNlci52aWV3I2F1dG9DYWNoZSNcXFxcXFxcIikrXFxcXFxcXCI/cnVsZT1cXFxcXFxcIiArIE1ZX1JVTEUudGl0bGU7XFxcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICBjYXNlIFxcXFxcXFwi5omT5byA5pa55byPXFxcXFxcXCI6XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwib3BlbkZpbGU6Ly9maWxlOi8vXFxcXFxcXCIgKyBwYXRoO1xcXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxuXFxcXG4gICAgZm9yI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ic2hhcmU6Ly9cXFxcXFxcIiArIG5vdmVsLnBhdGgpXFxcXG4gICAgICAgICAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLpmIXor7tcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAganM6IEpTT04uc3RyaW5naWZ5KCh0eXBlPT09XFxcXFxcXCIudHh0XFxcXFxcXCI/XFxcXFxcXCJoaWtlcjovL3BhZ2UvdHh0UGFyc2VyLnZpZXdcXFxcXFxcIjpcXFxcXFxcImhpa2VyOi8vcGFnZS9lcHViUGFyc2VyLnZpZXcjYXV0b0NhY2hlI1xcXFxcXFwiKStcXFxcXFxcIj9ydWxlPVxcXFxcXFwiICsgTVlfUlVMRS50aXRsZSlcXFxcbiAgICAgICAgICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuaJk+W8gOaWueW8j1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBqczogSlNPTi5zdHJpbmdpZnkoXFxcXFxcXCJvcGVuRmlsZTovL2ZpbGU6Ly9cXFxcXFxcIiArIG5vdmVsLnBhdGgpXFxcXG4gICAgICAgICAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLliKDpmaRcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHBhdGgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcXFxcXCJsb25nUHJlc3MuanNcXFxcXFxcIikuZGVsZXRlRmlsZUZvclR4dChwYXRoKVxcXFxuICAgICAgICAgICAgICAgICAgICB9LCBub3ZlbC5wYXRoKVxcXFxuICAgICAgICAgICAgICAgIH1dXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pO1xcXFxuICAgIH1cXFxcbiAgICBpZiAoZmlsZ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l0bGU6IFxcXFxcXFwi6YeN5paw6Kej5p6Q55uu5b2VXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF9jZW50ZXJfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKChwYXRoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUocGF0aCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICB9LCBwYXRoK1xcXFxcXFwiLmpzb25cXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6ZmFsc2VcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTpcXFxcXFxcImxpbmVfYmxhbmtcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcXFxuICAgICAgICAgICAgc2V0UmVzdWx0KFt7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi4oCc4oCc4oCd4oCdPHN0cm9uZz7nm67lvZXop6PmnpDlpLHotKUo6YeN5paw6Kej5p6QKTwvc3Ryb25nPlxcXFxcXFwiLmJpZygpLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZSgocGF0aCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKHBhdGgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSwgcGF0aCtcXFxcXFxcIi5qc29uXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1dKTtcXFxcbiAgICAgICAgICAgIHJldHVybjtcXFxcbiAgICAgICAgfVxcXFxuXFxcXG4gICAgfSBlbHNlIHtcXFxcbiAgICAgICAgc2hvd0xvYWRpbmcoXFxcXFxcXCLmraPlnKjop6PmnpDnm67lvZVcXFxcXFxcIik7XFxcXG4gICAgICAgIGxldCB0eHQgPSByZXF1ZXN0KHBhdGgsIHtcXFxcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAvL1xcXFxcXFwiY29udGVudC10eXBlXFxcXFxcXCI6IFxcXFxcXFwidGV4dC9wbGFpbjsgY2hhcnN0PVxcXFxcXFwiICsgY2hhcnN0XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBsZXQgcGF0dGVybiA9IHJlZ3MuZ2V0VG9jUnVsZSh0eHQpO1xcXFxuICAgICAgICBpZiAoIXBhdHRlcm4pIHtcXFxcbiAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxcXG4gICAgICAgICAgICBzZXRSZXN1bHQoW3tcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLigJzigJzigJ3igJ08c3Ryb25nPuebruW9leino+aekOWksei0pTwvc3Ryb25nPlxcXFxcXFwiLmJpZygpLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZSgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfV0pO1xcXFxuICAgICAgICAgICAgcmV0dXJuO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGxldCBtYXRjaGVyID0gcGF0dGVybi5tYXRjaGVyKHR4dCk7XFxcXG4gICAgICAgIGxldCBwb2ludGVyID0gMDtcXFxcbiAgICAgICAgd2hpbGUgKG1hdGNoZXIuZmluZCgpKSB7XFxcXG4gICAgICAgICAgICBsZXQgc3RhcnQgPSBtYXRjaGVyLnN0YXJ0KCk7XFxcXG4gICAgICAgICAgICBsZXQgZW5kID0gbWF0Y2hlci5lbmQoKTtcXFxcbiAgICAgICAgICAgIGxldCB0ID0gbWF0Y2hlci5ncm91cCgpO1xcXFxuICAgICAgICAgICAgaWYgKHBvaW50ZXIgPT09IDAgJiYgc3RhcnQgPiAzMCkge1xcXFxuICAgICAgICAgICAgICAgIGhhc1ByZWZhY2UgPSB0cnVlO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAg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XG4gICAgICAgICAgICAgICAgc3RhcnQ6IGludGVydmFsWzBdLFxcXFxuICAgICAgICAgICAgICAgIGVuZDogaW50ZXJ2YWxbMV0sXFxcXG4gICAgICAgICAgICAgICAgcGF0aDogcGF0aCxcXFxcbiAgICAgICAgICAgICAgICBjaGFyc3Q6IGNoYXJzdFxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KTtcXFxcbiAgICB9XFxcXG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjaGFwdGVyTmFtZXMubGVuZ3RoOyBpKyspIHtcXFxcbiAgICAgICAgbGV0IG5hbWUgPSBjaGFwdGVyTmFtZXNbaV07XFxcXG4gICAgICAgIGxldCBpbnRlcnZhbCA9IGludGVydmFsc1tpICsgMV07XFxcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL1RYVFZpZXdlci52aWV3I2F1dG9QYWdlIyNyZWFkVGhlbWUjXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIHN0YXJ0OiBpbnRlcnZhbFswXSxcXFxcbiAgICAgICAgICAgICAgICBlbmQ6IGludGVydmFsWzFdLFxcXFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJOYW1lOiBuYW1lLFxcXFxuICAgICAgICAgICAgICAgIHBhdGg6IHBhdGgsXFxcXG4gICAgICAgICAgICAgICAgY2hhcnN0OiBjaGFyc3RcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSk7XFxcXG4gICAgfVxcXFxuICAgIHNldFJlc3VsdChsYXlvdXQpO1xcXFxufSkoKVxcXCJ9LHtcXFwiY29sX3R5cGVcXFwiOlxcXCJtb3ZpZV8zXFxc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biAgICAgICAgaWYgKGEpIHtcXFxcbiAgICAgICAgICAgIHRpdGxlYiA9ICFyYW5rSXNSZXZlcnNlID8gXFxcXFxcXCLihpNcXFxcXFxcIiA6IFxcXFxcXFwi4oaRXFxcXFxcXCI7XFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICB0aXRsZWIgPSBcXFxcXFxcIuKGlVxcXFxcXFwiO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZWEgKyB0aXRsZWIsXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJmbGV4X2J1dHRvblxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKG5hbWUpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcmFua01ldGhvZCA9IGdldEl0ZW0oXFxcXFxcXCJib29rcmFjazpyYW5rTWV0aG9kXFxcXFxcXCIsIFxcXFxcXFwi57O757ufXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIGxldCByYW5rSXNSZXZlcnNlID0gZ2V0SXRlbShcXFxcXFxcImJvb2tyYWNrOnJhbmtJc1JldmVyc2VcXFxcXFxcIiwgXFxcXFxcXCJcXFxcXFxcIik7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICBpZiAocmFua01ldGhvZCA9PT0gbmFtZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAocmFua0lzUmV2ZXJzZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmFua0lzUmV2ZXJzZSA9IFxcXFxcXFwiXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByYW5rSXNSZXZlcnNlID0gXFxcXFxcXCIxXFxcXFxcXCI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25maWcuZGVmX1BpYztcXFxcbiAgICAgICAgYm9va0xpc3QucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogaXRlbS5nZXROYW1lKCksXFxcXG4gICAgICAgICAgICBwaWNfdXJsOiBwaWMsXFxcXG4gICAgICAgICAgICB1cmw6IHBhZ2VVcmwgKyBcXFxcXFxcIj9ydWxlPVxcXFxcXFwiICsgTVlfUlVMRS50aXRsZSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOmNvbF90eXBlLFxcXFxuICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuWIoOmZpFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygocGF0aCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFxcXFxcImxvbmdQcmVzcy5qc1xcXFxcXFwiKS5kZWxldGVGaWxlRm9yQm9vayhwYXRoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgaXRlbS5nZXRQYXRoKCkpXFxcXG4gICAgICAgICAgICAgICAgfV0sXFxcXG4gICAgICAgICAgICAgICAgaWQ6IGl0ZW0uZ2V0UGF0aCgpLFxcXFxuICAgICAgICAgICAgICAgIHBhdGg6IGl0ZW0uZ2V0UGF0aCgpLFxcXFxuICAgICAgICAgICAgICAgIG5hbWU6IGl0ZW0uZ2V0TmFtZSgpXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pO1xcXFxuICAgIH1cXFxcbiAgICBpZiAocmFua0lzUmV2ZXJzZSkge1xcXFxuICAgICAgICBib29rTGlzdC5yZXZlcnNlKCk7XFxcXG4gICAgfVxcXFxuXFxcXG4gICAgc2V0UmVzdWx0KGxheW91dC5jb25jYXQoYm9va0xpc3QpKTtcXFxcbn0pKCk7XFxcIn0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c2VUb051bWJlcihjaG5TdHIpIHtcXFxcbiAgICBsZXQgcnRuID0gMDtcXFxcbiAgICBsZXQgc2VjdGlvbiA9IDA7XFxcXG4gICAgbGV0IG51bWJlciA9IDA7XFxcXG4gICAgbGV0IHNlY1VuaXQgPSBmYWxzZTtcXFxcbiAgICBsZXQgc3RyID0gY2huU3RyLnNwbGl0KCcnKTtcXFxcblxcXFxuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgc3RyLmxlbmd0aDsgaSsrKSB7XFxcXG4gICAgICAgIGxldCBudW0gPSBjaG5OdW1DaGFyW3N0cltpXV07XFxcXG4gICAgICAgIGlmICh0eXBlb2YgbnVtICE9PSAndW5kZWZpbmVkJykge1xcXFxuICAgICAgICAgICAgbnVtYmVyID0gbnVtO1xcXFxuICAgICAgICAgICAgaWYgKGkgPT09IHN0ci5sZW5ndGggLSAxKSB7XFxcXG4gICAgICAgICAgICAgICAgc2VjdGlvbiArPSBudW1iZXI7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICBsZXQgdW5pdCA9IGNobk5hbWVWYWx1ZVtzdHJbaV1dLnZhbHVlO1xcXFxuICAgICAgICAgICAgc2VjVW5pdCA9IGNobk5hbWVWYWx1ZVtzdHJbaV1dLnNlY1VuaXQ7XFxcXG4gICAgICAgICAgICBpZiAoc2VjVW5pdCkge1xcXFxuICAgICAgICAgICAgICAgIHNlY3Rpb24gPSAoc2VjdGlvbiArIG51bWJlcikgKiB1bml0O1xcXFxuICAgICAgICAgICAgICAgIHJ0biArPSBzZWN0aW9uO1xcXFxuICAgICAgICAgICAgICAgIHNlY3Rpb24gPSAwO1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICBzZWN0aW9uICs9IChudW1iZXIgKiB1bml0KTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIG51bWJlciA9IDA7XFxcXG4gICAgICAgIH1cX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cXFxcXFwiICsgUEFUSDtcXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIHJldHVybiAkKFxcXFxcXFwi5peg5rOV5omT5byA77yM5piv5ZCm5L2/55So5YW25LuW5bqU55So5omT5byA77yfXFxcXFxcXCIpLmNvbmZpcm0ocGF0aCA9PiBcXFxcXFxcIm9wZW5GaWxlOi8vZmlsZTovL1xcXFxcXFwiICsgcGF0aCwgUEFUSCk7XFxcXG4gICAgICAgIH1cXFxcbiAgICB9KSxcXFxcbiAgICBpbml0aWFsUGF0aDogQ29uZmlnW3R5cGVdLFxcXFxuICAgIHJvb3REaXJQYXRoOiBDb25maWcuaG9tZVBhdGgsXFxcXG4gICAgLy9vbkNsaWNrVHlwZTogXFxcXFxcXCJjb25maXJtXFxcXFxcXCIsXFxcXG4gICAgLy9tZW1vcnk6IFxcXFxcXFwiRmlsZU1hbmFnZW1lbnQ6bWVtb3J5XFxcXFxcXCIsXFxcXG4gICAgcmVxdWlyZVVybDogdXJsLFxcXFxuICAgIGZpbGVUeXBlOiBcXFxcXFxcIlxcXFxcXFxcLnR4dHxcXFxcXFxcXC5lcHVifC5qcGdcXFxcXFxcIixcXFxcbiAgICAvL2NIb21lVGlwczogXFxcXFxcXCLmmK/lkKbkvb/nlKjmtbfpmJTlsI/nqIvluo/miZPlvIBbJHtuYW1lfV0/XFxcXFxcXCIsXFxcXG4gICAgLy9jU2VhcmNoVGlwczogXFxcXFxcXCLmmK/lkKbkvb/nlKjmtbfpmJTlsI/nqIvluo/miZPlvIBbJHtwYXRofV0/XFxcXFxcXCJcXFxcbn0pO1xcXCJ9XVwiLFwicHJveHlcIjpcIlwifSIsInRpdGxlIjoi44CM6YO95biC5aWH6Zeo5Yy75Zyj44CN55qE5pCc57Si57uT5p6cIn0=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement