09561 - 2334-0

Ihr Kontakt zu ortho sport coburg

Wir sind direkt für Sie erreichbar

coburg zentrum | op-zentrum

Ketschengasse 22 – 24
96450 Coburg
Tel. 0 95 61 – 23 34-0
Fax 0 95 61 – 23 34-29

stadthaus (privatambulanz)

Ketschengasse 25
96450 Coburg

Unsere Sprechzeiten

Montag bis Freitag:
08.00 – 18.00 Uhr

und nach Vereinbarung

OpenStreetMap

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

Karte laden

ICAgICAgICA8ZGl2IAogICAgICAgICAgICBpZD0ibGVhZmxldC1tYXAtMSIgCiAgICAgICAgICAgIGNsYXNzPSJsZWFmbGV0LW1hcCIgCiAgICAgICAgICAgIHN0eWxlPSJoZWlnaHQ6NDAwcHg7IHdpZHRoOjEwMCU7Ij48L2Rpdj4KICAgICAgICA8c2NyaXB0PgogICAgICAgIHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4gPSB3aW5kb3cuV1BMZWFmbGV0TWFwUGx1Z2luIHx8IFtdOwogICAgICAgIHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4ucHVzaChmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgIHZhciBiYXNlVXJsID0gJ2h0dHBzOi8ve3N9LnRpbGUub3BlbnN0cmVldG1hcC5vcmcve3p9L3t4fS97eX0ucG5nJywKICAgICAgICAgICAgICAgIGJhc2UgPSAoIWJhc2VVcmwgJiYgd2luZG93Lk1RKSA/IAogICAgICAgICAgICAgICAgICAgIE1RLm1hcExheWVyKCkgOiBMLnRpbGVMYXllcihiYXNlVXJsLCB7IAogICAgICAgICAgICAgICAgICAgICAgICBzdWJkb21haW5zOiAnYWJjJwogICAgICAgICAgICAgICAgICAgIH0pLAogICAgICAgICAgICAgICAgb3B0aW9ucyA9IEwuVXRpbC5leHRlbmQoe30sIHsKICAgICAgICAgICAgICAgICAgICBtYXhab29tOiAyMCwKICAgICAgICAgICAgICAgICAgICBtaW5ab29tOiAwLAogICAgICAgICAgICAgICAgICAgIGxheWVyczogW2Jhc2VdLAogICAgICAgICAgICAgICAgICAgIHpvb21Db250cm9sOiAxLAogICAgICAgICAgICAgICAgICAgIHNjcm9sbFdoZWVsWm9vbTogMCwKICAgICAgICAgICAgICAgICAgICBkb3VibGVDbGlja1pvb206IDAsCiAgICAgICAgICAgICAgICAgICAgYXR0cmlidXRpb25Db250cm9sOiBmYWxzZQogICAgICAgICAgICAgICAgfSwge30pLAogICAgICAgICAgICAgICAgbWFwID0gTC5tYXAoJ2xlYWZsZXQtbWFwLTEnLCBvcHRpb25zKQogICAgICAgICAgICAgICAgICAgIC5zZXRWaWV3KFs1MC4yNTY5NTIsMTAuOTY0MTA4XSwxOCk7CiAgICAgICAgICAgIGlmICgwKSB7CiAgICAgICAgICAgICAgICBtYXAuX3Nob3VsZEZpdEJvdW5kcyA9IHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhdHRDb250cm9sID0gTC5jb250cm9sLmF0dHJpYnV0aW9uKHtwcmVmaXg6ZmFsc2V9KS5hZGRUbyhtYXApOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRDb250cm9sLmFkZEF0dHJpYnV0aW9uKCc8YSBocmVmPSJodHRwOi8vbGVhZmxldGpzLmNvbSIgdGl0bGU9IkVpbmUgSmF2YXNjcmlwdC1CaWJsaW90aGVrIGbDvHIgaW50ZXJha3RpdmUgS2FydGVuIj5MZWFmbGV0PC9hPicpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRDb250cm9sLmFkZEF0dHJpYnV0aW9uKCdcclxuwqkgPGEgaHJlZj0iaHR0cDovL3d3dy5vcGVuc3RyZWV0bWFwLm9yZy9jb3B5cmlnaHQiPk9wZW5TdHJlZXRNYXA8L2E+IE1pdHdpcmtlbmRlJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cuV1BMZWFmbGV0TWFwUGx1Z2luLm1hcHMucHVzaChtYXApOwogICAgICAgIH0pOyAvLyBlbmQgYWRkCiAgICAgICAgPC9zY3JpcHQ+PGJyIC8+CiAgICAgICAgPHNjcmlwdD4KICAgICAgICB3aW5kb3cuV1BMZWFmbGV0TWFwUGx1Z2luID0gd2luZG93LldQTGVhZmxldE1hcFBsdWdpbiB8fCBbXTsKICAgICAgICB3aW5kb3cuV1BMZWFmbGV0TWFwUGx1Z2luLnB1c2goZnVuY3Rpb24gKCkgewogICAgICAgICAgICB2YXIgbWFya2VyX29wdGlvbnMgPSAoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgdmFyIF9vcHRpb25zID0ge307CiAgICAgICAgICAgICAgICB2YXIgaWNvbkFycmF5cyA9IFsKICAgICAgICAgICAgICAgICAgICAnaWNvblNpemUnLCAKICAgICAgICAgICAgICAgICAgICAnaWNvbkFuY2hvcicsIAogICAgICAgICAgICAgICAgICAgICdzaGFkb3dTaXplJywgCiAgICAgICAgICAgICAgICAgICAgJ3NoYWRvd0FuY2hvcicsCiAgICAgICAgICAgICAgICAgICAgJ3BvcHVwQW5jaG9yJwogICAgICAgICAgICAgICAgXTsKICAgICAgICAgICAgICAgIHZhciBkZWZhdWx0X2ljb24gPSBMLkljb24uRGVmYXVsdC5wcm90b3R5cGUub3B0aW9uczsKICAgICAgICAgICAgICAgIGlmIChfb3B0aW9ucy5pY29uVXJsKSB7CiAgICAgICAgICAgICAgICAgICAgLy8gYXJyYXlzIGFyZSBzdHJpbmdzLCB1bmZvcnR1bmF0ZWx5Li4uCiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDAsIGxlbiA9IGljb25BcnJheXMubGVuZ3RoOyBpIDwgbGVuOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9wdGlvbl9uYW1lID0gaWNvbkFycmF5c1tpXSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbiA9IF9vcHRpb25zWyBvcHRpb25fbmFtZSBdOwogICAgICAgICAgICAgICAgICAgICAgICAvLyBjb252ZXJ0ICIxLDIiIHRvIFsxLCAyXTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGFyciA9IG9wdGlvbi5qb2luKCcnKS5zcGxpdCgnLCcpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYXJyYXkubWFwIGZvciBpZTw5CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMCwgbGVuSiA9IGFyci5sZW5ndGg7IGogPCBsZW5KOyBqKyspIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnJbal0gPSBOdW1iZXIoYXJyW2pdKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9vcHRpb25zWyBvcHRpb25fbmFtZSBdID0gYXJyOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC8vIGRlZmF1bHQgcG9wdXBBbmNob3IKICAgICAgICAgICAgICAgICAgICBpZiAoIV9vcHRpb25zLnBvcHVwQW5jaG9yKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNldCAocm91Z2hseSkgdG8gc2l6ZSBvZiBpY29uCiAgICAgICAgICAgICAgICAgICAgICAgIF9vcHRpb25zLnBvcHVwQW5jaG9yID0gKGZ1bmN0aW9uIChpX3NpemUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvcHkgYXJyYXkKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlfc2l6ZSA9IGlfc2l6ZS5zbGljZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpbnZlcnNlIGNvb3JkaW5hdGVzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpX3NpemVbMF0gPSAwOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaV9zaXplWzFdICo9IC0xOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYm90dG9tIHBvc2l0aW9uIG9uIHBvcHVwIGlzIDdweAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaV9zaXplWzFdIC09IDM7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaV9zaXplOwogICAgICAgICAgICAgICAgICAgICAgICB9KShfb3B0aW9ucy5pY29uU2l6ZSB8fCBkZWZhdWx0X2ljb24uaWNvblNpemUpOwogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgX29wdGlvbnMuaWNvbiA9IG5ldyBMLkljb24oIF9vcHRpb25zICk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICByZXR1cm4gX29wdGlvbnM7CiAgICAgICAgICAgIH0pKCk7CiAgICAgICAgICAgIHZhciBkcmFnZ2FibGUgPSBtYXJrZXJfb3B0aW9ucy5kcmFnZ2FibGU7CiAgICAgICAgICAgIHZhciBtYXJrZXIgPSBMLm1hcmtlcigKICAgICAgICAgICAgICAgIFs1MC4yNTY5NTIsMTAuOTY0MTA4XSwgCiAgICAgICAgICAgICAgICBtYXJrZXJfb3B0aW9ucwogICAgICAgICAgICApOwogICAgICAgICAgICB2YXIgbWFwID0gd2luZG93LldQTGVhZmxldE1hcFBsdWdpbi5nZXRDdXJyZW50TWFwKCk7CiAgICAgICAgICAgIHZhciBpc19pbWFnZSA9IG1hcC5pc19pbWFnZV9tYXA7CiAgICAgICAgICAgIHZhciBncm91cCA9IHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4uZ2V0Q3VycmVudEdyb3VwKCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkcmFnZ2FibGUpIHsKICAgICAgICAgICAgICAgIG1hcmtlci5vbignZHJhZ2VuZCcsIGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICB2YXIgbGF0bG5nID0gdGhpcy5nZXRMYXRMbmcoKSwKICAgICAgICAgICAgICAgICAgICAgICAgbGF0ID0gbGF0bG5nLmxhdCwKICAgICAgICAgICAgICAgICAgICAgICAgbG5nID0gbGF0bG5nLmxuZzsKICAgICAgICAgICAgICAgICAgICBpZiAoaXNfaW1hZ2UpIHsKICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ2xlYWZsZXQtbWFya2VyIHk9JyArIGxhdCArICcgeD0nICsgbG5nKTsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygnbGVhZmxldC1tYXJrZXIgbGF0PScgKyBsYXQgKyAnIGxuZz0nICsgbG5nKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgfQogICAgICAgICAgICBtYXJrZXIuYWRkVG8oIGdyb3VwICk7CiAgICAgICAgICAgIG1hcmtlci5iaW5kUG9wdXAod2luZG93LldQTGVhZmxldE1hcFBsdWdpbi51bmVzY2FwZSgnT1AtWmVudHJ1bScpKTsgICAgICAgICAgICB3aW5kb3cuV1BMZWFmbGV0TWFwUGx1Z2luLm1hcmtlcnMucHVzaCggbWFya2VyICk7CiAgICAgICAgfSk7IC8vIGVuZCBhZGQgZnVuY3Rpb24KICAgICAgICA8L3NjcmlwdD4KICAgICAgICA8YnIgLz4KICAgICAgICA8c2NyaXB0PgogICAgICAgIHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4gPSB3aW5kb3cuV1BMZWFmbGV0TWFwUGx1Z2luIHx8IFtdOwogICAgICAgIHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4ucHVzaChmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgIHZhciBtYXJrZXJfb3B0aW9ucyA9IChmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICB2YXIgX29wdGlvbnMgPSB7fTsKICAgICAgICAgICAgICAgIHZhciBpY29uQXJyYXlzID0gWwogICAgICAgICAgICAgICAgICAgICdpY29uU2l6ZScsIAogICAgICAgICAgICAgICAgICAgICdpY29uQW5jaG9yJywgCiAgICAgICAgICAgICAgICAgICAgJ3NoYWRvd1NpemUnLCAKICAgICAgICAgICAgICAgICAgICAnc2hhZG93QW5jaG9yJywKICAgICAgICAgICAgICAgICAgICAncG9wdXBBbmNob3InCiAgICAgICAgICAgICAgICBdOwogICAgICAgICAgICAgICAgdmFyIGRlZmF1bHRfaWNvbiA9IEwuSWNvbi5EZWZhdWx0LnByb3RvdHlwZS5vcHRpb25zOwogICAgICAgICAgICAgICAgaWYgKF9vcHRpb25zLmljb25VcmwpIHsKICAgICAgICAgICAgICAgICAgICAvLyBhcnJheXMgYXJlIHN0cmluZ3MsIHVuZm9ydHVuYXRlbHkuLi4KICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMCwgbGVuID0gaWNvbkFycmF5cy5sZW5ndGg7IGkgPCBsZW47IGkrKykgewogICAgICAgICAgICAgICAgICAgICAgICB2YXIgb3B0aW9uX25hbWUgPSBpY29uQXJyYXlzW2ldLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9uID0gX29wdGlvbnNbIG9wdGlvbl9uYW1lIF07CiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvbnZlcnQgIjEsMiIgdG8gWzEsIDJdOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9uKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXJyID0gb3B0aW9uLmpvaW4oJycpLnNwbGl0KCcsJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhcnJheS5tYXAgZm9yIGllPDkKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwLCBsZW5KID0gYXJyLmxlbmd0aDsgaiA8IGxlbko7IGorKykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFycltqXSA9IE51bWJlcihhcnJbal0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgX29wdGlvbnNbIG9wdGlvbl9uYW1lIF0gPSBhcnI7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLy8gZGVmYXVsdCBwb3B1cEFuY2hvcgogICAgICAgICAgICAgICAgICAgIGlmICghX29wdGlvbnMucG9wdXBBbmNob3IpIHsKICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2V0IChyb3VnaGx5KSB0byBzaXplIG9mIGljb24KICAgICAgICAgICAgICAgICAgICAgICAgX29wdGlvbnMucG9wdXBBbmNob3IgPSAoZnVuY3Rpb24gKGlfc2l6ZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29weSBhcnJheQogICAgICAgICAgICAgICAgICAgICAgICAgICAgaV9zaXplID0gaV9zaXplLnNsaWNlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGludmVyc2UgY29vcmRpbmF0ZXMKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlfc2l6ZVswXSA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpX3NpemVbMV0gKj0gLTE7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBib3R0b20gcG9zaXRpb24gb24gcG9wdXAgaXMgN3B4CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpX3NpemVbMV0gLT0gMzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpX3NpemU7CiAgICAgICAgICAgICAgICAgICAgICAgIH0pKF9vcHRpb25zLmljb25TaXplIHx8IGRlZmF1bHRfaWNvbi5pY29uU2l6ZSk7CiAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICBfb3B0aW9ucy5pY29uID0gbmV3IEwuSWNvbiggX29wdGlvbnMgKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHJldHVybiBfb3B0aW9uczsKICAgICAgICAgICAgfSkoKTsKICAgICAgICAgICAgdmFyIGRyYWdnYWJsZSA9IG1hcmtlcl9vcHRpb25zLmRyYWdnYWJsZTsKICAgICAgICAgICAgdmFyIG1hcmtlciA9IEwubWFya2VyKAogICAgICAgICAgICAgICAgWzUwLjI1NjY5LDEwLjk2NDIyXSwgCiAgICAgICAgICAgICAgICBtYXJrZXJfb3B0aW9ucwogICAgICAgICAgICApOwogICAgICAgICAgICB2YXIgbWFwID0gd2luZG93LldQTGVhZmxldE1hcFBsdWdpbi5nZXRDdXJyZW50TWFwKCk7CiAgICAgICAgICAgIHZhciBpc19pbWFnZSA9IG1hcC5pc19pbWFnZV9tYXA7CiAgICAgICAgICAgIHZhciBncm91cCA9IHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4uZ2V0Q3VycmVudEdyb3VwKCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkcmFnZ2FibGUpIHsKICAgICAgICAgICAgICAgIG1hcmtlci5vbignZHJhZ2VuZCcsIGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICB2YXIgbGF0bG5nID0gdGhpcy5nZXRMYXRMbmcoKSwKICAgICAgICAgICAgICAgICAgICAgICAgbGF0ID0gbGF0bG5nLmxhdCwKICAgICAgICAgICAgICAgICAgICAgICAgbG5nID0gbGF0bG5nLmxuZzsKICAgICAgICAgICAgICAgICAgICBpZiAoaXNfaW1hZ2UpIHsKICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ2xlYWZsZXQtbWFya2VyIHk9JyArIGxhdCArICcgeD0nICsgbG5nKTsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygnbGVhZmxldC1tYXJrZXIgbGF0PScgKyBsYXQgKyAnIGxuZz0nICsgbG5nKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgfQogICAgICAgICAgICBtYXJrZXIuYWRkVG8oIGdyb3VwICk7CiAgICAgICAgICAgIG1hcmtlci5iaW5kUG9wdXAod2luZG93LldQTGVhZmxldE1hcFBsdWdpbi51bmVzY2FwZSgnU3RhZHRoYXVzJykpOyAgICAgICAgICAgIHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4ubWFya2Vycy5wdXNoKCBtYXJrZXIgKTsKICAgICAgICB9KTsgLy8gZW5kIGFkZCBmdW5jdGlvbgogICAgICAgIDwvc2NyaXB0PgogICAgICAgIDxiciAvPgogICAgICAgIDxzY3JpcHQ+CiAgICAgICAgd2luZG93LldQTGVhZmxldE1hcFBsdWdpbiA9IHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4gfHwgW107CiAgICAgICAgd2luZG93LldQTGVhZmxldE1hcFBsdWdpbi5wdXNoKGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgdmFyIG1hcmtlcl9vcHRpb25zID0gKGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgIHZhciBfb3B0aW9ucyA9IHt9OwogICAgICAgICAgICAgICAgdmFyIGljb25BcnJheXMgPSBbCiAgICAgICAgICAgICAgICAgICAgJ2ljb25TaXplJywgCiAgICAgICAgICAgICAgICAgICAgJ2ljb25BbmNob3InLCAKICAgICAgICAgICAgICAgICAgICAnc2hhZG93U2l6ZScsIAogICAgICAgICAgICAgICAgICAgICdzaGFkb3dBbmNob3InLAogICAgICAgICAgICAgICAgICAgICdwb3B1cEFuY2hvcicKICAgICAgICAgICAgICAgIF07CiAgICAgICAgICAgICAgICB2YXIgZGVmYXVsdF9pY29uID0gTC5JY29uLkRlZmF1bHQucHJvdG90eXBlLm9wdGlvbnM7CiAgICAgICAgICAgICAgICBpZiAoX29wdGlvbnMuaWNvblVybCkgewogICAgICAgICAgICAgICAgICAgIC8vIGFycmF5cyBhcmUgc3RyaW5ncywgdW5mb3J0dW5hdGVseS4uLgogICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwLCBsZW4gPSBpY29uQXJyYXlzLmxlbmd0aDsgaSA8IGxlbjsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvcHRpb25fbmFtZSA9IGljb25BcnJheXNbaV0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb24gPSBfb3B0aW9uc1sgb3B0aW9uX25hbWUgXTsKICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29udmVydCAiMSwyIiB0byBbMSwgMl07CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb24pIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhcnIgPSBvcHRpb24uam9pbignJykuc3BsaXQoJywnKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFycmF5Lm1hcCBmb3IgaWU8OQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDAsIGxlbkogPSBhcnIubGVuZ3RoOyBqIDwgbGVuSjsgaisrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyW2pdID0gTnVtYmVyKGFycltqXSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfb3B0aW9uc1sgb3B0aW9uX25hbWUgXSA9IGFycjsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAvLyBkZWZhdWx0IHBvcHVwQW5jaG9yCiAgICAgICAgICAgICAgICAgICAgaWYgKCFfb3B0aW9ucy5wb3B1cEFuY2hvcikgewogICAgICAgICAgICAgICAgICAgICAgICAvLyBzZXQgKHJvdWdobHkpIHRvIHNpemUgb2YgaWNvbgogICAgICAgICAgICAgICAgICAgICAgICBfb3B0aW9ucy5wb3B1cEFuY2hvciA9IChmdW5jdGlvbiAoaV9zaXplKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBjb3B5IGFycmF5CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpX3NpemUgPSBpX3NpemUuc2xpY2UoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW52ZXJzZSBjb29yZGluYXRlcwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaV9zaXplWzBdID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlfc2l6ZVsxXSAqPSAtMTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGJvdHRvbSBwb3NpdGlvbiBvbiBwb3B1cCBpcyA3cHgKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlfc2l6ZVsxXSAtPSAzOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlfc2l6ZTsKICAgICAgICAgICAgICAgICAgICAgICAgfSkoX29wdGlvbnMuaWNvblNpemUgfHwgZGVmYXVsdF9pY29uLmljb25TaXplKTsKICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIF9vcHRpb25zLmljb24gPSBuZXcgTC5JY29uKCBfb3B0aW9ucyApOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgcmV0dXJuIF9vcHRpb25zOwogICAgICAgICAgICB9KSgpOwogICAgICAgICAgICB2YXIgZHJhZ2dhYmxlID0gbWFya2VyX29wdGlvbnMuZHJhZ2dhYmxlOwogICAgICAgICAgICB2YXIgbWFya2VyID0gTC5tYXJrZXIoCiAgICAgICAgICAgICAgICBbNTAuMjU2OTEsMTAuOTY0MDgxXSwgCiAgICAgICAgICAgICAgICBtYXJrZXJfb3B0aW9ucwogICAgICAgICAgICApOwogICAgICAgICAgICB2YXIgbWFwID0gd2luZG93LldQTGVhZmxldE1hcFBsdWdpbi5nZXRDdXJyZW50TWFwKCk7CiAgICAgICAgICAgIHZhciBpc19pbWFnZSA9IG1hcC5pc19pbWFnZV9tYXA7CiAgICAgICAgICAgIHZhciBncm91cCA9IHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4uZ2V0Q3VycmVudEdyb3VwKCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkcmFnZ2FibGUpIHsKICAgICAgICAgICAgICAgIG1hcmtlci5vbignZHJhZ2VuZCcsIGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICB2YXIgbGF0bG5nID0gdGhpcy5nZXRMYXRMbmcoKSwKICAgICAgICAgICAgICAgICAgICAgICAgbGF0ID0gbGF0bG5nLmxhdCwKICAgICAgICAgICAgICAgICAgICAgICAgbG5nID0gbGF0bG5nLmxuZzsKICAgICAgICAgICAgICAgICAgICBpZiAoaXNfaW1hZ2UpIHsKICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ2xlYWZsZXQtbWFya2VyIHk9JyArIGxhdCArICcgeD0nICsgbG5nKTsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygnbGVhZmxldC1tYXJrZXIgbGF0PScgKyBsYXQgKyAnIGxuZz0nICsgbG5nKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgfQogICAgICAgICAgICBtYXJrZXIuYWRkVG8oIGdyb3VwICk7CiAgICAgICAgICAgIG1hcmtlci5iaW5kUG9wdXAod2luZG93LldQTGVhZmxldE1hcFBsdWdpbi51bmVzY2FwZSgnUHJheGlzJykpOyAgICAgICAgICAgIHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4ubWFya2Vycy5wdXNoKCBtYXJrZXIgKTsKICAgICAgICB9KTsgLy8gZW5kIGFkZCBmdW5jdGlvbgogICAgICAgIDwvc2NyaXB0PgogICAgICAgIA==