Medau Therapy Services GmbH | Schloss Hohenfels | 96450 Coburg
Medau Therapy Services GmbH | Schloss Hohenfels | 96450 Coburg
MEDAUtherapie Hygiene neu

MEDAUphysio Praxen für Physiotherapie & Krankengymnastik

Ihr Partner für die ganzheitliche physiotherapeutische Behandlung

In den MEDAUphysio Praxen werden Sie von erfahrenen Therapeuten und Therapeutinnen behandelt, die Expertinnen in ihrem jeweiligen Fachgebiet sind. In Kooperation mit der Berufsfachschule für Physiotherapie, der Medau-Schule garantieren wir Ihnen eine optimale Behandlung nach aktuellen wissenschaftlichen Leitlinien. 

OpenStreetMap

Mit dem Laden der Karte akzeptieren Sie die Datenschutzerklärung von OpenStreetMap Foundation.
Mehr erfahren

Karte laden

ICAgICAgICA8ZGl2IGNsYXNzPSJsZWFmbGV0LW1hcCBXUExlYWZsZXRNYXAiCiAgICAgICAgICAgIHN0eWxlPSJoZWlnaHQ6NTAwcHg7IHdpZHRoOjEwMCU7Ij48L2Rpdj4KICAgICAgICA8c2NyaXB0PgogICAgICAgIC8vIHB1c2ggZGVmZXJyZWQgbWFwIGNyZWF0aW9uIGZ1bmN0aW9uCiAgICAgICAgd2luZG93LldQTGVhZmxldE1hcFBsdWdpbiA9IHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4gfHwgW107CiAgICAgICAgd2luZG93LldQTGVhZmxldE1hcFBsdWdpbi5wdXNoKGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgdmFyIGJhc2VVcmwgPSAnaHR0cHM6Ly97c30udGlsZS5vcGVuc3RyZWV0bWFwLm9yZy97en0ve3h9L3t5fS5wbmcnOwogICAgICAgICAgICB2YXIgYmFzZSA9ICghYmFzZVVybCAmJiB3aW5kb3cuTVEpID8gCiAgICAgICAgICAgICAgICBNUS5tYXBMYXllcigpIDogTC50aWxlTGF5ZXIoYmFzZVVybCwgeyAKICAgICAgICAgICAgICAgICAgICBzdWJkb21haW5zOiAnYWJjJywKICAgICAgICAgICAgICAgICAgICBkZXRlY3RSZXRpbmE6IDAsCiAgICAgICAgICAgICAgICAgICAgbWluWm9vbTogMCwKICAgICAgICAgICAgICAgICAgICBtYXhab29tOiAyMCwKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB2YXIgb3B0aW9ucyA9IEwuVXRpbC5leHRlbmQoe30sIHsKICAgICAgICAgICAgICAgICAgICBtYXhab29tOiAyMCwKICAgICAgICAgICAgICAgICAgICBtaW5ab29tOiAwLAogICAgICAgICAgICAgICAgICAgIGxheWVyczogW2Jhc2VdLAogICAgICAgICAgICAgICAgICAgIHpvb21Db250cm9sOiAxLAogICAgICAgICAgICAgICAgICAgIHNjcm9sbFdoZWVsWm9vbTogMCwKICAgICAgICAgICAgICAgICAgICBkb3VibGVDbGlja1pvb206IDAsCiAgICAgICAgICAgICAgICAgICAgYXR0cmlidXRpb25Db250cm9sOiBmYWxzZQogICAgICAgICAgICAgICAgfSwgeyJmaXRCb3VuZHMiOmZhbHNlLCJhdHRyaWJ1dGlvbiI6IjxhIGhyZWY9XCJodHRwOlwvXC9sZWFmbGV0anMuY29tXCIgdGl0bGU9XCJFaW5lIEphdmFzY3JpcHQtQmlibGlvdGhlayBmXHUwMGZjciBpbnRlcmFrdGl2ZSBLYXJ0ZW5cIj5MZWFmbGV0PFwvYT47IFx1MDBhOSA8YSBocmVmPVwiaHR0cDpcL1wvd3d3Lm9wZW5zdHJlZXRtYXAub3JnXC9jb3B5cmlnaHRcIj5PcGVuU3RyZWV0TWFwPFwvYT4gTWl0d2lya2VuZGUifSwgCiAgICAgICAgICAgICAgICB7fSk7CiAgICAgICAgICAgIHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4uY3JlYXRlTWFwKG9wdGlvbnMpCiAgICAgICAgICAgICAgICAuc2V0VmlldyhbNTAuMjM2ODk3ODA2MTYzNzA0LDExLjA0OTA0MTYxMDMyMDk1Ml0sMTIpOwogICAgICAgIH0pOzwvc2NyaXB0PiAgICAgICAgPHNjcmlwdD4KICAgICAgICB3aW5kb3cuV1BMZWFmbGV0TWFwUGx1Z2luID0gd2luZG93LldQTGVhZmxldE1hcFBsdWdpbiB8fCBbXTsKICAgICAgICB3aW5kb3cuV1BMZWFmbGV0TWFwUGx1Z2luLnB1c2goZnVuY3Rpb24gKCkgewogICAgICAgICAgICB2YXIgbWFya2VyX29wdGlvbnMgPSAoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgdmFyIF9vcHRpb25zID0geyJpY29uVXJsIjoiXC93cC1jb250ZW50XC91cGxvYWRzXC8yMDE3XC8xMFwvbWFya2VyLWZtdy1waHlzaW8ucG5nIiwiaWNvblNpemUiOlsiNTEsNTEiXSwiaWNvbkFuY2hvciI6WyIyNS41LDUxIl19OwogICAgICAgICAgICAgICAgdmFyIGljb25BcnJheXMgPSBbCiAgICAgICAgICAgICAgICAgICAgJ2ljb25TaXplJywgCiAgICAgICAgICAgICAgICAgICAgJ2ljb25BbmNob3InLCAKICAgICAgICAgICAgICAgICAgICAnc2hhZG93U2l6ZScsIAogICAgICAgICAgICAgICAgICAgICdzaGFkb3dBbmNob3InLAogICAgICAgICAgICAgICAgICAgICdwb3B1cEFuY2hvcicKICAgICAgICAgICAgICAgIF07CiAgICAgICAgICAgICAgICB2YXIgZGVmYXVsdF9pY29uID0gTC5JY29uLkRlZmF1bHQucHJvdG90eXBlLm9wdGlvbnM7CiAgICAgICAgICAgICAgICBpZiAoX29wdGlvbnMuaWNvblVybCkgewogICAgICAgICAgICAgICAgICAgIC8vIGFycmF5cyBhcmUgc3RyaW5ncywgdW5mb3J0dW5hdGVseS4uLgogICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwLCBsZW4gPSBpY29uQXJyYXlzLmxlbmd0aDsgaSA8IGxlbjsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvcHRpb25fbmFtZSA9IGljb25BcnJheXNbaV0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb24gPSBfb3B0aW9uc1sgb3B0aW9uX25hbWUgXTsKICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29udmVydCAiMSwyIiB0byBbMSwgMl07CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb24pIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhcnIgPSBvcHRpb24uam9pbignJykuc3BsaXQoJywnKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFycmF5Lm1hcCBmb3IgaWU8OQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDAsIGxlbkogPSBhcnIubGVuZ3RoOyBqIDwgbGVuSjsgaisrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyW2pdID0gTnVtYmVyKGFycltqXSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfb3B0aW9uc1sgb3B0aW9uX25hbWUgXSA9IGFycjsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAvLyBkZWZhdWx0IHBvcHVwQW5jaG9yCiAgICAgICAgICAgICAgICAgICAgaWYgKCFfb3B0aW9ucy5wb3B1cEFuY2hvcikgewogICAgICAgICAgICAgICAgICAgICAgICAvLyBzZXQgKHJvdWdobHkpIHRvIHNpemUgb2YgaWNvbgogICAgICAgICAgICAgICAgICAgICAgICBfb3B0aW9ucy5wb3B1cEFuY2hvciA9IChmdW5jdGlvbiAoaV9zaXplKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBjb3B5IGFycmF5CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpX3NpemUgPSBpX3NpemUuc2xpY2UoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW52ZXJzZSBjb29yZGluYXRlcwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaV9zaXplWzBdID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlfc2l6ZVsxXSAqPSAtMTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGJvdHRvbSBwb3NpdGlvbiBvbiBwb3B1cCBpcyA3cHgKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlfc2l6ZVsxXSAtPSAzOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlfc2l6ZTsKICAgICAgICAgICAgICAgICAgICAgICAgfSkoX29wdGlvbnMuaWNvblNpemUgfHwgZGVmYXVsdF9pY29uLmljb25TaXplKTsKICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIF9vcHRpb25zLmljb24gPSBuZXcgTC5JY29uKCBfb3B0aW9ucyApOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgcmV0dXJuIF9vcHRpb25zOwogICAgICAgICAgICB9KSgpOwogICAgICAgICAgICB2YXIgZHJhZ2dhYmxlID0gbWFya2VyX29wdGlvbnMuZHJhZ2dhYmxlOwogICAgICAgICAgICB2YXIgbWFya2VyID0gTC5tYXJrZXIoCiAgICAgICAgICAgICAgICBbNTAuMjU1MDE3LDEwLjk2MjIzNl0sIAogICAgICAgICAgICAgICAgbWFya2VyX29wdGlvbnMKICAgICAgICAgICAgKTsKICAgICAgICAgICAgdmFyIG1hcCA9IHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4uZ2V0Q3VycmVudE1hcCgpOwogICAgICAgICAgICB2YXIgaXNfaW1hZ2UgPSBtYXAuaXNfaW1hZ2VfbWFwOwogICAgICAgICAgICB2YXIgZ3JvdXAgPSB3aW5kb3cuV1BMZWFmbGV0TWFwUGx1Z2luLmdldEN1cnJlbnRHcm91cCgpOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoZHJhZ2dhYmxlKSB7CiAgICAgICAgICAgICAgICBtYXJrZXIub24oJ2RyYWdlbmQnLCBmdW5jdGlvbiAoKSB7CiAgICAgICAgICA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2EmZ3Q7JykpOyAgICAgICAgICAgIHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4ubWFya2Vycy5wdXNoKCBtYXJrZXIgKTsKICAgICAgICB9KTsgLy8gZW5kIGFkZCBmdW5jdGlvbgogICAgICAgIDwvc2NyaXB0PgogICAgICAgICAgICAgICAgPHNjcmlwdD4KICAgICAgICB3aW5kb3cuV1BMZWFmbGV0TWFwUGx1Z2luID0gd2luZG93LldQTGVhZmxldE1hcFBsdWdpbiB8fCBbXTsKICAgICAgICB3aW5kb3cuV1BMZWFmbGV0TWFwUGx1Z2luLnB1c2goZnVuY3Rpb24gKCkgewogICAgICAgICAgICB2YXIgbWFya2VyX29wdGlvbnMgPSAoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgdmFyIF9vcHRpb25zID0geyJpY29uVXJsIjoiXC93cC1jb250ZW50XC91cGxvYWRzXC8yMDE3XC8xMFwvbWFya2VyLWZtdy1waHlzaW8ucG5nIiwiaWNvblNpemUiOlsiNTEsNTEiXSwiaWNvbkFuY2hvciI6WyIyNS41LDUxIl19OwogICAgICAgICAgICAgICAgdmFyIGljb25BcnJheXMgPSBbCiAgICAgICAgICAgICAgICAgICAgJ2ljb25TaXplJywgCiAgICAgICAgICAgICAgICAgICAgJ2ljb25BbmNob3InLCAKICAgICAgICAgICAgICAgICAgICAnc2hhZG93U2l6ZScsIAogICAgICAgICAgICAgICAgICAgICdzaGFkb3dBbmNob3InLAogICAgICAgICAgICAgICAgICAgICdwb3B1cEFuY2hvcicKICAgICAgICAgICAgICAgIF07CiAgICAgICAgICAgICAgICB2YXIgZGVmYXVsdF9pY29uID0gTC5JY29uLkRlZmF1bHQucHJvdG90eXBlLm9wdGlvbnM7CiAgICAgICAgICAgICAgICBpZiAoX29wdGlvbnMuaWNvblVybCkgewogICAgICAgICAgICAgICAgICAgIC8vIGFycmF5cyBhcmUgc3RyaW5ncywgdW5mb3J0dW5hdGVseS4uLgogICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwLCBsZW4gPSBpY29uQXJyYXlzLmxlbmd0aDsgaSA8IGxlbjsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvcHRpb25fbmFtZSA9IGljb25BcnJheXNbaV0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb24gPSBfb3B0aW9uc1sgb3B0aW9uX25hbWUgXTsKICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29udmVydCAiMSwyIiB0byBbMSwgMl07CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb24pIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhcnIgPSBvcHRpb24uam9pbignJykuc3BsaXQoJywnKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFycmF5Lm1hcCBmb3IgaWU8OQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDAsIGxlbkogPSBhcnIubGVuZ3RoOyBqIDwgbGVuSjsgaisrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyW2pdID0gTnVtYmVyKGFycltqXSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfb3B0aW9uc1sgb3B0aW9uX25hbWUgXSA9IGFycjsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAvLyBkZWZhdWx0IHBvcHVwQW5jaG9yCiAgICAgICAgICAgICAgICAgICAgaWYgKCFfb3B0aW9ucy5wb3B1cEFuY2hvcikgewogICAgICAgICAgICAgICAgICAgICAgICAvLyBzZXQgKHJvdWdobHkpIHRvIHNpemUgb2YgaWNvbgogICAgICAgICAgICAgICAgICAgICAgICBfb3B0aW9ucy5wb3B1cEFuY2hvciA9IChmdW5jdGlvbiAoaV9zaXplKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBjb3B5IGFycmF5CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpX3NpemUgPSBpX3NpemUuc2xpY2UoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW52ZXJzZSBjb29yZGluYXRlcwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaV9zaXplWzBdID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlfc2l6ZVsxXSAqPSAtMTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGJvdHRvbSBwb3NpdGlvbiBvbiBwb3B1cCBpcyA3cHgKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlfc2l6ZVsxXSAtPSAzOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlfc2l6ZTsKICAgICAgICAgICAgICAgICAgICAgICAgfSkoX29wdGlvbnMuaWNvblNpemUgfHwgZGVmYXVsdF9pY29uLmljb25TaXplKTsKICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIF9vcHRpb25zLmljb24gPSBuZXcgTC5JY29uKCBfb3B0aW9ucyApOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgcmV0dXJuIF9vcHRpb25zOwogICAgICAgICAgICB9KSgpOwogICAgICAgICAgICB2YXIgZHJhZ2dhYmxlID0gbWFya2VyX29wdGlvbnMuZHJhZ2dhYmxlOwogICAgICAgICAgICB2YXIgbWFya2VyID0gTC5tYXJrZXIoCiAgICAgICAgICAgICAgICBbNTAuMjQ2OTA4LDEwLjk3MTA5M10sIAogICAgICAgICAgICAgICAgbWFya2VyX29wdGlvbnMKICAgICAgICAgICAgKTsKICAgICAgICAgICAgdmFyIG1hcCA9IHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4uZ2V0Q3VycmVudE1hcCgpOwogICAgICAgICAgICB2YXIgaXNfaW1hZ2UgPSBtYXAuaXNfaW1hZ2VfbWFwOwogICAgICAgICA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OjA5NTYxMjM3MzczXCZxdW90OyZndDswOTU2MSA4NTM3MjIyJmx0Oy9hJmd0OyZsdDticiAvJmd0OyZsdDticiZndDtGYXg6IDA5NTYxIDg1MzcyMjMmbHQ7YnIgLyZndDsmbHQ7YnImZ3Q7RS1NYWlsOiAmbHQ7YSBocmVmPVwmcXVvdDttYWlsdG86cHJheGlzLWtldHNjaGVuZG9yZkBtZWRhdS1waHlzaW8uZGVcJnF1b3Q7Jmd0O3ByYXhpcy1rZXRzY2hlbmRvcmZAbWVkYXUtcGh5c2lvLmRlJmx0Oy9hJmd0OycpKTsgICAgICAgICAgICB3aW5kb3cuV1BMZWFmbGV0TWFwUGx1Z2luLm1hcmtlcnMucHVzaCggbWFya2VyICk7CiAgICAgICAgfSk7IC8vIGVuZCBhZGQgZnVuY3Rpb24KICAgICAgICA8L3NjcmlwdD4KICAgICAgICAgICAgICAgIDxzY3JpcHQ+CiAgICAgICAgd2luZG93LldQTGVhZmxldE1hcFBsdWdpbiA9IHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4gfHwgW107CiAgICAgICAgd2luZG93LldQTGVhZmxldE1hcFBsdWdpbi5wdXNoKGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgdmFyIG1hcmtlcl9vcHRpb25zID0gKGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgIHZhciBfb3B0aW9ucyA9IHsiaWNvblVybCI6Ilwvd3AtY29udGVudFwvdXBsb2Fkc1wvMjAxN1wvMTBcL21hcmtlci1mbXctcGh5c2lvLnBuZyIsImljb25TaXplIjpbIjUxLDUxIl0sImljb25BbmNob3IiOlsiMjUuNSw1MSJdfTsKICAgICAgICAgICAgICAgIHZhciBpY29uQXJyYXlzID0gWwogICAgICAgICAgICAgICAgICAgICdpY29uU2l6ZScsIAogICAgICAgICAgICAgICAgICAgICdpY29uQW5jaG9yJywgCiAgICAgICAgICAgICAgICAgICAgJ3NoYWRvd1NpemUnLCAKICAgICAgICAgICAgICAgICAgICAnc2hhZG93QW5jaG9yJywKICAgICAgICAgICAgICAgICAgICAncG9wdXBBbmNob3InCiAgICAgICAgICAgICAgICBdOwogICAgICAgICAgICAgICAgdmFyIGRlZmF1bHRfaWNvbiA9IEwuSWNvbi5EZWZhdWx0LnByb3RvdHlwZS5vcHRpb25zOwogICAgICAgICAgICAgICAgaWYgKF9vcHRpb25zLmljb25VcmwpIHsKICAgICAgICAgICAgICAgICAgICAvLyBhcnJheXMgYXJlIHN0cmluZ3MsIHVuZm9ydHVuYXRlbHkuLi4KICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMCwgbGVuID0gaWNvbkFycmF5cy5sZW5ndGg7IGkgPCBsZW47IGkrKykgewogICAgICAgICAgICAgICAgICAgICAgICB2YXIgb3B0aW9uX25hbWUgPSBpY29uQXJyYXlzW2ldLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9uID0gX29wdGlvbnNbIG9wdGlvbl9uYW1lIF07CiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvbnZlcnQgIjEsMiIgdG8gWzEsIDJdOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9uKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXJyID0gb3B0aW9uLmpvaW4oJycpLnNwbGl0KCcsJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhcnJheS5tYXAgZm9yIGllPDkKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwLCBsZW5KID0gYXJyLmxlbmd0aDsgaiA8IGxlbko7IGorKykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFycltqXSA9IE51bWJlcihhcnJbal0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgX29wdGlvbnNbIG9wdGlvbl9uYW1lIF0gPSBhcnI7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLy8gZGVmYXVsdCBwb3B1cEFuY2hvcgogICAgICAgICAgICAgICAgICAgIGlmICghX29wdGlvbnMucG9wdXBBbmNob3IpIHsKICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2V0IChyb3VnaGx5KSB0byBzaXplIG9mIGljb24KICAgICAgICAgICAgICAgICAgICAgICAgX29wdGlvbnMucG9wdXBBbmNob3IgPSAoZnVuY3Rpb24gKGlfc2l6ZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29weSBhcnJheQogICAgICAgICAgICAgICAgICAgICAgICAgICAgaV9zaXplID0gaV9zaXplLnNsaWNlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGludmVyc2UgY29vcmRpbmF0ZXMKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlfc2l6ZVswXSA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpX3NpemVbMV0gKj0gLTE7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBib3R0b20gcG9zaXRpb24gb24gcG9wdXAgaXMgN3B4CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpX3NpemVbMV0gLT0gMzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpX3NpemU7CiAgICAgICAgICAgICAgICAgICAgICAgIH0pKF9vcHRpb25zLmljb25TaXplIHx8IGRlZmF1bHRfaWNvbi5pY29uU2l6ZSk7CiAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICBfb3B0aW9ucy5pY29uID0gbmV3IEwuSWNvbiggX29wdGlvbnMgKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHJldHVybiBfb3B0aW9uczsKICAgICAgICAgICAgfSkoKTsKICAgICAgICAgICAgdmFyIGRyYWdnYWJsZSA9IG1hcmtlcl9vcHRpb25zLmRyYWdnYWJsZTsKICAgICAgICAgICAgdmFyIG1hcmtlciA9IEwubWFya2VyKAogICAgICAgICAgICAgICAgWzUwLjI2NjUxNTA1NDMxOTQxLDEwLjk0OTI2MzQ2NjY1NjQ3NV0sIAogICAgICAgICAgICAgICAgbWFya2VyX29wdGlvbnMKICAgICAgICAgICAgKTsKICAgICAgICAgICAgdmFyIG1hcCA9IHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4uZ2V0Q3VycmVudE1hcCgpOwogICAgICAgICAgICB2YXIgaXNfaW1hZ2UgPSBtYXAuaXNfaW1hZ2VfbWFwOwogICAgICAgICAgICB2YXIgZ3JvdXAgPSB3aW5kb3cuV1BMZWFmbGV0TWFwUGx1Z2luLmdldEN1cnJlbnRHcm91cCgpOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoZHJhZ2dhYmxlKSB7CiAgICAgICAgICAgICAgICBtYXJrZXIub24oJ2RyYWdlbmQnLCBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIGxhdGxuZyA9IHRoaXMuZ2V0TGF0TG5nKCksCiAgICAgICAgICAgICAgICAgICAgICAgIGxhdCA9IGxhdGxuZy5sYXQsCiAgICAgICAgICAgICAgICAgICAgICAgIGxuZyA9IGxhdGxuZy5sbmc7CiAgICAgICAgICAgICAgICAgICAgaWYgKGlzX2ltYWdlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCdsZWFmbGV0LW1hcmtlciB5PScgKyBsYXQgKyAnIHg9JyArIGxuZyk7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ2xlYWZsZXQtbWFya2VyIGxhdD0nICsgbGF0ICsgJyBsbmc9JyArIGxuZyk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgbWFya2VyLmFkZFRvKCBncm91cCApOwogICAgICA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ucyA9IHsiaWNvblVybCI6Ilwvd3AtY29udGVudFwvdXBsb2Fkc1wvMjAxN1wvMTBcL21hcmtlci1mbXctcGh5c2lvLnBuZyIsImljb25TaXplIjpbIjUxLDUxIl0sImljb25BbmNob3IiOlsiMjUuNSw1MSJdfTsKICAgICAgICAgICAgICAgIHZhciBpY29uQXJyYXlzID0gWwogICAgICAgICAgICAgICAgICAgICdpY29uU2l6ZScsIAogICAgICAgICAgICAgICAgICAgICdpY29uQW5jaG9yJywgCiAgICAgICAgICAgICAgICAgICAgJ3NoYWRvd1NpemUnLCAKICAgICAgICAgICAgICAgICAgICAnc2hhZG93QW5jaG9yJywKICAgICAgICAgICAgICAgICAgICAncG9wdXBBbmNob3InCiAgICAgICAgICAgICAgICBdOwogICAgICAgICAgICAgICAgdmFyIGRlZmF1bHRfaWNvbiA9IEwuSWNvbi5EZWZhdWx0LnByb3RvdHlwZS5vcHRpb25zOwogICAgICAgICAgICAgICAgaWYgKF9vcHRpb25zLmljb25VcmwpIHsKICAgICAgICAgICAgICAgICAgICAvLyBhcnJheXMgYXJlIHN0cmluZ3MsIHVuZm9ydHVuYXRlbHkuLi4KICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMCwgbGVuID0gaWNvbkFycmF5cy5sZW5ndGg7IGkgPCBsZW47IGkrKykgewogICAgICAgICAgICAgICAgICAgICAgICB2YXIgb3B0aW9uX25hbWUgPSBpY29uQXJyYXlzW2ldLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9uID0gX29wdGlvbnNbIG9wdGlvbl9uYW1lIF07CiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvbnZlcnQgIjEsMiIgdG8gWzEsIDJdOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9uKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXJyID0gb3B0aW9uLmpvaW4oJycpLnNwbGl0KCcsJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhcnJheS5tYXAgZm9yIGllPDkKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwLCBsZW5KID0gYXJyLmxlbmd0aDsgaiA8IGxlbko7IGorKykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFycltqXSA9IE51bWJlcihhcnJbal0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgX29wdGlvbnNbIG9wdGlvbl9uYW1lIF0gPSBhcnI7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLy8gZGVmYXVsdCBwb3B1cEFuY2hvcgogICAgICAgICAgICAgICAgICAgIGlmICghX29wdGlvbnMucG9wdXBBbmNob3IpIHsKICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2V0IChyb3VnaGx5KSB0byBzaXplIG9mIGljb24KICAgICAgICAgICAgICAgICAgICAgICAgX29wdGlvbnMucG9wdXBBbmNob3IgPSAoZnVuY3Rpb24gKGlfc2l6ZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29weSBhcnJheQogICAgICAgICAgICAgICAgICAgICAgICAgICAgaV9zaXplID0gaV9zaXplLnNsaWNlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGludmVyc2UgY29vcmRpbmF0ZXMKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlfc2l6ZVswXSA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpX3NpemVbMV0gKj0gLTE7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBib3R0b20gcG9zaXRpb24gb24gcG9wdXAgaXMgN3B4CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpX3NpemVbMV0gLT0gMzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpX3NpemU7CiAgICAgICAgICAgICAgICAgICAgICAgIH0pKF9vcHRpb25zLmljb25TaXplIHx8IGRlZmF1bHRfaWNvbi5pY29uU2l6ZSk7CiAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICBfb3B0aW9ucy5pY29uID0gbmV3IEwuSWNvbiggX29wdGlvbnMgKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHJldHVybiBfb3B0aW9uczsKICAgICAgICAgICAgfSkoKTsKICAgICAgICAgICAgdmFyIGRyYWdnYWJsZSA9IG1hcmtlcl9vcHRpb25zLmRyYWdnYWJsZTsKICAgICAgICAgICAgdmFyIG1hcmtlciA9IEwubWFya2VyKAogICAgICAgICAgICAgICAgWzUwLjI0Nzk0OTIsMTAuOTQ3NjE2ODk5OTk5OTU3XSwgCiAgICAgICAgICAgICAgICBtYXJrZXJfb3B0aW9ucwogICAgICAgICAgICApOwogICAgICAgICAgICB2YXIgbWFwID0gd2luZG93LldQTGVhZmxldE1hcFBsdWdpbi5nZXRDdXJyZW50TWFwKCk7CiAgICAgICAgICAgIHZhciBpc19pbWFnZSA9IG1hcC5pc19pbWFnZV9tYXA7CiAgICAgICAgICAgIHZhciBncm91cCA9IHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4uZ2V0Q3VycmVudEdyb3VwKCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkcmFnZ2FibGUpIHsKICAgICAgICAgICAgICAgIG1hcmtlci5vbignZHJhZ2VuZCcsIGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICB2YXIgbGF0bG5nID0gdGhpcy5nZXRMYXRMbmcoKSwKICAgICAgICAgICAgICAgICAgICAgICAgbGF0ID0gbGF0bG5nLmxhdCwKICAgICAgICAgICAgICAgICAgICAgICAgbG5nID0gbGF0bG5nLmxuZzsKICAgICAgICAgICAgICAgICAgICBpZiAoaXNfaW1hZ2UpIHsKICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS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GVhZmxldE1hcFBsdWdpbiA9IHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4gfHwgW107CiAgICAgICAgd2luZG93LldQTGVhZmxldE1hcFBsdWdpbi5wdXNoKGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgdmFyIG1hcmtlcl9vcHRpb25zID0gKGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgIHZhciBfb3B0aW9ucyA9IHsiaWNvblVybCI6Ilwvd3AtY29udGVudFwvdXBsb2Fkc1wvMjAxN1wvMTBcL21hcmtlci1mbXctcGh5c2lvLnBuZyIsImljb25TaXplIjpbIjUxLDUxIl0sImljb25BbmNob3IiOlsiMjUuNSw1MSJdfTsKICAgICAgICAgICAgICAgIHZhciBpY29uQXJyYXlzID0gWwogICAgICAgICAgICAgICAgICAgICdpY29uU2l6ZScsIAogICAgICAgICAgICAgICAgICAgICdpY29uQW5jaG9yJywgCiAgICAgICAgICAgICAgICAgICAgJ3NoYWRvd1NpemUnLCAKICAgICAgICAgICAgICAgICAgICAnc2hhZG93QW5jaG9yJywKICAgICAgICAgICAgICAgICAgICAncG9wdXBBbmNob3InCiAgICAgICAgICAgICAgICBdOwogICAgICAgICAgICAgICAgdmFyIGRlZmF1bHRfaWNvbiA9IEwuSWNvbi5EZWZhdWx0LnByb3RvdHlwZS5vcHRpb25zOwogICAgICAgICAgICAgICAgaWYgKF9vcHRpb25zLmljb25VcmwpIHsKICAgICAgICAgICAgICAgICAgICAvLyBhcnJheXMgYXJlIHN0cmluZ3MsIHVuZm9ydHVuYXRlbHkuLi4KICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMCwgbGVuID0gaWNvbkFycmF5cy5sZW5ndGg7IGkgPCBsZW47IGkrKykgewogICAgICAgICAgICAgICAgICAgICAgICB2YXIgb3B0aW9uX25hbWUgPSBpY29uQXJyYXlzW2ldLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9uID0gX29wdGlvbnNbIG9wdGlvbl9uYW1lIF07CiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvbnZlcnQgIjEsMiIgdG8gWzEsIDJdOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9uKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXJyID0gb3B0aW9uLmpvaW4oJycpLnNwbGl0KCcsJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhcnJheS5tYXAgZm9yIGllPDkKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwLCBsZW5KID0gYXJyLmxlbmd0aDsgaiA8IGxlbko7IGorKykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFycltqXSA9IE51bWJlcihhcnJbal0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgX29wdGlvbnNbIG9wdGlvbl9uYW1lIF0gPSBhcnI7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLy8gZGVmYXVsdCBwb3B1cEFuY2hvcgogICAgICAgICAgICAgICAgICAgIGlmICghX29wdGlvbnMucG9wdXBBbmNob3IpIHsKICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2V0IChyb3VnaGx5KSB0byBzaXplIG9mIGljb24KICAgICAgICAgICAgICAgICAgICAgICAgX29wdGlvbnMucG9wdXBBbmNob3IgPSAoZnVuY3Rpb24gKGlfc2l6ZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29weSBhcnJheQogICAgICAgICAgICAgICAgICAgICAgICAgICAgaV9zaXplID0gaV9zaXplLnNsaWNlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGludmVyc2UgY29vcmRpbmF0ZXMKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlfc2l6ZVswXSA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpX3NpemVbMV0gKj0gLTE7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBib3R0b20gcG9zaXRpb24gb24gcG9wdXAgaXMgN3B4CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpX3NpemVbMV0gLT0gMzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpX3NpemU7CiAgICAgICAgICAgICAgICAgICAgICAgIH0pKF9vcHRpb25zLmljb25TaXplIHx8IGRlZmF1bHRfaWNvbi5pY29uU2l6ZSk7CiAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICBfb3B0aW9ucy5pY29uID0gbmV3IEwuSWNvbiggX29wdGlvbnMgKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHJldHVybiBfb3B0aW9uczsKICAgICAgICAgICAgfSkoKTsKICAgICAgICAgICAgdmFyIGRyYWdnYWJsZSA9IG1hcmtlcl9vcHRpb25zLmRyYWdnYWJsZTsKICAgICAgICAgICAgdmFyIG1hcmtlciA9IEwubWFya2VyKAogICAgICAgICAgICAgICAgWzUwLjI2NjE5MzIsMTAuOTY5ODI3OV0sIAogICAgICAgICAgICAgICAgbWFya2VyX29wdGlvbnMKICAgICAgICAgICAgKTsKICAgICAgICAgICAgdmFyIG1hcCA9IHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4uZ2V0Q3VycmVudE1hcCgpOwogICAgICAgICAgICB2YXIgaXNfaW1hZ2UgPSBtYXAuaXNfaW1hZ2VfbWFwOwogICAgICAgICAgICB2YXIgZ3JvdXAgPSB3aW5kb3cuV1BMZWFmbGV0TWFwUGx1Z2luLmdldEN1cnJlbnRHcm91cCgpOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoZHJhZ2dhYmxlKSB7CiAgICAgICAgICAgICAgICBtYXJrZXIub24oJ2RyYWdlbmQnLCBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgIC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lYWZsZXRNYXBQbHVnaW4ubWFya2Vycy5wdXNoKCBtYXJrZXIgKTsKICAgICAgICB9KTsgLy8gZW5kIGFkZCBmdW5jdGlvbgogICAgICAgIDwvc2NyaXB0PgogICAgICAgICAgICAgICAgPHNjcmlwdD4KICAgICAgICB3aW5kb3cuV1BMZWFmbGV0TWFwUGx1Z2luID0gd2luZG93LldQTGVhZmxldE1hcFBsdWdpbiB8fCBbXTsKICAgICAgICB3aW5kb3cuV1BMZWFmbGV0TWFwUGx1Z2luLnB1c2goZnVuY3Rpb24gKCkgewogICAgICAgICAgICB2YXIgbWFya2VyX29wdGlvbnMgPSAoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgdmFyIF9vcHRpb25zID0geyJpY29uVXJsIjoiXC93cC1jb250ZW50XC91cGxvYWRzXC8yMDE3XC8xMFwvbWFya2VyLWZtdy1waHlzaW8ucG5nIiwiaWNvblNpemUiOlsiNTEsNTEiXSwiaWNvbkFuY2hvciI6WyIyNSw1MSJdfTsKICAgICAgICAgICAgICAgIHZhciBpY29uQXJyYXlzID0gWwogICAgICAgICAgICAgICAgICAgICdpY29uU2l6ZScsIAogICAgICAgICAgICAgICAgICAgICdpY29uQW5jaG9yJywgCiAgICAgICAgICAgICAgICAgICAgJ3NoYWRvd1NpemUnLCAKICAgICAgICAgICAgICAgICAgICAnc2hhZG93QW5jaG9yJywKICAgICAgICAgICAgICAgICAgICAncG9wdXBBbmNob3InCiAgICAgICAgICAgICAgICBdOwogICAgICAgICAgICAgICAgdmFyIGRlZmF1bHRfaWNvbiA9IEwuSWNvbi5EZWZhdWx0LnByb3RvdHlwZS5vcHRpb25zOwogICAgICAgICAgICAgICAgaWYgKF9vcHRpb25zLmljb25VcmwpIHsKICAgICAgICAgICAgICAgICAgICAvLyBhcnJheXMgYXJlIHN0cmluZ3MsIHVuZm9ydHVuYXRlbHkuLi4KICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMCwgbGVuID0gaWNvbkFycmF5cy5sZW5ndGg7IGkgPCBsZW47IGkrKykgewogICAgICAgICAgICAgICAgICAgICAgICB2YXIgb3B0aW9uX25hbWUgPSBpY29uQXJyYXlzW2ldLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9uID0gX29wdGlvbnNbIG9wdGlvbl9uYW1lIF07CiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvbnZlcnQgIjEsMiIgdG8gWzEsIDJdOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9uKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXJyID0gb3B0aW9uLmpvaW4oJycpLnNwbGl0KCcsJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhcnJheS5tYXAgZm9yIGllPDkKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwLCBsZW5KID0gYXJyLmxlbmd0aDsgaiA8IGxlbko7IGorKykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFycltqXSA9IE51bWJlcihhcnJbal0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgX29wdGlvbnNbIG9wdGlvbl9uYW1lIF0gPSBhcnI7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLy8gZGVmYXVsdCBwb3B1cEFuY2hvcgogICAgICAgICAgICAgICAgICAgIGlmICghX29wdGlvbnMucG9wdXBBbmNob3IpIHsKICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2V0IChyb3VnaGx5KSB0byBzaXplIG9mIGljb24KICAgICAgICAgICAgICAgICAgICAgICAgX29wdGlvbnMucG9wdXBBbmNob3IgPSAoZnVuY3Rpb24gKGlfc2l6ZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29weSBhcnJheQogICAgICAgICAgICAgICAgICAgICAgICAgICAgaV9zaXplID0gaV9zaXplLnNsaWNlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGludmVyc2UgY29vcmRpbmF0ZXMKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlfc2l6ZVswXSA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpX3NpemVbMV0gKj0gLTE7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBib3R0b20gcG9zaXRpb24gb24gcG9wdXAgaXMgN3B4CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpX3NpemVbMV0gLT0gMzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpX3NpemU7CiAgICAgICAgICAgICAgICAgICAgICAgIH0pKF9vcHRpb25zLmljb25TaXplIHx8IGRlZmF1bHRfaWNvbi5pY29uU2l6ZSk7CiAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICBfb3B0aW9ucy5pY29uID0gbmV3IEwuSWNvbiggX29wdGlvbnMgKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHJldHVybiBfb3B0aW9uczsKICAgICAgICAgICAgfSkoKTsKICAgICAgICAgICAgdmFyIGRyYWdnYWJsZSA9IG1hcmtlcl9vcHRpb25zLmRyYWdnYWJsZTsKICAgICAgICAgICAgdmFyIG1hcmtlciA9IEwubWFya2VyKAogICAgICAgICAgICAgICAgWzUwLjIxNzc0ODEsMTEuMTQxNTk1OF0sIAogICAgICAgICAgICAgICAgbWFya2VyX29wdGlvbnMKICAgICAgICAgICAgKTsKICAgICAgICAgICAgdmFyIG1hcCA9IHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4uZ2V0Q3VycmVudE1hcCgpOwogICAgICAgICAgICB2YXIgaXNfaW1hZ2UgPSBtYXAuaXNfaW1hZ2VfbWFwOwogICAgICAgICAgICB2YXIgZ3JvdXAgPSB3aW5kb3cuV1BMZWFmbGV0TWFw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