From c7d1eebadcd1c2c26124a06e1b3a589c9e8116f5 Mon Sep 17 00:00:00 2001 From: Anton Lazarev Date: Tue, 27 Aug 2024 18:21:12 -0700 Subject: [PATCH] npm run build --- dist/resources.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/resources.json b/dist/resources.json index bc664b2..c932207 100644 --- a/dist/resources.json +++ b/dist/resources.json @@ -1 +1 @@ -[{"name":"async-sugarcoat-04394153a7ce417b88e3fe1790a4e6a269bfebe5.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"e2NvbnN0IGE9e307KGU9PnsidXNlIHN0cmljdCI7Y29uc3QgdD1TeW1ib2woImRlZmVycmVkSGFuZGxlIiksbj1TeW1ib2woIm9ubG9hZHN0YXJ0IiksaT1TeW1ib2woIm9ucHJvZ3Jlc3MiKSxyPVN5bWJvbCgib25hYm9ydCIpLGE9U3ltYm9sKCJvbmVycm9yIiksbz1TeW1ib2woIm9ubG9hZCIpLHM9U3ltYm9sKCJvbnRpbWVvdXQiKSxnPVN5bWJvbCgib25sb2FkZW5kIiksbD1TeW1ib2woIm9ucmVhZHlzdGF0ZWNoYW5nZSIpLGQ9U3ltYm9sKCJyZWFkeVN0YXRlIiksdT1TeW1ib2woInRpbWVvdXQiKSxjPVN5bWJvbCgid2l0aENyZWRlbnRpYWxzIikscD1TeW1ib2woInVwbG9hZCIpLGg9U3ltYm9sKCJyZXNwb25zZVR5cGUiKSx2PShlLG4pPT57dmFyIHQ9bi5kZXNjcmlwdGlvbi5zdWJzdHJpbmcoMik7T2JqZWN0LmRlZmluZVByb3BlcnR5KGUsbix7Y29uZmlndXJhYmxlOiExLGVudW1lcmFibGU6ITEsdmFsdWU6bnVsbCx3cml0YWJsZTohMH0pLGUuYWRkRXZlbnRMaXN0ZW5lcih0LGZ1bmN0aW9uKGUpe2NvbnN0IHQ9dGhpc1tuXTt0JiZ0LmNhbGwodGhpcyxlKX0pfSxrPShlLHQpPT57ZVtkXT10LGUuZGlzcGF0Y2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UuZGV0YWlsLnR5cGUmJk1hcmtldGluZy5nRXZlbnQodCxuKX0pfSxNYXJrZXRpbmcuVURPLmdfaW9uX3N1Ym1pdD1mdW5jdGlvbihlLHQpey9saXZlYmFsbC4qY29tcGxldGVkL2dpLnRlc3QoZGVsbF9tYXJrZXRpbmdfdXRpbC5nZXRzY01hcCgicGFnZW5hbWUiKSkmJk1hcmtldGluZy5nRXZlbnQoZSx0KX0sTWFya2V0aW5nLlVETy5nX2dhdGVkX3N1Ym1pdD1mdW5jdGlvbih0LG4pe3dpbmRvdy5hZGRFdmVudExpc3RlbmVyKCJodmUiLGZ1bmN0aW9uKGUpeyJnYXRlZF9zdWJtaXQiPT09ZS5kZXRhaWwudHlwZSYmTWFya2V0aW5nLmdFdmVudCh0LG4pfSl9fSwzNDc1MTkzLFszNjE3NjgyXSw2MjA4MTgsWzYxOTQwNF0pfQo="},{"name":"async-sugarcoat-8a459c41783885dc83d30f5b7da2359091f4e607.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"e2NvbnN0IGE9e307KHQ9PnsidXNlIHN0cmljdCI7Y29uc3QgZT1TeW1ib2woImRlZmVycmVkSGFuZGxlIiksbj1TeW1ib2woIm9ubG9hZHN0YXJ0Iikscj1TeW1ib2woIm9ucHJvZ3Jlc3MiKSxhPVN5bWJvbCgib25hYm9ydCIpLG89U3ltYm9sKCJvbmVycm9yIiksaT1TeW1ib2woIm9ubG9hZCIpLHM9U3ltYm9sKCJvbnRpbWVvdXQiKSxjPVN5bWJvbCgib25sb2FkZW5kIiksdT1TeW1ib2woIm9ucmVhZHlzdGF0ZWNoYW5nZSIpLGw9U3ltYm9sKCJyZWFkeVN0YXRlIiksZz1TeW1ib2woInRpbWVvdXQiKSxoPVN5bWJvbCgid2l0aENyZWRlbnRpYWxzIiksZj1TeW1ib2woInVwbG9hZCIpLGQ9U3ltYm9sKCJyZXNwb25zZVR5cGUiKSxwPSh0LG4pPT57dmFyIGU9bi5kZXNjcmlwdGlvbi5zdWJzdH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PyExOih0W2JlXT1uLCEwKX0obikpJiYobnVsbD09KGU9bltiZV0pfHwxLzA9PWV8fGlzTmFOKGUpfHwoMDxlPyhycihuLHllKSxycihuLEVlKSxycihuLE9lKSxycihuLHdlKSxycihuLF9lKSxycihuLFRlKSxycihuLHhlKSxycihuLGtlKSxycihuLFNlKSxycihuLENlKSxycihuLGplKSxNKGZ1bmN0aW9uKCl7dChuKX0sMTApKTpwKEksImxvYWQiLGZ1bmN0aW9uKCl7bHIodCl9LCExKSkpfSxncj0hMSxocj1mdW5jdGlvbih0KXt2YXIgZSxuLHIsYSxvLGkscyxjLHU7ImNvb2tpZSI9PVB0KHQseG4pJiYoIXQuZ2V0KF9uKSYmUHQodCxkbik9PVB0KHQsaG4pfHwoZT0xZTMqTXQodCx5biksZnIodCxobixtbixlKSx0LmRhdGEuc2V0KGRuLFB0KHQsaG4pKSksIXQuZ2V0KF9uKSYmZHIodCk9PVB0KHQsUm4pfHxmcih0LFJuLEFuLDg2NGU1KSx0LmdldChxbik/KGU9UHQodCxJbikpJiYobj0wPT09KG49TWF0aC5taW4oTXQodCxNbiksMWUzKk10KHQseW4pKSk/MDpNYXRoLm1pbihuLDFlMypNdCh0LFBuKStuLShuZXcgRGF0ZSkuZ2V0VGltZSgpKSx0LmRhdGEuc2V0KE1uLG4pLHI9e30sYT1QdCh0LFBuKSxvPVB0KHQsRG4pLGk9d3IoUHQodCx3bikpLHM9YnIoUHQodCxibikpLGM9UHQodCx2biksdT1QdCh0LE9uKSxvJiYiYXcuZHMiIT1vP3ImJihyLnVhPSEwKTooZT1bIjEiLGEsRyhlKV0uam9pbigiLiIpLDA8PW4mJihyJiYoci50YT0hMCksJCgiX2dhY18iK0coYyksZSxpLHMsYyxuLHUpKSksX3IocikpOmcoNzUpLHQuZ2V0KHFuKSYmKGU9UHQodCxYbikpJiYobj0wPT09KG49TWF0aC5taW4oTXQodCx6biksMWUzKk10KHQseW4pKSk/MDpNYXRoLm1pbihuLDFlMypNdCh0LEJuKSt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ksZXIoInNldCIsdCx0LnNldCw0KSxlcigic2VuZCIsdCx0LnNlbmQpLGVyKCJyZXF1aXJlU3luYyIsdCx0Lm1hKSxlcigiZ2V0Iix0PUl0LnByb3RvdHlwZSx0LmdldCksZXIoInNldCIsdCx0LnNldCksImh0dHBzOiIhPVAubG9jYXRpb24ucHJvdG9jb2wmJiFsKXt0Ontmb3IodD1QLmdldEVsZW1lbnRzQnlUYWdOYW1lKCJzY3JpcHQiKSxlPTA7ZTx0Lmxlbmd0aCYmZTwxMDA7ZSsrKXt2YXIgcj10W2VdLnNyYztpZihyJiYwPT1yLmluZGV4T2YoZ3QoITApKyIvYW5hbHl0aWNzIikpe3Q9ITA7YnJlYWsgdH19dD0hMX10JiYobD0hMCl9dD0oKEkuZ2FwbHVnaW5zPUkuZ2FwbHVnaW5zfHx7fSkuTGlua2VyPVJyKS5wcm90b3R5cGUsaGEoImxpbmtlciIsUnIpLGVyKCJkZWNvcmF0ZSIsdCx0LmNhLDIwKSxlcigiYXV0b0xpbmsiLHQsdC5TLDI1KSxlcigicGFzc3Rocm91Z2giLHQsdC4kLDI1KSxoYSgiZGlzcGxheWZlYXR1cmVzIixVciksaGEoImFkZmVhdHVyZXMiLFVyKSx4YS5ELmFwcGx5KGthLG4pfX07QWU9a2EuTixSZT1JW3NdO1JlJiZSZS5yP0FlKCk6TmUoQWUpLE5lKGZ1bmN0aW9uKCl7eGEuRChbInByb3ZpZGUiLCJyZW5kZXIiLFRdKX0pfSh3aW5kb3cpfQo="},{"name":"brave-disable-pageview-api.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"Ly8vIGJyYXZlLWRpc2FibGUtcGFnZXZpZXctYXBpLmpzCi8vIEJhc2VkIG9uOiBodHRwczovL2FkZG9ucy5tb3ppbGxhLm9yZy9maXJlZm94L2FkZG9uL2Rpc2FibGUtcGFnZS12aXNpYmlsaXR5LwovLyBMaWNlbnNlOiAgaHR0cDovL3d3dy5vcGVuc291cmNlLm9yZy9saWNlbnNlcy9ic2QtbGljZW5zZS5waHAKLy8gRnJvbTogaHR0cHM6Ly9naXN0LmdpdGh1Yi5jb20vZ3dhcnNlci8zYjQ3YjYxODYzYmZmY2ZlYmU0NDk4Yzc3YjIzMDFjZAooZnVuY3Rpb24oKXsKLy8gdmlzaWJpbGl0eWNoYW5nZSBldmVudHMgYXJlIGNhcHR1cmVkIGFuZCBzdG9wcGVkIApkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKCJ2aXNpYmlsaXR5Y2hhbmdlIiwgZnVuY3Rpb24oZSkgewogICAgZS5zdG9wSW1tZWRpYXRlUHJvcGFnYXRpb24oKTsKfSwgdHJ1ZSk7Ci8vIGRvY3VtZW50LnZpc2liaWxpdHlTdGF0ZSBhbHdheXMgcmV0dXJucyBmYWxzZQpPYmplY3QuZGVmaW5lUHJvcGVydHkoRG9jdW1lbnQucHJvdG90eXBlLCAiaGlkZGVuIiwgewogICAgZ2V0OiBmdW5jdGlvbiBoaWRkZW4oKSB7CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfSwKICAgIGVudW1lcmFibGU6IHRydWUsCiAgICBjb25maWd1cmFibGU6IHRydWUKfSk7Ci8vIGRvY3VtZW50LnZpc2liaWxpdHlTdGF0ZSBhbHdheXMgcmV0dXJucyAidmlzaWJsZSIKT2JqZWN0LmRlZmluZVByb3BlcnR5KERvY3VtZW50LnByb3RvdHlwZSwgInZpc2liaWxpdHlTdGF0ZSIsIHsKICAgIGdldDogZnVuY3Rpb24gdmlzaWJpbGl0eVN0YXRlKCkgewogICAgICAgIHJldHVybiAidmlzaWJsZSI7CiAgICB9LAogICAgZW51bWVyYWJsZTogdHJ1ZSwKICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZQp9KTsKfSkoKQo="},{"name":"brave-fix.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"Ly8vIGJyYXZlLWZpeC5qcwovLy8gYWxpYXMgYmYuanMKZGVsZXRlIE5hdmlnYXRvci5wcm90b3R5cGUuYnJhdmUKZGVsZXRlIHdpbmRvdy5uYXZpZ2F0b3IuYnJhdmUK"},{"name":"brave-google-maps-fix.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"Ly8gRml4IGZvciBodHRwczovL2dpdGh1Yi5jb20vYnJhdmUvYnJhdmUtYnJvd3Nlci9pc3N1ZXMvMzcwNzUKKCgpID0+IHsKICBpZiAobG9jYXRpb24ucGF0aG5hbWUuc3RhcnRzV2l0aCgiL21hcHMvIikgfHwgbG9jYXRpb24ucGF0aG5hbWUgPT09ICIvbWFwcyIpIHsKICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShXZWJHTFNoYWRlclByZWNpc2lvbkZvcm1hdC5wcm90b3R5cGUsICdwcmVjaXNpb24nLCB7CiAgICAgIHZhbHVlOiAwLAogICAgICB3cml0YWJsZTogZmFsc2UKICAgIH0pOwogIH0KfSkoKTsK"},{"name":"brave-video-bg-play.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"Ly8vIGJyYXZlLXZpZGVvLWJnLXBsYXkuanMKLy8gQmFzZWQgb246IGh0dHBzOi8vZ2l0aHViLmNvbS9tb3ppbGxhL3ZpZGVvLWJnLXBsYXkKLy8gTGljZW5zZTogIGh0dHBzOi8vZ2l0aHViLmNvbS9tb3ppbGxhL3ZpZGVvLWJnLXBsYXkvYmxvYi9tYXN0ZXIvTElDRU5TRSAoTUlUKQovLyBGcm9tOiBodHRwczovL2dpc3QuZ2l0aHViLmNvbS9nd2Fyc2VyLzNiNDdiNjE4NjNiZmZjZmViZTQ0OThjNzdiMjMwMWNkCihmdW5jdGlvbigpewpjb25zdCBJU19ZT1VUVUJFID0gd2luZG93LmxvY2F0aW9uLmhvc3RuYW1lLnNlYXJjaCgvKD86XnwuK1wuKXlvdXR1YmUuY29tLykgPiAtMSB8fAogICAgICAgICAgICAgICAgICAgd2luZG93LmxvY2F0aW9uLmhvc3RuYW1lLnNlYXJjaCgvKD86XnwuK1wuKXlvdXR1YmUtbm9jb29raWUuY29tLykgPiAtMT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5pdCgoKSA9PiByZWZyZXNoTGFjdCgpLCByZWZyZXNoSW50ZXJ2YWwpOwp9CmZ1bmN0aW9uIHdhaXRGb3JZb3V0dWJlTGFjdEluaXQoYUNhbGxiYWNrLCBhQ2FsbGJhY2tJbnRlcnZhbCwgYURlbGF5ID0gMTAwMCkgewogIGxldCBwYWdlV2luID0gd2luZG93OwogIGlmIChwYWdlV2luLmhhc093blByb3BlcnR5KCdfbGFjdCcpKSB7CiAgICB3aW5kb3cuc2V0SW50ZXJ2YWwoYUNhbGxiYWNrLCBhQ2FsbGJhY2tJbnRlcnZhbCk7CiAgfSBlbHNlIHsKICAgIHdpbmRvdy5zZXRUaW1lb3V0KCgpID0+IHdhaXRGb3JZb3V0dWJlTGFjdEluaXQoYUNhbGxiYWNrLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhQ2FsbGJhY2tJbnRlcnZhbCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYURlbGF5ICogMiksCiAgICAgICAgICAgICAgICAgICAgICBhRGVsYXkpOwogIH0KfQpmdW5jdGlvbiByZWZyZXNoTGFjdCgpIHsKICB3aW5kb3cuX2xhY3QgPSBEYXRlLm5vdygpOwp9Cn0pKCkK"},{"name":"brave-youtube-navigation-fix.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"KF8gPT4gewogIGNvbnN0IG9yaWdQZXJmTm93ID0gd2luZG93LnBlcmZvcm1hbmNlLm5vdzsKICBsZXQgcHJldmlvdXMgPSAwOwoKICB3aW5kb3cucGVyZm9ybWFuY2Uubm93ID0gZnVuY3Rpb24gKCkgewogICAgbGV0IGN1cnJlbnQgPSBvcmlnUGVyZk5vdy5hcHBseSh0aGlzKTsKICAgIGlmIChjdXJyZW50IDw9IHByZXZpb3VzKSB7CiAgICAgIGN1cnJlbnQgPSBwcmV2aW91cyArIE51bWJlci5FUFNJTE9OICogMTAwMDAwOwogICAgfQoKICAgIHJldHVybiBwcmV2aW91cyA9IGN1cnJlbnQ7CiAgfQp9KSgpOwo="},{"name":"brave-youtube-theater-fix.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"KGFzeW5jIF8gPT4gewogIGlmIChzZWxmLmNvb2tpZVN0b3JlID09PSB1bmRlZmluZWQpIHsKICAgIC8vIERvIG5vdGhpbmcgb24gaU9TLiBUaGUgcHJvYmxlbSBkb2Vzbid0IGV4aXN0IHRoZXJlLCBhbmQgdGhlCiAgICAvLyBzb2x1dGlvbiB3b3VsZG4ndCB3b3JrIGFueXdheQogICAgcmV0dXJuCiAgfQogIGNvbnN0IHN0b3JlS2V5ID0gJ2JyYXZlOjp3aWRlJwogIGNvbnN0IGNvb2tpZUtleSA9ICd3aWRlJwoKICBjb25zdCB3aWRlQ29va2llID0gYXdhaXQgY29va2llU3RvcmUuZ2V0KGNvb2tpZUtleSkKICBjb25zdCB3aWRlQ29va2llQmFja3VwID0gbG9jYWxTdG9yYWdlLmdldEl0ZW0oc3RvcmVLZXkpCgogIC8vIFNldCB0aGUgY29va2llIGZyb20gbG9jYWxTdG9yYWdlIGlmZjogCiAgLy8gMSkgaXQgZG9lc24ndCBhbHJlYWR5IGV4aXN0LgogIC8vIDIpIHdlIGhhdmUgYSBiYWNrdXAgaW4gbG9jYWxTdG9yYWdlLgogIGlmICghd2lkZUNvb2tpZSAmJiB3aWRlQ29va2llQmFja3VwKSB7CiAgICAvLyBUaGUgY29va2llIG9iamVjdCBpcyBzdG9yZWQgYXMgYSBzdHJpbmcuIFBhcnNlIGl0LgogICAgY29uc3QgY29va2llT2JqID0gSlNPTi5wYXJzZSh3aWRlQ29va2llQmFja3VwKQogICAgYXdhaXQgY29va2llU3RvcmUuc2V0KGNvb2tpZU9iaikKICAgIC8vIFJlZnJlc2ggdGhlIHBhZ2UgdG8gbWFrZSBZVCB1c2UgdGhlIG5ldyBjb29raWUuCiAgICBsb2NhdGlvbi5yZWxvYWQoKQogIH0KCiAgLy8gUGVyc2lzdCB0aGUgY29va2llIHZhbHVlIHRvIGxvY2FsU3RvcmFnZSBldmVyeSBzZWNvbmQuCiAgc2V0SW50ZXJ2YWwoYXN5bmMgXyA9PiB7CiAgICB0cnkgewogICAgICBjb25zdCB3aWRlQ29va2llID0gYXdhaXQgY29va2llU3RvcmUuZ2V0KGNvb2tpZUtleSkKICAgICAgLy8gV2UgaGF2ZSB0byBzdHJpbmdpZnkgdGhlIGNvb2tpZSBvYmplY3QgdG8gc3RvcmUgaXQgaW4gbG9jYWxTdG9yYWdlLgogICAgICBpZiAod2lkZUNvb2tpZSkgewogICAgICAgIGxvY2FsU3RvcmFnZS5zZXRJdGVtKHN0b3JlS2V5LCBKU09OLnN0cmluZ2lmeSh3aWRlQ29va2llKSkKICAgICAgfSBlbHNlIHsKICAgICAgICBsb2NhbFN0b3JhZ2UucmVtb3ZlSXRlbShzdG9yZUtleSkKICAgICAgfQogICAgfSBjYXRjaCAoZSkgewogICAgICAvLyBzd2FsbG93IGVycm9yIGZyb20gbm8gY29va2llIGV4aXN0aW5nCiAgICB9CiAgfSwgMTAwMCkKfSkoKTsK"},{"name":"de-amp.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"KGZ1bmN0aW9uICgpIHsKICBpZiAodHlwZW9mIGRlQW1wRW5hYmxlZCAhPT0gJ3VuZGVmaW5lZCcgJiYgZGVBbXBFbmFibGVkKSB7CiAgICBjb25zdCBhdHRyID0gJ2pzYWN0aW9uJwogICAgY29uc3Qgc2VsZWN0b3IgPSBgYVtkYXRhLWFtcC10aXRsZV1bJHthdHRyfV1gCiAgICBsZXQgdGltZXIKICAgIGNvbnN0IGlkbGVDYWxsYmFjayA9IChfID0+IHsKICAgICAgaWYgKHNlbGYucmVxdWVzdElkbGVDYWxsYmFjaykgewogICAgICAgIHJldHVybiAoY2FsbGJhY2ssIHRpbWVvdXQpID0+IHsKICAgICAgICAgIHJldHVybiBzZWxmLnJlcXVlc3RJZGxlQ2FsbGJhY2soY2FsbGJhY2ssIHsgdGltZW91dCB9KQogICAgICAgIH0KICAgICAgfQoKICAgICAgLy8gRmFsbGJhY2sgdG8gc2V0VGltZW91dCB3aGVuIHJlcXVlc3RJZGxlQ2FsbGJhY2sgZG9lc24ndCBleGlzdC4KICAgICAgcmV0dXJuIChjYWxsYmFjaykgPT4gewogICAgICAgIHJldHVybiBzZWxmLnNldFRpbWVvdXQoY2FsbGJhY2ssIDApCiAgICAgIH0KICAgIH0pKCkKICAgIGNvbnN0IHJtYXR0ciA9ICgpID0+IHsKICAgICAgdGltZXIgPSB1bmRlZmluZWQKICAgICAgdHJ5IHsKICAgICAgICBjb25zdCBub2RlcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoc2VsZWN0b3IpCiAgICAgICAgZm9yIChjb25zdCBub2RlIG9mIG5vZGVzKSB7CiAgICAgICAgICBub2RlLnJlbW92ZUF0dHJpYnV0ZShhdHRyKQogICAgICAgIH0KICAgICAgfSBjYXRjaCAoZXgpIHsgfQogICAgfQogICAgY29uc3QgbXV0YXRpb25IYW5kbGVyID0gKG11dGF0aW9ucykgPT4gewogICAgICBpZiAodGltZXIgIT09IHVuZGVmaW5lZCkgewogICAgICAgIHJldHVybgogICAgICB9CiAgICAgIGxldCBza2lwID0gdHJ1ZQogICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG11dGF0aW9ucy5sZW5ndGggJiYgc2tpcDsgaSsrKSB7CiAgICAgICAgY29uc3QgeyB0eXBlLCBhZGRlZE5vZGVzLCByZW1vdmVkTm9kZXMgfSA9IG11dGF0aW9uc1tpXQogICAgICAgIGlmICh0eXBlID09PSAnYXR0cmlidXRlcycpIHsKICAgICAgICAgIHNraXAgPSBmYWxzZQogICAgICAgIH0KICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGFkZGVkTm9kZXMubGVuZ3RoICYmIHNraXA7IGorKykgewogICAgICAgICAgaWYgKGFkZGVkTm9kZXNbal0ubm9kZVR5cGUgPT09IDEpIHsKICAgICAgICAgICAgc2tpcCA9IGZhbHNlCiAgICAgICAgICAgIGJyZWFrCiAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgcmVtb3ZlZE5vZGVzLmxlbmd0aCAmJiBza2lwOyBqKyspIHsKICAgICAgICAgIGlmIChyZW1vdmVkTm9kZXNbal0ubm9kZVR5cGUgPT09IDEpIHsKICAgICAgICAgICAgc2tpcCA9IGZhbHNlCiAgICAgICAgICAgIGJyZWFrCiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICAgIGlmIChza2lwKSB7CiAgICAgICAgcmV0dXJuCiAgICAgIH0KCiAgICAgIHRpbWVyID0gaWRsZUNhbGxiYWNrKHJtYXR0ciwgMTcpCiAgICB9CgogICAgY29uc3Qgc3RhcnQgPSAoKSA9PiB7CiAgICAgIHJtYXR0cigpCiAgICAgIGNvbnN0IG9ic2VydmVyID0gbmV3IE11dGF0aW9uT2JzZXJ2ZXIobXV0YXRpb25IYW5kbGVyKQogICAgICBvYnNlcnZlci5vYnNlcnZlKGRvY3VtZW50LCB7CiAgICAgICAgYXR0cmlidXRlczogdHJ1ZSwKICAgICAgICBhdHRyaWJ1dGVGaWx0ZXI6IFthdHRyXSwKICAgICAgICBjaGlsZExpc3Q6IHRydWUsCiAgICAgICAgc3VidHJlZTogdHJ1ZQogICAgICB9KQogICAgfQoKICAgIHNlbGYuYWRkRXZlbnRMaXN0ZW5lcignRE9NQ29udGVudExvYWRlZCcsIHN0YXJ0LCB7IG9uY2U6IHRydWUgfSkKICB9Cn0pKCk7Cg=="},{"name":"touch-fix.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"Ly8gUmVtb3ZlIHRvdWNoIGNoZWNrcyBvbiBzZWxlY3RlZCBtb2JpbGUgc2l0ZXMKZGVsZXRlIERvY3VtZW50LnByb3RvdHlwZS5jcmVhdGVUb3VjaApkZWxldGUgRG9jdW1lbnQucHJvdG90eXBlLm9udG91Y2hzdGFydApkZWxldGUgRG9jdW1lbnQucHJvdG90eXBlLm9udG91Y2hlbmQKZGVsZXRlIERvY3VtZW50LnByb3RvdHlwZS5vbnRvdWNoY2FuY2VsCmRlbGV0ZSBEb2N1bWVudC5wcm90b3R5cGUuVG91Y2hFdmVudAo="},{"name":"trusted_types.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"Ly8vIHNldC10cnVzdGVkLXR5cGVzLmpzCmZ1bmN0aW9uIHNldFRydXN0ZWRUeXBlcygpIHsKICBpZiAod2luZG93LnRydXN0ZWRUeXBlcyAmJiB3aW5kb3cudHJ1c3RlZFR5cGVzLmNyZWF0ZVBvbGljeSkgewogICAgd2luZG93LnRydXN0ZWRUeXBlcy5jcmVhdGVQb2xpY3koImRlZmF1bHQiLCB7CiAgICAgIGNyZWF0ZVNjcmlwdDogc3RyaW5nID0+IHN0cmluZwogICAgfSk7CiAgIH0KICAgcnVuQXQoKCkgPT4ge30sICdpbnRlcmFjdGl2ZScpOwp9Cg=="},{"name":"vaft-ublock-origin.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"KGZ1bmN0aW9uKCkgewogICAgaWYgKCAvKF58XC4pdHdpdGNoXC50diQvLnRlc3QoZG9jdW1lbnQubG9jYXRpb24uaG9zdG5hbWUpID09PSBmYWxzZSApIHsgcmV0dXJuOyB9CiAgICAvL1RoaXMgc3RvcHMgVHdpdGNoIGZyb20gcGF1c2luZyB0aGUgcGxheWVyIHdoZW4gaW4gYW5vdGhlciB0YWIgYW5kIGFuIGFkIHNob3dzLgogICAgdHJ5IHsKICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoZG9jdW1lbnQsICd2aXNpYmlsaXR5U3RhdGUnLCB7CiAgICAgICAgICAgIGdldCgpIHsKICAgICAgICAgICAgICAgIHJldHVybiAndmlzaWJsZSc7CiAgICAgICAgICAgIH0KICAgICAgICB9KTsKICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoZG9jdW1lbnQsICdoaWRkZW4nLCB7CiAgICAgICAgICAgIGdldCgpIHsKICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgfQogICAgICAgIH0pOwogICAgICAgIGNvbnN0IGJsb2NrID0gZSA9PiB7CiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTsKICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTsKICAgICAgICAgICAgZS5zdG9wSW1tZWRpYXRlUHJvcGFnYXRpb24oKTsKICAgICAgICB9OwogICAgICAgIGNvbnN0IHByb2Nlc3MgPSBlID0+IHsKICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpOwogICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpOwogICAgICAgICAgICBlLnN0b3BJbW1lZGlhdGVQcm9wYWdhdGlvbigpOwogICAgICAgICAgICAvL1RoaXMgY29ycmVjdHMgdGhlIGJhY2tncm91bmQgdGFiIGJ1ZmZlciBidWcgd2hlbiBzd2l0Y2hpbmcgdG8gdGhlIGJhY2tncm91bmQgdGFiIGZvciB0aGUgZmlyc3QgdGltZSBhZnRlciBhbiBleHRlbmRlZCBwZXJpb2QuCiAgICAgICAgICAgIGRvVHdpdGNoUGxheWVyVGFzayhmYWxzZSwgZmFsc2UsIHRydWUsIGZhbHNlLCBmYWxzZSk7CiAgICAgICAgfTsKICAgICAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKCd2aXNpYmlsaXR5Y2hhbmdlJywgYmxvY2ssIHRydWUpOwogICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ3dlYmtpdHZpc2liaWxpdHljaGFuZ2UnLCBibG9jaywgdHJ1ZSk7CiAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignbW96dmlzaWJpbGl0eWNoYW5nZScsIGJsb2NrLCB0cnVlKTsKICAgICAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKCdoYXNGb2N1cycsIGJsb2NrLCB0cnVlKTsKICAgICAgICBpZiAoL0ZpcmVmb3gvLnRlc3QobmF2aWdhdG9yLnVzZXJBZ2VudCkpIHsKICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KGRvY3VtZW50LCAnbW96SGlkZGVuJywgewogICAgICAgICAgICAgICAgZ2V0KCkgewogICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KGRvY3VtZW50LCAnd2Via2l0SGlkZGVuJywgewogICAgICAgICAgICAgICAgZ2V0KCkgewogICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfSBjYXRjaCAoZXJyKSB7fQogICAgZnVuY3Rpb24gZGVjbGFyZU9wdGlvbnMoc2NvcGUpIHsKICAgICAgICBzY29wZS5BZFNpZ25pZmllciA9ICdzdGl0Y2hlZCc7CiAgICAgICAgc2NvcGUuQ2xpZW50SUQgPSAna2ltbmU3OGt4M25jeDZicmdvNG12NndraTVoMWtvJzsKICAgICAgICBzY29wZS5DbGllbnRWZXJzaW9uID0gJ251bGwnOwogICAgICAgIHNjb3BlLkNsaWVudFNlc3Npb24gPSAnbnVsbCc7CiAgICAgICAgc2NvcGUuUGxheWVyVHlwZTIgPSAnZW1iZWQnOyAvL1NvdXJjZQogICAgICAgIHNjb3BlLlBsYXllclR5cGUzID0gJ3NpdGUnOyAvL1NvdXJjZQogICAgICAgIHNjb3BlLlBsYXllclR5cGU0ID0gJ2F1dG9wbGF5JzsgLy8zNjBwCiAgICAgICAgc2NvcGUuQ3VycmVudENoYW5uZWxOYW1lID0gbnVsbDsKICAgICAgICBzY29wZS5Vc2hlclBhcmFtcyA9IG51bGw7CiAgICAgICAgc2NvcGUuV2FzU2hvd2luZ0FkID0gZmFsc2U7CiAgICAgICA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Rpb25zKTsKICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgfQogICAgICAgICAgICB2YXIgbmV3QmxvYlN0ciA9IGAKICAgICAgICAgICAgICAgICR7Z2V0U3RyZWFtVXJsRm9yUmVzb2x1dGlvbi50b1N0cmluZygpfQogICAgICAgICAgICAgICAgJHtnZXRTdHJlYW1Gb3JSZXNvbHV0aW9uLnRvU3RyaW5nKCl9CiAgICAgICAgICAgICAgICAke3N0cmlwVW51c2VkUGFyYW1zLnRvU3RyaW5nKCl9CiAgICAgICAgICAgICAgICAke3Byb2Nlc3NNM1U4LnRvU3RyaW5nKCl9CiAgICAgICAgICAgICAgICAke2hvb2tXb3JrZXJGZXRjaC50b1N0cmluZygpfQogICAgICAgICAgICAgICAgJHtkZWNsYXJlT3B0aW9ucy50b1N0cmluZygpfQogICAgICAgICAgICAgICAgJHtnZXRBY2Nlc3NUb2tlbi50b1N0cmluZygpfQogICAgICAgICAgICAgICAgJHtncWxSZXF1ZXN0LnRvU3RyaW5nKCl9CiAgICAgICAgICAgICAgICAke2FkUmVjb3JkZ3FsUGFja2V0LnRvU3RyaW5nKCl9CiAgICAgICAgICAgICAgICAke3RyeU5vdGlmeVR3aXRjaC50b1N0cmluZygpfQogICAgICAgICAgICAgICAgJHtwYXJzZUF0dHJpYnV0ZXMudG9TdHJpbmcoKX0KICAgICAgICAgICAgICAgICR7Z2V0V2FzbVdvcmtlclVybC50b1N0cmluZygpfQogICAgICAgICAgICAgICAgdmFyIHdvcmtlclVybCA9IGdldFdhc21Xb3JrZXJVcmwoJyR7dHdpdGNoQmxvYlVybC5yZXBsYWNlQWxsKCInIiwgIiUyNyIpfScpOwogICAgICAgICAgICAgICAgaWYgKHdvcmtlclVybCAmJiB3b3JrZXJVcmwuaW5jbHVkZXMoJ2Fzc2V0cy50d2l0Y2gudHYvYXNzZXRzL2FtYXpvbi1pdnMtd2FzbXdvcmtlcicpKSB7CiAgICAgICAgICAgICAgICAgICAgZGVjbGFyZU9wdGlvbnMoc2VsZik7CiAgICAgICAgICAgICAgICAgICAgc2VsZi5hZGRFdmVudExpc3RlbmVyKCdtZXNzYWdlJywgZnVuY3Rpb24oZSkgewogICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5kYXRhLmtleSA9PSAnVXBkYXRlSXNTcXVhZFN0cmVhbScpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIElzU3F1YWRTdHJlYW0gPSBlLmRhdGEudmFsdWU7CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZS5kYXRhLmtleSA9PSAnVXBkYXRlQ2xpZW50VmVyc2lvbicpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIENsaWVudFZlcnNpb24gPSBlLmRhdGEudmFsdWU7CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZS5kYXRhLmtleSA9PSAnVXBkYXRlQ2xpZW50U2Vzc2lvbicpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIENsaWVudFNlc3Npb24gPSBlLmRhdGEudmFsdWU7CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZS5kYXRhLmtleSA9PSAnVXBkYXRlQ2xpZW50SWQnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDbGllbnRJRCA9IGUuZGF0YS52YWx1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlLmRhdGEua2V5ID09ICdVcGRhdGVEZXZpY2VJZCcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdRTERldmljZUlEID0gZS5kYXRhLnZhbHVlOwogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGUuZGF0YS5rZXkgPT0gJ1VwZGF0ZUNsaWVudEludGVncml0eUhlYWRlcicpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIENsaWVudEludGVncml0eUhlYWRlciA9IGUuZGF0YS52YWx1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlLmRhdGEua2V5ID09ICdVcGRhdGVBdXRob3JpemF0aW9uSGVhZGVyJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgQXV0aG9yaXphdGlvbkhlYWRlciA9IGUuZGF0YS52YWx1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgIGhvb2tXb3JrZXJGZXRjaCgpOwogICAgICAgICAgICAgICAgICAgIGltcG9ydFNjcmlwdHMod29ya2VyVXJsKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgYDsKICAgICAgICAgICAgc3VwZXIoVVJMLmNyZWF0ZU9iamVjdFVSTChuZXcgQmxvYihbbmV3QmxvYlN0cl0pKSwgb3B0aW9ucyk7CiAgICAgICAgICAgIHR3aXRjaFdvcmtlcnMucHVzaCh0aGlzKTsKICAgICAgICAgICAgdGhpcy5vbm1lc3NhZ2UgPSBmdW5jdGlvbihlKSB7CiAgICAgICAgICAgICAgICBpZiAoZS5kYXRhLmtleSA9PSAnU2hvd0FkQmxvY2tCYW5uZXInKSB7CiAgICAgICAgICAgICAgICAgICAgaWYgKGFkQmxvY2tEaXYgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICBhZEJsb2NrRGl2ID0gZ2V0QWRCbG9ja0RpdigpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBhZEJsb2NrRGl2LlAudGV4dENvbnRlbnQgPSAnQmxvY2tpbmcgYWRzJzsKICAgICAgICAgICAgICAgICAgICBhZEJsb2NrRGl2LnN0eWxlLmRpc3BsYXkgPSAnYmxvY2snOwogICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlLmRhdGEua2V5ID09ICdIaWRlQWRCbG9ja0Jhbm5lcicpIHsKICAgICAgICAgICAgICAgICAgICBpZiAoYWRCbG9ja0RpdiA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGFkQmxvY2tEaXYgPSBnZXRBZEJsb2NrRGl2KCk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGFkQmxvY2tEaXYuc3R5bGUuZGlzcGxheSA9ICdub25lJzsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZS5kYXRhLmtleSA9PSAnUGF1c2VSZXN1bWVQbGF5ZXInKSB7CiAgICAgICAgICAgICAgICAgICAgZG9Ud2l0Y2hQbGF5ZXJUYXNrKHRydWUsIGZhbHNlLCBmYWxzZSwgZmFsc2UsIGZhbHNlKTsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZS5kYXRhLmtleSA9PSAnRm9yY2VDaGFuZ2VRdWFsaXR5JykgewogICAgICAgICAgICAgICAgICAgIC8vVGhpcyBpcyB1c2VkIHRvIGZpeCB0aGUgYnVnIHdoZXJlIHRoZSB2aWRlbyB3b3VsZCBmcmVlemUuCiAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgICAgLy9pZiAobmF2aWdhdG9yLnVzZXJBZ2VudC50b0xvd2VyQ2FzZSgpLmluZGV4T2YoJ2ZpcmVmb3gnKSA9PSAtMSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAvL30KICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGF1dG9RdWFsaXR5ID0gZG9Ud2l0Y2hQbGF5ZXJUYXNrKGZhbHNlLCBmYWxzZSwgZmFsc2UsIHRydWUsIGZhbHNlKTsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnJlbnRRdWFsaXR5ID0gZG9Ud2l0Y2hQbGF5ZXJUYXNrKGZhbHNlLCB0cnVlLCBmYWxzZSwgZmFsc2UsIGZhbHNlKTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKElzUGxheWVyQXV0b1F1YWxpdHkgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgSXNQbGF5ZXJBdXRvUXVhbGl0eSA9IGF1dG9RdWFsaXR5OwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChPcmlnaW5hbFZpZGVvUGxheWVyUXVhbGl0eSA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBPcmlnaW5hbFZpZGVvUGxheWVyUXVhbGl0eSA9IGN1cnJlbnRRdWFsaXR5OwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY3VycmVudFF1YWxpdHkuaW5jbHVkZXMoJzM2MCcpIHx8IGUuZGF0YS52YWx1ZSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIU9yaWdpbmFsVmlkZW9QbGF5ZXJRdWFsaXR5LmluY2x1ZGVzKCczNjAnKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZXR0aW5nc01lbnUgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCdkaXZbZGF0YS1hLXRhcmdldD0icGxheWVyLXNldHRpbmdzLW1lbnUiXScpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZXR0aW5nc01lbnUgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2V0dGluZ3NDb2cgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCdidXR0b25bZGF0YS1hLXRhcmdldD0icGxheWVyLXNldHRpbmdzLWJ1dHRvbiJdJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZXR0aW5nc0NvZykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0dGluZ3NDb2cuY2xpY2soKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBxdWFsaXR5TWVudSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJ2J1dHRvbltkYXRhLWEtdGFyZ2V0PSJwbGF5ZXItc2V0dGluZ3MtbWVudS1pdGVtLXF1YWxpdHkiXScpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHF1YWxpdHlNZW51KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eU1lbnUuY2xpY2soKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsb3dRdWFsaXR5ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnaW5wdXRbZGF0YS1hLXRhcmdldD0idHctcmFkaW8iJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobG93UXVhbGl0eSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBxdWFsaXR5VG9TZWxlY3QgPSBsb3dRdWFsaXR5Lmxlbmd0aCAtIDI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUuZGF0YS52YWx1ZSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmRhdGEudmFsdWUuaW5jbHVkZXMoJ29yaWdpbmFsJykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUuZGF0YS52YWx1ZSA9IE9yaWdpbmFsVmlkZW9QbGF5ZXJRdWFsaXR5OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKElzUGxheWVyQXV0b1F1YWxpdHkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLmRhdGEudmFsdWUgPSAnYXV0byc7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUuZGF0YS52YWx1ZS5pbmNsdWRlcygnMTYwcCcpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWFsaXR5VG9TZWxlY3QgPSA1OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmRhdGEudmFsdWUuaW5jbHVkZXMoJzM2MHAnKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eVRvU2VsZWN0ID0gNDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5kYXRhLnZhbHVlLmluY2x1ZGVzKCc0ODBwJykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1YWxpdHlUb1NlbGVjdCA9IDM7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUuZGF0YS52YWx1ZS5pbmNsdWRlcygnNzIwcCcpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWFsaXR5VG9TZWxlY3QgPSAyOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmRhdGEudmFsdWUuaW5jbHVkZXMoJzgyMnAnKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eVRvU2VsZWN0ID0gMjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5kYXRhLnZhbHVlLmluY2x1ZGVzKCc4NjRwJykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1YWxpdHlUb1NlbGVjdCA9IDI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUuZGF0YS52YWx1ZS5pbmNsdWRlcygnOTAwcCcpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWFsaXR5VG9TZWxlY3QgPSAyOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmRhdGEudmFsdWUuaW5jbHVkZXMoJzkzNnAnKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eVRvU2VsZWN0ID0gMjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5kYXRhLnZhbHVlLmluY2x1ZGVzKCc5NjBwJykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1YWxpdHlUb1NlbGVjdCA9IDI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUuZGF0YS52YWx1ZS5pbmNsdWRlcygnMTA4MHAnKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eVRvU2VsZWN0ID0gMjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5kYXRhLnZhbHVlLmluY2x1ZGVzKCdzb3VyY2UnKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eVRvU2VsZWN0ID0gMTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5kYXRhLnZhbHVlLmluY2x1ZGVzKCdhdXRvJykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1YWxpdHlUb1NlbGVjdCA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnJlbnRRdWFsaXR5TFMgPSB3aW5kb3cubG9jYWxTdG9yYWdlLmdldEl0ZW0oJ3ZpZGVvLXF1YWxpdHknKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb3dRdWFsaXR5W3F1YWxpdHlUb1NlbGVjdF0uY2xpY2soKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXR0aW5nc0NvZy5jbGljaygpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5sb2NhbFN0b3JhZ2Uuc2V0SXRlbSgndmlkZW8tcXVhbGl0eScsIGN1cnJlbnRRdWFsaXR5TFMpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmRhdGEudmFsdWUgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPcmlnaW5hbFZpZGVvUGxheWVyUXVhbGl0eSA9IG51bGw7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElzUGxheWVyQXV0b1F1YWxpdHkgPSBudWxsOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb1R3aXRjaFBsYXllclRhc2soZmFsc2UsIGZhbHNlLCBmYWxzZSwgdHJ1ZSwgdHJ1ZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIE9yaWdpbmFsVmlkZW9QbGF5ZXJRdWFsaXR5ID0gbnVsbDsKICAgICAgICAgICAgICAgICAgICAgICAgSXNQbGF5ZXJBdXRvUXVhbGl0eSA9IG51bGw7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9OwogICAgICAgICAgICBmdW5jdGlvbiBnZXRBZEJsb2NrRGl2KCkgewogICAgICAgICAgICAgICAgLy9UbyBkaXNwbGF5IGEgbm90aWZpY2F0aW9uIHRvIHRoZSB1c2VyLCB0aGF0IGFuIGFkIGlzIGJlaW5nIGJsb2NrZWQuCiAgICAgICAgICAgICAgICB2YXIgcGxheWVyUm9vdERpdiA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy52aWRlby1wbGF5ZXInKTsKICAgICAgICAgICAgICAgIHZhciBhZEJsb2NrRGl2ID0gbnVsbDsKICAgICAgICAgICAgICAgIGlmIChwbGF5ZXJSb290RGl2ICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICBhZEJsb2NrRGl2ID0gcGxheWVyUm9vdERpdi5xdWVyeVNlbGVjdG9yKCcuYWRibG9jay1vdmVybGF5Jyk7CiAgICAgICAgICAgICAgICAgICAgaWYgKGFkQmxvY2tEaXYgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICBhZEJsb2NrRGl2ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnZGl2Jyk7CiAgICAgICAgICAgICAgICAgICAgICAgIGFkQmxvY2tEaXYuY2xhc3NOYW1lID0gJ2FkYmxvY2stb3ZlcmxheSc7CiAgICAgICAgICAgICAgICAgICAgICAgIGFkQmxvY2tEaXYuaW5uZXJIVE1MID0gJzxkaXYgY2xhc3M9InBsYXllci1hZGJsb2NrLW5vdGljZSIgc3R5bGU9ImNvbG9yOiB3aGl0ZTsgYmFja2dyb3VuZC1jb2xvcjogcmdiYSgwLCAwLCAwLCAwLjgpOyBwb3NpdGlvbjogYWJzb2x1dGU7IHRvcDogMHB4OyBsZWZ0OiAwcHg7IHBhZGRpbmc6IDVweDsiPjxwPjwvcD48L2Rpdj4nOwogICAgICAgICAgICAgICAgICAgICAgICBhZEJsb2NrRGl2LnN0eWxlLmRpc3BsYXkgPSAnbm9uZSc7CiAgICAgICAgICAgICAgICAgICAgICAgIGFkQmxvY2tEaXYuUCA9IGFkQmxvY2tEaXYucXVlcnlTZWxlY3RvcigncCcpOwogICAgICAgICAgICAgICAgICAgICAgICBwbGF5ZXJSb290RGl2LmFwcGVuZENoaWxkKGFkQmxvY2tEaXYpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHJldHVybiBhZEJsb2NrRGl2OwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfTsKICAgIGZ1bmN0aW9uIGdldFdhc21Xb3JrZXJVcmwodHdpdGNoQmxvYlVybCkgewogICAgICAgIHZhciByZXEgPSBuZXcgWE1MSHR0cFJlcXVlc3QoKTsKICAgICAgICByZXEub3BlbignR0VUJywgdHdpdGNoQmxvYlVybCwgZmFsc2UpOwogICAgICAgIHJlcS5vdmVycmlkZU1pbWVUeXBlKCJ0ZXh0L2phdmFzY3JpcHQiKTsKICAgICAgICByZXEuc2VuZCgpOwogICAgICAgIHJldHVybiByZXEucmVzcG9uc2VUZXh0LnNwbGl0KCInIilbMV07CiAgICB9CiAgICBmdW5jdGlvbiBob29rV29ya2VyRmV0Y2goKSB7CiAgICAgICAgY29uc29sZS5sb2coJ2hvb2tXb3JrZXJGZXRjaCcpOwogICAgICAgIHZhciByZWFsRmV0Y2ggPSBmZXRjaDsKICAgICAgICBmZXRjaCA9IGFzeW5jIGZ1bmN0aW9uKHVybCwgb3B0aW9ucykgewogICAgICAgICAgICBpZiAodHlwZW9mIHVybCA9PT0gJ3N0cmluZycpIHsKICAgICAgICAgICAgICAgIGlmICh1cmwuZW5kc1dpdGgoJ20zdTgnKSkgewogICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbihyZXNvbHZlLCByZWplY3QpIHsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHByb2Nlc3NBZnRlciA9IGFzeW5jIGZ1bmN0aW9uKHJlc3BvbnNlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0hlcmUgd2UgY2hlY2sgdGhlIG0zdTggZm9yIGFueSBhZHMgYW5kIGFsc28gdHJ5IGZhbGxiYWNrIHBsYXllciB0eXBlcyBpZiBuZWVkZWQuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVzcG9uc2VUZXh0ID0gYXdhaXQgcmVzcG9uc2UudGV4dCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHdlYXZlclRleHQgPSBudWxsOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgd2VhdmVyVGV4dCA9IGF3YWl0IHByb2Nlc3NNM1U4KHVybCwgcmVzcG9uc2VUZXh0LCByZWFsRmV0Y2gsIFBsYXllclR5cGUyKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh3ZWF2ZXJUZXh0LmluY2x1ZGVzKEFkU2lnbmlmaWVyKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdlYXZlclRleHQgPSBhd2FpdCBwcm9jZXNzTTNVOCh1cmwsIHJlc3BvbnNlVGV4dCwgcmVhbEZldGNoLCBQbGF5ZXJUeXBlMyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAod2VhdmVyVGV4dC5pbmNsdWRlcyhBZFNpZ25pZmllcikpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZWF2ZXJUZXh0ID0gYXdhaXQgcHJvY2Vzc00zVTgodXJsLCByZXNwb25zZVRleHQsIHJlYWxGZXRjaCwgUGxheWVyVHlwZTQpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShuZXcgUmVzcG9uc2Uod2VhdmVyVGV4dCkpOwogICAgICAgICAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2VuZCA9IGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlYWxGZXRjaCh1cmwsIG9wdGlvbnMpLnRoZW4oZnVuY3Rpb24ocmVzcG9uc2UpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9jZXNzQWZ0ZXIocmVzcG9uc2UpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlbJ2NhdGNoJ10oZnVuY3Rpb24oZXJyKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KGVycik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICAgICAgc2VuZCgpOwogICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgfSBlbHNlIGlmICh1cmwuaW5jbHVkZXMoJy9hcGkvY2hhbm5lbC9obHMvJykpIHsKICAgICAgICAgICAgICAgICAgICB2YXIgY2hhbm5lbE5hbWUgPSAobmV3IFVSTCh1cmwpKS5wYXRobmFtZS5tYXRjaCgvKFteXC9dKykoPz1cLlx3KyQpLylbMF07CiAgICAgICAgICAgICAgICAgICAgVXNoZXJQYXJhbXMgPSAobmV3IFVSTCh1cmwpKS5zZWFyY2g7CiAgICAgICAgICAgICAgICAgICAgQ3VycmVudENoYW5uZWxOYW1lID0gY2hhbm5lbE5hbWU7CiAgICAgICAgICAgICAgICAgICAgLy9UbyBwcmV2ZW50IHBhdXNlL3Jlc3VtZSBsb29wIGZvciBtaWQtcm9sbHMuCiAgICAgICAgICAgICAgICAgICAgdmFyIGlzUEJZUFJlcXVlc3QgPSB1cmwuaW5jbHVkZXMoJ3BpY3R1cmUtYnktcGljdHVyZScpOwogICAgICAgICAgICAgICAgICAgIGlmIChpc1BCWVBSZXF1ZXN0KSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICcnOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwcm9jZXNzQWZ0ZXIgPSBhc3luYyBmdW5jdGlvbihyZXNwb25zZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLnN0YXR1cyA9PSAyMDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmNvZGluZ3NNM3U4ID0gYXdhaXQgcmVzcG9uc2UudGV4dCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzdHJlYW1JbmZvID0gU3RyZWFtSW5mb3NbY2hhbm5lbE5hbWVdOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdHJlYW1JbmZvID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyZWFtSW5mb3NbY2hhbm5lbE5hbWVdID0gc3RyZWFtSW5mbyA9IHt9OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW1JbmZvLkNoYW5uZWxOYW1lID0gY2hhbm5lbE5hbWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtSW5mby5SZXF1ZXN0ZWRBZHMgPSBuZXcgU2V0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtSW5mby5VcmxzID0gW107Ly8geHh4Lm0zdTggLT4geyBSZXNvbHV0aW9uOiAiMjg0eDE2MCIsIEZyYW1lUmF0ZTogMzAuMCB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtSW5mby5FbmNvZGluZ3NNM1U4Q2FjaGUgPSBbXTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW1JbmZvLkVuY29kaW5nc00zVTggPSBlbmNvZGluZ3NNM3U4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5lcyA9IGVuY29kaW5nc00zdTgucmVwbGFjZSgnXHInLCAnJykuc3BsaXQoJ1xuJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsaW5lcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWxpbmVzW2ldLnN0YXJ0c1dpdGgoJyMnKSAmJiBsaW5lc1tpXS5pbmNsdWRlcygnLm0zdTgnKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtSW5mby5VcmxzW2xpbmVzW2ldXSA9IC0xOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPiAwICYmIGxpbmVzW2kgLSAxXS5zdGFydHNXaXRoKCcjRVhULVgtU1RSRUFNLUlORicpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGF0dHJpYnV0ZXMgPSBwYXJzZUF0dHJpYnV0ZXMobGluZXNbaSAtIDFdKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVzb2x1dGlvbiA9IGF0dHJpYnV0ZXNbJ1JFU09MVVRJT04nXTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZnJhbWVSYXRlID0gYXR0cmlidXRlc1snRlJBTUUtUkFURSddOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNvbHV0aW9uKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbUluZm8uVXJsc1tsaW5lc1tpXV0gPSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNvbHV0aW9uOiByZXNvbHV0aW9uLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJhbWVSYXRlOiBmcmFtZVJhdGUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJlYW1JbmZvc0J5VXJsW2xpbmVzW2ldXSA9IHN0cmVhbUluZm87CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNYWluVXJsQnlVcmxbbGluZXNbaV1dID0gdXJsOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUobmV3IFJlc3BvbnNlKGVuY29kaW5nc00zdTgpKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShyZXNwb25zZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZW5kID0gZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVhbEZldGNoKHVybCwgb3B0aW9ucykudGhlbihmdW5jdGlvbihyZXNwb25zZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb2Nlc3NBZnRlcihyZXNwb25zZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVsnY2F0Y2gnXShmdW5jdGlvbihlcnIpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWplY3QoZXJyKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgICAgICAgICBzZW5kKCk7CiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHJlYWxGZXRjaC5hcHBseSh0aGlzLCBhcmd1bWVudHMpOwogICAgICAgIH07CiAgICB9CiAgICBmdW5jdGlvbiBnZXRTdHJlYW1VcmxGb3JSZXNvbHV0aW9uKGVuY29kaW5nc00zdTgsIHJlc29sdXRpb25JbmZvLCBxdWFsaXR5T3ZlcnJpZGVTdHIpIHsKICAgICAgICB2YXIgcXVhbGl0eU92ZXJyaWRlID0gMDsKICAgICAgICBpZiAocXVhbGl0eU92ZXJyaWRlU3RyICYmIHF1YWxpdHlPdmVycmlkZVN0ci5lbmRzV2l0aCgncCcpKSB7CiAgICAgICAgICAgIHF1YWxpdHlPdmVycmlkZSA9IHF1YWxpdHlPdmVycmlkZVN0ci5zdWJzdHIoMCwgcXVhbGl0eU92ZXJyaWRlU3RyLmxlbmd0aCAtIDEpIHwgMDsKICAgICAgICB9CiAgICAgICAgdmFyIHF1YWxpdHlPdmVycmlkZUZvdW5kUXVhbGl0eSA9IDA7CiAgICAgICAgdmFyIHF1YWxpdHlPdmVycmlkZUZvdW5kRnJhbWVSYXRlID0gMDsKICAgICAgICB2YXIgZW5jb2RpbmdzTGluZXMgPSBlbmNvZGluZ3NNM3U4LnJlcGxhY2UoJ1xyJywgJycpLnNwbGl0KCdcbicpOwogICAgICAgIHZhciBmaXJzdFVybCA9IG51bGw7CiAgICAgICAgdmFyIGxhc3RVcmwgPSBudWxsOwogICAgICAgIHZhciBtYXRjaGVkUmVzb2x1dGlvblVybCA9IG51bGw7CiAgICAgICAgdmFyIG1hdGNoZWRGcmFtZVJhdGUgPSBmYWxzZTsKICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGVuY29kaW5nc0xpbmVzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIGlmICghZW5jb2RpbmdzTGluZXNbaV0uc3RhcnRzV2l0aCgnIycpICYmIGVuY29kaW5nc0xpbmVzW2ldLmluY2x1ZGVzKCcubTN1OCcpKSB7CiAgICAgICAgICAgICAgICBpZiAoaSA+IDAgJiYgZW5jb2RpbmdzTGluZXNbaSAtIDFdLnN0YXJ0c1dpdGgoJyNFWFQtWC1TVFJFQU0tSU5GJykpIHsKICAgICAgICAgICAgICAgICAgICB2YXIgYXR0cmlidXRlcyA9IHBhcnNlQXR0cmlidXRlcyhlbmNvZGluZ3NMaW5lc1tpIC0gMV0pOwogICAgICAgICAgICAgICAgICAgIHZhciByZXNvbHV0aW9uID0gYXR0cmlidXRlc1snUkVTT0xVVElPTiddOwogICAgICAgICAgICAgICAgICAgIHZhciBmcmFtZVJhdGUgPSBhdHRyaWJ1dGVzWydGUkFNRS1SQVRFJ107CiAgICAgICAgICAgICAgICAgICAgaWYgKHJlc29sdXRpb24pIHsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHF1YWxpdHlPdmVycmlkZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHF1YWxpdHkgPSByZXNvbHV0aW9uLnRvTG93ZXJDYXNlKCkuc3BsaXQoJ3gnKVsxXTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChxdWFsaXR5ID09IHF1YWxpdHlPdmVycmlkZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1YWxpdHlPdmVycmlkZUZvdW5kUXVhbGl0eSA9IHF1YWxpdHk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eU92ZXJyaWRlRm91bmRGcmFtZVJhdGUgPSBmcmFtZVJhdGU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF0Y2hlZFJlc29sdXRpb25VcmwgPSBlbmNvZGluZ3NMaW5lc1tpXTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZnJhbWVSYXRlIDwgNDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9jb25zb2xlLmxvZyhgcXVhbGl0eU92ZXJyaWRlKEEpIHF1YWxpdHk6JHtxdWFsaXR5fSBmcmFtZVJhdGU6JHtmcmFtZVJhdGV9YCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBtYXRjaGVkUmVzb2x1dGlvblVybDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHF1YWxpdHkgPCBxdWFsaXR5T3ZlcnJpZGUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2lmIChtYXRjaGVkUmVzb2x1dGlvblVybCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgIGNvbnNvbGUubG9nKGBxdWFsaXR5T3ZlcnJpZGUoQikgcXVhbGl0eToke3F1YWxpdHlPdmVycmlkZUZvdW5kUXVhbGl0eX0gZnJhbWVSYXRlOiR7cXVhbGl0eU92ZXJyaWRlRm91bmRGcmFtZVJhdGV9YCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy99IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgIGNvbnNvbGUubG9nKGBxdWFsaXR5T3ZlcnJpZGUoQykgcXVhbGl0eToke3F1YWxpdHl9IGZyYW1lUmF0ZToke2ZyYW1lUmF0ZX1gKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL30KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbWF0Y2hlZFJlc29sdXRpb25VcmwgPyBtYXRjaGVkUmVzb2x1dGlvblVybCA6IGVuY29kaW5nc0xpbmVzW2ldOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCghcmVzb2x1dGlvbkluZm8gfHwgcmVzb2x1dGlvbiA9PSByZXNvbHV0aW9uSW5mby5SZXNvbHV0aW9uKSAmJgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICghbWF0Y2hlZFJlc29sdXRpb25VcmwgfHwgKCFtYXRjaGVkRnJhbWVSYXRlICYmIGZyYW1lUmF0ZSA9PSByZXNvbHV0aW9uSW5mby5GcmFtZVJhdGUpKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF0Y2hlZFJlc29sdXRpb25VcmwgPSBlbmNvZGluZ3NMaW5lc1tpXTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hdGNoZWRGcmFtZVJhdGUgPSBmcmFtZVJhdGUgPT0gcmVzb2x1dGlvbkluZm8uRnJhbWVSYXRlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1hdGNoZWRGcmFtZVJhdGUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbWF0Y2hlZFJlc29sdXRpb25Vcmw7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgaWYgKGZpcnN0VXJsID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgZmlyc3RVcmwgPSBlbmNvZGluZ3NMaW5lc1tpXTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgbGFzdFVybCA9IGVuY29kaW5nc0xpbmVzW2ldOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmIChxdWFsaXR5T3ZlcnJpZGUpIHsKICAgICAgICAgICAgcmV0dXJuIGxhc3RVcm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YWNoZVtwbGF5ZXJUeXBlXS5SZXNvbHV0aW9uID0gcmVzb2x1dGlvbkluZm8uUmVzb2x1dGlvbjsKICAgICAgICB2YXIgc3RyZWFtTTN1OFVybCA9IGdldFN0cmVhbVVybEZvclJlc29sdXRpb24oZW5jb2RpbmdzTTN1OCwgcmVzb2x1dGlvbkluZm8sIHF1YWxpdHlPdmVycmlkZSk7CiAgICAgICAgdmFyIHN0cmVhbU0zdThSZXNwb25zZSA9IGF3YWl0IHJlYWxGZXRjaChzdHJlYW1NM3U4VXJsKTsKICAgICAgICBpZiAoc3RyZWFtTTN1OFJlc3BvbnNlLnN0YXR1cyA9PSAyMDApIHsKICAgICAgICAgICAgdmFyIG0zdThUZXh0ID0gYXdhaXQgc3RyZWFtTTN1OFJlc3BvbnNlLnRleHQoKTsKICAgICAgICAgICAgV2FzU2hvd2luZ0FkID0gdHJ1ZTsKICAgICAgICAgICAgcG9zdE1lc3NhZ2UoewogICAgICAgICAgICAgICAga2V5OiAnU2hvd0FkQmxvY2tCYW5uZXInCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBwb3N0TWVzc2FnZSh7CiAgICAgICAgICAgICAgICBrZXk6ICdGb3JjZUNoYW5nZVF1YWxpdHknCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBpZiAoIW0zdThUZXh0IHx8IG0zdThUZXh0LmluY2x1ZGVzKEFkU2lnbmlmaWVyKSkgewogICAgICAgICAgICAgICAgc3RyZWFtSW5mby5FbmNvZGluZ3NNM1U4Q2FjaGVbcGxheWVyVHlwZV0uVmFsdWUgPSBudWxsOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiBtM3U4VGV4dDsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBzdHJlYW1JbmZvLkVuY29kaW5nc00zVThDYWNoZVtwbGF5ZXJUeXBlXS5WYWx1ZSA9IG51bGw7CiAgICAgICAgICAgIHJldHVybiBmYWxsYmFja1N0cmVhbVN0cjsKICAgICAgICB9CiAgIC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lIGxpdmUgc3RyZWFtcyB1c2UgbXA0LgogICAgICAgIGlmICghdGV4dFN0ci5pbmNsdWRlcygnLnRzJykgJiYgIXRleHRTdHIuaW5jbHVkZXMoJy5tcDQnKSkgewogICAgICAgICAgICByZXR1cm4gdGV4dFN0cjsKICAgICAgICB9CiAgICAgICAgdmFyIGhhdmVBZFRhZ3MgPSB0ZXh0U3RyLmluY2x1ZGVzKEFkU2lnbmlmaWVyKTsKICAgICAgICBpZiAoaGF2ZUFkVGFncykgewogICAgICAgICAgICB2YXIgaXNNaWRyb2xsID0gdGV4dFN0ci5pbmNsdWRlcygnIk1JRFJPTEwiJykgfHwgdGV4dFN0ci5pbmNsdWRlcygnIm1pZHJvbGwiJyk7CiAgICAgICAgICAgIC8vUmVkdWNlcyBhZCBmcmVxdWVuY3kuIFRPRE86IFJlZHVjZSB0aGUgbnVtYmVyIG9mIHJlcXVlc3RzLiBUaGlzIGlzIHJlYWxseSBzcGFtbWluZyBUd2l0Y2ggd2l0aCByZXF1ZXN0cy4KICAgICAgICAgICAgaWYgKCFpc01pZHJvbGwpIHsKICAgICAgICAgICAgICAgIGlmIChwbGF5ZXJUeXBlID09PSBQbGF5ZXJUeXBlMikgewogICAgICAgICAgICAgICAgICAgIHZhciBsaW5lcyA9IHRleHRTdHIucmVwbGFjZSgnXHInLCAnJykuc3BsaXQoJ1xuJyk7CiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsaW5lcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGluZSA9IGxpbmVzW2ldOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAobGluZS5zdGFydHNXaXRoKCcjRVhUSU5GJykgJiYgbGluZXMubGVuZ3RoID4gaSArIDEpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbGluZS5pbmNsdWRlcygnLGxpdmUnKSAmJiAhc3RyZWFtSW5mby5SZXF1ZXN0ZWRBZHMuaGFzKGxpbmVzW2kgKyAxXSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBPbmx5IHJlcXVlc3Qgb25lIC50cyBmaWxlIHBlciAubTN1OCByZXF1ZXN0IHRvIGF2b2lkIG1ha2luZyB0b28gbWFueSByZXF1ZXN0cwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vY29uc29sZS5sb2coJ0ZldGNoIGFkIC50cyBmaWxlJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtSW5mby5SZXF1ZXN0ZWRBZHMuYWRkKGxpbmVzW2kgKyAxXSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmV0Y2gobGluZXNbaSArIDFdKS50aGVuKChyZXNwb25zZSk9PntyZXNwb25zZS5ibG9iKCl9KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgLy90cnlOb3RpZnlUd2l0Y2godGV4dFN0cik7CiAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHt9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgdmFyIGN1cnJlbnRSZXNvbHV0aW9uID0gbnVsbDsKICAgICAgICAgICAgaWYgKHN0cmVhbUluZm8gJiYgc3RyZWFtSW5mby5VcmxzKSB7CiAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IFtyZXNVcmwsIHJlc0luZm9dIG9mIE9iamVjdC5lbnRyaWVzKHN0cmVhbUluZm8uVXJscykpIHsKICAgICAgICAgICAgICAgICAgICBpZiAocmVzVXJsID09IHVybCkgewogICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50UmVzb2x1dGlvbiA9IHJlc0luZm87CiAgICAgICAgICAgICAgICAgICAgICAgIC8vY29uc29sZS5sb2cocmVzSW5mby5SZXNvbHV0aW9uKTsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIC8vIEtlZXAgdGhlIG0zdTggYXJvdW5kIGZvciBhIGxpdHRsZSB3aGlsZSAob25jZSBwZXIgYWQpIGJlZm9yZSByZXF1ZXN0aW5nIGEgbmV3IG9uZQogICAgICAgICAgICB2YXIgZW5jb2RpbmdzTTNVOENhY2hlID0gc3RyZWFtSW5mby5FbmNvZGluZ3NNM1U4Q2FjaGVbcGxheWVyVHlwZV07CiAgICAgICAgICAgIGlmIChlbmNvZGluZ3NNM1U4Q2FjaGUpIHsKICAgICAgICAgICAgICAgIGlmIChlbmNvZGluZ3NNM1U4Q2FjaGUuVmFsdWUgJiYgZW5jb2RpbmdzTTNVOENhY2hlLlJlcXVlc3RUaW1lID49IERhdGUubm93KCkgLSBFbmNvZGluZ0NhY2hlVGltZW91dCkgewogICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXN1bHQgPSBnZXRTdHJlYW1Gb3JSZXNvbHV0aW9uKHN0cmVhbUluZm8sIGN1cnJlbnRSZXNvbHV0aW9uLCBlbmNvZGluZ3NNM1U4Q2FjaGUuVmFsdWUsIG51bGwsIHBsYXllclR5cGUsIHJlYWxGZXRjaCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHsKICAgICAgICAgICAgICAgICAgICAgICAgZW5jb2RpbmdzTTNVOENhY2hlLlZhbHVlID0gbnVsbDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBzdHJlYW1JbmZvLkVuY29kaW5nc00zVThDYWNoZVtwbGF5ZXJUeXBlXSA9IHsKICAgICAgICAgICAgICAgICAgICBSZXF1ZXN0VGltZTogRGF0ZS5ub3coKSwKICAgICAgICAgICAgICAgICAgICBWYWx1ZTogbnVsbCwKICAgICAgICAgICAgICAgICAgICBSZXNvbHV0aW9uOiBudWxsCiAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICB9CiAgICAgICAgICAgIHZhciBhY2Nlc3NUb2tlblJlc3BvbnNlID0gYXdhaXQgZ2V0QWNjZXNzVG9rZW4oQ3VycmVudENoYW5uZWxOYW1lLCBwbGF5ZXJUeXBlKTsKICAgICAgICAgICAgaWYgKGFjY2Vzc1Rva2VuUmVzcG9uc2Uuc3RhdHVzID09PSAyMDApIHsKICAgICAgICAgICAgICAgIHZhciBhY2Nlc3NUb2tlbiA9IGF3YWl0IGFjY2Vzc1Rva2VuUmVzcG9uc2UuanNvbigpOwogICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICB2YXIgdXJsSW5mbyA9IG5ldyBVUkwoJ2h0dHBzOi8vdXNoZXIudHR2bncubmV0L2FwaS9jaGFubmVsL2hscy8nICsgQ3VycmVudENoYW5uZWxOYW1lICsgJy5tM3U4JyArIFVzaGVyUGFyYW1zKTsKICAgICAgICAgICAgICAgICAgICB1cmxJbmZvLnNlYXJjaFBhcmFtcy5zZXQoJ3NpZycsIGFjY2Vzc1Rva2VuLmRhdGEuc3RyZWFtUGxheWJhY2tBY2Nlc3NUb2tlbi5zaWduYXR1cmUpOwogICAgICAgICAgICAgICAgICAgIHVybEluZm8uc2VhcmNoUGFyYW1zLnNldCgndG9rZW4nLCBhY2Nlc3NUb2tlbi5kYXRhLnN0cmVhbVBsYXliYWNrQWNjZXNzVG9rZW4udmFsdWUpOwogICAgICAgICAgICAgICAgICAgIHZhciBlbmNvZGluZ3NNM3U4UmVzcG9uc2UgPSBhd2FpdCByZWFsRmV0Y2godXJsSW5mby5ocmVmKTsKICAgICAgICAgICAgICAgICAgICBpZiAoZW5jb2RpbmdzTTN1OFJlc3BvbnNlLnN0YXR1cyA9PT0gMjAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBnZXRTdHJlYW1Gb3JSZXNvbHV0aW9uKHN0cmVhbUluZm8sIGN1cnJlbnRSZXNvbHV0aW9uLCBhd2FpdCBlbmNvZGluZ3NNM3U4UmVzcG9uc2UudGV4dCgpLCB0ZXh0U3RyLCBwbGF5ZXJUeXBlLCByZWFsRmV0Y2gpOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0U3RyOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge30KICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0U3RyOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIHRleHRTdHI7CiAgICAgICAgICAgIH0KICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBpZiAoV2FzU2hvd2luZ0FkKSB7CiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygnRmluaXNoZWQgYmxvY2tpbmcgYWRzJyk7CiAgICAgICAgICAgICAgICBXYXNTaG93aW5nQWQgPSBmYWxzZTsKICAgICAgICAgICAgICAgIC8vSGVyZSB3ZSBwdXQgcGxheWVyIGJhY2sgdG8gb3JpZ2luYWwgcXVhbGl0eSBhbmQgcmVtb3ZlIHRoZSBibG9ja2luZyBtZXNzYWdlLgogICAgICAgICAgICAgICAgcG9zdE1lc3NhZ2UoewogICAgICAgICAgICAgICAgICAgIGtleTogJ0ZvcmNlQ2hhbmdlUXVhbGl0eScsCiAgICAgICAgICAgICAgICAgICAgdmFsdWU6ICdvcmlnaW5hbCcKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgcG9zdE1lc3NhZ2UoewogICAgICAgICAgICAgICAgICAgIGtleTogJ1BhdXNlUmVzdW1lUGxheWVyJwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBwb3N0TWVzc2FnZSh7CiAgICAgICAgICAgICAgICAgICAga2V5OiAnSGlkZUFkQmxvY2tCYW5uZXInCiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gdGV4dFN0cjsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHRleHRTdHI7CiAgICB9CiAgICBmdW5jdGlvbiBwYXJzZUF0dHJpYnV0ZXMoc3RyKSB7CiAgICAgICAgcmV0dXJuIE9iamVjdC5mcm9tRW50cmllcygKICAgICAgICAgICAgc3RyLnNwbGl0KC8oPzpefCwpKCg/OltePV0qKT0oPzoiW14iXSoifFteLF0qKSkvKQogICAgICAgICAgICAuZmlsdGVyKEJvb2xlYW4pCiAgICAgICAgICAgIC5tYXAoeCA9PiB7CiAgICAgICAgICAgICAgICBjb25zdCBpZHggPSB4LmluZGV4T2YoJz0nKTsKICAgICAgICAgICAgICAgIGNvbnN0IGtleSA9IHguc3Vic3RyaW5nKDAsIGlkeCk7CiAgICAgICAgICAgICAgICBjb25zdCB2YWx1ZSA9IHguc3Vic3RyaW5nKGlkeCArIDEpOwogICAgICAgICAgICAgICAgY29uc3QgbnVtID0gTnVtYmVyKHZhbHVlKTsKICAgICAgICAgICAgICAgIHJldHVybiBba2V5LCBOdW1iZXIuaXNOYU4obnVtKSA/IHZhbHVlLnN0YXJ0c1dpdGgoJyInKSA/IEpTT04ucGFyc2UodmFsdWUpIDogdmFsdWUgOiBudW1dOwogICAgICAgICAgICB9KSk7CiAgICB9CiAgICBhc3luYyBmdW5jdGlvbiB0cnlOb3RpZnlUd2l0Y2goc3RyZWFtTTN1OCkgewogICAgICAgIC8vV2Ugbm90aWZ5IHRoYXQgYW4gYWQgd2FzIHJlcXVlc3RlZ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cm9sbFR5cGUgPSBhdHRyWydYLVRWLVRXSVRDSC1BRC1ST0xMLVRZUEUnXS50b0xvd2VyQ2FzZSgpOwogICAgICAgICAgICBjb25zdCBiYXNlRGF0YSA9IHsKICAgICAgICAgICAgICAgIHN0aXRjaGVkOiB0cnVlLAogICAgICAgICAgICAgICAgcm9sbF90eXBlOiByb2xsVHlwZSwKICAgICAgICAgICAgICAgIHBsYXllcl9tdXRlOiB0cnVlLAogICAgICAgICAgICAgICAgcGxheWVyX3ZvbHVtZTogMC4wLAogICAgICAgICAgICAgICAgdmlzaWJsZTogZmFsc2UsCiAgICAgICAgICAgIH07CiAgICAgICAgICAgIGZvciAobGV0IHBvZFBvc2l0aW9uID0gMDsgcG9kUG9zaXRpb24gPCBwb2RMZW5ndGg7IHBvZFBvc2l0aW9uKyspIHsKICAgICAgICAgICAgICAgIGNvbnN0IGV4dGVuZGVkRGF0YSA9IHsKICAgICAgICAgICAgICAgICAgICAuLi5iYXNlRGF0YSwKICAgICAgICAgICAgICAgICAgICBhZF9pZDogYWRJZCwKICAgICAgICAgICAgICAgICAgICBhZF9wb3NpdGlvbjogcG9kUG9zaXRpb24sCiAgICAgICAgICAgICAgICAgICAgZHVyYXRpb246IDAsCiAgICAgICAgICAgICAgICAgICAgY3JlYXRpdmVfaWQ6IGNyZWF0aXZlSWQsCiAgICAgICAgICAgICAgICAgICAgdG90YWxfYWRzOiBwb2RMZW5ndGgsCiAgICAgICAgICAgICAgICAgICAgb3JkZXJfaWQ6IG9yZGVySWQsCiAgICAgICAgICAgICAgICAgICAgbGluZV9pdGVtX2lkOiBsaW5lSXRlbUlkLAogICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgIGF3YWl0IGdxbFJlcXVlc3QoYWRSZWNvcmRncWxQYWNrZXQoJ3ZpZGVvX2FkX2ltcHJlc3Npb24nLCByYWRUb2tlbiwgZXh0ZW5kZWREYXRhKSk7CiAgICAgICAgICAgICAgICBmb3IgKGxldCBxdWFydGlsZSA9IDA7IHF1YXJ0aWxlIDwgNDsgcXVhcnRpbGUrKykgewogICAgICAgICAgICAgICAgICAgIGF3YWl0IGdxbFJlcXVlc3QoCiAgICAgICAgICAgICAgICAgICAgICAgIGFkUmVjb3JkZ3FsUGFja2V0KCd2aWRlb19hZF9xdWFydGlsZV9jb21wbGV0ZScsIHJhZFRva2VuLCB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuLi5leHRlbmRlZERhdGEsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWFydGlsZTogcXVhcnRpbGUgKyAxLAogICAgICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBhd2FpdCBncWxSZXF1ZXN0KGFkUmVjb3JkZ3FsUGFja2V0KCd2aWRlb19hZF9wb2RfY29tcGxldGUnLCByYWRUb2tlbiwgYmFzZURhdGEpKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KICAgIGZ1bmN0aW9uIGFkUmVjb3JkZ3FsUGFja2V0KGV2ZW50LCByYWRUb2tlbiwgcGF5bG9hZCkgewogICAgICAgIHJldHVybiBbewogICAgICAgICAgICBvcGVyYXRpb25OYW1lOiAnQ2xpZW50U2lkZUFkRXZlbnRIYW5kbGluZ19SZWNvcmRBZEV2ZW50JywKICAgICAgICAgICAgdmFyaWFibGVzOiB7CiAgICAgICAgICAgICAgICBpbnB1dDogewogICAgICAgICAgICAgICAgICAgIGV2ZW50TmFtZTogZXZlbnQsCiAgICAgICAgICAgICAgICAgICAgZXZlbnRQYXlsb2FkOiBKU09OLnN0cmluZ2lmeShwYXlsb2FkKSwKICAgICAgICAgICAgICAgICAgICByYWRUb2tlbiwKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGV4dGVuc2lvbnM6IHsKICAgICAgICAgICAgICAgIHBlcnNpc3RlZFF1ZXJ5OiB7CiAgICAgICAgICAgICAgICAgIC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wZXJhdGlvbk5hbWU6ICdQbGF5YmFja0FjY2Vzc1Rva2VuX1RlbXBsYXRlJywKICAgICAgICAgICAgcXVlcnk6IHRlbXBsYXRlUXVlcnksCiAgICAgICAgICAgIHZhcmlhYmxlczogewogICAgICAgICAgICAgICAgJ2lzTGl2ZSc6IHRydWUsCiAgICAgICAgICAgICAgICAnbG9naW4nOiBjaGFubmVsTmFtZSwKICAgICAgICAgICAgICAgICdpc1ZvZCc6IGZhbHNlLAogICAgICAgICAgICAgICAgJ3ZvZElEJzogJycsCiAgICAgICAgICAgICAgICAncGxheWVyVHlwZSc6IHBsYXllclR5cGUKICAgICAgICAgICAgfQogICAgICAgIH07CiAgICAgICAgcmV0dXJuIGdxbFJlcXVlc3QoYm9keSwgcmVhbEZldGNoKTsKICAgIH0KICAgIGZ1bmN0aW9uIGdxbFJlcXVlc3QoYm9keSwgcmVhbEZldGNoKSB7CiAgICAgICAgaWYgKENsaWVudEludGVncml0eUhlYWRlciA9PSBudWxsKSB7CiAgICAgICAgICAgIC8vY29uc29sZS53YXJuKCdDbGllbnRJbnRlZ3JpdHlIZWFkZXIgaXMgbnVsbCcpOwogICAgICAgICAgICAvL3Rocm93ICdDbGllbnRJbnRlZ3JpdHlIZWFkZXIgaXMgbnVsbCc7CiAgICAgICAgfQogICAgICAgIHZhciBmZXRjaEZ1bmMgPSByZWFsRmV0Y2ggPyByZWFsRmV0Y2ggOiBmZXRjaDsKICAgICAgICBpZiAoIUdRTERldmljZUlEKSB7CiAgICAgICAgICAgIHZhciBkY2hhcmFjdGVycyA9ICdhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODknOwogICAgICAgICAgICB2YXIgZGNoYXJhY3RlcnNMZW5ndGggPSBkY2hhcmFjdGVycy5sZW5ndGg7CiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMzI7IGkrKykgewogICAgICAgICAgICAgICAgR1FMRGV2aWNlSUQgKz0gZGNoYXJhY3RlcnMuY2hhckF0KE1hdGguZmxvb3IoTWF0aC5yYW5kb20oKSAqIGRjaGFyYWN0ZXJzTGVuZ3RoKSk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZldGNoRnVuYygnaHR0cHM6Ly9ncWwudHdpdGNoLnR2L2dxbCcsIHsKICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCcsCiAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KGJvZHkpLAogICAgICAgICAgICBoZWFkZXJzOiB7CiAgICAgICAgICAgICAgICAnQ2xpZW50LUlEJzogQ2xpZW50SUQsCiAgICAgICAgICAgICAgICAnQ2xpZW50LUludGVncml0eSc6IENsaWVudEludGVncml0eUhlYWRlciwKICAgICAgICAgICAgICAgICdEZXZpY2UtSUQnOiBHUUxEZXZpY2VJRCwKICAgICAgICAgICAgICAgICdYLURldmljZS1JZCc6IEdRTERldmljZUlELAogICAgICAgICAgICAgICAgJ0NsaWVudC1WZXJzaW9uJzogQ2xpZW50VmVyc2lvbiwKICAgICAgICAgICAgICAgICdDbGllbnQtU2Vzc2lvbi1JZCc6IENsaWVudFNlc3Npb24sCiAgICAgICAgICAgICAgICAnQXV0aG9yaXphdGlvbic6IEF1dGhvcml6YXRpb25IZWFkZXIKICAgICAgICAgICAgfQogICAgICAgIH0pOwogICAgfQogICAgZnVuY3Rpb24gZG9Ud2l0Y2hQbGF5ZXJUYXNrKGlzUGF1c2VQbGF5LCBpc0NoZWNrUXVhbGl0eSwgaXNDb3JyZWN0QnVmZmVyLCBpc0F1dG9RdWFsaXR5LCBzZXRBdXRvUXVhbGl0eSkgewogICAgICAgIC8vVGhpcyB3aWxsIGRvIGFuIGluc3RhbnQgcGF1c2UvcGxheSB0byByZXR1cm4gdG8gb3JpZ2luYWwgcXVhbGl0eSBvbmNlIHRoZSBhZCBpcyBmaW5pc2hlZC4KICAgICAgICAvL1dlIGFsc28gdXNlIHRoaXMgZnVuY3Rpb24gdG8gZ2V0IHRoZSBjdXJyZW50IHZpZGVvIHBsYXllciBxdWFsaXR5IHNldCBieSB0aGUgdXNlci4KICAgICAgICAvL1dlIGFsc28gdXNlIHRoaXMgZnVuY3Rpb24gdG8gcXVpY2tseSBwYXVzZS9wbGF5IHRoZSBwbGF5ZXIgd2hlbiBzd2l0Y2hpbmcgdGFicyB0byBzdG9wIGRlbGF5cy4KICAgICAgICB0cnkgewogICAgICAgICAgICB2YXIgdmlkZW9Db250cm9sbGVyID0gbnVsbDsKICAgICAgICAgICAgdmFyIHZpZGVvUGxheWVyID0gbnVsbDsKICAgICAgICAgICAgZnVuY3Rpb24gZmluZFJlYWN0Tm9kZShyb290LCBjb25zdHJhaW50KSB7CiAgICAgICAgICAgICAgICBpZiAocm9vdC5zdGF0ZU5vZGUgJiYgY29uc3RyYWludChyb290LnN0YXRlTm9kZSkpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gcm9vdC5zdGF0ZU5vZGU7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBsZXQgbm9kZSA9IHJvb3QuY2hpbGQ7CiAgICAgICAgICAgICAgICB3aGlsZSAobm9kZSkgewogICAgICAgICAgICAgICAgICAgIGNvbnN0IHJlc3VsdCA9IGZpbmRSZWFjdE5vZGUobm9kZSwgY29uc3RyYWludCk7CiAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCkgewogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0OwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBub2RlID0gbm9kZS5zaWJsaW5nOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZnVuY3Rpb24gZmluZFJlYWN0Um9vdE5vZGUoKSB7CiAgICAgICAgICAgICAgICB2YXIgcmVhY3RSb290Tm9kZSA9IG51bGw7CiAgICAgICAgICAgICAgICB2YXIgcm9vdE5vZGUgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjcm9vdCcpOwogICAgICAgICAgICAgICAgaWYgKHJvb3ROb2RlICYmIHJvb3ROb2RlLl9yZWFjdFJvb3RDb250YWluZXIgJiYgcm9vdE5vZGUuX3JlYWN0Um9vdENvbnRhaW5lci5faW50ZXJuYWxSb290ICYmIHJvb3ROb2RlLl9yZWFjdFJvb3RDb250YWluZXIuX2ludGVybmFsUm9vdC5jdXJyZW50KSB7CiAgICAgICAgICAgICAgICAgICAgcmVhY3RSb290Tm9kZSA9IHJvb3ROb2RlLl9yZWFjdFJvb3RDb250YWluZXIuX2ludGVybmFsUm9vdC5jdXJyZW50OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgaWYgKHJlYWN0Um9vdE5vZGUgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgIHZhciBjb250YWluZXJOYW1lID0gT2JqZWN0LmtleXMocm9vdE5vZGUpLmZpbmQoeCA9PiB4LnN0YXJ0c1dpdGgoJ19fcmVhY3RDb250YWluZXInKSk7CiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnRhaW5lck5hbWUgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICByZWFjdFJvb3ROb2RlID0gcm9vdE5vZGVbY29udGFpbmVyTmFtZV07CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgcmV0dXJuIHJlYWN0Um9vdE5vZGU7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgdmFyIHJlYWN0Um9vdE5vZGUgPSBmaW5kUmVhY3RSb290Tm9kZSgpOwogICAgICAgICAgICBpZiAoIXJlYWN0Um9vdE5vZGUpIHsKICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCdDb3VsZCBub3QgZmluZCByZWFjdCByb290Jyk7CiAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgIH0KICAgICAgICAgICAgdmlkZW9QbGF5ZXIgPSBmaW5kUmVhY3ROb2RlKHJlYWN0Um9vdE5vZGUsIG5vZGUgPT4gbm9kZS5zZXRQbGF5ZXJBY3RpdmUgJiYgbm9kZS5wcm9wcyAmJiBub2RlLnByb3BzLm1lZGlhUGxheWVySW5zdGFuY2UpOwogICAgICAgICAgICB2aWRlb1BsYXllciA9IHZpZGVvUGxheWVyICYmIHZpZGVvUGxheWVyLnByb3BzICYmIHZpZGVvUGxheWVyLnByb3BzLm1lZGlhUGxheWVySW5zdGFuY2UgPyB2aWRlb1BsYXllci5wcm9wcy5tZWRpYVBsYXllckluc3RhbmNlIDogbnVsbDsKICAgICAgICAgICAgaWYgKGlzUGF1c2VQbGF5KSB7CiAgICAgICAgICAgICAgICB2aWRlb1BsYXllci5wYXVzZSgpOwogICAgICAgICAgICAgICAgdmlkZW9QbGF5ZXIucGxheSgpOwogICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmIChpc0NoZWNrUXVhbGl0eSkgewogICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB2aWRlb1BsYXllci5nZXRRdWFsaXR5KCkgPT0gJ3VuZGVmaW5lZCcpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB2YXIgcGxheWVyUXVhbGl0eSA9IEpTT04uc3RyaW5naWZ5KHZpZGVvUGxheWVyLmdldFF1YWxpdHkoKSk7CiAgICAgICAgICAgICAgICBpZiAocGxheWVyUXVhbGl0eSkgewogICAgICAgICAgICAgICAgICAgIHJldHVybiBwbGF5ZXJRdWFsaXR5OwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGlzQXV0b1F1YWxpdHkpIHsKICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdmlkZW9QbGF5ZXIuaXNBdXRvUXVhbGl0eU1vZGUoKSA9PSAndW5kZWZpbmVkJykgewogICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHZhciBhdXRvUXVhbGl0eSA9IHZpZGVvUGxheWVyLmlzQXV0b1F1YWxpdHlNb2RlKCk7CiAgICAgICAgICAgICAgICBpZiAoYXV0b1F1YWxpdHkpIHsKICAgICAgICAgICAgICAgICAgICB2aWRlb1BsYXllci5zZXRBdXRvUXVhbGl0eU1vZGUoZmFsc2UpOwogICAgICAgICAgICAgICAgICAgIHJldHVybiBhdXRvUXVhbGl0eTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmIChzZXRBdXRvUXVhbGl0eSkgewogICAgICAgICAgICAgICAgdmlkZW9QbGF5ZXIuc2V0QXV0b1F1YWxpdHlNb2RlKHRydWUpOwogICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICB9CiAgICAgICAgICAgIC8vVGhpcyBvbmx5IGhhcHBlbnMgd2hlbiBzd2l0Y2hpbmcgdGFicyBhbmQgaXMgdG8gY29ycmVjdCB0aGUgaGlnaCBsYXRlbmN5IGNhdXNlZCB3aGVuIG9wZW5pbmcgYmFja2dyb3VuZCB0YWJzIGFuZCBnb2luZyB0byB0aGVtIGF0IGEgbGF0ZXIgdGltZS4KICAgICAgICAgICAgLy9XZSBjaGVjayB0aGF0IHRoaXMgaXMgYSBsaXZlIHN0cmVhbSBieSB0aGUgcGFnZSBVUkwsIHRvIHByZXZlbnQgdm9kL2NsaXAgcGF1c2UvcGxheXMuCiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICB2YXIgY3VycmVudFBhZ2VVUkwgPSBkb2N1bWVudC5VUkw7CiAgICAgICAgICAgICAgICB2YXIgaXNMaXZlID0gdHJ1ZTsKICAgICAgICAgICAgICAgIGlmIChjdXJyZW50UGFnZVVSTC5pbmNsdWRlcygndmlkZW9zLycpIHx8IGN1cnJlbnRQYWdlVVJMLmluY2x1ZGVzKCdjbGlwLycpKSB7CiAgICAgICAgICAgICAgICAgICAgaXNMaXZlID0gZmFsc2U7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZiAoaXNDb3JyZWN0QnVmZmVyICYmIGlzTGl2ZSkgewogICAgICAgICAgICAgICAgICAgIC8vQSB0aW1lciBpcyBuZWVkZWQgZHVlIHRvIHRoZSBwbGF5ZXIgbm90IHJlc3VtaW5nIHdpdGhvdXQgaXQuCiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgICAgICAgICAgLy9JZiBsYXRlbmN5IHRvIGJyb2FkY2FzdGVyIGlzIGFib3ZlIDUgb3IgMTUgc2Vjb25kcyB1cG9uIHN3aXRjaGluZyB0YWJzLCB3ZSBwYXVzZSBhbmQgcGxheSB0aGUgcGxheWVyIHRvIHJlc2V0IHRoZSBsYXRlbmN5LgogICAgICAgICAgICAgICAgICAgICAgICAvL0lmIGxhdGVuY3kgaXMgYmV0d2VlbiAwLTYsIHVzZXIgY2FuIG1hbnVhbGx5IHBhdXNlIGFuZCByZXN1bWUgdG8gcmVzZXQgbGF0ZW5jeSBmdXJ0aGVyLgogICAgICAgICAgICAgICAgICAgICAgICBpZiAodmlkZW9QbGF5ZXIuaXNMaXZlTG93TGF0ZW5jeSgpICYmIHZpZGVvUGxheWVyLmdldExpdmVMYXRlbmN5KCkgPiA1KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlb1BsYXllci5wYXVzZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW9QbGF5ZXIucGxheSgpOwogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHZpZGVvUGxheWVyLmdldExpdmVMYXRlbmN5KCkgPiAxNSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW9QbGF5ZXIucGF1c2UoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvUGxheWVyLnBsYXkoKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0sIDMwMDApOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9IGNhdGNoIChlcnIpIHt9CiAgICAgICAgfSBjYXRjaCAoZXJyKSB7fQogICAgfQogICAgd2luZG93LnJlbG9hZFR3aXRjaFBsYXllciA9IGRvVHdpdGNoUGxheWVyVGFzazsKICAgIHZhciBsb2NhbERldmljZUlEID0gbnVsbDsKICAgIGxvY2FsRGV2aWNlSUQgPSB3aW5kb3cubG9jYWxTdG9yYWdlLmdldEl0ZW0oJ2xvY2FsX2NvcHlfdW5pcXVlX2lkJyk7CiAgICBmdW5jdGlvbiBwb3N0VHdpdGNoV29ya2VyTWVzc2FnZShrZXksIHZhbHVlKSB7CiAgICAgICAgdHdpdGNoV29ya2Vycy5mb3JFYWNoKCh3b3JrZXIpID0+IHsKICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHtrZXk6IGtleSwgdmFsdWU6IHZhbHVlfSk7CiAgICAgICAgfSk7CiAgICB9CiAgICBmdW5jdGlvbiBob29rRmV0Y2goKSB7CiAgICAgICAgdmFyIHJlYWxGZXRjaCA9IHdpbmRvdy5mZXRjaDsKICAgICAgICB3aW5kb3cuZmV0Y2ggPSBmdW5jdGlvbih1cmwsIGluaXQsIC4uLmFyZ3MpIHsKICAgICAgICAgICAgaWYgKHR5cGVvZiB1cmwgPT09ICdzdHJpbmcnKSB7CiAgICAgICAgICAgICAgICAvL0NoZWNrIGlmIHNxdWFkIHN0cmVhbS4KICAgICAgICAgICAgICAgIGlmICh3aW5kb3cubG9jYXRpb24ucGF0aG5hbWUuaW5jbHVkZXMoJy9zcXVhZCcpKSB7CiAgICAgICAgICAgICAgICAgICAgcG9zdFR3aXRjaFdvcmtlck1lc3NhZ2UoJ1VwZGF0ZUlzU3F1YWRTdHJlYW0nLCB0cnVlKTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgcG9zdFR3aXRjaFdvcmtlck1lc3NhZ2UoJ1VwZGF0ZUlzU3F1YWRTdHJlYW0nLCBmYWxzZSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZiAodXJsLmluY2x1ZGVzKCcvYWNjZXNzX3Rva2VuJykgfHwgdXJsLmluY2x1ZGVzKCdncWwnKSkgewogICAgICAgICAgICAgICAgICAgIC8vRGV2aWNlIElEIGlzIHVzZWQgd2hlbiBub3RpZnlpbmcgVHdpdGNoIG9mIGFkcy4KICAgICAgICAgICAgICAgICAgICB2YXIgZGV2aWNlSWQgPSBpbml0LmhlYWRlcnNbJ1gtRGV2aWNlLUlkJ107CiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBkZXZpY2VJZCAhPT0gJ3N0cmluZycpIHsKICAgICAgICAgICAgICAgICAgICAgICAgZGV2aWNlSWQgPSBpbml0LmhlYWRlcnNbJ0RldmljZS1JRCddOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAvL0FkZGVkIHRvIHByZXZlbnQgZXZlbnR1YWwgVUJsb2NrIGNvbmZsaWN0cy4KICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGRldmljZUlkID09PSAnc3RyaW5nJyAmJiAhZGV2aWNlSWQuaW5jbHVkZXMoJ3R3aXRjaC13ZWItd2FsbC1tYXNvbicpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIEdRTERldmljZUlEID0gZGV2aWNlSWQ7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChsb2NhbERldmljZUlEKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIEdRTERldmljZUlEID0gbG9jYWxEZXZpY2VJRC5yZXBsYWNlKCciJywgJycpOwogICAgICAgICAgICAgICAgICAgICAgICBHUUxEZXZpY2VJRCA9IEdRTERldmljZUlELnJlcGxhY2UoJyInLCAnJyk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGlmIChHUUxEZXZpY2VJRCkgewogICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGluaXQuaGVhZGVyc1snWC1EZXZpY2UtSWQnXSA9PT0gJ3N0cmluZycpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXQuaGVhZGVyc1snWC1EZXZpY2UtSWQnXSA9IEdRTERldmljZUlEOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgaW5pdC5oZWFkZXJzWydEZXZpY2UtSUQnXSA9PT0gJ3N0cmluZycpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXQuaGVhZGVyc1snRGV2aWNlLUlEJ10gPSBHUUxEZXZpY2VJRDsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBwb3N0VHdpdGNoV29ya2VyTWVzc2FnZSgnVXBkYXRlRGV2aWNlSWQnLCBHUUxEZXZpY2VJRCk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC8vQ2xpZW50IHZlcnNpb24gaXMgdXNlZCBpbiBHUUwgcmVxdWVzdHMuCiAgICAgICAgICAgICAgICAgICAgdmFyIGNsaWVudFZlcnNpb24gPSBpbml0LmhlYWRlcnNbJ0NsaWVudC1WZXJzaW9uJ107CiAgICAgICAgICAgICAgICAgICAgaWYgKGNsaWVudFZlcnNpb24gJiYgdHlwZW9mIGNsaWVudFZlcnNpb24gPT0gJ3N0cmluZycpIHsKICAgICAgICAgICAgICAgICAgICAgICAgQ2xpZW50VmVyc2lvbiA9IGNsaWVudFZlcnNpb247CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGlmIChDbGllbnRWZXJzaW9uKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHBvc3RUd2l0Y2hXb3JrZXJNZXNzYWdlKCdVcGRhdGVDbGllbnRWZXJzaW9uJywgQ2xpZW50VmVyc2lvbik7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC8vQ2xpZW50IHNlc3Npb24gaXMgdXNlZCBpbiBHUUwgcmVxdWVzdHMuCiAgICAgICAgICAgICAgICAgICAgdmFyIGNsaWVudFNlc3Npb24gPSBpbml0LmhlYWRlcnNbJ0NsaWVudC1TZXNzaW9uLUlkJ107CiAgICAgICAgICAgICAgICAgICAgaWYgKGNsaWVudFNlc3Npb24gJiYgdHlwZW9mIGNsaWVudFNlc3Npb24gPT0gJ3N0cmluZycpIHsKICAgICAgICAgICAgICAgICAgICAgICAgQ2xpZW50U2Vzc2lvbiA9IGNsaWVudFNlc3Npb247CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGlmIChDbGllbnRTZXNzaW9uKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHBvc3RUd2l0Y2hXb3JrZXJNZXNzYWdlKCdVcGRhdGVDbGllbnRTZXNzaW9uJywgQ2xpZW50U2Vzc2lvbik7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC8vQ2xpZW50IElEIGlzIHVzZWQgaW4gR1FMIHJlcXVlc3RzLgogICAgICAgICAgICAgICAgICAgIGlmICh1cmwuaW5jbHVkZXMoJ2dxbCcpICYmIGluaXQgJiYgdHlwZW9mIGluaXQuYm9keSA9PT0gJ3N0cmluZycgJiYgaW5pdC5ib2R5LmluY2x1ZGVzKCdQbGF5YmFja0FjY2Vzc1Rva2VuJykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNsaWVudElkID0gaW5pdC5oZWFkZXJzWydDbGllbnQtSUQnXTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNsaWVudElkICYmIHR5cGVvZiBjbGllbnRJZCA9PSAnc3RyaW5nJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2xpZW50SUQgPSBjbGllbnRJZDsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsaWVudElkID0gaW5pdC5oZWFkZXJzWydDbGllbnQtSWQnXTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjbGllbnRJZCAmJiB0eXBlb2YgY2xpZW50SWQgPT0gJ3N0cmluZycpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDbGllbnRJRCA9IGNsaWVudElkOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChDbGllbnRJRCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zdFR3aXRjaFdvcmtlck1lc3NhZ2UoJ1VwZGF0ZUNsaWVudElkJywgQ2xpZW50SUQpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC8vQ2xpZW50IGludGVncml0eSBoZWFkZXIKICAgICAgICAgICAgICAgICAgICAgICAgQ2xpZW50SW50ZWdyaXR5SGVhZGVyID0gaW5pdC5oZWFkZXJzWydDbGllbnQtSW50ZWdyaXR5J107CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChDbGllbnRJbnRlZ3JpdHlIZWFkZXIpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc3RUd2l0Y2hXb3JrZXJNZXNzYWdlKCdVcGRhdGVDbGllbnRJbnRlZ3JpdHlIZWFkZXInLCBDbGllbnRJbnRlZ3JpdHlIZWFkZXIpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC8vQXV0aG9yaXphdGlvbiBoZWFkZXIKICAgICAgICAgICAgICAgICAgICAgICAgQXV0aG9yaXphdGlvbkhlYWRlciA9IGluaXQuaGVhZGVyc1snQXV0aG9yaXphdGlvbiddOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoQXV0aG9yaXphdGlvbkhlYWRlcikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zdFR3aXRjaFdvcmtlck1lc3NhZ2UoJ1VwZGF0ZUF1dGhvcml6YXRpb25IZWFkZXInLCBBdXRob3JpemF0aW9uSGVhZGVyKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAvL1RvIHByZXZlbnQgcGF1c2UvcmVzdW1lIGxvb3AgZm9yIG1pZC1yb2xscy4KICAgICAgICAgICAgICAgICAgICBpZiAodXJsLmluY2x1ZGVzKCdncWwnKSAmJiBpbml0ICYmIHR5cGVvZiBpbml0LmJvZHkgPT09ICdzdHJpbmcnICYmIGluaXQuYm9keS5pbmNsdWRlcygnUGxheWJhY2tBY2Nlc3NUb2tlbicpICYmIGluaXQuYm9keS5pbmNsdWRlcygncGljdHVyZS1ieS1waWN0dXJlJykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgaW5pdC5ib2R5ID0gJyc7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIHZhciBpc1BCWVBSZXF1ZXN0ID0gdXJsLmluY2x1ZGVzKCdwaWN0dXJlLWJ5LXBpY3R1cmUnKTsKICAgICAgICAgICAgICAgICAgICBpZiAoaXNQQllQUmVxdWVzdCkgewogICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAnJzsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHJlYWxGZXRjaC5hcHBseSh0aGlzLCBhcmd1bWVudHMpOwogICAgICAgIH07CiAgICB9CiAgICBob29rRmV0Y2goKTsKfSkoKTsK"},{"name":"video-swap-new-ublock-origin.js","aliases":[],"kind":{"mime":"application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JsID0gW107CiAgICAgICAgc2NvcGUuQ3VycmVudENoYW5uZWxOYW1lRnJvbU0zVTggPSBudWxsOwogICAgICAgIC8vIE5lZWQgdGhpcyBpbiBib3RoIHNjb3Blcy4gV2luZG93IHNjb3BlIG5lZWRzIHRvIHVwZGF0ZSB0aGlzIHRvIHdvcmtlciBzY29wZS4KICAgICAgICBzY29wZS5ncWxfZGV2aWNlX2lkID0gbnVsbDsKICAgICAgICBzY29wZS5DbGllbnRJbnRlZ3JpdHlIZWFkZXIgPSBudWxsOwogICAgICAgIHNjb3BlLkF1dGhvcml6YXRpb25IZWFkZXIgPSBudWxsOwogICAgfQogICAgZGVjbGFyZU9wdGlvbnMod2luZG93KTsKICAgIHZhciB0d2l0Y2hXb3JrZXJzID0gW107CiAgICBjb25zdCBvbGRXb3JrZXIgPSB3aW5kb3cuV29ya2VyOwogICAgd2luZG93LldvcmtlciA9IGNsYXNzIFdvcmtlciBleHRlbmRzIG9sZFdvcmtlciB7CiAgICAgICAgY29uc3RydWN0b3IodHdpdGNoQmxvYlVybCwgb3B0aW9ucykgewogICAgICAgICAgICB2YXIgaXNUd2l0Y2hXb3JrZXIgPSBmYWxzZTsKICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgIGlzVHdpdGNoV29ya2VyID0gbmV3IFVSTCh0d2l0Y2hCbG9iVXJsKS5vcmlnaW4uZW5kc1dpdGgoJy50d2l0Y2gudHYnKTsKICAgICAgICAgICAgfSBjYXRjaCB7fQogICAgICAgICAgICBpZiAoIWlzVHdpdGNoV29ya2VyKSB7CiAgICAgICAgICAgICAgICBzdXBlcih0d2l0Y2hCbG9iVXJsLCBvcHRpb25zKTsKICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgfQogICAgICAgICAgICB2YXIgbmV3QmxvYlN0ciA9IGAKICAgICAgICAgICAgICAgICR7cHJvY2Vzc00zVTgudG9TdHJpbmcoKX0KICAgICAgICAgICAgICAgICR7aG9va1dvcmtlckZldGNoLnRvU3RyaW5nKCl9CiAgICAgICAgICAgICAgICAke2RlY2xhcmVPcHRpb25zLnRvU3RyaW5nKCl9CiAgICAgICAgICAgICAgICAke2dldEFjY2Vzc1Rva2VuLnRvU3RyaW5nKCl9CiAgICAgICAgICAgICAgICAke2dxbFJlcXVlc3QudG9TdHJpbmcoKX0KICAgICAgICAgICAgICAgICR7bWFrZUdyYXBoUWxQYWNrZXQudG9TdHJpbmcoKX0KICAgICAgICAgICAgICAgICR7dHJ5Tm90aWZ5QWRzV2F0Y2hlZE0zVTgudG9TdHJpbmcoKX0KICAgICAgICAgICAgICAgICR7cGFyc2VBdHRyaWJ1dGVzLnRvU3RyaW5nKCl9CiAgICAgICAgICAgICAgICAke29uRm91bmRBZC50b1N0cmluZygpfQogICAgICAgICAgICAgICAgJHtnZXRXYXNtV29ya2VyVXJsLnRvU3RyaW5nKCl9CiAgICAgICAgICAgICAgICB2YXIgd29ya2VyVXJsID0gZ2V0V2FzbVdvcmtlclVybCgnJHt0d2l0Y2hCbG9iVXJsLnJlcGxhY2VBbGwoIiciLCAiJTI3Iil9Jyk7CiAgICAgICAgICAgICAgICBpZiAod29ya2VyVXJsICYmIHdvcmtlclVybC5pbmNsdWRlcygnYXNzZXRzLnR3aXRjaC50di9hc3NldHMvYW1hem9uLWl2cy13YXNtd29ya2VyJykpIHsKICAgICAgICAgICAgICAgICAgICBkZWNsYXJlT3B0aW9ucyhzZWxmKTsKICAgICAgICAgICAgICAgICAgICBzZWxmLmFkZEV2ZW50TGlzdGVuZXIoJ21lc3NhZ2UnLCBmdW5jdGlvbihlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmRhdGEua2V5ID09ICdVYm9VcGRhdGVEZXZpY2VJZCcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdxbF9kZXZpY2VfaWQgPSBlLmRhdGEudmFsdWU7CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZS5kYXRhLmtleSA9PSAnVXBkYXRlQ2xpZW50SW50ZWdyaXR5SGVhZGVyJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2xpZW50SW50ZWdyaXR5SGVhZGVyID0gZS5kYXRhLnZhbHVlOwogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGUuZGF0YS5rZXkgPT0gJ1VwZGF0ZUF1dGhvcml6YXRpb25IZWFkZXInKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdXRob3JpemF0aW9uSGVhZGVyID0gZS5kYXRhLnZhbHVlOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICAgICAgaG9va1dvcmtlckZldGNoKCk7CiAgICAgICAgICAgICAgICAgICAgaW1wb3J0U2NyaXB0cyh3b3JrZXJVcmwpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICBgCiAgICAgICAgICAgIHN1cGVyKFVSTC5jcmVhdGVPYmplY3RVUkwobmV3IEJsb2IoW25ld0Jsb2JTdHJdKSksIG9wdGlvbnMpOwogICAgICAgICAgICB0d2l0Y2hXb3JrZXJzLnB1c2godGhpcyk7CiAgICAgICAgICAgIHRoaXMub25tZXNzYWdlID0gZnVuY3Rpb24oZSkgewogICAgICAgICAgICAgICAgLy8gTk9URTogUmVtb3ZlZCBhZERpdiBjYWNoaW5nIGFzICcudmlkZW8tcGxheWVyJyBjYW4gY2hhbmdlIGJldHdlZW4gc3RyZWFtcz8KICAgICAgICAgICAgICAgIGlmIChlLmRhdGEua2V5ID09ICdVYm9TaG93QWRCYW5uZXInKSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIGFkRGl2ID0gZ2V0QWREaXYoKTsKICAgICAgICAgICAgICAgICAgICBpZiAoYWREaXYgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICBhZERpdi5QLnRleHRDb250ZW50ID0gJ0Jsb2NraW5nJyArIChlLmRhdGEuaXNNaWRyb2xsID8gJyBtaWRyb2xsJyA6ICcnKSArICcgYWRzJzsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKE9QVF9TSE9XX0FEX0JBTk5FUikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYWREaXYuc3R5bGUuZGlzcGxheSA9ICdibG9jayc7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGUuZGF0YS5rZXkgPT0gJ1Vib0hpZGVBZEJhbm5lcicpIHsKICAgICAgICAgICAgICAgICAgICB2YXIgYWREaXYgPSBnZXRBZERpdigpOwogICAgICAgICAgICAgICAgICAgIGlmIChhZERpdiAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGFkRGl2LnN0eWxlLmRpc3BsYXkgPSAnbm9uZSc7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlLmRhdGEua2V5ID09ICdVYm9DaGFubmVsTmFtZU0zVThDaGFuZ2VkJykgewogICAgICAgICAgICAgICAgICAgIC8vY29uc29sZS5sb2coJ00zVTggY2hhbm5lbCBuYW1lIGNoYW5nZWQgdG8gJyArIGUuZGF0YS52YWx1ZSk7CiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGUuZGF0YS5rZXkgPT0gJ1Vib1JlbG9hZFBsYXllcicpIHsKICAgICAgICAgICAgICAgICAgICByZWxvYWRUd2l0Y2hQbGF5ZXIoKTsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZS5kYXRhLmtleSA9PSAnVWJvUGF1c2VSZXN1bWVQbGF5ZXInKSB7CiAgICAgICAgICAgICAgICAgICAgcmVsb2FkVHdpdGNoUGxheWVyKGZhbHNlLCB0cnVlKTsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZS5kYXRhLmtleSA9PSAnVWJvU2Vla1BsYXllcicpIHsKICAgICAgICAgICAgICAgICAgICByZWxvYWRUd2l0Y2hQb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wogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHJldHVybiBhZERpdjsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KICAgIGZ1bmN0aW9uIGdldFdhc21Xb3JrZXJVcmwodHdpdGNoQmxvYlVybCkgewogICAgICAgIHZhciByZXEgPSBuZXcgWE1MSHR0cFJlcXVlc3QoKTsKICAgICAgICByZXEub3BlbignR0VUJywgdHdpdGNoQmxvYlVybCwgZmFsc2UpOwogICAgICAgIHJlcS5vdmVycmlkZU1pbWVUeXBlKCJ0ZXh0L2phdmFzY3JpcHQiKTsKICAgICAgICByZXEuc2VuZCgpOwogICAgICAgIHJldHVybiByZXEucmVzcG9uc2VUZXh0LnNwbGl0KCInIilbMV07CiAgICB9CiAgICBmdW5jdGlvbiBvbkZvdW5kQWQoc3RyZWFtSW5mbywgdGV4dFN0ciwgcmVsb2FkUGxheWVyKSB7CiAgICAgICAgY29uc29sZS5sb2coJ0ZvdW5kIGFkcywgc3dpdGNoIHRvIGJhY2t1cCcpOwogICAgICAgIHN0cmVhbUluZm8uVXNlQmFja3VwU3RyZWFtID0gdHJ1ZTsKICAgICAgICBzdHJlYW1JbmZvLklzTWlkcm9sbCA9IHRleHRTdHIuaW5jbHVkZXMoJyJNSURST0xMIicpIHx8IHRleHRTdHIuaW5jbHVkZXMoJyJtaWRyb2xsIicpOwogICAgICAgIGlmIChyZWxvYWRQbGF5ZXIpIHsKICAgICAgICAgICAgcG9zdE1lc3NhZ2Uoe2tleTonVWJvUmVsb2FkUGxheWVyJ30pOwogICAgICAgIH0KICAgICAgICBwb3N0TWVzc2FnZSh7a2V5OidVYm9TaG93QWRCYW5uZXInLGlzTWlkcm9sbDpzdHJlYW1JbmZvLklzTWlkcm9sbH0pOwogICAgfQogICAgYXN5bmMgZnVuY3Rpb24gcHJvY2Vzc00zVTgodXJsLCB0ZXh0U3RyLCByZWFsRmV0Y2gpIHsKICAgICAgICB2YXIgc3RyZWFtSW5mbyA9IFN0cmVhbUluZm9zQnlVcmxbdXJsXTsKICAgICAgICBpZiAoc3RyZWFtSW5mbyA9PSBudWxsKSB7CiAgICAgICAgICAgIGNvbnNvbGUubG9nKCdVbmtub3duIHN0cmVhbSB1cmwgJyArIHVybCk7CiAgICAgICAgICAgIC8vcG9zdE1lc3NhZ2Uoe2tleTonVWJvSGlkZUFkQmFubmVyJ30pOwogICAgICAgICAgICByZXR1cm4gdGV4dFN0cjsKICAgICAgICB9CiAgICAgICAgaWYgKCFPUFRfTU9ERV9TVFJJUF9BRF9TRUdNRU5UUykgewogICAgICAgICAgICByZXR1cm4gdGV4dFN0cjsKICAgICAgICB9CiAgICAgICAgdmFyIGhhdmVBZFRhZ3MgPSB0ZXh0U3RyLmluY2x1ZGVzKEFEX1NJR05JRklFUik7CiAgICAgICAgaWYgKHN0cmVhbUluZm8uVXNlQmFja3VwU3RyZWFtKSB7CiAgICAgICAgICAgIGlmIChzdHJlYW1JbmZvLkVuY29kaW5ncyA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygnRm91bmQgYmFja3VwIHN0cmVhbSBidXQgbm90IG1haW4gc3RyZWFtPycpOwogICAgICAgICAgICAgICAgc3RyZWFtSW5mby5Vc2VCYWNrdXBTdHJlYW0gPSBmYWxzZTsKICAgICAgICAgICAgICAgIHBvc3RNZXNzYWdlKHtrZXk6J1Vib1JlbG9hZFBsYXllcid9KTsKICAgICAgICAgICAgICAgIHJldHVybiAnJzsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHZhciBzdHJlYW1NM3U4VXJsID0gc3RyZWFtSW5mby5FbmNvZGluZ3MubWF0Y2goL15odHRwczouKlwubTN1OCQvbSlbMF07CiAgICAgICAgICAgICAgICB2YXIgc3RyZWFtTTN1OFJlc3BvbnNlID0gYXdhaXQgcmVhbEZldGNoKHN0cmVhbU0zdThVcmwpOwogICAgICAgICAgICAgICAgaWYgKHN0cmVhbU0zdThSZXNwb25zZS5zdGF0dXMgPT0gMjAwKSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIHN0cmVhbU0zdTggPSBhd2FpdCBzdHJlYW1NM3U4UmVzcG9uc2UudGV4dCgpOwogICAgICAgICAgICAgICAgICAgIGlmIChzdHJlYW1NM3U4ICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzdHJlYW1NM3U4LmluY2x1ZGVzKEFEX1NJR05JRklFUikpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCdObyBtb3JlIGFkcyBvbiBtYWluIHN0cmVhbS4gVHJpZ2dlcmluZyBwbGF5ZXIgcmVsb2FkIHRvIGdvIGJhY2sgdG8gbWFpbiBzdHJlYW0uLi4nKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbUluZm8uVXNlQmFja3VwU3RyZWFtID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3N0TWVzc2FnZSh7a2V5OidVYm9IaWRlQWRCYW5uZXInfSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3N0TWVzc2FnZSh7a2V5OidVYm9SZWxvYWRQbGF5ZXInfSk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIXN0cmVhbU0zdTguaW5jbHVkZXMoJyJNSURST0xMIicpICYmICFzdHJlYW1NM3U4LmluY2x1ZGVzKCcibWlkcm9sbCInKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpbmVzID0gc3RyZWFtTTN1OC5yZXBsYWNlKCdccicsICcnKS5zcGxpdCgnXG4nKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGluZXMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGluZSA9IGxpbmVzW2ldOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsaW5lLnN0YXJ0c1dpdGgoJyNFWFRJTkYnKSAmJiBsaW5lcy5sZW5ndGggPiBpICsgMSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWxpbmUuaW5jbHVkZXMoTElWRV9TSUdOSUZJRVIpICYmICFzdHJlYW1JbmZvLlJlcXVlc3RlZEFkcy5oYXMobGluZXNbaSArIDFdKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gT25seSByZXF1ZXN0IG9uZSAudHMgZmlsZSBwZXIgLm0zdTggcmVxdWVzdCB0byBhdm9pZCBtYWtpbmcgdG9vIG1hbnkgcmVxdWVzdHMKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vY29uc29sZS5sb2coJ0ZldGNoIGFkIC50cyBmaWxlJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW1JbmZvLlJlcXVlc3RlZEFkcy5hZGQobGluZXNbaSArIDFdKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZldGNoKGxpbmVzW2kgKyAxXSkudGhlbigocmVzcG9uc2UpPT57cmVzcG9uc2UuYmxvYigpfSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0gZWxzZSBpZiAoaGF2ZUFkVGFncykgewogICAgICAgICAgICBvbkZvdW5kQWQoc3RyZWFtSW5mbywgdGV4dFN0ciwgdHJ1ZSk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgcG9zdE1lc3NhZ2Uoe2tleTonVWJvSGlkZUFkQmFubmVyJ30pOwogICAgICAgIH0KICAgICAgICBpZiAoaGF2ZUFkVGFncyAmJiBzdHJlYW1JbmZvLkJhY2t1cEVuY29kaW5ncyAhPSBudWxsKSB7CiAgICAgICAgICAgIHZhciBzdHJlYW1NM3U4VXJsID0gc3RyZWFtSW5mby5CYWNrdXBFbmNvZGluZ3MubWF0Y2goL15odHRwczouKlwubTN1OC4qJC9tKVswXTsKICAgICAgICAgICAgdmFyIHN0cmVhbU0zdThSZXNwb25zZSA9IGF3YWl0IHJlYWxGZXRjaChzdHJlYW1NM3U4VXJsKTsKICAgICAgICAgICAgaWYgKHN0cmVhbU0zdThSZXNwb25zZS5zdGF0dXMgPT0gMjAwKSB7CiAgICAgICAgICAgICAgICB0ZXh0U3RyID0gYXdhaXQgc3RyZWFtTTN1OFJlc3BvbnNlLnRleHQoKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gdGV4dFN0cjsKICAgIH0KICAgIGZ1bmN0aW9uIGhvb2tXb3JrZXJGZXRjaCgpIHsKICAgICAgICBjb25zb2xlLmxvZygnaG9va1dvcmtlckZldGNoJyk7CiAgICAgICAgdmFyIHJlYWxGZXRjaCA9IGZldGNoOwogICAgICAgIGZldGNoID0gYXN5bmMgZnVuY3Rpb24odXJsLCBvcHRpb25zKSB7CiAgICAgICAgICAgIGlmICh0eXBlb2YgdXJsID09PSAnc3RyaW5nJykgewogICAgICAgICAgICAgICAgdXJsID0gdXJsLnRyaW1FbmQoKTsKICAgICAgICAgICAgICAgIGlmICh1cmwuZW5kc1dpdGgoJ20zdTgnKSkgewogICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbihyZXNvbHZlLCByZWplY3QpIHsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHByb2Nlc3NBZnRlciA9IGFzeW5jIGZ1bmN0aW9uKHJlc3BvbnNlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3RyID0gYXdhaXQgcHJvY2Vzc00zVTgodXJsLCBhd2FpdCByZXNwb25zZS50ZXh0KCksIHJlYWxGZXRjaCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKG5ldyBSZXNwb25zZShzdHIsIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXM6IHJlc3BvbnNlLnN0YXR1cywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXNUZXh0OiByZXNwb25zZS5zdGF0dXNUZXh0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHJlc3BvbnNlLmhlYWRlcnMKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTsKICAgICAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlbmQgPSBmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZWFsRmV0Y2godXJsLCBvcHRpb25zKS50aGVuKGZ1bmN0aW9uKHJlc3BvbnNlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvY2Vzc0FmdGVyKHJlc3BvbnNlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pWydjYXRjaCddKGZ1bmN0aW9uKGVycikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCdmZXRjaCBob29rIGVyciAnICsgZXJyKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWplY3QoZXJyKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgICAgICAgICBzZW5kKCk7CiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBlbHNlIGlmICh1cmwuaW5jbHVkZXMoJy9hcGkvY2hhbm5lbC9obHMvJykgJiYgIXVybC5pbmNsdWRlcygncGljdHVyZS1ieS1waWN0dXJlJykpIHsKICAgICAgICAgICAgICAgICAgICB2YXIgY2hhbm5lbE5hbWUgPSAobmV3IFVSTCh1cmwpKS5wYXRobmFtZS5tYXRjaCgvKFteXC9dKykoPz1cLlx3KyQpLylbMF07CiAgICAgICAgICAgICAgICAgICAgaWYgKEN1cnJlbnRDaGFubmVsTmFtZUZyb21NM1U4ICE9IGNoYW5uZWxOYW1lKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogJ1Vib0NoYW5uZWxOYW1lTTNVOENoYW5nZWQnLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IGNoYW5uZWxOYW1lCiAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBDdXJyZW50Q2hhbm5lbE5hbWVGcm9tTTNVOCA9IGNoYW5uZWxOYW1lOwogICAgICAgICAgICAgICAgICAgIGlmIChPUFRfTU9ERV9TVFJJUF9BRF9TRUdNRU5UUykgewogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoYXN5bmMgZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAtIEZpcnN0IG0zdTggcmVxdWVzdCBpcyB0aGUgbTN1OCB3aXRoIHRoZSB2aWRlbyBlbmNvZGluZ3MgKDM2MHAsNDgwcCw3MjBwLGV0YykuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAtIFNlY29uZCBtM3U4IHJlcXVlc3QgaXMgdGhlIG0zdTggZm9yIHRoZSBnaXZlbiBlbmNvZGluZyBvYnRhaW5lZCBpbiB0aGUgZmlyc3QgcmVxdWVzdC4gQXQgdGhpcyBwb2ludCB3ZSB3aWxsIGtub3cgaWYgdGhlcmUncyBhZHMuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3RyZWFtSW5mbyA9IFN0cmVhbUluZm9zW2NoYW5uZWxOYW1lXTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdHJlYW1JbmZvICE9IG51bGwgJiYgc3RyZWFtSW5mby5FbmNvZGluZ3MgIT0gbnVsbCAmJiAoYXdhaXQgcmVhbEZldGNoKHN0cmVhbUluZm8uRW5jb2RpbmdzLm1hdGNoKC9eaHR0cHM6LipcLm0zdTgkL20pWzBdKSkuc3RhdHVzICE9PSAyMDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGUgY2FjaGVkIGVuY29kaW5ncyBhcmUgZGVhZCAodGhlIHN0cmVhbSBwcm9iYWJseSByZXN0YXJ0ZWQpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtSW5mbyA9IG51bGw7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RyZWFtSW5mbyA9PSBudWxsIHx8IHN0cmVhbUluZm8uRW5jb2RpbmdzID09IG51bGwgfHwgc3RyZWFtSW5mby5CYWNrdXBFbmNvZGluZ3MgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmVhbUluZm9zW2NoYW5uZWxOYW1lXSA9IHN0cmVhbUluZm8gPSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlcXVlc3RlZEFkczogbmV3IFNldCgpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbmNvZGluZ3M6IG51bGwsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhY2t1cEVuY29kaW5nczogbnVsbCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSXNNaWRyb2xsOiBmYWxzZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVXNlQmFja3VwU3RyZWFtOiBmYWxzZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2hhbm5lbE5hbWU6IGNoYW5uZWxOYW1lCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI7IGkrKykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZW5jb2RpbmdzVXJsID0gdXJsOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSAxKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYWNjZXNzVG9rZW5SZXNwb25zZSA9IGF3YWl0IGdldEFjY2Vzc1Rva2VuKGNoYW5uZWxOYW1lLCBPUFRfQkFDS1VQX1BMQVlFUl9UWVBFLCBPUFRfQkFDS1VQX1BMQVRGT1JNLCByZWFsRmV0Y2gpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFjY2Vzc1Rva2VuUmVzcG9uc2UgIT0gbnVsbCAmJiBhY2Nlc3NUb2tlblJlc3BvbnNlLnN0YXR1cyA9PT0gMjAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGFjY2Vzc1Rva2VuID0gYXdhaXQgYWNjZXNzVG9rZW5SZXNwb25zZS5qc29uKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHVybEluZm8gPSBuZXcgVVJMKCdodHRwczovL3VzaGVyLnR0dm53Lm5ldC9hcGkvY2hhbm5lbC9obHMvJyArIGNoYW5uZWxOYW1lICsgJy5tM3U4JyArIChuZXcgVVJMKHVybCkpLnNlYXJjaCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsSW5mby5zZWFyY2hQYXJhbXMuc2V0KCdzaWcnLCBhY2Nlc3NUb2tlbi5kYXRhLnN0cmVhbVBsYXliYWNrQWNjZXNzVG9rZW4uc2lnbmF0dXJlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxJbmZvLnNlYXJjaFBhcmFtcy5zZXQoJ3Rva2VuJywgYWNjZXNzVG9rZW4uZGF0YS5zdHJlYW1QbGF5YmFja0FjY2Vzc1Rva2VuLnZhbHVlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmNvZGluZ3NVcmwgPSB1cmxJbmZvLmhyZWY7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoYWNjZXNzVG9rZW5SZXNwb25zZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbmNvZGluZ3NNM3U4UmVzcG9uc2UgPSBhd2FpdCByZWFsRmV0Y2goZW5jb2RpbmdzVXJsLCBvcHRpb25zKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVuY29kaW5nc00zdThSZXNwb25zZSAhPSBudWxsICYmIGVuY29kaW5nc00zdThSZXNwb25zZS5zdGF0dXMgPT09IDIwMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVuY29kaW5nc00zdTggPSBhd2FpdCBlbmNvZGluZ3NNM3U4UmVzcG9uc2UudGV4dCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbUluZm8uRW5jb2RpbmdzID0gZW5jb2RpbmdzTTN1ODsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3RyZWFtTTN1OFVybCA9IGVuY29kaW5nc00zdTgubWF0Y2goL15odHRwczouKlwubTN1OCQvbSlbMF07CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN0cmVhbU0zdThSZXNwb25zZSA9IGF3YWl0IHJlYWxGZXRjaChzdHJlYW1NM3U4VXJsKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RyZWFtTTN1OFJlc3BvbnNlLnN0YXR1cyA9PSAyMDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN0cmVhbU0zdTggPSBhd2FpdCBzdHJlYW1NM3U4UmVzcG9uc2UudGV4dCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RyZWFtTTN1OC5pbmNsdWRlcyhBRF9TSUdOSUZJRVIpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkZvdW5kQWQoc3RyZWFtSW5mbywgc3RyZWFtTTN1OCwgZmFsc2UpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShzdHJlYW1NM3U4UmVzcG9uc2UpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbG93UmVzTGluZXMgPSBlbmNvZGluZ3NNM3U4LnJlcGxhY2UoJ1xyJywgJycpLnNwbGl0KCdcbicpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsb3dSZXNCZXN0VXJsID0gbnVsbDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IGxvd1Jlc0xpbmVzLmxlbmd0aDsgaisrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsb3dSZXNMaW5lc1tqXS5zdGFydHNXaXRoKCcjRVhULVgtU1RSRUFNLUlORicpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0gcGFyc2VBdHRyaWJ1dGVzKGxvd1Jlc0xpbmVzW2pdKVsnUkVTT0xVVElPTiddOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyAmJiBsb3dSZXNMaW5lc1tqICsgMV0uZW5kc1dpdGgoJy5tM3U4JykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBc3N1bWVzIHJlc29sdXRpb25zIGFyZSBjb3JyZWN0bHkgb3JkZXJlZAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvd1Jlc0Jlc3RVcmwgPSBsb3dSZXNMaW5lc1tqICsgMV07CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxvd1Jlc0Jlc3RVcmwgIT0gbnVsbCAmJiBzdHJlYW1JbmZvLkVuY29kaW5ncyAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBub3JtYWxFbmNvZGluZ3NNM3U4ID0gc3RyZWFtSW5mby5FbmNvZGluZ3M7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBub3JtYWxMaW5lcyA9IG5vcm1hbEVuY29kaW5nc00zdTgucmVwbGFjZSgnXHInLCAnJykuc3BsaXQoJ1xuJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgbm9ybWFsTGluZXMubGVuZ3RoIC0gMTsgaisrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobm9ybWFsTGluZXNbal0uc3RhcnRzV2l0aCgnI0VYVC1YLVNUUkVBTS1JTkYnKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSBwYXJzZUF0dHJpYnV0ZXMobm9ybWFsTGluZXNbal0pWydSRVNPTFVUSU9OJ107CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb3dSZXNCZXN0VXJsICs9ICcgJzsvLyBUaGUgc3RyZWFtIGRvZXNuJ3QgbG9hZCB1bmxlc3MgZWFjaCB1cmwgbGluZSBpcyB1bmlxdWUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9ybWFsTGluZXNbaiArIDFdID0gbG93UmVzQmVzdFVybDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5jb2RpbmdzTTN1OCA9IG5vcm1hbExpbmVzLmpvaW4oJ1xyXG4nKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtSW5mby5CYWNrdXBFbmNvZGluZ3MgPSBlbmNvZGluZ3NNM3U4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpbmVzID0gZW5jb2RpbmdzTTN1OC5yZXBsYWNlKCdccicsICcnKS5zcGxpdCgnXG4nKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgbGluZXMubGVuZ3RoOyBqKyspIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWxpbmVzW2pdLnN0YXJ0c1dpdGgoJyMnKSAmJiBsaW5lc1tqXS5pbmNsdWRlcygnLm0zdTgnKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJlYW1JbmZvc0J5VXJsW2xpbmVzW2pdLnRyaW1FbmQoKV0gPSBzdHJlYW1JbmZvOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoZW5jb2RpbmdzTTN1OFJlc3BvbnNlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdHJlYW1JbmZvLlVzZUJhY2t1cFN0cmVhbSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUobmV3IFJlc3BvbnNlKHN0cmVhbUluZm8uQmFja3VwRW5jb2RpbmdzKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUobmV3IFJlc3BvbnNlKHN0cmVhbUluZm8uRW5jb2RpbmdzKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gcmVhbEZldGNoLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7CiAgICAgICAgfQogICAgfQogICAgZnVuY3Rpb24gbWFrZUdyYXBoUWxQYWNrZXQoZXZlbnQsIHJhZFRva2VuLCBwYXlsb2FkKSB7CiAgICAgICAgcmV0dXJuIFt7CiAgICAgICAgICAgIG9wZXJhdGlvbk5hbWU6ICdDbGllbnRTaWRlQWRFdmVudEhhbmRsaW5nX1JlY29yZEFkRXZlbnQnLAogICAgICAgICAgICB2YXJpYWJsZXM6IHsKICAgICAgICAgICAgICAgIGlucHV0OiB7CiAgICAgICAgICAgICAgICAgICAgZXZlbnROYW1lOiBldmVudCwKICAgICAgICAgICAgICAgICAgICBldmVudFBheWxvYWQ6IEpTT04uc3RyaW5naWZ5KHBheWxvYWQpLAogICAgICAgICAgICAgICAgICAgIHJhZFRva2VuLAogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgfSwKICAgICAgICAgICAgZXh0ZW5zaW9uczogewogICAgICAgICAgICAgICAgcGVyc2lzdGVkUXVlcnk6IHsKICAgICAgICAgICAgICAgICAgICB2ZXJzaW9uOiAxLAogICAgICAgICAgICAgICAgICAgIHNoYTI1Nkhhc2g6ICc3ZTZjNjllNmViNTlmOGNjYjk3YWI3MzY4NmYzZDhiN2Q4NWE3MmEwMjk4NzQ1Y2NkOGJmYzY4ZTQwNTRjYTViJywKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgIH0sCiAgICAgICAgfV07CiAgICB9CiAgICBmdW5jdGlvbiBnZXRBY2Nlc3NUb2tlbihjaGFubmVsTmFtZSwgcGxheWVyVHlwZSwgcGxhdGZvcm0sIHJlYWxGZXRjaCkgewogICAgICAgIGlmICghcGxhdGZvcm0pIHsKICAgICAgICAgICAgcGxhdGZvcm0gPSAnd2ViJzsKICAgICAgICB9CiAgICAgICAgdmFyIGJvZHkgPSBudWxsOwogICAgICAgIHZhciB0ZW1wbGF0ZVF1ZXJ5ID0gJ3F1ZXJ5IFBsYXliYWNrQWNjZXNzVG9rZW5fVGVtcGxhdGUoJGxvZ2luOiBTdHJpbmchLCAkaXNMaXZlOiBCb29sZWFuISwgJHZvZElEOiBJRCEsICRpc1ZvZDogQm9vbGVhbiEsICRw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1ZXN0KGJvZHksIHJlYWxGZXRjaCkgewogICAgICAgIGlmIChDbGllbnRJbnRlZ3JpdHlIZWFkZXIgPT0gbnVsbCkgewogICAgICAgICAgICAvL2NvbnNvbGUud2FybignQ2xpZW50SW50ZWdyaXR5SGVhZGVyIGlzIG51bGwnKTsKICAgICAgICAgICAgLy90aHJvdyAnQ2xpZW50SW50ZWdyaXR5SGVhZGVyIGlzIG51bGwnOwogICAgICAgIH0KICAgICAgICB2YXIgZmV0Y2hGdW5jID0gcmVhbEZldGNoID8gcmVhbEZldGNoIDogZmV0Y2g7CiAgICAgICAgcmV0dXJuIGZldGNoRnVuYygnaHR0cHM6Ly9ncWwudHdpdGNoLnR2L2dxbCcsIHsKICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCcsCiAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KGJvZHkpLAogICAgICAgICAgICBoZWFkZXJzOiB7CiAgICAgICAgICAgICAgICAnQ2xpZW50LUlkJzogQ0xJRU5UX0lELAogICAgICAgICAgICAgICAgJ0NsaWVudC1JbnRlZ3JpdHknOiBDbGllbnRJbnRlZ3JpdHlIZWFkZXIsCiAgICAgICAgICAgICAgICAnWC1EZXZpY2UtSWQnOiBncWxfZGV2aWNlX2lkLAogICAgICAgICAgICAgICAgJ0F1dGhvcml6YXRpb24nOiBBdXRob3JpemF0aW9uSGVhZGVyCiAgICAgICAgICAgIH0KICAgICAgICB9KTsKICAgIH0KICAgIGZ1bmN0aW9uIHBhcnNlQXR0cmlidXRlcyhzdHIpIHsKICAgICAgICByZXR1cm4gT2JqZWN0LmZyb21FbnRyaWVzKAogICAgICAgICAgICBzdHIuc3BsaXQoLyg/Ol58LCkoKD86W149XSopPSg/OiJbXiJdKiJ8W14sXSopKS8pCiAgICAgICAgICAgICAgICAuZmlsdGVyKEJvb2xlYW4pCiAgICAgICAgICAgICAgICAubWFwKHggPT4gewogICAgICAgICAgICAgICAgICAgIGNvbnN0IGlkeCA9IHguaW5kZXhPZignPScpOwogICAgICAgICAgICAgICAgICAgIGNvbnN0IGtleSA9IHguc3Vic3RyaW5nKDAsIGlkeCk7CiAgICAgICAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSB4LnN1YnN0cmluZyhpZHggKzEpOwogICAgICAgICAgICAgICAgICAgIGNvbnN0IG51bSA9IE51bWJlcih2YWx1ZSk7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtrZXksIE51bWJlci5pc05hTihudW0pID8gdmFsdWUuc3RhcnRzV2l0aCgnIicpID8gSlNPTi5wYXJzZSh2YWx1ZSkgOiB2YWx1ZSA6IG51bV0KICAgICAgICAgICAgICAgIH0pKTsKICAgIH0KICAgIGFzeW5jIGZ1bmN0aW9uIHRyeU5vdGlmeUFkc1dhdGNoZWRNM1U4KHN0cmVhbU0zdTgpIHsKICAgICAgICB0cnkgewogICAgICAgICAgICAvL2NvbnNvbGUubG9nKHN0cmVhbU0zdTgpOwogICAgICAgICAgICBpZiAoIXN0cmVhbU0zdTggfHwgIXN0cmVhbU0zdTguaW5jbHVkZXMoQURfU0lHTklGSUVSKSkgewogICAgICAgICAgICAgICAgcmV0dXJuIDE7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgdmFyIG1hdGNoZXMgPSBzdHJlYW1NM3U4Lm1hdGNoKC8jRVhULVgtREFURVJBTkdFOihJRD0ic3RpdGNoZWQtYWQtW15cbl0rKVxuLyk7CiAgICAgICAgICAgIGlmIChtYXRjaGVzLmxlbmd0aCA+IDEpIHsKICAgICAgICAgICAgICAgIGNvbnN0IGF0dHJTdHJpbmcgPSBtYXRjaGVzWzFdOwogICAgICAgICAgICAgICAgY29uc3QgYXR0ciA9IHBhcnNlQXR0cmlidXRlcyhhdHRyU3RyaW5nKTsKICAgICAgICAgICAgICAgIHZhciBwb2RMZW5ndGggPSBwYXJzZUludChhdHRyWydYLVRWLVRXSVRDSC1BRC1QT0QtTEVOR1RIJ10gPyBhdHRyWydYLVRWLVRXSVRDSC1BRC1QT0QtTEVOR1RIJ10gOiAnMScpOwogICAgICAgICAgICAgICAgdmFyIHBvZFBvc2l0aW9uID0gcGFyc2VJbnQoYXR0clsnWC1UVi1UV0lUQ0gtQUQtUE9ELVBPU0lUSU9OJ10gPyBhdHRyWydYLVRWLVRXSVRDSC1BRC1QT0QtUE9TSVRJT04nXSA6ICcwJyk7CiAgICAgICAgICAgICAgICB2YXIgcmFkVG9rZW4gPSBhdHRyWydYLVRWLVRXSVRDSC1BRC1SQURTLVRPS0VOJ107CiAgICAgICAgICAgICAgICB2YXIgbGluZUl0ZW1JZCA9IGF0dHJbJ1gtVFYtVFdJVENILUFELUxJTkUtSVRFTS1JRCddOwogICAgICAgICAgICAgICAgdmFyIG9yZGVySWQgPSBhdHRyWydYLVRWLVRXSVRDSC1BRC1PUkRFUi1JRCddOwogICAgICAgICAgICAgICAgdmFyIGNyZWF0aXZlSWQgPSBhdHRyWydYLVRWLVRXSVRDSC1BRC1DUkVBVElWRS1JRCddOwogICAgICAgICAgICAgICAgdmFyIGFkSWQgPSBhdHRyWydYLVRWLVRXSVRDSC1BRC1BRFZFUlRJU0VSLUlEJ107CiAgICAgICAgICAgICAgICB2YXIgcm9sbFR5cGUgPSBhdHRyWydYLVRWLVRXSVRDSC1BRC1ST0xMLVRZUEUnXS50b0xvd2VyQ2FzZSgpOwogICAgICAgICAgICAgICAgY29uc3QgYmFzZURhdGEgPSB7CiAgICAgICAgICAgICAgICAgICAgc3RpdGNoZWQ6IHRydWUsCiAgICAgICAgICAgICAgICAgICAgcm9sbF90eXBlOiByb2xsVHlwZSwKICAgICAgICAgICAgICAgICAgICBwbGF5ZXJfbXV0ZTogZmFsc2UsCiAgICAgICAgICAgICAgICAgICAgcGxheWVyX3ZvbHVtZTogMC41LAogICAgICAgICAgICAgICAgICAgIHZpc2libGU6IHRydWUsCiAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgZm9yIChsZXQgcG9kUG9zaXRpb24gPSAwOyBwb2RQb3NpdGlvbiA8IHBvZExlbmd0aDsgcG9kUG9zaXRpb24rKykgewogICAgICAgICAgICAgICAgICAgIGlmIChPUFRfTU9ERV9OT1RJRllfQURTX1dBVENIRURfTUlOX1JFUVVFU1RTKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgaXMgYWxsIHRoYXQncyBhY3R1YWxseSByZXF1aXJlZCBhdCB0aGUgbW9tZW50CiAgICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IGdxbFJlcXVlc3QobWFrZUdyYXBoUWxQYWNrZXQoJ3ZpZGVvX2FkX3BvZF9jb21wbGV0ZScsIHJhZFRva2VuLCBiYXNlRGF0YSkpOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGV4dGVuZGVkRGF0YSA9IHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC4uLmJhc2VEYXRhLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRfaWQ6IGFkSWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZF9wb3NpdGlvbjogcG9kUG9zaXRpb24sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkdXJhdGlvbjogMzAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjcmVhdGl2ZV9pZDogY3JlYXRpdmVJZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvdGFsX2FkczogcG9kTGVuZ3RoLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgb3JkZXJfaWQ6IG9yZGVySWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lX2l0ZW1faWQ6IGxpbmVJdGVtSWQsCiAgICAgICAgICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IGdxbFJlcXVlc3QobWFrZUdyYXBoUWxQYWNrZXQoJ3ZpZGVvX2FkX2ltcHJlc3Npb24nLCByYWRUb2tlbiwgZXh0ZW5kZWREYXRhKSk7CiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IHF1YXJ0aWxlID0gMDsgcXVhcnRpbGUgPCA0OyBxdWFydGlsZSsrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBncWxSZXF1ZXN0KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VHcmFwaFFsUGFja2V0KCd2aWRlb19hZF9xdWFydGlsZV9jb21wbGV0ZScsIHJhZFRva2VuLCB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC4uLmV4dGVuZGVkRGF0YSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhcnRpbGU6IHF1YXJ0aWxlICsgMSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBncWxSZXF1ZXN0KG1ha2VHcmFwaFFsUGFja2V0KCd2aWRlb19hZF9wb2RfY29tcGxldGUnLCByYWRUb2tlbiwgYmFzZURhdGEpKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgfSBjYXRjaCAoZXJyKSB7CiAgICAgICAgICAgIGNvbnNvbGUubG9nKGVycik7CiAgICAgICAgICAgIHJldHVybiAwOwogICAgICAgIH0KICAgIH0KICAgIGZ1bmN0aW9uIHBvc3RUd2l0Y2hXb3JrZXJNZXNzYWdlKGtleSwgdmFsdWUpIHsKICAgICAgICB0d2l0Y2hXb3JrZXJzLmZvckVhY2goKHdvcmtlcikgPT4gewogICAgICAgICAgICB3b3JrZXIucG9zdE1lc3NhZ2Uoe2tleToga2V5LCB2YWx1ZTogdmFsdWV9KTsKICAgICAgICB9KTsKICAgIH0KICAgIGZ1bmN0aW9uIGhvb2tGZXRjaCgpIHsKICAgICAgICB2YXIgcmVhbEZldGNoID0gd2luZG93LmZldGNoOwogICAgICAgIHdpbmRvdy5mZXRjaCA9IGZ1bmN0aW9uKHVybCwgaW5pdCwgLi4uYXJncykgewogICAgICAgICAgICBpZiAodHlwZW9mIHVybCA9PT0gJ3N0cmluZycpIHsKICAgICAgICAgICAgICAgIGlmICh1cmwuaW5jbHVkZXMoJ2dxbCcpKSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIGRldmljZUlkID0gaW5pdC5oZWFkZXJzWydYLURldmljZS1JZCddOwogICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZGV2aWNlSWQgIT09ICdzdHJpbmcnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGRldmljZUlkID0gaW5pdC5oZWFkZXJzWydEZXZpY2UtSUQnXTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBkZXZpY2VJZCA9PT0gJ3N0cmluZycpIHsKICAgICAgICAgICAgICAgICAgICAgICAgZ3FsX2RldmljZV9pZCA9IGRldmljZUlkOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBpZiAoZ3FsX2RldmljZV9pZCkgewogICAgICAgICAgICAgICAgICAgICAgICBwb3N0VHdpdGNoV29ya2VyTWVzc2FnZSgnVWJvVXBkYXRlRGV2aWNlSWQnLCBncWxfZGV2aWNlX2lkKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBpbml0LmJvZHkgPT09ICdzdHJpbmcnICYmIGluaXQuYm9keS5pbmNsdWRlcygnUGxheWJhY2tBY2Nlc3NUb2tlbicpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChPUFRfQUNDRVNTX1RPS0VOX1BMQVlFUl9UWVBFKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBuZXdCb2R5ID0gSlNPTi5wYXJzZShpbml0LmJvZHkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkobmV3Qm9keSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG5ld0JvZHkubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3Qm9keVtpXS52YXJpYWJsZXMucGxheWVyVHlwZSA9IE9QVF9BQ0NFU1NfVE9LRU5fUExBWUVSX1RZUEU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdCb2R5LnZhcmlhYmxlcy5wbGF5ZXJUeXBlID0gT1BUX0FDQ0VTU19UT0tFTl9QTEFZRVJfVFlQRTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXQuYm9keSA9IEpTT04uc3RyaW5naWZ5KG5ld0JvZHkpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgaW5pdC5oZWFkZXJzWydDbGllbnQtSW50ZWdyaXR5J10gPT09ICdzdHJpbmcnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDbGllbnRJbnRlZ3JpdHlIZWFkZXIgPSBpbml0LmhlYWRlcnNbJ0NsaWVudC1JbnRlZ3JpdHknXTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChDbGllbnRJbnRlZ3JpdHlIZWFkZXIpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3N0VHdpdGNoV29ya2VyTWVzc2FnZSgnVXBkYXRlQ2xpZW50SW50ZWdyaXR5SGVhZGVyJywgaW5pdC5oZWFkZXJzWydDbGllbnQtSW50ZWdyaXR5J10pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgaW5pdC5oZWFkZXJzWydBdXRob3JpemF0aW9uJ10gPT09ICdzdHJpbmcnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdXRob3JpemF0aW9uSGVhZGVyID0gaW5pdC5oZWFkZXJzWydBdXRob3JpemF0aW9uJ107CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQXV0aG9yaXphdGlvbkhlYWRlcikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc3RUd2l0Y2hXb3JrZXJNZXNzYWdlKCdVcGRhdGVBdXRob3JpemF0aW9uSGVhZGVyJywgaW5pdC5oZWFkZXJzWydBdXRob3JpemF0aW9uJ10pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiByZWFsRmV0Y2guYXBwbHkodGhpcywgYXJndW1lbnRzKTsKICAgICAgICB9OwogICAgfQogICAgZnVuY3Rpb24gcmVsb2FkVHdpdGNoUGxheWVyKGlzU2VlaywgaXNQYXVzZVBsYXkpIHsKICAgICAgICAvLyBUYWtlbiBmcm9tIHR0di10b29scyAvIGZmegogICAgICAgIC8vIGh0dHBzOi8vZ2l0aHViLmNvbS9OZXJpeHl6L3R0di10b29scy9ibG9iL21hc3Rlci9zcmMvY29udGV4dC90d2l0Y2gtcGxheWVyLnRzCiAgICAgICAgLy8gaHR0cHM6Ly9naXRodWIuY29tL0ZyYW5rZXJGYWNlWi9GcmFua2VyRmFjZVovYmxvYi9tYXN0ZXIvc3JjL3NpdGVzL3R3aXRjaC10d2lsaWdodC9tb2R1bGVzL3BsYXllci5qc3gKICAgICAgICBmdW5jdGlvbiBmaW5kUmVhY3ROb2RlKHJvb3QsIGNvbnN0cmFpbnQpIHsKICAgICAgICAgICAgaWYgKHJvb3Quc3RhdGVOb2RlICYmIGNvbnN0cmFpbnQocm9vdC5zdGF0ZU5vZGUpKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gcm9vdC5zdGF0ZU5vZGU7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgbGV0IG5vZGUgPSByb290LmNoaWxkOwogICAgICAgICAgICB3aGlsZSAobm9kZSkgewogICAgICAgICAgICAgICAgY29uc3QgcmVzdWx0ID0gZmluZFJlYWN0Tm9kZShub2RlLCBjb25zdHJhaW50KTsKICAgICAgICAgICAgICAgIGlmIChyZXN1bHQpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgbm9kZSA9IG5vZGUuc2libGluZzsKICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICB9CiAgICAgICAgZnVuY3Rpb24gZmluZFJlYWN0Um9vdE5vZGUoKSB7CiAgICAgICAgICAgIHZhciByZWFjdFJvb3ROb2RlID0gbnVsbDsKICAgICAgICAgICAgdmFyIHJvb3ROb2RlID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3Jvb3QnKTsKICAgICAgICAgICAgaWYgKHJvb3ROb2RlICYmIHJvb3ROb2RlLl9yZWFjdFJvb3RDb250YWluZXIgJiYgcm9vdE5vZGUuX3JlYWN0Um9vdENvbnRhaW5lci5faW50ZXJuYWxSb290ICYmIHJvb3ROb2RlLl9yZWFjdFJvb3RDb250YWluZXIuX2ludGVybmFsUm9vdC5jdXJyZW50KSB7CiAgICAgICAgICAgICAgICByZWFjdFJvb3ROb2RlID0gcm9vdE5vZGUuX3JlYWN0Um9vdENvbnRhaW5lci5faW50ZXJuYWxSb290LmN1cnJlbnQ7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKHJlYWN0Um9vdE5vZGUgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgdmFyIGNvbnRhaW5lck5hbWUgPSBPYmplY3Qua2V5cyhyb290Tm9kZSkuZmluZCh4ID0+IHguc3RhcnRzV2l0aCgnX19yZWFjdENvbnRhaW5lcicpKTsKICAgICAgICAgICAgICAgIGlmIChjb250YWluZXJOYW1lICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICByZWFjdFJvb3ROb2RlID0gcm9vdE5vZGVbY29udGFpbmVyTmFtZV07CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHJlYWN0Um9vdE5vZGU7CiAgICAgICAgfQogICAgICAgIHZhciByZWFjdFJvb3ROb2RlID0gZmluZFJlYWN0Um9vdE5vZGUoKTsKICAgICAgICBpZiAoIXJlYWN0Um9vdE5vZGUpIHsKICAgICAgICAgICAgY29uc29sZS5sb2coJ0NvdWxkIG5vdCBmaW5kIHJlYWN0IHJvb3QnKTsKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KICAgICAgICB2YXIgcGxheWVyID0gZmluZFJlYWN0Tm9kZShyZWFjdFJvb3ROb2RlLCBub2RlID0+IG5vZGUuc2V0UGxheWVyQWN0aXZlICYmIG5vZGUucHJvcHMgJiYgbm9kZS5wcm9wcy5tZWRpYVBsYXllckluc3RhbmNlKTsKICAgICAgICBwbGF5ZXIgPSBwbGF5ZXIgJiYgcGxheWVyLnByb3BzICYmIHBsYXllci5wcm9wcy5tZWRpYVBsYXllckluc3RhbmNlID8gcGxheWVyLnByb3BzLm1lZGlhUGxheWVySW5zdGFuY2UgOiBudWxsOwogICAgICAgIHZhciBwbGF5ZXJTdGF0ZSA9IGZpbmRSZWFjdE5vZGUocmVhY3RSb290Tm9kZSwgbm9kZSA9PiBub2RlLnNldFNyYyAmJiBub2RlLnNldEluaXRpYWxQbGF5YmFja1NldHRpbmdzKTsKICAgICAgICBpZiAoIXBsYXllcikgewogICAgICAgICAgICBjb25zb2xlLmxvZygnQ291bGQgbm90IGZpbmQgcGxheWVyJyk7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICB9CiAgICAgICAgaWYgKCFwbGF5ZXJTdGF0ZSkgewogICAgICAgICAgICBjb25zb2xlLmxvZygnQ291bGQgbm90IGZpbmQgcGxheWVyIHN0YXRlJyk7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICB9CiAgICAgICAgaWYgKHBsYXllci5wYXVzZWQgfHwgcGxheWVyLmNvcmU/LnBhdXNlZCkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGlmIChpc1NlZWspIHsKICAgICAgICAgICAgY29uc29sZS5sb2coJ0ZvcmNlIHNlZWsgdG8gcmVzZXQgcGxheWVyIChob3BlZnVsbHkgZml4aW5nIGFueSBhdWRpbyBkZXN5bmMpIHBvczonICsgcGxheWVyLmdldFBvc2l0aW9uKCkgKyAnIHJhbmdlOicgKyBKU09OLnN0cmluZ2lmeShwbGF5ZXIuZ2V0QnVmZmVyZWQoKSkpOwogICAgICAgICAgICB2YXIgcG9zID0gcGxheWVyLmdldFBvc2l0aW9uKCk7CiAgICAgICAgICAgIHBsYXllci5zZWVrVG8oMCk7CiAgICAgICAgICAgIHBsYXllci5zZWVrVG8ocG9zKTsKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KICAgICAgICBpZiAoaXNQYXVzZVBsYXkpIHsKICAgICAgICAgICAgcGxheWVyLnBhdXNlKCk7CiAgICAgICAgICAgIHBsYXllci5wbGF5KCk7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICB9CiAgICAgICAgY29uc3QgbHNLZXlRdWFsaXR5ID0gJ3ZpZGVvLXF1YWxpdHknOwogICAgICAgIGNvbnN0IGxzS2V5TXV0ZWQgPSAndmlkZW8tbXV0ZWQnOwogICAgICAgIGNvbnN0IGxzS2V5Vm9sdW1lID0gJ3ZvbHVtZSc7CiAgICAgICAgdmFyIGN1cnJlbnRRdWFsaXR5TFMgPSBsb2NhbFN0b3JhZ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XRlbShsc0tleVZvbHVtZSwgY3VycmVudFZvbHVtZUxTKTsKICAgICAgICB9LCAzMDAwKTsKICAgIH0KICAgIHdpbmRvdy5yZWxvYWRUd2l0Y2hQbGF5ZXIgPSByZWxvYWRUd2l0Y2hQbGF5ZXI7CiAgICBob29rRmV0Y2goKTsKICAgIGZ1bmN0aW9uIG9uQ29udGVudExvYWRlZCgpIHsKICAgICAgICAvLyBUaGlzIHN0b3BzIFR3aXRjaCBmcm9tIHBhdXNpbmcgdGhlIHBsYXllciB3aGVuIGluIGFub3RoZXIgdGFiIGFuZCBhbiBhZCBzaG93cy4KICAgICAgICAvLyBUYWtlbiBmcm9tIGh0dHBzOi8vZ2l0aHViLmNvbS9zYXVjZXR0di9WaWRlb0FkQmxvY2tGb3JUd2l0Y2gvYmxvYi9jZWZjZTlkMmI1NjU3NjljNzdlMzY2NmFjODIzNGMzYWNmZTIwZDgzL2Nocm9tZS9jb250ZW50LmpzI0wzMAogICAgICAgIHRyeSB7CiAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShkb2N1bWVudCwgJ3Zpc2liaWxpdHlTdGF0ZScsIHsKICAgICAgICAgICAgICAgIGdldCgpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3Zpc2libGUnOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKICAgICAgICB9Y2F0Y2h7fQogICAgICAgIHRyeSB7CiAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShkb2N1bWVudCwgJ2hpZGRlbicsIHsKICAgICAgICAgICAgICAgIGdldCgpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pOwogICAgICAgIH1jYXRjaHt9CiAgICAgICAgdmFyIGJsb2NrID0gZSA9PiB7CiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTsKICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTsKICAgICAgICAgICAgZS5zdG9wSW1tZWRpYXRlUHJvcGFnYXRpb24oKTsKICAgICAgICB9OwogICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ3Zpc2liaWxpdHljaGFuZ2UnLCBibG9jaywgdHJ1ZSk7CiAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignd2Via2l0dmlzaWJpbGl0eWNoYW5nZScsIGJsb2NrLCB0cnVlKTsKICAgICAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKCdtb3p2aXNpYmlsaXR5Y2hhbmdlJywgYmxvY2ssIHRydWUpOwogICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ2hhc0ZvY3VzJywgYmxvY2ssIHRydWUpOwogICAgICAgIHRyeSB7CiAgICAgICAgICAgIGlmICgvRmlyZWZveC8udGVzdChuYXZpZ2F0b3IudXNlckFnZW50KSkgewogICAgICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KGRvY3VtZW50LCAnbW96SGlkZGVuJywgewogICAgICAgICAgICAgICAgICAgIGdldCgpIHsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KGRvY3VtZW50LCAnd2Via2l0SGlkZGVuJywgewogICAgICAgICAgICAgICAgICAgIGdldCgpIHsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9CiAgICAgICAgfWNhdGNoe30KICAgICAgICAvLyBIb29rcyBmb3IgcHJlc2VydmluZyB2b2x1bWUgLyByZXNvbHV0aW9uCiAgICAgICAgdmFyIGtleXNUb0NhY2hlID0gWw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gIHJldHVybiByZWFsR2V0SXRlbS5hcHBseSh0aGlzLCBhcmd1bWVudHMpOwogICAgICAgIH07CiAgICB9CiAgICBpZiAoZG9jdW1lbnQucmVhZHlTdGF0ZSA9PT0gImNvbXBsZXRlIiB8fCBkb2N1bWVudC5yZWFkeVN0YXRlID09PSAibG9hZGVkIiB8fCBkb2N1bWVudC5yZWFkeVN0YXRlID09PSAiaW50ZXJhY3RpdmUiKSB7CiAgICAgICAgb25Db250ZW50TG9hZGVkKCk7CiAgICB9IGVsc2UgewogICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCJET01Db250ZW50TG9hZGVkIiwgZnVuY3Rpb24oKSB7CiAgICAgICAgICAgIG9uQ29udGVudExvYWRlZCgpOwogICAgICAgIH0pOwogICAgfQp9KSgpOwo="}] \ No newline at end of file +[{"name":"async-sugarcoat-04394153a7ce417b88e3fe1790a4e6a269bfebe5.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"e2NvbnN0IGE9e307KGU9PnsidXNlIHN0cmljdCI7Y29uc3QgdD1TeW1ib2woImRlZmVycmVkSGFuZGxlIiksbj1TeW1ib2woIm9ubG9hZHN0YXJ0IiksaT1TeW1ib2woIm9ucHJvZ3Jlc3MiKSxyPVN5bWJvbCgib25hYm9ydCIpLGE9U3ltYm9sKCJvbmVycm9yIiksbz1TeW1ib2woIm9ubG9hZCIpLHM9U3ltYm9sKCJvbnRpbWVvdXQiKSxnPVN5bWJvbCgib25sb2FkZW5kIiksbD1TeW1ib2woIm9ucmVhZHlzdGF0ZWNoYW5nZSIpLGQ9U3ltYm9sKCJyZWFkeVN0YXRlIiksdT1TeW1ib2woInRpbWVvdXQiKSxjPVN5bWJvbCgid2l0aENyZWRlbnRpYWxzIikscD1TeW1ib2woInVwbG9hZCIpLGg9U3ltYm9sKCJyZXNwb25zZVR5cGUiKSx2PShlLG4pPT57dmFyIHQ9bi5kZXNjcmlwdGlvbi5zdWJzdHJpbmcoMik7T2JqZWN0LmRlZmluZ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pb24oZSl7InBvZGNhc3Rfc3Vic2NyaWJlIj09PWUuZGV0YWlsLnR5cGUmJk1hcmtldGluZy5nRXZlbnQodCxuKX0pfSxNYXJrZXRpbmcuVURPLmdfcmZxX3N1Ym1pdD1mdW5jdGlvbih0LG4pe3dpbmRvdy5hZGRFdmVudExpc3RlbmVyKCJodmUiLGZ1bmN0aW9uKGUpeyJyZnFfc3VibWl0Ij09PWUuZGV0YWlsLnR5cGUmJk1hcmtldGluZy5nRXZlbnQodCxuKX0pfSxNYXJrZXRpbmcuVURPLmdfaW9uX3N1Ym1pdD1mdW5jdGlvbihlLHQpey9saXZlYmFsbC4qY29tcGxldGVkL2dpLnRlc3QoZGVsbF9tYXJrZXRpbmdfdXRpbC5nZXRzY01hcCgicGFnZW5hbWUiKSkmJk1hcmtldGluZy5nRXZlbnQoZSx0KX0sTWFya2V0aW5nLlVETy5nX2dhdGVkX3N1Ym1pdD1mdW5jdGlvbih0LG4pe3dpbmRvdy5hZGRFdmVudExpc3RlbmVyKCJodmUiLGZ1bmN0aW9uKGUpeyJnYXRlZF9zdWJtaXQiPT09ZS5kZXRhaWwudHlwZSYmTWFya2V0aW5nLmdFdmVudCh0LG4pfSl9fSwzNDc1MTkzLFszNjE3NjgyXSw2MjA4MTgsWzYxOTQwNF0pfQo="},{"name":"async-sugarcoat-8a459c41783885dc83d30f5b7da2359091f4e607.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"e2NvbnN0IGE9e307KHQ9PnsidXNlIHN0cmljdCI7Y29uc3QgZT1TeW1ib2woImRlZmVycmVkSGFuZGxlIiksbj1TeW1ib2woIm9ubG9hZHN0YXJ0Iikscj1TeW1ib2woIm9ucHJvZ3Jlc3MiKSxhPVN5bWJvbCgib25hYm9ydCIpLG89U3ltYm9sKCJvbmVycm9yIiksaT1TeW1ib2woIm9ubG9hZCIpLHM9U3ltYm9sKCJvbnRpbWVvdXQiKSxjPVN5bWJvbCgib25sb2FkZW5kIiksdT1TeW1ib2woIm9ucmVh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JsZSI7CiAgICB9LAogICAgZW51bWVyYWJsZTogdHJ1ZSwKICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZQp9KTsKfSkoKQo="},{"name":"brave-fix.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"Ly8vIGJyYXZlLWZpeC5qcwovLy8gYWxpYXMgYmYuanMKZGVsZXRlIE5hdmlnYXRvci5wcm90b3R5cGUuYnJhdmUKZGVsZXRlIHdpbmRvdy5uYXZpZ2F0b3IuYnJhdmUK"},{"name":"brave-google-maps-fix.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"Ly8gRml4IGZvciBodHRwczovL2dpdGh1Yi5jb20vYnJhdmUvYnJhdmUtYnJvd3Nlci9pc3N1ZXMvMzcwNzUKKCgpID0+IHsKICBpZiAobG9jYXRpb24ucGF0aG5hbWUuc3RhcnRzV2l0aCgiL21hcHMvIikgfHwgbG9jYXRpb24ucGF0aG5hbWUgPT09ICIvbWFwcyIpIHsKICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShXZWJHTFNoYWRlclByZWNpc2lvbkZvcm1hdC5wcm90b3R5cGUsICdwcmVjaXNpb24nLCB7CiAgICAgIHZhbHVlOiAwLAogICAgICB3cml0YWJsZTogZmFsc2UKICAgIH0pOwogIH0KfSkoKTsK"},{"name":"brave-video-bg-play.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"Ly8vIGJyYXZlLXZpZGVvLWJnLXBsYXkuanMKLy8gQmFzZWQgb246IGh0dHBzOi8vZ2l0aHViLmNvbS9tb3ppbGxhL3ZpZGVvLWJnLXBsYXkKLy8gTGljZW5zZTogIGh0dHBzOi8vZ2l0aHViLmNvbS9tb3ppbGxhL3ZpZGVvLWJnLXBsYXkvYmxvYi9tYXN0ZXIvTElDRU5TRSAoTUlUKQovLyBGcm9tOiBodHRwczovL2dpc3QuZ2l0aHViLmNvbS9nd2Fyc2VyLzNiNDdiNjE4NjNiZmZjZmViZTQ0OThjNzdiMjMwMWNkCihmdW5jdGlvb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PT4gZXZ0LnN0b3BJbW1lZGlhdGVQcm9wYWdhdGlvbigpLCB0cnVlKTsKfQovLyBVc2VyIGFjdGl2aXR5IHRyYWNraW5nCmlmIChJU19ZT1VUVUJFKSB7CiAgY29uc3QgcmVmcmVzaEludGVydmFsID0gNSAqIDYwICogMTAwMDsgLy8gZXZlcnkgNSBtaW51dGVzCiAgd2FpdEZvcllvdXR1YmVMYWN0SW5pdCgoKSA9PiByZWZyZXNoTGFjdCgpLCByZWZyZXNoSW50ZXJ2YWwpOwp9CmZ1bmN0aW9uIHdhaXRGb3JZb3V0dWJlTGFjdEluaXQoYUNhbGxiYWNrLCBhQ2FsbGJhY2tJbnRlcnZhbCwgYURlbGF5ID0gMTAwMCkgewogIGxldCBwYWdlV2luID0gd2luZG93OwogIGlmIChwYWdlV2luLmhhc093blByb3BlcnR5KCdfbGFjdCcpKSB7CiAgICB3aW5kb3cuc2V0SW50ZXJ2YWwoYUNhbGxiYWNrLCBhQ2FsbGJhY2tJbnRlcnZhbCk7CiAgfSBlbHNlIHsKICAgIHdpbmRvdy5zZXRUaW1lb3V0KCgpID0+IHdhaXRGb3JZb3V0dWJlTGFjdEluaXQoYUNhbGxiYWNrLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhQ2FsbGJhY2tJbnRlcnZhbCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYURlbGF5ICogMiksCiAgICAgICAgICAgICAgICAgICAgICBhRGVsYXkpOwogIH0KfQpmdW5jdGlvbiByZWZyZXNoTGFjdCgpIHsKICB3aW5kb3cuX2xhY3QgPSBEYXRlLm5vdygpOwp9Cn0pKCkK"},{"name":"brave-youtube-navigation-fix.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"KF8gPT4gewogIGNvbnN0IG9yaWdQZXJmTm93ID0gd2luZG93LnBlcmZvcm1hbmNlLm5vdzsKICBsZXQgcHJldmlvdXMgPSAwOwoKICB3aW5kb3cucGVyZm9ybWFuY2Uubm93ID0gZnVuY3Rpb24gKCkgewogICAgbGV0IGN1cnJlbnQgPSBvcmlnUGVyZk5vdy5hcHBseSh0aGlzKTsKICAgIGlmIChjdXJyZW50IDw9IHByZXZpb3VzKSB7CiAgICAgIGN1cnJlbnQgPSBwcmV2aW91cyArIE51bWJlci5FUFNJTE9OICogMTAwMDAwOwogICAgfQoKICAgIHJldHVybiBwcmV2aW91cyA9IGN1cnJlbnQ7CiAgfQp9KSgpOwo="},{"name":"brave-youtube-theater-fix.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"KGFzeW5jIF8gPT4gewogIGlmIChzZWxmLmNvb2tpZVN0b3JlID09PSB1bmRlZmluZWQpIHsKICAgIC8vIERvIG5vdGhpbmcgb24gaU9TLiBUaGUgcHJvYmxlbSBkb2Vzbid0IGV4aXN0IHRoZXJlLCBhbmQgdGhlCiAgICAvLyBzb2x1dGlvbiB3b3VsZG4ndCB3b3JrIGFueXdheQogICAgcmV0dXJuCiAgfQogIGNvbnN0IHN0b3JlS2V5ID0gJ2JyYXZlOjp3aWRlJwogIGNvbnN0IGNvb2tpZUtleSA9ICd3aWRlJwoKICBjb25zdCB3aWRlQ29va2llID0gYXdhaXQgY29va2llU3RvcmUuZ2V0KGNvb2tpZUtleSkKICBjb25zdCB3aWRlQ29va2llQmFja3VwID0gbG9jYWxTdG9yYWdlLmdldEl0ZW0oc3RvcmVLZXkpCgogIC8vIFNldCB0aGUgY29va2llIGZyb20gbG9jYWxTdG9yYWdlIGlmZjogCiAgLy8gMSkgaXQgZG9lc24ndCBhbHJlYWR5IGV4aXN0LgogIC8vIDIpIHdlIGhhdmUgYSBiYWNrdXAgaW4gbG9jYWxTdG9yYWdlLgogIGlmICghd2lkZUNvb2tpZSAmJiB3aWRlQ29va2llQmFja3VwKSB7CiAgICAvLyBUaGUgY29va2llIG9iamVjdCBpcyBzdG9yZWQgYXMgYSBzdHJpbmcuIFBhcnNlIGl0LgogICAgY29uc3QgY29va2llT2JqID0gSlNPTi5wYXJzZSh3aWRlQ29va2llQmFja3VwKQogICAgYXdhaXQgY29va2llU3RvcmUuc2V0KGNvb2tpZU9iaikKICAgIC8vIFJlZnJlc2ggdGhlIHBhZ2UgdG8gbWFrZSBZVCB1c2UgdGhlIG5ldyBjb29raWUuCiAgICBsb2NhdGlvbi5yZWxvYWQoKQogIH0KCiAgLy8gUGVyc2lzdCB0aGUgY29va2llIHZhbHVlIHRvIGxvY2FsU3RvcmFnZSBldmVyeSBzZWNvbmQuCiAgc2V0SW50ZXJ2YWwoYXN5bmMgXyA9PiB7CiAgICB0cnkgewogICAgICBjb25zdCB3aWRlQ29va2llID0gYXdhaXQgY29va2llU3RvcmUuZ2V0KGNvb2tpZUtleSkKICAgICAgLy8gV2UgaGF2ZSB0byBzdHJpbmdpZnkgdGhlIGNvb2tpZSBvYmplY3QgdG8gc3RvcmUgaXQgaW4gbG9jYWxTdG9yYWdlLgogICAgICBpZiAod2lkZUNvb2tpZSkgewogICAgICAgIGxvY2FsU3RvcmFnZS5zZXRJdGVtKHN0b3JlS2V5LCBKU09OLnN0cmluZ2lmeSh3aWRlQ29va2llKSkKICAgICAgfSBlbHNlIHsKICAgICAgICBsb2NhbFN0b3JhZ2UucmVtb3ZlSXRlbShzdG9yZUtleSkKICAgICAgfQogICAgfSBjYXRjaCAoZSkgewogICAgICAvLyBzd2FsbG93IGVycm9yIGZyb20gbm8gY29va2llIGV4aXN0aW5nCiAgICB9CiAgfSwgMTAwMCkKfSkoKTsK"},{"name":"de-amp.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"KGZ1bmN0aW9uICgpIHsKICBpZiAodHlwZW9mIGRlQW1wRW5hYmxlZCAhPT0gJ3VuZGVmaW5lZCcgJiYgZGVBbXBFbmFibGVkKSB7CiAgICBjb25zdCBhdHRyID0gJ2pzYWN0aW9uJwogICAgY29uc3Qgc2VsZWN0b3IgPSBgYVtkYXRhLWFtcC10aXRsZV1bJHthdHRyfV1gCiAgICBsZXQgdGltZXIKICAgIGNvbnN0IGlkbGVDYWxsYmFjayA9IChfID0+IHsKICAgICAgaWYgKHNlbGYucmVxdWVzdElkbGVDYWxsYmFjaykgewogICAgICAgIHJldHVybiAoY2FsbGJhY2ssIHRpbWVvdXQpID0+IHsKICAgICAgICAgIHJldHVybiBzZWxmLnJlcXVlc3RJZGxlQ2FsbGJhY2soY2FsbGJhY2ssIHsgdGltZW91dCB9KQogICAgICAgIH0KICAgICAgfQoKICAgICAgLy8gRmFsbGJhY2sgdG8gc2V0VGltZW91dCB3aGVuIHJlcXVlc3RJZGxlQ2FsbGJhY2sgZG9lc24ndCBleGlzdC4KICAgICAgcmV0dXJuIChjYWxsYmFjaykgPT4gewogICAgICAgIHJldHVybiBzZWxmLnNldFRpbWVvdXQoY2FsbGJhY2ssIDApCiAgICAgIH0KICAgIH0pKCkKICAgIGNvbnN0IHJtYXR0ciA9ICgpID0+IHsKICAgICAgdGltZXIgPSB1bmRlZmluZWQKICAgICAgdHJ5IHsKICAgICAgICBjb25zdCBub2RlcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoc2VsZWN0b3IpCiAgICAgICAgZm9yIChjb25zdCBub2RlIG9mIG5vZGVzKSB7CiAgICAgICAgICBub2RlLnJlbW92ZUF0dHJpYnV0ZShhdHRyKQogICAgICAgIH0KICAgICAgfSBjYXRjaCAoZXgpIHsgfQogICAgfQogICAgY29uc3QgbXV0YXRpb25IYW5kbGVyID0gKG11dGF0aW9ucykgPT4gewogICAgICBpZiAodGltZXIgIT09IHVuZGVmaW5lZCkgewogICAgICAgIHJldHVybgogICAgICB9CiAgICAgIGxldCBza2lwID0gdHJ1ZQogICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG11dGF0aW9ucy5sZW5ndGggJiYgc2tpcDsgaSsrKSB7CiAgICAgICAgY29uc3QgeyB0eXBlLCBhZGRlZE5vZGVzLCByZW1vdmVkTm9kZXMgfSA9IG11dGF0aW9uc1tpXQogICAgICAgIGlmICh0eXBlID09PSAnYXR0cmlidXRlcycpIHsKICAgICAgICAgIHNraXAgPSBmYWxzZQogICAgICAgIH0KICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGFkZGVkTm9kZXMubGVuZ3RoICYmIHNraXA7IGorKykgewogICAgICAgICAgaWYgKGFkZGVkTm9kZXNbal0ubm9kZVR5cGUgPT09IDEpIHsKICAgICAgICAgICAgc2tpcCA9IGZhbHNlCiAgICAgICAgICAgIGJyZWFrCiAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgcmVtb3ZlZE5vZGVzLmxlbmd0aCAmJiBza2lwOyBqKyspIHsKICAgICAgICAgIGlmIChyZW1vdmVkTm9kZXNbal0ubm9kZVR5cGUgPT09IDEpIHsKICAgICAgICAgICAgc2tpcCA9IGZhbHNlCiAgICAgICAgICAgIGJyZWFrCiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICAgIGlmIChza2lwKSB7CiAgICAgICAgcmV0dXJuCiAgICAgIH0KCiAgICAgIHRpbWVyID0gaWRsZUNhbGxiYWNrKHJtYXR0ciwgMTcpCiAgICB9CgogICAgY29uc3Qgc3RhcnQgPSAoKSA9PiB7CiAgICAgIHJtYXR0cigpCiAgICAgIGNvbnN0IG9ic2VydmVyID0gbmV3IE11dGF0aW9uT2JzZXJ2ZXIobXV0YXRpb25IYW5kbGVyKQogICAgICBvYnNlcnZlci5vYnNlcnZlKGRvY3VtZW50LCB7CiAgICAgICAgYXR0cmlidXRlczogdHJ1ZSwKICAgICAgICBhdHRyaWJ1dGVGaWx0ZXI6IFthdHRyXSwKICAgICAgICBjaGlsZExpc3Q6IHRydWUsCiAgICAgICAgc3VidHJlZTogdHJ1ZQogICAgICB9KQogICAgfQoKICAgIHNlbGYuYWRkRXZlbnRMaXN0ZW5lcignRE9NQ29udGVudExvYWRlZCcsIHN0YXJ0LCB7IG9uY2U6IHRydWUgfSkKICB9Cn0pKCk7Cg=="},{"name":"touch-fix.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"Ly8gUmVtb3ZlIHRvdWNoIGNoZWNrcyBvbiBzZWxlY3RlZCBtb2JpbGUgc2l0ZXMKZGVsZXRlIERvY3VtZW50LnByb3RvdHlwZS5jcmVhdGVUb3VjaApkZWxldGUgRG9jdW1lbnQucHJvdG90eXBlLm9udG91Y2hzdGFydApkZWxldGUgRG9jdW1lbnQucHJvdG90eXBlLm9udG91Y2hlbmQKZGVsZXRlIERvY3VtZW50LnByb3RvdHlwZS5vbnRvdWNoY2FuY2VsCmRlbGV0ZSBEb2N1bWVudC5wcm90b3R5cGUuVG91Y2hFdmVudAo="},{"name":"trusted_types.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"Ly8vIHNldC10cnVzdGVkLXR5cGVzLmpzCmZ1bmN0aW9uIHNldFRydXN0ZWRUeXBlcygpIHsKICBpZiAod2luZG93LnRydXN0ZWRUeXBlcyAmJiB3aW5kb3cudHJ1c3RlZFR5cGVzLmNyZWF0ZVBvbGljeSkgewogICAgd2luZG93LnRydXN0ZWRUeXBlcy5jcmVhdGVQb2xpY3koImRlZmF1bHQiLCB7CiAgICAgIGNyZWF0ZVNjcmlwdDogc3RyaW5nID0+IHN0cmluZwogICAgfSk7CiAgIH0KICAgcnVuQXQoKCkgPT4ge30sICdpbnRlcmFjdGl2ZScpOwp9Cg=="},{"name":"vaft-ublock-origin.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"KGZ1bmN0aW9uKCkgewogICAgaWYgKCAvKF58XC4pdHdpdGNoXC50diQvLnRlc3QoZG9jdW1lbnQubG9jYXRpb24uaG9zdG5hbWUpID09PSBmYWxzZSApIHsgcmV0dXJuOyB9CiAgICBmdW5jdGlvbiBkZWNsYXJlT3B0aW9ucyhzY29wZSkgewogICAgICAgIHNjb3BlLkFkU2lnbmlmaWVyID0gJ3N0aXRjaGVkJzsKICAgICAgICBzY29wZS5DbGllbnRJRCA9ICdraW1uZTc4a3gzbmN4NmJ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2tXaW5kb3dXb3JrZXIoKSB7CiAgICAgICAgd2luZG93LldvcmtlciA9IGNsYXNzIFdvcmtlciBleHRlbmRzIG9sZFdvcmtlciB7CiAgICAgICAgICAgIGNvbnN0cnVjdG9yKHR3aXRjaEJsb2JVcmwsIG9wdGlvbnMpIHsKICAgICAgICAgICAgICAgIHZhciBpc1R3aXRjaFdvcmtlciA9IGZhbHNlOwogICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICBpc1R3aXRjaFdvcmtlciA9IG5ldyBVUkwodHdpdGNoQmxvYlVybCkub3JpZ2luLmVuZHNXaXRoKCcudHdpdGNoLnR2Jyk7CiAgICAgICAgICAgICAgICB9IGNhdGNoIHt9CiAgICAgICAgICAgICAgICBpZiAoIWlzVHdpdGNoV29ya2VyKSB7CiAgICAgICAgICAgICAgICAgICAgc3VwZXIodHdpdGNoQmxvYlVybCwgb3B0aW9ucyk7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgdmFyIG5ld0Jsb2JTdHIgPSBgCiAgICAgICAgICAgICAgICAgICAgJHtnZXRTdHJlYW1VcmxGb3JSZXNvbHV0aW9uLnRvU3RyaW5nKCl9CiAgICAgICAgICAgICAgICAgICAgJHtnZXRTdHJlYW1Gb3JSZXNvbHV0aW9uLnRvU3RyaW5nKCl9CiAgICAgICAgICAgICAgICAgICAgJHtzdHJpcFVudXNlZFBhcmFtcy50b1N0cmluZygpfQogICAgICAgICAgICAgICAgICAgICR7cHJvY2Vzc00zVTgudG9TdHJpbmcoKX0KICAgICAgICAgICAgICAgICAgICAke2hvb2tXb3JrZXJGZXRjaC50b1N0cmluZygpfQogICAgICAgICAgICAgICAgICAgICR7ZGVjbGFyZU9wdGlvbnMudG9TdHJpbmcoKX0KICAgICAgICAgICAgICAgICAgICAke2dldEFjY2Vzc1Rva2VuLnRvU3RyaW5nKCl9CiAgICAgICAgICAgICAgICAgICAgJHtncWxSZXF1ZXN0LnRvU3RyaW5nKCl9CiAgICAgICAgICAgICAgICAgICAgJHthZFJlY29yZGdxbFBhY2tldC50b1N0cmluZygpfQogICAgICAgICAgICAgICAgICAgICR7dHJ5Tm90aWZ5VHdpdGNoLnRvU3RyaW5nKCl9CiAgICAgICAgICAgICAgICAgICAgJHtwYXJzZUF0dHJpYnV0ZXMudG9TdHJpbmcoKX0KICAgICAgICAgICAgICAgICAgICAke2dldFdhc21Xb3JrZXJVcmwudG9TdHJpbmcoKX0KICAgICAgICAgICAgICAgICAgICB2YXIgd29ya2VyVXJsID0gZ2V0V2FzbVdvcmtlclVybCgnJHt0d2l0Y2hCbG9iVXJsLnJlcGxhY2VBbGwoIiciLCAiJTI3Iil9Jyk7CiAgICAgICAgICAgICAgICAgICAgaWYgKHdvcmtlclVybCAmJiB3b3JrZXJVcmwuaW5jbHVkZXMoJ2Fzc2V0cy50d2l0Y2gudHYvYXNzZXRzL2FtYXpvbi1pdnMtd2FzbXdvcmtlcicpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGRlY2xhcmVPcHRpb25zKHNlbGYpOwogICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmFkZEV2ZW50TGlzdGVuZXIoJ21lc3NhZ2UnLCBmdW5jdGlvbihlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5kYXRhLmtleSA9PSAnVXBkYXRlSXNTcXVhZFN0cmVhbScpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJc1NxdWFkU3RyZWFtID0gZS5kYXRhLnZhbHVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlLmRhdGEua2V5ID09ICdVcGRhdGVDbGllbnRWZXJzaW9uJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENsaWVudFZlcnNpb24gPSBlLmRhdGEudmFsdWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGUuZGF0YS5rZXkgPT0gJ1VwZGF0ZUNsaWVudFNlc3Npb24nKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2xpZW50U2Vzc2lvbiA9IGUuZGF0YS52YWx1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZS5kYXRhLmtleSA9PSAnVXBkYXRlQ2xpZW50SWQnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2xpZW50SUQgPSBlLmRhdGEudmFsdWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGUuZGF0YS5rZXkgPT0gJ1VwZGF0ZURldmljZUlkJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdRTERldmljZUlEID0gZS5kYXRhLnZhbHVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlLmRhdGEua2V5ID09ICdVcGRhdGVDbGllbnRJbnRlZ3JpdHlIZWFkZXInKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2xpZW50SW50ZWdyaXR5SGVhZGVyID0gZS5kYXRhLnZhbHVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlLmRhdGEua2V5ID09ICdVcGRhdGVBdXRob3JpemF0aW9uSGVhZGVyJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF1dGhvcml6YXRpb25IZWFkZXIgPSBlLmRhdGEudmFsdWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgICAgICBob29rV29ya2VyRmV0Y2goKTsKICAgICAgICAgICAgICAgICAgICAgICAgaW1wb3J0U2NyaXB0cyh3b3JrZXJVcmwpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGA7CiAgICAgICAgICAgICAgICBzdXBlcihVUkwuY3JlYXRlT2JqZWN0VVJMKG5ldyBCbG9iKFtuZXdCbG9iU3RyXSkpLCBvcHRpb25zKTsKICAgICAgICAgICAgICAgIHR3aXRjaFdvcmtlcnMucHVzaCh0aGlzKTsKICAgICAgICAgICAgICAgIHRoaXMub25tZXNzYWdlID0gZnVuY3Rpb24oZSkgewogICAgICAgICAgICAgICAgICAgIGlmIChlLmRhdGEua2V5ID09ICdTaG93QWRCbG9ja0Jhbm5lcicpIHsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFkQmxvY2tEaXYgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRCbG9ja0RpdiA9IGdldEFkQmxvY2tEaXYoKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBhZEJsb2NrRGl2LlAudGV4dENvbnRlbnQgPSAnQmxvY2tpbmcgYWRzJzsKICAgICAgICAgICAgICAgICAgICAgICAgYWRCbG9ja0Rpdi5zdHlsZS5kaXNwbGF5ID0gJ2Jsb2NrJzsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGUuZGF0YS5rZXkgPT0gJ0hpZGVBZEJsb2NrQmFubmVyJykgewogICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWRCbG9ja0RpdiA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZEJsb2NrRGl2ID0gZ2V0QWRCbG9ja0RpdigpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGFkQmxvY2tEaXYuc3R5bGUuZGlzcGxheSA9ICdub25lJzsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGUuZGF0YS5rZXkgPT0gJ1BhdXNlUmVzdW1lUGxheWVyJykgewogICAgICAgICAgICAgICAgICAgICAgICBkb1R3aXRjaFBsYXllclRhc2sodHJ1ZSwgZmFsc2UsIGZhbHNlLCBmYWxzZSwgZmFsc2UpOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZS5kYXRhLmtleSA9PSAnRm9yY2VDaGFuZ2VRdWFsaXR5JykgewogICAgICAgICAgICAgICAgICAgICAgICAvL1RoaXMgaXMgdXNlZCB0byBmaXggdGhlIGJ1ZyB3aGVyZSB0aGUgdmlkZW8gd291bGQgZnJlZXplLgogICAgICAgICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9pZiAobmF2aWdhdG9yLnVzZXJBZ2VudC50b0xvd2VyQ2FzZSgpLmluZGV4T2YoJ2ZpcmVmb3gnKSA9PSAtMSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGF1dG9RdWFsaXR5ID0gZG9Ud2l0Y2hQbGF5ZXJUYXNrKGZhbHNlLCBmYWxzZSwgZmFsc2UsIHRydWUsIGZhbHNlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjdXJyZW50UXVhbGl0eSA9IGRvVHdpdGNoUGxheWVyVGFzayhmYWxzZSwgdHJ1ZSwgZmFsc2UsIGZhbHNlLCBmYWxzZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoSXNQbGF5ZXJBdXRvUXVhbGl0eSA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSXNQbGF5ZXJBdXRvUXVhbGl0eSA9IGF1dG9RdWFsaXR5OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKE9yaWdpbmFsVmlkZW9QbGF5ZXJRdWFsaXR5ID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPcmlnaW5hbFZpZGVvUGxheWVyUXVhbGl0eSA9IGN1cnJlbnRRdWFsaXR5OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFjdXJyZW50UXVhbGl0eS5pbmNsdWRlcygnMzYwJykgfHwgZS5kYXRhLnZhbHVlICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIU9yaWdpbmFsVmlkZW9QbGF5ZXJRdWFsaXR5LmluY2x1ZGVzKCczNjAnKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2V0dGluZ3NNZW51ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignZGl2W2RhdGEtYS10YXJnZXQ9InBsYXllci1zZXR0aW5ncy1tZW51Il0nKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNldHRpbmdzTWVudSA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2V0dGluZ3NDb2cgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCdidXR0b25bZGF0YS1hLXRhcmdldD0icGxheWVyLXNldHRpbmdzLWJ1dHRvbiJdJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2V0dGluZ3NDb2cpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXR0aW5nc0NvZy5jbGljaygpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBxdWFsaXR5TWVudSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJ2J1dHRvbltkYXRhLWEtdGFyZ2V0PSJwbGF5ZXItc2V0dGluZ3MtbWVudS1pdGVtLXF1YWxpdHkiXScpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChxdWFsaXR5TWVudSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWFsaXR5TWVudS5jbGljaygpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbG93UXVhbGl0eSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJ2lucHV0W2RhdGEtYS10YXJnZXQ9InR3LXJhZGlvIicpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsb3dRdWFsaXR5KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBxdWFsaXR5VG9TZWxlY3QgPSBsb3dRdWFsaXR5Lmxlbmd0aCAtIDI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmRhdGEudmFsdWUgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUuZGF0YS52YWx1ZS5pbmNsdWRlcygnb3JpZ2luYWwnKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUuZGF0YS52YWx1ZSA9IE9yaWdpbmFsVmlkZW9QbGF5ZXJRdWFsaXR5OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChJc1BsYXllckF1dG9RdWFsaXR5KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUuZGF0YS52YWx1ZSA9ICdhdXRvJzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5kYXRhLnZhbHVlLmluY2x1ZGVzKCcxNjBwJykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWFsaXR5VG9TZWxlY3QgPSA1OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUuZGF0YS52YWx1ZS5pbmNsdWRlcygnMzYwcCcpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eVRvU2VsZWN0ID0gNDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmRhdGEudmFsdWUuaW5jbHVkZXMoJzQ4MHAnKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1YWxpdHlUb1NlbGVjdCA9IDM7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5kYXRhLnZhbHVlLmluY2x1ZGVzKCc3MjBwJykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWFsaXR5VG9TZWxlY3QgPSAyOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUuZGF0YS52YWx1ZS5pbmNsdWRlcygnODIycCcpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eVRvU2VsZWN0ID0gMjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmRhdGEudmFsdWUuaW5jbHVkZXMoJzg2NHAnKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1YWxpdHlUb1NlbGVjdCA9IDI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5kYXRhLnZhbHVlLmluY2x1ZGVzKCc5MDBwJykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWFsaXR5VG9TZWxlY3QgPSAyOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUuZGF0YS52YWx1ZS5pbmNsdWRlcygnOTM2cCcpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eVRvU2VsZWN0ID0gMjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmRhdGEudmFsdWUuaW5jbHVkZXMoJzk2MHAnKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1YWxpdHlUb1NlbGVjdCA9IDI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5kYXRhLnZhbHVlLmluY2x1ZGVzKCcxMDgwcCcpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eVRvU2VsZWN0ID0gMjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmRhdGEudmFsdWUuaW5jbHVkZXMoJ3NvdXJjZScpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eVRvU2VsZWN0ID0gMTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmRhdGEudmFsdWUuaW5jbHVkZXMoJ2F1dG8nKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1YWxpdHlUb1NlbGVjdCA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnJlbnRRdWFsaXR5TFMgPSB3aW5kb3cubG9jYWxTdG9yYWdlLmdldEl0ZW0oJ3ZpZGVvLXF1YWxpdHknKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG93UXVhbGl0eVtxdWFsaXR5VG9TZWxlY3RdLmNsaWNrKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldHRpbmdzQ29nLmNsaWNrKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5sb2NhbFN0b3JhZ2Uuc2V0SXRlbSgndmlkZW8tcXVhbGl0eScsIGN1cnJlbnRRdWFsaXR5TFMpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5kYXRhLnZhbHVlICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9yaWdpbmFsVmlkZW9QbGF5ZXJRdWFsaXR5ID0gbnVsbDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElzUGxheWVyQXV0b1F1YWxpdHkgPSBudWxsOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9Ud2l0Y2hQbGF5ZXJUYXNrKGZhbHNlLCBmYWxzZSwgZmFsc2UsIHRydWUsIHRydWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9yaWdpbmFsVmlkZW9QbGF5ZXJRdWFsaXR5ID0gbnVsbDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIElzUGxheWVyQXV0b1F1YWxpdHkgPSBudWxsOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGdldEFkQmxvY2tEaXYoKSB7CiAgICAgICAgICAgICAgICAgICAgLy9UbyBkaXNwbGF5IGEgbm90aWZpY2F0aW9uIHRvIHRoZSB1c2VyLCB0aGF0IGFuIGFkIGlzIGJlaW5nIGJsb2NrZWQuCiAgICAgICAgICAgICAgICAgICAgdmFyIHBsYXllclJvb3REaXYgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcudmlkZW8tcGxheWVyJyk7CiAgICAgICAgICAgICAgICAgICAgdmFyIGFkQmxvY2tEaXYgPSBudWxsOwogICAgICAgICAgICAgICAgICAgIGlmIChwbGF5ZXJSb290RGl2ICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgYWRCbG9ja0RpdiA9IHBsYXllclJvb3REaXYucXVlcnlTZWxlY3RvcignLmFkYmxvY2stb3ZlcmxheScpOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWRCbG9ja0RpdiA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZEJsb2NrRGl2ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnZGl2Jyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZEJsb2NrRGl2LmNsYXNzTmFtZSA9ICdhZGJsb2NrLW92ZXJsYXknOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRCbG9ja0Rpdi5pbm5lckhUTUwgPSAnPGRpdiBjbGFzcz0icGxheWVyLWFkYmxvY2stbm90aWNlIiBzdHlsZT0iY29sb3I6IHdoaXRlOyBiYWNrZ3JvdW5kLWNvbG9yOiByZ2JhKDAsIDAsIDAsIDAuOCk7IHBvc2l0aW9uOiBhYnNvbHV0ZTsgdG9wOiAwcHg7IGxlZnQ6IDBweDsgcGFkZGluZzogNXB4OyI+PHA+PC9wPjwvZGl2Pic7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZEJsb2NrRGl2LnN0eWxlLmRpc3BsYXkgPSAnbm9uZSc7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZEJsb2NrRGl2LlAgPSBhZEJsb2NrRGl2LnF1ZXJ5U2VsZWN0b3IoJ3AnKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYXllclJvb3REaXYuYXBwZW5kQ2hpbGQoYWRCbG9ja0Rpdik7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFkQmxvY2tEaXY7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9OwogICAgfQogICAgZnVuY3Rpb24gZ2V0V2FzbVdvcmtlclVybCh0d2l0Y2hCbG9iVXJsKSB7CiAgICAgICAgdmFyIHJlcSA9IG5ldyBYTUxIdHRwUmVxdWVzdCgpOwogICAgICAgIHJlcS5vcGVuKCdHRVQnLCB0d2l0Y2hCbG9iVXJsLCBmYWxzZSk7CiAgICAgICAgcmVxLm92ZXJyaWRlTWltZVR5cGUoInRleHQvamF2YXNjcmlwdCIpOwogICAgICAgIHJlcS5zZW5kKCk7CiAgICAgICAgcmV0dXJuIHJlcS5yZXNwb25zZVRleHQuc3BsaXQoIiciKVsxXTsKICAgIH0KICAgIGZ1bmN0aW9uIGhvb2tXb3JrZXJGZXRjaCgpIHsKICAgICAgICBjb25zb2xlLmxvZygnaG9va1dvcmtlckZldGNoJyk7CiAgICAgICAgdmFyIHJlYWxGZXRjaCA9IGZldGNoOwogICAgICAgIGZldGNoID0gYXN5bmMgZnVuY3Rpb24odXJsLCBvcHRpb25zKSB7CiAgICAgICAgICAgIGlmICh0eXBlb2YgdXJsID09PSAnc3RyaW5nJykgewogICAgICAgICAgICAgICAgaWYgKHVybC5lbmRzV2l0aCgnbTN1OCcpKSB7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKGZ1bmN0aW9uKHJlc29sdmUsIHJlamVjdCkgewogICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHJvY2Vzc0FmdGVyID0gYXN5bmMgZnVuY3Rpb24ocmVzcG9uc2UpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vSGVyZSB3ZSBjaGVjayB0aGUgbTN1OCBmb3IgYW55IGFkcyBhbmQgYWxzbyB0cnkgZmFsbGJhY2sgcGxheWVyIHR5cGVzIGlmIG5lZWRlZC4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXNwb25zZVRleHQgPSBhd2FpdCByZXNwb25zZS50ZXh0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgd2VhdmVyVGV4dCA9IG51bGw7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZWF2ZXJUZXh0ID0gYXdhaXQgcHJvY2Vzc00zVTgodXJsLCByZXNwb25zZVRleHQsIHJlYWxGZXRjaCwgUGxheWVyVHlwZTIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHdlYXZlclRleHQuaW5jbHVkZXMoQWRTaWduaWZpZXIpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2VhdmVyVGV4dCA9IGF3YWl0IHByb2Nlc3NNM1U4KHVybCwgcmVzcG9uc2VUZXh0LCByZWFsRmV0Y2gsIFBsYXllclR5cGUzKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh3ZWF2ZXJUZXh0LmluY2x1ZGVzKEFkU2lnbmlmaWVyKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdlYXZlclRleHQgPSBhd2FpdCBwcm9jZXNzTTNVOCh1cmwsIHJlc3BvbnNlVGV4dCwgcmVhbEZldGNoLCBQbGF5ZXJUeXBlNCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKG5ldyBSZXNwb25zZSh3ZWF2ZXJUZXh0KSk7CiAgICAgICAgICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZW5kID0gZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVhbEZldGNoKHVybCwgb3B0aW9ucykudGhlbihmdW5jdGlvbihyZXNwb25zZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb2Nlc3NBZnRlcihyZXNwb25zZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVsnY2F0Y2gnXShmdW5jdGlvbihlcnIpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWplY3QoZXJyKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgICAgICAgICBzZW5kKCk7CiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHVybC5pbmNsdWRlcygnL2FwaS9jaGFubmVsL2hscy8nKSkgewogICAgICAgICAgICAgICAgICAgIHZhciBjaGFubmVsTmFtZSA9IChuZXcgVVJMKHVybCkpLnBhdGhuYW1lLm1hdGNoKC8oW15cL10rKSg/PVwuXHcrJCkvKVswXTsKICAgICAgICAgICAgICAgICAgICBVc2hlclBhcmFtcyA9IChuZXcgVVJMKHVybCkpLnNlYXJjaDsKICAgICAgICAgICAgICAgICAgICBDdXJyZW50Q2hhbm5lbE5hbWUgPSBjaGFubmVsTmFtZTsKICAgICAgICAgICAgICAgICAgICAvL1RvIHByZXZlbnQgcGF1c2UvcmVzdW1lIGxvb3AgZm9yIG1pZC1yb2xscy4KICAgICAgICAgICAgICAgICAgICB2YXIgaXNQQllQUmVxdWVzdCA9IHVybC5pbmNsdWRlcygncGljdHVyZS1ieS1waWN0dXJlJyk7CiAgICAgICAgICAgICAgICAgICAgaWYgKGlzUEJZUFJlcXVlc3QpIHsKICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gJyc7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbihyZXNvbHZlLCByZWplY3QpIHsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHByb2Nlc3NBZnRlciA9IGFzeW5jIGZ1bmN0aW9uKHJlc3BvbnNlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2Uuc3RhdHVzID09IDIwMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuY29kaW5nc00zdTggPSBhd2FpdCByZXNwb25zZS50ZXh0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN0cmVhbUluZm8gPSBTdHJlYW1JbmZvc1tjaGFubmVsTmFtZV07CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0cmVhbUluZm8gPT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJlYW1JbmZvc1tjaGFubmVsTmFtZV0gPSBzdHJlYW1JbmZvID0ge307CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbUluZm8uQ2hhbm5lbE5hbWUgPSBjaGFubmVsTmFtZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW1JbmZvLlJlcXVlc3RlZEFkcyA9IG5ldyBTZXQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW1JbmZvLlVybHMgPSBbXTsvLyB4eHgubTN1OCAtPiB7IFJlc29sdXRpb246ICIyODR4MTYwIiwgRnJhbWVSYXRlOiAzMC4wIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW1JbmZvLkVuY29kaW5nc00zVThDYWNoZSA9IFtdOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbUluZm8uRW5jb2RpbmdzTTNVOCA9IGVuY29kaW5nc00zdTg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpbmVzID0gZW5jb2RpbmdzTTN1OC5yZXBsYWNlKCdccicsICcnKS5zcGxpdCgnXG4nKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxpbmVzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbGluZXNbaV0uc3RhcnRzV2l0aCgnIycpICYmIGxpbmVzW2ldLmluY2x1ZGVzKCcubTN1OCcpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW1JbmZvLlVybHNbbGluZXNbaV1dID0gLTE7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA+IDAgJiYgbGluZXNbaSAtIDFdLnN0YXJ0c1dpdGgoJyNFWFQtWC1TVFJFQU0tSU5GJykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXR0cmlidXRlcyA9IHBhcnNlQXR0cmlidXRlcyhsaW5lc1tpIC0gMV0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXNvbHV0aW9uID0gYXR0cmlidXRlc1snUkVTT0xVVElPTiddOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmcmFtZVJhdGUgPSBhdHRyaWJ1dGVzWydGUkFNRS1SQVRFJ107CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc29sdXRpb24pIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtSW5mby5VcmxzW2xpbmVzW2ldXSA9IHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlc29sdXRpb246IHJlc29sdXRpb24sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFtZVJhdGU6IGZyYW1lUmF0ZQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmVhbUluZm9zQnlVcmxbbGluZXNbaV1dID0gc3RyZWFtSW5mbzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1haW5VcmxCeVVybFtsaW5lc1tpXV0gPSB1cmw7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShuZXcgUmVzcG9uc2UoZW5jb2RpbmdzTTN1OCkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHJlc3BvbnNlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlbmQgPSBmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZWFsRmV0Y2godXJsLCBvcHRpb25zKS50aGVuKGZ1bmN0aW9uKHJlc3BvbnNlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvY2Vzc0FmdGVyKHJlc3BvbnNlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pWydjYXRjaCddKGZ1bmN0aW9uKGVycikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChlcnIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgICAgICAgICAgICAgIHNlbmQoKTsKICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gcmVhbEZldGNoLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7CiAgICAgICAgfTsKICAgIH0KICAgIGZ1bmN0aW9uIGdldFN0cmVhbVVybEZvclJlc29sdXRpb24oZW5jb2RpbmdzTTN1OCwgcmVzb2x1dGlvbkluZm8sIHF1YWxpdHlPdmVycmlkZVN0cikgewogICAgICAgIHZhciBxdWFsaXR5T3ZlcnJpZGUgPSAwOwogICAgICAgIGlmIChxdWFsaXR5T3ZlcnJpZGVTdHIgJiYgcXVhbGl0eU92ZXJyaWRlU3RyLmVuZHNXaXRoKCdwJykpIHsKICAgICAgICAgICAgcXVhbGl0eU92ZXJyaWRlID0gcXVhbGl0eU92ZXJyaWRlU3RyLnN1YnN0cigwLCBxdWFsaXR5T3ZlcnJpZGVTdHIubGVuZ3RoIC0gMSkgfCAwOwogICAgICAgIH0KICAgICAgICB2YXIgcXVhbGl0eU92ZXJyaWRlRm91bmRRdWFsaXR5ID0gMDsKICAgICAgICB2YXIgcXVhbGl0eU92ZXJyaWRlRm91bmRGcmFtZVJhdGUgPSAwOwogICAgICAgIHZhciBlbmNvZGluZ3NMaW5lcyA9IGVuY29kaW5nc00zdTgucmVwbGFjZSgnXHInLCAnJykuc3BsaXQoJ1xuJyk7CiAgICAgICAgdmFyIGZpcnN0VXJsID0gbnVsbDsKICAgICAgICB2YXIgbGFzdFVybCA9IG51bGw7CiAgICAgICAgdmFyIG1hdGNoZWRSZXNvbHV0aW9uVXJsID0gbnVsbDsKICAgICAgICB2YXIgbWF0Y2hlZEZyYW1lUmF0ZSA9IGZhbHNlOwogICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZW5jb2RpbmdzTGluZXMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgaWYgKCFlbmNvZGluZ3NMaW5lc1tpXS5zdGFydHNXaXRoKCcjJykgJiYgZW5jb2RpbmdzTGluZXNbaV0uaW5jbHVkZXMoJy5tM3U4JykpIHsKICAgICAgICAgICAgICAgIGlmIChpID4gMCAmJiBlbmNvZGluZ3NMaW5lc1tpIC0gMV0uc3RhcnRzV2l0aCgnI0VYVC1YLVNUUkVBTS1JTkYnKSkgewogICAgICAgICAgICAgICAgICAgIHZhciBhdHRyaWJ1dGVzID0gcGFyc2VBdHRyaWJ1dGVzKGVuY29kaW5nc0xpbmVzW2kgLSAxXSk7CiAgICAgICAgICAgICAgICAgICAgdmFyIHJlc29sdXRpb24gPSBhdHRyaWJ1dGVzWydSRVNPTFVUSU9OJ107CiAgICAgICAgICAgICAgICAgICAgdmFyIGZyYW1lUmF0ZSA9IGF0dHJpYnV0ZXNbJ0ZSQU1FLVJBVEUnXTsKICAgICAgICAgICAgICAgICAgICBpZiAocmVzb2x1dGlvbikgewogICAgICAgICAgICAgICAgICAgICAgICBpZiAocXVhbGl0eU92ZXJyaWRlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcXVhbGl0eSA9IHJlc29sdXRpb24udG9Mb3dlckNhc2UoKS5zcGxpdCgneCcpWzFdOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHF1YWxpdHkgPT0gcXVhbGl0eU92ZXJyaWRlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eU92ZXJyaWRlRm91bmRRdWFsaXR5ID0gcXVhbGl0eTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWFsaXR5T3ZlcnJpZGVGb3VuZEZyYW1lUmF0ZSA9IGZyYW1lUmF0ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXRjaGVkUmVzb2x1dGlvblVybCA9IGVuY29kaW5nc0xpbmVzW2ldOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmcmFtZVJhdGUgPCA0MCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2NvbnNvbGUubG9nKGBxdWFsaXR5T3ZlcnJpZGUoQSkgcXVhbGl0eToke3F1YWxpdHl9IGZyYW1lUmF0ZToke2ZyYW1lUmF0ZX1gKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1hdGNoZWRSZXNvbHV0aW9uVXJsOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocXVhbGl0eSA8IHF1YWxpdHlPdmVycmlkZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vaWYgKG1hdGNoZWRSZXNvbHV0aW9uVXJsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgY29uc29sZS5sb2coYHF1YWxpdHlPdmVycmlkZShCKSBxdWFsaXR5OiR7cXVhbGl0eU92ZXJyaWRlRm91bmRRdWFsaXR5fSBmcmFtZVJhdGU6JHtxdWFsaXR5T3ZlcnJpZGVGb3VuZEZyYW1lUmF0ZX1gKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL30gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgY29uc29sZS5sb2coYHF1YWxpdHlPdmVycmlkZShDKSBxdWFsaXR5OiR7cXVhbGl0eX0gZnJhbWVSYXRlOiR7ZnJhbWVSYXRlfWApOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBtYXRjaGVkUmVzb2x1dGlvblVybCA/IG1hdGNoZWRSZXNvbHV0aW9uVXJsIDogZW5jb2RpbmdzTGluZXNbaV07CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKCFyZXNvbHV0aW9uSW5mbyB8fCByZXNvbHV0aW9uID09IHJlc29sdXRpb25JbmZvLlJlc29sdXRpb24pICYmCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCFtYXRjaGVkUmVzb2x1dGlvblVybCB8fCAoIW1hdGNoZWRGcmFtZVJhdGUgJiYgZnJhbWVSYXRlID09IHJlc29sdXRpb25JbmZvLkZyYW1lUmF0ZSkpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXRjaGVkUmVzb2x1dGlvblVybCA9IGVuY29kaW5nc0xpbmVzW2ldOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF0Y2hlZEZyYW1lUmF0ZSA9IGZyYW1lUmF0ZSA9PSByZXNvbHV0aW9uSW5mby5GcmFtZVJhdGU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWF0Y2hlZEZyYW1lUmF0ZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBtYXRjaGVkUmVzb2x1dGlvblVybDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBpZiAoZmlyc3RVcmwgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICBmaXJzdFVybCA9IGVuY29kaW5nc0xpbmVzW2ldOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBsYXN0VXJsID0gZW5jb2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gKElzU3F1YWRTdHJlYW0gPT0gdHJ1ZSkgewogICAgICAgICAgICByZXR1cm4gdGV4dFN0cjsKICAgICAgICB9CiAgICAgICAgaWYgKCF0ZXh0U3RyKSB7CiAgICAgICAgICAgIHJldHVybiB0ZXh0U3RyOwogICAgICAgIH0KICAgICAgICAvL1NvbWUgbGl2ZSBzdHJlYW1zIHVzZSBtcDQuCiAgICAgICAgaWYgKCF0ZXh0U3RyLmluY2x1ZGVzKCcudHMnKSAmJiAhdGV4dFN0ci5pbmNsdWRlcygnLm1wNCcpKSB7CiAgICAgICAgICAgIHJldHVybiB0ZXh0U3RyOwogICAgICAgIH0KICAgICAgICB2YXIgaGF2ZUFkVGFncyA9IHRleHRTdHIuaW5jbHVkZXMoQWRTaWduaWZpZXIpOwogICAgICAgIGlmIChoYXZlQWRUYWdzKSB7CiAgICAgICAgICAgIHZhciBpc01pZHJvbGwgPSB0ZXh0U3RyLmluY2x1ZGVzKCciTUlEUk9MTCInKSB8fCB0ZXh0U3RyLmluY2x1ZGVzKCcibWlkcm9sbCInKTsKICAgICAgICAgICAgLy9SZWR1Y2VzIGFkIGZyZXF1ZW5jeS4gVE9ETzogUmVkdWNlIHRoZSBudW1iZXIgb2YgcmVxdWVzdHMuIFRoaXMgaXMgcmVhbGx5IHNwYW1taW5nIFR3aXRjaCB3aXRoIHJlcXVlc3RzLgogICAgICAgICAgICBpZiAoIWlzTWlkcm9sbCkgewogICAgICAgICAgICAgICAgaWYgKHBsYXllclR5cGUgPT09IFBsYXllclR5cGUyKSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIGxpbmVzID0gdGV4dFN0ci5yZXBsYWNlKCdccicsICcnKS5zcGxpdCgnXG4nKTsKICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxpbmVzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5lID0gbGluZXNbaV07CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsaW5lLnN0YXJ0c1dpdGgoJyNFWFRJTkYnKSAmJiBsaW5lcy5sZW5ndGggPiBpICsgMSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFsaW5lLmluY2x1ZGVzKCcsbGl2ZScpICYmICFzdHJlYW1JbmZvLlJlcXVlc3RlZEFkcy5oYXMobGluZXNbaSArIDFdKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE9ubHkgcmVxdWVzdCBvbmUgLnRzIGZpbGUgcGVyIC5tM3U4IHJlcXVlc3QgdG8gYXZvaWQgbWFraW5nIHRvbyBtYW55IHJlcXVlc3RzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9jb25zb2xlLmxvZygnRmV0Y2ggYWQgLnRzIGZpbGUnKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW1JbmZvLlJlcXVlc3RlZEFkcy5hZGQobGluZXNbaSArIDFdKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmZXRjaChsaW5lc1tpICsgMV0pLnRoZW4oKHJlc3BvbnNlKT0+e3Jlc3BvbnNlLmJsb2IoKX0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAvL3RyeU5vdGlmeVR3aXRjaCh0ZXh0U3RyKTsKICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge30KICAgICAgICAgICAgfQogICAgICAgICAgICB2YXIgY3VycmVudFJlc29sdXRpb24gPSBudWxsOwogICAgICAgICAgICBpZiAoc3RyZWFtSW5mbyAmJiBzdHJlYW1JbmZvLlVybHMpIHsKICAgICAgICAgICAgICAgIGZvciAoY29uc3QgW3Jlc1VybCwgcmVzSW5mb10gb2YgT2JqZWN0LmVudHJpZXMoc3RyZWFtSW5mby5VcmxzKSkgewogICAgICAgICAgICAgICAgICAgIGlmIChyZXNVcmwgPT0gdXJsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRSZXNvbHV0aW9uID0gcmVzSW5mbzsKICAgICAgICAgICAgICAgICAgICAgICAgLy9jb25zb2xlLmxvZyhyZXNJbmZvLlJlc29sdXRpb24pOwogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLy8gS2VlcCB0aGUgbTN1OCBhcm91bmQgZm9yIGEgbGl0dGxlIHdoaWxlIChvbmNlIHBlciBhZCkgYmVmb3JlIHJlcXVlc3RpbmcgYSBuZXcgb25lCiAgICAgICAgICAgIHZhciBlbmNvZGluZ3NNM1U4Q2FjaGUgPSBzdHJlYW1JbmZvLkVuY29kaW5nc00zVThDYWNoZVtwbGF5ZXJUeXBlXTsKICAgICAgICAgICAgaWYgKGVuY29kaW5nc00zVThDYWNoZSkgewogICAgICAgICAgICAgICAgaWYgKGVuY29kaW5nc00zVThDYWNoZS5WYWx1ZSAmJiBlbmNvZGluZ3NNM1U4Q2FjaGUuUmVxdWVzdFRpbWUgPj0gRGF0ZS5ub3coKSAtIEVuY29kaW5nQ2FjaGVUaW1lb3V0KSB7CiAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlc3VsdCA9IGdldFN0cmVhbUZvclJlc29sdXRpb24oc3RyZWFtSW5mbywgY3VycmVudFJlc29sdXRpb24sIGVuY29kaW5nc00zVThDYWNoZS5WYWx1ZSwgbnVsbCwgcGxheWVyVHlwZSwgcmVhbEZldGNoKTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikgewogICAgICAgICAgICAgICAgICAgICAgICBlbmNvZGluZ3NNM1U4Q2FjaGUuVmFsdWUgPSBudWxsOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHN0cmVhbUluZm8uRW5jb2RpbmdzTTNVOENhY2hlW3BsYXllclR5cGVdID0gewogICAgICAgICAgICAgICAgICAgIFJlcXVlc3RUaW1lOiBEYXRlLm5vdygpLAogICAgICAgICAgICAgICAgICAgIFZhbHVlOiBudWxsLAogICAgICAgICAgICAgICAgICAgIFJlc29sdXRpb246IG51bGwKICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgIH0KICAgICAgICAgICAgdmFyIGFjY2Vzc1Rva2VuUmVzcG9uc2UgPSBhd2FpdCBnZXRBY2Nlc3NUb2tlbihDdXJyZW50Q2hhbm5lbE5hbWUsIHBsYXllclR5cGUpOwogICAgICAgICAgICBpZiAoYWNjZXNzVG9rZW5SZXNwb25zZS5zdGF0dXMgPT09IDIwMCkgewogICAgICAgICAgICAgICAgdmFyIGFjY2Vzc1Rva2VuID0gYXdhaXQgYWNjZXNzVG9rZW5SZXNwb25zZS5qc29uKCk7CiAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgIHZhciB1cmxJbmZvID0gbmV3IFVSTCgnaHR0cHM6Ly91c2hlci50dHZudy5uZXQvYXBpL2NoYW5uZWwvaGxzLycgKyBDdXJyZW50Q2hhbm5lbE5hbWUgKyAnLm0zdTgnICsgVXNoZXJQYXJhbXMpOwogICAgICAgICAgICAgICAgICAgIHVybEluZm8uc2VhcmNoUGFyYW1zLnNldCgnc2lnJywgYWNjZXNzVG9rZW4uZGF0YS5zdHJlYW1QbGF5YmFja0FjY2Vzc1Rva2VuLnNpZ25hdHVyZSk7CiAgICAgICAgICAgICAgICAgICAgdXJsSW5mby5zZWFyY2hQYXJhbXMuc2V0KCd0b2tlbicsIGFjY2Vzc1Rva2VuLmRhdGEuc3RyZWFtUGxheWJhY2tBY2Nlc3NUb2tlbi52YWx1ZSk7CiAgICAgICAgICAgICAgICAgICAgdmFyIGVuY29kaW5nc00zdThSZXNwb25zZSA9IGF3YWl0IHJlYWxGZXRjaCh1cmxJbmZvLmhyZWYpOwogICAgICAgICAgICAgICAgICAgIGlmIChlbmNvZGluZ3NNM3U4UmVzcG9uc2Uuc3RhdHVzID09PSAyMDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGdldFN0cmVhbUZvclJlc29sdXRpb24oc3RyZWFtSW5mbywgY3VycmVudFJlc29sdXRpb24sIGF3YWl0IGVuY29kaW5nc00zdThSZXNwb25zZS50ZXh0KCksIHRleHRTdHIsIHBsYXllclR5cGUsIHJlYWxGZXRjaCk7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRleHRTdHI7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7fQogICAgICAgICAgICAgICAgcmV0dXJuIHRleHRTdHI7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICByZXR1cm4gdGV4dFN0cjsKICAgICAgICAgICAgfQogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGlmIChXYXNTaG93aW5nQWQpIHsKICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCdGaW5pc2hlZCBibG9ja2luZyBhZHMnKTsKICAgICAgICAgICAgICAgIFdhc1Nob3dpbmdBZCA9IGZhbHNlOwogICAgICAgICAgICAgICAgLy9IZXJlIHdlIHB1dCBwbGF5ZXIgYmFjayB0byBvcmlnaW5hbCBxdWFsaXR5IGFuZCByZW1vdmUgdGhlIGJsb2NraW5nIG1lc3NhZ2UuCiAgICAgICAgICAgICAgICBwb3N0TWVzc2FnZSh7CiAgICAgICAgICAgICAgICAgICAga2V5OiAnRm9yY2VDaGFuZ2VRdWFsaXR5JywKICAgICAgICAgICAgICAgICAgICB2YWx1ZTogJ29yaWdpbmFsJwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBwb3N0TWVzc2FnZSh7CiAgICAgICAgICAgICAgICAgICAga2V5OiAnUGF1c2VSZXN1bWVQbGF5ZXInCiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIHBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgICAgICBrZXk6ICdIaWRlQWRCbG9ja0Jhbm5lcicKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiB0ZXh0U3RyOwogICAgICAgIH0KICAgICAgICByZXR1cm4gdGV4dFN0cjsKICAgIH0KICAgIGZ1bmN0aW9uIHBhcnNlQXR0cmlidXRlcyhzdHIpIHsKICAgICAgICByZXR1cm4gT2JqZWN0LmZyb21FbnRyaWVzKAogICAgICAgICAgICBzdHIuc3BsaXQoLyg/Ol58LCkoKD86W149XSopPSg/OiJbXiJdKiJ8W14sXSopKS8pCiAgICAgICAgICAgIC5maWx0ZXIoQm9vbGVhbikKICAgICAgICAgICAgLm1hcCh4ID0+IHsKICAgICAgICAgICAgICAgIGNvbnN0IGlkeCA9IHguaW5kZXhPZignPScpOwogICAgICAgICAgICAgICAgY29uc3Qga2V5ID0geC5zdWJzdHJpbmcoMCwgaWR4KTsKICAgICAgICAgICAgICAgIGNvbnN0IHZhbHVlID0geC5zdWJzdHJpbmcoaWR4ICsgMSk7CiAgICAgICAgICAgICAgICBjb25zdCBudW0gPSBOdW1iZXIodmFsdWUpOwogICAgICAgICAgICAgICAgcmV0dXJuIFtrZXksIE51bWJlci5pc05hTihudW0pID8gdmFsdWUuc3RhcnRzV2l0aCgnIicpID8gSlNPTi5wYXJzZSh2YWx1ZSkgOiB2YWx1ZSA6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snWC1UVi1UV0lUQ0gtQUQtQ1JFQVRJVkUtSUQnXTsKICAgICAgICAgICAgdmFyIGFkSWQgPSBhdHRyWydYLVRWLVRXSVRDSC1BRC1BRFZFUlRJU0VSLUlEJ107CiAgICAgICAgICAgIHZhciByb2xsVHlwZSA9IGF0dHJbJ1gtVFYtVFdJVENILUFELVJPTEwtVFlQRSddLnRvTG93ZXJDYXNlKCk7CiAgICAgICAgICAgIGNvbnN0IGJhc2VEYXRhID0gewogICAgICAgICAgICAgICAgc3RpdGNoZWQ6IHRydWUsCiAgICAgICAgICAgICAgICByb2xsX3R5cGU6IHJvbGxUeXBlLAogICAgICAgICAgICAgICAgcGxheWVyX211dGU6IHRydWUsCiAgICAgICAgICAgICAgICBwbGF5ZXJfdm9sdW1lOiAwLjAsCiAgICAgICAgICAgICAgICB2aXNpYmxlOiBmYWxzZSwKICAgICAgICAgICAgfTsKICAgICAgICAgICAgZm9yIChsZXQgcG9kUG9zaXRpb24gPSAwOyBwb2RQb3NpdGlvbiA8IHBvZExlbmd0aDsgcG9kUG9zaXRpb24rKykgewogICAgICAgICAgICAgICAgY29uc3QgZXh0ZW5kZWREYXRhID0gewogICAgICAgICAgICAgICAgICAgIC4uLmJhc2VEYXRhLAogICAgICAgICAgICAgICAgICAgIGFkX2lkOiBhZElkLAogICAgICAgICAgICAgICAgICAgIGFkX3Bvc2l0aW9uOiBwb2RQb3NpdGlvbiwKICAgICAgICAgICAgICAgICAgICBkdXJhdGlvbjogMCwKICAgICAgICAgICAgICAgICAgICBjcmVhdGl2ZV9pZDogY3JlYXRpdmVJZCwKICAgICAgICAgICAgICAgICAgICB0b3RhbF9hZHM6IHBvZExlbmd0aCwKICAgICAgICAgICAgICAgICAgICBvcmRlcl9pZDogb3JkZXJJZCwKICAgICAgICAgICAgICAgICAgICBsaW5lX2l0ZW1faWQ6IGxpbmVJdGVtSWQsCiAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgYXdhaXQgZ3FsUmVxdWVzdChhZFJlY29yZGdxbFBhY2tldCgndmlkZW9fYWRfaW1wcmVzc2lvbicsIHJhZFRva2VuLCBleHRlbmRlZERhdGEpKTsKICAgICAgICAgICAgICAgIGZvciAobGV0IHF1YXJ0aWxlID0gMDsgcXVhcnRpbGUgPCA0OyBxdWFydGlsZSsrKSB7CiAgICAgICAgICAgICAgICAgICAgYXdhaXQgZ3FsUmVxdWVzdCgKICAgICAgICAgICAgICAgICAgICAgICAgYWRSZWNvcmRncWxQYWNrZXQoJ3ZpZGVvX2FkX3F1YXJ0aWxlX2NvbXBsZXRlJywgcmFkVG9rZW4sIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC4uLmV4dGVuZGVkRGF0YSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1YXJ0aWxlOiBxdWFydGlsZSArIDEsCiAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGF3YWl0IGdxbFJlcXVlc3QoYWRSZWNvcmRncWxQYWNrZXQoJ3ZpZGVvX2FkX3BvZF9jb21wbGV0ZScsIHJhZFRva2VuLCBiYXNlRGF0YSkpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgZnVuY3Rpb24gYWRSZWNvcmRncWxQYWNrZXQoZXZlbnQsIHJhZFRva2VuLCBwYXlsb2FkKSB7CiAgICAgICAgcmV0dXJuIFt7CiAgICAgICAgICAgIG9wZXJhdGlvbk5hbWU6ICdDbGllbnRTaWRlQWRFdmVudEhhbmRsaW5nX1JlY29yZEFkRXZlbnQnLAogICAgICAgICAgICB2YXJpYWJsZXM6IHsKICAgICAgICAgICAgICAgIGlucHV0OiB7CiAgICAgICAgICAgICAgICAgICAgZXZlbnROYW1lOiBldmVudCwKICAgICAgICAgICAgICAgICAgICBldmVudFBheWxvYWQ6IEpTT04uc3RyaW5naWZ5KHBheWxvYWQpLAogICAgICAgICAgICAgICAgICAgIHJ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ZTogJHBsYXllclR5cGV9KSBAaW5jbHVkZShpZjogJGlzVm9kKSB7ICAgIHZhbHVlICAgIHNpZ25hdHVyZSAgICBfX3R5cGVuYW1lICB9fSc7CiAgICAgICAgYm9keSA9IHsKICAgICAgICAgICAgb3BlcmF0aW9uTmFtZTogJ1BsYXliYWNrQWNjZXNzVG9rZW5fVGVtcGxhdGUnLAogICAgICAgICAgICBxdWVyeTogdGVtcGxhdGVRdWVyeSwKICAgICAgICAgICAgdmFyaWFibGVzOiB7CiAgICAgICAgICAgICAgICAnaXNMaXZlJzogdHJ1ZSwKICAgICAgICAgICAgICAgICdsb2dpbic6IGNoYW5uZWxOYW1lLAogICAgICAgICAgICAgICAgJ2lzVm9kJzogZmFsc2UsCiAgICAgICAgICAgICAgICAndm9kSUQnOiAnJywKICAgICAgICAgICAgICAgICdwbGF5ZXJUeXBlJzogcGxheWVyVHlwZQogICAgICAgICAgICB9CiAgICAgICAgfTsKICAgICAgICByZXR1cm4gZ3FsUmVxdWVzdChib2R5LCByZWFsRmV0Y2gpOwogICAgfQogICAgZnVuY3Rpb24gZ3FsUmVxdWVzdChib2R5LCByZWFsRmV0Y2gpIHsKICAgICAgICBpZiAoQ2xpZW50SW50ZWdyaXR5SGVhZGVyID09IG51bGwpIHsKICAgICAgICAgICAgLy9jb25zb2xlLndhcm4oJ0NsaWVudEludGVncml0eUhlYWRlciBpcyBudWxsJyk7CiAgICAgICAgICAgIC8vdGhyb3cgJ0NsaWVudEludGVncml0eUhlYWRlciBpcyBudWxsJzsKICAgICAgICB9CiAgICAgICAgdmFyIGZldGNoRnVuYyA9IHJlYWxGZXRjaCA/IHJlYWxGZXRjaCA6IGZldGNoOwogICAgICAgIGlmICghR1FMRGV2aWNlSUQpIHsKICAgICAgICAgICAgdmFyIGRjaGFyYWN0ZXJzID0gJ2FiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSc7CiAgICAgICAgICAgIHZhciBkY2hhcmFjdGVyc0xlbmd0aCA9IGRjaGFyYWN0ZXJzLmxlbmd0aDsKICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCAzMjsgaSsrKSB7CiAgICAgICAgICAgICAgICBHUUxEZXZpY2VJRCArPSBkY2hhcmFjdGVycy5jaGFyQXQoTWF0aC5mbG9vcihNYXRoLnJhbmRvbSgpICogZGNoYXJhY3RlcnNMZW5ndGgpKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gZmV0Y2hGdW5jKCdodHRwczovL2dxbC50d2l0Y2gudHYvZ3FsJywgewogICAgICAgICAgICBtZXRob2Q6ICdQT1NUJywKICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoYm9keSksCiAgICAgICAgICAgIGhlYWRlcnM6IHsKICAgICAgICAgICAgICAgICdDbGllbnQtSUQnOiBDbGllbnRJRCwKICAgICAgICAgICAgICAgICdDbGllbnQtSW50ZWdyaXR5JzogQ2xpZW50SW50ZWdyaXR5SGVhZGVyLAogICAgICAgICAgICAgICAgJ0RldmljZS1JRCc6IEdRTERldmljZUlELAogICAgICAgICAgICAgICAgJ1gtRGV2aWNlLUlkJzogR1FMRGV2aWNlSUQsCiAgICAgICAgICAgICAgICAnQ2xpZW50LVZlcnNpb24nOiBDbGllbnRWZXJzaW9uLAogICAgICAgICAgICAgICAgJ0NsaWVudC1TZXNzaW9uLUlkJzogQ2xpZW50U2Vzc2lvbiwKICAgICAgICAgICAgICAgICdBdXRob3JpemF0aW9uJzogQXV0aG9yaXphdGlvbkhlYWRlcgogICAgICAgICAgICB9CiAgICAgICAgfSk7CiAgICB9CiAgICBmdW5jdGlvbiBkb1R3aXRjaFBsYXllclRhc2soaXNQYXVzZVBsYXksIGlzQ2hlY2tRdWFsaXR5LCBpc0NvcnJlY3RCdWZmZXIsIGlzQXV0b1F1YWxpdHksIHNldEF1dG9RdWFsaXR5KSB7CiAgICAgICAgLy9UaGlzIHdpbGwgZG8gYW4gaW5zdGFudCBwYXVzZS9wbGF5IHRvIHJldHVybiB0byBvcmlnaW5hbCBxdWFsaXR5IG9uY2UgdGhlIGFkIGlzIGZpbmlzaGVkLgogICAgICAgIC8vV2UgYWxzbyB1c2UgdGhpcyBmdW5jdGlvbiB0byBnZXQgdGhlIGN1cnJlbnQgdmlkZW8gcGxheWVyIHF1YWxpdHkgc2V0IGJ5IHRoZSB1c2VyLgogICAgICAgIC8vV2UgYWxzbyB1c2UgdGhpcyBmdW5jdGlvbiB0byBxdWlja2x5IHBhdXNlL3BsYXkgdGhlIHBsYXllciB3aGVuIHN3aXRjaGluZyB0YWJzIHRvIHN0b3AgZGVsYXlzLgogICAgICAgIHRyeSB7CiAgICAgICAgICAgIHZhciB2aWRlb0NvbnRyb2xsZXIgPSBudWxsOwogICAgICAgICAgICB2YXIgdmlkZW9QbGF5ZXIgPSBudWxsOwogICAgICAgICAgICBmdW5jdGlvbiBmaW5kUmVhY3ROb2RlKHJvb3QsIGNvbnN0cmFpbnQpIHsKICAgICAgICAgICAgICAgIGlmIChyb290LnN0YXRlTm9kZSAmJiBjb25zdHJhaW50KHJvb3Quc3RhdGVOb2RlKSkgewogICAgICAgICAgICAgICAgICAgIHJldHVybiByb290LnN0YXRlTm9kZTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGxldCBub2RlID0gcm9vdC5jaGlsZDsKICAgICAgICAgICAgICAgIHdoaWxlIChub2RlKSB7CiAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVzdWx0ID0gZmluZFJlYWN0Tm9kZShub2RlLCBjb25zdHJhaW50KTsKICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0KSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIG5vZGUgPSBub2RlLnNpYmxpbmc7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgICAgfQogICAgICAgICAgICBmdW5jdGlvbiBmaW5kUmVhY3RSb290Tm9kZSgpIHsKICAgICAgICAgICAgICAgIHZhciByZWFjdFJvb3ROb2RlID0gbnVsbDsKICAgICAgICAgICAgICAgIHZhciByb290Tm9kZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNyb290Jyk7CiAgICAgICAgICAgICAgICBpZiAocm9vdE5vZGUgJiYgcm9vdE5vZGUuX3JlYWN0Um9vdENvbnRhaW5lciAmJiByb290Tm9kZS5fcmVhY3RSb290Q29udGFpbmVyLl9pbnRlcm5hbFJvb3QgJiYgcm9vdE5vZGUuX3JlYWN0Um9vdENvbnRhaW5lci5faW50ZXJuYWxSb290LmN1cnJlbnQpIHsKICAgICAgICAgICAgICAgICAgICByZWFjdFJvb3ROb2RlID0gcm9vdE5vZGUuX3JlYWN0Um9vdENvbnRhaW5lci5faW50ZXJuYWxSb290LmN1cnJlbnQ7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZiAocmVhY3RSb290Tm9kZSA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRhaW5lck5hbWUgPSBPYmplY3Qua2V5cyhyb290Tm9kZSkuZmluZCh4ID0+IHguc3RhcnRzV2l0aCgnX19yZWFjdENvbnRhaW5lcicpKTsKICAgICAgICAgICAgICAgICAgICBpZiAoY29udGFpbmVyTmFtZSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHJlYWN0Um9vdE5vZGUgPSByb290Tm9kZVtjb250YWluZXJOYW1lXTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICByZXR1cm4gcmVhY3RSb290Tm9kZTsKICAgICAgICAgICAgfQogICAgICAgICAgICB2YXIgcmVhY3RSb290Tm9kZSA9IGZpbmRSZWFjdFJvb3ROb2RlKCk7CiAgICAgICAgICAgIGlmICghcmVhY3RSb290Tm9kZSkgewogICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ0NvdWxkIG5vdCBmaW5kIHJlYWN0IHJvb3QnKTsKICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgfQogICAgICAgICAgICB2aWRlb1BsYXllciA9IGZpbmRSZWFjdE5vZGUocmVhY3RSb290Tm9kZSwgbm9kZSA9PiBub2RlLnNldFBsYXllckFjdGl2ZSAmJiBub2RlLnByb3BzICYmIG5vZGUucHJvcHMubWVkaWFQbGF5ZXJJbnN0YW5jZSk7CiAgICAgICAgICAgIHZpZGVvUGxheWVyID0gdmlkZW9QbGF5ZXIgJiYgdmlkZW9QbGF5ZXIucHJvcHMgJiYgdmlkZW9QbGF5ZXIucHJvcHMubWVkaWFQbGF5ZXJJbnN0YW5jZSA/IHZpZGVvUGxheWVyLnByb3BzLm1lZGlhUGxheWVySW5zdGFuY2UgOiBudWxsOwogICAgICAgICAgICBpZiAoaXNQYXVzZVBsYXkpIHsKICAgICAgICAgICAgICAgIHZpZGVvUGxheWVyLnBhdXNlKCk7CiAgICAgICAgICAgICAgICB2aWRlb1BsYXllci5wbGF5KCk7CiAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGlzQ2hlY2tRdWFsaXR5KSB7CiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHZpZGVvUGxheWVyLmdldFF1YWxpdHkoKSA9PSAndW5kZWZpbmVkJykgewogICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHZhciBwbGF5ZXJRdWFsaXR5ID0gSlNPTi5zdHJpbmdpZnkodmlkZW9QbGF5ZXIuZ2V0UXVhbGl0eSgpKTsKICAgICAgICAgICAgICAgIGlmIChwbGF5ZXJRdWFsaXR5KSB7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBsYXllclF1YWxpdHk7CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoaXNBdXRvUXVhbGl0eSkgewogICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB2aWRlb1BsYXllci5pc0F1dG9RdWFsaXR5TW9kZSgpID09ICd1bmRlZmluZWQnKSB7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgdmFyIGF1dG9RdWFsaXR5ID0gdmlkZW9QbGF5ZXIuaXNBdXRvUXVhbGl0eU1vZGUoKTsKICAgICAgICAgICAgICAgIGlmIChhdXRvUXVhbGl0eSkgewogICAgICAgICAgICAgICAgICAgIHZpZGVvUGxheWVyLnNldEF1dG9RdWFsaXR5TW9kZShmYWxzZSk7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF1dG9RdWFsaXR5OwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKHNldEF1dG9RdWFsaXR5KSB7CiAgICAgICAgICAgICAgICB2aWRlb1BsYXllci5zZXRBdXRvUXVhbGl0eU1vZGUodHJ1ZSk7CiAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLy9UaGlzIG9ubHkgaGFwcGVucyB3aGVuIHN3aXRjaGluZyB0YWJzIGFuZCBpcyB0byBjb3JyZWN0IHRoZSBoaWdoIGxhdGVuY3kgY2F1c2VkIHdoZW4gb3BlbmluZyBiYWNrZ3JvdW5kIHRhYnMgYW5kIGdvaW5nIHRvIHRoZW0gYXQgYSBsYXRlciB0aW1lLgogICAgICAgICAgICAvL1dlIGNoZWNrIHRoYXQgdGhpcyBpcyBhIGxpdmUgc3RyZWFtIGJ5IHRoZSBwYWdlIFVSTCwgdG8gcHJldmVudCB2b2QvY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UGxheWVyLnBhdXNlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlb1BsYXllci5wbGF5KCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodmlkZW9QbGF5ZXIuZ2V0TGl2ZUxhdGVuY3koKSA+IDE1KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlb1BsYXllci5wYXVzZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW9QbGF5ZXIucGxheSgpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfSwgMzAwMCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge30KICAgICAgICB9IGNhdGNoIChlcnIpIHt9CiAgICB9CiAgICB3aW5kb3cucmVsb2FkVHdpdGNoUGxheWVyID0gZG9Ud2l0Y2hQbGF5ZXJUYXNrOwogICAgdmFyIGxvY2FsRGV2aWNlSUQgPSBudWxsOwogICAgbG9jYWxEZXZpY2VJRCA9IHdpbmRvdy5sb2NhbFN0b3JhZ2UuZ2V0SXRlbSgnbG9jYWxfY29weV91bmlxdWVfaWQnKTsKICAgIGZ1bmN0aW9uIHBvc3RUd2l0Y2hXb3JrZXJNZXNzYWdlKGtleSwgdmFsdWUpIHsKICAgICAgICB0d2l0Y2hXb3JrZXJzLmZvckVhY2goKHdvcmtlcikgPT4gewogICAgICAgICAgICB3b3JrZXIucG9zdE1lc3NhZ2Uoe2tleToga2V5LCB2YWx1ZTogdmFsdWV9KTsKICAgICAgICB9KTsKICAgIH0KICAgIGZ1bmN0aW9uIGhvb2tGZXRjaCgpIHsKICAgICAgICB2YXIgcmVhbEZldGNoID0gd2luZG93LmZldGNoOwogICAgICAgIHdpbmRvdy5mZXRjaCA9IGZ1bmN0aW9uKHVybCwgaW5pdCwgLi4uYXJncykgewogICAgICAgICAgICBpZiAodHlwZW9mIHVybCA9PT0gJ3N0cmluZycpIHsKICAgICAgICAgICAgICAgIC8vQ2hlY2sgaWYgc3F1YWQgc3RyZWFtLgogICAgICAgICAgICAgICAgaWYgKHdpbmRvdy5sb2NhdGlvbi5wYXRobmFtZS5pbmNsdWRlcygnL3NxdWFkJykpIHsKICAgICAgICAgICAgICAgICAgICBwb3N0VHdpdGNoV29ya2VyTWVzc2FnZSgnVXBkYXRlSXNTcXVhZFN0cmVhbScsIHRydWUpOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBwb3N0VHdpdGNoV29ya2VyTWVzc2FnZSgnVXBkYXRlSXNTcXVhZFN0cmVhbScsIGZhbHNlKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGlmICh1cmwuaW5jbHVkZXMoJy9hY2Nlc3NfdG9rZW4nKSB8fCB1cmwuaW5jbHVkZXMoJ2dxbCcpKSB7CiAgICAgICAgICAgICAgICAgICAgLy9EZXZpY2UgSUQgaXMgdXNlZCB3aGVuIG5vdGlmeWluZyBUd2l0Y2ggb2YgYWRzLgogICAgICAgICAgICAgICAgICAgIHZhciBkZXZpY2VJZCA9IGluaXQuaGVhZGVyc1snWC1EZXZpY2UtSWQnXTsKICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGRldmljZUlkICE9PSAnc3RyaW5nJykgewogICAgICAgICAgICAgICAgICAgICAgICBkZXZpY2VJZCA9IGluaXQuaGVhZGVyc1snRGV2aWNlLUlEJ107CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC8vQWRkZWQgdG8gcHJldmVudCBldmVudHVhbCBVQmxvY2sgY29uZmxpY3RzLgogICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZGV2aWNlSWQgPT09ICdzdHJpbmcnICYmICFkZXZpY2VJZC5pbmNsdWRlcygndHdpdGNoLXdlYi13YWxsLW1hc29uJykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgR1FMRGV2aWNlSUQgPSBkZXZpY2VJZDsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGxvY2FsRGV2aWNlSUQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgR1FMRGV2aWNlSUQgPSBsb2NhbERldmljZUlELnJlcGxhY2UoJyInLCAnJyk7CiAgICAgICAgICAgICAgICAgICAgICAgIEdRTERldmljZUlEID0gR1FMRGV2aWNlSUQucmVwbGFjZSgnIicsICcnKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgaWYgKEdRTERldmljZUlEKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgaW5pdC5oZWFkZXJzWydYLURldmljZS1JZCddID09PSAnc3RyaW5nJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5pdC5oZWFkZXJzWydYLURldmljZS1JZCddID0gR1FMRGV2aWNlSUQ7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBpbml0LmhlYWRlcnNbJ0RldmljZS1JRCddID09PSAnc3RyaW5nJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5pdC5oZWFkZXJzWydEZXZpY2UtSUQnXSA9IEdRTERldmljZUlEOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIHBvc3RUd2l0Y2hXb3JrZXJNZXNzYWdlKCdVcGRhdGVEZXZpY2VJZCcsIEdRTERldmljZUlEKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLy9DbGllbnQgdmVyc2lvbiBpcyB1c2VkIGluIEdRTCByZXF1ZXN0cy4KICAgICAgICAgICAgICAgICAgICB2YXIgY2xpZW50VmVyc2lvbiA9IGluaXQuaGVhZGVyc1snQ2xpZW50LVZlcnNpb24nXTsKICAgICAgICAgICAgICAgICAgICBpZiAoY2xpZW50VmVyc2lvbiAmJiB0eXBlb2YgY2xpZW50VmVyc2lvbiA9PSAnc3RyaW5nJykgewogICAgICAgICAgICAgICAgICAgICAgICBDbGllbnRWZXJzaW9uID0gY2xpZW50VmVyc2lvbjsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgaWYgKENsaWVudFZlcnNpb24pIHsKICAgICAgICAgICAgICAgICAgICAgICAgcG9zdFR3aXRjaFdvcmtlck1lc3NhZ2UoJ1VwZGF0ZUNsaWVudFZlcnNpb24nLCBDbGllbnRWZXJzaW9uKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLy9DbGllbnQgc2Vzc2lvbiBpcyB1c2VkIGluIEdRTCByZXF1ZXN0cy4KICAgICAgICAgICAgICAgICAgICB2YXIgY2xpZW50U2Vzc2lvbiA9IGluaXQuaGVhZGVyc1snQ2xpZW50LVNlc3Npb24tSWQnXTsKICAgICAgICAgICAgICAgICAgICBpZiAoY2xpZW50U2Vzc2lvbiAmJiB0eXBlb2YgY2xpZW50U2Vzc2lvbiA9PSAnc3RyaW5nJykgewogICAgICAgICAgICAgICAgICAgICAgICBDbGllbnRTZXNzaW9uID0gY2xpZW50U2Vzc2lvbjsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgaWYgKENsaWVudFNlc3Npb24pIHsKICAgICAgICAgICAgICAgICAgICAgICAgcG9zdFR3aXRjaFdvcmtlck1lc3NhZ2UoJ1VwZGF0ZUNsaWVudFNlc3Npb24nLCBDbGllbnRTZXNzaW9uKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLy9DbGllbnQgSUQgaXMgdXNlZCBpbiBHUUwgcmVxdWVzdHMuCiAgICAgICAgICAgICAgICAgICAgaWYgKHVybC5pbmNsdWRlcygnZ3FsJykgJiYgaW5pdCAmJiB0eXBlb2YgaW5pdC5ib2R5ID09PSAnc3RyaW5nJyAmJiBpbml0LmJvZHkuaW5jbHVkZXMoJ1BsYXliYWNrQWNjZXNzVG9rZW4nKSkgewogICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2xpZW50SWQgPSBpbml0LmhlYWRlcnNbJ0NsaWVudC1JRCddOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2xpZW50SWQgJiYgdHlwZW9mIGNsaWVudElkID09ICdzdHJpbmcnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDbGllbnRJRCA9IGNsaWVudElkOwogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xpZW50SWQgPSBpbml0LmhlYWRlcnNbJ0NsaWVudC1JZCddOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNsaWVudElkICYmIHR5cGVvZiBjbGllbnRJZCA9PSAnc3RyaW5nJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENsaWVudElEID0gY2xpZW50SWQ7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKENsaWVudElEKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3N0VHdpdGNoV29ya2VyTWVzc2FnZSgnVXBkYXRlQ2xpZW50SWQnLCBDbGllbnRJRCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLy9DbGllbnQgaW50ZWdyaXR5IGhlYWRlcgogICAgICAgICAgICAgICAgICAgICAgICBDbGllbnRJbnRlZ3JpdHlIZWFkZXIgPSBpbml0LmhlYWRlcnNbJ0NsaWVudC1JbnRlZ3JpdHknXTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKENsaWVudEludGVncml0eUhlYWRlcikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zdFR3aXRjaFdvcmtlck1lc3NhZ2UoJ1VwZGF0ZUNsaWVudEludGVncml0eUhlYWRlcicsIENsaWVudEludGVncml0eUhlYWRlcik7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLy9BdXRob3JpemF0aW9uIGhlYWRlcgogICAgICAgICAgICAgICAgICAgICAgICBBdXRob3JpemF0aW9uSGVhZGVyID0gaW5pdC5oZWFkZXJzWydBdXRob3JpemF0aW9uJ107CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBdXRob3JpemF0aW9uSGVhZGVyKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3N0VHdpdGNoV29ya2VyTWVzc2FnZSgnVXBkYXRlQXV0aG9yaXphdGlvbkhlYWRlcicsIEF1dGhvcml6YXRpb25IZWFkZXIpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC8vVG8gcHJldmVudCBwYXVzZS9yZXN1bWUgbG9vcCBmb3IgbWlkLXJvbGxzLgogICAgICAgICAgICAgICAgICAgIGlmICh1cmwuaW5jbHVkZXMoJ2dxbCcpICYmIGluaXQgJiYgdHlwZW9mIGluaXQuYm9keSA9PT0gJ3N0cmluZycgJiYgaW5pdC5ib2R5LmluY2x1ZGVzKCdQbGF5YmFja0FjY2Vzc1Rva2VuJykgJiYgaW5pdC5ib2R5LmluY2x1ZGVzKCdwaWN0dXJlLWJ5LXBpY3R1cmUnKSkgewogICAgICAgICAgICAgICAgICAgICAgICBpbml0LmJvZHkgPSAnJzsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgdmFyIGlzUEJZUFJlcXVlc3QgPSB1cmwuaW5jbHVkZXMoJ3BpY3R1cmUtYnktcGljdHVyZScpOwogICAgICAgICAgICAgICAgICAgIGlmIChpc1BCWVBSZXF1ZXN0KSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICcnOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gcmVhbEZldGNoLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7CiAgICAgICAgfTsKICAgIH0KICAgIGZ1bmN0aW9uIG9uQ29udGVudExvYWRlZCgpIHsKICAgICAgICAvLyBUaGlzIHN0b3BzIFR3aXRjaCBmcm9tIHBhdXNpbmcgdGhlIHBsYXllciB3aGVuIGluIGFub3RoZXIgdGFiIGFuZCBhbiBhZCBzaG93cy4KICAgICAgICAvLyBUYWtlbiBmcm9tIGh0dHBzOi8vZ2l0aHViLmNvbS9zYXVjZXR0di9WaWRlb0FkQmxvY2tGb3JUd2l0Y2gvYmxvYi9jZWZjZTlkMmI1NjU3NjljNzdlMzY2NmFjODIzNGMzYWNmZTIwZDgzL2Nocm9tZS9jb250ZW50LmpzI0wzMAogICAgICAgIHRyeSB7CiAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShkb2N1bWVudCwgJ3Zpc2liaWxpdHlTdGF0ZScsIHsKICAgICAgICAgICAgICAgIGdldCgpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3Zpc2libGUnOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKICAgICAgICB9Y2F0Y2h7fQogICAgICAgIHRyeSB7CiAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShkb2N1bWVudCwgJ2hpZGRlbicsIHsKICAgICAgICAgICAgICAgIGdldCgpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pOwogICAgICAgIH1jYXRjaHt9CiAgICAgICAgdmFyIGJsb2NrID0gZSA9PiB7CiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTsKICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTsKICAgICAgICAgICAgZS5zdG9wSW1tZWRpYXRlUHJvcGFnYXRpb24oKTsKICAgICAgICB9OwogICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ3Zpc2liaWxpdHljaGFuZ2UnLCBibG9jaywgdHJ1ZSk7CiAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignd2Via2l0dmlzaWJpbGl0eWNoYW5nZScsIGJsb2NrLCB0cnVlKTsKICAgICAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKCdtb3p2aXNpYmlsaXR5Y2hhbmdlJywgYmxvY2ssIHRydWUpOwogICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ2hhc0ZvY3VzJywgYmxvY2ssIHRydWUpOwogICAgICAgIHRyeSB7CiAgICAgICAgICAgIGlmICgvRmlyZWZveC8udGVzdChuYXZpZ2F0b3IudXNlckFnZW50KSkgewogICAgICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KGRvY3VtZW50LCAnbW96SGlkZGVuJywgewogICAgICAgICAgICAgICAgICAgIGdldCgpIHsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KGRvY3VtZW50LCAnd2Via2l0SGlkZGVuJywgewogICAgICAgICAgICAgICAgICAgIGdldCgpIHsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9CiAgICAgICAgfWNhdGNoe30KICAgIH0KICAgIGlmICh3aW5kb3cuV29ya2VyLnRvU3RyaW5nKCkuaW5jbHVkZXMoJ3R3aXRjaCcpKSB7CiAgICAgICAgY29uc29sZS5sb2coJ1R3aXRjaCBXb3JrZXIgaXMgYWxyZWFkeSBob29rZWQnKTsKICAgIH0gZWxzZSB7CiAgICAgICAgd2luZG93LnJlbG9hZFR3aXRjaFBsYXllciA9IHJlbG9hZFR3aXRjaFBsYXllcjsKICAgICAgICBkZWNsYXJlT3B0aW9ucyh3aW5kb3cpOwogICAgICAgIGhvb2tXaW5kb3dXb3JrZXIoKTsKICAgICAgICBob29rRmV0Y2goKTsKICAgICAgICBpZiAoZG9jdW1lbnQucmVhZHlTdGF0ZSA9PT0gImNvbXBsZXRlIiB8fCBkb2N1bWVudC5yZWFkeVN0YXRlID09PSAibG9hZGVkIiB8fCBkb2N1bWVudC5yZWFkeVN0YXRlID09PSAiaW50ZXJhY3RpdmUiKSB7CiAgICAgICAgICAgIG9uQ29udGVudExvYWRlZCgpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCJET01Db250ZW50TG9hZGVkIiwgZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICAgICBvbkNvbnRlbnRMb2FkZWQoKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQp9KSgpOwo="},{"name":"video-swap-new-ublock-origin.js","aliases":[],"kind":{"mime":"application/javascript"},"content":"KGZ1bmN0aW9uKCkgewogICAgaWYgKCAvKF58XC4pdHdpdGNoXC50diQvLnRlc3QoZG9jdW1lbnQubG9jYXRpb24uaG9zdG5hbWUpID09PSBmYWxzZSApIHsgcmV0dXJuOyB9CiAgICBmdW5jdGlvbiBkZWNsYXJlT3B0aW9ucyhzY29wZSkgewogICAgICAgIC8vIE9wdGlvbnMgLyBnbG9iYWxzCiAgICAgICAgc2NvcGUuT1BUX01PREVfU1RSSVBfQURfU0VHTUVOVFMgPSB0cnVlOwogICAgICAgIHNjb3BlLk9QVF9NT0RFX05PVElGWV9BRFNfV0FUQ0hFRCA9IHRydWU7CiAgICAgICAgc2NvcGUuT1BUX01PREVfTk9USUZZX0FEU19XQVRDSEVEX01JTl9SRVFVRVNUUyA9IGZhbHNlOwogICAgICAgIHNjb3BlLk9QVF9CQUNLVVBfUExBWUVSX1RZUEUgPSAnYXV0b3BsYXkn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ZXIgPSBjbGFzcyBXb3JrZXIgZXh0ZW5kcyBvbGRXb3JrZXIgewogICAgICAgICAgICBjb25zdHJ1Y3Rvcih0d2l0Y2hCbG9iVXJsLCBvcHRpb25zKSB7CiAgICAgICAgICAgICAgICB2YXIgaXNUd2l0Y2hXb3JrZXIgPSBmYWxzZTsKICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgaXNUd2l0Y2hXb3JrZXIgPSBuZXcgVVJMKHR3aXRjaEJsb2JVcmwpLm9yaWdpbi5lbmRzV2l0aCgnLnR3aXRjaC50dicpOwogICAgICAgICAgICAgICAgfSBjYXRjaCB7fQogICAgICAgICAgICAgICAgaWYgKCFpc1R3aXRjaFdvcmtlcikgewogICAgICAgICAgICAgICAgICAgIHN1cGVyKHR3aXRjaEJsb2JVcmwsIG9wdGlvbnMpOwogICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHZhciBuZXdCbG9iU3RyID0gYAogICAgICAgICAgICAgICAgICAgICR7cHJvY2Vzc00zVTgudG9TdHJpbmcoKX0KICAgICAgICAgICAgICAgICAgICAke2hvb2tXb3JrZXJGZXRjaC50b1N0cmluZygpfQogICAgICAgICAgICAgICAgICAgICR7ZGVjbGFyZU9wdGlvbnMudG9TdHJpbmcoKX0KICAgICAgICAgICAgICAgICAgICAke2dldEFjY2Vzc1Rva2VuLnRvU3RyaW5nKCl9CiAgICAgICAgICAgICAgICAgICAgJHtncWxSZXF1ZXN0LnRvU3RyaW5nKCl9CiAgICAgICAgICAgICAgICAgICAgJHttYWtlR3JhcGhRbFBhY2tldC50b1N0cmluZygpfQogICAgICAgICAgICAgICAgICAgICR7dHJ5Tm90aWZ5QWRzV2F0Y2hlZE0zVTgudG9TdHJpbmcoKX0KICAgICAgICAgICAgICAgICAgICAke3BhcnNlQXR0cmlidXRlcy50b1N0cmluZygpfQogICAgICAgICAgICAgICAgICAgICR7b25Gb3VuZEFkLnRvU3RyaW5nKCl9CiAgICAgICAgICAgICAgICAgICAgJHtnZXRXYXNtV29ya2VyVXJsLnRvU3RyaW5nKCl9CiAgICAgICAgICAgICAgICAgICAgdmFyIHdvcmtlclVybCA9IGdldFdhc21Xb3JrZXJVcmwoJyR7dHdpdGNoQmxvYlVybC5yZXBsYWNlQWxsKCInIiwgIiUyNyIpfScpOwogICAgICAgICAgICAgICAgICAgIGlmICh3b3JrZXJVcmwgJiYgd29ya2VyVXJsLmluY2x1ZGVzKCdhc3NldHMudHdpdGNoLnR2L2Fzc2V0cy9hbWF6b24taXZzLXdhc213b3JrZXInKSkgewogICAgICAgICAgICAgICAgICAgICAgICBkZWNsYXJlT3B0aW9ucyhzZWxmKTsKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5hZGRFdmVudExpc3RlbmVyKCdtZXNzYWdlJywgZnVuY3Rpb24oZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUuZGF0YS5rZXkgPT0gJ1Vib1VwZGF0ZURldmljZUlkJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdxbF9kZXZpY2VfaWQgPSBlLmRhdGEudmFsdWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGUuZGF0YS5rZXkgPT0gJ1VwZGF0ZUNsaWVudEludGVncml0eUhlYWRlcicpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDbGllbnRJbnRlZ3JpdHlIZWFkZXIgPSBlLmRhdGEudmFsdWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGUuZGF0YS5rZXkgPT0gJ1VwZGF0ZUF1dGhvcml6YXRpb25IZWFkZXInKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXV0aG9yaXphdGlvbkhlYWRlciA9IGUuZGF0YS52YWx1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICAgICAgICAgIGhvb2tXb3JrZXJGZXRjaCgpOwogICAgICAgICAgICAgICAgICAgICAgICBpbXBvcnRTY3JpcHRzKHdvcmtlclVybCk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgYAogICAgICAgICAgICAgICAgc3VwZXIoVVJMLmNyZWF0ZU9iamVjdFVSTChuZXcgQmxvYihbbmV3QmxvYlN0cl0pKSwgb3B0aW9ucyk7CiAgICAgICAgICAgICAgICB0d2l0Y2hXb3JrZXJzLnB1c2godGhpcyk7CiAgICAgICAgICAgICAgICB0aGlzLm9ubWVzc2FnZSA9IGZ1bmN0aW9uKGUpIHsKICAgICAgICAgICAgICAgICAgICAvLyBOT1RFOiBSZW1vdmVkIGFkRGl2IGNhY2hpbmcgYXMgJy52aWRlby1wbGF5ZXInIGNhbiBjaGFuZ2UgYmV0d2VlbiBzdHJlYW1zPwogICAgICAgICAgICAgICAgICAgIGlmIChlLmRhdGEua2V5ID09ICdVYm9TaG93QWRCYW5uZXInKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhZERpdiA9IGdldEFkRGl2KCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhZERpdiAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZERpdi5QLnRleHRDb250ZW50ID0gJ0Jsb2NraW5nJyArIChlLmRhdGEuaXNNaWRyb2xsID8gJyBtaWRyb2xsJyA6ICcnKSArICcgYWRzJzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChPUFRfU0hPV19BRF9CQU5ORVIpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZERpdi5zdHlsZS5kaXNwbGF5ID0gJ2Jsb2NrJzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZS5kYXRhLmtleSA9PSAnVWJvSGlkZUFkQmFubmVyJykgewogICAgICAgICAgICAgICAgICAgICAgICB2YXIgYWREaXYgPSBnZXRBZERpdigpOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWREaXYgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYWREaXYuc3R5bGUuZGlzcGxheSA9ICdub25lJzsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZS5kYXRhLmtleSA9PSAnVWJvQ2hhbm5lbE5hbWVNM1U4Q2hhbmdlZCcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgLy9jb25zb2xlLmxvZygnTTNVOCBjaGFubmVsIG5hbWUgY2hhbmdlZCB0byAnICsgZS5kYXRhLnZhbHVlKTsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGUuZGF0YS5rZXkgPT0gJ1Vib1JlbG9hZFBsYXllcicpIHsKICAgICAgICAgICAgICAgICAgICAgICAgcmVsb2FkVHdpdGNoUGxheWVyKCk7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlLmRhdGEua2V5ID09ICdVYm9QYXVzZVJlc3VtZVBsYXllcicpIHsKICAgICAgICAgICAgICAgICAgICAgICAgcmVsb2FkVHdpdGNoUGxheWVyKGZhbHNlLCB0cnVlKTsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGUuZGF0YS5rZXkgPT0gJ1Vib1NlZWtQbGF5ZXInKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHJlbG9hZFR3aXRjaFBsYXllcih0cnVlKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBmdW5jdGlvbiBnZXRBZERpdigpIHsKICAgICAgICAgICAgICAgICAgICB2YXIgcGxheWVyUm9vdERpdiA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy52aWRlby1wbGF5ZXInKTsKICAgICAgICAgICAgICAgICAgICB2YXIgYWREaXYgPSBudWxsOwogICAgICAgICAgICAgICAgICAgIGlmIChwbGF5ZXJSb290RGl2ICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgYWREaXYgPSBwbGF5ZXJSb290RGl2LnF1ZXJ5U2VsZWN0b3IoJy51Ym8tb3ZlcmxheScpOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWREaXYgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYWREaXYgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkRGl2LmNsYXNzTmFtZSA9ICd1Ym8tb3ZlcmxheSc7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZERpdi5pbm5lckhUTUwgPSAnPGRpdiBjbGFzcz0icGxheWVyLWFkLW5vdGljZSIgc3R5bGU9ImNvbG9yOiB3aGl0ZTsgYmFja2dyb3VuZC1jb2xvcjogcmdiYSgwLCAwLCAwLCAwLjgpOyBwb3NpdGlvbjogYWJzb2x1dGU7IHRvcDogMHB4OyBsZWZ0OiAwcHg7IHBhZGRpbmc6IDVweDsiPjxwPjwvcD48L2Rpdj4nOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYWREaXYuc3R5bGUuZGlzcGxheSA9ICdub25lJzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkRGl2LlAgPSBhZERpdi5xdWVyeVNlbGVjdG9yKCdwJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGF5ZXJSb290RGl2LmFwcGVuZENoaWxkKGFkRGl2KTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gYWREaXY7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CiAgICBmdW5jdGlvbiBnZXRXYXNtV29ya2V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dHJlYW0gdXJsICcgKyB1cmwpOwogICAgICAgICAgICAvL3Bvc3RNZXNzYWdlKHtrZXk6J1Vib0hpZGVBZEJhbm5lcid9KTsKICAgICAgICAgICAgcmV0dXJuIHRleHRTdHI7CiAgICAgICAgfQogICAgICAgIGlmICghT1BUX01PREVfU1RSSVBfQURfU0VHTUVOVFMpIHsKICAgICAgICAgICAgcmV0dXJuIHRleHRTdHI7CiAgICAgICAgfQogICAgICAgIHZhciBoYXZlQWRUYWdzID0gdGV4dFN0ci5pbmNsdWRlcyhBRF9TSUdOSUZJRVIpOwogICAgICAgIGlmIChzdHJlYW1JbmZvLlVzZUJhY2t1cFN0cmVhbSkgewogICAgICAgICAgICBpZiAoc3RyZWFtSW5mby5FbmNvZGluZ3MgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ0ZvdW5kIGJhY2t1cCBzdHJlYW0gYnV0IG5vdCBtYWluIHN0cmVhbT8nKTsKICAgICAgICAgICAgICAgIHN0cmVhbUluZm8uVXNlQmFja3VwU3RyZWFtID0gZmFsc2U7CiAgICAgICAgICAgICAgICBwb3N0TWVzc2FnZSh7a2V5OidVYm9SZWxvYWRQbGF5ZXInfSk7CiAgICAgICAgICAgICAgICByZXR1cm4gJyc7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICB2YXIgc3RyZWFtTTN1OFVybCA9IHN0cmVhbUluZm8uRW5jb2RpbmdzLm1hdGNoKC9eaHR0cHM6LipcLm0zdTgkL20pWzBdOwogICAgICAgICAgICAgICAgdmFyIHN0cmVhbU0zdThSZXNwb25zZSA9IGF3YWl0IHJlYWxGZXRjaChzdHJlYW1NM3U4VXJsKTsKICAgICAgICAgICAgICAgIGlmIChzdHJlYW1NM3U4UmVzcG9uc2Uuc3RhdHVzID09IDIwMCkgewogICAgICAgICAgICAgICAgICAgIHZhciBzdHJlYW1NM3U4ID0gYXdhaXQgc3RyZWFtTTN1OFJlc3BvbnNlLnRleHQoKTsKICAgICAgICAgICAgICAgICAgICBpZiAoc3RyZWFtTTN1OCAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc3RyZWFtTTN1OC5pbmNsdWRlcyhBRF9TSUdOSUZJRVIpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygnTm8gbW9yZSBhZHMgb24gbWFpbiBzdHJlYW0uIFRyaWdnZXJpbmcgcGxheWVyIHJlbG9hZCB0byBnbyBiYWNrIHRvIG1haW4gc3RyZWFtLi4uJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW1JbmZvLlVzZUJhY2t1cFN0cmVhbSA9IGZhbHNlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zdE1lc3NhZ2Uoe2tleTonVWJvSGlkZUFkQmFubmVyJ30pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zdE1lc3NhZ2Uoe2tleTonVWJvUmVsb2FkUGxheWVyJ30pOwogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFzdHJlYW1NM3U4LmluY2x1ZGVzKCciTUlEUk9MTCInKSAmJiAhc3RyZWFtTTN1OC5pbmNsdWRlcygnIm1pZHJvbGwiJykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5lcyA9IHN0cmVhbU0zdTgucmVwbGFjZSgnXHInLCAnJykuc3BsaXQoJ1xuJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxpbmVzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpbmUgPSBsaW5lc1tpXTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobGluZS5zdGFydHNXaXRoKCcjRVhUSU5GJykgJiYgbGluZXMubGVuZ3RoID4gaSArIDEpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFsaW5lLmluY2x1ZGVzKExJVkVfU0lHTklGSUVSKSAmJiAhc3RyZWFtSW5mby5SZXF1ZXN0ZWRBZHMuaGFzKGxpbmVzW2kgKyAxXSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE9ubHkgcmVxdWVzdCBvbmUgLnRzIGZpbGUgcGVyIC5tM3U4IHJlcXVlc3QgdG8gYXZvaWQgbWFraW5nIHRvbyBtYW55IHJlcXVlc3RzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2NvbnNvbGUubG9nKCdGZXRjaCBhZCAudHMgZmlsZScpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtSW5mby5SZXF1ZXN0ZWRBZHMuYWRkKGxpbmVzW2kgKyAxXSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmZXRjaChsaW5lc1tpICsgMV0pLnRoZW4oKHJlc3BvbnNlKT0+e3Jlc3BvbnNlLmJsb2IoKX0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9IGVsc2UgaWYgKGhhdmVBZFRhZ3MpIHsKICAgICAgICAgICAgb25Gb3VuZEFkKHN0cmVhbUluZm8sIHRleHRTdHIsIHRydWUpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHBvc3RNZXNzYWdlKHtrZXk6J1Vib0hpZGVBZEJhbm5lcid9KTsKICAgICAgICB9CiAgICAgICAgaWYgKGhhdmVBZFRhZ3MgJiYgc3RyZWFtSW5mby5CYWNrdXBFbmNvZGluZ3MgIT0gbnVsbCkgewogICAgICAgICAgICB2YXIgc3RyZWFtTTN1OFVybCA9IHN0cmVhbUluZm8uQmFja3VwRW5jb2RpbmdzLm1hdGNoKC9eaHR0cHM6LipcLm0zdTguKiQvbSlbMF07CiAgICAgICAgICAgIHZhciBzdHJlYW1NM3U4UmVzcG9uc2UgPSBhd2FpdCByZWFsRmV0Y2goc3RyZWFtTTN1OFVybCk7CiAgICAgICAgICAgIGlmIChzdHJlYW1NM3U4UmVzcG9uc2Uuc3RhdHVzID09IDIwMCkgewogICAgICAgICAgICAgICAgdGV4dFN0ciA9IGF3YWl0IHN0cmVhbU0zdThSZXNwb25zZS50ZXh0KCk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIHRleHRTdHI7CiAgICB9CiAgICBmdW5jdGlvbiBob29rV29ya2VyRmV0Y2goKSB7CiAgICAgICAgY29uc29sZS5sb2coJ2hvb2tXb3JrZXJGZXRjaCcpOwogICAgICAgIHZhciByZWFsRmV0Y2ggPSBmZXRjaDsKICAgICAgICBmZXRjaCA9IGFzeW5jIGZ1bmN0aW9uKHVybCwgb3B0aW9ucykgewogICAgICAgICAgICBpZiAodHlwZW9mIHVybCA9PT0gJ3N0cmluZycpIHsKICAgICAgICAgICAgICAgIHVybCA9IHVybC50cmltRW5kKCk7CiAgICAgICAgICAgICAgICBpZiAodXJsLmVuZHNXaXRoKCdtM3U4JykpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwcm9jZXNzQWZ0ZXIgPSBhc3luYyBmdW5jdGlvbihyZXNwb25zZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN0ciA9IGF3YWl0IHByb2Nlc3NNM1U4KHVybCwgYXdhaXQgcmVzcG9uc2UudGV4dCgpLCByZWFsRmV0Y2gpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShuZXcgUmVzcG9uc2Uoc3RyLCB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzOiByZXNwb25zZS5zdGF0dXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzVGV4dDogcmVzcG9uc2Uuc3RhdHVzVGV4dCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiByZXNwb25zZS5oZWFkZXJzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSk7CiAgICAgICAgICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZW5kID0gZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVhbEZldGNoKHVybCwgb3B0aW9ucykudGhlbihmdW5jdGlvbihyZXNwb25zZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb2Nlc3NBZnRlcihyZXNwb25zZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVsnY2F0Y2gnXShmdW5jdGlvbihlcnIpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygnZmV0Y2ggaG9vayBlcnIgJyArIGVycik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KGVycik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICAgICAgc2VuZCgpOwogICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZWxzZSBpZiAodXJsLmluY2x1ZGVzKCcvYXBpL2NoYW5uZWwvaGxzLycpICYmICF1cmwuaW5jbHVkZXMoJ3BpY3R1cmUtYnktcGljdHVyZScpKSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIGNoYW5uZWxOYW1lID0gKG5ldyBVUkwodXJsKSkucGF0aG5hbWUubWF0Y2goLyhbXlwvXSspKD89XC5cdyskKS8pWzBdOwogICAgICAgICAgICAgICAgICAgIGlmIChDdXJyZW50Q2hhbm5lbE5hbWVGcm9tTTNVOCAhPSBjaGFubmVsTmFtZSkgewogICAgICAgICAgICAgICAgICAgICAgICBwb3N0TWVzc2FnZSh7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6ICdVYm9DaGFubmVsTmFtZU0zVThDaGFuZ2VkJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBjaGFubmVsTmFtZQogICAgICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgQ3VycmVudENoYW5uZWxOYW1lRnJvbU0zVTggPSBjaGFubmVsTmFtZTsKICAgICAgICAgICAgICAgICAgICBpZiAoT1BUX01PREVfU1RSSVBfQURfU0VHTUVOVFMpIHsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKGFzeW5jIGZ1bmN0aW9uKHJlc29sdmUsIHJlamVjdCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gLSBGaXJzdCBtM3U4IHJlcXVlc3QgaXMgdGhlIG0zdTggd2l0aCB0aGUgdmlkZW8gZW5jb2RpbmdzICgzNjBwLDQ4MHAsNzIwcCxldGMpLgogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gLSBTZWNvbmQgbTN1OCByZXF1ZXN0IGlzIHRoZSBtM3U4IGZvciB0aGUgZ2l2ZW4gZW5jb2Rpbmcgb2J0YWluZWQgaW4gdGhlIGZpcnN0IHJlcXVlc3QuIEF0IHRoaXMgcG9pbnQgd2Ugd2lsbCBrbm93IGlmIHRoZXJlJ3MgYWRzLgogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN0cmVhbUluZm8gPSBTdHJlYW1JbmZvc1tjaGFubmVsTmFtZV07CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RyZWFtSW5mbyAhPSBudWxsICYmIHN0cmVhbUluZm8uRW5jb2RpbmdzICE9IG51bGwgJiYgKGF3YWl0IHJlYWxGZXRjaChzdHJlYW1JbmZvLkVuY29kaW5ncy5tYXRjaCgvXmh0dHBzOi4qXC5tM3U4JC9tKVswXSkpLnN0YXR1cyAhPT0gMjAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhlIGNhY2hlZCBlbmNvZGluZ3MgYXJlIGRlYWQgKHRoZSBzdHJlYW0gcHJvYmFibHkgcmVzdGFydGVkKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbUluZm8gPSBudWxsOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0cmVhbUluZm8gPT0gbnVsbCB8fCBzdHJlYW1JbmZvLkVuY29kaW5ncyA9PSBudWxsIHx8IHN0cmVhbUluZm8uQmFja3VwRW5jb2RpbmdzID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJlYW1JbmZvc1tjaGFubmVsTmFtZV0gPSBzdHJlYW1JbmZvID0gewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXF1ZXN0ZWRBZHM6IG5ldyBTZXQoKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRW5jb2RpbmdzOiBudWxsLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYWNrdXBFbmNvZGluZ3M6IG51bGwsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElzTWlkcm9sbDogZmFsc2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVzZUJhY2t1cFN0cmVhbTogZmFsc2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENoYW5uZWxOYW1lOiBjaGFubmVsTmFtZQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCAyOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVuY29kaW5nc1VybCA9IHVybDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gMSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGFjY2Vzc1Rva2VuUmVzcG9uc2UgPSBhd2FpdCBnZXRBY2Nlc3NUb2tlbihjaGFubmVsTmFtZSwgT1BUX0JBQ0tVUF9QTEFZRVJfVFlQRSwgT1BUX0JBQ0tVUF9QTEFURk9STSwgcmVhbEZldGNoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhY2Nlc3NUb2tlblJlc3BvbnNlICE9IG51bGwgJiYgYWNjZXNzVG9rZW5SZXNwb25zZS5zdGF0dXMgPT09IDIwMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhY2Nlc3NUb2tlbiA9IGF3YWl0IGFjY2Vzc1Rva2VuUmVzcG9uc2UuanNvbigpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB1cmxJbmZvID0gbmV3IFVSTCgnaHR0cHM6Ly91c2hlci50dHZudy5uZXQvYXBpL2NoYW5uZWwvaGxzLycgKyBjaGFubmVsTmFtZSArICcubTN1OCcgKyAobmV3IFVSTCh1cmwpKS5zZWFyY2gpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybEluZm8uc2VhcmNoUGFyYW1zLnNldCgnc2lnJywgYWNjZXNzVG9rZW4uZGF0YS5zdHJlYW1QbGF5YmFja0FjY2Vzc1Rva2VuLnNpZ25hdHVyZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsSW5mby5zZWFyY2hQYXJhbXMuc2V0KCd0b2tlbicsIGFjY2Vzc1Rva2VuLmRhdGEuc3RyZWFtUGxheWJhY2tBY2Nlc3NUb2tlbi52YWx1ZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5jb2RpbmdzVXJsID0gdXJsSW5mby5ocmVmOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKGFjY2Vzc1Rva2VuUmVzcG9uc2UpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZW5jb2RpbmdzTTN1OFJlc3BvbnNlID0gYXdhaXQgcmVhbEZldGNoKGVuY29kaW5nc1VybCwgb3B0aW9ucyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbmNvZGluZ3NNM3U4UmVzcG9uc2UgIT0gbnVsbCAmJiBlbmNvZGluZ3NNM3U4UmVzcG9uc2Uuc3RhdHVzID09PSAyMDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbmNvZGluZ3NNM3U4ID0gYXdhaXQgZW5jb2RpbmdzTTN1OFJlc3BvbnNlLnRleHQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID09IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW1JbmZvLkVuY29kaW5ncyA9IGVuY29kaW5nc00zdTg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN0cmVhbU0zdThVcmwgPSBlbmNvZGluZ3NNM3U4Lm1hdGNoKC9eaHR0cHM6LipcLm0zdTgkL20pWzBdOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzdHJlYW1NM3U4UmVzcG9uc2UgPSBhd2FpdCByZWFsRmV0Y2goc3RyZWFtTTN1OFVybCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0cmVhbU0zdThSZXNwb25zZS5zdGF0dXMgPT0gMjAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzdHJlYW1NM3U4ID0gYXdhaXQgc3RyZWFtTTN1OFJlc3BvbnNlLnRleHQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0cmVhbU0zdTguaW5jbHVkZXMoQURfU0lHTklGSUVSKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25Gb3VuZEFkKHN0cmVhbUluZm8sIHN0cmVhbU0zdTgsIGZhbHNlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoc3RyZWFtTTN1OFJlc3BvbnNlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxvd1Jlc0xpbmVzID0gZW5jb2RpbmdzTTN1OC5yZXBsYWNlKCdccicsICcnKS5zcGxpdCgnXG4nKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbG93UmVzQmVzdFVybCA9IG51bGw7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBsb3dSZXNMaW5lcy5sZW5ndGg7IGorKykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobG93UmVzTGluZXNbal0uc3RhcnRzV2l0aCgnI0VYVC1YLVNUUkVBTS1JTkYnKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IHBhcnNlQXR0cmlidXRlcyhsb3dSZXNMaW5lc1tqXSlbJ1JFU09MVVRJT04nXTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXMgJiYgbG93UmVzTGluZXNbaiArIDFdLmVuZHNXaXRoKCcubTN1OCcpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQXNzdW1lcyByZXNvbHV0aW9ucyBhcmUgY29ycmVjdGx5IG9yZGVyZWQKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb3dSZXNCZXN0VXJsID0gbG93UmVzTGluZXNbaiArIDFdOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsb3dSZXNCZXN0VXJsICE9IG51bGwgJiYgc3RyZWFtSW5mby5FbmNvZGluZ3MgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbm9ybWFsRW5jb2RpbmdzTTN1OCA9IHN0cmVhbUluZm8uRW5jb2RpbmdzOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbm9ybWFsTGluZXMgPSBub3JtYWxFbmNvZGluZ3NNM3U4LnJlcGxhY2UoJ1xyJywgJycpLnNwbGl0KCdcbicpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IG5vcm1hbExpbmVzLmxlbmd0aCAtIDE7IGorKykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5vcm1hbExpbmVzW2pdLnN0YXJ0c1dpdGgoJyNFWFQtWC1TVFJFQU0tSU5GJykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0gcGFyc2VBdHRyaWJ1dGVzKG5vcm1hbExpbmVzW2pdKVsnUkVTT0xVVElPTiddOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXMpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG93UmVzQmVzdFVybCArPSAnICc7Ly8gVGhlIHN0cmVhbSBkb2Vzbid0IGxvYWQgdW5sZXNzIGVhY2ggdXJsIGxpbmUgaXMgdW5pcXVlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vcm1hbExpbmVzW2ogKyAxXSA9IGxvd1Jlc0Jlc3RVcmw7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuY29kaW5nc00zdTggPSBub3JtYWxMaW5lcy5qb2luKCdcclxuJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbUluZm8uQmFja3VwRW5jb2RpbmdzID0gZW5jb2RpbmdzTTN1ODsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5lcyA9IGVuY29kaW5nc00zdTgucmVwbGFjZSgnXHInLCAnJykuc3BsaXQoJ1xuJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IGxpbmVzLmxlbmd0aDsgaisrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFsaW5lc1tqXS5zdGFydHNXaXRoKCcjJykgJiYgbGluZXNbal0uaW5jbHVkZXMoJy5tM3U4JykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyZWFtSW5mb3NCeVVybFtsaW5lc1tqXS50cmltRW5kKCldID0gc3RyZWFtSW5mbzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKGVuY29kaW5nc00zdThSZXNwb25zZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RyZWFtSW5mby5Vc2VCYWNrdXBTdHJlYW0pIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKG5ldyBSZXNwb25zZShzdHJlYW1JbmZvLkJhY2t1cEVuY29kaW5ncykpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKG5ldyBSZXNwb25zZShzdHJlYW1JbmZvLkVuY29kaW5ncykpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHJlYWxGZXRjaC5hcHBseSh0aGlzLCBhcmd1bWVudHMpOwogICAgICAgIH0KICAgIH0KICAgIGZ1bmN0aW9uIG1ha2VHcmFwaFFsUGFja2V0KGV2ZW50LCByYWRUb2tlbiwgcGF5bG9hZCkgewogICAgICAgIHJldHVybiBbewogICAgICAgICAgICBvcGVyYXRpb25OYW1lOiAnQ2xpZW50U2lkZUFkRXZlbnRIYW5kbGluZ19SZWNvcmRBZEV2ZW50JywKICAgICAgICAgICAgdmFyaWFibGVzOiB7CiAgICAgICAgICAgICAgICBpbnB1dDogewogICAgICAgICAgICAgICAgICAgIGV2ZW50TmFtZTogZXZlbnQsCiAgICAgICAgICAgICAgICAgICAgZXZlbnRQYXlsb2FkOiBKU09OLnN0cmluZ2lmeShwYXlsb2FkKSwKICAgICAgICAgICAgICAgICAgICByYWRUb2tlbiwKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGV4dGVuc2lvbnM6IHsKICAgICAgICAgICAgICAgIHBlcnNpc3RlZFF1ZXJ5OiB7CiAgICAgICAgICAgICAgICAgICAgdmVyc2lvbjogMSwKICAgICAgICAgICAgICAgICAgICBzaGEyNTZIYXNoOiAnN2U2YzY5ZTZlYjU5ZjhjY2I5N2FiNzM2ODZmM2Q4YjdkODVhNzJhMDI5ODc0NWNjZDhiZmM2OGU0MDU0Y2E1YicsCiAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICB9LAogICAgICAgIH1dOwogICAgfQogICAgZnVuY3Rpb24gZ2V0QWNjZXNzVG9rZW4oY2hhbm5lbE5hbWUsIHBsYXllclR5cGUsIHBsYXRmb3JtLCByZWFsRmV0Y2gpIHsKICAgICAgICBpZiAoIXBsYXRmb3JtKSB7CiAgICAgICAgICAgIHBsYXRmb3JtID0gJ3dlYic7CiAgICAgICAgfQogICAgICAgIHZhciBib2R5ID0gbnVsbDsKICAgICAgICB2YXIgdGVtcGxhdGVRdWVyeSA9ICdxdWVyeSBQbGF5YmFja0FjY2Vzc1Rva2VuX1RlbXBsYXRlKCRsb2dpbjogU3RyaW5nISwgJGlzTGl2ZTogQm9vbGVhbiEsICR2b2RJRDogSUQhLCAkaXNWb2Q6IEJvb2xlYW4hLCAkcGxheWVyVHlwZTogU3RyaW5nISkgeyAgc3RyZWFtUGxheWJhY2tBY2Nlc3NUb2tlbihjaGFubmVsTmFtZTogJGxvZ2luLCBwYXJhbXM6IHtwbGF0Zm9ybTogIicgKyBwbGF0Zm9ybSArICciLCBwbGF5ZXJCYWNrZW5kOiAibWVkaWFwbGF5ZXIiLCBwbGF5ZXJUeXBlOiAkcGxheWVyVHlwZX0pIEBpbmNsdWRlKGlmOiAkaXNMaXZlKSB7ICAgIHZhbHVlICAgIHNpZ25hdHVyZSAgICBfX3R5cGVuYW1lICB9ICB2aWRlb1BsYXliYWNrQWNjZXNzVG9rZW4oaWQ6ICR2b2RJRCwgcGFyYW1zOiB7cGxhdGZvcm06ICInICsgcGxhdGZvcm0gKyAnIiwgcGxheWVyQmFja2VuZDogIm1lZGlhcGxheWVyIiwgcGxheWVyVHlwZTogJHBsYXllclR5cGV9KSBAaW5jbHVkZShpZjogJGlzVm9kKSB7ICAgIHZhbHVlICAgIHNpZ25hdHVyZSAgICBfX3R5cGVuYW1lICB9fSc7CiAgICAgICAgYm9keSA9IHsKICAgICAgICAgICAgb3BlcmF0aW9uTmFtZTogJ1BsYXliYWNrQWNjZXNzVG9rZW5fVGVtcGxhdGUnLAogICAgICAgICAgICBxdWVyeTogdGVtcGxhdGVRdWVyeSwKICAgICAgICAgICAgdmFyaWFibGVzOiB7CiAgICAgICAgICAgICAgICAnaXNMaXZlJzogdHJ1ZSwKICAgICAgICAgICAgICAgICdsb2dpbic6IGNoYW5uZWxOYW1lLAogICAgICAgICAgICAgICAgJ2lzVm9kJzogZmFsc2UsCiAgICAgICAgICAgICAgICAndm9kSUQnOiAnJywKICAgICAgICAgICAgICAgICdwbGF5ZXJUeXBlJzogcGxheWVyVHlwZQogICAgICAgICAgICB9CiAgICAgICAgfTsKICAgICAgICByZXR1cm4gZ3FsUmVxdWVzdChib2R5LCByZWFsRmV0Y2gpOwogICAgfQogICAgZnVuY3Rpb24gZ3FsUmVxdWVzdChib2R5LCByZWFsRmV0Y2gpIHsKICAgICAgICBpZiAoQ2xpZW50SW50ZWdyaXR5SGVhZGVyID09IG51bGwpIHsKICAgICAgICAgICAgLy9jb25zb2xlLndhcm4oJ0NsaWVudEludGVncml0eUhlYWRlciBpcyBudWxsJyk7CiAgICAgICAgICAgIC8vdGhyb3cgJ0NsaWVudEludGVncml0eUhlYWRlciBpcyBudWxsJzsKICAgICAgICB9CiAgICAgICAgdmFyIGZldGNoRnVuYyA9IHJlYWxGZXRjaCA/IHJlYWxGZXRjaCA6IGZldGNoOwogICAgICAgIHJldHVybiBmZXRjaEZ1bmMoJ2h0dHBzOi8vZ3FsLnR3aXRjaC50di9ncWwnLCB7CiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnLAogICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeShib2R5KSwKICAgICAgICAgICAgaGVhZGVyczogewogICAgICAgICAgICAgICAgJ0NsaWVudC1JZCc6IENMSUVOVF9JRCwKICAgICAgICAgICAgICAgICdDbGllbnQtSW50ZWdyaXR5JzogQ2xpZW50SW50ZWdyaXR5SGVhZGVyLAogICAgICAgICAgICAgICAgJ1gtRGV2aWNlLUlkJzogZ3FsX2RldmljZV9pZCwKICAgICAgICAgICAgICAgICdBdXRob3JpemF0aW9uJzogQXV0aG9yaXphdGlvbkhlYWRlcgogICAgICAgICAgICB9CiAgICAgICAgfSk7CiAgICB9CiAgICBmdW5jdGlvbiBwYXJzZUF0dHJpYnV0ZXMoc3RyKSB7CiAgICAgICAgcmV0dXJuIE9iamVjdC5mcm9tRW50cmllcygKICAgICAgICAgICAgc3RyLnNwbGl0KC8oPzpefCwpKCg/OltePV0qKT0oPzoiW14iXSoifFteLF0qKSkvKQogICAgICAgICAgICAgICAgLmZpbHRlcihCb29sZWFuKQogICAgICAgICAgICAgICAgLm1hcCh4ID0+IHsKICAgICAgICAgICAgICAgICAgICBjb25zdCBpZHggPSB4LmluZGV4T2YoJz0nKTsKICAgICAgICAgICAgICAgICAgICBjb25zdCBrZXkgPSB4LnN1YnN0cmluZygwLCBpZHgpOwogICAgICAgICAgICAgICAgICAgIGNvbnN0IHZhbHVlID0geC5zdWJzdHJpbmcoaWR4ICsxKTsKICAgICAgICAgICAgICAgICAgICBjb25zdCBudW0gPSBOdW1iZXIodmFsdWUpOwogICAgICAgICAgICAgICAgICAgIHJldHVybiBba2V5LCBOdW1iZXIuaXNOYU4obnVtKSA/IHZhbHVlLnN0YXJ0c1dpdGgoJyInKSA/IEpTT04ucGFyc2UodmFsdWUpIDogdmFsdWUgOiBudW1dCiAgICAgICAgICAgICAgICB9KSk7CiAgICB9CiAgICBhc3luYyBmdW5jdGlvbiB0cnlOb3RpZnlBZHNXYXRjaGVkTTNVOChzdHJlYW1NM3U4KSB7CiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgLy9jb25zb2xlLmxvZyhzdHJlYW1NM3U4KTsKICAgICAgICAgICAgaWYgKCFzdHJlYW1NM3U4IHx8ICFzdHJlYW1NM3U4LmluY2x1ZGVzKEFEX1NJR05JRklFUikpIHsKICAgICAgICAgICAgICAgIHJldHVybiAxOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHZhciBtYXRjaGVzID0gc3RyZWFtTTN1OC5tYXRjaCgvI0VYVC1YLURBVEVSQU5HRTooSUQ9InN0aXRjaGVkLWFkLVteXG5dKylcbi8pOwogICAgICAgICAgICBpZiAobWF0Y2hlcy5sZW5ndGggPiAxKSB7CiAgICAgICAgICAgICAgICBjb25zdCBhdHRyU3RyaW5nID0gbWF0Y2hlc1sxXTsKICAgICAgICAgICAgICAgIGNvbnN0IGF0dHIgPSBwYXJzZUF0dHJpYnV0ZXMoYXR0clN0cmluZyk7CiAgICAgICAgICAgICAgICB2YXIgcG9kTGVuZ3RoID0gcGFyc2VJbnQoYXR0clsnWC1UVi1UV0lUQ0gtQUQtUE9ELUxFTkdUSCddID8gYXR0clsnWC1UVi1UV0lUQ0gtQUQtUE9ELUxFTkdUSCddIDogJzEnKTsKICAgICAgICAgICAgICAgIHZhciBwb2RQb3NpdGlvbiA9IHBhcnNlSW50KGF0dHJbJ1gtVFYtVFdJVENILUFELVBPRC1QT1NJVElPTiddID8gYXR0clsnWC1UVi1UV0lUQ0gtQUQtUE9ELVBPU0lUSU9OJ10gOiAnMCcpOwogICAgICAgICAgICAgICAgdmFyIHJhZFRva2VuID0gYXR0clsnWC1UVi1UV0lUQ0gtQUQtUkFEUy1UT0tFTiddOwogICAgICAgICAgICAgICAgdmFyIGxpbmVJdGVtSWQgPSBhdHRyWydYLVRWLVRXSVRDSC1BRC1MSU5FLUlURU0tSUQnXTsKICAgICAgICAgICAgICAgIHZhciBvcmRlcklkID0gYXR0clsnWC1UVi1UV0lUQ0gtQUQtT1JERVItSUQnXTsKICAgICAgICAgICAgICAgIHZhciBjcmVhdGl2ZUlkID0gYXR0clsnWC1UVi1UV0lUQ0gtQUQtQ1JFQVRJVkUtSUQnXTsKICAgICAgICAgICAgICAgIHZhciBhZElkID0gYXR0clsnWC1UVi1UV0lUQ0gtQUQtQURWRVJUSVNFUi1JRCddOwogICAgICAgICAgICAgICAgdmFyIHJvbGxUeXBlID0gYXR0clsnWC1UVi1UV0lUQ0gtQUQtUk9MTC1UWVBFJ10udG9Mb3dlckNhc2UoKTsKICAgICAgICAgICAgICAgIGNvbnN0IGJhc2VEYXRhID0gewogICAgICAgICAgICAgICAgICAgIHN0aXRjaGVkOiB0cnVlLAogICAgICAgICAgICAgICAgICAgIHJvbGxfdHlwZTogcm9sbFR5cGUsCiAgICAgICAgICAgICAgICAgICAgcGxheWVyX211dGU6IGZhbHNlLAogICAgICAgICAgICAgICAgICAgIHBsYXllcl92b2x1bWU6IDAuNSwKICAgICAgICAgICAgICAgICAgICB2aXNpYmxlOiB0cnVlLAogICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgIGZvciAobGV0IHBvZFBvc2l0aW9uID0gMDsgcG9kUG9zaXRpb24gPCBwb2RMZW5ndGg7IHBvZFBvc2l0aW9uKyspIHsKICAgICAgICAgICAgICAgICAgICBpZiAoT1BUX01PREVfTk9USUZZX0FEU19XQVRDSEVEX01JTl9SRVFVRVNUUykgewogICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIGlzIGFsbCB0aGF0J3MgYWN0dWFsbHkgcmVxdWlyZWQgYXQgdGhlIG1vbWVudAogICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBncWxSZXF1ZXN0KG1ha2VHcmFwaFFsUGFja2V0KCd2aWRlb19hZF9wb2RfY29tcGxldGUnLCByYWRUb2tlbiwgYmFzZURhdGEpKTsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBleHRlbmRlZERhdGEgPSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuLi5iYXNlRGF0YSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkX2lkOiBhZElkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRfcG9zaXRpb246IHBvZFBvc2l0aW9uLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgZHVyYXRpb246IDMwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgY3JlYXRpdmVfaWQ6IGNyZWF0aXZlSWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3RhbF9hZHM6IHBvZExlbmd0aCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9yZGVyX2lkOiBvcmRlcklkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZV9pdGVtX2lkOiBsaW5lSXRlbUlkLAogICAgICAgICAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBncWxSZXF1ZXN0KG1ha2VHcmFwaFFsUGFja2V0KCd2aWRlb19hZF9pbXByZXNzaW9uJywgcmFkVG9rZW4sIGV4dGVuZGVkRGF0YSkpOwogICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBxdWFydGlsZSA9IDA7IHF1YXJ0aWxlIDwgNDsgcXVhcnRpbGUrKykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYXdhaXQgZ3FsUmVxdWVzdCgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtlR3JhcGhRbFBhY2tldCgndmlkZW9fYWRfcXVhcnRpbGVfY29tcGxldGUnLCByYWRUb2tlbiwgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuLi5leHRlbmRlZERhdGEsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1YXJ0aWxlOiBxdWFydGlsZSArIDEsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgYXdhaXQgZ3FsUmVxdWVzdChtYWtlR3JhcGhRbFBhY2tldCgndmlkZW9fYWRfcG9kX2NvbXBsZXRlJywgcmFkVG9rZW4sIGJhc2VEYXRhKSk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiAwOwogICAgICAgIH0gY2F0Y2ggKGVycikgewogICAgICAgICAgICBjb25zb2xlLmxvZyhlcnIpOwogICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICB9CiAgICB9CiAgICBmdW5jdGlvbiBwb3N0VHdpdGNoV29ya2VyTWVzc2FnZShrZXksIHZhbHVlKSB7CiAgICAgICAgdHdpdGNoV29ya2Vycy5mb3JFYWNoKCh3b3JrZXIpID0+IHsKICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHtrZXk6IGtleSwgdmFsdWU6IHZhbHVlfSk7CiAgICAgICAgfSk7CiAgICB9CiAgICBmdW5jdGlvbiBob29rRmV0Y2goKSB7CiAgICAgICAgdmFyIHJlYWxGZXRjaCA9IHdpbmRvdy5mZXRjaDsKICAgICAgICB3aW5kb3cuZmV0Y2ggPSBmdW5jdGlvbih1cmwsIGluaXQsIC4uLmFyZ3MpIHsKICAgICAgICAgICAgaWYgKHR5cGVvZiB1cmwgPT09ICdzdHJpbmcnKSB7CiAgICAgICAgICAgICAgICBpZiAodXJsLmluY2x1ZGVzKCdncWwnKSkgewogICAgICAgICAgICAgICAgICAgIHZhciBkZXZpY2VJZCA9IGluaXQuaGVhZGVyc1snWC1EZXZpY2UtSWQnXTsKICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGRldmljZUlkICE9PSAnc3RyaW5nJykgewogICAgICAgICAgICAgICAgICAgICAgICBkZXZpY2VJZCA9IGluaXQuaGVhZGVyc1snRGV2aWNlLUlEJ107CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZGV2aWNlSWQgPT09ICdzdHJpbmcnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGdxbF9kZXZpY2VfaWQgPSBkZXZpY2VJZDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgaWYgKGdxbF9kZXZpY2VfaWQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgcG9zdFR3aXRjaFdvcmtlck1lc3NhZ2UoJ1Vib1VwZGF0ZURldmljZUlkJywgZ3FsX2RldmljZV9pZCk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgaW5pdC5ib2R5ID09PSAnc3RyaW5nJyAmJiBpbml0LmJvZHkuaW5jbHVkZXMoJ1BsYXliYWNrQWNjZXNzVG9rZW4nKSkgewogICAgICAgICAgICAgICAgICAgICAgICBpZiAoT1BUX0FDQ0VTU19UT0tFTl9QTEFZRVJfVFlQRSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgbmV3Qm9keSA9IEpTT04ucGFyc2UoaW5pdC5ib2R5KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KG5ld0JvZHkpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBuZXdCb2R5Lmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0JvZHlbaV0udmFyaWFibGVzLnBsYXllclR5cGUgPSBPUFRfQUNDRVNTX1RPS0VOX1BMQVlFUl9UWVBFOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3Qm9keS52YXJpYWJsZXMucGxheWVyVHlwZSA9IE9QVF9BQ0NFU1NfVE9LRU5fUExBWUVSX1RZUEU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbml0LmJvZHkgPSBKU09OLnN0cmluZ2lmeShuZXdCb2R5KTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGluaXQuaGVhZGVyc1snQ2xpZW50LUludGVncml0eSddID09PSAnc3RyaW5nJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2xpZW50SW50ZWdyaXR5SGVhZGVyID0gaW5pdC5oZWFkZXJzWydDbGllbnQtSW50ZWdyaXR5J107CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQ2xpZW50SW50ZWdyaXR5SGVhZGVyKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zdFR3aXRjaFdvcmtlck1lc3NhZ2UoJ1VwZGF0ZUNsaWVudEludGVncml0eUhlYWRlcicsIGluaXQuaGVhZGVyc1snQ2xpZW50LUludGVncml0eSddKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGluaXQuaGVhZGVyc1snQXV0aG9yaXphdGlvbiddID09PSAnc3RyaW5nJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgQXV0aG9yaXphdGlvbkhlYWRlciA9IGluaXQuaGVhZGVyc1snQXV0aG9yaXphdGlvbiddOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEF1dGhvcml6YXRpb25IZWFkZXIpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3N0VHdpdGNoV29ya2VyTWVzc2FnZSgnVXBkYXRlQXV0aG9yaXphdGlvbkhlYWRlcicsIGluaXQuaGVhZGVyc1snQXV0aG9yaXphdGlvbiddKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gcmVhbEZldGNoLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7CiAgICAgICAgfTsKICAgIH0KICAgIGZ1bmN0aW9uIHJlbG9hZFR3aXRjaFBsYXllcihpc1NlZWssIGlzUGF1c2VQbGF5KSB7CiAgICAgICAgLy8gVGFrZW4gZnJvbSB0dHYtdG9vbHMgLyBmZnoKICAgICAgICAvLyBodHRwczovL2dpdGh1Yi5jb20vTmVyaXh5ei90dHYtdG9vbHMvYmxvYi9tYXN0ZXIvc3JjL2NvbnRleHQvdHdpdGNoLXBsYXllci50cwogICAgICAgIC8vIGh0dHBzOi8vZ2l0aHViLmNvbS9GcmFua2VyRmFjZVovRnJhbmtlckZhY2VaL2Jsb2IvbWFzdGVyL3NyYy9zaXRlcy90d2l0Y2gtdHdpbGlnaHQvbW9kdWxlcy9wbGF5ZXIuanN4CiAgICAgICAgZnVuY3Rpb24gZmluZFJlYWN0Tm9kZShyb290LCBjb25zdHJhaW50KSB7CiAgICAgICAgICAgIGlmIChyb290LnN0YXRlTm9kZSAmJiBjb25zdHJhaW50KHJvb3Quc3RhdGVOb2RlKSkgewogICAgICAgICAgICAgICAgcmV0dXJuIHJvb3Quc3RhdGVOb2RlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGxldCBub2RlID0gcm9vdC5jaGlsZDsKICAgICAgICAgICAgd2hpbGUgKG5vZGUpIHsKICAgICAgICAgICAgICAgIGNvbnN0IHJlc3VsdCA9IGZpbmRSZWFjdE5vZGUobm9kZSwgY29uc3RyYWludCk7CiAgICAgICAgICAgICAgICBpZiAocmVzdWx0KSB7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIG5vZGUgPSBub2RlLnNpYmxpbmc7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgfQogICAgICAgIGZ1bmN0aW9uIGZpbmRSZWFjdFJvb3ROb2RlKCkgewogICAgICAgICAgICB2YXIgcmVhY3RSb290Tm9kZSA9IG51bGw7CiAgICAgICAgICAgIHZhciByb290Tm9kZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNyb290Jyk7CiAgICAgICAgICAgIGlmIChyb290Tm9kZSAmJiByb290Tm9kZS5fcmVhY3RSb290Q29udGFpbmVyICYmIHJvb3ROb2RlLl9yZWFjdFJvb3RDb250YWluZXIuX2ludGVybmFsUm9vdCAmJiByb290Tm9kZS5fcmVhY3RSb290Q29udGFpbmVyLl9pbnRlcm5hbFJvb3QuY3VycmVudCkgewogICAgICAgICAgICAgICAgcmVhY3RSb290Tm9kZSA9IHJvb3ROb2RlLl9yZWFjdFJvb3RDb250YWluZXIuX2ludGVybmFsUm9vdC5jdXJyZW50OwogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmIChyZWFjdFJvb3ROb2RlID09IG51bGwpIHsKICAgICAgICAgICAgICAgIHZhciBjb250YWluZXJOYW1lID0gT2JqZWN0LmtleXMocm9vdE5vZGUpLmZpbmQoeCA9PiB4LnN0YXJ0c1dpdGgoJ19fcmVhY3RDb250YWluZXInKSk7CiAgICAgICAgICAgICAgICBpZiAoY29udGFpbmVyTmFtZSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgcmVhY3RSb290Tm9kZSA9IHJvb3ROb2RlW2NvbnRhaW5lck5hbWVdOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiByZWFjdFJvb3ROb2RlOwogICAgICAgIH0KICAgICAgICB2YXIgcmVhY3RSb290Tm9kZSA9IGZpbmRSZWFjdFJvb3ROb2RlKCk7CiAgICAgICAgaWYgKCFyZWFjdFJvb3ROb2RlKSB7CiAgICAgICAgICAgIGNvbnNvbGUubG9nKCdDb3VsZCBub3QgZmluZCByZWFjdCByb290Jyk7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICB9CiAgICAgICAgdmFyIHBsYXllciA9IGZpbmRSZWFjdE5vZGUocmVhY3RSb290Tm9kZSwgbm9kZSA9PiBub2RlLnNldFBsYXllckFjdGl2ZSAmJiBub2RlLnByb3BzICYmIG5vZGUucHJvcHMubWVkaWFQbGF5ZXJJbnN0YW5jZSk7CiAgICAgICAgcGxheWVyID0gcGxheWVyICYmIHBsYXllci5wcm9wcyAmJiBwbGF5ZXIucHJvcHMubWVkaWFQbGF5ZXJJbnN0YW5jZSA/IHBsYXllci5wcm9wcy5tZWRpYVBsYXllckluc3RhbmNlIDogbnVsbDsKICAgICAgICB2YXIgcGxheWVyU3RhdGUgPSBmaW5kUmVhY3ROb2RlKHJlYWN0Um9vdE5vZGUsIG5vZGUgPT4gbm9kZS5zZXRTcmMgJiYgbm9kZS5zZXRJbml0aWFsUGxheWJhY2tTZXR0aW5ncyk7CiAgICAgICAgaWYgKCFwbGF5ZXIpIHsKICAgICAgICAgICAgY29uc29sZS5sb2coJ0NvdWxkIG5vdCBmaW5kIHBsYXllcicpOwogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGlmICghcGxheWVyU3RhdGUpIHsKICAgICAgICAgICAgY29uc29sZS5sb2coJ0NvdWxkIG5vdCBmaW5kIHBsYXllciBzdGF0ZScpOwogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGlmIChwbGF5ZXIucGF1c2VkIHx8IHBsYXllci5jb3JlPy5wYXVzZWQpIHsKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KICAgICAgICBpZiAoaXNTZWVrKSB7CiAgICAgICAgICAgIGNvbnNvbGUubG9nKCdGb3JjZSBzZWVrIHRvIHJlc2V0IHBsYXllciAoaG9wZWZ1bGx5IGZpeGluZyBhbnkgYXVkaW8gZGVzeW5jKSBwb3M6JyArIHBsYXllci5nZXRQb3NpdGlvbigpICsgJyByYW5nZTonICsgSlNPTi5zdHJpbmdpZnkocGxheWVyLmdldEJ1ZmZlcmVkKCkpKTsKICAgICAgICAgICAgdmFyIHBvcyA9IHBsYXllci5nZXRQb3NpdGlvbigpOwogICAgICAgICAgICBwbGF5ZXIuc2Vla1RvKDApOwogICAgICAgICAgICBwbGF5ZXIuc2Vla1RvKHBvcyk7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICB9CiAgICAgICAgaWYgKGlzUGF1c2VQbGF5KSB7CiAgICAgICAgICAgIHBsYXllci5wYXVzZSgpOwogICAgICAgICAgICBwbGF5ZXIucGxheSgpOwogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGxzS2V5UXVhbGl0eSA9ICd2aWRlby1xdWFsaXR5JzsKICAgICAgICBjb25zdCBsc0tleU11dGVkID0gJ3ZpZGVvLW11dGVkJzsKICAgICAgICBjb25zdCBsc0tleVZvbHVtZSA9ICd2b2x1bWUnOwogICAgICAgIHZhciBjdXJyZW50UXVhbGl0eUxTID0gbG9jYWxTdG9yYWdlLmdldEl0ZW0obHNLZXlRdWFsaXR5KTsKICAgICAgICB2YXIgY3VycmVudE11dGVkTFMgPSBsb2NhbFN0b3JhZ2UuZ2V0SXRlbShsc0tleU11dGVkKTsKICAgICAgICB2YXIgY3VycmVudFZvbHVtZUxTID0gbG9jYWxTdG9yYWdlLmdldEl0ZW0obHNLZXlWb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iBpbiBhbm90aGVyIHRhYiBhbmQgYW4gYWQgc2hvd3MuCiAgICAgICAgLy8gVGFrZW4gZnJvbSBodHRwczovL2dpdGh1Yi5jb20vc2F1Y2V0dHYvVmlkZW9BZEJsb2NrRm9yVHdpdGNoL2Jsb2IvY2VmY2U5ZDJiNTY1NzY5Yzc3ZTM2NjZhYzgyMzRjM2FjZmUyMGQ4My9jaHJvbWUvY29udGVudC5qcyNMMzAKICAgICAgICB0cnkgewogICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoZG9jdW1lbnQsICd2aXNpYmlsaXR5U3RhdGUnLCB7CiAgICAgICAgICAgICAgICBnZXQoKSB7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd2aXNpYmxlJzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSk7CiAgICAgICAgfWNhdGNoe30KICAgICAgICB0cnkgewogICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoZG9jdW1lbnQsICdoaWRkZW4nLCB7CiAgICAgICAgICAgICAgICBnZXQoKSB7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKICAgICAgICB9Y2F0Y2h7fQogICAgICAgIHZhciBibG9jayA9IGUgPT4gewogICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7CiAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7CiAgICAgICAgICAgIGUuc3RvcEltbWVkaWF0ZVByb3BhZ2F0aW9uKCk7CiAgICAgICAgfTsKICAgICAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKCd2aXNpYmlsaXR5Y2hhbmdlJywgYmxvY2ssIHRydWUpOwogICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ3dlYmtpdHZpc2liaWxpdHljaGFuZ2UnLCBibG9jaywgdHJ1ZSk7CiAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignbW96dmlzaWJpbGl0eWNoYW5nZScsIGJsb2NrLCB0cnVlKTsKICAgICAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKCdoYXNGb2N1cycsIGJsb2NrLCB0cnVlKTsKICAgICAgICB0cnkgewogICAgICAgICAgICBpZiAoL0ZpcmVmb3gvLnRlc3QobmF2aWdhdG9yLnVzZXJBZ2VudCkpIHsKICAgICAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShkb2N1bWVudCwgJ21vekhpZGRlbicsIHsKICAgICAgICAgICAgICAgICAgICBnZXQoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShkb2N1bWVudCwgJ3dlYmtpdEhpZGRlbicsIHsKICAgICAgICAgICAgICAgICAgICBnZXQoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgfQogICAgICAgIH1jYXRjaHt9CiAgICAgICAgLy8gSG9va3MgZm9yIHByZXNlcnZpbmcgdm9sdW1lIC8gcmVzb2x1dGlvbgogICAgICAgIHZhciBrZXlzVG9DYWNoZSA9IFsKICAgICAgICAgICAgJ3ZpZGVvLXF1YWxpdHknLAogICAgICAgICAgICAndmlkZW8tbXV0ZWQnLAogICAgICAgICAgICAndm9sdW1lJywKICAgICAgICAgICAgJ2xvd0xhdGVuY3lNb2RlRW5hYmxlZCcsLy8gTG93IExhdGVuY3kKICAgICAgICAgICAgJ3BlcnNpc3RlbmNlRW5hYmxlZCcsLy8gTWluaSBQbGF5ZXIKICAgICAgICBdOwogICAgICAgIHZhciBjYWNoZWRWYWx1ZXMgPS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oUGxheWVyID0gcmVsb2FkVHdpdGNoUGxheWVyOwogICAgICAgIGRlY2xhcmVPcHRpb25zKHdpbmRvdyk7CiAgICAgICAgaG9va1dpbmRvd1dvcmtlcigpOwogICAgICAgIGhvb2tGZXRjaCgpOwogICAgICAgIGlmIChkb2N1bWVudC5yZWFkeVN0YXRlID09PSAiY29tcGxldGUiIHx8IGRvY3VtZW50LnJlYWR5U3RhdGUgPT09ICJsb2FkZWQiIHx8IGRvY3VtZW50LnJlYWR5U3RhdGUgPT09ICJpbnRlcmFjdGl2ZSIpIHsKICAgICAgICAgICAgb25Db250ZW50TG9hZGVkKCk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoIkRPTUNvbnRlbnRMb2FkZWQiLCBmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgIG9uQ29udGVudExvYWRlZCgpOwogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICB9Cn0pKCk7Cg=="}] \ No newline at end of file