mirror of
https://github.com/alantang1977/hipy.git
synced 2024-11-22 03:33:07 +02:00
1 line
8.2 KiB
JavaScript
1 line
8.2 KiB
JavaScript
|
dmFyIGxpc3RzID0gYGpzOgpsb2coVEFCUyk7CmxldCBkID0gW107CnBkZmggPSBqc3AucGRmaDsKcGRmYSA9IGpzcC5wZGZhOwppZiAodHlwZW9mIHBsYXlfdXJsID09PSAidW5kZWZpbmVkIikgewoJdmFyIHBsYXlfdXJsID0gIiIKfQoKZnVuY3Rpb24gZ2V0TGlzdHMoaHRtbCkgewoJbGV0IHNyYyA9IHBkZmgoaHRtbCwgIi53cC1wbGF5bGlzdC1zY3JpcHQmJkh0bWwiKTsKCXNyYyA9IEpTT04ucGFyc2Uoc3JjKS50cmFja3M7CglsZXQgbGlzdDEgPSBbXTsKCWxldCBsaXN0MiA9IFtdOwoJbGV0IHVybDEgPSAiIjsKCWxldCB1cmwyID0gIiI7CglzcmMuZm9yRWFjaChmdW5jdGlvbihpdCkgewoJCWxldCBzcmMwID0gaXQuc3JjMDsKCQlsZXQgc3JjMSA9IGl0LnNyYzE7CgkJbGV0IHRpdGxlID0gaXQuY2FwdGlvbjsKCQl1cmwxID0gImh0dHBzOi8vdi5kZHlzLnBybyIgKyBzcmMwOwoJCXVybDIgPSAiaHR0cHM6Ly9kZHlzLnByby9nZXR2ZGRyMi92aWRlbz9pZD0iICsgc3JjMSArICImdHlwZT1taXgiOwoJCWxldCB6bSA9ICJodHRwczovL2RkeXMucHJvL3N1YmRkci8iICsgaXQuc3Vic3JjOwoJCWxpc3QxLnB1c2goewoJCQl0aXRsZTogdGl0bGUsCgkJCXVybDogdXJsMSwKCQkJZGVzYzogem0KCQl9KTsKCQlsaXN0Mi5wdXNoKHsKCQkJdGl0bGU6IHRpdGxlLAoJCQl1cmw6IHVybDIsCgkJCWRlc2M6IHptCgkJfSkKCX0pOwoJcmV0dXJuIHsKCQlsaXN0MTogbGlzdDEsCgkJbGlzdDI6IGxpc3QyCgl9Cn0KdmFyIG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sKTsKcHJpbnQoInJlZmVyZXI6IiArIHJlZmVyZXIpOwpwcmludCgiem06IiArIHptKTsKaWYgKC9nZXR2ZGRyLy50ZXN0KHB1cmwpKSB7CiAgICBsZXQgaHRtbCA9IHJlcXVlc3QocHVybCwgewogICAgICAgIGhlYWRlcnM6IHsKICAgICAgICAgICAgUmVmZXJlcjogSE9TVCwKICAgICAgICAgICAgIlVzZXItQWdlbnQiOiBNT0JJTEVfVUEKICAgICAgICB9CiAgICB9KTsKICAgIHByaW50KGh0bWwpOwogICAgdHJ5IHsKICAgICAgICBpbnB1dCA9IHtqeDowLHVybDpKU09OLnBhcnNlKGh0bWwpLnVybCxwYXJzZTowfSB8fCB7fQogICAgfSBjYXRjaCAoZSkgewogICAgICAgIGlucHV0ID0gcHVybAogICAgfQp9IGVsc2UgewogICAgaW5wdXQgPSB7CiAgICAgICAgang6IDAsCiAgICAgICAgdXJsOiBwdXJsLAogICAgICAgIHBhcnNlOiAwLAogICAgICAgIGhlYWRlcjogSlNPTi5zdHJpbmdpZnkoewogICAgICAgICAgICAndXNlci1hZ2VudCc6IE1PQklMRV9VQSwKICAgICAgICAgICAgJ3JlZmVyZXInOiBIT1NUCiAgICAgICAgfSkKICAgIH0KfQpgOwoKLy8g572R5Z2A5Y+R5biD6aG1IGh0dHBzOi8vZGR5cy5zaXRlCi8vIOe9keWdgOWPkeW4g+mhtSBodHRwczovL2RkeXMud2lraQp2YXIgcnVsZSA9IHsKICAgIHRpdGxlOiAnZGR5cycsCiAgICAvLyBob3N0OidodHRwczovL2RkeXMud2lraScsIAogICAgLy8gaG9zdEpzOidwcmludChIT1NUKTtsZXQgaHRtbD1yZXF1ZXN0KEhPU1Qse2hlYWRlcnM6eyJVc2VyLUFnZW50IjpNT0JJTEVfVUF9fSk7SE9TVCA9IGpzcC5wZGZoKGh0bWwsImE6ZXEoMSkmJmhyZWYiKScsCiAgICBob3N0OiAnaHR0cHM6Ly9kZHlzLnBybycsCiAgICAvLyBob3N0OidodHRwcz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