3.2 sec in total
224 ms
2.3 sec
713 ms
Visit starwind.com now to see the best up-to-date Star Wind content for Ukraine and also check out these interesting facts you probably never knew about starwind.com
StarWind delivers Software-Defined Storage solutions, HyperConverged and Storage Appliances designed to build highly resilient IT infrastructures.
Visit starwind.comWe analyzed Starwind.com page load time and found that the first response time was 224 ms and then it took 3 sec to load all DOM resources and completely render a web page. This is a poor result, as 55% of websites can load faster.
starwind.com performance score
name
value
score
weighting
Value5.2 s
8/100
10%
Value6.7 s
7/100
25%
Value8.6 s
17/100
10%
Value1,570 ms
13/100
30%
Value0.1
90/100
15%
Value12.8 s
13/100
10%
224 ms
446 ms
133 ms
587 ms
83 ms
Our browser made a total of 57 requests to load all elements on the main page. We found that 4% of them (2 requests) were addressed to the original Starwind.com, 67% (38 requests) were made to Starwindsoftware.com and 9% (5 requests) were made to . The less responsive or slowest element that took the longest time to load (888 ms) relates to the external source Starwindsoftware.com.
Page size can be reduced by 374.7 kB (26%)
1.4 MB
1.0 MB
In fact, the total size of Starwind.com main page is 1.4 MB. This result falls beyond the top 1M of websites and identifies a large and not optimized web page that may take ages to load. 45% of websites need less resources to load. Images take 844.8 kB which makes up the majority of the site volume.
Potential reduce by 324.0 kB
HTML content can be minified and compressed by a website’s server. The most efficient way is to compress content using GZIP which reduces data amount travelling through the network between server and browser. This page needs HTML code to be minified as it can gain 55.1 kB, which is 14% of the original size. It is highly recommended that content of this web page should be compressed using GZIP, as it can save up to 324.0 kB or 84% of the original size.
Potential reduce by 43.5 kB
Image size optimization can help to speed up a website loading time. The chart above shows the difference between the size before and after optimization. Star Wind images are well optimized though.
Potential reduce by 2.4 kB
It’s better to minify JavaScript in order to improve website performance. The diagram shows the current total size of all JavaScript files against the prospective JavaScript size after its minification and compression. This website has mostly compressed JavaScripts.
Potential reduce by 4.8 kB
CSS files minification is very important to reduce a web page rendering time. The faster CSS files can load, the earlier a page can be rendered. Starwind.com needs all CSS files to be minified and compressed as it can save up to 4.8 kB or 16% of the original size.
Number of requests can be reduced by 17 (40%)
43
26
The browser has sent 43 CSS, Javascripts, AJAX and image requests in order to completely render the main page of Star Wind. We recommend that multiple CSS and JavaScript files should be merged into one by each type, as it can help reduce assets requests from 15 to 1 for JavaScripts and from 4 to 1 for CSS and as a result speed up the page load time.
starwind.com
224 ms
starwind.com
446 ms
133 ms
www.starwindsoftware.com
587 ms
gtm.js
83 ms
menu.css
185 ms
libs.min.css
177 ms
main.css
187 ms
intlTelInput.min.css
166 ms
logo_blue.svg
167 ms
logo-blue.svg
176 ms
choices.min.js
345 ms
main-server-x2.png
177 ms
logo-gartner.svg
359 ms
logo-g2.svg
588 ms
logo-spiceworks.svg
343 ms
logo-peerspot.svg
327 ms
logo-storage-review.svg
359 ms
logo-thq.png
336 ms
logo-thq.svg
486 ms
logo-siemens2.svg
488 ms
logo-sears3.svg
481 ms
logo-auchan2.svg
483 ms
logo-rank-group3.png
368 ms
logo-bosch3.png
381 ms
logo-cygnus.webp
516 ms
logo-kellstrom.webp
651 ms
logo-oxford3.png
493 ms
logo-eccos3.png
494 ms
logo-midway.webp
629 ms
logo-visma5.svg
888 ms
logo-cantey4.png
502 ms
libs.min.js
637 ms
main.js
647 ms
menu.js
731 ms
socialintents.1.3.js
378 ms
javascript;base64,Ly8gR2VuZXJhdGVkIGJ5IENvZmZlZVNjcmlwdCAxLjEyLjcKKGZ1bmN0aW9uKCkgewogIHdpbmRvdy5ldXJvcGVfem9uZV9jb3VudHJ5ID0gWydHZXJtYW55JywgJ1VuaXRlZCBLaW5nZG9tJywgJ0ZyYW5jZScsICdJdGFseScsICdTcGFpbicsICdVa3JhaW5lJywgJ1BvbGFuZCcsICdSb21hbmlhJywgJ05ldGhlcmxhbmRzJywgJ0JlbGdpdW0nLCAnQ3plY2ggUmVwdWJsaWMnLCAnR3JlZWNlJywgJ1BvcnR1Z2FsJywgJ1N3ZWRlbicsICdIdW5nYXJ5JywgJ0JlbGFydXMnLCAnQXVzdHJpYScsICdTZXJiaWEnLCAnU3dpdHplcmxhb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yY2VMaWJyYXJ5UGFnZVR5cGUnXSA9IHdpbmRvdy5nZXRSZXNvdXJjZUxpYnJhcnlQYWdlVHlwZQogICAgICAgICAgICAgICAgICAgIH0KCgogICAgICAgICAgICAgICAgICAgIGNvbnN0IGhpc3RvcnlPYmogPSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogd2luZG93LmxvY2F0aW9uLm9yaWdpbit3aW5kb3cubG9jYXRpb24ucGF0aG5hbWUsCiAgICAgICAgICAgICAgICAgICAgICAgIGR1cmF0aW9uOiB0aW1lUmVzdWx0LAogICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiBwYXJhbXMsCiAgICAgICAgICAgICAgICAgICAgICAgIGFjdGlvbjogYWN0aW9uLAogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgbWUuc2F2ZUhpc3RvcnkoaGlzdG9yeU9iaikKCiAgICAgICAgICAgICAgICAgICAgbGV0IExlYWRJZCA9ICcnCiAgICAgICAgICAgICAgICAgICAgTGVhZElkID0gbWUuZ2V0Q29va2llKCdMZWFkSWQnKQogICAgICAgICAgICAgICAgICAgIGlmKExlYWRJZCA9PT0gdW5kZWZpbmVkKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIExlYWRJZCA9ICcnCiAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICBjb25zdCBoaXN0b3J5ID0gbWUucmVhZEhpc3RvcnkoKQogICAgICAgICAgICAgICAgICAgIHRoaXMuc2VuZEhpc3RvcnkyKExlYWRJZCwgaGlzdG9yeSkKCiAgICAgICAgICAgICAgICAgICAgZ2xvYmFsRm9ybUFjdGlvblN0YXR1cyA9IGZhbHNlCgogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfSkKICAgIH0KCiAgICByZXNldEhpc3RvcnkoKSB7CiAgICAgICAgbG9jYWxTdG9yYWdlLnNldEl0ZW0odGhpcy5rZXlIaXN0b3J5LCBKU09OLnN0cmluZ2lmeShbXSkpCiAgICB9CgogICAgc2F2ZUhpc3RvcnkoZGF0YSkgewoKICAgICAgICBsZXQgaGlzdG9yeSA9IGxvY2FsU3RvcmFnZS5nZXRJdGVtKHRoaXMua2V5SGlzdG9yeSkKCiAgICAgICAgaWYoaGlzdG9yeSA9PT0gbnVsbCkgewogICAgICAgICAgICBoaXN0b3J5ID0gW10KICAgICAgICB9IGVsc2V7CiAgICAgICAgICAgIGhpc3RvcnkgPSBKU09OLnBhcnNlKGhpc3RvcnkpCiAgICAgICAgICAgIGhpc3RvcnkucHVzaChkYXRhKQogICAgICAgIH0KCiAgICAgICAgbG9jYWxTdG9yYWdlLnNldEl0ZW0odGhpcy5rZXlIaXN0b3J5LCBKU09OLnN0cmluZ2lmeShoaXN0b3J5KSkKICAgIH0KCgogICAgcmVhZEhpc3RvcnkoKSB7CgogICAgICAgIGNvbnN0IGhpc3RvcnkgPSBsb2NhbFN0b3JhZ2UuZ2V0SXRlbSh0aGlzLmtleUhpc3RvcnkpCgogICAgICAgIGlmKGhpc3RvcnkgPT09IG51bGwpIHsKICAgICAgICAgICAgcmV0dXJuIFtdCiAgICAgICAgfQoKICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShoaXN0b3J5KQoKICAgIH0KCiAgICBnZXRUb2tlbigpIHsKCiAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlKSA9PiB7CgogICAgICAgICAgICBjb25zdCByZWFkVG9rZW4gPSB0aGlzLmdldENvb2tpZSh0aGlzLnRva2VuTmFtZSkKCiAgICAgICAgICAgIC8vIGlmKHJlYWRUb2tlbiAhPT0gdW5kZWZpbmVkKSB7CiAgICAgICAgICAgIC8vICAgICByZXNvbHZlKHJlYWRUb2tlbikKICAgICAgICAgICAgLy8gICAgIHJldHVybgogICAgICAgICAgICAvLyB9CgogICAgICAgICAgICAvL2lmIHRva2VuIHVuZGVmaW5lZCB0YWtlIGl0IGZyb20gc2VydmVyCiAgICAgICAgICAgIHRoaXMuZmV0Y2hUb2tlbih0aGlzLnVybCkudGhlbiggKGRhdGEpID0+IHsKICAgICAgICAgICAgICAgIGlmKGRhdGEuc3RhdHVzKSB7CiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRDb29raWUodGhpcy50b2tlbk5hbWUsIGRhdGEudG9rZW4sIDMwKjEyKQogICAgICAgICAgICAgICAgICAgIHJlc29sdmUoZGF0YS50b2tlbikKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSkKCiAgICAgICAgfSkKCiAgICB9CgogICAgZ2V0Q29va2llKG5hbWUpIHsKICAgICAgICBjb25zdCByZWdleCA9IG5ldyBSZWdFeHAoYChefCApJHtuYW1lfT0oW147XSspYCkKICAgICAgICBjb25zdCBtYXRjaCA9IGRvY3VtZW50LmNvb2tpZS5tYXRjaChyZWdleCkKICAgICAgICBpZiAobWF0Y2gpIHsKICAgICAgICAgICAgcmV0dXJuIG1hdGNoWzJdCiAgICAgICAgfQoKICAgICAgICByZXR1cm4gdW5kZWZpbmVkCiAgICB9CgogICAgc2V0Q29va2llKGNuYW1lLCBjdmFsdWUsIGV4ZGF5cykgewogICAgICAgIGNvbnN0IGQgPSBuZXcgRGF0ZSgpOwogICAgICAgIGQuc2V0VGltZShkLmdldFRpbWUoKSArIChleGRheXMqMjQqNjAqNjAqMTAwMCkpOwogICAgICAgIGNvbnN0IGV4cGlyZXMgPSAiZXhwaXJlcz0iKyBkLnRvVVRDU3RyaW5nKCk7CiAgICAgICAgZG9jdW1lbnQuY29va2llID0gY25hbWUgKyAiPSIgKyBjdmFsdWUgKyAiOyIgKyBleHBpcmVzICsgIjtwYXRoPS8iOwogICAgfQoKICAgIGRlbGV0ZUNvb2tpZShjbmFtZSkgewogICAgICAgIGRvY3VtZW50LmNvb2tpZSA9IGAke2NuYW1lfT07IGV4cGlyZXM9VGh1LCAwMSBKYW4gMTk3MCAwMDowMDowMCBVVEM7IHBhdGg9LzsgZG9tYWluPS5zdGFyd2luZHNvZnR3YXJlLmNvbWA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KSByZXR1cm4KCiAgICAgICAgaWYgKCBBcnJheS5pc0FycmF5KGRhdGEpICYmICFkYXRhLmxlbmd0aCApIHJldHVybgoKICAgICAgICBjb25zdCByYXdEYXRhID0gZGF0YQogICAgICAgIGNvbnN0IHNlbmREYXRhID0gSlNPTi5zdHJpbmdpZnkoewogICAgICAgICAgICBkYXRhOiBkYXRhLAogICAgICAgICAgICBsZWFkSWQ6IExlYWRJZAogICAgICAgIH0pCgogICAgICAgIGNvbnN0IG1lID0gdGhpcwoKICAgICAgICBmZXRjaCh0aGlzLnVybDIsIHsKICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCcsCiAgICAgICAgICAgIGhlYWRlcnM6IHsKICAgICAgICAgICAgICAgICdBY2NlcHQnOiAnYXBwbGljYXRpb24vanNvbicsCiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLAogICAgICAgICAgICAgICAgJ1gtWFNSRi1UT0tFTic6IGRlY29kZVVSSUNvbXBvbmVudCh0aGlzLmdldENvb2tpZSgnWFNSRi1UT0tFTicpKSwKICAgICAgICAgICAgfSwKICAgICAgICAgICAgYm9keTogc2VuZERhdGEsCiAgICAgICAgfSkudGhlbigoZGF0YSkgPT4gZGF0YS5qc29uKCkpLnRoZW4oZGF0YSA9PiB7CgogICAgICAgICAgICBjb25zdCBsYXN0QWN0ID0gcmF3RGF0YVtyYXdEYXRhLmxlbmd0aCAtIDFdCiAgICAgICAgICAgIGlmIChsYXN0QWN0LmFjdGlvbiAhPT0gJ3Zpc2l0JykgewogICAgICAgICAgICAgICAgdGhpcy5kZWxldGVDb29raWUoJ3V0bV9jYW1wYWlnbicpCiAgICAgICAgICAgICAgICB0aGlzLmRlbGV0ZUNvb2tpZSgndXRtX2NvbnRlbnQnKQogICAgICAgICAgICAgICAgdGhpcy5kZWxldGVDb29raWUoJ3V0bV9tZWRpdW0nKQogICAgICAgICAgICAgICAgdGhpcy5kZWxldGVDb29raWUoJ3V0bV9zb3VyY2UnKQogICAgICAgICAgICAgICAgdGhpcy5kZWxldGVDb29raWUoJ3V0bV90ZXJtJykKICAgICAgICAgICAgfQoKICAgICAgICAgICAgbWUucmVzZXRIaXN0b3J5KCkKICAgICAgICB9KQoKICAgIH0KCn0KCiAgICBjb25zdCBsaCA9IG5ldyBMZWFkSGlzdG9yeSgpCgoKCgp9KCkp
8 ms
intlTelInput.min.js
764 ms
axios.min.js
53 ms
vue.min.js
32 ms
dXRtX3NvdXJjZT1zdGFyd2luZCZ1dG1fbWVkaXVtPWxpbmtfbWVudSc6CiAgICAgICAgICAgIGlmICh0eXBlb2Ygc3dfY2hvaWNlcyAhPT0gInVuZGVmaW5lZCIgJiYgc3dfY2hvaWNlcyAhPT0gbnVsbCkgewogICAgICAgICAgICAgIHN3X2Nob2ljZXMuc2V0Q2hvaWNlQnlWYWx1ZSgnU3RhcldpbmQgVjJWIENvbnZlcnRlcicpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgICAgICBpZiAoIWFsbG93KSB7CiAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGZ1bmMgPSBmdW5jdGlvbihsYWJlbCkgewogICAgICAgICAgdmFyIHJlZjsKICAgICAgICAgIGlmICgocmVmID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ3RhYl9xdW90ZScpKSAhPSBudWxsKSB7CiAgICAgICAgICAgIHJlZi5kaXNwYXRjaEV2ZW50KG5ldyBFdmVudCgiY2xpY2siKSk7CiAgICAgICAgICB9CiAgICAgICAgICBzd2l0Y2ggKGxhYmVsKSB7CiAgICAgICAgICAgIGNhc2UgJ1ZpcnR1YWwgU0FOICh2U0FOKSc6CiAgICAgICAgICAgICAgaWYgKHR5cGVvZiBzd19jaG9pY2VzMyAhPT0gInVuZGVmaW5lZCIgJiYgc3dfY2hvaWNlczMgIT09IG51bGwpIHsKICAgICAgICAgICAgICAgIHN3X2Nob2ljZXMzLnNldENob2ljZUJ5VmFsdWUoJ1N0YXJXaW5kIFZpcnR1YWwgU0FOJyk7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBjYXNlICdTQU4gJmFtcDsgTkFTJzoKICAgICAgICAgICAgICBpZiAodHlwZW9mIHN3X2Nob2ljZXMzICE9PSAidW5kZWZpbmVkIiAmJiBzd19jaG9pY2VzMyAhPT0gbnVsbCkgewogICAgICAgICAgICAgICAgc3dfY2hvaWNlczMuc2V0Q2hvaWNlQnlWYWx1ZSgnU3RhcldpbmQgU0FOICYgTkFTJyk7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBjYXNlICdWaXJ0dWFsIFRhcGUgTGlicmFyeSAoVlRMKSc6CiAgICAgICAgICAgICAgaWYgKHR5cGVvZiBzd19jaG9pY2VzMyAhPT0gInVuZGVmaW5lZCIgJiYgc3dfY2hvaWNlczMgIT09IG51bGwpIHsKICAgICAgICAgICAgICAgIHN3X2Nob2ljZXMzLnNldENob2ljZUJ5VmFsdWUoJ1N0YXJXaW5kIFZpcnR1YWwgVGFwZSBMaWJyYXJ5Jyk7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBjYXNlICdWaXJ0dWFsIEhDSSBBcHBsaWFuY2UgKHZIQ0kpJzoKICAgICAgICAgICAgICBpZiAodHlwZW9mIHN3X2Nob2ljZXMzICE9PSAidW5kZWZpbmVkIiAmJiBzd19jaG9pY2VzMyAhPT0gbnVsbCkgewogICAgICAgICAgICAgICAgc3dfY2hvaWNlczMuc2V0Q2hvaWNlQnlWYWx1ZSgnU3RhcldpbmQgdkhDSSBBcHBsaWFuY2UnKTsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgJ05WTWUtb0YgSW5pdGlhdG9yJzoKICAgICAgICAgICAgICBpZiAodHlwZW9mIHN3X2Nob2ljZXMzICE9PSAidW5kZWZpbmVkIiAmJiBzd19jaG9pY2VzMyAhPT0gbnVsbCkgewogICAgICAgICAgICAgICAgc3dfY2hvaWNlczMuc2V0Q2hvaWNlQnlWYWx1ZSgnU3RhcldpbmQgTlZNZS1vRiBJbml0aWF0b3InKTsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgJ0hDSSBBcHBsaWFuY2UgKEhDQSknOgogICAgICAgICAgICAgIGlmICh0eXBlb2Ygc3dfY2hvaWNlczMgIT09ICJ1bmRlZmluZWQiICYmIHN3X2Nob2ljZXMzICE9PSBudWxsKSB7CiAgICAgICAgICAgICAgICBzd19jaG9pY2VzMy5zZXRDaG9pY2VCeVZhbHVlKCdTdGFyV2luZCBIeXBlckNvbnZlcmdlZCBBcHBsaWFuY2UnKTsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgJ0hDQSBmb3IgVmlkZW8gU3VydmVpbGxhbmNlJzoKICAgICAgICAgICAgICBpZiAodHlwZW9mIHN3X2Nob2ljZXMzICE9PSAidW5kZWZpbmVkIiAmJiBzd19jaG9pY2VzMyAhPT0gbnVsbCkgewogICAgICAgICAgICAgICAgc3dfY2hvaWNlczMuc2V0Q2hvaWNlQnlWYWx1ZSgnU3RhcldpbmQgSHlwZXJDb252ZXJnZWQgQXBwbGlhbmNlJyk7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBjYXNlICdWVEwgQXBwbGlhbmNlJzoKICAgICAgICAgICAgICBpZiAodHlwZW9mIHN3X2Nob2ljZXMzICE9PSAidW5kZWZpbmVkIiAmJiBzd19jaG9pY2VzMyAhPT0gbnVsbCkgewogICAgICAgICAgICAgICAgc3dfY2hvaWNlczMuc2V0Q2hvaWNlQnlWYWx1ZSgnU3RhcldpbmQgVmlydHVhbCBUYXBlIExpYnJhcnkgQXBwbGlhbmNlJyk7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBjYXNlICdCYWNrdXAgQXBwbGlhbmNlJzoKICAgICAgICAgICAgICBpZiAodHlwZW9mIHN3X2Nob2ljZXMzICE9PSAidW5kZWZpbmVkIiAmJiBzd19jaG9pY2VzMyAhPT0gbnVsbCkgewogICAgICAgICAgICAgICAgc3dfY2hvaWNlczMuc2V0Q2hvaWNlQnlWYWx1ZSgnU3RhcldpbmQgQmFja3VwIEFwcGxpYW5jZScpOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAnU3RvcmFnZSBBcHBsaWFuY2UnOgogICAgICAgICAgICAgIGlmICh0eXBlb2Ygc3dfY2hvaWNlczMgIT09ICJ1bmRlZmluZWQiICYmIHN3X2Nob2ljZXMzICE9PSBudWxsKSB7CiAgICAgICAgICAgICAgICBzd19jaG9pY2VzMy5zZXRDaG9pY2VCeVZhbHVlKCdTdGFyV2luZCBTdG9yYWdlIEFwcGxpYW5jZScpOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgIH0KICAgICAgICB9OwogICAgICAgIGNhbGxRdW90ZUZvcm1FbGVtcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy5jYWxsLXF1b3RlLWZvcm0nKTsKICAgICAgICBmb3IgKGkgPSAwLCBsZW4gPSBjYWxsUXVvdGVGb3JtRWxlbXMubGVuZ3RoOyBpIDwgbGVuOyBpKyspIHsKICAgICAgICAgIGl0ZW0gPSBjYWxsUXVvdGVGb3JtRWxlbXNbaV07CiAgICAgICAgICBpdGVtLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJywgZnVuY3Rpb24oZSkgewogICAgICAgICAgICB2YXIgbGFiZWwsIHJlZjsKICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpOwogICAgICAgICAgICBpZiAoKHJlZiA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCd0YWJfcXVvdGUnKSkgIT0gbnVsbCkgewogICAgICAgICAgICAgIHJlZi5kaXNwYXRjaEV2ZW50KG5ldyBFdmVudCgiY2xpY2siKSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgbGFiZWwgPSBlLnRhcmdldC5pbm5lckhUTUw7CiAgICAgICAgICAgIGZ1bmMobGFiZWwpOwogICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBwaG9uZUNoYW5nZTogZnVuY3Rpb24oZSkgewogICAgICAgIGlmICgvXlteLVwrMC05XChcKSNdJC8udGVzdChlLmtleSkpIHsKICAgICAgICAgIHJldHVybiBlLnByZXZlbnREZWZhdWx0KCk7CiAgICAgICAgfQogICAgICB9LAogICAgICB2YWxpZEVtYWlsOiBmdW5jdGlvbihvcHRpb25zKSB7CiAgICAgICAgaWYgKHdpbmRvdy5zdWNjZXNzRm9ybVN1Ym1pdCA9PSBudWxsKSB7CiAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgICQuYWpheCh7CiAgICAgICAgICB1cmw6ICcvdmFsaWRlbWFpbC5qcycsCiAgICAgICAgICB0eXBlOiAiUE9TVCIsCiAgICAgICAgICBkYXRhOiB7CiAgICAgICAgICAgIGVtYWlsOiBvcHRpb25zLmVtYWlsCiAgICAgICAgICB9LAogICAgICAgICAgc3VjY2VzczogZnVuY3Rpb24ocmVzcG9uc2UpIHsKICAgICAgICAgICAgdmFyIG9iajsKICAgICAgICAgICAgb2JqID0ge307CiAgICAgICAgICAgIG9wdGlvbnMudmFsaWQgPSByZXNwb25zZS5lbWFpbFN0YXR1czsKICAgICAgICAgICAgb3B0aW9ucy51c2VyID0gcmVzcG9uc2UuY2lkOwogICAgICAgICAgICB3aW5kb3cuc3VjY2Vzc0Zvcm1TdWJtaXQob3B0aW9ucyk7CiAgICAgICAgICB9LAogICAgICAgICAgZGF0YVR5cGU6ICdqc29uJwogICAgICAgIH0pOwogICAgICB9LAogICAgICBmdW5jX25vX3ZhbGlkOiBmdW5jdGlvbihkYXRhKSB7CiAgICAgICAgdmFyIGQ7CiAgICAgICAgZCA9IGRhdGE7CiAgICAgICAgZFsnZnJvbV91cmwnXSA9IGRvY3VtZW50LmxvY2F0aW9uLmhyZWY7CiAgICAgICAgaWYgKCFqUXVlcnkpIHsKICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICB9CiAgICAgICAgJC5wb3N0KCIvbm90LXZhbGlkLWRhdGEtdjIwLmpzIiwgZCk7CiAgICAgIH0sCiAgICAgIHNldE1vZGVsOiBmdW5jdGlvbigpIHsKICAgICAgICB2YXIgbGljZW5zZSwgb2JqLCBzd19lbGVtZW50X3N1Yl9wcm9kdWN0X3ZoY2k7CiAgICAgICAgdGhpcy5pc1ZhbGlkUGhvbmUoKTsKICAgICAgICBvYmogPSB0aGlzLmdldExpY2Vuc2U7CiAgICAgICAgbGljZW5zZSA9IG9iai5saWNlbnNlOwogICAgICAgIHRoaXMubW9kZWwgPSB7CiAgICAgICAgICBzdWJfcHJvZHVjdF9zYW5fbmFzOiB0aGlzLnN1Yl9wcm9kdWN0X3Nhbl9uYXMsCiAgICAgICAgICBsaWNlbnNlOiBsaWNlbnNlLAogICAgICAgICAgcHJvZHVjdDogdGhpcy5wcm9kdWN0LAogICAgICAgICAgZmlyc3RuYW1lOiB0aGlzLmZpcnN0bmFtZSwKICAgICAgICAgIGxhc3RuYW1lOiB0aGlzLmxhc3RuYW1lLAogICAgICAgICAgY29tcGFueTogdGhpcy5jb21wYW55LAogICAgICAgICAgZW1haWw6IHRoaXMuZW1haWwsCiAgICAgICAgICBjb3VudHJ5OiB0aGlzLmNvdW50cnksCiAgICAgICAgICB0aXRsZTogdGhpcy50aXRsZSwKICAgICAgICAgIHBob25lMjogdGhpcy5waG9uZSwKICAgICAgICAgIG52bWVfaG9zdHM6IHRoaXMubnZtZV9ob3N0cywKICAgICAgICAgIHVybDogd2luZG93LmxvY2F0aW9uLmhyZW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jaGVja19tZS5jaGVja2VkKSB7CiAgICAgICAgICAgICAgdGhpcy5wcml2YWN5UG9saWN5RXJyb3IgPSB0cnVlOwogICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgfQogICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBpZiAodGhpcy5pdGlJbnN0YW5jZSgnI2Rvd25sb2FkX3Bob25lJykgIT0gbnVsbCkgewogICAgICAgICAgdGhpcy5pc0l0aVZhbGlkUGhvbmUoJyNkb3dubG9hZF9waG9uZScpOwogICAgICAgIH0KICAgICAgICBtZSA9IHRoaXM7CiAgICAgICAgdGhpcy5zZXRNb2RlbCgpOwogICAgICAgIHN1Y2Nlc3NDYWxsYmFjayA9IGZ1bmN0aW9uKGRhdGEpIHsKICAgICAgICAgIHZhciBjYXRlZ29yeSwgZG93bmxvYWRUaGFua1lvdUVsLCBvYmosIG9wdGlvbnMsIHByb2R1Y3RfbmFtZV8yMDI0OwogICAgICAgICAgbWUuY2hlY2tSZXF1ZXN0KGRhdGEpOwogICAgICAgICAgb2JqID0gbWUuZ2V0TGljZW5zZTsKICAgICAgICAgIGNhdGVnb3J5ID0gb2JqLmNhdGVnb3J5OwogICAgICAgICAgJCgiI2Rvd25sb2FkX2Zvcm0iKS5oaWRlKCk7CiAgICAgICAgICBvcHRpb25zID0ge307CiAgICAgICAgICBvcHRpb25zLmFjdGlvbiA9ICdEb3dubG9hZCc7CiAgICAgICAgICBvcHRpb25zLmxvY2F0aW9uID0gd2luZG93LmxvY2F0aW9uLmhyZWY7CiAgICAgICAgICBvcHRpb25zLmVtYWlsID0gbWUuZW1haWw7CiAgICAgICAgICBvcHRpb25zLmxpY2Vuc2UgPSBtZS5tb2RlbFsnbGljZW5zZSddOwogICAgICAgICAgb3B0aW9ucy5jYXRlZ29yeSA9IGNhdGVnb3J5OwogICAgICAgICAgbWUudmFsaWRFbWFpbChvcHRpb25zKTsKICAgICAgICAgIHByb2R1Y3RfbmFtZV8yMDI0ID0gIiI7CiAgICAgICAgICBzd2l0Y2ggKG1lLnByb2R1Y3QpIHsKICAgICAgICAgICAgY2FzZSAidmlydHVhbF9zYW4iOgogICAgICAgICAgICAgIHByb2R1Y3RfbmFtZV8yMDI0ID0gIlZpcnR1YWwgU0FOIChWU0FOKSI7CiAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgInZzYW5fZnJlZV9vY3QxOCI6CiAgICAgICAgICAgICAgcHJvZHVjdF9uYW1lXzIwMjQgPSAiVlNBTiBGcmVlIjsKICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAiVmlydHVhbCBIQ0kgQXBwbGlhbmNlICh2SENJKSI6CiAgICAgICAgICAgICAgcHJvZHVjdF9uYW1lXzIwMjQgPSAiVmlydHVhbCBIQ0kgQXBwbGlhbmNlIChWSENBKSI7CiAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgInZ0bF9vY3QxOCI6CiAgICAgICAgICAgICAgcHJvZHVjdF9uYW1lXzIwMjQgPSAiVmlydHVhbCBUYXBlIExpYnJhcnkgKFZUTCkiOwogICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBjYXNlICJ2dGxfZnJlZV9vY3QxOCI6CiAgICAgICAgICAgICAgcHJvZHVjdF9uYW1lXzIwMjQgPSAiVlRMIEZyZWUiOwogICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBjYXNlICJ0YXBlX3JlZGlyZWN0b3Jfb2N0MTgiOgogICAgICAgICAgICAgIHByb2R1Y3RfbmFtZV8yMDI0ID0gIlRhcGUgUmVkaXJlY3RvciI7CiAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgIlN0YXJXaW5kIE5WTWUtb0YgSW5pdGlhdG9yIFRyaWFsIjoKICAgICAgICAgICAgICBwcm9kdWN0X25hbWVfMjAyNCA9ICJOVk1lLW9GIEluaXRpYXRvciI7CiAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgIlN0YXJXaW5kIE5WTWUtb0YgSW5pdGlhdG9yIjoKICAgICAgICAgICAgICBwcm9kdWN0X25hbWVfMjAyNCA9ICJOVk1lLW9GIEluaXRpYXRvciBGcmVlIjsKICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAidjJ2IjoKICAgICAgICAgICAgICBwcm9kdWN0X25hbWVfMjAyNCA9ICJWMlYgQ29udmVydGVyIjsKICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAiU3RhcldpbmQgVjJWIENvbnZlcnRlciI6CiAgICAgICAgICAgICAgcHJvZHVjdF9uYW1lXzIwMjQgPSAiUDJWIE1pZ3JhdG9yciI7CiAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgIlN0YXJXaW5kIEhDSSBFdmFsdWF0aW9uIEtpdCI6CiAgICAgICAgICAgICAgcHJvZHVjdF9uYW1lXzIwMjQgPSAiU3RhcldpbmQgSENJIEV2YWx1YXRpb24gS2l0IjsKICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAiZGVkdXBsaWNhdGlvbl9hbmFseXplciI6CiAgICAgICAgICAgICAgcHJvZHVjdF9uYW1lXzIwMjQgPSAiRGVkdXBsaWNhdGlvbiBBbmFseXplciI7CiAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgIlN0YXJXaW5kIHJQZXJmIjoKICAgICAgICAgICAgICBwcm9kdWN0X25hbWVfMjAyNCA9ICJSRE1BIFBlcmZvcm1hbmNlIEJlbmNobWFyayAoclBlcmYpIjsKICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAic2FuLW5hcy10cmlhbCI6CiAgICAgICAgICAgICAgcHJvZHVjdF9uYW1lXzIwMjQgPSAiU0FOICYgTkFTIjsKICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAic2FuLW5hcy1mcmVlIjoKICAgICAgICAgICAgICBwcm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8ZGl2IGNsYXNzPVwidGV4dFwiPlRoZSBsaWNlbnNlIGtleSBhbmQgdGhlIGRvd25sb2FkIGxpbmsgaGFzIGJlZW4gc2VudCB0byBlbWFpbDo8YnI+IDxiPiIgKyBtZS5lbWFpbCArICI8L2I+XG48YnI+PGJyPiBJZiB5b3UgZG8gbm90IGZpbmQgdGhlIGVtYWlsIGluIHlvdXIgaW5ib3gsIHBsZWFzZSBjaGVjayB5b3VyIHNwYW0vanVuayBmb2xkZXIuXG48L2Rpdj4iOwogICAgICAgICAgICB9CiAgICAgICAgICB9CiAgICAgICAgICAkKCcjZG93bmxvYWQtdGhhbmsteW91LmRvd25sb2FkLXRoYW5rLXlvdScpLnNob3coKTsKICAgICAgICAgICQoImh0bWwiKS5hbmltYXRlKHsKICAgICAgICAgICAgc2Nyb2xsVG9wOiAkKCIjZm9ybS1zZWN0aW9uIikub2Zmc2V0KCkudG9wCiAgICAgICAgICB9LCA0MDApOwogICAgICAgIH07CiAgICAgICAgZmFpbHVyZUNhbGxiYWNrID0gZnVuY3Rpb24oZGF0YSkgewogICAgICAgICAgbWUuY2hlY2tSZXF1ZXN0KGRhdGEpOwogICAgICAgIH07CiAgICAgICAgdGhpcy5wb2ludEZvcm1WYWxpZGF0aW9uKHRoaXMubW9kZWwsIHN1Y2Nlc3NDYWxsYmFjaywgZmFpbHVyZUNhbGxiYWNrKTsKICAgICAgfSwKICAgICAgZXJyb3JQcmlvcml0eTogZnVuY3Rpb24oZXJyb3IpIHsKICAgICAgICB2YXIgcmVzOwogICAgICAgIHJlcyA9IDA7CiAgICAgICAgc3dpdGNoIChlcnJvcikgewogICAgICAgICAgY2FzZSAndmFsaWRhdGVfcmVxdWlyZWQnOgogICAgICAgICAgICByZXMgPSAwOwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIGNhc2UgJ2Zha2Vfd29yZHMnOgogICAgICAgICAgICByZXMgPSA0OwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIGNhc2UgJ2xhdGluX2FuZF93aGl0ZXNwYWNlJzoKICAgICAgICAgICAgcmVzID0gNTsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICByZXMgPSAxMDsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHJlczsKICAgICAgfSwKICAgICAgc29ydEVycm9yczogZnVuY3Rpb24oZXJyb3JzKSB7CiAgICAgICAgdmFyIGtleSwgbWUsIG9iaiwgcmVzT2JqLCBzb3J0RnVuYzsKICAgICAgICBvYmogPSB7fTsKICAgICAgICBtZSA9IHRoaXM7CiAgICAgICAgZm9yIChrZXkgaW4gZXJyb3JzKSB7CiAgICAgICAgICBpZiAoa2V5ID09PSAnbGVuZ3RoJykgewogICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgIH0KICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGVycm9yc1trZXldKSkgewogICAgICAgICAgICBlcnJvcnNba2V5XS5mb3JFYWNoKGZ1bmN0aW9uKGVsZW1lbnQpIHsKICAgICAgICAgICAgICB2YXIgcHJpb3JpdHk7CiAgICAgICAgICAgICAgcHJpb3JpdHkgPSBtZS5lcnJvclByaW9yaXR5KGVsZW1lbnQpOwogICAgICAgICAgICAgIGlmIChvYmpba2V5XSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gb2JqW2tleV0ucHVzaCh7CiAgICAgICAgICAgICAgICAgICdydWxlJzogZWxlbWVudCwKICAgICAgICAgICAgICAgICAgJ3ByaW9yaXR5JzogcHJpb3JpdHkKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICByZXR1cm4gb2JqW2tleV0gPSBbCiAgICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAncnVsZSc6IGVsZW1lbnQsCiAgICAgICAgICAgICAgICAgICAgJ3ByaW9yaXR5JzogcHJpb3JpdHkKICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgXTsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pOwogICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBzb3J0RnVuYyA9IGZ1bmN0aW9uKGEsIGIpIHsKICAgICAgICAgIHZhciByZXM7CiAgICAgICAgICByZXMgPSAoK2EucHJpb3JpdHkpIC0gKCtiLnByaW9yaXR5KTsKICAgICAgICAgIHJldHVybiByZXM7CiAgICAgICAgfTsKICAgICAgICBmb3IgKGtleSBpbiBvYmopIHsKICAgICAgICAgIG9ialtrZXldLnNvcnQoc29ydEZ1bmMpOwogICAgICAgIH0KICAgICAgICByZXNPYmogPSB7CiAgICAgICAgICBsZW5ndGg6IDAKICAgICAgICB9OwogICAgICAgIGZvciAoa2V5IGluIG9iaikgewogICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoZXJyb3JzW2tleV0pKSB7CiAgICAgICAgICAgIG9ialtrZXldLmZvckVhY2goZnVuY3Rpb24oZWxlbWVudCkgewogICAgICAgICAgICAgIGlmIChyZXNPYmpba2V5XSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICByZXNPYmpba2V5XS5wdXNoKGVsZW1lbnQucnVsZSk7CiAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHJlc09ialtrZXldID0gW2VsZW1lbnQucnVsZV07CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIHJldHVybiByZXNPYmoubGVuZ3RoICs9IDE7CiAgICAgICAgICAgIH0pOwogICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gcmVzT2JqOwogICAgICB9LAogICAgICBjaGVja0Vycm9yczogZnVuY3Rpb24ocmVzKSB7CiAgICAgICAgdmFyIGVycm9ycywga2V5OwogICAgICAgIGVycm9ycyA9IHsKICAgICAgICAgIGxlbmd0aDogMAogICAgICAgIH07CiAgICAgICAgZm9yIChrZXkgaW4gcmVzLmRhdGEpIHsKICAgICAgICAgIGlmICgoZXJyb3JzW3Jlcy5kYXRhW2tleV1bJ2ZpZWxkJ11dICE9IG51bGwpKSB7CiAgICAgICAgICAgIGVycm9yc1tyZXMuZGF0YVtrZXldWydmaWVsZCddXS5wdXNoKHJlcy5kYXRhW2tleV1bJ3J1bGUnXSk7CiAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBlcnJvcnNbcmVzLmRhdGFba2V5XVsnZmllbGQnXV0gPSBbcmVzLmRhdGFba2V5XVsncnVsZSddXTsKICAgICAgICAgIH0KICAgICAgICAgIGVycm9ycy5sZW5ndGggKz0gMTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHRoaXMuc29ydEVycm9ycyhlcnJvcnMpOwogICAgICB9LAogICAgICBmaWx0ZXJFcnJvcnM6IGZ1bmN0aW9uKGVycm9ycykgewogICAgICAgIHZhciBrZXksIG9iajsKICAgICAgICBvYmogPSB7CiAgICAgICAgICBsZW5ndGg6IDAKICAgICAgICB9OwogICAgICAgIGZvciAoa2V5IGluIGVycm9ycykgewogICAgICAgICAgaWYgKGtleSA9PT0gJ2xlbmd0aCcpIHsKICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICB9CiAgICAgICAgICBvYmpba2V5XSA9IFtlcnJvcnNba2V5XVswXV07CiAgICAgICAgICBvYmoubGVuZ3RoICs9IDE7CiAgICAgICAgfQogICAgICAgIHJldHVybiBvYmo7CiAgICAgIH0sCiAgICAgIGNoZWNrUmVxdWVzdDogZnVuY3Rpb24ocmVzKSB7CiAgICAgICAgdmFyIGVycm9ycywgaywga2V5LCBteUNoZWNrLCBwaG9uZV9lcnJvcl9jb3VudDsKICAgICAgICBteUNoZWNrID0gdGhpcy5jaGVja0Vycm9ycyhyZXMpOwogICAgICAgIGVycm9ycyA9IHsKICAgICAgICAgIGxlbmd0aDogMAogICAgICAgIH07CiAgICAgICAgbXlDaGVjayA9IHRoaXMuZmlsdGVyRXJyb3JzKG15Q2hlY2spOwogICAgICAgIGVycm9ycyA9IG15Q2hlY2s7CiAgICAgICAgdGhpcy5lcnJvcnMyID0gZXJyb3JzOwogICAgICAgICQoJyNkb3dubG9hZF9mb3JtIHNwYW4uZXJyb3InKS5yZW1vdmUoKTsKICAgICAgICBpZiAoKGVycm9ycy5sZW5ndGggIT0gbnVsbCkgJiYgZXJyb3JzLmxlbmd0aCAhPT0gMCkgewogICAgICAgICAgcGhvbmVfZXJyb3JfY291bnQgPSAwOwogICAgICAgICAgZm9yIChrZXkgaW4gZXJyb3JzKSB7CiAgICAgICAgICAgIGlmIChrZXkgIT09ICdsZW5ndGgnKSB7CiAgICAgICAgICAgICAgc3dpdGNoIChrZXkpIHsKICAgICAgICAgICAgICAgIGNhc2UgJ2xpY2Vuc2UnOgogICAgICAgICAgICAgICAgY2FzZSAndXNlX3dpdGgnOgogICAgICAgICAgICAgICAgY2FzZSAnY291bnRyeSc6CiAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICAgZm9yIChrIGluIGVycm9yc1trZXldKSB7CiAgICAgICAgICAgICAgICAgICAgaWYgKGtleSA9PT0gJ252bWVfaG9zdHMnKSB7CiAgICAgICAgICAgICAgICAgICAgICAkKCcjZG93bmxvYWRfZm9ybSAjZG93bmxvYWRfJyArIGtleSArICcgKyBzcGFuLmJhcicpLmFmdGVyKCI8c3BhbiBjbGFzcz1cImVycm9yXCIgaWQ9XCJkb3dubG9hZF9udm1lX2hvc3RzX2Vycm9yXCI+IyBvZiBJbml0aWF0b3IgaG9zdHMgaXMgcmVxdWlyZWQ8L3NwYW4+Iik7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICQoJyNkb3dubG9hZF8nICsga2V5KS5hZGRDbGFzcygndmFsaWQtZXJyb3InKTsKICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGVycm9yc1trZXldW2tdKSB7CiAgICAgICAgICAgICAgICAgICAgICBjYXNlICd2YWxpZGF0ZV9yZXF1aXJlZCc6CiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoa2V5KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnZmlyc3RuYW1lJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICQoJyNkb3dubG9hZF9mb3JtICNkb3dubG9hZF8nICsga2V5KS5hZnRlcigiPHNwYW4gY2xhc3M9XCJlcnJvclwiPkZpcnN0IG5hbWUgaXMgcmVxdWlyZWQ8L3NwYW4+Iik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdsYXN0bmFtZSc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkKCcjZG93bmxvYWRfZm9ybSAjZG93bmxvYWRfJyArIGtleSkuYWZ0ZXIoIjxzcGFuIGNsYXNzPVwiZXJyb3JcIj5MYXN0IG5hbWUgaXMgcmVxdWlyZWQ8L3NwYW4+Iik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdlbWFpbCc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkKCcjZG93bmxvYWRfZm9ybSAjZG93bmxvYWRfJyArIGtleSkuYWZ0ZXIoIjxzcGFuIGNsYXNzPVwiZXJyb3JcIj5Db3Jwb3JhdGUgZW1haWwgaXMgcmVxdWlyZWQ8L3NwYW4+Iik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdjb21wYW55JzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICQoJyNkb3dubG9hZF9mb3JtICNkb3dubG9hZF8nICsga2V5KS5hZnRlcigiPHNwYW4gY2xhc3M9XCJlcnJvclwiPkNvbXBhbnkgaXMgcmVxdWlyZWQ8L3NwYW4+Iik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICd0aXRsZSc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkKCcjZG93bmxvYWRfZm9ybSAjZG93bmxvYWRfJyArIGtleSkuYWZ0ZXIoIjxzcGFuIGNsYXNzPVwiZXJyb3JcIj5Kb2IgdGl0bGUgaXMgcmVxdWlyZWQ8L3NwYW4+Iik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdwaG9uZTInOgogICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3Bob25lJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICQoJyNkb3dubG9hZF9mb3JtICNkb3dubG9hZF8nICsga2V5KS5hZnRlcigiPHNwYW4gY2xhc3M9XCJlcnJvclwiPlBob25lIG51bWJlciBpcyByZXF1aXJlZDwvc3Bhbj4iKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2NvdW50cnknOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgJCgnI2Rvd25sb2FkX2Zvcm0gI2Rvd25sb2FkXycgKyBrZXkpLmFmdGVyKCI8c3BhbiBjbGFzcz1cImVycm9yXCI+Q291bnRyeSBpcyByZXF1aXJlZDwvc3Bhbj4iKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgY2FzZSAnbnZtZV9ob3N0cyc6CiAgICAgICAgICAgICAgICAgICAgICAgICQoJyNkb3dubG9hZF9mb3JtICNkb3dubG9hZF9udm1lX2hvc3RzX3dyYXBwZXIgc3Bhbi5lcnJvcicpLnJlbW92ZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAkKCcjZG93bmxvYWRfZm9ybSAjZG93bmxvYWRfbnZtZV9ob3N0c193cmFwcGVyIC5iYXInKS5iZWZvcmUoIjx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oY2lfc3ViX3Byb2R1Y3Rfd3JhcHBlciBzcGFuLmVycm9yJykucmVtb3ZlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICQoJyNkb3dubG9hZF9mb3JtICNkb3dubG9hZF92aGNpX3N1Yl9wcm9kdWN0X3dyYXBwZXIgLmJhcicpLmJlZm9yZSgiPHNwYW4gY2xhc3M9XCJlcnJvclwiPlNlbGVjdCB1c2UgY2FzZTwvc3Bhbj4iKTsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICBjYXNlICdub19zYW5fbmFzX3N1Yl9wcm9kdWN0JzoKICAgICAgICAgICAgICAgICAgICAgICAgJCgnI2Rvd25sb2FkX2Zvcm0gI2Rvd25sb2FkX3N1Yl9wcm9kdWN0X3Nhbl9uYXNfd3JhcHBlciBzcGFuLmVycm9yJykucmVtb3ZlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICQoJyNkb3dubG9hZF9mb3JtICNkb3dubG9hZF9zdWJfcHJvZHVjdF9zYW5fbmFzX3dyYXBwZXIgLmJhcicpLmJlZm9yZSgiPHNwYW4gY2xhc3M9XCJlcnJvclwiPlNlbGVjdCB1c2UgY2FzZTwvc3Bhbj4iKTsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICBjYXNlICd0d29fbGF0aW5fYW5kX3doaXRlc3BhY2UnOgogICAgICAgICAgICAgICAgICAgICAgICAkKCcjZG93bmxvYWRfZm9ybSAjZG93bmxvYWRfJyArIGtleSkuYWZ0ZXIoIjxzcGFuIGNsYXNzPVwiZXJyb3JcIj5Pbmx5IExhdGluIGNoYXJhY3RlcnMgYXJlIGFsbG93ZWQ8L3NwYW4+Iik7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgY2FzZSAnbGF0aW5fYW5kX3doaXRlc3BhY2UnOgogICAgICAgICAgICAgICAgICAgICAgICAkKCcjZG93bmxvYWRfZm9ybSAjZG93bmxvYWRfJyArIGtleSkuYWZ0ZXIoIjxzcGFuIGNsYXNzPVwiZXJyb3JcIj5Pbmx5IExhdGluIGNoYXJhY3RlcnMgYXJlIGFsbG93ZWQ8L3NwYW4+Iik7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgY2FzZSAnZmlyc3RuYW1lX2xhc3RuYW1lX21hdGNoJzoKICAgICAgICAgICAgICAgICAgICAgICAgJCgnI2Rvd25sb2FkX2Zvcm0gI2Rvd25sb2FkXycgKyBrZXkpLmFmdGVyKCI8c3BhbiBjbGFzcz1cImVycm9yXCI+Rmlyc3QgbmFtZSBhbmQgTGFzdCBuYW1lIGNhbm5vdCBiZSBpZGVudGljYWw8L3NwYW4+Iik7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgY2FzZSAndmFsaWRhdGVfdmFsaWRfZW1haWwnOgogICAgICAgICAgICAgICAgICAgICAgICAkKCcjZG93bmxvYWRfZm9ybSAjZG93bmxvYWRfJyArIGtleSkuYWZ0ZXIoIjxzcGFuIGNsYXNzPVwiZXJyb3JcIj5JbnZhbGlkIGVtYWlsIGZvcm1hdDwvc3Bhbj4iKTsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICBjYXNlICdmYWtlX3dvcmRzJzoKICAgICAgICAgICAgICAgICAgICAgICAgJCgnI2Rvd25sb2FkX2Zvcm0gI2Rvd25sb2FkXycgKyBrZXkpLmFmdGVyKCI8c3BhbiBjbGFzcz1cImVycm9yXCI+UGxlYXNlIGVudGVyIHZhbGlkIGRhdGE8L3NwYW4+Iik7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgY2FzZSAncmVwZWF0X3N5bWJvbHMnOgogICAgICAgICAgICAgICAgICAgICAgICAkKCcjZG93bmxvYWRfZm9ybSAjZG93bmxvYWRfJyArIGtleSkuYWZ0ZXIoIjxzcGFuIGNsYXNzPVwiZXJyb3JcIj5JbnZhbGlkIG5hbWUgZm9ybWF0PC9zcGFuPiIpOwogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3B1YmxpY19lbWFpbCc6CiAgICAgICAgICAgICAgICAgICAgICAgICQoJyNkb3dubG9hZF9mb3JtICNkb3dubG9hZF8nICsga2V5KS5hZnRlcigiPHNwYW4gY2xhc3M9XCJlcnJvclwiPtChb21wYW55LWFmZmlsaWF0ZWQgZW1haWwgYWRkcmVzcyBpcyByZXF1aXJlZC4gSWYgeW91IGRvIG5vdCBoYXZlIG9uZSwgcmVhY2ggb3V0IHRvIDxhIGhyZWY9XCJtYWlsdG86c2FsZXNAc3RhcndpbmQuY29tXCI+c2FsZXNAc3RhcndpbmQuY29tPC9hPiBmb3IgaGVscDwvc3Bhbj4iKTsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICBjYXNlICdub3RfdmFsaWRfcGhvbmVfZm9ybWF0JzoKICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3Bob25lX251bWJlcic6CiAgICAgICAgICAgICAgICAgICAgICAgICQoJyNkb3dubG9hZF9mb3JtICNkb3dubG9hZF8nICsga2V5KS5hZnRlcigiPHNwYW4gY2xhc3M9XCJlcnJvclwiPkludmFsaWQgcGhvbmUgbnVtYmVyIGZvcm1hdDwvc3Bhbj4iKTsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgICAgICAgICAkKCcjZG93bmxvYWRfZm9ybSAjZG93bmxvYWRfJyArIGtleSkuYWZ0ZXIoIjxzcGFuIGNsYXNzPVwiZXJyb3JcIj5Vbmtub3duIGVycm9yIGZvciAiICsga2V5ICsgIjwvc3Bhbj4iKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9LAogICAgICBwb2ludEZvcm1WYWxpZGF0aW9uOiBmdW5jdGlvbihkYXRhLCBzdWNjZXNzQ2FsbGJhY2ssIGZhaWx1cmVDYWxsYmFjaykgewogICAgICAgIHZhciBrZXksIHBhcmFtcywgdXJsOwogICAgICAgIHBhcmFtcyA9IG5ldyBVUkxTZWFyY2hQYXJhbXMoKTsKICAgICAgICBmb3IgKGtleSBpbiBkYXRhKSB7CiAgICAgICAgICBwYXJhbXMuYXBwZW5kKGtleSwgZGF0YVtrZXldKTsKICAgICAgICB9CiAgICAgICAgaWYgKHR5cGVvZiBheGlvcyA9PT0gInVuZGVmaW5lZCIgfHwgYXhpb3MgPT09IG51bGwpIHsKICAgICAgICAgIHJldHVybjsKICAgICAgICB9CiAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignYm9keScpLmNsYXNzTGlzdC5hZGQoJ3ByZWxvYWRlcicpOwogICAgICAgIHVybCA9ICcvcG9pbnQtZm9ybS12YWxpZGF0aW9uLmpzJzsKICAgICAgICBheGlvcy5wb3N0KHVybCwgcGFyYW1zKS50aGVuKGZ1bmN0aW9uKGFyZykgewogICAgICAgICAgdmFyIGRhdGE7CiAgICAgICAgICBkYXRhID0gYXJnLmRhdGE7CiAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCdib2R5JykuY2xhc3NMaXN0LnJlbW92ZSgncHJlbG9hZGVyJyk7CiAgICAgICAgICBpZiAoKGRhdGEuc3VjY2VzcyAhPSBudWxsKSAmJiBkYXRhLnN1Y2Nlc3MpIHsKICAgICAgICAgICAgc3VjY2Vzc0NhbGxiYWNrKCdvaycpOwogICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgZmFpbHVyZUNhbGxiYWNrKGRhdGEpOwogICAgICAgICAgfQogICAgICAgIH0pOwogICAgICB9CiAgICB9CiAgfSk7Cgp9KS5jYWxsKHRoaXMpOwoKLy8jIHNvdXJjZU1hcHBpbmdVUkw9ZG93bmxvYWQuanMubWFwCg==
6 ms
underscore-min.js
44 ms
backbone-min.js
56 ms
backbone-validation-min.js
66 ms
Backbone.ModelBinder.js
61 ms
DscOmxZMgLictXSokL2k7CiAgICAgICAgICB0aGlzLm1vZGVsLmZpcnN0bmFtZV9mciA9IHZhbGlkQ2hhcmFjdGVyc1JlZ2V4cC50ZXN0KHRoaXMuZmlyc3RuYW1lKTsKICAgICAgICAgIHRoaXMubW9kZWwubGFzdG5hbWVfZnIgPSB2YWxpZENoYXJhY3RlcnNSZWdleHAudGVzdCh0aGlzLmxhc3RuYW1lKTsKICAgICAgICAgIHRoaXMubW9kZWwudGl0bGVfZnIgPSB2YWxpZENoYXJhY3RlcnNSZWdleHAudGVzdCh0aGlzLnRpdGxlKTsKICAgICAgICAgIHJldHVybiB0aGlzLm1vZGVsLmNvbXBhbnlfZnIgPSB2YWxpZENoYXJhY3RlcnNSZWdleHAudGVzdCh0aGlzLmNvbXBhbnkpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgaXRpUGhvbmVFcnJvcjogZnVuY3Rpb24oKSB7CiAgICAgICAgdmFyIGVsOwogICAgICAgIGVsID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3Bob25lXzIwMjNfcXVvdGUnKTsKICAgICAgICBpZiAoZWwgPT0gbnVsbCkgewogICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgIH0KICAgICAgICBlbC5jbGFzc0xpc3QucmVtb3ZlKCdmaWVsZC1lcnJvcicpOwogICAgICAgIGlmICghdGhpcy5pdGlOdW1iZXJFcnJvcikgewogICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgIH0KICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgfSwKICAgICAgZXJyb3JQcmlvcml0eTogZnVuY3Rpb24oZXJyb3IpIHsKICAgICAgICB2YXIgcmVzOwogICAgICAgIHJlcyA9IDA7CiAgICAgICAgc3dpdGNoIChlcnJvcikgewogICAgICAgICAgY2FzZSAndmFsaWRhdGVfcmVxdWlyZWQnOgogICAgICAgICAgICByZXMgPSAwOwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIGNhc2UgJ2Zha2Vfd29yZHMnOgogICAgICAgICAgICByZXMgPSA0OwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIGNhc2UgJ2xhdGluX2FuZF93aGl0ZXNwYWNlJzoKICAgICAgICAgICAgcmVzID0gNTsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICByZXMgPSAxMDsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHJlczsKICAgICAgfSwKICAgICAgc29ydEVycm9yczogZnVuY3Rpb24oZXJyb3JzKSB7CiAgICAgICAgdmFyIGtleSwgbWUsIG9iaiwgcmVzT2JqLCBzb3J0RnVuYzsKICAgICAgICBvYmogPSB7fTsKICAgICAgICBtZSA9IHRoaXM7CiAgICAgICAgZm9yIChrZXkgaW4gZXJyb3JzKSB7CiAgICAgICAgICBpZiAoa2V5ID09PSAnbGVuZ3RoJykgewogICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgIH0KICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGVycm9yc1trZXldKSkgewogICAgICAgICAgICBlcnJvcnNba2V5XS5mb3JFYWNoKGZ1bmN0aW9uKGVsZW1lbnQpIHsKICAgICAgICAgICAgICB2YXIgcHJpb3JpdHk7CiAgICAgICAgICAgICAgcHJpb3JpdHkgPSBtZS5lcnJvclByaW9yaXR5KGVsZW1lbnQpOwogICAgICAgICAgICAgIGlmIChvYmpba2V5XSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gb2JqW2tleV0ucHVzaCh7CiAgICAgICAgICAgICAgICAgICdydWxlJzogZWxlbWVudCwKICAgICAgICAgICAgICAgICAgJ3ByaW9yaXR5JzogcHJpb3JpdHkKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICByZXR1cm4gb2JqW2tleV0gPSBbCiAgICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAncnVsZSc6IGVsZW1lbnQsCiAgICAgICAgICAgICAgICAgICAgJ3ByaW9yaXR5JzogcHJpb3JpdHkKICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgXTsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pOwogICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBzb3J0RnVuYyA9IGZ1bmN0aW9uKGEsIGIpIHsKICAgICAgICAgIHZhciByZXM7CiAgICAgICAgICByZXMgPSAoK2EucHJpb3JpdHkpIC0gKCtiLnByaW9yaXR5KTsKICAgICAgICAgIHJldHVybiByZXM7CiAgICAgICAgfTsKICAgICAgICBmb3IgKGtleSBpbiBvYmopIHsKICAgICAgICAgIG9ialtrZXldLnNvcnQoc29ydEZ1bmMpOwogICAgICAgIH0KICAgICAgICByZXNPYmogPSB7CiAgICAgICAgICBsZW5ndGg6IDAKICAgICAgICB9OwogICAgICAgIGZvciAoa2V5IGluIG9iaikgewogICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoZXJyb3JzW2tleV0pKSB7CiAgICAgICAgICAgIG9ialtrZXldLmZvckVhY2goZnVuY3Rpb24oZWxlbWVudCkgewogICAgICAgICAgICAgIGlmIChyZXNPYmpba2V5XSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICByZXNPYmpba2V5XS5wdXNoKGVsZW1lbnQucnVsZSk7CiAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHJlc09ialtrZXldID0gW2VsZW1lbnQucnVsZV07CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIHJldHVybiByZXNPYmoubGVuZ3RoICs9IDE7CiAgICAgICAgICAgIH0pOwogICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gcmVzT2JqOwogICAgICB9LAogICAgICBmaWx0ZXJFcnJvcnM6IGZ1bmN0aW9uKGVycm9ycykgewogICAgICAgIHZhciBrZXksIG9iajsKICAgICAgICBvYmogPSB7CiAgICAgICAgICBsZW5ndGg6IDAKICAgICAgICB9OwogICAgICAgIGZvciAoa2V5IGluIGVycm9ycykgewogICAgICAgICAgaWYgKGtleSA9PT0gJ2xlbmd0aCcpIHsKICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICB9CiAgICAgICAgICBvYmpba2V5XSA9IFtlcnJvcnNba2V5XVswXV07CiAgICAgICAgICBvYmoubGVuZ3RoICs9IDE7CiAgICAgICAgfQogICAgICAgIHJldHVybiBvYmo7CiAgICAgIH0sCiAgICAgIGNoZWNrRXJyb3JzOiBmdW5jdGlvbihyZXMpIHsKICAgICAgICB2YXIgZXJyb3JzLCBrZXk7CiAgICAgICAgZXJyb3JzID0gewogICAgICAgICAgbGVuZ3RoOiAwCiAgICAgICAgfTsKICAgICAgICBmb3IgKGtleSBpbiByZXMuZGF0YSkgewogICAgICAgICAgaWYgKChlcnJvcnNbcmVzLmRhdGFba2V5XVsnZmllbGQnXV0gIT0gbnVsbCkpIHsKICAgICAgICAgICAgZXJyb3JzW3Jlcy5kYXRhW2tleV1bJ2ZpZWxkJ11dLnB1c2gocmVzLmRhdGFba2V5XVsncnVsZSddKTsKICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGVycm9yc1tyZXMuZGF0YVtrZXldWydmaWVsZCddXSA9IFtyZXMuZGF0YVtrZXldWydydWxlJ11dOwogICAgICAgICAgfQogICAgICAgICAgZXJyb3JzLmxlbmd0aCArPSAxOwogICAgICAgIH0KICAgICAgICByZXR1cm4gZXJyb3JzOwogICAgICB9LAogICAgICBjaGVja1JlcXVlc3Q6IGZ1bmN0aW9uKHJlcykgewogICAgICAgIHZhciBlcnJvcnMs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XQnLAogICAgICAgICAgICAgICdsYXN0bmFtZSc6ICdJbnZhbGlkIG5hbWUgZm9ybWF0JywKICAgICAgICAgICAgICAndGl0bGUnOiAnSW52YWxpZCBqb2IgdGl0bGUgZm9ybWF0JwogICAgICAgICAgICB9CiAgICAgICAgICB9OwogICAgICAgICAgdmFsaWRlX21lc3NhZ2VbJ2ZyJ10gPSB7CiAgICAgICAgICAgICd2YWxpZGF0ZV9yZXF1aXJlZCc6IHsKICAgICAgICAgICAgICAnZmlyc3RuYW1lJzogJ0xlIHByw6lub20gZXN0IHJlcXVpcycsCiAgICAgICAgICAgICAgJ2xhc3RuYW1lJzogJ0xlIG5vbSBlc3QgcmVxdWlzJywKICAgICAgICAgICAgICAnZW1haWwnOiAnVW5lIGFkcmVzc2UgZS1tYWlsIGRcJ2VudHJlcHJpc2UgZXN0IHJlcXVpc2UnLAogICAgICAgICAgICAgICdjb21wYW55JzogJ0xlIG5vbSBkZSBsXCdlbnRyZXByaXNlIGVzdCByZXF1aXMnLAogICAgICAgICAgICAgICd0aXRsZSc6ICdMZSB0aXRyZSBkZSBwb3N0ZSBlc3QgcmVxdWlzJywKICAgICAgICAgICAgICAncGhvbmUnOiAnTGUgbnVtw6lybyBkZSB0w6lsw6lwaG9uZSBlc3QgcmVxdWlzJywKICAgICAgICAgICAgICAnY291bnRyeSc6ICdMZSBub20gZHUgcGF5cyBlc3QgcmVxdWlzJwogICAgICAgICAgICB9LAogICAgICAgICAgICAndHdvX2xhdGluX2FuZF93aGl0ZXNwYWNlJzogJ1NldWxzIGxlcyBjYXJhY3TDqHJlcyBsYXRpbnMgc29udCBhdXRvcmlzw6lzJywKICAgICAgICAgICAgJ2ZpcnN0bmFtZV9sYXN0bmFtZV9tYXRjaCc6ICdMZSBwcsOpbm9tIGV0IGxlIG5vbSBkZSBmYW1pbGxlIG5lIHBldXZlbnQgcGFzIMOqdHJlIGlkZW50aXF1ZXMnLAogICAgICAgICAgICAnbGF0aW5fYW5kX3doaXRlc3BhY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OwogICAgICAgICAgZm9yIChrZXkgaW4gZXJyb3JzKSB7CiAgICAgICAgICAgIGlmIChrZXkgIT09ICdsZW5ndGgnKSB7CiAgICAgICAgICAgICAgc3dpdGNoIChrZXkpIHsKICAgICAgICAgICAgICAgIGNhc2UgJ3Byb2R1Y3QnOgogICAgICAgICAgICAgICAgY2FzZSAnY291bnRyeSc6CiAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICAgZm9yIChrIGluIGVycm9yc1trZXldKSB7CiAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChlcnJvcnNba2V5XVtrXSkgewogICAgICAgICAgICAgICAgICAgICAgY2FzZSAndmFsaWRhdGVfcmVxdWlyZWQnOgogICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGtleSkgewogICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2ZpcnN0bmFtZSc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUVycm9yKCcjZ2V0X3F1b3RlX2Zvcm0gI3F1b3RlXycgKyBrZXksIHZhbGlkZV9tZXNzYWdlW3RoaXMubGFuZ3VhZ2VdWyd2YWxpZGF0ZV9yZXF1aXJlZCddWydmaXJzdG5hbWUnXSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdsYXN0bmFtZSc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUVycm9yKCcjZ2V0X3F1b3RlX2Zvcm0gI3F1b3RlXycgKyBrZXksIHZhbGlkZV9tZXNzYWdlW3RoaXMubGFuZ3VhZ2VdWyd2YWxpZGF0ZV9yZXF1aXJlZCddWydsYXN0bmFtZSddKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2VtYWlsJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRXJyb3IoJyNnZXRfcXVvdGVfZm9ybSAjcXVvdGVfJyArIGtleSwgdmFsaWRlX21lc3NhZ2VbdGhpcy5sYW5ndWFnZV1bJ3ZhbGlkYXRlX3JlcXVpcmVkJ11bJ2VtYWlsJ10pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnY29tcGFueSc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUVycm9yKCcjZ2V0X3F1b3RlX2Zvcm0gI3F1b3RlXycgKyBrZXksIHZhbGlkZV9tZXNzYWdlW3RoaXMubGFuZ3VhZ2VdWyd2YWxpZGF0ZV9yZXF1aXJlZCddWydjb21wYW55J10pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAndGl0bGUnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVFcnJvcignI2dldF9xdW90ZV9mb3JtICNxdW90ZV8nICsga2V5LCB2YWxpZGVfbWVzc2FnZVt0aGlzLmxhbmd1YWdlXVsndmFsaWRhdGVfcmVxdWlyZWQnXVsndGl0bGUnXSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdwaG9uZTInOgogICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3Bob25lJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRXJyb3IoJyNnZXRfcXVvdGVfZm9ybSAjcXVvdGVfcGhvbmUyJywgdmFsaWRlX21lc3NhZ2VbdGhpcy5sYW5ndWFnZV1bJ3ZhbGlkYXRlX3JlcXVpcmVkJ11bJ3Bob25lJ10pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnY291bnRyeSc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUVycm9yKCcjZ2V0X3F1b3RlX2Zvcm0gI3F1b3RlXycgKyBrZXksIHZhbGlkZV9tZXNzYWdlW3RoaXMubGFuZ3VhZ2VdWyd2YWxpZGF0ZV9yZXF1aXJlZCddWydjb3VudHJ5J10pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICBjYXNlICd0d29fbGF0aW5fYW5kX3doaXRlc3BhY2UnOgogICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUVycm9yKCcjZ2V0X3F1b3RlX2Zvcm0gI3F1b3RlXycgKyBrZXksIHZhbGlkZV9tZXNzYWdlW3RoaXMubGFuZ3VhZ2VdWyd0d29fbGF0aW5fYW5kX3doaXRlc3BhY2UnXSk7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgY2FzZSAnZmlyc3RuYW1lX2xhc3RuYW1lX21hdGNoJzoKICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVFcnJvcignI2dldF9xdW90ZV9mb3JtICNxdW90ZV8nICsga2V5LCB2YWxpZGVfbWVzc2FnZVt0aGlzLmxhbmd1YWdlXVsnZmlyc3RuYW1lX2xhc3RuYW1lX21hdGNoJ10pOwogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2xhdGluX2FuZF93aGl0ZXNwYWNlJzoKICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVFcnJvcignI2dldF9xdW90ZV9mb3JtICNxdW90ZV8nICsga2V5LCB2YWxpZGVfbWVzc2FnZVt0aGlzLmxhbmd1YWdlXVsnbGF0aW5fYW5kX3doaXRlc3BhY2UnXSk7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgY2FzZSAncHVibGljX2VtYWlsJzoKICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVFcnJvcignI2dldF9xdW90ZV9mb3JtICNxdW90ZV8nICsga2V5LCB2YWxpZGVfbWVzc2FnZVt0aGlzLmxhbmd1YWdlXVsncHVibGljX2VtYWlsJ10pOwogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2Zha2Vfd29yZHMnOgogICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGtleSkgewogICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2ZpcnN0bmFtZSc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnbGFzdG5hbWUnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVFcnJvcignI2dldF9xdW90ZV9mb3JtICNxdW90ZV8nICsga2V5LCB2YWxpZGVfbWVzc2FnZVt0aGlzLmxhbmd1YWdlXVsnZmFrZV93b3JkcyddWydmaXJzdG5hbWUnXSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICd0aXRsZSc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUVycm9yKCcjZ2V0X3F1b3RlX2Zvcm0gI3F1b3RlXycgKyBrZXksIHZhbGlkZV9tZXNzYWdlW3RoaXMubGFuZ3VhZ2VdWydmYWtlX3dvcmRzJ11bJ3RpdGxlJ10pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICBjYXNlICdjaG9vc2VfbGljZW5zZV92YWx1ZSc6CiAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRXJyb3IoJyNnZXRfcXVvdGVfZm9ybSAjcXVvdGVfJyArIGtleSwgdmFsaWRlX21lc3NhZ2VbdGhpcy5sYW5ndWFnZV1bJ2Nob29zZV9saWNlbnNlX3ZhbHVlJ10pOwogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3JlcGVhdF9zeW1ib2xzJzoKICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVFcnJvcignI2dldF9xdW90ZV9mb3JtICNxdW90ZV8nICsga2V5LCB2YWxpZGVfbWVzc2FnZVt0aGlzLmxhbmd1YWdlXVsncmVwZWF0X3N5bWJvbHMnXSk7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgY2FzZSAnbm90X3ZhbGlkX3Bob25lX2Zvcm1hdCc6CiAgICAgICAgICAgICAgICAgICAgICBjYXNlICdwaG9uZV9udW1iZXInOgogICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUVycm9yKCcjZ2V0X3F1b3RlX2Zvcm0gI3F1b3RlXycgKyBrZXksIHZhbGlkZV9tZXNzYWdlW3RoaXMubGFuZ3VhZ2VdWydub3RfdmFsaWRfcGhvbmVfZm9ybWF0J10pOwogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3ZhbGlkYXRlX3ZhbGlkX2VtYWlsJzoKICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVFcnJvcignI2dldF9xdW90ZV9mb3JtICNxdW90ZV8nICsga2V5LCB2YWxpZGVfbWVzc2FnZVt0aGlzLmxhbmd1YWdlXVsndmFsaWRhdGVfdmFsaWRfZW1haWwnXSk7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoICh0aGlzLmxhbmd1YWdlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnZnInOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVFcnJvcignI2dldF9xdW90ZV9mb3JtICNxdW90ZV8nICsga2V5LCAiQXV0cmVzIGNhcyBwb3VyICIgKyBrZXkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRXJyb3IoJyNnZXRfcXVvdGVfZm9ybSAjcXVvdGVfJyArIGtleSwgIlVua25vd24gZXJyb3IgZm9yICIgKyBrZXkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgfQogICAgICAgIH0KICAgICAgfSwKICAgICAgc3VibWl0Rm9ybTogZnVuY3Rpb24oZXZlbnQpIHsKICAgICAgICB2YXIgY2hlY2tfbWUsIGNoZWNrX21lX2xhYmVsLCBmYWlsdXJlQ2FsbGJhY2ssIG1lLCBzdWNjZXNzQ2FsbGJhY2s7CiAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTsKICAgICAgICBjaGVja19tZSA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdxdW90ZV9jaGVja19tZScpOwogICAgICAgIGNoZWNrX21lX2xhYmVsID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ3F1b3RlX2NoZWNrbWFyaycpOwogICAgICAgIGlmICh0aGlzLmlzRXVyb1pvbmUpIHsKICAgICAgICAgIGlmICghY2hlY2tfbWUuY2hlY2tlZCkgewogICAgICAgICAgICB0aGlzLnByaXZhY3lQb2xpY3lFcnJvciA9IHRydWU7CiAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICB0aGlzLnByaXZhY3lQb2xpY3lFcnJvciA9IGZhbHNlOwogICAgICAgICAgfQogICAgICAgICAgaWYgKCFjaGVja19tZS5jaGVja2VkKSB7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgdGhpcy5pdGlOdW1iZXJFcnJvciA9IGZhbHNlOwogICAgICAgIGlmICh0aGlzLml0aUluc3RhbmNlKCcjcXVvdGVfcGhvbmUyJykgIT0gbnVsbCkgewogICAgICAgICAgdGhpcy5pc0l0aVZhbGlkUGhvbmUoJyNxdW90ZV9waG9uZTInKTsKICAgICAgICB9CiAgICAgICAgbWUgPSB0aGlzOwogICAgICAgIHRoaXMuc2V0TW9kZWwoKTsKICAgICAgICBzdWNjZXNzQ2FsbGJhY2sgPSBmdW5jdGlvbihkYXRhKSB7CiAgICAgICAgICB2YXIgb3B0aW9uczsKICAgICAgICAgIG1lLmNoZWNrUmVxdWVzdChkYXRhKTsKICAgICAgICAgICQoIiNnZXRfcXVvdGVfZm9ybSIpLmhpZGUoKTsKICAgICAgICAgICQoJyNxdW90ZS10aGFuay15b3UucXVvdGUtdGhhbmsteW91Jykuc2hvdygpOwogICAgICAgICAgY2hlY2tfbWVfbGFiZWwgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgncXVvdGVfY2hlY2ttYXJrJyk7CiAgICAgICAgICBjaGVja19tZV9sYWJlbC5jbGFzc0xpc3QucmVtb3ZlKCdlcnJvcicpOwogICAgICAgICAgY2hlY2tfbWUgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgncXVvdGVfY2hlY2tfbWUnKTsKICAgICAgICAgIGNoZWNrX21lLmNoZWNrZWQgPSBmYWxzZTsKICAgICAgICAgIG9wdGlvbnMgPSB7fTsKICAgICAgICAgIG9wdGlvbnMuYWN0aW9uID0gJ0dldCBQcmljaW5nJzsKICAgICAgICAgIG9wdGlvbnMubG9jYXRpb24gPSB3aW5kb3cubG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pb24gPSAndjIwMjMnOwogICAgICAgICAgICByZXR1cm4gd2luZG93LmludGxUZWxJbnB1dChwaG9uZUVsLCB7CiAgICAgICAgICAgICAgdXRpbHNTY3JpcHQ6IHV0aWxzU2NyaXB0LAogICAgICAgICAgICAgIHNlcGFyYXRlRGlhbENvZGU6IHRydWUKICAgICAgICAgICAgfSkucHJvbWlzZS50aGVuKGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgIG1lLnNldENsZWFuUGhvbmVNb2RlbCgncXVvdGUnKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9LAogICAgICBpdGlJbnN0YW5jZTogZnVuY3Rpb24oc2VsZWN0b3IpIHsKICAgICAgICB2YXIgaXRpLCBwaG9uZUVsOwogICAgICAgIGlmICh3aW5kb3cuaW50bFRlbElucHV0ID09IG51bGwpIHsKICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgIH0KICAgICAgICBwaG9uZUVsID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcihzZWxlY3Rvcik7CiAgICAgICAgaWYgKHBob25lRWwgPT0gbnVsbCkgewogICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgfQogICAgICAgIGl0aSA9IHdpbmRvdy5pbnRsVGVsSW5wdXRHbG9iYWxzLmdldEluc3RhbmNlKHBob25lRWwpOwogICAgICAgIGlmIChpdGkgPT0gbnVsbCkgewogICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgfQogICAgICAgIHJldHVybiBpdGk7CiAgICAgIH0sCiAgICAgIGdldElTTzogZnVuY3Rpb24obmV3Q291bnRyeSkgewogICAgICAgIHZhciBtZSwgdXJsOwogICAgICAgIGlmICh3aW5kb3cuaW50bFRlbElucHV0ID09IG51bGwpIHsKICAgICAgICAgIHJldHVybjsKICAgICAgICB9CiAgICAgICAgdXJsID0gJ2h0dHBzOi8vd3d3LnN0YXJ3aW5kc29mdHdhcmUuY29tL2dlb2lwLWRldGFpbC5qcyc7CiAgICAgICAgbWUgPSB0aGlzOwogICAgICAgICQuYWpheCh7CiAgICAgICAgICB1cmw6IHVybCwKICAgICAgICAgIHR5cGU6ICJQT1NUIiwKICAgICAgICAgIGRhdGE6IHsKICAgICAgICAgICAgY291bnRyeTogbmV3Q291bnRyeQogICAgICAgICAgfSwKICAgICAgICAgIGRhdGFUeXBlOiAnanNvbicsCiAgICAgICAgICBzdWNjZXNzOiBmdW5jdGlvbihyZXNwb25zZSkgewogICAgICAgICAgICB2YXIgaXRpLCBwaG9uZUNvdW50cnk7CiAgICAgICAgICAgIGlmICgocmVzcG9uc2Uuc3RhdHVzICE9IG51bGwpICYmIHJlc3BvbnNlLnN0YXR1cyA9PT0gdHJ1ZSAmJiAocmVzcG9uc2UudHlwZSAhPSBudWxsKSAmJiAocmVzcG9uc2UudHlwZSA9PT0gJ2NvdW50cnktZGV0YWlsJykpIHsKICAgICAgICAgICAgICBpZiAocmVzcG9uc2UuaXNvQ29kZSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICBtZS5pc29Db2RlID0gcmVzcG9uc2UuaXNvQ29kZTsKICAgICAgICAgICAgICAgIGl0aSA9IG1lLml0aUluc3RhbmNlKCcjcXVvdGVfcGhvbmUyJyk7CiAgICAgICAgICAgICAgICBpZiAoaXRpID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgcGhvbmVDb3VudHJ5ID0gbWUuZ2V0Q29va2llVmFsdWUoJ3Bob25lQ291bnRyeScpOwogICAgICAgICAgICAgICAgaWYgKChwaG9uZUNvdW50cnkgIT0gbnVsbCkgJiYgcGhvbmVDb3VudHJ5ICE9PSAnJykgewogICAgICAgICAgICAgICAgICBpdGkuc2V0Q291bnRyeShwaG9uZUNvdW50cnkpOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgaXRpLnNldENvdW50cnkobWUuaXNvQ29kZSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICB9CiAgICAgICAgfSk7CiAgICAgIH0sCiAgICAgIGlzSXRpVmFsaWRQaG9uZTogZnVuY3Rpb24oc2VsZWN0b3IpIHsKICAgICAgICB2YXIgaXRpLCByZXM7CiAgICAgICAgaWYgKHdpbmRvdy5pbnRsVGVsSW5wdXQgPT0gbnVsbCkgewogICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgIH0KICAgICAgICByZXMgPSBmYWxzZTsKICAgICAgICBpdGkgPSB0aGlzLml0aUluc3RhbmNlKHNlbGVjdG9yKTsKICAgICAgICBpZiAoaXRpID09IG51bGwpIHsKICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICB9CiAgICAgICAgaWYgKGl0aS5pc1ZhbGlkTnVtYmVyKCkpIHsKICAgICAgICAgIHJlcyA9IHRydWU7CiAgICAgICAgICB0aGlzLnZhbGlkUGhvbmUgPSB0cnVlOwogICAgICAgICAgdGhpcy5waG9uZVN0YW5kYXJ0ID0gaXRpLmdldE51bWJlcihpbnRsVGVsSW5wdXRVdGlscy5udW1iZXJGb3JtYXQuRTE2NCk7CiAgICAgICAgICB0aGlzLnBob25lRXh0ID0gaXRpLmdldEV4dGVuc2lvbigpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICB0aGlzLnZhbGlkUGhvbmUgPSBmYWxzZTsKICAgICAgICAgIHRoaXMucGhvbmVTdGFuZGFydCA9ICcnOwogICAgICAgICAgdGhpcy5waG9uZUV4dCA9ICcnOwogICAgICAgIH0KICAgICAgICB0aGlzLnBob25lQ291bnRyeSA9IGl0aS5nZXRTZWxlY3RlZENvdW50cnlEYXRhKCkuaXNvMjsKICAgICAgICByZXR1cm4gcmVzOwogICAgICB9LAogICAgICBwb2ludEZvcm1WYWxpZGF0aW9uOiBmdW5jdGlvbihkYXRhLCBzdWNjZXNzQ2FsbGJhY2ssIGZhaWx1cmVDYWxsYmFjaykgewogICAgICAgIHZhciBrZXksIHBhcmFtcywgdXJsOwogICAgICAgIHBhcmFtcyA9IG5ldyBVUkxTZWFyY2hQYXJhbXMoKTsKICAgICAgICBmb3IgKGtleSBpbiBkYXRhKSB7CiAgICAgICAgICBwYXJhbXMuYXBwZW5kKGtleSwgZGF0YVtrZXldKTsKICAgICAgICB9CiAgICAgICAgaWYgKHR5cGVvZiBheGlvcyA9PT0gInVuZGVmaW5lZCIgfHwgYXhpb3MgPT09IG51bGwpIHsKICAgICAgICAgIHJldHVybjsKICAgICAgICB9CiAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignYm9keScpLmNsYXNzTGlzdC5hZGQoJ3ByZWxvYWRlcicpOwogICAgICAgIHVybCA9ICcvcG9pbnQtZm9ybS12YWxpZGF0aW9uLmpzJzsKICAgICAgICBheGlvcy5wb3N0KHVybCwgcGFyYW1zKS50aGVuKGZ1bmN0aW9uKGFyZykgewogICAgICAgICAgdmFyIGRhdGE7CiAgICAgICAgICBkYXRhID0gYXJnLmRhdGE7CiAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCdib2R5JykuY2xhc3NMaXN0LnJlbW92ZSgncHJlbG9hZGVyJyk7CiAgICAgICAgICBpZiAoKGRhdGEuc3VjY2VzcyAhPSBudWxsKSAmJiBkYXRhLnN1Y2Nlc3MpIHsKICAgICAgICAgICAgc3VjY2Vzc0NhbGxiYWNrKCdvaycpOwogICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgZmFpbHVyZUNhbGxiYWNrKGRhdGEpOwogICAgICAgICAgfQogICAgICAgIH0pOwogICAgICB9CiAgICB9CiAgfSk7Cgp9KS5jYWxsKHRoaXMpOwoKLy8jIHNvdXJjZU1hcHBpbmdVUkw9cXVvdGUuanMubWFwCg==
4 ms
javascript;base64,Ly8gR2VuZXJhdGVkIGJ5IENvZmZlZVNjcmlwdCAxLjEyLjcKKGZ1bmN0aW9uKCkgewogIHZhciBzdHJpcCwgd3JpdGVFcnJ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ICAgY29tbWVudHM6ICcnLAogICAgICAgIGNoZWNrOiBmYWxzZSwKICAgICAgICBwbm9uZVN0YW5kYXJ0OiAnJywKICAgICAgICBwaG9uZUV4dDogJycsCiAgICAgICAgaXNvQ29kZTogJycsCiAgICAgICAgcGhvbmVWZXJzaW9uOiAnJywKICAgICAgICB2YWxpZFBob25lOiBmYWxzZSwKICAgICAgICBmb3JtVHlwZTogJ2RlbW8nLAogICAgICAgIHBob25lQ291bnRyeTogJycsCiAgICAgICAgbGFuZ3VhZ2U6ICdlbicsCiAgICAgICAgZXJyb3JzOiB7CiAgICAgICAgICBmaXJzdG5hbWU6IFtdLAogICAgICAgICAgbGFzdG5hbWU6IFtdLAogICAgICAgICAgY29tcGFueTogW10sCiAgICAgICAgICBlbWFpbDogW10sCiAgICAgICAgICB0aXRsZTogW10sCiAgICAgICAgICBwaG9uZTogW10sCiAgICAgICAgICBjb3VudHJ5OiBbXQogICAgICAgIH0sCiAgICAgICAgZXJyb3JzMjoge30sCiAgICAgICAgaXRpTnVtYmVyRXJyb3I6IGZhbHNlLAogICAgICAgIHByaXZhY3lQb2xpY3lFcnJvcjogZmFsc2UsCiAgICAgICAgYmVmb3JlVXBkYXRlQ291bnRlcjogMAogICAgICB9OwogICAgfSwKICAgIGNvbXB1dGVkOiB7CiAgICAgIGlzRXVyb1pvbmU6IGZ1bmN0aW9uKCkgewogICAgICAgIHZhciByZWY7CiAgICAgICAgaWYgKHdpbmRvdy5ldXJvcGVfem9uZV9jb3VudHJ5ID09IG51bGwpIHsKICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgIH0KICAgICAgICBpZiAoKHJlZiA9IHRoaXMuY291bnRyeSwgaW5kZXhPZi5jYWxsKHdpbmRvdy5ldXJvcGVfem9uZV9jb3VudHJ5LCByZWYpID49IDApKSB7CiAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgIH0KICAgICAgfSwKICAgICAgRmlyc3RuYW1lRXJyb3JDbGFzczogZnVuY3Rpb24oKSB7CiAgICAgICAgdmFyIHJlczsKICAgICAgICByZXMgPSBmYWxzZTsKICAgICAgICBpZiAoKHRoaXMuZXJyb3JzMi5maXJzdG5hbWUgIT0gbnVsbCkgfHwgKCh0aGlzLmVycm9yczIubGFzdG5hbWUgIT0gbnVsbCkgJiYgKHRoaXMuZXJyb3JzMi5sYXN0bmFtZVswXSA9PT0gJ2ZpcnN0bmFtZV9sYXN0bmFtZV9tYXRjaCcpKSkgewogICAgICAgICAgcmVzID0gdHJ1ZTsKICAgICAgICB9CiAgICAgICAgaWYgKHRoaXMuZXJyb3JzMi5maXJzdG5hbWUgIT0gbnVsbCkgewogICAgICAgICAgcmVzID0gdHJ1ZTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHJlczsKICAgICAgfSwKICAgICAgTGFzdG5hbWVFcnJvckNsYXNzOiBmdW5jdGlvbigpIHsKICAgICAgICB2YXIgcmVzOwogICAgICAgIHJlcyA9IGZhbHNlOwogICAgICAgIGlmICh0aGlzLmVycm9yczIubGFzdG5hbWUgIT0gbnVsbCkgewogICAgICAgICAgcmVzID0gdHJ1ZTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHJlczsKICAgICAgfSwKICAgICAgRW1haWxFcnJvckNsYXNzOiBmdW5jdGlvbigpIHsKICAgICAgICB2YXIgcmVzOwogICAgICAgIHJlcyA9IGZhbHNlOwogICAgICAgIGlmICh0aGlzLmVycm9yczIuZW1haWwgIT0gbnVsbCkgewogICAgICAgICAgcmVzID0gdHJ1ZTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHJlczsKICAgICAgfSwKICAgICAgVGl0bGVFcnJvckNsYXNzOiBmdW5jdGlvbigpIHsKICAgICAgICB2YXIgcmVzOwogICAgICAgIHJlcyA9IGZhbHNlOwogICAgICAgIGlmICh0aGlzLmVycm9yczIudGl0bGUgIT0gbnVsbCkgewogICAgICAgICAgcmVzID0gdHJ1ZTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHJlczsKICAgICAgfSwKICAgICAgQ29tcGFueUVycm9yQ2xhc3M6IGZ1bmN0aW9uKCkgewogICAgICAgIHZhciByZXM7CiAgICAgICAgcmVzID0gZmFsc2U7CiAgICAgICAgaWYgKHRoaXMuZXJyb3JzMi5jb21wYW55ICE9IG51bGwpIHsKICAgICAgICAgIHJlcyA9IHRydWU7CiAgICAgICAgfQogICAgICAgIHJldHVybiByZXM7CiAgICAgIH0sCiAgICAgIFBob25lRXJyb3JDbGFzczogZnVuY3Rpb24oKSB7CiAgICAgICAgdmFyIHJlczsKICAgICAgICByZXMgPSBmYWxzZTsKICAgICAgICBpZiAodGhpcy5pdGlOdW1iZXJFcnJvcikgewogICAgICAgICAgcmVzID0gdHJ1ZTsKICAgICAgICAgIHJldHVybiByZXM7CiAgICAgICAgfQogICAgICAgIGlmICh0aGlzLmVycm9yczIucGhvbmUgIT0gbnVsbCkgewogICAgICAgICAgcmVzID0gdHJ1ZTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHJlczsKICAgICAgfQogICAgfSwKICAgIGNyZWF0ZWQ6IGZ1bmN0aW9uKCkgewogICAgICB2YXIgZWxfY29tcGFueSwgZWxfY291bnRyeSwgZWxfZW1haWwsIGVsX2ZpcnN0bmFtZSwgZWxfbGFuZ3VhZ2UsIGVsX2xhc3RuYW1lLCBlbF9waG9uZSwgZWxfcHJvZHVjdCwgZWxfdGl0bGU7CiAgICAgIGVsX3Byb2R1Y3QgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnbGl2ZWRlbW9fbGljZW5zZScpOwogICAgICBpZiAoZWxfcHJvZHVjdCAhPSBudWxsKSB7CiAgICAgICAgdGhpcy5wcm9kdWN0ID0gZWxfcHJvZHVjdC52YWx1ZTsKICAgICAgfQogICAgICBlbF9maXJzdG5hbWUgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnbGl2ZWRlbW9fZmlyc3RuYW1l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V0RWxlbWVudEJ5SWQoJ2xpdmVkZW1vX2NvdW50cnknKTsKICAgICAgaWYgKGNvdW50cnlfZWxlbWVudCAhPSBudWxsKSB7CiAgICAgICAgaWYgKGNvdW50cnlfZWxlbWVudC5jbGFzc0xpc3QuY29udGFpbnMoJ3Z1ZS0yMDIzJykgfHwgY291bnRyeV9lbGVtZW50LmNsYXNzTGlzdC5jb250YWlucygndnVlJykpIHsKICAgICAgICAgIHN3X2Nob2ljZXM2ID0gbmV3IENob2ljZXMoY291bnRyeV9lbGVtZW50LCB7CiAgICAgICAgICAgIC8vIHNob3VsZFNvcnQ6IGZhbHNlLAogICAgICAgICAgICBzZWFyY2hFbmFibGVkOiBmYWxzZSwKICAgICAgICAgICAgc2VhcmNoQ2hvaWNlczogZmFsc2UsCiAgICAgICAgICAgIHNob3VsZFNvcnQ6IGZhbHNlLAogICAgICAgICAgICBpdGVtU2VsZWN0VGV4dDogJycKICAgICAgICB9KTsKICAgICAgICB9CiAgICAgIH0KICAgICAgdGhpcy5pdGlQaG9uZUluaXQoJyNsaXZlZGVtb19waG9uZTInKTsKICAgIH0sCiAgICBiZWZvcmVVcGRhdGU6IGZ1bmN0aW9uKCkgewogICAgICB0aGlzLnNldENsZWFuUGhvbmVNb2RlbCgpOwogICAgfSwKICAgIHdhdGNoOiB7CiAgICAgIGNvdW50cnk6IGZ1bmN0aW9uKG5ld0NvdW50cnksIG9sZENvdW50cnkpIHsKICAgICAgICB0aGlzLmdldElTTyhuZXdDb3VudHJ5LCBvbGRDb3VudHJ5KTsKICAgICAgfQogICAgfSwKICAgIG1ldGhvZHM6IHsKICAgICAgc2V0Q2xlYW5QaG9uZU1vZGVsOiBmdW5jdGlvbihuYW1lKSB7CiAgICAgICAgdmFyIGNvdW50cnlEYXRhLCBpdGksIG51bWJlciwgbnVtYmVySSwgcGhvbmVFbDsKICAgICAgICBpZiAoKGludGxUZWxJbnB1dFV0aWxzLm51bWJlckZvcm1hdCAhPSBudWxsKSAmJiAodGhpcy5iZWZvcmVVcGRhdGVDb3VudGVyID09PSAwKSkgewogICAgICAgICAgcGhvbmVFbCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNsaXZlZGVtb19waG9uZTInKTsKICAgICAgICAgIGl0aSA9IHdpbmRvdy5pbnRsVGVsSW5wdXRHbG9iYWxzLmdldEluc3RhbmNlKHBob25lRWwpOwogICAgICAgICAgbnVtYmVyID0gaXRpLmdldE51bWJlcihpbnRsVGVsSW5wdXRVdGlscy5udW1iZXJGb3JtYXQuTkFUSU9OQUwpOwogICAgICAgICAgY291bnRyeURhdGEgPSBpdGkuZ2V0U2VsZWN0ZWRDb3VudHJ5RGF0YSgpOwogICAgICAgICAgbnVtYmVySSA9IGl0aS5nZXROdW1iZXIoaW50bFRlbElucHV0VXRpbHMubnVtYmVyRm9ybWF0LklOVEVSTkFUSU9OQUwpOwogICAgICAgICAgbnVtYmVySSA9IG51bWJlckkucmVwbGFjZSgnKycsICcnKTsKICAgICAgICAgIGlmICgoY291bnRyeURhdGEgIT0gbnVsbCkgJiYgKHR5cGVvZiBjb3VudHJ5RGF0YSA9PT0gJ29iamVjdCcpICYmIChjb3VudHJ5RGF0YS5kaWFsQ29kZSAhPSBudWxsKSkgewogICAgICAgICAgICBudW1iZXJJID0gbnVtYmVySS5yZXBsYWNlKGNvdW50cnlEYXRhLmRpYWxDb2RlLCAnJyk7CiAgICAgICAgICAgIHRoaXMucGhvbmUyID0gbnVtYmVySTsKICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHRoaXMucGhvbmUyID0gbnVtYmVyOwogICAgICAgICAgfQogICAgICAgICAgdGhpcy5iZWZvcmVVcGRhdGVDb3VudGVyICs9IDE7CiAgICAgICAgfQogICAgICB9LAogICAgICBnZXRDb29raWVWYWx1ZTogZnVuY3Rpb24obmFtZSkgewogICAgICAgIHZhciByZWY7CiAgICAgICAgcmV0dXJuICgocmVmID0gZG9jdW1lbnQuY29va2llLm1hdGNoKCcoXnw7KVxccyonICsgbmFtZSArICdcXHMqPVxccyooW147XSspJykpICE9IG51bGwgPyByZWYucG9wKCkgOiB2b2lkIDApIHx8ICcnOwogICAgICB9LAogICAgICBmdW5jX25vX3ZhbGlkOiBmdW5jdGlvbihkYXRhKSB7CiAgICAgICAgdmFyIGQ7CiAgICAgICAgZCA9IGRhdGE7CiAgICAgICAgZC5mcm9tX3VybCA9IGRvY3VtZW50LmxvY2F0aW9uLmhyZWY7CiAgICAgICAgaWYgKCFqUXVlcnkpIHsKICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICB9CiAgICAgICAgJC5wb3N0KCIvbm90LXZhbGlkLWRhdGEtdjIwLmpzIiwgZCk7CiAgICAgIH0sCiAgICAgIHZhbGlkRW1haWxfZGVtbzogZnVuY3Rpb24ob3B0aW9ucykgewogICAgICAgIGlmICh3aW5kb3cuc3VjY2Vzc0Zvcm1TdWJtaXQgPT0gbnVsbCkgewogICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KICAgICAgICAkLmFqYXgoewogICAgICAgICAgdXJsOiAnL3ZhbGlkZW1haWwuanMnLAogICAgICAgICAgdHlwZTogIlBPU1QiLAogICAgICAgICAgZGF0YTogewogICAgICAgICAgICBlbWFpbDogb3B0aW9ucy5lbWFpbAogICAgICAgICAgfSwKICAgICAgICAgIHN1Y2Nlc3M6IGZ1bmN0aW9uKHJlc3BvbnNlKSB7CiAgICAgICAgICAgIHZhciBvYmo7CiAgICAgICAgICAgIG9iaiA9IHt9OwogICAgICAgICAgICBvYmouY2F0ZWdvcnkgPSAnJzsKICAgICAgICAgICAgb2JqLmNhdGVnb3J5ID0gb3B0aW9ucy5saWNlbnNlOwogICAgICAgICAgICBvcHRpb25zLnZhbGlkID0gcmVzcG9uc2UuZW1haWxTdGF0dXM7CiAgICAgICAgICAgIG9wdGlvbnMudXNlciA9IHJlc3BvbnNlLmNpZDsKICAgICAgICAgICAgb3B0aW9ucy5jYXRlZ29yeSA9IG9iai5jYXRlZ29yeTsKICAgICAgICAgICAgd2luZG93LnN1Y2Nlc3NGb3JtU3VibWl0KG9wdGlvbnMpOwogICAgICAgICAgfSwKICAgICAgICAgIGRhdGFUeXBlOiAnanNvbicKICAgICAgICB9KTsKICAgICAgfSwKICAgICAgc2V0TW9kZWw6IGZ1bmN0aW9uKCkgewogICAgICAgIHZhciB2YWxpZENoYXJhY3RlcnNSZWdleHA7CiAgICAgICAgdGhpcy5tb2RlbCA9IHsKICAgICAgICAgIGZpcnN0bmFtZTogdGhpcy5maXJzdG5hbWUsCiAgICAgICAgICBsYXN0bmFtZTogdGhpcy5sYXN0bmFtZSwKICAgICAgICAgIGNvbXBhbnk6IHRoaXMuY29tcGFueSwKICAgICAgICAgIGVtYWlsOiB0aGlzLmVtYWlsLAogICAgICAgICAgY291bnRyeTogdGhpcy5jb3VudHJ5LAogICAgICAgICAgdGl0bGU6IHRoaXMudGl0bGUsCiAgICAgICAgICBwaG9uZTI6IHRoaXMucGhvbmUyLAogICAgICAgICAgcHJvZHVjdDogdGhpcy5wcm9kdWN0LAogICAgICAgICAgdXJsOiB3aW5kb3cubG9jYXRpb24uaHJlZiwKICAgICAgICAgIHBob25lRXh0OiB0aGlzLnBob25lRXh0LAogICAgICAgICAgcGhvbmVTdGFuZGFydDogdGhpcy5waG9uZVN0YW5kYXJ0LAogICAgICAgICAgcGhvbmVWZXJzaW9uOiB0aGlzLnBob25lVmVyc2lvbiwKICAgICAgICAgIHZhbGlkUGhvbmU6IHRoaXMudmFsaWRQaG9uZSwKICAgICAgICAgIGZvcm1UeXBlOiB0aGlzLmZvcm1UeXBlLAogICAgICAgICAgcGhvbmVDb3VudHJ5OiB0aGlzLnBob25lQ291bnRyeSwKICAgICAgICAgIGNvbW1lbnRzOiB0aGlzLmNvbW1lbnRzLAogICAgICAgICAgbGFuZ3VhZ2U6IHRoaXMubGFuZ3VhZ2UKICAgICAgICB9OwogICAgICAgIGlmICh0aGlzLm1vZGVsLnByb2R1Y3QgPT09ICdIQ0EgZm9yIFZpZ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gfQogICAgICAgIHJldHVybiB0cnVlOwogICAgICB9LAogICAgICBlcnJvclByaW9yaXR5OiBmdW5jdGlvbihlcnJvcikgewogICAgICAgIHZhciByZXM7CiAgICAgICAgcmVzID0gMDsKICAgICAgICBzd2l0Y2ggKGVycm9yKSB7CiAgICAgICAgICBjYXNlICd2YWxpZGF0ZV9yZXF1aXJlZCc6CiAgICAgICAgICAgIHJlcyA9IDA7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgY2FzZSAnZmFrZV93b3Jkcyc6CiAgICAgICAgICAgIHJlcyA9IDQ7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgY2FzZSAnbGF0aW5fYW5kX3doaXRlc3BhY2UnOgogICAgICAgICAgICByZXMgPSA1OwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgIHJlcyA9IDEwOwogICAgICAgIH0KICAgICAgICByZXR1cm4gcmVzOwogICAgICB9LAogICAgICBzb3J0RXJyb3JzOiBmdW5jdGlvbihlcnJvcnMpIHsKICAgICAgICB2YXIga2V5LCBtZSwgb2JqLCByZXNPYmosIHNvcnRGdW5jOwogICAgICAgIG9iaiA9IHt9OwogICAgICAgIG1lID0gdGhpczsKICAgICAgICBmb3IgKGtleSBpbiBlcnJvcnMpIHsKICAgICAgICAgIGlmIChrZXkgPT09ICdsZW5ndGgnKSB7CiAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgfQogICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoZXJyb3JzW2tleV0pKSB7CiAgICAgICAgICAgIGVycm9yc1trZXldLmZvckVhY2goZnVuY3Rpb24oZWxlbWVudCkgewogICAgICAgICAgICAgIHZhciBwcmlvcml0eTsKICAgICAgICAgICAgICBwcmlvcml0eSA9IG1lLmVycm9yUHJpb3JpdHkoZWxlbWVudCk7CiAgICAgICAgICAgICAgaWYgKG9ialtrZXldICE9IG51bGwpIHsKICAgICAgICAgICAgICAgIHJldHVybiBvYmpba2V5XS5wdXNoKHsKICAgICAgICAgICAgICAgICAgJ3J1bGUnOiBlbGVtZW50LAogICAgICAgICAgICAgICAgICAncHJpb3JpdHknOiBwcmlvcml0eQogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHJldHVybiBvYmpba2V5XSA9IFsKICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICdydWxlJzogZWxlbWVudCwKICAgICAgICAgICAgICAgICAgICAncHJpb3JpdHknOiBwcmlvcml0eQogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBdOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSk7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHNvcnRGdW5jID0gZnVuY3Rpb24oYSwgYikgewogICAgICAgICAgdmFyIHJlczsKICAgICAgICAgIHJlcyA9ICgrYS5wcmlvcml0eSkgLSAoK2IucHJpb3JpdHkpOwogICAgICAgICAgcmV0dXJuIHJlczsKICAgICAgICB9OwogICAgICAgIGZvciAoa2V5IGluIG9iaikgewogICAgICAgICAgb2JqW2tleV0uc29ydChzb3J0RnVuYyk7CiAgICAgICAgfQogICAgICAgIHJlc09iaiA9IHsKICAgICAgICAgIGxlbmd0aDogMAogICAgICAgIH07CiAgICAgICAgZm9yIChrZXkgaW4gb2JqKSB7CiAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShlcnJvcnNba2V5XSkpIHsKICAgICAgICAgICAgb2JqW2tleV0uZm9yRWFjaChmdW5jdGlvbihlbGVtZW50KSB7CiAgICAgICAgICAgICAgaWYgKHJlc09ialtrZXldICE9IG51bGwpIHsKICAgICAgICAgICAgICAgIHJlc09ialtrZXldLnB1c2goZWxlbWVudC5ydWxlKTsKICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgcmVzT2JqW2tleV0gPSBbZWxlbWVudC5ydWxlXTsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgcmV0dXJuIHJlc09iai5sZW5ndGggKz0gMTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHJldHVybiByZXNPYmo7CiAgICAgIH0sCiAgICAgIGZpbHRlckVycm9yczogZnVuY3Rpb24oZXJyb3JzKSB7CiAgICAgICAgdmFyIGtleSwgb2JqOwogICAgICAgIG9iaiA9IHsKICAgICAgICAgIGxlbmd0aDogMAogICAgICAgIH07CiAgICAgICAgZm9yIChrZXkgaW4gZXJyb3JzKSB7CiAgICAgICAgICBpZiAoa2V5ID09PSAnbGVuZ3RoJykgewogICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgIH0KICAgICAgICAgIG9ialtrZXldID0gW2Vycm9yc1trZXldWzBdXTsKICAgICAgICAgIG9iai5sZW5ndGggKz0gMTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIG9iajsKICAgICAgfSwKICAgICAgY2hlY2tFcnJvcnM6IGZ1bmN0aW9uKHJlcykgewogICAgICAgIHZhciBlcnJvcnMsIGtleTsKICAgICAgICBlcnJvcnMgPSB7CiAgICAgICAgICBsZW5ndGg6IDAKICAgICAgICB9OwogICAgICAgIGZvciAoa2V5IGluIHJlcy5kYXRhKSB7CiAgICAgICAgICBpZiAoKGVycm9yc1tyZXMuZGF0YVtrZXldWydmaWVsZCddXSAhPSBudWxsKSkgewogICAgICAgICAgICBlcnJvcnNbcmVzLmRhdGFba2V5XVsnZmllbGQnXV0ucHVzaChyZXMuZGF0YVtrZXldWydydWxlJ10pOwogICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgZXJyb3JzW3Jlcy5kYXRhW2tleV1bJ2ZpZWxkJ11dID0gW3Jlcy5kYXRhW2tleV1bJ3J1bGUnXV07CiAgICAgICAgICB9CiAgICAgICAgICBlcnJvcnMubGVuZ3RoICs9IDE7CiAgICAgICAgfQogICAgICAgIHJldHVybiBlcnJvcnM7CiAgICAgIH0sCiAgICAgIGNoZWNrUmV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lcnJvcnMubGVuZ3RoICE9IG51bGwpICYmIGVycm9ycy5sZW5ndGggIT09IDApIHsKICAgICAgICAgIHBob25lX251bWJlcl9mbGFnID0gMDsKICAgICAgICAgIGZvciAoa2V5IGluIGVycm9ycykgewogICAgICAgICAgICBpZiAoa2V5ICE9PSAnbGVuZ3RoJykgewogICAgICAgICAgICAgIHN3aXRjaCAoa2V5KSB7CiAgICAgICAgICAgICAgICBjYXNlICdwcm9kdWN0JzoKICAgICAgICAgICAgICAgIGNhc2UgJ2NvdW50cnknOgogICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgICAgICAgIGZvciAoayBpbiBlcnJvcnNba2V5XSkgewogICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoZXJyb3JzW2tleV1ba10pIHsKICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3ZhbGlkYXRlX3JlcXVpcmVkJzoKICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ2tleScsIGtleSk7CiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoa2V5KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnZmlyc3RuYW1lJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRXJyb3IoKGVsICsgIiAiICsgcHJlZml4KSArIGtleSwgdmFsaWRlX21lc3NhZ2VbdGhpcy5sYW5ndWFnZV1bJ3ZhbGlkYXRlX3JlcXVpcmVkJ11bJ2ZpcnN0bmFtZSddKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2xhc3RuYW1lJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRXJyb3IoKGVsICsgIiAiICsgcHJlZml4KSArIGtleSwgdmFsaWRlX21lc3NhZ2VbdGhpcy5sYW5ndWFnZV1bJ3ZhbGlkYXRlX3JlcXVpcmVkJ11bJ2xhc3RuYW1lJ10pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnZW1haWwnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVFcnJvcigoZWwgKyAiICIgKyBwcmVmaXgpICsga2V5LCB2YWxpZGVfbWVzc2FnZVt0aGlzLmxhbmd1YWdlXVsndmFsaWRhdGVfcmVxdWlyZWQnXVsnZW1haWwnXSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdjb21wYW55JzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRXJyb3IoKGVsICsgIiAiICsgcHJlZml4KSArIGtleSwgdmFsaWRlX21lc3NhZ2VbdGhpcy5sYW5ndWFnZV1bJ3ZhbGlkYXRlX3JlcXVpcmVkJ11bJ2NvbXBhbnknXSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICd0aXRsZSc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUVycm9yKChlbCArICIgIiArIHByZWZpeCkgKyBrZXksIHZhbGlkZV9tZXNzYWdlW3RoaXMubGFuZ3VhZ2VdWyd2YWxpZGF0ZV9yZXF1aXJlZCddWyd0aXRsZSddKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3Bob25lMic6CiAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAncGhvbmUnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVFcnJvcihlbCArICIgI2xpdmVkZW1vX3Bob25lMiIsIHZhbGlkZV9tZXNzYWdlW3RoaXMubGFuZ3VhZ2VdWyd2YWxpZGF0ZV9yZXF1aXJlZCddWydwaG9uZSddKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2NvdW50cnknOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVFcnJvcigoZWwgKyAiICIgKyBwcmVmaXgpICsga2V5LCB2YWxpZGVfbWVzc2FnZVt0aGlzLmxhbmd1YWdlXVsndmFsaWRhdGVfcmVxdWlyZWQnXVsnY291bnRyeSddKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgY2FzZSAndHdvX2xhdGluX2FuZF93aGl0ZXNwYWNlJzoKICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVFcnJvcigoZWwgKyAiICIgKyBwcmVmaXgpICsga2V5LCB2YWxpZGVfbWVzc2FnZVt0aGlzLmxhbmd1YWdlXVsndHdvX2xhdGluX2FuZF93aGl0ZXNwYWNlJ10pOwogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2ZpcnN0bmFtZV9sYXN0bmFtZV9tYXRjaCc6CiAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRXJyb3IoKGVsICsgIiAiICsgcHJlZml4KSArIGtleSwgdmFsaWRlX21lc3NhZ2VbdGhpcy5sYW5ndWFnZV1bJ2ZpcnN0bmFtZV9sYXN0bmFtZV9tYXRjaCddKTsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICBjYXNlICdsYXRpbl9hbmRfd2hpdGVzcGFjZSc6CiAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRXJyb3IoKGVsICsgIiAiICsgcHJlZml4KSArIGtleSwgdmFsaWRlX21lc3NhZ2VbdGhpcy5sYW5ndWFnZV1bJ2xhdGluX2FuZF93aGl0ZXNwYWNlJ10pOwogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3B1YmxpY19lbWFpbCc6CiAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRXJyb3IoKGVsICsgIiAiICsgcHJlZml4KSArIGtleSwgdmFsaWRlX21lc3NhZ2VbdGhpcy5sYW5ndWFnZV1bJ3B1YmxpY19lbWFpbCddKTsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICBjYXNlICdmYWtlX3dvcmRzJzoKICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChrZXkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdmaXJzdG5hbWUnOgogICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2xhc3RuYW1lJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRXJyb3IoKGVsICsgIiAiICsgcHJlZml4KSArIGtleSwgdmFsaWRlX21lc3NhZ2VbdGhpcy5sYW5ndWFnZV1bJ2Zha2Vfd29yZHMnXVsnZmlyc3RuYW1lJ10pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAndGl0bGUnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVFcnJvcigoZWwgKyAiICIgKyBwcmVmaXgpICsga2V5LCB2YWxpZGVfbWVzc2FnZVt0aGlzLmxhbmd1YWdlXVsnZmFrZV93b3JkcyddWyd0aXRsZSddKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgY2FzZSAnY2hvb3NlX2xpY2Vuc2VfdmFsdWUnOgogICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUVycm9yKChlbCArICIgIiArIHByZWZpeCkgKyBrZXksIHZhbGlkZV9tZXNzYWdlW3RoaXMubGFuZ3VhZ2VdWydjaG9vc2VfbGljZW5zZV92YWx1ZSddKTsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICBjYXNlICdyZXBlYXRfc3ltYm9scyc6CiAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRXJyb3IoKGVsICsgIiAiICsgcHJlZml4KSArIGtleSwgdmFsaWRlX21lc3NhZ2VbdGhpcy5sYW5ndWFnZV1bJ3JlcGVhdF9zeW1ib2xzJ10pOwogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ25vdF92YWxpZF9waG9uZV9mb3JtYXQnOgogICAgICAgICAgICAgICAgICAgICAgY2FzZSAncGhvbmVfbnVtYmVyJzoKICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVFcnJvcihlbCArICIgI2xpdmVkZW1vX3Bob25lMiIsIHZhbGlkZV9tZXNzYWdlW3RoaXMubGFuZ3VhZ2VdWydub3RfdmFsaWRfcGhvbmVfZm9ybWF0J10pOwogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3ZhbGlkYXRlX3ZhbGlkX2VtYWlsJzoKICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVFcnJvcigoZWwgKyAiICIgKyBwcmVmaXgpICsga2V5LCB2YWxpZGVfbWVzc2FnZVt0aGlzLmxhbmd1YWdlXVsndmFsaWRhdGVfdmFsaWRfZW1haWwnXSk7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoICh0aGlzLmxhbmd1YWdlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnZnInOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVFcnJvcigoZWwgKyAiICIgKyBwcmVmaXgpICsga2V5LCAiQXV0cmVzIGNhcyBwb3VyICIgKyBrZXkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRXJyb3IoKGVsICsgIiAiICsgcHJlZml4KSArIGtleSwgIlVua25vd24gZXJyb3IgZm9yICIgKyBrZXkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgfQogICAgICAgIH0KICAgICAgfSwKICAgICAgc3VibWl0Rm9ybTogZnVuY3Rpb24oZXZlbnQpIHsKICAgICAgICB2YXIgY2hlY2tfbWUsIGNoZWNrX21lX2xhYmVsLCBmYWlsdXJlQ2FsbGJhY2ssIG1lLCBzdWNjZXNzQ2FsbGJhY2ssIHVybDsKICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpOwogICAgICAgIGNoZWNrX21lID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2xpdmVkZW1vX2NoZWNrX21lJyk7CiAgICAgICAgY2hlY2tfbWVfbGFiZWwgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnbGl2ZWRlbW9fY2hlY2ttYXJrJyk7CiAgICAgICAgaWYgKHRoaXMuaXNFdXJvWm9uZSkgewogICAgICAgICAgaWYgKCFjaGVja19tZS5jaGVja2VkKSB7CiAgICAgICAgICAgIHRoaXMucHJpdmFjeVBvbGljeUVycm9yID0gdHJ1ZTsKICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHRoaXMucHJpdmFjeVBvbGljeUVycm9yID0gZmFsc2U7CiAgICAgICAgICB9CiAgICAgICAgICBpZiAoIWNoZWNrX21lLmNoZWNrZWQpIHsKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgfQogICAgICAgIH0KICAgICAgICB0aGlzLml0aU51bWJlckVycm9yID0gZmFsc2U7CiAgICAgICAgaWYgKHRoaXMuaXRpSW5zdGFuY2UoJyNsaXZlZGVtb19waG9uZTInKSAhPSBudWxsKSB7CiAgICAgICAgICB0aGlzLmlzSXRpVmFsaWRQaG9uZSgnI2xpdmVkZW1vX3Bob25lMicpOwogICAgICAgIH0KICAgICAgICBtZSA9IHRoaXM7CiAgICAgICAgdGhpcy5zZXRNb2RlbCgpOwogICAgICAgIHN1Y2Nlc3NDYWxsYmFjayA9IGZ1bmN0aW9uKGRhdGEpIHsKICAgICAgICAgIHZhciBvcHRpb25zOwogICAgICAgICAgbWUuY2hlY2tSZXF1ZXN0KGRhdGEpOwogICAgICAgICAgJCgiI3JlcXVlc3RfbGl2ZV9kZW1vX2Zvcm0iKS5oaWRlKCk7CiAgICAgICAgICAkKCcjZGVtby10aGFuay15b3UuZGVtby10aGFuay15b3UnKS5zaG93KCk7CiAgICAgICAgICBjaGVja19tZV9sYWJlbCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdyZXF1ZXN0X2NoZWNrbWFyaycpOwogICAgICAgICAgb3B0aW9ucyA9IHt9OwogICAgICAgICAgb3B0aW9ucy5hY3Rpb24gPSAnUmVxdWVzdCBEZW1vJzsKICAgICAgICAgIG9wdGlvbnMubG9jYXRpb24gPSB3aW5kb3cubG9jYXRpb24uaHJlZjsKICAgICAgICAgIG9wdGlvbnMuZW1haWwgPSBtZS5lbWFpbDsKICAgICAgICAgIG9wdGlvbnMubGljZW5zZSA9IG1lLnByb2R1Y3Q7CiAgICAgICAgICBtZS52YWxpZEVtYWlsX2RlbW8ob3B0aW9ucyk7CiAgICA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lbElucHV0ICE9IG51bGwpIHsKICAgICAgICAgIHBob25lRWwgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKHNlbGVjdG9yKTsKICAgICAgICAgIGlmIChwaG9uZUVsICE9IG51bGwpIHsKICAgICAgICAgICAgdGhpcy5waG9uZVZlcnNpb24gPSAndjIwMjMnOwogICAgICAgICAgICByZXR1cm4gd2luZG93LmludGxUZWxJbnB1dChwaG9uZUVsLCB7CiAgICAgICAgICAgICAgdXRpbHNTY3JpcHQ6IHV0aWxzU2NyaXB0LAogICAgICAgICAgICAgIHNlcGFyYXRlRGlhbENvZGU6IHRydWUKICAgICAgICAgICAgfSkucHJvbWlzZS50aGVuKGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgIHJldHVybiBtZS5zZXRDbGVhblBob25lTW9kZWwoJ2RlbW8gbW91bnRlZCcpOwogICAgICAgICAgICB9KTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0sCiAgICAgIGl0aUluc3RhbmNlOiBmdW5jdGlvbihzZWxlY3RvcikgewogICAgICAgIHZhciBpdGksIHBob25lRWw7CiAgICAgICAgaWYgKHdpbmRvdy5pbnRsVGVsSW5wdXQgPT0gbnVsbCkgewogICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgfQogICAgICAgIHBob25lRWwgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKHNlbGVjdG9yKTsKICAgICAgICBpZiAocGhvbmVFbCA9PSBudWxsKSB7CiAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICB9CiAgICAgICAgaXRpID0gd2luZG93LmludGxUZWxJbnB1dEdsb2JhbHMuZ2V0SW5zdGFuY2UocGhvbmVFbCk7CiAgICAgICAgaWYgKGl0aSA9PSBudWxsKSB7CiAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGl0aTsKICAgICAgfSwKICAgICAgZ2V0SVNPOiBmdW5jdGlvbihuZXdDb3VudHJ5KSB7CiAgICAgICAgdmFyIG1lLCB1cmw7CiAgICAgICAgaWYgKHdpbmRvdy5pbnRsVGVsSW5wdXQgPT0gbnVsbCkgewogICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KICAgICAgICB1cmwgPSAnaHR0cHM6Ly93d3cuc3RhcndpbmRzb2Z0d2FyZS5jb20vZ2VvaXAtZGV0YWlsLmpzJzsKICAgICAgICBtZSA9IHRoaXM7CiAgICAgICAgJC5hamF4KHsKICAgICAgICAgIHVybDogdXJsLAogICAgICAgICAgdHlwZTogIlBPU1QiLAogICAgICAgICAgZGF0YTogewogICAgICAgICAgICBjb3VudHJ5OiBuZXdDb3VudHJ5CiAgICAgICAgICB9LAogICAgICAgICAgZGF0YVR5cGU6ICdqc29uJywKICAgICAgICAgIHN1Y2Nlc3M6IGZ1bmN0aW9uKHJlc3BvbnNlKSB7CiAgICAgICAgICAgIHZhciBpdGksIHBob25lQ291bnRyeTsKICAgICAgICAgICAgaWYgKChyZXNwb25zZS5zdGF0dXMgIT0gbnVsbCkgJiYgcmVzcG9uc2Uuc3RhdHVzID09PSB0cnVlICYmIChyZXNwb25zZS50eXBlICE9IG51bGwpICYmIChyZXNwb25zZS50eXBlID09PSAnY291bnRyeS1kZXRhaWwnKSkgewogICAgICAgICAgICAgIGlmIChyZXNwb25zZS5pc29Db2RlICE9IG51bGwpIHsKICAgICAgICAgICAgICAgIG1lLmlzb0NvZGUgPSByZXNwb25zZS5pc29Db2RlOwogICAgICAgICAgICAgICAgaXRpID0gbWUuaXRpSW5zdGFuY2UoJyNsaXZlZGVtb19waG9uZTInKTsKICAgICAgICAgICAgICAgIGlmIChpdGkgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBwaG9uZUNvdW50cnkgPSBtZS5nZXRDb29raWVWYWx1ZSgncGhvbmVDb3VudHJ5Jyk7CiAgICAgICAgICAgICAgICBpZiAoKHBob25lQ291bnRyeSAhPSBudWxsKSAmJiBwaG9uZUNvdW50cnkgIT09ICcnKSB7CiAgICAgICAgICAgICAgICAgIGl0aS5zZXRDb3VudHJ5KHBob25lQ291bnRyeSk7CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICBpdGkuc2V0Q291bnRyeShtZS5pc29Db2RlKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICB9KTsKICAgICAgfSwKICAgICAgaXNJdGlWYWxpZFBob25lOiBmdW5jdGlvbihzZWxlY3RvcikgewogICAgICAgIHZhciBpdGksIHJlczsKICAgICAgICBpZiAod2luZG93LmludGxUZWxJbnB1dCA9PSBudWxsKSB7CiAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgfQogICAgICAgIHJlcyA9IGZhbHNlOwogICAgICAgIGl0aSA9IHRoaXMuaXRpSW5zdGFuY2Uoc2VsZWN0b3IpOwogICAgICAgIGlmIChpdGkgPT0gbnVsbCkgewogICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgIH0KICAgICAgICBpZiAoaXRpLmlzVmFsaWROdW1iZXIoKSkgewogICAgICAgICAgcmVzID0gdHJ1ZTsKICAgICAgICAgIHRoaXMudmFsaWRQaG9uZSA9IHRydWU7CiAgICAgICAgICB0aGlzLnBob25lU3RhbmRhcnQgPSBpdGkuZ2V0TnVtYmVyKGludGxUZWxJbnB1dFV0aWxzLm51bWJlckZvcm1hdC5FMTY0KTsKICAgICAgICAgIHRoaXMucGhvbmVFeHQgPSBpdGkuZ2V0RXh0ZW5zaW9uKCk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgIHRoaXMudmFsaWRQaG9uZSA9IGZhbHNlOwogICAgICAgICAgdGhpcy5waG9uZVN0YW5kYXJ0ID0gJyc7CiAgICAgICAgICB0aGlzLnBob25lRXh0ID0gJyc7CiAgICAgICAgfQogICAgICAgIHRoaXMucGhvbmVDb3VudHJ5ID0gaXRpLmdldFNlbGVjdGVkQ291bnRyeURhdGEoKS5pc28yOwogICAgICAgIHJldHVybiByZXM7CiAgICAgIH0sCiAgICAgIHBvaW50Rm9ybVZhbGlkYXRpb246IGZ1bmN0aW9uKGRhdGEsIHN1Y2Nlc3NDYWxsYmFjaywgZmFpbHVyZUNhbGxiYWNrKSB7CiAgICAgICAgdmFyIGtleSwgcGFyYW1zLCB1cmw7CiAgICAgICAgcGFyYW1zID0gbmV3IFVSTFNlYXJjaFBhcmFtcygpOwogICAgICAgIGZvciAoa2V5IGluIGRhdGEpIHsKICAgICAgICAgIHBhcmFtcy5hcHBlbmQoa2V5LCBkYXRhW2tleV0pOwogICAgICAgIH0KICAgICAgICBpZiAodHlwZW9mIGF4aW9zID09PSAidW5kZWZpbmVkIiB8fCBheGlvcyA9PT0gbnVsbCkgewogICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCdib2R5JykuY2xhc3NMaXN0LmFkZCgncHJlbG9hZGVyJyk7CiAgICAgICAgdXJsID0gJy9wb2ludC1mb3JtLXZhbGlkYXRpb24uanMnOwogICAgICAgIGF4aW9zLnBvc3QodXJsLCBwYXJhbXMpLnRoZW4oZnVuY3Rpb24oYXJnKSB7CiAgICAgICAgICB2YXIgZGF0YTsKICAgICAgICAgIGRhdGEgPSBhcmcuZGF0YTsKICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJ2JvZHknKS5jbGFzc0xpc3QucmVtb3ZlKCdwcmVsb2FkZXInKTsKICAgICAgICAgIGlmICgoZGF0YS5zdWNjZXNzICE9IG51bGwpICYmIGRhdGEuc3VjY2VzcykgewogICAgICAgICAgICBzdWNjZXNzQ2FsbGJhY2soJ29rJyk7CiAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBmYWlsdXJlQ2FsbGJhY2soZGF0YSk7CiAgICAgICAgICB9CiAgICAgICAgfSk7CiAgICAgIH0KICAgIH0KICB9KTsKCn0pLmNhbGwodGhpcyk7CgovLyMgc291cmNlTWFwcGluZ1VSTD1kZW1vLmpzLm1hcAo=
4 ms
polyfill.min.js
5 ms
lozad.min.js
27 ms
axios.min.js
16 ms
icon-search.svg
658 ms
star.svg
660 ms
checkmark.svg
659 ms
mp.png
542 ms
vm.png
557 ms
jquery.min.js
17 ms
starwind.com accessibility score
ARIA
These are opportunities to improve the usage of ARIA in your application which may enhance the experience for users of assistive technology, like a screen reader.
Impact
Issue
[aria-*] attributes do not match their roles
ARIA input fields do not have accessible names
Elements with an ARIA [role] that require children to contain a specific [role] are missing some or all of those required children.
[aria-*] attributes do not have valid values
ARIA IDs are not unique
Contrast
These are opportunities to improve the legibility of your content.
Impact
Issue
Background and foreground colors do not have a sufficient contrast ratio.
Navigation
These are opportunities to improve keyboard navigation in your application.
Impact
Issue
[id] attributes on active, focusable elements are not unique
Internationalization and localization
These are opportunities to improve the interpretation of your content by users in different locales.
Impact
Issue
<html> element does not have a [lang] attribute
Names and labels
These are opportunities to improve the semantics of the controls in your application. This may enhance the experience for users of assistive technology, like a screen reader.
Impact
Issue
Links do not have a discernible name
Tables and lists
These are opportunities to improve the experience of reading tabular or list data using assistive technology, like a screen reader.
Impact
Issue
Lists do not contain only <li> elements and script supporting elements (<script> and <template>).
starwind.com best practices score
Trust and Safety
Impact
Issue
Does not use HTTPS
Ensure CSP is effective against XSS attacks
General
Impact
Issue
Detected JavaScript libraries
Browser errors were logged to the console
Page has valid source maps
starwind.com SEO score
Content Best Practices
Format your HTML in a way that enables crawlers to better understand your app’s content.
Impact
Issue
Links do not have descriptive text
Crawling and Indexing
To appear in search results, crawlers need access to your app.
Impact
Issue
Links are not crawlable
Mobile Friendly
Make sure your pages are mobile friendly so users don’t have to pinch or zoom in order to read the content pages. [Learn more](https://developers.google.com/search/mobile-sites/).
Impact
Issue
Document uses legible font sizes
Tap targets are not sized appropriately
EN
N/A
UTF-8
Language claimed in HTML meta tag should match the language actually used on the web page. Otherwise Starwind.com can be misinterpreted by Google and other search engines. Our service has detected that English is used on the page, and neither this language nor any other was claimed in <html> or <meta> tags. Our system also found out that Starwind.com main page’s claimed encoding is utf-8. Use of this encoding format is the best practice as the main page visitors from all over the world won’t have any issues with symbol transcription.
starwind.com
Open Graph data is detected on the main page of Star Wind. This is the best way to make the web page social media friendly. Here is how it looks like on Facebook: