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5zY3JvbGxJbnRvVmlldygpOwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIGNhc2UgInNldEhlaWdodCI6CiAgICAgICAgICAgIGlmcmFtZS5zdHlsZS5oZWlnaHQgPSBhcmdzWzFdICsgInB4IjsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBjYXNlICJjb2xsYXBzZUVycm9yUGFnZSI6CiAgICAgICAgICAgIGlmIChpZnJhbWUuY2xpZW50SGVpZ2h0ID4gd2luZG93LmlubmVySGVpZ2h0KSB7CiAgICAgICAgICAgICAgaWZyYW1lLnN0eWxlLmhlaWdodCA9IHdpbmRvdy5pbm5lckhlaWdodCArICJweCI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBjYXNlICJyZWxvYWRQYWdlIjoKICAgICAgICAgICAgd2luZG93LmxvY2F0aW9uLnJlbG9hZCgpOwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIGNhc2UgImxvYWRTY3JpcHQiOgogICAgICAgICAgICBpZiggIXdpbmRvdy5pc1Blcm1pdHRlZChlLm9yaWdpbiwgWydqb3Rmb3JtLmNvbScsICdqb3Rmb3JtLnBybyddKSApIHsgYnJlYWs7IH0KICAgICAgICAgICAgdmFyIHNyYyA9IGFyZ3NbMV07CiAgICAgICAgICAgIGlmIChhcmdzLmxlbmd0aCA+IDMpIHsKICAgICAgICAgICAgICAgIHNyYyA9IGFyZ3NbMV0gKyAnOicgKyBhcmdzWzJdOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHZhciBzY3JpcHQgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdzY3JpcHQnKTsKICAgICAgICAgICAgc2NyaXB0LnNyYyA9IHNyYzsKICAgICAgICAgICAgc2NyaXB0LnR5cGUgPSAndGV4dC9qYXZhc2NyaXB0JzsKICAgICAgICAgICAgZG9jdW1lbnQuYm9keS5hcHBlbmRDaGlsZChzY3JpcHQpOwogICAgICAgICAgICBicmVhazsKICAgICAgICAg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